@stelis/say-ur-intent 0.0.0 → 0.0.2
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 +4 -39
- package/dist/adapters/adapterLifecycleValidators.js +7 -0
- package/dist/adapters/adapterPromptSurfaces.js +71 -0
- package/dist/adapters/deepbook/deepbookHumanReviewProducer.js +175 -0
- package/dist/adapters/deepbook/deepbookQuotePolicy.js +112 -0
- package/dist/adapters/deepbook/deepbookReviewEvidence.js +507 -0
- package/dist/adapters/deepbook/deepbookReviewLifecycle.js +85 -0
- package/dist/adapters/deepbook/deepbookSwapIntent.js +79 -0
- package/dist/adapters/deepbook/deepbookTransactionMaterialProducer.js +269 -0
- package/dist/adapters/flowx/flowxSwapHumanReviewProducer.js +176 -0
- package/dist/adapters/flowx/flowxSwapIntent.js +79 -0
- package/dist/adapters/flowx/flowxSwapQuotePolicy.js +104 -0
- package/dist/adapters/flowx/flowxSwapReviewEvidence.js +468 -0
- package/dist/adapters/flowx/flowxSwapReviewLifecycle.js +85 -0
- package/dist/adapters/flowx/flowxSwapTransactionMaterialProducer.js +362 -0
- package/dist/adapters/intentPlanFactories.js +59 -0
- package/dist/adapters/reviewAdapters.js +81 -0
- package/dist/core/action/adapterLifecycleValidation.js +12 -0
- package/dist/core/action/forbiddenFields.js +43 -0
- package/dist/core/action/humanReadableReviewEvidence.js +203 -0
- package/dist/core/action/humanReadableReviewProjectionVerifier.js +29 -0
- package/dist/core/action/ptbVisualizationProducer.js +66 -0
- package/dist/core/action/reviewCheckResults.js +6 -0
- package/dist/core/action/reviewStateValidation.js +11 -0
- package/dist/core/action/reviewTimeSimulationEvidence.js +471 -0
- package/dist/core/action/schemas.js +529 -0
- package/dist/core/action/signableAdapterContract.js +993 -0
- package/dist/core/action/swapHumanReadableReviewProjection.js +124 -0
- package/dist/core/action/swapQuotePolicyEvidence.js +278 -0
- package/dist/core/action/transactionObjectOwnershipEvidence.js +247 -0
- package/dist/core/action/transactionObjectOwnershipProducer.js +329 -0
- package/dist/core/action/types.js +35 -0
- package/dist/core/action/walletReviewContractAssembler.js +282 -0
- package/dist/core/activity/activityStore.js +15 -0
- package/dist/core/activity/localDataService.js +258 -0
- package/dist/core/activity/localDataTypes.js +11 -0
- package/dist/core/activity/localDataValidation.js +396 -0
- package/dist/core/activity/schemaVersion.js +1 -0
- package/dist/core/activity/sqliteActivityStore.js +820 -0
- package/dist/core/activity/sqliteActivityStoreRows.js +430 -0
- package/dist/core/activity/sqliteActivityStoreSchema.js +258 -0
- package/dist/core/activity/sqliteActivityStoreTypes.js +5 -0
- package/dist/core/activity/suiFunctionTarget.js +43 -0
- package/dist/core/activity/transactionActivityAccountEffects.js +189 -0
- package/dist/core/activity/transactionActivityAnalysis.js +295 -0
- package/dist/core/activity/transactionActivityClassifier.js +306 -0
- package/dist/core/activity/transactionActivityDetails.js +229 -0
- package/dist/core/activity/transactionActivityProtocolRules.js +218 -0
- package/dist/core/activity/transactionActivityScanPolicy.js +170 -0
- package/dist/core/activity/transactionActivityService.js +379 -0
- package/dist/core/activity/transactionActivityTypes.js +18 -0
- package/dist/core/eventlog/sink.js +35 -0
- package/dist/core/evidence/settlementFamilies.js +87 -0
- package/dist/core/evidence/userAnswerUse.js +1 -0
- package/dist/core/numeric/rawU64.js +63 -0
- package/dist/core/preferences/preferencesStore.js +26 -0
- package/dist/core/preferences/sqlitePreferencesRepository.js +136 -0
- package/dist/core/proposal/externalProposalReview.js +347 -0
- package/dist/core/proposal/schemas.js +208 -0
- package/dist/core/proposal/types.js +35 -0
- package/dist/core/read/amounts.js +14 -0
- package/dist/core/read/coinMetadata.js +60 -0
- package/dist/core/read/deepbookRawQuoteClient.js +86 -0
- package/dist/core/read/deepbookReadHelpers.js +265 -0
- package/dist/core/read/deepbookRegistry.js +133 -0
- package/dist/core/read/flowxQuoteClient.js +117 -0
- package/dist/core/read/flowxReadHelpers.js +145 -0
- package/dist/core/read/flowxRegistry.js +174 -0
- package/dist/core/read/intentEvidenceResponseFormatting.js +228 -0
- package/dist/core/read/readResponseGuidance.js +451 -0
- package/dist/core/read/readService.js +1164 -0
- package/dist/core/read/readServiceTypes.js +59 -0
- package/dist/core/read/settlementParityFormatting.js +82 -0
- package/dist/core/read/walletReadHelpers.js +99 -0
- package/dist/core/review/reviewChecks.js +54 -0
- package/dist/core/review/reviewComputation.js +38 -0
- package/dist/core/review/reviewComputationResult.js +87 -0
- package/dist/core/session/localSession.js +31 -0
- package/dist/core/session/privateReviewArtifacts.js +73 -0
- package/dist/core/session/sessionErrors.js +9 -0
- package/dist/core/session/sessionStore.js +821 -0
- package/dist/core/session/settingsSession.js +1 -0
- package/dist/core/session/settingsSessions.js +43 -0
- package/dist/core/session/status.js +86 -0
- package/dist/core/session/transactionMaterialStore.js +205 -0
- package/dist/core/session/wait.js +102 -0
- package/dist/core/session/walletIdentity.js +103 -0
- package/dist/core/session/walletIdentitySessions.js +189 -0
- package/dist/core/suiAddress.js +18 -0
- package/dist/core/suiEndpoint.js +72 -0
- package/dist/mcp/activeAccountResponse.js +24 -0
- package/dist/mcp/prompts.js +146 -0
- package/dist/mcp/registerTool.js +19 -0
- package/dist/mcp/resources.js +72 -0
- package/dist/mcp/responseGuidance.js +381 -0
- package/dist/mcp/result.js +17 -0
- package/dist/mcp/schemas.js +8 -0
- package/dist/mcp/server.js +30 -0
- package/dist/mcp/serverInfo.js +123 -0
- package/dist/mcp/toolErrors.js +105 -0
- package/dist/mcp/toolNames.js +50 -0
- package/dist/mcp/tools/account/index.js +44 -0
- package/dist/mcp/tools/action/prepareSuiActionReview.js +120 -0
- package/dist/mcp/tools/read/commonSchemas.js +43 -0
- package/dist/mcp/tools/read/deepbookReadTools.js +453 -0
- package/dist/mcp/tools/read/flowxReadTools.js +135 -0
- package/dist/mcp/tools/read/index.js +16 -0
- package/dist/mcp/tools/read/readToolHelpers.js +68 -0
- package/dist/mcp/tools/read/reviewActivityTools.js +176 -0
- package/dist/mcp/tools/read/serverStatusTools.js +103 -0
- package/dist/mcp/tools/read/transactionActivityOutput.js +300 -0
- package/dist/mcp/tools/read/transactionActivityTools.js +544 -0
- package/dist/mcp/tools/read/walletReadTools.js +733 -0
- package/dist/mcp/tools/session/executionResultTools.js +92 -0
- package/dist/mcp/tools/session/index.js +8 -0
- package/dist/mcp/tools/session/shared.js +79 -0
- package/dist/mcp/tools/session/statusTools.js +134 -0
- package/dist/mcp/tools/session/walletIdentityTools.js +119 -0
- package/dist/mcp/tools/settings/index.js +64 -0
- package/dist/review-app/analysis.css +1 -0
- package/dist/review-app/analysis.js +1 -0
- package/dist/review-app/arc-BjIacwQm.js +1 -0
- package/dist/review-app/architecture-U656AL7Q-aSB9x1OK.js +1 -0
- package/dist/review-app/architectureDiagram-VXUJARFQ-C5W6re2I.js +36 -0
- package/dist/review-app/array-BmXUUrU6.js +1 -0
- package/dist/review-app/blockDiagram-VD42YOAC-20MLNcUm.js +122 -0
- package/dist/review-app/c4Diagram-YG6GDRKO-BZXRrcck.js +10 -0
- package/dist/review-app/channel-lk2p_CUu.js +1 -0
- package/dist/review-app/chunk-4BX2VUAB-BPITOdjX.js +1 -0
- package/dist/review-app/chunk-55IACEB6-Dz-pyw5k.js +1 -0
- package/dist/review-app/chunk-76Q3JFCE-cK_X1P_l.js +1 -0
- package/dist/review-app/chunk-ABZYJK2D-Dt4W53JI.js +81 -0
- package/dist/review-app/chunk-ATLVNIR6-fZHLXURb.js +1 -0
- package/dist/review-app/chunk-B4BG7PRW-BbgcjusC.js +165 -0
- package/dist/review-app/chunk-BJD4TVEz.js +1 -0
- package/dist/review-app/chunk-CVBHYZKI-CViawAKX.js +1 -0
- package/dist/review-app/chunk-DI55MBZ5-C5aoul-d.js +220 -0
- package/dist/review-app/chunk-FMBD7UC4-Chxmw62A.js +15 -0
- package/dist/review-app/chunk-FPAJGGOC-DDHjQ09H.js +80 -0
- package/dist/review-app/chunk-FWNWRKHM-CVVQUptk.js +1 -0
- package/dist/review-app/chunk-HN2XXSSU-yzNpjaSZ.js +1 -0
- package/dist/review-app/chunk-JA3XYJ7Z-C5ZJdU01.js +70 -0
- package/dist/review-app/chunk-JZLCHNYA-BBST4Cnk.js +54 -0
- package/dist/review-app/chunk-LBM3YZW2-CdwAPuHr.js +1 -0
- package/dist/review-app/chunk-LHMN2FUI-BtB5uDcp.js +1 -0
- package/dist/review-app/chunk-O7ZBX7Z2-pxdK4Sa3.js +1 -0
- package/dist/review-app/chunk-QN33PNHL-CbVv3uGK.js +1 -0
- package/dist/review-app/chunk-QXUST7PY-DKM2-t2c.js +7 -0
- package/dist/review-app/chunk-QZHKN3VN-C5ni2pN_.js +1 -0
- package/dist/review-app/chunk-S3R3BYOJ-BWvOhDs0.js +2 -0
- package/dist/review-app/chunk-S6J4BHB3-D9Fk0YeD.js +1 -0
- package/dist/review-app/chunk-T53DSG4Q-C1qEyzyV.js +1 -0
- package/dist/review-app/chunk-TZMSLE5B-B--7eU69.js +1 -0
- package/dist/review-app/classDiagram-2ON5EDUG-DlL1m2bp.js +1 -0
- package/dist/review-app/classDiagram-v2-WZHVMYZB-FXRskT1j.js +1 -0
- package/dist/review-app/clone-BZZb7gpZ.js +1 -0
- package/dist/review-app/cose-bilkent-S5V4N54A-CRIb8XEO.js +1 -0
- package/dist/review-app/cytoscape.esm-C7jYqDP5.js +321 -0
- package/dist/review-app/dagre-6UL2VRFP-FNCAXbdE.js +4 -0
- package/dist/review-app/dagre-Be46QtUd.js +1 -0
- package/dist/review-app/defaultLocale-BaWNtAUL.js +1 -0
- package/dist/review-app/diagram-PSM6KHXK-ylLWjiNM.js +24 -0
- package/dist/review-app/diagram-QEK2KX5R-BCDcESxs.js +43 -0
- package/dist/review-app/diagram-S2PKOQOG-Vdrc-vrO.js +24 -0
- package/dist/review-app/dist-WPc74x_f.js +1 -0
- package/dist/review-app/erDiagram-Q2GNP2WA-E5ZsUbDF.js +60 -0
- package/dist/review-app/flatten-DHf9IeNI.js +1 -0
- package/dist/review-app/flowDiagram-NV44I4VS-DBSQuj6x.js +162 -0
- package/dist/review-app/ganttDiagram-LVOFAZNH-CKUOsqwl.js +267 -0
- package/dist/review-app/gitGraph-F6HP7TQM-DsAD6qK1.js +1 -0
- package/dist/review-app/gitGraphDiagram-NY62KEGX-BCeIMWdl.js +65 -0
- package/dist/review-app/graphlib-CiX5CXxR.js +1 -0
- package/dist/review-app/http-DMvwuuFk.js +1 -0
- package/dist/review-app/identity-DY8PXc6t.js +1 -0
- package/dist/review-app/info-NVLQJR56-Dlx1nZic.js +1 -0
- package/dist/review-app/infoDiagram-F6ZHWCRC-CAuANIrz.js +2 -0
- package/dist/review-app/init-BvqephKz.js +1 -0
- package/dist/review-app/journeyDiagram-XKPGCS4Q-C-Z9phnx.js +139 -0
- package/dist/review-app/kanban-definition-3W4ZIXB7-DufgZABq.js +89 -0
- package/dist/review-app/katex-B-Z-NXXN.js +257 -0
- package/dist/review-app/line-DiIv3Jgw.js +1 -0
- package/dist/review-app/linear-Cv-UPvo1.js +1 -0
- package/dist/review-app/math-kmyYrkHL.js +1 -0
- package/dist/review-app/mermaid-parser.core-DkwUYTPl.js +4 -0
- package/dist/review-app/mindmap-definition-VGOIOE7T-TM_CqdmV.js +68 -0
- package/dist/review-app/ordinal-BliTlkoG.js +1 -0
- package/dist/review-app/packet-BFZMPI3H-DqbnU92v.js +1 -0
- package/dist/review-app/path-AEo9W6mQ.js +1 -0
- package/dist/review-app/pie-7BOR55EZ-LJzaLkgr.js +1 -0
- package/dist/review-app/pieDiagram-ADFJNKIX-BAs8OfRS.js +30 -0
- package/dist/review-app/quadrantDiagram-AYHSOK5B-CyUDZP5S.js +7 -0
- package/dist/review-app/radar-NHE76QYJ-DBpHc8_Y.js +1 -0
- package/dist/review-app/reduce-B-HuPpdd.js +1 -0
- package/dist/review-app/requirementDiagram-UZGBJVZJ-BEHix78P.js +64 -0
- package/dist/review-app/review.css +1 -0
- package/dist/review-app/review.js +43 -0
- package/dist/review-app/sankeyDiagram-TZEHDZUN-B2bKbmsm.js +10 -0
- package/dist/review-app/sequenceDiagram-WL72ISMW-DVLOORFJ.js +145 -0
- package/dist/review-app/settings.css +1 -0
- package/dist/review-app/settings.js +1 -0
- package/dist/review-app/src-Buml7cM5.js +1 -0
- package/dist/review-app/stateDiagram-FKZM4ZOC-sFGGp2kV.js +1 -0
- package/dist/review-app/stateDiagram-v2-4FDKWEC3-BHfCF4dX.js +1 -0
- package/dist/review-app/timeline-definition-IT6M3QCI-BESnBijC.js +61 -0
- package/dist/review-app/treemap-KMMF4GRG-wnVLBDeQ.js +1 -0
- package/dist/review-app/walletStatus-CcojOdGy.js +7 -0
- package/dist/review-app/xychartDiagram-PRI3JC2R-BGWVfCx4.js +7 -0
- package/dist/review-server/assets.js +48 -0
- package/dist/review-server/html.js +66 -0
- package/dist/review-server/http.js +47 -0
- package/dist/review-server/middleware/hostOrigin.js +48 -0
- package/dist/review-server/middleware/reviewToken.js +7 -0
- package/dist/review-server/reviewServerPolicy.js +10 -0
- package/dist/review-server/server.js +568 -0
- package/dist/review-server/settingsApi.js +182 -0
- package/dist/review-server/walletIdentityResponse.js +13 -0
- package/dist/runtime/config.js +103 -0
- package/dist/runtime/localSettingsService.js +198 -0
- package/dist/runtime/logger.js +50 -0
- package/dist/runtime/reviewServerAcquire.js +128 -0
- package/dist/runtime/smokeMainnetRead.js +529 -0
- package/dist/runtime/smokeMainnetReadAssertions.js +308 -0
- package/dist/runtime/start.js +295 -0
- package/dist/runtime/suiEndpoint.js +97 -0
- package/dist/runtime/suiTransactionGraphqlMapping.js +200 -0
- package/dist/runtime/suiTransactionGraphqlQueries.js +231 -0
- package/dist/runtime/suiTransactionGraphqlSource.js +148 -0
- package/docs/AGENT_BEHAVIOR.md +1 -1
- package/docs/AGENT_DEVELOPMENT_POLICY.md +20 -0
- package/docs/FRONTEND_POLICY.md +4 -3
- package/docs/MCP_SETUP.md +59 -7
- package/docs/MCP_TOOLS.md +1 -1
- package/docs/SDK_API.md +5 -1
- package/package.json +3 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e,f as t,g as n,h as r,m as i,n as a,p as o,s,t as c}from"./chunk-FPAJGGOC-DDHjQ09H.js";var l=class extends c{static{t(this,`TreemapTokenBuilder`)}constructor(){super([`treemap`])}},u=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,d=class extends a{static{t(this,`TreemapValueConverter`)}runCustomConverter(e,t,n){if(e.name===`NUMBER2`)return parseFloat(t.replace(/,/g,``));if(e.name===`SEPARATOR`||e.name===`STRING2`)return t.substring(1,t.length-1);if(e.name===`INDENTATION`)return t.length;if(e.name===`ClassDef`){if(typeof t!=`string`)return t;let e=u.exec(t);if(e)return{$type:`ClassDefStatement`,className:e[1],styleText:e[2]||void 0}}}};function f(e){let t=e.validation.TreemapValidator,n=e.validation.ValidationRegistry;if(n){let e={Treemap:t.checkSingleRoot.bind(t)};n.register(e,t)}}t(f,`registerValidationChecks`);var p=class{static{t(this,`TreemapValidator`)}checkSingleRoot(e,t){let n;for(let r of e.TreemapRows)r.item&&(n===void 0&&r.indent===void 0?n=0:(r.indent===void 0||n!==void 0&&n>=parseInt(r.indent,10))&&t(`error`,`Multiple root nodes are not allowed in a treemap.`,{node:r,property:`item`}))}},m={parser:{TokenBuilder:t(()=>new l,`TokenBuilder`),ValueConverter:t(()=>new d,`ValueConverter`)},validation:{TreemapValidator:t(()=>new p,`TreemapValidator`)}};function h(t=o){let a=i(n(t),s),c=i(r({shared:a}),e,m);return a.ServiceRegistry.register(c),f(c),{shared:a,Treemap:c}}t(h,`createTreemapServices`);export{h as n,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./src-Buml7cM5.js";var t={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},n={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function r(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=i(e),t=i(t);let[n,r]=[e.x,e.y],[a,o]=[t.x,t.y],s=a-n,c=o-r;return{angle:Math.atan(c/s),deltaX:s,deltaY:c}}e(r,`calculateDeltaAndAngle`);var i=e(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,`pointTransformer`),a=e(n=>({x:e(function(e,a,o){let s=0,c=i(o[0]).x<i(o[o.length-1]).x?`left`:`right`;if(a===0&&Object.hasOwn(t,n.arrowTypeStart)){let{angle:e,deltaX:i}=r(o[0],o[1]);s=t[n.arrowTypeStart]*Math.cos(e)*(i>=0?1:-1)}else if(a===o.length-1&&Object.hasOwn(t,n.arrowTypeEnd)){let{angle:e,deltaX:i}=r(o[o.length-1],o[o.length-2]);s=t[n.arrowTypeEnd]*Math.cos(e)*(i>=0?1:-1)}let l=Math.abs(i(e).x-i(o[o.length-1]).x),u=Math.abs(i(e).y-i(o[o.length-1]).y),d=Math.abs(i(e).x-i(o[0]).x),f=Math.abs(i(e).y-i(o[0]).y),p=t[n.arrowTypeStart],m=t[n.arrowTypeEnd];if(l<m&&l>0&&u<m){let e=m+1-l;e*=c===`right`?-1:1,s-=e}if(d<p&&d>0&&f<p){let e=p+1-d;e*=c===`right`?-1:1,s+=e}return i(e).x+s},`x`),y:e(function(e,a,o){let s=0,c=i(o[0]).y<i(o[o.length-1]).y?`down`:`up`;if(a===0&&Object.hasOwn(t,n.arrowTypeStart)){let{angle:e,deltaY:i}=r(o[0],o[1]);s=t[n.arrowTypeStart]*Math.abs(Math.sin(e))*(i>=0?1:-1)}else if(a===o.length-1&&Object.hasOwn(t,n.arrowTypeEnd)){let{angle:e,deltaY:i}=r(o[o.length-1],o[o.length-2]);s=t[n.arrowTypeEnd]*Math.abs(Math.sin(e))*(i>=0?1:-1)}let l=Math.abs(i(e).y-i(o[o.length-1]).y),u=Math.abs(i(e).x-i(o[o.length-1]).x),d=Math.abs(i(e).y-i(o[0]).y),f=Math.abs(i(e).x-i(o[0]).x),p=t[n.arrowTypeStart],m=t[n.arrowTypeEnd];if(l<m&&l>0&&u<m){let e=m+1-l;e*=c===`up`?-1:1,s-=e}if(d<p&&d>0&&f<p){let e=p+1-d;e*=c===`up`?-1:1,s+=e}return i(e).y+s},`y`)}),`getLineFunctionsWithOffset`);export{t as n,n as r,a as t};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import{g as e,h as t,p as n}from"./src-Buml7cM5.js";import{I as r,N as i,O as a,s as o,y as s}from"./chunk-ABZYJK2D-Dt4W53JI.js";import{i as c}from"./chunk-S3R3BYOJ-BWvOhDs0.js";var l=Object.freeze({left:0,top:0,width:16,height:16}),u=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),d=Object.freeze({...l,...u}),f=Object.freeze({...d,body:``,hidden:!1}),p=Object.freeze({width:null,height:null}),ee=Object.freeze({...p,...u}),m=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!h(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!h(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!h(e,n)?null:e}return null},h=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function te(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function ne(e,t){let n=te(e,t);for(let r in f)r in u?r in e&&!(r in n)&&(n[r]=u[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function re(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(a),i}function ie(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=ne(r[e]||i[e],a)}return o(t),n.forEach(o),ne(e,a)}function ae(e,t){if(e.icons[t])return ie(e,t,[]);let n=re(e,[t])[t];return n?ie(e,t,n):null}var oe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,se=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ce(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(oe);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=se.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function le(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function ue(e,t){return e?`<defs>`+e+`</defs>`+t:t}function de(e,t,n){let r=le(e);return ue(r.defs,t+r.content+n)}var fe=e=>e===`unset`||e===`undefined`||e===`none`;function pe(e,t){let n={...d,...e},r={...ee,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=de(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,f;o===null?(f=s===null?`1em`:s===`auto`?l:s,u=ce(f,c/l)):(u=o===`auto`?c:o,f=s===null?ce(u,l/c):s===`auto`?l:s);let p={},m=(e,t)=>{fe(t)||(p[e]=t.toString())};m(`width`,u),m(`height`,f);let h=[i.left,i.top,c,l];return p.viewBox=h.join(` `),{attributes:p,viewBox:h,body:a}}var me=/\sid="(\S+)"/g,he=new Map;function ge(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=he.get(e)||0;return he.set(e,t+1),t?`${e}${t}`:e}function _e(e){let t=[],n;for(;n=me.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=ge(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}function ve(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function g(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _=g();function ye(e){_=e}var v={exec:()=>null};function y(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(b.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var be=(()=>{try{return!0}catch{return!1}})(),b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},xe=/^(?:[ \t]*(?:\n|$))+/,Se=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ce=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,x=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,we=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,S=/(?:[*+-]|\d{1,9}[.)])/,Te=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ee=y(Te).replace(/bull/g,S).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),De=y(Te).replace(/bull/g,S).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),C=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Oe=/^[^\n]+/,w=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ke=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,w).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ae=y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,S).getRegex(),T=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,E=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,je=y(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,E).replace(`tag`,T).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),D=y(C).replace(`hr`,x).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,T).getRegex(),O={blockquote:y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,D).getRegex(),code:Se,def:ke,fences:Ce,heading:we,hr:x,html:je,lheading:Ee,list:Ae,newline:xe,paragraph:D,table:v,text:Oe},Me=y(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,x).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,T).getRegex(),Ne={...O,lheading:De,table:Me,paragraph:y(C).replace(`hr`,x).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Me).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,T).getRegex()},Pe={...O,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,E).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:v,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y(C).replace(`hr`,x).replace(`heading`,` *#{1,6} *[^
|
|
2
|
+
]`).replace(`lheading`,Ee).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Fe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ie=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Le=/^( {2,}|\\)\n(?!\s*$)/,Re=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,k=/[\p{P}\p{S}]/u,A=/[\s\p{P}\p{S}]/u,ze=/[^\s\p{P}\p{S}]/u,Be=y(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,A).getRegex(),Ve=/(?!~)[\p{P}\p{S}]/u,He=/(?!~)[\s\p{P}\p{S}]/u,Ue=/(?:[^\s\p{P}\p{S}]|~)/u,We=y(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,be?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Ge=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ke=y(Ge,`u`).replace(/punct/g,k).getRegex(),qe=y(Ge,`u`).replace(/punct/g,Ve).getRegex(),Je=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Ye=y(Je,`gu`).replace(/notPunctSpace/g,ze).replace(/punctSpace/g,A).replace(/punct/g,k).getRegex(),Xe=y(Je,`gu`).replace(/notPunctSpace/g,Ue).replace(/punctSpace/g,He).replace(/punct/g,Ve).getRegex(),Ze=y(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,ze).replace(/punctSpace/g,A).replace(/punct/g,k).getRegex(),Qe=y(/\\(punct)/,`gu`).replace(/punct/g,k).getRegex(),$e=y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),et=y(E).replace(`(?:-->|$)`,`-->`).getRegex(),tt=y(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,et).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),j=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,nt=y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,j).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),rt=y(/^!?\[(label)\]\[(ref)\]/).replace(`label`,j).replace(`ref`,w).getRegex(),it=y(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,w).getRegex(),at=y(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,rt).replace(`nolink`,it).getRegex(),ot=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,M={_backpedal:v,anyPunctuation:Qe,autolink:$e,blockSkip:We,br:Le,code:Ie,del:v,emStrongLDelim:Ke,emStrongRDelimAst:Ye,emStrongRDelimUnd:Ze,escape:Fe,link:nt,nolink:it,punctuation:Be,reflink:rt,reflinkSearch:at,tag:tt,text:Re,url:v},st={...M,link:y(/^!?\[(label)\]\((.*?)\)/).replace(`label`,j).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,j).getRegex()},N={...M,emStrongRDelimAst:Xe,emStrongLDelim:qe,url:y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,ot).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:y(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,ot).getRegex()},ct={...N,br:y(Le).replace(`{2,}`,`*`).getRegex(),text:y(N.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},P={normal:O,gfm:Ne,pedantic:Pe},F={normal:M,gfm:N,breaks:ct,pedantic:st},lt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},ut=e=>lt[e];function I(e,t){if(t){if(b.escapeTest.test(e))return e.replace(b.escapeReplace,ut)}else if(b.escapeTestNoEncode.test(e))return e.replace(b.escapeReplaceNoEncode,ut);return e}function dt(e){try{e=encodeURI(e).replace(b.percentDecode,`%`)}catch{return null}return e}function ft(e,t){let n=e.replace(b.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(b.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(b.slashPipe,`|`);return n}function L(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function pt(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function mt(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function ht(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
3
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
4
|
+
`)}var R=class{options;rules;lexer;constructor(e){this.options=e||_}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:L(e,`
|
|
5
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=ht(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=L(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:L(t[0],`
|
|
6
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=L(t[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
9
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
11
|
+
${s}`:s,r=r?`${r}
|
|
12
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
13
|
+
`+e.join(`
|
|
14
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
15
|
+
`+e.join(`
|
|
16
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
18
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
19
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
20
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(`
|
|
21
|
+
`,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
22
|
+
`+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
23
|
+
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
24
|
+
`,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=ft(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
25
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(ft(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
26
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=L(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=pt(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),mt(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return mt(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},z=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_,this.options.tokenizer=this.options.tokenizer||new R,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:b,block:P.normal,inline:F.normal};this.options.pedantic?(t.block=P.pedantic,t.inline=F.pedantic):this.options.gfm&&(t.block=P.gfm,this.options.breaks?t.inline=F.breaks:t.inline=F.gfm),this.tokenizer.rules=t}static get rules(){return{block:P,inline:F}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(b.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(b.tabCharGlobal,` `).replace(b.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
28
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
29
|
+
`)?``:`
|
|
30
|
+
`)+r.raw,n.text+=`
|
|
31
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
32
|
+
`)?``:`
|
|
33
|
+
`)+r.raw,n.text+=`
|
|
34
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
35
|
+
`)?``:`
|
|
36
|
+
`)+r.raw,a.text+=`
|
|
37
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
38
|
+
`)?``:`
|
|
39
|
+
`)+r.raw,n.text+=`
|
|
40
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},B=class{options;parser;constructor(e){this.options=e||_}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(b.notSpaceStart)?.[0],i=e.replace(b.endingNewline,``)+`
|
|
41
|
+
`;return r?`<pre><code class="language-`+I(r)+`">`+(n?i:I(i,!0))+`</code></pre>
|
|
42
|
+
`:`<pre><code>`+(n?i:I(i,!0))+`</code></pre>
|
|
43
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
44
|
+
${this.parser.parse(e)}</blockquote>
|
|
45
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
46
|
+
`}hr(e){return`<hr>
|
|
47
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
48
|
+
`+r+`</`+i+`>
|
|
49
|
+
`}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+I(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
50
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
51
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
52
|
+
<thead>
|
|
53
|
+
`+t+`</thead>
|
|
54
|
+
`+r+`</table>
|
|
55
|
+
`}tablerow({text:e}){return`<tr>
|
|
56
|
+
${e}</tr>
|
|
57
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
58
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${I(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=dt(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+I(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=dt(e);if(i===null)return I(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${I(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:I(e.text)}},V=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},H=class e{options;renderer;textRenderer;constructor(e){this.options=e||_,this.options.renderer=this.options.renderer||new B,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new V}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`def`:n+=this.renderer.def(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
|
|
59
|
+
`+this.renderer.text(i);t?n+=this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):n+=o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},U=class{options;block;constructor(e){this.options=e||_}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?z.lex:z.lexInline}provideParser(){return this.block?H.parse:H.parseInline}},W=new class{defaults=g();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=H;Renderer=B;TextRenderer=V;Lexer=z;Tokenizer=R;Hooks=U;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new B(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new R(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new U;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];U.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&U.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return z.lex(e,t??this.defaults)}parser(e,t){return H.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?z.lex:z.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?H.parse:H.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?z.lex:z.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?H.parse:H.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
60
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+I(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function G(e,t){return W.parse(e,t)}G.options=G.setOptions=function(e){return W.setOptions(e),G.defaults=W.defaults,ye(G.defaults),G},G.getDefaults=g,G.defaults=_,G.use=function(...e){return W.use(...e),G.defaults=W.defaults,ye(G.defaults),G},G.walkTokens=function(e,t){return W.walkTokens(e,t)},G.parseInline=W.parseInline,G.Parser=H,G.parser=H.parse,G.Renderer=B,G.TextRenderer=V,G.Lexer=z,G.lexer=z.lex,G.Tokenizer=R,G.Hooks=U,G.parse=G,G.options,G.setOptions,G.use,G.walkTokens,G.parseInline,H.parse,z.lex;function gt(e){var t=[...arguments].slice(1),n=Array.from(typeof e==`string`?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,``);var r=n.reduce(function(e,t){var n=t.match(/\n([\t ]+|(?!\s).)/g);return n?e.concat(n.map(function(e){return e.match(/[\t ]/g)?.length??0})):e},[]);if(r.length){var i=RegExp(`
|
|
61
|
+
[ ]{${Math.min.apply(Math,r)}}`,`g`);n=n.map(function(e){return e.replace(i,`
|
|
62
|
+
`)})}n[0]=n[0].replace(/^\r?\n/,``);var a=n[0];return t.forEach(function(e,t){var r=a.match(/(?:^|\n)( *)$/),i=r?r[1]:``,o=e;typeof e==`string`&&e.includes(`
|
|
63
|
+
`)&&(o=String(e).split(`
|
|
64
|
+
`).map(function(e,t){return t===0?e:`${i}${e}`}).join(`
|
|
65
|
+
`)),a+=o+n[t+1]}),a}var _t={body:`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>`,height:80,width:80},K=new Map,vt=new Map,yt=t(t=>{for(let n of t){if(!n.name)throw Error(`Invalid icon loader. Must have a "name" property with non-empty string value.`);if(e.debug(`Registering icon pack:`,n.name),`loader`in n)vt.set(n.name,n.loader);else if(`icons`in n)K.set(n.name,n.icons);else throw e.error(`Invalid icon loader:`,n),Error(`Invalid icon loader. Must have either "icons" or "loader" property.`)}},`registerIconPacks`),bt=t(async(t,n)=>{let r=m(t,!0,n!==void 0);if(!r)throw Error(`Invalid icon name: ${t}`);let i=r.prefix||n;if(!i)throw Error(`Icon name must contain a prefix: ${t}`);let a=K.get(i);if(!a){let t=vt.get(i);if(!t)throw Error(`Icon set not found: ${r.prefix}`);try{a={...await t(),prefix:i},K.set(i,a)}catch(t){throw e.error(t),Error(`Failed to load icon set: ${r.prefix}`)}}let o=ae(a,r.name);if(!o)throw Error(`Icon not found: ${t}`);return o},`getRegisteredIconData`),xt=t(async e=>{try{return await bt(e),!0}catch{return!1}},`isIconAvailable`),St=t(async(t,n,i)=>{let a;try{a=await bt(t,n?.fallbackPrefix)}catch(t){e.error(t),a=_t}let o=pe(a,n);return r(ve(_e(o.body),{...o.attributes,...i}),s())},`getIconSVG`);function Ct(e,{markdownAutoWrap:t}){let n=gt(e.replace(/<br\/>/g,`
|
|
66
|
+
`).replace(/\n{2,}/g,`
|
|
67
|
+
`));return t===!1?n.replace(/ /g,` `):n}t(Ct,`preprocessMarkdown`);function wt(e,n={}){let r=Ct(e,n),i=G.lexer(r),a=[[]],o=0;function s(e,t=`normal`){e.type===`text`?e.text.split(`
|
|
68
|
+
`).forEach((e,n)=>{n!==0&&(o++,a.push([])),e.split(` `).forEach(e=>{e=e.replace(/'/g,`'`),e&&a[o].push({content:e,type:t})})}):e.type===`strong`||e.type===`em`?e.tokens.forEach(t=>{s(t,e.type)}):e.type===`html`&&a[o].push({content:e.text,type:`normal`})}return t(s,`processNode`),i.forEach(e=>{e.type===`paragraph`?e.tokens?.forEach(e=>{s(e)}):e.type===`html`?a[o].push({content:e.text,type:`normal`}):a[o].push({content:e.raw,type:`normal`})}),a}t(wt,`markdownToLines`);function Tt(n,{markdownAutoWrap:r}={}){let i=G.lexer(n);function a(t){return t.type===`text`?r===!1?t.text.replace(/\n */g,`<br/>`).replace(/ /g,` `):t.text.replace(/\n */g,`<br/>`):t.type===`strong`?`<strong>${t.tokens?.map(a).join(``)}</strong>`:t.type===`em`?`<em>${t.tokens?.map(a).join(``)}</em>`:t.type===`paragraph`?`<p>${t.tokens?.map(a).join(``)}</p>`:t.type===`space`?``:t.type===`html`?`${t.text}`:t.type===`escape`?t.text:(e.warn(`Unsupported markdown: ${t.type}`),t.raw)}return t(a,`output`),i.map(a).join(``)}t(Tt,`markdownToHTML`);function q(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(e=>e.segment):[...e]}t(q,`splitTextToChars`);function Et(e,t){return J(e,[],q(t.content),t.type)}t(Et,`splitWordToFitWidth`);function J(e,t,n,r){if(n.length===0)return[{content:t.join(``),type:r},{content:``,type:r}];let[i,...a]=n,o=[...t,i];return e([{content:o.join(``),type:r}])?J(e,o,a,r):(t.length===0&&i&&(t.push(i),n.shift()),[{content:t.join(``),type:r},{content:n.join(``),type:r}])}t(J,`splitWordToFitWidthRecursion`);function Dt(e,t){if(e.some(({content:e})=>e.includes(`
|
|
69
|
+
`)))throw Error(`splitLineToFitWidth does not support newlines in the line`);return Y(e,t)}t(Dt,`splitLineToFitWidth`);function Y(e,t,n=[],r=[]){if(e.length===0)return r.length>0&&n.push(r),n.length>0?n:[];let i=``;e[0].content===` `&&(i=` `,e.shift());let a=e.shift()??{content:` `,type:`normal`},o=[...r];if(i!==``&&o.push({content:i,type:`normal`}),o.push(a),t(o))return Y(e,t,n,o);if(r.length>0)n.push(r),e.unshift(a);else if(a.content){let[r,i]=Et(t,a);n.push([r]),i.content&&e.unshift(i)}return Y(e,t,n)}t(Y,`splitLineToFitWidthRecursion`);function X(e,t){t&&e.attr(`style`,t)}t(X,`applyStyle`);async function Ot(e,t,n,c,l=!1,u=s()){let d=e.append(`foreignObject`);d.attr(`width`,`${10*n}px`),d.attr(`height`,`${10*n}px`);let f=d.append(`xhtml:div`),p=a(t.label)?await i(t.label.replace(o.lineBreakRegex,`
|
|
70
|
+
`),u):r(t.label,u),ee=t.isNode?`nodeLabel`:`edgeLabel`,m=f.append(`span`);m.html(p),X(m,t.labelStyle),m.attr(`class`,`${ee} ${c}`),X(f,t.labelStyle),f.style(`display`,`table-cell`),f.style(`white-space`,`nowrap`),f.style(`line-height`,`1.5`),f.style(`max-width`,n+`px`),f.style(`text-align`,`center`),f.attr(`xmlns`,`http://www.w3.org/1999/xhtml`),l&&f.attr(`class`,`labelBkg`);let h=f.node().getBoundingClientRect();return h.width===n&&(f.style(`display`,`table`),f.style(`white-space`,`break-spaces`),f.style(`width`,n+`px`),h=f.node().getBoundingClientRect()),d.node()}t(Ot,`addHtmlSpan`);function Z(e,t,n){return e.append(`tspan`).attr(`class`,`text-outer-tspan`).attr(`x`,0).attr(`y`,t*n-.1+`em`).attr(`dy`,n+`em`)}t(Z,`createTspan`);function kt(e,t,n){let r=e.append(`text`),i=Z(r,1,t);Q(i,n);let a=i.node().getComputedTextLength();return r.remove(),a}t(kt,`computeWidthOfText`);function At(e,t,n){let r=e.append(`text`),i=Z(r,1,t);Q(i,[{content:n,type:`normal`}]);let a=i.node()?.getBoundingClientRect();return a&&r.remove(),a}t(At,`computeDimensionOfText`);function jt(e,n,r,i=!1){let a=1.1,o=n.append(`g`),s=o.insert(`rect`).attr(`class`,`background`).attr(`style`,`stroke: none`),c=o.append(`text`).attr(`y`,`-10.1`),l=0;for(let n of r){let r=t(t=>kt(o,a,t)<=e,`checkWidth`),i=r(n)?[n]:Dt(n,r);for(let e of i)Q(Z(c,l,a),e),l++}if(i){let e=c.node().getBBox();return s.attr(`x`,e.x-2).attr(`y`,e.y-2).attr(`width`,e.width+4).attr(`height`,e.height+4),o.node()}else return c.node()}t(jt,`createFormattedText`);function Q(e,t){e.text(``),t.forEach((t,n)=>{let r=e.append(`tspan`).attr(`font-style`,t.type===`em`?`italic`:`normal`).attr(`class`,`text-inner-tspan`).attr(`font-weight`,t.type===`strong`?`bold`:`normal`);n===0?r.text(t.content):r.text(` `+t.content)})}t(Q,`updateTextContentAndStyles`);async function $(e,t={}){let n=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(e,i,a)=>(n.push((async()=>{let n=`${i}:${a}`;return await xt(n)?await St(n,void 0,{class:`label-icon`}):`<i class='${r(e,t).replace(`:`,` `)}'></i>`})()),e));let i=await Promise.all(n);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??``)}t($,`replaceIconSubstring`);var Mt=t(async(t,r=``,{style:i=``,isTitle:o=!1,classes:s=``,useHtmlLabels:l=!0,isNode:u=!0,width:d=200,addSvgBackground:f=!1}={},p)=>{if(e.debug(`XYZ createText`,r,i,o,s,l,u,`addSvgBackground: `,f),l){let e=await $(c(Tt(r,p)),p),n=r.replace(/\\\\/g,`\\`);return await Ot(t,{isNode:u,label:a(r)?n:e,labelStyle:i.replace(`fill:`,`color:`)},d,s,f,p)}else{let e=jt(d,t,wt(r.replace(/<br\s*\/?>/g,`<br/>`).replace(`<br>`,`<br/>`),p),r?f:!1);if(u){/stroke:/.exec(i)&&(i=i.replace(`stroke:`,`lineColor:`));let t=i.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/color:/g,`fill:`);n(e).attr(`style`,t)}else{let t=i.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/background:/g,`fill:`);n(e).select(`rect`).attr(`style`,t.replace(/background:/g,`fill:`));let r=i.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/color:/g,`fill:`);n(e).select(`text`).attr(`style`,r)}return e}},`createText`);export{$ as a,yt as i,Mt as n,_t as o,St as r,gt as s,At as t};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import{g as e,h as t,p as n}from"./src-Buml7cM5.js";import{A as r,I as i,L as a,N as o,O as s,b as c,d as l,h as u,s as d,y as f}from"./chunk-ABZYJK2D-Dt4W53JI.js";import{f as p,i as m,l as h,n as g}from"./chunk-S3R3BYOJ-BWvOhDs0.js";import{t as _}from"./chunk-CVBHYZKI-CViawAKX.js";import{a as v,i as y,r as b,t as x}from"./chunk-ATLVNIR6-fZHLXURb.js";import{n as S,r as C}from"./chunk-JA3XYJ7Z-C5ZJdU01.js";function w(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function T(e,t){return e[0]===t[0]&&e[1]===t[1]}function E(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)w(e,s,i);let c=function(e,t,n){let r=[];for(let t of e){let e=[...t];T(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach((e=>{o.push({s,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=s))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),(n!==1||c%t==0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach((e=>{e.edge.x=e.edge.x+n*e.edge.islope})),c++}return i}(o,a,r);if(i){for(let e of o)w(e,s,-i);(function(e,t,n){let r=[];e.forEach((e=>r.push(...e))),w(r,t,n)})(c,s,-i)}return c}function D(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),E(e,r,n,i||1)}var O=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=D(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function k(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var A=class extends O{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let r=D(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(let[e,t]of r)k([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},j=class extends O{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},M=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=D(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=k(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+2*Math.random()*a,c=o-a+2*Math.random()*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},N=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=D(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{let a=k(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}})),i}},P=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=D(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach((e=>{let i=k(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=2*e*t,a=2*(e+1)*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}},F={},I=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},ee=0,te=1,ne=2,re={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function ie(e,t){return e.type===t}function ae(e){let t=[],n=function(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:ee,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:te,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:ne,text:``},t}(e),r=`BOD`,i=0,a=n[i];for(;!ie(a,ne);){let o=0,s=[];if(r===`BOD`){if(a.text!==`M`&&a.text!==`m`)return ae(`M0,0`+e);i++,o=re[a.text],r=a.text}else ie(a,te)?o=re[r]:(i++,o=re[a.text],r=a.text);if(!(i+o<n.length))throw Error(`Path data ended short`);for(let e=i;e<i+o;e++){let t=n[e];if(!ie(t,te))throw Error(`Param not a number: `+r+`,`+t.text);s[s.length]=+t.text}if(typeof re[r]!=`number`)throw Error(`Bad segment: `+r);{let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}}return t}function L(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function oe(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(ce(r,i,c,l,e,n,a,o,s).forEach((function(e){t.push({key:`C`,data:e})})),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function se(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function ce(e,t,n,r,i,a,o,s,c,l){let u=(d=o,Math.PI*d/180);var d;let f=[],p=0,m=0,h=0,g=0;if(l)[p,m,h,g]=l;else{[e,t]=se(e,t,-u),[n,r]=se(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i*=d,a*=d);let f=i*i,_=a*a,v=f*_-f*l*l-_*o*o,y=f*l*l+_*o*o,b=(s===c?-1:1)*Math.sqrt(Math.abs(v/y));h=b*i*l/a+(e+n)/2,g=b*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-g)/a).toFixed(9))),m=Math.asin(parseFloat(((r-g)/a).toFixed(9))),e<h&&(p=Math.PI-p),n<h&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),c&&p>m&&(p-=2*Math.PI),!c&&m>p&&(m-=2*Math.PI)}let _=m-p;if(Math.abs(_)>120*Math.PI/180){let e=m,t=n,s=r;m=c&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=ce(n=h+i*Math.cos(m),r=g+a*Math.sin(m),t,s,i,a,o,0,c,[m,e,h,g])}_=m-p;let v=Math.cos(p),y=Math.sin(p),b=Math.cos(m),x=Math.sin(m),S=Math.tan(_/4),C=4/3*i*S,w=4/3*a*S,T=[e,t],E=[e+C*y,t-w*v],D=[n+C*x,r-w*b],O=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],l)return[E,D,O].concat(f);{f=[E,D,O].concat(f);let e=[];for(let t=0;t<f.length;t+=3){let n=se(f[t][0],f[t][1],u),r=se(f[t+1][0],f[t+1][1],u),i=se(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var le={randOffset:function(e,t){return R(e,t)},randOffsetWithRange:function(e,t,n){return Se(e,t,n)},ellipse:function(e,t,n,r,i){return he(e,t,i,me(n,r,i)).opset},doubleLineOps:function(e,t,n,r,i){return z(e,t,n,r,i,!0)}};function ue(e,t,n,r,i){return{type:`path`,ops:z(e,t,n,r,i)}}function de(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...z(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...z(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?ue(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function fe(e,t,n,r,i){return function(e,t){return de(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function pe(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=we(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:we(n[0],1.5*(1+.22*t.roughness),be(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=we(a,1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:we(a,1.5*(1+.22*t.roughness),be(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function me(e,t,n){let r=Math.sqrt(2*Math.PI*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=R(o*c,n),s+=R(s*c,n),{increment:a,rx:o,ry:s}}function he(e,t,n,r){let[i,a]=Ee(r.increment,e,t,r.rx,r.ry,1,r.increment*Se(.1,Se(.4,1,n),n),n),o=Te(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=Ee(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=Te(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function ge(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=R(.01*d,c),f+=R(.01*f,c);let p=i,m=a;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);let h=2*Math.PI/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=De(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=De(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...z(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...z(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function _e(e,t){let n=oe(L(ae(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...z(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...Oe(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...z(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function ve(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+R(e,t),r[0][1]+R(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+R(e,t),r[a][1]+R(e,t)]})}}return{type:`fillPath`,ops:n}}function ye(e,t){return function(e,t){let n=e.fillStyle||`hachure`;if(!F[n])switch(n){case`zigzag`:F[n]||(F[n]=new A(t));break;case`cross-hatch`:F[n]||(F[n]=new j(t));break;case`dots`:F[n]||(F[n]=new M(t));break;case`dashed`:F[n]||(F[n]=new N(t));break;case`zigzag-line`:F[n]||(F[n]=new P(t));break;default:n=`hachure`,F[n]||(F[n]=new O(t))}return F[n]}(t,le).fillPolygons(e,t)}function be(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function xe(e){return e.randomizer||=new I(e.seed||0),e.randomizer.next()}function Se(e,t,n,r=1){return n.roughness*r*(xe(n)*(t-e)+e)}function R(e,t,n=1){return Se(-e,e,t,n)}function z(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=Ce(e,t,n,r,i,!0,!1);if(o)return s;let c=Ce(e,t,n,r,i,!0,!0);return s.concat(c)}function Ce(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+.2*xe(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=R(p,i,l),m=R(m,i,l);let h=[],g=()=>R(d,i,l),_=()=>R(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:R(u,i,l)),t+(v?0:R(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function we(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+R(t,n),e[0][1]+R(t,n)]),r.push([e[0][0]+R(t,n),e[0][1]+R(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+R(t,n),e[i][1]+R(t,n)]),i===e.length-1&&r.push([e[i][0]+R(t,n),e[i][1]+R(t,n)]);return Te(r,null,n)}function Te(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+R(e,n),t[1]+R(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...Ce(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function Ee(e,t,n,r,i,a,o,s){let c=[],l=[];if(s.roughness===0){e/=4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=2*Math.PI;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];c.push(e),l.push(e)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let u=R(.5,s)-Math.PI/2;l.push([R(a,s)+t+.9*r*Math.cos(u-e),R(a,s)+n+.9*i*Math.sin(u-e)]);let d=2*Math.PI+u-.01;for(let o=u;o<d;o+=e){let e=[R(a,s)+t+r*Math.cos(o),R(a,s)+n+i*Math.sin(o)];c.push(e),l.push(e)}l.push([R(a,s)+t+r*Math.cos(u+2*Math.PI+.5*o),R(a,s)+n+i*Math.sin(u+2*Math.PI+.5*o)]),l.push([R(a,s)+t+.98*r*Math.cos(u+o),R(a,s)+n+.98*i*Math.sin(u+o)]),l.push([R(a,s)+t+.9*r*Math.cos(u+.5*o),R(a,s)+n+.9*i*Math.sin(u+.5*o)])}return[l,c]}function De(e,t,n,r,i,a,o,s,c){let l=a+R(.1,c),u=[];u.push([R(s,c)+t+.9*r*Math.cos(l-e),R(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([R(s,c)+t+r*Math.cos(a),R(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),Te(u,null,c)}function Oe(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:R(l[0],s)),o[1]+(f?0:R(l[0],s))]}),u=f?[i,a]:[i+R(l[p],s),a+R(l[p],s)],c.push({op:`bcurveTo`,data:[e+R(l[p],s),t+R(l[p],s),n+R(l[p],s),r+R(l[p],s),u[0],u[1]]});return c}function ke(e){return[...e]}function Ae(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(ke(e[0]),ke(e[1]),ke(e[2]),ke(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(ke(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function je(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function Me(e,t,n){let r=je(t,n);if(r===0)return je(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),je(e,Ne(t,n,i))}function Ne(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Pe(e,t,n,r){let i=r||[];if(function(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}(e,t)<n){let n=e[t+0];i.length?(a=i[i.length-1],o=n,Math.sqrt(je(a,o)))>1&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=Ne(a,o,r),u=Ne(o,s,r),d=Ne(s,c,r),f=Ne(l,u,r),p=Ne(u,d,r),m=Ne(f,p,r);Pe([a,l,f,m],0,n,i),Pe([m,p,d,c],0,n,i)}var a,o;return i}function Fe(e,t){return Ie(e,0,e.length,t)}function Ie(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=Me(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Ie(e,t,l+1,r,a),Ie(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function Le(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)Pe(e,3*n,t,r);return n&&n>0?Ie(r,0,r.length,n):r}var B=`none`,Re=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[ue(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=fe(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(ve([i],a)):o.push(ye([i],a))}return a.stroke!==B&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=me(n,r,a),c=he(e,t,a,s);if(a.fill)if(a.fillStyle===`solid`){let n=he(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(ye([c.estimatedPoints],a));return a.stroke!==B&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[de(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=ge(e,t,n,r,i,a,o,!0,c);if(o&&c.fill)if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=ge(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(function(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=R(.01*l,o),u+=R(.01*u,o);let d=i,f=a;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),ye([m],o)}(e,t,n,r,i,a,c));return c.stroke!==B&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=pe(e,n);if(n.fill&&n.fill!==B)if(n.fillStyle===`solid`){let t=pe(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...Le(Ae([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...Le(Ae(r),10,(1+n.roughness)/2))}t.length&&r.push(ye([t],n))}return n.stroke!==B&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=de(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(ve([e],n)):r.push(ye([e],n))),n.stroke!==B&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==B,a=n.stroke!==B,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){let r=oe(L(ae(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...Le(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=Fe(e,n);t.length&&u.push(t)}return u}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=_e(e,n);if(i)if(n.fillStyle===`solid`)if(s.length===1){let t=_e(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(ve(s,n));else r.push(ye(s,n));return a&&(o?s.forEach((e=>{r.push(de(e,!1,n))})):r.push(c)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:B};break;case`fillPath`:t={d:this.opsToPath(e),stroke:B,strokeWidth:0,fill:n.fill||B};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||B,strokeWidth:n,fill:B}}_mergedShape(e){return e.filter(((e,t)=>t===0||e.op!==`move`))}},ze=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new Re(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c),c}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},Be=`http://www.w3.org/2000/svg`,Ve=class{constructor(e,t){this.svg=e,this.gen=new Re(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(Be,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(Be,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(Be,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),e.shape!==`curve`&&e.shape!==`polygon`||t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(Be,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},V={canvas:(e,t)=>new ze(e,t),svg:(e,t)=>new Ve(e,t),generator:e=>new Re(e),newSeed:()=>Re.newSeed()},H=t(async(e,r,a)=>{let o,s=r.useHtmlLabels||u(c()?.htmlLabels);o=a||`node default`;let d=e.insert(`g`).attr(`class`,o).attr(`id`,r.domId||r.id),f=d.insert(`g`).attr(`class`,`label`).attr(`style`,h(r.labelStyle)),g;g=r.label===void 0?``:typeof r.label==`string`?r.label:r.label[0];let _=await S(f,i(m(g),c()),{useHtmlLabels:s,width:r.width||c().flowchart?.wrappingWidth,cssClasses:`markdown-node-label`,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),v=_.getBBox(),y=(r?.padding??0)/2;if(s){let e=_.children[0],r=n(_),i=e.getElementsByTagName(`img`);if(i){let e=g.replace(/<img[^>]*>/g,``).trim()===``;await Promise.all([...i].map(n=>new Promise(r=>{function i(){if(n.style.display=`flex`,n.style.flexDirection=`column`,e){let[e=l.fontSize]=p(c().fontSize?c().fontSize:window.getComputedStyle(document.body).fontSize),t=e*5+`px`;n.style.minWidth=t,n.style.maxWidth=t}else n.style.width=`100%`;r(n)}t(i,`setupImage`),setTimeout(()=>{n.complete&&i()}),n.addEventListener(`error`,i),n.addEventListener(`load`,i)})))}v=e.getBoundingClientRect(),r.attr(`width`,v.width),r.attr(`height`,v.height)}return s?f.attr(`transform`,`translate(`+-v.width/2+`, `+-v.height/2+`)`):f.attr(`transform`,`translate(0, `+-v.height/2+`)`),r.centerLabel&&f.attr(`transform`,`translate(`+-v.width/2+`, `+-v.height/2+`)`),f.insert(`rect`,`:first-child`),{shapeSvg:d,bbox:v,halfPadding:y,label:f}},`labelHelper`),He=t(async(e,t,r)=>{let a=r.useHtmlLabels||u(c()?.flowchart?.htmlLabels),o=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await S(o,i(m(t),c()),{useHtmlLabels:a,width:r.width||c()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),l=s.getBBox(),d=r.padding/2;if(u(c()?.flowchart?.htmlLabels)){let e=s.children[0],t=n(s);l=e.getBoundingClientRect(),t.attr(`width`,l.width),t.attr(`height`,l.height)}return a?o.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`):o.attr(`transform`,`translate(0, `+-l.height/2+`)`),r.centerLabel&&o.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`),o.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:l,halfPadding:d,label:o}},`insertLabel`),U=t((e,t)=>{let n=t.node().getBBox();e.width=n.width,e.height=n.height},`updateNodeBounds`),W=t((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function G(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}t(G,`createPathFromPoints`);function K(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}t(K,`generateFullSineWavePoints`);function Ue(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(Ue,`generateCirclePoints`);var We=t((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`);function Ge(e,t){t&&e.attr(`style`,t)}t(Ge,`applyStyle`);async function Ke(e){let t=n(document.createElementNS(`http://www.w3.org/2000/svg`,`foreignObject`)),r=t.append(`xhtml:div`),a=c(),l=e.label;e.label&&s(e.label)&&(l=await o(e.label.replace(d.lineBreakRegex,`
|
|
2
|
+
`),a));let u=`<span class="`+(e.isNode?`nodeLabel`:`edgeLabel`)+`" `+(e.labelStyle?`style="`+e.labelStyle+`"`:``)+`>`+l+`</span>`;return r.html(i(u,a)),Ge(r,e.labelStyle),r.style(`display`,`inline-block`),r.style(`padding-right`,`1px`),r.style(`white-space`,`nowrap`),r.attr(`xmlns`,`http://www.w3.org/1999/xhtml`),t.node()}t(Ke,`addHtmlLabel`);var qe=t(async(t,n,r,i)=>{let a=t||``;if(typeof a==`object`&&(a=a[0]),u(c().flowchart.htmlLabels))return a=a.replace(/\\n|\n/g,`<br />`),e.info(`vertexText`+a),await Ke({isNode:i,label:m(a).replace(/fa[blrs]?:fa-[\w-]+/g,e=>`<i class='${e.replace(`:`,` `)}'></i>`),labelStyle:n&&n.replace(`fill:`,`color:`)});{let e=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);e.setAttribute(`style`,n.replace(`color:`,`fill:`));let t=[];t=typeof a==`string`?a.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(a)?a:[];for(let n of t){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);t.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`),t.setAttribute(`dy`,`1em`),t.setAttribute(`x`,`0`),r?t.setAttribute(`class`,`title-row`):t.setAttribute(`class`,`row`),t.textContent=n.trim(),e.appendChild(t)}return e}},`createLabel`),q=t((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),Je=t(async(t,r)=>{e.info(`Creating subgraph rect for `,r.id,r);let i=c(),{themeVariables:a,handDrawnSeed:o}=i,{clusterBkg:s,clusterBorder:l}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:m}=y(r),h=t.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.id).attr(`data-look`,r.look),g=u(i.flowchart.htmlLabels),b=h.insert(`g`).attr(`class`,`cluster-label `),x=await S(b,r.label,{style:r.labelStyle,useHtmlLabels:g,isNode:!0}),C=x.getBBox();if(u(i.flowchart.htmlLabels)){let e=x.children[0],t=n(x);C=e.getBoundingClientRect(),t.attr(`width`,C.width),t.attr(`height`,C.height)}let w=r.width<=C.width+r.padding?C.width+r.padding:r.width;r.width<=C.width+r.padding?r.diff=(w-r.width)/2-r.padding:r.diff=-r.padding;let T=r.height,E=r.x-w/2,D=r.y-T/2;e.trace(`Data `,r,JSON.stringify(r));let O;if(r.look===`handDrawn`){let t=V.svg(h),n=v(r,{roughness:.7,fill:s,stroke:l,fillWeight:3,seed:o}),i=t.path(q(E,D,w,T,0),n);O=h.insert(()=>(e.debug(`Rough node insert CXC`,i),i),`:first-child`),O.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),O.select(`path`).attr(`style`,m.join(`;`).replace(`fill`,`stroke`))}else O=h.insert(`rect`,`:first-child`),O.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,E).attr(`y`,D).attr(`width`,w).attr(`height`,T);let{subGraphTitleTopMargin:k}=_(i);if(b.attr(`transform`,`translate(${r.x-C.width/2}, ${r.y-r.height/2+k})`),d){let e=b.select(`span`);e&&e.attr(`style`,d)}let A=O.node().getBBox();return r.offsetX=0,r.width=A.width,r.height=A.height,r.offsetY=C.height-r.padding/2,r.intersect=function(e){return We(r,e)},{cluster:h,labelBBox:C}},`rect`),Ye={rect:Je,squareRect:Je,roundedWithTitle:t(async(e,t)=>{let r=c(),{themeVariables:i,handDrawnSeed:a}=r,{altBackground:o,compositeBackground:s,compositeTitleBackground:l,nodeBorder:d}=i,f=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.id).attr(`data-id`,t.id).attr(`data-look`,t.look),p=f.insert(`g`,`:first-child`),m=f.insert(`g`).attr(`class`,`cluster-label`),h=f.append(`rect`),g=m.node().appendChild(await qe(t.label,t.labelStyle,void 0,!0)),_=g.getBBox();if(u(r.flowchart.htmlLabels)){let e=g.children[0],t=n(g);_=e.getBoundingClientRect(),t.attr(`width`,_.width),t.attr(`height`,_.height)}let v=0*t.padding,y=v/2,b=(t.width<=_.width+t.padding?_.width+t.padding:t.width)+v;t.width<=_.width+t.padding?t.diff=(b-t.width)/2-t.padding:t.diff=-t.padding;let x=t.height+v,S=t.height+v-_.height-6,C=t.x-b/2,w=t.y-x/2;t.width=b;let T=t.y-t.height/2-y+_.height+2,E;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=V.svg(f),r=t.rx||t.ry?n.path(q(C,w,b,x,10),{roughness:.7,fill:l,fillStyle:`solid`,stroke:d,seed:a}):n.rectangle(C,w,b,x,{seed:a});E=f.insert(()=>r,`:first-child`);let i=n.rectangle(C,T,b,S,{fill:e?o:s,fillStyle:e?`hachure`:`solid`,stroke:d,seed:a});E=f.insert(()=>r,`:first-child`),h=f.insert(()=>i)}else E=p.insert(`rect`,`:first-child`),E.attr(`class`,`outer`).attr(`x`,C).attr(`y`,w).attr(`width`,b).attr(`height`,x).attr(`data-look`,t.look),h.attr(`class`,`inner`).attr(`x`,C).attr(`y`,T).attr(`width`,b).attr(`height`,S);return m.attr(`transform`,`translate(${t.x-_.width/2}, ${w+1-(u(r.flowchart.htmlLabels)?0:3)})`),t.height=E.node().getBBox().height,t.offsetX=0,t.offsetY=_.height-t.padding/2,t.labelBBox=_,t.intersect=function(e){return We(t,e)},{cluster:f,labelBBox:_}},`roundedWithTitle`),noteGroup:t((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.id),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return We(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),divider:t((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=c(),{nodeBorder:i}=n,a=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.id).attr(`data-look`,t.look),o=a.insert(`g`,`:first-child`),s=0*t.padding,l=t.width+s;t.diff=-t.padding;let u=t.height+s,d=t.x-l/2,f=t.y-u/2;t.width=l;let p;if(t.look===`handDrawn`){let e=V.svg(a).rectangle(d,f,l,u,{fill:`lightgrey`,roughness:.5,strokeLineDash:[5],stroke:i,seed:r});p=a.insert(()=>e,`:first-child`)}else p=o.insert(`rect`,`:first-child`),p.attr(`class`,`divider`).attr(`x`,d).attr(`y`,f).attr(`width`,l).attr(`height`,u).attr(`data-look`,t.look);return t.height=p.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return We(t,e)},{cluster:a,labelBBox:{}}},`divider`),kanbanSection:t(async(t,r)=>{e.info(`Creating subgraph rect for `,r.id,r);let i=c(),{themeVariables:a,handDrawnSeed:o}=i,{clusterBkg:s,clusterBorder:l}=a,{labelStyles:d,nodeStyles:f,borderStyles:p,backgroundStyles:m}=y(r),h=t.insert(`g`).attr(`class`,`cluster `+r.cssClasses).attr(`id`,r.id).attr(`data-look`,r.look),g=u(i.flowchart.htmlLabels),b=h.insert(`g`).attr(`class`,`cluster-label `),x=await S(b,r.label,{style:r.labelStyle,useHtmlLabels:g,isNode:!0,width:r.width}),C=x.getBBox();if(u(i.flowchart.htmlLabels)){let e=x.children[0],t=n(x);C=e.getBoundingClientRect(),t.attr(`width`,C.width),t.attr(`height`,C.height)}let w=r.width<=C.width+r.padding?C.width+r.padding:r.width;r.width<=C.width+r.padding?r.diff=(w-r.width)/2-r.padding:r.diff=-r.padding;let T=r.height,E=r.x-w/2,D=r.y-T/2;e.trace(`Data `,r,JSON.stringify(r));let O;if(r.look===`handDrawn`){let t=V.svg(h),n=v(r,{roughness:.7,fill:s,stroke:l,fillWeight:4,seed:o}),i=t.path(q(E,D,w,T,r.rx),n);O=h.insert(()=>(e.debug(`Rough node insert CXC`,i),i),`:first-child`),O.select(`path:nth-child(2)`).attr(`style`,p.join(`;`)),O.select(`path`).attr(`style`,m.join(`;`).replace(`fill`,`stroke`))}else O=h.insert(`rect`,`:first-child`),O.attr(`style`,f).attr(`rx`,r.rx).attr(`ry`,r.ry).attr(`x`,E).attr(`y`,D).attr(`width`,w).attr(`height`,T);let{subGraphTitleTopMargin:k}=_(i);if(b.attr(`transform`,`translate(${r.x-C.width/2}, ${r.y-r.height/2+k})`),d){let e=b.select(`span`);e&&e.attr(`style`,d)}let A=O.node().getBBox();return r.offsetX=0,r.width=A.width,r.height=A.height,r.offsetY=C.height-r.padding/2,r.intersect=function(e){return We(r,e)},{cluster:h,labelBBox:C}},`kanbanSection`)},Xe=new Map,Ze=t(async(e,t)=>{let n=await Ye[t.shape||`rect`](e,t);return Xe.set(t.id,n),n},`insertCluster`),Qe=t(()=>{Xe=new Map},`clear`);function $e(e,t){return e.intersect(t)}t($e,`intersectNode`);var et=$e;function tt(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}t(tt,`intersectEllipse`);var nt=tt;function rt(e,t,n){return nt(e,t,t,n)}t(rt,`intersectCircle`);var it=rt;function at(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&&ot(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&ot(p,m))return;let h=i*d-u*a;if(h===0)return;let g=Math.abs(h/2),_=a*f-d*o,v=_<0?(_-g)/h:(_+g)/h;return _=u*o-i*f,{x:v,y:_<0?(_-g)/h:(_+g)/h}}}t(at,`intersectLine`);function ot(e,t){return e*t>0}t(ot,`sameSign`);var st=at;function ct(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=st(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}t(ct,`intersectPolygon`);var J={node:et,circle:it,ellipse:nt,polygon:ct,rect:We};function lt(t,n){let{labelStyles:r}=y(n);n.labelStyle=r;let i=W(n),a=i;i||(a=`anchor`);let o=t.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=V.svg(o),l=v(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,h(s)),U(n,d),n.intersect=function(t){return e.info(`Circle intersect`,n,1,t),J.circle(n,1,t)},o}t(lt,`anchor`);function ut(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}t(ut,`generateArcPoints`);async function dt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=a.width+t.padding+20,s=a.height+t.padding,c=s/2,l=c/(2.5+s/50),{cssStyles:u}=t,d=[{x:o/2,y:-s/2},{x:-o/2,y:-s/2},...ut(-o/2,-s/2,-o/2,s/2,l,c,!1),{x:o/2,y:s/2},...ut(o/2,s/2,o/2,-s/2,l,c,!0)],f=V.svg(i),p=v(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=G(d),h=f.path(m,p),g=i.insert(()=>h,`:first-child`);return g.attr(`class`,`basic label-container`),u&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,u),r&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,r),g.attr(`transform`,`translate(${l/2}, 0)`),U(t,g),t.intersect=function(e){return J.polygon(t,d,e)},i}t(dt,`bowTieRect`);function Y(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}t(Y,`insertPolygonShape`);async function ft(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=a.height+t.padding,s=a.width+t.padding+12,c=s,l=-o,u=[{x:12,y:l},{x:c,y:l},{x:c,y:0},{x:0,y:0},{x:0,y:l+12},{x:12,y:l}],d,{cssStyles:f}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=v(t,{}),r=G(u),a=e.path(r,n);d=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-s/2}, ${o/2})`),f&&d.attr(`style`,f)}else d=Y(i,s,o,u);return r&&d.attr(`style`,r),U(t,d),t.intersect=function(e){return J.polygon(t,u,e)},i}t(ft,`card`);function pt(e,t){let{nodeStyles:n}=y(t);t.label=``;let r=e.insert(`g`).attr(`class`,W(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=V.svg(r),c=v(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=G(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return J.polygon(t,o,e)},r}t(pt,`choice`);async function mt(t,n,r){let{labelStyles:i,nodeStyles:a}=y(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await H(t,n,W(n)),l=r?.padding??c,u=s.width/2+l,d,{cssStyles:f}=n;if(n.look===`handDrawn`){let e=V.svg(o),t=v(n,{}),r=e.circle(0,0,u*2,t);d=o.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,h(f))}else d=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,u).attr(`cx`,0).attr(`cy`,0);return U(n,d),n.calcIntersect=function(e,t){let n=e.width/2;return J.circle(e,n,t)},n.intersect=function(t){return e.info(`Circle intersect`,n,u,t),J.circle(n,u,t)},o}t(mt,`circle`);function ht(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
|
|
3
|
+
M ${i.x},${i.y} L ${o.x},${o.y}`}t(ht,`createLine`);function gt(t,n){let{labelStyles:r,nodeStyles:i}=y(n);n.labelStyle=r,n.label=``;let a=t.insert(`g`).attr(`class`,W(n)).attr(`id`,n.domId??n.id),o=Math.max(30,n?.width??0),{cssStyles:s}=n,c=V.svg(a),l=v(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=ht(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),s&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),U(n,p),n.intersect=function(t){return e.info(`crossedCircle intersect`,n,{radius:o,point:t}),J.circle(n,o,t)},a}t(gt,`crossedCircle`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(X,`generateCirclePoints`);async function _t(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=a.width+(t.padding??0),c=a.height+(t.padding??0),l=Math.max(5,c*.1),{cssStyles:u}=t,d=[...X(s/2,-c/2,l,30,-90,0),{x:-s/2-l,y:l},...X(s/2+l*2,-l,l,20,-180,-270),...X(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:-c/2},...X(s/2,c/2,l,20,0,90)],f=[{x:s/2,y:-c/2-l},{x:-s/2,y:-c/2-l},...X(s/2,-c/2,l,20,-90,0),{x:-s/2-l,y:-l},...X(s/2+s*.1,-l,l,20,-180,-270),...X(s/2+s*.1,l,l,20,-90,-180),{x:-s/2-l,y:c/2},...X(s/2,c/2,l,20,0,90),{x:-s/2,y:c/2+l},{x:s/2,y:c/2+l}],p=V.svg(i),m=v(t,{fill:`none`});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=G(d).replace(`Z`,``),g=p.path(h,m),_=G(f),b=p.path(_,{...m}),x=i.insert(`g`,`:first-child`);return x.insert(()=>b,`:first-child`).attr(`stroke-opacity`,0),x.insert(()=>g,`:first-child`),x.attr(`class`,`text`),u&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,u),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(${l}, 0)`),o.attr(`transform`,`translate(${-s/2+l-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),U(t,x),t.intersect=function(e){return J.polygon(t,f,e)},i}t(_t,`curlyBraceLeft`);function Z(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:a,y:l})}return o}t(Z,`generateCirclePoints`);async function vt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=a.width+(t.padding??0),c=a.height+(t.padding??0),l=Math.max(5,c*.1),{cssStyles:u}=t,d=[...Z(s/2,-c/2,l,20,-90,0),{x:s/2+l,y:-l},...Z(s/2+l*2,-l,l,20,-180,-270),...Z(s/2+l*2,l,l,20,-90,-180),{x:s/2+l,y:c/2},...Z(s/2,c/2,l,20,0,90)],f=[{x:-s/2,y:-c/2-l},{x:s/2,y:-c/2-l},...Z(s/2,-c/2,l,20,-90,0),{x:s/2+l,y:-l},...Z(s/2+l*2,-l,l,20,-180,-270),...Z(s/2+l*2,l,l,20,-90,-180),{x:s/2+l,y:c/2},...Z(s/2,c/2,l,20,0,90),{x:s/2,y:c/2+l},{x:-s/2,y:c/2+l}],p=V.svg(i),m=v(t,{fill:`none`});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=G(d).replace(`Z`,``),g=p.path(h,m),_=G(f),b=p.path(_,{...m}),x=i.insert(`g`,`:first-child`);return x.insert(()=>b,`:first-child`).attr(`stroke-opacity`,0),x.insert(()=>g,`:first-child`),x.attr(`class`,`text`),u&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,u),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(${-l}, 0)`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),U(t,x),t.intersect=function(e){return J.polygon(t,f,e)},i}t(vt,`curlyBraceRight`);function Q(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}t(Q,`generateCirclePoints`);async function yt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=a.width+(t.padding??0),c=a.height+(t.padding??0),l=Math.max(5,c*.1),{cssStyles:u}=t,d=[...Q(s/2,-c/2,l,30,-90,0),{x:-s/2-l,y:l},...Q(s/2+l*2,-l,l,20,-180,-270),...Q(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:-c/2},...Q(s/2,c/2,l,20,0,90)],f=[...Q(-s/2+l+l/2,-c/2,l,20,-90,-180),{x:s/2-l/2,y:l},...Q(-s/2-l/2,-l,l,20,0,90),...Q(-s/2-l/2,l,l,20,-90,0),{x:s/2-l/2,y:-l},...Q(-s/2+l+l/2,c/2,l,30,-180,-270)],p=[{x:s/2,y:-c/2-l},{x:-s/2,y:-c/2-l},...Q(s/2,-c/2,l,20,-90,0),{x:-s/2-l,y:-l},...Q(s/2+l*2,-l,l,20,-180,-270),...Q(s/2+l*2,l,l,20,-90,-180),{x:-s/2-l,y:c/2},...Q(s/2,c/2,l,20,0,90),{x:-s/2,y:c/2+l},{x:s/2-l-l/2,y:c/2+l},...Q(-s/2+l+l/2,-c/2,l,20,-90,-180),{x:s/2-l/2,y:l},...Q(-s/2-l/2,-l,l,20,0,90),...Q(-s/2-l/2,l,l,20,-90,0),{x:s/2-l/2,y:-l},...Q(-s/2+l+l/2,c/2,l,30,-180,-270)],m=V.svg(i),h=v(t,{fill:`none`});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=G(d).replace(`Z`,``),_=m.path(g,h),b=G(f).replace(`Z`,``),x=m.path(b,h),S=G(p),C=m.path(S,{...h}),w=i.insert(`g`,`:first-child`);return w.insert(()=>C,`:first-child`).attr(`stroke-opacity`,0),w.insert(()=>_,`:first-child`),w.insert(()=>x,`:first-child`),w.attr(`class`,`text`),u&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,u),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${l-l/4}, 0)`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)/2-(a.y-(a.top??0))})`),U(t,w),t.intersect=function(e){return J.polygon(t,p,e)},i}t(yt,`curlyBraces`);async function bt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(80,(a.width+(t.padding??0)*2)*1.25,t?.width??0),s=Math.max(20,a.height+(t.padding??0)*2,t?.height??0),c=s/2,{cssStyles:l}=t,u=V.svg(i),d=v(t,{});t.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=o,p=s,m=f-c,h=p/4,g=[{x:m,y:0},{x:h,y:0},{x:0,y:p/2},{x:h,y:p},{x:m,y:p},...Ue(-m,-p/2,c,50,270,90)],_=G(g),b=u.path(_,d),x=i.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container`),l&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,l),r&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,r),x.attr(`transform`,`translate(${-o/2}, ${-s/2})`),U(t,x),t.intersect=function(e){return J.polygon(t,g,e)},i}t(bt,`curvedTrapezoid`);var xt=t((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),St=t((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),Ct=t((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`);async function wt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+t.padding,t.width??0),c=s/2,l=c/(2.5+s/50),u=Math.max(a.height+l+t.padding,t.height??0),d,{cssStyles:f}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=St(0,0,s,u,c,l),r=Ct(0,l,s,u,c,l),a=e.path(n,v(t,{})),o=e.path(r,v(t,{fill:`none`}));d=i.insert(()=>o,`:first-child`),d=i.insert(()=>a,`:first-child`),d.attr(`class`,`basic label-container`),f&&d.attr(`style`,f)}else{let e=xt(0,0,s,u,c,l);d=i.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,h(f)).attr(`style`,r)}return d.attr(`label-offset-y`,l),d.attr(`transform`,`translate(${-s/2}, ${-(u/2+l)})`),U(t,d),o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+(t.padding??0)/1.5-(a.y-(a.top??0))})`),t.intersect=function(e){let n=J.rect(t,e),r=n.x-(t.x??0);if(c!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-l)){let i=l*l*(1-r*r/(c*c));i>0&&(i=Math.sqrt(i)),i=l-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},i}t(wt,`cylinder`);async function Tt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=a.width+t.padding,c=a.height+t.padding,l=c*.2,u=-s/2,d=-c/2-l/2,{cssStyles:f}=t,p=V.svg(i),m=v(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:u,y:d+l},{x:-u,y:d+l},{x:-u,y:-d},{x:u,y:-d},{x:u,y:d},{x:-u,y:d},{x:-u,y:d+l}],g=p.polygon(h.map(e=>[e.x,e.y]),m),_=i.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container`),f&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,r),o.attr(`transform`,`translate(${u+(t.padding??0)/2-(a.x-(a.left??0))}, ${d+l+(t.padding??0)/2-(a.y-(a.top??0))})`),U(t,_),t.intersect=function(e){return J.rect(t,e)},i}t(Tt,`dividedRectangle`);async function Et(t,n){let{labelStyles:r,nodeStyles:i}=y(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s}=await H(t,n,W(n)),c=o.width/2+s+5,l=o.width/2+s,u,{cssStyles:d}=n;if(n.look===`handDrawn`){let e=V.svg(a),t=v(n,{roughness:.2,strokeWidth:2.5}),r=v(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,c*2,t),o=e.circle(0,0,l*2,r);u=a.insert(`g`,`:first-child`),u.attr(`class`,h(n.cssClasses)).attr(`style`,h(d)),u.node()?.appendChild(i),u.node()?.appendChild(o)}else{u=a.insert(`g`,`:first-child`);let e=u.insert(`circle`,`:first-child`),t=u.insert(`circle`);u.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,c).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,l).attr(`cx`,0).attr(`cy`,0)}return U(n,u),n.intersect=function(t){return e.info(`DoubleCircle intersect`,n,c,t),J.circle(n,c,t)},a}t(Et,`doublecircle`);function Dt(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=y(n);n.label=``,n.labelStyle=i;let o=t.insert(`g`).attr(`class`,W(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=V.svg(o),{nodeBorder:l}=r,u=v(n,{fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),U(n,f),n.intersect=function(t){return e.info(`filledCircle intersect`,n,{radius:7,point:t}),J.circle(n,7,t)},o}t(Dt,`filledCircle`);async function Ot(t,n){let{labelStyles:r,nodeStyles:i}=y(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await H(t,n,W(n)),c=o.width+(n.padding??0),l=c+o.height,u=c+o.height,d=[{x:0,y:-l},{x:u,y:-l},{x:u/2,y:0}],{cssStyles:f}=n,p=V.svg(a),m=v(n,{});n.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=G(d),g=p.path(h,m),_=a.insert(()=>g,`:first-child`).attr(`transform`,`translate(${-l/2}, ${l/2})`);return f&&n.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,f),i&&n.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,i),n.width=c,n.height=l,U(n,_),s.attr(`transform`,`translate(${-o.width/2-(o.x-(o.left??0))}, ${-l/2+(n.padding??0)/2+(o.y-(o.top??0))})`),n.intersect=function(t){return e.info(`Triangle intersect`,n,d,t),J.polygon(n,d,t)},a}t(Ot,`flippedTriangle`);function kt(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=y(t);t.label=``;let o=e.insert(`g`).attr(`class`,W(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);n===`LR`&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=V.svg(o),p=v(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),U(t,h);let g=r?.padding??0;return t.width&&t.height&&(t.width+=g/2||0,t.height+=g/2||0),t.intersect=function(e){return J.rect(t,e)},o}t(kt,`forkJoin`);async function At(t,n){let{labelStyles:r,nodeStyles:i}=y(n);n.labelStyle=r;let{shapeSvg:a,bbox:o}=await H(t,n,W(n)),s=Math.max(80,o.width+(n.padding??0)*2,n?.width??0),c=Math.max(50,o.height+(n.padding??0)*2,n?.height??0),l=c/2,{cssStyles:u}=n,d=V.svg(a),f=v(n,{});n.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=[{x:-s/2,y:-c/2},{x:s/2-l,y:-c/2},...Ue(-s/2+l,0,l,50,90,270),{x:s/2-l,y:c/2},{x:-s/2,y:c/2}],m=G(p),h=d.path(m,f),g=a.insert(()=>h,`:first-child`);return g.attr(`class`,`basic label-container`),u&&n.look!==`handDrawn`&&g.selectChildren(`path`).attr(`style`,u),i&&n.look!==`handDrawn`&&g.selectChildren(`path`).attr(`style`,i),U(n,g),n.intersect=function(t){return e.info(`Pill intersect`,n,{radius:l,point:t}),J.polygon(n,p,t)},a}t(At,`halfRoundedRectangle`);async function jt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=a.height+(t.padding??0),s=a.width+(t.padding??0)*2.5,{cssStyles:c}=t,l=V.svg(i),u=v(t,{});t.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=s/2,f=d/6;d+=f;let p=o/2,m=p/2,h=d-m,g=[{x:-h,y:-p},{x:0,y:-p},{x:h,y:-p},{x:d,y:0},{x:h,y:p},{x:0,y:p},{x:-h,y:p},{x:-d,y:0}],_=G(g),b=l.path(_,u),x=i.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container`),c&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,c),r&&t.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,r),t.width=s,t.height=o,U(t,x),t.intersect=function(e){return J.polygon(t,g,e)},i}t(jt,`hexagon`);async function Mt(t,n){let{labelStyles:r,nodeStyles:i}=y(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await H(t,n,W(n)),o=Math.max(30,n?.width??0),s=Math.max(30,n?.height??0),{cssStyles:c}=n,l=V.svg(a),u=v(n,{});n.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=G(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container`),c&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),U(n,m),n.intersect=function(t){return e.info(`Pill intersect`,n,{points:d}),J.polygon(n,d,t)},a}t(Mt,`hourglass`);async function Nt(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=y(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await H(t,n,`icon-shape default`),p=n.pos===`t`,m=c,h=c,{nodeBorder:g}=r,{stylesMap:_}=x(n),b=-h/2,S=-m/2,w=n.label?8:0,T=V.svg(u),E=v(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`);let D=T.rectangle(b,S,h,m,E),O=Math.max(h,d.width),k=m+d.height+w,A=T.rectangle(-O/2,-k/2,O,k,{...E,fill:`transparent`,stroke:`none`}),j=u.insert(()=>D,`:first-child`),M=u.insert(()=>A);if(n.icon){let e=u.append(`g`);e.html(`<g>${await C(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+w/2-i/2-o:-d.height/2-w/2-i/2-o})`),e.attr(`style`,`color: ${_.get(`stroke`)??g};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-k/2:k/2-d.height})`),j.attr(`transform`,`translate(0,${p?d.height/2+w/2:-d.height/2-w/2})`),U(n,M),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return J.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=p?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+w},{x:r+h/2,y:i-a/2+d.height+w},{x:r+h/2,y:i+a/2},{x:r-h/2,y:i+a/2},{x:r-h/2,y:i-a/2+d.height+w},{x:r-d.width/2,y:i-a/2+d.height+w}]:[{x:r-h/2,y:i-a/2},{x:r+h/2,y:i-a/2},{x:r+h/2,y:i-a/2+m},{x:r+d.width/2,y:i-a/2+m},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+m},{x:r-h/2,y:i-a/2+m}],J.polygon(n,o,t)},u}t(Nt,`icon`);async function Pt(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=y(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await H(t,n,`icon-shape default`),p=n.label?8:0,m=n.pos===`t`,{nodeBorder:h,mainBkg:g}=r,{stylesMap:_}=x(n),b=V.svg(u),S=v(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`),S.stroke=_.get(`fill`)??g;let w=u.append(`g`);n.icon&&w.html(`<g>${await C(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let T=w.node().getBBox(),E=T.width,D=T.height,O=T.x,k=T.y,A=Math.max(E,D)*Math.SQRT2+40,j=b.circle(0,0,A,S),M=Math.max(A,d.width),N=A+d.height+p,P=b.rectangle(-M/2,-N/2,M,N,{...S,fill:`transparent`,stroke:`none`}),F=u.insert(()=>j,`:first-child`),I=u.insert(()=>P);return w.attr(`transform`,`translate(${-E/2-O},${m?d.height/2+p/2-D/2-k:-d.height/2-p/2-D/2-k})`),w.attr(`style`,`color: ${_.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-N/2:N/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),U(n,I),n.intersect=function(t){return e.info(`iconSquare intersect`,n,t),J.rect(n,t)},u}t(Pt,`iconCircle`);async function Ft(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=y(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await H(t,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,g=c+f*2,{nodeBorder:_,mainBkg:b}=r,{stylesMap:S}=x(n),w=-g/2,T=-h/2,E=n.label?8:0,D=V.svg(u),O=v(n,{});n.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`),O.stroke=S.get(`fill`)??b;let k=D.path(q(w,T,g,h,5),O),A=Math.max(g,d.width),j=h+d.height+E,M=D.rectangle(-A/2,-j/2,A,j,{...O,fill:`transparent`,stroke:`none`}),N=u.insert(()=>k,`:first-child`).attr(`class`,`icon-shape2`),P=u.insert(()=>M);if(n.icon){let e=u.append(`g`);e.html(`<g>${await C(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+E/2-i/2-o:-d.height/2-E/2-i/2-o})`),e.attr(`style`,`color: ${S.get(`stroke`)??_};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-j/2:j/2-d.height})`),N.attr(`transform`,`translate(0,${m?d.height/2+E/2:-d.height/2-E/2})`),U(n,P),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return J.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+E},{x:r+g/2,y:i-a/2+d.height+E},{x:r+g/2,y:i+a/2},{x:r-g/2,y:i+a/2},{x:r-g/2,y:i-a/2+d.height+E},{x:r-d.width/2,y:i-a/2+d.height+E}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-g/2,y:i-a/2+h}],J.polygon(n,o,t)},u}t(Ft,`iconRounded`);async function It(t,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=y(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await H(t,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,g=c+f*2,{nodeBorder:_,mainBkg:b}=r,{stylesMap:S}=x(n),w=-g/2,T=-h/2,E=n.label?8:0,D=V.svg(u),O=v(n,{});n.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`),O.stroke=S.get(`fill`)??b;let k=D.path(q(w,T,g,h,.1),O),A=Math.max(g,d.width),j=h+d.height+E,M=D.rectangle(-A/2,-j/2,A,j,{...O,fill:`transparent`,stroke:`none`}),N=u.insert(()=>k,`:first-child`),P=u.insert(()=>M);if(n.icon){let e=u.append(`g`);e.html(`<g>${await C(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+E/2-i/2-o:-d.height/2-E/2-i/2-o})`),e.attr(`style`,`color: ${S.get(`stroke`)??_};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-j/2:j/2-d.height})`),N.attr(`transform`,`translate(0,${m?d.height/2+E/2:-d.height/2-E/2})`),U(n,P),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return J.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+E},{x:r+g/2,y:i-a/2+d.height+E},{x:r+g/2,y:i+a/2},{x:r-g/2,y:i+a/2},{x:r-g/2,y:i-a/2+d.height+E},{x:r-d.width/2,y:i-a/2+d.height+E}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-g/2,y:i-a/2+h}],J.polygon(n,o,t)},u}t(It,`iconSquare`);async function Lt(t,n,{config:{flowchart:r}}){let i=new Image;i.src=n?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));n.imageAspectRatio=a/o;let{labelStyles:s}=y(n);n.labelStyle=s;let c=r?.wrappingWidth;n.defaultWidth=r?.wrappingWidth;let l=Math.max(n.label?c??0:0,n?.assetWidth??a),u=n.constraint===`on`&&n?.assetHeight?n.assetHeight*n.imageAspectRatio:l,d=n.constraint===`on`?u/n.imageAspectRatio:n?.assetHeight??o;n.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await H(t,n,`image-shape default`),h=n.pos===`t`,g=-u/2,_=-d/2,b=n.label?8:0,x=V.svg(f),S=v(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=x.rectangle(g,_,u,d,S),w=Math.max(u,p.width),T=d+p.height+b,E=x.rectangle(-w/2,-T/2,w,T,{...S,fill:`none`,stroke:`none`}),D=f.insert(()=>C,`:first-child`),O=f.insert(()=>E);if(n.img){let e=f.append(`image`);e.attr(`href`,n.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?T/2-d:-T/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-b/2:d/2-p.height/2+b/2})`),D.attr(`transform`,`translate(0,${h?p.height/2+b/2:-p.height/2-b/2})`),U(n,O),n.intersect=function(t){if(e.info(`iconSquare intersect`,n,t),!n.label)return J.rect(n,t);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+b},{x:r+u/2,y:i-a/2+p.height+b},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+b},{x:r-p.width/2,y:i-a/2+p.height+b}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],J.polygon(n,o,t)},f}t(Lt,`imageSquare`);async function Rt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(a.width+(t.padding??0)*2,t?.width??0),s=Math.max(a.height+(t.padding??0)*2,t?.height??0),c=[{x:0,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:-3*s/6,y:-s}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=v(t,{}),r=G(c),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2}, ${s/2})`),u&&l.attr(`style`,u)}else l=Y(i,o,s,c);return r&&l.attr(`style`,r),t.width=o,t.height=s,U(t,l),t.intersect=function(e){return J.polygon(t,c,e)},i}t(Rt,`inv_trapezoid`);async function zt(e,t,n){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await H(e,t,W(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:p}=t,{cssStyles:m}=t;if(n?.rx&&n.ry&&(f=n.rx,p=n.ry),t.look===`handDrawn`){let e=V.svg(a),n=v(t,{}),r=f||p?e.path(q(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,h(m))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,h(f)).attr(`ry`,h(p)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return U(t,d),t.calcIntersect=function(e,t){return J.rect(e,t)},t.intersect=function(e){return J.rect(t,e)},a}t(zt,`drawRect`);async function Bt(e,t){let{shapeSvg:n,bbox:r,label:i}=await H(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),U(t,a),t.intersect=function(e){return J.rect(t,e)},n}t(Bt,`labelRect`);async function Vt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(a.width+(t.padding??0),t?.width??0),s=Math.max(a.height+(t.padding??0),t?.height??0),c=[{x:0,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:-(3*s)/6,y:-s}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=v(t,{}),r=G(c),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2}, ${s/2})`),u&&l.attr(`style`,u)}else l=Y(i,o,s,c);return r&&l.attr(`style`,r),t.width=o,t.height=s,U(t,l),t.intersect=function(e){return J.polygon(t,c,e)},i}t(Vt,`lean_left`);async function Ht(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(a.width+(t.padding??0),t?.width??0),s=Math.max(a.height+(t.padding??0),t?.height??0),c=[{x:-3*s/6,y:0},{x:o,y:0},{x:o+3*s/6,y:-s},{x:0,y:-s}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=v(t,{}),r=G(c),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2}, ${s/2})`),u&&l.attr(`style`,u)}else l=Y(i,o,s,c);return r&&l.attr(`style`,r),t.width=o,t.height=s,U(t,l),t.intersect=function(e){return J.polygon(t,c,e)},i}t(Ht,`lean_right`);function Ut(t,n){let{labelStyles:r,nodeStyles:i}=y(n);n.label=``,n.labelStyle=r;let a=t.insert(`g`).attr(`class`,W(n)).attr(`id`,n.domId??n.id),{cssStyles:o}=n,s=Math.max(35,n?.width??0),c=Math.max(35,n?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=V.svg(a),d=v(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=G(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return o&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),U(n,m),n.intersect=function(t){return e.info(`lightningBolt intersect`,n,t),J.polygon(n,l,t)},a}t(Ut,`lightningBolt`);var Wt=t((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),Gt=t((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),Kt=t((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`);async function qt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0),t.width??0),c=s/2,l=c/(2.5+s/50),u=Math.max(a.height+l+(t.padding??0),t.height??0),d=u*.1,f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=Gt(0,0,s,u,c,l,d),r=Kt(0,l,s,u,c,l),a=v(t,{}),o=e.path(n,a),m=e.path(r,a);i.insert(()=>m,`:first-child`).attr(`class`,`line`),f=i.insert(()=>o,`:first-child`),f.attr(`class`,`basic label-container`),p&&f.attr(`style`,p)}else{let e=Wt(0,0,s,u,c,l,d);f=i.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,h(p)).attr(`style`,r)}return f.attr(`label-offset-y`,l),f.attr(`transform`,`translate(${-s/2}, ${-(u/2+l)})`),U(t,f),o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+l-(a.y-(a.top??0))})`),t.intersect=function(e){let n=J.rect(t,e),r=n.x-(t.x??0);if(c!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-l)){let i=l*l*(1-r*r/(c*c));i>0&&(i=Math.sqrt(i)),i=l-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},i}t(qt,`linedCylinder`);async function Jt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/4,u=c+l,{cssStyles:d}=t,f=V.svg(i),p=v(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:-s/2-s/2*.1,y:-u/2},{x:-s/2-s/2*.1,y:u/2},...K(-s/2-s/2*.1,u/2,s/2+s/2*.1,u/2,l,.8),{x:s/2+s/2*.1,y:-u/2},{x:-s/2-s/2*.1,y:-u/2},{x:-s/2,y:-u/2},{x:-s/2,y:u/2*1.1},{x:-s/2,y:-u/2}],h=f.polygon(m.map(e=>[e.x,e.y]),p),g=i.insert(()=>h,`:first-child`);return g.attr(`class`,`basic label-container`),d&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,r),g.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)+s/2*.1/2-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),U(t,g),t.intersect=function(e){return J.polygon(t,m,e)},i}t(Jt,`linedWaveEdgedRect`);async function Yt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=-s/2,u=-c/2,{cssStyles:d}=t,f=V.svg(i),p=v(t,{}),m=[{x:l-5,y:u+5},{x:l-5,y:u+c+5},{x:l+s-5,y:u+c+5},{x:l+s-5,y:u+c},{x:l+s,y:u+c},{x:l+s,y:u+c-5},{x:l+s+5,y:u+c-5},{x:l+s+5,y:u-5},{x:l+5,y:u-5},{x:l+5,y:u},{x:l,y:u},{x:l,y:u+5}],h=[{x:l,y:u+5},{x:l+s-5,y:u+5},{x:l+s-5,y:u+c},{x:l+s,y:u+c},{x:l+s,y:u},{x:l,y:u}];t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let g=G(m),_=f.path(g,p),b=G(h),x=f.path(b,{...p,fill:`none`}),S=i.insert(()=>x,`:first-child`);return S.insert(()=>_,`:first-child`),S.attr(`class`,`basic label-container`),d&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,r),o.attr(`transform`,`translate(${-(a.width/2)-5-(a.x-(a.left??0))}, ${-(a.height/2)+5-(a.y-(a.top??0))})`),U(t,S),t.intersect=function(e){return J.polygon(t,m,e)},i}t(Yt,`multiRect`);async function Xt(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/4,u=c+l,d=-s/2,f=-u/2,{cssStyles:p}=t,m=K(d-5,f+u+5,d+s-5,f+u+5,l,.8),h=m?.[m.length-1],g=[{x:d-5,y:f+5},{x:d-5,y:f+u+5},...m,{x:d+s-5,y:h.y-5},{x:d+s,y:h.y-5},{x:d+s,y:h.y-10},{x:d+s+5,y:h.y-10},{x:d+s+5,y:f-5},{x:d+5,y:f-5},{x:d+5,y:f},{x:d,y:f},{x:d,y:f+5}],_=[{x:d,y:f+5},{x:d+s-5,y:f+5},{x:d+s-5,y:h.y-5},{x:d+s,y:h.y-5},{x:d+s,y:f},{x:d,y:f}],b=V.svg(i),x=v(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=G(g),C=b.path(S,x),w=G(_),T=b.path(w,x),E=i.insert(()=>C,`:first-child`);return E.insert(()=>T),E.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),E.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-(a.width/2)-5-(a.x-(a.left??0))}, ${-(a.height/2)+5-l/2-(a.y-(a.top??0))})`),U(t,E),t.intersect=function(e){return J.polygon(t,g,e)},i}t(Xt,`multiWaveEdgedRectangle`);async function Zt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r,t.useHtmlLabels||f().flowchart?.htmlLabels!==!1||(t.centerLabel=!0);let{shapeSvg:a,bbox:o,label:s}=await H(e,t,W(t)),c=Math.max(o.width+(t.padding??0)*2,t?.width??0),l=Math.max(o.height+(t.padding??0)*2,t?.height??0),u=-c/2,d=-l/2,{cssStyles:p}=t,m=V.svg(a),h=v(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=m.rectangle(u,d,c,l,h),_=a.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,p),i&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,i),s.attr(`transform`,`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),U(t,_),t.intersect=function(e){return J.rect(t,e)},a}t(Zt,`note`);var Qt=t((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function $t(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=a.width+t.padding+(a.height+t.padding),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=v(t,{}),r=Qt(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=Y(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),U(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],i=J.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}t($t,`question`);async function en(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0),t?.width??0),c=Math.max(a.height+(t.padding??0),t?.height??0),l=-s/2,u=-c/2,d=u/2,f=[{x:l+d,y:u},{x:l,y:0},{x:l+d,y:-u},{x:-l,y:-u},{x:-l,y:u}],{cssStyles:p}=t,m=V.svg(i),h=v(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=G(f),_=m.path(g,h),b=i.insert(()=>_,`:first-child`);return b.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,r),b.attr(`transform`,`translate(${-d/2},0)`),o.attr(`transform`,`translate(${-d/2-a.width/2-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),U(t,b),t.intersect=function(e){return J.polygon(t,f,e)},i}t(en,`rect_left_inv_arrow`);async function tn(t,r){let{labelStyles:i,nodeStyles:a}=y(r);r.labelStyle=i;let o;o=r.cssClasses?`node `+r.cssClasses:`node default`;let s=t.insert(`g`).attr(`class`,o).attr(`id`,r.domId||r.id),l=s.insert(`g`),d=s.insert(`g`).attr(`class`,`label`).attr(`style`,a),f=r.description,p=r.label,m=d.node().appendChild(await qe(p,r.labelStyle,!0,!0)),h={width:0,height:0};if(u(c()?.flowchart?.htmlLabels)){let e=m.children[0],t=n(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}e.info(`Text 2`,f);let g=f||[],_=m.getBBox(),b=d.node().appendChild(await qe(g.join?g.join(`<br/>`):g,r.labelStyle,!0,!0)),x=b.children[0],S=n(b);h=x.getBoundingClientRect(),S.attr(`width`,h.width),S.attr(`height`,h.height);let C=(r.padding||0)/2;n(b).attr(`transform`,`translate( `+(h.width>_.width?0:(_.width-h.width)/2)+`, `+(_.height+C+5)+`)`),n(m).attr(`transform`,`translate( `+(h.width<_.width?0:-(_.width-h.width)/2)+`, 0)`),h=d.node().getBBox(),d.attr(`transform`,`translate(`+-h.width/2+`, `+(-h.height/2-C+3)+`)`);let w=h.width+(r.padding||0),T=h.height+(r.padding||0),E=-h.width/2-C,D=-h.height/2-C,O,k;if(r.look===`handDrawn`){let t=V.svg(s),n=v(r,{}),i=t.path(q(E,D,w,T,r.rx||0),n),a=t.line(-h.width/2-C,-h.height/2-C+_.height+C,h.width/2+C,-h.height/2-C+_.height+C,n);k=s.insert(()=>(e.debug(`Rough node insert CXC`,i),a),`:first-child`),O=s.insert(()=>(e.debug(`Rough node insert CXC`,i),i),`:first-child`)}else O=l.insert(`rect`,`:first-child`),k=l.insert(`line`),O.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-h.width/2-C).attr(`y`,-h.height/2-C).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),k.attr(`class`,`divider`).attr(`x1`,-h.width/2-C).attr(`x2`,h.width/2+C).attr(`y1`,-h.height/2-C+_.height+C).attr(`y2`,-h.height/2-C+_.height+C);return U(r,O),r.intersect=function(e){return J.rect(r,e)},s}t(tn,`rectWithTitle`);function nn(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}t(nn,`generateArcPoints`);async function rn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=t?.padding??0,s=t?.padding??0,c=(t?.width?t?.width:a.width)+o*2,l=(t?.height?t?.height:a.height)+s*2,u=t.radius||5,d=t.taper||5,{cssStyles:f}=t,p=V.svg(i),m=v(t,{});t.stroke&&(m.stroke=t.stroke),t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-c/2+d,y:-l/2},{x:c/2-d,y:-l/2},...nn(c/2-d,-l/2,c/2,-l/2+d,u,u,!0),{x:c/2,y:-l/2+d},{x:c/2,y:l/2-d},...nn(c/2,l/2-d,c/2-d,l/2,u,u,!0),{x:c/2-d,y:l/2},{x:-c/2+d,y:l/2},...nn(-c/2+d,l/2,-c/2,l/2-d,u,u,!0),{x:-c/2,y:l/2-d},{x:-c/2,y:-l/2+d},...nn(-c/2,-l/2+d,-c/2+d,-l/2,u,u,!0)],g=G(h),_=p.path(g,m),b=i.insert(()=>_,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),U(t,b),t.intersect=function(e){return J.polygon(t,h,e)},i}t(rn,`roundedRect`);async function an(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=t?.padding??0,c=Math.max(a.width+(t.padding??0)*2,t?.width??0),l=Math.max(a.height+(t.padding??0)*2,t?.height??0),u=-a.width/2-s,d=-a.height/2-s,{cssStyles:f}=t,p=V.svg(i),m=v(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let g=[{x:u,y:d},{x:u+c+8,y:d},{x:u+c+8,y:d+l},{x:u-8,y:d+l},{x:u-8,y:d},{x:u,y:d},{x:u,y:d+l}],_=p.polygon(g.map(e=>[e.x,e.y]),m),b=i.insert(()=>_,`:first-child`);return b.attr(`class`,`basic label-container`).attr(`style`,h(f)),r&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,r),f&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,r),o.attr(`transform`,`translate(${-c/2+4+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-(a.y-(a.top??0))})`),U(t,b),t.intersect=function(e){return J.rect(t,e)},i}t(an,`shadedProcess`);async function on(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=-s/2,u=-c/2,{cssStyles:d}=t,f=V.svg(i),p=v(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:l,y:u},{x:l,y:u+c},{x:l+s,y:u+c},{x:l+s,y:u-c/2}],h=G(m),g=f.path(h,p),_=i.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container`),d&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,r),_.attr(`transform`,`translate(0, ${c/4})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))}, ${-c/4+(t.padding??0)-(a.y-(a.top??0))})`),U(t,_),t.intersect=function(e){return J.polygon(t,m,e)},i}t(on,`slopedRect`);async function sn(e,t){return zt(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??(t?.padding||0)*2,labelPaddingY:(t?.padding||0)*1})}t(sn,`squareRect`);async function cn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=a.height+t.padding,s=a.width+o/4+t.padding,c=o/2,{cssStyles:l}=t,u=V.svg(i),d=v(t,{});t.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=[{x:-s/2+c,y:-o/2},{x:s/2-c,y:-o/2},...Ue(-s/2+c,0,c,50,90,270),{x:s/2-c,y:o/2},...Ue(s/2-c,0,c,50,270,450)],p=G(f),m=u.path(p,d),h=i.insert(()=>m,`:first-child`);return h.attr(`class`,`basic label-container outer-path`),l&&t.look!==`handDrawn`&&h.selectChildren(`path`).attr(`style`,l),r&&t.look!==`handDrawn`&&h.selectChildren(`path`).attr(`style`,r),U(t,h),t.intersect=function(e){return J.polygon(t,f,e)},i}t(cn,`stadium`);async function ln(e,t){return zt(e,t,{rx:5,ry:5,classes:`flowchart-node`})}t(ln,`state`);function un(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c}=n,l=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),u=V.svg(l),d=v(t,{});t.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=u.circle(0,0,14,{...d,stroke:o,strokeWidth:2}),p=s??c,m=u.circle(0,0,5,{...d,fill:p,stroke:p,strokeWidth:2,fillStyle:`solid`}),h=l.insert(()=>f,`:first-child`);return h.insert(()=>m),a&&h.selectAll(`path`).attr(`style`,a),i&&h.selectAll(`path`).attr(`style`,i),U(t,h),t.intersect=function(e){return J.circle(t,7,e)},l}t(un,`stateEnd`);function dn(e,t,{config:{themeVariables:n}}){let{lineColor:r}=n,i=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),a;if(t.look===`handDrawn`){let e=V.svg(i).circle(0,0,14,b(r));a=i.insert(()=>e),a.attr(`class`,`state-start`).attr(`r`,7).attr(`width`,14).attr(`height`,14)}else a=i.insert(`circle`,`:first-child`),a.attr(`class`,`state-start`).attr(`r`,7).attr(`width`,14).attr(`height`,14);return U(t,a),t.intersect=function(e){return J.circle(t,7,e)},i}t(dn,`stateStart`);async function fn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=(t?.padding||0)/2,s=a.width+t.padding,c=a.height+t.padding,l=-a.width/2-o,u=-a.height/2-o,d=[{x:0,y:0},{x:s,y:0},{x:s,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-c},{x:-8,y:-c},{x:-8,y:0}];if(t.look===`handDrawn`){let e=V.svg(i),n=v(t,{}),r=e.rectangle(l-8,u,s+16,c,n),a=e.line(l,u,l,u+c,n),o=e.line(l+s,u,l+s,u+c,n);i.insert(()=>a,`:first-child`),i.insert(()=>o,`:first-child`);let d=i.insert(()=>r,`:first-child`),{cssStyles:f}=t;d.attr(`class`,`basic label-container`).attr(`style`,h(f)),U(t,d)}else{let e=Y(i,s,c,d);r&&e.attr(`style`,r),U(t,e)}return t.intersect=function(e){return J.polygon(t,d,e)},i}t(fn,`subroutine`);async function pn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(a.width+(t.padding??0)*2,t?.width??0),s=Math.max(a.height+(t.padding??0)*2,t?.height??0),c=-o/2,l=-s/2,u=.2*s,d=.2*s,{cssStyles:f}=t,p=V.svg(i),m=v(t,{}),h=[{x:c-u/2,y:l},{x:c+o+u/2,y:l},{x:c+o+u/2,y:l+s},{x:c-u/2,y:l+s}],g=[{x:c+o-u/2,y:l+s},{x:c+o+u/2,y:l+s},{x:c+o+u/2,y:l+s-d}];t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let _=G(h),b=p.path(_,m),x=G(g),S=p.path(x,{...m,fillStyle:`solid`}),C=i.insert(()=>S,`:first-child`);return C.insert(()=>b,`:first-child`),C.attr(`class`,`basic label-container`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),U(t,C),t.intersect=function(e){return J.polygon(t,h,e)},i}t(pn,`taggedRect`);async function mn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/4,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=V.svg(i),h=v(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-s/2-s/2*.1,y:f/2},...K(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],_=-s/2+s/2*.1,b=-f/2-d*.4,x=[{x:_+s-u,y:(b+c)*1.4},{x:_+s,y:b+c-d},{x:_+s,y:(b+c)*.9},...K(_+s,(b+c)*1.3,_+s-u,(b+c)*1.5,-c*.03,.5)],S=G(g),C=m.path(S,h),w=G(x),T=m.path(w,{...h,fillStyle:`solid`}),E=i.insert(()=>T,`:first-child`);return E.insert(()=>C,`:first-child`),E.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),E.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),U(t,E),t.intersect=function(e){return J.polygon(t,g,e)},i}t(mn,`taggedWaveEdgedRectangle`);async function hn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(a.width+t.padding,t?.width||0),s=Math.max(a.height+t.padding,t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),U(t,u),t.intersect=function(e){return J.rect(t,e)},i}t(hn,`text`);var gn=t((e,t,n,r,i,a)=>`M${e},${t}
|
|
4
|
+
a${i},${a} 0,0,1 0,${-r}
|
|
5
|
+
l${n},0
|
|
6
|
+
a${i},${a} 0,0,1 0,${r}
|
|
7
|
+
M${n},${-r}
|
|
8
|
+
a${i},${a} 0,0,0 0,${r}
|
|
9
|
+
l${-n},0`,`createCylinderPathD`),_n=t((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),vn=t((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`);async function yn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o,halfPadding:s}=await H(e,t,W(t)),c=t.look===`neo`?s*2:s,l=a.height+c,u=l/2,d=u/(2.5+l/50),f=a.width+d+c,{cssStyles:p}=t,m;if(t.look===`handDrawn`){let e=V.svg(i),n=_n(0,0,f,l,d,u),r=vn(0,0,f,l,d,u),a=e.path(n,v(t,{})),o=e.path(r,v(t,{fill:`none`}));m=i.insert(()=>o,`:first-child`),m=i.insert(()=>a,`:first-child`),m.attr(`class`,`basic label-container`),p&&m.attr(`style`,p)}else{let e=gn(0,0,f,l,d,u);m=i.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,h(p)).attr(`style`,r),m.attr(`class`,`basic label-container`),p&&m.selectAll(`path`).attr(`style`,p),r&&m.selectAll(`path`).attr(`style`,r)}return m.attr(`label-offset-x`,d),m.attr(`transform`,`translate(${-f/2}, ${l/2} )`),o.attr(`transform`,`translate(${-(a.width/2)-d-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),U(t,m),t.intersect=function(e){let n=J.rect(t,e),r=n.y-(t.y??0);if(u!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-d)){let i=d*d*(1-r*r/(u*u));i!=0&&(i=Math.sqrt(Math.abs(i))),i=d-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},i}t(yn,`tiltedCylinder`);async function bn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=a.width+t.padding,s=a.height+t.padding,c=[{x:-3*s/6,y:0},{x:o+3*s/6,y:0},{x:o,y:-s},{x:0,y:-s}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=V.svg(i),n=v(t,{}),r=G(c),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2}, ${s/2})`),u&&l.attr(`style`,u)}else l=Y(i,o,s,c);return r&&l.attr(`style`,r),t.width=o,t.height=s,U(t,l),t.intersect=function(e){return J.polygon(t,c,e)},i}t(bn,`trapezoid`);async function xn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(60,a.width+(t.padding??0)*2,t?.width??0),s=Math.max(20,a.height+(t.padding??0)*2,t?.height??0),{cssStyles:c}=t,l=V.svg(i),u=v(t,{});t.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:-o/2*.8,y:-s/2},{x:o/2*.8,y:-s/2},{x:o/2,y:-s/2*.6},{x:o/2,y:s/2},{x:-o/2,y:s/2},{x:-o/2,y:-s/2*.6}],f=G(d),p=l.path(f,u),m=i.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container`),c&&t.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),r&&t.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,r),U(t,m),t.intersect=function(e){return J.polygon(t,d,e)},i}t(xn,`trapezoidalPentagon`);async function Sn(t,n){let{labelStyles:r,nodeStyles:i}=y(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await H(t,n,W(n)),l=u(c().flowchart?.htmlLabels),d=o.width+(n.padding??0),f=d+o.height,p=d+o.height,m=[{x:0,y:0},{x:p,y:0},{x:p/2,y:-f}],{cssStyles:h}=n,g=V.svg(a),_=v(n,{});n.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let b=G(m),x=g.path(b,_),S=a.insert(()=>x,`:first-child`).attr(`transform`,`translate(${-f/2}, ${f/2})`);return h&&n.look!==`handDrawn`&&S.selectChildren(`path`).attr(`style`,h),i&&n.look!==`handDrawn`&&S.selectChildren(`path`).attr(`style`,i),n.width=d,n.height=f,U(n,S),s.attr(`transform`,`translate(${-o.width/2-(o.x-(o.left??0))}, ${f/2-(o.height+(n.padding??0)/(l?2:1)-(o.y-(o.top??0)))})`),n.intersect=function(t){return e.info(`Triangle intersect`,n,m,t),J.polygon(n,m,t)},a}t(Sn,`triangle`);async function Cn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=c+l,{cssStyles:d}=t,f=70-s,p=f>0?f/2:0,m=V.svg(i),h=v(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-s/2-p,y:u/2},...K(-s/2-p,u/2,s/2+p,u/2,l,.8),{x:s/2+p,y:-u/2},{x:-s/2-p,y:-u/2}],_=G(g),b=m.path(_,h),x=i.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container`),d&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l-(a.y-(a.top??0))})`),U(t,x),t.intersect=function(e){return J.polygon(t,g,e)},i}t(Cn,`waveEdgedRectangle`);async function wn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await H(e,t,W(t)),o=Math.max(a.width+(t.padding??0)*2,t?.width??0),s=Math.max(a.height+(t.padding??0)*2,t?.height??0),c=o/s,l=o,u=s;l>u*c?u=l/c:l=u*c,l=Math.max(l,100),u=Math.max(u,50);let d=Math.min(u*.2,u/4),f=u+d*2,{cssStyles:p}=t,m=V.svg(i),h=v(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-l/2,y:f/2},...K(-l/2,f/2,l/2,f/2,d,1),{x:l/2,y:-f/2},...K(l/2,-f/2,-l/2,-f/2,d,-1)],_=G(g),b=m.path(_,h),x=i.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),U(t,x),t.intersect=function(e){return J.polygon(t,g,e)},i}t(wn,`waveRectangle`);async function Tn(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await H(e,t,W(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=-s/2,u=-c/2,{cssStyles:d}=t,f=V.svg(i),p=v(t,{}),m=[{x:l-5,y:u-5},{x:l-5,y:u+c},{x:l+s,y:u+c},{x:l+s,y:u-5}],h=`M${l-5},${u-5} L${l+s},${u-5} L${l+s},${u+c} L${l-5},${u+c} L${l-5},${u-5}
|
|
10
|
+
M${l-5},${u} L${l+s},${u}
|
|
11
|
+
M${l},${u-5} L${l},${u+c}`;t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let g=f.path(h,p),_=i.insert(()=>g,`:first-child`);return _.attr(`transform`,`translate(${5/2}, ${5/2})`),_.attr(`class`,`basic label-container`),d&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&_.selectAll(`path`).attr(`style`,r),o.attr(`transform`,`translate(${-(a.width/2)+5/2-(a.x-(a.left??0))}, ${-(a.height/2)+5/2-(a.y-(a.top??0))})`),U(t,_),t.intersect=function(e){return J.polygon(t,m,e)},i}t(Tn,`windowPane`);async function En(e,t){let r=t;if(r.alias&&(t.label=r.alias),t.look===`handDrawn`){let{themeVariables:n}=f(),{background:r}=n;await En(e,{...t,id:t.id+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let i=f();t.useHtmlLabels=i.htmlLabels;let a=i.er?.diagramPadding??10,o=i.er?.entityPadding??6,{cssStyles:s}=t,{labelStyles:c,nodeStyles:l}=y(t);if(r.attributes.length===0&&t.label){let n={rx:0,ry:0,labelPaddingX:a,labelPaddingY:a*1.5,classes:``};g(t.label,i)+n.labelPaddingX*2<i.er.minEntityWidth&&(t.width=i.er.minEntityWidth);let r=await zt(e,t,n);if(!u(i.htmlLabels)){let e=r.select(`text`),t=e.node()?.getBBox();e.attr(`transform`,`translate(${-t.width/2}, 0)`)}return r}i.htmlLabels||(a*=1.25,o*=1.25);let d=W(t);d||=`node default`;let p=e.insert(`g`).attr(`class`,d).attr(`id`,t.domId||t.id),m=await Dn(p,t.label??``,i,0,0,[`name`],c);m.height+=o;let h=0,_=[],b=[],x=0,S=0,C=0,w=0,T=!0,E=!0;for(let e of r.attributes){let t=await Dn(p,e.type,i,0,h,[`attribute-type`],c);x=Math.max(x,t.width+a);let n=await Dn(p,e.name,i,0,h,[`attribute-name`],c);S=Math.max(S,n.width+a);let r=await Dn(p,e.keys.join(),i,0,h,[`attribute-keys`],c);C=Math.max(C,r.width+a);let s=await Dn(p,e.comment,i,0,h,[`attribute-comment`],c);w=Math.max(w,s.width+a);let l=Math.max(t.height,n.height,r.height,s.height)+o;b.push({yOffset:h,rowHeight:l}),h+=l}let D=4;C<=a&&(T=!1,C=0,D--),w<=a&&(E=!1,w=0,D--);let O=p.node().getBBox();if(m.width+a*2-(x+S+C+w)>0){let e=m.width+a*2-(x+S+C+w);x+=e/D,S+=e/D,C>0&&(C+=e/D),w>0&&(w+=e/D)}let k=x+S+C+w,A=V.svg(p),j=v(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`);let M=0;b.length>0&&(M=b.reduce((e,t)=>e+(t?.rowHeight??0),0));let N=Math.max(O.width+a*2,t?.width||0,k),P=Math.max((M??0)+m.height,t?.height||0),F=-N/2,I=-P/2;p.selectAll(`g:not(:first-child)`).each((e,t,r)=>{let i=n(r[t]),s=i.attr(`transform`),c=0,l=0;if(s){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(s);e&&(c=parseFloat(e[1]),l=parseFloat(e[2]),i.attr(`class`).includes(`attribute-name`)?c+=x:i.attr(`class`).includes(`attribute-keys`)?c+=x+S:i.attr(`class`).includes(`attribute-comment`)&&(c+=x+S+C))}i.attr(`transform`,`translate(${F+a/2+c}, ${l+I+m.height+o/2})`)}),p.select(`.name`).attr(`transform`,`translate(`+-m.width/2+`, `+(I+o/2)+`)`);let ee=A.rectangle(F,I,N,P,j),te=p.insert(()=>ee,`:first-child`).attr(`style`,s.join(``)),{themeVariables:ne}=f(),{rowEven:re,rowOdd:ie,nodeBorder:ae}=ne;_.push(0);for(let[e,t]of b.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=A.rectangle(F,m.height+I+t?.yOffset,N,t?.rowHeight,{...j,fill:n?re:ie,stroke:ae});p.insert(()=>r,`g.label`).attr(`style`,s.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let L=A.line(F,m.height+I,N+F,m.height+I,j);p.insert(()=>L).attr(`class`,`divider`),L=A.line(x+F,m.height+I,x+F,P+I,j),p.insert(()=>L).attr(`class`,`divider`),T&&(L=A.line(x+S+F,m.height+I,x+S+F,P+I,j),p.insert(()=>L).attr(`class`,`divider`)),E&&(L=A.line(x+S+C+F,m.height+I,x+S+C+F,P+I,j),p.insert(()=>L).attr(`class`,`divider`));for(let e of _)L=A.line(F,m.height+I+e,N+F,m.height+I+e,j),p.insert(()=>L).attr(`class`,`divider`);if(U(t,te),l&&t.look!==`handDrawn`){let e=l.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);p.selectAll(`path`).attr(`style`,e??``),p.selectAll(`.row-rect-even path`).attr(`style`,l)}return t.intersect=function(e){return J.rect(t,e)},p}t(En,`erBox`);async function Dn(e,t,i,a=0,o=0,s=[],c=``){let l=e.insert(`g`).attr(`class`,`label ${s.join(` `)}`).attr(`transform`,`translate(${a}, ${o})`).attr(`style`,c);t!==r(t)&&(t=r(t),t=t.replaceAll(`<`,`<`).replaceAll(`>`,`>`));let d=l.node().appendChild(await S(l,t,{width:g(t,i)+100,style:c,useHtmlLabels:i.htmlLabels},i));if(t.includes(`<`)||t.includes(`>`)){let e=d.children[0];for(e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}let f=d.getBBox();if(u(i.htmlLabels)){let e=d.children[0];e.style.textAlign=`start`;let t=n(d);f=e.getBoundingClientRect(),t.attr(`width`,f.width),t.attr(`height`,f.height)}return f}t(Dn,`addText`);async function On(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,W(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await kn(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await kn(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await kn(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await kn(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}t(On,`textHelper`);async function kn(e,r,i,o=[]){let c=e.insert(`g`).attr(`class`,`label`).attr(`style`,o.join(`; `)),l=f(),d=`useHtmlLabels`in r?r.useHtmlLabels:u(l.htmlLabels)??!0,p=``;p=`text`in r?r.text:r.label,!d&&p.startsWith(`\\`)&&(p=p.substring(1)),s(p)&&(d=!0);let h=await S(c,a(m(p)),{width:g(p,l)+50,classes:`markdown-node-label`,useHtmlLabels:d},l),_,v=1;if(d){let e=h.children[0],r=n(h);v=e.innerHTML.split(`<br>`).length,e.innerHTML.includes(`</math>`)&&(v+=e.innerHTML.split(`<mrow>`).length-1);let i=e.getElementsByTagName(`img`);if(i){let e=p.replace(/<img[^>]*>/g,``).trim()===``;await Promise.all([...i].map(n=>new Promise(r=>{function i(){if(n.style.display=`flex`,n.style.flexDirection=`column`,e){let e=l.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,t=parseInt(e,10)*5+`px`;n.style.minWidth=t,n.style.maxWidth=t}else n.style.width=`100%`;r(n)}t(i,`setupImage`),setTimeout(()=>{n.complete&&i()}),n.addEventListener(`error`,i),n.addEventListener(`load`,i)})))}_=e.getBoundingClientRect(),r.attr(`width`,_.width),r.attr(`height`,_.height)}else{o.includes(`font-weight: bolder`)&&n(h).selectAll(`tspan`).attr(`font-weight`,``),v=h.children.length;let e=h.children[0];(h.textContent===``||h.textContent.includes(`>`))&&(e.textContent=p[0]+p.substring(1).replaceAll(`>`,`>`).replaceAll(`<`,`<`).trim(),p[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),_=h.getBBox()}return c.attr(`transform`,`translate(0,`+(-_.height/(2*v)+i)+`)`),_.height}t(kn,`addText`);async function An(e,t){let r=c(),i=r.class.padding??12,a=i,o=t.useHtmlLabels??u(r.htmlLabels)??!0,s=t;s.annotations=s.annotations??[],s.members=s.members??[],s.methods=s.methods??[];let{shapeSvg:l,bbox:d}=await On(e,t,r,o,a),{labelStyles:f,nodeStyles:p}=y(t);t.labelStyle=f,t.cssStyles=s.styles||``;let m=s.styles?.join(`;`)||p||``;t.cssStyles||=m.replaceAll(`!important`,``).split(`;`);let h=s.members.length===0&&s.methods.length===0&&!r.class?.hideEmptyMembersBox,g=V.svg(l),_=v(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let b=d.width,x=d.height;s.members.length===0&&s.methods.length===0?x+=a:s.members.length>0&&s.methods.length===0&&(x+=a*2);let S=-b/2,C=-x/2,w=g.rectangle(S-i,C-i-(h?i:s.members.length===0&&s.methods.length===0?-i/2:0),b+2*i,x+2*i+(h?i*2:s.members.length===0&&s.methods.length===0?-i:0),_),T=l.insert(()=>w,`:first-child`);T.attr(`class`,`basic label-container`);let E=T.node().getBBox();l.selectAll(`.text`).each((e,t,r)=>{let a=n(r[t]),c=a.attr(`transform`),u=0;if(c){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(c);e&&(u=parseFloat(e[2]))}let d=u+C+i-(h?i:s.members.length===0&&s.methods.length===0?-i/2:0);o||(d-=4);let f=S;(a.attr(`class`).includes(`label-group`)||a.attr(`class`).includes(`annotation-group`))&&(f=-a.node()?.getBBox().width/2||0,l.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(f=0)})),a.attr(`transform`,`translate(${f}, ${d})`)});let D=l.select(`.annotation-group`).node().getBBox().height-(h?i/2:0)||0,O=l.select(`.label-group`).node().getBBox().height-(h?i/2:0)||0,k=l.select(`.members-group`).node().getBBox().height-(h?i/2:0)||0;if(s.members.length>0||s.methods.length>0||h){let e=g.line(E.x,D+O+C+i,E.x+E.width,D+O+C+i,_);l.insert(()=>e).attr(`class`,`divider`).attr(`style`,m)}if(h||s.members.length>0||s.methods.length>0){let e=g.line(E.x,D+O+k+C+a*2+i,E.x+E.width,D+O+k+C+i+a*2,_);l.insert(()=>e).attr(`class`,`divider`).attr(`style`,m)}if(s.look!==`handDrawn`&&l.selectAll(`path`).attr(`style`,m),T.select(`:nth-child(2)`).attr(`style`,m),l.selectAll(`.divider`).select(`path`).attr(`style`,m),t.labelStyle?l.selectAll(`span`).attr(`style`,t.labelStyle):l.selectAll(`span`).attr(`style`,m),!o){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(m);if(t){let e=t[0].replace(`color`,`fill`);l.selectAll(`tspan`).attr(`style`,e)}else if(f){let t=e.exec(f);if(t){let e=t[0].replace(`color`,`fill`);l.selectAll(`tspan`).attr(`style`,e)}}}return U(t,T),t.intersect=function(e){return J.rect(t,e)},l}t(An,`classBox`);async function jn(e,t){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r;let a=t,o=t,s=`verifyMethod`in t,c=W(t),l=e.insert(`g`).attr(`class`,c).attr(`id`,t.domId??t.id),u;u=s?await $(l,`<<${a.type}>>`,0,t.labelStyle):await $(l,`<<Element>>`,0,t.labelStyle);let d=u,f=await $(l,a.name,d,t.labelStyle+`; font-weight: bold;`);if(d+=f+20,s){let e=await $(l,`${a.requirementId?`ID: ${a.requirementId}`:``}`,d,t.labelStyle);d+=e;let n=await $(l,`${a.text?`Text: ${a.text}`:``}`,d,t.labelStyle);d+=n;let r=await $(l,`${a.risk?`Risk: ${a.risk}`:``}`,d,t.labelStyle);d+=r,await $(l,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:``}`,d,t.labelStyle)}else{let e=await $(l,`${o.type?`Type: ${o.type}`:``}`,d,t.labelStyle);d+=e,await $(l,`${o.docRef?`Doc Ref: ${o.docRef}`:``}`,d,t.labelStyle)}let p=(l.node()?.getBBox().width??200)+20,m=(l.node()?.getBBox().height??200)+20,h=-p/2,g=-m/2,_=V.svg(l),b=v(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=_.rectangle(h,g,p,m,b),S=l.insert(()=>x,`:first-child`);if(S.attr(`class`,`basic label-container`).attr(`style`,i),l.selectAll(`.label`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]))}let c=s-m/2,l=h+20/2;(t===0||t===1)&&(l=o),i.attr(`transform`,`translate(${l}, ${c+20})`)}),d>u+f+20){let e=_.line(h,g+u+f+20,h+p,g+u+f+20,b);l.insert(()=>e).attr(`style`,i)}return U(t,S),t.intersect=function(e){return J.rect(t,e)},l}t(jn,`requirementBox`);async function $(e,t,r,i=``){if(t===``)return 0;let o=e.insert(`g`).attr(`class`,`label`).attr(`style`,i),s=c(),l=s.htmlLabels??!0,u=await S(o,a(m(t)),{width:g(t,s)+50,classes:`markdown-node-label`,useHtmlLabels:l,style:i},s),d;if(l){let e=u.children[0],t=n(u);d=e.getBoundingClientRect(),t.attr(`width`,d.width),t.attr(`height`,d.height)}else{let e=u.children[0];for(let t of e.children)t.textContent=t.textContent.replaceAll(`>`,`>`).replaceAll(`<`,`<`),i&&t.setAttribute(`style`,i);d=u.getBBox(),d.height+=6}return o.attr(`transform`,`translate(${-d.width/2},${-d.height/2+r})`),d.height}t($,`addText`);var Mn=t(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function Nn(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=y(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await H(e,t,W(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,m;d?{label:p,bbox:m}=await He(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:m}=await He(o,`ticket`in t&&t.ticket||``,f);let{label:h,bbox:g}=await He(o,`assigned`in t&&t.assigned||``,f);t.width=a;let _=t?.width||0,b=Math.max(m.height,g.height)/2,x=Math.max(s.height+20,t?.height||0)+b,S=-_/2,C=-x/2;c.attr(`transform`,`translate(`+(l-_/2)+`, `+(-b-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-_/2)+`, `+(-b+s.height/2)+`)`),h.attr(`transform`,`translate(`+(l+_/2-g.width-20)+`, `+(-b+s.height/2)+`)`);let w,{rx:T,ry:E}=t,{cssStyles:D}=t;if(t.look===`handDrawn`){let e=V.svg(o),n=v(t,{}),r=T||E?e.path(q(S,C,_,x,T||0),n):e.rectangle(S,C,_,x,n);w=o.insert(()=>r,`:first-child`),w.attr(`class`,`basic label-container`).attr(`style`,D||null)}else{w=o.insert(`rect`,`:first-child`),w.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,T??5).attr(`ry`,E??5).attr(`x`,S).attr(`y`,C).attr(`width`,_).attr(`height`,x);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=S+2,r=C+Math.floor((T??0)/2),i=C+x-Math.floor((T??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,Mn(e))}}return U(t,w),t.height=x,t.intersect=function(e){return J.rect(t,e)},o}t(Nn,`kanbanItem`);async function Pn(t,n){let{labelStyles:r,nodeStyles:i}=y(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await H(t,n,W(n)),l=o.width+10*s,u=o.height+8*s,d=.15*l,{cssStyles:f}=n,p=o.width+20,m=o.height+20,g=Math.max(l,p),_=Math.max(u,m);c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`);let b,x=`M0 0
|
|
12
|
+
a${d},${d} 1 0,0 ${g*.25},${-1*_*.1}
|
|
13
|
+
a${d},${d} 1 0,0 ${g*.25},0
|
|
14
|
+
a${d},${d} 1 0,0 ${g*.25},0
|
|
15
|
+
a${d},${d} 1 0,0 ${g*.25},${_*.1}
|
|
16
|
+
|
|
17
|
+
a${d},${d} 1 0,0 ${g*.15},${_*.33}
|
|
18
|
+
a${d*.8},${d*.8} 1 0,0 0,${_*.34}
|
|
19
|
+
a${d},${d} 1 0,0 ${-1*g*.15},${_*.33}
|
|
20
|
+
|
|
21
|
+
a${d},${d} 1 0,0 ${-1*g*.25},${_*.15}
|
|
22
|
+
a${d},${d} 1 0,0 ${-1*g*.25},0
|
|
23
|
+
a${d},${d} 1 0,0 ${-1*g*.25},0
|
|
24
|
+
a${d},${d} 1 0,0 ${-1*g*.25},${-1*_*.15}
|
|
25
|
+
|
|
26
|
+
a${d},${d} 1 0,0 ${-1*g*.1},${-1*_*.33}
|
|
27
|
+
a${d*.8},${d*.8} 1 0,0 0,${-1*_*.34}
|
|
28
|
+
a${d},${d} 1 0,0 ${g*.1},${-1*_*.33}
|
|
29
|
+
H0 V0 Z`;if(n.look===`handDrawn`){let e=V.svg(a),t=v(n,{}),r=e.path(x,t);b=a.insert(()=>r,`:first-child`),b.attr(`class`,`basic label-container`).attr(`style`,h(f))}else b=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,x);return b.attr(`transform`,`translate(${-g/2}, ${-_/2})`),U(n,b),n.calcIntersect=function(e,t){return J.rect(e,t)},n.intersect=function(t){return e.info(`Bang intersect`,n,t),J.rect(n,t)},a}t(Pn,`bang`);async function Fn(t,n){let{labelStyles:r,nodeStyles:i}=y(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await H(t,n,W(n)),l=o.width+2*s,u=o.height+2*s,d=.15*l,f=.25*l,p=.35*l,m=.2*l,{cssStyles:g}=n,_,b=`M0 0
|
|
30
|
+
a${d},${d} 0 0,1 ${l*.25},${-1*l*.1}
|
|
31
|
+
a${p},${p} 1 0,1 ${l*.4},${-1*l*.1}
|
|
32
|
+
a${f},${f} 1 0,1 ${l*.35},${l*.2}
|
|
33
|
+
|
|
34
|
+
a${d},${d} 1 0,1 ${l*.15},${u*.35}
|
|
35
|
+
a${m},${m} 1 0,1 ${-1*l*.15},${u*.65}
|
|
36
|
+
|
|
37
|
+
a${f},${d} 1 0,1 ${-1*l*.25},${l*.15}
|
|
38
|
+
a${p},${p} 1 0,1 ${-1*l*.5},0
|
|
39
|
+
a${d},${d} 1 0,1 ${-1*l*.25},${-1*l*.15}
|
|
40
|
+
|
|
41
|
+
a${d},${d} 1 0,1 ${-1*l*.1},${-1*u*.35}
|
|
42
|
+
a${m},${m} 1 0,1 ${l*.1},${-1*u*.65}
|
|
43
|
+
H0 V0 Z`;if(n.look===`handDrawn`){let e=V.svg(a),t=v(n,{}),r=e.path(b,t);_=a.insert(()=>r,`:first-child`),_.attr(`class`,`basic label-container`).attr(`style`,h(g))}else _=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,b);return c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`),_.attr(`transform`,`translate(${-l/2}, ${-u/2})`),U(n,_),n.calcIntersect=function(e,t){return J.rect(e,t)},n.intersect=function(t){return e.info(`Cloud intersect`,n,t),J.rect(n,t)},a}t(Fn,`cloud`);async function In(e,t){let{labelStyles:n,nodeStyles:r}=y(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await H(e,t,W(t)),c=a.width+8*o,l=a.height+2*o,u=`
|
|
44
|
+
M${-c/2} ${l/2-5}
|
|
45
|
+
v${-l+10}
|
|
46
|
+
q0,-5 5,-5
|
|
47
|
+
h${c-10}
|
|
48
|
+
q5,0 5,5
|
|
49
|
+
v${l-10}
|
|
50
|
+
q0,5 -5,5
|
|
51
|
+
h${-c+10}
|
|
52
|
+
q-5,0 -5,-5
|
|
53
|
+
Z
|
|
54
|
+
`,d=i.append(`path`).attr(`id`,`node-`+t.id).attr(`class`,`node-bkg node-`+t.type).attr(`style`,r).attr(`d`,u);return i.append(`line`).attr(`class`,`node-line-`).attr(`x1`,-c/2).attr(`y1`,l/2).attr(`x2`,c/2).attr(`y2`,l/2),s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>s.node()),U(t,d),t.calcIntersect=function(e,t){return J.rect(e,t)},t.intersect=function(e){return J.rect(t,e)},i}t(In,`defaultMindmapNode`);async function Ln(e,t){return mt(e,t,{padding:t.padding??0})}t(Ln,`mindmapCircle`);var Rn=[{semanticName:`Process`,name:`Rectangle`,shortName:`rect`,description:`Standard process shape`,aliases:[`proc`,`process`,`rectangle`],internalAliases:[`squareRect`],handler:sn},{semanticName:`Event`,name:`Rounded Rectangle`,shortName:`rounded`,description:`Represents an event`,aliases:[`event`],internalAliases:[`roundedRect`],handler:rn},{semanticName:`Terminal Point`,name:`Stadium`,shortName:`stadium`,description:`Terminal point`,aliases:[`terminal`,`pill`],handler:cn},{semanticName:`Subprocess`,name:`Framed Rectangle`,shortName:`fr-rect`,description:`Subprocess`,aliases:[`subprocess`,`subproc`,`framed-rectangle`,`subroutine`],handler:fn},{semanticName:`Database`,name:`Cylinder`,shortName:`cyl`,description:`Database storage`,aliases:[`db`,`database`,`cylinder`],handler:wt},{semanticName:`Start`,name:`Circle`,shortName:`circle`,description:`Starting point`,aliases:[`circ`],handler:mt},{semanticName:`Bang`,name:`Bang`,shortName:`bang`,description:`Bang`,aliases:[`bang`],handler:Pn},{semanticName:`Cloud`,name:`Cloud`,shortName:`cloud`,description:`cloud`,aliases:[`cloud`],handler:Fn},{semanticName:`Decision`,name:`Diamond`,shortName:`diam`,description:`Decision-making step`,aliases:[`decision`,`diamond`,`question`],handler:$t},{semanticName:`Prepare Conditional`,name:`Hexagon`,shortName:`hex`,description:`Preparation or condition step`,aliases:[`hexagon`,`prepare`],handler:jt},{semanticName:`Data Input/Output`,name:`Lean Right`,shortName:`lean-r`,description:`Represents input or output`,aliases:[`lean-right`,`in-out`],internalAliases:[`lean_right`],handler:Ht},{semanticName:`Data Input/Output`,name:`Lean Left`,shortName:`lean-l`,description:`Represents output or input`,aliases:[`lean-left`,`out-in`],internalAliases:[`lean_left`],handler:Vt},{semanticName:`Priority Action`,name:`Trapezoid Base Bottom`,shortName:`trap-b`,description:`Priority action`,aliases:[`priority`,`trapezoid-bottom`,`trapezoid`],handler:bn},{semanticName:`Manual Operation`,name:`Trapezoid Base Top`,shortName:`trap-t`,description:`Represents a manual task`,aliases:[`manual`,`trapezoid-top`,`inv-trapezoid`],internalAliases:[`inv_trapezoid`],handler:Rt},{semanticName:`Stop`,name:`Double Circle`,shortName:`dbl-circ`,description:`Represents a stop point`,aliases:[`double-circle`],internalAliases:[`doublecircle`],handler:Et},{semanticName:`Text Block`,name:`Text Block`,shortName:`text`,description:`Text block`,handler:hn},{semanticName:`Card`,name:`Notched Rectangle`,shortName:`notch-rect`,description:`Represents a card`,aliases:[`card`,`notched-rectangle`],handler:ft},{semanticName:`Lined/Shaded Process`,name:`Lined Rectangle`,shortName:`lin-rect`,description:`Lined process shape`,aliases:[`lined-rectangle`,`lined-process`,`lin-proc`,`shaded-process`],handler:an},{semanticName:`Start`,name:`Small Circle`,shortName:`sm-circ`,description:`Small starting point`,aliases:[`start`,`small-circle`],internalAliases:[`stateStart`],handler:dn},{semanticName:`Stop`,name:`Framed Circle`,shortName:`fr-circ`,description:`Stop point`,aliases:[`stop`,`framed-circle`],internalAliases:[`stateEnd`],handler:un},{semanticName:`Fork/Join`,name:`Filled Rectangle`,shortName:`fork`,description:`Fork or join in process flow`,aliases:[`join`],internalAliases:[`forkJoin`],handler:kt},{semanticName:`Collate`,name:`Hourglass`,shortName:`hourglass`,description:`Represents a collate operation`,aliases:[`hourglass`,`collate`],handler:Mt},{semanticName:`Comment`,name:`Curly Brace`,shortName:`brace`,description:`Adds a comment`,aliases:[`comment`,`brace-l`],handler:_t},{semanticName:`Comment Right`,name:`Curly Brace`,shortName:`brace-r`,description:`Adds a comment`,handler:vt},{semanticName:`Comment with braces on both sides`,name:`Curly Braces`,shortName:`braces`,description:`Adds a comment`,handler:yt},{semanticName:`Com Link`,name:`Lightning Bolt`,shortName:`bolt`,description:`Communication link`,aliases:[`com-link`,`lightning-bolt`],handler:Ut},{semanticName:`Document`,name:`Document`,shortName:`doc`,description:`Represents a document`,aliases:[`doc`,`document`],handler:Cn},{semanticName:`Delay`,name:`Half-Rounded Rectangle`,shortName:`delay`,description:`Represents a delay`,aliases:[`half-rounded-rectangle`],handler:At},{semanticName:`Direct Access Storage`,name:`Horizontal Cylinder`,shortName:`h-cyl`,description:`Direct access storage`,aliases:[`das`,`horizontal-cylinder`],handler:yn},{semanticName:`Disk Storage`,name:`Lined Cylinder`,shortName:`lin-cyl`,description:`Disk storage`,aliases:[`disk`,`lined-cylinder`],handler:qt},{semanticName:`Display`,name:`Curved Trapezoid`,shortName:`curv-trap`,description:`Represents a display`,aliases:[`curved-trapezoid`,`display`],handler:bt},{semanticName:`Divided Process`,name:`Divided Rectangle`,shortName:`div-rect`,description:`Divided process shape`,aliases:[`div-proc`,`divided-rectangle`,`divided-process`],handler:Tt},{semanticName:`Extract`,name:`Triangle`,shortName:`tri`,description:`Extraction process`,aliases:[`extract`,`triangle`],handler:Sn},{semanticName:`Internal Storage`,name:`Window Pane`,shortName:`win-pane`,description:`Internal storage`,aliases:[`internal-storage`,`window-pane`],handler:Tn},{semanticName:`Junction`,name:`Filled Circle`,shortName:`f-circ`,description:`Junction point`,aliases:[`junction`,`filled-circle`],handler:Dt},{semanticName:`Loop Limit`,name:`Trapezoidal Pentagon`,shortName:`notch-pent`,description:`Loop limit step`,aliases:[`loop-limit`,`notched-pentagon`],handler:xn},{semanticName:`Manual File`,name:`Flipped Triangle`,shortName:`flip-tri`,description:`Manual file operation`,aliases:[`manual-file`,`flipped-triangle`],handler:Ot},{semanticName:`Manual Input`,name:`Sloped Rectangle`,shortName:`sl-rect`,description:`Manual input step`,aliases:[`manual-input`,`sloped-rectangle`],handler:on},{semanticName:`Multi-Document`,name:`Stacked Document`,shortName:`docs`,description:`Multiple documents`,aliases:[`documents`,`st-doc`,`stacked-document`],handler:Xt},{semanticName:`Multi-Process`,name:`Stacked Rectangle`,shortName:`st-rect`,description:`Multiple processes`,aliases:[`procs`,`processes`,`stacked-rectangle`],handler:Yt},{semanticName:`Stored Data`,name:`Bow Tie Rectangle`,shortName:`bow-rect`,description:`Stored data`,aliases:[`stored-data`,`bow-tie-rectangle`],handler:dt},{semanticName:`Summary`,name:`Crossed Circle`,shortName:`cross-circ`,description:`Summary`,aliases:[`summary`,`crossed-circle`],handler:gt},{semanticName:`Tagged Document`,name:`Tagged Document`,shortName:`tag-doc`,description:`Tagged document`,aliases:[`tag-doc`,`tagged-document`],handler:mn},{semanticName:`Tagged Process`,name:`Tagged Rectangle`,shortName:`tag-rect`,description:`Tagged process`,aliases:[`tagged-rectangle`,`tag-proc`,`tagged-process`],handler:pn},{semanticName:`Paper Tape`,name:`Flag`,shortName:`flag`,description:`Paper tape`,aliases:[`paper-tape`],handler:wn},{semanticName:`Odd`,name:`Odd`,shortName:`odd`,description:`Odd shape`,internalAliases:[`rect_left_inv_arrow`],handler:en},{semanticName:`Lined Document`,name:`Lined Document`,shortName:`lin-doc`,description:`Lined document`,aliases:[`lined-document`],handler:Jt}],zn=t(()=>{let e=[...Object.entries({state:ln,choice:pt,note:Zt,rectWithTitle:tn,labelRect:Bt,iconSquare:It,iconCircle:Pt,icon:Nt,iconRounded:Ft,imageSquare:Lt,anchor:lt,kanbanItem:Nn,mindmapCircle:Ln,defaultMindmapNode:In,classBox:An,erBox:En,requirementBox:jn}),...Rn.flatMap(e=>[e.shortName,...`aliases`in e?e.aliases:[],...`internalAliases`in e?e.internalAliases:[]].map(t=>[t,e.handler]))];return Object.fromEntries(e)},`generateShapeMap`)();function Bn(e){return e in zn}t(Bn,`isValidShape`);var Vn=new Map;async function Hn(e,t,n){let r,i;t.shape===`rect`&&(t.rx&&t.ry?t.shape=`roundedRect`:t.shape=`squareRect`);let a=t.shape?zn[t.shape]:void 0;if(!a)throw Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;n.config.securityLevel===`sandbox`?o=`_top`:t.linkTarget&&(o=t.linkTarget||`_blank`),r=e.insert(`svg:a`).attr(`xlink:href`,t.link).attr(`target`,o??null),i=await a(r,t,n)}else i=await a(e,t,n),r=i;return t.tooltip&&i.attr(`title`,t.tooltip),Vn.set(t.id,r),t.haveCallback&&r.attr(`class`,r.attr(`class`)+` clickable`),r}t(Hn,`insertNode`);var Un=t((e,t)=>{Vn.set(t.id,e)},`setNodeElem`),Wn=t(()=>{Vn.clear()},`clear`),Gn=t(t=>{let n=Vn.get(t.id);e.trace(`Transforming node`,t.diff,t,`translate(`+(t.x-t.width/2-5)+`, `+t.width/2+`)`);let r=t.diff||0;return t.clusterNode?n.attr(`transform`,`translate(`+(t.x+r-t.width/2)+`, `+(t.y-t.height/2-8)+`)`):n.attr(`transform`,`translate(`+t.x+`, `+t.y+`)`),r},`positionNode`);export{Hn as a,Gn as c,V as d,Ze as i,Un as l,Wn as n,Bn as o,qe as r,H as s,Qe as t,U as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,g as t,h as n,i as r,m as i,o as a,p as o,s,t as c}from"./chunk-FPAJGGOC-DDHjQ09H.js";var l=class extends c{static{e(this,`InfoTokenBuilder`)}constructor(){super([`info`,`showInfo`])}},u={parser:{TokenBuilder:e(()=>new l,`TokenBuilder`),ValueConverter:e(()=>new r,`ValueConverter`)}};function d(e=o){let r=i(t(e),s),c=i(n({shared:r}),a,u);return r.ServiceRegistry.register(c),{shared:r,Info:c}}e(d,`createInfoServices`);export{d as n,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,g as t,h as n,i as r,m as i,p as a,s as o,t as s,u as c}from"./chunk-FPAJGGOC-DDHjQ09H.js";var l=class extends s{static{e(this,`RadarTokenBuilder`)}constructor(){super([`radar-beta`])}},u={parser:{TokenBuilder:e(()=>new l,`TokenBuilder`),ValueConverter:e(()=>new r,`ValueConverter`)}};function d(e=a){let r=i(t(e),o),s=i(n({shared:r}),c,u);return r.ServiceRegistry.register(s),{shared:r,Radar:s}}e(d,`createRadarServices`);export{d as n,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,g as t,h as n,m as r,n as i,p as a,r as o,s,t as c}from"./chunk-FPAJGGOC-DDHjQ09H.js";var l=class extends c{static{e(this,`ArchitectureTokenBuilder`)}constructor(){super([`architecture`])}},u=class extends i{static{e(this,`ArchitectureValueConverter`)}runCustomConverter(e,t,n){if(e.name===`ARCH_ICON`)return t.replace(/[()]/g,``).trim();if(e.name===`ARCH_TEXT_ICON`)return t.replace(/["()]/g,``);if(e.name===`ARCH_TITLE`)return t.replace(/[[\]]/g,``).trim()}},d={parser:{TokenBuilder:e(()=>new l,`TokenBuilder`),ValueConverter:e(()=>new u,`ValueConverter`)}};function f(e=a){let i=r(t(e),s),c=r(n({shared:i}),o,d);return i.ServiceRegistry.register(c),{shared:i,Architecture:c}}e(f,`createArchitectureServices`);export{f as n,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,h as t}from"./src-Buml7cM5.js";import{c as n}from"./chunk-ABZYJK2D-Dt4W53JI.js";var r=t((t,r,o,s)=>{t.attr(`class`,o);let{width:c,height:l,x:u,y:d}=i(t,r);n(t,l,c,s);let f=a(u,d,c,l,r);t.attr(`viewBox`,f),e.debug(`viewBox configured: ${f} with padding: ${r}`)},`setupViewPortForSVG`),i=t((e,t)=>{let n=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+t*2,height:n.height+t*2,x:n.x,y:n.y}},`calculateDimensionsWithPadding`),a=t((e,t,n,r,i)=>`${e-i} ${t-i} ${n} ${r}`,`createViewBox`);export{r as t};
|