f7cloud_client/apps/text/js/mermaid.core-BxtrgwOm.chunk.mjs
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

251 lines
461 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('text', '', 'js/dagre-6UL2VRFP-DJVbq-dK.chunk.mjs'),window.OC.filePath('text', '', 'js/graph-BOcm7ic5.chunk.mjs'),window.OC.filePath('text', '', 'js/_baseUniq-08qBA_if.chunk.mjs'),window.OC.filePath('text', '', 'js/layout-9-Reifww.chunk.mjs'),window.OC.filePath('text', '', 'js/_basePickBy-D4Ve5JSk.chunk.mjs'),window.OC.filePath('text', '', 'js/clone-Cq87TdKW.chunk.mjs'),window.OC.filePath('text', '', 'js/index-CYtgifWR.chunk.mjs'),window.OC.filePath('text', '', 'js/emoji-picker-B23JpFV7.chunk.mjs'),window.OC.filePath('text', '', 'js/NcLoadingIcon-zQCGdPwE.chunk.mjs'),window.OC.filePath('text', '', 'js/vue.runtime.esm-fahCO3eG.chunk.mjs'),window.OC.filePath('text', '', 'js/index-DxwFe63_.chunk.mjs'),window.OC.filePath('text', '', 'css/NcLoadingIcon-CAC0K4sG.chunk.css'),window.OC.filePath('text', '', 'js/cose-bilkent-S5V4N54A-C7c-PUyn.chunk.mjs'),window.OC.filePath('text', '', 'js/cytoscape.esm-D2wQNSMa.chunk.mjs'),window.OC.filePath('text', '', 'js/c4Diagram-YG6GDRKO-D8EA4slc.chunk.mjs'),window.OC.filePath('text', '', 'js/chunk-TZMSLE5B-DBmF9G8n.chunk.mjs'),window.OC.filePath('text', '', 'js/flowDiagram-NV44I4VS-BS0mqkL9.chunk.mjs'),window.OC.filePath('text', '', 'js/chunk-FMBD7UC4-C-YJ9Twg.chunk.mjs'),window.OC.filePath('text', '', 'js/chunk-55IACEB6-Bmn8dk9H.chunk.mjs'),window.OC.filePath('text', '', 'js/chunk-QN33PNHL-BzMeKeZN.chunk.mjs'),window.OC.filePath('text', '', 'js/channel-BMFyKOlW.chunk.mjs'),window.OC.filePath('text', '', 'js/erDiagram-Q2GNP2WA-BXDqWjIB.chunk.mjs'),window.OC.filePath('text', '', 'js/gitGraphDiagram-NY62KEGX-uYz2XzYa.chunk.mjs'),window.OC.filePath('text', '', 'js/chunk-4BX2VUAB-De5HNejl.chunk.mjs'),window.OC.filePath('text', '', 'js/chunk-QZHKN3VN-Cn3qF_1b.chunk.mjs'),window.OC.filePath('text', '', 'js/treemap-KMMF4GRG-DJhEU9NB.chunk.mjs'),window.OC.filePath('text', '', 'js/ganttDiagram-JELNMOA3-BFwlxZbV.chunk.mjs'),window.OC.filePath('text', '', 'js/linear-B8oUtb08.chunk.mjs'),window.OC.filePath('text', '', 'js/init-CLzSasj9.chunk.mjs'),window.OC.filePath('text', '', 'js/defaultLocale-0_YM-Ssk.chunk.mjs'),window.OC.filePath('text', '', 'js/infoDiagram-WHAUD3N6-DDUy6ZtV.chunk.mjs'),window.OC.filePath('text', '', 'js/pieDiagram-ADFJNKIX-Dyb2KERd.chunk.mjs'),window.OC.filePath('text', '', 'js/arc-DK09IL_E.chunk.mjs'),window.OC.filePath('text', '', 'js/ordinal-D6YK7yj2.chunk.mjs'),window.OC.filePath('text', '', 'js/quadrantDiagram-AYHSOK5B-CA6hLJI2.chunk.mjs'),window.OC.filePath('text', '', 'js/xychartDiagram-PRI3JC2R-CxsDr-8D.chunk.mjs'),window.OC.filePath('text', '', 'js/requirementDiagram-UZGBJVZJ-hmYiFRHr.chunk.mjs'),window.OC.filePath('text', '', 'js/sequenceDiagram-WL72ISMW-CVhR8HYZ.chunk.mjs'),window.OC.filePath('text', '', 'js/classDiagram-2ON5EDUG-C0RfdE4s.chunk.mjs'),window.OC.filePath('text', '', 'js/chunk-B4BG7PRW-P9KWjEcK.chunk.mjs'),window.OC.filePath('text', '', 'js/classDiagram-v2-WZHVMYZB-C0RfdE4s.chunk.mjs'),window.OC.filePath('text', '', 'js/stateDiagram-FKZM4ZOC-CbhoquXf.chunk.mjs'),window.OC.filePath('text', '', 'js/chunk-DI55MBZ5-CbAnZHZo.chunk.mjs'),window.OC.filePath('text', '', 'js/stateDiagram-v2-4FDKWEC3-C12O73D0.chunk.mjs'),window.OC.filePath('text', '', 'js/journeyDiagram-XKPGCS4Q-DjYCRdBZ.chunk.mjs'),window.OC.filePath('text', '', 'js/timeline-definition-IT6M3QCI-DrptD8mO.chunk.mjs'),window.OC.filePath('text', '', 'js/mindmap-definition-VGOIOE7T-11Z0vAWH.chunk.mjs'),window.OC.filePath('text', '', 'js/EditorOutline-CZg3-0Pd.chunk.mjs'),window.OC.filePath('text', '', 'js/logger-DEhDull1.chunk.mjs'),window.OC.filePath('text', '', 'js/index-D3wiQe9-.chunk.mjs'),window.OC.filePath('text', '', 'js/NcNoteCard-CwNXZ4vV-dRcgmGN6.chunk.mjs'),window.OC.filePath('text', '', 'css/NcNoteCard-CwNXZ4vV-GaPUWc2b.chunk.css'),window.OC.filePath('text', '', 'js/NcCheckboxRadioSwitch-CX3HXCEk-BE36-0KV.chunk.mjs'),window.OC.filePath('text', '', 'css/NcCheckboxRadioSwitch-CX3HXCEk-35V8jJy1.chunk.css'),window.OC.filePath('text', '', 'js/_plugin-vue2_normalizer-wd1ZAbRr.chunk.mjs'),window.OC.filePath('text', '', 'js/MediaHandler.provider-BQ5p2YTP.chunk.mjs'),window.OC.filePath('text', '', 'css/EditorOutline-BRhtHk_U.chunk.css'),window.OC.filePath('text', '', 'js/kanban-definition-3W4ZIXB7-BwRo3Wa6.chunk.mjs'),window.OC.filePath('text', '', 'js/sankeyDiagram-TZEHDZUN-bJrJnnw9.chunk.mjs'),window.OC.filePath('text', '', 'js/diagram-S2PKOQOG-BJDVGPp_.chunk.mjs'),window.OC.filePath('text', '', 'js/diagram-QEK2KX5R-BvatOdYd.chunk.mjs'),window.OC.filePath('text', '', 'js/blockDiagram-VD42YOAC-DK0_Jwr9.chunk.mjs'),window.OC.filePath('text', '', 'js/architectureDiagram-VXUJARFQ-D4dy_-Nw.chunk.mjs'),window.OC.filePath('text', '', 'js/diagram-PSM6KHXK-Dz6SO3L1.chunk.mjs')])))=>i.map(i=>d[i]);
import{_ as ot}from"./index-CYtgifWR.chunk.mjs";import{g as Xg}from"./emoji-picker-B23JpFV7.chunk.mjs";import{p as sr}from"./NcLoadingIcon-zQCGdPwE.chunk.mjs";import{g as ui}from"./vue.runtime.esm-fahCO3eG.chunk.mjs";var ao={name:"mermaid",version:"11.12.2",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",type:"module",module:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts",exports:{".":{types:"./dist/mermaid.d.ts",import:"./dist/mermaid.core.mjs",default:"./dist/mermaid.core.mjs"},"./*":"./*"},keywords:["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph","mindmap","packet diagram","c4 diagram","er diagram","pie chart","pie diagram","quadrant chart","requirement diagram","graph"],scripts:{clean:"rimraf dist",dev:"pnpm -w dev","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts","docs:verify":"pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify","docs:pre:vitepress":"pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts","docs:build:vitepress":"pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing","docs:dev":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:dev:docker":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell "src/docs/**/*.md"',"docs:release-version":"tsx scripts/update-release-version.mts","docs:verify-version":"tsx scripts/update-release-version.mts --verify","types:build-config":"tsx scripts/create-types-from-json-schema.mts","types:verify-config":"tsx scripts/create-types-from-json-schema.mts --verify",checkCircle:"npx madge --circular ./src",prepublishOnly:"pnpm docs:verify-version"},repository:{type:"git",url:"https://github.com/mermaid-js/mermaid"},author:"Knut Sveidqvist",license:"MIT",standard:{ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies:{"@braintree/sanitize-url":"^7.1.1","@iconify/utils":"^3.0.1","@mermaid-js/parser":"workspace:^","@types/d3":"^7.4.3",cytoscape:"^3.29.3","cytoscape-cose-bilkent":"^4.1.0","cytoscape-fcose":"^2.2.0",d3:"^7.9.0","d3-sankey":"^0.12.3","dagre-d3-es":"7.0.13",dayjs:"^1.11.18",dompurify:"^3.2.5",katex:"^0.16.22",khroma:"^2.1.0","lodash-es":"^4.17.21",marked:"^16.2.1",roughjs:"^4.6.6",stylis:"^4.3.6","ts-dedent":"^2.2.0",uuid:"^11.1.0"},devDependencies:{"@adobe/jsonschema2md":"^8.0.5","@iconify/types":"^2.0.0","@types/cytoscape":"^3.21.9","@types/cytoscape-fcose":"^2.2.4","@types/d3-sankey":"^0.12.4","@types/d3-scale":"^4.0.9","@types/d3-scale-chromatic":"^3.1.0","@types/d3-selection":"^3.0.11","@types/d3-shape":"^3.1.7","@types/jsdom":"^21.1.7","@types/katex":"^0.16.7","@types/lodash-es":"^4.17.12","@types/micromatch":"^4.0.9","@types/stylis":"^4.2.7","@types/uuid":"^10.0.0",ajv:"^8.17.1",canvas:"^3.1.2",chokidar:"3.6.0",concurrently:"^9.1.2","csstree-validator":"^4.0.1",globby:"^14.1.0",jison:"^0.4.18","js-base64":"^3.7.8",jsdom:"^26.1.0","json-schema-to-typescript":"^15.0.4",micromatch:"^4.0.8","path-browserify":"^1.0.1",prettier:"^3.5.3",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-gfm":"^4.0.1",rimraf:"^6.0.1","start-server-and-test":"^2.0.13","type-fest":"^4.35.0",typedoc:"^0.28.12","typedoc-plugin-markdown":"^4.8.1",typescript:"~5.7.3","unist-util-flatmap":"^1.0.0","unist-util-visit":"^5.0.0",vitepress:"^1.6.4","vitepress-plugin-search":"1.0.4-alpha.22"},files:["dist/","README.md"],publishConfig:{access:"public"}},oa={exports:{}},Zg=oa.exports,so;function Qg(){return so||(so=1,(function(t,e){(function(r,i){t.exports=i()})(Zg,function(){var r=1e3,i=6e4,n=36e5,a="millisecond",o="second",s="minute",l="hour",h="day",c="week",d="month",u="quarter",p="year",f="date",y="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|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,b={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 M=["th","st","nd","rd"],S=T%100;return"["+T+(M[(S-20)%10]||M[S]||M[0])+"]"}},k=function(T,M,S){var L=String(T);return!L||L.length>=M?T:""+Array(M+1-L.length).join(S)+T},_={s:k,z:function(T){var M=-T.utcOffset(),S=Math.abs(M),L=Math.floor(S/60),$=S%60;return(M<=0?"+":"-")+k(L,2,"0")+":"+k($,2,"0")},m:function T(M,S){if(M.date()<S.date())return-T(S,M);var L=12*(S.year()-M.year())+(S.month()-M.month()),$=M.clone().add(L,d),H=S-$<0,U=M.clone().add(L+(H?-1:1),d);return+(-(L+(S-$)/(H?$-U:U-$))||0)},a:function(T){return T<0?Math.ceil(T)||0:Math.floor(T)},p:function(T){return{M:d,y:p,w:c,d:h,D:f,h:l,m:s,s:o,ms:a,Q:u}[T]||String(T||"").toLowerCase().replace(/s$/,"")},u:function(T){return T===void 0}},C="en",B={};B[C]=b;var v="$isDayjsObject",E=function(T){return T instanceof P||!(!T||!T[v])},D=function T(M,S,L){var $;if(!M)return C;if(typeof M=="string"){var H=M.toLowerCase();B[H]&&($=H),S&&(B[H]=S,$=H);var U=M.split("-");if(!$&&U.length>1)return T(U[0])}else{var et=M.name;B[et]=M,$=et}return!L&&$&&(C=$),$||!L&&C},I=function(T,M){if(E(T))return T.clone();var S=typeof M=="object"?M:{};return S.date=T,S.args=arguments,new P(S)},A=_;A.l=D,A.i=E,A.w=function(T,M){return I(T,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var P=(function(){function T(S){this.$L=D(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[v]=!0}var M=T.prototype;return M.parse=function(S){this.$d=(function(L){var $=L.date,H=L.utc;if($===null)return new Date(NaN);if(A.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var U=$.match(m);if(U){var et=U[2]-1||0,X=(U[7]||"0").substring(0,3);return H?new Date(Date.UTC(U[1],et,U[3]||1,U[4]||0,U[5]||0,U[6]||0,X)):new Date(U[1],et,U[3]||1,U[4]||0,U[5]||0,U[6]||0,X)}}return new Date($)})(S),this.init()},M.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},M.$utils=function(){return A},M.isValid=function(){return this.$d.toString()!==y},M.isSame=function(S,L){var $=I(S);return this.startOf(L)<=$&&$<=this.endOf(L)},M.isAfter=function(S,L){return I(S)<this.startOf(L)},M.isBefore=function(S,L){return this.endOf(L)<I(S)},M.$g=function(S,L,$){return A.u(S)?this[L]:this.set($,S)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(S,L){var $=this,H=!!A.u(L)||L,U=A.p(S),et=function(Nt,Lt){var fe=A.w($.$u?Date.UTC($.$y,Lt,Nt):new Date($.$y,Lt,Nt),$);return H?fe:fe.endOf(h)},X=function(Nt,Lt){return A.w($.toDate()[Nt].apply($.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(Lt)),$)},tt=this.$W,lt=this.$M,ht=this.$D,Pt="set"+(this.$u?"UTC":"");switch(U){case p:return H?et(1,0):et(31,11);case d:return H?et(1,lt):et(0,lt+1);case c:var kt=this.$locale().weekStart||0,ge=(tt<kt?tt+7:tt)-kt;return et(H?ht-ge:ht+(6-ge),lt);case h:case f:return X(Pt+"Hours",0);case l:return X(Pt+"Minutes",1);case s:return X(Pt+"Seconds",2);case o:return X(Pt+"Milliseconds",3);default:return this.clone()}},M.endOf=function(S){return this.startOf(S,!1)},M.$set=function(S,L){var $,H=A.p(S),U="set"+(this.$u?"UTC":""),et=($={},$[h]=U+"Date",$[f]=U+"Date",$[d]=U+"Month",$[p]=U+"FullYear",$[l]=U+"Hours",$[s]=U+"Minutes",$[o]=U+"Seconds",$[a]=U+"Milliseconds",$)[H],X=H===h?this.$D+(L-this.$W):L;if(H===d||H===p){var tt=this.clone().set(f,1);tt.$d[et](X),tt.init(),this.$d=tt.set(f,Math.min(this.$D,tt.daysInMonth())).$d}else et&&this.$d[et](X);return this.init(),this},M.set=function(S,L){return this.clone().$set(S,L)},M.get=function(S){return this[A.p(S)]()},M.add=function(S,L){var $,H=this;S=Number(S);var U=A.p(L),et=function(lt){var ht=I(H);return A.w(ht.date(ht.date()+Math.round(lt*S)),H)};if(U===d)return this.set(d,this.$M+S);if(U===p)return this.set(p,this.$y+S);if(U===h)return et(1);if(U===c)return et(7);var X=($={},$[s]=i,$[l]=n,$[o]=r,$)[U]||1,tt=this.$d.getTime()+S*X;return A.w(tt,this)},M.subtract=function(S,L){return this.add(-1*S,L)},M.format=function(S){var L=this,$=this.$locale();if(!this.isValid())return $.invalidDate||y;var H=S||"YYYY-MM-DDTHH:mm:ssZ",U=A.z(this),et=this.$H,X=this.$m,tt=this.$M,lt=$.weekdays,ht=$.months,Pt=$.meridiem,kt=function(Lt,fe,br,di){return Lt&&(Lt[fe]||Lt(L,H))||br[fe].slice(0,di)},ge=function(Lt){return A.s(et%12||12,Lt,"0")},Nt=Pt||function(Lt,fe,br){var di=Lt<12?"AM":"PM";return br?di.toLowerCase():di};return H.replace(x,function(Lt,fe){return fe||(function(br){switch(br){case"YY":return String(L.$y).slice(-2);case"YYYY":return A.s(L.$y,4,"0");case"M":return tt+1;case"MM":return A.s(tt+1,2,"0");case"MMM":return kt($.monthsShort,tt,ht,3);case"MMMM":return kt(ht,tt);case"D":return L.$D;case"DD":return A.s(L.$D,2,"0");case"d":return String(L.$W);case"dd":return kt($.weekdaysMin,L.$W,lt,2);case"ddd":return kt($.weekdaysShort,L.$W,lt,3);case"dddd":return lt[L.$W];case"H":return String(et);case"HH":return A.s(et,2,"0");case"h":return ge(1);case"hh":return ge(2);case"a":return Nt(et,X,!0);case"A":return Nt(et,X,!1);case"m":return String(X);case"mm":return A.s(X,2,"0");case"s":return String(L.$s);case"ss":return A.s(L.$s,2,"0");case"SSS":return A.s(L.$ms,3,"0");case"Z":return U}return null})(Lt)||U.replace(":","")})},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(S,L,$){var H,U=this,et=A.p(L),X=I(S),tt=(X.utcOffset()-this.utcOffset())*i,lt=this-X,ht=function(){return A.m(U,X)};switch(et){case p:H=ht()/12;break;case d:H=ht();break;case u:H=ht()/3;break;case c:H=(lt-tt)/6048e5;break;case h:H=(lt-tt)/864e5;break;case l:H=lt/n;break;case s:H=lt/i;break;case o:H=lt/r;break;default:H=lt}return $?H:A.a(H)},M.daysInMonth=function(){return this.endOf(d).$D},M.$locale=function(){return B[this.$L]},M.locale=function(S,L){if(!S)return this.$L;var $=this.clone(),H=D(S,L,!0);return H&&($.$L=H),$},M.clone=function(){return A.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},T})(),O=P.prototype;return I.prototype=O,[["$ms",a],["$s",o],["$m",s],["$H",l],["$W",h],["$M",d],["$y",p],["$D",f]].forEach(function(T){O[T[1]]=function(M){return this.$g(M,T[0],T[1])}}),I.extend=function(T,M){return T.$i||(T(M,P,I),T.$i=!0),I},I.locale=D,I.isDayjs=E,I.unix=function(T){return I(1e3*T)},I.en=B[C],I.Ls=B,I.p={},I})})(oa)),oa.exports}var Kg=Qg();const Jg=Xg(Kg);var Ol=Object.defineProperty,g=(t,e)=>Ol(t,"name",{value:e,configurable:!0}),tf=(t,e)=>{for(var r in e)Ol(t,r,{get:e[r],enumerable:!0})},ne={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},F={trace:g((...t)=>{},"trace"),debug:g((...t)=>{},"debug"),info:g((...t)=>{},"info"),warn:g((...t)=>{},"warn"),error:g((...t)=>{},"error"),fatal:g((...t)=>{},"fatal")},is=g(function(t="fatal"){let e=ne.fatal;typeof t=="string"?t.toLowerCase()in ne&&(e=ne[t]):typeof t=="number"&&(e=t),F.trace=()=>{},F.debug=()=>{},F.info=()=>{},F.warn=()=>{},F.error=()=>{},F.fatal=()=>{},e<=ne.fatal&&(F.fatal=console.error?console.error.bind(console,zt("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",zt("FATAL"))),e<=ne.error&&(F.error=console.error?console.error.bind(console,zt("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",zt("ERROR"))),e<=ne.warn&&(F.warn=console.warn?console.warn.bind(console,zt("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",zt("WARN"))),e<=ne.info&&(F.info=console.info?console.info.bind(console,zt("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",zt("INFO"))),e<=ne.debug&&(F.debug=console.debug?console.debug.bind(console,zt("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",zt("DEBUG"))),e<=ne.trace&&(F.trace=console.debug?console.debug.bind(console,zt("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",zt("TRACE")))},"setLogLevel"),zt=g(t=>`%c${Jg().format("ss.SSS")} : ${t} : `,"format");const _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=>{const 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<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},i)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;const n=r<.5?r*(1+e):r+e-r*e,a=2*r-n;switch(i){case"r":return _i.hue2rgb(a,n,t+1/3)*255;case"g":return _i.hue2rgb(a,n,t)*255;case"b":return _i.hue2rgb(a,n,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:r},i)=>{t/=255,e/=255,r/=255;const n=Math.max(t,e,r),a=Math.min(t,e,r),o=(n+a)/2;if(i==="l")return o*100;if(n===a)return 0;const s=n-a,l=o>.5?s/(2-n-a):s/(n+a);if(i==="s")return l*100;switch(n){case t:return((e-r)/s+(e<r?6:0))*60;case e:return((r-t)/s+2)*60;case r:return((t-e)/s+4)*60;default:return-1}}},ef={clamp:(t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},rf={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},J={channel:_i,lang:ef,unit:rf},ye={};for(let t=0;t<=255;t++)ye[t]=J.unit.dec2hex(t);const wt={ALL:0,RGB:1,HSL:2};class nf{constructor(){this.type=wt.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=wt.ALL}is(e){return this.type===e}}class af{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new nf}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=wt.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:i,l:n}=e;r===void 0&&(e.h=J.channel.rgb2hsl(e,"h")),i===void 0&&(e.s=J.channel.rgb2hsl(e,"s")),n===void 0&&(e.l=J.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:i,b:n}=e;r===void 0&&(e.r=J.channel.hsl2rgb(e,"r")),i===void 0&&(e.g=J.channel.hsl2rgb(e,"g")),n===void 0&&(e.b=J.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(wt.HSL)&&r!==void 0?r:(this._ensureHSL(),J.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(wt.HSL)&&r!==void 0?r:(this._ensureHSL(),J.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(wt.HSL)&&r!==void 0?r:(this._ensureHSL(),J.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(wt.RGB)&&r!==void 0?r:(this._ensureRGB(),J.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(wt.RGB)&&r!==void 0?r:(this._ensureRGB(),J.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(wt.RGB)&&r!==void 0?r:(this._ensureRGB(),J.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(wt.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(wt.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(wt.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(wt.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(wt.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(wt.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const bn=new af({r:0,g:0,b:0,a:0},"transparent"),ir={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(ir.re);if(!e)return;const r=e[1],i=parseInt(r,16),n=r.length,a=n%4===0,o=n>4,s=o?1:17,l=o?8:4,h=a?0:-1,c=o?255:15;return bn.set({r:(i>>l*(h+3)&c)*s,g:(i>>l*(h+2)&c)*s,b:(i>>l*(h+1)&c)*s,a:a?(i&c)*s/255:1},t)},stringify:t=>{const{r:e,g:r,b:i,a:n}=t;return n<1?`#${ye[Math.round(e)]}${ye[Math.round(r)]}${ye[Math.round(i)]}${ye[Math.round(n*255)]}`:`#${ye[Math.round(e)]}${ye[Math.round(r)]}${ye[Math.round(i)]}`}},Oe={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=>{const e=t.match(Oe.hueRe);if(e){const[,r,i]=e;switch(i){case"grad":return J.channel.clamp.h(parseFloat(r)*.9);case"rad":return J.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return J.channel.clamp.h(parseFloat(r)*360)}}return J.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(Oe.re);if(!r)return;const[,i,n,a,o,s]=r;return bn.set({h:Oe._hue2deg(i),s:J.channel.clamp.s(parseFloat(n)),l:J.channel.clamp.l(parseFloat(a)),a:o?J.channel.clamp.a(s?parseFloat(o)/100:parseFloat(o)):1},t)},stringify:t=>{const{h:e,s:r,l:i,a:n}=t;return n<1?`hsla(${J.lang.round(e)}, ${J.lang.round(r)}%, ${J.lang.round(i)}%, ${n})`:`hsl(${J.lang.round(e)}, ${J.lang.round(r)}%, ${J.lang.round(i)}%)`}},Ir={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();const e=Ir.colors[t];if(e)return ir.parse(e)},stringify:t=>{const e=ir.stringify(t);for(const r in Ir.colors)if(Ir.colors[r]===e)return r}},Mr={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=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const r=t.match(Mr.re);if(!r)return;const[,i,n,a,o,s,l,h,c]=r;return bn.set({r:J.channel.clamp.r(n?parseFloat(i)*2.55:parseFloat(i)),g:J.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:J.channel.clamp.b(l?parseFloat(s)*2.55:parseFloat(s)),a:h?J.channel.clamp.a(c?parseFloat(h)/100:parseFloat(h)):1},t)},stringify:t=>{const{r:e,g:r,b:i,a:n}=t;return n<1?`rgba(${J.lang.round(e)}, ${J.lang.round(r)}, ${J.lang.round(i)}, ${J.lang.round(n)})`:`rgb(${J.lang.round(e)}, ${J.lang.round(r)}, ${J.lang.round(i)})`}},te={format:{keyword:Ir,hex:ir,rgb:Mr,rgba:Mr,hsl:Oe,hsla:Oe},parse:t=>{if(typeof t!="string")return t;const e=ir.parse(t)||Mr.parse(t)||Oe.parse(t)||Ir.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(wt.HSL)||t.data.r===void 0?Oe.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Mr.stringify(t):ir.stringify(t)},Dl=(t,e)=>{const r=te.parse(t);for(const i in e)r[i]=J.channel.clamp[i](e[i]);return te.stringify(r)},Pr=(t,e,r=0,i=1)=>{if(typeof t!="number")return Dl(t,{a:e});const n=bn.set({r:J.channel.clamp.r(t),g:J.channel.clamp.g(e),b:J.channel.clamp.b(r),a:J.channel.clamp.a(i)});return te.stringify(n)},sf=t=>{const{r:e,g:r,b:i}=te.parse(t),n=.2126*J.channel.toLinear(e)+.7152*J.channel.toLinear(r)+.0722*J.channel.toLinear(i);return J.lang.round(n)},of=t=>sf(t)>=.5,ri=t=>!of(t),Il=(t,e,r)=>{const i=te.parse(t),n=i[e],a=J.channel.clamp[e](n+r);return n!==a&&(i[e]=a),te.stringify(i)},R=(t,e)=>Il(t,"l",e),G=(t,e)=>Il(t,"l",-e),w=(t,e)=>{const r=te.parse(t),i={};for(const n in e)e[n]&&(i[n]=r[n]+e[n]);return Dl(t,i)},lf=(t,e,r=50)=>{const{r:i,g:n,b:a,a:o}=te.parse(t),{r:s,g:l,b:h,a:c}=te.parse(e),d=r/100,u=d*2-1,p=o-c,f=((u*p===-1?u:(u+p)/(1+u*p))+1)/2,y=1-f,m=i*f+s*y,x=n*f+l*y,b=a*f+h*y,k=o*d+c*(1-d);return Pr(m,x,b,k)},z=(t,e=100)=>{const r=te.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,lf(r,t,e)};var Pl=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,zr=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,hf=/\s*%%.*\n/gm,zl=class extends Error{static{g(this,"UnknownDiagramError")}constructor(t){super(t),this.name="UnknownDiagramError"}},Re={},ns=g(function(t,e){t=t.replace(Pl,"").replace(zr,"").replace(hf,`
`);for(const[r,{detector:i}]of Object.entries(Re))if(i(t,e))return r;throw new zl(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),la=g((...t)=>{for(const{id:e,detector:r,loader:i}of t)ql(e,r,i)},"registerLazyLoadedDiagrams"),ql=g((t,e,r)=>{Re[t]&&F.warn(`Detector with key ${t} already exists. Overwriting.`),Re[t]={detector:e,loader:r},F.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),cf=g(t=>Re[t].loader,"getDiagramLoader"),ha=g((t,e,{depth:r=2,clobber:i=!1}={})=>{const n={depth:r,clobber:i};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(a=>ha(t,a,n)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(a=>{t.includes(a)||t.push(a)}),t):t===void 0||r<=0?t!=null&&typeof t=="object"&&typeof e=="object"?Object.assign(t,e):e:(e!==void 0&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(a=>{typeof e[a]=="object"&&(t[a]===void 0||typeof t[a]=="object")?(t[a]===void 0&&(t[a]=Array.isArray(e[a])?[]:{}),t[a]=ha(t[a],e[a],{depth:r-1,clobber:i})):(i||typeof t[a]!="object"&&typeof e[a]!="object")&&(t[a]=e[a])}),t)},"assignWithDepth"),gt=ha,kn="#ffffff",Cn="#f2f2f2",Bt=g((t,e)=>e?w(t,{s:-40,l:10}):w(t,{s:-40,l:-10}),"mkBorder"),df=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||w(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||w(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Bt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Bt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Bt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Bt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||z(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||z(this.tertiaryColor),this.lineColor=this.lineColor||z(this.background),this.arrowheadColor=this.arrowheadColor||z(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?G(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||G(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||z(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||R(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||G(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||G(this.mainBkg,10)):(this.rowOdd=this.rowOdd||R(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||R(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||w(this.primaryColor,{h:30}),this.cScale4=this.cScale4||w(this.primaryColor,{h:60}),this.cScale5=this.cScale5||w(this.primaryColor,{h:90}),this.cScale6=this.cScale6||w(this.primaryColor,{h:120}),this.cScale7=this.cScale7||w(this.primaryColor,{h:150}),this.cScale8=this.cScale8||w(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||w(this.primaryColor,{h:270}),this.cScale10=this.cScale10||w(this.primaryColor,{h:300}),this.cScale11=this.cScale11||w(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=G(this["cScale"+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=G(this["cScale"+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||z(this["cScale"+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this["cScalePeer"+e]=this["cScalePeer"+e]||R(this["cScale"+e],10):this["cScalePeer"+e]=this["cScalePeer"+e]||G(this["cScale"+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||w(this.mainBkg,{h:180,s:-15,l:t*(5+e*3)}),this["surfacePeer"+e]=this["surfacePeer"+e]||w(this.mainBkg,{h:180,s:-15,l:t*(8+e*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||w(this.primaryColor,{h:64}),this.fillType3=this.fillType3||w(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||w(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||w(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||w(this.primaryColor,{h:128}),this.fillType7=this.fillType7||w(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||w(this.primaryColor,{l:-10}),this.pie5=this.pie5||w(this.secondaryColor,{l:-10}),this.pie6=this.pie6||w(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||w(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||w(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||w(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||w(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||w(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||w(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||w(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||w(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||w(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||w(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||w(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||w(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ri(this.quadrant1Fill)?R(this.quadrant1Fill):G(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?G(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||w(this.primaryColor,{h:-30}),this.git4=this.git4||w(this.primaryColor,{h:-60}),this.git5=this.git5||w(this.primaryColor,{h:-90}),this.git6=this.git6||w(this.primaryColor,{h:60}),this.git7=this.git7||w(this.primaryColor,{h:120}),this.darkMode?(this.git0=R(this.git0,25),this.git1=R(this.git1,25),this.git2=R(this.git2,25),this.git3=R(this.git3,25),this.git4=R(this.git4,25),this.git5=R(this.git5,25),this.git6=R(this.git6,25),this.git7=R(this.git7,25)):(this.git0=G(this.git0,25),this.git1=G(this.git1,25),this.git2=G(this.git2,25),this.git3=G(this.git3,25),this.git4=G(this.git4,25),this.git5=G(this.git5,25),this.git6=G(this.git6,25),this.git7=G(this.git7,25)),this.gitInv0=this.gitInv0||z(this.git0),this.gitInv1=this.gitInv1||z(this.git1),this.gitInv2=this.gitInv2||z(this.git2),this.gitInv3=this.gitInv3||z(this.git3),this.gitInv4=this.gitInv4||z(this.git4),this.gitInv5=this.gitInv5||z(this.git5),this.gitInv6=this.gitInv6||z(this.git6),this.gitInv7=this.gitInv7||z(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||kn,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Cn}calculate(t){if(typeof t!="object"){this.updateColors();return}const e=Object.keys(t);e.forEach(r=>{this[r]=t[r]}),this.updateColors(),e.forEach(r=>{this[r]=t[r]})}},uf=g(t=>{const e=new df;return e.calculate(t),e},"getThemeVariables"),pf=class{static{g(this,"Theme")}constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=R(this.primaryColor,16),this.tertiaryColor=w(this.primaryColor,{h:-160}),this.primaryBorderColor=z(this.background),this.secondaryBorderColor=Bt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bt(this.tertiaryColor,this.darkMode),this.primaryTextColor=z(this.primaryColor),this.secondaryTextColor=z(this.secondaryColor),this.tertiaryTextColor=z(this.tertiaryColor),this.lineColor=z(this.background),this.textColor=z(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=R(z("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Pr(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.sectionBkgColor=G("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=G(this.sectionBkgColor,10),this.taskBorderColor=Pr(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Pr(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||R(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||G(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=R(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=R(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=R(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=this.darkTextColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=w(this.primaryColor,{h:64}),this.fillType3=w(this.secondaryColor,{h:64}),this.fillType4=w(this.primaryColor,{h:-64}),this.fillType5=w(this.secondaryColor,{h:-64}),this.fillType6=w(this.primaryColor,{h:128}),this.fillType7=w(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||w(this.primaryColor,{h:30}),this.cScale4=this.cScale4||w(this.primaryColor,{h:60}),this.cScale5=this.cScale5||w(this.primaryColor,{h:90}),this.cScale6=this.cScale6||w(this.primaryColor,{h:120}),this.cScale7=this.cScale7||w(this.primaryColor,{h:150}),this.cScale8=this.cScale8||w(this.primaryColor,{h:210}),this.cScale9=this.cScale9||w(this.primaryColor,{h:270}),this.cScale10=this.cScale10||w(this.primaryColor,{h:300}),this.cScale11=this.cScale11||w(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||z(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||R(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||w(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||w(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||w(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||w(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||w(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||w(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||w(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||w(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ri(this.quadrant1Fill)?R(this.quadrant1Fill):G(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?G(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=R(this.secondaryColor,20),this.git1=R(this.pie2||this.secondaryColor,20),this.git2=R(this.pie3||this.tertiaryColor,20),this.git3=R(this.pie4||w(this.primaryColor,{h:-30}),20),this.git4=R(this.pie5||w(this.primaryColor,{h:-60}),20),this.git5=R(this.pie6||w(this.primaryColor,{h:-90}),10),this.git6=R(this.pie7||w(this.primaryColor,{h:60}),10),this.git7=R(this.pie8||w(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||z(this.git0),this.gitInv1=this.gitInv1||z(this.git1),this.gitInv2=this.gitInv2||z(this.git2),this.gitInv3=this.gitInv3||z(this.git3),this.gitInv4=this.gitInv4||z(this.git4),this.gitInv5=this.gitInv5||z(this.git5),this.gitInv6=this.gitInv6||z(this.git6),this.gitInv7=this.gitInv7||z(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||z(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||z(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||R(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||R(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const e=Object.keys(t);e.forEach(r=>{this[r]=t[r]}),this.updateColors(),e.forEach(r=>{this[r]=t[r]})}},gf=g(t=>{const e=new pf;return e.calculate(t),e},"getThemeVariables"),ff=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=w(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=w(this.primaryColor,{h:-160}),this.primaryBorderColor=Bt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Bt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bt(this.tertiaryColor,this.darkMode),this.primaryTextColor=z(this.primaryColor),this.secondaryTextColor=z(this.secondaryColor),this.tertiaryTextColor=z(this.tertiaryColor),this.lineColor=z(this.background),this.textColor=z(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Pr(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||w(this.primaryColor,{h:30}),this.cScale4=this.cScale4||w(this.primaryColor,{h:60}),this.cScale5=this.cScale5||w(this.primaryColor,{h:90}),this.cScale6=this.cScale6||w(this.primaryColor,{h:120}),this.cScale7=this.cScale7||w(this.primaryColor,{h:150}),this.cScale8=this.cScale8||w(this.primaryColor,{h:210}),this.cScale9=this.cScale9||w(this.primaryColor,{h:270}),this.cScale10=this.cScale10||w(this.primaryColor,{h:300}),this.cScale11=this.cScale11||w(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||G(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||G(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=G(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||G(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||w(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||w(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||w(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||z(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||z(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=R(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||R(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||R(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=w(this.primaryColor,{h:64}),this.fillType3=w(this.secondaryColor,{h:64}),this.fillType4=w(this.primaryColor,{h:-64}),this.fillType5=w(this.secondaryColor,{h:-64}),this.fillType6=w(this.primaryColor,{h:128}),this.fillType7=w(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||w(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||w(this.primaryColor,{l:-10}),this.pie5=this.pie5||w(this.secondaryColor,{l:-30}),this.pie6=this.pie6||w(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||w(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||w(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||w(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||w(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||w(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||w(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||w(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||w(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||w(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||w(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||w(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||w(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ri(this.quadrant1Fill)?R(this.quadrant1Fill):G(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||w(this.primaryColor,{h:-30}),this.git4=this.git4||w(this.primaryColor,{h:-60}),this.git5=this.git5||w(this.primaryColor,{h:-90}),this.git6=this.git6||w(this.primaryColor,{h:60}),this.git7=this.git7||w(this.primaryColor,{h:120}),this.darkMode?(this.git0=R(this.git0,25),this.git1=R(this.git1,25),this.git2=R(this.git2,25),this.git3=R(this.git3,25),this.git4=R(this.git4,25),this.git5=R(this.git5,25),this.git6=R(this.git6,25),this.git7=R(this.git7,25)):(this.git0=G(this.git0,25),this.git1=G(this.git1,25),this.git2=G(this.git2,25),this.git3=G(this.git3,25),this.git4=G(this.git4,25),this.git5=G(this.git5,25),this.git6=G(this.git6,25),this.git7=G(this.git7,25)),this.gitInv0=this.gitInv0||G(z(this.git0),25),this.gitInv1=this.gitInv1||z(this.git1),this.gitInv2=this.gitInv2||z(this.git2),this.gitInv3=this.gitInv3||z(this.git3),this.gitInv4=this.gitInv4||z(this.git4),this.gitInv5=this.gitInv5||z(this.git5),this.gitInv6=this.gitInv6||z(this.git6),this.gitInv7=this.gitInv7||z(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||z(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||z(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||kn,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Cn}calculate(t){if(Object.keys(this).forEach(r=>{this[r]==="calculated"&&(this[r]=void 0)}),typeof t!="object"){this.updateColors();return}const e=Object.keys(t);e.forEach(r=>{this[r]=t[r]}),this.updateColors(),e.forEach(r=>{this[r]=t[r]})}},yf=g(t=>{const e=new ff;return e.calculate(t),e},"getThemeVariables"),mf=class{static{g(this,"Theme")}constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=R("#cde498",10),this.primaryBorderColor=Bt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Bt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bt(this.tertiaryColor,this.darkMode),this.primaryTextColor=z(this.primaryColor),this.secondaryTextColor=z(this.secondaryColor),this.tertiaryTextColor=z(this.primaryColor),this.lineColor=z(this.background),this.textColor=z(this.background),this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.actorBorder=G(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||w(this.primaryColor,{h:30}),this.cScale4=this.cScale4||w(this.primaryColor,{h:60}),this.cScale5=this.cScale5||w(this.primaryColor,{h:90}),this.cScale6=this.cScale6||w(this.primaryColor,{h:120}),this.cScale7=this.cScale7||w(this.primaryColor,{h:150}),this.cScale8=this.cScale8||w(this.primaryColor,{h:210}),this.cScale9=this.cScale9||w(this.primaryColor,{h:270}),this.cScale10=this.cScale10||w(this.primaryColor,{h:300}),this.cScale11=this.cScale11||w(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||G(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||G(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=G(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||G(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||w(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||w(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||w(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||R(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||R(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=w(this.primaryColor,{h:64}),this.fillType3=w(this.secondaryColor,{h:64}),this.fillType4=w(this.primaryColor,{h:-64}),this.fillType5=w(this.secondaryColor,{h:-64}),this.fillType6=w(this.primaryColor,{h:128}),this.fillType7=w(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||w(this.primaryColor,{l:-30}),this.pie5=this.pie5||w(this.secondaryColor,{l:-30}),this.pie6=this.pie6||w(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||w(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||w(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||w(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||w(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||w(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||w(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||w(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||w(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||w(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||w(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||w(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||w(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ri(this.quadrant1Fill)?R(this.quadrant1Fill):G(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||w(this.primaryColor,{h:-30}),this.git4=this.git4||w(this.primaryColor,{h:-60}),this.git5=this.git5||w(this.primaryColor,{h:-90}),this.git6=this.git6||w(this.primaryColor,{h:60}),this.git7=this.git7||w(this.primaryColor,{h:120}),this.darkMode?(this.git0=R(this.git0,25),this.git1=R(this.git1,25),this.git2=R(this.git2,25),this.git3=R(this.git3,25),this.git4=R(this.git4,25),this.git5=R(this.git5,25),this.git6=R(this.git6,25),this.git7=R(this.git7,25)):(this.git0=G(this.git0,25),this.git1=G(this.git1,25),this.git2=G(this.git2,25),this.git3=G(this.git3,25),this.git4=G(this.git4,25),this.git5=G(this.git5,25),this.git6=G(this.git6,25),this.git7=G(this.git7,25)),this.gitInv0=this.gitInv0||z(this.git0),this.gitInv1=this.gitInv1||z(this.git1),this.gitInv2=this.gitInv2||z(this.git2),this.gitInv3=this.gitInv3||z(this.git3),this.gitInv4=this.gitInv4||z(this.git4),this.gitInv5=this.gitInv5||z(this.git5),this.gitInv6=this.gitInv6||z(this.git6),this.gitInv7=this.gitInv7||z(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||z(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||z(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||kn,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Cn}calculate(t){if(typeof t!="object"){this.updateColors();return}const e=Object.keys(t);e.forEach(r=>{this[r]=t[r]}),this.updateColors(),e.forEach(r=>{this[r]=t[r]})}},xf=g(t=>{const e=new mf;return e.calculate(t),e},"getThemeVariables"),bf=class{static{g(this,"Theme")}constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=R(this.contrast,55),this.background="#ffffff",this.tertiaryColor=w(this.primaryColor,{h:-160}),this.primaryBorderColor=Bt(this.primaryColor,this.darkMode),this.secondaryBorderColor=Bt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Bt(this.tertiaryColor,this.darkMode),this.primaryTextColor=z(this.primaryColor),this.secondaryTextColor=z(this.secondaryColor),this.tertiaryTextColor=z(this.tertiaryColor),this.lineColor=z(this.background),this.textColor=z(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||R(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=R(this.contrast,55),this.border2=this.contrast,this.actorBorder=R(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||z(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||R(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||G(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||w(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||w(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=R(this.contrast,30),this.sectionBkgColor2=R(this.contrast,30),this.taskBorderColor=G(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=R(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=G(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=w(this.primaryColor,{h:64}),this.fillType3=w(this.secondaryColor,{h:64}),this.fillType4=w(this.primaryColor,{h:-64}),this.fillType5=w(this.secondaryColor,{h:-64}),this.fillType6=w(this.primaryColor,{h:128}),this.fillType7=w(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||w(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||w(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||w(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||w(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||w(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||w(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ri(this.quadrant1Fill)?R(this.quadrant1Fill):G(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=G(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||w(this.primaryColor,{h:-30}),this.git4=this.pie5||w(this.primaryColor,{h:-60}),this.git5=this.pie6||w(this.primaryColor,{h:-90}),this.git6=this.pie7||w(this.primaryColor,{h:60}),this.git7=this.pie8||w(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||z(this.git0),this.gitInv1=this.gitInv1||z(this.git1),this.gitInv2=this.gitInv2||z(this.git2),this.gitInv3=this.gitInv3||z(this.git3),this.gitInv4=this.gitInv4||z(this.git4),this.gitInv5=this.gitInv5||z(this.git5),this.gitInv6=this.gitInv6||z(this.git6),this.gitInv7=this.gitInv7||z(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||kn,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Cn}calculate(t){if(typeof t!="object"){this.updateColors();return}const e=Object.keys(t);e.forEach(r=>{this[r]=t[r]}),this.updateColors(),e.forEach(r=>{this[r]=t[r]})}},kf=g(t=>{const e=new bf;return e.calculate(t),e},"getThemeVariables"),he={base:{getThemeVariables:uf},dark:{getThemeVariables:gf},default:{getThemeVariables:yf},forest:{getThemeVariables:xf},neutral:{getThemeVariables:kf}},Xt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Rl={...Xt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:he.default.getThemeVariables(),sequence:{...Xt.sequence,messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:g(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:g(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...Xt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Xt.c4,useWidth:void 0,personFont:g(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Xt.flowchart,inheritDir:!1},external_personFont:g(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:g(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:g(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:g(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:g(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:g(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:g(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:g(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:g(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:g(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:g(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:g(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:g(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:g(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:g(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:g(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:g(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:g(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:g(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:g(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Xt.pie,useWidth:984},xyChart:{...Xt.xyChart,useWidth:void 0},requirement:{...Xt.requirement,useWidth:void 0},packet:{...Xt.packet},radar:{...Xt.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},Nl=g((t,e="")=>Object.keys(t).reduce((r,i)=>Array.isArray(t[i])?r:typeof t[i]=="object"&&t[i]!==null?[...r,e+i,...Nl(t[i],"")]:[...r,e+i],[]),"keyify"),Cf=new Set(Nl(Rl,"")),jl=Rl,Pi=g(t=>{if(F.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Pi(e));return}for(const e of Object.keys(t)){if(F.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Cf.has(e)||t[e]==null){F.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){F.debug("sanitizing object",e),Pi(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)e.includes(i)&&(F.debug("sanitizing css option",e),t[e]=wf(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}F.debug("After sanitization",t)}},"sanitizeDirective"),wf=g(t=>{let e=0,r=0;for(const i of t){if(e<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?e++:i==="}"&&r++}return e!==r?"{ /* ERROR: Unbalanced CSS */ }":t},"sanitizeCss"),or=Object.freeze(jl),At=gt({},or),zi,Ne=[],qr=gt({},or),wn=g((t,e)=>{let r=gt({},t),i={};for(const n of e)Yl(n),i=gt(i,n);if(r=gt(r,i),i.theme&&i.theme in he){const n=gt({},zi),a=gt(n.themeVariables||{},i.themeVariables);r.theme&&r.theme in he&&(r.themeVariables=he[r.theme].getThemeVariables(a))}return qr=r,Vl(qr),qr},"updateCurrentConfig"),_f=g(t=>(At=gt({},or),At=gt(At,t),t.theme&&he[t.theme]&&(At.themeVariables=he[t.theme].getThemeVariables(t.themeVariables)),wn(At,Ne),At),"setSiteConfig"),Sf=g(t=>{zi=gt({},t)},"saveConfigFromInitialize"),vf=g(t=>(At=gt(At,t),wn(At,Ne),At),"updateSiteConfig"),Wl=g(()=>gt({},At),"getSiteConfig"),Hl=g(t=>(Vl(t),gt(qr,t),St()),"setConfig"),St=g(()=>gt({},qr),"getConfig"),Yl=g(t=>{t&&(["secure",...At.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(F.debug(`Denied attempt to modify a secure key ${e}`,t[e]),delete t[e])}),Object.keys(t).forEach(e=>{e.startsWith("__")&&delete t[e]}),Object.keys(t).forEach(e=>{typeof t[e]=="string"&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],typeof t[e]=="object"&&Yl(t[e])}))},"sanitize"),Tf=g(t=>{Pi(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Ne.push(t),wn(At,Ne)},"addDirective"),qi=g((t=At)=>{Ne=[],wn(t,Ne)},"reset"),Bf={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},oo={},Mf=g(t=>{oo[t]||(F.warn(Bf[t]),oo[t]=!0)},"issueWarning"),Vl=g(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Mf("LAZY_LOAD_DEPRECATED")},"checkConfig"),BT=g(()=>{let t={};zi&&(t=gt(t,zi));for(const e of Ne)t=gt(t,e);return t},"getUserDefinedConfig"),ii=/<br\s*\/?>/gi,$f=g(t=>t?Xl(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Lf=(()=>{let t=!1;return()=>{t||(Ul(),t=!0)}})();function Ul(){const t="data-temp-href-target";sr.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),sr.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))})}g(Ul,"setupDompurifyHooks");var Gl=g(t=>(Lf(),sr.sanitize(t)),"removeScript"),lo=g((t,e)=>{if(e.flowchart?.htmlLabels!==!1){const r=e.securityLevel;r==="antiscript"||r==="strict"?t=Gl(t):r!=="loose"&&(t=Xl(t),t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"),t=t.replace(/=/g,"&equals;"),t=Of(t))}return t},"sanitizeMore"),qt=g((t,e)=>t&&(e.dompurifyConfig?t=sr.sanitize(lo(t,e),e.dompurifyConfig).toString():t=sr.sanitize(lo(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),Ff=g((t,e)=>typeof t=="string"?qt(t,e):t.flat().map(r=>qt(r,e)),"sanitizeTextOrArray"),Af=g(t=>ii.test(t),"hasBreaks"),Ef=g(t=>t.split(ii),"splitBreaks"),Of=g(t=>t.replace(/#br#/g,"<br/>"),"placeholderToBreak"),Xl=g(t=>t.replace(ii,"#br#"),"breakToPlaceholder"),Df=g(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),yt=g(t=>!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),If=g(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),Pf=g(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),ho=g(function(t){const e=t.split(/(,)/),r=[];for(let i=0;i<e.length;i++){let n=e[i];if(n===","&&i>0&&i+1<e.length){const a=e[i-1],o=e[i+1];zf(a,o)&&(n=a+","+o,i++,r.pop())}r.push(qf(n))}return r.join("")},"parseGenericTypes"),ca=g((t,e)=>Math.max(0,t.split(e).length-1),"countOccurrence"),zf=g((t,e)=>{const r=ca(t,"~"),i=ca(e,"~");return r===1&&i===1},"shouldCombineSets"),qf=g(t=>{const e=ca(t,"~");let r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const i=[...t];let n=i.indexOf("~"),a=i.lastIndexOf("~");for(;n!==-1&&a!==-1&&n!==a;)i[n]="<",i[a]=">",n=i.indexOf("~"),a=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),co=g(()=>window.MathMLElement!==void 0,"isMathMLSupported"),da=/\$\$(.*)\$\$/g,lr=g(t=>(t.match(da)?.length??0)>0,"hasKatex"),MT=g(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await as(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),Rf=g(async(t,e)=>{if(!lr(t))return t;if(!(co()||e.legacyMathML||e.forceLegacyMathML))return t.replace(da,"MathML is unsupported in this environment.");{const{default:r}=await ot(async()=>{const{default:n}=await import("./katex-DGORuje8.chunk.mjs");return{default:n}},[],import.meta.url),i=e.forceLegacyMathML||!co()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(ii).map(n=>lr(n)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${n}</div>`:`<div>${n}</div>`).join("").replace(da,(n,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),as=g(async(t,e)=>qt(await Rf(t,e),e),"renderKatexSanitized"),gr={getRows:$f,sanitizeText:qt,sanitizeTextOrArray:Ff,hasBreaks:Af,splitBreaks:Ef,lineBreakRegex:ii,removeScript:Gl,getUrl:Df,evaluate:yt,getMax:If,getMin:Pf},Nf=g(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),jf=g(function(t,e,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${e}px;`)):(i.set("height",t),i.set("width",e)),i},"calculateSvgSizeAttrs"),Zl=g(function(t,e,r,i){const n=jf(e,r,i);Nf(t,n)},"configureSvgSize"),Wf=g(function(t,e,r,i){const n=e.node().getBBox(),a=n.width,o=n.height;F.info(`SVG bounds: ${a}x${o}`,n);let s=0,l=0;F.info(`Graph bounds: ${s}x${l}`,t),s=a+r*2,l=o+r*2,F.info(`Calculated bounds: ${s}x${l}`),Zl(e,l,s,i);const h=`${n.x-r} ${n.y-r} ${n.width+2*r} ${n.height+2*r}`;e.attr("viewBox",h)},"setupGraphViewbox"),Si={},Hf=g((t,e,r)=>{let i="";return t in Si&&Si[t]?i=Si[t](r):F.warn(`No theme found for ${t}`),` & {
font-family: ${r.fontFamily};
font-size: ${r.fontSize};
fill: ${r.textColor}
}
@keyframes edge-animation-frame {
from {
stroke-dashoffset: 0;
}
}
@keyframes dash {
to {
stroke-dashoffset: 0;
}
}
& .edge-animation-slow {
stroke-dasharray: 9,5 !important;
stroke-dashoffset: 900;
animation: dash 50s linear infinite;
stroke-linecap: round;
}
& .edge-animation-fast {
stroke-dasharray: 9,5 !important;
stroke-dashoffset: 900;
animation: dash 20s linear infinite;
stroke-linecap: round;
}
/* Classes common for multiple diagrams */
& .error-icon {
fill: ${r.errorBkgColor};
}
& .error-text {
fill: ${r.errorTextColor};
stroke: ${r.errorTextColor};
}
& .edge-thickness-normal {
stroke-width: 1px;
}
& .edge-thickness-thick {
stroke-width: 3.5px
}
& .edge-pattern-solid {
stroke-dasharray: 0;
}
& .edge-thickness-invisible {
stroke-width: 0;
fill: none;
}
& .edge-pattern-dashed{
stroke-dasharray: 3;
}
.edge-pattern-dotted {
stroke-dasharray: 2;
}
& .marker {
fill: ${r.lineColor};
stroke: ${r.lineColor};
}
& .marker.cross {
stroke: ${r.lineColor};
}
& svg {
font-family: ${r.fontFamily};
font-size: ${r.fontSize};
}
& p {
margin: 0
}
${i}
${e}
`},"getStyles"),Yf=g((t,e)=>{e!==void 0&&(Si[t]=e)},"addStylesForDiagram"),Vf=Hf,Ql={};tf(Ql,{clear:()=>Uf,getAccDescription:()=>Qf,getAccTitle:()=>Xf,getDiagramTitle:()=>Jf,setAccDescription:()=>Zf,setAccTitle:()=>Gf,setDiagramTitle:()=>Kf});var ss="",os="",ls="",hs=g(t=>qt(t,St()),"sanitizeText"),Uf=g(()=>{ss="",ls="",os=""},"clear"),Gf=g(t=>{ss=hs(t).replace(/^\s+/g,"")},"setAccTitle"),Xf=g(()=>ss,"getAccTitle"),Zf=g(t=>{ls=hs(t).replace(/\n\s+/g,`
`)},"setAccDescription"),Qf=g(()=>ls,"getAccDescription"),Kf=g(t=>{os=hs(t)},"setDiagramTitle"),Jf=g(()=>os,"getDiagramTitle"),uo=F,ty=is,st=St,$T=Hl,LT=or,cs=g(t=>qt(t,st()),"sanitizeText"),ey=Wf,ry=g(()=>Ql,"getCommonDb"),Ri={},Ni=g((t,e,r)=>{Ri[t]&&uo.warn(`Diagram with id ${t} already registered. Overwriting.`),Ri[t]=e,r&&ql(t,r),Yf(t,e.styles),e.injectUtils?.(uo,ty,st,cs,ey,ry(),()=>{})},"registerDiagram"),ua=g(t=>{if(t in Ri)return Ri[t];throw new iy(t)},"getDiagram"),iy=class extends Error{static{g(this,"DiagramNotFoundError")}constructor(t){super(`Diagram ${t} not found.`)}},ny={value:()=>{}};function Kl(){for(var t=0,e=arguments.length,r={},i;t<e;++t){if(!(i=arguments[t]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new vi(r)}function vi(t){this._=t}function ay(t,e){return t.trim().split(/^|\s+/).map(function(r){var i="",n=r.indexOf(".");if(n>=0&&(i=r.slice(n+1),r=r.slice(0,n)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}vi.prototype=Kl.prototype={constructor:vi,on:function(t,e){var r=this._,i=ay(t+"",r),n,a=-1,o=i.length;if(arguments.length<2){for(;++a<o;)if((n=(t=i[a]).type)&&(n=sy(r[n],t.name)))return n;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(n=(t=i[a]).type)r[n]=po(r[n],t.name,e);else if(e==null)for(n in r)r[n]=po(r[n],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new vi(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var r=new Array(n),i=0,n,a;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],i=0,n=a.length;i<n;++i)a[i].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],n=0,a=i.length;n<a;++n)i[n].value.apply(e,r)}};function sy(t,e){for(var r=0,i=t.length,n;r<i;++r)if((n=t[r]).name===e)return n.value}function po(t,e,r){for(var i=0,n=t.length;i<n;++i)if(t[i].name===e){t[i]=ny,t=t.slice(0,i).concat(t.slice(i+1));break}return r!=null&&t.push({name:e,value:r}),t}var pa="http://www.w3.org/1999/xhtml";const go={svg:"http://www.w3.org/2000/svg",xhtml:pa,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _n(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),go.hasOwnProperty(e)?{space:go[e],local:t}:t}function oy(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===pa&&e.documentElement.namespaceURI===pa?e.createElement(t):e.createElementNS(r,t)}}function ly(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Jl(t){var e=_n(t);return(e.local?ly:oy)(e)}function hy(){}function ds(t){return t==null?hy:function(){return this.querySelector(t)}}function cy(t){typeof t!="function"&&(t=ds(t));for(var e=this._groups,r=e.length,i=new Array(r),n=0;n<r;++n)for(var a=e[n],o=a.length,s=i[n]=new Array(o),l,h,c=0;c<o;++c)(l=a[c])&&(h=t.call(l,l.__data__,c,a))&&("__data__"in l&&(h.__data__=l.__data__),s[c]=h);return new It(i,this._parents)}function dy(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function uy(){return[]}function th(t){return t==null?uy:function(){return this.querySelectorAll(t)}}function py(t){return function(){return dy(t.apply(this,arguments))}}function gy(t){typeof t=="function"?t=py(t):t=th(t);for(var e=this._groups,r=e.length,i=[],n=[],a=0;a<r;++a)for(var o=e[a],s=o.length,l,h=0;h<s;++h)(l=o[h])&&(i.push(t.call(l,l.__data__,h,o)),n.push(l));return new It(i,n)}function eh(t){return function(){return this.matches(t)}}function rh(t){return function(e){return e.matches(t)}}var fy=Array.prototype.find;function yy(t){return function(){return fy.call(this.children,t)}}function my(){return this.firstElementChild}function xy(t){return this.select(t==null?my:yy(typeof t=="function"?t:rh(t)))}var by=Array.prototype.filter;function ky(){return Array.from(this.children)}function Cy(t){return function(){return by.call(this.children,t)}}function wy(t){return this.selectAll(t==null?ky:Cy(typeof t=="function"?t:rh(t)))}function _y(t){typeof t!="function"&&(t=eh(t));for(var e=this._groups,r=e.length,i=new Array(r),n=0;n<r;++n)for(var a=e[n],o=a.length,s=i[n]=[],l,h=0;h<o;++h)(l=a[h])&&t.call(l,l.__data__,h,a)&&s.push(l);return new It(i,this._parents)}function ih(t){return new Array(t.length)}function Sy(){return new It(this._enter||this._groups.map(ih),this._parents)}function ji(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ji.prototype={constructor:ji,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)}};function vy(t){return function(){return t}}function Ty(t,e,r,i,n,a){for(var o=0,s,l=e.length,h=a.length;o<h;++o)(s=e[o])?(s.__data__=a[o],i[o]=s):r[o]=new ji(t,a[o]);for(;o<l;++o)(s=e[o])&&(n[o]=s)}function By(t,e,r,i,n,a,o){var s,l,h=new Map,c=e.length,d=a.length,u=new Array(c),p;for(s=0;s<c;++s)(l=e[s])&&(u[s]=p=o.call(l,l.__data__,s,e)+"",h.has(p)?n[s]=l:h.set(p,l));for(s=0;s<d;++s)p=o.call(t,a[s],s,a)+"",(l=h.get(p))?(i[s]=l,l.__data__=a[s],h.delete(p)):r[s]=new ji(t,a[s]);for(s=0;s<c;++s)(l=e[s])&&h.get(u[s])===l&&(n[s]=l)}function My(t){return t.__data__}function $y(t,e){if(!arguments.length)return Array.from(this,My);var r=e?By:Ty,i=this._parents,n=this._groups;typeof t!="function"&&(t=vy(t));for(var a=n.length,o=new Array(a),s=new Array(a),l=new Array(a),h=0;h<a;++h){var c=i[h],d=n[h],u=d.length,p=Ly(t.call(c,c&&c.__data__,h,i)),f=p.length,y=s[h]=new Array(f),m=o[h]=new Array(f),x=l[h]=new Array(u);r(c,d,y,m,x,p,e);for(var b=0,k=0,_,C;b<f;++b)if(_=y[b]){for(b>=k&&(k=b+1);!(C=m[k])&&++k<f;);_._next=C||null}}return o=new It(o,i),o._enter=s,o._exit=l,o}function Ly(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Fy(){return new It(this._exit||this._groups.map(ih),this._parents)}function Ay(t,e,r){var i=this.enter(),n=this,a=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(n=e(n),n&&(n=n.selection())),r==null?a.remove():r(a),i&&n?i.merge(n).order():n}function Ey(t){for(var e=t.selection?t.selection():t,r=this._groups,i=e._groups,n=r.length,a=i.length,o=Math.min(n,a),s=new Array(n),l=0;l<o;++l)for(var h=r[l],c=i[l],d=h.length,u=s[l]=new Array(d),p,f=0;f<d;++f)(p=h[f]||c[f])&&(u[f]=p);for(;l<n;++l)s[l]=r[l];return new It(s,this._parents)}function Oy(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var i=t[e],n=i.length-1,a=i[n],o;--n>=0;)(o=i[n])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Dy(t){t||(t=Iy);function e(d,u){return d&&u?t(d.__data__,u.__data__):!d-!u}for(var r=this._groups,i=r.length,n=new Array(i),a=0;a<i;++a){for(var o=r[a],s=o.length,l=n[a]=new Array(s),h,c=0;c<s;++c)(h=o[c])&&(l[c]=h);l.sort(e)}return new It(n,this._parents).order()}function Iy(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Py(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function zy(){return Array.from(this)}function qy(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var i=t[e],n=0,a=i.length;n<a;++n){var o=i[n];if(o)return o}return null}function Ry(){let t=0;for(const e of this)++t;return t}function Ny(){return!this.node()}function jy(t){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var n=e[r],a=0,o=n.length,s;a<o;++a)(s=n[a])&&t.call(s,s.__data__,a,n);return this}function Wy(t){return function(){this.removeAttribute(t)}}function Hy(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Yy(t,e){return function(){this.setAttribute(t,e)}}function Vy(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Uy(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function Gy(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function Xy(t,e){var r=_n(t);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((e==null?r.local?Hy:Wy:typeof e=="function"?r.local?Gy:Uy:r.local?Vy:Yy)(r,e))}function nh(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Zy(t){return function(){this.style.removeProperty(t)}}function Qy(t,e,r){return function(){this.style.setProperty(t,e,r)}}function Ky(t,e,r){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,r)}}function Jy(t,e,r){return arguments.length>1?this.each((e==null?Zy:typeof e=="function"?Ky:Qy)(t,e,r??"")):hr(this.node(),t)}function hr(t,e){return t.style.getPropertyValue(e)||nh(t).getComputedStyle(t,null).getPropertyValue(e)}function t0(t){return function(){delete this[t]}}function e0(t,e){return function(){this[t]=e}}function r0(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function i0(t,e){return arguments.length>1?this.each((e==null?t0:typeof e=="function"?r0:e0)(t,e)):this.node()[t]}function ah(t){return t.trim().split(/^|\s+/)}function us(t){return t.classList||new sh(t)}function sh(t){this._node=t,this._names=ah(t.getAttribute("class")||"")}sh.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(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}};function oh(t,e){for(var r=us(t),i=-1,n=e.length;++i<n;)r.add(e[i])}function lh(t,e){for(var r=us(t),i=-1,n=e.length;++i<n;)r.remove(e[i])}function n0(t){return function(){oh(this,t)}}function a0(t){return function(){lh(this,t)}}function s0(t,e){return function(){(e.apply(this,arguments)?oh:lh)(this,t)}}function o0(t,e){var r=ah(t+"");if(arguments.length<2){for(var i=us(this.node()),n=-1,a=r.length;++n<a;)if(!i.contains(r[n]))return!1;return!0}return this.each((typeof e=="function"?s0:e?n0:a0)(r,e))}function l0(){this.textContent=""}function h0(t){return function(){this.textContent=t}}function c0(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function d0(t){return arguments.length?this.each(t==null?l0:(typeof t=="function"?c0:h0)(t)):this.node().textContent}function u0(){this.innerHTML=""}function p0(t){return function(){this.innerHTML=t}}function g0(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function f0(t){return arguments.length?this.each(t==null?u0:(typeof t=="function"?g0:p0)(t)):this.node().innerHTML}function y0(){this.nextSibling&&this.parentNode.appendChild(this)}function m0(){return this.each(y0)}function x0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function b0(){return this.each(x0)}function k0(t){var e=typeof t=="function"?t:Jl(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function C0(){return null}function w0(t,e){var r=typeof t=="function"?t:Jl(t),i=e==null?C0:typeof e=="function"?e:ds(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function _0(){var t=this.parentNode;t&&t.removeChild(this)}function S0(){return this.each(_0)}function v0(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function T0(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function B0(t){return this.select(t?T0:v0)}function M0(t){return arguments.length?this.property("__data__",t):this.node().__data__}function $0(t){return function(e){t.call(this,e,this.__data__)}}function L0(t){return t.trim().split(/^|\s+/).map(function(e){var r="",i=e.indexOf(".");return i>=0&&(r=e.slice(i+1),e=e.slice(0,i)),{type:e,name:r}})}function F0(t){return function(){var e=this.__on;if(e){for(var r=0,i=-1,n=e.length,a;r<n;++r)a=e[r],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++i]=a;++i?e.length=i:delete this.__on}}}function A0(t,e,r){return function(){var i=this.__on,n,a=$0(e);if(i){for(var o=0,s=i.length;o<s;++o)if((n=i[o]).type===t.type&&n.name===t.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=a,n.options=r),n.value=e;return}}this.addEventListener(t.type,a,r),n={type:t.type,name:t.name,value:e,listener:a,options:r},i?i.push(n):this.__on=[n]}}function E0(t,e,r){var i=L0(t+""),n,a=i.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,h=s.length,c;l<h;++l)for(n=0,c=s[l];n<a;++n)if((o=i[n]).type===c.type&&o.name===c.name)return c.value}return}for(s=e?A0:F0,n=0;n<a;++n)this.each(s(i[n],e,r));return this}function hh(t,e,r){var i=nh(t),n=i.CustomEvent;typeof n=="function"?n=new n(e,r):(n=i.document.createEvent("Event"),r?(n.initEvent(e,r.bubbles,r.cancelable),n.detail=r.detail):n.initEvent(e,!1,!1)),t.dispatchEvent(n)}function O0(t,e){return function(){return hh(this,t,e)}}function D0(t,e){return function(){return hh(this,t,e.apply(this,arguments))}}function I0(t,e){return this.each((typeof e=="function"?D0:O0)(t,e))}function*P0(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var i=t[e],n=0,a=i.length,o;n<a;++n)(o=i[n])&&(yield o)}var ch=[null];function It(t,e){this._groups=t,this._parents=e}function jr(){return new It([[document.documentElement]],ch)}function z0(){return this}It.prototype=jr.prototype={constructor:It,select:cy,selectAll:gy,selectChild:xy,selectChildren:wy,filter:_y,data:$y,enter:Sy,exit:Fy,join:Ay,merge:Ey,selection:z0,order:Oy,sort:Dy,call:Py,nodes:zy,node:qy,size:Ry,empty:Ny,each:jy,attr:Xy,style:Jy,property:i0,classed:o0,text:d0,html:f0,raise:m0,lower:b0,append:k0,insert:w0,remove:S0,clone:B0,datum:M0,on:E0,dispatch:I0,[Symbol.iterator]:P0};function it(t){return typeof t=="string"?new It([[document.querySelector(t)]],[document.documentElement]):new It([[t]],ch)}function ps(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function dh(t,e){var r=Object.create(t.prototype);for(var i in e)r[i]=e[i];return r}function ni(){}var Wr=.7,Wi=1/Wr,nr="\\s*([+-]?\\d+)\\s*",Hr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",q0=/^#([0-9a-f]{3,8})$/,R0=new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`),N0=new RegExp(`^rgb\\(${Jt},${Jt},${Jt}\\)$`),j0=new RegExp(`^rgba\\(${nr},${nr},${nr},${Hr}\\)$`),W0=new RegExp(`^rgba\\(${Jt},${Jt},${Jt},${Hr}\\)$`),H0=new RegExp(`^hsl\\(${Hr},${Jt},${Jt}\\)$`),Y0=new RegExp(`^hsla\\(${Hr},${Jt},${Jt},${Hr}\\)$`),fo={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ps(ni,Yr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:yo,formatHex:yo,formatHex8:V0,formatHsl:U0,formatRgb:mo,toString:mo});function yo(){return this.rgb().formatHex()}function V0(){return this.rgb().formatHex8()}function U0(){return uh(this).formatHsl()}function mo(){return this.rgb().formatRgb()}function Yr(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=q0.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?xo(e):r===3?new Ot(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?pi(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?pi(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=R0.exec(t))?new Ot(e[1],e[2],e[3],1):(e=N0.exec(t))?new Ot(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=j0.exec(t))?pi(e[1],e[2],e[3],e[4]):(e=W0.exec(t))?pi(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=H0.exec(t))?Co(e[1],e[2]/100,e[3]/100,1):(e=Y0.exec(t))?Co(e[1],e[2]/100,e[3]/100,e[4]):fo.hasOwnProperty(t)?xo(fo[t]):t==="transparent"?new Ot(NaN,NaN,NaN,0):null}function xo(t){return new Ot(t>>16&255,t>>8&255,t&255,1)}function pi(t,e,r,i){return i<=0&&(t=e=r=NaN),new Ot(t,e,r,i)}function G0(t){return t instanceof ni||(t=Yr(t)),t?(t=t.rgb(),new Ot(t.r,t.g,t.b,t.opacity)):new Ot}function ga(t,e,r,i){return arguments.length===1?G0(t):new Ot(t,e,r,i??1)}function Ot(t,e,r,i){this.r=+t,this.g=+e,this.b=+r,this.opacity=+i}ps(Ot,ga,dh(ni,{brighter(t){return t=t==null?Wi:Math.pow(Wi,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Wr:Math.pow(Wr,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ot(qe(this.r),qe(this.g),qe(this.b),Hi(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:bo,formatHex:bo,formatHex8:X0,formatRgb:ko,toString:ko}));function bo(){return`#${De(this.r)}${De(this.g)}${De(this.b)}`}function X0(){return`#${De(this.r)}${De(this.g)}${De(this.b)}${De((isNaN(this.opacity)?1:this.opacity)*255)}`}function ko(){const t=Hi(this.opacity);return`${t===1?"rgb(":"rgba("}${qe(this.r)}, ${qe(this.g)}, ${qe(this.b)}${t===1?")":`, ${t})`}`}function Hi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function qe(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function De(t){return t=qe(t),(t<16?"0":"")+t.toString(16)}function Co(t,e,r,i){return i<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Ht(t,e,r,i)}function uh(t){if(t instanceof Ht)return new Ht(t.h,t.s,t.l,t.opacity);if(t instanceof ni||(t=Yr(t)),!t)return new Ht;if(t instanceof Ht)return t;t=t.rgb();var e=t.r/255,r=t.g/255,i=t.b/255,n=Math.min(e,r,i),a=Math.max(e,r,i),o=NaN,s=a-n,l=(a+n)/2;return s?(e===a?o=(r-i)/s+(r<i)*6:r===a?o=(i-e)/s+2:o=(e-r)/s+4,s/=l<.5?a+n:2-a-n,o*=60):s=l>0&&l<1?0:o,new Ht(o,s,l,t.opacity)}function Z0(t,e,r,i){return arguments.length===1?uh(t):new Ht(t,e,r,i??1)}function Ht(t,e,r,i){this.h=+t,this.s=+e,this.l=+r,this.opacity=+i}ps(Ht,Z0,dh(ni,{brighter(t){return t=t==null?Wi:Math.pow(Wi,t),new Ht(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Wr:Math.pow(Wr,t),new Ht(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,n=2*r-i;return new Ot(Vn(t>=240?t-240:t+120,n,i),Vn(t,n,i),Vn(t<120?t+240:t-120,n,i),this.opacity)},clamp(){return new Ht(wo(this.h),gi(this.s),gi(this.l),Hi(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(){const t=Hi(this.opacity);return`${t===1?"hsl(":"hsla("}${wo(this.h)}, ${gi(this.s)*100}%, ${gi(this.l)*100}%${t===1?")":`, ${t})`}`}}));function wo(t){return t=(t||0)%360,t<0?t+360:t}function gi(t){return Math.max(0,Math.min(1,t||0))}function Vn(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const gs=t=>()=>t;function ph(t,e){return function(r){return t+r*e}}function Q0(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(i){return Math.pow(t+i*e,r)}}function FT(t,e){var r=e-t;return r?ph(t,r>180||r<-180?r-360*Math.round(r/360):r):gs(isNaN(t)?e:t)}function K0(t){return(t=+t)==1?gh:function(e,r){return r-e?Q0(e,r,t):gs(isNaN(e)?r:e)}}function gh(t,e){var r=e-t;return r?ph(t,r):gs(isNaN(t)?e:t)}const _o=(function t(e){var r=K0(e);function i(n,a){var o=r((n=ga(n)).r,(a=ga(a)).r),s=r(n.g,a.g),l=r(n.b,a.b),h=gh(n.opacity,a.opacity);return function(c){return n.r=o(c),n.g=s(c),n.b=l(c),n.opacity=h(c),n+""}}return i.gamma=t,i})(1);function me(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var fa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Un=new RegExp(fa.source,"g");function J0(t){return function(){return t}}function tm(t){return function(e){return t(e)+""}}function em(t,e){var r=fa.lastIndex=Un.lastIndex=0,i,n,a,o=-1,s=[],l=[];for(t=t+"",e=e+"";(i=fa.exec(t))&&(n=Un.exec(e));)(a=n.index)>r&&(a=e.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(i=i[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:me(i,n)})),r=Un.lastIndex;return r<e.length&&(a=e.slice(r),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?tm(l[0].x):J0(e):(e=l.length,function(h){for(var c=0,d;c<e;++c)s[(d=l[c]).i]=d.x(h);return s.join("")})}var So=180/Math.PI,fh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function yh(t,e,r,i,n,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*r+e*i)&&(r-=t*l,i-=e*l),(s=Math.sqrt(r*r+i*i))&&(r/=s,i/=s,l/=s),t*i<e*r&&(t=-t,e=-e,l=-l,o=-o),{translateX:n,translateY:a,rotate:Math.atan2(e,t)*So,skewX:Math.atan(l)*So,scaleX:o,scaleY:s}}var fi;function rm(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?fh:yh(e.a,e.b,e.c,e.d,e.e,e.f)}function im(t){return t==null||(fi||(fi=document.createElementNS("http://www.w3.org/2000/svg","g")),fi.setAttribute("transform",t),!(t=fi.transform.baseVal.consolidate()))?fh:(t=t.matrix,yh(t.a,t.b,t.c,t.d,t.e,t.f))}function mh(t,e,r,i){function n(h){return h.length?h.pop()+" ":""}function a(h,c,d,u,p,f){if(h!==d||c!==u){var y=p.push("translate(",null,e,null,r);f.push({i:y-4,x:me(h,d)},{i:y-2,x:me(c,u)})}else(d||u)&&p.push("translate("+d+e+u+r)}function o(h,c,d,u){h!==c?(h-c>180?c+=360:c-h>180&&(h+=360),u.push({i:d.push(n(d)+"rotate(",null,i)-2,x:me(h,c)})):c&&d.push(n(d)+"rotate("+c+i)}function s(h,c,d,u){h!==c?u.push({i:d.push(n(d)+"skewX(",null,i)-2,x:me(h,c)}):c&&d.push(n(d)+"skewX("+c+i)}function l(h,c,d,u,p,f){if(h!==d||c!==u){var y=p.push(n(p)+"scale(",null,",",null,")");f.push({i:y-4,x:me(h,d)},{i:y-2,x:me(c,u)})}else(d!==1||u!==1)&&p.push(n(p)+"scale("+d+","+u+")")}return function(h,c){var d=[],u=[];return h=t(h),c=t(c),a(h.translateX,h.translateY,c.translateX,c.translateY,d,u),o(h.rotate,c.rotate,d,u),s(h.skewX,c.skewX,d,u),l(h.scaleX,h.scaleY,c.scaleX,c.scaleY,d,u),h=c=null,function(p){for(var f=-1,y=u.length,m;++f<y;)d[(m=u[f]).i]=m.x(p);return d.join("")}}}var nm=mh(rm,"px, ","px)","deg)"),am=mh(im,", ",")",")"),cr=0,$r=0,kr=0,xh=1e3,Yi,Lr,Vi=0,je=0,Sn=0,Vr=typeof performance=="object"&&performance.now?performance:Date,bh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function fs(){return je||(bh(sm),je=Vr.now()+Sn)}function sm(){je=0}function Ui(){this._call=this._time=this._next=null}Ui.prototype=kh.prototype={constructor:Ui,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?fs():+r)+(e==null?0:+e),!this._next&&Lr!==this&&(Lr?Lr._next=this:Yi=this,Lr=this),this._call=t,this._time=r,ya()},stop:function(){this._call&&(this._call=null,this._time=1/0,ya())}};function kh(t,e,r){var i=new Ui;return i.restart(t,e,r),i}function om(){fs(),++cr;for(var t=Yi,e;t;)(e=je-t._time)>=0&&t._call.call(void 0,e),t=t._next;--cr}function vo(){je=(Vi=Vr.now())+Sn,cr=$r=0;try{om()}finally{cr=0,hm(),je=0}}function lm(){var t=Vr.now(),e=t-Vi;e>xh&&(Sn-=e,Vi=t)}function hm(){for(var t,e=Yi,r,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:Yi=r);Lr=t,ya(i)}function ya(t){if(!cr){$r&&($r=clearTimeout($r));var e=t-je;e>24?(t<1/0&&($r=setTimeout(vo,t-Vr.now()-Sn)),kr&&(kr=clearInterval(kr))):(kr||(Vi=Vr.now(),kr=setInterval(lm,xh)),cr=1,bh(vo))}}function To(t,e,r){var i=new Ui;return e=e==null?0:+e,i.restart(n=>{i.stop(),t(n+e)},e,r),i}var cm=Kl("start","end","cancel","interrupt"),dm=[],Ch=0,Bo=1,ma=2,Ti=3,Mo=4,xa=5,Bi=6;function vn(t,e,r,i,n,a){var o=t.__transition;if(!o)t.__transition={};else if(r in o)return;um(t,r,{name:e,index:i,group:n,on:cm,tween:dm,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Ch})}function ys(t,e){var r=Gt(t,e);if(r.state>Ch)throw new Error("too late; already scheduled");return r}function re(t,e){var r=Gt(t,e);if(r.state>Ti)throw new Error("too late; already running");return r}function Gt(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function um(t,e,r){var i=t.__transition,n;i[e]=r,r.timer=kh(a,0,r.time);function a(h){r.state=Bo,r.timer.restart(o,r.delay,r.time),r.delay<=h&&o(h-r.delay)}function o(h){var c,d,u,p;if(r.state!==Bo)return l();for(c in i)if(p=i[c],p.name===r.name){if(p.state===Ti)return To(o);p.state===Mo?(p.state=Bi,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete i[c]):+c<e&&(p.state=Bi,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete i[c])}if(To(function(){r.state===Ti&&(r.state=Mo,r.timer.restart(s,r.delay,r.time),s(h))}),r.state=ma,r.on.call("start",t,t.__data__,r.index,r.group),r.state===ma){for(r.state=Ti,n=new Array(u=r.tween.length),c=0,d=-1;c<u;++c)(p=r.tween[c].value.call(t,t.__data__,r.index,r.group))&&(n[++d]=p);n.length=d+1}}function s(h){for(var c=h<r.duration?r.ease.call(null,h/r.duration):(r.timer.restart(l),r.state=xa,1),d=-1,u=n.length;++d<u;)n[d].call(t,c);r.state===xa&&(r.on.call("end",t,t.__data__,r.index,r.group),l())}function l(){r.state=Bi,r.timer.stop(),delete i[e];for(var h in i)return;delete t.__transition}}function pm(t,e){var r=t.__transition,i,n,a=!0,o;if(r){e=e==null?null:e+"";for(o in r){if((i=r[o]).name!==e){a=!1;continue}n=i.state>ma&&i.state<xa,i.state=Bi,i.timer.stop(),i.on.call(n?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete r[o]}a&&delete t.__transition}}function gm(t){return this.each(function(){pm(this,t)})}function fm(t,e){var r,i;return function(){var n=re(this,t),a=n.tween;if(a!==r){i=r=a;for(var o=0,s=i.length;o<s;++o)if(i[o].name===e){i=i.slice(),i.splice(o,1);break}}n.tween=i}}function ym(t,e,r){var i,n;if(typeof r!="function")throw new Error;return function(){var a=re(this,t),o=a.tween;if(o!==i){n=(i=o).slice();for(var s={name:e,value:r},l=0,h=n.length;l<h;++l)if(n[l].name===e){n[l]=s;break}l===h&&n.push(s)}a.tween=n}}function mm(t,e){var r=this._id;if(t+="",arguments.length<2){for(var i=Gt(this.node(),r).tween,n=0,a=i.length,o;n<a;++n)if((o=i[n]).name===t)return o.value;return null}return this.each((e==null?fm:ym)(r,t,e))}function ms(t,e,r){var i=t._id;return t.each(function(){var n=re(this,i);(n.value||(n.value={}))[e]=r.apply(this,arguments)}),function(n){return Gt(n,i).value[e]}}function wh(t,e){var r;return(typeof e=="number"?me:e instanceof Yr?_o:(r=Yr(e))?(e=r,_o):em)(t,e)}function xm(t){return function(){this.removeAttribute(t)}}function bm(t){return function(){this.removeAttributeNS(t.space,t.local)}}function km(t,e,r){var i,n=r+"",a;return function(){var o=this.getAttribute(t);return o===n?null:o===i?a:a=e(i=o,r)}}function Cm(t,e,r){var i,n=r+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===n?null:o===i?a:a=e(i=o,r)}}function wm(t,e,r){var i,n,a;return function(){var o,s=r(this),l;return s==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=s+"",o===l?null:o===i&&l===n?a:(n=l,a=e(i=o,s)))}}function _m(t,e,r){var i,n,a;return function(){var o,s=r(this),l;return s==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=s+"",o===l?null:o===i&&l===n?a:(n=l,a=e(i=o,s)))}}function Sm(t,e){var r=_n(t),i=r==="transform"?am:wh;return this.attrTween(t,typeof e=="function"?(r.local?_m:wm)(r,i,ms(this,"attr."+t,e)):e==null?(r.local?bm:xm)(r):(r.local?Cm:km)(r,i,e))}function vm(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function Tm(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function Bm(t,e){var r,i;function n(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&Tm(t,a)),r}return n._value=e,n}function Mm(t,e){var r,i;function n(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&vm(t,a)),r}return n._value=e,n}function $m(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var i=_n(t);return this.tween(r,(i.local?Bm:Mm)(i,e))}function Lm(t,e){return function(){ys(this,t).delay=+e.apply(this,arguments)}}function Fm(t,e){return e=+e,function(){ys(this,t).delay=e}}function Am(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Lm:Fm)(e,t)):Gt(this.node(),e).delay}function Em(t,e){return function(){re(this,t).duration=+e.apply(this,arguments)}}function Om(t,e){return e=+e,function(){re(this,t).duration=e}}function Dm(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Em:Om)(e,t)):Gt(this.node(),e).duration}function Im(t,e){if(typeof e!="function")throw new Error;return function(){re(this,t).ease=e}}function Pm(t){var e=this._id;return arguments.length?this.each(Im(e,t)):Gt(this.node(),e).ease}function zm(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;re(this,t).ease=r}}function qm(t){if(typeof t!="function")throw new Error;return this.each(zm(this._id,t))}function Rm(t){typeof t!="function"&&(t=eh(t));for(var e=this._groups,r=e.length,i=new Array(r),n=0;n<r;++n)for(var a=e[n],o=a.length,s=i[n]=[],l,h=0;h<o;++h)(l=a[h])&&t.call(l,l.__data__,h,a)&&s.push(l);return new de(i,this._parents,this._name,this._id)}function Nm(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,i=e.length,n=r.length,a=Math.min(i,n),o=new Array(i),s=0;s<a;++s)for(var l=e[s],h=r[s],c=l.length,d=o[s]=new Array(c),u,p=0;p<c;++p)(u=l[p]||h[p])&&(d[p]=u);for(;s<i;++s)o[s]=e[s];return new de(o,this._parents,this._name,this._id)}function jm(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function Wm(t,e,r){var i,n,a=jm(e)?ys:re;return function(){var o=a(this,t),s=o.on;s!==i&&(n=(i=s).copy()).on(e,r),o.on=n}}function Hm(t,e){var r=this._id;return arguments.length<2?Gt(this.node(),r).on.on(t):this.each(Wm(r,t,e))}function Ym(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Vm(){return this.on("end.remove",Ym(this._id))}function Um(t){var e=this._name,r=this._id;typeof t!="function"&&(t=ds(t));for(var i=this._groups,n=i.length,a=new Array(n),o=0;o<n;++o)for(var s=i[o],l=s.length,h=a[o]=new Array(l),c,d,u=0;u<l;++u)(c=s[u])&&(d=t.call(c,c.__data__,u,s))&&("__data__"in c&&(d.__data__=c.__data__),h[u]=d,vn(h[u],e,r,u,h,Gt(c,r)));return new de(a,this._parents,e,r)}function Gm(t){var e=this._name,r=this._id;typeof t!="function"&&(t=th(t));for(var i=this._groups,n=i.length,a=[],o=[],s=0;s<n;++s)for(var l=i[s],h=l.length,c,d=0;d<h;++d)if(c=l[d]){for(var u=t.call(c,c.__data__,d,l),p,f=Gt(c,r),y=0,m=u.length;y<m;++y)(p=u[y])&&vn(p,e,r,y,u,f);a.push(u),o.push(c)}return new de(a,o,e,r)}var Xm=jr.prototype.constructor;function Zm(){return new Xm(this._groups,this._parents)}function Qm(t,e){var r,i,n;return function(){var a=hr(this,t),o=(this.style.removeProperty(t),hr(this,t));return a===o?null:a===r&&o===i?n:n=e(r=a,i=o)}}function _h(t){return function(){this.style.removeProperty(t)}}function Km(t,e,r){var i,n=r+"",a;return function(){var o=hr(this,t);return o===n?null:o===i?a:a=e(i=o,r)}}function Jm(t,e,r){var i,n,a;return function(){var o=hr(this,t),s=r(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(t),hr(this,t))),o===l?null:o===i&&l===n?a:(n=l,a=e(i=o,s))}}function tx(t,e){var r,i,n,a="style."+e,o="end."+a,s;return function(){var l=re(this,t),h=l.on,c=l.value[a]==null?s||(s=_h(e)):void 0;(h!==r||n!==c)&&(i=(r=h).copy()).on(o,n=c),l.on=i}}function ex(t,e,r){var i=(t+="")=="transform"?nm:wh;return e==null?this.styleTween(t,Qm(t,i)).on("end.style."+t,_h(t)):typeof e=="function"?this.styleTween(t,Jm(t,i,ms(this,"style."+t,e))).each(tx(this._id,t)):this.styleTween(t,Km(t,i,e),r).on("end.style."+t,null)}function rx(t,e,r){return function(i){this.style.setProperty(t,e.call(this,i),r)}}function ix(t,e,r){var i,n;function a(){var o=e.apply(this,arguments);return o!==n&&(i=(n=o)&&rx(t,o,r)),i}return a._value=e,a}function nx(t,e,r){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;return this.tween(i,ix(t,e,r??""))}function ax(t){return function(){this.textContent=t}}function sx(t){return function(){var e=t(this);this.textContent=e??""}}function ox(t){return this.tween("text",typeof t=="function"?sx(ms(this,"text",t)):ax(t==null?"":t+""))}function lx(t){return function(e){this.textContent=t.call(this,e)}}function hx(t){var e,r;function i(){var n=t.apply(this,arguments);return n!==r&&(e=(r=n)&&lx(n)),e}return i._value=t,i}function cx(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,hx(t))}function dx(){for(var t=this._name,e=this._id,r=Sh(),i=this._groups,n=i.length,a=0;a<n;++a)for(var o=i[a],s=o.length,l,h=0;h<s;++h)if(l=o[h]){var c=Gt(l,e);vn(l,t,r,h,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new de(i,this._parents,t,r)}function ux(){var t,e,r=this,i=r._id,n=r.size();return new Promise(function(a,o){var s={value:o},l={value:function(){--n===0&&a()}};r.each(function(){var h=re(this,i),c=h.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),h.on=e}),n===0&&a()})}var px=0;function de(t,e,r,i){this._groups=t,this._parents=e,this._name=r,this._id=i}function Sh(){return++px}var ae=jr.prototype;de.prototype={constructor:de,select:Um,selectAll:Gm,selectChild:ae.selectChild,selectChildren:ae.selectChildren,filter:Rm,merge:Nm,selection:Zm,transition:dx,call:ae.call,nodes:ae.nodes,node:ae.node,size:ae.size,empty:ae.empty,each:ae.each,on:Hm,attr:Sm,attrTween:$m,style:ex,styleTween:nx,text:ox,textTween:cx,remove:Vm,tween:mm,delay:Am,duration:Dm,ease:Pm,easeVarying:qm,end:ux,[Symbol.iterator]:ae[Symbol.iterator]};function gx(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var fx={time:null,delay:0,duration:250,ease:gx};function yx(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function mx(t){var e,r;t instanceof de?(e=t._id,t=t._name):(e=Sh(),(r=fx).time=fs(),t=t==null?null:t+"");for(var i=this._groups,n=i.length,a=0;a<n;++a)for(var o=i[a],s=o.length,l,h=0;h<s;++h)(l=o[h])&&vn(l,t,e,h,o,r||yx(l,e));return new de(i,this._parents,t,e)}jr.prototype.interrupt=gm,jr.prototype.transition=mx;const ba=Math.PI,ka=2*ba,$e=1e-6,xx=ka-$e;function vh(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function bx(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return vh;const r=10**e;return function(i){this._+=i[0];for(let n=1,a=i.length;n<a;++n)this._+=Math.round(arguments[n]*r)/r+i[n]}}class kx{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?vh:bx(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,i,n){this._append`Q${+e},${+r},${this._x1=+i},${this._y1=+n}`}bezierCurveTo(e,r,i,n,a,o){this._append`C${+e},${+r},${+i},${+n},${this._x1=+a},${this._y1=+o}`}arcTo(e,r,i,n,a){if(e=+e,r=+r,i=+i,n=+n,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,s=this._y1,l=i-e,h=n-r,c=o-e,d=s-r,u=c*c+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(u>$e)if(!(Math.abs(d*l-h*c)>$e)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=i-o,f=n-s,y=l*l+h*h,m=p*p+f*f,x=Math.sqrt(y),b=Math.sqrt(u),k=a*Math.tan((ba-Math.acos((y+u-m)/(2*x*b)))/2),_=k/b,C=k/x;Math.abs(_-1)>$e&&this._append`L${e+_*c},${r+_*d}`,this._append`A${a},${a},0,0,${+(d*p>c*f)},${this._x1=e+C*l},${this._y1=r+C*h}`}}arc(e,r,i,n,a,o){if(e=+e,r=+r,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let s=i*Math.cos(n),l=i*Math.sin(n),h=e+s,c=r+l,d=1^o,u=o?n-a:a-n;this._x1===null?this._append`M${h},${c}`:(Math.abs(this._x1-h)>$e||Math.abs(this._y1-c)>$e)&&this._append`L${h},${c}`,i&&(u<0&&(u=u%ka+ka),u>xx?this._append`A${i},${i},0,1,${d},${e-s},${r-l}A${i},${i},0,1,${d},${this._x1=h},${this._y1=c}`:u>$e&&this._append`A${i},${i},0,${+(u>=ba)},${d},${this._x1=e+i*Math.cos(a)},${this._y1=r+i*Math.sin(a)}`)}rect(e,r,i,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${i=+i}v${+n}h${-i}Z`}toString(){return this._}}function Ze(t){return function(){return t}}const AT=Math.abs,ET=Math.atan2,OT=Math.cos,DT=Math.max,IT=Math.min,PT=Math.sin,zT=Math.sqrt,$o=1e-12,xs=Math.PI,Lo=xs/2,qT=2*xs;function RT(t){return t>1?0:t<-1?xs:Math.acos(t)}function NT(t){return t>=1?Lo:t<=-1?-Lo:Math.asin(t)}function Cx(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);e=i}return t},()=>new kx(e)}function wx(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Th(t){this._context=t}Th.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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);break}}};function Gi(t){return new Th(t)}function _x(t){return t[0]}function Sx(t){return t[1]}function vx(t,e){var r=Ze(!0),i=null,n=Gi,a=null,o=Cx(s);t=typeof t=="function"?t:t===void 0?_x:Ze(t),e=typeof e=="function"?e:e===void 0?Sx:Ze(e);function s(l){var h,c=(l=wx(l)).length,d,u=!1,p;for(i==null&&(a=n(p=o())),h=0;h<=c;++h)!(h<c&&r(d=l[h],h,l))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+t(d,h,l),+e(d,h,l));if(p)return a=null,p+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:Ze(+l),s):t},s.y=function(l){return arguments.length?(e=typeof l=="function"?l:Ze(+l),s):e},s.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Ze(!!l),s):r},s.curve=function(l){return arguments.length?(n=l,i!=null&&(a=n(i)),s):n},s.context=function(l){return arguments.length?(l==null?i=a=null:a=n(i=l),s):i},s}class Bh{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function Mh(t){return new Bh(t,!0)}function $h(t){return new Bh(t,!1)}function Ce(){}function Xi(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 Tn(t){this._context=t}Tn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Xi(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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:Xi(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Mi(t){return new Tn(t)}function Lh(t){this._context=t}Lh.prototype={areaStart:Ce,areaEnd:Ce,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,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);break}}},point:function(t,e){switch(t=+t,e=+e,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:Xi(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Tx(t){return new Lh(t)}function Fh(t){this._context=t}Fh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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:Xi(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Bx(t){return new Fh(t)}function Ah(t,e){this._basis=new Tn(t),this._beta=e}Ah.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=t[0],n=e[0],a=t[r]-i,o=e[r]-n,s=-1,l;++s<=r;)l=s/r,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+l*a),this._beta*e[s]+(1-this._beta)*(n+l*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Mx=(function t(e){function r(i){return e===1?new Tn(i):new Ah(i,e)}return r.beta=function(i){return t(+i)},r})(.85);function Zi(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 bs(t,e){this._context=t,this._k=(1-e)/6}bs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Zi(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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:Zi(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Eh=(function t(e){function r(i){return new bs(i,e)}return r.tension=function(i){return t(+i)},r})(0);function ks(t,e){this._context=t,this._k=(1-e)/6}ks.prototype={areaStart:Ce,areaEnd:Ce,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=NaN,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);break}}},point:function(t,e){switch(t=+t,e=+e,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:Zi(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const $x=(function t(e){function r(i){return new ks(i,e)}return r.tension=function(i){return t(+i)},r})(0);function Cs(t,e){this._context=t,this._k=(1-e)/6}Cs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,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:Zi(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Lx=(function t(e){function r(i){return new Cs(i,e)}return r.tension=function(i){return t(+i)},r})(0);function ws(t,e,r){var i=t._x1,n=t._y1,a=t._x2,o=t._y2;if(t._l01_a>$o){var s=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*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,n=(n*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>$o){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,o=(o*h+t._y1*t._l23_2a-r*t._l12_2a)/c}t._context.bezierCurveTo(i,n,a,o,t._x2,t._y2)}function Oh(t,e){this._context=t,this._alpha=e}Oh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,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);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,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:ws(this,t,e);break}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}};const Dh=(function t(e){function r(i){return e?new Oh(i,e):new bs(i,0)}return r.alpha=function(i){return t(+i)},r})(.5);function Ih(t,e){this._context=t,this._alpha=e}Ih.prototype={areaStart:Ce,areaEnd:Ce,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=NaN,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);break}}},point:function(t,e){if(t=+t,e=+e,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:ws(this,t,e);break}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}};const Fx=(function t(e){function r(i){return e?new Ih(i,e):new ks(i,0)}return r.alpha=function(i){return t(+i)},r})(.5);function Ph(t,e){this._context=t,this._alpha=e}Ph.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,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:ws(this,t,e);break}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}};const Ax=(function t(e){function r(i){return e?new Ph(i,e):new Cs(i,0)}return r.alpha=function(i){return t(+i)},r})(.5);function zh(t){this._context=t}zh.prototype={areaStart:Ce,areaEnd:Ce,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Ex(t){return new zh(t)}function Fo(t){return t<0?-1:1}function Ao(t,e,r){var i=t._x1-t._x0,n=e-t._x1,a=(t._y1-t._y0)/(i||n<0&&-0),o=(r-t._y1)/(n||i<0&&-0),s=(a*n+o*i)/(i+n);return(Fo(a)+Fo(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Eo(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Gn(t,e,r){var i=t._x0,n=t._y0,a=t._x1,o=t._y1,s=(a-i)/3;t._context.bezierCurveTo(i+s,n+s*e,a-s,o-s*r,a,o)}function Qi(t){this._context=t}Qi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Gn(this,this._t0,Eo(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===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,Gn(this,Eo(this,r=Ao(this,t,e)),r);break;default:Gn(this,this._t0,r=Ao(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function qh(t){this._context=new Rh(t)}(qh.prototype=Object.create(Qi.prototype)).point=function(t,e){Qi.prototype.point.call(this,e,t)};function Rh(t){this._context=t}Rh.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,n,a){this._context.bezierCurveTo(e,t,i,r,a,n)}};function Nh(t){return new Qi(t)}function jh(t){return new qh(t)}function Wh(t){this._context=t}Wh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},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]),r===2)this._context.lineTo(t[1],e[1]);else for(var i=Oo(t),n=Oo(e),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(i[0][a],n[0][a],i[1][a],n[1][a],t[o],e[o]);(this._line||this._line!==0&&r===1)&&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)}};function Oo(t){var e,r=t.length-1,i,n=new Array(r),a=new Array(r),o=new Array(r);for(n[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<r-1;++e)n[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(n[r-1]=2,a[r-1]=7,o[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)i=n[e]/a[e-1],a[e]-=i,o[e]-=i*o[e-1];for(n[r-1]=o[r-1]/a[r-1],e=r-2;e>=0;--e)n[e]=(o[e]-n[e+1])/a[e];for(a[r-1]=(t[r]+n[r-1])/2,e=0;e<r-1;++e)a[e]=2*t[e+1]-n[e+1];return[n,a]}function Hh(t){return new Wh(t)}function Bn(t,e){this._context=t,this._t=e}Bn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,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)}break}}this._x=t,this._y=e}};function Yh(t){return new Bn(t,.5)}function Vh(t){return new Bn(t,0)}function Uh(t){return new Bn(t,1)}function Cr(t,e,r){this.k=t,this.x=e,this.y=r}Cr.prototype={constructor:Cr,scale:function(t){return t===1?this:new Cr(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Cr(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+")"}},Cr.prototype;var Ox=g(t=>{const{securityLevel:e}=st();let r=it("body");if(e==="sandbox"){const i=it(`#i${t}`).node()?.contentDocument??document;r=it(i.body)}return r.select(`#${t}`)},"selectSvgElement");function _s(t){return typeof t>"u"||t===null}g(_s,"isNothing");function Gh(t){return typeof t=="object"&&t!==null}g(Gh,"isObject");function Xh(t){return Array.isArray(t)?t:_s(t)?[]:[t]}g(Xh,"toArray");function Zh(t,e){var r,i,n,a;if(e)for(a=Object.keys(e),r=0,i=a.length;r<i;r+=1)n=a[r],t[n]=e[n];return t}g(Zh,"extend");function Qh(t,e){var r="",i;for(i=0;i<e;i+=1)r+=t;return r}g(Qh,"repeat");function Kh(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}g(Kh,"isNegativeZero");var Dx=_s,Ix=Gh,Px=Xh,zx=Qh,qx=Kh,Rx=Zh,ft={isNothing:Dx,isObject:Ix,toArray:Px,repeat:zx,isNegativeZero:qx,extend:Rx};function Ss(t,e){var r="",i=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
`+t.mark.snippet),i+" "+r):i}g(Ss,"formatError");function Ke(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=Ss(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}g(Ke,"YAMLException$1"),Ke.prototype=Object.create(Error.prototype),Ke.prototype.constructor=Ke,Ke.prototype.toString=g(function(t){return this.name+": "+Ss(this,t)},"toString");var Et=Ke;function $i(t,e,r,i,n){var a="",o="",s=Math.floor(n/2)-1;return i-e>s&&(a=" ... ",e=i-s+a.length),r-i>s&&(o=" ...",r=i+s-o.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+o,pos:i-e+a.length}}g($i,"getLine");function Li(t,e){return ft.repeat(" ",e-t.length)+t}g(Li,"padStart");function Jh(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],n=[],a,o=-1;a=r.exec(t.buffer);)n.push(a.index),i.push(a.index+a[0].length),t.position<=a.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var s="",l,h,c=Math.min(t.line+e.linesAfter,n.length).toString().length,d=e.maxLength-(e.indent+c+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)h=$i(t.buffer,i[o-l],n[o-l],t.position-(i[o]-i[o-l]),d),s=ft.repeat(" ",e.indent)+Li((t.line-l+1).toString(),c)+" | "+h.str+`
`+s;for(h=$i(t.buffer,i[o],n[o],t.position,d),s+=ft.repeat(" ",e.indent)+Li((t.line+1).toString(),c)+" | "+h.str+`
`,s+=ft.repeat("-",e.indent+c+3+h.pos)+`^
`,l=1;l<=e.linesAfter&&!(o+l>=n.length);l++)h=$i(t.buffer,i[o+l],n[o+l],t.position-(i[o]-i[o+l]),d),s+=ft.repeat(" ",e.indent)+Li((t.line+l+1).toString(),c)+" | "+h.str+`
`;return s.replace(/\n$/,"")}g(Jh,"makeSnippet");var Nx=Jh,jx=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Wx=["scalar","sequence","mapping"];function tc(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(i){e[String(i)]=r})}),e}g(tc,"compileStyleAliases");function ec(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(jx.indexOf(r)===-1)throw new Et('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=tc(e.styleAliases||null),Wx.indexOf(this.kind)===-1)throw new Et('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}g(ec,"Type$1");var vt=ec;function Ca(t,e){var r=[];return t[e].forEach(function(i){var n=r.length;r.forEach(function(a,o){a.tag===i.tag&&a.kind===i.kind&&a.multi===i.multi&&(n=o)}),r[n]=i}),r}g(Ca,"compileList");function rc(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function i(n){n.multi?(t.multi[n.kind].push(n),t.multi.fallback.push(n)):t[n.kind][n.tag]=t.fallback[n.tag]=n}for(g(i,"collectType"),e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(i);return t}g(rc,"compileMap");function Fi(t){return this.extend(t)}g(Fi,"Schema$1"),Fi.prototype.extend=g(function(t){var e=[],r=[];if(t instanceof vt)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new Et("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.forEach(function(n){if(!(n instanceof vt))throw new Et("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&n.loadKind!=="scalar")throw new Et("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(n.multi)throw new Et("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(n){if(!(n instanceof vt))throw new Et("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Fi.prototype);return i.implicit=(this.implicit||[]).concat(e),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Ca(i,"implicit"),i.compiledExplicit=Ca(i,"explicit"),i.compiledTypeMap=rc(i.compiledImplicit,i.compiledExplicit),i},"extend");var Hx=Fi,Yx=new vt("tag:yaml.org,2002:str",{kind:"scalar",construct:g(function(t){return t!==null?t:""},"construct")}),Vx=new vt("tag:yaml.org,2002:seq",{kind:"sequence",construct:g(function(t){return t!==null?t:[]},"construct")}),Ux=new vt("tag:yaml.org,2002:map",{kind:"mapping",construct:g(function(t){return t!==null?t:{}},"construct")}),Gx=new Hx({explicit:[Yx,Vx,Ux]});function ic(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}g(ic,"resolveYamlNull");function nc(){return null}g(nc,"constructYamlNull");function ac(t){return t===null}g(ac,"isNull");var Xx=new vt("tag:yaml.org,2002:null",{kind:"scalar",resolve:ic,construct:nc,predicate:ac,represent:{canonical:g(function(){return"~"},"canonical"),lowercase:g(function(){return"null"},"lowercase"),uppercase:g(function(){return"NULL"},"uppercase"),camelcase:g(function(){return"Null"},"camelcase"),empty:g(function(){return""},"empty")},defaultStyle:"lowercase"});function sc(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}g(sc,"resolveYamlBoolean");function oc(t){return t==="true"||t==="True"||t==="TRUE"}g(oc,"constructYamlBoolean");function lc(t){return Object.prototype.toString.call(t)==="[object Boolean]"}g(lc,"isBoolean");var Zx=new vt("tag:yaml.org,2002:bool",{kind:"scalar",resolve:sc,construct:oc,predicate:lc,represent:{lowercase:g(function(t){return t?"true":"false"},"lowercase"),uppercase:g(function(t){return t?"TRUE":"FALSE"},"uppercase"),camelcase:g(function(t){return t?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function hc(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}g(hc,"isHexCode");function cc(t){return 48<=t&&t<=55}g(cc,"isOctCode");function dc(t){return 48<=t&&t<=57}g(dc,"isDecCode");function uc(t){if(t===null)return!1;var e=t.length,r=0,i=!1,n;if(!e)return!1;if(n=t[r],(n==="-"||n==="+")&&(n=t[++r]),n==="0"){if(r+1===e)return!0;if(n=t[++r],n==="b"){for(r++;r<e;r++)if(n=t[r],n!=="_"){if(n!=="0"&&n!=="1")return!1;i=!0}return i&&n!=="_"}if(n==="x"){for(r++;r<e;r++)if(n=t[r],n!=="_"){if(!hc(t.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}if(n==="o"){for(r++;r<e;r++)if(n=t[r],n!=="_"){if(!cc(t.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}}if(n==="_")return!1;for(;r<e;r++)if(n=t[r],n!=="_"){if(!dc(t.charCodeAt(r)))return!1;i=!0}return!(!i||n==="_")}g(uc,"resolveYamlInteger");function pc(t){var e=t,r=1,i;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),i=e[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),e=e.slice(1),i=e[0]),e==="0")return 0;if(i==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}g(pc,"constructYamlInteger");function gc(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!ft.isNegativeZero(t)}g(gc,"isInteger");var Qx=new vt("tag:yaml.org,2002:int",{kind:"scalar",resolve:uc,construct:pc,predicate:gc,represent:{binary:g(function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:g(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:g(function(t){return t.toString(10)},"decimal"),hexadecimal:g(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Kx=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function fc(t){return!(t===null||!Kx.test(t)||t[t.length-1]==="_")}g(fc,"resolveYamlFloat");function yc(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}g(yc,"constructYamlFloat");var Jx=/^[-+]?[0-9]+e/;function mc(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ft.isNegativeZero(t))return"-0.0";return r=t.toString(10),Jx.test(r)?r.replace("e",".e"):r}g(mc,"representYamlFloat");function xc(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||ft.isNegativeZero(t))}g(xc,"isFloat");var t1=new vt("tag:yaml.org,2002:float",{kind:"scalar",resolve:fc,construct:yc,predicate:xc,represent:mc,defaultStyle:"lowercase"}),bc=Gx.extend({implicit:[Xx,Zx,Qx,t1]}),e1=bc,kc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Cc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function wc(t){return t===null?!1:kc.exec(t)!==null||Cc.exec(t)!==null}g(wc,"resolveYamlTimestamp");function _c(t){var e,r,i,n,a,o,s,l=0,h=null,c,d,u;if(e=kc.exec(t),e===null&&(e=Cc.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],i=+e[2]-1,n=+e[3],!e[4])return new Date(Date.UTC(r,i,n));if(a=+e[4],o=+e[5],s=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(c=+e[10],d=+(e[11]||0),h=(c*60+d)*6e4,e[9]==="-"&&(h=-h)),u=new Date(Date.UTC(r,i,n,a,o,s,l)),h&&u.setTime(u.getTime()-h),u}g(_c,"constructYamlTimestamp");function Sc(t){return t.toISOString()}g(Sc,"representYamlTimestamp");var r1=new vt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:wc,construct:_c,instanceOf:Date,represent:Sc});function vc(t){return t==="<<"||t===null}g(vc,"resolveYamlMerge");var i1=new vt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:vc}),vs=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;function Tc(t){if(t===null)return!1;var e,r,i=0,n=t.length,a=vs;for(r=0;r<n;r++)if(e=a.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;i+=6}return i%8===0}g(Tc,"resolveYamlBinary");function Bc(t){var e,r,i=t.replace(/[\r\n=]/g,""),n=i.length,a=vs,o=0,s=[];for(e=0;e<n;e++)e%4===0&&e&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(i.charAt(e));return r=n%4*6,r===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):r===18?(s.push(o>>10&255),s.push(o>>2&255)):r===12&&s.push(o>>4&255),new Uint8Array(s)}g(Bc,"constructYamlBinary");function Mc(t){var e="",r=0,i,n,a=t.length,o=vs;for(i=0;i<a;i++)i%3===0&&i&&(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]),r=(r<<8)+t[i];return n=a%3,n===0?(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]):n===2?(e+=o[r>>10&63],e+=o[r>>4&63],e+=o[r<<2&63],e+=o[64]):n===1&&(e+=o[r>>2&63],e+=o[r<<4&63],e+=o[64],e+=o[64]),e}g(Mc,"representYamlBinary");function $c(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}g($c,"isBinary");var n1=new vt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Tc,construct:Bc,predicate:$c,represent:Mc}),a1=Object.prototype.hasOwnProperty,s1=Object.prototype.toString;function Lc(t){if(t===null)return!0;var e=[],r,i,n,a,o,s=t;for(r=0,i=s.length;r<i;r+=1){if(n=s[r],o=!1,s1.call(n)!=="[object Object]")return!1;for(a in n)if(a1.call(n,a))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(a)===-1)e.push(a);else return!1}return!0}g(Lc,"resolveYamlOmap");function Fc(t){return t!==null?t:[]}g(Fc,"constructYamlOmap");var o1=new vt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Lc,construct:Fc}),l1=Object.prototype.toString;function Ac(t){if(t===null)return!0;var e,r,i,n,a,o=t;for(a=new Array(o.length),e=0,r=o.length;e<r;e+=1){if(i=o[e],l1.call(i)!=="[object Object]"||(n=Object.keys(i),n.length!==1))return!1;a[e]=[n[0],i[n[0]]]}return!0}g(Ac,"resolveYamlPairs");function Ec(t){if(t===null)return[];var e,r,i,n,a,o=t;for(a=new Array(o.length),e=0,r=o.length;e<r;e+=1)i=o[e],n=Object.keys(i),a[e]=[n[0],i[n[0]]];return a}g(Ec,"constructYamlPairs");var h1=new vt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Ac,construct:Ec}),c1=Object.prototype.hasOwnProperty;function Oc(t){if(t===null)return!0;var e,r=t;for(e in r)if(c1.call(r,e)&&r[e]!==null)return!1;return!0}g(Oc,"resolveYamlSet");function Dc(t){return t!==null?t:{}}g(Dc,"constructYamlSet");var d1=new vt("tag:yaml.org,2002:set",{kind:"mapping",resolve:Oc,construct:Dc}),Ic=e1.extend({implicit:[r1,i1],explicit:[n1,o1,h1,d1]}),we=Object.prototype.hasOwnProperty,Ki=1,Pc=2,zc=3,Ji=4,Xn=1,u1=2,Do=3,p1=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g1=/[\x85\u2028\u2029]/,f1=/[,\[\]\{\}]/,qc=/^(?:!|!!|![a-z\-]+!)$/i,Rc=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function wa(t){return Object.prototype.toString.call(t)}g(wa,"_class");function Vt(t){return t===10||t===13}g(Vt,"is_EOL");function ke(t){return t===9||t===32}g(ke,"is_WHITE_SPACE");function Mt(t){return t===9||t===32||t===10||t===13}g(Mt,"is_WS_OR_EOL");function Ie(t){return t===44||t===91||t===93||t===123||t===125}g(Ie,"is_FLOW_INDICATOR");function Nc(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}g(Nc,"fromHexCode");function jc(t){return t===120?2:t===117?4:t===85?8:0}g(jc,"escapedHexLen");function Wc(t){return 48<=t&&t<=57?t-48:-1}g(Wc,"fromDecimalCode");function _a(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"…":t===95?" ":t===76?"\u2028":t===80?"\u2029":""}g(_a,"simpleEscapeSequence");function Hc(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}g(Hc,"charFromCodepoint");var Yc=new Array(256),Vc=new Array(256);for(Me=0;Me<256;Me++)Yc[Me]=_a(Me)?1:0,Vc[Me]=_a(Me);var Me;function Uc(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Ic,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}g(Uc,"State$1");function Ts(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=Nx(r),new Et(e,r)}g(Ts,"generateError");function V(t,e){throw Ts(t,e)}g(V,"throwError");function Ur(t,e){t.onWarning&&t.onWarning.call(null,Ts(t,e))}g(Ur,"throwWarning");var Io={YAML:g(function(t,e,r){var i,n,a;t.version!==null&&V(t,"duplication of %YAML directive"),r.length!==1&&V(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&V(t,"ill-formed argument of the YAML directive"),n=parseInt(i[1],10),a=parseInt(i[2],10),n!==1&&V(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&Ur(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:g(function(t,e,r){var i,n;r.length!==2&&V(t,"TAG directive accepts exactly two arguments"),i=r[0],n=r[1],qc.test(i)||V(t,"ill-formed tag handle (first argument) of the TAG directive"),we.call(t.tagMap,i)&&V(t,'there is a previously declared suffix for "'+i+'" tag handle'),Rc.test(n)||V(t,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch{V(t,"tag prefix is malformed: "+n)}t.tagMap[i]=n},"handleTagDirective")};function ce(t,e,r,i){var n,a,o,s;if(e<r){if(s=t.input.slice(e,r),i)for(n=0,a=s.length;n<a;n+=1)o=s.charCodeAt(n),o===9||32<=o&&o<=1114111||V(t,"expected valid JSON character");else p1.test(s)&&V(t,"the stream contains non-printable characters");t.result+=s}}g(ce,"captureSegment");function Sa(t,e,r,i){var n,a,o,s;for(ft.isObject(r)||V(t,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),o=0,s=n.length;o<s;o+=1)a=n[o],we.call(e,a)||(e[a]=r[a],i[a]=!0)}g(Sa,"mergeMappings");function Pe(t,e,r,i,n,a,o,s,l){var h,c;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),h=0,c=n.length;h<c;h+=1)Array.isArray(n[h])&&V(t,"nested arrays are not supported inside keys"),typeof n=="object"&&wa(n[h])==="[object Object]"&&(n[h]="[object Object]");if(typeof n=="object"&&wa(n)==="[object Object]"&&(n="[object Object]"),n=String(n),e===null&&(e={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(h=0,c=a.length;h<c;h+=1)Sa(t,e,a[h],r);else Sa(t,e,a,r);else!t.json&&!we.call(r,n)&&we.call(e,n)&&(t.line=o||t.line,t.lineStart=s||t.lineStart,t.position=l||t.position,V(t,"duplicated mapping key")),n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:a}):e[n]=a,delete r[n];return e}g(Pe,"storeMappingPair");function Mn(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):V(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}g(Mn,"readLineBreak");function ut(t,e,r){for(var i=0,n=t.input.charCodeAt(t.position);n!==0;){for(;ke(n);)n===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),n=t.input.charCodeAt(++t.position);if(e&&n===35)do n=t.input.charCodeAt(++t.position);while(n!==10&&n!==13&&n!==0);if(Vt(n))for(Mn(t),n=t.input.charCodeAt(t.position),i++,t.lineIndent=0;n===32;)t.lineIndent++,n=t.input.charCodeAt(++t.position);else break}return r!==-1&&i!==0&&t.lineIndent<r&&Ur(t,"deficient indentation"),i}g(ut,"skipSeparationSpace");function ai(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||Mt(r)))}g(ai,"testDocumentSeparator");function $n(t,e){e===1?t.result+=" ":e>1&&(t.result+=ft.repeat(`
`,e-1))}g($n,"writeFoldedLines");function Gc(t,e,r){var i,n,a,o,s,l,h,c,d=t.kind,u=t.result,p;if(p=t.input.charCodeAt(t.position),Mt(p)||Ie(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(n=t.input.charCodeAt(t.position+1),Mt(n)||r&&Ie(n)))return!1;for(t.kind="scalar",t.result="",a=o=t.position,s=!1;p!==0;){if(p===58){if(n=t.input.charCodeAt(t.position+1),Mt(n)||r&&Ie(n))break}else if(p===35){if(i=t.input.charCodeAt(t.position-1),Mt(i))break}else{if(t.position===t.lineStart&&ai(t)||r&&Ie(p))break;if(Vt(p))if(l=t.line,h=t.lineStart,c=t.lineIndent,ut(t,!1,-1),t.lineIndent>=e){s=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=l,t.lineStart=h,t.lineIndent=c;break}}s&&(ce(t,a,o,!1),$n(t,t.line-l),a=o=t.position,s=!1),ke(p)||(o=t.position+1),p=t.input.charCodeAt(++t.position)}return ce(t,a,o,!1),t.result?!0:(t.kind=d,t.result=u,!1)}g(Gc,"readPlainScalar");function Xc(t,e){var r,i,n;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,i=n=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(ce(t,i,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)i=t.position,t.position++,n=t.position;else return!0;else Vt(r)?(ce(t,i,n,!0),$n(t,ut(t,!1,e)),i=n=t.position):t.position===t.lineStart&&ai(t)?V(t,"unexpected end of the document within a single quoted scalar"):(t.position++,n=t.position);V(t,"unexpected end of the stream within a single quoted scalar")}g(Xc,"readSingleQuotedScalar");function Zc(t,e){var r,i,n,a,o,s;if(s=t.input.charCodeAt(t.position),s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return ce(t,r,t.position,!0),t.position++,!0;if(s===92){if(ce(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),Vt(s))ut(t,!1,e);else if(s<256&&Yc[s])t.result+=Vc[s],t.position++;else if((o=jc(s))>0){for(n=o,a=0;n>0;n--)s=t.input.charCodeAt(++t.position),(o=Nc(s))>=0?a=(a<<4)+o:V(t,"expected hexadecimal character");t.result+=Hc(a),t.position++}else V(t,"unknown escape sequence");r=i=t.position}else Vt(s)?(ce(t,r,i,!0),$n(t,ut(t,!1,e)),r=i=t.position):t.position===t.lineStart&&ai(t)?V(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}V(t,"unexpected end of the stream within a double quoted scalar")}g(Zc,"readDoubleQuotedScalar");function Qc(t,e){var r=!0,i,n,a,o=t.tag,s,l=t.anchor,h,c,d,u,p,f=Object.create(null),y,m,x,b;if(b=t.input.charCodeAt(t.position),b===91)c=93,p=!1,s=[];else if(b===123)c=125,p=!0,s={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),b=t.input.charCodeAt(++t.position);b!==0;){if(ut(t,!0,e),b=t.input.charCodeAt(t.position),b===c)return t.position++,t.tag=o,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=s,!0;r?b===44&&V(t,"expected the node content, but found ','"):V(t,"missed comma between flow collection entries"),m=y=x=null,d=u=!1,b===63&&(h=t.input.charCodeAt(t.position+1),Mt(h)&&(d=u=!0,t.position++,ut(t,!0,e))),i=t.line,n=t.lineStart,a=t.position,We(t,e,Ki,!1,!0),m=t.tag,y=t.result,ut(t,!0,e),b=t.input.charCodeAt(t.position),(u||t.line===i)&&b===58&&(d=!0,b=t.input.charCodeAt(++t.position),ut(t,!0,e),We(t,e,Ki,!1,!0),x=t.result),p?Pe(t,s,f,m,y,x,i,n,a):d?s.push(Pe(t,null,f,m,y,x,i,n,a)):s.push(y),ut(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(r=!0,b=t.input.charCodeAt(++t.position)):r=!1}V(t,"unexpected end of the stream within a flow collection")}g(Qc,"readFlowCollection");function Kc(t,e){var r,i,n=Xn,a=!1,o=!1,s=e,l=0,h=!1,c,d;if(d=t.input.charCodeAt(t.position),d===124)i=!1;else if(d===62)i=!0;else return!1;for(t.kind="scalar",t.result="";d!==0;)if(d=t.input.charCodeAt(++t.position),d===43||d===45)Xn===n?n=d===43?Do:u1:V(t,"repeat of a chomping mode identifier");else if((c=Wc(d))>=0)c===0?V(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?V(t,"repeat of an indentation width identifier"):(s=e+c-1,o=!0);else break;if(ke(d)){do d=t.input.charCodeAt(++t.position);while(ke(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!Vt(d)&&d!==0)}for(;d!==0;){for(Mn(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!o||t.lineIndent<s)&&d===32;)t.lineIndent++,d=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>s&&(s=t.lineIndent),Vt(d)){l++;continue}if(t.lineIndent<s){n===Do?t.result+=ft.repeat(`
`,a?1+l:l):n===Xn&&a&&(t.result+=`
`);break}for(i?ke(d)?(h=!0,t.result+=ft.repeat(`
`,a?1+l:l)):h?(h=!1,t.result+=ft.repeat(`
`,l+1)):l===0?a&&(t.result+=" "):t.result+=ft.repeat(`
`,l):t.result+=ft.repeat(`
`,a?1+l:l),a=!0,o=!0,l=0,r=t.position;!Vt(d)&&d!==0;)d=t.input.charCodeAt(++t.position);ce(t,r,t.position,!1)}return!0}g(Kc,"readBlockScalar");function va(t,e){var r,i=t.tag,n=t.anchor,a=[],o,s=!1,l;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=a),l=t.input.charCodeAt(t.position);l!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,V(t,"tab characters must not be used in indentation")),!(l!==45||(o=t.input.charCodeAt(t.position+1),!Mt(o))));){if(s=!0,t.position++,ut(t,!0,-1)&&t.lineIndent<=e){a.push(null),l=t.input.charCodeAt(t.position);continue}if(r=t.line,We(t,e,zc,!1,!0),a.push(t.result),ut(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&l!==0)V(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return s?(t.tag=i,t.anchor=n,t.kind="sequence",t.result=a,!0):!1}g(va,"readBlockSequence");function Jc(t,e,r){var i,n,a,o,s,l,h=t.tag,c=t.anchor,d={},u=Object.create(null),p=null,f=null,y=null,m=!1,x=!1,b;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=d),b=t.input.charCodeAt(t.position);b!==0;){if(!m&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,V(t,"tab characters must not be used in indentation")),i=t.input.charCodeAt(t.position+1),a=t.line,(b===63||b===58)&&Mt(i))b===63?(m&&(Pe(t,d,u,p,f,null,o,s,l),p=f=y=null),x=!0,m=!0,n=!0):m?(m=!1,n=!0):V(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,b=i;else{if(o=t.line,s=t.lineStart,l=t.position,!We(t,r,Pc,!1,!0))break;if(t.line===a){for(b=t.input.charCodeAt(t.position);ke(b);)b=t.input.charCodeAt(++t.position);if(b===58)b=t.input.charCodeAt(++t.position),Mt(b)||V(t,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(Pe(t,d,u,p,f,null,o,s,l),p=f=y=null),x=!0,m=!1,n=!1,p=t.tag,f=t.result;else if(x)V(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=h,t.anchor=c,!0}else if(x)V(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=h,t.anchor=c,!0}if((t.line===a||t.lineIndent>e)&&(m&&(o=t.line,s=t.lineStart,l=t.position),We(t,e,Ji,!0,n)&&(m?f=t.result:y=t.result),m||(Pe(t,d,u,p,f,y,o,s,l),p=f=y=null),ut(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&b!==0)V(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return m&&Pe(t,d,u,p,f,null,o,s,l),x&&(t.tag=h,t.anchor=c,t.kind="mapping",t.result=d),x}g(Jc,"readBlockMapping");function td(t){var e,r=!1,i=!1,n,a,o;if(o=t.input.charCodeAt(t.position),o!==33)return!1;if(t.tag!==null&&V(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(r=!0,o=t.input.charCodeAt(++t.position)):o===33?(i=!0,n="!!",o=t.input.charCodeAt(++t.position)):n="!",e=t.position,r){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(a=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):V(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Mt(o);)o===33&&(i?V(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),qc.test(n)||V(t,"named tag handle cannot contain such characters"),i=!0,e=t.position+1)),o=t.input.charCodeAt(++t.position);a=t.input.slice(e,t.position),f1.test(a)&&V(t,"tag suffix cannot contain flow indicator characters")}a&&!Rc.test(a)&&V(t,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{V(t,"tag name is malformed: "+a)}return r?t.tag=a:we.call(t.tagMap,n)?t.tag=t.tagMap[n]+a:n==="!"?t.tag="!"+a:n==="!!"?t.tag="tag:yaml.org,2002:"+a:V(t,'undeclared tag handle "'+n+'"'),!0}g(td,"readTagProperty");function ed(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&V(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!Mt(r)&&!Ie(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&V(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}g(ed,"readAnchorProperty");function rd(t){var e,r,i;if(i=t.input.charCodeAt(t.position),i!==42)return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;i!==0&&!Mt(i)&&!Ie(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&V(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),we.call(t.anchorMap,r)||V(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],ut(t,!0,-1),!0}g(rd,"readAlias");function We(t,e,r,i,n){var a,o,s,l=1,h=!1,c=!1,d,u,p,f,y,m;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,a=o=s=Ji===r||zc===r,i&&ut(t,!0,-1)&&(h=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;td(t)||ed(t);)ut(t,!0,-1)?(h=!0,s=a,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):s=!1;if(s&&(s=h||n),(l===1||Ji===r)&&(Ki===r||Pc===r?y=e:y=e+1,m=t.position-t.lineStart,l===1?s&&(va(t,m)||Jc(t,m,y))||Qc(t,y)?c=!0:(o&&Kc(t,y)||Xc(t,y)||Zc(t,y)?c=!0:rd(t)?(c=!0,(t.tag!==null||t.anchor!==null)&&V(t,"alias node should not have any properties")):Gc(t,y,Ki===r)&&(c=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):l===0&&(c=s&&va(t,m))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&V(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),d=0,u=t.implicitTypes.length;d<u;d+=1)if(f=t.implicitTypes[d],f.resolve(t.result)){t.result=f.construct(t.result),t.tag=f.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(we.call(t.typeMap[t.kind||"fallback"],t.tag))f=t.typeMap[t.kind||"fallback"][t.tag];else for(f=null,p=t.typeMap.multi[t.kind||"fallback"],d=0,u=p.length;d<u;d+=1)if(t.tag.slice(0,p[d].tag.length)===p[d].tag){f=p[d];break}f||V(t,"unknown tag !<"+t.tag+">"),t.result!==null&&f.kind!==t.kind&&V(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+f.kind+'", not "'+t.kind+'"'),f.resolve(t.result,t.tag)?(t.result=f.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):V(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||c}g(We,"composeNode");function id(t){var e=t.position,r,i,n,a=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(ut(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(a=!0,o=t.input.charCodeAt(++t.position),r=t.position;o!==0&&!Mt(o);)o=t.input.charCodeAt(++t.position);for(i=t.input.slice(r,t.position),n=[],i.length<1&&V(t,"directive name must not be less than one character in length");o!==0;){for(;ke(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!Vt(o));break}if(Vt(o))break;for(r=t.position;o!==0&&!Mt(o);)o=t.input.charCodeAt(++t.position);n.push(t.input.slice(r,t.position))}o!==0&&Mn(t),we.call(Io,i)?Io[i](t,i,n):Ur(t,'unknown document directive "'+i+'"')}if(ut(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,ut(t,!0,-1)):a&&V(t,"directives end mark is expected"),We(t,t.lineIndent-1,Ji,!1,!0),ut(t,!0,-1),t.checkLineBreaks&&g1.test(t.input.slice(e,t.position))&&Ur(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&ai(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,ut(t,!0,-1));return}if(t.position<t.length-1)V(t,"end of the stream or a document separator is expected");else return}g(id,"readDocument");function Bs(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new Uc(t,e),i=t.indexOf("\0");for(i!==-1&&(r.position=i,V(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)id(r);return r.documents}g(Bs,"loadDocuments");function y1(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);var i=Bs(t,r);if(typeof e!="function")return i;for(var n=0,a=i.length;n<a;n+=1)e(i[n])}g(y1,"loadAll$1");function nd(t,e){var r=Bs(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new Et("expected a single document in the stream, but found more")}}g(nd,"load$1");var m1=nd,x1={load:m1},ad=Object.prototype.toString,sd=Object.prototype.hasOwnProperty,Ms=65279,b1=9,Gr=10,k1=13,C1=32,w1=33,_1=34,Ta=35,S1=37,v1=38,T1=39,B1=42,od=44,M1=45,tn=58,$1=61,L1=62,F1=63,A1=64,ld=91,hd=93,E1=96,cd=123,O1=124,dd=125,Ct={};Ct[0]="\\0",Ct[7]="\\a",Ct[8]="\\b",Ct[9]="\\t",Ct[10]="\\n",Ct[11]="\\v",Ct[12]="\\f",Ct[13]="\\r",Ct[27]="\\e",Ct[34]='\\"',Ct[92]="\\\\",Ct[133]="\\N",Ct[160]="\\_",Ct[8232]="\\L",Ct[8233]="\\P";var D1=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],I1=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ud(t,e){var r,i,n,a,o,s,l;if(e===null)return{};for(r={},i=Object.keys(e),n=0,a=i.length;n<a;n+=1)o=i[n],s=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=t.compiledTypeMap.fallback[o],l&&sd.call(l.styleAliases,s)&&(s=l.styleAliases[s]),r[o]=s;return r}g(ud,"compileStyleMap");function pd(t){var e,r,i;if(e=t.toString(16).toUpperCase(),t<=255)r="x",i=2;else if(t<=65535)r="u",i=4;else if(t<=4294967295)r="U",i=8;else throw new Et("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ft.repeat("0",i-e.length)+e}g(pd,"encodeHex");var P1=1,Xr=2;function gd(t){this.schema=t.schema||Ic,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=ft.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=ud(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Xr:P1,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}g(gd,"State");function Ba(t,e){for(var r=ft.repeat(" ",e),i=0,n=-1,a="",o,s=t.length;i<s;)n=t.indexOf(`
`,i),n===-1?(o=t.slice(i),i=s):(o=t.slice(i,n+1),i=n+1),o.length&&o!==`
`&&(a+=r),a+=o;return a}g(Ba,"indentString");function en(t,e){return`
`+ft.repeat(" ",t.indent*e)}g(en,"generateNextLine");function fd(t,e){var r,i,n;for(r=0,i=t.implicitTypes.length;r<i;r+=1)if(n=t.implicitTypes[r],n.resolve(e))return!0;return!1}g(fd,"testImplicitResolving");function Zr(t){return t===C1||t===b1}g(Zr,"isWhitespace");function dr(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==Ms||65536<=t&&t<=1114111}g(dr,"isPrintable");function Ma(t){return dr(t)&&t!==Ms&&t!==k1&&t!==Gr}g(Ma,"isNsCharOrWhitespace");function $a(t,e,r){var i=Ma(t),n=i&&!Zr(t);return(r?i:i&&t!==od&&t!==ld&&t!==hd&&t!==cd&&t!==dd)&&t!==Ta&&!(e===tn&&!n)||Ma(e)&&!Zr(e)&&t===Ta||e===tn&&n}g($a,"isPlainSafe");function yd(t){return dr(t)&&t!==Ms&&!Zr(t)&&t!==M1&&t!==F1&&t!==tn&&t!==od&&t!==ld&&t!==hd&&t!==cd&&t!==dd&&t!==Ta&&t!==v1&&t!==B1&&t!==w1&&t!==O1&&t!==$1&&t!==L1&&t!==T1&&t!==_1&&t!==S1&&t!==A1&&t!==E1}g(yd,"isPlainSafeFirst");function md(t){return!Zr(t)&&t!==tn}g(md,"isPlainSafeLast");function rr(t,e){var r=t.charCodeAt(e),i;return r>=55296&&r<=56319&&e+1<t.length&&(i=t.charCodeAt(e+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}g(rr,"codePointAt");function $s(t){var e=/^\n* /;return e.test(t)}g($s,"needIndentIndicator");var xd=1,La=2,bd=3,kd=4,Je=5;function Cd(t,e,r,i,n,a,o,s){var l,h=0,c=null,d=!1,u=!1,p=i!==-1,f=-1,y=yd(rr(t,0))&&md(rr(t,t.length-1));if(e||o)for(l=0;l<t.length;h>=65536?l+=2:l++){if(h=rr(t,l),!dr(h))return Je;y=y&&$a(h,c,s),c=h}else{for(l=0;l<t.length;h>=65536?l+=2:l++){if(h=rr(t,l),h===Gr)d=!0,p&&(u=u||l-f-1>i&&t[f+1]!==" ",f=l);else if(!dr(h))return Je;y=y&&$a(h,c,s),c=h}u=u||p&&l-f-1>i&&t[f+1]!==" "}return!d&&!u?y&&!o&&!n(t)?xd:a===Xr?Je:La:r>9&&$s(t)?Je:o?a===Xr?Je:La:u?kd:bd}g(Cd,"chooseScalarStyle");function wd(t,e,r,i,n){t.dump=(function(){if(e.length===0)return t.quotingType===Xr?'""':"''";if(!t.noCompatMode&&(D1.indexOf(e)!==-1||I1.test(e)))return t.quotingType===Xr?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),s=i||t.flowLevel>-1&&r>=t.flowLevel;function l(h){return fd(t,h)}switch(g(l,"testAmbiguity"),Cd(e,s,t.indent,o,l,t.quotingType,t.forceQuotes&&!i,n)){case xd:return e;case La:return"'"+e.replace(/'/g,"''")+"'";case bd:return"|"+Fa(e,t.indent)+Aa(Ba(e,a));case kd:return">"+Fa(e,t.indent)+Aa(Ba(_d(e,o),a));case Je:return'"'+Sd(e)+'"';default:throw new Et("impossible error: invalid scalar style")}})()}g(wd,"writeScalar");function Fa(t,e){var r=$s(t)?String(e):"",i=t[t.length-1]===`
`,n=i&&(t[t.length-2]===`
`||t===`
`),a=n?"+":i?"":"-";return r+a+`
`}g(Fa,"blockHeader");function Aa(t){return t[t.length-1]===`
`?t.slice(0,-1):t}g(Aa,"dropEndingNewline");function _d(t,e){for(var r=/(\n+)([^\n]*)/g,i=(function(){var h=t.indexOf(`
`);return h=h!==-1?h:t.length,r.lastIndex=h,Ea(t.slice(0,h),e)})(),n=t[0]===`
`||t[0]===" ",a,o;o=r.exec(t);){var s=o[1],l=o[2];a=l[0]===" ",i+=s+(!n&&!a&&l!==""?`
`:"")+Ea(l,e),n=a}return i}g(_d,"foldString");function Ea(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,i,n=0,a,o=0,s=0,l="";i=r.exec(t);)s=i.index,s-n>e&&(a=o>n?o:s,l+=`
`+t.slice(n,a),n=a+1),o=s;return l+=`
`,t.length-n>e&&o>n?l+=t.slice(n,o)+`
`+t.slice(o+1):l+=t.slice(n),l.slice(1)}g(Ea,"foldLine");function Sd(t){for(var e="",r=0,i,n=0;n<t.length;r>=65536?n+=2:n++)r=rr(t,n),i=Ct[r],!i&&dr(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||pd(r);return e}g(Sd,"escapeString");function vd(t,e,r){var i="",n=t.tag,a,o,s;for(a=0,o=r.length;a<o;a+=1)s=r[a],t.replacer&&(s=t.replacer.call(r,String(a),s)),(ee(t,e,s,!1,!1)||typeof s>"u"&&ee(t,e,null,!1,!1))&&(i!==""&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=n,t.dump="["+i+"]"}g(vd,"writeFlowSequence");function Oa(t,e,r,i){var n="",a=t.tag,o,s,l;for(o=0,s=r.length;o<s;o+=1)l=r[o],t.replacer&&(l=t.replacer.call(r,String(o),l)),(ee(t,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&ee(t,e+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=en(t,e)),t.dump&&Gr===t.dump.charCodeAt(0)?n+="-":n+="- ",n+=t.dump);t.tag=a,t.dump=n||"[]"}g(Oa,"writeBlockSequence");function Td(t,e,r){var i="",n=t.tag,a=Object.keys(r),o,s,l,h,c;for(o=0,s=a.length;o<s;o+=1)c="",i!==""&&(c+=", "),t.condenseFlow&&(c+='"'),l=a[o],h=r[l],t.replacer&&(h=t.replacer.call(r,l,h)),ee(t,e,l,!1,!1)&&(t.dump.length>1024&&(c+="? "),c+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ee(t,e,h,!1,!1)&&(c+=t.dump,i+=c));t.tag=n,t.dump="{"+i+"}"}g(Td,"writeFlowMapping");function Bd(t,e,r,i){var n="",a=t.tag,o=Object.keys(r),s,l,h,c,d,u;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new Et("sortKeys must be a boolean or a function");for(s=0,l=o.length;s<l;s+=1)u="",(!i||n!=="")&&(u+=en(t,e)),h=o[s],c=r[h],t.replacer&&(c=t.replacer.call(r,h,c)),ee(t,e+1,h,!0,!0,!0)&&(d=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,d&&(t.dump&&Gr===t.dump.charCodeAt(0)?u+="?":u+="? "),u+=t.dump,d&&(u+=en(t,e)),ee(t,e+1,c,!0,d)&&(t.dump&&Gr===t.dump.charCodeAt(0)?u+=":":u+=": ",u+=t.dump,n+=u));t.tag=a,t.dump=n||"{}"}g(Bd,"writeBlockMapping");function Da(t,e,r){var i,n,a,o,s,l;for(n=r?t.explicitTypes:t.implicitTypes,a=0,o=n.length;a<o;a+=1)if(s=n[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof e=="object"&&e instanceof s.instanceOf)&&(!s.predicate||s.predicate(e))){if(r?s.multi&&s.representName?t.tag=s.representName(e):t.tag=s.tag:t.tag="?",s.represent){if(l=t.styleMap[s.tag]||s.defaultStyle,ad.call(s.represent)==="[object Function]")i=s.represent(e,l);else if(sd.call(s.represent,l))i=s.represent[l](e,l);else throw new Et("!<"+s.tag+'> tag resolver accepts not "'+l+'" style');t.dump=i}return!0}return!1}g(Da,"detectType");function ee(t,e,r,i,n,a,o){t.tag=null,t.dump=r,Da(t,r,!1)||Da(t,r,!0);var s=ad.call(t.dump),l=i,h;i&&(i=t.flowLevel<0||t.flowLevel>e);var c=s==="[object Object]"||s==="[object Array]",d,u;if(c&&(d=t.duplicates.indexOf(r),u=d!==-1),(t.tag!==null&&t.tag!=="?"||u||t.indent!==2&&e>0)&&(n=!1),u&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(c&&u&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),s==="[object Object]")i&&Object.keys(t.dump).length!==0?(Bd(t,e,t.dump,n),u&&(t.dump="&ref_"+d+t.dump)):(Td(t,e,t.dump),u&&(t.dump="&ref_"+d+" "+t.dump));else if(s==="[object Array]")i&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?Oa(t,e-1,t.dump,n):Oa(t,e,t.dump,n),u&&(t.dump="&ref_"+d+t.dump)):(vd(t,e,t.dump),u&&(t.dump="&ref_"+d+" "+t.dump));else if(s==="[object String]")t.tag!=="?"&&wd(t,t.dump,e,a,l);else{if(s==="[object Undefined]"||t.skipInvalid)return!1;throw new Et("unacceptable kind of an object to dump "+s)}t.tag!==null&&t.tag!=="?"&&(h=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",t.dump=h+" "+t.dump)}return!0}g(ee,"writeNode");function Md(t,e){var r=[],i=[],n,a;for(rn(t,r,i),n=0,a=i.length;n<a;n+=1)e.duplicates.push(r[i[n]]);e.usedDuplicates=new Array(a)}g(Md,"getDuplicateReferences");function rn(t,e,r){var i,n,a;if(t!==null&&typeof t=="object")if(n=e.indexOf(t),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(e.push(t),Array.isArray(t))for(n=0,a=t.length;n<a;n+=1)rn(t[n],e,r);else for(i=Object.keys(t),n=0,a=i.length;n<a;n+=1)rn(t[i[n]],e,r)}g(rn,"inspectNode");function z1(t,e){e=e||{};var r=new gd(e);r.noRefs||Md(t,r);var i=t;return r.replacer&&(i=r.replacer.call({"":i},"",i)),ee(r,0,i,!0,!0)?r.dump+`
`:""}g(z1,"dump$1");function q1(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}g(q1,"renamed");var R1=bc,N1=x1.load,_t={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},Po={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function Fr(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=dt(t),e=dt(e);const[r,i]=[t.x,t.y],[n,a]=[e.x,e.y],o=n-r,s=a-i;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}g(Fr,"calculateDeltaAndAngle");var dt=g(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),j1=g(t=>({x:g(function(e,r,i){let n=0;const a=dt(i[0]).x<dt(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(_t,t.arrowTypeStart)){const{angle:p,deltaX:f}=Fr(i[0],i[1]);n=_t[t.arrowTypeStart]*Math.cos(p)*(f>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(_t,t.arrowTypeEnd)){const{angle:p,deltaX:f}=Fr(i[i.length-1],i[i.length-2]);n=_t[t.arrowTypeEnd]*Math.cos(p)*(f>=0?1:-1)}const o=Math.abs(dt(e).x-dt(i[i.length-1]).x),s=Math.abs(dt(e).y-dt(i[i.length-1]).y),l=Math.abs(dt(e).x-dt(i[0]).x),h=Math.abs(dt(e).y-dt(i[0]).y),c=_t[t.arrowTypeStart],d=_t[t.arrowTypeEnd],u=1;if(o<d&&o>0&&s<d){let p=d+u-o;p*=a==="right"?-1:1,n-=p}if(l<c&&l>0&&h<c){let p=c+u-l;p*=a==="right"?-1:1,n+=p}return dt(e).x+n},"x"),y:g(function(e,r,i){let n=0;const a=dt(i[0]).y<dt(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(_t,t.arrowTypeStart)){const{angle:p,deltaY:f}=Fr(i[0],i[1]);n=_t[t.arrowTypeStart]*Math.abs(Math.sin(p))*(f>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(_t,t.arrowTypeEnd)){const{angle:p,deltaY:f}=Fr(i[i.length-1],i[i.length-2]);n=_t[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(f>=0?1:-1)}const o=Math.abs(dt(e).y-dt(i[i.length-1]).y),s=Math.abs(dt(e).x-dt(i[i.length-1]).x),l=Math.abs(dt(e).y-dt(i[0]).y),h=Math.abs(dt(e).x-dt(i[0]).x),c=_t[t.arrowTypeStart],d=_t[t.arrowTypeEnd],u=1;if(o<d&&o>0&&s<d){let p=d+u-o;p*=a==="up"?-1:1,n-=p}if(l<c&&l>0&&h<c){let p=c+u-l;p*=a==="up"?-1:1,n+=p}return dt(e).y+n},"y")}),"getLineFunctionsWithOffset"),Ls=g(({flowchart:t})=>{const e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0,i=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),W1=g(t=>{const{handDrawnSeed:e}=st();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),fr=g(t=>{const e=H1([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),H1=g(t=>{const e=new Map;return t.forEach(r=>{const[i,n]=r.split(":");e.set(i.trim(),n?.trim())}),e},"styles2Map"),$d=g(t=>t==="color"||t==="font-size"||t==="font-family"||t==="font-weight"||t==="font-style"||t==="text-decoration"||t==="text-align"||t==="text-transform"||t==="line-height"||t==="letter-spacing"||t==="word-spacing"||t==="text-shadow"||t==="text-overflow"||t==="white-space"||t==="word-wrap"||t==="word-break"||t==="overflow-wrap"||t==="hyphens","isLabelStyle"),W=g(t=>{const{stylesArray:e}=fr(t),r=[],i=[],n=[],a=[];return e.forEach(o=>{const s=o[0];$d(s)?r.push(o.join(":")+" !important"):(i.push(o.join(":")+" !important"),s.includes("stroke")&&n.push(o.join(":")+" !important"),s==="fill"&&a.push(o.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:e,borderStyles:n,backgroundStyles:a}},"styles2String"),j=g((t,e)=>{const{themeVariables:r,handDrawnSeed:i}=st(),{nodeBorder:n,mainBkg:a}=r,{stylesMap:o}=fr(t);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||n,seed:i,strokeWidth:o.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:Y1(o.get("stroke-dasharray"))},e)},"userNodeOverrides"),Y1=g(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(e.length===1){const n=isNaN(e[0])?0:e[0];return[n,n]}const r=isNaN(e[0])?0:e[0],i=isNaN(e[1])?0:e[1];return[r,i]},"getStrokeDashArray"),wr={},mt={},zo;function V1(){return zo||(zo=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.BLANK_URL=mt.relativeFirstCharacters=mt.whitespaceEscapeCharsRegex=mt.urlSchemeRegex=mt.ctrlCharactersRegex=mt.htmlCtrlEntityRegex=mt.htmlEntitiesRegex=mt.invalidProtocolRegex=void 0,mt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,mt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,mt.htmlCtrlEntityRegex=/&(newline|tab);/gi,mt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,mt.urlSchemeRegex=/^.+(:|&colon;)/gim,mt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,mt.relativeFirstCharacters=[".","/"],mt.BLANK_URL="about:blank"),mt}var qo;function U1(){if(qo)return wr;qo=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.sanitizeUrl=void 0;var t=V1();function e(o){return t.relativeFirstCharacters.indexOf(o[0])>-1}function r(o){var s=o.replace(t.ctrlCharactersRegex,"");return s.replace(t.htmlEntitiesRegex,function(l,h){return String.fromCharCode(h)})}function i(o){return URL.canParse(o)}function n(o){try{return decodeURIComponent(o)}catch{return o}}function a(o){if(!o)return t.BLANK_URL;var s,l=n(o.trim());do l=r(l).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),l=n(l),s=l.match(t.ctrlCharactersRegex)||l.match(t.htmlEntitiesRegex)||l.match(t.htmlCtrlEntityRegex)||l.match(t.whitespaceEscapeCharsRegex);while(s&&s.length>0);var h=l;if(!h)return t.BLANK_URL;if(e(h))return h;var c=h.trimStart(),d=c.match(t.urlSchemeRegex);if(!d)return h;var u=d[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(u))return t.BLANK_URL;var p=c.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return p;if(u==="http:"||u==="https:"){if(!i(p))return t.BLANK_URL;var f=new URL(p);return f.protocol=f.protocol.toLowerCase(),f.hostname=f.hostname.toLowerCase(),f.toString()}return p}return wr.sanitizeUrl=a,wr}var G1=U1(),Ld=typeof ui=="object"&&ui&&ui.Object===Object&&ui,X1=typeof self=="object"&&self&&self.Object===Object&&self,ie=Ld||X1||Function("return this")(),nn=ie.Symbol,Fd=Object.prototype,Z1=Fd.hasOwnProperty,Q1=Fd.toString,_r=nn?nn.toStringTag:void 0;function K1(t){var e=Z1.call(t,_r),r=t[_r];try{t[_r]=void 0;var i=!0}catch{}var n=Q1.call(t);return i&&(e?t[_r]=r:delete t[_r]),n}var J1=Object.prototype,tb=J1.toString;function eb(t){return tb.call(t)}var rb="[object Null]",ib="[object Undefined]",Ro=nn?nn.toStringTag:void 0;function yr(t){return t==null?t===void 0?ib:rb:Ro&&Ro in Object(t)?K1(t):eb(t)}function Ye(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var nb="[object AsyncFunction]",ab="[object Function]",sb="[object GeneratorFunction]",ob="[object Proxy]";function Fs(t){if(!Ye(t))return!1;var e=yr(t);return e==ab||e==sb||e==nb||e==ob}var Zn=ie["__core-js_shared__"],No=(function(){var t=/[^.]+$/.exec(Zn&&Zn.keys&&Zn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function lb(t){return!!No&&No in t}var hb=Function.prototype,cb=hb.toString;function Ve(t){if(t!=null){try{return cb.call(t)}catch{}try{return t+""}catch{}}return""}var db=/[\\^$.*+?()[\]{}|]/g,ub=/^\[object .+?Constructor\]$/,pb=Function.prototype,gb=Object.prototype,fb=pb.toString,yb=gb.hasOwnProperty,mb=RegExp("^"+fb.call(yb).replace(db,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xb(t){if(!Ye(t)||lb(t))return!1;var e=Fs(t)?mb:ub;return e.test(Ve(t))}function bb(t,e){return t?.[e]}function Ue(t,e){var r=bb(t,e);return xb(r)?r:void 0}var Qr=Ue(Object,"create");function kb(){this.__data__=Qr?Qr(null):{},this.size=0}function Cb(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var wb="__lodash_hash_undefined__",_b=Object.prototype,Sb=_b.hasOwnProperty;function vb(t){var e=this.__data__;if(Qr){var r=e[t];return r===wb?void 0:r}return Sb.call(e,t)?e[t]:void 0}var Tb=Object.prototype,Bb=Tb.hasOwnProperty;function Mb(t){var e=this.__data__;return Qr?e[t]!==void 0:Bb.call(e,t)}var $b="__lodash_hash_undefined__";function Lb(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Qr&&e===void 0?$b:e,this}function Ee(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}Ee.prototype.clear=kb,Ee.prototype.delete=Cb,Ee.prototype.get=vb,Ee.prototype.has=Mb,Ee.prototype.set=Lb;function Fb(){this.__data__=[],this.size=0}function Ln(t,e){return t===e||t!==t&&e!==e}function Fn(t,e){for(var r=t.length;r--;)if(Ln(t[r][0],e))return r;return-1}var Ab=Array.prototype,Eb=Ab.splice;function Ob(t){var e=this.__data__,r=Fn(e,t);if(r<0)return!1;var i=e.length-1;return r==i?e.pop():Eb.call(e,r,1),--this.size,!0}function Db(t){var e=this.__data__,r=Fn(e,t);return r<0?void 0:e[r][1]}function Ib(t){return Fn(this.__data__,t)>-1}function Pb(t,e){var r=this.__data__,i=Fn(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}function le(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}le.prototype.clear=Fb,le.prototype.delete=Ob,le.prototype.get=Db,le.prototype.has=Ib,le.prototype.set=Pb;var Kr=Ue(ie,"Map");function zb(){this.size=0,this.__data__={hash:new Ee,map:new(Kr||le),string:new Ee}}function qb(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function An(t,e){var r=t.__data__;return qb(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Rb(t){var e=An(this,t).delete(t);return this.size-=e?1:0,e}function Nb(t){return An(this,t).get(t)}function jb(t){return An(this,t).has(t)}function Wb(t,e){var r=An(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}function xe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}xe.prototype.clear=zb,xe.prototype.delete=Rb,xe.prototype.get=Nb,xe.prototype.has=jb,xe.prototype.set=Wb;var Hb="Expected a function";function si(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Hb);var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],a=r.cache;if(a.has(n))return a.get(n);var o=t.apply(this,i);return r.cache=a.set(n,o)||a,o};return r.cache=new(si.Cache||xe),r}si.Cache=xe;function Yb(){this.__data__=new le,this.size=0}function Vb(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Ub(t){return this.__data__.get(t)}function Gb(t){return this.__data__.has(t)}var Xb=200;function Zb(t,e){var r=this.__data__;if(r instanceof le){var i=r.__data__;if(!Kr||i.length<Xb-1)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new xe(i)}return r.set(t,e),this.size=r.size,this}function tr(t){var e=this.__data__=new le(t);this.size=e.size}tr.prototype.clear=Yb,tr.prototype.delete=Vb,tr.prototype.get=Ub,tr.prototype.has=Gb,tr.prototype.set=Zb;var an=(function(){try{var t=Ue(Object,"defineProperty");return t({},"",{}),t}catch{}})();function As(t,e,r){e=="__proto__"&&an?an(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ia(t,e,r){(r!==void 0&&!Ln(t[e],r)||r===void 0&&!(e in t))&&As(t,e,r)}function Qb(t){return function(e,r,i){for(var n=-1,a=Object(e),o=i(e),s=o.length;s--;){var l=o[++n];if(r(a[l],l,a)===!1)break}return e}}var Kb=Qb(),Ad=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jo=Ad&&typeof module=="object"&&module&&!module.nodeType&&module,Jb=jo&&jo.exports===Ad,Wo=Jb?ie.Buffer:void 0,Ho=Wo?Wo.allocUnsafe:void 0;function t2(t,e){if(e)return t.slice();var r=t.length,i=Ho?Ho(r):new t.constructor(r);return t.copy(i),i}var Yo=ie.Uint8Array;function e2(t){var e=new t.constructor(t.byteLength);return new Yo(e).set(new Yo(t)),e}function r2(t,e){var r=e?e2(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function i2(t,e){var r=-1,i=t.length;for(e||(e=Array(i));++r<i;)e[r]=t[r];return e}var Vo=Object.create,n2=(function(){function t(){}return function(e){if(!Ye(e))return{};if(Vo)return Vo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function Ed(t,e){return function(r){return t(e(r))}}var Od=Ed(Object.getPrototypeOf,Object),a2=Object.prototype;function En(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||a2;return t===r}function s2(t){return typeof t.constructor=="function"&&!En(t)?n2(Od(t)):{}}function oi(t){return t!=null&&typeof t=="object"}var o2="[object Arguments]";function Uo(t){return oi(t)&&yr(t)==o2}var Dd=Object.prototype,l2=Dd.hasOwnProperty,h2=Dd.propertyIsEnumerable,sn=Uo((function(){return arguments})())?Uo:function(t){return oi(t)&&l2.call(t,"callee")&&!h2.call(t,"callee")},on=Array.isArray,c2=9007199254740991;function Id(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=c2}function On(t){return t!=null&&Id(t.length)&&!Fs(t)}function d2(t){return oi(t)&&On(t)}function u2(){return!1}var Pd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Go=Pd&&typeof module=="object"&&module&&!module.nodeType&&module,p2=Go&&Go.exports===Pd,Xo=p2?ie.Buffer:void 0,g2=Xo?Xo.isBuffer:void 0,Es=g2||u2,f2="[object Object]",y2=Function.prototype,m2=Object.prototype,zd=y2.toString,x2=m2.hasOwnProperty,b2=zd.call(Object);function k2(t){if(!oi(t)||yr(t)!=f2)return!1;var e=Od(t);if(e===null)return!0;var r=x2.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&zd.call(r)==b2}var C2="[object Arguments]",w2="[object Array]",_2="[object Boolean]",S2="[object Date]",v2="[object Error]",T2="[object Function]",B2="[object Map]",M2="[object Number]",$2="[object Object]",L2="[object RegExp]",F2="[object Set]",A2="[object String]",E2="[object WeakMap]",O2="[object ArrayBuffer]",D2="[object DataView]",I2="[object Float32Array]",P2="[object Float64Array]",z2="[object Int8Array]",q2="[object Int16Array]",R2="[object Int32Array]",N2="[object Uint8Array]",j2="[object Uint8ClampedArray]",W2="[object Uint16Array]",H2="[object Uint32Array]",ct={};ct[I2]=ct[P2]=ct[z2]=ct[q2]=ct[R2]=ct[N2]=ct[j2]=ct[W2]=ct[H2]=!0,ct[C2]=ct[w2]=ct[O2]=ct[_2]=ct[D2]=ct[S2]=ct[v2]=ct[T2]=ct[B2]=ct[M2]=ct[$2]=ct[L2]=ct[F2]=ct[A2]=ct[E2]=!1;function Y2(t){return oi(t)&&Id(t.length)&&!!ct[yr(t)]}function V2(t){return function(e){return t(e)}}var qd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Rr=qd&&typeof module=="object"&&module&&!module.nodeType&&module,U2=Rr&&Rr.exports===qd,Qn=U2&&Ld.process,Zo=(function(){try{var t=Rr&&Rr.require&&Rr.require("util").types;return t||Qn&&Qn.binding&&Qn.binding("util")}catch{}})(),Qo=Zo&&Zo.isTypedArray,Os=Qo?V2(Qo):Y2;function Pa(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var G2=Object.prototype,X2=G2.hasOwnProperty;function Z2(t,e,r){var i=t[e];(!(X2.call(t,e)&&Ln(i,r))||r===void 0&&!(e in t))&&As(t,e,r)}function Q2(t,e,r,i){var n=!r;r||(r={});for(var a=-1,o=e.length;++a<o;){var s=e[a],l=void 0;l===void 0&&(l=t[s]),n?As(r,s,l):Z2(r,s,l)}return r}function K2(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}var J2=9007199254740991,tk=/^(?:0|[1-9]\d*)$/;function Rd(t,e){var r=typeof t;return e=e??J2,!!e&&(r=="number"||r!="symbol"&&tk.test(t))&&t>-1&&t%1==0&&t<e}var ek=Object.prototype,rk=ek.hasOwnProperty;function ik(t,e){var r=on(t),i=!r&&sn(t),n=!r&&!i&&Es(t),a=!r&&!i&&!n&&Os(t),o=r||i||n||a,s=o?K2(t.length,String):[],l=s.length;for(var h in t)(e||rk.call(t,h))&&!(o&&(h=="length"||n&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Rd(h,l)))&&s.push(h);return s}function nk(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var ak=Object.prototype,sk=ak.hasOwnProperty;function ok(t){if(!Ye(t))return nk(t);var e=En(t),r=[];for(var i in t)i=="constructor"&&(e||!sk.call(t,i))||r.push(i);return r}function Nd(t){return On(t)?ik(t,!0):ok(t)}function lk(t){return Q2(t,Nd(t))}function hk(t,e,r,i,n,a,o){var s=Pa(t,r),l=Pa(e,r),h=o.get(l);if(h){Ia(t,r,h);return}var c=a?a(s,l,r+"",t,e,o):void 0,d=c===void 0;if(d){var u=on(l),p=!u&&Es(l),f=!u&&!p&&Os(l);c=l,u||p||f?on(s)?c=s:d2(s)?c=i2(s):p?(d=!1,c=t2(l,!0)):f?(d=!1,c=r2(l,!0)):c=[]:k2(l)||sn(l)?(c=s,sn(s)?c=lk(s):(!Ye(s)||Fs(s))&&(c=s2(l))):d=!1}d&&(o.set(l,c),n(c,l,i,a,o),o.delete(l)),Ia(t,r,c)}function jd(t,e,r,i,n){t!==e&&Kb(e,function(a,o){if(n||(n=new tr),Ye(a))hk(t,e,o,r,jd,i,n);else{var s=i?i(Pa(t,o),a,o+"",t,e,n):void 0;s===void 0&&(s=a),Ia(t,o,s)}},Nd)}function Wd(t){return t}function ck(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Ko=Math.max;function dk(t,e,r){return e=Ko(e===void 0?t.length-1:e,0),function(){for(var i=arguments,n=-1,a=Ko(i.length-e,0),o=Array(a);++n<a;)o[n]=i[e+n];n=-1;for(var s=Array(e+1);++n<e;)s[n]=i[n];return s[e]=r(o),ck(t,this,s)}}function uk(t){return function(){return t}}var pk=an?function(t,e){return an(t,"toString",{configurable:!0,enumerable:!1,value:uk(e),writable:!0})}:Wd,gk=800,fk=16,yk=Date.now;function mk(t){var e=0,r=0;return function(){var i=yk(),n=fk-(i-r);if(r=i,n>0){if(++e>=gk)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var xk=mk(pk);function bk(t,e){return xk(dk(t,e,Wd),t+"")}function kk(t,e,r){if(!Ye(r))return!1;var i=typeof e;return(i=="number"?On(r)&&Rd(e,r.length):i=="string"&&e in r)?Ln(r[e],t):!1}function Ck(t){return bk(function(e,r){var i=-1,n=r.length,a=n>1?r[n-1]:void 0,o=n>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(n--,a):void 0,o&&kk(r[0],r[1],o)&&(a=n<3?void 0:a,n=1),e=Object(e);++i<n;){var s=r[i];s&&t(e,s,i,a)}return e})}var wk=Ck(function(t,e,r){jd(t,e,r)}),_k="",Sk={curveBasis:Mi,curveBasisClosed:Tx,curveBasisOpen:Bx,curveBumpX:Mh,curveBumpY:$h,curveBundle:Mx,curveCardinalClosed:$x,curveCardinalOpen:Lx,curveCardinal:Eh,curveCatmullRomClosed:Fx,curveCatmullRomOpen:Ax,curveCatmullRom:Dh,curveLinear:Gi,curveLinearClosed:Ex,curveMonotoneX:Nh,curveMonotoneY:jh,curveNatural:Hh,curveStep:Yh,curveStepAfter:Uh,curveStepBefore:Vh},vk=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Tk=g(function(t,e){const r=Hd(t,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const o=r.map(s=>s.args);Pi(o),i=gt(i,[...o])}else i=r.args;if(!i)return;let n=ns(t,e);const a="config";return i[a]!==void 0&&(n==="flowchart-v2"&&(n="flowchart"),i[n]=i[a],delete i[a]),i},"detectInit"),Hd=g(function(t,e=null){try{const r=new RegExp(`[%]{2}(?![{]${vk.source})(?=[}][%]{2}).*
`,"ig");t=t.trim().replace(r,"").replace(/'/gm,'"'),F.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let i;const n=[];for(;(i=zr.exec(t))!==null;)if(i.index===zr.lastIndex&&zr.lastIndex++,i&&!e||e&&i[1]?.match(e)||e&&i[2]?.match(e)){const a=i[1]?i[1]:i[2],o=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;n.push({type:a,args:o})}return n.length===0?{type:t,args:null}:n.length===1?n[0]:n}catch(r){return F.error(`ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),Bk=g(function(t){return t.replace(zr,"")},"removeDirectives"),Mk=g(function(t,e){for(const[r,i]of e.entries())if(i.match(t))return r;return-1},"isSubstringInArray");function Ds(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Sk[r]??e}g(Ds,"interpolateToCurve");function Yd(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?G1.sanitizeUrl(r):r}g(Yd,"formatUrl");var $k=g((t,...e)=>{const r=t.split("."),i=r.length-1,n=r[i];let a=window;for(let o=0;o<i;o++)if(a=a[r[o]],!a){F.error(`Function name: ${t} not found in window`);return}a[n](...e)},"runFunc");function Is(t,e){return!t||!e?0:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}g(Is,"distance");function Vd(t){let e,r=0;t.forEach(n=>{r+=Is(n,e),e=n});const i=r/2;return Ps(t,i)}g(Vd,"traverseEdge");function Ud(t){return t.length===1?t[0]:Vd(t)}g(Ud,"calcLabelPosition");var Jo=g((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),Ps=g((t,e)=>{let r,i=e;for(const n of t){if(r){const a=Is(n,r);if(a===0)return r;if(a<i)i-=a;else{const o=i/a;if(o<=0)return r;if(o>=1)return{x:n.x,y:n.y};if(o>0&&o<1)return{x:Jo((1-o)*r.x+o*n.x,5),y:Jo((1-o)*r.y+o*n.y,5)}}}r=n}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Lk=g((t,e,r)=>{F.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=Ps(e,25),n=t?10:5,a=Math.atan2(e[0].y-i.y,e[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(a)*n+(e[0].x+i.x)/2,o.y=-Math.cos(a)*n+(e[0].y+i.y)/2,o},"calcCardinalityPosition");function Gd(t,e,r){const i=structuredClone(r);F.info("our points",i),e!=="start_left"&&e!=="start_right"&&i.reverse();const n=25+t,a=Ps(i,n),o=10+t*.5,s=Math.atan2(i[0].y-a.y,i[0].x-a.x),l={x:0,y:0};return e==="start_left"?(l.x=Math.sin(s+Math.PI)*o+(i[0].x+a.x)/2,l.y=-Math.cos(s+Math.PI)*o+(i[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(s-Math.PI)*o+(i[0].x+a.x)/2-5,l.y=-Math.cos(s-Math.PI)*o+(i[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(s)*o+(i[0].x+a.x)/2-5,l.y=-Math.cos(s)*o+(i[0].y+a.y)/2-5):(l.x=Math.sin(s)*o+(i[0].x+a.x)/2,l.y=-Math.cos(s)*o+(i[0].y+a.y)/2),l}g(Gd,"calcTerminalLabelPosition");function Xd(t){let e="",r="";for(const i of t)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":e=e+i+";");return{style:e,labelStyle:r}}g(Xd,"getStylesFromArray");var tl=0,Fk=g(()=>(tl++,"id-"+Math.random().toString(36).substr(2,12)+"-"+tl),"generateId");function Zd(t){let e="";const r="0123456789abcdef",i=r.length;for(let n=0;n<t;n++)e+=r.charAt(Math.floor(Math.random()*i));return e}g(Zd,"makeRandomHex");var Ak=g(t=>Zd(t.length),"random"),Ek=g(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"),Ok=g(function(t,e){const r=e.text.replace(gr.lineBreakRegex," "),[,i]=Dn(e.fontSize),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.style("text-anchor",e.anchor),n.style("font-family",e.fontFamily),n.style("font-size",i),n.style("font-weight",e.fontWeight),n.attr("fill",e.fill),e.class!==void 0&&n.attr("class",e.class);const a=n.append("tspan");return a.attr("x",e.x+e.textMargin*2),a.attr("fill",e.fill),a.text(r),n},"drawSimpleText"),Dk=si((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),gr.lineBreakRegex.test(t)))return t;const i=t.split(" ").filter(Boolean),n=[];let a="";return i.forEach((o,s)=>{const l=ue(`${o} `,r),h=ue(a,r);if(l>e){const{hyphenatedStrings:c,remainingWord:d}=Ik(o,e,"-",r);n.push(a,...c),a=d}else h+l>=e?(n.push(a),a=o):a=[a,o].filter(Boolean).join(" ");s+1===i.length&&n.push(a)}),n.filter(o=>o!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),Ik=si((t,e,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const n=[...t],a=[];let o="";return n.forEach((s,l)=>{const h=`${o}${s}`;if(ue(h,i)>=e){const c=l+1,d=n.length===c,u=`${h}${r}`;a.push(d?h:u),o=""}else o=h}),{hyphenatedStrings:a,remainingWord:o}},(t,e,r="-",i)=>`${t}${e}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Qd(t,e){return zs(t,e).height}g(Qd,"calculateTextHeight");function ue(t,e){return zs(t,e).width}g(ue,"calculateTextWidth");var zs=si((t,e)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:n=400}=e;if(!t)return{width:0,height:0};const[,a]=Dn(r),o=["sans-serif",i],s=t.split(gr.lineBreakRegex),l=[],h=it("body");if(!h.remove)return{width:0,height:0,lineHeight:0};const c=h.append("svg");for(const u of o){let p=0;const f={width:0,height:0,lineHeight:0};for(const y of s){const m=Ek();m.text=y||_k;const x=Ok(c,m).style("font-size",a).style("font-weight",n).style("font-family",u),b=(x._groups||x)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");f.width=Math.round(Math.max(f.width,b.width)),p=Math.round(b.height),f.height+=p,f.lineHeight=Math.round(Math.max(f.lineHeight,p))}l.push(f)}c.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Pk=class{constructor(t=!1,e){this.count=0,this.count=e?e.length:0,this.next=t?()=>this.count++:()=>Date.now()}static{g(this,"InitIDGenerator")}},yi,zk=g(function(t){return yi=yi||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),yi.innerHTML=t,unescape(yi.textContent)},"entityDecode");function qs(t){return"str"in t}g(qs,"isDetailedError");var qk=g((t,e,r,i)=>{if(!i)return;const n=t.node()?.getBBox();n&&t.append("text").text(i).attr("text-anchor","middle").attr("x",n.x+n.width/2).attr("y",-r).attr("class",e)},"insertTitle"),Dn=g(t=>{if(typeof t=="number")return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function Rs(t,e){return wk({},t,e)}g(Rs,"cleanAndMerge");var Yt={assignWithDepth:gt,wrapLabel:Dk,calculateTextHeight:Qd,calculateTextWidth:ue,calculateTextDimensions:zs,cleanAndMerge:Rs,detectInit:Tk,detectDirective:Hd,isSubstringInArray:Mk,interpolateToCurve:Ds,calcLabelPosition:Ud,calcCardinalityPosition:Lk,calcTerminalLabelPosition:Gd,formatUrl:Yd,getStylesFromArray:Xd,generateId:Fk,random:Ak,runFunc:$k,entityDecode:zk,insertTitle:qk,isLabelCoordinateInPath:Kd,parseFontSize:Dn,InitIDGenerator:Pk},Rk=g(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),e},"encodeEntities"),Ge=g(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),jT=g((t,e,{counter:r=0,prefix:i,suffix:n},a)=>a||`${i?`${i}_`:""}${t}_${e}_${r}${n?`_${n}`:""}`,"getEdgeId");function Tt(t){return t??null}g(Tt,"handleUndefinedAttr");function Kd(t,e){const r=Math.round(t.x),i=Math.round(t.y),n=e.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return n.includes(r.toString())||n.includes(i.toString())}g(Kd,"isLabelCoordinateInPath");const Nk=Object.freeze({left:0,top:0,width:16,height:16}),ln=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Jd=Object.freeze({...Nk,...ln}),jk=Object.freeze({...Jd,body:"",hidden:!1}),Wk=Object.freeze({width:null,height:null}),Hk=Object.freeze({...Wk,...ln}),Yk=(t,e,r,i="")=>{const n=t.split(":");if(t.slice(0,1)==="@"){if(n.length<2||n.length>3)return null;i=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const s=n.pop(),l=n.pop(),h={provider:n.length>0?n[0]:i,prefix:l,name:s};return Kn(h)?h:null}const a=n[0],o=a.split("-");if(o.length>1){const s={provider:i,prefix:o.shift(),name:o.join("-")};return Kn(s)?s:null}if(r&&i===""){const s={provider:i,prefix:"",name:a};return Kn(s,r)?s:null}return null},Kn=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function Vk(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const i=((t.rotate||0)+(e.rotate||0))%4;return i&&(r.rotate=i),r}function el(t,e){const r=Vk(t,e);for(const i in jk)i in ln?i in t&&!(i in r)&&(r[i]=ln[i]):i in e?r[i]=e[i]:i in t&&(r[i]=t[i]);return r}function Uk(t,e){const r=t.icons,i=t.aliases||Object.create(null),n=Object.create(null);function a(o){if(r[o])return n[o]=[];if(!(o in n)){n[o]=null;const s=i[o]&&i[o].parent,l=s&&a(s);l&&(n[o]=[s].concat(l))}return n[o]}return(e||Object.keys(r).concat(Object.keys(i))).forEach(a),n}function rl(t,e,r){const i=t.icons,n=t.aliases||Object.create(null);let a={};function o(s){a=el(i[s]||n[s],a)}return o(e),r.forEach(o),el(t,a)}function Gk(t,e){if(t.icons[e])return rl(t,e,[]);const r=Uk(t,[e])[e];return r?rl(t,e,r):null}const Xk=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Zk=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function il(t,e,r){if(e===1)return t;if(r=r||100,typeof t=="number")return Math.ceil(t*e*r)/r;if(typeof t!="string")return t;const i=t.split(Xk);if(i===null||!i.length)return t;const n=[];let a=i.shift(),o=Zk.test(a);for(;;){if(o){const s=parseFloat(a);isNaN(s)?n.push(a):n.push(Math.ceil(s*e*r)/r)}else n.push(a);if(a=i.shift(),a===void 0)return n.join("");o=!o}}function Qk(t,e="defs"){let r="";const i=t.indexOf("<"+e);for(;i>=0;){const n=t.indexOf(">",i),a=t.indexOf("</"+e);if(n===-1||a===-1)break;const o=t.indexOf(">",a);if(o===-1)break;r+=t.slice(n+1,a).trim(),t=t.slice(0,i).trim()+t.slice(o+1)}return{defs:r,content:t}}function Kk(t,e){return t?"<defs>"+t+"</defs>"+e:e}function Jk(t,e,r){const i=Qk(t);return Kk(i.defs,e+i.content+r)}const tC=t=>t==="unset"||t==="undefined"||t==="none";function eC(t,e){const r={...Jd,...t},i={...Hk,...e},n={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,i].forEach(y=>{const m=[],x=y.hFlip,b=y.vFlip;let k=y.rotate;x?b?k+=2:(m.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),m.push("scale(-1 1)"),n.top=n.left=0):b&&(m.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),m.push("scale(1 -1)"),n.top=n.left=0);let _;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:_=n.height/2+n.top,m.unshift("rotate(90 "+_.toString()+" "+_.toString()+")");break;case 2:m.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:_=n.width/2+n.left,m.unshift("rotate(-90 "+_.toString()+" "+_.toString()+")");break}k%2===1&&(n.left!==n.top&&(_=n.left,n.left=n.top,n.top=_),n.width!==n.height&&(_=n.width,n.width=n.height,n.height=_)),m.length&&(a=Jk(a,'<g transform="'+m.join(" ")+'">',"</g>"))});const o=i.width,s=i.height,l=n.width,h=n.height;let c,d;o===null?(d=s===null?"1em":s==="auto"?h:s,c=il(d,l/h)):(c=o==="auto"?l:o,d=s===null?il(c,h/l):s==="auto"?h:s);const u={},p=(y,m)=>{tC(m)||(u[y]=m.toString())};p("width",c),p("height",d);const f=[n.left,n.top,l,h];return u.viewBox=f.join(" "),{attributes:u,viewBox:f,body:a}}const rC=/\sid="(\S+)"/g,iC="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let nC=0;function aC(t,e=iC){const r=[];let i;for(;i=rC.exec(t);)r.push(i[1]);if(!r.length)return t;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(a=>{const o=typeof e=="function"?e(a):e+(nC++).toString(),s=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+o+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function sC(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)r+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+t+"</svg>"}function Ns(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Xe=Ns();function nl(t){Xe=t}var Nr={exec:()=>null};function nt(t,e=""){let r=typeof t=="string"?t:t.source,i={replace:(n,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace($t.caret,"$1"),r=r.replace(n,o),i},getRegex:()=>new RegExp(r,e)};return i}var $t={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},oC=/^(?:[ \t]*(?:\n|$))+/,lC=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hC=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,li=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,cC=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,js=/(?:[*+-]|\d{1,9}[.)])/,tu=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,eu=nt(tu).replace(/bull/g,js).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),dC=nt(tu).replace(/bull/g,js).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ws=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,uC=/^[^\n]+/,Hs=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,pC=nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Hs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gC=nt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,js).getRegex(),In="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ys=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fC=nt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ys).replace("tag",In).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ru=nt(Ws).replace("hr",li).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",In).getRegex(),yC=nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ru).getRegex(),Vs={blockquote:yC,code:lC,def:pC,fences:hC,heading:cC,hr:li,html:fC,lheading:eu,list:gC,newline:oC,paragraph:ru,table:Nr,text:uC},al=nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",li).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",In).getRegex(),mC={...Vs,lheading:dC,table:al,paragraph:nt(Ws).replace("hr",li).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",al).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",In).getRegex()},xC={...Vs,html:nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ys).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Nr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:nt(Ws).replace("hr",li).replace("heading",` *#{1,6} *[^
]`).replace("lheading",eu).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},bC=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kC=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,iu=/^( {2,}|\\)\n(?!\s*$)/,CC=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pn=/[\p{P}\p{S}]/u,Us=/[\s\p{P}\p{S}]/u,nu=/[^\s\p{P}\p{S}]/u,wC=nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Us).getRegex(),au=/(?!~)[\p{P}\p{S}]/u,_C=/(?!~)[\s\p{P}\p{S}]/u,SC=/(?:[^\s\p{P}\p{S}]|~)/u,vC=nt(/link|code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code",/(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),su=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,TC=nt(su,"u").replace(/punct/g,Pn).getRegex(),BC=nt(su,"u").replace(/punct/g,au).getRegex(),ou="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",MC=nt(ou,"gu").replace(/notPunctSpace/g,nu).replace(/punctSpace/g,Us).replace(/punct/g,Pn).getRegex(),$C=nt(ou,"gu").replace(/notPunctSpace/g,SC).replace(/punctSpace/g,_C).replace(/punct/g,au).getRegex(),LC=nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,nu).replace(/punctSpace/g,Us).replace(/punct/g,Pn).getRegex(),FC=nt(/\\(punct)/,"gu").replace(/punct/g,Pn).getRegex(),AC=nt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),EC=nt(Ys).replace("(?:-->|$)","-->").getRegex(),OC=nt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",EC).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),hn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,DC=nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",hn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lu=nt(/^!?\[(label)\]\[(ref)\]/).replace("label",hn).replace("ref",Hs).getRegex(),hu=nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hs).getRegex(),IC=nt("reflink|nolink(?!\\()","g").replace("reflink",lu).replace("nolink",hu).getRegex(),sl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Gs={_backpedal:Nr,anyPunctuation:FC,autolink:AC,blockSkip:vC,br:iu,code:kC,del:Nr,emStrongLDelim:TC,emStrongRDelimAst:MC,emStrongRDelimUnd:LC,escape:bC,link:DC,nolink:hu,punctuation:wC,reflink:lu,reflinkSearch:IC,tag:OC,text:CC,url:Nr},PC={...Gs,link:nt(/^!?\[(label)\]\((.*?)\)/).replace("label",hn).getRegex(),reflink:nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",hn).getRegex()},za={...Gs,emStrongRDelimAst:$C,emStrongLDelim:BC,url:nt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",sl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:nt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",sl).getRegex()},zC={...za,br:nt(iu).replace("{2,}","*").getRegex(),text:nt(za.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},mi={normal:Vs,gfm:mC,pedantic:xC},Sr={normal:Gs,gfm:za,breaks:zC,pedantic:PC},qC={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ol=t=>qC[t];function Zt(t,e){if(e){if($t.escapeTest.test(t))return t.replace($t.escapeReplace,ol)}else if($t.escapeTestNoEncode.test(t))return t.replace($t.escapeReplaceNoEncode,ol);return t}function ll(t){try{t=encodeURI(t).replace($t.percentDecode,"%")}catch{return null}return t}function hl(t,e){let r=t.replace($t.findPipe,(a,o,s)=>{let l=!1,h=o;for(;--h>=0&&s[h]==="\\";)l=!l;return l?"|":" |"}),i=r.split($t.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace($t.slashPipe,"|");return i}function vr(t,e,r){let i=t.length;if(i===0)return"";let n=0;for(;n<i&&t.charAt(i-n-1)===e;)n++;return t.slice(0,i-n)}function RC(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&(r--,r<0))return i;return r>0?-2:-1}function cl(t,e,r,i,n){let a=e.href,o=e.title||null,s=t[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:o,text:s,tokens:i.inlineTokens(s)};return i.state.inLink=!1,l}function NC(t,e,r){let i=t.match(r.other.indentCodeCompensation);if(i===null)return e;let n=i[1];return e.split(`
`).map(a=>{let o=a.match(r.other.beginningSpace);if(o===null)return a;let[s]=o;return s.length>=n.length?a.slice(n.length):a}).join(`
`)}var cn=class{options;rules;lexer;constructor(t){this.options=t||Xe}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:vr(r,`
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],i=NC(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let i=vr(r,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(r=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:vr(e[0],`
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=vr(e[0],`
`).split(`
`),i="",n="",a=[];for(;r.length>0;){let o=!1,s=[],l;for(l=0;l<r.length;l++)if(this.rules.other.blockquoteStart.test(r[l]))s.push(r[l]),o=!0;else if(!o)s.push(r[l]);else break;r=r.slice(l);let h=s.join(`
`),c=h.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
${h}`:h,n=n?`${n}
${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,a,!0),this.lexer.state.top=d,r.length===0)break;let u=a.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let p=u,f=p.raw+`
`+r.join(`
`),y=this.blockquote(f);a[a.length-1]=y,i=i.substring(0,i.length-p.raw.length)+y.raw,n=n.substring(0,n.length-p.text.length)+y.text;break}else if(u?.type==="list"){let p=u,f=p.raw+`
`+r.join(`
`),y=this.list(f);a[a.length-1]=y,i=i.substring(0,i.length-u.raw.length)+y.raw,n=n.substring(0,n.length-p.raw.length)+y.raw,r=f.substring(a.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:i,tokens:a,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim(),i=r.length>1,n={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");let a=this.rules.other.listItemRegex(r),o=!1;for(;t;){let l=!1,h="",c="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;h=e[0],t=t.substring(h.length);let d=e[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),u=t.split(`
`,1)[0],p=!d.trim(),f=0;if(this.options.pedantic?(f=2,c=d.trimStart()):p?f=e[1].length+1:(f=e[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,c=d.slice(f),f+=e[1].length),p&&this.rules.other.blankLine.test(u)&&(h+=u+`
`,t=t.substring(u.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(f),b=this.rules.other.hrRegex(f),k=this.rules.other.fencesBeginRegex(f),_=this.rules.other.headingBeginRegex(f),C=this.rules.other.htmlBeginRegex(f);for(;t;){let B=t.split(`
`,1)[0],v;if(u=B,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),v=u):v=u.replace(this.rules.other.tabCharGlobal," "),k.test(u)||_.test(u)||C.test(u)||x.test(u)||b.test(u))break;if(v.search(this.rules.other.nonSpaceChar)>=f||!u.trim())c+=`
`+v.slice(f);else{if(p||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(d)||_.test(d)||b.test(d))break;c+=`
`+u}!p&&!u.trim()&&(p=!0),h+=B+`
`,t=t.substring(B.length+1),d=v.slice(f)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let y=null,m;this.options.gfm&&(y=this.rules.other.listIsTask.exec(c),y&&(m=y[0]!=="[ ] ",c=c.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:h,task:!!y,checked:m,loose:!1,text:c,tokens:[]}),n.raw+=h}let s=n.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let l=0;l<n.items.length;l++)if(this.lexer.state.top=!1,n.items[l].tokens=this.lexer.blockTokens(n.items[l].text,[]),!n.loose){let h=n.items[l].tokens.filter(d=>d.type==="space"),c=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=c}if(n.loose)for(let l=0;l<n.items.length;l++)n.items[l].loose=!0;return n}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:i,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=hl(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<r.length;o++)a.header.push({text:r[o],tokens:this.lexer.inline(r[o]),header:!0,align:a.align[o]});for(let o of n)a.rows.push(hl(o,a.header.length).map((s,l)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[l]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let a=vr(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=RC(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let i=e[2],n="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],n=a[3])}else n=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i=i.slice(1):i=i.slice(1,-1)),cl(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let i=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[i.toLowerCase()];if(!n){let a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return cl(r,n,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||i[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!r||this.rules.inline.punctuation.exec(r))){let n=[...i[0]].length-1,a,o,s=n,l=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*t.length+n);(i=h.exec(e))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){s+=o;continue}else if((i[5]||i[6])&&n%3&&!((n+o)%3)){l+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+l);let c=[...i[0]][0].length,d=t.slice(0,n+i.index+c+o);if(Math.min(n,o)%2){let p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}let u=d.slice(2,-2);return{type:"strong",raw:d,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(r),n=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return i&&n&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,i;return e[2]==="@"?(r=e[1],i="mailto:"+r):(r=e[1],i=r),{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let r,i;if(e[2]==="@")r=e[0],i="mailto:"+r;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);r=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},jt=class qa{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Xe,this.options.tokenizer=this.options.tokenizer||new cn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:$t,block:mi.normal,inline:Sr.normal};this.options.pedantic?(r.block=mi.pedantic,r.inline=Sr.pedantic):this.options.gfm&&(r.block=mi.gfm,this.options.breaks?r.inline=Sr.breaks:r.inline=Sr.gfm),this.tokenizer.rules=r}static get rules(){return{block:mi,inline:Sr}}static lex(e,r){return new qa(r).lex(e)}static lexInline(e,r){return new qa(r).inlineTokens(e)}lex(e){e=e.replace($t.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],i=!1){for(this.options.pedantic&&(e=e.replace($t.tabCharGlobal," ").replace($t.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(o=>(n=o.call({lexer:this},e,r))?(e=e.substring(n.raw.length),r.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let o=r.at(-1);n.raw.length===1&&o!==void 0?o.raw+=`
`:r.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let o=r.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+n.raw,o.text+=`
`+n.text,this.inlineQueue.at(-1).src=o.text):r.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let o=r.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+n.raw,o.text+=`
`+n.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},r.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),r.push(n);continue}let a=e;if(this.options.extensions?.startBlock){let o=1/0,s=e.slice(1),l;this.options.extensions.startBlock.forEach(h=>{l=h.call({lexer:this},s),typeof l=="number"&&l>=0&&(o=Math.min(o,l))}),o<1/0&&o>=0&&(a=e.substring(0,o+1))}if(this.state.top&&(n=this.tokenizer.paragraph(a))){let o=r.at(-1);i&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+n.raw,o.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):r.push(n),i=a.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let o=r.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
`)?"":`
`)+n.raw,o.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):r.push(n);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let i=e,n=null;if(this.tokens.links){let s=Object.keys(this.tokens.links);if(s.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)s.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,n.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(n=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,o="";for(;e;){a||(o=""),a=!1;let s;if(this.options.extensions?.inline?.some(h=>(s=h.call({lexer:this},e,r))?(e=e.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);let h=r.at(-1);s.type==="text"&&h?.type==="text"?(h.raw+=s.raw,h.text+=s.text):r.push(s);continue}if(s=this.tokenizer.emStrong(e,i,o)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),r.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),r.push(s);continue}let l=e;if(this.options.extensions?.startInline){let h=1/0,c=e.slice(1),d;this.options.extensions.startInline.forEach(u=>{d=u.call({lexer:this},c),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(l=e.substring(0,h+1))}if(s=this.tokenizer.inlineText(l)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(o=s.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=s.raw,h.text+=s.text):r.push(s);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},dn=class{options;parser;constructor(t){this.options=t||Xe}space(t){return""}code({text:t,lang:e,escaped:r}){let i=(e||"").match($t.notSpaceStart)?.[0],n=t.replace($t.endingNewline,"")+`
`;return i?'<pre><code class="language-'+Zt(i)+'">'+(r?n:Zt(n,!0))+`</code></pre>
`:"<pre><code>"+(r?n:Zt(n,!0))+`</code></pre>
`}blockquote({tokens:t}){return`<blockquote>
${this.parser.parse(t)}</blockquote>
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
`}hr(t){return`<hr>
`}list(t){let e=t.ordered,r=t.start,i="";for(let o=0;o<t.items.length;o++){let s=t.items[o];i+=this.listitem(s)}let n=e?"ol":"ul",a=e&&r!==1?' start="'+r+'"':"";return"<"+n+a+`>
`+i+"</"+n+`>
`}listitem(t){let e="";if(t.task){let r=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+Zt(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
`}table(t){let e="",r="";for(let n=0;n<t.header.length;n++)r+=this.tablecell(t.header[n]);e+=this.tablerow({text:r});let i="";for(let n=0;n<t.rows.length;n++){let a=t.rows[n];r="";for(let o=0;o<a.length;o++)r+=this.tablecell(a[o]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+i+`</table>
`}tablerow({text:t}){return`<tr>
${t}</tr>
`}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Zt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let i=this.parser.parseInline(r),n=ll(t);if(n===null)return i;t=n;let a='<a href="'+t+'"';return e&&(a+=' title="'+Zt(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let n=ll(t);if(n===null)return Zt(r);t=n;let a=`<img src="${t}" alt="${r}"`;return e&&(a+=` title="${Zt(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Zt(t.text)}},Xs=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Wt=class Ra{options;renderer;textRenderer;constructor(e){this.options=e||Xe,this.options.renderer=this.options.renderer||new dn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Xs}static parse(e,r){return new Ra(r).parse(e)}static parseInline(e,r){return new Ra(r).parseInline(e)}parse(e,r=!0){let i="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions?.renderers?.[a.type]){let s=a,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){i+=l||"";continue}}let o=a;switch(o.type){case"space":{i+=this.renderer.space(o);continue}case"hr":{i+=this.renderer.hr(o);continue}case"heading":{i+=this.renderer.heading(o);continue}case"code":{i+=this.renderer.code(o);continue}case"table":{i+=this.renderer.table(o);continue}case"blockquote":{i+=this.renderer.blockquote(o);continue}case"list":{i+=this.renderer.list(o);continue}case"html":{i+=this.renderer.html(o);continue}case"def":{i+=this.renderer.def(o);continue}case"paragraph":{i+=this.renderer.paragraph(o);continue}case"text":{let s=o,l=this.renderer.text(s);for(;n+1<e.length&&e[n+1].type==="text";)s=e[++n],l+=`
`+this.renderer.text(s);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return i}parseInline(e,r=this.renderer){let i="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions?.renderers?.[a.type]){let s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){i+=s||"";continue}}let o=a;switch(o.type){case"escape":{i+=r.text(o);break}case"html":{i+=r.html(o);break}case"link":{i+=r.link(o);break}case"image":{i+=r.image(o);break}case"strong":{i+=r.strong(o);break}case"em":{i+=r.em(o);break}case"codespan":{i+=r.codespan(o);break}case"br":{i+=r.br(o);break}case"del":{i+=r.del(o);break}case"text":{i+=r.text(o);break}default:{let s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return i}},Ar=class{options;block;constructor(t){this.options=t||Xe}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?jt.lex:jt.lexInline}provideParser(){return this.block?Wt.parse:Wt.parseInline}},jC=class{defaults=Ns();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Wt;Renderer=dn;TextRenderer=Xs;Lexer=jt;Tokenizer=cn;Hooks=Ar;constructor(...t){this.use(...t)}walkTokens(t,e){let r=[];for(let i of t)switch(r=r.concat(e.call(this,i)),i.type){case"table":{let n=i;for(let a of n.header)r=r.concat(this.walkTokens(a.tokens,e));for(let a of n.rows)for(let o of a)r=r.concat(this.walkTokens(o.tokens,e));break}case"list":{let n=i;r=r.concat(this.walkTokens(n.items,e));break}default:{let n=i;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(a=>{let o=n[a].flat(1/0);r=r.concat(this.walkTokens(o,e))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let a=e.renderers[n.name];a?e.renderers[n.name]=function(...o){let s=n.renderer.apply(this,o);return s===!1&&(s=a.apply(this,o)),s}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[n.level];a?a.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),i.extensions=e),r.renderer){let n=this.defaults.renderer||new dn(this.defaults);for(let a in r.renderer){if(!(a in n))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,s=r.renderer[o],l=n[o];n[o]=(...h)=>{let c=s.apply(n,h);return c===!1&&(c=l.apply(n,h)),c||""}}i.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new cn(this.defaults);for(let a in r.tokenizer){if(!(a in n))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,s=r.tokenizer[o],l=n[o];n[o]=(...h)=>{let c=s.apply(n,h);return c===!1&&(c=l.apply(n,h)),c}}i.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new Ar;for(let a in r.hooks){if(!(a in n))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,s=r.hooks[o],l=n[o];Ar.passThroughHooks.has(a)?n[o]=h=>{if(this.defaults.async&&Ar.passThroughHooksRespectAsync.has(a))return(async()=>{let d=await s.call(n,h);return l.call(n,d)})();let c=s.call(n,h);return l.call(n,c)}:n[o]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await s.apply(n,h);return d===!1&&(d=await l.apply(n,h)),d})();let c=s.apply(n,h);return c===!1&&(c=l.apply(n,h)),c}}i.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,a=r.walkTokens;i.walkTokens=function(o){let s=[];return s.push(a.call(this,o)),n&&(s=s.concat(n.call(this,o))),s}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return jt.lex(t,e??this.defaults)}parser(t,e){return Wt.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let i={...r},n={...this.defaults,...i},a=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let o=n.hooks?await n.hooks.preprocess(e):e,s=await(n.hooks?await n.hooks.provideLexer():t?jt.lex:jt.lexInline)(o,n),l=n.hooks?await n.hooks.processAllTokens(s):s;n.walkTokens&&await Promise.all(this.walkTokens(l,n.walkTokens));let h=await(n.hooks?await n.hooks.provideParser():t?Wt.parse:Wt.parseInline)(l,n);return n.hooks?await n.hooks.postprocess(h):h})().catch(a);try{n.hooks&&(e=n.hooks.preprocess(e));let o=(n.hooks?n.hooks.provideLexer():t?jt.lex:jt.lexInline)(e,n);n.hooks&&(o=n.hooks.processAllTokens(o)),n.walkTokens&&this.walkTokens(o,n.walkTokens);let s=(n.hooks?n.hooks.provideParser():t?Wt.parse:Wt.parseInline)(o,n);return n.hooks&&(s=n.hooks.postprocess(s)),s}catch(o){return a(o)}}}onError(t,e){return r=>{if(r.message+=`
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Zt(r.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(r);throw r}}},Le=new jC;function at(t,e){return Le.parse(t,e)}at.options=at.setOptions=function(t){return Le.setOptions(t),at.defaults=Le.defaults,nl(at.defaults),at},at.getDefaults=Ns,at.defaults=Xe,at.use=function(...t){return Le.use(...t),at.defaults=Le.defaults,nl(at.defaults),at},at.walkTokens=function(t,e){return Le.walkTokens(t,e)},at.parseInline=Le.parseInline,at.Parser=Wt,at.parser=Wt.parse,at.Renderer=dn,at.TextRenderer=Xs,at.Lexer=jt,at.lexer=jt.lex,at.Tokenizer=cn,at.Hooks=Ar,at.parse=at,at.options,at.setOptions,at.use,at.walkTokens,at.parseInline,Wt.parse,jt.lex;function cu(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var i=Array.from(typeof t=="string"?[t]:t);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var n=i.reduce(function(s,l){var h=l.match(/\n([\t ]+|(?!\s).)/g);return h?s.concat(h.map(function(c){var d,u;return(u=(d=c.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&u!==void 0?u:0})):s},[]);if(n.length){var a=new RegExp(`
[ ]{`+Math.min.apply(Math,n)+"}","g");i=i.map(function(s){return s.replace(a,`
`)})}i[0]=i[0].replace(/^\r?\n/,"");var o=i[0];return e.forEach(function(s,l){var h=o.match(/(?:^|\n)( *)$/),c=h?h[1]:"",d=s;typeof s=="string"&&s.includes(`
`)&&(d=String(s).split(`
`).map(function(u,p){return p===0?u:""+c+u}).join(`
`)),o+=d+i[l+1]}),o}var WC={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},Na=new Map,du=new Map,HC=g(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(F.debug("Registering icon pack:",e.name),"loader"in e)du.set(e.name,e.loader);else if("icons"in e)Na.set(e.name,e.icons);else throw F.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),uu=g(async(t,e)=>{const r=Yk(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);const i=r.prefix||e;if(!i)throw new Error(`Icon name must contain a prefix: ${t}`);let n=Na.get(i);if(!n){const o=du.get(i);if(!o)throw new Error(`Icon set not found: ${r.prefix}`);try{n={...await o(),prefix:i},Na.set(i,n)}catch(s){throw F.error(s),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=Gk(n,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),YC=g(async t=>{try{return await uu(t),!0}catch{return!1}},"isIconAvailable"),hi=g(async(t,e,r)=>{let i;try{i=await uu(t,e?.fallbackPrefix)}catch(o){F.error(o),i=WC}const n=eC(i,e),a=sC(aC(n.body),{...n.attributes,...r});return qt(a,St())},"getIconSVG");function pu(t,{markdownAutoWrap:e}){const r=t.replace(/<br\/>/g,`
`).replace(/\n{2,}/g,`
`),i=cu(r);return e===!1?i.replace(/ /g,"&nbsp;"):i}g(pu,"preprocessMarkdown");function gu(t,e={}){const r=pu(t,e),i=at.lexer(r),n=[[]];let a=0;function o(s,l="normal"){s.type==="text"?s.text.split(`
`).forEach((h,c)=>{c!==0&&(a++,n.push([])),h.split(" ").forEach(d=>{d=d.replace(/&#39;/g,"'"),d&&n[a].push({content:d,type:l})})}):s.type==="strong"||s.type==="em"?s.tokens.forEach(h=>{o(h,s.type)}):s.type==="html"&&n[a].push({content:s.text,type:"normal"})}return g(o,"processNode"),i.forEach(s=>{s.type==="paragraph"?s.tokens?.forEach(l=>{o(l)}):s.type==="html"?n[a].push({content:s.text,type:"normal"}):n[a].push({content:s.raw,type:"normal"})}),n}g(gu,"markdownToLines");function fu(t,{markdownAutoWrap:e}={}){const r=at.lexer(t);function i(n){return n.type==="text"?e===!1?n.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):n.text.replace(/\n */g,"<br/>"):n.type==="strong"?`<strong>${n.tokens?.map(i).join("")}</strong>`:n.type==="em"?`<em>${n.tokens?.map(i).join("")}</em>`:n.type==="paragraph"?`<p>${n.tokens?.map(i).join("")}</p>`:n.type==="space"?"":n.type==="html"?`${n.text}`:n.type==="escape"?n.text:(F.warn(`Unsupported markdown: ${n.type}`),n.raw)}return g(i,"output"),r.map(i).join("")}g(fu,"markdownToHTML");function yu(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}g(yu,"splitTextToChars");function mu(t,e){const r=yu(e.content);return Zs(t,[],r,e.type)}g(mu,"splitWordToFitWidth");function Zs(t,e,r,i){if(r.length===0)return[{content:e.join(""),type:i},{content:"",type:i}];const[n,...a]=r,o=[...e,n];return t([{content:o.join(""),type:i}])?Zs(t,o,a,i):(e.length===0&&n&&(e.push(n),r.shift()),[{content:e.join(""),type:i},{content:r.join(""),type:i}])}g(Zs,"splitWordToFitWidthRecursion");function xu(t,e){if(t.some(({content:r})=>r.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return un(t,e)}g(xu,"splitLineToFitWidth");function un(t,e,r=[],i=[]){if(t.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let n="";t[0].content===" "&&(n=" ",t.shift());const a=t.shift()??{content:" ",type:"normal"},o=[...i];if(n!==""&&o.push({content:n,type:"normal"}),o.push(a),e(o))return un(t,e,r,o);if(i.length>0)r.push(i),t.unshift(a);else if(a.content){const[s,l]=mu(e,a);r.push([s]),l.content&&t.unshift(l)}return un(t,e,r)}g(un,"splitLineToFitWidthRecursion");function ja(t,e){e&&t.attr("style",e)}g(ja,"applyStyle");async function bu(t,e,r,i,n=!1,a=St()){const o=t.append("foreignObject");o.attr("width",`${10*r}px`),o.attr("height",`${10*r}px`);const s=o.append("xhtml:div"),l=lr(e.label)?await as(e.label.replace(gr.lineBreakRegex,`
`),a):qt(e.label,a),h=e.isNode?"nodeLabel":"edgeLabel",c=s.append("span");c.html(l),ja(c,e.labelStyle),c.attr("class",`${h} ${i}`),ja(s,e.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),s.style("max-width",r+"px"),s.style("text-align","center"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),n&&s.attr("class","labelBkg");let d=s.node().getBoundingClientRect();return d.width===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px"),d=s.node().getBoundingClientRect()),o.node()}g(bu,"addHtmlSpan");function zn(t,e,r){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em")}g(zn,"createTspan");function ku(t,e,r){const i=t.append("text"),n=zn(i,1,e);qn(n,r);const a=n.node().getComputedTextLength();return i.remove(),a}g(ku,"computeWidthOfText");function VC(t,e,r){const i=t.append("text"),n=zn(i,1,e);qn(n,[{content:r,type:"normal"}]);const a=n.node()?.getBoundingClientRect();return a&&i.remove(),a}g(VC,"computeDimensionOfText");function Cu(t,e,r,i=!1){const n=e.append("g"),a=n.insert("rect").attr("class","background").attr("style","stroke: none"),o=n.append("text").attr("y","-10.1");let s=0;for(const l of r){const h=g(d=>ku(n,1.1,d)<=t,"checkWidth"),c=h(l)?[l]:xu(l,h);for(const d of c){const u=zn(o,s,1.1);qn(u,d),s++}}if(i){const l=o.node().getBBox(),h=2;return a.attr("x",l.x-h).attr("y",l.y-h).attr("width",l.width+2*h).attr("height",l.height+2*h),n.node()}else return o.node()}g(Cu,"createFormattedText");function qn(t,e){t.text(""),e.forEach((r,i)=>{const n=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?n.text(r.content):n.text(" "+r.content)})}g(qn,"updateTextContentAndStyles");async function wu(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(n,a,o)=>(r.push((async()=>{const s=`${a}:${o}`;return await YC(s)?await hi(s,void 0,{class:"label-icon"}):`<i class='${qt(n,e).replace(":"," ")}'></i>`})()),n));const i=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}g(wu,"replaceIconSubstring");var ve=g(async(t,e="",{style:r="",isTitle:i=!1,classes:n="",useHtmlLabels:a=!0,isNode:o=!0,width:s=200,addSvgBackground:l=!1}={},h)=>{if(F.debug("XYZ createText",e,r,i,n,a,o,"addSvgBackground: ",l),a){const c=fu(e,h),d=await wu(Ge(c),h),u=e.replace(/\\\\/g,"\\"),p={isNode:o,label:lr(e)?u:d,labelStyle:r.replace("fill:","color:")};return await bu(t,p,s,n,l,h)}else{const c=e.replace(/<br\s*\/?>/g,"<br/>"),d=gu(c.replace("<br>","<br/>"),h),u=Cu(s,t,d,e?l:!1);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");it(u).attr("style",p)}else{const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");it(u).select("rect").attr("style",p.replace(/background:/g,"fill:"));const f=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");it(u).select("text").attr("style",f)}return u}},"createText");function Jn(t,e,r){if(t&&t.length){const[i,n]=e,a=Math.PI/180*r,o=Math.cos(a),s=Math.sin(a);for(const l of t){const[h,c]=l;l[0]=(h-i)*o-(c-n)*s+i,l[1]=(h-i)*s+(c-n)*o+n}}}function UC(t,e){return t[0]===e[0]&&t[1]===e[1]}function GC(t,e,r,i=1){const n=r,a=Math.max(e,.1),o=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,s=[0,0];if(n)for(const h of o)Jn(h,s,n);const l=(function(h,c,d){const u=[];for(const b of h){const k=[...b];UC(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&u.push(k)}const p=[];c=Math.max(c,.1);const f=[];for(const b of u)for(let k=0;k<b.length-1;k++){const _=b[k],C=b[k+1];if(_[1]!==C[1]){const B=Math.min(_[1],C[1]);f.push({ymin:B,ymax:Math.max(_[1],C[1]),x:B===_[1]?_[0]:C[0],islope:(C[0]-_[0])/(C[1]-_[1])})}}if(f.sort((b,k)=>b.ymin<k.ymin?-1:b.ymin>k.ymin?1:b.x<k.x?-1:b.x>k.x?1:b.ymax===k.ymax?0:(b.ymax-k.ymax)/Math.abs(b.ymax-k.ymax)),!f.length)return p;let y=[],m=f[0].ymin,x=0;for(;y.length||f.length;){if(f.length){let b=-1;for(let k=0;k<f.length&&!(f[k].ymin>m);k++)b=k;f.splice(0,b+1).forEach(k=>{y.push({s:m,edge:k})})}if(y=y.filter(b=>!(b.edge.ymax<=m)),y.sort((b,k)=>b.edge.x===k.edge.x?0:(b.edge.x-k.edge.x)/Math.abs(b.edge.x-k.edge.x)),(d!==1||x%c==0)&&y.length>1)for(let b=0;b<y.length;b+=2){const k=b+1;if(k>=y.length)break;const _=y[b].edge,C=y[k].edge;p.push([[Math.round(_.x),m],[Math.round(C.x),m]])}m+=d,y.forEach(b=>{b.edge.x=b.edge.x+d*b.edge.islope}),x++}return p})(o,a,i);if(n){for(const h of o)Jn(h,s,-n);(function(h,c,d){const u=[];h.forEach(p=>u.push(...p)),Jn(u,c,d)})(l,s,-n)}return l}function ci(t,e){var r;const i=e.hachureAngle+90;let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.round(Math.max(n,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=n),GC(t,n,i,a||1)}class Qs{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const i=ci(e,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(e,r){const i=[];for(const n of e)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],r));return i}}function Rn(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class XC extends Qs{fillPolygons(e,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const n=ci(e,Object.assign({},r,{hachureGap:i})),a=Math.PI/180*r.hachureAngle,o=[],s=.5*i*Math.cos(a),l=.5*i*Math.sin(a);for(const[h,c]of n)Rn([h,c])&&o.push([[h[0]-s,h[1]+l],[...c]],[[h[0]+s,h[1]-l],[...c]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}}class ZC extends Qs{fillPolygons(e,r){const i=this._fillPolygons(e,r),n=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,n);return i.ops=i.ops.concat(a.ops),i}}class QC{constructor(e){this.helper=e}fillPolygons(e,r){const i=ci(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(e,r){const i=[];let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const o=n/4;for(const s of e){const l=Rn(s),h=l/n,c=Math.ceil(h)-1,d=l-c*n,u=(s[0][0]+s[1][0])/2-n/4,p=Math.min(s[0][1],s[1][1]);for(let f=0;f<c;f++){const y=p+d+f*n,m=u-o+2*Math.random()*o,x=y-o+2*Math.random()*o,b=this.helper.ellipse(m,x,a,a,r);i.push(...b.ops)}}return{type:"fillSketch",ops:i}}}class KC{constructor(e){this.helper=e}fillPolygons(e,r){const i=ci(e,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(e,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,n=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,a=[];return e.forEach(o=>{const s=Rn(o),l=Math.floor(s/(i+n)),h=(s+n-l*(i+n))/2;let c=o[0],d=o[1];c[0]>d[0]&&(c=o[1],d=o[0]);const u=Math.atan((d[1]-c[1])/(d[0]-c[0]));for(let p=0;p<l;p++){const f=p*(i+n),y=f+i,m=[c[0]+f*Math.cos(u)+h*Math.cos(u),c[1]+f*Math.sin(u)+h*Math.sin(u)],x=[c[0]+y*Math.cos(u)+h*Math.cos(u),c[1]+y*Math.sin(u)+h*Math.sin(u)];a.push(...this.helper.doubleLineOps(m[0],m[1],x[0],x[1],r))}}),a}}class JC{constructor(e){this.helper=e}fillPolygons(e,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,n=r.zigzagOffset<0?i:r.zigzagOffset,a=ci(e,r=Object.assign({},r,{hachureGap:i+n}));return{type:"fillSketch",ops:this.zigzagLines(a,n,r)}}zigzagLines(e,r,i){const n=[];return e.forEach(a=>{const o=Rn(a),s=Math.round(o/(2*r));let l=a[0],h=a[1];l[0]>h[0]&&(l=a[1],h=a[0]);const c=Math.atan((h[1]-l[1])/(h[0]-l[0]));for(let d=0;d<s;d++){const u=2*d*r,p=2*(d+1)*r,f=Math.sqrt(2*Math.pow(r,2)),y=[l[0]+u*Math.cos(c),l[1]+u*Math.sin(c)],m=[l[0]+p*Math.cos(c),l[1]+p*Math.sin(c)],x=[y[0]+f*Math.cos(c+Math.PI/4),y[1]+f*Math.sin(c+Math.PI/4)];n.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],i),...this.helper.doubleLineOps(x[0],x[1],m[0],m[1],i))}}),n}}const Ft={};class tw{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const ew=0,ta=1,dl=2,xi={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 ea(t,e){return t.type===e}function Ks(t){const e=[],r=(function(o){const s=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))s[s.length]={type:ew,text:RegExp.$1},o=o.substr(RegExp.$1.length);else{if(!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];s[s.length]={type:ta,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return s[s.length]={type:dl,text:""},s})(t);let i="BOD",n=0,a=r[n];for(;!ea(a,dl);){let o=0;const s=[];if(i==="BOD"){if(a.text!=="M"&&a.text!=="m")return Ks("M0,0"+t);n++,o=xi[a.text],i=a.text}else ea(a,ta)?o=xi[i]:(n++,o=xi[a.text],i=a.text);if(!(n+o<r.length))throw new Error("Path data ended short");for(let l=n;l<n+o;l++){const h=r[l];if(!ea(h,ta))throw new Error("Param not a number: "+i+","+h.text);s[s.length]=+h.text}if(typeof xi[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:s};e.push(l),n+=o,a=r[n],i==="M"&&(i="L"),i==="m"&&(i="l")}}return e}function _u(t){let e=0,r=0,i=0,n=0;const a=[];for(const{key:o,data:s}of t)switch(o){case"M":a.push({key:"M",data:[...s]}),[e,r]=s,[i,n]=s;break;case"m":e+=s[0],r+=s[1],a.push({key:"M",data:[e,r]}),i=e,n=r;break;case"L":a.push({key:"L",data:[...s]}),[e,r]=s;break;case"l":e+=s[0],r+=s[1],a.push({key:"L",data:[e,r]});break;case"C":a.push({key:"C",data:[...s]}),e=s[4],r=s[5];break;case"c":{const l=s.map((h,c)=>c%2?h+r:h+e);a.push({key:"C",data:l}),e=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...s]}),e=s[2],r=s[3];break;case"q":{const l=s.map((h,c)=>c%2?h+r:h+e);a.push({key:"Q",data:l}),e=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...s]}),e=s[5],r=s[6];break;case"a":e+=s[5],r+=s[6],a.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],e,r]});break;case"H":a.push({key:"H",data:[...s]}),e=s[0];break;case"h":e+=s[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...s]}),r=s[0];break;case"v":r+=s[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...s]}),e=s[2],r=s[3];break;case"s":{const l=s.map((h,c)=>c%2?h+r:h+e);a.push({key:"S",data:l}),e=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...s]}),e=s[0],r=s[1];break;case"t":e+=s[0],r+=s[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=i,r=n}return a}function Su(t){const e=[];let r="",i=0,n=0,a=0,o=0,s=0,l=0;for(const{key:h,data:c}of t){switch(h){case"M":e.push({key:"M",data:[...c]}),[i,n]=c,[a,o]=c;break;case"C":e.push({key:"C",data:[...c]}),i=c[4],n=c[5],s=c[2],l=c[3];break;case"L":e.push({key:"L",data:[...c]}),[i,n]=c;break;case"H":i=c[0],e.push({key:"L",data:[i,n]});break;case"V":n=c[0],e.push({key:"L",data:[i,n]});break;case"S":{let d=0,u=0;r==="C"||r==="S"?(d=i+(i-s),u=n+(n-l)):(d=i,u=n),e.push({key:"C",data:[d,u,...c]}),s=c[0],l=c[1],i=c[2],n=c[3];break}case"T":{const[d,u]=c;let p=0,f=0;r==="Q"||r==="T"?(p=i+(i-s),f=n+(n-l)):(p=i,f=n);const y=i+2*(p-i)/3,m=n+2*(f-n)/3,x=d+2*(p-d)/3,b=u+2*(f-u)/3;e.push({key:"C",data:[y,m,x,b,d,u]}),s=p,l=f,i=d,n=u;break}case"Q":{const[d,u,p,f]=c,y=i+2*(d-i)/3,m=n+2*(u-n)/3,x=p+2*(d-p)/3,b=f+2*(u-f)/3;e.push({key:"C",data:[y,m,x,b,p,f]}),s=d,l=u,i=p,n=f;break}case"A":{const d=Math.abs(c[0]),u=Math.abs(c[1]),p=c[2],f=c[3],y=c[4],m=c[5],x=c[6];d===0||u===0?(e.push({key:"C",data:[i,n,m,x,m,x]}),i=m,n=x):(i!==m||n!==x)&&(vu(i,n,m,x,d,u,p,f,y).forEach(function(b){e.push({key:"C",data:b})}),i=m,n=x);break}case"Z":e.push({key:"Z",data:[]}),i=a,n=o}r=h}return e}function Tr(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function vu(t,e,r,i,n,a,o,s,l,h){const c=(d=o,Math.PI*d/180);var d;let u=[],p=0,f=0,y=0,m=0;if(h)[p,f,y,m]=h;else{[t,e]=Tr(t,e,-c),[r,i]=Tr(r,i,-c);const O=(t-r)/2,T=(e-i)/2;let M=O*O/(n*n)+T*T/(a*a);M>1&&(M=Math.sqrt(M),n*=M,a*=M);const S=n*n,L=a*a,$=S*L-S*T*T-L*O*O,H=S*T*T+L*O*O,U=(s===l?-1:1)*Math.sqrt(Math.abs($/H));y=U*n*T/a+(t+r)/2,m=U*-a*O/n+(e+i)/2,p=Math.asin(parseFloat(((e-m)/a).toFixed(9))),f=Math.asin(parseFloat(((i-m)/a).toFixed(9))),t<y&&(p=Math.PI-p),r<y&&(f=Math.PI-f),p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),l&&p>f&&(p-=2*Math.PI),!l&&f>p&&(f-=2*Math.PI)}let x=f-p;if(Math.abs(x)>120*Math.PI/180){const O=f,T=r,M=i;f=l&&f>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,u=vu(r=y+n*Math.cos(f),i=m+a*Math.sin(f),T,M,n,a,o,0,l,[f,O,y,m])}x=f-p;const b=Math.cos(p),k=Math.sin(p),_=Math.cos(f),C=Math.sin(f),B=Math.tan(x/4),v=4/3*n*B,E=4/3*a*B,D=[t,e],I=[t+v*k,e-E*b],A=[r+v*C,i-E*_],P=[r,i];if(I[0]=2*D[0]-I[0],I[1]=2*D[1]-I[1],h)return[I,A,P].concat(u);{u=[I,A,P].concat(u);const O=[];for(let T=0;T<u.length;T+=3){const M=Tr(u[T][0],u[T][1],c),S=Tr(u[T+1][0],u[T+1][1],c),L=Tr(u[T+2][0],u[T+2][1],c);O.push([M[0],M[1],S[0],S[1],L[0],L[1]])}return O}}const rw={randOffset:function(t,e){return K(t,e)},randOffsetWithRange:function(t,e,r){return pn(t,e,r)},ellipse:function(t,e,r,i,n){const a=Bu(r,i,n);return Wa(t,e,n,a).opset},doubleLineOps:function(t,e,r,i,n){return _e(t,e,r,i,n,!0)}};function Tu(t,e,r,i,n){return{type:"path",ops:_e(t,e,r,i,n)}}function Ai(t,e,r){const i=(t||[]).length;if(i>2){const n=[];for(let a=0;a<i-1;a++)n.push(..._e(t[a][0],t[a][1],t[a+1][0],t[a+1][1],r));return e&&n.push(..._e(t[i-1][0],t[i-1][1],t[0][0],t[0][1],r)),{type:"path",ops:n}}return i===2?Tu(t[0][0],t[0][1],t[1][0],t[1][1],r):{type:"path",ops:[]}}function iw(t,e,r,i,n){return(function(a,o){return Ai(a,!0,o)})([[t,e],[t+r,e],[t+r,e+i],[t,e+i]],n)}function ul(t,e){if(t.length){const r=typeof t[0][0]=="number"?[t]:t,i=bi(r[0],1*(1+.2*e.roughness),e),n=e.disableMultiStroke?[]:bi(r[0],1.5*(1+.22*e.roughness),fl(e));for(let a=1;a<r.length;a++){const o=r[a];if(o.length){const s=bi(o,1*(1+.2*e.roughness),e),l=e.disableMultiStroke?[]:bi(o,1.5*(1+.22*e.roughness),fl(e));for(const h of s)h.op!=="move"&&i.push(h);for(const h of l)h.op!=="move"&&n.push(h)}}return{type:"path",ops:i.concat(n)}}return{type:"path",ops:[]}}function Bu(t,e,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),n=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),a=2*Math.PI/n;let o=Math.abs(t/2),s=Math.abs(e/2);const l=1-r.curveFitting;return o+=K(o*l,r),s+=K(s*l,r),{increment:a,rx:o,ry:s}}function Wa(t,e,r,i){const[n,a]=yl(i.increment,t,e,i.rx,i.ry,1,i.increment*pn(.1,pn(.4,1,r),r),r);let o=gn(n,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[s]=yl(i.increment,t,e,i.rx,i.ry,1.5,0,r),l=gn(s,null,r);o=o.concat(l)}return{estimatedPoints:a,opset:{type:"path",ops:o}}}function pl(t,e,r,i,n,a,o,s,l){const h=t,c=e;let d=Math.abs(r/2),u=Math.abs(i/2);d+=K(.01*d,l),u+=K(.01*u,l);let p=n,f=a;for(;p<0;)p+=2*Math.PI,f+=2*Math.PI;f-p>2*Math.PI&&(p=0,f=2*Math.PI);const y=2*Math.PI/l.curveStepCount,m=Math.min(y/2,(f-p)/2),x=ml(m,h,c,d,u,p,f,1,l);if(!l.disableMultiStroke){const b=ml(m,h,c,d,u,p,f,1.5,l);x.push(...b)}return o&&(s?x.push(..._e(h,c,h+d*Math.cos(p),c+u*Math.sin(p),l),..._e(h,c,h+d*Math.cos(f),c+u*Math.sin(f),l)):x.push({op:"lineTo",data:[h,c]},{op:"lineTo",data:[h+d*Math.cos(p),c+u*Math.sin(p)]})),{type:"path",ops:x}}function gl(t,e){const r=Su(_u(Ks(t))),i=[];let n=[0,0],a=[0,0];for(const{key:o,data:s}of r)switch(o){case"M":a=[s[0],s[1]],n=[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":{const[l,h,c,d,u,p]=s;i.push(...nw(l,h,c,d,u,p,a,e)),a=[u,p];break}case"Z":i.push(..._e(a[0],a[1],n[0],n[1],e)),a=[n[0],n[1]]}return{type:"path",ops:i}}function ra(t,e){const r=[];for(const i of t)if(i.length){const n=e.maxRandomnessOffset||0,a=i.length;if(a>2){r.push({op:"move",data:[i[0][0]+K(n,e),i[0][1]+K(n,e)]});for(let o=1;o<a;o++)r.push({op:"lineTo",data:[i[o][0]+K(n,e),i[o][1]+K(n,e)]})}}return{type:"fillPath",ops:r}}function Qe(t,e){return(function(r,i){let n=r.fillStyle||"hachure";if(!Ft[n])switch(n){case"zigzag":Ft[n]||(Ft[n]=new XC(i));break;case"cross-hatch":Ft[n]||(Ft[n]=new ZC(i));break;case"dots":Ft[n]||(Ft[n]=new QC(i));break;case"dashed":Ft[n]||(Ft[n]=new KC(i));break;case"zigzag-line":Ft[n]||(Ft[n]=new JC(i));break;default:n="hachure",Ft[n]||(Ft[n]=new Qs(i))}return Ft[n]})(e,rw).fillPolygons(t,e)}function fl(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function Mu(t){return t.randomizer||(t.randomizer=new tw(t.seed||0)),t.randomizer.next()}function pn(t,e,r,i=1){return r.roughness*i*(Mu(r)*(e-t)+t)}function K(t,e,r=1){return pn(-t,t,e,r)}function _e(t,e,r,i,n,a=!1){const o=a?n.disableMultiStrokeFill:n.disableMultiStroke,s=Ha(t,e,r,i,n,!0,!1);if(o)return s;const l=Ha(t,e,r,i,n,!0,!0);return s.concat(l)}function Ha(t,e,r,i,n,a,o){const s=Math.pow(t-r,2)+Math.pow(e-i,2),l=Math.sqrt(s);let h=1;h=l<200?1:l>500?.4:-.0016668*l+1.233334;let c=n.maxRandomnessOffset||0;c*c*100>s&&(c=l/10);const d=c/2,u=.2+.2*Mu(n);let p=n.bowing*n.maxRandomnessOffset*(i-e)/200,f=n.bowing*n.maxRandomnessOffset*(t-r)/200;p=K(p,n,h),f=K(f,n,h);const y=[],m=()=>K(d,n,h),x=()=>K(c,n,h),b=n.preserveVertices;return o?y.push({op:"move",data:[t+(b?0:m()),e+(b?0:m())]}):y.push({op:"move",data:[t+(b?0:K(c,n,h)),e+(b?0:K(c,n,h))]}),o?y.push({op:"bcurveTo",data:[p+t+(r-t)*u+m(),f+e+(i-e)*u+m(),p+t+2*(r-t)*u+m(),f+e+2*(i-e)*u+m(),r+(b?0:m()),i+(b?0:m())]}):y.push({op:"bcurveTo",data:[p+t+(r-t)*u+x(),f+e+(i-e)*u+x(),p+t+2*(r-t)*u+x(),f+e+2*(i-e)*u+x(),r+(b?0:x()),i+(b?0:x())]}),y}function bi(t,e,r){if(!t.length)return[];const i=[];i.push([t[0][0]+K(e,r),t[0][1]+K(e,r)]),i.push([t[0][0]+K(e,r),t[0][1]+K(e,r)]);for(let n=1;n<t.length;n++)i.push([t[n][0]+K(e,r),t[n][1]+K(e,r)]),n===t.length-1&&i.push([t[n][0]+K(e,r),t[n][1]+K(e,r)]);return gn(i,null,r)}function gn(t,e,r){const i=t.length,n=[];if(i>3){const a=[],o=1-r.curveTightness;n.push({op:"move",data:[t[1][0],t[1][1]]});for(let s=1;s+2<i;s++){const l=t[s];a[0]=[l[0],l[1]],a[1]=[l[0]+(o*t[s+1][0]-o*t[s-1][0])/6,l[1]+(o*t[s+1][1]-o*t[s-1][1])/6],a[2]=[t[s+1][0]+(o*t[s][0]-o*t[s+2][0])/6,t[s+1][1]+(o*t[s][1]-o*t[s+2][1])/6],a[3]=[t[s+1][0],t[s+1][1]],n.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}}else i===3?(n.push({op:"move",data:[t[1][0],t[1][1]]}),n.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):i===2&&n.push(...Ha(t[0][0],t[0][1],t[1][0],t[1][1],r,!0,!0));return n}function yl(t,e,r,i,n,a,o,s){const l=[],h=[];if(s.roughness===0){t/=4,h.push([e+i*Math.cos(-t),r+n*Math.sin(-t)]);for(let c=0;c<=2*Math.PI;c+=t){const d=[e+i*Math.cos(c),r+n*Math.sin(c)];l.push(d),h.push(d)}h.push([e+i*Math.cos(0),r+n*Math.sin(0)]),h.push([e+i*Math.cos(t),r+n*Math.sin(t)])}else{const c=K(.5,s)-Math.PI/2;h.push([K(a,s)+e+.9*i*Math.cos(c-t),K(a,s)+r+.9*n*Math.sin(c-t)]);const d=2*Math.PI+c-.01;for(let u=c;u<d;u+=t){const p=[K(a,s)+e+i*Math.cos(u),K(a,s)+r+n*Math.sin(u)];l.push(p),h.push(p)}h.push([K(a,s)+e+i*Math.cos(c+2*Math.PI+.5*o),K(a,s)+r+n*Math.sin(c+2*Math.PI+.5*o)]),h.push([K(a,s)+e+.98*i*Math.cos(c+o),K(a,s)+r+.98*n*Math.sin(c+o)]),h.push([K(a,s)+e+.9*i*Math.cos(c+.5*o),K(a,s)+r+.9*n*Math.sin(c+.5*o)])}return[h,l]}function ml(t,e,r,i,n,a,o,s,l){const h=a+K(.1,l),c=[];c.push([K(s,l)+e+.9*i*Math.cos(h-t),K(s,l)+r+.9*n*Math.sin(h-t)]);for(let d=h;d<=o;d+=t)c.push([K(s,l)+e+i*Math.cos(d),K(s,l)+r+n*Math.sin(d)]);return c.push([e+i*Math.cos(o),r+n*Math.sin(o)]),c.push([e+i*Math.cos(o),r+n*Math.sin(o)]),gn(c,null,l)}function nw(t,e,r,i,n,a,o,s){const l=[],h=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3];let c=[0,0];const d=s.disableMultiStroke?1:2,u=s.preserveVertices;for(let p=0;p<d;p++)p===0?l.push({op:"move",data:[o[0],o[1]]}):l.push({op:"move",data:[o[0]+(u?0:K(h[0],s)),o[1]+(u?0:K(h[0],s))]}),c=u?[n,a]:[n+K(h[p],s),a+K(h[p],s)],l.push({op:"bcurveTo",data:[t+K(h[p],s),e+K(h[p],s),r+K(h[p],s),i+K(h[p],s),c[0],c[1]]});return l}function Br(t){return[...t]}function xl(t,e=0){const r=t.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Br(t[0]),Br(t[1]),Br(t[2]),Br(t[2]));else{const n=[];n.push(t[0],t[0]);for(let s=1;s<t.length;s++)n.push(t[s]),s===t.length-1&&n.push(t[s]);const a=[],o=1-e;i.push(Br(n[0]));for(let s=1;s+2<n.length;s++){const l=n[s];a[0]=[l[0],l[1]],a[1]=[l[0]+(o*n[s+1][0]-o*n[s-1][0])/6,l[1]+(o*n[s+1][1]-o*n[s-1][1])/6],a[2]=[n[s+1][0]+(o*n[s][0]-o*n[s+2][0])/6,n[s+1][1]+(o*n[s][1]-o*n[s+2][1])/6],a[3]=[n[s+1][0],n[s+1][1]],i.push(a[1],a[2],a[3])}}return i}function Ei(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function aw(t,e,r){const i=Ei(e,r);if(i===0)return Ei(t,e);let n=((t[0]-e[0])*(r[0]-e[0])+(t[1]-e[1])*(r[1]-e[1]))/i;return n=Math.max(0,Math.min(1,n)),Ei(t,Fe(e,r,n))}function Fe(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function Ya(t,e,r,i){const n=i||[];if((function(s,l){const h=s[l+0],c=s[l+1],d=s[l+2],u=s[l+3];let p=3*c[0]-2*h[0]-u[0];p*=p;let f=3*c[1]-2*h[1]-u[1];f*=f;let y=3*d[0]-2*u[0]-h[0];y*=y;let m=3*d[1]-2*u[1]-h[1];return m*=m,p<y&&(p=y),f<m&&(f=m),p+f})(t,e)<r){const s=t[e+0];n.length?(a=n[n.length-1],o=s,Math.sqrt(Ei(a,o))>1&&n.push(s)):n.push(s),n.push(t[e+3])}else{const s=t[e+0],l=t[e+1],h=t[e+2],c=t[e+3],d=Fe(s,l,.5),u=Fe(l,h,.5),p=Fe(h,c,.5),f=Fe(d,u,.5),y=Fe(u,p,.5),m=Fe(f,y,.5);Ya([s,d,f,m],0,r,n),Ya([m,y,p,c],0,r,n)}var a,o;return n}function sw(t,e){return fn(t,0,t.length,e)}function fn(t,e,r,i,n){const a=n||[],o=t[e],s=t[r-1];let l=0,h=1;for(let c=e+1;c<r-1;++c){const d=aw(t[c],o,s);d>l&&(l=d,h=c)}return Math.sqrt(l)>i?(fn(t,e,h+1,i,a),fn(t,h,r,i,a)):(a.length||a.push(o),a.push(s)),a}function ia(t,e=.15,r){const i=[],n=(t.length-1)/3;for(let a=0;a<n;a++)Ya(t,3*a,e,i);return r&&r>0?fn(i,0,i.length,r):i}const Dt="none";class yn{constructor(e){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=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,r,i){return{shape:e,sets:r||[],options:i||this.defaultOptions}}line(e,r,i,n,a){const o=this._o(a);return this._d("line",[Tu(e,r,i,n,o)],o)}rectangle(e,r,i,n,a){const o=this._o(a),s=[],l=iw(e,r,i,n,o);if(o.fill){const h=[[e,r],[e+i,r],[e+i,r+n],[e,r+n]];o.fillStyle==="solid"?s.push(ra([h],o)):s.push(Qe([h],o))}return o.stroke!==Dt&&s.push(l),this._d("rectangle",s,o)}ellipse(e,r,i,n,a){const o=this._o(a),s=[],l=Bu(i,n,o),h=Wa(e,r,o,l);if(o.fill)if(o.fillStyle==="solid"){const c=Wa(e,r,o,l).opset;c.type="fillPath",s.push(c)}else s.push(Qe([h.estimatedPoints],o));return o.stroke!==Dt&&s.push(h.opset),this._d("ellipse",s,o)}circle(e,r,i,n){const a=this.ellipse(e,r,i,i,n);return a.shape="circle",a}linearPath(e,r){const i=this._o(r);return this._d("linearPath",[Ai(e,!1,i)],i)}arc(e,r,i,n,a,o,s=!1,l){const h=this._o(l),c=[],d=pl(e,r,i,n,a,o,s,!0,h);if(s&&h.fill)if(h.fillStyle==="solid"){const u=Object.assign({},h);u.disableMultiStroke=!0;const p=pl(e,r,i,n,a,o,!0,!1,u);p.type="fillPath",c.push(p)}else c.push((function(u,p,f,y,m,x,b){const k=u,_=p;let C=Math.abs(f/2),B=Math.abs(y/2);C+=K(.01*C,b),B+=K(.01*B,b);let v=m,E=x;for(;v<0;)v+=2*Math.PI,E+=2*Math.PI;E-v>2*Math.PI&&(v=0,E=2*Math.PI);const D=(E-v)/b.curveStepCount,I=[];for(let A=v;A<=E;A+=D)I.push([k+C*Math.cos(A),_+B*Math.sin(A)]);return I.push([k+C*Math.cos(E),_+B*Math.sin(E)]),I.push([k,_]),Qe([I],b)})(e,r,i,n,a,o,h));return h.stroke!==Dt&&c.push(d),this._d("arc",c,h)}curve(e,r){const i=this._o(r),n=[],a=ul(e,i);if(i.fill&&i.fill!==Dt)if(i.fillStyle==="solid"){const o=ul(e,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{const o=[],s=e;if(s.length){const l=typeof s[0][0]=="number"?[s]:s;for(const h of l)h.length<3?o.push(...h):h.length===3?o.push(...ia(xl([h[0],h[0],h[1],h[2]]),10,(1+i.roughness)/2)):o.push(...ia(xl(h),10,(1+i.roughness)/2))}o.length&&n.push(Qe([o],i))}return i.stroke!==Dt&&n.push(a),this._d("curve",n,i)}polygon(e,r){const i=this._o(r),n=[],a=Ai(e,!0,i);return i.fill&&(i.fillStyle==="solid"?n.push(ra([e],i)):n.push(Qe([e],i))),i.stroke!==Dt&&n.push(a),this._d("polygon",n,i)}path(e,r){const i=this._o(r),n=[];if(!e)return this._d("path",n,i);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=i.fill&&i.fill!=="transparent"&&i.fill!==Dt,o=i.stroke!==Dt,s=!!(i.simplification&&i.simplification<1),l=(function(c,d,u){const p=Su(_u(Ks(c))),f=[];let y=[],m=[0,0],x=[];const b=()=>{x.length>=4&&y.push(...ia(x,d)),x=[]},k=()=>{b(),y.length&&(f.push(y),y=[])};for(const{key:C,data:B}of p)switch(C){case"M":k(),m=[B[0],B[1]],y.push(m);break;case"L":b(),y.push([B[0],B[1]]);break;case"C":if(!x.length){const v=y.length?y[y.length-1]:m;x.push([v[0],v[1]])}x.push([B[0],B[1]]),x.push([B[2],B[3]]),x.push([B[4],B[5]]);break;case"Z":b(),y.push([m[0],m[1]])}if(k(),!u)return f;const _=[];for(const C of f){const B=sw(C,u);B.length&&_.push(B)}return _})(e,1,s?4-4*(i.simplification||1):(1+i.roughness)/2),h=gl(e,i);if(a)if(i.fillStyle==="solid")if(l.length===1){const c=gl(e,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(c.ops)})}else n.push(ra(l,i));else n.push(Qe(l,i));return o&&(s?l.forEach(c=>{n.push(Ai(c,!1,i))}):n.push(h)),this._d("path",n,i)}opsToPath(e,r){let i="";for(const n of e.ops){const a=typeof r=="number"&&r>=0?n.data.map(o=>+o.toFixed(r)):n.data;switch(n.op){case"move":i+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":i+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":i+=`L${a[0]} ${a[1]} `}}return i.trim()}toPaths(e){const r=e.sets||[],i=e.options||this.defaultOptions,n=[];for(const a of r){let o=null;switch(a.type){case"path":o={d:this.opsToPath(a),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:Dt};break;case"fillPath":o={d:this.opsToPath(a),stroke:Dt,strokeWidth:0,fill:i.fill||Dt};break;case"fillSketch":o=this.fillSketch(a,i)}o&&n.push(o)}return n}fillSketch(e,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Dt,strokeWidth:i,fill:Dt}}_mergedShape(e){return e.filter((r,i)=>i===0||r.op!=="move")}}class ow{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new yn(r)}draw(e){const r=e.sets||[],i=e.options||this.getDefaultOptions(),n=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const o of r)switch(o.type){case"path":n.save(),n.strokeStyle=i.stroke==="none"?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,o,a),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";const s=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,o,a,s),n.restore();break}case"fillSketch":this.fillSketch(n,o,i)}}fillSketch(e,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),e.save(),i.fillLineDash&&e.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(e.lineDashOffset=i.fillLineDashOffset),e.strokeStyle=i.fill||"",e.lineWidth=n,this._drawToContext(e,r,i.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,i,n="nonzero"){e.beginPath();for(const a of r.ops){const o=typeof i=="number"&&i>=0?a.data.map(s=>+s.toFixed(i)):a.data;switch(a.op){case"move":e.moveTo(o[0],o[1]);break;case"bcurveTo":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":e.lineTo(o[0],o[1])}}r.type==="fillPath"?e.fill(n):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,i,n,a){const o=this.gen.line(e,r,i,n,a);return this.draw(o),o}rectangle(e,r,i,n,a){const o=this.gen.rectangle(e,r,i,n,a);return this.draw(o),o}ellipse(e,r,i,n,a){const o=this.gen.ellipse(e,r,i,n,a);return this.draw(o),o}circle(e,r,i,n){const a=this.gen.circle(e,r,i,n);return this.draw(a),a}linearPath(e,r){const i=this.gen.linearPath(e,r);return this.draw(i),i}polygon(e,r){const i=this.gen.polygon(e,r);return this.draw(i),i}arc(e,r,i,n,a,o,s=!1,l){const h=this.gen.arc(e,r,i,n,a,o,s,l);return this.draw(h),h}curve(e,r){const i=this.gen.curve(e,r);return this.draw(i),i}path(e,r){const i=this.gen.path(e,r);return this.draw(i),i}}const ki="http://www.w3.org/2000/svg";class lw{constructor(e,r){this.svg=e,this.gen=new yn(r)}draw(e){const r=e.sets||[],i=e.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,a=n.createElementNS(ki,"g"),o=e.options.fixedDecimalPlaceDigits;for(const s of r){let l=null;switch(s.type){case"path":l=n.createElementNS(ki,"path"),l.setAttribute("d",this.opsToPath(s,o)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=n.createElementNS(ki,"path"),l.setAttribute("d",this.opsToPath(s,o)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(n,s,i)}l&&a.appendChild(l)}return a}fillSketch(e,r,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2);const a=e.createElementNS(ki,"path");return a.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),a.setAttribute("stroke",i.fill||""),a.setAttribute("stroke-width",n+""),a.setAttribute("fill","none"),i.fillLineDash&&a.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,i,n,a){const o=this.gen.line(e,r,i,n,a);return this.draw(o)}rectangle(e,r,i,n,a){const o=this.gen.rectangle(e,r,i,n,a);return this.draw(o)}ellipse(e,r,i,n,a){const o=this.gen.ellipse(e,r,i,n,a);return this.draw(o)}circle(e,r,i,n){const a=this.gen.circle(e,r,i,n);return this.draw(a)}linearPath(e,r){const i=this.gen.linearPath(e,r);return this.draw(i)}polygon(e,r){const i=this.gen.polygon(e,r);return this.draw(i)}arc(e,r,i,n,a,o,s=!1,l){const h=this.gen.arc(e,r,i,n,a,o,s,l);return this.draw(h)}curve(e,r){const i=this.gen.curve(e,r);return this.draw(i)}path(e,r){const i=this.gen.path(e,r);return this.draw(i)}}var N={canvas:(t,e)=>new ow(t,e),svg:(t,e)=>new lw(t,e),generator:t=>new yn(t),newSeed:()=>yn.newSeed()},Q=g(async(t,e,r)=>{let i;const n=e.useHtmlLabels||yt(st()?.htmlLabels);r?i=r:i="node default";const a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),o=a.insert("g").attr("class","label").attr("style",Tt(e.labelStyle));let s;e.label===void 0?s="":s=typeof e.label=="string"?e.label:e.label[0];const l=await ve(o,qt(Ge(s),st()),{useHtmlLabels:n,width:e.width||st().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img});let h=l.getBBox();const c=(e?.padding??0)/2;if(n){const d=l.children[0],u=it(l),p=d.getElementsByTagName("img");if(p){const f=s.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...p].map(y=>new Promise(m=>{function x(){if(y.style.display="flex",y.style.flexDirection="column",f){const b=st().fontSize?st().fontSize:window.getComputedStyle(document.body).fontSize,k=5,[_=jl.fontSize]=Dn(b),C=_*k+"px";y.style.minWidth=C,y.style.maxWidth=C}else y.style.width="100%";m(y)}g(x,"setupImage"),setTimeout(()=>{y.complete&&x()}),y.addEventListener("error",x),y.addEventListener("load",x)})))}h=d.getBoundingClientRect(),u.attr("width",h.width),u.attr("height",h.height)}return n?o.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):o.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&o.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:h,halfPadding:c,label:o}},"labelHelper"),na=g(async(t,e,r)=>{const i=r.useHtmlLabels||yt(st()?.flowchart?.htmlLabels),n=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await ve(n,qt(Ge(e),st()),{useHtmlLabels:i,width:r.width||st()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let o=a.getBBox();const s=r.padding/2;if(yt(st()?.flowchart?.htmlLabels)){const l=a.children[0],h=it(a);o=l.getBoundingClientRect(),h.attr("width",o.width),h.attr("height",o.height)}return i?n.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):n.attr("transform","translate(0, "+-o.height/2+")"),r.centerLabel&&n.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:t,bbox:o,halfPadding:s,label:n}},"insertLabel"),Y=g((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),Z=g((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function rt(t){const e=t.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}g(rt,"createPathFromPoints");function Se(t,e,r,i,n,a){const o=[],s=r-t,l=i-e,h=s/a,c=2*Math.PI/h,d=e+l/2;for(let u=0;u<=50;u++){const p=u/50,f=t+p*s,y=d+n*Math.sin(c*(f-t));o.push({x:f,y})}return o}g(Se,"generateFullSineWavePoints");function Jr(t,e,r,i,n,a){const o=[],s=n*Math.PI/180,l=(a*Math.PI/180-s)/(i-1);for(let h=0;h<i;h++){const c=s+h*l,d=t+r*Math.cos(c),u=e+r*Math.sin(c);o.push({x:-d,y:-u})}return o}g(Jr,"generateCirclePoints");var hw=g((t,e)=>{var r=t.x,i=t.y,n=e.x-r,a=e.y-i,o=t.width/2,s=t.height/2,l,h;return Math.abs(a)*o>Math.abs(n)*s?(a<0&&(s=-s),l=a===0?0:s*n/a,h=s):(n<0&&(o=-o),l=o,h=n===0?0:o*a/n),{x:r+l,y:i+h}},"intersectRect"),mr=hw;function $u(t,e){e&&t.attr("style",e)}g($u,"applyStyle");async function Lu(t){const e=it(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),i=st();let n=t.label;t.label&&lr(t.label)&&(n=await as(t.label.replace(gr.lineBreakRegex,`
`),i));const a='<span class="'+(t.isNode?"nodeLabel":"edgeLabel")+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+n+"</span>";return r.html(qt(a,i)),$u(r,t.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}g(Lu,"addHtmlLabel");var cw=g(async(t,e,r,i)=>{let n=t||"";if(typeof n=="object"&&(n=n[0]),yt(st().flowchart.htmlLabels)){n=n.replace(/\\n|\n/g,"<br />"),F.info("vertexText"+n);const a={isNode:i,label:Ge(n).replace(/fa[blrs]?:fa-[\w-]+/g,o=>`<i class='${o.replace(":"," ")}'></i>`),labelStyle:e&&e.replace("fill:","color:")};return await Lu(a)}else{const a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",e.replace("color:","fill:"));let o=[];typeof n=="string"?o=n.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(n)?o=n:o=[];for(const s of o){const l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),r?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=s.trim(),a.appendChild(l)}return a}},"createLabel"),ze=cw,Te=g((t,e,r,i,n)=>["M",t+n,e,"H",t+r-n,"A",n,n,0,0,1,t+r,e+n,"V",e+i-n,"A",n,n,0,0,1,t+r-n,e+i,"H",t+n,"A",n,n,0,0,1,t,e+i-n,"V",e+n,"A",n,n,0,0,1,t+n,e,"Z"].join(" "),"createRoundedRectPathD"),Fu=g(async(t,e)=>{F.info("Creating subgraph rect for ",e.id,e);const r=st(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:a,clusterBorder:o}=i,{labelStyles:s,nodeStyles:l,borderStyles:h,backgroundStyles:c}=W(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),u=yt(r.flowchart.htmlLabels),p=d.insert("g").attr("class","cluster-label "),f=await ve(p,e.label,{style:e.labelStyle,useHtmlLabels:u,isNode:!0});let y=f.getBBox();if(yt(r.flowchart.htmlLabels)){const v=f.children[0],E=it(f);y=v.getBoundingClientRect(),E.attr("width",y.width),E.attr("height",y.height)}const m=e.width<=y.width+e.padding?y.width+e.padding:e.width;e.width<=y.width+e.padding?e.diff=(m-e.width)/2-e.padding:e.diff=-e.padding;const x=e.height,b=e.x-m/2,k=e.y-x/2;F.trace("Data ",e,JSON.stringify(e));let _;if(e.look==="handDrawn"){const v=N.svg(d),E=j(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:n}),D=v.path(Te(b,k,m,x,0),E);_=d.insert(()=>(F.debug("Rough node insert CXC",D),D),":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",c.join(";").replace("fill","stroke"))}else _=d.insert("rect",":first-child"),_.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",k).attr("width",m).attr("height",x);const{subGraphTitleTopMargin:C}=Ls(r);if(p.attr("transform",`translate(${e.x-y.width/2}, ${e.y-e.height/2+C})`),s){const v=p.select("span");v&&v.attr("style",s)}const B=_.node().getBBox();return e.offsetX=0,e.width=B.width,e.height=B.height,e.offsetY=y.height-e.padding/2,e.intersect=function(v){return mr(e,v)},{cluster:d,labelBBox:y}},"rect"),dw=g((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.id),i=r.insert("rect",":first-child"),n=0*e.padding,a=n/2;i.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+n).attr("height",e.height+n).attr("fill","none");const o=i.node().getBBox();return e.width=o.width,e.height=o.height,e.intersect=function(s){return mr(e,s)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),uw=g(async(t,e)=>{const r=st(),{themeVariables:i,handDrawnSeed:n}=r,{altBackground:a,compositeBackground:o,compositeTitleBackground:s,nodeBorder:l}=i,h=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),c=h.insert("g",":first-child"),d=h.insert("g").attr("class","cluster-label");let u=h.append("rect");const p=d.node().appendChild(await ze(e.label,e.labelStyle,void 0,!0));let f=p.getBBox();if(yt(r.flowchart.htmlLabels)){const D=p.children[0],I=it(p);f=D.getBoundingClientRect(),I.attr("width",f.width),I.attr("height",f.height)}const y=0*e.padding,m=y/2,x=(e.width<=f.width+e.padding?f.width+e.padding:e.width)+y;e.width<=f.width+e.padding?e.diff=(x-e.width)/2-e.padding:e.diff=-e.padding;const b=e.height+y,k=e.height+y-f.height-6,_=e.x-x/2,C=e.y-b/2;e.width=x;const B=e.y-e.height/2-m+f.height+2;let v;if(e.look==="handDrawn"){const D=e.cssClasses.includes("statediagram-cluster-alt"),I=N.svg(h),A=e.rx||e.ry?I.path(Te(_,C,x,b,10),{roughness:.7,fill:s,fillStyle:"solid",stroke:l,seed:n}):I.rectangle(_,C,x,b,{seed:n});v=h.insert(()=>A,":first-child");const P=I.rectangle(_,B,x,k,{fill:D?a:o,fillStyle:D?"hachure":"solid",stroke:l,seed:n});v=h.insert(()=>A,":first-child"),u=h.insert(()=>P)}else v=c.insert("rect",":first-child"),v.attr("class","outer").attr("x",_).attr("y",C).attr("width",x).attr("height",b).attr("data-look",e.look),u.attr("class","inner").attr("x",_).attr("y",B).attr("width",x).attr("height",k);d.attr("transform",`translate(${e.x-f.width/2}, ${C+1-(yt(r.flowchart.htmlLabels)?0:3)})`);const E=v.node().getBBox();return e.height=E.height,e.offsetX=0,e.offsetY=f.height-e.padding/2,e.labelBBox=f,e.intersect=function(D){return mr(e,D)},{cluster:h,labelBBox:f}},"roundedWithTitle"),pw=g(async(t,e)=>{F.info("Creating subgraph rect for ",e.id,e);const r=st(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:a,clusterBorder:o}=i,{labelStyles:s,nodeStyles:l,borderStyles:h,backgroundStyles:c}=W(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),u=yt(r.flowchart.htmlLabels),p=d.insert("g").attr("class","cluster-label "),f=await ve(p,e.label,{style:e.labelStyle,useHtmlLabels:u,isNode:!0,width:e.width});let y=f.getBBox();if(yt(r.flowchart.htmlLabels)){const v=f.children[0],E=it(f);y=v.getBoundingClientRect(),E.attr("width",y.width),E.attr("height",y.height)}const m=e.width<=y.width+e.padding?y.width+e.padding:e.width;e.width<=y.width+e.padding?e.diff=(m-e.width)/2-e.padding:e.diff=-e.padding;const x=e.height,b=e.x-m/2,k=e.y-x/2;F.trace("Data ",e,JSON.stringify(e));let _;if(e.look==="handDrawn"){const v=N.svg(d),E=j(e,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:n}),D=v.path(Te(b,k,m,x,e.rx),E);_=d.insert(()=>(F.debug("Rough node insert CXC",D),D),":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",c.join(";").replace("fill","stroke"))}else _=d.insert("rect",":first-child"),_.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",k).attr("width",m).attr("height",x);const{subGraphTitleTopMargin:C}=Ls(r);if(p.attr("transform",`translate(${e.x-y.width/2}, ${e.y-e.height/2+C})`),s){const v=p.select("span");v&&v.attr("style",s)}const B=_.node().getBBox();return e.offsetX=0,e.width=B.width,e.height=B.height,e.offsetY=y.height-e.padding/2,e.intersect=function(v){return mr(e,v)},{cluster:d,labelBBox:y}},"kanbanSection"),gw=g((t,e)=>{const r=st(),{themeVariables:i,handDrawnSeed:n}=r,{nodeBorder:a}=i,o=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),s=o.insert("g",":first-child"),l=0*e.padding,h=e.width+l;e.diff=-e.padding;const c=e.height+l,d=e.x-h/2,u=e.y-c/2;e.width=h;let p;if(e.look==="handDrawn"){const y=N.svg(o).rectangle(d,u,h,c,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:n});p=o.insert(()=>y,":first-child")}else p=s.insert("rect",":first-child"),p.attr("class","divider").attr("x",d).attr("y",u).attr("width",h).attr("height",c).attr("data-look",e.look);const f=p.node().getBBox();return e.height=f.height,e.offsetX=0,e.offsetY=0,e.intersect=function(y){return mr(e,y)},{cluster:o,labelBBox:{}}},"divider"),fw=Fu,yw={rect:Fu,squareRect:fw,roundedWithTitle:uw,noteGroup:dw,divider:gw,kanbanSection:pw},Au=new Map,mw=g(async(t,e)=>{const r=e.shape||"rect",i=await yw[r](t,e);return Au.set(e.id,i),i},"insertCluster"),WT=g(()=>{Au=new Map},"clear");function Eu(t,e){return t.intersect(e)}g(Eu,"intersectNode");var xw=Eu;function Ou(t,e,r,i){var n=t.x,a=t.y,o=n-i.x,s=a-i.y,l=Math.sqrt(e*e*s*s+r*r*o*o),h=Math.abs(e*r*o/l);i.x<n&&(h=-h);var c=Math.abs(e*r*s/l);return i.y<a&&(c=-c),{x:n+h,y:a+c}}g(Ou,"intersectEllipse");var Du=Ou;function Iu(t,e,r){return Du(t,e,e,r)}g(Iu,"intersectCircle");var bw=Iu;function Pu(t,e,r,i){{const n=e.y-t.y,a=t.x-e.x,o=e.x*t.y-t.x*e.y,s=n*r.x+a*r.y+o,l=n*i.x+a*i.y+o,h=1e-6;if(s!==0&&l!==0&&Va(s,l))return;const c=i.y-r.y,d=r.x-i.x,u=i.x*r.y-r.x*i.y,p=c*t.x+d*t.y+u,f=c*e.x+d*e.y+u;if(Math.abs(p)<h&&Math.abs(f)<h&&Va(p,f))return;const y=n*d-c*a;if(y===0)return;const m=Math.abs(y/2);let x=a*u-d*o;const b=x<0?(x-m)/y:(x+m)/y;x=c*o-n*u;const k=x<0?(x-m)/y:(x+m)/y;return{x:b,y:k}}}g(Pu,"intersectLine");function Va(t,e){return t*e>0}g(Va,"sameSign");var kw=Pu;function zu(t,e,r){let i=t.x,n=t.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(c){o=Math.min(o,c.x),s=Math.min(s,c.y)}):(o=Math.min(o,e.x),s=Math.min(s,e.y));let l=i-t.width/2-o,h=n-t.height/2-s;for(let c=0;c<e.length;c++){let d=e[c],u=e[c<e.length-1?c+1:0],p=kw(t,r,{x:l+d.x,y:h+d.y},{x:l+u.x,y:h+u.y});p&&a.push(p)}return a.length?(a.length>1&&a.sort(function(c,d){let u=c.x-r.x,p=c.y-r.y,f=Math.sqrt(u*u+p*p),y=d.x-r.x,m=d.y-r.y,x=Math.sqrt(y*y+m*m);return f<x?-1:f===x?0:1}),a[0]):t}g(zu,"intersectPolygon");var Cw=zu,q={node:xw,circle:bw,ellipse:Du,polygon:Cw,rect:mr};function qu(t,e){const{labelStyles:r}=W(e);e.labelStyle=r;const i=Z(e);let n=i;i||(n="anchor");const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),o=1,{cssStyles:s}=e,l=N.svg(a),h=j(e,{fill:"black",stroke:"none",fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);const c=l.circle(0,0,o*2,h),d=a.insert(()=>c,":first-child");return d.attr("class","anchor").attr("style",Tt(s)),Y(e,d),e.intersect=function(u){return F.info("Circle intersect",e,o,u),q.circle(e,o,u)},a}g(qu,"anchor");function Ua(t,e,r,i,n,a,o){const s=(t+r)/2,l=(e+i)/2,h=Math.atan2(i-e,r-t),c=(r-t)/2,d=(i-e)/2,u=c/n,p=d/a,f=Math.sqrt(u**2+p**2);if(f>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-f**2),m=s+y*a*Math.sin(h)*(o?-1:1),x=l-y*n*Math.cos(h)*(o?-1:1),b=Math.atan2((e-x)/a,(t-m)/n);let k=Math.atan2((i-x)/a,(r-m)/n)-b;o&&k<0&&(k+=2*Math.PI),!o&&k>0&&(k-=2*Math.PI);const _=[];for(let C=0;C<20;C++){const B=C/19,v=b+B*k,E=m+n*Math.cos(v),D=x+a*Math.sin(v);_.push({x:E,y:D})}return _}g(Ua,"generateArcPoints");async function Ru(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=a.width+e.padding+20,s=a.height+e.padding,l=s/2,h=l/(2.5+s/50),{cssStyles:c}=e,d=[{x:o/2,y:-s/2},{x:-o/2,y:-s/2},...Ua(-o/2,-s/2,-o/2,s/2,h,l,!1),{x:o/2,y:s/2},...Ua(o/2,s/2,o/2,-s/2,h,l,!0)],u=N.svg(n),p=j(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const f=rt(d),y=u.path(f,p),m=n.insert(()=>y,":first-child");return m.attr("class","basic label-container"),c&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",c),i&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",i),m.attr("transform",`translate(${h/2}, 0)`),Y(e,m),e.intersect=function(x){return q.polygon(e,d,x)},n}g(Ru,"bowTieRect");function Be(t,e,r,i){return t.insert("polygon",":first-child").attr("points",i.map(function(n){return n.x+","+n.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}g(Be,"insertPolygonShape");async function Nu(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=a.height+e.padding,s=12,l=a.width+e.padding+s,h=0,c=l,d=-o,u=0,p=[{x:h+s,y:d},{x:c,y:d},{x:c,y:u},{x:h,y:u},{x:h,y:d+s},{x:h+s,y:d}];let f;const{cssStyles:y}=e;if(e.look==="handDrawn"){const m=N.svg(n),x=j(e,{}),b=rt(p),k=m.path(b,x);f=n.insert(()=>k,":first-child").attr("transform",`translate(${-l/2}, ${o/2})`),y&&f.attr("style",y)}else f=Be(n,l,o,p);return i&&f.attr("style",i),Y(e,f),e.intersect=function(m){return q.polygon(e,p,m)},n}g(Nu,"card");function ju(t,e){const{nodeStyles:r}=W(e);e.label="";const i=t.insert("g").attr("class",Z(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,a=Math.max(28,e.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=N.svg(i),l=j(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const h=rt(o),c=s.path(h,l),d=i.insert(()=>c,":first-child");return n&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",n),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(u){return q.polygon(e,o,u)},i}g(ju,"choice");async function Js(t,e,r){const{labelStyles:i,nodeStyles:n}=W(e);e.labelStyle=i;const{shapeSvg:a,bbox:o,halfPadding:s}=await Q(t,e,Z(e)),l=r?.padding??s,h=o.width/2+l;let c;const{cssStyles:d}=e;if(e.look==="handDrawn"){const u=N.svg(a),p=j(e,{}),f=u.circle(0,0,h*2,p);c=a.insert(()=>f,":first-child"),c.attr("class","basic label-container").attr("style",Tt(d))}else c=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0);return Y(e,c),e.calcIntersect=function(u,p){const f=u.width/2;return q.circle(u,f,p)},e.intersect=function(u){return F.info("Circle intersect",e,h,u),q.circle(e,h,u)},a}g(Js,"circle");function Wu(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=t*2,n={x:i/2*e,y:i/2*r},a={x:-(i/2)*e,y:i/2*r},o={x:-(i/2)*e,y:-(i/2)*r},s={x:i/2*e,y:-(i/2)*r};return`M ${a.x},${a.y} L ${s.x},${s.y}
M ${n.x},${n.y} L ${o.x},${o.y}`}g(Wu,"createLine");function Hu(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r,e.label="";const n=t.insert("g").attr("class",Z(e)).attr("id",e.domId??e.id),a=Math.max(30,e?.width??0),{cssStyles:o}=e,s=N.svg(n),l=j(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const h=s.circle(0,0,a*2,l),c=Wu(a),d=s.path(c,l),u=n.insert(()=>h,":first-child");return u.insert(()=>d),o&&e.look!=="handDrawn"&&u.selectAll("path").attr("style",o),i&&e.look!=="handDrawn"&&u.selectAll("path").attr("style",i),Y(e,u),e.intersect=function(p){return F.info("crossedCircle intersect",e,{radius:a,point:p}),q.circle(e,a,p)},n}g(Hu,"crossedCircle");function se(t,e,r,i=100,n=0,a=180){const o=[],s=n*Math.PI/180,l=(a*Math.PI/180-s)/(i-1);for(let h=0;h<i;h++){const c=s+h*l,d=t+r*Math.cos(c),u=e+r*Math.sin(c);o.push({x:-d,y:-u})}return o}g(se,"generateCirclePoints");async function Yu(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=a.width+(e.padding??0),l=a.height+(e.padding??0),h=Math.max(5,l*.1),{cssStyles:c}=e,d=[...se(s/2,-l/2,h,30,-90,0),{x:-s/2-h,y:h},...se(s/2+h*2,-h,h,20,-180,-270),...se(s/2+h*2,h,h,20,-90,-180),{x:-s/2-h,y:-l/2},...se(s/2,l/2,h,20,0,90)],u=[{x:s/2,y:-l/2-h},{x:-s/2,y:-l/2-h},...se(s/2,-l/2,h,20,-90,0),{x:-s/2-h,y:-h},...se(s/2+s*.1,-h,h,20,-180,-270),...se(s/2+s*.1,h,h,20,-90,-180),{x:-s/2-h,y:l/2},...se(s/2,l/2,h,20,0,90),{x:-s/2,y:l/2+h},{x:s/2,y:l/2+h}],p=N.svg(n),f=j(e,{fill:"none"});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const y=rt(d).replace("Z",""),m=p.path(y,f),x=rt(u),b=p.path(x,{...f}),k=n.insert("g",":first-child");return k.insert(()=>b,":first-child").attr("stroke-opacity",0),k.insert(()=>m,":first-child"),k.attr("class","text"),c&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",c),i&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(${h}, 0)`),o.attr("transform",`translate(${-s/2+h-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Y(e,k),e.intersect=function(_){return q.polygon(e,u,_)},n}g(Yu,"curlyBraceLeft");function oe(t,e,r,i=100,n=0,a=180){const o=[],s=n*Math.PI/180,l=(a*Math.PI/180-s)/(i-1);for(let h=0;h<i;h++){const c=s+h*l,d=t+r*Math.cos(c),u=e+r*Math.sin(c);o.push({x:d,y:u})}return o}g(oe,"generateCirclePoints");async function Vu(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=a.width+(e.padding??0),l=a.height+(e.padding??0),h=Math.max(5,l*.1),{cssStyles:c}=e,d=[...oe(s/2,-l/2,h,20,-90,0),{x:s/2+h,y:-h},...oe(s/2+h*2,-h,h,20,-180,-270),...oe(s/2+h*2,h,h,20,-90,-180),{x:s/2+h,y:l/2},...oe(s/2,l/2,h,20,0,90)],u=[{x:-s/2,y:-l/2-h},{x:s/2,y:-l/2-h},...oe(s/2,-l/2,h,20,-90,0),{x:s/2+h,y:-h},...oe(s/2+h*2,-h,h,20,-180,-270),...oe(s/2+h*2,h,h,20,-90,-180),{x:s/2+h,y:l/2},...oe(s/2,l/2,h,20,0,90),{x:s/2,y:l/2+h},{x:-s/2,y:l/2+h}],p=N.svg(n),f=j(e,{fill:"none"});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const y=rt(d).replace("Z",""),m=p.path(y,f),x=rt(u),b=p.path(x,{...f}),k=n.insert("g",":first-child");return k.insert(()=>b,":first-child").attr("stroke-opacity",0),k.insert(()=>m,":first-child"),k.attr("class","text"),c&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",c),i&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(${-h}, 0)`),o.attr("transform",`translate(${-s/2+(e.padding??0)/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Y(e,k),e.intersect=function(_){return q.polygon(e,u,_)},n}g(Vu,"curlyBraceRight");function xt(t,e,r,i=100,n=0,a=180){const o=[],s=n*Math.PI/180,l=(a*Math.PI/180-s)/(i-1);for(let h=0;h<i;h++){const c=s+h*l,d=t+r*Math.cos(c),u=e+r*Math.sin(c);o.push({x:-d,y:-u})}return o}g(xt,"generateCirclePoints");async function Uu(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=a.width+(e.padding??0),l=a.height+(e.padding??0),h=Math.max(5,l*.1),{cssStyles:c}=e,d=[...xt(s/2,-l/2,h,30,-90,0),{x:-s/2-h,y:h},...xt(s/2+h*2,-h,h,20,-180,-270),...xt(s/2+h*2,h,h,20,-90,-180),{x:-s/2-h,y:-l/2},...xt(s/2,l/2,h,20,0,90)],u=[...xt(-s/2+h+h/2,-l/2,h,20,-90,-180),{x:s/2-h/2,y:h},...xt(-s/2-h/2,-h,h,20,0,90),...xt(-s/2-h/2,h,h,20,-90,0),{x:s/2-h/2,y:-h},...xt(-s/2+h+h/2,l/2,h,30,-180,-270)],p=[{x:s/2,y:-l/2-h},{x:-s/2,y:-l/2-h},...xt(s/2,-l/2,h,20,-90,0),{x:-s/2-h,y:-h},...xt(s/2+h*2,-h,h,20,-180,-270),...xt(s/2+h*2,h,h,20,-90,-180),{x:-s/2-h,y:l/2},...xt(s/2,l/2,h,20,0,90),{x:-s/2,y:l/2+h},{x:s/2-h-h/2,y:l/2+h},...xt(-s/2+h+h/2,-l/2,h,20,-90,-180),{x:s/2-h/2,y:h},...xt(-s/2-h/2,-h,h,20,0,90),...xt(-s/2-h/2,h,h,20,-90,0),{x:s/2-h/2,y:-h},...xt(-s/2+h+h/2,l/2,h,30,-180,-270)],f=N.svg(n),y=j(e,{fill:"none"});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const m=rt(d).replace("Z",""),x=f.path(m,y),b=rt(u).replace("Z",""),k=f.path(b,y),_=rt(p),C=f.path(_,{...y}),B=n.insert("g",":first-child");return B.insert(()=>C,":first-child").attr("stroke-opacity",0),B.insert(()=>x,":first-child"),B.insert(()=>k,":first-child"),B.attr("class","text"),c&&e.look!=="handDrawn"&&B.selectAll("path").attr("style",c),i&&e.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${h-h/4}, 0)`),o.attr("transform",`translate(${-s/2+(e.padding??0)/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Y(e,B),e.intersect=function(v){return q.polygon(e,p,v)},n}g(Uu,"curlyBraces");async function Gu(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=80,s=20,l=Math.max(o,(a.width+(e.padding??0)*2)*1.25,e?.width??0),h=Math.max(s,a.height+(e.padding??0)*2,e?.height??0),c=h/2,{cssStyles:d}=e,u=N.svg(n),p=j(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const f=l,y=h,m=f-c,x=y/4,b=[{x:m,y:0},{x,y:0},{x:0,y:y/2},{x,y},{x:m,y},...Jr(-m,-y/2,c,50,270,90)],k=rt(b),_=u.path(k,p),C=n.insert(()=>_,":first-child");return C.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&C.selectChildren("path").attr("style",d),i&&e.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),C.attr("transform",`translate(${-l/2}, ${-h/2})`),Y(e,C),e.intersect=function(B){return q.polygon(e,b,B)},n}g(Gu,"curvedTrapezoid");var ww=g((t,e,r,i,n,a)=>[`M${t},${e+a}`,`a${n},${a} 0,0,0 ${r},0`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),_w=g((t,e,r,i,n,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),Sw=g((t,e,r,i,n,a)=>[`M${t-r/2},${-i/2}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function Xu(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=Math.max(a.width+e.padding,e.width??0),l=s/2,h=l/(2.5+s/50),c=Math.max(a.height+h+e.padding,e.height??0);let d;const{cssStyles:u}=e;if(e.look==="handDrawn"){const p=N.svg(n),f=_w(0,0,s,c,l,h),y=Sw(0,h,s,c,l,h),m=p.path(f,j(e,{})),x=p.path(y,j(e,{fill:"none"}));d=n.insert(()=>x,":first-child"),d=n.insert(()=>m,":first-child"),d.attr("class","basic label-container"),u&&d.attr("style",u)}else{const p=ww(0,0,s,c,l,h);d=n.insert("path",":first-child").attr("d",p).attr("class","basic label-container").attr("style",Tt(u)).attr("style",i)}return d.attr("label-offset-y",h),d.attr("transform",`translate(${-s/2}, ${-(c/2+h)})`),Y(e,d),o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+(e.padding??0)/1.5-(a.y-(a.top??0))})`),e.intersect=function(p){const f=q.rect(e,p),y=f.x-(e.x??0);if(l!=0&&(Math.abs(y)<(e.width??0)/2||Math.abs(y)==(e.width??0)/2&&Math.abs(f.y-(e.y??0))>(e.height??0)/2-h)){let m=h*h*(1-y*y/(l*l));m>0&&(m=Math.sqrt(m)),m=h-m,p.y-(e.y??0)>0&&(m=-m),f.y+=m}return f},n}g(Xu,"cylinder");async function Zu(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=a.width+e.padding,l=a.height+e.padding,h=l*.2,c=-s/2,d=-l/2-h/2,{cssStyles:u}=e,p=N.svg(n),f=j(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const y=[{x:c,y:d+h},{x:-c,y:d+h},{x:-c,y:-d},{x:c,y:-d},{x:c,y:d},{x:-c,y:d},{x:-c,y:d+h}],m=p.polygon(y.map(b=>[b.x,b.y]),f),x=n.insert(()=>m,":first-child");return x.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",u),i&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",i),o.attr("transform",`translate(${c+(e.padding??0)/2-(a.x-(a.left??0))}, ${d+h+(e.padding??0)/2-(a.y-(a.top??0))})`),Y(e,x),e.intersect=function(b){return q.rect(e,b)},n}g(Zu,"dividedRectangle");async function Qu(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,halfPadding:o}=await Q(t,e,Z(e)),s=a.width/2+o+5,l=a.width/2+o;let h;const{cssStyles:c}=e;if(e.look==="handDrawn"){const d=N.svg(n),u=j(e,{roughness:.2,strokeWidth:2.5}),p=j(e,{roughness:.2,strokeWidth:1.5}),f=d.circle(0,0,s*2,u),y=d.circle(0,0,l*2,p);h=n.insert("g",":first-child"),h.attr("class",Tt(e.cssClasses)).attr("style",Tt(c)),h.node()?.appendChild(f),h.node()?.appendChild(y)}else{h=n.insert("g",":first-child");const d=h.insert("circle",":first-child"),u=h.insert("circle");h.attr("class","basic label-container").attr("style",i),d.attr("class","outer-circle").attr("style",i).attr("r",s).attr("cx",0).attr("cy",0),u.attr("class","inner-circle").attr("style",i).attr("r",l).attr("cx",0).attr("cy",0)}return Y(e,h),e.intersect=function(d){return F.info("DoubleCircle intersect",e,s,d),q.circle(e,s,d)},n}g(Qu,"doublecircle");function Ku(t,e,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=W(e);e.label="",e.labelStyle=i;const a=t.insert("g").attr("class",Z(e)).attr("id",e.domId??e.id),o=7,{cssStyles:s}=e,l=N.svg(a),{nodeBorder:h}=r,c=j(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(c.roughness=0);const d=l.circle(0,0,o*2,c),u=a.insert(()=>d,":first-child");return u.selectAll("path").attr("style",`fill: ${h} !important;`),s&&s.length>0&&e.look!=="handDrawn"&&u.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&u.selectAll("path").attr("style",n),Y(e,u),e.intersect=function(p){return F.info("filledCircle intersect",e,{radius:o,point:p}),q.circle(e,o,p)},a}g(Ku,"filledCircle");async function Ju(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=a.width+(e.padding??0),l=s+a.height,h=s+a.height,c=[{x:0,y:-l},{x:h,y:-l},{x:h/2,y:0}],{cssStyles:d}=e,u=N.svg(n),p=j(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const f=rt(c),y=u.path(f,p),m=n.insert(()=>y,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return d&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",d),i&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",i),e.width=s,e.height=l,Y(e,m),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-l/2+(e.padding??0)/2+(a.y-(a.top??0))})`),e.intersect=function(x){return F.info("Triangle intersect",e,c,x),q.polygon(e,c,x)},n}g(Ju,"flippedTriangle");function tp(t,e,{dir:r,config:{state:i,themeVariables:n}}){const{nodeStyles:a}=W(e);e.label="";const o=t.insert("g").attr("class",Z(e)).attr("id",e.domId??e.id),{cssStyles:s}=e;let l=Math.max(70,e?.width??0),h=Math.max(10,e?.height??0);r==="LR"&&(l=Math.max(10,e?.width??0),h=Math.max(70,e?.height??0));const c=-1*l/2,d=-1*h/2,u=N.svg(o),p=j(e,{stroke:n.lineColor,fill:n.lineColor});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const f=u.rectangle(c,d,l,h,p),y=o.insert(()=>f,":first-child");s&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",s),a&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",a),Y(e,y);const m=i?.padding??0;return e.width&&e.height&&(e.width+=m/2||0,e.height+=m/2||0),e.intersect=function(x){return q.rect(e,x)},o}g(tp,"forkJoin");async function ep(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const n=80,a=50,{shapeSvg:o,bbox:s}=await Q(t,e,Z(e)),l=Math.max(n,s.width+(e.padding??0)*2,e?.width??0),h=Math.max(a,s.height+(e.padding??0)*2,e?.height??0),c=h/2,{cssStyles:d}=e,u=N.svg(o),p=j(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const f=[{x:-l/2,y:-h/2},{x:l/2-c,y:-h/2},...Jr(-l/2+c,0,c,50,90,270),{x:l/2-c,y:h/2},{x:-l/2,y:h/2}],y=rt(f),m=u.path(y,p),x=o.insert(()=>m,":first-child");return x.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",d),i&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),Y(e,x),e.intersect=function(b){return F.info("Pill intersect",e,{radius:c,point:b}),q.polygon(e,f,b)},o}g(ep,"halfRoundedRectangle");async function rp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=a.height+(e.padding??0),s=a.width+(e.padding??0)*2.5,{cssStyles:l}=e,h=N.svg(n),c=j(e,{});e.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");let d=s/2;const u=d/6;d=d+u;const p=o/2,f=p/2,y=d-f,m=[{x:-y,y:-p},{x:0,y:-p},{x:y,y:-p},{x:d,y:0},{x:y,y:p},{x:0,y:p},{x:-y,y:p},{x:-d,y:0}],x=rt(m),b=h.path(x,c),k=n.insert(()=>b,":first-child");return k.attr("class","basic label-container"),l&&e.look!=="handDrawn"&&k.selectChildren("path").attr("style",l),i&&e.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),e.width=s,e.height=o,Y(e,k),e.intersect=function(_){return q.polygon(e,m,_)},n}g(rp,"hexagon");async function ip(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.label="",e.labelStyle=r;const{shapeSvg:n}=await Q(t,e,Z(e)),a=Math.max(30,e?.width??0),o=Math.max(30,e?.height??0),{cssStyles:s}=e,l=N.svg(n),h=j(e,{});e.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const c=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],d=rt(c),u=l.path(d,h),p=n.insert(()=>u,":first-child");return p.attr("class","basic label-container"),s&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",s),i&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",i),p.attr("transform",`translate(${-a/2}, ${-o/2})`),Y(e,p),e.intersect=function(f){return F.info("Pill intersect",e,{points:c}),q.polygon(e,c,f)},n}g(ip,"hourglass");async function np(t,e,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=W(e);e.labelStyle=n;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=i?.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:h,bbox:c,label:d}=await Q(t,e,"icon-shape default"),u=e.pos==="t",p=s,f=s,{nodeBorder:y}=r,{stylesMap:m}=fr(e),x=-f/2,b=-p/2,k=e.label?8:0,_=N.svg(h),C=j(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const B=_.rectangle(x,b,f,p,C),v=Math.max(f,c.width),E=p+c.height+k,D=_.rectangle(-v/2,-E/2,v,E,{...C,fill:"transparent",stroke:"none"}),I=h.insert(()=>B,":first-child"),A=h.insert(()=>D);if(e.icon){const P=h.append("g");P.html(`<g>${await hi(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const O=P.node().getBBox(),T=O.width,M=O.height,S=O.x,L=O.y;P.attr("transform",`translate(${-T/2-S},${u?c.height/2+k/2-M/2-L:-c.height/2-k/2-M/2-L})`),P.attr("style",`color: ${m.get("stroke")??y};`)}return d.attr("transform",`translate(${-c.width/2-(c.x-(c.left??0))},${u?-E/2:E/2-c.height})`),I.attr("transform",`translate(0,${u?c.height/2+k/2:-c.height/2-k/2})`),Y(e,A),e.intersect=function(P){if(F.info("iconSquare intersect",e,P),!e.label)return q.rect(e,P);const O=e.x??0,T=e.y??0,M=e.height??0;let S=[];return u?S=[{x:O-c.width/2,y:T-M/2},{x:O+c.width/2,y:T-M/2},{x:O+c.width/2,y:T-M/2+c.height+k},{x:O+f/2,y:T-M/2+c.height+k},{x:O+f/2,y:T+M/2},{x:O-f/2,y:T+M/2},{x:O-f/2,y:T-M/2+c.height+k},{x:O-c.width/2,y:T-M/2+c.height+k}]:S=[{x:O-f/2,y:T-M/2},{x:O+f/2,y:T-M/2},{x:O+f/2,y:T-M/2+p},{x:O+c.width/2,y:T-M/2+p},{x:O+c.width/2/2,y:T+M/2},{x:O-c.width/2,y:T+M/2},{x:O-c.width/2,y:T-M/2+p},{x:O-f/2,y:T-M/2+p}],q.polygon(e,S,P)},h}g(np,"icon");async function ap(t,e,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=W(e);e.labelStyle=n;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=i?.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:h,bbox:c,label:d}=await Q(t,e,"icon-shape default"),u=20,p=e.label?8:0,f=e.pos==="t",{nodeBorder:y,mainBkg:m}=r,{stylesMap:x}=fr(e),b=N.svg(h),k=j(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=x.get("fill");k.stroke=_??m;const C=h.append("g");e.icon&&C.html(`<g>${await hi(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const B=C.node().getBBox(),v=B.width,E=B.height,D=B.x,I=B.y,A=Math.max(v,E)*Math.SQRT2+u*2,P=b.circle(0,0,A,k),O=Math.max(A,c.width),T=A+c.height+p,M=b.rectangle(-O/2,-T/2,O,T,{...k,fill:"transparent",stroke:"none"}),S=h.insert(()=>P,":first-child"),L=h.insert(()=>M);return C.attr("transform",`translate(${-v/2-D},${f?c.height/2+p/2-E/2-I:-c.height/2-p/2-E/2-I})`),C.attr("style",`color: ${x.get("stroke")??y};`),d.attr("transform",`translate(${-c.width/2-(c.x-(c.left??0))},${f?-T/2:T/2-c.height})`),S.attr("transform",`translate(0,${f?c.height/2+p/2:-c.height/2-p/2})`),Y(e,L),e.intersect=function($){return F.info("iconSquare intersect",e,$),q.rect(e,$)},h}g(ap,"iconCircle");async function sp(t,e,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=W(e);e.labelStyle=n;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=i?.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:h,bbox:c,halfPadding:d,label:u}=await Q(t,e,"icon-shape default"),p=e.pos==="t",f=s+d*2,y=s+d*2,{nodeBorder:m,mainBkg:x}=r,{stylesMap:b}=fr(e),k=-y/2,_=-f/2,C=e.label?8:0,B=N.svg(h),v=j(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const E=b.get("fill");v.stroke=E??x;const D=B.path(Te(k,_,y,f,5),v),I=Math.max(y,c.width),A=f+c.height+C,P=B.rectangle(-I/2,-A/2,I,A,{...v,fill:"transparent",stroke:"none"}),O=h.insert(()=>D,":first-child").attr("class","icon-shape2"),T=h.insert(()=>P);if(e.icon){const M=h.append("g");M.html(`<g>${await hi(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const S=M.node().getBBox(),L=S.width,$=S.height,H=S.x,U=S.y;M.attr("transform",`translate(${-L/2-H},${p?c.height/2+C/2-$/2-U:-c.height/2-C/2-$/2-U})`),M.attr("style",`color: ${b.get("stroke")??m};`)}return u.attr("transform",`translate(${-c.width/2-(c.x-(c.left??0))},${p?-A/2:A/2-c.height})`),O.attr("transform",`translate(0,${p?c.height/2+C/2:-c.height/2-C/2})`),Y(e,T),e.intersect=function(M){if(F.info("iconSquare intersect",e,M),!e.label)return q.rect(e,M);const S=e.x??0,L=e.y??0,$=e.height??0;let H=[];return p?H=[{x:S-c.width/2,y:L-$/2},{x:S+c.width/2,y:L-$/2},{x:S+c.width/2,y:L-$/2+c.height+C},{x:S+y/2,y:L-$/2+c.height+C},{x:S+y/2,y:L+$/2},{x:S-y/2,y:L+$/2},{x:S-y/2,y:L-$/2+c.height+C},{x:S-c.width/2,y:L-$/2+c.height+C}]:H=[{x:S-y/2,y:L-$/2},{x:S+y/2,y:L-$/2},{x:S+y/2,y:L-$/2+f},{x:S+c.width/2,y:L-$/2+f},{x:S+c.width/2/2,y:L+$/2},{x:S-c.width/2,y:L+$/2},{x:S-c.width/2,y:L-$/2+f},{x:S-y/2,y:L-$/2+f}],q.polygon(e,H,M)},h}g(sp,"iconRounded");async function op(t,e,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=W(e);e.labelStyle=n;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=i?.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:h,bbox:c,halfPadding:d,label:u}=await Q(t,e,"icon-shape default"),p=e.pos==="t",f=s+d*2,y=s+d*2,{nodeBorder:m,mainBkg:x}=r,{stylesMap:b}=fr(e),k=-y/2,_=-f/2,C=e.label?8:0,B=N.svg(h),v=j(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const E=b.get("fill");v.stroke=E??x;const D=B.path(Te(k,_,y,f,.1),v),I=Math.max(y,c.width),A=f+c.height+C,P=B.rectangle(-I/2,-A/2,I,A,{...v,fill:"transparent",stroke:"none"}),O=h.insert(()=>D,":first-child"),T=h.insert(()=>P);if(e.icon){const M=h.append("g");M.html(`<g>${await hi(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const S=M.node().getBBox(),L=S.width,$=S.height,H=S.x,U=S.y;M.attr("transform",`translate(${-L/2-H},${p?c.height/2+C/2-$/2-U:-c.height/2-C/2-$/2-U})`),M.attr("style",`color: ${b.get("stroke")??m};`)}return u.attr("transform",`translate(${-c.width/2-(c.x-(c.left??0))},${p?-A/2:A/2-c.height})`),O.attr("transform",`translate(0,${p?c.height/2+C/2:-c.height/2-C/2})`),Y(e,T),e.intersect=function(M){if(F.info("iconSquare intersect",e,M),!e.label)return q.rect(e,M);const S=e.x??0,L=e.y??0,$=e.height??0;let H=[];return p?H=[{x:S-c.width/2,y:L-$/2},{x:S+c.width/2,y:L-$/2},{x:S+c.width/2,y:L-$/2+c.height+C},{x:S+y/2,y:L-$/2+c.height+C},{x:S+y/2,y:L+$/2},{x:S-y/2,y:L+$/2},{x:S-y/2,y:L-$/2+c.height+C},{x:S-c.width/2,y:L-$/2+c.height+C}]:H=[{x:S-y/2,y:L-$/2},{x:S+y/2,y:L-$/2},{x:S+y/2,y:L-$/2+f},{x:S+c.width/2,y:L-$/2+f},{x:S+c.width/2/2,y:L+$/2},{x:S-c.width/2,y:L+$/2},{x:S-c.width/2,y:L-$/2+f},{x:S-y/2,y:L-$/2+f}],q.polygon(e,H,M)},h}g(op,"iconSquare");async function lp(t,e,{config:{flowchart:r}}){const i=new Image;i.src=e?.img??"",await i.decode();const n=Number(i.naturalWidth.toString().replace("px","")),a=Number(i.naturalHeight.toString().replace("px",""));e.imageAspectRatio=n/a;const{labelStyles:o}=W(e);e.labelStyle=o;const s=r?.wrappingWidth;e.defaultWidth=r?.wrappingWidth;const l=Math.max(e.label?s??0:0,e?.assetWidth??n),h=e.constraint==="on"&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:l,c=e.constraint==="on"?h/e.imageAspectRatio:e?.assetHeight??a;e.width=Math.max(h,s??0);const{shapeSvg:d,bbox:u,label:p}=await Q(t,e,"image-shape default"),f=e.pos==="t",y=-h/2,m=-c/2,x=e.label?8:0,b=N.svg(d),k=j(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=b.rectangle(y,m,h,c,k),C=Math.max(h,u.width),B=c+u.height+x,v=b.rectangle(-C/2,-B/2,C,B,{...k,fill:"none",stroke:"none"}),E=d.insert(()=>_,":first-child"),D=d.insert(()=>v);if(e.img){const I=d.append("image");I.attr("href",e.img),I.attr("width",h),I.attr("height",c),I.attr("preserveAspectRatio","none"),I.attr("transform",`translate(${-h/2},${f?B/2-c:-B/2})`)}return p.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${f?-c/2-u.height/2-x/2:c/2-u.height/2+x/2})`),E.attr("transform",`translate(0,${f?u.height/2+x/2:-u.height/2-x/2})`),Y(e,D),e.intersect=function(I){if(F.info("iconSquare intersect",e,I),!e.label)return q.rect(e,I);const A=e.x??0,P=e.y??0,O=e.height??0;let T=[];return f?T=[{x:A-u.width/2,y:P-O/2},{x:A+u.width/2,y:P-O/2},{x:A+u.width/2,y:P-O/2+u.height+x},{x:A+h/2,y:P-O/2+u.height+x},{x:A+h/2,y:P+O/2},{x:A-h/2,y:P+O/2},{x:A-h/2,y:P-O/2+u.height+x},{x:A-u.width/2,y:P-O/2+u.height+x}]:T=[{x:A-h/2,y:P-O/2},{x:A+h/2,y:P-O/2},{x:A+h/2,y:P-O/2+c},{x:A+u.width/2,y:P-O/2+c},{x:A+u.width/2/2,y:P+O/2},{x:A-u.width/2,y:P+O/2},{x:A-u.width/2,y:P-O/2+c},{x:A-h/2,y:P-O/2+c}],q.polygon(e,T,I)},d}g(lp,"imageSquare");async function hp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=Math.max(a.width+(e.padding??0)*2,e?.width??0),s=Math.max(a.height+(e.padding??0)*2,e?.height??0),l=[{x:0,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:-3*s/6,y:-s}];let h;const{cssStyles:c}=e;if(e.look==="handDrawn"){const d=N.svg(n),u=j(e,{}),p=rt(l),f=d.path(p,u);h=n.insert(()=>f,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),c&&h.attr("style",c)}else h=Be(n,o,s,l);return i&&h.attr("style",i),e.width=o,e.height=s,Y(e,h),e.intersect=function(d){return q.polygon(e,l,d)},n}g(hp,"inv_trapezoid");async function Nn(t,e,r){const{labelStyles:i,nodeStyles:n}=W(e);e.labelStyle=i;const{shapeSvg:a,bbox:o}=await Q(t,e,Z(e)),s=Math.max(o.width+r.labelPaddingX*2,e?.width||0),l=Math.max(o.height+r.labelPaddingY*2,e?.height||0),h=-s/2,c=-l/2;let d,{rx:u,ry:p}=e;const{cssStyles:f}=e;if(r?.rx&&r.ry&&(u=r.rx,p=r.ry),e.look==="handDrawn"){const y=N.svg(a),m=j(e,{}),x=u||p?y.path(Te(h,c,s,l,u||0),m):y.rectangle(h,c,s,l,m);d=a.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",Tt(f))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",n).attr("rx",Tt(u)).attr("ry",Tt(p)).attr("x",h).attr("y",c).attr("width",s).attr("height",l);return Y(e,d),e.calcIntersect=function(y,m){return q.rect(y,m)},e.intersect=function(y){return q.rect(e,y)},a}g(Nn,"drawRect");async function cp(t,e){const{shapeSvg:r,bbox:i,label:n}=await Q(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),n.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),Y(e,a),e.intersect=function(o){return q.rect(e,o)},r}g(cp,"labelRect");async function dp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=Math.max(a.width+(e.padding??0),e?.width??0),s=Math.max(a.height+(e.padding??0),e?.height??0),l=[{x:0,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:-(3*s)/6,y:-s}];let h;const{cssStyles:c}=e;if(e.look==="handDrawn"){const d=N.svg(n),u=j(e,{}),p=rt(l),f=d.path(p,u);h=n.insert(()=>f,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),c&&h.attr("style",c)}else h=Be(n,o,s,l);return i&&h.attr("style",i),e.width=o,e.height=s,Y(e,h),e.intersect=function(d){return q.polygon(e,l,d)},n}g(dp,"lean_left");async function up(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=Math.max(a.width+(e.padding??0),e?.width??0),s=Math.max(a.height+(e.padding??0),e?.height??0),l=[{x:-3*s/6,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:0,y:-s}];let h;const{cssStyles:c}=e;if(e.look==="handDrawn"){const d=N.svg(n),u=j(e,{}),p=rt(l),f=d.path(p,u);h=n.insert(()=>f,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),c&&h.attr("style",c)}else h=Be(n,o,s,l);return i&&h.attr("style",i),e.width=o,e.height=s,Y(e,h),e.intersect=function(d){return q.polygon(e,l,d)},n}g(up,"lean_right");function pp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.label="",e.labelStyle=r;const n=t.insert("g").attr("class",Z(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,o=Math.max(35,e?.width??0),s=Math.max(35,e?.height??0),l=7,h=[{x:o,y:0},{x:0,y:s+l/2},{x:o-2*l,y:s+l/2},{x:0,y:2*s},{x:o,y:s-l/2},{x:2*l,y:s-l/2}],c=N.svg(n),d=j(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=rt(h),p=c.path(u,d),f=n.insert(()=>p,":first-child");return a&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",a),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),f.attr("transform",`translate(-${o/2},${-s})`),Y(e,f),e.intersect=function(y){return F.info("lightningBolt intersect",e,y),q.polygon(e,h,y)},n}g(pp,"lightningBolt");var vw=g((t,e,r,i,n,a,o)=>[`M${t},${e+a}`,`a${n},${a} 0,0,0 ${r},0`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${t},${e+a+o}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Tw=g((t,e,r,i,n,a,o)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${n},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${t},${e+a+o}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Bw=g((t,e,r,i,n,a)=>[`M${t-r/2},${-i/2}`,`a${n},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function gp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=Math.max(a.width+(e.padding??0),e.width??0),l=s/2,h=l/(2.5+s/50),c=Math.max(a.height+h+(e.padding??0),e.height??0),d=c*.1;let u;const{cssStyles:p}=e;if(e.look==="handDrawn"){const f=N.svg(n),y=Tw(0,0,s,c,l,h,d),m=Bw(0,h,s,c,l,h),x=j(e,{}),b=f.path(y,x),k=f.path(m,x);n.insert(()=>k,":first-child").attr("class","line"),u=n.insert(()=>b,":first-child"),u.attr("class","basic label-container"),p&&u.attr("style",p)}else{const f=vw(0,0,s,c,l,h,d);u=n.insert("path",":first-child").attr("d",f).attr("class","basic label-container").attr("style",Tt(p)).attr("style",i)}return u.attr("label-offset-y",h),u.attr("transform",`translate(${-s/2}, ${-(c/2+h)})`),Y(e,u),o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+h-(a.y-(a.top??0))})`),e.intersect=function(f){const y=q.rect(e,f),m=y.x-(e.x??0);if(l!=0&&(Math.abs(m)<(e.width??0)/2||Math.abs(m)==(e.width??0)/2&&Math.abs(y.y-(e.y??0))>(e.height??0)/2-h)){let x=h*h*(1-m*m/(l*l));x>0&&(x=Math.sqrt(x)),x=h-x,f.y-(e.y??0)>0&&(x=-x),y.y+=x}return y},n}g(gp,"linedCylinder");async function fp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=l/4,c=l+h,{cssStyles:d}=e,u=N.svg(n),p=j(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const f=[{x:-s/2-s/2*.1,y:-c/2},{x:-s/2-s/2*.1,y:c/2},...Se(-s/2-s/2*.1,c/2,s/2+s/2*.1,c/2,h,.8),{x:s/2+s/2*.1,y:-c/2},{x:-s/2-s/2*.1,y:-c/2},{x:-s/2,y:-c/2},{x:-s/2,y:c/2*1.1},{x:-s/2,y:-c/2}],y=u.polygon(f.map(x=>[x.x,x.y]),p),m=n.insert(()=>y,":first-child");return m.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",d),i&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",i),m.attr("transform",`translate(0,${-h/2})`),o.attr("transform",`translate(${-s/2+(e.padding??0)+s/2*.1/2-(a.x-(a.left??0))},${-l/2+(e.padding??0)-h/2-(a.y-(a.top??0))})`),Y(e,m),e.intersect=function(x){return q.polygon(e,f,x)},n}g(fp,"linedWaveEdgedRect");async function yp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=5,c=-s/2,d=-l/2,{cssStyles:u}=e,p=N.svg(n),f=j(e,{}),y=[{x:c-h,y:d+h},{x:c-h,y:d+l+h},{x:c+s-h,y:d+l+h},{x:c+s-h,y:d+l},{x:c+s,y:d+l},{x:c+s,y:d+l-h},{x:c+s+h,y:d+l-h},{x:c+s+h,y:d-h},{x:c+h,y:d-h},{x:c+h,y:d},{x:c,y:d},{x:c,y:d+h}],m=[{x:c,y:d+h},{x:c+s-h,y:d+h},{x:c+s-h,y:d+l},{x:c+s,y:d+l},{x:c+s,y:d},{x:c,y:d}];e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const x=rt(y),b=p.path(x,f),k=rt(m),_=p.path(k,{...f,fill:"none"}),C=n.insert(()=>_,":first-child");return C.insert(()=>b,":first-child"),C.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",u),i&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",i),o.attr("transform",`translate(${-(a.width/2)-h-(a.x-(a.left??0))}, ${-(a.height/2)+h-(a.y-(a.top??0))})`),Y(e,C),e.intersect=function(B){return q.polygon(e,y,B)},n}g(yp,"multiRect");async function mp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=l/4,c=l+h,d=-s/2,u=-c/2,p=5,{cssStyles:f}=e,y=Se(d-p,u+c+p,d+s-p,u+c+p,h,.8),m=y?.[y.length-1],x=[{x:d-p,y:u+p},{x:d-p,y:u+c+p},...y,{x:d+s-p,y:m.y-p},{x:d+s,y:m.y-p},{x:d+s,y:m.y-2*p},{x:d+s+p,y:m.y-2*p},{x:d+s+p,y:u-p},{x:d+p,y:u-p},{x:d+p,y:u},{x:d,y:u},{x:d,y:u+p}],b=[{x:d,y:u+p},{x:d+s-p,y:u+p},{x:d+s-p,y:m.y-p},{x:d+s,y:m.y-p},{x:d+s,y:u},{x:d,y:u}],k=N.svg(n),_=j(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const C=rt(x),B=k.path(C,_),v=rt(b),E=k.path(v,_),D=n.insert(()=>B,":first-child");return D.insert(()=>E),D.attr("class","basic label-container"),f&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",f),i&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",i),D.attr("transform",`translate(0,${-h/2})`),o.attr("transform",`translate(${-(a.width/2)-p-(a.x-(a.left??0))}, ${-(a.height/2)+p-h/2-(a.y-(a.top??0))})`),Y(e,D),e.intersect=function(I){return q.polygon(e,x,I)},n}g(mp,"multiWaveEdgedRectangle");async function xp(t,e,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=W(e);e.labelStyle=i,e.useHtmlLabels||St().flowchart?.htmlLabels!==!1||(e.centerLabel=!0);const{shapeSvg:a,bbox:o,label:s}=await Q(t,e,Z(e)),l=Math.max(o.width+(e.padding??0)*2,e?.width??0),h=Math.max(o.height+(e.padding??0)*2,e?.height??0),c=-l/2,d=-h/2,{cssStyles:u}=e,p=N.svg(a),f=j(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const y=p.rectangle(c,d,l,h,f),m=a.insert(()=>y,":first-child");return m.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",u),n&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Y(e,m),e.intersect=function(x){return q.rect(e,x)},a}g(xp,"note");var Mw=g((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"].join(" "),"createDecisionBoxPathD");async function bp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=a.width+e.padding,s=a.height+e.padding,l=o+s,h=.5,c=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:u}=e;if(e.look==="handDrawn"){const p=N.svg(n),f=j(e,{}),y=Mw(0,0,l),m=p.path(y,f);d=n.insert(()=>m,":first-child").attr("transform",`translate(${-l/2+h}, ${l/2})`),u&&d.attr("style",u)}else d=Be(n,l,l,c),d.attr("transform",`translate(${-l/2+h}, ${l/2})`);return i&&d.attr("style",i),Y(e,d),e.calcIntersect=function(p,f){const y=p.width,m=[{x:y/2,y:0},{x:y,y:-y/2},{x:y/2,y:-y},{x:0,y:-y/2}],x=q.polygon(p,m,f);return{x:x.x-.5,y:x.y-.5}},e.intersect=function(p){return this.calcIntersect(e,p)},n}g(bp,"question");async function kp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=Math.max(a.width+(e.padding??0),e?.width??0),l=Math.max(a.height+(e.padding??0),e?.height??0),h=-s/2,c=-l/2,d=c/2,u=[{x:h+d,y:c},{x:h,y:0},{x:h+d,y:-c},{x:-h,y:-c},{x:-h,y:c}],{cssStyles:p}=e,f=N.svg(n),y=j(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const m=rt(u),x=f.path(m,y),b=n.insert(()=>x,":first-child");return b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",i),b.attr("transform",`translate(${-d/2},0)`),o.attr("transform",`translate(${-d/2-a.width/2-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),Y(e,b),e.intersect=function(k){return q.polygon(e,u,k)},n}g(kp,"rect_left_inv_arrow");async function Cp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;let n;e.cssClasses?n="node "+e.cssClasses:n="node default";const a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),o=a.insert("g"),s=a.insert("g").attr("class","label").attr("style",i),l=e.description,h=e.label,c=s.node().appendChild(await ze(h,e.labelStyle,!0,!0));let d={width:0,height:0};if(yt(st()?.flowchart?.htmlLabels)){const E=c.children[0],D=it(c);d=E.getBoundingClientRect(),D.attr("width",d.width),D.attr("height",d.height)}F.info("Text 2",l);const u=l||[],p=c.getBBox(),f=s.node().appendChild(await ze(u.join?u.join("<br/>"):u,e.labelStyle,!0,!0)),y=f.children[0],m=it(f);d=y.getBoundingClientRect(),m.attr("width",d.width),m.attr("height",d.height);const x=(e.padding||0)/2;it(f).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+x+5)+")"),it(c).attr("transform","translate( "+(d.width<p.width?0:-(p.width-d.width)/2)+", 0)"),d=s.node().getBBox(),s.attr("transform","translate("+-d.width/2+", "+(-d.height/2-x+3)+")");const b=d.width+(e.padding||0),k=d.height+(e.padding||0),_=-d.width/2-x,C=-d.height/2-x;let B,v;if(e.look==="handDrawn"){const E=N.svg(a),D=j(e,{}),I=E.path(Te(_,C,b,k,e.rx||0),D),A=E.line(-d.width/2-x,-d.height/2-x+p.height+x,d.width/2+x,-d.height/2-x+p.height+x,D);v=a.insert(()=>(F.debug("Rough node insert CXC",I),A),":first-child"),B=a.insert(()=>(F.debug("Rough node insert CXC",I),I),":first-child")}else B=o.insert("rect",":first-child"),v=o.insert("line"),B.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),v.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+p.height+x).attr("y2",-d.height/2-x+p.height+x);return Y(e,B),e.intersect=function(E){return q.rect(e,E)},a}g(Cp,"rectWithTitle");function Er(t,e,r,i,n,a,o){const s=(t+r)/2,l=(e+i)/2,h=Math.atan2(i-e,r-t),c=(r-t)/2,d=(i-e)/2,u=c/n,p=d/a,f=Math.sqrt(u**2+p**2);if(f>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-f**2),m=s+y*a*Math.sin(h)*(o?-1:1),x=l-y*n*Math.cos(h)*(o?-1:1),b=Math.atan2((e-x)/a,(t-m)/n);let k=Math.atan2((i-x)/a,(r-m)/n)-b;o&&k<0&&(k+=2*Math.PI),!o&&k>0&&(k-=2*Math.PI);const _=[];for(let C=0;C<20;C++){const B=C/19,v=b+B*k,E=m+n*Math.cos(v),D=x+a*Math.sin(v);_.push({x:E,y:D})}return _}g(Er,"generateArcPoints");async function wp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=e?.padding??0,s=e?.padding??0,l=(e?.width?e?.width:a.width)+o*2,h=(e?.height?e?.height:a.height)+s*2,c=e.radius||5,d=e.taper||5,{cssStyles:u}=e,p=N.svg(n),f=j(e,{});e.stroke&&(f.stroke=e.stroke),e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const y=[{x:-l/2+d,y:-h/2},{x:l/2-d,y:-h/2},...Er(l/2-d,-h/2,l/2,-h/2+d,c,c,!0),{x:l/2,y:-h/2+d},{x:l/2,y:h/2-d},...Er(l/2,h/2-d,l/2-d,h/2,c,c,!0),{x:l/2-d,y:h/2},{x:-l/2+d,y:h/2},...Er(-l/2+d,h/2,-l/2,h/2-d,c,c,!0),{x:-l/2,y:h/2-d},{x:-l/2,y:-h/2+d},...Er(-l/2,-h/2+d,-l/2+d,-h/2,c,c,!0)],m=rt(y),x=p.path(m,f),b=n.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),u&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",u),i&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),Y(e,b),e.intersect=function(k){return q.polygon(e,y,k)},n}g(wp,"roundedRect");async function _p(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=e?.padding??0,l=Math.max(a.width+(e.padding??0)*2,e?.width??0),h=Math.max(a.height+(e.padding??0)*2,e?.height??0),c=-a.width/2-s,d=-a.height/2-s,{cssStyles:u}=e,p=N.svg(n),f=j(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const y=[{x:c,y:d},{x:c+l+8,y:d},{x:c+l+8,y:d+h},{x:c-8,y:d+h},{x:c-8,y:d},{x:c,y:d},{x:c,y:d+h}],m=p.polygon(y.map(b=>[b.x,b.y]),f),x=n.insert(()=>m,":first-child");return x.attr("class","basic label-container").attr("style",Tt(u)),i&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",i),u&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",i),o.attr("transform",`translate(${-l/2+4+(e.padding??0)-(a.x-(a.left??0))},${-h/2+(e.padding??0)-(a.y-(a.top??0))})`),Y(e,x),e.intersect=function(b){return q.rect(e,b)},n}g(_p,"shadedProcess");async function Sp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=-s/2,c=-l/2,{cssStyles:d}=e,u=N.svg(n),p=j(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const f=[{x:h,y:c},{x:h,y:c+l},{x:h+s,y:c+l},{x:h+s,y:c-l/2}],y=rt(f),m=u.path(y,p),x=n.insert(()=>m,":first-child");return x.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",d),i&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),x.attr("transform",`translate(0, ${l/4})`),o.attr("transform",`translate(${-s/2+(e.padding??0)-(a.x-(a.left??0))}, ${-l/4+(e.padding??0)-(a.y-(a.top??0))})`),Y(e,x),e.intersect=function(b){return q.polygon(e,f,b)},n}g(Sp,"slopedRect");async function vp(t,e){const r={rx:0,ry:0,labelPaddingX:e.labelPaddingX??(e?.padding||0)*2,labelPaddingY:(e?.padding||0)*1};return Nn(t,e,r)}g(vp,"squareRect");async function Tp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=a.height+e.padding,s=a.width+o/4+e.padding,l=o/2,{cssStyles:h}=e,c=N.svg(n),d=j(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=[{x:-s/2+l,y:-o/2},{x:s/2-l,y:-o/2},...Jr(-s/2+l,0,l,50,90,270),{x:s/2-l,y:o/2},...Jr(s/2-l,0,l,50,270,450)],p=rt(u),f=c.path(p,d),y=n.insert(()=>f,":first-child");return y.attr("class","basic label-container outer-path"),h&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",h),i&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),Y(e,y),e.intersect=function(m){return q.polygon(e,u,m)},n}g(Tp,"stadium");async function Bp(t,e){return Nn(t,e,{rx:5,ry:5})}g(Bp,"state");function Mp(t,e,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=W(e);e.labelStyle=i;const{cssStyles:a}=e,{lineColor:o,stateBorder:s,nodeBorder:l}=r,h=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),c=N.svg(h),d=j(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=c.circle(0,0,14,{...d,stroke:o,strokeWidth:2}),p=s??l,f=c.circle(0,0,5,{...d,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),y=h.insert(()=>u,":first-child");return y.insert(()=>f),a&&y.selectAll("path").attr("style",a),n&&y.selectAll("path").attr("style",n),Y(e,y),e.intersect=function(m){return q.circle(e,7,m)},h}g(Mp,"stateEnd");function $p(t,e,{config:{themeVariables:r}}){const{lineColor:i}=r,n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let a;if(e.look==="handDrawn"){const o=N.svg(n).circle(0,0,14,W1(i));a=n.insert(()=>o),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else a=n.insert("circle",":first-child"),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return Y(e,a),e.intersect=function(o){return q.circle(e,7,o)},n}g($p,"stateStart");async function Lp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=(e?.padding||0)/2,s=a.width+e.padding,l=a.height+e.padding,h=-a.width/2-o,c=-a.height/2-o,d=[{x:0,y:0},{x:s,y:0},{x:s,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if(e.look==="handDrawn"){const u=N.svg(n),p=j(e,{}),f=u.rectangle(h-8,c,s+16,l,p),y=u.line(h,c,h,c+l,p),m=u.line(h+s,c,h+s,c+l,p);n.insert(()=>y,":first-child"),n.insert(()=>m,":first-child");const x=n.insert(()=>f,":first-child"),{cssStyles:b}=e;x.attr("class","basic label-container").attr("style",Tt(b)),Y(e,x)}else{const u=Be(n,s,l,d);i&&u.attr("style",i),Y(e,u)}return e.intersect=function(u){return q.polygon(e,d,u)},n}g(Lp,"subroutine");async function Fp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=Math.max(a.width+(e.padding??0)*2,e?.width??0),s=Math.max(a.height+(e.padding??0)*2,e?.height??0),l=-o/2,h=-s/2,c=.2*s,d=.2*s,{cssStyles:u}=e,p=N.svg(n),f=j(e,{}),y=[{x:l-c/2,y:h},{x:l+o+c/2,y:h},{x:l+o+c/2,y:h+s},{x:l-c/2,y:h+s}],m=[{x:l+o-c/2,y:h+s},{x:l+o+c/2,y:h+s},{x:l+o+c/2,y:h+s-d}];e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const x=rt(y),b=p.path(x,f),k=rt(m),_=p.path(k,{...f,fillStyle:"solid"}),C=n.insert(()=>_,":first-child");return C.insert(()=>b,":first-child"),C.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",u),i&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",i),Y(e,C),e.intersect=function(B){return q.polygon(e,y,B)},n}g(Fp,"taggedRect");async function Ap(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=l/4,c=.2*s,d=.2*l,u=l+h,{cssStyles:p}=e,f=N.svg(n),y=j(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const m=[{x:-s/2-s/2*.1,y:u/2},...Se(-s/2-s/2*.1,u/2,s/2+s/2*.1,u/2,h,.8),{x:s/2+s/2*.1,y:-u/2},{x:-s/2-s/2*.1,y:-u/2}],x=-s/2+s/2*.1,b=-u/2-d*.4,k=[{x:x+s-c,y:(b+l)*1.4},{x:x+s,y:b+l-d},{x:x+s,y:(b+l)*.9},...Se(x+s,(b+l)*1.3,x+s-c,(b+l)*1.5,-l*.03,.5)],_=rt(m),C=f.path(_,y),B=rt(k),v=f.path(B,{...y,fillStyle:"solid"}),E=n.insert(()=>v,":first-child");return E.insert(()=>C,":first-child"),E.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&E.selectAll("path").attr("style",i),E.attr("transform",`translate(0,${-h/2})`),o.attr("transform",`translate(${-s/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-h/2-(a.y-(a.top??0))})`),Y(e,E),e.intersect=function(D){return q.polygon(e,m,D)},n}g(Ap,"taggedWaveEdgedRectangle");async function Ep(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=Math.max(a.width+e.padding,e?.width||0),s=Math.max(a.height+e.padding,e?.height||0),l=-o/2,h=-s/2,c=n.insert("rect",":first-child");return c.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",h).attr("width",o).attr("height",s),Y(e,c),e.intersect=function(d){return q.rect(e,d)},n}g(Ep,"text");var $w=g((t,e,r,i,n,a)=>`M${t},${e}
a${n},${a} 0,0,1 0,${-i}
l${r},0
a${n},${a} 0,0,1 0,${i}
M${r},${-i}
a${n},${a} 0,0,0 0,${i}
l${-r},0`,"createCylinderPathD"),Lw=g((t,e,r,i,n,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${n},${a} 0,0,0 0,${-i}`,`l${-r},0`,`a${n},${a} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),Fw=g((t,e,r,i,n,a)=>[`M${t+r/2},${-i/2}`,`a${n},${a} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD");async function Op(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o,halfPadding:s}=await Q(t,e,Z(e)),l=e.look==="neo"?s*2:s,h=a.height+l,c=h/2,d=c/(2.5+h/50),u=a.width+d+l,{cssStyles:p}=e;let f;if(e.look==="handDrawn"){const y=N.svg(n),m=Lw(0,0,u,h,d,c),x=Fw(0,0,u,h,d,c),b=y.path(m,j(e,{})),k=y.path(x,j(e,{fill:"none"}));f=n.insert(()=>k,":first-child"),f=n.insert(()=>b,":first-child"),f.attr("class","basic label-container"),p&&f.attr("style",p)}else{const y=$w(0,0,u,h,d,c);f=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container").attr("style",Tt(p)).attr("style",i),f.attr("class","basic label-container"),p&&f.selectAll("path").attr("style",p),i&&f.selectAll("path").attr("style",i)}return f.attr("label-offset-x",d),f.attr("transform",`translate(${-u/2}, ${h/2} )`),o.attr("transform",`translate(${-(a.width/2)-d-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),Y(e,f),e.intersect=function(y){const m=q.rect(e,y),x=m.y-(e.y??0);if(c!=0&&(Math.abs(x)<(e.height??0)/2||Math.abs(x)==(e.height??0)/2&&Math.abs(m.x-(e.x??0))>(e.width??0)/2-d)){let b=d*d*(1-x*x/(c*c));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,y.x-(e.x??0)>0&&(b=-b),m.x+=b}return m},n}g(Op,"tiltedCylinder");async function Dp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=a.width+e.padding,s=a.height+e.padding,l=[{x:-3*s/6,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:0,y:-s}];let h;const{cssStyles:c}=e;if(e.look==="handDrawn"){const d=N.svg(n),u=j(e,{}),p=rt(l),f=d.path(p,u);h=n.insert(()=>f,":first-child").attr("transform",`translate(${-o/2}, ${s/2})`),c&&h.attr("style",c)}else h=Be(n,o,s,l);return i&&h.attr("style",i),e.width=o,e.height=s,Y(e,h),e.intersect=function(d){return q.polygon(e,l,d)},n}g(Dp,"trapezoid");async function Ip(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=60,s=20,l=Math.max(o,a.width+(e.padding??0)*2,e?.width??0),h=Math.max(s,a.height+(e.padding??0)*2,e?.height??0),{cssStyles:c}=e,d=N.svg(n),u=j(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const p=[{x:-l/2*.8,y:-h/2},{x:l/2*.8,y:-h/2},{x:l/2,y:-h/2*.6},{x:l/2,y:h/2},{x:-l/2,y:h/2},{x:-l/2,y:-h/2*.6}],f=rt(p),y=d.path(f,u),m=n.insert(()=>y,":first-child");return m.attr("class","basic label-container"),c&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",c),i&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",i),Y(e,m),e.intersect=function(x){return q.polygon(e,p,x)},n}g(Ip,"trapezoidalPentagon");async function Pp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=yt(st().flowchart?.htmlLabels),l=a.width+(e.padding??0),h=l+a.height,c=l+a.height,d=[{x:0,y:0},{x:c,y:0},{x:c/2,y:-h}],{cssStyles:u}=e,p=N.svg(n),f=j(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const y=rt(d),m=p.path(y,f),x=n.insert(()=>m,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`);return u&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",u),i&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),e.width=l,e.height=h,Y(e,x),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${h/2-(a.height+(e.padding??0)/(s?2:1)-(a.y-(a.top??0)))})`),e.intersect=function(b){return F.info("Triangle intersect",e,d,b),q.polygon(e,d,b)},n}g(Pp,"triangle");async function zp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=l/8,c=l+h,{cssStyles:d}=e,u=70-s,p=u>0?u/2:0,f=N.svg(n),y=j(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const m=[{x:-s/2-p,y:c/2},...Se(-s/2-p,c/2,s/2+p,c/2,h,.8),{x:s/2+p,y:-c/2},{x:-s/2-p,y:-c/2}],x=rt(m),b=f.path(x,y),k=n.insert(()=>b,":first-child");return k.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",d),i&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(0,${-h/2})`),o.attr("transform",`translate(${-s/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-h-(a.y-(a.top??0))})`),Y(e,k),e.intersect=function(_){return q.polygon(e,m,_)},n}g(zp,"waveEdgedRectangle");async function qp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a}=await Q(t,e,Z(e)),o=100,s=50,l=Math.max(a.width+(e.padding??0)*2,e?.width??0),h=Math.max(a.height+(e.padding??0)*2,e?.height??0),c=l/h;let d=l,u=h;d>u*c?u=d/c:d=u*c,d=Math.max(d,o),u=Math.max(u,s);const p=Math.min(u*.2,u/4),f=u+p*2,{cssStyles:y}=e,m=N.svg(n),x=j(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:-d/2,y:f/2},...Se(-d/2,f/2,d/2,f/2,p,1),{x:d/2,y:-f/2},...Se(d/2,-f/2,-d/2,-f/2,p,-1)],k=rt(b),_=m.path(k,x),C=n.insert(()=>_,":first-child");return C.attr("class","basic label-container"),y&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",y),i&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",i),Y(e,C),e.intersect=function(B){return q.polygon(e,b,B)},n}g(qp,"waveRectangle");async function Rp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,label:o}=await Q(t,e,Z(e)),s=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=5,c=-s/2,d=-l/2,{cssStyles:u}=e,p=N.svg(n),f=j(e,{}),y=[{x:c-h,y:d-h},{x:c-h,y:d+l},{x:c+s,y:d+l},{x:c+s,y:d-h}],m=`M${c-h},${d-h} L${c+s},${d-h} L${c+s},${d+l} L${c-h},${d+l} L${c-h},${d-h}
M${c-h},${d} L${c+s},${d}
M${c},${d-h} L${c},${d+l}`;e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const x=p.path(m,f),b=n.insert(()=>x,":first-child");return b.attr("transform",`translate(${h/2}, ${h/2})`),b.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",u),i&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",i),o.attr("transform",`translate(${-(a.width/2)+h/2-(a.x-(a.left??0))}, ${-(a.height/2)+h/2-(a.y-(a.top??0))})`),Y(e,b),e.intersect=function(k){return q.polygon(e,y,k)},n}g(Rp,"windowPane");async function to(t,e){const r=e;if(r.alias&&(e.label=r.alias),e.look==="handDrawn"){const{themeVariables:X}=St(),{background:tt}=X,lt={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${tt}`]};await to(t,lt)}const i=St();e.useHtmlLabels=i.htmlLabels;let n=i.er?.diagramPadding??10,a=i.er?.entityPadding??6;const{cssStyles:o}=e,{labelStyles:s,nodeStyles:l}=W(e);if(r.attributes.length===0&&e.label){const X={rx:0,ry:0,labelPaddingX:n,labelPaddingY:n*1.5};ue(e.label,i)+X.labelPaddingX*2<i.er.minEntityWidth&&(e.width=i.er.minEntityWidth);const tt=await Nn(t,e,X);if(!yt(i.htmlLabels)){const lt=tt.select("text"),ht=lt.node()?.getBBox();lt.attr("transform",`translate(${-ht.width/2}, 0)`)}return tt}i.htmlLabels||(n*=1.25,a*=1.25);let h=Z(e);h||(h="node default");const c=t.insert("g").attr("class",h).attr("id",e.domId||e.id),d=await er(c,e.label??"",i,0,0,["name"],s);d.height+=a;let u=0;const p=[],f=[];let y=0,m=0,x=0,b=0,k=!0,_=!0;for(const X of r.attributes){const tt=await er(c,X.type,i,0,u,["attribute-type"],s);y=Math.max(y,tt.width+n);const lt=await er(c,X.name,i,0,u,["attribute-name"],s);m=Math.max(m,lt.width+n);const ht=await er(c,X.keys.join(),i,0,u,["attribute-keys"],s);x=Math.max(x,ht.width+n);const Pt=await er(c,X.comment,i,0,u,["attribute-comment"],s);b=Math.max(b,Pt.width+n);const kt=Math.max(tt.height,lt.height,ht.height,Pt.height)+a;f.push({yOffset:u,rowHeight:kt}),u+=kt}let C=4;x<=n&&(k=!1,x=0,C--),b<=n&&(_=!1,b=0,C--);const B=c.node().getBBox();if(d.width+n*2-(y+m+x+b)>0){const X=d.width+n*2-(y+m+x+b);y+=X/C,m+=X/C,x>0&&(x+=X/C),b>0&&(b+=X/C)}const v=y+m+x+b,E=N.svg(c),D=j(e,{});e.look!=="handDrawn"&&(D.roughness=0,D.fillStyle="solid");let I=0;f.length>0&&(I=f.reduce((X,tt)=>X+(tt?.rowHeight??0),0));const A=Math.max(B.width+n*2,e?.width||0,v),P=Math.max((I??0)+d.height,e?.height||0),O=-A/2,T=-P/2;c.selectAll("g:not(:first-child)").each((X,tt,lt)=>{const ht=it(lt[tt]),Pt=ht.attr("transform");let kt=0,ge=0;if(Pt){const Nt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Pt);Nt&&(kt=parseFloat(Nt[1]),ge=parseFloat(Nt[2]),ht.attr("class").includes("attribute-name")?kt+=y:ht.attr("class").includes("attribute-keys")?kt+=y+m:ht.attr("class").includes("attribute-comment")&&(kt+=y+m+x))}ht.attr("transform",`translate(${O+n/2+kt}, ${ge+T+d.height+a/2})`)}),c.select(".name").attr("transform","translate("+-d.width/2+", "+(T+a/2)+")");const M=E.rectangle(O,T,A,P,D),S=c.insert(()=>M,":first-child").attr("style",o.join("")),{themeVariables:L}=St(),{rowEven:$,rowOdd:H,nodeBorder:U}=L;p.push(0);for(const[X,tt]of f.entries()){const lt=(X+1)%2===0&&tt.yOffset!==0,ht=E.rectangle(O,d.height+T+tt?.yOffset,A,tt?.rowHeight,{...D,fill:lt?$:H,stroke:U});c.insert(()=>ht,"g.label").attr("style",o.join("")).attr("class",`row-rect-${lt?"even":"odd"}`)}let et=E.line(O,d.height+T,A+O,d.height+T,D);c.insert(()=>et).attr("class","divider"),et=E.line(y+O,d.height+T,y+O,P+T,D),c.insert(()=>et).attr("class","divider"),k&&(et=E.line(y+m+O,d.height+T,y+m+O,P+T,D),c.insert(()=>et).attr("class","divider")),_&&(et=E.line(y+m+x+O,d.height+T,y+m+x+O,P+T,D),c.insert(()=>et).attr("class","divider"));for(const X of p)et=E.line(O,d.height+T+X,A+O,d.height+T+X,D),c.insert(()=>et).attr("class","divider");if(Y(e,S),l&&e.look!=="handDrawn"){const X=l.split(";")?.filter(tt=>tt.includes("stroke"))?.map(tt=>`${tt}`).join("; ");c.selectAll("path").attr("style",X??""),c.selectAll(".row-rect-even path").attr("style",l)}return e.intersect=function(X){return q.rect(e,X)},c}g(to,"erBox");async function er(t,e,r,i=0,n=0,a=[],o=""){const s=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${i}, ${n})`).attr("style",o);e!==ho(e)&&(e=ho(e),e=e.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=s.node().appendChild(await ve(s,e,{width:ue(e,r)+100,style:o,useHtmlLabels:r.htmlLabels},r));if(e.includes("&lt;")||e.includes("&gt;")){let c=l.children[0];for(c.textContent=c.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");c.childNodes[0];)c=c.childNodes[0],c.textContent=c.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let h=l.getBBox();if(yt(r.htmlLabels)){const c=l.children[0];c.style.textAlign="start";const d=it(l);h=c.getBoundingClientRect(),d.attr("width",h.width),d.attr("height",h.height)}return h}g(er,"addText");async function Np(t,e,r,i,n=r.class.padding??12){const a=i?0:3,o=t.insert("g").attr("class",Z(e)).attr("id",e.domId||e.id);let s=null,l=null,h=null,c=null,d=0,u=0,p=0;if(s=o.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const b=e.annotations[0];await Or(s,{text:`«${b}»`},0),d=s.node().getBBox().height}l=o.insert("g").attr("class","label-group text"),await Or(l,e,0,["font-weight: bolder"]);const f=l.node().getBBox();u=f.height,h=o.insert("g").attr("class","members-group text");let y=0;for(const b of e.members){const k=await Or(h,b,y,[b.parseClassifier()]);y+=k+a}p=h.node().getBBox().height,p<=0&&(p=n/2),c=o.insert("g").attr("class","methods-group text");let m=0;for(const b of e.methods){const k=await Or(c,b,m,[b.parseClassifier()]);m+=k+a}let x=o.node().getBBox();if(s!==null){const b=s.node().getBBox();s.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-f.width/2}, ${d})`),x=o.node().getBBox(),h.attr("transform",`translate(0, ${d+u+n*2})`),x=o.node().getBBox(),c.attr("transform",`translate(0, ${d+u+(p?p+n*4:n*2)})`),x=o.node().getBBox(),{shapeSvg:o,bbox:x}}g(Np,"textHelper");async function Or(t,e,r,i=[]){const n=t.insert("g").attr("class","label").attr("style",i.join("; ")),a=St();let o="useHtmlLabels"in e?e.useHtmlLabels:yt(a.htmlLabels)??!0,s="";"text"in e?s=e.text:s=e.label,!o&&s.startsWith("\\")&&(s=s.substring(1)),lr(s)&&(o=!0);const l=await ve(n,cs(Ge(s)),{width:ue(s,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a);let h,c=1;if(o){const d=l.children[0],u=it(l);c=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(c+=d.innerHTML.split("<mrow>").length-1);const p=d.getElementsByTagName("img");if(p){const f=s.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...p].map(y=>new Promise(m=>{function x(){if(y.style.display="flex",y.style.flexDirection="column",f){const b=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,k=parseInt(b,10)*5+"px";y.style.minWidth=k,y.style.maxWidth=k}else y.style.width="100%";m(y)}g(x,"setupImage"),setTimeout(()=>{y.complete&&x()}),y.addEventListener("error",x),y.addEventListener("load",x)})))}h=d.getBoundingClientRect(),u.attr("width",h.width),u.attr("height",h.height)}else{i.includes("font-weight: bolder")&&it(l).selectAll("tspan").attr("font-weight",""),c=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes("&gt"))&&(d.textContent=s[0]+s.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),s[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),h=l.getBBox()}return n.attr("transform","translate(0,"+(-h.height/(2*c)+r)+")"),h.height}g(Or,"addText");async function jp(t,e){const r=st(),i=r.class.padding??12,n=i,a=e.useHtmlLabels??yt(r.htmlLabels)??!0,o=e;o.annotations=o.annotations??[],o.members=o.members??[],o.methods=o.methods??[];const{shapeSvg:s,bbox:l}=await Np(t,e,r,a,n),{labelStyles:h,nodeStyles:c}=W(e);e.labelStyle=h,e.cssStyles=o.styles||"";const d=o.styles?.join(";")||c||"";e.cssStyles||(e.cssStyles=d.replaceAll("!important","").split(";"));const u=o.members.length===0&&o.methods.length===0&&!r.class?.hideEmptyMembersBox,p=N.svg(s),f=j(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const y=l.width;let m=l.height;o.members.length===0&&o.methods.length===0?m+=n:o.members.length>0&&o.methods.length===0&&(m+=n*2);const x=-y/2,b=-m/2,k=p.rectangle(x-i,b-i-(u?i:o.members.length===0&&o.methods.length===0?-i/2:0),y+2*i,m+2*i+(u?i*2:o.members.length===0&&o.methods.length===0?-i:0),f),_=s.insert(()=>k,":first-child");_.attr("class","basic label-container");const C=_.node().getBBox();s.selectAll(".text").each((D,I,A)=>{const P=it(A[I]),O=P.attr("transform");let T=0;if(O){const L=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(O);L&&(T=parseFloat(L[2]))}let M=T+b+i-(u?i:o.members.length===0&&o.methods.length===0?-i/2:0);a||(M-=4);let S=x;(P.attr("class").includes("label-group")||P.attr("class").includes("annotation-group"))&&(S=-P.node()?.getBBox().width/2||0,s.selectAll("text").each(function(L,$,H){window.getComputedStyle(H[$]).textAnchor==="middle"&&(S=0)})),P.attr("transform",`translate(${S}, ${M})`)});const B=s.select(".annotation-group").node().getBBox().height-(u?i/2:0)||0,v=s.select(".label-group").node().getBBox().height-(u?i/2:0)||0,E=s.select(".members-group").node().getBBox().height-(u?i/2:0)||0;if(o.members.length>0||o.methods.length>0||u){const D=p.line(C.x,B+v+b+i,C.x+C.width,B+v+b+i,f);s.insert(()=>D).attr("class","divider").attr("style",d)}if(u||o.members.length>0||o.methods.length>0){const D=p.line(C.x,B+v+E+b+n*2+i,C.x+C.width,B+v+E+b+i+n*2,f);s.insert(()=>D).attr("class","divider").attr("style",d)}if(o.look!=="handDrawn"&&s.selectAll("path").attr("style",d),_.select(":nth-child(2)").attr("style",d),s.selectAll(".divider").select("path").attr("style",d),e.labelStyle?s.selectAll("span").attr("style",e.labelStyle):s.selectAll("span").attr("style",d),!a){const D=RegExp(/color\s*:\s*([^;]*)/),I=D.exec(d);if(I){const A=I[0].replace("color","fill");s.selectAll("tspan").attr("style",A)}else if(h){const A=D.exec(h);if(A){const P=A[0].replace("color","fill");s.selectAll("tspan").attr("style",P)}}}return Y(e,_),e.intersect=function(D){return q.rect(e,D)},s}g(jp,"classBox");async function Wp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const n=e,a=e,o=20,s=20,l="verifyMethod"in e,h=Z(e),c=t.insert("g").attr("class",h).attr("id",e.domId??e.id);let d;l?d=await Qt(c,`&lt;&lt;${n.type}&gt;&gt;`,0,e.labelStyle):d=await Qt(c,"&lt;&lt;Element&gt;&gt;",0,e.labelStyle);let u=d;const p=await Qt(c,n.name,u,e.labelStyle+"; font-weight: bold;");if(u+=p+s,l){const B=await Qt(c,`${n.requirementId?`ID: ${n.requirementId}`:""}`,u,e.labelStyle);u+=B;const v=await Qt(c,`${n.text?`Text: ${n.text}`:""}`,u,e.labelStyle);u+=v;const E=await Qt(c,`${n.risk?`Risk: ${n.risk}`:""}`,u,e.labelStyle);u+=E,await Qt(c,`${n.verifyMethod?`Verification: ${n.verifyMethod}`:""}`,u,e.labelStyle)}else{const B=await Qt(c,`${a.type?`Type: ${a.type}`:""}`,u,e.labelStyle);u+=B,await Qt(c,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,u,e.labelStyle)}const f=(c.node()?.getBBox().width??200)+o,y=(c.node()?.getBBox().height??200)+o,m=-f/2,x=-y/2,b=N.svg(c),k=j(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=b.rectangle(m,x,f,y,k),C=c.insert(()=>_,":first-child");if(C.attr("class","basic label-container").attr("style",i),c.selectAll(".label").each((B,v,E)=>{const D=it(E[v]),I=D.attr("transform");let A=0,P=0;if(I){const M=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);M&&(A=parseFloat(M[1]),P=parseFloat(M[2]))}const O=P-y/2;let T=m+o/2;(v===0||v===1)&&(T=A),D.attr("transform",`translate(${T}, ${O+o})`)}),u>d+p+s){const B=b.line(m,x+d+p+s,m+f,x+d+p+s,k);c.insert(()=>B).attr("style",i)}return Y(e,C),e.intersect=function(B){return q.rect(e,B)},c}g(Wp,"requirementBox");async function Qt(t,e,r,i=""){if(e==="")return 0;const n=t.insert("g").attr("class","label").attr("style",i),a=st(),o=a.htmlLabels??!0,s=await ve(n,cs(Ge(e)),{width:ue(e,a)+50,classes:"markdown-node-label",useHtmlLabels:o,style:i},a);let l;if(o){const h=s.children[0],c=it(s);l=h.getBoundingClientRect(),c.attr("width",l.width),c.attr("height",l.height)}else{const h=s.children[0];for(const c of h.children)c.textContent=c.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),i&&c.setAttribute("style",i);l=s.getBBox(),l.height+=6}return n.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}g(Qt,"addText");var Aw=g(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Hp(t,e,{config:r}){const{labelStyles:i,nodeStyles:n}=W(e);e.labelStyle=i||"";const a=10,o=e.width;e.width=(e.width??200)-10;const{shapeSvg:s,bbox:l,label:h}=await Q(t,e,Z(e)),c=e.padding||10;let d="",u;"ticket"in e&&e.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),u=s.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const p={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let f,y;u?{label:f,bbox:y}=await na(u,"ticket"in e&&e.ticket||"",p):{label:f,bbox:y}=await na(s,"ticket"in e&&e.ticket||"",p);const{label:m,bbox:x}=await na(s,"assigned"in e&&e.assigned||"",p);e.width=o;const b=10,k=e?.width||0,_=Math.max(y.height,x.height)/2,C=Math.max(l.height+b*2,e?.height||0)+_,B=-k/2,v=-C/2;h.attr("transform","translate("+(c-k/2)+", "+(-_-l.height/2)+")"),f.attr("transform","translate("+(c-k/2)+", "+(-_+l.height/2)+")"),m.attr("transform","translate("+(c+k/2-x.width-2*a)+", "+(-_+l.height/2)+")");let E;const{rx:D,ry:I}=e,{cssStyles:A}=e;if(e.look==="handDrawn"){const P=N.svg(s),O=j(e,{}),T=D||I?P.path(Te(B,v,k,C,D||0),O):P.rectangle(B,v,k,C,O);E=s.insert(()=>T,":first-child"),E.attr("class","basic label-container").attr("style",A||null)}else{E=s.insert("rect",":first-child"),E.attr("class","basic label-container __APA__").attr("style",n).attr("rx",D??5).attr("ry",I??5).attr("x",B).attr("y",v).attr("width",k).attr("height",C);const P="priority"in e&&e.priority;if(P){const O=s.append("line"),T=B+2,M=v+Math.floor((D??0)/2),S=v+C-Math.floor((D??0)/2);O.attr("x1",T).attr("y1",M).attr("x2",T).attr("y2",S).attr("stroke-width","4").attr("stroke",Aw(P))}}return Y(e,E),e.height=C,e.intersect=function(P){return q.rect(e,P)},s}g(Hp,"kanbanItem");async function Yp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,halfPadding:o,label:s}=await Q(t,e,Z(e)),l=a.width+10*o,h=a.height+8*o,c=.15*l,{cssStyles:d}=e,u=a.width+20,p=a.height+20,f=Math.max(l,u),y=Math.max(h,p);s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let m;const x=`M0 0
a${c},${c} 1 0,0 ${f*.25},${-1*y*.1}
a${c},${c} 1 0,0 ${f*.25},0
a${c},${c} 1 0,0 ${f*.25},0
a${c},${c} 1 0,0 ${f*.25},${y*.1}
a${c},${c} 1 0,0 ${f*.15},${y*.33}
a${c*.8},${c*.8} 1 0,0 0,${y*.34}
a${c},${c} 1 0,0 ${-1*f*.15},${y*.33}
a${c},${c} 1 0,0 ${-1*f*.25},${y*.15}
a${c},${c} 1 0,0 ${-1*f*.25},0
a${c},${c} 1 0,0 ${-1*f*.25},0
a${c},${c} 1 0,0 ${-1*f*.25},${-1*y*.15}
a${c},${c} 1 0,0 ${-1*f*.1},${-1*y*.33}
a${c*.8},${c*.8} 1 0,0 0,${-1*y*.34}
a${c},${c} 1 0,0 ${f*.1},${-1*y*.33}
H0 V0 Z`;if(e.look==="handDrawn"){const b=N.svg(n),k=j(e,{}),_=b.path(x,k);m=n.insert(()=>_,":first-child"),m.attr("class","basic label-container").attr("style",Tt(d))}else m=n.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return m.attr("transform",`translate(${-f/2}, ${-y/2})`),Y(e,m),e.calcIntersect=function(b,k){return q.rect(b,k)},e.intersect=function(b){return F.info("Bang intersect",e,b),q.rect(e,b)},n}g(Yp,"bang");async function Vp(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,halfPadding:o,label:s}=await Q(t,e,Z(e)),l=a.width+2*o,h=a.height+2*o,c=.15*l,d=.25*l,u=.35*l,p=.2*l,{cssStyles:f}=e;let y;const m=`M0 0
a${c},${c} 0 0,1 ${l*.25},${-1*l*.1}
a${u},${u} 1 0,1 ${l*.4},${-1*l*.1}
a${d},${d} 1 0,1 ${l*.35},${l*.2}
a${c},${c} 1 0,1 ${l*.15},${h*.35}
a${p},${p} 1 0,1 ${-1*l*.15},${h*.65}
a${d},${c} 1 0,1 ${-1*l*.25},${l*.15}
a${u},${u} 1 0,1 ${-1*l*.5},0
a${c},${c} 1 0,1 ${-1*l*.25},${-1*l*.15}
a${c},${c} 1 0,1 ${-1*l*.1},${-1*h*.35}
a${p},${p} 1 0,1 ${l*.1},${-1*h*.65}
H0 V0 Z`;if(e.look==="handDrawn"){const x=N.svg(n),b=j(e,{}),k=x.path(m,b);y=n.insert(()=>k,":first-child"),y.attr("class","basic label-container").attr("style",Tt(f))}else y=n.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",m);return s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),y.attr("transform",`translate(${-l/2}, ${-h/2})`),Y(e,y),e.calcIntersect=function(x,b){return q.rect(x,b)},e.intersect=function(x){return F.info("Cloud intersect",e,x),q.rect(e,x)},n}g(Vp,"cloud");async function Up(t,e){const{labelStyles:r,nodeStyles:i}=W(e);e.labelStyle=r;const{shapeSvg:n,bbox:a,halfPadding:o,label:s}=await Q(t,e,Z(e)),l=a.width+8*o,h=a.height+2*o,c=5,d=`
M${-l/2} ${h/2-c}
v${-h+2*c}
q0,-${c} ${c},-${c}
h${l-2*c}
q${c},0 ${c},${c}
v${h-2*c}
q0,${c} -${c},${c}
h${-l+2*c}
q-${c},0 -${c},-${c}
Z
`,u=n.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("style",i).attr("d",d);return n.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",h/2).attr("x2",l/2).attr("y2",h/2),s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),n.append(()=>s.node()),Y(e,u),e.calcIntersect=function(p,f){return q.rect(p,f)},e.intersect=function(p){return q.rect(e,p)},n}g(Up,"defaultMindmapNode");async function Gp(t,e){const r={padding:e.padding??0};return Js(t,e,r)}g(Gp,"mindmapCircle");var Ew=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:vp},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:wp},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Tp},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Lp},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Xu},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Js},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Yp},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Vp},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:bp},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:rp},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:up},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:dp},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Dp},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:hp},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Qu},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Ep},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Nu},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:_p},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:$p},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Mp},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:tp},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:ip},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Yu},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Vu},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Uu},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:pp},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:zp},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ep},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Op},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:gp},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Gu},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Zu},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Pp},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Rp},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Ku},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Ip},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Ju},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Sp},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:mp},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:yp},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Ru},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Hu},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Ap},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Fp},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:qp},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:kp},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:fp}],Ow=g(()=>{const t=[...Object.entries({state:Bp,choice:ju,note:xp,rectWithTitle:Cp,labelRect:cp,iconSquare:op,iconCircle:ap,icon:np,iconRounded:sp,imageSquare:lp,anchor:qu,kanbanItem:Hp,mindmapCircle:Gp,defaultMindmapNode:Up,classBox:jp,erBox:to,requirementBox:Wp}),...Ew.flatMap(e=>[e.shortName,..."aliases"in e?e.aliases:[],..."internalAliases"in e?e.internalAliases:[]].map(r=>[r,e.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Xp=Ow();function Dw(t){return t in Xp}g(Dw,"isValidShape");var jn=new Map;async function Zp(t,e,r){let i,n;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?Xp[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let o;r.config.securityLevel==="sandbox"?o="_top":e.linkTarget&&(o=e.linkTarget||"_blank"),i=t.insert("svg:a").attr("xlink:href",e.link).attr("target",o??null),n=await a(i,e,r)}else n=await a(t,e,r),i=n;return e.tooltip&&n.attr("title",e.tooltip),jn.set(e.id,i),e.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}g(Zp,"insertNode");var HT=g((t,e)=>{jn.set(e.id,t)},"setNodeElem"),YT=g(()=>{jn.clear()},"clear"),VT=g(t=>{const e=jn.get(t.id);F.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=8,i=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+i-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),i},"positionNode"),Iw=g((t,e,r,i,n,a)=>{e.arrowTypeStart&&bl(t,"start",e.arrowTypeStart,r,i,n,a),e.arrowTypeEnd&&bl(t,"end",e.arrowTypeEnd,r,i,n,a)},"addEdgeMarkers"),Pw={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},bl=g((t,e,r,i,n,a,o)=>{const s=Pw[r];if(!s){F.warn(`Unknown arrow type: ${r}`);return}const l=s.type,h=`${n}_${a}-${l}${e==="start"?"Start":"End"}`;if(o&&o.trim()!==""){const c=o.replace(/[^\dA-Za-z]/g,"_"),d=`${h}_${c}`;if(!document.getElementById(d)){const u=document.getElementById(h);if(u){const p=u.cloneNode(!0);p.id=d,p.querySelectorAll("path, circle, line").forEach(f=>{f.setAttribute("stroke",o),s.fill&&f.setAttribute("fill",o)}),u.parentNode?.appendChild(p)}}t.attr(`marker-${e}`,`url(${i}#${d})`)}else t.attr(`marker-${e}`,`url(${i}#${h})`)},"addEdgeMarker"),mn=new Map,bt=new Map,UT=g(()=>{mn.clear(),bt.clear()},"clear"),Ci=g(t=>t?t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),zw=g(async(t,e)=>{let r=yt(st().flowchart.htmlLabels);const{labelStyles:i}=W(e);e.labelStyle=i;const n=await ve(t,e.label,{style:e.labelStyle,useHtmlLabels:r,addSvgBackground:!0,isNode:!1});F.info("abc82",e,e.labelType);const a=t.insert("g").attr("class","edgeLabel"),o=a.insert("g").attr("class","label").attr("data-id",e.id);o.node().appendChild(n);let s=n.getBBox();if(r){const h=n.children[0],c=it(n);s=h.getBoundingClientRect(),c.attr("width",s.width),c.attr("height",s.height)}o.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),mn.set(e.id,a),e.width=s.width,e.height=s.height;let l;if(e.startLabelLeft){const h=await ze(e.startLabelLeft,Ci(e.labelStyle)),c=t.insert("g").attr("class","edgeTerminals"),d=c.insert("g").attr("class","inner");l=d.node().appendChild(h);const u=h.getBBox();d.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),bt.get(e.id)||bt.set(e.id,{}),bt.get(e.id).startLeft=c,Dr(l,e.startLabelLeft)}if(e.startLabelRight){const h=await ze(e.startLabelRight,Ci(e.labelStyle)),c=t.insert("g").attr("class","edgeTerminals"),d=c.insert("g").attr("class","inner");l=c.node().appendChild(h),d.node().appendChild(h);const u=h.getBBox();d.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),bt.get(e.id)||bt.set(e.id,{}),bt.get(e.id).startRight=c,Dr(l,e.startLabelRight)}if(e.endLabelLeft){const h=await ze(e.endLabelLeft,Ci(e.labelStyle)),c=t.insert("g").attr("class","edgeTerminals"),d=c.insert("g").attr("class","inner");l=d.node().appendChild(h);const u=h.getBBox();d.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),c.node().appendChild(h),bt.get(e.id)||bt.set(e.id,{}),bt.get(e.id).endLeft=c,Dr(l,e.endLabelLeft)}if(e.endLabelRight){const h=await ze(e.endLabelRight,Ci(e.labelStyle)),c=t.insert("g").attr("class","edgeTerminals"),d=c.insert("g").attr("class","inner");l=d.node().appendChild(h);const u=h.getBBox();d.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),c.node().appendChild(h),bt.get(e.id)||bt.set(e.id,{}),bt.get(e.id).endRight=c,Dr(l,e.endLabelRight)}return n},"insertEdgeLabel");function Dr(t,e){st().flowchart.htmlLabels&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}g(Dr,"setTerminalWidth");var qw=g((t,e)=>{F.debug("Moving label abc88 ",t.id,t.label,mn.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const i=st(),{subGraphTitleTotalMargin:n}=Ls(i);if(t.label){const a=mn.get(t.id);let o=t.x,s=t.y;if(r){const l=Yt.calcLabelPosition(r);F.debug("Moving label "+t.label+" from (",o,",",s,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(o=l.x,s=l.y)}a.attr("transform",`translate(${o}, ${s+n/2})`)}if(t.startLabelLeft){const a=bt.get(t.id).startLeft;let o=t.x,s=t.y;if(r){const l=Yt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.startLabelRight){const a=bt.get(t.id).startRight;let o=t.x,s=t.y;if(r){const l=Yt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelLeft){const a=bt.get(t.id).endLeft;let o=t.x,s=t.y;if(r){const l=Yt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelRight){const a=bt.get(t.id).endRight;let o=t.x,s=t.y;if(r){const l=Yt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}},"positionEdgeLabel"),Rw=g((t,e)=>{const r=t.x,i=t.y,n=Math.abs(e.x-r),a=Math.abs(e.y-i),o=t.width/2,s=t.height/2;return n>=o||a>=s},"outsideNode"),Nw=g((t,e,r)=>{F.debug(`intersection calc abc89:
outsidePoint: ${JSON.stringify(e)}
insidePoint : ${JSON.stringify(r)}
node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const i=t.x,n=t.y,a=Math.abs(i-r.x),o=t.width/2;let s=r.x<e.x?o-a:o+a;const l=t.height/2,h=Math.abs(e.y-r.y),c=Math.abs(e.x-r.x);if(Math.abs(n-e.y)*o>Math.abs(i-e.x)*l){let d=r.y<e.y?e.y-l-n:n-l-e.y;s=c*d/h;const u={x:r.x<e.x?r.x+s:r.x-c+s,y:r.y<e.y?r.y+h-d:r.y-h+d};return s===0&&(u.x=e.x,u.y=e.y),c===0&&(u.x=e.x),h===0&&(u.y=e.y),F.debug(`abc89 top/bottom calc, Q ${h}, q ${d}, R ${c}, r ${s}`,u),u}else{r.x<e.x?s=e.x-o-i:s=i-o-e.x;let d=h*s/c,u=r.x<e.x?r.x+c-s:r.x-c+s,p=r.y<e.y?r.y+d:r.y-d;return F.debug(`sides calc abc89, Q ${h}, q ${d}, R ${c}, r ${s}`,{_x:u,_y:p}),s===0&&(u=e.x,p=e.y),c===0&&(u=e.x),h===0&&(p=e.y),{x:u,y:p}}},"intersection"),kl=g((t,e)=>{F.warn("abc88 cutPathAtIntersect",t,e);let r=[],i=t[0],n=!1;return t.forEach(a=>{if(F.info("abc88 checking point",a,e),!Rw(e,a)&&!n){const o=Nw(e,i,a);F.debug("abc88 inside",a,i,o),F.debug("abc88 intersection",o,e);let s=!1;r.forEach(l=>{s=s||l.x===o.x&&l.y===o.y}),r.some(l=>l.x===o.x&&l.y===o.y)?F.warn("abc88 no intersect",o,r):r.push(o),n=!0}else F.warn("abc88 outside",a,i),i=a,n||r.push(a)}),F.debug("returning points",r),r},"cutPathAtIntersect");function Qp(t){const e=[],r=[];for(let i=1;i<t.length-1;i++){const n=t[i-1],a=t[i],o=t[i+1];(n.x===a.x&&a.y===o.y&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-n.y)>5||n.y===a.y&&a.x===o.x&&Math.abs(a.x-n.x)>5&&Math.abs(a.y-o.y)>5)&&(e.push(a),r.push(i))}return{cornerPoints:e,cornerPointPositions:r}}g(Qp,"extractCornerPoints");var Cl=g(function(t,e,r){const i=e.x-t.x,n=e.y-t.y,a=Math.sqrt(i*i+n*n),o=r/a;return{x:e.x-o*i,y:e.y-o*n}},"findAdjacentPoint"),jw=g(function(t){const{cornerPointPositions:e}=Qp(t),r=[];for(let i=0;i<t.length;i++)if(e.includes(i)){const n=t[i-1],a=t[i+1],o=t[i],s=Cl(n,o,5),l=Cl(a,o,5),h=l.x-s.x,c=l.y-s.y;r.push(s);const d=Math.sqrt(2)*2;let u={x:o.x,y:o.y};if(Math.abs(a.x-n.x)>10&&Math.abs(a.y-n.y)>=10){F.debug("Corner point fixing",Math.abs(a.x-n.x),Math.abs(a.y-n.y));const p=5;o.x===s.x?u={x:h<0?s.x-p+d:s.x+p-d,y:c<0?s.y-d:s.y+d}:u={x:h<0?s.x-d:s.x+d,y:c<0?s.y-p+d:s.y+p-d}}else F.debug("Corner point skipping fixing",Math.abs(a.x-n.x),Math.abs(a.y-n.y));r.push(u,l)}else r.push(t[i]);return r},"fixCorners"),Ww=g((t,e,r)=>{const i=t-e-r,n=2,a=2,o=n+a,s=Math.floor(i/o),l=Array(s).fill(`${n} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),Hw=g(function(t,e,r,i,n,a,o,s=!1){const{handDrawnSeed:l}=st();let h=e.points,c=!1;const d=n;var u=a;const p=[];for(const T in e.cssCompiledStyles)$d(T)||p.push(e.cssCompiledStyles[T]);F.debug("UIO intersect check",e.points,u.x,d.x),u.intersect&&d.intersect&&!s&&(h=h.slice(1,e.points.length-1),h.unshift(d.intersect(h[0])),F.debug("Last point UIO",e.start,"-->",e.end,h[h.length-1],u,u.intersect(h[h.length-1])),h.push(u.intersect(h[h.length-1])));const f=btoa(JSON.stringify(h));e.toCluster&&(F.info("to cluster abc88",r.get(e.toCluster)),h=kl(e.points,r.get(e.toCluster).node),c=!0),e.fromCluster&&(F.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(h,null,2)),h=kl(h.reverse(),r.get(e.fromCluster).node).reverse(),c=!0);let y=h.filter(T=>!Number.isNaN(T.y));y=jw(y);let m=Mi;switch(m=Gi,e.curve){case"linear":m=Gi;break;case"basis":m=Mi;break;case"cardinal":m=Eh;break;case"bumpX":m=Mh;break;case"bumpY":m=$h;break;case"catmullRom":m=Dh;break;case"monotoneX":m=Nh;break;case"monotoneY":m=jh;break;case"natural":m=Hh;break;case"step":m=Yh;break;case"stepAfter":m=Uh;break;case"stepBefore":m=Vh;break;default:m=Mi}const{x,y:b}=j1(e),k=vx().x(x).y(b).curve(m);let _;switch(e.thickness){case"normal":_="edge-thickness-normal";break;case"thick":_="edge-thickness-thick";break;case"invisible":_="edge-thickness-invisible";break;default:_="edge-thickness-normal"}switch(e.pattern){case"solid":_+=" edge-pattern-solid";break;case"dotted":_+=" edge-pattern-dotted";break;case"dashed":_+=" edge-pattern-dashed";break;default:_+=" edge-pattern-solid"}let C,B=e.curve==="rounded"?Kp(Jp(y,e),5):k(y);const v=Array.isArray(e.style)?e.style:[e.style];let E=v.find(T=>T?.startsWith("stroke:")),D=!1;if(e.look==="handDrawn"){const T=N.svg(t);Object.assign([],y);const M=T.path(B,{roughness:.3,seed:l});_+=" transition",C=it(M).select("path").attr("id",e.id).attr("class"," "+_+(e.classes?" "+e.classes:"")).attr("style",v?v.reduce((L,$)=>L+";"+$,""):"");let S=C.attr("d");C.attr("d",S),t.node().appendChild(C.node())}else{const T=p.join(";"),M=v?v.reduce((X,tt)=>X+tt+";",""):"";let S="";e.animate&&(S=" edge-animation-fast"),e.animation&&(S=" edge-animation-"+e.animation);const L=(T?T+";"+M+";":M)+";"+(v?v.reduce((X,tt)=>X+";"+tt,""):"");C=t.append("path").attr("d",B).attr("id",e.id).attr("class"," "+_+(e.classes?" "+e.classes:"")+(S??"")).attr("style",L),E=L.match(/stroke:([^;]+)/)?.[1],D=e.animate===!0||!!e.animation||T.includes("animation");const $=C.node(),H=typeof $.getTotalLength=="function"?$.getTotalLength():0,U=Po[e.arrowTypeStart]||0,et=Po[e.arrowTypeEnd]||0;if(e.look==="neo"&&!D){const X=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?Ww(H,U,et):`0 ${U} ${H-U-et} ${et}`}; stroke-dashoffset: 0;`;C.attr("style",X+C.attr("style"))}}C.attr("data-edge",!0),C.attr("data-et","edge"),C.attr("data-id",e.id),C.attr("data-points",f),e.showPoints&&y.forEach(T=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",T.x).attr("cy",T.y)});let I="";(st().flowchart.arrowMarkerAbsolute||st().state.arrowMarkerAbsolute)&&(I=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,I=I.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),F.info("arrowTypeStart",e.arrowTypeStart),F.info("arrowTypeEnd",e.arrowTypeEnd),Iw(C,e,I,o,i,E);const A=Math.floor(h.length/2),P=h[A];Yt.isLabelCoordinateInPath(P,C.attr("d"))||(c=!0);let O={};return c&&(O.updatedPath=h),O.originalPath=e.points,O},"insertEdge");function Kp(t,e){if(t.length<2)return"";let r="";const i=t.length,n=1e-5;for(let a=0;a<i;a++){const o=t[a],s=t[a-1],l=t[a+1];if(a===0)r+=`M${o.x},${o.y}`;else if(a===i-1)r+=`L${o.x},${o.y}`;else{const h=o.x-s.x,c=o.y-s.y,d=l.x-o.x,u=l.y-o.y,p=Math.hypot(h,c),f=Math.hypot(d,u);if(p<n||f<n){r+=`L${o.x},${o.y}`;continue}const y=h/p,m=c/p,x=d/f,b=u/f,k=y*x+m*b,_=Math.max(-1,Math.min(1,k)),C=Math.acos(_);if(C<n||Math.abs(Math.PI-C)<n){r+=`L${o.x},${o.y}`;continue}const B=Math.min(e/Math.sin(C/2),p/2,f/2),v=o.x-y*B,E=o.y-m*B,D=o.x+x*B,I=o.y+b*B;r+=`L${v},${E}`,r+=`Q${o.x},${o.y} ${D},${I}`}}return r}g(Kp,"generateRoundedPath");function Ga(t,e){if(!t||!e)return{angle:0,deltaX:0,deltaY:0};const r=e.x-t.x,i=e.y-t.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}g(Ga,"calculateDeltaAndAngle");function Jp(t,e){const r=t.map(n=>({...n}));if(t.length>=2&&_t[e.arrowTypeStart]){const n=_t[e.arrowTypeStart],a=t[0],o=t[1],{angle:s}=Ga(a,o),l=n*Math.cos(s),h=n*Math.sin(s);r[0].x=a.x+l,r[0].y=a.y+h}const i=t.length;if(i>=2&&_t[e.arrowTypeEnd]){const n=_t[e.arrowTypeEnd],a=t[i-1],o=t[i-2],{angle:s}=Ga(o,a),l=n*Math.cos(s),h=n*Math.sin(s);r[i-1].x=a.x-l,r[i-1].y=a.y-h}return r}g(Jp,"applyMarkerOffsetsToPoints");var Yw=g((t,e,r,i)=>{e.forEach(n=>{o_[n](t,r,i)})},"insertMarkers"),Vw=g((t,e,r)=>{F.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Uw=g((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Gw=g((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Xw=g((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Zw=g((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Qw=g((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Kw=g((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Jw=g((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),t_=g((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),e_=g((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),r_=g((t,e,r)=>{const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),i_=g((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),n_=g((t,e,r)=>{const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),a_=g((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
L20,10
M20,10
L0,20`)},"requirement_arrow"),s_=g((t,e,r)=>{const 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"),o_={extension:Vw,composition:Uw,aggregation:Gw,dependency:Xw,lollipop:Zw,point:Qw,circle:Kw,cross:Jw,barb:t_,only_one:e_,zero_or_one:r_,one_or_more:i_,zero_or_more:n_,requirement_arrow:a_,requirement_contains:s_},l_=Yw,h_={common:gr,getConfig:St,insertCluster:mw,insertEdge:Hw,insertEdgeLabel:zw,insertMarkers:l_,insertNode:Zp,interpolateToCurve:Ds,labelHelper:Q,log:F,positionEdgeLabel:qw},ti={},tg=g(t=>{for(const e of t)ti[e.name]=e},"registerLayoutLoaders"),c_=g(()=>{tg([{name:"dagre",loader:g(async()=>await ot(()=>import("./dagre-6UL2VRFP-DJVbq-dK.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),"loader")},{name:"cose-bilkent",loader:g(async()=>await ot(()=>import("./cose-bilkent-S5V4N54A-C7c-PUyn.chunk.mjs"),__vite__mapDeps([12,13,9,7,6,8,10,11]),import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");c_();var GT=g(async(t,e)=>{if(!(t.layoutAlgorithm in ti))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const r=ti[t.layoutAlgorithm];return(await r.loader()).render(t,e,h_,{algorithm:r.algorithm})},"render"),XT=g((t="",{fallback:e="dagre"}={})=>{if(t in ti)return t;if(e in ti)return F.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),eg="comm",rg="rule",ig="decl",d_="@import",u_="@namespace",p_="@keyframes",g_="@layer",ng=Math.abs,eo=String.fromCharCode;function ag(t){return t.trim()}function Oi(t,e,r){return t.replace(e,r)}function f_(t,e,r){return t.indexOf(e,r)}function ar(t,e){return t.charCodeAt(e)|0}function ur(t,e,r){return t.slice(e,r)}function Kt(t){return t.length}function y_(t){return t.length}function wi(t,e){return e.push(t),t}var Wn=1,pr=1,sg=0,Rt=0,pt=0,xr="";function ro(t,e,r,i,n,a,o,s){return{value:t,root:e,parent:r,type:i,props:n,children:a,line:Wn,column:pr,length:o,return:"",siblings:s}}function m_(){return pt}function x_(){return pt=Rt>0?ar(xr,--Rt):0,pr--,pt===10&&(pr=1,Wn--),pt}function Ut(){return pt=Rt<sg?ar(xr,Rt++):0,pr++,pt===10&&(pr=1,Wn++),pt}function be(){return ar(xr,Rt)}function Di(){return Rt}function Hn(t,e){return ur(xr,t,e)}function ei(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 b_(t){return Wn=pr=1,sg=Kt(xr=t),Rt=0,[]}function k_(t){return xr="",t}function aa(t){return ag(Hn(Rt-1,Xa(t===91?t+2:t===40?t+1:t)))}function C_(t){for(;(pt=be())&&pt<33;)Ut();return ei(t)>2||ei(pt)>3?"":" "}function w_(t,e){for(;--e&&Ut()&&!(pt<48||pt>102||pt>57&&pt<65||pt>70&&pt<97););return Hn(t,Di()+(e<6&&be()==32&&Ut()==32))}function Xa(t){for(;Ut();)switch(pt){case t:return Rt;case 34:case 39:t!==34&&t!==39&&Xa(pt);break;case 40:t===41&&Xa(t);break;case 92:Ut();break}return Rt}function __(t,e){for(;Ut()&&t+pt!==57&&!(t+pt===84&&be()===47););return"/*"+Hn(e,Rt-1)+"*"+eo(t===47?t:Ut())}function S_(t){for(;!ei(be());)Ut();return Hn(t,Rt)}function v_(t){return k_(Ii("",null,null,null,[""],t=b_(t),0,[0],t))}function Ii(t,e,r,i,n,a,o,s,l){for(var h=0,c=0,d=o,u=0,p=0,f=0,y=1,m=1,x=1,b=0,k="",_=n,C=a,B=i,v=k;m;)switch(f=b,b=Ut()){case 40:if(f!=108&&ar(v,d-1)==58){f_(v+=Oi(aa(b),"&","&\f"),"&\f",ng(h?s[h-1]:0))!=-1&&(x=-1);break}case 34:case 39:case 91:v+=aa(b);break;case 9:case 10:case 13:case 32:v+=C_(f);break;case 92:v+=w_(Di()-1,7);continue;case 47:switch(be()){case 42:case 47:wi(T_(__(Ut(),Di()),e,r,l),l),(ei(f||1)==5||ei(be()||1)==5)&&Kt(v)&&ur(v,-1,void 0)!==" "&&(v+=" ");break;default:v+="/"}break;case 123*y:s[h++]=Kt(v)*x;case 125*y:case 59:case 0:switch(b){case 0:case 125:m=0;case 59+c:x==-1&&(v=Oi(v,/\f/g,"")),p>0&&(Kt(v)-d||y===0&&f===47)&&wi(p>32?_l(v+";",i,r,d-1,l):_l(Oi(v," ","")+";",i,r,d-2,l),l);break;case 59:v+=";";default:if(wi(B=wl(v,e,r,h,c,n,s,k,_=[],C=[],d,a),a),b===123)if(c===0)Ii(v,e,B,B,_,a,d,s,C);else{switch(u){case 99:if(ar(v,3)===110)break;case 108:if(ar(v,2)===97)break;default:c=0;case 100:case 109:case 115:}c?Ii(t,B,B,i&&wi(wl(t,B,B,0,0,n,s,k,n,_=[],d,C),C),n,C,d,s,i?_:C):Ii(v,B,B,B,[""],C,0,s,C)}}h=c=p=0,y=x=1,k=v="",d=o;break;case 58:d=1+Kt(v),p=f;default:if(y<1){if(b==123)--y;else if(b==125&&y++==0&&x_()==125)continue}switch(v+=eo(b),b*y){case 38:x=c>0?1:(v+="\f",-1);break;case 44:s[h++]=(Kt(v)-1)*x,x=1;break;case 64:be()===45&&(v+=aa(Ut())),u=be(),c=d=Kt(k=v+=S_(Di())),b++;break;case 45:f===45&&Kt(v)==2&&(y=0)}}return a}function wl(t,e,r,i,n,a,o,s,l,h,c,d){for(var u=n-1,p=n===0?a:[""],f=y_(p),y=0,m=0,x=0;y<i;++y)for(var b=0,k=ur(t,u+1,u=ng(m=o[y])),_=t;b<f;++b)(_=ag(m>0?p[b]+" "+k:Oi(k,/&\f/g,p[b])))&&(l[x++]=_);return ro(t,e,r,n===0?rg:s,l,h,c,d)}function T_(t,e,r,i){return ro(t,e,r,eg,eo(m_()),ur(t,2,-2),0,i)}function _l(t,e,r,i,n){return ro(t,e,r,ig,ur(t,0,i),ur(t,i+1,-1),i,n)}function Za(t,e){for(var r="",i=0;i<t.length;i++)r+=e(t[i],i,t,e)||"";return r}function B_(t,e,r,i){switch(t.type){case g_:if(t.children.length)break;case d_:case u_:case ig:return t.return=t.return||t.value;case eg:return"";case p_:return t.return=t.value+"{"+Za(t.children,i)+"}";case rg:if(!Kt(t.value=t.props.join(",")))return""}return Kt(r=Za(t.children,i))?t.return=t.value+"{"+r+"}":""}var M_=Ed(Object.keys,Object),$_=Object.prototype,L_=$_.hasOwnProperty;function F_(t){if(!En(t))return M_(t);var e=[];for(var r in Object(t))L_.call(t,r)&&r!="constructor"&&e.push(r);return e}var Qa=Ue(ie,"DataView"),Ka=Ue(ie,"Promise"),Ja=Ue(ie,"Set"),ts=Ue(ie,"WeakMap"),Sl="[object Map]",A_="[object Object]",vl="[object Promise]",Tl="[object Set]",Bl="[object WeakMap]",Ml="[object DataView]",E_=Ve(Qa),O_=Ve(Kr),D_=Ve(Ka),I_=Ve(Ja),P_=Ve(ts),Ae=yr;(Qa&&Ae(new Qa(new ArrayBuffer(1)))!=Ml||Kr&&Ae(new Kr)!=Sl||Ka&&Ae(Ka.resolve())!=vl||Ja&&Ae(new Ja)!=Tl||ts&&Ae(new ts)!=Bl)&&(Ae=function(t){var e=yr(t),r=e==A_?t.constructor:void 0,i=r?Ve(r):"";if(i)switch(i){case E_:return Ml;case O_:return Sl;case D_:return vl;case I_:return Tl;case P_:return Bl}return e});var z_="[object Map]",q_="[object Set]",R_=Object.prototype,N_=R_.hasOwnProperty;function $l(t){if(t==null)return!0;if(On(t)&&(on(t)||typeof t=="string"||typeof t.splice=="function"||Es(t)||Os(t)||sn(t)))return!t.length;var e=Ae(t);if(e==z_||e==q_)return!t.size;if(En(t))return!F_(t).length;for(var r in t)if(N_.call(t,r))return!1;return!0}var og="c4",j_=g(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),W_=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./c4Diagram-YG6GDRKO-D8EA4slc.chunk.mjs");return{diagram:e}},__vite__mapDeps([14,15,6,7,8,9,10,11]),import.meta.url);return{id:og,diagram:t}},"loader"),H_={id:og,detector:j_,loader:W_},Y_=H_,lg="flowchart",V_=g((t,e)=>e?.flowchart?.defaultRenderer==="dagre-wrapper"||e?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(t),"detector"),U_=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./flowDiagram-NV44I4VS-BS0mqkL9.chunk.mjs");return{diagram:e}},__vite__mapDeps([16,17,18,19,20,6,7,8,9,10,11]),import.meta.url);return{id:lg,diagram:t}},"loader"),G_={id:lg,detector:V_,loader:U_},X_=G_,hg="flowchart-v2",Z_=g((t,e)=>e?.flowchart?.defaultRenderer==="dagre-d3"?!1:(e?.flowchart?.defaultRenderer==="elk"&&(e.layout="elk"),/^\s*graph/.test(t)&&e?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(t)),"detector"),Q_=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./flowDiagram-NV44I4VS-BS0mqkL9.chunk.mjs");return{diagram:e}},__vite__mapDeps([16,17,18,19,20,6,7,8,9,10,11]),import.meta.url);return{id:hg,diagram:t}},"loader"),K_={id:hg,detector:Z_,loader:Q_},J_=K_,cg="er",tS=g(t=>/^\s*erDiagram/.test(t),"detector"),eS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./erDiagram-Q2GNP2WA-BXDqWjIB.chunk.mjs");return{diagram:e}},__vite__mapDeps([21,18,19,20,6,7,8,9,10,11]),import.meta.url);return{id:cg,diagram:t}},"loader"),rS={id:cg,detector:tS,loader:eS},iS=rS,dg="gitGraph",nS=g(t=>/^\s*gitGraph/.test(t),"detector"),aS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./gitGraphDiagram-NY62KEGX-uYz2XzYa.chunk.mjs");return{diagram:e}},__vite__mapDeps([22,23,24,25,6,7,2,4,5,8,9,10,11]),import.meta.url);return{id:dg,diagram:t}},"loader"),sS={id:dg,detector:nS,loader:aS},oS=sS,ug="gantt",lS=g(t=>/^\s*gantt/.test(t),"detector"),hS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./ganttDiagram-JELNMOA3-BFwlxZbV.chunk.mjs");return{diagram:e}},__vite__mapDeps([26,7,27,28,29,6,8,9,10,11]),import.meta.url);return{id:ug,diagram:t}},"loader"),cS={id:ug,detector:lS,loader:hS},dS=cS,pg="info",uS=g(t=>/^\s*info/.test(t),"detector"),pS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./infoDiagram-WHAUD3N6-DDUy6ZtV.chunk.mjs");return{diagram:e}},__vite__mapDeps([30,25,6,7,2,4,5,8,9,10,11]),import.meta.url);return{id:pg,diagram:t}},"loader"),gS={id:pg,detector:uS,loader:pS},gg="pie",fS=g(t=>/^\s*pie/.test(t),"detector"),yS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./pieDiagram-ADFJNKIX-Dyb2KERd.chunk.mjs");return{diagram:e}},__vite__mapDeps([31,23,25,6,7,2,4,5,32,33,28,8,9,10,11]),import.meta.url);return{id:gg,diagram:t}},"loader"),mS={id:gg,detector:fS,loader:yS},fg="quadrantChart",xS=g(t=>/^\s*quadrantChart/.test(t),"detector"),bS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./quadrantDiagram-AYHSOK5B-CA6hLJI2.chunk.mjs");return{diagram:e}},__vite__mapDeps([34,27,28,29,6,7,8,9,10,11]),import.meta.url);return{id:fg,diagram:t}},"loader"),kS={id:fg,detector:xS,loader:bS},CS=kS,yg="xychart",wS=g(t=>/^\s*xychart(-beta)?/.test(t),"detector"),_S=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./xychartDiagram-PRI3JC2R-CxsDr-8D.chunk.mjs");return{diagram:e}},__vite__mapDeps([35,28,33,27,29,6,7,8,9,10,11]),import.meta.url);return{id:yg,diagram:t}},"loader"),SS={id:yg,detector:wS,loader:_S},vS=SS,mg="requirement",TS=g(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),BS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./requirementDiagram-UZGBJVZJ-hmYiFRHr.chunk.mjs");return{diagram:e}},__vite__mapDeps([36,18,19,6,7,8,9,10,11]),import.meta.url);return{id:mg,diagram:t}},"loader"),MS={id:mg,detector:TS,loader:BS},$S=MS,xg="sequence",LS=g(t=>/^\s*sequenceDiagram/.test(t),"detector"),FS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./sequenceDiagram-WL72ISMW-CVhR8HYZ.chunk.mjs");return{diagram:e}},__vite__mapDeps([37,15,24,6,7,8,9,10,11]),import.meta.url);return{id:xg,diagram:t}},"loader"),AS={id:xg,detector:LS,loader:FS},ES=AS,bg="class",OS=g((t,e)=>e?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t),"detector"),DS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./classDiagram-2ON5EDUG-C0RfdE4s.chunk.mjs");return{diagram:e}},__vite__mapDeps([38,39,17,18,19,6,7,8,9,10,11]),import.meta.url);return{id:bg,diagram:t}},"loader"),IS={id:bg,detector:OS,loader:DS},PS=IS,kg="classDiagram",zS=g((t,e)=>/^\s*classDiagram/.test(t)&&e?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t),"detector"),qS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./classDiagram-v2-WZHVMYZB-C0RfdE4s.chunk.mjs");return{diagram:e}},__vite__mapDeps([40,39,17,18,19,6,7,8,9,10,11]),import.meta.url);return{id:kg,diagram:t}},"loader"),RS={id:kg,detector:zS,loader:qS},NS=RS,Cg="state",jS=g((t,e)=>e?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t),"detector"),WS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./stateDiagram-FKZM4ZOC-CbhoquXf.chunk.mjs");return{diagram:e}},__vite__mapDeps([41,42,18,19,1,2,3,4,6,7,8,9,10,11]),import.meta.url);return{id:Cg,diagram:t}},"loader"),HS={id:Cg,detector:jS,loader:WS},YS=HS,wg="stateDiagram",VS=g((t,e)=>!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&e?.state?.defaultRenderer==="dagre-wrapper"),"detector"),US=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./stateDiagram-v2-4FDKWEC3-C12O73D0.chunk.mjs");return{diagram:e}},__vite__mapDeps([43,42,18,19,6,7,8,9,10,11]),import.meta.url);return{id:wg,diagram:t}},"loader"),GS={id:wg,detector:VS,loader:US},XS=GS,_g="journey",ZS=g(t=>/^\s*journey/.test(t),"detector"),QS=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./journeyDiagram-XKPGCS4Q-DjYCRdBZ.chunk.mjs");return{diagram:e}},__vite__mapDeps([44,15,17,32,6,7,8,9,10,11]),import.meta.url);return{id:_g,diagram:t}},"loader"),KS={id:_g,detector:ZS,loader:QS},JS=KS,tv=g((t,e,r)=>{F.debug(`rendering svg for syntax error
`);const i=Ox(e),n=i.append("g");i.attr("viewBox","0 0 2412 512"),Zl(i,100,512,!0),n.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"),n.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"),n.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"),n.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"),n.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"),n.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"),n.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"),n.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"),Sg={draw:tv},ev=Sg,rv={db:{},renderer:Sg,parser:{parse:g(()=>{},"parse")}},iv=rv,vg="flowchart-elk",nv=g((t,e={})=>/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&e?.flowchart?.defaultRenderer==="elk"?(e.layout="elk",!0):!1,"detector"),av=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./flowDiagram-NV44I4VS-BS0mqkL9.chunk.mjs");return{diagram:e}},__vite__mapDeps([16,17,18,19,20,6,7,8,9,10,11]),import.meta.url);return{id:vg,diagram:t}},"loader"),sv={id:vg,detector:nv,loader:av},ov=sv,Tg="timeline",lv=g(t=>/^\s*timeline/.test(t),"detector"),hv=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./timeline-definition-IT6M3QCI-DrptD8mO.chunk.mjs");return{diagram:e}},__vite__mapDeps([45,32,6,7,8,9,10,11]),import.meta.url);return{id:Tg,diagram:t}},"loader"),cv={id:Tg,detector:lv,loader:hv},dv=cv,Bg="mindmap",uv=g(t=>/^\s*mindmap/.test(t),"detector"),pv=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./mindmap-definition-VGOIOE7T-11Z0vAWH.chunk.mjs");return{diagram:e}},__vite__mapDeps([46,18,19,47,8,7,6,9,10,11,48,49,50,51,52,53,54,55,56]),import.meta.url);return{id:Bg,diagram:t}},"loader"),gv={id:Bg,detector:uv,loader:pv},fv=gv,Mg="kanban",yv=g(t=>/^\s*kanban/.test(t),"detector"),mv=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./kanban-definition-3W4ZIXB7-BwRo3Wa6.chunk.mjs");return{diagram:e}},__vite__mapDeps([57,17,6,7,8,9,10,11]),import.meta.url);return{id:Mg,diagram:t}},"loader"),xv={id:Mg,detector:yv,loader:mv},bv=xv,$g="sankey",kv=g(t=>/^\s*sankey(-beta)?/.test(t),"detector"),Cv=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./sankeyDiagram-TZEHDZUN-bJrJnnw9.chunk.mjs");return{diagram:e}},__vite__mapDeps([58,33,28,6,7,8,9,10,11]),import.meta.url);return{id:$g,diagram:t}},"loader"),wv={id:$g,detector:kv,loader:Cv},_v=wv,Lg="packet",Sv=g(t=>/^\s*packet(-beta)?/.test(t),"detector"),vv=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./diagram-S2PKOQOG-BJDVGPp_.chunk.mjs");return{diagram:e}},__vite__mapDeps([59,23,25,6,7,2,4,5,8,9,10,11]),import.meta.url);return{id:Lg,diagram:t}},"loader"),Tv={id:Lg,detector:Sv,loader:vv},Fg="radar",Bv=g(t=>/^\s*radar-beta/.test(t),"detector"),Mv=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./diagram-QEK2KX5R-BvatOdYd.chunk.mjs");return{diagram:e}},__vite__mapDeps([60,23,25,6,7,2,4,5,8,9,10,11]),import.meta.url);return{id:Fg,diagram:t}},"loader"),$v={id:Fg,detector:Bv,loader:Mv},Ag="block",Lv=g(t=>/^\s*block(-beta)?/.test(t),"detector"),Fv=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./blockDiagram-VD42YOAC-DK0_Jwr9.chunk.mjs");return{diagram:e}},__vite__mapDeps([61,17,5,2,1,20,6,7,8,9,10,11]),import.meta.url);return{id:Ag,diagram:t}},"loader"),Av={id:Ag,detector:Lv,loader:Fv},Ev=Av,Eg="architecture",Ov=g(t=>/^\s*architecture/.test(t),"detector"),Dv=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./architectureDiagram-VXUJARFQ-D4dy_-Nw.chunk.mjs");return{diagram:e}},__vite__mapDeps([62,23,25,6,7,2,4,5,13,9,8,10,11]),import.meta.url);return{id:Eg,diagram:t}},"loader"),Iv={id:Eg,detector:Ov,loader:Dv},Pv=Iv,Og="treemap",zv=g(t=>/^\s*treemap/.test(t),"detector"),qv=g(async()=>{const{diagram:t}=await ot(async()=>{const{diagram:e}=await import("./diagram-PSM6KHXK-Dz6SO3L1.chunk.mjs");return{diagram:e}},__vite__mapDeps([63,19,23,25,6,7,2,4,5,29,33,28,8,9,10,11]),import.meta.url);return{id:Og,diagram:t}},"loader"),Rv={id:Og,detector:zv,loader:qv},Ll=!1,Yn=g(()=>{Ll||(Ll=!0,Ni("error",iv,t=>t.toLowerCase().trim()==="error"),Ni("---",{db:{clear:g(()=>{},"clear")},styles:{},renderer:{draw:g(()=>{},"draw")},parser:{parse:g(()=>{throw new 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:g(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),la(ov,fv,Pv),la(Y_,bv,NS,PS,iS,dS,gS,mS,$S,ES,J_,X_,dv,oS,XS,YS,JS,CS,_v,Tv,vS,Ev,$v,Rv))},"addDiagrams"),Nv=g(async()=>{F.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Re).map(async([e,{detector:r,loader:i}])=>{if(i)try{ua(e)}catch{try{const{diagram:n,id:a}=await i();Ni(a,n,r)}catch(n){throw F.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete Re[e],n}}}))).filter(e=>e.status==="rejected");if(t.length>0){F.error(`Failed to load ${t.length} external diagrams`);for(const e of t)F.error(e);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),jv="graphics-document document";function Dg(t,e){t.attr("role",jv),e!==""&&t.attr("aria-roledescription",e)}g(Dg,"setA11yDiagramInfo");function Ig(t,e,r,i){if(t.insert!==void 0){if(r){const n=`chart-desc-${i}`;t.attr("aria-describedby",n),t.insert("desc",":first-child").attr("id",n).text(r)}if(e){const n=`chart-title-${i}`;t.attr("aria-labelledby",n),t.insert("title",":first-child").attr("id",n).text(e)}}}g(Ig,"addSVGa11yTitleDescription");var es=class Pg{constructor(e,r,i,n,a){this.type=e,this.text=r,this.db=i,this.parser=n,this.renderer=a}static{g(this,"Diagram")}static async fromText(e,r={}){const i=St(),n=ns(e,i);e=Rk(e)+`
`;try{ua(n)}catch{const h=cf(n);if(!h)throw new zl(`Diagram ${n} not found.`);const{id:c,diagram:d}=await h();Ni(c,d)}const{db:a,parser:o,renderer:s,init:l}=ua(n);return o.parser&&(o.parser.yy=a),a.clear?.(),l?.(i),r.title&&a.setDiagramTitle?.(r.title),await o.parse(e),new Pg(n,e,a,o,s)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},Fl=[],Wv=g(()=>{Fl.forEach(t=>{t()}),Fl=[]},"attachFunctions"),Hv=g(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function zg(t){const e=t.match(Pl);if(!e)return{text:t,metadata:{}};let r=N1(e[1],{schema:R1})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const i={};return r.displayMode&&(i.displayMode=r.displayMode.toString()),r.title&&(i.title=r.title.toString()),r.config&&(i.config=r.config),{text:t.slice(e[0].length),metadata:i}}g(zg,"extractFrontMatter");var Yv=g(t=>t.replace(/\r\n?/g,`
`).replace(/<(\w+)([^>]*)>/g,(e,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Vv=g(t=>{const{text:e,metadata:r}=zg(t),{displayMode:i,title:n,config:a={}}=r;return i&&(a.gantt||(a.gantt={}),a.gantt.displayMode=i),{title:n,config:a,text:e}},"processFrontmatter"),Uv=g(t=>{const e=Yt.detectInit(t)??{},r=Yt.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(e.wrap=!0),{text:Bk(t),directive:e}},"processDirectives");function io(t){const e=Yv(t),r=Vv(e),i=Uv(r.text),n=Rs(r.config,i.directive);return t=Hv(i.text),{code:t,title:r.title,config:n}}g(io,"preprocessDiagram");function qg(t){const e=new TextEncoder().encode(t),r=Array.from(e,i=>String.fromCodePoint(i)).join("");return btoa(r)}g(qg,"toBase64");var Gv=5e4,Xv="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Zv="sandbox",Qv="loose",Kv="http://www.w3.org/2000/svg",Jv="http://www.w3.org/1999/xlink",tT="http://www.w3.org/1999/xhtml",eT="100%",rT="100%",iT="border:0;margin:0;",nT="margin:0",aT="allow-top-navigation-by-user-activation allow-popups",sT='The "iframe" tag is not supported by your browser.',oT=["foreignobject"],lT=["dominant-baseline"];function no(t){const e=io(t);return qi(),Tf(e.config??{}),e}g(no,"processAndSetConfigs");async function Rg(t,e){Yn();try{const{code:r,config:i}=no(t);return{diagramType:(await jg(r)).type,config:i}}catch(r){if(e?.suppressErrors)return!1;throw r}}g(Rg,"parse");var Al=g((t,e,r=[])=>`
.${t} ${e} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),hT=g((t,e=new Map)=>{let r="";if(t.themeCSS!==void 0&&(r+=`
${t.themeCSS}`),t.fontFamily!==void 0&&(r+=`
:root { --mermaid-font-family: ${t.fontFamily}}`),t.altFontFamily!==void 0&&(r+=`
:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){const i=t.htmlLabels??t.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(n=>{$l(n.styles)||i.forEach(a=>{r+=Al(n.id,a,n.styles)}),$l(n.textStyles)||(r+=Al(n.id,"tspan",(n?.textStyles||[]).map(a=>a.replace("color","fill"))))})}return r},"createCssStyles"),cT=g((t,e,r,i)=>{const n=hT(t,r),a=Vf(e,n,t.themeVariables);return Za(v_(`${i}{${a}}`),B_)},"createUserStyles"),dT=g((t="",e,r)=>{let i=t;return!r&&!e&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Ge(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),uT=g((t="",e)=>{const r=e?.viewBox?.baseVal?.height?e.viewBox.baseVal.height+"px":rT,i=qg(`<body style="${nT}">${t}</body>`);return`<iframe style="width:${eT};height:${r};${iT}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${aT}">
${sT}
</iframe>`},"putIntoIFrame"),El=g((t,e,r,i,n)=>{const a=t.append("div");a.attr("id",r),i&&a.attr("style",i);const o=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",Kv);return n&&o.attr("xmlns:xlink",n),o.append("g"),t},"appendDivSvgG");function rs(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}g(rs,"sandboxedIframe");var pT=g((t,e,r,i)=>{t.getElementById(e)?.remove(),t.getElementById(r)?.remove(),t.getElementById(i)?.remove()},"removeExistingElements"),gT=g(async function(t,e,r){Yn();const i=no(e);e=i.code;const n=St();F.debug(n),e.length>(n?.maxTextSize??Gv)&&(e=Xv);const a="#"+t,o="i"+t,s="#"+o,l="d"+t,h="#"+l,c=g(()=>{const P=it(u?s:h).node();P&&"remove"in P&&P.remove()},"removeTempElements");let d=it("body");const u=n.securityLevel===Zv,p=n.securityLevel===Qv,f=n.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),u){const P=rs(it(r),o);d=it(P.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=it(r);El(d,t,l,`font-family: ${f}`,Jv)}else{if(pT(document,t,l,o),u){const P=rs(it("body"),o);d=it(P.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=it("body");El(d,t,l)}let y,m;try{y=await es.fromText(e,{title:i.title})}catch(P){if(n.suppressErrorRendering)throw c(),P;y=await es.fromText("error"),m=P}const x=d.select(h).node(),b=y.type,k=x.firstChild,_=k.firstChild,C=y.renderer.getClasses?.(e,y),B=cT(n,b,C,a),v=document.createElement("style");v.innerHTML=B,k.insertBefore(v,_);try{await y.renderer.draw(e,t,ao.version,y)}catch(P){throw n.suppressErrorRendering?c():ev.draw(e,t,ao.version),P}const E=d.select(`${h} svg`),D=y.db.getAccTitle?.(),I=y.db.getAccDescription?.();Wg(b,E,D,I),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",tT);let A=d.select(h).node().innerHTML;if(F.debug("config.arrowMarkerAbsolute",n.arrowMarkerAbsolute),A=dT(A,u,yt(n.arrowMarkerAbsolute)),u){const P=d.select(h+" svg").node();A=uT(A,P)}else p||(A=sr.sanitize(A,{ADD_TAGS:oT,ADD_ATTR:lT,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Wv(),m)throw m;return c(),{diagramType:b,svg:A,bindFunctions:y.db.bindFunctions}},"render");function Ng(t={}){const e=gt({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Sf(e),e?.theme&&e.theme in he?e.themeVariables=he[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=he.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?_f(e):Wl();is(r.logLevel),Yn()}g(Ng,"initialize");var jg=g((t,e={})=>{const{code:r}=io(t);return es.fromText(r,e)},"getDiagramFromText");function Wg(t,e,r,i){Dg(e,t),Ig(e,r,i,e.attr("id"))}g(Wg,"addA11yInfo");var He=Object.freeze({render:gT,parse:Rg,getDiagramFromText:jg,initialize:Ng,getConfig:St,setConfig:Hl,getSiteConfig:Wl,updateSiteConfig:vf,reset:g(()=>{qi()},"reset"),globalReset:g(()=>{qi(or)},"globalReset"),defaultConfig:or});is(St().logLevel),qi(St());var fT=g((t,e,r)=>{F.warn(t),qs(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"),Hg=g(async function(t={querySelector:".mermaid"}){try{await yT(t)}catch(e){if(qs(e)&&F.error(e.str),pe.parseError&&pe.parseError(e),!t.suppressErrors)throw F.error("Use the suppressErrors option to suppress these errors"),e}},"run"),yT=g(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const i=He.getConfig();F.debug(`${t?"":"No "}Callback function found`);let n;if(r)n=r;else if(e)n=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");F.debug(`Found ${n.length} diagrams`),i?.startOnLoad!==void 0&&(F.debug("Start On Load: "+i?.startOnLoad),He.updateSiteConfig({startOnLoad:i?.startOnLoad}));const a=new Yt.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let o;const s=[];for(const l of Array.from(n)){if(F.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const h=`mermaid-${a.next()}`;o=l.innerHTML,o=cu(Yt.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");const c=Yt.detectInit(o);c&&F.debug("Detected early reinit: ",c);try{const{svg:d,bindFunctions:u}=await Gg(h,o,l);l.innerHTML=d,t&&await t(h),u&&u(l)}catch(d){fT(d,s,pe.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),Yg=g(function(t){He.initialize(t)},"initialize"),mT=g(async function(t,e,r){F.warn("mermaid.init is deprecated. Please use run instead."),t&&Yg(t);const i={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?i.querySelector=e:e&&(e instanceof HTMLElement?i.nodes=[e]:i.nodes=e),await Hg(i)},"init"),xT=g(async(t,{lazyLoad:e=!0}={})=>{Yn(),la(...t),e===!1&&await Nv()},"registerExternalDiagrams"),Vg=g(function(){if(pe.startOnLoad){const{startOnLoad:t}=He.getConfig();t&&pe.run().catch(e=>F.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Vg,!1);var bT=g(function(t){pe.parseError=t},"setParseErrorHandler"),xn=[],sa=!1,Ug=g(async()=>{if(!sa){for(sa=!0;xn.length>0;){const t=xn.shift();if(t)try{await t()}catch(e){F.error("Error executing queue",e)}}sa=!1}},"executeQueue"),kT=g(async(t,e)=>new Promise((r,i)=>{const n=g(()=>new Promise((a,o)=>{He.parse(t,e).then(s=>{a(s),r(s)},s=>{F.error("Error parsing",s),pe.parseError?.(s),o(s),i(s)})}),"performCall");xn.push(n),Ug().catch(i)}),"parse"),Gg=g((t,e,r)=>new Promise((i,n)=>{const a=g(()=>new Promise((o,s)=>{He.render(t,e,r).then(l=>{o(l),i(l)},l=>{F.error("Error parsing",l),pe.parseError?.(l),s(l),n(l)})}),"performCall");xn.push(a),Ug().catch(n)}),"render"),CT=g(()=>Object.keys(Re).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),pe={startOnLoad:!0,mermaidAPI:He,parse:kT,render:Gg,init:mT,run:Hg,registerExternalDiagrams:xT,registerLayoutLoaders:tg,initialize:Yg,parseError:void 0,contentLoaded:Vg,setParseErrorHandler:bT,detectType:ns,registerIconPacks:HC,getRegisteredDiagramsMetadata:CT},wT=pe;const ZT=Object.freeze(Object.defineProperty({__proto__:null,default:wT},Symbol.toStringTag,{value:"Module"}));export{DT as $,LT as A,Pr as B,te as C,tf as D,ey as E,Rs as F,St as G,jl as H,Ak as I,R1 as J,Ox as K,ao as L,Cx as M,xs as N,OT as O,PT as P,Ze as Q,Lo as R,$o as S,qT as T,J as U,zT as V,IT as W,AT as X,ET as Y,NT as Z,g as _,Xf as a,Ot as a$,RT as a0,yf as a1,lr as a2,MT as a3,Dn as a4,_k as a5,Df as a6,as as a7,ho as a8,vx as a9,WT as aA,Y as aB,HT as aC,Hw as aD,qw as aE,zw as aF,VC as aG,wx as aH,hi as aI,HC as aJ,WC as aK,Ye as aL,kk as aM,Nd as aN,Ln as aO,On as aP,on as aQ,Wd as aR,Rd as aS,Z2 as aT,gs as aU,me as aV,_o as aW,em as aX,Yr as aY,W as aZ,$d as a_,Mi as aa,Fk as ab,Wf as ac,ri as ad,R as ae,G as af,Ql as ag,BT as ah,mw as ai,Zp as aj,VT as ak,j1 as al,yt as am,ve as an,Ls as ao,wu as ap,Ge as aq,Xd as ar,bk as as,d2 as at,uk as au,Fs as av,$l as aw,l_ as ax,YT as ay,UT as az,Gf as b,G0 as b0,ps as b1,dh as b2,ni as b3,gh as b4,FT as b5,Jg as b6,xk as b7,dk as b8,Kb as b9,Ck as bA,En as bB,ZT as bC,As as ba,V2 as bb,wk as bc,oi as bd,yr as be,nn as bf,ik as bg,F_ as bh,si as bi,sn as bj,Q2 as bk,Od as bl,e2 as bm,r2 as bn,Ae as bo,Zo as bp,i2 as bq,Es as br,t2 as bs,s2 as bt,tr as bu,xe as bv,Yo as bw,Os as bx,Id as by,Ja as bz,st as c,it as d,Zl as e,gt as f,Qf as g,ue as h,qt as i,G1 as j,gr as k,F as l,Qd as m,ii as n,$T as o,XT as p,Kf as q,GT as r,Zf as s,Jf as t,Yt as u,N1 as v,Dk as w,Dw as x,jT as y,Uf as z};
//# sourceMappingURL=mermaid.core-BxtrgwOm.chunk.mjs.map