aitu-app 0.6.21 → 0.6.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/assets/{ChatMessagesArea-Bc7FkjZo.js → ChatMessagesArea-63H9tZtG.js} +3 -3
- package/assets/{KnowledgeBaseContent-BLIcG9KK.js → KnowledgeBaseContent-5j70f-FP.js} +4 -4
- package/assets/{ModelBenchmarkWorkbench-CGztJD2j.js → ModelBenchmarkWorkbench-OdGWsh0T.js} +1 -1
- package/assets/{ResizableDivider-DfqWs8LM.js → ResizableDivider-DUn2YRJi.js} +1 -1
- package/assets/{ToolboxDrawer-B9g_w8pc.js → ToolboxDrawer-DDAFUdNA.js} +1 -1
- package/assets/{VideoAnalyzer-KdlQiqKF.js → VideoAnalyzer-C7mAfG_a.js} +1 -1
- package/assets/{ai-analyze-D51W4jnj.js → ai-analyze-CJsLcVP0.js} +1 -1
- package/assets/{arc-DVIrWwbE.js → arc-BwiBrwsC.js} +1 -1
- package/assets/{arc-BqtXmYwJ.js → arc-bU0RTLO_.js} +1 -1
- package/assets/{batch-image-generation-DEC8rrCP.js → batch-image-generation-se7md6Xz.js} +1 -1
- package/assets/{blockDiagram-38ab4fdb-BgPS1CyJ.js → blockDiagram-38ab4fdb-C-J430-U.js} +1 -1
- package/assets/{blockDiagram-38ab4fdb-CMoyjTgm.js → blockDiagram-38ab4fdb-CRlC08-f.js} +1 -1
- package/assets/{c4Diagram-3d4e48cf-wjCA-CL-.js → c4Diagram-3d4e48cf-CZXHUfLE.js} +1 -1
- package/assets/{c4Diagram-3d4e48cf-CIeKmCwa.js → c4Diagram-3d4e48cf-CjnnPMdb.js} +1 -1
- package/assets/channel-C0300EYS.js +1 -0
- package/assets/channel-CFKYr4PJ.js +1 -0
- package/assets/{classDiagram-70f12bd4-vizVZzUd.js → classDiagram-70f12bd4-CHHFCLtW.js} +1 -1
- package/assets/{classDiagram-70f12bd4-DfTNrA1t.js → classDiagram-70f12bd4-Cka5pz9E.js} +1 -1
- package/assets/{classDiagram-v2-f2320105-LutY6jPP.js → classDiagram-v2-f2320105-BoY5QpGK.js} +1 -1
- package/assets/{classDiagram-v2-f2320105-DO7izSAk.js → classDiagram-v2-f2320105-DhMOYQPM.js} +1 -1
- package/assets/{clipper-D3zP18nj.js → clipper-ZDte_DyN.js} +1 -1
- package/assets/clone-B4wQMor7.js +1 -0
- package/assets/clone-DTNvy75S.js +1 -0
- package/assets/{createText-2e5e7dd3-CtWg9f_f.js → createText-2e5e7dd3-CouAisK8.js} +1 -1
- package/assets/{createText-2e5e7dd3-iSllMU05.js → createText-2e5e7dd3-DQiR2iFi.js} +1 -1
- package/assets/{edges-e0da2a9e-B8N3S4AD.js → edges-e0da2a9e-D5w5n92i.js} +1 -1
- package/assets/{edges-e0da2a9e-B9APkBSa.js → edges-e0da2a9e-dJImi3XC.js} +1 -1
- package/assets/{erDiagram-9861fffd-Dnp1WpmL.js → erDiagram-9861fffd-9WI5iVS2.js} +1 -1
- package/assets/{erDiagram-9861fffd-B1x-ZWfU.js → erDiagram-9861fffd-IyJNqdw_.js} +1 -1
- package/assets/{flowDb-956e92f1-BT8eaBZE.js → flowDb-956e92f1-DltT8K-M.js} +1 -1
- package/assets/{flowDb-956e92f1-5caTHN1T.js → flowDb-956e92f1-FUMkFpNV.js} +1 -1
- package/assets/{flowDiagram-66a62f08-B5xcjVie.js → flowDiagram-66a62f08-Dbc4Nx93.js} +1 -1
- package/assets/{flowDiagram-66a62f08-Cx_V_MoA.js → flowDiagram-66a62f08-nXDkz0Ug.js} +1 -1
- package/assets/flowDiagram-v2-96b9c2cf-BVOhfZw2.js +1 -0
- package/assets/flowDiagram-v2-96b9c2cf-j5LlfdZR.js +1 -0
- package/assets/{flowchart-elk-definition-4a651766-Cjgywupa.js → flowchart-elk-definition-4a651766-B6rzHwEw.js} +1 -1
- package/assets/{flowchart-elk-definition-4a651766-CwIA9l-O.js → flowchart-elk-definition-4a651766-gZ7Jh0C4.js} +1 -1
- package/assets/{ganttDiagram-c361ad54-6zSjhOJy.js → ganttDiagram-c361ad54-B9Sd11GI.js} +1 -1
- package/assets/{ganttDiagram-c361ad54-oySKvDa4.js → ganttDiagram-c361ad54-CItnWrDi.js} +1 -1
- package/assets/{gitGraphDiagram-72cf32ee-BK7TWB1s.js → gitGraphDiagram-72cf32ee-CYyEomwm.js} +1 -1
- package/assets/{gitGraphDiagram-72cf32ee-BnNAY3pp.js → gitGraphDiagram-72cf32ee-Dd5nG_11.js} +1 -1
- package/assets/{graph-B_MH2EY9.js → graph-BHlg4sFb.js} +1 -1
- package/assets/{graph-BPS27gwv.js → graph-Cy6oe2k_.js} +1 -1
- package/assets/{grid-image-DLa8OQhL.js → grid-image-C-msrN1B.js} +1 -1
- package/assets/{has-D0S1Zmzg.js → has-CWNO02CD.js} +1 -1
- package/assets/{hasIn-De9yBkgj.js → hasIn-Bs6kQ8q7.js} +1 -1
- package/assets/{index-3862675e-FzFTrzJW.js → index-3862675e-BKpqGoRu.js} +1 -1
- package/assets/{index-3862675e-D6LCgHcS.js → index-3862675e-DsPsD_QS.js} +1 -1
- package/assets/{index-T5OF1JP4.js → index-B-A2026m.js} +1 -1
- package/assets/{index-Bjr6SLmW.js → index-BC5aP94k.js} +1 -1
- package/assets/{index-Cb_6lq4r.js → index-BEFGFeiI.js} +1 -1
- package/assets/{index-Dgs_9LtJ.js → index-BTRvm9gy.js} +1 -1
- package/assets/{index-B8Cp8ZAq.js → index-B_ECxmtW.js} +1 -1
- package/assets/{index-CGUpUzSI.js → index-BcM3gyCR.js} +1 -1
- package/assets/{index-Ia_xKhIZ.js → index-BdH171U0.js} +5 -5
- package/assets/{index-sARZWo5n.js → index-Br38Ej3g.js} +1 -1
- package/assets/{index-CU-f8hlX.js → index-C-wf0YcU.js} +1 -1
- package/assets/{index-Ctlb8bi0.js → index-C1X4nHa1.js} +1 -1
- package/assets/{index-Br6iEGLw.js → index-CCzr4Dqs.js} +1 -1
- package/assets/{index-DYQtOpt_.js → index-CMfdA3Eb.js} +1 -1
- package/assets/{index-B1Qj7KmK.js → index-CRvF4JAy.js} +1 -1
- package/assets/{index-GP_0iNEx.js → index-CUYzOOe1.js} +1 -1
- package/assets/{index-rrHZbeHC.js → index-CnVvluBH.js} +1 -1
- package/assets/{index-Ddc6oDDk.js → index-D4JTX52h.js} +1 -1
- package/assets/{index-BdrYk4gf.js → index-DB9eHDVM.js} +1 -1
- package/assets/{index-DFgRlr0t.js → index-DGVrURNm.js} +1 -1
- package/assets/{index-CG_qIHbM.js → index-Dczi3BkD.js} +1 -1
- package/assets/{index-CSxjkKUk.js → index-DtJW2qel.js} +1 -1
- package/assets/{index-6opHRfWl.js → index-DysS6hq1.js} +1 -1
- package/assets/{index-C6mW2Bug.js → index-KJVd0B2z.js} +1 -1
- package/assets/{index-BIv91qW9.js → index-T9dstNa6.js} +16 -16
- package/assets/{index-B3GMIqjJ.js → index-TQu9hYF9.js} +1 -1
- package/assets/{index-CAghokCh.js → index-Y5c26X-0.js} +1 -1
- package/assets/{index-BR5Ge2w3.js → index-YBixVTkA.js} +1 -1
- package/assets/{index-CqeciDtE.js → index-ZRpcXeUi.js} +1 -1
- package/assets/{index-DUFh_idy.js → index-byQfZx9Y.js} +1 -1
- package/assets/{index-DJhDtQwz.js → index-hmLPqXUT.js} +1 -1
- package/assets/{index-BUde8Mm7.js → index-iDwZIVzi.js} +1 -1
- package/assets/{index-B_TY0tLT.js → index-sRNe5iWo.js} +1 -1
- package/assets/{index-CoNiRHcD.js → index-w0J-N3Bz.js} +1 -1
- package/assets/{index-CIsTR1zp.js → index-xSQSiTqU.js} +1 -1
- package/assets/{infoDiagram-f8f76790-C5lK_OdP.js → infoDiagram-f8f76790-D3aFK43x.js} +1 -1
- package/assets/{infoDiagram-f8f76790-DqxLIqvx.js → infoDiagram-f8f76790-plyhvVln.js} +1 -1
- package/assets/{inspiration-board-DELLwhlH.js → inspiration-board-WeHubIbH.js} +1 -1
- package/assets/{isEmpty-DF_ugZHw.js → isEmpty-DZgnI1Gi.js} +1 -1
- package/assets/{journeyDiagram-49397b02-f6bVwxyz.js → journeyDiagram-49397b02-BUEu9YZl.js} +1 -1
- package/assets/{journeyDiagram-49397b02-BJ9tbMfk.js → journeyDiagram-49397b02-CJLyWjZc.js} +1 -1
- package/assets/{layers-DAOrLzwi.js → layers-BZ-h9vGA.js} +1 -1
- package/assets/{layout-yMh6DKYs.js → layout-CB3iLEN-.js} +1 -1
- package/assets/{layout-fmUyEip8.js → layout-CfIv6ys6.js} +1 -1
- package/assets/{line-DANa88VO.js → line-Cl2IINpY.js} +1 -1
- package/assets/{line-DXiCFjwk.js → line-DEMH00tR.js} +1 -1
- package/assets/{linear-5iY8Cy-H.js → linear-CAlPBLIZ.js} +1 -1
- package/assets/{linear-ctDXkzM_.js → linear-CYligRij.js} +1 -1
- package/assets/{mermaid.core-Dgk12NKe.js → mermaid.core-HRa8_3iy.js} +5 -5
- package/assets/{mindmap-definition-fc14e90a-C7BlMhzr.js → mindmap-definition-fc14e90a-BE_BelNq.js} +1 -1
- package/assets/{mindmap-definition-fc14e90a-DLlf6Rx9.js → mindmap-definition-fc14e90a-BjEfE1ER.js} +1 -1
- package/assets/{model-benchmark-launcher-fleyPbmY.js → model-benchmark-launcher-DGhnqUWi.js} +1 -1
- package/assets/{photo-wall-splitter-xpPO2k5T.js → photo-wall-splitter-CEBkekUS.js} +1 -1
- package/assets/{pick-VCZntyna.js → pick-BDzXufGU.js} +1 -1
- package/assets/{pieDiagram-8a3498a8-BBnaNSJ-.js → pieDiagram-8a3498a8-BOz79K-l.js} +1 -1
- package/assets/{pieDiagram-8a3498a8-BvSfbq65.js → pieDiagram-8a3498a8-BXg1_0zb.js} +1 -1
- package/assets/{quadrantDiagram-120e2f19-Bnh-DNQv.js → quadrantDiagram-120e2f19-BNSax4Yv.js} +1 -1
- package/assets/{quadrantDiagram-120e2f19-Cm8pCCM5.js → quadrantDiagram-120e2f19-BW0c6246.js} +1 -1
- package/assets/{requirementDiagram-deff3bca-CDm-DECv.js → requirementDiagram-deff3bca-BdKQCBBh.js} +1 -1
- package/assets/{requirementDiagram-deff3bca-DMRUc1cx.js → requirementDiagram-deff3bca-DLC9wibM.js} +1 -1
- package/assets/{sankeyDiagram-04a897e0-CXC5R9JG.js → sankeyDiagram-04a897e0-gzh6unx3.js} +1 -1
- package/assets/{sankeyDiagram-04a897e0-BMtXJIXg.js → sankeyDiagram-04a897e0-mnwYvtIk.js} +1 -1
- package/assets/{sequenceDiagram-704730f1-D42qglAv.js → sequenceDiagram-704730f1-9WzL_6Og.js} +1 -1
- package/assets/{sequenceDiagram-704730f1-CNMmBUQx.js → sequenceDiagram-704730f1-CPrfOGmY.js} +1 -1
- package/assets/{settings-dialog-2ODvctTh.js → settings-dialog-DKi0S3Fj.js} +1 -1
- package/assets/{shard-sync-service-D3USLllH.js → shard-sync-service-DMBoL8-S.js} +1 -1
- package/assets/{stateDiagram-587899a1-DqPLyMub.js → stateDiagram-587899a1-D0lAIKBU.js} +1 -1
- package/assets/{stateDiagram-587899a1-DsEPR5ou.js → stateDiagram-587899a1-DHfaNuxL.js} +1 -1
- package/assets/{stateDiagram-v2-d93cdb3a-DrlPKA21.js → stateDiagram-v2-d93cdb3a-BW2UOJGd.js} +1 -1
- package/assets/{stateDiagram-v2-d93cdb3a-Bf_7sDs_.js → stateDiagram-v2-d93cdb3a-BkSMcdnU.js} +1 -1
- package/assets/{styles-6aaf32cf-YHAPMNO9.js → styles-6aaf32cf-BzV4m8wn.js} +1 -1
- package/assets/{styles-6aaf32cf-Bj2sDHb0.js → styles-6aaf32cf-DbLx1dQP.js} +1 -1
- package/assets/{styles-9a916d00-7jELss6_.js → styles-9a916d00-BWvAJ5en.js} +1 -1
- package/assets/{styles-9a916d00-CZUDnhpb.js → styles-9a916d00-DfAvsjKD.js} +1 -1
- package/assets/{styles-c10674c1-DC9073pI.js → styles-c10674c1-CeFiajQK.js} +1 -1
- package/assets/{styles-c10674c1-DLuj745u.js → styles-c10674c1-DOM3WQ5r.js} +1 -1
- package/assets/{svgDrawCommon-08f97a94-CrWF0HaY.js → svgDrawCommon-08f97a94-BVgqbMeh.js} +1 -1
- package/assets/{svgDrawCommon-08f97a94-D2AO9i1k.js → svgDrawCommon-08f97a94-BlKKsIl4.js} +1 -1
- package/assets/{timeline-definition-85554ec2-leTEuD1Q.js → timeline-definition-85554ec2-9aW1_D2N.js} +1 -1
- package/assets/{timeline-definition-85554ec2-7KS0GPh6.js → timeline-definition-85554ec2-DzpdYs0t.js} +1 -1
- package/assets/ttd-dialog-DEnnfHyO.js +115 -0
- package/assets/{upload-CQNwOcX2.js → upload-DNNZ8L4F.js} +1 -1
- package/assets/{video-recovery-service-BQIopXWm.js → video-recovery-service-CbVWiAGn.js} +1 -1
- package/assets/{xychartDiagram-e933f94c-BCEY4mIx.js → xychartDiagram-e933f94c-DNl2ns7z.js} +1 -1
- package/assets/{xychartDiagram-e933f94c-B_6b1Ojq.js → xychartDiagram-e933f94c-d54TQLOU.js} +1 -1
- package/changelog.json +13 -0
- package/package.json +1 -1
- package/precache-manifest.json +277 -277
- package/sw.js +1 -1
- package/version.json +3 -7
- package/assets/channel-Ckduo0Rh.js +0 -1
- package/assets/channel-DXN87Isu.js +0 -1
- package/assets/clone-CuD87pDT.js +0 -1
- package/assets/clone-DOLqw3Mb.js +0 -1
- package/assets/flowDiagram-v2-96b9c2cf-BaJg3X7e.js +0 -1
- package/assets/flowDiagram-v2-96b9c2cf-bslUZjmZ.js +0 -1
- package/assets/ttd-dialog-DZzhIaYG.js +0 -115
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{l as ln,x as sn,ar as cn}from"./mermaid.core-
|
|
1
|
+
import{l as ln,x as sn,ar as cn}from"./mermaid.core-HRa8_3iy.js";import{b6 as pn}from"./index-T9dstNa6.js";var st=Object.prototype.hasOwnProperty;function ct(e,n,t){for(t of e.keys())if(Ie(t,n))return t}function Ie(e,n){var t,r,o;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&Ie(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(o=r,o&&typeof o=="object"&&(o=ct(n,o),!o)||!n.has(o))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(o=r[0],o&&typeof o=="object"&&(o=ct(n,o),!o)||!Ie(r[1],n.get(o)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(st.call(e,t)&&++r&&!st.call(n,t)||!(t in n)||!Ie(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}var hn={};let Qe,Mt,Dt,Lt,Ot=!0;typeof process<"u"&&({FORCE_COLOR:Qe,NODE_DISABLE_COLORS:Mt,NO_COLOR:Dt,TERM:Lt}=hn||{},Ot=process.stdout&&process.stdout.isTTY);const v={enabled:!Mt&&Dt==null&&Lt!=="dumb"&&(Qe!=null&&Qe!=="0"||Ot),reset:W(0,0),bold:W(1,22),dim:W(2,22),italic:W(3,23),underline:W(4,24),inverse:W(7,27),hidden:W(8,28),strikethrough:W(9,29),black:W(30,39),red:W(31,39),green:W(32,39),yellow:W(33,39),blue:W(34,39),magenta:W(35,39),cyan:W(36,39),white:W(37,39),gray:W(90,39),grey:W(90,39),bgBlack:W(40,49),bgRed:W(41,49),bgGreen:W(42,49),bgYellow:W(43,49),bgBlue:W(44,49),bgMagenta:W(45,49),bgCyan:W(46,49),bgWhite:W(47,49)};function pt(e,n){let t=0,r,o="",a="";for(;t<e.length;t++)r=e[t],o+=r.open,a+=r.close,~n.indexOf(r.close)&&(n=n.replace(r.rgx,r.close+r.open));return o+n+a}function fn(e,n){let t={has:e,keys:n};return t.reset=v.reset.bind(t),t.bold=v.bold.bind(t),t.dim=v.dim.bind(t),t.italic=v.italic.bind(t),t.underline=v.underline.bind(t),t.inverse=v.inverse.bind(t),t.hidden=v.hidden.bind(t),t.strikethrough=v.strikethrough.bind(t),t.black=v.black.bind(t),t.red=v.red.bind(t),t.green=v.green.bind(t),t.yellow=v.yellow.bind(t),t.blue=v.blue.bind(t),t.magenta=v.magenta.bind(t),t.cyan=v.cyan.bind(t),t.white=v.white.bind(t),t.gray=v.gray.bind(t),t.grey=v.grey.bind(t),t.bgBlack=v.bgBlack.bind(t),t.bgRed=v.bgRed.bind(t),t.bgGreen=v.bgGreen.bind(t),t.bgYellow=v.bgYellow.bind(t),t.bgBlue=v.bgBlue.bind(t),t.bgMagenta=v.bgMagenta.bind(t),t.bgCyan=v.bgCyan.bind(t),t.bgWhite=v.bgWhite.bind(t),t}function W(e,n){let t={open:`\x1B[${e}m`,close:`\x1B[${n}m`,rgx:new RegExp(`\\x1b\\[${n}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(t)),r===void 0?this:v.enabled?pt(this.keys,r+""):r+""):r===void 0?fn([e],[t]):v.enabled?pt([t],r+""):r+""}}function ke(){}ke.prototype={diff:function(n,t){var r,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.callback;typeof o=="function"&&(a=o,o={}),this.options=o;var l=this;function s(D){return a?(setTimeout(function(){a(void 0,D)},0),!0):D}n=this.castInput(n),t=this.castInput(t),n=this.removeEmpty(this.tokenize(n)),t=this.removeEmpty(this.tokenize(t));var x=t.length,h=n.length,c=1,f=x+h;o.maxEditLength&&(f=Math.min(f,o.maxEditLength));var d=(r=o.timeout)!==null&&r!==void 0?r:1/0,p=Date.now()+d,A=[{oldPos:-1,lastComponent:void 0}],M=this.extractCommon(A[0],t,n,0);if(A[0].oldPos+1>=h&&M+1>=x)return s([{value:this.join(t),count:t.length}]);var I=-1/0,C=1/0;function P(){for(var D=Math.max(I,-c);D<=Math.min(C,c);D+=2){var O=void 0,S=A[D-1],q=A[D+1];S&&(A[D-1]=void 0);var N=!1;if(q){var V=q.oldPos-D;N=q&&0<=V&&V<x}var U=S&&S.oldPos+1<h;if(!N&&!U){A[D]=void 0;continue}if(!U||N&&S.oldPos+1<q.oldPos?O=l.addToPath(q,!0,void 0,0):O=l.addToPath(S,void 0,!0,1),M=l.extractCommon(O,t,n,D),O.oldPos+1>=h&&M+1>=x)return s(dn(l,O.lastComponent,t,n,l.useLongestToken));A[D]=O,O.oldPos+1>=h&&(C=Math.min(C,D-1)),M+1>=x&&(I=Math.max(I,D+1))}c++}if(a)(function D(){setTimeout(function(){if(c>f||Date.now()>p)return a();P()||D()},0)})();else for(;c<=f&&Date.now()<=p;){var E=P();if(E)return E}},addToPath:function(n,t,r,o){var a=n.lastComponent;return a&&a.added===t&&a.removed===r?{oldPos:n.oldPos+o,lastComponent:{count:a.count+1,added:t,removed:r,previousComponent:a.previousComponent}}:{oldPos:n.oldPos+o,lastComponent:{count:1,added:t,removed:r,previousComponent:a}}},extractCommon:function(n,t,r,o){for(var a=t.length,l=r.length,s=n.oldPos,x=s-o,h=0;x+1<a&&s+1<l&&this.equals(t[x+1],r[s+1]);)x++,s++,h++;return h&&(n.lastComponent={count:h,previousComponent:n.lastComponent}),n.oldPos=s,x},equals:function(n,t){return this.options.comparator?this.options.comparator(n,t):n===t||this.options.ignoreCase&&n.toLowerCase()===t.toLowerCase()},removeEmpty:function(n){for(var t=[],r=0;r<n.length;r++)n[r]&&t.push(n[r]);return t},castInput:function(n){return n},tokenize:function(n){return n.split("")},join:function(n){return n.join("")}};function dn(e,n,t,r,o){for(var a=[],l;n;)a.push(n),l=n.previousComponent,delete n.previousComponent,n=l;a.reverse();for(var s=0,x=a.length,h=0,c=0;s<x;s++){var f=a[s];if(f.removed){if(f.value=e.join(r.slice(c,c+f.count)),c+=f.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}else{if(!f.added&&o){var d=t.slice(h,h+f.count);d=d.map(function(M,I){var C=r[c+I];return C.length>M.length?C:M}),f.value=e.join(d)}else f.value=e.join(t.slice(h,h+f.count));h+=f.count,f.added||(c+=f.count)}}var A=a[x-1];return x>1&&typeof A.value=="string"&&(A.added||A.removed)&&e.equals("",A.value)&&(a[x-2].value+=A.value,a.pop()),a}var ht=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,ft=/\S/,qt=new ke;qt.equals=function(e,n){return this.options.ignoreCase&&(e=e.toLowerCase(),n=n.toLowerCase()),e===n||this.options.ignoreWhitespace&&!ft.test(e)&&!ft.test(n)};qt.tokenize=function(e){for(var n=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),t=0;t<n.length-1;t++)!n[t+1]&&n[t+2]&&ht.test(n[t])&&ht.test(n[t+2])&&(n[t]+=n[t+2],n.splice(t+1,2),t--);return n};var vt=new ke;vt.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
2
2
|
`));var n=[],t=e.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(var r=0;r<t.length;r++){var o=t[r];r%2&&!this.options.newlineIsToken?n[n.length-1]+=o:(this.options.ignoreWhitespace&&(o=o.trim()),n.push(o))}return n};var mn=new ke;mn.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var gn=new ke;gn.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Le(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Le=function(n){return typeof n}:Le=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Le(e)}var xn=Object.prototype.toString,Me=new ke;Me.useLongestToken=!0;Me.tokenize=vt.tokenize;Me.castInput=function(e){var n=this.options,t=n.undefinedReplacement,r=n.stringifyReplacer,o=r===void 0?function(a,l){return typeof l>"u"?t:l}:r;return typeof e=="string"?e:JSON.stringify(Ue(e,null,null,o),o," ")};Me.equals=function(e,n){return ke.prototype.equals.call(Me,e.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"))};function Ue(e,n,t,r,o){n=n||[],t=t||[],r&&(e=r(o,e));var a;for(a=0;a<n.length;a+=1)if(n[a]===e)return t[a];var l;if(xn.call(e)==="[object Array]"){for(n.push(e),l=new Array(e.length),t.push(l),a=0;a<e.length;a+=1)l[a]=Ue(e[a],n,t,r,o);return n.pop(),t.pop(),l}if(e&&e.toJSON&&(e=e.toJSON()),Le(e)==="object"&&e!==null){n.push(e),l={},t.push(l);var s=[],x;for(x in e)e.hasOwnProperty(x)&&s.push(x);for(s.sort(),a=0;a<s.length;a+=1)x=s[a],l[x]=Ue(e[x],n,t,r,x);n.pop(),t.pop()}else l=e;return l}var Ge=new ke;Ge.tokenize=function(e){return e.slice()};Ge.join=Ge.removeEmpty=function(e){return e};v.red,v.grey,v.green;v.dim().italic;v.dim("→");v.dim("·");v.dim("↵");function ve(e){e=e.replace(/\r?\n/g,`
|
|
3
3
|
`);let n=e.match(/^[ \t]*(?=\S)/gm),t=0,r=1/0,o=(n||[]).length;for(;t<o;t++)r=Math.min(r,n[t].length);return o&&r?e.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):e}class kn extends Error{constructor(n={}){super(n.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=n.details||!1,this.generated=!!n.generated,this.operator=n.operator,this.expects=n.expects,this.actual=n.actual}}function ae(e,n,t,r,o,a,l){if(e)return;let s=l||a;if(l instanceof Error)throw l;let x=o;throw new kn({actual:n,expects:t,operator:r,message:s,details:x,generated:!l})}function k(e,n){ae(!!e,!1,!0,"ok",!1,"Expected value to be truthy",n)}function me(e,n){ae(!e,!0,!1,"not",!1,"Expected value to be falsey",n)}me.ok=me;me.equal=function(e,n,t){ae(!Ie(e,n),e,n,"not.equal",!1,"Expected values not to be deeply equal",t)};me.type=function(e,n,t){let r=typeof e;ae(r!==n,r,n,"not.type",!1,`Expected "${r}" not to be "${n}"`,t)};me.instance=function(e,n,t){let r="`"+(n.name||n.constructor.name)+"`";ae(!(e instanceof n),e,n,"not.instance",!1,`Expected value not to be an instance of ${r}`,t)};me.snapshot=function(e,n,t){e=ve(e),n=ve(n),ae(e!==n,e,n,"not.snapshot",!1,"Expected value not to match snapshot",t)};me.fixture=function(e,n,t){e=ve(e),n=ve(n),ae(e!==n,e,n,"not.fixture",!1,"Expected value not to match fixture",t)};me.match=function(e,n,t){typeof n=="string"?ae(!e.includes(n),e,n,"not.match",!1,`Expected value not to include "${n}" substring`,t):ae(!n.test(e),e,n,"not.match",!1,`Expected value not to match \`${String(n)}\` pattern`,t)};me.throws=function(e,n,t){!t&&typeof n=="string"&&(t=n,n=null);try{e()}catch(r){typeof n=="function"?ae(!n(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",t):n instanceof RegExp?ae(!n.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(n)}\` pattern`,t):n||ae(!1,!0,!1,"not.throws",!1,"Expected function not to throw",t)}};const bn={};function yn(e,n){const t=bn,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,o=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Pt(e,r,o)}function Pt(e,n,t){if(Sn(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dt(e.children,n,t)}return Array.isArray(e)?dt(e,n,t):""}function dt(e,n,t){const r=[];let o=-1;for(;++o<e.length;)r[o]=Pt(e[o],n,t);return r.join("")}function Sn(e){return!!(e&&typeof e=="object")}const w={atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:"CDATA[",characterGroupWhitespace:1,characterGroupPunctuation:2,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeFlow:"flow",contentTypeContent:"content",contentTypeString:"string",contentTypeText:"text",hardBreakPrefixSizeMin:2,htmlRaw:1,htmlComment:2,htmlInstruction:3,htmlDeclaration:4,htmlCdata:5,htmlBasic:6,htmlComplete:7,htmlRawSizeMax:8,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4};function se(e,n,t,r){const o=e.length;let a=0,l;if(n<0?n=-n>o?0:o+n:n=n>o?o:n,t=t>0?t:0,r.length<w.v8MaxSafeChunkSize)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);a<r.length;)l=r.slice(a,a+w.v8MaxSafeChunkSize),l.unshift(n,0),e.splice(...l),a+=w.v8MaxSafeChunkSize,n+=w.v8MaxSafeChunkSize}function ie(e,n){return e.length>0?(se(e,e.length,0,n),e):n}const mt={}.hasOwnProperty;function Cn(e){const n={};let t=-1;for(;++t<e.length;)Fn(n,e[t]);return n}function Fn(e,n){let t;for(t in n){const o=(mt.call(e,t)?e[t]:void 0)||(e[t]={}),a=n[t];let l;if(a)for(l in a){mt.call(o,l)||(o[l]=[]);const s=a[l];wn(o[l],Array.isArray(s)?s:s?[s]:[])}}}function wn(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);se(e,0,0,r)}const u={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,ht:9,lf:10,vt:11,cr:13,space:32,exclamationMark:33,quotationMark:34,numberSign:35,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseX:88,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseX:120,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},Tn=/[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,le=be(/[A-Za-z]/),ue=be(/[\dA-Za-z]/),En=be(/[#-'*+\--9=?A-Z^-~]/);function $e(e){return e!==null&&(e<u.space||e===u.del)}const Ye=be(/\d/),zn=be(/[\dA-Fa-f]/),An=be(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<u.horizontalTab}function ee(e){return e!==null&&(e<u.nul||e===u.space)}function _(e){return e===u.horizontalTab||e===u.virtualSpace||e===u.space}const In=be(Tn),Bn=be(/\s/);function be(e){return n;function n(t){return t!==null&&e.test(String.fromCharCode(t))}}function Q(e,n,t,r){const o=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(x){return _(x)?(e.enter(t),s(x)):n(x)}function s(x){return _(x)&&a++<o?(e.consume(x),s):(e.exit(t),n(x))}}const i={data:"data",whitespace:"whitespace",lineEnding:"lineEnding",lineEndingBlank:"lineEndingBlank",linePrefix:"linePrefix",lineSuffix:"lineSuffix",atxHeading:"atxHeading",atxHeadingSequence:"atxHeadingSequence",atxHeadingText:"atxHeadingText",autolink:"autolink",autolinkEmail:"autolinkEmail",autolinkMarker:"autolinkMarker",autolinkProtocol:"autolinkProtocol",characterEscape:"characterEscape",characterEscapeValue:"characterEscapeValue",characterReference:"characterReference",characterReferenceMarker:"characterReferenceMarker",characterReferenceMarkerNumeric:"characterReferenceMarkerNumeric",characterReferenceMarkerHexadecimal:"characterReferenceMarkerHexadecimal",characterReferenceValue:"characterReferenceValue",codeFenced:"codeFenced",codeFencedFence:"codeFencedFence",codeFencedFenceSequence:"codeFencedFenceSequence",codeFencedFenceInfo:"codeFencedFenceInfo",codeFencedFenceMeta:"codeFencedFenceMeta",codeFlowValue:"codeFlowValue",codeIndented:"codeIndented",codeText:"codeText",codeTextData:"codeTextData",codeTextPadding:"codeTextPadding",codeTextSequence:"codeTextSequence",content:"content",definition:"definition",definitionDestination:"definitionDestination",definitionDestinationLiteral:"definitionDestinationLiteral",definitionDestinationLiteralMarker:"definitionDestinationLiteralMarker",definitionDestinationRaw:"definitionDestinationRaw",definitionDestinationString:"definitionDestinationString",definitionLabel:"definitionLabel",definitionLabelMarker:"definitionLabelMarker",definitionLabelString:"definitionLabelString",definitionMarker:"definitionMarker",definitionTitle:"definitionTitle",definitionTitleMarker:"definitionTitleMarker",definitionTitleString:"definitionTitleString",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",escapeMarker:"escapeMarker",hardBreakEscape:"hardBreakEscape",hardBreakTrailing:"hardBreakTrailing",htmlFlow:"htmlFlow",htmlFlowData:"htmlFlowData",htmlText:"htmlText",htmlTextData:"htmlTextData",image:"image",label:"label",labelText:"labelText",labelLink:"labelLink",labelImage:"labelImage",labelMarker:"labelMarker",labelImageMarker:"labelImageMarker",labelEnd:"labelEnd",link:"link",paragraph:"paragraph",reference:"reference",referenceMarker:"referenceMarker",referenceString:"referenceString",resource:"resource",resourceDestination:"resourceDestination",resourceDestinationLiteral:"resourceDestinationLiteral",resourceDestinationLiteralMarker:"resourceDestinationLiteralMarker",resourceDestinationRaw:"resourceDestinationRaw",resourceDestinationString:"resourceDestinationString",resourceMarker:"resourceMarker",resourceTitle:"resourceTitle",resourceTitleMarker:"resourceTitleMarker",resourceTitleString:"resourceTitleString",setextHeading:"setextHeading",setextHeadingText:"setextHeadingText",setextHeadingLine:"setextHeadingLine",setextHeadingLineSequence:"setextHeadingLineSequence",strong:"strong",strongSequence:"strongSequence",strongText:"strongText",thematicBreak:"thematicBreak",thematicBreakSequence:"thematicBreakSequence",blockQuote:"blockQuote",blockQuotePrefix:"blockQuotePrefix",blockQuoteMarker:"blockQuoteMarker",blockQuotePrefixWhitespace:"blockQuotePrefixWhitespace",listOrdered:"listOrdered",listUnordered:"listUnordered",listItemIndent:"listItemIndent",listItemMarker:"listItemMarker",listItemPrefix:"listItemPrefix",listItemPrefixWhitespace:"listItemPrefixWhitespace",listItemValue:"listItemValue",chunkContent:"chunkContent",chunkFlow:"chunkFlow",chunkText:"chunkText",chunkString:"chunkString"},Mn={tokenize:Dn};function Dn(e){const n=e.attempt(this.parser.constructs.contentInitial,r,o);let t;return n;function r(s){if(k(s===u.eof||z(s),"expected eol or eof"),s===u.eof){e.consume(s);return}return e.enter(i.lineEnding),e.consume(s),e.exit(i.lineEnding),Q(e,n,i.linePrefix)}function o(s){return k(s!==u.eof&&!z(s),"expected anything other than a line ending or EOF"),e.enter(i.paragraph),a(s)}function a(s){const x=e.enter(i.chunkText,{contentType:w.contentTypeText,previous:t});return t&&(t.next=x),t=x,l(s)}function l(s){if(s===u.eof){e.exit(i.chunkText),e.exit(i.paragraph),e.consume(s);return}return z(s)?(e.consume(s),e.exit(i.chunkText),a):(e.consume(s),l)}}const Ln={tokenize:On},gt={tokenize:qn};function On(e){const n=this,t=[];let r=0,o,a,l;return s;function s(E){if(r<t.length){const D=t[r];return n.containerState=D[1],k(D[0].continuation,"expected `continuation` to be defined on container construct"),e.attempt(D[0].continuation,x,h)(E)}return h(E)}function x(E){if(k(n.containerState,"expected `containerState` to be defined after continuation"),r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,o&&P();const D=n.events.length;let O=D,S;for(;O--;)if(n.events[O][0]==="exit"&&n.events[O][1].type===i.chunkFlow){S=n.events[O][1].end;break}k(S,"could not find previous flow chunk"),C(r);let q=D;for(;q<n.events.length;)n.events[q][1].end=Object.assign({},S),q++;return se(n.events,O+1,0,n.events.slice(D)),n.events.length=q,h(E)}return s(E)}function h(E){if(r===t.length){if(!o)return d(E);if(o.currentConstruct&&o.currentConstruct.concrete)return A(E);n.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(gt,c,f)(E)}function c(E){return o&&P(),C(r),d(E)}function f(E){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,A(E)}function d(E){return n.containerState={},e.attempt(gt,p,A)(E)}function p(E){return k(n.currentConstruct,"expected `currentConstruct` to be defined on tokenizer"),k(n.containerState,"expected `containerState` to be defined on tokenizer"),r++,t.push([n.currentConstruct,n.containerState]),d(E)}function A(E){if(E===u.eof){o&&P(),C(0),e.consume(E);return}return o=o||n.parser.flow(n.now()),e.enter(i.chunkFlow,{contentType:w.contentTypeFlow,previous:a,_tokenizer:o}),M(E)}function M(E){if(E===u.eof){I(e.exit(i.chunkFlow),!0),C(0),e.consume(E);return}return z(E)?(e.consume(E),I(e.exit(i.chunkFlow)),r=0,n.interrupt=void 0,s):(e.consume(E),M)}function I(E,D){k(o,"expected `childFlow` to be defined when continuing");const O=n.sliceStream(E);if(D&&O.push(null),E.previous=a,a&&(a.next=E),a=E,o.defineSkip(E.start),o.write(O),n.parser.lazy[E.start.line]){let S=o.events.length;for(;S--;)if(o.events[S][1].start.offset<l&&(!o.events[S][1].end||o.events[S][1].end.offset>l))return;const q=n.events.length;let N=q,V,U;for(;N--;)if(n.events[N][0]==="exit"&&n.events[N][1].type===i.chunkFlow){if(V){U=n.events[N][1].end;break}V=!0}for(k(U,"could not find previous flow chunk"),C(r),S=q;S<n.events.length;)n.events[S][1].end=Object.assign({},U),S++;se(n.events,N+1,0,n.events.slice(q)),n.events.length=S}}function C(E){let D=t.length;for(;D-- >E;){const O=t[D];n.containerState=O[1],k(O[0].exit,"expected `exit` to be defined on container construct"),O[0].exit.call(n,e)}t.length=E}function P(){k(n.containerState,"expected `containerState` to be defined when closing flow"),k(o,"expected `childFlow` to be defined when closing it"),o.write([u.eof]),a=void 0,o=void 0,n.containerState._closeFlow=void 0}}function qn(e,n,t){return k(this.parser.constructs.disable.null,"expected `disable.null` to be populated"),Q(e,e.attempt(this.parser.constructs.document,n,t),i.linePrefix,this.parser.constructs.disable.null.includes("codeIndented")?void 0:w.tabSize)}function xt(e){if(e===u.eof||ee(e)||Bn(e))return w.characterGroupWhitespace;if(In(e))return w.characterGroupPunctuation}function Ke(e,n,t){const r=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!r.includes(a)&&(n=a(n,t),r.push(a))}return n}const Je={name:"attention",tokenize:Pn,resolveAll:vn};function vn(e,n){let t=-1,r,o,a,l,s,x,h,c;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;x=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),d=Object.assign({},e[t][1].start);kt(f,-x),kt(d,x),l={type:x>1?i.strongSequence:i.emphasisSequence,start:f,end:Object.assign({},e[r][1].end)},s={type:x>1?i.strongSequence:i.emphasisSequence,start:Object.assign({},e[t][1].start),end:d},a={type:x>1?i.strongText:i.emphasisText,start:Object.assign({},e[r][1].end),end:Object.assign({},e[t][1].start)},o={type:x>1?i.strong:i.emphasis,start:Object.assign({},l.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},l.start),e[t][1].start=Object.assign({},s.end),h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=ie(h,[["enter",e[r][1],n],["exit",e[r][1],n]])),h=ie(h,[["enter",o,n],["enter",l,n],["exit",l,n],["enter",a,n]]),k(n.parser.constructs.insideSpan.null,"expected `insideSpan` to be populated"),h=ie(h,Ke(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),h=ie(h,[["exit",a,n],["enter",s,n],["exit",s,n],["exit",o,n]]),e[t][1].end.offset-e[t][1].start.offset?(c=2,h=ie(h,[["enter",e[t][1],n],["exit",e[t][1],n]])):c=0,se(e,r-1,t-r+3,h),t=r+h.length-c-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function Pn(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,o=xt(r);let a;return l;function l(x){return k(x===u.asterisk||x===u.underscore,"expected asterisk or underscore"),a=x,e.enter("attentionSequence"),s(x)}function s(x){if(x===a)return e.consume(x),s;const h=e.exit("attentionSequence"),c=xt(x);k(t,"expected `attentionMarkers` to be populated");const f=!c||c===w.characterGroupPunctuation&&o||t.includes(x),d=!o||o===w.characterGroupPunctuation&&c||t.includes(r);return h._open=!!(a===u.asterisk?f:f&&(o||!d)),h._close=!!(a===u.asterisk?d:d&&(c||!f)),n(x)}}function kt(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const Rn={name:"autolink",tokenize:_n};function _n(e,n,t){let r=0;return o;function o(p){return k(p===u.lessThan,"expected `<`"),e.enter(i.autolink),e.enter(i.autolinkMarker),e.consume(p),e.exit(i.autolinkMarker),e.enter(i.autolinkProtocol),a}function a(p){return le(p)?(e.consume(p),l):h(p)}function l(p){return p===u.plusSign||p===u.dash||p===u.dot||ue(p)?(r=1,s(p)):h(p)}function s(p){return p===u.colon?(e.consume(p),r=0,x):(p===u.plusSign||p===u.dash||p===u.dot||ue(p))&&r++<w.autolinkSchemeSizeMax?(e.consume(p),s):(r=0,h(p))}function x(p){return p===u.greaterThan?(e.exit(i.autolinkProtocol),e.enter(i.autolinkMarker),e.consume(p),e.exit(i.autolinkMarker),e.exit(i.autolink),n):p===u.eof||p===u.space||p===u.lessThan||$e(p)?t(p):(e.consume(p),x)}function h(p){return p===u.atSign?(e.consume(p),c):En(p)?(e.consume(p),h):t(p)}function c(p){return ue(p)?f(p):t(p)}function f(p){return p===u.dot?(e.consume(p),r=0,c):p===u.greaterThan?(e.exit(i.autolinkProtocol).type=i.autolinkEmail,e.enter(i.autolinkMarker),e.consume(p),e.exit(i.autolinkMarker),e.exit(i.autolink),n):d(p)}function d(p){if((p===u.dash||ue(p))&&r++<w.autolinkDomainSizeMax){const A=p===u.dash?d:f;return e.consume(p),A}return t(p)}}const Pe={tokenize:Hn,partial:!0};function Hn(e,n,t){return r;function r(a){return _(a)?Q(e,o,i.linePrefix)(a):o(a)}function o(a){return a===u.eof||z(a)?n(a):t(a)}}const Rt={name:"blockQuote",tokenize:jn,continuation:{tokenize:Nn},exit:Vn};function jn(e,n,t){const r=this;return o;function o(l){if(l===u.greaterThan){const s=r.containerState;return k(s,"expected `containerState` to be defined in container"),s.open||(e.enter(i.blockQuote,{_container:!0}),s.open=!0),e.enter(i.blockQuotePrefix),e.enter(i.blockQuoteMarker),e.consume(l),e.exit(i.blockQuoteMarker),a}return t(l)}function a(l){return _(l)?(e.enter(i.blockQuotePrefixWhitespace),e.consume(l),e.exit(i.blockQuotePrefixWhitespace),e.exit(i.blockQuotePrefix),n):(e.exit(i.blockQuotePrefix),n(l))}}function Nn(e,n,t){const r=this;return o;function o(l){return _(l)?(k(r.parser.constructs.disable.null,"expected `disable.null` to be populated"),Q(e,a,i.linePrefix,r.parser.constructs.disable.null.includes("codeIndented")?void 0:w.tabSize)(l)):a(l)}function a(l){return e.attempt(Rt,n,t)(l)}}function Vn(e){e.exit(i.blockQuote)}const _t={name:"characterEscape",tokenize:Wn};function Wn(e,n,t){return r;function r(a){return k(a===u.backslash,"expected `\\`"),e.enter(i.characterEscape),e.enter(i.escapeMarker),e.consume(a),e.exit(i.escapeMarker),o}function o(a){return An(a)?(e.enter(i.characterEscapeValue),e.consume(a),e.exit(i.characterEscapeValue),e.exit(i.characterEscape),n):t(a)}}const bt=document.createElement("i");function et(e){const n="&"+e+";";bt.innerHTML=n;const t=bt.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}const Ht={name:"characterReference",tokenize:Qn};function Qn(e,n,t){const r=this;let o=0,a,l;return s;function s(f){return k(f===u.ampersand,"expected `&`"),e.enter(i.characterReference),e.enter(i.characterReferenceMarker),e.consume(f),e.exit(i.characterReferenceMarker),x}function x(f){return f===u.numberSign?(e.enter(i.characterReferenceMarkerNumeric),e.consume(f),e.exit(i.characterReferenceMarkerNumeric),h):(e.enter(i.characterReferenceValue),a=w.characterReferenceNamedSizeMax,l=ue,c(f))}function h(f){return f===u.uppercaseX||f===u.lowercaseX?(e.enter(i.characterReferenceMarkerHexadecimal),e.consume(f),e.exit(i.characterReferenceMarkerHexadecimal),e.enter(i.characterReferenceValue),a=w.characterReferenceHexadecimalSizeMax,l=zn,c):(e.enter(i.characterReferenceValue),a=w.characterReferenceDecimalSizeMax,l=Ye,c(f))}function c(f){if(f===u.semicolon&&o){const d=e.exit(i.characterReferenceValue);return l===ue&&!et(r.sliceSerialize(d))?t(f):(e.enter(i.characterReferenceMarker),e.consume(f),e.exit(i.characterReferenceMarker),e.exit(i.characterReference),n)}return l(f)&&o++<a?(e.consume(f),c):t(f)}}const yt={tokenize:Gn,partial:!0},St={name:"codeFenced",tokenize:Un,concrete:!0};function Un(e,n,t){const r=this,o={tokenize:O,partial:!0};let a=0,l=0,s;return x;function x(S){return h(S)}function h(S){k(S===u.graveAccent||S===u.tilde,"expected `` ` `` or `~`");const q=r.events[r.events.length-1];return a=q&&q[1].type===i.linePrefix?q[2].sliceSerialize(q[1],!0).length:0,s=S,e.enter(i.codeFenced),e.enter(i.codeFencedFence),e.enter(i.codeFencedFenceSequence),c(S)}function c(S){return S===s?(l++,e.consume(S),c):l<w.codeFencedSequenceSizeMin?t(S):(e.exit(i.codeFencedFenceSequence),_(S)?Q(e,f,i.whitespace)(S):f(S))}function f(S){return S===u.eof||z(S)?(e.exit(i.codeFencedFence),r.interrupt?n(S):e.check(yt,M,D)(S)):(e.enter(i.codeFencedFenceInfo),e.enter(i.chunkString,{contentType:w.contentTypeString}),d(S))}function d(S){return S===u.eof||z(S)?(e.exit(i.chunkString),e.exit(i.codeFencedFenceInfo),f(S)):_(S)?(e.exit(i.chunkString),e.exit(i.codeFencedFenceInfo),Q(e,p,i.whitespace)(S)):S===u.graveAccent&&S===s?t(S):(e.consume(S),d)}function p(S){return S===u.eof||z(S)?f(S):(e.enter(i.codeFencedFenceMeta),e.enter(i.chunkString,{contentType:w.contentTypeString}),A(S))}function A(S){return S===u.eof||z(S)?(e.exit(i.chunkString),e.exit(i.codeFencedFenceMeta),f(S)):S===u.graveAccent&&S===s?t(S):(e.consume(S),A)}function M(S){return k(z(S),"expected eol"),e.attempt(o,D,I)(S)}function I(S){return k(z(S),"expected eol"),e.enter(i.lineEnding),e.consume(S),e.exit(i.lineEnding),C}function C(S){return a>0&&_(S)?Q(e,P,i.linePrefix,a+1)(S):P(S)}function P(S){return S===u.eof||z(S)?e.check(yt,M,D)(S):(e.enter(i.codeFlowValue),E(S))}function E(S){return S===u.eof||z(S)?(e.exit(i.codeFlowValue),P(S)):(e.consume(S),E)}function D(S){return e.exit(i.codeFenced),n(S)}function O(S,q,N){let V=0;return U;function U(L){return k(z(L),"expected eol"),S.enter(i.lineEnding),S.consume(L),S.exit(i.lineEnding),$}function $(L){return k(r.parser.constructs.disable.null,"expected `disable.null` to be populated"),S.enter(i.codeFencedFence),_(L)?Q(S,R,i.linePrefix,r.parser.constructs.disable.null.includes("codeIndented")?void 0:w.tabSize)(L):R(L)}function R(L){return L===s?(S.enter(i.codeFencedFenceSequence),T(L)):N(L)}function T(L){return L===s?(V++,S.consume(L),T):V>=l?(S.exit(i.codeFencedFenceSequence),_(L)?Q(S,B,i.whitespace)(L):B(L)):N(L)}function B(L){return L===u.eof||z(L)?(S.exit(i.codeFencedFence),q(L)):N(L)}}}function Gn(e,n,t){const r=this;return o;function o(l){return l===u.eof?t(l):(k(z(l),"expected eol"),e.enter(i.lineEnding),e.consume(l),e.exit(i.lineEnding),a)}function a(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const je={name:"codeIndented",tokenize:Yn},$n={tokenize:Jn,partial:!0};function Yn(e,n,t){const r=this;return o;function o(h){return k(_(h)),e.enter(i.codeIndented),Q(e,a,i.linePrefix,w.tabSize+1)(h)}function a(h){const c=r.events[r.events.length-1];return c&&c[1].type===i.linePrefix&&c[2].sliceSerialize(c[1],!0).length>=w.tabSize?l(h):t(h)}function l(h){return h===u.eof?x(h):z(h)?e.attempt($n,l,x)(h):(e.enter(i.codeFlowValue),s(h))}function s(h){return h===u.eof||z(h)?(e.exit(i.codeFlowValue),l(h)):(e.consume(h),s)}function x(h){return e.exit(i.codeIndented),n(h)}}function Jn(e,n,t){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?t(l):z(l)?(e.enter(i.lineEnding),e.consume(l),e.exit(i.lineEnding),o):Q(e,a,i.linePrefix,w.tabSize+1)(l)}function a(l){const s=r.events[r.events.length-1];return s&&s[1].type===i.linePrefix&&s[2].sliceSerialize(s[1],!0).length>=w.tabSize?n(l):z(l)?o(l):t(l)}}const Xn={name:"codeText",tokenize:Kn,resolve:Zn,previous:jt};function Zn(e){let n=e.length-4,t=3,r,o;if((e[t][1].type===i.lineEnding||e[t][1].type==="space")&&(e[n][1].type===i.lineEnding||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type===i.codeTextData){e[t][1].type=i.codeTextPadding,e[n][1].type=i.codeTextPadding,t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)o===void 0?r!==n&&e[r][1].type!==i.lineEnding&&(o=r):(r===n||e[r][1].type===i.lineEnding)&&(e[o][1].type=i.codeTextData,r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),n-=r-o-2,r=o+2),o=void 0);return e}function jt(e){return e!==u.graveAccent||this.events[this.events.length-1][1].type===i.characterEscape}function Kn(e,n,t){const r=this;let o=0,a,l;return s;function s(d){return k(d===u.graveAccent,"expected `` ` ``"),k(jt.call(r,r.previous),"expected correct previous"),e.enter(i.codeText),e.enter(i.codeTextSequence),x(d)}function x(d){return d===u.graveAccent?(e.consume(d),o++,x):(e.exit(i.codeTextSequence),h(d))}function h(d){return d===u.eof?t(d):d===u.space?(e.enter("space"),e.consume(d),e.exit("space"),h):d===u.graveAccent?(l=e.enter(i.codeTextSequence),a=0,f(d)):z(d)?(e.enter(i.lineEnding),e.consume(d),e.exit(i.lineEnding),h):(e.enter(i.codeTextData),c(d))}function c(d){return d===u.eof||d===u.space||d===u.graveAccent||z(d)?(e.exit(i.codeTextData),h(d)):(e.consume(d),c)}function f(d){return d===u.graveAccent?(e.consume(d),a++,f):a===o?(e.exit(i.codeTextSequence),e.exit(i.codeText),n(d)):(l.type=i.codeTextData,c(d))}}function Nt(e){const n={};let t=-1,r,o,a,l,s,x,h;for(;++t<e.length;){for(;t in n;)t=n[t];if(r=e[t],t&&r[1].type===i.chunkFlow&&e[t-1][1].type===i.listItemPrefix&&(k(r[1]._tokenizer,"expected `_tokenizer` on subtokens"),x=r[1]._tokenizer.events,a=0,a<x.length&&x[a][1].type===i.lineEndingBlank&&(a+=2),a<x.length&&x[a][1].type===i.content))for(;++a<x.length&&x[a][1].type!==i.content;)x[a][1].type===i.chunkText&&(x[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,er(e,t)),t=n[t],h=!0);else if(r[1]._container){for(a=t,o=void 0;a--&&(l=e[a],l[1].type===i.lineEnding||l[1].type===i.lineEndingBlank);)l[0]==="enter"&&(o&&(e[o][1].type=i.lineEndingBlank),l[1].type=i.lineEnding,o=a);o&&(r[1].end=Object.assign({},e[o][1].start),s=e.slice(o,t),s.unshift(r),se(e,o,t-o+1,s))}}return!h}function er(e,n){const t=e[n][1],r=e[n][2];let o=n-1;const a=[];k(t.contentType,"expected `contentType` on subtokens");const l=t._tokenizer||r.parser[t.contentType](t.start),s=l.events,x=[],h={};let c,f,d=-1,p=t,A=0,M=0;const I=[M];for(;p;){for(;e[++o][1]!==p;);k(!f||p.previous===f,"expected previous to match"),k(!f||f.next===p,"expected next to match"),a.push(o),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(u.eof),f&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(c),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=t;++d<s.length;)s[d][0]==="exit"&&s[d-1][0]==="enter"&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(k(p,"expected a current token"),M=d+1,I.push(M),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0,k(!p.next,"expected no next token")):I.pop(),d=I.length;d--;){const C=s.slice(I[d],I[d+1]),P=a.pop();k(P!==void 0,"expected a start position when splicing"),x.unshift([P,P+C.length-1]),se(e,P,2,C)}for(d=-1;++d<x.length;)h[A+x[d][0]]=A+x[d][1],A+=x[d][1]-x[d][0]-1;return h}const tr={tokenize:ir,resolve:rr},nr={tokenize:ar,partial:!0};function rr(e){return Nt(e),e}function ir(e,n){let t;return r;function r(s){return k(s!==u.eof&&!z(s),"expected no eof or eol"),e.enter(i.content),t=e.enter(i.chunkContent,{contentType:w.contentTypeContent}),o(s)}function o(s){return s===u.eof?a(s):z(s)?e.check(nr,l,a)(s):(e.consume(s),o)}function a(s){return e.exit(i.chunkContent),e.exit(i.content),n(s)}function l(s){return k(z(s),"expected eol"),e.consume(s),e.exit(i.chunkContent),k(t,"expected previous token"),t.next=e.enter(i.chunkContent,{contentType:w.contentTypeContent,previous:t}),t=t.next,o}}function ar(e,n,t){const r=this;return o;function o(l){return k(z(l),"expected a line ending"),e.exit(i.chunkContent),e.enter(i.lineEnding),e.consume(l),e.exit(i.lineEnding),Q(e,a,i.linePrefix)}function a(l){if(l===u.eof||z(l))return t(l);k(r.parser.constructs.disable.null,"expected `disable.null` to be populated");const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type===i.linePrefix&&s[2].sliceSerialize(s[1],!0).length>=w.tabSize?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function Vt(e,n,t,r,o,a,l,s,x){const h=x||Number.POSITIVE_INFINITY;let c=0;return f;function f(C){return C===u.lessThan?(e.enter(r),e.enter(o),e.enter(a),e.consume(C),e.exit(a),d):C===u.eof||C===u.space||C===u.rightParenthesis||$e(C)?t(C):(e.enter(r),e.enter(l),e.enter(s),e.enter(i.chunkString,{contentType:w.contentTypeString}),M(C))}function d(C){return C===u.greaterThan?(e.enter(a),e.consume(C),e.exit(a),e.exit(o),e.exit(r),n):(e.enter(s),e.enter(i.chunkString,{contentType:w.contentTypeString}),p(C))}function p(C){return C===u.greaterThan?(e.exit(i.chunkString),e.exit(s),d(C)):C===u.eof||C===u.lessThan||z(C)?t(C):(e.consume(C),C===u.backslash?A:p)}function A(C){return C===u.lessThan||C===u.greaterThan||C===u.backslash?(e.consume(C),p):p(C)}function M(C){return!c&&(C===u.eof||C===u.rightParenthesis||ee(C))?(e.exit(i.chunkString),e.exit(s),e.exit(l),e.exit(r),n(C)):c<h&&C===u.leftParenthesis?(e.consume(C),c++,M):C===u.rightParenthesis?(e.consume(C),c--,M):C===u.eof||C===u.space||C===u.leftParenthesis||$e(C)?t(C):(e.consume(C),C===u.backslash?I:M)}function I(C){return C===u.leftParenthesis||C===u.rightParenthesis||C===u.backslash?(e.consume(C),M):M(C)}}function Wt(e,n,t,r,o,a){const l=this;let s=0,x;return h;function h(p){return k(p===u.leftSquareBracket,"expected `[`"),e.enter(r),e.enter(o),e.consume(p),e.exit(o),e.enter(a),c}function c(p){return s>w.linkReferenceSizeMax||p===u.eof||p===u.leftSquareBracket||p===u.rightSquareBracket&&!x||p===u.caret&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?t(p):p===u.rightSquareBracket?(e.exit(a),e.enter(o),e.consume(p),e.exit(o),e.exit(r),n):z(p)?(e.enter(i.lineEnding),e.consume(p),e.exit(i.lineEnding),c):(e.enter(i.chunkString,{contentType:w.contentTypeString}),f(p))}function f(p){return p===u.eof||p===u.leftSquareBracket||p===u.rightSquareBracket||z(p)||s++>w.linkReferenceSizeMax?(e.exit(i.chunkString),c(p)):(e.consume(p),x||(x=!_(p)),p===u.backslash?d:f)}function d(p){return p===u.leftSquareBracket||p===u.backslash||p===u.rightSquareBracket?(e.consume(p),s++,f):f(p)}}function Qt(e,n,t,r,o,a){let l;return s;function s(d){return d===u.quotationMark||d===u.apostrophe||d===u.leftParenthesis?(e.enter(r),e.enter(o),e.consume(d),e.exit(o),l=d===u.leftParenthesis?u.rightParenthesis:d,x):t(d)}function x(d){return d===l?(e.enter(o),e.consume(d),e.exit(o),e.exit(r),n):(e.enter(a),h(d))}function h(d){return d===l?(e.exit(a),x(l)):d===u.eof?t(d):z(d)?(e.enter(i.lineEnding),e.consume(d),e.exit(i.lineEnding),Q(e,h,i.linePrefix)):(e.enter(i.chunkString,{contentType:w.contentTypeString}),c(d))}function c(d){return d===l||d===u.eof||z(d)?(e.exit(i.chunkString),h(d)):(e.consume(d),d===u.backslash?f:c)}function f(d){return d===l||d===u.backslash?(e.consume(d),c):c(d)}}function Be(e,n){let t;return r;function r(o){return z(o)?(e.enter(i.lineEnding),e.consume(o),e.exit(i.lineEnding),t=!0,r):_(o)?Q(e,r,t?i.linePrefix:i.lineSuffix)(o):n(o)}}const de={ht:" ",lf:`
|
|
4
4
|
`,cr:"\r",space:" ",replacementCharacter:"�"};function we(e){return e.replace(/[\t\n\r ]+/g,de.space).replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ur={name:"definition",tokenize:lr},or={tokenize:sr,partial:!0};function lr(e,n,t){const r=this;let o;return a;function a(p){return e.enter(i.definition),l(p)}function l(p){return k(p===u.leftSquareBracket,"expected `[`"),Wt.call(r,e,s,t,i.definitionLabel,i.definitionLabelMarker,i.definitionLabelString)(p)}function s(p){return o=we(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===u.colon?(e.enter(i.definitionMarker),e.consume(p),e.exit(i.definitionMarker),x):t(p)}function x(p){return ee(p)?Be(e,h)(p):h(p)}function h(p){return Vt(e,c,t,i.definitionDestination,i.definitionDestinationLiteral,i.definitionDestinationLiteralMarker,i.definitionDestinationRaw,i.definitionDestinationString)(p)}function c(p){return e.attempt(or,f,f)(p)}function f(p){return _(p)?Q(e,d,i.whitespace)(p):d(p)}function d(p){return p===u.eof||z(p)?(e.exit(i.definition),r.parser.defined.push(o),n(p)):t(p)}}function sr(e,n,t){return r;function r(s){return ee(s)?Be(e,o)(s):t(s)}function o(s){return Qt(e,a,t,i.definitionTitle,i.definitionTitleMarker,i.definitionTitleString)(s)}function a(s){return _(s)?Q(e,l,i.whitespace)(s):l(s)}function l(s){return s===u.eof||z(s)?n(s):t(s)}}const cr={name:"hardBreakEscape",tokenize:pr};function pr(e,n,t){return r;function r(a){return k(a===u.backslash,"expected `\\`"),e.enter(i.hardBreakEscape),e.consume(a),o}function o(a){return z(a)?(e.exit(i.hardBreakEscape),n(a)):t(a)}}const hr={name:"headingAtx",tokenize:dr,resolve:fr};function fr(e,n){let t=e.length-2,r=3,o,a;return e[r][1].type===i.whitespace&&(r+=2),t-2>r&&e[t][1].type===i.whitespace&&(t-=2),e[t][1].type===i.atxHeadingSequence&&(r===t-1||t-4>r&&e[t-2][1].type===i.whitespace)&&(t-=r+1===t?2:4),t>r&&(o={type:i.atxHeadingText,start:e[r][1].start,end:e[t][1].end},a={type:i.chunkText,start:e[r][1].start,end:e[t][1].end,contentType:w.contentTypeText},se(e,r,t-r+1,[["enter",o,n],["enter",a,n],["exit",a,n],["exit",o,n]])),e}function dr(e,n,t){let r=0;return o;function o(c){return e.enter(i.atxHeading),a(c)}function a(c){return k(c===u.numberSign,"expected `#`"),e.enter(i.atxHeadingSequence),l(c)}function l(c){return c===u.numberSign&&r++<w.atxHeadingOpeningFenceSizeMax?(e.consume(c),l):c===u.eof||ee(c)?(e.exit(i.atxHeadingSequence),s(c)):t(c)}function s(c){return c===u.numberSign?(e.enter(i.atxHeadingSequence),x(c)):c===u.eof||z(c)?(e.exit(i.atxHeading),n(c)):_(c)?Q(e,s,i.whitespace)(c):(e.enter(i.atxHeadingText),h(c))}function x(c){return c===u.numberSign?(e.consume(c),x):(e.exit(i.atxHeadingSequence),s(c))}function h(c){return c===u.eof||c===u.numberSign||ee(c)?(e.exit(i.atxHeadingText),s(c)):(e.consume(c),h)}}const mr=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ct=["pre","script","style","textarea"],gr={name:"htmlFlow",tokenize:yr,resolveTo:br,concrete:!0},xr={tokenize:Cr,partial:!0},kr={tokenize:Sr,partial:!0};function br(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type===i.htmlFlow););return n>1&&e[n-2][1].type===i.linePrefix&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function yr(e,n,t){const r=this;let o,a,l,s,x;return h;function h(g){return c(g)}function c(g){return k(g===u.lessThan,"expected `<`"),e.enter(i.htmlFlow),e.enter(i.htmlFlowData),e.consume(g),f}function f(g){return g===u.exclamationMark?(e.consume(g),d):g===u.slash?(e.consume(g),a=!0,M):g===u.questionMark?(e.consume(g),o=w.htmlInstruction,r.interrupt?n:m):le(g)?(e.consume(g),l=String.fromCharCode(g),I):t(g)}function d(g){return g===u.dash?(e.consume(g),o=w.htmlComment,p):g===u.leftSquareBracket?(e.consume(g),o=w.htmlCdata,s=0,A):le(g)?(e.consume(g),o=w.htmlDeclaration,r.interrupt?n:m):t(g)}function p(g){return g===u.dash?(e.consume(g),r.interrupt?n:m):t(g)}function A(g){const te=w.cdataOpeningString;return g===te.charCodeAt(s++)?(e.consume(g),s===te.length?r.interrupt?n:R:A):t(g)}function M(g){return le(g)?(e.consume(g),l=String.fromCharCode(g),I):t(g)}function I(g){if(g===u.eof||g===u.slash||g===u.greaterThan||ee(g)){const te=g===u.slash,Ce=l.toLowerCase();return!te&&!a&&Ct.includes(Ce)?(o=w.htmlRaw,r.interrupt?n(g):R(g)):mr.includes(l.toLowerCase())?(o=w.htmlBasic,te?(e.consume(g),C):r.interrupt?n(g):R(g)):(o=w.htmlComplete,r.interrupt&&!r.parser.lazy[r.now().line]?t(g):a?P(g):E(g))}return g===u.dash||ue(g)?(e.consume(g),l+=String.fromCharCode(g),I):t(g)}function C(g){return g===u.greaterThan?(e.consume(g),r.interrupt?n:R):t(g)}function P(g){return _(g)?(e.consume(g),P):U(g)}function E(g){return g===u.slash?(e.consume(g),U):g===u.colon||g===u.underscore||le(g)?(e.consume(g),D):_(g)?(e.consume(g),E):U(g)}function D(g){return g===u.dash||g===u.dot||g===u.colon||g===u.underscore||ue(g)?(e.consume(g),D):O(g)}function O(g){return g===u.equalsTo?(e.consume(g),S):_(g)?(e.consume(g),O):E(g)}function S(g){return g===u.eof||g===u.lessThan||g===u.equalsTo||g===u.greaterThan||g===u.graveAccent?t(g):g===u.quotationMark||g===u.apostrophe?(e.consume(g),x=g,q):_(g)?(e.consume(g),S):N(g)}function q(g){return g===x?(e.consume(g),x=null,V):g===u.eof||z(g)?t(g):(e.consume(g),q)}function N(g){return g===u.eof||g===u.quotationMark||g===u.apostrophe||g===u.slash||g===u.lessThan||g===u.equalsTo||g===u.greaterThan||g===u.graveAccent||ee(g)?O(g):(e.consume(g),N)}function V(g){return g===u.slash||g===u.greaterThan||_(g)?E(g):t(g)}function U(g){return g===u.greaterThan?(e.consume(g),$):t(g)}function $(g){return g===u.eof||z(g)?R(g):_(g)?(e.consume(g),$):t(g)}function R(g){return g===u.dash&&o===w.htmlComment?(e.consume(g),G):g===u.lessThan&&o===w.htmlRaw?(e.consume(g),J):g===u.greaterThan&&o===w.htmlDeclaration?(e.consume(g),re):g===u.questionMark&&o===w.htmlInstruction?(e.consume(g),m):g===u.rightSquareBracket&&o===w.htmlCdata?(e.consume(g),oe):z(g)&&(o===w.htmlBasic||o===w.htmlComplete)?(e.exit(i.htmlFlowData),e.check(xr,ce,T)(g)):g===u.eof||z(g)?(e.exit(i.htmlFlowData),T(g)):(e.consume(g),R)}function T(g){return e.check(kr,B,ce)(g)}function B(g){return k(z(g)),e.enter(i.lineEnding),e.consume(g),e.exit(i.lineEnding),L}function L(g){return g===u.eof||z(g)?T(g):(e.enter(i.htmlFlowData),R(g))}function G(g){return g===u.dash?(e.consume(g),m):R(g)}function J(g){return g===u.slash?(e.consume(g),l="",ne):R(g)}function ne(g){if(g===u.greaterThan){const te=l.toLowerCase();return Ct.includes(te)?(e.consume(g),re):R(g)}return le(g)&&l.length<w.htmlRawSizeMax?(e.consume(g),l+=String.fromCharCode(g),ne):R(g)}function oe(g){return g===u.rightSquareBracket?(e.consume(g),m):R(g)}function m(g){return g===u.greaterThan?(e.consume(g),re):g===u.dash&&o===w.htmlComment?(e.consume(g),m):R(g)}function re(g){return g===u.eof||z(g)?(e.exit(i.htmlFlowData),ce(g)):(e.consume(g),re)}function ce(g){return e.exit(i.htmlFlow),n(g)}}function Sr(e,n,t){const r=this;return o;function o(l){return z(l)?(e.enter(i.lineEnding),e.consume(l),e.exit(i.lineEnding),a):t(l)}function a(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function Cr(e,n,t){return r;function r(o){return k(z(o),"expected a line ending"),e.enter(i.lineEnding),e.consume(o),e.exit(i.lineEnding),e.attempt(Pe,n,t)}}const Fr={name:"htmlText",tokenize:wr};function wr(e,n,t){const r=this;let o,a,l;return s;function s(m){return k(m===u.lessThan,"expected `<`"),e.enter(i.htmlText),e.enter(i.htmlTextData),e.consume(m),x}function x(m){return m===u.exclamationMark?(e.consume(m),h):m===u.slash?(e.consume(m),O):m===u.questionMark?(e.consume(m),E):le(m)?(e.consume(m),N):t(m)}function h(m){return m===u.dash?(e.consume(m),c):m===u.leftSquareBracket?(e.consume(m),a=0,A):le(m)?(e.consume(m),P):t(m)}function c(m){return m===u.dash?(e.consume(m),p):t(m)}function f(m){return m===u.eof?t(m):m===u.dash?(e.consume(m),d):z(m)?(l=f,J(m)):(e.consume(m),f)}function d(m){return m===u.dash?(e.consume(m),p):f(m)}function p(m){return m===u.greaterThan?G(m):m===u.dash?d(m):f(m)}function A(m){const re=w.cdataOpeningString;return m===re.charCodeAt(a++)?(e.consume(m),a===re.length?M:A):t(m)}function M(m){return m===u.eof?t(m):m===u.rightSquareBracket?(e.consume(m),I):z(m)?(l=M,J(m)):(e.consume(m),M)}function I(m){return m===u.rightSquareBracket?(e.consume(m),C):M(m)}function C(m){return m===u.greaterThan?G(m):m===u.rightSquareBracket?(e.consume(m),C):M(m)}function P(m){return m===u.eof||m===u.greaterThan?G(m):z(m)?(l=P,J(m)):(e.consume(m),P)}function E(m){return m===u.eof?t(m):m===u.questionMark?(e.consume(m),D):z(m)?(l=E,J(m)):(e.consume(m),E)}function D(m){return m===u.greaterThan?G(m):E(m)}function O(m){return le(m)?(e.consume(m),S):t(m)}function S(m){return m===u.dash||ue(m)?(e.consume(m),S):q(m)}function q(m){return z(m)?(l=q,J(m)):_(m)?(e.consume(m),q):G(m)}function N(m){return m===u.dash||ue(m)?(e.consume(m),N):m===u.slash||m===u.greaterThan||ee(m)?V(m):t(m)}function V(m){return m===u.slash?(e.consume(m),G):m===u.colon||m===u.underscore||le(m)?(e.consume(m),U):z(m)?(l=V,J(m)):_(m)?(e.consume(m),V):G(m)}function U(m){return m===u.dash||m===u.dot||m===u.colon||m===u.underscore||ue(m)?(e.consume(m),U):$(m)}function $(m){return m===u.equalsTo?(e.consume(m),R):z(m)?(l=$,J(m)):_(m)?(e.consume(m),$):V(m)}function R(m){return m===u.eof||m===u.lessThan||m===u.equalsTo||m===u.greaterThan||m===u.graveAccent?t(m):m===u.quotationMark||m===u.apostrophe?(e.consume(m),o=m,T):z(m)?(l=R,J(m)):_(m)?(e.consume(m),R):(e.consume(m),B)}function T(m){return m===o?(e.consume(m),o=void 0,L):m===u.eof?t(m):z(m)?(l=T,J(m)):(e.consume(m),T)}function B(m){return m===u.eof||m===u.quotationMark||m===u.apostrophe||m===u.lessThan||m===u.equalsTo||m===u.graveAccent?t(m):m===u.slash||m===u.greaterThan||ee(m)?V(m):(e.consume(m),B)}function L(m){return m===u.slash||m===u.greaterThan||ee(m)?V(m):t(m)}function G(m){return m===u.greaterThan?(e.consume(m),e.exit(i.htmlTextData),e.exit(i.htmlText),n):t(m)}function J(m){return k(l,"expected return state"),k(z(m),"expected eol"),e.exit(i.htmlTextData),e.enter(i.lineEnding),e.consume(m),e.exit(i.lineEnding),ne}function ne(m){return k(r.parser.constructs.disable.null,"expected `disable.null` to be populated"),_(m)?Q(e,oe,i.linePrefix,r.parser.constructs.disable.null.includes("codeIndented")?void 0:w.tabSize)(m):oe(m)}function oe(m){return e.enter(i.htmlTextData),l(m)}}const tt={name:"labelEnd",tokenize:Br,resolveTo:Ir,resolveAll:Ar},Tr={tokenize:Mr},Er={tokenize:Dr},zr={tokenize:Lr};function Ar(e){let n=-1;for(;++n<e.length;){const t=e[n][1];(t.type===i.labelImage||t.type===i.labelLink||t.type===i.labelEnd)&&(e.splice(n+1,t.type===i.labelImage?4:2),t.type=i.data,n++)}return e}function Ir(e,n){let t=e.length,r=0,o,a,l,s;for(;t--;)if(o=e[t][1],a){if(o.type===i.link||o.type===i.labelLink&&o._inactive)break;e[t][0]==="enter"&&o.type===i.labelLink&&(o._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(o.type===i.labelImage||o.type===i.labelLink)&&!o._balanced&&(a=t,o.type!==i.labelLink)){r=2;break}}else o.type===i.labelEnd&&(l=t);k(a!==void 0,"`open` is supposed to be found"),k(l!==void 0,"`close` is supposed to be found");const x={type:e[a][1].type===i.labelLink?i.link:i.image,start:Object.assign({},e[a][1].start),end:Object.assign({},e[e.length-1][1].end)},h={type:i.label,start:Object.assign({},e[a][1].start),end:Object.assign({},e[l][1].end)},c={type:i.labelText,start:Object.assign({},e[a+r+2][1].end),end:Object.assign({},e[l-2][1].start)};return s=[["enter",x,n],["enter",h,n]],s=ie(s,e.slice(a+1,a+r+3)),s=ie(s,[["enter",c,n]]),k(n.parser.constructs.insideSpan.null,"expected `insideSpan.null` to be populated"),s=ie(s,Ke(n.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),n)),s=ie(s,[["exit",c,n],e[l-2],e[l-1],["exit",h,n]]),s=ie(s,e.slice(l+1)),s=ie(s,[["exit",x,n]]),se(e,a,e.length,s),e}function Br(e,n,t){const r=this;let o=r.events.length,a,l;for(;o--;)if((r.events[o][1].type===i.labelImage||r.events[o][1].type===i.labelLink)&&!r.events[o][1]._balanced){a=r.events[o][1];break}return s;function s(d){return k(d===u.rightSquareBracket,"expected `]`"),a?a._inactive?f(d):(l=r.parser.defined.includes(we(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(i.labelEnd),e.enter(i.labelMarker),e.consume(d),e.exit(i.labelMarker),e.exit(i.labelEnd),x):t(d)}function x(d){return d===u.leftParenthesis?e.attempt(Tr,c,l?c:f)(d):d===u.leftSquareBracket?e.attempt(Er,c,l?h:f)(d):l?c(d):f(d)}function h(d){return e.attempt(zr,c,f)(d)}function c(d){return n(d)}function f(d){return a._balanced=!0,t(d)}}function Mr(e,n,t){return r;function r(f){return k(f===u.leftParenthesis,"expected left paren"),e.enter(i.resource),e.enter(i.resourceMarker),e.consume(f),e.exit(i.resourceMarker),o}function o(f){return ee(f)?Be(e,a)(f):a(f)}function a(f){return f===u.rightParenthesis?c(f):Vt(e,l,s,i.resourceDestination,i.resourceDestinationLiteral,i.resourceDestinationLiteralMarker,i.resourceDestinationRaw,i.resourceDestinationString,w.linkResourceDestinationBalanceMax)(f)}function l(f){return ee(f)?Be(e,x)(f):c(f)}function s(f){return t(f)}function x(f){return f===u.quotationMark||f===u.apostrophe||f===u.leftParenthesis?Qt(e,h,t,i.resourceTitle,i.resourceTitleMarker,i.resourceTitleString)(f):c(f)}function h(f){return ee(f)?Be(e,c)(f):c(f)}function c(f){return f===u.rightParenthesis?(e.enter(i.resourceMarker),e.consume(f),e.exit(i.resourceMarker),e.exit(i.resource),n):t(f)}}function Dr(e,n,t){const r=this;return o;function o(s){return k(s===u.leftSquareBracket,"expected left bracket"),Wt.call(r,e,a,l,i.reference,i.referenceMarker,i.referenceString)(s)}function a(s){return r.parser.defined.includes(we(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(s):t(s)}function l(s){return t(s)}}function Lr(e,n,t){return r;function r(a){return k(a===u.leftSquareBracket,"expected left bracket"),e.enter(i.reference),e.enter(i.referenceMarker),e.consume(a),e.exit(i.referenceMarker),o}function o(a){return a===u.rightSquareBracket?(e.enter(i.referenceMarker),e.consume(a),e.exit(i.referenceMarker),e.exit(i.reference),n):t(a)}}const Or={name:"labelStartImage",tokenize:qr,resolveAll:tt.resolveAll};function qr(e,n,t){const r=this;return o;function o(s){return k(s===u.exclamationMark,"expected `!`"),e.enter(i.labelImage),e.enter(i.labelImageMarker),e.consume(s),e.exit(i.labelImageMarker),a}function a(s){return s===u.leftSquareBracket?(e.enter(i.labelMarker),e.consume(s),e.exit(i.labelMarker),e.exit(i.labelImage),l):t(s)}function l(s){return s===u.caret&&"_hiddenFootnoteSupport"in r.parser.constructs?t(s):n(s)}}const vr={name:"labelStartLink",tokenize:Pr,resolveAll:tt.resolveAll};function Pr(e,n,t){const r=this;return o;function o(l){return k(l===u.leftSquareBracket,"expected `[`"),e.enter(i.labelLink),e.enter(i.labelMarker),e.consume(l),e.exit(i.labelMarker),e.exit(i.labelLink),a}function a(l){return l===u.caret&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const Ne={name:"lineEnding",tokenize:Rr};function Rr(e,n){return t;function t(r){return k(z(r),"expected eol"),e.enter(i.lineEnding),e.consume(r),e.exit(i.lineEnding),Q(e,n,i.linePrefix)}}const Oe={name:"thematicBreak",tokenize:_r};function _r(e,n,t){let r=0,o;return a;function a(h){return e.enter(i.thematicBreak),l(h)}function l(h){return k(h===u.asterisk||h===u.dash||h===u.underscore,"expected `*`, `-`, or `_`"),o=h,s(h)}function s(h){return h===o?(e.enter(i.thematicBreakSequence),x(h)):r>=w.thematicBreakMarkerCountMin&&(h===u.eof||z(h))?(e.exit(i.thematicBreak),n(h)):t(h)}function x(h){return h===o?(e.consume(h),r++,x):(e.exit(i.thematicBreakSequence),_(h)?Q(e,s,i.whitespace)(h):s(h))}}const K={name:"list",tokenize:Nr,continuation:{tokenize:Vr},exit:Qr},Hr={tokenize:Ur,partial:!0},jr={tokenize:Wr,partial:!0};function Nr(e,n,t){const r=this,o=r.events[r.events.length-1];let a=o&&o[1].type===i.linePrefix?o[2].sliceSerialize(o[1],!0).length:0,l=0;return s;function s(p){k(r.containerState,"expected state");const A=r.containerState.type||(p===u.asterisk||p===u.plusSign||p===u.dash?i.listUnordered:i.listOrdered);if(A===i.listUnordered?!r.containerState.marker||p===r.containerState.marker:Ye(p)){if(r.containerState.type||(r.containerState.type=A,e.enter(A,{_container:!0})),A===i.listUnordered)return e.enter(i.listItemPrefix),p===u.asterisk||p===u.dash?e.check(Oe,t,h)(p):h(p);if(!r.interrupt||p===u.digit1)return e.enter(i.listItemPrefix),e.enter(i.listItemValue),x(p)}return t(p)}function x(p){return k(r.containerState,"expected state"),Ye(p)&&++l<w.listItemValueSizeMax?(e.consume(p),x):(!r.interrupt||l<2)&&(r.containerState.marker?p===r.containerState.marker:p===u.rightParenthesis||p===u.dot)?(e.exit(i.listItemValue),h(p)):t(p)}function h(p){return k(r.containerState,"expected state"),k(p!==u.eof,"eof (`null`) is not a marker"),e.enter(i.listItemMarker),e.consume(p),e.exit(i.listItemMarker),r.containerState.marker=r.containerState.marker||p,e.check(Pe,r.interrupt?t:c,e.attempt(Hr,d,f))}function c(p){return k(r.containerState,"expected state"),r.containerState.initialBlankLine=!0,a++,d(p)}function f(p){return _(p)?(e.enter(i.listItemPrefixWhitespace),e.consume(p),e.exit(i.listItemPrefixWhitespace),d):t(p)}function d(p){return k(r.containerState,"expected state"),r.containerState.size=a+r.sliceSerialize(e.exit(i.listItemPrefix),!0).length,n(p)}}function Vr(e,n,t){const r=this;return k(r.containerState,"expected state"),r.containerState._closeFlow=void 0,e.check(Pe,o,a);function o(s){return k(r.containerState,"expected state"),k(typeof r.containerState.size=="number","expected size"),r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,n,i.listItemIndent,r.containerState.size+1)(s)}function a(s){return k(r.containerState,"expected state"),r.containerState.furtherBlankLines||!_(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(jr,n,l)(s))}function l(s){return k(r.containerState,"expected state"),r.containerState._closeFlow=!0,r.interrupt=void 0,k(r.parser.constructs.disable.null,"expected `disable.null` to be populated"),Q(e,e.attempt(K,n,t),i.linePrefix,r.parser.constructs.disable.null.includes("codeIndented")?void 0:w.tabSize)(s)}}function Wr(e,n,t){const r=this;return k(r.containerState,"expected state"),k(typeof r.containerState.size=="number","expected size"),Q(e,o,i.listItemIndent,r.containerState.size+1);function o(a){k(r.containerState,"expected state");const l=r.events[r.events.length-1];return l&&l[1].type===i.listItemIndent&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(a):t(a)}}function Qr(e){k(this.containerState,"expected state"),k(typeof this.containerState.type=="string","expected type"),e.exit(this.containerState.type)}function Ur(e,n,t){const r=this;return k(r.parser.constructs.disable.null,"expected `disable.null` to be populated"),Q(e,o,i.listItemPrefixWhitespace,r.parser.constructs.disable.null.includes("codeIndented")?void 0:w.tabSize+1);function o(a){const l=r.events[r.events.length-1];return!_(a)&&l&&l[1].type===i.listItemPrefixWhitespace?n(a):t(a)}}const Ft={name:"setextUnderline",tokenize:$r,resolveTo:Gr};function Gr(e,n){let t=e.length,r,o,a;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type===i.content){r=t;break}e[t][1].type===i.paragraph&&(o=t)}else e[t][1].type===i.content&&e.splice(t,1),!a&&e[t][1].type===i.definition&&(a=t);k(o!==void 0,"expected a `text` index to be found"),k(r!==void 0,"expected a `text` index to be found");const l={type:i.setextHeading,start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[o][1].type=i.setextHeadingText,a?(e.splice(o,0,["enter",l,n]),e.splice(a+1,0,["exit",e[r][1],n]),e[r][1].end=Object.assign({},e[a][1].end)):e[r][1]=l,e.push(["exit",l,n]),e}function $r(e,n,t){const r=this;let o;return a;function a(h){let c=r.events.length,f;for(k(h===u.dash||h===u.equalsTo,"expected `=` or `-`");c--;)if(r.events[c][1].type!==i.lineEnding&&r.events[c][1].type!==i.linePrefix&&r.events[c][1].type!==i.content){f=r.events[c][1].type===i.paragraph;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter(i.setextHeadingLine),o=h,l(h)):t(h)}function l(h){return e.enter(i.setextHeadingLineSequence),s(h)}function s(h){return h===o?(e.consume(h),s):(e.exit(i.setextHeadingLineSequence),_(h)?Q(e,x,i.lineSuffix)(h):x(h))}function x(h){return h===u.eof||z(h)?(e.exit(i.setextHeadingLine),n(h)):t(h)}}const Yr={tokenize:Jr};function Jr(e){const n=this,t=e.attempt(Pe,r,e.attempt(this.parser.constructs.flowInitial,o,Q(e,e.attempt(this.parser.constructs.flow,o,e.attempt(tr,o)),i.linePrefix)));return t;function r(a){if(k(a===u.eof||z(a),"expected eol or eof"),a===u.eof){e.consume(a);return}return e.enter(i.lineEndingBlank),e.consume(a),e.exit(i.lineEndingBlank),n.currentConstruct=void 0,t}function o(a){if(k(a===u.eof||z(a),"expected eol or eof"),a===u.eof){e.consume(a);return}return e.enter(i.lineEnding),e.consume(a),e.exit(i.lineEnding),n.currentConstruct=void 0,t}}const Xr={resolveAll:Gt()},Zr=Ut("string"),Kr=Ut("text");function Ut(e){return{tokenize:n,resolveAll:Gt(e==="text"?ei:void 0)};function n(t){const r=this,o=this.parser.constructs[e],a=t.attempt(o,l,s);return l;function l(c){return h(c)?a(c):s(c)}function s(c){if(c===u.eof){t.consume(c);return}return t.enter(i.data),t.consume(c),x}function x(c){return h(c)?(t.exit(i.data),a(c)):(t.consume(c),x)}function h(c){if(c===u.eof)return!0;const f=o[c];let d=-1;if(f)for(k(Array.isArray(f),"expected `disable.null` to be populated");++d<f.length;){const p=f[d];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Gt(e){return n;function n(t,r){let o=-1,a;for(;++o<=t.length;)a===void 0?t[o]&&t[o][1].type===i.data&&(a=o,o++):(!t[o]||t[o][1].type!==i.data)&&(o!==a+2&&(t[a][1].end=t[o-1][1].end,t.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(t,r):t}}function ei(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type===i.lineEnding)&&e[t-1][1].type===i.data){const r=e[t-1][1],o=n.sliceStream(r);let a=o.length,l=-1,s=0,x;for(;a--;){const h=o[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===u.space;)s++,l--;if(l)break;l=-1}else if(h===u.horizontalTab)x=!0,s++;else if(h!==u.virtualSpace){a++;break}}if(s){const h={type:t===e.length||x||s<w.hardBreakPrefixSizeMin?i.lineSuffix:i.hardBreakTrailing,start:{line:r.end.line,column:r.end.column-s,offset:r.end.offset-s,_index:r.start._index+a,_bufferIndex:a?l:r.start._bufferIndex+l},end:Object.assign({},r.end)};r.end=Object.assign({},h.start),r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(t,0,["enter",h,n],["exit",h,n]),t+=2)}t++}return e}var De={exports:{}},Ve,wt;function ti(){if(wt)return Ve;wt=1;var e=1e3,n=e*60,t=n*60,r=t*24,o=r*7,a=r*365.25;Ve=function(c,f){f=f||{};var d=typeof c;if(d==="string"&&c.length>0)return l(c);if(d==="number"&&isFinite(c))return f.long?x(c):s(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function l(c){if(c=String(c),!(c.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(f){var d=parseFloat(f[1]),p=(f[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return d*a;case"weeks":case"week":case"w":return d*o;case"days":case"day":case"d":return d*r;case"hours":case"hour":case"hrs":case"hr":case"h":return d*t;case"minutes":case"minute":case"mins":case"min":case"m":return d*n;case"seconds":case"second":case"secs":case"sec":case"s":return d*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function s(c){var f=Math.abs(c);return f>=r?Math.round(c/r)+"d":f>=t?Math.round(c/t)+"h":f>=n?Math.round(c/n)+"m":f>=e?Math.round(c/e)+"s":c+"ms"}function x(c){var f=Math.abs(c);return f>=r?h(c,f,r,"day"):f>=t?h(c,f,t,"hour"):f>=n?h(c,f,n,"minute"):f>=e?h(c,f,e,"second"):c+" ms"}function h(c,f,d,p){var A=f>=d*1.5;return Math.round(c/d)+" "+p+(A?"s":"")}return Ve}var We,Tt;function ni(){if(Tt)return We;Tt=1;function e(n){r.debug=r,r.default=r,r.coerce=h,r.disable=s,r.enable=a,r.enabled=x,r.humanize=ti(),r.destroy=c,Object.keys(n).forEach(f=>{r[f]=n[f]}),r.names=[],r.skips=[],r.formatters={};function t(f){let d=0;for(let p=0;p<f.length;p++)d=(d<<5)-d+f.charCodeAt(p),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=t;function r(f){let d,p=null,A,M;function I(...C){if(!I.enabled)return;const P=I,E=Number(new Date),D=E-(d||E);P.diff=D,P.prev=d,P.curr=E,d=E,C[0]=r.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let O=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(q,N)=>{if(q==="%%")return"%";O++;const V=r.formatters[N];if(typeof V=="function"){const U=C[O];q=V.call(P,U),C.splice(O,1),O--}return q}),r.formatArgs.call(P,C),(P.log||r.log).apply(P,C)}return I.namespace=f,I.useColors=r.useColors(),I.color=r.selectColor(f),I.extend=o,I.destroy=r.destroy,Object.defineProperty(I,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(A!==r.namespaces&&(A=r.namespaces,M=r.enabled(f)),M),set:C=>{p=C}}),typeof r.init=="function"&&r.init(I),I}function o(f,d){const p=r(this.namespace+(typeof d>"u"?":":d)+f);return p.log=this.log,p}function a(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];const d=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const p of d)p[0]==="-"?r.skips.push(p.slice(1)):r.names.push(p)}function l(f,d){let p=0,A=0,M=-1,I=0;for(;p<f.length;)if(A<d.length&&(d[A]===f[p]||d[A]==="*"))d[A]==="*"?(M=A,I=p,A++):(p++,A++);else if(M!==-1)A=M+1,I++,p=I;else return!1;for(;A<d.length&&d[A]==="*";)A++;return A===d.length}function s(){const f=[...r.names,...r.skips.map(d=>"-"+d)].join(",");return r.enable(""),f}function x(f){for(const d of r.skips)if(l(f,d))return!1;for(const d of r.names)if(l(f,d))return!0;return!1}function h(f){return f instanceof Error?f.stack||f.message:f}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}return We=e,We}var Et;function ri(){return Et||(Et=1,(function(e,n){var t={};n.formatArgs=o,n.save=a,n.load=l,n.useColors=r,n.storage=s(),n.destroy=(()=>{let h=!1;return()=>{h||(h=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let h;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(h=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(h[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(h){if(h[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+h[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;h.splice(1,0,c,"color: inherit");let f=0,d=0;h[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(f++,p==="%c"&&(d=f))}),h.splice(d,0,c)}n.log=console.debug||console.log||(()=>{});function a(h){try{h?n.storage.setItem("debug",h):n.storage.removeItem("debug")}catch{}}function l(){let h;try{h=n.storage.getItem("debug")||n.storage.getItem("DEBUG")}catch{}return!h&&typeof process<"u"&&"env"in process&&(h=t.DEBUG),h}function s(){try{return localStorage}catch{}}e.exports=ni()(n);const{formatters:x}=e.exports;x.j=function(h){try{return JSON.stringify(h)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(De,De.exports)),De.exports}var ii=ri();const ai=pn(ii),Se=ai("micromark");function ui(e,n,t){let r=Object.assign(t?Object.assign({},t):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},a=[];let l=[],s=[],x=!0;const h={consume:D,enter:O,exit:S,attempt:V(q),check:V(N),interrupt:V(N,{interrupt:!0})},c={previous:u.eof,code:u.eof,containerState:{},events:[],parser:e,sliceStream:M,sliceSerialize:A,now:I,defineSkip:C,write:p};let f=n.tokenize.call(c,h),d;return n.resolveAll&&a.push(n),c;function p(T){return l=ie(l,T),P(),l[l.length-1]!==u.eof?[]:(U(n,0),c.events=Ke(a,c.events,c),c.events)}function A(T,B){return li(M(T),B)}function M(T){return oi(l,T)}function I(){const{line:T,column:B,offset:L,_index:G,_bufferIndex:J}=r;return{line:T,column:B,offset:L,_index:G,_bufferIndex:J}}function C(T){o[T.line]=T.column,R(),Se("position: define skip: `%j`",r)}function P(){let T;for(;r._index<l.length;){const B=l[r._index];if(typeof B=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<B.length;)E(B.charCodeAt(r._bufferIndex));else E(B)}}function E(T){k(x===!0,"expected character to be consumed"),x=void 0,Se("main: passing `%s` to %s",T,f&&f.name),d=T,k(typeof f=="function","expected state"),f=f(T)}function D(T){k(T===d,"expected given code to equal expected code"),Se("consume: `%s`",T),k(x===void 0,"expected code to not have been consumed: this might be because `return x(code)` instead of `return x` was used"),k(T===null?c.events.length===0||c.events[c.events.length-1][0]==="exit":c.events[c.events.length-1][0]==="enter","expected last token to be open"),z(T)?(r.line++,r.column=1,r.offset+=T===u.carriageReturnLineFeed?2:1,R(),Se("position: after eol: `%j`",r)):T!==u.virtualSpace&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=T,x=!0}function O(T,B){const L=B||{};return L.type=T,L.start=I(),k(typeof T=="string","expected string type"),k(T.length>0,"expected non-empty string"),Se("enter: `%s`",T),c.events.push(["enter",L,c]),s.push(L),L}function S(T){k(typeof T=="string","expected string type"),k(T.length>0,"expected non-empty string");const B=s.pop();return k(B,"cannot close w/o open tokens"),B.end=I(),k(T===B.type,"expected exit token to match current token"),k(!(B.start._index===B.end._index&&B.start._bufferIndex===B.end._bufferIndex),"expected non-empty token (`"+T+"`)"),Se("exit: `%s`",B.type),c.events.push(["exit",B,c]),B}function q(T,B){U(T,B.from)}function N(T,B){B.restore()}function V(T,B){return L;function L(G,J,ne){let oe,m,re,ce;return Array.isArray(G)?te(G):"tokenize"in G?te([G]):g(G);function g(X){return Ee;function Ee(pe){const Fe=pe!==null&&X[pe],ye=pe!==null&&X.null,_e=[...Array.isArray(Fe)?Fe:Fe?[Fe]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return te(_e)(pe)}}function te(X){return oe=X,m=0,X.length===0?(k(ne,"expected `bogusState` to be given"),ne):Ce(X[m])}function Ce(X){return Ee;function Ee(pe){return ce=$(),re=X,X.partial||(c.currentConstruct=X),k(c.parser.constructs.disable.null,"expected `disable.null` to be populated"),X.name&&c.parser.constructs.disable.null.includes(X.name)?Te(pe):X.tokenize.call(B?Object.assign(Object.create(c),B):c,h,Re,Te)(pe)}}function Re(X){return k(X===d,"expected code"),x=!0,T(re,ce),J}function Te(X){return k(X===d,"expected code"),x=!0,ce.restore(),++m<oe.length?Ce(oe[m]):ne}}}function U(T,B){T.resolveAll&&!a.includes(T)&&a.push(T),T.resolve&&se(c.events,B,c.events.length-B,T.resolve(c.events.slice(B),c)),T.resolveTo&&(c.events=T.resolveTo(c.events,c)),k(T.partial||c.events.length===0||c.events[c.events.length-1][0]==="exit","expected last token to end")}function $(){const T=I(),B=c.previous,L=c.currentConstruct,G=c.events.length,J=Array.from(s);return{restore:ne,from:G};function ne(){r=T,c.previous=B,c.currentConstruct=L,c.events.length=G,s=J,R(),Se("position: restore: `%j`",r)}}function R(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function oi(e,n){const t=n.start._index,r=n.start._bufferIndex,o=n.end._index,a=n.end._bufferIndex;let l;if(t===o)k(a>-1,"expected non-negative end buffer index"),k(r>-1,"expected non-negative start buffer index"),l=[e[t].slice(r,a)];else{if(l=e.slice(t,o),r>-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):(k(r===0,"expected `startBufferIndex` to be `0`"),l.shift())}a>0&&l.push(e[o].slice(0,a))}return l}function li(e,n){let t=-1;const r=[];let o;for(;++t<e.length;){const a=e[t];let l;if(typeof a=="string")l=a;else switch(a){case u.carriageReturn:{l=de.cr;break}case u.lineFeed:{l=de.lf;break}case u.carriageReturnLineFeed:{l=de.cr+de.lf;break}case u.horizontalTab:{l=n?de.space:de.ht;break}case u.virtualSpace:{if(!n&&o)continue;l=de.space;break}default:k(typeof a=="number","expected number"),l=String.fromCharCode(a)}o=a===u.horizontalTab,r.push(l)}return r.join("")}const si={[u.asterisk]:K,[u.plusSign]:K,[u.dash]:K,[u.digit0]:K,[u.digit1]:K,[u.digit2]:K,[u.digit3]:K,[u.digit4]:K,[u.digit5]:K,[u.digit6]:K,[u.digit7]:K,[u.digit8]:K,[u.digit9]:K,[u.greaterThan]:Rt},ci={[u.leftSquareBracket]:ur},pi={[u.horizontalTab]:je,[u.virtualSpace]:je,[u.space]:je},hi={[u.numberSign]:hr,[u.asterisk]:Oe,[u.dash]:[Ft,Oe],[u.lessThan]:gr,[u.equalsTo]:Ft,[u.underscore]:Oe,[u.graveAccent]:St,[u.tilde]:St},fi={[u.ampersand]:Ht,[u.backslash]:_t},di={[u.carriageReturn]:Ne,[u.lineFeed]:Ne,[u.carriageReturnLineFeed]:Ne,[u.exclamationMark]:Or,[u.ampersand]:Ht,[u.asterisk]:Je,[u.lessThan]:[Rn,Fr],[u.leftSquareBracket]:vr,[u.backslash]:[cr,_t],[u.rightSquareBracket]:tt,[u.underscore]:Je,[u.graveAccent]:Xn},mi={null:[Je,Xr]},gi={null:[u.asterisk,u.underscore]},xi={null:[]},ki=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gi,contentInitial:ci,disable:xi,document:si,flow:hi,flowInitial:pi,insideSpan:mi,string:fi,text:di},Symbol.toStringTag,{value:"Module"}));function bi(e){const t=Cn([ki,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:t,content:o(Mn),document:o(Ln),flow:o(Yr),string:o(Zr),text:o(Kr)};return r;function o(a){return l;function l(s){return ui(r,a,s)}}}const zt=/[\0\t\n\r]/g;function yi(){let e=1,n="",t=!0,r;return o;function o(a,l,s){const x=[];let h,c,f,d,p;for(a=n+a.toString(l),f=0,n="",t&&(a.charCodeAt(0)===u.byteOrderMarker&&f++,t=void 0);f<a.length;){if(zt.lastIndex=f,h=zt.exec(a),d=h&&h.index!==void 0?h.index:a.length,p=a.charCodeAt(d),!h){n=a.slice(f);break}if(p===u.lf&&f===d&&r)x.push(u.carriageReturnLineFeed),r=void 0;else switch(r&&(x.push(u.carriageReturn),r=void 0),f<d&&(x.push(a.slice(f,d)),e+=d-f),p){case u.nul:{x.push(u.replacementCharacter),e++;break}case u.ht:{for(c=Math.ceil(e/w.tabSize)*w.tabSize,x.push(u.horizontalTab);e++<c;)x.push(u.virtualSpace);break}case u.lf:{x.push(u.lineFeed),e=1;break}default:r=!0,e=1}f=d+1}return s&&(r&&x.push(u.carriageReturn),n&&x.push(n),x.push(u.eof)),x}}function Si(e){for(;!Nt(e););return e}function $t(e,n){const t=Number.parseInt(e,n);return t<u.ht||t===u.vt||t>u.cr&&t<u.space||t>u.tilde&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?de.replacementCharacter:String.fromCharCode(t)}const Ci=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Fi(e){return e.replace(Ci,wi)}function wi(e,n,t){if(n)return n;if(t.charCodeAt(0)===u.numberSign){const o=t.charCodeAt(1),a=o===u.lowercaseX||o===u.uppercaseX;return $t(t.slice(a?2:1),a?w.numericBaseHexadecimal:w.numericBaseDecimal)}return et(t)||e}function qe(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?At(e.position):"start"in e||"end"in e?At(e):"line"in e||"column"in e?Xe(e):""}function Xe(e){return It(e&&e.line)+":"+It(e&&e.column)}function At(e){return Xe(e&&e.start)+"-"+Xe(e&&e.end)}function It(e){return e&&typeof e=="number"?e:1}const Yt={}.hasOwnProperty,Jt=(function(e,n,t){return typeof n!="string"&&(t=n,n=void 0),Ti(t)(Si(bi(t).document().write(yi()(e,n,!0))))});function Ti(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ot),autolinkProtocol:$,autolinkEmail:$,atxHeading:s(it),blockQuote:s(Fe),characterEscape:$,characterReference:$,codeFenced:s(ye),codeFencedFenceInfo:x,codeFencedFenceMeta:x,codeIndented:s(ye,x),codeText:s(_e,x),codeTextData:$,data:$,codeFlowValue:$,definition:s(Kt),definitionDestinationString:x,definitionLabelString:x,definitionTitleString:x,emphasis:s(en),hardBreakEscape:s(at),hardBreakTrailing:s(at),htmlFlow:s(ut,x),htmlFlowData:$,htmlText:s(ut,x),htmlTextData:$,image:s(tn),label:x,link:s(ot),listItem:s(nn),listItemValue:A,listOrdered:s(lt,p),listUnordered:s(lt),paragraph:s(rn),reference:Ce,referenceString:x,resourceDestinationString:x,resourceTitleString:x,setextHeading:s(it),strong:s(an),thematicBreak:s(on)},exit:{atxHeading:c(),atxHeadingSequence:q,autolink:c(),autolinkEmail:pe,autolinkProtocol:Ee,blockQuote:c(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:Te,characterReferenceMarkerNumeric:Te,characterReferenceValue:X,codeFenced:c(P),codeFencedFence:C,codeFencedFenceInfo:M,codeFencedFenceMeta:I,codeFlowValue:R,codeIndented:c(E),codeText:c(J),codeTextData:R,data:R,definition:c(),definitionDestinationString:S,definitionLabelString:D,definitionTitleString:O,emphasis:c(),hardBreakEscape:c(B),hardBreakTrailing:c(B),htmlFlow:c(L),htmlFlowData:R,htmlText:c(G),htmlTextData:R,image:c(oe),label:re,labelText:m,lineEnding:T,link:c(ne),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Re,resourceDestinationString:ce,resourceTitleString:g,resource:te,setextHeading:c(U),setextHeadingLineSequence:V,setextHeadingText:N,strong:c(),thematicBreak:c()}};Xt(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(b){let y={type:"root",children:[]};const F={stack:[y],tokenStack:[],config:n,enter:h,exit:f,buffer:x,resume:d,setData:a,getData:l},H=[];let j=-1;for(;++j<b.length;)if(b[j][1].type===i.listOrdered||b[j][1].type===i.listUnordered)if(b[j][0]==="enter")H.push(j);else{const Z=H.pop();k(typeof Z=="number","expected list ot be open"),j=o(b,Z,j)}for(j=-1;++j<b.length;){const Z=n[b[j][0]];Yt.call(Z,b[j][1].type)&&Z[b[j][1].type].call(Object.assign({sliceSerialize:b[j][2].sliceSerialize},F),b[j][1])}if(F.tokenStack.length>0){const Z=F.tokenStack[F.tokenStack.length-1];(Z[1]||Bt).call(F,void 0,Z[0])}for(y.position={start:xe(b.length>0?b[0][1].start:{line:1,column:1,offset:0}),end:xe(b.length>0?b[b.length-2][1].end:{line:1,column:1,offset:0})},j=-1;++j<n.transforms.length;)y=n.transforms[j](y)||y;return y}function o(b,y,F){let H=y-1,j=-1,Z=!1,ge,he,ze,Ae;for(;++H<=F;){const Y=b[H];if(Y[1].type===i.listUnordered||Y[1].type===i.listOrdered||Y[1].type===i.blockQuote?(Y[0]==="enter"?j++:j--,Ae=void 0):Y[1].type===i.lineEndingBlank?Y[0]==="enter"&&(ge&&!Ae&&!j&&!ze&&(ze=H),Ae=void 0):Y[1].type===i.linePrefix||Y[1].type===i.listItemValue||Y[1].type===i.listItemMarker||Y[1].type===i.listItemPrefix||Y[1].type===i.listItemPrefixWhitespace||(Ae=void 0),!j&&Y[0]==="enter"&&Y[1].type===i.listItemPrefix||j===-1&&Y[0]==="exit"&&(Y[1].type===i.listUnordered||Y[1].type===i.listOrdered)){if(ge){let He=H;for(he=void 0;He--;){const fe=b[He];if(fe[1].type===i.lineEnding||fe[1].type===i.lineEndingBlank){if(fe[0]==="exit")continue;he&&(b[he][1].type=i.lineEndingBlank,Z=!0),fe[1].type=i.lineEnding,he=He}else if(!(fe[1].type===i.linePrefix||fe[1].type===i.blockQuotePrefix||fe[1].type===i.blockQuotePrefixWhitespace||fe[1].type===i.blockQuoteMarker||fe[1].type===i.listItemIndent))break}ze&&(!he||ze<he)&&(ge._spread=!0),ge.end=Object.assign({},he?b[he][1].start:Y[1].end),b.splice(he||H,0,["exit",ge,Y[2]]),H++,F++}Y[1].type===i.listItemPrefix&&(ge={type:"listItem",_spread:!1,start:Object.assign({},Y[1].start),end:void 0},b.splice(H,0,["enter",ge,Y[2]]),H++,F++,ze=void 0,Ae=!0)}}return b[y][1]._spread=Z,F}function a(b,y){t[b]=y}function l(b){return t[b]}function s(b,y){return F;function F(H){h.call(this,b(H),H),y&&y.call(this,H)}}function x(){this.stack.push({type:"fragment",children:[]})}function h(b,y,F){const H=this.stack[this.stack.length-1];return k(H,"expected `parent`"),k("children"in H,"expected `parent`"),H.children.push(b),this.stack.push(b),this.tokenStack.push([y,F]),b.position={start:xe(y.start)},b}function c(b){return y;function y(F){b&&b.call(this,F),f.call(this,F)}}function f(b,y){const F=this.stack.pop();k(F,"expected `node`");const H=this.tokenStack.pop();if(H)H[0].type!==b.type&&(y?y.call(this,b,H[0]):(H[1]||Bt).call(this,b,H[0]));else throw new Error("Cannot close `"+b.type+"` ("+qe({start:b.start,end:b.end})+"): it’s not open");return k(F.type!=="fragment","unexpected fragment `exit`ed"),k(F.position,"expected `position` to be defined"),F.position.end=xe(b.end),F}function d(){return yn(this.stack.pop())}function p(){a("expectingFirstListItemValue",!0)}function A(b){if(l("expectingFirstListItemValue")){const y=this.stack[this.stack.length-2];k(y,"expected nodes on stack"),k(y.type==="list","expected list on stack"),y.start=Number.parseInt(this.sliceSerialize(b),w.numericBaseDecimal),a("expectingFirstListItemValue")}}function M(){const b=this.resume(),y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="code","expected code on stack"),y.lang=b}function I(){const b=this.resume(),y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="code","expected code on stack"),y.meta=b}function C(){l("flowCodeInside")||(this.buffer(),a("flowCodeInside",!0))}function P(){const b=this.resume(),y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="code","expected code on stack"),y.value=b.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),a("flowCodeInside")}function E(){const b=this.resume(),y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="code","expected code on stack"),y.value=b.replace(/(\r?\n|\r)$/g,"")}function D(b){const y=this.resume(),F=this.stack[this.stack.length-1];k(F,"expected node on stack"),k(F.type==="definition","expected definition on stack"),F.label=y,F.identifier=we(this.sliceSerialize(b)).toLowerCase()}function O(){const b=this.resume(),y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="definition","expected definition on stack"),y.title=b}function S(){const b=this.resume(),y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="definition","expected definition on stack"),y.url=b}function q(b){const y=this.stack[this.stack.length-1];if(k(y,"expected node on stack"),k(y.type==="heading","expected heading on stack"),!y.depth){const F=this.sliceSerialize(b).length;k(F===1||F===2||F===3||F===4||F===5||F===6,"expected `depth` between `1` and `6`"),y.depth=F}}function N(){a("setextHeadingSlurpLineEnding",!0)}function V(b){const y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="heading","expected heading on stack"),y.depth=this.sliceSerialize(b).charCodeAt(0)===u.equalsTo?1:2}function U(){a("setextHeadingSlurpLineEnding")}function $(b){const y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k("children"in y,"expected parent on stack");let F=y.children[y.children.length-1];(!F||F.type!=="text")&&(F=un(),F.position={start:xe(b.start)},y.children.push(F)),this.stack.push(F)}function R(b){const y=this.stack.pop();k(y,"expected a `node` to be on the stack"),k("value"in y,"expected a `literal` to be on the stack"),k(y.position,"expected `node` to have an open position"),y.value+=this.sliceSerialize(b),y.position.end=xe(b.end)}function T(b){const y=this.stack[this.stack.length-1];if(k(y,"expected `node`"),l("atHardBreak")){k("children"in y,"expected `parent`");const F=y.children[y.children.length-1];k(F.position,"expected tail to have a starting position"),F.position.end=xe(b.end),a("atHardBreak");return}!l("setextHeadingSlurpLineEnding")&&n.canContainEols.includes(y.type)&&($.call(this,b),R.call(this,b))}function B(){a("atHardBreak",!0)}function L(){const b=this.resume(),y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="html","expected html on stack"),y.value=b}function G(){const b=this.resume(),y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="html","expected html on stack"),y.value=b}function J(){const b=this.resume(),y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="inlineCode","expected inline code on stack"),y.value=b}function ne(){const b=this.stack[this.stack.length-1];if(k(b,"expected node on stack"),k(b.type==="link","expected link on stack"),l("inReference")){const y=l("referenceType")||"shortcut";b.type+="Reference",b.referenceType=y,delete b.url,delete b.title}else delete b.identifier,delete b.label;a("referenceType")}function oe(){const b=this.stack[this.stack.length-1];if(k(b,"expected node on stack"),k(b.type==="image","expected image on stack"),l("inReference")){const y=l("referenceType")||"shortcut";b.type+="Reference",b.referenceType=y,delete b.url,delete b.title}else delete b.identifier,delete b.label;a("referenceType")}function m(b){const y=this.sliceSerialize(b),F=this.stack[this.stack.length-2];k(F,"expected ancestor on stack"),k(F.type==="image"||F.type==="link","expected image or link on stack"),F.label=Fi(y),F.identifier=we(y).toLowerCase()}function re(){const b=this.stack[this.stack.length-1];k(b,"expected node on stack"),k(b.type==="fragment","expected fragment on stack");const y=this.resume(),F=this.stack[this.stack.length-1];if(k(F,"expected node on stack"),k(F.type==="image"||F.type==="link","expected image or link on stack"),a("inReference",!0),F.type==="link"){const H=b.children;F.children=H}else F.alt=y}function ce(){const b=this.resume(),y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="image"||y.type==="link","expected image or link on stack"),y.url=b}function g(){const b=this.resume(),y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="image"||y.type==="link","expected image or link on stack"),y.title=b}function te(){a("inReference")}function Ce(){a("referenceType","collapsed")}function Re(b){const y=this.resume(),F=this.stack[this.stack.length-1];k(F,"expected node on stack"),k(F.type==="image"||F.type==="link","expected image reference or link reference on stack"),F.label=y,F.identifier=we(this.sliceSerialize(b)).toLowerCase(),a("referenceType","full")}function Te(b){k(b.type==="characterReferenceMarkerNumeric"||b.type==="characterReferenceMarkerHexadecimal"),a("characterReferenceType",b.type)}function X(b){const y=this.sliceSerialize(b),F=l("characterReferenceType");let H;if(F)H=$t(y,F===i.characterReferenceMarkerNumeric?w.numericBaseDecimal:w.numericBaseHexadecimal),a("characterReferenceType");else{const Z=et(y);k(Z!==!1,"expected reference to decode"),H=Z}const j=this.stack.pop();k(j,"expected `node`"),k(j.position,"expected `node.position`"),k("value"in j,"expected `node.value`"),j.value+=H,j.position.end=xe(b.end)}function Ee(b){R.call(this,b);const y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="link","expected link on stack"),y.url=this.sliceSerialize(b)}function pe(b){R.call(this,b);const y=this.stack[this.stack.length-1];k(y,"expected node on stack"),k(y.type==="link","expected link on stack"),y.url="mailto:"+this.sliceSerialize(b)}function Fe(){return{type:"blockquote",children:[]}}function ye(){return{type:"code",lang:null,meta:null,value:""}}function _e(){return{type:"inlineCode",value:""}}function Kt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function en(){return{type:"emphasis",children:[]}}function it(){return{type:"heading",depth:void 0,children:[]}}function at(){return{type:"break"}}function ut(){return{type:"html",value:""}}function tn(){return{type:"image",title:null,url:"",alt:null}}function ot(){return{type:"link",title:null,url:"",children:[]}}function lt(b){return{type:"list",ordered:b.type==="listOrdered",start:null,spread:b._spread,children:[]}}function nn(b){return{type:"listItem",spread:b._spread,checked:null,children:[]}}function rn(){return{type:"paragraph",children:[]}}function an(){return{type:"strong",children:[]}}function un(){return{type:"text",value:""}}function on(){return{type:"thematicBreak"}}}function xe(e){return{line:e.line,column:e.column,offset:e.offset}}function Xt(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?Xt(e,r):Ei(e,r)}}function Ei(e,n){let t;for(t in n)if(Yt.call(n,t)){if(t==="canContainEols"){const r=n[t];r&&e[t].push(...r)}else if(t==="transforms"){const r=n[t];r&&e[t].push(...r)}else if(t==="enter"||t==="exit"){const r=n[t];r&&Object.assign(e[t],r)}}}function Bt(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+qe({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+qe({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+qe({start:n.start,end:n.end})+") is still open")}function zi(e){const n=e.replace(/\n{2,}/g,`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{l as g,t as lt,g as b,v as H,d as E,u as j,i as q,x as Q}from"./index-Ia_xKhIZ.js";import{c as st}from"./createText-2e5e7dd3-CtWg9f_f.js";import{l as ct}from"./line-DXiCFjwk.js";const ht=(e,t,a,i)=>{t.forEach(l=>{wt[l](e,a,i)})},ot=(e,t,a)=>{g.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).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")},yt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).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")},pt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).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")},ft=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).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")},xt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},dt=(e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).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"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).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")},gt=(e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).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"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).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")},ut=(e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).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"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).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")},bt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},wt={extension:ot,composition:yt,aggregation:pt,dependency:ft,lollipop:xt,point:dt,circle:gt,cross:ut,barb:bt},hr=ht;function mt(e,t){t&&e.attr("style",t)}function kt(e){const t=E(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=t.append("xhtml:div"),i=e.label,l=e.isNode?"nodeLabel":"edgeLabel";return a.html('<span class="'+l+'" '+(e.labelStyle?'style="'+e.labelStyle+'"':"")+">"+i+"</span>"),mt(a,e.labelStyle),a.style("display","inline-block"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}const vt=(e,t,a,i)=>{let l=e||"";if(typeof l=="object"&&(l=l[0]),H(b().flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"<br />"),g.debug("vertexText"+l);const r={isNode:i,label:Q(l).replace(/fa[blrs]?:fa-[\w-]+/g,n=>`<i class='${n.replace(":"," ")}'></i>`),labelStyle:t.replace("fill:","color:")};return kt(r)}else{const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("style",t.replace("color:","fill:"));let s=[];typeof l=="string"?s=l.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(l)?s=l:s=[];for(const n of s){const c=document.createElementNS("http://www.w3.org/2000/svg","tspan");c.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),c.setAttribute("dy","1em"),c.setAttribute("x","0"),a?c.setAttribute("class","title-row"):c.setAttribute("class","row"),c.textContent=n.trim(),r.appendChild(c)}return r}},R=vt,M=async(e,t,a,i)=>{let l;const r=t.useHtmlLabels||H(b().flowchart.htmlLabels);a?l=a:l="node default";const s=e.insert("g").attr("class",l).attr("id",t.domId||t.id),n=s.insert("g").attr("class","label").attr("style",t.labelStyle);let c;t.labelText===void 0?c="":c=typeof t.labelText=="string"?t.labelText:t.labelText[0];const o=n.node();let h;t.labelType==="markdown"?h=st(n,q(Q(c),b()),{useHtmlLabels:r,width:t.width||b().flowchart.wrappingWidth,classes:"markdown-node-label"}):h=o.appendChild(R(q(Q(c),b()),t.labelStyle,!1,i));let y=h.getBBox();const f=t.padding/2;if(H(b().flowchart.htmlLabels)){const p=h.children[0],d=E(h),k=p.getElementsByTagName("img");if(k){const x=c.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...k].map(u=>new Promise(S=>{function B(){if(u.style.display="flex",u.style.flexDirection="column",x){const C=b().fontSize?b().fontSize:window.getComputedStyle(document.body).fontSize,D=parseInt(C,10)*5+"px";u.style.minWidth=D,u.style.maxWidth=D}else u.style.width="100%";S(u)}setTimeout(()=>{u.complete&&B()}),u.addEventListener("error",B),u.addEventListener("load",B)})))}y=p.getBoundingClientRect(),d.attr("width",y.width),d.attr("height",y.height)}return r?n.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):n.attr("transform","translate(0, "+-y.height/2+")"),t.centerLabel&&n.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:s,bbox:y,halfPadding:f,label:n}},m=(e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height};function I(e,t,a,i){return e.insert("polygon",":first-child").attr("points",i.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}function Lt(e,t){return e.intersect(t)}function it(e,t,a,i){var l=e.x,r=e.y,s=l-i.x,n=r-i.y,c=Math.sqrt(t*t*n*n+a*a*s*s),o=Math.abs(t*a*s/c);i.x<l&&(o=-o);var h=Math.abs(t*a*n/c);return i.y<r&&(h=-h),{x:l+o,y:r+h}}function St(e,t,a){return it(e,t,t,a)}function Mt(e,t,a,i){var l,r,s,n,c,o,h,y,f,p,d,k,x,u,S;if(l=t.y-e.y,s=e.x-t.x,c=t.x*e.y-e.x*t.y,f=l*a.x+s*a.y+c,p=l*i.x+s*i.y+c,!(f!==0&&p!==0&&J(f,p))&&(r=i.y-a.y,n=a.x-i.x,o=i.x*a.y-a.x*i.y,h=r*e.x+n*e.y+o,y=r*t.x+n*t.y+o,!(h!==0&&y!==0&&J(h,y))&&(d=l*n-r*s,d!==0)))return k=Math.abs(d/2),x=s*o-n*c,u=x<0?(x-k)/d:(x+k)/d,x=r*c-l*o,S=x<0?(x-k)/d:(x+k)/d,{x:u,y:S}}function J(e,t){return e*t>0}function Tt(e,t,a){var i=e.x,l=e.y,r=[],s=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){s=Math.min(s,d.x),n=Math.min(n,d.y)}):(s=Math.min(s,t.x),n=Math.min(n,t.y));for(var c=i-e.width/2-s,o=l-e.height/2-n,h=0;h<t.length;h++){var y=t[h],f=t[h<t.length-1?h+1:0],p=Mt(e,a,{x:c+y.x,y:o+y.y},{x:c+f.x,y:o+f.y});p&&r.push(p)}return r.length?(r.length>1&&r.sort(function(d,k){var x=d.x-a.x,u=d.y-a.y,S=Math.sqrt(x*x+u*u),B=k.x-a.x,C=k.y-a.y,X=Math.sqrt(B*B+C*C);return S<X?-1:S===X?0:1}),r[0]):e}const Bt=(e,t)=>{var a=e.x,i=e.y,l=t.x-a,r=t.y-i,s=e.width/2,n=e.height/2,c,o;return Math.abs(r)*s>Math.abs(l)*n?(r<0&&(n=-n),c=r===0?0:n*l/r,o=n):(l<0&&(s=-s),c=s,o=l===0?0:s*r/l),{x:a+c,y:i+o}},Et=Bt,w={node:Lt,circle:St,ellipse:it,polygon:Tt,rect:Et},Ct=async(e,t)=>{t.useHtmlLabels||b().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:i,bbox:l,halfPadding:r}=await M(e,t,"node "+t.classes,!0);g.info("Classes = ",t.classes);const s=i.insert("rect",":first-child");return s.attr("rx",t.rx).attr("ry",t.ry).attr("x",-l.width/2-r).attr("y",-l.height/2-r).attr("width",l.width+t.padding).attr("height",l.height+t.padding),m(t,s),t.intersect=function(n){return w.rect(t,n)},i},$t=Ct,_t=e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},Rt=(e,t,a)=>{const i=_t(e),l=2,r=t.height+2*a.padding,s=r/l,n=t.width+2*s+a.padding,c=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:s,y:0},{x:n/2,y:2*c},{x:n-s,y:0},{x:n,y:0},{x:n,y:-r/3},{x:n+2*c,y:-r/2},{x:n,y:-2*r/3},{x:n,y:-r},{x:n-s,y:-r},{x:n/2,y:-r-2*c},{x:s,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*c,y:-r/2},{x:0,y:-r/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:s,y:0},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:s,y:-r},{x:0,y:-r/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:s,y:-r},{x:n-s,y:-r},{x:n,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:-s},{x:n,y:-r+s},{x:0,y:-r}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:n,y:0},{x:0,y:-s},{x:0,y:-r+s},{x:n,y:-r}]:i.has("right")&&i.has("left")?[{x:s,y:0},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r},{x:0,y:-r/2}]:i.has("up")&&i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:s,y:-c},{x:s,y:-r+c},{x:0,y:-r+c},{x:n/2,y:-r},{x:n,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c},{x:n,y:-c}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:n,y:-s},{x:0,y:-r}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-r}]:i.has("left")&&i.has("up")?[{x:n,y:0},{x:0,y:-s},{x:n,y:-r}]:i.has("left")&&i.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-r}]:i.has("right")?[{x:s,y:-c},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r+c}]:i.has("left")?[{x:s,y:0},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r},{x:0,y:-r/2}]:i.has("up")?[{x:s,y:-c},{x:s,y:-r+c},{x:0,y:-r+c},{x:n/2,y:-r},{x:n,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c}]:i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:s,y:-c},{x:s,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c},{x:n,y:-c}]:[{x:0,y:0}]},K=e=>e?" "+e:"",_=(e,t)=>`node default${K(e.classes)} ${K(e.class)}`,P=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=l+r,n=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];g.info("Question main (Circle)");const c=I(a,s,s,n);return c.attr("style",t.style),m(t,c),t.intersect=function(o){return g.warn("Intersect called"),w.polygon(t,n,o)},a},Ht=(e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=28,l=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}];return a.insert("polygon",":first-child").attr("points",l.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(s){return w.circle(t,14,s)},a},It=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=4,r=i.height+t.padding,s=r/l,n=i.width+2*s+t.padding,c=[{x:s,y:0},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:s,y:-r},{x:0,y:-r/2}],o=I(a,n,r,c);return o.attr("style",t.style),m(t,o),t.intersect=function(h){return w.polygon(t,c,h)},a},Nt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,void 0,!0),l=2,r=i.height+2*t.padding,s=r/l,n=i.width+2*s+t.padding,c=Rt(t.directions,i,t),o=I(a,n,r,c);return o.attr("style",t.style),m(t,o),t.intersect=function(h){return w.polygon(t,c,h)},a},Ot=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-r/2,y:0},{x:l,y:0},{x:l,y:-r},{x:-r/2,y:-r},{x:0,y:-r/2}];return I(a,l,r,s).attr("style",t.style),t.width=l+r,t.height=r,t.intersect=function(c){return w.polygon(t,s,c)},a},Wt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-2*r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:r/6,y:-r}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},Xt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:2*r/6,y:0},{x:l+r/6,y:0},{x:l-2*r/6,y:-r},{x:-r/6,y:-r}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},Yt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-2*r/6,y:0},{x:l+2*r/6,y:0},{x:l-r/6,y:-r},{x:r/6,y:-r}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},Dt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:-2*r/6,y:-r}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},At=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:0,y:0},{x:l+r/2,y:0},{x:l,y:-r/2},{x:l+r/2,y:-r},{x:0,y:-r}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},jt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=l/2,s=r/(2.5+l/50),n=i.height+s+t.padding,c="M 0,"+s+" a "+r+","+s+" 0,0,0 "+l+" 0 a "+r+","+s+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+r+","+s+" 0,0,0 "+l+" 0 l 0,"+-n,o=a.attr("label-offset-y",s).insert("path",":first-child").attr("style",t.style).attr("d",c).attr("transform","translate("+-l/2+","+-(n/2+s)+")");return m(t,o),t.intersect=function(h){const y=w.rect(t,h),f=y.x-t.x;if(r!=0&&(Math.abs(f)<t.width/2||Math.abs(f)==t.width/2&&Math.abs(y.y-t.y)>t.height/2-s)){let p=s*s*(1-f*f/(r*r));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-t.y>0&&(p=-p),y.y+=p}return y},a},Ut=async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await M(e,t,"node "+t.classes+" "+t.class,!0),r=a.insert("rect",":first-child"),s=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-s/2:-i.width/2-l,o=t.positioned?-n/2:-i.height/2-l;if(r.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",o).attr("width",s).attr("height",n),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(V(r,t.props.borders,s,n),h.delete("borders")),h.forEach(y=>{g.warn(`Unknown node property ${y}`)})}return m(t,r),t.intersect=function(h){return w.rect(t,h)},a},zt=async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await M(e,t,"node "+t.classes,!0),r=a.insert("rect",":first-child"),s=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-s/2:-i.width/2-l,o=t.positioned?-n/2:-i.height/2-l;if(r.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",o).attr("width",s).attr("height",n),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(V(r,t.props.borders,s,n),h.delete("borders")),h.forEach(y=>{g.warn(`Unknown node property ${y}`)})}return m(t,r),t.intersect=function(h){return w.rect(t,h)},a},Zt=async(e,t)=>{const{shapeSvg:a}=await M(e,t,"label",!0);g.trace("Classes = ",t.class);const i=a.insert("rect",":first-child"),l=0,r=0;if(i.attr("width",l).attr("height",r),a.attr("class","label edgeLabel"),t.props){const s=new Set(Object.keys(t.props));t.props.borders&&(V(i,t.props.borders,l,r),s.delete("borders")),s.forEach(n=>{g.warn(`Unknown node property ${n}`)})}return m(t,i),t.intersect=function(s){return w.rect(t,s)},a};function V(e,t,a,i){const l=[],r=n=>{l.push(n,0)},s=n=>{l.push(0,n)};t.includes("t")?(g.debug("add top border"),r(a)):s(a),t.includes("r")?(g.debug("add right border"),r(i)):s(i),t.includes("b")?(g.debug("add bottom border"),r(a)):s(a),t.includes("l")?(g.debug("add left border"),r(i)):s(i),e.attr("stroke-dasharray",l.join(" "))}const Gt=(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const i=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=i.insert("rect",":first-child"),r=i.insert("line"),s=i.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let c="";typeof n=="object"?c=n[0]:c=n,g.info("Label text abc79",c,n,typeof n=="object");const o=s.node().appendChild(R(c,t.labelStyle,!0,!0));let h={width:0,height:0};if(H(b().flowchart.htmlLabels)){const k=o.children[0],x=E(o);h=k.getBoundingClientRect(),x.attr("width",h.width),x.attr("height",h.height)}g.info("Text 2",n);const y=n.slice(1,n.length);let f=o.getBBox();const p=s.node().appendChild(R(y.join?y.join("<br/>"):y,t.labelStyle,!0,!0));if(H(b().flowchart.htmlLabels)){const k=p.children[0],x=E(p);h=k.getBoundingClientRect(),x.attr("width",h.width),x.attr("height",h.height)}const d=t.padding/2;return E(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+d+5)+")"),E(o).attr("transform","translate( "+(h.width<f.width?0:-(f.width-h.width)/2)+", 0)"),h=s.node().getBBox(),s.attr("transform","translate("+-h.width/2+", "+(-h.height/2-d+3)+")"),l.attr("class","outer title-state").attr("x",-h.width/2-d).attr("y",-h.height/2-d).attr("width",h.width+t.padding).attr("height",h.height+t.padding),r.attr("class","divider").attr("x1",-h.width/2-d).attr("x2",h.width/2+d).attr("y1",-h.height/2-d+f.height+d).attr("y2",-h.height/2-d+f.height+d),m(t,l),t.intersect=function(k){return w.rect(t,k)},i},Ft=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.height+t.padding,r=i.width+l/4+t.padding,s=a.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-r/2).attr("y",-l/2).attr("width",r).attr("height",l);return m(t,s),t.intersect=function(n){return w.rect(t,n)},a},Qt=async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await M(e,t,_(t),!0),r=a.insert("circle",":first-child");return r.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),g.info("Circle main"),m(t,r),t.intersect=function(s){return g.info("Circle intersect",t,i.width/2+l,s),w.circle(t,i.width/2+l,s)},a},Vt=async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await M(e,t,_(t),!0),r=5,s=a.insert("g",":first-child"),n=s.insert("circle"),c=s.insert("circle");return s.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l+r).attr("width",i.width+t.padding+r*2).attr("height",i.height+t.padding+r*2),c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),g.info("DoubleCircle main"),m(t,n),t.intersect=function(o){return g.info("DoubleCircle intersect",t,i.width/2+l+r,o),w.circle(t,i.width/2+l+r,o)},a},qt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:0,y:0},{x:l,y:0},{x:l,y:-r},{x:0,y:-r},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-r},{x:-8,y:-r},{x:-8,y:0}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},Jt=(e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),m(t,i),t.intersect=function(l){return w.circle(t,7,l)},a},tt=(e,t,a)=>{const i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let l=70,r=10;a==="LR"&&(l=10,r=70);const s=i.append("rect").attr("x",-1*l/2).attr("y",-1*r/2).attr("width",l).attr("height",r).attr("class","fork-join");return m(t,s),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return w.rect(t,n)},i},Kt=(e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child"),l=a.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),m(t,l),t.intersect=function(r){return w.circle(t,7,r)},a},Pt=(e,t)=>{const a=t.padding/2,i=4,l=8;let r;t.classes?r="node "+t.classes:r="node default";const s=e.insert("g").attr("class",r).attr("id",t.domId||t.id),n=s.insert("rect",":first-child"),c=s.insert("line"),o=s.insert("line");let h=0,y=i;const f=s.insert("g").attr("class","label");let p=0;const d=t.classData.annotations&&t.classData.annotations[0],k=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",x=f.node().appendChild(R(k,t.labelStyle,!0,!0));let u=x.getBBox();if(H(b().flowchart.htmlLabels)){const v=x.children[0],L=E(x);u=v.getBoundingClientRect(),L.attr("width",u.width),L.attr("height",u.height)}t.classData.annotations[0]&&(y+=u.height+i,h+=u.width);let S=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(b().flowchart.htmlLabels?S+="<"+t.classData.type+">":S+="<"+t.classData.type+">");const B=f.node().appendChild(R(S,t.labelStyle,!0,!0));E(B).attr("class","classTitle");let C=B.getBBox();if(H(b().flowchart.htmlLabels)){const v=B.children[0],L=E(B);C=v.getBoundingClientRect(),L.attr("width",C.width),L.attr("height",C.height)}y+=C.height+i,C.width>h&&(h=C.width);const X=[];t.classData.members.forEach(v=>{const L=v.getDisplayDetails();let W=L.displayText;b().flowchart.htmlLabels&&(W=W.replace(/</g,"<").replace(/>/g,">"));const N=f.node().appendChild(R(W,L.cssStyle?L.cssStyle:t.labelStyle,!0,!0));let $=N.getBBox();if(H(b().flowchart.htmlLabels)){const F=N.children[0],A=E(N);$=F.getBoundingClientRect(),A.attr("width",$.width),A.attr("height",$.height)}$.width>h&&(h=$.width),y+=$.height+i,X.push(N)}),y+=l;const D=[];if(t.classData.methods.forEach(v=>{const L=v.getDisplayDetails();let W=L.displayText;b().flowchart.htmlLabels&&(W=W.replace(/</g,"<").replace(/>/g,">"));const N=f.node().appendChild(R(W,L.cssStyle?L.cssStyle:t.labelStyle,!0,!0));let $=N.getBBox();if(H(b().flowchart.htmlLabels)){const F=N.children[0],A=E(N);$=F.getBoundingClientRect(),A.attr("width",$.width),A.attr("height",$.height)}$.width>h&&(h=$.width),y+=$.height+i,D.push(N)}),y+=l,d){let v=(h-u.width)/2;E(x).attr("transform","translate( "+(-1*h/2+v)+", "+-1*y/2+")"),p=u.height+i}let nt=(h-C.width)/2;return E(B).attr("transform","translate( "+(-1*h/2+nt)+", "+(-1*y/2+p)+")"),p+=C.height+i,c.attr("class","divider").attr("x1",-h/2-a).attr("x2",h/2+a).attr("y1",-y/2-a+l+p).attr("y2",-y/2-a+l+p),p+=l,X.forEach(v=>{E(v).attr("transform","translate( "+-h/2+", "+(-1*y/2+p+l/2)+")");const L=v==null?void 0:v.getBBox();p+=((L==null?void 0:L.height)??0)+i}),p+=l,o.attr("class","divider").attr("x1",-h/2-a).attr("x2",h/2+a).attr("y1",-y/2-a+l+p).attr("y2",-y/2-a+l+p),p+=l,D.forEach(v=>{E(v).attr("transform","translate( "+-h/2+", "+(-1*y/2+p)+")");const L=v==null?void 0:v.getBBox();p+=((L==null?void 0:L.height)??0)+i}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-h/2-a).attr("y",-(y/2)-a).attr("width",h+t.padding).attr("height",y+t.padding),m(t,n),t.intersect=function(v){return w.rect(t,v)},s},rt={rhombus:P,composite:zt,question:P,rect:Ut,labelRect:Zt,rectWithTitle:Gt,choice:Ht,circle:Qt,doublecircle:Vt,stadium:Ft,hexagon:It,block_arrow:Nt,rect_left_inv_arrow:Ot,lean_right:Wt,lean_left:Xt,trapezoid:Yt,inv_trapezoid:Dt,rect_right_inv_arrow:At,cylinder:jt,start:Jt,end:Kt,note:$t,subroutine:qt,fork:tt,join:tt,class_box:Pt};let Y={};const or=async(e,t,a)=>{let i,l;if(t.link){let r;b().securityLevel==="sandbox"?r="_top":t.linkTarget&&(r=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",r),l=await rt[t.shape](i,t,a)}else l=await rt[t.shape](e,t,a),i=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),i.attr("data-node","true"),i.attr("data-id",t.id),Y[t.id]=i,t.haveCallback&&Y[t.id].attr("class",Y[t.id].attr("class")+" clickable"),i},yr=(e,t)=>{Y[t.id]=e},pr=()=>{Y={}},fr=e=>{const t=Y[e.id];g.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},tr=({flowchart:e})=>{var t,a;const i=((t=e==null?void 0:e.subGraphTitleMargin)==null?void 0:t.top)??0,l=((a=e==null?void 0:e.subGraphTitleMargin)==null?void 0:a.bottom)??0,r=i+l;return{subGraphTitleTopMargin:i,subGraphTitleBottomMargin:l,subGraphTitleTotalMargin:r}},O={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:5.3};function U(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Z(e),t=Z(t);const[a,i]=[e.x,e.y],[l,r]=[t.x,t.y],s=l-a,n=r-i;return{angle:Math.atan(n/s),deltaX:s,deltaY:n}}const Z=e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,rr=e=>({x:function(t,a,i){let l=0;if(a===0&&Object.hasOwn(O,e.arrowTypeStart)){const{angle:r,deltaX:s}=U(i[0],i[1]);l=O[e.arrowTypeStart]*Math.cos(r)*(s>=0?1:-1)}else if(a===i.length-1&&Object.hasOwn(O,e.arrowTypeEnd)){const{angle:r,deltaX:s}=U(i[i.length-1],i[i.length-2]);l=O[e.arrowTypeEnd]*Math.cos(r)*(s>=0?1:-1)}return Z(t).x+l},y:function(t,a,i){let l=0;if(a===0&&Object.hasOwn(O,e.arrowTypeStart)){const{angle:r,deltaY:s}=U(i[0],i[1]);l=O[e.arrowTypeStart]*Math.abs(Math.sin(r))*(s>=0?1:-1)}else if(a===i.length-1&&Object.hasOwn(O,e.arrowTypeEnd)){const{angle:r,deltaY:s}=U(i[i.length-1],i[i.length-2]);l=O[e.arrowTypeEnd]*Math.abs(Math.sin(r))*(s>=0?1:-1)}return Z(t).y+l}}),ar=(e,t,a,i,l)=>{t.arrowTypeStart&&at(e,"start",t.arrowTypeStart,a,i,l),t.arrowTypeEnd&&at(e,"end",t.arrowTypeEnd,a,i,l)},er={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},at=(e,t,a,i,l,r)=>{const s=er[a];if(!s){g.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${i}#${l}_${r}-${s}${n})`)};let G={},T={};const xr=()=>{G={},T={}},dr=(e,t)=>{const a=H(b().flowchart.htmlLabels),i=t.labelType==="markdown"?st(e,t.label,{style:t.labelStyle,useHtmlLabels:a,addSvgBackground:!0}):R(t.label,t.labelStyle),l=e.insert("g").attr("class","edgeLabel"),r=l.insert("g").attr("class","label");r.node().appendChild(i);let s=i.getBBox();if(a){const c=i.children[0],o=E(i);s=c.getBoundingClientRect(),o.attr("width",s.width),o.attr("height",s.height)}r.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),G[t.id]=l,t.width=s.width,t.height=s.height;let n;if(t.startLabelLeft){const c=R(t.startLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");n=h.node().appendChild(c);const y=c.getBBox();h.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),T[t.id]||(T[t.id]={}),T[t.id].startLeft=o,z(n,t.startLabelLeft)}if(t.startLabelRight){const c=R(t.startLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");n=o.node().appendChild(c),h.node().appendChild(c);const y=c.getBBox();h.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),T[t.id]||(T[t.id]={}),T[t.id].startRight=o,z(n,t.startLabelRight)}if(t.endLabelLeft){const c=R(t.endLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");n=h.node().appendChild(c);const y=c.getBBox();h.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),o.node().appendChild(c),T[t.id]||(T[t.id]={}),T[t.id].endLeft=o,z(n,t.endLabelLeft)}if(t.endLabelRight){const c=R(t.endLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");n=h.node().appendChild(c);const y=c.getBBox();h.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),o.node().appendChild(c),T[t.id]||(T[t.id]={}),T[t.id].endRight=o,z(n,t.endLabelRight)}return i};function z(e,t){b().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}const gr=(e,t)=>{g.debug("Moving label abc88 ",e.id,e.label,G[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const i=b(),{subGraphTitleTotalMargin:l}=tr(i);if(e.label){const r=G[e.id];let s=e.x,n=e.y;if(a){const c=j.calcLabelPosition(a);g.debug("Moving label "+e.label+" from (",s,",",n,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(s=c.x,n=c.y)}r.attr("transform",`translate(${s}, ${n+l/2})`)}if(e.startLabelLeft){const r=T[e.id].startLeft;let s=e.x,n=e.y;if(a){const c=j.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}if(e.startLabelRight){const r=T[e.id].startRight;let s=e.x,n=e.y;if(a){const c=j.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelLeft){const r=T[e.id].endLeft;let s=e.x,n=e.y;if(a){const c=j.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelRight){const r=T[e.id].endRight;let s=e.x,n=e.y;if(a){const c=j.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}},sr=(e,t)=>{const a=e.x,i=e.y,l=Math.abs(t.x-a),r=Math.abs(t.y-i),s=e.width/2,n=e.height/2;return l>=s||r>=n},ir=(e,t,a)=>{g.debug(`intersection calc abc89:
|
|
1
|
+
import{l as g,t as lt,g as b,v as H,d as E,u as j,i as q,x as Q}from"./index-BdH171U0.js";import{c as st}from"./createText-2e5e7dd3-CouAisK8.js";import{l as ct}from"./line-DEMH00tR.js";const ht=(e,t,a,i)=>{t.forEach(l=>{wt[l](e,a,i)})},ot=(e,t,a)=>{g.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).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")},yt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).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")},pt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).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")},ft=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).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"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).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")},xt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},dt=(e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).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"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).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")},gt=(e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).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"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).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")},ut=(e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).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"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).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")},bt=(e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},wt={extension:ot,composition:yt,aggregation:pt,dependency:ft,lollipop:xt,point:dt,circle:gt,cross:ut,barb:bt},hr=ht;function mt(e,t){t&&e.attr("style",t)}function kt(e){const t=E(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=t.append("xhtml:div"),i=e.label,l=e.isNode?"nodeLabel":"edgeLabel";return a.html('<span class="'+l+'" '+(e.labelStyle?'style="'+e.labelStyle+'"':"")+">"+i+"</span>"),mt(a,e.labelStyle),a.style("display","inline-block"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}const vt=(e,t,a,i)=>{let l=e||"";if(typeof l=="object"&&(l=l[0]),H(b().flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"<br />"),g.debug("vertexText"+l);const r={isNode:i,label:Q(l).replace(/fa[blrs]?:fa-[\w-]+/g,n=>`<i class='${n.replace(":"," ")}'></i>`),labelStyle:t.replace("fill:","color:")};return kt(r)}else{const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("style",t.replace("color:","fill:"));let s=[];typeof l=="string"?s=l.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(l)?s=l:s=[];for(const n of s){const c=document.createElementNS("http://www.w3.org/2000/svg","tspan");c.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),c.setAttribute("dy","1em"),c.setAttribute("x","0"),a?c.setAttribute("class","title-row"):c.setAttribute("class","row"),c.textContent=n.trim(),r.appendChild(c)}return r}},R=vt,M=async(e,t,a,i)=>{let l;const r=t.useHtmlLabels||H(b().flowchart.htmlLabels);a?l=a:l="node default";const s=e.insert("g").attr("class",l).attr("id",t.domId||t.id),n=s.insert("g").attr("class","label").attr("style",t.labelStyle);let c;t.labelText===void 0?c="":c=typeof t.labelText=="string"?t.labelText:t.labelText[0];const o=n.node();let h;t.labelType==="markdown"?h=st(n,q(Q(c),b()),{useHtmlLabels:r,width:t.width||b().flowchart.wrappingWidth,classes:"markdown-node-label"}):h=o.appendChild(R(q(Q(c),b()),t.labelStyle,!1,i));let y=h.getBBox();const f=t.padding/2;if(H(b().flowchart.htmlLabels)){const p=h.children[0],d=E(h),k=p.getElementsByTagName("img");if(k){const x=c.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...k].map(u=>new Promise(S=>{function B(){if(u.style.display="flex",u.style.flexDirection="column",x){const C=b().fontSize?b().fontSize:window.getComputedStyle(document.body).fontSize,D=parseInt(C,10)*5+"px";u.style.minWidth=D,u.style.maxWidth=D}else u.style.width="100%";S(u)}setTimeout(()=>{u.complete&&B()}),u.addEventListener("error",B),u.addEventListener("load",B)})))}y=p.getBoundingClientRect(),d.attr("width",y.width),d.attr("height",y.height)}return r?n.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):n.attr("transform","translate(0, "+-y.height/2+")"),t.centerLabel&&n.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:s,bbox:y,halfPadding:f,label:n}},m=(e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height};function I(e,t,a,i){return e.insert("polygon",":first-child").attr("points",i.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}function Lt(e,t){return e.intersect(t)}function it(e,t,a,i){var l=e.x,r=e.y,s=l-i.x,n=r-i.y,c=Math.sqrt(t*t*n*n+a*a*s*s),o=Math.abs(t*a*s/c);i.x<l&&(o=-o);var h=Math.abs(t*a*n/c);return i.y<r&&(h=-h),{x:l+o,y:r+h}}function St(e,t,a){return it(e,t,t,a)}function Mt(e,t,a,i){var l,r,s,n,c,o,h,y,f,p,d,k,x,u,S;if(l=t.y-e.y,s=e.x-t.x,c=t.x*e.y-e.x*t.y,f=l*a.x+s*a.y+c,p=l*i.x+s*i.y+c,!(f!==0&&p!==0&&J(f,p))&&(r=i.y-a.y,n=a.x-i.x,o=i.x*a.y-a.x*i.y,h=r*e.x+n*e.y+o,y=r*t.x+n*t.y+o,!(h!==0&&y!==0&&J(h,y))&&(d=l*n-r*s,d!==0)))return k=Math.abs(d/2),x=s*o-n*c,u=x<0?(x-k)/d:(x+k)/d,x=r*c-l*o,S=x<0?(x-k)/d:(x+k)/d,{x:u,y:S}}function J(e,t){return e*t>0}function Tt(e,t,a){var i=e.x,l=e.y,r=[],s=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){s=Math.min(s,d.x),n=Math.min(n,d.y)}):(s=Math.min(s,t.x),n=Math.min(n,t.y));for(var c=i-e.width/2-s,o=l-e.height/2-n,h=0;h<t.length;h++){var y=t[h],f=t[h<t.length-1?h+1:0],p=Mt(e,a,{x:c+y.x,y:o+y.y},{x:c+f.x,y:o+f.y});p&&r.push(p)}return r.length?(r.length>1&&r.sort(function(d,k){var x=d.x-a.x,u=d.y-a.y,S=Math.sqrt(x*x+u*u),B=k.x-a.x,C=k.y-a.y,X=Math.sqrt(B*B+C*C);return S<X?-1:S===X?0:1}),r[0]):e}const Bt=(e,t)=>{var a=e.x,i=e.y,l=t.x-a,r=t.y-i,s=e.width/2,n=e.height/2,c,o;return Math.abs(r)*s>Math.abs(l)*n?(r<0&&(n=-n),c=r===0?0:n*l/r,o=n):(l<0&&(s=-s),c=s,o=l===0?0:s*r/l),{x:a+c,y:i+o}},Et=Bt,w={node:Lt,circle:St,ellipse:it,polygon:Tt,rect:Et},Ct=async(e,t)=>{t.useHtmlLabels||b().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:i,bbox:l,halfPadding:r}=await M(e,t,"node "+t.classes,!0);g.info("Classes = ",t.classes);const s=i.insert("rect",":first-child");return s.attr("rx",t.rx).attr("ry",t.ry).attr("x",-l.width/2-r).attr("y",-l.height/2-r).attr("width",l.width+t.padding).attr("height",l.height+t.padding),m(t,s),t.intersect=function(n){return w.rect(t,n)},i},$t=Ct,_t=e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},Rt=(e,t,a)=>{const i=_t(e),l=2,r=t.height+2*a.padding,s=r/l,n=t.width+2*s+a.padding,c=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:s,y:0},{x:n/2,y:2*c},{x:n-s,y:0},{x:n,y:0},{x:n,y:-r/3},{x:n+2*c,y:-r/2},{x:n,y:-2*r/3},{x:n,y:-r},{x:n-s,y:-r},{x:n/2,y:-r-2*c},{x:s,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*c,y:-r/2},{x:0,y:-r/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:s,y:0},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:s,y:-r},{x:0,y:-r/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:s,y:-r},{x:n-s,y:-r},{x:n,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:-s},{x:n,y:-r+s},{x:0,y:-r}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:n,y:0},{x:0,y:-s},{x:0,y:-r+s},{x:n,y:-r}]:i.has("right")&&i.has("left")?[{x:s,y:0},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r},{x:0,y:-r/2}]:i.has("up")&&i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:s,y:-c},{x:s,y:-r+c},{x:0,y:-r+c},{x:n/2,y:-r},{x:n,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c},{x:n,y:-c}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:n,y:-s},{x:0,y:-r}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-r}]:i.has("left")&&i.has("up")?[{x:n,y:0},{x:0,y:-s},{x:n,y:-r}]:i.has("left")&&i.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-r}]:i.has("right")?[{x:s,y:-c},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r+c}]:i.has("left")?[{x:s,y:0},{x:s,y:-c},{x:n-s,y:-c},{x:n-s,y:-r+c},{x:s,y:-r+c},{x:s,y:-r},{x:0,y:-r/2}]:i.has("up")?[{x:s,y:-c},{x:s,y:-r+c},{x:0,y:-r+c},{x:n/2,y:-r},{x:n,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c}]:i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:s,y:-c},{x:s,y:-r+c},{x:n-s,y:-r+c},{x:n-s,y:-c},{x:n,y:-c}]:[{x:0,y:0}]},K=e=>e?" "+e:"",_=(e,t)=>`node default${K(e.classes)} ${K(e.class)}`,P=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=l+r,n=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];g.info("Question main (Circle)");const c=I(a,s,s,n);return c.attr("style",t.style),m(t,c),t.intersect=function(o){return g.warn("Intersect called"),w.polygon(t,n,o)},a},Ht=(e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=28,l=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}];return a.insert("polygon",":first-child").attr("points",l.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(s){return w.circle(t,14,s)},a},It=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=4,r=i.height+t.padding,s=r/l,n=i.width+2*s+t.padding,c=[{x:s,y:0},{x:n-s,y:0},{x:n,y:-r/2},{x:n-s,y:-r},{x:s,y:-r},{x:0,y:-r/2}],o=I(a,n,r,c);return o.attr("style",t.style),m(t,o),t.intersect=function(h){return w.polygon(t,c,h)},a},Nt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,void 0,!0),l=2,r=i.height+2*t.padding,s=r/l,n=i.width+2*s+t.padding,c=Rt(t.directions,i,t),o=I(a,n,r,c);return o.attr("style",t.style),m(t,o),t.intersect=function(h){return w.polygon(t,c,h)},a},Ot=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-r/2,y:0},{x:l,y:0},{x:l,y:-r},{x:-r/2,y:-r},{x:0,y:-r/2}];return I(a,l,r,s).attr("style",t.style),t.width=l+r,t.height=r,t.intersect=function(c){return w.polygon(t,s,c)},a},Wt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-2*r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:r/6,y:-r}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},Xt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:2*r/6,y:0},{x:l+r/6,y:0},{x:l-2*r/6,y:-r},{x:-r/6,y:-r}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},Yt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:-2*r/6,y:0},{x:l+2*r/6,y:0},{x:l-r/6,y:-r},{x:r/6,y:-r}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},Dt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:r/6,y:0},{x:l-r/6,y:0},{x:l+2*r/6,y:-r},{x:-2*r/6,y:-r}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},At=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:0,y:0},{x:l+r/2,y:0},{x:l,y:-r/2},{x:l+r/2,y:-r},{x:0,y:-r}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},jt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=l/2,s=r/(2.5+l/50),n=i.height+s+t.padding,c="M 0,"+s+" a "+r+","+s+" 0,0,0 "+l+" 0 a "+r+","+s+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+r+","+s+" 0,0,0 "+l+" 0 l 0,"+-n,o=a.attr("label-offset-y",s).insert("path",":first-child").attr("style",t.style).attr("d",c).attr("transform","translate("+-l/2+","+-(n/2+s)+")");return m(t,o),t.intersect=function(h){const y=w.rect(t,h),f=y.x-t.x;if(r!=0&&(Math.abs(f)<t.width/2||Math.abs(f)==t.width/2&&Math.abs(y.y-t.y)>t.height/2-s)){let p=s*s*(1-f*f/(r*r));p!=0&&(p=Math.sqrt(p)),p=s-p,h.y-t.y>0&&(p=-p),y.y+=p}return y},a},Ut=async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await M(e,t,"node "+t.classes+" "+t.class,!0),r=a.insert("rect",":first-child"),s=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-s/2:-i.width/2-l,o=t.positioned?-n/2:-i.height/2-l;if(r.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",o).attr("width",s).attr("height",n),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(V(r,t.props.borders,s,n),h.delete("borders")),h.forEach(y=>{g.warn(`Unknown node property ${y}`)})}return m(t,r),t.intersect=function(h){return w.rect(t,h)},a},zt=async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await M(e,t,"node "+t.classes,!0),r=a.insert("rect",":first-child"),s=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-s/2:-i.width/2-l,o=t.positioned?-n/2:-i.height/2-l;if(r.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",o).attr("width",s).attr("height",n),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(V(r,t.props.borders,s,n),h.delete("borders")),h.forEach(y=>{g.warn(`Unknown node property ${y}`)})}return m(t,r),t.intersect=function(h){return w.rect(t,h)},a},Zt=async(e,t)=>{const{shapeSvg:a}=await M(e,t,"label",!0);g.trace("Classes = ",t.class);const i=a.insert("rect",":first-child"),l=0,r=0;if(i.attr("width",l).attr("height",r),a.attr("class","label edgeLabel"),t.props){const s=new Set(Object.keys(t.props));t.props.borders&&(V(i,t.props.borders,l,r),s.delete("borders")),s.forEach(n=>{g.warn(`Unknown node property ${n}`)})}return m(t,i),t.intersect=function(s){return w.rect(t,s)},a};function V(e,t,a,i){const l=[],r=n=>{l.push(n,0)},s=n=>{l.push(0,n)};t.includes("t")?(g.debug("add top border"),r(a)):s(a),t.includes("r")?(g.debug("add right border"),r(i)):s(i),t.includes("b")?(g.debug("add bottom border"),r(a)):s(a),t.includes("l")?(g.debug("add left border"),r(i)):s(i),e.attr("stroke-dasharray",l.join(" "))}const Gt=(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const i=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=i.insert("rect",":first-child"),r=i.insert("line"),s=i.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let c="";typeof n=="object"?c=n[0]:c=n,g.info("Label text abc79",c,n,typeof n=="object");const o=s.node().appendChild(R(c,t.labelStyle,!0,!0));let h={width:0,height:0};if(H(b().flowchart.htmlLabels)){const k=o.children[0],x=E(o);h=k.getBoundingClientRect(),x.attr("width",h.width),x.attr("height",h.height)}g.info("Text 2",n);const y=n.slice(1,n.length);let f=o.getBBox();const p=s.node().appendChild(R(y.join?y.join("<br/>"):y,t.labelStyle,!0,!0));if(H(b().flowchart.htmlLabels)){const k=p.children[0],x=E(p);h=k.getBoundingClientRect(),x.attr("width",h.width),x.attr("height",h.height)}const d=t.padding/2;return E(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+d+5)+")"),E(o).attr("transform","translate( "+(h.width<f.width?0:-(f.width-h.width)/2)+", 0)"),h=s.node().getBBox(),s.attr("transform","translate("+-h.width/2+", "+(-h.height/2-d+3)+")"),l.attr("class","outer title-state").attr("x",-h.width/2-d).attr("y",-h.height/2-d).attr("width",h.width+t.padding).attr("height",h.height+t.padding),r.attr("class","divider").attr("x1",-h.width/2-d).attr("x2",h.width/2+d).attr("y1",-h.height/2-d+f.height+d).attr("y2",-h.height/2-d+f.height+d),m(t,l),t.intersect=function(k){return w.rect(t,k)},i},Ft=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.height+t.padding,r=i.width+l/4+t.padding,s=a.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-r/2).attr("y",-l/2).attr("width",r).attr("height",l);return m(t,s),t.intersect=function(n){return w.rect(t,n)},a},Qt=async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await M(e,t,_(t),!0),r=a.insert("circle",":first-child");return r.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),g.info("Circle main"),m(t,r),t.intersect=function(s){return g.info("Circle intersect",t,i.width/2+l,s),w.circle(t,i.width/2+l,s)},a},Vt=async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await M(e,t,_(t),!0),r=5,s=a.insert("g",":first-child"),n=s.insert("circle"),c=s.insert("circle");return s.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l+r).attr("width",i.width+t.padding+r*2).attr("height",i.height+t.padding+r*2),c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),g.info("DoubleCircle main"),m(t,n),t.intersect=function(o){return g.info("DoubleCircle intersect",t,i.width/2+l+r,o),w.circle(t,i.width/2+l+r,o)},a},qt=async(e,t)=>{const{shapeSvg:a,bbox:i}=await M(e,t,_(t),!0),l=i.width+t.padding,r=i.height+t.padding,s=[{x:0,y:0},{x:l,y:0},{x:l,y:-r},{x:0,y:-r},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-r},{x:-8,y:-r},{x:-8,y:0}],n=I(a,l,r,s);return n.attr("style",t.style),m(t,n),t.intersect=function(c){return w.polygon(t,s,c)},a},Jt=(e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),m(t,i),t.intersect=function(l){return w.circle(t,7,l)},a},tt=(e,t,a)=>{const i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let l=70,r=10;a==="LR"&&(l=10,r=70);const s=i.append("rect").attr("x",-1*l/2).attr("y",-1*r/2).attr("width",l).attr("height",r).attr("class","fork-join");return m(t,s),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return w.rect(t,n)},i},Kt=(e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child"),l=a.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),m(t,l),t.intersect=function(r){return w.circle(t,7,r)},a},Pt=(e,t)=>{const a=t.padding/2,i=4,l=8;let r;t.classes?r="node "+t.classes:r="node default";const s=e.insert("g").attr("class",r).attr("id",t.domId||t.id),n=s.insert("rect",":first-child"),c=s.insert("line"),o=s.insert("line");let h=0,y=i;const f=s.insert("g").attr("class","label");let p=0;const d=t.classData.annotations&&t.classData.annotations[0],k=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",x=f.node().appendChild(R(k,t.labelStyle,!0,!0));let u=x.getBBox();if(H(b().flowchart.htmlLabels)){const v=x.children[0],L=E(x);u=v.getBoundingClientRect(),L.attr("width",u.width),L.attr("height",u.height)}t.classData.annotations[0]&&(y+=u.height+i,h+=u.width);let S=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(b().flowchart.htmlLabels?S+="<"+t.classData.type+">":S+="<"+t.classData.type+">");const B=f.node().appendChild(R(S,t.labelStyle,!0,!0));E(B).attr("class","classTitle");let C=B.getBBox();if(H(b().flowchart.htmlLabels)){const v=B.children[0],L=E(B);C=v.getBoundingClientRect(),L.attr("width",C.width),L.attr("height",C.height)}y+=C.height+i,C.width>h&&(h=C.width);const X=[];t.classData.members.forEach(v=>{const L=v.getDisplayDetails();let W=L.displayText;b().flowchart.htmlLabels&&(W=W.replace(/</g,"<").replace(/>/g,">"));const N=f.node().appendChild(R(W,L.cssStyle?L.cssStyle:t.labelStyle,!0,!0));let $=N.getBBox();if(H(b().flowchart.htmlLabels)){const F=N.children[0],A=E(N);$=F.getBoundingClientRect(),A.attr("width",$.width),A.attr("height",$.height)}$.width>h&&(h=$.width),y+=$.height+i,X.push(N)}),y+=l;const D=[];if(t.classData.methods.forEach(v=>{const L=v.getDisplayDetails();let W=L.displayText;b().flowchart.htmlLabels&&(W=W.replace(/</g,"<").replace(/>/g,">"));const N=f.node().appendChild(R(W,L.cssStyle?L.cssStyle:t.labelStyle,!0,!0));let $=N.getBBox();if(H(b().flowchart.htmlLabels)){const F=N.children[0],A=E(N);$=F.getBoundingClientRect(),A.attr("width",$.width),A.attr("height",$.height)}$.width>h&&(h=$.width),y+=$.height+i,D.push(N)}),y+=l,d){let v=(h-u.width)/2;E(x).attr("transform","translate( "+(-1*h/2+v)+", "+-1*y/2+")"),p=u.height+i}let nt=(h-C.width)/2;return E(B).attr("transform","translate( "+(-1*h/2+nt)+", "+(-1*y/2+p)+")"),p+=C.height+i,c.attr("class","divider").attr("x1",-h/2-a).attr("x2",h/2+a).attr("y1",-y/2-a+l+p).attr("y2",-y/2-a+l+p),p+=l,X.forEach(v=>{E(v).attr("transform","translate( "+-h/2+", "+(-1*y/2+p+l/2)+")");const L=v==null?void 0:v.getBBox();p+=((L==null?void 0:L.height)??0)+i}),p+=l,o.attr("class","divider").attr("x1",-h/2-a).attr("x2",h/2+a).attr("y1",-y/2-a+l+p).attr("y2",-y/2-a+l+p),p+=l,D.forEach(v=>{E(v).attr("transform","translate( "+-h/2+", "+(-1*y/2+p)+")");const L=v==null?void 0:v.getBBox();p+=((L==null?void 0:L.height)??0)+i}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-h/2-a).attr("y",-(y/2)-a).attr("width",h+t.padding).attr("height",y+t.padding),m(t,n),t.intersect=function(v){return w.rect(t,v)},s},rt={rhombus:P,composite:zt,question:P,rect:Ut,labelRect:Zt,rectWithTitle:Gt,choice:Ht,circle:Qt,doublecircle:Vt,stadium:Ft,hexagon:It,block_arrow:Nt,rect_left_inv_arrow:Ot,lean_right:Wt,lean_left:Xt,trapezoid:Yt,inv_trapezoid:Dt,rect_right_inv_arrow:At,cylinder:jt,start:Jt,end:Kt,note:$t,subroutine:qt,fork:tt,join:tt,class_box:Pt};let Y={};const or=async(e,t,a)=>{let i,l;if(t.link){let r;b().securityLevel==="sandbox"?r="_top":t.linkTarget&&(r=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",r),l=await rt[t.shape](i,t,a)}else l=await rt[t.shape](e,t,a),i=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),i.attr("data-node","true"),i.attr("data-id",t.id),Y[t.id]=i,t.haveCallback&&Y[t.id].attr("class",Y[t.id].attr("class")+" clickable"),i},yr=(e,t)=>{Y[t.id]=e},pr=()=>{Y={}},fr=e=>{const t=Y[e.id];g.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},tr=({flowchart:e})=>{var t,a;const i=((t=e==null?void 0:e.subGraphTitleMargin)==null?void 0:t.top)??0,l=((a=e==null?void 0:e.subGraphTitleMargin)==null?void 0:a.bottom)??0,r=i+l;return{subGraphTitleTopMargin:i,subGraphTitleBottomMargin:l,subGraphTitleTotalMargin:r}},O={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:5.3};function U(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Z(e),t=Z(t);const[a,i]=[e.x,e.y],[l,r]=[t.x,t.y],s=l-a,n=r-i;return{angle:Math.atan(n/s),deltaX:s,deltaY:n}}const Z=e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,rr=e=>({x:function(t,a,i){let l=0;if(a===0&&Object.hasOwn(O,e.arrowTypeStart)){const{angle:r,deltaX:s}=U(i[0],i[1]);l=O[e.arrowTypeStart]*Math.cos(r)*(s>=0?1:-1)}else if(a===i.length-1&&Object.hasOwn(O,e.arrowTypeEnd)){const{angle:r,deltaX:s}=U(i[i.length-1],i[i.length-2]);l=O[e.arrowTypeEnd]*Math.cos(r)*(s>=0?1:-1)}return Z(t).x+l},y:function(t,a,i){let l=0;if(a===0&&Object.hasOwn(O,e.arrowTypeStart)){const{angle:r,deltaY:s}=U(i[0],i[1]);l=O[e.arrowTypeStart]*Math.abs(Math.sin(r))*(s>=0?1:-1)}else if(a===i.length-1&&Object.hasOwn(O,e.arrowTypeEnd)){const{angle:r,deltaY:s}=U(i[i.length-1],i[i.length-2]);l=O[e.arrowTypeEnd]*Math.abs(Math.sin(r))*(s>=0?1:-1)}return Z(t).y+l}}),ar=(e,t,a,i,l)=>{t.arrowTypeStart&&at(e,"start",t.arrowTypeStart,a,i,l),t.arrowTypeEnd&&at(e,"end",t.arrowTypeEnd,a,i,l)},er={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},at=(e,t,a,i,l,r)=>{const s=er[a];if(!s){g.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${i}#${l}_${r}-${s}${n})`)};let G={},T={};const xr=()=>{G={},T={}},dr=(e,t)=>{const a=H(b().flowchart.htmlLabels),i=t.labelType==="markdown"?st(e,t.label,{style:t.labelStyle,useHtmlLabels:a,addSvgBackground:!0}):R(t.label,t.labelStyle),l=e.insert("g").attr("class","edgeLabel"),r=l.insert("g").attr("class","label");r.node().appendChild(i);let s=i.getBBox();if(a){const c=i.children[0],o=E(i);s=c.getBoundingClientRect(),o.attr("width",s.width),o.attr("height",s.height)}r.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),G[t.id]=l,t.width=s.width,t.height=s.height;let n;if(t.startLabelLeft){const c=R(t.startLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");n=h.node().appendChild(c);const y=c.getBBox();h.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),T[t.id]||(T[t.id]={}),T[t.id].startLeft=o,z(n,t.startLabelLeft)}if(t.startLabelRight){const c=R(t.startLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");n=o.node().appendChild(c),h.node().appendChild(c);const y=c.getBBox();h.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),T[t.id]||(T[t.id]={}),T[t.id].startRight=o,z(n,t.startLabelRight)}if(t.endLabelLeft){const c=R(t.endLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");n=h.node().appendChild(c);const y=c.getBBox();h.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),o.node().appendChild(c),T[t.id]||(T[t.id]={}),T[t.id].endLeft=o,z(n,t.endLabelLeft)}if(t.endLabelRight){const c=R(t.endLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),h=o.insert("g").attr("class","inner");n=h.node().appendChild(c);const y=c.getBBox();h.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),o.node().appendChild(c),T[t.id]||(T[t.id]={}),T[t.id].endRight=o,z(n,t.endLabelRight)}return i};function z(e,t){b().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}const gr=(e,t)=>{g.debug("Moving label abc88 ",e.id,e.label,G[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const i=b(),{subGraphTitleTotalMargin:l}=tr(i);if(e.label){const r=G[e.id];let s=e.x,n=e.y;if(a){const c=j.calcLabelPosition(a);g.debug("Moving label "+e.label+" from (",s,",",n,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(s=c.x,n=c.y)}r.attr("transform",`translate(${s}, ${n+l/2})`)}if(e.startLabelLeft){const r=T[e.id].startLeft;let s=e.x,n=e.y;if(a){const c=j.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}if(e.startLabelRight){const r=T[e.id].startRight;let s=e.x,n=e.y;if(a){const c=j.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelLeft){const r=T[e.id].endLeft;let s=e.x,n=e.y;if(a){const c=j.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelRight){const r=T[e.id].endRight;let s=e.x,n=e.y;if(a){const c=j.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);s=c.x,n=c.y}r.attr("transform",`translate(${s}, ${n})`)}},sr=(e,t)=>{const a=e.x,i=e.y,l=Math.abs(t.x-a),r=Math.abs(t.y-i),s=e.width/2,n=e.height/2;return l>=s||r>=n},ir=(e,t,a)=>{g.debug(`intersection calc abc89:
|
|
2
2
|
outsidePoint: ${JSON.stringify(t)}
|
|
3
3
|
insidePoint : ${JSON.stringify(a)}
|
|
4
4
|
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,l=e.y,r=Math.abs(i-a.x),s=e.width/2;let n=a.x<t.x?s-r:s+r;const c=e.height/2,o=Math.abs(t.y-a.y),h=Math.abs(t.x-a.x);if(Math.abs(l-t.y)*s>Math.abs(i-t.x)*c){let y=a.y<t.y?t.y-c-l:l-c-t.y;n=h*y/o;const f={x:a.x<t.x?a.x+n:a.x-h+n,y:a.y<t.y?a.y+o-y:a.y-o+y};return n===0&&(f.x=t.x,f.y=t.y),h===0&&(f.x=t.x),o===0&&(f.y=t.y),g.debug(`abc89 topp/bott calc, Q ${o}, q ${y}, R ${h}, r ${n}`,f),f}else{a.x<t.x?n=t.x-s-i:n=i-s-t.x;let y=o*n/h,f=a.x<t.x?a.x+h-n:a.x-h+n,p=a.y<t.y?a.y+y:a.y-y;return g.debug(`sides calc abc89, Q ${o}, q ${y}, R ${h}, r ${n}`,{_x:f,_y:p}),n===0&&(f=t.x,p=t.y),h===0&&(f=t.x),o===0&&(p=t.y),{x:f,y:p}}},et=(e,t)=>{g.debug("abc88 cutPathAtIntersect",e,t);let a=[],i=e[0],l=!1;return e.forEach(r=>{if(!sr(t,r)&&!l){const s=ir(t,i,r);let n=!1;a.forEach(c=>{n=n||c.x===s.x&&c.y===s.y}),a.some(c=>c.x===s.x&&c.y===s.y)||a.push(s),l=!0}else i=r,l||a.push(r)}),a},ur=function(e,t,a,i,l,r,s){let n=a.points;g.debug("abc88 InsertEdge: edge=",a,"e=",t);let c=!1;const o=r.node(t.v);var h=r.node(t.w);h!=null&&h.intersect&&(o!=null&&o.intersect)&&(n=n.slice(1,a.points.length-1),n.unshift(o.intersect(n[0])),n.push(h.intersect(n[n.length-1]))),a.toCluster&&(g.debug("to cluster abc88",i[a.toCluster]),n=et(a.points,i[a.toCluster].node),c=!0),a.fromCluster&&(g.debug("from cluster abc88",i[a.fromCluster]),n=et(n.reverse(),i[a.fromCluster].node).reverse(),c=!0);const y=n.filter(C=>!Number.isNaN(C.y));let f=lt;a.curve&&(l==="graph"||l==="flowchart")&&(f=a.curve);const{x:p,y:d}=rr(a),k=ct().x(p).y(d).curve(f);let x;switch(a.thickness){case"normal":x="edge-thickness-normal";break;case"thick":x="edge-thickness-thick";break;case"invisible":x="edge-thickness-thick";break;default:x=""}switch(a.pattern){case"solid":x+=" edge-pattern-solid";break;case"dotted":x+=" edge-pattern-dotted";break;case"dashed":x+=" edge-pattern-dashed";break}const u=e.append("path").attr("d",k(y)).attr("id",a.id).attr("class"," "+x+(a.classes?" "+a.classes:"")).attr("style",a.style);let S="";(b().flowchart.arrowMarkerAbsolute||b().state.arrowMarkerAbsolute)&&(S=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,S=S.replace(/\(/g,"\\("),S=S.replace(/\)/g,"\\)")),ar(u,a,S,s,l);let B={};return c&&(B.updatedPath=n),B.originalPath=a.points,B};export{ur as a,dr as b,or as c,fr as d,Et as e,R as f,tr as g,pr as h,hr as i,xr as j,rr as k,M as l,ar as m,gr as p,yr as s,m as u};
|