@marimo-team/frontend 0.10.16-dev17 → 0.10.16-dev19
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/dist/assets/{ConnectedDataExplorerComponent-B76UwUtU.js → ConnectedDataExplorerComponent-BjQQClf-.js} +2 -2
- package/dist/assets/VegaLite-D63kFVaj.js +11 -0
- package/dist/assets/{_baseEach-Bpo7Ba8k.js → _baseEach-DWfv1RIO.js} +1 -1
- package/dist/assets/_baseMap-CBLPpHV0.js +1 -0
- package/dist/assets/{_baseUniq-7Y6INM9S.js → _baseUniq-AYx5k-51.js} +1 -1
- package/dist/assets/{any-language-editor-BOOqWPNZ.js → any-language-editor-Bp8tx-y3.js} +1 -1
- package/dist/assets/{arc-y9WbYkJu.js → arc-XdNuvsqn.js} +1 -1
- package/dist/assets/{architectureDiagram-IFBEXTG3-Qn1GhlZP.js → architectureDiagram-IFBEXTG3-IicJiKyd.js} +1 -1
- package/dist/assets/{blockDiagram-TCMKQVZ6-Cx85eT_w.js → blockDiagram-TCMKQVZ6-NSsyD1Sg.js} +1 -1
- package/dist/assets/{c4Diagram-ZCSEYPFN-chWrZd0T.js → c4Diagram-ZCSEYPFN-BN43TMtL.js} +1 -1
- package/dist/assets/channel-DsaS9tbd.js +1 -0
- package/dist/assets/{chunk-4LC2V6XN-uVqjneNA.js → chunk-4LC2V6XN-CXpVsyqQ.js} +1 -1
- package/dist/assets/{chunk-5RIWM3LS-CMREdtiO.js → chunk-5RIWM3LS-CkDm9xLJ.js} +1 -1
- package/dist/assets/{chunk-6JKP7OK7-BN_T2IRd.js → chunk-6JKP7OK7-sS-Nhjns.js} +1 -1
- package/dist/assets/{chunk-NGC4727B-Ck2BQyvs.js → chunk-NGC4727B-DykcMQSX.js} +1 -1
- package/dist/assets/{chunk-REEJFE46-CjeLLA_H.js → chunk-REEJFE46-DWM0GqfP.js} +1 -1
- package/dist/assets/{chunk-RYO7GUH3-CWQr3Aei.js → chunk-RYO7GUH3-CmFBhetC.js} +1 -1
- package/dist/assets/{chunk-V35ELUW5-DExqgCpd.js → chunk-V35ELUW5-ZsyzDEZj.js} +1 -1
- package/dist/assets/{classDiagram-Q73GJZWF-CTbWz-3U.js → classDiagram-Q73GJZWF-CbPjM6rN.js} +1 -1
- package/dist/assets/{classDiagram-v2-C6QPLPW4-rnyqKNZi.js → classDiagram-v2-C6QPLPW4-CkD9KnlX.js} +1 -1
- package/dist/assets/clone-DCR3feb6.js +1 -0
- package/dist/assets/{cobol-DJhTY0fG.js → cobol-DbZRNMTs.js} +1 -1
- package/dist/assets/compile-Ertd3OkE.js +1 -0
- package/dist/assets/createWsUrl-AYnQqPDo.js +1 -0
- package/dist/assets/{cytoscape.esm-DXieaT54.js → cytoscape.esm-BOa7ANXG.js} +1 -1
- package/dist/assets/{dagre-7KT5K2WU-DeJ_CULU.js → dagre-7KT5K2WU-DnC0beaD.js} +1 -1
- package/dist/assets/data-editor-0-_VKSE0.js +1 -0
- package/dist/assets/{diagram-AVGMFHF7-DOUVO520.js → diagram-AVGMFHF7-CQCtRGUj.js} +1 -1
- package/dist/assets/edit-page-DVUv_esw.js +14 -0
- package/dist/assets/{erDiagram-DKC2X5TE-FtPNBK6d.js → erDiagram-DKC2X5TE-DlGoPDJk.js} +1 -1
- package/dist/assets/{flowDiagram-NWEUNK3L-CLZbqt_N.js → flowDiagram-NWEUNK3L-MTNnALh7.js} +1 -1
- package/dist/assets/{ganttDiagram-HLVPPPRE-D5xLaO7S.js → ganttDiagram-HLVPPPRE-B9K73XjK.js} +1 -1
- package/dist/assets/gitGraph-YCYPL57B-CD_vrwaX.js +1 -0
- package/dist/assets/{gitGraphDiagram-JPZ3KUXI-DXjKP97z.js → gitGraphDiagram-JPZ3KUXI-CzJfNI0f.js} +1 -1
- package/dist/assets/{graph-BJMPcPMm.js → graph-DtKBQTHU.js} +1 -1
- package/dist/assets/{home-page-B2n0xuBJ.js → home-page-gzUWx7CP.js} +1 -1
- package/dist/assets/{index-C7qMWXkd.js → index-31MhAhLq.js} +1 -1
- package/dist/assets/{index-CyxPejx7.js → index-9GF9SIRv.js} +1 -1
- package/dist/assets/{index-_fSQ_NrG.js → index-B4MgFPB6.js} +1 -1
- package/dist/assets/{index-DpdBqGdx.js → index-B7bbqzaX.js} +1 -1
- package/dist/assets/{index-BJ-tyqrz.js → index-BQX5nLR_.js} +1 -1
- package/dist/assets/{index-BajaTnHs.js → index-BXKtzTR_.js} +1 -1
- package/dist/assets/{index-BourxBWi.js → index-BfOP5u0W.js} +1 -1
- package/dist/assets/{index-DL2RB-iH.js → index-CGCc0s_K.js} +1 -1
- package/dist/assets/{index-BzJeRk6P.js → index-CGVA-TS4.js} +1 -1
- package/dist/assets/{index-x3KmXs1A.js → index-Cv0PzaNI.js} +1 -1
- package/dist/assets/{index-Cy13fwh6.js → index-Cyu5waIO.js} +1 -1
- package/dist/assets/index-DHvEsXpq.js +79 -0
- package/dist/assets/{index-BN41UsiL.js → index-DXyF-Gdi.js} +1 -1
- package/dist/assets/{index-VjOkphRG.js → index-DbipcVuQ.js} +1 -1
- package/dist/assets/{index-CTxiruaa.js → index-DfHmNL2V.js} +1 -1
- package/dist/assets/{index-D_jj5huT.js → index-bU7yWk1o.js} +1 -1
- package/dist/assets/{index-DT9T5cyP.js → index-wCgX5InV.js} +1 -1
- package/dist/assets/{infoDiagram-RZZSJVI2-BoxTVSaS.js → infoDiagram-RZZSJVI2-BLrZ5i5Y.js} +1 -1
- package/dist/assets/{journeyDiagram-BLD6N6MZ-IZukYC3N.js → journeyDiagram-BLD6N6MZ-CJ65LzQN.js} +1 -1
- package/dist/assets/{json-CDiSxpmr.js → json-YlFhVUTY.js} +1 -1
- package/dist/assets/layout-BHVPCwYv.js +1 -0
- package/dist/assets/{linear-Co84cCtT.js → linear-DQeX4Pp_.js} +1 -1
- package/dist/assets/livescript-HO6ttBFx.js +1 -0
- package/dist/assets/main-DPWVgc5Y.js +1 -0
- package/dist/assets/mermaid-COzbSDFn.js +13 -0
- package/dist/assets/{min-DCsYMRaP.js → min-JiMDlEwz.js} +1 -1
- package/dist/assets/{mindmap-definition-OEB2RXX2-D1opBvTd.js → mindmap-definition-OEB2RXX2-WUNnuJg_.js} +1 -1
- package/dist/assets/{mirc-DkvFAiy5.js → mirc-1Vs7mkDM.js} +1 -1
- package/dist/assets/{pieDiagram-X7YZ5ZEZ-DYgdaD3n.js → pieDiagram-X7YZ5ZEZ-BfX7rmEa.js} +1 -1
- package/dist/assets/{pig-CwGJVRC4.js → pig-C9krdGUD.js} +1 -1
- package/dist/assets/{quadrantDiagram-F36EZAVT-ZSEhCjxb.js → quadrantDiagram-F36EZAVT-BsyFzy9x.js} +1 -1
- package/dist/assets/react-plotly-DUK_pf22.js +71 -0
- package/dist/assets/{requirementDiagram-JG2LMPGF-lfoKuhuP.js → requirementDiagram-JG2LMPGF-7NoYKw25.js} +1 -1
- package/dist/assets/{run-page-C7dokzaL.js → run-page-DoDY6UBo.js} +1 -1
- package/dist/assets/{sankeyDiagram-ATFNWWW6-D7C5vqOz.js → sankeyDiagram-ATFNWWW6-lN95QVee.js} +1 -1
- package/dist/assets/save-worker-8bKai79t.js +1 -0
- package/dist/assets/{scheme-qjP0V5Ag.js → scheme-DlxeS-fJ.js} +1 -1
- package/dist/assets/{sequenceDiagram-WK7YDQ3N-Ma_7nH1h.js → sequenceDiagram-WK7YDQ3N-S8tJv-wv.js} +1 -1
- package/dist/assets/{slides-component-Cw5mnYLx.js → slides-component-C1YhRmWa.js} +1 -1
- package/dist/assets/{sortBy-CriEdJ3o.js → sortBy-Mll4DSdK.js} +1 -1
- package/dist/assets/{stateDiagram-4JV6CC6H-KfE8ILxc.js → stateDiagram-4JV6CC6H-F7zNPGaN.js} +1 -1
- package/dist/assets/stateDiagram-v2-7KT6RKTD-Lmjwe_e4.js +1 -0
- package/dist/assets/{step-DY8hpDjU.js → step-CjxFKgSe.js} +1 -1
- package/dist/assets/{tcl-B2fODqDH.js → tcl-BWtglvHf.js} +1 -1
- package/dist/assets/{terminal-paxzyrF8.js → terminal-wlLAdd7u.js} +1 -1
- package/dist/assets/{time-Duw7TTDF.js → time-BFDapKfT.js} +1 -1
- package/dist/assets/{timeline-definition-3ZMEY6HS--j2BtHPJ.js → timeline-definition-3ZMEY6HS-MRGFKEJn.js} +1 -1
- package/dist/assets/{transform-C6EuPmuu.js → transform-BZgIUWgO.js} +1 -1
- package/dist/assets/tree-DJxPLg5B.js +14 -0
- package/dist/assets/ttcn-BXRxJEWs.js +1 -0
- package/dist/assets/useMarimoWebSocket-CNdDRymh.js +21 -0
- package/dist/assets/{vega-component-CwQ2yZLR.js → vega-component-BIssJpP5.js} +1 -1
- package/dist/assets/velocity-Bo4HNIcG.js +1 -0
- package/dist/assets/worker-ByJ8QhEE.js +1 -0
- package/dist/assets/worker-DK2GD4A8.js +1 -0
- package/dist/assets/{xychartDiagram-KECQ2H5Q-Dn1XattK.js → xychartDiagram-KECQ2H5Q-B_pBhsI6.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/VegaLite-wVGtQlq4.js +0 -11
- package/dist/assets/_baseMap-Deq4nLP1.js +0 -1
- package/dist/assets/channel-50f5ziCi.js +0 -1
- package/dist/assets/clone-DAPg2en_.js +0 -1
- package/dist/assets/compile-DPnzoogc.js +0 -1
- package/dist/assets/createWsUrl-DjqUlIW9.js +0 -1
- package/dist/assets/data-editor-kLg6UYhZ.js +0 -1
- package/dist/assets/edit-page-Du2X9cco.js +0 -14
- package/dist/assets/gitGraph-YCYPL57B-BuB3YGQ0.js +0 -1
- package/dist/assets/index-H_VRvUbH.js +0 -79
- package/dist/assets/layout-DdjPWCee.js +0 -1
- package/dist/assets/livescript-B19OIWEP.js +0 -1
- package/dist/assets/main-cdvIQCIX.js +0 -1
- package/dist/assets/mermaid-C0xJWrUT.js +0 -13
- package/dist/assets/react-plotly-BKrJN_kL.js +0 -71
- package/dist/assets/save-worker-CYi-EYGO.js +0 -1
- package/dist/assets/stateDiagram-v2-7KT6RKTD-BuWtp4HA.js +0 -1
- package/dist/assets/tree-sW4LXRfG.js +0 -14
- package/dist/assets/ttcn-C4reStyN.js +0 -1
- package/dist/assets/useMarimoWebSocket-D0Z78Ctp.js +0 -21
- package/dist/assets/velocity-BdD_26Jv.js +0 -1
- package/dist/assets/worker-C3i7jBDW.js +0 -1
- package/dist/assets/worker-NmomTmKk.js +0 -1
- /package/dist/assets/{edit-page-C05ExoCW.css → edit-page-BhKrBab5.css} +0 -0
- /package/dist/assets/{index-B7vPtAsU.css → index-tuE_24FF.css} +0 -0
- /package/dist/assets/{slides-component-DgTqb5fJ.css → slides-component-CD4qq_xs.css} +0 -0
- /package/dist/assets/{terminal-Bylkn-Y1.css → terminal-WibgYtSD.css} +0 -0
- /package/dist/assets/{tree-C6JGL_Wo.css → tree-BQGO22dn.css} +0 -0
- /package/dist/assets/{useMarimoWebSocket-D4wG0iNK.css → useMarimoWebSocket-CYiIF7o8.css} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,d as e,s as i,g as n,c as r,b as s,l as a,t as o,j as l,e as h}from"./mermaid-C0xJWrUT.js";import{s as c}from"./transform-C6EuPmuu.js";import{G as u}from"./graph-BJMPcPMm.js";import{l as d}from"./layout-DdjPWCee.js";import{l as p}from"./step-DY8hpDjU.js";import"./index-H_VRvUbH.js";import"./_baseUniq-7Y6INM9S.js";import"./_baseEach-Bpo7Ba8k.js";import"./min-DCsYMRaP.js";import"./_baseMap-Deq4nLP1.js";import"./sortBy-CriEdJ3o.js";var y=function(){var e=t((function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i}),"o"),i=[1,3],n=[1,4],r=[1,5],s=[1,6],a=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],o=[1,18],l=[2,7],h=[1,22],c=[1,23],u=[1,24],d=[1,25],p=[1,26],y=[1,27],_=[1,20],g=[1,28],E=[1,29],m=[62,63],R=[5,8,9,11,13,31,32,33,34,35,36,44,51,53,62,63],f=[1,47],I=[1,48],S=[1,49],b=[1,50],N=[1,51],T=[1,52],k=[1,53],x=[53,54],A=[1,64],w=[1,60],q=[1,61],v=[1,62],$=[1,63],O=[1,65],L=[1,69],C=[1,70],M=[1,67],F=[1,68],D=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],P={trace:t((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,requirementType:17,requirementName:18,STRUCT_START:19,requirementBody:20,ID:21,COLONSEP:22,id:23,TEXT:24,text:25,RISK:26,riskLevel:27,VERIFYMTHD:28,verifyType:29,STRUCT_STOP:30,REQUIREMENT:31,FUNCTIONAL_REQUIREMENT:32,INTERFACE_REQUIREMENT:33,PERFORMANCE_REQUIREMENT:34,PHYSICAL_REQUIREMENT:35,DESIGN_CONSTRAINT:36,LOW_RISK:37,MED_RISK:38,HIGH_RISK:39,VERIFY_ANALYSIS:40,VERIFY_DEMONSTRATION:41,VERIFY_INSPECTION:42,VERIFY_TEST:43,ELEMENT:44,elementName:45,elementBody:46,TYPE:47,type:48,DOCREF:49,ref:50,END_ARROW_L:51,relationship:52,LINE:53,END_ARROW_R:54,CONTAINS:55,COPIES:56,DERIVES:57,SATISFIES:58,VERIFIES:59,REFINES:60,TRACES:61,unqString:62,qString:63,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",19:"STRUCT_START",21:"ID",22:"COLONSEP",24:"TEXT",26:"RISK",28:"VERIFYMTHD",30:"STRUCT_STOP",31:"REQUIREMENT",32:"FUNCTIONAL_REQUIREMENT",33:"INTERFACE_REQUIREMENT",34:"PERFORMANCE_REQUIREMENT",35:"PHYSICAL_REQUIREMENT",36:"DESIGN_CONSTRAINT",37:"LOW_RISK",38:"MED_RISK",39:"HIGH_RISK",40:"VERIFY_ANALYSIS",41:"VERIFY_DEMONSTRATION",42:"VERIFY_INSPECTION",43:"VERIFY_TEST",44:"ELEMENT",47:"TYPE",49:"DOCREF",51:"END_ARROW_L",53:"LINE",54:"END_ARROW_R",55:"CONTAINS",56:"COPIES",57:"DERIVES",58:"SATISFIES",59:"VERIFIES",60:"REFINES",61:"TRACES",62:"unqString",63:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[14,5],[20,5],[20,5],[20,5],[20,5],[20,2],[20,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[27,1],[27,1],[27,1],[29,1],[29,1],[29,1],[29,1],[15,5],[46,5],[46,5],[46,2],[46,1],[16,5],[16,5],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[18,1],[18,1],[23,1],[23,1],[25,1],[25,1],[45,1],[45,1],[48,1],[48,1],[50,1],[50,1]],performAction:t((function(t,e,i,n,r,s,a){var o=s.length-1;switch(r){case 4:this.$=s[o].trim(),n.setAccTitle(this.$);break;case 5:case 6:this.$=s[o].trim(),n.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:n.addRequirement(s[o-3],s[o-4]);break;case 14:n.setNewReqId(s[o-2]);break;case 15:n.setNewReqText(s[o-2]);break;case 16:n.setNewReqRisk(s[o-2]);break;case 17:n.setNewReqVerifyMethod(s[o-2]);break;case 20:this.$=n.RequirementType.REQUIREMENT;break;case 21:this.$=n.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=n.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=n.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=n.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=n.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=n.RiskLevel.LOW_RISK;break;case 27:this.$=n.RiskLevel.MED_RISK;break;case 28:this.$=n.RiskLevel.HIGH_RISK;break;case 29:this.$=n.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=n.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=n.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=n.VerifyType.VERIFY_TEST;break;case 33:n.addElement(s[o-3]);break;case 34:n.setNewElementType(s[o-2]);break;case 35:n.setNewElementDocRef(s[o-2]);break;case 38:n.addRelationship(s[o-2],s[o],s[o-4]);break;case 39:n.addRelationship(s[o-2],s[o-4],s[o]);break;case 40:this.$=n.Relationships.CONTAINS;break;case 41:this.$=n.Relationships.COPIES;break;case 42:this.$=n.Relationships.DERIVES;break;case 43:this.$=n.Relationships.SATISFIES;break;case 44:this.$=n.Relationships.VERIFIES;break;case 45:this.$=n.Relationships.REFINES;break;case 46:this.$=n.Relationships.TRACES}}),"anonymous"),table:[{3:1,4:2,6:i,9:n,11:r,13:s},{1:[3]},{3:8,4:2,5:[1,7],6:i,9:n,11:r,13:s},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:i,9:n,11:r,13:s},{1:[2,2]},{4:17,5:o,7:13,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,30]},{4:17,5:o,7:31,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:32,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:33,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:34,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:35,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{18:36,62:[1,37],63:[1,38]},{45:39,62:[1,40],63:[1,41]},{51:[1,42],53:[1,43]},e(m,[2,20]),e(m,[2,21]),e(m,[2,22]),e(m,[2,23]),e(m,[2,24]),e(m,[2,25]),e(R,[2,49]),e(R,[2,50]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{19:[1,44]},{19:[2,47]},{19:[2,48]},{19:[1,45]},{19:[2,53]},{19:[2,54]},{52:46,55:f,56:I,57:S,58:b,59:N,60:T,61:k},{52:54,55:f,56:I,57:S,58:b,59:N,60:T,61:k},{5:[1,55]},{5:[1,56]},{53:[1,57]},e(x,[2,40]),e(x,[2,41]),e(x,[2,42]),e(x,[2,43]),e(x,[2,44]),e(x,[2,45]),e(x,[2,46]),{54:[1,58]},{5:A,20:59,21:w,24:q,26:v,28:$,30:O},{5:L,30:C,46:66,47:M,49:F},{23:71,62:g,63:E},{23:72,62:g,63:E},e(D,[2,13]),{22:[1,73]},{22:[1,74]},{22:[1,75]},{22:[1,76]},{5:A,20:77,21:w,24:q,26:v,28:$,30:O},e(D,[2,19]),e(D,[2,33]),{22:[1,78]},{22:[1,79]},{5:L,30:C,46:80,47:M,49:F},e(D,[2,37]),e(D,[2,38]),e(D,[2,39]),{23:81,62:g,63:E},{25:82,62:[1,83],63:[1,84]},{27:85,37:[1,86],38:[1,87],39:[1,88]},{29:89,40:[1,90],41:[1,91],42:[1,92],43:[1,93]},e(D,[2,18]),{48:94,62:[1,95],63:[1,96]},{50:97,62:[1,98],63:[1,99]},e(D,[2,36]),{5:[1,100]},{5:[1,101]},{5:[2,51]},{5:[2,52]},{5:[1,102]},{5:[2,26]},{5:[2,27]},{5:[2,28]},{5:[1,103]},{5:[2,29]},{5:[2,30]},{5:[2,31]},{5:[2,32]},{5:[1,104]},{5:[2,55]},{5:[2,56]},{5:[1,105]},{5:[2,57]},{5:[2,58]},{5:A,20:106,21:w,24:q,26:v,28:$,30:O},{5:A,20:107,21:w,24:q,26:v,28:$,30:O},{5:A,20:108,21:w,24:q,26:v,28:$,30:O},{5:A,20:109,21:w,24:q,26:v,28:$,30:O},{5:L,30:C,46:110,47:M,49:F},{5:L,30:C,46:111,47:M,49:F},e(D,[2,14]),e(D,[2,15]),e(D,[2,16]),e(D,[2,17]),e(D,[2,34]),e(D,[2,35])],defaultActions:{8:[2,2],12:[2,1],30:[2,3],31:[2,8],32:[2,9],33:[2,10],34:[2,11],35:[2,12],37:[2,47],38:[2,48],40:[2,53],41:[2,54],83:[2,51],84:[2,52],86:[2,26],87:[2,27],88:[2,28],90:[2,29],91:[2,30],92:[2,31],93:[2,32],95:[2,55],96:[2,56],98:[2,57],99:[2,58]},parseError:t((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:t((function(e){var i=this,n=[0],r=[],s=[null],a=[],o=this.table,l="",h=0,c=0,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);d.setInput(e,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var _=d.yylloc;a.push(_);var g=d.options&&d.options.ranges;function E(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t((function(t){n.length=n.length-2*t,s.length=s.length-t,a.length=a.length-t}),"popStack"),t(E,"lex");for(var m,R,f,I,S,b,N,T,k={};;){if(R=n[n.length-1],this.defaultActions[R]?f=this.defaultActions[R]:(null==m&&(m=E()),f=o[R]&&o[R][m]),void 0===f||!f.length||!f[0]){var x="";for(S in T=[],o[R])this.terminals_[S]&&S>2&&T.push("'"+this.terminals_[S]+"'");x=d.showPosition?"Parse error on line "+(h+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(x,{text:d.match,token:this.terminals_[m]||m,line:d.yylineno,loc:_,expected:T})}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+m);switch(f[0]){case 1:n.push(m),s.push(d.yytext),a.push(d.yylloc),n.push(f[1]),m=null,c=d.yyleng,l=d.yytext,h=d.yylineno,_=d.yylloc;break;case 2:if(b=this.productions_[f[1]][1],k.$=s[s.length-b],k._$={first_line:a[a.length-(b||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(b||1)].first_column,last_column:a[a.length-1].last_column},g&&(k._$.range=[a[a.length-(b||1)].range[0],a[a.length-1].range[1]]),void 0!==(I=this.performAction.apply(k,[l,c,h,p.yy,f[1],s,a].concat(u))))return I;b&&(n=n.slice(0,-1*b*2),s=s.slice(0,-1*b),a=a.slice(0,-1*b)),n.push(this.productions_[f[1]][0]),s.push(k.$),a.push(k._$),N=o[n[n.length-2]][n[n.length-1]],n.push(N);break;case 3:return!0}}return!0}),"parse")},V=function(){return{EOF:1,parseError:t((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:t((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:t((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:t((function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:t((function(){return this._more=!0,this}),"more"),reject:t((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:t((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:t((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:t((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:t((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:t((function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1}),"test_match"),next:t((function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((i=this._input.match(this.rules[r[s]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:t((function(){var t=this.next();return t||this.lex()}),"lex"),begin:t((function(t){this.conditionStack.push(t)}),"begin"),popState:t((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:t((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:t((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:t((function(t){this.begin(t)}),"pushState"),stateStackSize:t((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:t((function(t,e,i,n){switch(i){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 48:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 5;case 9:case 10:case 11:break;case 12:return 8;case 13:return 6;case 14:return 19;case 15:return 30;case 16:return 22;case 17:return 21;case 18:return 24;case 19:return 26;case 20:return 28;case 21:return 31;case 22:return 32;case 23:return 33;case 24:return 34;case 25:return 35;case 26:return 36;case 27:return 37;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 41;case 32:return 42;case 33:return 43;case 34:return 44;case 35:return 55;case 36:return 56;case 37:return 57;case 38:return 58;case 39:return 59;case 40:return 60;case 41:return 61;case 42:return 47;case 43:return 49;case 44:return 51;case 45:return 54;case 46:return 53;case 47:this.begin("string");break;case 49:return"qString";case 50:return e.yytext=e.yytext.trim(),62}}),"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[48,49],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,50],inclusive:!0}}}}();function U(){this.yy={}}return P.lexer=V,t(U,"Parser"),U.prototype=P,P.Parser=U,new U}();y.parser=y;var _=y,g=[],E={},m=new Map,R={},f=new Map,I=t(((t,e)=>(m.has(t)||m.set(t,{name:t,type:e,id:E.id,text:E.text,risk:E.risk,verifyMethod:E.verifyMethod}),E={},m.get(t))),"addRequirement"),S=t((()=>m),"getRequirements"),b=t((t=>{void 0!==E&&(E.id=t)}),"setNewReqId"),N=t((t=>{void 0!==E&&(E.text=t)}),"setNewReqText"),T=t((t=>{void 0!==E&&(E.risk=t)}),"setNewReqRisk"),k=t((t=>{void 0!==E&&(E.verifyMethod=t)}),"setNewReqVerifyMethod"),x=t((t=>(f.has(t)||(f.set(t,{name:t,type:R.type,docRef:R.docRef}),a.info("Added new requirement: ",t)),R={},f.get(t))),"addElement"),A=t((()=>f),"getElements"),w=t((t=>{void 0!==R&&(R.type=t)}),"setNewElementType"),q=t((t=>{void 0!==R&&(R.docRef=t)}),"setNewElementDocRef"),v=t(((t,e,i)=>{g.push({type:t,src:e,dst:i})}),"addRelationship"),$=t((()=>g),"getRelationships"),O=t((()=>{g=[],E={},m=new Map,R={},f=new Map,o()}),"clear"),L={RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},getConfig:t((()=>e().req),"getConfig"),addRequirement:I,getRequirements:S,setNewReqId:b,setNewReqText:N,setNewReqRisk:T,setNewReqVerifyMethod:k,setAccTitle:i,getAccTitle:n,setAccDescription:r,getAccDescription:s,addElement:x,getElements:A,setNewElementType:w,setNewElementDocRef:q,addRelationship:v,getRelationships:$,clear:O},C=t((t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n\n`),"getStyles"),M={CONTAINS:"contains",ARROW:"arrow"},F={ReqMarkers:M,insertLineEndings:t(((t,e)=>{let i=t.append("defs").append("marker").attr("id",M.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");i.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),i.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),i.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",M.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n L${e.line_height},${e.line_height/2}\n M${e.line_height},${e.line_height/2}\n L0,${e.line_height}`).attr("stroke-width",1)}),"insertLineEndings")},D={},P=0,V=t(((t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",D.rect_min_width+"px").attr("height",D.rect_min_height+"px")),"newRectNode"),U=t(((t,e,i)=>{let n=D.rect_min_width/2,r=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",n).attr("y",D.rect_padding).attr("dominant-baseline","hanging"),s=0;i.forEach((t=>{0==s?r.append("tspan").attr("text-anchor","middle").attr("x",D.rect_min_width/2).attr("dy",0).text(t):r.append("tspan").attr("text-anchor","middle").attr("x",D.rect_min_width/2).attr("dy",.75*D.line_height).text(t),s++}));let a=1.5*D.rect_padding+s*D.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",D.rect_min_width).attr("y1",a).attr("y2",a),{titleNode:r,y:a}}),"newTitleNode"),Y=t(((t,e,i,n)=>{let r=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",D.rect_padding).attr("y",n).attr("dominant-baseline","hanging"),s=0;let a=[];return i.forEach((t=>{let e=t.length;for(;e>30&&s<3;){let i=t.substring(0,30);e=(t=t.substring(30,t.length)).length,a[a.length]=i,s++}if(3==s){let t=a[a.length-1];a[a.length-1]=t.substring(0,t.length-4)+"..."}else a[a.length]=t;s=0})),a.forEach((t=>{r.append("tspan").attr("x",D.rect_padding).attr("dy",D.line_height).text(t)})),r}),"newBodyNode"),B=t(((t,e,i,n)=>{const r=e.node().getTotalLength(),s=e.node().getPointAtLength(.5*r),a="rel"+P;P++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",a).attr("x",s.x).attr("y",s.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(n).node().getBBox();t.insert("rect","#"+a).attr("class","req reqLabelBox").attr("x",s.x-o.width/2).attr("y",s.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")}),"addEdgeLabel"),j=t((function(t,e,i,n,r){const s=i.edge(G(e.src),G(e.dst)),a=p().x((function(t){return t.x})).y((function(t){return t.y})),o=t.insert("path","#"+n).attr("class","er relationshipLine").attr("d",a(s.points)).attr("fill","none");e.type==r.db.Relationships.CONTAINS?o.attr("marker-start","url("+h.getUrl(D.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+h.getUrl(D.arrowMarkerAbsolute)+"#"+F.ReqMarkers.ARROW+"_line_ending)")),B(t,o,D,`<<${e.type}>>`)}),"drawRelationshipFromLayout"),Q=t(((t,e,i)=>{t.forEach(((t,n)=>{n=G(n),a.info("Added new requirement: ",n);const r=i.append("g").attr("id",n),s=V(r,"req-"+n);let o=[],l=U(r,n+"_title",[`<<${t.type}>>`,`${t.name}`]);o.push(l.titleNode);let h=Y(r,n+"_body",[`Id: ${t.id}`,`Text: ${t.text}`,`Risk: ${t.risk}`,`Verification: ${t.verifyMethod}`],l.y);o.push(h);const c=s.node().getBBox();e.setNode(n,{width:c.width,height:c.height,shape:"rect",id:n})}))}),"drawReqs"),H=t(((t,e,i)=>{t.forEach(((t,n)=>{const r=G(n),s=i.append("g").attr("id",r),a="element-"+r,o=V(s,a);let l=[],h=U(s,a+"_title",["<<Element>>",`${n}`]);l.push(h.titleNode);let c=Y(s,a+"_body",[`Type: ${t.type||"Not Specified"}`,`Doc Ref: ${t.docRef||"None"}`],h.y);l.push(c);const u=o.node().getBBox();e.setNode(r,{width:u.width,height:u.height,shape:"rect",id:r})}))}),"drawElements"),W=t(((t,e)=>(t.forEach((function(t){let i=G(t.src),n=G(t.dst);e.setEdge(i,n,{relationship:t})})),t)),"addRelationships"),K=t((function(t,e){e.nodes().forEach((function(i){void 0!==i&&void 0!==e.node(i)&&(t.select("#"+i),t.select("#"+i).attr("transform","translate("+(e.node(i).x-e.node(i).width/2)+","+(e.node(i).y-e.node(i).height/2)+" )"))}))}),"adjustEntities"),G=t((t=>t.replace(/\s/g,"").replace(/\./g,"_")),"elementString"),z={parser:_,db:L,renderer:{draw:t(((t,i,n,r)=>{const s=(D=e().requirement).securityLevel;let a;"sandbox"===s&&(a=c("#i"+i));const o=c("sandbox"===s?a.nodes()[0].contentDocument.body:"body").select(`[id='${i}']`);F.insertLineEndings(o,D);const h=new u({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:D.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));let p=r.db.getRequirements(),y=r.db.getElements(),_=r.db.getRelationships();Q(p,h,o),H(y,h,o),W(_,h),d(h),K(o,h),_.forEach((function(t){j(o,t,h,i,r)}));const g=D.rect_padding,E=o.node().getBBox(),m=E.width+2*g,R=E.height+2*g;l(o,R,m,D.useMaxWidth),o.attr("viewBox",`${E.x-g} ${E.y-g} ${m} ${R}`)}),"draw")},styles:C};export{z as diagram};
|
|
1
|
+
import{_ as t,d as e,s as i,g as n,c as r,b as s,l as a,t as o,j as l,e as h}from"./mermaid-COzbSDFn.js";import{s as c}from"./transform-BZgIUWgO.js";import{G as u}from"./graph-DtKBQTHU.js";import{l as d}from"./layout-BHVPCwYv.js";import{l as p}from"./step-CjxFKgSe.js";import"./index-DHvEsXpq.js";import"./_baseUniq-AYx5k-51.js";import"./_baseEach-DWfv1RIO.js";import"./min-JiMDlEwz.js";import"./_baseMap-CBLPpHV0.js";import"./sortBy-Mll4DSdK.js";var y=function(){var e=t((function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i}),"o"),i=[1,3],n=[1,4],r=[1,5],s=[1,6],a=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],o=[1,18],l=[2,7],h=[1,22],c=[1,23],u=[1,24],d=[1,25],p=[1,26],y=[1,27],_=[1,20],g=[1,28],E=[1,29],m=[62,63],R=[5,8,9,11,13,31,32,33,34,35,36,44,51,53,62,63],f=[1,47],I=[1,48],S=[1,49],b=[1,50],N=[1,51],T=[1,52],k=[1,53],x=[53,54],A=[1,64],w=[1,60],q=[1,61],v=[1,62],$=[1,63],O=[1,65],L=[1,69],C=[1,70],M=[1,67],F=[1,68],D=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],P={trace:t((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,requirementType:17,requirementName:18,STRUCT_START:19,requirementBody:20,ID:21,COLONSEP:22,id:23,TEXT:24,text:25,RISK:26,riskLevel:27,VERIFYMTHD:28,verifyType:29,STRUCT_STOP:30,REQUIREMENT:31,FUNCTIONAL_REQUIREMENT:32,INTERFACE_REQUIREMENT:33,PERFORMANCE_REQUIREMENT:34,PHYSICAL_REQUIREMENT:35,DESIGN_CONSTRAINT:36,LOW_RISK:37,MED_RISK:38,HIGH_RISK:39,VERIFY_ANALYSIS:40,VERIFY_DEMONSTRATION:41,VERIFY_INSPECTION:42,VERIFY_TEST:43,ELEMENT:44,elementName:45,elementBody:46,TYPE:47,type:48,DOCREF:49,ref:50,END_ARROW_L:51,relationship:52,LINE:53,END_ARROW_R:54,CONTAINS:55,COPIES:56,DERIVES:57,SATISFIES:58,VERIFIES:59,REFINES:60,TRACES:61,unqString:62,qString:63,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",19:"STRUCT_START",21:"ID",22:"COLONSEP",24:"TEXT",26:"RISK",28:"VERIFYMTHD",30:"STRUCT_STOP",31:"REQUIREMENT",32:"FUNCTIONAL_REQUIREMENT",33:"INTERFACE_REQUIREMENT",34:"PERFORMANCE_REQUIREMENT",35:"PHYSICAL_REQUIREMENT",36:"DESIGN_CONSTRAINT",37:"LOW_RISK",38:"MED_RISK",39:"HIGH_RISK",40:"VERIFY_ANALYSIS",41:"VERIFY_DEMONSTRATION",42:"VERIFY_INSPECTION",43:"VERIFY_TEST",44:"ELEMENT",47:"TYPE",49:"DOCREF",51:"END_ARROW_L",53:"LINE",54:"END_ARROW_R",55:"CONTAINS",56:"COPIES",57:"DERIVES",58:"SATISFIES",59:"VERIFIES",60:"REFINES",61:"TRACES",62:"unqString",63:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[14,5],[20,5],[20,5],[20,5],[20,5],[20,2],[20,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[27,1],[27,1],[27,1],[29,1],[29,1],[29,1],[29,1],[15,5],[46,5],[46,5],[46,2],[46,1],[16,5],[16,5],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[18,1],[18,1],[23,1],[23,1],[25,1],[25,1],[45,1],[45,1],[48,1],[48,1],[50,1],[50,1]],performAction:t((function(t,e,i,n,r,s,a){var o=s.length-1;switch(r){case 4:this.$=s[o].trim(),n.setAccTitle(this.$);break;case 5:case 6:this.$=s[o].trim(),n.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:n.addRequirement(s[o-3],s[o-4]);break;case 14:n.setNewReqId(s[o-2]);break;case 15:n.setNewReqText(s[o-2]);break;case 16:n.setNewReqRisk(s[o-2]);break;case 17:n.setNewReqVerifyMethod(s[o-2]);break;case 20:this.$=n.RequirementType.REQUIREMENT;break;case 21:this.$=n.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=n.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=n.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=n.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=n.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=n.RiskLevel.LOW_RISK;break;case 27:this.$=n.RiskLevel.MED_RISK;break;case 28:this.$=n.RiskLevel.HIGH_RISK;break;case 29:this.$=n.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=n.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=n.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=n.VerifyType.VERIFY_TEST;break;case 33:n.addElement(s[o-3]);break;case 34:n.setNewElementType(s[o-2]);break;case 35:n.setNewElementDocRef(s[o-2]);break;case 38:n.addRelationship(s[o-2],s[o],s[o-4]);break;case 39:n.addRelationship(s[o-2],s[o-4],s[o]);break;case 40:this.$=n.Relationships.CONTAINS;break;case 41:this.$=n.Relationships.COPIES;break;case 42:this.$=n.Relationships.DERIVES;break;case 43:this.$=n.Relationships.SATISFIES;break;case 44:this.$=n.Relationships.VERIFIES;break;case 45:this.$=n.Relationships.REFINES;break;case 46:this.$=n.Relationships.TRACES}}),"anonymous"),table:[{3:1,4:2,6:i,9:n,11:r,13:s},{1:[3]},{3:8,4:2,5:[1,7],6:i,9:n,11:r,13:s},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:i,9:n,11:r,13:s},{1:[2,2]},{4:17,5:o,7:13,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,30]},{4:17,5:o,7:31,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:32,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:33,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:34,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:35,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{18:36,62:[1,37],63:[1,38]},{45:39,62:[1,40],63:[1,41]},{51:[1,42],53:[1,43]},e(m,[2,20]),e(m,[2,21]),e(m,[2,22]),e(m,[2,23]),e(m,[2,24]),e(m,[2,25]),e(R,[2,49]),e(R,[2,50]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{19:[1,44]},{19:[2,47]},{19:[2,48]},{19:[1,45]},{19:[2,53]},{19:[2,54]},{52:46,55:f,56:I,57:S,58:b,59:N,60:T,61:k},{52:54,55:f,56:I,57:S,58:b,59:N,60:T,61:k},{5:[1,55]},{5:[1,56]},{53:[1,57]},e(x,[2,40]),e(x,[2,41]),e(x,[2,42]),e(x,[2,43]),e(x,[2,44]),e(x,[2,45]),e(x,[2,46]),{54:[1,58]},{5:A,20:59,21:w,24:q,26:v,28:$,30:O},{5:L,30:C,46:66,47:M,49:F},{23:71,62:g,63:E},{23:72,62:g,63:E},e(D,[2,13]),{22:[1,73]},{22:[1,74]},{22:[1,75]},{22:[1,76]},{5:A,20:77,21:w,24:q,26:v,28:$,30:O},e(D,[2,19]),e(D,[2,33]),{22:[1,78]},{22:[1,79]},{5:L,30:C,46:80,47:M,49:F},e(D,[2,37]),e(D,[2,38]),e(D,[2,39]),{23:81,62:g,63:E},{25:82,62:[1,83],63:[1,84]},{27:85,37:[1,86],38:[1,87],39:[1,88]},{29:89,40:[1,90],41:[1,91],42:[1,92],43:[1,93]},e(D,[2,18]),{48:94,62:[1,95],63:[1,96]},{50:97,62:[1,98],63:[1,99]},e(D,[2,36]),{5:[1,100]},{5:[1,101]},{5:[2,51]},{5:[2,52]},{5:[1,102]},{5:[2,26]},{5:[2,27]},{5:[2,28]},{5:[1,103]},{5:[2,29]},{5:[2,30]},{5:[2,31]},{5:[2,32]},{5:[1,104]},{5:[2,55]},{5:[2,56]},{5:[1,105]},{5:[2,57]},{5:[2,58]},{5:A,20:106,21:w,24:q,26:v,28:$,30:O},{5:A,20:107,21:w,24:q,26:v,28:$,30:O},{5:A,20:108,21:w,24:q,26:v,28:$,30:O},{5:A,20:109,21:w,24:q,26:v,28:$,30:O},{5:L,30:C,46:110,47:M,49:F},{5:L,30:C,46:111,47:M,49:F},e(D,[2,14]),e(D,[2,15]),e(D,[2,16]),e(D,[2,17]),e(D,[2,34]),e(D,[2,35])],defaultActions:{8:[2,2],12:[2,1],30:[2,3],31:[2,8],32:[2,9],33:[2,10],34:[2,11],35:[2,12],37:[2,47],38:[2,48],40:[2,53],41:[2,54],83:[2,51],84:[2,52],86:[2,26],87:[2,27],88:[2,28],90:[2,29],91:[2,30],92:[2,31],93:[2,32],95:[2,55],96:[2,56],98:[2,57],99:[2,58]},parseError:t((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:t((function(e){var i=this,n=[0],r=[],s=[null],a=[],o=this.table,l="",h=0,c=0,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);d.setInput(e,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var _=d.yylloc;a.push(_);var g=d.options&&d.options.ranges;function E(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t((function(t){n.length=n.length-2*t,s.length=s.length-t,a.length=a.length-t}),"popStack"),t(E,"lex");for(var m,R,f,I,S,b,N,T,k={};;){if(R=n[n.length-1],this.defaultActions[R]?f=this.defaultActions[R]:(null==m&&(m=E()),f=o[R]&&o[R][m]),void 0===f||!f.length||!f[0]){var x="";for(S in T=[],o[R])this.terminals_[S]&&S>2&&T.push("'"+this.terminals_[S]+"'");x=d.showPosition?"Parse error on line "+(h+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(x,{text:d.match,token:this.terminals_[m]||m,line:d.yylineno,loc:_,expected:T})}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+m);switch(f[0]){case 1:n.push(m),s.push(d.yytext),a.push(d.yylloc),n.push(f[1]),m=null,c=d.yyleng,l=d.yytext,h=d.yylineno,_=d.yylloc;break;case 2:if(b=this.productions_[f[1]][1],k.$=s[s.length-b],k._$={first_line:a[a.length-(b||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(b||1)].first_column,last_column:a[a.length-1].last_column},g&&(k._$.range=[a[a.length-(b||1)].range[0],a[a.length-1].range[1]]),void 0!==(I=this.performAction.apply(k,[l,c,h,p.yy,f[1],s,a].concat(u))))return I;b&&(n=n.slice(0,-1*b*2),s=s.slice(0,-1*b),a=a.slice(0,-1*b)),n.push(this.productions_[f[1]][0]),s.push(k.$),a.push(k._$),N=o[n[n.length-2]][n[n.length-1]],n.push(N);break;case 3:return!0}}return!0}),"parse")},V=function(){return{EOF:1,parseError:t((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:t((function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:t((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:t((function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:t((function(){return this._more=!0,this}),"more"),reject:t((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:t((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:t((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:t((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:t((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:t((function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1}),"test_match"),next:t((function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((i=this._input.match(this.rules[r[s]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:t((function(){var t=this.next();return t||this.lex()}),"lex"),begin:t((function(t){this.conditionStack.push(t)}),"begin"),popState:t((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:t((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:t((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:t((function(t){this.begin(t)}),"pushState"),stateStackSize:t((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:t((function(t,e,i,n){switch(i){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 48:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 5;case 9:case 10:case 11:break;case 12:return 8;case 13:return 6;case 14:return 19;case 15:return 30;case 16:return 22;case 17:return 21;case 18:return 24;case 19:return 26;case 20:return 28;case 21:return 31;case 22:return 32;case 23:return 33;case 24:return 34;case 25:return 35;case 26:return 36;case 27:return 37;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 41;case 32:return 42;case 33:return 43;case 34:return 44;case 35:return 55;case 36:return 56;case 37:return 57;case 38:return 58;case 39:return 59;case 40:return 60;case 41:return 61;case 42:return 47;case 43:return 49;case 44:return 51;case 45:return 54;case 46:return 53;case 47:this.begin("string");break;case 49:return"qString";case 50:return e.yytext=e.yytext.trim(),62}}),"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[48,49],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,50],inclusive:!0}}}}();function U(){this.yy={}}return P.lexer=V,t(U,"Parser"),U.prototype=P,P.Parser=U,new U}();y.parser=y;var _=y,g=[],E={},m=new Map,R={},f=new Map,I=t(((t,e)=>(m.has(t)||m.set(t,{name:t,type:e,id:E.id,text:E.text,risk:E.risk,verifyMethod:E.verifyMethod}),E={},m.get(t))),"addRequirement"),S=t((()=>m),"getRequirements"),b=t((t=>{void 0!==E&&(E.id=t)}),"setNewReqId"),N=t((t=>{void 0!==E&&(E.text=t)}),"setNewReqText"),T=t((t=>{void 0!==E&&(E.risk=t)}),"setNewReqRisk"),k=t((t=>{void 0!==E&&(E.verifyMethod=t)}),"setNewReqVerifyMethod"),x=t((t=>(f.has(t)||(f.set(t,{name:t,type:R.type,docRef:R.docRef}),a.info("Added new requirement: ",t)),R={},f.get(t))),"addElement"),A=t((()=>f),"getElements"),w=t((t=>{void 0!==R&&(R.type=t)}),"setNewElementType"),q=t((t=>{void 0!==R&&(R.docRef=t)}),"setNewElementDocRef"),v=t(((t,e,i)=>{g.push({type:t,src:e,dst:i})}),"addRelationship"),$=t((()=>g),"getRelationships"),O=t((()=>{g=[],E={},m=new Map,R={},f=new Map,o()}),"clear"),L={RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},getConfig:t((()=>e().req),"getConfig"),addRequirement:I,getRequirements:S,setNewReqId:b,setNewReqText:N,setNewReqRisk:T,setNewReqVerifyMethod:k,setAccTitle:i,getAccTitle:n,setAccDescription:r,getAccDescription:s,addElement:x,getElements:A,setNewElementType:w,setNewElementDocRef:q,addRelationship:v,getRelationships:$,clear:O},C=t((t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n\n`),"getStyles"),M={CONTAINS:"contains",ARROW:"arrow"},F={ReqMarkers:M,insertLineEndings:t(((t,e)=>{let i=t.append("defs").append("marker").attr("id",M.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");i.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),i.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),i.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",M.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n L${e.line_height},${e.line_height/2}\n M${e.line_height},${e.line_height/2}\n L0,${e.line_height}`).attr("stroke-width",1)}),"insertLineEndings")},D={},P=0,V=t(((t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",D.rect_min_width+"px").attr("height",D.rect_min_height+"px")),"newRectNode"),U=t(((t,e,i)=>{let n=D.rect_min_width/2,r=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",n).attr("y",D.rect_padding).attr("dominant-baseline","hanging"),s=0;i.forEach((t=>{0==s?r.append("tspan").attr("text-anchor","middle").attr("x",D.rect_min_width/2).attr("dy",0).text(t):r.append("tspan").attr("text-anchor","middle").attr("x",D.rect_min_width/2).attr("dy",.75*D.line_height).text(t),s++}));let a=1.5*D.rect_padding+s*D.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",D.rect_min_width).attr("y1",a).attr("y2",a),{titleNode:r,y:a}}),"newTitleNode"),Y=t(((t,e,i,n)=>{let r=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",D.rect_padding).attr("y",n).attr("dominant-baseline","hanging"),s=0;let a=[];return i.forEach((t=>{let e=t.length;for(;e>30&&s<3;){let i=t.substring(0,30);e=(t=t.substring(30,t.length)).length,a[a.length]=i,s++}if(3==s){let t=a[a.length-1];a[a.length-1]=t.substring(0,t.length-4)+"..."}else a[a.length]=t;s=0})),a.forEach((t=>{r.append("tspan").attr("x",D.rect_padding).attr("dy",D.line_height).text(t)})),r}),"newBodyNode"),B=t(((t,e,i,n)=>{const r=e.node().getTotalLength(),s=e.node().getPointAtLength(.5*r),a="rel"+P;P++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",a).attr("x",s.x).attr("y",s.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(n).node().getBBox();t.insert("rect","#"+a).attr("class","req reqLabelBox").attr("x",s.x-o.width/2).attr("y",s.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")}),"addEdgeLabel"),j=t((function(t,e,i,n,r){const s=i.edge(G(e.src),G(e.dst)),a=p().x((function(t){return t.x})).y((function(t){return t.y})),o=t.insert("path","#"+n).attr("class","er relationshipLine").attr("d",a(s.points)).attr("fill","none");e.type==r.db.Relationships.CONTAINS?o.attr("marker-start","url("+h.getUrl(D.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+h.getUrl(D.arrowMarkerAbsolute)+"#"+F.ReqMarkers.ARROW+"_line_ending)")),B(t,o,D,`<<${e.type}>>`)}),"drawRelationshipFromLayout"),Q=t(((t,e,i)=>{t.forEach(((t,n)=>{n=G(n),a.info("Added new requirement: ",n);const r=i.append("g").attr("id",n),s=V(r,"req-"+n);let o=[],l=U(r,n+"_title",[`<<${t.type}>>`,`${t.name}`]);o.push(l.titleNode);let h=Y(r,n+"_body",[`Id: ${t.id}`,`Text: ${t.text}`,`Risk: ${t.risk}`,`Verification: ${t.verifyMethod}`],l.y);o.push(h);const c=s.node().getBBox();e.setNode(n,{width:c.width,height:c.height,shape:"rect",id:n})}))}),"drawReqs"),H=t(((t,e,i)=>{t.forEach(((t,n)=>{const r=G(n),s=i.append("g").attr("id",r),a="element-"+r,o=V(s,a);let l=[],h=U(s,a+"_title",["<<Element>>",`${n}`]);l.push(h.titleNode);let c=Y(s,a+"_body",[`Type: ${t.type||"Not Specified"}`,`Doc Ref: ${t.docRef||"None"}`],h.y);l.push(c);const u=o.node().getBBox();e.setNode(r,{width:u.width,height:u.height,shape:"rect",id:r})}))}),"drawElements"),W=t(((t,e)=>(t.forEach((function(t){let i=G(t.src),n=G(t.dst);e.setEdge(i,n,{relationship:t})})),t)),"addRelationships"),K=t((function(t,e){e.nodes().forEach((function(i){void 0!==i&&void 0!==e.node(i)&&(t.select("#"+i),t.select("#"+i).attr("transform","translate("+(e.node(i).x-e.node(i).width/2)+","+(e.node(i).y-e.node(i).height/2)+" )"))}))}),"adjustEntities"),G=t((t=>t.replace(/\s/g,"").replace(/\./g,"_")),"elementString"),z={parser:_,db:L,renderer:{draw:t(((t,i,n,r)=>{const s=(D=e().requirement).securityLevel;let a;"sandbox"===s&&(a=c("#i"+i));const o=c("sandbox"===s?a.nodes()[0].contentDocument.body:"body").select(`[id='${i}']`);F.insertLineEndings(o,D);const h=new u({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:D.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));let p=r.db.getRequirements(),y=r.db.getElements(),_=r.db.getRelationships();Q(p,h,o),H(y,h,o),W(_,h),d(h),K(o,h),_.forEach((function(t){j(o,t,h,i,r)}));const g=D.rect_padding,E=o.node().getBBox(),m=E.width+2*g,R=E.height+2*g;l(o,R,m,D.useMaxWidth),o.attr("viewBox",`${E.x-g} ${E.y-g} ${m} ${R}`)}),"draw")},styles:C};export{z as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e,H as a,J as s,M as t,O as o,P as r,Q as n,T as i,U as l,V as c,W as m,X as d,Y as h,Z as b,_ as x,$ as f,a0 as y,a1 as p,a2 as u,a3 as g,a4 as _,a5 as j,a6 as k,a7 as v,a8 as w,a9 as N}from"./index-
|
|
1
|
+
import{G as e,H as a,J as s,M as t,O as o,P as r,Q as n,T as i,U as l,V as c,W as m,X as d,Y as h,Z as b,_ as x,$ as f,a0 as y,a1 as p,a2 as u,a3 as g,a4 as _,a5 as j,a6 as k,a7 as v,a8 as w,a9 as N}from"./index-DHvEsXpq.js";import{u as S,A as C,R as I,a as P,C as T}from"./useMarimoWebSocket-CNdDRymh.js";import"./createWsUrl-AYnQqPDo.js";const A=n=>{const l=e(14),{appConfig:c}=n,{setCells:m}=a();let d,h,b;l[0]===Symbol.for("react.memo_cache_sentinel")?(d=[],l[0]=d):d=l[0],s.useEffect(E,d),l[1]===Symbol.for("react.memo_cache_sentinel")?(h=i(),l[1]=h):h=l[1],l[2]!==m?(b={autoInstantiate:!0,setCells:m,sessionId:h},l[2]=m,l[3]=b):b=l[3];const{connection:x}=S(b),f=t(o);let y,p,u;return l[4]!==x?(y=r.jsx(P,{connection:x,className:"sm:pt-8"}),l[4]=x,l[5]=y):y=l[5],l[6]!==c?(p=r.jsx(T,{appConfig:c,mode:"read"}),l[6]=c,l[7]=p):p=l[7],l[8]!==x||l[9]!==f||l[10]!==c.width||l[11]!==y||l[12]!==p?(u=r.jsxs(C,{connection:x,isRunning:f,width:c.width,children:[y,p]}),l[8]=x,l[9]=f,l[10]=c.width,l[11]=y,l[12]=p,l[13]=u):u=l[13],u};function W(){I.INSTANCE.stop()}function E(){return I.INSTANCE.start(n),W}const R=()=>{const a=e(4);if(!l())return null;let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s=c(),a[0]=s):s=a[0];const t=s;if(!t)return null;let o,n,i;return a[1]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx("a",{href:m.githubPage,target:"_blank",className:"underline",rel:"noreferrer",children:"marimo"}),a[1]=o):o=a[1],a[2]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsxs("span",{children:["This is a static Python notebook built using"," ",o,".",r.jsx("br",{}),"Some interactive features may not work, see ways to run or edit this."]}),a[2]=n):n=a[2],a[3]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsxs("div",{className:"px-4 py-2 bg-[var(--sky-2)] border-b border-[var(--sky-7)] text-md text-[var(--sky-11)] font-semibold flex justify-between items-center gap-4 no-print",children:[n,r.jsx("span",{className:"flex-shrink-0",children:r.jsx(F,{code:t})})]}),a[3]=i):i=a[3],i},F=a=>{const s=e(81),{code:t}=a;let o;if(s[0]===Symbol.for("react.memo_cache_sentinel")){o=d()||"notebook.py";const e=o.lastIndexOf("/");-1!==e&&(o=o.slice(e+1)),s[0]=o}else o=s[0];const n=window.location.href;let i,l,c,N,S,C,I,P,T,A,W,E,R,F,M,O,U,Y,z,B,D,G,H,J,Q,V,X,Z,$,q,K,L,ee,ae,se,te,oe;if(s[1]!==t){const e=h({code:t});let a;G=b,s[25]===Symbol.for("react.memo_cache_sentinel")?(H=r.jsx(x,{asChild:!0,children:r.jsx(f,{"data-testid":"static-notebook-dialog-trigger",variant:"secondary",children:"Run or edit this notebook"})}),s[25]=H):H=s[25],D=y,z=p,s[26]===Symbol.for("react.memo_cache_sentinel")?(B=r.jsx(u,{children:o}),s[26]=B):B=s[26],C=g,I="pt-4 text-md text-left",P="This is a static notebook built using",T=" ",s[27]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("a",{href:m.githubPage,target:"_blank",className:"text-link hover:underline",rel:"noreferrer",children:"marimo"}),s[27]=A):A=s[27],W=". marimo is an open-source next-generation Python notebook.",s[28]===Symbol.for("react.memo_cache_sentinel")?(E=r.jsx("hr",{className:"my-3"}),s[28]=E):E=s[28],R="In order to edit this notebook, you will need to download the code locally, install marimo, and run the following in your terminal:",s[29]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("br",{}),s[29]=a):a=s[29],s[30]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs("div",{className:"font-mono text-sm bg-[var(--sky-2)] rounded-md my-3 p-2 border border-[var(--sky-7)]",children:["pip install marimo",a,"marimo edit ",o]}),M=!n.endsWith(".html")&&r.jsxs(r.Fragment,{children:["or",r.jsxs("div",{className:"font-mono text-sm bg-[var(--sky-2)] rounded-md my-3 p-2 border border-[var(--sky-7)] break-all",children:["marimo edit ",window.location.href]})]}),O=r.jsx("hr",{className:"my-3"}),s[30]=F,s[31]=M,s[32]=O):(F=s[30],M=s[31],O=s[32]),U="You may also be able to run this notebook entirely in the browser via WebAssembly at:",Y=" ",i=e,l="_blank",c="text-link hover:underline",N="noreferrer",S=e.slice(0,40),s[1]=t,s[2]=i,s[3]=l,s[4]=c,s[5]=N,s[6]=S,s[7]=C,s[8]=I,s[9]=P,s[10]=T,s[11]=A,s[12]=W,s[13]=E,s[14]=R,s[15]=F,s[16]=M,s[17]=O,s[18]=U,s[19]=Y,s[20]=z,s[21]=B,s[22]=D,s[23]=G,s[24]=H}else i=s[2],l=s[3],c=s[4],N=s[5],S=s[6],C=s[7],I=s[8],P=s[9],T=s[10],A=s[11],W=s[12],E=s[13],R=s[14],F=s[15],M=s[16],O=s[17],U=s[18],Y=s[19],z=s[20],B=s[21],D=s[22],G=s[23],H=s[24];return s[33]!==i||s[34]!==l||s[35]!==c||s[36]!==N||s[37]!==S?(J=r.jsxs("a",{href:i,target:l,className:c,rel:N,children:[S,"..."]}),s[33]=i,s[34]=l,s[35]=c,s[36]=N,s[37]=S,s[38]=J):J=s[38],s[39]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx("br",{}),s[39]=Q):Q=s[39],s[40]===Symbol.for("react.memo_cache_sentinel")?(V=r.jsxs("div",{className:"text-sm text-muted-foreground pt-2",children:[r.jsx("strong",{children:"Note:"})," This feature is experimental and may not work for all notebooks. Additionally, some dependencies may not be available in the browser."]}),s[40]=V):V=s[40],s[41]!==C||s[42]!==I||s[43]!==P||s[44]!==T||s[45]!==A||s[46]!==W||s[47]!==E||s[48]!==R||s[49]!==F||s[50]!==M||s[51]!==O||s[52]!==U||s[53]!==Y||s[54]!==J?(X=r.jsxs(C,{className:I,children:[P,T,A,W,E,R,F,M,O,U,Y,J,Q,V]}),s[41]=C,s[42]=I,s[43]=P,s[44]=T,s[45]=A,s[46]=W,s[47]=E,s[48]=R,s[49]=F,s[50]=M,s[51]=O,s[52]=U,s[53]=Y,s[54]=J,s[55]=X):X=s[55],s[56]!==z||s[57]!==B||s[58]!==X?(Z=r.jsxs(z,{children:[B,X]}),s[56]=z,s[57]=B,s[58]=X,s[59]=Z):Z=s[59],s[60]!==t?($=async()=>{await _(t),j({title:"Copied to clipboard"})},s[60]=t,s[61]=$):$=s[61],s[62]===Symbol.for("react.memo_cache_sentinel")?(q=r.jsx(k,{className:"w-4 h-4 mr-1"}),s[62]=q):q=s[62],s[63]!==$?(K=r.jsxs(f,{"data-testid":"copy-static-notebook-dialog-button",variant:"secondary",onClick:$,children:[q,"Copy code"]}),s[63]=$,s[64]=K):K=s[64],s[65]!==t?(L=()=>{v(new Blob([t],{type:"text/plain"}),o)},s[65]=t,s[66]=L):L=s[66],s[67]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(w,{className:"w-4 h-4 mr-1"}),s[67]=ee):ee=s[67],s[68]!==L?(ae=r.jsxs(f,{"data-testid":"download-static-notebook-dialog-button",variant:"secondary",onClick:L,children:[ee,"Download code"]}),s[68]=L,s[69]=ae):ae=s[69],s[70]!==K||s[71]!==ae?(se=r.jsxs("div",{className:"flex gap-4 flex-wrap",children:[K,ae]}),s[70]=K,s[71]=ae,s[72]=se):se=s[72],s[73]!==D||s[74]!==Z||s[75]!==se?(te=r.jsxs(D,{children:[Z,se]}),s[73]=D,s[74]=Z,s[75]=se,s[76]=te):te=s[76],s[77]!==G||s[78]!==H||s[79]!==te?(oe=r.jsxs(G,{children:[H,te]}),s[77]=G,s[78]=H,s[79]=te,s[80]=oe):oe=s[80],oe},M=N()||l(),O=a=>{const s=e(6);let t,o,n,i;return s[0]===Symbol.for("react.memo_cache_sentinel")?(t=r.jsx(R,{}),s[0]=t):t=s[0],s[1]!==a.appConfig?(o=r.jsx(A,{appConfig:a.appConfig}),s[1]=a.appConfig,s[2]=o):o=s[2],s[3]===Symbol.for("react.memo_cache_sentinel")?(n=M&&r.jsx(U,{}),s[3]=n):n=s[3],s[4]!==o?(i=r.jsxs(r.Fragment,{children:[t,o,n]}),s[4]=o,s[5]=i):i=s[5],i},U=()=>{const a=e(1);let s;return a[0]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("div",{className:"fixed bottom-0 right-0 z-50",children:r.jsxs("a",{href:m.githubPage,target:"_blank",className:"text-sm text-[var(--grass-11)] font-bold tracking-wide transition-colors bg-[var(--grass-4)] hover:bg-[var(--grass-5)] border-t border-l border-[var(--grass-8)] px-3 py-1 rounded-tl-md flex items-center gap-2",rel:"noreferrer",children:[r.jsx("span",{className:"pb-[2px]",children:"made with marimo"}),r.jsx("img",{src:"./favicon.ico",alt:"marimo",className:"h-4 w-auto"})]})}),a[0]=s):s=a[0],s};export{O as default};
|
package/dist/assets/{sankeyDiagram-ATFNWWW6-D7C5vqOz.js → sankeyDiagram-ATFNWWW6-lN95QVee.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,n,e;import{_ as i,d as r,g as s,s as o,b as a,c as l,q as c,p as h,t as u,e as f,o as y,P as d}from"./mermaid-C0xJWrUT.js";import{s as p}from"./transform-C6EuPmuu.js";import{o as g}from"./ordinal-BcaZTuz9.js";import{c as _}from"./colors-bszWmPJw.js";import"./index-H_VRvUbH.js";import"./step-DY8hpDjU.js";import"./init-DLRA0X12.js";const m=_("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function x(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}var k,v;function b(t,n){var e,i,r=t.length,s=-1;if(null==n){for(;++s<r;)if(null!=(e=t[s])&&e>=e)for(i=e;++s<r;)null!=(e=t[s])&&e>i&&(i=e)}else for(;++s<r;)if(null!=(e=n(t[s],s,t))&&e>=e)for(i=e;++s<r;)null!=(e=n(t[s],s,t))&&e>i&&(i=e);return i}function w(t,n){var e,i,r=t.length,s=-1;if(null==n){for(;++s<r;)if(null!=(e=t[s])&&e>=e)for(i=e;++s<r;)null!=(e=t[s])&&i>e&&(i=e)}else for(;++s<r;)if(null!=(e=n(t[s],s,t))&&e>=e)for(i=e;++s<r;)null!=(e=n(t[s],s,t))&&i>e&&(i=e);return i}function S(t,n){var e,i=t.length,r=-1,s=0;if(null==n)for(;++r<i;)(e=+t[r])&&(s+=e);else for(;++r<i;)(e=+n(t[r],r,t))&&(s+=e);return s}function E(t){return t.target.depth}function L(t,n){return t.sourceLinks.length?t.depth:n-1}function A(t){return function(){return t}}function M(t,n){return T(t.source,n.source)||t.index-n.index}function I(t,n){return T(t.target,n.target)||t.index-n.index}function T(t,n){return t.y0-n.y0}function N(t){return t.value}function P(t){return t.index}function j(t){return t.nodes}function O(t){return t.links}function C(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function D({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const i of n.sourceLinks)i.y0=t+i.width/2,t+=i.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function $(){let t,n,e,i=0,r=0,s=1,o=1,a=24,l=8,c=P,h=L,u=j,f=O,y=6;function d(){const d={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[e,r]of t.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const i=new Map(t.map(((n,e)=>[c(n,e,t),n])));for(const[e,r]of n.entries()){r.index=e;let{source:t,target:n}=r;"object"!=typeof t&&(t=r.source=C(i,t)),"object"!=typeof n&&(n=r.target=C(i,n)),t.sourceLinks.push(r),n.targetLinks.push(r)}if(null!=e)for(const{sourceLinks:r,targetLinks:s}of t)r.sort(e),s.sort(e)}(d),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(S(n.sourceLinks,N),S(n.targetLinks,N)):n.fixedValue}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.depth=r;for(const{target:n}of t.sourceLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.height=r;for(const{source:n}of t.targetLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function(e){const c=function({nodes:t}){const e=b(t,(t=>t.depth))+1,r=(s-i-a)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+a,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const i of o)i.sort(n);return o}(e);t=Math.min(l,(o-r)/(b(c,(t=>t.length))-1)),function(n){const e=w(n,(n=>(o-r-(n.length-1)*t)/S(n,N)));for(const i of n){let n=r;for(const r of i){r.y0=n,r.y1=n+r.value*e,n=r.y1+t;for(const t of r.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}v(i)}}(c);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);g(c,n,e),p(c,n,e)}}(d),D(d),d}function p(t,e,i){for(let r=1,s=t.length;r<s;++r){const s=t[r];for(const t of s){let n=0,i=0;for(const{source:e,value:s}of t.targetLinks){let r=s*(t.layer-e.layer);n+=E(e,t)*r,i+=r}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,k(t)}void 0===n&&s.sort(T),_(s,i)}}function g(t,e,i){for(let r=t.length-2;r>=0;--r){const s=t[r];for(const t of s){let n=0,i=0;for(const{target:e,value:s}of t.sourceLinks){let r=s*(e.layer-t.layer);n+=$(t,e)*r,i+=r}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,k(t)}void 0===n&&s.sort(T),_(s,i)}}function _(n,e){const i=n.length>>1,s=n[i];x(n,s.y0-t,i-1,e),m(n,s.y1+t,i+1,e),x(n,o,n.length-1,e),m(n,r,0,e)}function m(n,e,i,r){for(;i<n.length;++i){const s=n[i],o=(e-s.y0)*r;o>1e-6&&(s.y0+=o,s.y1+=o),e=s.y1+t}}function x(n,e,i,r){for(;i>=0;--i){const s=n[i],o=(s.y1-e)*r;o>1e-6&&(s.y0-=o,s.y1-=o),e=s.y0-t}}function k({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(I);for(const{target:{targetLinks:n}}of t)n.sort(M)}}function v(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(I),e.sort(M)}function E(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:r,width:s}of n.sourceLinks){if(r===e)break;i+=s+t}for(const{source:t,width:r}of e.targetLinks){if(t===n)break;i-=r}return i}function $(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:r,width:s}of e.targetLinks){if(r===n)break;i+=s+t}for(const{target:t,width:r}of n.sourceLinks){if(t===e)break;i-=r}return i}return d.update=function(t){return D(t),t},d.nodeId=function(t){return arguments.length?(c="function"==typeof t?t:A(t),d):c},d.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:A(t),d):h},d.nodeSort=function(t){return arguments.length?(n=t,d):n},d.nodeWidth=function(t){return arguments.length?(a=+t,d):a},d.nodePadding=function(n){return arguments.length?(l=t=+n,d):l},d.nodes=function(t){return arguments.length?(u="function"==typeof t?t:A(t),d):u},d.links=function(t){return arguments.length?(f="function"==typeof t?t:A(t),d):f},d.linkSort=function(t){return arguments.length?(e=t,d):e},d.size=function(t){return arguments.length?(i=r=0,s=+t[0],o=+t[1],d):[s-i,o-r]},d.extent=function(t){return arguments.length?(i=+t[0][0],s=+t[1][0],r=+t[0][1],o=+t[1][1],d):[[i,r],[s,o]]},d.iterations=function(t){return arguments.length?(y=+t,d):y},d}1===(k=x).length&&(v=k,k=function(t,n){return x(v(t),n)});var z=Math.PI,F=2*z,U=1e-6,W=F-U;function G(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function X(){return new G}function q(t){return function(){return t}}function V(t){return t[0]}function Y(t){return t[1]}G.prototype=X.prototype={constructor:G,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,r,s){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,n,e,i,r){t=+t,n=+n,e=+e,i=+i,r=+r;var s=this._x1,o=this._y1,a=e-t,l=i-n,c=s-t,h=o-n,u=c*c+h*h;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>U)if(Math.abs(h*a-l*c)>U&&r){var f=e-s,y=i-o,d=a*a+l*l,p=f*f+y*y,g=Math.sqrt(d),_=Math.sqrt(u),m=r*Math.tan((z-Math.acos((d+u-p)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>U&&(this._+="L"+(t+x*c)+","+(n+x*h)),this._+="A"+r+","+r+",0,0,"+ +(h*f>c*y)+","+(this._x1=t+k*a)+","+(this._y1=n+k*l)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,r,s){t=+t,n=+n,s=!!s;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),l=t+o,c=n+a,h=1^s,u=s?i-r:r-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>U||Math.abs(this._y1-c)>U)&&(this._+="L"+l+","+c),e&&(u<0&&(u=u%F+F),u>W?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>U&&(this._+="A"+e+","+e+",0,"+ +(u>=z)+","+h+","+(this._x1=t+e*Math.cos(r))+","+(this._y1=n+e*Math.sin(r))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var Q=Array.prototype.slice;function R(t){return t.source}function B(t){return t.target}function K(t,n,e,i,r){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,r,i,r)}function Z(){return function(t){var n=R,e=B,i=V,r=Y,s=null;function o(){var o,a=Q.call(arguments),l=n.apply(this,a),c=e.apply(this,a);if(s||(s=o=X()),t(s,+i.apply(this,(a[0]=l,a)),+r.apply(this,a),+i.apply(this,(a[0]=c,a)),+r.apply(this,a)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:q(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:q(+t),o):r},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o}(K)}function H(t){return[t.source.x1,t.y0]}function J(t){return[t.target.x0,t.y1]}var tt=function(){var t=i((function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e}),"o"),n=[1,9],e=[1,10],r=[1,5,10,12],s={trace:i((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:i((function(t,n,e,i,r,s,o){var a=s.length-1;switch(r){case 7:const t=i.findOrCreateNode(s[a-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(s[a-2].trim().replaceAll('""','"')),e=parseFloat(s[a].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=s[a];break;case 10:this.$=s[a-1]}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(r,[2,8]),t(r,[2,9]),{19:[1,16]},t(r,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(r,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:i((function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)}),"parseError"),parse:i((function(t){var n=this,e=[0],r=[],s=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),f=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);f.setInput(t,y.yy),y.yy.lexer=f,y.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var p=f.yylloc;o.push(p);var g=f.options&&f.options.ranges;function _(){var t;return"number"!=typeof(t=r.pop()||f.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,i((function(t){e.length=e.length-2*t,s.length=s.length-t,o.length=o.length-t}),"popStack"),i(_,"lex");for(var m,x,k,v,b,w,S,E,L={};;){if(x=e[e.length-1],this.defaultActions[x]?k=this.defaultActions[x]:(null==m&&(m=_()),k=a[x]&&a[x][m]),void 0===k||!k.length||!k[0]){var A="";for(b in E=[],a[x])this.terminals_[b]&&b>2&&E.push("'"+this.terminals_[b]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:p,expected:E})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+m);switch(k[0]){case 1:e.push(m),s.push(f.yytext),o.push(f.yylloc),e.push(k[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,p=f.yylloc;break;case 2:if(w=this.productions_[k[1]][1],L.$=s[s.length-w],L._$={first_line:o[o.length-(w||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(w||1)].first_column,last_column:o[o.length-1].last_column},g&&(L._$.range=[o[o.length-(w||1)].range[0],o[o.length-1].range[1]]),void 0!==(v=this.performAction.apply(L,[l,h,c,y.yy,k[1],s,o].concat(u))))return v;w&&(e=e.slice(0,-1*w*2),s=s.slice(0,-1*w),o=o.slice(0,-1*w)),e.push(this.productions_[k[1]][0]),s.push(L.$),o.push(L._$),S=a[e[e.length-2]][e[e.length-1]],e.push(S);break;case 3:return!0}}return!0}),"parse")},o=function(){return{EOF:1,parseError:i((function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)}),"parseError"),setInput:i((function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:i((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:i((function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this}),"unput"),more:i((function(){return this._more=!0,this}),"more"),reject:i((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:i((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:i((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:i((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:i((function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"}),"showPosition"),test_match:i((function(t,n){var e,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1}),"test_match"),next:i((function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((e=this._input.match(this.rules[r[s]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,r[s])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:i((function(){var t=this.next();return t||this.lex()}),"lex"),begin:i((function(t){this.conditionStack.push(t)}),"begin"),popState:i((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:i((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:i((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:i((function(t){this.begin(t)}),"pushState"),stateStackSize:i((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:i((function(t,n,e,i){switch(e){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}}),"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function a(){this.yy={}}return s.lexer=o,i(a,"Parser"),a.prototype=s,s.Parser=a,new a}();tt.parser=tt;var nt=tt,et=[],it=[],rt=new Map,st=i((()=>{et=[],it=[],rt=new Map,u()}),"clear"),ot=(i(t=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}},"SankeyLink"),t),at=i(((t,n,e)=>{et.push(new ot(t,n,e))}),"addLink"),lt=(i(n=class{constructor(t){this.ID=t}},"SankeyNode"),n),ct=i((t=>{t=f.sanitizeText(t,r());let n=rt.get(t);return void 0===n&&(n=new lt(t),rt.set(t,n),it.push(n)),n}),"findOrCreateNode"),ht=i((()=>it),"getNodes"),ut=i((()=>et),"getLinks"),ft=i((()=>({nodes:it.map((t=>({id:t.ID}))),links:et.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))})),"getGraph"),yt={nodesMap:rt,getConfig:i((()=>r().sankey),"getConfig"),getNodes:ht,getLinks:ut,getGraph:ft,addLink:at,findOrCreateNode:ct,getAccTitle:s,setAccTitle:o,getAccDescription:a,setAccDescription:l,getDiagramTitle:c,setDiagramTitle:h,clear:st},dt=(i(e=class{static next(t){return new e(t+ ++e.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},"Uid"),e.count=0,e),pt={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?w(t.sourceLinks,E)-1:0},justify:L},gt={draw:i((function(t,n,e,s){const{securityLevel:o,sankey:a}=r(),l=y.sankey;let c;"sandbox"===o&&(c=p("#i"+n));const h=p("sandbox"===o?c.nodes()[0].contentDocument.body:"body"),u="sandbox"===o?h.select(`[id="${n}"]`):p(`[id="${n}"]`),f=(null==a?void 0:a.width)??l.width,_=(null==a?void 0:a.height)??l.width,x=(null==a?void 0:a.useMaxWidth)??l.useMaxWidth,k=(null==a?void 0:a.nodeAlignment)??l.nodeAlignment,v=(null==a?void 0:a.prefix)??l.prefix,b=(null==a?void 0:a.suffix)??l.suffix,w=(null==a?void 0:a.showValues)??l.showValues,S=s.db.getGraph(),E=pt[k];$().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(w?15:0)).nodeAlign(E).extent([[0,0],[f,_]])(S);const L=g(m);u.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=dt.next("node-")).id)).attr("transform",(function(t){return"translate("+t.x0+","+t.y0+")"})).attr("x",(t=>t.x0)).attr("y",(t=>t.y0)).append("rect").attr("height",(t=>t.y1-t.y0)).attr("width",(t=>t.x1-t.x0)).attr("fill",(t=>L(t.id)));const A=i((({id:t,value:n})=>w?`${t}\n${v}${Math.round(100*n)/100}${b}`:t),"getText");u.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(S.nodes).join("text").attr("x",(t=>t.x0<f/2?t.x1+6:t.x0-6)).attr("y",(t=>(t.y1+t.y0)/2)).attr("dy",(w?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0<f/2?"start":"end")).text(A);const M=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),I=(null==a?void 0:a.linkColor)??"gradient";if("gradient"===I){const t=M.append("linearGradient").attr("id",(t=>(t.uid=dt.next("linearGradient-")).id)).attr("gradientUnits","userSpaceOnUse").attr("x1",(t=>t.source.x1)).attr("x2",(t=>t.target.x0));t.append("stop").attr("offset","0%").attr("stop-color",(t=>L(t.source.id))),t.append("stop").attr("offset","100%").attr("stop-color",(t=>L(t.target.id)))}let T;switch(I){case"gradient":T=i((t=>t.uid),"coloring");break;case"source":T=i((t=>L(t.source.id)),"coloring");break;case"target":T=i((t=>L(t.target.id)),"coloring");break;default:T=I}M.append("path").attr("d",Z().source(H).target(J)).attr("stroke",T).attr("stroke-width",(t=>Math.max(1,t.width))),d(void 0,u,0,x)}),"draw")},_t=i((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim()),"prepareTextForParsing"),mt=nt.parse.bind(nt);nt.parse=t=>mt(_t(t));var xt={parser:nt,db:yt,renderer:gt};export{xt as diagram};
|
|
1
|
+
var t,n,e;import{_ as i,d as r,g as s,s as o,b as a,c as l,q as c,p as h,t as u,e as f,o as y,P as d}from"./mermaid-COzbSDFn.js";import{s as p}from"./transform-BZgIUWgO.js";import{o as g}from"./ordinal-BcaZTuz9.js";import{c as _}from"./colors-bszWmPJw.js";import"./index-DHvEsXpq.js";import"./step-CjxFKgSe.js";import"./init-DLRA0X12.js";const m=_("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function x(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}var k,v;function b(t,n){var e,i,r=t.length,s=-1;if(null==n){for(;++s<r;)if(null!=(e=t[s])&&e>=e)for(i=e;++s<r;)null!=(e=t[s])&&e>i&&(i=e)}else for(;++s<r;)if(null!=(e=n(t[s],s,t))&&e>=e)for(i=e;++s<r;)null!=(e=n(t[s],s,t))&&e>i&&(i=e);return i}function w(t,n){var e,i,r=t.length,s=-1;if(null==n){for(;++s<r;)if(null!=(e=t[s])&&e>=e)for(i=e;++s<r;)null!=(e=t[s])&&i>e&&(i=e)}else for(;++s<r;)if(null!=(e=n(t[s],s,t))&&e>=e)for(i=e;++s<r;)null!=(e=n(t[s],s,t))&&i>e&&(i=e);return i}function S(t,n){var e,i=t.length,r=-1,s=0;if(null==n)for(;++r<i;)(e=+t[r])&&(s+=e);else for(;++r<i;)(e=+n(t[r],r,t))&&(s+=e);return s}function E(t){return t.target.depth}function L(t,n){return t.sourceLinks.length?t.depth:n-1}function A(t){return function(){return t}}function M(t,n){return T(t.source,n.source)||t.index-n.index}function I(t,n){return T(t.target,n.target)||t.index-n.index}function T(t,n){return t.y0-n.y0}function N(t){return t.value}function P(t){return t.index}function j(t){return t.nodes}function O(t){return t.links}function C(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function D({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const i of n.sourceLinks)i.y0=t+i.width/2,t+=i.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function $(){let t,n,e,i=0,r=0,s=1,o=1,a=24,l=8,c=P,h=L,u=j,f=O,y=6;function d(){const d={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[e,r]of t.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const i=new Map(t.map(((n,e)=>[c(n,e,t),n])));for(const[e,r]of n.entries()){r.index=e;let{source:t,target:n}=r;"object"!=typeof t&&(t=r.source=C(i,t)),"object"!=typeof n&&(n=r.target=C(i,n)),t.sourceLinks.push(r),n.targetLinks.push(r)}if(null!=e)for(const{sourceLinks:r,targetLinks:s}of t)r.sort(e),s.sort(e)}(d),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(S(n.sourceLinks,N),S(n.targetLinks,N)):n.fixedValue}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.depth=r;for(const{target:n}of t.sourceLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.height=r;for(const{source:n}of t.targetLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function(e){const c=function({nodes:t}){const e=b(t,(t=>t.depth))+1,r=(s-i-a)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+a,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const i of o)i.sort(n);return o}(e);t=Math.min(l,(o-r)/(b(c,(t=>t.length))-1)),function(n){const e=w(n,(n=>(o-r-(n.length-1)*t)/S(n,N)));for(const i of n){let n=r;for(const r of i){r.y0=n,r.y1=n+r.value*e,n=r.y1+t;for(const t of r.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}v(i)}}(c);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);g(c,n,e),p(c,n,e)}}(d),D(d),d}function p(t,e,i){for(let r=1,s=t.length;r<s;++r){const s=t[r];for(const t of s){let n=0,i=0;for(const{source:e,value:s}of t.targetLinks){let r=s*(t.layer-e.layer);n+=E(e,t)*r,i+=r}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,k(t)}void 0===n&&s.sort(T),_(s,i)}}function g(t,e,i){for(let r=t.length-2;r>=0;--r){const s=t[r];for(const t of s){let n=0,i=0;for(const{target:e,value:s}of t.sourceLinks){let r=s*(e.layer-t.layer);n+=$(t,e)*r,i+=r}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,k(t)}void 0===n&&s.sort(T),_(s,i)}}function _(n,e){const i=n.length>>1,s=n[i];x(n,s.y0-t,i-1,e),m(n,s.y1+t,i+1,e),x(n,o,n.length-1,e),m(n,r,0,e)}function m(n,e,i,r){for(;i<n.length;++i){const s=n[i],o=(e-s.y0)*r;o>1e-6&&(s.y0+=o,s.y1+=o),e=s.y1+t}}function x(n,e,i,r){for(;i>=0;--i){const s=n[i],o=(s.y1-e)*r;o>1e-6&&(s.y0-=o,s.y1-=o),e=s.y0-t}}function k({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(I);for(const{target:{targetLinks:n}}of t)n.sort(M)}}function v(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(I),e.sort(M)}function E(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:r,width:s}of n.sourceLinks){if(r===e)break;i+=s+t}for(const{source:t,width:r}of e.targetLinks){if(t===n)break;i-=r}return i}function $(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:r,width:s}of e.targetLinks){if(r===n)break;i+=s+t}for(const{target:t,width:r}of n.sourceLinks){if(t===e)break;i-=r}return i}return d.update=function(t){return D(t),t},d.nodeId=function(t){return arguments.length?(c="function"==typeof t?t:A(t),d):c},d.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:A(t),d):h},d.nodeSort=function(t){return arguments.length?(n=t,d):n},d.nodeWidth=function(t){return arguments.length?(a=+t,d):a},d.nodePadding=function(n){return arguments.length?(l=t=+n,d):l},d.nodes=function(t){return arguments.length?(u="function"==typeof t?t:A(t),d):u},d.links=function(t){return arguments.length?(f="function"==typeof t?t:A(t),d):f},d.linkSort=function(t){return arguments.length?(e=t,d):e},d.size=function(t){return arguments.length?(i=r=0,s=+t[0],o=+t[1],d):[s-i,o-r]},d.extent=function(t){return arguments.length?(i=+t[0][0],s=+t[1][0],r=+t[0][1],o=+t[1][1],d):[[i,r],[s,o]]},d.iterations=function(t){return arguments.length?(y=+t,d):y},d}1===(k=x).length&&(v=k,k=function(t,n){return x(v(t),n)});var z=Math.PI,F=2*z,U=1e-6,W=F-U;function G(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function X(){return new G}function q(t){return function(){return t}}function V(t){return t[0]}function Y(t){return t[1]}G.prototype=X.prototype={constructor:G,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,r,s){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,n,e,i,r){t=+t,n=+n,e=+e,i=+i,r=+r;var s=this._x1,o=this._y1,a=e-t,l=i-n,c=s-t,h=o-n,u=c*c+h*h;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>U)if(Math.abs(h*a-l*c)>U&&r){var f=e-s,y=i-o,d=a*a+l*l,p=f*f+y*y,g=Math.sqrt(d),_=Math.sqrt(u),m=r*Math.tan((z-Math.acos((d+u-p)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>U&&(this._+="L"+(t+x*c)+","+(n+x*h)),this._+="A"+r+","+r+",0,0,"+ +(h*f>c*y)+","+(this._x1=t+k*a)+","+(this._y1=n+k*l)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,r,s){t=+t,n=+n,s=!!s;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),l=t+o,c=n+a,h=1^s,u=s?i-r:r-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>U||Math.abs(this._y1-c)>U)&&(this._+="L"+l+","+c),e&&(u<0&&(u=u%F+F),u>W?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>U&&(this._+="A"+e+","+e+",0,"+ +(u>=z)+","+h+","+(this._x1=t+e*Math.cos(r))+","+(this._y1=n+e*Math.sin(r))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var Q=Array.prototype.slice;function R(t){return t.source}function B(t){return t.target}function K(t,n,e,i,r){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,r,i,r)}function Z(){return function(t){var n=R,e=B,i=V,r=Y,s=null;function o(){var o,a=Q.call(arguments),l=n.apply(this,a),c=e.apply(this,a);if(s||(s=o=X()),t(s,+i.apply(this,(a[0]=l,a)),+r.apply(this,a),+i.apply(this,(a[0]=c,a)),+r.apply(this,a)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:q(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:q(+t),o):r},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o}(K)}function H(t){return[t.source.x1,t.y0]}function J(t){return[t.target.x0,t.y1]}var tt=function(){var t=i((function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e}),"o"),n=[1,9],e=[1,10],r=[1,5,10,12],s={trace:i((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:i((function(t,n,e,i,r,s,o){var a=s.length-1;switch(r){case 7:const t=i.findOrCreateNode(s[a-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(s[a-2].trim().replaceAll('""','"')),e=parseFloat(s[a].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=s[a];break;case 10:this.$=s[a-1]}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(r,[2,8]),t(r,[2,9]),{19:[1,16]},t(r,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(r,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:i((function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)}),"parseError"),parse:i((function(t){var n=this,e=[0],r=[],s=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),f=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);f.setInput(t,y.yy),y.yy.lexer=f,y.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var p=f.yylloc;o.push(p);var g=f.options&&f.options.ranges;function _(){var t;return"number"!=typeof(t=r.pop()||f.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,i((function(t){e.length=e.length-2*t,s.length=s.length-t,o.length=o.length-t}),"popStack"),i(_,"lex");for(var m,x,k,v,b,w,S,E,L={};;){if(x=e[e.length-1],this.defaultActions[x]?k=this.defaultActions[x]:(null==m&&(m=_()),k=a[x]&&a[x][m]),void 0===k||!k.length||!k[0]){var A="";for(b in E=[],a[x])this.terminals_[b]&&b>2&&E.push("'"+this.terminals_[b]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:p,expected:E})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+m);switch(k[0]){case 1:e.push(m),s.push(f.yytext),o.push(f.yylloc),e.push(k[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,p=f.yylloc;break;case 2:if(w=this.productions_[k[1]][1],L.$=s[s.length-w],L._$={first_line:o[o.length-(w||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(w||1)].first_column,last_column:o[o.length-1].last_column},g&&(L._$.range=[o[o.length-(w||1)].range[0],o[o.length-1].range[1]]),void 0!==(v=this.performAction.apply(L,[l,h,c,y.yy,k[1],s,o].concat(u))))return v;w&&(e=e.slice(0,-1*w*2),s=s.slice(0,-1*w),o=o.slice(0,-1*w)),e.push(this.productions_[k[1]][0]),s.push(L.$),o.push(L._$),S=a[e[e.length-2]][e[e.length-1]],e.push(S);break;case 3:return!0}}return!0}),"parse")},o=function(){return{EOF:1,parseError:i((function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)}),"parseError"),setInput:i((function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this}),"setInput"),input:i((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:i((function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this}),"unput"),more:i((function(){return this._more=!0,this}),"more"),reject:i((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:i((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:i((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:i((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:i((function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"}),"showPosition"),test_match:i((function(t,n){var e,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1}),"test_match"),next:i((function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((e=this._input.match(this.rules[r[s]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,r[s])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:i((function(){var t=this.next();return t||this.lex()}),"lex"),begin:i((function(t){this.conditionStack.push(t)}),"begin"),popState:i((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:i((function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules}),"_currentRules"),topState:i((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:i((function(t){this.begin(t)}),"pushState"),stateStackSize:i((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:i((function(t,n,e,i){switch(e){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}}),"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function a(){this.yy={}}return s.lexer=o,i(a,"Parser"),a.prototype=s,s.Parser=a,new a}();tt.parser=tt;var nt=tt,et=[],it=[],rt=new Map,st=i((()=>{et=[],it=[],rt=new Map,u()}),"clear"),ot=(i(t=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}},"SankeyLink"),t),at=i(((t,n,e)=>{et.push(new ot(t,n,e))}),"addLink"),lt=(i(n=class{constructor(t){this.ID=t}},"SankeyNode"),n),ct=i((t=>{t=f.sanitizeText(t,r());let n=rt.get(t);return void 0===n&&(n=new lt(t),rt.set(t,n),it.push(n)),n}),"findOrCreateNode"),ht=i((()=>it),"getNodes"),ut=i((()=>et),"getLinks"),ft=i((()=>({nodes:it.map((t=>({id:t.ID}))),links:et.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))})),"getGraph"),yt={nodesMap:rt,getConfig:i((()=>r().sankey),"getConfig"),getNodes:ht,getLinks:ut,getGraph:ft,addLink:at,findOrCreateNode:ct,getAccTitle:s,setAccTitle:o,getAccDescription:a,setAccDescription:l,getDiagramTitle:c,setDiagramTitle:h,clear:st},dt=(i(e=class{static next(t){return new e(t+ ++e.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},"Uid"),e.count=0,e),pt={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?w(t.sourceLinks,E)-1:0},justify:L},gt={draw:i((function(t,n,e,s){const{securityLevel:o,sankey:a}=r(),l=y.sankey;let c;"sandbox"===o&&(c=p("#i"+n));const h=p("sandbox"===o?c.nodes()[0].contentDocument.body:"body"),u="sandbox"===o?h.select(`[id="${n}"]`):p(`[id="${n}"]`),f=(null==a?void 0:a.width)??l.width,_=(null==a?void 0:a.height)??l.width,x=(null==a?void 0:a.useMaxWidth)??l.useMaxWidth,k=(null==a?void 0:a.nodeAlignment)??l.nodeAlignment,v=(null==a?void 0:a.prefix)??l.prefix,b=(null==a?void 0:a.suffix)??l.suffix,w=(null==a?void 0:a.showValues)??l.showValues,S=s.db.getGraph(),E=pt[k];$().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(w?15:0)).nodeAlign(E).extent([[0,0],[f,_]])(S);const L=g(m);u.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=dt.next("node-")).id)).attr("transform",(function(t){return"translate("+t.x0+","+t.y0+")"})).attr("x",(t=>t.x0)).attr("y",(t=>t.y0)).append("rect").attr("height",(t=>t.y1-t.y0)).attr("width",(t=>t.x1-t.x0)).attr("fill",(t=>L(t.id)));const A=i((({id:t,value:n})=>w?`${t}\n${v}${Math.round(100*n)/100}${b}`:t),"getText");u.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(S.nodes).join("text").attr("x",(t=>t.x0<f/2?t.x1+6:t.x0-6)).attr("y",(t=>(t.y1+t.y0)/2)).attr("dy",(w?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0<f/2?"start":"end")).text(A);const M=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),I=(null==a?void 0:a.linkColor)??"gradient";if("gradient"===I){const t=M.append("linearGradient").attr("id",(t=>(t.uid=dt.next("linearGradient-")).id)).attr("gradientUnits","userSpaceOnUse").attr("x1",(t=>t.source.x1)).attr("x2",(t=>t.target.x0));t.append("stop").attr("offset","0%").attr("stop-color",(t=>L(t.source.id))),t.append("stop").attr("offset","100%").attr("stop-color",(t=>L(t.target.id)))}let T;switch(I){case"gradient":T=i((t=>t.uid),"coloring");break;case"source":T=i((t=>L(t.source.id)),"coloring");break;case"target":T=i((t=>L(t.target.id)),"coloring");break;default:T=I}M.append("path").attr("d",Z().source(H).target(J)).attr("stroke",T).attr("stroke-width",(t=>Math.max(1,t.width))),d(void 0,u,0,x)}),"draw")},_t=i((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim()),"prepareTextForParsing"),mt=nt.parse.bind(nt);nt.parse=t=>mt(_t(t));var xt={parser:nt,db:yt,renderer:gt};export{xt as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t,r=Object.getOwnPropertyNames,n=(e={"assets/save-worker-8bKai79t.js"(e,t){var r,n,a;(n=r||(r={})).assertEqual=e=>e,n.assertIs=function(e){},n.assertNever=function(e){throw new Error},n.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},n.getValidEnumValues=e=>{const t=n.objectKeys(e).filter((t=>"number"!=typeof e[e[t]])),r={};for(const n of t)r[n]=e[n];return n.objectValues(r)},n.objectValues=e=>n.objectKeys(e).map((function(t){return e[t]})),n.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},n.find=(e,t)=>{for(const r of e)if(t(r))return r},n.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,n.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},n.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(a||(a={})).mergeShapes=(e,t)=>({...e,...t});const s=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}},o=r.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class d extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(n);else if("invalid_return_type"===a.code)n(a.returnTypeError);else if("invalid_arguments"===a.code)n(a.argumentsError);else if(0===a.path.length)r._errors.push(t(a));else{let e=r,n=0;for(;n<a.path.length;){const r=a.path[n];n===a.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(a))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof d))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}d.create=e=>new d(e);const c=(e,t)=>{let n;switch(e.code){case o.invalid_type:n=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,r.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:n=`Unrecognized key(s) in object: ${r.joinValues(e.keys,", ")}`;break;case o.invalid_union:n="Invalid input";break;case o.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${r.joinValues(e.options)}`;break;case o.invalid_enum_value:n=`Invalid enum value. Expected ${r.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:n="Invalid function arguments";break;case o.invalid_return_type:n="Invalid function return type";break;case o.invalid_date:n="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:r.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:n="Invalid input";break;case o.invalid_intersection_types:n="Intersection results could not be merged";break;case o.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:n="Number must be finite";break;default:n=t.defaultError,r.assertNever(e)}return{message:n}};let u=c;function l(){return u}const p=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],i={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let o="";const d=n.filter((e=>!!e)).slice().reverse();for(const c of d)o=c(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}};function h(e,t){const r=l(),n=p({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===c?void 0:c].filter((e=>!!e))});e.common.issues.push(n)}class m{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return f;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const e=await n.key,t=await n.value;r.push({key:e,value:t})}return m.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:a}=n;if("aborted"===t.status)return f;if("aborted"===a.status)return f;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!n.alwaysSet||(r[t.value]=a.value)}return{status:e.value,value:r}}}const f=Object.freeze({status:"aborted"}),y=e=>({status:"dirty",value:e}),g=e=>({status:"valid",value:e}),v=e=>"aborted"===e.status,_=e=>"dirty"===e.status,w=e=>"valid"===e.status,b=e=>"undefined"!=typeof Promise&&e instanceof Promise;function k(e,t,r,n){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function x(e,t,r,n,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var S,T,E,O;"function"==typeof SuppressedError&&SuppressedError,(T=S||(S={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},T.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class Z{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const N=(e,t)=>{if(w(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new d(e.common.issues);return this._error=t,this._error}}};function j(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:a}:{errorMap:(t,a)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(s=null!=o?o:n)&&void 0!==s?s:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:r)&&void 0!==i?i:a.defaultError}},description:a}}class P{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new m,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(b(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parseSync({data:e,path:n.path,parent:n});return N(n,a)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(b(n)?n:Promise.resolve(n));return N(r,a)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const a=e(t),s=()=>n.addIssue({code:o.custom,...r(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new Te({schema:this,typeName:Le.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ee.create(this,this._def)}nullable(){return Oe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ie.create(this,this._def)}promise(){return Se.create(this,this._def)}or(e){return ce.create([this,e],this._def)}and(e){return he.create(this,e,this._def)}transform(e){return new Te({...j(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ze({...j(this._def),innerType:this,defaultValue:t,typeName:Le.ZodDefault})}brand(){return new Ce({typeName:Le.ZodBranded,type:this,...j(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ne({...j(this._def),innerType:this,catchValue:t,typeName:Le.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Re.create(this,e)}readonly(){return Ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const C=/^c[^\s-]{8,}$/i,R=/^[0-9a-z]+$/,I=/^[0-9A-HJKMNP-TV-Z]{26}$/,$=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,A=/^[a-z0-9_-]{21}$/i,L=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,F=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let M;const D=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,U=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,q=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",V=new RegExp(`^${z}$`);function H(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function B(e){let t=`${z}T${H(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}class W extends P{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.string,received:t.parsedType}),f}const t=new m;let n;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const r=e.data.length>s.value,a=e.data.length<s.value;(r||a)&&(n=this._getOrReturnCtx(e,n),r?h(n,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&h(n,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)F.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"email",code:o.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)M||(M=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),M.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"emoji",code:o.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)$.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"uuid",code:o.invalid_string,message:s.message}),t.dirty());else if("nanoid"===s.kind)A.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"nanoid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)C.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"cuid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)R.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"cuid2",code:o.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)I.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"ulid",code:o.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new URL(e.data)}catch(d){n=this._getOrReturnCtx(e,n),h(n,{validation:"url",code:o.invalid_string,message:s.message}),t.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"regex",code:o.invalid_string,message:s.message}),t.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),h(n,{code:o.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),h(n,{code:o.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),h(n,{code:o.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):"datetime"===s.kind?B(s).test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:o.invalid_string,validation:"datetime",message:s.message}),t.dirty()):"date"===s.kind?V.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:o.invalid_string,validation:"date",message:s.message}),t.dirty()):"time"===s.kind?new RegExp(`^${H(s)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:o.invalid_string,validation:"time",message:s.message}),t.dirty()):"duration"===s.kind?L.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"duration",code:o.invalid_string,message:s.message}),t.dirty()):"ip"===s.kind?(a=e.data,("v4"!==(i=s.version)&&i||!D.test(a))&&("v6"!==i&&i||!U.test(a))&&(n=this._getOrReturnCtx(e,n),h(n,{validation:"ip",code:o.invalid_string,message:s.message}),t.dirty())):"base64"===s.kind?q.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"base64",code:o.invalid_string,message:s.message}),t.dirty()):r.assertNever(s);var a,i;return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:o.invalid_string,...S.errToObj(r)})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...S.errToObj(e)})}url(e){return this._addCheck({kind:"url",...S.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...S.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...S.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...S.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...S.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...S.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...S.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...S.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...S.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...S.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...S.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...S.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...S.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...S.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...S.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...S.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...S.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...S.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...S.errToObj(t)})}nonempty(e){return this.min(1,S.errToObj(e))}trim(){return new W({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function K(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}W.create=e=>{var t;return new W({checks:[],typeName:Le.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...j(e)})};class J extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==s.number){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.number,received:t.parsedType}),f}let t;const n=new m;for(const a of this._def.checks)"int"===a.kind?r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),h(t,{code:o.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):"multipleOf"===a.kind?0!==K(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_finite,message:a.message}),n.dirty()):r.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,r,n){return new J({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:S.toString(n)}]})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:S.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:S.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:S.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:S.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&r.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}J.create=e=>new J({checks:[],typeName:Le.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...j(e)});class Y extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==s.bigint){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.bigint,received:t.parsedType}),f}let t;const n=new m;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),h(t,{code:o.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):r.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,S.toString(t))}gt(e,t){return this.setLimit("min",e,!1,S.toString(t))}lte(e,t){return this.setLimit("max",e,!0,S.toString(t))}lt(e,t){return this.setLimit("max",e,!1,S.toString(t))}setLimit(e,t,r,n){return new Y({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:S.toString(n)}]})}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:S.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:S.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:S.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:S.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:S.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Y.create=e=>{var t;return new Y({checks:[],typeName:Le.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...j(e)})};class G extends P{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.boolean){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.boolean,received:t.parsedType}),f}return g(e.data)}}G.create=e=>new G({typeName:Le.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...j(e)});class X extends P{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.date,received:t.parsedType}),f}if(isNaN(e.data.getTime()))return h(this._getOrReturnCtx(e),{code:o.invalid_date}),f;const t=new m;let n;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:o.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:o.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):r.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:S.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:S.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}X.create=e=>new X({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Le.ZodDate,...j(e)});class Q extends P{_parse(e){if(this._getType(e)!==s.symbol){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.symbol,received:t.parsedType}),f}return g(e.data)}}Q.create=e=>new Q({typeName:Le.ZodSymbol,...j(e)});class ee extends P{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.undefined,received:t.parsedType}),f}return g(e.data)}}ee.create=e=>new ee({typeName:Le.ZodUndefined,...j(e)});class te extends P{_parse(e){if(this._getType(e)!==s.null){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.null,received:t.parsedType}),f}return g(e.data)}}te.create=e=>new te({typeName:Le.ZodNull,...j(e)});class re extends P{constructor(){super(...arguments),this._any=!0}_parse(e){return g(e.data)}}re.create=e=>new re({typeName:Le.ZodAny,...j(e)});class ne extends P{constructor(){super(...arguments),this._unknown=!0}_parse(e){return g(e.data)}}ne.create=e=>new ne({typeName:Le.ZodUnknown,...j(e)});class ae extends P{_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.never,received:t.parsedType}),f}}ae.create=e=>new ae({typeName:Le.ZodNever,...j(e)});class se extends P{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.void,received:t.parsedType}),f}return g(e.data)}}se.create=e=>new se({typeName:Le.ZodVoid,...j(e)});class ie extends P{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==s.array)return h(t,{code:o.invalid_type,expected:s.array,received:t.parsedType}),f;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,a=t.data.length<n.exactLength.value;(e||a)&&(h(t,{code:e?o.too_big:o.too_small,minimum:a?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(h(t,{code:o.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(h(t,{code:o.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new Z(t,e,t.path,r))))).then((e=>m.mergeArray(r,e)));const a=[...t.data].map(((e,r)=>n.type._parseSync(new Z(t,e,t.path,r))));return m.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new ie({...this._def,minLength:{value:e,message:S.toString(t)}})}max(e,t){return new ie({...this._def,maxLength:{value:e,message:S.toString(t)}})}length(e,t){return new ie({...this._def,exactLength:{value:e,message:S.toString(t)}})}nonempty(e){return this.min(1,e)}}function oe(e){if(e instanceof de){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Ee.create(oe(n))}return new de({...e._def,shape:()=>t})}return e instanceof ie?new ie({...e._def,type:oe(e.element)}):e instanceof Ee?Ee.create(oe(e.unwrap())):e instanceof Oe?Oe.create(oe(e.unwrap())):e instanceof me?me.create(e.items.map((e=>oe(e)))):e}ie.create=(e,t)=>new ie({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...j(t)});class de extends P{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=r.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==s.object){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),f}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof ae&&"strip"===this._def.unknownKeys))for(const s in r.data)a.includes(s)||i.push(s);const d=[];for(const s of a){const e=n[s],t=r.data[s];d.push({key:{status:"valid",value:s},value:e._parse(new Z(r,t,r.path,s)),alwaysSet:s in r.data})}if(this._def.catchall instanceof ae){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of i)d.push({key:{status:"valid",value:t},value:{status:"valid",value:r.data[t]}});else if("strict"===e)i.length>0&&(h(r,{code:o.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const n=r.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new Z(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>m.mergeObjectSync(t,e))):m.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return S.errToObj,new de({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,a,s,i;const o=null!==(s=null===(a=(n=this._def).errorMap)||void 0===a?void 0:a.call(n,t,r).message)&&void 0!==s?s:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=S.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new de({...this._def,unknownKeys:"strip"})}passthrough(){return new de({...this._def,unknownKeys:"passthrough"})}extend(e){return new de({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new de({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Le.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new de({...this._def,catchall:e})}pick(e){const t={};return r.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new de({...this._def,shape:()=>t})}omit(e){const t={};return r.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new de({...this._def,shape:()=>t})}deepPartial(){return oe(this)}partial(e){const t={};return r.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new de({...this._def,shape:()=>t})}required(e){const t={};return r.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof Ee;)e=e._def.innerType;t[r]=e}})),new de({...this._def,shape:()=>t})}keyof(){return be(r.objectKeys(this.shape))}}de.create=(e,t)=>new de({shape:()=>e,unknownKeys:"strip",catchall:ae.create(),typeName:Le.ZodObject,...j(t)}),de.strictCreate=(e,t)=>new de({shape:()=>e,unknownKeys:"strict",catchall:ae.create(),typeName:Le.ZodObject,...j(t)}),de.lazycreate=(e,t)=>new de({shape:e,unknownKeys:"strip",catchall:ae.create(),typeName:Le.ZodObject,...j(t)});class ce extends P{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const r=e.map((e=>new d(e.ctx.common.issues)));return h(t,{code:o.invalid_union,unionErrors:r}),f}));{let e;const n=[];for(const s of r){const r={...t,common:{...t.common,issues:[]},parent:null},a=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=n.map((e=>new d(e)));return h(t,{code:o.invalid_union,unionErrors:a}),f}}get options(){return this._def.options}}ce.create=(e,t)=>new ce({options:e,typeName:Le.ZodUnion,...j(t)});const ue=e=>e instanceof _e?ue(e.schema):e instanceof Te?ue(e.innerType()):e instanceof we?[e.value]:e instanceof ke?e.options:e instanceof xe?r.objectValues(e.enum):e instanceof Ze?ue(e._def.innerType):e instanceof ee?[void 0]:e instanceof te?[null]:e instanceof Ee?[void 0,...ue(e.unwrap())]:e instanceof Oe?[null,...ue(e.unwrap())]:e instanceof Ce||e instanceof Ie?ue(e.unwrap()):e instanceof Ne?ue(e._def.innerType):[];class le extends P{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return h(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),f;const r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(h(t,{code:o.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),f)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const a of t){const t=ue(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const r of t){if(n.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);n.set(r,a)}}return new le({typeName:Le.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...j(r)})}}function pe(e,t){const n=i(e),a=i(t);if(e===t)return{valid:!0,data:e};if(n===s.object&&a===s.object){const n=r.objectKeys(t),a=r.objectKeys(e).filter((e=>-1!==n.indexOf(e))),s={...e,...t};for(const r of a){const n=pe(e[r],t[r]);if(!n.valid)return{valid:!1};s[r]=n.data}return{valid:!0,data:s}}if(n===s.array&&a===s.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const a=pe(e[n],t[n]);if(!a.valid)return{valid:!1};r.push(a.data)}return{valid:!0,data:r}}return n===s.date&&a===s.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class he extends P{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(v(e)||v(n))return f;const a=pe(e.value,n.value);return a.valid?((_(e)||_(n))&&t.dirty(),{status:t.value,value:a.data}):(h(r,{code:o.invalid_intersection_types}),f)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}he.create=(e,t,r)=>new he({left:e,right:t,typeName:Le.ZodIntersection,...j(r)});class me extends P{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.array)return h(r,{code:o.invalid_type,expected:s.array,received:r.parsedType}),f;if(r.data.length<this._def.items.length)return h(r,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f;!this._def.rest&&r.data.length>this._def.items.length&&(h(r,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new Z(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>m.mergeArray(t,e))):m.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new me({...this._def,rest:e})}}me.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new me({items:e,typeName:Le.ZodTuple,rest:null,...j(t)})};class fe extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.object)return h(r,{code:o.invalid_type,expected:s.object,received:r.parsedType}),f;const n=[],a=this._def.keyType,i=this._def.valueType;for(const s in r.data)n.push({key:a._parse(new Z(r,s,r.path,s)),value:i._parse(new Z(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?m.mergeObjectAsync(t,n):m.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new fe(t instanceof P?{keyType:e,valueType:t,typeName:Le.ZodRecord,...j(r)}:{keyType:W.create(),valueType:e,typeName:Le.ZodRecord,...j(t)})}}class ye extends P{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.map)return h(r,{code:o.invalid_type,expected:s.map,received:r.parsedType}),f;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map((([e,t],s)=>({key:n._parse(new Z(r,e,r.path,[s,"key"])),value:a._parse(new Z(r,t,r.path,[s,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of i){const n=await r.key,a=await r.value;if("aborted"===n.status||"aborted"===a.status)return f;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of i){const n=r.key,a=r.value;if("aborted"===n.status||"aborted"===a.status)return f;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}}}ye.create=(e,t,r)=>new ye({valueType:t,keyType:e,typeName:Le.ZodMap,...j(r)});class ge extends P{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.set)return h(r,{code:o.invalid_type,expected:s.set,received:r.parsedType}),f;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(h(r,{code:o.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(h(r,{code:o.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(e){const r=new Set;for(const n of e){if("aborted"===n.status)return f;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const d=[...r.data.values()].map(((e,t)=>a._parse(new Z(r,e,r.path,t))));return r.common.async?Promise.all(d).then((e=>i(e))):i(d)}min(e,t){return new ge({...this._def,minSize:{value:e,message:S.toString(t)}})}max(e,t){return new ge({...this._def,maxSize:{value:e,message:S.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ge.create=(e,t)=>new ge({valueType:e,minSize:null,maxSize:null,typeName:Le.ZodSet,...j(t)});class ve extends P{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return h(t,{code:o.invalid_type,expected:s.function,received:t.parsedType}),f;function r(e,r){return p({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),c].filter((e=>!!e)),issueData:{code:o.invalid_arguments,argumentsError:r}})}function n(e,r){return p({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l(),c].filter((e=>!!e)),issueData:{code:o.invalid_return_type,returnTypeError:r}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof Se){const e=this;return g((async function(...t){const s=new d([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw s.addIssue(r(t,e)),s})),c=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(c,a).catch((e=>{throw s.addIssue(n(c,e)),s}))}))}{const e=this;return g((function(...t){const s=e._def.args.safeParse(t,a);if(!s.success)throw new d([r(t,s.error)]);const o=Reflect.apply(i,this,s.data),c=e._def.returns.safeParse(o,a);if(!c.success)throw new d([n(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ve({...this._def,args:me.create(e).rest(ne.create())})}returns(e){return new ve({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ve({args:e||me.create([]).rest(ne.create()),returns:t||ne.create(),typeName:Le.ZodFunction,...j(r)})}}class _e extends P{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(e,t)=>new _e({getter:e,typeName:Le.ZodLazy,...j(t)});class we extends P{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),f}return{status:"valid",value:e.data}}get value(){return this._def.value}}function be(e,t){return new ke({values:e,typeName:Le.ZodEnum,...j(t)})}we.create=(e,t)=>new we({value:e,typeName:Le.ZodLiteral,...j(t)});class ke extends P{constructor(){super(...arguments),E.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return h(t,{expected:r.joinValues(n),received:t.parsedType,code:o.invalid_type}),f}if(k(this,E)||x(this,E,new Set(this._def.values)),!k(this,E).has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return h(t,{received:t.data,code:o.invalid_enum_value,options:r}),f}return g(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ke.create(e,{...this._def,...t})}exclude(e,t=this._def){return ke.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}E=new WeakMap,ke.create=be;class xe extends P{constructor(){super(...arguments),O.set(this,void 0)}_parse(e){const t=r.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==s.string&&n.parsedType!==s.number){const e=r.objectValues(t);return h(n,{expected:r.joinValues(e),received:n.parsedType,code:o.invalid_type}),f}if(k(this,O)||x(this,O,new Set(r.getValidEnumValues(this._def.values))),!k(this,O).has(e.data)){const e=r.objectValues(t);return h(n,{received:n.data,code:o.invalid_enum_value,options:e}),f}return g(e.data)}get enum(){return this._def.values}}O=new WeakMap,xe.create=(e,t)=>new xe({values:e,typeName:Le.ZodNativeEnum,...j(t)});class Se extends P{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.promise&&!1===t.common.async)return h(t,{code:o.invalid_type,expected:s.promise,received:t.parsedType}),f;const r=t.parsedType===s.promise?t.data:Promise.resolve(t.data);return g(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Se.create=(e,t)=>new Se({type:e,typeName:Le.ZodPromise,...j(t)});class Te extends P{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:e=>{h(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){const e=a.transform(n.data,s);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return f;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?f:"dirty"===r.status||"dirty"===t.value?y(r.value):r}));{if("aborted"===t.value)return f;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?f:"dirty"===r.status||"dirty"===t.value?y(r.value):r}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,s);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?f:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((r=>"aborted"===r.status?f:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===a.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!w(e))return e;const r=a.transform(e.value,s);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>w(e)?Promise.resolve(a.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}r.assertNever(a)}}Te.create=(e,t,r)=>new Te({schema:e,typeName:Le.ZodEffects,effect:t,...j(r)}),Te.createWithPreprocess=(e,t,r)=>new Te({schema:t,effect:{type:"preprocess",transform:e},typeName:Le.ZodEffects,...j(r)});class Ee extends P{_parse(e){return this._getType(e)===s.undefined?g(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ee.create=(e,t)=>new Ee({innerType:e,typeName:Le.ZodOptional,...j(t)});class Oe extends P{_parse(e){return this._getType(e)===s.null?g(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oe.create=(e,t)=>new Oe({innerType:e,typeName:Le.ZodNullable,...j(t)});class Ze extends P{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===s.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:Le.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...j(t)});class Ne extends P{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return b(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new d(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new d(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ne.create=(e,t)=>new Ne({innerType:e,typeName:Le.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...j(t)});class je extends P{_parse(e){if(this._getType(e)!==s.nan){const t=this._getOrReturnCtx(e);return h(t,{code:o.invalid_type,expected:s.nan,received:t.parsedType}),f}return{status:"valid",value:e.data}}}je.create=e=>new je({typeName:Le.ZodNaN,...j(e)});const Pe=Symbol("zod_brand");class Ce extends P{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Re extends P{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),y(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?f:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Re({in:e,out:t,typeName:Le.ZodPipeline})}}class Ie extends P{_parse(e){const t=this._def.innerType._parse(e),r=e=>(w(e)&&(e.value=Object.freeze(e.value)),e);return b(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function $e(e,t={},r){return e?re.create().superRefine(((n,a)=>{var s,i;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:r)||void 0===i||i,d="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...d,fatal:o})}})):re.create()}Ie.create=(e,t)=>new Ie({innerType:e,typeName:Le.ZodReadonly,...j(t)});const Ae={object:de.lazycreate};var Le,Fe;(Fe=Le||(Le={})).ZodString="ZodString",Fe.ZodNumber="ZodNumber",Fe.ZodNaN="ZodNaN",Fe.ZodBigInt="ZodBigInt",Fe.ZodBoolean="ZodBoolean",Fe.ZodDate="ZodDate",Fe.ZodSymbol="ZodSymbol",Fe.ZodUndefined="ZodUndefined",Fe.ZodNull="ZodNull",Fe.ZodAny="ZodAny",Fe.ZodUnknown="ZodUnknown",Fe.ZodNever="ZodNever",Fe.ZodVoid="ZodVoid",Fe.ZodArray="ZodArray",Fe.ZodObject="ZodObject",Fe.ZodUnion="ZodUnion",Fe.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Fe.ZodIntersection="ZodIntersection",Fe.ZodTuple="ZodTuple",Fe.ZodRecord="ZodRecord",Fe.ZodMap="ZodMap",Fe.ZodSet="ZodSet",Fe.ZodFunction="ZodFunction",Fe.ZodLazy="ZodLazy",Fe.ZodLiteral="ZodLiteral",Fe.ZodEnum="ZodEnum",Fe.ZodEffects="ZodEffects",Fe.ZodNativeEnum="ZodNativeEnum",Fe.ZodOptional="ZodOptional",Fe.ZodNullable="ZodNullable",Fe.ZodDefault="ZodDefault",Fe.ZodCatch="ZodCatch",Fe.ZodPromise="ZodPromise",Fe.ZodBranded="ZodBranded",Fe.ZodPipeline="ZodPipeline",Fe.ZodReadonly="ZodReadonly";const Me=W.create,De=J.create,Ue=je.create,qe=Y.create,ze=G.create,Ve=X.create,He=Q.create,Be=ee.create,We=te.create,Ke=re.create,Je=ne.create,Ye=ae.create,Ge=se.create,Xe=ie.create,Qe=de.create,et=de.strictCreate,tt=ce.create,rt=le.create,nt=he.create,at=me.create,st=fe.create,it=ye.create,ot=ge.create,dt=ve.create,ct=_e.create,ut=we.create,lt=ke.create,pt=xe.create,ht=Se.create,mt=Te.create,ft=Ee.create,yt=Oe.create,gt=Te.createWithPreprocess,vt=Re.create,_t={string:e=>W.create({...e,coerce:!0}),number:e=>J.create({...e,coerce:!0}),boolean:e=>G.create({...e,coerce:!0}),bigint:e=>Y.create({...e,coerce:!0}),date:e=>X.create({...e,coerce:!0})},wt=f;var bt=Object.freeze({__proto__:null,defaultErrorMap:c,setErrorMap:function(e){u=e},getErrorMap:l,makeIssue:p,EMPTY_PATH:[],addIssueToContext:h,ParseStatus:m,INVALID:f,DIRTY:y,OK:g,isAborted:v,isDirty:_,isValid:w,isAsync:b,get util(){return r},get objectUtil(){return a},ZodParsedType:s,getParsedType:i,ZodType:P,datetimeRegex:B,ZodString:W,ZodNumber:J,ZodBigInt:Y,ZodBoolean:G,ZodDate:X,ZodSymbol:Q,ZodUndefined:ee,ZodNull:te,ZodAny:re,ZodUnknown:ne,ZodNever:ae,ZodVoid:se,ZodArray:ie,ZodObject:de,ZodUnion:ce,ZodDiscriminatedUnion:le,ZodIntersection:he,ZodTuple:me,ZodRecord:fe,ZodMap:ye,ZodSet:ge,ZodFunction:ve,ZodLazy:_e,ZodLiteral:we,ZodEnum:ke,ZodNativeEnum:xe,ZodPromise:Se,ZodEffects:Te,ZodTransformer:Te,ZodOptional:Ee,ZodNullable:Oe,ZodDefault:Ze,ZodCatch:Ne,ZodNaN:je,BRAND:Pe,ZodBranded:Ce,ZodPipeline:Re,ZodReadonly:Ie,custom:$e,Schema:P,ZodSchema:P,late:Ae,get ZodFirstPartyTypeKind(){return Le},coerce:_t,any:Ke,array:Xe,bigint:qe,boolean:ze,date:Ve,discriminatedUnion:rt,effect:mt,enum:lt,function:dt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>$e((t=>t instanceof e),t),intersection:nt,lazy:ct,literal:ut,map:it,nan:Ue,nativeEnum:pt,never:Ye,null:We,nullable:yt,number:De,object:Qe,oboolean:()=>ze().optional(),onumber:()=>De().optional(),optional:ft,ostring:()=>Me().optional(),pipeline:vt,preprocess:gt,promise:ht,record:st,set:ot,strictObject:et,string:Me,symbol:He,transformer:mt,tuple:at,undefined:Be,union:tt,unknown:Je,void:Ge,NEVER:wt,ZodIssueCode:o,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:d});const kt=bt.object({detail:bt.string()});function xt(e){if(!e)return"Unknown error";if(e instanceof Error){const t=kt.safeParse(e.cause);return t.success?t.data.detail:function(e){const t=function(e){try{return JSON.parse(e)}catch{return e}}(e);if(!t)return e;const r=kt.safeParse(t);return r.success?r.data.detail:e}(e.message)}if("object"==typeof e){const t=kt.safeParse(e);return t.success?t.data.detail:JSON.stringify(e)}try{return JSON.stringify(e)}catch{return String(e)}}const St=1e3;function Tt(e,t){const r=e.map((e=>`"${e}"`)).join(", ");return new Error(`This RPC instance cannot ${t} because the transport did not provide one or more of these methods: ${r}`)}function Et(e={}){let t={};function r(e){t=e}let n,a={};function s(e){var t;a.unregisterHandler&&a.unregisterHandler(),a=e,null==(t=a.registerHandler)||t.call(a,_)}function i(e){n="function"!=typeof e?(t,r)=>{const n=e[t];if(n)return n(r);const a=e._;if(!a)throw new Error(`The requested method has no handler: ${t}`);return a(t,r)}:e}const{maxRequestTime:o=St}=e;e.transport&&s(e.transport),e.requestHandler&&i(e.requestHandler),e._debugHooks&&r(e._debugHooks);let d=0;const c=new Map,u=new Map;function l(e,...r){const n=r[0];return new Promise(((r,s)=>{var i;if(!a.send)throw Tt(["send"],"make requests");const l=d<=1e10?++d:d=0,p={type:"request",id:l,method:e,params:n};c.set(l,{resolve:r,reject:s}),o!==1/0&&u.set(l,setTimeout((()=>{u.delete(l),s(new Error("RPC request timed out."))}),o)),null==(i=t.onSend)||i.call(t,p),a.send(p)}))}const p=new Proxy(l,{get:(e,t,r)=>t in e?Reflect.get(e,t,r):e=>l(t,e)}),h=p;function m(e,...r){var n;const s=r[0];if(!a.send)throw Tt(["send"],"send messages");const i={type:"message",id:e,payload:s};null==(n=t.onSend)||n.call(t,i),a.send(i)}const f=new Proxy(m,{get:(e,t,r)=>t in e?Reflect.get(e,t,r):e=>m(t,e)}),y=f,g=new Map,v=new Set;async function _(e){var r,s;if(null==(r=t.onReceive)||r.call(t,e),!("type"in e))throw new Error("Message does not contain a type.");if("request"===e.type){if(!a.send||!n)throw Tt(["send","requestHandler"],"handle requests");const{id:r,method:o,params:d}=e;let c;try{c={type:"response",id:r,success:!0,payload:await n(o,d)}}catch(i){if(!(i instanceof Error))throw i;c={type:"response",id:r,success:!1,error:i.message}}return null==(s=t.onSend)||s.call(t,c),void a.send(c)}if("response"!==e.type){if("message"!==e.type)throw new Error(`Unexpected RPC message type: ${e.type}`);{for(const r of v)r(e.id,e.payload);const t=g.get(e.id);if(!t)return;for(const r of t)r(e.payload)}}else{const t=u.get(e.id);null!=t&&clearTimeout(t);const{resolve:r,reject:n}=c.get(e.id)??{};e.success?null==r||r(e.payload):null==n||n(new Error(e.error))}}return{setTransport:s,setRequestHandler:i,request:p,requestProxy:h,send:f,sendProxy:y,addMessageListener:function(e,t){var r;if(!a.registerHandler)throw Tt(["registerHandler"],"register message listeners");"*"!==e?(g.has(e)||g.set(e,new Set),null==(r=g.get(e))||r.add(t)):v.add(t)},removeMessageListener:function(e,t){var r,n;"*"!==e?(null==(r=g.get(e))||r.delete(t),0===(null==(n=g.get(e))?void 0:n.size)&&g.delete(e)):v.delete(t)},proxy:{send:y,request:h},_setDebugHooks:r}}const Ot="[transport-id]";function Zt(e,t={}){const{transportId:r,filter:n,remotePort:a}=t,s=e,i=a??e;let o;return{send(e){i.postMessage(function(e,t){const{transportId:r}=t;return null!=r?{[Ot]:r,data:e}:e}(e,{transportId:r}))},registerHandler(e){o=t=>{const a=t.data,[s,i]=function(e,t){const{transportId:r,filter:n}=t,a=null==n?void 0:n();if(null!=r&&null!=a)throw new Error("Cannot use both `transportId` and `filter` at the same time");let s=e;if(r){if(e[Ot]!==r)return[!0];s=e.data}return!1===a?[!0]:[!1,s]}(a,{transportId:r,filter:()=>null==n?void 0:n(t)});s||e(i)},s.addEventListener("message",o)},unregisterHandler(){o&&s.removeEventListener("message",o)}}}const Nt={debug:(...e)=>{},log:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)},error:(...e)=>{console.error(...e)},trace:(...e)=>{console.trace(...e)}},jt="undefined"!=typeof window&&window.Logger||Nt;var Pt,Ct=Object.defineProperty,Rt=(e,t)=>Ct(e,"name",{value:t,configurable:!0}),It=(Pt=function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')},typeof require<"u"?require:typeof Proxy<"u"?new Proxy(Pt,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):Pt);function $t(e){return!isNaN(parseFloat(e))&&isFinite(e)}function At(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Lt(e){return function(){return this[e]}}Rt($t,"_isNumber"),Rt(At,"_capitalize"),Rt(Lt,"_getter");var Ft,Mt,Dt=["isConstructor","isEval","isNative","isToplevel"],Ut=["columnNumber","lineNumber"],qt=["fileName","functionName","source"],zt=Dt.concat(Ut,qt,["args"],["evalOrigin"]);function Vt(e){if(e)for(var t=0;t<zt.length;t++)void 0!==e[zt[t]]&&this["set"+At(zt[t])](e[zt[t]])}for(Rt(Vt,"StackFrame"),Vt.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof Vt)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new Vt(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",n=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:n?n+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r}},Vt.fromString=Rt((function(e){var t=e.indexOf("("),r=e.lastIndexOf(")"),n=e.substring(0,t),a=e.substring(t+1,r).split(","),s=e.substring(r+1);if(0===s.indexOf("@"))var i=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s,""),o=i[1],d=i[2],c=i[3];return new Vt({functionName:n,args:a||void 0,fileName:o,lineNumber:d||void 0,columnNumber:c||void 0})}),"StackFrame$$fromString"),Ft=0;Ft<Dt.length;Ft++)Vt.prototype["get"+At(Dt[Ft])]=Lt(Dt[Ft]),Vt.prototype["set"+At(Dt[Ft])]=function(e){return function(t){this[e]=!!t}}(Dt[Ft]);for(Mt=0;Mt<Ut.length;Mt++)Vt.prototype["get"+At(Ut[Mt])]=Lt(Ut[Mt]),Vt.prototype["set"+At(Ut[Mt])]=function(e){return function(t){if(!$t(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(Ut[Mt]);for(Ht=0;Ht<qt.length;Ht++)Vt.prototype["get"+At(qt[Ht])]=Lt(qt[Ht]),Vt.prototype["set"+At(qt[Ht])]=function(e){return function(t){this[e]=String(t)}}(qt[Ht]);var Ht,Bt=Vt;function Wt(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:Rt((function(t){if(t.stack&&t.stack.match(e))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")}),"ErrorStackParser$$parse"),extractLocation:Rt((function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]}),"ErrorStackParser$$extractLocation"),parseV8OrIE:Rt((function(t){return t.stack.split("\n").filter((function(t){return!!t.match(e)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=t.match(/ (\(.+\)$)/);t=r?t.replace(r[0],""):t;var n=this.extractLocation(r?r[1]:t),a=r&&t||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Bt({functionName:a,fileName:s,lineNumber:n[1],columnNumber:n[2],source:e})}),this)}),"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:Rt((function(e){return e.stack.split("\n").filter((function(e){return!e.match(t)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Bt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,a=this.extractLocation(e.replace(t,""));return new Bt({functionName:n,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:e})}),this)}),"ErrorStackParser$$parseFFOrSafari")}}Rt(Wt,"ErrorStackParser");var Kt,Jt,Yt,Gt,Xt,Qt,er,tr,rr,nr=new Wt,ar="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&!process.browser,sr=ar&&typeof t<"u"&&typeof t.exports<"u"&&typeof It<"u"&&typeof __dirname<"u",ir=ar&&!sr,or=typeof Deno<"u",dr=!ar&&!or,cr=dr&&"object"==typeof window&&"object"==typeof document&&"function"==typeof document.createElement&&"sessionStorage"in window&&"function"!=typeof importScripts,ur=dr&&"function"==typeof importScripts&&"object"==typeof self;async function lr(){if(!ar||(Kt=(await import("./__vite-browser-external-CIEyP2s7.js")).default,Gt=await import("./__vite-browser-external-CIEyP2s7.js"),Xt=await import("./__vite-browser-external-CIEyP2s7.js"),Yt=(await import("./__vite-browser-external-CIEyP2s7.js")).default,Jt=await import("./__vite-browser-external-CIEyP2s7.js"),er=Jt.sep,typeof It<"u"))return;let e={fs:Gt,crypto:await import("./__vite-browser-external-CIEyP2s7.js"),ws:await import("./__vite-browser-external-CIEyP2s7.js"),child_process:await import("./__vite-browser-external-CIEyP2s7.js")};globalThis.require=function(t){return e[t]}}function pr(e,t){return Jt.resolve(t||".",e)}function hr(e,t){return void 0===t&&(t=location),new URL(e,t).toString()}function mr(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:Xt.readFile(e).then((e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))}}function fr(e,t){let r=new URL(e,location);return{response:fetch(r,t?{integrity:t}:{})}}async function yr(e,t){let{response:r,binary:n}=tr(e,t);if(n)return n;let a=await r;if(!a.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await a.arrayBuffer())}if("object"==typeof navigator&&"string"==typeof navigator.userAgent&&-1==navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Safari"),Rt(lr,"initNodeModules"),Rt(pr,"node_resolvePath"),Rt(hr,"browser_resolvePath"),Qt=ar?pr:hr,ar||(er="/"),Rt(mr,"node_getBinaryResponse"),Rt(fr,"browser_getBinaryResponse"),tr=ar?mr:fr,Rt(yr,"loadBinaryFile"),cr)rr=Rt((async e=>await import(e)),"loadScript");else if(ur)rr=Rt((async e=>{try{globalThis.importScripts(e)}catch(t){if(!(t instanceof TypeError))throw t;await import(e)}}),"loadScript");else{if(!ar)throw new Error("Cannot determine runtime environment");rr=gr}async function gr(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?Yt.runInThisContext(await(await fetch(e)).text()):await import(Kt.pathToFileURL(e).href)}async function vr(e){if(ar){await lr();let t=await Xt.readFile(e,{encoding:"utf8"});return JSON.parse(t)}return await(await fetch(e)).json()}async function _r(){if(sr)return __dirname;let e;try{throw new Error}catch(n){e=n}let t=nr.parse(e)[0].fileName;if(ar&&!t.startsWith("file://")&&(t=`file://${t}`),ir){let e=await import("./__vite-browser-external-CIEyP2s7.js");return(await import("./__vite-browser-external-CIEyP2s7.js")).fileURLToPath(e.dirname(t))}let r=t.lastIndexOf(er);if(-1===r)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,r)}function wr(e){let t=e.FS,r=e.FS.filesystems.MEMFS,n=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:function(e){if(!e.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return r.mount.apply(null,arguments)},syncfs:async(e,t,r)=>{try{let n=a.getLocalSet(e),s=await a.getRemoteSet(e),i=t?s:n,o=t?n:s;await a.reconcile(e,i,o),r(null)}catch(n){r(n)}},getLocalSet:e=>{let r=Object.create(null);function a(e){return"."!==e&&".."!==e}function s(e){return t=>n.join2(e,t)}Rt(a,"isRealDir"),Rt(s,"toAbsolute");let i=t.readdir(e.mountpoint).filter(a).map(s(e.mountpoint));for(;i.length;){let e=i.pop(),n=t.stat(e);t.isDir(n.mode)&&i.push.apply(i,t.readdir(e).filter(a).map(s(e))),r[e]={timestamp:n.mtime,mode:n.mode}}return{type:"local",entries:r}},getRemoteSet:async e=>{let t=Object.create(null),r=await br(e.opts.fileSystemHandle);for(let[s,i]of r)"."!==s&&(t[n.join2(e.mountpoint,s)]={timestamp:"file"===i.kind?(await i.getFile()).lastModifiedDate:new Date,mode:"file"===i.kind?a.FILE_MODE:a.DIR_MODE});return{type:"remote",entries:t,handles:r}},loadLocalEntry:e=>{let n=t.lookupPath(e).node,a=t.stat(e);if(t.isDir(a.mode))return{timestamp:a.mtime,mode:a.mode};if(t.isFile(a.mode))return n.contents=r.getFileDataAsTypedArray(n),{timestamp:a.mtime,mode:a.mode,contents:n.contents};throw new Error("node type not supported")},storeLocalEntry:(e,r)=>{if(t.isDir(r.mode))t.mkdirTree(e,r.mode);else{if(!t.isFile(r.mode))throw new Error("node type not supported");t.writeFile(e,r.contents,{canOwn:!0})}t.chmod(e,r.mode),t.utime(e,r.timestamp,r.timestamp)},removeLocalEntry:e=>{var r=t.stat(e);t.isDir(r.mode)?t.rmdir(e):t.isFile(r.mode)&&t.unlink(e)},loadRemoteEntry:async e=>{if("file"===e.kind){let t=await e.getFile();return{contents:new Uint8Array(await t.arrayBuffer()),mode:a.FILE_MODE,timestamp:t.lastModifiedDate}}if("directory"===e.kind)return{mode:a.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+e.kind)},storeRemoteEntry:async(e,r,a)=>{let s=e.get(n.dirname(r)),i=t.isFile(a.mode)?await s.getFileHandle(n.basename(r),{create:!0}):await s.getDirectoryHandle(n.basename(r),{create:!0});if("file"===i.kind){let e=await i.createWritable();await e.write(a.contents),await e.close()}e.set(r,i)},removeRemoteEntry:async(e,t)=>{await e.get(n.dirname(t)).removeEntry(n.basename(t)),e.delete(t)},reconcile:async(e,r,s)=>{let i=0,o=[];Object.keys(r.entries).forEach((function(e){let n=r.entries[e],a=s.entries[e];(!a||t.isFile(n.mode)&&n.timestamp.getTime()>a.timestamp.getTime())&&(o.push(e),i++)})),o.sort();let d=[];if(Object.keys(s.entries).forEach((function(e){r.entries[e]||(d.push(e),i++)})),d.sort().reverse(),!i)return;let c="remote"===r.type?r.handles:s.handles;for(let t of o){let r=n.normalize(t.replace(e.mountpoint,"/")).substring(1);if("local"===s.type){let e=c.get(r),n=await a.loadRemoteEntry(e);a.storeLocalEntry(t,n)}else{let e=a.loadLocalEntry(t);await a.storeRemoteEntry(c,r,e)}}for(let t of d)if("local"===s.type)a.removeLocalEntry(t);else{let r=n.normalize(t.replace(e.mountpoint,"/")).substring(1);await a.removeRemoteEntry(c,r)}}};e.FS.filesystems.NATIVEFS_ASYNC=a}Rt(gr,"nodeLoadScript"),Rt(vr,"loadLockFile"),Rt(_r,"calculateDirname"),Rt(wr,"initializeNativeFS");var br=Rt((async e=>{let t=[];async function r(e){for await(let n of e.values())t.push(n),"directory"===n.kind&&await r(n)}Rt(r,"collect"),await r(e);let n=new Map;n.set(".",e);for(let a of t){let t=(await e.resolve(a)).join("/");n.set(t,a)}return n}),"getFsHandles");function kr(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Or(e),quit(e,r){throw t.exited={status:e,toThrow:r},r},print:e.stdout,printErr:e.stderr,arguments:e.args,API:{config:e},locateFile:t=>e.indexURL+t,instantiateWasm:Zr(e.indexURL)};return t}function xr(e){return function(t){try{t.FS.mkdirTree(e)}catch(r){console.error(`Error occurred while making a home directory '${e}':`),console.error(r),console.error("Using '/' for a home directory instead"),e="/"}t.FS.chdir(e)}}function Sr(e){return function(t){Object.assign(t.ENV,e)}}function Tr(e){return t=>{for(let r of e)t.FS.mkdirTree(r),t.FS.mount(t.FS.filesystems.NODEFS,{root:r},r)}}function Er(e){let t=yr(e);return e=>{let r=e._py_version_major(),n=e._py_version_minor();e.FS.mkdirTree("/lib"),e.FS.mkdirTree(`/lib/python${r}.${n}/site-packages`),e.addRunDependency("install-stdlib"),t.then((t=>{e.FS.writeFile(`/lib/python${r}${n}.zip`,t)})).catch((e=>{console.error("Error occurred while installing the standard library:"),console.error(e)})).finally((()=>{e.removeRunDependency("install-stdlib")}))}}function Or(e){let t;return t=null!=e.stdLibURL?e.stdLibURL:e.indexURL+"python_stdlib.zip",[Er(t),xr(e.env.HOME),Sr(e.env),Tr(e._node_mounts),wr]}function Zr(e){if(typeof WasmOffsetConverter<"u")return;let{binary:t,response:r}=tr(e+"pyodide.asm.wasm");return function(e,n){return async function(){try{let a;a=r?await WebAssembly.instantiateStreaming(r,e):await WebAssembly.instantiate(await t,e);let{instance:s,module:i}=a;n(s,i)}catch(a){console.warn("wasm instantiation failed!"),console.warn(a)}}(),{}}}Rt(kr,"createSettings"),Rt(xr,"createHomeDirectory"),Rt(Sr,"setEnvironment"),Rt(Tr,"mountLocalDirectories"),Rt(Er,"installStdlib"),Rt(Or,"getFileSystemInitializationFuncs"),Rt(Zr,"getInstantiateWasmFunc");var Nr="0.27.1";async function jr(e={}){var t,r;await lr();let n=e.indexURL||await _r();n=Qt(n),n.endsWith("/")||(n+="/"),e.indexURL=n;let a={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:n+"pyodide-lock.json",args:[],_node_mounts:[],env:{},packageCacheDir:n,packages:[],enableRunUntilComplete:!1,checkAPIVersion:!0,BUILD_ID:"974b1f1cb28e24c51bdff627c7a3dda121a3b48b7062365a8447ccefcf95367a"},s=Object.assign(a,e);(t=s.env).HOME??(t.HOME="/home/pyodide"),(r=s.env).PYTHONINSPECT??(r.PYTHONINSPECT="1");let i,o=kr(s),d=o.API;if(d.lockFilePromise=vr(s.lockFileURL),"function"!=typeof _createPyodideModule){let e=`${s.indexURL}pyodide.asm.js`;await rr(e)}if(e._loadSnapshot){let t=await e._loadSnapshot;i=ArrayBuffer.isView(t)?t:new Uint8Array(t),o.noInitialRun=!0,o.INITIAL_MEMORY=i.length}let c,u=await _createPyodideModule(o);if(o.exited)throw o.exited.toThrow;if(e.pyproxyToStringRepr&&d.setPyProxyToStringMethod(!0),d.version!==Nr&&s.checkAPIVersion)throw new Error(`Pyodide version does not match: '${Nr}' <==> '${d.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);u.locateFile=e=>{throw new Error("Didn't expect to load any more file_packager files!")},i&&(c=d.restoreSnapshot(i));let l=d.finalizeBootstrap(c,e._snapshotDeserializer);return d.sys.path.insert(0,d.config.env.HOME),l.version.includes("dev")||d.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${l.version}/full/`),d._pyodide.set_excepthook(),await d.packageIndexReady,d.initializeStreams(s.stdin,s.stdout,s.stderr),l}function Pr(e){return e.FS}Rt(jr,"loadPyodide");const Cr=e=>(new TextDecoder).decode(e),Rr="notebook.py",Ir="/marimo",$r=Rr,Ar=e=>{const t=Pr(e);try{t.mkdirTree(Ir)}catch{}t.chdir(Ir)},Lr=e=>{Pr(e).mount(e.FS.filesystems.IDBFS,{root:"."},Ir)},Fr=async e=>{await qr(e,!0)},Mr=async e=>{await qr(e,!1)},Dr=e=>{const t=Pr(e),r=`${Ir}/${Rr}`;return Cr(t.readFile(r))},Ur=e=>{const{pyodide:t,filename:r,code:n}=e,a=Pr(t);if(r&&r!==Rr){const e=(e=>{try{return Cr(a.readFile(e))}catch{return null}})(r);if(e)return{code:e,filename:r}}return a.writeFile(Rr,n),{code:n,filename:Rr}};function qr(e,t){return new Promise(((r,n)=>{Pr(e).syncfs(t,(e=>{e instanceof Error?n(e):r()}))}))}const zr=new class{constructor(){this.spans=[]}startSpan(e,t={}){const r={name:e,startTime:Date.now(),attributes:t,end:(e="ok")=>this.endSpan(r,e)};return this.spans.push(r),r}endSpan(e,t="ok"){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,r={}){const n=this.startSpan(t||e.name,r);try{const t=e();return this.endSpan(n),t}catch(a){throw this.endSpan(n,"error"),a}}wrapAsync(e,t,r={}){return async(...n)=>{const a=this.startSpan(t||e.name,r);try{const t=await e(...n);return this.endSpan(a),t}catch(s){throw this.endSpan(a,"error"),s}}}logSpans(){}};globalThis.t=zr;class Vr{constructor(){this.pyodide=null}get requirePyodide(){return function(e,t){if(!e)throw new Error(t)}(this.pyodide,"Pyodide not loaded"),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!jr)throw new Error("loadPyodide is not defined");const t=zr.startSpan("loadPyodide");try{const r=await jr({packages:["micropip","marimo-base","Markdown","pymdown-extensions","narwhals","packaging"],_makeSnapshot:!1,lockFileURL:`https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,indexURL:`https://cdn.jsdelivr.net/pyodide/${e.pyodideVersion}/full/`});return this.pyodide=r,t.end("ok"),r}catch(r){throw jt.error("Failed to load Pyodide",r),r}}async mountFilesystem(e){const t=zr.startSpan("mountFilesystem");return Ar(this.requirePyodide),Lr(this.requirePyodide),await Fr(this.requirePyodide),t.end("ok"),Ur({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){const{code:t,filename:r,onMessage:n,queryParameters:a,userConfig:s}=e;self.messenger={callback:n},self.query_params=a,self.user_config=s;const i=zr.startSpan("startSession.runPython"),o=r||$r,[d,c,u]=this.requirePyodide.runPython(`\n print("[py] Starting marimo...")\n import asyncio\n import js\n from marimo._pyodide.bootstrap import create_session, instantiate\n\n assert js.messenger, "messenger is not defined"\n assert js.query_params, "query_params is not defined"\n\n session, bridge = create_session(\n filename="${o}",\n query_params=js.query_params.to_py(),\n message_callback=js.messenger.callback,\n user_config=js.user_config.to_py(),\n )\n\n def init(auto_instantiate=True):\n instantiate(session, auto_instantiate)\n asyncio.create_task(session.start())\n\n # Find the packages to install\n with open("${o}", "r") as f:\n packages = session.find_packages(f.read())\n\n bridge, init, packages`);i.end();const l=new Set(u.toJs());return this.loadNotebookDeps(t,l).then((()=>c(s.runtime.auto_instantiate))),d}async loadNotebookDeps(e,t){const r=this.requirePyodide;e.includes("mo.sql")&&(e="import duckdb\n"+(e=`import pandas\n${e}`)),e="import pyodide_http\n"+(e="import jedi\n"+(e="import pygments\n"+(e=`import docutils\n${e}`)));const n=[...t];let a=zr.startSpan("pyodide.loadPackage");await r.loadPackagesFromImports(e,{errorCallback:jt.error,messageCallback:jt.log}),a.end(),a=zr.startSpan("micropip.install");const s=n.filter((e=>!r.loadedPackages[e]));s.length>0&&await r.runPythonAsync(`\n import micropip\n import sys\n # Filter out builtins\n missing = [p for p in ${JSON.stringify(s)} if p not in sys.modules]\n if len(missing) > 0:\n print("Loading from micropip:", missing)\n await micropip.install(missing)\n `).catch((e=>{jt.error("Failed to load packages from micropip",e)})),a.end()}}const Hr=async function(){var e;try{const t=self.name,r=function(e){return e.includes("dev"),`v${Nr}`}(t),n=await async function(e){try{return await import(`/wasm/controller.js?version=${e}`)}catch{return new Vr}}(t);self.controller=n,self.pyodide=await n.bootstrap({version:t,pyodideVersion:r}),await(null==(e=n.mountFilesystem)?void 0:e.call(n,{code:"",filename:null})),Wr.send.initialized({})}catch(t){jt.error("Error bootstrapping",t),Wr.send.initializedError({error:xt(t)})}}(),Br={readFile:async e=>(await Hr,Cr(self.pyodide.FS.readFile(e))),readNotebook:async()=>(await Hr,Dr(self.pyodide)),saveNotebook:async e=>{await Hr;const t=self.pyodide.runPython("\n from marimo._pyodide.bootstrap import save_file\n\n save_file\n ");await t(JSON.stringify(e),$r),await Mr(self.pyodide)}},Wr=function(e){return Et(e)}({transport:(Kr={transportId:"marimo-transport"},Zt(self,Kr)),requestHandler:Br});var Kr;Wr.send("ready",{})}},function(){return t||(0,e[r(e)[0]])((t={exports:{}}).exports,t),t.exports});export default n();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="comment",t="string",n="symbol",r="atom",a="number",i="bracket";function s(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}var c=s("λ case-lambda call/cc class cond-expand define-class define-values exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax define-macro defmacro delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),l=s("define let letrec let* lambda define-macro defmacro let-syntax letrec-syntax let-values let*-values define-syntax syntax-rules define-values when unless");function o(e,t,n){this.indent=e,this.type=t,this.prev=n}function d(e,t,n){e.indentStack=new o(t,n,e.indentStack)}var u=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),m=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),p=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),f=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);function h(e){return e.match(u)}function g(e){return e.match(m)}function x(e,t){return!0===t&&e.backUp(1),e.match(f)}function b(e){return e.match(p)}function v(e,t){for(var n,r=!1;null!=(n=e.next());){if(n==t.token&&!r){t.state.mode=!1;break}r=!r&&"\\"==n}}const k={name:"scheme",startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1,sExprQuote:!1}},token:function(s,o){if(null==o.indentStack&&s.sol()&&(o.indentation=s.indentation()),s.eatSpace())return null;var u=null;switch(o.mode){case"string":v(s,{token:'"',state:o}),u=t;break;case"symbol":v(s,{token:"|",state:o}),u=n;break;case"comment":for(var m,p=!1;null!=(m=s.next());){if("#"==m&&p){o.mode=!1;break}p="|"==m}u=e;break;case"s-expr-comment":if(o.mode=!1,"("!=s.peek()&&"["!=s.peek()){s.eatWhile(/[^\s\(\)\[\]]/),u=e;break}o.sExprComment=0;default:var f=s.next();if('"'==f)o.mode="string",u=t;else if("'"==f)"("==s.peek()||"["==s.peek()?("number"!=typeof o.sExprQuote&&(o.sExprQuote=0),u=r):(s.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),u=r);else if("|"==f)o.mode="symbol",u=n;else if("#"==f)if(s.eat("|"))o.mode="comment",u=e;else if(s.eat(/[tf]/i))u=r;else if(s.eat(";"))o.mode="s-expr-comment",u=e;else{var k=null,y=!1,w=!0;s.eat(/[ei]/i)?y=!0:s.backUp(1),s.match(/^#b/i)?k=h:s.match(/^#o/i)?k=g:s.match(/^#x/i)?k=b:s.match(/^#d/i)?k=x:s.match(/^[-+0-9.]/,!1)?(w=!1,k=x):y||s.eat("#"),null!=k&&(w&&!y&&s.match(/^#[ei]/i),k(s)&&(u=a))}else if(/^[-+0-9.]/.test(f)&&x(s,!0))u=a;else if(";"==f)s.skipToEnd(),u=e;else if("("==f||"["==f){for(var E,S="",q=s.column();null!=(E=s.eat(/[^\s\(\[\;\)\]]/));)S+=E;S.length>0&&l.propertyIsEnumerable(S)?d(o,q+2,f):(s.eatSpace(),s.eol()||";"==s.peek()?d(o,q+1,f):d(o,q+s.current().length,f)),s.backUp(s.current().length-1),"number"==typeof o.sExprComment&&o.sExprComment++,"number"==typeof o.sExprQuote&&o.sExprQuote++,u=i}else")"==f||"]"==f?(u=i,null!=o.indentStack&&o.indentStack.type==(")"==f?"(":"[")&&(!function(e){e.indentStack=e.indentStack.prev}(o),"number"==typeof o.sExprComment&&0==--o.sExprComment&&(u=e,o.sExprComment=!1),"number"==typeof o.sExprQuote&&0==--o.sExprQuote&&(u=r,o.sExprQuote=!1))):(s.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),u=c
|
|
1
|
+
var e="comment",t="string",n="symbol",r="atom",a="number",i="bracket";function s(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}var c=s("λ case-lambda call/cc class cond-expand define-class define-values exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax define-macro defmacro delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),l=s("define let letrec let* lambda define-macro defmacro let-syntax letrec-syntax let-values let*-values define-syntax syntax-rules define-values when unless");function o(e,t,n){this.indent=e,this.type=t,this.prev=n}function d(e,t,n){e.indentStack=new o(t,n,e.indentStack)}var u=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),m=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),p=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),f=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);function h(e){return e.match(u)}function g(e){return e.match(m)}function x(e,t){return!0===t&&e.backUp(1),e.match(f)}function b(e){return e.match(p)}function v(e,t){for(var n,r=!1;null!=(n=e.next());){if(n==t.token&&!r){t.state.mode=!1;break}r=!r&&"\\"==n}}const k={name:"scheme",startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1,sExprQuote:!1}},token:function(s,o){if(null==o.indentStack&&s.sol()&&(o.indentation=s.indentation()),s.eatSpace())return null;var u=null;switch(o.mode){case"string":v(s,{token:'"',state:o}),u=t;break;case"symbol":v(s,{token:"|",state:o}),u=n;break;case"comment":for(var m,p=!1;null!=(m=s.next());){if("#"==m&&p){o.mode=!1;break}p="|"==m}u=e;break;case"s-expr-comment":if(o.mode=!1,"("!=s.peek()&&"["!=s.peek()){s.eatWhile(/[^\s\(\)\[\]]/),u=e;break}o.sExprComment=0;default:var f=s.next();if('"'==f)o.mode="string",u=t;else if("'"==f)"("==s.peek()||"["==s.peek()?("number"!=typeof o.sExprQuote&&(o.sExprQuote=0),u=r):(s.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),u=r);else if("|"==f)o.mode="symbol",u=n;else if("#"==f)if(s.eat("|"))o.mode="comment",u=e;else if(s.eat(/[tf]/i))u=r;else if(s.eat(";"))o.mode="s-expr-comment",u=e;else{var k=null,y=!1,w=!0;s.eat(/[ei]/i)?y=!0:s.backUp(1),s.match(/^#b/i)?k=h:s.match(/^#o/i)?k=g:s.match(/^#x/i)?k=b:s.match(/^#d/i)?k=x:s.match(/^[-+0-9.]/,!1)?(w=!1,k=x):y||s.eat("#"),null!=k&&(w&&!y&&s.match(/^#[ei]/i),k(s)&&(u=a))}else if(/^[-+0-9.]/.test(f)&&x(s,!0))u=a;else if(";"==f)s.skipToEnd(),u=e;else if("("==f||"["==f){for(var E,S="",q=s.column();null!=(E=s.eat(/[^\s\(\[\;\)\]]/));)S+=E;S.length>0&&l.propertyIsEnumerable(S)?d(o,q+2,f):(s.eatSpace(),s.eol()||";"==s.peek()?d(o,q+1,f):d(o,q+s.current().length,f)),s.backUp(s.current().length-1),"number"==typeof o.sExprComment&&o.sExprComment++,"number"==typeof o.sExprQuote&&o.sExprQuote++,u=i}else")"==f||"]"==f?(u=i,null!=o.indentStack&&o.indentStack.type==(")"==f?"(":"[")&&(!function(e){e.indentStack=e.indentStack.prev}(o),"number"==typeof o.sExprComment&&0==--o.sExprComment&&(u=e,o.sExprComment=!1),"number"==typeof o.sExprQuote&&0==--o.sExprQuote&&(u=r,o.sExprQuote=!1))):(s.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),u=c.propertyIsEnumerable(s.current())?"builtin":"variable")}return"number"==typeof o.sExprComment?e:"number"==typeof o.sExprQuote?r:u},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},languageData:{closeBrackets:{brackets:["(","[","{",'"']},commentTokens:{line:";;"}}};export{k as scheme};
|