ompchamber 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -8
- package/dist/client/index.html +1 -1
- package/dist/client/static/css/index.5c0447cefe.css +2 -0
- package/dist/client/static/js/async/{3y.4c2596f64c.js → 3y.71f2ccf3b6.js} +2 -2
- package/dist/client/static/js/async/{xw.ae67ba06fd.js → 5b.0d6ae50fe8.js} +10 -10
- package/dist/client/static/js/async/5bh.8b2363424f.js +1 -0
- package/dist/client/static/js/async/{vy.bbe114c4e0.js → bi.09688ba75c.js} +1 -2
- package/dist/client/static/js/async/c.797d933882.js +1 -0
- package/dist/client/static/js/async/{dc.6dc4b0a04b.js → dc.856fda6560.js} +2 -2
- package/dist/client/static/js/async/{g.8515cbc6f7.js → g.d1c2fe09aa.js} +2 -2
- package/dist/client/static/js/async/g.d1c2fe09aa.js.LICENSE.txt +11 -0
- package/dist/client/static/js/async/{m.4b29d34f93.js → m.0896dab823.js} +2 -2
- package/dist/client/static/js/async/ma.2c261b04dd.js +2 -0
- package/dist/client/static/js/async/nam.b5663e919f.js +10 -0
- package/dist/client/static/js/async/nam.b5663e919f.js.LICENSE.txt +11 -0
- package/dist/client/static/js/async/{q.542c184fec.js → q.23af2a358f.js} +3 -3
- package/dist/client/static/js/async/{s.413c2a4683.js → s.222ee974f6.js} +2 -2
- package/dist/client/static/js/async/t.4dca0e2ba8.js +1 -0
- package/dist/client/static/js/async/uf.46ad6209fa.js +2 -0
- package/dist/client/static/js/async/x4.69ec69c61b.js +6 -0
- package/dist/client/static/js/async/xn.6360379f71.js +2 -0
- package/dist/client/static/js/async/xnl.feb0021e50.js +2 -0
- package/dist/client/static/js/index.dc5f5fabe8.js +33 -0
- package/dist/client/static/js/{uy.2e8929ed0c.js → jp.50817896f3.js} +6 -6
- package/package.json +3 -1
- package/src/cli/lib/args.js +1 -1
- package/src/cli/lib/commands/restart.js +11 -0
- package/src/cli/lib/commands/update.js +21 -7
- package/src/cli/lib/runtime.js +6 -3
- package/src/client/components/common/MarkdownRenderer.tsx +69 -27
- package/src/client/components/common/code-editor/history.test.ts +118 -0
- package/src/client/components/common/code-editor/history.ts +101 -0
- package/src/client/components/common/code-editor/index.tsx +56 -66
- package/src/client/components/common/code-surface/index.tsx +84 -11
- package/src/client/components/common/code-surface/measure.ts +66 -17
- package/src/client/components/common/diagram-viewer/index.tsx +258 -0
- package/src/client/components/common/diagram-viewer/read-block.ts +53 -0
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +1 -0
- package/src/client/components/layout/session-sidebar/SessionItem.tsx +10 -3
- package/src/client/components/settings/LazyModal.tsx +1 -1
- package/src/client/components/settings/Modal.tsx +2 -1
- package/src/client/components/workspace/chat-timeline/ToolCallCard.tsx +8 -1
- package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +11 -52
- package/src/client/components/workspace/chat-timeline/chat-input/selection.ts +57 -0
- package/src/client/components/workspace/chat-timeline/index.tsx +121 -107
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FrameControl.tsx +172 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock.tsx +155 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/drafts.ts +113 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +92 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/{ask-dialog → extension-dialog}/Footer.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/{ask-dialog → extension-dialog}/Header.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/{ask-dialog → extension-dialog}/Lazy.tsx +8 -8
- package/src/client/components/workspace/chat-timeline/tool-renderers/{ask-dialog → extension-dialog}/SelectBody.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/{ask-dialog → extension-dialog}/index.tsx +16 -10
- package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +2 -2
- package/src/client/components/workspace/file-explorer/index.tsx +18 -5
- package/src/client/hooks/chat/omp/index.ts +4 -109
- package/src/client/hooks/chat/omp/prompt-send.ts +161 -0
- package/src/client/hooks/chat/omp/session-list.tsx +4 -0
- package/src/client/hooks/chat/timeline/actions.ts +0 -9
- package/src/client/hooks/chat/timeline/ask-frames.ts +102 -0
- package/src/client/hooks/chat/timeline/extension-dialog.ts +12 -9
- package/src/client/hooks/chat/timeline/index.ts +6 -8
- package/src/client/hooks/chat/timeline/prompt-text.ts +35 -0
- package/src/client/hooks/chat/timeline/send.ts +16 -29
- package/src/client/hooks/chat/timeline/session-load.ts +48 -106
- package/src/client/hooks/chat/timeline/session-pagination.ts +144 -0
- package/src/client/hooks/editor/use-code-window.ts +118 -0
- package/src/client/hooks/ui/input-required-alert.ts +43 -0
- package/src/client/hooks/ui/notification-sound.ts +65 -0
- package/src/client/hooks/ui/theme.ts +22 -6
- package/src/client/tailwind.css +38 -12
- package/src/server/index.ts +4 -3
- package/src/server/lib/lifecycle/bun.ts +18 -0
- package/src/server/lib/lifecycle/launch-mode.test.ts +32 -0
- package/src/server/lib/lifecycle/launch-mode.ts +40 -0
- package/src/server/lib/lifecycle/restart.test.ts +21 -0
- package/src/server/lib/lifecycle/restart.ts +111 -0
- package/src/server/lib/omp/rpc/manager.ts +14 -3
- package/src/server/lib/omp/rpc/session-commands.ts +15 -1
- package/src/server/lib/omp/rpc/session-registry.ts +18 -0
- package/src/server/lib/omp/session/sidebar-data.server.ts +7 -1
- package/src/server/lib/updates/apply.ts +8 -5
- package/src/server/lib/updates/install.ts +7 -4
- package/src/server/routes/health/probe.ts +2 -1
- package/src/shared/lib/chat/ask-questions.test.ts +169 -0
- package/src/shared/lib/chat/ask-questions.ts +264 -0
- package/src/shared/lib/code/lazy-window.test.ts +161 -0
- package/src/shared/lib/code/lazy-window.ts +156 -0
- package/src/shared/lib/code/syntax-highlight.test.ts +50 -1
- package/src/shared/lib/code/syntax-highlight.ts +14 -1
- package/src/shared/lib/code/windowed-highlight.ts +63 -0
- package/src/shared/lib/markdown/mermaid.ts +8 -6
- package/src/shared/lib/omp/session/stream-state.server.ts +16 -1
- package/src/shared/types/omp/agent.ts +2 -2
- package/src/shared/types/workspace.ts +4 -0
- package/dist/client/static/css/index.51f68210a5.css +0 -2
- package/dist/client/static/js/async/5b.d88304bc13.js +0 -1
- package/dist/client/static/js/async/c.cd45b0ac45.js +0 -1
- package/dist/client/static/js/async/fw.6a51998a8e.js +0 -6
- package/dist/client/static/js/async/kc.bbdb35b771.js +0 -1
- package/dist/client/static/js/async/mw.ca1512563c.js +0 -10
- package/dist/client/static/js/async/rf.d626afc367.js +0 -2
- package/dist/client/static/js/async/t.cda4891526.js +0 -1
- package/dist/client/static/js/async/uf.24ca3d49c3.js +0 -2
- package/dist/client/static/js/async/v0.394ed37c6b.js +0 -2
- package/dist/client/static/js/async/v0.394ed37c6b.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/vy.bbe114c4e0.js.LICENSE.txt +0 -6
- package/dist/client/static/js/async/xn.afecebbbd9.js +0 -2
- package/dist/client/static/js/index.47d3b04d5f.js +0 -33
- package/dist/client/static/js/index.47d3b04d5f.js.LICENSE.txt +0 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Ask.tsx +0 -205
- /package/dist/client/static/js/async/{3y.4c2596f64c.js.LICENSE.txt → 3y.71f2ccf3b6.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{g.8515cbc6f7.js.LICENSE.txt → 5b.0d6ae50fe8.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{dc.6dc4b0a04b.js.LICENSE.txt → dc.856fda6560.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{fw.6a51998a8e.js.LICENSE.txt → m.0896dab823.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{m.4b29d34f93.js.LICENSE.txt → ma.2c261b04dd.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{mw.ca1512563c.js.LICENSE.txt → q.23af2a358f.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{q.542c184fec.js.LICENSE.txt → s.222ee974f6.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{rf.d626afc367.js.LICENSE.txt → uf.46ad6209fa.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{s.413c2a4683.js.LICENSE.txt → x4.69ec69c61b.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{uf.24ca3d49c3.js.LICENSE.txt → xn.6360379f71.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/async/{xn.afecebbbd9.js.LICENSE.txt → xnl.feb0021e50.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/{async/xw.ae67ba06fd.js.LICENSE.txt → index.dc5f5fabe8.js.LICENSE.txt} +0 -0
- /package/dist/client/static/js/{uy.2e8929ed0c.js.LICENSE.txt → jp.50817896f3.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! LICENSE: 3y.
|
|
1
|
+
/*! LICENSE: 3y.71f2ccf3b6.js.LICENSE.txt */
|
|
2
2
|
(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["3y"],{XQ(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BLANK_URL=e.relativeFirstCharacters=e.whitespaceEscapeCharsRegex=e.urlSchemeRegex=e.ctrlCharactersRegex=e.htmlCtrlEntityRegex=e.htmlEntitiesRegex=e.invalidProtocolRegex=void 0,e.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,e.htmlCtrlEntityRegex=/&(newline|tab);/gi,e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,e.urlSchemeRegex=/^.+(:|:)/gim,e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,e.relativeFirstCharacters=[".","/"],e.BLANK_URL="about:blank"},tP(t,e,r){"use strict";e.J=function(t){if(!t)return i.BLANK_URL;var e,r=o(t.trim());do e=(r=o(r=r.replace(i.ctrlCharactersRegex,"").replace(i.htmlEntitiesRegex,function(t,e){return String.fromCharCode(e)}).replace(i.htmlCtrlEntityRegex,"").replace(i.ctrlCharactersRegex,"").replace(i.whitespaceEscapeCharsRegex,"").trim())).match(i.ctrlCharactersRegex)||r.match(i.htmlEntitiesRegex)||r.match(i.htmlCtrlEntityRegex)||r.match(i.whitespaceEscapeCharsRegex);while(e&&e.length>0)var a=r;if(!a)return i.BLANK_URL;if(i.relativeFirstCharacters.indexOf(a[0])>-1)return a;var s=a.trimStart(),n=s.match(i.urlSchemeRegex);if(!n)return a;var l=n[0].toLowerCase().trim();if(i.invalidProtocolRegex.test(l))return i.BLANK_URL;var h=s.replace(/\\/g,"/");if("mailto:"===l||l.includes("://"))return h;if("http:"===l||"https:"===l){if(!URL.canParse(h))return i.BLANK_URL;var c=new URL(h);return c.protocol=c.protocol.toLowerCase(),c.hostname=c.hostname.toLowerCase(),c.toString()}return h};var i=r("XQ");function o(t){try{return decodeURIComponent(t)}catch(e){return t}}},h0(t){t.exports=function(){"use strict";var t="millisecond",e="second",r="minute",i="hour",o="week",a="month",s="quarter",n="year",l="date",h="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=function(t,e,r){var i=String(t);return!i||i.length>=e?t:""+Array(e+1-i.length).join(r)+t},g="en",p={};p[g]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}};var f="$isDayjsObject",y=function(t){return t instanceof b||!(!t||!t[f])},m=function t(e,r,i){var o;if(!e)return g;if("string"==typeof e){var a=e.toLowerCase();p[a]&&(o=a),r&&(p[a]=r,o=a);var s=e.split("-");if(!o&&s.length>1)return t(s[0])}else{var n=e.name;p[n]=e,o=n}return!i&&o&&(g=o),o||!i&&g},C=function(t,e){if(y(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new b(r)},x={s:u,z:function(t){var e=-t.utcOffset(),r=Math.abs(e);return(e<=0?"+":"-")+u(Math.floor(r/60),2,"0")+":"+u(r%60,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var i=12*(r.year()-e.year())+(r.month()-e.month()),o=e.clone().add(i,a),s=r-o<0,n=e.clone().add(i+(s?-1:1),a);return+(-(i+(r-o)/(s?o-n:n-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return({M:a,y:n,w:o,d:"day",D:l,h:i,m:r,s:e,ms:t,Q:s})[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}};x.l=m,x.i=y,x.w=function(t,e){return C(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var b=function(){function u(t){this.$L=m(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[f]=!0}var g=u.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(0/0);if(x.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var i=e.match(c);if(i){var o=i[2]-1||0,a=(i[7]||"0").substring(0,3);return r?new Date(Date.UTC(i[1],o,i[3]||1,i[4]||0,i[5]||0,i[6]||0,a)):new Date(i[1],o,i[3]||1,i[4]||0,i[5]||0,i[6]||0,a)}}return new Date(e)}(t),this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return x},g.isValid=function(){return this.$d.toString()!==h},g.isSame=function(t,e){var r=C(t);return this.startOf(e)<=r&&r<=this.endOf(e)},g.isAfter=function(t,e){return C(t)<this.startOf(e)},g.isBefore=function(t,e){return this.endOf(e)<C(t)},g.$g=function(t,e,r){return x.u(t)?this[e]:this.set(r,t)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(t,s){var h=this,c=!!x.u(s)||s,d=x.p(t),u=function(t,e){var r=x.w(h.$u?Date.UTC(h.$y,e,t):new Date(h.$y,e,t),h);return c?r:r.endOf("day")},g=function(t,e){return x.w(h.toDate()[t].apply(h.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(e)),h)},p=this.$W,f=this.$M,y=this.$D,m="set"+(this.$u?"UTC":"");switch(d){case n:return c?u(1,0):u(31,11);case a:return c?u(1,f):u(0,f+1);case o:var C=this.$locale().weekStart||0,b=(p<C?p+7:p)-C;return u(c?y-b:y+(6-b),f);case"day":case l:return g(m+"Hours",0);case i:return g(m+"Minutes",1);case r:return g(m+"Seconds",2);case e:return g(m+"Milliseconds",3);default:return this.clone()}},g.endOf=function(t){return this.startOf(t,!1)},g.$set=function(o,s){var h,c=x.p(o),d="set"+(this.$u?"UTC":""),u=((h={}).day=d+"Date",h[l]=d+"Date",h[a]=d+"Month",h[n]=d+"FullYear",h[i]=d+"Hours",h[r]=d+"Minutes",h[e]=d+"Seconds",h[t]=d+"Milliseconds",h)[c],g="day"===c?this.$D+(s-this.$W):s;if(c===a||c===n){var p=this.clone().set(l,1);p.$d[u](g),p.init(),this.$d=p.set(l,Math.min(this.$D,p.daysInMonth())).$d}else u&&this.$d[u](g);return this.init(),this},g.set=function(t,e){return this.clone().$set(t,e)},g.get=function(t){return this[x.p(t)]()},g.add=function(t,s){var l,h=this;t=Number(t);var c=x.p(s),d=function(e){var r=C(h);return x.w(r.date(r.date()+Math.round(e*t)),h)};if(c===a)return this.set(a,this.$M+t);if(c===n)return this.set(n,this.$y+t);if("day"===c)return d(1);if(c===o)return d(7);var u=((l={})[r]=6e4,l[i]=36e5,l[e]=1e3,l)[c]||1,g=this.$d.getTime()+t*u;return x.w(g,this)},g.subtract=function(t,e){return this.add(-1*t,e)},g.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||h;var i=t||"YYYY-MM-DDTHH:mm:ssZ",o=x.z(this),a=this.$H,s=this.$m,n=this.$M,l=r.weekdays,c=r.months,u=r.meridiem,g=function(t,r,o,a){return t&&(t[r]||t(e,i))||o[r].slice(0,a)},p=function(t){return x.s(a%12||12,t,"0")},f=u||function(t,e,r){var i=t<12?"AM":"PM";return r?i.toLowerCase():i};return i.replace(d,function(t,i){return i||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return x.s(e.$y,4,"0");case"M":return n+1;case"MM":return x.s(n+1,2,"0");case"MMM":return g(r.monthsShort,n,c,3);case"MMMM":return g(c,n);case"D":return e.$D;case"DD":return x.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return g(r.weekdaysMin,e.$W,l,2);case"ddd":return g(r.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(a);case"HH":return x.s(a,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return f(a,s,!0);case"A":return f(a,s,!1);case"m":return String(s);case"mm":return x.s(s,2,"0");case"s":return String(e.$s);case"ss":return x.s(e.$s,2,"0");case"SSS":return x.s(e.$ms,3,"0");case"Z":return o}return null}(t)||o.replace(":","")})},g.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},g.diff=function(t,l,h){var c,d=this,u=x.p(l),g=C(t),p=(g.utcOffset()-this.utcOffset())*6e4,f=this-g,y=function(){return x.m(d,g)};switch(u){case n:c=y()/12;break;case a:c=y();break;case s:c=y()/3;break;case o:c=(f-p)/6048e5;break;case"day":c=(f-p)/864e5;break;case i:c=f/36e5;break;case r:c=f/6e4;break;case e:c=f/1e3;break;default:c=f}return h?c:x.a(c)},g.daysInMonth=function(){return this.endOf(a).$D},g.$locale=function(){return p[this.$L]},g.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),i=m(t,e,!0);return i&&(r.$L=i),r},g.clone=function(){return x.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},u}(),k=b.prototype;return C.prototype=k,[["$ms",t],["$s",e],["$m",r],["$H",i],["$W","day"],["$M",a],["$y",n],["$D",l]].forEach(function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),C.extend=function(t,e){return t.$i||(t(e,b,C),t.$i=!0),C},C.locale=m,C.isDayjs=y,C.unix=function(t){return C(1e3*t)},C.en=p[g],C.Ls=p,C.p={},C}()},nh(t,e,r){"use strict";function i(t,e,r){if(t&&t.length){let[i,o]=e,a=Math.PI/180*r,s=Math.cos(a),n=Math.sin(a);for(let e of t){let[t,r]=e;e[0]=(t-i)*s-(r-o)*n+i,e[1]=(t-i)*n+(r-o)*s+o}}}function o(t,e){var r;let o=e.hachureAngle+90,a=e.hachureGap;a<0&&(a=4*e.strokeWidth),a=Math.round(Math.max(a,.1));let s=1;return e.roughness>=1&&((null==(r=e.randomizer)?void 0:r.next())||Math.random())>.7&&(s=a),function(t,e,r,o=1){let a=Math.max(e,.1),s=t[0]&&t[0][0]&&"number"==typeof t[0][0]?[t]:t,n=[0,0];if(r)for(let t of s)i(t,n,r);let l=function(t,e,r){let i=[];for(let e of t){var o,a;let t=[...e];o=t[0],a=t[t.length-1],o[0]===a[0]&&o[1]===a[1]||t.push([t[0][0],t[0][1]]),t.length>2&&i.push(t)}let s=[];e=Math.max(e,.1);let n=[];for(let t of i)for(let e=0;e<t.length-1;e++){let r=t[e],i=t[e+1];if(r[1]!==i[1]){let t=Math.min(r[1],i[1]);n.push({ymin:t,ymax:Math.max(r[1],i[1]),x:t===r[1]?r[0]:i[0],islope:(i[0]-r[0])/(i[1]-r[1])})}}if(n.sort((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax)),!n.length)return s;let l=[],h=n[0].ymin,c=0;for(;l.length||n.length;){if(n.length){let t=-1;for(let e=0;e<n.length&&!(n[e].ymin>h);e++)t=e;n.splice(0,t+1).forEach(t=>{l.push({s:h,edge:t})})}if((l=l.filter(t=>!(t.edge.ymax<=h))).sort((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x)),(1!==r||c%e==0)&&l.length>1)for(let t=0;t<l.length;t+=2){let e=t+1;if(e>=l.length)break;let r=l[t].edge,i=l[e].edge;s.push([[Math.round(r.x),h],[Math.round(i.x),h]])}h+=r,l.forEach(t=>{t.edge.x=t.edge.x+r*t.edge.islope}),c++}return s}(s,a,o);if(r){let t;for(let t of s)i(t,n,-r);t=[],l.forEach(e=>t.push(...e)),i(t,n,-r)}return l}(t,a,o,s||1)}class a{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){let r=o(t,e);return{type:"fillSketch",ops:this.renderLines(r,e)}}renderLines(t,e){let r=[];for(let i of t)r.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],e));return r}}function s(t){let e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class n extends a{fillPolygons(t,e){let r=e.hachureGap;r<0&&(r=4*e.strokeWidth);let i=o(t,Object.assign({},e,{hachureGap:r=Math.max(r,.1)})),a=Math.PI/180*e.hachureAngle,n=[],l=.5*r*Math.cos(a),h=.5*r*Math.sin(a);for(let[t,e]of i)s([t,e])&&n.push([[t[0]-l,t[1]+h],[...e]],[[t[0]+l,t[1]-h],[...e]]);return{type:"fillSketch",ops:this.renderLines(n,e)}}}class l extends a{fillPolygons(t,e){let r=this._fillPolygons(t,e),i=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),o=this._fillPolygons(t,i);return r.ops=r.ops.concat(o.ops),r}}class h{constructor(t){this.helper=t}fillPolygons(t,e){let r=o(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(r,e)}dotsOnLines(t,e){let r=[],i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);let o=e.fillWeight;o<0&&(o=e.strokeWidth/2);let a=i/4;for(let n of t){let t=s(n),l=Math.ceil(t/i)-1,h=t-l*i,c=(n[0][0]+n[1][0])/2-i/4,d=Math.min(n[0][1],n[1][1]);for(let t=0;t<l;t++){let s=c-a+2*Math.random()*a,n=d+h+t*i-a+2*Math.random()*a,l=this.helper.ellipse(s,n,o,o,e);r.push(...l.ops)}}return{type:"fillSketch",ops:r}}}class c{constructor(t){this.helper=t}fillPolygons(t,e){let r=o(t,e);return{type:"fillSketch",ops:this.dashedLine(r,e)}}dashedLine(t,e){let r=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,i=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,o=[];return t.forEach(t=>{let a=s(t),n=Math.floor(a/(r+i)),l=(a+i-n*(r+i))/2,h=t[0],c=t[1];h[0]>c[0]&&(h=t[1],c=t[0]);let d=Math.atan((c[1]-h[1])/(c[0]-h[0]));for(let t=0;t<n;t++){let a=t*(r+i),s=a+r,n=[h[0]+a*Math.cos(d)+l*Math.cos(d),h[1]+a*Math.sin(d)+l*Math.sin(d)],c=[h[0]+s*Math.cos(d)+l*Math.cos(d),h[1]+s*Math.sin(d)+l*Math.sin(d)];o.push(...this.helper.doubleLineOps(n[0],n[1],c[0],c[1],e))}}),o}}class d{constructor(t){this.helper=t}fillPolygons(t,e){let r=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,i=e.zigzagOffset<0?r:e.zigzagOffset,a=o(t,e=Object.assign({},e,{hachureGap:r+i}));return{type:"fillSketch",ops:this.zigzagLines(a,i,e)}}zigzagLines(t,e,r){let i=[];return t.forEach(t=>{let o=Math.round(s(t)/(2*e)),a=t[0],n=t[1];a[0]>n[0]&&(a=t[1],n=t[0]);let l=Math.atan((n[1]-a[1])/(n[0]-a[0]));for(let t=0;t<o;t++){let o=2*t*e,s=2*(t+1)*e,n=Math.sqrt(2*Math.pow(e,2)),h=[a[0]+o*Math.cos(l),a[1]+o*Math.sin(l)],c=[a[0]+s*Math.cos(l),a[1]+s*Math.sin(l)],d=[h[0]+n*Math.cos(l+Math.PI/4),h[1]+n*Math.sin(l+Math.PI/4)];i.push(...this.helper.doubleLineOps(h[0],h[1],d[0],d[1],r),...this.helper.doubleLineOps(d[0],d[1],c[0],c[1],r))}}),i}}let u={};class g{constructor(t){this.seed=t}next(){return this.seed?(0x7fffffff&(this.seed=Math.imul(48271,this.seed)))/0x80000000:Math.random()}}let p={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function f(t){let e=[],r=function(t){let e=[];for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t),i="BOD",o=0,a=r[0];for(;2!==a.type;){let s=0,n=[];if("BOD"===i){if("M"!==a.text&&"m"!==a.text)return f("M0,0"+t);o++,s=p[a.text],i=a.text}else 1===a.type?s=p[i]:(o++,s=p[a.text],i=a.text);if(!(o+s<r.length))throw Error("Path data ended short");for(let t=o;t<o+s;t++){let e=r[t];if(1!==e.type)throw Error("Param not a number: "+i+","+e.text);n[n.length]=+e.text}if("number"!=typeof p[i])throw Error("Bad segment: "+i);{let t={key:i,data:n};e.push(t),o+=s,a=r[o],"M"===i&&(i="L"),"m"===i&&(i="l")}}return e}function y(t){let e=0,r=0,i=0,o=0,a=[];for(let{key:s,data:n}of t)switch(s){case"M":a.push({key:"M",data:[...n]}),[e,r]=n,[i,o]=n;break;case"m":e+=n[0],r+=n[1],a.push({key:"M",data:[e,r]}),i=e,o=r;break;case"L":a.push({key:"L",data:[...n]}),[e,r]=n;break;case"l":e+=n[0],r+=n[1],a.push({key:"L",data:[e,r]});break;case"C":a.push({key:"C",data:[...n]}),e=n[4],r=n[5];break;case"c":{let t=n.map((t,i)=>i%2?t+r:t+e);a.push({key:"C",data:t}),e=t[4],r=t[5];break}case"Q":a.push({key:"Q",data:[...n]}),e=n[2],r=n[3];break;case"q":{let t=n.map((t,i)=>i%2?t+r:t+e);a.push({key:"Q",data:t}),e=t[2],r=t[3];break}case"A":a.push({key:"A",data:[...n]}),e=n[5],r=n[6];break;case"a":e+=n[5],r+=n[6],a.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],e,r]});break;case"H":a.push({key:"H",data:[...n]}),e=n[0];break;case"h":e+=n[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...n]}),e=n[2],r=n[3];break;case"s":{let t=n.map((t,i)=>i%2?t+r:t+e);a.push({key:"S",data:t}),e=t[2],r=t[3];break}case"T":a.push({key:"T",data:[...n]}),e=n[0],r=n[1];break;case"t":e+=n[0],r+=n[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=i,r=o}return a}function m(t){let e=[],r="",i=0,o=0,a=0,s=0,n=0,l=0;for(let{key:h,data:c}of t){switch(h){case"M":e.push({key:"M",data:[...c]}),[i,o]=c,[a,s]=c;break;case"C":e.push({key:"C",data:[...c]}),i=c[4],o=c[5],n=c[2],l=c[3];break;case"L":e.push({key:"L",data:[...c]}),[i,o]=c;break;case"H":i=c[0],e.push({key:"L",data:[i,o]});break;case"V":o=c[0],e.push({key:"L",data:[i,o]});break;case"S":{let t=0,a=0;"C"===r||"S"===r?(t=i+(i-n),a=o+(o-l)):(t=i,a=o),e.push({key:"C",data:[t,a,...c]}),n=c[0],l=c[1],i=c[2],o=c[3];break}case"T":{let[t,a]=c,s=0,h=0;"Q"===r||"T"===r?(s=i+(i-n),h=o+(o-l)):(s=i,h=o);let d=i+2*(s-i)/3,u=o+2*(h-o)/3,g=t+2*(s-t)/3,p=a+2*(h-a)/3;e.push({key:"C",data:[d,u,g,p,t,a]}),n=s,l=h,i=t,o=a;break}case"Q":{let[t,r,a,s]=c,h=i+2*(t-i)/3,d=o+2*(r-o)/3,u=a+2*(t-a)/3,g=s+2*(r-s)/3;e.push({key:"C",data:[h,d,u,g,a,s]}),n=t,l=r,i=a,o=s;break}case"A":{let t=Math.abs(c[0]),r=Math.abs(c[1]),a=c[2],s=c[3],n=c[4],l=c[5],h=c[6];0===t||0===r?(e.push({key:"C",data:[i,o,l,h,l,h]}),i=l,o=h):(i!==l||o!==h)&&((function t(e,r,i,o,a,s,n,l,h,c){let d=Math.PI*n/180,u=[],g=0,p=0,f=0,y=0;if(c)[g,p,f,y]=c;else{[e,r]=C(e,r,-d),[i,o]=C(i,o,-d);let t=(e-i)/2,n=(r-o)/2,c=t*t/(a*a)+n*n/(s*s);c>1&&(a*=c=Math.sqrt(c),s*=c);let u=a*a,m=s*s,x=(l===h?-1:1)*Math.sqrt(Math.abs((u*m-u*n*n-m*t*t)/(u*n*n+m*t*t)));f=x*a*n/s+(e+i)/2,y=-(x*s)*t/a+(r+o)/2,g=Math.asin(parseFloat(((r-y)/s).toFixed(9))),p=Math.asin(parseFloat(((o-y)/s).toFixed(9))),e<f&&(g=Math.PI-g),i<f&&(p=Math.PI-p),g<0&&(g=2*Math.PI+g),p<0&&(p=2*Math.PI+p),h&&g>p&&(g-=2*Math.PI),!h&&p>g&&(p-=2*Math.PI)}let m=p-g;if(Math.abs(m)>120*Math.PI/180){let e=p,r=i,l=o;u=t(i=f+a*Math.cos(p=h&&p>g?g+120*Math.PI/180*1:g+-(120*Math.PI/180*1)),o=y+s*Math.sin(p),r,l,a,s,n,0,h,[p,e,f,y])}m=p-g;let x=Math.cos(g),b=Math.cos(p),k=Math.tan(m/4),w=4/3*a*k,B=4/3*s*k,T=[e,r],S=[e+w*Math.sin(g),r-B*x],v=[i+w*Math.sin(p),o-B*b],_=[i,o];if(S[0]=2*T[0]-S[0],S[1]=2*T[1]-S[1],c)return[S,v,_].concat(u);{u=[S,v,_].concat(u);let t=[];for(let e=0;e<u.length;e+=3){let r=C(u[e][0],u[e][1],d),i=C(u[e+1][0],u[e+1][1],d),o=C(u[e+2][0],u[e+2][1],d);t.push([r[0],r[1],i[0],i[1],o[0],o[1]])}return t}})(i,o,l,h,t,r,a,s,n).forEach(function(t){e.push({key:"C",data:t})}),i=l,o=h);break}case"Z":e.push({key:"Z",data:[]}),i=a,o=s}r=h}return e}function C(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}let x={randOffset:function(t,e){return $(t,e)},randOffsetWithRange:function(t,e,r){return M(t,e,r)},ellipse:function(t,e,r,i,o){let a=B(r,i,o);return T(t,e,o,a).opset},doubleLineOps:function(t,e,r,i,o){return E(t,e,r,i,o,!0)}};function b(t,e,r,i,o){return{type:"path",ops:E(t,e,r,i,o)}}function k(t,e,r){let i=(t||[]).length;if(i>2){let o=[];for(let e=0;e<i-1;e++)o.push(...E(t[e][0],t[e][1],t[e+1][0],t[e+1][1],r));return e&&o.push(...E(t[i-1][0],t[i-1][1],t[0][0],t[0][1],r)),{type:"path",ops:o}}return 2===i?b(t[0][0],t[0][1],t[1][0],t[1][1],r):{type:"path",ops:[]}}function w(t,e){if(t.length){let r="number"==typeof t[0][0]?[t]:t,i=O(r[0],+(1+.2*e.roughness),e),o=e.disableMultiStroke?[]:O(r[0],1.5*(1+.22*e.roughness),L(e));for(let t=1;t<r.length;t++){let a=r[t];if(a.length){let t=O(a,+(1+.2*e.roughness),e),r=e.disableMultiStroke?[]:O(a,1.5*(1+.22*e.roughness),L(e));for(let e of t)"move"!==e.op&&i.push(e);for(let t of r)"move"!==t.op&&o.push(t)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function B(t,e,r){let i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),o=2*Math.PI/Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),a=Math.abs(t/2),s=Math.abs(e/2),n=1-r.curveFitting;return a+=$(a*n,r),s+=$(s*n,r),{increment:o,rx:a,ry:s}}function T(t,e,r,i){let[o,a]=q(i.increment,t,e,i.rx,i.ry,1,i.increment*M(.1,M(.4,1,r),r),r),s=D(o,null,r);if(!r.disableMultiStroke&&0!==r.roughness){let[o]=q(i.increment,t,e,i.rx,i.ry,1.5,0,r),a=D(o,null,r);s=s.concat(a)}return{estimatedPoints:a,opset:{type:"path",ops:s}}}function S(t,e,r,i,o,a,s,n,l){let h=Math.abs(r/2),c=Math.abs(i/2);h+=$(.01*h,l),c+=$(.01*c,l);let d=o,u=a;for(;d<0;)d+=2*Math.PI,u+=2*Math.PI;u-d>2*Math.PI&&(d=0,u=2*Math.PI);let g=Math.min(2*Math.PI/l.curveStepCount/2,(u-d)/2),p=I(g,t,e,h,c,d,u,1,l);if(!l.disableMultiStroke){let r=I(g,t,e,h,c,d,u,1.5,l);p.push(...r)}return s&&(n?p.push(...E(t,e,t+h*Math.cos(d),e+c*Math.sin(d),l),...E(t,e,t+h*Math.cos(u),e+c*Math.sin(u),l)):p.push({op:"lineTo",data:[t,e]},{op:"lineTo",data:[t+h*Math.cos(d),e+c*Math.sin(d)]})),{type:"path",ops:p}}function v(t,e){let r=m(y(f(t))),i=[],o=[0,0],a=[0,0];for(let{key:t,data:s}of r)switch(t){case"M":a=[s[0],s[1]],o=[s[0],s[1]];break;case"L":i.push(...E(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":{let[t,r,o,n,l,h]=s;i.push(...function(t,e,r,i,o,a,s,n){let l=[],h=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3],c=[0,0],d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let g=0;g<d;g++)0===g?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(u?0:$(h[0],n)),s[1]+(u?0:$(h[0],n))]}),c=u?[o,a]:[o+$(h[g],n),a+$(h[g],n)],l.push({op:"bcurveTo",data:[t+$(h[g],n),e+$(h[g],n),r+$(h[g],n),i+$(h[g],n),c[0],c[1]]});return l}(t,r,o,n,l,h,a,e)),a=[l,h];break}case"Z":i.push(...E(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]]}return{type:"path",ops:i}}function _(t,e){let r=[];for(let i of t)if(i.length){let t=e.maxRandomnessOffset||0,o=i.length;if(o>2){r.push({op:"move",data:[i[0][0]+$(t,e),i[0][1]+$(t,e)]});for(let a=1;a<o;a++)r.push({op:"lineTo",data:[i[a][0]+$(t,e),i[a][1]+$(t,e)]})}}return{type:"fillPath",ops:r}}function F(t,e){return(function(t,e){let r=t.fillStyle||"hachure";if(!u[r])switch(r){case"zigzag":u[r]||(u[r]=new n(e));break;case"cross-hatch":u[r]||(u[r]=new l(e));break;case"dots":u[r]||(u[r]=new h(e));break;case"dashed":u[r]||(u[r]=new c(e));break;case"zigzag-line":u[r]||(u[r]=new d(e));break;default:u[r="hachure"]||(u[r]=new a(e))}return u[r]})(e,x).fillPolygons(t,e)}function L(t){let e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function A(t){return t.randomizer||(t.randomizer=new g(t.seed||0)),t.randomizer.next()}function M(t,e,r,i=1){return r.roughness*i*(A(r)*(e-t)+t)}function $(t,e,r=1){return M(-t,t,e,r)}function E(t,e,r,i,o,a=!1){let s=a?o.disableMultiStrokeFill:o.disableMultiStroke,n=K(t,e,r,i,o,!0,!1);if(s)return n;let l=K(t,e,r,i,o,!0,!0);return n.concat(l)}function K(t,e,r,i,o,a,s){let n=Math.pow(t-r,2)+Math.pow(e-i,2),l=Math.sqrt(n),h=1;h=l<200?1:l>500?.4:-.0016668*l+1.233334;let c=o.maxRandomnessOffset||0;c*c*100>n&&(c=l/10);let d=c/2,u=.2+.2*A(o),g=o.bowing*o.maxRandomnessOffset*(i-e)/200,p=o.bowing*o.maxRandomnessOffset*(t-r)/200;g=$(g,o,h),p=$(p,o,h);let f=[],y=o.preserveVertices;return a&&(s?f.push({op:"move",data:[t+(y?0:$(d,o,h)),e+(y?0:$(d,o,h))]}):f.push({op:"move",data:[t+(y?0:$(c,o,h)),e+(y?0:$(c,o,h))]})),s?f.push({op:"bcurveTo",data:[g+t+(r-t)*u+$(d,o,h),p+e+(i-e)*u+$(d,o,h),g+t+2*(r-t)*u+$(d,o,h),p+e+2*(i-e)*u+$(d,o,h),r+(y?0:$(d,o,h)),i+(y?0:$(d,o,h))]}):f.push({op:"bcurveTo",data:[g+t+(r-t)*u+$(c,o,h),p+e+(i-e)*u+$(c,o,h),g+t+2*(r-t)*u+$(c,o,h),p+e+2*(i-e)*u+$(c,o,h),r+(y?0:$(c,o,h)),i+(y?0:$(c,o,h))]}),f}function O(t,e,r){if(!t.length)return[];let i=[];i.push([t[0][0]+$(e,r),t[0][1]+$(e,r)]),i.push([t[0][0]+$(e,r),t[0][1]+$(e,r)]);for(let o=1;o<t.length;o++)i.push([t[o][0]+$(e,r),t[o][1]+$(e,r)]),o===t.length-1&&i.push([t[o][0]+$(e,r),t[o][1]+$(e,r)]);return D(i,null,r)}function D(t,e,r){let i=t.length,o=[];if(i>3){let a=[],s=1-r.curveTightness;o.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<i;e++){let r=t[e];a[0]=[r[0],r[1]],a[1]=[r[0]+(s*t[e+1][0]-s*t[e-1][0])/6,r[1]+(s*t[e+1][1]-s*t[e-1][1])/6],a[2]=[t[e+1][0]+(s*t[e][0]-s*t[e+2][0])/6,t[e+1][1]+(s*t[e][1]-s*t[e+2][1])/6],a[3]=[t[e+1][0],t[e+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(e&&2===e.length){let t=r.maxRandomnessOffset;o.push({op:"lineTo",data:[e[0]+$(t,r),e[1]+$(t,r)]})}}else 3===i?(o.push({op:"move",data:[t[1][0],t[1][1]]}),o.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===i&&o.push(...K(t[0][0],t[0][1],t[1][0],t[1][1],r,!0,!0));return o}function q(t,e,r,i,o,a,s,n){let l=[],h=[];if(0===n.roughness){t/=4,h.push([e+i*Math.cos(-t),r+o*Math.sin(-t)]);for(let a=0;a<=2*Math.PI;a+=t){let t=[e+i*Math.cos(a),r+o*Math.sin(a)];l.push(t),h.push(t)}h.push([e+ +i,r+0*o]),h.push([e+i*Math.cos(t),r+o*Math.sin(t)])}else{let c=$(.5,n)-Math.PI/2;h.push([$(a,n)+e+.9*i*Math.cos(c-t),$(a,n)+r+.9*o*Math.sin(c-t)]);let d=2*Math.PI+c-.01;for(let s=c;s<d;s+=t){let t=[$(a,n)+e+i*Math.cos(s),$(a,n)+r+o*Math.sin(s)];l.push(t),h.push(t)}h.push([$(a,n)+e+i*Math.cos(c+2*Math.PI+.5*s),$(a,n)+r+o*Math.sin(c+2*Math.PI+.5*s)]),h.push([$(a,n)+e+.98*i*Math.cos(c+s),$(a,n)+r+.98*o*Math.sin(c+s)]),h.push([$(a,n)+e+.9*i*Math.cos(c+.5*s),$(a,n)+r+.9*o*Math.sin(c+.5*s)])}return[h,l]}function I(t,e,r,i,o,a,s,n,l){let h=a+$(.1,l),c=[];c.push([$(n,l)+e+.9*i*Math.cos(h-t),$(n,l)+r+.9*o*Math.sin(h-t)]);for(let a=h;a<=s;a+=t)c.push([$(n,l)+e+i*Math.cos(a),$(n,l)+r+o*Math.sin(a)]);return c.push([e+i*Math.cos(s),r+o*Math.sin(s)]),c.push([e+i*Math.cos(s),r+o*Math.sin(s)]),D(c,null,l)}function P(t,e=0){let r=t.length;if(r<3)throw Error("A curve must have at least three points.");let i=[];if(3===r)i.push([...t[0]],[...t[1]],[...t[2]],[...t[2]]);else{let r=[];r.push(t[0],t[0]);for(let e=1;e<t.length;e++)r.push(t[e]),e===t.length-1&&r.push(t[e]);let o=[],a=1-e;i.push([...r[0]]);for(let t=1;t+2<r.length;t++){let e=r[t];o[0]=[e[0],e[1]],o[1]=[e[0]+(a*r[t+1][0]-a*r[t-1][0])/6,e[1]+(a*r[t+1][1]-a*r[t-1][1])/6],o[2]=[r[t+1][0]+(a*r[t][0]-a*r[t+2][0])/6,r[t+1][1]+(a*r[t][1]-a*r[t+2][1])/6],o[3]=[r[t+1][0],r[t+1][1]],i.push(o[1],o[2],o[3])}}return i}function W(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function z(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function R(t,e,r,i,o){let a=o||[],s=t[e],n=t[r-1],l=0,h=1;for(let i=e+1;i<r-1;++i){let e=function(t,e,r){let i=W(e,r);if(0===i)return W(t,e);let o=((t[0]-e[0])*(r[0]-e[0])+(t[1]-e[1])*(r[1]-e[1]))/i;return W(t,z(e,r,o=Math.max(0,Math.min(1,o))))}(t[i],s,n);e>l&&(l=e,h=i)}return Math.sqrt(l)>i?(R(t,e,h+1,i,a),R(t,h,r,i,a)):(a.length||a.push(s),a.push(n)),a}function j(t,e=.15,r){let i=[],o=(t.length-1)/3;for(let r=0;r<o;r++)!function t(e,r,i,o){let a,s,n,l,h,c,d,u,g=o||[];if(a=e[r+0],s=e[r+1],n=e[r+2],l=e[r+3],h=3*s[0]-2*a[0]-l[0],h*=h,c=3*s[1]-2*a[1]-l[1],c*=c,d=3*n[0]-2*l[0]-a[0],d*=d,u=3*n[1]-2*l[1]-a[1],u*=u,h<d&&(h=d),c<u&&(c=u),h+c<i){let t=e[r+0];g.length?Math.sqrt(W(g[g.length-1],t))>1&&g.push(t):g.push(t),g.push(e[r+3])}else{let o=e[r+0],a=e[r+1],s=e[r+2],n=e[r+3],l=z(o,a,.5),h=z(a,s,.5),c=z(s,n,.5),d=z(l,h,.5),u=z(h,c,.5),p=z(d,u,.5);t([o,l,d,p],0,i,g),t([p,u,c,n],0,i,g)}return g}(t,3*r,e,i);return r&&r>0?R(i,0,i.length,r):i}let N="none";class H{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(0x80000000*Math.random())}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,r){return{shape:t,sets:e||[],options:r||this.defaultOptions}}line(t,e,r,i,o){let a=this._o(o);return this._d("line",[b(t,e,r,i,a)],a)}rectangle(t,e,r,i,o){var a,s,n,l;let h=this._o(o),c=[],d=k([[a=t,s=e],[a+(n=r),s],[a+n,s+(l=i)],[a,s+l]],!0,h);if(h.fill){let o=[[t,e],[t+r,e],[t+r,e+i],[t,e+i]];"solid"===h.fillStyle?c.push(_([o],h)):c.push(F([o],h))}return h.stroke!==N&&c.push(d),this._d("rectangle",c,h)}ellipse(t,e,r,i,o){let a=this._o(o),s=[],n=B(r,i,a),l=T(t,e,a,n);if(a.fill)if("solid"===a.fillStyle){let r=T(t,e,a,n).opset;r.type="fillPath",s.push(r)}else s.push(F([l.estimatedPoints],a));return a.stroke!==N&&s.push(l.opset),this._d("ellipse",s,a)}circle(t,e,r,i){let o=this.ellipse(t,e,r,r,i);return o.shape="circle",o}linearPath(t,e){let r=this._o(e);return this._d("linearPath",[k(t,!1,r)],r)}arc(t,e,r,i,o,a,s=!1,n){let l=this._o(n),h=[],c=S(t,e,r,i,o,a,s,!0,l);if(s&&l.fill)if("solid"===l.fillStyle){let s=Object.assign({},l);s.disableMultiStroke=!0;let n=S(t,e,r,i,o,a,!0,!1,s);n.type="fillPath",h.push(n)}else h.push(function(t,e,r,i,o,a,s){let n=Math.abs(r/2),l=Math.abs(i/2);n+=$(.01*n,s),l+=$(.01*l,s);let h=o,c=a;for(;h<0;)h+=2*Math.PI,c+=2*Math.PI;c-h>2*Math.PI&&(h=0,c=2*Math.PI);let d=(c-h)/s.curveStepCount,u=[];for(let r=h;r<=c;r+=d)u.push([t+n*Math.cos(r),e+l*Math.sin(r)]);return u.push([t+n*Math.cos(c),e+l*Math.sin(c)]),u.push([t,e]),F([u],s)}(t,e,r,i,o,a,l));return l.stroke!==N&&h.push(c),this._d("arc",h,l)}curve(t,e){let r=this._o(e),i=[],o=w(t,r);if(r.fill&&r.fill!==N)if("solid"===r.fillStyle){let e=w(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{let e=[];if(t.length)for(let i of"number"==typeof t[0][0]?[t]:t)i.length<3?e.push(...i):3===i.length?e.push(...j(P([i[0],i[0],i[1],i[2]]),10,(1+r.roughness)/2)):e.push(...j(P(i),10,(1+r.roughness)/2));e.length&&i.push(F([e],r))}return r.stroke!==N&&i.push(o),this._d("curve",i,r)}polygon(t,e){let r=this._o(e),i=[],o=k(t,!0,r);return r.fill&&("solid"===r.fillStyle?i.push(_([t],r)):i.push(F([t],r))),r.stroke!==N&&i.push(o),this._d("polygon",i,r)}path(t,e){let r=this._o(e),i=[];if(!t)return this._d("path",i,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let o=r.fill&&"transparent"!==r.fill&&r.fill!==N,a=r.stroke!==N,s=!!(r.simplification&&r.simplification<1),n=function(t,e){let r=m(y(f(t))),i=[],o=[],a=[0,0],s=[],n=()=>{s.length>=4&&o.push(...j(s,1)),s=[]},l=()=>{n(),o.length&&(i.push(o),o=[])};for(let{key:t,data:e}of r)switch(t){case"M":l(),a=[e[0],e[1]],o.push(a);break;case"L":n(),o.push([e[0],e[1]]);break;case"C":if(!s.length){let t=o.length?o[o.length-1]:a;s.push([t[0],t[1]])}s.push([e[0],e[1]]),s.push([e[2],e[3]]),s.push([e[4],e[5]]);break;case"Z":n(),o.push([a[0],a[1]])}if(l(),!e)return i;let h=[];for(let t of i){let r=R(t,0,t.length,e);r.length&&h.push(r)}return h}(t,s?4-4*(r.simplification||1):(1+r.roughness)/2),l=v(t,r);if(o)if("solid"===r.fillStyle)if(1===n.length){let e=v(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else i.push(_(n,r));else i.push(F(n,r));return a&&(s?n.forEach(t=>{i.push(k(t,!1,r))}):i.push(l)),this._d("path",i,r)}opsToPath(t,e){let r="";for(let i of t.ops){let t="number"==typeof e&&e>=0?i.data.map(t=>+t.toFixed(e)):i.data;switch(i.op){case"move":r+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":r+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":r+=`L${t[0]} ${t[1]} `}}return r.trim()}toPaths(t){let e=t.sets||[],r=t.options||this.defaultOptions,i=[];for(let t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:N};break;case"fillPath":e={d:this.opsToPath(t),stroke:N,strokeWidth:0,fill:r.fill||N};break;case"fillSketch":e=this.fillSketch(t,r)}e&&i.push(e)}return i}fillSketch(t,e){let r=e.fillWeight;return r<0&&(r=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||N,strokeWidth:r,fill:N}}_mergedShape(t){return t.filter((t,e)=>0===e||"move"!==t.op)}}class U{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new H(e)}draw(t){let e=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(let a of e)switch(a.type){case"path":i.save(),i.strokeStyle="none"===r.stroke?"transparent":r.stroke,i.lineWidth=r.strokeWidth,r.strokeLineDash&&i.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(i.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(i,a,o),i.restore();break;case"fillPath":{i.save(),i.fillStyle=r.fill||"";let e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(i,a,o,e),i.restore();break}case"fillSketch":this.fillSketch(i,a,r)}}fillSketch(t,e,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=i,this._drawToContext(t,e,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,r,i="nonzero"){for(let i of(t.beginPath(),e.ops)){let e="number"==typeof r&&r>=0?i.data.map(t=>+t.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,r,i,o){let a=this.gen.line(t,e,r,i,o);return this.draw(a),a}rectangle(t,e,r,i,o){let a=this.gen.rectangle(t,e,r,i,o);return this.draw(a),a}ellipse(t,e,r,i,o){let a=this.gen.ellipse(t,e,r,i,o);return this.draw(a),a}circle(t,e,r,i){let o=this.gen.circle(t,e,r,i);return this.draw(o),o}linearPath(t,e){let r=this.gen.linearPath(t,e);return this.draw(r),r}polygon(t,e){let r=this.gen.polygon(t,e);return this.draw(r),r}arc(t,e,r,i,o,a,s=!1,n){let l=this.gen.arc(t,e,r,i,o,a,s,n);return this.draw(l),l}curve(t,e){let r=this.gen.curve(t,e);return this.draw(r),r}path(t,e){let r=this.gen.path(t,e);return this.draw(r),r}}let Y="http://www.w3.org/2000/svg";class X{constructor(t,e){this.svg=t,this.gen=new H(e)}draw(t){let e=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,o=i.createElementNS(Y,"g"),a=t.options.fixedDecimalPlaceDigits;for(let s of e){let e=null;switch(s.type){case"path":(e=i.createElementNS(Y,"path")).setAttribute("d",this.opsToPath(s,a)),e.setAttribute("stroke",r.stroke),e.setAttribute("stroke-width",r.strokeWidth+""),e.setAttribute("fill","none"),r.strokeLineDash&&e.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":(e=i.createElementNS(Y,"path")).setAttribute("d",this.opsToPath(s,a)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",r.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(i,s,r)}e&&o.appendChild(e)}return o}fillSketch(t,e,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2);let o=t.createElementNS(Y,"path");return o.setAttribute("d",this.opsToPath(e,r.fixedDecimalPlaceDigits)),o.setAttribute("stroke",r.fill||""),o.setAttribute("stroke-width",i+""),o.setAttribute("fill","none"),r.fillLineDash&&o.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,r,i,o){let a=this.gen.line(t,e,r,i,o);return this.draw(a)}rectangle(t,e,r,i,o){let a=this.gen.rectangle(t,e,r,i,o);return this.draw(a)}ellipse(t,e,r,i,o){let a=this.gen.ellipse(t,e,r,i,o);return this.draw(a)}circle(t,e,r,i){let o=this.gen.circle(t,e,r,i);return this.draw(o)}linearPath(t,e){let r=this.gen.linearPath(t,e);return this.draw(r)}polygon(t,e){let r=this.gen.polygon(t,e);return this.draw(r)}arc(t,e,r,i,o,a,s=!1,n){let l=this.gen.arc(t,e,r,i,o,a,s,n);return this.draw(l)}curve(t,e){let r=this.gen.curve(t,e);return this.draw(r)}path(t,e){let r=this.gen.path(t,e);return this.draw(r)}}var G={canvas:(t,e)=>new U(t,e),svg:(t,e)=>new X(t,e),generator:t=>new H(t),newSeed:()=>H.newSeed()};r.d(e,{A:()=>G})},El(t,e,r){"use strict";function i(t,e){let r;if(void 0===e)for(let e of t)null!=e&&(r<e||void 0===r&&e>=e)&&(r=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(r<o||void 0===r&&o>=o)&&(r=o)}return r}function o(t,e){let r;if(void 0===e)for(let e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(r>o||void 0===r&&o>=o)&&(r=o)}return r}function a(t){return t}function s(t){return"translate("+t+",0)"}function n(t){return"translate(0,"+t+")"}function l(){return!this.__axis}function h(t,e){var r=[],i=null,o=null,h=6,c=6,d=3,u="u">typeof window&&window.devicePixelRatio>1?0:.5,g=1===t||4===t?-1:1,p=4===t||2===t?"x":"y",f=1===t||3===t?s:n;function y(s){var n=null==i?e.ticks?e.ticks.apply(e,r):e.domain():i,y=null==o?e.tickFormat?e.tickFormat.apply(e,r):a:o,m=Math.max(h,0)+d,C=e.range(),x=+C[0]+u,b=+C[C.length-1]+u,k=(e.bandwidth?function(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}:function(t){return e=>+t(e)})(e.copy(),u),w=s.selection?s.selection():s,B=w.selectAll(".domain").data([null]),T=w.selectAll(".tick").data(n,e).order(),S=T.exit(),v=T.enter().append("g").attr("class","tick"),_=T.select("line"),F=T.select("text");B=B.merge(B.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(v),_=_.merge(v.append("line").attr("stroke","currentColor").attr(p+"2",g*h)),F=F.merge(v.append("text").attr("fill","currentColor").attr(p,g*m).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),s!==w&&(B=B.transition(s),T=T.transition(s),_=_.transition(s),F=F.transition(s),S=S.transition(s).attr("opacity",1e-6).attr("transform",function(t){return isFinite(t=k(t))?f(t+u):this.getAttribute("transform")}),v.attr("opacity",1e-6).attr("transform",function(t){var e=this.parentNode.__axis;return f((e&&isFinite(e=e(t))?e:k(t))+u)})),S.remove(),B.attr("d",4===t||2===t?c?"M"+g*c+","+x+"H"+u+"V"+b+"H"+g*c:"M"+u+","+x+"V"+b:c?"M"+x+","+g*c+"V"+u+"H"+b+"V"+g*c:"M"+x+","+u+"H"+b),T.attr("opacity",1).attr("transform",function(t){return f(k(t)+u)}),_.attr(p+"2",g*h),F.attr(p,g*m).text(y),w.filter(l).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),w.each(function(){this.__axis=k})}return y.scale=function(t){return arguments.length?(e=t,y):e},y.ticks=function(){return r=Array.from(arguments),y},y.tickArguments=function(t){return arguments.length?(r=null==t?[]:Array.from(t),y):r.slice()},y.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),y):i&&i.slice()},y.tickFormat=function(t){return arguments.length?(o=t,y):o},y.tickSize=function(t){return arguments.length?(h=c=+t,y):h},y.tickSizeInner=function(t){return arguments.length?(h=+t,y):h},y.tickSizeOuter=function(t){return arguments.length?(c=+t,y):c},y.tickPadding=function(t){return arguments.length?(d=+t,y):d},y.offset=function(t){return arguments.length?(u=+t,y):u},y}function c(t){return h(1,t)}function d(t){return h(3,t)}function u(){}function g(t){return null==t?u:function(){return this.querySelector(t)}}function p(){return[]}function f(t){return null==t?p:function(){return this.querySelectorAll(t)}}function y(t){return function(){return this.matches(t)}}function m(t){return function(e){return e.matches(t)}}r.d(e,{JLW:()=>oU,l78:()=>d,tlR:()=>c,qrM:()=>o4,Yu4:()=>o8,IA3:()=>o9,Wi0:()=>ae,PGM:()=>ar,OEq:()=>ao,y8u:()=>an,olC:()=>ah,IrU:()=>ad,oDi:()=>ap,Q7f:()=>ay,cVp:()=>aC,lUB:()=>oG,Lx9:()=>ab,nVG:()=>a_,uxU:()=>aF,Xf2:()=>aM,GZz:()=>aE,UPb:()=>aO,dyv:()=>aK,GPZ:()=>tn,Sk5:()=>eR,bEH:()=>ro,n8j:()=>oQ,T9B:()=>i,jkA:()=>o,rLf:()=>o1,WH:()=>function t(){var e,r,i=rc().unknown(void 0),o=i.domain,a=i.range,s=0,n=1,l=!1,h=0,c=0,d=.5;function u(){var t=o().length,i=n<s,u=i?n:s,g=i?s:n;e=(g-u)/Math.max(1,t-h+2*c),l&&(e=Math.floor(e)),u+=(g-u-e*(t-h))*d,r=e*(1-h),l&&(u=Math.round(u),r=Math.round(r));var p=(function(t,e,r){t*=1,e*=1,r=(o=arguments.length)<2?(e=t,t=0,1):o<3?1:+r;for(var i=-1,o=0|Math.max(0,Math.ceil((e-t)/r)),a=Array(o);++i<o;)a[i]=t+i*r;return a})(t).map(function(t){return u+e*t});return a(i?p.reverse():p)}return delete i.unknown,i.domain=function(t){return arguments.length?(o(t),u()):o()},i.range=function(t){return arguments.length?([s,n]=t,s*=1,n*=1,u()):[s,n]},i.rangeRound=function(t){return[s,n]=t,s*=1,n*=1,l=!0,u()},i.bandwidth=function(){return r},i.step=function(){return e},i.round=function(t){return arguments.length?(l=!!t,u()):l},i.padding=function(t){return arguments.length?(h=Math.min(1,c=+t),u()):h},i.paddingInner=function(t){return arguments.length?(h=Math.min(1,t),u()):h},i.paddingOuter=function(t){return arguments.length?(c=+t,u()):c},i.align=function(t){return arguments.length?(d=Math.max(0,Math.min(1,t)),u()):d},i.copy=function(){return t(o(),[s,n]).round(l).paddingInner(h).paddingOuter(c).align(d)},ra.apply(u(),arguments)},m4Y:()=>function t(){var e,r=rM();return r.copy=function(){return rA(r,t())},ra.apply(r,arguments),e=r.domain,r.ticks=function(t){var r=e();return function(t,e,r){if(e*=1,t*=1,!((r*=1)>0))return[];if(t===e)return[t];let i=e<t,[o,a,s]=i?rp(e,t,r):rp(t,e,r);if(!(a>=o))return[];let n=a-o+1,l=Array(n);if(i)if(s<0)for(let t=0;t<n;++t)l[t]=-((a-t)/s);else for(let t=0;t<n;++t)l[t]=(a-t)*s;else if(s<0)for(let t=0;t<n;++t)l[t]=-((o+t)/s);else for(let t=0;t<n;++t)l[t]=(o+t)*s;return l}(r[0],r[r.length-1],null==t?10:t)},r.tickFormat=function(t,r){var i=e();return function(t,e,r,i){var o,a,s=ry(t,e,r);switch((i=eK(null==i?",f":i)).type){case"s":var n=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(a=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(e$(n)/3)))-e$(Math.abs(s))))||(i.precision=a),tl(i,n);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(a=Math.max(0,e$(Math.abs(Math.max(Math.abs(t),Math.abs(e)))-(o=Math.abs(o=s)))-e$(o))+1)||(i.precision=a-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(a=Math.max(0,-e$(Math.abs(s))))||(i.precision=a-("%"===i.type)*2)}return tn(i)}(i[0],i[i.length-1],null==t?10:t,r)},r.nice=function(t){null==t&&(t=10);var i,o,a=e(),s=0,n=a.length-1,l=a[s],h=a[n],c=10;for(h<l&&(o=l,l=h,h=o,o=s,s=n,n=o);c-- >0;){if((o=rf(l,h,t))===i)return a[s]=l,a[n]=h,e(a);if(o>0)l=Math.floor(l/o)*o,h=Math.ceil(h/o)*o;else if(o<0)l=Math.ceil(l*o)/o,h=Math.floor(h*o)/o;else break;i=o}return r},r},UMr:()=>rc,w7C:()=>ox,zt:()=>ob,Ltv:()=>ok,UAC:()=>rz,DCK:()=>tc,TUC:()=>rV,Agd:()=>rP,t6C:()=>rO,wXd:()=>rq,ABi:()=>rU,Ui6:()=>r6,rGn:()=>rZ,ucG:()=>rD,YPH:()=>rH,Mol:()=>rG,PGu:()=>rY,GuW:()=>rX,hkb:()=>eQ});var C,x=Array.prototype.find;function b(){return this.firstElementChild}var k=Array.prototype.filter;function w(){return Array.from(this.children)}function B(t){return Array(t.length)}function T(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function S(t,e,r,i,o,a){for(var s,n=0,l=e.length,h=a.length;n<h;++n)(s=e[n])?(s.__data__=a[n],i[n]=s):r[n]=new T(t,a[n]);for(;n<l;++n)(s=e[n])&&(o[n]=s)}function v(t,e,r,i,o,a,s){var n,l,h,c=new Map,d=e.length,u=a.length,g=Array(d);for(n=0;n<d;++n)(l=e[n])&&(g[n]=h=s.call(l,l.__data__,n,e)+"",c.has(h)?o[n]=l:c.set(h,l));for(n=0;n<u;++n)h=s.call(t,a[n],n,a)+"",(l=c.get(h))?(i[n]=l,l.__data__=a[n],c.delete(h)):r[n]=new T(t,a[n]);for(n=0;n<d;++n)(l=e[n])&&c.get(g[n])===l&&(o[n]=l)}function _(t){return t.__data__}function F(t,e){return t<e?-1:t>e?1:t>=e?0:0/0}T.prototype={constructor:T,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var L="http://www.w3.org/1999/xhtml",A={svg:"http://www.w3.org/2000/svg",xhtml:L,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function M(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),A.hasOwnProperty(e)?{space:A[e],local:t}:t}function $(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function E(t,e){return t.style.getPropertyValue(e)||$(t).getComputedStyle(t,null).getPropertyValue(e)}function K(t){return t.trim().split(/^|\s+/)}function O(t){return t.classList||new D(t)}function D(t){this._node=t,this._names=K(t.getAttribute("class")||"")}function q(t,e){for(var r=O(t),i=-1,o=e.length;++i<o;)r.add(e[i])}function I(t,e){for(var r=O(t),i=-1,o=e.length;++i<o;)r.remove(e[i])}function P(){this.textContent=""}function W(){this.innerHTML=""}function z(){this.nextSibling&&this.parentNode.appendChild(this)}function R(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function j(t){var e=M(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===L&&e.documentElement.namespaceURI===L?e.createElement(t):e.createElementNS(r,t)}})(e)}function N(){return null}function H(){var t=this.parentNode;t&&t.removeChild(this)}function U(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Y(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function X(t){return function(){var e=this.__on;if(e){for(var r,i=0,o=-1,a=e.length;i<a;++i)(r=e[i],t.type&&r.type!==t.type||r.name!==t.name)?e[++o]=r:this.removeEventListener(r.type,r.listener,r.options);++o?e.length=o:delete this.__on}}}function G(t,e,r){return function(){var i,o=this.__on,a=function(t){e.call(this,t,this.__data__)};if(o){for(var s=0,n=o.length;s<n;++s)if((i=o[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=e;return}}this.addEventListener(t.type,a,r),i={type:t.type,name:t.name,value:e,listener:a,options:r},o?o.push(i):this.__on=[i]}}function V(t,e,r){var i=$(t),o=i.CustomEvent;"function"==typeof o?o=new o(e,r):(o=i.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}D.prototype={add:function(t){0>this._names.indexOf(t)&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Z=[null];function Q(t,e){this._groups=t,this._parents=e}function J(){return new Q([[document.documentElement]],Z)}Q.prototype=J.prototype={constructor:Q,select:function(t){"function"!=typeof t&&(t=g(t));for(var e=this._groups,r=e.length,i=Array(r),o=0;o<r;++o)for(var a,s,n=e[o],l=n.length,h=i[o]=Array(l),c=0;c<l;++c)(a=n[c])&&(s=t.call(a,a.__data__,c,n))&&("__data__"in a&&(s.__data__=a.__data__),h[c]=s);return new Q(i,this._parents)},selectAll:function(t){if("function"==typeof t){var e;e=t,t=function(){var t;return t=e.apply(this,arguments),null==t?[]:Array.isArray(t)?t:Array.from(t)}}else t=f(t);for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var n,l=r[s],h=l.length,c=0;c<h;++c)(n=l[c])&&(o.push(t.call(n,n.__data__,c,l)),a.push(n));return new Q(o,a)},selectChild:function(t){var e;return this.select(null==t?b:(e="function"==typeof t?t:m(t),function(){return x.call(this.children,e)}))},selectChildren:function(t){var e;return this.selectAll(null==t?w:(e="function"==typeof t?t:m(t),function(){return k.call(this.children,e)}))},filter:function(t){"function"!=typeof t&&(t=y(t));for(var e=this._groups,r=e.length,i=Array(r),o=0;o<r;++o)for(var a,s=e[o],n=s.length,l=i[o]=[],h=0;h<n;++h)(a=s[h])&&t.call(a,a.__data__,h,s)&&l.push(a);return new Q(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,_);var r=e?v:S,i=this._parents,o=this._groups;"function"!=typeof t&&(C=t,t=function(){return C});for(var a=o.length,s=Array(a),n=Array(a),l=Array(a),h=0;h<a;++h){var c=i[h],d=o[h],u=d.length,g="object"==typeof(m=t.call(c,c&&c.__data__,h,i))&&"length"in m?m:Array.from(m),p=g.length,f=n[h]=Array(p),y=s[h]=Array(p);r(c,d,f,y,l[h]=Array(u),g,e);for(var m,C,x,b,k=0,w=0;k<p;++k)if(x=f[k]){for(k>=w&&(w=k+1);!(b=y[w])&&++w<p;);x._next=b||null}}return(s=new Q(s,i))._enter=n,s._exit=l,s},enter:function(){return new Q(this._enter||this._groups.map(B),this._parents)},exit:function(){return new Q(this._exit||this._groups.map(B),this._parents)},join:function(t,e,r){var i=this.enter(),o=this,a=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(o=e(o))&&(o=o.selection()),null==r?a.remove():r(a),i&&o?i.merge(o).order():o},merge:function(t){for(var e=t.selection?t.selection():t,r=this._groups,i=e._groups,o=r.length,a=i.length,s=Math.min(o,a),n=Array(o),l=0;l<s;++l)for(var h,c=r[l],d=i[l],u=c.length,g=n[l]=Array(u),p=0;p<u;++p)(h=c[p]||d[p])&&(g[p]=h);for(;l<o;++l)n[l]=r[l];return new Q(n,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var i,o=t[e],a=o.length-1,s=o[a];--a>=0;)(i=o[a])&&(s&&4^i.compareDocumentPosition(s)&&s.parentNode.insertBefore(i,s),s=i);return this},sort:function(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=F);for(var r=this._groups,i=r.length,o=Array(i),a=0;a<i;++a){for(var s,n=r[a],l=n.length,h=o[a]=Array(l),c=0;c<l;++c)(s=n[c])&&(h[c]=s);h.sort(e)}return new Q(o,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var i=t[e],o=0,a=i.length;o<a;++o){var s=i[o];if(s)return s}return null},size:function(){let t=0;for(let e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var o,a=e[r],s=0,n=a.length;s<n;++s)(o=a[s])&&t.call(o,o.__data__,s,a);return this},attr:function(t,e){var r=M(t);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((null==e?r.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof e?r.local?function(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}:function(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}:r.local?function(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}:function(t,e){return function(){this.setAttribute(t,e)}})(r,e))},style:function(t,e,r){return arguments.length>1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,r){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,r)}}:function(t,e,r){return function(){this.style.setProperty(t,e,r)}})(t,e,null==r?"":r)):E(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]},classed:function(t,e){var r=K(t+"");if(arguments.length<2){for(var i=O(this.node()),o=-1,a=r.length;++o<a;)if(!i.contains(r[o]))return!1;return!0}return this.each(("function"==typeof e?function(t,e){return function(){(e.apply(this,arguments)?q:I)(this,t)}}:e?function(t){return function(){q(this,t)}}:function(t){return function(){I(this,t)}})(r,e))},text:function(t){return arguments.length?this.each(null==t?P:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(z)},lower:function(){return this.each(R)},append:function(t){var e="function"==typeof t?t:j(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var r="function"==typeof t?t:j(t),i=null==e?N:"function"==typeof e?e:g(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(H)},clone:function(t){return this.select(t?Y:U)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,r){var i,o,a=(t+"").trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");return r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}),s=a.length;if(arguments.length<2){var n=this.node().__on;if(n){for(var l,h=0,c=n.length;h<c;++h)for(i=0,l=n[h];i<s;++i)if((o=a[i]).type===l.type&&o.name===l.name)return l.value}return}for(n=e?G:X,i=0;i<s;++i)this.each(n(a[i],e,r));return this},dispatch:function(t,e){return this.each(("function"==typeof e?function(t,e){return function(){return V(this,t,e.apply(this,arguments))}}:function(t,e){return function(){return V(this,t,e)}})(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var i,o=t[e],a=0,s=o.length;a<s;++a)(i=o[a])&&(yield i)}};var tt={value:()=>{}};function te(){for(var t,e=0,r=arguments.length,i={};e<r;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw Error("illegal type: "+t);i[t]=[]}return new tr(i)}function tr(t){this._=t}function ti(t,e,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=tt,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}tr.prototype=te.prototype={constructor:tr,on:function(t,e){var r,i=this._,o=(t+"").trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!i.hasOwnProperty(t))throw Error("unknown type: "+t);return{type:t,name:e}}),a=-1,s=o.length;if(arguments.length<2){for(;++a<s;)if((r=(t=o[a]).type)&&(r=function(t,e){for(var r,i=0,o=t.length;i<o;++i)if((r=t[i]).name===e)return r.value}(i[r],t.name)))return r;return}if(null!=e&&"function"!=typeof e)throw Error("invalid callback: "+e);for(;++a<s;)if(r=(t=o[a]).type)i[r]=ti(i[r],t.name,e);else if(null==e)for(r in i)i[r]=ti(i[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new tr(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,i,o=Array(r),a=0;a<r;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw Error("unknown type: "+t);for(i=this._[t],a=0,r=i.length;a<r;++a)i[a].value.apply(e,o)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw Error("unknown type: "+t);for(var i=this._[t],o=0,a=i.length;o<a;++o)i[o].value.apply(e,r)}};var to,ta,ts,tn,tl,th,tc,td,tu,tg=0,tp=0,tf=0,ty=0,tm=0,tC=0,tx="object"==typeof performance&&performance.now?performance:Date,tb="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function tk(){return tm||(tb(tw),tm=tx.now()+tC)}function tw(){tm=0}function tB(){this._call=this._time=this._next=null}function tT(t,e,r){var i=new tB;return i.restart(t,e,r),i}function tS(){tm=(ty=tx.now())+tC,tg=tp=0;try{tk(),++tg;for(var t,e=td;e;)(t=tm-e._time)>=0&&e._call.call(void 0,t),e=e._next;--tg}finally{tg=0,function(){for(var t,e,r=td,i=1/0;r;)r._call?(i>r._time&&(i=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:td=e);tu=t,t_(i)}(),tm=0}}function tv(){var t=tx.now(),e=t-ty;e>1e3&&(tC-=e,ty=t)}function t_(t){!tg&&(tp&&(tp=clearTimeout(tp)),t-tm>24?(t<1/0&&(tp=setTimeout(tS,t-tx.now()-tC)),tf&&(tf=clearInterval(tf))):(tf||(ty=tx.now(),tf=setInterval(tv,1e3)),tg=1,tb(tS)))}function tF(t,e,r){var i=new tB;return e=null==e?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,r),i}tB.prototype=tT.prototype={constructor:tB,restart:function(t,e,r){if("function"!=typeof t)throw TypeError("callback is not a function");r=(null==r?tk():+r)+(null==e?0:+e),this._next||tu===this||(tu?tu._next=this:td=this,tu=this),this._call=t,this._time=r,t_()},stop:function(){this._call&&(this._call=null,this._time=1/0,t_())}};var tL=te("start","end","cancel","interrupt"),tA=[];function tM(t,e,r,i,o,a){var s=t.__transition;if(s){if(r in s)return}else t.__transition={};!function(t,e,r){var i,o=t.__transition;function a(l){var h,c,d,u;if(1!==r.state)return n();for(h in o)if((u=o[h]).name===r.name){if(3===u.state)return tF(a);4===u.state?(u.state=6,u.timer.stop(),u.on.call("interrupt",t,t.__data__,u.index,u.group),delete o[h]):+h<e&&(u.state=6,u.timer.stop(),u.on.call("cancel",t,t.__data__,u.index,u.group),delete o[h])}if(tF(function(){3===r.state&&(r.state=4,r.timer.restart(s,r.delay,r.time),s(l))}),r.state=2,r.on.call("start",t,t.__data__,r.index,r.group),2===r.state){for(r.state=3,i=Array(d=r.tween.length),h=0,c=-1;h<d;++h)(u=r.tween[h].value.call(t,t.__data__,r.index,r.group))&&(i[++c]=u);i.length=c+1}}function s(e){for(var o=e<r.duration?r.ease.call(null,e/r.duration):(r.timer.restart(n),r.state=5,1),a=-1,s=i.length;++a<s;)i[a].call(t,o);5===r.state&&(r.on.call("end",t,t.__data__,r.index,r.group),n())}function n(){for(var i in r.state=6,r.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=r,r.timer=tT(function(t){r.state=1,r.timer.restart(a,r.delay,r.time),r.delay<=t&&a(t-r.delay)},0,r.time)}(t,r,{name:e,index:i,group:o,on:tL,tween:tA,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function t$(t,e){var r=tK(t,e);if(r.state>0)throw Error("too late; already scheduled");return r}function tE(t,e){var r=tK(t,e);if(r.state>3)throw Error("too late; already running");return r}function tK(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw Error("transition not found");return r}function tO(t,e){return t*=1,e*=1,function(r){return t*(1-r)+e*r}}var tD=180/Math.PI,tq={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tI(t,e,r,i,o,a){var s,n,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*r+e*i)&&(r-=t*l,i-=e*l),(n=Math.sqrt(r*r+i*i))&&(r/=n,i/=n,l/=n),t*i<e*r&&(t=-t,e=-e,l=-l,s=-s),{translateX:o,translateY:a,rotate:Math.atan2(e,t)*tD,skewX:Math.atan(l)*tD,scaleX:s,scaleY:n}}function tP(t,e,r,i){function o(t){return t.length?t.pop()+" ":""}return function(a,s){var n,l,h,c,d=[],u=[];return a=t(a),s=t(s),!function(t,i,o,a,s,n){if(t!==o||i!==a){var l=s.push("translate(",null,e,null,r);n.push({i:l-4,x:tO(t,o)},{i:l-2,x:tO(i,a)})}else(o||a)&&s.push("translate("+o+e+a+r)}(a.translateX,a.translateY,s.translateX,s.translateY,d,u),n=a.rotate,l=s.rotate,n!==l?(n-l>180?l+=360:l-n>180&&(n+=360),u.push({i:d.push(o(d)+"rotate(",null,i)-2,x:tO(n,l)})):l&&d.push(o(d)+"rotate("+l+i),h=a.skewX,c=s.skewX,h!==c?u.push({i:d.push(o(d)+"skewX(",null,i)-2,x:tO(h,c)}):c&&d.push(o(d)+"skewX("+c+i),!function(t,e,r,i,a,s){if(t!==r||e!==i){var n=a.push(o(a)+"scale(",null,",",null,")");s.push({i:n-4,x:tO(t,r)},{i:n-2,x:tO(e,i)})}else(1!==r||1!==i)&&a.push(o(a)+"scale("+r+","+i+")")}(a.scaleX,a.scaleY,s.scaleX,s.scaleY,d,u),a=s=null,function(t){for(var e,r=-1,i=u.length;++r<i;)d[(e=u[r]).i]=e.x(t);return d.join("")}}}var tW=tP(function(t){let e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?tq:tI(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),tz=tP(function(t){return null==t?tq:(to||(to=document.createElementNS("http://www.w3.org/2000/svg","g")),to.setAttribute("transform",t),t=to.transform.baseVal.consolidate())?tI((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):tq},", ",")",")");function tR(t,e,r){var i=t._id;return t.each(function(){var t=tE(this,i);(t.value||(t.value={}))[e]=r.apply(this,arguments)}),function(t){return tK(t,i).value[e]}}function tj(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function tN(t,e){var r=Object.create(t.prototype);for(var i in e)r[i]=e[i];return r}function tH(){}var tU=1/.7,tY="\\s*([+-]?\\d+)\\s*",tX="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tG="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tV=/^#([0-9a-f]{3,8})$/,tZ=RegExp(`^rgb\\(${tY},${tY},${tY}\\)$`),tQ=RegExp(`^rgb\\(${tG},${tG},${tG}\\)$`),tJ=RegExp(`^rgba\\(${tY},${tY},${tY},${tX}\\)$`),t0=RegExp(`^rgba\\(${tG},${tG},${tG},${tX}\\)$`),t1=RegExp(`^hsl\\(${tX},${tG},${tG}\\)$`),t2=RegExp(`^hsla\\(${tX},${tG},${tG},${tX}\\)$`),t5={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function t3(){return this.rgb().formatHex()}function t4(){return this.rgb().formatRgb()}function t6(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=tV.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?t8(e):3===r?new ee(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?t7(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?t7(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=tZ.exec(t))?new ee(e[1],e[2],e[3],1):(e=tQ.exec(t))?new ee(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=tJ.exec(t))?t7(e[1],e[2],e[3],e[4]):(e=t0.exec(t))?t7(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=t1.exec(t))?en(e[1],e[2]/100,e[3]/100,1):(e=t2.exec(t))?en(e[1],e[2]/100,e[3]/100,e[4]):t5.hasOwnProperty(t)?t8(t5[t]):"transparent"===t?new ee(0/0,0/0,0/0,0):null}function t8(t){return new ee(t>>16&255,t>>8&255,255&t,1)}function t7(t,e,r,i){return i<=0&&(t=e=r=0/0),new ee(t,e,r,i)}function t9(t){return(t instanceof tH||(t=t6(t)),t)?new ee((t=t.rgb()).r,t.g,t.b,t.opacity):new ee}function et(t,e,r,i){return 1==arguments.length?t9(t):new ee(t,e,r,null==i?1:i)}function ee(t,e,r,i){this.r=+t,this.g=+e,this.b=+r,this.opacity=+i}function er(){return`#${es(this.r)}${es(this.g)}${es(this.b)}`}function ei(){let t=eo(this.opacity);return`${1===t?"rgb(":"rgba("}${ea(this.r)}, ${ea(this.g)}, ${ea(this.b)}${1===t?")":`, ${t})`}`}function eo(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ea(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function es(t){return((t=ea(t))<16?"0":"")+t.toString(16)}function en(t,e,r,i){return i<=0?t=e=r=0/0:r<=0||r>=1?t=e=0/0:e<=0&&(t=0/0),new eh(t,e,r,i)}function el(t){if(t instanceof eh)return new eh(t.h,t.s,t.l,t.opacity);if(t instanceof tH||(t=t6(t)),!t)return new eh;if(t instanceof eh)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,o=Math.min(e,r,i),a=Math.max(e,r,i),s=0/0,n=a-o,l=(a+o)/2;return n?(s=e===a?(r-i)/n+(r<i)*6:r===a?(i-e)/n+2:(e-r)/n+4,n/=l<.5?a+o:2-a-o,s*=60):n=l>0&&l<1?0:s,new eh(s,n,l,t.opacity)}function eh(t,e,r,i){this.h=+t,this.s=+e,this.l=+r,this.opacity=+i}function ec(t){return(t=(t||0)%360)<0?t+360:t}function ed(t){return Math.max(0,Math.min(1,t||0))}function eu(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}tj(tH,t6,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:t3,formatHex:t3,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return el(this).formatHsl()},formatRgb:t4,toString:t4}),tj(ee,et,tN(tH,{brighter(t){return t=null==t?tU:Math.pow(tU,t),new ee(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new ee(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ee(ea(this.r),ea(this.g),ea(this.b),eo(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:er,formatHex:er,formatHex8:function(){return`#${es(this.r)}${es(this.g)}${es(this.b)}${es((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:ei,toString:ei})),tj(eh,function(t,e,r,i){return 1==arguments.length?el(t):new eh(t,e,r,null==i?1:i)},tN(tH,{brighter(t){return t=null==t?tU:Math.pow(tU,t),new eh(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new eh(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*e,o=2*r-i;return new ee(eu(t>=240?t-240:t+120,o,i),eu(t,o,i),eu(t<120?t+240:t-120,o,i),this.opacity)},clamp(){return new eh(ec(this.h),ed(this.s),ed(this.l),eo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=eo(this.opacity);return`${1===t?"hsl(":"hsla("}${ec(this.h)}, ${100*ed(this.s)}%, ${100*ed(this.l)}%${1===t?")":`, ${t})`}`}}));var eg=t=>()=>t;function ep(t,e){return function(r){return t+r*e}}function ef(t,e){var r=e-t;return r?ep(t,r):eg(isNaN(t)?e:t)}var ey=function t(e){var r,i=1==(r=+e)?ef:function(t,e){var i,o,a;return e-t?(i=t,o=e,i=Math.pow(i,a=r),o=Math.pow(o,a)-i,a=1/a,function(t){return Math.pow(i+t*o,a)}):eg(isNaN(t)?e:t)};function o(t,e){var r=i((t=et(t)).r,(e=et(e)).r),o=i(t.g,e.g),a=i(t.b,e.b),s=ef(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=a(e),t.opacity=s(e),t+""}}return o.gamma=t,o}(1),em=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,eC=RegExp(em.source,"g");function ex(t,e){var r,i,o,a,s,n=em.lastIndex=eC.lastIndex=0,l=-1,h=[],c=[];for(t+="",e+="";(o=em.exec(t))&&(a=eC.exec(e));)(s=a.index)>n&&(s=e.slice(n,s),h[l]?h[l]+=s:h[++l]=s),(o=o[0])===(a=a[0])?h[l]?h[l]+=a:h[++l]=a:(h[++l]=null,c.push({i:l,x:tO(o,a)})),n=eC.lastIndex;return n<e.length&&(s=e.slice(n),h[l]?h[l]+=s:h[++l]=s),h.length<2?c[0]?(r=c[0].x,function(t){return r(t)+""}):(i=e,function(){return i}):(e=c.length,function(t){for(var r,i=0;i<e;++i)h[(r=c[i]).i]=r.x(t);return h.join("")})}function eb(t,e){var r;return("number"==typeof e?tO:e instanceof t6?ey:(r=t6(e))?(e=r,ey):ex)(t,e)}var ek=J.prototype.constructor;function ew(t){return function(){this.style.removeProperty(t)}}var eB=0;function eT(t,e,r,i){this._groups=t,this._parents=e,this._name=r,this._id=i}var eS=J.prototype;eT.prototype=(function(t){return J().transition(t)}).prototype={constructor:eT,select:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=g(t));for(var i=this._groups,o=i.length,a=Array(o),s=0;s<o;++s)for(var n,l,h=i[s],c=h.length,d=a[s]=Array(c),u=0;u<c;++u)(n=h[u])&&(l=t.call(n,n.__data__,u,h))&&("__data__"in n&&(l.__data__=n.__data__),d[u]=l,tM(d[u],e,r,u,d,tK(n,r)));return new eT(a,this._parents,e,r)},selectAll:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=f(t));for(var i=this._groups,o=i.length,a=[],s=[],n=0;n<o;++n)for(var l,h=i[n],c=h.length,d=0;d<c;++d)if(l=h[d]){for(var u,g=t.call(l,l.__data__,d,h),p=tK(l,r),y=0,m=g.length;y<m;++y)(u=g[y])&&tM(u,e,r,y,g,p);a.push(g),s.push(l)}return new eT(a,s,e,r)},selectChild:eS.selectChild,selectChildren:eS.selectChildren,filter:function(t){"function"!=typeof t&&(t=y(t));for(var e=this._groups,r=e.length,i=Array(r),o=0;o<r;++o)for(var a,s=e[o],n=s.length,l=i[o]=[],h=0;h<n;++h)(a=s[h])&&t.call(a,a.__data__,h,s)&&l.push(a);return new eT(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw Error();for(var e=this._groups,r=t._groups,i=e.length,o=r.length,a=Math.min(i,o),s=Array(i),n=0;n<a;++n)for(var l,h=e[n],c=r[n],d=h.length,u=s[n]=Array(d),g=0;g<d;++g)(l=h[g]||c[g])&&(u[g]=l);for(;n<i;++n)s[n]=e[n];return new eT(s,this._parents,this._name,this._id)},selection:function(){return new ek(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,r=++eB,i=this._groups,o=i.length,a=0;a<o;++a)for(var s,n=i[a],l=n.length,h=0;h<l;++h)if(s=n[h]){var c=tK(s,e);tM(s,t,r,h,n,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new eT(i,this._parents,t,r)},call:eS.call,nodes:eS.nodes,node:eS.node,size:eS.size,empty:eS.empty,each:eS.each,on:function(t,e){var r,i,o,a,s,n,l=this._id;return arguments.length<2?tK(this.node(),l).on.on(t):this.each((r=l,i=t,o=e,n=(i+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})?t$:tE,function(){var t=n(this,r),e=t.on;e!==a&&(s=(a=e).copy()).on(i,o),t.on=s}))},attr:function(t,e){var r=M(t),i="transform"===r?tz:eb;return this.attrTween(t,"function"==typeof e?(r.local?function(t,e,r){var i,o,a;return function(){var s,n,l=r(this);return null==l?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local))===(n=l+"")?null:s===i&&n===o?a:(o=n,a=e(i=s,l))}}:function(t,e,r){var i,o,a;return function(){var s,n,l=r(this);return null==l?void this.removeAttribute(t):(s=this.getAttribute(t))===(n=l+"")?null:s===i&&n===o?a:(o=n,a=e(i=s,l))}})(r,i,tR(this,"attr."+t,e)):null==e?(r.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(r):(r.local?function(t,e,r){var i,o,a=r+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===a?null:s===i?o:o=e(i=s,r)}}:function(t,e,r){var i,o,a=r+"";return function(){var s=this.getAttribute(t);return s===a?null:s===i?o:o=e(i=s,r)}})(r,i,e))},attrTween:function(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw Error();var i=M(t);return this.tween(r,(i.local?function(t,e){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(e){this.setAttributeNS(t.space,t.local,o.call(this,e))}),r}return o._value=e,o}:function(t,e){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(e){this.setAttribute(t,o.call(this,e))}),r}return o._value=e,o})(i,e))},style:function(t,e,r){var i,o,a,s,n,l,h,c,d,u,g,p,f,y,m,C,x,b,k,w,B,T="transform"==(t+="")?tW:eb;return null==e?this.styleTween(t,(i=t,function(){var t=E(this,i),e=(this.style.removeProperty(i),E(this,i));return t===e?null:t===o&&e===a?s:s=T(o=t,a=e)})).on("end.style."+t,ew(t)):"function"==typeof e?this.styleTween(t,(n=t,l=tR(this,"style."+t,e),function(){var t=E(this,n),e=l(this),r=e+"";return null==e&&(this.style.removeProperty(n),r=e=E(this,n)),t===r?null:t===h&&r===c?d:(c=r,d=T(h=t,e))})).each((u=this._id,x="end."+(C="style."+(g=t)),function(){var t=tE(this,u),e=t.on,r=null==t.value[C]?m||(m=ew(g)):void 0;(e!==p||y!==r)&&(f=(p=e).copy()).on(x,y=r),t.on=f})):this.styleTween(t,(b=t,B=e+"",function(){var t=E(this,b);return t===B?null:t===k?w:w=T(k=t,e)}),r).on("end.style."+t,null)},styleTween:function(t,e,r){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw Error();return this.tween(i,function(t,e,r){var i,o;function a(){var a=e.apply(this,arguments);return a!==o&&(i=(o=a)&&function(e){this.style.setProperty(t,a.call(this,e),r)}),i}return a._value=e,a}(t,e,null==r?"":r))},text:function(t){var e,r;return this.tween("text","function"==typeof t?(e=tR(this,"text",t),function(){var t=e(this);this.textContent=null==t?"":t}):(r=null==t?"":t+"",function(){this.textContent=r}))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw Error();return this.tween(e,function(t){var e,r;function i(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t){this.textContent=i.call(this,t)}),e}return i._value=t,i}(t))},remove:function(){var t;return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}))},tween:function(t,e){var r=this._id;if(t+="",arguments.length<2){for(var i,o=tK(this.node(),r).tween,a=0,s=o.length;a<s;++a)if((i=o[a]).name===t)return i.value;return null}return this.each((null==e?function(t,e){var r,i;return function(){var o=tE(this,t),a=o.tween;if(a!==r){i=r=a;for(var s=0,n=i.length;s<n;++s)if(i[s].name===e){(i=i.slice()).splice(s,1);break}}o.tween=i}}:function(t,e,r){var i,o;if("function"!=typeof r)throw Error();return function(){var a=tE(this,t),s=a.tween;if(s!==i){o=(i=s).slice();for(var n={name:e,value:r},l=0,h=o.length;l<h;++l)if(o[l].name===e){o[l]=n;break}l===h&&o.push(n)}a.tween=o}})(r,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){t$(this,t).delay=+e.apply(this,arguments)}}:function(t,e){return e*=1,function(){t$(this,t).delay=e}})(e,t)):tK(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){tE(this,t).duration=+e.apply(this,arguments)}}:function(t,e){return e*=1,function(){tE(this,t).duration=e}})(e,t)):tK(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw Error();return function(){tE(this,t).ease=e}}(e,t)):tK(this.node(),e).ease},easeVarying:function(t){var e;if("function"!=typeof t)throw Error();return this.each((e=this._id,function(){var r=t.apply(this,arguments);if("function"!=typeof r)throw Error();tE(this,e).ease=r}))},end:function(){var t,e,r=this,i=r._id,o=r.size();return new Promise(function(a,s){var n={value:s},l={value:function(){0==--o&&a()}};r.each(function(){var r=tE(this,i),o=r.on;o!==t&&((e=(t=o).copy())._.cancel.push(n),e._.interrupt.push(n),e._.end.push(l)),r.on=e}),0===o&&a()})},[Symbol.iterator]:eS[Symbol.iterator]};var ev={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};J.prototype.interrupt=function(t){return this.each(function(){!function(t,e){var r,i,o,a=t.__transition,s=!0;if(a){for(o in e=null==e?null:e+"",a){if((r=a[o]).name!==e){s=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete a[o]}s&&delete t.__transition}}(this,t)})},J.prototype.transition=function(t){var e,r;t instanceof eT?(e=t._id,t=t._name):(e=++eB,(r=ev).time=tk(),t=null==t?null:t+"");for(var i=this._groups,o=i.length,a=0;a<o;++a)for(var s,n=i[a],l=n.length,h=0;h<l;++h)(s=n[h])&&tM(s,t,e,h,n,r||function(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw Error(`transition ${e} not found`);return r}(s,e));return new eT(i,this._parents,t,e)};let{abs:e_,max:eF,min:eL}=Math;function eA(t){return{type:t}}function eM(t,e){if(!isFinite(t)||0===t)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),i=t.slice(0,r);return[i.length>1?i[0]+i.slice(2):i,+t.slice(r+1)]}function e$(t){return(t=eM(Math.abs(t)))?t[1]:0/0}["w","e"].map(eA),["n","s"].map(eA),["n","w","e","s","nw","ne","sw","se"].map(eA);var eE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function eK(t){var e;if(!(e=eE.exec(t)))throw Error("invalid format: "+t);return new eO({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function eO(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function eD(t,e){var r=eM(t,e);if(!r)return t+"";var i=r[0],o=r[1];return o<0?"0."+Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+Array(o-i.length+2).join("0")}eK.prototype=eO.prototype,eO.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var eq={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>eD(100*t,e),r:eD,s:function(t,e){var r=eM(t,e);if(!r)return ta=void 0,t.toPrecision(e);var i=r[0],o=r[1],a=o-(ta=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,s=i.length;return a===s?i:a>s?i+Array(a-s+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+Array(1-a).join("0")+eM(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function eI(t){return t}var eP=Array.prototype.map,eW=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ez(t){var e=0,r=t.children,i=r&&r.length;if(i)for(;--i>=0;)e+=r[i].value;else e=1;t.value=e}function eR(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=eN)):void 0===e&&(e=ej);for(var r,i,o,a,s,n=new eY(t),l=[n];r=l.pop();)if((o=e(r.data))&&(s=(o=Array.from(o)).length))for(r.children=o,a=s-1;a>=0;--a)l.push(i=o[a]=new eY(o[a])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(eU)}function ej(t){return t.children}function eN(t){return Array.isArray(t)?t[1]:null}function eH(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function eU(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function eY(t){this.data=t,this.depth=this.height=0,this.parent=null}function eX(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}tn=(ts=function(t){var e,r,i,o=void 0===t.grouping||void 0===t.thousands?eI:(e=eP.call(t.grouping,Number),r=t.thousands+"",function(t,i){for(var o=t.length,a=[],s=0,n=e[0],l=0;o>0&&n>0&&(l+n+1>i&&(n=Math.max(1,i-l)),a.push(t.substring(o-=n,o+n)),!((l+=n+1)>i));)n=e[s=(s+1)%e.length];return a.reverse().join(r)}),a=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",n=void 0===t.decimal?".":t.decimal+"",l=void 0===t.numerals?eI:(i=eP.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return i[+t]})}),h=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",d=void 0===t.nan?"NaN":t.nan+"";function u(t,e){var r=(t=eK(t)).fill,i=t.align,u=t.sign,g=t.symbol,p=t.zero,f=t.width,y=t.comma,m=t.precision,C=t.trim,x=t.type;"n"===x?(y=!0,x="g"):eq[x]||(void 0===m&&(m=12),C=!0,x="g"),(p||"0"===r&&"="===i)&&(p=!0,r="0",i="=");var b=(e&&void 0!==e.prefix?e.prefix:"")+("$"===g?a:"#"===g&&/[boxX]/.test(x)?"0"+x.toLowerCase():""),k=("$"===g?s:/[%p]/.test(x)?h:"")+(e&&void 0!==e.suffix?e.suffix:""),w=eq[x],B=/[defgprs%]/.test(x);function T(t){var e,a,s,h=b,g=k;if("c"===x)g=w(t)+g,t="";else{var T=(t*=1)<0||1/t<0;if(t=isNaN(t)?d:w(Math.abs(t),m),C&&(t=function(t){t:for(var e,r=t.length,i=1,o=-1;i<r;++i)switch(t[i]){case".":o=e=i;break;case"0":0===o&&(o=i),e=i;break;default:if(!+t[i])break t;o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),T&&0==+t&&"+"!==u&&(T=!1),h=(T?"("===u?u:c:"-"===u||"("===u?"":u)+h,g=("s"!==x||isNaN(t)||void 0===ta?"":eW[8+ta/3])+g+(T&&"("===u?")":""),B){for(e=-1,a=t.length;++e<a;)if(48>(s=t.charCodeAt(e))||s>57){g=(46===s?n+t.slice(e+1):t.slice(e))+g,t=t.slice(0,e);break}}}y&&!p&&(t=o(t,1/0));var S=h.length+t.length+g.length,v=S<f?Array(f-S+1).join(r):"";switch(y&&p&&(t=o(v+t,v.length?f-g.length:1/0),v=""),i){case"<":t=h+t+g+v;break;case"=":t=h+v+t+g;break;case"^":t=v.slice(0,S=v.length>>1)+h+t+g+v.slice(S);break;default:t=v+h+t+g}return l(t)}return m=void 0===m?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),T.toString=function(){return t+""},T}return{format:u,formatPrefix:function(t,e){var r=3*Math.max(-8,Math.min(8,Math.floor(e$(e)/3))),i=Math.pow(10,-r),o=u(((t=eK(t)).type="f",t),{suffix:eW[8+r/3]});return function(t){return o(i*t)}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,tl=ts.formatPrefix,eY.prototype=eR.prototype={constructor:eY,count:function(){return this.eachAfter(ez)},each:function(t,e){let r=-1;for(let i of this)t.call(e,i,++r,this);return this},eachAfter:function(t,e){for(var r,i,o,a=this,s=[a],n=[],l=-1;a=s.pop();)if(n.push(a),r=a.children)for(i=0,o=r.length;i<o;++i)s.push(r[i]);for(;a=n.pop();)t.call(e,a,++l,this);return this},eachBefore:function(t,e){for(var r,i,o=this,a=[o],s=-1;o=a.pop();)if(t.call(e,o,++s,this),r=o.children)for(i=r.length-1;i>=0;--i)a.push(r[i]);return this},find:function(t,e){let r=-1;for(let i of this)if(t.call(e,i,++r,this))return i},sum:function(t){return this.eachAfter(function(e){for(var r=+t(e.data)||0,i=e.children,o=i&&i.length;--o>=0;)r+=i[o].value;e.value=r})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,r=function(t,e){if(t===e)return t;var r=t.ancestors(),i=e.ancestors(),o=null;for(t=r.pop(),e=i.pop();t===e;)o=t,t=r.pop(),e=i.pop();return o}(e,t),i=[e];e!==r;)i.push(e=e.parent);for(var o=i.length;t!==r;)i.splice(o,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e},copy:function(){return eR(this).eachBefore(eH)},[Symbol.iterator]:function*(){var t,e,r,i,o=this,a=[o];do for(t=a.reverse(),a=[];o=t.pop();)if(yield o,e=o.children)for(r=0,i=e.length;r<i;++r)a.push(e[r]);while(a.length)}};var eG=function t(e){function r(t,r,i,o,a){!function(t,e,r,i,o,a){for(var s,n,l,h,c,d,u,g,p,f,y,m=[],C=e.children,x=0,b=0,k=C.length,w=e.value;x<k;){l=o-r,h=a-i;do c=C[b++].value;while(!c&&b<k)for(d=u=c,p=Math.max(u/(y=c*c*(f=Math.max(h/l,l/h)/(w*t))),y/d);b<k;++b){if(c+=n=C[b].value,n<d&&(d=n),n>u&&(u=n),(g=Math.max(u/(y=c*c*f),y/d))>p){c-=n;break}p=g}m.push(s={value:c,dice:l<h,children:C.slice(x,b)}),s.dice?function(t,e,r,i,o){for(var a,s=t.children,n=-1,l=s.length,h=t.value&&(i-e)/t.value;++n<l;)(a=s[n]).y0=r,a.y1=o,a.x0=e,a.x1=e+=a.value*h}(s,r,i,o,w?i+=h*c/w:a):function(t,e,r,i,o){for(var a,s=t.children,n=-1,l=s.length,h=t.value&&(o-r)/t.value;++n<l;)(a=s[n]).x0=e,a.x1=i,a.y0=r,a.y1=r+=a.value*h}(s,r,i,w?r+=l*c/w:o,a),w-=c,x=b}}(e,t,r,i,o,a)}return r.ratio=function(e){return t((e*=1)>1?e:1)},r}((1+Math.sqrt(5))/2);function eV(){return 0}function eZ(t){return function(){return t}}function eQ(){var t=eG,e=!1,r=1,i=1,o=[0],a=eV,s=eV,n=eV,l=eV,h=eV;function c(t){return t.x0=t.y0=0,t.x1=r,t.y1=i,t.eachBefore(d),o=[0],e&&t.eachBefore(eX),t}function d(e){var r=o[e.depth],i=e.x0+r,c=e.y0+r,d=e.x1-r,u=e.y1-r;d<i&&(i=d=(i+d)/2),u<c&&(c=u=(c+u)/2),e.x0=i,e.y0=c,e.x1=d,e.y1=u,e.children&&(r=o[e.depth+1]=a(e)/2,i+=h(e)-r,c+=s(e)-r,d-=n(e)-r,u-=l(e)-r,d<i&&(i=d=(i+d)/2),u<c&&(c=u=(c+u)/2),t(e,i,c,d,u))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(r=+t[0],i=+t[1],c):[r,i]},c.tile=function(e){return arguments.length?(t=function(t){if("function"!=typeof t)throw Error();return t}(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(a="function"==typeof t?t:eZ(+t),c):a},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(s="function"==typeof t?t:eZ(+t),c):s},c.paddingRight=function(t){return arguments.length?(n="function"==typeof t?t:eZ(+t),c):n},c.paddingBottom=function(t){return arguments.length?(l="function"==typeof t?t:eZ(+t),c):l},c.paddingLeft=function(t){return arguments.length?(h="function"==typeof t?t:eZ(+t),c):h},c}let eJ=Math.PI/180,e0=180/Math.PI,e1=4/29,e2=6/29,e5=6/29*3*(6/29),e3=6/29*(6/29)*(6/29);function e4(t){if(t instanceof e6)return new e6(t.l,t.a,t.b,t.opacity);if(t instanceof rr)return ri(t);t instanceof ee||(t=t9(t));var e,r,i=rt(t.r),o=rt(t.g),a=rt(t.b),s=e8((.2225045*i+.7168786*o+.0606169*a)/1);return i===o&&o===a?e=r=s:(e=e8((.4360747*i+.3850649*o+.1430804*a)/.96422),r=e8((.0139322*i+.0971045*o+.7141733*a)/.82521)),new e6(116*s-16,500*(e-s),200*(s-r),t.opacity)}function e6(t,e,r,i){this.l=+t,this.a=+e,this.b=+r,this.opacity=+i}function e8(t){return t>e3?Math.pow(t,1/3):t/e5+e1}function e7(t){return t>e2?t*t*t:e5*(t-e1)}function e9(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function rt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function re(t,e,r,i){return 1==arguments.length?function(t){if(t instanceof rr)return new rr(t.h,t.c,t.l,t.opacity);if(t instanceof e6||(t=e4(t)),0===t.a&&0===t.b)return new rr(0/0,0<t.l&&t.l<100?0:0/0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*e0;return new rr(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new rr(t,e,r,null==i?1:i)}function rr(t,e,r,i){this.h=+t,this.c=+e,this.l=+r,this.opacity=+i}function ri(t){if(isNaN(t.h))return new e6(t.l,0,0,t.opacity);var e=t.h*eJ;return new e6(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}tj(e6,function(t,e,r,i){return 1==arguments.length?e4(t):new e6(t,e,r,null==i?1:i)},tN(tH,{brighter(t){return new e6(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new e6(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=.96422*e7(e),new ee(e9(3.1338561*e-1.6168667*(t=+e7(t))-.4906146*(r=.82521*e7(r))),e9(-.9787684*e+1.9161415*t+.033454*r),e9(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),tj(rr,re,tN(tH,{brighter(t){return new rr(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new rr(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return ri(this).rgb()}}));var ro=(C=function(t,e){var r=e-t;return r?ep(t,r>180||r<-180?r-360*Math.round(r/360):r):eg(isNaN(t)?e:t)},function(t,e){var r=C((t=re(t)).h,(e=re(e)).h),i=ef(t.c,e.c),o=ef(t.l,e.l),a=ef(t.opacity,e.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=o(e),t.opacity=a(e),t+""}});function ra(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}class rs extends Map{constructor(t,e=rl){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(let[e,r]of t)this.set(e,r)}get(t){return super.get(rn(this,t))}has(t){return super.has(rn(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},r){let i=e(r);return t.has(i)?t.get(i):(t.set(i,r),r)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},r){let i=e(r);return t.has(i)&&(r=t.get(i),t.delete(i)),r}(this,t))}}function rn({_intern:t,_key:e},r){let i=e(r);return t.has(i)?t.get(i):r}function rl(t){return null!==t&&"object"==typeof t?t.valueOf():t}let rh=Symbol("implicit");function rc(){var t=new rs,e=[],r=[],i=rh;function o(o){let a=t.get(o);if(void 0===a){if(i!==rh)return i;t.set(o,a=e.push(o)-1)}return r[a%r.length]}return o.domain=function(r){if(!arguments.length)return e.slice();for(let i of(e=[],t=new rs,r))t.has(i)||t.set(i,e.push(i)-1);return o},o.range=function(t){return arguments.length?(r=Array.from(t),o):r.slice()},o.unknown=function(t){return arguments.length?(i=t,o):i},o.copy=function(){return rc(e,r).unknown(i)},ra.apply(o,arguments),o}let rd=Math.sqrt(50),ru=Math.sqrt(10),rg=Math.sqrt(2);function rp(t,e,r){let i,o,a,s=(e-t)/Math.max(0,r),n=Math.floor(Math.log10(s)),l=s/Math.pow(10,n),h=l>=rd?10:l>=ru?5:l>=rg?2:1;return(n<0?(i=Math.round(t*(a=Math.pow(10,-n)/h)),o=Math.round(e*a),i/a<t&&++i,o/a>e&&--o,a=-a):(i=Math.round(t/(a=Math.pow(10,n)*h)),o=Math.round(e/a),i*a<t&&++i,o*a>e&&--o),o<i&&.5<=r&&r<2)?rp(t,e,2*r):[i,o,a]}function rf(t,e,r){return rp(t*=1,e*=1,r*=1)[2]}function ry(t,e,r){e*=1,t*=1,r*=1;let i=e<t,o=i?rf(e,t,r):rf(t,e,r);return(i?-1:1)*(o<0?-(1/o):o)}function rm(t,e){return null==t||null==e?0/0:t<e?-1:t>e?1:t>=e?0:0/0}function rC(t,e){return null==t||null==e?0/0:e<t?-1:e>t?1:e>=t?0:0/0}function rx(t){let e,r,i;function o(t,i,a=0,s=t.length){if(a<s){if(0!==e(i,i))return s;do{let e=a+s>>>1;0>r(t[e],i)?a=e+1:s=e}while(a<s)}return a}return 2!==t.length?(e=rm,r=(e,r)=>rm(t(e),r),i=(e,r)=>t(e)-r):(e=t===rm||t===rC?t:rb,r=t,i=t),{left:o,center:function(t,e,r=0,a=t.length){let s=o(t,e,r,a-1);return s>r&&i(t[s-1],e)>-i(t[s],e)?s-1:s},right:function(t,i,o=0,a=t.length){if(o<a){if(0!==e(i,i))return a;do{let e=o+a>>>1;0>=r(t[e],i)?o=e+1:a=e}while(o<a)}return o}}}function rb(){return 0}let rk=rx(rm),rw=rk.right;rk.left,rx(function(t){return null===t?0/0:+t}).center;function rB(t,e){return t*=1,e*=1,function(r){return Math.round(t*(1-r)+e*r)}}function rT(t){return+t}var rS=[0,1];function rv(t){return t}function r_(t,e){var r;return(e-=t*=1)?function(r){return(r-t)/e}:(r=isNaN(e)?0/0:.5,function(){return r})}function rF(t,e,r){var i=t[0],o=t[1],a=e[0],s=e[1];return o<i?(i=r_(o,i),a=r(s,a)):(i=r_(i,o),a=r(a,s)),function(t){return a(i(t))}}function rL(t,e,r){var i=Math.min(t.length,e.length)-1,o=Array(i),a=Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)o[s]=r_(t[s],t[s+1]),a[s]=r(e[s],e[s+1]);return function(e){var r=rw(t,e,1,i)-1;return a[r](o[r](e))}}function rA(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function rM(){return(function(){var t,e,r,i,o,a,s=rS,n=rS,l=function t(e,r){var i,o,a=typeof r;return null==r||"boolean"===a?eg(r):("number"===a?tO:"string"===a?(o=t6(r))?(r=o,ey):ex:r instanceof t6?ey:r instanceof Date?function(t,e){var r=new Date;return t*=1,e*=1,function(i){return r.setTime(t*(1-i)+e*i),r}}:!ArrayBuffer.isView(i=r)||i instanceof DataView?Array.isArray(r)?function(e,r){var i,o=r?r.length:0,a=e?Math.min(o,e.length):0,s=Array(a),n=Array(o);for(i=0;i<a;++i)s[i]=t(e[i],r[i]);for(;i<o;++i)n[i]=r[i];return function(t){for(i=0;i<a;++i)n[i]=s[i](t);return n}}:"function"!=typeof r.valueOf&&"function"!=typeof r.toString||isNaN(r)?function(e,r){var i,o={},a={};for(i in(null===e||"object"!=typeof e)&&(e={}),(null===r||"object"!=typeof r)&&(r={}),r)i in e?o[i]=t(e[i],r[i]):a[i]=r[i];return function(t){for(i in o)a[i]=o[i](t);return a}}:tO:function(t,e){e||(e=[]);var r,i=t?Math.min(e.length,t.length):0,o=e.slice();return function(a){for(r=0;r<i;++r)o[r]=t[r]*(1-a)+e[r]*a;return o}})(e,r)},h=rv;function c(){var t,e,r,l=Math.min(s.length,n.length);return h!==rv&&(t=s[0],e=s[l-1],t>e&&(r=t,t=e,e=r),h=function(r){return Math.max(t,Math.min(e,r))}),i=l>2?rL:rF,o=a=null,d}function d(e){return null==e||isNaN(e*=1)?r:(o||(o=i(s.map(t),n,l)))(t(h(e)))}return d.invert=function(r){return h(e((a||(a=i(n,s.map(t),tO)))(r)))},d.domain=function(t){return arguments.length?(s=Array.from(t,rT),c()):s.slice()},d.range=function(t){return arguments.length?(n=Array.from(t),c()):n.slice()},d.rangeRound=function(t){return n=Array.from(t),l=rB,c()},d.clamp=function(t){return arguments.length?(h=!!t||rv,c()):h!==rv},d.interpolate=function(t){return arguments.length?(l=t,c()):l},d.unknown=function(t){return arguments.length?(r=t,d):r},function(r,i){return t=r,e=i,c()}})()(rv,rv)}let r$=new Date,rE=new Date;function rK(t,e,r,i){function o(e){return t(e=0==arguments.length?new Date:new Date(+e)),e}return o.floor=e=>(t(e=new Date(+e)),e),o.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),o.round=t=>{let e=o(t),r=o.ceil(t);return t-e<r-t?e:r},o.offset=(t,r)=>(e(t=new Date(+t),null==r?1:Math.floor(r)),t),o.range=(r,i,a)=>{let s,n=[];if(r=o.ceil(r),a=null==a?1:Math.floor(a),!(r<i)||!(a>0))return n;do n.push(s=new Date(+r)),e(r,a),t(r);while(s<r&&r<i)return n},o.filter=r=>rK(e=>{if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)},(t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!r(t););else for(;--i>=0;)for(;e(t,1),!r(t););}),r&&(o.count=(e,i)=>(r$.setTime(+e),rE.setTime(+i),t(r$),t(rE),Math.floor(r(r$,rE))),o.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?o.filter(i?e=>i(e)%t==0:e=>o.count(0,e)%t==0):o:null),o}let rO=rK(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);rO.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?rK(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):rO:null,rO.range;let rD=rK(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+1e3*e)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds());rD.range;let rq=rK(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getMinutes());rq.range;let rI=rK(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes());rI.range;let rP=rK(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getHours());rP.range;let rW=rK(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours());rW.range;let rz=rK(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1);rz.range;let rR=rK(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1);rR.range;let rj=rK(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5));function rN(t){return rK(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+7*e)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}rj.range;let rH=rN(0),rU=rN(1),rY=rN(2),rX=rN(3),rG=rN(4),rV=rN(5),rZ=rN(6);function rQ(t){return rK(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)},(t,e)=>(e-t)/6048e5)}rH.range,rU.range,rY.range,rX.range,rG.range,rV.range,rZ.range;let rJ=rQ(0),r0=rQ(1),r1=rQ(2),r2=rQ(3),r5=rQ(4),r3=rQ(5),r4=rQ(6);rJ.range,r0.range,r1.range,r2.range,r5.range,r3.range,r4.range;let r6=rK(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());r6.range;let r8=rK(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());r8.range;let r7=rK(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());r7.every=t=>isFinite(t=Math.floor(t))&&t>0?rK(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}):null,r7.range;let r9=rK(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());function it(t,e,r,i,o,a){let s=[[rD,1,1e3],[rD,5,5e3],[rD,15,15e3],[rD,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[i,1,864e5],[i,2,1728e5],[r,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function n(e,r,i){let o=Math.abs(r-e)/i,a=rx(([,,t])=>t).right(s,o);if(a===s.length)return t.every(ry(e/31536e6,r/31536e6,i));if(0===a)return rO.every(Math.max(ry(e,r,i),1));let[n,l]=s[o/s[a-1][2]<s[a][2]/o?a-1:a];return n.every(l)}return[function(t,e,r){let i=e<t;i&&([t,e]=[e,t]);let o=r&&"function"==typeof r.range?r:n(t,e,r),a=o?o.range(t,+e+1):[];return i?a.reverse():a},n]}r9.every=t=>isFinite(t=Math.floor(t))&&t>0?rK(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}):null,r9.range;let[ie,ir]=it(r9,r8,rJ,rj,rW,rI),[ii,io]=it(r7,r6,rH,rz,rP,rq);function ia(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function is(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function il(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}var ih={"-":"",_:" ",0:"0"},ic=/^\s*\d+/,id=/^%/,iu=/[\\^$*+?|[\]().{}]/g;function ig(t,e,r){var i=t<0?"-":"",o=(i?-t:t)+"",a=o.length;return i+(a<r?Array(r-a+1).join(e)+o:o)}function ip(t){return t.replace(iu,"\\$&")}function iy(t){return RegExp("^(?:"+t.map(ip).join("|")+")","i")}function im(t){return new Map(t.map((t,e)=>[t.toLowerCase(),e]))}function iC(t,e,r){var i=ic.exec(e.slice(r,r+1));return i?(t.w=+i[0],r+i[0].length):-1}function ix(t,e,r){var i=ic.exec(e.slice(r,r+1));return i?(t.u=+i[0],r+i[0].length):-1}function ib(t,e,r){var i=ic.exec(e.slice(r,r+2));return i?(t.U=+i[0],r+i[0].length):-1}function ik(t,e,r){var i=ic.exec(e.slice(r,r+2));return i?(t.V=+i[0],r+i[0].length):-1}function iw(t,e,r){var i=ic.exec(e.slice(r,r+2));return i?(t.W=+i[0],r+i[0].length):-1}function iB(t,e,r){var i=ic.exec(e.slice(r,r+4));return i?(t.y=+i[0],r+i[0].length):-1}function iT(t,e,r){var i=ic.exec(e.slice(r,r+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),r+i[0].length):-1}function iS(t,e,r){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),r+i[0].length):-1}function iv(t,e,r){var i=ic.exec(e.slice(r,r+1));return i?(t.q=3*i[0]-3,r+i[0].length):-1}function i_(t,e,r){var i=ic.exec(e.slice(r,r+2));return i?(t.m=i[0]-1,r+i[0].length):-1}function iF(t,e,r){var i=ic.exec(e.slice(r,r+2));return i?(t.d=+i[0],r+i[0].length):-1}function iL(t,e,r){var i=ic.exec(e.slice(r,r+3));return i?(t.m=0,t.d=+i[0],r+i[0].length):-1}function iA(t,e,r){var i=ic.exec(e.slice(r,r+2));return i?(t.H=+i[0],r+i[0].length):-1}function iM(t,e,r){var i=ic.exec(e.slice(r,r+2));return i?(t.M=+i[0],r+i[0].length):-1}function i$(t,e,r){var i=ic.exec(e.slice(r,r+2));return i?(t.S=+i[0],r+i[0].length):-1}function iE(t,e,r){var i=ic.exec(e.slice(r,r+3));return i?(t.L=+i[0],r+i[0].length):-1}function iK(t,e,r){var i=ic.exec(e.slice(r,r+6));return i?(t.L=Math.floor(i[0]/1e3),r+i[0].length):-1}function iO(t,e,r){var i=id.exec(e.slice(r,r+1));return i?r+i[0].length:-1}function iD(t,e,r){var i=ic.exec(e.slice(r));return i?(t.Q=+i[0],r+i[0].length):-1}function iq(t,e,r){var i=ic.exec(e.slice(r));return i?(t.s=+i[0],r+i[0].length):-1}function iI(t,e){return ig(t.getDate(),e,2)}function iP(t,e){return ig(t.getHours(),e,2)}function iW(t,e){return ig(t.getHours()%12||12,e,2)}function iz(t,e){return ig(1+rz.count(r7(t),t),e,3)}function iR(t,e){return ig(t.getMilliseconds(),e,3)}function ij(t,e){return iR(t,e)+"000"}function iN(t,e){return ig(t.getMonth()+1,e,2)}function iH(t,e){return ig(t.getMinutes(),e,2)}function iU(t,e){return ig(t.getSeconds(),e,2)}function iY(t){var e=t.getDay();return 0===e?7:e}function iX(t,e){return ig(rH.count(r7(t)-1,t),e,2)}function iG(t){var e=t.getDay();return e>=4||0===e?rG(t):rG.ceil(t)}function iV(t,e){return t=iG(t),ig(rG.count(r7(t),t)+(4===r7(t).getDay()),e,2)}function iZ(t){return t.getDay()}function iQ(t,e){return ig(rU.count(r7(t)-1,t),e,2)}function iJ(t,e){return ig(t.getFullYear()%100,e,2)}function i0(t,e){return ig((t=iG(t)).getFullYear()%100,e,2)}function i1(t,e){return ig(t.getFullYear()%1e4,e,4)}function i2(t,e){var r=t.getDay();return ig((t=r>=4||0===r?rG(t):rG.ceil(t)).getFullYear()%1e4,e,4)}function i5(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ig(e/60|0,"0",2)+ig(e%60,"0",2)}function i3(t,e){return ig(t.getUTCDate(),e,2)}function i4(t,e){return ig(t.getUTCHours(),e,2)}function i6(t,e){return ig(t.getUTCHours()%12||12,e,2)}function i8(t,e){return ig(1+rR.count(r9(t),t),e,3)}function i7(t,e){return ig(t.getUTCMilliseconds(),e,3)}function i9(t,e){return i7(t,e)+"000"}function ot(t,e){return ig(t.getUTCMonth()+1,e,2)}function oe(t,e){return ig(t.getUTCMinutes(),e,2)}function or(t,e){return ig(t.getUTCSeconds(),e,2)}function oi(t){var e=t.getUTCDay();return 0===e?7:e}function oo(t,e){return ig(rJ.count(r9(t)-1,t),e,2)}function oa(t){var e=t.getUTCDay();return e>=4||0===e?r5(t):r5.ceil(t)}function os(t,e){return t=oa(t),ig(r5.count(r9(t),t)+(4===r9(t).getUTCDay()),e,2)}function on(t){return t.getUTCDay()}function ol(t,e){return ig(r0.count(r9(t)-1,t),e,2)}function oh(t,e){return ig(t.getUTCFullYear()%100,e,2)}function oc(t,e){return ig((t=oa(t)).getUTCFullYear()%100,e,2)}function od(t,e){return ig(t.getUTCFullYear()%1e4,e,4)}function ou(t,e){var r=t.getUTCDay();return ig((t=r>=4||0===r?r5(t):r5.ceil(t)).getUTCFullYear()%1e4,e,4)}function og(){return"+0000"}function op(){return"%"}function of(t){return+t}function oy(t){return Math.floor(t/1e3)}function om(t){return new Date(t)}function oC(t){return t instanceof Date?+t:+new Date(+t)}function ox(){return ra.apply((function t(e,r,i,o,a,s,n,l,h,c){var d=rM(),u=d.invert,g=d.domain,p=c(".%L"),f=c(":%S"),y=c("%I:%M"),m=c("%I %p"),C=c("%a %d"),x=c("%b %d"),b=c("%B"),k=c("%Y");function w(t){return(h(t)<t?p:l(t)<t?f:n(t)<t?y:s(t)<t?m:o(t)<t?a(t)<t?C:x:i(t)<t?b:k)(t)}return d.invert=function(t){return new Date(u(t))},d.domain=function(t){return arguments.length?g(Array.from(t,oC)):g().map(om)},d.ticks=function(t){var r=g();return e(r[0],r[r.length-1],null==t?10:t)},d.tickFormat=function(t,e){return null==e?w:c(e)},d.nice=function(t){var e,i,o,a,s,n,l,h=g();return t&&"function"==typeof t.range||(t=r(h[0],h[h.length-1],null==t?10:t)),t?g((e=h,i=t,e=e.slice(),a=0,s=e.length-1,n=e[a],(l=e[s])<n&&(o=a,a=s,s=o,o=n,n=l,l=o),e[a]=i.floor(n),e[s]=i.ceil(l),e)):d},d.copy=function(){return rA(d,t(e,r,i,o,a,s,n,l,h,c))},d})(ii,io,r7,r6,rH,rz,rP,rq,rD,tc).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}tc=(th=function(t){var e=t.dateTime,r=t.date,i=t.time,o=t.periods,a=t.days,s=t.shortDays,n=t.months,l=t.shortMonths,h=iy(o),c=im(o),d=iy(a),u=im(a),g=iy(s),p=im(s),f=iy(n),y=im(n),m=iy(l),C=im(l),x={a:function(t){return s[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return n[t.getMonth()]},c:null,d:iI,e:iI,f:ij,g:i0,G:i2,H:iP,I:iW,j:iz,L:iR,m:iN,M:iH,p:function(t){return o[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:of,s:oy,S:iU,u:iY,U:iX,V:iV,w:iZ,W:iQ,x:null,X:null,y:iJ,Y:i1,Z:i5,"%":op},b={a:function(t){return s[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return n[t.getUTCMonth()]},c:null,d:i3,e:i3,f:i9,g:oc,G:ou,H:i4,I:i6,j:i8,L:i7,m:ot,M:oe,p:function(t){return o[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:of,s:oy,S:or,u:oi,U:oo,V:os,w:on,W:ol,x:null,X:null,y:oh,Y:od,Z:og,"%":op},k={a:function(t,e,r){var i=g.exec(e.slice(r));return i?(t.w=p.get(i[0].toLowerCase()),r+i[0].length):-1},A:function(t,e,r){var i=d.exec(e.slice(r));return i?(t.w=u.get(i[0].toLowerCase()),r+i[0].length):-1},b:function(t,e,r){var i=m.exec(e.slice(r));return i?(t.m=C.get(i[0].toLowerCase()),r+i[0].length):-1},B:function(t,e,r){var i=f.exec(e.slice(r));return i?(t.m=y.get(i[0].toLowerCase()),r+i[0].length):-1},c:function(t,r,i){return T(t,e,r,i)},d:iF,e:iF,f:iK,g:iT,G:iB,H:iA,I:iA,j:iL,L:iE,m:i_,M:iM,p:function(t,e,r){var i=h.exec(e.slice(r));return i?(t.p=c.get(i[0].toLowerCase()),r+i[0].length):-1},q:iv,Q:iD,s:iq,S:i$,u:ix,U:ib,V:ik,w:iC,W:iw,x:function(t,e,i){return T(t,r,e,i)},X:function(t,e,r){return T(t,i,e,r)},y:iT,Y:iB,Z:iS,"%":iO};function w(t,e){return function(r){var i,o,a,s=[],n=-1,l=0,h=t.length;for(r instanceof Date||(r=new Date(+r));++n<h;)37===t.charCodeAt(n)&&(s.push(t.slice(l,n)),null!=(o=ih[i=t.charAt(++n)])?i=t.charAt(++n):o="e"===i?" ":"0",(a=e[i])&&(i=a(r,o)),s.push(i),l=n+1);return s.push(t.slice(l,n)),s.join("")}}function B(t,e){return function(r){var i,o,a=il(1900,void 0,1);if(T(a,t,r+="",0)!=r.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(!e||"Z"in a||(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(i=(o=(i=is(il(a.y,0,1))).getUTCDay())>4||0===o?r0.ceil(i):r0(i),i=rR.offset(i,(a.V-1)*7),a.y=i.getUTCFullYear(),a.m=i.getUTCMonth(),a.d=i.getUTCDate()+(a.w+6)%7):(i=(o=(i=ia(il(a.y,0,1))).getDay())>4||0===o?rU.ceil(i):rU(i),i=rz.offset(i,(a.V-1)*7),a.y=i.getFullYear(),a.m=i.getMonth(),a.d=i.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:+("W"in a)),o="Z"in a?is(il(a.y,0,1)).getUTCDay():ia(il(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,is(a)):ia(a)}}function T(t,e,r,i){for(var o,a,s=0,n=e.length,l=r.length;s<n;){if(i>=l)return -1;if(37===(o=e.charCodeAt(s++))){if(!(a=k[(o=e.charAt(s++))in ih?e.charAt(s++):o])||(i=a(t,r,i))<0)return -1}else if(o!=r.charCodeAt(i++))return -1}return i}return x.x=w(r,x),x.X=w(i,x),x.c=w(e,x),b.x=w(r,b),b.X=w(i,b),b.c=w(e,b),{format:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},parse:function(t){var e=B(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=B(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,th.parse,th.utcFormat,th.utcParse;var ob=function(t){for(var e=t.length/6|0,r=Array(e),i=0;i<e;)r[i]="#"+t.slice(6*i,6*++i);return r}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ok(t){return"string"==typeof t?new Q([[document.querySelector(t)]],[document.documentElement]):new Q([[t]],Z)}function ow(t){return function(){return t}}let oB=Math.abs,oT=Math.atan2,oS=Math.cos,ov=Math.max,o_=Math.min,oF=Math.sin,oL=Math.sqrt,oA=Math.PI,oM=oA/2,o$=2*oA;function oE(t){return t>=1?oM:t<=-1?-oM:Math.asin(t)}let oK=Math.PI,oO=2*oK,oD=oO-1e-6;function oq(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}class oI{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?oq:function(t){let e=Math.floor(t);if(!(e>=0))throw Error(`invalid digits: ${t}`);if(e>15)return oq;let r=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*r)/r+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,r,i){this._append`Q${+t},${+e},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,e,r,i,o,a){this._append`C${+t},${+e},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(t,e,r,i,o){if(t*=1,e*=1,r*=1,i*=1,(o*=1)<0)throw Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,n=r-t,l=i-e,h=a-t,c=s-e,d=h*h+c*c;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(d>1e-6)if(Math.abs(c*n-l*h)>1e-6&&o){let u=r-a,g=i-s,p=n*n+l*l,f=Math.sqrt(p),y=Math.sqrt(d),m=o*Math.tan((oK-Math.acos((p+d-(u*u+g*g))/(2*f*y)))/2),C=m/y,x=m/f;Math.abs(C-1)>1e-6&&this._append`L${t+C*h},${e+C*c}`,this._append`A${o},${o},0,0,${+(c*u>h*g)},${this._x1=t+x*n},${this._y1=e+x*l}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,r,i,o,a){if(t*=1,e*=1,r*=1,a=!!a,r<0)throw Error(`negative radius: ${r}`);let s=r*Math.cos(i),n=r*Math.sin(i),l=t+s,h=e+n,c=1^a,d=a?i-o:o-i;null===this._x1?this._append`M${l},${h}`:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-h)>1e-6)&&this._append`L${l},${h}`,r&&(d<0&&(d=d%oO+oO),d>oD?this._append`A${r},${r},0,1,${c},${t-s},${e-n}A${r},${r},0,1,${c},${this._x1=l},${this._y1=h}`:d>1e-6&&this._append`A${r},${r},0,${+(d>=oK)},${c},${this._x1=t+r*Math.cos(o)},${this._y1=e+r*Math.sin(o)}`)}rect(t,e,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${r*=1}v${+i}h${-r}Z`}toString(){return this._}}function oP(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(null==r)e=null;else{let t=Math.floor(r);if(!(t>=0))throw RangeError(`invalid digits: ${r}`);e=t}return t},()=>new oI(e)}function oW(t){return t.innerRadius}function oz(t){return t.outerRadius}function oR(t){return t.startAngle}function oj(t){return t.endAngle}function oN(t){return t&&t.padAngle}function oH(t,e,r,i,o,a,s){var n=t-r,l=e-i,h=(s?a:-a)/oL(n*n+l*l),c=h*l,d=-h*n,u=t+c,g=e+d,p=r+c,f=i+d,y=(u+p)/2,m=(g+f)/2,C=p-u,x=f-g,b=C*C+x*x,k=o-a,w=u*f-p*g,B=(x<0?-1:1)*oL(ov(0,k*k*b-w*w)),T=(w*x-C*B)/b,S=(-w*C-x*B)/b,v=(w*x+C*B)/b,_=(-w*C+x*B)/b,F=T-y,L=S-m,A=v-y,M=_-m;return F*F+L*L>A*A+M*M&&(T=v,S=_),{cx:T,cy:S,x01:-c,y01:-d,x11:T*(o/k-1),y11:S*(o/k-1)}}function oU(){var t=oW,e=oz,r=ow(0),i=null,o=oR,a=oj,s=oN,n=null,l=oP(h);function h(){var h,c,d=+t.apply(this,arguments),u=+e.apply(this,arguments),g=o.apply(this,arguments)-oM,p=a.apply(this,arguments)-oM,f=oB(p-g),y=p>g;if(n||(n=h=l()),u<d&&(c=u,u=d,d=c),u>1e-12)if(f>o$-1e-12)n.moveTo(u*oS(g),u*oF(g)),n.arc(0,0,u,g,p,!y),d>1e-12&&(n.moveTo(d*oS(p),d*oF(p)),n.arc(0,0,d,p,g,y));else{var m,C,x=g,b=p,k=g,w=p,B=f,T=f,S=s.apply(this,arguments)/2,v=S>1e-12&&(i?+i.apply(this,arguments):oL(d*d+u*u)),_=o_(oB(u-d)/2,+r.apply(this,arguments)),F=_,L=_;if(v>1e-12){var A=oE(v/d*oF(S)),M=oE(v/u*oF(S));(B-=2*A)>1e-12?(A*=y?1:-1,k+=A,w-=A):(B=0,k=w=(g+p)/2),(T-=2*M)>1e-12?(M*=y?1:-1,x+=M,b-=M):(T=0,x=b=(g+p)/2)}var $=u*oS(x),E=u*oF(x),K=d*oS(w),O=d*oF(w);if(_>1e-12){var D,q=u*oS(b),I=u*oF(b),P=d*oS(k),W=d*oF(k);if(f<oA)if(D=function(t,e,r,i,o,a,s,n){var l=r-t,h=i-e,c=s-o,d=n-a,u=d*l-c*h;if(!(u*u<1e-12))return u=(c*(e-a)-d*(t-o))/u,[t+u*l,e+u*h]}($,E,P,W,q,I,K,O)){var z,R=$-D[0],j=E-D[1],N=q-D[0],H=I-D[1],U=1/oF(((z=(R*N+j*H)/(oL(R*R+j*j)*oL(N*N+H*H)))>1?0:z<-1?oA:Math.acos(z))/2),Y=oL(D[0]*D[0]+D[1]*D[1]);F=o_(_,(d-Y)/(U-1)),L=o_(_,(u-Y)/(U+1))}else F=L=0}T>1e-12?L>1e-12?(m=oH(P,W,$,E,u,L,y),C=oH(q,I,K,O,u,L,y),n.moveTo(m.cx+m.x01,m.cy+m.y01),L<_?n.arc(m.cx,m.cy,L,oT(m.y01,m.x01),oT(C.y01,C.x01),!y):(n.arc(m.cx,m.cy,L,oT(m.y01,m.x01),oT(m.y11,m.x11),!y),n.arc(0,0,u,oT(m.cy+m.y11,m.cx+m.x11),oT(C.cy+C.y11,C.cx+C.x11),!y),n.arc(C.cx,C.cy,L,oT(C.y11,C.x11),oT(C.y01,C.x01),!y))):(n.moveTo($,E),n.arc(0,0,u,x,b,!y)):n.moveTo($,E),d>1e-12&&B>1e-12?F>1e-12?(m=oH(K,O,q,I,d,-F,y),C=oH($,E,P,W,d,-F,y),n.lineTo(m.cx+m.x01,m.cy+m.y01),F<_?n.arc(m.cx,m.cy,F,oT(m.y01,m.x01),oT(C.y01,C.x01),!y):(n.arc(m.cx,m.cy,F,oT(m.y01,m.x01),oT(m.y11,m.x11),!y),n.arc(0,0,d,oT(m.cy+m.y11,m.cx+m.x11),oT(C.cy+C.y11,C.cx+C.x11),y),n.arc(C.cx,C.cy,F,oT(C.y11,C.x11),oT(C.y01,C.x01),!y))):n.arc(0,0,d,w,k,y):n.lineTo(K,O)}else n.moveTo(0,0);if(n.closePath(),h)return n=null,h+""||null}return h.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-oA/2;return[oS(i)*r,oF(i)*r]},h.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ow(+e),h):t},h.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ow(+t),h):e},h.cornerRadius=function(t){return arguments.length?(r="function"==typeof t?t:ow(+t),h):r},h.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:ow(+t),h):i},h.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:ow(+t),h):o},h.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:ow(+t),h):a},h.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:ow(+t),h):s},h.context=function(t){return arguments.length?(n=null==t?null:t,h):n},h}function oY(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function oX(t){this._context=t}function oG(t){return new oX(t)}function oV(t){return t[0]}function oZ(t){return t[1]}function oQ(t,e){var r=ow(!0),i=null,o=oG,a=null,s=oP(n);function n(n){var l,h,c,d=(n=oY(n)).length,u=!1;for(null==i&&(a=o(c=s())),l=0;l<=d;++l)!(l<d&&r(h=n[l],l,n))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+t(h,l,n),+e(h,l,n));if(c)return a=null,c+""||null}return t="function"==typeof t?t:void 0===t?oV:ow(t),e="function"==typeof e?e:void 0===e?oZ:ow(e),n.x=function(e){return arguments.length?(t="function"==typeof e?e:ow(+e),n):t},n.y=function(t){return arguments.length?(e="function"==typeof t?t:ow(+t),n):e},n.defined=function(t){return arguments.length?(r="function"==typeof t?t:ow(!!t),n):r},n.curve=function(t){return arguments.length?(o=t,null!=i&&(a=o(i)),n):o},n.context=function(t){return arguments.length?(null==t?i=a=null:a=o(i=t),n):i},n}function oJ(t,e){return e<t?-1:e>t?1:e>=t?0:0/0}function o0(t){return t}function o1(){var t=o0,e=oJ,r=null,i=ow(0),o=ow(o$),a=ow(0);function s(s){var n,l,h,c,d,u=(s=oY(s)).length,g=0,p=Array(u),f=Array(u),y=+i.apply(this,arguments),m=Math.min(o$,Math.max(-o$,o.apply(this,arguments)-y)),C=Math.min(Math.abs(m)/u,a.apply(this,arguments)),x=C*(m<0?-1:1);for(n=0;n<u;++n)(d=f[p[n]=n]=+t(s[n],n,s))>0&&(g+=d);for(null!=e?p.sort(function(t,r){return e(f[t],f[r])}):null!=r&&p.sort(function(t,e){return r(s[t],s[e])}),n=0,h=g?(m-u*x)/g:0;n<u;++n,y=c)c=y+((d=f[l=p[n]])>0?d*h:0)+x,f[l]={data:s[l],index:n,value:d,startAngle:y,endAngle:c,padAngle:C};return f}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:ow(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,r=null,s):e},s.sort=function(t){return arguments.length?(r=t,e=null,s):r},s.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:ow(+t),s):i},s.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:ow(+t),s):o},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:ow(+t),s):a},s}function o2(){}function o5(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function o3(t){this._context=t}function o4(t){return new o3(t)}function o6(t){this._context=t}function o8(t){return new o6(t)}function o7(t){this._context=t}function o9(t){return new o7(t)}oI.prototype,Array.prototype.slice,oX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}},o3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._y0=this._y1=0/0,this._point=0},lineEnd:function(){switch(this._point){case 3:o5(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:o5(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},o6.prototype={areaStart:o2,areaEnd:o2,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=0/0,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:o5(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},o7.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._y0=this._y1=0/0,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:o5(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};class at{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=0/0}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function ae(t){return new at(t,!0)}function ar(t){return new at(t,!1)}function ai(t,e){this._basis=new o3(t),this._beta=e}ai.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var i,o=t[0],a=e[0],s=t[r]-o,n=e[r]-a,l=-1;++l<=r;)i=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+i*s),this._beta*e[l]+(1-this._beta)*(a+i*n));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var ao=function t(e){function r(t){return 1===e?new o3(t):new ai(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function aa(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function as(t,e){this._context=t,this._k=(1-e)/6}as.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=0/0,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:aa(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:aa(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var an=function t(e){function r(t){return new as(t,e)}return r.tension=function(e){return t(+e)},r}(0);function al(t,e){this._context=t,this._k=(1-e)/6}al.prototype={areaStart:o2,areaEnd:o2,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=0/0,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:aa(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ah=function t(e){function r(t){return new al(t,e)}return r.tension=function(e){return t(+e)},r}(0);function ac(t,e){this._context=t,this._k=(1-e)/6}ac.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=0/0,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:aa(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ad=function t(e){function r(t){return new ac(t,e)}return r.tension=function(e){return t(+e)},r}(0);function au(t,e,r){var i=t._x1,o=t._y1,a=t._x2,s=t._y2;if(t._l01_a>1e-12){var n=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*n-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*n-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>1e-12){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*h+t._x1*t._l23_2a-e*t._l12_2a)/c,s=(s*h+t._y1*t._l23_2a-r*t._l12_2a)/c}t._context.bezierCurveTo(i,o,a,s,t._x2,t._y2)}function ag(t,e){this._context=t,this._alpha=e}ag.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=0/0,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t*=1,e*=1,this._point){var r=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:au(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ap=function t(e){function r(t){return e?new ag(t,e):new as(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function af(t,e){this._context=t,this._alpha=e}af.prototype={areaStart:o2,areaEnd:o2,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=0/0,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t*=1,e*=1,this._point){var r=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:au(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ay=function t(e){function r(t){return e?new af(t,e):new al(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function am(t,e){this._context=t,this._alpha=e}am.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=0/0,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t*=1,e*=1,this._point){var r=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:au(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var aC=function t(e){function r(t){return e?new am(t,e):new ac(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function ax(t){this._context=t}function ab(t){return new ax(t)}function ak(t,e,r){var i=t._x1-t._x0,o=e-t._x1,a=(t._y1-t._y0)/(i||o<0&&-0),s=(r-t._y1)/(o||i<0&&-0);return((a<0?-1:1)+(s<0?-1:1))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs((a*o+s*i)/(i+o)))||0}function aw(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function aB(t,e,r){var i=t._x0,o=t._y0,a=t._x1,s=t._y1,n=(a-i)/3;t._context.bezierCurveTo(i+n,o+n*e,a-n,s-n*r,a,s)}function aT(t){this._context=t}function aS(t){this._context=new av(t)}function av(t){this._context=t}function a_(t){return new aT(t)}function aF(t){return new aS(t)}function aL(t){this._context=t}function aA(t){var e,r,i=t.length-1,o=Array(i),a=Array(i),s=Array(i);for(o[0]=0,a[0]=2,s[0]=t[0]+2*t[1],e=1;e<i-1;++e)o[e]=1,a[e]=4,s[e]=4*t[e]+2*t[e+1];for(o[i-1]=2,a[i-1]=7,s[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)r=o[e]/a[e-1],a[e]-=r,s[e]-=r*s[e-1];for(o[i-1]=s[i-1]/a[i-1],e=i-2;e>=0;--e)o[e]=(s[e]-o[e+1])/a[e];for(a[i-1]=(t[i]+o[i-1])/2,e=0;e<i-1;++e)a[e]=2*t[e+1]-o[e+1];return[o,a]}function aM(t){return new aL(t)}function a$(t,e){this._context=t,this._t=e}function aE(t){return new a$(t,.5)}function aK(t){return new a$(t,0)}function aO(t){return new a$(t,1)}function aD(t,e,r){this.k=t,this.x=e,this.y=r}ax.prototype={areaStart:o2,areaEnd:o2,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t*=1,e*=1,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},aT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=0/0,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:aB(this,this._t0,aw(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=0/0;if(e*=1,(t*=1)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,aB(this,aw(this,r=ak(this,t,e)),r);break;default:aB(this,this._t0,r=ak(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}},(aS.prototype=Object.create(aT.prototype)).point=function(t,e){aT.prototype.point.call(this,e,t)},av.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,i,o,a){this._context.bezierCurveTo(e,t,i,r,a,o)}},aL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===r)this._context.lineTo(t[1],e[1]);else for(var i=aA(t),o=aA(e),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(i[0][a],o[0][a],i[1][a],o[1][a],t[s],e[s]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},a$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x=this._y=0/0,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},aD.prototype={constructor:aD,scale:function(t){return 1===t?this:new aD(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new aD(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};new aD(1,0,0);aD.prototype},DH(t,e,r){"use strict";function i(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}r.d(e,{b:()=>i})},VV(t,e,r){"use strict";r.d(e,{},{$V:"[object Boolean]",Av:"[object RegExp]",GX:"[object Object]",ML:"[object Float64Array]",NA:"[object Set]",OG:"[object String]",Qb:"[object Uint8Array]",R_:"[object Arguments]",Uw:"[object Array]",VP:"[object Symbol]",XZ:"[object Int8Array]",ZR:"[object Uint32Array]",_u:"[object Int32Array]",cT:"[object ArrayBuffer]",i1:"[object Int16Array]",iq:"[object DataView]",kj:"[object Number]",pj:"[object Map]",q:"[object Uint8ClampedArray]",ri:"[object Float32Array]",vC:"[object Date]",x6:"[object Uint16Array]"})},rY0(t,e,r){"use strict";var i=r("DH");function o(t){return null!==t&&"object"==typeof t&&"[object Arguments]"===(0,i.b)(t)}r.d(e,{N:()=>o})},tNQ(t,e,r){"use strict";function i(t){var e;return null!=t&&"function"!=typeof t&&Number.isSafeInteger(e=t.length)&&e>=0}r.d(e,{X:()=>i})},SPK(t,e,r){"use strict";var i=r("Oe");function o(t){return(0,i.i)(t)}r.d(e,{i:()=>o})},NM(t,e,r){"use strict";r.d(e,{P:()=>o});let i="object"==typeof globalThis&&globalThis||"object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||function(){return this}();function o(t){return void 0!==i.Buffer&&i.Buffer.isBuffer(t)}},OY(t,e,r){"use strict";function i(t){return null==t||"object"!=typeof t&&"function"!=typeof t}r.d(e,{s:()=>i})},Oe(t,e,r){"use strict";function i(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}r.d(e,{i:()=>i})},ojl(t,e,r){"use strict";r.d(e,{A:()=>s});var i=r("Wq"),o=r("SSY"),a=class{constructor(){this.type=o.Z.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=o.Z.ALL}is(t){return this.type===t}},s=new class{constructor(t,e){this.color=e,this.changed=!1,this.data=t,this.type=new a}set(t,e){return this.color=e,this.changed=!1,this.data=t,this.type.type=o.Z.ALL,this}_ensureHSL(){let t=this.data,{h:e,s:r,l:o}=t;void 0===e&&(t.h=i.A.channel.rgb2hsl(t,"h")),void 0===r&&(t.s=i.A.channel.rgb2hsl(t,"s")),void 0===o&&(t.l=i.A.channel.rgb2hsl(t,"l"))}_ensureRGB(){let t=this.data,{r:e,g:r,b:o}=t;void 0===e&&(t.r=i.A.channel.hsl2rgb(t,"r")),void 0===r&&(t.g=i.A.channel.hsl2rgb(t,"g")),void 0===o&&(t.b=i.A.channel.hsl2rgb(t,"b"))}get r(){let t=this.data,e=t.r;return this.type.is(o.Z.HSL)||void 0===e?(this._ensureHSL(),i.A.channel.hsl2rgb(t,"r")):e}get g(){let t=this.data,e=t.g;return this.type.is(o.Z.HSL)||void 0===e?(this._ensureHSL(),i.A.channel.hsl2rgb(t,"g")):e}get b(){let t=this.data,e=t.b;return this.type.is(o.Z.HSL)||void 0===e?(this._ensureHSL(),i.A.channel.hsl2rgb(t,"b")):e}get h(){let t=this.data,e=t.h;return this.type.is(o.Z.RGB)||void 0===e?(this._ensureRGB(),i.A.channel.rgb2hsl(t,"h")):e}get s(){let t=this.data,e=t.s;return this.type.is(o.Z.RGB)||void 0===e?(this._ensureRGB(),i.A.channel.rgb2hsl(t,"s")):e}get l(){let t=this.data,e=t.l;return this.type.is(o.Z.RGB)||void 0===e?(this._ensureRGB(),i.A.channel.rgb2hsl(t,"l")):e}get a(){return this.data.a}set r(t){this.type.set(o.Z.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(o.Z.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(o.Z.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(o.Z.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(o.Z.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(o.Z.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}({r:0,g:0,b:0,a:0},"transparent")},ja(t,e,r){"use strict";r.d(e,{A:()=>c});var i=r("ojl"),o=r("SSY");let a={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(35!==t.charCodeAt(0))return;let e=t.match(a.re);if(!e)return;let r=e[1],o=parseInt(r,16),s=r.length,n=s%4==0,l=s>4,h=l?1:17,c=l?8:4,d=n?0:-1,u=l?255:15;return i.A.set({r:(o>>c*(d+3)&u)*h,g:(o>>c*(d+2)&u)*h,b:(o>>c*(d+1)&u)*h,a:n?(o&u)*h/255:1},t)},stringify:t=>{let{r:e,g:r,b:i,a}=t;return a<1?`#${o.Y[Math.round(e)]}${o.Y[Math.round(r)]}${o.Y[Math.round(i)]}${o.Y[Math.round(255*a)]}`:`#${o.Y[Math.round(e)]}${o.Y[Math.round(r)]}${o.Y[Math.round(i)]}`}};var s=r("Wq");let n={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{let e=t.match(n.hueRe);if(e){let[,t,r]=e;switch(r){case"grad":return s.A.channel.clamp.h(.9*parseFloat(t));case"rad":return s.A.channel.clamp.h(180*parseFloat(t)/Math.PI);case"turn":return s.A.channel.clamp.h(360*parseFloat(t))}}return s.A.channel.clamp.h(parseFloat(t))},parse:t=>{let e=t.charCodeAt(0);if(104!==e&&72!==e)return;let r=t.match(n.re);if(!r)return;let[,o,a,l,h,c]=r;return i.A.set({h:n._hue2deg(o),s:s.A.channel.clamp.s(parseFloat(a)),l:s.A.channel.clamp.l(parseFloat(l)),a:h?s.A.channel.clamp.a(c?parseFloat(h)/100:parseFloat(h)):1},t)},stringify:t=>{let{h:e,s:r,l:i,a:o}=t;return o<1?`hsla(${s.A.lang.round(e)}, ${s.A.lang.round(r)}%, ${s.A.lang.round(i)}%, ${o})`:`hsl(${s.A.lang.round(e)}, ${s.A.lang.round(r)}%, ${s.A.lang.round(i)}%)`}},l={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();let e=l.colors[t];if(e)return a.parse(e)},stringify:t=>{let e=a.stringify(t);for(let t in l.colors)if(l.colors[t]===e)return t}},h={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{let e=t.charCodeAt(0);if(114!==e&&82!==e)return;let r=t.match(h.re);if(!r)return;let[,o,a,n,l,c,d,u,g]=r;return i.A.set({r:s.A.channel.clamp.r(a?2.55*parseFloat(o):parseFloat(o)),g:s.A.channel.clamp.g(l?2.55*parseFloat(n):parseFloat(n)),b:s.A.channel.clamp.b(d?2.55*parseFloat(c):parseFloat(c)),a:u?s.A.channel.clamp.a(g?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{let{r:e,g:r,b:i,a:o}=t;return o<1?`rgba(${s.A.lang.round(e)}, ${s.A.lang.round(r)}, ${s.A.lang.round(i)}, ${s.A.lang.round(o)})`:`rgb(${s.A.lang.round(e)}, ${s.A.lang.round(r)}, ${s.A.lang.round(i)})`}};var c={format:{keyword:l,hex:a,rgb:h,rgba:h,hsl:n,hsla:n},parse:t=>{if("string"!=typeof t)return t;let e=a.parse(t)||h.parse(t)||n.parse(t)||l.parse(t);if(e)return e;throw Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(o.Z.HSL)||void 0===t.data.r?n.stringify(t):!(t.a<1)&&Number.isInteger(t.r)&&Number.isInteger(t.g)&&Number.isInteger(t.b)?a.stringify(t):h.stringify(t)}},SSY(t,e,r){"use strict";var i=r("Wq");let o={};for(let t=0;t<=255;t++)o[t]=i.A.unit.dec2hex(t);r.d(e,{},{Y:o,Z:{ALL:0,RGB:1,HSL:2}})},bg(t,e,r){"use strict";var i=r("Wq"),o=r("ja");e.A=(t,e,r)=>{let a=o.A.parse(t),s=a[e],n=i.A.channel.clamp[e](s+r);return s!==n&&(a[e]=n),o.A.stringify(a)}},UI(t,e,r){"use strict";var i=r("Wq"),o=r("ja");e.A=(t,e)=>{let r=o.A.parse(t);for(let t in e)r[t]=i.A.channel.clamp[t](e[t]);return o.A.stringify(r)}},xh(t,e,r){"use strict";var i=r("bg");e.A=(t,e)=>(0,i.A)(t,"l",-e)},HAv(t,e,r){"use strict";r.d(e,{A:()=>a});var i=r("Wq"),o=r("ja"),a=t=>!((t=>{let{r:e,g:r,b:a}=o.A.parse(t),s=.2126*i.A.channel.toLinear(e)+.7152*i.A.channel.toLinear(r)+.0722*i.A.channel.toLinear(a);return i.A.lang.round(s)})(t)>=.5)},CM(t,e,r){"use strict";var i=r("bg");e.A=(t,e)=>(0,i.A)(t,"l",e)},Cv(t,e,r){"use strict";var i=r("Wq"),o=r("ojl"),a=r("ja"),s=r("UI");e.A=(t,e,r=0,n=1)=>{if("number"!=typeof t)return(0,s.A)(t,{a:e});let l=o.A.set({r:i.A.channel.clamp.r(t),g:i.A.channel.clamp.g(e),b:i.A.channel.clamp.b(r),a:i.A.channel.clamp.a(n)});return a.A.stringify(l)}},Wq(t,e,r){"use strict";r.d(e,{A:()=>o});let i={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{let e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?t+(e-t)*6*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t,hsl2rgb:({h:t,s:e,l:r},o)=>{if(!e)return 2.55*r;t/=360,e/=100;let a=(r/=100)<.5?r*(1+e):r+e-r*e,s=2*r-a;switch(o){case"r":return 255*i.hue2rgb(s,a,t+1/3);case"g":return 255*i.hue2rgb(s,a,t);case"b":return 255*i.hue2rgb(s,a,t-1/3)}},rgb2hsl:({r:t,g:e,b:r},i)=>{let o=Math.max(t/=255,e/=255,r/=255),a=Math.min(t,e,r),s=(o+a)/2;if("l"===i)return 100*s;if(o===a)return 0;let n=o-a;if("s"===i)return 100*(s>.5?n/(2-o-a):n/(o+a));switch(o){case t:return((e-r)/n+6*(e<r))*60;case e:return((r-t)/n+2)*60;case r:return((t-e)/n+4)*60;default:return -1}}};var o={channel:i,lang:{clamp:(t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(1e10*t)/1e10},unit:{dec2hex:t=>{let e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}}},bQ(t,e,r){"use strict";var i=r("Ut"),o=r("NH"),a=r("M4"),s=r("Gt"),n=(0,s.K)(({flowchart:t})=>{let e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:e+r}},"getSubGraphTitleMargins"),l=new Map;async function h(t,e,r){let a,s;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");let n=e.shape?i.nq[e.shape]:void 0;if(!n)throw Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let i;"sandbox"===r.config.securityLevel?i="_top":e.linkTarget&&(i=e.linkTarget||"_blank"),a=t.insert("svg:a").attr("xlink:href",e.link).attr("target",i??null),s=await n(a,e,r)}else a=s=await n(t,e,r);return a.attr("data-look",(0,o.KL)(e.look)),e.tooltip&&s.attr("title",e.tooltip),l.set(e.id,a),e.haveCallback&&a.attr("class",a.attr("class")+" clickable"),a}(0,s.K)(h,"insertNode");var c=(0,s.K)((t,e)=>{l.set(e.id,t)},"setNodeElem"),d=(0,s.K)(()=>{l.clear()},"clear"),u=(0,s.K)(t=>{let e=l.get(t.id);a.R.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");r.d(e,{IU:()=>d,Oi:()=>n,U7:()=>c,U_:()=>u,on:()=>h})},MM(t,e,r){"use strict";var i=r("Yr"),o=r("Gt"),a=r("El"),s=(0,o.K)(t=>{let{securityLevel:e}=(0,i.D7)(),r=(0,a.Ltv)("body");if("sandbox"===e){let e=(0,a.Ltv)(`#i${t}`),i=e.node()?.contentDocument??document;r=(0,a.Ltv)(i.body)}return r.select(`#${t}`)},"selectSvgElement");r.d(e,{D:()=>s})},h5(t,e,r){"use strict";r.d(e,{WY:()=>S,dn:()=>T,pC:()=>w,Gc:()=>x});var i=r("Yr"),o=r("M4"),a=r("Gt");let s=(t,e)=>!!t&&!!((e&&""===t.prefix||t.prefix)&&t.name),n=Object.freeze({left:0,top:0,width:16,height:16}),l=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),h=Object.freeze({...n,...l}),c=Object.freeze({...h,body:"",hidden:!1});function d(t,e){let r,i,o=(r={},!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0),(i=((t.rotate||0)+(e.rotate||0))%4)&&(r.rotate=i),r);for(let r in c)r in l?r in t&&!(r in o)&&(o[r]=l[r]):r in e?o[r]=e[r]:r in t&&(o[r]=t[r]);return o}function u(t,e,r){let i=t.icons,o=t.aliases||Object.create(null),a={};function s(t){a=d(i[t]||o[t],a)}return s(e),r.forEach(s),d(t,a)}let g=Object.freeze({...Object.freeze({width:null,height:null}),...l}),p=/(-?[0-9.]*[0-9]+[0-9.]*)/g,f=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function y(t,e,r){if(1===e)return t;if(r=r||100,"number"==typeof t)return Math.ceil(t*e*r)/r;if("string"!=typeof t)return t;let i=t.split(p);if(null===i||!i.length)return t;let o=[],a=i.shift(),s=f.test(a);for(;;){if(s){let t=parseFloat(a);isNaN(t)?o.push(a):o.push(Math.ceil(t*e*r)/r)}else o.push(a);if(void 0===(a=i.shift()))return o.join("");s=!s}}let m=/\sid="(\S+)"/g,C=new Map;var x={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},b=new Map,k=new Map,w=(0,a.K)(t=>{for(let e of t){if(!e.name)throw Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(o.R.debug("Registering icon pack:",e.name),"loader"in e)k.set(e.name,e.loader);else if("icons"in e)b.set(e.name,e.icons);else throw o.R.error("Invalid icon loader:",e),Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),B=(0,a.K)(async(t,e)=>{let r=((t,e,r,i="")=>{let o=t.split(":");if("@"===t.slice(0,1)){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){let t=o.pop(),r=o.pop(),a={provider:o.length>0?o[0]:i,prefix:r,name:t};return e&&!s(a)?null:a}let a=o[0],n=a.split("-");if(n.length>1){let t={provider:i,prefix:n.shift(),name:n.join("-")};return e&&!s(t)?null:t}if(r&&""===i){let t={provider:i,prefix:"",name:a};return e&&!s(t,r)?null:t}return null})(t,!0,void 0!==e);if(!r)throw Error(`Invalid icon name: ${t}`);let i=r.prefix||e;if(!i)throw Error(`Icon name must contain a prefix: ${t}`);let a=b.get(i);if(!a){let t=k.get(i);if(!t)throw Error(`Icon set not found: ${r.prefix}`);try{a={...await t(),prefix:i},b.set(i,a)}catch(t){throw o.R.error(t),Error(`Failed to load icon set: ${r.prefix}`)}}let n=function(t,e){var r;let i,o,a;if(t.icons[e])return u(t,e,[]);let s=(r=[e],i=t.icons,o=t.aliases||Object.create(null),a=Object.create(null),(r||Object.keys(i).concat(Object.keys(o))).forEach(function t(e){if(i[e])return a[e]=[];if(!(e in a)){a[e]=null;let r=o[e]&&o[e].parent,i=r&&t(r);i&&(a[e]=[r].concat(i))}return a[e]}),a)[e];return s?u(t,e,s):null}(a,r.name);if(!n)throw Error(`Icon not found: ${t}`);return n},"getRegisteredIconData"),T=(0,a.K)(async t=>{try{return await B(t),!0}catch{return!1}},"isIconAvailable"),S=(0,a.K)(async(t,e,r)=>{var a;let s,n,l,c,d,u,p,f,b,k,w,T,S,v;try{s=await B(t,e?.fallbackPrefix)}catch(t){o.R.error(t),s=x}let _=(a=s,c={...h,...a},d={...g,...e},u={left:c.left,top:c.top,width:c.width,height:c.height},p=c.body,[c,d].forEach(t=>{var e,r,i,o;let a,s,n=[],l=t.hFlip,h=t.vFlip,c=t.rotate;switch(l?h?c+=2:(n.push("translate("+(u.width+u.left).toString()+" "+(0-u.top).toString()+")"),n.push("scale(-1 1)"),u.top=u.left=0):h&&(n.push("translate("+(0-u.left).toString()+" "+(u.height+u.top).toString()+")"),n.push("scale(1 -1)"),u.top=u.left=0),c<0&&(c-=4*Math.floor(c/4)),c%=4){case 1:a=u.height/2+u.top,n.unshift("rotate(90 "+a.toString()+" "+a.toString()+")");break;case 2:n.unshift("rotate(180 "+(u.width/2+u.left).toString()+" "+(u.height/2+u.top).toString()+")");break;case 3:a=u.width/2+u.left,n.unshift("rotate(-90 "+a.toString()+" "+a.toString()+")")}c%2==1&&(u.left!==u.top&&(a=u.left,u.left=u.top,u.top=a),u.width!==u.height&&(a=u.width,u.width=u.height,u.height=a)),n.length&&(e=p,r='<g transform="'+n.join(" ")+'">',i=(s=function(t,e="defs"){let r="",i=t.indexOf("<"+e);for(;i>=0;){let o=t.indexOf(">",i),a=t.indexOf("</"+e);if(-1===o||-1===a)break;let s=t.indexOf(">",a);if(-1===s)break;r+=t.slice(o+1,a).trim(),t=t.slice(0,i).trim()+t.slice(s+1)}return{defs:r,content:t}}(e)).defs,o=r+s.content+"</g>",p=i?"<defs>"+i+"</defs>"+o:o)}),f=d.width,b=d.height,k=u.width,w=u.height,null===f?n=y(l=null===b?"1em":"auto"===b?w:b,k/w):(n="auto"===f?k:f,l=null===b?y(n,w/k):"auto"===b?w:b),T={},(S=(t,e)=>{"unset"!==e&&"undefined"!==e&&"none"!==e&&(T[t]=e.toString())})("width",n),S("height",l),T.viewBox=(v=[u.left,u.top,k,w]).join(" "),{attributes:T,viewBox:v,body:p}),F=function(t,e){let r=-1===t.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let t in e)r+=" "+t+'="'+e[t]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+t+"</svg>"}(function(t){let e,r=[];for(;e=m.exec(t);)r.push(e[1]);if(!r.length)return t;let i="suffix"+(0x1000000*Math.random()|Date.now()).toString(16);return r.forEach(e=>{var r;let o,a=(r=(r=e).replace(/[0-9]+$/,"")||"a",o=C.get(r)||0,C.set(r,o+1),o?`${r}${o}`:r),s=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),t=t.replace(RegExp(i,"g"),"")}(_.body),{..._.attributes,...r});return(0,i.jZ)(F,(0,i.zj)())},"getIconSVG")},Ut(t,e,r){"use strict";var i=r("PF"),o=r("iV"),a=r("h5"),s=r("pK"),n=r("NH"),l=r("Yr"),h=r("M4"),c=r("Gt"),d=r("El"),u=r("nh");async function g(t){let e=t.getElementsByTagName("img");if(!e||0===e.length)return;let r=!p(t);await Promise.all([...e].map(t=>new Promise(e=>{function i(){if(t.style.display="flex",t.style.flexDirection="column",r){let e=(0,l.D7)().fontSize?(0,l.D7)().fontSize:window.getComputedStyle(document.body).fontSize,[r=l.UI.fontSize]=(0,n.I5)(e),i=5*r+"px";t.style.minWidth=i,t.style.maxWidth=i}else t.style.width="100%";e(t)}(0,c.K)(i,"setupImage"),setTimeout(()=>{t.complete&&i()}),t.addEventListener("error",i),t.addEventListener("load",i)})))}function p(t){return 3===t.nodeType?t.textContent?.trim()!=="":1===t.nodeType&&"img"!==t.tagName.toLowerCase()&&[...t.childNodes].some(p)}(0,c.K)(g,"configureLabelImages"),(0,c.K)(p,"hasTextBesidesImages");var f=(0,c.K)(async(t,e,r)=>{let i=(0,l.D7)(),a=t.insert("g").attr("class",r??"node default").attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",(0,n.KL)(e.labelStyle)),h=[{text:"string"==typeof e.label?e.label:e.label?.[0]??"",cssClass:"c4-name"},{text:e.stereotype,cssClass:"c4-type"},...(e.description??[]).map(t=>({text:t,cssClass:"c4-descr"}))].filter(t=>t.text),c=e.width?Math.max(e.width-2*(e.padding??0),32):(0,l.D7)().flowchart?.wrappingWidth??200,u=i.c4?.wrap??!0?c:1/0,g=await Promise.all(h.map(async t=>{let r=s.append("g").attr("class",t.cssClass),a=await (0,o.GZ)(r,(0,l.jZ)((0,n.Sm)(t.text??""),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:u,style:e.labelStyle},i);return(0,d.Ltv)(a).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),(0,d.Ltv)(a).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:r,box:r.node().getBBox()}})),p=Math.max(...g.map(({box:t})=>t.width),0),f=0;for(let{el:t,box:e}of g)t.attr("transform",`translate(${p/2-e.x-e.width/2}, ${f-e.y})`),f+=e.height+3;let y=g.length>0?f-3:0;return s.insert("rect",":first-child"),s.attr("transform",`translate(${-p/2}, ${-y/2})`),{shapeSvg:a,bbox:s.node().getBBox(),halfPadding:(e.padding??0)/2,label:s}},"c4LabelHelper"),y=(0,c.K)((t,e)=>{let{x:r,y:i,width:o,height:a}=t;return o>=e?t:"left"in t?{x:r,y:i,width:e,height:a,top:i,left:r,bottom:i+a,right:r+e,toJSON:(0,c.K)(()=>({}),"toJSON")}:{x:r-(e-o)/2,y:i,width:e,height:a}},"withMinWidth"),m=(0,c.K)(async(t,e,r)=>{let i,a,s;if(void 0!==e.stereotype)return f(t,e,r);let h=e.useHtmlLabels||(0,l._3)((0,l.D7)()?.htmlLabels);i=r||"node default";let c=t.insert("g").attr("class",i).attr("id",e.domId||e.id),u=c.insert("g").attr("class","label").attr("style",(0,n.KL)(e.labelStyle));a=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];let p=!!e.icon||!!e.img,m="markdown"===e.labelType,C=a&&!e.width?e.minWidth??0:0,x=await (0,o.GZ)(u,(0,l.jZ)((0,n.Sm)(a),(0,l.D7)()),{useHtmlLabels:h,width:e.width||e.wrappingWidth||(0,l.D7)().flowchart?.wrappingWidth,minWidth:C,classes:m?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:p,markdown:m},(0,l.D7)()),b=(e?.padding??0)/2;if(h){let t=x.children[0],e=(0,d.Ltv)(x);await g(t),s=y(s=await o.lT.measure(()=>t.getBoundingClientRect()),C),e.attr("width",s.width),e.attr("height",s.height)}else s=y(s=await o.lT.measure(()=>x.getBBox()),C);return h?u.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):u.attr("transform","translate(0, "+-s.height/2+")"),e.centerLabel&&u.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),u.insert("rect",":first-child"),{shapeSvg:c,bbox:s,halfPadding:b,label:u}},"labelHelper"),C=(0,c.K)(async(t,e,r)=>{let i,a=r.useHtmlLabels??(0,l.E)((0,l.D7)()),s=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),h=await (0,o.GZ)(s,(0,l.jZ)((0,n.Sm)(e),(0,l.D7)()),{useHtmlLabels:a,width:r.width||(0,l.D7)()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=r.padding/2;if((0,l.E)((0,l.D7)())){let t=h.children[0],e=(0,d.Ltv)(h);i=await o.lT.measure(()=>t.getBoundingClientRect()),e.attr("width",i.width),e.attr("height",i.height)}else i=await o.lT.measure(()=>h.getBBox());return a?s.attr("transform","translate("+-i.width/2+", "+-i.height/2+")"):s.attr("transform","translate(0, "+-i.height/2+")"),r.centerLabel&&s.attr("transform","translate("+-i.width/2+", "+-i.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:t,bbox:i,halfPadding:c,label:s}},"insertLabel"),x=(0,c.K)((t,e,r)=>{if(r){t.width=r.width,t.height=r.height;return}let i=e.node().getBBox();t.width=i.width,t.height=i.height},"updateNodeBounds"),b=(0,c.K)((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function k(t){let e=t.map((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`);return e.push("Z"),e.join(" ")}function w(t,e,r,i,o,a){let s=[],n=r-t,l=2*Math.PI/(n/a),h=e+(i-e)/2;for(let e=0;e<=50;e++){let r=t+e/50*n,i=h+o*Math.sin(l*(r-t));s.push({x:r,y:i})}return s}function B(t,e,r,i,o,a){let s=[],n=o*Math.PI/180,l=(a*Math.PI/180-n)/(i-1);for(let o=0;o<i;o++){let i=n+o*l,a=t+r*Math.cos(i),h=e+r*Math.sin(i);s.push({x:-a,y:-h})}return s}function T(t){let e=Array.from(t.childNodes).filter(t=>"path"===t.tagName),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=e.map(t=>t.getAttribute("d")).filter(t=>null!==t).join(" ");r.setAttribute("d",i);let o=e.find(t=>"none"!==t.getAttribute("fill")),a=e.find(t=>"none"!==t.getAttribute("stroke")),s=(0,c.K)((t,e)=>t?.getAttribute(e)??void 0,"getAttr");o&&Object.entries({fill:s(o,"fill"),"fill-opacity":s(o,"fill-opacity")??"1"}).forEach(([t,e])=>{e&&r.setAttribute(t,e)}),a&&Object.entries({stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"}).forEach(([t,e])=>{e&&r.setAttribute(t,e)});let n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}(0,c.K)(k,"createPathFromPoints"),(0,c.K)(w,"generateFullSineWavePoints"),(0,c.K)(B,"generateCirclePoints"),(0,c.K)(T,"mergePaths");var S=(0,c.K)((t,e)=>{var r,i,o=t.x,a=t.y,s=e.x-o,n=e.y-a,l=t.width/2,h=t.height/2;return Math.abs(n)*l>Math.abs(s)*h?(n<0&&(h=-h),r=0===n?0:h*s/n,i=h):(s<0&&(l=-l),r=l,i=0===s?0:l*n/s),{x:o+r,y:a+i}},"intersectRect");function v(t,e){return t.intersect(e)}function _(t,e,r,i){var o=t.x,a=t.y,s=o-i.x,n=a-i.y,l=Math.sqrt(e*e*n*n+r*r*s*s),h=Math.abs(e*r*s/l);i.x<o&&(h=-h);var c=Math.abs(e*r*n/l);return i.y<a&&(c=-c),{x:o+h,y:a+c}}function F(t,e,r){return _(t,e,e,r)}function L(t,e,r,i){{let o=e.y-t.y,a=t.x-e.x,s=e.x*t.y-t.x*e.y,n=o*r.x+a*r.y+s,l=o*i.x+a*i.y+s;if(0!==n&&0!==l&&A(n,l))return;let h=i.y-r.y,c=r.x-i.x,d=i.x*r.y-r.x*i.y,u=h*t.x+c*t.y+d,g=h*e.x+c*e.y+d;if(1e-6>Math.abs(u)&&1e-6>Math.abs(g)&&A(u,g))return;let p=o*c-h*a;if(0===p)return;return{x:(a*d-c*s)/p,y:(h*s-o*d)/p}}}function A(t,e){return t*e>0}function M(t,e,r){let i=t.x,o=t.y,a=[],s=1/0,n=1/0;"function"==typeof e.forEach?e.forEach(function(t){s=Math.min(s,t.x),n=Math.min(n,t.y)}):(s=Math.min(s,e.x),n=Math.min(n,e.y));let l=i-t.width/2-s,h=o-t.height/2-n;for(let i=0;i<e.length;i++){let o=e[i],s=e[i<e.length-1?i+1:0],n=L(t,r,{x:l+o.x,y:h+o.y},{x:l+s.x,y:h+s.y});n&&a.push(n)}return a.length?(a.length>1&&a.sort(function(t,e){let i=t.x-r.x,o=t.y-r.y,a=Math.sqrt(i*i+o*o),s=e.x-r.x,n=e.y-r.y,l=Math.sqrt(s*s+n*n);return a<l?-1:+(a!==l)}),a[0]):t}(0,c.K)(v,"intersectNode"),(0,c.K)(_,"intersectEllipse"),(0,c.K)(F,"intersectCircle"),(0,c.K)(L,"intersectLine"),(0,c.K)(A,"sameSign"),(0,c.K)(M,"intersectPolygon");var $={node:v,circle:F,ellipse:_,polygon:M,rect:S},E=(0,c.K)((t,e,r,i,o)=>["M",t+o,e,"H",t+r-o,"A",o,o,"0 0 1",t+r,e+o,"V",e+i-o,"A",o,o,"0 0 1",t+r-o,e+i,"H",t+o,"A",o,o,"0 0 1",t,e+i-o,"V",e+o,"A",o,o,"0 0 1",t+o,e,"Z"].join(" "),"createRoundedRectPathD"),K=(0,c.K)(async(t,e,r,i=!1,a=!1)=>{let s=e||"";"object"==typeof s&&(s=s[0]);let n=(0,l.D7)(),h=(0,l.E)(n);return await (0,o.GZ)(t,s,{style:r,isTitle:i,useHtmlLabels:h,markdown:!1,isNode:a,width:1/0},n)},"createLabel");function O(t,e){let{labelStyles:r}=(0,i.GX)(e);e.labelStyle=r;let o=b(e),a=o;o||(a="anchor");let s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),{cssStyles:l}=e,c=u.A.svg(s),d=(0,i.Fr)(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(d.roughness=0);let g=c.circle(0,0,2,d),p=s.insert(()=>g,":first-child");return p.attr("class","anchor").attr("style",(0,n.KL)(l)),x(e,p),e.intersect=function(t){return h.R.info("Circle intersect",e,1,t),$.circle(e,1,t)},s}function D(t,e,r,i,o,a,s){let n=Math.atan2(i-e,r-t),l=Math.sqrt(((r-t)/2/o)**2+((i-e)/2/a)**2);if(l>1)throw Error("The given radii are too small to create an arc between the points.");let h=Math.sqrt(1-l**2),c=(t+r)/2+h*a*Math.sin(n)*(s?-1:1),d=(e+i)/2-h*o*Math.cos(n)*(s?-1:1),u=Math.atan2((e-d)/a,(t-c)/o),g=Math.atan2((i-d)/a,(r-c)/o)-u;s&&g<0&&(g+=2*Math.PI),!s&&g>0&&(g-=2*Math.PI);let p=[];for(let t=0;t<20;t++){let e=u+t/19*g,r=c+o*Math.cos(e),i=d+a*Math.sin(e);p.push({x:r,y:i})}return p}function q(t,e,r){let[i,o]=[e,r].sort((t,e)=>e-t);return o*(1-Math.sqrt(1-(t/i/2)**2))}async function I(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a=e.padding??0,s="neo"===e.look?16:a,n="neo"===e.look?12:a,l=(0,c.K)(t=>t+n,"calcTotalHeight"),h=(0,c.K)(t=>{let e=t/2;return[e/(2.5+t/50),e]},"calcEllipseRadius"),{shapeSvg:d,bbox:g}=await m(t,e,b(e)),p=l(e?.height?e?.height:g.height),[f,y]=h(p),C=q(p,f,y),w=(e?.width?e?.width:g.width)+2*s+C-C,{cssStyles:B}=e,T=[{x:w/2,y:-p/2},{x:-w/2,y:-p/2},...D(-w/2,-p/2,-w/2,p/2,f,y,!1),{x:w/2,y:p/2},...D(w/2,p/2,w/2,-p/2,f,y,!0)],S=u.A.svg(d),v=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");let _=k(T),F=S.path(_,v),L=d.insert(()=>F,":first-child");return L.attr("class","basic label-container outer-path"),B&&"handDrawn"!==e.look&&L.selectAll("path").attr("style",B),o&&"handDrawn"!==e.look&&L.selectAll("path").attr("style",o),L.attr("transform",`translate(${f/2}, 0)`),x(e,L),e.intersect=function(t){return $.polygon(e,T,t)},d}async function P(t,e,{config:{themeVariables:r}}){let{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let{shapeSvg:s,bbox:n,label:l}=await m(t,e,b(e)),h=r?.nodeBorder??r?.lineColor??"currentColor",d=e.padding??12,g=Math.max(n.width+2*d,e.width??0,80),p=Math.max(Math.min(.08*g,12),5),f=Math.max(n.height+2*d+p,e.height??0),y=-f/2+p,C=f/2,k=.72*g,w=`M${-g/2},${y} L${-k/2},${C} A${k/2},${p} 0 0 0 ${k/2},${C} L${g/2},${y} A${g/2},${p} 0 0 0 ${-g/2},${y} Z`,{cssStyles:B}=e,T=s.insert("g",":first-child").attr("class","basic label-container");if("handDrawn"===e.look){let t=u.A.svg(s).path(w,(0,i.Fr)(e,{}));T.node()?.appendChild(t),B&&T.attr("style",B)}else T.append("path").attr("d",w).attr("style",a);T.append("ellipse").attr("cx",0).attr("cy",y).attr("rx",g/2).attr("ry",p).attr("style",`fill:none;stroke:${h};stroke-width:1px`),x(e,T);let S=y+(C-y)/2;l.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${S-n.height/2-(n.y-(n.top??0))})`);let v=(0,c.K)((t,e,r)=>Array.from({length:13},(i,o)=>{let a=Math.PI-o*Math.PI/12;return{x:t*Math.cos(a),y:e+r*p*Math.sin(a)}}),"arc"),_=[...v(g/2,y,-1),...v(k/2,C,1).reverse()];return e.intersect=function(t){return $.polygon(e,_,t)},s}function W(t){let{themeVariables:e}=(0,l.D7)(),r=e.clusterBkg,i=e.clusterBorder;return"flow"===t?{rx:10,fill:"none",stroke:e.flowContainerStroke||e.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"}:{rx:8,fill:r,stroke:i,cssClass:"collapsed-group"}}async function z(t,e){let r,o=W(e.metadata?.containerType),{fill:a,stroke:h}=o,{nodeStyles:c}=(0,i.GX)(e),{shapeSvg:d,bbox:g}=await m(t,e,b(e)),{theme:p,themeVariables:f}=(0,l.D7)();(0,s.XE)(d,e.colorIndex,p,f.borderColorArray);let y=e.padding??8,C=g.height,k=Math.max(g.width+2*y,80,e?.width??0),w=Math.max(C+8+20+2*y,e?.height??0),B=-k/2,T=-w/2,S=d.select(".label");if(S&&(e.useHtmlLabels??(0,l.E)((0,l.D7)())?S.attr("transform",`translate(${-g.width/2}, ${-g.height/2+-14})`):S.attr("transform",`translate(0, ${-g.height/2+-14})`)),"handDrawn"===e.look){let t=u.A.svg(d),s=(0,i.Fr)(e,{fill:a,stroke:h,...void 0===o.strokeWidth?{}:{strokeWidth:o.strokeWidth},..."none"===a?{fillWeight:0}:{fillStyle:"solid"}}),l=t.path(E(B,T,k,w,o.rx),s);(r=d.insert(()=>l,":first-child")).attr("class","basic label-container "+o.cssClass).attr("style",(0,n.KL)(e.cssStyles))}else(r=d.insert("rect",":first-child")).attr("class","basic label-container "+o.cssClass).attr("style",c).attr("rx",o.rx).attr("ry",o.rx).attr("x",B).attr("y",T).attr("width",k).attr("height",w).attr("fill",a).attr("stroke",h),void 0!==o.strokeWidth&&r.attr("stroke-width",o.strokeWidth+"px");let v=T+y+C+8;d.append("line").attr("class","collapsed-separator").attr("x1",B+8).attr("y1",v).attr("x2",B+k-8).attr("y2",v).attr("stroke",h).attr("stroke-dasharray","3, 3");let _=v+10;for(let t=-1;t<=1;t++)d.append("circle").attr("class","collapsed-indicator").attr("cx",10*t).attr("cy",_).attr("r",2.5).attr("fill",h);return x(e,r),e.calcIntersect=function(t,e){return $.rect(t,e)},e.intersect=function(t){return $.rect(e,t)},d}function R(t,e,r,i){return t.insert("polygon",":first-child").attr("points",i.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}(0,c.K)(O,"anchor"),(0,c.K)(D,"generateArcPoints"),(0,c.K)(q,"calculateArcSagitta"),(0,c.K)(I,"bowTieRect"),(0,c.K)(P,"bucket"),(0,c.K)(W,"getCollapsedStyle"),(0,c.K)(z,"collapsedGroup"),(0,c.K)(R,"insertPolygonShape");var j=["right","left","up","down"],N="point",H=(0,c.K)(t=>{let e=new Set;for(let r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e},"expandAndDeduplicateDirections"),U=(0,c.K)(t=>j.filter(e=>t.has(e)).join("|")||N,"getDirectionKey"),Y={"right|left|up|down":(0,c.K)(({height:t,midpoint:e,padding:r,width:i})=>[{x:0,y:0},{x:e,y:0},{x:i/2,y:2*r},{x:i-e,y:0},{x:i,y:0},{x:i,y:-t/3},{x:i+2*r,y:-t/2},{x:i,y:-2*t/3},{x:i,y:-t},{x:i-e,y:-t},{x:i/2,y:-t-2*r},{x:e,y:-t},{x:0,y:-t},{x:0,y:-2*t/3},{x:-2*r,y:-t/2},{x:0,y:-t/3}],"right|left|up|down"),"right|left|up":(0,c.K)(({height:t,midpoint:e,width:r})=>[{x:e,y:0},{x:r-e,y:0},{x:r,y:-t/2},{x:r-e,y:-t},{x:e,y:-t},{x:0,y:-t/2}],"right|left|up"),"right|left|down":(0,c.K)(({height:t,midpoint:e,width:r})=>[{x:0,y:0},{x:e,y:-t},{x:r-e,y:-t},{x:r,y:0}],"right|left|down"),"right|up|down":(0,c.K)(({height:t,midpoint:e,width:r})=>[{x:0,y:0},{x:r,y:-e},{x:r,y:-t+e},{x:0,y:-t}],"right|up|down"),"left|up|down":(0,c.K)(({height:t,midpoint:e,width:r})=>[{x:r,y:0},{x:0,y:-e},{x:0,y:-t+e},{x:r,y:-t}],"left|up|down"),"right|left":(0,c.K)(({height:t,midpoint:e,padding:r,width:i})=>[{x:e,y:0},{x:e,y:-r},{x:i-e,y:-r},{x:i-e,y:0},{x:i,y:-t/2},{x:i-e,y:-t},{x:i-e,y:-t+r},{x:e,y:-t+r},{x:e,y:-t},{x:0,y:-t/2}],"right|left"),"up|down":(0,c.K)(({height:t,midpoint:e,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:e,y:-r},{x:e,y:-t+r},{x:0,y:-t+r},{x:i/2,y:-t},{x:i,y:-t+r},{x:i-e,y:-t+r},{x:i-e,y:-r},{x:i,y:-r}],"up|down"),"right|up":(0,c.K)(({height:t,midpoint:e,width:r})=>[{x:0,y:0},{x:r,y:-e},{x:0,y:-t}],"right|up"),"right|down":(0,c.K)(({height:t,width:e})=>[{x:0,y:0},{x:e,y:0},{x:0,y:-t}],"right|down"),"left|up":(0,c.K)(({height:t,midpoint:e,width:r})=>[{x:r,y:0},{x:0,y:-e},{x:r,y:-t}],"left|up"),"left|down":(0,c.K)(({height:t,width:e})=>[{x:e,y:0},{x:0,y:0},{x:e,y:-t}],"left|down"),right:(0,c.K)(({height:t,midpoint:e,padding:r,width:i})=>[{x:e,y:-r},{x:e,y:-r},{x:i-e,y:-r},{x:i-e,y:0},{x:i,y:-t/2},{x:i-e,y:-t},{x:i-e,y:-t+r},{x:e,y:-t+r},{x:e,y:-t+r}],"right"),left:(0,c.K)(({height:t,midpoint:e,padding:r,width:i})=>[{x:e,y:0},{x:e,y:-r},{x:i-e,y:-r},{x:i-e,y:-t+r},{x:e,y:-t+r},{x:e,y:-t},{x:0,y:-t/2}],"left"),up:(0,c.K)(({height:t,midpoint:e,padding:r,width:i})=>[{x:e,y:-r},{x:e,y:-t+r},{x:0,y:-t+r},{x:i/2,y:-t},{x:i,y:-t+r},{x:i-e,y:-t+r},{x:i-e,y:-r}],"up"),down:(0,c.K)(({height:t,midpoint:e,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:e,y:-r},{x:e,y:-t+r},{x:i-e,y:-t+r},{x:i-e,y:-r},{x:i,y:-r}],"down"),[N]:()=>[{x:0,y:0}]},X=(0,c.K)((t,e,r,i)=>{let o=H(t),a=(r.padding??0)/2,s=e.height+4*a,n=s/2,l=i??e.width+2*n+2*a;return(Y[U(o)]??Y[N])({height:s,midpoint:n,padding:a,width:l})},"getArrowPoints");async function G(t,e){let{shapeSvg:r,bbox:i}=await m(t,e,b(e)),o=e.padding??0,a=i.height+2*o,s=a/2,n=i.width+2*s+o,l=e.width??0,h=e.positioned&&(e.widthInColumns??1)>1&&l>n?l:n,c=X(e.directions??[],i,e,h),d=R(r,h,a,c);return d.attr("style",e.style??null),x(e,d),e.intersect=function(t){return $.polygon(e,c,t)},r}async function V(t,e,{config:{themeVariables:r}}){let{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let{shapeSvg:s,bbox:n,label:l}=await m(t,e,b(e)),h=r?.nodeBorder??r?.lineColor??"currentColor",c=e.padding??12,d=Math.max(n.width+2*c,e.width??0,90),g=Math.max(n.height+2*c+18,e.height??0),p=-g/2,{cssStyles:f}=e,y=s.insert("g",":first-child").attr("class","basic label-container");if("handDrawn"===e.look){let t=u.A.svg(s).path(E(-d/2,p,d,g,12),(0,i.Fr)(e,{}));y.node()?.appendChild(t),f&&y.attr("style",f)}else y.append("rect").attr("x",-d/2).attr("y",p).attr("width",d).attr("height",g).attr("rx",12).attr("ry",12).attr("style",a);y.append("line").attr("x1",-d/2).attr("y1",p+18).attr("x2",d/2).attr("y2",p+18).attr("style",`stroke:${h};stroke-width:1px`);for(let t=0;t<3;t++)y.append("circle").attr("cx",-d/2+12+9*t).attr("cy",p+9).attr("r",2.5).attr("style",`fill:${h};stroke:none`);y.append("rect").attr("class","browser-address-bar").attr("x",-d/2+44).attr("y",p+4).attr("width",Math.max(d-56,10)).attr("height",10).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${h};stroke-width:1px;opacity:0.6`),x(e,y);let C=p+18+(g-18)/2;return l.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${C-n.height/2-(n.y-(n.top??0))})`),e.intersect=function(t){return $.rect(e,t)},s}async function Z(t,e){let r,{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let s=e.padding??0,n="neo"===e.look?28:s,l="neo"===e.look?24:s,{shapeSvg:h,bbox:c}=await m(t,e,b(e)),d=(e?.width??c.width)+("neo"===e.look?2*n:n+12),g=(e?.height??c.height)+("neo"===e.look?2*l:l),p=-g,f=[{x:12,y:p},{x:d,y:p},{x:d,y:0},{x:0,y:0},{x:0,y:p+12},{x:12,y:p}],{cssStyles:y}=e;if("handDrawn"===e.look){let t=u.A.svg(h),o=(0,i.Fr)(e,{}),a=k(f),s=t.path(a,o);r=h.insert(()=>s,":first-child").attr("transform",`translate(${-d/2}, ${g/2})`),y&&r.attr("style",y)}else r=R(h,d,g,f);return a&&r.attr("style",a),x(e,r),e.intersect=function(t){return $.polygon(e,f,t)},h}function Q(t,e){let{nodeStyles:r}=(0,i.GX)(e);e.label="";let o=t.insert("g").attr("class",b(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(28,e.width??0),n=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],l=u.A.svg(o),h=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");let c=k(n),d=l.path(c,h),g=o.insert(()=>d,":first-child");return a&&"handDrawn"!==e.look&&g.selectAll("path").attr("style",a),r&&"handDrawn"!==e.look&&g.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(t){return $.polygon(e,n,t)},o}async function J(t,e,r){let o,{labelStyles:a,nodeStyles:s}=(0,i.GX)(e);e.labelStyle=a;let{shapeSvg:l,bbox:c,halfPadding:d}=await m(t,e,b(e)),g=r?.padding??d,p=Math.sqrt(c.width**2+c.height**2)/2,f="neo"===e.look?p+32:p+g,{cssStyles:y}=e;if("handDrawn"===e.look){let t=u.A.svg(l),r=(0,i.Fr)(e,{}),a=t.circle(0,0,2*f,r);(o=l.insert(()=>a,":first-child")).attr("class","basic label-container").attr("style",(0,n.KL)(y))}else o=l.insert("circle",":first-child").attr("class","basic label-container").attr("style",s).attr("r",f).attr("cx",0).attr("cy",0);return x(e,o),e.calcIntersect=function(t,e){let r=t.width/2;return $.circle(t,r,e)},e.intersect=function(t){return h.R.info("Circle intersect",e,f,t),$.circle(e,f,t)},l}async function tt(t,e){let r=["node",e.cssClasses,e.class].filter(Boolean).join(" "),{shapeSvg:i,bbox:o,halfPadding:a}=await m(t,e,r),s=i.insert("rect",":first-child"),n=e.padding??0,l=e.positioned?e.width??0:o.width+n,h=e.positioned?e.height??0:o.height+n,c=e.positioned?-l/2:-o.width/2-a,d=e.positioned?-h/2:-o.height/2-a;return s.attr("class","basic cluster composite label-container").attr("style",e.style??null).attr("rx",e.rx??null).attr("ry",e.ry??null).attr("x",c).attr("y",d).attr("width",l).attr("height",h),x(e,s),e.intersect=function(t){return $.rect(e,t)},i}async function te(t,e,{config:{themeVariables:r}}){let{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let{shapeSvg:s,bbox:n,label:l}=await m(t,e,b(e)),h=r?.nodeBorder??r?.lineColor??"currentColor",c=e.padding??12,d=Math.max(n.width+2*c,e.width??0,90),g=Math.max(n.height+2*c+20,e.height??0),p=-g/2,{cssStyles:f}=e,y=s.insert("g",":first-child").attr("class","basic label-container");if("handDrawn"===e.look){let t=u.A.svg(s).path(E(-d/2,p,d,g,12),(0,i.Fr)(e,{}));y.node()?.appendChild(t),f&&y.attr("style",f)}else y.append("rect").attr("x",-d/2).attr("y",p).attr("width",d).attr("height",g).attr("rx",12).attr("ry",12).attr("style",a);y.append("text").attr("x",-d/2+12).attr("y",p+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${h}`).text(">_"),x(e,y);let C=p+20+(g-20)/2;return l.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${C-n.height/2-(n.y-(n.top??0))})`),e.intersect=function(t){return $.rect(e,t)},s}function tr(t){let e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=2*t,o={x:i/2*e,y:i/2*r},a={x:-(i/2)*e,y:i/2*r},s={x:-(i/2)*e,y:-(i/2)*r},n={x:i/2*e,y:-(i/2)*r};return`M ${a.x},${a.y} L ${n.x},${n.y}
|
|
3
3
|
M ${o.x},${o.y} L ${s.x},${s.y}`}function ti(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r,e.label="";let a=t.insert("g").attr("class",b(e)).attr("id",e.domId??e.id),s=Math.max(30,e?.width??0),{cssStyles:n}=e,l=u.A.svg(a),c=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(c.roughness=0,c.fillStyle="solid");let d=l.circle(0,0,2*s,c),g=tr(s),p=l.path(g,c),f=a.insert(()=>d,":first-child");return f.insert(()=>p),f.attr("class","outer-path"),n&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",n),o&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",o),x(e,f),e.intersect=function(t){return h.R.info("crossedCircle intersect",e,{radius:s,point:t}),$.circle(e,s,t)},a}function to(t,e,r,i=100,o=0,a=180){let s=[],n=o*Math.PI/180,l=(a*Math.PI/180-n)/(i-1);for(let o=0;o<i;o++){let i=n+o*l,a=t+r*Math.cos(i),h=e+r*Math.sin(i);s.push({x:-a,y:-h})}return s}async function ta(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let{shapeSvg:a,bbox:s,label:n}=await m(t,e,b(e)),l="neo"===e.look?18:e.padding??0,h="neo"===e.look?12:e.padding??0,c=s.width+l,d=s.height+h,g=Math.max(5,.1*d),{cssStyles:p}=e,f=[...to(c/2,-d/2,g,30,-90,0),{x:-c/2-g,y:g},...to(c/2+2*g,-g,g,20,-180,-270),...to(c/2+2*g,g,g,20,-90,-180),{x:-c/2-g,y:-d/2},...to(c/2,d/2,g,20,0,90)],y=[{x:c/2,y:-d/2-g},{x:-c/2,y:-d/2-g},...to(c/2,-d/2,g,20,-90,0),{x:-c/2-g,y:-g},...to(c/2+.1*c,-g,g,20,-180,-270),...to(c/2+.1*c,g,g,20,-90,-180),{x:-c/2-g,y:d/2},...to(c/2,d/2,g,20,0,90),{x:-c/2,y:d/2+g},{x:c/2,y:d/2+g}],C=u.A.svg(a),w=(0,i.Fr)(e,{fill:"none"});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let B=k(f).replace("Z",""),T=C.path(B,w),S=k(y),v=C.path(S,{...w}),_=a.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>T,":first-child"),_.attr("class","text"),p&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",p),o&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",o),_.attr("transform",`translate(${g}, 0)`),n.attr("transform",`translate(${-c/2+g-(s.x-(s.left??0))},${-d/2+(e.padding??0)/2-(s.y-(s.top??0))})`),x(e,_),e.intersect=function(t){return $.polygon(e,y,t)},a}function ts(t,e,r,i=100,o=0,a=180){let s=[],n=o*Math.PI/180,l=(a*Math.PI/180-n)/(i-1);for(let o=0;o<i;o++){let i=n+o*l,a=t+r*Math.cos(i),h=e+r*Math.sin(i);s.push({x:a,y:h})}return s}async function tn(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let{shapeSvg:a,bbox:s,label:n}=await m(t,e,b(e)),l="neo"===e.look?18:e.padding??0,h="neo"===e.look?12:e.padding??0,c=s.width+("neo"===e.look?2*l:l),d=s.height+("neo"===e.look?2*h:h),g=Math.max(5,.1*d),{cssStyles:p}=e,f=[...ts(c/2,-d/2,g,20,-90,0),{x:c/2+g,y:-g},...ts(c/2+2*g,-g,g,20,-180,-270),...ts(c/2+2*g,g,g,20,-90,-180),{x:c/2+g,y:d/2},...ts(c/2,d/2,g,20,0,90)],y=[{x:-c/2,y:-d/2-g},{x:c/2,y:-d/2-g},...ts(c/2,-d/2,g,20,-90,0),{x:c/2+g,y:-g},...ts(c/2+2*g,-g,g,20,-180,-270),...ts(c/2+2*g,g,g,20,-90,-180),{x:c/2+g,y:d/2},...ts(c/2,d/2,g,20,0,90),{x:c/2,y:d/2+g},{x:-c/2,y:d/2+g}],C=u.A.svg(a),w=(0,i.Fr)(e,{fill:"none"});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let B=k(f).replace("Z",""),T=C.path(B,w),S=k(y),v=C.path(S,{...w}),_=a.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>T,":first-child"),_.attr("class","text"),p&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",p),o&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",o),_.attr("transform",`translate(${-g}, 0)`),n.attr("transform",`translate(${-c/2+(e.padding??0)/2-(s.x-(s.left??0))},${-d/2+(e.padding??0)/2-(s.y-(s.top??0))})`),x(e,_),e.intersect=function(t){return $.polygon(e,y,t)},a}function tl(t,e,r,i=100,o=0,a=180){let s=[],n=o*Math.PI/180,l=(a*Math.PI/180-n)/(i-1);for(let o=0;o<i;o++){let i=n+o*l,a=t+r*Math.cos(i),h=e+r*Math.sin(i);s.push({x:-a,y:-h})}return s}async function th(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let{shapeSvg:a,bbox:s,label:n}=await m(t,e,b(e)),l="neo"===e.look?18:e.padding??0,h="neo"===e.look?12:e.padding??0,c=s.width+("neo"===e.look?2*l:l),d=s.height+("neo"===e.look?2*h:h),g=Math.max(5,.1*d),{cssStyles:p}=e,f=[...tl(c/2,-d/2,g,30,-90,0),{x:-c/2-g,y:g},...tl(c/2+2*g,-g,g,20,-180,-270),...tl(c/2+2*g,g,g,20,-90,-180),{x:-c/2-g,y:-d/2},...tl(c/2,d/2,g,20,0,90)],y=[...tl(-c/2+g+g/2,-d/2,g,20,-90,-180),{x:c/2-g/2,y:g},...tl(-c/2-g/2,-g,g,20,0,90),...tl(-c/2-g/2,g,g,20,-90,0),{x:c/2-g/2,y:-g},...tl(-c/2+g+g/2,d/2,g,30,-180,-270)],C=[{x:c/2,y:-d/2-g},{x:-c/2,y:-d/2-g},...tl(c/2,-d/2,g,20,-90,0),{x:-c/2-g,y:-g},...tl(c/2+2*g,-g,g,20,-180,-270),...tl(c/2+2*g,g,g,20,-90,-180),{x:-c/2-g,y:d/2},...tl(c/2,d/2,g,20,0,90),{x:-c/2,y:d/2+g},{x:c/2-g-g/2,y:d/2+g},...tl(-c/2+g+g/2,-d/2,g,20,-90,-180),{x:c/2-g/2,y:g},...tl(-c/2-g/2,-g,g,20,0,90),...tl(-c/2-g/2,g,g,20,-90,0),{x:c/2-g/2,y:-g},...tl(-c/2+g+g/2,d/2,g,30,-180,-270)],w=u.A.svg(a),B=(0,i.Fr)(e,{fill:"none"});"handDrawn"!==e.look&&(B.roughness=0,B.fillStyle="solid");let T=k(f).replace("Z",""),S=w.path(T,B),v=k(y).replace("Z",""),_=w.path(v,B),F=k(C),L=w.path(F,{...B}),A=a.insert("g",":first-child");return A.insert(()=>L,":first-child").attr("stroke-opacity",0),A.insert(()=>S,":first-child"),A.insert(()=>_,":first-child"),A.attr("class","text"),p&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",p),o&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",o),A.attr("transform",`translate(${g-g/4}, 0)`),n.attr("transform",`translate(${-c/2+(e.padding??0)/2-(s.x-(s.left??0))},${-d/2+(e.padding??0)/2-(s.y-(s.top??0))})`),x(e,A),e.intersect=function(t){return $.polygon(e,C,t)},a}async function tc(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a=e.padding??0,s="neo"===e.look?16:a,n="neo"===e.look?12:a,{shapeSvg:l,bbox:h}=await m(t,e,b(e)),c=Math.max(5,h.height+2*n,e?.height??0),d=c/2,g=Math.max(c/4,d-Math.sqrt(Math.max(0,d**2-(h.height/2)**2))),p=Math.max(20,h.width+2*s+2*g,(h.width+2*s)*1.25,e?.width??0),{cssStyles:f}=e,y=u.A.svg(l),C=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(C.roughness=0,C.fillStyle="solid");let w=p-d,T=c/4,S=[{x:w,y:0},{x:T,y:0},{x:0,y:c/2},{x:T,y:c},{x:w,y:c},...B(-w,-c/2,d,50,270,90)],v=k(S),_=y.path(v,C),F=l.insert(()=>_,":first-child");return F.attr("class","basic label-container outer-path"),f&&"handDrawn"!==e.look&&F.selectChildren("path").attr("style",f),o&&"handDrawn"!==e.look&&F.selectChildren("path").attr("style",o),F.attr("transform",`translate(${-p/2}, ${-c/2})`),x(e,F),e.intersect=function(t){return $.polygon(e,S,t)},l}async function td(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let{shapeSvg:a,bbox:s,label:n}=await m(t,e,b(e)),l=e.padding??20,h=Math.max(s.width+2*l,e.width??0,100),c=Math.min(Math.max(.23*h,16),56),d=.27*c,g=Math.max(s.height+2*l,e.height?e.height-(2*c-d):0),p=Math.min(.177*h,.45*g),f=g+2*c-d,y=-f/2,C=y+2*c-d,k=a.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:w}=e;if("handDrawn"===e.look){let t=u.A.svg(a),r=(0,i.Fr)(e,{}),o=t.path(E(-h/2,C,h,g,p),r),s=t.circle(0,y+c,2*c,r);k.insert(()=>s,":first-child"),k.insert(()=>o,":first-child"),w&&k.attr("style",w)}else k.append("rect").attr("x",-h/2).attr("y",C).attr("width",h).attr("height",g).attr("rx",p).attr("ry",p).attr("style",o),k.append("circle").attr("cx",0).attr("cy",y+c).attr("r",c).attr("style",o);x(e,k);let T=C+g/2;n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${T-s.height/2-(s.y-(s.top??0))})`);let S=y+c,v=180*Math.asin(Math.min(1,(C-S)/c))/Math.PI,_=[...B(0,-S,c,24,180+v,-v),...B(-(-h/2+p),-(C+p),p,12,90,0),...B(-(-h/2+p),-(f/2-p),p,12,360,270),...B(-(h/2-p),-(f/2-p),p,12,270,180),...B(-(h/2-p),-(C+p),p,12,180,90)];return e.intersect=function(t){return $.polygon(e,_,t)},a}(0,c.K)(G,"block_arrow"),(0,c.K)(V,"browser"),(0,c.K)(Z,"card"),(0,c.K)(Q,"choice"),(0,c.K)(J,"circle"),(0,c.K)(tt,"composite"),(0,c.K)(te,"consoleWindow"),(0,c.K)(tr,"createLine"),(0,c.K)(ti,"crossedCircle"),(0,c.K)(to,"generateCirclePoints"),(0,c.K)(ta,"curlyBraceLeft"),(0,c.K)(ts,"generateCirclePoints"),(0,c.K)(tn,"curlyBraceRight"),(0,c.K)(tl,"generateCirclePoints"),(0,c.K)(th,"curlyBraces"),(0,c.K)(tc,"curvedTrapezoid"),(0,c.K)(td,"person");var tu=(0,c.K)((t,e,r,i,o,a)=>`M${t},${e+a} a${o},${a} 0,0,0 ${r},0 a${o},${a} 0,0,0 ${-r},0 l0,${i} a${o},${a} 0,0,0 ${r},0 l0,${-i}`,"createCylinderPathD"),tg=(0,c.K)((t,e,r,i,o,a)=>`M${t},${e+a} M${t+r},${e+a} a${o},${a} 0,0,0 ${-r},0 l0,${i} a${o},${a} 0,0,0 ${r},0 l0,${-i}`,"createOuterCylinderPathD"),tp=(0,c.K)((t,e,r,i,o,a)=>`M${t-r/2},${-i/2} a${o},${a} 0,0,0 ${r},0`,"createInnerCylinderPathD");async function tf(t,e){let r,{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let s=e.padding??0,l="neo"===e.look?24:s,h="neo"===e.look?24:s,c=e.width??0;e.width&&(e.width=e.width-h,e.width<8&&(e.width=8)),e.height&&(e.height=e.height-l-c/2/(2.5+c/50)*3,e.height<8&&(e.height=8));let{shapeSvg:d,bbox:g,label:p}=await m(t,e,b(e)),f=Math.max(e.width??0,g.width)+h,y=f/2,C=y/(2.5+f/50),k=Math.max(e.height??0,g.height)+l+C,{cssStyles:w}=e;if("handDrawn"===e.look){let t=u.A.svg(d),o=tg(0,0,f,k,y,C),a=tp(0,C,f,k,y,C),s=(0,i.Fr)(e,{}),n=t.path(o,s),l=t.path(a,(0,i.Fr)(e,{fill:"none"}));r=d.insert(()=>l,":first-child"),(r=d.insert(()=>n,":first-child")).attr("class","basic label-container"),w&&r.attr("style",w)}else{let t=tu(0,0,f,k,y,C);r=d.insert("path",":first-child").attr("d",t).attr("class","basic label-container outer-path").attr("style",(0,n.KL)(w)).attr("style",a)}return r.attr("label-offset-y",C),r.attr("transform",`translate(${-f/2}, ${-(k/2+C)})`),x(e,r),p.attr("transform",`translate(${-(g.width/2)-(g.x-(g.left??0))}, ${-(g.height/2)+(e.padding??0)/1.5-(g.y-(g.top??0))})`),e.intersect=function(t){let r=$.rect(e,t),i=r.x-(e.x??0);if(0!=y&&(Math.abs(i)<(e.width??0)/2||Math.abs(i)==(e.width??0)/2&&Math.abs(r.y-(e.y??0))>(e.height??0)/2-C)){let o=C*C*(1-i*i/(y*y));o>0&&(o=Math.sqrt(o)),o=C-o,t.y-(e.y??0)>0&&(o=-o),r.y+=o}return r},d}async function ty(t,e,r){let o,{labelStyles:a,nodeStyles:s}=(0,i.GX)(e);e.labelStyle=a;let{shapeSvg:l,bbox:h}=await m(t,e,b(e)),c=Math.max(h.width+2*r.labelPaddingX,e?.width||0),d=Math.max(h.height+2*r.labelPaddingY,e?.height||0),g=-c/2,p=-d/2,{rx:f,ry:y}=e,{cssStyles:C}=e;if(r?.rx&&r.ry&&(f=r.rx,y=r.ry),"handDrawn"===e.look){let t=u.A.svg(l),r=(0,i.Fr)(e,{}),a=f||y?t.path(E(g,p,c,d,f||0),r):t.rectangle(g,p,c,d,r);(o=l.insert(()=>a,":first-child")).attr("class","basic label-container").attr("style",(0,n.KL)(C))}else(o=l.insert("rect",":first-child")).attr("class","basic label-container").attr("style",s).attr("rx",(0,n.KL)(f)).attr("ry",(0,n.KL)(y)).attr("x",g).attr("y",p).attr("width",c).attr("height",d);return x(e,o,"handDrawn"===e.look?void 0:{width:c,height:d}),e.calcIntersect=function(t,e){return $.rect(t,e)},e.intersect=function(t){return $.rect(e,t)},l}async function tm(t,e){let{cssClasses:r,labelPaddingX:o,labelPaddingY:a,padding:s,width:n,height:l}=e,h=await ty(t,e,{rx:0,ry:0,classes:r??"",labelPaddingX:o??(s??0)*2,labelPaddingY:a??s??0});if("handDrawn"===e.look){let t=u.A.svg(h),r=(0,i.Fr)(e,{}),o=h.select(".basic.label-container > path:nth-child(2)"),a=o.node();if(!a)return h;let s=null;return a instanceof SVGGraphicsElement&&(s=a.getBBox(),h.insert(()=>t.line(s.x,s.y,s.x+s.width,s.y,r),".basic.label-container g.label"),h.insert(()=>t.line(s.x,s.y+s.height,s.x+s.width,s.y+s.height,r),".basic.label-container g.label"),o.remove()),h}let c=h.select(".basic.label-container"),d=(Number(c.attr("width"))||n)??0,g=(Number(c.attr("height"))||l)??0;return d>0&&g>0&&c.attr("stroke-dasharray",`${d} ${g}`),h}async function tC(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a="neo"===e.look?16:e.padding??0,s="neo"===e.look?16:e.padding??0,{shapeSvg:n,bbox:l,label:h}=await m(t,e,b(e)),c=l.width+a,d=l.height+s,g=.2*d,p=-c/2,f=-d/2-g/2,{cssStyles:y}=e,C=u.A.svg(n),k=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let w=C.polygon([{x:p,y:f+g},{x:-p,y:f+g},{x:-p,y:-f},{x:p,y:-f},{x:p,y:f},{x:-p,y:f},{x:-p,y:f+g}].map(t=>[t.x,t.y]),k),B=n.insert(()=>w,":first-child");return B.attr("class","basic label-container outer-path"),y&&"handDrawn"!==e.look&&B.selectAll("path").attr("style",y),o&&"handDrawn"!==e.look&&B.selectAll("path").attr("style",o),h.attr("transform",`translate(${p+(e.padding??0)/2-(l.x-(l.left??0))}, ${f+g+(e.padding??0)/2-(l.y-(l.top??0))})`),x(e,B),e.intersect=function(t){return $.rect(e,t)},n}async function tx(t,e){let r,{labelStyles:o,nodeStyles:a}=(0,i.GX)(e),s="neo"===e.look?12:5;e.labelStyle=o;let l=e.padding??0,c="neo"===e.look?16:l,{shapeSvg:d,bbox:g}=await m(t,e,b(e)),p=Math.sqrt(g.width**2+g.height**2)/2,f=(e?.width?e?.width/2:p)+(c??0),y=f+s,{cssStyles:C}=e;if("handDrawn"===e.look){let t=u.A.svg(d),o=(0,i.Fr)(e,{roughness:.2,strokeWidth:2.5}),a=(0,i.Fr)(e,{roughness:.2,strokeWidth:1.5}),s=t.circle(0,0,2*y,o),l=t.circle(0,0,2*f,a);(r=d.insert("g",":first-child")).attr("class",(0,n.KL)(e.cssClasses)).attr("style",(0,n.KL)(C)),r.node()?.appendChild(s),r.node()?.appendChild(l)}else{let t=(r=d.insert("g",":first-child")).insert("circle",":first-child"),e=r.insert("circle");r.attr("class","basic label-container").attr("style",a),t.attr("class","outer-circle").attr("style",a).attr("r",y).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",a).attr("r",f).attr("cx",0).attr("cy",0)}return x(e,r),e.intersect=function(t){return h.R.info("DoubleCircle intersect",e,y,t),$.circle(e,y,t)},d}async function tb(t,e){let r,{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let{shapeSvg:n,bbox:h,halfPadding:c}=await m(t,e,b(e)),{theme:d,themeVariables:g}=(0,l.D7)();(0,s.XE)(n,e.colorIndex,d,g.borderColorArray);let p=c??10,f=h.width/2+2*p,y=h.height/2+2*p,{cssStyles:C}=e;if("handDrawn"===e.look){let t=u.A.svg(n),o=(0,i.Fr)(e,{}),a=t.ellipse(0,0,2*f,2*y,o);(r=n.insert(()=>a,":first-child")).attr("class","basic label-container"),C&&r.attr("style",C)}else r=n.insert("ellipse",":first-child").attr("class","basic label-container").attr("style",a).attr("rx",f).attr("ry",y).attr("cx",0).attr("cy",0);return e.width=2*f,e.height=2*y,x(e,r),e.calcIntersect=function(t,e){let r=t.width/2,i=t.height/2;return $.ellipse(t,r,i,e)},e.intersect=function(t){return $.ellipse(e,f,y,t)},n}function tk(t,e,{config:{themeVariables:r}}){let{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.label="",e.labelStyle=o;let s=t.insert("g").attr("class",b(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,l=u.A.svg(s),{nodeBorder:c}=r,d=(0,i.Fr)(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(d.roughness=0);let g=l.circle(0,0,14,d),p=s.insert(()=>g,":first-child");return p.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",n),a&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",a),x(e,p),e.intersect=function(t){return h.R.info("filledCircle intersect",e,{radius:7,point:t}),$.circle(e,7,t)},s}async function tw(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a=e.padding??0,s="neo"===e.look?2*a:a;(e.width||e.height)&&(e.height=e?.height??0,e.height<10&&(e.height=10),e.width=(e?.width??0)-s-s/2,e.width<10&&(e.width=10));let{shapeSvg:n,bbox:l,label:c}=await m(t,e,b(e)),d=(e?.width?e?.width:l.width)+(s??0),g=e?.height?e?.height:d+l.height,p=[{x:0,y:-g},{x:g,y:-g},{x:g/2,y:0}],{cssStyles:f}=e,y=u.A.svg(n),C=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(C.roughness=0,C.fillStyle="solid");let w=k(p),B=y.path(w,C),T=n.insert(()=>B,":first-child").attr("transform",`translate(${-g/2}, ${g/2})`).attr("class","outer-path");return f&&"handDrawn"!==e.look&&T.selectChildren("path").attr("style",f),o&&"handDrawn"!==e.look&&T.selectChildren("path").attr("style",o),e.width=d,e.height=g,x(e,T),c.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${-g/2+(e.padding??0)/2+(l.y-(l.top??0))})`),e.intersect=function(t){return h.R.info("Triangle intersect",e,p,t),$.polygon(e,p,t)},n}async function tB(t,e){let r,{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let{shapeSvg:s,bbox:n,label:l}=await m(t,e,b(e)),h=e.padding??12,c=Math.max(n.width+2*h,e.width??0,90),d=n.height+2*h,g=Math.max(Math.min(.16*d,14),8),p=Math.max(d+g,e.height??0),f=p-g,y=Math.max(.38*c,28),C=-p/2,k=[{x:-c/2,y:C},{x:-c/2+y,y:C},{x:-c/2+y,y:C+g},{x:c/2,y:C+g},{x:c/2,y:p/2},{x:-c/2,y:p/2}],w=[`M${k[0].x},${k[0].y}`,...k.slice(1).map(t=>`L${t.x},${t.y}`),"Z"].join(" "),{cssStyles:B}=e;if("handDrawn"===e.look){let t=u.A.svg(s).path(w,(0,i.Fr)(e,{}));r=s.insert(()=>t,":first-child").attr("class","basic label-container"),B&&r.attr("style",B)}else r=s.insert("path",":first-child").attr("d",w).attr("class","basic label-container").attr("style",a);return"handDrawn"===e.look?x(e,r):x(e,r,{width:c,height:p}),l.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${C+g+f/2-n.height/2-(n.y-(n.top??0))})`),e.intersect=function(t){return $.polygon(e,k,t)},s}function tT(t,e,{dir:r,config:{state:o,themeVariables:a}}){let{nodeStyles:s}=(0,i.GX)(e);e.label="";let n=t.insert("g").attr("class",b(e)).attr("id",e.domId??e.id),{cssStyles:l}=e,h=Math.max(70,e?.width??0),c=Math.max(10,e?.height??0);("LR"===r||"RL"===r)&&(h=Math.max(10,e?.width??0),c=Math.max(70,e?.height??0));let d=-1*h/2,g=-1*c/2,p=u.A.svg(n),f=(0,i.Fr)(e,{stroke:a.lineColor,fill:a.lineColor});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");let y=p.rectangle(d,g,h,c,f),m=n.insert(()=>y,":first-child");l&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",l),s&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",s),x(e,m);let C=o?.padding??0;return e.width&&e.height&&(e.width+=C/2||0,e.height+=C/2||0),e.intersect=function(t){return $.rect(e,t)},n}async function tS(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a="neo"===e.look?16:e.padding??0,s="neo"===e.look?12:e.padding??0;(e.width||e.height)&&(e.height=(e?.height??0)-2*s,e.height<10&&(e.height=10),e.width=(e?.width??0)-2*a,e.width<15&&(e.width=15));let{shapeSvg:n,bbox:l}=await m(t,e,b(e)),c=(e?.height?e?.height:Math.max(10,l.height))+2*s,d=c/2,g=d-Math.sqrt(Math.max(0,d**2-(l.height/2)**2)),p=(e?.width?e?.width:Math.max(15,l.width)+2*g)+2*a,{cssStyles:f}=e,y=u.A.svg(n),C=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(C.roughness=0,C.fillStyle="solid");let w=[{x:-p/2,y:-c/2},{x:p/2-d,y:-c/2},...B(-p/2+d,0,d,50,90,270),{x:p/2-d,y:c/2},{x:-p/2,y:c/2}],T=k(w),S=y.path(T,C),v=n.insert(()=>S,":first-child");return v.attr("class","basic label-container outer-path"),f&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",f),o&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",o),x(e,v),e.intersect=function(t){return h.R.info("Pill intersect",e,{radius:d,point:t}),$.polygon(e,w,t)},n}(0,c.K)(tf,"cylinder"),(0,c.K)(ty,"drawRect"),(0,c.K)(tm,"datastore"),(0,c.K)(tC,"dividedRectangle"),(0,c.K)(tx,"doublecircle"),(0,c.K)(tb,"usecaseEllipse"),(0,c.K)(tk,"filledCircle"),(0,c.K)(tw,"flippedTriangle"),(0,c.K)(tB,"folder"),(0,c.K)(tT,"forkJoin"),(0,c.K)(tS,"halfRoundedRectangle");var tv=(0,c.K)((t,e,r,i,o)=>`M${t+o},${e} L${t+r-o},${e} L${t+r},${e-i/2} L${t+r-o},${e-i} L${t+o},${e-i} L${t},${e-i/2} Z`,"createHexagonPathD");async function t_(t,e){let r,{labelStyles:o,nodeStyles:a}=(0,i.GX)(e),s="neo"===e.look?3.5:4;e.labelStyle=o;let n=e.padding??0,l="neo"===e.look?70:n,h="neo"===e.look?32:n;if(e.width||e.height){let t=e.height??0;e.width=(e?.width??0)-t/s*2-h,e.height=(e.height??0)-l}let{shapeSvg:c,bbox:d}=await m(t,e,b(e)),g=(e?.height?e?.height:d.height)+l,p=g/s,f=(e?.width?e?.width:d.width)+2*p+h,y=[{x:p,y:0},{x:f-p,y:0},{x:f,y:-g/2},{x:f-p,y:-g},{x:p,y:-g},{x:0,y:-g/2}],{cssStyles:C}=e;if("handDrawn"===e.look){let t=u.A.svg(c),o=(0,i.Fr)(e,{}),a=tv(0,0,f,g,p),s=t.path(a,o);r=c.insert(()=>s,":first-child").attr("transform",`translate(${-f/2}, ${g/2})`),C&&r.attr("style",C)}else r=R(c,f,g,y);return a&&r.attr("style",a),e.width=f,e.height=g,x(e,r),e.intersect=function(t){return $.polygon(e,y,t)},c}async function tF(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.label="",e.labelStyle=r;let{shapeSvg:a}=await m(t,e,b(e)),s=Math.max(30,e?.width??0),n=Math.max(30,e?.height??0),{cssStyles:l}=e,c=u.A.svg(a),d=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");let g=[{x:0,y:0},{x:s,y:0},{x:0,y:n},{x:s,y:n}],p=k(g),f=c.path(p,d),y=a.insert(()=>f,":first-child");return y.attr("class","basic label-container outer-path"),l&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",l),o&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",o),y.attr("transform",`translate(${-s/2}, ${-n/2})`),x(e,y),e.intersect=function(t){return h.R.info("Pill intersect",e,{points:g}),$.polygon(e,g,t)},a}async function tL(t,e,{config:{themeVariables:r,flowchart:o}}){let{labelStyles:s}=(0,i.GX)(e);e.labelStyle=s;let n=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(n,o?.wrappingWidth??0);let{shapeSvg:l,bbox:c,label:d}=await m(t,e,"icon-shape default"),g="t"===e.pos,{nodeBorder:p}=r,{stylesMap:f}=(0,i.WW)(e),y=-n/2,C=-n/2,b=8*!!e.label,k=u.A.svg(l),w=(0,i.Fr)(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let B=k.rectangle(y,C,n,n,w),T=Math.max(n,c.width),S=n+c.height+b,v=k.rectangle(-T/2,-S/2,T,S,{...w,fill:"transparent",stroke:"none"}),_=l.insert(()=>B,":first-child"),F=l.insert(()=>v);if(e.icon){let t=l.append("g");t.html(`<g>${await (0,a.WY)(e.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);let r=t.node().getBBox(),i=r.width,o=r.height,s=r.x,h=r.y;t.attr("transform",`translate(${-i/2-s},${g?c.height/2+b/2-o/2-h:-c.height/2-b/2-o/2-h})`),t.attr("style",`color: ${f.get("stroke")??p};`)}return d.attr("transform",`translate(${-c.width/2-(c.x-(c.left??0))},${g?-S/2:S/2-c.height})`),_.attr("transform",`translate(0,${g?c.height/2+b/2:-c.height/2-b/2})`),x(e,F),e.intersect=function(t){if(h.R.info("iconSquare intersect",e,t),!e.label)return $.rect(e,t);let r=e.x??0,i=e.y??0,o=e.height??0,a=[];return a=g?[{x:r-c.width/2,y:i-o/2},{x:r+c.width/2,y:i-o/2},{x:r+c.width/2,y:i-o/2+c.height+b},{x:r+n/2,y:i-o/2+c.height+b},{x:r+n/2,y:i+o/2},{x:r-n/2,y:i+o/2},{x:r-n/2,y:i-o/2+c.height+b},{x:r-c.width/2,y:i-o/2+c.height+b}]:[{x:r-n/2,y:i-o/2},{x:r+n/2,y:i-o/2},{x:r+n/2,y:i-o/2+n},{x:r+c.width/2,y:i-o/2+n},{x:r+c.width/2/2,y:i+o/2},{x:r-c.width/2,y:i+o/2},{x:r-c.width/2,y:i-o/2+n},{x:r-n/2,y:i-o/2+n}],$.polygon(e,a,t)},l}async function tA(t,e,{config:{themeVariables:r,flowchart:o}}){let{labelStyles:s}=(0,i.GX)(e);e.labelStyle=s;let n=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(n,o?.wrappingWidth??0);let{shapeSvg:l,bbox:c,label:d}=await m(t,e,"icon-shape default"),g=8*!!e.label,p="t"===e.pos,{nodeBorder:f,mainBkg:y}=r,{stylesMap:C}=(0,i.WW)(e),b=u.A.svg(l),k=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid"),k.stroke=C.get("fill")??y;let w=l.append("g");e.icon&&w.html(`<g>${await (0,a.WY)(e.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);let B=w.node().getBBox(),T=B.width,S=B.height,v=B.x,_=B.y,F=Math.max(T,S)*Math.SQRT2+40,L=b.circle(0,0,F,k),A=Math.max(F,c.width),M=F+c.height+g,E=b.rectangle(-A/2,-M/2,A,M,{...k,fill:"transparent",stroke:"none"}),K=l.insert(()=>L,":first-child"),O=l.insert(()=>E);return w.attr("transform",`translate(${-T/2-v},${p?c.height/2+g/2-S/2-_:-c.height/2-g/2-S/2-_})`),w.attr("style",`color: ${C.get("stroke")??f};`),d.attr("transform",`translate(${-c.width/2-(c.x-(c.left??0))},${p?-M/2:M/2-c.height})`),K.attr("transform",`translate(0,${p?c.height/2+g/2:-c.height/2-g/2})`),x(e,O),e.intersect=function(t){return h.R.info("iconSquare intersect",e,t),$.rect(e,t)},l}async function tM(t,e,{config:{themeVariables:r,flowchart:o}}){let{labelStyles:s}=(0,i.GX)(e);e.labelStyle=s;let n=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(n,o?.wrappingWidth??0);let{shapeSvg:l,bbox:c,halfPadding:d,label:g}=await m(t,e,"icon-shape default"),p="t"===e.pos,f=n+2*d,y=n+2*d,{nodeBorder:C,mainBkg:b}=r,{stylesMap:k}=(0,i.WW)(e),w=8*!!e.label,B=u.A.svg(l),T=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(T.roughness=0,T.fillStyle="solid"),T.stroke=k.get("fill")??b;let S=B.path(E(-y/2,-f/2,y,f,5),T),v=Math.max(y,c.width),_=f+c.height+w,F=B.rectangle(-v/2,-_/2,v,_,{...T,fill:"transparent",stroke:"none"}),L=l.insert(()=>S,":first-child").attr("class","icon-shape2"),A=l.insert(()=>F);if(e.icon){let t=l.append("g");t.html(`<g>${await (0,a.WY)(e.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);let r=t.node().getBBox(),i=r.width,o=r.height,s=r.x,h=r.y;t.attr("transform",`translate(${-i/2-s},${p?c.height/2+w/2-o/2-h:-c.height/2-w/2-o/2-h})`),t.attr("style",`color: ${k.get("stroke")??C};`)}return g.attr("transform",`translate(${-c.width/2-(c.x-(c.left??0))},${p?-_/2:_/2-c.height})`),L.attr("transform",`translate(0,${p?c.height/2+w/2:-c.height/2-w/2})`),x(e,A),e.intersect=function(t){if(h.R.info("iconSquare intersect",e,t),!e.label)return $.rect(e,t);let r=e.x??0,i=e.y??0,o=e.height??0,a=[];return a=p?[{x:r-c.width/2,y:i-o/2},{x:r+c.width/2,y:i-o/2},{x:r+c.width/2,y:i-o/2+c.height+w},{x:r+y/2,y:i-o/2+c.height+w},{x:r+y/2,y:i+o/2},{x:r-y/2,y:i+o/2},{x:r-y/2,y:i-o/2+c.height+w},{x:r-c.width/2,y:i-o/2+c.height+w}]:[{x:r-y/2,y:i-o/2},{x:r+y/2,y:i-o/2},{x:r+y/2,y:i-o/2+f},{x:r+c.width/2,y:i-o/2+f},{x:r+c.width/2/2,y:i+o/2},{x:r-c.width/2,y:i+o/2},{x:r-c.width/2,y:i-o/2+f},{x:r-y/2,y:i-o/2+f}],$.polygon(e,a,t)},l}async function t$(t,e,{config:{themeVariables:r,flowchart:o}}){let{labelStyles:s}=(0,i.GX)(e);e.labelStyle=s;let n=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(n,o?.wrappingWidth??0);let{shapeSvg:l,bbox:c,halfPadding:d,label:g}=await m(t,e,"icon-shape default"),p="t"===e.pos,f=n+2*d,y=n+2*d,{nodeBorder:C,mainBkg:b}=r,{stylesMap:k}=(0,i.WW)(e),w=8*!!e.label,B=u.A.svg(l),T=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(T.roughness=0,T.fillStyle="solid"),T.stroke=k.get("fill")??b;let S=B.path(E(-y/2,-f/2,y,f,.1),T),v=Math.max(y,c.width),_=f+c.height+w,F=B.rectangle(-v/2,-_/2,v,_,{...T,fill:"transparent",stroke:"none"}),L=l.insert(()=>S,":first-child"),A=l.insert(()=>F);if(e.icon){let t=l.append("g");t.html(`<g>${await (0,a.WY)(e.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);let r=t.node().getBBox(),i=r.width,o=r.height,s=r.x,h=r.y;t.attr("transform",`translate(${-i/2-s},${p?c.height/2+w/2-o/2-h:-c.height/2-w/2-o/2-h})`),t.attr("style",`color: ${k.get("stroke")??C};`)}return g.attr("transform",`translate(${-c.width/2-(c.x-(c.left??0))},${p?-_/2:_/2-c.height})`),L.attr("transform",`translate(0,${p?c.height/2+w/2:-c.height/2-w/2})`),x(e,A),e.intersect=function(t){if(h.R.info("iconSquare intersect",e,t),!e.label)return $.rect(e,t);let r=e.x??0,i=e.y??0,o=e.height??0,a=[];return a=p?[{x:r-c.width/2,y:i-o/2},{x:r+c.width/2,y:i-o/2},{x:r+c.width/2,y:i-o/2+c.height+w},{x:r+y/2,y:i-o/2+c.height+w},{x:r+y/2,y:i+o/2},{x:r-y/2,y:i+o/2},{x:r-y/2,y:i-o/2+c.height+w},{x:r-c.width/2,y:i-o/2+c.height+w}]:[{x:r-y/2,y:i-o/2},{x:r+y/2,y:i-o/2},{x:r+y/2,y:i-o/2+f},{x:r+c.width/2,y:i-o/2+f},{x:r+c.width/2/2,y:i+o/2},{x:r-c.width/2,y:i+o/2},{x:r-c.width/2,y:i-o/2+f},{x:r-y/2,y:i-o/2+f}],$.polygon(e,a,t)},l}async function tE(t,e,{config:{flowchart:r}}){let o=new Image;o.src=e?.img??"",await o.decode();let a=Number(o.naturalWidth.toString().replace("px","")),s=Number(o.naturalHeight.toString().replace("px",""));e.imageAspectRatio=a/s;let{labelStyles:n}=(0,i.GX)(e);e.labelStyle=n;let l=r?.wrappingWidth;e.defaultWidth=r?.wrappingWidth;let c=Math.max(e.label?l??0:0,e?.assetWidth??a),d="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:c,g="on"===e.constraint?d/e.imageAspectRatio:e?.assetHeight??s;e.width=Math.max(d,l??0);let{shapeSvg:p,bbox:f,label:y}=await m(t,e,"image-shape default"),C="t"===e.pos,b=-d/2,k=8*!!e.label,w=u.A.svg(p),B=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(B.roughness=0,B.fillStyle="solid");let T=w.rectangle(b,-g/2,d,g,B),S=Math.max(d,f.width),v=g+f.height+k,_=w.rectangle(-S/2,-v/2,S,v,{...B,fill:"none",stroke:"none"}),F=p.insert(()=>T,":first-child"),L=p.insert(()=>_);if(e.img){let t=p.append("image");t.attr("href",e.img),t.attr("width",d),t.attr("height",g),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-d/2},${C?v/2-g:-v/2})`)}return y.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${C?-g/2-f.height/2-k/2:g/2-f.height/2+k/2})`),F.attr("transform",`translate(0,${C?f.height/2+k/2:-f.height/2-k/2})`),x(e,L),e.intersect=function(t){if(h.R.info("iconSquare intersect",e,t),!e.label)return $.rect(e,t);let r=e.x??0,i=e.y??0,o=e.height??0,a=[];return a=C?[{x:r-f.width/2,y:i-o/2},{x:r+f.width/2,y:i-o/2},{x:r+f.width/2,y:i-o/2+f.height+k},{x:r+d/2,y:i-o/2+f.height+k},{x:r+d/2,y:i+o/2},{x:r-d/2,y:i+o/2},{x:r-d/2,y:i-o/2+f.height+k},{x:r-f.width/2,y:i-o/2+f.height+k}]:[{x:r-d/2,y:i-o/2},{x:r+d/2,y:i-o/2},{x:r+d/2,y:i-o/2+g},{x:r+f.width/2,y:i-o/2+g},{x:r+f.width/2/2,y:i+o/2},{x:r-f.width/2,y:i+o/2},{x:r-f.width/2,y:i-o/2+g},{x:r-d/2,y:i-o/2+g}],$.polygon(e,a,t)},p}async function tK(t,e){let r,{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let s=e.padding??0,n="neo"===e.look?2*s:s,{shapeSvg:l,bbox:h}=await m(t,e,b(e)),c=Math.max(h.height+2*s,e.height??0),d=Math.max(h.width+2*n,(e.width??0)-c),g=[{x:0,y:0},{x:d,y:0},{x:d+3*c/6,y:-c},{x:-3*c/6,y:-c}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=u.A.svg(l),o=(0,i.Fr)(e,{}),a=k(g),s=t.path(a,o);r=l.insert(()=>s,":first-child").attr("transform",`translate(${-d/2}, ${c/2})`),p&&r.attr("style",p)}else r=R(l,d,c,g);return a&&r.attr("style",a),e.width=d,e.height=c,x(e,r),e.intersect=function(t){return $.polygon(e,g,t)},l}async function tO(t,e){let{shapeSvg:r,bbox:i,label:o}=await m(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),x(e,a),e.intersect=function(t){return $.rect(e,t)},r}async function tD(t,e){let r,{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let s=e.padding??0,n="neo"===e.look?2*s:s,{shapeSvg:l,bbox:h}=await m(t,e,b(e)),c=Math.max(h.height+s,e.height??0),d=Math.max(h.width+n,(e.width??0)-c),g=[{x:0,y:0},{x:d+3*c/6,y:0},{x:d,y:-c},{x:-(3*c)/6,y:-c}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=u.A.svg(l),o=(0,i.Fr)(e,{}),a=k(g),s=t.path(a,o);r=l.insert(()=>s,":first-child").attr("transform",`translate(${-d/2}, ${c/2})`),p&&r.attr("style",p)}else r=R(l,d,c,g);return a&&r.attr("style",a),e.width=d,e.height=c,x(e,r),e.intersect=function(t){return $.polygon(e,g,t)},l}async function tq(t,e){let r,{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let s=e.padding??0,n="neo"===e.look?2*s:s,{shapeSvg:l,bbox:h}=await m(t,e,b(e)),c=Math.max(h.height+s,e.height??0),d=Math.max(h.width+n,(e.width??0)-c),g=[{x:-3*c/6,y:0},{x:d,y:0},{x:d+3*c/6,y:-c},{x:0,y:-c}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=u.A.svg(l),o=(0,i.Fr)(e,{}),a=k(g),s=t.path(a,o);r=l.insert(()=>s,":first-child").attr("transform",`translate(${-d/2}, ${c/2})`),p&&r.attr("style",p)}else r=R(l,d,c,g);return a&&r.attr("style",a),e.width=d,e.height=c,x(e,r),e.intersect=function(t){return $.polygon(e,g,t)},l}function tI(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.label="",e.labelStyle=r;let a=t.insert("g").attr("class",b(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,n=Math.max(35,e?.width??0),l=Math.max(35,e?.height??0),c=[{x:n,y:0},{x:0,y:l+3.5},{x:n-14,y:l+3.5},{x:0,y:2*l},{x:n,y:l-3.5},{x:14,y:l-3.5}],d=u.A.svg(a),g=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");let p=k(c),f=d.path(p,g),y=a.insert(()=>f,":first-child");return y.attr("class","outer-path"),s&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",s),o&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",o),y.attr("transform",`translate(-${n/2},${-l})`),x(e,y),e.intersect=function(t){return h.R.info("lightningBolt intersect",e,t),$.polygon(e,c,t)},a}(0,c.K)(t_,"hexagon"),(0,c.K)(tF,"hourglass"),(0,c.K)(tL,"icon"),(0,c.K)(tA,"iconCircle"),(0,c.K)(tM,"iconRounded"),(0,c.K)(t$,"iconSquare"),(0,c.K)(tE,"imageSquare"),(0,c.K)(tK,"inv_trapezoid"),(0,c.K)(tO,"labelRect"),(0,c.K)(tD,"lean_left"),(0,c.K)(tq,"lean_right"),(0,c.K)(tI,"lightningBolt");var tP=(0,c.K)((t,e,r,i,o,a,s)=>`M${t},${e+a} a${o},${a} 0,0,0 ${r},0 a${o},${a} 0,0,0 ${-r},0 l0,${i} a${o},${a} 0,0,0 ${r},0 l0,${-i} M${t},${e+a+s} a${o},${a} 0,0,0 ${r},0`,"createCylinderPathD"),tW=(0,c.K)((t,e,r,i,o,a,s)=>`M${t},${e+a} M${t+r},${e+a} a${o},${a} 0,0,0 ${-r},0 l0,${i} a${o},${a} 0,0,0 ${r},0 l0,${-i} M${t},${e+a+s} a${o},${a} 0,0,0 ${r},0`,"createOuterCylinderPathD"),tz=(0,c.K)((t,e,r,i,o,a)=>`M${t-r/2},${-i/2} a${o},${a} 0,0,0 ${r},0`,"createInnerCylinderPathD");async function tR(t,e){let r,{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let s=e.padding??0,l="neo"===e.look?16:s,h="neo"===e.look?24:s;if(e.width||e.height){let t=e.width??0;e.width=(e.width??0)-l,e.width<10&&(e.width=10),e.height=(e.height??0)-h-t/2/(2.5+t/50)*3,e.height<10&&(e.height=10)}let{shapeSvg:c,bbox:d,label:g}=await m(t,e,b(e)),p=(e?.width?e?.width:d.width)+2*l,f=p/2,y=f/(2.5+p/50),C=(e?.height?e?.height:d.height)+y+2*h,k=.1*C,{cssStyles:w}=e;if("handDrawn"===e.look){let t=u.A.svg(c),o=tW(0,0,p,C,f,y,k),a=tz(0,y,p,C,f,y),s=(0,i.Fr)(e,{}),n=t.path(o,s),l=t.path(a,s);c.insert(()=>l,":first-child").attr("class","line"),(r=c.insert(()=>n,":first-child")).attr("class","basic label-container"),w&&r.attr("style",w)}else{let t=tP(0,0,p,C,f,y,k);r=c.insert("path",":first-child").attr("d",t).attr("class","basic label-container outer-path").attr("style",(0,n.KL)(w)).attr("style",a)}return r.attr("label-offset-y",y),r.attr("transform",`translate(${-p/2}, ${-(C/2+y)})`),x(e,r),g.attr("transform",`translate(${-(d.width/2)-(d.x-(d.left??0))}, ${-(d.height/2)+y-(d.y-(d.top??0))})`),e.intersect=function(t){let r=$.rect(e,t),i=r.x-(e.x??0);if(0!=f&&(Math.abs(i)<(e.width??0)/2||Math.abs(i)==(e.width??0)/2&&Math.abs(r.y-(e.y??0))>(e.height??0)/2-y)){let o=y*y*(1-i*i/(f*f));o>0&&(o=Math.sqrt(o)),o=y-o,t.y-(e.y??0)>0&&(o=-o),r.y+=o}return r},c}async function tj(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a=e.padding??0,s="neo"===e.look?16:a,n="neo"===e.look?12:a;if(e.width||e.height){let t=e.width;e.width=(t??0)*10/11-2*s,e.width<10&&(e.width=10),e.height=(e?.height??0)-2*n,e.height<10&&(e.height=10)}let{shapeSvg:l,bbox:h,label:c}=await m(t,e,b(e)),d=(e?.width?e?.width:h.width)+(s??0)*2,g=(e?.height?e?.height:h.height)+(n??0)*2,p="neo"===e.look?g/4:g/8,f=g+p,{cssStyles:y}=e,C=u.A.svg(l),k=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let B=[{x:-d/2-d/2*.1,y:-f/2},{x:-d/2-d/2*.1,y:f/2},...w(-d/2-d/2*.1,f/2,d/2+d/2*.1,f/2,p,.8),{x:d/2+d/2*.1,y:-f/2},{x:-d/2-d/2*.1,y:-f/2},{x:-d/2,y:-f/2},{x:-d/2,y:f/2*1.1},{x:-d/2,y:-f/2}],T=C.polygon(B.map(t=>[t.x,t.y]),k),S=l.insert(()=>T,":first-child");return S.attr("class","basic label-container outer-path"),y&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",y),o&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",o),S.attr("transform",`translate(0,${-p/2})`),c.attr("transform",`translate(${-d/2+(e.padding??0)+d/2*.1/2-(h.x-(h.left??0))},${-g/2+(e.padding??0)-p-(h.y-(h.top??0))})`),x(e,S),e.intersect=function(t){return $.polygon(e,B,t)},l}(0,c.K)(tR,"linedCylinder"),(0,c.K)(tj,"linedWaveEdgedRect");var tN={normal:"usecase-actor-shape usecase-actor-normal",hollow:"usecase-actor-hollow",awesome:"usecase-actor-awesome",icon:"usecase-actor-icon"},tH=Math.PI/3,tU=(0,c.K)((t,e)=>{let r=.6*e,i=.8*e,o=Math.cos(tH),a=-Math.sin(tH),s=-(r*a),n=t+r*o,l=i*o,h=i*a;return`M ${s-l} ${n-h} L ${s+l} ${n+h}`},"businessMarkerPathForCircle"),tY={normal:tU(-24,12),hollow:tU(-23,9),awesome:tU(-21,13),icon:"M 12 -8 L 26 -26"},tX=(0,c.K)((t,e,r)=>{let i=(e.x??0)-(e.left??0),o=(e.y??0)-(e.top??0);t.attr("transform",`translate(${-e.width/2-i},${r-e.height/2-o})`)},"positionLabel"),tG=(0,c.K)((t,e,r,o,a=!1)=>{if("handDrawn"===e.look){let s=u.A.svg(t).path(r,(0,i.Fr)(e,a?{fill:"none"}:{}));return t.insert(()=>s,":first-child").attr("class",o)}let s=t.append("path").attr("class",o).attr("d",r);return a&&s.attr("fill","none"),s},"appendActorPath"),tV=(0,c.K)((t,e,r,o,a,s,n=!1)=>{if("handDrawn"===e.look){let l=u.A.svg(t).circle(r,o,2*a,(0,i.Fr)(e,n?{fill:"none"}:{}));return t.insert(()=>l,":first-child").attr("class",s)}let l=t.append("circle").attr("class",s).attr("cx",r).attr("cy",o).attr("r",a);return n&&l.attr("fill","none"),l},"appendActorCircle"),tZ=(0,c.K)((t,e,r)=>{e.business&&t.append("path").attr("class","usecase-business-marker usecase-actor-business-marker").attr("d",tY[r]).attr("fill","none").attr("style","stroke: inherit !important; stroke-width: inherit !important")},"appendBusinessActorMarker");async function tQ(t,e,r,o){let a,n,{labelStyles:h,nodeStyles:c}=(0,i.GX)(e);e.labelStyle=h;let d="icon"===r||void 0!==e.stereotype?{...e,icon:"icon"===r?void 0:e.icon,stereotype:void 0}:e,{shapeSvg:u,bbox:g,label:p}=await m(t,d,b(e,`usecase-actor-variant usecase-actor-${r}`)),f=e.accessibleName??e.label;f&&u.attr("role","img").attr("aria-label",f),p.attr("class","label actor-label usecase-actor-label");let{theme:y,themeVariables:k}=(0,l.D7)();if((0,s.XE)(u,e.colorIndex,y,k.borderColorArray),e.stereotype){let t=await C(u,`\xab${e.stereotype}\xbb`,{labelStyle:h,useHtmlLabels:e.useHtmlLabels,padding:0,centerLabel:!0,width:e.wrappingWidth});a=t.label.attr("class","label usecase-stereotype"),n=t.bbox}let w=u.append("g").attr("class",`usecase-actor-glyph ${tN[r]}`).attr("style",c||null);await o(w,e),tZ(w,e,r);let B=e.padding??8,T=n?.height??0,S=80+g.height+(n?T+2:0),v=Math.max(56,g.width,n?.width??0)+2*B,_=S+2*B,F=-S/2;w.attr("transform",`translate(0,${F+36})`);let L=F+72+8;return a&&n&&(tX(a,n,L+=T/2),L+=T/2+2),tX(p,g,L+g.height/2),x(e,u.insert("rect",":first-child").attr("class","usecase-actor-outline").attr("x",-v/2).attr("y",-_/2).attr("width",v).attr("height",_).attr("opacity",0).attr("aria-hidden","true")),e.intersect=t=>$.rect(e,t),u}async function tJ(t,e){return tQ(t,e,"normal",(t,e)=>{tG(t,e,"M 0 -12 C 6.627 -12 12 -17.373 12 -24 C 12 -30.627 6.627 -36 0 -36 C -6.627 -36 -12 -30.627 -12 -24 C -12 -17.373 -6.627 -12 0 -12 Z M 0 -12 V 8 M -17 -5 H 17 M 0 8 L -15 28 M 0 8 L 15 28","usecase-actor-stick")})}async function t0(t,e){return tQ(t,e,"awesome",(t,e)=>{tG(t,e,"M 0 -34 C 7.18 -34 13 -28.18 13 -21 C 13 -13.82 7.18 -8 0 -8 C -7.18 -8 -13 -13.82 -13 -21 C -13 -28.18 -7.18 -34 0 -34 Z M -24 25 C -24 7 -14 -3 0 -3 C 14 -3 24 7 24 25 C 24 28 21 30 18 30 H -18 C -21 30 -24 28 -24 25 Z","usecase-actor-awesome-silhouette")})}async function t1(t,e){return tQ(t,e,"hollow",(t,e)=>{tV(t,e,0,-23,9,"usecase-actor-hollow-head",!0),tG(t,e,"M -22 -10 H 22 V 0 H 6 L 22 17 L 13 28 L 0 13 L -13 28 L -22 17 L -6 0 H -22 Z","usecase-actor-hollow-body",!0)})}(0,c.K)(tQ,"renderUsecaseActor"),(0,c.K)(tJ,"usecaseActor"),(0,c.K)(t0,"usecaseActorAwesome"),(0,c.K)(t1,"usecaseActorHollow");var t2=(0,c.K)(async(t,e)=>{if("handDrawn"===e.look){let r=u.A.svg(t).rectangle(-26,-28,52,52,(0,i.Fr)(e,{}));t.insert(()=>r,":first-child").attr("class","usecase-actor-icon-frame")}else t.append("rect").attr("class","usecase-actor-icon-frame").attr("x",-26).attr("y",-28).attr("width",52).attr("height",52).attr("rx",4).attr("ry",4);let r=e.icon??"",o=await (0,a.dn)(r.includes(":")?r:`fa:${r}`),s=await (0,a.WY)(r,{height:42,width:42,fallbackPrefix:"fa"}),n=t.append("g").attr("class",`usecase-actor-icon-symbol${o?"":" usecase-actor-icon-fallback"}`).attr("aria-hidden","true").html(`<g>${s}</g>`),l=n.node()?.getBBox();l&&n.attr("transform",`translate(${-l.width/2-l.x},${-2-l.height/2-l.y})`)},"drawIconActor");async function t5(t,e){return tQ(t,e,"icon",t2)}(0,c.K)(t5,"usecaseActorIcon");var t3=(0,c.K)((t,e,r)=>{let i=(e.x??0)-(e.left??0),o=(e.y??0)-(e.top??0);t.attr("transform",`translate(${-e.width/2-i},${r-e.height/2-o})`)},"positionLabel");async function t4(t,e){let r,o,a,{labelStyles:n,nodeStyles:h}=(0,i.GX)(e);e.labelStyle=n;let c=e.stereotype?{...e,stereotype:void 0}:e,{shapeSvg:d,bbox:g,halfPadding:p,label:f}=await m(t,c,b(e,"usecase-business-shape"));f.attr("class","label usecase-label");let{theme:y,themeVariables:k}=(0,l.D7)();if((0,s.XE)(d,e.colorIndex,y,k.borderColorArray),e.stereotype){let t=await C(d,`\xab${e.stereotype}\xbb`,{labelStyle:n,useHtmlLabels:e.useHtmlLabels,padding:0,centerLabel:!0,width:e.wrappingWidth});r=t.label.attr("class","label usecase-stereotype"),o=t.bbox}let w=2*!!o,B=g.height+(o?.height??0)+w,T=Math.max(g.width,o?.width??0),S=p??10,v=T/2+2*S,_=B/2+2*S,F=Math.min(Math.max(S/5,1),S/2),L=T/2+F,A=v-F,M=L/v,E=A/v,K=_*Math.sqrt(Math.max(0,1-M*M)),O=-_*Math.sqrt(Math.max(0,1-E*E));if(r&&o&&t3(r,o,-B/2+o.height/2),t3(f,g,B/2-g.height/2),"handDrawn"===e.look){let t=u.A.svg(d).ellipse(0,0,2*v,2*_,(0,i.Fr)(e,{}));a=d.insert(()=>t,":first-child").attr("class","basic label-container usecase-business-ellipse")}else a=d.insert("ellipse",":first-child").attr("class","basic label-container usecase-business-ellipse").attr("style",h).attr("rx",v).attr("ry",_).attr("cx",0).attr("cy",0);d.append("path").attr("class","usecase-business-marker").attr("d",`M ${L} ${K} L ${A} ${O}`).attr("fill","none").attr("style",h||null);let D=e.accessibleName??e.label;return D&&d.attr("role","img").attr("aria-label",D),x(e,a),e.calcIntersect=(t,e)=>$.ellipse(t,t.width/2,t.height/2,e),e.intersect=t=>$.ellipse(e,v,_,t),d}(0,c.K)(t4,"usecaseBusiness");var t6=(0,c.K)((t,e,r,i)=>{let o=(e.x??0)-(e.left??0),a=(e.y??0)-(e.top??0);t.attr("transform",`translate(${r-e.width/2-o},${i-e.height/2-a})`)},"positionLabel"),t8=(0,c.K)(t=>{let e=Number.parseFloat(t??"");return Number.isFinite(e)&&e>=0?e:1},"numericStrokeWidth");async function t7(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e),{stylesMap:a}=(0,i.WW)(e);e.labelStyle=r;let{shapeSvg:s,bbox:n,label:l}=await m(t,e,b(e,"usecase-json-table"));s.attr("role","img"),e.accessibleName&&s.attr("aria-label",e.accessibleName),l.attr("class","label usecase-json-title");let h=s.append("g").attr("class","usecase-json-table-grid"),d=[];for(let t of e.jsonRows??[]){let i=await C(h,t.key,{labelStyle:r,useHtmlLabels:e.useHtmlLabels,padding:0,centerLabel:!0}),o=await C(h,t.value,{labelStyle:r,useHtmlLabels:e.useHtmlLabels,padding:0,centerLabel:!0});d.push({key:{label:i.label.attr("class","label usecase-json-key"),bbox:i.bbox},value:{label:o.label.attr("class","label usecase-json-value"),bbox:o.bbox}})}let g=Math.max(0,...d.map(({key:t})=>t.bbox.width))+16,p=Math.max(0,...d.map(({value:t})=>t.bbox.width))+16,f=Math.max(n.width+16,g+p),y=p+Math.max(0,f-g-p),k=n.height+8,w=d.map(({key:t,value:e})=>Math.max(t.bbox.height,e.bbox.height)+8),B=k+w.reduce((t,e)=>t+e,0),T=t8(a.get("stroke-width")),S=f+2*T,v=B+2*T,_=-f/2,F=-B/2,L="handDrawn"===e.look?u.A.svg(s):void 0,A=L?(0,i.Fr)(e,{}):void 0,M=(0,c.K)((t,e,r,i,a,s)=>{if(L&&A){let o=L.rectangle(r,i,a,s,A);return t.insert(()=>o,":first-child").attr("class",e)}return t.insert("rect",":first-child").attr("class",e).attr("x",r).attr("y",i).attr("width",a).attr("height",s).attr("style",o)},"insertCell"),E=M(s,"label-container usecase-json-border",-S/2,-v/2,S,v);M(h,"usecase-json-cell usecase-json-title-cell",_,F,f,k),h.node()?.append(l.node()),t6(l,n,0,F+k/2);let K=F+k;return d.forEach(({key:t,value:e},r)=>{let i=w[r],o=h.append("g").attr("class","usecase-json-row").attr("data-row-index",r).attr("transform",`translate(0,${K})`);M(o,"usecase-json-cell usecase-json-key-cell",_,0,g,i),M(o,"usecase-json-cell usecase-json-value-cell",_+g,0,y,i),o.node()?.append(t.label.node(),e.label.node()),t6(t.label,t.bbox,_+g/2,i/2),t6(e.label,e.bbox,_+g+y/2,i/2),K+=i}),x(e,E),e.intersect=t=>$.rect(e,t),s}async function t9(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a=e.padding??0,s="neo"===e.look?16:a,n="neo"===e.look?12:a,l="neo"===e.look?10:5;(e.width||e.height)&&(e.width=Math.max((e?.width??0)-2*s-2*l,10),e.height=Math.max((e?.height??0)-2*n-2*l,10));let{shapeSvg:h,bbox:c,label:d}=await m(t,e,b(e)),g=(e?.width?e?.width:c.width)+2*s+2*l,p=(e?.height?e?.height:c.height)+2*n+2*l,f=g-2*l,y=p-2*l,C=-f/2,w=-y/2,{cssStyles:B}=e,S=u.A.svg(h),v=(0,i.Fr)(e,{}),_=[{x:C-l,y:w+l},{x:C-l,y:w+y+l},{x:C+f-l,y:w+y+l},{x:C+f-l,y:w+y},{x:C+f,y:w+y},{x:C+f,y:w+y-l},{x:C+f+l,y:w+y-l},{x:C+f+l,y:w-l},{x:C+l,y:w-l},{x:C+l,y:w},{x:C,y:w},{x:C,y:w+l}];"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");let F=k(_),L=S.path(F,v),A=k([{x:C,y:w+l},{x:C+f-l,y:w+l},{x:C+f-l,y:w+y},{x:C+f,y:w+y},{x:C+f,y:w},{x:C,y:w}]),M=S.path(A,v);"handDrawn"!==e.look&&(L=T(L),M=T(M));let E=h.insert("g",":first-child");return E.insert(()=>L),E.insert(()=>M),E.attr("class","basic label-container outer-path"),B&&"handDrawn"!==e.look&&E.selectAll("path").attr("style",B),o&&"handDrawn"!==e.look&&E.selectAll("path").attr("style",o),d.attr("transform",`translate(${-(c.width/2)-l-(c.x-(c.left??0))}, ${-(c.height/2)+l-(c.y-(c.top??0))})`),x(e,E),e.intersect=function(t){return $.polygon(e,_,t)},h}async function et(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let{shapeSvg:a,bbox:s,label:n}=await m(t,e,b(e)),l=e.padding??0,h="neo"===e.look?16:l,c="neo"===e.look?12:l,d=!0;(e.width||e.height)&&(d=!1,e.width=(e?.width??0)-2*h,e.height=(e?.height??0)-3*c);let g=Math.max(s.width,e?.width??0)+2*h,p=Math.max(s.height,e?.height??0)+3*c,f="neo"===e.look?p/4:p/8,y=p+(d?f/2:-f/2),C=-g/2,B=-y/2,{cssStyles:T}=e,S=w(C-10,B+y+10,C+g-10,B+y+10,f,.8),v=S?.[S.length-1],_=[{x:C-10,y:B+10},{x:C-10,y:B+y+10},...S,{x:C+g-10,y:v.y-10},{x:C+g,y:v.y-10},{x:C+g,y:v.y-20},{x:C+g+10,y:v.y-20},{x:C+g+10,y:B-10},{x:C+10,y:B-10},{x:C+10,y:B},{x:C,y:B},{x:C,y:B+10}],F=[{x:C,y:B+10},{x:C+g-10,y:B+10},{x:C+g-10,y:v.y-10},{x:C+g,y:v.y-10},{x:C+g,y:B},{x:C,y:B}],L=u.A.svg(a),A=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(A.roughness=0,A.fillStyle="solid");let M=k(_),E=L.path(M,A),K=k(F),O=L.path(K,A),D=a.insert(()=>E,":first-child");return D.insert(()=>O),D.attr("class","basic label-container outer-path"),T&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",T),o&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",o),D.attr("transform",`translate(0,${-f/2})`),n.attr("transform",`translate(${-(s.width/2)-10-(s.x-(s.left??0))}, ${-(s.height/2)+10-f-(s.y-(s.top??0))})`),x(e,D),e.intersect=function(t){return $.polygon(e,_,t)},a}async function ee(t,e,{config:{themeVariables:r}}){let{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o,e.useHtmlLabels||(0,l.E)((0,l.zj)())||(e.centerLabel=!0);let{shapeSvg:s,bbox:n,label:h}=await m(t,e,b(e)),c=Math.max(n.width+(e.padding??0)*2,e?.width??0),d=Math.max(n.height+(e.padding??0)*2,e?.height??0),{cssStyles:g}=e,p=u.A.svg(s),f=(0,i.Fr)(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");let y=p.rectangle(-c/2,-d/2,c,d,f),C=s.insert(()=>y,":first-child");return C.attr("class","basic label-container outer-path"),h.attr("class","label noteLabel"),g&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",g),a&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",a),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),x(e,C),e.intersect=function(t){return $.rect(e,t)},s}(0,c.K)(t7,"usecaseJsonTable"),(0,c.K)(t9,"multiRect"),(0,c.K)(et,"multiWaveEdgedRectangle"),(0,c.K)(ee,"note");var er=(0,c.K)((t,e,r)=>`M${t+r/2},${e} L${t+r},${e-r/2} L${t+r/2},${e-r} L${t},${e-r/2} Z`,"createDecisionBoxPathD");async function ei(t,e){let r,{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let{shapeSvg:s,bbox:n}=await m(t,e,b(e)),l=n.width+(e.padding??0)+(n.height+(e.padding??0)),h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}],{cssStyles:c}=e;if("handDrawn"===e.look){let t=u.A.svg(s),o=(0,i.Fr)(e,{}),a=er(0,0,l),n=t.path(a,o);r=s.insert(()=>n,":first-child").attr("transform",`translate(${-l/2+.5}, ${l/2})`),c&&r.attr("style",c)}else(r=R(s,l,l,h)).attr("transform",`translate(${-l/2+.5}, ${l/2})`);return a&&r.attr("style",a),x(e,r),e.calcIntersect=function(t,e){let r=t.width;return $.polygon(t,[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}],e)},e.intersect=function(t){return this.calcIntersect(e,t)},s}async function eo(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a=e.padding??0,s="neo"===e.look?21:a??0,n="neo"===e.look?12:a??0,{shapeSvg:l,bbox:h,label:c}=await m(t,e,b(e)),d=h.width+("neo"===e.look?2*s:s),g=Math.max(h.height+("neo"===e.look?2*n:n),e.height??0),p=-Math.max(d,(e.width??0)-g/4)/2,f=-g/2,y=f/2,C=[{x:p+y,y:f},{x:p,y:0},{x:p+y,y:-f},{x:-p,y:-f},{x:-p,y:f}],{cssStyles:w}=e,B=u.A.svg(l),T=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(T.roughness=0,T.fillStyle="solid");let S=k(C),v=B.path(S,T),_=l.insert(()=>v,":first-child");return _.attr("class","basic label-container outer-path"),w&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",w),o&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",o),_.attr("transform",`translate(${-y/2},0)`),c.attr("transform",`translate(${-y/2-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),x(e,_),e.intersect=function(t){return $.polygon(e,C,t)},l}async function ea(t,e){let r,o,a,{labelStyles:s,nodeStyles:n}=(0,i.GX)(e);e.labelStyle=s,r=e.cssClasses?"node "+e.cssClasses:"node default";let c=t.insert("g").attr("class",r).attr("id",e.domId||e.id),g=c.insert("g"),p=c.insert("g").attr("class","label").attr("style",n),f=e.description,y=e.label,m=await K(p,y,e.labelStyle,!0,!0),C={width:0,height:0};if((0,l.E)((0,l.D7)())){let t=m.children[0],e=(0,d.Ltv)(m);C=t.getBoundingClientRect(),e.attr("width",C.width),e.attr("height",C.height)}h.R.info("Text 2",f);let b=f||[],k=m.getBBox(),w=await K(p,Array.isArray(b)?b.join("<br/>"):b,e.labelStyle,!0,!0),B=w.children[0],T=(0,d.Ltv)(w);C=B.getBoundingClientRect(),T.attr("width",C.width),T.attr("height",C.height);let S=(e.padding||0)/2;(0,d.Ltv)(w).attr("transform","translate( "+(C.width>k.width?0:(k.width-C.width)/2)+", "+(k.height+S+5)+")"),(0,d.Ltv)(m).attr("transform","translate( "+(C.width<k.width?0:-(k.width-C.width)/2)+", 0)"),C=p.node().getBBox(),p.attr("transform","translate("+-C.width/2+", "+(-C.height/2-S+3)+")");let v=C.width+(e.padding||0),_=C.height+(e.padding||0),F=-C.width/2-S,L=-C.height/2-S;if("handDrawn"===e.look){let t=u.A.svg(c),r=(0,i.Fr)(e,{}),s=t.path(E(F,L,v,_,e.rx||0),r),n=t.line(-C.width/2-S,-C.height/2-S+k.height+S,C.width/2+S,-C.height/2-S+k.height+S,r);a=c.insert(()=>(h.R.debug("Rough node insert CXC",s),n),":first-child"),o=c.insert(()=>(h.R.debug("Rough node insert CXC",s),s),":first-child")}else o=g.insert("rect",":first-child"),a=g.insert("line"),o.attr("class","outer title-state").attr("style",n).attr("x",-C.width/2-S).attr("y",-C.height/2-S).attr("width",C.width+(e.padding||0)).attr("height",C.height+(e.padding||0)),a.attr("class","divider").attr("x1",-C.width/2-S).attr("x2",C.width/2+S).attr("y1",-C.height/2-S+k.height+S).attr("y2",-C.height/2-S+k.height+S);return x(e,o),e.intersect=function(t){return $.rect(e,t)},c}async function es(t,e,{config:{themeVariables:r}}){let i=r?.radius??5,o={rx:i,ry:i,classes:"",labelPaddingX:(e?.padding??0)*1,labelPaddingY:(e?.padding??0)*1};return ty(t,e,o)}async function en(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a="neo"===e.look?16:e.padding??0,s="neo"===e.look?12:e.padding??0,{shapeSvg:l,bbox:h,label:c}=await m(t,e,b(e)),d=(e?.width??h.width)+2*a+("neo"===e.look?8:16),g=(e?.height??h.height)+2*s,p=d-8,f=8-d/2,y=-g/2,{cssStyles:C}=e,k=u.A.svg(l),w=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let B=k.polygon([{x:f,y},{x:f+p,y},{x:f+p,y:y+g},{x:f-8,y:y+g},{x:f-8,y},{x:f,y},{x:f,y:y+g}].map(t=>[t.x,t.y]),w),T=l.insert(()=>B,":first-child");return T.attr("class","basic label-container outer-path").attr("style",(0,n.KL)(C)),o&&"handDrawn"!==e.look&&T.selectAll("path").attr("style",o),C&&"handDrawn"!==e.look&&T.selectAll("path").attr("style",o),c.attr("transform",`translate(${4-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),x(e,T),e.intersect=function(t){return $.rect(e,t)},l}async function el(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a=e.padding??0,s="neo"===e.look?16:a,n="neo"===e.look?12:a;(e.width||e.height)&&(e.width=Math.max((e?.width??0)-2*s,10),e.height=Math.max((e?.height??0)/1.5-2*n,10));let{shapeSvg:l,bbox:h,label:c}=await m(t,e,b(e)),d=(e?.width?e?.width:h.width)+2*s,g=((e?.height?e?.height:h.height)+2*n)*1.5/1.5,p=-d/2,f=-g/2,{cssStyles:y}=e,C=u.A.svg(l),w=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let B=[{x:p,y:f},{x:p,y:f+g},{x:p+d,y:f+g},{x:p+d,y:f-g/2}],T=k(B),S=C.path(T,w),v=l.insert(()=>S,":first-child");return v.attr("class","basic label-container outer-path"),y&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",y),o&&"handDrawn"!==e.look&&v.selectChildren("path").attr("style",o),v.attr("transform",`translate(0, ${g/4})`),c.attr("transform",`translate(${-d/2+(e.padding??0)-(h.x-(h.left??0))}, ${-g/4+(e.padding??0)-(h.y-(h.top??0))})`),x(e,v),e.intersect=function(t){return $.polygon(e,B,t)},l}async function eh(t,e){let r=e.padding??0,i="neo"===e.look?16:2*r,o="neo"===e.look?12:r,a={rx:0,ry:0,classes:"",labelPaddingX:e.labelPaddingX??i,labelPaddingY:o},n=await ty(t,e,a);if(void 0!==e.colorIndex){let{theme:t,themeVariables:r}=(0,l.D7)();(0,s.XE)(n,e.colorIndex,t,r.borderColorArray)}return n}(0,c.K)(ei,"question"),(0,c.K)(eo,"rect_left_inv_arrow"),(0,c.K)(ea,"rectWithTitle"),(0,c.K)(es,"roundedRect"),(0,c.K)(en,"shadedProcess"),(0,c.K)(el,"slopedRect"),(0,c.K)(eh,"squareRect");var ec=(0,c.K)((t,e,r)=>{let i=t.height+r,o=i*Math.cos(Math.PI/98),a=Math.sqrt(Math.max(0,o**2-t.height**2));return{w:Math.max(t.width+i/4+e,1.5*i+(i-o),t.width+e+i-a),h:i}},"stadiumDimensions");async function ed(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a=e.padding??0,s="neo"===e.look?40:a,n="neo"===e.look?24:a,{shapeSvg:l,bbox:h}=await m(t,e,b(e)),{w:c,h:d}=ec(h,s,n),g=d/2,{cssStyles:p}=e,f=u.A.svg(l),y=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");let C=[{x:-c/2+g,y:-d/2},{x:c/2-g,y:-d/2},...B(-c/2+g,0,g,50,90,270),{x:c/2-g,y:d/2},...B(c/2-g,0,g,50,270,450)],w=k(C),T=f.path(w,y),S=l.insert(()=>T,":first-child");return S.attr("class","basic label-container outer-path"),p&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",p),o&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",o),x(e,S),e.intersect=function(t){return $.polygon(e,C,t)},l}async function eu(t,e){let r={rx:"neo"===e.look?3:5,ry:"neo"===e.look?3:5,classes:"flowchart-node"};return ty(t,e,r)}function eg(t,e,{config:{themeVariables:r}}){let{labelStyles:o,nodeStyles:a}=(0,i.GX)(e);e.labelStyle=o;let{cssStyles:s}=e,{lineColor:n,stateBorder:l,nodeBorder:h,nodeShadow:c}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);let d=t.insert("g").attr("class","node default").attr("id",e.domId??e.id),g=u.A.svg(d),p=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");let f=g.circle(0,0,e.width,{...p,stroke:n,strokeWidth:2}),y=l??h,m=(e.width??0)*5/14,C=g.circle(0,0,m,{...p,fill:y,stroke:y,strokeWidth:2,fillStyle:"solid"}),b=d.insert(()=>f,":first-child");if(b.insert(()=>C),"handDrawn"!==e.look&&b.attr("class","outer-path"),s&&b.selectAll("path").attr("style",s),a&&b.selectAll("path").attr("style",a),e.width<25&&c&&"handDrawn"!==e.look){let e=t.node()?.ownerSVGElement?.id??"",r=e?`${e}-drop-shadow-small`:"drop-shadow-small";b.attr("style",`filter:url(#${r})`)}return x(e,b),e.intersect=function(t){return $.circle(e,(e.width??0)/2,t)},d}function ep(t,e,{config:{themeVariables:r}}){let o,{lineColor:a,nodeShadow:s}=r;(e.width||e.height)&&((e.width??0)<14&&(e.width=14),(e.height??0)<14&&(e.height=14)),e.width||(e.width=14),e.height||(e.height=14);let n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);if("handDrawn"===e.look){let t=u.A.svg(n).circle(0,0,e.width,(0,i.ue)(a));(o=n.insert(()=>t)).attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else(o=n.insert("circle",":first-child")).attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14);if(e.width<25&&s&&"handDrawn"!==e.look){let e=t.node()?.ownerSVGElement?.id??"",r=e?`${e}-drop-shadow-small`:"drop-shadow-small";o.attr("style",`filter:url(#${r})`)}return x(e,o),e.intersect=function(t){return $.circle(e,(e.width??7)/2,t)},n}async function ef(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a=e?.padding??8,s="neo"===e.look?28:a,l="neo"===e.look?12:a,{shapeSvg:h,bbox:c}=await m(t,e,b(e)),d=Math.max(c.width+16+s,e.width??0),g=Math.max(c.height+l,e.height??0),p=d-16,f=-d/2,y=-g/2,C=[{x:0,y:0},{x:p,y:0},{x:p,y:-g},{x:0,y:-g},{x:0,y:0},{x:-8,y:0},{x:p+8,y:0},{x:p+8,y:-g},{x:-8,y:-g},{x:-8,y:0}];if("handDrawn"===e.look){let t=u.A.svg(h),r=(0,i.Fr)(e,{}),o=t.rectangle(f,y,p+16,g,r),a=t.line(f+8,y,f+8,y+g,r),s=t.line(f+8+p,y,f+8+p,y+g,r);h.insert(()=>a,":first-child"),h.insert(()=>s,":first-child");let l=h.insert(()=>o,":first-child"),{cssStyles:c}=e;l.attr("class","basic label-container").attr("style",(0,n.KL)(c)),x(e,l)}else{let t=R(h,p,g,C);o&&t.attr("style",o),x(e,t)}return e.intersect=function(t){return $.polygon(e,C,t)},h}async function ey(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let a=e.padding??0,s="neo"===e.look?16:a,n="neo"===e.look?12:a;(e.width||e.height)&&(e.height=Math.max((e?.height??0)-2*n,10),e.width=Math.max((e?.width??0)-2*s-.2*(e.height+2*n),10));let{shapeSvg:l,bbox:h}=await m(t,e,b(e)),c=(e?.height?e?.height:h.height)+2*n,d=.2*c,g=(e?.width?e?.width:h.width)+2*s+d-d,p=-g/2,f=-c/2,{cssStyles:y}=e,C=u.A.svg(l),w=(0,i.Fr)(e,{}),B=[{x:p-d/2,y:f},{x:p+g+d/2,y:f},{x:p+g+d/2,y:f+c},{x:p-d/2,y:f+c}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let T=k(B),S=C.path(T,w),v=k([{x:p+g-d/2,y:f+c},{x:p+g+d/2,y:f+c},{x:p+g+d/2,y:f+c-.2*c}]),_=C.path(v,{...w,fillStyle:"solid"}),F=l.insert(()=>_,":first-child");return F.insert(()=>S,":first-child"),F.attr("class","basic label-container outer-path"),y&&"handDrawn"!==e.look&&F.selectAll("path").attr("style",y),o&&"handDrawn"!==e.look&&F.selectAll("path").attr("style",o),x(e,F),e.intersect=function(t){return $.polygon(e,B,t)},l}async function em(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let{shapeSvg:a,bbox:s,label:n}=await m(t,e,b(e)),l=Math.max(s.width+(e.padding??0)*2,e?.width??0),h=Math.max(s.height+(e.padding??0)*2,e?.height??0),c=h/8,d=.2*l,g=.2*h,p=h+c,{cssStyles:f}=e,y=u.A.svg(a),C=(0,i.Fr)(e,{});"handDrawn"!==e.look&&(C.roughness=0,C.fillStyle="solid");let B=[{x:-l/2-l/2*.1,y:p/2},...w(-l/2-l/2*.1,p/2,l/2+l/2*.1,p/2,c,.8),{x:l/2+l/2*.1,y:-p/2},{x:-l/2-l/2*.1,y:-p/2}],T=-l/2+l/2*.1,S=-p/2-.4*g,v=[{x:T+l-d,y:(S+h)*1.3},{x:T+l,y:S+h-g},{x:T+l,y:(S+h)*.9},...w(T+l,(S+h)*1.25,T+l-d,(S+h)*1.3,-(.02*h),.5)],_=k(B),F=y.path(_,C),L=k(v),A=y.path(L,{...C,fillStyle:"solid"}),M=a.insert(()=>A,":first-child");return M.insert(()=>F,":first-child"),M.attr("class","basic label-container outer-path"),f&&"handDrawn"!==e.look&&M.selectAll("path").attr("style",f),o&&"handDrawn"!==e.look&&M.selectAll("path").attr("style",o),M.attr("transform",`translate(0,${-c/2})`),n.attr("transform",`translate(${-l/2+(e.padding??0)-(s.x-(s.left??0))},${-h/2+(e.padding??0)-c/2-(s.y-(s.top??0))})`),x(e,M),e.intersect=function(t){return $.polygon(e,B,t)},a}async function eC(t,e){let{labelStyles:r,nodeStyles:o}=(0,i.GX)(e);e.labelStyle=r;let{shapeSvg:a,bbox:s}=await m(t,e,b(e)),n=Math.max(s.width+(e.padding??0),e?.width||0),l=Math.max(s.height+(e.padding??0),e?.height||0),h=a.insert("rect",":first-child");return h.attr("class","text").attr("style",o).attr("rx",0).attr("ry",0).attr("x",-n/2).attr("y",-l/2).attr("width",n).attr("height",l),x(e,h),e.intersect=function(t){return $.rect(e,t)},a}(0,c.K)(ed,"stadium"),(0,c.K)(eu,"state"),(0,c.K)(eg,"stateEnd"),(0,c.K)(ep,"stateStart"),(0,c.K)(ef,"subroutine"),(0,c.K)(ey,"taggedRect"),(0,c.K)(em,"taggedWaveEdgedRectangle"),(0,c.K)(eC,"text");var ex=(0,c.K)((t,e,r,i,o,a)=>`M${t},${e}
|
|
4
4
|
a${o},${a} 0,0,1 0,${-i}
|
|
@@ -192,7 +192,7 @@ ${o.join("\n")}`)}}),globalThis.injected??={includeLargeFeatures:!0,profiling:!1
|
|
|
192
192
|
L20,10
|
|
193
193
|
M20,10
|
|
194
194
|
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),td=(0,c.K)((t,e,r)=>{let i=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),tu=(0,c.K)((t,e,r)=>{let{themeVariables:i}=(0,l.zj)(),{strokeWidth:o}=i,a=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),tg={extension:H,composition:U,aggregation:Y,dependency:X,lollipop:G,point:V,circle:Z,cross:Q,barb:J,barbNeo:tt,hierarchy:(0,c.K)((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-hierarchyEnd").attr("class","marker hierarchy "+e).attr("viewBox","0 0 12 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none"),t.append("marker").attr("id",r+"_"+e+"-hierarchyStart").attr("class","marker hierarchy "+e).attr("viewBox","0 0 12 10").attr("refX",2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none")},"hierarchy"),only_one:te,zero_or_one:tr,one_or_more:ti,zero_or_more:to,only_one_neo:ta,zero_or_one_neo:ts,one_or_more_neo:tn,zero_or_more_neo:tl,requirement_arrow:th,requirement_contains:td,requirement_arrow_neo:tc,requirement_contains_neo:tu};r.d(e,{IU:()=>v,Jo:()=>W,Nq:()=>f,T_:()=>M,UQ:()=>S,a6:()=>_,g0:()=>N,hq:()=>p,jP:()=>L,lP:()=>T})},NH(t,e,r){"use strict";r.d(e,{pe:()=>S,PX:()=>J,ru:()=>Z,Un:()=>Q,$t:()=>ta,Sm:()=>tl,C4:()=>tn,$C:()=>N,rY:()=>th,sM:()=>R,KL:()=>tc,Ib:()=>$,dq:()=>tr,I5:()=>to,yT:()=>U,vU:()=>A,_K:()=>ts,bH:()=>G});var i,o=r("Yr"),a=r("M4"),s=r("Gt"),n=r("tP"),l=r("El");function h(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw TypeError("Expected a function");let r=function(...i){let o=e?e.apply(this,i):i[0],a=r.cache;if(a.has(o))return a.get(o);let s=t.apply(this,i);return r.cache=a.set(o,s)||a,s};return r.cache=new(h.Cache||Map),r}function c(){}h.Cache=Map;var d=r("OY"),u=r("Oe");function g(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}var p=r("NM");function f(t){if("object"!=typeof t||null==t)return!1;if(null===Object.getPrototypeOf(t))return!0;if("[object Object]"!==Object.prototype.toString.call(t)){let e=t[Symbol.toStringTag];return null!=e&&!!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable&&t.toString()===`[object ${e}]`}let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}var y=r("DH"),m=r("VV");function C(t,e,r,i=new Map,o){let a=o?.(t,e,r,i);if(void 0!==a)return a;if((0,d.s)(t))return t;if(i.has(t))return i.get(t);if(Array.isArray(t)){let e=Array(t.length);i.set(t,e);for(let a=0;a<t.length;a++)e[a]=C(t[a],a,r,i,o);return Object.hasOwn(t,"index")&&(e.index=t.index),Object.hasOwn(t,"input")&&(e.input=t.input),e}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,e}if(t instanceof Map){let e=new Map;for(let[a,s]of(i.set(t,e),t))e.set(a,C(s,a,r,i,o));return e}if(t instanceof Set){let e=new Set;for(let a of(i.set(t,e),t))e.add(C(a,void 0,r,i,o));return e}if((0,p.P)(t))return t.subarray();if((0,u.i)(t)){let e=new(Object.getPrototypeOf(t)).constructor(t.length);i.set(t,e);for(let a=0;a<t.length;a++)e[a]=C(t[a],a,r,i,o);return e}if(t instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){let e=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return i.set(t,e),x(e,t,r,i,o),e}if("u">typeof File&&t instanceof File){let e=new File([t],t.name,{type:t.type});return i.set(t,e),x(e,t,r,i,o),e}if("u">typeof Blob&&t instanceof Blob){let e=new Blob([t],{type:t.type});return i.set(t,e),x(e,t,r,i,o),e}if(t instanceof Error){let e=structuredClone(t);return i.set(t,e),e.message=t.message,e.name=t.name,e.stack=t.stack,e.cause=t.cause,e.constructor=t.constructor,x(e,t,r,i,o),e}if(t instanceof Boolean){let e=new Boolean(t.valueOf());return i.set(t,e),x(e,t,r,i,o),e}if(t instanceof Number){let e=new Number(t.valueOf());return i.set(t,e),x(e,t,r,i,o),e}if(t instanceof String){let e=new String(t.valueOf());return i.set(t,e),x(e,t,r,i,o),e}if("object"==typeof t&&function(t){switch((0,y.b)(t)){case m.R_:case m.Uw:case m.cT:case m.iq:case m.$V:case m.vC:case m.ri:case m.ML:case m.XZ:case m.i1:case m._u:case m.pj:case m.kj:case m.GX:case m.Av:case m.NA:case m.OG:case m.VP:case m.Qb:case m.q:case m.x6:case m.ZR:return!0;default:return!1}}(t)){let e=Object.create(Object.getPrototypeOf(t));return i.set(t,e),x(e,t,r,i,o),e}return t}function x(t,e,r=t,i,o){let a=[...Object.keys(e),...g(e)];for(let s=0;s<a.length;s++){let n=a[s],l=Object.getOwnPropertyDescriptor(t,n);(null==l||l.writable)&&(t[n]=C(e[n],n,r,i,o))}}function b(t){var e;return e=(e,r,i,o)=>{let a;if(void 0!==a)return a;if("object"==typeof t){if("[object Object]"===(0,y.b)(t)&&"function"!=typeof t.constructor){let e={};return o.set(t,e),x(e,t,i,o),e}switch(Object.prototype.toString.call(t)){case m.kj:case m.OG:case m.$V:{let e=new t.constructor(t?.valueOf());return x(e,t),e}case m.R_:{let e={};return x(e,t),e.length=t.length,e[Symbol.iterator]=t[Symbol.iterator],e}default:return}}},C(t,void 0,t,new Map,e)}var k=r("rY0");function w(t){return"object"==typeof t&&null!==t}var B=r("tNQ"),T=r("SPK"),S="",v={curveBasis:l.qrM,curveBasisClosed:l.Yu4,curveBasisOpen:l.IA3,curveBumpX:l.Wi0,curveBumpY:l.PGM,curveBundle:l.OEq,curveCardinalClosed:l.olC,curveCardinalOpen:l.IrU,curveCardinal:l.y8u,curveCatmullRomClosed:l.Q7f,curveCatmullRomOpen:l.cVp,curveCatmullRom:l.oDi,curveLinear:l.lUB,curveLinearClosed:l.Lx9,curveMonotoneX:l.nVG,curveMonotoneY:l.uxU,curveNatural:l.Xf2,curveStep:l.GZz,curveStepAfter:l.UPb,curveStepBefore:l.dyv},_=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,F=(0,s.K)(function(t,e){let r=L(t,/(?:init\b)|(?:initialize\b)/),i={};if(Array.isArray(r)){let t=r.map(t=>t.args);(0,o.$i)(t),i=(0,o.hH)(i,[...t])}else i=r.args;if(!i)return;let a=(0,o.Ch)(t,e),s="config";return void 0!==i[s]&&("flowchart-v2"===a&&(a="flowchart"),i[a]=i[s],delete i[s]),i},"detectInit"),L=(0,s.K)(function(t,e=null){try{let r,i=RegExp(`[%]{2}(?![{]${_.source})(?=[}][%]{2}).*
|
|
195
|
-
`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),a.R.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);let s=[];for(;null!==(r=o.DB.exec(t));)if(r.index===o.DB.lastIndex&&o.DB.lastIndex++,r&&!e||e&&r[1]?.match(e)||e&&r[2]?.match(e)){let t=r[1]?r[1]:r[2],e=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;s.push({type:t,args:e})}if(0===s.length)return{type:t,args:null};return 1===s.length?s[0]:s}catch(r){return a.R.error(`ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),A=(0,s.K)(function(t){return t.replace(o.DB,"")},"removeDirectives"),M=(0,s.K)(function(t,e){for(let[r,i]of e.entries())if(i.match(t))return r;return -1},"isSubstringInArray");function $(t,e){return t?v[`curve${t.charAt(0).toUpperCase()+t.slice(1)}`]??e:e}function E(t,e){let r=t.trim();if(r)return"loose"!==e.securityLevel?(0,n.J)(r):r}(0,s.K)($,"interpolateToCurve"),(0,s.K)(E,"formatUrl");var K=(0,s.K)((t,...e)=>{let r=t.split("."),i=r.length-1,o=r[i],s=window;for(let e=0;e<i;e++)if(!(s=s[r[e]]))return void a.R.error(`Function name: ${t} not found in window`);s[o](...e)},"runFunc");function O(t,e){return t&&e?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):0}function D(t){let e,r=0;return t.forEach(t=>{r+=O(t,e),e=t}),P(t,r/2)}function q(t){return 1===t.length?t[0]:D(t)}(0,s.K)(O,"distance"),(0,s.K)(D,"traverseEdge"),(0,s.K)(q,"calcLabelPosition");var I=(0,s.K)((t,e=2)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),P=(0,s.K)((t,e)=>{let r,i=e;for(let e of t){if(r){let t=O(e,r);if(0===t)return r;if(t<i)i-=t;else{let o=i/t;if(o<=0)return r;if(o>=1)return{x:e.x,y:e.y};if(o>0&&o<1)return{x:I((1-o)*r.x+o*e.x,5),y:I((1-o)*r.y+o*e.y,5)}}}r=e}throw Error("Could not find a suitable point for the given distance")},"calculatePoint"),W=(0,s.K)((t,e,r)=>{a.R.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());let i=P(e,25),o=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),n={x:0,y:0};return n.x=Math.sin(s)*o+(e[0].x+i.x)/2,n.y=-Math.cos(s)*o+(e[0].y+i.y)/2,n},"calcCardinalityPosition");function z(t,e,r){let i=structuredClone(r);a.R.info("our points",i),"start_left"!==e&&"start_right"!==e&&i.reverse();let o=P(i,25+t),s=10+.5*t,n=Math.atan2(i[0].y-o.y,i[0].x-o.x),l={x:0,y:0};return"start_left"===e?(l.x=Math.sin(n+Math.PI)*s+(i[0].x+o.x)/2,l.y=-Math.cos(n+Math.PI)*s+(i[0].y+o.y)/2):"end_right"===e?(l.x=Math.sin(n-Math.PI)*s+(i[0].x+o.x)/2-5,l.y=-Math.cos(n-Math.PI)*s+(i[0].y+o.y)/2-5):"end_left"===e?(l.x=Math.sin(n)*s+(i[0].x+o.x)/2-5,l.y=-Math.cos(n)*s+(i[0].y+o.y)/2-5):(l.x=Math.sin(n)*s+(i[0].x+o.x)/2,l.y=-Math.cos(n)*s+(i[0].y+o.y)/2),l}function R(t){let e="",r="";for(let i of t)void 0!==i&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":e=e+i+";");return{style:e,labelStyle:r}}(0,s.K)(z,"calcTerminalLabelPosition"),(0,s.K)(R,"getStylesFromArray");var j=0,N=(0,s.K)(()=>(j++,"id-"+Math.random().toString(36).substr(2,12)+"-"+j),"generateId");function H(t){let e="",r="0123456789abcdef",i=r.length;for(let o=0;o<t;o++)e+=r.charAt(Math.floor(Math.random()*i));return e}(0,s.K)(H,"makeRandomHex");var U=(0,s.K)(t=>H(t.length),"random"),Y=(0,s.K)(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),X=(0,s.K)(function(t,e){let r=e.text.replace(o.Y2.lineBreakRegex," "),[,i]=to(e.fontSize),a=t.append("text");a.attr("x",e.x),a.attr("y",e.y),a.style("text-anchor",e.anchor),a.style("font-family",e.fontFamily),a.style("font-size",i),a.style("font-weight",e.fontWeight),a.attr("fill",e.fill),void 0!==e.class&&a.attr("class",e.class);let s=a.append("tspan");return s.attr("x",e.x+2*e.textMargin),s.attr("fill",e.fill),s.text(r),a},"drawSimpleText"),G=h((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),o.Y2.hasBreaks(t)))return t;let i=t.split(" ").filter(Boolean),a=[],s="";return i.forEach((t,o)=>{let n=Q(`${t} `,r),l=Q(s,r);if(n>e){let{hyphenatedStrings:i,remainingWord:o}=V(t,e,"-",r);a.push(s,...i),s=o}else l+n>=e?(a.push(s),s=t):s=[s,t].filter(Boolean).join(" ");o+1===i.length&&a.push(s)}),a.filter(t=>""!==t).join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),V=h((t,e,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);let o=[...t],a=[],s="";return o.forEach((t,n)=>{let l=`${s}${t}`;if(Q(l,i)>=e){let t=o.length===n+1,e=`${l}${r}`;a.push(t?l:e),s=""}else s=l}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",i)=>`${t}${e}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Z(t,e){return J(t,e).height}function Q(t,e){return J(t,e).width}(0,s.K)(Z,"calculateTextHeight"),(0,s.K)(Q,"calculateTextWidth");var J=h((t,e)=>{let{fontSize:r=12,fontFamily:i="Arial",fontWeight:a=400}=e;if(!t)return{width:0,height:0};let[,s]=to(r),n=t.split(o.Y2.lineBreakRegex),h=[],c=(0,l.Ltv)("body");if(!c.remove)return{width:0,height:0,lineHeight:0};let d=c.append("svg");for(let t of["sans-serif",i]){let e=0,r={width:0,height:0,lineHeight:0};for(let i of n){let o=Y();o.text=i||S;let n=X(d,o).style("font-size",s).style("font-weight",a).style("font-family",t),l=(n._groups||n)[0][0].getBBox();if(0===l.width&&0===l.height)throw Error("svg element not in render tree");r.width=Math.round(Math.max(r.width,l.width)),e=Math.round(l.height),r.height+=e,r.lineHeight=Math.round(Math.max(r.lineHeight,e))}h.push(r)}d.remove();let u=isNaN(h[1].height)||isNaN(h[1].width)||isNaN(h[1].lineHeight)||h[0].height>h[1].height&&h[0].width>h[1].width&&h[0].lineHeight>h[1].lineHeight?0:1;return h[u]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),tt=class{constructor(t=!1,e){this.count=0,this.count=e?e.length:0,this.next=t?()=>this.count++:()=>Date.now()}static{(0,s.K)(this,"InitIDGenerator")}},te=(0,s.K)(function(t){return i=i||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),i.innerHTML=t,unescape(i.textContent)},"entityDecode");function tr(t){return"str"in t}(0,s.K)(tr,"isDetailedError");var ti=(0,s.K)((t,e,r,i)=>{if(!i)return;let o=t.node()?.getBBox();o&&t.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",e)},"insertTitle"),to=(0,s.K)(t=>{if("number"==typeof t)return[t,t+"px"];let e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ta(t,e){return function(t,...e){return function(t,...e){let r=e.slice(0,-1),i=e[e.length-1],o=t;for(let t=0;t<r.length;t++)o=function t(e,r,i,o){if((0,d.s)(e)&&(e=Object(e)),null==r||"object"!=typeof r)return e;if(o.has(r))return function(t){if((0,d.s)(t))return t;if(Array.isArray(t)||(0,u.i)(t)||t instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer)return t.slice(0);let e=Object.getPrototypeOf(t);if(null==e)return Object.assign(Object.create(e),t);let r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){let e=new r(t);return e.lastIndex=t.lastIndex,e}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let e;return(e=t instanceof AggregateError?new r(t.errors,t.message,{cause:t.cause}):new r(t.message,{cause:t.cause})).stack=t.stack,Object.assign(e,t),e}return"u">typeof File&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):"object"==typeof t?Object.assign(Object.create(e),t):t}(o.get(r));if(o.set(r,e),Array.isArray(r)){r=r.slice();for(let t=0;t<r.length;t++)t in r||(r[t]=void 0)}let a=[...Object.keys(r),...g(r)];for(let n=0;n<a.length;n++){let l=a[n];if("__proto__"===l)continue;let h=r[l],c=e[l];if((0,k.N)(h)&&(h={...h}),(0,k.N)(c)&&(c={...c}),(0,p.P)(h)&&(h=b(h)),Array.isArray(h))if(Array.isArray(c)){let t=[],e=Reflect.ownKeys(c);for(let r=0;r<e.length;r++){let i=e[r];t[i]=c[i]}c=t}else{var s;if(w(s=c)&&(0,B.X)(s)){let t=[];for(let e=0;e<c.length;e++)t[e]=c[e];c=t}else c=[]}let d=i(c,h,l,e,r,o);void 0!==d?e[l]=d:Array.isArray(h)||w(c)&&w(h)&&(f(c)||f(h)||(0,T.i)(c)||(0,T.i)(h))?e[l]=t(c,h,i,o):null==c&&f(h)?e[l]=t({},h,i,o):null==c&&(0,T.i)(h)?e[l]=b(h):(void 0===c||void 0!==h)&&(e[l]=h)}return e}(o,r[t],i,new Map);return o}(t,...e,c)}({},t,e)}(0,s.K)(ta,"cleanAndMerge");var ts={assignWithDepth:o.hH,wrapLabel:G,calculateTextHeight:Z,calculateTextWidth:Q,calculateTextDimensions:J,cleanAndMerge:ta,detectInit:F,detectDirective:L,isSubstringInArray:M,interpolateToCurve:$,calcLabelPosition:q,calcCardinalityPosition:W,calcTerminalLabelPosition:z,formatUrl:E,getStylesFromArray:R,generateId:N,random:U,runFunc:K,entityDecode:te,insertTitle:ti,isLabelCoordinateInPath:td,parseFontSize:to,InitIDGenerator:tt},tn=(0,s.K)(function(t){let e=t;return(e=(e=e.replace(/style.*:\S*#.*;/g,function(t){return t.substring(0,t.length-1)})).replace(/classDef.*:\S*#.*;/g,function(t){return t.substring(0,t.length-1)})).replace(/#\w+;/g,function(t){let e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})},"encodeEntities"),tl=(0,s.K)(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),th=(0,s.K)((t,e,{counter:r=0,prefix:i,suffix:o},a)=>a||`${i?`${i}_`:""}${t}_${e}_${r}${o?`_${o}`:""}`,"getEdgeId");function tc(t){return t??null}function td(t,e){let r=Math.round(t.x),i=Math.round(t.y),o=e.replace(/(\d+\.\d+)/g,t=>Math.round(parseFloat(t)).toString());return o.includes(r.toString())||o.includes(i.toString())}(0,s.K)(tc,"handleUndefinedAttr"),(0,s.K)(td,"isLabelCoordinateInPath")},Fl(t,e,r){"use strict";r.d(e,{default:()=>r0});var i=r("MM"),o=r("Wf"),a=r("mW");r("Q"),r("ix"),r("LC"),r("bQ"),r("Ut"),r("PF"),r("iV");var s=r("h5");r("pK");var n=r("NH"),l=r("Yr"),h=r("M4"),c=r("Gt"),d=r("pk"),u=r("El"),g="comm",p="rule",f="decl",y="@keyframes",m="@layer",C=Math.abs,x=String.fromCharCode;function b(t,e,r){return t.replace(e,r)}function k(t,e){return 0|t.charCodeAt(e)}function w(t,e,r){return t.slice(e,r)}function B(t){return t.length}function T(t,e){return e.push(t),t}function S(t,e){for(var r="",i=0;i<t.length;i++)r+=e(t[i],i,t,e)||"";return r}function v(t,e,r,i){switch(t.type){case m:if(t.children.length)break;case"@import":case"@namespace":case f:return t.return=t.return||t.value;case g:return"";case y:return t.return=t.value+"{"+S(t.children,i)+"}";case p:if(!B(t.value=t.props.join(",")))return""}return B(r=S(t.children,i))?t.return=t.value+"{"+r+"}":""}var _=1,F=1,L=0,A=0,M=0,$="";function E(t,e,r,i,o,a,s,n){return{value:t,root:e,parent:r,type:i,props:o,children:a,line:_,column:F,length:s,return:"",siblings:n}}function K(){return M=A<L?k($,A++):0,F++,10===M&&(F=1,_++),M}function O(){return k($,A)}function D(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function q(t){var e,r;return(e=A-1,r=function t(e){for(;K();)switch(M){case e:return A;case 34:case 39:34!==e&&39!==e&&t(M);break;case 40:41===e&&t(e);break;case 92:K()}return A}(91===t?t+2:40===t?t+1:t),w($,e,r)).trim()}function I(t,e,r,i,o,a,s,n,l,h,c,d){for(var u=o-1,g=0===o?a:[""],f=g.length,y=0,m=0,x=0;y<i;++y)for(var k=0,B=w(t,u+1,u=C(m=s[y])),T=t;k<f;++k)(T=(m>0?g[k]+" "+B:b(B,/&\f/g,g[k])).trim())&&(l[x++]=T);return E(t,e,r,0===o?p:n,l,h,c,d)}function P(t,e,r,i,o){return E(t,e,r,f,w(t,0,i),w(t,i+1,-1),i,o)}var W=r("L"),z=r("NM"),R=r("tNQ"),j=r("rY0"),N=r("SPK");function H(t){if(null==t)return!0;if((0,R.X)(t))return("function"==typeof t.splice||"string"==typeof t||!!(0,z.P)(t)||!!(0,N.i)(t)||!!(0,j.N)(t))&&0===t.length;if("object"==typeof t||"function"==typeof t){let e;if(t instanceof Map||t instanceof Set)return 0===t.size;let r=Object.keys(t);return(e=t?.constructor,t===("function"==typeof e?e.prototype:Object.prototype))?0===r.filter(t=>"constructor"!==t).length:0===r.length}return!0}var U={id:"c4",detector:(0,c.K)(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),loader:(0,c.K)(async()=>{let{diagram:t}=await r.e("up").then(r.bind(r,"Yq"));return{id:"c4",diagram:t}},"loader")},Y="flowchart-v2",X=(0,c.K)(t=>/^\s*(graph|flowchart)/.test(t),"detector"),G=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("k"),r.e("h1")]).then(r.bind(r,"PZ"));return{id:Y,diagram:t}},"loader"),V={id:Y,detector:X,loader:G},Z="agentflow",Q=(0,c.K)(t=>/^\s*agentflow-beta\b/.test(t),"detector"),J=(0,c.K)(async()=>{let{diagram:t}=await r.e("og").then(r.bind(r,"WU"));return{id:Z,diagram:t}},"loader"),tt={id:Z,detector:Q,loader:J},te="swimlane",tr=(0,c.K)(t=>/^\s*swimlane-beta\b/.test(t),"detector"),ti=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("k"),r.e("oc")]).then(r.bind(r,"WK"));return{id:te,diagram:t}},"loader"),to={id:te,detector:tr,loader:ti},ta={id:"er",detector:(0,c.K)(t=>/^\s*erDiagram/.test(t),"detector"),loader:(0,c.K)(async()=>{let{diagram:t}=await r.e("sy").then(r.bind(r,"aT"));return{id:"er",diagram:t}},"loader")},ts="gitGraph",tn=(0,c.K)(t=>/^\s*gitGraph/.test(t),"detector"),tl=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("ls")]).then(r.bind(r,"Xd"));return{id:ts,diagram:t}},"loader"),th={id:ts,detector:tn,loader:tl},tc="gantt",td=(0,c.K)(t=>/^\s*gantt/.test(t),"detector"),tu=(0,c.K)(async()=>{let{diagram:t}=await r.e("5j").then(r.bind(r,"TT"));return{id:tc,diagram:t}},"loader"),tg={id:tc,detector:td,loader:tu},tp="info",tf=(0,c.K)(t=>/^\s*info/.test(t),"detector"),ty=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("5b")]).then(r.bind(r,"fL"));return{id:tp,diagram:t}},"loader"),tm={id:tp,detector:tf,loader:ty},tC={id:"pie",detector:(0,c.K)(t=>/^\s*pie/.test(t),"detector"),loader:(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("ys")]).then(r.bind(r,"Qe"));return{id:"pie",diagram:t}},"loader")},tx="quadrantChart",tb=(0,c.K)(t=>/^\s*quadrantChart/.test(t),"detector"),tk=(0,c.K)(async()=>{let{diagram:t}=await r.e("id").then(r.bind(r,"gO"));return{id:tx,diagram:t}},"loader"),tw={id:tx,detector:tb,loader:tk},tB="xychart",tT=(0,c.K)(t=>/^\s*xychart(-beta)?/.test(t),"detector"),tS=(0,c.K)(async()=>{let{diagram:t}=await r.e("6o").then(r.bind(r,"QT"));return{id:tB,diagram:t}},"loader"),tv={id:tB,detector:tT,loader:tS},t_="requirement",tF=(0,c.K)(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),tL=(0,c.K)(async()=>{let{diagram:t}=await r.e("e").then(r.bind(r,"cw"));return{id:t_,diagram:t}},"loader"),tA={id:t_,detector:tF,loader:tL},tM="sequence",t$=(0,c.K)(t=>/^\s*sequenceDiagram/.test(t),"detector"),tE=(0,c.K)(async()=>{let{diagram:t}=await r.e(19).then(r.bind(r,"HN"));return{id:tM,diagram:t}},"loader"),tK={id:tM,detector:t$,loader:tE},tO="classDiagram",tD=(0,c.K)(t=>/^\s*classDiagram/.test(t),"detector"),tq=(0,c.K)(async()=>{let{diagram:t}=await r.e("cx").then(r.bind(r,"qw9"));return{id:tO,diagram:t}},"loader"),tI={id:tO,detector:tD,loader:tq},tP="stateDiagram",tW=(0,c.K)(t=>/^\s*stateDiagram/.test(t),"detector"),tz=(0,c.K)(async()=>{let{diagram:t}=await r.e("q5").then(r.bind(r,"QP"));return{id:tP,diagram:t}},"loader"),tR={id:tP,detector:tW,loader:tz},tj="journey",tN=(0,c.K)(t=>/^\s*journey/.test(t),"detector"),tH=(0,c.K)(async()=>{let{diagram:t}=await r.e("h3").then(r.bind(r,"jx3"));return{id:tj,diagram:t}},"loader"),tU={id:tj,detector:tN,loader:tH},tY={draw:(0,c.K)((t,e,r)=>{h.R.debug("rendering svg for syntax error\n");let o=(0,i.D)(e),a=o.append("g");o.attr("viewBox","0 0 2412 512"),(0,l.a$)(o,100,512,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw")},tX={db:{},renderer:tY,parser:{parse:(0,c.K)(()=>{},"parse")}},tG="flowchart-elk",tV=(0,c.K)((t,e={})=>!!/^\s*flowchart-elk/.test(t)&&(e.layout="elk",!0),"detector"),tZ=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("k"),r.e("h1")]).then(r.bind(r,"PZ"));return{id:tG,diagram:t}},"loader"),tQ={id:tG,detector:tV,loader:tZ},tJ="timeline",t0=(0,c.K)(t=>/^\s*timeline/.test(t),"detector"),t1=(0,c.K)(async()=>{let{diagram:t}=await r.e("ka").then(r.bind(r,"mC"));return{id:tJ,diagram:t}},"loader"),t2={id:tJ,detector:t0,loader:t1},t5="mindmap",t3=(0,c.K)(t=>/^\s*mindmap/.test(t),"detector"),t4=(0,c.K)(async()=>{let{diagram:t}=await r.e("x1").then(r.bind(r,"Px"));return{id:t5,diagram:t}},"loader"),t6={id:t5,detector:t3,loader:t4},t8="kanban",t7=(0,c.K)(t=>/^\s*kanban/.test(t),"detector"),t9=(0,c.K)(async()=>{let{diagram:t}=await r.e(66).then(r.bind(r,"Mu"));return{id:t8,diagram:t}},"loader"),et={id:t8,detector:t7,loader:t9},ee="sankey",er=(0,c.K)(t=>/^\s*sankey(-beta)?/.test(t),"detector"),ei=(0,c.K)(async()=>{let{diagram:t}=await r.e("v").then(r.bind(r,"dF"));return{id:ee,diagram:t}},"loader"),eo={id:ee,detector:er,loader:ei},ea="packet",es=(0,c.K)(t=>/^\s*packet(-beta)?/.test(t),"detector"),en=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("zi")]).then(r.bind(r,"Ji"));return{id:ea,diagram:t}},"loader"),el={id:ea,detector:es,loader:en},eh="radar",ec=(0,c.K)(t=>/^\s*radar-beta/.test(t),"detector"),ed=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("hs")]).then(r.bind(r,"XYb"));return{id:eh,diagram:t}},"loader"),eu={id:eh,detector:ec,loader:ed},eg="block",ep=(0,c.K)(t=>/^\s*block(-beta)?/.test(t),"detector"),ef=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l"),r.e("yg")]).then(r.bind(r,"AY"));return{id:eg,diagram:t}},"loader"),ey={id:eg,detector:ep,loader:ef},em="treeView",eC=(0,c.K)(t=>/^\s*treeView-beta/.test(t),"detector"),ex=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("h")]).then(r.bind(r,"fLH"));return{id:em,diagram:t}},"loader"),eb={id:em,detector:eC,loader:ex},ek="architecture",ew=(0,c.K)(t=>/^\s*architecture/.test(t),"detector"),eB=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("hp"),r.e(5)]).then(r.bind(r,"r5"));return{id:ek,diagram:t}},"loader"),eT={id:ek,detector:ew,loader:eB},eS="eventmodeling",ev=(0,c.K)(t=>/^\s*eventmodeling/.test(t),"detector"),e_=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("na")]).then(r.bind(r,"Jz"));return{id:eS,diagram:t}},"loader"),eF={id:eS,detector:ev,loader:e_},eL="ishikawa",eA=(0,c.K)(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),eM=(0,c.K)(async()=>{let{diagram:t}=await r.e("3r").then(r.bind(r,"Bf"));return{id:eL,diagram:t}},"loader"),e$={id:eL,detector:eA,loader:eM},eE="venn",eK=(0,c.K)(t=>/^\s*venn-beta/.test(t),"detector"),eO=(0,c.K)(async()=>{let{diagram:t}=await r.e("me").then(r.bind(r,"sV"));return{id:eE,diagram:t}},"loader"),eD={id:eE,detector:eK,loader:eO},eq="treemap",eI=(0,c.K)(t=>/^\s*treemap/.test(t),"detector"),eP=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("c0")]).then(r.bind(r,"m2"));return{id:eq,diagram:t}},"loader"),eW={id:eq,detector:eI,loader:eP},ez="usecase",eR=(0,c.K)(t=>/^\s*usecase-beta(?:\s|$)/.test(t),"detector"),ej=(0,c.K)(async()=>{let{diagram:t}=await r.e("tr").then(r.bind(r,"Hk"));return{id:ez,diagram:t}},"loader"),eN={id:ez,detector:eR,loader:ej},eH="wardley",eU=(0,c.K)(t=>/^\s*wardley-beta/i.test(t),"detector"),eY=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("jz")]).then(r.bind(r,"Zv"));return{id:eH,diagram:t}},"loader"),eX={id:eH,detector:eU,loader:eY},eG="cynefin",eV=(0,c.K)(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),eZ=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("5o")]).then(r.bind(r,"DG"));return{id:eG,diagram:t}},"loader"),eQ={id:eG,detector:eV,loader:eZ},eJ="railroad",e0=(0,c.K)(t=>/^\s*railroad-beta/i.test(t),"detector"),e1=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("jg"),r.e("hn")]).then(r.bind(r,"Ti"));return{id:eJ,diagram:t}},"loader"),e2={id:eJ,detector:e0,loader:e1},e5="railroadEbnf",e3=(0,c.K)(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),e4=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("jg"),r.e(73)]).then(r.bind(r,"tc"));return{id:e5,diagram:t}},"loader"),e6={id:e5,detector:e3,loader:e4},e8="railroadAbnf",e7=(0,c.K)(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),e9=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("jg"),r.e("t")]).then(r.bind(r,"Tef"));return{id:e8,diagram:t}},"loader"),rt={id:e8,detector:e7,loader:e9},re="railroadPeg",rr=(0,c.K)(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),ri=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("jg"),r.e("nk")]).then(r.bind(r,"d7"));return{id:re,diagram:t}},"loader"),ro={id:re,detector:rr,loader:ri},ra=!1,rs=(0,c.K)(()=>{ra||(ra=!0,(0,l.Js)("error",tX,t=>"error"===t.toLowerCase().trim()),(0,l.Js)("---",{db:{clear:(0,c.K)(()=>{},"clear")},styles:{},renderer:{draw:(0,c.K)(()=>{},"draw")},parser:{parse:(0,c.K)(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:(0,c.K)(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),(0,l.Xd)(tQ,t6,eT),(0,l.Xd)(tt,U,et,tI,ta,tg,tm,tC,tA,tK,to,V,t2,th,tR,tU,tw,eo,el,tv,ey,eF,eb,eu,e$,eW,e2,e6,rt,ro,eD,eX,eQ,eN))},"addDiagrams"),rn=(0,c.K)(async()=>{h.R.debug("Loading registered diagrams");let t=(await Promise.allSettled(Object.entries(l.mW).map(async([t,{detector:e,loader:r}])=>{if(r)try{(0,l.Gs)(t)}catch{try{let{diagram:t,id:i}=await r();(0,l.Js)(i,t,e)}catch(e){throw h.R.error(`Failed to load external diagram with key ${t}. Removing from detectors.`),delete l.mW[t],e}}}))).filter(t=>"rejected"===t.status);if(t.length>0){for(let e of(h.R.error(`Failed to load ${t.length} external diagrams`),t))h.R.error(e);throw Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams");function rl(t,e){t.attr("role","graphics-document document"),""!==e&&t.attr("aria-roledescription",e)}function rh(t,e,r,i){if(void 0!==t.insert){if(r){let e=`chart-desc-${i}`;t.attr("aria-describedby",e),t.insert("desc",":first-child").attr("id",e).text(r)}if(e){let r=`chart-title-${i}`;t.attr("aria-labelledby",r),t.insert("title",":first-child").attr("id",r).text(e)}}}(0,c.K)(rl,"setA11yDiagramInfo"),(0,c.K)(rh,"addSVGa11yTitleDescription");var rc=class t{constructor(t,e,r,i,o){this.type=t,this.text=e,this.db=r,this.parser=i,this.renderer=o}static{(0,c.K)(this,"Diagram")}static async fromText(e,r={}){let i="string"==typeof e?{raw:e,cleaned:e}:e,o=(0,l.zj)(),a=(0,l.Ch)(i.cleaned,o);try{(0,l.Gs)(a)}catch{let t=(0,l.J$)(a);if(!t)throw new l.C0(`Diagram ${a} not found.`);let{id:e,diagram:r}=await t();(0,l.Js)(e,r)}let{db:s,parser:c,renderer:d,init:u}=(0,l.Gs)(a);c.parser&&(c.parser.yy=s),s.clear?.(),u?.(o),r.title&&s.setDiagramTitle?.(r.title);let g=i.cleaned;if(s.preserveCommentsWhenParsing&&i.withComments){let t=o.maxTextSize??l.UI.maxTextSize;i.withComments.length>t?h.R.warn(`Comment-preserving source exceeds maxTextSize (${i.withComments.length} > ${t}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):g=i.withComments}let p=(0,n.C4)(g)+"\n";return i.frontmatterLineOffset&&s.setFrontmatterLineOffset?.(i.frontmatterLineOffset),await c.parse(p),new t(a,p,s,c,d)}async render(t,e){await this.renderer.draw(this.text,t,e,this)}getParser(){return this.parser}getType(){return this.type}},rd=[],ru=(0,c.K)(()=>{rd.forEach(t=>{t()}),rd=[]},"attachFunctions"),rg=(0,c.K)(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function rp(t){let e=t.match(l.EJ);if(!e)return{text:t,metadata:{}};let r=e[1],i=r?e[2].split("\n").map(t=>t.startsWith(r)?t.slice(r.length):t).join("\n"):e[2],a=(0,o.H)(i,{schema:o.r})??{};a="object"!=typeof a||Array.isArray(a)?{}:a;let s={};return a.displayMode&&(s.displayMode=a.displayMode.toString()),a.title&&(s.title=a.title.toString()),a.config&&(s.config=a.config),{text:t.slice(e[0].length),metadata:s}}(0,c.K)(rp,"extractFrontMatter");var rf=(0,c.K)(t=>t.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,(t,e,r)=>"<"+e+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),ry=(0,c.K)(t=>{let{text:e,metadata:r}=rp(t),{displayMode:i,title:o,config:a={}}=r;return i&&(a.gantt||(a.gantt={}),a.gantt.displayMode=i),{title:o,config:a,text:e}},"processFrontmatter"),rm=(0,c.K)(t=>{let e=n._K.detectInit(t)??{},r=n._K.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:t})=>"wrap"===t):r?.type==="wrap"&&(e.wrap=!0),{text:(0,n.vU)(t),directive:e}},"processDirectives");function rC(t){let e=rf(t),r=ry(e),i=rm(r.text),o=(0,n.$t)(r.config,i.directive),a=i.text;return{code:{raw:t,cleaned:rg(a),withComments:a,frontmatterLineOffset:e.length>r.text.length?(e.substring(0,e.length-r.text.length).match(/\n/g)??[]).length:0},title:r.title,config:o}}function rx(t){return btoa(Array.from(new TextEncoder().encode(t),t=>String.fromCodePoint(t)).join(""))}(0,c.K)(rC,"preprocessDiagram"),(0,c.K)(rx,"toBase64");var rb=["foreignobject"],rk=["dominant-baseline"];function rw(t){let e,r=rC(t);(0,l.cL)();try{e=(0,l.Ch)(r.code.cleaned,(0,l.zj)())}catch{e=void 0}return(0,l.yj)(e),(0,l.xA)(r.config??{}),r}async function rB(t,e){rs();try{let{code:e,config:r}=rw(t);return{diagramType:(await rc.fromText(e)).type,config:r}}catch(t){if(e?.suppressErrors)return!1;throw t}finally{(0,l.yj)(void 0)}}(0,c.K)(rw,"processAndSetConfigs"),(0,c.K)(rB,"parse");var rT=(0,c.K)((t,e,r=[])=>{let i=(0,l.Df)(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${i}`},"cssImportantStyles"),rS=(0,c.K)((t,e=new Map)=>{let r=new CSSStyleSheet;if(void 0!==t.fontFamily&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),void 0!==t.altFontFamily&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){let i=(0,l.E)(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(t=>{H(t.styles)||i.forEach(e=>{r.insertRule(rT(t.id,e,t.styles),r.cssRules.length)}),H(t.textStyles)||r.insertRule(rT(t.id,"tspan",(t?.textStyles||[]).map(t=>t.replace("color","fill"))),r.cssRules.length)})}let i="";if(void 0!==t.themeCSS)if("function"==typeof r.replaceSync){let e=new CSSStyleSheet;e.replaceSync(t.themeCSS),i=(0,l.KG)(e)+"\n"}else i+=`${t.themeCSS}
|
|
195
|
+
`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),a.R.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);let s=[];for(;null!==(r=o.DB.exec(t));)if(r.index===o.DB.lastIndex&&o.DB.lastIndex++,r&&!e||e&&r[1]?.match(e)||e&&r[2]?.match(e)){let t=r[1]?r[1]:r[2],e=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;s.push({type:t,args:e})}if(0===s.length)return{type:t,args:null};return 1===s.length?s[0]:s}catch(r){return a.R.error(`ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),A=(0,s.K)(function(t){return t.replace(o.DB,"")},"removeDirectives"),M=(0,s.K)(function(t,e){for(let[r,i]of e.entries())if(i.match(t))return r;return -1},"isSubstringInArray");function $(t,e){return t?v[`curve${t.charAt(0).toUpperCase()+t.slice(1)}`]??e:e}function E(t,e){let r=t.trim();if(r)return"loose"!==e.securityLevel?(0,n.J)(r):r}(0,s.K)($,"interpolateToCurve"),(0,s.K)(E,"formatUrl");var K=(0,s.K)((t,...e)=>{let r=t.split("."),i=r.length-1,o=r[i],s=window;for(let e=0;e<i;e++)if(!(s=s[r[e]]))return void a.R.error(`Function name: ${t} not found in window`);s[o](...e)},"runFunc");function O(t,e){return t&&e?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):0}function D(t){let e,r=0;return t.forEach(t=>{r+=O(t,e),e=t}),P(t,r/2)}function q(t){return 1===t.length?t[0]:D(t)}(0,s.K)(O,"distance"),(0,s.K)(D,"traverseEdge"),(0,s.K)(q,"calcLabelPosition");var I=(0,s.K)((t,e=2)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),P=(0,s.K)((t,e)=>{let r,i=e;for(let e of t){if(r){let t=O(e,r);if(0===t)return r;if(t<i)i-=t;else{let o=i/t;if(o<=0)return r;if(o>=1)return{x:e.x,y:e.y};if(o>0&&o<1)return{x:I((1-o)*r.x+o*e.x,5),y:I((1-o)*r.y+o*e.y,5)}}}r=e}throw Error("Could not find a suitable point for the given distance")},"calculatePoint"),W=(0,s.K)((t,e,r)=>{a.R.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());let i=P(e,25),o=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),n={x:0,y:0};return n.x=Math.sin(s)*o+(e[0].x+i.x)/2,n.y=-Math.cos(s)*o+(e[0].y+i.y)/2,n},"calcCardinalityPosition");function z(t,e,r){let i=structuredClone(r);a.R.info("our points",i),"start_left"!==e&&"start_right"!==e&&i.reverse();let o=P(i,25+t),s=10+.5*t,n=Math.atan2(i[0].y-o.y,i[0].x-o.x),l={x:0,y:0};return"start_left"===e?(l.x=Math.sin(n+Math.PI)*s+(i[0].x+o.x)/2,l.y=-Math.cos(n+Math.PI)*s+(i[0].y+o.y)/2):"end_right"===e?(l.x=Math.sin(n-Math.PI)*s+(i[0].x+o.x)/2-5,l.y=-Math.cos(n-Math.PI)*s+(i[0].y+o.y)/2-5):"end_left"===e?(l.x=Math.sin(n)*s+(i[0].x+o.x)/2-5,l.y=-Math.cos(n)*s+(i[0].y+o.y)/2-5):(l.x=Math.sin(n)*s+(i[0].x+o.x)/2,l.y=-Math.cos(n)*s+(i[0].y+o.y)/2),l}function R(t){let e="",r="";for(let i of t)void 0!==i&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":e=e+i+";");return{style:e,labelStyle:r}}(0,s.K)(z,"calcTerminalLabelPosition"),(0,s.K)(R,"getStylesFromArray");var j=0,N=(0,s.K)(()=>(j++,"id-"+Math.random().toString(36).substr(2,12)+"-"+j),"generateId");function H(t){let e="",r="0123456789abcdef",i=r.length;for(let o=0;o<t;o++)e+=r.charAt(Math.floor(Math.random()*i));return e}(0,s.K)(H,"makeRandomHex");var U=(0,s.K)(t=>H(t.length),"random"),Y=(0,s.K)(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),X=(0,s.K)(function(t,e){let r=e.text.replace(o.Y2.lineBreakRegex," "),[,i]=to(e.fontSize),a=t.append("text");a.attr("x",e.x),a.attr("y",e.y),a.style("text-anchor",e.anchor),a.style("font-family",e.fontFamily),a.style("font-size",i),a.style("font-weight",e.fontWeight),a.attr("fill",e.fill),void 0!==e.class&&a.attr("class",e.class);let s=a.append("tspan");return s.attr("x",e.x+2*e.textMargin),s.attr("fill",e.fill),s.text(r),a},"drawSimpleText"),G=h((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),o.Y2.hasBreaks(t)))return t;let i=t.split(" ").filter(Boolean),a=[],s="";return i.forEach((t,o)=>{let n=Q(`${t} `,r),l=Q(s,r);if(n>e){let{hyphenatedStrings:i,remainingWord:o}=V(t,e,"-",r);a.push(s,...i),s=o}else l+n>=e?(a.push(s),s=t):s=[s,t].filter(Boolean).join(" ");o+1===i.length&&a.push(s)}),a.filter(t=>""!==t).join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),V=h((t,e,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);let o=[...t],a=[],s="";return o.forEach((t,n)=>{let l=`${s}${t}`;if(Q(l,i)>=e){let t=o.length===n+1,e=`${l}${r}`;a.push(t?l:e),s=""}else s=l}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",i)=>`${t}${e}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Z(t,e){return J(t,e).height}function Q(t,e){return J(t,e).width}(0,s.K)(Z,"calculateTextHeight"),(0,s.K)(Q,"calculateTextWidth");var J=h((t,e)=>{let{fontSize:r=12,fontFamily:i="Arial",fontWeight:a=400}=e;if(!t)return{width:0,height:0};let[,s]=to(r),n=t.split(o.Y2.lineBreakRegex),h=[],c=(0,l.Ltv)("body");if(!c.remove)return{width:0,height:0,lineHeight:0};let d=c.append("svg");for(let t of["sans-serif",i]){let e=0,r={width:0,height:0,lineHeight:0};for(let i of n){let o=Y();o.text=i||S;let n=X(d,o).style("font-size",s).style("font-weight",a).style("font-family",t),l=(n._groups||n)[0][0].getBBox();if(0===l.width&&0===l.height)throw Error("svg element not in render tree");r.width=Math.round(Math.max(r.width,l.width)),e=Math.round(l.height),r.height+=e,r.lineHeight=Math.round(Math.max(r.lineHeight,e))}h.push(r)}d.remove();let u=isNaN(h[1].height)||isNaN(h[1].width)||isNaN(h[1].lineHeight)||h[0].height>h[1].height&&h[0].width>h[1].width&&h[0].lineHeight>h[1].lineHeight?0:1;return h[u]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),tt=class{constructor(t=!1,e){this.count=0,this.count=e?e.length:0,this.next=t?()=>this.count++:()=>Date.now()}static{(0,s.K)(this,"InitIDGenerator")}},te=(0,s.K)(function(t){return i=i||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),i.innerHTML=t,unescape(i.textContent)},"entityDecode");function tr(t){return"str"in t}(0,s.K)(tr,"isDetailedError");var ti=(0,s.K)((t,e,r,i)=>{if(!i)return;let o=t.node()?.getBBox();o&&t.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",e)},"insertTitle"),to=(0,s.K)(t=>{if("number"==typeof t)return[t,t+"px"];let e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ta(t,e){return function(t,...e){return function(t,...e){let r=e.slice(0,-1),i=e[e.length-1],o=t;for(let t=0;t<r.length;t++)o=function t(e,r,i,o){if((0,d.s)(e)&&(e=Object(e)),null==r||"object"!=typeof r)return e;if(o.has(r))return function(t){if((0,d.s)(t))return t;if(Array.isArray(t)||(0,u.i)(t)||t instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer)return t.slice(0);let e=Object.getPrototypeOf(t);if(null==e)return Object.assign(Object.create(e),t);let r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){let e=new r(t);return e.lastIndex=t.lastIndex,e}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let e;return(e=t instanceof AggregateError?new r(t.errors,t.message,{cause:t.cause}):new r(t.message,{cause:t.cause})).stack=t.stack,Object.assign(e,t),e}return"u">typeof File&&t instanceof File?new r([t],t.name,{type:t.type,lastModified:t.lastModified}):"object"==typeof t?Object.assign(Object.create(e),t):t}(o.get(r));if(o.set(r,e),Array.isArray(r)){r=r.slice();for(let t=0;t<r.length;t++)t in r||(r[t]=void 0)}let a=[...Object.keys(r),...g(r)];for(let n=0;n<a.length;n++){let l=a[n];if("__proto__"===l)continue;let h=r[l],c=e[l];if((0,k.N)(h)&&(h={...h}),(0,k.N)(c)&&(c={...c}),(0,p.P)(h)&&(h=b(h)),Array.isArray(h))if(Array.isArray(c)){let t=[],e=Reflect.ownKeys(c);for(let r=0;r<e.length;r++){let i=e[r];t[i]=c[i]}c=t}else{var s;if(w(s=c)&&(0,B.X)(s)){let t=[];for(let e=0;e<c.length;e++)t[e]=c[e];c=t}else c=[]}let d=i(c,h,l,e,r,o);void 0!==d?e[l]=d:Array.isArray(h)||w(c)&&w(h)&&(f(c)||f(h)||(0,T.i)(c)||(0,T.i)(h))?e[l]=t(c,h,i,o):null==c&&f(h)?e[l]=t({},h,i,o):null==c&&(0,T.i)(h)?e[l]=b(h):(void 0===c||void 0!==h)&&(e[l]=h)}return e}(o,r[t],i,new Map);return o}(t,...e,c)}({},t,e)}(0,s.K)(ta,"cleanAndMerge");var ts={assignWithDepth:o.hH,wrapLabel:G,calculateTextHeight:Z,calculateTextWidth:Q,calculateTextDimensions:J,cleanAndMerge:ta,detectInit:F,detectDirective:L,isSubstringInArray:M,interpolateToCurve:$,calcLabelPosition:q,calcCardinalityPosition:W,calcTerminalLabelPosition:z,formatUrl:E,getStylesFromArray:R,generateId:N,random:U,runFunc:K,entityDecode:te,insertTitle:ti,isLabelCoordinateInPath:td,parseFontSize:to,InitIDGenerator:tt},tn=(0,s.K)(function(t){let e=t;return(e=(e=e.replace(/style.*:\S*#.*;/g,function(t){return t.substring(0,t.length-1)})).replace(/classDef.*:\S*#.*;/g,function(t){return t.substring(0,t.length-1)})).replace(/#\w+;/g,function(t){let e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"})},"encodeEntities"),tl=(0,s.K)(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),th=(0,s.K)((t,e,{counter:r=0,prefix:i,suffix:o},a)=>a||`${i?`${i}_`:""}${t}_${e}_${r}${o?`_${o}`:""}`,"getEdgeId");function tc(t){return t??null}function td(t,e){let r=Math.round(t.x),i=Math.round(t.y),o=e.replace(/(\d+\.\d+)/g,t=>Math.round(parseFloat(t)).toString());return o.includes(r.toString())||o.includes(i.toString())}(0,s.K)(tc,"handleUndefinedAttr"),(0,s.K)(td,"isLabelCoordinateInPath")},Fl(t,e,r){"use strict";r.d(e,{default:()=>r0});var i=r("MM"),o=r("Wf"),a=r("mW");r("Q"),r("ix"),r("LC"),r("bQ"),r("Ut"),r("PF"),r("iV");var s=r("h5");r("pK");var n=r("NH"),l=r("Yr"),h=r("M4"),c=r("Gt"),d=r("pk"),u=r("El"),g="comm",p="rule",f="decl",y="@keyframes",m="@layer",C=Math.abs,x=String.fromCharCode;function b(t,e,r){return t.replace(e,r)}function k(t,e){return 0|t.charCodeAt(e)}function w(t,e,r){return t.slice(e,r)}function B(t){return t.length}function T(t,e){return e.push(t),t}function S(t,e){for(var r="",i=0;i<t.length;i++)r+=e(t[i],i,t,e)||"";return r}function v(t,e,r,i){switch(t.type){case m:if(t.children.length)break;case"@import":case"@namespace":case f:return t.return=t.return||t.value;case g:return"";case y:return t.return=t.value+"{"+S(t.children,i)+"}";case p:if(!B(t.value=t.props.join(",")))return""}return B(r=S(t.children,i))?t.return=t.value+"{"+r+"}":""}var _=1,F=1,L=0,A=0,M=0,$="";function E(t,e,r,i,o,a,s,n){return{value:t,root:e,parent:r,type:i,props:o,children:a,line:_,column:F,length:s,return:"",siblings:n}}function K(){return M=A<L?k($,A++):0,F++,10===M&&(F=1,_++),M}function O(){return k($,A)}function D(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function q(t){var e,r;return(e=A-1,r=function t(e){for(;K();)switch(M){case e:return A;case 34:case 39:34!==e&&39!==e&&t(M);break;case 40:41===e&&t(e);break;case 92:K()}return A}(91===t?t+2:40===t?t+1:t),w($,e,r)).trim()}function I(t,e,r,i,o,a,s,n,l,h,c,d){for(var u=o-1,g=0===o?a:[""],f=g.length,y=0,m=0,x=0;y<i;++y)for(var k=0,B=w(t,u+1,u=C(m=s[y])),T=t;k<f;++k)(T=(m>0?g[k]+" "+B:b(B,/&\f/g,g[k])).trim())&&(l[x++]=T);return E(t,e,r,0===o?p:n,l,h,c,d)}function P(t,e,r,i,o){return E(t,e,r,f,w(t,0,i),w(t,i+1,-1),i,o)}var W=r("L"),z=r("NM"),R=r("tNQ"),j=r("rY0"),N=r("SPK");function H(t){if(null==t)return!0;if((0,R.X)(t))return("function"==typeof t.splice||"string"==typeof t||!!(0,z.P)(t)||!!(0,N.i)(t)||!!(0,j.N)(t))&&0===t.length;if("object"==typeof t||"function"==typeof t){let e;if(t instanceof Map||t instanceof Set)return 0===t.size;let r=Object.keys(t);return(e=t?.constructor,t===("function"==typeof e?e.prototype:Object.prototype))?0===r.filter(t=>"constructor"!==t).length:0===r.length}return!0}var U={id:"c4",detector:(0,c.K)(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),loader:(0,c.K)(async()=>{let{diagram:t}=await r.e("up").then(r.bind(r,"Yq"));return{id:"c4",diagram:t}},"loader")},Y="flowchart-v2",X=(0,c.K)(t=>/^\s*(graph|flowchart)/.test(t),"detector"),G=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("k"),r.e("h1")]).then(r.bind(r,"PZ"));return{id:Y,diagram:t}},"loader"),V={id:Y,detector:X,loader:G},Z="agentflow",Q=(0,c.K)(t=>/^\s*agentflow-beta\b/.test(t),"detector"),J=(0,c.K)(async()=>{let{diagram:t}=await r.e("og").then(r.bind(r,"WU"));return{id:Z,diagram:t}},"loader"),tt={id:Z,detector:Q,loader:J},te="swimlane",tr=(0,c.K)(t=>/^\s*swimlane-beta\b/.test(t),"detector"),ti=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("k"),r.e("oc")]).then(r.bind(r,"WK"));return{id:te,diagram:t}},"loader"),to={id:te,detector:tr,loader:ti},ta={id:"er",detector:(0,c.K)(t=>/^\s*erDiagram/.test(t),"detector"),loader:(0,c.K)(async()=>{let{diagram:t}=await r.e("sy").then(r.bind(r,"aT"));return{id:"er",diagram:t}},"loader")},ts="gitGraph",tn=(0,c.K)(t=>/^\s*gitGraph/.test(t),"detector"),tl=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("ls")]).then(r.bind(r,"Xd"));return{id:ts,diagram:t}},"loader"),th={id:ts,detector:tn,loader:tl},tc="gantt",td=(0,c.K)(t=>/^\s*gantt/.test(t),"detector"),tu=(0,c.K)(async()=>{let{diagram:t}=await r.e("5j").then(r.bind(r,"TT"));return{id:tc,diagram:t}},"loader"),tg={id:tc,detector:td,loader:tu},tp="info",tf=(0,c.K)(t=>/^\s*info/.test(t),"detector"),ty=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("5bh")]).then(r.bind(r,"fL"));return{id:tp,diagram:t}},"loader"),tm={id:tp,detector:tf,loader:ty},tC={id:"pie",detector:(0,c.K)(t=>/^\s*pie/.test(t),"detector"),loader:(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("ys")]).then(r.bind(r,"Qe"));return{id:"pie",diagram:t}},"loader")},tx="quadrantChart",tb=(0,c.K)(t=>/^\s*quadrantChart/.test(t),"detector"),tk=(0,c.K)(async()=>{let{diagram:t}=await r.e("id").then(r.bind(r,"gO"));return{id:tx,diagram:t}},"loader"),tw={id:tx,detector:tb,loader:tk},tB="xychart",tT=(0,c.K)(t=>/^\s*xychart(-beta)?/.test(t),"detector"),tS=(0,c.K)(async()=>{let{diagram:t}=await r.e("6o").then(r.bind(r,"QT"));return{id:tB,diagram:t}},"loader"),tv={id:tB,detector:tT,loader:tS},t_="requirement",tF=(0,c.K)(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),tL=(0,c.K)(async()=>{let{diagram:t}=await r.e("e").then(r.bind(r,"cw"));return{id:t_,diagram:t}},"loader"),tA={id:t_,detector:tF,loader:tL},tM="sequence",t$=(0,c.K)(t=>/^\s*sequenceDiagram/.test(t),"detector"),tE=(0,c.K)(async()=>{let{diagram:t}=await r.e(19).then(r.bind(r,"HN"));return{id:tM,diagram:t}},"loader"),tK={id:tM,detector:t$,loader:tE},tO="classDiagram",tD=(0,c.K)(t=>/^\s*classDiagram/.test(t),"detector"),tq=(0,c.K)(async()=>{let{diagram:t}=await r.e("cx").then(r.bind(r,"qw9"));return{id:tO,diagram:t}},"loader"),tI={id:tO,detector:tD,loader:tq},tP="stateDiagram",tW=(0,c.K)(t=>/^\s*stateDiagram/.test(t),"detector"),tz=(0,c.K)(async()=>{let{diagram:t}=await r.e("q5").then(r.bind(r,"QP"));return{id:tP,diagram:t}},"loader"),tR={id:tP,detector:tW,loader:tz},tj="journey",tN=(0,c.K)(t=>/^\s*journey/.test(t),"detector"),tH=(0,c.K)(async()=>{let{diagram:t}=await r.e("h3").then(r.bind(r,"jx3"));return{id:tj,diagram:t}},"loader"),tU={id:tj,detector:tN,loader:tH},tY={draw:(0,c.K)((t,e,r)=>{h.R.debug("rendering svg for syntax error\n");let o=(0,i.D)(e),a=o.append("g");o.attr("viewBox","0 0 2412 512"),(0,l.a$)(o,100,512,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw")},tX={db:{},renderer:tY,parser:{parse:(0,c.K)(()=>{},"parse")}},tG="flowchart-elk",tV=(0,c.K)((t,e={})=>!!/^\s*flowchart-elk/.test(t)&&(e.layout="elk",!0),"detector"),tZ=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("k"),r.e("h1")]).then(r.bind(r,"PZ"));return{id:tG,diagram:t}},"loader"),tQ={id:tG,detector:tV,loader:tZ},tJ="timeline",t0=(0,c.K)(t=>/^\s*timeline/.test(t),"detector"),t1=(0,c.K)(async()=>{let{diagram:t}=await r.e("ka").then(r.bind(r,"mC"));return{id:tJ,diagram:t}},"loader"),t2={id:tJ,detector:t0,loader:t1},t5="mindmap",t3=(0,c.K)(t=>/^\s*mindmap/.test(t),"detector"),t4=(0,c.K)(async()=>{let{diagram:t}=await r.e("x1").then(r.bind(r,"Px"));return{id:t5,diagram:t}},"loader"),t6={id:t5,detector:t3,loader:t4},t8="kanban",t7=(0,c.K)(t=>/^\s*kanban/.test(t),"detector"),t9=(0,c.K)(async()=>{let{diagram:t}=await r.e(66).then(r.bind(r,"Mu"));return{id:t8,diagram:t}},"loader"),et={id:t8,detector:t7,loader:t9},ee="sankey",er=(0,c.K)(t=>/^\s*sankey(-beta)?/.test(t),"detector"),ei=(0,c.K)(async()=>{let{diagram:t}=await r.e("v").then(r.bind(r,"dF"));return{id:ee,diagram:t}},"loader"),eo={id:ee,detector:er,loader:ei},ea="packet",es=(0,c.K)(t=>/^\s*packet(-beta)?/.test(t),"detector"),en=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("zi")]).then(r.bind(r,"Ji"));return{id:ea,diagram:t}},"loader"),el={id:ea,detector:es,loader:en},eh="radar",ec=(0,c.K)(t=>/^\s*radar-beta/.test(t),"detector"),ed=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("hs")]).then(r.bind(r,"XYb"));return{id:eh,diagram:t}},"loader"),eu={id:eh,detector:ec,loader:ed},eg="block",ep=(0,c.K)(t=>/^\s*block(-beta)?/.test(t),"detector"),ef=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l"),r.e("yg")]).then(r.bind(r,"AY"));return{id:eg,diagram:t}},"loader"),ey={id:eg,detector:ep,loader:ef},em="treeView",eC=(0,c.K)(t=>/^\s*treeView-beta/.test(t),"detector"),ex=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("h")]).then(r.bind(r,"fLH"));return{id:em,diagram:t}},"loader"),eb={id:em,detector:eC,loader:ex},ek="architecture",ew=(0,c.K)(t=>/^\s*architecture/.test(t),"detector"),eB=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("hp"),r.e(5)]).then(r.bind(r,"r5"));return{id:ek,diagram:t}},"loader"),eT={id:ek,detector:ew,loader:eB},eS="eventmodeling",ev=(0,c.K)(t=>/^\s*eventmodeling/.test(t),"detector"),e_=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("na")]).then(r.bind(r,"Jz"));return{id:eS,diagram:t}},"loader"),eF={id:eS,detector:ev,loader:e_},eL="ishikawa",eA=(0,c.K)(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),eM=(0,c.K)(async()=>{let{diagram:t}=await r.e("3r").then(r.bind(r,"Bf"));return{id:eL,diagram:t}},"loader"),e$={id:eL,detector:eA,loader:eM},eE="venn",eK=(0,c.K)(t=>/^\s*venn-beta/.test(t),"detector"),eO=(0,c.K)(async()=>{let{diagram:t}=await r.e("me").then(r.bind(r,"sV"));return{id:eE,diagram:t}},"loader"),eD={id:eE,detector:eK,loader:eO},eq="treemap",eI=(0,c.K)(t=>/^\s*treemap/.test(t),"detector"),eP=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("c0")]).then(r.bind(r,"m2"));return{id:eq,diagram:t}},"loader"),eW={id:eq,detector:eI,loader:eP},ez="usecase",eR=(0,c.K)(t=>/^\s*usecase-beta(?:\s|$)/.test(t),"detector"),ej=(0,c.K)(async()=>{let{diagram:t}=await r.e("tr").then(r.bind(r,"Hk"));return{id:ez,diagram:t}},"loader"),eN={id:ez,detector:eR,loader:ej},eH="wardley",eU=(0,c.K)(t=>/^\s*wardley-beta/i.test(t),"detector"),eY=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("jz")]).then(r.bind(r,"Zv"));return{id:eH,diagram:t}},"loader"),eX={id:eH,detector:eU,loader:eY},eG="cynefin",eV=(0,c.K)(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),eZ=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("5o")]).then(r.bind(r,"DG"));return{id:eG,diagram:t}},"loader"),eQ={id:eG,detector:eV,loader:eZ},eJ="railroad",e0=(0,c.K)(t=>/^\s*railroad-beta/i.test(t),"detector"),e1=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("jg"),r.e("hn")]).then(r.bind(r,"Ti"));return{id:eJ,diagram:t}},"loader"),e2={id:eJ,detector:e0,loader:e1},e5="railroadEbnf",e3=(0,c.K)(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),e4=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("jg"),r.e(73)]).then(r.bind(r,"tc"));return{id:e5,diagram:t}},"loader"),e6={id:e5,detector:e3,loader:e4},e8="railroadAbnf",e7=(0,c.K)(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),e9=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("jg"),r.e("t")]).then(r.bind(r,"Te"));return{id:e8,diagram:t}},"loader"),rt={id:e8,detector:e7,loader:e9},re="railroadPeg",rr=(0,c.K)(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),ri=(0,c.K)(async()=>{let{diagram:t}=await Promise.all([r.e("l9"),r.e("jg"),r.e("nk")]).then(r.bind(r,"d7"));return{id:re,diagram:t}},"loader"),ro={id:re,detector:rr,loader:ri},ra=!1,rs=(0,c.K)(()=>{ra||(ra=!0,(0,l.Js)("error",tX,t=>"error"===t.toLowerCase().trim()),(0,l.Js)("---",{db:{clear:(0,c.K)(()=>{},"clear")},styles:{},renderer:{draw:(0,c.K)(()=>{},"draw")},parser:{parse:(0,c.K)(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:(0,c.K)(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),(0,l.Xd)(tQ,t6,eT),(0,l.Xd)(tt,U,et,tI,ta,tg,tm,tC,tA,tK,to,V,t2,th,tR,tU,tw,eo,el,tv,ey,eF,eb,eu,e$,eW,e2,e6,rt,ro,eD,eX,eQ,eN))},"addDiagrams"),rn=(0,c.K)(async()=>{h.R.debug("Loading registered diagrams");let t=(await Promise.allSettled(Object.entries(l.mW).map(async([t,{detector:e,loader:r}])=>{if(r)try{(0,l.Gs)(t)}catch{try{let{diagram:t,id:i}=await r();(0,l.Js)(i,t,e)}catch(e){throw h.R.error(`Failed to load external diagram with key ${t}. Removing from detectors.`),delete l.mW[t],e}}}))).filter(t=>"rejected"===t.status);if(t.length>0){for(let e of(h.R.error(`Failed to load ${t.length} external diagrams`),t))h.R.error(e);throw Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams");function rl(t,e){t.attr("role","graphics-document document"),""!==e&&t.attr("aria-roledescription",e)}function rh(t,e,r,i){if(void 0!==t.insert){if(r){let e=`chart-desc-${i}`;t.attr("aria-describedby",e),t.insert("desc",":first-child").attr("id",e).text(r)}if(e){let r=`chart-title-${i}`;t.attr("aria-labelledby",r),t.insert("title",":first-child").attr("id",r).text(e)}}}(0,c.K)(rl,"setA11yDiagramInfo"),(0,c.K)(rh,"addSVGa11yTitleDescription");var rc=class t{constructor(t,e,r,i,o){this.type=t,this.text=e,this.db=r,this.parser=i,this.renderer=o}static{(0,c.K)(this,"Diagram")}static async fromText(e,r={}){let i="string"==typeof e?{raw:e,cleaned:e}:e,o=(0,l.zj)(),a=(0,l.Ch)(i.cleaned,o);try{(0,l.Gs)(a)}catch{let t=(0,l.J$)(a);if(!t)throw new l.C0(`Diagram ${a} not found.`);let{id:e,diagram:r}=await t();(0,l.Js)(e,r)}let{db:s,parser:c,renderer:d,init:u}=(0,l.Gs)(a);c.parser&&(c.parser.yy=s),s.clear?.(),u?.(o),r.title&&s.setDiagramTitle?.(r.title);let g=i.cleaned;if(s.preserveCommentsWhenParsing&&i.withComments){let t=o.maxTextSize??l.UI.maxTextSize;i.withComments.length>t?h.R.warn(`Comment-preserving source exceeds maxTextSize (${i.withComments.length} > ${t}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):g=i.withComments}let p=(0,n.C4)(g)+"\n";return i.frontmatterLineOffset&&s.setFrontmatterLineOffset?.(i.frontmatterLineOffset),await c.parse(p),new t(a,p,s,c,d)}async render(t,e){await this.renderer.draw(this.text,t,e,this)}getParser(){return this.parser}getType(){return this.type}},rd=[],ru=(0,c.K)(()=>{rd.forEach(t=>{t()}),rd=[]},"attachFunctions"),rg=(0,c.K)(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function rp(t){let e=t.match(l.EJ);if(!e)return{text:t,metadata:{}};let r=e[1],i=r?e[2].split("\n").map(t=>t.startsWith(r)?t.slice(r.length):t).join("\n"):e[2],a=(0,o.H)(i,{schema:o.r})??{};a="object"!=typeof a||Array.isArray(a)?{}:a;let s={};return a.displayMode&&(s.displayMode=a.displayMode.toString()),a.title&&(s.title=a.title.toString()),a.config&&(s.config=a.config),{text:t.slice(e[0].length),metadata:s}}(0,c.K)(rp,"extractFrontMatter");var rf=(0,c.K)(t=>t.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,(t,e,r)=>"<"+e+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),ry=(0,c.K)(t=>{let{text:e,metadata:r}=rp(t),{displayMode:i,title:o,config:a={}}=r;return i&&(a.gantt||(a.gantt={}),a.gantt.displayMode=i),{title:o,config:a,text:e}},"processFrontmatter"),rm=(0,c.K)(t=>{let e=n._K.detectInit(t)??{},r=n._K.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:t})=>"wrap"===t):r?.type==="wrap"&&(e.wrap=!0),{text:(0,n.vU)(t),directive:e}},"processDirectives");function rC(t){let e=rf(t),r=ry(e),i=rm(r.text),o=(0,n.$t)(r.config,i.directive),a=i.text;return{code:{raw:t,cleaned:rg(a),withComments:a,frontmatterLineOffset:e.length>r.text.length?(e.substring(0,e.length-r.text.length).match(/\n/g)??[]).length:0},title:r.title,config:o}}function rx(t){return btoa(Array.from(new TextEncoder().encode(t),t=>String.fromCodePoint(t)).join(""))}(0,c.K)(rC,"preprocessDiagram"),(0,c.K)(rx,"toBase64");var rb=["foreignobject"],rk=["dominant-baseline"];function rw(t){let e,r=rC(t);(0,l.cL)();try{e=(0,l.Ch)(r.code.cleaned,(0,l.zj)())}catch{e=void 0}return(0,l.yj)(e),(0,l.xA)(r.config??{}),r}async function rB(t,e){rs();try{let{code:e,config:r}=rw(t);return{diagramType:(await rc.fromText(e)).type,config:r}}catch(t){if(e?.suppressErrors)return!1;throw t}finally{(0,l.yj)(void 0)}}(0,c.K)(rw,"processAndSetConfigs"),(0,c.K)(rB,"parse");var rT=(0,c.K)((t,e,r=[])=>{let i=(0,l.Df)(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${i}`},"cssImportantStyles"),rS=(0,c.K)((t,e=new Map)=>{let r=new CSSStyleSheet;if(void 0!==t.fontFamily&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),void 0!==t.altFontFamily&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){let i=(0,l.E)(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(t=>{H(t.styles)||i.forEach(e=>{r.insertRule(rT(t.id,e,t.styles),r.cssRules.length)}),H(t.textStyles)||r.insertRule(rT(t.id,"tspan",(t?.textStyles||[]).map(t=>t.replace("color","fill"))),r.cssRules.length)})}let i="";if(void 0!==t.themeCSS)if("function"==typeof r.replaceSync){let e=new CSSStyleSheet;e.replaceSync(t.themeCSS),i=(0,l.KG)(e)+"\n"}else i+=`${t.themeCSS}
|
|
196
196
|
`;return i+(0,l.KG)(r)},"createCssStyles"),rv=(0,c.K)((t,e)=>{var r,i,o,a,s;return S((o=function t(e,r,i,o,a,s,n,l,h){for(var c,d,u,p,f=0,y=0,m=n,C=0,S=0,v=0,L=1,W=1,z=1,R=0,j=0,N="",H=a,U=s,Y=o,X=N;W;)switch(v=j,j=K()){case 40:108!=v&&58==k(X,m-1)?(R++,X+="("):X+=q(j);break;case 41:R--,X+=")";break;case 34:case 39:case 91:X+=q(j);break;case 9:case 10:case 13:case 32:if(R>0){X+=x(j);break}X+=function(t){for(;M=O();)if(M<33)K();else break;return D(t)>2||D(M)>3?"":" "}(v);break;case 92:X+=function(t,e){for(var r;--e&&K()&&!(M<48)&&!(M>102)&&(!(M>57)||!(M<65))&&(!(M>70)||!(M<97)););return r=A+(e<6&&32==O()&&32==K()),w($,t,r)}(A-1,7);continue;case 47:switch(O()){case 42:case 47:T((c=function(t,e){for(;K();)if(t+M===57)break;else if(t+M===84&&47===O())break;return"/*"+w($,e,A-1)+"*"+x(47===t?t:K())}(K(),A),d=r,u=i,p=h,E(c,d,u,g,x(M),w(c,2,-2),0,p)),h),(5==D(v||1)||5==D(O()||1))&&B(X)&&" "!==w(X,-1,void 0)&&(X+=" ");break;default:X+="/"}break;case 123*L:l[f++]=B(X)*z;case 125*L:case 59:case 0:if(R>0&&j){X+=x(j);break}switch(j){case 0:case 125:W=0;case 59+y:-1==z&&(X=b(X,/\f/g,"")),S>0&&(B(X)-m||0===L)&&T(S>32?P(X+";",o,i,m-1,h):P(b(X," ","")+";",o,i,m-2,h),h);break;case 59:X+=";";default:if(T(Y=I(X,r,i,f,y,a,l,N,H=[],U=[],m,s),s),123===j)if(0===y)t(X,r,Y,Y,H,s,m,l,U);else{switch(C){case 99:if(110===k(X,3))break;case 108:if(97===k(X,2))break;default:y=0;case 100:case 109:case 115:}y?t(e,Y,Y,o&&T(I(e,Y,Y,0,0,a,l,N,a,H=[],m,U),U),a,U,m,l,o?H:U):t(X,Y,Y,Y,[""],U,0,l,U)}}f=y=S=0,L=z=1,N=X="",m=n;break;case 58:m=1+B(X),S=v;default:if(L<1){if(123==j)--L;else if(125==j&&0==L++&&125==(M=A>0?k($,--A):0,F--,10===M&&(F=1,_--),M))continue}switch(X+=x(j),j*L){case 38:z=y>0?1:(X+="\f",-1);break;case 44:if(R>0)break;l[f++]=(B(X)-1)*z,z=1;break;case 64:45===O()&&(X+=q(K())),C=O(),y=m=B(N=X+=function(t){for(;!D(O());)K();return w($,t,A)}(A)),j++;break;case 45:45===v&&2==B(X)&&(L=0)}}return s}("",null,null,null,[""],(i=r=`${t}{${e}}`,_=F=1,L=B($=i),A=0,r=[]),0,[0],r),$="",o),(s=(a=[(0,c.K)(function(e,r,i,o){"rule"===e.type&&Array.isArray(e.props)?e.parent&&e.parent.type===y||(e.props=e.props.map(r=>r===t&&Array.isArray(e.children)&&e.children.every(t=>"decl"===t.type&&(new Set(["font-family","font-size","fill"])).has(t.props))||(r.startsWith(`${t} `)||r.startsWith(`${t}>`))&&!r.startsWith(`${t} ||`)?r:`${t} ${r}`)):e.type.startsWith("@")&&(["@media","@supports",m,"@scope","@container","@starting-style",y].includes(e.type)||(h.R.warn(`Removing unsupported at-rule ${e.type} from CSS`),e.type=g))},"addNamespace"),v]).length,function(t,e,r,i){for(var o="",n=0;n<s;n++)o+=a[n](t,e,r,i)||"";return o}))},"compileCSS"),r_=(0,c.K)((t,e,r,i)=>{let o=rS(t,r),a=(0,l.tM)(e,o,{...t.themeVariables,theme:t.theme,look:t.look},i);return rv(i,a)},"createUserStyles"),rF=(0,c.K)((t="",e,r)=>{let i=t;return r||e||(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=(i=(0,n.Sm)(i)).replace(/<br>/g,"<br/>")},"cleanUpSvgCode"),rL=(0,c.K)((t="",e)=>{let r=e?.viewBox?.baseVal?.height?e.viewBox.baseVal.height+"px":"100%",i=rx(`<body style="margin:0">${t}</body>`);return`<iframe style="width:100%;height:${r};border:0;margin:0;" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="allow-top-navigation-by-user-activation allow-popups">
|
|
197
197
|
The "iframe" tag is not supported by your browser.
|
|
198
198
|
</iframe>`},"putIntoIFrame"),rA=(0,c.K)((t,e,r,i,o)=>{let a=t.append("div");a.attr("id",r),i&&a.attr("style",i);let s=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return o&&s.attr("xmlns:xlink",o),s.append("g"),t},"appendDivSvgG");function rM(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}(0,c.K)(rM,"sandboxedIframe");var r$=(0,c.K)((t,e,r,i)=>{t.getElementById(e)?.remove(),t.getElementById(r)?.remove(),t.getElementById(i)?.remove()},"removeExistingElements"),rE=(0,c.K)(async function(t,e,r){let i,o;rs();let a=rw(e),s=a.code;e=s.cleaned;let n=(0,l.zj)();h.R.debug(n),e.length>(n?.maxTextSize??5e4)&&(s={raw:e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",cleaned:e});let d=`#${t}`,g="i"+t,p="#"+g,f="d"+t,y="#"+f,m=(0,c.K)(()=>{let t=x?p:y,e=(0,u.Ltv)(t).node();e&&"remove"in e&&e.remove()},"removeTempElements"),C=(0,u.Ltv)(document.body),x="sandbox"===n.securityLevel,b="loose"===n.securityLevel,k=n.fontFamily;if(void 0!==r){if(r&&(r.innerHTML=""),x){let t=rM((0,u.Ltv)(r),g);(C=(0,u.Ltv)(t.nodes()[0].contentDocument.body)).node().style.margin="0"}else C=(0,u.Ltv)(r);rA(C,t,f,`font-family: ${k}`,"http://www.w3.org/1999/xlink")}else{if(r$(document,t,f,g),x){let t=rM((0,u.Ltv)(document.body),g);(C=(0,u.Ltv)(t.nodes()[0].contentDocument.body)).node().style.margin="0"}else C=(0,u.Ltv)("body");rA(C,t,f)}try{i=await rc.fromText(s,{title:a.title})}catch(t){if(n.suppressErrorRendering)throw m(),t;i=await rc.fromText("error"),o=t}let w=C.select(y).node(),B=i.type,T=w.firstChild,S=T.firstChild,v=r_(n,B,i.renderer.getClasses?.(e,i),d),_=document.createElement("style");_.innerHTML=v,T.insertBefore(_,S);try{await i.renderer.draw(e,t,"12.0.0",i)}catch(r){throw n.suppressErrorRendering?m():tY.draw(e,t,"12.0.0"),r}rq(B,C.select(`${y} svg`),i.db.getAccTitle?.(),i.db.getAccDescription?.());let F=(0,c.K)(()=>{C.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let e=C.select(y).node().innerHTML;return h.R.debug("config.arrowMarkerAbsolute",n.arrowMarkerAbsolute),e=rF(e,x,(0,l._3)(n.arrowMarkerAbsolute)),x?e=rL(e,C.select(y+" svg").node()):b||(e=W.A.sanitize(e,{ADD_TAGS:rb,ADD_ATTR:rk,HTML_INTEGRATION_POINTS:{foreignobject:!0}})),ru(),e},"serializeSvg")();if(o)throw o;return m(),{diagramType:B,svg:F,bindFunctions:i.db.bindFunctions}},"renderDiagram"),rK=(0,c.K)(async function(t,e,r){try{return await rE(t,e,r)}finally{(0,l.yj)(void 0)}},"render");function rO(t={}){let e=(0,l.hH)({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),(0,l.wZ)(e);let r=l.sb.theme;e?.theme&&Object.hasOwn(l.H$,e.theme)?e.themeVariables=l.H$[e.theme].getThemeVariables(e.themeVariables):e&&(null!=e.theme&&"null"!==e.theme&&(e.theme=r),e.themeVariables=l.H$[r].getThemeVariables(e.themeVariables));let i="object"==typeof e?(0,l.UU)(e):(0,l.Q2)();(0,h.H)(i.logLevel),rs()}(0,c.K)(rO,"initialize");var rD=(0,c.K)((t,e={})=>{let{code:r}=rC(t);return rc.fromText(r,e)},"getDiagramFromText");function rq(t,e,r,i){rl(e,t),rh(e,r,i,e.attr("id"))}(0,c.K)(rq,"addA11yInfo");var rI=Object.freeze({render:rK,parse:rB,getDiagramFromText:rD,initialize:rO,getConfig:l.zj,setConfig:l.Nk,getSiteConfig:l.Q2,updateSiteConfig:l.B6,reset:(0,c.K)(()=>{(0,l.cL)()},"reset"),globalReset:(0,c.K)(()=>{(0,l.cL)(l.sb)},"globalReset"),defaultConfig:l.sb});(0,h.H)((0,l.zj)().logLevel),(0,l.cL)((0,l.zj)());var rP=(0,c.K)((t,e,r)=>{h.R.warn(t),(0,n.dq)(t)?(r&&r(t.str,t.hash),e.push({...t,message:t.str,error:t})):(r&&r(t),t instanceof Error&&e.push({str:t.message,message:t.message,hash:t.name,error:t}))},"handleError"),rW=(0,c.K)(async function(t={querySelector:".mermaid"}){try{await rz(t)}catch(e){if((0,n.dq)(e)&&h.R.error(e.str),rJ.parseError&&rJ.parseError(e),!t.suppressErrors)throw h.R.error("Use the suppressErrors option to suppress these errors"),e}},"run"),rz=(0,c.K)(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){let i,o,a=rI.getConfig();if(h.R.debug(`${!t?"No ":""}Callback function found`),r)i=r;else if(e)i=document.querySelectorAll(e);else throw Error("Nodes and querySelector are both undefined");h.R.debug(`Found ${i.length} diagrams`),a?.startOnLoad!==void 0&&(h.R.debug("Start On Load: "+a?.startOnLoad),rI.updateSiteConfig({startOnLoad:a?.startOnLoad}));let s=new n._K.InitIDGenerator(a.deterministicIds,a.deterministicIDSeed),l=[];for(let e of Array.from(i)){if(h.R.info("Rendering diagram: "+e.id),e.getAttribute("data-processed"))continue;e.setAttribute("data-processed","true");let r=`mermaid-${s.next()}`;o=e.innerHTML,o=(0,d.T)(n._K.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");let i=n._K.detectInit(o);i&&h.R.debug("Detected early reinit: ",i);try{let{svg:i,bindFunctions:a}=await rZ(r,o,e);e.innerHTML=i,t&&await t(r),a&&a(e)}catch(t){rP(t,l,rJ.parseError)}}if(l.length>0)throw l[0]},"runThrowsErrors"),rR=(0,c.K)(function(t){rI.initialize(t)},"initialize"),rj=(0,c.K)(async function(t,e,r){h.R.warn("mermaid.init is deprecated. Please use run instead."),t&&rR(t);let i={postRenderCallback:r,querySelector:".mermaid"};"string"==typeof e?i.querySelector=e:e&&(e instanceof HTMLElement?i.nodes=[e]:i.nodes=e),await rW(i)},"init"),rN=(0,c.K)(async(t,{lazyLoad:e=!0}={})=>{rs(),(0,l.Xd)(...t),!1===e&&await rn()},"registerExternalDiagrams"),rH=(0,c.K)(function(){if(rJ.startOnLoad){let{startOnLoad:t}=rI.getConfig();t&&rJ.run().catch(t=>h.R.error("Mermaid failed to initialize",t))}},"contentLoaded");"u">typeof document&&window.addEventListener("load",rH,!1);var rU=(0,c.K)(function(t){rJ.parseError=t},"setParseErrorHandler"),rY=[],rX=!1,rG=(0,c.K)(async()=>{if(!rX){for(rX=!0;rY.length>0;){let t=rY.shift();if(t)try{await t()}catch(t){h.R.error("Error executing queue",t)}}rX=!1}},"executeQueue"),rV=(0,c.K)(async(t,e)=>new Promise((r,i)=>{let o=(0,c.K)(()=>new Promise((o,a)=>{rI.parse(t,e).then(t=>{o(t),r(t)},t=>{h.R.error("Error parsing",t),rJ.parseError?.(t),a(t),i(t)})}),"performCall");rY.push(o),rG().catch(i)}),"parse"),rZ=(0,c.K)((t,e,r)=>new Promise((i,o)=>{let a=(0,c.K)(()=>new Promise((a,s)=>{rI.render(t,e,r).then(t=>{a(t),i(t)},t=>{h.R.error("Error parsing",t),rJ.parseError?.(t),s(t),o(t)})}),"performCall");rY.push(a),rG().catch(o)}),"render"),rQ=(0,c.K)(()=>Object.keys(l.mW).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),rJ={startOnLoad:!0,mermaidAPI:rI,parse:rV,render:rZ,init:rj,run:rW,registerExternalDiagrams:rN,registerLayoutLoaders:a.sO,initialize:rR,parseError:void 0,contentLoaded:rH,setParseErrorHandler:rU,detectType:l.Ch,registerIconPacks:s.pC,getRegisteredDiagramsMetadata:rQ},r0=rJ},pk(t,e,r){"use strict";function i(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var i=Array.from("string"==typeof t?[t]:t);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var o=i.reduce(function(t,e){var r=e.match(/\n([\t ]+|(?!\s).)/g);return r?t.concat(r.map(function(t){var e,r;return null!=(r=null==(e=t.match(/[\t ]/g))?void 0:e.length)?r:0})):t},[]);if(o.length){var a=RegExp("\n[ ]{".concat(Math.min.apply(Math,o),"}"),"g");i=i.map(function(t){return t.replace(a,"\n")})}i[0]=i[0].replace(/^\r?\n/,"");var s=i[0];return e.forEach(function(t,e){var r=s.match(/(?:^|\n)( *)$/),o=r?r[1]:"",a=t;"string"==typeof t&&t.includes("\n")&&(a=String(t).split("\n").map(function(t,e){return 0===e?t:"".concat(o).concat(t)}).join("\n")),s+=a+i[e+1]}),s}r.d(e,{T:()=>i})}}]);
|