PageSourceSearch

https://nickz.ai/assets/js/index-C16DHWFp.js

js nickz.ai collected 2026-10-05 14:21:03 UTC 608,191 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/js/vendor-katex-BuQuj6Fv.js","assets/css/vendor-katex-DEGTXuzJ.css","assets/js/dagre-KLK3FWXG-D4F02BJF.js","assets/js/graph-C_ZsycKk.js","assets/js/_baseUniq-BjWlgG8Y.js","assets/js/index-BeIIFw6E.js","assets/js/vendor-react-DejgYtBM.js","assets/js/vendor-semi-D8d7bTtM.js","assets/js/vendor-icons-EJvJ5X-w.js","assets/js/vendor-motion-Chfy_MiU.js","assets/js/layout-CmQUdn0S.js","assets/js/_basePickBy-bVyxPQRR.js","assets/js/clone-VMOlTGG7.js","assets/js/dayjs.min-CASHsil8.js","assets/js/purify.es-Bm-lHtoJ.js","assets/js/index-DcbB2zxU.js","assets/js/vendor-highlight-CaHTjBxz.js","assets/js/index-B_PxGnmD.js","assets/css/vendor-semi-o4lF_xks.css","assets/css/index-D0vqlaxj.css","assets/css/vendor-highlight-DNzBsRYQ.css","assets/js/cose-bilkent-S5V4N54A-DgRtKu10.js","assets/js/cytoscape.esm-BbMTu3Xr.js","assets/js/c4Diagram-IC4MRINW-L0BzSFbJ.js","assets/js/chunk-JSJVCQXG-frfIGU8m.js","assets/js/flowDiagram-PKNHOUZH-DPphzpsQ.js","assets/js/chunk-FMBD7UC4-DyXD2GCB.js","assets/js/chunk-55IACEB6-B8hfRf52.js","assets/js/chunk-KX2RTZJC-D7shOJrd.js","assets/js/channel-CCSk5QJl.js","assets/js/erDiagram-INFDFZHY-V2nlHOlN.js","assets/js/gitGraphDiagram-K3NZZRJ6-CJuKNLAQ.js","assets/js/chunk-4BX2VUAB-CJu338GO.js","assets/js/chunk-QZHKN3VN-D5cQ1iop.js","assets/js/treemap-KZPCXAKY-DdCrRx6w.js","assets/js/ganttDiagram-A5KZAMGK-C389l52C.js","assets/js/linear-B7SoSIUI.js","assets/js/init-C0SZ43gy.js","assets/js/defaultLocale-FGEv0fP-.js","assets/js/infoDiagram-LFFYTUFH-aNwW__kV.js","assets/js/pieDiagram-SKSYHLDU-DOZDFWNX.js","assets/js/arc-BQRz2rP0.js","assets/js/ordinal-BXL5nHgV.js","assets/js/quadrantDiagram-337W2JSQ-dvlPHKa0.js","assets/js/xychartDiagram-JWTSCODW-ml6_KJFy.js","assets/js/requirementDiagram-Z7DCOOCP-DRkYpnp7.js","assets/js/sequenceDiagram-2WXFIKYE-q63eULMB.js","assets/js/classDiagram-VBA2DB6C-C3m8c0iR.js","assets/js/chunk-WL4C6EOR-D41amgrS.js","assets/js/classDiagram-v2-RAHNMMFH-C3m8c0iR.js","assets/js/stateDiagram-RAJIS63D-DnQsesY8.js","assets/js/chunk-NQ4KR5QH-BilLAwwE.js","assets/js/stateDiagram-v2-FVOUBMTO-CpNuagSV.js","assets/js/journeyDiagram-4ABVD52K-CVjU2TQP.js","assets/js/timeline-definition-YZTLITO2-D51kYbEL.js","assets/js/mindmap-definition-YRQLILUH-CL8KrDIf.js","assets/js/kanban-definition-K7BYSVSG-SJxIzQ7H.js","assets/js/sankeyDiagram-WA2Y5GQK-C6jY7bl2.js","assets/js/diagram-P4PSJMXO-BZArGzSi.js","assets/js/diagram-IFDJBPK2-C1P-Wsmw.js","assets/js/blockDiagram-WCTKOSBZ-BhiCuc4P.js","assets/js/architectureDiagram-2XIMDMQ5-5i4yUs-1.js","assets/js/ishikawaDiagram-PHBUUO56-D3G0DC6c.js","assets/js/vennDiagram-LZ73GAT5-RC4kg7vW.js","assets/js/diagram-E7M64L7V-BbikrTiT.js","assets/js/vendor-charts-CKochBGt.js"])))=>i.map(i=>d[i]);
2var e,r,i,n,s,a,o,l,c,h,d=Object.defineProperty,u=(t,e,r)=>((t,e,r)=>e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);import{r as p,j as g,R as f,f as m}from"./vendor-react-DejgYtBM.js";import{Y as y,M as x,aZ as b,b9 as C,z as w,B as k,f as v,a1 as S,j as _,F as T,G as A,E as B,I as M,b as E,m as L,an as j,T as F,a as N,H as I,k as O,P as D,be as R,i as z,b8 as $,D as P,N as q,r as W,p as H,W as V,L as Y}from"./vendor-semi-D8d7bTtM.js";import{by as U,bz as G,bj as J,bA as X,b6 as K,_ as Z,bB as Q,bC as tt,u as et,bD as rt,bE as it,bF as nt,bG as st,bH as at,bI as ot,bJ as lt,bK as ct,a5 as ht,bL as dt,bM as ut,bN as pt,bO as gt,A as ft,bP as mt,s as yt,bQ as xt,bR as bt,bS as Ct,bT as wt,v as kt,bU as vt,bV as St,a as _t,b8 as Tt,y as At,S as Bt,z as Mt,U as Et,bW as Lt,ax as jt,bX as Ft}from"./index-BeIIFw6E.js";import"./vendor-katex-BuQuj6Fv.js";import{d as Nt}from"./dayjs.min-CASHsil8.js";import{p as It}from"./purify.es-Bm-lHtoJ.js";import{a as Ot,r as Dt,c as Rt,b as zt}from"./index-DcbB2zxU.js";import{M as $t}from"./index-B_PxGnmD.js";import{C as Pt,aN as qt,b$ as Wt,d as Ht,Q as Vt,ba as Yt,aM as Ut,R as Gt,br as Jt,aY as Xt,T as Kt,a1 as Zt,f as Qt,a as te,a9 as ee,a8 as re,e as ie,b as ne,E as se,bv as ae,a7 as oe,aO as le,$ as ce,V as he,c0 as de,c1 as ue,aA as pe,c2 as ge,c3 as fe,aX as me,b3 as ye,aW as xe,x as be,c4 as Ce,ak as we,aa as ke,F as ve,w as Se,a$ as _e,bR as Te,ae as Ae,c5 as Be}from"./vendor-icons-EJvJ5X-w.js";import{m as Me}from"./vendor-motion-Chfy_MiU.js";var Ee="comm",Le="rule",je="decl",Fe=Math.abs,Ne=String.fromCharCode;function Ie(t){return t.trim()}function Oe(t,e,r){return t.replace(e,r)}function De(t,e,r){return t.indexOf(e,r)}function Re(t,e){return 0|t.charCodeAt(e)}function ze(t,e,r){return t.slice(e,r)}function $e(t){return t.length}function Pe(t,e){return e.push(t),t}var qe=1,We=1,He=0,Ve=0,Ye=0,Ue="";function Ge(t,e,r,i,n,s,a,o){return{value:t,root:e,parent:r,type:i,props:n,children:s,line:qe,column:We,length:a,return:"",siblings:o}}function Je(){return Ye=Ve>0?Re(Ue,--Ve):0,We--,10===Ye&&(We=1,qe--),Ye}function Xe(){return Ye=Ve<He?Re(Ue,Ve++):0,We++,10===Ye&&(We=1,qe++),Ye}function Ke(){return Re(Ue,Ve)}function Ze(){return Ve}function Qe(t,e){return ze(Ue,t,e)}function tr(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function er(t){return Ie(Qe(Ve-1,nr(91===t?t+2:40===t?t+1:t)))}function rr(t){for(;(Ye=Ke())&&Ye<33;)Xe();return tr(t)>2||tr(Ye)>3?"":" "}function ir(t,e){for(;
2--e&&Xe()&&!(Ye<48||Ye>102||Ye>57&&Ye<65||Ye>70&&Ye<97););return Qe(t,Ze()+(e<6&&32==Ke()&&32==Xe()))}function nr(t){for(;Xe();)switch(Ye){case t:return Ve;case 34:case 39:34!==t&&39!==t&&nr(Ye);break;case 40:41===t&&nr(t);break;case 92:Xe()}return Ve}function sr(t,e){for(;Xe()&&t+Ye!==57&&(t+Ye!==84||47!==Ke()););return"/*"+Qe(e,Ve-1)+"*"+Ne(47===t?t:Xe())}function ar(t){for(;!tr(Ke());)Xe();return Qe(t,Ve)}function or(t){return function(t){return Ue="",t}(lr("",null,null,null,[""],t=function(t){return qe=We=1,He=$e(Ue=t),Ve=0,[]}(t),0,[0],t))}function lr(t,e,r,i,n,s,a,o,l){for(var c=0,h=0,d=a,u=0,p=0,g=0,f=1,m=1,y=1,x=0,b="",C=n,w=s,k=i,v=b;m;)switch(g=x,x=Xe()){case 40:if(108!=g&&58==Re(v,d-1)){-1!=De(v+=Oe(er(x),"&","&\f"),"&\f",Fe(c?o[c-1]:0))&&(y=-1);break}case 34:case 39:case 91:v+=er(x);break;case 9:case 10:case 13:case 32:v+=rr(g);break;case 92:v+=ir(Ze()-1,7);continue;case 47:switch(Ke()){case 42:case 47:Pe(hr(sr(Xe(),Ze()),e,r,l),l),5!=tr(g||1)&&5!=tr(Ke()||1)||!$e(v)||" "===ze(v,-1,void 0)||(v+=" ");break;default:v+="/"}break;case 123*f:o[c++]=$e(v)*y;case 125*f:case 59:case 0:switch(x){case 0:case 125:m=0;case 59+h:-1==y&&(v=Oe(v,/\f/g,"")),p>0&&($e(v)-d||0===f&&47===g)&&Pe(p>32?dr(v+";",i,r,d-1,l):dr(Oe(v," ","")+";",i,r,d-2,l),l);break;case 59:v+=";";default:if(Pe(k=cr(v,e,r,c,h,n,o,b,C=[],w=[],d,s),s),123===x)if(0===h)lr(v,e,k,k,C,s,d,o,w);else{switch(u){case 99:if(110===Re(v,3))break;case 108:if(97===Re(v,2))break;default:h=0;case 100:case 109:case 115:}h?lr(t,k,k,i&&Pe(cr(t,k,k,0,0,n,o,b,n,C=[],d,w),w),n,w,d,o,i?C:w):lr(v,k,k,k,[""],w,0,o,w)}}c=h=p=0,f=y=1,b=v="",d=a;break;case 58:d=1+$e(v),p=g;default:if(f<1)if(123==x)--f;else if(125==x&&0==f++&&125==Je())continue;switch(v+=Ne(x),x*f){case 38:y=h>0?1:(v+="\f",-1);break;case 44:o[c++]=($e(v)-1)*y,y=1;break;case 64:45===Ke()&&(v+=er(Xe())),u=Ke(),h=d=$e(b=v+=ar(Ze())),x++;break;case 45:45===g&&2==$e(v)&&(f=0)}}return s}function cr(t,e,r,i,n,s,a,o,l,c,h,d){for(var u=n-1,p=0===n?s:[""],g=function(t){return t.length}(p),f=0,m=0,y=0;f<i;++f)for(var x=0,b=ze(t,u+1,u=Fe(m=a[f])),C=t;x<g;++x)(C=Ie(m>0?p[x]+" "+b:Oe(b,/&\f/g,p[x])))&&(l[y++]=C);return Ge(t,e,r,0===n?Le:o,l,c,h,d)}function hr(t,e,r,i){return Ge(t,e,r,Ee,Ne(Ye),ze(t,2,-2),0,i)}function dr(t,e,r,i,n){return Ge(t,e,r,je,ze(t,0,i),ze(t,i+1,-1),i,n)}function ur(t,e){for(var r="",i=0;i<t.length;i++)r+=e(t[i],i,t,e)||"";return r}function pr(t,e,r,i){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case"@namespace":case je:return t.return=t.return||t.value;case Ee:return"";case"@keyframes":return t.return=t.value+"{"+ur(t.children,i)+"}";case Le:if(!$e(t.value=t.props.join(",")))return""}return $e(r=ur(t.children,i))?t.return=t.value+"{"+r+"}":""}function gr(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function fr(t){return t}function mr(t){if(!gr(t))return!1;var e=U(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var yr,xr=G["__core-js_shared__"],br=(yr=/[^.]+$/.exec(xr&&xr.keys&&xr.keys.IE_PROTO||""))?"Symbol(src)_1."+yr:"",Cr=Function.prototype.toString;function wr(t){if(null!=t){try{return Cr.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var kr=/^\[object .+?Constructor\]$/,vr=Function.prototype,Sr=Object.prototype,_r=vr.toString,Tr=Sr.hasOwnProperty,Ar=RegExp("^"+_r.call(Tr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Br(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!gr(t)||(e=t,br&&br in e))&&(mr(t)?Ar:kr).test(wr(t));var e}(r)?r:void 0}var Mr=Br(G,"WeakMap"),Er=Object.create,Lr=function(){function t(){}return function(e){if(!gr(e))return{};if(Er)return Er(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function jr(t,e){var r=-1,i=t.length;for(e||(e=Array(i));++r<i;)e[r]=t[r];return e}var Fr=Date.now;function Nr(t){return function(){return t}}var Ir,Or,Dr,Rr=function(){try{var t=Br(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),zr=Rr?function(t,e){return Rr(t,"toString",{configurable:!0,enumerable:!1,value:Nr(e),writable:!0})}:fr,$r=(Ir=zr,Or=0,Dr=0,function(){var t=Fr(),e=16-(t-Dr);if(Dr=t,e>0){if(++Or>=800)return arguments[0]}else Or=0;return Ir.apply(void 0,arguments)}),Pr=/^(?:0|[1-9]\d*)$/;function qr(t,e){var r=typeof t;return!!(e=e??9007199254740991)&&("number"==r||"symbol"!=r&&Pr.test(t))&&t>-1&&t%1==0&&t<e}function Wr(t,e,r){"__proto__"==e&&Rr?Rr(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Hr(t,e){return t===e||t!=t&&e!=e}var Vr=Object.prototype.hasOwnProperty;function Yr(t,e,r){var i=t[e];Vr.call(t,e)&&Hr(i,r)&&(void 0!==r||e in t)||Wr(t,e,r)}function Ur(t,e,r,i){var n=!r;r||(r={});for(var s=-1,a=e.length;++s<a;){var o=e[s],l=void 0;void 0===l&&(l=t[o]),n?Wr(r,o,l):Yr(r,o,l)}return r}var Gr=Math.max;function Jr(t,e,r){return e=Gr(void 0===e?t.length-1:e,0),function(){for(var i=arguments,n=-1,s=Gr(i.length-e,0),a=Array(s);++n<s;)a[n]=i[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=i[n];return o[e]=r(a),function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}(t,this,o)}}function Xr(t,e){return $r(Jr(t,e,fr),t+"")}function Kr(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Zr(t){return null!=t&&Kr(t.length)&&!mr(t)}function Qr(t,e,r){if(!gr(r))return!1;var i=typeof e;return!!("number"==i?Zr(r)&&qr(e,r.length):"string"==i&&e in r)&&Hr(r[e],t)}function ti(t){return Xr(function(e,r){var i=-1,n=r.length,s=n>1?r[n-1]:void 0,a=n>2?r[2]:void 0;for(s=t.length>3&&"function"==typeof s?(n--,s):void 0,a&&Qr(r[0],r[1],a)&&(s=n<3?void 0:s,n=1),e=Object(e);++i<n;){var o=r[i];o&&t(e,o,i,s)}return e})}var ei=Object.prototype;function ri(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ei)}function ii(t){return J(t)&&"[object Arguments]"==U(t)}var ni=Object.prototype,si=ni.hasOwnProperty,ai=ni.propertyIsEnumerable,oi=ii(function(){return arguments}())?ii:function(t){return J(t)&&si.call(t,"callee")&&!ai.call(t,"callee")},li="object"==typeof exports&&exports&&!exports.nodeType&&exports,ci=li&&"object"==typeof module&&module&&!module.nodeType&&module,hi=ci&&ci.exports===li?G.Buffer:void 0,di=(hi?hi.isBuffer:void 0)||function(){return!1},ui={};function pi(t){return function(e){return t(e)}}
vendor: 7,239 bytes, line 2
2ui["[object Float32Array]"]=ui["[object Float64Array]"]=ui["[object Int8Array]"]=ui["[object Int16Array]"]=ui["[object Int32Array]"]=ui["[object Uint8Array]"]=ui["[object Uint8ClampedArray]"]=ui["[object Uint16Array]"]=ui["[object Uint32Array]"]=!0,ui["[object Arguments]"]=ui["[object Array]"]=ui["[object ArrayBuffer]"]=ui["[object Boolean]"]=ui["[object DataView]"]=ui["[object Date]"]=ui["[object Error]"]=ui["[object Function]"]=ui["[object Map]"]=ui["[object Number]"]=ui["[object Object]"]=ui["[object RegExp]"]=ui["[object Set]"]=ui["[object String]"]=ui["[object WeakMap]"]=!1;var gi="object"==typeof exports&&exports&&!exports.nodeType&&exports,fi=gi&&"object"==typeof module&&module&&!module.nodeType&&module,mi=fi&&fi.exports===gi&&X.process,yi=function(){try{return fi&&fi.require&&fi.require("util").types||mi&&mi.binding&&mi.binding("util")}catch(t){}}(),xi=yi&&yi.isTypedArray,bi=xi?pi(xi):function(t){return J(t)&&Kr(t.length)&&!!ui[U(t)]},Ci=Object.prototype.hasOwnProperty;function wi(t,e){var r=K(t),i=!r&&oi(t),n=!r&&!i&&di(t),s=!r&&!i&&!n&&bi(t),a=r||i||n||s,o=a?function(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}(t.length,String):[],l=o.length;for(var c in t)!e&&!Ci.call(t,c)||a&&("length"==c||n&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||qr(c,l))||o.push(c);return o}function ki(t,e){return function(r){return t(e(r))}}var vi=ki(Object.keys,Object),Si=Object.prototype.hasOwnProperty;function _i(t){if(!ri(t))return vi(t);var e=[];for(var r in Object(t))Si.call(t,r)&&"constructor"!=r&&e.push(r);return e}var Ti=Object.prototype.hasOwnProperty;function Ai(t){return Zr(t)?wi(t,!0):function(t){if(!gr(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=ri(t),r=[];for(var i in t)("constructor"!=i||!e&&Ti.call(t,i))&&r.push(i);return r}(t)}var Bi=Br(Object,"create"),Mi=Object.prototype.hasOwnProperty,Ei=Object.prototype.hasOwnProperty;function Li(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function ji(t,e){for(var r=t.length;r--;)if(Hr(t[r][0],e))return r;return-1}Li.prototype.clear=function(){this.__data__=Bi?Bi(null):{},this.size=0},Li.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Li.prototype.get=function(t){var e=this.__data__;if(Bi){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return Mi.call(e,t)?e[t]:void 0},Li.prototype.has=function(t){var e=this.__data__;return Bi?void 0!==e[t]:Ei.call(e,t)},Li.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Bi&&void 0===e?"__lodash_hash_undefined__":e,this};var Fi=Array.prototype.splice;function Ni(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}Ni.prototype.clear=function(){this.__data__=[],this.size=0},Ni.prototype.delete=function(t){var e=this.__data__,r=ji(e,t);return!(r<0||(r==e.length-1?e.pop():Fi.call(e,r,1),--this.size,0))},Ni.prototype.get=function(t){var e=this.__data__,r=ji(e,t);return r<0?void 0:e[r][1]},Ni.prototype.has=function(t){return ji(this.__data__,t)>-1},Ni.prototype.set=function(t,e){var r=this.__data__,i=ji(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this};var Ii=Br(G,"Map");function Oi(t,e){var r,i,n=t.__data__;return("string"==(i=typeof(r=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?n["string"==typeof e?"string":"hash"]:n.map}function Di(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Ri(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var a=t.apply(this,i);return r.cache=s.set(n,a)||s,a};return r.cache=new(Ri.Cache||Di),r}Di.prototype.clear=function(){this.size=0,this.__data__={hash:new Li,map:new(Ii||Ni),string:new Li}},Di.prototype.delete=function(t){var e=Oi(this,t).delete(t);return this.size-=e?1:0,e},Di.prototype.get=function(t){return Oi(this,t).get(t)},Di.prototype.has=function(t){return Oi(this,t).has(t)},Di.prototype.set=function(t,e){var r=Oi(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this},Ri.Cache=Di;var zi=ki(Object.getPrototypeOf,Object),$i=Function.prototype,Pi=Object.prototype,qi=$i.toString,Wi=Pi.hasOwnProperty,Hi=qi.call(Object);function Vi(t){var e=this.__data__=new Ni(t);this.size=e.size}Vi.prototype.clear=function(){this.__data__=new Ni,this.size=0},Vi.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Vi.prototype.get=function(t){return this.__data__.get(t)},Vi.prototype.has=function(t){return this.__data__.has(t)},Vi.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Ni){var i=r.__data__;if(!Ii||i.length<199)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new Di(i)}return r.set(t,e),this.size=r.size,this};var Yi="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ui=Yi&&"object"==typeof module&&module&&!module.nodeType&&module,Gi=Ui&&Ui.exports===Yi?G.Buffer:void 0,Ji=Gi?Gi.allocUnsafe:void 0;function Xi(t,e){if(e)return t.slice();var r=t.length,i=Ji?Ji(r):new t.constructor(r);return t.copy(i),i}var Ki=Br(G,"DataView"),Zi=Br(G,"Promise"),Qi=Br(G,"Set"),tn="[object Map]",en="[object Promise]",rn="[object Set]",nn="[object WeakMap]",sn="[object DataView]",an=wr(Ki),on=wr(Ii),ln=wr(Zi),cn=wr(Qi),hn=wr(Mr),dn=U;(Ki&&dn(new Ki(new ArrayBuffer(1)))!=sn||Ii&&dn(new Ii)!=tn||Zi&&dn(Zi.resolve())!=en||Qi&&dn(new Qi)!=rn||Mr&&dn(new Mr)!=nn)&&(dn=function(t){var e=U(t),r="[object Object]"==e?t.constructor:void 0,i=r?wr(r):"";if(i)switch(i){case an:return sn;case on:return tn;case ln:return en;case cn:return rn;case hn:return nn}return e});var un=G.Uint8Array;function pn(t){var e=new t.constructor(t.byteLength);return new un(e).set(new un(t)),e}function gn(t,e){var r=e?pn(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function fn(t){return"function"!=typeof t.constructor||ri(t)?{}:Lr(zi(t))}var mn=function(t,e,r){for(var i=-1,n=Object(t),s=r(t),a=s.length;a--;){var o=s[++i];if(!1===e(n[o],o,n))break}return t};function yn(t,e,r){(void 0!==r&&!Hr(t[e],r)||void 0===r&&!(e in t))&&Wr(t,e,r)}function xn(t){return J(t)&&Zr(t)}function bn(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Cn(t,e,r,i,n){t!==e&&mn(e,function(s,a){if(n||(n=new Vi),gr(s))!function(t,e,r,i,n,s,a){var o=bn(t,r),l=bn(e,r),c=a.get(l);if(c)yn(t,r,c);else{var h,d=s?s(o,l,r+"",t,e,a):void 0,u=void 0===d;if(u){var p=K(l),g=!p&&di(l),f=!p&&!g&&bi(l);d=l,p||g||f?K(o)?d=o:xn(o)?d=jr(o):g?(u=!1,d=Xi(l,!0)):f?(u=!1,d=gn(l,!0)):d=[]:function(t){if(!J(t)||"[object Object]"!=U(t))return!1;var e=zi(t);if(null===e)return!0;var r=Wi.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&qi.call(r)==Hi}(l)||oi(l)?(d=o,oi(o)?d=Ur(h=o,Ai(h)):gr(o)&&!mr(o)||(d=fn(l))):u=!1}u&&(a.set(l,d),n(d,l,i,s,a),a.delete(l)),yn(t,r,d)}}(t,e,a,r,Cn,i,n);else{var o=i?i(bn(t,a),s,a+"",t,e,n):void 0;void 0===o&&(o=s),yn(t,a,o)}},Ai)}var wn=Object.prototype.hasOwnProperty;function kn(t){if(null==t)return!0;
2if(Zr(t)&&(K(t)||"string"==typeof t||"function"==typeof t.splice||di(t)||bi(t)||oi(t)))return!t.length;var e=dn(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(ri(t))return!_i(t).length;for(var r in t)if(wn.call(t,r))return!1;return!0}var vn=ti(function(t,e,r){Cn(t,e,r)}),Sn=Object.defineProperty,_n=(t,e)=>Sn(t,"name",{value:e,configurable:!0}),Tn=(t,e)=>{for(var r in e)Sn(t,r,{get:e[r],enumerable:!0})},An={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},Bn={trace:_n((...t)=>{},"trace"),debug:_n((...t)=>{},"debug"),info:_n((...t)=>{},"info"),warn:_n((...t)=>{},"warn"),error:_n((...t)=>{},"error"),fatal:_n((...t)=>{},"fatal")},Mn=_n(function(t="fatal"){let e=An.fatal;"string"==typeof t?t.toLowerCase()in An&&(e=An[t]):"number"==typeof t&&(e=t),Bn.trace=()=>{},Bn.debug=()=>{},Bn.info=()=>{},Bn.warn=()=>{},Bn.error=()=>{},Bn.fatal=()=>{},e<=An.fatal&&(Bn.fatal=console.error?console.error.bind(console,En("FATAL"),"color: orange"):console.log.bind(console,"�[35m",En("FATAL"))),e<=An.error&&(Bn.error=console.error?console.error.bind(console,En("ERROR"),"color: orange"):console.log.bind(console,"�[31m",En("ERROR"))),e<=An.warn&&(Bn.warn=console.warn?console.warn.bind(console,En("WARN"),"color: orange"):console.log.bind(console,"�[33m",En("WARN"))),e<=An.info&&(Bn.info=console.info?console.info.bind(console,En("INFO"),"color: lightblue"):console.log.bind(console,"�[34m",En("INFO"))),e<=An.debug&&(Bn.debug=console.debug?console.debug.bind(console,En("DEBUG"),"color: lightgreen"):console.log.bind(console,"�[32m",En("DEBUG"))),e<=An.trace&&(Bn.trace=console.debug?console.debug.bind(console,En("TRACE"),"color: lightgreen"):console.log.bind(console,"�[32m",En("TRACE")))},"setLogLevel"),En=_n(t=>`%c${Nt().format("ss.SSS")} : ${t} : `,"format");const Ln={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t),hsl2rgb:({h:t,s:e,l:r},i)=>{if(!e)return 2.55*r;t/=360,e/=100;const n=(r/=100)<.5?r*(1+e):r+e-r*e,s=2*r-n;switch(i){case"r":return 255*Ln.hue2rgb(s,n,t+1/3);case"g":return 255*Ln.hue2rgb(s,n,t);case"b":return 255*Ln.hue2rgb(s,n,t-1/3)}},rgb2hsl:({r:t,g:e,b:r},i)=>{t/=255,e/=255,r/=255;const n=Math.max(t,e,r),s=Math.min(t,e,r),a=(n+s)/2;if("l"===i)return 100*a;if(n===s)return 0;const o=n-s;if("s"===i)return 100*(a>.5?o/(2-n-s):o/(n+s));switch(n){case t:return 60*((e-r)/o+(e<r?6:0));case e:return 60*((r-t)/o+2);case r:return 60*((t-e)/o+4);default:return-1}}},jn={channel:Ln,lang:{clamp:(t,e,r)=>e>r?Math.min(e,Math.max(r,t)):Math.min(r,Math.max(e,t)),round:t=>Math.round(1e10*t)/1e10},unit:{dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}}},Fn={};for(let t=0;t<=255;t++)Fn[t]=jn.unit.dec2hex(t);class Nn{constructor(){this.type=0}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=0}is(t){return this.type===t}}const In=new class{constructor(t,e){this.color=e,this.changed=!1,this.data=t,this.type=new Nn}set(t,e){return this.color=e,this.changed=!1,this.data=t,this.type.type=0,this}_ensureHSL(){const t=this.data,{h:e,s:r,l:i}=t;void 0===e&&(t.h=jn.channel.rgb2hsl(t,"h")),void 0===r&&(t.s=jn.channel.rgb2hsl(t,"s")),void 0===i&&(t.l=jn.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:e,g:r,b:i}=t;void 0===e&&(t.r=jn.channel.hsl2rgb(t,"r")),void 0===r&&(t.g=jn.channel.hsl2rgb(t,"g")),void 0===i&&(t.b=jn.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,e=t.r;return this.type.is(2)||void 0===e?(this._ensureHSL(),jn.channel.hsl2rgb(t,"r")):e}get g(){const t=this.data,e=t.g;return this.type.is(2)||void 0===e?(this._ensureHSL(),jn.channel.hsl2rgb(t,"g")):e}get b(){const t=this.data,e=t.b;return this.type.is(2)||void 0===e?(this._ensureHSL(),jn.channel.hsl2rgb(t,"b")):e}get h(){const t=this.data,e=t.h;return this.type.is(1)||void 0===e?(this._ensureRGB(),jn.channel.rgb2hsl(t,"h")):e}get s(){const t=this.data,e=t.s;return this.type.is(1)||void 0===e?(this._ensureRGB(),jn.channel.rgb2hsl(t,"s")):e}get l(){const t=this.data,e=t.l;return this.type.is(1)||void 0===e?(this._ensureRGB(),jn.channel.rgb2hsl(t,"l")):e}get a(){return this.data.a}set r(t){this.type.set(1),this.changed=!0,this.data.r=t}set g(t){this.type.set(1),this.changed=!0,this.data.g=t}set b(t){this.type.set(1),this.changed=!0,this.data.b=t}set h(t){this.type.set(2),this.changed=!0,this.data.h=t}set s(t){this.type.set(2),this.changed=!0,this.data.s=t}set l(t){this.type.set(2),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}({r:0,g:0,b:0,a:0},"transparent"),On={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(35!==t.charCodeAt(0))return;const e=t.match(On.re);if(!e)return;const r=e[1],i=parseInt(r,16),n=r.length,s=n%4==0,a=n>4,o=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return In.set({r:(i>>l*(c+3)&h)*o,g:(i>>l*(c+2)&h)*o,b:(i>>l*(c+1)&h)*o,a:s?(i&h)*o/255:1},t)},stringify:t=>{const{r:e,g:r,b:i,a:n}=t;return n<1?`#${Fn[Math.round(e)]}${Fn[Math.round(r)]}${Fn[Math.round(i)]}${Fn[Math.round(255*n)]}`:`#${Fn[Math.round(e)]}${Fn[Math.round(r)]}${Fn[Math.round(i)]}`}},Dn={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(Dn.hueRe);if(e){const[,t,r]=e;switch(r){case"grad":return jn.channel.clamp.h(.9*parseFloat(t));case"rad":return jn.channel.clamp.h(180*parseFloat(t)/Math.PI);case"turn":return jn.channel.clamp.h(360*parseFloat(t))}}return jn.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(104!==e&&72!==e)return;const r=t.match(Dn.re);if(!r)return;const[,i,n,s,a,o]=r;return In.set({h:Dn._hue2deg(i),s:jn.channel.clamp.s(parseFloat(n)),l:jn.channel.clamp.l(parseFloat(s)),a:a?jn.channel.clamp.a(o?parseFloat(a)/100:parseFloat(a)):1},t)},stringify:t=>{const{h:e,s:r,l:i,a:n}=t;return n<1?`hsla(${jn.lang.round(e)}, ${jn.lang.round(r)}%, ${jn.lang.round(i)}%, ${n})`:`hsl(${jn.lang.round(e)}, ${jn.lang.round(r)}%, ${jn.lang.round(i)}%)`}},Rn={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",s
2almon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=Rn.colors[t];if(e)return On.parse(e)},stringify:t=>{const e=On.stringify(t);for(const r in Rn.colors)if(Rn.colors[r]===e)return r}},zn={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(114!==e&&82!==e)return;const r=t.match(zn.re);if(!r)return;const[,i,n,s,a,o,l,c,h]=r;return In.set({r:jn.channel.clamp.r(n?2.55*parseFloat(i):parseFloat(i)),g:jn.channel.clamp.g(a?2.55*parseFloat(s):parseFloat(s)),b:jn.channel.clamp.b(l?2.55*parseFloat(o):parseFloat(o)),a:c?jn.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},t)},stringify:t=>{const{r:e,g:r,b:i,a:n}=t;return n<1?`rgba(${jn.lang.round(e)}, ${jn.lang.round(r)}, ${jn.lang.round(i)}, ${jn.lang.round(n)})`:`rgb(${jn.lang.round(e)}, ${jn.lang.round(r)}, ${jn.lang.round(i)})`}},$n={format:{keyword:Rn,hex:On,rgb:zn,rgba:zn,hsl:Dn,hsla:Dn},parse:t=>{if("string"!=typeof t)return t;const e=On.parse(t)||zn.parse(t)||Dn.parse(t)||Rn.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(2)||void 0===t.data.r?Dn.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?zn.stringify(t):On.stringify(t)},Pn=(t,e)=>{const r=$n.parse(t);for(const i in e)r[i]=jn.channel.clamp[i](e[i]);return $n.stringify(r)},qn=(t,e,r=0,i=1)=>{if("number"!=typeof t)return Pn(t,{a:e});const n=In.set({r:jn.channel.clamp.r(t),g:jn.channel.clamp.g(e),b:jn.channel.clamp.b(r),a:jn.channel.clamp.a(i)});return $n.stringify(n)},Wn=t=>!(t=>(t=>{const{r:e,g:r,b:i}=$n.parse(t),n=.2126*jn.channel.toLinear(e)+.7152*jn.channel.toLinear(r)+.0722*jn.channel.toLinear(i);return jn.lang.round(n)})(t)>=.5)(t),Hn=(t,e,r)=>{const i=$n.parse(t),n=i[e],s=jn.channel.clamp[e](n+r);return n!==s&&(i[e]=s),$n.stringify(i)},Vn=(t,e)=>Hn(t,"l",e),Yn=(t,e)=>Hn(t,"l",-e),Un=(t,e)=>{const r=$n.parse(t),i={};for(const n in e)e[n]&&(i[n]=r[n]+e[n]);return Pn(t,i)},Gn=(t,e=100)=>{const r=$n.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,((t,e,r=50)=>{const{r:i,g:n,b:s,a}=$n.parse(t),{r:o,g:l,b:c,a:h}=$n.parse(e),d=r/100,u=2*d-1,p=a-h,g=((u*p===-1?u:(u+p)/(1+u*p))+1)/2,f=1-g;return qn(i*g+o*f,n*g+l*f,s*g+c*f,a*d+h*(1-d))})(r,t,e)};var Jn,Xn=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,Kn=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Zn=/\s*%%.*\n/gm,Qn=(e=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},_n(e,"UnknownDiagramError"),e),ts={},es=_n(function(t,e){t=t.replace(Xn,"").replace(Kn,"").replace(Zn,"\n");for(const[r,{detector:i}]of Object.entries(ts))if(i(t,e))return r;throw new Qn(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),rs=_n((...t)=>{for(const{id:e,detector:r,loader:i}of t)is(e,r,i)},"registerLazyLoadedDiagrams"),is=_n((t,e,r)=>{ts[t]&&Bn.warn(`Detector with key ${t} already exists. Overwriting.`),ts[t]={detector:e,loader:r},Bn.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),ns=_n(t=>ts[t].loader,"getDiagramLoader"),ss=_n((t,e,{depth:r=2,clobber:i=!1}={})=>{const n={depth:r,clobber:i};return Array.isArray(e)&&!Array.isArray(t)?(e.forEach(e=>ss(t,e,n)),t):Array.isArray(e)&&Array.isArray(t)?(e.forEach(e=>{t.includes(e)||t.push(e)}),t):void 0===t||r<=0?null!=t&&"object"==typeof t&&"object"==typeof e?Object.assign(t,e):e:(void 0!==e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).forEach(n=>{"object"!=typeof e[n]||null===e[n]||void 0!==t[n]&&"object"!=typeof t[n]?(i||"object"!=typeof t[n]&&"object"!=typeof e[n])&&(t[n]=e[n]):(void 0===t[n]&&(t[n]=Array.isArray(e[n])?[]:{}),t[n]=ss(t[n],e[n],{depth:r-1,clobber:i}))}),t)},"assignWithDepth"),as=ss,os="#ffffff",ls="#f2f2f2",cs=_n((t,e)=>Un(t,e?{s:-40,l:10}:{s:-40,l:-10}),"mkBorder"),hs=(_n(r=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||Un(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Un(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||cs(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||cs(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||cs(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||cs(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Gn(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Gn(this.tertiaryColor),this.lineColor=this.lineColor||Gn(this.background),this.arrowheadColor=this.arrowheadColor||Gn(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.edgeLabelBackgroun
vendor: 9,142 bytes, line 2
2d=this.edgeLabelBackground||(this.darkMode?Yn(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||Yn(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Gn(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||Vn(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||Yn(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Yn(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Vn(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Vn(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||Un(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Un(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Un(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Un(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Un(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Un(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Un(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Un(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Un(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=Yn(this["cScale"+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScale"+e]=Yn(this["cScale"+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleInv"+e]=this["cScaleInv"+e]||Gn(this["cScale"+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this["cScalePeer"+e]=this["cScalePeer"+e]||Vn(this["cScale"+e],10):this["cScalePeer"+e]=this["cScalePeer"+e]||Yn(this["cScale"+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this["cScaleLabel"+e]=this["cScaleLabel"+e]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let e=0;e<5;e++)this["surface"+e]=this["surface"+e]||Un(this.mainBkg,{h:180,s:-15,l:t*(5+3*e)}),this["surfacePeer"+e]=this["surfacePeer"+e]||Un(this.mainBkg,{h:180,s:-15,l:t*(8+3*e)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||Un(this.primaryColor,{h:64}),this.fillType3=this.fillType3||Un(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||Un(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||Un(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||Un(this.primaryColor,{h:128}),this.fillType7=this.fillType7||Un(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||Un(this.primaryColor,{l:-10}),this.pie5=this.pie5||Un(this.secondaryColor,{l:-10}),this.pie6=this.pie6||Un(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||Un(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||Un(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||Un(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||Un(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||Un(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||Un(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??Un(this.primaryColor,{l:-30}),this.venn2=this.venn2??Un(this.secondaryColor,{l:-30}),this.venn3=this.venn3??Un(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??Un(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??Un(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??Un(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??Un(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??Un(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||Un(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||Un(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||Un(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||Un(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||Un(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||Un(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Wn(this.quadrant1Fill)?Vn(this.quadrant1Fill):Yn(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExter
2nalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Yn(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||Un(this.primaryColor,{h:-30}),this.git4=this.git4||Un(this.primaryColor,{h:-60}),this.git5=this.git5||Un(this.primaryColor,{h:-90}),this.git6=this.git6||Un(this.primaryColor,{h:60}),this.git7=this.git7||Un(this.primaryColor,{h:120}),this.darkMode?(this.git0=Vn(this.git0,25),this.git1=Vn(this.git1,25),this.git2=Vn(this.git2,25),this.git3=Vn(this.git3,25),this.git4=Vn(this.git4,25),this.git5=Vn(this.git5,25),this.git6=Vn(this.git6,25),this.git7=Vn(this.git7,25)):(this.git0=Yn(this.git0,25),this.git1=Yn(this.git1,25),this.git2=Yn(this.git2,25),this.git3=Yn(this.git3,25),this.git4=Yn(this.git4,25),this.git5=Yn(this.git5,25),this.git6=Yn(this.git6,25),this.git7=Yn(this.git7,25)),this.gitInv0=this.gitInv0||Gn(this.git0),this.gitInv1=this.gitInv1||Gn(this.git1),this.gitInv2=this.gitInv2||Gn(this.git2),this.gitInv3=this.gitInv3||Gn(this.git3),this.gitInv4=this.gitInv4||Gn(this.git4),this.gitInv5=this.gitInv5||Gn(this.git5),this.gitInv6=this.gitInv6||Gn(this.git6),this.gitInv7=this.gitInv7||Gn(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||os,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||ls}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach(e=>{this[e]=t[e]}),this.updateColors(),e.forEach(e=>{this[e]=t[e]})}},"Theme"),r),ds=_n(t=>{const e=new hs;return e.calculate(t),e},"getThemeVariables"),us=(_n(i=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Vn(this.primaryColor,16),this.tertiaryColor=Un(this.primaryColor,{h:-160}),this.primaryBorderColor=Gn(this.background),this.secondaryBorderColor=cs(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=cs(this.tertiaryColor,this.darkMode),this.primaryTextColor=Gn(this.primaryColor),this.secondaryTextColor=Gn(this.secondaryColor),this.tertiaryTextColor=Gn(this.tertiaryColor),this.lineColor=Gn(this.background),this.textColor=Gn(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Vn(Gn("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=qn(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackgroun
vendor: 12,205 bytes, line 2
2d="#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=Yn("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Yn(this.sectionBkgColor,10),this.taskBorderColor=qn(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=qn(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||Vn(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Yn(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){this.secondBkg=Vn(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=Vn(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=Vn(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=Gn(this.doneTaskBkgColor),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=Un(this.primaryColor,{h:64}),this.fillType3=Un(this.secondaryColor,{h:64}),this.fillType4=Un(this.primaryColor,{h:-64}),this.fillType5=Un(this.secondaryColor,{h:-64}),this.fillType6=Un(this.primaryColor,{h:128}),this.fillType7=Un(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||Un(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Un(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Un(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Un(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Un(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Un(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Un(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Un(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Un(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||Gn(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||Vn(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||Un(this.mainBkg,{h:30,s:-30,l:-(4*t-10)}),this["surfacePeer"+t]=this["surfacePeer"+t]||Un(this.mainBkg,{h:30,s:-30,l:-(4*t-7)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??Vn(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||Un(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||Un(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||Un(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||Un(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||Un(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||Un(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Wn(this.quadrant1Fill)?Vn(this.quadrant1Fill):Yn(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Yn(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Vn(this.secondaryColor,20),this.git1=Vn(this.pie2||this.secondaryColor,20),this.git2=Vn(this.pie3||this.tertiaryColor,20),this.git3=Vn(this.pie4||Un(this.primaryColor,{h:-30}),20),this.git4=Vn(this.pie5||Un(this.primaryColor,{h:-60}),20),this.git5=Vn(this.pie6||Un(this.primaryColor,{h:-90}),10),this.git6=Vn(this.pie7||Un(this.primaryColor,{h:60}),10),this.git7=Vn(this.pie8||Un(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||Gn(this.git0),this.gitInv1=this.gitInv1||Gn(this.git1),this.gitInv2=this.gitInv2||Gn(this.git2),this.gitInv3=this.gitInv3||Gn(this.git3),this.gitInv4=this.gitInv4||Gn(this.git4),this.gitInv5=this.gitInv5||Gn(this.git5),this.gitInv6=this.gitInv6||Gn(this.git6),this.gitInv7=this.gitInv7||Gn(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Gn(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Gn(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Vn(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroun
2dColorEven||Vn(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach(e=>{this[e]=t[e]}),this.updateColors(),e.forEach(e=>{this[e]=t[e]})}},"Theme"),i),ps=_n(t=>{const e=new us;return e.calculate(t),e},"getThemeVariables"),gs=(_n(n=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Un(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Un(this.primaryColor,{h:-160}),this.primaryBorderColor=cs(this.primaryColor,this.darkMode),this.secondaryBorderColor=cs(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=cs(this.tertiaryColor,this.darkMode),this.primaryTextColor=Gn(this.primaryColor),this.secondaryTextColor=Gn(this.secondaryColor),this.tertiaryTextColor=Gn(this.tertiaryColor),this.lineColor=Gn(this.background),this.textColor=Gn(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=qn(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||Un(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Un(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Un(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Un(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Un(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Un(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Un(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Un(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Un(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Yn(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Yn(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Yn(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Yn(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||Un(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||Un(this.mainBkg,{h:30,l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||Un(this.mainBkg,{h:30,l:-(7+5*t)});if(this.scaleLabelColor="calculated"!==this.scaleLabelColor&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,"calculated"!==this.labelTextColor){this.cScaleLabel0=this.cScaleLabel0||Gn(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||Gn(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackgroun
vendor: 8,983 bytes, line 2
2d=this.labelBackground,this.actorBorder=Vn(this.border1,23),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Vn(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||Vn(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=Un(this.primaryColor,{h:64}),this.fillType3=Un(this.secondaryColor,{h:64}),this.fillType4=Un(this.primaryColor,{h:-64}),this.fillType5=Un(this.secondaryColor,{h:-64}),this.fillType6=Un(this.primaryColor,{h:128}),this.fillType7=Un(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||Un(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||Un(this.primaryColor,{l:-10}),this.pie5=this.pie5||Un(this.secondaryColor,{l:-30}),this.pie6=this.pie6||Un(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||Un(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||Un(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||Un(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||Un(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||Un(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||Un(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??Un(this.primaryColor,{l:-30}),this.venn2=this.venn2??Un(this.secondaryColor,{l:-30}),this.venn3=this.venn3??Un(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??Un(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??Un(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??Un(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??Un(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??Un(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||Un(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||Un(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||Un(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||Un(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||Un(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||Un(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Wn(this.quadrant1Fill)?Vn(this.quadrant1Fill):Yn(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||Un(this.primaryColor,{h:-30}),this.git4=this.git4||Un(this.primaryColor,{h:-60}),this.git5=this.git5||Un(this.primaryColor,{h:-90}),this.git6=this.git6||Un(this.primaryColor,{h:60}),this.git7=this.git7||Un(this.primaryColor,{h:120}),this.darkMode?(this.git0=Vn(this.git0,25),this.git1=Vn(this.git1,25),this.git2=Vn(this.git2,25),this.git3=Vn(this.git3,25),this.git4=Vn(this.git4,25),this.git5=Vn(this.git5,25),this.git6=Vn(this.git6,25),this.git7=Vn(this.git7,25)):(this.git0=Yn(this.git0,25),this.git1=Yn(this.git1,25),this.git2=Yn(this.git2,25),this.git3=Yn(this.git3,25),this.git4=Yn(this.git4,25),this.git5=Yn(this.git5,25),this.git6=Yn(this.git6,25),this.git7=Yn(this.git7,25)),this.gitInv0=this.gitInv0||Yn(Gn(this.git0),25),this.gitInv1=this.gitInv1||Gn(this.git1),this.gitInv2=this.gitInv2||Gn(this.git2),this.gitInv3=this.gitInv3||Gn(this.git3),this.gitInv4=this.gitInv4||Gn(this.git4),this.gitInv5=this.gitInv5||Gn(this.git5),this.gitInv6=this.gitInv6||Gn(this.git6),this.gitInv7=this.gitInv7||Gn(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Gn(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Gn(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroun
2dColorOdd||os,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||ls}calculate(t){if(Object.keys(this).forEach(t=>{"calculated"===this[t]&&(this[t]=void 0)}),"object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach(e=>{this[e]=t[e]}),this.updateColors(),e.forEach(e=>{this[e]=t[e]})}},"Theme"),n),fs=_n(t=>{const e=new gs;return e.calculate(t),e},"getThemeVariables"),ms=(_n(s=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=Vn("#cde498",10),this.primaryBorderColor=cs(this.primaryColor,this.darkMode),this.secondaryBorderColor=cs(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=cs(this.tertiaryColor,this.darkMode),this.primaryTextColor=Gn(this.primaryColor),this.secondaryTextColor=Gn(this.secondaryColor),this.tertiaryTextColor=Gn(this.primaryColor),this.lineColor=Gn(this.background),this.textColor=Gn(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=Yn(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||Un(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Un(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Un(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Un(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Un(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Un(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Un(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Un(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Un(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Yn(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Yn(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Yn(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Yn(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||Un(this["cScale"+t],{h:180});this.scaleLabelColor="calculated"!==this.scaleLabelColor&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||Un(this.mainBkg,{h:30,s:-30,l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||Un(this.mainBkg,{h:30,s:-30,l:-(8+5*t)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Vn(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Vn(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroun
vendor: 8,408 bytes, line 2
2dColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=Un(this.primaryColor,{h:64}),this.fillType3=Un(this.secondaryColor,{h:64}),this.fillType4=Un(this.primaryColor,{h:-64}),this.fillType5=Un(this.secondaryColor,{h:-64}),this.fillType6=Un(this.primaryColor,{h:128}),this.fillType7=Un(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||Un(this.primaryColor,{l:-30}),this.pie5=this.pie5||Un(this.secondaryColor,{l:-30}),this.pie6=this.pie6||Un(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||Un(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||Un(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||Un(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||Un(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||Un(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||Un(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??Un(this.primaryColor,{l:-30}),this.venn2=this.venn2??Un(this.secondaryColor,{l:-30}),this.venn3=this.venn3??Un(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??Un(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??Un(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??Un(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??Un(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??Un(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||Un(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||Un(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||Un(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||Un(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||Un(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||Un(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Wn(this.quadrant1Fill)?Vn(this.quadrant1Fill):Yn(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||Un(this.primaryColor,{h:-30}),this.git4=this.git4||Un(this.primaryColor,{h:-60}),this.git5=this.git5||Un(this.primaryColor,{h:-90}),this.git6=this.git6||Un(this.primaryColor,{h:60}),this.git7=this.git7||Un(this.primaryColor,{h:120}),this.darkMode?(this.git0=Vn(this.git0,25),this.git1=Vn(this.git1,25),this.git2=Vn(this.git2,25),this.git3=Vn(this.git3,25),this.git4=Vn(this.git4,25),this.git5=Vn(this.git5,25),this.git6=Vn(this.git6,25),this.git7=Vn(this.git7,25)):(this.git0=Yn(this.git0,25),this.git1=Yn(this.git1,25),this.git2=Yn(this.git2,25),this.git3=Yn(this.git3,25),this.git4=Yn(this.git4,25),this.git5=Yn(this.git5,25),this.git6=Yn(this.git6,25),this.git7=Yn(this.git7,25)),this.gitInv0=this.gitInv0||Gn(this.git0),this.gitInv1=this.gitInv1||Gn(this.git1),this.gitInv2=this.gitInv2||Gn(this.git2),this.gitInv3=this.gitInv3||Gn(this.git3),this.gitInv4=this.gitInv4||Gn(this.git4),this.gitInv5=this.gitInv5||Gn(this.git5),this.gitInv6=this.gitInv6||Gn(this.git6),this.gitInv7=this.gitInv7||Gn(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Gn(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Gn(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||os,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||ls}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);
2e.forEach(e=>{this[e]=t[e]}),this.updateColors(),e.forEach(e=>{this[e]=t[e]})}},"Theme"),s),ys=_n(t=>{const e=new ms;return e.calculate(t),e},"getThemeVariables"),xs=(_n(a=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Vn(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Un(this.primaryColor,{h:-160}),this.primaryBorderColor=cs(this.primaryColor,this.darkMode),this.secondaryBorderColor=cs(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=cs(this.tertiaryColor,this.darkMode),this.primaryTextColor=Gn(this.primaryColor),this.secondaryTextColor=Gn(this.secondaryColor),this.tertiaryTextColor=Gn(this.tertiaryColor),this.lineColor=Gn(this.background),this.textColor=Gn(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||Vn(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){this.secondBkg=Vn(this.contrast,55),this.border2=this.contrast,this.actorBorder=Vn(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||Gn(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||Vn(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||Yn(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||Un(this.mainBkg,{l:-(5+5*t)}),this["surfacePeer"+t]=this["surfacePeer"+t]||Un(this.mainBkg,{l:-(8+5*t)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=Vn(this.contrast,30),this.sectionBkgColor2=Vn(this.contrast,30),this.taskBorderColor=Yn(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=Vn(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Yn(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroun
vendor: 4,354 bytes, line 2
2dColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=Un(this.primaryColor,{h:64}),this.fillType3=Un(this.secondaryColor,{h:64}),this.fillType4=Un(this.primaryColor,{h:-64}),this.fillType5=Un(this.secondaryColor,{h:-64}),this.fillType6=Un(this.primaryColor,{h:128}),this.fillType7=Un(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||Un(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||Un(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||Un(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||Un(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||Un(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||Un(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Wn(this.quadrant1Fill)?Vn(this.quadrant1Fill):Yn(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12}
2,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Yn(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||Un(this.primaryColor,{h:-30}),this.git4=this.pie5||Un(this.primaryColor,{h:-60}),this.git5=this.pie6||Un(this.primaryColor,{h:-90}),this.git6=this.pie7||Un(this.primaryColor,{h:60}),this.git7=this.pie8||Un(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||Gn(this.git0),this.gitInv1=this.gitInv1||Gn(this.git1),this.gitInv2=this.gitInv2||Gn(this.git2),this.gitInv3=this.gitInv3||Gn(this.git3),this.gitInv4=this.gitInv4||Gn(this.git4),this.gitInv5=this.gitInv5||Gn(this.git5),this.gitInv6=this.gitInv6||Gn(this.git6),this.gitInv7=this.gitInv7||Gn(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||os,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||ls}calculate(t){if("object"!=typeof t)return void this.updateColors();const e=Object.keys(t);e.forEach(e=>{this[e]=t[e]}),this.updateColors(),e.forEach(e=>{this[e]=t[e]})}},"Theme"),a),bs={base:{getThemeVariables:ds},dark:{getThemeVariables:ps},default:{getThemeVariables:fs},forest:{getThemeVariables:ys},neutral:{getThemeVariables:_n(t=>{const e=new xs;return e.calculate(t),e},"getThemeVariables")}},Cs
vendor: 9,756 bytes, line 2
2={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,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"},ishikawa:{useMaxWidth:!0,diagramPadding:20},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},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},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},
vendor: 4,910 bytes, line 2
2ws={...Cs,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:bs.default.getThemeVariables(),sequence:{...Cs.sequence,messageFont:_n(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:_n(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:_n(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...Cs.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Cs.c4,useWidth:void 0,personFont:_n(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Cs.flowchart,inheritDir:!1},external_personFont:_n(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:_n(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:_n(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:_n(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:_n(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:_n(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:_n(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:_n(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:_n(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:_n(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:_n(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:_n(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:_n(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:_n(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:_n(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:_n(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:_n(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:_n(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:_n(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:_n(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:_n(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Cs.pie,useWidth:984}
2,xyChart:{...Cs.xyChart,useWidth:void 0},requirement:{...Cs.requirement,useWidth:void 0},packet:{...Cs.packet},radar:{...Cs.radar},ishikawa:{...Cs.ishikawa},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Cs.venn}},ks=_n((t,e="")=>Object.keys(t).reduce((r,i)=>Array.isArray(t[i])?r:"object"==typeof t[i]&&null!==t[i]?[...r,e+i,...ks(t[i],"")]:[...r,e+i],[]),"keyify"),vs=new Set(ks(ws,"")),Ss=ws,_s=_n(t=>{if(Bn.debug("sanitizeDirective called with",t),"object"==typeof t&&null!=t)if(Array.isArray(t))t.forEach(t=>_s(t));else{for(const e of Object.keys(t)){if(Bn.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!vs.has(e)||null==t[e]){Bn.debug("sanitize deleting key: ",e),delete t[e];continue}if("object"==typeof t[e]){Bn.debug("sanitizing object",e),_s(t[e]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)e.includes(i)&&(Bn.debug("sanitizing css option",e),t[e]=Ts(t[e]))}if(t.themeVariables)for(const e of Object.keys(t.themeVariables)){const r=t.themeVariables[e];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(t.themeVariables[e]="")}Bn.debug("After sanitization",t)}},"sanitizeDirective"),Ts=_n(t=>{let e=0,r=0;for(const i of t){if(e<r)return"{ /* ERROR: Unbalanced CSS */ }";"{"===i?e++:"}"===i&&r++}return e!==r?"{ /* ERROR: Unbalanced CSS */ }":t},"sanitizeCss"),As=Object.freeze(Ss),Bs=_n(t=>!1!==t&&!["false","null","0"].includes(String(t).trim().toLowerCase()),"evaluate"),Ms=as({},As),Es=[],Ls=as({},As),js=_n((t,e)=>{let r=as({},t),i={};for(const n of e)zs(n),i=as(i,n);if(r=as(r,i),i.theme&&i.theme in bs){const t=as({},Jn),e=as(t.themeVariables||{},i.themeVariables);r.theme&&r.theme in bs&&(r.themeVariables=bs[r.theme].getThemeVariables(e))}return Vs(Ls=r),Ls},"updateCurrentConfig"),Fs=_n(t=>(Ms=as({},As),Ms=as(Ms,t),t.theme&&bs[t.theme]&&(Ms.themeVariables=bs[t.theme].getThemeVariables(t.themeVariables)),js(Ms,Es),Ms),"setSiteConfig"),Ns=_n(t=>{Jn=as({},t)},"saveConfigFromInitialize"),Is=_n(t=>(Ms=as(Ms,t),js(Ms,Es),Ms),"updateSiteConfig"),Os=_n(()=>as({},Ms),"getSiteConfig"),Ds=_n(t=>(Vs(t),as(Ls,t),Rs()),"setConfig"),Rs=_n(()=>as({},Ls),"getConfig"),zs=_n(t=>{t&&(["secure",...Ms.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(Bn.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=>{"string"==typeof t[e]&&(t[e].includes("<")||t[e].includes(">")||t[e].includes("url(data:"))&&delete t[e],"object"==typeof t[e]&&zs(t[e])}))},"sanitize"),$s=_n(t=>{_s(t),t.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),Es.push(t),js(Ms,Es)},"addDirective"),Ps=_n((t=Ms)=>{js(t,Es=[])},"reset"),qs={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},Ws={},Hs=_n(t=>{Ws[t]||(Bn.warn(qs[t]),Ws[t]=!0)},"issueWarning"),Vs=_n(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&Hs("LAZY_LOAD_DEPRECATED")},"checkConfig"),Ys=_n(()=>{let t={};Jn&&(t=as(t,Jn));for(const e of Es)t=as(t,e);return t},"getUserDefinedConfig"),Us=_n(t=>(null!=t.flowchart?.htmlLabels&&Hs("FLOWCHART_HTML_LABELS_DEPRECATED"),Bs(t.htmlLabels??t.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),Gs=/<br\s*\/?>/gi,Js=_n(t=>
2t?sa(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Xs=(()=>{let t=!1;return()=>{t||(Ks(),t=!0)}})();function Ks(){const t="data-temp-href-target";It.addHook("beforeSanitizeAttributes",e=>{"A"===e.tagName&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),It.addHook("afterSanitizeAttributes",e=>{"A"===e.tagName&&e.hasAttribute(t)&&(e.setAttribute("target",e.getAttribute(t)??""),e.removeAttribute(t),"_blank"===e.getAttribute("target")&&e.setAttribute("rel","noopener"))})}_n(Ks,"setupDompurifyHooks");var Zs=_n(t=>(Xs(),It.sanitize(t)),"removeScript"),Qs=_n((t,e)=>{if(Us(e)){const r=e.securityLevel;"antiscript"===r||"strict"===r||"sandbox"===r?t=Zs(t):"loose"!==r&&(t=(t=(t=sa(t)).replace(/</g,"&lt;").replace(/>/g,"&gt;")).replace(/=/g,"&equals;"),t=na(t))}return t},"sanitizeMore"),ta=_n((t,e)=>t?t=e.dompurifyConfig?It.sanitize(Qs(t,e),e.dompurifyConfig).toString():It.sanitize(Qs(t,e),{FORBID_TAGS:["style"]}).toString():t,"sanitizeText"),ea=_n((t,e)=>"string"==typeof t?ta(t,e):t.flat().map(t=>ta(t,e)),"sanitizeTextOrArray"),ra=_n(t=>Gs.test(t),"hasBreaks"),ia=_n(t=>t.split(Gs),"splitBreaks"),na=_n(t=>t.replace(/#br#/g,"<br/>"),"placeholderToBreak"),sa=_n(t=>t.replace(Gs,"#br#"),"breakToPlaceholder"),aa=_n(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),oa=_n(function(...t){const e=t.filter(t=>!isNaN(t));return Math.max(...e)},"getMax"),la=_n(function(...t){const e=t.filter(t=>!isNaN(t));return Math.min(...e)},"getMin"),ca=_n(function(t){const e=t.split(/(,)/),r=[];for(let i=0;i<e.length;i++){let t=e[i];if(","===t&&i>0&&i+1<e.length){const n=e[i-1],s=e[i+1];da(n,s)&&(t=n+","+s,i++,r.pop())}r.push(ua(t))}return r.join("")},"parseGenericTypes"),ha=_n((t,e)=>Math.max(0,t.split(e).length-1),"countOccurrence"),da=_n((t,e)=>{const r=ha(t,"~"),i=ha(e,"~");return 1===r&&1===i},"shouldCombineSets"),ua=_n(t=>{const e=ha(t,"~");let r=!1;if(e<=1)return t;e%2!=0&&t.startsWith("~")&&(t=t.substring(1),r=!0);const i=[...t];let n=i.indexOf("~"),s=i.lastIndexOf("~");for(;-1!==n&&-1!==s&&n!==s;)i[n]="<",i[s]=">",n=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),pa=_n(()=>void 0!==window.MathMLElement,"isMathMLSupported"),ga=/\$\$(.*)\$\$/g,fa=_n(t=>(t.match(ga)?.length??0)>0,"hasKatex"),ma=_n(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await xa(t,e),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const i=document.querySelector("body");i?.insertAdjacentElement("beforeend",r);const n={width:r.clientWidth,height:r.clientHeight};return r.remove(),n},"calculateMathMLDimensions"),ya=_n(async(t,e)=>{if(!fa(t))return t;if(!(pa()||e.legacyMathML||e.forceLegacyMathML))return t.replace(ga,"MathML is unsupported in this environment.");{const{default:r}=await Z(async()=>{const{default:t}=await import("./vendor-katex-BuQuj6Fv.js");return{default:t}},__vite__mapDeps([0,1])),i=e.forceLegacyMathML||!pa()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(Gs).map(t=>fa(t)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${t}</div>`:`<div>${t}</div>`).join("").replace(ga,(t,e)=>r.renderToString(e,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),xa=_n(async(t,e)=>ta(await ya(t,e),e),"renderKatexSanitized"),ba={getRows:Js,sanitizeText:ta,sanitizeTextOrArray:ea,hasBreaks:ra,splitBreaks:ia,lineBreakRegex:Gs,removeScript:Zs,getUrl:aa,evaluate:Bs,getMax:oa,getMin:la},Ca=_n(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),wa=_n(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"),ka=_n(function(t,e,r,i){const n=wa(e,r,i);Ca(t,n)},"configureSvgSize"),va=_n(function(t,e,r,i){const n=e.node().getBBox(),s=n.width,a=n.height;Bn.info(`SVG bounds: ${s}x${a}`,n);let o=0,l=0;Bn.info(`Graph bounds: ${o}x${l}`,t),o=s+2*r,l=a+2*r,Bn.info(`Calculated bounds: ${o}x${l}`),ka(e,l,o,i);const c=`${n.x-r} ${n.y-r} ${n.width+2*r} ${n.height+2*r}`;e.attr("viewBox",c)},"setupGraphViewbox"),Sa={},_a=_n((t,e,r)=>{let i="";return t in Sa&&Sa[t]?i=Sa[t](r):Bn.warn(`No theme found for ${t}`),` & {\n    font-family: ${r.fontFamily};\n    font-size: ${r.fontSize};\n    fill: ${r.textColor}\n  }\n  @keyframes edge-animation-frame {\n    from {\n      stroke-dashoffset: 0;\n    }\n  }\n  @keyframes dash {\n    to {\n      stroke-dashoffset: 0;\n    }\n  }\n  & .edge-animation-slow {\n    stroke-dasharray: 9,5 !important;\n    stroke-dashoffset: 900;\n    animation: dash 50s linear infinite;\n    stroke-linecap: round;\n  }\n  & .edge-animation-fast {\n    stroke-dasharray: 9,5 !important;\n    stroke-dashoffset: 900;\n    animation: dash 20s linear infinite;\n    stroke-linecap: round;\n  }\n  /* Classes common for multiple diagrams */\n\n  & .error-icon {\n    fill: ${r.errorBkgColor};\n  }\n  & .error-text {\n    fill: ${r.errorTextColor};\n    stroke: ${r.errorTextColor};\n  }\n\n  & .edge-thickness-normal {\n    stroke-width: 1px;\n  }\n  & .edge-thickness-thick {\n    stroke-width: 3.5px\n  }\n  & .edge-pattern-solid {\n    stroke-dasharray: 0;\n  }\n  & .edge-thickness-invisible {\n    stroke-width: 0;\n    fill: none;\n  }\n  & .edge-pattern-dashed{\n    stroke-dasharray: 3;\n  }\n  .edge-pattern-dotted {\n    stroke-dasharray: 2;\n  }\n\n  & .marker {\n    fill: ${r.lineColor};\n    stroke: ${r.lineColor};\n  }\n  & .marker.cross {\n    stroke: ${r.lineColor};\n  }\n\n  & svg {\n    font-family: ${r.fontFamily};\n    font-size: ${r.fontSize};\n  }\n   & p {\n    margin: 0\n   }\n\n  ${i}\n\n  ${e}\n`},"getStyles"),Ta=_n((t,e)=>{void 0!==e&&(Sa[t]=e)},"addStylesForDiagram"),Aa=_a,Ba={};
2Tn(Ba,{clear:()=>Fa,getAccDescription:()=>Da,getAccTitle:()=>Ia,getDiagramTitle:()=>za,setAccDescription:()=>Oa,setAccTitle:()=>Na,setDiagramTitle:()=>Ra});var Ma="",Ea="",La="",ja=_n(t=>ta(t,Rs()),"sanitizeText"),Fa=_n(()=>{Ma="",La="",Ea=""},"clear"),Na=_n(t=>{Ma=ja(t).replace(/^\s+/g,"")},"setAccTitle"),Ia=_n(()=>Ma,"getAccTitle"),Oa=_n(t=>{La=ja(t).replace(/\n\s+/g,"\n")},"setAccDescription"),Da=_n(()=>La,"getAccDescription"),Ra=_n(t=>{Ea=ja(t)},"setDiagramTitle"),za=_n(()=>Ea,"getDiagramTitle"),$a=Bn,Pa=Mn,qa=Rs,Wa=Ds,Ha=As,Va=_n(t=>ta(t,qa()),"sanitizeText"),Ya=va,Ua=_n(()=>Ba,"getCommonDb"),Ga={},Ja=_n((t,e,r)=>{Ga[t]&&$a.warn(`Diagram with id ${t} already registered. Overwriting.`),Ga[t]=e,r&&is(t,r),Ta(t,e.styles),e.injectUtils?.($a,Pa,qa,Va,Ya,Ua(),()=>{})},"registerDiagram"),Xa=_n(t=>{if(t in Ga)return Ga[t];throw new Ka(t)},"getDiagram"),Ka=(o=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},_n(o,"DiagramNotFoundError"),o),Za={value:()=>{}};function Qa(){for(var t,e=0,r=arguments.length,i={};e<r;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new to(i)}function to(t){this._=t}function eo(t,e){for(var r,i=0,n=t.length;i<n;++i)if((r=t[i]).name===e)return r.value}function ro(t,e,r){for(var i=0,n=t.length;i<n;++i)if(t[i].name===e){t[i]=Za,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}to.prototype=Qa.prototype={constructor:to,on:function(t,e){var r,i,n=this._,s=(i=n,(t+"").trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),a=-1,o=s.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<o;)if(r=(t=s[a]).type)n[r]=ro(n[r],t.name,e);else if(null==e)for(r in n)n[r]=ro(n[r],t.name,null);return this}for(;++a<o;)if((r=(t=s[a]).type)&&(r=eo(n[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new to(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,i,n=new Array(r),s=0;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=0,r=(i=this._[t]).length;s<r;++s)i[s].value.apply(e,n)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],n=0,s=i.length;n<s;++n)i[n].value.apply(e,r)}};var io="http://www.w3.org/1999/xhtml";const no={svg:"http://www.w3.org/2000/svg",xhtml:io,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function so(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),no.hasOwnProperty(e)?{space:no[e],local:t}:t}function ao(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===io&&e.documentElement.namespaceURI===io?e.createElement(t):e.createElementNS(r,t)}}function oo(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function lo(t){var e=so(t);return(e.local?oo:ao)(e)}function co(){}function ho(t){return null==t?co:function(){return this.querySelector(t)}}function uo(){return[]}function po(t){return null==t?uo:function(){return this.querySelectorAll(t)}}function go(t){return function(){return this.matches(t)}}function fo(t){return function(e){return e.matches(t)}}var mo=Array.prototype.find;function yo(){return this.firstElementChild}var xo=Array.prototype.filter;function bo(){return Array.from(this.children)}function Co(t){return new Array(t.length)}function wo(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function ko(t,e,r,i,n,s){for(var a,o=0,l=e.length,c=s.length;o<c;++o)(a=e[o])?(a.__data__=s[o],i[o]=a):r[o]=new wo(t,s[o]);for(;o<l;++o)(a=e[o])&&(n[o]=a)}function vo(t,e,r,i,n,s,a){var o,l,c,h=new Map,d=e.length,u=s.length,p=new Array(d);for(o=0;o<d;++o)(l=e[o])&&(p[o]=c=a.call(l,l.__data__,o,e)+"",h.has(c)?n[o]=l:h.set(c,l));for(o=0;o<u;++o)c=a.call(t,s[o],o,s)+"",(l=h.get(c))?(i[o]=l,l.__data__=s[o],h.delete(c)):r[o]=new wo(t,s[o]);for(o=0;o<d;++o)(l=e[o])&&h.get(p[o])===l&&(n[o]=l)}function So(t){return t.__data__}function _o(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function To(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ao(t){return function(){this.removeAttribute(t)}}function Bo(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Mo(t,e){return function(){this.setAttribute(t,e)}}function Eo(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Lo(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function jo(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function Fo(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function No(t){return function(){this.style.removeProperty(t)}}function Io(t,e,r){return function(){this.style.setProperty(t,e,r)}}function Oo(t,e,r){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,r)}}function Do(t,e){return t.style.getPropertyValue(e)||Fo(t).getComputedStyle(t,null).getPropertyValue(e)}function Ro(t){return function(){delete this[t]}}function zo(t,e){return function(){this[t]=e}}function $o(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function Po(t){return t.trim().split(/^|\s+/)}function qo(t){return t.classList||new Wo(t)}function Wo(t){this._node=t,this._names=Po(t.getAttribute("class")||"")}function Ho(t,e){for(var r=qo(t),i=-1,n=e.length;++i<n;)r.add(e[i])}function Vo(t,e){for(var r=qo(t),i=-1,n=e.length;++i<n;)r.remove(e[i])}function Yo(t){return function(){Ho(this,t)}}function Uo(t){return function(){Vo(this,t)}}function Go(t,e){return function(){(e.apply(this,arguments)?Ho:Vo)(this,t)}}function Jo(){this.textContent=""}function Xo(t){return function(){this.textContent=t}}function Ko(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Zo(){this.innerHTML=""}function Qo(t){return function(){this.innerHTML=t}}function tl(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function el(){this.nextSibling&&this.parentNode.appendChild(this)}function rl(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function il(){return null}function nl(){var t=this.parentNode;t&&t.removeChild(this)}function sl(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function al(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ol(t){return function(){var e=this.__on;if(e){for(var r,i=0,n=-1,s=e.length;i<s;++i)r=e[i],t.type&&r.type!==t.type||r.name!==t.name?e[++n]=r:this.removeEventListener(r.type,r.listener,r.options);++n?e.length=n:delete this.__on}}}function ll(t,e,r){return function(){var i,n=this.__on,s=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(n)for(var a=0,o=n.length;a<o;++a)if((i=n[a]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=r),void(i.value=e);this.addEventListener(t.type,s,r),i={type:t.type,name:t.name,value:e,listener:s,options:r},n?n.push(i):this.__on=[i]}}function cl(t,e,r){var i=Fo(t),n=i.CustomEvent;"function"==typeof n?n=new n(e,r):(n=i.document.createEvent("Event"),r?(n.initEvent(e,r.bubbles,r.cancelable),n.detail=r.detail):n.initEvent(e,!1,!1)),t.dis
vendor: 11,188 bytes, line 2
2patchEvent(n)}function hl(t,e){return function(){return cl(this,t,e)}}function dl(t,e){return function(){return cl(this,t,e.apply(this,arguments))}}wo.prototype={constructor:wo,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},Wo.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ul=[null];function pl(t,e){this._groups=t,this._parents=e}function gl(){return new pl([[document.documentElement]],ul)}function fl(t){return"string"==typeof t?new pl([[document.querySelector(t)]],[document.documentElement]):new pl([[t]],ul)}function ml(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function yl(t,e){var r=Object.create(t.prototype);for(var i in e)r[i]=e[i];return r}function xl(){}pl.prototype=gl.prototype={constructor:pl,select:function(t){"function"!=typeof t&&(t=ho(t));for(var e=this._groups,r=e.length,i=new Array(r),n=0;n<r;++n)for(var s,a,o=e[n],l=o.length,c=i[n]=new Array(l),h=0;h<l;++h)(s=o[h])&&(a=t.call(s,s.__data__,h,o))&&("__data__"in s&&(a.__data__=s.__data__),c[h]=a);return new pl(i,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}(t):po(t);for(var e=this._groups,r=e.length,i=[],n=[],s=0;s<r;++s)for(var a,o=e[s],l=o.length,c=0;c<l;++c)(a=o[c])&&(i.push(t.call(a,a.__data__,c,o)),n.push(a));return new pl(i,n)},selectChild:function(t){return this.select(null==t?yo:function(t){return function(){return mo.call(this.children,t)}}("function"==typeof t?t:fo(t)))},selectChildren:function(t){return this.selectAll(null==t?bo:function(t){return function(){return xo.call(this.children,t)}}("function"==typeof t?t:fo(t)))},filter:function(t){"function"!=typeof t&&(t=go(t));for(var e=this._groups,r=e.length,i=new Array(r),n=0;n<r;++n)for(var s,a=e[n],o=a.length,l=i[n]=[],c=0;c<o;++c)(s=a[c])&&t.call(s,s.__data__,c,a)&&l.push(s);return new pl(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,So);var r,i=e?vo:ko,n=this._parents,s=this._groups;"function"!=typeof t&&(r=t,t=function(){return r});for(var a=s.length,o=new Array(a),l=new Array(a),c=new Array(a),h=0;h<a;++h){var d=n[h],u=s[h],p=u.length,g=_o(t.call(d,d&&d.__data__,h,n)),f=g.length,m=l[h]=new Array(f),y=o[h]=new Array(f);i(d,u,m,y,c[h]=new Array(p),g,e);for(var x,b,C=0,w=0;C<f;++C)if(x=m[C]){for(C>=w&&(w=C+1);!(b=y[w])&&++w<f;);x._next=b||null}}return(o=new pl(o,n))._enter=l,o._exit=c,o},enter:function(){return new pl(this._enter||this._groups.map(Co),this._parents)},exit:function(){return new pl(this._exit||this._groups.map(Co),this._parents)},join:function(t,e,r){var i=this.enter(),n=this,s=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(n=e(n))&&(n=n.selection()),null==r?s.remove():r(s),i&&n?i.merge(n).order():n},merge:function(t){for(var e=t.selection?t.selection():t,r=this._groups,i=e._groups,n=r.length,s=i.length,a=Math.min(n,s),o=new Array(n),l=0;l<a;++l)for(var c,h=r[l],d=i[l],u=h.length,p=o[l]=new Array(u),g=0;g<u;++g)(c=h[g]||d[g])&&(p[g]=c);for(;l<n;++l)o[l]=r[l];return new pl(o,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var i,n=t[e],s=n.length-1,a=n[s];--s>=0;)(i=n[s])&&(a&&4^i.compareDocumentPosition(a)&&a.parentNode.insertBefore(i,a),a=i);return this},sort:function(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=To);for(var r=this._groups,i=r.length,n=new Array(i),s=0;s<i;++s){for(var a,o=r[s],l=o.length,c=n[s]=new Array(l),h=0;h<l;++h)(a=o[h])&&(c[h]=a);c.sort(e)}return new pl(n,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var i=t[e],n=0,s=i.length;n<s;++n){var a=i[n];if(a)return a}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var n,s=e[r],a=0,o=s.length;a<o;++a)(n=s[a])&&t.call(n,n.__data__,a,s);return this},attr:function(t,e){var r=so(t);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((null==e?r.local?Bo:Ao:"function"==typeof e?r.local?jo:Lo:r.local?Eo:Mo)(r,e))},style:function(t,e,r){return arguments.length>1?this.each((null==e?No:"function"==typeof e?Oo:Io)(t,e,r??"")):Do(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Ro:"function"==typeof e?$o:zo)(t,e)):this.node()[t]},classed:function(t,e){var r=Po(t+"");if(arguments.length<2){for(var i=qo(this.node()),n=-1,s=r.length;++n<s;)if(!i.contains(r[n]))return!1;return!0}return this.each(("function"==typeof e?Go:e?Yo:Uo)(r,e))},text:function(t){return arguments.length?this.each(null==t?Jo:("function"==typeof t?Ko:Xo)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Zo:("function"==typeof t?tl:Qo)(t)):this.node().innerHTML},raise:function(){return this.each(el)},lower:function(){return this.each(rl)},append:function(t){var e="function"==typeof t?t:lo(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var r="function"==typeof t?t:lo(t),i=null==e?il:"function"==typeof e?e:ho(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(nl)},clone:function(t){return this.select(t?al:sl)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,r){var i,n,s=function(t){return t.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");return r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}})}(t+""),a=s.length;if(!(arguments.length<2)){for(o=e?ll:ol,i=0;i<a;++i)this.each(o(s[i],e,r));return this}var o=this.node().__on;if(o)for(var l,c=0,h=o.length;c<h;++c)for(i=0,l=o[c];i<a;++i)if((n=s[i]).type===l.type&&n.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?dl:hl)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var i,n=t[e],s=0,a=n.length;s<a;++s)(i=n[s])&&(yield i)}};var bl=.7,Cl=1/bl,wl="\\s*([+-]?\\d+)\\s*",kl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Sl=/^#([0-9a-f]{3,8})$/,_l=new RegExp(`^rgb\\(${wl},${wl},${wl}\\)$`),Tl=new RegExp(`^rgb\\(${vl},${vl},${vl}\\)$`),Al=new RegExp(`^rgba\\(${wl},${wl},${wl},${kl}\\)$`),Bl=new RegExp(`^rgba\\(${vl},${vl},${vl},${kl}\\)$`),Ml=new RegExp(`^hsl\\(${kl},${vl},${vl}\\)$`),El=new RegExp(`^hsla\\(${kl},${vl},${vl},${kl}\\)$`),Ll={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function jl(){return this.rgb().formatHex()}function Fl(){return this.rgb().formatRgb()}function Nl(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Sl.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?Il(e):3===r?new zl(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?Ol(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?Ol(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=_l.exec(t))?new zl(e[1],e[2],e[3],1):(e=Tl.exec(t))?new zl(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Al.exec(t))?Ol(e[1],e[2],e[3],e[4]):(e=Bl.exec(t))?Ol(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ml.exec(t))?Vl(e[1],e[2]/100,e[3]/100,1):(e=El.exec(t))?Vl(e[1],e[2]/100,e[3]/100,e[4]):Ll.hasOwnProperty(t)?Il(Ll[t]):"transparent"===t?new zl(NaN,NaN,NaN,0):null}function Il(t){return new zl(t>>16&255,t>>8&255,255&t,1)}function Ol(t,e,r,i){return i<=0&&(t=e=r=NaN),new zl(t,e,r,i)}function Dl(t){return t instanceof xl||(t=Nl(t)),t?new zl((t=t.rgb()).r,t.g,t.b,t.opacity):new zl}function Rl(t,e,r,i){return 1===arguments.length?Dl(t):new zl(t,e,r,i??1)}function zl(t,e,r,i){this.r=+t,this.g=+e,this.b=+r,this.opacity=+i}function $l(){return`#${Hl(this.r)}${Hl(this.g)}${Hl(this.b)}`}
vendor: 2,555 bytes, line 2
2function Pl(){const t=ql(this.opacity);return`${1===t?"rgb(":"rgba("}${Wl(this.r)}, ${Wl(this.g)}, ${Wl(this.b)}${1===t?")":`, ${t})`}`}function ql(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Wl(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Hl(t){return((t=Wl(t))<16?"0":"")+t.toString(16)}function Vl(t,e,r,i){return i<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Ul(t,e,r,i)}function Yl(t){if(t instanceof Ul)return new Ul(t.h,t.s,t.l,t.opacity);if(t instanceof xl||(t=Nl(t)),!t)return new Ul;if(t instanceof Ul)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,n=Math.min(e,r,i),s=Math.max(e,r,i),a=NaN,o=s-n,l=(s+n)/2;return o?(a=e===s?(r-i)/o+6*(r<i):r===s?(i-e)/o+2:(e-r)/o+4,o/=l<.5?s+n:2-s-n,a*=60):o=l>0&&l<1?0:a,new Ul(a,o,l,t.opacity)}function Ul(t,e,r,i){this.h=+t,this.s=+e,this.l=+r,this.opacity=+i}function Gl(t){return(t=(t||0)%360)<0?t+360:t}function Jl(t){return Math.max(0,Math.min(1,t||0))}function Xl(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}ml(xl,Nl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:jl,formatHex:jl,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Yl(this).formatHsl()},formatRgb:Fl,toString:Fl}),ml(zl,Rl,yl(xl,{brighter(t){return t=null==t?Cl:Math.pow(Cl,t),new zl(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?bl:Math.pow(bl,t),new zl(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new zl(Wl(this.r),Wl(this.g),Wl(this.b),ql(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:$l,formatHex:$l,formatHex8:function(){return`#${Hl(this.r)}${Hl(this.g)}${Hl(this.b)}${Hl(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Pl,toString:Pl})),ml(Ul,function(t,e,r,i){return 1===arguments.length?Yl(t):new Ul(t,e,r,i??1)},yl(xl,{brighter(t){return t=null==t?Cl:Math.pow(Cl,t),new Ul(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?bl:Math.pow(bl,t),new Ul(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*e,n=2*r-i;return new zl(Xl(t>=240?t-240:t+120,n,i),Xl(t,n,i),Xl(t<120?t+240:t-120,n,i),this.opacity)},clamp(){return new Ul(Gl(this.h),Jl(this.s),Jl(this.l),ql(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}
vendor: 2,396 bytes, line 2
2,formatHsl(){const t=ql(this.opacity);return`${1===t?"hsl(":"hsla("}${Gl(this.h)}, ${100*Jl(this.s)}%, ${100*Jl(this.l)}%${1===t?")":`, ${t})`}`}}));const Kl=t=>()=>t;function Zl(t,e){return function(r){return t+r*e}}function Ql(t,e){var r=e-t;return r?Zl(t,r>180||r<-180?r-360*Math.round(r/360):r):Kl(isNaN(t)?e:t)}function tc(t,e){var r=e-t;return r?Zl(t,r):Kl(isNaN(t)?e:t)}const ec=function t(e){var r=function(t){return 1===(t=+t)?tc:function(e,r){return r-e?function(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)}}(e,r,t):Kl(isNaN(e)?r:e)}}(e);function i(t,e){var i=r((t=Rl(t)).r,(e=Rl(e)).r),n=r(t.g,e.g),s=r(t.b,e.b),a=tc(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=n(e),t.b=s(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function rc(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var ic=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nc=new RegExp(ic.source,"g");function sc(t,e){var r,i,n,s=ic.lastIndex=nc.lastIndex=0,a=-1,o=[],l=[];for(t+="",e+="";(r=ic.exec(t))&&(i=nc.exec(e));)(n=i.index)>s&&(n=e.slice(s,n),o[a]?o[a]+=n:o[++a]=n),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:rc(r,i)})),s=nc.lastIndex;return s<e.length&&(n=e.slice(s),o[a]?o[a]+=n:o[++a]=n),o.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var r,i=0;i<e;++i)o[(r=l[i]).i]=r.x(t);return o.join("")})}var ac,oc=180/Math.PI,lc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cc(t,e,r,i,n,s){var a,o,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*r+e*i)&&(r-=t*l,i-=e*l),(o=Math.sqrt(r*r+i*i))&&(r/=o,i/=o,l/=o),t*i<e*r&&(t=-t,e=-e,l=-l,a=-a),{translateX:n,translateY:s,rotate:Math.atan2(e,t)*oc,skewX:Math.atan(l)*oc,scaleX:a,scaleY:o}}function hc(t,e,r,i){function n(t){return t.length?t.pop()+" ":""}return function(s,a){var o=[],l=[];return s=t(s),a=t(a),function(t,i,n,s,a,o){if(t!==n||i!==s){var l=a.push("translate(",null,e,null,r);o.push({i:l-4,x:rc(t,n)},{i:l-2,x:rc(i,s)})}else(n||s)&&a.push("translate("+n+e+s+r)}(s.translateX,s.translateY,a.translateX,a.translateY,o,l),function(t,e,r,s){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),s.push({i:r.push(n(r)+"rotate(",null,i)-2,x:rc(t,e)})):e&&r.push(n(r)+"rotate("+e+i)}(s.rotate,a.rotate,o,l),function(t,e,r,s){t!==e?s.push({i:r.push(n(r)+"skewX(",
vendor: 7,579 bytes, line 2
2null,i)-2,x:rc(t,e)}):e&&r.push(n(r)+"skewX("+e+i)}(s.skewX,a.skewX,o,l),function(t,e,r,i,s,a){if(t!==r||e!==i){var o=s.push(n(s)+"scale(",null,",",null,")");a.push({i:o-4,x:rc(t,r)},{i:o-2,x:rc(e,i)})}else 1===r&&1===i||s.push(n(s)+"scale("+r+","+i+")")}(s.scaleX,s.scaleY,a.scaleX,a.scaleY,o,l),s=a=null,function(t){for(var e,r=-1,i=l.length;++r<i;)o[(e=l[r]).i]=e.x(t);return o.join("")}}}var dc,uc,pc=hc(function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?lc:cc(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),gc=hc(function(t){return null==t?lc:(ac||(ac=document.createElementNS("http://www.w3.org/2000/svg","g")),ac.setAttribute("transform",t),(t=ac.transform.baseVal.consolidate())?cc((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):lc)},", ",")",")"),fc=0,mc=0,yc=0,xc=0,bc=0,Cc=0,wc="object"==typeof performance&&performance.now?performance:Date,kc="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function vc(){return bc||(kc(Sc),bc=wc.now()+Cc)}function Sc(){bc=0}function _c(){this._call=this._time=this._next=null}function Tc(t,e,r){var i=new _c;return i.restart(t,e,r),i}function Ac(){bc=(xc=wc.now())+Cc,fc=mc=0;try{!function(){vc(),++fc;for(var t,e=dc;e;)(t=bc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fc}()}finally{fc=0,function(){for(var t,e,r=dc,i=1/0;r;)r._call?(i>r._time&&(i=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:dc=e);uc=t,Mc(i)}(),bc=0}}function Bc(){var t=wc.now(),e=t-xc;e>1e3&&(Cc-=e,xc=t)}function Mc(t){fc||(mc&&(mc=clearTimeout(mc)),t-bc>24?(t<1/0&&(mc=setTimeout(Ac,t-wc.now()-Cc)),yc&&(yc=clearInterval(yc))):(yc||(xc=wc.now(),yc=setInterval(Bc,1e3)),fc=1,kc(Ac)))}function Ec(t,e,r){var i=new _c;return e=null==e?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,r),i}_c.prototype=Tc.prototype={constructor:_c,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?vc():+r)+(null==e?0:+e),this._next||uc===this||(uc?uc._next=this:dc=this,uc=this),this._call=t,this._time=r,Mc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Mc())}};var Lc=Qa("start","end","cancel","interrupt"),jc=[];function Fc(t,e,r,i,n,s){var a=t.__transition;if(a){if(r in a)return}else t.__transition={};!function(t,e,r){var i,n=t.__transition;function s(l){var c,h,d,u;if(1!==r.state)return o();for(c in n)if((u=n[c]).name===r.name){if(3===u.state)return Ec(s);4===u.state?(u.state=6,u.timer.stop(),u.on.call("interrupt",t,t.__data__,u.index,u.group),delete n[c]):+c<e&&(u.state=6,u.timer.stop(),u.on.call("cancel",t,t.__data__,u.index,u.group),delete n[c])}if(Ec(function(){3===r.state&&(r.state=4,r.timer.restart(a,r.delay,r.time),a(l))}),r.state=2,r.on.call("start",t,t.__data__,r.index,r.group),2===r.state){for(r.state=3,i=new Array(d=r.tween.length),c=0,h=-1;c<d;++c)(u=r.tween[c].value.call(t,t.__data__,r.index,r.group))&&(i[++h]=u);i.length=h+1}}function a(e){for(var n=e<r.duration?r.ease.call(null,e/r.duration):(r.timer.restart(o),r.state=5,1),s=-1,a=i.length;++s<a;)i[s].call(t,n);5===r.state&&(r.on.call("end",t,t.__data__,r.index,r.group),o())}function o(){for(var i in r.state=6,r.timer.stop(),delete n[e],n)return;delete t.__transition}n[e]=r,r.timer=Tc(function(t){r.state=1,r.timer.restart(s,r.delay,r.time),r.delay<=t&&s(t-r.delay)},0,r.time)}(t,r,{name:e,index:i,group:n,on:Lc,tween:jc,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:0})}function Nc(t,e){var r=Oc(t,e);if(r.state>0)throw new Error("too late; already scheduled");return r}function Ic(t,e){var r=Oc(t,e);if(r.state>3)throw new Error("too late; already running");return r}function Oc(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Dc(t,e){var r,i;return function(){var n=Ic(this,t),s=n.tween;if(s!==r)for(var a=0,o=(i=r=s).length;a<o;++a)if(i[a].name===e){(i=i.slice()).splice(a,1);break}n.tween=i}}function Rc(t,e,r){var i,n;if("function"!=typeof r)throw new Error;return function(){var s=Ic(this,t),a=s.tween;if(a!==i){n=(i=a).slice();for(var o={name:e,value:r},l=0,c=n.length;l<c;++l)if(n[l].name===e){n[l]=o;break}l===c&&n.push(o)}s.tween=n}}function zc(t,e,r){var i=t._id;return t.each(function(){var t=Ic(this,i);(t.value||(t.value={}))[e]=r.apply(this,arguments)}),function(t){return Oc(t,i).value[e]}}function $c(t,e){var r;return("number"==typeof e?rc:e instanceof Nl?ec:(r=Nl(e))?(e=r,ec):sc)(t,e)}function Pc(t){return function(){this.removeAttribute(t)}}function qc(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Wc(t,e,r){var i,n,s=r+"";return function(){var a=this.getAttribute(t);return a===s?null:a===i?n:n=e(i=a,r)}}function Hc(t,e,r){var i,n,s=r+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===s?null:a===i?n:n=e(i=a,r)}}function Vc(t,e,r){var i,n,s;return function(){var a,o,l=r(this);if(null!=l)return(a=this.getAttribute(t))===(o=l+"")?null:a===i&&o===n?s:(n=o,s=e(i=a,l));this.removeAttribute(t)}}function Yc(t,e,r){var i,n,s;return function(){var a,o,l=r(this);if(null!=l)return(a=this.getAttributeNS(t.space,t.local))===(o=l+"")?null:a===i&&o===n?s:(n=o,s=e(i=a,l));this.removeAttributeNS(t.space,t.local)}}function Uc(t,e){var r,i;function n(){var n=e.apply(this,arguments);return n!==i&&(r=(i=n)&&function(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}(t,n)),r}return n._value=e,n}function Gc(t,e){var r,i;function n(){var n=e.apply(this,arguments);return n!==i&&(r=(i=n)&&function(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}(t,n)),r}return n._value=e,n}function Jc(t,e){return function(){Nc(this,t).delay=+e.apply(this,arguments)}}function Xc(t,e){return e=+e,function(){Nc(this,t).delay=e}}function Kc(t,e){return function(){Ic(this,t).duration=+e.apply(this,arguments)}}function Zc(t,e){return e=+e,function(){Ic(this,t).duration=e}}var Qc=gl.prototype.constructor;function th(t){return function(){this.style.removeProperty(t)}}var eh=0;function rh(t,e,r,i){this._groups=t,this._parents=e,this._name=r,this._id=i}function ih(){return++eh}var nh=gl.prototype;rh.prototype={constructor:rh,select:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=ho(t));for(var i=this._groups,n=i.length,s=new Array(n),a=0;a<n;++a)for(var o,l,c=i[a],h=c.length,d=s[a]=new Array(h),u=0;u<h;++u)(o=c[u])&&(l=t.call(o,o.__data__,u,c))&&("__data__"in o&&(l.__data__=o.__data__),d[u]=l,Fc(d[u],e,r,u,d,Oc(o,r)));return new rh(s,this._parents,e,r)},selectAll:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=po(t));for(var i=this._groups,n=i.length,s=[],a=[],o=0;o<n;++o)for(var l,c=i[o],h=c.length,d=0;d<h;++d)if(l=c[d]){for(var u,p=t.call(l,l.__data__,d,c),g=Oc(l,r),f=0,m=p.length;f<m;++f)(u=p[f])&&Fc(u,e,r,f,p,g);s.push(p),a.push(l)}return new rh(s,a,e,r)},selectChild:nh.selectChild,selectChildren:nh.selectChildren,filter:function(t){"function"!=typeof t&&(t=go(t));for(var e=this._groups,r=e.length,i=new Array(r),n=0;n<r;++n)for(var s,a=e[n],o=a.length,l=i[n]=[],c=0;c<o;++c)(s=a[c])&&t.call(s,s.__data__,c,a)&&l.push(s);return new rh(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,i=e.length,n=r.length,s=Math.min(i,n),a=new Array(i),o=0;o<s;++o)for(var l,c=e[o],h=r[o],d=c.length,u=a[o]=new Array(d),p=0;p<d;++p)(l=c[p]||h[p])&&(u[p]=l);for(;o<i;++o)a[o]=e[o];return new rh(a,this._parents,this._name,this._id)},selection:function(){return new Qc(this._groups,this._parents)}
vendor: 6,098 bytes, line 2
2,transition:function(){for(var t=this._name,e=this._id,r=ih(),i=this._groups,n=i.length,s=0;s<n;++s)for(var a,o=i[s],l=o.length,c=0;c<l;++c)if(a=o[c]){var h=Oc(a,e);Fc(a,t,r,c,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new rh(i,this._parents,t,r)},call:nh.call,nodes:nh.nodes,node:nh.node,size:nh.size,empty:nh.empty,each:nh.each,on:function(t,e){var r=this._id;return arguments.length<2?Oc(this.node(),r).on.on(t):this.each(function(t,e,r){var i,n,s=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})}(e)?Nc:Ic;return function(){var a=s(this,t),o=a.on;o!==i&&(n=(i=o).copy()).on(e,r),a.on=n}}(r,t,e))},attr:function(t,e){var r=so(t),i="transform"===r?gc:$c;return this.attrTween(t,"function"==typeof e?(r.local?Yc:Vc)(r,i,zc(this,"attr."+t,e)):null==e?(r.local?qc:Pc)(r):(r.local?Hc:Wc)(r,i,e))},attrTween:function(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var i=so(t);return this.tween(r,(i.local?Uc:Gc)(i,e))},style:function(t,e,r){var i="transform"==(t+="")?pc:$c;return null==e?this.styleTween(t,function(t,e){var r,i,n;return function(){var s=Do(this,t),a=(this.style.removeProperty(t),Do(this,t));return s===a?null:s===r&&a===i?n:n=e(r=s,i=a)}}(t,i)).on("end.style."+t,th(t)):"function"==typeof e?this.styleTween(t,function(t,e,r){var i,n,s;return function(){var a=Do(this,t),o=r(this),l=o+"";return null==o&&(this.style.removeProperty(t),l=o=Do(this,t)),a===l?null:a===i&&l===n?s:(n=l,s=e(i=a,o))}}(t,i,zc(this,"style."+t,e))).each(function(t,e){var r,i,n,s,a="style."+e,o="end."+a;return function(){var l=Ic(this,t),c=l.on,h=null==l.value[a]?s||(s=th(e)):void 0;c===r&&n===h||(i=(r=c).copy()).on(o,n=h),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,r){var i,n,s=r+"";return function(){var a=Do(this,t);return a===s?null:a===i?n:n=e(i=a,r)}}(t,i,e),r).on("end.style."+t,null)},styleTween:function(t,e,r){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,r){var i,n;function s(){var s=e.apply(this,arguments);return s!==n&&(i=(n=s)&&function(t,e,r){return function(i){this.style.setProperty(t,e.call(this,i),r)}}(t,s,r)),i}return s._value=e,s}(t,e,r??""))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=e??""}}(zc(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,r;function i(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var r=this._id;if(t+="",arguments.length<2){for(var i,n=Oc(this.node(),r).tween,s=0,a=n.length;s<a;++s)if((i=n[s]).name===t)return i.value;return null}return this.each((null==e?Dc:Rc)(r,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Jc:Xc)(e,t)):Oc(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Kc:Zc)(e,t)):Oc(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){Ic(this,t).ease=e}}(e,t)):Oc(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var r=e.apply(this,arguments);if("function"!=typeof r)throw new Error;Ic(this,t).ease=r}}(this._id,t))},end:function(){var t,e,r=this,i=r._id,n=r.size();return new Promise(function(s,a){var o={value:a},l={value:function(){0===--n&&s()}};r.each(function(){var r=Ic(this,i),n=r.on;n!==t&&((e=(t=n).copy())._.cancel.push(o),e._.interrupt.push(o),e._.end.push(l)),r.on=e}),0===n&&s()})},[Symbol.iterator]:nh[Symbol.iterator]};var sh={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function ah(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}gl.prototype.interrupt=function(t){return this.each(function(){!function(t,e){var r,i,n,s=t.__transition,a=!0;if(s){for(n in e=null==e?null:e+"",s)(r=s[n]).name===e?(i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete s[n]):a=!1;a&&delete t.__transition}}(this,t)})},gl.prototype.transition=function(t){var e,r;t instanceof rh?(e=t._id,t=t._name):(e=ih(),(r=sh).time=vc(),t=null==t?null:t+"");for(var i=this._groups,n=i.length,s=0;s<n;++s)for(var a,o=i[s],l=o.length,c=0;c<l;++c)(a=o[c])&&Fc(a,t,e,c,o,r||ah(a,e));return new rh(i,this._parents,t,e)};const oh=Math.PI,lh=2*oh,ch=1e-6,hh=lh-ch;function dh(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}class uh{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?dh:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return dh;const r=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*r)/r+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,r,i){this._append`Q${+t},${+e},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,e,r,i,n,s){this._append`C${+t},${+e},${+r},${+i},${this._x1=+n},${this._y1=+s}`}
vendor: 16,384 bytes, line 2
2arcTo(t,e,r,i,n){if(t=+t,e=+e,r=+r,i=+i,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=this._x1,a=this._y1,o=r-t,l=i-e,c=s-t,h=a-e,d=c*c+h*h;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(d>ch)if(Math.abs(h*o-l*c)>ch&&n){let u=r-s,p=i-a,g=o*o+l*l,f=u*u+p*p,m=Math.sqrt(g),y=Math.sqrt(d),x=n*Math.tan((oh-Math.acos((g+d-f)/(2*m*y)))/2),b=x/y,C=x/m;Math.abs(b-1)>ch&&this._append`L${t+b*c},${e+b*h}`,this._append`A${n},${n},0,0,${+(h*u>c*p)},${this._x1=t+C*o},${this._y1=e+C*l}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,r,i,n,s){if(t=+t,e=+e,s=!!s,(r=+r)<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),o=r*Math.sin(i),l=t+a,c=e+o,h=1^s,d=s?i-n:n-i;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>ch||Math.abs(this._y1-c)>ch)&&this._append`L${l},${c}`,r&&(d<0&&(d=d%lh+lh),d>hh?this._append`A${r},${r},0,1,${h},${t-a},${e-o}A${r},${r},0,1,${h},${this._x1=l},${this._y1=c}`:d>ch&&this._append`A${r},${r},0,${+(d>=oh)},${h},${this._x1=t+r*Math.cos(n)},${this._y1=e+r*Math.sin(n)}`)}rect(t,e,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function ph(t){return function(){return t}}const gh=Math.abs,fh=Math.atan2,mh=Math.cos,yh=Math.max,xh=Math.min,bh=Math.sin,Ch=Math.sqrt,wh=1e-12,kh=Math.PI,vh=kh/2,Sh=2*kh;function _h(t){return t>1?0:t<-1?kh:Math.acos(t)}function Th(t){return t>=1?vh:t<=-1?-vh:Math.asin(t)}function Ah(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(null==r)e=null;else{const t=Math.floor(r);if(!(t>=0))throw new RangeError(`invalid digits: ${r}`);e=t}return t},()=>new uh(e)}function Bh(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Mh(t){this._context=t}function Eh(t){return new Mh(t)}function Lh(t){return t[0]}function jh(t){return t[1]}function Fh(t,e){var r=ph(!0),i=null,n=Eh,s=null,a=Ah(o);function o(o){var l,c,h,d=(o=Bh(o)).length,u=!1;for(null==i&&(s=n(h=a())),l=0;l<=d;++l)!(l<d&&r(c=o[l],l,o))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+t(c,l,o),+e(c,l,o));if(h)return s=null,h+""||null}return t="function"==typeof t?t:void 0===t?Lh:ph(t),e="function"==typeof e?e:void 0===e?jh:ph(e),o.x=function(e){return arguments.length?(t="function"==typeof e?e:ph(+e),o):t},o.y=function(t){return arguments.length?(e="function"==typeof t?t:ph(+t),o):e},o.defined=function(t){return arguments.length?(r="function"==typeof t?t:ph(!!t),o):r},o.curve=function(t){return arguments.length?(n=t,null!=i&&(s=n(i)),o):n},o.context=function(t){return arguments.length?(null==t?i=s=null:s=n(i=t),o):i},o}Mh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};class Nh{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function Ih(t){return new Nh(t,!0)}function Oh(t){return new Nh(t,!1)}function Dh(){}function Rh(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function zh(t){this._context=t}function $h(t){return new zh(t)}function Ph(t){this._context=t}function qh(t){this._context=t}function Wh(t,e){this._basis=new zh(t),this._beta=e}zh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Rh(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+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:Rh(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Ph.prototype={areaStart:Dh,areaEnd:Dh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Rh(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},qh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:Rh(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Wh.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var i,n=t[0],s=e[0],a=t[r]-n,o=e[r]-s,l=-1;++l<=r;)i=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(n+i*a),this._beta*e[l]+(1-this._beta)*(s+i*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Hh=function t(e){function r(t){return 1===e?new zh(t):new Wh(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function Vh(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function Yh(t,e){this._context=t,this._k=(1-e)/6}Yh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Vh(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+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:Vh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Uh=function t(e){function r(t){return new Yh(t,e)}return r.tension=function(e){return t(+e)},r}(0);function Gh(t,e){this._context=t,this._k=(1-e)/6}Gh.prototype={areaStart:Dh,areaEnd:Dh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Vh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Jh=function t(e){function r(t){return new Gh(t,e)}return r.tension=function(e){return t(+e)},r}(0);function Xh(t,e){this._context=t,this._k=(1-e)/6}Xh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Vh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Kh=function t(e){function r(t){return new Xh(t,e)}return r.tension=function(e){return t(+e)},r}(0);function Zh(t,e,r){var i=t._x1,n=t._y1,s=t._x2,a=t._y2;if(t._l01_a>wh){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,n=(n*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>wh){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*c+t._x1*t._l23_2a-e*t._l12_2a)/h,a=(a*c+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(i,n,s,a,t._x2,t._y2)}function Qh(t,e){this._context=t,this._alpha=e}Qh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Zh(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const td=function t(e){function r(t){return e?new Qh(t,e):new Yh(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function ed(t,e){this._context=t,this._alpha=e}ed.prototype={areaStart:Dh,areaEnd:Dh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Zh(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const rd=function t(e){function r(t){return e?new ed(t,e):new Gh(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function id(t,e){this._context=t,this._alpha=e}id.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Zh(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const nd=function t(e){function r(t){return e?new id(t,e):new Xh(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function sd(t){this._context=t}function ad(t){return t<0?-1:1}function od(t,e,r){var i=t._x1-t._x0,n=e-t._x1,s=(t._y1-t._y0)/(i||n<0&&-0),a=(r-t._y1)/(n||i<0&&-0),o=(s*n+a*i)/(i+n);return(ad(s)+ad(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function ld(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function cd(t,e,r){var i=t._x0,n=t._y0,s=t._x1,a=t._y1,o=(s-i)/3;t._context.bezierCurveTo(i+o,n+o*e,s-o,a-o*r,s,a)}function hd(t){this._context=t}function dd(t){this._context=new ud(t)}function ud(t){this._context=t}function pd(t){return new hd(t)}function gd(t){return new dd(t)}function fd(t){this._context=t}function md(t){var e,r,i=t.length-1,n=new Array(i),s=new Array(i),a=new Array(i);for(n[0]=0,s[0]=2,a[0]=t[0]+2*t[1],e=1;e<i-1;++e)n[e]=1,s[e]=4,a[e]=4*t[e]+2*t[e+1];for(n[i-1]=2,s[i-1]=7,a[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)r=n[e]/s[e-1],s[e]-=r,a[e]-=r*a[e-1];for(n[i-1]=a[i-1]/s[i-1],e=i-2;e>=0;--e)n[e]=(a[e]-n[e+1])/s[e];for(s[i-1]=(t[i]+n[i-1])/2,e=0;e<i-1;++e)s[e]=2*t[e+1]-n[e+1];return[n,s]}function yd(t){return new fd(t)}function xd(t,e){this._context=t,this._t=e}function bd(t){return new xd(t,.5)}function Cd(t){return new xd(t,0)}function wd(t){return new xd(t,1)}function kd(t,e,r){this.k=t,this.x=e,this.y=r}sd.prototype={areaStart:Dh,areaEnd:Dh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},hd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:cd(this,this._t0,ld(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(e=+e,(t=+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,cd(this,ld(this,r=od(this,t,e)),r);break;default:cd(this,this._t0,r=od(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}},(dd.prototype=Object.create(hd.prototype)).point=function(t,e){hd.prototype.point.call(this,e,t)},ud.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,i,n,s){this._context.bezierCurveTo(e,t,i,r,s,n)}},fd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y
2=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===r)this._context.lineTo(t[1],e[1]);else for(var i=md(t),n=md(e),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(i[0][s],n[0][s],i[1][s],n[1][s],t[a],e[a]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},xd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+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)}}this._x=t,this._y=e}},kd.prototype={constructor:kd,scale:function(t){return 1===t?this:new kd(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new kd(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},kd.prototype;var vd=_n(t=>{const{securityLevel:e}=qa();let r=fl("body");if("sandbox"===e){const e=fl(`#i${t}`);r=fl((e.node()?.contentDocument??document).body)}return r.select(`#${t}`)},"selectSvgElement");function Sd(t){return null==t}function _d(t){return"object"==typeof t&&null!==t}function Td(t){return Array.isArray(t)?t:Sd(t)?[]:[t]}function Ad(t,e){var r,i,n,s;if(e)for(r=0,i=(s=Object.keys(e)).length;r<i;r+=1)t[n=s[r]]=e[n];return t}function Bd(t,e){var r,i="";for(r=0;r<e;r+=1)i+=t;return i}function Md(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t}_n(Sd,"isNothing"),_n(_d,"isObject"),_n(Td,"toArray"),_n(Ad,"extend"),_n(Bd,"repeat"),_n(Md,"isNegativeZero");var Ed={isNothing:Sd,isObject:_d,toArray:Td,repeat:Bd,isNegativeZero:Md,extend:Ad};function Ld(t,e){var r="",i=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+="\n\n"+t.mark.snippet),i+" "+r):i}function jd(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=Ld(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}_n(Ld,"formatError"),_n(jd,"YAMLException$1"),jd.prototype=Object.create(Error.prototype),jd.prototype.constructor=jd,jd.prototype.toString=_n(function(t){return this.name+": "+Ld(this,t)},"toString");var Fd=jd;function Nd(t,e,r,i,n){var s="",a="",o=Math.floor(n/2)-1;return i-e>o&&(e=i-o+(s=" ... ").length),r-i>o&&(r=i+o-(a=" ...").length),{str:s+t.slice(e,r).replace(/\t/g,"→")+a,pos:i-e+s.length}}function Id(t,e){return Ed.repeat(" ",e-t.length)+t}function Od(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var r,i=/\r?\n|\r|\0/g,n=[0],s=[],a=-1;r=i.exec(t.buffer);)s.push(r.index),n.push(r.index+r[0].length),t.position<=r.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);var o,l,c="",h=Math.min(t.line+e.linesAfter,s.length).toString().length,d=e.maxLength-(e.indent+h+3);for(o=1;o<=e.linesBefore&&!(a-o<0);o++)l=Nd(t.buffer,n[a-o],s[a-o],t.position-(n[a]-n[a-o]),d),c=Ed.repeat(" ",e.indent)+Id((t.line-o+1).toString(),h)+" | "+l.str+"\n"+c;for(l=Nd(t.buffer,n[a],s[a],t.position,d),c+=Ed.repeat(" ",e.indent)+Id((t.line+1).toString(),h)+" | "+l.str+"\n",c+=Ed.repeat("-",e.indent+h+3+l.pos)+"^\n",o=1;o<=e.linesAfter&&!(a+o>=s.length);o++)l=Nd(t.buffer,n[a+o],s[a+o],t.position-(n[a]-n[a+o]),d),c+=Ed.repeat(" ",e.indent)+Id((t.line+o+1).toString(),h)+" | "+l.str+"\n";return c.replace(/\n$/,"")}_n(Nd,"getLine"),_n(Id,"padStart"),_n(Od,"makeSnippet");var Dd=Od,Rd=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],zd=["scalar","sequence","mapping"];function $d(t){var e={};return null!==t&&Object.keys(t).forEach(function(r){t[r].forEach(function(t){e[String(t)]=r})}),e}function Pd(t,e){if(e=e||{},Object.keys(e).forEach(function(e){if(-1===Rd.indexOf(e))throw new Fd('Unknown option "'+e+'" 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(t){return t},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=$d(e.styleAliases||null),-1===zd.indexOf(this.kind))throw new Fd('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}_n($d,"compileStyleAliases"),_n(Pd,"Type$1");var qd=Pd;function Wd(t,e){var r=[];return t[e].forEach(function(t){var e=r.length;r.forEach(function(r,i){r.tag===t.tag&&r.kind===t.kind&&r.multi===t.multi&&(e=i)}),r[e]=t}),r}function Hd(){var t,e,r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(t){t.multi?(r.multi[t.kind].push(t),r.multi.fallback.push(t)):r[t.kind][t.tag]=r.fallback[t.tag]=t}for(_n(i,"collectType"),t=0,e=arguments.length;t<e;t+=1)arguments[t].forEach(i);return r}function Vd(t){return this.extend(t)}_n(Wd,"compileList"),_n(Hd,"compileMap"),_n(Vd,"Schema$1"),Vd.prototype.extend=_n(function(t){var e=[],r=[];if(t instanceof qd)r.push(t);else if(Array.isArray(t))r=r.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new Fd("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit))}e.forEach(function(t){if(!(t instanceof qd))throw new Fd("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new Fd("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
2if(t.multi)throw new Fd("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(t){if(!(t instanceof qd))throw new Fd("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Vd.prototype);return i.implicit=(this.implicit||[]).concat(e),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Wd(i,"implicit"),i.compiledExplicit=Wd(i,"explicit"),i.compiledTypeMap=Hd(i.compiledImplicit,i.compiledExplicit),i},"extend");var Yd=new Vd({explicit:[new qd("tag:yaml.org,2002:str",{kind:"scalar",construct:_n(function(t){return null!==t?t:""},"construct")}),new qd("tag:yaml.org,2002:seq",{kind:"sequence",construct:_n(function(t){return null!==t?t:[]},"construct")}),new qd("tag:yaml.org,2002:map",{kind:"mapping",construct:_n(function(t){return null!==t?t:{}},"construct")})]});function Ud(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)}function Gd(){return null}function Jd(t){return null===t}_n(Ud,"resolveYamlNull"),_n(Gd,"constructYamlNull"),_n(Jd,"isNull");var Xd=new qd("tag:yaml.org,2002:null",{kind:"scalar",resolve:Ud,construct:Gd,predicate:Jd,represent:{canonical:_n(function(){return"~"},"canonical"),lowercase:_n(function(){return"null"},"lowercase"),uppercase:_n(function(){return"NULL"},"uppercase"),camelcase:_n(function(){return"Null"},"camelcase"),empty:_n(function(){return""},"empty")},defaultStyle:"lowercase"});function Kd(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)}function Zd(t){return"true"===t||"True"===t||"TRUE"===t}function Qd(t){return"[object Boolean]"===Object.prototype.toString.call(t)}_n(Kd,"resolveYamlBoolean"),_n(Zd,"constructYamlBoolean"),_n(Qd,"isBoolean");var tu=new qd("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Kd,construct:Zd,predicate:Qd,represent:{lowercase:_n(function(t){return t?"true":"false"},"lowercase"),uppercase:_n(function(t){return t?"TRUE":"FALSE"},"uppercase"),camelcase:_n(function(t){return t?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function eu(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function ru(t){return 48<=t&&t<=55}function iu(t){return 48<=t&&t<=57}function nu(t){if(null===t)return!1;var e,r=t.length,i=0,n=!1;if(!r)return!1;if("-"!==(e=t[i])&&"+"!==e||(e=t[++i]),"0"===e){if(i+1===r)return!0;if("b"===(e=t[++i])){for(i++;i<r;i++)if("_"!==(e=t[i])){if("0"!==e&&"1"!==e)return!1;n=!0}return n&&"_"!==e}if("x"===e){for(i++;i<r;i++)if("_"!==(e=t[i])){if(!eu(t.charCodeAt(i)))return!1;n=!0}return n&&"_"!==e}if("o"===e){for(i++;i<r;i++)if("_"!==(e=t[i])){if(!ru(t.charCodeAt(i)))return!1;n=!0}return n&&"_"!==e}}if("_"===e)return!1;for(;i<r;i++)if("_"!==(e=t[i])){if(!iu(t.charCodeAt(i)))return!1;n=!0}return!(!n||"_"===e)}function su(t){var e,r=t,i=1;if(-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(e=r[0])&&"+"!==e||("-"===e&&(i=-1),e=(r=r.slice(1))[0]),"0"===r)return 0;if("0"===e){if("b"===r[1])return i*parseInt(r.slice(2),2);if("x"===r[1])return i*parseInt(r.slice(2),16);if("o"===r[1])return i*parseInt(r.slice(2),8)}return i*parseInt(r,10)}function au(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!Ed.isNegativeZero(t)}_n(eu,"isHexCode"),_n(ru,"isOctCode"),_n(iu,"isDecCode"),_n(nu,"resolveYamlInteger"),_n(su,"constructYamlInteger"),_n(au,"isInteger");var ou=new qd("tag:yaml.org,2002:int",{kind:"scalar",resolve:nu,construct:su,predicate:au,represent:{binary:_n(function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:_n(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)}
2,"octal"),decimal:_n(function(t){return t.toString(10)},"decimal"),hexadecimal:_n(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"]}}),lu=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function cu(t){return null!==t&&!(!lu.test(t)||"_"===t[t.length-1])}function hu(t){var e,r;return r="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:r*parseFloat(e,10)}_n(cu,"resolveYamlFloat"),_n(hu,"constructYamlFloat");var du=/^[-+]?[0-9]+e/;function uu(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(Ed.isNegativeZero(t))return"-0.0";return r=t.toString(10),du.test(r)?r.replace("e",".e"):r}function pu(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||Ed.isNegativeZero(t))}_n(uu,"representYamlFloat"),_n(pu,"isFloat");var gu=new qd("tag:yaml.org,2002:float",{kind:"scalar",resolve:cu,construct:hu,predicate:pu,represent:uu,defaultStyle:"lowercase"}),fu=Yd.extend({implicit:[Xd,tu,ou,gu]}),mu=fu,yu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),xu=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 bu(t){return null!==t&&(null!==yu.exec(t)||null!==xu.exec(t))}function Cu(t){var e,r,i,n,s,a,o,l,c=0,h=null;if(null===(e=yu.exec(t))&&(e=xu.exec(t)),null===e)throw new Error("Date resolve error");
2if(r=+e[1],i=+e[2]-1,n=+e[3],!e[4])return new Date(Date.UTC(r,i,n));if(s=+e[4],a=+e[5],o=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(h=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(h=-h)),l=new Date(Date.UTC(r,i,n,s,a,o,c)),h&&l.setTime(l.getTime()-h),l}function wu(t){return t.toISOString()}_n(bu,"resolveYamlTimestamp"),_n(Cu,"constructYamlTimestamp"),_n(wu,"representYamlTimestamp");var ku=new qd("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:bu,construct:Cu,instanceOf:Date,represent:wu});function vu(t){return"<<"===t||null===t}_n(vu,"resolveYamlMerge");var Su=new qd("tag:yaml.org,2002:merge",{kind:"scalar",resolve:vu}),_u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function Tu(t){if(null===t)return!1;var e,r,i=0,n=t.length,s=_u;for(r=0;r<n;r++)if(!((e=s.indexOf(t.charAt(r)))>64)){if(e<0)return!1;i+=6}return i%8==0}function Au(t){var e,r,i=t.replace(/[\r\n=]/g,""),n=i.length,s=_u,a=0,o=[];for(e=0;e<n;e++)e%4==0&&e&&(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)),a=a<<6|s.indexOf(i.charAt(e));return 0==(r=n%4*6)?(o.push(a>>16&255),o.push(a>>8&255),o.push(255&a)):18===r?(o.push(a>>10&255),o.push(a>>2&255)):12===r&&o.push(a>>4&255),new Uint8Array(o)}function Bu(t){var e,r,i="",n=0,s=t.length,a=_u;for(e=0;e<s;e++)e%3==0&&e&&(i+=a[n>>18&63],i+=a[n>>12&63],i+=a[n>>6&63],i+=a[63&n]),n=(n<<8)+t[e];return 0==(r=s%3)?(i+=a[n>>18&63],i+=a[n>>12&63],i+=a[n>>6&63],i+=a[63&n]):2===r?(i+=a[n>>10&63],i+=a[n>>4&63],i+=a[n<<2&63],i+=a[64]):1===r&&(i+=a[n>>2&63],i+=a[n<<4&63],i+=a[64],i+=a[64]),i}function Mu(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}_n(Tu,"resolveYamlBinary"),_n(Au,"constructYamlBinary"),_n(Bu,"representYamlBinary"),_n(Mu,"isBinary");var Eu=new qd("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Tu,construct:Au,predicate:Mu,represent:Bu}),Lu=Object.prototype.hasOwnProperty,ju=Object.prototype.toString;function Fu(t){if(null===t)return!0;var e,r,i,n,s,a=[],o=t;for(e=0,r=o.length;e<r;e+=1){if(i=o[e],s=!1,"[object Object]"!==ju.call(i))return!1;for(n in i)if(Lu.call(i,n)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==a.indexOf(n))return!1;a.push(n)}return!0}function Nu(t){return null!==t?t:[]}_n(Fu,"resolveYamlOmap"),_n(Nu,"constructYamlOmap");var Iu=new qd("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Fu,construct:Nu}),Ou=Object.prototype.toString;function Du(t){if(null===t)return!0;var e,r,i,n,s,a=t;for(s=new Array(a.length),e=0,r=a.length;e<r;e+=1){if(i=a[e],"[object Object]"!==Ou.call(i))return!1;if(1!==(n=Object.keys(i)).length)return!1;s[e]=[n[0],i[n[0]]]}return!0}function Ru(t){if(null===t)return[];var e,r,i,n,s,a=t;for(s=new Array(a.length),e=0,r=a.length;e<r;e+=1)i=a[e],n=Object.keys(i),s[e]=[n[0],i[n[0]]];return s}_n(Du,"resolveYamlPairs"),_n(Ru,"constructYamlPairs");var zu=new qd("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Du,construct:Ru}),$u=Object.prototype.hasOwnProperty;function Pu(t){if(null===t)return!0;var e,r=t;for(e in r)if($u.call(r,e)&&null!==r[e])return!1;return!0}function qu(t){return null!==t?t:{}}_n(Pu,"resolveYamlSet"),_n(qu,"constructYamlSet");var Wu=new qd("tag:yaml.org,2002:set",{kind:"mapping",resolve:Pu,construct:qu}),Hu=mu.extend({implicit:[ku,Su],explicit:[Eu,Iu,zu,Wu]}),Vu=Object.prototype.hasOwnProperty,Yu=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Uu=/[\x85\u2028\u2029]/,Gu=/[,\[\]\{\}]/,Ju=/^(?:!|!!|![a-z\-]+!)$/i,Xu=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Ku(t){return Object.prototype.toString.call(t)}function Zu(t){return 10===t||13===t}function Qu(t){return 9===t||32===t}function tp(t){return 9===t||32===t||10===t||13===t}function ep(t){return 44===t||91===t||93===t||123===t||125===t}function rp(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function ip(t){return 120===t?2:117===t?4:85===t?8:0}function np(t){return 48<=t&&t<=57?t-48:-1}function sp(t){return 48===t?"\0":97===t?"�":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"�":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"…":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function ap(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}function op(t,e,r){"__proto__"===e?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}_n(Ku,"_class"),_n(Zu,"is_EOL"),_n(Qu,"is_WHITE_SPACE"),_n(tp,"is_WS_OR_EOL"),_n(ep,"is_FLOW_INDICATOR"),_n(rp,"fromHexCode"),_n(ip,"escapedHexLen"),_n(np,"fromDecimalCode"),_n(sp,"simpleEscapeSequence"),_n(ap,"charFromCodepoint"),_n(op,"setProperty");var lp,cp=new Array(256),hp=new Array(256);for(lp=0;lp<256;lp++)cp[lp]=sp(lp)?1:0,hp[lp]=sp(lp);function dp(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Hu,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.impl
vendor: 10,006 bytes, line 2
2icitTypes=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=[]}function up(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=Dd(r),new Fd(e,r)}function pp(t,e){throw up(t,e)}function gp(t,e){t.onWarning&&t.onWarning.call(null,up(t,e))}_n(dp,"State$1"),_n(up,"generateError"),_n(pp,"throwError"),_n(gp,"throwWarning");var fp={YAML:_n(function(t,e,r){var i,n,s;null!==t.version&&pp(t,"duplication of %YAML directive"),1!==r.length&&pp(t,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]))&&pp(t,"ill-formed argument of the YAML directive"),n=parseInt(i[1],10),s=parseInt(i[2],10),1!==n&&pp(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=s<2,1!==s&&2!==s&&gp(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:_n(function(t,e,r){var i,n;2!==r.length&&pp(t,"TAG directive accepts exactly two arguments"),i=r[0],n=r[1],Ju.test(i)||pp(t,"ill-formed tag handle (first argument) of the TAG directive"),Vu.call(t.tagMap,i)&&pp(t,'there is a previously declared suffix for "'+i+'" tag handle'),Xu.test(n)||pp(t,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch(s){pp(t,"tag prefix is malformed: "+n)}t.tagMap[i]=n},"handleTagDirective")};function mp(t,e,r,i){var n,s,a,o;if(e<r){if(o=t.input.slice(e,r),i)for(n=0,s=o.length;n<s;n+=1)9===(a=o.charCodeAt(n))||32<=a&&a<=1114111||pp(t,"expected valid JSON character");else Yu.test(o)&&pp(t,"the stream contains non-printable characters");t.result+=o}}function yp(t,e,r,i){var n,s,a,o;for(Ed.isObject(r)||pp(t,"cannot merge mappings; the provided source object is unacceptable"),a=0,o=(n=Object.keys(r)).length;a<o;a+=1)s=n[a],Vu.call(e,s)||(op(e,s,r[s]),i[s]=!0)}function xp(t,e,r,i,n,s,a,o,l){var c,h;if(Array.isArray(n))for(c=0,h=(n=Array.prototype.slice.call(n)).length;c<h;c+=1)Array.isArray(n[c])&&pp(t,"nested arrays are not supported inside keys"),"object"==typeof n&&"[object Object]"===Ku(n[c])&&(n[c]="[object Object]");if("object"==typeof n&&"[object Object]"===Ku(n)&&(n="[object Object]"),n=String(n),null===e&&(e={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(s))for(c=0,h=s.length;c<h;c+=1)yp(t,e,s[c],r);else yp(t,e,s,r);else t.json||Vu.call(r,n)||!Vu.call(e,n)||(t.line=a||t.line,t.lineStart=o||t.lineStart,t.position=l||t.position,pp(t,"duplicated mapping key")),op(e,n,s),delete r[n];return e}function bp(t){var e;10===(e=t.input.charCodeAt(t.position))?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):pp(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Cp(t,e,r){for(var i=0,n=t.input.charCodeAt(t.position);0!==n;){for(;Qu(n);)9===n&&-1===t.firstTabInLine&&(t.firstTabInLine=t.position),n=t.input.charCodeAt(++t.position);if(e&&35===n)do{n=t.input.charCodeAt(++t.position)}while(10!==n&&13!==n&&0!==n);if(!Zu(n))break;for(bp(t),n=t.input.charCodeAt(t.position),i++,t.lineIndent=0;32===n;)t.lineIndent++,n=t.input.charCodeAt(++t.position)}return-1!==r&&0!==i&&t.lineIndent<r&&gp(t,"deficient indentation"),i}function wp(t){var e,r=t.position;return!(45!==(e=t.input.charCodeAt(r))&&46!==e||e!==t.input.charCodeAt(r+1)||e!==t.input.charCodeAt(r+2)||(r+=3,0!==(e=t.input.charCodeAt(r))&&!tp(e)))}function kp(t,e){1===e?t.result+=" ":e>1&&(t.result+=Ed.repeat("\n",e-1))}function vp(t,e,r){var i,n,s,a,o,l,c,h,d=t.kind,u=t.result;if(tp(h=t.input.charCodeAt(t.position))||ep(h)||35===h||38===h||42===h||33===h||124===h||62===h||39===h||34===h||37===h||64===h||96===h)return!1;if((63===h||45===h)&&(tp(i=t.input.charCodeAt(t.position+1))||r&&ep(i)))return!1;for(t.kind="scalar",t.result="",n=s=t.position,a=!1;0!==h;){if(58===h){if(tp(i=t.input.charCodeAt(t.position+1))||r&&ep(i))break}else if(35===h){if(tp(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&wp(t)||r&&ep(h))break;if(Zu(h)){if(o=t.line,l=t.lineStart,c=t.lineIndent,Cp(t,!1,-1),t.lineIndent>=e){a=!0,h=t.input.charCodeAt(t.position);continue}t.position=s,t.line=o,t.lineStart=l,t.lineIndent=c;break}}a&&(mp(t,n,s,!1),kp(t,t.line-o),n=s=t.position,a=!1),Qu(h)||(s=t.position+1),h=t.input.charCodeAt(++t.position)}return mp(t,n,s,!1),!!t.result||(t.kind=d,t.result=u,!1)}function Sp(t,e){var r,i,n;if(39!==(r=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,i=n=t.position;0!==(r=t.input.charCodeAt(t.position));)if(39===r){if(mp(t,i,t.position,!0),39!==(r=t.input.charCodeAt(++t.position)))return!0;i=t.position,t.position++,n=t.position}else Zu(r)?(mp(t,i,n,!0),kp(t,Cp(t,!1,e)),i=n=t.position):t.position===t.lineStart&&wp(t)?pp(t,"unexpected end of the document within a single quoted scalar"):(t.position++,n=t.position);pp(t,"unexpected end of the stream within a single quoted scalar")}function _p(t,e){var r,i,n,s,a,o;if(34!==(o=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;0!==(o=t.input.charCodeAt(t.position));){if(34===o)return mp(t,r,t.position,!0),t.position++,!0;if(92===o){if(mp(t,r,t.position,!0),Zu(o=t.input.charCodeAt(++t.position)))Cp(t,!1,e);else if(o<256&&cp[o])t.result+=hp[o],t.position++;else if((a=ip(o))>0){for(n=a,s=0;n>0;n--)(a=rp(o=t.input.charCodeAt(++t.position)))>=0?s=(s<<4)+a:pp(t,"expected hexadecimal character");t.result+=ap(s),t.position++}else pp(t,"unknown escape sequence");r=i=t.position}else Zu(o)?(mp(t,r,i,!0),kp(t,Cp(t,!1,e)),r=i=t.position):t.position===t.lineStart&&wp(t)?pp(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}pp(t,"unexpected end of the stream within a double quoted scalar")}function Tp(t,e){var r,i,n,s,a,o,l,c,h,d,u,p,g=!0,f=t.tag,m=t.anchor,y=Object.create(null);if(91===(p=t.input.charCodeAt(t.position)))a=93,c=!1,s=[];else{if(123!==p)return!1;a=125,c=!0,s={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=s),p=t.input.charCodeAt(++t.position);0!==p;){if(Cp(t,!0,e),(p=t.input.charCodeAt(t.position))===a)return t.position++,t.tag=f,t.anchor=m,t.kind=c?"mapping":"sequence",t.result=s,!0;g?44===p&&pp(t,"expected the node content, but found ','"):pp(t,"missed comma between flow collection entries"),u=null,o=l=!1,63===p&&tp(t.input.charCodeAt(t.position+1))&&(o=l=!0,t.position++,Cp(t,!0,e)),r=t.line,i=t.lineStart,n=t.position,Fp(t,e,1,!1,!0),d=t.tag,h=t.result,Cp(t,!0,e),p=t.input.charCodeAt(t.position),!l&&t.line!==r||58!==p||(o=!0,p=t.input.charCodeAt(++t.position),Cp(t,!0,e),Fp(t,e,1,!1,!0),u=t.result),c?xp(t,s,y,d,h,u,r,i,n):o?s.push(xp(t,null,y,d,h,u,r,i,n)):s.push(h),Cp(t,!0,e),44===(p=t.input.charCodeAt(t.position))?(g=!0,p=t.input.charCodeAt(++t.position)):g=!1}pp(t,"unexpected end of the stream within a flow collection")}function Ap(t,e){var r,i,n,s,a=1,o=!1,l=!1,c=e,h=0,d=!1;if(124===(s=t.input.charCodeAt(t.position)))i=!1;else{if(62!==s)return!1;i=!0}for(t.kind="scalar",t.result="";0!==s;)if(43===(s=t.input.charCodeAt(++t.position))||45===s)1===a?a=43===s?3:2:pp(t,"repeat of a chomping mode identifier");else{if(!((n=np(s))>=0))break;0===n?pp(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?pp(t,"repeat of an indentation width identifier"):(c=e+n-1,l=!0)}if(Qu(s)){do{s=t.input.charCodeAt(++t.position)}while(Qu(s));if(35===s)do{s=t.input.charCodeAt(++t.position)}while(!Zu(s)&&0!==s)}for(;0!==s;){for(bp(t),t.lineIndent=0,s=t.input.charCodeAt(t.position);(!l||t.lineIndent<c)&&32===s;)t.lineIndent++,s=t.input.charCodeAt(++t.position);if(!l&&t.lineIndent>c&&(c=t.lineIndent),Zu(s))h++;else{if(t.lineIndent<c){3===a?t.result+=Ed.repeat("\n",o?1+h:h):1===a&&o&&(t.result+="\n");break}for(i?Qu(s)?(d=!0,t.result+=Ed.repeat("\n",o?1+h:h)):d?(d=!1,t.result+=Ed.repeat("\n",h+1)):0===h?o&&(t.result+=" "):t.result+=Ed.repeat("\n",h):t.result+=Ed.repeat("\n",o?1+h:h),o=!0,l=!0,h=0,r=t.position;!Zu(s)&&0!==s;)s=t.input.charCodeAt(++t.position);mp(t,r,t.position,!1)}}return!0}function Bp(t,e){var r,i,n=t.tag,s=t.anchor,a=[],o=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),i=t.input.charCodeAt(t.position);0!==i&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,pp(t,"tab characters must not be used in indentation")),45===i)&&tp(t.input.charCodeAt(t.position+1));)if(o=!0,t.position++,Cp(t,!0,-1)&&t.lineIndent<=e)a.push(null),i=t.input.charCodeAt(t.position);else if(r=t.line,Fp(t,e,3,!1,!0),a.push(t.result),Cp(t,!0,-1),i=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&0!==i)pp(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!o&&(t.tag=n,t.anchor=s,t.kind="sequence",t.result=a,!0)}function Mp(t,e,r){var i,n,s,a,o,l,c,h=t.tag,d=t.anchor,u={},p=Object.create(null),g=null,f=null,m=null,y=!1,x=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=u),c=t.input.charCodeAt(t.position);0!==c;){if(y||-1===t.firstTabInLine||(t.position=t.firstTabInLine,pp(t,"tab characters must not be used in indentation")),i=t.input.charCodeAt(t.position+1),s=t.line,63!==c&&58!==c||!tp(i)){if(a=t.line,o=t.lineStart,l=t.position,!Fp(t,r,2,!1,!0))break;if(t.line===s){for(c=t.input.charCodeAt(t.position);Qu(c);)c=t.input.charCodeAt(++t.position);if(58===c)tp(c=t.input.charCodeAt(++t.position))||pp(t,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(xp(t,u,p,g,f,null,a,o,l),g=f=m=null),x=!0,y=!1,n=!1,g=t.tag,f=t.result;else{if(!x)return t.tag=h,t.anchor=d,!0;pp(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!x)return t.tag=h,t.anchor=d,!0;pp(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(y&&(xp(t,u,p,g,f,null,a,o,l),g=f=m=null),x=!0,y=!0,n=!0):y?(y=!1,n=!0):pp(t,"incomplete explicit mapping pair; a key node is missed;
2 or followed by a non-tabulated empty line"),t.position+=1,c=i;if((t.line===s||t.lineIndent>e)&&(y&&(a=t.line,o=t.lineStart,l=t.position),Fp(t,e,4,!0,n)&&(y?f=t.result:m=t.result),y||(xp(t,u,p,g,f,m,a,o,l),g=f=m=null),Cp(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&0!==c)pp(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return y&&xp(t,u,p,g,f,null,a,o,l),x&&(t.tag=h,t.anchor=d,t.kind="mapping",t.result=u),x}function Ep(t){var e,r,i,n,s=!1,a=!1;if(33!==(n=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&pp(t,"duplication of a tag property"),60===(n=t.input.charCodeAt(++t.position))?(s=!0,n=t.input.charCodeAt(++t.position)):33===n?(a=!0,r="!!",n=t.input.charCodeAt(++t.position)):r="!",e=t.position,s){do{n=t.input.charCodeAt(++t.position)}while(0!==n&&62!==n);t.position<t.length?(i=t.input.slice(e,t.position),n=t.input.charCodeAt(++t.position)):pp(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==n&&!tp(n);)33===n&&(a?pp(t,"tag suffix cannot contain exclamation marks"):(r=t.input.slice(e-1,t.position+1),Ju.test(r)||pp(t,"named tag handle cannot contain such characters"),a=!0,e=t.position+1)),n=t.input.charCodeAt(++t.position);i=t.input.slice(e,t.position),Gu.test(i)&&pp(t,"tag suffix cannot contain flow indicator characters")}i&&!Xu.test(i)&&pp(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch(o){pp(t,"tag name is malformed: "+i)}return s?t.tag=i:Vu.call(t.tagMap,r)?t.tag=t.tagMap[r]+i:"!"===r?t.tag="!"+i:"!!"===r?t.tag="tag:yaml.org,2002:"+i:pp(t,'undeclared tag handle "'+r+'"'),!0}function Lp(t){var e,r;if(38!==(r=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&pp(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!tp(r)&&!ep(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&pp(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function jp(t){var e,r,i;if(42!==(i=t.input.charCodeAt(t.position)))return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!tp(i)&&!ep(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&pp(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),Vu.call(t.anchorMap,r)||pp(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],Cp(t,!0,-1),!0}function Fp(t,e,r,i,n){var s,a,o,l,c,h,d,u,p,g=1,f=!1,m=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s=a=o=4===r||3===r,i&&Cp(t,!0,-1)&&(f=!0,t.lineIndent>e?g=1:t.lineIndent===e?g=0:t.lineIndent<e&&(g=-1)),1===g)for(;Ep(t)||Lp(t);)Cp(t,!0,-1)?(f=!0,o=s,t.lineIndent>e?g=1:t.lineIndent===e?g=0:t.lineIndent<e&&(g=-1)):o=!1;if(o&&(o=f||n),1!==g&&4!==r||(u=1===r||2===r?e:e+1,p=t.position-t.lineStart,1===g?o&&(Bp(t,p)||Mp(t,p,u))||Tp(t,u)?m=!0:(a&&Ap(t,u)||Sp(t,u)||_p(t,u)?m=!0:jp(t)?(m=!0,null===t.tag&&null===t.anchor||pp(t,"alias node should not have any properties")):vp(t,u,1===r)&&(m=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===g&&(m=o&&Bp(t,p))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&pp(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),l=0,c=t.implicitTypes.length;l<c;l+=1)if((d=t.implicitTypes[l]).resolve(t.result)){t.result=d.construct(t.result),t.tag=d.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else if("!"!==t.tag){if(Vu.call(t.typeMap[t.kind||"fallback"],t.tag))d=t.typeMap[t.kind||"fallback"][t.tag];else for(d=null,l=0,c=(h=t.typeMap.multi[t.kind||"fallback"]).length;l<c;l+=1)if(t.tag.slice(0,h[l].tag.length)===h[l].tag){d=h[l];break}d||pp(t,"unknown tag !<"+t.tag+">"),null!==t.result&&d.kind!==t.kind&&pp(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+d.kind+'", not "'+t.kind+'"'),d.resolve(t.result,t.tag)?(t.result=d.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):pp(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||m}function Np(t){var e,r,i,n,s=t.position,a=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(n=t.input.charCodeAt(t.position))&&(Cp(t,!0,-1),n=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==n));){for(a=!0,n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!tp(n);)n=t.input.charCodeAt(++t.position);for(i=[],(r=t.input.slice(e,t.position)).length<1&&pp(t,"directive name must not be less than one character in length");0!==n;){for(;Qu(n);)n=t.input.charCodeAt(++t.position);if(35===n){do{n=t.input.charCodeAt(++t.position)}while(0!==n&&!Zu(n));break}if(Zu(n))break;for(e=t.position;0!==n&&!tp(n);)n=t.input.charCodeAt(++t.position);i.push(t.input.slice(e,t.position))}0!==n&&bp(t),Vu.call(fp,r)?fp[r](t,r,i):gp(t,'unknown document directive "'+r+'"')}Cp(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,Cp(t,!0,-1)):a&&pp(t,"directives end mark is expected"),Fp(t,t.lineIndent-1,4,!1,!0),Cp(t,!0,-1),t.checkLineBreaks&&Uu.test(t.input.slice(s,t.position))&&gp(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&wp(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,Cp(t,!0,-1)):t.position<t.length-1&&pp(t,"end of the stream or a document separator is expected")}function Ip(t,e){e=e||{},0!==(t=String(t)).length&&(10!==t.charCodeAt(t.length-1)&&13!==t.charCodeAt(t.length-1)&&(t+="\n"),65279===t.charCodeAt(0)&&(t=t.slice(1)));var r=new dp(t,e),i=t.indexOf("\0");for(-1!==i&&(r.position=i,pp(r,"null byte is not allowed in input")),r.input+="\0";32===r.input.charCodeAt(r.position);)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Np(r);return r.documents}function Op(t,e){var r=Ip(t,e);if(0!==r.length){if(1===r.length)return r[0];throw new Fd("expected a single document in the stream, but found more")}}_n(mp,"captureSegment"),_n(yp,"mergeMappings"),_n(xp,"storeMappingPair"),_n(bp,"readLineBreak"),_n(Cp,"skipSeparationSpace"),_n(wp,"testDocumentSeparator"),_n(kp,"writeFoldedLines"),_n(vp,"readPlainScalar"),_n(Sp,"readSingleQuotedScalar"),_n(_p,"readDoubleQuotedScalar"),_n(Tp,"readFlowCollection"),_n(Ap,"readBlockScalar"),_n(Bp,"readBlockSequence"),_n(Mp,"readBlockMapping"),_n(Ep,"readTagProperty"),_n(Lp,"readAnchorProperty"),_n(jp,"readAlias"),_n(Fp,"composeNode"),_n(Np,"readDocument"),_n(Ip,"loadDocuments"),_n(function(t,e,r){null!==e&&"object"==typeof e&&void 0===r&&(r=e,e=null);var i=Ip(t,r);if("function"!=typeof e)return i;for(var n=0,s=i.length;n<s;n+=1)e(i[n])},"loadAll$1"),_n(Op,"load$1");var Dp=Op,Rp=Object.prototype.toString,zp=Object.prototype.hasOwnProperty,$p=65279,Pp={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},qp=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Wp=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Hp(t,e){var r,i,n,s,a,o,l;if(null===e)return{};for(r={},n=0,s=(i=Object.keys(e)).length;n<s;n+=1)a=i[n],o=String(e[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(l=t.compiledTypeMap.fallback[a])&&zp.call(l.styleAliases,o)&&(o=l.styleAliases[o]),r[a]=o;return r}function Vp(t){var e,r,i;if(e=t.toString(16).toUpperCase(),t<=255)r="x",i=2;else if(t<=65535)r="u",i=4;else{if(!(t<=4294967295))throw new Fd("code point within a string may not be greater than 0xFFFFFFFF");r="U",i=8}return"\\"+r+Ed.repeat("0",i-e.length)+e}function Yp(t){this.schema=t.schema||Hu,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Ed.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=Hp(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType='"'===t.quotingType?2:1,this.forceQuotes=t.forceQuotes||!1,this.replacer="function"==typeof t.replacer?t.replacer:null,this.impl
vendor: 4,147 bytes, line 2
2icitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Up(t,e){for(var r,i=Ed.repeat(" ",e),n=0,s=-1,a="",o=t.length;n<o;)-1===(s=t.indexOf("\n",n))?(r=t.slice(n),n=o):(r=t.slice(n,s+1),n=s+1),r.length&&"\n"!==r&&(a+=i),a+=r;return a}function Gp(t,e){return"\n"+Ed.repeat(" ",t.indent*e)}function Jp(t,e){var r,i;for(r=0,i=t.implicitTypes.length;r<i;r+=1)if(t.implicitTypes[r].resolve(e))return!0;return!1}function Xp(t){return 32===t||9===t}function Kp(t){return 32<=t&&t<=126||161<=t&&t<=55295&&8232!==t&&8233!==t||57344<=t&&t<=65533&&t!==$p||65536<=t&&t<=1114111}function Zp(t){return Kp(t)&&t!==$p&&13!==t&&10!==t}function Qp(t,e,r){var i=Zp(t),n=i&&!Xp(t);return(r?i:i&&44!==t&&91!==t&&93!==t&&123!==t&&125!==t)&&35!==t&&!(58===e&&!n)||Zp(e)&&!Xp(e)&&35===t||58===e&&n}function tg(t){return Kp(t)&&t!==$p&&!Xp(t)&&45!==t&&63!==t&&58!==t&&44!==t&&91!==t&&93!==t&&123!==t&&125!==t&&35!==t&&38!==t&&42!==t&&33!==t&&124!==t&&61!==t&&62!==t&&39!==t&&34!==t&&37!==t&&64!==t&&96!==t}function eg(t){return!Xp(t)&&58!==t}function rg(t,e){var r,i=t.charCodeAt(e);return i>=55296&&i<=56319&&e+1<t.length&&(r=t.charCodeAt(e+1))>=56320&&r<=57343?1024*(i-55296)+r-56320+65536:i}function ig(t){return/^\n* /.test(t)}function ng(t,e,r,i,n,s,a,o){var l,c=0,h=null,d=!1,u=!1,p=-1!==i,g=-1,f=tg(rg(t,0))&&eg(rg(t,t.length-1));if(e||a)for(l=0;l<t.length;c>=65536?l+=2:l++){if(!Kp(c=rg(t,l)))return 5;f=f&&Qp(c,h,o),h=c}else{for(l=0;l<t.length;c>=65536?l+=2:l++){if(10===(c=rg(t,l)))d=!0,p&&(u=u||l-g-1>i&&" "!==t[g+1],g=l);else if(!Kp(c))return 5;f=f&&Qp(c,h,o),h=c}u=u||p&&l-g-1>i&&" "!==t[g+1]}return d||u?r>9&&ig(t)?5:a?2===s?5:2:u?4:3:!f||a||n(t)?2===s?5:2:1}function sg(t,e,r,i,n){t.dump=function(){if(0===e.length)return 2===t.quotingType?'""':"''";if(!t.noCompatMode&&(-1!==qp.indexOf(e)||Wp.test(e)))return 2===t.quotingType?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,r),a=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),o=i||t.flowLevel>-1&&r>=t.flowLevel;function l(e){return Jp(t,e)}switch(_n(l,"testAmbiguity"),ng(e,o,t.indent,a,l,t.quotingType,t.forceQuotes&&!i,n)){case 1:return e;case 2:return"'"+e.replace(/'/g,"''")+"'";case 3:return"|"+ag(e,t.indent)+og(Up(e,s));case 4:return">"+ag(e,t.indent)+og(Up(lg(e,a),s));case 5:return'"'+hg(e)+'"';default:throw new Fd("impossible error: invalid scalar style")}}()}function ag(t,e){var r=ig(t)?String(e):"",i="\n"===t[t.length-1];return r+(!i||"\n"!==t[t.length-2]&&"\n"!==t?i?"":"-":"+")+"\n"}function og(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function lg(t,e){for(var r,i,n,s=/(\n+)([^\n]*)/g,a=(r=-1!==(r=t.indexOf("\n"))?r:t.length,s.lastIndex=r,cg(t.slice(0,r),e)),o="\n"===t[0]||" "===t[0];n=s.exec(t);){var l=n[1],c=n[2];i=" "===c[0],a+=l+(o||i||""===c?"":"\n")+cg(c,e),o=i}return a}function cg(t,e){if(""===t||" "===t[0])return t;for(var r,i,n=/ [^ ]/g,s=0,a=0,o=0,l="";r=n.exec(t);)(o=r.index)-s>e&&(i=a>s?a:o,l+="\n"+t.slice(s,i),s=i+1),a=o;return l+="\n",t.length-s>e&&a>s?l+=t.slice(s,a)+"\n"+t.slice(a+1):l+=t.slice(s),l.slice(1)}function hg(t){for(var e,r="",i=0,n=0;n<t.length;i>=65536?n+=2:n++)i=rg(t,n),!(e=Pp[i])&&Kp(i)?(r+=t[n],i>=65536&&(r+=t[n+1])):r+=e||Vp(i);return r}function dg(t,e,r){var i,n,s,a="",o=t.tag;for(i=0,n=r.length;i<n;i+=1)s=r[i],t.replacer&&(s=t.replacer.call(r,String(i),s)),(mg(t,e,s,!1,!1)||void 0===s&&mg(t,e,null,!1,!1))&&(""!==a&&(a+=","+(t.condenseFlow?"":" ")),a+=t.dump);t.tag=o,t.dump="["+a+"]"}function ug(t,e,r,i){var n,s,a,o="",l=t.tag;for(n=0,s=r.length;n<s;n+=1)a=r[n],t.replacer&&(a=t.replacer.call(r,String(n),a)),(mg(t,e+1,a,!0,!0,!1,!0)||void 0===a&&mg(t,e+1,null,!0,!0,!1,!0))&&(i&&""===o||(o+=Gp(t,e)),t.dump&&10===t.dump.charCodeAt(0)?o+="-":o+="- ",o+=t.dump);t.tag=l,t.dump=o||"[]"}function pg(t,e,r){var i,n,s,a,o,l="",c=t.tag,h=Object.keys(r);for(i=0,n=h.length;i<n;i+=1)o="",""!==l&&(o+=", "),t.condenseFlow&&(o+='"'),a=r[s=h[i]],t.replacer&&(a=t.replacer.call(r,s,a)),mg(t,e,s,!1,!1)&&(t.dump.length>1024&&(o+="? "),o+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),mg(t,e,a,!1,
2!1)&&(l+=o+=t.dump));t.tag=c,t.dump="{"+l+"}"}function gg(t,e,r,i){var n,s,a,o,l,c,h="",d=t.tag,u=Object.keys(r);if(!0===t.sortKeys)u.sort();else if("function"==typeof t.sortKeys)u.sort(t.sortKeys);else if(t.sortKeys)throw new Fd("sortKeys must be a boolean or a function");for(n=0,s=u.length;n<s;n+=1)c="",i&&""===h||(c+=Gp(t,e)),o=r[a=u[n]],t.replacer&&(o=t.replacer.call(r,a,o)),mg(t,e+1,a,!0,!0,!0)&&((l=null!==t.tag&&"?"!==t.tag||t.dump&&t.dump.length>1024)&&(t.dump&&10===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,l&&(c+=Gp(t,e)),mg(t,e+1,o,!0,l)&&(t.dump&&10===t.dump.charCodeAt(0)?c+=":":c+=": ",h+=c+=t.dump));t.tag=d,t.dump=h||"{}"}function fg(t,e,r){var i,n,s,a,o,l;for(s=0,a=(n=r?t.explicitTypes:t.implicitTypes).length;s<a;s+=1)if(((o=n[s]).instanceOf||o.predicate)&&(!o.instanceOf||"object"==typeof e&&e instanceof o.instanceOf)&&(!o.predicate||o.predicate(e))){if(r?o.multi&&o.representName?t.tag=o.representName(e):t.tag=o.tag:t.tag="?",o.represent){if(l=t.styleMap[o.tag]||o.defaultStyle,"[object Function]"===Rp.call(o.represent))i=o.represent(e,l);else{if(!zp.call(o.represent,l))throw new Fd("!<"+o.tag+'> tag resolver accepts not "'+l+'" style');i=o.represent[l](e,l)}t.dump=i}return!0}return!1}function mg(t,e,r,i,n,s,a){t.tag=null,t.dump=r,fg(t,r,!1)||fg(t,r,!0);var o,l=Rp.call(t.dump),c=i;i&&(i=t.flowLevel<0||t.flowLevel>e);var h,d,u="[object Object]"===l||"[object Array]"===l;if(u&&(d=-1!==(h=t.duplicates.indexOf(r))),(null!==t.tag&&"?"!==t.tag||d||2!==t.indent&&e>0)&&(n=!1),d&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(u&&d&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),"[object Object]"===l)i&&0!==Object.keys(t.dump).length?(gg(t,e,t.dump,n),d&&(t.dump="&ref_"+h+t.dump)):(pg(t,e,t.dump),d&&(t.dump="&ref_"+h+" "+t.dump));else if("[object Array]"===l)i&&0!==t.dump.length?(t.noArrayIndent&&!a&&e>0?ug(t,e-1,t.dump,n):ug(t,e,t.dump,n),d&&(t.dump="&ref_"+h+t.dump)):(dg(t,e,t.dump),d&&(t.dump="&ref_"+h+" "+t.dump));else{if("[object String]"!==l){if("[object Undefined]"===l)return!1;if(t.skipInvalid)return!1;throw new Fd("unacceptable kind of an object to dump "+l)}"?"!==t.tag&&sg(t,t.dump,e,s,c)}null!==t.tag&&"?"!==t.tag&&(o=encodeURI("!"===t.tag[0]?t.tag.slice(1):t.tag).replace(/!/g,"%21"),o="!"===t.tag[0]?"!"+o:"tag:yaml.org,2002:"===o.slice(0,18)?"!!"+o.slice(18):"!<"+o+">",t.dump=o+" "+t.dump)}return!0}function yg(t,e){var r,i,n=[],s=[];for(xg(t,n,s),r=0,i=s.length;r<i;r+=1)e.duplicates.push(n[s[r]]);e.usedDuplicates=new Array(i)}function xg(t,e,r){var i,n,s;if(null!==t&&"object"==typeof t)if(-1!==(n=e.indexOf(t)))-1===r.indexOf(n)&&r.push(n);else if(e.push(t),Array.isArray(t))for(n=0,s=t.length;n<s;n+=1)xg(t[n],e,r);else for(n=0,s=(i=Object.keys(t)).length;n<s;n+=1)xg(t[i[n]],e,r)}_n(Hp,"compileStyleMap"),_n(Vp,"encodeHex"),_n(Yp,"State"),_n(Up,"indentString"),_n(Gp,"generateNextLine"),_n(Jp,"testImplicitResolving"),_n(Xp,"isWhitespace"),_n(Kp,"isPrintable"),_n(Zp,"isNsCharOrWhitespace"),_n(Qp,"isPlainSafe"),_n(tg,"isPlainSafeFirst"),_n(eg,"isPlainSafeLast"),_n(rg,"codePointAt"),_n(ig,"needIndentIndicator"),_n(ng,"chooseScalarStyle"),_n(sg,"writeScalar"),_n(ag,"blockHeader"),_n(og,"dropEndingNewline"),_n(lg,"foldString"),_n(cg,"foldLine"),_n(hg,"escapeString"),_n(dg,"writeFlowSequence"),_n(ug,"writeBlockSequence"),_n(pg,"writeFlowMapping"),_n(gg,"writeBlockMapping"),_n(fg,"detectType"),_n(mg,"writeNode"),_n(yg,"getDuplicateReferences"),_n(xg,"inspectNode"),_n(function(t,e){var r=new Yp(e=e||{});r.noRefs||yg(t,r);var i=t;return r.replacer&&(i=r.replacer.call({"":i},"",i)),mg(r,0,i,!0,!0)?r.dump+"\n":""},"dump$1"),_n(function(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}},"renamed");var bg=fu,Cg=Dp,wg=_n((t,e)=>{if(e)return"translate("+-t.width/2+", "+-t.height/2+")";const r=t.x??0,i=t.y??0;return"translate("+-(r+t.width/2)+", "+-(i+t.height/2)+")"},"computeLabelTransform"),kg={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},vg={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function Sg(t,e){if(void 0===t||void 0===e)return{angle:0,deltaX:0,deltaY:0};t=_g(t),e=_g(e);const[r,i]=[t.x,t.y],[n,s]=[e.x,e.y],a=n-r,o=s-i;return{angle:Math.atan(o/a),deltaX:a,deltaY:o}}_n(Sg,"calculateDeltaAndAngle");var _g=_n(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),Tg=_n(t=>({x:_n(function(e,r,i){let n=0;const s=_g(i[0]).x<_g(i[i.length-1]).x?"left":"right";if(0===r&&Object.hasOwn(kg,t.arrowTypeStart)){const{angle:e,deltaX:r}=Sg(i[0],i[1]);n=kg[t.arrowTypeStart]*Math.cos(e)*(r>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(kg,t.arrowTypeEnd)){const{angle:e,deltaX:r}=Sg(i[i.length-1],i[i.length-2]);n=kg[t.arrowTypeEnd]*Math.cos(e)*(r>=0?1:-1)}const a=Math.abs(_g(e).x-_g(i[i.length-1]).x),o=Math.abs(_g(e).y-_g(i[i.length-1]).y),l=Math.abs(_g(e).x-_g(i[0]).x),c=Math.abs(_g(e).y-_g(i[0]).y),h=kg[t.arrowTypeStart],d=kg[t.arrowTypeEnd];if(a<d&&a>0&&o<d){let t=d+1-a;t*="right"===s?-1:1,n-=t}if(l<h&&l>0&&c<h){let t=h+1-l;t*="right"===s?-1:1,n+=t}return _g(e).x+n},"x"),y:_n(function(e,r,i){let n=0;const s=_g(i[0]).y<_g(i[i.length-1]).y?"down":"up";if(0===r&&Object.hasOwn(kg,t.arrowTypeStart)){const{angle:e,deltaY:r}=Sg(i[0],i[1]);n=kg[t.arrowTypeStart]*Math.abs(Math.sin(e))*(r>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(kg,t.arrowTypeEnd)){const{angle:e,deltaY:r}=Sg(i[i.length-1],i[i.length-2]);n=kg[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(r>=0?1:-1)}const a=Math.abs(_g(e).y-_g(i[i.length-1]).y),o=Math.abs(_g(e).x-_g(i[i.length-1]).x),l=Math.abs(_g(e).y-_g(i[0]).y),c=Math.abs(_g(e).x-_g(i[0]).x),h=kg[t.arrowTypeStart],d=kg[t.arrowTypeEnd];if(a<d&&a>0&&o<d){let t=d+1-a;t*="up"===s?-1:1,n-=t}if(l<h&&l>0&&c<h){let t=h+1-l;t*="up"===s?-1:1,n+=t}return _g(e).y+n},"y")}),"getLineFunctionsWithOffset"),Ag={},Bg={};
2Object.defineProperty(Bg,"__esModule",{value:!0}),Bg.BLANK_URL=Bg.relativeFirstCharacters=Bg.whitespaceEscapeCharsRegex=Bg.urlSchemeRegex=Bg.ctrlCharactersRegex=Bg.htmlCtrlEntityRegex=Bg.htmlEntitiesRegex=Bg.invalidProtocolRegex=void 0,Bg.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Bg.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Bg.htmlCtrlEntityRegex=/&(newline|tab);/gi,Bg.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Bg.urlSchemeRegex=/^.+(:|&colon;)/gim,Bg.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Bg.relativeFirstCharacters=[".","/"],Bg.BLANK_URL="about:blank",Object.defineProperty(Ag,"__esModule",{value:!0});var Mg=Ag.sanitizeUrl=function(t){if(!t)return Eg.BLANK_URL;var e,r=jg(t.trim());do{e=(r=jg(r=Lg(r).replace(Eg.htmlCtrlEntityRegex,"").replace(Eg.ctrlCharactersRegex,"").replace(Eg.whitespaceEscapeCharsRegex,"").trim())).match(Eg.ctrlCharactersRegex)||r.match(Eg.htmlEntitiesRegex)||r.match(Eg.htmlCtrlEntityRegex)||r.match(Eg.whitespaceEscapeCharsRegex)}while(e&&e.length>0);var i=r;if(!i)return Eg.BLANK_URL;if(function(t){return Eg.relativeFirstCharacters.indexOf(t[0])>-1}(i))return i;var n=i.trimStart(),s=n.match(Eg.urlSchemeRegex);if(!s)return i;var a=s[0].toLowerCase().trim();if(Eg.invalidProtocolRegex.test(a))return Eg.BLANK_URL;var o=n.replace(/\\/g,"/");if("mailto:"===a||a.includes("://"))return o;if("http:"===a||"https:"===a){if(!function(t){return URL.canParse(t)}(o))return Eg.BLANK_URL;var l=new URL(o);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return o},Eg=Bg;function Lg(t){return t.replace(Eg.ctrlCharactersRegex,"").replace(Eg.htmlEntitiesRegex,function(t,e){return String.fromCharCode(e)})}function jg(t){try{return decodeURIComponent(t)}catch(e){return t}}var Fg="​",Ng={curveBasis:$h,curveBasisClosed:function(t){return new Ph(t)},curveBasisOpen:function(t){return new qh(t)},curveBumpX:Ih,curveBumpY:Oh,curveBundle:Hh,curveCardinalClosed:Jh,curveCardinalOpen:Kh,curveCardinal:Uh,curveCatmullRomClosed:rd,curveCatmullRomOpen:nd,curveCatmullRom:td,curveLinear:Eh,curveLinearClosed:function(t){return new sd(t)},curveMonotoneX:pd,curveMonotoneY:gd,curveNatural:yd,curveStep:bd,curveStepAfter:wd,curveStepBefore:Cd},Ig=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Og=_n(function(t,e){const r=Dg(t,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const t=r.map(t=>t.args);_s(t),i=as(i,[...t])}else i=r.args;if(!i)return;let n=es(t,e);const s="config";return void 0!==i[s]&&("flowchart-v2"===n&&(n="flowchart"),i[n]=i[s],delete i[s]),i},"detectInit"),Dg=_n(function(t,e=null){try{const r=new RegExp(`[%]{2}(?![{]${Ig.source})(?=[}][%]{2}).*\n`,"ig");let i;t=t.trim().replace(r,"").replace(/'/gm,'"'),Bn.debug(`Detecting diagram directive${null!==e?" type:"+e:""} based on the text:${t}`);const n=[];for(;null!==(i=Kn.exec(t));)if(i.index===Kn.lastIndex&&Kn.lastIndex++,i&&!e||e&&i[1]?.match(e)||e&&i[2]?.match(e)){const t=i[1]?i[1]:i[2],e=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;n.push({type:t,args:e})}return 0===n.length?{type:t,args:null}:1===n.length?n[0]:n}catch(r){return Bn.error(`ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),Rg=_n(function(t){return t.replace(Kn,"")},"removeDirectives"),zg=_n(function(t,e){for(const[r,i]of e.entries())if(i.match(t))return r;return-1},"isSubstringInArray");function $g(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Ng[r]??e}function Pg(t,e){const r=t.trim();if(r)return"loose"!==e.securityLevel?Mg(r):r}_n($g,"interpolateToCurve"),_n(Pg,"formatUrl");var qg=_n((t,...e)=>{const r=t.split("."),i=r.length-1,n=r[i];let s=window;for(let a=0;a<i;a++)if(s=s[r[a]],!s)return void Bn.error(`Function name: ${t} not found in window`);s[n](...e)},"runFunc");function Wg(t,e){return t&&e?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):0}function Hg(t){let e,r=0;return t.forEach(t=>{r+=Wg(t,e),e=t}),Ug(t,r/2)}function Vg(t){return 1===t.length?t[0]:Hg(t)}_n(Wg,"distance"),_n(Hg,"traverseEdge"),_n(Vg,"calcLabelPosition");var Yg=_n((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),Ug=_n((t,e)=>{let r,i=e;for(const n of t){if(r){const t=Wg(n,r);if(0===t)return r;if(t<i)i-=t;else{const e=i/t;if(e<=0)return r;if(e>=1)return{x:n.x,y:n.y};if(e>0&&e<1)return{x:Yg((1-e)*r.x+e*n.x,5),y:Yg((1-e)*r.y+e*n.y,5)}}}r=n}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Gg=_n((t,e,r)=>{Bn.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=Ug(e,25),n=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),a={x:0,y:0};return a.x=Math.sin(s)*n+(e[0].x+i.x)/2,a.y=-Math.cos(s)*n+(e[0].y+i.y)/2,a},"calcCardinalityPosition");function Jg(t,e,r){const i=structuredClone(r);Bn.info("our points",i),"start_left"!==e&&"start_right"!==e&&i.reverse();const n=Ug(i,25+t),s=10+.5*t,a=Math.atan2(i[0].y-n.y,i[0].x-n.x),o={x:0,y:0};
2return"start_left"===e?(o.x=Math.sin(a+Math.PI)*s+(i[0].x+n.x)/2,o.y=-Math.cos(a+Math.PI)*s+(i[0].y+n.y)/2):"end_right"===e?(o.x=Math.sin(a-Math.PI)*s+(i[0].x+n.x)/2-5,o.y=-Math.cos(a-Math.PI)*s+(i[0].y+n.y)/2-5):"end_left"===e?(o.x=Math.sin(a)*s+(i[0].x+n.x)/2-5,o.y=-Math.cos(a)*s+(i[0].y+n.y)/2-5):(o.x=Math.sin(a)*s+(i[0].x+n.x)/2,o.y=-Math.cos(a)*s+(i[0].y+n.y)/2),o}function Xg(t){let e="",r="";for(const i of t)void 0!==i&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":e=e+i+";");return{style:e,labelStyle:r}}_n(Jg,"calcTerminalLabelPosition"),_n(Xg,"getStylesFromArray");var Kg=0,Zg=_n(()=>(Kg++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Kg),"generateId");function Qg(t){let e="";for(let r=0;r<t;r++)e+="0123456789abcdef".charAt(Math.floor(16*Math.random()));return e}_n(Qg,"makeRandomHex");var tf=_n(t=>Qg(t.length),"random"),ef=_n(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"),rf=_n(function(t,e){const r=e.text.replace(ba.lineBreakRegex," "),[,i]=gf(e.fontSize),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.style("text-anchor",e.anchor),n.style("font-family",e.fontFamily),n.style("font-size",i),n.style("font-weight",e.fontWeight),n.attr("fill",e.fill),void 0!==e.class&&n.attr("class",e.class);const s=n.append("tspan");return s.attr("x",e.x+2*e.textMargin),s.attr("fill",e.fill),s.text(r),n},"drawSimpleText"),nf=Ri((t,e,r)=>{if(!t)return t;if(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),ba.lineBreakRegex.test(t))return t;const i=t.split(" ").filter(Boolean),n=[];let s="";return i.forEach((t,a)=>{const o=of(`${t} `,r),l=of(s,r);if(o>e){const{hyphenatedStrings:i,remainingWord:a}=sf(t,e,"-",r);n.push(s,...i),s=a}else l+o>=e?(n.push(s),s=t):s=[s,t].filter(Boolean).join(" ");a+1===i.length&&n.push(s)}),n.filter(t=>""!==t).join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),sf=Ri((t,e,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const n=[...t],s=[];let a="";return n.forEach((t,o)=>{const l=`${a}${t}`;if(of(l,i)>=e){const t=o+1,e=n.length===t,i=`${l}${r}`;s.push(e?l:i),a=""}else a=l}),{hyphenatedStrings:s,remainingWord:a}},(t,e,r="-",i)=>`${t}${e}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function af(t,e){return cf(t,e).height}function of(t,e){return cf(t,e).width}_n(af,"calculateTextHeight"),_n(of,"calculateTextWidth");var lf,cf=Ri((t,e)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:n=400}=e;if(!t)return{width:0,height:0};const[,s]=gf(r),a=["sans-serif",i],o=t.split(ba.lineBreakRegex),l=[],c=fl("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const d of a){let t=0;const e={width:0,height:0,lineHeight:0};for(const r of o){const i=ef();i.text=r||"​";const a=rf(h,i).style("font-size",s).style("font-weight",n).style("font-family",d),o=(a._groups||a)[0][0].getBBox();if(0===o.width&&0===o.height)throw new Error("svg element not in render tree");e.width=Math.round(Math.max(e.width,o.width)),t=Math.round(o.height),e.height+=t,e.lineHeight=Math.round(Math.max(e.lineHeight,t))}l.push(e)}return h.remove(),l[isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),hf=(_n(l=class{constructor(t=!1,e){this.count=0,this.count=e?e.length:0,this.next=t?()=>this.count++:()=>Date.now()}},"InitIDGenerator"),l),df=_n(function(t){return lf=lf||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),lf.innerHTML=t,unescape(lf.textContent)},"entityDecode");function uf(t){return"str"in t}_n(uf,"isDetailedError");var pf=_n((t,e,r,i)=>{if(!i)return;const n=t.node()?.getBBox();n&&t.append("text").text(i).attr("text-anchor","middle").attr("x",n.x+n.width/2).attr("y",-r).attr("class",e)},"insertTitle"),gf=_n(t=>{if("number"==typeof t)return[t,t+"px"];const e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");function ff(t,e){return vn({},t,e)}_n(ff,"cleanAndMerge");var mf={assignWithDepth:as,wrapLabel:nf,calculateTextHeight:af,calculateTextWidth:of,calculateTextDimensions:cf,cleanAndMerge:ff,detectInit:Og,detectDirective:Dg,isSubstringInArray:zg,interpolateToCurve:$g,calcLabelPosition:Vg,calcCardinalityPosition:Gg,calcTerminalLabelPosition:Jg,formatUrl:Pg,getStylesFromArray:Xg,generateId:Zg,random:tf,runFunc:qg,entityDecode:df,insertTitle:pf,isLabelCoordinateInPath:wf,parseFontSize:gf,InitIDGenerator:hf},yf=_n(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(t){return t.substring(0,t.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(t){return t.substring(0,t.length-1)}),e=e.replace(/#\w+;/g,function(t){const e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"}),e},"encodeEntities"),xf=_n(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),bf=_n((t,e,{counter:r=0,prefix:i,suffix:n},s)=>s||`${i?`${i}_`:""}${t}_${e}_${r}${n?`_${n}`:""}`,"getEdgeId");function Cf(t){return t??null}function wf(t,e){const r=Math.round(t.x),i=Math.round(t.y),n=e.replace(/(\d+\.\d+)/g,t=>Math.round(parseFloat(t)).toString());return n.includes(r.toString())||n.includes(i.toString())}_n(Cf,"handleUndefinedAttr"),_n(wf,"isLabelCoordinateInPath");var kf=_n(({flowchart:t})=>{const e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:e+r}},"getSubGraphTitleMargins");async function vf(t,e){const r=t.getElementsByTagName("img");if(!r||0===r.length)return;const i=""===e.replace(/<img[^>]*>/g,"").trim();await Promise.all([...r].map(t=>new Promise(e=>{function r(){if(t.style.display="flex",t.style.flexDirection="column",i){const e=qa().fontSize?qa().fontSize:window.getComputedStyle(document.body).fontSize,r=5,[i=Ss.fontSize]=gf(e),n=i*r+"px";t.style.minWidth=n,t.style.maxWidth=n}else t.style.width="100%";e(t)}_n(r,"setupImage"),setTimeout(()=>{t.complete&&r()}),t.addEventListener("error",r),t.addEventListener("load",r)})))}_n(vf,"configureLabelImages");var Sf=_n(t=>{const{handDrawnSeed:e}=qa();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),_f=_n(t=>{const e=Tf([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),Tf=_n(t=>{const e=new Map;return t.forEach(t=>{const[r,i]=t.split(":");e.set(r.trim(),i?.trim())}),e},"styles2Map"),Af=_n(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"===t,"isLabelStyle"),Bf=_n(t=>{const{stylesArray:e}=_f(t),r=[],i=[],n=[],s=[];return e.forEach(t=>{const e=t[0];Af(e)?r.push(t.join(":")+" !important"):(i.push(t.join(":")+" !important"),e.includes("stroke")&&n.push(t.join(":")+" !important"),"fill"===e&&s.push(t.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:e,borderStyles:n,backgroundStyles:s}},"styles2String"),Mf=_n((t,e)=>{const{themeVariables:r,handDrawnSeed:i}=qa(),{nodeBorder:n,mainBkg:s}=r,{stylesMap:a}=_f(t);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||n,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:Ef(a.get("stroke-dasharray"))},e)},"userNodeOverrides"),Ef=_n(t=>{if(!t)return[0,0];const e=t.trim().split(/\s+/).map(Number);if(1===e.length){const t=isNaN(e[0])?0:e[0];return[t,t]}return[isNaN(e[0])?0:e[0],isNaN(e[1])?0:e[1]]},"getStrokeDashArray");const Lf=Object.freeze({left:0,top:0,width:16,height:16}),jf=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ff=Object.freeze({...Lf,...jf}),Nf=Object.freeze({...Ff,body:"",hidden:!1}),If=Object.freeze({width:null,height:null}),Of=Object.freeze({...If,...jf}),Df=(t,e)=>!!t&&!(!(e&&""===t.prefix||t.prefix)||!t.name);function Rf(t,e){const r=function(t,e){const r={};!t.hFlip!=!e.hFlip&&(r.hFlip=!0),!t.vFlip!=!e.vFlip&&(r.vFlip=!0);const i=((t.rotate||0)+(e.rotate||0))%4;return i&&(r.rotate=i),r}(t,e);for(const i in Nf)i in jf?i in t&&!(i in r)&&(r[i]=jf[i]):i in e?r[i]=e[i]:i in t&&(r[i]=t[i]);return r}function zf(t,e,r){const i=t.icons,n=t.aliases||Object.create(null);let s={};function a(t){s=Rf(i[t]||n[t],s)}return a(e),r.forEach(a),Rf(t,s)}const $f=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Pf=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function qf(t,e,r){if(1===e)return t;if(r=r||100,"number"==typeof t)return Math.ceil(t*e*r)/r;if("string"!=typeof t)return t;const i=t.split($f);if(null===i||!i.length)return t;const n=[];let s=i.shift(),a=Pf.test(s);for(;;){if(a){const t=parseFloat(s);isNaN(t)?n.push(s):n.push(Math.ceil(t*e*r)/r)}else n.push(s);if(s=i.shift(),void 0===s)return n.join("");a=!a}}const Wf=/\sid="(\S+)"/g,Hf=new Map;var Vf={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Yf(t){Vf=t}var Uf={exec:()=>null};function Gf(t,e=""){let r="string"==typeof t?t:t.source,i={replace:(t,e)=>{let n="string"==typeof e?e:e.source;return n=n.replace(Xf.caret,"$1"),r=r.replace(t,n),i},getRegex:()=>new RegExp(r,e)};return i}var Jf=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Xf={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
vendor: 4,197 bytes, line 2
2:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Kf=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Zf=/(?:[*+-]|\d{1,9}[.)])/,Qf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,tm=Gf(Qf).replace(/bull/g,Zf).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(),em=Gf(Qf).replace(/bull/g,Zf).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(),rm=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,im=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,nm=Gf(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",im).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sm=Gf(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Zf).getRegex(),am="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",om=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,lm=Gf("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",om).replace("tag",am).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cm=Gf(rm).replace("hr",Kf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",am).getRegex(),hm={blockquote:Gf(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cm).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:nm,fences:/^ {0,3}(`{3,}
vendor: 4,554 bytes, line 2
2(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Kf,html:lm,lheading:tm,list:sm,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:cm,table:Uf,text:/^[^\n]+/},dm=Gf("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Kf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",am).getRegex(),um={...hm,lheading:em,table:dm,paragraph:Gf(rm).replace("hr",Kf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",dm).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",am).getRegex()},pm={...hm,html:Gf("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",om).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Uf,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Gf(rm).replace("hr",Kf).replace("heading"," *#{1,6} *[^\n]").replace("lheading",tm).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},gm=/^( {2,}|\\)\n(?!\s*$)/,fm=/[\p{P}\p{S}]/u,mm=/[\s\p{P}\p{S}]/u,ym=/[^\s\p{P}\p{S}]/u,xm=Gf(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,mm).getRegex(),bm=/(?!~)[\p{P}\p{S}]/u,Cm=Gf(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Jf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),wm=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,km=Gf(wm,"u").replace(/punct/g,fm).getRegex(),vm=Gf(wm,"u").replace(/punct/g,bm).getRegex(),Sm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_m=Gf(Sm,"gu").replace(/notPunctSpace/g,ym).replace(/punctSpace/g,mm).replace(/punct/g,fm).getRegex(),Tm=Gf(Sm,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,bm).getRegex(),Am=Gf("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ym).replace(/punctSpace/g,mm).replace(/punct/g,fm).getRegex(),Bm=Gf(/\\(punct)/,"gu").replace(/punct/g,fm).getRegex(),Mm=Gf(/^<(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(),Em=Gf(om).replace("(?:--\x3e|$)","--\x3e").getRegex(),Lm=Gf("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Em).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jm=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Fm=Gf(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",jm).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nm=Gf(/^!?\[(label)\]\[(ref)\]/).replace("label",jm).replace("ref",im).getRegex(),Im=Gf(/^!?\[(ref)\](?:\[\])?/).replace("ref",im).getRegex(),Om=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Dm
vendor: 13,737 bytes, line 2
2={_backpedal:Uf,anyPunctuation:Bm,autolink:Mm,blockSkip:Cm,br:gm,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Uf,emStrongLDelim:km,emStrongRDelimAst:_m,emStrongRDelimUnd:Am,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Fm,nolink:Im,punctuation:xm,reflink:Nm,reflinkSearch:Gf("reflink|nolink(?!\\()","g").replace("reflink",Nm).replace("nolink",Im).getRegex(),tag:Lm,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Uf},Rm={...Dm,link:Gf(/^!?\[(label)\]\((.*?)\)/).replace("label",jm).getRegex(),reflink:Gf(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jm).getRegex()},zm={...Dm,emStrongRDelimAst:Tm,emStrongLDelim:vm,url:Gf(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Om).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:Gf(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Om).getRegex()},$m={...zm,br:Gf(gm).replace("{2,}","*").getRegex(),text:Gf(zm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Pm={normal:hm,gfm:um,pedantic:pm},qm={normal:Dm,gfm:zm,breaks:$m,pedantic:Rm},Wm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Hm=t=>Wm[t];function Vm(t,e){if(e){if(Xf.escapeTest.test(t))return t.replace(Xf.escapeReplace,Hm)}else if(Xf.escapeTestNoEncode.test(t))return t.replace(Xf.escapeReplaceNoEncode,Hm);return t}function Ym(t){try{t=encodeURI(t).replace(Xf.percentDecode,"%")}catch{return null}return t}function Um(t,e){let r=t.replace(Xf.findPipe,(t,e,r)=>{let i=!1,n=e;for(;--n>=0&&"\\"===r[n];)i=!i;return i?"|":" |"}).split(Xf.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Xf.slashPipe,"|");return r}function Gm(t,e,r){let i=t.length;if(0===i)return"";let n=0;for(;n<i&&t.charAt(i-n-1)===e;)n++;return t.slice(0,i-n)}function Jm(t,e,r,i,n){let s=e.href,a=e.title||null,o=t[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:"!"===t[0].charAt(0)?"image":"link",raw:r,href:s,title:a,text:o,tokens:i.inlineTokens(o)};return i.state.inLink=!1,l}var Xm=class{constructor(t){u(this,"options"),u(this,"rules"),u(this,"lexer"),this.options=t||Vf}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Gm(t,"\n")}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let t=e[0],r=function(t,e,r){let i=t.match(r.other.indentCodeCompensation);if(null===i)return e;let n=i[1];return e.split("\n").map(t=>{let e=t.match(r.other.beginningSpace);if(null===e)return t;let[i]=e;return i.length>=n.length?t.slice(n.length):t}).join("\n")}(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let e=Gm(t,"#");(this.options.pedantic||!e||this.rules.other.endingSpaceChar.test(e))&&(t=e.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Gm(e[0],"\n")}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let t=Gm(e[0],"\n").split("\n"),r="",i="",n=[];for(;t.length>0;){let e,s=!1,a=[];for(e=0;e<t.length;e++)if(this.rules.other.blockquoteStart.test(t[e]))a.push(t[e]),s=!0;else{if(s)break;a.push(t[e])}t=t.slice(e);let o=a.join("\n"),l=o.replace(this.rules.other.blockquoteSetextReplace,"\n    $1").replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}\n${o}`:o,i=i?`${i}\n${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,n,!0),this.lexer.state.top=c,0===t.length)break;let h=n.at(-1);if("code"===h?.type)break;if("blockquote"===h?.type){let e=h,s=e.raw+"\n"+t.join("\n"),a=this.blockquote(s);n[n.length-1]=a,r=r.substring(0,r.length-e.raw.length)+a.raw,i=i.substring(0,i.length-e.text.length)+a.text;break}if("list"===h?.type){let e=h,s=e.raw+"\n"+t.join("\n"),a=this.list(s);n[n.length-1]=a,r=r.substring(0,r.length-h.raw.length)+a.raw,i=i.substring(0,i.length-e.raw.length)+a.raw,t=s.substring(n.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:r,tokens:n,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim(),i=r.length>1,n={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");let s=this.rules.other.listItemRegex(r),a=!1;for(;t;){let r=!1,i="",o="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;i=e[0],t=t.substring(i.length);let l=e[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,t=>" ".repeat(3*t.length)),c=t.split("\n",1)[0],h=!l.trim(),d=0;if(this.options.pedantic?(d=2,o=l.trimStart()):h?d=e[1].length+1:(d=e[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,o=l.slice(d),d+=e[1].length),h&&this.rules.other.blankLine.test(c)&&(i+=c+"\n",t=t.substring(c.length+1),r=!0),!r){let e=this.rules.other.nextBulletRegex(d),r=this.rules.other.hrRegex(d),n=this.rules.other.fencesBeginRegex(d),s=this.rules.other.headingBeginRegex(d),a=this.rules.other.htmlBeginRegex(d);for(;t;){let u,p=t.split("\n",1)[0];if(c=p,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting,"  "),u=c):u=c.replace(this.rules.other.tabCharGlobal,"    "),n.test(c)||s.test(c)||a.test(c)||e.test(c)||r.test(c))break;if(u.search(this.rules.other.nonSpaceChar)>=d||!c.trim())o+="\n"+u.slice(d);else{if(h||l.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||n.test(l)||s.test(l)||r.test(l))break;o+="\n"+c}!h&&!c.trim()&&(h=!0),i+=p+"\n",t=t.substring(p.length+1),l=u.slice(d)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(i)&&(a=!0));let u,p=null;this.options.gfm&&(p=this.rules.other.listIsTask.exec(o),p&&(u="[ ] "!==p[0],o=o.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:i,task:!!p,checked:u,loose:!1,text:o,tokens:[]}),n.raw+=i}let o=n.items.at(-1);if(!o)return;o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd(),n.raw=n.raw.trimEnd();for(let t=0;t<n.items.length;t++)if(this.lexer.state.top=!1,n.items[t].tokens=this.lexer.blockTokens(n.items[t].text,[]),!n.loose){let e=n.items[t].tokens.filter(t=>"space"===t.type),r=e.length>0&&e.some(t=>this.rules.other.anyLine.test(t.raw));n.loose=r}if(n.loose)for(let t=0;t<n.items.length;t++)n.items[t].loose=!0;return n}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=Um(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===i.length){for(let t of i)this.rules.other.tableAlignRight.test(t)?s.align.push("right"):this.rules.other.tableAlignCenter.test(t)?s.align.push("center"):this.rules.other.tableAlignLeft.test(t)?s.align.push("left"):s.align.push(null);for(let t=0;t<r.length;t++)s.header.push({text:r[t],tokens:this.lexer.inline(r[t]),header:!0,align:s.align[t]});for(let t of n)s.rows.push(Um(t,s.header.length).map((t,e)=>({text:t,tokens:this.lexer.inline(t),header:!1,align:s.align[e]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let e=Gm(t.slice(0,-1),"\\");if((t.length-e.length)%2==0)return}else{let t=function(t,e){if(-1===t.indexOf(e[1]))return-1;let r=0;for(let i=0;i<t.length;i++)if("\\"===t[i])i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&(r--,r<0))return i;return r>0?-2:-1}(e[2],"()");if(-2===t)return;if(t>-1){let r=(0===e[0].indexOf("!")?5:4)+e[1].length+t;e[2]=e[2].substring(0,t),e[0]=e[0].substring(0,r).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let t=this.rules.other.pedanticHrefTitle.exec(r);t&&(r=t[1],i=t[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r.slice(1):r.slice(1,-1)),Jm(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let t=e[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!t){let t=r[0].charAt(0);return{type:"text",raw:t,text:t}}return Jm(r,t,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||i[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!i[1]&&!i[2]||!r||this.rules.inline.punctuation.exec(r))){let r,n,s=[...i[0]].length-1,a=s,o=0,l="*"===i[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+s);null!=(i=l.exec(e));){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(n=[...r].length,i[3]||i[4]){a+=n;continue}if((i[5]||i[6])&&s%3&&!((s+n)%3)){o+=n;continue}if(a-=n,a>0)continue;n=Math.min(n,n+a+o);let e=[...i[0]][0].length,l=t.slice(0,s+i.index+e+n);if(Math.min(s,n)%2){let t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}let c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let t,r;return"@"===e[2]?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,r;if("@"===e[2])t=e[0],r="mailto:"+t;else{let i;do{i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(i!==e[0]);t=e[0],r="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},Km=class t{constructor(t){u(this,"tokens"),u(this,"options"),u(this,"state"),u(this,"tokenizer"),u(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Vf,this.options.tokenizer=this.options.tokenizer||new Xm,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 e={other:Xf,block:Pm.normal,inline:qm.normal};this.options.pedantic?(e.block=Pm.pedantic,e.inline=qm.pedantic):this.options.gfm&&(e.block=Pm.gfm,this.options.breaks?e.inline=qm.breaks:e.inline=qm.gfm),this.tokenizer.rules=e}static get rules(){return{block:Pm,inline:qm}}static lex(e,r){return new t(r).lex(e)}static lexInline(e,r){return new t(r).inlineTokens(e)}lex(t){t=t.replace(Xf.carriageReturn,"\n"),this.blockTokens(t,this.tokens);for(let e=0;
2e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],r=!1){for(this.options.pedantic&&(t=t.replace(Xf.tabCharGlobal,"    ").replace(Xf.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some(r=>!!(i=r.call({lexer:this},t,e))&&(t=t.substring(i.raw.length),e.push(i),!0)))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let r=e.at(-1);1===i.raw.length&&void 0!==r?r.raw+="\n":e.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+=(r.raw.endsWith("\n")?"":"\n")+i.raw,r.text+="\n"+i.text,this.inlineQueue.at(-1).src=r.text):e.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let r=e.at(-1);"paragraph"===r?.type||"text"===r?.type?(r.raw+=(r.raw.endsWith("\n")?"":"\n")+i.raw,r.text+="\n"+i.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},e.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),e.push(i);continue}let n=t;if(this.options.extensions?.startBlock){let e,r=1/0,i=t.slice(1);this.options.extensions.startBlock.forEach(t=>{e=t.call({lexer:this},i),"number"==typeof e&&e>=0&&(r=Math.min(r,e))}),r<1/0&&r>=0&&(n=t.substring(0,r+1))}if(this.state.top&&(i=this.tokenizer.paragraph(n))){let s=e.at(-1);r&&"paragraph"===s?.type?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+i.raw,s.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):e.push(i),r=n.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let r=e.at(-1);"text"===r?.type?(r.raw+=(r.raw.endsWith("\n")?"":"\n")+i.raw,r.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):e.push(i);continue}if(t){let e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let r,i=t,n=null;if(this.tokens.links){let t=Object.keys(this.tokens.links);if(t.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(i));)t.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(i));)i=i.slice(0,n.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(i));)r=n[2]?n[2].length:0,i=i.slice(0,n.index+r)+"["+"a".repeat(n[0].length-r-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let s=!1,a="";for(;t;){let r;if(s||(a=""),s=!1,this.options.extensions?.inline?.some(i=>!!(r=i.call({lexer:this},t,e))&&(t=t.substring(r.raw.length),e.push(r),!0)))continue;if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length);let i=e.at(-1);"text"===r.type&&"text"===i?.type?(i.raw+=r.raw,i.text+=r.text):e.push(r);continue}if(r=this.tokenizer.emStrong(t,i,a)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),e.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),e.push(r);continue}let n=t;if(this.options.extensions?.startInline){let e,r=1/0,i=t.slice(1);this.options.extensions.startInline.forEach(t=>{e=t.call({lexer:this},i),"number"==typeof e&&e>=0&&(r=Math.min(r,e))}),r<1/0&&r>=0&&(n=t.substring(0,r+1))}if(r=this.tokenizer.inlineText(n)){t=t.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(a=r.raw.slice(-1)),s=!0;let i=e.at(-1);"text"===i?.type?(i.raw+=r.raw,i.text+=r.text):e.push(r);continue}if(t){let e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return e}},Zm=class{constructor(t){u(this,"options"),u(this,"parser"),this.options=t||Vf}space(t){return""}code({text:t,lang:e,escaped:r}){let i=(e||"").match(Xf.notSpaceStart)?.[0],n=t.replace(Xf.endingNewline,"")+"\n";return i?'<pre><code class="language-'+Vm(i)+'">'+(r?n:Vm(n,!0))+"</code></pre>\n":"<pre><code>"+(r?n:Vm(n,!0))+"</code></pre>\n"}blockquote({tokens:t}){return`<blockquote>\n${this.parser.parse(t)}</blockquote>\n`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>\n`}hr(t){return"<hr>\n"}list(t){let e=t.ordered,r=t.start,i="";for(let s=0;s<t.items.length;s++){let e=t.items[s];i+=this.listitem(e)}let n=e?"ol":"ul";return"<"+n+(e&&1!==r?' start="'+r+'"':"")+">\n"+i+"</"+n+">\n"}listitem(t){let e="";if(t.task){let r=this.checkbox({checked:!!t.checked});t.loose?"paragraph"===t.tokens[0]?.type?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=r+" "+Vm(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>\n`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>\n`}table(t){let e="",r="";for(let n=0;n<t.header.length;n++)r+=this.tablecell(t.header[n]);e+=this.tablerow({text:r});let i="";for(let n=0;n<t.rows.length;n++){let e=t.rows[n];r="";for(let t=0;t<e.length;t++)r+=this.tablecell(e[t]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+i+"</table>\n"}tablerow({text:t}){return`<tr>\n${t}</tr>\n`}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>\n`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Vm(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let i=this.parser.parseInline(r),n=Ym(t);if(null===n)return i;let s='<a href="'+(t=n)+'"';return e&&(s+=' title="'+Vm(e)+'"'),s+=">"+i+"</a>",s}image({href:t,title:e,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let n=Ym(t);if(null===n)return Vm(r);let s=`<img src="${t=n}" alt="${r}"`;return e&&(s+=` title="${Vm(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Vm(t.text)}},Qm=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},ty=class t{constructor(t){u(this,"options"),u(this,"renderer"),u(this,"textRenderer"),this.options=t||Vf,this.options.renderer=this.options.renderer||new Zm,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Qm}static parse(e,r){return new t(r).parse(e)}static parseInline(e,r){return new t(r).parseInline(e)}parse(t,e=!0){let r="";for(let i=0;i<t.length;i++){let n=t[i];if(this.options.extensions?.renderers?.[n.type]){let t=n,e=this.options.extensions.renderers[t.type].call({parser:this},t);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(t.type)){r+=e||"";continue}}let s=n;switch(s.type){case"space":r+=this.renderer.space(s);continue;case"hr":r+=this.renderer.hr(s);continue;case"heading":r+=this.renderer.heading(s);continue;case"code":r+=this.renderer.code(s);continue;case"table":r+=this.renderer.table(s);continue;case"blockquote":r+=this.renderer.blockquote(s);continue;case"list":r+=this.renderer.list(s);continue;case"html":r+=this.renderer.html(s);continue;case"def":r+=this.renderer.def(s);continue;
2case"paragraph":r+=this.renderer.paragraph(s);continue;case"text":{let n=s,a=this.renderer.text(n);for(;i+1<t.length&&"text"===t[i+1].type;)n=t[++i],a+="\n"+this.renderer.text(n);r+=e?this.renderer.paragraph({type:"paragraph",raw:a,text:a,tokens:[{type:"text",raw:a,text:a,escaped:!0}]}):a;continue}default:{let t='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return r}parseInline(t,e=this.renderer){let r="";for(let i=0;i<t.length;i++){let n=t[i];if(this.options.extensions?.renderers?.[n.type]){let t=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==t||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=t||"";continue}}let s=n;switch(s.type){case"escape":case"text":r+=e.text(s);break;case"html":r+=e.html(s);break;case"link":r+=e.link(s);break;case"image":r+=e.image(s);break;case"strong":r+=e.strong(s);break;case"em":r+=e.em(s);break;case"codespan":r+=e.codespan(s);break;case"br":r+=e.br(s);break;case"del":r+=e.del(s);break;default:{let t='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return r}},ey=(c=class{constructor(t){u(this,"options"),u(this,"block"),this.options=t||Vf}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Km.lex:Km.lexInline}provideParser(){return this.block?ty.parse:ty.parseInline}},u(c,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),u(c,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),c),ry=new class{constructor(...t){u(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),u(this,"options",this.setOptions),u(this,"parse",this.parseMarkdown(!0)),u(this,"parseInline",this.parseMarkdown(!1)),u(this,"Parser",ty),u(this,"Renderer",Zm),u(this,"TextRenderer",Qm),u(this,"Lexer",Km),u(this,"Tokenizer",Xm),u(this,"Hooks",ey),this.use(...t)}walkTokens(t,e){let r=[];for(let i of t)switch(r=r.concat(e.call(this,i)),i.type){case"table":{let t=i;for(let i of t.header)r=r.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let t of i)r=r.concat(this.walkTokens(t.tokens,e));break}case"list":{let t=i;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=i;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let n=t[i].flat(1/0);r=r.concat(this.walkTokens(n,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let r=e.renderers[t.name];e.renderers[t.name]=r?function(...e){let i=t.renderer.apply(this,e);return!1===i&&(i=r.apply(this,e)),i}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");let r=e[t.level];r?r.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),r.extensions=e),t.renderer){let e=this.defaults.renderer||new Zm(this.defaults);for(let r in t.renderer){if(!(r in e))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let i=r,n=t.renderer[i],s=e[i];e[i]=(...t)=>{let r=n.apply(e,t);return!1===r&&(r=s.apply(e,t)),r||""}}r.renderer=e}if(t.tokenizer){let e=this.defaults.tokenizer||new Xm(this.defaults);for(let r in t.tokenizer){if(!(r in e))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let i=r,n=t.tokenizer[i],s=e[i];e[i]=(...t)=>{let r=n.apply(e,t);return!1===r&&(r=s.apply(e,t)),r}}r.tokenizer=e}if(t.hooks){let e=this.defaults.hooks||new ey;for(let r in t.hooks){if(!(r in e))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let i=r,n=t.hooks[i],s=e[i];ey.passThroughHooks.has(r)?e[i]=t=>{if(this.defaults.async&&ey.passThroughHooksRespectAsync.has(r))return(async()=>{let r=await n.call(e,t);return s.call(e,r)})();let i=n.call(e,t);return s.call(e,i)}:e[i]=(...t)=>{if(this.defaults.async)return(async()=>{let r=await n.apply(e,t);return!1===r&&(r=await s.apply(e,t)),r})();let r=n.apply(e,t);return!1===r&&(r=s.apply(e,t)),r}}r.hooks=e}if(t.walkTokens){let e=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(t){let r=[];return r.push(i.call(this,t)),e&&(r=r.concat(e.call(this,t))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Km.lex(t,e??this.defaults)}parser(t,e){return ty.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let i={...r},n={...this.defaults,...i},s=this.onError(!!n.silent,!!n.async);if(!0===this.defaults.async&&!1===i.async)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 e>"u"||null===e)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let r=n.hooks?await n.hooks.preprocess(e):e,i=await(n.hooks?await n.hooks.provideLexer():t?Km.lex:Km.lexInline)(r,n),s=n.hooks?await n.hooks.processAllTokens(i):i;n.walkTokens&&await Promise.all(this.walkTokens(s,n.walkTokens));let a=await(n.hooks?await n.hooks.provideParser():t?ty.parse:ty.parseInline)(s,n);return n.hooks?await n.hooks.postprocess(a):a})().catch(s);try{n.hooks&&(e=n.hooks.preprocess(e));let r=(n.hooks?n.hooks.provideLexer():t?Km.lex:Km.lexInline)(e,n);n.hooks&&(r=n.hooks.processAllTokens(r)),n.walkTokens&&this.walkTokens(r,n.walkTokens);let i=(n.hooks?n.hooks.provideParser():t?ty.parse:ty.parseInline)(r,n);return n.hooks&&(i=n.hooks.postprocess(i)),i}catch(a){return s(a)}}}onError(t,e){return r=>{if(r.message+="\nPlease report this to https://github.com/markedjs/marked.",t){let t="<p>An error occurred:</p><pre>"+Vm(r.message+"",!0)+"</pre>";return e?Promise.resolve(t):t}if(e)return Promise.reject(r);throw r}}};function iy(t,e){return ry.parse(t,e)}function ny(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var i=Array.from("string"==typeof t?[t]:t);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var n=i.reduce(function(t,e){var r=e.match(/\n([\t ]+|(?!\s).)/g);return r?t.concat(r.map(function(t){var e,r;return null!==(r=null===(e=t.match(/[\t ]/g))||void 0===e?void 0:e.length)&&void 0!==r?r:0})):t},[]);if(n.length){var s=new RegExp("\n[\t ]{"+Math.min.apply(Math,n)+"}","g");i=i.map(function(t){return t.replace(s,"\n")})}i[0]=i[0].replace(/^\r?\n/,"");var a=i[0];return e.forEach(function(t,e){var r=a.match(/(?:^|\n)( *)$/),n=r?r[1]:"",s=t;"string"==typeof t&&t.includes("\n")&&(s=String(t).split("\n").map(function(t,e){return 0===e?t:""+n+t}).join("\n")),a+=s+i[e+1]}),a}iy.options=iy.setOptions=function(t){return ry.setOptions(t),iy.defaults=ry.defaults,Yf(iy.defaults),iy},iy.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},iy.defaults=Vf,iy.use=function(...t){return ry.use(...t),iy.defaults=ry.defaults,Yf(iy.defaults),iy},iy.walkTokens=function(t,e){return ry.walkTokens(t,e)},iy.parseInline=ry.parseInline,iy.Parser=ty,iy.parser=ty.parse,iy.Renderer=Zm,iy.TextRenderer=Qm,iy.Lexer=Km,iy.lexer=Km.lex,iy.Tokenizer=Xm,iy.Hooks=ey,iy.parse=iy,iy.options,iy.setOptions,iy.use,iy.walkTokens,iy.parseInline,ty.parse,Km.lex;var sy={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},ay=new Map,oy=new Map,ly=_n(t=>{for(const e of t){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');
2if(Bn.debug("Registering icon pack:",e.name),"loader"in e)oy.set(e.name,e.loader);else{if(!("icons"in e))throw Bn.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.');ay.set(e.name,e.icons)}}},"registerIconPacks"),cy=_n(async(t,e)=>{const r=((t,e,r,i="")=>{const n=t.split(":");if("@"===t.slice(0,1)){if(n.length<2||n.length>3)return null;i=n.shift().slice(1)}if(n.length>3||!n.length)return null;if(n.length>1){const t=n.pop(),e=n.pop(),r={provider:n.length>0?n[0]:i,prefix:e,name:t};return Df(r)?r:null}const s=n[0],a=s.split("-");if(a.length>1){const t={provider:i,prefix:a.shift(),name:a.join("-")};return Df(t)?t:null}if(r&&""===i){const t={provider:i,prefix:"",name:s};return Df(t,r)?t:null}return null})(t,0,void 0!==e);if(!r)throw new Error(`Invalid icon name: ${t}`);const i=r.prefix||e;if(!i)throw new Error(`Icon name must contain a prefix: ${t}`);let n=ay.get(i);if(!n){const t=oy.get(i);if(!t)throw new Error(`Icon set not found: ${r.prefix}`);try{n={...await t(),prefix:i},ay.set(i,n)}catch(a){throw Bn.error(a),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=function(t,e){if(t.icons[e])return zf(t,e,[]);const r=function(t,e){const r=t.icons,i=t.aliases||Object.create(null),n=Object.create(null);return(e||Object.keys(r).concat(Object.keys(i))).forEach(function t(e){if(r[e])return n[e]=[];if(!(e in n)){n[e]=null;const r=i[e]&&i[e].parent,s=r&&t(r);s&&(n[e]=[r].concat(s))}return n[e]}),n}(t,[e])[e];return r?zf(t,e,r):null}(n,r.name);if(!s)throw new Error(`Icon not found: ${t}`);return s},"getRegisteredIconData"),hy=_n(async t=>{try{return await cy(t),!0}catch{return!1}},"isIconAvailable"),dy=_n(async(t,e,r)=>{let i;try{i=await cy(t,e?.fallbackPrefix)}catch(a){Bn.error(a),i=sy}const n=function(t,e){const r={...Ff,...t},i={...Of,...e},n={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,i].forEach(t=>{const e=[],r=t.hFlip,i=t.vFlip;let a,o=t.rotate;switch(r?i?o+=2:(e.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),e.push("scale(-1 1)"),n.top=n.left=0):i&&(e.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),e.push("scale(1 -1)"),n.top=n.left=0),o<0&&(o-=4*Math.floor(o/4)),o%=4,o){case 1:a=n.height/2+n.top,e.unshift("rotate(90 "+a.toString()+" "+a.toString()+")");break;case 2:e.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:a=n.width/2+n.left,e.unshift("rotate(-90 "+a.toString()+" "+a.toString()+")")}o%2==1&&(n.left!==n.top&&(a=n.left,n.left=n.top,n.top=a),n.width!==n.height&&(a=n.width,n.width=n.height,n.height=a)),e.length&&(s=function(t,e){const r=function(t,e="defs"){let r="";const i=t.indexOf("<"+e);for(;i>=0;){const n=t.indexOf(">",i),s=t.indexOf("</"+e);if(-1===n||-1===s)break;const a=t.indexOf(">",s);if(-1===a)break;r+=t.slice(n+1,s).trim(),t=t.slice(0,i).trim()+t.slice(a+1)}return{defs:r,content:t}}(t);return i=r.defs,n=e+r.content+"</g>",i?"<defs>"+i+"</defs>"+n:n;var i,n}(s,'<g transform="'+e.join(" ")+'">'))});const a=i.width,o=i.height,l=n.width,c=n.height;let h,d;null===a?(d=null===o?"1em":"auto"===o?c:o,h=qf(d,l/c)):(h="auto"===a?l:a,d=null===o?qf(h,c/l):"auto"===o?c:o);const u={},p=(t,e)=>{(t=>"unset"===t||"undefined"===t||"none"===t)(e)||(u[t]=e.toString())};p("width",h),p("height",d);const g=[n.left,n.top,l,c];return u.viewBox=g.join(" "),{attributes:u,viewBox:g,body:s}}(i,e),s=function(t,e){let r=-1===t.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)r+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+t+"</svg>"}(function(t){const e=[];let r;for(;r=Wf.exec(t);)e.push(r[1]);if(!e.length)return t;const i="suffix"+(16777216*Math.random()|Date.now()).toString(16);return e.forEach(e=>{const r=function(t){t=t.replace(/[0-9]+$/,"")||"a";const e=Hf.get(t)||0;return Hf.set(t,e+1),e?`${t}${e}`:t}(e),n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+n+')([")]|\\.[a-z])',"g"),"$1"+r+i+"$3")}),t=t.replace(new RegExp(i,"g"),"")}(n.body),{...n.attributes,...r});return ta(s,Rs())},"getIconSVG");function uy(t,{markdownAutoWrap:e}){return ny(t.replace(/<br\/>/g,"\n").replace(/\n{2,}/g,"\n"))}function py(t){return t.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(t=>({content:t,type:"normal"}))??[])}function gy(t,e={}){const r=uy(t,e),i=iy.lexer(r),n=[[]];let s=0;function a(t,e="normal"){"text"===t.type?t.text.split("\n").forEach((t,r)=>{0!==r&&(s++,n.push([])),t.split(" ").forEach(t=>{(t=t.replace(/&#39;/g,"'"))&&n[s].push({content:t,type:e})})}
2):"strong"===t.type||"em"===t.type?t.tokens.forEach(e=>{a(e,t.type)}):"html"===t.type&&n[s].push({content:t.text,type:"normal"})}return _n(a,"processNode"),i.forEach(t=>{"paragraph"===t.type?t.tokens?.forEach(t=>{a(t)}):"html"===t.type?n[s].push({content:t.text,type:"normal"}):n[s].push({content:t.raw,type:"normal"})}),n}function fy(t){return t?`<p>${t.replace(/\\n|\n/g,"<br />")}</p>`:""}function my(t,{markdownAutoWrap:e}={}){const r=iy.lexer(t);function i(t){return"text"===t.type?!1===e?t.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):t.text.replace(/\n */g,"<br/>"):"strong"===t.type?`<strong>${t.tokens?.map(i).join("")}</strong>`:"em"===t.type?`<em>${t.tokens?.map(i).join("")}</em>`:"paragraph"===t.type?`<p>${t.tokens?.map(i).join("")}</p>`:"space"===t.type?"":"html"===t.type?`${t.text}`:"escape"===t.type?t.text:(Bn.warn(`Unsupported markdown: ${t.type}`),t.raw)}return _n(i,"output"),r.map(i).join("")}function yy(t){return Intl.Segmenter?[...(new Intl.Segmenter).segment(t)].map(t=>t.segment):[...t]}function xy(t,e){return by(t,[],yy(e.content),e.type)}function by(t,e,r,i){if(0===r.length)return[{content:e.join(""),type:i},{content:"",type:i}];const[n,...s]=r,a=[...e,n];return t([{content:a.join(""),type:i}])?by(t,a,s,i):(0===e.length&&n&&(e.push(n),r.shift()),[{content:e.join(""),type:i},{content:r.join(""),type:i}])}function Cy(t,e){if(t.some(({content:t})=>t.includes("\n")))throw new Error("splitLineToFitWidth does not support newlines in the line");return wy(t,e)}function wy(t,e,r=[],i=[]){if(0===t.length)return i.length>0&&r.push(i),r.length>0?r:[];let n="";" "===t[0].content&&(n=" ",t.shift());const s=t.shift()??{content:" ",type:"normal"},a=[...i];if(""!==n&&a.push({content:n,type:"normal"}),a.push(s),e(a))return wy(t,e,r,a);if(i.length>0)r.push(i),t.unshift(s);else if(s.content){const[i,n]=xy(e,s);r.push([i]),n.content&&t.unshift(n)}return wy(t,e,r)}function ky(t,e){e&&t.attr("style",e)}async function vy(t,e,r,i,n=!1,s=Rs()){const a=t.append("foreignObject");a.attr("width",`${Math.min(10*r,16384)}px`),a.attr("height",`${Math.min(10*r,16384)}px`);const o=a.append("xhtml:div"),l=fa(e.label)?await xa(e.label.replace(ba.lineBreakRegex,"\n"),s):ta(e.label,s),c=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(l),ky(h,e.labelStyle),h.attr("class",`${c} ${i}`),ky(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),n&&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()),a.node()}function Sy(t,e,r,i=!1){const n=t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return i&&n.attr("text-anchor","middle"),n}function _y(t,e,r){const i=t.append("text"),n=Sy(i,1,e);By(n,r);const s=n.node().getComputedTextLength();return i.remove(),s}function Ty(t,e,r){const i=t.append("text"),n=Sy(i,1,e);By(n,[{content:r,type:"normal"}]);const s=n.node()?.getBoundingClientRect();return s&&i.remove(),s}function Ay(t,e,r,i=!1,n=!1){const s=e.append("g"),a=s.insert("rect").attr("class","background").attr("style","stroke: none"),o=s.append("text").attr("y","-10.1");n&&o.attr("text-anchor","middle");let l=0;for(const c of r){const e=_n(e=>_y(s,1.1,e)<=t,"checkWidth"),r=e(c)?[c]:Cy(c,e);for(const t of r)By(Sy(o,l,1.1,n),t),l++}if(i){const t=o.node().getBBox(),e=2;return a.attr("x",t.x-e).attr("y",t.y-e).attr("width",t.width+2*e).attr("height",t.height+2*e),s.node()}return o.node()}function By(t,e){t.text(""),e.forEach((e,r)=>{const i=t.append("tspan").attr("font-style","em"===e.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===e.type?"bold":"normal");0===r?i.text(e.content):i.text(" "+e.content)})}async function My(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(t,i,n)=>(r.push((async()=>{const r=`${i}:${n}`;return await hy(r)?await dy(r,void 0,{class:"label-icon"}):`<i class='${ta(t,e).replace(":"," ")}'></i>`})()),t));const i=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}_n(uy,"preprocessMarkdown"),_n(py,"nonMarkdownToLines"),_n(gy,"markdownToLines"),_n(fy,"n
2onMarkdownToHTML"),_n(my,"markdownToHTML"),_n(yy,"splitTextToChars"),_n(xy,"splitWordToFitWidth"),_n(by,"splitWordToFitWidthRecursion"),_n(Cy,"splitLineToFitWidth"),_n(wy,"splitLineToFitWidthRecursion"),_n(ky,"applyStyle"),_n(vy,"addHtmlSpan"),_n(Sy,"createTspan"),_n(_y,"computeWidthOfText"),_n(Ty,"computeDimensionOfText"),_n(Ay,"createFormattedText"),_n(By,"updateTextContentAndStyles"),_n(My,"replaceIconSubstring");var Ey=_n(async(t,e="",{style:r="",isTitle:i=!1,classes:n="",useHtmlLabels:s=!0,markdown:a=!0,isNode:o=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(Bn.debug("XYZ createText",e,r,i,n,s,o,"addSvgBackground: ",c),s){const i=a?my(e,h):fy(e),s=await My(xf(i),h),d=e.replace(/\\\\/g,"\\"),u={isNode:o,label:fa(e)?d:s,labelStyle:r.replace("fill:","color:")};return await vy(t,u,l,n,c,h)}{const n=e.replace(/<br\s*\/?>/g,"<br/>"),s=Ay(l,t,a?gy(n.replace("<br>","<br/>"),h):py(n),!!e&&c,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const t=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");fl(s).attr("style",t)}else{const t=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");fl(s).select("rect").attr("style",t.replace(/background:/g,"fill:"));const e=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");fl(s).select("text").attr("style",e)}return i?fl(s).selectAll("tspan.text-outer-tspan").classed("title-row",!0):fl(s).selectAll("tspan.text-outer-tspan").classed("row",!0),s}},"createText");function Ly(t,e,r){if(t&&t.length){const[i,n]=e,s=Math.PI/180*r,a=Math.cos(s),o=Math.sin(s);for(const e of t){const[t,r]=e;e[0]=(t-i)*a-(r-n)*o+i,e[1]=(t-i)*o+(r-n)*a+n}}}function jy(t,e){return t[0]===e[0]&&t[1]===e[1]}function Fy(t,e){var r;const i=e.hachureAngle+90;let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.round(Math.max(n,.1));let s=1;return e.roughness>=1&&((null===(r=e.randomizer)||void 0===r?void 0:r.next())||Math.random())>.7&&(s=n),function(t,e,r,i=1){const n=r,s=Math.max(e,.1),a=t[0]&&t[0][0]&&"number"==typeof t[0][0]?[t]:t,o=[0,0];if(n)for(const c of a)Ly(c,o,n);const l=function(t,e,r){const i=[];for(const c of t){const t=[...c];jy(t[0],t[t.length-1])||t.push([t[0][0],t[0][1]]),t.length>2&&i.push(t)}const n=[];e=Math.max(e,.1);const s=[];for(const c of i)for(let t=0;t<c.length-1;t++){const e=c[t],r=c[t+1];if(e[1]!==r[1]){const t=Math.min(e[1],r[1]);s.push({ymin:t,ymax:Math.max(e[1],r[1]),x:t===e[1]?e[0]:r[0],islope:(r[0]-e[0])/(r[1]-e[1])})}}if(s.sort((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax)),!s.length)return n;let a=[],o=s[0].ymin,l=0;for(;a.length||s.length;){if(s.length){let t=-1;for(let e=0;e<s.length&&!(s[e].ymin>o);e++)t=e;s.splice(0,t+1).forEach(t=>{a.push({s:o,edge:t})})}if(a=a.filter(t=>!(t.edge.ymax<=o)),a.sort((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x)),(1!==r||l%e==0)&&a.length>1)for(let t=0;t<a.length;t+=2){const e=t+1;if(e>=a.length)break;const r=a[t].edge,i=a[e].edge;n.push([[Math.round(r.x),o],[Math.round(i.x),o]])}o+=r,a.forEach(t=>{t.edge.x=t.edge.x+r*t.edge.islope}),l++}return n}(a,s,i);if(n){for(const t of a)Ly(t,o,-n);!function(t,e,r){const i=[];t.forEach(t=>i.push(...t)),Ly(i,e,r)}(l,o,-n)}return l}(t,n,i,s||1)}class Ny{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const r=Fy(t,e);return{type:"fillSketch",ops:this.renderLines(r,e)}}renderLines(t,e){const r=[];for(const i of t)r.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],e));return r}}function Iy(t){const e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}class Oy extends Ny{fillPolygons(t,e){let r=e.hachureGap;r<0&&(r=4*e.strokeWidth),r=Math.max(r,.1);const i=Fy(t,Object.assign({},e,{hachureGap:r})),n=Math.PI/180*e.hachureAngle,s=[],a=.5*r*Math.cos(n),o=.5*r*Math.sin(n);for(const[l,c]of i)Iy([l,c])&&s.push([[l[0]-a,l[1]+o],[...c]],[[l[0]+a,l[1]-o],[...c]]);return{type:"fillSketch",ops:this.renderLines(s,e)}}}class Dy extends Ny{fillPolygons(t,e){const r=this._fillPolygons(t,e),i=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),n=this._fillPolygons(t,i);return r.ops=r.ops.concat(n.ops),r}}class Ry{constructor(t){this.helper=t}fillPolygons(t,e){const r=Fy(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(r,e)}dotsOnLines(t,e){const r=[];let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);let n=e.fillWeight;n<0&&(n=e.strokeWidth/2);const s=i/4;
2for(const a of t){const t=Iy(a),o=t/i,l=Math.ceil(o)-1,c=t-l*i,h=(a[0][0]+a[1][0])/2-i/4,d=Math.min(a[0][1],a[1][1]);for(let a=0;a<l;a++){const t=d+c+a*i,o=h-s+2*Math.random()*s,l=t-s+2*Math.random()*s,u=this.helper.ellipse(o,l,n,n,e);r.push(...u.ops)}}return{type:"fillSketch",ops:r}}}let zy=class{constructor(t){this.helper=t}fillPolygons(t,e){const r=Fy(t,e);return{type:"fillSketch",ops:this.dashedLine(r,e)}}dashedLine(t,e){const r=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,i=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,n=[];return t.forEach(t=>{const s=Iy(t),a=Math.floor(s/(r+i)),o=(s+i-a*(r+i))/2;let l=t[0],c=t[1];l[0]>c[0]&&(l=t[1],c=t[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<a;d++){const t=d*(r+i),s=t+r,a=[l[0]+t*Math.cos(h)+o*Math.cos(h),l[1]+t*Math.sin(h)+o*Math.sin(h)],c=[l[0]+s*Math.cos(h)+o*Math.cos(h),l[1]+s*Math.sin(h)+o*Math.sin(h)];n.push(...this.helper.doubleLineOps(a[0],a[1],c[0],c[1],e))}}),n}};class $y{constructor(t){this.helper=t}fillPolygons(t,e){const r=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,i=e.zigzagOffset<0?r:e.zigzagOffset,n=Fy(t,e=Object.assign({},e,{hachureGap:r+i}));return{type:"fillSketch",ops:this.zigzagLines(n,i,e)}}zigzagLines(t,e,r){const i=[];return t.forEach(t=>{const n=Iy(t),s=Math.round(n/(2*e));let a=t[0],o=t[1];a[0]>o[0]&&(a=t[1],o=t[0]);const l=Math.atan((o[1]-a[1])/(o[0]-a[0]));for(let c=0;c<s;c++){const t=2*c*e,n=2*(c+1)*e,s=Math.sqrt(2*Math.pow(e,2)),o=[a[0]+t*Math.cos(l),a[1]+t*Math.sin(l)],h=[a[0]+n*Math.cos(l),a[1]+n*Math.sin(l)],d=[o[0]+s*Math.cos(l+Math.PI/4),o[1]+s*Math.sin(l+Math.PI/4)];i.push(...this.helper.doubleLineOps(o[0],o[1],d[0],d[1],r),...this.helper.doubleLineOps(d[0],d[1],h[0],h[1],r))}}),i}}const Py={};class qy{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const Wy={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Hy(t,e){return t.type===e}function Vy(t){const e=[],r=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t);let i="BOD",n=0,s=r[n];for(;!Hy(s,2);){let a=0;const o=[];if("BOD"===i){if("M"!==s.text&&"m"!==s.text)return Vy("M0,0"+t);n++,a=Wy[s.text],i=s.text}else Hy(s,1)?a=Wy[i]:(n++,a=Wy[s.text],i=s.text);if(!(n+a<r.length))throw new Error("Path data ended short");for(let t=n;t<n+a;t++){const e=r[t];if(!Hy(e,1))throw new Error("Param not a number: "+i+","+e.text);o[o.length]=+e.text}if("number"!=typeof Wy[i])throw new Error("Bad segment: "+i);{const t={key:i,data:o};e.push(t),n+=a,s=r[n],"M"===i&&(i="L"),"m"===i&&(i="l")}}return e}function Yy(t){let e=0,r=0,i=0,n=0;const s=[];for(const{key:a,data:o}of t)switch(a){case"M":s.push({key:"M",data:[...o]}),[e,r]=o,[i,n]=o;break;case"m":e+=o[0],r+=o[1],s.push({key:"M",data:[e,r]}),i=e,n=r;break;case"L":s.push({key:"L",data:[...o]}),[e,r]=o;break;case"l":e+=o[0],r+=o[1],s.push({key:"L",data:[e,r]});break;case"C":s.push({key:"C",data:[...o]}),e=o[4],r=o[5];break;case"c":{const t=o.map((t,i)=>i%2?t+r:t+e);s.push({key:"C",data:t}),e=t[4],r=t[5];break}case"Q":s.push({key:"Q",data:[...o]}),e=o[2],r=o[3];break;case"q":{const t=o.map((t,i)=>i%2?t+r:t+e);s.push({key:"Q",data:t}),e=t[2],r=t[3];break}case"A":s.push({key:"A",data:[...o]}),e=o[5],r=o[6];break;case"a":e+=o[5],r+=o[6],s.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,r]});break;case"H":s.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],s.push({key:"H",data:[e]});break;case"V":s.push({key:"V",data:[...o]}),r=o[0];break;case"v":r+=o[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...o]}),e=o[2],r=o[3];break;case"s":{const t=o.map((t,i)=>i%2?t+r:t+e);s.push({key:"S",data:t}),e=t[2],r=t[3];break}case"T":s.push({key:"T",data:[...o]}),e=o[0],r=o[1];break;case"t":e+=o[0],r+=o[1],s.push({key:"T",data:[e,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),e=i,r=n}return s}function Uy(t){const e=[];let r="",i=0,n=0,s=0,a=0,o=0,l=0;for(const{key:c,data:h}of t){switch(c){case"M":e.push({key:"M",data:[...h]}),[i,n]=h,[s,a]=h;break;case"C":e.push({key:"C",data:[...h]}),i=h[4],n=h[5],o=h[2],l=h[3];break;
vendor: 12,820 bytes, line 2
2case"L":e.push({key:"L",data:[...h]}),[i,n]=h;break;case"H":i=h[0],e.push({key:"L",data:[i,n]});break;case"V":n=h[0],e.push({key:"L",data:[i,n]});break;case"S":{let t=0,s=0;"C"===r||"S"===r?(t=i+(i-o),s=n+(n-l)):(t=i,s=n),e.push({key:"C",data:[t,s,...h]}),o=h[0],l=h[1],i=h[2],n=h[3];break}case"T":{const[t,s]=h;let a=0,c=0;"Q"===r||"T"===r?(a=i+(i-o),c=n+(n-l)):(a=i,c=n);const d=i+2*(a-i)/3,u=n+2*(c-n)/3,p=t+2*(a-t)/3,g=s+2*(c-s)/3;e.push({key:"C",data:[d,u,p,g,t,s]}),o=a,l=c,i=t,n=s;break}case"Q":{const[t,r,s,a]=h,c=i+2*(t-i)/3,d=n+2*(r-n)/3,u=s+2*(t-s)/3,p=a+2*(r-a)/3;e.push({key:"C",data:[c,d,u,p,s,a]}),o=t,l=r,i=s,n=a;break}case"A":{const t=Math.abs(h[0]),r=Math.abs(h[1]),s=h[2],a=h[3],o=h[4],l=h[5],c=h[6];0===t||0===r?(e.push({key:"C",data:[i,n,l,c,l,c]}),i=l,n=c):i===l&&n===c||(Jy(i,n,l,c,t,r,s,a,o).forEach(function(t){e.push({key:"C",data:t})}),i=l,n=c);break}case"Z":e.push({key:"Z",data:[]}),i=s,n=a}r=c}return e}function Gy(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function Jy(t,e,r,i,n,s,a,o,l,c){const h=(d=a,Math.PI*d/180);var d;let u=[],p=0,g=0,f=0,m=0;if(c)[p,g,f,m]=c;else{[t,e]=Gy(t,e,-h),[r,i]=Gy(r,i,-h);const a=(t-r)/2,c=(e-i)/2;let d=a*a/(n*n)+c*c/(s*s);d>1&&(d=Math.sqrt(d),n*=d,s*=d);const u=n*n,y=s*s,x=u*y-u*c*c-y*a*a,b=u*c*c+y*a*a,C=(o===l?-1:1)*Math.sqrt(Math.abs(x/b));f=C*n*c/s+(t+r)/2,m=C*-s*a/n+(e+i)/2,p=Math.asin(parseFloat(((e-m)/s).toFixed(9))),g=Math.asin(parseFloat(((i-m)/s).toFixed(9))),t<f&&(p=Math.PI-p),r<f&&(g=Math.PI-g),p<0&&(p=2*Math.PI+p),g<0&&(g=2*Math.PI+g),l&&p>g&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let y=g-p;if(Math.abs(y)>120*Math.PI/180){const t=g,e=r,o=i;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,u=Jy(r=f+n*Math.cos(g),i=m+s*Math.sin(g),e,o,n,s,a,0,l,[g,t,f,m])}y=g-p;const x=Math.cos(p),b=Math.sin(p),C=Math.cos(g),w=Math.sin(g),k=Math.tan(y/4),v=4/3*n*k,S=4/3*s*k,_=[t,e],T=[t+v*b,e-S*x],A=[r+v*w,i-S*C],B=[r,i];if(T[0]=2*_[0]-T[0],T[1]=2*_[1]-T[1],c)return[T,A,B].concat(u);{u=[T,A,B].concat(u);const t=[];for(let e=0;e<u.length;e+=3){const r=Gy(u[e][0],u[e][1],h),i=Gy(u[e+1][0],u[e+1][1],h),n=Gy(u[e+2][0],u[e+2][1],h);t.push([r[0],r[1],i[0],i[1],n[0],n[1]])}return t}}const Xy={randOffset:function(t,e){return cx(t,e)},randOffsetWithRange:function(t,e,r){return lx(t,e,r)},ellipse:function(t,e,r,i,n){return ex(t,e,n,tx(r,i,n)).opset},doubleLineOps:function(t,e,r,i,n){return hx(t,e,r,i,n,!0)}};function Ky(t,e,r,i,n){return{type:"path",ops:hx(t,e,r,i,n)}}function Zy(t,e,r){const i=(t||[]).length;if(i>2){const n=[];for(let e=0;e<i-1;e++)n.push(...hx(t[e][0],t[e][1],t[e+1][0],t[e+1][1],r));return e&&n.push(...hx(t[i-1][0],t[i-1][1],t[0][0],t[0][1],r)),{type:"path",ops:n}}return 2===i?Ky(t[0][0],t[0][1],t[1][0],t[1][1],r):{type:"path",ops:[]}}function Qy(t,e){if(t.length){const r="number"==typeof t[0][0]?[t]:t,i=ux(r[0],1*(1+.2*e.roughness),e),n=e.disableMultiStroke?[]:ux(r[0],1.5*(1+.22*e.roughness),ax(e));for(let t=1;t<r.length;t++){const s=r[t];if(s.length){const t=ux(s,1*(1+.2*e.roughness),e),r=e.disableMultiStroke?[]:ux(s,1.5*(1+.22*e.roughness),ax(e));for(const e of t)"move"!==e.op&&i.push(e);for(const e of r)"move"!==e.op&&n.push(e)}}return{type:"path",ops:i.concat(n)}}return{type:"path",ops:[]}}function tx(t,e,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),n=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),s=2*Math.PI/n;let a=Math.abs(t/2),o=Math.abs(e/2);const l=1-r.curveFitting;return a+=cx(a*l,r),o+=cx(o*l,r),{increment:s,rx:a,ry:o}}function ex(t,e,r,i){const[n,s]=gx(i.increment,t,e,i.rx,i.ry,1,i.increment*lx(.1,lx(.4,1,r),r),r);let a=px(n,0,r);if(!r.disableMultiStroke&&0!==r.roughness){const[n]=gx(i.increment,t,e,i.rx,i.ry,1.5,0,r),s=px(n,0,r);a=a.concat(s)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function rx(t,e,r,i,n,s,a,o,l){const c=t,h=e;let d=Math.abs(r/2),u=Math.abs(i/2);d+=cx(.01*d,l),u+=cx(.01*u,l);let p=n,g=s;for(;p<0;)p+=2*Math.PI,g+=2*Math.PI;g-p>2*Math.PI&&(p=0,g=2*Math.PI);const f=2*Math.PI/l.curveStepCount,m=Math.min(f/2,(g-p)/2),y=fx(m,c,h,d,u,p,g,1,l);if(!l.disableMultiStroke){const t=fx(m,c,h,d,u,p,g,1.5,l);y.push(...t)}return a&&(o?y.push(...hx(c,h,c+d*Math.cos(p),h+u*Math.sin(p),l),...hx(c,h,c+d*Math.cos(g),h+u*Math.sin(g),l)):y.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(p),h+u*Math.sin(p)]})),{type:"path",ops:y}}function ix(t,e){const r=Uy(Yy(Vy(t))),i=[];let n=[0,0],s=[0,0];for(const{key:a,data:o}of r)switch(a){case"M":s=[o[0],o[1]],n=[o[0],o[1]];break;case"L":i.push(...hx(s[0],s[1],o[0],o[1],e)),s=[o[0],o[1]];break;case"C":{const[t,r,n,a,l,c]=o;i.push(...mx(t,r,n,a,l,c,s,e)),s=[l,c];break}case"Z":i.push(...hx(s[0],s[1],n[0],n[1],e)),s=[n[0],n[1]]}return{type:"path",ops:i}}function nx(t,e){const r=[];for(const i of t)if(i.length){const t=e.maxRandomnessOffset||0,n=i.length;if(n>2){r.push({op:"move",data:[i[0][0]+cx(t,e),i[0][1]+cx(t,e)]});for(let s=1;s<n;s++)r.push({op:"lineTo",data:[i[s][0]+cx(t,e),i[s][1]+cx(t,e)]})}}return{type:"fillPath",ops:r}}function sx(t,e){return function(t,e){let r=t.fillStyle||"hachure";if(!Py[r])switch(r){case"zigzag":Py[r]||(Py[r]=new Oy(e));break;case"cross-hatch":Py[r]||(Py[r]=new Dy(e));break;case"dots":Py[r]||(Py[r]=new Ry(e));break;case"dashed":Py[r]||(Py[r]=new zy(e));break;case"zigzag-line":Py[r]||(Py[r]=new $y(e));break;default:r="hachure",Py[r]||(Py[r]=new Ny(e))}return Py[r]}(e,Xy).fillPolygons(t,e)}function ax(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function ox(t){return t.randomizer||(t.randomizer=new qy(t.seed||0)),t.randomizer.next()}function lx(t,e,r,i=1){return r.roughness*i*(ox(r)*(e-t)+t)}function cx(t,e,r=1){return lx(-t,t,e,r)}function hx(t,e,r,i,n,s=!1){const a=s?n.disableMultiStrokeFill:n.disableMultiStroke,o=dx(t,e,r,i,n,0,!1);if(a)return o;const l=dx(t,e,r,i,n,0,!0);return o.concat(l)}function dx(t,e,r,i,n,s,a){const o=Math.pow(t-r,2)+Math.pow(e-i,2),l=Math.sqrt(o);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=n.maxRandomnessOffset||0;h*h*100>o&&(h=l/10);const d=h/2,u=.2+.2*ox(n);let p=n.bowing*n.maxRandomnessOffset*(i-e)/200,g=n.bowing*n.maxRandomnessOffset*(t-r)/200;p=cx(p,n,c),g=cx(g,n,c);const f=[],m=()=>cx(d,n,c),y=()=>cx(h,n,c),x=n.preserveVertices;return a?f.push({op:"move",data:[t+(x?0:m()),e+(x?0:m())]}):f.push({op:"move",data:[t+(x?0:cx(h,n,c)),e+(x?0:cx(h,n,c))]}),a?f.push({op:"bcurveTo",data:[p+t+(r-t)*u+m(),g+e+(i-e)*u+m(),p+t+2*(r-t)*u+m(),g+e+2*(i-e)*u+m(),r+(x?0:m()),i+(x?0:m())]}):f.push({op:"bcurveTo",data:[p+t+(r-t)*u+y(),g+e+(i-e)*u+y(),p+t+2*(r-t)*u+y(),g+e+2*(i-e)*u+y(),r+(x?0:y()),i+(x?0:y())]}),f}function ux(t,e,r){if(!t.length)return[];const i=[];i.push([t[0][0]+cx(e,r),t[0][1]+cx(e,r)]),i.push([t[0][0]+cx(e,r),t[0][1]+cx(e,r)]);for(let n=1;n<t.length;n++)i.push([t[n][0]+cx(e,r),t[n][1]+cx(e,r)]),n===t.length-1&&i.push([t[n][0]+cx(e,r),t[n][1]+cx(e,r)]);return px(i,0,r)}function px(t,e,r){const i=t.length,n=[];if(i>3){const e=[],s=1-r.curveTightness;n.push({op:"move",data:[t[1][0],t[1][1]]});for(let r=1;r+2<i;r++){const i=t[r];e[0]=[i[0],i[1]],e[1]=[i[0]+(s*t[r+1][0]-s*t[r-1][0])/6,i[1]+(s*t[r+1][1]-s*t[r-1][1])/6],e[2]=[t[r+1][0]+(s*t[r][0]-s*t[r+2][0])/6,t[r+1][1]+(s*t[r][1]-s*t[r+2][1])/6],e[3]=[t[r+1][0],t[r+1][1]],n.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[3][0],e[3][1]]})}}else 3===i?(n.push({op:"move",data:[t[1][0],t[1][1]]}),n.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===i&&n.push(...dx(t[0][0],t[0][1],t[1][0],t[1][1],r,0,!0));return n}function gx(t,e,r,i,n,s,a,o){const l=[],c=[];if(0===o.roughness){t/=4,c.push([e+i*Math.cos(-t),r+n*Math.sin(-t)]);for(let s=0;s<=2*Math.PI;s+=t){const t=[e+i*Math.cos(s),r+n*Math.sin(s)];l.push(t),c.push(t)}c.push([e+i*Math.cos(0),r+n*Math.sin(0)]),c.push([e+i*Math.cos(t),r+n*Math.sin(t)])}else{const h=cx(.5,o)-Math.PI/2;c.push([cx(s,o)+e+.9*i*Math.cos(h-t),cx(s,o)+r+.9*n*Math.sin(h-t)]);const d=2*Math.PI+h-.01;for(let a=h;a<d;a+=t){const t=[cx(s,o)+e+i*Math.cos(a),cx(s,o)+r+n*Math.sin(a)];l.push(t),c.push(t)}c.push([cx(s,o)+e+i*Math.cos(h+2*Math.PI+.5*a),cx(s,o)+r+n*Math.sin(h+2*Math.PI+.5*a)]),c.push([cx(s,o)+e+.98*i*Math.cos(h+a),cx(s,o)+r+.98*n*Math.sin(h+a)]),c.push([cx(s,o)+e+.9*i*Math.cos(h+.5*a),cx(s,o)+r+.9*n*Math.sin(h+.5*a)])}return[c,l]}function fx(t,e,r,i,n,s,a,o,l){const c=s+cx(.1,l),h=[];h.push([cx(o,l)+e+.9*i*Math.cos(c-t),cx(o,l)+r+.9*n*Math.sin(c-t)]);for(let d=c;d<=a;d+=t)h.push([cx(o,l)+e+i*Math.cos(d),cx(o,l)+r+n*Math.sin(d)]);return h.push([e+i*Math.cos(a),r+n*Math.sin(a)]),h.push([e+i*Math.cos(a),r+n*Math.sin(a)]),px(h,0,l)}function mx(t,e,r,i,n,s,a,o){const l=[],c=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let h=[0,0];const d=o.disableMultiStroke?1:2,u=o.preserveVertices;for(let p=0;p<d;p++)0===p?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(u?0:cx(c[0],o)),a[1]+(u?0:cx(c[0],o))]}),h=u?[n,s]:[n+cx(c[p],o),s+cx(c[p],o)],l.push({op:"bcurveTo",data:[t+cx(c[p],o),e+cx(c[p],o),r+cx(c[p],o),i+cx(c[p],o),h[0],h[1]]});return l}function yx(t){return[...t]}function xx(t,e=0){const r=t.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(3===r)i.push(yx(t[0]),yx(t[1]),yx(t[2]),yx(t[2]));else{const r=[];r.push(t[0],t[0]);for(let e=1;e<t.length;e++)r.push(t[e]),e===t.length-1&&r.push(t[e]);const n=[],s=1-e;i.push(yx(r[0]));for(let t=1;t+2<r.length;t++){const e=r[t];n[0]=[e[0],e[1]],n[1]=[e[0]+(s*r[t+1][0]-s*r[t-1][0])/6,e[1]+(s*r[t+1][1]-s*r[t-1][1])/6],n[2]=[r[t+1][0]+(s*r[t][0]-s*r[t+2][0])/6,r[t+1][1]+(s*r[t][1]-s*r[t+2][1])/6],n[3]=[r[t+1][0],r[t+1][1]],i.push(n[1],n[2],n[3])}}return i}function bx(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function Cx(t,e,r){const i=bx(e,r);if(0===i)return bx(t,e);let n=((t[0]-e[0])*(r[0]-e[0])+(t[1]-e[1])*(r[1]-e[1]))/i;return n=Math.max(0,Math.min(1,n)),bx(t,wx(e,r,n))}function wx(t,e,r){return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r]}function kx(t,e,r,i){const n=i||[];if(function(t,e){const r=t[e+0],i=t[e+1],n=t[e+2],s=t[e+3];let a=3*i[0]-2*r[0]-s[0];a*=a;let o=3*i[1]-2*r[1]-s[1];o*=o;let l=3*n[0]-2*s[0]-r[0];l*=l;let c=3*n[1]-2*s[1]-r[1];return c*=c,a<l&&(a=l),o<c&&(o=c),a+o}(t,e)<r){const r=t[e+0];n.length?(s=n[n.length-1],a=r,Math.sqrt(bx(s,a))>1&&n.push(r)):n.push(r),n.push(t[e+3])}else{const i=.5,s=t[e+0],a=t[e+1],o=t[e+2],l=t[e+3],c=wx(s,a,i),h=wx(a,o,i),d=wx(o,l,i),u=wx(c,h,i),p=wx(h,d,i),g=wx(u,p,i);kx([s,c,u,g],0,r,n),kx([g,p,d,l],0,r,n)}var s,a;return n}function vx(t,e){return Sx(t,0,t.length,e)}function Sx(t,e,r,i,n){const s=n||[],a=t[e],o=t[r-1];let l=0,c=1;for(let h=e+1;h<r-1;++h){const e=Cx(t[h],a,o);e>l&&(l=e,c=h)}return Math.sqrt(l)>i?(Sx(t,e,c+1,i,s),Sx(t,c,r,i,s)):(s.length||s.push(a),s.push(o)),s}function _x(t,e=.15,r){const i=[],n=(t.length-1)/3;for(let s=0;s<n;s++)kx(t,3*s,e,i);return r&&r>0?Sx(i,0,i.length,r):i}const Tx="none";class Ax{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,r){return{shape:t,sets:e||[],options:r||this.defaultOptions}}line(t,e,r,i,n){const s=this._o(n);return this._d("line",[Ky(t,e,r,i,s)],s)}rectangle(t,e,r,i,n){const s=this._o(n),a=[],o=function(t,e,r,i,n){return Zy([[t,e],[t+r,e],[t+r,e+i],[t,e+i]],!0,n)}(t,e,r,i,s);if(s.fill){const n=[[t,e],[t+r,e],[t+r,e+i],[t,e+i]];"solid"===s.fillStyle?a.push(nx([n],s)):a.push(sx([n],s))}return s.stroke!==Tx&&a.push(o),this._d("rectangle",a,s)}ellipse(t,e,r,i,n){const s=this._o(n),a=[],o=tx(r,i,s),l=ex(t,e,s,o);if(s.fill)if("solid"===s.fillStyle){const r=ex(t,e,s,o).opset;r.type="fillPath",a.push(r)}else a.push(sx([l.estimatedPoints],s));return s.stroke!==Tx&&a.push(l.opset),this._d("ellipse",a,s)}circle(t,e,r,i){const n=this.ellipse(t,e,r,r,i);return n.shape="circle",n}linearPath(t,e){const r=this._o(e);return this._d("linearPath",[Zy(t,!1,r)],r)}arc(t,e,r,i,n,s,a=!1,o){const l=this._o(o),c=[],h=rx(t,e,r,i,n,s,a,!0,l);if(a&&l.fill)if("solid"===l.fillStyle){const a=Object.assign({},l);a.disableMultiStroke=!0;const o=rx(t,e,r,i,n,s,!0,!1,a);o.type="fillPath",c.push(o)}else c.push(function(t,e,r,i,n,s,a){const o=t,l=e;let c=Math.abs(r/2),h=Math.abs(i/2);c+=cx(.01*c,a),h+=cx(.01*h,a);let d=n,u=s;for(;d<0;)d+=2*Math.PI,u+=2*Math.PI;u-d>2*Math.PI&&(d=0,u=2*Math.PI);const p=(u-d)/a.curveStepCount,g=[];for(let f=d;f<=u;
2f+=p)g.push([o+c*Math.cos(f),l+h*Math.sin(f)]);return g.push([o+c*Math.cos(u),l+h*Math.sin(u)]),g.push([o,l]),sx([g],a)}(t,e,r,i,n,s,l));return l.stroke!==Tx&&c.push(h),this._d("arc",c,l)}curve(t,e){const r=this._o(e),i=[],n=Qy(t,r);if(r.fill&&r.fill!==Tx)if("solid"===r.fillStyle){const e=Qy(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{const e=[],n=t;if(n.length){const t="number"==typeof n[0][0]?[n]:n;for(const i of t)i.length<3?e.push(...i):3===i.length?e.push(..._x(xx([i[0],i[0],i[1],i[2]]),10,(1+r.roughness)/2)):e.push(..._x(xx(i),10,(1+r.roughness)/2))}e.length&&i.push(sx([e],r))}return r.stroke!==Tx&&i.push(n),this._d("curve",i,r)}polygon(t,e){const r=this._o(e),i=[],n=Zy(t,!0,r);return r.fill&&("solid"===r.fillStyle?i.push(nx([t],r)):i.push(sx([t],r))),r.stroke!==Tx&&i.push(n),this._d("polygon",i,r)}path(t,e){const r=this._o(e),i=[];if(!t)return this._d("path",i,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const n=r.fill&&"transparent"!==r.fill&&r.fill!==Tx,s=r.stroke!==Tx,a=!!(r.simplification&&r.simplification<1),o=function(t,e,r){const i=Uy(Yy(Vy(t))),n=[];let s=[],a=[0,0],o=[];const l=()=>{o.length>=4&&s.push(..._x(o,1)),o=[]},c=()=>{l(),s.length&&(n.push(s),s=[])};for(const{key:d,data:u}of i)switch(d){case"M":c(),a=[u[0],u[1]],s.push(a);break;case"L":l(),s.push([u[0],u[1]]);break;case"C":if(!o.length){const t=s.length?s[s.length-1]:a;o.push([t[0],t[1]])}o.push([u[0],u[1]]),o.push([u[2],u[3]]),o.push([u[4],u[5]]);break;case"Z":l(),s.push([a[0],a[1]])}if(c(),!r)return n;const h=[];for(const d of n){const t=vx(d,r);t.length&&h.push(t)}return h}(t,0,a?4-4*(r.simplification||1):(1+r.roughness)/2),l=ix(t,r);if(n)if("solid"===r.fillStyle)if(1===o.length){const e=ix(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else i.push(nx(o,r));else i.push(sx(o,r));return s&&(a?o.forEach(t=>{i.push(Zy(t,!1,r))}):i.push(l)),this._d("path",i,r)}opsToPath(t,e){let r="";for(const i of t.ops){const t="number"==typeof e&&e>=0?i.data.map(t=>+t.toFixed(e)):i.data;switch(i.op){case"move":r+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":r+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":r+=`L${t[0]} ${t[1]} `}}return r.trim()}toPaths(t){const e=t.sets||[],r=t.options||this.defaultOptions,i=[];for(const n of e){let t=null;switch(n.type){case"path":t={d:this.opsToPath(n),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Tx};break;case"fillPath":t={d:this.opsToPath(n),stroke:Tx,strokeWidth:0,fill:r.fill||Tx};break;case"fillSketch":t=this.fillSketch(n,r)}t&&i.push(t)}return i}fillSketch(t,e){let r=e.fillWeight;return r<0&&(r=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||Tx,strokeWidth:r,fill:Tx}}_mergedShape(t){return t.filter((t,e)=>0===e||"move"!==t.op)}}class Bx{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Ax(e)}draw(t){const e=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.ctx,n=t.options.fixedDecimalPlaceDigits;for(const s of e)switch(s.type){case"path":i.save(),i.strokeStyle="none"===r.stroke?"transparent":r.stroke,i.lineWidth=r.strokeWidth,r.strokeLineDash&&i.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(i.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(i,s,n),i.restore();break;case"fillPath":{i.save(),i.fillStyle=r.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(i,s,n,e),i.restore();break}case"fillSketch":this.fillSketch(i,s,r)}}fillSketch(t,e,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=i,this._drawToContext(t,e,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,r,i="nonzero"){t.beginPath();for(const n of e.ops){const e="number"==typeof r&&r>=0?n.data.map(t=>+t.toFixed(r)):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,r,i,n){const s=this.gen.line(t,e,r,i,n);return this.draw(s),s}rectangle(t,e,r,i,n){const s=this.gen.rectangle(t,e,r,i,n);return this.draw(s),s}ellipse(t,e,r,i,n){const s=this.gen.ellipse(t,e,r,i,n);return this.draw(s),s}circle(t,e,r,i){const n=this.gen.circle(t,e,r,i);return this.draw(n),n}linearPath(t,e){const r=this.gen.linearPath(t,e);return this.draw(r),r}polygon(t,e){const r=this.gen.polygon(t,e);return this.draw(r),r}arc(t,e,r,i,n,s,a=!1,o){const l=this.gen.arc(t,e,r,i,n,s,a,o);return this.draw(l),l}curve(t,e){const r=this.gen.curve(t,e);return this.draw(r),r}path(t,e){const r=this.gen.path(t,e);return this.draw(r),r}}const Mx="http://www.w3.org/2000/svg";class Ex{constructor(t,e){this.svg=t,this.gen=new Ax(e)}draw(t){const e=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,n=i.createElementNS(Mx,"g"),s=t.options.fixedDecimalPlaceDigits;for(const a of e){let e=null;switch(a.type){case"path":e=i.createElementNS(Mx,"path"),e.setAttribute("d",this.opsToPath(a,s)),e.setAttribute("stroke",r.stroke),e.setAttribute("stroke-width",r.strokeWidth+""),e.setAttribute("fill","none"),r.strokeLineDash&&e.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":e=i.createElementNS(Mx,"path"),e.setAttribute("d",this.opsToPath(a,s)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",r.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(i,a,r)}e&&n.appendChild(e)}return n}fillSketch(t,e,r){let i=r.fillWeight;i<0&&(i=r.strokeWidth/2);const n=t.createElementNS(Mx,"path");return n.setAttribute("d",this.opsToPath(e,r.fixedDecimalPlaceDigits)),n.setAttribute("stroke",r.fill||""),n.setAttribute("stroke-width",i+""),n.setAttribute("fill","none"),r.fillLineDash&&n.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&n.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),n}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,r,i,n){const s=this.gen.line(t,e,r,i,n);return this.draw(s)}rectangle(t,e,r,i,n){const s=this.gen.rectangle(t,e,r,i,n);return this.draw(s)}ellipse(t,e,r,i,n){const s=this.gen.ellipse(t,e,r,i,n);return this.draw(s)}circle(t,e,r,i){const n=this.gen.circle(t,e,r,i);return this.draw(n)}linearPath(t,e){const r=this.gen.linearPath(t,e);return this.draw(r)}polygon(t,e){const r=this.gen.polygon(t,e);return this.draw(r)}arc(t,e,r,i,n,s,a=!1,o){const l=this.gen.arc(t,e,r,i,n,s,a,o);return this.draw(l)}curve(t,e){const r=this.gen.curve(t,e);return this.draw(r)}path(t,e){const r=this.gen.path(t,e);return this.draw(r)}}var Lx={canvas:(t,e)=>new Bx(t,e),svg:(t,e)=>new Ex(t,e),generator:t=>new Ax(t),newSeed:()=>Ax.newSeed()},jx=_n(async(t,e,r)=>{let i;const n=e.useHtmlLabels||Bs(qa()?.htmlLabels);i=r||"node default";const s=t.insert("g").attr("class",i).attr("id",e.domId||e.id),a=s.insert("g").attr("class","label").attr("style",Cf(e.labelStyle));let o;o=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];const l=!!e.icon||!!e.img,c="markdown"===e.labelType,h=await Ey(a,ta(xf(o),qa()),{useHtmlLabels:n,width:e.width||qa().flowchart?.wrappingWidth,cssClasse
2s:c?"markdown-node-label":void 0,style:e.labelStyle,addSvgBackground:l,markdown:c},qa());let d=h.getBBox();const u=(e?.padding??0)/2;if(n){const t=h.children[0],e=fl(h);await vf(t,o),d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}return n?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:u,label:a}},"labelHelper"),Fx=_n(async(t,e,r)=>{const i=r.useHtmlLabels??Us(qa()),n=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Ey(n,ta(xf(e),qa()),{useHtmlLabels:i,width:r.width||qa()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const o=r.padding/2;if(Us(qa())){const t=s.children[0],e=fl(s);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}return i?n.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):n.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&n.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:t,bbox:a,halfPadding:o,label:n}},"insertLabel"),Nx=_n((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),Ix=_n((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Ox(t){const e=t.map((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`);return e.push("Z"),e.join(" ")}function Dx(t,e,r,i,n,s){const a=[],o=r-t,l=i-e,c=o/s,h=2*Math.PI/c,d=e+l/2;for(let u=0;u<=50;u++){const e=t+u/50*o,r=d+n*Math.sin(h*(e-t));a.push({x:e,y:r})}return a}function Rx(t,e,r,i,n,s){const a=[],o=n*Math.PI/180,l=(s*Math.PI/180-o)/(i-1);for(let c=0;c<i;c++){const i=o+c*l,n=t+r*Math.cos(i),s=e+r*Math.sin(i);a.push({x:-n,y:-s})}return a}_n(Ox,"createPathFromPoints"),_n(Dx,"generateFullSineWavePoints"),_n(Rx,"generateCirclePoints");var zx=_n((t,e)=>{var r,i,n=t.x,s=t.y,a=e.x-n,o=e.y-s,l=t.width/2,c=t.height/2;return Math.abs(o)*l>Math.abs(a)*c?(o<0&&(c=-c),r=0===o?0:c*a/o,i=c):(a<0&&(l=-l),r=l,i=0===a?0:l*o/a),{x:n+r,y:s+i}},"intersectRect"),$x=_n(async(t,e,r,i=!1,n=!1)=>{let s=e||"";"object"==typeof s&&(s=s[0]);const a=qa(),o=Us(a);return await Ey(t,s,{style:r,isTitle:i,useHtmlLabels:o,markdown:!1,isNode:n,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Px=_n((t,e,r,i,n)=>["M",t+n,e,"H",t+r-n,"A",n,n,0,0,1,t+r,e+n,"V",e+i-n,"A",n,n,0,0,1,t+r-n,e+i,"H",t+n,"A",n,n,0,0,1,t,e+i-n,"V",e+n,"A",n,n,0,0,1,t+n,e,"Z"].join(" "),"createRoundedRectPathD"),qx=_n(async(t,e)=>{Bn.info("Creating subgraph rect for ",e.id,e);const r=qa(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=Bf(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),u=Us(r),p=d.insert("g").attr("class","cluster-label ");let g;g="markdown"===e.labelType?await Ey(p,e.label,{style:e.labelStyle,useHtmlLabels:u,isNode:!0,width:e.width}):await $x(p,e.label,e.labelStyle||"",!1,!0);let f=g.getBBox();if(Us(r)){const t=g.children[0],e=fl(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}const m=e.width<=f.width+e.padding?f.width+e.padding:e.width;e.width<=f.width+e.padding?e.diff=(m-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,x=e.x-m/2,b=e.y-y/2;let C;if(Bn.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=Lx.svg(d),r=Mf(e,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:n}),i=t.path(Px(x,b,m,y,0),r);C=d.insert(()=>(Bn.debug("Rough node insert CXC",i),i),":first-child"),C.select("path:nth-child(2)").attr("style",c.join(";")),C.select("path").attr("style",h.join(";").replace("fill","stroke"))}else C=d.insert("rect",":first-child"),C.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",m).attr("height",y);const{subGraphTitleTopMargin:w}=kf(r);if(p.attr("transform",`translate(${e.x-f.width/2}
2, ${e.y-e.height/2+w})`),o){const t=p.select("span");t&&t.attr("style",o)}const k=C.node().getBBox();return e.offsetX=0,e.width=k.width,e.height=k.height,e.offsetY=f.height-e.padding/2,e.intersect=function(t){return zx(e,t)},{cluster:d,labelBBox:f}},"rect"),Wx=_n((t,e)=>{const r=t.insert("g").attr("class","note-cluster").attr("id",e.id),i=r.insert("rect",":first-child"),n=0*e.padding,s=n/2;i.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-s).attr("y",e.y-e.height/2-s).attr("width",e.width+n).attr("height",e.height+n).attr("fill","none");const a=i.node().getBBox();return e.width=a.width,e.height=a.height,e.intersect=function(t){return zx(e,t)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),Hx=_n(async(t,e)=>{const r=qa(),{themeVariables:i,handDrawnSeed:n}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:o,nodeBorder:l}=i,c=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let u=c.append("rect");const p=await $x(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(Us(r)){const t=p.children[0],e=fl(p);g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}const f=0*e.padding,m=f/2,y=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+f;e.width<=g.width+e.padding?e.diff=(y-e.width)/2-e.padding:e.diff=-e.padding;const x=e.height+f,b=e.height+f-g.height-6,C=e.x-y/2,w=e.y-x/2;e.width=y;const k=e.y-e.height/2-m+g.height+2;let v;if("handDrawn"===e.look){const t=e.cssClasses.includes("statediagram-cluster-alt"),r=Lx.svg(c),i=e.rx||e.ry?r.path(Px(C,w,y,x,10),{roughness:.7,fill:o,fillStyle:"solid",stroke:l,seed:n}):r.rectangle(C,w,y,x,{seed:n});v=c.insert(()=>i,":first-child");const h=r.rectangle(C,k,y,b,{fill:t?s:a,fillStyle:t?"hachure":"solid",stroke:l,seed:n});v=c.insert(()=>i,":first-child"),u=c.insert(()=>h)}else{v=h.insert("rect",":first-child");const t="outer";v.attr("class",t).attr("x",C).attr("y",w).attr("width",y).attr("height",x).attr("data-look",e.look),u.attr("class","inner").attr("x",C).attr("y",k).attr("width",y).attr("height",b)}d.attr("transform",`translate(${e.x-g.width/2}, ${w+1-(Us(r)?0:3)})`);const S=v.node().getBBox();return e.height=S.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(t){return zx(e,t)},{cluster:c,labelBBox:g}},"roundedWithTitle"),Vx=_n(async(t,e)=>{Bn.info("Creating subgraph rect for ",e.id,e);const r=qa(),{themeVariables:i,handDrawnSeed:n}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:o,nodeStyles:l,borderStyles:c,backgroundStyles:h}=Bf(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),u=Us(r),p=d.insert("g").attr("class","cluster-label "),g=await Ey(p,e.label,{style:e.labelStyle,useHtmlLabels:u,isNode:!0,width:e.width});let f=g.getBBox();if(Us(r)){const t=g.children[0],e=fl(g);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}const m=e.width<=f.width+e.padding?f.width+e.padding:e.width;e.width<=f.width+e.padding?e.diff=(m-e.width)/2-e.padding:e.diff=-e.padding;const y=e.height,x=e.x-m/2,b=e.y-y/2;let C;if(Bn.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){const t=Lx.svg(d),r=Mf(e,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:n}),i=t.path(Px(x,b,m,y,e.rx),r);C=d.insert(()=>(Bn.debug("Rough node insert CXC",i),i),":first-child"),C.select("path:nth-child(2)").attr("style",c.join(";")),C.select("path").attr("style",h.join(";").replace("fill","stroke"))}else C=d.insert("rect",":first-child"),C.attr("style",l).attr("rx",e.rx).attr("ry",e.ry).attr("x",x).attr("y",b).attr("width",m).attr("height",y);const{subGraphTitleTopMargin:w}=kf(r);if(p.attr("transform",`translate(${e.x-f.width/2}, ${e.y-e.height/2+w})`),o){const t=p.select("span");t&&t.attr("style",o)}const k=C.node().getBBox();return e.offsetX=0,e.width=k.width,e.height=k.height,e.offsetY=f.height-e.padding/2,e.intersect=function(t){return zx(e,t)},{cluster:d,labelBBox:f}},"kanbanSection"),Yx={rect:qx,squareRect:qx,roundedWithTitle:Hx,noteGroup:Wx,divider:_n((t,e)=>
2{const r=qa(),{themeVariables:i,handDrawnSeed:n}=r,{nodeBorder:s}=i,a=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),o=a.insert("g",":first-child"),l=0*e.padding,c=e.width+l;e.diff=-e.padding;const h=e.height+l,d=e.x-c/2,u=e.y-h/2;let p;if(e.width=c,"handDrawn"===e.look){const t=Lx.svg(a).rectangle(d,u,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:n});p=a.insert(()=>t,":first-child")}else{p=o.insert("rect",":first-child");const t="divider";p.attr("class",t).attr("x",d).attr("y",u).attr("width",c).attr("height",h).attr("data-look",e.look)}const g=p.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return zx(e,t)},{cluster:a,labelBBox:{}}},"divider"),kanbanSection:Vx},Ux=new Map,Gx=_n(async(t,e)=>{const r=e.shape||"rect",i=await Yx[r](t,e);return Ux.set(e.id,i),i},"insertCluster"),Jx=_n(()=>{Ux=new Map},"clear");function Xx(t,e){return t.intersect(e)}_n(Xx,"intersectNode");var Kx=Xx;function Zx(t,e,r,i){var n=t.x,s=t.y,a=n-i.x,o=s-i.y,l=Math.sqrt(e*e*o*o+r*r*a*a),c=Math.abs(e*r*a/l);i.x<n&&(c=-c);var h=Math.abs(e*r*o/l);return i.y<s&&(h=-h),{x:n+c,y:s+h}}_n(Zx,"intersectEllipse");var Qx=Zx;function tb(t,e,r){return Qx(t,e,e,r)}_n(tb,"intersectCircle");var eb=tb;function rb(t,e,r,i){{const n=e.y-t.y,s=t.x-e.x,a=e.x*t.y-t.x*e.y,o=n*r.x+s*r.y+a,l=n*i.x+s*i.y+a,c=1e-6;if(0!==o&&0!==l&&ib(o,l))return;const h=i.y-r.y,d=r.x-i.x,u=i.x*r.y-r.x*i.y,p=h*t.x+d*t.y+u,g=h*e.x+d*e.y+u;if(Math.abs(p)<c&&Math.abs(g)<c&&ib(p,g))return;const f=n*d-h*s;if(0===f)return;const m=Math.abs(f/2);let y=s*u-d*a;const x=y<0?(y-m)/f:(y+m)/f;return y=h*a-n*u,{x,y:y<0?(y-m)/f:(y+m)/f}}}function ib(t,e){return t*e>0}_n(rb,"intersectLine"),_n(ib,"sameSign");var nb=rb;function sb(t,e,r){let i=t.x,n=t.y,s=[],a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){a=Math.min(a,t.x),o=Math.min(o,t.y)}):(a=Math.min(a,e.x),o=Math.min(o,e.y));let l=i-t.width/2-a,c=n-t.height/2-o;for(let h=0;h<e.length;h++){let i=e[h],n=e[h<e.length-1?h+1:0],a=nb(t,r,{x:l+i.x,y:c+i.y},{x:l+n.x,y:c+n.y});a&&s.push(a)}return s.length?(s.length>1&&s.sort(function(t,e){let i=t.x-r.x,n=t.y-r.y,s=Math.sqrt(i*i+n*n),a=e.x-r.x,o=e.y-r.y,l=Math.sqrt(a*a+o*o);return s<l?-1:s===l?0:1}),s[0]):t}_n(sb,"intersectPolygon");var ab={node:Kx,circle:eb,ellipse:Qx,polygon:sb,rect:zx};function ob(t,e){const{labelStyles:r}=Bf(e);e.labelStyle=r;const i=Ix(e);let n=i;i||(n="anchor");const s=t.insert("g").attr("class",n).attr("id",e.domId||e.id),{cssStyles:a}=e,o=Lx.svg(s),l=Mf(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(l.roughness=0);const c=o.circle(0,0,2,l),h=s.insert(()=>c,":first-child");return h.attr("class","anchor").attr("style",Cf(a)),Nx(e,h),e.intersect=function(t){return Bn.info("Circle intersect",e,1,t),ab.circle(e,1,t)},s}function lb(t,e,r,i,n,s,a){const o=(t+r)/2,l=(e+i)/2,c=Math.atan2(i-e,r-t),h=(r-t)/2/n,d=(i-e)/2/s,u=Math.sqrt(h**2+d**2);if(u>1)throw new Error("The given radii are too small to create an arc between the points.");const p=Math.sqrt(1-u**2),g=o+p*s*Math.sin(c)*(a?-1:1),f=l-p*n*Math.cos(c)*(a?-1:1),m=Math.atan2((e-f)/s,(t-g)/n);let y=Math.atan2((i-f)/s,(r-g)/n)-m;a&&y<0&&(y+=2*Math.PI),!a&&y>0&&(y-=2*Math.PI);const x=[];for(let b=0;b<20;b++){const t=m+b/19*y,e=g+n*Math.cos(t),r=f+s*Math.sin(t);x.push({x:e,y:r})}return x}async function cb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=s.width+e.padding+20,o=s.height+e.padding,l=o/2,c=l/(2.5+o/50),{cssStyles:h}=e,d=[{x:a/2,y:-o/2},{x:-a/2,y:-o/2},...lb(-a/2,-o/2,-a/2,o/2,c,l,!1),{x:a/2,y:o/2},...lb(a/2,o/2,a/2,-o/2,c,l,!0)],u=Lx.svg(n),p=Mf(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=Ox(d),f=u.path(g,p),m=n.insert(()=>f,":first-child");return m.attr("class","basic label-container"),h&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",h),i&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",i),m.attr("transform",`translate(${c/2}, 0)`),Nx(e,m),e.intersect=function(t){return ab.polygon(e,d,t)},n}function hb(t,e,r,i){return t.insert("polygon",":first-child").attr("points",i.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}async function db(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}
2=await jx(t,e,Ix(e)),a=s.height+e.padding,o=s.width+e.padding+12,l=-a,c=[{x:12,y:l},{x:o,y:l},{x:o,y:0},{x:0,y:0},{x:0,y:l+12},{x:12,y:l}];let h;const{cssStyles:d}=e;if("handDrawn"===e.look){const t=Lx.svg(n),r=Mf(e,{}),i=Ox(c),s=t.path(i,r);h=n.insert(()=>s,":first-child").attr("transform",`translate(${-o/2}, ${a/2})`),d&&h.attr("style",d)}else h=hb(n,o,a,c);return i&&h.attr("style",i),Nx(e,h),e.intersect=function(t){return ab.polygon(e,c,t)},n}function ub(t,e){const{nodeStyles:r}=Bf(e);e.label="";const i=t.insert("g").attr("class",Ix(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,s=Math.max(28,e.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],o=Lx.svg(i),l=Mf(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=Ox(a),h=o.path(c,l),d=i.insert(()=>h,":first-child");return n&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",n),r&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(t){return ab.polygon(e,a,t)},i}async function pb(t,e,r){const{labelStyles:i,nodeStyles:n}=Bf(e);e.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:o}=await jx(t,e,Ix(e)),l=r?.padding??o,c=a.width/2+l;let h;const{cssStyles:d}=e;if("handDrawn"===e.look){const t=Lx.svg(s),r=Mf(e,{}),i=t.circle(0,0,2*c,r);h=s.insert(()=>i,":first-child"),h.attr("class","basic label-container").attr("style",Cf(d))}else h=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",n).attr("r",c).attr("cx",0).attr("cy",0);return Nx(e,h),e.calcIntersect=function(t,e){const r=t.width/2;return ab.circle(t,r,e)},e.intersect=function(t){return Bn.info("Circle intersect",e,c,t),ab.circle(e,c,t)},s}function gb(t){const e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=2*t;return`M ${-i/2*e},${i/2*r} L ${i/2*e},${-i/2*r}\n                   M ${i/2*e},${i/2*r} L ${-i/2*e},${-i/2*r}`}function fb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r,e.label="";const n=t.insert("g").attr("class",Ix(e)).attr("id",e.domId??e.id),s=Math.max(30,e?.width??0),{cssStyles:a}=e,o=Lx.svg(n),l=Mf(e,{});"handDrawn"!==e.look&&(l.roughness=0,l.fillStyle="solid");const c=o.circle(0,0,2*s,l),h=gb(s),d=o.path(h,l),u=n.insert(()=>c,":first-child");return u.insert(()=>d),a&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",a),i&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",i),Nx(e,u),e.intersect=function(t){return Bn.info("crossedCircle intersect",e,{radius:s,point:t}),ab.circle(e,s,t)},n}function mb(t,e,r,i=100,n=0,s=180){const a=[],o=n*Math.PI/180,l=(s*Math.PI/180-o)/(i-1);for(let c=0;c<i;c++){const i=o+c*l,n=t+r*Math.cos(i),s=e+r*Math.sin(i);a.push({x:-n,y:-s})}return a}async function yb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=s.width+(e.padding??0),l=s.height+(e.padding??0),c=Math.max(5,.1*l),{cssStyles:h}=e,d=[...mb(o/2,-l/2,c,30,-90,0),{x:-o/2-c,y:c},...mb(o/2+2*c,-c,c,20,-180,-270),...mb(o/2+2*c,c,c,20,-90,-180),{x:-o/2-c,y:-l/2},...mb(o/2,l/2,c,20,0,90)],u=[{x:o/2,y:-l/2-c},{x:-o/2,y:-l/2-c},...mb(o/2,-l/2,c,20,-90,0),{x:-o/2-c,y:-c},...mb(o/2+.1*o,-c,c,20,-180,-270),...mb(o/2+.1*o,c,c,20,-90,-180),{x:-o/2-c,y:l/2},...mb(o/2,l/2,c,20,0,90),{x:-o/2,y:l/2+c},{x:o/2,y:l/2+c}],p=Lx.svg(n),g=Mf(e,{fill:"none"});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=Ox(d).replace("Z",""),m=p.path(f,g),y=Ox(u),x=p.path(y,{...g}),b=n.insert("g",":first-child");return b.insert(()=>x,":first-child").attr("stroke-opacity",0),b.insert(()=>m,":first-child"),b.attr("class","text"),h&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",h),i&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",i),b.attr("transform",`translate(${c}, 0)`),a.attr("transform",`translate(${-o/2+c-(s.x-(s.left??0))},${-l/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Nx(e,b),e.intersect=function(t){return ab.polygon(e,u,t)},n}function xb(t,e,r,i=100,n=0,s=180){const a=[],o=n*Math.PI/180,l=(s*Math.PI/180-o)/(i-1);for(let c=0;c<i;c++){const i=o+c*l,n=t+r*Math.cos(i),s=e+r*Math.sin(i);a.push({x:n,y:s})}return a}async function bb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}
2=await jx(t,e,Ix(e)),o=s.width+(e.padding??0),l=s.height+(e.padding??0),c=Math.max(5,.1*l),{cssStyles:h}=e,d=[...xb(o/2,-l/2,c,20,-90,0),{x:o/2+c,y:-c},...xb(o/2+2*c,-c,c,20,-180,-270),...xb(o/2+2*c,c,c,20,-90,-180),{x:o/2+c,y:l/2},...xb(o/2,l/2,c,20,0,90)],u=[{x:-o/2,y:-l/2-c},{x:o/2,y:-l/2-c},...xb(o/2,-l/2,c,20,-90,0),{x:o/2+c,y:-c},...xb(o/2+2*c,-c,c,20,-180,-270),...xb(o/2+2*c,c,c,20,-90,-180),{x:o/2+c,y:l/2},...xb(o/2,l/2,c,20,0,90),{x:o/2,y:l/2+c},{x:-o/2,y:l/2+c}],p=Lx.svg(n),g=Mf(e,{fill:"none"});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=Ox(d).replace("Z",""),m=p.path(f,g),y=Ox(u),x=p.path(y,{...g}),b=n.insert("g",":first-child");return b.insert(()=>x,":first-child").attr("stroke-opacity",0),b.insert(()=>m,":first-child"),b.attr("class","text"),h&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",h),i&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",i),b.attr("transform",`translate(${-c}, 0)`),a.attr("transform",`translate(${-o/2+(e.padding??0)/2-(s.x-(s.left??0))},${-l/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Nx(e,b),e.intersect=function(t){return ab.polygon(e,u,t)},n}function Cb(t,e,r,i=100,n=0,s=180){const a=[],o=n*Math.PI/180,l=(s*Math.PI/180-o)/(i-1);for(let c=0;c<i;c++){const i=o+c*l,n=t+r*Math.cos(i),s=e+r*Math.sin(i);a.push({x:-n,y:-s})}return a}async function wb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=s.width+(e.padding??0),l=s.height+(e.padding??0),c=Math.max(5,.1*l),{cssStyles:h}=e,d=[...Cb(o/2,-l/2,c,30,-90,0),{x:-o/2-c,y:c},...Cb(o/2+2*c,-c,c,20,-180,-270),...Cb(o/2+2*c,c,c,20,-90,-180),{x:-o/2-c,y:-l/2},...Cb(o/2,l/2,c,20,0,90)],u=[...Cb(-o/2+c+c/2,-l/2,c,20,-90,-180),{x:o/2-c/2,y:c},...Cb(-o/2-c/2,-c,c,20,0,90),...Cb(-o/2-c/2,c,c,20,-90,0),{x:o/2-c/2,y:-c},...Cb(-o/2+c+c/2,l/2,c,30,-180,-270)],p=[{x:o/2,y:-l/2-c},{x:-o/2,y:-l/2-c},...Cb(o/2,-l/2,c,20,-90,0),{x:-o/2-c,y:-c},...Cb(o/2+2*c,-c,c,20,-180,-270),...Cb(o/2+2*c,c,c,20,-90,-180),{x:-o/2-c,y:l/2},...Cb(o/2,l/2,c,20,0,90),{x:-o/2,y:l/2+c},{x:o/2-c-c/2,y:l/2+c},...Cb(-o/2+c+c/2,-l/2,c,20,-90,-180),{x:o/2-c/2,y:c},...Cb(-o/2-c/2,-c,c,20,0,90),...Cb(-o/2-c/2,c,c,20,-90,0),{x:o/2-c/2,y:-c},...Cb(-o/2+c+c/2,l/2,c,30,-180,-270)],g=Lx.svg(n),f=Mf(e,{fill:"none"});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=Ox(d).replace("Z",""),y=g.path(m,f),x=Ox(u).replace("Z",""),b=g.path(x,f),C=Ox(p),w=g.path(C,{...f}),k=n.insert("g",":first-child");return k.insert(()=>w,":first-child").attr("stroke-opacity",0),k.insert(()=>y,":first-child"),k.insert(()=>b,":first-child"),k.attr("class","text"),h&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",h),i&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(${c-c/4}, 0)`),a.attr("transform",`translate(${-o/2+(e.padding??0)/2-(s.x-(s.left??0))},${-l/2+(e.padding??0)/2-(s.y-(s.top??0))})`),Nx(e,k),e.intersect=function(t){return ab.polygon(e,p,t)},n}async function kb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=Math.max(80,1.25*(s.width+2*(e.padding??0)),e?.width??0),o=Math.max(20,s.height+2*(e.padding??0),e?.height??0),l=o/2,{cssStyles:c}=e,h=Lx.svg(n),d=Mf(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");const u=a-l,p=o/4,g=[{x:u,y:0},{x:p,y:0},{x:0,y:o/2},{x:p,y:o},{x:u,y:o},...Rx(-u,-o/2,l,50,270,90)],f=Ox(g),m=h.path(f,d),y=n.insert(()=>m,":first-child");return y.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",c),i&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",i),y.attr("transform",`translate(${-a/2}, ${-o/2})`),Nx(e,y),e.intersect=function(t){return ab.polygon(e,g,t)},n}_n(ob,"anchor"),_n(lb,"generateArcPoints"),_n(cb,"bowTieRect"),_n(hb,"insertPolygonShape"),_n(db,"card"),_n(ub,"choice"),_n(pb,"circle"),_n(gb,"createLine"),_n(fb,"crossedCircle"),_n(mb,"generateCirclePoints"),_n(yb,"curlyBraceLeft"),_n(xb,"generateCirclePoints"),_n(bb,"curlyBraceRight"),_n(Cb,"generateCirclePoints"),_n(wb,"curlyBraces"),_n(kb,"curvedTrapezoid");var vb=_n((t,e,r,i,n,s)=>[`M${t},${e+s}`,`a${n},${s} 0,0,0 ${r},0`,`a${n},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${s} 0,0,0 ${r},0`,"l0,"+-i].join(" "),"createCylinderPathD"),Sb=_n((t,e,r,i,n,s)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${n},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${s} 0,0,0 ${r},0`,"l0,"+-i].join(" "),"createOuterCylinderPathD"),_b=_n((t,e,r,i,n,s)=>[`M${t-r/2},${-i/2}`,`a${n},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function Tb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}
2=await jx(t,e,Ix(e)),o=Math.max(s.width+e.padding,e.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(s.height+c+e.padding,e.height??0);let d;const{cssStyles:u}=e;if("handDrawn"===e.look){const t=Lx.svg(n),r=Sb(0,0,o,h,l,c),i=_b(0,c,o,h,l,c),s=t.path(r,Mf(e,{})),a=t.path(i,Mf(e,{fill:"none"}));d=n.insert(()=>a,":first-child"),d=n.insert(()=>s,":first-child"),d.attr("class","basic label-container"),u&&d.attr("style",u)}else{const t=vb(0,0,o,h,l,c);d=n.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",Cf(u)).attr("style",i)}return d.attr("label-offset-y",c),d.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),Nx(e,d),a.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-s.height/2+(e.padding??0)/1.5-(s.y-(s.top??0))})`),e.intersect=function(t){const r=ab.rect(e,t),i=r.x-(e.x??0);if(0!=l&&(Math.abs(i)<(e.width??0)/2||Math.abs(i)==(e.width??0)/2&&Math.abs(r.y-(e.y??0))>(e.height??0)/2-c)){let n=c*c*(1-i*i/(l*l));n>0&&(n=Math.sqrt(n)),n=c-n,t.y-(e.y??0)>0&&(n=-n),r.y+=n}return r},n}async function Ab(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=s.width+e.padding,l=s.height+e.padding,c=.2*l,h=-o/2,d=-l/2-c/2,{cssStyles:u}=e,p=Lx.svg(n),g=Mf(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=[{x:h,y:d+c},{x:-h,y:d+c},{x:-h,y:-d},{x:h,y:-d},{x:h,y:d},{x:-h,y:d},{x:-h,y:d+c}],m=p.polygon(f.map(t=>[t.x,t.y]),g),y=n.insert(()=>m,":first-child");return y.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",u),i&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",i),a.attr("transform",`translate(${h+(e.padding??0)/2-(s.x-(s.left??0))}, ${d+c+(e.padding??0)/2-(s.y-(s.top??0))})`),Nx(e,y),e.intersect=function(t){return ab.rect(e,t)},n}async function Bb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,halfPadding:a}=await jx(t,e,Ix(e)),o=s.width/2+a+5,l=s.width/2+a;let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=Lx.svg(n),r=Mf(e,{roughness:.2,strokeWidth:2.5}),i=Mf(e,{roughness:.2,strokeWidth:1.5}),s=t.circle(0,0,2*o,r),a=t.circle(0,0,2*l,i);c=n.insert("g",":first-child"),c.attr("class",Cf(e.cssClasses)).attr("style",Cf(h)),c.node()?.appendChild(s),c.node()?.appendChild(a)}else{c=n.insert("g",":first-child");const t=c.insert("circle",":first-child"),e=c.insert("circle");c.attr("class","basic label-container").attr("style",i),t.attr("class","outer-circle").attr("style",i).attr("r",o).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",i).attr("r",l).attr("cx",0).attr("cy",0)}return Nx(e,c),e.intersect=function(t){return Bn.info("DoubleCircle intersect",e,o,t),ab.circle(e,o,t)},n}function Mb(t,e,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=Bf(e);e.label="",e.labelStyle=i;const s=t.insert("g").attr("class",Ix(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,o=Lx.svg(s),{nodeBorder:l}=r,c=Mf(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(c.roughness=0);const h=o.circle(0,0,14,c),d=s.insert(()=>h,":first-child");return d.selectAll("path").attr("style",`fill: ${l} !important;`),a&&a.length>0&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",a),n&&"handDrawn"!==e.look&&d.selectAll("path").attr("style",n),Nx(e,d),e.intersect=function(t){return Bn.info("filledCircle intersect",e,{radius:7,point:t}),ab.circle(e,7,t)},s}async function Eb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=s.width+(e.padding??0),l=o+s.height,c=o+s.height,h=[{x:0,y:-l},{x:c,y:-l},{x:c/2,y:0}],{cssStyles:d}=e,u=Lx.svg(n),p=Mf(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=Ox(h),f=u.path(g,p),m=n.insert(()=>f,":first-child").attr("transform",`translate(${-l/2}, ${l/2})`);return d&&"handDrawn"!==e.look&&m.selectChildren("path").attr("style",d),i&&"handDrawn"!==e.look&&m.selectChildren("path").attr("style",i),e.width=o,e.height=l,Nx(e,m),a.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}
2, ${-l/2+(e.padding??0)/2+(s.y-(s.top??0))})`),e.intersect=function(t){return Bn.info("Triangle intersect",e,h,t),ab.polygon(e,h,t)},n}function Lb(t,e,{dir:r,config:{state:i,themeVariables:n}}){const{nodeStyles:s}=Bf(e);e.label="";const a=t.insert("g").attr("class",Ix(e)).attr("id",e.domId??e.id),{cssStyles:o}=e;let l=Math.max(70,e?.width??0),c=Math.max(10,e?.height??0);"LR"===r&&(l=Math.max(10,e?.width??0),c=Math.max(70,e?.height??0));const h=-1*l/2,d=-1*c/2,u=Lx.svg(a),p=Mf(e,{stroke:n.lineColor,fill:n.lineColor});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=u.rectangle(h,d,l,c,p),f=a.insert(()=>g,":first-child");o&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",o),s&&"handDrawn"!==e.look&&f.selectAll("path").attr("style",s),Nx(e,f);const m=i?.padding??0;return e.width&&e.height&&(e.width+=m/2||0,e.height+=m/2||0),e.intersect=function(t){return ab.rect(e,t)},a}async function jb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=Math.max(80,s.width+2*(e.padding??0),e?.width??0),o=Math.max(50,s.height+2*(e.padding??0),e?.height??0),l=o/2,{cssStyles:c}=e,h=Lx.svg(n),d=Mf(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");const u=[{x:-a/2,y:-o/2},{x:a/2-l,y:-o/2},...Rx(-a/2+l,0,l,50,90,270),{x:a/2-l,y:o/2},{x:-a/2,y:o/2}],p=Ox(u),g=h.path(p,d),f=n.insert(()=>g,":first-child");return f.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",c),i&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",i),Nx(e,f),e.intersect=function(t){return Bn.info("Pill intersect",e,{radius:l,point:t}),ab.polygon(e,u,t)},n}_n(Tb,"cylinder"),_n(Ab,"dividedRectangle"),_n(Bb,"doublecircle"),_n(Mb,"filledCircle"),_n(Eb,"flippedTriangle"),_n(Lb,"forkJoin"),_n(jb,"halfRoundedRectangle");var Fb=_n((t,e,r,i,n)=>[`M${t+n},${e}`,`L${t+r-n},${e}`,`L${t+r},${e-i/2}`,`L${t+r-n},${e-i}`,`L${t+n},${e-i}`,`L${t},${e-i/2}`,"Z"].join(" "),"createHexagonPathD");async function Nb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=s.height+e.padding,o=a/4,l=s.width+2*o+e.padding,c=[{x:o,y:0},{x:l-o,y:0},{x:l,y:-a/2},{x:l-o,y:-a},{x:o,y:-a},{x:0,y:-a/2}];let h;const{cssStyles:d}=e;if("handDrawn"===e.look){const t=Lx.svg(n),r=Mf(e,{}),i=Fb(0,0,l,a,o),s=t.path(i,r);h=n.insert(()=>s,":first-child").attr("transform",`translate(${-l/2}, ${a/2})`),d&&h.attr("style",d)}else h=hb(n,l,a,c);return i&&h.attr("style",i),e.width=l,e.height=a,Nx(e,h),e.intersect=function(t){return ab.polygon(e,c,t)},n}async function Ib(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.label="",e.labelStyle=r;const{shapeSvg:n}=await jx(t,e,Ix(e)),s=Math.max(30,e?.width??0),a=Math.max(30,e?.height??0),{cssStyles:o}=e,l=Lx.svg(n),c=Mf(e,{});"handDrawn"!==e.look&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=Ox(h),u=l.path(d,c),p=n.insert(()=>u,":first-child");return p.attr("class","basic label-container"),o&&"handDrawn"!==e.look&&p.selectChildren("path").attr("style",o),i&&"handDrawn"!==e.look&&p.selectChildren("path").attr("style",i),p.attr("transform",`translate(${-s/2}, ${-a/2})`),Nx(e,p),e.intersect=function(t){return Bn.info("Pill intersect",e,{points:h}),ab.polygon(e,h,t)},n}async function Ob(t,e,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Bf(e);e.labelStyle=n;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=i?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:d}=await jx(t,e,"icon-shape default"),u="t"===e.pos,p=o,g=o,{nodeBorder:f}=r,{stylesMap:m}=_f(e),y=-g/2,x=-p/2,b=e.label?8:0,C=Lx.svg(c),w=Mf(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");const k=C.rectangle(y,x,g,p,w),v=Math.max(g,h.width),S=p+h.height+b,_=C.rectangle(-v/2,-S/2,v,S,{...w,fill:"transparent",stroke:"none"}),T=c.insert(()=>k,":first-child"),A=c.insert(()=>_);if(e.icon){const t=c.append("g");t.html(`<g>${await dy(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const r=t.node().getBBox(),i=r.width,n=r.height,s=r.x,a=r.y;t.attr("transform",`translate(${-i/2-s},${u?h.height/2+b/2-n/2-a:-h.height/2-b/2-n/2-a})`),t.attr("style",`color: ${m.get("stroke")??f};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-S/2:S/2-h.height})`),T.attr("transform",`translate(0,${u?h.height/2+b/2:-h.height/2-b/2})`),Nx(e,A),e.intersect=function(t){if(Bn.info("iconSquare intersect",e,t),!e.label)return ab.rect(e,t);const r=e.x??0,i=e.y??0,n=e.height??0;let s=[];return s=u?[{x:r-h.width/2,y:i-n/2},{x:r+h.width/2,y:i-n/2},{x:r+h.width/2,y:i-n/2+h.height+b},{x:r+g/2,y:i-n/2+h.height+b},{x:r+g/2,y:i+n/2},{x:r-g/2,y:i+n/2},{x:r-g/2,y:i-n/2+h.height+b},{x:r-h.width/2,y:i-n/2+h.height+b}]:[{x:r-g/2,y:i-n/2},{x:r+g/2,y:i-n/2},{x:r+g/2,y:i-n/2+p},{x:r+h.width/2,y:i-n/2+p},{x:r+h.width/2/2,y:i+n/2},{x:r-h.width/2,y:i+n/2},{x:r-h.width/2,y:i-n/2+p},{x:r-g/2,y:i-n/2+p}],ab.polygon(e,s,t)},c}async function Db(t,e,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Bf(e);e.labelStyle=n;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=i?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,label:d}
2=await jx(t,e,"icon-shape default"),u=e.label?8:0,p="t"===e.pos,{nodeBorder:g,mainBkg:f}=r,{stylesMap:m}=_f(e),y=Lx.svg(c),x=Mf(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");const b=m.get("fill");x.stroke=b??f;const C=c.append("g");e.icon&&C.html(`<g>${await dy(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const w=C.node().getBBox(),k=w.width,v=w.height,S=w.x,_=w.y,T=Math.max(k,v)*Math.SQRT2+40,A=y.circle(0,0,T,x),B=Math.max(T,h.width),M=T+h.height+u,E=y.rectangle(-B/2,-M/2,B,M,{...x,fill:"transparent",stroke:"none"}),L=c.insert(()=>A,":first-child"),j=c.insert(()=>E);return C.attr("transform",`translate(${-k/2-S},${p?h.height/2+u/2-v/2-_:-h.height/2-u/2-v/2-_})`),C.attr("style",`color: ${m.get("stroke")??g};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-M/2:M/2-h.height})`),L.attr("transform",`translate(0,${p?h.height/2+u/2:-h.height/2-u/2})`),Nx(e,j),e.intersect=function(t){return Bn.info("iconSquare intersect",e,t),ab.rect(e,t)},c}async function Rb(t,e,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Bf(e);e.labelStyle=n;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=i?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await jx(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*d,f=o+2*d,{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=_f(e),b=-f/2,C=-g/2,w=e.label?8:0,k=Lx.svg(c),v=Mf(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");const S=x.get("fill");v.stroke=S??y;const _=k.path(Px(b,C,f,g,5),v),T=Math.max(f,h.width),A=g+h.height+w,B=k.rectangle(-T/2,-A/2,T,A,{...v,fill:"transparent",stroke:"none"}),M=c.insert(()=>_,":first-child").attr("class","icon-shape2"),E=c.insert(()=>B);if(e.icon){const t=c.append("g");t.html(`<g>${await dy(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const r=t.node().getBBox(),i=r.width,n=r.height,s=r.x,a=r.y;t.attr("transform",`translate(${-i/2-s},${p?h.height/2+w/2-n/2-a:-h.height/2-w/2-n/2-a})`),t.attr("style",`color: ${x.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-A/2:A/2-h.height})`),M.attr("transform",`translate(0,${p?h.height/2+w/2:-h.height/2-w/2})`),Nx(e,E),e.intersect=function(t){if(Bn.info("iconSquare intersect",e,t),!e.label)return ab.rect(e,t);const r=e.x??0,i=e.y??0,n=e.height??0;let s=[];return s=p?[{x:r-h.width/2,y:i-n/2},{x:r+h.width/2,y:i-n/2},{x:r+h.width/2,y:i-n/2+h.height+w},{x:r+f/2,y:i-n/2+h.height+w},{x:r+f/2,y:i+n/2},{x:r-f/2,y:i+n/2},{x:r-f/2,y:i-n/2+h.height+w},{x:r-h.width/2,y:i-n/2+h.height+w}]:[{x:r-f/2,y:i-n/2},{x:r+f/2,y:i-n/2},{x:r+f/2,y:i-n/2+g},{x:r+h.width/2,y:i-n/2+g},{x:r+h.width/2/2,y:i+n/2},{x:r-h.width/2,y:i+n/2},{x:r-h.width/2,y:i-n/2+g},{x:r-f/2,y:i-n/2+g}],ab.polygon(e,s,t)},c}async function zb(t,e,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:n}=Bf(e);e.labelStyle=n;const s=e.assetHeight??48,a=e.assetWidth??48,o=Math.max(s,a),l=i?.wrappingWidth;e.width=Math.max(o,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await jx(t,e,"icon-shape default"),p="t"===e.pos,g=o+2*d,f=o+2*d,{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=_f(e),b=-f/2,C=-g/2,w=e.label?8:0,k=Lx.svg(c),v=Mf(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");const S=x.get("fill");v.stroke=S??y;const _=k.path(Px(b,C,f,g,.1),v),T=Math.max(f,h.width),A=g+h.height+w,B=k.rectangle(-T/2,-A/2,T,A,{...v,fill:"transparent",stroke:"none"}),M=c.insert(()=>_,":first-child"),E=c.insert(()=>B);if(e.icon){const t=c.append("g");t.html(`<g>${await dy(e.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);const r=t.node().getBBox(),i=r.width,n=r.height,s=r.x,a=r.y;t.attr("transform",`translate(${-i/2-s},${p?h.height/2+w/2-n/2-a:-h.height/2-w/2-n/2-a})`),t.attr("style",`color: ${x.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-A/2:A/2-h.height})`),M.attr("transform",`translate(0,${p?h.height/2+w/2:-h.height/2-w/2})`),Nx(e,E),e.intersect=function(t){if(Bn.info("iconSquare intersect",e,t),!e.label)return ab.rect(e,t);const r=e.x??0,i=e.y??0,n=e.height??0;let s=[];return s=p?[{x:r-h.width/2,y:i-n/2},{x:r+h.width/2,y:i-n/2},{x:r+h.width/2,y:i-n/2+h.height+w},{x:r+f/2,y:i-n/2+h.height+w},{x:r+f/2,y:i+n/2},{x:r-f/2,y:i+n/2},{x:r-f/2,y:i-n/2+h.height+w},{x:r-h.width/2,y:i-n/2+h.height+w}]:[{x:r-f/2,y:i-n/2},{x:r+f/2,y:i-n/2},{x:r+f/2,y:i-n/2+g},{x:r+h.width/2,y:i-n/2+g},{x:r+h.width/2/2,y:i+n/2},{x:r-h.width/2,y:i+n/2},{x:r-h.width/2,y:i-n/2+g},{x:r-f/2,y:i-n/2+g}],ab.polygon(e,s,t)},c}async function $b(t,e,{config:{flowchart:r}}){const i=new Image;i.src=e?.img??"",await i.decode();
2const n=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));e.imageAspectRatio=n/s;const{labelStyles:a}=Bf(e);e.labelStyle=a;const o=r?.wrappingWidth;e.defaultWidth=r?.wrappingWidth;const l=Math.max(e.label?o??0:0,e?.assetWidth??n),c="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:l,h="on"===e.constraint?c/e.imageAspectRatio:e?.assetHeight??s;e.width=Math.max(c,o??0);const{shapeSvg:d,bbox:u,label:p}=await jx(t,e,"image-shape default"),g="t"===e.pos,f=-c/2,m=-h/2,y=e.label?8:0,x=Lx.svg(d),b=Mf(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");const C=x.rectangle(f,m,c,h,b),w=Math.max(c,u.width),k=h+u.height+y,v=x.rectangle(-w/2,-k/2,w,k,{...b,fill:"none",stroke:"none"}),S=d.insert(()=>C,":first-child"),_=d.insert(()=>v);if(e.img){const t=d.append("image");t.attr("href",e.img),t.attr("width",c),t.attr("height",h),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-c/2},${g?k/2-h:-k/2})`)}return p.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${g?-h/2-u.height/2-y/2:h/2-u.height/2+y/2})`),S.attr("transform",`translate(0,${g?u.height/2+y/2:-u.height/2-y/2})`),Nx(e,_),e.intersect=function(t){if(Bn.info("iconSquare intersect",e,t),!e.label)return ab.rect(e,t);const r=e.x??0,i=e.y??0,n=e.height??0;let s=[];return s=g?[{x:r-u.width/2,y:i-n/2},{x:r+u.width/2,y:i-n/2},{x:r+u.width/2,y:i-n/2+u.height+y},{x:r+c/2,y:i-n/2+u.height+y},{x:r+c/2,y:i+n/2},{x:r-c/2,y:i+n/2},{x:r-c/2,y:i-n/2+u.height+y},{x:r-u.width/2,y:i-n/2+u.height+y}]:[{x:r-c/2,y:i-n/2},{x:r+c/2,y:i-n/2},{x:r+c/2,y:i-n/2+h},{x:r+u.width/2,y:i-n/2+h},{x:r+u.width/2/2,y:i+n/2},{x:r-u.width/2,y:i+n/2},{x:r-u.width/2,y:i-n/2+h},{x:r-c/2,y:i-n/2+h}],ab.polygon(e,s,t)},d}async function Pb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=Math.max(s.width+2*(e.padding??0),e?.width??0),o=Math.max(s.height+2*(e.padding??0),e?.height??0),l=[{x:0,y:0},{x:a,y:0},{x:a+3*o/6,y:-o},{x:-3*o/6,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=Lx.svg(n),r=Mf(e,{}),i=Ox(l),s=t.path(i,r);c=n.insert(()=>s,":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),h&&c.attr("style",h)}else c=hb(n,a,o,l);return i&&c.attr("style",i),e.width=a,e.height=o,Nx(e,c),e.intersect=function(t){return ab.polygon(e,l,t)},n}async function qb(t,e,r){const{labelStyles:i,nodeStyles:n}=Bf(e);e.labelStyle=i;const{shapeSvg:s,bbox:a}=await jx(t,e,Ix(e)),o=Math.max(a.width+2*r.labelPaddingX,e?.width||0),l=Math.max(a.height+2*r.labelPaddingY,e?.height||0),c=-o/2,h=-l/2;let d,{rx:u,ry:p}=e;const{cssStyles:g}=e;if(r?.rx&&r.ry&&(u=r.rx,p=r.ry),"handDrawn"===e.look){const t=Lx.svg(s),r=Mf(e,{}),i=u||p?t.path(Px(c,h,o,l,u||0),r):t.rectangle(c,h,o,l,r);d=s.insert(()=>i,":first-child"),d.attr("class","basic label-container").attr("style",Cf(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",n).attr("rx",Cf(u)).attr("ry",Cf(p)).attr("x",c).attr("y",h).attr("width",o).attr("height",l);return Nx(e,d),e.calcIntersect=function(t,e){return ab.rect(t,e)},e.intersect=function(t){return ab.rect(e,t)},s}async function Wb(t,e){const{shapeSvg:r,bbox:i,label:n}=await jx(t,e,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),n.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${-i.height/2-(i.y-(i.top??0))})`),Nx(e,s),e.intersect=function(t){return ab.rect(e,t)},r}async function Hb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=Math.max(s.width+(e.padding??0),e?.width??0),o=Math.max(s.height+(e.padding??0),e?.height??0),l=[{x:0,y:0},{x:a+3*o/6,y:0},{x:a,y:-o},{x:-3*o/6,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=Lx.svg(n),r=Mf(e,{}),i=Ox(l),s=t.path(i,r);c=n.insert(()=>s,":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),h&&c.attr("style",h)}else c=hb(n,a,o,l);return i&&c.attr("style",i),e.width=a,e.height=o,Nx(e,c),e.intersect=function(t){return ab.polygon(e,l,t)},n}async function Vb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}
2=await jx(t,e,Ix(e)),a=Math.max(s.width+(e.padding??0),e?.width??0),o=Math.max(s.height+(e.padding??0),e?.height??0),l=[{x:-3*o/6,y:0},{x:a,y:0},{x:a+3*o/6,y:-o},{x:0,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=Lx.svg(n),r=Mf(e,{}),i=Ox(l),s=t.path(i,r);c=n.insert(()=>s,":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),h&&c.attr("style",h)}else c=hb(n,a,o,l);return i&&c.attr("style",i),e.width=a,e.height=o,Nx(e,c),e.intersect=function(t){return ab.polygon(e,l,t)},n}function Yb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.label="",e.labelStyle=r;const n=t.insert("g").attr("class",Ix(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,a=Math.max(35,e?.width??0),o=Math.max(35,e?.height??0),l=[{x:a,y:0},{x:0,y:o+3.5},{x:a-14,y:o+3.5},{x:0,y:2*o},{x:a,y:o-3.5},{x:14,y:o-3.5}],c=Lx.svg(n),h=Mf(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");const d=Ox(l),u=c.path(d,h),p=n.insert(()=>u,":first-child");return s&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",s),i&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",i),p.attr("transform",`translate(-${a/2},${-o})`),Nx(e,p),e.intersect=function(t){return Bn.info("lightningBolt intersect",e,t),ab.polygon(e,l,t)},n}_n(Nb,"hexagon"),_n(Ib,"hourglass"),_n(Ob,"icon"),_n(Db,"iconCircle"),_n(Rb,"iconRounded"),_n(zb,"iconSquare"),_n($b,"imageSquare"),_n(Pb,"inv_trapezoid"),_n(qb,"drawRect"),_n(Wb,"labelRect"),_n(Hb,"lean_left"),_n(Vb,"lean_right"),_n(Yb,"lightningBolt");var Ub=_n((t,e,r,i,n,s,a)=>[`M${t},${e+s}`,`a${n},${s} 0,0,0 ${r},0`,`a${n},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${s} 0,0,0 ${r},0`,"l0,"+-i,`M${t},${e+s+a}`,`a${n},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Gb=_n((t,e,r,i,n,s,a)=>[`M${t},${e+s}`,`M${t+r},${e+s}`,`a${n},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${n},${s} 0,0,0 ${r},0`,"l0,"+-i,`M${t},${e+s+a}`,`a${n},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Jb=_n((t,e,r,i,n,s)=>[`M${t-r/2},${-i/2}`,`a${n},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function Xb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=Math.max(s.width+(e.padding??0),e.width??0),l=o/2,c=l/(2.5+o/50),h=Math.max(s.height+c+(e.padding??0),e.height??0),d=.1*h;let u;const{cssStyles:p}=e;if("handDrawn"===e.look){const t=Lx.svg(n),r=Gb(0,0,o,h,l,c,d),i=Jb(0,c,o,h,l,c),s=Mf(e,{}),a=t.path(r,s),g=t.path(i,s);n.insert(()=>g,":first-child").attr("class","line"),u=n.insert(()=>a,":first-child"),u.attr("class","basic label-container"),p&&u.attr("style",p)}else{const t=Ub(0,0,o,h,l,c,d);u=n.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",Cf(p)).attr("style",i)}return u.attr("label-offset-y",c),u.attr("transform",`translate(${-o/2}, ${-(h/2+c)})`),Nx(e,u),a.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-s.height/2+c-(s.y-(s.top??0))})`),e.intersect=function(t){const r=ab.rect(e,t),i=r.x-(e.x??0);if(0!=l&&(Math.abs(i)<(e.width??0)/2||Math.abs(i)==(e.width??0)/2&&Math.abs(r.y-(e.y??0))>(e.height??0)/2-c)){let n=c*c*(1-i*i/(l*l));n>0&&(n=Math.sqrt(n)),n=c-n,t.y-(e.y??0)>0&&(n=-n),r.y+=n}return r},n}async function Kb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=Math.max(s.width+2*(e.padding??0),e?.width??0),l=Math.max(s.height+2*(e.padding??0),e?.height??0),c=l/4,h=l+c,{cssStyles:d}=e,u=Lx.svg(n),p=Mf(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=[{x:-o/2-o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:h/2},...Dx(-o/2-o/2*.1,h/2,o/2+o/2*.1,h/2,c,.8),{x:o/2+o/2*.1,y:-h/2},{x:-o/2-o/2*.1,y:-h/2},{x:-o/2,y:-h/2},{x:-o/2,y:h/2*1.1},{x:-o/2,y:-h/2}],f=u.polygon(g.map(t=>[t.x,t.y]),p),m=n.insert(()=>f,":first-child");return m.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",d),i&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",i),m.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-o/2+(e.padding??0)+o/2*.1/2-(s.x-(s.left??0))},${-l/2+(e.padding??0)-c/2-(s.y-(s.top??0))})`),Nx(e,m),e.intersect=function(t){return ab.polygon(e,g,t)},n}async function Zb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}
2=await jx(t,e,Ix(e)),o=Math.max(s.width+2*(e.padding??0),e?.width??0),l=Math.max(s.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:d}=e,u=Lx.svg(n),p=Mf(e,{}),g=[{x:c-5,y:h+5},{x:c-5,y:h+l+5},{x:c+o-5,y:h+l+5},{x:c+o-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h+l-5},{x:c+o+5,y:h+l-5},{x:c+o+5,y:h-5},{x:c+5,y:h-5},{x:c+5,y:h},{x:c,y:h},{x:c,y:h+5}],f=[{x:c,y:h+5},{x:c+o-5,y:h+5},{x:c+o-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h},{x:c,y:h}];"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const m=Ox(g),y=u.path(m,p),x=Ox(f),b=u.path(x,{...p,fill:"none"}),C=n.insert(()=>b,":first-child");return C.insert(()=>y,":first-child"),C.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",d),i&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",i),a.attr("transform",`translate(${-s.width/2-5-(s.x-(s.left??0))}, ${-s.height/2+5-(s.y-(s.top??0))})`),Nx(e,C),e.intersect=function(t){return ab.polygon(e,g,t)},n}async function Qb(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=Math.max(s.width+2*(e.padding??0),e?.width??0),l=Math.max(s.height+2*(e.padding??0),e?.height??0),c=l/4,h=l+c,d=-o/2,u=-h/2,{cssStyles:p}=e,g=Dx(d-5,u+h+5,d+o-5,u+h+5,c,.8),f=g?.[g.length-1],m=[{x:d-5,y:u+5},{x:d-5,y:u+h+5},...g,{x:d+o-5,y:f.y-5},{x:d+o,y:f.y-5},{x:d+o,y:f.y-10},{x:d+o+5,y:f.y-10},{x:d+o+5,y:u-5},{x:d+5,y:u-5},{x:d+5,y:u},{x:d,y:u},{x:d,y:u+5}],y=[{x:d,y:u+5},{x:d+o-5,y:u+5},{x:d+o-5,y:f.y-5},{x:d+o,y:f.y-5},{x:d+o,y:u},{x:d,y:u}],x=Lx.svg(n),b=Mf(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");const C=Ox(m),w=x.path(C,b),k=Ox(y),v=x.path(k,b),S=n.insert(()=>w,":first-child");return S.insert(()=>v),S.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",p),i&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-s.width/2-5-(s.x-(s.left??0))}, ${-s.height/2+5-c/2-(s.y-(s.top??0))})`),Nx(e,S),e.intersect=function(t){return ab.polygon(e,m,t)},n}async function tC(t,e,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=Bf(e);e.labelStyle=i,e.useHtmlLabels||Us(Rs())||(e.centerLabel=!0);const{shapeSvg:s,bbox:a,label:o}=await jx(t,e,Ix(e)),l=Math.max(a.width+2*(e.padding??0),e?.width??0),c=Math.max(a.height+2*(e.padding??0),e?.height??0),h=-l/2,d=-c/2,{cssStyles:u}=e,p=Lx.svg(s),g=Mf(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=p.rectangle(h,d,l,c,g),m=s.insert(()=>f,":first-child");return m.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",u),n&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",n),o.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-a.height/2-(a.y-(a.top??0))})`),Nx(e,m),e.intersect=function(t){return ab.rect(e,t)},s}_n(Xb,"linedCylinder"),_n(Kb,"linedWaveEdgedRect"),_n(Zb,"multiRect"),_n(Qb,"multiWaveEdgedRectangle"),_n(tC,"note");var eC=_n((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 rC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=s.width+e.padding+(s.height+e.padding),o=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}];let l;const{cssStyles:c}=e;if("handDrawn"===e.look){const t=Lx.svg(n),r=Mf(e,{}),i=eC(0,0,a),s=t.path(i,r);l=n.insert(()=>s,":first-child").attr("transform",`translate(${-a/2+.5}, ${a/2})`),c&&l.attr("style",c)}else l=hb(n,a,a,o),l.attr("transform",`translate(${-a/2+.5}, ${a/2})`);return i&&l.attr("style",i),Nx(e,l),e.calcIntersect=function(t,e){const r=t.width,i=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}],n=ab.polygon(t,i,e);return{x:n.x-.5,y:n.y-.5}},e.intersect=function(t){return this.calcIntersect(e,t)},n}async function iC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=-Math.max(s.width+(e.padding??0),e?.width??0)/2,l=-Math.max(s.height+(e.padding??0),e?.height??0)/2,c=l/2,h=[{x:o+c,y:l},{x:o,y:0},{x:o+c,y:-l},{x:-o,y:-l},{x:-o,y:l}],{cssStyles:d}=e,u=Lx.svg(n),p=Mf(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=Ox(h),f=u.path(g,p),m=n.insert(()=>f,":first-child");return m.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",d),i&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",i),m.attr("transform",`translate(${-c/2},0)`),a.attr("transform",`translate(${-c/2-s.width/2-(s.x-(s.left??0))}, ${-s.height/2-(s.y-(s.top??0))})`),Nx(e,m),e.intersect=function(t){return ab.polygon(e,h,t)},n}async function nC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);let n;
2e.labelStyle=r,n=e.cssClasses?"node "+e.cssClasses:"node default";const s=t.insert("g").attr("class",n).attr("id",e.domId||e.id),a=s.insert("g"),o=s.insert("g").attr("class","label").attr("style",i),l=e.description,c=e.label,h=await $x(o,c,e.labelStyle,!0,!0);let d={width:0,height:0};if(Us(qa())){const t=h.children[0],e=fl(h);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}Bn.info("Text 2",l);const u=l||[],p=h.getBBox(),g=await $x(o,Array.isArray(u)?u.join("<br/>"):u,e.labelStyle,!0,!0),f=g.children[0],m=fl(g);d=f.getBoundingClientRect(),m.attr("width",d.width),m.attr("height",d.height);const y=(e.padding||0)/2;fl(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+y+5)+")"),fl(h).attr("transform","translate( "+(d.width<p.width?0:-(p.width-d.width)/2)+", 0)"),d=o.node().getBBox(),o.attr("transform","translate("+-d.width/2+", "+(-d.height/2-y+3)+")");const x=d.width+(e.padding||0),b=d.height+(e.padding||0),C=-d.width/2-y,w=-d.height/2-y;let k,v;if("handDrawn"===e.look){const t=Lx.svg(s),r=Mf(e,{}),i=t.path(Px(C,w,x,b,e.rx||0),r),n=t.line(-d.width/2-y,-d.height/2-y+p.height+y,d.width/2+y,-d.height/2-y+p.height+y,r);v=s.insert(()=>(Bn.debug("Rough node insert CXC",i),n),":first-child"),k=s.insert(()=>(Bn.debug("Rough node insert CXC",i),i),":first-child")}else k=a.insert("rect",":first-child"),v=a.insert("line"),k.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),v.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+p.height+y).attr("y2",-d.height/2-y+p.height+y);return Nx(e,k),e.intersect=function(t){return ab.rect(e,t)},s}async function sC(t,e){return qb(t,e,{rx:5,ry:5,labelPaddingX:1*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function aC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=e?.padding??0,l=Math.max(s.width+2*(e.padding??0),e?.width??0),c=Math.max(s.height+2*(e.padding??0),e?.height??0),h=-s.width/2-o,d=-s.height/2-o,{cssStyles:u}=e,p=Lx.svg(n),g=Mf(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=[{x:h,y:d},{x:h+l+8,y:d},{x:h+l+8,y:d+c},{x:h-8,y:d+c},{x:h-8,y:d},{x:h,y:d},{x:h,y:d+c}],m=p.polygon(f.map(t=>[t.x,t.y]),g),y=n.insert(()=>m,":first-child");return y.attr("class","basic label-container").attr("style",Cf(u)),i&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",i),u&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",i),a.attr("transform",`translate(${-l/2+4+(e.padding??0)-(s.x-(s.left??0))},${-c/2+(e.padding??0)-(s.y-(s.top??0))})`),Nx(e,y),e.intersect=function(t){return ab.rect(e,t)},n}async function oC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=Math.max(s.width+2*(e.padding??0),e?.width??0),l=Math.max(s.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:d}=e,u=Lx.svg(n),p=Mf(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const g=[{x:c,y:h},{x:c,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h-l/2}],f=Ox(g),m=u.path(f,p),y=n.insert(()=>m,":first-child");return y.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",d),i&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",i),y.attr("transform",`translate(0, ${l/4})`),a.attr("transform",`translate(${-o/2+(e.padding??0)-(s.x-(s.left??0))}, ${-l/4+(e.padding??0)-(s.y-(s.top??0))})`),Nx(e,y),e.intersect=function(t){return ab.polygon(e,g,t)},n}async function lC(t,e){return qb(t,e,{rx:0,ry:0,labelPaddingX:e.labelPaddingX??2*(e?.padding||0),labelPaddingY:1*(e?.padding||0)})}async function cC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=s.height+e.padding,o=s.width+a/4+e.padding,l=a/2,{cssStyles:c}=e,h=Lx.svg(n),d=Mf(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");const u=[{x:-o/2+l,y:-a/2},{x:o/2-l,y:-a/2},...Rx(-o/2+l,0,l,50,90,270),{x:o/2-l,y:a/2},...Rx(o/2-l,0,l,50,270,450)],p=Ox(u),g=h.path(p,d),f=n.insert(()=>g,":first-child");return f.attr("class","basic label-container outer-path"),c&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",c),i&&"handDrawn"!==e.look&&f.selectChildren("path").attr("style",i),Nx(e,f),e.intersect=function(t){return ab.polygon(e,u,t)},n}async function hC(t,e){return qb(t,e,{rx:5,ry:5})}function dC(t,e,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:n}=Bf(e);e.labelStyle=i;const{cssStyles:s}=e,{lineColor:a,stateBorder:o,nodeBorder:l}=r,c=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),h=Lx.svg(c),d=Mf(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");const u=h.circle(0,0,14,{...d,stroke:a,strokeWidth:2}),p=o??l,g=h.circle(0,0,5,{...d,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),f=c.insert(()=>u,":first-child");return f.insert(()=>g),s&&f.selectAll("path").attr("style",s),n&&f.selectAll("path").attr("style",n),Nx(e,f),e.intersect=function(t){return ab.circle(e,7,t)},c}function uC(t,e,{config:{themeVariables:r}}){const{lineColor:i}=r,n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s;
2if("handDrawn"===e.look){const t=Lx.svg(n).circle(0,0,14,Sf(i));s=n.insert(()=>t),s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else s=n.insert("circle",":first-child"),s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return Nx(e,s),e.intersect=function(t){return ab.circle(e,7,t)},n}async function pC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=(e?.padding||0)/2,o=s.width+e.padding,l=s.height+e.padding,c=-s.width/2-a,h=-s.height/2-a,d=[{x:0,y:0},{x:o,y:0},{x:o,y:-l},{x:0,y:-l},{x:0,y:0},{x:-8,y:0},{x:o+8,y:0},{x:o+8,y:-l},{x:-8,y:-l},{x:-8,y:0}];if("handDrawn"===e.look){const t=Lx.svg(n),r=Mf(e,{}),i=t.rectangle(c-8,h,o+16,l,r),s=t.line(c,h,c,h+l,r),a=t.line(c+o,h,c+o,h+l,r);n.insert(()=>s,":first-child"),n.insert(()=>a,":first-child");const d=n.insert(()=>i,":first-child"),{cssStyles:u}=e;d.attr("class","basic label-container").attr("style",Cf(u)),Nx(e,d)}else{const t=hb(n,o,l,d);i&&t.attr("style",i),Nx(e,t)}return e.intersect=function(t){return ab.polygon(e,d,t)},n}async function gC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=Math.max(s.width+2*(e.padding??0),e?.width??0),o=Math.max(s.height+2*(e.padding??0),e?.height??0),l=-a/2,c=-o/2,h=.2*o,d=.2*o,{cssStyles:u}=e,p=Lx.svg(n),g=Mf(e,{}),f=[{x:l-h/2,y:c},{x:l+a+h/2,y:c},{x:l+a+h/2,y:c+o},{x:l-h/2,y:c+o}],m=[{x:l+a-h/2,y:c+o},{x:l+a+h/2,y:c+o},{x:l+a+h/2,y:c+o-d}];"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const y=Ox(f),x=p.path(y,g),b=Ox(m),C=p.path(b,{...g,fillStyle:"solid"}),w=n.insert(()=>C,":first-child");return w.insert(()=>x,":first-child"),w.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",u),i&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",i),Nx(e,w),e.intersect=function(t){return ab.polygon(e,f,t)},n}async function fC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=Math.max(s.width+2*(e.padding??0),e?.width??0),l=Math.max(s.height+2*(e.padding??0),e?.height??0),c=l/4,h=.2*o,d=.2*l,u=l+c,{cssStyles:p}=e,g=Lx.svg(n),f=Mf(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-o/2-o/2*.1,y:u/2},...Dx(-o/2-o/2*.1,u/2,o/2+o/2*.1,u/2,c,.8),{x:o/2+o/2*.1,y:-u/2},{x:-o/2-o/2*.1,y:-u/2}],y=-o/2+o/2*.1,x=-u/2-.4*d,b=[{x:y+o-h,y:1.4*(x+l)},{x:y+o,y:x+l-d},{x:y+o,y:.9*(x+l)},...Dx(y+o,1.3*(x+l),y+o-h,1.5*(x+l),.03*-l,.5)],C=Ox(m),w=g.path(C,f),k=Ox(b),v=g.path(k,{...f,fillStyle:"solid"}),S=n.insert(()=>v,":first-child");return S.insert(()=>w,":first-child"),S.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",p),i&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-o/2+(e.padding??0)-(s.x-(s.left??0))},${-l/2+(e.padding??0)-c/2-(s.y-(s.top??0))})`),Nx(e,S),e.intersect=function(t){return ab.polygon(e,m,t)},n}async function mC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=Math.max(s.width+e.padding,e?.width||0),o=Math.max(s.height+e.padding,e?.height||0),l=-a/2,c=-o/2,h=n.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",o),Nx(e,h),e.intersect=function(t){return ab.rect(e,t)},n}_n(rC,"question"),_n(iC,"rect_left_inv_arrow"),_n(nC,"rectWithTitle"),_n(sC,"roundedRect"),_n(aC,"shadedProcess"),_n(oC,"slopedRect"),_n(lC,"squareRect"),_n(cC,"stadium"),_n(hC,"state"),_n(dC,"stateEnd"),_n(uC,"stateStart"),_n(pC,"subroutine"),_n(gC,"taggedRect"),_n(fC,"taggedWaveEdgedRectangle"),_n(mC,"text");var yC=_n((t,e,r,i,n,s)=>`M${t},${e}\n    a${n},${s} 0,0,1 0,${-i}\n    l${r},0\n    a${n},${s} 0,0,1 0,${i}\n    M${r},${-i}\n    a${n},${s} 0,0,0 0,${i}\n    l${-r},0`,"createCylinderPathD"),xC=_n((t,e,r,i,n,s)=>[`M${t},${e}`,`M${t+r},${e}`,`a${n},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${n},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),bC=_n((t,e,r,i,n,s)=>[`M${t+r/2},${-i/2}`,`a${n},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD");async function CC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a,halfPadding:o}
2=await jx(t,e,Ix(e)),l="neo"===e.look?2*o:o,c=s.height+l,h=c/2,d=h/(2.5+c/50),u=s.width+d+l,{cssStyles:p}=e;let g;if("handDrawn"===e.look){const t=Lx.svg(n),r=xC(0,0,u,c,d,h),i=bC(0,0,u,c,d,h),s=t.path(r,Mf(e,{})),a=t.path(i,Mf(e,{fill:"none"}));g=n.insert(()=>a,":first-child"),g=n.insert(()=>s,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const t=yC(0,0,u,c,d,h);g=n.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",Cf(p)).attr("style",i),g.attr("class","basic label-container"),p&&g.selectAll("path").attr("style",p),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-u/2}, ${c/2} )`),a.attr("transform",`translate(${-s.width/2-d-(s.x-(s.left??0))}, ${-s.height/2-(s.y-(s.top??0))})`),Nx(e,g),e.intersect=function(t){const r=ab.rect(e,t),i=r.y-(e.y??0);if(0!=h&&(Math.abs(i)<(e.height??0)/2||Math.abs(i)==(e.height??0)/2&&Math.abs(r.x-(e.x??0))>(e.width??0)/2-d)){let n=d*d*(1-i*i/(h*h));0!=n&&(n=Math.sqrt(Math.abs(n))),n=d-n,t.x-(e.x??0)>0&&(n=-n),r.x+=n}return r},n}async function wC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=s.width+e.padding,o=s.height+e.padding,l=[{x:-3*o/6,y:0},{x:a+3*o/6,y:0},{x:a,y:-o},{x:0,y:-o}];let c;const{cssStyles:h}=e;if("handDrawn"===e.look){const t=Lx.svg(n),r=Mf(e,{}),i=Ox(l),s=t.path(i,r);c=n.insert(()=>s,":first-child").attr("transform",`translate(${-a/2}, ${o/2})`),h&&c.attr("style",h)}else c=hb(n,a,o,l);return i&&c.attr("style",i),e.width=a,e.height=o,Nx(e,c),e.intersect=function(t){return ab.polygon(e,l,t)},n}async function kC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}=await jx(t,e,Ix(e)),a=Math.max(60,s.width+2*(e.padding??0),e?.width??0),o=Math.max(20,s.height+2*(e.padding??0),e?.height??0),{cssStyles:l}=e,c=Lx.svg(n),h=Mf(e,{});"handDrawn"!==e.look&&(h.roughness=0,h.fillStyle="solid");const d=[{x:-a/2*.8,y:-o/2},{x:a/2*.8,y:-o/2},{x:a/2,y:-o/2*.6},{x:a/2,y:o/2},{x:-a/2,y:o/2},{x:-a/2,y:-o/2*.6}],u=Ox(d),p=c.path(u,h),g=n.insert(()=>p,":first-child");return g.attr("class","basic label-container"),l&&"handDrawn"!==e.look&&g.selectChildren("path").attr("style",l),i&&"handDrawn"!==e.look&&g.selectChildren("path").attr("style",i),Nx(e,g),e.intersect=function(t){return ab.polygon(e,d,t)},n}async function vC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=e.useHtmlLabels||Us(qa()),l=s.width+(e.padding??0),c=l+s.height,h=l+s.height,d=[{x:0,y:0},{x:h,y:0},{x:h/2,y:-c}],{cssStyles:u}=e,p=Lx.svg(n),g=Mf(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=Ox(d),m=p.path(f,g),y=n.insert(()=>m,":first-child").attr("transform",`translate(${-c/2}, ${c/2})`);return u&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",u),i&&"handDrawn"!==e.look&&y.selectChildren("path").attr("style",i),e.width=l,e.height=c,Nx(e,y),a.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${c/2-(s.height+(e.padding??0)/(o?2:1)-(s.y-(s.top??0)))})`),e.intersect=function(t){return Bn.info("Triangle intersect",e,d,t),ab.polygon(e,d,t)},n}async function SC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=Math.max(s.width+2*(e.padding??0),e?.width??0),l=Math.max(s.height+2*(e.padding??0),e?.height??0),c=l/8,h=l+c,{cssStyles:d}=e,u=70-o,p=u>0?u/2:0,g=Lx.svg(n),f=Mf(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-o/2-p,y:h/2},...Dx(-o/2-p,h/2,o/2+p,h/2,c,.8),{x:o/2+p,y:-h/2},{x:-o/2-p,y:-h/2}],y=Ox(m),x=g.path(y,f),b=n.insert(()=>x,":first-child");return b.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",d),i&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",i),b.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-o/2+(e.padding??0)-(s.x-(s.left??0))},${-l/2+(e.padding??0)-c-(s.y-(s.top??0))})`),Nx(e,b),e.intersect=function(t){return ab.polygon(e,m,t)},n}async function _C(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s}
2=await jx(t,e,Ix(e)),a=Math.max(s.width+2*(e.padding??0),e?.width??0),o=Math.max(s.height+2*(e.padding??0),e?.height??0),l=a/o;let c=a,h=o;c>h*l?h=c/l:c=h*l,c=Math.max(c,100),h=Math.max(h,50);const d=Math.min(.2*h,h/4),u=h+2*d,{cssStyles:p}=e,g=Lx.svg(n),f=Mf(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");const m=[{x:-c/2,y:u/2},...Dx(-c/2,u/2,c/2,u/2,d,1),{x:c/2,y:-u/2},...Dx(c/2,-u/2,-c/2,-u/2,d,-1)],y=Ox(m),x=g.path(y,f),b=n.insert(()=>x,":first-child");return b.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",p),i&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",i),Nx(e,b),e.intersect=function(t){return ab.polygon(e,m,t)},n}async function TC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,label:a}=await jx(t,e,Ix(e)),o=Math.max(s.width+2*(e.padding??0),e?.width??0),l=Math.max(s.height+2*(e.padding??0),e?.height??0),c=-o/2,h=-l/2,{cssStyles:d}=e,u=Lx.svg(n),p=Mf(e,{}),g=[{x:c-5,y:h-5},{x:c-5,y:h+l},{x:c+o,y:h+l},{x:c+o,y:h-5}],f=`M${c-5},${h-5} L${c+o},${h-5} L${c+o},${h+l} L${c-5},${h+l} L${c-5},${h-5}\n                M${c-5},${h} L${c+o},${h}\n                M${c},${h-5} L${c},${h+l}`;"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");const m=u.path(f,p),y=n.insert(()=>m,":first-child");return y.attr("transform","translate(2.5, 2.5)"),y.attr("class","basic label-container"),d&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",d),i&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",i),a.attr("transform",`translate(${-s.width/2+2.5-(s.x-(s.left??0))}, ${-s.height/2+2.5-(s.y-(s.top??0))})`),Nx(e,y),e.intersect=function(t){return ab.polygon(e,g,t)},n}async function AC(t,e){const r=e;if(r.alias&&(e.label=r.alias),"handDrawn"===e.look){const{themeVariables:r}=Rs(),{background:i}=r,n={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${i}`]};await AC(t,n)}const i=Rs();e.useHtmlLabels=i.htmlLabels;let n=i.er?.diagramPadding??10,s=i.er?.entityPadding??6;const{cssStyles:a}=e,{labelStyles:o,nodeStyles:l}=Bf(e);if(0===r.attributes.length&&e.label){const r={rx:0,ry:0,labelPaddingX:n,labelPaddingY:1.5*n};of(e.label,i)+2*r.labelPaddingX<i.er.minEntityWidth&&(e.width=i.er.minEntityWidth);const s=await qb(t,e,r);if(!Bs(i.htmlLabels)){const t=s.select("text"),e=t.node()?.getBBox();t.attr("transform",`translate(${-e.width/2}, 0)`)}return s}i.htmlLabels||(n*=1.25,s*=1.25);let c=Ix(e);c||(c="node default");const h=t.insert("g").attr("class",c).attr("id",e.domId||e.id),d=await BC(h,e.label??"",i,0,0,["name"],o);d.height+=s;let u=0;const p=[],g=[];let f=0,m=0,y=0,x=0,b=!0,C=!0;for(const R of r.attributes){const t=await BC(h,R.type,i,0,u,["attribute-type"],o);f=Math.max(f,t.width+n);const e=await BC(h,R.name,i,0,u,["attribute-name"],o);m=Math.max(m,e.width+n);const r=await BC(h,R.keys.join(),i,0,u,["attribute-keys"],o);y=Math.max(y,r.width+n);const a=await BC(h,R.comment,i,0,u,["attribute-comment"],o);x=Math.max(x,a.width+n);const l=Math.max(t.height,e.height,r.height,a.height)+s;g.push({yOffset:u,rowHeight:l}),u+=l}let w=4;y<=n&&(b=!1,y=0,w--),x<=n&&(C=!1,x=0,w--);const k=h.node().getBBox();if(d.width+2*n-(f+m+y+x)>0){const t=d.width+2*n-(f+m+y+x);f+=t/w,m+=t/w,y>0&&(y+=t/w),x>0&&(x+=t/w)}const v=f+m+y+x,S=Lx.svg(h),_=Mf(e,{});"handDrawn"!==e.look&&(_.roughness=0,_.fillStyle="solid");let T=0;g.length>0&&(T=g.reduce((t,e)=>t+(e?.rowHeight??0),0));const A=Math.max(k.width+2*n,e?.width||0,v),B=Math.max((T??0)+d.height,e?.height||0),M=-A/2,E=-B/2;h.selectAll("g:not(:first-child)").each((t,e,r)=>{const i=fl(r[e]),a=i.attr("transform");let o=0,l=0;if(a){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);t&&(o=parseFloat(t[1]),l=parseFloat(t[2]),i.attr("class").includes("attribute-name")?o+=f:i.attr("class").includes("attribute-keys")?o+=f+m:i.attr("class").includes("attribute-comment")&&(o+=f+m+y))}i.attr("transform",`translate(${M+n/2+o}, ${l+E+d.height+s/2})`)}),h.select(".name").attr("transform","translate("+-d.width/2+", "+(E+s/2)+")");const L=S.rectangle(M,E,A,B,_),j=h.insert(()=>L,":first-child").attr("style",a.join("")),{themeVariables:F}=Rs(),{rowEven:N,rowOdd:I,nodeBorder:O}=F;p.push(0);for(const[R,z]of g.entries()){const t=(R+1)%2==0&&0!==z.yOffset,e=S.rectangle(M,d.height+E+z?.yOffset,A,z?.rowHeight,{..._,fill:t?N:I,stroke:O});h.insert(()=>e,"g.label").attr("style",a.join("")).attr("class","row-rect-"+(t?"even":"odd"))}let D=S.line(M,d.height+E,A+M,d.height+E,_);h.insert(()=>D).attr("class","divider"),D=S.line(f+M,d.height+E,f+M,B+E,_),h.insert(()=>D).attr("class","divider"),b&&(D=S.line(f+m+M,d.height+E,f+m+M,B+E,_),h.insert(()=>D).attr("class","divider")),C&&(D=S.line(f+m+y+M,d.height+E,f+m+y+M,B+E,_),h.insert(()=>D).attr("class","divider"));for(const R of p)D=S.line(M,d.height+E+R,A+M,d.height+E+R,_),h.insert(()=>D).attr("class","divider");if(Nx(e,j),l&&"handDrawn"!==e.look){const t=l.split(";"),e=t?.filter(t=>t.includes("stroke"))?.map(t=>`${t}`).join("; ");h.selectAll("path").attr("style",e??""),h.selectAll(".row-rect-even path").attr("style",l)}return e.intersect=function(t){return ab.rect(e,t)},h}async function BC(t,e,r,i=0,n=0,s=[],a=""){const o=t.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${n})`).attr("style",a);e!==ca(e)&&(e=(e=ca(e)).replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=o.node().appendChild(await Ey(o,e,{width:of(e,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(e.includes("&lt;")||e.includes("&gt;")){let t=l.children[0];for(t.textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");t.childNodes[0];)t=t.childNodes[0],t.textContent=t.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let c=l.getBBox();
2if(Bs(r.htmlLabels)){const t=l.children[0];t.style.textAlign="start";const e=fl(l);c=t.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}return c}async function MC(t,e,r,i,n=r.class.padding??12){const s=i?0:3,a=t.insert("g").attr("class",Ix(e)).attr("id",e.domId||e.id);let o=null,l=null,c=null,h=null,d=0,u=0,p=0;if(o=a.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const t=e.annotations[0];await EC(o,{text:`«${t}»`},0),d=o.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await EC(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();u=g.height,c=a.insert("g").attr("class","members-group text");let f=0;for(const x of e.members)f+=await EC(c,x,f,[x.parseClassifier()])+s;p=c.node().getBBox().height,p<=0&&(p=n/2),h=a.insert("g").attr("class","methods-group text");let m=0;for(const x of e.methods)m+=await EC(h,x,m,[x.parseClassifier()])+s;let y=a.node().getBBox();if(null!==o){const t=o.node().getBBox();o.attr("transform",`translate(${-t.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),y=a.node().getBBox(),c.attr("transform",`translate(0, ${d+u+2*n})`),y=a.node().getBBox(),h.attr("transform",`translate(0, ${d+u+(p?p+4*n:2*n)})`),y=a.node().getBBox(),{shapeSvg:a,bbox:y}}async function EC(t,e,r,i=[]){const n=t.insert("g").attr("class","label").attr("style",i.join("; ")),s=Rs();let a="useHtmlLabels"in e?e.useHtmlLabels:Bs(s.htmlLabels)??!0,o="";o="text"in e?e.text:e.label,!a&&o.startsWith("\\")&&(o=o.substring(1)),fa(o)&&(a=!0);const l=await Ey(n,Va(xf(o)),{width:of(o,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const t=l.children[0],e=fl(l);h=t.innerHTML.split("<br>").length,t.innerHTML.includes("</math>")&&(h+=t.innerHTML.split("<mrow>").length-1);const r=t.getElementsByTagName("img");if(r){const t=""===o.replace(/<img[^>]*>/g,"").trim();await Promise.all([...r].map(e=>new Promise(r=>{function i(){if(e.style.display="flex",e.style.flexDirection="column",t){const t=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,r=5,i=parseInt(t,10)*r+"px";e.style.minWidth=i,e.style.maxWidth=i}else e.style.width="100%";r(e)}_n(i,"setupImage"),setTimeout(()=>{e.complete&&i()}),e.addEventListener("error",i),e.addEventListener("load",i)})))}c=t.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}else{i.includes("font-weight: bolder")&&fl(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const t=l.children[0];(""===l.textContent||l.textContent.includes("&gt"))&&(t.textContent=o[0]+o.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim()," "===o[1]&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))),"undefined"===t.textContent&&(t.textContent=""),c=l.getBBox()}return n.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}async function LC(t,e){const r=qa(),i=r.class.padding??12,n=i,s=e.useHtmlLabels??Bs(r.htmlLabels)??!0,a=e;a.annotations=a.annotations??[],a.members=a.members??[],a.methods=a.methods??[];const{shapeSvg:o,bbox:l}=await MC(t,e,r,s,n),{labelStyles:c,nodeStyles:h}=Bf(e);e.labelStyle=c,e.cssStyles=a.styles||"";const d=a.styles?.join(";")||h||"";e.cssStyles||(e.cssStyles=d.replaceAll("!important","").split(";"));const u=0===a.members.length&&0===a.methods.length&&!r.class?.hideEmptyMembersBox,p=Lx.svg(o),g=Mf(e,{});"handDrawn"!==e.look&&(g.roughness=0,g.fillStyle="solid");const f=l.width;let m=l.height;0===a.members.length&&0===a.methods.length?m+=n:a.members.length>0&&0===a.methods.length&&(m+=2*n);const y=-f/2,x=-m/2,b=p.rectangle(y-i,x-i-(u?i:0===a.members.length&&0===a.methods.length?-i/2:0),f+2*i,m+2*i+(u?2*i:0===a.members.length&&0===a.methods.length?-i:0),g),C=o.insert(()=>b,":first-child");C.attr("class","basic label-container");const w=C.node().getBBox();o.selectAll(".text").each((t,e,r)=>{const n=fl(r[e]),l=n.attr("transform");let c=0;if(l){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);t&&(c=parseFloat(t[2]))}let h=c+x+i-(u?i:0===a.members.length&&0===a.methods.length?-i/2:0);s||(h-=4);let d=y;(n.attr("class").includes("label-group")||n.attr("class").includes("annotation-group"))&&(d=-n.node()?.getBBox().width/2||0,o.selectAll("text").each(function(t,e,r){"middle"===window.getComputedStyle(r[e]).textAnchor&&(d=0)})),n.attr("transform",`translate(${d}, ${h})`)}
2);const k=o.select(".annotation-group").node().getBBox().height-(u?i/2:0)||0,v=o.select(".label-group").node().getBBox().height-(u?i/2:0)||0,S=o.select(".members-group").node().getBBox().height-(u?i/2:0)||0;if(a.members.length>0||a.methods.length>0||u){const t=p.line(w.x,k+v+x+i,w.x+w.width,k+v+x+i,g);o.insert(()=>t).attr("class","divider").attr("style",d)}if(u||a.members.length>0||a.methods.length>0){const t=p.line(w.x,k+v+S+x+2*n+i,w.x+w.width,k+v+S+x+i+2*n,g);o.insert(()=>t).attr("class","divider").attr("style",d)}if("handDrawn"!==a.look&&o.selectAll("path").attr("style",d),C.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),!s){const t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(d);if(e){const t=e[0].replace("color","fill");o.selectAll("tspan").attr("style",t)}else if(c){const e=t.exec(c);if(e){const t=e[0].replace("color","fill");o.selectAll("tspan").attr("style",t)}}}return Nx(e,C),e.intersect=function(t){return ab.rect(e,t)},o}async function jC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const n=e,s=e,a="verifyMethod"in e,o=Ix(e),l=t.insert("g").attr("class",o).attr("id",e.domId??e.id);let c;c=a?await FC(l,`&lt;&lt;${n.type}&gt;&gt;`,0,e.labelStyle):await FC(l,"&lt;&lt;Element&gt;&gt;",0,e.labelStyle);let h=c;const d=await FC(l,n.name,h,e.labelStyle+"; font-weight: bold;");h+=d+20,a?(h+=await FC(l,n.requirementId?`ID: ${n.requirementId}`:"",h,e.labelStyle),h+=await FC(l,n.text?`Text: ${n.text}`:"",h,e.labelStyle),h+=await FC(l,n.risk?`Risk: ${n.risk}`:"",h,e.labelStyle),await FC(l,n.verifyMethod?`Verification: ${n.verifyMethod}`:"",h,e.labelStyle)):(h+=await FC(l,s.type?`Type: ${s.type}`:"",h,e.labelStyle),await FC(l,s.docRef?`Doc Ref: ${s.docRef}`:"",h,e.labelStyle));const u=(l.node()?.getBBox().width??200)+20,p=(l.node()?.getBBox().height??200)+20,g=-u/2,f=-p/2,m=Lx.svg(l),y=Mf(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");const x=m.rectangle(g,f,u,p,y),b=l.insert(()=>x,":first-child");if(b.attr("class","basic label-container").attr("style",i),l.selectAll(".label").each((t,e,r)=>{const i=fl(r[e]),n=i.attr("transform");let s=0,a=0;if(n){const t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(n);t&&(s=parseFloat(t[1]),a=parseFloat(t[2]))}const o=a-p/2;let l=g+10;0!==e&&1!==e||(l=s),i.attr("transform",`translate(${l}, ${o+20})`)}),h>c+d+20){const t=m.line(g,f+c+d+20,g+u,f+c+d+20,y);l.insert(()=>t).attr("style",i)}return Nx(e,b),e.intersect=function(t){return ab.rect(e,t)},l}async function FC(t,e,r,i=""){if(""===e)return 0;const n=t.insert("g").attr("class","label").attr("style",i),s=qa(),a=s.htmlLabels??!0,o=await Ey(n,Va(xf(e)),{width:of(e,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const t=o.children[0],e=fl(o);l=t.getBoundingClientRect(),e.attr("width",l.width),e.attr("height",l.height)}else{const t=o.children[0];for(const e of t.children)e.textContent=e.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),i&&e.setAttribute("style",i);l=o.getBBox(),l.height+=6}return n.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}_n(CC,"tiltedCylinder"),_n(wC,"trapezoid"),_n(kC,"trapezoidalPentagon"),_n(vC,"triangle"),_n(SC,"waveEdgedRectangle"),_n(_C,"waveRectangle"),_n(TC,"windowPane"),_n(AC,"erBo
2x"),_n(BC,"addText"),_n(MC,"textHelper"),_n(EC,"addText"),_n(LC,"classBox"),_n(jC,"requirementBox"),_n(FC,"addText");var NC=_n(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 IC(t,e,{config:r}){const{labelStyles:i,nodeStyles:n}=Bf(e);e.labelStyle=i||"";const s=e.width;e.width=(e.width??200)-10;const{shapeSvg:a,bbox:o,label:l}=await jx(t,e,Ix(e)),c=e.padding||10;let h,d="";"ticket"in e&&e.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),h=a.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const u={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};let p,g;({label:p,bbox:g}=h?await Fx(h,"ticket"in e&&e.ticket||"",u):await Fx(a,"ticket"in e&&e.ticket||"",u));const{label:f,bbox:m}=await Fx(a,"assigned"in e&&e.assigned||"",u);e.width=s;const y=e?.width||0,x=Math.max(g.height,m.height)/2,b=Math.max(o.height+20,e?.height||0)+x,C=-y/2,w=-b/2;let k;l.attr("transform","translate("+(c-y/2)+", "+(-x-o.height/2)+")"),p.attr("transform","translate("+(c-y/2)+", "+(-x+o.height/2)+")"),f.attr("transform","translate("+(c+y/2-m.width-20)+", "+(-x+o.height/2)+")");const{rx:v,ry:S}=e,{cssStyles:_}=e;
2if("handDrawn"===e.look){const t=Lx.svg(a),r=Mf(e,{}),i=v||S?t.path(Px(C,w,y,b,v||0),r):t.rectangle(C,w,y,b,r);k=a.insert(()=>i,":first-child"),k.attr("class","basic label-container").attr("style",_||null)}else{k=a.insert("rect",":first-child"),k.attr("class","basic label-container __APA__").attr("style",n).attr("rx",v??5).attr("ry",S??5).attr("x",C).attr("y",w).attr("width",y).attr("height",b);const t="priority"in e&&e.priority;if(t){const e=a.append("line"),r=C+2,i=w+Math.floor((v??0)/2),n=w+b-Math.floor((v??0)/2);e.attr("x1",r).attr("y1",i).attr("x2",r).attr("y2",n).attr("stroke-width","4").attr("stroke",NC(t))}}return Nx(e,k),e.height=b,e.intersect=function(t){return ab.rect(e,t)},a}async function OC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,halfPadding:a,label:o}=await jx(t,e,Ix(e)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:d}=e,u=s.width+20,p=s.height+20,g=Math.max(l,u),f=Math.max(c,p);let m;o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);const y=`M0 0 \n    a${h},${h} 1 0,0 ${.25*g},${-1*f*.1}\n    a${h},${h} 1 0,0 ${.25*g},0\n    a${h},${h} 1 0,0 ${.25*g},0\n    a${h},${h} 1 0,0 ${.25*g},${.1*f}\n\n    a${h},${h} 1 0,0 ${.15*g},${.33*f}\n    a${.8*h},${.8*h} 1 0,0 0,${.34*f}\n    a${h},${h} 1 0,0 ${-1*g*.15},${.33*f}\n\n    a${h},${h} 1 0,0 ${-1*g*.25},${.15*f}\n    a${h},${h} 1 0,0 ${-1*g*.25},0\n    a${h},${h} 1 0,0 ${-1*g*.25},0\n    a${h},${h} 1 0,0 ${-1*g*.25},${-1*f*.15}\n\n    a${h},${h} 1 0,0 ${-1*g*.1},${-1*f*.33}\n    a${.8*h},${.8*h} 1 0,0 0,${-1*f*.34}\n    a${h},${h} 1 0,0 ${.1*g},${-1*f*.33}\n  H0 V0 Z`;if("handDrawn"===e.look){const t=Lx.svg(n),r=Mf(e,{}),i=t.path(y,r);m=n.insert(()=>i,":first-child"),m.attr("class","basic label-container").attr("style",Cf(d))}else m=n.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return m.attr("transform",`translate(${-g/2}, ${-f/2})`),Nx(e,m),e.calcIntersect=function(t,e){return ab.rect(t,e)},e.intersect=function(t){return Bn.info("Bang intersect",e,t),ab.rect(e,t)},n}async function DC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,halfPadding:a,label:o}=await jx(t,e,Ix(e)),l=s.width+2*a,c=s.height+2*a,h=.15*l,d=.25*l,u=.35*l,p=.2*l,{cssStyles:g}=e;let f;const m=`M0 0 \n    a${h},${h} 0 0,1 ${.25*l},${-1*l*.1}\n    a${u},${u} 1 0,1 ${.4*l},${-1*l*.1}\n    a${d},${d} 1 0,1 ${.35*l},${.2*l}\n\n    a${h},${h} 1 0,1 ${.15*l},${.35*c}\n    a${p},${p} 1 0,1 ${-1*l*.15},${.65*c}\n\n    a${d},${h} 1 0,1 ${-1*l*.25},${.15*l}\n    a${u},${u} 1 0,1 ${-1*l*.5},0\n    a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}\n\n    a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}\n    a${p},${p} 1 0,1 ${.1*l},${-1*c*.65}\n  H0 V0 Z`;if("handDrawn"===e.look){const t=Lx.svg(n),r=Mf(e,{}),i=t.path(m,r);f=n.insert(()=>i,":first-child"),f.attr("class","basic label-container").attr("style",Cf(g))}else f=n.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",m);return o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),f.attr("transform",`translate(${-l/2}, ${-c/2})`),Nx(e,f),e.calcIntersect=function(t,e){return ab.rect(t,e)},e.intersect=function(t){return Bn.info("Cloud intersect",e,t),ab.rect(e,t)},n}async function RC(t,e){const{labelStyles:r,nodeStyles:i}=Bf(e);e.labelStyle=r;const{shapeSvg:n,bbox:s,halfPadding:a,label:o}=await jx(t,e,Ix(e)),l=s.width+8*a,c=s.height+2*a,h=`\n    M${-l/2} ${c/2-5}\n    v${10-c}\n    q0,-5 5,-5\n    h${l-10}\n    q5,0 5,5\n    v${c-10}\n    q0,5 -5,5\n    h${10-l}\n    q-5,0 -5,-5\n    Z\n  `,d=n.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("style",i).attr("d",h);return n.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),o.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),n.append(()=>o.node()),Nx(e,d),e.calcIntersect=function(t,e){return ab.rect(t,e)},e.intersect=function(t){return ab.rect(e,t)},n}async function zC(t,e){return pb(t,e,{padding:e.padding??0})}_n(IC,"kanbanItem"),_n(OC,"bang"),_n(DC,"cloud"),_n(RC,"defaultMindmapNode"),_n(zC,"mindmapCircle");var $C=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:lC},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:sC},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:cC},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","
2subproc","framed-rectangle","subroutine"],handler:pC},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Tb},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:pb},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:OC},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:DC},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:rC},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:Nb},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Vb},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Hb},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:wC},{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:Pb},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Bb},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:mC}
2,{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:db},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:aC},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:uC},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:dC},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Lb},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Ib},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:yb},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:bb},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:wb},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Yb}
2,{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:SC},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:jb},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:CC},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Xb},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:kb},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Ab},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:vC},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:TC},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Mb},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:kC},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Eb},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:oC},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Qb},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Zb},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:cb},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:fb},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:fC},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:gC},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:_C},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:iC},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Kb}],PC=_n(()=>{const t={state:hC,choice:ub,note:tC,rectWithTitle:nC,labelRect:Wb,iconSquare:zb,iconCircle:Db,icon:Ob,iconRounded:Rb,imageSquare:$b,anchor:ob,kanbanItem:IC,mindmapCircle:zC,defaultMindmapNode:RC,classBox:LC,erBox:AC,requirementBox:jC},e=[...Object.entries(t),...$C.flatMap(t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map(e=>[e,t.handler]))];return Object.fromEntries(e)},"generateShapeMap")();function qC(t){return t in PC}_n(qC,"isValidShape");var WC=new Map;async function HC(t,e,r){let i,n;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const s=e.shape?PC[e.shape]:void 0;if(!s)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let a;"sandbox"===r.config.securityLevel?a="_top":e.linkTarget&&(a=e.linkTarget||"_blank"),i=t.insert("svg:a").attr("xlink:href",e.link).attr("target",a??null),n=await s(i,e,r)}else n=await s(t,e,r),i=n;return e.tooltip&&n.attr("title",e.tooltip),WC.set(e.id,i),e.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}
2_n(HC,"insertNode");var VC=_n((t,e)=>{WC.set(e.id,t)},"setNodeElem"),YC=_n(()=>{WC.clear()},"clear"),UC=_n(t=>{const e=WC.get(t.id);Bn.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode"),GC=_n((t,e,r,i,n,s)=>{e.arrowTypeStart&&XC(t,"start",e.arrowTypeStart,r,i,n,s),e.arrowTypeEnd&&XC(t,"end",e.arrowTypeEnd,r,i,n,s)},"addEdgeMarkers"),JC={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}},XC=_n((t,e,r,i,n,s,a)=>{const o=JC[r];if(!o)return void Bn.warn(`Unknown arrow type: ${r}`);const l=`${n}_${s}-${o.type}${"start"===e?"Start":"End"}`;if(a&&""!==a.trim()){const r=`${l}_${a.replace(/[^\dA-Za-z]/g,"_")}`;if(!document.getElementById(r)){const t=document.getElementById(l);if(t){const e=t.cloneNode(!0);e.id=r,e.querySelectorAll("path, circle, line").forEach(t=>{t.setAttribute("stroke",a),o.fill&&t.setAttribute("fill",a)}),t.parentNode?.appendChild(e)}}t.attr(`marker-${e}`,`url(${i}#${r})`)}else t.attr(`marker-${e}`,`url(${i}#${l})`)},"addEdgeMarker"),KC=_n(t=>"string"==typeof t?t:qa()?.flowchart?.curve,"resolveEdgeCurveType"),ZC=new Map,QC=new Map,tw=_n(()=>{ZC.clear(),QC.clear()},"clear"),ew=_n(t=>t?"string"==typeof t?t:t.reduce((t,e)=>t+";"+e,""):"","getLabelStyles"),rw=_n(async(t,e)=>{const r=qa();let i=Us(r);const{labelStyles:n}=Bf(e);e.labelStyle=n;const s=t.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",e.id),o="markdown"===e.labelType,l=await Ey(t,e.label,{style:ew(e.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:o,width:void 0},r);a.node().appendChild(l),Bn.info("abc82",e,e.labelType);let c,h=l.getBBox(),d=h;if(i){const t=l.children[0],e=fl(l);h=t.getBoundingClientRect(),d=h,e.attr("width",h.width),e.attr("height",h.height)}else{const t=fl(l).select("text").node();t&&"function"==typeof t.getBBox&&(d=t.getBBox())}if(a.attr("transform",wg(d,i)),ZC.set(e.id,s),e.width=h.width,e.height=h.height,e.startLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),n=r.insert("g").attr("class","inner"),s=await $x(n,e.startLabelLeft,ew(e.labelStyle)||"",!1,!1);c=s;let a=s.getBBox();if(i){const t=s.children[0],e=fl(s);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}n.attr("transform",wg(a,i)),QC.get(e.id)||QC.set(e.id,{}),QC.get(e.id).startLeft=r,iw(c,e.startLabelLeft)}if(e.startLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),n=r.insert("g").attr("class","inner"),s=await $x(n,e.startLabelRight,ew(e.labelStyle)||"",!1,!1);c=s,n.node().appendChild(s);let a=s.getBBox();if(i){const t=s.children[0],e=fl(s);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}n.attr("transform",wg(a,i)),QC.get(e.id)||QC.set(e.id,{}),QC.get(e.id).startRight=r,iw(c,e.startLabelRight)}if(e.endLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),n=r.insert("g").attr("class","inner"),s=await $x(n,e.endLabelLeft,ew(e.labelStyle)||"",!1,!1);c=s;let a=s.getBBox();if(i){const t=s.children[0],e=fl(s);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}n.attr("transform",wg(a,i)),r.node().appendChild(s),QC.get(e.id)||QC.set(e.id,{}),QC.get(e.id).endLeft=r,iw(c,e.endLabelLeft)}if(e.endLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),n=r.insert("g").attr("class","inner"),s=await $x(n,e.endLabelRight,ew(e.labelStyle)||"",!1,!1);c=s;let a=s.getBBox();if(i){const t=s.children[0],e=fl(s);a=t.getBoundingClientRect(),e.attr("width",a.width),e.attr("height",a.height)}n.attr("transform",wg(a,i)),r.node().appendChild(s),QC.get(e.id)||QC.set(e.id,{}),QC.get(e.id).endRight=r,iw(c,e.endLabelRight)}return l},"insertEdgeLabel");function iw(t,e){Us(qa())&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}_n(iw,"setTerminalWidth");var nw=_n((t,e)=>{Bn.debug("Moving label abc88 ",t.id,t.label,ZC.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const i=qa(),{subGraphTitleTotalMargin:n}=kf(i);if(t.label){const i=ZC.get(t.id);let s=t.x,a=t.y;if(r){const i=mf.calcLabelPosition(r);Bn.debug("Moving label "+t.label+" from (",s,",",a,") to (",i.x,",",i.y,") abc88"),e.updatedPath&&(s=i.x,a=i.y)}i.attr("transform",`translate(${s}, ${a+n/2})`)}if(t.startLabelLeft){const e=QC.get(t.id).startLeft;let i=t.x,n=t.y;if(r){const e=mf.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);i=e.x,n=e.y}e.attr("transform",`translate(${i}, ${n})`)}if(t.startLabelRight){const e=QC.get(t.id).startRight;let i=t.x,n=t.y;if(r){const e=mf.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);i=e.x,n=e.y}e.attr("transform",`translate(${i}, ${n})`)}if(t.endLabelLeft){const e=QC.get(t.id).endLeft;let i=t.x,n=t.y;if(r){const e=mf.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);i=e.x,n=e.y}e.attr("transform",`translate(${i}, ${n})`)}if(t.endLabelRight){const e=QC.get(t.id).endRight;let i=t.x,n=t.y;if(r){const e=mf.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);i=e.x,n=e.y}e.attr("transform",`translate(${i}, ${n})`)}},"positionEdgeLabel"),sw=_n((t,e)=>{const r=t.x,i=t.y,n=Math.abs(e.x-r),s=Math.abs(e.y-i),a=t.width/2,o=t.height/2;return n>=a||s>=o},"outsideNode"),aw=_n((t,e,r)=>{Bn.debug(`intersection calc abc89:\n  outsidePoint: ${JSON.stringify(e)}\n  insidePoint : ${JSON.stringify(r)}\n  node        : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const i=t.x,n=t.y,s=Math.abs(i-r.x),a=t.width/2;let o=r.x<e.x?a-s:a+s;const l=t.height/2,c=Math.abs(e.y-r.y),h=Math.abs(e.x-r.x);
2if(Math.abs(n-e.y)*a>Math.abs(i-e.x)*l){let t=r.y<e.y?e.y-l-n:n-l-e.y;o=h*t/c;const i={x:r.x<e.x?r.x+o:r.x-h+o,y:r.y<e.y?r.y+c-t:r.y-c+t};return 0===o&&(i.x=e.x,i.y=e.y),0===h&&(i.x=e.x),0===c&&(i.y=e.y),Bn.debug(`abc89 top/bottom calc, Q ${c}, q ${t}, R ${h}, r ${o}`,i),i}{o=r.x<e.x?e.x-a-i:i-a-e.x;let t=c*o/h,n=r.x<e.x?r.x+h-o:r.x-h+o,s=r.y<e.y?r.y+t:r.y-t;return Bn.debug(`sides calc abc89, Q ${c}, q ${t}, R ${h}, r ${o}`,{_x:n,_y:s}),0===o&&(n=e.x,s=e.y),0===h&&(n=e.x),0===c&&(s=e.y),{x:n,y:s}}},"intersection"),ow=_n((t,e)=>{Bn.warn("abc88 cutPathAtIntersect",t,e);let r=[],i=t[0],n=!1;return t.forEach(t=>{if(Bn.info("abc88 checking point",t,e),sw(e,t)||n)Bn.warn("abc88 outside",t,i),i=t,n||r.push(t);else{const s=aw(e,i,t);Bn.debug("abc88 inside",t,i,s),Bn.debug("abc88 intersection",s,e);let a=!1;r.forEach(t=>{a=a||t.x===s.x&&t.y===s.y}),r.some(t=>t.x===s.x&&t.y===s.y)?Bn.warn("abc88 no intersect",s,r):r.push(s),n=!0}}),Bn.debug("returning points",r),r},"cutPathAtIntersect");function lw(t){const e=[],r=[];for(let i=1;i<t.length-1;i++){const n=t[i-1],s=t[i],a=t[i+1];(n.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-n.y)>5||n.y===s.y&&s.x===a.x&&Math.abs(s.x-n.x)>5&&Math.abs(s.y-a.y)>5)&&(e.push(s),r.push(i))}return{cornerPoints:e,cornerPointPositions:r}}_n(lw,"extractCornerPoints");var cw=_n(function(t,e,r){const i=e.x-t.x,n=e.y-t.y,s=r/Math.sqrt(i*i+n*n);return{x:e.x-s*i,y:e.y-s*n}},"findAdjacentPoint"),hw=_n(function(t){const{cornerPointPositions:e}=lw(t),r=[];for(let i=0;i<t.length;i++)if(e.includes(i)){const e=t[i-1],n=t[i+1],s=t[i],a=cw(e,s,5),o=cw(n,s,5),l=o.x-a.x,c=o.y-a.y;r.push(a);const h=2*Math.sqrt(2);let d={x:s.x,y:s.y};if(Math.abs(n.x-e.x)>10&&Math.abs(n.y-e.y)>=10){Bn.debug("Corner point fixing",Math.abs(n.x-e.x),Math.abs(n.y-e.y));const t=5;d=s.x===a.x?{x:l<0?a.x-t+h:a.x+t-h,y:c<0?a.y-h:a.y+h}:{x:l<0?a.x-h:a.x+h,y:c<0?a.y-t+h:a.y+t-h}}else Bn.debug("Corner point skipping fixing",Math.abs(n.x-e.x),Math.abs(n.y-e.y));r.push(d,o)}else r.push(t[i]);return r},"fixCorners"),dw=_n((t,e,r)=>{const i=t-e-r,n=Math.floor(i/4);return`0 ${e} ${Array(n).fill("2 2").join(" ")} ${r}`},"generateDashArray"),uw=_n(function(t,e,r,i,n,s,a,o=!1){const{handDrawnSeed:l}=qa();let c=e.points,h=!1;const d=n;var u=s;const p=[];for(const L in e.cssCompiledStyles)Af(L)||p.push(e.cssCompiledStyles[L]);Bn.debug("UIO intersect check",e.points,u.x,d.x),u.intersect&&d.intersect&&!o&&(c=c.slice(1,e.points.length-1),c.unshift(d.intersect(c[0])),Bn.debug("Last point UIO",e.start,"--\x3e",e.end,c[c.length-1],u,u.intersect(c[c.length-1])),c.push(u.intersect(c[c.length-1])));const g=btoa(JSON.stringify(c));e.toCluster&&(Bn.info("to cluster abc88",r.get(e.toCluster)),c=ow(e.points,r.get(e.toCluster).node),h=!0),e.fromCluster&&(Bn.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(c,null,2)),c=ow(c.reverse(),r.get(e.fromCluster).node).reverse(),h=!0);let f=c.filter(t=>!Number.isNaN(t.y));const m=KC(e.curve);"rounded"!==m&&(f=hw(f));let y=Eh;switch(m){case"linear":case"rounded":y=Eh;break;case"basis":default:y=$h;break;case"cardinal":y=Uh;break;case"bumpX":y=Ih;break;case"bumpY":y=Oh;break;case"catmullRom":y=td;break;case"monotoneX":y=pd;break;case"monotoneY":y=gd;break;case"natural":y=yd;break;case"step":y=bd;break;case"stepAfter":y=wd;break;case"stepBefore":y=Cd}const{x,y:b}=Tg(e),C=Fh().x(x).y(b).curve(y);let w,k;switch(e.thickness){case"normal":default:w="edge-thickness-normal";break;case"thick":w="edge-thickness-thick";break;case"invisible":w="edge-thickness-invisible"}switch(e.pattern){case"solid":default:w+=" edge-pattern-solid";break;case"dotted":w+=" edge-pattern-dotted";break;case"dashed":w+=" edge-pattern-dashed"}let v="rounded"===m?pw(fw(f,e),5):C(f);const S=Array.isArray(e.style)?e.style:[e.style];let _=S.find(t=>t?.startsWith("stroke:")),T="";e.animate&&(T="edge-animation-fast"),e.animation&&(T="edge-animation-"+e.animation);let A=!1;if("handDrawn"===e.look){const r=Lx.svg(t);Object.assign([],f),w+=" transition",k=fl(r.path(v,{roughness:.3,seed:l})).select("path").attr("id",e.id).attr("class"," "+w+(e.classes?" "+e.classes:"")+(T?" "+T:"")).attr("style",S?S.reduce((t,e)=>t+";"+e,""):"");let i=k.attr("d");k.attr("d",i),t.node().appendChild(k.node())}else{const r=p.join(";"),i=S?S.reduce((t,e)=>t+e+";",""):"",n=(r?r+";"+i+";":i)+";"+(S?S.reduce((t,e)=>t+";"+e,""):"");k=t.append("path").attr("d",v).attr("id",e.id).attr("class"," "+w+(e.classes?" "+e.classes:"")+(T?" "+T:"")).attr("style",n),_=n.match(/stroke:([^;
2]+)/)?.[1],A=!0===e.animate||!!e.animation||r.includes("animation");const s=k.node(),a="function"==typeof s.getTotalLength?s.getTotalLength():0,o=vg[e.arrowTypeStart]||0,l=vg[e.arrowTypeEnd]||0;if("neo"===e.look&&!A){const t=`stroke-dasharray: ${"dotted"===e.pattern||"dashed"===e.pattern?dw(a,o,l):`0 ${o} ${a-o-l} ${l}`}; stroke-dashoffset: 0;`;k.attr("style",t+k.attr("style"))}}k.attr("data-edge",!0),k.attr("data-et","edge"),k.attr("data-id",e.id),k.attr("data-points",g),e.showPoints&&f.forEach(e=>{t.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",e.x).attr("cy",e.y)});let B="";(qa().flowchart.arrowMarkerAbsolute||qa().state.arrowMarkerAbsolute)&&(B=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,B=B.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Bn.info("arrowTypeStart",e.arrowTypeStart),Bn.info("arrowTypeEnd",e.arrowTypeEnd),GC(k,e,B,a,i,_);const M=c[Math.floor(c.length/2)];mf.isLabelCoordinateInPath(M,k.attr("d"))||(h=!0);let E={};return h&&(E.updatedPath=c),E.originalPath=e.points,E},"insertEdge");function pw(t,e){if(t.length<2)return"";let r="";const i=t.length,n=1e-5;for(let s=0;s<i;s++){const a=t[s],o=t[s-1],l=t[s+1];if(0===s)r+=`M${a.x},${a.y}`;else if(s===i-1)r+=`L${a.x},${a.y}`;else{const t=a.x-o.x,i=a.y-o.y,s=l.x-a.x,c=l.y-a.y,h=Math.hypot(t,i),d=Math.hypot(s,c);if(h<n||d<n){r+=`L${a.x},${a.y}`;continue}const u=t/h,p=i/h,g=s/d,f=c/d,m=u*g+p*f,y=Math.max(-1,Math.min(1,m)),x=Math.acos(y);if(x<n||Math.abs(Math.PI-x)<n){r+=`L${a.x},${a.y}`;continue}const b=Math.min(e/Math.sin(x/2),h/2,d/2),C=a.x-u*b,w=a.y-p*b,k=a.x+g*b,v=a.y+f*b;r+=`L${C},${w}`,r+=`Q${a.x},${a.y} ${k},${v}`}}return r}function gw(t,e){if(!t||!e)return{angle:0,deltaX:0,deltaY:0};const r=e.x-t.x,i=e.y-t.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}function fw(t,e){const r=t.map(t=>({...t}));if(t.length>=2&&kg[e.arrowTypeStart]){const i=kg[e.arrowTypeStart],n=t[0],s=t[1],{angle:a}=gw(n,s),o=i*Math.cos(a),l=i*Math.sin(a);r[0].x=n.x+o,r[0].y=n.y+l}const i=t.length;if(i>=2&&kg[e.arrowTypeEnd]){const n=kg[e.arrowTypeEnd],s=t[i-1],a=t[i-2],{angle:o}=gw(a,s),l=n*Math.cos(o),c=n*Math.sin(o);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}_n(pw,"generateRoundedPath"),_n(gw,"calculateDeltaAndAngle"),_n(fw,"applyMarkerOffsetsToPoints");var mw=_n((t,e,r,i)=>{e.forEach(e=>{yw[e](t,r,i)})},"insertMarkers"),yw={extension:_n((t,e,r)=>{Bn.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"),composition:_n((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"),aggregation:_n((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"),dependency:_n((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"),lollipop:_n((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("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("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),point:_n((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"),circle:_n((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"),cross:_n((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"),barb:_n((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"),only_one:_n((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"),zero_or_one:_n((t,e,r)=>{const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),one_or_more:_n((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"),zero_or_more:_n((t,e,r)=>{const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),requirement_arrow:_n((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\n      L20,10\n      M20,10\n      L0,20")}
2,"requirement_arrow"),requirement_contains:_n((t,e,r)=>{const i=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains")},xw=mw,bw={common:ba,getConfig:Rs,insertCluster:Gx,insertEdge:uw,insertEdgeLabel:rw,insertMarkers:xw,insertNode:HC,interpolateToCurve:$g,labelHelper:jx,log:Bn,positionEdgeLabel:nw},Cw={},ww=_n(t=>{for(const e of t)Cw[e.name]=e},"registerLayoutLoaders");_n(()=>{ww([{name:"dagre",loader:_n(async()=>await Z(()=>import("./dagre-KLK3FWXG-D4F02BJF.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,10,11,12,0,13,14,15,16,17,18,19,1,20])),"loader")},{name:"cose-bilkent",loader:_n(async()=>await Z(()=>import("./cose-bilkent-S5V4N54A-DgRtKu10.js"),__vite__mapDeps([21,22,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20])),"loader")}])},"registerDefaultLayoutLoaders")();var kw=_n(async(t,e)=>{if(!(t.layoutAlgorithm in Cw))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const r=Cw[t.layoutAlgorithm];return(await r.loader()).render(t,e,bw,{algorithm:r.algorithm})},"render"),vw=_n((t="",{fallback:e="dagre"}={})=>{if(t in Cw)return t;if(e in Cw)return Bn.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"),Sw={id:"c4",detector:_n(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./c4Diagram-IC4MRINW-L0BzSFbJ.js");return{diagram:t}},__vite__mapDeps([23,24,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:"c4",diagram:t}},"loader")},_w="flowchart",Tw={id:_w,detector:_n((t,e)=>"dagre-wrapper"!==e?.flowchart?.defaultRenderer&&"elk"!==e?.flowchart?.defaultRenderer&&/^\s*graph/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./flowDiagram-PKNHOUZH-DPphzpsQ.js");return{diagram:t}},__vite__mapDeps([25,26,24,27,28,14,29,6,7,5,8,9,0,13,15,16,17,18,19,1,20]));return{id:_w,diagram:t}},"loader")},Aw="flowchart-v2",Bw={id:Aw,detector:_n((t,e)=>"dagre-d3"!==e?.flowchart?.defaultRenderer&&("elk"===e?.flowchart?.defaultRenderer&&(e.layout="elk"),!(!/^\s*graph/.test(t)||"dagre-wrapper"!==e?.flowchart?.defaultRenderer)||/^\s*flowchart/.test(t)),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./flowDiagram-PKNHOUZH-DPphzpsQ.js");return{diagram:t}},__vite__mapDeps([25,26,24,27,28,14,29,6,7,5,8,9,0,13,15,16,17,18,19,1,20]));return{id:Aw,diagram:t}},"loader")},Mw={id:"er",detector:_n(t=>/^\s*erDiagram/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./erDiagram-INFDFZHY-V2nlHOlN.js");return{diagram:t}},__vite__mapDeps([30,27,28,29,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:"er",diagram:t}},"loader")},Ew="gitGraph",Lw={id:Ew,detector:_n(t=>/^\s*gitGraph/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./gitGraphDiagram-K3NZZRJ6-CJuKNLAQ.js");return{diagram:t}},__vite__mapDeps([31,32,33,34,5,6,7,8,9,4,11,12,0,13,14,15,16,17,18,19,1,20]));return{id:Ew,diagram:t}},"loader")},jw="gantt",Fw={id:jw,detector:_n(t=>/^\s*gantt/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./ganttDiagram-A5KZAMGK-C389l52C.js");return{diagram:t}},__vite__mapDeps([35,13,6,36,37,38,7,5,8,9,0,14,15,16,17,18,19,1,20]));return{id:jw,diagram:t}},"loader")},Nw="info",Iw={id:Nw,detector:_n(t=>/^\s*info/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./infoDiagram-LFFYTUFH-aNwW__kV.js");return{diagram:t}},__vite__mapDeps([39,34,5,6,7,8,9,4,11,12,0,13,14,15,16,17,18,19,1,20]));return{id:Nw,diagram:t}},"loader")},Ow={id:"pie",detector:_n(t=>/^\s*pie/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./pieDiagram-SKSYHLDU-DOZDFWNX.js");return{diagram:t}},__vite__mapDeps([40,32,34,5,6,7,8,9,4,11,12,41,42,37,0,13,14,15,16,17,18,19,1,20]));return{id:"pie",diagram:t}},"loader")},Dw="quadrantChart",Rw={id:Dw,detector:_n(t=>/^\s*quadrantChart/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./quadrantDiagram-337W2JSQ-dvlPHKa0.js");return{diagram:t}},__vite__mapDeps([43,36,37,38,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:Dw,diagram:t}},"loader")},zw="xychart",$w={id:zw,detector:_n(t=>/^\s*xychart(-beta)?/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./xychartDiagram-JWTSCODW-ml6_KJFy.js");return{diagram:t}},__vite__mapDeps([44,37,42,36,38,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:zw,diagram:t}},"loader")},Pw="requirement",qw={id:Pw,detector:_n(t=>
2/^\s*requirement(Diagram)?/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./requirementDiagram-Z7DCOOCP-DRkYpnp7.js");return{diagram:t}},__vite__mapDeps([45,27,28,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:Pw,diagram:t}},"loader")},Ww="sequence",Hw={id:Ww,detector:_n(t=>/^\s*sequenceDiagram/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./sequenceDiagram-2WXFIKYE-q63eULMB.js");return{diagram:t}},__vite__mapDeps([46,24,33,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:Ww,diagram:t}},"loader")},Vw="class",Yw={id:Vw,detector:_n((t,e)=>"dagre-wrapper"!==e?.class?.defaultRenderer&&/^\s*classDiagram/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./classDiagram-VBA2DB6C-C3m8c0iR.js");return{diagram:t}},__vite__mapDeps([47,48,26,24,27,28,14,6,7,5,8,9,0,13,15,16,17,18,19,1,20]));return{id:Vw,diagram:t}},"loader")},Uw="classDiagram",Gw={id:Uw,detector:_n((t,e)=>!(!/^\s*classDiagram/.test(t)||"dagre-wrapper"!==e?.class?.defaultRenderer)||/^\s*classDiagram-v2/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./classDiagram-v2-RAHNMMFH-C3m8c0iR.js");return{diagram:t}},__vite__mapDeps([49,48,26,24,27,28,14,6,7,5,8,9,0,13,15,16,17,18,19,1,20]));return{id:Uw,diagram:t}},"loader")},Jw="state",Xw={id:Jw,detector:_n((t,e)=>"dagre-wrapper"!==e?.state?.defaultRenderer&&/^\s*stateDiagram/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./stateDiagram-RAJIS63D-DnQsesY8.js");return{diagram:t}},__vite__mapDeps([50,51,27,28,3,4,5,6,7,8,9,10,11,0,13,14,15,16,17,18,19,1,20]));return{id:Jw,diagram:t}},"loader")},Kw="stateDiagram",Zw={id:Kw,detector:_n((t,e)=>!!/^\s*stateDiagram-v2/.test(t)||!(!/^\s*stateDiagram/.test(t)||"dagre-wrapper"!==e?.state?.defaultRenderer),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./stateDiagram-v2-FVOUBMTO-CpNuagSV.js");return{diagram:t}},__vite__mapDeps([52,51,27,28,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:Kw,diagram:t}},"loader")},Qw="journey",tk={id:Qw,detector:_n(t=>/^\s*journey/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./journeyDiagram-4ABVD52K-CVjU2TQP.js");return{diagram:t}},__vite__mapDeps([53,26,24,41,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:Qw,diagram:t}},"loader")},ek={draw:_n((t,e,r)=>{Bn.debug("rendering svg for syntax error\n");const i=vd(e),n=i.append("g");i.attr("viewBox","0 0 2412 512"),ka(i,100,512,!0),n.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),n.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),n.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),n.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.
2164-16,16v32c0,8.836 7.156,16 16,16z"),n.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),n.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),n.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),n.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw")},rk=ek,ik={db:{},renderer:ek,parser:{parse:_n(()=>{},"parse")}},nk="flowchart-elk",sk={id:nk,detector:_n((t,e={})=>!!(/^\s*flowchart-elk/.test(t)||/^\s*(flowchart|graph)/.test(t)&&"elk"===e?.flowchart?.defaultRenderer)&&(e.layout="elk",!0),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./flowDiagram-PKNHOUZH-DPphzpsQ.js");return{diagram:t}},__vite__mapDeps([25,26,24,27,28,14,29,6,7,5,8,9,0,13,15,16,17,18,19,1,20]));return{id:nk,diagram:t}},"loader")},ak="timeline",ok={id:ak,detector:_n(t=>/^\s*timeline/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./timeline-definition-YZTLITO2-D51kYbEL.js");return{diagram:t}},__vite__mapDeps([54,41,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:ak,diagram:t}},"loader")},lk="mindmap",ck={id:lk,detector:_n(t=>/^\s*mindmap/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./mindmap-definition-YRQLILUH-CL8KrDIf.js");return{diagram:t}},__vite__mapDeps([55,27,28,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:lk,diagram:t}},"loader")},hk="kanban",dk={id:hk,detector:_n(t=>/^\s*kanban/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./kanban-definition-K7BYSVSG-SJxIzQ7H.js");return{diagram:t}},__vite__mapDeps([56,26,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:hk,diagram:t}},"loader")},uk="sankey",pk={id:uk,detector:_n(t=>/^\s*sankey(-beta)?/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./sankeyDiagram-WA2Y5GQK-C6jY7bl2.js");return{diagram:t}},__vite__mapDeps([57,42,37,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:uk,diagram:t}},"loader")},gk="packet",fk={id:gk,detector:_n(t=>/^\s*packet(-beta)?/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./diagram-P4PSJMXO-BZArGzSi.js");return{diagram:t}},__vite__mapDeps([58,32,34,5,6,7,8,9,4,11,12,0,13,14,15,16,17,18,19,1,20]));return{id:gk,diagram:t}},"loader")},mk="radar",yk={id:mk,detector:_n(t=>/^\s*radar-beta/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./diagram-IFDJBPK2-C1P-Wsmw.js");return{diagram:t}},__vite__mapDeps([59,32,34,5,6,7,8,9,4,11,12,0,13,14,15,16,17,18,19,1,20]));return{id:mk,diagram:t}},"loader")},xk="block",bk={id:xk,detector:_n(t=>/^\s*block(-beta)?/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./blockDiagram-WCTKOSBZ-BhiCuc4P.js");return{diagram:t}},__vite__mapDeps([60,26,12,4,5,6,7,8,9,3,29,0,13,14,15,16,17,18,19,1,20]));return{id:xk,diagram:t}},"loader")},Ck="architecture",wk={id:Ck,detector:_n(t=>/^\s*architecture/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./architectureDiagram-2XIMDMQ5-5i4yUs-1.js");return{diagram:t}},__vite__mapDeps([61,32,34,5,6,7,8,9,4,11,12,22,0,13,14,15,16,17,18,19,1,20]));return{id:Ck,diagram:t}},"loader")},kk="ishikawa",vk={id:kk,detector:_n(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./ishikawaDiagram-PHBUUO56-D3G0DC6c.js");return{diagram:t}},__vite__mapDeps([62,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:kk,diagram:t}},"loader")},Sk="venn",_k={id:Sk,detector:_n(t=>/^\s*venn-beta/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./vennDiagram-LZ73GAT5-RC4kg7vW.js");return{diagram:t}},__vite__mapDeps([63,6,7,5,8,9,0,13,14,15,16,17,18,19,1,20]));return{id:Sk,diagram:t}},"loader")},Tk="treemap",Ak={id:Tk,detector:_n(t=>/^\s*treemap/.test(t),"detector"),loader:_n(async()=>{const{diagram:t}=await Z(async()=>{const{diagram:t}=await import("./diagram-E7M64L7V-BbikrTiT.js");return{diagram:t}},__vite__mapDeps([64,28,32,34,5,6,7,8,9,4,11,12,38,42,37,65,0,13,14,15,16,17,18,19,1,20]));return{id:Tk,diagram:t}},"loader")},Bk=!1,Mk=_n(()=>{Bk||(Bk=!0,Ja("error",ik,t=>"error"===t.toLowerCase().trim()),Ja("---",{db:{clear:_n(()=>{},"clear")},styles:{},renderer:{draw:_n(()=>{},"draw")},parser:{parse:_n(()=>{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:_n(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),rs(sk,ck,wk),rs(Sw,dk,Gw,Yw,Mw,Fw,Iw,Ow,qw,Hw,Bw,Tw,ok,Lw,Zw,Xw,tk,Rw,pk,fk,$w,bk,yk,vk,Ak,_k))},"addDiagrams"),Ek=_n(async()=>{Bn.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(ts).map(async([t,{detector:e,loader:r}])=>{if(r)try{Xa(t)}catch{try{const{diagram:t,id:i}=await r();Ja(i,t,e)}catch(i){throw Bn.error(`Failed to load external diagram with key ${t}. Removing from detectors.`),delete ts[t],i}}}))).filter(t=>"rejected"===t.status);if(t.length>0){Bn.error(`Failed to load ${t.length} external diagrams`);for(const e of t)Bn.error(e);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams");function Lk(t,e){t.attr("role","graphics-document document"),""!==e&&t.attr("aria-roledescription",e)}function jk(t,e,r,i){if(void 0!==t.insert){if(r){const e=`chart-desc-${i}`;t.attr("aria-describedby",e),t.insert("desc",":first-child").attr("id",e).text(r)}if(e){const r=`chart-title-${i}`;t.attr("aria-labelledby",r),t.insert("title",":first-child").attr("id",r).text(e)}}}_n(Lk,"setA11yDiagramInfo"),_n(jk,"addSVGa11yTitleDescription");var Fk=(_n(h=class{constructor(t,e,r,i,n){this.type=t,this.text=e,this.db=r,this.parser=i,this.renderer=n}static async fromText(t,e={}){const r=Rs(),i=es(t,r);t=yf(t)+"\n";try{Xa(i)}catch{const t=ns(i);if(!t)throw new Qn(`Diagram ${i} not found.`);const{id:e,diagram:r}=await t();Ja(e,r)}const{db:n,parser:s,renderer:a,init:o}=Xa(i);return s.parser&&(s.parser.yy=n),n.clear?.(),o?.(r),e.title&&n.setDiagramTitle?.(e.title),await s.parse(t),new h(i,t,n,s,a)}async render(t,e){await this.renderer.draw(this.text,t,e,this)}getParser(){return this.parser}getType(){return this.type}},"Diagram"),h),Nk=[],Ik=_n(()=>{Nk.forEach(t=>{t()}),Nk=[]},"attachFunctions"),Ok=_n(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Dk(t){const e=t.match(Xn);if(!e)return{text:t,metadata:{}};let r=Cg(e[1],{schema:bg})??{};r="object"!=typeof r||Array.isArray(r)?{}:r;
2const 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}}_n(Dk,"extractFrontMatter");var Rk=_n(t=>t.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,(t,e,r)=>"<"+e+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),zk=_n(t=>{const{text:e,metadata:r}=Dk(t),{displayMode:i,title:n,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:n,config:s,text:e}},"processFrontmatter"),$k=_n(t=>{const e=mf.detectInit(t)??{},r=mf.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:t})=>"wrap"===t):"wrap"===r?.type&&(e.wrap=!0),{text:Rg(t),directive:e}},"processDirectives");function Pk(t){const e=Rk(t),r=zk(e),i=$k(r.text),n=ff(r.config,i.directive);return{code:t=Ok(i.text),title:r.title,config:n}}function qk(t){const e=(new TextEncoder).encode(t),r=Array.from(e,t=>String.fromCodePoint(t)).join("");return btoa(r)}_n(Pk,"preprocessDiagram"),_n(qk,"toBase64");var Wk=["foreignobject"],Hk=["dominant-baseline"];function Vk(t){const e=Pk(t);return Ps(),$s(e.config??{}),e}async function Yk(t,e){Mk();try{const{code:e,config:r}=Vk(t);return{diagramType:(await iv(e)).type,config:r}}catch(r){if(e?.suppressErrors)return!1;throw r}}_n(Vk,"processAndSetConfigs"),_n(Yk,"parse");var Uk=_n((t,e,r=[])=>`\n.${t} ${e} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),Gk=_n((t,e=new Map)=>{let r="";if(void 0!==t.themeCSS&&(r+=`\n${t.themeCSS}`),void 0!==t.fontFamily&&(r+=`\n:root { --mermaid-font-family: ${t.fontFamily}}`),void 0!==t.altFontFamily&&(r+=`\n:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),e instanceof Map){const i=Us(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(t=>{kn(t.styles)||i.forEach(e=>{r+=Uk(t.id,e,t.styles)}
2),kn(t.textStyles)||(r+=Uk(t.id,"tspan",(t?.textStyles||[]).map(t=>t.replace("color","fill"))))})}return r},"createCssStyles"),Jk=_n((t,e,r,i)=>{const n=Gk(t,r);return ur(or(`${i}{${Aa(e,n,t.themeVariables)}}`),pr)},"createUserStyles"),Xk=_n((t="",e,r)=>{let i=t;return r||e||(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=xf(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),Kk=_n((t="",e)=>`<iframe style="width:100%;height:${e?.viewBox?.baseVal?.height?e.viewBox.baseVal.height+"px":"100%"};border:0;margin:0;" src="data:text/html;charset=UTF-8;base64,${qk(`<body style="margin:0">${t}</body>`)}" sandbox="allow-top-navigation-by-user-activation allow-popups">\n  The "iframe" tag is not supported by your browser.\n</iframe>`,"putIntoIFrame"),Zk=_n((t,e,r,i,n)=>{const s=t.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",e).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return n&&a.attr("xmlns:xlink",n),a.append("g"),t},"appendDivSvgG");function Qk(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}_n(Qk,"sandboxedIframe");var tv=_n((t,e,r,i)=>{t.getElementById(e)?.remove(),t.getElementById(r)?.remove(),t.getElementById(i)?.remove()},"removeExistingElements"),ev=_n(async function(t,e,r){Mk();const i=Vk(e);e=i.code;const n=Rs();Bn.debug(n),e.length>(n?.maxTextSize??5e4)&&(e="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");const s="#"+t,a="i"+t,o="#"+a,l="d"+t,c="#"+l,h=_n(()=>{const t=fl(u?o:c).node();t&&"remove"in t&&t.remove()},"removeTempElements");let d=fl("body");const u="sandbox"===n.securityLevel,p="loose"===n.securityLevel,g=n.fontFamily;if(void 0!==r){if(r&&(r.innerHTML=""),u){const t=Qk(fl(r),a);d=fl(t.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=fl(r);Zk(d,t,l,`font-family: ${g}`,"http://www.w3.org/1999/xlink")}else{if(tv(document,t,l,a),u){const t=Qk(fl("body"),a);d=fl(t.nodes()[0].contentDocument.body),d.node().style.margin=0}else d=fl("body");Zk(d,t,l)}let f,m;try{f=await Fk.fromText(e,{title:i.title})}catch(B){if(n.suppressErrorRendering)throw h(),B;f=await Fk.fromText("error"),m=B}const y=d.select(c).node(),x=f.type,b=y.firstChild,C=b.firstChild,w=f.renderer.getClasses?.(e,f),k=Jk(n,x,w,s),v=document.createElement("style");v.innerHTML=k,b.insertBefore(v,C);try{await f.renderer.draw(e,t,"11.13.0",f)}catch(M){throw n.suppressErrorRendering?h():rk.draw(e,t,"11.13.0"),M}const S=d.select(`${c} svg`),_=f.db.getAccTitle?.(),T=f.db.getAccDescription?.();nv(x,S,_,T),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let A=d.select(c).node().innerHTML;if(Bn.debug("config.arrowMarkerAbsolute",n.arrowMarkerAbsolute),A=Xk(A,u,Bs(n.arrowMarkerAbsolute)),u){const t=d.select(c+" svg").node();A=Kk(A,t)}else p||(A=It.sanitize(A,{ADD_TAGS:Wk,ADD_ATTR:Hk,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Ik(),m)throw m;return h(),{diagramType:x,svg:A,bindFunctions:f.db.bindFunctions}},"render");function rv(t={}){const e=as({},t);e?.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Ns(e),e?.theme&&e.theme in bs?e.themeVariables=bs[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=bs.default.getThemeVariables(e.themeVariables));const r="object"==typeof e?Fs(e):Os();Mn(r.logLevel),Mk()}_n(rv,"initialize");var iv=_n((t,e={})=>{const{code:r}=Pk(t);return Fk.fromText(r,e)},"getDiagramFromText");function nv(t,e,r,i){Lk(e,t),jk(e,r,i,e.attr("id"))}_n(nv,"addA11yInfo");var sv=Object.freeze({render:ev,parse:Yk,getDiagramFromText:iv,initialize:rv,getConfig:Rs,setConfig:Ds,getSiteConfig:Os,updateSiteConfig:Is,reset:_n(()=>{Ps()},"reset"),globalReset:_n(()=>{Ps(As)},"globalReset"),defaultConfig:As});Mn(Rs().logLevel),Ps(Rs());var av=_n((t,e,r)=>{Bn.warn(t),uf(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"),ov=_n(async function(t={querySelector:".mermaid"}){try{await lv(t)}catch(e){if(uf(e)&&Bn.error(e.str),bv.parseError&&bv.parseError(e),!t.suppressErrors)throw Bn.error("Use the suppressErrors option to suppress these errors"),e}},"run"),lv=_n(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const i=sv.getConfig();let n;if(Bn.debug((t?"":"No ")+"Callback function found"),r)n=r;else{if(!e)throw new Error("Nodes and querySelector are both undefined");n=document.querySelectorAll(e)}Bn.debug(`Found ${n.length} diagrams`),void 0!==i?.startOnLoad&&(Bn.debug("Start On Load: "+i?.startOnLoad),sv.updateSiteConfig({startOnLoad:i?.startOnLoad}
2));const s=new mf.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const o=[];for(const c of Array.from(n)){if(Bn.info("Rendering diagram: "+c.id),c.getAttribute("data-processed"))continue;c.setAttribute("data-processed","true");const e=`mermaid-${s.next()}`;a=c.innerHTML,a=ny(mf.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const r=mf.detectInit(a);r&&Bn.debug("Detected early reinit: ",r);try{const{svg:r,bindFunctions:i}=await xv(e,a,c);c.innerHTML=r,t&&await t(e),i&&i(c)}catch(l){av(l,o,bv.parseError)}}if(o.length>0)throw o[0]},"runThrowsErrors"),cv=_n(function(t){sv.initialize(t)},"initialize"),hv=_n(async function(t,e,r){Bn.warn("mermaid.init is deprecated. Please use run instead."),t&&cv(t);const i={postRenderCallback:r,querySelector:".mermaid"};"string"==typeof e?i.querySelector=e:e&&(e instanceof HTMLElement?i.nodes=[e]:i.nodes=e),await ov(i)},"init"),dv=_n(async(t,{lazyLoad:e=!0}={})=>{Mk(),rs(...t),!1===e&&await Ek()},"registerExternalDiagrams"),uv=_n(function(){if(bv.startOnLoad){const{startOnLoad:t}=sv.getConfig();t&&bv.run().catch(t=>Bn.error("Mermaid failed to initialize",t))}},"contentLoaded");"undefined"!=typeof document&&window.addEventListener("load",uv,!1);var pv=_n(function(t){bv.parseError=t},"setParseErrorHandler"),gv=[],fv=!1,mv=_n(async()=>{if(!fv){for(fv=!0;gv.length>0;){const e=gv.shift();if(e)try{await e()}catch(t){Bn.error("Error executing queue",t)}}fv=!1}},"executeQueue"),yv=_n(async(t,e)=>new Promise((r,i)=>{const n=_n(()=>new Promise((n,s)=>{sv.parse(t,e).then(t=>{n(t),r(t)},t=>{Bn.error("Error parsing",t),bv.parseError?.(t),s(t),i(t)})}),"performCall");gv.push(n),mv().catch(i)}),"parse"),xv=_n((t,e,r)=>new Promise((i,n)=>{const s=_n(()=>new Promise((s,a)=>{sv.render(t,e,r).then(t=>{s(t),i(t)},t=>{Bn.error("Error parsing",t),bv.parseError?.(t),a(t),n(t)})}),"performCall");gv.push(s),mv().catch(n)}),"render"),bv={startOnLoad:!0,mermaidAPI:sv,parse:yv,render:xv,init:hv,run:ov,registerExternalDiagrams:dv,registerLayoutLoaders:ww,initialize:cv,parseError:void 0,contentLoaded:uv,setParseErrorHandler:pv,detectType:es,registerIconPacks:ly,getRegisteredDiagramsMetadata:_n(()=>Object.keys(ts).map(t=>({id:t})),"getRegisteredDiagramsMetadata")},Cv=bv;const wv="messages",kv="config",vv="images";let Sv=null;const _v=()=>(Sv||(Sv=new Promise((t,e)=>{const r=indexedDB.open("PlaygroundDB",1);r.onerror=()=>{e(new Error("Failed to open IndexedDB"))},r.onsuccess=e=>{t(e.target.result)},r.onupgradeneeded=t=>{const e=t.target.result;if(e.objectStoreNames.contains(wv)||e.createObjectStore(wv,{keyPath:"id"}).createIndex("timestamp","timestamp",{unique:!1}),e.objectStoreNames.contains(kv)||e.createObjectStore(kv,{keyPath:"key"}),!e.objectStoreNames.contains(vv)){const t=e.createObjectStore(vv,{keyPath:"id"});t.createIndex("messageId","messageId",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}}})),Sv),Tv=async(t,e,r)=>{try{const i=(await _v()).transaction([t],e),n=i.objectStore(t);return new Promise((t,e)=>{const s=r(n);s.onsuccess=()=>{t(s.result)},s.onerror=()=>{e(new Error(`Transaction failed: ${s.error}`))},i.onerror=()=>{e(new Error(`Transaction error: ${i.error}`))}})}catch(i){throw console.error("IndexedDB operation failed:",i),i}},Av=async(t,e,r=null)=>{try{const i={id:t,data:e,messageId:r,timestamp:(new Date).toISOString()};return await Tv(vv,"readwrite",t=>t.put(i)),t}catch(i){throw console.error("保存图片到 IndexedDB 失败:",i),i}},Bv=()=>`img_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,Mv=(t,e=.8,r=1920,i=1080)=>new Promise(n=>{const s=document.createElement("canvas"),a=s.getContext("2d"),o=new Image;o.onload=()=>{let{width:t,height:l}=o;if(t>r||l>i){const e=Math.min(r/t,i/l);t*=e,l*=e}s.width=t,s.height=l,a.drawImage(o,0,0,t,l),s.toBlob(t=>{n(t)},"image/jpeg",e)},o.src=URL.createObjectURL(t)}),Ev=async t=>{try{try{await(async t=>{try{const e={id:"current_session",messages:t,timestamp:(new Date).toISOString()};await Tv(wv,"readwrite",t=>t.put(e))}catch(e){throw console.error("保存聊天记录到 IndexedDB 失败:",e),e}})(t)}catch(e){console.warn("IndexedDB 保存消息失败,使用 localStorage 备用:",e);const r={messages:t,timestamp:(new Date).toISOString()};localStorage.setItem(Q.MESSAGES,JSON.stringify(r))}}catch(r){console.error("保存消息失败:",r)}},Lv=async()=>{try{try{const t=await(async()=>{try{const t=await Tv(wv,"readonly",t=>t.get("current_session"));return t&&t.messages?t.messages:null}catch(t){return console.error("从 IndexedDB 加载聊天记录失败:",t),null}})();if(t)return t}catch(t){console.warn("IndexedDB 加载消息失败,尝试 localStorage:",t)}const e=localStorage.getItem(Q.MESSAGES);if(e)return JSON.parse(e).messages||null}catch(e){console.error("加载消息失败:",e)}return null},jv=async()=>{try{try{await(async()=>{try{await _v();const t=[wv,kv,vv];for(const e of t)await Tv(e,"readwrite",t=>t.clear())}catch(t){throw console.error("清空 IndexedDB 数据失败:",t),t}})()}catch(t){console.warn("清除 IndexedDB 失败:",t)}localStorage.removeItem(Q.CONFIG),localStorage.removeItem(Q.MESSAGES)}catch(e){console.error("清除配置失败:",e)}};var Fv=function(t,e){if(!(this instanceof Fv))return new Fv(t,e);this.url=t,e=e||{},this.headers=e.headers||{},this.payload=void 0!==e.payload?e.payload:"",this.method=e.method||this.payload&&"POST"||"GET",this.withCredentials=!!e.withCredentials,this.debug=!!e.debug,this.autoReconnect=void 0!==e.autoReconnect&&e.autoReconnect,this.reconnectDelay=void 0!==e.reconnectDelay?e.reconnectDelay:3e3,this.maxRetries=void 0!==e.maxRetries?e.maxRetries:null,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=void 0===e.useLastEventId||e.useLastEventId,this.FIELD_SEPARATOR=":",this.listeners={},this.xhr=null,this.readyState=Fv.INITIALIZING,this.progress=0,this.chunk="",this.lastEventId="",this._hasParsedBom=!1,this.addEventListener=function(t,e){void 0===this.listeners[t]&&(this.listeners[t]=[]),-1===this.listeners[t].indexOf(e)&&this.listeners[t].push(e)},this.removeEventListener=function(t,e){if(void 0===this.listeners[t])return;const r=[];this.listeners[t].forEach(function(t){t!==e&&r.push(t)}),0===r.length?delete this.listeners[t]:this.listeners[t]=r},this.dispatchEvent=function(t){if(!t)return!0;this.debug,t.source=this;const e="on"+t.type;return(!this.hasOwnProperty(e)||(this[e].call(this,t),!t.defaultPrevented))&&(!this.listeners[t.type]||this.listeners[t.type].every(function(e){return e(t),!t.defaultPrevented}))},this._markClosed=function(){if(this.xhr=null,this.progress=0,this.chunk="",this._setReadyState(Fv.CLOSED),this.autoReconnect){if(null!==this.maxRetries&&this.retryCount>=this.maxRetries)return this.debug&&this.maxRetries,this.autoReconnect=!1,void this.close();this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.debug&&(this.reconnectDelay,this.retryCount,this.maxRetries&&this.maxRetries),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryCount++,this.stream()},this.reconnectDelay)}},this._setReadyState=function(t){const e=new CustomEvent("readystatechange");e.readyState=t,this.readyState=t,this.dispatchEvent(e)},this._onStreamFailure=function(t){const e=new CustomEvent("error");e.responseCode=t.currentTarget.status,e.data=t.currentTarget.response,this.dispatchEvent(e),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent("abort")),this._markClosed()},this._onStreamProgress=function(t){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300)return void this._onStreamFailure(t);this.retryCount=0;let e=this.xhr.responseText.substring(this.progress);this.progress+=e.length,this._hasParsedBom||0!==this.chunk.length||(65279===e.charCodeAt(0)&&(e=e.substring(1)),this._hasParsedBom=!0);const r=(this.chunk+e).split(/(\r\n\r\n|\r\r|\n\n)/g),i=r.pop();r.forEach(function(t){t.trim().length>0&&this.dispatchEvent(this._parseEventChunk(t))}.bind(this)),this.chunk=i}
2,this._onStreamLoaded=function(t){this._onStreamProgress(t),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk="",this._markClosed()},this._parseEventChunk=function(t){if(!t||0===t.length)return null;this.debug;const e={id:null,retry:null,data:null,event:null};if(t.split(/\n|\r\n|\r/).forEach(function(t){const r=t.indexOf(this.FIELD_SEPARATOR);let i,n;if(r>0){const e=" "===t[r+1]?2:1;i=t.substring(0,r),n=t.substring(r+e)}else{if(!(r<0))return;i=t,n=""}i in e&&("data"===i&&null!==e[i]?e.data+="\n"+n:e[i]=n)}.bind(this)),null!==e.id&&-1===e.id.indexOf("\0")&&(this.lastEventId=e.id),null!==e.retry&&/^[0-9]+$/.test(e.retry)&&(this.reconnectDelay=parseInt(e.retry,10)),null===e.data)return null;const r=new CustomEvent(e.event||"message");return r.id=e.id,r.data=e.data||"",r.lastEventId=this.lastEventId,r},this._onReadyStateChange=function(){if(this.xhr&&this.xhr.readyState===XMLHttpRequest.HEADERS_RECEIVED){const t={},e=this.xhr.getAllResponseHeaders().trim().split("\r\n");for(const i of e){const[e,...r]=i.split(":"),n=r.join(":").trim();t[e.trim().toLowerCase()]=t[e.trim().toLowerCase()]||[],t[e.trim().toLowerCase()].push(n)}const r=new CustomEvent("open");r.responseCode=this.xhr.status,r.headers=t,this.dispatchEvent(r),this._setReadyState(Fv.OPEN)}},this.stream=function(){if(!this.xhr){this._setReadyState(Fv.CONNECTING),this.xhr=new XMLHttpRequest,this.xhr.addEventListener("progress",this._onStreamProgress.bind(this)),this.xhr.addEventListener("load",this._onStreamLoaded.bind(this)),this.xhr.addEventListener("readystatechange",this._onReadyStateChange.bind(this)),this.xhr.addEventListener("error",this._onStreamFailure.bind(this)),this.xhr.addEventListener("abort",this._onStreamAbort.bind(this)),this.xhr.open(this.method,this.url);for(let t in this.headers)this.xhr.setRequestHeader(t,this.headers[t]);this.useLastEventId&&this.lastEventId.length>0&&this.xhr.setRequestHeader("Last-Event-ID",this.lastEventId),this.xhr.withCredentials=this.withCredentials,this.xhr.send(this.payload)}},this.close=function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.autoReconnect=!1,this.xhr&&this.xhr.abort()},(void 0===e.start||e.start)&&this.stream()};function Nv(t){return`playground_favorite_models:${t}`}function Iv(t){const e=t??ht();return e>0?e:null}function Ov(t,e){return t.includes(e)}function Dv(t,e,r={}){const i="string"==typeof t&&t?t:JSON.stringify(t??r);Ct({type:"playground_favorite_toggle",message:i,url:"undefined"!=typeof window?window.location.href:"",extra:JSON.stringify({model:e,...r})})}Fv.INITIALIZING=-1,Fv.CONNECTING=0,Fv.OPEN=1,Fv.CLOSED=2;const Rv=p.createContext(null),zv=({favoriteModels:t,toggleFavoriteModel:e,children:r})=>{const i=p.useMemo(()=>{const r=new Set(t);return{favoriteModels:t,favoriteSet:r,toggleFavoriteModel:e}},[t,e]);return g.jsx(Rv.Provider,{value:i,children:r})},$v=()=>p.useContext(Rv)||{favoriteModels:[],favoriteSet:new Set,toggleFavoriteModel:()=>{}};function Pv(t){const e=p.useRef(null),[r,i]=p.useState(!1);return p.useEffect(()=>{t.code&&e.current&&Cv.run({nodes:[e.current],suppressErrors:!0}).catch(t=>{i(!0),console.error("[Mermaid] ",t.message)})},[t.code]),r?null:g.jsx("div",{className:b("mermaid-container"),style:{cursor:"pointer",overflow:"auto",padding:"12px",border:"1px solid hsl(var(--border))",borderRadius:"8px",backgroundColor:"hsl(var(--card))",margin:"12px 0"},ref:e,onClick:()=>function(){const t=e.current?.querySelector("svg");if(!t)return;const r=(new XMLSerializer).serializeToString(t),i=new Blob([r],{type:"image/svg+xml"}),n=URL.createObjectURL(i);window.open(n,"_blank")}(),children:t.code})}function qv(t){const e=p.useRef(null),[r,i]=p.useState(""),{t:n}=et(),s=function(t,e,r){var i=this,n=p.useRef(null),s=p.useRef(0),a=p.useRef(0),o=p.useRef(null),l=p.useRef([]),c=p.useRef(),h=p.useRef(),d=p.useRef(t),u=p.useRef(!0),g=p.useRef(),f=p.useRef();d.current=t;var m="undefined"!=typeof window,y=!e&&0!==e&&m;e=+e||0;var x=!!(r=r||{}).leading,b=!("trailing"in r)||!!r.trailing,C=!!r.flushOnExit&&b,w="maxWait"in r,k="debounceOnServer"in r&&!!r.debounceOnServer,v=w?Math.max(+r.maxWait||0,e):null,S=p.useMemo(function(){var t=function(t){var e=l.current,r=c.current;return l.current=c.current=null,s.current=t,a.current=a.current||t,h.current=d.current.apply(r,e)},r=function(t,e){y&&cancelAnimationFrame(o.current),o.current=y?requestAnimationFrame(t):setTimeout(t,e)},p=function(t){if(!u.current)return!1;var r=t-n.current;return!n.current||r>=e||r<0||w&&t-s.current>=v},S=function(e){return o.current=null,b&&l.current?t(e):(l.current=c.current=null,h.current)},_=function t(){var i=Date.now();
2if(x&&a.current===s.current&&T(),p(i))return S(i);if(u.current){var o=e-(i-n.current),l=w?Math.min(o,v-(i-s.current)):o;r(t,l)}},T=function(){},A=function(){if(m||k){var a,d=Date.now(),y=p(d);if(l.current=[].slice.call(arguments),c.current=i,n.current=d,C&&!g.current&&(g.current=function(){var t;"hidden"===(null==(t=globalThis.document)?void 0:t.visibilityState)&&f.current.flush()},null==(a=globalThis.document)||null==a.addEventListener||a.addEventListener("visibilitychange",g.current)),y){if(!o.current&&u.current)return s.current=n.current,r(_,e),x?t(n.current):h.current;if(w)return r(_,e),t(n.current)}return o.current||r(_,e),h.current}};return A.cancel=function(){o.current&&(y?cancelAnimationFrame(o.current):clearTimeout(o.current)),s.current=0,l.current=n.current=c.current=o.current=null},A.isPending=function(){return!!o.current},A.flush=function(){return o.current?S(Date.now()):h.current},A},[x,w,e,v,b,C,y,m,k,void 0]);return f.current=S,p.useEffect(function(){return u.current=!0,function(){var t;C&&f.current.flush(),g.current&&(null==(t=globalThis.document)||null==t.removeEventListener||t.removeEventListener("visibilitychange",g.current),g.current=null),u.current=!1}},[C]),S}(()=>{if(!e.current)return;const t=e.current.querySelector("code.language-mermaid");t&&i(t.innerText)},600);return p.useEffect(()=>{if(e.current){const t=e.current.querySelectorAll("code"),r=["","md","markdown","text","txt","plaintext","tex","latex"];t.forEach(t=>{let e=t.className.match(/language-(\w+)/),i=e?e[1]:"";r.includes(i)&&(t.style.whiteSpace="pre-wrap")}),setTimeout(s,1)}},[]),g.jsxs(g.Fragment,{children:[g.jsxs("pre",{ref:e,className:"not-prose",style:{position:"relative",color:"hsl(var(--foreground))",backgroundColor:"hsl(var(--foreground) / 0.02)",border:"1px solid hsl(var(--border))",borderRadius:"6px",padding:"12px",margin:"12px 0",overflow:"auto",fontSize:"14px",lineHeight:"1.4"},children:[g.jsx("div",{className:"copy-code-button",style:{position:"absolute",top:"8px",right:"8px",display:"flex",gap:"4px",zIndex:10,opacity:0,transition:"opacity 0.2s ease"},children:g.jsx(w,{content:n("复制代码"),children:g.jsx(k,{size:"small",theme:"borderless",icon:g.jsx(Pt,{size:16}),onClick:t=>{if(t.preventDefault(),t.stopPropagation(),e.current){const t=e.current.querySelector("code")?.innerText??"";kt(t).then(t=>{t?y.success(n("代码已复制到剪贴板")):y.error(n("复制失败,请手动复制"))})}},style:{padding:"4px",backgroundColor:"hsl(var(--secondary))",borderRadius:"4px",cursor:"pointer",border:"1px solid hsl(var(--border))",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.1)"}})})}),t.children]}),r.length>0&&g.jsx(Pv,{code:r},r)]})}function Wv(t){const e=p.useRef(null),[r,i]=p.useState(!0),[n,s]=p.useState(!1),{t:a}=et();p.useEffect(()=>{if(e.current){const t=e.current.scrollHeight;s(t>400),e.current.scrollTop=e.current.scrollHeight}},[t.children]);return g.jsxs("div",{style:{position:"relative"},children:[g.jsx("code",{className:b("not-prose",t?.className),ref:e,style:{maxHeight:r?"400px":"none",overflowY:"hidden",display:"block",padding:"8px 12px",color:"hsl(var(--foreground))",backgroundColor:"hsl(var(--foreground) / 0.02)",borderRadius:"4px",fontSize:"13px",lineHeight:"1.4"},children:t.children}),n&&r?g.jsx("div",{style:{position:"absolute",bottom:"8px",right:"8px",left:"8px",display:"flex",justifyContent:"center"},children:g.jsx(k,{size:"small",onClick:()=>{i(t=>!t)},theme:"solid",children:a("显示更多")})}):null]})}Cv.initialize({startOnLoad:!1,theme:"default",securityLevel:"loose"});const Hv=1e5,Vv=f.memo(function(t){const{content:e,className:r,animated:i=!1,previousContentLength:n=0}=t,s=p.useMemo(()=>{return function(t){return"string"!=typeof t||t.length>Hv||t.includes("```")?t:t.replace(/([`]*?)(\w*?)([\n\r]*?)(<!DOCTYPE html>)/g,(t,e,r,i,n)=>e?t:"\n```html\n"+n).replace(/(<\/body>)([\r\n\s]*?)(<\/html>)([\n\r]*)([`]*)([\n\r]*?)/g,(t,e,r,i,n,s)=>s?t:e+r+i+"\n```\n")}("string"!=typeof(t=e)||t.length>Hv?t:t.replace(/(```[\s\S]*?```|`.*?`)|\\\[([\s\S]*?[^\\])\\\]|\\\((.*?)\\\)/g,(t,e,r,i)=>e||(r?`$$${r}$$`:i?`$${i}$`:t)));var t},[e]),a=r&&r.includes("user-message"),o=p.useMemo(()=>{const t=[Ot,[Dt,{detect:!1,ignoreMissing:!0}]];
2return i&&t.push([wt,{previousContentLength:n}]),t},[i,n]);return g.jsx($t,{remarkPlugins:[Rt,C,zt],rehypePlugins:o,components:{pre:qv,code:Wv,p:t=>g.jsx("p",{...t,dir:"auto",style:{lineHeight:"1.6",color:a?"white":"inherit"}}),a:t=>{const e=t.href||"";if(/\.(aac|mp3|opus|wav)$/.test(e))return g.jsx("figure",{style:{margin:"12px 0"},children:g.jsx("audio",{controls:!0,src:e,style:{width:"100%"}})});if(/\.(3gp|3g2|webm|ogv|mpeg|mp4|avi)$/.test(e))return g.jsx("video",{controls:!0,style:{width:"100%",maxWidth:"100%",margin:"12px 0"},children:g.jsx("source",{src:e})});const r=/^\/#/i.test(e)?"_self":t.target??"_blank";return g.jsx("a",{...t,target:r,style:{color:a?"#87CEEB":"hsl(var(--primary))",textDecoration:"none"},onMouseEnter:t=>{t.target.style.textDecoration="underline"},onMouseLeave:t=>{t.target.style.textDecoration="none"}})},h1:t=>g.jsx("h1",{...t,style:{fontSize:"24px",fontWeight:"bold",margin:"20px 0 12px 0",color:a?"white":"hsl(var(--foreground))"}}),h2:t=>g.jsx("h2",{...t,style:{fontSize:"20px",fontWeight:"bold",margin:"18px 0 10px 0",color:a?"white":"hsl(var(--foreground))"}}),h3:t=>g.jsx("h3",{...t,style:{fontSize:"18px",fontWeight:"bold",margin:"16px 0 8px 0",color:a?"white":"hsl(var(--foreground))"}}),h4:t=>g.jsx("h4",{...t,style:{fontSize:"16px",fontWeight:"bold",margin:"14px 0 6px 0",color:a?"white":"hsl(var(--foreground))"}}),h5:t=>g.jsx("h5",{...t,style:{fontSize:"14px",fontWeight:"bold",margin:"12px 0 4px 0",color:a?"white":"hsl(var(--foreground))"}}),h6:t=>g.jsx("h6",{...t,style:{fontSize:"13px",fontWeight:"bold",margin:"10px 0 4px 0",color:a?"white":"hsl(var(--foreground))"}}),blockquote:t=>
2g.jsx("blockquote",{...t,style:{borderLeft:a?"4px solid rgba(255, 255, 255, 0.5)":"4px solid hsl(var(--primary))",paddingLeft:"16px",margin:"12px 0",backgroundColor:a?"rgba(255, 255, 255, 0.1)":"hsl(var(--foreground) / 0.02)",padding:"8px 16px",borderRadius:"0 4px 4px 0",fontStyle:"italic",color:a?"white":"inherit"}}),ul:t=>g.jsx("ul",{...t,style:{margin:"8px 0",paddingLeft:"20px",color:a?"white":"inherit"}}),ol:t=>g.jsx("ol",{...t,style:{margin:"8px 0",paddingLeft:"20px",color:a?"white":"inherit"}}),li:t=>g.jsx("li",{...t,style:{margin:"4px 0",lineHeight:"1.6",color:a?"white":"inherit"}}),table:t=>g.jsx("div",{style:{overflow:"auto",margin:"12px 0"},children:g.jsx("table",{...t,style:{width:"100%",borderCollapse:"collapse",border:a?"1px solid rgba(255, 255, 255, 0.3)":"1px solid hsl(var(--border))",borderRadius:"6px",overflow:"hidden"}})}),th:t=>g.jsx("th",{...t,style:{padding:"8px 12px",backgroundColor:a?"rgba(255, 255, 255, 0.2)":"hsl(var(--foreground) / 0.06)",border:a?"1px solid rgba(255, 255, 255, 0.3)":"1px solid hsl(var(--border))",fontWeight:"bold",textAlign:"left",color:a?"white":"inherit"}}),td:t=>g.jsx("td",{...t,style:{padding:"8px 12px",border:a?"1px solid rgba(255, 255, 255, 0.3)":"1px solid hsl(var(--border))",color:a?"white":"inherit"}})},children:s})});class Yv extends f.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,e){console.error("[MarkdownRenderer] render failed, fallback to plain text:",t?.message);const r=this.props.fallbackContent,i="string"==typeof r;Ct({type:"markdown_render",message:t?.message||String(t),stack:(t?.stack||"")+"\n\nComponent Stack:"+(e?.componentStack||""),url:window.location.href,user_agent:navigator.userAgent,extra:JSON.stringify({contentLength:i?r.length:-1,contentPreview:i?r.slice(0,200):""})})}componentDidUpdate(t){this.state.hasError&&t.fallbackContent!==this.props.fallbackContent&&this.setState({hasError:!1})}render(){return this.state.hasError?g.jsx("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0,fontFamily:"inherit",fontSize:"inherit",color:"inherit"},children:"string"==typeof this.props.fallbackContent?this.props.fallbackContent:""}):this.props.children}}function Uv(t){const{content:e,loading:r,fontSize:i=14,fontFamily:n="inherit",className:s,style:a,animated:o=!1,previousContentLength:l=0,...c}=t;return g.jsx("div",{className:b("markdown-body",s),style:{fontSize:`${i}px`,fontFamily:n,lineHeight:"1.6",color:"hsl(var(--foreground))",...a},dir:"auto",...c,children:r?g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"16px",color:"hsl(var(--muted-foreground))"},children:[g.jsx("div",{style:{width:"16px",height:"16px",border:"2px solid hsl(var(--border))",borderTop:"2px solid hsl(var(--primary))",borderRadius:"50%",animation:"spin 1s linear infinite"}}),"正在渲染..."]}):g.jsx(Yv,{fallbackContent:e,children:g.jsx(Vv,{content:e,className:s,animated:o,previousContentLength:l})})})}const Gv=({message:t,finalExtractedThinkingContent:e,thinkingSource:r,styleState:i,onToggleReasoningExpansion:n})=>{const{t:s}=et(),a=p.useRef(null),o=p.useRef(""),l="loading"===t.status||"incomplete"===t.status,c=l&&!t.isThinkingComplete?s("思考中..."):s("思考过程");if(p.useEffect(()=>{a.current&&e&&t.isReasoningExpanded&&(a.current.scrollTop=a.current.scrollHeight)},[e,t.isReasoningExpanded]),p.useEffect(()=>{l||(o.current="")},[l]),!e)return null;let h=0;return l&&o.current&&e.startsWith(o.current)&&(h=o.current.length),l&&(o.current=e),g.jsxs("div",{className:"rounded-xl sm:rounded-2xl mb-2 sm:mb-4 overflow-hidden shadow-sm backdrop-blur-sm",children:[g.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-primary-hover transition-all",style:{background:"hsl(var(--primary))",position:"relative"},onClick:()=>n(t.id),children:[g.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[g.jsx("div",{className:"absolute -top-10 -right-10 w-40 h-40 bg-background opacity-5 rounded-full"}),g.jsx("div",{className:"absolute -bottom-8 -left-8 w-24 h-24 bg-background opacity-10 rounded-full"})]}),g.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 relative",children:[g.jsx("div",{className:"w-6 h-6 sm:w-8 sm:h-8 rounded-full bg-fill-default flex items-center justify-center shadow-lg",children:g.jsx(qt,{style:{color:"hsl(var(--background))"},size:i.isMobile?12:16})}),g.jsxs("div",{className:"flex flex-col",children:[g.jsx(v.Text,{strong:!0,style:{color:"hsl(var(--background))"},className:"text-sm sm:text-base",children:c}),r&&g.jsxs(v.Text,{style:{color:"hsl(var(--background))"},className:"text-xs mt-0.5 opacity-80 hidden sm:block",children:["来源: ",r]})]})]}),g.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 relative",children:[l&&!t.isThinkingComplete&&g.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[g.jsx(Wt,{style:{color:"hsl(var(--background))"},className:"animate-spin",size:i.isMobile?14:18}),g.jsx(v.Text,{style:{color:"hsl(var(--background))"},className:"text-xs sm:text-sm font-medium opacity-90",children:"思考中"})]}),(!l||t.isThinkingComplete)&&g.jsx("div",{className:"w-5 h-5 sm:w-6 sm:h-6 rounded-full bg-fill-default flex items-center justify-center",children:t.isReasoningExpanded?g.jsx(Ht,{size:i.isMobile?12:16,style:{color:"hsl(var(--background))"}}):g.jsx(Vt,{size:i.isMobile?12:16,style:{color:"hsl(var(--background))"}})})]})]}),g.jsx("div",{className:`transition-all duration-500 ease-out ${t.isReasoningExpanded?"max-h-96 opacity-100":"max-h-0 opacity-0"} overflow-hidden bg-fill-subtle`,children:t.isReasoningExpanded&&g.jsx("div",{className:"p-3 sm:p-5 pt-2 sm:pt-4",children:g.jsx("div",{ref:a,className:"bg-card backdrop-blur-sm rounded-lg sm:rounded-xl p-2 shadow-inner overflow-x-auto overflow-y-auto thinking-content-scroll",style:{maxHeight:"200px",scrollbarWidth:"thin",scrollbarColor:"hsl(var(--muted-foreground)) transparent"},children:g.jsx("div",{className:"prose prose-xs sm:prose-sm prose-purple max-w-none text-xs sm:text-sm",children:g.jsx(Uv,{content:e,className:"",animated:l,previousContentLength:h})})})})})]})},Jv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAFsklEQVR4AexYb4hUVRQ/5+1sLVGbfSpJSFHTIDOpSKmoD0kGRTszq86bnVEHDA0Lk+pb0ERBX4wWMtiwGGHe/HF1ZlYsKjQwMNqoyP58UDLaD30QFP+x5GzzZk7nzLz75r2d98bZdbb80OXed+4599xzf/f/uU+D6zz8D/BaJ2jWI5hMJgPG/sIj6XxpZzpXeD+dLeaMXOFAJl/cm8mV3mD6XCpVmvevA8zlxh7mxvcuvvu+s1DD40g0jIAvIkIEAAeJYCsBJYlgrLePzhrZwhHWZ7CpPphF0Dqtk8kU7jJyxQNVqI0Tg2BAnYxOABCfZP2x3hv7fxSgnban9DoCmM4Xh0iDX7nSIKdpkSZZMI5IY5KA8CjzE5zcEXG5ADVyhRSHjkfzqgAzvJ6QwADAm8EK3NBFQBquQe2h06d+uS2mh9YMRcJBSbFocC3ziyqAixjsqwB00qpmEdwS6Lv1SDZ76HZL0Ja0BSjgiNeT0wIifGRO4aJYJLxrkz74PW8W01mu8gk9OMFg343p4XsIaXu9U1YhAjxaxerRD0ZH7U5bRS3EF6CRLW52g6NJBjcwFAk9n0gEL7ZYaiOIR8Ifmji1CghOgBUY5L39Zk/aYn2JJ0DZEAxuRNUiojJosI7BHVKymdKErk9cumA+RgDHVV1EHOCNt0PxXtQTICAMc+XmQkYYjG0Mfw3XGHbs2DBpls31PJJ/KlM89W+3Oy9bAObzxZXEPVMGmI7E9fCnTLsSE4kNZwBxizKGCPNu6IOdip9OWwCaRC8rJZnaStl8U/HdojE9+CXysaTs1bhN3mwBxTupC6CcT0Q4oBRQ00bqPVaCLlKs4bAyJ6O4eNmKpxTvpC6AvTf1PyDKSqGHMK/y3abRaOgrtmkf6AxkHfMtkeVNGZH2oIObPHXqxA9Nfi5ydExZrQHer/JO6gLIF/9yVUgAJ5PJpOchrHSumRLI9Vk3gwB223WB9XEBZJl9smsI9lHA8rmJ7jY8nY9pAKl59s0NpHZWr76LAfAcWIF3s2ePrOKuECKw2+C85/XpGkECPAMqECxR2TmjiHYbfHp4LikXQHAsWkBYYBiFBXMGrm6YnqiTxsd2JBps4+sC+BdckbOpuXM12NhQ6/5XOo+A9rHG+WNerbgAbotGzwFhUxFhezKZ9Fy8XsZmJAvAK0pfrlSkK56ekgugVCCN9gltJFyydNnKzY18u+/MykZHD99JNdiuamkafB6VwVECB20B+PvJn/ezL3ha6fBFvlumQ/HdoH9XKyOIaB9pPYBJP7stAHlKZQ3aHg2yO0Q9UOrEPfdrxCk3coW3mH+Gk4pGJBL6STHTaQtAUYjX/b/mVCMv5v5q4LNUavQOKZ9taoDD1x31JzQq73LwLVlPgKJVKV9+gZzuOT90evsC32SzxcelfCZJ1hy79ocBXOCAw5kLgUCZqW/0BZhIJMpmwz13nk8LawjHMtlCSf4w+Fq1ClK53MIMP1unzIo4Bc5ptTRgtcxMu+XjC1AsiLMqDx3Of8LJjvIkqPIfBh6VPwx+iKf5/wz/NRhKZ0vhdLawzciX3uP/Nd/1wo2/ET9bZR03K4PcGOOKR56ZdiDbAhQj8tCJ6aFnid+2ACR/EUSs0kIA3IJEw3yXGuzGH0TEEWAXHnndAsC0M5T2VaZwxaXz5trpy8cPpMZGOorytq2Uq0vZ8G4G43mx+xiSU+FgD2irY3qYV07wonT68nnzabbVfIL6jKTmY9RTLFMe10OvmVOX5vN7ZR0C7WHFcQISJ0OAMEuT0HigGzXArRqV58f00HpdH/iWC+3oB3JerecdW4kzMwLI+vXIw1Ae2jjwxZAefokbXxPXwwKil/MY08O3xKKhVTE9FN+kBz/2uyHEkBfIGqFrV88KoBjvVnKA3M0zsYen3vXM/c8BSkcFZJyXTpxnRPIiU+m6AKjAeNHrHuA/AAAA///5N+G7AAAABklEQVQDAGkvOm87+XCKAAAAAElFTkSuQmCC",Xv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAADvElEQVR4AexYzWsTQRR/b7aN0tLSitDi0X/CkwfBozfJTQ+mEpGm4AfaFBQWekha6EGyVQhNVPAgBBQETxYVBcWDB0+e6lGkVostLW3a3edM6s7Opsnu7IfQQ8u87Mzse7/57fuYnS2DA/53SDBpgGJ5MJ/P9+UKxbtjheK8lowXJ/N5sy8O2VgE7d6hCQS4wBc8qyUIud3M1k2uG7nFIkjIMlFX
2QsDtqDZCPxbBnubvOQCsAcCijhDAE6P5y+K6kVssgtVqdbNmlWZrVnlcR+pWeVrYRGbHDXwEIye/bpHo6nUoJh/ByMkPoFckunodislHME7y8yik2tqLyUfQl/wIn3wrI7zjY62iCNMjog9cx2t7ay12KiYfQZHIbvLbaE97CAB8rF0UYYUDDvqwaRdMYdOpmHwEVUKZLWdVHdOOMaiOk/RtgGHVnmXYhjpW+10Jrp4YWFMVew0YUMdJ+u1Yf75nfM5QsbsSbJhmk4Dk7u8ApuZBhzwPijUaDbOpklL7XQkKJV5R0otIti8s4n5sYaAcHLCr9wR+IEFeVZ4xY6mFGJUcRIJNQaSbBBLkRutcWo0cSi3EpIYYwXNCayX/TyBBJJIhJvTyxg8RY0TQ71qpa7hz6jWQoIMgPcgovSpGoCGXBCFL4EHF/YTpVbEfi+LnIALKEPMnTq9IlBxExQl8jX0tMMTgODLEqFTePpSIE4TeNkOQoEgIDZkffENNrYoByNtTnQTbDAOvihHwSDZrdvkW0Xdh1jQzAsu1YElCvGN7VSwAh4fXE3uxf3njmMBypX0Nd969BuYg9tpqkUDzKPNC4yJEvDIylNccgJEkB//HkctuK7ago5Z49kAPth+5mEHHhVESaccIOmqJdQIJ7h25vG2A71kjwiiJoIPyIfk7eTXoqCXWCSQoFLh849JqCCi+4lr92D+MzkhbBIkt59o64QQR30gbglNjE8WC2CrknGYnm80aufHb1/hDnpYmKrac9HfCCW7YT0UopBnBxODK1qtcYXJB6z9b/KNd6A6OnHyNyK5KHICfPdvN58q4YzeUYL0+y193eJ2/krYVhNF/nhAhD5U9XRx17QUWIk5Vq3Mr7ly3ayhBYVifL320bbgECF/FOJEQzzukiwuV0nsdHC2CAujxg/LntR9L523Ey5xohQCfOUAv+L3FEHnJ7zf4+/c+AlxZW146V6/MfOFzWk2boEBrNBr2I/7ktUrZqlulqYfWzC3xwR0iN/j9OzVr5t6CVX4rMASWrkQiqAuapt6BJ/gXAAD//4u9hDsAAAAGSURBVAMAUZr/YOvBoqUAAAAASUVORK5CYII=",{Text:Kv,Title:Zv}=v,Qv=({session:t,isActive:e,onClick:r,onDelete:i,isMobile:n=!1})=>{const{t:s}=et(),[a,o]=p.useState(!1),l=()=>t.messages?.length||0;return g.jsx(L,{style:{marginBottom:6,cursor:"pointer",background:e?"linear-gradient(135deg, rgba(70, 172, 255, 0.08) 0%, rgba(0, 132, 255, 0.08) 100%)":"hsl(var(--card))",border:e?"1px solid rgba(0, 132, 255, 0.3)":"1px solid rgba(0, 0, 0, 0.04)",borderRadius:"8px",transition:"all 0.2s ease",transform:e?"translateX(2px)":"translateX(0)",boxShadow:e?"0 2px 8px rgba(70, 172, 255, 0.1)":"none"},bodyStyle:{padding:"10px 12px",position:"relative"},onClick:r,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),shadows:"none",children:g.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:g.jsxs("div",{style:{flex:1,minWidth:0},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:4},children:[e?g.jsx("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFl0lEQVR4AcRXaWxVRRT+zrxWGxFsFAGh+goStXGhBRICisH4wxAhLSFKSGVpClKo2ECqEYHQRAWMIAgBZEslIASbeMMPIo0mlBglChaIRomItIpC3ShbWrvc4zdzXxf63mvl0YbbOefMnDnLN2fm3bk1uMlPFICnPtIRT+7VZWN369Yxu7Rs1E71RpKGf6BeZql6j25X75Ft6mVsUe+Bzerd/7566RvVC29Qb+B69Qa8p3v6rdPSu9fo4tR1Oqyr9bUCGFeqKU+X6VYojopimQrySZMhyIYi20oFJZBDfbYlq2OCHKGNHRtKMZgCxQyO35AmHOuzWktRoim0i9laAST3xiY6zmJQZaI2YwXjQ9oUoFkw0oigg5uPjCNaiFDLNqP37VgfKKO5A/DMxzqMUWdCyBU1IcH4pBD6HM4V89U0kSPTRSpniDmRJ+bbfJHv88WcnC3m1ItiTheIqZon8ss8Mb+9JObcfDENPu5Ugxz1UWNTElj+bW/rSNvvSA5As48JboKWhFBwcIqUVzwvV5wuAVa7QGr/LpJ9MJhlQ8Ln0oBnY4VyAELAUJbKzovW4ZDtdAdduIhDPE9BaEFarJgOgCpSeGgU3IKKPKmNZZiQroRVZEwbl5QaK4YDwMkUlt6axrK5MR2XpTaCIsmKjhQA8AM1qxB0upEzprptcCiiAwcAAg4aRlt0h4a1jZOf59QmaKmA7fcA2eQisQMHa7ecKN05iG2XsJYH3Pm2SDdox2xq8HfaTvU/uiWaNHSL5vIe2DR4k5aFeRek8R4YuE69/qR+a9W7a416qavVa125IvOWlfpO8kq95n4IADCnKn8LlF21dN4ZGYPwaQjYxeBz6DWZPtm8A9x9wXOUo7wzLFGfw6pSADyMYSiK+XY8bt7SxU5JFgAIuDKYUtdp6+VjBQ3GdbRtcWQi5RwzknNblcZMbA+4UKN2XhVvYrk+bqdcahrV0ojmkHG7ta+diEfC1dlA3LYaruaxM7wLqnkPnC0U8zvvgZqXxfxZJOafhSK1C8VcLhZz9VUxdfVIpt805glC+8gBHweAE9+x75ofQqHrxGEEm8YgwpUcPT1XWv3imLepS6SpoQ57uW1gPmUM92p2ABovYTsnLjCofWmUjN2jpWN262S734h+klwAoCl6qgsNQbBqLCLtDNw3ggNg3/9cWR5RNZHAPZpJWdY/GT+M3qGDaO5axjYNu44SguskwISR27k5AHb82XOyj3Ii6STDKyUFws2CJbafxeTJBhXg4yYpE25qQwferQDs0H4HHJoqGb6P4RxfVTLSQ1kfalhDqFBFOseguxNI5FF6g1WIvH2vAdAS78tcOU4Tt8dMOgBNOKhAGAYUtPJdEHauv9lz5rwjmSOik0CCBwVId04+ygmBQ9g1kCXWuCjhz9gtMC4ALvWKS6YutU1YftlgElOeg4AxMDS9k69d2kW15OU6KqK0Uf+y/bgAOLnLJqJ0yS8Ck6rypJ7jciXj3MOhAfiR/xMcu2+jVg7aoJX3rNdK3gOf931Xd/ZZGyTrtUqL+EF65NaVWsnyf+JcgxoesP24AA6/IIv4mx3Pr9sJlVWYGEmOBsVSUVS76gBpEAxjOTJZ0izaZ4ngCfrkhnwcvmOV2k/9FbQZwWSZzJtKCdrvxxKxvzoeK6uJQ19Pl/Jvpsl+8AWCyPPTbDlb34jRBLCKlThBWc2pKiapYrQz1J3l2DWueA6TplBnq/gvlV+Q5qIJdivZBV2cuD5WVSjnTxXIKz8XSBb/Jxj8a6EM4f8Eg8/PlyF/FMm9vmIigdW0RlUI/w40LpKx/uuyGe0WFHcLcAPPhQWyv6EZWQSx14Wxh1Zw2fU7sB4BYHPwBjx/qVimchvyeDZ2mBCWWn1H6jEALYmuFsuO+tckr75Yqlt07eV/AAAA//8wGpOLAAAABklEQVQDAE1VF19LPM8mAAAAAElFTkSuQmCC",alt:"",style:{width:16,height:16,marginRight:8}}):g.jsx("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAD40lEQVR4AexXTYgTWRCu6jG7mcOOu7CHPbjsLCusC/vjsMKy7C7scWFn2UyyzE5PokyDh4E5eNGDiJiDoKA3D4OIRE0n3f6ko6CgeFH0ICg4DIKKCh48zEFERTCaTpdVz35JJnYyJkRFsHnV9bpevarv1XupejHgHT+vACgcKf9ccMrbCq63z3ZKRwtuqdwN5YueYzvlnO16W1zX+2mp9dUB5HK5uDilGl0hoCwRrAfA/4gw0Q0hwgQATQHBdp9g
2jhfBpnNxaPPUAcTiQ7OknLbR7FmMUx8NLt/TbrohAy9DhVPSJ6AFptFHA/4nGTOJvVC1gp8hQoLtLCibvLBDzrE10m8lBcAPYFQPGIjTa83UqZnx8Sda1i23rLGH6YnkCZ7H28hvbgMw8DezV5qhJIgrFefX86d4nllf2uMHtYYtpBVRRhUAIqofEkEfpdiLbGamEUU+X59G2VAADKMBIEqpHzJEWhZlRwGIGnhbsg8A3s8IZLPZZXnXS9uON8uptmO90GeJCFfnHW+X21Ifuo4AJ/b4N9/+eBYJbDY+DUvUC2g8wwiwUdWHordFi7sGEBsc2sGG/tQGeuII2+3Dpd9krgJABA8hfIrF4udhN5pxdZQByfNBFX543Vpx++Z8jBAyMlcIA0wIVwC4dF6TDyHCwRnhHUilVAS8sm5dsj6vg74a4nPj37kxf1h98CsgUHYUgOozY7+OAq8sywcrx3eDf2W/Wbe1qYzGmc1vHVjqW0BoHZ19FQDJ/4YBUo5DozjFgI7H4suv23ZJIQV+CoXSV8z62hQAsSjlEwODyzLdkO+QhmEA1YkV52TguVDeN1YHIBbT6cSZjJn6rhr4IwCk7wOrmpwPi14/aREAbdhKj88BYbgd9EW48r47F3+RAGSgQbiK+8o5AZzmfl8ahQvsBEBvgXIozv3KozH+lah7XkC4ss2vROlHvRzn+C9N8vvS7wRAUq3ogHZuWVYFwygw/z728dAtu+hdbSbO9xe4RuS1s7xb3pB3SpdFx6egHkHEl9FsCyAzmdyMhvEXr3j0zs35f8S5QlODrczvMgEgrgCE1c3EwH4HgEwNgksMZBaCYCcCrhEddqqvZSflV8d60BaADKb/T5yRG3I2mw0PJFvOpO5VK/6vHJXdHJo51hMwTUT3WKbbNCKq+ybfOys856KBNM1peUwrdASglVq5ZY0vrDWTmzhKIxkz+fViSn2JTf8J9FxOdKd5zh+TE6m9zQvqCYA22o5LeP1KbYQIXK1DhIsOtZa/EQBiXEVpMmnyNnGKxwNVeCZnR4YW0RsDoL3wNh3MmGOWZZpyTrS4zl8AAAD//4OmPz8AAAAGSURBVAMAf+DwUFMLu00AAAAASUVORK5CYII=",alt:"",style:{width:16,height:16,marginRight:8}}),g.jsx(Kv,{strong:!0,ellipsis:{showTooltip:!0},style:{color:e?"#0084FF":"hsl(var(--foreground))",fontSize:"13px",fontWeight:600,flex:1},children:t.title||s("新对话")}),l()>0&&g.jsx(j,{count:l(),type:e?"primary":"secondary",size:"small",style:{marginLeft:4,fontSize:"11px"}})]}),g.jsx(Kv,{type:"tertiary",size:"small",ellipsis:{showTooltip:!0},style:{display:"block",marginBottom:4,lineHeight:"1.3",fontSize:"12px",color:e?"rgba(0, 132, 255, 0.7)":"hsl(var(--muted-foreground))"},children:(()=>{const e=(t.messages||[]).filter(t=>"user"===t.role).slice(-1)[0],r=ot(e)||s("暂无消息");return String(r).slice(0,50)})()}),g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g.jsx("div",{style:{display:"flex",alignItems:"center"},children:g.jsx(Kv,{type:"tertiary",size:"small",style:{color:e?"rgba(0, 132, 255, 0.6)":"hsl(var(--muted-foreground) / 0.60)",fontSize:"11px"},children:(t=>{const e=new Date(t),r=(new Date-e)/36e5;return r<1?s("刚刚"):r<24?s(`${Math.floor(r)}小时前`):r<168?s(`${Math.floor(r/24)}天前`):e.toLocaleDateString()})(t.createTime)})}),g.jsx(A,{title:s("确定要删除这个对话吗?"),content:s("删除后无法恢复"),onConfirm:e=>{e.stopPropagation(),i(t.id)},position:"topRight",children:g.jsx(k,{size:"small",type:"danger",theme:"borderless",icon:e?g.jsx("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAADQElEQVR4AexYO2sUURT+ziRLEl9oYQr/gEVA8hcsbMQggoW/QLDQwlJ3l4kGO0FUEFSEIEgaETQ2NoKIIjbBByoIFoIoVoqaLLuZ6zm7Zubcmd07dx5FCi9zZu+5e853vzmPmdkNsMnHf4JVE1QugifNBM6ZYzhvTnjKUYhPCbblCE5jDgH2gzDrKQewG0dQYpQjaDBeeK8A3cI+7FCO4HfcY99HMFjxkgiP8Q3LKDHKEbxCHTTpLlp0zUvatATxqUxQCrlY8fs2ia9dppnsCE6jaPHPwr9RfGwzzWQTLFP8JdLmdEk1k01QFz/wwQIivIFvU+TZAe8sbNlLfIY0k01QCrn5r/h7WLJAuvBvirzm6aWwe7gD8Wlnm8kmaDHCL1vFlpReRd2Wcl5L6bHqIvgntpJJgCn5qEXSWF/wexTuaIIh9bjm9N2/vgiOI4mg4SfMddL7WFwDS8sqSRSNAs3aFVtZx4RySJeS+gr8yLfUjJKEPp2WjGmhBR3BjsuzSATrS7FR2aBMM1p8/QlCgVoQpZRJ5ZWUkVrcmLoJGqxuGPIjrb4uJmxVuJVqUDvXl2Koe2qETkx2yMQdQUISfkKdEUyapFINRirFpsYaNKjpNmNfXZ0pTiJo0BmS2XjJnWJYKW7guGnEntakgBKacW44jaPrPAPkJqhTLK57UL0O17BdoGJJ7xF/MZi4CeoIDuyT1Az04udJq/7Ev0IEkbnL11GH6Ysc+aol7ItFsIEd4lRJ0hiOVy3ZJ5DTSJFXrkhFMcJOVB2RukjBdrxqyVZugmJB+CoffZFfcP1JhZPBvthbY8eL9iSfYIBXymUv/1l0CHKrUIte09AEmDeHEWAmtrex42U9ySc4hSfskHQaYQ5jWMCCOcVk/X6Qi+0YLrDfQcYaHAY/0MXzgTL6nE/wNK0iwA3r9Z+wiyFnICn3EUBsxYfd+DDoMt4iQvqJnJFPUADO0Hus4xKAzyzVjqhf0xfRprc+QH4EBSmkj+hxmiJc5qt/wEvPEOEFz1ecQnjJtk/Z5iHbX2WZR4s+8ZrX4U9Q4EKKIFfeomU0aZHnt3gz9z9cZ+km295mu/ts/xqCAf9RjKA/bm2Wm57gXwAAAP//Jt7h3wAAAAZJREFUAwARQJNgOYNu1QAAAABJRU5ErkJggg==",alt:"",style:{width:13,height:13}}):g.jsx("img",{src:Xv,alt:"",style:{width:13,height:13}}),style:{opacity:a?1:e?.7:.5,transition:"opacity 0.2s ease",padding:"2px 4px",borderRadius:"4px"},onClick:t=>t.stopPropagation()})})]})]})})})},tS=({currentSessionId:t,onSessionChange:e,onNewSession:r,onClearHistory:i,onDeleteSession:n,styleState:s,sessions:a=[]})=>{const{t:o}=et(),[l,c]=p.useState(""),h=p.useMemo(()=>l.trim()?a.filter(t=>{const e=(t.title||"").toLowerCase(),r=(t.messages||[]).filter(t=>"user"===t.role).slice(-1)[0],i=(ot(r)||"").toLowerCase(),n=l.toLowerCase();return e.includes(n)||i.includes(n)}):a,[a,l]),d=p.useMemo(()=>{const t={today:[],yesterday:[],thisWeek:[],older:[]},e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),i=new Date(r.getTime()-864e5),n=new Date(r.getTime()-6048e5);
2return h.forEach(e=>{const s=new Date(e.createTime);s>=r?t.today.push(e):s>=i?t.yesterday.push(e):s>=n?t.thisWeek.push(e):t.older.push(e)}),t},[h]),u=(r,i,a)=>0===i.length?null:g.jsxs("div",{style:{marginBottom:12},children:[g.jsx(Kv,{type:"tertiary",size:"small",style:{display:"block",marginBottom:6,marginLeft:2,fontWeight:600,fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.5px",color:"hsl(var(--muted-foreground) / 0.60)"},children:r}),i.map(r=>g.jsx(Qv,{session:r,isActive:r.id===t,onClick:()=>e(r.id),onDelete:n,isMobile:s?.isMobile},r.id))]},a);return g.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",minHeight:0},children:[g.jsx("div",{style:{marginBottom:12,marginTop:0,flexShrink:0},children:g.jsxs(_,{vertical:!0,style:{width:"100%"},spacing:10,children:[a.length>0&&g.jsx(T,{prefix:g.jsx("img",{src:Jv,alt:"",style:{width:18,height:18,marginRight:8}}),placeholder:o("搜索对话..."),value:l,onChange:c,showClear:!0,style:{height:"32px",background:"hsl(var(--secondary))",border:"1px solid hsl(var(--border))",borderRadius:"6px",padding:"6px 10px",fontSize:"13px"}}),a.length>0&&g.jsx("div",{className:"w-full flex items-center justify-end",children:g.jsx(A,{title:o("确定要清空所有历史对话吗?"),content:o("此操作无法撤销"),onConfirm:i,position:"bottomLeft",children:g.jsx(k,{size:"small",type:"danger",theme:"borderless",icon:g.jsx("img",{src:Xv,alt:"",style:{width:14,height:14,cursor:"pointer"}}),style:{opacity:.7,transition:"opacity 0.2s ease",padding:"4px 6px",borderRadius:"4px",fontSize:"12px"},onClick:t=>t.stopPropagation(),children:o("清空历史")})})})]})}),g.jsx("div",{className:"no-scrollbar",style:{flex:1,minHeight:0,overflow:"auto",paddingRight:"4px",scrollbarWidth:"none",msOverflowStyle:"none"},children:h.length>0?g.jsxs("div",{children:[u(o("今天"),d.today,"today"),u(o("昨天"),d.yesterday,"yesterday"),u(o("本周"),d.thisWeek,"thisWeek"),u(
2o("更早"),d.older,"older")]}):a.length>0?g.jsx(B,{image:g.jsx("img",{src:Jv,alt:"",style:{width:56,height:56}}),description:g.jsxs("div",{children:[g.jsx(Kv,{type:"tertiary",children:o("未找到匹配的对话")}),g.jsx("br",{}),g.jsx(Kv,{type:"tertiary",size:"small",children:o("尝试使用其他关键词")})]}),style:{marginTop:"40px"}}):g.jsx(B,{image:g.jsx(E,{style:{width:120,height:120}}),darkModeImage:g.jsx(M,{style:{width:120,height:120}}),description:g.jsxs("div",{children:[g.jsx(Kv,{type:"tertiary",children:o("暂无历史对话")}),g.jsx("br",{}),g.jsx(Kv,{type:"tertiary",size:"small",children:o("点击上方按钮开始新的对话")})]}),style:{marginTop:"40px"}})})]})},{Text:eS}=v,rS=15,iS=[{id:"chat",icon:Qt,label:vt("智能对话")},{id:"image",icon:te,label:vt("绘画创作")},{id:"video",icon:ee,label:vt("视频创作")},{id:"audio",icon:re,label:vt("音频创作")}],nS={container:{backgroundColor:"#1e1e1e",color:"#d4d4d4",fontFamily:'Consolas, "Courier New", Monaco, "SF Mono", monospace',fontSize:"13px",lineHeight:"1.4",borderRadius:"8px",border:"1px solid #3c3c3c",position:"relative",overflow:"hidden",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},content:{height:"100%",overflowY:"auto",overflowX:"auto",padding:"16px",margin:0,whiteSpace:"pre",wordBreak:"normal",background:"#1e1e1e"},actionButton:{position:"absolute",zIndex:10,backgroundColor:"rgba(45, 45, 45, 0.9)",border:"1px solid rgba(255, 255, 255, 0.1)",color:"#d4d4d4",borderRadius:"6px",transition:"all 0.2s ease"},actionButtonHover:{backgroundColor:"rgba(60, 60, 60, 0.95)",borderColor:"rgba(255, 255, 255, 0.2)",transform:"scale(1.05)"},noContent:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"#666",fontSize:"14px",fontStyle:"italic",backgroundColor:"hsl(var(--foreground) / 0.02)",borderRadius:"8px"},performanceWarning:{padding:"8px 12px",backgroundColor:"rgba(255, 193, 7, 0.1)",border:"1px solid rgba(255, 193, 7, 0.3)",borderRadius:"6px",color:"#ffc107",fontSize:"12px",marginBottom:"8px",display:"flex",alignItems:"center",gap:"8px"}},sS=({content:t,title:e,language:r="json"})=>{const{t:i}=et(),[n,s]=p.useState(!1),[a,o]=p.useState(!1),[l,c]=p.useState(!1),[h,d]=p.useState(!1),u=p.useMemo(()=>(t=>{if(!t)return"";if("object"==typeof t)try{return JSON.stringify(t,null,2)}catch(e){return String(t)}if("string"==typeof t)try{const e=JSON.parse(t);return JSON.stringify(e,null,2)}catch(e){return t}return String(t)})(t),[t]),f=p.useMemo(()=>{const t=u.length;return{length:t,isLarge:t>5e4,isVeryLarge:t>1e5}},[u.length]),m=p.useMemo(()=>!f.isLarge||l?u:u.substring(0,5e3)+"\n\n// ... 内容被截断以提升性能 ...",[u,f.isLarge,l]),x=p.useMemo(()=>f.isVeryLarge&&!l?m:((t,e)=>{if("json"===e)return!0;const r=t.trim();return r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")})(m,r)?m.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,t=>{let e="#b5cea8";return/^"/.test(t)?e=/:$/.test(t)?"#9cdcfe":"#ce9178":/true|false|null/.test(t)&&(e="#569cd6"),`<span style="color: ${e}">${t}</span>`}):m,[m,r,f.isVeryLarge,l]),b=p.useCallback(async()=>{try{const e="object"==typeof t&&null!==t?JSON.stringify(t,null,2):t,r=await kt(e);if(s(!0),y.success(i("已复制到剪贴板")),setTimeout(()=>s(!1),2e3),!r)throw new Error("Copy operation failed")}catch(e){y.error(i("复制失败")),console.error("Copy failed:",e)}},[t,i]),C=p.useCallback(()=>{f.isVeryLarge&&!l?(d(!0),setTimeout(()=>{c(!0),d(!1)},100)):c(!l)},[l,f.isVeryLarge]);if(!t){const t={preview:i("正在构造请求体预览..."),request:i("暂无请求数据"),response:i("暂无响应数据")}[e]||i("暂无数据");return g.jsx("div",{style:nS.noContent,children:g.jsx("span",{children:t})})}const v=f.isLarge?"52px":"12px",S=f.isLarge?"52px":"16px";return g.jsxs("div",{style:nS.container,className:"h-full",children:[f.isLarge&&g.jsxs("div",{style:nS.performanceWarning,children:[g.jsx("span",{children:"⚡"}),g.jsx("span",{children:f.isVeryLarge?i("内容较大,已启用性能优化模式"):i("内容较大,部分功能可能受限")})]}),g.jsx("div",{style:{...nS.actionButton,...a?nS.actionButtonHover:{},top:v,right:"12px"},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:g.jsx(w,{content:i(n?"已复制":"复制代码"),children:g.jsx(k,{icon:g.jsx(Pt,{size:14}),onClick:b,size:"small",theme:"borderless",style:{backgroundColor:"transparent",border:"none",color:n?"#4ade80":"#d4d4d4",padding:"6px"}})})}),g.jsx("div",{style:{...nS.content,paddingTop:S},className:"model-settings-scroll",children:h?g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"200px",color:"#888"},children:[g.jsx("div",{style:{width:"20px",height:"20px",border:"2px s
2olid #444",borderTop:"2px solid #888",borderRadius:"50%",animation:"spin 1s linear infinite",marginRight:"8px"}}),i("正在处理大内容...")]}):g.jsx("div",{dangerouslySetInnerHTML:{__html:x}})}),f.isLarge&&!h&&g.jsx("div",{style:{...nS.actionButton,bottom:"12px",left:"50%",transform:"translateX(-50%)"},children:g.jsx(w,{content:i(l?"收起内容":"显示完整内容"),children:g.jsxs(k,{icon:l?g.jsx(Ht,{size:14}):g.jsx(ie,{size:14}),onClick:C,size:"small",theme:"borderless",style:{backgroundColor:"transparent",border:"none",color:"#d4d4d4",padding:"6px 12px"},children:[i(l?"收起":"展开"),!l&&g.jsxs("span",{style:{fontSize:"11px",opacity:.7,marginLeft:"4px"},children:["(+",Math.round((f.length-5e3)/1e3),"K)"]})]})})})]})},aS=f.memo(({message:t,className:e,styleState:r,onToggleReasoningExpansion:i,isEditing:n=!1,onEditSave:s,onEditCancel:a,editValue:o,onEditValueChange:l})=>{const{t:c}=et(),h=p.useRef(0),d=p.useRef(""),u="loading"===t.status||"incomplete"===t.status,f=void 0!==t.fullContent?t.fullContent:t.content;if(p.useEffect(()=>{u||(h.current=0,d.current="")},[u]),"error"===t.status){let t;if(Array.isArray(f)){const e=f.find(t=>"text"===t.type);t=e&&e.text&&"string"==typeof e.text?e.text:c("请求发生错误")}else t="string"==typeof f?f:c("请求发生错误");return g.jsxs("div",{className:`${e} flex items-center gap-2 p-4 rounded-xl`,style:{backgroundColor:"hsl(var(--destructive) / 0.12)",border:"1px solid hsl(var(--destructive) / 0.18)",color:"hsl(var(--destructive))"},children:[g.jsx("div",{className:"w-4 h-4 rounded-full bg-destructive flex items-center justify-center flex-shrink-0",children:g.jsx(v.Text,{className:"text-background text-xs font-bold",children:"!"})}),g.jsx(v.Text,{className:"text-sm font-medium",style:{color:"hsl(var(--destructive))"},children:t})]})}let m=null,y="",x=null;const b=t=>{if(Array.isArray(t)){const e=t.find(t=>"text"===t.type);return e&&e.text&&"string"==typeof e.text?e.text:""}return"string"==typeof t?t:""};if(y=b(f),"assistant"===t.role){let e=b(f),r="";if(t.reasoningContent&&(r=t.reasoningContent,x="reasoningContent"),e.includes("<think>")){const t=/<think>([\s\S]*?)<\/think>/g;let i,n=[],s=[],a=0;for(;null!==(i=t.exec(e));)s.push(e.substring(a,i.index)),n.push(i[1]),a=i.index+i[0].length;if(s.push(e.substring(a)),n.length>0){const t=n.join("\n\n---\n\n");r?r+="\n\n---\n\n"+t:r=t,x=x?x+" & <think> tags":"<think> tags"}e=s.join("")}if(u){const t=e.lastIndexOf("<think>");if(-1!==t){const i=e.substring(t);if(!i.includes("</think>")){const n=i.substring(7).trim();n&&(r?r+="\n\n---\n\n"+n:r=n,x=x?x+" + streaming <think>":"streaming <think>"),e=e.substring(0,t)}}}m=r||null,y=e.replace(/<\/?think>/g,"").trim()}const C=m,w=y;return"assistant"!==t.role||!u||C||w&&""!==w.trim()?g.jsxs("div",{className:e,children:["system"===t.role&&g.jsx("div",{className:"mb-2 sm:mb-4",children:g.jsxs("div",{className:"flex items-center gap-2 p-2 sm:p-3 bg-warning-light-default rounded-lg",style:{border:"1px solid hsl(var(--border))"},children:[g.jsx("div",{className:"w-4 h-4 sm:w-5 sm:h-5 rounded-full bg-warning flex items-center justify-center shadow-sm",children:g.jsx(v.Text,{className:"text-background text-xs font-bold",children:"S"})}),g.jsx(v.Text,{className:"text-warning text-xs sm:text-sm font-medium",children:c("系统消息")})]})}),"assistant"===t.role&&g.jsx(Gv,{message:t,finalExtractedThinkingContent:C,thinkingSource:x,styleState:r,onToggleReasoningExpansion:i}),n?g.jsxs("div",{className:"space-y-3",children:[g.jsx(S,{value:o,onChange:t=>l(t),placeholder:c("请输入消息内容..."),autosize:{minRows:3,maxRows:12},style:{resize:"vertical",fontSize:r.isMobile?"14px":"15px",lineHeight:"1.6"},className:"!border-border focus:!border-primary !bg-primary/10"}),g.jsxs("div",{className:"flex items-center gap-2 w-full",children:[g.jsx(k,{size:"small",type:"danger",theme:"light",icon:g.jsx(Yt,{size:14}),onClick:a,className:"flex-1",children:c("取消")}),g.jsx(k,{size:"small",type:"warning",theme:"solid",icon:g.jsx(Ut,{size:14}),onClick:s,disabled:!o||""===o.trim(),className:"flex-1",children:c("保存")})]})]}):(()=>
2{if(Array.isArray(f)){const e=f.find(t=>"text"===t.type),r=f.filter(t=>"image_url"===t.type);return g.jsxs("div",{children:[r.length>0&&g.jsx("div",{className:"mb-3 space-y-2",children:r.map((t,e)=>g.jsxs("div",{className:"max-w-sm",children:[g.jsx("img",{src:t.image_url.url,alt:`用户上传的图片 ${e+1}`,className:"rounded-lg max-w-full h-auto shadow-sm border",style:{maxHeight:"300px"},onError:t=>{t.target.style.display="none",t.target.nextSibling.style.display="block"}}),g.jsxs("div",{className:"text-sm p-2 rounded-lg",style:{display:"none",backgroundColor:"hsl(var(--destructive) / 0.12)",border:"1px solid hsl(var(--destructive) / 0.18)",color:"hsl(var(--destructive))"},children:["图片加载失败: ",t.image_url.url]})]},e))}),e&&e.text&&"string"==typeof e.text&&""!==e.text.trim()&&g.jsx("div",{className:"prose prose-xs sm:prose-sm prose-gray max-w-none overflow-x-auto text-xs sm:text-sm "+("user"===t.role?"user-message":""),children:g.jsx(Uv,{content:e.text,className:"user"===t.role?"user-message":"",animated:!1,previousContentLength:0})})]})}if("string"==typeof f){if("assistant"!==t.role)return g.jsx("div",{className:"prose prose-xs sm:prose-sm prose-gray max-w-none overflow-x-auto text-xs sm:text-sm "+("user"===t.role?"user-message":""),children:g.jsx(Uv,{content:f,className:"user"===t.role?"user-message":"",animated:!1,previousContentLength:0})});if(w&&""!==w.trim()){let t=0;return u&&d.current&&w.startsWith(d.current)&&(t=d.current.length),u&&(d.current=w),g.jsx("div",{className:"prose prose-xs sm:prose-sm prose-gray max-w-none overflow-x-auto text-xs sm:text-sm",children:g.jsx(Uv,{content:w,className:"",animated:u,previousContentLength:t})})}}return null})()]}):g.jsx("div",{className:`${e} flex items-center gap-2 sm:gap-4 bg-fill-subtle`,children:g.jsx("div",{className:"w-5 h-5 rounded-full bg-primary flex items-center justify-center shadow-lg",children:g.jsx(Wt,{className:"animate-spin text-background",size:r.isMobile?16:20})})})},(t,e)=>t.message.id===e.message.id&&t.message.content===e.message.content&&t.message.status===e.message.status&&t.message.role===e.message.role&&t.message.reasoningContent===e.message.reasoningContent&&t.message.isReasoningExpanded===e.message.isReasoningExpanded&&t.isEditing===e.isEditing&&t.editValue===e.editValue&&t.styleState.isMobile===e.styleState.isMobile),oS=f.memo(({message:t,styleState:e,onMessageReset:r,onMessageCopy:i,onMessageDelete:n,onRoleToggle:s,onMessageEdit:a,isAnyMessageGenerating:o=!1,isEditing:l=!1})=>{const{t:c}=et(),h="loading"===t.status||"incomplete"===t.status,d=o||l,u="assistant"===t.role||"system"===t.role,p=!h&&t.content&&"function"==typeof a&&!l;return g.jsxs("div",{className:"flex items-center gap-0.5",children:[!h&&g.jsx(w,{content:c(d?"操作暂时被禁用":"重试"),position:"top",children:g.jsx(k,{theme:"borderless",type:"tertiary",size:"small",icon:g.jsx(Gt,{size:e.isMobile?12:14}),onClick:()=>!d&&r(t),disabled:d,className:`!rounded-full ${d?"!text-gray-300 !cursor-not-allowed":"!text-gray-400 hover:!text-blue-600 hover:!bg-blue-50"} ${e.isMobile?"!w-6 !h-6":"!w-7 !h-7"} !p-0 transition-all`,"aria-label":c("重试")})}),t.content&&g.jsx(w,{content:c("复制"),position:"top",children:g.jsx(k,{theme:"borderless",type:"tertiary",size:"small",icon:g.jsx(Pt,{size:e.isMobile?12:14}),onClick:()=>i(t),className:`!rounded-full !text-gray-400 hover:!text-green-600 hover:!bg-green-50 ${e.isMobile?"!w-6 !h-6":"!w-7 !h-7"} !p-0 transition-all`,"aria-label":c("复制")})}),p&&g.jsx(w,{content:c(d?"操作暂时被禁用":"编辑"),position:"top",children:g.jsx(k,{theme:"borderless",type:"tertiary",size:"small",icon:g.jsx(Jt,{size:e.isMobile?12:14}),onClick:()=>!d&&a(t),disabled:d,className:`!rounded-full ${d?"!text-gray-300 !cursor-not-allowed":"!text-gray-400 hover:!text-yellow-600 hover:!bg-yellow-50"} ${e.isMobile?"!w-6 !h-6":"!w-7 !h-7"} !p-0 transition-all`,"aria-label":c("编辑")})}),u&&!h&&g.jsx(w,{content:d?c("操作暂时被禁用"):"assistant"===t.role?c("切换为System角色"):c("切换为Assistant角色"),position:"top",children:g.jsx(k,{theme:"borderless",type:"tertiary",size:"small",icon:g.jsx(Xt,{size:e.isMobile?12:14}),onClick:()=>!d&&s&&s(t),disabled:d,className:`!rounded-full ${d?"!text-gray-300 !cursor-not-allowed":"system"===t.role?"!text-purple-500 hover:!text-purple-700 hover:!bg-purple-50":"!text-gray-400 hover:!text-purple-600 hover:!bg-purple-50"}
2 ${e.isMobile?"!w-6 !h-6":"!w-7 !h-7"} !p-0 transition-all`,"aria-label":"assistant"===t.role?c("切换为System角色"):c("切换为Assistant角色")})}),!h&&g.jsx(w,{content:c(d?"操作暂时被禁用":"删除"),position:"top",children:g.jsx(k,{theme:"borderless",type:"tertiary",size:"small",icon:g.jsx(Kt,{size:e.isMobile?12:14}),onClick:()=>!d&&n(t),disabled:d,className:`!rounded-full ${d?"!text-gray-300 !cursor-not-allowed":"!text-gray-400 hover:!text-red-600 hover:!bg-red-50"} ${e.isMobile?"!w-6 !h-6":"!w-7 !h-7"} !p-0 transition-all`,"aria-label":c("删除")})})]})},(t,e)=>t.message.id===e.message.id&&t.message.role===e.message.role&&t.isAnyMessageGenerating===e.isAnyMessageGenerating&&t.isEditing===e.isEditing&&t.onMessageReset===e.onMessageReset),lS=f.memo(({styleState:t,onCloseSettings:e,messages:r,currentSessionId:i,sessions:n=[],onSessionChange:s=()=>{},onNewSession:a=()=>{},onClearHistory:o=()=>{},onDeleteSession:l=()=>{},onRenameSession:c=()=>{},onAction:h,onNewConversation:d,sidebarCollapsed:u=!1,onToggleCollapse:f,onModelTypeClick:m=()=>{},selectedModelType:y="chat"})=>{const{t:x}=et(),b="playground_sessions",C="playground_currentSessionId",[v,S]=p.useState([]),[_,T]=p.useState(null),A=!n||0===n.length,B=p.useCallback(()=>{if(A)try{const t=localStorage.getItem(b)||"[]",e=JSON.parse(t);let r=Array.isArray(e)?e:[];r.length>rS&&(r=[...r].sort((t,e)=>e.createTime-t.createTime).slice(0,rS)),S(r);const i=localStorage.getItem(C);T(i||r[0]?.id||null)}catch{S([]),T(null)}},[A,b,C]);p.useEffect(()=>{B()},[B]),p.useEffect(()=>{if(!A)return;const t=()=>{B()};return window.addEventListener("playground_sessions_updated",t),()=>window.removeEventListener("playground_sessions_updated",t)},[A,B]),p.useEffect(()=>{if(!A)return;const t=t=>{const e=t?.detail?.messages||[],r=ot(e.find?.(t=>"user"===t.role))||x("新对话"),i=String(r).slice(0,20);if(_&&0!==v.length){const t=v.map(t=>t.id===_?{...t,messages:e,title:i}:t);S(t),E(t,_)}else{const t=M(),r={id:t,title:i,createTime:Date.now(),messages:e};let n=[...v,r];n.length>rS&&(n=[...n].sort((t,e)=>e.createTime-t.createTime).slice(0,rS)),S(n),T(t),E(n,t)}};return window.addEventListener("playground_after_send",t),()=>window.removeEventListener("playground_after_send",t)},[A,v,_,x]);const M=()=>"s-"+Date.now(),E=(t,e)=>{try{localStorage.setItem(b,JSON.stringify(t)),void 0!==e&&(e?localStorage.setItem(C,e):localStorage.removeItem(C));try{window.dispatchEvent(new Event("playground_sessions_updated"))}catch{}}catch{}},L=p.useCallback(()=>{const t=M(),e=ot(r?.find?.(t=>"user"===t.role))||x("新对话"),i=String(e).slice(0,20),n=v.map(t=>t.id===_?{...t,messages:r||t.messages,title:i}:t);let s=[{id:t,title:x("新对话"),createTime:Date.now(),messages:[]},...n];s.length>rS&&(s=[...s].sort((t,e)=>e.createTime-t.createTime).slice(0,rS)),S(s),T(t),E(s,t);try{window.dispatchEvent(new Event("playground_restart_chat"))}catch{}},[v,_,r,x]),j=p.useCallback(t=>{const e=ot(r?.find?.(t=>"user"===t.role))||x("新对话"),i=String(e).slice(0,20),n=v.map(t=>t.id===_?{...t,messages:r||t.messages,title:i}:t);S(n),T(t),E(n,t);const s=n.find(e=>e.id===t)||{messages:[]};try{window.dispatchEvent(new CustomEvent("playground_load_session",{detail:{messages:s.messages||[]}}))}catch{}},[v,_,r,x]),F=p.useCallback(()=>{S([]),T(null),E([],null);try{window.dispatchEvent(new Event("playground_restart_chat"))}catch{}},[]),N=p.useCallback(t=>{const e=v.filter(e=>e.id!==t);let r=_;if(r===t&&(r=e.length?e[e.length-1].id:null),S(e),T(r),E(e,r),r){const t=e.find(t=>t.id===r)||{messages:[]};try{window.dispatchEvent(new CustomEvent("playground_load_session",{detail:{messages:t.messages||[]}}))}catch{}}else try{window.dispatchEvent(new Event("playground_restart_chat"))}catch{}},[v,_]),I=p.useCallback((t,e)=>{const r=v.map(r=>r.id===t?{...r,title:e}:r);S(r),E(r,_)},[v,_]),O=p.useCallback(()=>{"function"==typeof a?a():"function"==typeof d&&d()},[a,d]),D=t=>(...e)=>{"function"==typeof t&&(h?h(()=>t(...e)):t(...e))};return u&&!t.isMobile?g.jsx("div",{className:"sidebar-collapsed-content",style:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",paddingTop:"20px",gap:"12px",background:"transparent"},children:g.jsx(w,{content:x("展开侧边栏"),position:"right",children:g.jsx(k,{className:"collapse-toggle-button",onClick:f,style:{width:"32px",height:"32px",borderRadius:"50%",padding:0,display:"flex",alignItems:"center",justifyContent:"center",background:"linear-gradient(135deg, #46ACFF 0%, #0084FF 100%)",border:"none",color:"white",fontSize:"14px",fontWeight:"bold",boxShadow:"0 2px 8px rgba(70, 172, 255, 0.3)",cursor:"pointer",transition:"all 0.2s ease"},children:"▶"})})}):g.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",background:t.isMobile?"#ffffff"
2:"transparent",padding:t.isMobile?"0px 20px":"0"},children:[t.isMobile&&g.jsx("div",{className:"mobile-tabbar-overlay-right !bg-transparent",style:{flexShrink:0},children:g.jsx(k,{className:"mobile-close-btn",size:"small",theme:"light",type:"tertiary",icon:g.jsx(Yt,{size:16}),onClick:e})}),g.jsxs("div",{className:"sidebar-header-title",style:{padding:t.isMobile?"12px 0 16px 0":"16px 16px 16px 16px",flexShrink:0,display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[g.jsx(Zt,{size:20,style:{color:"hsl(var(--muted-foreground))"}}),g.jsx(eS,{style:{fontSize:"18px",fontWeight:600,color:"hsl(var(--foreground))"},children:x("体验中心")})]}),!t.isMobile&&g.jsx(w,{content:x("折叠侧边栏"),position:"bottom",children:g.jsx(k,{className:"collapse-toggle-button",onClick:f,style:{width:"32px",height:"32px",borderRadius:"50%",padding:0,display:"flex",alignItems:"center",justifyContent:"center",background:"linear-gradient(135deg, #46ACFF 0%, #0084FF 100%)",border:"none",color:"white",fontSize:"14px",fontWeight:"bold",boxShadow:"0 2px 8px rgba(70, 172, 255, 0.3)",cursor:"pointer",transition:"all 0.2s ease",flexShrink:0},children:"◀"})})]}),g.jsx("div",{className:"model-type-nav",style:{padding:t.isMobile?"0 0 12px 0":"0 16px 12px 16px",flexShrink:0},children:iS.map(t=>{const e=y===t.id,r=t.icon;return g.jsxs("div",{className:"model-type-item "+(e?"active":""),onClick:()=>(t=>{"function"==typeof m&&m(t)})(t),style:{display:"flex",alignItems:"center",padding:"10px 12px",marginBottom:"6px",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s ease",background:e?"linear-gradient(135deg, rgba(70, 172, 255, 0.1) 0%, rgba(0, 132, 255, 0.1) 100%)":"transparent",border:e?"1px solid rgba(0, 132, 255, 0.3)":"1px solid transparent"},children:[g.jsx(r,{size:20,style:{marginRight:"12px",color:e?"#0084FF":"hsl(var(--muted-foreground))",transition:"color 0.2s ease",strokeWidth:e?2.5:2,flexShrink:0}}),g.jsx(eS,{style:{fontSize:"14px",fontWeight:e?600:500,color:e?"#0084FF":"hsl(var(--foreground) / 0.80)"},children:x(t.label)})]},t.id)})}),g.jsxs("div",{style:{padding:t.isMobile?"8px 0 12px 0":"8px 16px 12px 16px",flexShrink:0},children:[g.jsx(eS,{style:{fontSize:"14px",fontWeight:600,color:"hsl(var(--muted-foreground))",textTransform:"uppercase",letterSpacing:"0.5px"},children:x("最近对话")}),g.jsx(eS,{type:"tertiary",size:"small",style:{marginLeft:"8px"},children:(A?v:n).length})]}),g.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto",padding:"0 16px"},children:g.jsx(tS,{currentSessionId:A?_:i,sessions:A?v:n,styleState:t,onSessionChange:D(A?j:s),onNewSession:D(A?L:O),onClearHistory:D(A?F:o),onDeleteSession:D(A?N:l),onRenameSession:D(A?I:c)})})]})},(t,e)=>JSON.stringify(t.inputs)===JSON.stringify(e.inputs)&&JSON.stringify(t.parameterEnabled)===JSON.stringify(e.parameterEnabled)&&JSON.stringify(t.models)===JSON.stringify(e.models)&&JSON.stringify(t.groups)===JSON.stringify(e.groups)&&t.customRequestMode===e.customRequestMode&&t.customRequestBody===e.customRequestBody&&t.showDebugPanel===e.showDebugPanel&&t.showSettings===e.showSettings&&JSON.stringify(t.previewPayload)===JSON.stringify(e.previewPayload)&&JSON.stringify(t.messages)===JSON.stringify(e.messages)&&t.sidebarCollapsed===e.sidebarCollapsed&&t.onToggleCollapse===e.onToggleCollapse&&t.selectedModelType===e.selectedModelType),cS=f.memo(({debugData:t,activeDebugTab:e,onActiveDebugTabChange:r,styleState:i,onCloseDebugPanel:n,customRequestMode:s})=>{const{t:a}=et(),[o,l]=p.useState(e);p.useEffect(()=>{l(e)},[e]);const c=t=>{l(t),r(t)};return g.jsxs(L,{className:"h-full flex flex-col",bordered:!1,bodyStyle:{padding:i.isMobile?"16px":"24px",height:"100%",display:"flex",flexDirection:"column"},children:[g.jsxs("div",{className:"flex items-center justify-between mb-6 flex-shrink-0",children:[g.jsxs("div",{className:"flex items-center",children:[g.jsx("div",{className:"w-10 h-10 rounded-full bg-success flex items-center justify-center mr-3",children:g.jsx(ne,{size:20,className:"text-background"})}),g.jsx(v.Title,{heading:5,className:"mb-0",children:a("调试信息")})]}),i.isMobile&&n&&g.jsx(k,{icon:g.jsx(Yt,{size:16}),onClick:n,theme:"borderless",type:"tertiary",size:"small",className:"!rounded-lg"})]}
2),g.jsx("div",{className:"flex-1 overflow-hidden debug-panel",children:g.jsxs(F,{renderArrow:(t,e,r,i)=>{const n={width:32,height:32,margin:"0 12px",display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",background:"hsl(var(--foreground))",color:"hsl(var(--foreground))",cursor:"pointer"};return g.jsx(I,{render:g.jsx(I.Menu,{children:t.map(t=>g.jsx(I.Item,{onClick:()=>c(t.itemKey),children:t.tab},t.itemKey))}),children:"start"===e?g.jsx("div",{style:n,onClick:r,children:"←"}):g.jsx("div",{style:n,onClick:r,children:"→"})})},type:"card",collapsible:!0,className:"h-full",style:{height:"100%",display:"flex",flexDirection:"column"},activeKey:o,onChange:c,children:[g.jsx(N,{tab:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(se,{size:16}),a("预览请求体"),s&&g.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-orange-100 text-orange-600 rounded-full",children:"自定义"})]}),itemKey:"preview",children:g.jsx(sS,{content:t.previewRequest,title:"preview",language:"json"})}),g.jsx(N,{tab:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ae,{size:16}),a("实际请求体")]}),itemKey:"request",children:g.jsx(sS,{content:t.request,title:"request",language:"json"})}),g.jsx(N,{tab:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(oe,{size:16}),a("响应")]}),itemKey:"response",children:g.jsx(sS,{content:t.response,title:"response",language:"json"})})]})}),g.jsx("div",{className:"flex items-center justify-between mt-4 pt-4 flex-shrink-0",children:(t.timestamp||t.previewTimestamp)&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(le,{size:14,className:"text-muted-foreground"}),g.jsx(v.Text,{className:"text-xs text-muted-foreground",children:"preview"===o&&t.previewTimestamp?`${a("预览更新")}: ${new Date(t.previewTimestamp).toLocaleString()}`:t.timestamp?`${a("最后请求")}: ${new Date(t.timestamp).toLocaleString()}`:""})]})})]})},(t,e)=>t.show===e.show&&t.activeTab===e.activeTab&&JSON.stringify(t.debugData)===JSON.stringify(e.debugData)&&JSON.stringify(t.previewPayload)===JSON.stringify(e.previewPayload)&&t.customRequestMode===e.customRequestMode&&t.showDebugPanel===e.showDebugPanel),hS="/assets/img/send-laQBGs4T.png",dS="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAD/klEQVR4AYRVS4gcZRD+qrd7MgHd9EWID3CCQog6PTkI7qKLET1ESBBBbwoRI3oyvRrIgiPbkhWyoG5v8CAYMKA3hQjmsAeFiAH34MHpUVlByBx8LHjprB4m/apU9WNmdjabKf6a+uv7q76q/9G7BiaJx+bhlfhxx49edVbid5zVeLHlR687Pj/W8Lg+KX3XAo+c5weclehTx47/zYivCtEFEC+B2WPgEyBen7bjf5p+tHLoY75f1m85dhaQjlt+/DZl8S8gnJQsW3S3YRPgmkm84cjuILnjgcYo0PCu1R07usTgDyRxZPvck66/YNCSqqxdBLhX5Ypf1905dvLN+LENC0j1afueSwAdw1DW2aAjgbvnQNetvdx1rXdVO27tlUAwED0Dxk/DcD46bSdfQrgqbFDA2ZecAegoSmHpNgitue6b1vcltMMEp6zvguvWrMYOF/lYy05OVX5eQC+JidsVqAld6RYeJZgkEqOxmlOFZuClhz/qP6h+XkAuyc3PURHZcjc039PpJNXGmn58Rl9cmbOuOco1RYacCGDoxRJwApUYtADpChPE8fmgmUTrBD5HabQGyZH7WkAlhBf0LozpO+89LFj5FLmn5yr+bYeSM6IrBNqvgUQw1Rb3xdXrsh+6oz9j8BRauqgqCVfUqo5uX/1Kx8kZvMkJnq3WGaQfZe6a5tRBg6joQpEM9KdaVSvRDmX7WXRVSRVTO9q5kiPBU93TezZ0vVCqdgAw7TeQSUixsu2XucBJjkFJm6vJc2rV10CWziVijFxXRtSAacgXuImBcGMwTXE8JxFASYmzr9WKixzf0bmuqPJ9+qvKzJtGkqS/q6MqL+IJtar5toUkJ1Og1NwXPF8vsVEjHEcqn9KkY/z2f13fbliA1Giej58s5kBOImQ5qYC5FT/HxR8fzmr8NEDVKYRb/+392YC8X9nzVyiFMj6Hkb8lSpZlPEeghZizWfXL0O1Gclhzh+jFnkd9Q/2Us2UG+joXnWna0aLYwfj1rfofHdda3pjf2xuAY5OmnSwS4VGFlSvidFXneQElMEBtBVSl23bTv3EWHucfkGK7qsQ0/fisnP0wn2mpasaoEjuhKRX5cuXnRfbFPxbnWqHbrd6XY8c/jJIDtBZcN5dRyqAA5C62wr9fBHgNpeRbZv7W8W9ca/nRZ9ppodHnjmByX/rlz5ThYujyVmg+D+FCKcMCAvS8A/0grB0HU1vPUaByUEP8EwRuF4qXMHwtkLW+7Ph0IOQ9j6q7hMq2AgpAqgfz1vsxp4cA+ABC7C6hsF/IsqzZca0PIbkYk50FygC9pMCtzW+Ff92NFLMEvCH/Ij3I7iTkJCXpXBBadwXztdf0kQh2y3ETAAD//4hh+nUAAAAGSURBVAMAPXvYzDe0DS8AAAAASUVORK5CYII=",uS=(t,e)=>({width:e?Math.min(t,140):t,flexShrink:0,background:"hsl(var(--card))",border:"1px solid hsl(var(--primary) / 0.2)",borderRadius:"10px",boxShadow:"0 2px 8px hsl(var(--primary) / 0.08)"}),pS=(t,e)=>{const r=t?.label||t?.value||t;return g.jsx("div",{className:"flex items-center gap-1.5 min-w-0 w-full overflow-hidden",children:g.jsx("span",{className:"truncate",style:{fontSize:e?13:14,fontWeight:500,background:"linear-gradient(135deg, hsl(var(--primary) / 0.7) 0%, hsl(var(--primary)) 100%)",WebkitBackgroun
2dClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:r})})},gS=p.memo(function({renderProps:t,isFavorite:e,onToggleFavorite:r}){const{disabled:i,selected:n,label:s,value:a,focused:o,className:l,style:c,onMouseEnter:h,onClick:d}=t,u=a??s,p=["semi-select-option",l,o?"semi-select-option-focused":"",n?"semi-select-option-selected":"",i?"semi-select-option-disabled":""].filter(Boolean).join(" ");return g.jsx("div",{style:{...c,padding:"8px 12px"},className:p,onMouseEnter:h,onClick:d,children:g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:8,minWidth:0},children:[g.jsx("span",{className:"truncate",style:{flex:1,minWidth:0,fontSize:14,fontWeight:500,background:"linear-gradient(135deg, hsl(var(--primary) / 0.7) 0%, hsl(var(--primary)) 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:u}),g.jsx("button",{type:"button",className:"playground-model-favorite-btn","aria-pressed":e,onMouseDown:t=>{t.preventDefault(),t.stopPropagation()},onClick:t=>{t.preventDefault(),t.stopPropagation(),i||r(u)},children:g.jsx(ce,{size:16,strokeWidth:2,fill:e?"currentColor":"none",className:e?"playground-model-favorite-star--active":"playground-model-favorite-star"})})]})})}),fS=p.memo(function({groups:t=[],models:e=[],selectedGroup:r,selectedModel:i,onGroupChange:n,onModelChange:s,isMobile:a=!1}){const{t:o}=et(),{favoriteSet:l,toggleFavoriteModel:c}=$v(),h=a?140:180,d=p.useRef(l);d.current=l;const u=p.useRef(c);u.current=c;const f=p.useMemo(()=>{const t=new Set;for(let r=0;r<e.length;r+=1){const i=e[r]?.value??e[r]?.label;i&&t.add(i)}return t},[e]),{favoriteModels:m}=$v(),y=p.useMemo(()=>{const t=[];for(let e=0;e<m.length;e+=1){const r=m[e];r&&f.has(r)&&t.push(r)}return t},[m,f]),x=p.useMemo(()=>y.map(t=>({label:t,value:t,key:t})),[y]),b=y.includes(i)?i:void 0,C=p.useCallback(t=>{const e=t.value??t.label,r=d.current.has(e);return g.jsx(gS,{renderProps:t,isFavorite:r,onToggleFavorite:t=>u.current?.(t)})},[]);return 0===e.length?null:g.jsxs("div",{className:"flex items-center gap-3 p-3 pb-2 flex-wrap min-w-0",children:[t.length>0&&g.jsx(O,{placeholder:o("选择分组"),value:r,onChange:n,optionList:t,renderOptionItem:St,size:"default",style:{width:a?"110px":"140px",flexShrink:0,background:"hsl(var(--card))",border:"1px solid hsl(var(--primary) / 0.2)",borderRadius:"10px",boxShadow:"0 2px 8px hsl(var(--primary) / 0.08)"},className:"selector-gradient",dropdownClassName:"selector-dropdown",renderSelectedItem:e=>{const r=e?.value??e,i=Array.isArray(t)?t.find(t=>t.value===r):null,n=i?.ratio,s="string"==typeof r?r:e?.label||"";return g.jsxs("div",{className:"flex items-center gap-1.5",style:{fontSize:a?"13px":"14px",fontWeight:500},children:[g.jsx("img",{src:dS,alt:"check",className:"w-3.5 h-3.5"}),g.jsx("span",{className:"truncate",style:{background:"linear-gradient(135deg, hsl(var(--primary) / 0.7) 0%, hsl(var(--primary)) 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:s}),void 0!==n&&g.jsxs("span",{className:"text-success text-xs font-semibold px-1.5 py-0.5 bg-success/10 rounded",children:[n,o("倍")]})]})}}),g.jsx(O,{placeholder:o("选择模型"),value:i,onChange:s,optionList:e,filter:!0,size:"default",style:uS(h,a),className:"selector-gradient",dropdownClassName:"selector-dropdown",renderSelectedItem:t=>pS(t,a),renderOptionItem:C}),g.jsx(v.Text,{type:"secondary",style:{fontSize:a?12:13,fontWeight:500,flexShrink:0,whiteSpace:"nowrap",color:"hsl(var(--muted-foreground))"},children:o("常用模型")}),g.jsx(O,{placeholder:y.length>0?o("选择常用模型"):o("当前无收藏模型"),value:y.length>0?b:void 0,onChange:s,optionList:x,disabled:0===y.length,filter:y.length>0,size:"default",style:uS(h,a),className:"selector-gradient",dropdownClassName:"selector-dropdown",renderSelectedItem:t=>pS(t,a)})]})}),mS=t=>{const{t:e}=et(),{detailProps:r={},onImageUpload:i,onImageRemove:n,clearImages:s,groups:a=[],models:o=[],selectedGroup:l,selectedModel:c,onGroupChange:h,onModelChange:d}=t||{},{clearContextNode:u,uploadNode:m,inputNode:x,sendNode:b,onClick:C}=r||{},w=_t(),[S,_]=p.useState(!1),[T,A]=p.useState(0),[B,M]=p.useState(!1),[E,L]=p.useState([]),j=p.useRef(null),F=p.useRef(null),N=p.useRef(0),I=p.useCallback((t,r)=>{L(e=>e.filter(e=>e.id!==t)),n&&r&&n(r),y.info(e("已删除图片"))},[e,n]),O=p.useCallback(t=>
2["image/jpeg","image/jpg","image/png","image/gif","image/webp"].includes(t.type)?!(t.size>52428800&&(y.error(e("图片大小不能超过 50MB")),1)):(y.error(e("仅支持 JPG、PNG、GIF、WebP 格式的图片")),!1),[e]),R=p.useCallback(async t=>{const r=Array.from(t).filter(O);if(0!==r.length){_(!0),A(0);try{const t=r.length,s=[];for(let i=0;i<r.length;i++){const a=r[i];A((i+1)/t*100);try{let t=a;a.size>1048576&&(t=await Mv(a,.8,1920,1080));const r=new FormData;r.append("file",t);const i=await fetch(Tt,{method:"POST",body:r});if(!i.ok)throw new Error(e("上传失败: HTTP {{status}}",{status:i.status}));const n=await i.json();if(!n.url)throw new Error(e("上传失败:未返回图片URL"));const o=n.url,l=Bv();s.push({id:l,name:a.name,url:o,type:a.type,size:a.size})}catch(n){y.error(e("处理图片 {{name}} 失败: {{message}}",{name:a.name,message:n.message}))}}s.length>0&&(L(t=>[...t,...s]),i&&i(s),y.success(e("成功上传 {{count}} 张图片",{count:s.length})))}catch(n){y.error(e("上传图片失败"))}finally{_(!1),A(0)}}},[i,e,O]),z=p.useCallback(t=>{const e=t.clipboardData||window.clipboardData;if(!e)return;const r=e.items;if(!r)return;const i=[];for(let n=0;n<r.length;n++){const t=r[n];-1!==t.type.indexOf("image")&&i.push(t)}if(i.length>0){t.preventDefault();const e=i.map(t=>t.getAsFile()).filter(Boolean);e.length>0&&R(e)}},[R]);p.useEffect(()=>{const t=F.current;if(t)return t.addEventListener("paste",z),()=>{t.removeEventListener("paste",z)}},[z]),p.useEffect(()=>{const t=()=>{L([])};return window.addEventListener("playground_after_send",t),()=>{window.removeEventListener("playground_after_send",t)}},[]);const $=p.useCallback(t=>{t.preventDefault(),t.stopPropagation(),N.current++,t.dataTransfer.items&&t.dataTransfer.items.length>0&&M(!0)},[]),P=p.useCallback(t=>{t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect="copy"},[]),q=p.useCallback(t=>{t.preventDefault(),t.stopPropagation(),N.current--,0===N.current&&M(!1)},[]),W=p.useCallback(t=>{t.preventDefault(),t.stopPropagation(),M(!1),N.current=0;const r=t.dataTransfer.files;if(r&&r.length>0){const t=Array.from(r).filter(t=>t.type.startsWith("image/"));t.length>0?R(t):y.warning(e("请拖拽图片文件"))}},[R,e]),H=g.jsx(k,{icon:g.jsx("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAALkUlEQVR4AeyaC3BV1RWG/3VJMCgotli06siI9UkLPpAqKDDVOrTjhDuW1pZHg0qVooIN0SI4xLGUOjHjg1KsiLzptMDcZGyLDnQClliQgsm0InWghim2UKwgBBNMclf/te+DJOQC955zGIVzZq+z9157r7X3/s46557HjSDcPBEIAXrCB4QAQ4AeCXg0DyMwBOiRgEfzMAJDgB4JeDQPIzAE6JGAR/MwAkOAHgl4ND8dI9AjsrbmIcC2PLKuhQCzRtbWIATYlkfWtRBg1sjaGoQA2/LIunbqASzVrmeX66xuZVoGlrMmkqXBKQXwPALr3g2ryGACZfKZXVimjuXA0kkBOPR3ev2ty7R44G901s1Ldf5NS3T5jYs1dsMijV1PuW6BxvrN11hfylfnaezqlzV21Usau4Jy2a811vtFLTtvtnY9FgWD13w2/gjBQChEhfsIBnYJGGKgAIeu0AFDf6tvxxWbuKAyUTxICEUK3CWCQgEKoShkWyH1w6kvNHFlwXDTWz9CKT47gpnUd5gMnp6DVfR3C/0J+6vlYr0JtKALwQYUiYEBvG2F3iVxVHENfUEqzC1ZSblAIO6ixHRO1O25c6umhUWQKU2ojgsamR2VDB66YxV9DqSoE9sDdMIdkwKD8s9gnwAgBgLwm4w8zn4xWXTh5LkEkBbqVbERQCV1lYyuCvapNGFkVlJfwf6VBGvlSsKvtLr1pW52fQueZJ82yU5rOZfRxShzDexMf1ZU2AHgQXJ1NRUG5gUAMRCAnPSLnHIB501OaGb+ROQ9fKF6pNz05kiJbqS8NVqifx0j0c1FEt1CqR0rUZO/3yfRrZR3fyTRf1C23y/RHePlob0TpJ4+08ngdWpG4rSllmOAg1WzuIbikgjWUG86V+cBHCidCdzHSPQdoIs+oB8Azh/CST/5xt0yY22pNCPn7WjD/DimIxF5dr3jQKje9zGGEdgh9rb4A8v1jQ0Yxn7rqWPGpBiEPGS8nlq/bMR3gKQ2iJHAuYPssB8NKEcQm6KAOFKeqz8kPJQySm1khw+JjbrDDfgWK9VsYmIJ6PB66lqy3PkOkIf9Ml673DRIcNvasdLhZPvN1179F2nxdQt1cb8FurjvAi3uM1d7OsMT2DV1whReG8s53mzsxzAQFJIbx7VSahoA25oOYxgV5WybjWYcdT1Fjpv/AIGC5FwkItibLLfJBizWiZ3zsJXhYLc2o9g4kiDKIp3wfp95Wsz6cZNdE3dPlJI9k3h9JKDWBgTVupoos0/z41KCafIQWIZPm+8AeYTtx8OmZ9emFiu0lpuXEJDgWeoKoLx0pU43KxO+AmVXvawT2Z5zog+ztfEtD1R8BwhBQToC0oXEGvrP1/PZ/lSi5vZN3P+Jso76xLrVlWZeOUd7Ue8ttRvfm7OOrf0HGAcDKyHth8zPx0hllJmeOeKCO7f8UG6vKZKhNBpGaTF8woPAX8q7rN9nXfwHmPTIm2OmdssX9G2lWbdljLyeqtfe48prra4KMoTdCiHbjXcAu1I2DMDtqXJQeXK5PrpnBJKccCFM7fwSTFojOPq+UBh31oHXRbqxUtZy4CCmQN2t0+xDn8C3X9tME/EfID1qcjRGUrKUzmq4OAYG+OuBwTcu0juQ3Pq+4sqDXVVhEVjjytnu+At7sERK6kv8/bXNNA0uN1NTbvr4MUIn3oSVEN5a07UCeXxL89q1C7SK94GrWX+V6lRqPAwsSVU+y3kksMkpUbVzvmGs1BHwlNZqhuMQRuVt1OUzZxXMMO39cbKHumOnUs2DybF7BdrqO8C0QyE
2Hk3bT3zhanqeqhNKo3BGzpgVoEMUj28bJMR//vvSc9rxgli7reS4OnHcuPunxrK7u8ZxeYe5OtqTX69fAyTNYkcLSgeONowioGZcS3GRiXsouS/n6qqTpU1zNtzEGmKqO08UvaO+8TvgLW++mvd2M5zP/hrag5pxyPem3Pr4D5MIsCRdlCK3coWwaK7s3j5FyvsoaXVMko2vvlfJt46Wuw85J5UW/1AH8af+zCI7cZCejXCM4Q4AV5zyjM0/mae07wEjKo+FT+Lb1mqN3dIpgNSI4n1FLVnSt+APLz7cb5qfdzsKr3Uq1B3sEnlLL9W+gxDmsyQhUPxxfOoenpiKmisSHJYs6xbw9+xDdO0ke4SAjCPKwjckIVeZ3xM/Epq6/0Gv8GP9YPvwHyNGU4pJyKa6Q+673HC1WYDk9dGnlbcZ/HpZxKE28pP1okqwEcAMh7qTwdwggyEtaBJs6zyR8NgaV/AdIjzy/BPFWy81x9l95SZ+ilzKKeSBHWLHkgwflCbTbPvqJvNOi6A/Fa9ZEisLOBbxeruj8c/oxZQDC5frsNe6OvjIC3IJz8s57u8vn6lzCmObs1R5c0EgYI/41QTLe4hycLB8eOIQ7FXiakn6dxblMzZup050vn3f+A7QJcvYCHn9kv/Uq1YIrL0SMEXwf6Mc80Fc94UV3jhc7VU2VWXhaH5osU2g6gpJ+G65xTEOpXpbZMLeWYAByxZw8U3aTunq2dj3rIqyi1bf5a6uMHBaxOx7BbXXj5XWrnKg0PCorCf129rd3jkJ/nSL5KITPWzAAs0YHXL5QL5QCvEXTwW6NcQivY3Vowa1194t9T3bqbHaEWM3+6yip1CdV8Cv3HWDcZqYQmFj5BKTPAu19RjPWE9hV6e6CbfopbtkxQTy901Mg8T2ZBabuaf8+FXwH6BwSH08fzvf4s/zaKzogEsd6Ir/EGShLwLq8JvTf/rDsOr6HE+ihJ9Anxy5uvTnadmwmcC9KVcHH2467pLTX8X0gn1xW85J5vtMRvAK/b8zDsK0TJBE5rsHjjgMkPdB9suRT1gagHz4ZeYmFEwZP44wub1is9uejCnboyphLLIxPF+9+gGhdhm/J7JtbMu8JiC25Ochs5TtAXgPrCS4xXSARWe3Gtw/qjNDlXFfqG7L1mPHOfUeeLkzhh3CcHjxA4G0Rjy0SB9cPx0kfvgMkvDpOmGw4guCaIbwpZimdBizRp0j3GUpax/4lf7tHjnq6ONIhxxLvKUntGk6Gyfmoc3sfd74DbFasBbfkjLvGr8RjrMJAfn2pzmV5Ku/v7ClBCK5BgBG1RZLx6YL9c04FXWD/ckj/8sYFa3J2lsHQd4BV35XNjMJaN54SkWL6oGU6telylBHWvU6f2B1ka/TtIjn+00Wi/4nvGfUFT+tUBaanjHjQavC42H1hSuVL7jtAm1VLBA8wTz1G5bP8M8pEKJGxYDkXtIfXpQf6LdCM/422/0df+qLGev1KY5dQLp6lsS9TLnhBYz0pfLUf4+v82Bef1Vj3co3xZWqs2zNaddaZ2MtT1y4VeTYWh2zktdnmxKK/KRCAVd/hk4NiNKfaSGRkBa6DNUsGMfEL3ZtthVQV8kI/XIHhXHQhH7kKLTeh0XAA1sfaC/nW2bWl7FwuKKSt6+PqwGDadKekUiPbRzP6cnqaSTnJlAcC0Aar+p6s5JPFEEZZLQkqy0xsScDj2czlsuqS6ShcqKsSKGvJdm2Vty9b3cSsaJG2Y9lUCtRSN6Rlivh/mbABKIEBpG9UfV82vvEDuZYffG7mQiZTZ3/9XciFVRBLBT9xVlLn/gsNRWWEQuCVLNv/pStcP0UFAFc3Pf2YTYWVQb31oZiN+VlBvy/zSM1gftPhx+Tapsd5NrBjUClQgKlJV4+SDW/yS9yGUTKeX+TGuv9Gj5FozVhKkST+G32vRPlFLur+G32/RN+j7HhAov/8sUTrKDsnSHTXQxL9N4Vvo6N7Jkn0v5T/PSLRfZT9xRL9eLKM4DvBcfWPyhMNJcGCS63tpABMDXYq5iFAj0f1tAfokR9vGrx6OM3twwj0GAAhwBCgRwIezcMIDAF6JODRPIzAEKBHAh7NwwgMAXok4NE8jMAQoEcCHs0/jxHoccn+mocAPfIMAYYAPRLwaP5/AAAA//8pbH7FAAAABklEQVQDADVwAd3EH5SFAAAAAElFTkSuQmCC",alt:"upload",style:{width:"40px",height:"40px"}}),size:"small",theme:"outline",type:"secondary",onClick:t=>{t.stopPropagation(),j.current?.click()},onMouseDown:t=>t.stopPropagation(),className:"!rounded-full flex-shrink-0 transition-all",style:{width:"40px",height:"40px",minWidth:"40px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:"none"},disabled:S,loading:S,title:e("上传图片")}),V=f.isValidElement(b)?f.cloneElement(b,{icon:g.jsx("img",{src:hS,alt:"send",style:{width:"40px",height:"40px"}}),className:`!rounded-full flex-shrink-0 transition-all ${b.props.className||""}`,style:{...b.props.style,width:"40px",height:"40px",minWidth:"40px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",background:"#ffffff"}}):null;return g.jsxs("div",{className:"p-2 sm:p-4 relative",ref:F,onDragEnter:$,onDragOver:P,onDragLeave:q,onDrop:W,children:[B&&g.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center rounded-xl",style:{background:"hsl(var(--primary) / 0.1)",border:"2px dashed hsl(var(--primary))",backdropFilter:"blur(4px)",pointerEvents:"none"},children:g.jsxs("div",{className:"text-center p-6 rounded-xl",style:{background:"hsl(var(--background))",boxShadow:"var(--app-shadow-md)",pointerEvents:"none"},children:[g.jsx("div",{className:"text-xl mb-2",children:"📁"}),g.jsx(v.Text,{strong:!0,style:{fontSize:"16px",color:"hsl(var(--primary))"},children:e("释放以上传图片")})]})}),S&&g.jsxs("div",{className:"mb-2 px-2",children:[g.jsx("div",{className:"text-xs text-primary mb-1",children:e("上传进度: {{progress}}%",{progress:T.toFixed(0)})}),g.jsx(D,{percent:T,size:"small"})]}),E.length>0&&g.jsx("div",{className:"mb-3 px-2",children:g.jsx("div",{className:"flex flex-wrap gap-2",children:E.map(t=>g.jsxs("div",{className:"relative group",style:{width:"80px",height:"80px",borderRadius:"8px",overflow:"hidden",border:"1px solid hsl(var(--border))",background:"hsl(var(--card))"},children:[g.jsx("img",{src:t.url,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}),g.jsx("button",{onClick:()=>I(t.id,t.url),className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity",style:{width:"20px",height:"20px",borderRadius:"50%",background:"rgba(0, 0, 0, 0.6)",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px",padding:0},title:e("删除图片"),children:"×"}),g.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity",style:{background:"rgba(0, 0, 0, 0.3)",pointerEvents:"none"}})]},t.id))})}),g.jsxs("div",{className:"bg-secondary rounded-tl-xl rounded-tr-xl",children:[g.jsx(fS,{groups:a,models:o,selectedGroup:l,selectedModel:c,onGroupChange:h,onModelChange:d,isMobile:w}),g.jsxs("div",{className:"flex items-start gap-2 sm:gap-3 p-2 rounded-xl sm:rounded-2xl transition-shadow",style:{border:"1px solid hsl(var(--border))",background:"hsl(var(--background) / 0.96)",alignItems:"flex-start"},children:[g.jsx("div",{className:"flex-1",style:{minHeight:"68px"},children:x}),H,V]})]}),g.jsx("div",{className:"py-[8px] px-[12px] flex items-center gap-2 bg-secondary rounded-bl-xl rounded-br-xl border border-border border-t-0",children:g.jsx(v.Text,{type:"tertiary",size:"small",style:{fontWeight:400,fontSize:"12px"},children:e("按 Enter 发送,Shift+Enter 换行,支持拖拽上传图片或 Ctrl+V 粘贴图片")})}),g.jsx("input",{ref:j,type:"file",accept:"image/*",multiple:!0,onChange:t=>{const e=t.target.files;e&&e.length>0&&R(e),t.target.value=""},style:{display:"none"}})]})},yS=({onMessageSend:t,onImageUpload:e,onImageRemove:r,groups:i,models:n,selectedGroup:s,selectedModel:a,onGroupChange:o,onModelChange:l,styleState:c})=>{const{t:h,i18n:d}=et(),u=At(),[f]=p.useContext(Bt),m=Mt(),y=d.language&&d.language.startsWith("zh")?f?.status?.system_name||m||"中转 API":f?.status?.server_name_en||f?.status?.system_name_en||m||"New API",x={inputNode:g.jsx("textarea",{className:"welcome-screen-textarea",placeholder:h("请输入问题,帮你深度解答"),style:{width:"100%",minHeight:"68px",maxHeight:"200px",padding:"12px",border:"none",outline:"none",resize:"vertical",fontSize:"14px",lineHeight:"1.5",background:"transparent",color:"hsl(var(--foreground))",fontFamily:"inherit"},onKeyDown:e=>{if("Enter"===e.key&&!e.shiftKey){e.preventDefault();const r=e.target.value.trim();r&&t&&(t(r),e.target.value="")}}}),sendNode:g.jsx(k,{icon:g.jsx("img",{src:hS,alt:"send",style:{width:"40px",height:"40px"}}),onClick:e=>{const r=e.currentTarget.closest(".welcome-screen-input-area")?.querySelector("textarea"),i=r?.value.trim();i&&t&&(t(i),r.value="")},className:"!rounded-full flex-shrink-0",style:{width:"40px",height:"40px",background:"#ffffff"}})};return g.jsx(Me.div,{className:"welcome-screen-container",initial:{opacity:0}
2,animate:{opacity:1},transition:{duration:.3,ease:"easeIn"},children:g.jsxs("div",{className:"welcome-screen-content",children:[g.jsxs("div",{className:"welcome-screen-header",children:[g.jsx(Me.div,{className:"welcome-screen-logo",animate:{y:[0,-10,0]},transition:{duration:3,ease:"easeInOut",repeat:1/0},children:g.jsx("img",{src:u,alt:"logo"})}),g.jsxs(v.Title,{heading:1,className:"welcome-screen-title",children:[h("欢迎来到")," ",g.jsx("span",{className:"welcome-screen-brand",children:y})]}),g.jsx(v.Text,{type:"tertiary",className:"welcome-screen-subtitle",children:h("请输入问题,帮你深度解答")})]}),g.jsx(Me.div,{className:"welcome-screen-input-area",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,ease:"easeOut",delay:.1},children:g.jsx(mS,{detailProps:x,onImageUpload:e,onImageRemove:r,groups:i,models:n,selectedGroup:s,selectedModel:a,onGroupChange:o,onModelChange:l})})]})})},xS="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAEr0lEQVR4AexZTWhUVxQ+Z7STBLpISku7sFBoC5G2lNJKFQp9r5oJ0r8Z267qIqUU6q5CFl24KbR0YYtuil0UmkJd6gz4xyTC3IWgEgQFwSxcCAYUFJOFMMlocjznxhnvzxtn3sx7T5Q85s6759xzz/m+e8/cd9+dHDzl1zqBJz2Bz/4MhONfvRUUigfCsdLZcKx4KyyU6lwopSK+b4SF4mxQKO0Px0vvdprhtjMQBMFgMFb8F2j1MgL+BAhbAfFFdjjIJa2P+H4FAD9AgEkguBiMlQ4JFmhzRRLQHfLDxxBxok2/zNSI8CMwloAHNCpoJAF4buQAAu6I6vAkdBrLwPChqNgeAck7zdqwJoA5Tp/PqLH0KjUWhmrTZUyjiG+JAUhf65gGBiSc4N/F24ZKVz0CRLBbtzz80o4aC1tq1aMnlDo1r5RaetiU+E18S4xatXIEOKaObUWh7y2RBY8AEgWsb30QaR87vttSZFSRmIg4aYbjWdhqylL3CHCqbJKGZqHc8vlmPes7LcMlOya9YcsAPgGCYTCvev22KWZbv+PExufd+D4BBFmLW3Y8lT3lfDi+61P94JOHH9dbDmNUvNgONnHlExBtEmV1dQrkwSdF6kn4jPCRHgEB3gxo1pu6hO7pEUgIYCc36wQ6jVDa7X3PQGu1KZSsLbYLPHTa9QrV4+pk+u6bAMgK08uPVPpIXxNND/UYBHrwnkGX/gnkchNA5Dwxu0AufaRvF6aPM8k9rrGbNtml1mYqL7nba7ev26778A7XtYsr900gbsCk7dcJJD2icf2lNwPyI22iMetNXUL39AjICiPApUg9IcCum9QItFYnWaF6XG28oxQC793EJ0Bgvf8GwTfeW5A7CunJL8hB2iP3CIvgXD4BpJumDQ6sfGzKWdZxYPVDOx7N23LEOzERnraMiP7gqcx8FiQmY/nVxEKAypSlHjED8Jc0GGUU8yOz4Y7Sl0FQtF/4DaMkqgx6MAh2bZIdLuRHZhFg1PSLCP+bstQ9Amq6fJmIpqTRKKN8flHBPC60tsUdXtY/2Vl8nU/S9rP9FS51LtZ2O0rmgapjnq7z3uq4C54I/q5Vy84xCzAsiLjuLe4hIDuVXLM222EexY0M/HdagTmUE+a1UbROOlxXnWSN5d7C3ig7bwbESCk+Pmwsfi6sRW5bhITRuH37Fy9DfvgUA/8ZADdCAhchZwNj0Zgi/EUSEDvpoGbKezid3iOEf1g3x8Vbh1mnP2Gh+P7Khg3nsL9T7SVOn9v8v8A5HvWDBPCOqla+Eyw6SMRXWwJNWzVTuaiq5R94O7yZy1BTb945Zb4FwjMI8BrY1zyDmKAGjXDfbk60h/Q2e6a8TU1X9srv0XbnSx0J+F1sTVAo8n8JvDo4p2Y8gqepsbyFQfynVMV7ANleepf6JoDy95MTn8EfhMbiTqVOWg9FxywRsW8CDoolTpndevqVuu+0pSL2QsB7nK8ho2sA9BGnzGFYU2TyHZsAp8eUi4x1nO+NbbXpygW3LW05NgHO7V8IYB+P9lUGN8fr9CTrMsl3jud9YhNQnNucJr/xaL/JS+NmXqf/FJ3nOSNFbAIZ4eo6zFNP4AEAAAD//wF82X0AAAAGSURBVAMATJM+fxmK/ZIAAAAASUVORK5CYII=",bS=({chatRef:t,message:e,allMessagesCount:r=0,hasMoreMessages:i=!1,remainingMessagesCount:n=0,onLoadMore:s,onLoadAll:a,inputs:o,styleState:l,showDebugPanel:c,roleInfo:h,onMessageSend:d,onMessageCopy:u,onMessageReset:m,onMessageDelete:y,onStopGenerator:x,onClearMessages:b,onReplaceMessages:C,onToggleDebugPanel:S,renderCustomChatContent:_,renderChatBoxAction:T,onImageUpload:A,onImageRemove:B,groups:M,models:E,onGroupChange:j,onModelChange:F,onToggleModelConfig:N})=>{const{t:I}=et();At();const O=f.useCallback(t=>g.jsx(mS,{...t,onImageUpload:A,onImageRemove:B,groups:M,models:E,selectedGroup:o?.group,selectedModel:o?.model,onGroupChange:j,onModelChange:F}),[A,B,M,E,o?.group,o?.model,j,F]),D=f.useMemo(()=>Array.isArray(e)&&0!==e.length?e.map(t=>({...t,fullContent:t.content,content:ot(t)})):[],[e]),z="playground_restart_chat",$="playground_load_session";return p.useRef(""),p.useEffect(()=>{const t=()=>{"function"==typeof b&&b()};return window.addEventListener(z,t),()=>window.removeEventListener(z,t)},[b]),p.useEffect(()=>{const t=t=>{"function"==typeof C&&C(t?.detail?.messages||[])};return window.addEventListener($,t),()=>window.removeEventListener($,t)},[C]),0===e.length?g.jsx("div",{className:"welcome-screen-wrapper",children:g.jsx(yS,{onMessageSend:d,onImageUpload:A,onImageRemove:B,groups:M,models:E,selectedGroup:o?.group,selectedModel:o?.model,onGroupChange:j,onModelChange:F,styleState:l})}):g.jsx(Me.div,{initial:{opacity:0,y:10}
2,animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:g.jsxs(L,{className:"h-full playground-chat-card !bg-transparent",bordered:!1,bodyStyle:{padding:0,height:"calc(100vh - var(--app-header-offset, 80px))",display:"flex",flexDirection:"column",overflow:"hidden"},children:[g.jsx("div",{className:"chat-header mx-6 py-4 rounded-t-2xl position-relative top-0 z-10",children:l.isMobile?g.jsxs("div",{className:"flex items-center justify-between px-3 py-3",children:[g.jsx("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAFRUlEQVR4AexZX2gcZRCfuSaXBCIkpeJLBcEWUlREpGhBcM80F4r/7io+2YcUFAz6YKEPfeiLoCiotA9KAgqNUF+9E/+USyr3PQhWilCh4EH7IJgHweAFLOTu0tx0Zm/37tvdb3fvcrm7FLLs7H4z33yz8/u+uf125hJwnx97AAa9gHsr0O0KpGZfe8yazS6k0plbTJsO3bJmsl+mZrNPxtkf2ApYljVqzWQuAdVvIsHbAHiIacihQ4jwJhDcsGYzl0QXQo5YACmZoXTmQmom+2tqJvNvKp3dYKJYEt3Zky+anms7lJz4HhHnTP26DIl1WNdiwLrcbYcCkAHNGQJ8DxCeBcQDPHCUKf4U3Xp9yag4PLGAgMeNfQahrTsysWDoAiMAcR4YdTszZDIaJZO49tslgBJPzktUK48xPQAIGVumGZKVsNLZxzWR3TQCgOHJCzZqW2WbF6I1SCTm/KOpDu/qMtvRWvlosfDtj0qpCtOdYiH3HbDM7vMqv6Oz0k7IRafGDAH/qFpS2xAiz1DlYZ6hseJyDmNpJf9gkZ1qWWm0EMlqtBpXRDgnTje41lVkiHi2JQHgsYGwCwAgglOgHQRQktkQZ5S6ssqGK1r3dpqP6IOoWv5Z5/U2Vf/z93nGim4AABL5ZojOs9N3RLlHdDfCLr9WI3q5KwCA1+kgy5snJaq/NZmdafylm8GR/dM6r7dxaNLf5xkrukEABBOgHxsbazrbbZsIr3psEH1qWda4R8aMyCgBH3OzeRKiajJOIwgAwfOe5/DpNuadRzk3hC+clnubwuTk9dTx7KuW9fo4Oz6akg0wOXkdAaZcJbkz/7ncdQoC0Ht70FbLuZtEtOQzPcU7Uh6Td/9nMBtA9AM763GekJaKhdwfvnE8zC/pB7+5Pk9A3lCKeK6tW12fN6n0fQXECaVUBWrrLxtWQro9JDMvuvYYT0+DGQgAebQ4pFbypxnEU4TwFQDdZuJXKgndZtkiATyhCvnToitjTDQwAK4zDOKGKuTeKi7nDzMNO3SYZfPye3H1wu4dAAgzMVj5HoDBzj8M6DXaBmrZzOwMMCKzEzO7N4Qkm5OsTkja4q2Bdi8Acdx1WG+7Mue+ewE4Dsbd9gDEzdB2+uWL1DOOIPSLOLgCBJ7sSz5xPcb6wuw/4HkMwjqEHEEASP/oujiy9bzO96ONI/VnvM+hVS/f4gIA2s2YWiZ2tsXhM84+fKBbJcBAJub2BwBAZMaU8aabrpUu7+z0qGWdPCibF5gyMYTLYY8IAJAvQP7EXfINcDImLDdrojE75AsnMo9yJe0T1v+TKbKeKlkYJulvYyZGsGjKxMA5AgBseTsZk2wuhh2SZ3OIHf+ItqCEAFKYmmKbnjyb+bZOOxPbLJ+JUjYCUM2MCRajBoOA0BSmp195CJITV9jxcwAYW9OBiCMuE3OHGgFIp4BQK7l5DicnY4ISy0Pfx6l05umtffuuYQdVZ7bnnhUOnzX+P+Aaz/pFaiMTcweGAnAVWhlT7gjXQ8dcuX7nkHkDCH9BAH/pb5WdmaMaTfLYqHrqWFFqqSu5Y2o5f0Z+h9DmEQsgzo6VznAlGy6Dr57EM3mVatWj7MzXSuVDN6I4+3H9XQNA+fPD9xR2/iJXEk4o9ZNnU/Sp7QjbNQCfFxUOmVN2GCjF1QVfbw/Y7QAI2daJC6/0HIfMN9ADR8NMdgyAw2PJb4xlHO+1Y1wS+d3f12u+YwAc2+8TwHkuQnEhCkr8vj7Lsr7Eu2kyOgagOLY5TD7k2eZCVO4IV84+E5nJeD9kHQPoh1OdPOO+B3APAAD//8rXdEUAAAAGSURBVAMABSZNfzgR/OsAAAAASUVORK5CYII=",alt:"mesSet",className:"w-[20px] h-[20px]",onClick:()=>{try{window.dispatchEvent(new Event("playground_open_settings"))}catch{}}}),g.jsx("div",{className:"flex items-center",children:g.jsx(v.Title,{heading:6,className:"mb-0",style:{color:"hsl(var(--foreground))",fontSize:"16px",fontWeight:"500"},children:I("新对话")})}),g.jsx("img",{src:xS,alt:"mesAdd",className:"w-[20px] h-[20px]",onClick:()=>{try{window.dispatchEvent(new Event("playground_new_session"))}catch{}}})]}):g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx(k,{icon:g.jsx("img",{src:xS,alt:"new",style:{width:"18px",height:"18px"}}),onClick:()=>{try{window.dispatchEvent(new Event("playground_new_session"))}catch{}},size:"large",theme:"light",children:I("新对话")}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(w,{content:I("查看代码"),children:g.jsx(k,{icon:c?g.jsx(he,{size:18}):g.jsx(se,{size:18}),onClick:S,theme:"borderless",type:c?"primary":"tertiary",size:"large",style:{width:"36px",height:"36px",borderRadius:"50%",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},className:"!rounded-full"})}),g.jsx(w,{content:I("模型参数"),children:g.jsx(k,{icon:g.jsx(de,{size:18}),onClick:N,theme:"borderless",type:"tertiary",size:"large",style:{width:"36px",height:"36px",borderRadius:"50%",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},className:"!rounded-full"})})]})]})}),g.jsxs("div",{className:"flex-1 overflow-hidden chat-content",children:[i&&g.jsx("div",{style:{padding:"10px 16px",textAlign:"center",background:"transparent",borderBottom:"1px solid hsl(var(--foreground) / 0.08)"},children:g.jsxs(k,{size:"small",theme:"borderless",type:"primary",onClick:()=>s&&s(50),style:{fontSize:"13px",padding:"5px 16px",height:"30px",borderRadius:"15p
2x",transition:"all 0.2s ease",fontWeight:500},children:[I("加载更早的消息")," (",n,")"]})}),g.jsx(R,{ref:t,chatBoxRenderConfig:{renderChatBoxContent:_,renderChatBoxAction:T,renderChatBoxTitle:({role:t,message:e})=>{const r=t?.name||I("user"===e?.role?"You":"Assistant"),i=e?.createAt||e?.time||e?.createTime||e?.createdAt||e?.timestamp||e?.date;let n;if(i)if("number"==typeof i)n=Nt(i<1e11?1e3*i:i);else if("string"==typeof i){const t=Number(i);n=Number.isFinite(t)&&""!==i.trim()?Nt(t<1e11?1e3*t:t):Nt(i)}else n=Nt(i);const s=Nt(),a=n?n.format("h:mma"):"";let o="";return n&&(o=n.format("YYYY-MM-DD")===s.format("YYYY-MM-DD")?`Today ${a}`:n.format("YYYY-MM-DD")===s.subtract(1,"day").format("YYYY-MM-DD")?`Yesterday ${a}`:n.year()!==s.year()?`${n.format("YYYY-MM-DD")} ${a}`:n.month()!==s.month()?`${n.format("MM-DD")} ${a}`:`${n.format("DD")} ${a}`),g.jsxs("div",{className:"message-meta-row",children:[g.jsx("span",{className:"message-meta-name",children:r}),g.jsx("span",{className:"message-meta-time",children:o})]})}},renderInputArea:O,roleConfig:h,style:{height:"100%",maxWidth:"100%",overflow:"hidden"},chats:D,onMessageSend:d,onMessageCopy:u,onMessageReset:m,onMessageDelete:y,showClearContext:!0,showStopGenerate:!0,onStopGenerator:x,onClear:b,enableUpload:!1,className:"h-full playground-chat",placeholder:I("输入您的消息... (Enter 发送,Shift+Enter 换行)")})]})]})})},CS=({styleState:t,showSettings:e,showDebugPanel:r,showModelConfig:i,onToggleSettings:n,onToggleDebugPanel:s,onToggleModelConfig:a})=>{const{t:o}=et();return t?.isMobile?g.jsxs(g.Fragment,{children:[!e&&g.jsx(w,{content:o("模型参数"),children:g.jsx(k,{icon:g.jsx(de,{size:18}),onClick:a,theme:"solid",type:"primary",style:{position:"fixed",right:16,bottom:"max(120px, env(safe-area-inset-bottom, 0px) + 120px)",zIndex:1e3,width:40,height:40,borderRadius:"50%",padding:0,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",background:"hsl(var(--primary))"},className:"!rounded-full !p-0"})}),!e&&g.jsx(w,{content:o("查看代码"),children:g.jsx(k,{icon:r?g.jsx(he,{size:18}):g.jsx(se,{size:18}),onClick:s,theme:"solid",type:r?"danger":"primary",style:{position:"fixed",right:16,bottom:"max(180px, env(safe-area-inset-bottom, 0px) + 180px)",zIndex:1e3,width:40,height:40,borderRadius:"50%",padding:0,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",background:r?"hsl(var(--destructive))":"hsl(var(--primary))"},className:"!rounded-full !p-0"})})]}):null},wS=({inputs:t,parameterEnabled:e,onInputChange:r,onParameterToggle:i,disabled:n=!1})=>{const{t:s}=et();return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"transition-opacity duration-200 mb-4 "+(!e.temperature||n?"opacity-50":""),children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ue,{size:16,className:"text-muted-foreground"}),g.jsx(v.Text,{strong:!0,className:"text-sm",children:s("Temperature")}),g.jsx(z,{size:"small",shape:"circle",children:t.temperature})]}),g.jsx(k,{theme:e.temperature?"solid":"borderless",type:e.temperature?"primary":"tertiary",size:"small",icon:e.temperature?g.jsx(Ut,{size:10}):g.jsx(Yt,{size:10}),onClick:()=>i("temperature"),className:"!rounded-full !w-4 !h-4 !p-0 !min-w-0",disabled:n})]}),g.jsx(v.Text,{className:"text-xs text-muted-foreground mb-2",children:s("控制输出的随机性和创造性")}
2),g.jsx($,{step:.1,min:.1,max:1,value:t.temperature,onChange:t=>r("temperature",t),className:"mt-2",disabled:!e.temperature||n})]}),g.jsxs("div",{className:"transition-opacity duration-200 mb-4 "+(!e.top_p||n?"opacity-50":""),children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(pe,{size:16,className:"text-muted-foreground"}),g.jsx(v.Text,{strong:!0,className:"text-sm",children:s("Top P")}),g.jsx(z,{size:"small",shape:"circle",children:t.top_p})]}),g.jsx(k,{theme:e.top_p?"solid":"borderless",type:e.top_p?"primary":"tertiary",size:"small",icon:e.top_p?g.jsx(Ut,{size:10}):g.jsx(Yt,{size:10}),onClick:()=>i("top_p"),className:"!rounded-full !w-4 !h-4 !p-0 !min-w-0",disabled:n})]}),g.jsx(v.Text,{className:"text-xs text-muted-foreground mb-2",children:s("核采样,控制词汇选择的多样性")}),g.jsx($,{step:.1,min:.1,max:1,value:t.top_p,onChange:t=>r("top_p",t),className:"mt-2",disabled:!e.top_p||n})]}),g.jsxs("div",{className:"transition-opacity duration-200 mb-4 "+(!e.frequency_penalty||n?"opacity-50":""),children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ge,{size:16,className:"text-muted-foreground"}),g.jsx(v.Text,{strong:!0,className:"text-sm",children:s("Frequency Penalty")}),g.jsx(z,{size:"small",shape:"circle",children:t.frequency_penalty})]}),g.jsx(k,{theme:e.frequency_penalty?"solid":"borderless",type:e.frequency_penalty?"primary":"tertiary",size:"small",icon:e.frequency_penalty?g.jsx(Ut,{size:10}):g.jsx(Yt,{size:10}),onClick:()=>i("frequency_penalty"),className:"!rounded-full !w-4 !h-4 !p-0 !min-w-0",disabled:n})]}),g.jsx(v.Text,{className:"text-xs text-muted-foreground mb-2",children:s("频率惩罚,减少重复词汇的出现")}),g.jsx($,{step:.1,min:-2,max:2,value:t.frequency_penalty,onChange:t=>r("frequency_penalty",t),className:"mt-2",disabled:!e.frequency_penalty||n})]}),g.jsxs("div",{className:"transition-opacity duration-200 mb-4 "+(!e.presence_penalty||n?"opacity-50":""),children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(fe,{size:16,className:"text-muted-foreground"}),g.jsx(v.Text,{strong:!0,className:"text-sm",children:s("Presence Penalty")}),g.jsx(z,{size:"small",shape:"circle",children:t.presence_penalty})]}),g.jsx(k,{theme:e.presence_penalty?"solid":"borderless",type:e.presence_penalty?"primary":"tertiary",size:"small",icon:e.presence_penalty?g.jsx(Ut,{size:10}):g.jsx(Yt,{size:10}),onClick:()=>i("presence_penalty"),className:"!rounded-full !w-4 !h-4 !p-0 !min-w-0",disabled:n})]}),g.jsx(v.Text,{className:"text-xs text-muted-foreground mb-2",children:s("存在惩罚,鼓励讨论新话题")}),g.jsx($,{step:.1,min:-2,max:2,value:t.presence_penalty,onChange:t=>r("presence_penalty",t),className:"mt-2",disabled:!e.presence_penalty||n})]}),g.jsxs("div",{className:"transition-opacity duration-200 mb-4 "+(!e.max_tokens||n?"opacity-50":""),children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(me,{size:16,className:"text-muted-foreground"}),g.jsx(v.Text,{strong:!0,className:"text-sm",children:s("Max Tokens")})]}),g.jsx(k,{theme:e.max_tokens?"solid":"borderless",type:e.max_tokens?"primary":"tertiary",size:"small",icon:e.max_tokens?g.jsx(Ut,{size:10}):g.jsx(Yt,{size:10}),onClick:()=>i("max_tokens"),className:"!rounded-full !w-4 !h-4 !p-0 !min-w-0",disabled:n})]}),g.jsx(T,{placeholder:s("Max Tokens"),name:"max_tokens",required:!0,autoComplete:"new-password",defaultValue:0,value:t.max_tokens,onChange:t=>r("max_tokens",t),className:"!rounded-lg",disabled:!e.max_tokens||n})]}),g.jsxs("div",{className:"transition-opacity duration-200 mb-4 "+(!e.context_length||n?"opacity-50":""),children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Qt,{size:16,className:"text-muted-foreground"}),g.jsx(v.Text,{strong:!0,className:"text-sm",children:s("上下文长度")}),g.jsx(z,{size:"small",shape:"circle",children:t.context_length})]}),g.jsx(k,{theme:e.context_length?"solid":"borderless",type:e.context_length?"primary":"tertiary",size:"small",icon:e.context_length?g.jsx(Ut,{size:10}):g.jsx(Yt,{size:10}),onClick:()=>i("context_length"),className:"!rounded-full !w-4 !h-4 !p-0 !min-w-0",disabled:n})]}),g.jsx(v.Text,{className:"text-xs text-muted-foreground mb-2",children:s("控制对话历史记录保留的消息条数")}),g.jsx($,{step:1,min:5,max:50,value:t.context_length,onChange:t=>r("context_length",t),className:"mt-2",disabled:!e.context_length||n})]}),g.jsxs("div",{className:"transition-opacity duration-200 mb-4 "+(!e.seed||n?"opacity-50":""),children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ye,{size:16,className:"text-muted-foreground"}),g.jsx(v.Text,{strong:!0,className:"text-sm",children:s("Seed")}
2),g.jsx(v.Text,{className:"text-xs text-muted-foreground/60",children:s("(可选,用于复现结果)")})]}),g.jsx(k,{theme:e.seed?"solid":"borderless",type:e.seed?"primary":"tertiary",size:"small",icon:e.seed?g.jsx(Ut,{size:10}):g.jsx(Yt,{size:10}),onClick:()=>i("seed"),className:"!rounded-full !w-4 !h-4 !p-0 !min-w-0",disabled:n})]}),g.jsx(T,{placeholder:s("随机种子 (留空为随机)"),name:"seed",autoComplete:"new-password",value:t.seed||"",onChange:t=>r("seed",""===t?null:t),className:"!rounded-lg",disabled:!e.seed||n})]})]})},{TabPane:kS}=F,vS=({visible:t,onClose:e,onImageSelect:r})=>{const[i,n]=p.useState([]),[s,a]=p.useState(!1),[o,l]=p.useState(0),[c,h]=p.useState({usage:0,quota:0,percentage:0}),[d,u]=p.useState(null),[f,m]=p.useState(!1),[b,C]=p.useState(!1),[w,S]=p.useState("upload"),{t:T}=et(),N=p.useRef(null),I=async()=>new Promise((t,e)=>{const r=indexedDB.open("PlaygroundDB",1);r.onsuccess=e=>t(e.target.result),r.onerror=()=>e(new Error("Failed to open IndexedDB"))}),O=p.useCallback(async()=>{C(!0);try{const t=await(async()=>new Promise(async(t,e)=>{try{const r=(await I()).transaction(["images"],"readonly").objectStore("images").getAll();r.onsuccess=()=>{const e=r.result.map(t=>({id:t.id,name:t.id,url:t.data,timestamp:t.timestamp,size:.75*t.data.length}));t(e)},r.onerror=()=>{e(new Error("获取图片失败"))}}catch(r){e(r)}}))();n(t)}catch(t){console.error("加载存储图片失败:",t),y.error(T("加载存储图片失败"))}finally{C(!1)}},[]),R=p.useCallback(async()=>{try{const t=await(async()=>{try{if("storage"in navigator&&"estimate"in navigator.storage){const t=await navigator.storage.estimate();return{quota:t.quota,usage:t.usage,percentage:t.quota?(t.usage/t.quota*100).toFixed(2):0}}return{quota:0,usage:0,percentage:0}}catch(t){return console.error("获取存储使用情况失败:",t),{quota:0,usage:0,percentage:0}}})();h(t)}catch(t){console.error("获取存储信息失败:",t)}},[]),z=t=>["image/jpeg","image/jpg","image/png","image/gif","image/webp"].includes(t.type)?!(t.size>52428800&&(y.error(T("图片大小不能超过 50MB")),1)):(y.error(T("仅支持 JPG、PNG、GIF、WebP 格式的图片")),!1),$=p.useCallback(async t=>{const e=Array.from(t).filter(z);if(0!==e.length){a(!0),l(0);try{const t=e.length,i=[];for(let n=0;n<e.length;n++){const s=e[n];l((n+1)/t*100);try{let t=s;s.size>1048576&&(y.info(`正在压缩图片: ${s.name}`),t=await Mv(s,.8,1920,1080));const e=await new Promise((e,r)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=r,i.readAsDataURL(t)}),r=Bv();await Av(r,e);const n={id:r,name:s.name,type:s.type,size:s.size,compressedSize:t.size,url:e,timestamp:(new Date).toISOString()};i.push(n)}catch(r){console.error(`处理图片 ${s.name} 失败:`,r),y.error(`处理图片 ${s.name} 失败`)}}await O(),await R(),y.success(`成功上传 ${i.length} 张图片`)}catch(r){console.error("上传图片失败:",r),y.error(T("上传图片失败"))}finally{a(!1),l(0)}}},[O,R]),W=p.useCallback(async t=>new Promise(async(e,r)=>{try{const i=(await I()).transaction(["images"],"readwrite").objectStore("images").delete(t);i.onsuccess=async()=>{await O(),await R(),y.success(T("图片已删除")),e()},i.onerror=()=>{console.error("删除图片失败"),y.error(T("删除图片失败")),r(new Error("删除图片失败"))}}catch(i){console.error("删除图片失败:",i),y.error(T("删除图片失败")),r(i)}}),[O,R]),H=p.useCallback(async()=>new Promise(async(t,e)=>{try{const r=(await I()).transaction(["images"],"readwrite").objectStore("images").clear();r.onsuccess=async()=>{n([]),await R(),y.success(T("已清空所有图片")),t()},r.onerror=()=>{console.error("清空图片失败"),y.error(T("清空图片失败")),e(new Error("清空图片失败"))}}catch(r){console.error("清空图片失败:",r),y.error(T("清空图片失败")),e(r)}}),[R]),V=p.useCallback(t=>{u(t),m(!0)},[]),Y=p.useCallback(t=>{r&&(r(t.url),y.success(T("图片已插入到地址列表")))},[r]),U=t=>{if(0===t)return"0 B";const e=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,e)).toFixed(2))+" "+["B","KB","MB","GB"][e]};return p.useEffect(()=>
2{t&&(O(),R())},[t,O,R]),g.jsxs(g.Fragment,{children:[g.jsx(x,{title:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-r from-blue-500 to-purple-500 flex items-center justify-center",children:g.jsx(ke,{size:16,className:"text-white"})}),g.jsx("span",{children:T("图片存储管理")}),g.jsx(j,{count:i.length,type:"primary"})]}),visible:t,onCancel:e,width:800,height:600,footer:g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("div",{className:"flex items-center gap-4 text-sm text-gray-500",children:g.jsxs("span",{children:[g.jsx(we,{size:14,className:"inline mr-1"}),"存储使用: ",U(c.usage)," / ",U(c.quota)," (",c.percentage,"%)"]})}),g.jsx("div",{className:"flex gap-2",children:g.jsx(k,{onClick:e,children:T("关闭")})})]}),bodyStyle:{padding:0,height:"500px"},children:g.jsx("div",{className:"h-full flex flex-col",children:g.jsxs(F,{activeKey:w,onChange:S,style:{height:"100%"},contentStyle:{height:"calc(100% - 44px)",padding:"16px"},children:[g.jsx(kS,{tab:g.jsxs("span",{children:[g.jsx(xe,{size:14,className:"mr-2"}),"上传图片"]}),itemKey:"upload",children:g.jsxs("div",{className:"space-y-4",children:[g.jsx(L,{className:"border-dashed border-2 border-gray-300 hover:border-blue-400 transition-colors",children:g.jsx("div",{className:"text-center py-8 cursor-pointer",onClick:()=>N.current?.click(),onDrop:t=>{t.preventDefault();const e=Array.from(t.dataTransfer.files);e.length>0&&$(e)},onDragOver:t=>t.preventDefault(),children:g.jsxs("div",{className:"flex flex-col items-center gap-3",children:[g.jsx("div",{className:"w-16 h-16 rounded-full bg-blue-50 flex items-center justify-center",children:g.jsx(xe,{size:24,className:"text-blue-500"})}),g.jsxs("div",{children:[g.jsx(v.Text,{strong:!0,className:"text-lg block",children:"点击或拖拽上传图片"}),g.jsx(v.Text,{className:"text-gray-500",children:"支持 JPG、PNG、GIF、WebP 格式,最大 50MB"})]}),g.jsx(k,{theme:"solid",type:"primary",loading:s,disabled:s,children:s?"上传中...":"选择文件"})]})})}),s&&g.jsxs("div",{children:[g.jsxs(v.Text,{className:"text-sm text-gray-600 mb-2 block",children:["上传进度: ",o.toFixed(0),"%"]}),g.jsx(D,{percent:o})]}),g.jsx("input",{ref:N,type:"file",accept:"image/*",multiple:!0,onChange:t=>{const e=t.target.files;e&&e.length>0&&$(e),t.target.value=""},style:{display:"none"}})]})}),g.jsx(kS,{tab:g.jsxs("span",{children:[g.jsx(Ce,{size:14,className:"mr-2"}),"图片管理",g.jsx(j,{count:i.length,type:"primary",size:"small",style:{marginLeft:8}})]}),itemKey:"manage",children:g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx(v.Text,{strong:!0,children:T("共 {{num}} 张图片",{num:i.length})}),g.jsxs(_,{children:[g.jsx(k,{icon:g.jsx(Gt,{size:14}),size:"small",onClick:()=>{O(),R()},loading:b,children:T("刷新")}),i.length>0&&g.jsx(A,{title:T("确定要清空所有图片吗?"),content:T("此操作不可撤销"),onConfirm:H,children:g.jsx(k,{icon:g.jsx(Kt,{size:14}),type:"danger",theme:"light",size:"small",children:T("清空全部")})})]})]}),g.jsx(P,{style:{margin:"8px 0"}}),g.jsx("div",{className:"h-80 overflow-y-auto",children:0===i.length?g.jsx(B,{image:g.jsx(E,{style:{width:150,height:150}}),darkModeImage:g.jsx(M,{style:{width:150,height:150}}),title:T("暂无图片"),description:T("请先上传一些图片")}):g.jsx(q,{dataSource:i,renderItem:t=>g.jsx(q.Item,{className:"!p-3 hover:bg-gray-50 transition-colors rounded-lg",main:g.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[g.jsx("img",{src:t.url,alt:t.name,className:"w-16 h-16 object-cover rounded-lg border flex-shrink-0 cursor-pointer",onClick:()=>V(t)}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx(v.Text,{className:"text-sm font-medium block truncate",children:t.name||t.id}),g.jsxs(v.Text,{className:"text-xs text-gray-500",children:[U(t.size)," • ",new Date(t.timestamp).toLocaleString()]})]})]}),extra:g.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[g.jsx(k,{icon:g.jsx(be,{size:12}),size:"small",theme:"solid",type:"primary",onClick:()=>Y(t),className:"!w-8 !h-8 !p-0"}),g.jsx(k,{icon:g.jsx(se,{size:12}),size:"small",theme:"borderless",onClick:()=>V(t),className:"!w-8 !h-8 !p-0"}
2),g.jsx(A,{title:T("确定删除这张图片吗?"),onConfirm:()=>W(t.id),children:g.jsx(k,{icon:g.jsx(Kt,{size:12}),size:"small",theme:"borderless",type:"danger",className:"!w-8 !h-8 !p-0"})})]})},t.id)})})]})})]})})}),g.jsx(x,{title:d?.name||d?.id,visible:f,onCancel:()=>m(!1),footer:g.jsxs("div",{className:"flex justify-between",children:[g.jsx(k,{onClick:()=>m(!1),children:T("关闭")}),g.jsx(_,{children:g.jsx(k,{icon:g.jsx(be,{size:14}),type:"primary",onClick:()=>{Y(d),m(!1)},children:T("插入到地址列表")})})]}),width:"auto",style:{maxWidth:"90vw"},bodyStyle:{padding:0,textAlign:"center"},children:d&&g.jsx("img",{src:d.url,alt:d.name||d.id,style:{maxWidth:"100%",maxHeight:"80vh",objectFit:"contain",display:"block",margin:"0 auto"}})})]})},SS=({imageUrls:e,imageEnabled:r,onImageUrlsChange:i,onImageEnabledChange:n,disabled:s=!1})=>{const[a,o]=p.useState(!1),[l,c]=p.useState(!1),[h,d]=p.useState(0),u=p.useRef(null),f=e=>["image/jpeg","image/jpg","image/png","image/gif","image/webp"].includes(e.type)?!(e.size>52428800&&(y.error(t("图片大小不能超过 50MB")),1)):(y.error(t("仅支持 JPG、PNG、GIF、WebP 格式的图片")),!1),m=p.useCallback(async a=>{if(!r||s)return;const o=Array.from(a).filter(f);if(0!==o.length){c(!0),d(0);try{const t=o.length,r=[];for(let e=0;e<o.length;e++){const i=o[e];d((e+1)/t*100);try{let t=i;i.size>1048576&&(t=await Mv(i,.8,1920,1080));const e=await new Promise((e,r)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=r,i.readAsDataURL(t)}),n=Bv();await Av(n,e),r.push(e)}catch(l){console.error(`处理图片 ${i.name} 失败:`,l),y.error(`处理图片 ${i.name} 失败`)}}if(r.length>0){const t=[...e||[""]];r.forEach(e=>{const r=t.findIndex(t=>!t||""===t.trim());-1!==r?t[r]=e:t.push(e)}),i(t),n(!0),y.success(`成功上传 ${r.length} 张图片`)}}catch(l){console.error("快速上传失败:",l),y.error(t("上传图片失败"))}finally{c(!1),d(0)}}},[r,s,e,i,n]);return g.jsxs("div",{className:s?"opacity-50":"",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ke,{size:16,className:r&&!s?"text-blue-500":"text-gray-400"}),g.jsx(v.Text,{strong:!0,className:"text-sm",children:"图片地址"}),s&&g.jsx(v.Text,{className:"text-xs text-orange-600",children:"(已在自定义模式中忽略)"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(W,{checked:r,onChange:n,checkedText:"启用",uncheckedText:"停用",size:"small",className:"flex-shrink-0",disabled:s}),g.jsx(k,{icon:g.jsx(Ce,{size:14}),size:"small",theme:"outline",type:"tertiary",onClick:()=>o(!0),className:"!rounded-lg",disabled:s,children:"存储管理"}),g.jsx(k,{icon:g.jsx(be,{size:14}),size:"small",theme:"solid",type:"primary",onClick:()=>{const t=[...e,""];i(t)},className:"!rounded-full !w-4 !h-4 !p-0 !min-w-0",disabled:!r||s})]})]}),r?g.jsxs("div",{className:"mb-2",children:[g.jsx(v.Text,{className:"text-xs text-gray-500 block",children:0===e.length?s?"图片功能在自定义请求体模式下不可用":'点击"快速上传"按钮上传本地图片,或点击 + 按钮添加图片URL':`已添加 ${e.length} 张图片${s?" (自定义模式下不可用)":""}`}),l&&g.jsxs("div",{className:"mt-1",children:[g.jsxs(v.Text,{className:"text-xs text-blue-600 block mb-1",children:["上传进度: ",h.toFixed(0),"%"]}),g.jsx(D,{percent:h,size:14})]})]}):g.jsx(v.Text,{className:"text-xs text-gray-500 mb-2 block",children:s?"图片功能在自定义请求体模式下不可用":"启用后可添加图片URL或直接上传本地图片进行多模态对话"}),g.jsx("div",{className:"space-y-2 max-h-32 overflow-y-auto image-list-scroll "+(!r||s?"opacity-50":""),children:e.map((t,n)=>g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"flex-1",children:g.jsx(T,{placeholder:`https://example.com/image${n+1}.jpg`,value:t,onChange:t=>((t,r)=>{const n=[...e];n[t]=r,i(n)})(n,t),className:"!rounded-lg",size:"small",prefix:g.jsx(ve,{size:14}),disabled:!r||s})}),g.jsx(k,{icon:g.jsx(Yt,{size:12}),size:"small",theme:"borderless",type:"danger",onClick:()=>(t=>{const r=e.filter((e,r)=>r!==t);i(r)})(n),className:"!rounded-full !w-6 !h-6 !p-0 !min-w-0 !text-red-500 hover:!bg-red-50 flex-shrink-0",disabled:!r||s})]},n))}),g.jsx("input",{ref:u,type:"file",accept:"image/*",multiple:!0,onChange:t=>{const e=t.target.files;e&&e.length>0&&m(e),t.target.value=""},style:{display:"none"}}),g.jsx(vS,{visible:a,onClose:()=>o(!1),onImageSelect:t=>{const r=[...e||[""]],s=r.findIndex(t=>!t||""===t.trim());-1!==s?r[s]=t:r.push(t),i(r),n(!0)}})]})},_S=({currentConfig:t,onConfigImport:e,onConfigReset:r,styleState:i,messages:n})=>{const{t:s}=et(),a=p.useRef(null),o=()=>{try{const e={...t,timestamp:(new Date).toISOString()};localStorage.setItem("playground_config",JSON.stringify(e)),((t,e=null)=>{try{const r={...t,messages:e||Lv(),exportTime:(new Date).toISOString(),version:"1.0"},i=JSON.stringify(r,null,2),n=new Blob([i],{type:"application/json"}),s=document.createElement("a");s.href=URL.createObjectURL(n),s.download=`playground-config-${(new Date).toISOString().split("T")[0]}.json`,s.click(),URL.revokeObjectURL(s.href)}catch(r){console.error("导出配置失败:",r)}})(t,n),y.success({content:s("配置已导出到下载文件夹"),duration:3})}catch(e){y.error({content:s("导出配置失败: ")+e.message,duration:3})}},l=()=>{a.current?.click()},c=async t=>{const r=t.target.files[0];if(r)try{const t=await(t=>new Promise((e,r)=>{try{const i=new FileReader;i.onload=t=>{try{const i=JSON.parse(t.target.result);i.inputs&&i.parameterEnabled?(i.messages&&Array.isArray(i.messages)&&Ev(i.messages),e(i)):r(new Error("配置文件格式无效"))}catch(i){r(new Error("解析配置文件失败: "+i.message))}},i.onerror=()=>r(new Error("读取文件失败")),i.readAsText(t)}catch(i){r(new Error("导入配置失败: "+i.message))}}))(r);x.confirm({title:s("确认导入配置"),content:s("导入的配置将覆盖当前设置,是否继续?"),okText:s("确定导入"),cancelText:s("取消"),onOk:()=>{e(t),y.success({content:s("配置导入成功"),duration:3})}})}catch(i){y.error({content:s("导入配置失败: ")+i.message,duration:3})}finally{t.target.value=""}},h=()=>{x.confirm({title:s("重置配置"),content:s("将清除所有保存的配置并恢复默认设置,此操作不可撤销。是否继续?"),okText:s("确定重置"),cancelText:s("取消"),okButtonProps:{type:"danger"},onOk:()=>
2{x.confirm({title:s("重置选项"),content:s('是否同时重置对话消息?选择"是"将清空所有对话记录并恢复默认示例;选择"否"将保留当前对话记录。'),okText:s("同时重置消息"),cancelText:s("仅重置配置"),okButtonProps:{type:"danger"},onOk:async()=>{await jv(),r({resetMessages:!0}),y.success({content:s("配置和消息已全部重置"),duration:3})},onCancel:async()=>{await jv(),r({resetMessages:!1}),y.success({content:s("配置已重置,对话消息已保留"),duration:3})}})}})},d=[{node:"item",name:"export",onClick:o,children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Se,{size:14}),s("导出配置")]})},{node:"item",name:"import",onClick:l,children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(xe,{size:14}),s("导入配置")]})},{node:"divider"},{node:"item",name:"reset",onClick:h,children:g.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[g.jsx(_e,{size:14}),s("重置配置")]})}];return i.isMobile?g.jsxs(g.Fragment,{children:[g.jsx(I,{trigger:"click",position:"bottomLeft",showTick:!0,menu:d,children:g.jsx(k,{icon:g.jsx(Te,{size:14}),theme:"borderless",type:"tertiary",size:"small",className:"!rounded-lg !text-gray-600 hover:!text-blue-600 hover:!bg-blue-50"})}),g.jsx("input",{ref:a,type:"file",accept:".json",onChange:c,style:{display:"none"}})]}):g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx(v.Text,{className:"text-xs text-gray-500",children:(()=>{if((()=>{try{return null!==localStorage.getItem(Q.CONFIG)}catch(t){return console.error("检查配置失败:",t),!1}})()){const t=(()=>{try{const t=localStorage.getItem(Q.CONFIG);if(t)return JSON.parse(t).timestamp||null}catch(t){console.error("获取配置时间戳失败:",t)}return null})();if(t){const e=new Date(t);return s("上次保存: ")+e.toLocaleString()}return s("已有保存的配置")}return s("暂无保存的配置")})()}),g.jsx(k,{icon:g.jsx(_e,{size:12}),size:"small",theme:"borderless",type:"danger",onClick:h,className:"!rounded-full !text-xs !px-2"})]}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(k,{icon:g.jsx(Se,{size:12}),size:"small",theme:"solid",type:"primary",onClick:o,className:"!rounded-lg flex-1 !text-xs !h-7",children:s("导出")}),g.jsx(k,{icon:g.jsx(xe,{size:12}),size:"small",theme:"outline",type:"primary",onClick:l,className:"!rounded-lg flex-1 !text-xs !h-7",children:s("导入")})]}),g.jsx("input",{ref:a,type:"file",accept:".json",onChange:c,style:{display:"none"}})]})},TS=({customRequestMode:t,customRequestBody:e,onCustomRequestModeChange:r,onCustomRequestBodyChange:i,defaultPayload:n})=>{const{t:s}=et(),[a,o]=p.useState(!0),[l,c]=p.useState(""),[h,d]=p.useState(e||"");p.useEffect(()=>{if(t&&(!e||""===e.trim())){const t=n?JSON.stringify(n,null,2):"";d(t),i(t)}},[t,n,e,i]),p.useEffect(()=>{e!==h&&(d(e||""),u(e||""))},[e]);const u=t=>{if(!t.trim())return o(!0),c(""),!0;try{return JSON.parse(t),o(!0),c(""),!0}catch(e){return o(!1),c(`${s("JSON格式错误")}: ${e.message}`),!1}};return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ne,{size:16,className:"text-gray-500"}),g.jsx(v.Text,{strong:!0,className:"text-sm",children:s("自定义请求体模式")})]}),g.jsx(W,{checked:t,onChange:t=>{if(r(t),t&&n){const t=JSON.stringify(n,null,2);d(t),i(t)}},checkedText:s("开"),uncheckedText:s("关"),size:"small"})]}),t&&g.jsxs(g.Fragment,{children:[g.jsx(H,{type:"warning",description:s("启用此模式后,将使用您自定义的请求体发送API请求,模型配置面板的参数设置将被忽略。"),icon:g.jsx(Ae,{size:16}),className:"!rounded-lg",closable:!1}),g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsx(v.Text,{strong:!0,className:"text-sm",children:s("请求体 JSON")}),g.jsxs("div",{className:"flex items-center gap-2",children:[a?g.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[g.jsx(Ut,{size:14}),g.jsx(v.Text,{className:"text-xs",children:s("格式正确")})]}):g.jsxs("div",{className:"flex items-center gap-1 text-red-600",children:[g.jsx(Yt,{size:14}),g.jsx(v.Text,{className:"text-xs",children:s("格式错误")})]}),g.jsx(k,{theme:"borderless",type:"tertiary",size:"small",icon:g.jsx(Jt,{size:14}),onClick:()=>{try{const t=JSON.parse(h),e=JSON.stringify(t,null,2);d(e),i(e),o(!0),c("")}catch(t){}},disabled:!a,className:"!rounded-lg",children:s("格式化")})]})]}),g.jsx(S,{value:h,onChange:t=>{d(t),u(t),i(t)},placeholder:'{"model": "gpt-4o", "messages": [...], ...}',autosize:{minRows:8,maxRows:20},className:"custom-request-textarea !rounded-lg font-mono text-sm "+(a?"":"!border-red-500"),style:{fontFamily:'Consolas, Monaco, "Courier New", monospace',lineHeight:"1.5"}}),!a&&l&&g.jsx(v.Text,{type:"danger",className:"text-xs mt-1 block",children:l}),g.jsx(v.Text,{className:"text-xs text-gray-500 mt-2 block",children:s("请输入有效的JSON格式的请求体。您可以参考预览面板中的默认请求体格式。")})]})]})]})},AS=({visible:t,onClose:e,inputs:r,parameterEnabled:i,models:n,groups:s,styleState:a,showDebugPanel:o,customRequestMode:l,customRequestBody:c,onInputChange:h,onParameterToggle:d,onConfigImport:u,onConfigReset:f,onCustomRequestModeChange:m,onCustomRequestBodyChange:y,previewPayload:x,messages:b})=>{const{t:C}=et(),[w,k]=p.useState("model"),[S,_]=p.useState(!0),T={inputs:r,parameterEnabled:i,showDebugPanel:o,customRequestMode:l,customRequestBody:c},A={border:"1px solid rgba(28,31,35,0.06)",borderRadius:12};return g.jsx(V,{title:C("模型参数"),visible:t,onCancel:e,placement:"right",width:a?.isMobile?"100%":400,bodyStyle:{padding:0,display:"flex",flexDirection:"column",height:"100%"},headerStyle:{borderBottom:"1px solid hsl(var(--border))"},children:g.jsxs("div",{className:"model-settings custom-scrollbar",style:{padding:a?.isMobile?12:16,height:"100%",overflowY:"auto",display:"flex",flexDirection:"column",gap:a?.isMobile?12:14},children:[a?.isMobile&&g.jsx("div",{className:"mb-2",children:g.jsx(_S,{currentConfig:T,onConfigImport:u,onConfigReset:f,styleState:{...a,isMobile:!1},messages:b})}),g.jsx(TS,{customRequestMode:l,customRequestBody:c,onCustomRequestModeChange:m,onCustomRequestBodyChange:y,defaultPayload:x}),g.jsx("div",{className:"!w-full flex items-center mb-2 font-bold",children:g.jsx(O,{value:w,onChange:k,optionList:[{label:C("模型设置"),value:"model"},{label:C("图片设置"),value:"image"}],size:"small",style:{width:"100%",height:"38px",background:"transparent"},dropdownStyle:{width:"100%",maxWidth:"100%"},className:"settings-view-select !rounded-lg"})}),"image"===w&&g.jsx("div",{className:l?"opacity-50":"",style:{...A,padding:a?.isMobile?12:14},children:g.jsx(SS,{imageUrls:r.imageUrls,imageEnabled:r.imageEnabled,onImageUrlsChange:t=>h("imageUrls",t),onImageEnabledChange:t=>h("imageEnabled",t),disabled:l})}),"model"===w&&g.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr",gap:a?.isMobile?10:12},children:[g.jsx(O,{placeholder:C("请选择分组"),name:"group",required:!0,selection:!0,onChange:t=>h("group",t),value:r.group,autoComplete:"new-password",optionList:s,renderOptionItem:St,style:{width:"100%",height:"38px",background:a?.isMobile?"hsl(var(--card))":"transparent",border:"1px solid hsl(var(--border))"},dropdownStyle:{width:"100%",maxWidth:"100%"},className:"group-select !rounded-lg",renderSelectedItem:t=>{const e=t?.value??t,r=Array.isArray(s)?s.find(t=>t.value===e):null,i=r?.ratio,n="string"==typeof e?e:t?.label||"";return g.jsxs("div",{className:"group-selected","aria-label":n,children:[g.jsxs("span",{className:"group-pill name",role:"text",children:[g.jsx("img",{src:dS,alt:"check",className:"w-4 h-4 mr-1"}),n]}),void 0!==i&&g.jsxs("span",{className:"group-pill ratio",role:"text",children:[g.jsx("span",{className:"w-[6px] h-[6px] bg-success rounded-full mr-[5px]"}),`${i}${C("倍")}`]})]})},disabled:l}),g.jsx(O,{placeholder:C("请选择模型"),name:"model",required:!0,selection:!0,searchPosition:"dropdown",filter:!0,onChange:t=>h("model",t),value:r.model,autoComplete:"new-password",optionList:n,style:{width:"100%",height:"38px",background:a?.isMobile?"hsl(var(--card))":"transparent",border:"1px solid hsl(var(--border))"},dropdownStyle:{width:"100%",maxWidth:"100%"},className:"!rounded-lg",disabled:l})]}),g.jsx("div",{className:"h-[1px] bg-border rounded-[0px_0px_0px_0px] mt-[2px] mb-[10px]"}),g.jsxs("div",{className:"flex items-center justify-between settings-header px-[10px]",children:[g.jsx("div",{className:"flex items-center gap-2",children:g.jsx(v.Text,{strong:!0,className:"text-sm",children:C("参数配置")})}),g.jsx("div",{className:"toggle-arrow",onClick:()=>_(!S),style:{display:"flex",alignItems:"center",cursor:"pointer"},children:S?g.jsx(Ht,{size:18}):g.jsx(ie,{size:18})})]}),S&&g.jsxs("div",{className:l?"opacity-50":"",style:{...A,padding:a?.isMobile?12:14},children:[g.jsx(wS,{inputs:r,parameterEnabled:i,onInputChange:h,onParameterToggle:d,disabled:l}),g.jsx("div",{className:"h-[1px] bg-border rounded-[0px_0px_0px_0px] my-4"}),g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2 settings-header",children:[g.jsx(Be,{size:16,className:"text-muted-foreground"}),g.jsx(v.Text,{strong:!0,className:"text-sm",children:C("流式输出")}),l&&g.jsx(v.Text,{className:"text-xs text-warning",children:C("(已在自定义模式中忽略)")})]}),g.jsx(W,{checked:r.stream,onChange:t=>h("stream",t),checkedText:C("开"),uncheckedText:C("关"),size:"small",disabled:l})]})]}),!a?.isMobile&&g.jsx("div",{className:"pt-3 border-t border-border",children:g.jsx(_S,{currentConfig:T,onConfigImport:u,onConfigReset:f,styleState:a,messages:b})})]})})},BS=({visible:t,onClose:e,debugData:r,activeDebugTab:i,onActiveDebugTabChange:n,styleState:s,customRequestMode:
2a})=>{const{t:o}=et();return g.jsx(V,{title:o("查看代码"),visible:t,onCancel:e,placement:"right",width:s?.isMobile?"100%":480,bodyStyle:{padding:0,display:"flex",flexDirection:"column",height:"100%"},headerStyle:{borderBottom:"1px solid hsl(var(--border))"},children:g.jsx(cS,{debugData:r,activeDebugTab:i,onActiveDebugTabChange:n,styleState:s,customRequestMode:a,showDebugPanel:t,onCloseDebugPanel:e})})},MS=t=>{if(!t)return"https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/docs-icon.png";const e=t[0].toUpperCase(),r=jt(t);return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(`\n    <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n      <circle cx="16" cy="16" r="16" fill="${r}" />\n      <text x="50%" y="50%" dominant-baseline="central" text-anchor="middle" font-size="16" fill="#ffffff" font-family="sans-serif">${e}</text>\n    </svg>\n  `)}`},ES=Object.freeze(Object.defineProperty({__proto__:null,default:()=>{const{t}=et(),[e]=p.useContext(Et),r=_t(),i={isMobile:r},[n]=m(),s=p.useRef([]),a=p.useRef([]),o=(()=>{const{i18n:t}=et(),[e,r]=p.useState(!1),[i,n]=p.useState(!1),[s,a]=p.useState(tt),[o,l]=p.useState(()=>rt()),[c,h]=p.useState(s.inputs||tt.inputs),[d,u]=p.useState(s.parameterEnabled||tt.parameterEnabled),[g,f]=p.useState(s.showDebugPanel||tt.showDebugPanel),[m,y]=p.useState(s.customRequestMode||tt.customRequestMode),[x,b]=p.useState(s.customRequestBody||tt.customRequestBody),[C,w]=p.useState(!1),[k,v]=p.useState([]),[S,_]=p.useState([]),[T,A]=p.useState({}),[B,M]=p.useState(o),[E,L]=p.useState({request:null,response:null,timestamp:null,previewRequest:null,previewTimestamp:null}),[j,F]=p.useState(it.PREVIEW),[N,I]=p.useState(null),[O,D]=p.useState(null),[R,z]=p.useState(""),$=p.useRef(null),P=p.useRef(null),q=p.useRef(null);p.useRef(null);const W=p.useCallback((t,e)=>{h(r=>({...r,[t]:e}))},[]),H=p.useCallback(t=>{u(e=>{const r=!e[t];return"context_length"!==t||r||h(t=>({...t,context_length:0})),{...e,[t]:r}})},[]),V=p.useCallback(async t=>{try{await Ev(t||B)}catch(e){console.error("立即保存消息失败:",e)}},[B]),Y=p.useCallback(()=>{q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{(async t=>{try{const r={...t,timestamp:(new Date).toISOString()};try{await(async t=>{try{const e={key:"playground_config",config:t,timestamp:(new Date).toISOString()};await Tv(kv,"readwrite",t=>t.put(e))}catch(e){throw console.error("保存配置到 IndexedDB 失败:",e),e}})(r)}catch(e){console.warn("IndexedDB 保存失败,使用 localStorage 备用:",e),localStorage.setItem(Q.CONFIG,JSON.stringify(r))}}catch(r){console.error("保存配置失败:",r)}})({inputs:c,parameterEnabled:d,showDebugPanel:g,customRequestMode:m,customRequestBody:x})},1e3)},[c,d,g,m,x]),U=p.useCallback(t=>{t.inputs&&h(e=>({...e,...t.inputs})),t.parameterEnabled&&u(e=>({...e,...t.parameterEnabled})),"boolean"==typeof t.showDebugPanel&&f(t.showDebugPanel),t.customRequestMode&&y(t.customRequestMode),t.customRequestBody&&b(t.customRequestBody),t.messages&&Array.isArray(t.messages)&&M(t.messages)},[]),G=p.useCallback((t={})=>{const{resetMessages:e=!1}=t;h(tt.inputs),u(tt.parameterEnabled),f(tt.showDebugPanel),y(tt.customRequestMode),b(tt.customRequestBody),e&&(M([]),setTimeout(()=>{M(rt())},0))},[]);return p.useEffect(()=>()=>{q.current&&clearTimeout(q.current)},[]),p.useEffect(()=>{(async()=>{try{const t=await(async()=>{try{let e=null;try{const t=await(async()=>{try{const t=await Tv(kv,"readonly",t=>t.get("playground_config"));return t&&t.config?t.config:null}catch(t){return console.error("从 IndexedDB 加载配置失败:",t),null}})();t&&(e=t)}catch(t){console.warn("IndexedDB 加载配置失败,尝试 localStorage:",t)}if(!e){const t=localStorage.getItem(Q.CONFIG);t&&(e=JSON.parse(t))}if(e)return{inputs:{...tt.inputs,...e.inputs},parameterEnabled:{...tt.parameterEnabled,...e.parameterEnabled},showDebugPanel:e.showDebugPanel||tt.showDebugPanel,customRequestMode:e.customRequestMode||tt.customRequestMode,customRequestBody:e.customRequestBody||tt.customRequestBody}}catch(e){console.error("加载配置失败:",e)}return tt})();a(t),r(!0);const e=await Lv();e&&(l(e),M(e)),n(!0)}catch(t){console.error("加载初始数据失败:",t),r(!0),n(!0)}})()},[]),p.useEffect(()=>{if(!i||!Array.isArray(B)||0===B.length)return;const t=B[B.length-1];if(t.status===nt.LOADING||t.status===nt.INCOMPLETE){const e=st(t.content||"",t.reasoningContent||""),r={...t,status:nt.COMPLETE,content:e.content,reasoningContent:e.reasoningContent||null,isThinkingComplete:!0},i=[...B.slice(0,-1),r];M(i),setTimeout(()=>V(i),0)}},[i]),p.useEffect(()=>
2{if(i&&2===B.length&&"2"===B[0]?.id&&B[0]?.role===at.USER&&"3"===B[1]?.id&&B[1]?.role===at.ASSISTANT){const t=rt();(B[0].content!==t[0].content||B[1].content!==t[1].content)&&(M(t),setTimeout(()=>V(t),0))}},[t.language,i,B,V]),{inputs:c,parameterEnabled:d,showDebugPanel:g,customRequestMode:m,customRequestBody:x,showSettings:C,models:k,groups:S,status:T,message:B,debugData:E,activeDebugTab:j,previewPayload:N,editingMessageId:O,editValue:R,configLoaded:e,messagesLoaded:i,isDataLoaded:e&&i,sseSourceRef:$,chatRef:P,saveConfigTimeoutRef:q,setInputs:h,setParameterEnabled:u,setShowDebugPanel:f,setCustomRequestMode:y,setCustomRequestBody:b,setShowSettings:w,setModels:v,setGroups:_,setStatus:A,setMessage:M,setDebugData:L,setActiveDebugTab:F,setPreviewPayload:I,setEditingMessageId:D,setEditValue:z,handleInputChange:W,handleParameterToggle:H,debouncedSaveConfig:Y,saveMessagesImmediately:V,handleConfigImport:U,handleConfigReset:G}})(),{inputs:l,parameterEnabled:c,showDebugPanel:h,customRequestMode:d,customRequestBody:u,showSettings:b,models:C,groups:w,message:k,debugData:v,activeDebugTab:S,previewPayload:_,sseSourceRef:T,chatRef:A,handleInputChange:B,handleParameterToggle:M,debouncedSaveConfig:E,saveMessagesImmediately:L,handleConfigImport:j,handleConfigReset:F,setShowSettings:N,setModels:I,setGroups:O,setMessage:D,setDebugData:R,setActiveDebugTab:z,setPreviewPayload:$,setShowDebugPanel:P,setCustomRequestMode:q,setCustomRequestBody:W}=o,H=e?.user?.id,{favoriteModels:V,toggleFavoriteModel:U}=(t=>{const{t:e}=et(),[r,i]=p.useState([]),n=p.useRef([]),s=p.useRef([]),a=p.useRef(new Map),o=p.useRef(new Map),l=p.useRef(new Map),c=p.useRef(null),h=p.useCallback((t,e)=>{const r=t.filter(Boolean);n.current=r,p.startTransition(()=>{i(r)}),e&&function(t,e){if(t&&!(t<=0))try{const r=Array.isArray(e)?e.filter(t=>"string"==typeof t&&t):[];localStorage.setItem(Nv(t),JSON.stringify(r))}catch{}}(e,r)},[]),d=p.useCallback((t,e)=>{const r=(t||[]).filter(Boolean);s.current=r,h(r,e)},[h]),u=p.useCallback(async()=>{const e=Iv(t);if(!e)return s.current=[],n.current=[],void i([]);try{const t=await ft.get(ct.FAVORITE_MODELS),{success:r,data:i}=t.data||{};r&&Array.isArray(i)&&d(i,e)}catch(r){console.error("加载收藏模型失败:",r)}},[t,d]);p.useEffect(()=>{const e=Iv(t);if(c.current=e,!e)return s.current=[],n.current=[],void i([]);const r=function(t){if(!t||t<=0)return null;try{const e=localStorage.getItem(Nv(t));if(!e)return null;const r=JSON.parse(e);return Array.isArray(r)?r.filter(t=>"string"==typeof t&&t):null}catch{return null}}(e);return r&&(n.current=r,p.startTransition(()=>{i(r)})),u(),()=>{l.current.forEach(t=>clearTimeout(t)),l.current.clear(),o.current.forEach(t=>t.abort()),o.current.clear()}},[t,u]);const g=p.useCallback(r=>{const i=c.current??Iv(t);if(!i||!r)return;if(Ov(n.current,r)===Ov(s.current,r))return;const l=(a.current.get(r)||0)+1;a.current.set(r,l),o.current.get(r)?.abort();const h=new AbortController;o.current.set(r,h),ft.post(ct.FAVORITE_MODELS_TOGGLE,{model:r},{signal:h.signal}).then(t=>{if(a.current.get(r)!==l)return;const{success:o,data:c,message:h,code:p}=t.data||{};if(!o)return console.error("切换收藏模型失败:",h||t.data),Dv(h,r,{code:p,response:t.data}),p===bt.LIMIT?y.warning(e(lt.FAVORITE_LIMIT)):y.error(e(lt.FAVORITE_NETWORK_RETRY)),d(s.current,i),void u();if(c&&"boolean"==typeof c.favorited&&c.model){const{favorited:t,model:r}=c,i=[...s.current];return t?(s.current=[r,...i.filter(t=>t!==r)],y.success(e(lt.FAVORITE_ADDED))):(s.current=i.filter(t=>t!==r),y.success(e(lt.FAVORITE_REMOVED))),void(Ov(n.current,r)!==t&&g(r))}Array.isArray(c)&&d(c,i)}).catch(t=>{if(function(t){return"ERR_CANCELED"===t?.code||"CanceledError"===t?.name}(t))return;if(a.current.get(r)!==l)return;const n=t?.response?.data?.message,o=n||t?.message||String(t);console.error("切换收藏模型失败:",o,t),Dv(o,r,{code:t?.code,response:t?.response?.data}),y.error(e(lt.FAVORITE_NETWORK_RETRY)),d(s.current,i),u()}).finally(()=>{o.current.get(r)===h&&o.current.delete(r)})},[t,u,d,e]),f=p.useCallback(t=>{const e=l.current.get(t);e&&clearTimeout(e);const r=setTimeout(()=>{l.current.delete(t),g(t)},300);l.current.set(t,r)},[g]);return{favoriteModels:r,toggleFavoriteModel:p.useCallback(e=>{const r=Iv(t);if(!e||!r)return;c.current=r;const i=n.current,s=i.includes(e)?i.filter(t=>t!==e):[e,...i.filter(t=>t!==e)];h(s,r),f(e)},[t,h,f]),refreshFavoriteModels:u}})(H),[G,J]=f.useState(!1),[X,K]=f.useState(320),[Z,Ct]=f.useState(!1),[wt,kt]=f.useState(!1),[vt,St]=f.useState("chat"),{send
2Request:Tt,onStopGenerator:Bt}=((t,e,r,i,n)=>{const{t:s}=et(),a=p.useCallback((t,e=!0)=>{const r=e&&!t.hasAutoCollapsed;return{isThinkingComplete:e,hasAutoCollapsed:r||t.hasAutoCollapsed,isReasoningExpanded:!r&&t.isReasoningExpanded}},[]),o=p.useCallback((e,r)=>{t(t=>{const i=t[t.length-1];if(!i)return t;if("assistant"!==i.role)return t;if(i.status===nt.ERROR)return t;if(i.status===nt.LOADING||i.status===nt.INCOMPLETE){let n={...i};if("reasoning"===r)n={...n,reasoningContent:(i.reasoningContent||"")+e,status:nt.INCOMPLETE,isThinkingComplete:!1};else if("content"===r){!i.content&&i.reasoningContent;const t=(i.content||"")+e;let r=i.isThinkingComplete;if(i.isReasoningExpanded&&t.includes("</think>")){const e=t.match(/<think>/g),i=t.match(/<\/think>/g);e&&i&&i.length>=e.length&&(r=!0)}const s=i.reasoningContent&&!i.isThinkingComplete||r,o=a(i,s);n={...n,content:t,status:nt.INCOMPLETE,...o}}return[...t.slice(0,-1),n]}return t})},[t,a]),l=p.useCallback((e=nt.COMPLETE)=>{t(t=>{const r=t[t.length-1];if(r.status===nt.COMPLETE||r.status===nt.ERROR)return t;const i=a(r,!0),s=[...t.slice(0,-1),{...r,status:e,...i}];return e!==nt.COMPLETE&&e!==nt.ERROR||setTimeout(()=>n(s),0),s})},[t,a,n]),c=p.useCallback(async i=>{e(t=>({...t,request:i,timestamp:(new Date).toISOString(),response:null})),r(it.REQUEST);try{const s=await fetch(ct.CHAT_COMPLETIONS,{method:"POST",headers:{"Content-Type":"application/json","New-Api-User":ht()},body:JSON.stringify(i)});if(!s.ok){let t="";try{t=await s.text()}catch(n){t="无法读取错误响应体"}const i=dt(new Error(`HTTP error! status: ${s.status}, body: ${t}`),s);throw e(t=>({...t,response:JSON.stringify(i,null,2)})),r(it.RESPONSE),new Error(`HTTP error! status: ${s.status}, body: ${t}`)}const o=await s.json();if(e(t=>({...t,response:JSON.stringify(o,null,2)})),r(it.RESPONSE),o.choices?.[0]){const e=o.choices[0];let r=e.message?.content||"",i=e.message?.reasoning_content||"";const n=ut(r,i);t(t=>{const e=[...t],r=e[e.length-1];if(r?.status===nt.LOADING){const t=a(r,!0);e[e.length-1]={...r,content:n.content,reasoningContent:n.reasoningContent,status:nt.COMPLETE,...t}}return e})}}catch(o){console.error("Non-stream request error:",o);const i=dt(o);e(t=>({...t,response:JSON.stringify(i,null,2)})),r(it.RESPONSE),t(t=>{const e=[...t],r=e[e.length-1];if(r?.status===nt.LOADING){const t=a(r,!0);e[e.length-1]={...r,content:s("请求发生错误")+": "+o.message,status:nt.ERROR,...t}}return e})}},[e,r,t,s,a]),h=p.useCallback(t=>{e(e=>({...e,request:t,timestamp:(new Date).toISOString(),response:null})),r(it.REQUEST);const n=new Fv(ct.CHAT_COMPLETIONS,{headers:{"Content-Type":"application/json","New-Api-User":ht()},method:"POST",payload:JSON.stringify(t)});i.current=n;let a="",c=!1,h=!1;n.addEventListener("message",t=>{if("[DONE]"===t.data)return h=!0,n.close(),i.current=null,e(t=>({...t,response:a})),void l();try{const e=JSON.parse(t.data);a+=t.data+"\n",c||(r(it.RESPONSE),c=!0);const i=e.choices?.[0]?.delta;i&&(i.reasoning_content&&o(i.reasoning_content,"reasoning"),i.content&&o(i.content,"content"))}catch(d){console.error("Failed to parse SSE message:",d);const t=`解析错误: ${d.message}`;e(e=>({...e,response:a+`\n\nError: ${t}`})),r(it.RESPONSE),o(s("解析响应数据时发生错误"),"content"),l(nt.ERROR)}}),n.addEventListener("error",t=>{if(!h&&2!==n.readyState){console.error("SSE Error:",t);const c=t.data||s("请求发生错误"),h=dt(new Error(c));h.readyState=n.readyState,e(t=>({...t,response:a+"\n\nSSE Error:\n"+JSON.stringify(h,null,2)})),r(it.RESPONSE),o(c,"content"),l(nt.ERROR),i.current=null,n.close()}}),n.addEventListener("readystatechange",t=>{if(t.readyState>=2&&void 0!==n.status&&200!==n.status&&!h){const t=dt(new Error("HTTP状态错误"));t.status=n.status,t.readyState=n.readyState,e(e=>({...e,response:a+"\n\nHTTP Error:\n"+JSON.stringify(t,null,2)})),r(it.RESPONSE),n.close(),o(s("连接已断开"),"content"),l(nt.ERROR)}});try{n.stream()}catch(d){console.error("Failed to start SSE stream:",d);const t=dt(d);e(e=>({...e,response:"Stream启动失败:\n"+JSON.stringify(t,null,2)})),r(it.RESPONSE),o(s("建立连接时发生错误"),"content"),l(nt.ERROR)}},[e,r,o,l,s,a]),d=p.useCallback(()=>{i.current&&(i.current.close(),i.current=null),t(t=>{if(0===t.length)return t;const e=t[t.length-1];if(e.status===nt.LOADING||e.status===nt.INCOMPLETE){const r=st(e.content||"",e.reasoningContent||""),i=a(e,!0),s=[...t.slice(0,-1),{...e,status:nt.COMPLETE,reasoningContent:r.reasoningContent||null,content:r.content,...i}];return setTimeout(()=>n(s),0),s}return t})},[t,a,n]);return{sendRequest:p.useCallback((t,e)=>{e?h(t):c(t)}
2,[h,c]),onStopGenerator:d,streamMessageUpdate:o,completeMessage:l}})(D,R,z,T,L);((t,e,r,i,n)=>{const{t:s}=et(),a=p.useCallback(async()=>{try{const t=`${ct.USER_MODELS}${e.group?`?group=${encodeURIComponent(e.group)}`:""}`,n=await ft.get(t),{success:a,message:o,data:l}=n.data;if(a){const{modelOptions:t,selectedModel:n}=mt(l,e.model);i(t),n!==e.model&&r("model",n)}else yt(s(o))}catch(t){yt(s("加载模型失败"))}},[e.group,e.model,r,i,s]),o=p.useCallback(async()=>{try{const i=await ft.get(ct.USER_GROUPS),{success:a,message:o,data:l}=i.data;if(a){let i={},a={};if(l&&l.data&&l.ratios)i=l.data,a=l.ratios;else{if(!l||"object"!=typeof l)return console.error("🎯 useDataLoader:未知的API响应格式",l),void yt(s("分组数据格式错误"));i=l,a={}}const o=t?.user?.group||JSON.parse(localStorage.getItem("user"))?.group,c=xt(i,a,o);n(c),c.some(t=>t.value===e.group)||r("group",c[0]?.value||"")}else yt(s(o))}catch(i){yt(s("加载分组失败"))}},[t,e.group,r,n,s]);p.useEffect(()=>{t?.user&&(a(),o())},[t?.user,a,o])})(e,l,B,I,O);const{editingMessageId:Mt,editValue:jt,setEditValue:Nt,handleMessageEdit:It,handleEditSave:Ot,handleEditCancel:Dt}=((t,e,r,i,n)=>{const{t:s}=et(),[a,o]=p.useState(null),[l,c]=p.useState(""),h=p.useRef(null),d=p.useCallback(t=>{const e=ot(t);o(t.id),h.current=t,c(e)},[]),u=p.useCallback(()=>{a&&l.trim()&&(t(o=>{let c=o.findIndex(t=>t===h.current);-1===c&&(c=o.findIndex(t=>t.id===a));const d=o[c];let u;u=Array.isArray(d.content)?d.content.map(t=>"text"===t.type?{...t,text:l.trim()}:t):l.trim();const p=o.map(t=>t.id===a?{...t,content:u}:t);return d.role===at.USER&&c<o.length-1&&o[c+1].role===at.ASSISTANT?(x.confirm({title:s("消息已编辑"),content:s("检测到该消息后有AI回复,是否删除后续回复并重新生成?"),okText:s("重新生成"),cancelText:s("仅保存"),onOk:()=>{const s=p.slice(0,c+1);t(s),setTimeout(()=>n(s),0),setTimeout(()=>{const n=pt(s,null,e,r);t(t=>[...t,gt()]),i(n,e.stream)},100)},onCancel:()=>{t(p),setTimeout(()=>n(p),0)}}),o):(setTimeout(()=>n(p),0),p)}),o(null),h.current=null,c(""),y.success({content:s("消息已更新"),duration:2}))},[a,l,s,e,r,i,t,n]),g=p.useCallback(()=>{o(null),h.current=null,c("")},[]);return{editingMessageId:a,editValue:l,setEditValue:c,handleMessageEdit:d,handleEditSave:u,handleEditCancel:g}})(D,l,c,Tt,L),Rt=((t,e=50)=>{const[r,i]=p.useState(e),n=p.useRef(t.length),s=p.useMemo(()=>Array.isArray(t)?t.length<=r?t:t.slice(-r):[],[t,r]),a=p.useMemo(()=>t.length>r,[t.length,r]),o=p.useMemo(()=>Math.max(0,t.length-r),[t.length,r]),l=p.useCallback((t=5)=>{i(e=>e+t)},[]),c=p.useCallback(()=>{i(t.length)},[t.length]),h=p.useCallback(()=>{i(e)},[e]);return p.useEffect(()=>{const r=n.current,s=t.length;(s<.5*r||r-s>10||0===r&&s>0)&&i(e),n.current=s},[t.length,e]),{displayedMessages:s,displayCount:r,hasMore:a,remainingCount:o,loadMore:l,loadAll:c,reset:h,totalCount:t.length}})(k,50),{syncMessageToCustomBody:zt,syncCustomBodyToMessage:$t}=((t,e,r,i,n,s,a)=>{const o=p.useRef(!1),l=p.useRef(!1),c=p.useRef(""),h=p.useRef(""),d=p.useCallback(t=>JSON.stringify(t.map(t=>({id:t.id,role:t.role,content:t.content}))),[]),u=p.useCallback(t=>{try{const e=JSON.parse(t);return JSON.stringify(e.messages||[])}catch{return""}},[]);return{syncMessageToCustomBody:p.useCallback(()=>{if(!t||l.current)return;const s=d(r);if(s!==c.current)try{let t;o.current=!0;try{t=JSON.parse(e||"{}")}catch{t={model:i.model||"gpt-4o",messages:[],temperature:i.temperature||1,stream:!1!==i.stream}}t.messages=r.map(t=>({role:t.role,content:t.content}));const l=JSON.stringify(t,null,2);n(l),c.current=s,h.current=u(l),setTimeout(()=>{a()},0)}finally{o.current=!1}},[t,e,r,i.model,i.temperature,i.stream,d,u,n,a]),syncCustomBodyToMessage:p.useCallback(()=>{if(!t||o.current)return;const r=u(e);if(r!==h.current)try{l.current=!0;const t=JSON.parse(e||"{}");if(t.messages&&Array.isArray(t.messages)){const e=t.messages.map((t,e)=>({id:t.id||(e+1).toString(),role:t.role||at.USER,content:t.content||"",createAt:Date.now(),...t.role===at.ASSISTANT&&{reasoningContent:t.reasoningContent||"",isReasoningExpanded:!1}}));s(e),h.current=r,c.current=d(e)}}catch(i){console.warn("同步自定义请求体到消息失败:",i)}finally{l.current=!1}},[t,e,u,d,s])}})(d,u,k,l,W,D,E),Pt={user:{name:e?.user?.username||"User",avatar:MS(e?.user?.username)},assistant:{name:"Assistant",avatar:At()},system:{name:"System",avatar:At()}},qt=((t,e,r,i)=>{const{t:n}=et();return{handleMessageCopy:p.useCallback(t=>{const e=ot(t);if(!e)return void y.warning({content:n(lt.NO_TEXT_CONTENT),duration:2});const r=t=>{try{const e=document.createElement("textarea");e.value=t,e.style.cssText="\n          position: fixed;\n          top: -9999px;\n          left: -9999px;\n          opacity: 0;\n          pointer-events: none;\n          z-index: -1;\n        ",e.setAttribute("readonly",""),document.body.appendChild(e),e.select(),e.setSelectionRange(0,t.length);const r=document.execCommand("copy");if(document.body.removeChild(e),!r)throw new Error("execCommand copy failed");y.success({content:n("消息已复制到剪贴板"),duration:2})}catch(e){console.error("回退复制方案也失败:",e);let t=n(lt.COPY_FAILED);"http:"===window.location.protocol&&"localhost"!==window.location.hostname?t=n(lt.COPY_HTTPS_REQUIRED):navigator.clipboard||document.execCommand||(t=n(lt.BROWSER_NOT_SUPPORTED)),y.error({content:t,duration:4})}};(async t=>{if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(t),y.success({content:n("消息已复制到剪贴板"),duration:2})}catch(e){console.error("Clipboard API 复制失败:",e),r(t)}else r(t)})(e)},[n]),handleMessageReset:p.useCallback(t=>{e(e=>{let i=e.findIndex(e=>e===t);if(-1===i&&(i=e.findIndex(e=>e.id===t.id)),-1===i)return e;if("user"===t.role){const n=e.slice(0,i),s=ot(t);return setTimeout(()=>{r(s)},100),n}if("assistant"===t.role||"system"===t.role){let t=i-1;for(;t>=0&&"user"!==e[t].role;)t--;if(t>=0){const i=e[t],n=e.slice(0,t),s=ot(i);return setTimeout(()=>{r(s)},100),n}}return e})},[e,r]),handleMessageDelete:p.useCallback(t=>{x.confirm({title:n("确认删除"),content:n("确定要删除这条消息吗?"),okText:n("确定"),cancelText:n("取消"),okButtonProps:{type:"danger"},onOk:()=>{e(e=>
2{let r,s=e.findIndex(e=>e===t);return-1===s&&(s=e.findIndex(e=>e.id===t.id)),-1===s?e:("user"===t.role&&s<e.length-1&&"assistant"===e[s+1].role?(y.success({content:n("已删除消息及其回复"),duration:2}),r=e.filter((t,e)=>e!==s&&e!==s+1)):(y.success({content:n("消息已删除"),duration:2}),r=e.filter(e=>e.id!==t.id)),setTimeout(()=>i(r),0),r)})}})},[e,n,i]),handleRoleToggle:p.useCallback(t=>{if("assistant"!==t.role&&"system"!==t.role)return;const r="assistant"===t.role?"system":"assistant";e(e=>{const n=e.map(e=>e.id!==t.id||"assistant"!==e.role&&"system"!==e.role?e:{...e,role:r});return setTimeout(()=>i(n),0),n}),y.success({content:n(`已切换为${"system"===r?"System":"Assistant"}角色`),duration:2})},[e,n,i])}})(0,D,Ht,L),Wt=p.useCallback(()=>{try{if(d&&u&&u.trim())try{return JSON.parse(u)}catch(t){}let e=[...k];if(0!==e.length&&!e.every(t=>t.role!==at.USER))for(let t=e.length-1;t>=0;t--)if(e[t].role===at.USER){if(l.imageEnabled&&l.imageUrls){const r=l.imageUrls.filter(t=>""!==t.trim());if(r.length>0){const i=ot(e[t])||"示例消息",n=Lt(i,r,!0);e[t]={...e[t],content:n}}}break}return pt(e,null,l,c)}catch(e){return null}},[l,c,k,d,u]);function Ht(t,e){const r=Ft(at.USER,t),i=gt();if(d&&u)try{const t=JSON.parse(u);return void D(e=>{const n=[...e,r,i];return Tt(t,!1!==t.stream),setTimeout(()=>L(n),0),setTimeout(()=>window.dispatchEvent(new CustomEvent("playground_after_send",{detail:{messages:n}})),0),n})}catch(f){return void y.error(lt.JSON_PARSE_ERROR)}const n=(s.current||[]).filter(t=>t&&""!==t.trim()),a=n.length>0?n:(l.imageUrls||[]).filter(t=>""!==t.trim()),o=a.length>0||l.imageEnabled,h="string"==typeof t?t:Array.isArray(t)?t.find(t=>"text"===t.type)?.text||"":t&&"string"==typeof t.text?t.text:"",p=Lt(h,a,o),g=Ft(at.USER,p);D(t=>{const e=[...t,g],r=pt(e,null,l,c);Tt(r,l.stream),setTimeout(()=>{s.current=[],B("imageUrls",[""])},100);const n=[...e,i];return setTimeout(()=>L(n),0),setTimeout(()=>window.dispatchEvent(new CustomEvent("playground_after_send",{detail:{messages:n}})),0),n})}const Vt=p.useCallback(t=>{D(e=>e.map(e=>e.id===t&&e.role===at.ASSISTANT?{...e,isReasoningExpanded:!e.isReasoningExpanded}:e))},[D]),Yt=p.useCallback(t=>{St(t.id)},[]),Ut=p.useCallback(({message:t,className:e})=>{const r=Mt===t.id;return g.jsx(aS,{message:t,className:e,styleState:i,onToggleReasoningExpansion:Vt,isEditing:r,onEditSave:Ot,onEditCancel:Dt,editValue:jt,onEditValueChange:Nt})},[i,Mt,jt,Ot,Dt,Nt,Vt]),Gt=p.useCallback(t=>{const{message:e}=t,r=k.some(t=>"loading"===t?.status||"incomplete"===t?.status),n=Mt===e.id;return g.jsx(oS,{message:e,styleState:i,onMessageReset:qt.handleMessageReset,onMessageCopy:qt.handleMessageCopy,onMessageDelete:qt.handleMessageDelete,onRoleToggle:qt.handleRoleToggle,onMessageEdit:It,isAnyMessageGenerating:r,isEditing:n})},[qt,i,k,Mt,It]);p.useEffect(()=>{zt()},[k,zt]),p.useEffect(()=>{$t()},[u,$t]),p.useEffect(()=>{n.get("expired")&&y.warning(t("登录过期,请重新登录!"))},[n,t]),p.useEffect(()=>{const e=()=>N(!0),r=()=>{try{const e="playground_sessions",r="playground_currentSessionId",i=localStorage.getItem(e)||"[]";let n=[];try{n=JSON.parse(i)}catch{n=[]}const s=localStorage.getItem(r),a=Array.isArray(k)?[...k].reverse().find(t=>t.role===at.USER):null,o=a?ot(a):t("新对话"),l=String(o||t("新对话")).slice(0,20),c=s?n.map(t=>t.id===s?{...t,messages:k,title:l}:t):n,h="s-"+Date.now(),d=[{id:h,title:t("新对话"),createTime:Date.now(),messages:[]},...c];localStorage.setItem(e,JSON.stringify(d)),localStorage.setItem(r,h);try{window.dispatchEvent(new Event("playground_restart_chat"))}catch{}try{window.dispatchEvent(new Event("playground_sessions_updated"))}catch{}}catch{}};return window.addEventListener("playground_open_settings",e),window.addEventListener("playground_new_session",r),()=>{window.removeEventListener("playground_open_settings",e),window.removeEventListener("playground_new_session",r)}},[N,k,t]),p.useEffect(()=>{const t=setTimeout(()=>{const t=Wt();$(t),R(e=>({...e,previewRequest:t?JSON.stringify(t,null,2):null,previewTimestamp:t?(new Date).toISOString():null}))},300);return()=>clearTimeout(t)},[k,l,c,d,u,Wt,$,R]),p.useEffect(()=>{E()},[l,c,h,d,u,E]),p.useEffect(()=>{a.current=l.imageUrls||[]},[l.imageUrls]),p.useEffect(()=>{if(!c.context_length||0===l.context_length)return;const e=l.context_length||15;if(k.length>e){const r=k.length-e,i=k.slice(r);D(i),setTimeout(()=>L(i),0),y.warning(t("对话记录已超过{{max}}
2条,已自动清理{{count}}条最旧的对话",{max:e,count:r}),{duration:5})}},[k.length,l.context_length,D,L,t]);const Jt=p.useCallback(()=>{D([]),setTimeout(()=>L([]),0)},[D,L]);p.useCallback(t=>{t.preventDefault(),kt(!0)},[]);const Xt=p.useCallback(t=>{if(!wt)return;const e=t.clientX;e>=200&&e<=500&&K(e)},[wt]),Kt=p.useCallback(()=>{kt(!1)},[]);f.useEffect(()=>{if(wt)return document.addEventListener("mousemove",Xt),document.addEventListener("mouseup",Kt),()=>{document.removeEventListener("mousemove",Xt),document.removeEventListener("mouseup",Kt)}},[wt,Xt,Kt]);const Zt=p.useCallback(t=>{if(!t||0===t.length)return;const e=t.map(t=>t.url),r=[...a.current.filter(t=>t&&""!==t.trim()),...e];s.current=r,B("imageUrls",r),B("imageEnabled",!0)},[B]),Qt=p.useCallback(t=>{const e=a.current.filter(e=>e!==t&&""!==e.trim());s.current=e,B("imageUrls",e)},[B]);return g.jsx(zv,{favoriteModels:V,toggleFavoriteModel:U,children:g.jsx("div",{className:"h-full",children:g.jsxs(Y,{style:{height:"100%",background:"transparent"},className:"flex flex-col md:flex-row",children:[(b||!r)&&g.jsx(Y.Sider,{style:{background:"transparent",borderRight:"none",flexShrink:0,minWidth:r?"100%":Z?60:320,maxWidth:r?"100%":Z?60:320,width:r?"100%":Z?60:320,height:r?"auto":"calc(100vh - var(--app-header-offset, 80px))",overflow:"hidden",position:r?"fixed":"relative",zIndex:r?1e3:1,top:0,left:0,right:0,bottom:0,transition:"width 0.3s ease, min-width 0.3s ease, max-width 0.3s ease"},className:r?"bg-white shadow-lg":"",children:g.jsx(lS,{styleState:i,showSettings:b,onCloseSettings:()=>N(!1),messages:k,sidebarCollapsed:Z,onToggleCollapse:()=>Ct(!Z),onModelTypeClick:Yt,selectedModelType:vt})}),g.jsxs(Y.Content,{className:"relative flex-1 overflow-hidden",children:[g.jsx("div",{className:"overflow-hidden flex flex-col lg:flex-row h-[calc(100vh-var(--app-header-offset,80px))]",children:g.jsx("div",{className:"flex-1 flex flex-col",children:"chat"===vt?g.jsx(bS,{chatRef:A,message:Rt.displayedMessages,allMessagesCount:Rt.totalCount,hasMoreMessages:Rt.hasMore,remainingMessagesCount:Rt.remainingCount,onLoadMore:Rt.loadMore,onLoadAll:Rt.loadAll,inputs:l,styleState:i,showDebugPanel:h,roleInfo:Pt,onMessageSend:Ht,onMessageCopy:qt.handleMessageCopy,onMessageReset:qt.handleMessageReset,onMessageDelete:qt.handleMessageDelete,onStopGenerator:Bt,onClearMessages:Jt,onReplaceMessages:t=>{D(t),setTimeout(()=>L(t),0)},onToggleDebugPanel:()=>P(!h),onToggleModelConfig:()=>J(!G),renderCustomChatContent:Ut,renderChatBoxAction:Gt,onImageUpload:Zt,onImageRemove:Qt,groups:w,models:C,onGroupChange:t=>B("group",t),onModelChange:t=>B("model",t)}):g.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",background:"hsl(var(--background))",padding:"40px 20px"},children:[g.jsxs(Me.div,{animate:{y:[0,-20,0]},transition:{duration:3,ease:"easeInOut",repeat:1/0},style:{marginBottom:"32px",display:"flex",alignItems:"center",justifyContent:"center",width:"120px",height:"120px",borderRadius:"50%",background:"linear-gradient(135deg, rgba(70, 172, 255, 0.1) 0%, rgba(0, 132, 255, 0.1) 100%)",border:"2px solid rgba(70, 172, 255, 0.2)"},children:["image"===vt&&g.jsx(te,{size:64,color:"#0084FF",strokeWidth:1.5}),"video"===vt&&g.jsx(ee,{size:64,color:"#0084FF",strokeWidth:1.5}),"audio"===vt&&g.jsx(re,{size:64,color:"#0084FF",strokeWidth:1.5})]}),g.jsx("div",{style:{fontSize:"32px",fontWeight:600,background:"linear-gradient(135deg, #46ACFF 0%, #0084FF 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",marginBottom:"16px"},children:t("敬请期待")}),g.jsxs("div",{style:{fontSize:"16px",color:"hsl(var(--muted-foreground))",textAlign:"center",maxWidth:"400px",lineHeight:"1.6"},children:["image"===vt&&t("绘画创作功能即将上线,为您带来更强大的AI绘画体验"),"video"===vt&&t("视频创作功能即将上线,为您带来更强大的AI视频体验"),"audio"===vt&&t("音频创作功能即将上线,为您带来更强大的AI音频体验")]})]})})}),g.jsx(CS,{styleState:i,showSettings:b,showDebugPanel:h,showModelConfig:G,onToggleSettings:()=>N(!b),onToggleDebugPanel:()=>P(!h),onToggleModelConfig:()=>J(!G)})]}),g.jsx(AS,{visible:G,onClose:()=>J(!1),inputs:l,parameterEnabled:c,models:C,groups:w,styleState:i,showDebugPanel:h,customRequestMode:d,customRequestBody:u,onInputChange:B,onParameterToggle:M,onConfigImport:j,onConfigReset:F,onCustomRequestModeChange:q,onCustomRequestBodyChange:W,previewPayload:_,messages:k}),g.jsx(BS,{visible:h,onClose:()=>P(!1),debugData:v,activeDebugTab:S,onActiveDebugTabChange:z,styleState:i,customRequestMode:d})]})})})}},Symbol.toStringTag,{value:"Module"}));
2export{_h as $,Ha as A,qn as B,$n as C,Tn as D,Ya as E,ff as F,Ss as G,Rs as H,tf as I,bg as J,vd as K,Ah as L,kh as M,mh as N,bh as O,ph as P,vh as Q,wh as R,Sh as S,Ch as T,jn as U,xh as V,gh as W,fh as X,yh as Y,Th as Z,_n as _,Ia as a,sc as a$,fs as a0,fa as a1,ma as a2,gf as a3,Fg as a4,aa as a5,xa as a6,ca as a7,Fh as a8,$h as a9,YC as aA,tw as aB,Jx as aC,Nx as aD,VC as aE,uw as aF,nw as aG,rw as aH,Ty as aI,Hn as aJ,Bh as aK,Ys as aL,dy as aM,ly as aN,sy as aO,gr as aP,Qr as aQ,Ai as aR,Hr as aS,Zr as aT,fr as aU,qr as aV,Yr as aW,Kl as aX,rc as aY,Nl as aZ,ec as a_,Zg as aa,va as ab,Wn as ac,Vn as ad,Yn as ae,Ba as af,Gx as ag,HC as ah,UC as ai,Tg as aj,Us as ak,Ey as al,wg as am,kf as an,Xg as ao,xf as ap,vf as aq,Lx as ar,Bf as as,Af as at,Xr as au,xn as av,Nr as aw,mr as ax,kn as ay,xw as az,Na as b,zl as b0,Dl as b1,ml as b2,yl as b3,xl as b4,tc as b5,Ql as b6,$r as b7,Jr as b8,mn as b9,Wr as ba,pi as bb,vn as bc,wi as bd,_i as be,Ri as bf,oi as bg,Ur as bh,zi as bi,pn as bj,gn as bk,dn as bl,yi as bm,jr as bn,di as bo,Xi as bp,fn as bq,Vi as br,Di as bs,un as bt,bi as bu,Kr as bv,Qi as bw,ti as bx,ri as by,ES as bz,qa as c,fl as d,ka as e,as as f,Da as g,of as h,ta as i,Mg as j,ba as k,Bn as l,af as m,Gs as n,Wa as o,vw as p,Ra as q,kw as r,Oa as s,za as t,mf as u,Cg as v,nf as w,qC as x,bf as y,Fa as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.