const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-RV2QPRKB-B6HNiSvq.js","assets/app-BwvsBlHw.js","assets/dagre-X5LCLMGV-CwB36wg9.js","assets/chunk-CCU7O4O5-C_HAswox.js","assets/chunk-EYG76IYJ-UAgStWzX.js","assets/chunk-OMTJKCYW-DMe1YJoF.js","assets/cose-bilkent-AZ5BDB2T-DyeqItdk.js","assets/chunk-7SRKK4IT-8I_gr733.js","assets/c4Diagram-Q5SP5FFD-DzsMI3Ik.js","assets/chunk-WONJCSFZ-Qra6PP-8.js","assets/flowDiagram-UML6HZQP-DAGK-b8j.js","assets/chunk-ZZTKAOFA-t_YYI9eu.js","assets/chunk-6EQESGSB-BIUamy9L.js","assets/chunk-T244DUNM-Cf7yFFbm.js","assets/erDiagram-MBDK6S7D-C9IYauT8.js","assets/gitGraphDiagram-JCGM6PWI-Cc41ymyc.js","assets/chunk-4KE642ED-DwBAzfS-.js","assets/treemap-KMMF4GRG-7ORZ52ND-CoiuN2Kf.js","assets/chunk-VSLJSFIP-DYo1Z_k8.js","assets/ganttDiagram-SAESIEWH-IHShLdv1.js","assets/infoDiagram-GKI3LBYJ-D5wcD6JP.js","assets/pieDiagram-QB62DFGK-7hcFCy4Z.js","assets/quadrantDiagram-AGVETKZM-BFi9v5jq.js","assets/xychartDiagram-6J6QOAP6-DruplG9A.js","assets/requirementDiagram-BJFPASL3-DcJNkQb2.js","assets/sequenceDiagram-W4XLKSBU-Cvj1HRdt.js","assets/classDiagram-FKO7XAE5-CzUjJx-s.js","assets/chunk-P7EU7REX-DW3m7Mjc.js","assets/classDiagram-v2-XZHHGUJO-CzUjJx-s.js","assets/stateDiagram-ZFDIVMDF-c3Z3A4fJ.js","assets/chunk-AI4T2ZLM-CoR2OeoK.js","assets/stateDiagram-v2-GQU47BET-C-GuSN9p.js","assets/journeyDiagram-E42M6OD5-DGiKq_-3.js","assets/timeline-definition-DZOEFOHF-CkjRGiIO.js","assets/mindmap-definition-ZYHNXUZP-CB32Yjz4.js","assets/kanban-definition-D5DEDDHO-CzE0zbtM.js","assets/sankeyDiagram-XSL23WO4-BLCarbPT.js","assets/diagram-BZV4OSZQ-BP82GnUQ.js","assets/diagram-DKYQLJNW-CZjeYhwy.js","assets/blockDiagram-BWRZOBD3-CBcaG9Zz.js","assets/architectureDiagram-4X3Z3J56-CLXWk1iP.js","assets/diagram-LL6QPXA2-B5BUPoIO.js"])))=>i.map(i=>d[i]); var l_=Object.defineProperty;var h_=(t,e,r)=>e in t?l_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var al=(t,e,r)=>h_(t,typeof e!="symbol"?e+"":e,r);import{a8 as bt}from"./app-BwvsBlHw.js";var Ad={name:"mermaid",version:"11.12.0",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.11",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"}},c_=Object.create,cs=Object.defineProperty,u_=Object.getOwnPropertyDescriptor,d_=Object.getOwnPropertyNames,p_=Object.getPrototypeOf,f_=Object.prototype.hasOwnProperty,l=(t,e)=>cs(t,"name",{value:e,configurable:!0}),ec=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),g_=(t,e)=>{for(var r in e)cs(t,r,{get:e[r],enumerable:!0})},qp=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of d_(e))!f_.call(t,a)&&a!==r&&cs(t,a,{get:()=>e[a],enumerable:!(i=u_(e,a))||i.enumerable});return t},tE=(t,e,r)=>(qp(t,e,"default"),r),jp=(t,e,r)=>(r=t!=null?c_(p_(t)):{},qp(cs(r,"default",{value:t,enumerable:!0}),t)),m_=ec((t,e)=>{(function(r,i){typeof t=="object"&&typeof e<"u"?e.exports=i():typeof define=="function"&&define.amd?define(i):(r=typeof globalThis<"u"?globalThis:r||self).dayjs=i()})(t,(function(){var r=1e3,i=6e4,a=36e5,n="millisecond",s="second",o="minute",c="hour",h="day",u="week",d="month",p="quarter",f="year",g="date",m="Invalid Date",y=/^(\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:l(function(v){var L=["th","st","nd","rd"],B=v%100;return"["+v+(L[(B-20)%10]||L[B]||L[0])+"]"},"ordinal")},k=l(function(v,L,B){var E=String(v);return!E||E.length>=L?v:""+Array(L+1-E.length).join(B)+v},"m"),_={s:k,z:l(function(v){var L=-v.utcOffset(),B=Math.abs(L),E=Math.floor(B/60),F=B%60;return(L<=0?"+":"-")+k(E,2,"0")+":"+k(F,2,"0")},"z"),m:l(function v(L,B){if(L.date()1)return v(Y[0])}else{var V=L.name;$[V]=L,F=V}return!E&&F&&(C=F),F||!E&&C},"t"),I=l(function(v,L){if(D(v))return v.clone();var B=typeof L=="object"?L:{};return B.date=v,B.args=arguments,new O(B)},"O"),T=_;T.l=N,T.i=D,T.w=function(v,L){return I(v,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var O=(function(){function v(B){this.$L=N(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[S]=!0}l(v,"M");var L=v.prototype;return L.parse=function(B){this.$d=(function(E){var F=E.date,z=E.utc;if(F===null)return new Date(NaN);if(T.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var Y=F.match(y);if(Y){var V=Y[2]-1||0,X=(Y[7]||"0").substring(0,3);return z?new Date(Date.UTC(Y[1],V,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,X)):new Date(Y[1],V,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,X)}}return new Date(F)})(B),this.init()},L.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},L.$utils=function(){return T},L.isValid=function(){return this.$d.toString()!==m},L.isSame=function(B,E){var F=I(B);return this.startOf(E)<=F&&F<=this.endOf(E)},L.isAfter=function(B,E){return I(B){},"trace"),debug:l((...t)=>{},"debug"),info:l((...t)=>{},"info"),warn:l((...t)=>{},"warn"),error:l((...t)=>{},"error"),fatal:l((...t)=>{},"fatal")},rc=l(function(t="fatal"){let e=ze.fatal;typeof t=="string"?t.toLowerCase()in ze&&(e=ze[t]):typeof t=="number"&&(e=t),R.trace=()=>{},R.debug=()=>{},R.info=()=>{},R.warn=()=>{},R.error=()=>{},R.fatal=()=>{},e<=ze.fatal&&(R.fatal=console.error?console.error.bind(console,ce("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",ce("FATAL"))),e<=ze.error&&(R.error=console.error?console.error.bind(console,ce("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",ce("ERROR"))),e<=ze.warn&&(R.warn=console.warn?console.warn.bind(console,ce("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",ce("WARN"))),e<=ze.info&&(R.info=console.info?console.info.bind(console,ce("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",ce("INFO"))),e<=ze.debug&&(R.debug=console.debug?console.debug.bind(console,ce("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ce("DEBUG"))),e<=ze.trace&&(R.trace=console.debug?console.debug.bind(console,ce("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",ce("TRACE")))},"setLogLevel"),ce=l(t=>`%c${(0,y_.default)().format("ss.SSS")} : ${t} : `,"format");function x_(t,e){let r;if(e===void 0)for(let i of t)i!=null&&(r=i)&&(r=i);else{let i=-1;for(let a of t)(a=e(a,++i,t))!=null&&(r=a)&&(r=a)}return r}l(x_,"max");function b_(t,e){let r;if(e===void 0)for(let i of t)i!=null&&(r>i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let a of t)(a=e(a,++i,t))!=null&&(r>a||r===void 0&&a>=a)&&(r=a)}return r}l(b_,"min");function Aa(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}l(Aa,"ascending");function Wp(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}l(Wp,"descending");function us(t){let e,r,i;t.length!==2?(e=Aa,r=l((o,c)=>Aa(t(o),c),"compare2"),i=l((o,c)=>t(o)-c,"delta")):(e=t===Aa||t===Wp?t:Hp,r=t,i=t);function a(o,c,h=0,u=o.length){if(h>>1;r(o[d],c)<0?h=d+1:u=d}while(h>>1;r(o[d],c)<=0?h=d+1:u=d}while(hh&&i(o[d-1],c)>-i(o[d],c)?d-1:d}return l(s,"center"),{left:a,center:s,right:n}}l(us,"bisector");function Hp(){return 0}l(Hp,"zero");function Up(t){return t===null?NaN:+t}l(Up,"number");var Yp=us(Aa),k_=Yp.right;Yp.left;us(Up).center;var C_=k_,bi,Ld=(bi=class extends Map{constructor(e,r=Xp){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(let[i,a]of e)this.set(i,a)}get(e){return super.get(wl(this,e))}has(e){return super.has(wl(this,e))}set(e,r){return super.set(Vp(this,e),r)}delete(e){return super.delete(Gp(this,e))}},l(bi,"InternMap"),bi);function wl({_intern:t,_key:e},r){let i=e(r);return t.has(i)?t.get(i):r}l(wl,"intern_get");function Vp({_intern:t,_key:e},r){let i=e(r);return t.has(i)?t.get(i):(t.set(i,r),r)}l(Vp,"intern_set");function Gp({_intern:t,_key:e},r){let i=e(r);return t.has(i)&&(r=t.get(i),t.delete(i)),r}l(Gp,"intern_delete");function Xp(t){return t!==null&&typeof t=="object"?t.valueOf():t}l(Xp,"keyof");var w_=Math.sqrt(50),$_=Math.sqrt(10),__=Math.sqrt(2);function Ha(t,e,r){let i=(e-t)/Math.max(0,r),a=Math.floor(Math.log10(i)),n=i/Math.pow(10,a),s=n>=w_?10:n>=$_?5:n>=__?2:1,o,c,h;return a<0?(h=Math.pow(10,-a)/s,o=Math.round(t*h),c=Math.round(e*h),o/he&&--c,h=-h):(h=Math.pow(10,a)*s,o=Math.round(t/h),c=Math.round(e/h),o*he&&--c),c0))return[];if(t===e)return[t];let i=e=a))return[];let o=n-a+1,c=new Array(o);if(i)if(s<0)for(let h=0;h+t(e)}l(ef,"number");function rf(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}l(rf,"center");function af(){return!this.__axis}l(af,"entering");function ic(t,e){var r=[],i=null,a=null,n=6,s=6,o=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,h=t===Qn||t===Pn?-1:1,u=t===Pn||t===nl?"x":"y",d=t===Qn||t===$l?Kp:tf;function p(f){var g=i??(e.ticks?e.ticks.apply(e,r):e.domain()),m=a??(e.tickFormat?e.tickFormat.apply(e,r):Jp),y=Math.max(n,0)+o,x=e.range(),b=+x[0]+c,k=+x[x.length-1]+c,_=(e.bandwidth?rf:ef)(e.copy(),c),C=f.selection?f.selection():f,$=C.selectAll(".domain").data([null]),S=C.selectAll(".tick").data(g,e).order(),D=S.exit(),N=S.enter().append("g").attr("class","tick"),I=S.select("line"),T=S.select("text");$=$.merge($.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(N),I=I.merge(N.append("line").attr("stroke","currentColor").attr(u+"2",h*n)),T=T.merge(N.append("text").attr("fill","currentColor").attr(u,h*y).attr("dy",t===Qn?"0em":t===$l?"0.71em":"0.32em")),f!==C&&($=$.transition(f),S=S.transition(f),I=I.transition(f),T=T.transition(f),D=D.transition(f).attr("opacity",Fd).attr("transform",function(O){return isFinite(O=_(O))?d(O+c):this.getAttribute("transform")}),N.attr("opacity",Fd).attr("transform",function(O){var A=this.parentNode.__axis;return d((A&&isFinite(A=A(O))?A:_(O))+c)})),D.remove(),$.attr("d",t===Pn||t===nl?s?"M"+h*s+","+b+"H"+c+"V"+k+"H"+h*s:"M"+c+","+b+"V"+k:s?"M"+b+","+h*s+"V"+c+"H"+k+"V"+h*s:"M"+b+","+c+"H"+k),S.attr("opacity",1).attr("transform",function(O){return d(_(O)+c)}),I.attr(u+"2",h*n),T.attr(u,h*y).text(m),C.filter(af).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===nl?"start":t===Pn?"end":"middle"),C.each(function(){this.__axis=_})}return l(p,"axis"),p.scale=function(f){return arguments.length?(e=f,p):e},p.ticks=function(){return r=Array.from(arguments),p},p.tickArguments=function(f){return arguments.length?(r=f==null?[]:Array.from(f),p):r.slice()},p.tickValues=function(f){return arguments.length?(i=f==null?null:Array.from(f),p):i&&i.slice()},p.tickFormat=function(f){return arguments.length?(a=f,p):a},p.tickSize=function(f){return arguments.length?(n=s=+f,p):n},p.tickSizeInner=function(f){return arguments.length?(n=+f,p):n},p.tickSizeOuter=function(f){return arguments.length?(s=+f,p):s},p.tickPadding=function(f){return arguments.length?(o=+f,p):o},p.offset=function(f){return arguments.length?(c=+f,p):c},p}l(ic,"axis");function v_(t){return ic(Qn,t)}l(v_,"axisTop");function S_(t){return ic($l,t)}l(S_,"axisBottom");function nf(){}l(nf,"none");function ds(t){return t==null?nf:function(){return this.querySelector(t)}}l(ds,"default");function of(t){typeof t!="function"&&(t=ds(t));for(var e=this._groups,r=e.length,i=new Array(r),a=0;a=k&&(k=b+1);!(C=y[k])&&++k=0;)(s=i[a])&&(n&&s.compareDocumentPosition(n)^4&&n.parentNode.insertBefore(s,n),n=s);return this}l(Mf,"default");function Bf(t){t||(t=Af);function e(d,p){return d&&p?t(d.__data__,p.__data__):!d-!p}l(e,"compareNode");for(var r=this._groups,i=r.length,a=new Array(i),n=0;ne?1:t>=e?0:NaN}l(Af,"ascending");function Lf(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}l(Lf,"default");function Ff(){return Array.from(this)}l(Ff,"default");function Ef(){for(var t=this._groups,e=0,r=t.length;e=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),Ed.hasOwnProperty(e)?{space:Ed[e],local:t}:t}l(xn,"default");function Rf(t){return function(){this.removeAttribute(t)}}l(Rf,"attrRemove");function Nf(t){return function(){this.removeAttributeNS(t.space,t.local)}}l(Nf,"attrRemoveNS");function Pf(t,e){return function(){this.setAttribute(t,e)}}l(Pf,"attrConstant");function zf(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}l(zf,"attrConstantNS");function qf(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}l(qf,"attrFunction");function jf(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)}}l(jf,"attrFunctionNS");function Wf(t,e){var r=xn(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?Nf:Rf:typeof e=="function"?r.local?jf:qf:r.local?zf:Pf)(r,e))}l(Wf,"default");function lc(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}l(lc,"default");function Hf(t){return function(){this.style.removeProperty(t)}}l(Hf,"styleRemove");function Uf(t,e,r){return function(){this.style.setProperty(t,e,r)}}l(Uf,"styleConstant");function Yf(t,e,r){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,r)}}l(Yf,"styleFunction");function Vf(t,e,r){return arguments.length>1?this.each((e==null?Hf:typeof e=="function"?Yf:Uf)(t,e,r??"")):Fr(this.node(),t)}l(Vf,"default");function Fr(t,e){return t.style.getPropertyValue(e)||lc(t).getComputedStyle(t,null).getPropertyValue(e)}l(Fr,"styleValue");function Gf(t){return function(){delete this[t]}}l(Gf,"propertyRemove");function Xf(t,e){return function(){this[t]=e}}l(Xf,"propertyConstant");function Zf(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}l(Zf,"propertyFunction");function Qf(t,e){return arguments.length>1?this.each((e==null?Gf:typeof e=="function"?Zf:Xf)(t,e)):this.node()[t]}l(Qf,"default");function hc(t){return t.trim().split(/^|\s+/)}l(hc,"classArray");function ps(t){return t.classList||new cc(t)}l(ps,"classList");function cc(t){this._node=t,this._names=hc(t.getAttribute("class")||"")}l(cc,"ClassList");cc.prototype={add:l(function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:l(function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:l(function(t){return this._names.indexOf(t)>=0},"contains")};function uc(t,e){for(var r=ps(t),i=-1,a=e.length;++i=0&&(r=e.slice(i+1),e=e.slice(0,i)),{type:e,name:r}})}l(Sg,"parseTypenames");function Tg(t){return function(){var e=this.__on;if(e){for(var r=0,i=-1,a=e.length,n;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?xa(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?xa(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=A_.exec(t))?new jt(e[1],e[2],e[3],1):(e=L_.exec(t))?new jt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=F_.exec(t))?xa(e[1],e[2],e[3],e[4]):(e=E_.exec(t))?xa(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=O_.exec(t))?Al(e[1],e[2]/100,e[3]/100,1):(e=D_.exec(t))?Al(e[1],e[2]/100,e[3]/100,e[4]):Od.hasOwnProperty(t)?Tl(Od[t]):t==="transparent"?new jt(NaN,NaN,NaN,0):null}l(lr,"color");function Tl(t){return new jt(t>>16&255,t>>8&255,t&255,1)}l(Tl,"rgbn");function xa(t,e,r,i){return i<=0&&(t=e=r=NaN),new jt(t,e,r,i)}l(xa,"rgba");function mc(t){return t instanceof dr||(t=lr(t)),t?(t=t.rgb(),new jt(t.r,t.g,t.b,t.opacity)):new jt}l(mc,"rgbConvert");function Ga(t,e,r,i){return arguments.length===1?mc(t):new jt(t,e,r,i??1)}l(Ga,"rgb");function jt(t,e,r,i){this.r=+t,this.g=+e,this.b=+r,this.opacity=+i}l(jt,"Rgb");ra(jt,Ga,kn(dr,{brighter(t){return t=t==null?_o:Math.pow(_o,t),new jt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ya:Math.pow(Ya,t),new jt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new jt(ar(this.r),ar(this.g),ar(this.b),Xa(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:Ml,formatHex:Ml,formatHex8:Ng,formatRgb:Bl,toString:Bl}));function Ml(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}l(Ml,"rgb_formatHex");function Ng(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity)?1:this.opacity)*255)}`}l(Ng,"rgb_formatHex8");function Bl(){let t=Xa(this.opacity);return`${t===1?"rgb(":"rgba("}${ar(this.r)}, ${ar(this.g)}, ${ar(this.b)}${t===1?")":`, ${t})`}`}l(Bl,"rgb_formatRgb");function Xa(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}l(Xa,"clampa");function ar(t){return Math.max(0,Math.min(255,Math.round(t)||0))}l(ar,"clampi");function ir(t){return t=ar(t),(t<16?"0":"")+t.toString(16)}l(ir,"hex");function Al(t,e,r,i){return i<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new de(t,e,r,i)}l(Al,"hsla");function yc(t){if(t instanceof de)return new de(t.h,t.s,t.l,t.opacity);if(t instanceof dr||(t=lr(t)),!t)return new de;if(t instanceof de)return t;t=t.rgb();var e=t.r/255,r=t.g/255,i=t.b/255,a=Math.min(e,r,i),n=Math.max(e,r,i),s=NaN,o=n-a,c=(n+a)/2;return o?(e===n?s=(r-i)/o+(r0&&c<1?0:s,new de(s,o,c,t.opacity)}l(yc,"hslConvert");function Pg(t,e,r,i){return arguments.length===1?yc(t):new de(t,e,r,i??1)}l(Pg,"hsl");function de(t,e,r,i){this.h=+t,this.s=+e,this.l=+r,this.opacity=+i}l(de,"Hsl");ra(de,Pg,kn(dr,{brighter(t){return t=t==null?_o:Math.pow(_o,t),new de(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ya:Math.pow(Ya,t),new de(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,a=2*r-i;return new jt(Jn(t>=240?t-240:t+120,a,i),Jn(t,a,i),Jn(t<120?t+240:t-120,a,i),this.opacity)},clamp(){return new de(Ll(this.h),ba(this.s),ba(this.l),Xa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=Xa(this.opacity);return`${t===1?"hsl(":"hsla("}${Ll(this.h)}, ${ba(this.s)*100}%, ${ba(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ll(t){return t=(t||0)%360,t<0?t+360:t}l(Ll,"clamph");function ba(t){return Math.max(0,Math.min(1,t||0))}l(ba,"clampt");function Jn(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}l(Jn,"hsl2rgb");var I_=Math.PI/180,R_=180/Math.PI,vo=18,zg=.96422,qg=1,jg=.82521,Wg=4/29,yi=6/29,Hg=3*yi*yi,N_=yi*yi*yi;function xc(t){if(t instanceof $e)return new $e(t.l,t.a,t.b,t.opacity);if(t instanceof Ee)return bc(t);t instanceof jt||(t=mc(t));var e=ro(t.r),r=ro(t.g),i=ro(t.b),a=Kn((.2225045*e+.7168786*r+.0606169*i)/qg),n,s;return e===r&&r===i?n=s=a:(n=Kn((.4360747*e+.3850649*r+.1430804*i)/zg),s=Kn((.0139322*e+.0971045*r+.7141733*i)/jg)),new $e(116*a-16,500*(n-a),200*(a-s),t.opacity)}l(xc,"labConvert");function Ug(t,e,r,i){return arguments.length===1?xc(t):new $e(t,e,r,i??1)}l(Ug,"lab");function $e(t,e,r,i){this.l=+t,this.a=+e,this.b=+r,this.opacity=+i}l($e,"Lab");ra($e,Ug,kn(dr,{brighter(t){return new $e(this.l+vo*(t??1),this.a,this.b,this.opacity)},darker(t){return new $e(this.l-vo*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=zg*to(e),t=qg*to(t),r=jg*to(r),new jt(eo(3.1338561*e-1.6168667*t-.4906146*r),eo(-.9787684*e+1.9161415*t+.033454*r),eo(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function Kn(t){return t>N_?Math.pow(t,1/3):t/Hg+Wg}l(Kn,"xyz2lab");function to(t){return t>yi?t*t*t:Hg*(t-Wg)}l(to,"lab2xyz");function eo(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}l(eo,"lrgb2rgb");function ro(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}l(ro,"rgb2lrgb");function Yg(t){if(t instanceof Ee)return new Ee(t.h,t.c,t.l,t.opacity);if(t instanceof $e||(t=xc(t)),t.a===0&&t.b===0)return new Ee(NaN,0()=>t,"default");function kc(t,e){return function(r){return t+r*e}}l(kc,"linear");function Vg(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)}}l(Vg,"exponential");function Gg(t,e){var r=e-t;return r?kc(t,r>180||r<-180?r-360*Math.round(r/360):r):fs(isNaN(t)?e:t)}l(Gg,"hue");function Xg(t){return(t=+t)==1?xi:function(e,r){return r-e?Vg(e,r,t):fs(isNaN(e)?r:e)}}l(Xg,"gamma");function xi(t,e){var r=e-t;return r?kc(t,r):fs(isNaN(t)?e:t)}l(xi,"nogamma");function Zg(t){return function(e,r){var i=t((e=So(e)).h,(r=So(r)).h),a=xi(e.c,r.c),n=xi(e.l,r.l),s=xi(e.opacity,r.opacity);return function(o){return e.h=i(o),e.c=a(o),e.l=n(o),e.opacity=s(o),e+""}}}l(Zg,"hcl");var eE=Zg(Gg);function Cc(t,e,r,i,a){var n=t*t,s=n*t;return((1-3*t+3*n-s)*e+(4-6*n+3*s)*r+(1+3*t+3*n-3*s)*i+s*a)/6}l(Cc,"basis");function P_(t){var e=t.length-1;return function(r){var i=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),a=t[i],n=t[i+1],s=i>0?t[i-1]:2*a-n,o=ir&&(n=e.slice(r,n),o[s]?o[s]+=n:o[++s]=n),(i=i[0])===(a=a[0])?o[s]?o[s]+=a:o[++s]=a:(o[++s]=null,c.push({i:s,x:ue(i,a)})),r=ol.lastIndex;return r180?u+=360:u-h>180&&(h+=360),p.push({i:d.push(a(d)+"rotate(",null,i)-2,x:ue(h,u)})):u&&d.push(a(d)+"rotate("+u+i)}l(s,"rotate");function o(h,u,d,p){h!==u?p.push({i:d.push(a(d)+"skewX(",null,i)-2,x:ue(h,u)}):u&&d.push(a(d)+"skewX("+u+i)}l(o,"skewX");function c(h,u,d,p,f,g){if(h!==d||u!==p){var m=f.push(a(f)+"scale(",null,",",null,")");g.push({i:m-4,x:ue(h,d)},{i:m-2,x:ue(u,p)})}else(d!==1||p!==1)&&f.push(a(f)+"scale("+d+","+p+")")}return l(c,"scale"),function(h,u){var d=[],p=[];return h=t(h),u=t(u),n(h.translateX,h.translateY,u.translateX,u.translateY,d,p),s(h.rotate,u.rotate,d,p),o(h.skewX,u.skewX,d,p),c(h.scaleX,h.scaleY,u.scaleX,u.scaleY,d,p),h=u=null,function(f){for(var g=-1,m=p.length,y;++g=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}l(sm,"default");function Za(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,i=t.slice(0,r);return[i.length>1?i[0]+i.slice(2):i,+t.slice(r+1)]}l(Za,"formatDecimalParts");function Er(t){return t=Za(Math.abs(t)),t?t[1]:NaN}l(Er,"default");function lm(t,e){return function(r,i){for(var a=r.length,n=[],s=0,o=t[0],c=0;a>0&&o>0&&(c+o+1>i&&(o=Math.max(1,i-c)),n.push(r.substring(a-=o,a+o)),!((c+=o+1)>i));)o=t[s=(s+1)%t.length];return n.reverse().join(e)}}l(lm,"default");function hm(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}l(hm,"default");var H_=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Qa(t){if(!(e=H_.exec(t)))throw new Error("invalid format: "+t);var e;return new ms({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}l(Qa,"formatSpecifier");Qa.prototype=ms.prototype;function ms(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}l(ms,"FormatSpecifier");ms.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function cm(t){t:for(var e=t.length,r=1,i=-1,a;r0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(a+1):t}l(cm,"default");var um;function dm(t,e){var r=Za(t,e);if(!r)return t+"";var i=r[0],a=r[1],n=a-(um=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=i.length;return n===s?i:n>s?i+new Array(n-s+1).join("0"):n>0?i.slice(0,n)+"."+i.slice(n):"0."+new Array(1-n).join("0")+Za(t,Math.max(0,e+n-1))[0]}l(dm,"default");function Ol(t,e){var r=Za(t,e);if(!r)return t+"";var i=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}l(Ol,"default");var Id={"%":l((t,e)=>(t*100).toFixed(e),"%"),b:l(t=>Math.round(t).toString(2),"b"),c:l(t=>t+"","c"),d:sm,e:l((t,e)=>t.toExponential(e),"e"),f:l((t,e)=>t.toFixed(e),"f"),g:l((t,e)=>t.toPrecision(e),"g"),o:l(t=>Math.round(t).toString(8),"o"),p:l((t,e)=>Ol(t*100,e),"p"),r:Ol,s:dm,X:l(t=>Math.round(t).toString(16).toUpperCase(),"X"),x:l(t=>Math.round(t).toString(16),"x")};function Dl(t){return t}l(Dl,"default");var Rd=Array.prototype.map,Nd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function pm(t){var e=t.grouping===void 0||t.thousands===void 0?Dl:lm(Rd.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",a=t.decimal===void 0?".":t.decimal+"",n=t.numerals===void 0?Dl:hm(Rd.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function h(d){d=Qa(d);var p=d.fill,f=d.align,g=d.sign,m=d.symbol,y=d.zero,x=d.width,b=d.comma,k=d.precision,_=d.trim,C=d.type;C==="n"?(b=!0,C="g"):Id[C]||(k===void 0&&(k=12),_=!0,C="g"),(y||p==="0"&&f==="=")&&(y=!0,p="0",f="=");var $=m==="$"?r:m==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",S=m==="$"?i:/[%p]/.test(C)?s:"",D=Id[C],N=/[defgprs%]/.test(C);k=k===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function I(T){var O=$,A=S,v,L,B;if(C==="c")A=D(T)+A,T="";else{T=+T;var E=T<0||1/T<0;if(T=isNaN(T)?c:D(Math.abs(T),k),_&&(T=cm(T)),E&&+T==0&&g!=="+"&&(E=!1),O=(E?g==="("?g:o:g==="-"||g==="("?"":g)+O,A=(C==="s"?Nd[8+um/3]:"")+A+(E&&g==="("?")":""),N){for(v=-1,L=T.length;++vB||B>57){A=(B===46?a+T.slice(v+1):T.slice(v))+A,T=T.slice(0,v);break}}}b&&!y&&(T=e(T,1/0));var F=O.length+T.length+A.length,z=F>1)+O+T+A+z.slice(F);break;default:T=z+O+T+A;break}return n(T)}return l(I,"format"),I.toString=function(){return d+""},I}l(h,"newFormat");function u(d,p){var f=h((d=Qa(d),d.type="f",d)),g=Math.max(-8,Math.min(8,Math.floor(Er(p)/3)))*3,m=Math.pow(10,-g),y=Nd[8+g/3];return function(x){return f(m*x)+y}}return l(u,"formatPrefix"),{format:h,formatPrefix:u}}l(pm,"default");var qn,fm,gm;mm({thousands:",",grouping:[3],currency:["$",""]});function mm(t){return qn=pm(t),fm=qn.format,gm=qn.formatPrefix,qn}l(mm,"defaultLocale");function ym(t){return Math.max(0,-Er(Math.abs(t)))}l(ym,"default");function xm(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Er(e)/3)))*3-Er(Math.abs(t)))}l(xm,"default");function bm(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Er(e)-Er(t))+1}l(bm,"default");function km(t){var e=0,r=t.children,i=r&&r.length;if(!i)e=1;else for(;--i>=0;)e+=r[i].value;t.value=e}l(km,"count");function Cm(){return this.eachAfter(km)}l(Cm,"default");function wm(t,e){let r=-1;for(let i of this)t.call(e,i,++r,this);return this}l(wm,"default");function $m(t,e){for(var r=this,i=[r],a,n,s=-1;r=i.pop();)if(t.call(e,r,++s,this),a=r.children)for(n=a.length-1;n>=0;--n)i.push(a[n]);return this}l($m,"default");function _m(t,e){for(var r=this,i=[r],a=[],n,s,o,c=-1;r=i.pop();)if(a.push(r),n=r.children)for(s=0,o=n.length;s=0;)r+=i[a].value;e.value=r})}l(Sm,"default");function Tm(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}l(Tm,"default");function Mm(t){for(var e=this,r=Bm(e,t),i=[e];e!==r;)e=e.parent,i.push(e);for(var a=i.length;t!==r;)i.splice(a,0,t),t=t.parent;return i}l(Mm,"default");function Bm(t,e){if(t===e)return t;var r=t.ancestors(),i=e.ancestors(),a=null;for(t=r.pop(),e=i.pop();t===e;)a=t,t=r.pop(),e=i.pop();return a}l(Bm,"leastCommonAncestor");function Am(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}l(Am,"default");function Lm(){return Array.from(this)}l(Lm,"default");function Fm(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}l(Fm,"default");function Em(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}l(Em,"default");function*Om(){var t=this,e,r=[t],i,a,n;do for(e=r.reverse(),r=[];t=e.pop();)if(yield t,i=t.children)for(a=0,n=i.length;a=0;--o)a.push(n=s[o]=new Ja(s[o])),n.parent=i,n.depth=i.depth+1;return r.eachBefore(Pm)}l(vc,"hierarchy");function Dm(){return vc(this).eachBefore(Nm)}l(Dm,"node_copy");function Im(t){return t.children}l(Im,"objectChildren");function Rm(t){return Array.isArray(t)?t[1]:null}l(Rm,"mapChildren");function Nm(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}l(Nm,"copyData");function Pm(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}l(Pm,"computeHeight");function Ja(t){this.data=t,this.depth=this.height=0,this.parent=null}l(Ja,"Node");Ja.prototype=vc.prototype={constructor:Ja,count:Cm,each:wm,eachAfter:_m,eachBefore:$m,find:vm,sum:Sm,sort:Tm,path:Mm,ancestors:Am,descendants:Lm,leaves:Fm,links:Em,copy:Dm,[Symbol.iterator]:Om};function zm(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}l(zm,"default");function qm(t,e,r,i,a){for(var n=t.children,s,o=-1,c=n.length,h=t.value&&(i-e)/t.value;++ob&&(b=h),$=y*y*C,k=Math.max(b/$,$/x),k>_){y-=h;break}_=k}s.push(c={value:y,dice:f1?i:1)},r}),"custom")(U_);function Hm(t){if(typeof t!="function")throw new Error;return t}l(Hm,"required");function ri(){return 0}l(ri,"constantZero");function ii(t){return function(){return t}}l(ii,"default");function V_(){var t=Y_,e=!1,r=1,i=1,a=[0],n=ri,s=ri,o=ri,c=ri,h=ri;function u(p){return p.x0=p.y0=0,p.x1=r,p.y1=i,p.eachBefore(d),a=[0],e&&p.eachBefore(zm),p}l(u,"treemap");function d(p){var f=a[p.depth],g=p.x0+f,m=p.y0+f,y=p.x1-f,x=p.y1-f;ye&&(r=t,t=e,e=r),function(i){return Math.max(t,Math.min(e,i))}}l(Vm,"clamper");function Gm(t,e,r){var i=t[0],a=t[1],n=e[0],s=e[1];return a2?Xm:Gm,c=h=null,d}l(u,"rescale");function d(p){return p==null||isNaN(p=+p)?n:(c||(c=o(t.map(i),e,r)))(i(s(p)))}return l(d,"scale"),d.invert=function(p){return s(a((h||(h=o(e,t.map(i),ue)))(p)))},d.domain=function(p){return arguments.length?(t=Array.from(p,Ym),u()):t.slice()},d.range=function(p){return arguments.length?(e=Array.from(p),u()):e.slice()},d.rangeRound=function(p){return e=Array.from(p),r=am,u()},d.clamp=function(p){return arguments.length?(s=p?!0:vr,u()):s!==vr},d.interpolate=function(p){return arguments.length?(r=p,u()):r},d.unknown=function(p){return arguments.length?(n=p,d):n},function(p,f){return i=p,a=f,u()}}l(Zm,"transformer");function Mc(){return Zm()(vr,vr)}l(Mc,"continuous");function Qm(t,e,r,i){var a=$o(t,e,r),n;switch(i=Qa(i??",f"),i.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(n=xm(a,s))&&(i.precision=n),gm(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(n=bm(a,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=n-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(n=ym(a))&&(i.precision=n-(i.type==="%")*2);break}}return fm(i)}l(Qm,"tickFormat");function Jm(t){var e=t.domain;return t.ticks=function(r){var i=e();return Zp(i[0],i[i.length-1],r??10)},t.tickFormat=function(r,i){var a=e();return Qm(a[0],a[a.length-1],r??10,i)},t.nice=function(r){r==null&&(r=10);var i=e(),a=0,n=i.length-1,s=i[a],o=i[n],c,h,u=10;for(o0;){if(h=wo(s,o,r),h===c)return i[a]=s,i[n]=o,e(i);if(h>0)s=Math.floor(s/h)*h,o=Math.ceil(o/h)*h;else if(h<0)s=Math.ceil(s*h)/h,o=Math.floor(o*h)/h;else break;c=h}return t},t}l(Jm,"linearish");function Km(){var t=Mc();return t.copy=function(){return Tc(t,Km())},Cn.apply(t,arguments),Jm(t)}l(Km,"linear");var sl=new Date,ll=new Date;function At(t,e,r,i){function a(n){return t(n=arguments.length===0?new Date:new Date(+n)),n}return l(a,"interval"),a.floor=n=>(t(n=new Date(+n)),n),a.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),a.round=n=>{let s=a(n),o=a.ceil(n);return n-s(e(n=new Date(+n),s==null?1:Math.floor(s)),n),a.range=(n,s,o)=>{let c=[];if(n=a.ceil(n),o=o==null?1:Math.floor(o),!(n0))return c;let h;do c.push(h=new Date(+n)),e(n,o),t(n);while(hAt(s=>{if(s>=s)for(;t(s),!n(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!n(s););else for(;--o>=0;)for(;e(s,1),!n(s););}),r&&(a.count=(n,s)=>(sl.setTime(+n),ll.setTime(+s),t(sl),t(ll),Math.floor(r(sl,ll))),a.every=n=>(n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?a.filter(i?s=>i(s)%n===0:s=>a.count(0,s)%n===0):a)),a}l(At,"timeInterval");var Bo=At(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Bo.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?At(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Bo);Bo.range;var pi=At(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds());pi.range;var Bc=At(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes());Bc.range;var ty=At(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes());ty.range;var Ac=At(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours());Ac.range;var ey=At(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours());ey.range;var wn=At(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1);wn.range;var Lc=At(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1);Lc.range;var ry=At(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5));ry.range;function pr(t){return At(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}l(pr,"timeWeekday");var ys=pr(0),Ao=pr(1),G_=pr(2),X_=pr(3),Yi=pr(4),Z_=pr(5),Q_=pr(6);ys.range;Ao.range;G_.range;X_.range;Yi.range;Z_.range;Q_.range;function fr(t){return At(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}l(fr,"utcWeekday");var Fc=fr(0),Lo=fr(1),J_=fr(2),K_=fr(3),Vi=fr(4),tv=fr(5),ev=fr(6);Fc.range;Lo.range;J_.range;K_.range;Vi.range;tv.range;ev.range;var Ec=At(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Ec.range;var iy=At(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());iy.range;var Xe=At(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Xe.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:At(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});Xe.range;var hr=At(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());hr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:At(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});hr.range;function Oc(t,e,r,i,a,n){let s=[[pi,1,1e3],[pi,5,5e3],[pi,15,15e3],[pi,30,3e4],[n,1,6e4],[n,5,3e5],[n,15,9e5],[n,30,18e5],[a,1,36e5],[a,3,108e5],[a,6,216e5],[a,12,432e5],[i,1,864e5],[i,2,1728e5],[r,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function o(h,u,d){let p=uy).right(s,p);if(f===s.length)return t.every($o(h/31536e6,u/31536e6,d));if(f===0)return Bo.every(Math.max($o(h,u,d),1));let[g,m]=s[p/s[f-1][2]53)return null;"w"in P||(P.w=1),"Z"in P?(ft=ao(ai(P.y,0,1)),Rt=ft.getUTCDay(),ft=Rt>4||Rt===0?Lo.ceil(ft):Lo(ft),ft=Lc.offset(ft,(P.V-1)*7),P.y=ft.getUTCFullYear(),P.m=ft.getUTCMonth(),P.d=ft.getUTCDate()+(P.w+6)%7):(ft=io(ai(P.y,0,1)),Rt=ft.getDay(),ft=Rt>4||Rt===0?Ao.ceil(ft):Ao(ft),ft=wn.offset(ft,(P.V-1)*7),P.y=ft.getFullYear(),P.m=ft.getMonth(),P.d=ft.getDate()+(P.w+6)%7)}else("W"in P||"U"in P)&&("w"in P||(P.w="u"in P?P.u%7:"W"in P?1:0),Rt="Z"in P?ao(ai(P.y,0,1)).getUTCDay():io(ai(P.y,0,1)).getDay(),P.m=0,P.d="W"in P?(P.w+6)%7+P.W*7-(Rt+5)%7:P.w+P.U*7-(Rt+6)%7);return"Z"in P?(P.H+=P.Z/100|0,P.M+=P.Z%100,ao(P)):io(P)}}l(S,"newParse");function D(q,rt,ht,P){for(var _t=0,ft=rt.length,Rt=ht.length,Nt,ae;_t=Rt)return-1;if(Nt=rt.charCodeAt(_t++),Nt===37){if(Nt=rt.charAt(_t++),ae=C[Nt in qd?rt.charAt(_t++):Nt],!ae||(P=ae(q,ht,P))<0)return-1}else if(Nt!=ht.charCodeAt(P++))return-1}return P}l(D,"parseSpecifier");function N(q,rt,ht){var P=h.exec(rt.slice(ht));return P?(q.p=u.get(P[0].toLowerCase()),ht+P[0].length):-1}l(N,"parsePeriod");function I(q,rt,ht){var P=f.exec(rt.slice(ht));return P?(q.w=g.get(P[0].toLowerCase()),ht+P[0].length):-1}l(I,"parseShortWeekday");function T(q,rt,ht){var P=d.exec(rt.slice(ht));return P?(q.w=p.get(P[0].toLowerCase()),ht+P[0].length):-1}l(T,"parseWeekday");function O(q,rt,ht){var P=x.exec(rt.slice(ht));return P?(q.m=b.get(P[0].toLowerCase()),ht+P[0].length):-1}l(O,"parseShortMonth");function A(q,rt,ht){var P=m.exec(rt.slice(ht));return P?(q.m=y.get(P[0].toLowerCase()),ht+P[0].length):-1}l(A,"parseMonth");function v(q,rt,ht){return D(q,e,rt,ht)}l(v,"parseLocaleDateTime");function L(q,rt,ht){return D(q,r,rt,ht)}l(L,"parseLocaleDate");function B(q,rt,ht){return D(q,i,rt,ht)}l(B,"parseLocaleTime");function E(q){return s[q.getDay()]}l(E,"formatShortWeekday");function F(q){return n[q.getDay()]}l(F,"formatWeekday");function z(q){return c[q.getMonth()]}l(z,"formatShortMonth");function Y(q){return o[q.getMonth()]}l(Y,"formatMonth");function V(q){return a[+(q.getHours()>=12)]}l(V,"formatPeriod");function X(q){return 1+~~(q.getMonth()/3)}l(X,"formatQuarter");function G(q){return s[q.getUTCDay()]}l(G,"formatUTCShortWeekday");function ct(q){return n[q.getUTCDay()]}l(ct,"formatUTCWeekday");function et(q){return c[q.getUTCMonth()]}l(et,"formatUTCShortMonth");function wt(q){return o[q.getUTCMonth()]}l(wt,"formatUTCMonth");function Ct(q){return a[+(q.getUTCHours()>=12)]}l(Ct,"formatUTCPeriod");function Ot(q){return 1+~~(q.getUTCMonth()/3)}return l(Ot,"formatUTCQuarter"),{format:l(function(q){var rt=$(q+="",k);return rt.toString=function(){return q},rt},"format"),parse:l(function(q){var rt=S(q+="",!1);return rt.toString=function(){return q},rt},"parse"),utcFormat:l(function(q){var rt=$(q+="",_);return rt.toString=function(){return q},rt},"utcFormat"),utcParse:l(function(q){var rt=S(q+="",!0);return rt.toString=function(){return q},rt},"utcParse")}}l(ay,"formatLocale");var qd={"-":"",_:" ",0:"0"},It=/^\s*\d+/,av=/^%/,nv=/[\\^$*+?|[\]().{}]/g;function gt(t,e,r){var i=t<0?"-":"",a=(i?-t:t)+"",n=a.length;return i+(n[e.toLowerCase(),r]))}l(oi,"formatLookup");function oy(t,e,r){var i=It.exec(e.slice(r,r+1));return i?(t.w=+i[0],r+i[0].length):-1}l(oy,"parseWeekdayNumberSunday");function sy(t,e,r){var i=It.exec(e.slice(r,r+1));return i?(t.u=+i[0],r+i[0].length):-1}l(sy,"parseWeekdayNumberMonday");function ly(t,e,r){var i=It.exec(e.slice(r,r+2));return i?(t.U=+i[0],r+i[0].length):-1}l(ly,"parseWeekNumberSunday");function hy(t,e,r){var i=It.exec(e.slice(r,r+2));return i?(t.V=+i[0],r+i[0].length):-1}l(hy,"parseWeekNumberISO");function cy(t,e,r){var i=It.exec(e.slice(r,r+2));return i?(t.W=+i[0],r+i[0].length):-1}l(cy,"parseWeekNumberMonday");function Il(t,e,r){var i=It.exec(e.slice(r,r+4));return i?(t.y=+i[0],r+i[0].length):-1}l(Il,"parseFullYear");function Rl(t,e,r){var i=It.exec(e.slice(r,r+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),r+i[0].length):-1}l(Rl,"parseYear");function uy(t,e,r){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),r+i[0].length):-1}l(uy,"parseZone");function dy(t,e,r){var i=It.exec(e.slice(r,r+1));return i?(t.q=i[0]*3-3,r+i[0].length):-1}l(dy,"parseQuarter");function py(t,e,r){var i=It.exec(e.slice(r,r+2));return i?(t.m=i[0]-1,r+i[0].length):-1}l(py,"parseMonthNumber");function Nl(t,e,r){var i=It.exec(e.slice(r,r+2));return i?(t.d=+i[0],r+i[0].length):-1}l(Nl,"parseDayOfMonth");function fy(t,e,r){var i=It.exec(e.slice(r,r+3));return i?(t.m=0,t.d=+i[0],r+i[0].length):-1}l(fy,"parseDayOfYear");function Pl(t,e,r){var i=It.exec(e.slice(r,r+2));return i?(t.H=+i[0],r+i[0].length):-1}l(Pl,"parseHour24");function gy(t,e,r){var i=It.exec(e.slice(r,r+2));return i?(t.M=+i[0],r+i[0].length):-1}l(gy,"parseMinutes");function my(t,e,r){var i=It.exec(e.slice(r,r+2));return i?(t.S=+i[0],r+i[0].length):-1}l(my,"parseSeconds");function yy(t,e,r){var i=It.exec(e.slice(r,r+3));return i?(t.L=+i[0],r+i[0].length):-1}l(yy,"parseMilliseconds");function xy(t,e,r){var i=It.exec(e.slice(r,r+6));return i?(t.L=Math.floor(i[0]/1e3),r+i[0].length):-1}l(xy,"parseMicroseconds");function by(t,e,r){var i=av.exec(e.slice(r,r+1));return i?r+i[0].length:-1}l(by,"parseLiteralPercent");function ky(t,e,r){var i=It.exec(e.slice(r));return i?(t.Q=+i[0],r+i[0].length):-1}l(ky,"parseUnixTimestamp");function Cy(t,e,r){var i=It.exec(e.slice(r));return i?(t.s=+i[0],r+i[0].length):-1}l(Cy,"parseUnixTimestampSeconds");function zl(t,e){return gt(t.getDate(),e,2)}l(zl,"formatDayOfMonth");function wy(t,e){return gt(t.getHours(),e,2)}l(wy,"formatHour24");function $y(t,e){return gt(t.getHours()%12||12,e,2)}l($y,"formatHour12");function _y(t,e){return gt(1+wn.count(Xe(t),t),e,3)}l(_y,"formatDayOfYear");function Dc(t,e){return gt(t.getMilliseconds(),e,3)}l(Dc,"formatMilliseconds");function vy(t,e){return Dc(t,e)+"000"}l(vy,"formatMicroseconds");function Sy(t,e){return gt(t.getMonth()+1,e,2)}l(Sy,"formatMonthNumber");function Ty(t,e){return gt(t.getMinutes(),e,2)}l(Ty,"formatMinutes");function My(t,e){return gt(t.getSeconds(),e,2)}l(My,"formatSeconds");function By(t){var e=t.getDay();return e===0?7:e}l(By,"formatWeekdayNumberMonday");function Ay(t,e){return gt(ys.count(Xe(t)-1,t),e,2)}l(Ay,"formatWeekNumberSunday");function Ic(t){var e=t.getDay();return e>=4||e===0?Yi(t):Yi.ceil(t)}l(Ic,"dISO");function Ly(t,e){return t=Ic(t),gt(Yi.count(Xe(t),t)+(Xe(t).getDay()===4),e,2)}l(Ly,"formatWeekNumberISO");function Fy(t){return t.getDay()}l(Fy,"formatWeekdayNumberSunday");function Ey(t,e){return gt(Ao.count(Xe(t)-1,t),e,2)}l(Ey,"formatWeekNumberMonday");function Oy(t,e){return gt(t.getFullYear()%100,e,2)}l(Oy,"formatYear");function Dy(t,e){return t=Ic(t),gt(t.getFullYear()%100,e,2)}l(Dy,"formatYearISO");function Iy(t,e){return gt(t.getFullYear()%1e4,e,4)}l(Iy,"formatFullYear");function Ry(t,e){var r=t.getDay();return t=r>=4||r===0?Yi(t):Yi.ceil(t),gt(t.getFullYear()%1e4,e,4)}l(Ry,"formatFullYearISO");function Ny(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+gt(e/60|0,"0",2)+gt(e%60,"0",2)}l(Ny,"formatZone");function ql(t,e){return gt(t.getUTCDate(),e,2)}l(ql,"formatUTCDayOfMonth");function Py(t,e){return gt(t.getUTCHours(),e,2)}l(Py,"formatUTCHour24");function zy(t,e){return gt(t.getUTCHours()%12||12,e,2)}l(zy,"formatUTCHour12");function qy(t,e){return gt(1+Lc.count(hr(t),t),e,3)}l(qy,"formatUTCDayOfYear");function Rc(t,e){return gt(t.getUTCMilliseconds(),e,3)}l(Rc,"formatUTCMilliseconds");function jy(t,e){return Rc(t,e)+"000"}l(jy,"formatUTCMicroseconds");function Wy(t,e){return gt(t.getUTCMonth()+1,e,2)}l(Wy,"formatUTCMonthNumber");function Hy(t,e){return gt(t.getUTCMinutes(),e,2)}l(Hy,"formatUTCMinutes");function Uy(t,e){return gt(t.getUTCSeconds(),e,2)}l(Uy,"formatUTCSeconds");function Yy(t){var e=t.getUTCDay();return e===0?7:e}l(Yy,"formatUTCWeekdayNumberMonday");function Vy(t,e){return gt(Fc.count(hr(t)-1,t),e,2)}l(Vy,"formatUTCWeekNumberSunday");function Nc(t){var e=t.getUTCDay();return e>=4||e===0?Vi(t):Vi.ceil(t)}l(Nc,"UTCdISO");function Gy(t,e){return t=Nc(t),gt(Vi.count(hr(t),t)+(hr(t).getUTCDay()===4),e,2)}l(Gy,"formatUTCWeekNumberISO");function Xy(t){return t.getUTCDay()}l(Xy,"formatUTCWeekdayNumberSunday");function Zy(t,e){return gt(Lo.count(hr(t)-1,t),e,2)}l(Zy,"formatUTCWeekNumberMonday");function Qy(t,e){return gt(t.getUTCFullYear()%100,e,2)}l(Qy,"formatUTCYear");function Jy(t,e){return t=Nc(t),gt(t.getUTCFullYear()%100,e,2)}l(Jy,"formatUTCYearISO");function Ky(t,e){return gt(t.getUTCFullYear()%1e4,e,4)}l(Ky,"formatUTCFullYear");function t0(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Vi(t):Vi.ceil(t),gt(t.getUTCFullYear()%1e4,e,4)}l(t0,"formatUTCFullYearISO");function e0(){return"+0000"}l(e0,"formatUTCZone");function jl(){return"%"}l(jl,"formatLiteralPercent");function Wl(t){return+t}l(Wl,"formatUnixTimestamp");function Hl(t){return Math.floor(+t/1e3)}l(Hl,"formatUnixTimestampSeconds");var ei,r0;i0({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function i0(t){return ei=ay(t),r0=ei.format,ei.parse,ei.utcFormat,ei.utcParse,ei}l(i0,"defaultLocale");function a0(t,e){t=t.slice();var r=0,i=t.length-1,a=t[r],n=t[i],s;return n1?0:t<-1?Ka:Math.acos(t)}l(h0,"acos");function Ul(t){return t>=1?Fo:t<=-1?-Fo:Math.asin(t)}l(Ul,"asin");var Yl=Math.PI,Vl=2*Yl,wr=1e-6,lv=Vl-wr;function zc(t){this._+=t[0];for(let e=1,r=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return zc;let r=10**e;return function(i){this._+=i[0];for(let a=1,n=i.length;awr)if(!(Math.abs(d*c-h*u)>wr)||!n)this._append`L${this._x1=e},${this._y1=r}`;else{let f=i-s,g=a-o,m=c*c+h*h,y=f*f+g*g,x=Math.sqrt(m),b=Math.sqrt(p),k=n*Math.tan((Yl-Math.acos((m+p-y)/(2*x*b)))/2),_=k/b,C=k/x;Math.abs(_-1)>wr&&this._append`L${e+_*u},${r+_*d}`,this._append`A${n},${n},0,0,${+(d*f>u*g)},${this._x1=e+C*c},${this._y1=r+C*h}`}}arc(e,r,i,a,n,s){if(e=+e,r=+r,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(a),c=i*Math.sin(a),h=e+o,u=r+c,d=1^s,p=s?a-n:n-a;this._x1===null?this._append`M${h},${u}`:(Math.abs(this._x1-h)>wr||Math.abs(this._y1-u)>wr)&&this._append`L${h},${u}`,i&&(p<0&&(p=p%Vl+Vl),p>lv?this._append`A${i},${i},0,1,${d},${e-o},${r-c}A${i},${i},0,1,${d},${this._x1=h},${this._y1=u}`:p>wr&&this._append`A${i},${i},0,${+(p>=Yl)},${d},${this._x1=e+i*Math.cos(n)},${this._y1=r+i*Math.sin(n)}`)}rect(e,r,i,a){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${i=+i}v${+a}h${-i}Z`}toString(){return this._}},l(ki,"Path"),ki);function u0(){return new qc}l(u0,"path");u0.prototype=qc.prototype;function jc(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{let i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);e=i}return t},()=>new qc(e)}l(jc,"withPath");function d0(t){return t.innerRadius}l(d0,"arcInnerRadius");function p0(t){return t.outerRadius}l(p0,"arcOuterRadius");function f0(t){return t.startAngle}l(f0,"arcStartAngle");function g0(t){return t.endAngle}l(g0,"arcEndAngle");function m0(t){return t&&t.padAngle}l(m0,"arcPadAngle");function y0(t,e,r,i,a,n,s,o){var c=r-t,h=i-e,u=s-a,d=o-n,p=d*c-u*h;if(!(p*pv*v+L*L&&(D=I,N=T),{cx:D,cy:N,x01:-u,y01:-d,x11:D*(a/C-1),y11:N*(a/C-1)}}l(ka,"cornerTangents");function hv(){var t=d0,e=p0,r=Tt(0),i=null,a=f0,n=g0,s=m0,o=null,c=jc(h);function h(){var u,d,p=+t.apply(this,arguments),f=+e.apply(this,arguments),g=a.apply(this,arguments)-Fo,m=n.apply(this,arguments)-Fo,y=jd(m-g),x=m>g;if(o||(o=u=c()),fUt))o.moveTo(0,0);else if(y>no-Ut)o.moveTo(f*kr(g),f*Be(g)),o.arc(0,0,f,g,m,!x),p>Ut&&(o.moveTo(p*kr(m),p*Be(m)),o.arc(0,0,p,m,g,x));else{var b=g,k=m,_=g,C=m,$=y,S=y,D=s.apply(this,arguments)/2,N=D>Ut&&(i?+i.apply(this,arguments):fi(p*p+f*f)),I=hl(jd(f-p)/2,+r.apply(this,arguments)),T=I,O=I,A,v;if(N>Ut){var L=Ul(N/p*Be(D)),B=Ul(N/f*Be(D));($-=L*2)>Ut?(L*=x?1:-1,_+=L,C-=L):($=0,_=C=(g+m)/2),(S-=B*2)>Ut?(B*=x?1:-1,b+=B,k-=B):(S=0,b=k=(g+m)/2)}var E=f*kr(b),F=f*Be(b),z=p*kr(C),Y=p*Be(C);if(I>Ut){var V=f*kr(k),X=f*Be(k),G=p*kr(_),ct=p*Be(_),et;if(yUt?O>Ut?(A=ka(G,ct,E,F,f,O,x),v=ka(V,X,z,Y,f,O,x),o.moveTo(A.cx+A.x01,A.cy+A.y01),OUt)||!($>Ut)?o.lineTo(z,Y):T>Ut?(A=ka(z,Y,V,X,p,-T,x),v=ka(E,F,G,ct,p,-T,x),o.lineTo(A.cx+A.x01,A.cy+A.y01),Tt?1:e>=t?0:NaN}l(C0,"default");function w0(t){return t}l(w0,"default");function cv(){var t=w0,e=C0,r=null,i=Tt(0),a=Tt(no),n=Tt(0);function s(o){var c,h=(o=Hc(o)).length,u,d,p=0,f=new Array(h),g=new Array(h),m=+i.apply(this,arguments),y=Math.min(no,Math.max(-no,a.apply(this,arguments)-m)),x,b=Math.min(Math.abs(y)/h,n.apply(this,arguments)),k=b*(y<0?-1:1),_;for(c=0;c0&&(p+=_);for(e!=null?f.sort(function(C,$){return e(g[C],g[$])}):r!=null&&f.sort(function(C,$){return r(o[C],o[$])}),c=0,d=p?(y-h*k)/p:0;c0?_*d:0)+k,g[u]={data:o[u],index:c,value:_,startAngle:m,endAngle:x,padAngle:b};return g}return l(s,"pie"),s.value=function(o){return arguments.length?(t=typeof o=="function"?o:Tt(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,r=null,s):e},s.sort=function(o){return arguments.length?(r=o,e=null,s):r},s.startAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Tt(+o),s):i},s.endAngle=function(o){return arguments.length?(a=typeof o=="function"?o:Tt(+o),s):a},s.padAngle=function(o){return arguments.length?(n=typeof o=="function"?o:Tt(+o),s):n},s}l(cv,"default");var Ci,$0=(Ci=class{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}},l(Ci,"Bump"),Ci);function Uc(t){return new $0(t,!0)}l(Uc,"bumpX");function Yc(t){return new $0(t,!1)}l(Yc,"bumpY");function en(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)}l(en,"point");function $n(t){this._context=t}l($n,"Basis");$n.prototype={areaStart:l(function(){this._line=0},"areaStart"),areaEnd:l(function(){this._line=NaN},"areaEnd"),lineStart:l(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:l(function(){switch(this._point){case 3:en(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},"lineEnd"),point:l(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:en(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")};function La(t){return new $n(t)}l(La,"default");function Ze(){}l(Ze,"default");function Vc(t){this._context=t}l(Vc,"BasisClosed");Vc.prototype={areaStart:Ze,areaEnd:Ze,lineStart:l(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},"lineStart"),lineEnd:l(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}}},"lineEnd"),point:l(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:en(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")};function _0(t){return new Vc(t)}l(_0,"default");function Gc(t){this._context=t}l(Gc,"BasisOpen");Gc.prototype={areaStart:l(function(){this._line=0},"areaStart"),areaEnd:l(function(){this._line=NaN},"areaEnd"),lineStart:l(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:l(function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:l(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:en(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")};function v0(t){return new Gc(t)}l(v0,"default");function Xc(t,e){this._basis=new $n(t),this._beta=e}l(Xc,"Bundle");Xc.prototype={lineStart:l(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:l(function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var i=t[0],a=e[0],n=t[r]-i,s=e[r]-a,o=-1,c;++o<=r;)c=o/r,this._basis.point(this._beta*t[o]+(1-this._beta)*(i+c*n),this._beta*e[o]+(1-this._beta)*(a+c*s));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:l(function(t,e){this._x.push(+t),this._y.push(+e)},"point")};var uv=l((function t(e){function r(i){return e===1?new $n(i):new Xc(i,e)}return l(r,"bundle"),r.beta=function(i){return t(+i)},r}),"custom")(.85);function rn(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)}l(rn,"point");function xs(t,e){this._context=t,this._k=(1-e)/6}l(xs,"Cardinal");xs.prototype={areaStart:l(function(){this._line=0},"areaStart"),areaEnd:l(function(){this._line=NaN},"areaEnd"),lineStart:l(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:l(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:rn(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:l(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:rn(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},"point")};var S0=l((function t(e){function r(i){return new xs(i,e)}return l(r,"cardinal"),r.tension=function(i){return t(+i)},r}),"custom")(0);function bs(t,e){this._context=t,this._k=(1-e)/6}l(bs,"CardinalClosed");bs.prototype={areaStart:Ze,areaEnd:Ze,lineStart:l(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},"lineStart"),lineEnd:l(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}}},"lineEnd"),point:l(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:rn(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},"point")};var dv=l((function t(e){function r(i){return new bs(i,e)}return l(r,"cardinal"),r.tension=function(i){return t(+i)},r}),"custom")(0);function ks(t,e){this._context=t,this._k=(1-e)/6}l(ks,"CardinalOpen");ks.prototype={areaStart:l(function(){this._line=0},"areaStart"),areaEnd:l(function(){this._line=NaN},"areaEnd"),lineStart:l(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:l(function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:l(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:rn(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},"point")};var pv=l((function t(e){function r(i){return new ks(i,e)}return l(r,"cardinal"),r.tension=function(i){return t(+i)},r}),"custom")(0);function Cs(t,e,r){var i=t._x1,a=t._y1,n=t._x2,s=t._y2;if(t._l01_a>Ut){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,a=(a*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Ut){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);n=(n*h+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*h+t._y1*t._l23_2a-r*t._l12_2a)/u}t._context.bezierCurveTo(i,a,n,s,t._x2,t._y2)}l(Cs,"point");function Zc(t,e){this._context=t,this._alpha=e}l(Zc,"CatmullRom");Zc.prototype={areaStart:l(function(){this._line=0},"areaStart"),areaEnd:l(function(){this._line=NaN},"areaEnd"),lineStart:l(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},"lineStart"),lineEnd:l(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},"lineEnd"),point:l(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:Cs(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},"point")};var T0=l((function t(e){function r(i){return e?new Zc(i,e):new xs(i,0)}return l(r,"catmullRom"),r.alpha=function(i){return t(+i)},r}),"custom")(.5);function Qc(t,e){this._context=t,this._alpha=e}l(Qc,"CatmullRomClosed");Qc.prototype={areaStart:Ze,areaEnd:Ze,lineStart:l(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},"lineStart"),lineEnd:l(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}}},"lineEnd"),point:l(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:Cs(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},"point")};var fv=l((function t(e){function r(i){return e?new Qc(i,e):new bs(i,0)}return l(r,"catmullRom"),r.alpha=function(i){return t(+i)},r}),"custom")(.5);function Jc(t,e){this._context=t,this._alpha=e}l(Jc,"CatmullRomOpen");Jc.prototype={areaStart:l(function(){this._line=0},"areaStart"),areaEnd:l(function(){this._line=NaN},"areaEnd"),lineStart:l(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},"lineStart"),lineEnd:l(function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:l(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:Cs(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},"point")};var gv=l((function t(e){function r(i){return e?new Jc(i,e):new ks(i,0)}return l(r,"catmullRom"),r.alpha=function(i){return t(+i)},r}),"custom")(.5);function Kc(t){this._context=t}l(Kc,"LinearClosed");Kc.prototype={areaStart:Ze,areaEnd:Ze,lineStart:l(function(){this._point=0},"lineStart"),lineEnd:l(function(){this._point&&this._context.closePath()},"lineEnd"),point:l(function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))},"point")};function M0(t){return new Kc(t)}l(M0,"default");function Gl(t){return t<0?-1:1}l(Gl,"sign");function Xl(t,e,r){var i=t._x1-t._x0,a=e-t._x1,n=(t._y1-t._y0)/(i||a<0&&-0),s=(r-t._y1)/(a||i<0&&-0),o=(n*a+s*i)/(i+a);return(Gl(n)+Gl(s))*Math.min(Math.abs(n),Math.abs(s),.5*Math.abs(o))||0}l(Xl,"slope3");function Zl(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}l(Zl,"slope2");function oo(t,e,r){var i=t._x0,a=t._y0,n=t._x1,s=t._y1,o=(n-i)/3;t._context.bezierCurveTo(i+o,a+o*e,n-o,s-o*r,n,s)}l(oo,"point");function an(t){this._context=t}l(an,"MonotoneX");an.prototype={areaStart:l(function(){this._line=0},"areaStart"),areaEnd:l(function(){this._line=NaN},"areaEnd"),lineStart:l(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:l(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:oo(this,this._t0,Zl(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:l(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,oo(this,Zl(this,r=Xl(this,t,e)),r);break;default:oo(this,this._t0,r=Xl(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}},"point")};function tu(t){this._context=new eu(t)}l(tu,"MonotoneY");(tu.prototype=Object.create(an.prototype)).point=function(t,e){an.prototype.point.call(this,e,t)};function eu(t){this._context=t}l(eu,"ReflectContext");eu.prototype={moveTo:l(function(t,e){this._context.moveTo(e,t)},"moveTo"),closePath:l(function(){this._context.closePath()},"closePath"),lineTo:l(function(t,e){this._context.lineTo(e,t)},"lineTo"),bezierCurveTo:l(function(t,e,r,i,a,n){this._context.bezierCurveTo(e,t,i,r,n,a)},"bezierCurveTo")};function ru(t){return new an(t)}l(ru,"monotoneX");function iu(t){return new tu(t)}l(iu,"monotoneY");function au(t){this._context=t}l(au,"Natural");au.prototype={areaStart:l(function(){this._line=0},"areaStart"),areaEnd:l(function(){this._line=NaN},"areaEnd"),lineStart:l(function(){this._x=[],this._y=[]},"lineStart"),lineEnd:l(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=Ql(t),a=Ql(e),n=0,s=1;s=0;--e)a[e]=(s[e]-a[e+1])/n[e];for(n[r-1]=(t[r]+a[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},"lineEnd"),point:l(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},"point")};function ou(t){return new _n(t,.5)}l(ou,"default");function su(t){return new _n(t,0)}l(su,"stepBefore");function lu(t){return new _n(t,1)}l(lu,"stepAfter");var mv={value:l(()=>{},"value")};function hu(){for(var t=0,e=arguments.length,r={},i;t=0&&(i=r.slice(a+1),r=r.slice(0,a)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}l(B0,"parseTypenames");Fa.prototype=hu.prototype={constructor:Fa,on:l(function(t,e){var r=this._,i=B0(t+"",r),a,n=-1,s=i.length;if(arguments.length<2){for(;++n0)for(var r=new Array(a),i=0,a,n;i=0&&t._call.call(void 0,e),t=t._next;--Gi}l(O0,"timerFlush");function Kl(){Or=(Oo=nn.now())+ws,Gi=Ca=0;try{O0()}finally{Gi=0,I0(),Or=0}}l(Kl,"wake");function D0(){var t=nn.now(),e=t-Oo;e>L0&&(ws-=e,Oo=t)}l(D0,"poke");function I0(){for(var t,e=Eo,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:Eo=r);wa=t,Do(i)}l(I0,"nap");function Do(t){if(!Gi){Ca&&(Ca=clearTimeout(Ca));var e=t-Or;e>24?(t<1/0&&(Ca=setTimeout(Kl,t-nn.now()-ws)),ua&&(ua=clearInterval(ua))):(ua||(Oo=nn.now(),ua=setInterval(D0,L0)),Gi=1,F0(Kl))}}l(Do,"sleep");function th(t,e,r){var i=new on;return e=e==null?0:+e,i.restart(a=>{i.stop(),t(a+e)},e,r),i}l(th,"default");var xv=yv("start","end","cancel","interrupt"),bv=[],R0=0,Wd=1,eh=2,so=3,Hd=4,rh=5,lo=6;function vn(t,e,r,i,a,n){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;N0(t,r,{name:e,index:i,group:a,on:xv,tween:bv,time:n.time,delay:n.delay,duration:n.duration,ease:n.ease,timer:null,state:R0})}l(vn,"default");function _s(t,e){var r=ye(t,e);if(r.state>R0)throw new Error("too late; already scheduled");return r}l(_s,"init");function Se(t,e){var r=ye(t,e);if(r.state>so)throw new Error("too late; already running");return r}l(Se,"set");function ye(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}l(ye,"get");function N0(t,e,r){var i=t.__transition,a;i[e]=r,r.timer=cu(n,0,r.time);function n(h){r.state=Wd,r.timer.restart(s,r.delay,r.time),r.delay<=h&&s(h-r.delay)}l(n,"schedule");function s(h){var u,d,p,f;if(r.state!==Wd)return c();for(u in i)if(f=i[u],f.name===r.name){if(f.state===so)return th(s);f.state===Hd?(f.state=lo,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[u]):+ueh&&i.state=0&&(e=e.slice(0,r)),!e||e==="start"})}l(f1,"start");function g1(t,e,r){var i,a,n=f1(e)?_s:Se;return function(){var s=n(this,t),o=s.on;o!==i&&(a=(i=o).copy()).on(e,r),s.on=a}}l(g1,"onFunction");function m1(t,e){var r=this._id;return arguments.length<2?ye(this.node(),r).on.on(t):this.each(g1(r,t,e))}l(m1,"default");function y1(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}l(y1,"removeFunction");function x1(){return this.on("end.remove",y1(this._id))}l(x1,"default");function b1(t){var e=this._name,r=this._id;typeof t!="function"&&(t=ds(t));for(var i=this._groups,a=i.length,n=new Array(a),s=0;s{for(let{id:e,detector:r,loader:i}of t)Y1(e,r,i)},"registerLazyLoadedDiagrams"),Y1=l((t,e,r)=>{Dr[t]&&R.warn(`Detector with key ${t} already exists. Overwriting.`),Dr[t]={detector:e,loader:r},R.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),Sv=l(t=>Dr[t].loader,"getDiagramLoader"),nh=l((t,e,{depth:r=2,clobber:i=!1}={})=>{let a={depth:r,clobber:i};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(n=>nh(t,n,a)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(n=>{t.includes(n)||t.push(n)}),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(n=>{typeof e[n]=="object"&&(t[n]===void 0||typeof t[n]=="object")?(t[n]===void 0&&(t[n]=Array.isArray(e[n])?[]:{}),t[n]=nh(t[n],e[n],{depth:r-1,clobber:i})):(i||typeof t[n]!="object"&&typeof e[n]!="object")&&(t[n]=e[n])}),t)},"assignWithDepth"),Lt=nh,ho={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:l(t=>t>=255?255:t<0?0:t,"r"),g:l(t=>t>=255?255:t<0?0:t,"g"),b:l(t=>t>=255?255:t<0?0:t,"b"),h:l(t=>t%360,"h"),s:l(t=>t>=100?100:t<0?0:t,"s"),l:l(t=>t>=100?100:t<0?0:t,"l"),a:l(t=>t>=1?1:t<0?0:t,"a")},toLinear:l(t=>{let e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},"toLinear"),hue2rgb:l((t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<.16666666666666666?t+(e-t)*6*r:r<.5?e:r<.6666666666666666?t+(e-t)*(.6666666666666666-r)*6:t),"hue2rgb"),hsl2rgb:l(({h:t,s:e,l:r},i)=>{if(!e)return r*2.55;t/=360,e/=100,r/=100;let a=r<.5?r*(1+e):r+e-r*e,n=2*r-a;switch(i){case"r":return ho.hue2rgb(n,a,t+.3333333333333333)*255;case"g":return ho.hue2rgb(n,a,t)*255;case"b":return ho.hue2rgb(n,a,t-.3333333333333333)*255}},"hsl2rgb"),rgb2hsl:l(({r:t,g:e,b:r},i)=>{t/=255,e/=255,r/=255;let a=Math.max(t,e,r),n=Math.min(t,e,r),s=(a+n)/2;if(i==="l")return s*100;if(a===n)return 0;let o=a-n,c=s>.5?o/(2-a-n):o/(a+n);if(i==="s")return c*100;switch(a){case t:return((e-r)/o+(ee>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),"clamp"),round:l(t=>Math.round(t*1e10)/1e10,"round")},Bv=Mv,Av={dec2hex:l(t=>{let e=Math.round(t).toString(16);return e.length>1?e:`0${e}`},"dec2hex")},Lv=Av,Fv={channel:Tv,lang:Bv,unit:Lv},lt=Fv,tr={};for(let t=0;t<=255;t++)tr[t]=lt.unit.dec2hex(t);var Yt={ALL:0,RGB:1,HSL:2},$i,Ev=($i=class{constructor(){this.type=Yt.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=Yt.ALL}is(e){return this.type===e}},l($i,"Type"),$i),Ov=Ev,_i,Dv=(_i=class{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new Ov}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Yt.ALL,this}_ensureHSL(){let e=this.data,{h:r,s:i,l:a}=e;r===void 0&&(e.h=lt.channel.rgb2hsl(e,"h")),i===void 0&&(e.s=lt.channel.rgb2hsl(e,"s")),a===void 0&&(e.l=lt.channel.rgb2hsl(e,"l"))}_ensureRGB(){let e=this.data,{r,g:i,b:a}=e;r===void 0&&(e.r=lt.channel.hsl2rgb(e,"r")),i===void 0&&(e.g=lt.channel.hsl2rgb(e,"g")),a===void 0&&(e.b=lt.channel.hsl2rgb(e,"b"))}get r(){let e=this.data,r=e.r;return!this.type.is(Yt.HSL)&&r!==void 0?r:(this._ensureHSL(),lt.channel.hsl2rgb(e,"r"))}get g(){let e=this.data,r=e.g;return!this.type.is(Yt.HSL)&&r!==void 0?r:(this._ensureHSL(),lt.channel.hsl2rgb(e,"g"))}get b(){let e=this.data,r=e.b;return!this.type.is(Yt.HSL)&&r!==void 0?r:(this._ensureHSL(),lt.channel.hsl2rgb(e,"b"))}get h(){let e=this.data,r=e.h;return!this.type.is(Yt.RGB)&&r!==void 0?r:(this._ensureRGB(),lt.channel.rgb2hsl(e,"h"))}get s(){let e=this.data,r=e.s;return!this.type.is(Yt.RGB)&&r!==void 0?r:(this._ensureRGB(),lt.channel.rgb2hsl(e,"s"))}get l(){let e=this.data,r=e.l;return!this.type.is(Yt.RGB)&&r!==void 0?r:(this._ensureRGB(),lt.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Yt.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Yt.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Yt.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Yt.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Yt.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Yt.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}},l(_i,"Channels"),_i),Iv=Dv,Rv=new Iv({r:0,g:0,b:0,a:0},"transparent"),Ss=Rv,V1={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:l(t=>{if(t.charCodeAt(0)!==35)return;let e=t.match(V1.re);if(!e)return;let r=e[1],i=parseInt(r,16),a=r.length,n=a%4===0,s=a>4,o=s?1:17,c=s?8:4,h=n?0:-1,u=s?255:15;return Ss.set({r:(i>>c*(h+3)&u)*o,g:(i>>c*(h+2)&u)*o,b:(i>>c*(h+1)&u)*o,a:n?(i&u)*o/255:1},t)},"parse"),stringify:l(t=>{let{r:e,g:r,b:i,a}=t;return a<1?`#${tr[Math.round(e)]}${tr[Math.round(r)]}${tr[Math.round(i)]}${tr[Math.round(a*255)]}`:`#${tr[Math.round(e)]}${tr[Math.round(r)]}${tr[Math.round(i)]}`},"stringify")},Oa=V1,co={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:l(t=>{let e=t.match(co.hueRe);if(e){let[,r,i]=e;switch(i){case"grad":return lt.channel.clamp.h(parseFloat(r)*.9);case"rad":return lt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return lt.channel.clamp.h(parseFloat(r)*360)}}return lt.channel.clamp.h(parseFloat(t))},"_hue2deg"),parse:l(t=>{let e=t.charCodeAt(0);if(e!==104&&e!==72)return;let r=t.match(co.re);if(!r)return;let[,i,a,n,s,o]=r;return Ss.set({h:co._hue2deg(i),s:lt.channel.clamp.s(parseFloat(a)),l:lt.channel.clamp.l(parseFloat(n)),a:s?lt.channel.clamp.a(o?parseFloat(s)/100:parseFloat(s)):1},t)},"parse"),stringify:l(t=>{let{h:e,s:r,l:i,a}=t;return a<1?`hsla(${lt.lang.round(e)}, ${lt.lang.round(r)}%, ${lt.lang.round(i)}%, ${a})`:`hsl(${lt.lang.round(e)}, ${lt.lang.round(r)}%, ${lt.lang.round(i)}%)`},"stringify")},jn=co,uo={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:l(t=>{t=t.toLowerCase();let e=uo.colors[t];if(e)return Oa.parse(e)},"parse"),stringify:l(t=>{let e=Oa.stringify(t);for(let r in uo.colors)if(uo.colors[r]===e)return r},"stringify")},Ud=uo,G1={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:l(t=>{let e=t.charCodeAt(0);if(e!==114&&e!==82)return;let r=t.match(G1.re);if(!r)return;let[,i,a,n,s,o,c,h,u]=r;return Ss.set({r:lt.channel.clamp.r(a?parseFloat(i)*2.55:parseFloat(i)),g:lt.channel.clamp.g(s?parseFloat(n)*2.55:parseFloat(n)),b:lt.channel.clamp.b(c?parseFloat(o)*2.55:parseFloat(o)),a:h?lt.channel.clamp.a(u?parseFloat(h)/100:parseFloat(h)):1},t)},"parse"),stringify:l(t=>{let{r:e,g:r,b:i,a}=t;return a<1?`rgba(${lt.lang.round(e)}, ${lt.lang.round(r)}, ${lt.lang.round(i)}, ${lt.lang.round(a)})`:`rgb(${lt.lang.round(e)}, ${lt.lang.round(r)}, ${lt.lang.round(i)})`},"stringify")},Wn=G1,Nv={format:{keyword:Ud,hex:Oa,rgb:Wn,rgba:Wn,hsl:jn,hsla:jn},parse:l(t=>{if(typeof t!="string")return t;let e=Oa.parse(t)||Wn.parse(t)||jn.parse(t)||Ud.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},"parse"),stringify:l(t=>!t.changed&&t.color?t.color:t.type.is(Yt.HSL)||t.data.r===void 0?jn.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Wn.stringify(t):Oa.stringify(t),"stringify")},ve=Nv,Pv=l((t,e)=>{let r=ve.parse(t);for(let i in e)r[i]=lt.channel.clamp[i](e[i]);return ve.stringify(r)},"change"),X1=Pv,zv=l((t,e,r=0,i=1)=>{if(typeof t!="number")return X1(t,{a:e});let a=Ss.set({r:lt.channel.clamp.r(t),g:lt.channel.clamp.g(e),b:lt.channel.clamp.b(r),a:lt.channel.clamp.a(i)});return ve.stringify(a)},"rgba"),Da=zv,qv=l((t,e)=>lt.lang.round(ve.parse(t)[e]),"channel"),nE=qv,jv=l(t=>{let{r:e,g:r,b:i}=ve.parse(t),a=.2126*lt.channel.toLinear(e)+.7152*lt.channel.toLinear(r)+.0722*lt.channel.toLinear(i);return lt.lang.round(a)},"luminance"),Wv=jv,Hv=l(t=>Wv(t)>=.5,"isLight"),Uv=Hv,Yv=l(t=>!Uv(t),"isDark"),Sn=Yv,Vv=l((t,e,r)=>{let i=ve.parse(t),a=i[e],n=lt.channel.clamp[e](a+r);return a!==n&&(i[e]=n),ve.stringify(i)},"adjustChannel"),Z1=Vv,Gv=l((t,e)=>Z1(t,"l",e),"lighten"),Z=Gv,Xv=l((t,e)=>Z1(t,"l",-e),"darken"),at=Xv,Zv=l((t,e)=>{let r=ve.parse(t),i={};for(let a in e)e[a]&&(i[a]=r[a]+e[a]);return X1(t,i)},"adjust"),M=Zv,Qv=l((t,e,r=50)=>{let{r:i,g:a,b:n,a:s}=ve.parse(t),{r:o,g:c,b:h,a:u}=ve.parse(e),d=r/100,p=d*2-1,f=s-u,g=((p*f===-1?p:(p+f)/(1+p*f))+1)/2,m=1-g,y=i*g+o*m,x=a*g+c*m,b=n*g+h*m,k=s*d+u*(1-d);return Da(y,x,b,k)},"mix"),Jv=Qv,Kv=l((t,e=100)=>{let r=ve.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Jv(r,t,e)},"invert"),W=Kv,Ts="#ffffff",Ms="#f2f2f2",te=l((t,e)=>e?M(t,{s:-40,l:10}):M(t,{s:-40,l:-10}),"mkBorder"),vi,tS=(vi=class{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||M(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||M(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||te(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||te(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||te(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||te(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||W(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||W(this.tertiaryColor),this.lineColor=this.lineColor||W(this.background),this.arrowheadColor=this.arrowheadColor||W(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?at(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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||W(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||Z(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||at(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||at(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Z(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Z(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||M(this.primaryColor,{h:30}),this.cScale4=this.cScale4||M(this.primaryColor,{h:60}),this.cScale5=this.cScale5||M(this.primaryColor,{h:90}),this.cScale6=this.cScale6||M(this.primaryColor,{h:120}),this.cScale7=this.cScale7||M(this.primaryColor,{h:150}),this.cScale8=this.cScale8||M(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||M(this.primaryColor,{h:270}),this.cScale10=this.cScale10||M(this.primaryColor,{h:300}),this.cScale11=this.cScale11||M(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r{this[i]=e[i]}),this.updateColors(),r.forEach(i=>{this[i]=e[i]})}},l(vi,"Theme"),vi),eS=l(t=>{let e=new tS;return e.calculate(t),e},"getThemeVariables"),Si,rS=(Si=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Z(this.primaryColor,16),this.tertiaryColor=M(this.primaryColor,{h:-160}),this.primaryBorderColor=W(this.background),this.secondaryBorderColor=te(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=te(this.tertiaryColor,this.darkMode),this.primaryTextColor=W(this.primaryColor),this.secondaryTextColor=W(this.secondaryColor),this.tertiaryTextColor=W(this.tertiaryColor),this.lineColor=W(this.background),this.textColor=W(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Z(W("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Da(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=at("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=at(this.sectionBkgColor,10),this.taskBorderColor=Da(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Da(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||Z(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||at(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=Z(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=Z(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=Z(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=M(this.primaryColor,{h:64}),this.fillType3=M(this.secondaryColor,{h:64}),this.fillType4=M(this.primaryColor,{h:-64}),this.fillType5=M(this.secondaryColor,{h:-64}),this.fillType6=M(this.primaryColor,{h:128}),this.fillType7=M(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||M(this.primaryColor,{h:30}),this.cScale4=this.cScale4||M(this.primaryColor,{h:60}),this.cScale5=this.cScale5||M(this.primaryColor,{h:90}),this.cScale6=this.cScale6||M(this.primaryColor,{h:120}),this.cScale7=this.cScale7||M(this.primaryColor,{h:150}),this.cScale8=this.cScale8||M(this.primaryColor,{h:210}),this.cScale9=this.cScale9||M(this.primaryColor,{h:270}),this.cScale10=this.cScale10||M(this.primaryColor,{h:300}),this.cScale11=this.cScale11||M(this.primaryColor,{h:330});for(let e=0;e{this[i]=e[i]}),this.updateColors(),r.forEach(i=>{this[i]=e[i]})}},l(Si,"Theme"),Si),iS=l(t=>{let e=new rS;return e.calculate(t),e},"getThemeVariables"),Ti,aS=(Ti=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=M(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=M(this.primaryColor,{h:-160}),this.primaryBorderColor=te(this.primaryColor,this.darkMode),this.secondaryBorderColor=te(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=te(this.tertiaryColor,this.darkMode),this.primaryTextColor=W(this.primaryColor),this.secondaryTextColor=W(this.secondaryColor),this.tertiaryTextColor=W(this.tertiaryColor),this.lineColor=W(this.background),this.textColor=W(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=Da(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||M(this.primaryColor,{h:30}),this.cScale4=this.cScale4||M(this.primaryColor,{h:60}),this.cScale5=this.cScale5||M(this.primaryColor,{h:90}),this.cScale6=this.cScale6||M(this.primaryColor,{h:120}),this.cScale7=this.cScale7||M(this.primaryColor,{h:150}),this.cScale8=this.cScale8||M(this.primaryColor,{h:210}),this.cScale9=this.cScale9||M(this.primaryColor,{h:270}),this.cScale10=this.cScale10||M(this.primaryColor,{h:300}),this.cScale11=this.cScale11||M(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||at(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||at(this.tertiaryColor,40);for(let e=0;e{this[i]==="calculated"&&(this[i]=void 0)}),typeof e!="object"){this.updateColors();return}let r=Object.keys(e);r.forEach(i=>{this[i]=e[i]}),this.updateColors(),r.forEach(i=>{this[i]=e[i]})}},l(Ti,"Theme"),Ti),nS=l(t=>{let e=new aS;return e.calculate(t),e},"getThemeVariables"),Mi,oS=(Mi=class{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=Z("#cde498",10),this.primaryBorderColor=te(this.primaryColor,this.darkMode),this.secondaryBorderColor=te(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=te(this.tertiaryColor,this.darkMode),this.primaryTextColor=W(this.primaryColor),this.secondaryTextColor=W(this.secondaryColor),this.tertiaryTextColor=W(this.primaryColor),this.lineColor=W(this.background),this.textColor=W(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=at(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||M(this.primaryColor,{h:30}),this.cScale4=this.cScale4||M(this.primaryColor,{h:60}),this.cScale5=this.cScale5||M(this.primaryColor,{h:90}),this.cScale6=this.cScale6||M(this.primaryColor,{h:120}),this.cScale7=this.cScale7||M(this.primaryColor,{h:150}),this.cScale8=this.cScale8||M(this.primaryColor,{h:210}),this.cScale9=this.cScale9||M(this.primaryColor,{h:270}),this.cScale10=this.cScale10||M(this.primaryColor,{h:300}),this.cScale11=this.cScale11||M(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||at(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||at(this.tertiaryColor,40);for(let e=0;e{this[i]=e[i]}),this.updateColors(),r.forEach(i=>{this[i]=e[i]})}},l(Mi,"Theme"),Mi),sS=l(t=>{let e=new oS;return e.calculate(t),e},"getThemeVariables"),Bi,lS=(Bi=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Z(this.contrast,55),this.background="#ffffff",this.tertiaryColor=M(this.primaryColor,{h:-160}),this.primaryBorderColor=te(this.primaryColor,this.darkMode),this.secondaryBorderColor=te(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=te(this.tertiaryColor,this.darkMode),this.primaryTextColor=W(this.primaryColor),this.secondaryTextColor=W(this.secondaryColor),this.tertiaryTextColor=W(this.tertiaryColor),this.lineColor=W(this.background),this.textColor=W(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||Z(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=Z(this.contrast,55),this.border2=this.contrast,this.actorBorder=Z(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 e=0;e{this[i]=e[i]}),this.updateColors(),r.forEach(i=>{this[i]=e[i]})}},l(Bi,"Theme"),Bi),hS=l(t=>{let e=new lS;return e.calculate(t),e},"getThemeVariables"),Ve={base:{getThemeVariables:eS},dark:{getThemeVariables:iS},default:{getThemeVariables:nS},forest:{getThemeVariables:sS},neutral:{getThemeVariables:hS}},Ae={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},Q1={...Ae,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Ve.default.getThemeVariables(),sequence:{...Ae.sequence,messageFont:l(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:l(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:l(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...Ae.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Ae.c4,useWidth:void 0,personFont:l(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Ae.flowchart,inheritDir:!1},external_personFont:l(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:l(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:l(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:l(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:l(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:l(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:l(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:l(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:l(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:l(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:l(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:l(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:l(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:l(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:l(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:l(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:l(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:l(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:l(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:l(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:l(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Ae.pie,useWidth:984},xyChart:{...Ae.xyChart,useWidth:void 0},requirement:{...Ae.requirement,useWidth:void 0},packet:{...Ae.packet},radar:{...Ae.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},J1=l((t,e="")=>Object.keys(t).reduce((r,i)=>Array.isArray(t[i])?r:typeof t[i]=="object"&&t[i]!==null?[...r,e+i,...J1(t[i],"")]:[...r,e+i],[]),"keyify"),cS=new Set(J1(Q1,"")),K1=Q1,Io=l(t=>{if(R.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Io(e));return}for(let e of Object.keys(t)){if(R.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!cS.has(e)||t[e]==null){R.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){R.debug("sanitizing object",e),Io(t[e]);continue}let r=["themeCSS","fontFamily","altFontFamily"];for(let i of r)e.includes(i)&&(R.debug("sanitizing css option",e),t[e]=uS(t[e]))}if(t.themeVariables)for(let e of Object.keys(t.themeVariables)){let r=t.themeVariables[e];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}R.debug("After sanitization",t)}},"sanitizeDirective"),uS=l(t=>{let e=0,r=0;for(let i of t){if(e{let r=Lt({},t),i={};for(let a of e)rx(a),i=Lt(i,a);if(r=Lt(r,i),i.theme&&i.theme in Ve){let a=Lt({},Ro),n=Lt(a.themeVariables||{},i.themeVariables);r.theme&&r.theme in Ve&&(r.themeVariables=Ve[r.theme].getThemeVariables(n))}return Ia=r,ix(Ia),Ia},"updateCurrentConfig"),dS=l(t=>(oe=Lt({},Xi),oe=Lt(oe,t),t.theme&&Ve[t.theme]&&(oe.themeVariables=Ve[t.theme].getThemeVariables(t.themeVariables)),Bs(oe,Ir),oe),"setSiteConfig"),pS=l(t=>{Ro=Lt({},t)},"saveConfigFromInitialize"),fS=l(t=>(oe=Lt(oe,t),Bs(oe,Ir),oe),"updateSiteConfig"),tx=l(()=>Lt({},oe),"getSiteConfig"),ex=l(t=>(ix(t),Lt(Ia,t),Gt()),"setConfig"),Gt=l(()=>Lt({},Ia),"getConfig"),rx=l(t=>{t&&(["secure",...oe.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(R.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"&&rx(t[e])}))},"sanitize"),gS=l(t=>{Io(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Ir.push(t),Bs(oe,Ir)},"addDirective"),No=l((t=oe)=>{Ir=[],Bs(t,Ir)},"reset"),mS={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},Yd={},yS=l(t=>{Yd[t]||(R.warn(mS[t]),Yd[t]=!0)},"issueWarning"),ix=l(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&yS("LAZY_LOAD_DEPRECATED")},"checkConfig"),oE=l(()=>{let t={};Ro&&(t=Lt(t,Ro));for(let e of Ir)t=Lt(t,e);return t},"getUserDefinedConfig"),{entries:ax,setPrototypeOf:Vd,isFrozen:xS,getPrototypeOf:bS,getOwnPropertyDescriptor:kS}=Object,{freeze:ie,seal:fe,create:nx}=Object,{apply:oh,construct:sh}=typeof Reflect<"u"&&Reflect;ie||(ie=l(function(t){return t},"freeze"));fe||(fe=l(function(t){return t},"seal"));oh||(oh=l(function(t,e,r){return t.apply(e,r)},"apply"));sh||(sh=l(function(t,e){return new t(...e)},"construct"));var Hn=Qt(Array.prototype.forEach),CS=Qt(Array.prototype.lastIndexOf),Gd=Qt(Array.prototype.pop),da=Qt(Array.prototype.push),wS=Qt(Array.prototype.splice),po=Qt(String.prototype.toLowerCase),cl=Qt(String.prototype.toString),Xd=Qt(String.prototype.match),pa=Qt(String.prototype.replace),$S=Qt(String.prototype.indexOf),_S=Qt(String.prototype.trim),be=Qt(Object.prototype.hasOwnProperty),Kt=Qt(RegExp.prototype.test),fa=ox(TypeError);function Qt(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a2&&arguments[2]!==void 0?arguments[2]:po;Vd&&Vd(t,null);let i=e.length;for(;i--;){let a=e[i];if(typeof a=="string"){let n=r(a);n!==a&&(xS(e)||(e[i]=n),a=n)}t[a]=!0}return t}l(ut,"addToSet");function sx(t){for(let e=0;e/gm),BS=fe(/\$\{[\w\W]*/gm),AS=fe(/^data-[\-\w.\u00B7-\uFFFF]+$/),LS=fe(/^aria-[\-\w]+$/),lx=fe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),FS=fe(/^(?:\w+script|data):/i),ES=fe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hx=fe(/^html$/i),OS=fe(/^[a-z][.\w]*(-[.\w]+)+$/i),tp=Object.freeze({__proto__:null,ARIA_ATTR:LS,ATTR_WHITESPACE:ES,CUSTOM_ELEMENT:OS,DATA_ATTR:AS,DOCTYPE_NAME:hx,ERB_EXPR:MS,IS_ALLOWED_URI:lx,IS_SCRIPT_OR_DATA:FS,MUSTACHE_EXPR:TS,TMPLIT_EXPR:BS}),ga={element:1,text:3,progressingInstruction:7,comment:8,document:9},DS=l(function(){return typeof window>"u"?null:window},"getGlobal"),IS=l(function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null,i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(r=e.getAttribute(i));let a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(n){return n},createScriptURL(n){return n}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},"_createTrustedTypesPolicy"),ep=l(function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},"_createHooksMap");function gu(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:DS(),e=l(w=>gu(w),"DOMPurify");if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==ga.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t,i=r,a=i.currentScript,{DocumentFragment:n,HTMLTemplateElement:s,Node:o,Element:c,NodeFilter:h,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:f}=t,g=c.prototype,m=si(g,"cloneNode"),y=si(g,"remove"),x=si(g,"nextSibling"),b=si(g,"childNodes"),k=si(g,"parentNode");if(typeof s=="function"){let w=r.createElement("template");w.content&&w.content.ownerDocument&&(r=w.content.ownerDocument)}let _,C="",{implementation:$,createNodeIterator:S,createDocumentFragment:D,getElementsByTagName:N}=r,{importNode:I}=i,T=ep();e.isSupported=typeof ax=="function"&&typeof k=="function"&&$&&$.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:O,ERB_EXPR:A,TMPLIT_EXPR:v,DATA_ATTR:L,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:E,ATTR_WHITESPACE:F,CUSTOM_ELEMENT:z}=tp,{IS_ALLOWED_URI:Y}=tp,V=null,X=ut({},[...Zd,...ul,...dl,...pl,...Qd]),G=null,ct=ut({},[...Jd,...fl,...Kd,...Un]),et=Object.seal(nx(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),wt=null,Ct=null,Ot=!0,q=!0,rt=!1,ht=!0,P=!1,_t=!0,ft=!1,Rt=!1,Nt=!1,ae=!1,xr=!1,On=!1,pd=!0,fd=!1,K$="user-content-",Qs=!0,ha=!1,Zr={},Qr=null,gd=ut({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),md=null,yd=ut({},["audio","video","img","source","image","track"]),Js=null,xd=ut({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Dn="http://www.w3.org/1998/Math/MathML",In="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",Jr=Ne,Ks=!1,tl=null,t_=ut({},[Dn,In,Ne],cl),Rn=ut({},["mi","mo","mn","ms","mtext"]),Nn=ut({},["annotation-xml"]),e_=ut({},["title","style","font","a","script"]),ca=null,r_=["application/xhtml+xml","text/html"],i_="text/html",Dt=null,Kr=null,a_=r.createElement("form"),bd=l(function(w){return w instanceof RegExp||w instanceof Function},"isRegexOrFunction"),el=l(function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Kr&&Kr===w)){if((!w||typeof w!="object")&&(w={}),w=Fe(w),ca=r_.indexOf(w.PARSER_MEDIA_TYPE)===-1?i_:w.PARSER_MEDIA_TYPE,Dt=ca==="application/xhtml+xml"?cl:po,V=be(w,"ALLOWED_TAGS")?ut({},w.ALLOWED_TAGS,Dt):X,G=be(w,"ALLOWED_ATTR")?ut({},w.ALLOWED_ATTR,Dt):ct,tl=be(w,"ALLOWED_NAMESPACES")?ut({},w.ALLOWED_NAMESPACES,cl):t_,Js=be(w,"ADD_URI_SAFE_ATTR")?ut(Fe(xd),w.ADD_URI_SAFE_ATTR,Dt):xd,md=be(w,"ADD_DATA_URI_TAGS")?ut(Fe(yd),w.ADD_DATA_URI_TAGS,Dt):yd,Qr=be(w,"FORBID_CONTENTS")?ut({},w.FORBID_CONTENTS,Dt):gd,wt=be(w,"FORBID_TAGS")?ut({},w.FORBID_TAGS,Dt):Fe({}),Ct=be(w,"FORBID_ATTR")?ut({},w.FORBID_ATTR,Dt):Fe({}),Zr=be(w,"USE_PROFILES")?w.USE_PROFILES:!1,Ot=w.ALLOW_ARIA_ATTR!==!1,q=w.ALLOW_DATA_ATTR!==!1,rt=w.ALLOW_UNKNOWN_PROTOCOLS||!1,ht=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=w.SAFE_FOR_TEMPLATES||!1,_t=w.SAFE_FOR_XML!==!1,ft=w.WHOLE_DOCUMENT||!1,ae=w.RETURN_DOM||!1,xr=w.RETURN_DOM_FRAGMENT||!1,On=w.RETURN_TRUSTED_TYPE||!1,Nt=w.FORCE_BODY||!1,pd=w.SANITIZE_DOM!==!1,fd=w.SANITIZE_NAMED_PROPS||!1,Qs=w.KEEP_CONTENT!==!1,ha=w.IN_PLACE||!1,Y=w.ALLOWED_URI_REGEXP||lx,Jr=w.NAMESPACE||Ne,Rn=w.MATHML_TEXT_INTEGRATION_POINTS||Rn,Nn=w.HTML_INTEGRATION_POINTS||Nn,et=w.CUSTOM_ELEMENT_HANDLING||{},w.CUSTOM_ELEMENT_HANDLING&&bd(w.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(et.tagNameCheck=w.CUSTOM_ELEMENT_HANDLING.tagNameCheck),w.CUSTOM_ELEMENT_HANDLING&&bd(w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(et.attributeNameCheck=w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(et.allowCustomizedBuiltInElements=w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(q=!1),xr&&(ae=!0),Zr&&(V=ut({},Qd),G=[],Zr.html===!0&&(ut(V,Zd),ut(G,Jd)),Zr.svg===!0&&(ut(V,ul),ut(G,fl),ut(G,Un)),Zr.svgFilters===!0&&(ut(V,dl),ut(G,fl),ut(G,Un)),Zr.mathMl===!0&&(ut(V,pl),ut(G,Kd),ut(G,Un))),w.ADD_TAGS&&(V===X&&(V=Fe(V)),ut(V,w.ADD_TAGS,Dt)),w.ADD_ATTR&&(G===ct&&(G=Fe(G)),ut(G,w.ADD_ATTR,Dt)),w.ADD_URI_SAFE_ATTR&&ut(Js,w.ADD_URI_SAFE_ATTR,Dt),w.FORBID_CONTENTS&&(Qr===gd&&(Qr=Fe(Qr)),ut(Qr,w.FORBID_CONTENTS,Dt)),Qs&&(V["#text"]=!0),ft&&ut(V,["html","head","body"]),V.table&&(ut(V,["tbody"]),delete wt.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw fa('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw fa('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=w.TRUSTED_TYPES_POLICY,C=_.createHTML("")}else _===void 0&&(_=IS(f,a)),_!==null&&typeof C=="string"&&(C=_.createHTML(""));ie&&ie(w),Kr=w}},"_parseConfig"),kd=ut({},[...ul,...dl,...vS]),Cd=ut({},[...pl,...SS]),n_=l(function(w){let U=k(w);(!U||!U.tagName)&&(U={namespaceURI:Jr,tagName:"template"});let j=po(w.tagName),kt=po(U.tagName);return tl[w.namespaceURI]?w.namespaceURI===In?U.namespaceURI===Ne?j==="svg":U.namespaceURI===Dn?j==="svg"&&(kt==="annotation-xml"||Rn[kt]):!!kd[j]:w.namespaceURI===Dn?U.namespaceURI===Ne?j==="math":U.namespaceURI===In?j==="math"&&Nn[kt]:!!Cd[j]:w.namespaceURI===Ne?U.namespaceURI===In&&!Nn[kt]||U.namespaceURI===Dn&&!Rn[kt]?!1:!Cd[j]&&(e_[j]||!kd[j]):!!(ca==="application/xhtml+xml"&&tl[w.namespaceURI]):!1},"_checkValidNamespace"),br=l(function(w){da(e.removed,{element:w});try{k(w).removeChild(w)}catch{y(w)}},"_forceRemove"),ti=l(function(w,U){try{da(e.removed,{attribute:U.getAttributeNode(w),from:U})}catch{da(e.removed,{attribute:null,from:U})}if(U.removeAttribute(w),w==="is")if(ae||xr)try{br(U)}catch{}else try{U.setAttribute(w,"")}catch{}},"_removeAttribute"),wd=l(function(w){let U=null,j=null;if(Nt)w=""+w;else{let St=Xd(w,/^[\r\n\t ]+/);j=St&&St[0]}ca==="application/xhtml+xml"&&Jr===Ne&&(w=''+w+"");let kt=_?_.createHTML(w):w;if(Jr===Ne)try{U=new p().parseFromString(kt,ca)}catch{}if(!U||!U.documentElement){U=$.createDocument(Jr,"template",null);try{U.documentElement.innerHTML=Ks?C:kt}catch{}}let Pt=U.body||U.documentElement;return w&&j&&Pt.insertBefore(r.createTextNode(j),Pt.childNodes[0]||null),Jr===Ne?N.call(U,ft?"html":"body")[0]:ft?U.documentElement:Pt},"_initDocument"),$d=l(function(w){return S.call(w.ownerDocument||w,w,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),rl=l(function(w){return w instanceof d&&(typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||!(w.attributes instanceof u)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function")},"_isClobbered"),_d=l(function(w){return typeof o=="function"&&w instanceof o},"_isNode");function Te(w,U,j){Hn(w,kt=>{kt.call(e,U,j,Kr)})}l(Te,"_executeHooks");let vd=l(function(w){let U=null;if(Te(T.beforeSanitizeElements,w,null),rl(w))return br(w),!0;let j=Dt(w.nodeName);if(Te(T.uponSanitizeElement,w,{tagName:j,allowedTags:V}),_t&&w.hasChildNodes()&&!_d(w.firstElementChild)&&Kt(/<[/\w!]/g,w.innerHTML)&&Kt(/<[/\w!]/g,w.textContent)||w.nodeType===ga.progressingInstruction||_t&&w.nodeType===ga.comment&&Kt(/<[/\w]/g,w.data))return br(w),!0;if(!V[j]||wt[j]){if(!wt[j]&&Td(j)&&(et.tagNameCheck instanceof RegExp&&Kt(et.tagNameCheck,j)||et.tagNameCheck instanceof Function&&et.tagNameCheck(j)))return!1;if(Qs&&!Qr[j]){let kt=k(w)||w.parentNode,Pt=b(w)||w.childNodes;if(Pt&&kt){let St=Pt.length;for(let Pe=St-1;Pe>=0;--Pe){let xe=m(Pt[Pe],!0);xe.__removalCount=(w.__removalCount||0)+1,kt.insertBefore(xe,x(w))}}}return br(w),!0}return w instanceof c&&!n_(w)||(j==="noscript"||j==="noembed"||j==="noframes")&&Kt(/<\/no(script|embed|frames)/i,w.innerHTML)?(br(w),!0):(P&&w.nodeType===ga.text&&(U=w.textContent,Hn([O,A,v],kt=>{U=pa(U,kt," ")}),w.textContent!==U&&(da(e.removed,{element:w.cloneNode()}),w.textContent=U)),Te(T.afterSanitizeElements,w,null),!1)},"_sanitizeElements"),Sd=l(function(w,U,j){if(pd&&(U==="id"||U==="name")&&(j in r||j in a_))return!1;if(!(q&&!Ct[U]&&Kt(L,U))&&!(Ot&&Kt(B,U))){if(!G[U]||Ct[U]){if(!(Td(w)&&(et.tagNameCheck instanceof RegExp&&Kt(et.tagNameCheck,w)||et.tagNameCheck instanceof Function&&et.tagNameCheck(w))&&(et.attributeNameCheck instanceof RegExp&&Kt(et.attributeNameCheck,U)||et.attributeNameCheck instanceof Function&&et.attributeNameCheck(U))||U==="is"&&et.allowCustomizedBuiltInElements&&(et.tagNameCheck instanceof RegExp&&Kt(et.tagNameCheck,j)||et.tagNameCheck instanceof Function&&et.tagNameCheck(j))))return!1}else if(!Js[U]&&!Kt(Y,pa(j,F,""))&&!((U==="src"||U==="xlink:href"||U==="href")&&w!=="script"&&$S(j,"data:")===0&&md[w])&&!(rt&&!Kt(E,pa(j,F,"")))&&j)return!1}return!0},"_isValidAttribute"),Td=l(function(w){return w!=="annotation-xml"&&Xd(w,z)},"_isBasicCustomElement"),Md=l(function(w){Te(T.beforeSanitizeAttributes,w,null);let{attributes:U}=w;if(!U||rl(w))return;let j={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0},kt=U.length;for(;kt--;){let Pt=U[kt],{name:St,namespaceURI:Pe,value:xe}=Pt,Me=Dt(St),il=xe,Wt=St==="value"?il:_S(il);if(j.attrName=Me,j.attrValue=Wt,j.keepAttr=!0,j.forceKeepAttr=void 0,Te(T.uponSanitizeAttribute,w,j),Wt=j.attrValue,fd&&(Me==="id"||Me==="name")&&(ti(St,w),Wt=K$+Wt),_t&&Kt(/((--!?|])>)|<\/(style|title)/i,Wt)){ti(St,w);continue}if(j.forceKeepAttr)continue;if(!j.keepAttr){ti(St,w);continue}if(!ht&&Kt(/\/>/i,Wt)){ti(St,w);continue}P&&Hn([O,A,v],s_=>{Wt=pa(Wt,s_," ")});let Bd=Dt(w.nodeName);if(!Sd(Bd,Me,Wt)){ti(St,w);continue}if(_&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Pe)switch(f.getAttributeType(Bd,Me)){case"TrustedHTML":{Wt=_.createHTML(Wt);break}case"TrustedScriptURL":{Wt=_.createScriptURL(Wt);break}}if(Wt!==il)try{Pe?w.setAttributeNS(Pe,St,Wt):w.setAttribute(St,Wt),rl(w)?br(w):Gd(e.removed)}catch{ti(St,w)}}Te(T.afterSanitizeAttributes,w,null)},"_sanitizeAttributes"),o_=l(function w(U){let j=null,kt=$d(U);for(Te(T.beforeSanitizeShadowDOM,U,null);j=kt.nextNode();)Te(T.uponSanitizeShadowNode,j,null),vd(j),Md(j),j.content instanceof n&&w(j.content);Te(T.afterSanitizeShadowDOM,U,null)},"_sanitizeShadowDOM");return e.sanitize=function(w){let U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=null,kt=null,Pt=null,St=null;if(Ks=!w,Ks&&(w=""),typeof w!="string"&&!_d(w))if(typeof w.toString=="function"){if(w=w.toString(),typeof w!="string")throw fa("dirty is not a string, aborting")}else throw fa("toString is not a function");if(!e.isSupported)return w;if(Rt||el(U),e.removed=[],typeof w=="string"&&(ha=!1),ha){if(w.nodeName){let Me=Dt(w.nodeName);if(!V[Me]||wt[Me])throw fa("root node is forbidden and cannot be sanitized in-place")}}else if(w instanceof o)j=wd(""),kt=j.ownerDocument.importNode(w,!0),kt.nodeType===ga.element&&kt.nodeName==="BODY"||kt.nodeName==="HTML"?j=kt:j.appendChild(kt);else{if(!ae&&!P&&!ft&&w.indexOf("<")===-1)return _&&On?_.createHTML(w):w;if(j=wd(w),!j)return ae?null:On?C:""}j&&Nt&&br(j.firstChild);let Pe=$d(ha?w:j);for(;Pt=Pe.nextNode();)vd(Pt),Md(Pt),Pt.content instanceof n&&o_(Pt.content);if(ha)return w;if(ae){if(xr)for(St=D.call(j.ownerDocument);j.firstChild;)St.appendChild(j.firstChild);else St=j;return(G.shadowroot||G.shadowrootmode)&&(St=I.call(i,St,!0)),St}let xe=ft?j.outerHTML:j.innerHTML;return ft&&V["!doctype"]&&j.ownerDocument&&j.ownerDocument.doctype&&j.ownerDocument.doctype.name&&Kt(hx,j.ownerDocument.doctype.name)&&(xe=" `+xe),P&&Hn([O,A,v],Me=>{xe=pa(xe,Me," ")}),_&&On?_.createHTML(xe):xe},e.setConfig=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};el(w),Rt=!0},e.clearConfig=function(){Kr=null,Rt=!1},e.isValidAttribute=function(w,U,j){Kr||el({});let kt=Dt(w),Pt=Dt(U);return Sd(kt,Pt,j)},e.addHook=function(w,U){typeof U=="function"&&da(T[w],U)},e.removeHook=function(w,U){if(U!==void 0){let j=CS(T[w],U);return j===-1?void 0:wS(T[w],j,1)[0]}return Gd(T[w])},e.removeHooks=function(w){T[w]=[]},e.removeAllHooks=function(){T=ep()},e}l(gu,"createDOMPurify");var Zi=gu(),Tn=//gi,RS=l(t=>t?dx(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),NS=(()=>{let t=!1;return()=>{t||(cx(),t=!0)}})();function cx(){let t="data-temp-href-target";Zi.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),Zi.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"))})}l(cx,"setupDompurifyHooks");var ux=l(t=>(NS(),Zi.sanitize(t)),"removeScript"),rp=l((t,e)=>{if(e.flowchart?.htmlLabels!==!1){let r=e.securityLevel;r==="antiscript"||r==="strict"?t=ux(t):r!=="loose"&&(t=dx(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=jS(t))}return t},"sanitizeMore"),ge=l((t,e)=>t&&(e.dompurifyConfig?t=Zi.sanitize(rp(t,e),e.dompurifyConfig).toString():t=Zi.sanitize(rp(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),PS=l((t,e)=>typeof t=="string"?ge(t,e):t.flat().map(r=>ge(r,e)),"sanitizeTextOrArray"),zS=l(t=>Tn.test(t),"hasBreaks"),qS=l(t=>t.split(Tn),"splitBreaks"),jS=l(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),dx=l(t=>t.replace(Tn,"#br#"),"breakToPlaceholder"),WS=l(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),Et=l(t=>!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),HS=l(function(...t){let e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),US=l(function(...t){let e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),ip=l(function(t){let e=t.split(/(,)/),r=[];for(let i=0;i0&&i+1Math.max(0,t.split(e).length-1),"countOccurrence"),YS=l((t,e)=>{let r=lh(t,"~"),i=lh(e,"~");return r===1&&i===1},"shouldCombineSets"),VS=l(t=>{let e=lh(t,"~"),r=!1;if(e<=1)return t;e%2!==0&&t.startsWith("~")&&(t=t.substring(1),r=!0);let i=[...t],a=i.indexOf("~"),n=i.lastIndexOf("~");for(;a!==-1&&n!==-1&&a!==n;)i[a]="<",i[n]=">",a=i.indexOf("~"),n=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),ap=l(()=>window.MathMLElement!==void 0,"isMathMLSupported"),hh=/\$\$(.*)\$\$/g,Qi=l(t=>(t.match(hh)?.length??0)>0,"hasKatex"),sE=l(async(t,e)=>{let r=document.createElement("div");r.innerHTML=await mu(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);let i={width:r.clientWidth,height:r.clientHeight};return r.remove(),i},"calculateMathMLDimensions"),GS=l(async(t,e)=>{if(!Qi(t))return t;if(!(ap()||e.legacyMathML||e.forceLegacyMathML))return t.replace(hh,"MathML is unsupported in this environment.");{let{default:r}=await bt(()=>import("./katex-RV2QPRKB-B6HNiSvq.js"),__vite__mapDeps([0,1])),i=e.forceLegacyMathML||!ap()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(Tn).map(a=>Qi(a)?`
${a}
`:`
${a}
`).join("").replace(hh,(a,n)=>r.renderToString(n,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),mu=l(async(t,e)=>ge(await GS(t,e),e),"renderKatexSanitized"),ia={getRows:RS,sanitizeText:ge,sanitizeTextOrArray:PS,hasBreaks:zS,splitBreaks:qS,lineBreakRegex:Tn,removeScript:ux,getUrl:WS,evaluate:Et,getMax:HS,getMin:US},XS=l(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),ZS=l(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"),px=l(function(t,e,r,i){let a=ZS(e,r,i);XS(t,a)},"configureSvgSize"),QS=l(function(t,e,r,i){let a=e.node().getBBox(),n=a.width,s=a.height;R.info(`SVG bounds: ${n}x${s}`,a);let o=0,c=0;R.info(`Graph bounds: ${o}x${c}`,t),o=n+r*2,c=s+r*2,R.info(`Calculated bounds: ${o}x${c}`),px(e,c,o,i);let h=`${a.x-r} ${a.y-r} ${a.width+2*r} ${a.height+2*r}`;e.attr("viewBox",h)},"setupGraphViewbox"),fo={},JS=l((t,e,r)=>{let i="";return t in fo&&fo[t]?i=fo[t](r):R.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"),KS=l((t,e)=>{e!==void 0&&(fo[t]=e)},"addStylesForDiagram"),tT=JS,fx={};g_(fx,{clear:()=>eT,getAccDescription:()=>nT,getAccTitle:()=>iT,getDiagramTitle:()=>sT,setAccDescription:()=>aT,setAccTitle:()=>rT,setDiagramTitle:()=>oT});var yu="",xu="",bu="",ku=l(t=>ge(t,Gt()),"sanitizeText"),eT=l(()=>{yu="",bu="",xu=""},"clear"),rT=l(t=>{yu=ku(t).replace(/^\s+/g,"")},"setAccTitle"),iT=l(()=>yu,"getAccTitle"),aT=l(t=>{bu=ku(t).replace(/\n\s+/g,` `)},"setAccDescription"),nT=l(()=>bu,"getAccDescription"),oT=l(t=>{xu=ku(t)},"setDiagramTitle"),sT=l(()=>xu,"getDiagramTitle"),np=R,lT=rc,xt=Gt,lE=ex,hE=Xi,Cu=l(t=>ge(t,xt()),"sanitizeText"),hT=QS,cT=l(()=>fx,"getCommonDb"),Po={},zo=l((t,e,r)=>{Po[t]&&np.warn(`Diagram with id ${t} already registered. Overwriting.`),Po[t]=e,r&&Y1(t,r),KS(t,e.styles),e.injectUtils?.(np,lT,xt,Cu,hT,cT(),()=>{})},"registerDiagram"),ch=l(t=>{if(t in Po)return Po[t];throw new uT(t)},"getDiagram"),Ai,uT=(Ai=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},l(Ai,"DiagramNotFoundError"),Ai);/*! Bundled license information: dompurify/dist/purify.es.mjs: (*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE *) */var dT=l(t=>{let{securityLevel:e}=xt(),r=pt("body");if(e==="sandbox"){let i=pt(`#i${t}`).node()?.contentDocument??document;r=pt(i.body)}return r.select(`#${t}`)},"selectSvgElement");function wu(t){return typeof t>"u"||t===null}l(wu,"isNothing");function gx(t){return typeof t=="object"&&t!==null}l(gx,"isObject");function mx(t){return Array.isArray(t)?t:wu(t)?[]:[t]}l(mx,"toArray");function yx(t,e){var r,i,a,n;if(e)for(n=Object.keys(e),r=0,i=n.length;ro&&(n=" ... ",e=i-o+n.length),r-i>o&&(s=" ...",r=i+o-s.length),{str:n+t.slice(e,r).replace(/\t/g,"→")+s,pos:i-e+n.length}}l(go,"getLine");function mo(t,e){return Ft.repeat(" ",e-t.length)+t}l(mo,"padStart");function kx(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],a=[],n,s=-1;n=r.exec(t.buffer);)a.push(n.index),i.push(n.index+n[0].length),t.position<=n.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var o="",c,h,u=Math.min(t.line+e.linesAfter,a.length).toString().length,d=e.maxLength-(e.indent+u+3);for(c=1;c<=e.linesBefore&&!(s-c<0);c++)h=go(t.buffer,i[s-c],a[s-c],t.position-(i[s]-i[s-c]),d),o=Ft.repeat(" ",e.indent)+mo((t.line-c+1).toString(),u)+" | "+h.str+` `+o;for(h=go(t.buffer,i[s],a[s],t.position,d),o+=Ft.repeat(" ",e.indent)+mo((t.line+1).toString(),u)+" | "+h.str+` `,o+=Ft.repeat("-",e.indent+u+3+h.pos)+`^ `,c=1;c<=e.linesAfter&&!(s+c>=a.length);c++)h=go(t.buffer,i[s+c],a[s+c],t.position-(i[s]-i[s+c]),d),o+=Ft.repeat(" ",e.indent)+mo((t.line+c+1).toString(),u)+" | "+h.str+` `;return o.replace(/\n$/,"")}l(kx,"makeSnippet");var bT=kx,kT=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],CT=["scalar","sequence","mapping"];function Cx(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(i){e[String(i)]=r})}),e}l(Cx,"compileStyleAliases");function wx(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(kT.indexOf(r)===-1)throw new se('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=Cx(e.styleAliases||null),CT.indexOf(this.kind)===-1)throw new se('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}l(wx,"Type$1");var Xt=wx;function uh(t,e){var r=[];return t[e].forEach(function(i){var a=r.length;r.forEach(function(n,s){n.tag===i.tag&&n.kind===i.kind&&n.multi===i.multi&&(a=s)}),r[a]=i}),r}l(uh,"compileList");function $x(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function i(a){a.multi?(t.multi[a.kind].push(a),t.multi.fallback.push(a)):t[a.kind][a.tag]=t.fallback[a.tag]=a}for(l(i,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:l(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:l(function(t){return t.toString(10)},"decimal"),hexadecimal:l(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"]}}),AT=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ix(t){return!(t===null||!AT.test(t)||t[t.length-1]==="_")}l(Ix,"resolveYamlFloat");function Rx(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)}l(Rx,"constructYamlFloat");var LT=/^[-+]?[0-9]+e/;function Nx(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),LT.test(r)?r.replace("e",".e"):r}l(Nx,"representYamlFloat");function Px(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||Ft.isNegativeZero(t))}l(Px,"isFloat");var FT=new Xt("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ix,construct:Rx,predicate:Px,represent:Nx,defaultStyle:"lowercase"}),zx=ST.extend({implicit:[TT,MT,BT,FT]}),ET=zx,qx=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),jx=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 Wx(t){return t===null?!1:qx.exec(t)!==null||jx.exec(t)!==null}l(Wx,"resolveYamlTimestamp");function Hx(t){var e,r,i,a,n,s,o,c=0,h=null,u,d,p;if(e=qx.exec(t),e===null&&(e=jx.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],i=+e[2]-1,a=+e[3],!e[4])return new Date(Date.UTC(r,i,a));if(n=+e[4],s=+e[5],o=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(u=+e[10],d=+(e[11]||0),h=(u*60+d)*6e4,e[9]==="-"&&(h=-h)),p=new Date(Date.UTC(r,i,a,n,s,o,c)),h&&p.setTime(p.getTime()-h),p}l(Hx,"constructYamlTimestamp");function Ux(t){return t.toISOString()}l(Ux,"representYamlTimestamp");var OT=new Xt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Wx,construct:Hx,instanceOf:Date,represent:Ux});function Yx(t){return t==="<<"||t===null}l(Yx,"resolveYamlMerge");var DT=new Xt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Yx}),_u=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function Vx(t){if(t===null)return!1;var e,r,i=0,a=t.length,n=_u;for(r=0;r64)){if(e<0)return!1;i+=6}return i%8===0}l(Vx,"resolveYamlBinary");function Gx(t){var e,r,i=t.replace(/[\r\n=]/g,""),a=i.length,n=_u,s=0,o=[];for(e=0;e>16&255),o.push(s>>8&255),o.push(s&255)),s=s<<6|n.indexOf(i.charAt(e));return r=a%4*6,r===0?(o.push(s>>16&255),o.push(s>>8&255),o.push(s&255)):r===18?(o.push(s>>10&255),o.push(s>>2&255)):r===12&&o.push(s>>4&255),new Uint8Array(o)}l(Gx,"constructYamlBinary");function Xx(t){var e="",r=0,i,a,n=t.length,s=_u;for(i=0;i>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]),r=(r<<8)+t[i];return a=n%3,a===0?(e+=s[r>>18&63],e+=s[r>>12&63],e+=s[r>>6&63],e+=s[r&63]):a===2?(e+=s[r>>10&63],e+=s[r>>4&63],e+=s[r<<2&63],e+=s[64]):a===1&&(e+=s[r>>2&63],e+=s[r<<4&63],e+=s[64],e+=s[64]),e}l(Xx,"representYamlBinary");function Zx(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}l(Zx,"isBinary");var IT=new Xt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Vx,construct:Gx,predicate:Zx,represent:Xx}),RT=Object.prototype.hasOwnProperty,NT=Object.prototype.toString;function Qx(t){if(t===null)return!0;var e=[],r,i,a,n,s,o=t;for(r=0,i=o.length;r>10)+55296,(t-65536&1023)+56320)}l(ub,"charFromCodepoint");var db=new Array(256),pb=new Array(256);for(Cr=0;Cr<256;Cr++)db[Cr]=ph(Cr)?1:0,pb[Cr]=ph(Cr);var Cr;function fb(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||ib,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=[]}l(fb,"State$1");function vu(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=bT(r),new se(e,r)}l(vu,"generateError");function it(t,e){throw vu(t,e)}l(it,"throwError");function sn(t,e){t.onWarning&&t.onWarning.call(null,vu(t,e))}l(sn,"throwWarning");var sp={YAML:l(function(t,e,r){var i,a,n;t.version!==null&&it(t,"duplication of %YAML directive"),r.length!==1&&it(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&it(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),n=parseInt(i[2],10),a!==1&&it(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=n<2,n!==1&&n!==2&&sn(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:l(function(t,e,r){var i,a;r.length!==2&&it(t,"TAG directive accepts exactly two arguments"),i=r[0],a=r[1],ob.test(i)||it(t,"ill-formed tag handle (first argument) of the TAG directive"),cr.call(t.tagMap,i)&&it(t,'there is a previously declared suffix for "'+i+'" tag handle'),sb.test(a)||it(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{it(t,"tag prefix is malformed: "+a)}t.tagMap[i]=a},"handleTagDirective")};function Ge(t,e,r,i){var a,n,s,o;if(e1&&(t.result+=Ft.repeat(` `,e-1))}l(Ls,"writeFoldedLines");function gb(t,e,r){var i,a,n,s,o,c,h,u,d=t.kind,p=t.result,f;if(f=t.input.charCodeAt(t.position),ee(f)||Tr(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(a=t.input.charCodeAt(t.position+1),ee(a)||r&&Tr(a)))return!1;for(t.kind="scalar",t.result="",n=s=t.position,o=!1;f!==0;){if(f===58){if(a=t.input.charCodeAt(t.position+1),ee(a)||r&&Tr(a))break}else if(f===35){if(i=t.input.charCodeAt(t.position-1),ee(i))break}else{if(t.position===t.lineStart&&Mn(t)||r&&Tr(f))break;if(_e(f))if(c=t.line,h=t.lineStart,u=t.lineIndent,Mt(t,!1,-1),t.lineIndent>=e){o=!0,f=t.input.charCodeAt(t.position);continue}else{t.position=s,t.line=c,t.lineStart=h,t.lineIndent=u;break}}o&&(Ge(t,n,s,!1),Ls(t,t.line-c),n=s=t.position,o=!1),nr(f)||(s=t.position+1),f=t.input.charCodeAt(++t.position)}return Ge(t,n,s,!1),t.result?!0:(t.kind=d,t.result=p,!1)}l(gb,"readPlainScalar");function mb(t,e){var r,i,a;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,i=a=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(Ge(t,i,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)i=t.position,t.position++,a=t.position;else return!0;else _e(r)?(Ge(t,i,a,!0),Ls(t,Mt(t,!1,e)),i=a=t.position):t.position===t.lineStart&&Mn(t)?it(t,"unexpected end of the document within a single quoted scalar"):(t.position++,a=t.position);it(t,"unexpected end of the stream within a single quoted scalar")}l(mb,"readSingleQuotedScalar");function yb(t,e){var r,i,a,n,s,o;if(o=t.input.charCodeAt(t.position),o!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;(o=t.input.charCodeAt(t.position))!==0;){if(o===34)return Ge(t,r,t.position,!0),t.position++,!0;if(o===92){if(Ge(t,r,t.position,!0),o=t.input.charCodeAt(++t.position),_e(o))Mt(t,!1,e);else if(o<256&&db[o])t.result+=pb[o],t.position++;else if((s=hb(o))>0){for(a=s,n=0;a>0;a--)o=t.input.charCodeAt(++t.position),(s=lb(o))>=0?n=(n<<4)+s:it(t,"expected hexadecimal character");t.result+=ub(n),t.position++}else it(t,"unknown escape sequence");r=i=t.position}else _e(o)?(Ge(t,r,i,!0),Ls(t,Mt(t,!1,e)),r=i=t.position):t.position===t.lineStart&&Mn(t)?it(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}it(t,"unexpected end of the stream within a double quoted scalar")}l(yb,"readDoubleQuotedScalar");function xb(t,e){var r=!0,i,a,n,s=t.tag,o,c=t.anchor,h,u,d,p,f,g=Object.create(null),m,y,x,b;if(b=t.input.charCodeAt(t.position),b===91)u=93,f=!1,o=[];else if(b===123)u=125,f=!0,o={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=o),b=t.input.charCodeAt(++t.position);b!==0;){if(Mt(t,!0,e),b=t.input.charCodeAt(t.position),b===u)return t.position++,t.tag=s,t.anchor=c,t.kind=f?"mapping":"sequence",t.result=o,!0;r?b===44&&it(t,"expected the node content, but found ','"):it(t,"missed comma between flow collection entries"),y=m=x=null,d=p=!1,b===63&&(h=t.input.charCodeAt(t.position+1),ee(h)&&(d=p=!0,t.position++,Mt(t,!0,e))),i=t.line,a=t.lineStart,n=t.position,Rr(t,e,jo,!1,!0),y=t.tag,m=t.result,Mt(t,!0,e),b=t.input.charCodeAt(t.position),(p||t.line===i)&&b===58&&(d=!0,b=t.input.charCodeAt(++t.position),Mt(t,!0,e),Rr(t,e,jo,!1,!0),x=t.result),f?Mr(t,o,g,y,m,x,i,a,n):d?o.push(Mr(t,null,g,y,m,x,i,a,n)):o.push(m),Mt(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(r=!0,b=t.input.charCodeAt(++t.position)):r=!1}it(t,"unexpected end of the stream within a flow collection")}l(xb,"readFlowCollection");function bb(t,e){var r,i,a=gl,n=!1,s=!1,o=e,c=0,h=!1,u,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)gl===a?a=d===43?op:HT:it(t,"repeat of a chomping mode identifier");else if((u=cb(d))>=0)u===0?it(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?it(t,"repeat of an indentation width identifier"):(o=e+u-1,s=!0);else break;if(nr(d)){do d=t.input.charCodeAt(++t.position);while(nr(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!_e(d)&&d!==0)}for(;d!==0;){for(As(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!s||t.lineIndento&&(o=t.lineIndent),_e(d)){c++;continue}if(t.lineIndente)&&c!==0)it(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(y&&(s=t.line,o=t.lineStart,c=t.position),Rr(t,e,Wo,!0,a)&&(y?g=t.result:m=t.result),y||(Mr(t,d,p,f,g,m,s,o,c),f=g=m=null),Mt(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===n||t.lineIndent>e)&&b!==0)it(t,"bad indentation of a mapping entry");else if(t.lineIndente?c=1:t.lineIndent===e?c=0:t.lineIndente?c=1:t.lineIndent===e?c=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),d=0,p=t.implicitTypes.length;d"),t.result!==null&&g.kind!==t.kind&&it(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):it(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||u}l(Rr,"composeNode");function _b(t){var e=t.position,r,i,a,n=!1,s;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(s=t.input.charCodeAt(t.position))!==0&&(Mt(t,!0,-1),s=t.input.charCodeAt(t.position),!(t.lineIndent>0||s!==37));){for(n=!0,s=t.input.charCodeAt(++t.position),r=t.position;s!==0&&!ee(s);)s=t.input.charCodeAt(++t.position);for(i=t.input.slice(r,t.position),a=[],i.length<1&&it(t,"directive name must not be less than one character in length");s!==0;){for(;nr(s);)s=t.input.charCodeAt(++t.position);if(s===35){do s=t.input.charCodeAt(++t.position);while(s!==0&&!_e(s));break}if(_e(s))break;for(r=t.position;s!==0&&!ee(s);)s=t.input.charCodeAt(++t.position);a.push(t.input.slice(r,t.position))}s!==0&&As(t),cr.call(sp,i)?sp[i](t,i,a):sn(t,'unknown document directive "'+i+'"')}if(Mt(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,Mt(t,!0,-1)):n&&it(t,"directives end mark is expected"),Rr(t,t.lineIndent-1,Wo,!1,!0),Mt(t,!0,-1),t.checkLineBreaks&&YT.test(t.input.slice(e,t.position))&&sn(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Mn(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Mt(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var i=Su(t,r);if(typeof e!="function")return i;for(var a=0,n=i.length;a=55296&&r<=56319&&e+1=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}l(gi,"codePointAt");function Mu(t){var e=/^\n* /;return e.test(t)}l(Mu,"needIndentIndicator");var Pb=1,kh=2,zb=3,qb=4,li=5;function jb(t,e,r,i,a,n,s,o){var c,h=0,u=null,d=!1,p=!1,f=i!==-1,g=-1,m=Rb(gi(t,0))&&Nb(gi(t,t.length-1));if(e||s)for(c=0;c=65536?c+=2:c++){if(h=gi(t,c),!Ki(h))return li;m=m&&bh(h,u,o),u=h}else{for(c=0;c=65536?c+=2:c++){if(h=gi(t,c),h===ln)d=!0,f&&(p=p||c-g-1>i&&t[g+1]!==" ",g=c);else if(!Ki(h))return li;m=m&&bh(h,u,o),u=h}p=p||f&&c-g-1>i&&t[g+1]!==" "}return!d&&!p?m&&!s&&!a(t)?Pb:n===hn?li:kh:r>9&&Mu(t)?li:s?n===hn?li:kh:p?qb:zb}l(jb,"chooseScalarStyle");function Wb(t,e,r,i,a){t.dump=(function(){if(e.length===0)return t.quotingType===hn?'""':"''";if(!t.noCompatMode&&(p3.indexOf(e)!==-1||f3.test(e)))return t.quotingType===hn?'"'+e+'"':"'"+e+"'";var n=t.indent*Math.max(1,r),s=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-n),o=i||t.flowLevel>-1&&r>=t.flowLevel;function c(h){return Ib(t,h)}switch(l(c,"testAmbiguity"),jb(e,o,t.indent,s,c,t.quotingType,t.forceQuotes&&!i,a)){case Pb:return e;case kh:return"'"+e.replace(/'/g,"''")+"'";case zb:return"|"+Ch(e,t.indent)+wh(yh(e,n));case qb:return">"+Ch(e,t.indent)+wh(yh(Hb(e,s),n));case li:return'"'+Ub(e)+'"';default:throw new se("impossible error: invalid scalar style")}})()}l(Wb,"writeScalar");function Ch(t,e){var r=Mu(t)?String(e):"",i=t[t.length-1]===` `,a=i&&(t[t.length-2]===` `||t===` `),n=a?"+":i?"":"-";return r+n+` `}l(Ch,"blockHeader");function wh(t){return t[t.length-1]===` `?t.slice(0,-1):t}l(wh,"dropEndingNewline");function Hb(t,e){for(var r=/(\n+)([^\n]*)/g,i=(function(){var h=t.indexOf(` `);return h=h!==-1?h:t.length,r.lastIndex=h,$h(t.slice(0,h),e)})(),a=t[0]===` `||t[0]===" ",n,s;s=r.exec(t);){var o=s[1],c=s[2];n=c[0]===" ",i+=o+(!a&&!n&&c!==""?` `:"")+$h(c,e),a=n}return i}l(Hb,"foldString");function $h(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,i,a=0,n,s=0,o=0,c="";i=r.exec(t);)o=i.index,o-a>e&&(n=s>a?s:o,c+=` `+t.slice(a,n),a=n+1),s=o;return c+=` `,t.length-a>e&&s>a?c+=t.slice(a,s)+` `+t.slice(s+1):c+=t.slice(a),c.slice(1)}l($h,"foldLine");function Ub(t){for(var e="",r=0,i,a=0;a=65536?a+=2:a++)r=gi(t,a),i=Jt[r],!i&&Ki(r)?(e+=t[a],r>=65536&&(e+=t[a+1])):e+=i||Ob(r);return e}l(Ub,"escapeString");function Yb(t,e,r){var i="",a=t.tag,n,s,o;for(n=0,s=r.length;n"u"&&Ie(t,e,null,!1,!1))&&(i!==""&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=a,t.dump="["+i+"]"}l(Yb,"writeFlowSequence");function _h(t,e,r,i){var a="",n=t.tag,s,o,c;for(s=0,o=r.length;s"u"&&Ie(t,e+1,null,!0,!0,!1,!0))&&((!i||a!=="")&&(a+=Uo(t,e)),t.dump&&ln===t.dump.charCodeAt(0)?a+="-":a+="- ",a+=t.dump);t.tag=n,t.dump=a||"[]"}l(_h,"writeBlockSequence");function Vb(t,e,r){var i="",a=t.tag,n=Object.keys(r),s,o,c,h,u;for(s=0,o=n.length;s1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Ie(t,e,h,!1,!1)&&(u+=t.dump,i+=u));t.tag=a,t.dump="{"+i+"}"}l(Vb,"writeFlowMapping");function Gb(t,e,r,i){var a="",n=t.tag,s=Object.keys(r),o,c,h,u,d,p;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new se("sortKeys must be a boolean or a function");for(o=0,c=s.length;o1024,d&&(t.dump&&ln===t.dump.charCodeAt(0)?p+="?":p+="? "),p+=t.dump,d&&(p+=Uo(t,e)),Ie(t,e+1,u,!0,d)&&(t.dump&&ln===t.dump.charCodeAt(0)?p+=":":p+=": ",p+=t.dump,a+=p));t.tag=n,t.dump=a||"{}"}l(Gb,"writeBlockMapping");function vh(t,e,r){var i,a,n,s,o,c;for(a=r?t.explicitTypes:t.implicitTypes,n=0,s=a.length;n tag resolver accepts not "'+c+'" style');t.dump=i}return!0}return!1}l(vh,"detectType");function Ie(t,e,r,i,a,n,s){t.tag=null,t.dump=r,vh(t,r,!1)||vh(t,r,!0);var o=Sb.call(t.dump),c=i,h;i&&(i=t.flowLevel<0||t.flowLevel>e);var u=o==="[object Object]"||o==="[object Array]",d,p;if(u&&(d=t.duplicates.indexOf(r),p=d!==-1),(t.tag!==null&&t.tag!=="?"||p||t.indent!==2&&e>0)&&(a=!1),p&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(u&&p&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),o==="[object Object]")i&&Object.keys(t.dump).length!==0?(Gb(t,e,t.dump,a),p&&(t.dump="&ref_"+d+t.dump)):(Vb(t,e,t.dump),p&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object Array]")i&&t.dump.length!==0?(t.noArrayIndent&&!s&&e>0?_h(t,e-1,t.dump,a):_h(t,e,t.dump,a),p&&(t.dump="&ref_"+d+t.dump)):(Yb(t,e,t.dump),p&&(t.dump="&ref_"+d+" "+t.dump));else if(o==="[object String]")t.tag!=="?"&&Wb(t,t.dump,e,n,c);else{if(o==="[object Undefined]"||t.skipInvalid)return!1;throw new se("unacceptable kind of an object to dump "+o)}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}l(Ie,"writeNode");function Xb(t,e){var r=[],i=[],a,n;for(Yo(t,r,i),a=0,n=i.length;aArray.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),k3=l(t=>({x:l(function(e,r,i){let a=0,n=vt(i[0]).x=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Vt,t.arrowTypeEnd)){let{angle:f,deltaX:g}=$a(i[i.length-1],i[i.length-2]);a=Vt[t.arrowTypeEnd]*Math.cos(f)*(g>=0?1:-1)}let s=Math.abs(vt(e).x-vt(i[i.length-1]).x),o=Math.abs(vt(e).y-vt(i[i.length-1]).y),c=Math.abs(vt(e).x-vt(i[0]).x),h=Math.abs(vt(e).y-vt(i[0]).y),u=Vt[t.arrowTypeStart],d=Vt[t.arrowTypeEnd],p=1;if(s0&&o0&&h=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Vt,t.arrowTypeEnd)){let{angle:f,deltaY:g}=$a(i[i.length-1],i[i.length-2]);a=Vt[t.arrowTypeEnd]*Math.abs(Math.sin(f))*(g>=0?1:-1)}let s=Math.abs(vt(e).y-vt(i[i.length-1]).y),o=Math.abs(vt(e).x-vt(i[i.length-1]).x),c=Math.abs(vt(e).y-vt(i[0]).y),h=Math.abs(vt(e).x-vt(i[0]).x),u=Vt[t.arrowTypeStart],d=Vt[t.arrowTypeEnd],p=1;if(s0&&o0&&h{let e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0,i=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),C3=l(t=>{let{handDrawnSeed:e}=xt();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),aa=l(t=>{let e=w3([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),w3=l(t=>{let e=new Map;return t.forEach(r=>{let[i,a]=r.split(":");e.set(i.trim(),a?.trim())}),e},"styles2Map"),Zb=l(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"),K=l(t=>{let{stylesArray:e}=aa(t),r=[],i=[],a=[],n=[];return e.forEach(s=>{let o=s[0];Zb(o)?r.push(s.join(":")+" !important"):(i.push(s.join(":")+" !important"),o.includes("stroke")&&a.push(s.join(":")+" !important"),o==="fill"&&n.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:e,borderStyles:a,backgroundStyles:n}},"styles2String"),J=l((t,e)=>{let{themeVariables:r,handDrawnSeed:i}=xt(),{nodeBorder:a,mainBkg:n}=r,{stylesMap:s}=aa(t);return Object.assign({roughness:.7,fill:s.get("fill")||n,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||a,seed:i,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:$3(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),$3=l(t=>{if(!t)return[0,0];let e=t.trim().split(/\s+/).map(Number);if(e.length===1){let a=isNaN(e[0])?0:e[0];return[a,a]}let r=isNaN(e[0])?0:e[0],i=isNaN(e[1])?0:e[1];return[r,i]},"getStrokeDashArray"),_3=ec(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BLANK_URL=t.relativeFirstCharacters=t.whitespaceEscapeCharsRegex=t.urlSchemeRegex=t.ctrlCharactersRegex=t.htmlCtrlEntityRegex=t.htmlEntitiesRegex=t.invalidProtocolRegex=void 0,t.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,t.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,t.htmlCtrlEntityRegex=/&(newline|tab);/gi,t.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,t.urlSchemeRegex=/^.+(:|:)/gim,t.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,t.relativeFirstCharacters=[".","/"],t.BLANK_URL="about:blank"}),v3=ec(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeUrl=void 0;var e=_3();function r(o){return e.relativeFirstCharacters.indexOf(o[0])>-1}l(r,"isRelativeUrlWithoutProtocol");function i(o){var c=o.replace(e.ctrlCharactersRegex,"");return c.replace(e.htmlEntitiesRegex,function(h,u){return String.fromCharCode(u)})}l(i,"decodeHtmlCharacters");function a(o){return URL.canParse(o)}l(a,"isValidUrl");function n(o){try{return decodeURIComponent(o)}catch{return o}}l(n,"decodeURI");function s(o){if(!o)return e.BLANK_URL;var c,h=n(o.trim());do h=i(h).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),h=n(h),c=h.match(e.ctrlCharactersRegex)||h.match(e.htmlEntitiesRegex)||h.match(e.htmlCtrlEntityRegex)||h.match(e.whitespaceEscapeCharsRegex);while(c&&c.length>0);var u=h;if(!u)return e.BLANK_URL;if(r(u))return u;var d=u.trimStart(),p=d.match(e.urlSchemeRegex);if(!p)return u;var f=p[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var g=d.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return g;if(f==="http:"||f==="https:"){if(!a(g))return e.BLANK_URL;var m=new URL(g);return m.protocol=m.protocol.toLowerCase(),m.hostname=m.hostname.toLowerCase(),m.toString()}return g}l(s,"sanitizeUrl"),t.sanitizeUrl=s}),S3=typeof global=="object"&&global&&global.Object===Object&&global,Qb=S3,T3=typeof self=="object"&&self&&self.Object===Object&&self,M3=Qb||T3||Function("return this")(),Re=M3,B3=Re.Symbol,Vo=B3,Jb=Object.prototype,A3=Jb.hasOwnProperty,L3=Jb.toString,ma=Vo?Vo.toStringTag:void 0;function Kb(t){var e=A3.call(t,ma),r=t[ma];try{t[ma]=void 0;var i=!0}catch{}var a=L3.call(t);return i&&(e?t[ma]=r:delete t[ma]),a}l(Kb,"getRawTag");var F3=Kb,E3=Object.prototype,O3=E3.toString;function t2(t){return O3.call(t)}l(t2,"objectToString");var D3=t2,I3="[object Null]",R3="[object Undefined]",hp=Vo?Vo.toStringTag:void 0;function e2(t){return t==null?t===void 0?R3:I3:hp&&hp in Object(t)?F3(t):D3(t)}l(e2,"baseGetTag");var na=e2;function r2(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}l(r2,"isObject");var qr=r2,N3="[object AsyncFunction]",P3="[object Function]",z3="[object GeneratorFunction]",q3="[object Proxy]";function i2(t){if(!qr(t))return!1;var e=na(t);return e==P3||e==z3||e==N3||e==q3}l(i2,"isFunction");var Au=i2,j3=Re["__core-js_shared__"],ml=j3,cp=(function(){var t=/[^.]+$/.exec(ml&&ml.keys&&ml.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function a2(t){return!!cp&&cp in t}l(a2,"isMasked");var W3=a2,H3=Function.prototype,U3=H3.toString;function n2(t){if(t!=null){try{return U3.call(t)}catch{}try{return t+""}catch{}}return""}l(n2,"toSource");var jr=n2,Y3=/[\\^$.*+?()[\]{}|]/g,V3=/^\[object .+?Constructor\]$/,G3=Function.prototype,X3=Object.prototype,Z3=G3.toString,Q3=X3.hasOwnProperty,J3=RegExp("^"+Z3.call(Q3).replace(Y3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function o2(t){if(!qr(t)||W3(t))return!1;var e=Au(t)?J3:V3;return e.test(jr(t))}l(o2,"baseIsNative");var K3=o2;function s2(t,e){return t?.[e]}l(s2,"getValue");var tM=s2;function l2(t,e){var r=tM(t,e);return K3(r)?r:void 0}l(l2,"getNative");var Wr=l2,eM=Wr(Object,"create"),un=eM;function h2(){this.__data__=un?un(null):{},this.size=0}l(h2,"hashClear");var rM=h2;function c2(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}l(c2,"hashDelete");var iM=c2,aM="__lodash_hash_undefined__",nM=Object.prototype,oM=nM.hasOwnProperty;function u2(t){var e=this.__data__;if(un){var r=e[t];return r===aM?void 0:r}return oM.call(e,t)?e[t]:void 0}l(u2,"hashGet");var sM=u2,lM=Object.prototype,hM=lM.hasOwnProperty;function d2(t){var e=this.__data__;return un?e[t]!==void 0:hM.call(e,t)}l(d2,"hashHas");var cM=d2,uM="__lodash_hash_undefined__";function p2(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=un&&e===void 0?uM:e,this}l(p2,"hashSet");var dM=p2;function Hr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}l(b2,"listCacheHas");var xM=b2;function k2(t,e){var r=this.__data__,i=Es(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}l(k2,"listCacheSet");var bM=k2;function Ur(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=r5}l(Z2,"isLength");var Q2=Z2;function J2(t){return t!=null&&Q2(t.length)&&!Au(t)}l(J2,"isArrayLike");var Ns=J2;function K2(t){return Bn(t)&&Ns(t)}l(K2,"isArrayLikeObject");var i5=K2;function tk(){return!1}l(tk,"stubFalse");var a5=tk,ek=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xp=ek&&typeof module=="object"&&module&&!module.nodeType&&module,n5=xp&&xp.exports===ek,bp=n5?Re.Buffer:void 0,o5=bp?bp.isBuffer:void 0,s5=o5||a5,Ou=s5,l5="[object Object]",h5=Function.prototype,c5=Object.prototype,rk=h5.toString,u5=c5.hasOwnProperty,d5=rk.call(Object);function ik(t){if(!Bn(t)||na(t)!=l5)return!1;var e=H2(t);if(e===null)return!0;var r=u5.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&rk.call(r)==d5}l(ik,"isPlainObject");var p5=ik,f5="[object Arguments]",g5="[object Array]",m5="[object Boolean]",y5="[object Date]",x5="[object Error]",b5="[object Function]",k5="[object Map]",C5="[object Number]",w5="[object Object]",$5="[object RegExp]",_5="[object Set]",v5="[object String]",S5="[object WeakMap]",T5="[object ArrayBuffer]",M5="[object DataView]",B5="[object Float32Array]",A5="[object Float64Array]",L5="[object Int8Array]",F5="[object Int16Array]",E5="[object Int32Array]",O5="[object Uint8Array]",D5="[object Uint8ClampedArray]",I5="[object Uint16Array]",R5="[object Uint32Array]",$t={};$t[B5]=$t[A5]=$t[L5]=$t[F5]=$t[E5]=$t[O5]=$t[D5]=$t[I5]=$t[R5]=!0;$t[f5]=$t[g5]=$t[T5]=$t[m5]=$t[M5]=$t[y5]=$t[x5]=$t[b5]=$t[k5]=$t[C5]=$t[w5]=$t[$5]=$t[_5]=$t[v5]=$t[S5]=!1;function ak(t){return Bn(t)&&Q2(t.length)&&!!$t[na(t)]}l(ak,"baseIsTypedArray");var N5=ak;function nk(t){return function(e){return t(e)}}l(nk,"baseUnary");var P5=nk,ok=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ra=ok&&typeof module=="object"&&module&&!module.nodeType&&module,z5=Ra&&Ra.exports===ok,yl=z5&&Qb.process,q5=(function(){try{var t=Ra&&Ra.require&&Ra.require("util").types;return t||yl&&yl.binding&&yl.binding("util")}catch{}})(),kp=q5,Cp=kp&&kp.isTypedArray,j5=Cp?P5(Cp):N5,Du=j5;function sk(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}l(sk,"safeGet");var Th=sk,W5=Object.prototype,H5=W5.hasOwnProperty;function lk(t,e,r){var i=t[e];(!(H5.call(t,e)&&Fs(i,r))||r===void 0&&!(e in t))&&Eu(t,e,r)}l(lk,"assignValue");var U5=lk;function hk(t,e,r,i){var a=!r;r||(r={});for(var n=-1,s=e.length;++n-1&&t%1==0&&t0){if(++e>=cB)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}l(_k,"shortOut");var pB=_k,fB=pB(hB),gB=fB;function vk(t,e){return gB(sB(t,e,Ck),t+"")}l(vk,"baseRest");var mB=vk;function Sk(t,e,r){if(!qr(r))return!1;var i=typeof e;return(i=="number"?Ns(r)&&dk(e,r.length):i=="string"&&e in r)?Fs(r[e],t):!1}l(Sk,"isIterateeCall");var yB=Sk;function Tk(t){return mB(function(e,r){var i=-1,a=r.length,n=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(n=t.length>3&&typeof n=="function"?(a--,n):void 0,s&&yB(r[0],r[1],s)&&(n=a<3?void 0:n,a=1),e=Object(e);++io.args);Io(s),i=Lt(i,[...s])}else i=r.args;if(!i)return;let a=fu(t,e),n="config";return i[n]!==void 0&&(a==="flowchart-v2"&&(a="flowchart"),i[a]=i[n],delete i[n]),i},"detectInit"),Mk=l(function(t,e=null){try{let r=new RegExp(`[%]{2}(?![{]${_B.source})(?=[}][%]{2}).* `,"ig");t=t.trim().replace(r,"").replace(/'/gm,'"'),R.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let i,a=[];for(;(i=Ea.exec(t))!==null;)if(i.index===Ea.lastIndex&&Ea.lastIndex++,i&&!e||e&&i[1]?.match(e)||e&&i[2]?.match(e)){let n=i[1]?i[1]:i[2],s=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;a.push({type:n,args:s})}return a.length===0?{type:t,args:null}:a.length===1?a[0]:a}catch(r){return R.error(`ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),SB=l(function(t){return t.replace(Ea,"")},"removeDirectives"),TB=l(function(t,e){for(let[r,i]of e.entries())if(i.match(t))return r;return-1},"isSubstringInArray");function Ru(t,e){if(!t)return e;let r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return $B[r]??e}l(Ru,"interpolateToCurve");function Bk(t,e){let r=t.trim();if(r)return e.securityLevel!=="loose"?(0,CB.sanitizeUrl)(r):r}l(Bk,"formatUrl");var MB=l((t,...e)=>{let r=t.split("."),i=r.length-1,a=r[i],n=window;for(let s=0;s{r+=Nu(a,e),e=a});let i=r/2;return Pu(t,i)}l(Ak,"traverseEdge");function Lk(t){return t.length===1?t[0]:Ak(t)}l(Lk,"calcLabelPosition");var $p=l((t,e=2)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),Pu=l((t,e)=>{let r,i=e;for(let a of t){if(r){let n=Nu(a,r);if(n===0)return r;if(n=1)return{x:a.x,y:a.y};if(s>0&&s<1)return{x:$p((1-s)*r.x+s*a.x,5),y:$p((1-s)*r.y+s*a.y,5)}}}r=a}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),BB=l((t,e,r)=>{R.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());let i=Pu(e,25),a=t?10:5,n=Math.atan2(e[0].y-i.y,e[0].x-i.x),s={x:0,y:0};return s.x=Math.sin(n)*a+(e[0].x+i.x)/2,s.y=-Math.cos(n)*a+(e[0].y+i.y)/2,s},"calcCardinalityPosition");function Fk(t,e,r){let i=structuredClone(r);R.info("our points",i),e!=="start_left"&&e!=="start_right"&&i.reverse();let a=25+t,n=Pu(i,a),s=10+t*.5,o=Math.atan2(i[0].y-n.y,i[0].x-n.x),c={x:0,y:0};return e==="start_left"?(c.x=Math.sin(o+Math.PI)*s+(i[0].x+n.x)/2,c.y=-Math.cos(o+Math.PI)*s+(i[0].y+n.y)/2):e==="end_right"?(c.x=Math.sin(o-Math.PI)*s+(i[0].x+n.x)/2-5,c.y=-Math.cos(o-Math.PI)*s+(i[0].y+n.y)/2-5):e==="end_left"?(c.x=Math.sin(o)*s+(i[0].x+n.x)/2-5,c.y=-Math.cos(o)*s+(i[0].y+n.y)/2-5):(c.x=Math.sin(o)*s+(i[0].x+n.x)/2,c.y=-Math.cos(o)*s+(i[0].y+n.y)/2),c}l(Fk,"calcTerminalLabelPosition");function Ek(t){let e="",r="";for(let i of t)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":e=e+i+";");return{style:e,labelStyle:r}}l(Ek,"getStylesFromArray");var _p=0,AB=l(()=>(_p++,"id-"+Math.random().toString(36).substr(2,12)+"-"+_p),"generateId");function Ok(t){let e="",r="0123456789abcdef",i=r.length;for(let a=0;aOk(t.length),"random"),FB=l(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"),EB=l(function(t,e){let r=e.text.replace(ia.lineBreakRegex," "),[,i]=Ps(e.fontSize),a=t.append("text");a.attr("x",e.x),a.attr("y",e.y),a.style("text-anchor",e.anchor),a.style("font-family",e.fontFamily),a.style("font-size",i),a.style("font-weight",e.fontWeight),a.attr("fill",e.fill),e.class!==void 0&&a.attr("class",e.class);let n=a.append("tspan");return n.attr("x",e.x+e.textMargin*2),n.attr("fill",e.fill),n.text(r),a},"drawSimpleText"),OB=Fu((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),ia.lineBreakRegex.test(t)))return t;let i=t.split(" ").filter(Boolean),a=[],n="";return i.forEach((s,o)=>{let c=Qe(`${s} `,r),h=Qe(n,r);if(c>e){let{hyphenatedStrings:u,remainingWord:d}=DB(s,e,"-",r);a.push(n,...u),n=d}else h+c>=e?(a.push(n),n=s):n=[n,s].filter(Boolean).join(" ");o+1===i.length&&a.push(n)}),a.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),DB=Fu((t,e,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);let a=[...t],n=[],s="";return a.forEach((o,c)=>{let h=`${s}${o}`;if(Qe(h,i)>=e){let u=c+1,d=a.length===u,p=`${h}${r}`;n.push(d?h:p),s=""}else s=h}),{hyphenatedStrings:n,remainingWord:s}},(t,e,r="-",i)=>`${t}${e}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Dk(t,e){return zu(t,e).height}l(Dk,"calculateTextHeight");function Qe(t,e){return zu(t,e).width}l(Qe,"calculateTextWidth");var zu=Fu((t,e)=>{let{fontSize:r=12,fontFamily:i="Arial",fontWeight:a=400}=e;if(!t)return{width:0,height:0};let[,n]=Ps(r),s=["sans-serif",i],o=t.split(ia.lineBreakRegex),c=[],h=pt("body");if(!h.remove)return{width:0,height:0,lineHeight:0};let u=h.append("svg");for(let p of s){let f=0,g={width:0,height:0,lineHeight:0};for(let m of o){let y=FB();y.text=m||wB;let x=EB(u,y).style("font-size",n).style("font-weight",a).style("font-family",p),b=(x._groups||x)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),f=Math.round(b.height),g.height+=f,g.lineHeight=Math.round(Math.max(g.lineHeight,f))}c.push(g)}u.remove();let d=isNaN(c[1].height)||isNaN(c[1].width)||isNaN(c[1].lineHeight)||c[0].height>c[1].height&&c[0].width>c[1].width&&c[0].lineHeight>c[1].lineHeight?0:1;return c[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),Li,IB=(Li=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},l(Li,"InitIDGenerator"),Li),Yn,RB=l(function(t){return Yn=Yn||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Yn.innerHTML=t,unescape(Yn.textContent)},"entityDecode");function qu(t){return"str"in t}l(qu,"isDetailedError");var NB=l((t,e,r,i)=>{if(!i)return;let a=t.node()?.getBBox();a&&t.append("text").text(i).attr("text-anchor","middle").attr("x",a.x+a.width/2).attr("y",-r).attr("class",e)},"insertTitle"),Ps=l(t=>{if(typeof t=="number")return[t,t+"px"];let e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ju(t,e){return kB({},t,e)}l(ju,"cleanAndMerge");var we={assignWithDepth:Lt,wrapLabel:OB,calculateTextHeight:Dk,calculateTextWidth:Qe,calculateTextDimensions:zu,cleanAndMerge:ju,detectInit:vB,detectDirective:Mk,isSubstringInArray:TB,interpolateToCurve:Ru,calcLabelPosition:Lk,calcCardinalityPosition:BB,calcTerminalLabelPosition:Fk,formatUrl:Bk,getStylesFromArray:Ek,generateId:AB,random:LB,runFunc:MB,entityDecode:RB,insertTitle:NB,isLabelCoordinateInPath:Ik,parseFontSize:Ps,InitIDGenerator:IB},PB=l(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){let i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),e},"encodeEntities"),Gr=l(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),cE=l((t,e,{counter:r=0,prefix:i,suffix:a},n)=>n||`${i?`${i}_`:""}${t}_${e}_${r}${a?`_${a}`:""}`,"getEdgeId");function Zt(t){return t??null}l(Zt,"handleUndefinedAttr");function Ik(t,e){let r=Math.round(t.x),i=Math.round(t.y),a=e.replace(/(\d+\.\d+)/g,n=>Math.round(parseFloat(n)).toString());return a.includes(r.toString())||a.includes(i.toString())}l(Ik,"isLabelCoordinateInPath");var zB=Object.freeze({left:0,top:0,width:16,height:16}),Qo=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Rk=Object.freeze({...zB,...Qo}),qB=Object.freeze({...Rk,body:"",hidden:!1}),jB=Object.freeze({width:null,height:null}),WB=Object.freeze({...jB,...Qo}),HB=l((t,e,r,i="")=>{let a=t.split(":");if(t.slice(0,1)==="@"){if(a.length<2||a.length>3)return null;i=a.shift().slice(1)}if(a.length>3||!a.length)return null;if(a.length>1){let o=a.pop(),c=a.pop(),h={provider:a.length>0?a[0]:i,prefix:c,name:o};return e&&!xl(h)?null:h}let n=a[0],s=n.split("-");if(s.length>1){let o={provider:i,prefix:s.shift(),name:s.join("-")};return e&&!xl(o)?null:o}if(r&&i===""){let o={provider:i,prefix:"",name:n};return e&&!xl(o,r)?null:o}return null},"stringToIcon"),xl=l((t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1,"validateIconName");function Nk(t,e){let r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);let i=((t.rotate||0)+(e.rotate||0))%4;return i&&(r.rotate=i),r}l(Nk,"mergeIconTransformations");function Mh(t,e){let r=Nk(t,e);for(let i in qB)i in Qo?i in t&&!(i in r)&&(r[i]=Qo[i]):i in e?r[i]=e[i]:i in t&&(r[i]=t[i]);return r}l(Mh,"mergeIconData");function Pk(t,e){let r=t.icons,i=t.aliases||Object.create(null),a=Object.create(null);function n(s){if(r[s])return a[s]=[];if(!(s in a)){a[s]=null;let o=i[s]&&i[s].parent,c=o&&n(o);c&&(a[s]=[o].concat(c))}return a[s]}return l(n,"resolve"),(e||Object.keys(r).concat(Object.keys(i))).forEach(n),a}l(Pk,"getIconsTree");function Bh(t,e,r){let i=t.icons,a=t.aliases||Object.create(null),n={};function s(o){n=Mh(i[o]||a[o],n)}return l(s,"parse"),s(e),r.forEach(s),Mh(t,n)}l(Bh,"internalGetIconData");function zk(t,e){if(t.icons[e])return Bh(t,e,[]);let r=Pk(t,[e])[e];return r?Bh(t,e,r):null}l(zk,"getIconData");var UB=/(-?[0-9.]*[0-9]+[0-9.]*)/g,YB=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ah(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;let i=t.split(UB);if(i===null||!i.length)return t;let a=[],n=i.shift(),s=YB.test(n);for(;;){if(s){let o=parseFloat(n);isNaN(o)?a.push(n):a.push(Math.ceil(o*e*r)/r)}else a.push(n);if(n=i.shift(),n===void 0)return a.join("");s=!s}}l(Ah,"calculateSize");function qk(t,e="defs"){let r="",i=t.indexOf("<"+e);for(;i>=0;){let a=t.indexOf(">",i),n=t.indexOf("",n);if(s===-1)break;r+=t.slice(a+1,n).trim(),t=t.slice(0,i).trim()+t.slice(s+1)}return{defs:r,content:t}}l(qk,"splitSVGDefs");function jk(t,e){return t?""+t+""+e:e}l(jk,"mergeDefsAndContent");function Wk(t,e,r){let i=qk(t);return jk(i.defs,e+i.content+r)}l(Wk,"wrapSVGContent");var VB=l(t=>t==="unset"||t==="undefined"||t==="none","isUnsetKeyword");function Hk(t,e){let r={...Rk,...t},i={...WB,...e},a={left:r.left,top:r.top,width:r.width,height:r.height},n=r.body;[r,i].forEach(m=>{let y=[],x=m.hFlip,b=m.vFlip,k=m.rotate;x?b?k+=2:(y.push("translate("+(a.width+a.left).toString()+" "+(0-a.top).toString()+")"),y.push("scale(-1 1)"),a.top=a.left=0):b&&(y.push("translate("+(0-a.left).toString()+" "+(a.height+a.top).toString()+")"),y.push("scale(1 -1)"),a.top=a.left=0);let _;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:_=a.height/2+a.top,y.unshift("rotate(90 "+_.toString()+" "+_.toString()+")");break;case 2:y.unshift("rotate(180 "+(a.width/2+a.left).toString()+" "+(a.height/2+a.top).toString()+")");break;case 3:_=a.width/2+a.left,y.unshift("rotate(-90 "+_.toString()+" "+_.toString()+")");break}k%2===1&&(a.left!==a.top&&(_=a.left,a.left=a.top,a.top=_),a.width!==a.height&&(_=a.width,a.width=a.height,a.height=_)),y.length&&(n=Wk(n,'',""))});let s=i.width,o=i.height,c=a.width,h=a.height,u,d;s===null?(d=o===null?"1em":o==="auto"?h:o,u=Ah(d,c/h)):(u=s==="auto"?c:s,d=o===null?Ah(u,h/c):o==="auto"?h:o);let p={},f=l((m,y)=>{VB(y)||(p[m]=y.toString())},"setAttr");f("width",u),f("height",d);let g=[a.left,a.top,c,h];return p.viewBox=g.join(" "),{attributes:p,viewBox:g,body:n}}l(Hk,"iconToSVG");var GB=/\sid="(\S+)"/g,XB="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),ZB=0;function Uk(t,e=XB){let r=[],i;for(;i=GB.exec(t);)r.push(i[1]);if(!r.length)return t;let a="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(n=>{let s=typeof e=="function"?e(n):e+(ZB++).toString(),o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+o+')([")]|\\.[a-z])',"g"),"$1"+s+a+"$3")}),t=t.replace(new RegExp(a,"g"),""),t}l(Uk,"replaceIDs");function Yk(t,e){let r=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let i in e)r+=" "+i+'="'+e[i]+'"';return'"+t+""}l(Yk,"iconToHTML");var QB={body:'?',height:80,width:80},Lh=new Map,Vk=new Map,JB=l(t=>{for(let e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(R.debug("Registering icon pack:",e.name),"loader"in e)Vk.set(e.name,e.loader);else if("icons"in e)Lh.set(e.name,e.icons);else throw R.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Gk=l(async(t,e)=>{let r=HB(t,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${t}`);let i=r.prefix||e;if(!i)throw new Error(`Icon name must contain a prefix: ${t}`);let a=Lh.get(i);if(!a){let s=Vk.get(i);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{a={...await s(),prefix:i},Lh.set(i,a)}catch(o){throw R.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}let n=zk(a,r.name);if(!n)throw new Error(`Icon not found: ${t}`);return n},"getRegisteredIconData"),KB=l(async t=>{try{return await Gk(t),!0}catch{return!1}},"isIconAvailable"),An=l(async(t,e,r)=>{let i;try{i=await Gk(t,e?.fallbackPrefix)}catch(s){R.error(s),i=QB}let a=Hk(i,e),n=Yk(Uk(a.body),{...a.attributes,...r});return ge(n,Gt())},"getIconSVG");function Wu(t){for(var e=[],r=1;rnull,"exec")};function yt(t,e=""){let r=typeof t=="string"?t:t.source,i={replace:l((a,n)=>{let s=typeof n=="string"?n:n.source;return s=s.replace(re.caret,"$1"),r=r.replace(a,s),i},"replace"),getRegex:l(()=>new RegExp(r,e),"getRegex")};return i}l(yt,"h");var re={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:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,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:l(t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),"listItemRegex"),nextBulletRegex:l(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),"nextBulletRegex"),hrRegex:l(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),"hrRegex"),fencesBeginRegex:l(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),"fencesBeginRegex"),headingBeginRegex:l(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),"headingBeginRegex"),htmlBeginRegex:l(t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),"htmlBeginRegex")},tA=/^(?:[ \t]*(?:\n|$))+/,eA=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,rA=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ln=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,iA=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Uu=/(?:[*+-]|\d{1,9}[.)])/,Xk=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Zk=yt(Xk).replace(/bull/g,Uu).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(),aA=yt(Xk).replace(/bull/g,Uu).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(),Yu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nA=/^[^\n]+/,Vu=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,oA=yt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Vu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sA=yt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Uu).getRegex(),qs="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",Gu=/|$))/,lA=yt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Gu).replace("tag",qs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Qk=yt(Yu).replace("hr",Ln).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",qs).getRegex(),hA=yt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Qk).getRegex(),Xu={blockquote:hA,code:eA,def:oA,fences:rA,heading:iA,hr:Ln,html:lA,lheading:Zk,list:sA,newline:tA,paragraph:Qk,table:Na,text:nA},vp=yt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ln).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",qs).getRegex(),cA={...Xu,lheading:aA,table:vp,paragraph:yt(Yu).replace("hr",Ln).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",vp).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",qs).getRegex()},uA={...Xu,html:yt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gu).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Na,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:yt(Yu).replace("hr",Ln).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Zk).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},dA=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,pA=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Jk=/^( {2,}|\\)\n(?!\s*$)/,fA=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,eC=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,bA=yt(eC,"u").replace(/punct/g,js).getRegex(),kA=yt(eC,"u").replace(/punct/g,tC).getRegex(),rC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",CA=yt(rC,"gu").replace(/notPunctSpace/g,Kk).replace(/punctSpace/g,Zu).replace(/punct/g,js).getRegex(),wA=yt(rC,"gu").replace(/notPunctSpace/g,yA).replace(/punctSpace/g,mA).replace(/punct/g,tC).getRegex(),$A=yt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Kk).replace(/punctSpace/g,Zu).replace(/punct/g,js).getRegex(),_A=yt(/\\(punct)/,"gu").replace(/punct/g,js).getRegex(),vA=yt(/^<(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(),SA=yt(Gu).replace("(?:-->|$)","-->").getRegex(),TA=yt("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",SA).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,MA=yt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Jo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),iC=yt(/^!?\[(label)\]\[(ref)\]/).replace("label",Jo).replace("ref",Vu).getRegex(),aC=yt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Vu).getRegex(),BA=yt("reflink|nolink(?!\\()","g").replace("reflink",iC).replace("nolink",aC).getRegex(),Qu={_backpedal:Na,anyPunctuation:_A,autolink:vA,blockSkip:xA,br:Jk,code:pA,del:Na,emStrongLDelim:bA,emStrongRDelimAst:CA,emStrongRDelimUnd:$A,escape:dA,link:MA,nolink:aC,punctuation:gA,reflink:iC,reflinkSearch:BA,tag:TA,text:fA,url:Na},AA={...Qu,link:yt(/^!?\[(label)\]\((.*?)\)/).replace("label",Jo).getRegex(),reflink:yt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jo).getRegex()},Fh={...Qu,emStrongRDelimAst:wA,emStrongLDelim:kA,url:yt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Sp=l(t=>FA[t],"ke");function ke(t,e){if(e){if(re.escapeTest.test(t))return t.replace(re.escapeReplace,Sp)}else if(re.escapeTestNoEncode.test(t))return t.replace(re.escapeReplaceNoEncode,Sp);return t}l(ke,"w");function Eh(t){try{t=encodeURI(t).replace(re.percentDecode,"%")}catch{return null}return t}l(Eh,"J");function Oh(t,e){let r=t.replace(re.findPipe,(n,s,o)=>{let c=!1,h=s;for(;--h>=0&&o[h]==="\\";)c=!c;return c?"|":" |"}),i=r.split(re.splitPipe),a=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.length0?-2:-1}l(nC,"ge");function Dh(t,e,r,i,a){let n=e.href,s=e.title||null,o=t[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let c={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:n,title:s,text:o,tokens:i.inlineTokens(o)};return i.state.inLink=!1,c}l(Dh,"fe");function oC(t,e,r){let i=t.match(r.other.indentCodeCompensation);if(i===null)return e;let a=i[1];return e.split(` `).map(n=>{let s=n.match(r.other.beginningSpace);if(s===null)return n;let[o]=s;return o.length>=a.length?n.slice(a.length):n}).join(` `)}l(oC,"Je");var Fi,Ko=(Fi=class{options;rules;lexer;constructor(e){this.options=e||Xr}space(e){let r=this.rules.block.newline.exec(e);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(e){let r=this.rules.block.code.exec(e);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:hi(i,` `)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let i=r[0],a=oC(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:a}}}heading(e){let r=this.rules.block.heading.exec(e);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let a=hi(i,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(i=a.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){let r=this.rules.block.hr.exec(e);if(r)return{type:"hr",raw:hi(r[0],` `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let i=hi(r[0],` `).split(` `),a="",n="",s=[];for(;i.length>0;){let o=!1,c=[],h;for(h=0;h1,n={type:"list",raw:"",ordered:a,start:a?+i.slice(0,-1):"",loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:"[*+-]");let s=this.rules.other.listItemRegex(i),o=!1;for(;e;){let h=!1,u="",d="";if(!(r=s.exec(e))||this.rules.block.hr.test(e))break;u=r[0],e=e.substring(u.length);let p=r[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),f=e.split(` `,1)[0],g=!p.trim(),m=0;if(this.options.pedantic?(m=2,d=p.trimStart()):g?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=p.slice(m),m+=r[1].length),g&&this.rules.other.blankLine.test(f)&&(u+=f+` `,e=e.substring(f.length+1),h=!0),!h){let b=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),_=this.rules.other.fencesBeginRegex(m),C=this.rules.other.headingBeginRegex(m),$=this.rules.other.htmlBeginRegex(m);for(;e;){let S=e.split(` `,1)[0],D;if(f=S,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),D=f):D=f.replace(this.rules.other.tabCharGlobal," "),_.test(f)||C.test(f)||$.test(f)||b.test(f)||k.test(f))break;if(D.search(this.rules.other.nonSpaceChar)>=m||!f.trim())d+=` `+D.slice(m);else{if(g||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(p)||C.test(p)||k.test(p))break;d+=` `+f}!g&&!f.trim()&&(g=!0),u+=S+` `,e=e.substring(S.length+1),p=D.slice(m)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(o=!0));let y=null,x;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(x=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:u,task:!!y,checked:x,loose:!1,text:d,tokens:[]}),n.raw+=u}let c=n.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let h=0;hp.type==="space"),d=u.length>0&&u.some(p=>this.rules.other.anyLine.test(p.raw));n.loose=d}if(n.loose)for(let h=0;h({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[h]})));return s}}lheading(e){let r=this.rules.block.lheading.exec(e);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(e){let r=this.rules.block.paragraph.exec(e);if(r){let i=r[1].charAt(r[1].length-1)===` `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(e){let r=this.rules.block.text.exec(e);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(e){let r=this.rules.inline.escape.exec(e);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(e){let r=this.rules.inline.tag.exec(e);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(e){let r=this.rules.inline.link.exec(e);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let s=hi(i.slice(0,-1),"\\");if((i.length-s.length)%2===0)return}else{let s=nC(r[2],"()");if(s===-2)return;if(s>-1){let o=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,o).trim(),r[3]=""}}let a=r[2],n="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(a);s&&(a=s[1],n=s[3])}else n=r[3]?r[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?a=a.slice(1):a=a.slice(1,-1)),Dh(r,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(e,r){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let a=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=r[a.toLowerCase()];if(!n){let s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return Dh(i,n,i[0],this.lexer,this.rules)}}emStrong(e,r,i=""){let a=this.rules.inline.emStrongLDelim.exec(e);if(!(!a||a[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!i||this.rules.inline.punctuation.exec(i))){let n=[...a[0]].length-1,s,o,c=n,h=0,u=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,r=r.slice(-1*e.length+n);(a=u.exec(r))!=null;){if(s=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!s)continue;if(o=[...s].length,a[3]||a[4]){c+=o;continue}else if((a[5]||a[6])&&n%3&&!((n+o)%3)){h+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+h);let d=[...a[0]][0].length,p=e.slice(0,n+a.index+d+o);if(Math.min(n,o)%2){let g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}let f=p.slice(2,-2);return{type:"strong",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let r=this.rules.inline.code.exec(e);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(i),n=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return a&&n&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(e){let r=this.rules.inline.br.exec(e);if(r)return{type:"br",raw:r[0]}}del(e){let r=this.rules.inline.del.exec(e);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(e){let r=this.rules.inline.autolink.exec(e);if(r){let i,a;return r[2]==="@"?(i=r[1],a="mailto:"+i):(i=r[1],a=i),{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let r;if(r=this.rules.inline.url.exec(e)){let i,a;if(r[2]==="@")i=r[0],a="mailto:"+i;else{let n;do n=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(n!==r[0]);i=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let r=this.rules.inline.text.exec(e);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},l(Fi,"y"),Fi),or,He=(or=class{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Xr,this.options.tokenizer=this.options.tokenizer||new Ko,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:re,block:Vn.normal,inline:ya.normal};this.options.pedantic?(r.block=Vn.pedantic,r.inline=ya.pedantic):this.options.gfm&&(r.block=Vn.gfm,this.options.breaks?r.inline=ya.breaks:r.inline=ya.gfm),this.tokenizer.rules=r}static get rules(){return{block:Vn,inline:ya}}static lex(e,r){return new or(r).lex(e)}static lexInline(e,r){return new or(r).inlineTokens(e)}lex(e){e=e.replace(re.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let r=0;r(a=s.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let s=r.at(-1);a.raw.length===1&&s!==void 0?s.raw+=` `:r.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` `)?"":` `)+a.raw,s.text+=` `+a.text,this.inlineQueue.at(-1).src=s.text):r.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` `)?"":` `)+a.raw,s.text+=` `+a.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},r.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),r.push(a);continue}let n=e;if(this.options.extensions?.startBlock){let s=1/0,o=e.slice(1),c;this.options.extensions.startBlock.forEach(h=>{c=h.call({lexer:this},o),typeof c=="number"&&c>=0&&(s=Math.min(s,c))}),s<1/0&&s>=0&&(n=e.substring(0,s+1))}if(this.state.top&&(a=this.tokenizer.paragraph(n))){let s=r.at(-1);i&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(` `)?"":` `)+a.raw,s.text+=` `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(a),i=n.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let s=r.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(` `)?"":` `)+a.raw,s.text+=` `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(a);continue}if(e){let s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let i=e,a=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)o.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let n=!1,s="";for(;e;){n||(s=""),n=!1;let o;if(this.options.extensions?.inline?.some(h=>(o=h.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let h=r.at(-1);o.type==="text"&&h?.type==="text"?(h.raw+=o.raw,h.text+=o.text):r.push(o);continue}if(o=this.tokenizer.emStrong(e,i,s)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),r.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),r.push(o);continue}let c=e;if(this.options.extensions?.startInline){let h=1/0,u=e.slice(1),d;this.options.extensions.startInline.forEach(p=>{d=p.call({lexer:this},u),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(c=e.substring(0,h+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(s=o.raw.slice(-1)),n=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=o.raw,h.text+=o.text):r.push(o);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}},l(or,"l"),or),Ei,ts=(Ei=class{options;parser;constructor(e){this.options=e||Xr}space(e){return""}code({text:e,lang:r,escaped:i}){let a=(r||"").match(re.notSpaceStart)?.[0],n=e.replace(re.endingNewline,"")+` `;return a?'
'+(i?n:ke(n,!0))+`
`:"
"+(i?n:ke(n,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let r=e.ordered,i=e.start,a="";for(let o=0;o `+a+" `}listitem(e){let r="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+ke(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(e.tokens,!!e.loose),`
  • ${r}
  • `}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let r="",i="";for(let n=0;n${a}`),` `+r+` `+a+`
    `}tablerow({text:e}){return` ${e} `}tablecell(e){let r=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+r+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${ke(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:r,tokens:i}){let a=this.parser.parseInline(i),n=Eh(e);if(n===null)return a;e=n;let s='
    ",s}image({href:e,title:r,text:i,tokens:a}){a&&(i=this.parser.parseInline(a,this.parser.textRenderer));let n=Eh(e);if(n===null)return ke(i);e=n;let s=`${i}{let o=n[s].flat(1/0);i=i.concat(this.walkTokens(o,r))}):n.tokens&&(i=i.concat(this.walkTokens(n.tokens,r)))}}return i}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{let a={...i};if(a.async=this.defaults.async||a.async||!1,i.extensions&&(i.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let s=r.renderers[n.name];s?r.renderers[n.name]=function(...o){let c=n.renderer.apply(this,o);return c===!1&&(c=s.apply(this,o)),c}:r.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 s=r[n.level];s?s.unshift(n.tokenizer):r[n.level]=[n.tokenizer],n.start&&(n.level==="block"?r.startBlock?r.startBlock.push(n.start):r.startBlock=[n.start]:n.level==="inline"&&(r.startInline?r.startInline.push(n.start):r.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(r.childTokens[n.name]=n.childTokens)}),a.extensions=r),i.renderer){let n=this.defaults.renderer||new ts(this.defaults);for(let s in i.renderer){if(!(s in n))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,c=i.renderer[o],h=n[o];n[o]=(...u)=>{let d=c.apply(n,u);return d===!1&&(d=h.apply(n,u)),d||""}}a.renderer=n}if(i.tokenizer){let n=this.defaults.tokenizer||new Ko(this.defaults);for(let s in i.tokenizer){if(!(s in n))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,c=i.tokenizer[o],h=n[o];n[o]=(...u)=>{let d=c.apply(n,u);return d===!1&&(d=h.apply(n,u)),d}}a.tokenizer=n}if(i.hooks){let n=this.defaults.hooks||new _a;for(let s in i.hooks){if(!(s in n))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,c=i.hooks[o],h=n[o];_a.passThroughHooks.has(s)?n[o]=u=>{if(this.defaults.async&&_a.passThroughHooksRespectAsync.has(s))return Promise.resolve(c.call(n,u)).then(p=>h.call(n,p));let d=c.call(n,u);return h.call(n,d)}:n[o]=(...u)=>{let d=c.apply(n,u);return d===!1&&(d=h.apply(n,u)),d}}a.hooks=n}if(i.walkTokens){let n=this.defaults.walkTokens,s=i.walkTokens;a.walkTokens=function(o){let c=[];return c.push(s.call(this,o)),n&&(c=c.concat(n.call(this,o))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return He.lex(e,r??this.defaults)}parser(e,r){return Ue.parse(e,r??this.defaults)}parseMarkdown(e){return(r,i)=>{let a={...i},n={...this.defaults,...a},s=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&a.async===!1)return s(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 r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));n.hooks&&(n.hooks.options=n,n.hooks.block=e);let o=n.hooks?n.hooks.provideLexer():e?He.lex:He.lexInline,c=n.hooks?n.hooks.provideParser():e?Ue.parse:Ue.parseInline;if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(r):r).then(h=>o(h,n)).then(h=>n.hooks?n.hooks.processAllTokens(h):h).then(h=>n.walkTokens?Promise.all(this.walkTokens(h,n.walkTokens)).then(()=>h):h).then(h=>c(h,n)).then(h=>n.hooks?n.hooks.postprocess(h):h).catch(s);try{n.hooks&&(r=n.hooks.preprocess(r));let h=o(r,n);n.hooks&&(h=n.hooks.processAllTokens(h)),n.walkTokens&&this.walkTokens(h,n.walkTokens);let u=c(h,n);return n.hooks&&(u=n.hooks.postprocess(u)),u}catch(h){return s(h)}}}onError(e,r){return i=>{if(i.message+=` Please report this to https://github.com/markedjs/marked.`,e){let a="

    An error occurred:

    "+ke(i.message+"",!0)+"
    ";return r?Promise.resolve(a):a}if(r)return Promise.reject(i);throw i}}},l(Di,"B"),Di),Nr=new EA;function mt(t,e){return Nr.parse(t,e)}l(mt,"d");mt.options=mt.setOptions=function(t){return Nr.setOptions(t),mt.defaults=Nr.defaults,Hu(mt.defaults),mt};mt.getDefaults=zs;mt.defaults=Xr;mt.use=function(...t){return Nr.use(...t),mt.defaults=Nr.defaults,Hu(mt.defaults),mt};mt.walkTokens=function(t,e){return Nr.walkTokens(t,e)};mt.parseInline=Nr.parseInline;mt.Parser=Ue;mt.parser=Ue.parse;mt.Renderer=ts;mt.TextRenderer=Ju;mt.Lexer=He;mt.lexer=He.lex;mt.Tokenizer=Ko;mt.Hooks=_a;mt.parse=mt;mt.options;mt.setOptions;mt.use;mt.walkTokens;mt.parseInline;Ue.parse;He.lex;function sC(t,{markdownAutoWrap:e}){let r=t.replace(//g,` `).replace(/\n{2,}/g,` `),i=Wu(r);return e===!1?i.replace(/ /g," "):i}l(sC,"preprocessMarkdown");function lC(t,e={}){let r=sC(t,e),i=mt.lexer(r),a=[[]],n=0;function s(o,c="normal"){o.type==="text"?o.text.split(` `).forEach((h,u)=>{u!==0&&(n++,a.push([])),h.split(" ").forEach(d=>{d=d.replace(/'/g,"'"),d&&a[n].push({content:d,type:c})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(h=>{s(h,o.type)}):o.type==="html"&&a[n].push({content:o.text,type:"normal"})}return l(s,"processNode"),i.forEach(o=>{o.type==="paragraph"?o.tokens?.forEach(c=>{s(c)}):o.type==="html"?a[n].push({content:o.text,type:"normal"}):a[n].push({content:o.raw,type:"normal"})}),a}l(lC,"markdownToLines");function hC(t,{markdownAutoWrap:e}={}){let r=mt.lexer(t);function i(a){return a.type==="text"?e===!1?a.text.replace(/\n */g,"
    ").replace(/ /g," "):a.text.replace(/\n */g,"
    "):a.type==="strong"?`${a.tokens?.map(i).join("")}`:a.type==="em"?`${a.tokens?.map(i).join("")}`:a.type==="paragraph"?`

    ${a.tokens?.map(i).join("")}

    `:a.type==="space"?"":a.type==="html"?`${a.text}`:a.type==="escape"?a.text:(R.warn(`Unsupported markdown: ${a.type}`),a.raw)}return l(i,"output"),r.map(i).join("")}l(hC,"markdownToHTML");function cC(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}l(cC,"splitTextToChars");function uC(t,e){let r=cC(e.content);return Ku(t,[],r,e.type)}l(uC,"splitWordToFitWidth");function Ku(t,e,r,i){if(r.length===0)return[{content:e.join(""),type:i},{content:"",type:i}];let[a,...n]=r,s=[...e,a];return t([{content:s.join(""),type:i}])?Ku(t,s,n,i):(e.length===0&&a&&(e.push(a),r.shift()),[{content:e.join(""),type:i},{content:r.join(""),type:i}])}l(Ku,"splitWordToFitWidthRecursion");function dC(t,e){if(t.some(({content:r})=>r.includes(` `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return es(t,e)}l(dC,"splitLineToFitWidth");function es(t,e,r=[],i=[]){if(t.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let a="";t[0].content===" "&&(a=" ",t.shift());let n=t.shift()??{content:" ",type:"normal"},s=[...i];if(a!==""&&s.push({content:a,type:"normal"}),s.push(n),e(s))return es(t,e,r,s);if(i.length>0)r.push(i),t.unshift(n);else if(n.content){let[o,c]=uC(e,n);r.push([o]),c.content&&t.unshift(c)}return es(t,e,r)}l(es,"splitLineToFitWidthRecursion");function Ih(t,e){e&&t.attr("style",e)}l(Ih,"applyStyle");async function pC(t,e,r,i,a=!1,n=Gt()){let s=t.append("foreignObject");s.attr("width",`${10*r}px`),s.attr("height",`${10*r}px`);let o=s.append("xhtml:div"),c=Qi(e.label)?await mu(e.label.replace(ia.lineBreakRegex,` `),n):ge(e.label,n),h=e.isNode?"nodeLabel":"edgeLabel",u=o.append("span");u.html(c),Ih(u,e.labelStyle),u.attr("class",`${h} ${i}`),Ih(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),o.style("max-width",r+"px"),o.style("text-align","center"),o.attr("xmlns","http://www.w3.org/1999/xhtml"),a&&o.attr("class","labelBkg");let d=o.node().getBoundingClientRect();return d.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),d=o.node().getBoundingClientRect()),s.node()}l(pC,"addHtmlSpan");function Ws(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")}l(Ws,"createTspan");function fC(t,e,r){let i=t.append("text"),a=Ws(i,1,e);Hs(a,r);let n=a.node().getComputedTextLength();return i.remove(),n}l(fC,"computeWidthOfText");function OA(t,e,r){let i=t.append("text"),a=Ws(i,1,e);Hs(a,[{content:r,type:"normal"}]);let n=a.node()?.getBoundingClientRect();return n&&i.remove(),n}l(OA,"computeDimensionOfText");function gC(t,e,r,i=!1){let a=e.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),s=a.append("text").attr("y","-10.1"),o=0;for(let c of r){let h=l(d=>fC(a,1.1,d)<=t,"checkWidth"),u=h(c)?[c]:dC(c,h);for(let d of u){let p=Ws(s,o,1.1);Hs(p,d),o++}}if(i){let c=s.node().getBBox(),h=2;return n.attr("x",c.x-h).attr("y",c.y-h).attr("width",c.width+2*h).attr("height",c.height+2*h),a.node()}else return s.node()}l(gC,"createFormattedText");function Hs(t,e){t.text(""),e.forEach((r,i)=>{let a=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?a.text(r.content):a.text(" "+r.content)})}l(Hs,"updateTextContentAndStyles");async function mC(t,e={}){let r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(a,n,s)=>(r.push((async()=>{let o=`${n}:${s}`;return await KB(o)?await An(o,void 0,{class:"label-icon"}):``})()),a));let i=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}l(mC,"replaceIconSubstring");var gr=l(async(t,e="",{style:r="",isTitle:i=!1,classes:a="",useHtmlLabels:n=!0,isNode:s=!0,width:o=200,addSvgBackground:c=!1}={},h)=>{if(R.debug("XYZ createText",e,r,i,a,n,s,"addSvgBackground: ",c),n){let u=hC(e,h),d=await mC(Gr(u),h),p=e.replace(/\\\\/g,"\\"),f={isNode:s,label:Qi(e)?p:d,labelStyle:r.replace("fill:","color:")};return await pC(t,f,o,a,c,h)}else{let u=e.replace(//g,"
    "),d=lC(u.replace("
    ","
    "),h),p=gC(o,t,d,e?c:!1);if(s){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));let f=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(p).attr("style",f)}else{let f=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");pt(p).select("rect").attr("style",f.replace(/background:/g,"fill:"));let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(p).select("text").attr("style",g)}return p}},"createText"),st=l(async(t,e,r)=>{let i,a=e.useHtmlLabels||Et(xt()?.htmlLabels);r?i=r:i="node default";let n=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=n.insert("g").attr("class","label").attr("style",Zt(e.labelStyle)),o;e.label===void 0?o="":o=typeof e.label=="string"?e.label:e.label[0];let c=await gr(s,ge(Gr(o),xt()),{useHtmlLabels:a,width:e.width||xt().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img}),h=c.getBBox(),u=(e?.padding??0)/2;if(a){let d=c.children[0],p=pt(c),f=d.getElementsByTagName("img");if(f){let g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...f].map(m=>new Promise(y=>{function x(){if(m.style.display="flex",m.style.flexDirection="column",g){let b=xt().fontSize?xt().fontSize:window.getComputedStyle(document.body).fontSize,k=5,[_=K1.fontSize]=Ps(b),C=_*k+"px";m.style.minWidth=C,m.style.maxWidth=C}else m.style.width="100%";y(m)}l(x,"setupImage"),setTimeout(()=>{m.complete&&x()}),m.addEventListener("error",x),m.addEventListener("load",x)})))}h=d.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}return a?s.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):s.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:n,bbox:h,halfPadding:u,label:s}},"labelHelper"),bl=l(async(t,e,r)=>{let i=r.useHtmlLabels||Et(xt()?.flowchart?.htmlLabels),a=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),n=await gr(a,ge(Gr(e),xt()),{useHtmlLabels:i,width:r.width||xt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),s=n.getBBox(),o=r.padding/2;if(Et(xt()?.flowchart?.htmlLabels)){let c=n.children[0],h=pt(n);s=c.getBoundingClientRect(),h.attr("width",s.width),h.attr("height",s.height)}return i?a.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):a.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&a.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:o,label:a}},"insertLabel"),tt=l((t,e)=>{let r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),nt=l((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function dt(t){let e=t.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}l(dt,"createPathFromPoints");function ur(t,e,r,i,a,n){let s=[],o=r-t,c=i-e,h=o/n,u=2*Math.PI/h,d=e+c/2;for(let p=0;p<=50;p++){let f=p/50,g=t+f*o,m=d+a*Math.sin(u*(g-t));s.push({x:g,y:m})}return s}l(ur,"generateFullSineWavePoints");function pn(t,e,r,i,a,n){let s=[],o=a*Math.PI/180,c=(n*Math.PI/180-o)/(i-1);for(let h=0;h2&&p.push(k)}let f=[];u=Math.max(u,.1);let g=[];for(let b of p)for(let k=0;kb.ymink.ymin?1:b.xk.x?1:b.ymax===k.ymax?0:(b.ymax-k.ymax)/Math.abs(b.ymax-k.ymax))),!g.length)return f;let m=[],y=g[0].ymin,x=0;for(;m.length||g.length;){if(g.length){let b=-1;for(let k=0;ky);k++)b=k;g.splice(0,b+1).forEach((k=>{m.push({s:y,edge:k})}))}if(m=m.filter((b=>!(b.edge.ymax<=y))),m.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%u==0)&&m.length>1)for(let b=0;b=m.length)break;let _=m[b].edge,C=m[k].edge;f.push([[Math.round(_.x),y],[Math.round(C.x),y]])}y+=d,m.forEach((b=>{b.edge.x=b.edge.x+d*b.edge.islope})),x++}return f})(s,n,i);if(a){for(let h of s)yo(h,o,-a);(function(h,u,d){let p=[];h.forEach((f=>p.push(...f))),yo(p,u,d)})(c,o,-a)}return c}l(xC,"s");function oa(t,e){var r;let i=e.hachureAngle+90,a=e.hachureGap;a<0&&(a=4*e.strokeWidth),a=Math.round(Math.max(a,.1));let n=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(n=a),xC(t,a,i,n||1)}l(oa,"n");var Ii,td=(Ii=class{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){let i=oa(e,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(e,r){let i=[];for(let a of e)i.push(...this.helper.doubleLineOps(a[0][0],a[0][1],a[1][0],a[1][1],r));return i}},l(Ii,"o"),Ii);function Fn(t){let e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}l(Fn,"a");var Ri,DA=(Ri=class extends td{fillPolygons(e,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=oa(e,Object.assign({},r,{hachureGap:i})),n=Math.PI/180*r.hachureAngle,s=[],o=.5*i*Math.cos(n),c=.5*i*Math.sin(n);for(let[h,u]of a)Fn([h,u])&&s.push([[h[0]-o,h[1]+c],[...u]],[[h[0]+o,h[1]-c],[...u]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}},l(Ri,"h"),Ri),Ni,IA=(Ni=class extends td{fillPolygons(e,r){let i=this._fillPolygons(e,r),a=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),n=this._fillPolygons(e,a);return i.ops=i.ops.concat(n.ops),i}},l(Ni,"r"),Ni),Pi,RA=(Pi=class{constructor(e){this.helper=e}fillPolygons(e,r){let i=oa(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(e,r){let i=[],a=r.hachureGap;a<0&&(a=4*r.strokeWidth),a=Math.max(a,.1);let n=r.fillWeight;n<0&&(n=r.strokeWidth/2);let s=a/4;for(let o of e){let c=Fn(o),h=c/a,u=Math.ceil(h)-1,d=c-u*a,p=(o[0][0]+o[1][0])/2-a/4,f=Math.min(o[0][1],o[1][1]);for(let g=0;g{let o=Fn(s),c=Math.floor(o/(i+a)),h=(o+a-c*(i+a))/2,u=s[0],d=s[1];u[0]>d[0]&&(u=s[1],d=s[0]);let p=Math.atan((d[1]-u[1])/(d[0]-u[0]));for(let f=0;f{let s=Fn(n),o=Math.round(s/(2*r)),c=n[0],h=n[1];c[0]>h[0]&&(c=n[1],h=n[0]);let u=Math.atan((h[1]-c[1])/(h[0]-c[0]));for(let d=0;du%2?h+r:h+e));n.push({key:"C",data:c}),e=c[4],r=c[5];break}case"Q":n.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{let c=o.map(((h,u)=>u%2?h+r:h+e));n.push({key:"Q",data:c}),e=c[2],r=c[3];break}case"A":n.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],n.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":n.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],n.push({key:"H",data:[e]});break;case"V":n.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],n.push({key:"V",data:[r]});break;case"S":n.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{let c=o.map(((h,u)=>u%2?h+r:h+e));n.push({key:"S",data:c}),e=c[2],r=c[3];break}case"T":n.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],n.push({key:"T",data:[e,r]});break;case"Z":case"z":n.push({key:"Z",data:[]}),e=i,r=a}return n}l(ed,"y");function rd(t){let e=[],r="",i=0,a=0,n=0,s=0,o=0,c=0;for(let{key:h,data:u}of t){switch(h){case"M":e.push({key:"M",data:[...u]}),[i,a]=u,[n,s]=u;break;case"C":e.push({key:"C",data:[...u]}),i=u[4],a=u[5],o=u[2],c=u[3];break;case"L":e.push({key:"L",data:[...u]}),[i,a]=u;break;case"H":i=u[0],e.push({key:"L",data:[i,a]});break;case"V":a=u[0],e.push({key:"L",data:[i,a]});break;case"S":{let d=0,p=0;r==="C"||r==="S"?(d=i+(i-o),p=a+(a-c)):(d=i,p=a),e.push({key:"C",data:[d,p,...u]}),o=u[0],c=u[1],i=u[2],a=u[3];break}case"T":{let[d,p]=u,f=0,g=0;r==="Q"||r==="T"?(f=i+(i-o),g=a+(a-c)):(f=i,g=a);let m=i+2*(f-i)/3,y=a+2*(g-a)/3,x=d+2*(f-d)/3,b=p+2*(g-p)/3;e.push({key:"C",data:[m,y,x,b,d,p]}),o=f,c=g,i=d,a=p;break}case"Q":{let[d,p,f,g]=u,m=i+2*(d-i)/3,y=a+2*(p-a)/3,x=f+2*(d-f)/3,b=g+2*(p-g)/3;e.push({key:"C",data:[m,y,x,b,f,g]}),o=d,c=p,i=f,a=g;break}case"A":{let d=Math.abs(u[0]),p=Math.abs(u[1]),f=u[2],g=u[3],m=u[4],y=u[5],x=u[6];d===0||p===0?(e.push({key:"C",data:[i,a,y,x,y,x]}),i=y,a=x):(i!==y||a!==x)&&(id(i,a,y,x,d,p,f,g,m).forEach((function(b){e.push({key:"C",data:b})})),i=y,a=x);break}case"Z":e.push({key:"Z",data:[]}),i=n,a=s}r=h}return e}l(rd,"m");function ci(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}l(ci,"w");function id(t,e,r,i,a,n,s,o,c,h){let u=(d=s,Math.PI*d/180);var d;let p=[],f=0,g=0,m=0,y=0;if(h)[f,g,m,y]=h;else{[t,e]=ci(t,e,-u),[r,i]=ci(r,i,-u);let A=(t-r)/2,v=(e-i)/2,L=A*A/(a*a)+v*v/(n*n);L>1&&(L=Math.sqrt(L),a*=L,n*=L);let B=a*a,E=n*n,F=B*E-B*v*v-E*A*A,z=B*v*v+E*A*A,Y=(o===c?-1:1)*Math.sqrt(Math.abs(F/z));m=Y*a*v/n+(t+r)/2,y=Y*-n*A/a+(e+i)/2,f=Math.asin(parseFloat(((e-y)/n).toFixed(9))),g=Math.asin(parseFloat(((i-y)/n).toFixed(9))),tg&&(f-=2*Math.PI),!c&&g>f&&(g-=2*Math.PI)}let x=g-f;if(Math.abs(x)>120*Math.PI/180){let A=g,v=r,L=i;g=c&&g>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,p=id(r=m+a*Math.cos(g),i=y+n*Math.sin(g),v,L,a,n,s,0,c,[g,A,m,y])}x=g-f;let b=Math.cos(f),k=Math.sin(f),_=Math.cos(g),C=Math.sin(g),$=Math.tan(x/4),S=4/3*a*$,D=4/3*n*$,N=[t,e],I=[t+S*k,e-D*b],T=[r+S*C,i-D*_],O=[r,i];if(I[0]=2*N[0]-I[0],I[1]=2*N[1]-I[1],h)return[I,T,O].concat(p);{p=[I,T,O].concat(p);let A=[];for(let v=0;v2){let a=[];for(let n=0;n2*Math.PI&&(f=0,g=2*Math.PI);let m=2*Math.PI/c.curveStepCount,y=Math.min(m/2,(g-f)/2),x=jh(y,h,u,d,p,f,g,1,c);if(!c.disableMultiStroke){let b=jh(y,h,u,d,p,f,g,1.5,c);x.push(...b)}return s&&(o?x.push(...Je(h,u,h+d*Math.cos(f),u+p*Math.sin(f),c),...Je(h,u,h+d*Math.cos(g),u+p*Math.sin(g),c)):x.push({op:"lineTo",data:[h,u]},{op:"lineTo",data:[h+d*Math.cos(f),u+p*Math.sin(f)]})),{type:"path",ops:x}}l(Nh,"A");function Ph(t,e){let r=rd(ed(Us(t))),i=[],a=[0,0],n=[0,0];for(let{key:s,data:o}of r)switch(s){case"M":n=[o[0],o[1]],a=[o[0],o[1]];break;case"L":i.push(...Je(n[0],n[1],o[0],o[1],e)),n=[o[0],o[1]];break;case"C":{let[c,h,u,d,p,f]=o;i.push(...kC(c,h,u,d,p,f,n,e)),n=[p,f];break}case"Z":i.push(...Je(n[0],n[1],a[0],a[1],e)),n=[a[0],a[1]]}return{type:"path",ops:i}}l(Ph,"_");function bo(t,e){let r=[];for(let i of t)if(i.length){let a=e.maxRandomnessOffset||0,n=i.length;if(n>2){r.push({op:"move",data:[i[0][0]+ot(a,e),i[0][1]+ot(a,e)]});for(let s=1;s500?.4:-.0016668*c+1.233334;let u=a.maxRandomnessOffset||0;u*u*100>o&&(u=c/10);let d=u/2,p=.2+.2*od(a),f=a.bowing*a.maxRandomnessOffset*(i-e)/200,g=a.bowing*a.maxRandomnessOffset*(t-r)/200;f=ot(f,a,h),g=ot(g,a,h);let m=[],y=l(()=>ot(d,a,h),"M"),x=l(()=>ot(u,a,h),"k"),b=a.preserveVertices;return n&&(s?m.push({op:"move",data:[t+(b?0:y()),e+(b?0:y())]}):m.push({op:"move",data:[t+(b?0:ot(u,a,h)),e+(b?0:ot(u,a,h))]})),s?m.push({op:"bcurveTo",data:[f+t+(r-t)*p+y(),g+e+(i-e)*p+y(),f+t+2*(r-t)*p+y(),g+e+2*(i-e)*p+y(),r+(b?0:y()),i+(b?0:y())]}):m.push({op:"bcurveTo",data:[f+t+(r-t)*p+x(),g+e+(i-e)*p+x(),f+t+2*(r-t)*p+x(),g+e+2*(i-e)*p+x(),r+(b?0:x()),i+(b?0:x())]}),m}l(is,"R");function va(t,e,r){if(!t.length)return[];let i=[];i.push([t[0][0]+ot(e,r),t[0][1]+ot(e,r)]),i.push([t[0][0]+ot(e,r),t[0][1]+ot(e,r)]);for(let a=1;a3){let n=[],s=1-r.curveTightness;a.push({op:"move",data:[t[1][0],t[1][1]]});for(let o=1;o+21&&a.push(o)):a.push(o),a.push(t[e+3])}else{let o=t[e+0],c=t[e+1],h=t[e+2],u=t[e+3],d=er(o,c,.5),p=er(c,h,.5),f=er(h,u,.5),g=er(d,p,.5),m=er(p,f,.5),y=er(g,m,.5);as([o,d,g,y],0,r,a),as([y,m,f,u],0,r,a)}var n,s;return a}l(as,"K");function wC(t,e){return mn(t,0,t.length,e)}l(wC,"U");function mn(t,e,r,i,a){let n=a||[],s=t[e],o=t[r-1],c=0,h=1;for(let u=e+1;uc&&(c=d,h=u)}return Math.sqrt(c)>i?(mn(t,e,h+1,i,n),mn(t,h,r,i,n)):(n.length||n.push(s),n.push(o)),n}l(mn,"X");function ko(t,e=.15,r){let i=[],a=(t.length-1)/3;for(let n=0;n0?mn(i,0,i.length,r):i}l(ko,"Y");var he="none",Wi,ns=(Wi=class{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,a,n){let s=this._o(n);return this._d("line",[ad(e,r,i,a,s)],s)}rectangle(e,r,i,a,n){let s=this._o(n),o=[],c=bC(e,r,i,a,s);if(s.fill){let h=[[e,r],[e+i,r],[e+i,r+a],[e,r+a]];s.fillStyle==="solid"?o.push(bo([h],s)):o.push($r([h],s))}return s.stroke!==he&&o.push(c),this._d("rectangle",o,s)}ellipse(e,r,i,a,n){let s=this._o(n),o=[],c=nd(i,a,s),h=rs(e,r,s,c);if(s.fill)if(s.fillStyle==="solid"){let u=rs(e,r,s,c).opset;u.type="fillPath",o.push(u)}else o.push($r([h.estimatedPoints],s));return s.stroke!==he&&o.push(h.opset),this._d("ellipse",o,s)}circle(e,r,i,a){let n=this.ellipse(e,r,i,i,a);return n.shape="circle",n}linearPath(e,r){let i=this._o(r);return this._d("linearPath",[Pa(e,!1,i)],i)}arc(e,r,i,a,n,s,o=!1,c){let h=this._o(c),u=[],d=Nh(e,r,i,a,n,s,o,!0,h);if(o&&h.fill)if(h.fillStyle==="solid"){let p=Object.assign({},h);p.disableMultiStroke=!0;let f=Nh(e,r,i,a,n,s,!0,!1,p);f.type="fillPath",u.push(f)}else u.push((function(p,f,g,m,y,x,b){let k=p,_=f,C=Math.abs(g/2),$=Math.abs(m/2);C+=ot(.01*C,b),$+=ot(.01*$,b);let S=y,D=x;for(;S<0;)S+=2*Math.PI,D+=2*Math.PI;D-S>2*Math.PI&&(S=0,D=2*Math.PI);let N=(D-S)/b.curveStepCount,I=[];for(let T=S;T<=D;T+=N)I.push([k+C*Math.cos(T),_+$*Math.sin(T)]);return I.push([k+C*Math.cos(D),_+$*Math.sin(D)]),I.push([k,_]),$r([I],b)})(e,r,i,a,n,s,h));return h.stroke!==he&&u.push(d),this._d("arc",u,h)}curve(e,r){let i=this._o(r),a=[],n=Rh(e,i);if(i.fill&&i.fill!==he)if(i.fillStyle==="solid"){let s=Rh(e,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));a.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{let s=[],o=e;if(o.length){let c=typeof o[0][0]=="number"?[o]:o;for(let h of c)h.length<3?s.push(...h):h.length===3?s.push(...ko(Wh([h[0],h[0],h[1],h[2]]),10,(1+i.roughness)/2)):s.push(...ko(Wh(h),10,(1+i.roughness)/2))}s.length&&a.push($r([s],i))}return i.stroke!==he&&a.push(n),this._d("curve",a,i)}polygon(e,r){let i=this._o(r),a=[],n=Pa(e,!0,i);return i.fill&&(i.fillStyle==="solid"?a.push(bo([e],i)):a.push($r([e],i))),i.stroke!==he&&a.push(n),this._d("polygon",a,i)}path(e,r){let i=this._o(r),a=[];if(!e)return this._d("path",a,i);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let n=i.fill&&i.fill!=="transparent"&&i.fill!==he,s=i.stroke!==he,o=!!(i.simplification&&i.simplification<1),c=(function(u,d,p){let f=rd(ed(Us(u))),g=[],m=[],y=[0,0],x=[],b=l(()=>{x.length>=4&&m.push(...ko(x,d)),x=[]},"i"),k=l(()=>{b(),m.length&&(g.push(m),m=[])},"c");for(let{key:C,data:$}of f)switch(C){case"M":k(),y=[$[0],$[1]],m.push(y);break;case"L":b(),m.push([$[0],$[1]]);break;case"C":if(!x.length){let S=m.length?m[m.length-1]:y;x.push([S[0],S[1]])}x.push([$[0],$[1]]),x.push([$[2],$[3]]),x.push([$[4],$[5]]);break;case"Z":b(),m.push([y[0],y[1]])}if(k(),!p)return g;let _=[];for(let C of g){let $=wC(C,p);$.length&&_.push($)}return _})(e,1,o?4-4*(i.simplification||1):(1+i.roughness)/2),h=Ph(e,i);if(n)if(i.fillStyle==="solid")if(c.length===1){let u=Ph(e,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));a.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else a.push(bo(c,i));else a.push($r(c,i));return s&&(o?c.forEach((u=>{a.push(Pa(u,!1,i))})):a.push(h)),this._d("path",a,i)}opsToPath(e,r){let i="";for(let a of e.ops){let n=typeof r=="number"&&r>=0?a.data.map((s=>+s.toFixed(r))):a.data;switch(a.op){case"move":i+=`M${n[0]} ${n[1]} `;break;case"bcurveTo":i+=`C${n[0]} ${n[1]}, ${n[2]} ${n[3]}, ${n[4]} ${n[5]} `;break;case"lineTo":i+=`L${n[0]} ${n[1]} `}}return i.trim()}toPaths(e){let r=e.sets||[],i=e.options||this.defaultOptions,a=[];for(let n of r){let s=null;switch(n.type){case"path":s={d:this.opsToPath(n),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:he};break;case"fillPath":s={d:this.opsToPath(n),stroke:he,strokeWidth:0,fill:i.fill||he};break;case"fillSketch":s=this.fillSketch(n,i)}s&&a.push(s)}return a}fillSketch(e,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||he,strokeWidth:i,fill:he}}_mergedShape(e){return e.filter(((r,i)=>i===0||r.op!=="move"))}},l(Wi,"et"),Wi),Hi,WA=(Hi=class{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ns(r)}draw(e){let r=e.sets||[],i=e.options||this.getDefaultOptions(),a=this.ctx,n=e.options.fixedDecimalPlaceDigits;for(let s of r)switch(s.type){case"path":a.save(),a.strokeStyle=i.stroke==="none"?"transparent":i.stroke,a.lineWidth=i.strokeWidth,i.strokeLineDash&&a.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(a.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(a,s,n),a.restore();break;case"fillPath":{a.save(),a.fillStyle=i.fill||"";let o=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(a,s,n,o),a.restore();break}case"fillSketch":this.fillSketch(a,s,i)}}fillSketch(e,r,i){let a=i.fillWeight;a<0&&(a=i.strokeWidth/2),e.save(),i.fillLineDash&&e.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(e.lineDashOffset=i.fillLineDashOffset),e.strokeStyle=i.fill||"",e.lineWidth=a,this._drawToContext(e,r,i.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,i,a="nonzero"){e.beginPath();for(let n of r.ops){let s=typeof i=="number"&&i>=0?n.data.map((o=>+o.toFixed(i))):n.data;switch(n.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(a):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,i,a,n){let s=this.gen.line(e,r,i,a,n);return this.draw(s),s}rectangle(e,r,i,a,n){let s=this.gen.rectangle(e,r,i,a,n);return this.draw(s),s}ellipse(e,r,i,a,n){let s=this.gen.ellipse(e,r,i,a,n);return this.draw(s),s}circle(e,r,i,a){let n=this.gen.circle(e,r,i,a);return this.draw(n),n}linearPath(e,r){let i=this.gen.linearPath(e,r);return this.draw(i),i}polygon(e,r){let i=this.gen.polygon(e,r);return this.draw(i),i}arc(e,r,i,a,n,s,o=!1,c){let h=this.gen.arc(e,r,i,a,n,s,o,c);return this.draw(h),h}curve(e,r){let i=this.gen.curve(e,r);return this.draw(i),i}path(e,r){let i=this.gen.path(e,r);return this.draw(i),i}},l(Hi,"st"),Hi),Xn="http://www.w3.org/2000/svg",Ui,HA=(Ui=class{constructor(e,r){this.svg=e,this.gen=new ns(r)}draw(e){let r=e.sets||[],i=e.options||this.getDefaultOptions(),a=this.svg.ownerDocument||window.document,n=a.createElementNS(Xn,"g"),s=e.options.fixedDecimalPlaceDigits;for(let o of r){let c=null;switch(o.type){case"path":c=a.createElementNS(Xn,"path"),c.setAttribute("d",this.opsToPath(o,s)),c.setAttribute("stroke",i.stroke),c.setAttribute("stroke-width",i.strokeWidth+""),c.setAttribute("fill","none"),i.strokeLineDash&&c.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&c.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":c=a.createElementNS(Xn,"path"),c.setAttribute("d",this.opsToPath(o,s)),c.setAttribute("stroke","none"),c.setAttribute("stroke-width","0"),c.setAttribute("fill",i.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||c.setAttribute("fill-rule","evenodd");break;case"fillSketch":c=this.fillSketch(a,o,i)}c&&n.appendChild(c)}return n}fillSketch(e,r,i){let a=i.fillWeight;a<0&&(a=i.strokeWidth/2);let n=e.createElementNS(Xn,"path");return n.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),n.setAttribute("stroke",i.fill||""),n.setAttribute("stroke-width",a+""),n.setAttribute("fill","none"),i.fillLineDash&&n.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&n.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),n}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,i,a,n){let s=this.gen.line(e,r,i,a,n);return this.draw(s)}rectangle(e,r,i,a,n){let s=this.gen.rectangle(e,r,i,a,n);return this.draw(s)}ellipse(e,r,i,a,n){let s=this.gen.ellipse(e,r,i,a,n);return this.draw(s)}circle(e,r,i,a){let n=this.gen.circle(e,r,i,a);return this.draw(n)}linearPath(e,r){let i=this.gen.linearPath(e,r);return this.draw(i)}polygon(e,r){let i=this.gen.polygon(e,r);return this.draw(i)}arc(e,r,i,a,n,s,o=!1,c){let h=this.gen.arc(e,r,i,a,n,s,o,c);return this.draw(h)}curve(e,r){let i=this.gen.curve(e,r);return this.draw(i)}path(e,r){let i=this.gen.path(e,r);return this.draw(i)}},l(Ui,"ot"),Ui),Q={canvas:l((t,e)=>new WA(t,e),"canvas"),svg:l((t,e)=>new HA(t,e),"svg"),generator:l(t=>new ns(t),"generator"),newSeed:l(()=>ns.newSeed(),"newSeed")},UA=l((t,e)=>{var r=t.x,i=t.y,a=e.x-r,n=e.y-i,s=t.width/2,o=t.height/2,c,h;return Math.abs(n)*s>Math.abs(a)*o?(n<0&&(o=-o),c=n===0?0:o*a/n,h=o):(a<0&&(s=-s),c=s,h=a===0?0:s*n/a),{x:r+c,y:i+h}},"intersectRect"),sa=UA;function $C(t,e){e&&t.attr("style",e)}l($C,"applyStyle");async function _C(t){let e=pt(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),i=xt(),a=t.label;t.label&&Qi(t.label)&&(a=await mu(t.label.replace(ia.lineBreakRegex,` `),i));let n='"+a+"";return r.html(ge(n,i)),$C(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()}l(_C,"addHtmlLabel");var YA=l(async(t,e,r,i)=>{let a=t||"";if(typeof a=="object"&&(a=a[0]),Et(xt().flowchart.htmlLabels)){a=a.replace(/\\n|\n/g,"
    "),R.info("vertexText"+a);let n={isNode:i,label:Gr(a).replace(/fa[blrs]?:fa-[\w-]+/g,s=>``),labelStyle:e&&e.replace("fill:","color:")};return await _C(n)}else{let n=document.createElementNS("http://www.w3.org/2000/svg","text");n.setAttribute("style",e.replace("color:","fill:"));let s=[];typeof a=="string"?s=a.split(/\\n|\n|/gi):Array.isArray(a)?s=a:s=[];for(let o of s){let c=document.createElementNS("http://www.w3.org/2000/svg","tspan");c.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),c.setAttribute("dy","1em"),c.setAttribute("x","0"),r?c.setAttribute("class","title-row"):c.setAttribute("class","row"),c.textContent=o.trim(),n.appendChild(c)}return n}},"createLabel"),Br=YA,mr=l((t,e,r,i,a)=>["M",t+a,e,"H",t+r-a,"A",a,a,0,0,1,t+r,e+a,"V",e+i-a,"A",a,a,0,0,1,t+r-a,e+i,"H",t+a,"A",a,a,0,0,1,t,e+i-a,"V",e+a,"A",a,a,0,0,1,t+a,e,"Z"].join(" "),"createRoundedRectPathD"),vC=l(async(t,e)=>{R.info("Creating subgraph rect for ",e.id,e);let r=xt(),{themeVariables:i,handDrawnSeed:a}=r,{clusterBkg:n,clusterBorder:s}=i,{labelStyles:o,nodeStyles:c,borderStyles:h,backgroundStyles:u}=K(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),p=Et(r.flowchart.htmlLabels),f=d.insert("g").attr("class","cluster-label "),g=await gr(f,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0}),m=g.getBBox();if(Et(r.flowchart.htmlLabels)){let S=g.children[0],D=pt(g);m=S.getBoundingClientRect(),D.attr("width",m.width),D.attr("height",m.height)}let y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;let x=e.height,b=e.x-y/2,k=e.y-x/2;R.trace("Data ",e,JSON.stringify(e));let _;if(e.look==="handDrawn"){let S=Q.svg(d),D=J(e,{roughness:.7,fill:n,stroke:s,fillWeight:3,seed:a}),N=S.path(mr(b,k,y,x,0),D);_=d.insert(()=>(R.debug("Rough node insert CXC",N),N),":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",u.join(";").replace("fill","stroke"))}else _=d.insert("rect",":first-child"),_.attr("style",c).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",x);let{subGraphTitleTopMargin:C}=Bu(r);if(f.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){let S=f.select("span");S&&S.attr("style",o)}let $=_.node().getBBox();return e.offsetX=0,e.width=$.width,e.height=$.height,e.offsetY=m.height-e.padding/2,e.intersect=function(S){return sa(e,S)},{cluster:d,labelBBox:m}},"rect"),VA=l((t,e)=>{let r=t.insert("g").attr("class","note-cluster").attr("id",e.id),i=r.insert("rect",":first-child"),a=0*e.padding,n=a/2;i.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-n).attr("y",e.y-e.height/2-n).attr("width",e.width+a).attr("height",e.height+a).attr("fill","none");let s=i.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(o){return sa(e,o)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),GA=l(async(t,e)=>{let r=xt(),{themeVariables:i,handDrawnSeed:a}=r,{altBackground:n,compositeBackground:s,compositeTitleBackground:o,nodeBorder:c}=i,h=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),u=h.insert("g",":first-child"),d=h.insert("g").attr("class","cluster-label"),p=h.append("rect"),f=d.node().appendChild(await Br(e.label,e.labelStyle,void 0,!0)),g=f.getBBox();if(Et(r.flowchart.htmlLabels)){let N=f.children[0],I=pt(f);g=N.getBoundingClientRect(),I.attr("width",g.width),I.attr("height",g.height)}let m=0*e.padding,y=m/2,x=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+m;e.width<=g.width+e.padding?e.diff=(x-e.width)/2-e.padding:e.diff=-e.padding;let b=e.height+m,k=e.height+m-g.height-6,_=e.x-x/2,C=e.y-b/2;e.width=x;let $=e.y-e.height/2-y+g.height+2,S;if(e.look==="handDrawn"){let N=e.cssClasses.includes("statediagram-cluster-alt"),I=Q.svg(h),T=e.rx||e.ry?I.path(mr(_,C,x,b,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:c,seed:a}):I.rectangle(_,C,x,b,{seed:a});S=h.insert(()=>T,":first-child");let O=I.rectangle(_,$,x,k,{fill:N?n:s,fillStyle:N?"hachure":"solid",stroke:c,seed:a});S=h.insert(()=>T,":first-child"),p=h.insert(()=>O)}else S=u.insert("rect",":first-child"),S.attr("class","outer").attr("x",_).attr("y",C).attr("width",x).attr("height",b).attr("data-look",e.look),p.attr("class","inner").attr("x",_).attr("y",$).attr("width",x).attr("height",k);d.attr("transform",`translate(${e.x-g.width/2}, ${C+1-(Et(r.flowchart.htmlLabels)?0:3)})`);let D=S.node().getBBox();return e.height=D.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(N){return sa(e,N)},{cluster:h,labelBBox:g}},"roundedWithTitle"),XA=l(async(t,e)=>{R.info("Creating subgraph rect for ",e.id,e);let r=xt(),{themeVariables:i,handDrawnSeed:a}=r,{clusterBkg:n,clusterBorder:s}=i,{labelStyles:o,nodeStyles:c,borderStyles:h,backgroundStyles:u}=K(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),p=Et(r.flowchart.htmlLabels),f=d.insert("g").attr("class","cluster-label "),g=await gr(f,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width}),m=g.getBBox();if(Et(r.flowchart.htmlLabels)){let S=g.children[0],D=pt(g);m=S.getBoundingClientRect(),D.attr("width",m.width),D.attr("height",m.height)}let y=e.width<=m.width+e.padding?m.width+e.padding:e.width;e.width<=m.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;let x=e.height,b=e.x-y/2,k=e.y-x/2;R.trace("Data ",e,JSON.stringify(e));let _;if(e.look==="handDrawn"){let S=Q.svg(d),D=J(e,{roughness:.7,fill:n,stroke:s,fillWeight:4,seed:a}),N=S.path(mr(b,k,y,x,e.rx),D);_=d.insert(()=>(R.debug("Rough node insert CXC",N),N),":first-child"),_.select("path:nth-child(2)").attr("style",h.join(";")),_.select("path").attr("style",u.join(";").replace("fill","stroke"))}else _=d.insert("rect",":first-child"),_.attr("style",c).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",k).attr("width",y).attr("height",x);let{subGraphTitleTopMargin:C}=Bu(r);if(f.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+C})`),o){let S=f.select("span");S&&S.attr("style",o)}let $=_.node().getBBox();return e.offsetX=0,e.width=$.width,e.height=$.height,e.offsetY=m.height-e.padding/2,e.intersect=function(S){return sa(e,S)},{cluster:d,labelBBox:m}},"kanbanSection"),ZA=l((t,e)=>{let r=xt(),{themeVariables:i,handDrawnSeed:a}=r,{nodeBorder:n}=i,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),o=s.insert("g",":first-child"),c=0*e.padding,h=e.width+c;e.diff=-e.padding;let u=e.height+c,d=e.x-h/2,p=e.y-u/2;e.width=h;let f;if(e.look==="handDrawn"){let m=Q.svg(s).rectangle(d,p,h,u,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:n,seed:a});f=s.insert(()=>m,":first-child")}else f=o.insert("rect",":first-child"),f.attr("class","divider").attr("x",d).attr("y",p).attr("width",h).attr("height",u).attr("data-look",e.look);let g=f.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(m){return sa(e,m)},{cluster:s,labelBBox:{}}},"divider"),QA=vC,JA={rect:vC,squareRect:QA,roundedWithTitle:GA,noteGroup:VA,divider:ZA,kanbanSection:XA},SC=new Map,KA=l(async(t,e)=>{let r=e.shape||"rect",i=await JA[r](t,e);return SC.set(e.id,i),i},"insertCluster"),uE=l(()=>{SC=new Map},"clear");function TC(t,e){return t.intersect(e)}l(TC,"intersectNode");var tL=TC;function MC(t,e,r,i){var a=t.x,n=t.y,s=a-i.x,o=n-i.y,c=Math.sqrt(e*e*o*o+r*r*s*s),h=Math.abs(e*r*s/c);i.x0}l(Hh,"sameSign");var rL=LC;function FC(t,e,r){let i=t.x,a=t.y,n=[],s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(u){s=Math.min(s,u.x),o=Math.min(o,u.y)}):(s=Math.min(s,e.x),o=Math.min(o,e.y));let c=i-t.width/2-s,h=a-t.height/2-o;for(let u=0;u1&&n.sort(function(u,d){let p=u.x-r.x,f=u.y-r.y,g=Math.sqrt(p*p+f*f),m=d.x-r.x,y=d.y-r.y,x=Math.sqrt(m*m+y*y);return gu,":first-child");return d.attr("class","anchor").attr("style",Zt(o)),tt(e,d),e.intersect=function(p){return R.info("Circle intersect",e,s,p),H.circle(e,s,p)},n}l(EC,"anchor");function Uh(t,e,r,i,a,n,s){let o=(t+r)/2,c=(e+i)/2,h=Math.atan2(i-e,r-t),u=(r-t)/2,d=(i-e)/2,p=u/a,f=d/n,g=Math.sqrt(p**2+f**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");let m=Math.sqrt(1-g**2),y=o+m*n*Math.sin(h)*(s?-1:1),x=c-m*a*Math.cos(h)*(s?-1:1),b=Math.atan2((e-x)/n,(t-y)/a),k=Math.atan2((i-x)/n,(r-y)/a)-b;s&&k<0&&(k+=2*Math.PI),!s&&k>0&&(k-=2*Math.PI);let _=[];for(let C=0;C<20;C++){let $=C/19,S=b+$*k,D=y+a*Math.cos(S),N=x+n*Math.sin(S);_.push({x:D,y:N})}return _}l(Uh,"generateArcPoints");async function OC(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=n.width+e.padding+20,o=n.height+e.padding,c=o/2,h=c/(2.5+o/50),{cssStyles:u}=e,d=[{x:s/2,y:-o/2},{x:-s/2,y:-o/2},...Uh(-s/2,-o/2,-s/2,o/2,h,c,!1),{x:s/2,y:o/2},...Uh(s/2,o/2,s/2,-o/2,h,c,!0)],p=Q.svg(a),f=J(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let g=dt(d),m=p.path(g,f),y=a.insert(()=>m,":first-child");return y.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",u),i&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",i),y.attr("transform",`translate(${h/2}, 0)`),tt(e,y),e.intersect=function(x){return H.polygon(e,d,x)},a}l(OC,"bowTieRect");function yr(t,e,r,i){return t.insert("polygon",":first-child").attr("points",i.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}l(yr,"insertPolygonShape");async function DC(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=n.height+e.padding,o=12,c=n.width+e.padding+o,h=0,u=c,d=-s,p=0,f=[{x:h+o,y:d},{x:u,y:d},{x:u,y:p},{x:h,y:p},{x:h,y:d+o},{x:h+o,y:d}],g,{cssStyles:m}=e;if(e.look==="handDrawn"){let y=Q.svg(a),x=J(e,{}),b=dt(f),k=y.path(b,x);g=a.insert(()=>k,":first-child").attr("transform",`translate(${-c/2}, ${s/2})`),m&&g.attr("style",m)}else g=yr(a,c,s,f);return i&&g.attr("style",i),tt(e,g),e.intersect=function(y){return H.polygon(e,f,y)},a}l(DC,"card");function IC(t,e){let{nodeStyles:r}=K(e);e.label="";let i=t.insert("g").attr("class",nt(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,n=Math.max(28,e.width??0),s=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}],o=Q.svg(i),c=J(e,{});e.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");let h=dt(s),u=o.path(h,c),d=i.insert(()=>u,":first-child");return a&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",a),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(p){return H.polygon(e,s,p)},i}l(IC,"choice");async function sd(t,e,r){let{labelStyles:i,nodeStyles:a}=K(e);e.labelStyle=i;let{shapeSvg:n,bbox:s,halfPadding:o}=await st(t,e,nt(e)),c=r?.padding??o,h=s.width/2+c,u,{cssStyles:d}=e;if(e.look==="handDrawn"){let p=Q.svg(n),f=J(e,{}),g=p.circle(0,0,h*2,f);u=n.insert(()=>g,":first-child"),u.attr("class","basic label-container").attr("style",Zt(d))}else u=n.insert("circle",":first-child").attr("class","basic label-container").attr("style",a).attr("r",h).attr("cx",0).attr("cy",0);return tt(e,u),e.calcIntersect=function(p,f){let g=p.width/2;return H.circle(p,g,f)},e.intersect=function(p){return R.info("Circle intersect",e,h,p),H.circle(e,h,p)},n}l(sd,"circle");function RC(t){let e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=t*2,a={x:i/2*e,y:i/2*r},n={x:-(i/2)*e,y:i/2*r},s={x:-(i/2)*e,y:-(i/2)*r},o={x:i/2*e,y:-(i/2)*r};return`M ${n.x},${n.y} L ${o.x},${o.y} M ${a.x},${a.y} L ${s.x},${s.y}`}l(RC,"createLine");function NC(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r,e.label="";let a=t.insert("g").attr("class",nt(e)).attr("id",e.domId??e.id),n=Math.max(30,e?.width??0),{cssStyles:s}=e,o=Q.svg(a),c=J(e,{});e.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");let h=o.circle(0,0,n*2,c),u=RC(n),d=o.path(u,c),p=a.insert(()=>h,":first-child");return p.insert(()=>d),s&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",s),i&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",i),tt(e,p),e.intersect=function(f){return R.info("crossedCircle intersect",e,{radius:n,point:f}),H.circle(e,n,f)},a}l(NC,"crossedCircle");function je(t,e,r,i=100,a=0,n=180){let s=[],o=a*Math.PI/180,c=(n*Math.PI/180-o)/(i-1);for(let h=0;hb,":first-child").attr("stroke-opacity",0),k.insert(()=>y,":first-child"),k.attr("class","text"),u&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(${h}, 0)`),s.attr("transform",`translate(${-o/2+h-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),tt(e,k),e.intersect=function(_){return H.polygon(e,p,_)},a}l(PC,"curlyBraceLeft");function We(t,e,r,i=100,a=0,n=180){let s=[],o=a*Math.PI/180,c=(n*Math.PI/180-o)/(i-1);for(let h=0;hb,":first-child").attr("stroke-opacity",0),k.insert(()=>y,":first-child"),k.attr("class","text"),u&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&e.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(${-h}, 0)`),s.attr("transform",`translate(${-o/2+(e.padding??0)/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),tt(e,k),e.intersect=function(_){return H.polygon(e,p,_)},a}l(zC,"curlyBraceRight");function zt(t,e,r,i=100,a=0,n=180){let s=[],o=a*Math.PI/180,c=(n*Math.PI/180-o)/(i-1);for(let h=0;hC,":first-child").attr("stroke-opacity",0),$.insert(()=>x,":first-child"),$.insert(()=>k,":first-child"),$.attr("class","text"),u&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",u),i&&e.look!=="handDrawn"&&$.selectAll("path").attr("style",i),$.attr("transform",`translate(${h-h/4}, 0)`),s.attr("transform",`translate(${-o/2+(e.padding??0)/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),tt(e,$),e.intersect=function(S){return H.polygon(e,f,S)},a}l(qC,"curlyBraces");async function jC(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=80,o=20,c=Math.max(s,(n.width+(e.padding??0)*2)*1.25,e?.width??0),h=Math.max(o,n.height+(e.padding??0)*2,e?.height??0),u=h/2,{cssStyles:d}=e,p=Q.svg(a),f=J(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let g=c,m=h,y=g-u,x=m/4,b=[{x:y,y:0},{x,y:0},{x:0,y:m/2},{x,y:m},{x:y,y:m},...pn(-y,-m/2,u,50,270,90)],k=dt(b),_=p.path(k,f),C=a.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(${-c/2}, ${-h/2})`),tt(e,C),e.intersect=function($){return H.polygon(e,b,$)},a}l(jC,"curvedTrapezoid");var aL=l((t,e,r,i,a,n)=>[`M${t},${e+n}`,`a${a},${n} 0,0,0 ${r},0`,`a${a},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${n} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),nL=l((t,e,r,i,a,n)=>[`M${t},${e+n}`,`M${t+r},${e+n}`,`a${a},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${n} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),oL=l((t,e,r,i,a,n)=>[`M${t-r/2},${-i/2}`,`a${a},${n} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function WC(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=Math.max(n.width+e.padding,e.width??0),c=o/2,h=c/(2.5+o/50),u=Math.max(n.height+h+e.padding,e.height??0),d,{cssStyles:p}=e;if(e.look==="handDrawn"){let f=Q.svg(a),g=nL(0,0,o,u,c,h),m=oL(0,h,o,u,c,h),y=f.path(g,J(e,{})),x=f.path(m,J(e,{fill:"none"}));d=a.insert(()=>x,":first-child"),d=a.insert(()=>y,":first-child"),d.attr("class","basic label-container"),p&&d.attr("style",p)}else{let f=aL(0,0,o,u,c,h);d=a.insert("path",":first-child").attr("d",f).attr("class","basic label-container").attr("style",Zt(p)).attr("style",i)}return d.attr("label-offset-y",h),d.attr("transform",`translate(${-o/2}, ${-(u/2+h)})`),tt(e,d),s.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)+(e.padding??0)/1.5-(n.y-(n.top??0))})`),e.intersect=function(f){let g=H.rect(e,f),m=g.x-(e.x??0);if(c!=0&&(Math.abs(m)<(e.width??0)/2||Math.abs(m)==(e.width??0)/2&&Math.abs(g.y-(e.y??0))>(e.height??0)/2-h)){let y=h*h*(1-m*m/(c*c));y>0&&(y=Math.sqrt(y)),y=h-y,f.y-(e.y??0)>0&&(y=-y),g.y+=y}return g},a}l(WC,"cylinder");async function HC(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=n.width+e.padding,c=n.height+e.padding,h=c*.2,u=-o/2,d=-c/2-h/2,{cssStyles:p}=e,f=Q.svg(a),g=J(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let m=[{x:u,y:d+h},{x:-u,y:d+h},{x:-u,y:-d},{x:u,y:-d},{x:u,y:d},{x:-u,y:d},{x:-u,y:d+h}],y=f.polygon(m.map(b=>[b.x,b.y]),g),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",i),s.attr("transform",`translate(${u+(e.padding??0)/2-(n.x-(n.left??0))}, ${d+h+(e.padding??0)/2-(n.y-(n.top??0))})`),tt(e,x),e.intersect=function(b){return H.rect(e,b)},a}l(HC,"dividedRectangle");async function UC(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,halfPadding:s}=await st(t,e,nt(e)),o=n.width/2+s+5,c=n.width/2+s,h,{cssStyles:u}=e;if(e.look==="handDrawn"){let d=Q.svg(a),p=J(e,{roughness:.2,strokeWidth:2.5}),f=J(e,{roughness:.2,strokeWidth:1.5}),g=d.circle(0,0,o*2,p),m=d.circle(0,0,c*2,f);h=a.insert("g",":first-child"),h.attr("class",Zt(e.cssClasses)).attr("style",Zt(u)),h.node()?.appendChild(g),h.node()?.appendChild(m)}else{h=a.insert("g",":first-child");let d=h.insert("circle",":first-child"),p=h.insert("circle");h.attr("class","basic label-container").attr("style",i),d.attr("class","outer-circle").attr("style",i).attr("r",o).attr("cx",0).attr("cy",0),p.attr("class","inner-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0)}return tt(e,h),e.intersect=function(d){return R.info("DoubleCircle intersect",e,o,d),H.circle(e,o,d)},a}l(UC,"doublecircle");function YC(t,e,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=K(e);e.label="",e.labelStyle=i;let n=t.insert("g").attr("class",nt(e)).attr("id",e.domId??e.id),s=7,{cssStyles:o}=e,c=Q.svg(n),{nodeBorder:h}=r,u=J(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(u.roughness=0);let d=c.circle(0,0,s*2,u),p=n.insert(()=>d,":first-child");return p.selectAll("path").attr("style",`fill: ${h} !important;`),o&&o.length>0&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",o),a&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",a),tt(e,p),e.intersect=function(f){return R.info("filledCircle intersect",e,{radius:s,point:f}),H.circle(e,s,f)},n}l(YC,"filledCircle");async function VC(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=n.width+(e.padding??0),c=o+n.height,h=o+n.height,u=[{x:0,y:-c},{x:h,y:-c},{x:h/2,y:0}],{cssStyles:d}=e,p=Q.svg(a),f=J(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let g=dt(u),m=p.path(g,f),y=a.insert(()=>m,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return d&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",d),i&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),e.width=o,e.height=c,tt(e,y),s.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-c/2+(e.padding??0)/2+(n.y-(n.top??0))})`),e.intersect=function(x){return R.info("Triangle intersect",e,u,x),H.polygon(e,u,x)},a}l(VC,"flippedTriangle");function GC(t,e,{dir:r,config:{state:i,themeVariables:a}}){let{nodeStyles:n}=K(e);e.label="";let s=t.insert("g").attr("class",nt(e)).attr("id",e.domId??e.id),{cssStyles:o}=e,c=Math.max(70,e?.width??0),h=Math.max(10,e?.height??0);r==="LR"&&(c=Math.max(10,e?.width??0),h=Math.max(70,e?.height??0));let u=-1*c/2,d=-1*h/2,p=Q.svg(s),f=J(e,{stroke:a.lineColor,fill:a.lineColor});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let g=p.rectangle(u,d,c,h,f),m=s.insert(()=>g,":first-child");o&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",o),n&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",n),tt(e,m);let y=i?.padding??0;return e.width&&e.height&&(e.width+=y/2||0,e.height+=y/2||0),e.intersect=function(x){return H.rect(e,x)},s}l(GC,"forkJoin");async function XC(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let a=80,n=50,{shapeSvg:s,bbox:o}=await st(t,e,nt(e)),c=Math.max(a,o.width+(e.padding??0)*2,e?.width??0),h=Math.max(n,o.height+(e.padding??0)*2,e?.height??0),u=h/2,{cssStyles:d}=e,p=Q.svg(s),f=J(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let g=[{x:-c/2,y:-h/2},{x:c/2-u,y:-h/2},...pn(-c/2+u,0,u,50,90,270),{x:c/2-u,y:h/2},{x:-c/2,y:h/2}],m=dt(g),y=p.path(m,f),x=s.insert(()=>y,":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),tt(e,x),e.intersect=function(b){return R.info("Pill intersect",e,{radius:u,point:b}),H.polygon(e,g,b)},s}l(XC,"halfRoundedRectangle");async function ZC(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=n.height+(e.padding??0),o=n.width+(e.padding??0)*2.5,{cssStyles:c}=e,h=Q.svg(a),u=J(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let d=o/2,p=d/6;d=d+p;let f=s/2,g=f/2,m=d-g,y=[{x:-m,y:-f},{x:0,y:-f},{x:m,y:-f},{x:d,y:0},{x:m,y:f},{x:0,y:f},{x:-m,y:f},{x:-d,y:0}],x=dt(y),b=h.path(x,u),k=a.insert(()=>b,":first-child");return k.attr("class","basic label-container"),c&&e.look!=="handDrawn"&&k.selectChildren("path").attr("style",c),i&&e.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),e.width=o,e.height=s,tt(e,k),e.intersect=function(_){return H.polygon(e,y,_)},a}l(ZC,"hexagon");async function QC(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.label="",e.labelStyle=r;let{shapeSvg:a}=await st(t,e,nt(e)),n=Math.max(30,e?.width??0),s=Math.max(30,e?.height??0),{cssStyles:o}=e,c=Q.svg(a),h=J(e,{});e.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let u=[{x:0,y:0},{x:n,y:0},{x:0,y:s},{x:n,y:s}],d=dt(u),p=c.path(d,h),f=a.insert(()=>p,":first-child");return f.attr("class","basic label-container"),o&&e.look!=="handDrawn"&&f.selectChildren("path").attr("style",o),i&&e.look!=="handDrawn"&&f.selectChildren("path").attr("style",i),f.attr("transform",`translate(${-n/2}, ${-s/2})`),tt(e,f),e.intersect=function(g){return R.info("Pill intersect",e,{points:u}),H.polygon(e,u,g)},a}l(QC,"hourglass");async function JC(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=K(e);e.labelStyle=a;let n=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(n,s),c=i?.wrappingWidth;e.width=Math.max(o,c??0);let{shapeSvg:h,bbox:u,label:d}=await st(t,e,"icon-shape default"),p=e.pos==="t",f=o,g=o,{nodeBorder:m}=r,{stylesMap:y}=aa(e),x=-g/2,b=-f/2,k=e.label?8:0,_=Q.svg(h),C=J(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let $=_.rectangle(x,b,g,f,C),S=Math.max(g,u.width),D=f+u.height+k,N=_.rectangle(-S/2,-D/2,S,D,{...C,fill:"transparent",stroke:"none"}),I=h.insert(()=>$,":first-child"),T=h.insert(()=>N);if(e.icon){let O=h.append("g");O.html(`${await An(e.icon,{height:o,width:o,fallbackPrefix:""})}`);let A=O.node().getBBox(),v=A.width,L=A.height,B=A.x,E=A.y;O.attr("transform",`translate(${-v/2-B},${p?u.height/2+k/2-L/2-E:-u.height/2-k/2-L/2-E})`),O.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-D/2:D/2-u.height})`),I.attr("transform",`translate(0,${p?u.height/2+k/2:-u.height/2-k/2})`),tt(e,T),e.intersect=function(O){if(R.info("iconSquare intersect",e,O),!e.label)return H.rect(e,O);let A=e.x??0,v=e.y??0,L=e.height??0,B=[];return p?B=[{x:A-u.width/2,y:v-L/2},{x:A+u.width/2,y:v-L/2},{x:A+u.width/2,y:v-L/2+u.height+k},{x:A+g/2,y:v-L/2+u.height+k},{x:A+g/2,y:v+L/2},{x:A-g/2,y:v+L/2},{x:A-g/2,y:v-L/2+u.height+k},{x:A-u.width/2,y:v-L/2+u.height+k}]:B=[{x:A-g/2,y:v-L/2},{x:A+g/2,y:v-L/2},{x:A+g/2,y:v-L/2+f},{x:A+u.width/2,y:v-L/2+f},{x:A+u.width/2/2,y:v+L/2},{x:A-u.width/2,y:v+L/2},{x:A-u.width/2,y:v-L/2+f},{x:A-g/2,y:v-L/2+f}],H.polygon(e,B,O)},h}l(JC,"icon");async function KC(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=K(e);e.labelStyle=a;let n=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(n,s),c=i?.wrappingWidth;e.width=Math.max(o,c??0);let{shapeSvg:h,bbox:u,label:d}=await st(t,e,"icon-shape default"),p=20,f=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=aa(e),b=Q.svg(h),k=J(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let _=x.get("fill");k.stroke=_??y;let C=h.append("g");e.icon&&C.html(`${await An(e.icon,{height:o,width:o,fallbackPrefix:""})}`);let $=C.node().getBBox(),S=$.width,D=$.height,N=$.x,I=$.y,T=Math.max(S,D)*Math.SQRT2+p*2,O=b.circle(0,0,T,k),A=Math.max(T,u.width),v=T+u.height+f,L=b.rectangle(-A/2,-v/2,A,v,{...k,fill:"transparent",stroke:"none"}),B=h.insert(()=>O,":first-child"),E=h.insert(()=>L);return C.attr("transform",`translate(${-S/2-N},${g?u.height/2+f/2-D/2-I:-u.height/2-f/2-D/2-I})`),C.attr("style",`color: ${x.get("stroke")??m};`),d.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${g?-v/2:v/2-u.height})`),B.attr("transform",`translate(0,${g?u.height/2+f/2:-u.height/2-f/2})`),tt(e,E),e.intersect=function(F){return R.info("iconSquare intersect",e,F),H.rect(e,F)},h}l(KC,"iconCircle");async function tw(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=K(e);e.labelStyle=a;let n=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(n,s),c=i?.wrappingWidth;e.width=Math.max(o,c??0);let{shapeSvg:h,bbox:u,halfPadding:d,label:p}=await st(t,e,"icon-shape default"),f=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:b}=aa(e),k=-m/2,_=-g/2,C=e.label?8:0,$=Q.svg(h),S=J(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let D=b.get("fill");S.stroke=D??x;let N=$.path(mr(k,_,m,g,5),S),I=Math.max(m,u.width),T=g+u.height+C,O=$.rectangle(-I/2,-T/2,I,T,{...S,fill:"transparent",stroke:"none"}),A=h.insert(()=>N,":first-child").attr("class","icon-shape2"),v=h.insert(()=>O);if(e.icon){let L=h.append("g");L.html(`${await An(e.icon,{height:o,width:o,fallbackPrefix:""})}`);let B=L.node().getBBox(),E=B.width,F=B.height,z=B.x,Y=B.y;L.attr("transform",`translate(${-E/2-z},${f?u.height/2+C/2-F/2-Y:-u.height/2-C/2-F/2-Y})`),L.attr("style",`color: ${b.get("stroke")??y};`)}return p.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${f?-T/2:T/2-u.height})`),A.attr("transform",`translate(0,${f?u.height/2+C/2:-u.height/2-C/2})`),tt(e,v),e.intersect=function(L){if(R.info("iconSquare intersect",e,L),!e.label)return H.rect(e,L);let B=e.x??0,E=e.y??0,F=e.height??0,z=[];return f?z=[{x:B-u.width/2,y:E-F/2},{x:B+u.width/2,y:E-F/2},{x:B+u.width/2,y:E-F/2+u.height+C},{x:B+m/2,y:E-F/2+u.height+C},{x:B+m/2,y:E+F/2},{x:B-m/2,y:E+F/2},{x:B-m/2,y:E-F/2+u.height+C},{x:B-u.width/2,y:E-F/2+u.height+C}]:z=[{x:B-m/2,y:E-F/2},{x:B+m/2,y:E-F/2},{x:B+m/2,y:E-F/2+g},{x:B+u.width/2,y:E-F/2+g},{x:B+u.width/2/2,y:E+F/2},{x:B-u.width/2,y:E+F/2},{x:B-u.width/2,y:E-F/2+g},{x:B-m/2,y:E-F/2+g}],H.polygon(e,z,L)},h}l(tw,"iconRounded");async function ew(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=K(e);e.labelStyle=a;let n=e.assetHeight??48,s=e.assetWidth??48,o=Math.max(n,s),c=i?.wrappingWidth;e.width=Math.max(o,c??0);let{shapeSvg:h,bbox:u,halfPadding:d,label:p}=await st(t,e,"icon-shape default"),f=e.pos==="t",g=o+d*2,m=o+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:b}=aa(e),k=-m/2,_=-g/2,C=e.label?8:0,$=Q.svg(h),S=J(e,{});e.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let D=b.get("fill");S.stroke=D??x;let N=$.path(mr(k,_,m,g,.1),S),I=Math.max(m,u.width),T=g+u.height+C,O=$.rectangle(-I/2,-T/2,I,T,{...S,fill:"transparent",stroke:"none"}),A=h.insert(()=>N,":first-child"),v=h.insert(()=>O);if(e.icon){let L=h.append("g");L.html(`${await An(e.icon,{height:o,width:o,fallbackPrefix:""})}`);let B=L.node().getBBox(),E=B.width,F=B.height,z=B.x,Y=B.y;L.attr("transform",`translate(${-E/2-z},${f?u.height/2+C/2-F/2-Y:-u.height/2-C/2-F/2-Y})`),L.attr("style",`color: ${b.get("stroke")??y};`)}return p.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${f?-T/2:T/2-u.height})`),A.attr("transform",`translate(0,${f?u.height/2+C/2:-u.height/2-C/2})`),tt(e,v),e.intersect=function(L){if(R.info("iconSquare intersect",e,L),!e.label)return H.rect(e,L);let B=e.x??0,E=e.y??0,F=e.height??0,z=[];return f?z=[{x:B-u.width/2,y:E-F/2},{x:B+u.width/2,y:E-F/2},{x:B+u.width/2,y:E-F/2+u.height+C},{x:B+m/2,y:E-F/2+u.height+C},{x:B+m/2,y:E+F/2},{x:B-m/2,y:E+F/2},{x:B-m/2,y:E-F/2+u.height+C},{x:B-u.width/2,y:E-F/2+u.height+C}]:z=[{x:B-m/2,y:E-F/2},{x:B+m/2,y:E-F/2},{x:B+m/2,y:E-F/2+g},{x:B+u.width/2,y:E-F/2+g},{x:B+u.width/2/2,y:E+F/2},{x:B-u.width/2,y:E+F/2},{x:B-u.width/2,y:E-F/2+g},{x:B-m/2,y:E-F/2+g}],H.polygon(e,z,L)},h}l(ew,"iconSquare");async function rw(t,e,{config:{flowchart:r}}){let i=new Image;i.src=e?.img??"",await i.decode();let a=Number(i.naturalWidth.toString().replace("px","")),n=Number(i.naturalHeight.toString().replace("px",""));e.imageAspectRatio=a/n;let{labelStyles:s}=K(e);e.labelStyle=s;let o=r?.wrappingWidth;e.defaultWidth=r?.wrappingWidth;let c=Math.max(e.label?o??0:0,e?.assetWidth??a),h=e.constraint==="on"&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:c,u=e.constraint==="on"?h/e.imageAspectRatio:e?.assetHeight??n;e.width=Math.max(h,o??0);let{shapeSvg:d,bbox:p,label:f}=await st(t,e,"image-shape default"),g=e.pos==="t",m=-h/2,y=-u/2,x=e.label?8:0,b=Q.svg(d),k=J(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let _=b.rectangle(m,y,h,u,k),C=Math.max(h,p.width),$=u+p.height+x,S=b.rectangle(-C/2,-$/2,C,$,{...k,fill:"none",stroke:"none"}),D=d.insert(()=>_,":first-child"),N=d.insert(()=>S);if(e.img){let I=d.append("image");I.attr("href",e.img),I.attr("width",h),I.attr("height",u),I.attr("preserveAspectRatio","none"),I.attr("transform",`translate(${-h/2},${g?$/2-u:-$/2})`)}return f.attr("transform",`translate(${-p.width/2-(p.x-(p.left??0))},${g?-u/2-p.height/2-x/2:u/2-p.height/2+x/2})`),D.attr("transform",`translate(0,${g?p.height/2+x/2:-p.height/2-x/2})`),tt(e,N),e.intersect=function(I){if(R.info("iconSquare intersect",e,I),!e.label)return H.rect(e,I);let T=e.x??0,O=e.y??0,A=e.height??0,v=[];return g?v=[{x:T-p.width/2,y:O-A/2},{x:T+p.width/2,y:O-A/2},{x:T+p.width/2,y:O-A/2+p.height+x},{x:T+h/2,y:O-A/2+p.height+x},{x:T+h/2,y:O+A/2},{x:T-h/2,y:O+A/2},{x:T-h/2,y:O-A/2+p.height+x},{x:T-p.width/2,y:O-A/2+p.height+x}]:v=[{x:T-h/2,y:O-A/2},{x:T+h/2,y:O-A/2},{x:T+h/2,y:O-A/2+u},{x:T+p.width/2,y:O-A/2+u},{x:T+p.width/2/2,y:O+A/2},{x:T-p.width/2,y:O+A/2},{x:T-p.width/2,y:O-A/2+u},{x:T-h/2,y:O-A/2+u}],H.polygon(e,v,I)},d}l(rw,"imageSquare");async function iw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),o=Math.max(n.height+(e.padding??0)*2,e?.height??0),c=[{x:0,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:-3*o/6,y:-o}],h,{cssStyles:u}=e;if(e.look==="handDrawn"){let d=Q.svg(a),p=J(e,{}),f=dt(c),g=d.path(f,p);h=a.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),u&&h.attr("style",u)}else h=yr(a,s,o,c);return i&&h.attr("style",i),e.width=s,e.height=o,tt(e,h),e.intersect=function(d){return H.polygon(e,c,d)},a}l(iw,"inv_trapezoid");async function Ys(t,e,r){let{labelStyles:i,nodeStyles:a}=K(e);e.labelStyle=i;let{shapeSvg:n,bbox:s}=await st(t,e,nt(e)),o=Math.max(s.width+r.labelPaddingX*2,e?.width||0),c=Math.max(s.height+r.labelPaddingY*2,e?.height||0),h=-o/2,u=-c/2,d,{rx:p,ry:f}=e,{cssStyles:g}=e;if(r?.rx&&r.ry&&(p=r.rx,f=r.ry),e.look==="handDrawn"){let m=Q.svg(n),y=J(e,{}),x=p||f?m.path(mr(h,u,o,c,p||0),y):m.rectangle(h,u,o,c,y);d=n.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",Zt(g))}else d=n.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",a).attr("rx",Zt(p)).attr("ry",Zt(f)).attr("x",h).attr("y",u).attr("width",o).attr("height",c);return tt(e,d),e.calcIntersect=function(m,y){return H.rect(m,y)},e.intersect=function(m){return H.rect(e,m)},n}l(Ys,"drawRect");async function aw(t,e){let{shapeSvg:r,bbox:i,label:a}=await st(t,e,"label"),n=r.insert("rect",":first-child");return n.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),a.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),tt(e,n),e.intersect=function(s){return H.rect(e,s)},r}l(aw,"labelRect");async function nw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=Math.max(n.width+(e.padding??0),e?.width??0),o=Math.max(n.height+(e.padding??0),e?.height??0),c=[{x:0,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:-(3*o)/6,y:-o}],h,{cssStyles:u}=e;if(e.look==="handDrawn"){let d=Q.svg(a),p=J(e,{}),f=dt(c),g=d.path(f,p);h=a.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),u&&h.attr("style",u)}else h=yr(a,s,o,c);return i&&h.attr("style",i),e.width=s,e.height=o,tt(e,h),e.intersect=function(d){return H.polygon(e,c,d)},a}l(nw,"lean_left");async function ow(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=Math.max(n.width+(e.padding??0),e?.width??0),o=Math.max(n.height+(e.padding??0),e?.height??0),c=[{x:-3*o/6,y:0},{x:s,y:0},{x:s+3*o/6,y:-o},{x:0,y:-o}],h,{cssStyles:u}=e;if(e.look==="handDrawn"){let d=Q.svg(a),p=J(e,{}),f=dt(c),g=d.path(f,p);h=a.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),u&&h.attr("style",u)}else h=yr(a,s,o,c);return i&&h.attr("style",i),e.width=s,e.height=o,tt(e,h),e.intersect=function(d){return H.polygon(e,c,d)},a}l(ow,"lean_right");function sw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.label="",e.labelStyle=r;let a=t.insert("g").attr("class",nt(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,s=Math.max(35,e?.width??0),o=Math.max(35,e?.height??0),c=7,h=[{x:s,y:0},{x:0,y:o+c/2},{x:s-2*c,y:o+c/2},{x:0,y:2*o},{x:s,y:o-c/2},{x:2*c,y:o-c/2}],u=Q.svg(a),d=J(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let p=dt(h),f=u.path(p,d),g=a.insert(()=>f,":first-child");return n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),i&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${s/2},${-o})`),tt(e,g),e.intersect=function(m){return R.info("lightningBolt intersect",e,m),H.polygon(e,h,m)},a}l(sw,"lightningBolt");var sL=l((t,e,r,i,a,n,s)=>[`M${t},${e+n}`,`a${a},${n} 0,0,0 ${r},0`,`a${a},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${n} 0,0,0 ${r},0`,`l0,${-i}`,`M${t},${e+n+s}`,`a${a},${n} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),lL=l((t,e,r,i,a,n,s)=>[`M${t},${e+n}`,`M${t+r},${e+n}`,`a${a},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${a},${n} 0,0,0 ${r},0`,`l0,${-i}`,`M${t},${e+n+s}`,`a${a},${n} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),hL=l((t,e,r,i,a,n)=>[`M${t-r/2},${-i/2}`,`a${a},${n} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function lw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=Math.max(n.width+(e.padding??0),e.width??0),c=o/2,h=c/(2.5+o/50),u=Math.max(n.height+h+(e.padding??0),e.height??0),d=u*.1,p,{cssStyles:f}=e;if(e.look==="handDrawn"){let g=Q.svg(a),m=lL(0,0,o,u,c,h,d),y=hL(0,h,o,u,c,h),x=J(e,{}),b=g.path(m,x),k=g.path(y,x);a.insert(()=>k,":first-child").attr("class","line"),p=a.insert(()=>b,":first-child"),p.attr("class","basic label-container"),f&&p.attr("style",f)}else{let g=sL(0,0,o,u,c,h,d);p=a.insert("path",":first-child").attr("d",g).attr("class","basic label-container").attr("style",Zt(f)).attr("style",i)}return p.attr("label-offset-y",h),p.attr("transform",`translate(${-o/2}, ${-(u/2+h)})`),tt(e,p),s.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)+h-(n.y-(n.top??0))})`),e.intersect=function(g){let m=H.rect(e,g),y=m.x-(e.x??0);if(c!=0&&(Math.abs(y)<(e.width??0)/2||Math.abs(y)==(e.width??0)/2&&Math.abs(m.y-(e.y??0))>(e.height??0)/2-h)){let x=h*h*(1-y*y/(c*c));x>0&&(x=Math.sqrt(x)),x=h-x,g.y-(e.y??0)>0&&(x=-x),m.y+=x}return m},a}l(lw,"linedCylinder");async function hw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),h=c/4,u=c+h,{cssStyles:d}=e,p=Q.svg(a),f=J(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let g=[{x:-o/2-o/2*.1,y:-u/2},{x:-o/2-o/2*.1,y:u/2},...ur(-o/2-o/2*.1,u/2,o/2+o/2*.1,u/2,h,.8),{x:o/2+o/2*.1,y:-u/2},{x:-o/2-o/2*.1,y:-u/2},{x:-o/2,y:-u/2},{x:-o/2,y:u/2*1.1},{x:-o/2,y:-u/2}],m=p.polygon(g.map(x=>[x.x,x.y]),f),y=a.insert(()=>m,":first-child");return y.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",d),i&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",i),y.attr("transform",`translate(0,${-h/2})`),s.attr("transform",`translate(${-o/2+(e.padding??0)+o/2*.1/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)-h/2-(n.y-(n.top??0))})`),tt(e,y),e.intersect=function(x){return H.polygon(e,g,x)},a}l(hw,"linedWaveEdgedRect");async function cw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),h=5,u=-o/2,d=-c/2,{cssStyles:p}=e,f=Q.svg(a),g=J(e,{}),m=[{x:u-h,y:d+h},{x:u-h,y:d+c+h},{x:u+o-h,y:d+c+h},{x:u+o-h,y:d+c},{x:u+o,y:d+c},{x:u+o,y:d+c-h},{x:u+o+h,y:d+c-h},{x:u+o+h,y:d-h},{x:u+h,y:d-h},{x:u+h,y:d},{x:u,y:d},{x:u,y:d+h}],y=[{x:u,y:d+h},{x:u+o-h,y:d+h},{x:u+o-h,y:d+c},{x:u+o,y:d+c},{x:u+o,y:d},{x:u,y:d}];e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let x=dt(m),b=f.path(x,g),k=dt(y),_=f.path(k,{...g,fill:"none"}),C=a.insert(()=>_,":first-child");return C.insert(()=>b,":first-child"),C.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",i),s.attr("transform",`translate(${-(n.width/2)-h-(n.x-(n.left??0))}, ${-(n.height/2)+h-(n.y-(n.top??0))})`),tt(e,C),e.intersect=function($){return H.polygon(e,m,$)},a}l(cw,"multiRect");async function uw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),h=c/4,u=c+h,d=-o/2,p=-u/2,f=5,{cssStyles:g}=e,m=ur(d-f,p+u+f,d+o-f,p+u+f,h,.8),y=m?.[m.length-1],x=[{x:d-f,y:p+f},{x:d-f,y:p+u+f},...m,{x:d+o-f,y:y.y-f},{x:d+o,y:y.y-f},{x:d+o,y:y.y-2*f},{x:d+o+f,y:y.y-2*f},{x:d+o+f,y:p-f},{x:d+f,y:p-f},{x:d+f,y:p},{x:d,y:p},{x:d,y:p+f}],b=[{x:d,y:p+f},{x:d+o-f,y:p+f},{x:d+o-f,y:y.y-f},{x:d+o,y:y.y-f},{x:d+o,y:p},{x:d,y:p}],k=Q.svg(a),_=J(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");let C=dt(x),$=k.path(C,_),S=dt(b),D=k.path(S,_),N=a.insert(()=>$,":first-child");return N.insert(()=>D),N.attr("class","basic label-container"),g&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",g),i&&e.look!=="handDrawn"&&N.selectAll("path").attr("style",i),N.attr("transform",`translate(0,${-h/2})`),s.attr("transform",`translate(${-(n.width/2)-f-(n.x-(n.left??0))}, ${-(n.height/2)+f-h/2-(n.y-(n.top??0))})`),tt(e,N),e.intersect=function(I){return H.polygon(e,x,I)},a}l(uw,"multiWaveEdgedRectangle");async function dw(t,e,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=K(e);e.labelStyle=i,e.useHtmlLabels||Gt().flowchart?.htmlLabels!==!1||(e.centerLabel=!0);let{shapeSvg:n,bbox:s,label:o}=await st(t,e,nt(e)),c=Math.max(s.width+(e.padding??0)*2,e?.width??0),h=Math.max(s.height+(e.padding??0)*2,e?.height??0),u=-c/2,d=-h/2,{cssStyles:p}=e,f=Q.svg(n),g=J(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let m=f.rectangle(u,d,c,h,g),y=n.insert(()=>m,":first-child");return y.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",p),a&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",a),o.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),tt(e,y),e.intersect=function(x){return H.rect(e,x)},n}l(dw,"note");var cL=l((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 pw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=n.width+e.padding,o=n.height+e.padding,c=s+o,h=.5,u=[{x:c/2,y:0},{x:c,y:-c/2},{x:c/2,y:-c},{x:0,y:-c/2}],d,{cssStyles:p}=e;if(e.look==="handDrawn"){let f=Q.svg(a),g=J(e,{}),m=cL(0,0,c),y=f.path(m,g);d=a.insert(()=>y,":first-child").attr("transform",`translate(${-c/2+h}, ${c/2})`),p&&d.attr("style",p)}else d=yr(a,c,c,u),d.attr("transform",`translate(${-c/2+h}, ${c/2})`);return i&&d.attr("style",i),tt(e,d),e.calcIntersect=function(f,g){let m=f.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],x=H.polygon(f,y,g);return{x:x.x-.5,y:x.y-.5}},e.intersect=function(f){return this.calcIntersect(e,f)},a}l(pw,"question");async function fw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=Math.max(n.width+(e.padding??0),e?.width??0),c=Math.max(n.height+(e.padding??0),e?.height??0),h=-o/2,u=-c/2,d=u/2,p=[{x:h+d,y:u},{x:h,y:0},{x:h+d,y:-u},{x:-h,y:-u},{x:-h,y:u}],{cssStyles:f}=e,g=Q.svg(a),m=J(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let y=dt(p),x=g.path(y,m),b=a.insert(()=>x,":first-child");return b.attr("class","basic label-container"),f&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",f),i&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",i),b.attr("transform",`translate(${-d/2},0)`),s.attr("transform",`translate(${-d/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),tt(e,b),e.intersect=function(k){return H.polygon(e,p,k)},a}l(fw,"rect_left_inv_arrow");async function gw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let a;e.cssClasses?a="node "+e.cssClasses:a="node default";let n=t.insert("g").attr("class",a).attr("id",e.domId||e.id),s=n.insert("g"),o=n.insert("g").attr("class","label").attr("style",i),c=e.description,h=e.label,u=o.node().appendChild(await Br(h,e.labelStyle,!0,!0)),d={width:0,height:0};if(Et(xt()?.flowchart?.htmlLabels)){let D=u.children[0],N=pt(u);d=D.getBoundingClientRect(),N.attr("width",d.width),N.attr("height",d.height)}R.info("Text 2",c);let p=c||[],f=u.getBBox(),g=o.node().appendChild(await Br(p.join?p.join("
    "):p,e.labelStyle,!0,!0)),m=g.children[0],y=pt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);let x=(e.padding||0)/2;pt(g).attr("transform","translate( "+(d.width>f.width?0:(f.width-d.width)/2)+", "+(f.height+x+5)+")"),pt(u).attr("transform","translate( "+(d.width(R.debug("Rough node insert CXC",I),T),":first-child"),$=n.insert(()=>(R.debug("Rough node insert CXC",I),I),":first-child")}else $=s.insert("rect",":first-child"),S=s.insert("line"),$.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)),S.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+f.height+x).attr("y2",-d.height/2-x+f.height+x);return tt(e,$),e.intersect=function(D){return H.rect(e,D)},n}l(gw,"rectWithTitle");function Sa(t,e,r,i,a,n,s){let o=(t+r)/2,c=(e+i)/2,h=Math.atan2(i-e,r-t),u=(r-t)/2,d=(i-e)/2,p=u/a,f=d/n,g=Math.sqrt(p**2+f**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");let m=Math.sqrt(1-g**2),y=o+m*n*Math.sin(h)*(s?-1:1),x=c-m*a*Math.cos(h)*(s?-1:1),b=Math.atan2((e-x)/n,(t-y)/a),k=Math.atan2((i-x)/n,(r-y)/a)-b;s&&k<0&&(k+=2*Math.PI),!s&&k>0&&(k-=2*Math.PI);let _=[];for(let C=0;C<20;C++){let $=C/19,S=b+$*k,D=y+a*Math.cos(S),N=x+n*Math.sin(S);_.push({x:D,y:N})}return _}l(Sa,"generateArcPoints");async function mw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=e?.padding??0,o=e?.padding??0,c=(e?.width?e?.width:n.width)+s*2,h=(e?.height?e?.height:n.height)+o*2,u=e.radius||5,d=e.taper||5,{cssStyles:p}=e,f=Q.svg(a),g=J(e,{});e.stroke&&(g.stroke=e.stroke),e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let m=[{x:-c/2+d,y:-h/2},{x:c/2-d,y:-h/2},...Sa(c/2-d,-h/2,c/2,-h/2+d,u,u,!0),{x:c/2,y:-h/2+d},{x:c/2,y:h/2-d},...Sa(c/2,h/2-d,c/2-d,h/2,u,u,!0),{x:c/2-d,y:h/2},{x:-c/2+d,y:h/2},...Sa(-c/2+d,h/2,-c/2,h/2-d,u,u,!0),{x:-c/2,y:h/2-d},{x:-c/2,y:-h/2+d},...Sa(-c/2,-h/2+d,-c/2+d,-h/2,u,u,!0)],y=dt(m),x=f.path(y,g),b=a.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),i&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",i),tt(e,b),e.intersect=function(k){return H.polygon(e,m,k)},a}l(mw,"roundedRect");async function yw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=e?.padding??0,c=Math.max(n.width+(e.padding??0)*2,e?.width??0),h=Math.max(n.height+(e.padding??0)*2,e?.height??0),u=-n.width/2-o,d=-n.height/2-o,{cssStyles:p}=e,f=Q.svg(a),g=J(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let m=[{x:u,y:d},{x:u+c+8,y:d},{x:u+c+8,y:d+h},{x:u-8,y:d+h},{x:u-8,y:d},{x:u,y:d},{x:u,y:d+h}],y=f.polygon(m.map(b=>[b.x,b.y]),g),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container").attr("style",Zt(p)),i&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",i),p&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",i),s.attr("transform",`translate(${-c/2+4+(e.padding??0)-(n.x-(n.left??0))},${-h/2+(e.padding??0)-(n.y-(n.top??0))})`),tt(e,x),e.intersect=function(b){return H.rect(e,b)},a}l(yw,"shadedProcess");async function xw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),h=-o/2,u=-c/2,{cssStyles:d}=e,p=Q.svg(a),f=J(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let g=[{x:h,y:u},{x:h,y:u+c},{x:h+o,y:u+c},{x:h+o,y:u-c/2}],m=dt(g),y=p.path(m,f),x=a.insert(()=>y,":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, ${c/4})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(n.x-(n.left??0))}, ${-c/4+(e.padding??0)-(n.y-(n.top??0))})`),tt(e,x),e.intersect=function(b){return H.polygon(e,g,b)},a}l(xw,"slopedRect");async function bw(t,e){let r={rx:0,ry:0,labelPaddingX:e.labelPaddingX??(e?.padding||0)*2,labelPaddingY:(e?.padding||0)*1};return Ys(t,e,r)}l(bw,"squareRect");async function kw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=n.height+e.padding,o=n.width+s/4+e.padding,c=s/2,{cssStyles:h}=e,u=Q.svg(a),d=J(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let p=[{x:-o/2+c,y:-s/2},{x:o/2-c,y:-s/2},...pn(-o/2+c,0,c,50,90,270),{x:o/2-c,y:s/2},...pn(o/2-c,0,c,50,270,450)],f=dt(p),g=u.path(f,d),m=a.insert(()=>g,":first-child");return m.attr("class","basic label-container outer-path"),h&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",h),i&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",i),tt(e,m),e.intersect=function(y){return H.polygon(e,p,y)},a}l(kw,"stadium");async function Cw(t,e){return Ys(t,e,{rx:5,ry:5})}l(Cw,"state");function ww(t,e,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=K(e);e.labelStyle=i;let{cssStyles:n}=e,{lineColor:s,stateBorder:o,nodeBorder:c}=r,h=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),u=Q.svg(h),d=J(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let p=u.circle(0,0,14,{...d,stroke:s,strokeWidth:2}),f=o??c,g=u.circle(0,0,5,{...d,fill:f,stroke:f,strokeWidth:2,fillStyle:"solid"}),m=h.insert(()=>p,":first-child");return m.insert(()=>g),n&&m.selectAll("path").attr("style",n),a&&m.selectAll("path").attr("style",a),tt(e,m),e.intersect=function(y){return H.circle(e,7,y)},h}l(ww,"stateEnd");function $w(t,e,{config:{themeVariables:r}}){let{lineColor:i}=r,a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),n;if(e.look==="handDrawn"){let s=Q.svg(a).circle(0,0,14,C3(i));n=a.insert(()=>s),n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else n=a.insert("circle",":first-child"),n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return tt(e,n),e.intersect=function(s){return H.circle(e,7,s)},a}l($w,"stateStart");async function _w(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=(e?.padding||0)/2,o=n.width+e.padding,c=n.height+e.padding,h=-n.width/2-s,u=-n.height/2-s,d=[{x:0,y:0},{x:o,y:0},{x:o,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:o+8,y:0},{x:o+8,y:-c},{x:-8,y:-c},{x:-8,y:0}];if(e.look==="handDrawn"){let p=Q.svg(a),f=J(e,{}),g=p.rectangle(h-8,u,o+16,c,f),m=p.line(h,u,h,u+c,f),y=p.line(h+o,u,h+o,u+c,f);a.insert(()=>m,":first-child"),a.insert(()=>y,":first-child");let x=a.insert(()=>g,":first-child"),{cssStyles:b}=e;x.attr("class","basic label-container").attr("style",Zt(b)),tt(e,x)}else{let p=yr(a,o,c,d);i&&p.attr("style",i),tt(e,p)}return e.intersect=function(p){return H.polygon(e,d,p)},a}l(_w,"subroutine");async function vw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),o=Math.max(n.height+(e.padding??0)*2,e?.height??0),c=-s/2,h=-o/2,u=.2*o,d=.2*o,{cssStyles:p}=e,f=Q.svg(a),g=J(e,{}),m=[{x:c-u/2,y:h},{x:c+s+u/2,y:h},{x:c+s+u/2,y:h+o},{x:c-u/2,y:h+o}],y=[{x:c+s-u/2,y:h+o},{x:c+s+u/2,y:h+o},{x:c+s+u/2,y:h+o-d}];e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let x=dt(m),b=f.path(x,g),k=dt(y),_=f.path(k,{...g,fillStyle:"solid"}),C=a.insert(()=>_,":first-child");return C.insert(()=>b,":first-child"),C.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",p),i&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",i),tt(e,C),e.intersect=function($){return H.polygon(e,m,$)},a}l(vw,"taggedRect");async function Sw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),h=c/4,u=.2*o,d=.2*c,p=c+h,{cssStyles:f}=e,g=Q.svg(a),m=J(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let y=[{x:-o/2-o/2*.1,y:p/2},...ur(-o/2-o/2*.1,p/2,o/2+o/2*.1,p/2,h,.8),{x:o/2+o/2*.1,y:-p/2},{x:-o/2-o/2*.1,y:-p/2}],x=-o/2+o/2*.1,b=-p/2-d*.4,k=[{x:x+o-u,y:(b+c)*1.4},{x:x+o,y:b+c-d},{x:x+o,y:(b+c)*.9},...ur(x+o,(b+c)*1.3,x+o-u,(b+c)*1.5,-c*.03,.5)],_=dt(y),C=g.path(_,m),$=dt(k),S=g.path($,{...m,fillStyle:"solid"}),D=a.insert(()=>S,":first-child");return D.insert(()=>C,":first-child"),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})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(n.x-(n.left??0))},${-c/2+(e.padding??0)-h/2-(n.y-(n.top??0))})`),tt(e,D),e.intersect=function(N){return H.polygon(e,y,N)},a}l(Sw,"taggedWaveEdgedRectangle");async function Tw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=Math.max(n.width+e.padding,e?.width||0),o=Math.max(n.height+e.padding,e?.height||0),c=-s/2,h=-o/2,u=a.insert("rect",":first-child");return u.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",c).attr("y",h).attr("width",s).attr("height",o),tt(e,u),e.intersect=function(d){return H.rect(e,d)},a}l(Tw,"text");var uL=l((t,e,r,i,a,n)=>`M${t},${e} a${a},${n} 0,0,1 0,${-i} l${r},0 a${a},${n} 0,0,1 0,${i} M${r},${-i} a${a},${n} 0,0,0 0,${i} l${-r},0`,"createCylinderPathD"),dL=l((t,e,r,i,a,n)=>[`M${t},${e}`,`M${t+r},${e}`,`a${a},${n} 0,0,0 0,${-i}`,`l${-r},0`,`a${a},${n} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),pL=l((t,e,r,i,a,n)=>[`M${t+r/2},${-i/2}`,`a${a},${n} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD");async function Mw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s,halfPadding:o}=await st(t,e,nt(e)),c=e.look==="neo"?o*2:o,h=n.height+c,u=h/2,d=u/(2.5+h/50),p=n.width+d+c,{cssStyles:f}=e,g;if(e.look==="handDrawn"){let m=Q.svg(a),y=dL(0,0,p,h,d,u),x=pL(0,0,p,h,d,u),b=m.path(y,J(e,{})),k=m.path(x,J(e,{fill:"none"}));g=a.insert(()=>k,":first-child"),g=a.insert(()=>b,":first-child"),g.attr("class","basic label-container"),f&&g.attr("style",f)}else{let m=uL(0,0,p,h,d,u);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Zt(f)).attr("style",i),g.attr("class","basic label-container"),f&&g.selectAll("path").attr("style",f),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-p/2}, ${h/2} )`),s.attr("transform",`translate(${-(n.width/2)-d-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),tt(e,g),e.intersect=function(m){let y=H.rect(e,m),x=y.y-(e.y??0);if(u!=0&&(Math.abs(x)<(e.height??0)/2||Math.abs(x)==(e.height??0)/2&&Math.abs(y.x-(e.x??0))>(e.width??0)/2-d)){let b=d*d*(1-x*x/(u*u));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,m.x-(e.x??0)>0&&(b=-b),y.x+=b}return y},a}l(Mw,"tiltedCylinder");async function Bw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=n.width+e.padding,o=n.height+e.padding,c=[{x:-3*o/6,y:0},{x:s+3*o/6,y:0},{x:s,y:-o},{x:0,y:-o}],h,{cssStyles:u}=e;if(e.look==="handDrawn"){let d=Q.svg(a),p=J(e,{}),f=dt(c),g=d.path(f,p);h=a.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${o/2})`),u&&h.attr("style",u)}else h=yr(a,s,o,c);return i&&h.attr("style",i),e.width=s,e.height=o,tt(e,h),e.intersect=function(d){return H.polygon(e,c,d)},a}l(Bw,"trapezoid");async function Aw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=60,o=20,c=Math.max(s,n.width+(e.padding??0)*2,e?.width??0),h=Math.max(o,n.height+(e.padding??0)*2,e?.height??0),{cssStyles:u}=e,d=Q.svg(a),p=J(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let f=[{x:-c/2*.8,y:-h/2},{x:c/2*.8,y:-h/2},{x:c/2,y:-h/2*.6},{x:c/2,y:h/2},{x:-c/2,y:h/2},{x:-c/2,y:-h/2*.6}],g=dt(f),m=d.path(g,p),y=a.insert(()=>m,":first-child");return y.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",u),i&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",i),tt(e,y),e.intersect=function(x){return H.polygon(e,f,x)},a}l(Aw,"trapezoidalPentagon");async function Lw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=Et(xt().flowchart?.htmlLabels),c=n.width+(e.padding??0),h=c+n.height,u=c+n.height,d=[{x:0,y:0},{x:u,y:0},{x:u/2,y:-h}],{cssStyles:p}=e,f=Q.svg(a),g=J(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let m=dt(d),y=f.path(m,g),x=a.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`);return p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),i&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),e.width=c,e.height=h,tt(e,x),s.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${h/2-(n.height+(e.padding??0)/(o?2:1)-(n.y-(n.top??0)))})`),e.intersect=function(b){return R.info("Triangle intersect",e,d,b),H.polygon(e,d,b)},a}l(Lw,"triangle");async function Fw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),h=c/8,u=c+h,{cssStyles:d}=e,p=70-o,f=p>0?p/2:0,g=Q.svg(a),m=J(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let y=[{x:-o/2-f,y:u/2},...ur(-o/2-f,u/2,o/2+f,u/2,h,.8),{x:o/2+f,y:-u/2},{x:-o/2-f,y:-u/2}],x=dt(y),b=g.path(x,m),k=a.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})`),s.attr("transform",`translate(${-o/2+(e.padding??0)-(n.x-(n.left??0))},${-c/2+(e.padding??0)-h-(n.y-(n.top??0))})`),tt(e,k),e.intersect=function(_){return H.polygon(e,y,_)},a}l(Fw,"waveEdgedRectangle");async function Ew(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n}=await st(t,e,nt(e)),s=100,o=50,c=Math.max(n.width+(e.padding??0)*2,e?.width??0),h=Math.max(n.height+(e.padding??0)*2,e?.height??0),u=c/h,d=c,p=h;d>p*u?p=d/u:d=p*u,d=Math.max(d,s),p=Math.max(p,o);let f=Math.min(p*.2,p/4),g=p+f*2,{cssStyles:m}=e,y=Q.svg(a),x=J(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let b=[{x:-d/2,y:g/2},...ur(-d/2,g/2,d/2,g/2,f,1),{x:d/2,y:-g/2},...ur(d/2,-g/2,-d/2,-g/2,f,-1)],k=dt(b),_=y.path(k,x),C=a.insert(()=>_,":first-child");return C.attr("class","basic label-container"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),i&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",i),tt(e,C),e.intersect=function($){return H.polygon(e,b,$)},a}l(Ew,"waveRectangle");async function Ow(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,label:s}=await st(t,e,nt(e)),o=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),h=5,u=-o/2,d=-c/2,{cssStyles:p}=e,f=Q.svg(a),g=J(e,{}),m=[{x:u-h,y:d-h},{x:u-h,y:d+c},{x:u+o,y:d+c},{x:u+o,y:d-h}],y=`M${u-h},${d-h} L${u+o},${d-h} L${u+o},${d+c} L${u-h},${d+c} L${u-h},${d-h} M${u-h},${d} L${u+o},${d} M${u},${d-h} L${u},${d+c}`;e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let x=f.path(y,g),b=a.insert(()=>x,":first-child");return b.attr("transform",`translate(${h/2}, ${h/2})`),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),s.attr("transform",`translate(${-(n.width/2)+h/2-(n.x-(n.left??0))}, ${-(n.height/2)+h/2-(n.y-(n.top??0))})`),tt(e,b),e.intersect=function(k){return H.polygon(e,m,k)},a}l(Ow,"windowPane");async function ld(t,e){let r=e;if(r.alias&&(e.label=r.alias),e.look==="handDrawn"){let{themeVariables:X}=Gt(),{background:G}=X,ct={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${G}`]};await ld(t,ct)}let i=Gt();e.useHtmlLabels=i.htmlLabels;let a=i.er?.diagramPadding??10,n=i.er?.entityPadding??6,{cssStyles:s}=e,{labelStyles:o,nodeStyles:c}=K(e);if(r.attributes.length===0&&e.label){let X={rx:0,ry:0,labelPaddingX:a,labelPaddingY:a*1.5};Qe(e.label,i)+X.labelPaddingX*20){let X=d.width+a*2-(m+y+x+b);m+=X/C,y+=X/C,x>0&&(x+=X/C),b>0&&(b+=X/C)}let S=m+y+x+b,D=Q.svg(u),N=J(e,{});e.look!=="handDrawn"&&(N.roughness=0,N.fillStyle="solid");let I=0;g.length>0&&(I=g.reduce((X,G)=>X+(G?.rowHeight??0),0));let T=Math.max($.width+a*2,e?.width||0,S),O=Math.max((I??0)+d.height,e?.height||0),A=-T/2,v=-O/2;u.selectAll("g:not(:first-child)").each((X,G,ct)=>{let et=pt(ct[G]),wt=et.attr("transform"),Ct=0,Ot=0;if(wt){let q=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(wt);q&&(Ct=parseFloat(q[1]),Ot=parseFloat(q[2]),et.attr("class").includes("attribute-name")?Ct+=m:et.attr("class").includes("attribute-keys")?Ct+=m+y:et.attr("class").includes("attribute-comment")&&(Ct+=m+y+x))}et.attr("transform",`translate(${A+a/2+Ct}, ${Ot+v+d.height+n/2})`)}),u.select(".name").attr("transform","translate("+-d.width/2+", "+(v+n/2)+")");let L=D.rectangle(A,v,T,O,N),B=u.insert(()=>L,":first-child").attr("style",s.join("")),{themeVariables:E}=Gt(),{rowEven:F,rowOdd:z,nodeBorder:Y}=E;f.push(0);for(let[X,G]of g.entries()){let ct=(X+1)%2===0&&G.yOffset!==0,et=D.rectangle(A,d.height+v+G?.yOffset,T,G?.rowHeight,{...N,fill:ct?F:z,stroke:Y});u.insert(()=>et,"g.label").attr("style",s.join("")).attr("class",`row-rect-${ct?"even":"odd"}`)}let V=D.line(A,d.height+v,T+A,d.height+v,N);u.insert(()=>V).attr("class","divider"),V=D.line(m+A,d.height+v,m+A,O+v,N),u.insert(()=>V).attr("class","divider"),k&&(V=D.line(m+y+A,d.height+v,m+y+A,O+v,N),u.insert(()=>V).attr("class","divider")),_&&(V=D.line(m+y+x+A,d.height+v,m+y+x+A,O+v,N),u.insert(()=>V).attr("class","divider"));for(let X of f)V=D.line(A,d.height+v+X,T+A,d.height+v+X,N),u.insert(()=>V).attr("class","divider");if(tt(e,B),c&&e.look!=="handDrawn"){let X=c.split(";")?.filter(G=>G.includes("stroke"))?.map(G=>`${G}`).join("; ");u.selectAll("path").attr("style",X??""),u.selectAll(".row-rect-even path").attr("style",c)}return e.intersect=function(X){return H.rect(e,X)},u}l(ld,"erBox");async function di(t,e,r,i=0,a=0,n=[],s=""){let o=t.insert("g").attr("class",`label ${n.join(" ")}`).attr("transform",`translate(${i}, ${a})`).attr("style",s);e!==ip(e)&&(e=ip(e),e=e.replaceAll("<","<").replaceAll(">",">"));let c=o.node().appendChild(await gr(o,e,{width:Qe(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let u=c.children[0];for(u.textContent=u.textContent.replaceAll("<","<").replaceAll(">",">");u.childNodes[0];)u=u.childNodes[0],u.textContent=u.textContent.replaceAll("<","<").replaceAll(">",">")}let h=c.getBBox();if(Et(r.htmlLabels)){let u=c.children[0];u.style.textAlign="start";let d=pt(c);h=u.getBoundingClientRect(),d.attr("width",h.width),d.attr("height",h.height)}return h}l(di,"addText");async function Dw(t,e,r,i,a=r.class.padding??12){let n=i?0:3,s=t.insert("g").attr("class",nt(e)).attr("id",e.domId||e.id),o=null,c=null,h=null,u=null,d=0,p=0,f=0;if(o=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){let b=e.annotations[0];await Ta(o,{text:`«${b}»`},0),d=o.node().getBBox().height}c=s.insert("g").attr("class","label-group text"),await Ta(c,e,0,["font-weight: bolder"]);let g=c.node().getBBox();p=g.height,h=s.insert("g").attr("class","members-group text");let m=0;for(let b of e.members){let k=await Ta(h,b,m,[b.parseClassifier()]);m+=k+n}f=h.node().getBBox().height,f<=0&&(f=a/2),u=s.insert("g").attr("class","methods-group text");let y=0;for(let b of e.methods){let k=await Ta(u,b,y,[b.parseClassifier()]);y+=k+n}let x=s.node().getBBox();if(o!==null){let b=o.node().getBBox();o.attr("transform",`translate(${-b.width/2})`)}return c.attr("transform",`translate(${-g.width/2}, ${d})`),x=s.node().getBBox(),h.attr("transform",`translate(0, ${d+p+a*2})`),x=s.node().getBBox(),u.attr("transform",`translate(0, ${d+p+(f?f+a*4:a*2)})`),x=s.node().getBBox(),{shapeSvg:s,bbox:x}}l(Dw,"textHelper");async function Ta(t,e,r,i=[]){let a=t.insert("g").attr("class","label").attr("style",i.join("; ")),n=Gt(),s="useHtmlLabels"in e?e.useHtmlLabels:Et(n.htmlLabels)??!0,o="";"text"in e?o=e.text:o=e.label,!s&&o.startsWith("\\")&&(o=o.substring(1)),Qi(o)&&(s=!0);let c=await gr(a,Cu(Gr(o)),{width:Qe(o,n)+50,classes:"markdown-node-label",useHtmlLabels:s},n),h,u=1;if(s){let d=c.children[0],p=pt(c);u=d.innerHTML.split("
    ").length,d.innerHTML.includes("")&&(u+=d.innerHTML.split("").length-1);let f=d.getElementsByTagName("img");if(f){let g=o.replace(/]*>/g,"").trim()==="";await Promise.all([...f].map(m=>new Promise(y=>{function x(){if(m.style.display="flex",m.style.flexDirection="column",g){let b=n.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,k=parseInt(b,10)*5+"px";m.style.minWidth=k,m.style.maxWidth=k}else m.style.width="100%";y(m)}l(x,"setupImage"),setTimeout(()=>{m.complete&&x()}),m.addEventListener("error",x),m.addEventListener("load",x)})))}h=d.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}else{i.includes("font-weight: bolder")&&pt(c).selectAll("tspan").attr("font-weight",""),u=c.children.length;let d=c.children[0];(c.textContent===""||c.textContent.includes(">"))&&(d.textContent=o[0]+o.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),o[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),h=c.getBBox()}return a.attr("transform","translate(0,"+(-h.height/(2*u)+r)+")"),h.height}l(Ta,"addText");async function Iw(t,e){let r=xt(),i=r.class.padding??12,a=i,n=e.useHtmlLabels??Et(r.htmlLabels)??!0,s=e;s.annotations=s.annotations??[],s.members=s.members??[],s.methods=s.methods??[];let{shapeSvg:o,bbox:c}=await Dw(t,e,r,n,a),{labelStyles:h,nodeStyles:u}=K(e);e.labelStyle=h,e.cssStyles=s.styles||"";let d=s.styles?.join(";")||u||"";e.cssStyles||(e.cssStyles=d.replaceAll("!important","").split(";"));let p=s.members.length===0&&s.methods.length===0&&!r.class?.hideEmptyMembersBox,f=Q.svg(o),g=J(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let m=c.width,y=c.height;s.members.length===0&&s.methods.length===0?y+=a:s.members.length>0&&s.methods.length===0&&(y+=a*2);let x=-m/2,b=-y/2,k=f.rectangle(x-i,b-i-(p?i:s.members.length===0&&s.methods.length===0?-i/2:0),m+2*i,y+2*i+(p?i*2:s.members.length===0&&s.methods.length===0?-i:0),g),_=o.insert(()=>k,":first-child");_.attr("class","basic label-container");let C=_.node().getBBox();o.selectAll(".text").each((N,I,T)=>{let O=pt(T[I]),A=O.attr("transform"),v=0;if(A){let E=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(A);E&&(v=parseFloat(E[2]))}let L=v+b+i-(p?i:s.members.length===0&&s.methods.length===0?-i/2:0);n||(L-=4);let B=x;(O.attr("class").includes("label-group")||O.attr("class").includes("annotation-group"))&&(B=-O.node()?.getBBox().width/2||0,o.selectAll("text").each(function(E,F,z){window.getComputedStyle(z[F]).textAnchor==="middle"&&(B=0)})),O.attr("transform",`translate(${B}, ${L})`)});let $=o.select(".annotation-group").node().getBBox().height-(p?i/2:0)||0,S=o.select(".label-group").node().getBBox().height-(p?i/2:0)||0,D=o.select(".members-group").node().getBBox().height-(p?i/2:0)||0;if(s.members.length>0||s.methods.length>0||p){let N=f.line(C.x,$+S+b+i,C.x+C.width,$+S+b+i,g);o.insert(()=>N).attr("class","divider").attr("style",d)}if(p||s.members.length>0||s.methods.length>0){let N=f.line(C.x,$+S+D+b+a*2+i,C.x+C.width,$+S+D+b+i+a*2,g);o.insert(()=>N).attr("class","divider").attr("style",d)}if(s.look!=="handDrawn"&&o.selectAll("path").attr("style",d),_.select(":nth-child(2)").attr("style",d),o.selectAll(".divider").select("path").attr("style",d),e.labelStyle?o.selectAll("span").attr("style",e.labelStyle):o.selectAll("span").attr("style",d),!n){let N=RegExp(/color\s*:\s*([^;]*)/),I=N.exec(d);if(I){let T=I[0].replace("color","fill");o.selectAll("tspan").attr("style",T)}else if(h){let T=N.exec(h);if(T){let O=T[0].replace("color","fill");o.selectAll("tspan").attr("style",O)}}}return tt(e,_),e.intersect=function(N){return H.rect(e,N)},o}l(Iw,"classBox");async function Rw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let a=e,n=e,s=20,o=20,c="verifyMethod"in e,h=nt(e),u=t.insert("g").attr("class",h).attr("id",e.domId??e.id),d;c?d=await Le(u,`<<${a.type}>>`,0,e.labelStyle):d=await Le(u,"<<Element>>",0,e.labelStyle);let p=d,f=await Le(u,a.name,p,e.labelStyle+"; font-weight: bold;");if(p+=f+o,c){let $=await Le(u,`${a.requirementId?`ID: ${a.requirementId}`:""}`,p,e.labelStyle);p+=$;let S=await Le(u,`${a.text?`Text: ${a.text}`:""}`,p,e.labelStyle);p+=S;let D=await Le(u,`${a.risk?`Risk: ${a.risk}`:""}`,p,e.labelStyle);p+=D,await Le(u,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:""}`,p,e.labelStyle)}else{let $=await Le(u,`${n.type?`Type: ${n.type}`:""}`,p,e.labelStyle);p+=$,await Le(u,`${n.docRef?`Doc Ref: ${n.docRef}`:""}`,p,e.labelStyle)}let g=(u.node()?.getBBox().width??200)+s,m=(u.node()?.getBBox().height??200)+s,y=-g/2,x=-m/2,b=Q.svg(u),k=J(e,{});e.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let _=b.rectangle(y,x,g,m,k),C=u.insert(()=>_,":first-child");if(C.attr("class","basic label-container").attr("style",i),u.selectAll(".label").each(($,S,D)=>{let N=pt(D[S]),I=N.attr("transform"),T=0,O=0;if(I){let L=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);L&&(T=parseFloat(L[1]),O=parseFloat(L[2]))}let A=O-m/2,v=y+s/2;(S===0||S===1)&&(v=T),N.attr("transform",`translate(${v}, ${A+s})`)}),p>d+f+o){let $=b.line(y,x+d+f+o,y+g,x+d+f+o,k);u.insert(()=>$).attr("style",i)}return tt(e,C),e.intersect=function($){return H.rect(e,$)},u}l(Rw,"requirementBox");async function Le(t,e,r,i=""){if(e==="")return 0;let a=t.insert("g").attr("class","label").attr("style",i),n=xt(),s=n.htmlLabels??!0,o=await gr(a,Cu(Gr(e)),{width:Qe(e,n)+50,classes:"markdown-node-label",useHtmlLabels:s,style:i},n),c;if(s){let h=o.children[0],u=pt(o);c=h.getBoundingClientRect(),u.attr("width",c.width),u.attr("height",c.height)}else{let h=o.children[0];for(let u of h.children)u.textContent=u.textContent.replaceAll(">",">").replaceAll("<","<"),i&&u.setAttribute("style",i);c=o.getBBox(),c.height+=6}return a.attr("transform",`translate(${-c.width/2},${-c.height/2+r})`),c.height}l(Le,"addText");var fL=l(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 Nw(t,e,{config:r}){let{labelStyles:i,nodeStyles:a}=K(e);e.labelStyle=i||"";let n=10,s=e.width;e.width=(e.width??200)-10;let{shapeSvg:o,bbox:c,label:h}=await st(t,e,nt(e)),u=e.padding||10,d="",p;"ticket"in e&&e.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),p=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));let f={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1},g,m;p?{label:g,bbox:m}=await bl(p,"ticket"in e&&e.ticket||"",f):{label:g,bbox:m}=await bl(o,"ticket"in e&&e.ticket||"",f);let{label:y,bbox:x}=await bl(o,"assigned"in e&&e.assigned||"",f);e.width=s;let b=10,k=e?.width||0,_=Math.max(m.height,x.height)/2,C=Math.max(c.height+b*2,e?.height||0)+_,$=-k/2,S=-C/2;h.attr("transform","translate("+(u-k/2)+", "+(-_-c.height/2)+")"),g.attr("transform","translate("+(u-k/2)+", "+(-_+c.height/2)+")"),y.attr("transform","translate("+(u+k/2-x.width-2*n)+", "+(-_+c.height/2)+")");let D,{rx:N,ry:I}=e,{cssStyles:T}=e;if(e.look==="handDrawn"){let O=Q.svg(o),A=J(e,{}),v=N||I?O.path(mr($,S,k,C,N||0),A):O.rectangle($,S,k,C,A);D=o.insert(()=>v,":first-child"),D.attr("class","basic label-container").attr("style",T||null)}else{D=o.insert("rect",":first-child"),D.attr("class","basic label-container __APA__").attr("style",a).attr("rx",N??5).attr("ry",I??5).attr("x",$).attr("y",S).attr("width",k).attr("height",C);let O="priority"in e&&e.priority;if(O){let A=o.append("line"),v=$+2,L=S+Math.floor((N??0)/2),B=S+C-Math.floor((N??0)/2);A.attr("x1",v).attr("y1",L).attr("x2",v).attr("y2",B).attr("stroke-width","4").attr("stroke",fL(O))}}return tt(e,D),e.height=C,e.intersect=function(O){return H.rect(e,O)},o}l(Nw,"kanbanItem");async function Pw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,halfPadding:s,label:o}=await st(t,e,nt(e)),c=n.width+10*s,h=n.height+8*s,u=.15*c,{cssStyles:d}=e,p=n.width+20,f=n.height+20,g=Math.max(c,p),m=Math.max(h,f);o.attr("transform",`translate(${-n.width/2}, ${-n.height/2})`);let y,x=`M0 0 a${u},${u} 1 0,0 ${g*.25},${-1*m*.1} a${u},${u} 1 0,0 ${g*.25},0 a${u},${u} 1 0,0 ${g*.25},0 a${u},${u} 1 0,0 ${g*.25},${m*.1} a${u},${u} 1 0,0 ${g*.15},${m*.33} a${u*.8},${u*.8} 1 0,0 0,${m*.34} a${u},${u} 1 0,0 ${-1*g*.15},${m*.33} a${u},${u} 1 0,0 ${-1*g*.25},${m*.15} a${u},${u} 1 0,0 ${-1*g*.25},0 a${u},${u} 1 0,0 ${-1*g*.25},0 a${u},${u} 1 0,0 ${-1*g*.25},${-1*m*.15} a${u},${u} 1 0,0 ${-1*g*.1},${-1*m*.33} a${u*.8},${u*.8} 1 0,0 0,${-1*m*.34} a${u},${u} 1 0,0 ${g*.1},${-1*m*.33} H0 V0 Z`;if(e.look==="handDrawn"){let b=Q.svg(a),k=J(e,{}),_=b.path(x,k);y=a.insert(()=>_,":first-child"),y.attr("class","basic label-container").attr("style",Zt(d))}else y=a.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),tt(e,y),e.calcIntersect=function(b,k){return H.rect(b,k)},e.intersect=function(b){return R.info("Bang intersect",e,b),H.rect(e,b)},a}l(Pw,"bang");async function zw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,halfPadding:s,label:o}=await st(t,e,nt(e)),c=n.width+2*s,h=n.height+2*s,u=.15*c,d=.25*c,p=.35*c,f=.2*c,{cssStyles:g}=e,m,y=`M0 0 a${u},${u} 0 0,1 ${c*.25},${-1*c*.1} a${p},${p} 1 0,1 ${c*.4},${-1*c*.1} a${d},${d} 1 0,1 ${c*.35},${c*.2} a${u},${u} 1 0,1 ${c*.15},${h*.35} a${f},${f} 1 0,1 ${-1*c*.15},${h*.65} a${d},${u} 1 0,1 ${-1*c*.25},${c*.15} a${p},${p} 1 0,1 ${-1*c*.5},0 a${u},${u} 1 0,1 ${-1*c*.25},${-1*c*.15} a${u},${u} 1 0,1 ${-1*c*.1},${-1*h*.35} a${f},${f} 1 0,1 ${c*.1},${-1*h*.65} H0 V0 Z`;if(e.look==="handDrawn"){let x=Q.svg(a),b=J(e,{}),k=x.path(y,b);m=a.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Zt(g))}else m=a.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return o.attr("transform",`translate(${-n.width/2}, ${-n.height/2})`),m.attr("transform",`translate(${-c/2}, ${-h/2})`),tt(e,m),e.calcIntersect=function(x,b){return H.rect(x,b)},e.intersect=function(x){return R.info("Cloud intersect",e,x),H.rect(e,x)},a}l(zw,"cloud");async function qw(t,e){let{labelStyles:r,nodeStyles:i}=K(e);e.labelStyle=r;let{shapeSvg:a,bbox:n,halfPadding:s,label:o}=await st(t,e,nt(e)),c=n.width+8*s,h=n.height+2*s,u=5,d=` M${-c/2} ${h/2-u} v${-h+2*u} q0,-${u} ${u},-${u} h${c-2*u} q${u},0 ${u},${u} v${h-2*u} q0,${u} -${u},${u} h${-c+2*u} q-${u},0 -${u},-${u} Z `,p=a.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("style",i).attr("d",d);return a.append("line").attr("class","node-line-").attr("x1",-c/2).attr("y1",h/2).attr("x2",c/2).attr("y2",h/2),o.attr("transform",`translate(${-n.width/2}, ${-n.height/2})`),a.append(()=>o.node()),tt(e,p),e.calcIntersect=function(f,g){return H.rect(f,g)},e.intersect=function(f){return H.rect(e,f)},a}l(qw,"defaultMindmapNode");async function jw(t,e){let r={padding:e.padding??0};return sd(t,e,r)}l(jw,"mindmapCircle");var gL=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:bw},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:mw},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:kw},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:_w},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:WC},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:sd},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Pw},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:zw},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:pw},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:ZC},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:ow},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:nw},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Bw},{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:iw},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:UC},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Tw},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:DC},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:yw},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:$w},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:ww},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:GC},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:QC},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:PC},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:zC},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:qC},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:sw},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Fw},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:XC},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Mw},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:lw},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:jC},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:HC},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Lw},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Ow},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:YC},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Aw},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:VC},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:xw},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:uw},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:cw},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:OC},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:NC},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Sw},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:vw},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Ew},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:fw},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:hw}],mL=l(()=>{let t=[...Object.entries({state:Cw,choice:IC,note:dw,rectWithTitle:gw,labelRect:aw,iconSquare:ew,iconCircle:KC,icon:JC,iconRounded:tw,imageSquare:rw,anchor:EC,kanbanItem:Nw,mindmapCircle:jw,defaultMindmapNode:qw,classBox:Iw,erBox:ld,requirementBox:Rw}),...gL.flatMap(e=>[e.shortName,..."aliases"in e?e.aliases:[],..."internalAliases"in e?e.internalAliases:[]].map(r=>[r,e.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Ww=mL();function yL(t){return t in Ww}l(yL,"isValidShape");var Vs=new Map;async function Hw(t,e,r){let i,a;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");let n=e.shape?Ww[e.shape]:void 0;if(!n)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),i=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),a=await n(i,e,r)}else a=await n(t,e,r),i=a;return e.tooltip&&a.attr("title",e.tooltip),Vs.set(e.id,i),e.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}l(Hw,"insertNode");var dE=l((t,e)=>{Vs.set(e.id,t)},"setNodeElem"),pE=l(()=>{Vs.clear()},"clear"),fE=l(t=>{let e=Vs.get(t.id);R.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let 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"),xL=l((t,e,r,i,a,n)=>{e.arrowTypeStart&&Mp(t,"start",e.arrowTypeStart,r,i,a,n),e.arrowTypeEnd&&Mp(t,"end",e.arrowTypeEnd,r,i,a,n)},"addEdgeMarkers"),bL={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}},Mp=l((t,e,r,i,a,n,s)=>{let o=bL[r];if(!o){R.warn(`Unknown arrow type: ${r}`);return}let c=o.type,h=`${a}_${n}-${c}${e==="start"?"Start":"End"}`;if(s&&s.trim()!==""){let u=s.replace(/[^\dA-Za-z]/g,"_"),d=`${h}_${u}`;if(!document.getElementById(d)){let p=document.getElementById(h);if(p){let f=p.cloneNode(!0);f.id=d,f.querySelectorAll("path, circle, line").forEach(g=>{g.setAttribute("stroke",s),o.fill&&g.setAttribute("fill",s)}),p.parentNode?.appendChild(f)}}t.attr(`marker-${e}`,`url(${i}#${d})`)}else t.attr(`marker-${e}`,`url(${i}#${h})`)},"addEdgeMarker"),os=new Map,qt=new Map,gE=l(()=>{os.clear(),qt.clear()},"clear"),Zn=l(t=>t?t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),kL=l(async(t,e)=>{let r=Et(xt().flowchart.htmlLabels),{labelStyles:i}=K(e);e.labelStyle=i;let a=await gr(t,e.label,{style:e.labelStyle,useHtmlLabels:r,addSvgBackground:!0,isNode:!1});R.info("abc82",e,e.labelType);let n=t.insert("g").attr("class","edgeLabel"),s=n.insert("g").attr("class","label").attr("data-id",e.id);s.node().appendChild(a);let o=a.getBBox();if(r){let h=a.children[0],u=pt(a);o=h.getBoundingClientRect(),u.attr("width",o.width),u.attr("height",o.height)}s.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),os.set(e.id,n),e.width=o.width,e.height=o.height;let c;if(e.startLabelLeft){let h=await Br(e.startLabelLeft,Zn(e.labelStyle)),u=t.insert("g").attr("class","edgeTerminals"),d=u.insert("g").attr("class","inner");c=d.node().appendChild(h);let p=h.getBBox();d.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),qt.get(e.id)||qt.set(e.id,{}),qt.get(e.id).startLeft=u,Ma(c,e.startLabelLeft)}if(e.startLabelRight){let h=await Br(e.startLabelRight,Zn(e.labelStyle)),u=t.insert("g").attr("class","edgeTerminals"),d=u.insert("g").attr("class","inner");c=u.node().appendChild(h),d.node().appendChild(h);let p=h.getBBox();d.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),qt.get(e.id)||qt.set(e.id,{}),qt.get(e.id).startRight=u,Ma(c,e.startLabelRight)}if(e.endLabelLeft){let h=await Br(e.endLabelLeft,Zn(e.labelStyle)),u=t.insert("g").attr("class","edgeTerminals"),d=u.insert("g").attr("class","inner");c=d.node().appendChild(h);let p=h.getBBox();d.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),u.node().appendChild(h),qt.get(e.id)||qt.set(e.id,{}),qt.get(e.id).endLeft=u,Ma(c,e.endLabelLeft)}if(e.endLabelRight){let h=await Br(e.endLabelRight,Zn(e.labelStyle)),u=t.insert("g").attr("class","edgeTerminals"),d=u.insert("g").attr("class","inner");c=d.node().appendChild(h);let p=h.getBBox();d.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),u.node().appendChild(h),qt.get(e.id)||qt.set(e.id,{}),qt.get(e.id).endRight=u,Ma(c,e.endLabelRight)}return a},"insertEdgeLabel");function Ma(t,e){xt().flowchart.htmlLabels&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}l(Ma,"setTerminalWidth");var CL=l((t,e)=>{R.debug("Moving label abc88 ",t.id,t.label,os.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath,i=xt(),{subGraphTitleTotalMargin:a}=Bu(i);if(t.label){let n=os.get(t.id),s=t.x,o=t.y;if(r){let c=we.calcLabelPosition(r);R.debug("Moving label "+t.label+" from (",s,",",o,") to (",c.x,",",c.y,") abc88"),e.updatedPath&&(s=c.x,o=c.y)}n.attr("transform",`translate(${s}, ${o+a/2})`)}if(t.startLabelLeft){let n=qt.get(t.id).startLeft,s=t.x,o=t.y;if(r){let c=we.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=c.x,o=c.y}n.attr("transform",`translate(${s}, ${o})`)}if(t.startLabelRight){let n=qt.get(t.id).startRight,s=t.x,o=t.y;if(r){let c=we.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=c.x,o=c.y}n.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelLeft){let n=qt.get(t.id).endLeft,s=t.x,o=t.y;if(r){let c=we.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=c.x,o=c.y}n.attr("transform",`translate(${s}, ${o})`)}if(t.endLabelRight){let n=qt.get(t.id).endRight,s=t.x,o=t.y;if(r){let c=we.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=c.x,o=c.y}n.attr("transform",`translate(${s}, ${o})`)}},"positionEdgeLabel"),wL=l((t,e)=>{let r=t.x,i=t.y,a=Math.abs(e.x-r),n=Math.abs(e.y-i),s=t.width/2,o=t.height/2;return a>=s||n>=o},"outsideNode"),$L=l((t,e,r)=>{R.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}`);let i=t.x,a=t.y,n=Math.abs(i-r.x),s=t.width/2,o=r.xMath.abs(i-e.x)*c){let d=r.y{R.warn("abc88 cutPathAtIntersect",t,e);let r=[],i=t[0],a=!1;return t.forEach(n=>{if(R.info("abc88 checking point",n,e),!wL(e,n)&&!a){let s=$L(e,i,n);R.debug("abc88 inside",n,i,s),R.debug("abc88 intersection",s,e);let o=!1;r.forEach(c=>{o=o||c.x===s.x&&c.y===s.y}),r.some(c=>c.x===s.x&&c.y===s.y)?R.warn("abc88 no intersect",s,r):r.push(s),a=!0}else R.warn("abc88 outside",n,i),i=n,a||r.push(n)}),R.debug("returning points",r),r},"cutPathAtIntersect");function Uw(t){let e=[],r=[];for(let i=1;i5&&Math.abs(n.y-a.y)>5||a.y===n.y&&n.x===s.x&&Math.abs(n.x-a.x)>5&&Math.abs(n.y-s.y)>5)&&(e.push(n),r.push(i))}return{cornerPoints:e,cornerPointPositions:r}}l(Uw,"extractCornerPoints");var Ap=l(function(t,e,r){let i=e.x-t.x,a=e.y-t.y,n=Math.sqrt(i*i+a*a),s=r/n;return{x:e.x-s*i,y:e.y-s*a}},"findAdjacentPoint"),_L=l(function(t){let{cornerPointPositions:e}=Uw(t),r=[];for(let i=0;i10&&Math.abs(n.y-a.y)>=10){R.debug("Corner point fixing",Math.abs(n.x-a.x),Math.abs(n.y-a.y));let f=5;s.x===o.x?p={x:h<0?o.x-f+d:o.x+f-d,y:u<0?o.y-d:o.y+d}:p={x:h<0?o.x-d:o.x+d,y:u<0?o.y-f+d:o.y+f-d}}else R.debug("Corner point skipping fixing",Math.abs(n.x-a.x),Math.abs(n.y-a.y));r.push(p,c)}else r.push(t[i]);return r},"fixCorners"),vL=l((t,e,r)=>{let i=t-e-r,a=2,n=2,s=a+n,o=Math.floor(i/s),c=Array(o).fill(`${a} ${n}`).join(" ");return`0 ${e} ${c} ${r}`},"generateDashArray"),SL=l(function(t,e,r,i,a,n,s,o=!1){let{handDrawnSeed:c}=xt(),h=e.points,u=!1,d=a;var p=n;let f=[];for(let v in e.cssCompiledStyles)Zb(v)||f.push(e.cssCompiledStyles[v]);R.debug("UIO intersect check",e.points,p.x,d.x),p.intersect&&d.intersect&&!o&&(h=h.slice(1,e.points.length-1),h.unshift(d.intersect(h[0])),R.debug("Last point UIO",e.start,"-->",e.end,h[h.length-1],p,p.intersect(h[h.length-1])),h.push(p.intersect(h[h.length-1])));let g=btoa(JSON.stringify(h));e.toCluster&&(R.info("to cluster abc88",r.get(e.toCluster)),h=Bp(e.points,r.get(e.toCluster).node),u=!0),e.fromCluster&&(R.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(h,null,2)),h=Bp(h.reverse(),r.get(e.fromCluster).node).reverse(),u=!0);let m=h.filter(v=>!Number.isNaN(v.y));m=_L(m);let y=La;switch(y=tn,e.curve){case"linear":y=tn;break;case"basis":y=La;break;case"cardinal":y=S0;break;case"bumpX":y=Uc;break;case"bumpY":y=Yc;break;case"catmullRom":y=T0;break;case"monotoneX":y=ru;break;case"monotoneY":y=iu;break;case"natural":y=nu;break;case"step":y=ou;break;case"stepAfter":y=lu;break;case"stepBefore":y=su;break;default:y=La}let{x,y:b}=k3(e),k=k0().x(x).y(b).curve(y),_;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,$=e.curve==="rounded"?Yw(Vw(m,e),5):k(m),S=Array.isArray(e.style)?e.style:[e.style],D=S.find(v=>v?.startsWith("stroke:")),N=!1;if(e.look==="handDrawn"){let v=Q.svg(t);Object.assign([],m);let L=v.path($,{roughness:.3,seed:c});_+=" transition",C=pt(L).select("path").attr("id",e.id).attr("class"," "+_+(e.classes?" "+e.classes:"")).attr("style",S?S.reduce((E,F)=>E+";"+F,""):"");let B=C.attr("d");C.attr("d",B),t.node().appendChild(C.node())}else{let v=f.join(";"),L=S?S.reduce((X,G)=>X+G+";",""):"",B="";e.animate&&(B=" edge-animation-fast"),e.animation&&(B=" edge-animation-"+e.animation);let E=(v?v+";"+L+";":L)+";"+(S?S.reduce((X,G)=>X+";"+G,""):"");C=t.append("path").attr("d",$).attr("id",e.id).attr("class"," "+_+(e.classes?" "+e.classes:"")+(B??"")).attr("style",E),D=E.match(/stroke:([^;]+)/)?.[1],N=e.animate===!0||!!e.animation||v.includes("animation");let F=C.node(),z=typeof F.getTotalLength=="function"?F.getTotalLength():0,Y=lp[e.arrowTypeStart]||0,V=lp[e.arrowTypeEnd]||0;if(e.look==="neo"&&!N){let X=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?vL(z,Y,V):`0 ${Y} ${z-Y-V} ${V}`}; 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",g),e.showPoints&&m.forEach(v=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",v.x).attr("cy",v.y)});let I="";(xt().flowchart.arrowMarkerAbsolute||xt().state.arrowMarkerAbsolute)&&(I=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,I=I.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),R.info("arrowTypeStart",e.arrowTypeStart),R.info("arrowTypeEnd",e.arrowTypeEnd),xL(C,e,I,s,i,D);let T=Math.floor(h.length/2),O=h[T];we.isLabelCoordinateInPath(O,C.attr("d"))||(u=!0);let A={};return u&&(A.updatedPath=h),A.originalPath=e.points,A},"insertEdge");function Yw(t,e){if(t.length<2)return"";let r="",i=t.length,a=1e-5;for(let n=0;n({...a}));if(t.length>=2&&Vt[e.arrowTypeStart]){let a=Vt[e.arrowTypeStart],n=t[0],s=t[1],{angle:o}=Yh(n,s),c=a*Math.cos(o),h=a*Math.sin(o);r[0].x=n.x+c,r[0].y=n.y+h}let i=t.length;if(i>=2&&Vt[e.arrowTypeEnd]){let a=Vt[e.arrowTypeEnd],n=t[i-1],s=t[i-2],{angle:o}=Yh(s,n),c=a*Math.cos(o),h=a*Math.sin(o);r[i-1].x=n.x-c,r[i-1].y=n.y-h}return r}l(Vw,"applyMarkerOffsetsToPoints");var TL=l((t,e,r,i)=>{e.forEach(a=>{WL[a](t,r,i)})},"insertMarkers"),ML=l((t,e,r)=>{R.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"),BL=l((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"),AL=l((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"),LL=l((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"),FL=l((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"),EL=l((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"),OL=l((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"),DL=l((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"),IL=l((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"),RL=l((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"),NL=l((t,e,r)=>{let 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");let a=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");a.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),a.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),PL=l((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"),zL=l((t,e,r)=>{let 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");let a=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");a.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),a.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),qL=l((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"),jL=l((t,e,r)=>{let i=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),WL={extension:ML,composition:BL,aggregation:AL,dependency:LL,lollipop:FL,point:EL,circle:OL,cross:DL,barb:IL,only_one:RL,zero_or_one:NL,one_or_more:PL,zero_or_more:zL,requirement_arrow:qL,requirement_contains:jL},HL=TL,UL={common:ia,getConfig:Gt,insertCluster:KA,insertEdge:SL,insertEdgeLabel:kL,insertMarkers:HL,insertNode:Hw,interpolateToCurve:Ru,labelHelper:st,log:R,positionEdgeLabel:CL},yn={},Gw=l(t=>{for(let e of t)yn[e.name]=e},"registerLayoutLoaders"),YL=l(()=>{Gw([{name:"dagre",loader:l(async()=>await bt(()=>import("./dagre-X5LCLMGV-CwB36wg9.js"),__vite__mapDeps([2,3,4,5,1])),"loader")},{name:"cose-bilkent",loader:l(async()=>await bt(()=>import("./cose-bilkent-AZ5BDB2T-DyeqItdk.js"),__vite__mapDeps([6,7,1])),"loader")}])},"registerDefaultLayoutLoaders");YL();var mE=l(async(t,e)=>{if(!(t.layoutAlgorithm in yn))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);let r=yn[t.layoutAlgorithm];return(await r.loader()).render(t,e,UL,{algorithm:r.algorithm})},"render"),yE=l((t="",{fallback:e="dagre"}={})=>{if(t in yn)return t;if(e in yn)return R.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"),VL=W2(Object.keys,Object),GL=VL,XL=Object.prototype,ZL=XL.hasOwnProperty;function Xw(t){if(!Rs(t))return GL(t);var e=[];for(var r in Object(t))ZL.call(t,r)&&r!="constructor"&&e.push(r);return e}l(Xw,"baseKeys");var QL=Xw,JL=Wr(Re,"DataView"),Vh=JL,KL=Wr(Re,"Promise"),Gh=KL,tF=Wr(Re,"Set"),Xh=tF,eF=Wr(Re,"WeakMap"),Zh=eF,Lp="[object Map]",rF="[object Object]",Fp="[object Promise]",Ep="[object Set]",Op="[object WeakMap]",Dp="[object DataView]",iF=jr(Vh),aF=jr(dn),nF=jr(Gh),oF=jr(Xh),sF=jr(Zh),_r=na;(Vh&&_r(new Vh(new ArrayBuffer(1)))!=Dp||dn&&_r(new dn)!=Lp||Gh&&_r(Gh.resolve())!=Fp||Xh&&_r(new Xh)!=Ep||Zh&&_r(new Zh)!=Op)&&(_r=l(function(t){var e=na(t),r=e==rF?t.constructor:void 0,i=r?jr(r):"";if(i)switch(i){case iF:return Dp;case aF:return Lp;case nF:return Fp;case oF:return Ep;case sF:return Op}return e},"getTag"));var lF=_r,hF="[object Map]",cF="[object Set]",uF=Object.prototype,dF=uF.hasOwnProperty;function Zw(t){if(t==null)return!0;if(Ns(t)&&(Zo(t)||typeof t=="string"||typeof t.splice=="function"||Ou(t)||Du(t)||Xo(t)))return!t.length;var e=lF(t);if(e==hF||e==cF)return!t.size;if(Rs(t))return!QL(t).length;for(var r in t)if(dF.call(t,r))return!1;return!0}l(Zw,"isEmpty");var Ip=Zw,pF=l(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),fF=l(async()=>{let{diagram:t}=await bt(()=>import("./c4Diagram-Q5SP5FFD-DzsMI3Ik.js"),__vite__mapDeps([8,9,1]));return{id:"c4",diagram:t}},"loader"),gF={id:"c4",detector:pF,loader:fF},mF=gF,Qw="flowchart",yF=l((t,e)=>e?.flowchart?.defaultRenderer==="dagre-wrapper"||e?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(t),"detector"),xF=l(async()=>{let{diagram:t}=await bt(()=>import("./flowDiagram-UML6HZQP-DAGK-b8j.js"),__vite__mapDeps([10,11,12,13,1]));return{id:Qw,diagram:t}},"loader"),bF={id:Qw,detector:yF,loader:xF},kF=bF,Jw="flowchart-v2",CF=l((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"),wF=l(async()=>{let{diagram:t}=await bt(()=>import("./flowDiagram-UML6HZQP-DAGK-b8j.js"),__vite__mapDeps([10,11,12,13,1]));return{id:Jw,diagram:t}},"loader"),$F={id:Jw,detector:CF,loader:wF},_F=$F,vF=l(t=>/^\s*erDiagram/.test(t),"detector"),SF=l(async()=>{let{diagram:t}=await bt(()=>import("./erDiagram-MBDK6S7D-C9IYauT8.js"),__vite__mapDeps([14,12,13,1]));return{id:"er",diagram:t}},"loader"),TF={id:"er",detector:vF,loader:SF},MF=TF,Kw="gitGraph",BF=l(t=>/^\s*gitGraph/.test(t),"detector"),AF=l(async()=>{let{diagram:t}=await bt(()=>import("./gitGraphDiagram-JCGM6PWI-Cc41ymyc.js"),__vite__mapDeps([15,16,17,1,5,18]));return{id:Kw,diagram:t}},"loader"),LF={id:Kw,detector:BF,loader:AF},FF=LF,t$="gantt",EF=l(t=>/^\s*gantt/.test(t),"detector"),OF=l(async()=>{let{diagram:t}=await bt(()=>import("./ganttDiagram-SAESIEWH-IHShLdv1.js"),__vite__mapDeps([19,1]));return{id:t$,diagram:t}},"loader"),DF={id:t$,detector:EF,loader:OF},IF=DF,e$="info",RF=l(t=>/^\s*info/.test(t),"detector"),NF=l(async()=>{let{diagram:t}=await bt(()=>import("./infoDiagram-GKI3LBYJ-D5wcD6JP.js"),__vite__mapDeps([20,17,1,5]));return{id:e$,diagram:t}},"loader"),PF={id:e$,detector:RF,loader:NF},zF=l(t=>/^\s*pie/.test(t),"detector"),qF=l(async()=>{let{diagram:t}=await bt(()=>import("./pieDiagram-QB62DFGK-7hcFCy4Z.js"),__vite__mapDeps([21,16,17,1,5]));return{id:"pie",diagram:t}},"loader"),jF={id:"pie",detector:zF,loader:qF},r$="quadrantChart",WF=l(t=>/^\s*quadrantChart/.test(t),"detector"),HF=l(async()=>{let{diagram:t}=await bt(()=>import("./quadrantDiagram-AGVETKZM-BFi9v5jq.js"),__vite__mapDeps([22,1]));return{id:r$,diagram:t}},"loader"),UF={id:r$,detector:WF,loader:HF},YF=UF,i$="xychart",VF=l(t=>/^\s*xychart(-beta)?/.test(t),"detector"),GF=l(async()=>{let{diagram:t}=await bt(()=>import("./xychartDiagram-6J6QOAP6-DruplG9A.js"),__vite__mapDeps([23,1]));return{id:i$,diagram:t}},"loader"),XF={id:i$,detector:VF,loader:GF},ZF=XF,a$="requirement",QF=l(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),JF=l(async()=>{let{diagram:t}=await bt(()=>import("./requirementDiagram-BJFPASL3-DcJNkQb2.js"),__vite__mapDeps([24,12,13,1]));return{id:a$,diagram:t}},"loader"),KF={id:a$,detector:QF,loader:JF},t4=KF,n$="sequence",e4=l(t=>/^\s*sequenceDiagram/.test(t),"detector"),r4=l(async()=>{let{diagram:t}=await bt(()=>import("./sequenceDiagram-W4XLKSBU-Cvj1HRdt.js"),__vite__mapDeps([25,18,9,1]));return{id:n$,diagram:t}},"loader"),i4={id:n$,detector:e4,loader:r4},a4=i4,o$="class",n4=l((t,e)=>e?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t),"detector"),o4=l(async()=>{let{diagram:t}=await bt(()=>import("./classDiagram-FKO7XAE5-CzUjJx-s.js"),__vite__mapDeps([26,27,11,12,13,1]));return{id:o$,diagram:t}},"loader"),s4={id:o$,detector:n4,loader:o4},l4=s4,s$="classDiagram",h4=l((t,e)=>/^\s*classDiagram/.test(t)&&e?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t),"detector"),c4=l(async()=>{let{diagram:t}=await bt(()=>import("./classDiagram-v2-XZHHGUJO-CzUjJx-s.js"),__vite__mapDeps([28,27,11,12,13,1]));return{id:s$,diagram:t}},"loader"),u4={id:s$,detector:h4,loader:c4},d4=u4,l$="state",p4=l((t,e)=>e?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t),"detector"),f4=l(async()=>{let{diagram:t}=await bt(()=>import("./stateDiagram-ZFDIVMDF-c3Z3A4fJ.js"),__vite__mapDeps([29,30,12,13,3,4,5,1]));return{id:l$,diagram:t}},"loader"),g4={id:l$,detector:p4,loader:f4},m4=g4,h$="stateDiagram",y4=l((t,e)=>!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&e?.state?.defaultRenderer==="dagre-wrapper"),"detector"),x4=l(async()=>{let{diagram:t}=await bt(()=>import("./stateDiagram-v2-GQU47BET-C-GuSN9p.js"),__vite__mapDeps([31,30,12,13,1]));return{id:h$,diagram:t}},"loader"),b4={id:h$,detector:y4,loader:x4},k4=b4,c$="journey",C4=l(t=>/^\s*journey/.test(t),"detector"),w4=l(async()=>{let{diagram:t}=await bt(()=>import("./journeyDiagram-E42M6OD5-DGiKq_-3.js"),__vite__mapDeps([32,9,11,1]));return{id:c$,diagram:t}},"loader"),$4={id:c$,detector:C4,loader:w4},_4=$4,v4=l((t,e,r)=>{R.debug(`rendering svg for syntax error `);let i=dT(e),a=i.append("g");i.attr("viewBox","0 0 2412 512"),px(i,100,512,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),u$={draw:v4},S4=u$,T4={db:{},renderer:u$,parser:{parse:l(()=>{},"parse")}},M4=T4,d$="flowchart-elk",B4=l((t,e={})=>/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&e?.flowchart?.defaultRenderer==="elk"?(e.layout="elk",!0):!1,"detector"),A4=l(async()=>{let{diagram:t}=await bt(()=>import("./flowDiagram-UML6HZQP-DAGK-b8j.js"),__vite__mapDeps([10,11,12,13,1]));return{id:d$,diagram:t}},"loader"),L4={id:d$,detector:B4,loader:A4},F4=L4,p$="timeline",E4=l(t=>/^\s*timeline/.test(t),"detector"),O4=l(async()=>{let{diagram:t}=await bt(()=>import("./timeline-definition-DZOEFOHF-CkjRGiIO.js"),__vite__mapDeps([33,1]));return{id:p$,diagram:t}},"loader"),D4={id:p$,detector:E4,loader:O4},I4=D4,f$="mindmap",R4=l(t=>/^\s*mindmap/.test(t),"detector"),N4=l(async()=>{let{diagram:t}=await bt(()=>import("./mindmap-definition-ZYHNXUZP-CB32Yjz4.js"),__vite__mapDeps([34,12,13,1]));return{id:f$,diagram:t}},"loader"),P4={id:f$,detector:R4,loader:N4},z4=P4,g$="kanban",q4=l(t=>/^\s*kanban/.test(t),"detector"),j4=l(async()=>{let{diagram:t}=await bt(()=>import("./kanban-definition-D5DEDDHO-CzE0zbtM.js"),__vite__mapDeps([35,11,1]));return{id:g$,diagram:t}},"loader"),W4={id:g$,detector:q4,loader:j4},H4=W4,m$="sankey",U4=l(t=>/^\s*sankey(-beta)?/.test(t),"detector"),Y4=l(async()=>{let{diagram:t}=await bt(()=>import("./sankeyDiagram-XSL23WO4-BLCarbPT.js"),__vite__mapDeps([36,1]));return{id:m$,diagram:t}},"loader"),V4={id:m$,detector:U4,loader:Y4},G4=V4,y$="packet",X4=l(t=>/^\s*packet(-beta)?/.test(t),"detector"),Z4=l(async()=>{let{diagram:t}=await bt(()=>import("./diagram-BZV4OSZQ-BP82GnUQ.js"),__vite__mapDeps([37,16,17,1,5]));return{id:y$,diagram:t}},"loader"),Q4={id:y$,detector:X4,loader:Z4},x$="radar",J4=l(t=>/^\s*radar-beta/.test(t),"detector"),K4=l(async()=>{let{diagram:t}=await bt(()=>import("./diagram-DKYQLJNW-CZjeYhwy.js"),__vite__mapDeps([38,16,17,1,5]));return{id:x$,diagram:t}},"loader"),t6={id:x$,detector:J4,loader:K4},b$="block",e6=l(t=>/^\s*block(-beta)?/.test(t),"detector"),r6=l(async()=>{let{diagram:t}=await bt(()=>import("./blockDiagram-BWRZOBD3-CBcaG9Zz.js"),__vite__mapDeps([39,4,5,11,1]));return{id:b$,diagram:t}},"loader"),i6={id:b$,detector:e6,loader:r6},a6=i6,k$="architecture",n6=l(t=>/^\s*architecture/.test(t),"detector"),o6=l(async()=>{let{diagram:t}=await bt(()=>import("./architectureDiagram-4X3Z3J56-CLXWk1iP.js"),__vite__mapDeps([40,16,17,1,5,7]));return{id:k$,diagram:t}},"loader"),s6={id:k$,detector:n6,loader:o6},l6=s6,C$="treemap",h6=l(t=>/^\s*treemap/.test(t),"detector"),c6=l(async()=>{let{diagram:t}=await bt(()=>import("./diagram-LL6QPXA2-B5BUPoIO.js"),__vite__mapDeps([41,16,17,1,5,13]));return{id:C$,diagram:t}},"loader"),u6={id:C$,detector:h6,loader:c6},Rp=!1,Gs=l(()=>{Rp||(Rp=!0,zo("error",M4,t=>t.toLowerCase().trim()==="error"),zo("---",{db:{clear:l(()=>{},"clear")},styles:{},renderer:{draw:l(()=>{},"draw")},parser:{parse:l(()=>{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:l(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),ah(F4,z4,l6),ah(mF,H4,d4,l4,MF,IF,PF,jF,t4,a4,_F,kF,I4,FF,k4,m4,_4,YF,G4,Q4,ZF,a6,t6,u6))},"addDiagrams"),d6=l(async()=>{R.debug("Loading registered diagrams");let t=(await Promise.allSettled(Object.entries(Dr).map(async([e,{detector:r,loader:i}])=>{if(i)try{ch(e)}catch{try{let{diagram:a,id:n}=await i();zo(n,a,r)}catch(a){throw R.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete Dr[e],a}}}))).filter(e=>e.status==="rejected");if(t.length>0){R.error(`Failed to load ${t.length} external diagrams`);for(let e of t)R.error(e);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),w$="comm",$$="rule",_$="decl",p6="@import",f6="@namespace",g6="@keyframes",m6="@layer",v$=Math.abs,hd=String.fromCharCode;function cd(t){return t.trim()}l(cd,"trim");function qa(t,e,r){return t.replace(e,r)}l(qa,"replace");function S$(t,e,r){return t.indexOf(e,r)}l(S$,"indexof");function Ar(t,e){return t.charCodeAt(e)|0}l(Ar,"charat");function Pr(t,e,r){return t.slice(e,r)}l(Pr,"substr");function Ce(t){return t.length}l(Ce,"strlen");function T$(t){return t.length}l(T$,"sizeof");function Ba(t,e){return e.push(t),t}l(Ba,"append");var Xs=1,ta=1,M$=0,me=0,Bt=0,la="";function Zs(t,e,r,i,a,n,s,o){return{value:t,root:e,parent:r,type:i,props:a,children:n,line:Xs,column:ta,length:s,return:"",siblings:o}}l(Zs,"node");function B$(){return Bt}l(B$,"char");function A$(){return Bt=me>0?Ar(la,--me):0,ta--,Bt===10&&(ta=1,Xs--),Bt}l(A$,"prev");function pe(){return Bt=me2||ea(Bt)>3?"":" "}l(E$,"whitespace");function O$(t,e){for(;--e&&pe()&&!(Bt<48||Bt>102||Bt>57&&Bt<65||Bt>70&&Bt<97););return En(t,ja()+(e<6&&Ye()==32&&pe()==32))}l(O$,"escaping");function ss(t){for(;pe();)switch(Bt){case t:return me;case 34:case 39:t!==34&&t!==39&&ss(Bt);break;case 40:t===41&&ss(t);break;case 92:pe();break}return me}l(ss,"delimiter");function D$(t,e){for(;pe()&&t+Bt!==57&&!(t+Bt===84&&Ye()===47););return"/*"+En(e,me-1)+"*"+hd(t===47?t:pe())}l(D$,"commenter");function I$(t){for(;!ea(Ye());)pe();return En(t,me)}l(I$,"identifier");function R$(t){return F$(Wa("",null,null,null,[""],t=L$(t),0,[0],t))}l(R$,"compile");function Wa(t,e,r,i,a,n,s,o,c){for(var h=0,u=0,d=s,p=0,f=0,g=0,m=1,y=1,x=1,b=0,k="",_=a,C=n,$=i,S=k;y;)switch(g=b,b=pe()){case 40:if(g!=108&&Ar(S,d-1)==58){S$(S+=qa(Co(b),"&","&\f"),"&\f",v$(h?o[h-1]:0))!=-1&&(x=-1);break}case 34:case 39:case 91:S+=Co(b);break;case 9:case 10:case 13:case 32:S+=E$(g);break;case 92:S+=O$(ja()-1,7);continue;case 47:switch(Ye()){case 42:case 47:Ba(N$(D$(pe(),ja()),e,r,c),c),(ea(g||1)==5||ea(Ye()||1)==5)&&Ce(S)&&Pr(S,-1,void 0)!==" "&&(S+=" ");break;default:S+="/"}break;case 123*m:o[h++]=Ce(S)*x;case 125*m:case 59:case 0:switch(b){case 0:case 125:y=0;case 59+u:x==-1&&(S=qa(S,/\f/g,"")),f>0&&(Ce(S)-d||m===0&&g===47)&&Ba(f>32?Jh(S+";",i,r,d-1,c):Jh(qa(S," ","")+";",i,r,d-2,c),c);break;case 59:S+=";";default:if(Ba($=Qh(S,e,r,h,u,a,o,k,_=[],C=[],d,n),n),b===123)if(u===0)Wa(S,e,$,$,_,n,d,o,C);else{switch(p){case 99:if(Ar(S,3)===110)break;case 108:if(Ar(S,2)===97)break;default:u=0;case 100:case 109:case 115:}u?Wa(t,$,$,i&&Ba(Qh(t,$,$,0,0,a,o,k,a,_=[],d,C),C),a,C,d,o,i?_:C):Wa(S,$,$,$,[""],C,0,o,C)}}h=u=f=0,m=x=1,k=S="",d=s;break;case 58:d=1+Ce(S),f=g;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&A$()==125)continue}switch(S+=hd(b),b*m){case 38:x=u>0?1:(S+="\f",-1);break;case 44:o[h++]=(Ce(S)-1)*x,x=1;break;case 64:Ye()===45&&(S+=Co(pe())),p=Ye(),u=d=Ce(k=S+=I$(ja())),b++;break;case 45:g===45&&Ce(S)==2&&(m=0)}}return n}l(Wa,"parse");function Qh(t,e,r,i,a,n,s,o,c,h,u,d){for(var p=a-1,f=a===0?n:[""],g=T$(f),m=0,y=0,x=0;m0?f[b]+" "+k:qa(k,/&\f/g,f[b])))&&(c[x++]=_);return Zs(t,e,r,a===0?$$:o,c,h,u,d)}l(Qh,"ruleset");function N$(t,e,r,i){return Zs(t,e,r,w$,hd(B$()),Pr(t,2,-2),0,i)}l(N$,"comment");function Jh(t,e,r,i,a){return Zs(t,e,r,_$,Pr(t,0,i),Pr(t,i+1,-1),i,a)}l(Jh,"declaration");function ls(t,e){for(var r="",i=0;i{Np.forEach(t=>{t()}),Np=[]},"attachFunctions"),b6=l(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function j$(t){let e=t.match(H1);if(!e)return{text:t,metadata:{}};let r=b3(e[1],{schema:x3})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};let 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}}l(j$,"extractFrontMatter");var k6=l(t=>t.replace(/\r\n?/g,` `).replace(/<(\w+)([^>]*)>/g,(e,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),C6=l(t=>{let{text:e,metadata:r}=j$(t),{displayMode:i,title:a,config:n={}}=r;return i&&(n.gantt||(n.gantt={}),n.gantt.displayMode=i),{title:a,config:n,text:e}},"processFrontmatter"),w6=l(t=>{let e=we.detectInit(t)??{},r=we.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(e.wrap=!0),{text:SB(t),directive:e}},"processDirectives");function ud(t){let e=k6(t),r=C6(e),i=w6(r.text),a=ju(r.config,i.directive);return t=b6(i.text),{code:t,title:r.title,config:a}}l(ud,"preprocessDiagram");function W$(t){let e=new TextEncoder().encode(t),r=Array.from(e,i=>String.fromCodePoint(i)).join("");return btoa(r)}l(W$,"toBase64");var $6=5e4,_6="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",v6="sandbox",S6="loose",T6="http://www.w3.org/2000/svg",M6="http://www.w3.org/1999/xlink",B6="http://www.w3.org/1999/xhtml",A6="100%",L6="100%",F6="border:0;margin:0;",E6="margin:0",O6="allow-top-navigation-by-user-activation allow-popups",D6='The "iframe" tag is not supported by your browser.',I6=["foreignobject"],R6=["dominant-baseline"];function dd(t){let e=ud(t);return No(),gS(e.config??{}),e}l(dd,"processAndSetConfigs");async function H$(t,e){Gs();try{let{code:r,config:i}=dd(t);return{diagramType:(await Y$(r)).type,config:i}}catch(r){if(e?.suppressErrors)return!1;throw r}}l(H$,"parse");var Pp=l((t,e,r=[])=>` .${t} ${e} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),N6=l((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){let i=t.htmlLabels??t.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(a=>{Ip(a.styles)||i.forEach(n=>{r+=Pp(a.id,n,a.styles)}),Ip(a.textStyles)||(r+=Pp(a.id,"tspan",(a?.textStyles||[]).map(n=>n.replace("color","fill"))))})}return r},"createCssStyles"),P6=l((t,e,r,i)=>{let a=N6(t,r),n=tT(e,a,t.themeVariables);return ls(R$(`${i}{${n}}`),P$)},"createUserStyles"),z6=l((t="",e,r)=>{let i=t;return!r&&!e&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Gr(i),i=i.replace(/
    /g,"
    "),i},"cleanUpSvgCode"),q6=l((t="",e)=>{let r=e?.viewBox?.baseVal?.height?e.viewBox.baseVal.height+"px":L6,i=W$(`${t}`);return``},"putIntoIFrame"),zp=l((t,e,r,i,a)=>{let n=t.append("div");n.attr("id",r),i&&n.attr("style",i);let s=n.append("svg").attr("id",e).attr("width","100%").attr("xmlns",T6);return a&&s.attr("xmlns:xlink",a),s.append("g"),t},"appendDivSvgG");function tc(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}l(tc,"sandboxedIframe");var j6=l((t,e,r,i)=>{t.getElementById(e)?.remove(),t.getElementById(r)?.remove(),t.getElementById(i)?.remove()},"removeExistingElements"),W6=l(async function(t,e,r){Gs();let i=dd(e);e=i.code;let a=Gt();R.debug(a),e.length>(a?.maxTextSize??$6)&&(e=_6);let n="#"+t,s="i"+t,o="#"+s,c="d"+t,h="#"+c,u=l(()=>{let O=pt(p?o:h).node();O&&"remove"in O&&O.remove()},"removeTempElements"),d=pt("body"),p=a.securityLevel===v6,f=a.securityLevel===S6,g=a.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),p){let O=tc(pt(r),s);d=pt(O.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=pt(r);zp(d,t,c,`font-family: ${g}`,M6)}else{if(j6(document,t,c,s),p){let O=tc(pt("body"),s);d=pt(O.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=pt("body");zp(d,t,c)}let m,y;try{m=await Kh.fromText(e,{title:i.title})}catch(O){if(a.suppressErrorRendering)throw u(),O;m=await Kh.fromText("error"),y=O}let x=d.select(h).node(),b=m.type,k=x.firstChild,_=k.firstChild,C=m.renderer.getClasses?.(e,m),$=P6(a,b,C,n),S=document.createElement("style");S.innerHTML=$,k.insertBefore(S,_);try{await m.renderer.draw(e,t,Ad.version,m)}catch(O){throw a.suppressErrorRendering?u():S4.draw(e,t,Ad.version),O}let D=d.select(`${h} svg`),N=m.db.getAccTitle?.(),I=m.db.getAccDescription?.();V$(b,D,N,I),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",B6);let T=d.select(h).node().innerHTML;if(R.debug("config.arrowMarkerAbsolute",a.arrowMarkerAbsolute),T=z6(T,p,Et(a.arrowMarkerAbsolute)),p){let O=d.select(h+" svg").node();T=q6(T,O)}else f||(T=Zi.sanitize(T,{ADD_TAGS:I6,ADD_ATTR:R6,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(x6(),y)throw y;return u(),{diagramType:b,svg:T,bindFunctions:m.db.bindFunctions}},"render");function U$(t={}){let e=Lt({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),pS(e),e?.theme&&e.theme in Ve?e.themeVariables=Ve[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Ve.default.getThemeVariables(e.themeVariables));let r=typeof e=="object"?dS(e):tx();rc(r.logLevel),Gs()}l(U$,"initialize");var Y$=l((t,e={})=>{let{code:r}=ud(t);return Kh.fromText(r,e)},"getDiagramFromText");function V$(t,e,r,i){z$(e,t),q$(e,r,i,e.attr("id"))}l(V$,"addA11yInfo");var zr=Object.freeze({render:W6,parse:H$,getDiagramFromText:Y$,initialize:U$,getConfig:Gt,setConfig:ex,getSiteConfig:tx,updateSiteConfig:fS,reset:l(()=>{No()},"reset"),globalReset:l(()=>{No(Xi)},"globalReset"),defaultConfig:Xi});rc(Gt().logLevel);No(Gt());var H6=l((t,e,r)=>{R.warn(t),qu(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"),G$=l(async function(t={querySelector:".mermaid"}){try{await U6(t)}catch(e){if(qu(e)&&R.error(e.str),Ke.parseError&&Ke.parseError(e),!t.suppressErrors)throw R.error("Use the suppressErrors option to suppress these errors"),e}},"run"),U6=l(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){let i=zr.getConfig();R.debug(`${t?"":"No "}Callback function found`);let a;if(r)a=r;else if(e)a=document.querySelectorAll(e);else throw new Error("Nodes and querySelector are both undefined");R.debug(`Found ${a.length} diagrams`),i?.startOnLoad!==void 0&&(R.debug("Start On Load: "+i?.startOnLoad),zr.updateSiteConfig({startOnLoad:i?.startOnLoad}));let n=new we.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed),s,o=[];for(let c of Array.from(a)){if(R.info("Rendering diagram: "+c.id),c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");let h=`mermaid-${n.next()}`;s=c.innerHTML,s=Wu(we.entityDecode(s)).trim().replace(//gi,"
    ");let u=we.detectInit(s);u&&R.debug("Detected early reinit: ",u);try{let{svg:d,bindFunctions:p}=await J$(h,s,c);c.innerHTML=d,t&&await t(h),p&&p(c)}catch(d){H6(d,o,Ke.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),X$=l(function(t){zr.initialize(t)},"initialize"),Y6=l(async function(t,e,r){R.warn("mermaid.init is deprecated. Please use run instead."),t&&X$(t);let i={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?i.querySelector=e:e&&(e instanceof HTMLElement?i.nodes=[e]:i.nodes=e),await G$(i)},"init"),V6=l(async(t,{lazyLoad:e=!0}={})=>{Gs(),ah(...t),e===!1&&await d6()},"registerExternalDiagrams"),Z$=l(function(){if(Ke.startOnLoad){let{startOnLoad:t}=zr.getConfig();t&&Ke.run().catch(e=>R.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Z$,!1);var G6=l(function(t){Ke.parseError=t},"setParseErrorHandler"),hs=[],Cl=!1,Q$=l(async()=>{if(!Cl){for(Cl=!0;hs.length>0;){let t=hs.shift();if(t)try{await t()}catch(e){R.error("Error executing queue",e)}}Cl=!1}},"executeQueue"),X6=l(async(t,e)=>new Promise((r,i)=>{let a=l(()=>new Promise((n,s)=>{zr.parse(t,e).then(o=>{n(o),r(o)},o=>{R.error("Error parsing",o),Ke.parseError?.(o),s(o),i(o)})}),"performCall");hs.push(a),Q$().catch(i)}),"parse"),J$=l((t,e,r)=>new Promise((i,a)=>{let n=l(()=>new Promise((s,o)=>{zr.render(t,e,r).then(c=>{s(c),i(c)},c=>{R.error("Error parsing",c),Ke.parseError?.(c),o(c),a(c)})}),"performCall");hs.push(n),Q$().catch(a)}),"render"),Z6=l(()=>Object.keys(Dr).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Ke={startOnLoad:!0,mermaidAPI:zr,parse:X6,render:J$,init:Y6,run:G$,registerExternalDiagrams:V6,registerLayoutLoaders:Gw,initialize:X$,parseError:void 0,contentLoaded:Z$,setParseErrorHandler:G6,detectType:fu,registerIconPacks:JB,getRegisteredDiagramsMetadata:Z6},Q6=Ke;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution */const xE=Object.freeze(Object.defineProperty({__proto__:null,default:Q6},Symbol.toStringTag,{value:"Module"}));export{nT as $,hE as A,Ou as B,mB as C,qM as D,lE as E,ZM as F,aT as G,rT as H,DM as I,cE as J,hT as K,ju as L,Qe as M,eT as N,Gt as O,nE as P,P5 as Q,yk as R,OB as S,Zo as T,iT as U,yE as V,px as W,UM as X,Ck as Y,Da as Z,Y5 as _,xt as a,mu as a$,HM as a0,WM as a1,kp as a2,Bn as a3,Xh as a4,Lu as a5,H2 as a6,Vo as a7,xB as a8,na as a9,Z_ as aA,Yi as aB,X_ as aC,G_ as aD,Ao as aE,wn as aF,Ac as aG,Bc as aH,pi as aI,Bo as aJ,v_ as aK,m_ as aL,ec as aM,dT as aN,Ad as aO,Ps as aP,hv as aQ,Sc as aR,cv as aS,nS as aT,s0 as aU,OA as aV,k0 as aW,sE as aX,Qi as aY,wB as aZ,WS as a_,Q2 as aa,dk as ab,Xo as ac,Du as ad,Fs as ae,gp as af,Fu as ag,yB as ah,i5 as ai,U5 as aj,Rs as ak,Re as al,Eu as am,PM as an,gB as ao,sB as ap,ov as aq,b_ as ar,x_ as as,Km as at,eE as au,S_ as av,r0 as aw,Ec as ax,ys as ay,Q_ as az,Dk as b,ip as b0,La as b1,AB as b2,kB as b3,MM as b4,Au as b5,Ip as b6,QS as b7,Sn as b8,Z as b9,tt as bA,dE as bB,kL as bC,SL as bD,CL as bE,tE as bF,xE as bG,at as ba,fx as bb,oE as bc,KA as bd,Hw as be,fE as bf,aE as bg,k3 as bh,Et as bi,gr as bj,Bu as bk,mC as bl,Gr as bm,Ek as bn,An as bo,JB as bp,QB as bq,fm as br,vc as bs,V_ as bt,K as bu,Zb as bv,HL as bw,pE as bx,gE as by,uE as bz,mE as c,we as d,sT as e,v3 as f,b3 as g,ia as h,pt as i,oT as j,x3 as k,yL as l,l as m,g_ as n,ge as o,R as p,jp as q,K1 as r,J5 as s,QL as t,Ns as u,Lt as v,LB as w,qr as x,lF as y,Tn as z};