orbitchat 2.6.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/orbitchat.js +6 -0
- package/dist/assets/{_baseUniq-BPMphbq5-Bc3mfrWu.js → _baseUniq-BPMphbq5-DxDS_DP8.js} +1 -1
- package/dist/assets/{api-BYQtjDFb.js → api-BYvRAHp8.js} +1 -1
- package/dist/assets/{arc-D9rhTKV0-DqltxDCK.js → arc-D9rhTKV0-KnyPe3uY.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-BiqZtsDe-DssPmlMz.js → architectureDiagram-VXUJARFQ-BiqZtsDe-CZ3WiY-q.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-zcRIdFTD-VGN02_C2.js → blockDiagram-VD42YOAC-zcRIdFTD-BC7D6Vxt.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-DYXNcDX4-B3MMT-QA.js → c4Diagram-YG6GDRKO-DYXNcDX4-55ZTxY0k.js} +1 -1
- package/dist/assets/channel-CUIutAfm-CyeeIMzr.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-DAh9ktmY-CSlRfDiD.js → chunk-4BX2VUAB-DAh9ktmY-gtVQbgyn.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-Cza7pcpr-Dk0Y3FWi.js → chunk-55IACEB6-Cza7pcpr-DCWU8s6Y.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-BTUSpeKy-GQz22Pxu.js → chunk-B4BG7PRW-BTUSpeKy-lK-0nOZL.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-DKt4WII7-eoubkYKX.js → chunk-DI55MBZ5-DKt4WII7-DXo76uJq.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-DdcCR8w3-DD7VLulG.js → chunk-FMBD7UC4-DdcCR8w3-DW3gja5S.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-v6AkzOl1-63Ww-l7h.js → chunk-QN33PNHL-v6AkzOl1-Dh4p95uo.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-DVJOrqBZ-Vi2nR9Fj.js → chunk-QZHKN3VN-DVJOrqBZ-BiKdf0Im.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-G2jJHqli-CQcB4RBh.js → chunk-TZMSLE5B-G2jJHqli-UJaOO59u.js} +1 -1
- package/dist/assets/{classDiagram-2ON5EDUG-CxmgTanh-wtMdojNI.js → classDiagram-2ON5EDUG-CxmgTanh-BL76V_fR.js} +1 -1
- package/dist/assets/{classDiagram-v2-WZHVMYZB-CxmgTanh-wtMdojNI.js → classDiagram-v2-WZHVMYZB-CxmgTanh-BL76V_fR.js} +1 -1
- package/dist/assets/clone-CsNB4mMi-BOqjYs-M.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-BRr2Y6dg-BMbgPATB.js → cose-bilkent-S5V4N54A-BRr2Y6dg-BYJ0KNVA.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-DX8gNHmJ-BjcfHAjB.js → dagre-6UL2VRFP-DX8gNHmJ-SU8Y5CAY.js} +1 -1
- package/dist/assets/{diagram-PSM6KHXK-DNX818To-Dqs4xXI7.js → diagram-PSM6KHXK-DNX818To-axZON_1p.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-BDO6hKtm-DEMoX6J4.js → diagram-QEK2KX5R-BDO6hKtm-D9aQxRi5.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-IEqaDwzi-B_wvJB6W.js → diagram-S2PKOQOG-IEqaDwzi-BbtpMEAd.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-DbLpN8Jp-Bkgo1EkO.js → erDiagram-Q2GNP2WA-DbLpN8Jp-v3B6347e.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-pJlHae8Y-BqYiH4aw.js → flowDiagram-NV44I4VS-pJlHae8Y-BPg_yPGy.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-J0Tkq5TR-BXZ-NHAu.js → ganttDiagram-JELNMOA3-J0Tkq5TR-DqyS2ekT.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NY62KEGX-DgYonpsZ-DDGeDkgp.js → gitGraphDiagram-NY62KEGX-DgYonpsZ-DdSNLj3c.js} +1 -1
- package/dist/assets/{graph-BpcfrHXY-BxLMpmgE.js → graph-BpcfrHXY-BdEJ7yQe.js} +1 -1
- package/dist/assets/{index-Cat4tDb5.js → index-CH486f5J.js} +191 -185
- package/dist/assets/{index-DvNpGWs7-CkhNmeVZ.js → index-DvNpGWs7-CnBp3gAk.js} +1 -1
- package/dist/assets/{infoDiagram-WHAUD3N6-C3JLOAnb-DUp3F_EX.js → infoDiagram-WHAUD3N6-C3JLOAnb-BkvEuhwS.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-CfjB2Qdf-NCO4ZbSS.js → journeyDiagram-XKPGCS4Q-CfjB2Qdf-BIcG-Rf7.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-CrW8yVmd-C4KZAM4N.js → kanban-definition-3W4ZIXB7-CrW8yVmd-bXTGtSL7.js} +1 -1
- package/dist/assets/{layout-bsfAhWjc-I5CzbVSc.js → layout-bsfAhWjc-DOm-XLuA.js} +1 -1
- package/dist/assets/{min-C2aDz5ZK-LEKv4vLP.js → min-C2aDz5ZK-BLKawk6b.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-Dj37RkY_-D_8NN8IJ.js → mindmap-definition-VGOIOE7T-Dj37RkY_-DCjDoQC8.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-BiQvDx8I-DmOOdQdq.js → pieDiagram-ADFJNKIX-BiQvDx8I-Br3r0oWd.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-D4b-YFzI-DLjmAXSU.js → quadrantDiagram-AYHSOK5B-D4b-YFzI-lOeRTpQG.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-km07nlVd-VQM3DztJ.js → requirementDiagram-UZGBJVZJ-km07nlVd-C4pwEb8H.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-LfuSRRbf-C1RPrj1E.js → sankeyDiagram-TZEHDZUN-LfuSRRbf-DK0314pz.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-CQ4J-0_7-Cyd5FAqA.js → sequenceDiagram-WL72ISMW-CQ4J-0_7-CDv5iWFq.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-JtogJwt6-BpzYUxJb.js → stateDiagram-FKZM4ZOC-JtogJwt6-vGdBdnBe.js} +1 -1
- package/dist/assets/{stateDiagram-v2-4FDKWEC3-DuQ7UaeU-KzCrTqY2.js → stateDiagram-v2-4FDKWEC3-DuQ7UaeU-DAQthLJ-.js} +1 -1
- package/dist/assets/{timeline-definition-IT6M3QCI-Cs3NnF2M-BB4l57DU.js → timeline-definition-IT6M3QCI-Cs3NnF2M-KVCTjvWt.js} +1 -1
- package/dist/assets/{treemap-KMMF4GRG-CkW25-tn-OIkc-foi.js → treemap-KMMF4GRG-CkW25-tn-BQQfKVqt.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-JzAaXa5z-CQhLeS5W.js → xychartDiagram-PRI3JC2R-JzAaXa5z-GBOEuw5Y.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/channel-CUIutAfm-DKqX6_5M.js +0 -1
- package/dist/assets/clone-CsNB4mMi-Dkw770wp.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as os}from"./index-Cat4tDb5.js";function cs(T,g){for(var p=0;p<g.length;p++){const o=g[p];if(typeof o!="string"&&!Array.isArray(o)){for(const r in o)if(r!=="default"&&!(r in T)){const n=Object.getOwnPropertyDescriptor(o,r);n&&Object.defineProperty(T,r,n.get?n:{enumerable:!0,get:()=>o[r]})}}}return Object.freeze(Object.defineProperty(T,Symbol.toStringTag,{value:"Module"}))}var Xe,Yr;function ls(){if(Yr)return Xe;Yr=1;var T="6.5.2";return Xe=T,Xe}var Ke,Rr;function Br(){if(Rr)return Ke;Rr=1;var T=function(p,o){var r=this;if(o||(o={}),r.qpm=o.qpm?parseInt(o.qpm,10):null,!r.qpm){var n=p.metaText?p.metaText.tempo:null;r.qpm=p.getBpm(n)}r.extraMeasuresAtBeginning=o.extraMeasuresAtBeginning?parseInt(o.extraMeasuresAtBeginning,10):0,r.beatCallback=o.beatCallback,r.eventCallback=o.eventCallback,r.lineEndCallback=o.lineEndCallback,r.lineEndAnticipation=o.lineEndAnticipation?parseInt(o.lineEndAnticipation,10):0,r.beatSubdivisions=o.beatSubdivisions?parseInt(o.beatSubdivisions,10):1,r.joggerTimer=null,r.replaceTarget=function(s){r.noteTimings=s.setTiming(r.qpm,r.extraMeasuresAtBeginning),s.noteTimings.length===0&&(r.noteTimings=s.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=g(s.noteTimings,r.lineEndAnticipation)),r.startTime=null,r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.currentTime=0,r.isPaused=!1,r.isRunning=!1,r.pausedPercent=null,r.justUnpaused=!1,r.newSeekPercent=0,r.lastTimestamp=0,r.noteTimings.length!==0&&(r.millisecondsPerBeat=1e3/(r.qpm/60)/r.beatSubdivisions,r.lastMoment=r.noteTimings[r.noteTimings.length-1].milliseconds,r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat))},r.replaceTarget(p),r.doTiming=function(s){if(r.lastTimestamp!==s&&(r.lastTimestamp=s,r.startTime||(r.startTime=s),!r.isPaused&&r.isRunning)){for(r.currentTime=s-r.startTime,r.currentTime+=16;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;){if(r.eventCallback&&r.noteTimings[r.currentEvent].type==="event"){var l=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),l!==r.startTime&&(r.currentTime=s-r.startTime)}r.currentEvent++}if(r.lineEndCallback&&r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds<r.currentTime&&r.currentEvent<r.noteTimings.length){var d=r.noteTimings[r.currentEvent].milliseconds===r.currentTime?r.noteTimings[r.currentEvent]:r.noteTimings[r.currentEvent-1];r.lineEndCallback(r.lineEndTimings[r.currentLine],d,{line:r.currentLine,endTimings:r.lineEndTimings,currentTime:r.currentTime}),r.currentLine++}if(r.currentTime<r.lastMoment){if(requestAnimationFrame(r.doTiming),r.currentBeat*r.millisecondsPerBeat<r.currentTime){var f=r.doBeatCallback(s);f!==null&&(r.currentTime=f)}}else if(r.currentBeat<=r.totalBeats&&r.beatCallback){var u=r.doBeatCallback(s);u!==null&&(r.currentTime=u),requestAnimationFrame(r.doTiming)}if(r.currentTime>=r.lastMoment)if(r.eventCallback){var i=r.eventCallback(null);r.shouldStop(i).then(function(t){t&&r.stop()})}else r.stop()}},r.shouldStop=function(s){return new Promise(function(l){if(!s)return l(!0);if(s==="continue")return l(!1);s.then&&s.then(function(d){l(d!=="continue")})})},r.doBeatCallback=function(s){if(r.beatCallback){for(var l=r.currentEvent;l<r.noteTimings.length&&r.noteTimings[l].left===null;)l++;var d,f;if(l<r.noteTimings.length){for(d=r.noteTimings[l].milliseconds,l=Math.max(0,r.currentEvent-1);l>=0&&r.noteTimings[l].left===null;)l--;f=r.noteTimings[l]}var u={},i={};if(f){u.top=f.top,u.height=f.height;var t=Math.max(0,s-r.startTime-f.milliseconds),a=d-f.milliseconds,e=f.endX-f.left,h=a?t*e/a:0;u.left=f.left+h,r.currentEvent===0&&f.milliseconds>s-r.startTime&&(u.left=void 0),i={timestamp:s,startTime:r.startTime,ev:f,endMs:d,offMs:t,offPx:h,gapMs:a,gapPx:e}}else i={timestamp:s,startTime:r.startTime};var v=r.startTime;if(r.beatCallback(r.currentBeat/r.beatSubdivisions,r.totalBeats/r.beatSubdivisions,r.lastMoment,u,i),v!==r.startTime)return s-r.startTime;r.currentBeat++}return null};var c=60;r.animationJogger=function(){r.isRunning&&(r.doTiming(performance.now()),r.joggerTimer=setTimeout(r.animationJogger,c))},r.start=function(s,l){if(r.isRunning=!0,r.isPaused&&(r.isPaused=!1,s===void 0&&(r.justUnpaused=!0)),s)r.setProgress(s,l);else if(s===0)r.reset();else if(r.pausedPercent!==null){var d=performance.now();r.currentTime=r.lastMoment*r.pausedPercent,r.startTime=d-r.currentTime,r.pausedPercent=null,r.reportNext=!0}requestAnimationFrame(r.doTiming),r.joggerTimer=setTimeout(r.animationJogger,c)},r.pause=function(){r.isPaused=!0;var s=performance.now();r.pausedPercent=(s-r.startTime)/r.lastMoment,r.isRunning=!1,r.joggerTimer&&(clearTimeout(r.joggerTimer),r.joggerTimer=null)},r.currentMillisecond=function(){return r.currentTime},r.reset=function(){r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.startTime=null,r.pausedPercent=null},r.stop=function(){r.pause(),r.reset()},r.setProgress=function(s,l){var d;switch(l){case"seconds":r.currentTime=s*1e3,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),d=r.currentTime/r.lastMoment;break;case"beats":r.currentTime=s*r.millisecondsPerBeat*r.beatSubdivisions,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),d=r.currentTime/r.lastMoment;break;default:d=s,d<0&&(d=0),d>1&&(d=1),r.currentTime=r.lastMoment*d;break}r.isRunning||(r.pausedPercent=d);var f=performance.now();for(r.startTime=f-r.currentTime,r.currentEvent,r.currentEvent=0;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;)r.currentEvent++;if(r.lineEndCallback)for(r.currentLine=0;r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds+r.lineEndAnticipation<r.currentTime;)r.currentLine++;var u=r.currentBeat;r.currentBeat=Math.floor(r.currentTime/r.millisecondsPerBeat),r.beatCallback&&u!==r.currentBeat&&r.doBeatCallback(r.startTime+r.currentTime),r.eventCallback&&r.currentEvent>=0&&r.noteTimings[r.currentEvent].type==="event"&&r.eventCallback(r.noteTimings[r.currentEvent]),r.lineEndCallback&&r.lineEndCallback(r.lineEndTimings[r.currentLine],r.noteTimings[r.currentEvent],{line:r.currentLine,endTimings:r.lineEndTimings}),r.joggerTimer=setTimeout(r.animationJogger,c)}};function g(p,o){for(var r=[],n=null,c=0;c<p.length;c++){var s=p[c];s.type!=="end"&&s.top!==n&&(r.push({measureNumber:s.measureNumber,milliseconds:s.milliseconds-o,top:s.top,bottom:s.top+s.height}),n=s.top)}return r}return Ke=T,Ke}var Ue,Wr;function hs(){if(Wr)return Ue;Wr=1;var T=Br(),g={};return function(){var p,o;g.startAnimation=function(r,n,c){p&&(p.stop(),p=void 0),c.showCursor&&(o=r.querySelector(".abcjs-cursor"),o||(o=document.createElement("DIV"),o.className="abcjs-cursor cursor",o.style.position="absolute",r.appendChild(o),r.style.position="relative"));function s(a){for(var e=0;e<a.length;e++){var h=a[e];h.classList.contains("abcjs-bar")||(h.style.display="none")}}var l;function d(a){if(l){var e=r.querySelectorAll(l);s(e)}l=a}function f(a){var e=r.querySelectorAll(a);s(e)}function u(a){c.hideCurrentMeasure?f(a):c.hideFinishedMeasures&&d(a)}function i(a){return".abcjs-l"+a.line+".abcjs-m"+a.measureNumber}function t(a){if(a){if(a.measureStart){var e=i(a);e&&u(e)}o&&(o.style.left=a.left+"px",o.style.top=a.top+"px",o.style.width=a.width+"px",o.style.height=a.height+"px")}else p.stop(),p=void 0}p=new T(n,{qpm:c.bpm,eventCallback:t}),p.start()},g.pauseAnimation=function(r){p&&(r?p.pause():p.start())},g.stopAnimation=function(){p&&(p.stop(),p=void 0)}}(),Ue=g,Ue}var $e,Gr;function Ne(){if(Gr)return $e;Gr=1;var T={};return T.cloneArray=function(g){for(var p=[],o=0;o<g.length;o++)p.push(Object.assign({},g[o]));return p},T.cloneHashOfHash=function(g){var p={};for(var o in g)g.hasOwnProperty(o)&&(p[o]=Object.assign({},g[o]));return p},T.cloneHashOfArrayOfHash=function(g){var p={};for(var o in g)g.hasOwnProperty(o)&&(p[o]=T.cloneArray(g[o]));return p},T.strip=function(g){return g.replace(/^\s+/,"").replace(/\s+$/,"")},T.startsWith=function(g,p){return g.indexOf(p)===0},T.endsWith=function(g,p){var o=g.length-p.length;return o>=0&&g.lastIndexOf(p)===o},T.last=function(g){return g.length===0?null:g[g.length-1]},$e=T,$e}var Qe,qr;function Pr(){if(qr)return Qe;qr=1;var T=Ne(),g={};return function(){var p,o,r,n,c;g.initialize=function(y,k,w,O,z){p=y,o=k,r=w,n=O,c=z,s()};function s(){r.annotationfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.gchordfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.historyfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.infofont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.measurefont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.partsfont={face:'"Times New Roman"',size:15,weight:"normal",style:"normal",decoration:"none"},r.repeatfont={face:'"Times New Roman"',size:13,weight:"normal",style:"normal",decoration:"none"},r.textfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.tripletfont={face:"Times",size:11,weight:"normal",style:"italic",decoration:"none"},r.vocalfont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},r.wordsfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},n.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},n.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},n.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},n.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},n.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},n.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},n.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},n.formatting.annotationfont=r.annotationfont,n.formatting.gchordfont=r.gchordfont,n.formatting.historyfont=r.historyfont,n.formatting.infofont=r.infofont,n.formatting.measurefont=r.measurefont,n.formatting.partsfont=r.partsfont,n.formatting.repeatfont=r.repeatfont,n.formatting.textfont=r.textfont,n.formatting.tripletfont=r.tripletfont,n.formatting.vocalfont=r.vocalfont,n.formatting.wordsfont=r.wordsfont}var l={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},d=function(y){switch(y){case"Arial-Italic":return{face:"Arial",weight:"normal",style:"italic",decoration:"none"};case"Arial-Bold":return{face:"Arial",weight:"bold",style:"normal",decoration:"none"};case"Bookman-Demi":return{face:"Bookman,serif",weight:"bold",style:"normal",decoration:"none"};case"Bookman-DemiItalic":return{face:"Bookman,serif",weight:"bold",style:"italic",decoration:"none"};case"Bookman-Light":return{face:"Bookman,serif",weight:"normal",style:"normal",decoration:"none"};case"Bookman-LightItalic":return{face:"Bookman,serif",weight:"normal",style:"italic",decoration:"none"};case"Courier":return{face:'"Courier New"',weight:"normal",style:"normal",decoration:"none"};case"Courier-Oblique":return{face:'"Courier New"',weight:"normal",style:"italic",decoration:"none"};case"Courier-Bold":return{face:'"Courier New"',weight:"bold",style:"normal",decoration:"none"};case"Courier-BoldOblique":return{face:'"Courier New"',weight:"bold",style:"italic",decoration:"none"};case"AvantGarde-Book":return{face:"AvantGarde,Arial",weight:"normal",style:"normal",decoration:"none"};case"AvantGarde-BookOblique":return{face:"AvantGarde,Arial",weight:"normal",style:"italic",decoration:"none"};case"AvantGarde-Demi":case"Avant-Garde-Demi":return{face:"AvantGarde,Arial",weight:"bold",style:"normal",decoration:"none"};case"AvantGarde-DemiOblique":return{face:"AvantGarde,Arial",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Oblique":return{face:"Helvetica",weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Bold":return{face:"Helvetica",weight:"bold",style:"normal",decoration:"none"};case"Helvetica-BoldOblique":return{face:"Helvetica",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Narrow":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"normal",decoration:"none"};case"Helvetica-Narrow-Oblique":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Narrow-Bold":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"normal",decoration:"none"};case"Helvetica-Narrow-BoldOblique":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"italic",decoration:"none"};case"Palatino-Roman":return{face:"Palatino",weight:"normal",style:"normal",decoration:"none"};case"Palatino-Italic":return{face:"Palatino",weight:"normal",style:"italic",decoration:"none"};case"Palatino-Bold":return{face:"Palatino",weight:"bold",style:"normal",decoration:"none"};case"Palatino-BoldItalic":return{face:"Palatino",weight:"bold",style:"italic",decoration:"none"};case"NewCenturySchlbk-Roman":return{face:'"New Century",serif',weight:"normal",style:"normal",decoration:"none"};case"NewCenturySchlbk-Italic":return{face:'"New Century",serif',weight:"normal",style:"italic",decoration:"none"};case"NewCenturySchlbk-Bold":return{face:'"New Century",serif',weight:"bold",style:"normal",decoration:"none"};case"NewCenturySchlbk-BoldItalic":return{face:'"New Century",serif',weight:"bold",style:"italic",decoration:"none"};case"Times":case"Times-Roman":case"Times-Narrow":case"Times-Courier":case"Times-New-Roman":return{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none"};case"Times-Italic":case"Times-Italics":return{face:'"Times New Roman"',weight:"normal",style:"italic",decoration:"none"};case"Times-Bold":return{face:'"Times New Roman"',weight:"bold",style:"normal",decoration:"none"};case"Times-BoldItalic":return{face:'"Times New Roman"',weight:"bold",style:"italic",decoration:"none"};case"ZapfChancery-MediumItalic":return{face:'"Zapf Chancery",cursive,serif',weight:"normal",style:"normal",decoration:"none"};default:return null}},f=function(y,k,w,O,z){function V(){var fe=parseInt(y[0].token);return y.shift(),k?y.length===0?{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe}:y.length===1&&y[0].token==="box"&&l[z]?{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe,box:!0}:(o("Extra parameters in font definition.",w,O),{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe}):(o("Can't set just the size of the font since there is no default value.",w,O),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:fe})}if(y[0].token==="*"){if(y.shift(),y[0].type==="number")return V();o("Expected font size number after *.",w,O)}if(y[0].type==="number")return V();for(var I=[],K,Q="normal",G="normal",ee="none",te=!1,ne="face",X=!1;y.length;){var ae=y.shift(),$=ae.token.toLowerCase();switch(ne){case"face":X||$!=="utf"&&ae.type!=="number"&&$!=="bold"&&$!=="italic"&&$!=="underline"&&$!=="box"?I.length>0&&ae.token==="-"?(X=!0,I[I.length-1]=I[I.length-1]+ae.token):X?(X=!1,I[I.length-1]=I[I.length-1]+ae.token):I.push(ae.token):ae.type==="number"?(K?o("Font size specified twice in font definition.",w,O):K=ae.token,ne="modifier"):$==="bold"?Q="bold":$==="italic"?G="italic":$==="underline"?ee="underline":$==="box"?(l[z]?te=!0:o(`This font style doesn't support "box"`,w,O),ne="finished"):$==="utf"?(ae=y.shift(),ne="size"):o("Unknown parameter "+ae.token+" in font definition.",w,O);break;case"size":ae.type==="number"?K?o("Font size specified twice in font definition.",w,O):K=ae.token:o("Expected font size in font definition.",w,O),ne="modifier";break;case"modifier":$==="bold"?Q="bold":$==="italic"?G="italic":$==="underline"?ee="underline":$==="box"?(l[z]?te=!0:o(`This font style doesn't support "box"`,w,O),ne="finished"):o("Unknown parameter "+ae.token+" in font definition.",w,O);break;case"finished":o('Extra characters found after "box" in font definition.',w,O);break}}K===void 0?k?K=k.size:(o("Must specify the size of the font since there is no default value.",w,O),K=12):K=parseFloat(K),I=I.join(" "),I===""&&(k?I=k.face:(o("Must specify the name of the font since there is no default value.",w,O),I="sans-serif"));var se=d(I),ce={};return se?(ce.face=se.face,ce.weight=se.weight,ce.style=se.style,ce.decoration=se.decoration,ce.size=K,te&&(ce.box=!0),ce):(ce.face=I,ce.weight=Q,ce.style=G,ce.decoration=ee,ce.size=K,te&&(ce.box=!0),ce)},u=function(y,k,w){return k.length===0?'Directive "'+y+'" requires a font as a parameter.':(r[y]=f(k,r[y],w,0,y),r.is_in_header&&(n.formatting[y]=r[y]),null)},i=function(y,k,w){return k.length===0?'Directive "'+y+'" requires a font as a parameter.':(n.formatting[y]=f(k,n.formatting[y],w,0,y),null)},t=function(y,k){var w="";k.forEach(function(z){w+=z.token});var O=parseFloat(w);if(isNaN(O)||O===0)return'Directive "'+y+'" requires a number as a parameter.';n.formatting.scale=O},a=["acoustic-bass-drum","bass-drum-1","side-stick","acoustic-snare","hand-clap","electric-snare","low-floor-tom","closed-hi-hat","high-floor-tom","pedal-hi-hat","low-tom","open-hi-hat","low-mid-tom","hi-mid-tom","crash-cymbal-1","high-tom","ride-cymbal-1","chinese-cymbal","ride-bell","tambourine","splash-cymbal","cowbell","crash-cymbal-2","vibraslap","ride-cymbal-2","hi-bongo","low-bongo","mute-hi-conga","open-hi-conga","low-conga","high-timbale","low-timbale","high-agogo","low-agogo","cabasa","maracas","short-whistle","long-whistle","short-guiro","long-guiro","claves","hi-wood-block","low-wood-block","mute-cuica","open-cuica","mute-triangle","open-triangle"],e=function(y){var k=y.split(/\s+/);if(k.length!==2&&k.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var w=k[0],O=parseInt(k[1],10);if((isNaN(O)||O<35||O>81)&&k[1]&&(O=a.indexOf(k[1].toLowerCase())+35),isNaN(O)||O<35||O>81)return{error:'Expected drum name, received "'+k[1]+'"'};var z={sound:O};return k.length===3&&(z.noteHead=k[2]),{key:w,value:z}},h=function(y,k){var w=p.getMeasurement(k);return w.used===0||k.length!==0?{error:'Directive "'+y+'" requires a measurement as a parameter.'}:w.value},v=function(y,k){var w=p.getMeasurement(k);return w.used===0||k.length!==0?'Directive "'+y+'" requires a measurement as a parameter.':(n.formatting[y]=w.value,null)},m=function(y,k,w,O,z){if(w.length!==1||w[0].type!=="number")return'Directive "'+k+'" requires a number as a parameter.';var V=w[0].intt;return O!==void 0&&V<O?'Directive "'+k+'" requires a number greater than or equal to '+O+" as a parameter.":z!==void 0&&V>z?'Directive "'+k+'" requires a number less than or equal to '+z+" as a parameter.":(r[y]=V,null)},x=function(y,k,w){if(w.length===1&&(w[0].token==="true"||w[0].token==="false"))return r[y]=w[0].token==="true",null;var O=m(y,k,w,0,1);return O!==null?O:(r[y]=r[y]===1,null)},C=function(y,k,w,O){if(w.length!==1)return'Directive "'+k+'" requires one of [ '+O.join(", ")+" ] as a parameter.";for(var z=w[0].token,V=!1,I=0;!V&&I<O.length;I++)O[I]===z&&(V=!0);return V?(r[y]=z,null):'Directive "'+k+'" requires one of [ '+O.join(", ")+" ] as a parameter."},S=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],j=["gchord","ptstress","beatstring"],F=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],b=["program"],M=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],B=["beat"],A=["drone"],P=["portamento"],N=["expand","grace","trim"],E=["drum","chordname"],_=["bassprog","chordprog"],L=function(y,k,w){var O=y.shift().token,z=[];if(S.indexOf(O)>=0)y.length!==0&&o("Unexpected parameter in MIDI "+O,w,0);else if(j.indexOf(O)>=0)y.length!==1?o("Expected one parameter in MIDI "+O,w,0):z.push(y[0].token);else if(F.indexOf(O)>=0)y.length!==1?o("Expected one parameter in MIDI "+O,w,0):y[0].type!=="number"?o("Expected one integer parameter in MIDI "+O,w,0):z.push(y[0].intt);else if(b.indexOf(O)>=0)y.length!==1&&y.length!==2?o("Expected one or two parameters in MIDI "+O,w,0):y[0].type!=="number"||y.length===2&&y[1].type!=="number"?o("Expected integer parameter in MIDI "+O,w,0):(z.push(y[0].intt),y.length===2&&z.push(y[1].intt));else if(M.indexOf(O)>=0)y.length!==2?o("Expected two parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"?o("Expected two integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt));else if(P.indexOf(O)>=0)y.length!==2?o("Expected two parameters in MIDI "+O,w,0):y[0].type!=="alpha"||y[1].type!=="number"?o("Expected one string and one integer parameters in MIDI "+O,w,0):(z.push(y[0].token),z.push(y[1].intt));else if(O==="drummap")y.length===2&&y[0].type==="alpha"&&y[1].type==="number"?(k.formatting||(k.formatting={}),k.formatting.midi||(k.formatting.midi={}),k.formatting.midi.drummap||(k.formatting.midi.drummap={}),k.formatting.midi.drummap[y[0].token]=y[1].intt,z=k.formatting.midi.drummap):y.length===3&&y[0].type==="punct"&&y[1].type==="alpha"&&y[2].type==="number"?(k.formatting||(k.formatting={}),k.formatting.midi||(k.formatting.midi={}),k.formatting.midi.drummap||(k.formatting.midi.drummap={}),k.formatting.midi.drummap[y[0].token+y[1].token]=y[2].intt,z=k.formatting.midi.drummap):o("Expected one note name and one integer parameter in MIDI "+O,w,0);else if(N.indexOf(O)>=0)y.length!==3||y[0].type!=="number"||y[1].token!=="/"||y[2].type!=="number"?o("Expected fraction parameter in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[2].intt));else if(B.indexOf(O)>=0)y.length!==4?o("Expected four parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"||y[2].type!=="number"||y[3].type!=="number"?o("Expected four integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt),z.push(y[2].intt),z.push(y[3].intt));else if(A.indexOf(O)>=0)y.length!==5?o("Expected five parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"||y[2].type!=="number"||y[3].type!=="number"||y[4].type!=="number"?o("Expected five integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt),z.push(y[2].intt),z.push(y[3].intt),z.push(y[4].intt));else if(b.indexOf(O)>=0)y.length!==1||y.length!==4?o("Expected one or two parameters in MIDI "+O,w,0):y[0].type!=="number"?o("Expected integer parameter in MIDI "+O,w,0):y.length===4?(y[1].token!=="octave"&&o("Expected octave parameter in MIDI "+O,w,0),y[2].token!=="="&&o("Expected octave parameter in MIDI "+O,w,0),y[3].type!=="number"&&o("Expected integer parameter for octave in MIDI "+O,w,0)):(z.push(y[0].intt),y.length===4&&z.push(y[3].intt));else if(E.indexOf(O)>=0)if(y.length<2)o("Expected string parameter and at least one integer parameter in MIDI "+O,w,0);else if(y[0].type!=="alpha")o("Expected string parameter and at least one integer parameter in MIDI "+O,w,0);else{var V=y.shift();for(z.push(V.token);y.length>0;)V=y.shift(),V.type!=="number"&&o("Expected integer parameter in MIDI "+O,w,0),z.push(V.intt)}else if(_.indexOf(O)>=0){if(y.length!==1&&y.length!==2)o("Expected one or two parameters in MIDI "+O,w,0);else if(y[0].type!=="number")o("Expected integer parameter in MIDI "+O,w,0);else if(y.length===2&&y[1].type!=="alpha")o("Expected alpha parameter in MIDI "+O,w,0);else if(z.push(y[0].intt),y.length===2){var I=y[1].token;I.indexOf("octave=")!=-1?(I=I.replace("octave=",""),I=parseInt(I),isNaN(I)?o("Expected octave value in MIDI"+O):(I<-1&&(o("Expected octave= in MIDI "+O+" to be >= -1 (recv:"+I+")"),I=-1),I>3&&(o("Expected octave= in MIDI "+O+" to be <= 3 (recv:"+I+")"),I=3),z.push(I))):o("Expected octave= in MIDI"+O)}}c.hasBeginMusic()?c.appendElement("midi",-1,-1,{cmd:O,params:z}):(k.formatting.midi===void 0&&(k.formatting.midi={}),k.formatting.midi[O]=z)};g.parseFontChangeLine=function(y){y=y.replace(/\$\$/g,"");var k=y.split("$");if(k.length>1&&r.setfont){var w=[];k[0]!==""&&w.push({text:k[0]});for(var O=1;O<k.length;O++)if(k[O][0]==="0")w.push({text:k[O].substring(1).replace(/\x03/g,"$$")});else{var z=parseInt(k[O][0],10);r.setfont[z]?w.push({font:r.setfont[z],text:k[O].substring(1).replace(/\x03/g,"$$")}):w[w.length-1].text+="$"+k[O].replace(/\x03/g,"$$")}return w}return y.replace(/\x03/g,"$$")};var D=["auto","above","below","hidden"];g.addDirective=function(y){var k=p.tokenize(y,0,y.length);if(k.length===0||k[0].type!=="alpha")return null;var w=y.substring(y.indexOf(k[0].token)+k[0].token.length);w=p.stripComment(w);var O=k.shift().token.toLowerCase(),z="",V;switch(O){case"bagpipes":n.formatting.bagpipes=!0;break;case"flatbeams":n.formatting.flatbeams=!0;break;case"jazzchords":n.formatting.jazzchords=!0;break;case"accentAbove":n.formatting.accentAbove=!0;break;case"germanAlphabet":n.formatting.germanAlphabet=!0;break;case"landscape":r.landscape=!0;break;case"papersize":r.papersize=w;break;case"graceslurs":if(k.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(k[0].token==="0"||k[0].token==="false")n.formatting.graceSlurs=!1;else if(k[0].token==="1"||k[0].token==="true")n.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+k[0].token+")";break;case"lineThickness":var I=H(k);if(I.value!==void 0&&(n.formatting.lineThickness=I.value),I.error)return I.error;break;case"stretchlast":var K=H(k);if(K.value!==void 0&&(n.formatting.stretchlast=K.value),K.error)return K.error;break;case"titlecaps":r.titlecaps=!0;break;case"titleleft":n.formatting.titleleft=!0;break;case"measurebox":n.formatting.measurebox=!0;break;case"vocal":return C("vocalPosition",O,k,D);case"dynamic":return C("dynamicPosition",O,k,D);case"gchord":return C("chordPosition",O,k,D);case"ornament":return C("ornamentPosition",O,k,D);case"volume":return C("volumePosition",O,k,D);case"botmargin":case"botspace":case"composerspace":case"indent":case"leftmargin":case"linesep":case"musicspace":case"partsspace":case"pageheight":case"pagewidth":case"rightmargin":case"stafftopmargin":case"staffsep":case"staffwidth":case"subtitlespace":case"sysstaffsep":case"systemsep":case"textspace":case"titlespace":case"topmargin":case"topspace":case"vocalspace":case"wordsspace":return v(O,k);case"voicescale":if(k.length!==1||k[0].type!=="number")return"voicescale requires one float as a parameter";var Q=k.shift();return r.currentVoice&&(r.currentVoice.scale=Q.floatt,c.changeVoiceScale(r.currentVoice.scale)),null;case"voicecolor":if(k.length!==1)return"voicecolor requires one string as a parameter";var G=k.shift();return r.currentVoice&&(r.currentVoice.color=G.token,c.changeVoiceColor(r.currentVoice.color)),null;case"vskip":var ee=Math.round(h(O,k));return ee.error?ee.error:(c.addSpacing(ee),null);case"scale":t(O,k);break;case"sep":if(k.length===0)c.addSeparator(14,14,85,{startChar:r.iChar,endChar:r.iChar+5});else{var te=p.getMeasurement(k);if(te.used===0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var ne=te.value;if(te=p.getMeasurement(k),te.used===0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var X=te.value;if(te=p.getMeasurement(k),te.used===0||k.length!==0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var ae=te.value;c.addSeparator(ne,X,ae,{startChar:r.iChar,endChar:r.iChar+w.length})}break;case"barsperstaff":if(z=m("barsperstaff",O,k),z!==null)return z;break;case"staffnonote":if(k.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(k[0].token==="0")r.staffnonote=!0;else if(k[0].token==="1")r.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+k[0].token+")";break;case"printtempo":if(z=x("printTempo",O,k),z!==null)return z;break;case"partsbox":if(z=x("partsBox",O,k),z!==null)return z;r.partsfont.box=r.partsBox;break;case"freegchord":if(z=x("freegchord",O,k),z!==null)return z;break;case"measurenb":case"barnumbers":if(z=m("barNumbers",O,k),z!==null)return z;break;case"setbarnb":if(k.length!==1||k[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";r.currBarNumber=c.setBarNumberImmediate(k[0].intt);break;case"keywarn":if(k.length!==1||k[0].type!=="number"||k[0].intt!==1&&k[0].intt!==0)return"Directive "+O+" requires 0 or 1 as a parameter.";r[O]=k[0].intt===1;break;case"begintext":var $="";for(V=p.nextLine();V&&V.indexOf("%%endtext")!==0;){if(T.startsWith(V,"%%")){var se=V.substring(2);se=se.trim()+`
|
|
1
|
+
import{d as os}from"./index-CH486f5J.js";function cs(T,g){for(var p=0;p<g.length;p++){const o=g[p];if(typeof o!="string"&&!Array.isArray(o)){for(const r in o)if(r!=="default"&&!(r in T)){const n=Object.getOwnPropertyDescriptor(o,r);n&&Object.defineProperty(T,r,n.get?n:{enumerable:!0,get:()=>o[r]})}}}return Object.freeze(Object.defineProperty(T,Symbol.toStringTag,{value:"Module"}))}var Xe,Yr;function ls(){if(Yr)return Xe;Yr=1;var T="6.5.2";return Xe=T,Xe}var Ke,Rr;function Br(){if(Rr)return Ke;Rr=1;var T=function(p,o){var r=this;if(o||(o={}),r.qpm=o.qpm?parseInt(o.qpm,10):null,!r.qpm){var n=p.metaText?p.metaText.tempo:null;r.qpm=p.getBpm(n)}r.extraMeasuresAtBeginning=o.extraMeasuresAtBeginning?parseInt(o.extraMeasuresAtBeginning,10):0,r.beatCallback=o.beatCallback,r.eventCallback=o.eventCallback,r.lineEndCallback=o.lineEndCallback,r.lineEndAnticipation=o.lineEndAnticipation?parseInt(o.lineEndAnticipation,10):0,r.beatSubdivisions=o.beatSubdivisions?parseInt(o.beatSubdivisions,10):1,r.joggerTimer=null,r.replaceTarget=function(s){r.noteTimings=s.setTiming(r.qpm,r.extraMeasuresAtBeginning),s.noteTimings.length===0&&(r.noteTimings=s.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=g(s.noteTimings,r.lineEndAnticipation)),r.startTime=null,r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.currentTime=0,r.isPaused=!1,r.isRunning=!1,r.pausedPercent=null,r.justUnpaused=!1,r.newSeekPercent=0,r.lastTimestamp=0,r.noteTimings.length!==0&&(r.millisecondsPerBeat=1e3/(r.qpm/60)/r.beatSubdivisions,r.lastMoment=r.noteTimings[r.noteTimings.length-1].milliseconds,r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat))},r.replaceTarget(p),r.doTiming=function(s){if(r.lastTimestamp!==s&&(r.lastTimestamp=s,r.startTime||(r.startTime=s),!r.isPaused&&r.isRunning)){for(r.currentTime=s-r.startTime,r.currentTime+=16;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;){if(r.eventCallback&&r.noteTimings[r.currentEvent].type==="event"){var l=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),l!==r.startTime&&(r.currentTime=s-r.startTime)}r.currentEvent++}if(r.lineEndCallback&&r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds<r.currentTime&&r.currentEvent<r.noteTimings.length){var d=r.noteTimings[r.currentEvent].milliseconds===r.currentTime?r.noteTimings[r.currentEvent]:r.noteTimings[r.currentEvent-1];r.lineEndCallback(r.lineEndTimings[r.currentLine],d,{line:r.currentLine,endTimings:r.lineEndTimings,currentTime:r.currentTime}),r.currentLine++}if(r.currentTime<r.lastMoment){if(requestAnimationFrame(r.doTiming),r.currentBeat*r.millisecondsPerBeat<r.currentTime){var f=r.doBeatCallback(s);f!==null&&(r.currentTime=f)}}else if(r.currentBeat<=r.totalBeats&&r.beatCallback){var u=r.doBeatCallback(s);u!==null&&(r.currentTime=u),requestAnimationFrame(r.doTiming)}if(r.currentTime>=r.lastMoment)if(r.eventCallback){var i=r.eventCallback(null);r.shouldStop(i).then(function(t){t&&r.stop()})}else r.stop()}},r.shouldStop=function(s){return new Promise(function(l){if(!s)return l(!0);if(s==="continue")return l(!1);s.then&&s.then(function(d){l(d!=="continue")})})},r.doBeatCallback=function(s){if(r.beatCallback){for(var l=r.currentEvent;l<r.noteTimings.length&&r.noteTimings[l].left===null;)l++;var d,f;if(l<r.noteTimings.length){for(d=r.noteTimings[l].milliseconds,l=Math.max(0,r.currentEvent-1);l>=0&&r.noteTimings[l].left===null;)l--;f=r.noteTimings[l]}var u={},i={};if(f){u.top=f.top,u.height=f.height;var t=Math.max(0,s-r.startTime-f.milliseconds),a=d-f.milliseconds,e=f.endX-f.left,h=a?t*e/a:0;u.left=f.left+h,r.currentEvent===0&&f.milliseconds>s-r.startTime&&(u.left=void 0),i={timestamp:s,startTime:r.startTime,ev:f,endMs:d,offMs:t,offPx:h,gapMs:a,gapPx:e}}else i={timestamp:s,startTime:r.startTime};var v=r.startTime;if(r.beatCallback(r.currentBeat/r.beatSubdivisions,r.totalBeats/r.beatSubdivisions,r.lastMoment,u,i),v!==r.startTime)return s-r.startTime;r.currentBeat++}return null};var c=60;r.animationJogger=function(){r.isRunning&&(r.doTiming(performance.now()),r.joggerTimer=setTimeout(r.animationJogger,c))},r.start=function(s,l){if(r.isRunning=!0,r.isPaused&&(r.isPaused=!1,s===void 0&&(r.justUnpaused=!0)),s)r.setProgress(s,l);else if(s===0)r.reset();else if(r.pausedPercent!==null){var d=performance.now();r.currentTime=r.lastMoment*r.pausedPercent,r.startTime=d-r.currentTime,r.pausedPercent=null,r.reportNext=!0}requestAnimationFrame(r.doTiming),r.joggerTimer=setTimeout(r.animationJogger,c)},r.pause=function(){r.isPaused=!0;var s=performance.now();r.pausedPercent=(s-r.startTime)/r.lastMoment,r.isRunning=!1,r.joggerTimer&&(clearTimeout(r.joggerTimer),r.joggerTimer=null)},r.currentMillisecond=function(){return r.currentTime},r.reset=function(){r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.startTime=null,r.pausedPercent=null},r.stop=function(){r.pause(),r.reset()},r.setProgress=function(s,l){var d;switch(l){case"seconds":r.currentTime=s*1e3,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),d=r.currentTime/r.lastMoment;break;case"beats":r.currentTime=s*r.millisecondsPerBeat*r.beatSubdivisions,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),d=r.currentTime/r.lastMoment;break;default:d=s,d<0&&(d=0),d>1&&(d=1),r.currentTime=r.lastMoment*d;break}r.isRunning||(r.pausedPercent=d);var f=performance.now();for(r.startTime=f-r.currentTime,r.currentEvent,r.currentEvent=0;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;)r.currentEvent++;if(r.lineEndCallback)for(r.currentLine=0;r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds+r.lineEndAnticipation<r.currentTime;)r.currentLine++;var u=r.currentBeat;r.currentBeat=Math.floor(r.currentTime/r.millisecondsPerBeat),r.beatCallback&&u!==r.currentBeat&&r.doBeatCallback(r.startTime+r.currentTime),r.eventCallback&&r.currentEvent>=0&&r.noteTimings[r.currentEvent].type==="event"&&r.eventCallback(r.noteTimings[r.currentEvent]),r.lineEndCallback&&r.lineEndCallback(r.lineEndTimings[r.currentLine],r.noteTimings[r.currentEvent],{line:r.currentLine,endTimings:r.lineEndTimings}),r.joggerTimer=setTimeout(r.animationJogger,c)}};function g(p,o){for(var r=[],n=null,c=0;c<p.length;c++){var s=p[c];s.type!=="end"&&s.top!==n&&(r.push({measureNumber:s.measureNumber,milliseconds:s.milliseconds-o,top:s.top,bottom:s.top+s.height}),n=s.top)}return r}return Ke=T,Ke}var Ue,Wr;function hs(){if(Wr)return Ue;Wr=1;var T=Br(),g={};return function(){var p,o;g.startAnimation=function(r,n,c){p&&(p.stop(),p=void 0),c.showCursor&&(o=r.querySelector(".abcjs-cursor"),o||(o=document.createElement("DIV"),o.className="abcjs-cursor cursor",o.style.position="absolute",r.appendChild(o),r.style.position="relative"));function s(a){for(var e=0;e<a.length;e++){var h=a[e];h.classList.contains("abcjs-bar")||(h.style.display="none")}}var l;function d(a){if(l){var e=r.querySelectorAll(l);s(e)}l=a}function f(a){var e=r.querySelectorAll(a);s(e)}function u(a){c.hideCurrentMeasure?f(a):c.hideFinishedMeasures&&d(a)}function i(a){return".abcjs-l"+a.line+".abcjs-m"+a.measureNumber}function t(a){if(a){if(a.measureStart){var e=i(a);e&&u(e)}o&&(o.style.left=a.left+"px",o.style.top=a.top+"px",o.style.width=a.width+"px",o.style.height=a.height+"px")}else p.stop(),p=void 0}p=new T(n,{qpm:c.bpm,eventCallback:t}),p.start()},g.pauseAnimation=function(r){p&&(r?p.pause():p.start())},g.stopAnimation=function(){p&&(p.stop(),p=void 0)}}(),Ue=g,Ue}var $e,Gr;function Ne(){if(Gr)return $e;Gr=1;var T={};return T.cloneArray=function(g){for(var p=[],o=0;o<g.length;o++)p.push(Object.assign({},g[o]));return p},T.cloneHashOfHash=function(g){var p={};for(var o in g)g.hasOwnProperty(o)&&(p[o]=Object.assign({},g[o]));return p},T.cloneHashOfArrayOfHash=function(g){var p={};for(var o in g)g.hasOwnProperty(o)&&(p[o]=T.cloneArray(g[o]));return p},T.strip=function(g){return g.replace(/^\s+/,"").replace(/\s+$/,"")},T.startsWith=function(g,p){return g.indexOf(p)===0},T.endsWith=function(g,p){var o=g.length-p.length;return o>=0&&g.lastIndexOf(p)===o},T.last=function(g){return g.length===0?null:g[g.length-1]},$e=T,$e}var Qe,qr;function Pr(){if(qr)return Qe;qr=1;var T=Ne(),g={};return function(){var p,o,r,n,c;g.initialize=function(y,k,w,O,z){p=y,o=k,r=w,n=O,c=z,s()};function s(){r.annotationfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.gchordfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.historyfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.infofont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.measurefont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.partsfont={face:'"Times New Roman"',size:15,weight:"normal",style:"normal",decoration:"none"},r.repeatfont={face:'"Times New Roman"',size:13,weight:"normal",style:"normal",decoration:"none"},r.textfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.tripletfont={face:"Times",size:11,weight:"normal",style:"italic",decoration:"none"},r.vocalfont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},r.wordsfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},n.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},n.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},n.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},n.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},n.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},n.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},n.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},n.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},n.formatting.annotationfont=r.annotationfont,n.formatting.gchordfont=r.gchordfont,n.formatting.historyfont=r.historyfont,n.formatting.infofont=r.infofont,n.formatting.measurefont=r.measurefont,n.formatting.partsfont=r.partsfont,n.formatting.repeatfont=r.repeatfont,n.formatting.textfont=r.textfont,n.formatting.tripletfont=r.tripletfont,n.formatting.vocalfont=r.vocalfont,n.formatting.wordsfont=r.wordsfont}var l={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},d=function(y){switch(y){case"Arial-Italic":return{face:"Arial",weight:"normal",style:"italic",decoration:"none"};case"Arial-Bold":return{face:"Arial",weight:"bold",style:"normal",decoration:"none"};case"Bookman-Demi":return{face:"Bookman,serif",weight:"bold",style:"normal",decoration:"none"};case"Bookman-DemiItalic":return{face:"Bookman,serif",weight:"bold",style:"italic",decoration:"none"};case"Bookman-Light":return{face:"Bookman,serif",weight:"normal",style:"normal",decoration:"none"};case"Bookman-LightItalic":return{face:"Bookman,serif",weight:"normal",style:"italic",decoration:"none"};case"Courier":return{face:'"Courier New"',weight:"normal",style:"normal",decoration:"none"};case"Courier-Oblique":return{face:'"Courier New"',weight:"normal",style:"italic",decoration:"none"};case"Courier-Bold":return{face:'"Courier New"',weight:"bold",style:"normal",decoration:"none"};case"Courier-BoldOblique":return{face:'"Courier New"',weight:"bold",style:"italic",decoration:"none"};case"AvantGarde-Book":return{face:"AvantGarde,Arial",weight:"normal",style:"normal",decoration:"none"};case"AvantGarde-BookOblique":return{face:"AvantGarde,Arial",weight:"normal",style:"italic",decoration:"none"};case"AvantGarde-Demi":case"Avant-Garde-Demi":return{face:"AvantGarde,Arial",weight:"bold",style:"normal",decoration:"none"};case"AvantGarde-DemiOblique":return{face:"AvantGarde,Arial",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Oblique":return{face:"Helvetica",weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Bold":return{face:"Helvetica",weight:"bold",style:"normal",decoration:"none"};case"Helvetica-BoldOblique":return{face:"Helvetica",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Narrow":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"normal",decoration:"none"};case"Helvetica-Narrow-Oblique":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Narrow-Bold":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"normal",decoration:"none"};case"Helvetica-Narrow-BoldOblique":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"italic",decoration:"none"};case"Palatino-Roman":return{face:"Palatino",weight:"normal",style:"normal",decoration:"none"};case"Palatino-Italic":return{face:"Palatino",weight:"normal",style:"italic",decoration:"none"};case"Palatino-Bold":return{face:"Palatino",weight:"bold",style:"normal",decoration:"none"};case"Palatino-BoldItalic":return{face:"Palatino",weight:"bold",style:"italic",decoration:"none"};case"NewCenturySchlbk-Roman":return{face:'"New Century",serif',weight:"normal",style:"normal",decoration:"none"};case"NewCenturySchlbk-Italic":return{face:'"New Century",serif',weight:"normal",style:"italic",decoration:"none"};case"NewCenturySchlbk-Bold":return{face:'"New Century",serif',weight:"bold",style:"normal",decoration:"none"};case"NewCenturySchlbk-BoldItalic":return{face:'"New Century",serif',weight:"bold",style:"italic",decoration:"none"};case"Times":case"Times-Roman":case"Times-Narrow":case"Times-Courier":case"Times-New-Roman":return{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none"};case"Times-Italic":case"Times-Italics":return{face:'"Times New Roman"',weight:"normal",style:"italic",decoration:"none"};case"Times-Bold":return{face:'"Times New Roman"',weight:"bold",style:"normal",decoration:"none"};case"Times-BoldItalic":return{face:'"Times New Roman"',weight:"bold",style:"italic",decoration:"none"};case"ZapfChancery-MediumItalic":return{face:'"Zapf Chancery",cursive,serif',weight:"normal",style:"normal",decoration:"none"};default:return null}},f=function(y,k,w,O,z){function V(){var fe=parseInt(y[0].token);return y.shift(),k?y.length===0?{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe}:y.length===1&&y[0].token==="box"&&l[z]?{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe,box:!0}:(o("Extra parameters in font definition.",w,O),{face:k.face,weight:k.weight,style:k.style,decoration:k.decoration,size:fe}):(o("Can't set just the size of the font since there is no default value.",w,O),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:fe})}if(y[0].token==="*"){if(y.shift(),y[0].type==="number")return V();o("Expected font size number after *.",w,O)}if(y[0].type==="number")return V();for(var I=[],K,Q="normal",G="normal",ee="none",te=!1,ne="face",X=!1;y.length;){var ae=y.shift(),$=ae.token.toLowerCase();switch(ne){case"face":X||$!=="utf"&&ae.type!=="number"&&$!=="bold"&&$!=="italic"&&$!=="underline"&&$!=="box"?I.length>0&&ae.token==="-"?(X=!0,I[I.length-1]=I[I.length-1]+ae.token):X?(X=!1,I[I.length-1]=I[I.length-1]+ae.token):I.push(ae.token):ae.type==="number"?(K?o("Font size specified twice in font definition.",w,O):K=ae.token,ne="modifier"):$==="bold"?Q="bold":$==="italic"?G="italic":$==="underline"?ee="underline":$==="box"?(l[z]?te=!0:o(`This font style doesn't support "box"`,w,O),ne="finished"):$==="utf"?(ae=y.shift(),ne="size"):o("Unknown parameter "+ae.token+" in font definition.",w,O);break;case"size":ae.type==="number"?K?o("Font size specified twice in font definition.",w,O):K=ae.token:o("Expected font size in font definition.",w,O),ne="modifier";break;case"modifier":$==="bold"?Q="bold":$==="italic"?G="italic":$==="underline"?ee="underline":$==="box"?(l[z]?te=!0:o(`This font style doesn't support "box"`,w,O),ne="finished"):o("Unknown parameter "+ae.token+" in font definition.",w,O);break;case"finished":o('Extra characters found after "box" in font definition.',w,O);break}}K===void 0?k?K=k.size:(o("Must specify the size of the font since there is no default value.",w,O),K=12):K=parseFloat(K),I=I.join(" "),I===""&&(k?I=k.face:(o("Must specify the name of the font since there is no default value.",w,O),I="sans-serif"));var se=d(I),ce={};return se?(ce.face=se.face,ce.weight=se.weight,ce.style=se.style,ce.decoration=se.decoration,ce.size=K,te&&(ce.box=!0),ce):(ce.face=I,ce.weight=Q,ce.style=G,ce.decoration=ee,ce.size=K,te&&(ce.box=!0),ce)},u=function(y,k,w){return k.length===0?'Directive "'+y+'" requires a font as a parameter.':(r[y]=f(k,r[y],w,0,y),r.is_in_header&&(n.formatting[y]=r[y]),null)},i=function(y,k,w){return k.length===0?'Directive "'+y+'" requires a font as a parameter.':(n.formatting[y]=f(k,n.formatting[y],w,0,y),null)},t=function(y,k){var w="";k.forEach(function(z){w+=z.token});var O=parseFloat(w);if(isNaN(O)||O===0)return'Directive "'+y+'" requires a number as a parameter.';n.formatting.scale=O},a=["acoustic-bass-drum","bass-drum-1","side-stick","acoustic-snare","hand-clap","electric-snare","low-floor-tom","closed-hi-hat","high-floor-tom","pedal-hi-hat","low-tom","open-hi-hat","low-mid-tom","hi-mid-tom","crash-cymbal-1","high-tom","ride-cymbal-1","chinese-cymbal","ride-bell","tambourine","splash-cymbal","cowbell","crash-cymbal-2","vibraslap","ride-cymbal-2","hi-bongo","low-bongo","mute-hi-conga","open-hi-conga","low-conga","high-timbale","low-timbale","high-agogo","low-agogo","cabasa","maracas","short-whistle","long-whistle","short-guiro","long-guiro","claves","hi-wood-block","low-wood-block","mute-cuica","open-cuica","mute-triangle","open-triangle"],e=function(y){var k=y.split(/\s+/);if(k.length!==2&&k.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var w=k[0],O=parseInt(k[1],10);if((isNaN(O)||O<35||O>81)&&k[1]&&(O=a.indexOf(k[1].toLowerCase())+35),isNaN(O)||O<35||O>81)return{error:'Expected drum name, received "'+k[1]+'"'};var z={sound:O};return k.length===3&&(z.noteHead=k[2]),{key:w,value:z}},h=function(y,k){var w=p.getMeasurement(k);return w.used===0||k.length!==0?{error:'Directive "'+y+'" requires a measurement as a parameter.'}:w.value},v=function(y,k){var w=p.getMeasurement(k);return w.used===0||k.length!==0?'Directive "'+y+'" requires a measurement as a parameter.':(n.formatting[y]=w.value,null)},m=function(y,k,w,O,z){if(w.length!==1||w[0].type!=="number")return'Directive "'+k+'" requires a number as a parameter.';var V=w[0].intt;return O!==void 0&&V<O?'Directive "'+k+'" requires a number greater than or equal to '+O+" as a parameter.":z!==void 0&&V>z?'Directive "'+k+'" requires a number less than or equal to '+z+" as a parameter.":(r[y]=V,null)},x=function(y,k,w){if(w.length===1&&(w[0].token==="true"||w[0].token==="false"))return r[y]=w[0].token==="true",null;var O=m(y,k,w,0,1);return O!==null?O:(r[y]=r[y]===1,null)},C=function(y,k,w,O){if(w.length!==1)return'Directive "'+k+'" requires one of [ '+O.join(", ")+" ] as a parameter.";for(var z=w[0].token,V=!1,I=0;!V&&I<O.length;I++)O[I]===z&&(V=!0);return V?(r[y]=z,null):'Directive "'+k+'" requires one of [ '+O.join(", ")+" ] as a parameter."},S=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],j=["gchord","ptstress","beatstring"],F=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],b=["program"],M=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],B=["beat"],A=["drone"],P=["portamento"],N=["expand","grace","trim"],E=["drum","chordname"],_=["bassprog","chordprog"],L=function(y,k,w){var O=y.shift().token,z=[];if(S.indexOf(O)>=0)y.length!==0&&o("Unexpected parameter in MIDI "+O,w,0);else if(j.indexOf(O)>=0)y.length!==1?o("Expected one parameter in MIDI "+O,w,0):z.push(y[0].token);else if(F.indexOf(O)>=0)y.length!==1?o("Expected one parameter in MIDI "+O,w,0):y[0].type!=="number"?o("Expected one integer parameter in MIDI "+O,w,0):z.push(y[0].intt);else if(b.indexOf(O)>=0)y.length!==1&&y.length!==2?o("Expected one or two parameters in MIDI "+O,w,0):y[0].type!=="number"||y.length===2&&y[1].type!=="number"?o("Expected integer parameter in MIDI "+O,w,0):(z.push(y[0].intt),y.length===2&&z.push(y[1].intt));else if(M.indexOf(O)>=0)y.length!==2?o("Expected two parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"?o("Expected two integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt));else if(P.indexOf(O)>=0)y.length!==2?o("Expected two parameters in MIDI "+O,w,0):y[0].type!=="alpha"||y[1].type!=="number"?o("Expected one string and one integer parameters in MIDI "+O,w,0):(z.push(y[0].token),z.push(y[1].intt));else if(O==="drummap")y.length===2&&y[0].type==="alpha"&&y[1].type==="number"?(k.formatting||(k.formatting={}),k.formatting.midi||(k.formatting.midi={}),k.formatting.midi.drummap||(k.formatting.midi.drummap={}),k.formatting.midi.drummap[y[0].token]=y[1].intt,z=k.formatting.midi.drummap):y.length===3&&y[0].type==="punct"&&y[1].type==="alpha"&&y[2].type==="number"?(k.formatting||(k.formatting={}),k.formatting.midi||(k.formatting.midi={}),k.formatting.midi.drummap||(k.formatting.midi.drummap={}),k.formatting.midi.drummap[y[0].token+y[1].token]=y[2].intt,z=k.formatting.midi.drummap):o("Expected one note name and one integer parameter in MIDI "+O,w,0);else if(N.indexOf(O)>=0)y.length!==3||y[0].type!=="number"||y[1].token!=="/"||y[2].type!=="number"?o("Expected fraction parameter in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[2].intt));else if(B.indexOf(O)>=0)y.length!==4?o("Expected four parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"||y[2].type!=="number"||y[3].type!=="number"?o("Expected four integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt),z.push(y[2].intt),z.push(y[3].intt));else if(A.indexOf(O)>=0)y.length!==5?o("Expected five parameters in MIDI "+O,w,0):y[0].type!=="number"||y[1].type!=="number"||y[2].type!=="number"||y[3].type!=="number"||y[4].type!=="number"?o("Expected five integer parameters in MIDI "+O,w,0):(z.push(y[0].intt),z.push(y[1].intt),z.push(y[2].intt),z.push(y[3].intt),z.push(y[4].intt));else if(b.indexOf(O)>=0)y.length!==1||y.length!==4?o("Expected one or two parameters in MIDI "+O,w,0):y[0].type!=="number"?o("Expected integer parameter in MIDI "+O,w,0):y.length===4?(y[1].token!=="octave"&&o("Expected octave parameter in MIDI "+O,w,0),y[2].token!=="="&&o("Expected octave parameter in MIDI "+O,w,0),y[3].type!=="number"&&o("Expected integer parameter for octave in MIDI "+O,w,0)):(z.push(y[0].intt),y.length===4&&z.push(y[3].intt));else if(E.indexOf(O)>=0)if(y.length<2)o("Expected string parameter and at least one integer parameter in MIDI "+O,w,0);else if(y[0].type!=="alpha")o("Expected string parameter and at least one integer parameter in MIDI "+O,w,0);else{var V=y.shift();for(z.push(V.token);y.length>0;)V=y.shift(),V.type!=="number"&&o("Expected integer parameter in MIDI "+O,w,0),z.push(V.intt)}else if(_.indexOf(O)>=0){if(y.length!==1&&y.length!==2)o("Expected one or two parameters in MIDI "+O,w,0);else if(y[0].type!=="number")o("Expected integer parameter in MIDI "+O,w,0);else if(y.length===2&&y[1].type!=="alpha")o("Expected alpha parameter in MIDI "+O,w,0);else if(z.push(y[0].intt),y.length===2){var I=y[1].token;I.indexOf("octave=")!=-1?(I=I.replace("octave=",""),I=parseInt(I),isNaN(I)?o("Expected octave value in MIDI"+O):(I<-1&&(o("Expected octave= in MIDI "+O+" to be >= -1 (recv:"+I+")"),I=-1),I>3&&(o("Expected octave= in MIDI "+O+" to be <= 3 (recv:"+I+")"),I=3),z.push(I))):o("Expected octave= in MIDI"+O)}}c.hasBeginMusic()?c.appendElement("midi",-1,-1,{cmd:O,params:z}):(k.formatting.midi===void 0&&(k.formatting.midi={}),k.formatting.midi[O]=z)};g.parseFontChangeLine=function(y){y=y.replace(/\$\$/g,"");var k=y.split("$");if(k.length>1&&r.setfont){var w=[];k[0]!==""&&w.push({text:k[0]});for(var O=1;O<k.length;O++)if(k[O][0]==="0")w.push({text:k[O].substring(1).replace(/\x03/g,"$$")});else{var z=parseInt(k[O][0],10);r.setfont[z]?w.push({font:r.setfont[z],text:k[O].substring(1).replace(/\x03/g,"$$")}):w[w.length-1].text+="$"+k[O].replace(/\x03/g,"$$")}return w}return y.replace(/\x03/g,"$$")};var D=["auto","above","below","hidden"];g.addDirective=function(y){var k=p.tokenize(y,0,y.length);if(k.length===0||k[0].type!=="alpha")return null;var w=y.substring(y.indexOf(k[0].token)+k[0].token.length);w=p.stripComment(w);var O=k.shift().token.toLowerCase(),z="",V;switch(O){case"bagpipes":n.formatting.bagpipes=!0;break;case"flatbeams":n.formatting.flatbeams=!0;break;case"jazzchords":n.formatting.jazzchords=!0;break;case"accentAbove":n.formatting.accentAbove=!0;break;case"germanAlphabet":n.formatting.germanAlphabet=!0;break;case"landscape":r.landscape=!0;break;case"papersize":r.papersize=w;break;case"graceslurs":if(k.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(k[0].token==="0"||k[0].token==="false")n.formatting.graceSlurs=!1;else if(k[0].token==="1"||k[0].token==="true")n.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+k[0].token+")";break;case"lineThickness":var I=H(k);if(I.value!==void 0&&(n.formatting.lineThickness=I.value),I.error)return I.error;break;case"stretchlast":var K=H(k);if(K.value!==void 0&&(n.formatting.stretchlast=K.value),K.error)return K.error;break;case"titlecaps":r.titlecaps=!0;break;case"titleleft":n.formatting.titleleft=!0;break;case"measurebox":n.formatting.measurebox=!0;break;case"vocal":return C("vocalPosition",O,k,D);case"dynamic":return C("dynamicPosition",O,k,D);case"gchord":return C("chordPosition",O,k,D);case"ornament":return C("ornamentPosition",O,k,D);case"volume":return C("volumePosition",O,k,D);case"botmargin":case"botspace":case"composerspace":case"indent":case"leftmargin":case"linesep":case"musicspace":case"partsspace":case"pageheight":case"pagewidth":case"rightmargin":case"stafftopmargin":case"staffsep":case"staffwidth":case"subtitlespace":case"sysstaffsep":case"systemsep":case"textspace":case"titlespace":case"topmargin":case"topspace":case"vocalspace":case"wordsspace":return v(O,k);case"voicescale":if(k.length!==1||k[0].type!=="number")return"voicescale requires one float as a parameter";var Q=k.shift();return r.currentVoice&&(r.currentVoice.scale=Q.floatt,c.changeVoiceScale(r.currentVoice.scale)),null;case"voicecolor":if(k.length!==1)return"voicecolor requires one string as a parameter";var G=k.shift();return r.currentVoice&&(r.currentVoice.color=G.token,c.changeVoiceColor(r.currentVoice.color)),null;case"vskip":var ee=Math.round(h(O,k));return ee.error?ee.error:(c.addSpacing(ee),null);case"scale":t(O,k);break;case"sep":if(k.length===0)c.addSeparator(14,14,85,{startChar:r.iChar,endChar:r.iChar+5});else{var te=p.getMeasurement(k);if(te.used===0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var ne=te.value;if(te=p.getMeasurement(k),te.used===0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var X=te.value;if(te=p.getMeasurement(k),te.used===0||k.length!==0)return'Directive "'+O+'" requires 3 numbers: space above, space below, length of line';var ae=te.value;c.addSeparator(ne,X,ae,{startChar:r.iChar,endChar:r.iChar+w.length})}break;case"barsperstaff":if(z=m("barsperstaff",O,k),z!==null)return z;break;case"staffnonote":if(k.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(k[0].token==="0")r.staffnonote=!0;else if(k[0].token==="1")r.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+k[0].token+")";break;case"printtempo":if(z=x("printTempo",O,k),z!==null)return z;break;case"partsbox":if(z=x("partsBox",O,k),z!==null)return z;r.partsfont.box=r.partsBox;break;case"freegchord":if(z=x("freegchord",O,k),z!==null)return z;break;case"measurenb":case"barnumbers":if(z=m("barNumbers",O,k),z!==null)return z;break;case"setbarnb":if(k.length!==1||k[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";r.currBarNumber=c.setBarNumberImmediate(k[0].intt);break;case"keywarn":if(k.length!==1||k[0].type!=="number"||k[0].intt!==1&&k[0].intt!==0)return"Directive "+O+" requires 0 or 1 as a parameter.";r[O]=k[0].intt===1;break;case"begintext":var $="";for(V=p.nextLine();V&&V.indexOf("%%endtext")!==0;){if(T.startsWith(V,"%%")){var se=V.substring(2);se=se.trim()+`
|
|
2
2
|
`,$+=se}else $+=V.trim()+`
|
|
3
3
|
`;V=p.nextLine()}c.addText($,{startChar:r.iChar,endChar:r.iChar+$.length+7});break;case"continueall":r.continueall=!0;break;case"beginps":for(V=p.nextLine();V&&V.indexOf("%%endps")!==0;)p.nextLine();o("Postscript ignored",y,0);break;case"deco":w.length>0&&r.ignoredDecorations.push(w.substring(0,w.indexOf(" "))),o("Decoration redefinition ignored",y,0);break;case"text":var ce=p.translateString(w);c.addText(g.parseFontChangeLine(ce),{startChar:r.iChar,endChar:r.iChar+w.length+7});break;case"center":var fe=p.translateString(w);c.addCentered(g.parseFontChangeLine(fe));break;case"font":break;case"setfont":var le=p.tokenize(w,0,w.length);if(le.length>=4&&le[0].token==="-"&&le[1].type==="number"){var ve=parseInt(le[1].token);ve>=1&&ve<=9&&(r.setfont||(r.setfont=[]),le.shift(),le.shift(),r.setfont[ve]=f(le,r.setfont[ve],y,0,"setfont"))}break;case"gchordfont":case"partsfont":case"tripletfont":case"vocalfont":case"textfont":case"annotationfont":case"historyfont":case"infofont":case"measurefont":case"repeatfont":case"wordsfont":return u(O,k,y);case"composerfont":case"subtitlefont":case"tempofont":case"titlefont":case"voicefont":case"footerfont":case"headerfont":return i(O,k,y);case"barlabelfont":case"barnumberfont":case"barnumfont":return u("measurefont",k,y);case"staves":case"score":r.score_is_present=!0;for(var ge=function(Pe,ze,Ie,Ve,Ye){(ze||r.staves.length===0)&&r.staves.push({index:r.staves.length,numVoices:0});var Se=T.last(r.staves);Ie!==void 0&&Se.bracket===void 0&&(Se.bracket=Ie),Ve!==void 0&&Se.brace===void 0&&(Se.brace=Ve),Ye&&(Se.connectBarLines="end"),r.voices[Pe]===void 0&&(r.voices[Pe]={staffNum:Se.index,index:Se.numVoices},Se.numVoices++)},ye=!1,R=!1,q=!1,Y=!1,W=!1,U=!1,J=!1,re,he=function(){if(J=!0,re){var Pe="start";re.staffNum>0&&(r.staves[re.staffNum-1].connectBarLines==="start"||r.staves[re.staffNum-1].connectBarLines==="continue")&&(Pe="continue"),r.staves[re.staffNum].connectBarLines=Pe}};k.length;){var Z=k.shift();switch(Z.token){case"(":ye?o("Can't nest parenthesis in %%score",y,Z.start):(ye=!0,Y=!0);break;case")":!ye||Y?o("Unexpected close parenthesis in %%score",y,Z.start):ye=!1;break;case"[":R?o("Can't nest brackets in %%score",y,Z.start):(R=!0,W=!0);break;case"]":!R||W?o("Unexpected close bracket in %%score",y,Z.start):(R=!1,r.staves[re.staffNum].bracket="end");break;case"{":q?o("Can't nest braces in %%score",y,Z.start):(q=!0,U=!0);break;case"}":!q||U?o("Unexpected close brace in %%score",y,Z.start):(q=!1,r.staves[re.staffNum].brace="end");break;case"|":he();break;default:for(var ie="";(Z.type==="alpha"||Z.type==="number")&&(ie+=Z.token,Z.continueId);)Z=k.shift();var be=!ye||Y,pe=W?"start":R?"continue":void 0,oe=U?"start":q?"continue":void 0;ge(ie,be,pe,oe,J),Y=!1,W=!1,U=!1,J=!1,re=r.voices[ie],O==="staves"&&he();break}}break;case"maxstaves":var me=p.getInt(w);me.digits===0?o("Expected number of staves in maxstaves"):me.value>0&&(n.formatting.maxStaves=me.value);break;case"newpage":var Ee=p.getInt(w);c.addNewPage(Ee.digits===0?-1:Ee.value);break;case"abc":var ue=w.split(" ");switch(ue[0]){case"-copyright":case"-creator":case"-edited-by":case"-version":case"-charset":var xe=ue.shift();c.addMetaText(O+xe,ue.join(" "),{startChar:r.iChar,endChar:r.iChar+w.length+5});break;default:return"Unknown directive: "+O+ue[0]}break;case"header":case"footer":var we=p.getMeat(w,0,w.length);we=w.substring(we.start,we.end),we[0]==='"'&&we[we.length-1]==='"'&&(we=we.substring(1,we.length-1));var de=we.split(" "),Te={};de.length===1?Te={left:"",center:de[0],right:""}:de.length===2?Te={left:de[0],center:de[1],right:""}:Te={left:de[0],center:de[1],right:de[2]},de.length>3&&o("Too many tabs in "+O+": "+de.length+" found.",w,0),c.addMetaTextObj(O,Te,{startChar:r.iChar,endChar:r.iChar+y.length});break;case"midi":var ke=p.tokenize(w,0,w.length,!0);ke.length>0&&ke[0].token==="="&&ke.shift(),ke.length===0?o("Expected midi command",w,0):L(ke,n,w);break;case"percmap":var Be=e(w);Be.error?o(Be.error,y,8):(n.formatting.percmap||(n.formatting.percmap={}),n.formatting.percmap[Be.key]=Be.value);break;case"visualtranspose":var De=p.getInt(w);De.digits===0?o("Expected number of half steps in visualTranspose"):r.globalTranspose=De.value;break;case"map":case"playtempo":case"auquality":case"continuous":case"nobarcheck":n.formatting[O]=w;break;default:return"Unknown directive: "+O}return null},g.globalFormatting=function(y){for(var k in y)if(y.hasOwnProperty(k)){var w=""+y[k],O=p.tokenize(w,0,w.length),z;switch(k){case"titlefont":case"gchordfont":case"composerfont":case"footerfont":case"headerfont":case"historyfont":case"infofont":case"measurefont":case"partsfont":case"repeatfont":case"subtitlefont":case"tempofont":case"textfont":case"voicefont":case"tripletfont":case"vocalfont":case"wordsfont":case"annotationfont":case"tablabelfont":case"tabnumberfont":case"tabgracefont":u(k,O,w);break;case"scale":t(k,O);break;case"partsbox":z=x("partsBox",k,O),z!==null&&o(z),r.partsfont.box=r.partsBox;break;case"freegchord":z=x("freegchord",k,O),z!==null&&o(z);break;case"fontboxpadding":(O.length!==1||O[0].type!=="number")&&o('Directive "'+k+'" requires a number as a parameter.'),n.formatting.fontboxpadding=O[0].floatt;break;case"stafftopmargin":(O.length!==1||O[0].type!=="number")&&o('Directive "'+k+'" requires a number as a parameter.'),n.formatting.stafftopmargin=O[0].floatt;break;case"stretchlast":var V=H(O);if(V.value!==void 0&&(n.formatting.stretchlast=V.value),V.error)return V.error;break;default:o("Formatting directive unrecognized: ",k,0)}}};function H(y){if(y.length===0)return{value:1};if(y.length===1)if(y[0].type==="number"){if(y[0].floatt>=0||y[0].floatt<=1)return{value:y[0].floatt}}else{if(y[0].token==="false")return{value:0};if(y[0].token==="true")return{value:1}}return{error:"Directive stretchlast requires zero or one parameter: false, true, or number between 0 and 1 (received "+y[0].token+")"}}}(),Qe=g,Qe}var Je,Xr;function us(){if(Xr)return Je;Xr=1;var T={};const g=["C,,,","D,,,","E,,,","F,,,","G,,,","A,,,","B,,,","C,,","D,,","E,,","F,,","G,,","A,,","B,,","C,","D,","E,","F,","G,","A,","B,","C","D","E","F","G","A","B","c","d","e","f","g","a","b","c'","d'","e'","f'","g'","a'","b'","c''","d''","e''","f''","g''","a''","b''","c'''","d'''","e'''","f'''","g'''","a'''","b'''"];return T.pitchIndex=function(p){return g.indexOf(p)},T.noteName=function(p){return g[p]},Je=T,Je}var Ze,Kr;function Mi(){if(Kr)return Ze;Kr=1;var T=["C","C♯","D","D♯","E","F","F♯","G","G♯","A","A♯","B"],g=["C","D♭","D","E♭","E","F","G♭","G","A♭","A","B♭","B"],p=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],o=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"];function r(n,c,s,l){if(!c||c%12===0)return n;for(;c<0;)c+=12;c>11&&(c=c%12);var d=n.match(/^([A-G][b#♭♯]?)([^\/]+)?\/?([A-G][b#♭♯]?)?(.+)?/);if(!d)return n;var f=d[1],u=d[2],i=d[3],t=d[4],a=T.indexOf(f);if(a<0&&(a=g.indexOf(f)),a<0&&(a=p.indexOf(f)),a<0&&(a=o.indexOf(f)),a<0)return n;a+=c,a=a%12,s?l?n=o[a]:n=g[a]:l?n=p[a]:n=T[a];var e=u&&(u.indexOf("dim")>=0||u.indexOf("°")>=0);if(e&&n==="A#"&&(n="Bb"),e&&n==="D#"&&(n="Eb"),e&&n==="A♯"&&(n="B♭"),e&&n==="D♯"&&(n="E♭"),u&&(n+=u),i){var a=T.indexOf(i);a<0&&(a=g.indexOf(i)),a<0&&(a=p.indexOf(i)),a<0&&(a=o.indexOf(i)),n+="/",a>=0?(a+=c,a=a%12,s?l?n+=o[a]:n+=g[a]:l?n+=p[a]:n+=T[a]):n+=i}return t&&(n+=t),n}return Ze=r,Ze}var et,Ur;function Ai(){if(Ur)return et;Ur=1;var T={C:{modes:["CMaj","Amin","Am","GMix","DDor","EPhr","FLyd","BLoc"],stepsFromC:0},Db:{modes:["DbMaj","Bbmin","Bbm","AbMix","EbDor","FPhr","GbLyd","CLoc"],stepsFromC:1},D:{modes:["DMaj","Bmin","Bm","AMix","EDor","F#Phr","GLyd","C#Loc"],stepsFromC:2},Eb:{modes:["EbMaj","Cmin","Cm","BbMix","FDor","GPhr","AbLyd","DLoc"],stepsFromC:3},E:{modes:["EMaj","C#min","C#m","BMix","F#Dor","G#Phr","ALyd","D#Loc"],stepsFromC:4},F:{modes:["FMaj","Dmin","Dm","CMix","GDor","APhr","BbLyd","ELoc"],stepsFromC:5},Gb:{modes:["GbMaj","Ebmin","Ebm","DbMix","AbDor","BbPhr","CbLyd","FLoc"],stepsFromC:6},G:{modes:["GMaj","Emin","Em","DMix","ADor","BPhr","CLyd","F#Loc"],stepsFromC:7},Ab:{modes:["AbMaj","Fmin","Fm","EbMix","BbDor","CPhr","DbLyd","GLoc"],stepsFromC:8},A:{modes:["AMaj","F#min","F#m","EMix","BDor","C#Phr","DLyd","G#Loc"],stepsFromC:9},Bb:{modes:["BbMaj","Gmin","Gm","FMix","CDor","DPhr","EbLyd","ALoc"],stepsFromC:10},B:{modes:["BMaj","G#min","G#m","F#Mix","C#Dor","D#Phr","ELyd","A#Loc"],stepsFromC:11},"C#":{modes:["C#Maj","A#min","A#m","G#Mix","D#Dor","E#Phr","F#Lyd","B#Loc"],stepsFromC:1},"F#":{modes:["F#Maj","D#min","D#m","C#Mix","G#Dor","A#Phr","BLyd","E#Loc"],stepsFromC:6},Cb:{modes:["CbMaj","Abmin","Abm","GbMix","DbDor","EbPhr","FbLyd","BbLoc"],stepsFromC:11}},g=null;function p(){g={};for(var c=Object.keys(T),s=0;s<c.length;s++){var l=T[c[s]];g[c[s].toLowerCase()]=c[s];for(var d=0;d<l.modes.length;d++){var f=l.modes[d].toLowerCase();g[f]=c[s]}}}function o(c){g||p();var s=c.toLowerCase().match(/([a-g][b#]?)(maj|min|mix|dor|phr|lyd|loc|m)?/);if(!s||!s[2])return c;s=s[1]+s[2];var l=g[s];return l||c}function r(c,s){var l=T[c];if(!l||s==="")return c;var d=s.toLowerCase().match(/^(maj|min|mix|dor|phr|lyd|loc|m)/);if(!d)return c;for(var f=d[1],u=0;u<l.modes.length;u++){var i=l.modes[u],t=i.toLowerCase().indexOf(f);if(t!==-1&&t===i.length-f.length)return i.substring(0,i.length-f.length)}return c}function n(c,s){var l=T[c];if(!l)return c;for(;s<0;)s+=12;for(var d=(l.stepsFromC+s)%12,f=0;f<Object.keys(T).length;f++){var u=Object.keys(T)[f];if(T[u].stepsFromC===d)return u}return c}return et={relativeMajor:o,relativeMode:r,transposeKey:n},et}var tt,$r;function Ni(){if($r)return tt;$r=1;var{relativeMajor:T}=Ai(),g={acc:"sharp",note:"f"},p={acc:"sharp",note:"c"},o={acc:"sharp",note:"g"},r={acc:"sharp",note:"d"},n={acc:"sharp",note:"A"},c={acc:"sharp",note:"e"},s={acc:"sharp",note:"B"},l={acc:"flat",note:"B"},d={acc:"flat",note:"e"},f={acc:"flat",note:"A"},u={acc:"flat",note:"d"},i={acc:"flat",note:"G"},t={acc:"flat",note:"c"},a={acc:"flat",note:"F"},e={"C#":[g,p,o,r,n,c,s],"F#":[g,p,o,r,n,c],B:[g,p,o,r,n],E:[g,p,o,r],A:[g,p,o],D:[g,p],G:[g],C:[],F:[l],Bb:[l,d],Eb:[l,d,f],Cm:[l,d,f],Ab:[l,d,f,u],Db:[l,d,f,u,i],Gb:[l,d,f,u,i,t],Cb:[l,d,f,u,i,t,a],"A#":[l,d],"B#":[],"D#":[l,d,f],"E#":[l],"G#":[l,d,f,u],none:[]};function h(v){var m=e[T(v)];return m?JSON.parse(JSON.stringify(m)):null}return tt=h,tt}var rt,Qr;function Bi(){if(Qr)return rt;Qr=1;var T=us(),g=Mi(),p=Ni(),o={},r={C:0,"C#":1,Db:1,D:2,"D#":3,Eb:3,E:4,F:5,"F#":6,Gb:6,G:7,"G#":8,Ab:8,A:9,"A#":10,Bb:10,B:11},n=["C","Db","D","Eb","E","F","F#","G","Ab","A","Bb","B"],c=["C","C#","D","D#","E","F","F#","G","G#","A","Bb","B"];o.keySignature=function(i,t,a,e,h){if(i.clef.type==="perc"||i.clef.type==="none")return{accidentals:p(t),root:a,acc:e};h||(h=0),i.localTransposeVerticalMovement=0,i.localTransposePreferFlats=!1;var v=p(t);if(!v)return i.key;if(i.localTranspose=(i.globalTranspose?i.globalTranspose:0)+h,!i.localTranspose)return{accidentals:v,root:a,acc:e};if(i.globalTransposeOrigKeySig=v,i.localTranspose%12===0)return i.localTransposeVerticalMovement=i.localTranspose/12*7,{accidentals:v,root:a,acc:e};var m=t[0];t[1]==="b"||t[1]==="#"?(m+=t[1],t=t.substr(2)):t=t.substr(1);var x=r[m],C=x!==void 0;C||(x=0,m="C",t="");for(var S=x+i.localTranspose;S<0;)S+=12;S>11&&(S=S%12);var j=t[0]==="m"?c[S]:n[S],F=j+t,b=p(F);(b.length===0||b[0].acc==="flat")&&(i.localTransposePreferFlats=!0);var M=F.charCodeAt(0)-m.charCodeAt(0);return i.localTranspose>0?(M<0||M===0&&(m[1]==="#"||F[1]==="b"))&&(M+=7):i.localTranspose<0&&(M>0||M===0&&(m[1]==="b"||F[1]==="#"))&&(M-=7),i.localTranspose>0?i.localTransposeVerticalMovement=M+Math.floor(i.localTranspose/12)*7:i.localTransposeVerticalMovement=M+Math.ceil(i.localTranspose/12)*7,C?{accidentals:b,root:j[0],acc:j.length>1?j[1]:""}:{accidentals:[],root:a,acc:e}},o.chordName=function(i,t){return g(t,i.localTranspose,i.localTransposePreferFlats,i.freegchord)};var s=["c","d","e","f","g","a","b"];function l(i,t,a,e,h){for(var v=s[(i+49)%7],m=0,x=0;x<e.length;x++)e[x].note.toLowerCase()===v&&(m=d[e[x].acc]);for(var C=d[a],S=C-m,j=s[(t+49)%7],F=0,b=0;b<h.accidentals.length;b++)h.accidentals[b].note.toLowerCase()===j&&(F=d[h.accidentals[b].acc]);var M=S+F;return M<-2&&(t--,M+=j==="c"||j==="f"?1:2),M>2&&(t++,M-=j==="b"||j==="e"?1:2),[t,M]}var d={dblflat:-2,flat:-1,natural:0,sharp:1,dblsharp:2},f={"-2":"dblflat","-1":"flat",0:"natural",1:"sharp",2:"dblsharp"},u={"-2":"__","-1":"_",0:"=",1:"^",2:"^^"};return o.note=function(i,t){if(!(!i.localTranspose||i.clef.type==="perc")){var a=t.pitch;if(i.localTransposeVerticalMovement&&(t.pitch=t.pitch+i.localTransposeVerticalMovement,t.name)){var e=t.accidental?t.name.substring(1):t.name,h=t.accidental?t.name[0]:"",v=T.pitchIndex(e);t.name=h+T.noteName(v+i.localTransposeVerticalMovement)}if(t.accidental){var m=l(a,t.pitch,t.accidental,i.globalTransposeOrigKeySig,i.targetKey);t.pitch=m[0],t.accidental=f[m[1]],t.name&&(t.name=u[m[1]]+t.name.replace(/[_^=]/g,""))}}},rt=o,rt}var at,Jr;function Lr(){if(Jr)return at;Jr=1;var T=Pr(),g=Bi(),p={};return function(){var o,r,n,c;p.initialize=function(t,a,e,h,v){o=t,r=a,n=e,c=v},p.standardKey=function(t,a,e,h){return g.keySignature(n,t,a,e,h)};var s={treble:{clef:"treble",pitch:4,mid:0},"treble+8":{clef:"treble+8",pitch:4,mid:0},"treble-8":{clef:"treble-8",pitch:4,mid:0},"treble^8":{clef:"treble+8",pitch:4,mid:0},treble_8:{clef:"treble-8",pitch:4,mid:0},treble1:{clef:"treble",pitch:2,mid:2},treble2:{clef:"treble",pitch:4,mid:0},treble3:{clef:"treble",pitch:6,mid:-2},treble4:{clef:"treble",pitch:8,mid:-4},treble5:{clef:"treble",pitch:10,mid:-6},perc:{clef:"perc",pitch:6,mid:0},none:{clef:"none",mid:0},bass:{clef:"bass",pitch:8,mid:-12},"bass+8":{clef:"bass+8",pitch:8,mid:-12},"bass-8":{clef:"bass-8",pitch:8,mid:-12},"bass^8":{clef:"bass+8",pitch:8,mid:-12},bass_8:{clef:"bass-8",pitch:8,mid:-12},"bass+16":{clef:"bass",pitch:8,mid:-12},"bass-16":{clef:"bass",pitch:8,mid:-12},"bass^16":{clef:"bass",pitch:8,mid:-12},bass_16:{clef:"bass",pitch:8,mid:-12},bass1:{clef:"bass",pitch:2,mid:-6},bass2:{clef:"bass",pitch:4,mid:-8},bass3:{clef:"bass",pitch:6,mid:-10},bass4:{clef:"bass",pitch:8,mid:-12},bass5:{clef:"bass",pitch:10,mid:-14},tenor:{clef:"alto",pitch:8,mid:-8},tenor1:{clef:"alto",pitch:2,mid:-2},tenor2:{clef:"alto",pitch:4,mid:-4},tenor3:{clef:"alto",pitch:6,mid:-6},tenor4:{clef:"alto",pitch:8,mid:-8},tenor5:{clef:"alto",pitch:10,mid:-10},alto:{clef:"alto",pitch:6,mid:-6},alto1:{clef:"alto",pitch:2,mid:-2},alto2:{clef:"alto",pitch:4,mid:-4},alto3:{clef:"alto",pitch:6,mid:-6},alto4:{clef:"alto",pitch:8,mid:-8},alto5:{clef:"alto",pitch:10,mid:-10},"alto+8":{clef:"alto+8",pitch:6,mid:-6},"alto-8":{clef:"alto-8",pitch:6,mid:-6},"alto^8":{clef:"alto+8",pitch:6,mid:-6},alto_8:{clef:"alto-8",pitch:6,mid:-6}},l=function(t,a){var e=s[t],h=e?e.mid:0;return h+a};p.fixClef=function(t){var a=s[t.type];a&&(t.clefPos=a.pitch,t.type=a.clef)},p.deepCopyKey=function(t){var a={accidentals:[],root:t.root,acc:t.acc,mode:t.mode};return t.accidentals.forEach(function(e){a.accidentals.push(Object.assign({},e))}),a};var d={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};p.addPosToKey=function(t,a){var e=t.verticalPos;a.accidentals.forEach(function(h){var v=d[h.note];v=v-e,h.verticalPos=v}),a.impliedNaturals&&a.impliedNaturals.forEach(function(h){var v=d[h.note];v=v-e,h.verticalPos=v}),e<-10?(a.accidentals.forEach(function(h){h.verticalPos-=7,(h.verticalPos>=11||h.verticalPos===10&&h.acc==="flat")&&(h.verticalPos-=7),h.note==="A"&&h.acc==="sharp"&&(h.verticalPos-=7),(h.note==="G"||h.note==="F")&&h.acc==="flat"&&(h.verticalPos-=7)}),a.impliedNaturals&&a.impliedNaturals.forEach(function(h){h.verticalPos-=7,(h.verticalPos>=11||h.verticalPos===10&&h.acc==="flat")&&(h.verticalPos-=7),h.note==="A"&&h.acc==="sharp"&&(h.verticalPos-=7),(h.note==="G"||h.note==="F")&&h.acc==="flat"&&(h.verticalPos-=7)})):e<-4?(a.accidentals.forEach(function(h){h.verticalPos-=7,e===-8&&(h.note==="f"||h.note==="g")&&h.acc==="sharp"&&(h.verticalPos-=7)}),a.impliedNaturals&&a.impliedNaturals.forEach(function(h){h.verticalPos-=7,e===-8&&(h.note==="f"||h.note==="g")&&h.acc==="sharp"&&(h.verticalPos-=7)})):e>=7&&(a.accidentals.forEach(function(h){h.verticalPos+=7}),a.impliedNaturals&&a.impliedNaturals.forEach(function(h){h.verticalPos+=7}))},p.fixKey=function(t,a){var e=Object.assign({},a);return p.addPosToKey(t,e),e};var f=function(t){var a=0,e=t[a++];(e==="^"||e==="_")&&(e=t[a++]);var h=d[e];for(h===void 0&&(h=6);a<t.length;a++)if(t[a]===",")h-=7;else if(t[a]==="'")h+=7;else break;return{mid:h-6,str:t.substring(a)}},u=function(t){for(var a=0;a<t.length;a++)t[a].note==="b"?t[a].note="B":t[a].note==="a"?t[a].note="A":t[a].note==="F"?t[a].note="f":t[a].note==="E"?t[a].note="e":t[a].note==="D"?t[a].note="d":t[a].note==="C"?t[a].note="c":t[a].note==="G"&&t[a].acc==="sharp"?t[a].note="g":t[a].note==="g"&&t[a].acc==="flat"&&(t[a].note="G")};p.parseKey=function(t,a){t.length===0&&(t="none");var e=o.tokenize(t,0,t.length),h={};if(e.length===0)return r("Must pass in key signature.",t,0),h;switch(e[0].token){case"HP":T.addDirective("bagpipes"),n.key={root:"HP",accidentals:[],acc:"",mode:""},h.foundKey=!0,e.shift();break;case"Hp":T.addDirective("bagpipes"),n.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},h.foundKey=!0,e.shift();break;case"none":n.key={root:"none",accidentals:[],acc:"",mode:""},h.foundKey=!0,e.shift();break;default:var v=o.getKeyPitch(e[0].token);if(v.len>0){h.foundKey=!0;var m="",x="";e[0].token.length>1?e[0].token=e[0].token.substring(1):e.shift();var C=v.token;if(e.length>0){var S=o.getSharpFlat(e[0].token);if(S.len>0&&(e[0].token.length>1?e[0].token=e[0].token.substring(1):e.shift(),C+=S.token,m=S.token),e.length>0){var j=o.getMode(e[0].token);j.len>0&&(e.shift(),C+=j.token,x=j.token)}if(p.standardKey(C,v.token,m,0)===void 0)return r("Unsupported key signature: "+C,t,0),h}var F=p.deepCopyKey(n.key),b=!a&&n.globalTranspose?-n.globalTranspose:0,M;if(a&&(M=n.globalTransposeOrigKeySig),n.key=p.deepCopyKey(p.standardKey(C,v.token,m,b)),a&&(n.globalTransposeOrigKeySig=M),n.key.mode=x,F&&n.keywarn!==!1){for(var B,A=0;A<n.key.accidentals.length;A++)for(B=0;B<F.accidentals.length;B++)F.accidentals[B].note&&n.key.accidentals[A].note.toLowerCase()===F.accidentals[B].note.toLowerCase()&&(F.accidentals[B].note=null);for(B=0;B<F.accidentals.length;B++)F.accidentals[B].note&&(n.key.impliedNaturals||(n.key.impliedNaturals=[]),n.key.impliedNaturals.push({acc:"natural",note:F.accidentals[B].note}))}}break}if(e.length===0||(e[0].token==="exp"&&e.shift(),e.length===0)||(e[0].token==="oct"&&e.shift(),e.length===0))return h;var P=o.getKeyAccidentals2(e);if(P.warn&&r(P.warn,t,0),P.accs){h.foundKey||(h.foundKey=!0,n.key={root:"none",acc:"",mode:"",accidentals:[]}),u(P.accs);for(var N=0;N<P.accs.length;N++){for(var E=!1,_=0;_<n.key.accidentals.length&&!E;_++)n.key.accidentals[_].note===P.accs[N].note&&(E=!0,n.key.accidentals[_].acc!==P.accs[N].acc&&(n.key.accidentals[_].acc=P.accs[N].acc,n.key.explicitAccidentals||(n.key.explicitAccidentals=[]),n.key.explicitAccidentals.push(P.accs[N])));if(!E&&(n.key.explicitAccidentals||(n.key.explicitAccidentals=[]),n.key.explicitAccidentals.push(P.accs[N]),n.key.accidentals.push(P.accs[N]),n.key.impliedNaturals))for(var L=0;L<n.key.impliedNaturals.length;L++)n.key.impliedNaturals[L].note===P.accs[N].note&&n.key.impliedNaturals.splice(L,1)}}for(var D;e.length>0;)switch(e[0].token){case"m":case"middle":if(e.shift(),e.length===0)return r("Expected = after middle",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after middle",t,D.start);break}if(e.length===0)return r("Expected parameter after middle=",t,0),h;var H=o.getPitchFromTokens(e);H.warn&&r(H.warn,t,0),H.position&&(n.clef.verticalPos=H.position-6);break;case"transpose":if(e.shift(),e.length===0)return r("Expected = after transpose",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after transpose",t,D.start);break}if(e.length===0)return r("Expected parameter after transpose=",t,0),h;if(e[0].type!=="number"){r("Expected number after transpose",t,e[0].start);break}n.clef.transpose=e[0].intt,e.shift();break;case"stafflines":if(e.shift(),e.length===0)return r("Expected = after stafflines",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after stafflines",t,D.start);break}if(e.length===0)return r("Expected parameter after stafflines=",t,0),h;if(e[0].type!=="number"){r("Expected number after stafflines",t,e[0].start);break}n.clef.stafflines=e[0].intt,e.shift();break;case"staffscale":if(e.shift(),e.length===0)return r("Expected = after staffscale",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after staffscale",t,D.start);break}if(e.length===0)return r("Expected parameter after staffscale=",t,0),h;if(e[0].type!=="number"){r("Expected number after staffscale",t,e[0].start);break}n.clef.staffscale=e[0].floatt,e.shift();break;case"octave":if(e.shift(),e.length===0)return r("Expected = after octave",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after octave",t,D.start);break}if(e.length===0)return r("Expected parameter after octave=",t,0),h;if(e[0].type!=="number"){r("Expected number after octave",t,e[0].start);break}n.octave=e[0].intt,e.shift();break;case"style":if(e.shift(),e.length===0)return r("Expected = after style",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after style",t,D.start);break}if(e.length===0)return r("Expected parameter after style=",t,0),h;switch(e[0].token){case"normal":case"harmonic":case"rhythm":case"x":case"triangle":n.style=e[0].token,e.shift();break;default:r("error parsing style element: "+e[0].token,t,e[0].start);break}break;case"clef":if(e.shift(),e.length===0)return r("Expected = after clef",t,0),h;if(D=e.shift(),D.token!=="="){r("Expected = after clef",t,D.start);break}if(e.length===0)return r("Expected parameter after clef=",t,0),h;case"treble":case"bass":case"alto":case"tenor":case"perc":case"none":var y=e.shift();switch(y.token){case"treble":case"tenor":case"alto":case"bass":case"perc":case"none":break;case"C":y.token="alto";break;case"F":y.token="bass";break;case"G":y.token="treble";break;case"c":y.token="alto";break;case"f":y.token="bass";break;case"g":y.token="treble";break;default:r("Expected clef name. Found "+y.token,t,y.start);break}e.length>0&&e[0].type==="number"&&(y.token+=e[0].token,e.shift()),e.length>1&&(e[0].token==="-"||e[0].token==="+"||e[0].token==="^"||e[0].token==="_")&&e[1].token==="8"&&(y.token+=e[0].token+e[1].token,e.shift(),e.shift()),n.clef={type:y.token,verticalPos:l(y.token,0)},n.currentVoice&&n.currentVoice.transpose!==void 0&&(n.clef.transpose=n.currentVoice.transpose),h.foundClef=!0;break;default:r("Unknown parameter: "+e[0].token,t,e[0].start),e.shift()}return h};var i=function(t){var a=n.voices[t];if(!(n.currentVoice&&n.currentVoice.index===a.index&&n.currentVoice.staffNum===a.staffNum))return n.currentVoice=a,c.setCurrentVoice(a.staffNum,a.index,t)};p.parseVoice=function(t,a,e){var h=o.getMeat(t,a,e),v=h.start,m=h.end,x=o.getToken(t,v,m);if(x.length===0){r("Expected a voice id",t,v);return}var C=!1;n.voices[x]===void 0&&(n.voices[x]={},C=!0,n.score_is_present&&r("Can't have an unknown V: id when the %score directive is present",t,v)),v+=x.length,v+=o.eatWhiteSpace(t,v);for(var S={startStaff:C},j=function(H){var y=o.getVoiceToken(t,v,m);y.warn!==void 0?r("Expected value for "+H+" in voice: "+y.warn,t,v):y.err!==void 0?r("Expected value for "+H+" in voice: "+y.err,t,v):y.token.length===0&&t[v]!=='"'?r("Expected value for "+H+" in voice",t,v):S[H]=y.token,v+=y.len},F=function(H,y,k){var w=o.getVoiceToken(t,v,m);w.warn!==void 0?r("Expected value for "+y+" in voice: "+w.warn,t,v):w.err!==void 0?r("Expected value for "+y+" in voice: "+w.err,t,v):w.token.length===0&&t[v]!=='"'?r("Expected value for "+y+" in voice",t,v):(w.token=parseFloat(w.token),n.voices[H][y]=w.token),v+=w.len},b=function(H,y){var k=o.getVoiceToken(t,v,m);if(k.warn!==void 0)r("Expected value for "+H+" in voice: "+k.warn,t,v);else if(k.err!==void 0)r("Expected value for "+H+" in voice: "+k.err,t,v);else if(k.token.length===0&&t[v]!=='"')r("Expected value for "+H+" in voice",t,v);else return k.token;v+=k.len},M=function(H,y){var k={_B:2,_E:9,_b:-10,_e:-3},w=o.getVoiceToken(t,v,m);if(w.warn!==void 0)r("Expected one of (_B, _E, _b, _e) for "+y+" in voice: "+w.warn,t,v);else if(w.token.length===0&&t[v]!=='"')r("Expected one of (_B, _E, _b, _e) for "+y+" in voice",t,v);else{var O=k[w.token];O?n.voices[H][y]=O:r("Expected one of (_B, _E, _b, _e) for "+y+" in voice",t,v)}v+=w.len};v<m;){var B=o.getVoiceToken(t,v,m);if(v+=B.len,B.warn)r("Error parsing voice: "+B.warn,t,v);else{var A=null;switch(B.token){case"clef":case"cl":j("clef");var P=0;S.clef!==void 0&&(S.clef=S.clef.replace(/[',]/g,""),S.clef.indexOf("+16")!==-1&&(P+=14,S.clef=S.clef.replace("+16","")),S.verticalPos=l(S.clef,P));break;case"treble":case"bass":case"tenor":case"alto":case"perc":case"none":case"treble'":case"bass'":case"tenor'":case"alto'":case"none'":case"treble''":case"bass''":case"tenor''":case"alto''":case"none''":case"treble,":case"bass,":case"tenor,":case"alto,":case"none,":case"treble,,":case"bass,,":case"tenor,,":case"alto,,":case"none,,":case"treble+8":case"treble-8":case"treble^8":case"treble_8":case"treble1":case"treble2":case"treble3":case"treble4":case"treble5":case"bass+8":case"bass-8":case"bass^8":case"bass_8":case"bass+16":case"bass-16":case"bass^16":case"bass_16":case"bass1":case"bass2":case"bass3":case"bass4":case"bass5":case"tenor1":case"tenor2":case"tenor3":case"tenor4":case"tenor5":case"alto1":case"alto2":case"alto3":case"alto4":case"alto5":case"alto+8":case"alto-8":case"alto^8":case"alto_8":var N=0;S.clef=B.token.replace(/[',]/g,""),S.verticalPos=l(S.clef,N),n.voices[x].clef=B.token;break;case"staves":case"stave":case"stv":j("staves");break;case"brace":case"brc":j("brace");break;case"bracket":case"brk":j("bracket");break;case"name":case"nm":j("name");break;case"subname":case"sname":case"snm":j("subname");break;case"merge":S.startStaff=!1;break;case"stem":case"stems":A=o.getVoiceToken(t,v,m),A.warn!==void 0?r("Expected value for stems in voice: "+A.warn,t,v):A.err!==void 0?r("Expected value for stems in voice: "+A.err,t,v):A.token==="up"||A.token==="down"?n.voices[x].stem=A.token:r("Expected up or down for voice stem",t,v),v+=A.len;break;case"up":case"down":n.voices[x].stem=B.token;break;case"middle":case"m":j("verticalPos"),S.verticalPos=f(S.verticalPos).mid;break;case"gchords":case"gch":n.voices[x].suppressChords=!0,A=o.getVoiceToken(t,v,m),A.token==="0"&&(v=v+A.len);break;case"space":case"spc":j("spacing");break;case"scale":F(x,"scale");break;case"score":M(x,"scoreTranspose");break;case"transpose":F(x,"transpose");break;case"stafflines":F(x,"stafflines");break;case"staffscale":F(x,"staffscale");break;case"octave":F(x,"octave");break;case"volume":F(x,"volume");break;case"cue":var E=b("cue");E==="on"?n.voices[x].scale=.6:n.voices[x].scale=1;break;case"style":A=o.getVoiceToken(t,v,m),A.warn!==void 0?r("Expected value for style in voice: "+A.warn,t,v):A.err!==void 0?r("Expected value for style in voice: "+A.err,t,v):A.token==="normal"||A.token==="harmonic"||A.token==="rhythm"||A.token==="x"||A.token==="triangle"?n.voices[x].style=A.token:r("Expected one of [normal, harmonic, rhythm, x, triangle] for voice style",t,v),v+=A.len;break}}v+=o.eatWhiteSpace(t,v)}if((S.startStaff||n.staves.length===0)&&(n.staves.push({index:n.staves.length,meter:n.origMeter}),n.score_is_present||(n.staves[n.staves.length-1].numVoices=0)),n.voices[x].staffNum===void 0){n.voices[x].staffNum=n.staves.length-1;var _=0;for(var L in n.voices)n.voices.hasOwnProperty(L)&&n.voices[L].staffNum===n.voices[x].staffNum&&_++;n.voices[x].index=_-1}var D=n.staves[n.voices[x].staffNum];return n.score_is_present||D.numVoices++,S.clef&&(D.clef={type:S.clef,verticalPos:S.verticalPos}),S.spacing&&(D.spacing_below_offset=S.spacing),S.verticalPos&&(D.verticalPos=S.verticalPos),S.name&&(D.name?D.name.push(S.name):D.name=[S.name]),S.subname&&(D.subname?D.subname.push(S.subname):D.subname=[S.subname]),i(x)}}(),at=p,at}var nt,Zr;function ds(){if(Zr)return nt;Zr=1;var T=Ne(),g=Pr(),p=Lr(),o=function(r,n,c,s,l){this.reset=function(u,i,t,a){p.initialize(u,i,t,a,l),g.initialize(u,i,t,a,l)},this.reset(r,n,c,s),this.setTitle=function(u,i){c.hasMainTitle?l.addSubtitle(u,{startChar:c.iChar,endChar:c.iChar+i+2}):(l.addMetaText("title",u,{startChar:c.iChar,endChar:c.iChar+i+2}),c.hasMainTitle=!0)},this.setMeter=function(u){if(u=r.stripComment(u),u==="C")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"common_time"};if(u==="C|")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"cut_time"};if(u==="o")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_perfectum"};if(u==="c")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_imperfectum"};if(u==="o.")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_perfectum_prolatio"};if(u==="c.")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),{type:"tempus_imperfectum_prolatio"};if(u.length===0||u.toLowerCase()==="none")return c.havent_set_length===!0&&(c.default_length=.125,c.havent_set_length=!1),null;var i=r.tokenize(u,0,u.length);try{var t=function(){var x={value:0,num:""},C=i.shift();for(C.token==="("&&(C=i.shift());;){if(C.type!=="number")throw"Expected top number of meter";if(x.value+=parseInt(C.token),x.num+=C.token,i.length===0||i[0].token==="/")return x;if(C=i.shift(),C.token===")"){if(i.length===0||i[0].token==="/")return x;throw"Unexpected paren in meter"}if(C.token!=="."&&C.token!=="+"||(x.num+=C.token,i.length===0))throw"Expected top number of meter";C=i.shift()}return x},a=function(){var x=t();if(i.length===0)return x;var C=i.shift();if(C.token!=="/")throw"Expected slash in meter";if(C=i.shift(),C.type!=="number")throw"Expected bottom number of meter";return x.den=C.token,x.value=x.value/parseInt(x.den),x};if(i.length===0)throw"Expected meter definition in M: line";for(var e={type:"specified",value:[]},h=0;;){var v=a();h+=v.value;var m={num:v.num};if(v.den!==void 0&&(m.den=v.den),e.value.push(m),i.length===0)break}return c.havent_set_length===!0&&(c.default_length=h<.75?.0625:.125,c.havent_set_length=!1),e}catch(x){n(x,u,0)}return null},this.calcTempo=function(u){var i=.25;c.meter&&c.meter.type==="specified"?i=1/parseInt(c.meter.value[0].den):c.origMeter&&c.origMeter.type==="specified"&&(i=1/parseInt(c.origMeter.value[0].den));for(var t=0;t<u.duration;t++)u.duration[t]=i*u.duration[t];return u},this.resolveTempo=function(){c.tempo&&(this.calcTempo(c.tempo),s.metaText.tempo=c.tempo,delete c.tempo)},this.addUserDefinition=function(u,i,t){var a=u.indexOf("=",i);if(a===-1){n("Need an = in a macro definition",u,i);return}var e=T.strip(u.substring(i,a)),h=T.strip(u.substring(a+1));if(e.length!==1){n("Macro definitions can only be one character",u,i);return}var v="HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw~";if(v.indexOf(e)===-1){n("Macro definitions must be H-Y, h-w, or tilde",u,i);return}if(h.length===0){n("Missing macro definition",u,i);return}c.macros===void 0&&(c.macros={}),c.macros[e]=h},this.setDefaultLength=function(u,i,t){var a=u.substring(i,t).replace(/ /g,""),e=a.split("/");if(e.length===2){var h=parseInt(e[0]),v=parseInt(e[1]);v>0&&(c.default_length=h/v,c.havent_set_length=!1)}else e.length===1&&e[0]==="1"&&(c.default_length=1,c.havent_set_length=!1)};var d={larghissimo:20,adagissimo:24,sostenuto:28,grave:32,largo:40,lento:50,larghetto:60,adagio:68,adagietto:74,andante:80,andantino:88,"marcia moderato":84,"andante moderato":100,moderato:112,allegretto:116,"allegro moderato":120,allegro:126,animato:132,agitato:140,veloce:148,"mosso vivo":156,vivace:164,vivacissimo:172,allegrissimo:176,presto:184,prestissimo:210};this.setTempo=function(u,i,t,a){try{var e=r.tokenize(u,i,t);if(e.length===0)throw"Missing parameter in Q: field";var h={startChar:a+i-2,endChar:a+t},v=!0,m=e.shift();if(m.type==="quote"&&(h.preString=m.token,m=e.shift(),e.length===0))return d[h.preString.toLowerCase()]&&(h.bpm=d[h.preString.toLowerCase()],h.suppressBpm=!0),{type:"immediate",tempo:h};if(m.type==="alpha"&&m.token==="C"){if(e.length===0)throw"Missing tempo after C in Q: field";if(m=e.shift(),m.type==="punct"&&m.token==="="){if(e.length===0)throw"Missing tempo after = in Q: field";if(m=e.shift(),m.type!=="number")throw"Expected number after = in Q: field";h.duration=[1],h.bpm=parseInt(m.token)}else if(m.type==="number"){if(h.duration=[parseInt(m.token)],e.length===0)throw"Missing = after duration in Q: field";if(m=e.shift(),m.type!=="punct"||m.token!=="=")throw"Expected = after duration in Q: field";if(e.length===0)throw"Missing tempo after = in Q: field";if(m=e.shift(),m.type!=="number")throw"Expected number after = in Q: field";h.bpm=parseInt(m.token)}else throw"Expected number or equal after C in Q: field"}else if(m.type==="number"){var x=parseInt(m.token);if(e.length===0||e[0].type==="quote")h.duration=[1],h.bpm=x;else{if(v=!1,m=e.shift(),m.type!=="punct"&&m.token!=="/"||(m=e.shift(),m.type!=="number"))throw"Expected fraction in Q: field";var C=parseInt(m.token);for(h.duration=[x/C];e.length>0&&e[0].token!=="="&&e[0].type!=="quote";){if(m=e.shift(),m.type!=="number"||(x=parseInt(m.token),m=e.shift(),m.type!=="punct"&&m.token!=="/")||(m=e.shift(),m.type!=="number"))throw"Expected fraction in Q: field";C=parseInt(m.token),h.duration.push(x/C)}if(m=e.shift(),m.type!=="punct"&&m.token!=="=")throw"Expected = in Q: field";if(m=e.shift(),m.type!=="number")throw"Expected tempo in Q: field";h.bpm=parseInt(m.token)}}else throw"Unknown value in Q: field";if(e.length!==0&&(m=e.shift(),m.type==="quote"&&(h.postString=m.token,m=e.shift()),e.length!==0))throw"Unexpected string at end of Q: field";return c.printTempo===!1&&(h.suppress=!0),{type:v?"delaySet":"immediate",tempo:h}}catch(S){return n(S,u,i),{type:"none"}}},this.letter_to_inline_header=function(u,i,t){var a=!1,e=r.eatWhiteSpace(u,i);if(i+=e,u.length>=i+5&&u[i]==="["&&u[i+2]===":"){var h=u.indexOf("]",i),v=c.iChar+i,m=c.iChar+h+1;switch(u.substring(i,i+3)){case"[I:":var x=g.addDirective(u.substring(i+3,h));return x&&n(x,u,i),[h-i+1+e];case"[M:":var C=this.setMeter(u.substring(i+3,h));return l.hasBeginMusic()&&C?l.appendStartingElement("meter",v,m,C):c.meter=C,[h-i+1+e];case"[K:":var S=p.parseKey(u.substring(i+3,h),!0);return S.foundClef&&l.hasBeginMusic()&&l.appendStartingElement("clef",v,m,c.clef),S.foundKey&&l.hasBeginMusic()&&l.appendStartingElement("key",v,m,p.fixKey(c.clef,c.key)),[h-i+1+e];case"[P:":var j=g.parseFontChangeLine(u.substring(i+3,h));return t||s.lines.length<=s.lineNum?c.partForNextLine={title:j,startChar:v,endChar:m}:l.appendElement("part",v,m,{title:j}),[h-i+1+e];case"[L:":return this.setDefaultLength(u,i+3,h),[h-i+1+e];case"[Q:":if(h>0){var F=this.setTempo(u,i+3,h,c.iChar);return F.type==="delaySet"?l.hasBeginMusic()?l.appendElement("tempo",v,m,this.calcTempo(F.tempo)):c.tempoForNextLine=["tempo",v,m,this.calcTempo(F.tempo)]:F.type==="immediate"&&(!t&&l.hasBeginMusic()?l.appendElement("tempo",v,m,F.tempo):c.tempoForNextLine=["tempo",v,m,F.tempo]),[h-i+1+e,u[i+1],u.substring(i+3,h)]}break;case"[V:":if(h>0)return a=p.parseVoice(u,i+3,h),[h-i+1+e,u[i+1],u.substring(i+3,h),a];break;case"[r:":return[h-i+1+e]}}return[0]},this.letter_to_body_header=function(u,i){var t=!1;if(u.length>=i+3)switch(u.substring(i,i+2)){case"I:":var a=g.addDirective(u.substring(i+2));return a&&n(a,u,i),[u.length];case"M:":var e=this.setMeter(u.substring(i+2));return l.hasBeginMusic()&&e&&l.appendStartingElement("meter",c.iChar+i,c.iChar+u.length,e),[u.length];case"K:":var h=p.parseKey(u.substring(i+2),l.hasBeginMusic());return h.foundClef&&l.hasBeginMusic()&&c.keywarn!==!1&&l.appendStartingElement("clef",c.iChar+i,c.iChar+u.length,c.clef),h.foundKey&&l.hasBeginMusic()&&c.keywarn!==!1&&l.appendStartingElement("key",c.iChar+i,c.iChar+u.length,p.fixKey(c.clef,c.key)),[u.length];case"P:":return l.hasBeginMusic()&&l.appendElement("part",c.iChar+i,c.iChar+u.length,{title:u.substring(i+2)}),[u.length];case"L:":return this.setDefaultLength(u,i+2,u.length),[u.length];case"Q:":var v=u.indexOf("",i+2);v===-1&&(v=u.length);var m=this.setTempo(u,i+2,v,c.iChar);return m.type==="delaySet"?l.appendElement("tempo",c.iChar+i,c.iChar+u.length,this.calcTempo(m.tempo)):m.type==="immediate"&&l.appendElement("tempo",c.iChar+i,c.iChar+u.length,m.tempo),[v,u[i],T.strip(u.substring(i+2))];case"V:":return t=p.parseVoice(u,i+2,u.length),[u.length,u[i],T.strip(u.substring(i+2)),t]}return[0]};var f={A:"author",B:"book",C:"composer",D:"discography",F:"url",G:"group",I:"instruction",N:"notes",O:"origin",R:"rhythm",S:"source",W:"unalignedWords",Z:"transcription"};this.parseHeader=function(u){var i=f[u[0]],t=u.length-2,a=r.translateString(r.stripComment(u.substring(2)));if(i==="unalignedWords"||i==="notes")l.addMetaTextArray(i,g.parseFontChangeLine(a),{startChar:c.iChar,endChar:c.iChar+u.length});else if(i!==void 0)l.addMetaText(i,g.parseFontChangeLine(a),{startChar:c.iChar,endChar:c.iChar+u.length});else{var e=c.iChar,h=e+u.length;switch(u[0]){case"H":for(l.addMetaTextArray("history",g.parseFontChangeLine(a),{startChar:c.iChar,endChar:c.iChar+u.length}),u=r.peekLine();u&&u[1]!==":";)r.nextLine(),l.addMetaTextArray("history",g.parseFontChangeLine(r.translateString(r.stripComment(u))),{startChar:c.iChar,endChar:c.iChar+u.length}),u=r.peekLine();break;case"K":this.resolveTempo();var v=p.parseKey(u.substring(2),!1);!c.is_in_header&&l.hasBeginMusic()&&c.keywarn!==!1&&(v.foundClef&&l.appendStartingElement("clef",e,h,c.clef),v.foundKey&&l.appendStartingElement("key",e,h,p.fixKey(c.clef,c.key))),c.is_in_header=!1;break;case"L":this.setDefaultLength(u,2,u.length);break;case"M":c.origMeter=c.meter=this.setMeter(u.substring(2));break;case"P":c.is_in_header?l.addMetaText("partOrder",g.parseFontChangeLine(a),{startChar:c.iChar,endChar:c.iChar+u.length}):c.partForNextLine={title:a,startChar:e,endChar:h};break;case"Q":var m=this.setTempo(u,2,u.length,c.iChar);m.type==="delaySet"?c.tempo=m.tempo:m.type==="immediate"&&(s.metaText.tempo?c.tempoForNextLine=["tempo",e,h,m.tempo]:s.metaText.tempo=m.tempo);break;case"T":c.titlecaps&&(a=a.toUpperCase()),this.setTitle(g.parseFontChangeLine(r.theReverser(a)),t);break;case"U":this.addUserDefinition(u,2,u.length);break;case"V":if(p.parseVoice(u,2,u.length),!c.is_in_header)return{newline:!0};break;case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":n("Ignored header",u,0);break;default:return{regular:!0}}}return{}}};return nt=o,nt}var Ce={},ea;function fs(){return ea||(ea=1,Ce.legalAccents=["trill","trillh","lowermordent","uppermordent","mordent","pralltriller","accent","fermata","invertedfermata","tenuto","0","1","2","3","4","5","+","wedge","open","thumb","snap","turn","roll","breath","shortphrase","mediumphrase","longphrase","segno","coda","D.S.","D.C.","fine","beambr1","beambr2","slide","marcato","upbow","downbow","/","//","///","////","trem1","trem2","trem3","trem4","turnx","invertedturn","invertedturnx","trill(","trill)","arpeggio","xstem","mark","umarcato","style=normal","style=harmonic","style=rhythm","style=x","style=triangle","D.C.alcoda","D.C.alfine","D.S.alcoda","D.S.alfine","editorial","courtesy"],Ce.volumeDecorations=["p","pp","f","ff","mf","mp","ppp","pppp","fff","ffff","sfz"],Ce.dynamicDecorations=["crescendo(","crescendo)","diminuendo(","diminuendo)","glissando(","glissando)","~(","~)"],Ce.accentPseudonyms=[["<","accent"],[">","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]],Ce.accentDynamicPseudonyms=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]],Ce.nonDecorations="ABCDEFGabcdefgxyzZ[]|^_{",Ce.durations=[.5,.75,.875,.9375,.96875,.984375,.25,.375,.4375,.46875,.484375,.4921875,.125,.1875,.21875,.234375,.2421875,.24609375,.0625,.09375,.109375,.1171875,.12109375,.123046875,.03125,.046875,.0546875,.05859375,.060546875,.0615234375,.015625,.0234375,.02734375,.029296875,.0302734375,.03076171875],Ce.pitches={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11},Ce.rests={x:"invisible",X:"invisible-multimeasure",y:"spacer",z:"rest",Z:"multimeasure"},Ce.accMap={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^",quarterflat:"_/",quartersharp:"^/"},Ce.tripletQ={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2}),Ce}var it,ta;function ps(){if(ta)return it;ta=1;var T=Lr(),g=Bi(),p,o,r,n,c,s,{legalAccents:l,volumeDecorations:d,dynamicDecorations:f,accentPseudonyms:u,accentDynamicPseudonyms:i,nonDecorations:t,durations:a,pitches:e,rests:h,accMap:v,tripletQ:m}=fs(),x=function(y,k,w,O,z,V){p=y,o=k,r=w,n=O,c=z,s=V,this.lineContinuation=!1},C=function(y,k,w){if(y.inTie[k]===void 0)return!1;var O=y.currentVoice?y.currentVoice.staffNum*100+y.currentVoice.index:0;return!!(y.inTie[k][O]&&(w.pitches!==void 0||w.rest.type!=="spacer"))},S={};x.prototype.parseMusic=function(y){s.resolveTempo(),r.is_in_header=!1;for(var k=0,w=r.iChar;p.isWhiteSpace(y[k])&&k<y.length;)k++;if(!(k===y.length||y[k]==="%")){var O=r.start_new_line;r.continueall===void 0?r.start_new_line=!0:r.start_new_line=!1;var z=0,V=s.letter_to_body_header(y,k);V[0]>0&&(k+=V[0],V[1]==="V"&&this.startNewLine());for(var I=0;k<y.length;){var K=k;if(y[k]==="%")break;var Q=s.letter_to_inline_header(y,k,O);if(Q[0]>0)k+=Q[0],Q[1]==="V"&&(O=!0);else{(!c.hasBeginMusic()||O&&!this.lineContinuation)&&(this.startNewLine(),O=!1);for(var G;;)if(G=p.eatWhiteSpace(y,k),G>0&&(k+=G),k>0&&y[k-1]===""&&(G=s.letter_to_body_header(y,k),G[0]>0&&(G[1]==="V"&&this.startNewLine(),k=G[0],r.start_new_line=!1)),G=P(y,k),G[0]>0&&(k+=G[0]),G=F(y,k),G[0]>0){S.chord||(S.chord=[]);var ee=p.translateString(G[1]);ee=ee.replace(/;/g,`
|
|
4
4
|
`);for(var te=!1,ne=0;ne<S.chord.length;ne++)S.chord[ne].position===G[2]&&(te=!0,S.chord[ne].name+=`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Q as e,s,am as o,f as i,an as d}from"./index-
|
|
1
|
+
import{Q as e,s,am as o,f as i,an as d}from"./index-CH486f5J.js";import{j as p}from"./treemap-KMMF4GRG-CkW25-tn-BQQfKVqt.js";import"./min-C2aDz5ZK-BLKawk6b.js";import"./_baseUniq-BPMphbq5-DxDS_DP8.js";var m={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},f={version:d.version+""},g=e(()=>f.version,"getVersion"),c={getVersion:g},v=e((r,a,n)=>{s.debug(`rendering info diagram
|
|
2
2
|
`+r);const t=o(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),x={draw:v},y={parser:m,db:c,renderer:x};export{y as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as ft,y as rt,g as gt,x as mt}from"./chunk-TZMSLE5B-G2jJHqli-
|
|
1
|
+
import{d as ft,y as rt,g as gt,x as mt}from"./chunk-TZMSLE5B-G2jJHqli-UJaOO59u.js";import{l as xt}from"./chunk-FMBD7UC4-DdcCR8w3-DW3gja5S.js";import{Q as s,p as kt,e as _t,h as bt,B as wt,E as $t,v as vt,k as V,w as X,f as St,F as Et}from"./index-CH486f5J.js";import{h as tt}from"./arc-D9rhTKV0-KnyPe3uY.js";var Q=function(){var t=s(function(y,i,a,u){for(a=a||{},u=y.length;u--;a[y[u]]=i);return a},"o"),e=[6,8,10,11,12,14,16,17,18],r=[1,9],l=[1,10],n=[1,11],c=[1,12],d=[1,13],h=[1,14],f={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(y,i,a,u,p,o,x){var k=o.length-1;switch(p){case 1:return o[k-1];case 2:this.$=[];break;case 3:o[k-1].push(o[k]),this.$=o[k-1];break;case 4:case 5:this.$=o[k];break;case 6:case 7:this.$=[];break;case 8:u.setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),u.setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),u.setAccDescription(this.$);break;case 12:u.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 13:u.addTask(o[k-1],o[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:l,14:n,16:c,17:d,18:h},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:l,14:n,16:c,17:d,18:h},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(y,i){if(i.recoverable)this.trace(y);else{var a=new Error(y);throw a.hash=i,a}},"parseError"),parse:s(function(y){var i=this,a=[0],u=[],p=[null],o=[],x=this.table,k="",T=0,A=0,ut=2,Z=1,pt=o.slice.call(arguments,1),_=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]);_.setInput(y,P.yy),P.yy.lexer=_,P.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var z=_.yylloc;o.push(z);var yt=_.options&&_.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function dt(w){a.length=a.length-2*w,p.length=p.length-w,o.length=o.length-w}s(dt,"popStack");function K(){var w;return w=u.pop()||_.lex()||Z,typeof w!="number"&&(w instanceof Array&&(u=w,w=u.pop()),w=i.symbols_[w]||w),w}s(K,"lex");for(var b,I,$,W,j={},D,E,H,O;;){if(I=a[a.length-1],this.defaultActions[I]?$=this.defaultActions[I]:((b===null||typeof b>"u")&&(b=K()),$=x[I]&&x[I][b]),typeof $>"u"||!$.length||!$[0]){var G="";O=[];for(D in x[I])this.terminals_[D]&&D>ut&&O.push("'"+this.terminals_[D]+"'");_.showPosition?G="Parse error on line "+(T+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
3
|
Expecting `+O.join(", ")+", got '"+(this.terminals_[b]||b)+"'":G="Parse error on line "+(T+1)+": Unexpected "+(b==Z?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(G,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:z,expected:O})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+b);switch($[0]){case 1:a.push(b),p.push(_.yytext),o.push(_.yylloc),a.push($[1]),b=null,A=_.yyleng,k=_.yytext,T=_.yylineno,z=_.yylloc;break;case 2:if(E=this.productions_[$[1]][1],j.$=p[p.length-E],j._$={first_line:o[o.length-(E||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(E||1)].first_column,last_column:o[o.length-1].last_column},yt&&(j._$.range=[o[o.length-(E||1)].range[0],o[o.length-1].range[1]]),W=this.performAction.apply(j,[k,A,T,P.yy,$[1],p,o].concat(pt)),typeof W<"u")return W;E&&(a=a.slice(0,-1*E*2),p=p.slice(0,-1*E),o=o.slice(0,-1*E)),a.push(this.productions_[$[1]][0]),p.push(j.$),o.push(j._$),H=x[a[a.length-2]][a[a.length-1]],a.push(H);break;case 3:return!0}}return!0},"parse")},m=function(){var y={EOF:1,parseError:s(function(i,a){if(this.yy.parser)this.yy.parser.parseError(i,a);else throw new Error(i)},"parseError"),setInput:s(function(i,a){return this.yy=a||this.yy||{},this._input=i,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:s(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:s(function(i){var a=i.length,u=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var p=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),u.length-1&&(this.yylineno-=u.length-1);var o=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:u?(u.length===p.length?this.yylloc.first_column:0)+p[p.length-u.length].length-u[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[o[0],o[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(i){this.unput(this.match.slice(i))},"less"),pastInput:s(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Q as a,s as ee,k as F,am as pe,t as ye,b as fe,c as me,aX as be,T as V,Y as G,M as _e,x as Ee,aY as Se,aZ as ae,a_ as le}from"./index-
|
|
1
|
+
import{Q as a,s as ee,k as F,am as pe,t as ye,b as fe,c as me,aX as be,T as V,Y as G,M as _e,x as Ee,aY as Se,aZ as ae,a_ as le}from"./index-CH486f5J.js";import{l as ke}from"./chunk-FMBD7UC4-DdcCR8w3-DW3gja5S.js";var J=function(){var i=a(function(k,e,n,r){for(n=n||{},r=k.length;r--;n[k[r]]=e);return n},"o"),u=[1,4],d=[1,13],s=[1,12],g=[1,15],D=[1,16],S=[1,20],h=[1,19],O=[6,7,8],b=[1,26],_=[1,24],C=[1,25],o=[6,7,11],j=[1,31],I=[6,7,11,24],T=[1,6,13,16,17,20,23],$=[1,35],H=[1,36],w=[1,6,7,11,13,16,17,20,23],M=[1,38],y={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:a(function(k,e,n,r,c,t,m){var l=t.length-1;switch(c){case 6:case 7:return r;case 8:r.getLogger().trace("Stop NL ");break;case 9:r.getLogger().trace("Stop EOF ");break;case 11:r.getLogger().trace("Stop NL2 ");break;case 12:r.getLogger().trace("Stop EOF2 ");break;case 15:r.getLogger().info("Node: ",t[l-1].id),r.addNode(t[l-2].length,t[l-1].id,t[l-1].descr,t[l-1].type,t[l]);break;case 16:r.getLogger().info("Node: ",t[l].id),r.addNode(t[l-1].length,t[l].id,t[l].descr,t[l].type);break;case 17:r.getLogger().trace("Icon: ",t[l]),r.decorateNode({icon:t[l]});break;case 18:case 23:r.decorateNode({class:t[l]});break;case 19:r.getLogger().trace("SPACELIST");break;case 20:r.getLogger().trace("Node: ",t[l-1].id),r.addNode(0,t[l-1].id,t[l-1].descr,t[l-1].type,t[l]);break;case 21:r.getLogger().trace("Node: ",t[l].id),r.addNode(0,t[l].id,t[l].descr,t[l].type);break;case 22:r.decorateNode({icon:t[l]});break;case 27:r.getLogger().trace("node found ..",t[l-2]),this.$={id:t[l-1],descr:t[l-1],type:r.getType(t[l-2],t[l])};break;case 28:this.$={id:t[l],descr:t[l],type:0};break;case 29:r.getLogger().trace("node found ..",t[l-3]),this.$={id:t[l-3],descr:t[l-1],type:r.getType(t[l-2],t[l])};break;case 30:this.$=t[l-1]+t[l];break;case 31:this.$=t[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:u},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:u},{6:d,7:[1,10],9:9,12:11,13:s,14:14,16:g,17:D,18:17,19:18,20:S,23:h},i(O,[2,3]),{1:[2,2]},i(O,[2,4]),i(O,[2,5]),{1:[2,6],6:d,12:21,13:s,14:14,16:g,17:D,18:17,19:18,20:S,23:h},{6:d,9:22,12:11,13:s,14:14,16:g,17:D,18:17,19:18,20:S,23:h},{6:b,7:_,10:23,11:C},i(o,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:S,23:h}),i(o,[2,19]),i(o,[2,21],{15:30,24:j}),i(o,[2,22]),i(o,[2,23]),i(I,[2,25]),i(I,[2,26]),i(I,[2,28],{20:[1,32]}),{21:[1,33]},{6:b,7:_,10:34,11:C},{1:[2,7],6:d,12:21,13:s,14:14,16:g,17:D,18:17,19:18,20:S,23:h},i(T,[2,14],{7:$,11:H}),i(w,[2,8]),i(w,[2,9]),i(w,[2,10]),i(o,[2,16],{15:37,24:j}),i(o,[2,17]),i(o,[2,18]),i(o,[2,20],{24:M}),i(I,[2,31]),{21:[1,39]},{22:[1,40]},i(T,[2,13],{7:$,11:H}),i(w,[2,11]),i(w,[2,12]),i(o,[2,15],{24:M}),i(I,[2,30]),{22:[1,41]},i(I,[2,27]),i(I,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:a(function(k,e){if(e.recoverable)this.trace(k);else{var n=new Error(k);throw n.hash=e,n}},"parseError"),parse:a(function(k){var e=this,n=[0],r=[],c=[null],t=[],m=this.table,l="",W=0,ne=0,he=2,se=1,ue=t.slice.call(arguments,1),f=Object.create(this.lexer),P={yy:{}};for(var X in this.yy)Object.prototype.hasOwnProperty.call(this.yy,X)&&(P.yy[X]=this.yy[X]);f.setInput(k,P.yy),P.yy.lexer=f,P.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var q=f.yylloc;t.push(q);var ge=f.options&&f.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function de(N){n.length=n.length-2*N,c.length=c.length-N,t.length=t.length-N}a(de,"popStack");function re(){var N;return N=r.pop()||f.lex()||se,typeof N!="number"&&(N instanceof Array&&(r=N,N=r.pop()),N=e.symbols_[N]||N),N}a(re,"lex");for(var E,B,x,Q,U={},z,A,oe,K;;){if(B=n[n.length-1],this.defaultActions[B]?x=this.defaultActions[B]:((E===null||typeof E>"u")&&(E=re()),x=m[B]&&m[B][E]),typeof x>"u"||!x.length||!x[0]){var Y="";K=[];for(z in m[B])this.terminals_[z]&&z>he&&K.push("'"+this.terminals_[z]+"'");f.showPosition?Y="Parse error on line "+(W+1)+`:
|
|
2
2
|
`+f.showPosition()+`
|
|
3
3
|
Expecting `+K.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Y="Parse error on line "+(W+1)+": Unexpected "+(E==se?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Y,{text:f.match,token:this.terminals_[E]||E,line:f.yylineno,loc:q,expected:K})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+E);switch(x[0]){case 1:n.push(E),c.push(f.yytext),t.push(f.yylloc),n.push(x[1]),E=null,ne=f.yyleng,l=f.yytext,W=f.yylineno,q=f.yylloc;break;case 2:if(A=this.productions_[x[1]][1],U.$=c[c.length-A],U._$={first_line:t[t.length-(A||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(A||1)].first_column,last_column:t[t.length-1].last_column},ge&&(U._$.range=[t[t.length-(A||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(U,[l,ne,W,P.yy,x[1],c,t].concat(ue)),typeof Q<"u")return Q;A&&(n=n.slice(0,-1*A*2),c=c.slice(0,-1*A),t=t.slice(0,-1*A)),n.push(this.productions_[x[1]][0]),c.push(U.$),t.push(U._$),oe=m[n[n.length-2]][n[n.length-1]],n.push(oe);break;case 3:return!0}}return!0},"parse")},R=function(){var k={EOF:1,parseError:a(function(e,n){if(this.yy.parser)this.yy.parser.parseError(e,n);else throw new Error(e)},"parseError"),setInput:a(function(e,n){return this.yy=n||this.yy||{},this._input=e,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:a(function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var n=e.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:a(function(e){var n=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var c=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),r.length-1&&(this.yylineno-=r.length-1);var t=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:r?(r.length===c.length?this.yylloc.first_column:0)+c[c.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[t[0],t[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(e){this.unput(this.match.slice(e))},"less"),pastInput:a(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var e=this.pastInput(),n=new Array(e.length+1).join("-");return e+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as b,A as k,_ as m,O as An}from"./graph-BpcfrHXY-BxLMpmgE.js";import{B as Vn,q as f,v as q,n as ln,a as j,$ as pn,G as Yn,Y as F,T as zn,Z as R,F as wn,j as mn,x as Q,I as Dn,M as Qn,b as Zn,c as Hn}from"./_baseUniq-BPMphbq5-Bc3mfrWu.js";import{L as O,v as Jn,k as I,M as p,A as bn,x as Kn}from"./min-C2aDz5ZK-LEKv4vLP.js";import{aE as yn,aF as L,aG as xn,aH as Un,aI as Z,aJ as Xn,aK as Wn,aL as kn,aM as En,aN as nr,aO as rr,aP as tr,aQ as $,aR as er,aS as On,aT as or,aU as ir}from"./index-Cat4tDb5.js";var ar=/\s/;function ur(n){for(var r=n.length;r--&&ar.test(n.charAt(r)););return r}var cr=/^\s+/;function dr(n){return n&&n.slice(0,ur(n)+1).replace(cr,"")}var tn=NaN,fr=/^[-+]0x[0-9a-f]+$/i,sr=/^0b[01]+$/i,hr=/^0o[0-7]+$/i,vr=parseInt;function gr(n){if(typeof n=="number")return n;if(Q(n))return tn;if($(n)){var r=typeof n.valueOf=="function"?n.valueOf():n;n=$(r)?r+"":r}if(typeof n!="string")return n===0?n:+n;n=dr(n);var t=sr.test(n);return t||hr.test(n)?vr(n.slice(2),t?2:8):fr.test(n)?tn:+n}var en=1/0,lr=17976931348623157e292;function M(n){if(!n)return n===0?n:0;if(n=gr(n),n===en||n===-en){var r=n<0?-1:1;return r*lr}return n===n?n:0}function pr(n){var r=M(n),t=r%1;return r===r?t?r-t:r:0}function wr(n){return Xn(Wn(n,void 0,O),n+"")}var mr=1,br=4;function yr(n){return An(n,mr|br)}var Nn=Object.prototype,xr=Nn.hasOwnProperty,kr=yn(function(n,r){n=Object(n);var t=-1,e=r.length,o=e>2?r[2]:void 0;for(o&&L(r[0],r[1],o)&&(e=1);++t<e;)for(var a=r[t],i=xn(a),u=-1,c=i.length;++u<c;){var d=i[u],s=n[d];(s===void 0||Un(s,Nn[d])&&!xr.call(n,d))&&(n[d]=a[d])}return n});function C(n){var r=n==null?0:n.length;return r?n[r-1]:void 0}function Er(n){return function(r,t,e){var o=Object(r);if(!or(r)){var a=j(t);r=Qn(r),t=function(u){return a(o[u],u,o)}}var i=n(r,t,e);return i>-1?o[a?r[i]:i]:void 0}}var Or=Math.max;function Nr(n,r,t){var e=n==null?0:n.length;if(!e)return-1;var o=t==null?0:pr(t);return o<0&&(o=Or(e+o,0)),Hn(n,j(r),o)}var J=Er(Nr);function _r(n,r){return n==null?n:ir(n,wn(r),xn)}function Ir(n,r){return n&&pn(n,wn(r))}function Pr(n,r){return n>r}var jr=Object.prototype,Rr=jr.hasOwnProperty;function Tr(n,r){return n!=null&&Rr.call(n,r)}function _n(n,r){return n!=null&&zn(n,r,Tr)}function G(n,r){var t={};return r=j(r),pn(n,function(e,o,a){rr(t,o,r(e,o,a))}),t}function y(n){return n&&n.length?bn(n,En,Pr):void 0}function K(n,r){return n&&n.length?bn(n,j(r),Kn):void 0}function Mr(n,r,t,e){if(!$(n))return n;r=mn(r,n);for(var o=-1,a=r.length,i=a-1,u=n;u!=null&&++o<a;){var c=Dn(r[o]),d=t;if(c==="__proto__"||c==="constructor"||c==="prototype")return n;if(o!=i){var s=u[c];d=void 0,d===void 0&&(d=$(s)?s:er(r[o+1])?[]:{})}On(u,c,d),u=u[c]}return n}function Lr(n,r,t){for(var e=-1,o=r.length,a={};++e<o;){var i=r[e],u=ln(n,i);t(u,i)&&Mr(a,mn(i,n),u)}return a}function $r(n,r){var t=n.length;for(n.sort(r);t--;)n[t]=n[t].value;return n}function Cr(n,r){if(n!==r){var t=n!==void 0,e=n===null,o=n===n,a=Q(n),i=r!==void 0,u=r===null,c=r===r,d=Q(r);if(!u&&!d&&!a&&n>r||a&&i&&c&&!u&&!d||e&&i&&c||!t&&c||!o)return 1;if(!e&&!a&&!d&&n<r||d&&t&&o&&!e&&!a||u&&t&&o||!i&&o||!c)return-1}return 0}function Sr(n,r,t){for(var e=-1,o=n.criteria,a=r.criteria,i=o.length,u=t.length;++e<i;){var c=Cr(o[e],a[e]);if(c){if(e>=u)return c;var d=t[e];return c*(d=="desc"?-1:1)}}return n.index-r.index}function Fr(n,r,t){r.length?r=q(r,function(a){return kn(a)?function(i){return ln(i,a.length===1?a[0]:a)}:a}):r=[En];var e=-1;r=q(r,nr(j));var o=Jn(n,function(a,i,u){var c=q(r,function(d){return d(a)});return{criteria:c,index:++e,value:a}});return $r(o,function(a,i){return Sr(a,i,t)})}function Gr(n,r){return Lr(n,r,function(t,e){return Zn(n,e)})}var S=wr(function(n,r){return n==null?{}:Gr(n,r)}),Br=Math.ceil,qr=Math.max;function Ar(n,r,t,e){for(var o=-1,a=qr(Br((r-n)/(t||1)),0),i=Array(a);a--;)i[++o]=n,n+=t;return i}function Vr(n){return function(r,t,e){return e&&typeof e!="number"&&L(r,t,e)&&(t=e=void 0),r=M(r),t===void 0?(t=r,r=0):t=M(t),e=e===void 0?r<t?1:-1:M(e),Ar(r,t,e)}}var E=Vr(),T=yn(function(n,r){if(n==null)return[];var t=r.length;return t>1&&L(n,r[0],r[1])?r=[]:t>2&&L(r[0],r[1],r[2])&&(r=[r[0]]),Fr(n,Vn(r),[])}),Yr=0;function U(n){var r=++Yr;return Yn(n)+r}function zr(n,r,t){for(var e=-1,o=n.length,a=r.length,i={};++e<o;){var u=e<a?r[e]:void 0;t(i,n[e],u)}return i}function Dr(n,r){return zr(n||[],r||[],On)}class Qr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,t=r._prev;if(t!==r)return on(t),t}enqueue(r){var t=this._sentinel;r._prev&&r._next&&on(r),r._next=t._next,t._next._prev=r,t._next=r,r._prev=t}toString(){for(var r=[],t=this._sentinel,e=t._prev;e!==t;)r.push(JSON.stringify(e,Zr)),e=e._prev;return"["+r.join(", ")+"]"}}function on(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function Zr(n,r){if(n!=="_next"&&n!=="_prev")return r}var Hr=tr(1);function Jr(n,r){if(n.nodeCount()<=1)return[];var t=Ur(n,r||Hr),e=Kr(t.graph,t.buckets,t.zeroIdx);return O(p(e,function(o){return n.outEdges(o.v,o.w)}))}function Kr(n,r,t){for(var e=[],o=r[r.length-1],a=r[0],i;n.nodeCount();){for(;i=a.dequeue();)A(n,r,t,i);for(;i=o.dequeue();)A(n,r,t,i);if(n.nodeCount()){for(var u=r.length-2;u>0;--u)if(i=r[u].dequeue(),i){e=e.concat(A(n,r,t,i,!0));break}}}return e}function A(n,r,t,e,o){var a=o?[]:void 0;return f(n.inEdges(e.v),function(i){var u=n.edge(i),c=n.node(i.v);o&&a.push({v:i.v,w:i.w}),c.out-=u,H(r,t,c)}),f(n.outEdges(e.v),function(i){var u=n.edge(i),c=i.w,d=n.node(c);d.in-=u,H(r,t,d)}),n.removeNode(e.v),a}function Ur(n,r){var t=new b,e=0,o=0;f(n.nodes(),function(u){t.setNode(u,{v:u,in:0,out:0})}),f(n.edges(),function(u){var c=t.edge(u.v,u.w)||0,d=r(u),s=c+d;t.setEdge(u.v,u.w,s),o=Math.max(o,t.node(u.v).out+=d),e=Math.max(e,t.node(u.w).in+=d)});var a=E(o+e+3).map(function(){return new Qr}),i=e+1;return f(t.nodes(),function(u){H(a,i,t.node(u))}),{graph:t,buckets:a,zeroIdx:i}}function H(n,r,t){t.out?t.in?n[t.out-t.in+r].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}function Xr(n){var r=n.graph().acyclicer==="greedy"?Jr(n,t(n)):Wr(n);f(r,function(e){var o=n.edge(e);n.removeEdge(e),o.forwardName=e.name,o.reversed=!0,n.setEdge(e.w,e.v,o,U("rev"))});function t(e){return function(o){return e.edge(o).weight}}}function Wr(n){var r=[],t={},e={};function o(a){Object.prototype.hasOwnProperty.call(e,a)||(e[a]=!0,t[a]=!0,f(n.outEdges(a),function(i){Object.prototype.hasOwnProperty.call(t,i.w)?r.push(i):o(i.w)}),delete t[a])}return f(n.nodes(),o),r}function nt(n){f(n.edges(),function(r){var t=n.edge(r);if(t.reversed){n.removeEdge(r);var e=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(r.w,r.v,t,e)}})}function N(n,r,t,e){var o;do o=U(e);while(n.hasNode(o));return t.dummy=r,n.setNode(o,t),o}function rt(n){var r=new b().setGraph(n.graph());return f(n.nodes(),function(t){r.setNode(t,n.node(t))}),f(n.edges(),function(t){var e=r.edge(t.v,t.w)||{weight:0,minlen:1},o=n.edge(t);r.setEdge(t.v,t.w,{weight:e.weight+o.weight,minlen:Math.max(e.minlen,o.minlen)})}),r}function In(n){var r=new b({multigraph:n.isMultigraph()}).setGraph(n.graph());return f(n.nodes(),function(t){n.children(t).length||r.setNode(t,n.node(t))}),f(n.edges(),function(t){r.setEdge(t,n.edge(t))}),r}function an(n,r){var t=n.x,e=n.y,o=r.x-t,a=r.y-e,i=n.width/2,u=n.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var c,d;return Math.abs(a)*i>Math.abs(o)*u?(a<0&&(u=-u),c=u*o/a,d=u):(o<0&&(i=-i),c=i,d=i*a/o),{x:t+c,y:e+d}}function B(n){var r=p(E(Pn(n)+1),function(){return[]});return f(n.nodes(),function(t){var e=n.node(t),o=e.rank;m(o)||(r[o][e.order]=t)}),r}function tt(n){var r=I(p(n.nodes(),function(t){return n.node(t).rank}));f(n.nodes(),function(t){var e=n.node(t);_n(e,"rank")&&(e.rank-=r)})}function et(n){var r=I(p(n.nodes(),function(a){return n.node(a).rank})),t=[];f(n.nodes(),function(a){var i=n.node(a).rank-r;t[i]||(t[i]=[]),t[i].push(a)});var e=0,o=n.graph().nodeRankFactor;f(t,function(a,i){m(a)&&i%o!==0?--e:e&&f(a,function(u){n.node(u).rank+=e})})}function un(n,r,t,e){var o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=e),N(n,"border",o,r)}function Pn(n){return y(p(n.nodes(),function(r){var t=n.node(r).rank;if(!m(t))return t}))}function ot(n,r){var t={lhs:[],rhs:[]};return f(n,function(e){r(e)?t.lhs.push(e):t.rhs.push(e)}),t}function it(n,r){return r()}function at(n){function r(t){var e=n.children(t),o=n.node(t);if(e.length&&f(e,r),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,i=o.maxRank+1;a<i;++a)cn(n,"borderLeft","_bl",t,o,a),cn(n,"borderRight","_br",t,o,a)}}f(n.children(),r)}function cn(n,r,t,e,o,a){var i={width:0,height:0,rank:a,borderType:r},u=o[r][a-1],c=N(n,"border",i,t);o[r][a]=c,n.setParent(c,e),u&&n.setEdge(u,c,{weight:1})}function ut(n){var r=n.graph().rankdir.toLowerCase();(r==="lr"||r==="rl")&&jn(n)}function ct(n){var r=n.graph().rankdir.toLowerCase();(r==="bt"||r==="rl")&&dt(n),(r==="lr"||r==="rl")&&(ft(n),jn(n))}function jn(n){f(n.nodes(),function(r){dn(n.node(r))}),f(n.edges(),function(r){dn(n.edge(r))})}function dn(n){var r=n.width;n.width=n.height,n.height=r}function dt(n){f(n.nodes(),function(r){V(n.node(r))}),f(n.edges(),function(r){var t=n.edge(r);f(t.points,V),Object.prototype.hasOwnProperty.call(t,"y")&&V(t)})}function V(n){n.y=-n.y}function ft(n){f(n.nodes(),function(r){Y(n.node(r))}),f(n.edges(),function(r){var t=n.edge(r);f(t.points,Y),Object.prototype.hasOwnProperty.call(t,"x")&&Y(t)})}function Y(n){var r=n.x;n.x=n.y,n.y=r}function st(n){n.graph().dummyChains=[],f(n.edges(),function(r){ht(n,r)})}function ht(n,r){var t=r.v,e=n.node(t).rank,o=r.w,a=n.node(o).rank,i=r.name,u=n.edge(r),c=u.labelRank;if(a!==e+1){n.removeEdge(r);var d=void 0,s,h;for(h=0,++e;e<a;++h,++e)u.points=[],d={width:0,height:0,edgeLabel:u,edgeObj:r,rank:e},s=N(n,"edge",d,"_d"),e===c&&(d.width=u.width,d.height=u.height,d.dummy="edge-label",d.labelpos=u.labelpos),n.setEdge(t,s,{weight:u.weight},i),h===0&&n.graph().dummyChains.push(s),t=s;n.setEdge(t,o,{weight:u.weight},i)}}function vt(n){f(n.graph().dummyChains,function(r){var t=n.node(r),e=t.edgeLabel,o;for(n.setEdge(t.edgeObj,e);t.dummy;)o=n.successors(r)[0],n.removeNode(r),e.points.push({x:t.x,y:t.y}),t.dummy==="edge-label"&&(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height),r=o,t=n.node(r)})}function X(n){var r={};function t(e){var o=n.node(e);if(Object.prototype.hasOwnProperty.call(r,e))return o.rank;r[e]=!0;var a=I(p(n.outEdges(e),function(i){return t(i.w)-n.edge(i).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),o.rank=a}f(n.sources(),t)}function P(n,r){return n.node(r.w).rank-n.node(r.v).rank-n.edge(r).minlen}function Rn(n){var r=new b({directed:!1}),t=n.nodes()[0],e=n.nodeCount();r.setNode(t,{});for(var o,a;gt(r,n)<e;)o=lt(r,n),a=r.hasNode(o.v)?P(n,o):-P(n,o),pt(r,n,a);return r}function gt(n,r){function t(e){f(r.nodeEdges(e),function(o){var a=o.v,i=e===a?o.w:a;!n.hasNode(i)&&!P(r,o)&&(n.setNode(i,{}),n.setEdge(e,i,{}),t(i))})}return f(n.nodes(),t),n.nodeCount()}function lt(n,r){return K(r.edges(),function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return P(r,t)})}function pt(n,r,t){f(n.nodes(),function(e){r.node(e).rank+=t})}function Tn(n,r,t){kn(r)||(r=[r]);var e=(n.isDirected()?n.successors:n.neighbors).bind(n),o=[],a={};return f(r,function(i){if(!n.hasNode(i))throw new Error("Graph does not have node: "+i);Mn(n,i,t==="post",a,e,o)}),o}function Mn(n,r,t,e,o,a){Object.prototype.hasOwnProperty.call(e,r)||(e[r]=!0,t||a.push(r),f(o(r),function(i){Mn(n,i,t,e,o,a)}),t&&a.push(r))}function wt(n,r){return Tn(n,r,"post")}function mt(n,r){return Tn(n,r,"pre")}x.initLowLimValues=nn;x.initCutValues=W;x.calcCutValue=Ln;x.leaveEdge=Cn;x.enterEdge=Sn;x.exchangeEdges=Fn;function x(n){n=rt(n),X(n);var r=Rn(n);nn(r),W(r,n);for(var t,e;t=Cn(r);)e=Sn(r,n,t),Fn(r,n,t,e)}function W(n,r){var t=wt(n,n.nodes());t=t.slice(0,t.length-1),f(t,function(e){bt(n,r,e)})}function bt(n,r,t){var e=n.node(t),o=e.parent;n.edge(t,o).cutvalue=Ln(n,r,t)}function Ln(n,r,t){var e=n.node(t),o=e.parent,a=!0,i=r.edge(t,o),u=0;return i||(a=!1,i=r.edge(o,t)),u=i.weight,f(r.nodeEdges(t),function(c){var d=c.v===t,s=d?c.w:c.v;if(s!==o){var h=d===a,v=r.edge(c).weight;if(u+=h?v:-v,xt(n,t,s)){var g=n.edge(t,s).cutvalue;u+=h?-g:g}}}),u}function nn(n,r){arguments.length<2&&(r=n.nodes()[0]),$n(n,{},1,r)}function $n(n,r,t,e,o){var a=t,i=n.node(e);return r[e]=!0,f(n.neighbors(e),function(u){Object.prototype.hasOwnProperty.call(r,u)||(t=$n(n,r,t,u,e))}),i.low=a,i.lim=t++,o?i.parent=o:delete i.parent,t}function Cn(n){return J(n.edges(),function(r){return n.edge(r).cutvalue<0})}function Sn(n,r,t){var e=t.v,o=t.w;r.hasEdge(e,o)||(e=t.w,o=t.v);var a=n.node(e),i=n.node(o),u=a,c=!1;a.lim>i.lim&&(u=i,c=!0);var d=R(r.edges(),function(s){return c===fn(n,n.node(s.v),u)&&c!==fn(n,n.node(s.w),u)});return K(d,function(s){return P(r,s)})}function Fn(n,r,t,e){var o=t.v,a=t.w;n.removeEdge(o,a),n.setEdge(e.v,e.w,{}),nn(n),W(n,r),yt(n,r)}function yt(n,r){var t=J(n.nodes(),function(o){return!r.node(o).parent}),e=mt(n,t);e=e.slice(1),f(e,function(o){var a=n.node(o).parent,i=r.edge(o,a),u=!1;i||(i=r.edge(a,o),u=!0),r.node(o).rank=r.node(a).rank+(u?i.minlen:-i.minlen)})}function xt(n,r,t){return n.hasEdge(r,t)}function fn(n,r,t){return t.low<=r.lim&&r.lim<=t.lim}function kt(n){switch(n.graph().ranker){case"network-simplex":sn(n);break;case"tight-tree":Ot(n);break;case"longest-path":Et(n);break;default:sn(n)}}var Et=X;function Ot(n){X(n),Rn(n)}function sn(n){x(n)}function Nt(n){var r=N(n,"root",{},"_root"),t=_t(n),e=y(k(t))-1,o=2*e+1;n.graph().nestingRoot=r,f(n.edges(),function(i){n.edge(i).minlen*=o});var a=It(n)+1;f(n.children(),function(i){Gn(n,r,o,a,e,t,i)}),n.graph().nodeRankFactor=o}function Gn(n,r,t,e,o,a,i){var u=n.children(i);if(!u.length){i!==r&&n.setEdge(r,i,{weight:0,minlen:t});return}var c=un(n,"_bt"),d=un(n,"_bb"),s=n.node(i);n.setParent(c,i),s.borderTop=c,n.setParent(d,i),s.borderBottom=d,f(u,function(h){Gn(n,r,t,e,o,a,h);var v=n.node(h),g=v.borderTop?v.borderTop:h,l=v.borderBottom?v.borderBottom:h,w=v.borderTop?e:2*e,_=g!==l?1:o-a[i]+1;n.setEdge(c,g,{weight:w,minlen:_,nestingEdge:!0}),n.setEdge(l,d,{weight:w,minlen:_,nestingEdge:!0})}),n.parent(i)||n.setEdge(r,c,{weight:0,minlen:o+a[i]})}function _t(n){var r={};function t(e,o){var a=n.children(e);a&&a.length&&f(a,function(i){t(i,o+1)}),r[e]=o}return f(n.children(),function(e){t(e,1)}),r}function It(n){return F(n.edges(),function(r,t){return r+n.edge(t).weight},0)}function Pt(n){var r=n.graph();n.removeNode(r.nestingRoot),delete r.nestingRoot,f(n.edges(),function(t){var e=n.edge(t);e.nestingEdge&&n.removeEdge(t)})}function jt(n,r,t){var e={},o;f(t,function(a){for(var i=n.parent(a),u,c;i;){if(u=n.parent(i),u?(c=e[u],e[u]=i):(c=o,o=i),c&&c!==i){r.setEdge(c,i);return}i=u}})}function Rt(n,r,t){var e=Tt(n),o=new b({compound:!0}).setGraph({root:e}).setDefaultNodeLabel(function(a){return n.node(a)});return f(n.nodes(),function(a){var i=n.node(a),u=n.parent(a);(i.rank===r||i.minRank<=r&&r<=i.maxRank)&&(o.setNode(a),o.setParent(a,u||e),f(n[t](a),function(c){var d=c.v===a?c.w:c.v,s=o.edge(d,a),h=m(s)?0:s.weight;o.setEdge(d,a,{weight:n.edge(c).weight+h})}),Object.prototype.hasOwnProperty.call(i,"minRank")&&o.setNode(a,{borderLeft:i.borderLeft[r],borderRight:i.borderRight[r]}))}),o}function Tt(n){for(var r;n.hasNode(r=U("_root")););return r}function Mt(n,r){for(var t=0,e=1;e<r.length;++e)t+=Lt(n,r[e-1],r[e]);return t}function Lt(n,r,t){for(var e=Dr(t,p(t,function(d,s){return s})),o=O(p(r,function(d){return T(p(n.outEdges(d),function(s){return{pos:e[s.w],weight:n.edge(s).weight}}),"pos")})),a=1;a<t.length;)a<<=1;var i=2*a-1;a-=1;var u=p(new Array(i),function(){return 0}),c=0;return f(o.forEach(function(d){var s=d.pos+a;u[s]+=d.weight;for(var h=0;s>0;)s%2&&(h+=u[s+1]),s=s-1>>1,u[s]+=d.weight;c+=d.weight*h})),c}function $t(n){var r={},t=R(n.nodes(),function(u){return!n.children(u).length}),e=y(p(t,function(u){return n.node(u).rank})),o=p(E(e+1),function(){return[]});function a(u){if(!_n(r,u)){r[u]=!0;var c=n.node(u);o[c.rank].push(u),f(n.successors(u),a)}}var i=T(t,function(u){return n.node(u).rank});return f(i,a),o}function Ct(n,r){return p(r,function(t){var e=n.inEdges(t);if(e.length){var o=F(e,function(a,i){var u=n.edge(i),c=n.node(i.v);return{sum:a.sum+u.weight*c.order,weight:a.weight+u.weight}},{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:t}})}function St(n,r){var t={};f(n,function(o,a){var i=t[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:a};m(o.barycenter)||(i.barycenter=o.barycenter,i.weight=o.weight)}),f(r.edges(),function(o){var a=t[o.v],i=t[o.w];!m(a)&&!m(i)&&(i.indegree++,a.out.push(t[o.w]))});var e=R(t,function(o){return!o.indegree});return Ft(e)}function Ft(n){var r=[];function t(a){return function(i){i.merged||(m(i.barycenter)||m(a.barycenter)||i.barycenter>=a.barycenter)&&Gt(a,i)}}function e(a){return function(i){i.in.push(a),--i.indegree===0&&n.push(i)}}for(;n.length;){var o=n.pop();r.push(o),f(o.in.reverse(),t(o)),f(o.out,e(o))}return p(R(r,function(a){return!a.merged}),function(a){return S(a,["vs","i","barycenter","weight"])})}function Gt(n,r){var t=0,e=0;n.weight&&(t+=n.barycenter*n.weight,e+=n.weight),r.weight&&(t+=r.barycenter*r.weight,e+=r.weight),n.vs=r.vs.concat(n.vs),n.barycenter=t/e,n.weight=e,n.i=Math.min(r.i,n.i),r.merged=!0}function Bt(n,r){var t=ot(n,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),e=t.lhs,o=T(t.rhs,function(s){return-s.i}),a=[],i=0,u=0,c=0;e.sort(qt(!!r)),c=hn(a,o,c),f(e,function(s){c+=s.vs.length,a.push(s.vs),i+=s.barycenter*s.weight,u+=s.weight,c=hn(a,o,c)});var d={vs:O(a)};return u&&(d.barycenter=i/u,d.weight=u),d}function hn(n,r,t){for(var e;r.length&&(e=C(r)).i<=t;)r.pop(),n.push(e.vs),t++;return t}function qt(n){return function(r,t){return r.barycenter<t.barycenter?-1:r.barycenter>t.barycenter?1:n?t.i-r.i:r.i-t.i}}function Bn(n,r,t,e){var o=n.children(r),a=n.node(r),i=a?a.borderLeft:void 0,u=a?a.borderRight:void 0,c={};i&&(o=R(o,function(l){return l!==i&&l!==u}));var d=Ct(n,o);f(d,function(l){if(n.children(l.v).length){var w=Bn(n,l.v,t,e);c[l.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&Vt(l,w)}});var s=St(d,t);At(s,c);var h=Bt(s,e);if(i&&(h.vs=O([i,h.vs,u]),n.predecessors(i).length)){var v=n.node(n.predecessors(i)[0]),g=n.node(n.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+v.order+g.order)/(h.weight+2),h.weight+=2}return h}function At(n,r){f(n,function(t){t.vs=O(t.vs.map(function(e){return r[e]?r[e].vs:e}))})}function Vt(n,r){m(n.barycenter)?(n.barycenter=r.barycenter,n.weight=r.weight):(n.barycenter=(n.barycenter*n.weight+r.barycenter*r.weight)/(n.weight+r.weight),n.weight+=r.weight)}function Yt(n){var r=Pn(n),t=vn(n,E(1,r+1),"inEdges"),e=vn(n,E(r-1,-1,-1),"outEdges"),o=$t(n);gn(n,o);for(var a=Number.POSITIVE_INFINITY,i,u=0,c=0;c<4;++u,++c){zt(u%2?t:e,u%4>=2),o=B(n);var d=Mt(n,o);d<a&&(c=0,i=yr(o),a=d)}gn(n,i)}function vn(n,r,t){return p(r,function(e){return Rt(n,e,t)})}function zt(n,r){var t=new b;f(n,function(e){var o=e.graph().root,a=Bn(e,o,t,r);f(a.vs,function(i,u){e.node(i).order=u}),jt(e,t,a.vs)})}function gn(n,r){f(r,function(t){f(t,function(e,o){n.node(e).order=o})})}function Dt(n){var r=Zt(n);f(n.graph().dummyChains,function(t){for(var e=n.node(t),o=e.edgeObj,a=Qt(n,r,o.v,o.w),i=a.path,u=a.lca,c=0,d=i[c],s=!0;t!==o.w;){if(e=n.node(t),s){for(;(d=i[c])!==u&&n.node(d).maxRank<e.rank;)c++;d===u&&(s=!1)}if(!s){for(;c<i.length-1&&n.node(d=i[c+1]).minRank<=e.rank;)c++;d=i[c]}n.setParent(t,d),t=n.successors(t)[0]}})}function Qt(n,r,t,e){var o=[],a=[],i=Math.min(r[t].low,r[e].low),u=Math.max(r[t].lim,r[e].lim),c,d;c=t;do c=n.parent(c),o.push(c);while(c&&(r[c].low>i||u>r[c].lim));for(d=c,c=e;(c=n.parent(c))!==d;)a.push(c);return{path:o.concat(a.reverse()),lca:d}}function Zt(n){var r={},t=0;function e(o){var a=t;f(n.children(o),e),r[o]={low:a,lim:t++}}return f(n.children(),e),r}function Ht(n,r){var t={};function e(o,a){var i=0,u=0,c=o.length,d=C(a);return f(a,function(s,h){var v=Kt(n,s),g=v?n.node(v).order:c;(v||s===d)&&(f(a.slice(u,h+1),function(l){f(n.predecessors(l),function(w){var _=n.node(w),rn=_.order;(rn<i||g<rn)&&!(_.dummy&&n.node(l).dummy)&&qn(t,w,l)})}),u=h+1,i=g)}),a}return F(r,e),t}function Jt(n,r){var t={};function e(a,i,u,c,d){var s;f(E(i,u),function(h){s=a[h],n.node(s).dummy&&f(n.predecessors(s),function(v){var g=n.node(v);g.dummy&&(g.order<c||g.order>d)&&qn(t,v,s)})})}function o(a,i){var u=-1,c,d=0;return f(i,function(s,h){if(n.node(s).dummy==="border"){var v=n.predecessors(s);v.length&&(c=n.node(v[0]).order,e(i,d,h,u,c),d=h,u=c)}e(i,d,i.length,c,a.length)}),i}return F(r,o),t}function Kt(n,r){if(n.node(r).dummy)return J(n.predecessors(r),function(t){return n.node(t).dummy})}function qn(n,r,t){if(r>t){var e=r;r=t,t=e}Object.prototype.hasOwnProperty.call(n,r)||Object.defineProperty(n,r,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=n[r];Object.defineProperty(o,t,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ut(n,r,t){if(r>t){var e=r;r=t,t=e}return!!n[r]&&Object.prototype.hasOwnProperty.call(n[r],t)}function Xt(n,r,t,e){var o={},a={},i={};return f(r,function(u){f(u,function(c,d){o[c]=c,a[c]=c,i[c]=d})}),f(r,function(u){var c=-1;f(u,function(d){var s=e(d);if(s.length){s=T(s,function(w){return i[w]});for(var h=(s.length-1)/2,v=Math.floor(h),g=Math.ceil(h);v<=g;++v){var l=s[v];a[d]===d&&c<i[l]&&!Ut(t,d,l)&&(a[l]=d,a[d]=o[d]=o[l],c=i[l])}}})}),{root:o,align:a}}function Wt(n,r,t,e,o){var a={},i=ne(n,r,t,o),u=o?"borderLeft":"borderRight";function c(h,v){for(var g=i.nodes(),l=g.pop(),w={};l;)w[l]?h(l):(w[l]=!0,g.push(l),g=g.concat(v(l))),l=g.pop()}function d(h){a[h]=i.inEdges(h).reduce(function(v,g){return Math.max(v,a[g.v]+i.edge(g))},0)}function s(h){var v=i.outEdges(h).reduce(function(l,w){return Math.min(l,a[w.w]-i.edge(w))},Number.POSITIVE_INFINITY),g=n.node(h);v!==Number.POSITIVE_INFINITY&&g.borderType!==u&&(a[h]=Math.max(a[h],v))}return c(d,i.predecessors.bind(i)),c(s,i.successors.bind(i)),f(e,function(h){a[h]=a[t[h]]}),a}function ne(n,r,t,e){var o=new b,a=n.graph(),i=ie(a.nodesep,a.edgesep,e);return f(r,function(u){var c;f(u,function(d){var s=t[d];if(o.setNode(s),c){var h=t[c],v=o.edge(h,s);o.setEdge(h,s,Math.max(i(n,d,c),v||0))}c=d})}),o}function re(n,r){return K(k(r),function(t){var e=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return _r(t,function(a,i){var u=ae(n,i)/2;e=Math.max(a+u,e),o=Math.min(a-u,o)}),e-o})}function te(n,r){var t=k(r),e=I(t),o=y(t);f(["u","d"],function(a){f(["l","r"],function(i){var u=a+i,c=n[u],d;if(c!==r){var s=k(c);d=i==="l"?e-I(s):o-y(s),d&&(n[u]=G(c,function(h){return h+d}))}})})}function ee(n,r){return G(n.ul,function(t,e){if(r)return n[r.toLowerCase()][e];var o=T(p(n,e));return(o[1]+o[2])/2})}function oe(n){var r=B(n),t=Z(Ht(n,r),Jt(n,r)),e={},o;f(["u","d"],function(i){o=i==="u"?r:k(r).reverse(),f(["l","r"],function(u){u==="r"&&(o=p(o,function(h){return k(h).reverse()}));var c=(i==="u"?n.predecessors:n.successors).bind(n),d=Xt(n,o,t,c),s=Wt(n,o,d.root,d.align,u==="r");u==="r"&&(s=G(s,function(h){return-h})),e[i+u]=s})});var a=re(n,e);return te(e,a),ee(e,n.graph().align)}function ie(n,r,t){return function(e,o,a){var i=e.node(o),u=e.node(a),c=0,d;if(c+=i.width/2,Object.prototype.hasOwnProperty.call(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":d=-i.width/2;break;case"r":d=i.width/2;break}if(d&&(c+=t?d:-d),d=0,c+=(i.dummy?r:n)/2,c+=(u.dummy?r:n)/2,c+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":d=u.width/2;break;case"r":d=-u.width/2;break}return d&&(c+=t?d:-d),d=0,c}}function ae(n,r){return n.node(r).width}function ue(n){n=In(n),ce(n),Ir(oe(n),function(r,t){n.node(t).x=r})}function ce(n){var r=B(n),t=n.graph().ranksep,e=0;f(r,function(o){var a=y(p(o,function(i){return n.node(i).height}));f(o,function(i){n.node(i).y=e+a/2}),e+=a+t})}function Se(n,r){var t=it;t("layout",()=>{var e=t(" buildLayoutGraph",()=>be(n));t(" runLayout",()=>de(e,t)),t(" updateInputGraph",()=>fe(n,e))})}function de(n,r){r(" makeSpaceForEdgeLabels",()=>ye(n)),r(" removeSelfEdges",()=>je(n)),r(" acyclic",()=>Xr(n)),r(" nestingGraph.run",()=>Nt(n)),r(" rank",()=>kt(In(n))),r(" injectEdgeLabelProxies",()=>xe(n)),r(" removeEmptyRanks",()=>et(n)),r(" nestingGraph.cleanup",()=>Pt(n)),r(" normalizeRanks",()=>tt(n)),r(" assignRankMinMax",()=>ke(n)),r(" removeEdgeLabelProxies",()=>Ee(n)),r(" normalize.run",()=>st(n)),r(" parentDummyChains",()=>Dt(n)),r(" addBorderSegments",()=>at(n)),r(" order",()=>Yt(n)),r(" insertSelfEdges",()=>Re(n)),r(" adjustCoordinateSystem",()=>ut(n)),r(" position",()=>ue(n)),r(" positionSelfEdges",()=>Te(n)),r(" removeBorderNodes",()=>Pe(n)),r(" normalize.undo",()=>vt(n)),r(" fixupEdgeLabelCoords",()=>_e(n)),r(" undoCoordinateSystem",()=>ct(n)),r(" translateGraph",()=>Oe(n)),r(" assignNodeIntersects",()=>Ne(n)),r(" reversePoints",()=>Ie(n)),r(" acyclic.undo",()=>nt(n))}function fe(n,r){f(n.nodes(),function(t){var e=n.node(t),o=r.node(t);e&&(e.x=o.x,e.y=o.y,r.children(t).length&&(e.width=o.width,e.height=o.height))}),f(n.edges(),function(t){var e=n.edge(t),o=r.edge(t);e.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(e.x=o.x,e.y=o.y)}),n.graph().width=r.graph().width,n.graph().height=r.graph().height}var se=["nodesep","edgesep","ranksep","marginx","marginy"],he={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ve=["acyclicer","ranker","rankdir","align"],ge=["width","height"],le={width:0,height:0},pe=["minlen","weight","width","height","labeloffset"],we={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},me=["labelpos"];function be(n){var r=new b({multigraph:!0,compound:!0}),t=D(n.graph());return r.setGraph(Z({},he,z(t,se),S(t,ve))),f(n.nodes(),function(e){var o=D(n.node(e));r.setNode(e,kr(z(o,ge),le)),r.setParent(e,n.parent(e))}),f(n.edges(),function(e){var o=D(n.edge(e));r.setEdge(e,Z({},we,z(o,pe),S(o,me)))}),r}function ye(n){var r=n.graph();r.ranksep/=2,f(n.edges(),function(t){var e=n.edge(t);e.minlen*=2,e.labelpos.toLowerCase()!=="c"&&(r.rankdir==="TB"||r.rankdir==="BT"?e.width+=e.labeloffset:e.height+=e.labeloffset)})}function xe(n){f(n.edges(),function(r){var t=n.edge(r);if(t.width&&t.height){var e=n.node(r.v),o=n.node(r.w),a={rank:(o.rank-e.rank)/2+e.rank,e:r};N(n,"edge-proxy",a,"_ep")}})}function ke(n){var r=0;f(n.nodes(),function(t){var e=n.node(t);e.borderTop&&(e.minRank=n.node(e.borderTop).rank,e.maxRank=n.node(e.borderBottom).rank,r=y(r,e.maxRank))}),n.graph().maxRank=r}function Ee(n){f(n.nodes(),function(r){var t=n.node(r);t.dummy==="edge-proxy"&&(n.edge(t.e).labelRank=t.rank,n.removeNode(r))})}function Oe(n){var r=Number.POSITIVE_INFINITY,t=0,e=Number.POSITIVE_INFINITY,o=0,a=n.graph(),i=a.marginx||0,u=a.marginy||0;function c(d){var s=d.x,h=d.y,v=d.width,g=d.height;r=Math.min(r,s-v/2),t=Math.max(t,s+v/2),e=Math.min(e,h-g/2),o=Math.max(o,h+g/2)}f(n.nodes(),function(d){c(n.node(d))}),f(n.edges(),function(d){var s=n.edge(d);Object.prototype.hasOwnProperty.call(s,"x")&&c(s)}),r-=i,e-=u,f(n.nodes(),function(d){var s=n.node(d);s.x-=r,s.y-=e}),f(n.edges(),function(d){var s=n.edge(d);f(s.points,function(h){h.x-=r,h.y-=e}),Object.prototype.hasOwnProperty.call(s,"x")&&(s.x-=r),Object.prototype.hasOwnProperty.call(s,"y")&&(s.y-=e)}),a.width=t-r+i,a.height=o-e+u}function Ne(n){f(n.edges(),function(r){var t=n.edge(r),e=n.node(r.v),o=n.node(r.w),a,i;t.points?(a=t.points[0],i=t.points[t.points.length-1]):(t.points=[],a=o,i=e),t.points.unshift(an(e,a)),t.points.push(an(o,i))})}function _e(n){f(n.edges(),function(r){var t=n.edge(r);if(Object.prototype.hasOwnProperty.call(t,"x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})}function Ie(n){f(n.edges(),function(r){var t=n.edge(r);t.reversed&&t.points.reverse()})}function Pe(n){f(n.nodes(),function(r){if(n.children(r).length){var t=n.node(r),e=n.node(t.borderTop),o=n.node(t.borderBottom),a=n.node(C(t.borderLeft)),i=n.node(C(t.borderRight));t.width=Math.abs(i.x-a.x),t.height=Math.abs(o.y-e.y),t.x=a.x+t.width/2,t.y=e.y+t.height/2}}),f(n.nodes(),function(r){n.node(r).dummy==="border"&&n.removeNode(r)})}function je(n){f(n.edges(),function(r){if(r.v===r.w){var t=n.node(r.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:r,label:n.edge(r)}),n.removeEdge(r)}})}function Re(n){var r=B(n);f(r,function(t){var e=0;f(t,function(o,a){var i=n.node(o);i.order=a+e,f(i.selfEdges,function(u){N(n,"selfedge",{width:u.label.width,height:u.label.height,rank:i.rank,order:a+ ++e,e:u.e,label:u.label},"_se")}),delete i.selfEdges})})}function Te(n){f(n.nodes(),function(r){var t=n.node(r);if(t.dummy==="selfedge"){var e=n.node(t.e.v),o=e.x+e.width/2,a=e.y,i=t.x-o,u=e.height/2;n.setEdge(t.e,t.label),n.removeNode(r),t.label.points=[{x:o+2*i/3,y:a-u},{x:o+5*i/6,y:a-u},{x:o+i,y:a},{x:o+5*i/6,y:a+u},{x:o+2*i/3,y:a+u}],t.label.x=t.x,t.label.y=t.y}})}function z(n,r){return G(S(n,r),Number)}function D(n){var r={};return f(n,function(t,e){r[e.toLowerCase()]=t}),r}export{Se as B};
|
|
1
|
+
import{Q as b,A as k,_ as m,O as An}from"./graph-BpcfrHXY-BdEJ7yQe.js";import{B as Vn,q as f,v as q,n as ln,a as j,$ as pn,G as Yn,Y as F,T as zn,Z as R,F as wn,j as mn,x as Q,I as Dn,M as Qn,b as Zn,c as Hn}from"./_baseUniq-BPMphbq5-DxDS_DP8.js";import{L as O,v as Jn,k as I,M as p,A as bn,x as Kn}from"./min-C2aDz5ZK-BLKawk6b.js";import{aE as yn,aF as L,aG as xn,aH as Un,aI as Z,aJ as Xn,aK as Wn,aL as kn,aM as En,aN as nr,aO as rr,aP as tr,aQ as $,aR as er,aS as On,aT as or,aU as ir}from"./index-CH486f5J.js";var ar=/\s/;function ur(n){for(var r=n.length;r--&&ar.test(n.charAt(r)););return r}var cr=/^\s+/;function dr(n){return n&&n.slice(0,ur(n)+1).replace(cr,"")}var tn=NaN,fr=/^[-+]0x[0-9a-f]+$/i,sr=/^0b[01]+$/i,hr=/^0o[0-7]+$/i,vr=parseInt;function gr(n){if(typeof n=="number")return n;if(Q(n))return tn;if($(n)){var r=typeof n.valueOf=="function"?n.valueOf():n;n=$(r)?r+"":r}if(typeof n!="string")return n===0?n:+n;n=dr(n);var t=sr.test(n);return t||hr.test(n)?vr(n.slice(2),t?2:8):fr.test(n)?tn:+n}var en=1/0,lr=17976931348623157e292;function M(n){if(!n)return n===0?n:0;if(n=gr(n),n===en||n===-en){var r=n<0?-1:1;return r*lr}return n===n?n:0}function pr(n){var r=M(n),t=r%1;return r===r?t?r-t:r:0}function wr(n){return Xn(Wn(n,void 0,O),n+"")}var mr=1,br=4;function yr(n){return An(n,mr|br)}var Nn=Object.prototype,xr=Nn.hasOwnProperty,kr=yn(function(n,r){n=Object(n);var t=-1,e=r.length,o=e>2?r[2]:void 0;for(o&&L(r[0],r[1],o)&&(e=1);++t<e;)for(var a=r[t],i=xn(a),u=-1,c=i.length;++u<c;){var d=i[u],s=n[d];(s===void 0||Un(s,Nn[d])&&!xr.call(n,d))&&(n[d]=a[d])}return n});function C(n){var r=n==null?0:n.length;return r?n[r-1]:void 0}function Er(n){return function(r,t,e){var o=Object(r);if(!or(r)){var a=j(t);r=Qn(r),t=function(u){return a(o[u],u,o)}}var i=n(r,t,e);return i>-1?o[a?r[i]:i]:void 0}}var Or=Math.max;function Nr(n,r,t){var e=n==null?0:n.length;if(!e)return-1;var o=t==null?0:pr(t);return o<0&&(o=Or(e+o,0)),Hn(n,j(r),o)}var J=Er(Nr);function _r(n,r){return n==null?n:ir(n,wn(r),xn)}function Ir(n,r){return n&&pn(n,wn(r))}function Pr(n,r){return n>r}var jr=Object.prototype,Rr=jr.hasOwnProperty;function Tr(n,r){return n!=null&&Rr.call(n,r)}function _n(n,r){return n!=null&&zn(n,r,Tr)}function G(n,r){var t={};return r=j(r),pn(n,function(e,o,a){rr(t,o,r(e,o,a))}),t}function y(n){return n&&n.length?bn(n,En,Pr):void 0}function K(n,r){return n&&n.length?bn(n,j(r),Kn):void 0}function Mr(n,r,t,e){if(!$(n))return n;r=mn(r,n);for(var o=-1,a=r.length,i=a-1,u=n;u!=null&&++o<a;){var c=Dn(r[o]),d=t;if(c==="__proto__"||c==="constructor"||c==="prototype")return n;if(o!=i){var s=u[c];d=void 0,d===void 0&&(d=$(s)?s:er(r[o+1])?[]:{})}On(u,c,d),u=u[c]}return n}function Lr(n,r,t){for(var e=-1,o=r.length,a={};++e<o;){var i=r[e],u=ln(n,i);t(u,i)&&Mr(a,mn(i,n),u)}return a}function $r(n,r){var t=n.length;for(n.sort(r);t--;)n[t]=n[t].value;return n}function Cr(n,r){if(n!==r){var t=n!==void 0,e=n===null,o=n===n,a=Q(n),i=r!==void 0,u=r===null,c=r===r,d=Q(r);if(!u&&!d&&!a&&n>r||a&&i&&c&&!u&&!d||e&&i&&c||!t&&c||!o)return 1;if(!e&&!a&&!d&&n<r||d&&t&&o&&!e&&!a||u&&t&&o||!i&&o||!c)return-1}return 0}function Sr(n,r,t){for(var e=-1,o=n.criteria,a=r.criteria,i=o.length,u=t.length;++e<i;){var c=Cr(o[e],a[e]);if(c){if(e>=u)return c;var d=t[e];return c*(d=="desc"?-1:1)}}return n.index-r.index}function Fr(n,r,t){r.length?r=q(r,function(a){return kn(a)?function(i){return ln(i,a.length===1?a[0]:a)}:a}):r=[En];var e=-1;r=q(r,nr(j));var o=Jn(n,function(a,i,u){var c=q(r,function(d){return d(a)});return{criteria:c,index:++e,value:a}});return $r(o,function(a,i){return Sr(a,i,t)})}function Gr(n,r){return Lr(n,r,function(t,e){return Zn(n,e)})}var S=wr(function(n,r){return n==null?{}:Gr(n,r)}),Br=Math.ceil,qr=Math.max;function Ar(n,r,t,e){for(var o=-1,a=qr(Br((r-n)/(t||1)),0),i=Array(a);a--;)i[++o]=n,n+=t;return i}function Vr(n){return function(r,t,e){return e&&typeof e!="number"&&L(r,t,e)&&(t=e=void 0),r=M(r),t===void 0?(t=r,r=0):t=M(t),e=e===void 0?r<t?1:-1:M(e),Ar(r,t,e)}}var E=Vr(),T=yn(function(n,r){if(n==null)return[];var t=r.length;return t>1&&L(n,r[0],r[1])?r=[]:t>2&&L(r[0],r[1],r[2])&&(r=[r[0]]),Fr(n,Vn(r),[])}),Yr=0;function U(n){var r=++Yr;return Yn(n)+r}function zr(n,r,t){for(var e=-1,o=n.length,a=r.length,i={};++e<o;){var u=e<a?r[e]:void 0;t(i,n[e],u)}return i}function Dr(n,r){return zr(n||[],r||[],On)}class Qr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,t=r._prev;if(t!==r)return on(t),t}enqueue(r){var t=this._sentinel;r._prev&&r._next&&on(r),r._next=t._next,t._next._prev=r,t._next=r,r._prev=t}toString(){for(var r=[],t=this._sentinel,e=t._prev;e!==t;)r.push(JSON.stringify(e,Zr)),e=e._prev;return"["+r.join(", ")+"]"}}function on(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function Zr(n,r){if(n!=="_next"&&n!=="_prev")return r}var Hr=tr(1);function Jr(n,r){if(n.nodeCount()<=1)return[];var t=Ur(n,r||Hr),e=Kr(t.graph,t.buckets,t.zeroIdx);return O(p(e,function(o){return n.outEdges(o.v,o.w)}))}function Kr(n,r,t){for(var e=[],o=r[r.length-1],a=r[0],i;n.nodeCount();){for(;i=a.dequeue();)A(n,r,t,i);for(;i=o.dequeue();)A(n,r,t,i);if(n.nodeCount()){for(var u=r.length-2;u>0;--u)if(i=r[u].dequeue(),i){e=e.concat(A(n,r,t,i,!0));break}}}return e}function A(n,r,t,e,o){var a=o?[]:void 0;return f(n.inEdges(e.v),function(i){var u=n.edge(i),c=n.node(i.v);o&&a.push({v:i.v,w:i.w}),c.out-=u,H(r,t,c)}),f(n.outEdges(e.v),function(i){var u=n.edge(i),c=i.w,d=n.node(c);d.in-=u,H(r,t,d)}),n.removeNode(e.v),a}function Ur(n,r){var t=new b,e=0,o=0;f(n.nodes(),function(u){t.setNode(u,{v:u,in:0,out:0})}),f(n.edges(),function(u){var c=t.edge(u.v,u.w)||0,d=r(u),s=c+d;t.setEdge(u.v,u.w,s),o=Math.max(o,t.node(u.v).out+=d),e=Math.max(e,t.node(u.w).in+=d)});var a=E(o+e+3).map(function(){return new Qr}),i=e+1;return f(t.nodes(),function(u){H(a,i,t.node(u))}),{graph:t,buckets:a,zeroIdx:i}}function H(n,r,t){t.out?t.in?n[t.out-t.in+r].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}function Xr(n){var r=n.graph().acyclicer==="greedy"?Jr(n,t(n)):Wr(n);f(r,function(e){var o=n.edge(e);n.removeEdge(e),o.forwardName=e.name,o.reversed=!0,n.setEdge(e.w,e.v,o,U("rev"))});function t(e){return function(o){return e.edge(o).weight}}}function Wr(n){var r=[],t={},e={};function o(a){Object.prototype.hasOwnProperty.call(e,a)||(e[a]=!0,t[a]=!0,f(n.outEdges(a),function(i){Object.prototype.hasOwnProperty.call(t,i.w)?r.push(i):o(i.w)}),delete t[a])}return f(n.nodes(),o),r}function nt(n){f(n.edges(),function(r){var t=n.edge(r);if(t.reversed){n.removeEdge(r);var e=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(r.w,r.v,t,e)}})}function N(n,r,t,e){var o;do o=U(e);while(n.hasNode(o));return t.dummy=r,n.setNode(o,t),o}function rt(n){var r=new b().setGraph(n.graph());return f(n.nodes(),function(t){r.setNode(t,n.node(t))}),f(n.edges(),function(t){var e=r.edge(t.v,t.w)||{weight:0,minlen:1},o=n.edge(t);r.setEdge(t.v,t.w,{weight:e.weight+o.weight,minlen:Math.max(e.minlen,o.minlen)})}),r}function In(n){var r=new b({multigraph:n.isMultigraph()}).setGraph(n.graph());return f(n.nodes(),function(t){n.children(t).length||r.setNode(t,n.node(t))}),f(n.edges(),function(t){r.setEdge(t,n.edge(t))}),r}function an(n,r){var t=n.x,e=n.y,o=r.x-t,a=r.y-e,i=n.width/2,u=n.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var c,d;return Math.abs(a)*i>Math.abs(o)*u?(a<0&&(u=-u),c=u*o/a,d=u):(o<0&&(i=-i),c=i,d=i*a/o),{x:t+c,y:e+d}}function B(n){var r=p(E(Pn(n)+1),function(){return[]});return f(n.nodes(),function(t){var e=n.node(t),o=e.rank;m(o)||(r[o][e.order]=t)}),r}function tt(n){var r=I(p(n.nodes(),function(t){return n.node(t).rank}));f(n.nodes(),function(t){var e=n.node(t);_n(e,"rank")&&(e.rank-=r)})}function et(n){var r=I(p(n.nodes(),function(a){return n.node(a).rank})),t=[];f(n.nodes(),function(a){var i=n.node(a).rank-r;t[i]||(t[i]=[]),t[i].push(a)});var e=0,o=n.graph().nodeRankFactor;f(t,function(a,i){m(a)&&i%o!==0?--e:e&&f(a,function(u){n.node(u).rank+=e})})}function un(n,r,t,e){var o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=e),N(n,"border",o,r)}function Pn(n){return y(p(n.nodes(),function(r){var t=n.node(r).rank;if(!m(t))return t}))}function ot(n,r){var t={lhs:[],rhs:[]};return f(n,function(e){r(e)?t.lhs.push(e):t.rhs.push(e)}),t}function it(n,r){return r()}function at(n){function r(t){var e=n.children(t),o=n.node(t);if(e.length&&f(e,r),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,i=o.maxRank+1;a<i;++a)cn(n,"borderLeft","_bl",t,o,a),cn(n,"borderRight","_br",t,o,a)}}f(n.children(),r)}function cn(n,r,t,e,o,a){var i={width:0,height:0,rank:a,borderType:r},u=o[r][a-1],c=N(n,"border",i,t);o[r][a]=c,n.setParent(c,e),u&&n.setEdge(u,c,{weight:1})}function ut(n){var r=n.graph().rankdir.toLowerCase();(r==="lr"||r==="rl")&&jn(n)}function ct(n){var r=n.graph().rankdir.toLowerCase();(r==="bt"||r==="rl")&&dt(n),(r==="lr"||r==="rl")&&(ft(n),jn(n))}function jn(n){f(n.nodes(),function(r){dn(n.node(r))}),f(n.edges(),function(r){dn(n.edge(r))})}function dn(n){var r=n.width;n.width=n.height,n.height=r}function dt(n){f(n.nodes(),function(r){V(n.node(r))}),f(n.edges(),function(r){var t=n.edge(r);f(t.points,V),Object.prototype.hasOwnProperty.call(t,"y")&&V(t)})}function V(n){n.y=-n.y}function ft(n){f(n.nodes(),function(r){Y(n.node(r))}),f(n.edges(),function(r){var t=n.edge(r);f(t.points,Y),Object.prototype.hasOwnProperty.call(t,"x")&&Y(t)})}function Y(n){var r=n.x;n.x=n.y,n.y=r}function st(n){n.graph().dummyChains=[],f(n.edges(),function(r){ht(n,r)})}function ht(n,r){var t=r.v,e=n.node(t).rank,o=r.w,a=n.node(o).rank,i=r.name,u=n.edge(r),c=u.labelRank;if(a!==e+1){n.removeEdge(r);var d=void 0,s,h;for(h=0,++e;e<a;++h,++e)u.points=[],d={width:0,height:0,edgeLabel:u,edgeObj:r,rank:e},s=N(n,"edge",d,"_d"),e===c&&(d.width=u.width,d.height=u.height,d.dummy="edge-label",d.labelpos=u.labelpos),n.setEdge(t,s,{weight:u.weight},i),h===0&&n.graph().dummyChains.push(s),t=s;n.setEdge(t,o,{weight:u.weight},i)}}function vt(n){f(n.graph().dummyChains,function(r){var t=n.node(r),e=t.edgeLabel,o;for(n.setEdge(t.edgeObj,e);t.dummy;)o=n.successors(r)[0],n.removeNode(r),e.points.push({x:t.x,y:t.y}),t.dummy==="edge-label"&&(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height),r=o,t=n.node(r)})}function X(n){var r={};function t(e){var o=n.node(e);if(Object.prototype.hasOwnProperty.call(r,e))return o.rank;r[e]=!0;var a=I(p(n.outEdges(e),function(i){return t(i.w)-n.edge(i).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),o.rank=a}f(n.sources(),t)}function P(n,r){return n.node(r.w).rank-n.node(r.v).rank-n.edge(r).minlen}function Rn(n){var r=new b({directed:!1}),t=n.nodes()[0],e=n.nodeCount();r.setNode(t,{});for(var o,a;gt(r,n)<e;)o=lt(r,n),a=r.hasNode(o.v)?P(n,o):-P(n,o),pt(r,n,a);return r}function gt(n,r){function t(e){f(r.nodeEdges(e),function(o){var a=o.v,i=e===a?o.w:a;!n.hasNode(i)&&!P(r,o)&&(n.setNode(i,{}),n.setEdge(e,i,{}),t(i))})}return f(n.nodes(),t),n.nodeCount()}function lt(n,r){return K(r.edges(),function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return P(r,t)})}function pt(n,r,t){f(n.nodes(),function(e){r.node(e).rank+=t})}function Tn(n,r,t){kn(r)||(r=[r]);var e=(n.isDirected()?n.successors:n.neighbors).bind(n),o=[],a={};return f(r,function(i){if(!n.hasNode(i))throw new Error("Graph does not have node: "+i);Mn(n,i,t==="post",a,e,o)}),o}function Mn(n,r,t,e,o,a){Object.prototype.hasOwnProperty.call(e,r)||(e[r]=!0,t||a.push(r),f(o(r),function(i){Mn(n,i,t,e,o,a)}),t&&a.push(r))}function wt(n,r){return Tn(n,r,"post")}function mt(n,r){return Tn(n,r,"pre")}x.initLowLimValues=nn;x.initCutValues=W;x.calcCutValue=Ln;x.leaveEdge=Cn;x.enterEdge=Sn;x.exchangeEdges=Fn;function x(n){n=rt(n),X(n);var r=Rn(n);nn(r),W(r,n);for(var t,e;t=Cn(r);)e=Sn(r,n,t),Fn(r,n,t,e)}function W(n,r){var t=wt(n,n.nodes());t=t.slice(0,t.length-1),f(t,function(e){bt(n,r,e)})}function bt(n,r,t){var e=n.node(t),o=e.parent;n.edge(t,o).cutvalue=Ln(n,r,t)}function Ln(n,r,t){var e=n.node(t),o=e.parent,a=!0,i=r.edge(t,o),u=0;return i||(a=!1,i=r.edge(o,t)),u=i.weight,f(r.nodeEdges(t),function(c){var d=c.v===t,s=d?c.w:c.v;if(s!==o){var h=d===a,v=r.edge(c).weight;if(u+=h?v:-v,xt(n,t,s)){var g=n.edge(t,s).cutvalue;u+=h?-g:g}}}),u}function nn(n,r){arguments.length<2&&(r=n.nodes()[0]),$n(n,{},1,r)}function $n(n,r,t,e,o){var a=t,i=n.node(e);return r[e]=!0,f(n.neighbors(e),function(u){Object.prototype.hasOwnProperty.call(r,u)||(t=$n(n,r,t,u,e))}),i.low=a,i.lim=t++,o?i.parent=o:delete i.parent,t}function Cn(n){return J(n.edges(),function(r){return n.edge(r).cutvalue<0})}function Sn(n,r,t){var e=t.v,o=t.w;r.hasEdge(e,o)||(e=t.w,o=t.v);var a=n.node(e),i=n.node(o),u=a,c=!1;a.lim>i.lim&&(u=i,c=!0);var d=R(r.edges(),function(s){return c===fn(n,n.node(s.v),u)&&c!==fn(n,n.node(s.w),u)});return K(d,function(s){return P(r,s)})}function Fn(n,r,t,e){var o=t.v,a=t.w;n.removeEdge(o,a),n.setEdge(e.v,e.w,{}),nn(n),W(n,r),yt(n,r)}function yt(n,r){var t=J(n.nodes(),function(o){return!r.node(o).parent}),e=mt(n,t);e=e.slice(1),f(e,function(o){var a=n.node(o).parent,i=r.edge(o,a),u=!1;i||(i=r.edge(a,o),u=!0),r.node(o).rank=r.node(a).rank+(u?i.minlen:-i.minlen)})}function xt(n,r,t){return n.hasEdge(r,t)}function fn(n,r,t){return t.low<=r.lim&&r.lim<=t.lim}function kt(n){switch(n.graph().ranker){case"network-simplex":sn(n);break;case"tight-tree":Ot(n);break;case"longest-path":Et(n);break;default:sn(n)}}var Et=X;function Ot(n){X(n),Rn(n)}function sn(n){x(n)}function Nt(n){var r=N(n,"root",{},"_root"),t=_t(n),e=y(k(t))-1,o=2*e+1;n.graph().nestingRoot=r,f(n.edges(),function(i){n.edge(i).minlen*=o});var a=It(n)+1;f(n.children(),function(i){Gn(n,r,o,a,e,t,i)}),n.graph().nodeRankFactor=o}function Gn(n,r,t,e,o,a,i){var u=n.children(i);if(!u.length){i!==r&&n.setEdge(r,i,{weight:0,minlen:t});return}var c=un(n,"_bt"),d=un(n,"_bb"),s=n.node(i);n.setParent(c,i),s.borderTop=c,n.setParent(d,i),s.borderBottom=d,f(u,function(h){Gn(n,r,t,e,o,a,h);var v=n.node(h),g=v.borderTop?v.borderTop:h,l=v.borderBottom?v.borderBottom:h,w=v.borderTop?e:2*e,_=g!==l?1:o-a[i]+1;n.setEdge(c,g,{weight:w,minlen:_,nestingEdge:!0}),n.setEdge(l,d,{weight:w,minlen:_,nestingEdge:!0})}),n.parent(i)||n.setEdge(r,c,{weight:0,minlen:o+a[i]})}function _t(n){var r={};function t(e,o){var a=n.children(e);a&&a.length&&f(a,function(i){t(i,o+1)}),r[e]=o}return f(n.children(),function(e){t(e,1)}),r}function It(n){return F(n.edges(),function(r,t){return r+n.edge(t).weight},0)}function Pt(n){var r=n.graph();n.removeNode(r.nestingRoot),delete r.nestingRoot,f(n.edges(),function(t){var e=n.edge(t);e.nestingEdge&&n.removeEdge(t)})}function jt(n,r,t){var e={},o;f(t,function(a){for(var i=n.parent(a),u,c;i;){if(u=n.parent(i),u?(c=e[u],e[u]=i):(c=o,o=i),c&&c!==i){r.setEdge(c,i);return}i=u}})}function Rt(n,r,t){var e=Tt(n),o=new b({compound:!0}).setGraph({root:e}).setDefaultNodeLabel(function(a){return n.node(a)});return f(n.nodes(),function(a){var i=n.node(a),u=n.parent(a);(i.rank===r||i.minRank<=r&&r<=i.maxRank)&&(o.setNode(a),o.setParent(a,u||e),f(n[t](a),function(c){var d=c.v===a?c.w:c.v,s=o.edge(d,a),h=m(s)?0:s.weight;o.setEdge(d,a,{weight:n.edge(c).weight+h})}),Object.prototype.hasOwnProperty.call(i,"minRank")&&o.setNode(a,{borderLeft:i.borderLeft[r],borderRight:i.borderRight[r]}))}),o}function Tt(n){for(var r;n.hasNode(r=U("_root")););return r}function Mt(n,r){for(var t=0,e=1;e<r.length;++e)t+=Lt(n,r[e-1],r[e]);return t}function Lt(n,r,t){for(var e=Dr(t,p(t,function(d,s){return s})),o=O(p(r,function(d){return T(p(n.outEdges(d),function(s){return{pos:e[s.w],weight:n.edge(s).weight}}),"pos")})),a=1;a<t.length;)a<<=1;var i=2*a-1;a-=1;var u=p(new Array(i),function(){return 0}),c=0;return f(o.forEach(function(d){var s=d.pos+a;u[s]+=d.weight;for(var h=0;s>0;)s%2&&(h+=u[s+1]),s=s-1>>1,u[s]+=d.weight;c+=d.weight*h})),c}function $t(n){var r={},t=R(n.nodes(),function(u){return!n.children(u).length}),e=y(p(t,function(u){return n.node(u).rank})),o=p(E(e+1),function(){return[]});function a(u){if(!_n(r,u)){r[u]=!0;var c=n.node(u);o[c.rank].push(u),f(n.successors(u),a)}}var i=T(t,function(u){return n.node(u).rank});return f(i,a),o}function Ct(n,r){return p(r,function(t){var e=n.inEdges(t);if(e.length){var o=F(e,function(a,i){var u=n.edge(i),c=n.node(i.v);return{sum:a.sum+u.weight*c.order,weight:a.weight+u.weight}},{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:t}})}function St(n,r){var t={};f(n,function(o,a){var i=t[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:a};m(o.barycenter)||(i.barycenter=o.barycenter,i.weight=o.weight)}),f(r.edges(),function(o){var a=t[o.v],i=t[o.w];!m(a)&&!m(i)&&(i.indegree++,a.out.push(t[o.w]))});var e=R(t,function(o){return!o.indegree});return Ft(e)}function Ft(n){var r=[];function t(a){return function(i){i.merged||(m(i.barycenter)||m(a.barycenter)||i.barycenter>=a.barycenter)&&Gt(a,i)}}function e(a){return function(i){i.in.push(a),--i.indegree===0&&n.push(i)}}for(;n.length;){var o=n.pop();r.push(o),f(o.in.reverse(),t(o)),f(o.out,e(o))}return p(R(r,function(a){return!a.merged}),function(a){return S(a,["vs","i","barycenter","weight"])})}function Gt(n,r){var t=0,e=0;n.weight&&(t+=n.barycenter*n.weight,e+=n.weight),r.weight&&(t+=r.barycenter*r.weight,e+=r.weight),n.vs=r.vs.concat(n.vs),n.barycenter=t/e,n.weight=e,n.i=Math.min(r.i,n.i),r.merged=!0}function Bt(n,r){var t=ot(n,function(s){return Object.prototype.hasOwnProperty.call(s,"barycenter")}),e=t.lhs,o=T(t.rhs,function(s){return-s.i}),a=[],i=0,u=0,c=0;e.sort(qt(!!r)),c=hn(a,o,c),f(e,function(s){c+=s.vs.length,a.push(s.vs),i+=s.barycenter*s.weight,u+=s.weight,c=hn(a,o,c)});var d={vs:O(a)};return u&&(d.barycenter=i/u,d.weight=u),d}function hn(n,r,t){for(var e;r.length&&(e=C(r)).i<=t;)r.pop(),n.push(e.vs),t++;return t}function qt(n){return function(r,t){return r.barycenter<t.barycenter?-1:r.barycenter>t.barycenter?1:n?t.i-r.i:r.i-t.i}}function Bn(n,r,t,e){var o=n.children(r),a=n.node(r),i=a?a.borderLeft:void 0,u=a?a.borderRight:void 0,c={};i&&(o=R(o,function(l){return l!==i&&l!==u}));var d=Ct(n,o);f(d,function(l){if(n.children(l.v).length){var w=Bn(n,l.v,t,e);c[l.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&Vt(l,w)}});var s=St(d,t);At(s,c);var h=Bt(s,e);if(i&&(h.vs=O([i,h.vs,u]),n.predecessors(i).length)){var v=n.node(n.predecessors(i)[0]),g=n.node(n.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+v.order+g.order)/(h.weight+2),h.weight+=2}return h}function At(n,r){f(n,function(t){t.vs=O(t.vs.map(function(e){return r[e]?r[e].vs:e}))})}function Vt(n,r){m(n.barycenter)?(n.barycenter=r.barycenter,n.weight=r.weight):(n.barycenter=(n.barycenter*n.weight+r.barycenter*r.weight)/(n.weight+r.weight),n.weight+=r.weight)}function Yt(n){var r=Pn(n),t=vn(n,E(1,r+1),"inEdges"),e=vn(n,E(r-1,-1,-1),"outEdges"),o=$t(n);gn(n,o);for(var a=Number.POSITIVE_INFINITY,i,u=0,c=0;c<4;++u,++c){zt(u%2?t:e,u%4>=2),o=B(n);var d=Mt(n,o);d<a&&(c=0,i=yr(o),a=d)}gn(n,i)}function vn(n,r,t){return p(r,function(e){return Rt(n,e,t)})}function zt(n,r){var t=new b;f(n,function(e){var o=e.graph().root,a=Bn(e,o,t,r);f(a.vs,function(i,u){e.node(i).order=u}),jt(e,t,a.vs)})}function gn(n,r){f(r,function(t){f(t,function(e,o){n.node(e).order=o})})}function Dt(n){var r=Zt(n);f(n.graph().dummyChains,function(t){for(var e=n.node(t),o=e.edgeObj,a=Qt(n,r,o.v,o.w),i=a.path,u=a.lca,c=0,d=i[c],s=!0;t!==o.w;){if(e=n.node(t),s){for(;(d=i[c])!==u&&n.node(d).maxRank<e.rank;)c++;d===u&&(s=!1)}if(!s){for(;c<i.length-1&&n.node(d=i[c+1]).minRank<=e.rank;)c++;d=i[c]}n.setParent(t,d),t=n.successors(t)[0]}})}function Qt(n,r,t,e){var o=[],a=[],i=Math.min(r[t].low,r[e].low),u=Math.max(r[t].lim,r[e].lim),c,d;c=t;do c=n.parent(c),o.push(c);while(c&&(r[c].low>i||u>r[c].lim));for(d=c,c=e;(c=n.parent(c))!==d;)a.push(c);return{path:o.concat(a.reverse()),lca:d}}function Zt(n){var r={},t=0;function e(o){var a=t;f(n.children(o),e),r[o]={low:a,lim:t++}}return f(n.children(),e),r}function Ht(n,r){var t={};function e(o,a){var i=0,u=0,c=o.length,d=C(a);return f(a,function(s,h){var v=Kt(n,s),g=v?n.node(v).order:c;(v||s===d)&&(f(a.slice(u,h+1),function(l){f(n.predecessors(l),function(w){var _=n.node(w),rn=_.order;(rn<i||g<rn)&&!(_.dummy&&n.node(l).dummy)&&qn(t,w,l)})}),u=h+1,i=g)}),a}return F(r,e),t}function Jt(n,r){var t={};function e(a,i,u,c,d){var s;f(E(i,u),function(h){s=a[h],n.node(s).dummy&&f(n.predecessors(s),function(v){var g=n.node(v);g.dummy&&(g.order<c||g.order>d)&&qn(t,v,s)})})}function o(a,i){var u=-1,c,d=0;return f(i,function(s,h){if(n.node(s).dummy==="border"){var v=n.predecessors(s);v.length&&(c=n.node(v[0]).order,e(i,d,h,u,c),d=h,u=c)}e(i,d,i.length,c,a.length)}),i}return F(r,o),t}function Kt(n,r){if(n.node(r).dummy)return J(n.predecessors(r),function(t){return n.node(t).dummy})}function qn(n,r,t){if(r>t){var e=r;r=t,t=e}Object.prototype.hasOwnProperty.call(n,r)||Object.defineProperty(n,r,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=n[r];Object.defineProperty(o,t,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ut(n,r,t){if(r>t){var e=r;r=t,t=e}return!!n[r]&&Object.prototype.hasOwnProperty.call(n[r],t)}function Xt(n,r,t,e){var o={},a={},i={};return f(r,function(u){f(u,function(c,d){o[c]=c,a[c]=c,i[c]=d})}),f(r,function(u){var c=-1;f(u,function(d){var s=e(d);if(s.length){s=T(s,function(w){return i[w]});for(var h=(s.length-1)/2,v=Math.floor(h),g=Math.ceil(h);v<=g;++v){var l=s[v];a[d]===d&&c<i[l]&&!Ut(t,d,l)&&(a[l]=d,a[d]=o[d]=o[l],c=i[l])}}})}),{root:o,align:a}}function Wt(n,r,t,e,o){var a={},i=ne(n,r,t,o),u=o?"borderLeft":"borderRight";function c(h,v){for(var g=i.nodes(),l=g.pop(),w={};l;)w[l]?h(l):(w[l]=!0,g.push(l),g=g.concat(v(l))),l=g.pop()}function d(h){a[h]=i.inEdges(h).reduce(function(v,g){return Math.max(v,a[g.v]+i.edge(g))},0)}function s(h){var v=i.outEdges(h).reduce(function(l,w){return Math.min(l,a[w.w]-i.edge(w))},Number.POSITIVE_INFINITY),g=n.node(h);v!==Number.POSITIVE_INFINITY&&g.borderType!==u&&(a[h]=Math.max(a[h],v))}return c(d,i.predecessors.bind(i)),c(s,i.successors.bind(i)),f(e,function(h){a[h]=a[t[h]]}),a}function ne(n,r,t,e){var o=new b,a=n.graph(),i=ie(a.nodesep,a.edgesep,e);return f(r,function(u){var c;f(u,function(d){var s=t[d];if(o.setNode(s),c){var h=t[c],v=o.edge(h,s);o.setEdge(h,s,Math.max(i(n,d,c),v||0))}c=d})}),o}function re(n,r){return K(k(r),function(t){var e=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return _r(t,function(a,i){var u=ae(n,i)/2;e=Math.max(a+u,e),o=Math.min(a-u,o)}),e-o})}function te(n,r){var t=k(r),e=I(t),o=y(t);f(["u","d"],function(a){f(["l","r"],function(i){var u=a+i,c=n[u],d;if(c!==r){var s=k(c);d=i==="l"?e-I(s):o-y(s),d&&(n[u]=G(c,function(h){return h+d}))}})})}function ee(n,r){return G(n.ul,function(t,e){if(r)return n[r.toLowerCase()][e];var o=T(p(n,e));return(o[1]+o[2])/2})}function oe(n){var r=B(n),t=Z(Ht(n,r),Jt(n,r)),e={},o;f(["u","d"],function(i){o=i==="u"?r:k(r).reverse(),f(["l","r"],function(u){u==="r"&&(o=p(o,function(h){return k(h).reverse()}));var c=(i==="u"?n.predecessors:n.successors).bind(n),d=Xt(n,o,t,c),s=Wt(n,o,d.root,d.align,u==="r");u==="r"&&(s=G(s,function(h){return-h})),e[i+u]=s})});var a=re(n,e);return te(e,a),ee(e,n.graph().align)}function ie(n,r,t){return function(e,o,a){var i=e.node(o),u=e.node(a),c=0,d;if(c+=i.width/2,Object.prototype.hasOwnProperty.call(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":d=-i.width/2;break;case"r":d=i.width/2;break}if(d&&(c+=t?d:-d),d=0,c+=(i.dummy?r:n)/2,c+=(u.dummy?r:n)/2,c+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":d=u.width/2;break;case"r":d=-u.width/2;break}return d&&(c+=t?d:-d),d=0,c}}function ae(n,r){return n.node(r).width}function ue(n){n=In(n),ce(n),Ir(oe(n),function(r,t){n.node(t).x=r})}function ce(n){var r=B(n),t=n.graph().ranksep,e=0;f(r,function(o){var a=y(p(o,function(i){return n.node(i).height}));f(o,function(i){n.node(i).y=e+a/2}),e+=a+t})}function Se(n,r){var t=it;t("layout",()=>{var e=t(" buildLayoutGraph",()=>be(n));t(" runLayout",()=>de(e,t)),t(" updateInputGraph",()=>fe(n,e))})}function de(n,r){r(" makeSpaceForEdgeLabels",()=>ye(n)),r(" removeSelfEdges",()=>je(n)),r(" acyclic",()=>Xr(n)),r(" nestingGraph.run",()=>Nt(n)),r(" rank",()=>kt(In(n))),r(" injectEdgeLabelProxies",()=>xe(n)),r(" removeEmptyRanks",()=>et(n)),r(" nestingGraph.cleanup",()=>Pt(n)),r(" normalizeRanks",()=>tt(n)),r(" assignRankMinMax",()=>ke(n)),r(" removeEdgeLabelProxies",()=>Ee(n)),r(" normalize.run",()=>st(n)),r(" parentDummyChains",()=>Dt(n)),r(" addBorderSegments",()=>at(n)),r(" order",()=>Yt(n)),r(" insertSelfEdges",()=>Re(n)),r(" adjustCoordinateSystem",()=>ut(n)),r(" position",()=>ue(n)),r(" positionSelfEdges",()=>Te(n)),r(" removeBorderNodes",()=>Pe(n)),r(" normalize.undo",()=>vt(n)),r(" fixupEdgeLabelCoords",()=>_e(n)),r(" undoCoordinateSystem",()=>ct(n)),r(" translateGraph",()=>Oe(n)),r(" assignNodeIntersects",()=>Ne(n)),r(" reversePoints",()=>Ie(n)),r(" acyclic.undo",()=>nt(n))}function fe(n,r){f(n.nodes(),function(t){var e=n.node(t),o=r.node(t);e&&(e.x=o.x,e.y=o.y,r.children(t).length&&(e.width=o.width,e.height=o.height))}),f(n.edges(),function(t){var e=n.edge(t),o=r.edge(t);e.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(e.x=o.x,e.y=o.y)}),n.graph().width=r.graph().width,n.graph().height=r.graph().height}var se=["nodesep","edgesep","ranksep","marginx","marginy"],he={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ve=["acyclicer","ranker","rankdir","align"],ge=["width","height"],le={width:0,height:0},pe=["minlen","weight","width","height","labeloffset"],we={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},me=["labelpos"];function be(n){var r=new b({multigraph:!0,compound:!0}),t=D(n.graph());return r.setGraph(Z({},he,z(t,se),S(t,ve))),f(n.nodes(),function(e){var o=D(n.node(e));r.setNode(e,kr(z(o,ge),le)),r.setParent(e,n.parent(e))}),f(n.edges(),function(e){var o=D(n.edge(e));r.setEdge(e,Z({},we,z(o,pe),S(o,me)))}),r}function ye(n){var r=n.graph();r.ranksep/=2,f(n.edges(),function(t){var e=n.edge(t);e.minlen*=2,e.labelpos.toLowerCase()!=="c"&&(r.rankdir==="TB"||r.rankdir==="BT"?e.width+=e.labeloffset:e.height+=e.labeloffset)})}function xe(n){f(n.edges(),function(r){var t=n.edge(r);if(t.width&&t.height){var e=n.node(r.v),o=n.node(r.w),a={rank:(o.rank-e.rank)/2+e.rank,e:r};N(n,"edge-proxy",a,"_ep")}})}function ke(n){var r=0;f(n.nodes(),function(t){var e=n.node(t);e.borderTop&&(e.minRank=n.node(e.borderTop).rank,e.maxRank=n.node(e.borderBottom).rank,r=y(r,e.maxRank))}),n.graph().maxRank=r}function Ee(n){f(n.nodes(),function(r){var t=n.node(r);t.dummy==="edge-proxy"&&(n.edge(t.e).labelRank=t.rank,n.removeNode(r))})}function Oe(n){var r=Number.POSITIVE_INFINITY,t=0,e=Number.POSITIVE_INFINITY,o=0,a=n.graph(),i=a.marginx||0,u=a.marginy||0;function c(d){var s=d.x,h=d.y,v=d.width,g=d.height;r=Math.min(r,s-v/2),t=Math.max(t,s+v/2),e=Math.min(e,h-g/2),o=Math.max(o,h+g/2)}f(n.nodes(),function(d){c(n.node(d))}),f(n.edges(),function(d){var s=n.edge(d);Object.prototype.hasOwnProperty.call(s,"x")&&c(s)}),r-=i,e-=u,f(n.nodes(),function(d){var s=n.node(d);s.x-=r,s.y-=e}),f(n.edges(),function(d){var s=n.edge(d);f(s.points,function(h){h.x-=r,h.y-=e}),Object.prototype.hasOwnProperty.call(s,"x")&&(s.x-=r),Object.prototype.hasOwnProperty.call(s,"y")&&(s.y-=e)}),a.width=t-r+i,a.height=o-e+u}function Ne(n){f(n.edges(),function(r){var t=n.edge(r),e=n.node(r.v),o=n.node(r.w),a,i;t.points?(a=t.points[0],i=t.points[t.points.length-1]):(t.points=[],a=o,i=e),t.points.unshift(an(e,a)),t.points.push(an(o,i))})}function _e(n){f(n.edges(),function(r){var t=n.edge(r);if(Object.prototype.hasOwnProperty.call(t,"x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})}function Ie(n){f(n.edges(),function(r){var t=n.edge(r);t.reversed&&t.points.reverse()})}function Pe(n){f(n.nodes(),function(r){if(n.children(r).length){var t=n.node(r),e=n.node(t.borderTop),o=n.node(t.borderBottom),a=n.node(C(t.borderLeft)),i=n.node(C(t.borderRight));t.width=Math.abs(i.x-a.x),t.height=Math.abs(o.y-e.y),t.x=a.x+t.width/2,t.y=e.y+t.height/2}}),f(n.nodes(),function(r){n.node(r).dummy==="border"&&n.removeNode(r)})}function je(n){f(n.edges(),function(r){if(r.v===r.w){var t=n.node(r.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:r,label:n.edge(r)}),n.removeEdge(r)}})}function Re(n){var r=B(n);f(r,function(t){var e=0;f(t,function(o,a){var i=n.node(o);i.order=a+e,f(i.selfEdges,function(u){N(n,"selfedge",{width:u.label.width,height:u.label.height,rank:i.rank,order:a+ ++e,e:u.e,label:u.label},"_se")}),delete i.selfEdges})})}function Te(n){f(n.nodes(),function(r){var t=n.node(r);if(t.dummy==="selfedge"){var e=n.node(t.e.v),o=e.x+e.width/2,a=e.y,i=t.x-o,u=e.height/2;n.setEdge(t.e,t.label),n.removeNode(r),t.label.points=[{x:o+2*i/3,y:a-u},{x:o+5*i/6,y:a-u},{x:o+i,y:a},{x:o+5*i/6,y:a+u},{x:o+2*i/3,y:a+u}],t.label.x=t.x,t.label.y=t.y}})}function z(n,r){return G(S(n,r),Number)}function D(n){var r={};return f(n,function(t,e){r[e.toLowerCase()]=t}),r}export{Se as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as s,a as l,g as c,B as e,x as g}from"./_baseUniq-BPMphbq5-
|
|
1
|
+
import{v as s,a as l,g as c,B as e,x as g}from"./_baseUniq-BPMphbq5-DxDS_DP8.js";import{aL as h,aT as m,aM as p}from"./index-CH486f5J.js";function M(n){var r=n==null?0:n.length;return r?e(n):[]}function x(n,r){var u=-1,o=m(n)?Array(n.length):[];return c(n,function(f,a,t){o[++u]=r(f,a,t)}),o}function k(n,r){var u=h(n)?s:x;return u(n,l(r))}function d(n,r){return n<r}function A(n,r,u){for(var o=-1,f=n.length;++o<f;){var a=n[o],t=r(a);if(t!=null&&(i===void 0?t===t&&!g(t):u(t,i)))var i=t,v=a}return v}function y(n){return n&&n.length?A(n,p,d):void 0}export{A,M as L,k as M,y as k,x as v,d as x};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as ce}from"./chunk-55IACEB6-Cza7pcpr-
|
|
1
|
+
import{d as ce}from"./chunk-55IACEB6-Cza7pcpr-DCWU8s6Y.js";import{d as he}from"./chunk-QN33PNHL-v6AkzOl1-Dh4p95uo.js";import{Q as a,s as I,r as le,u as de,T as M,k as X,Y as P,bd as ge,aY as ue,aZ as pe,a_ as ye}from"./index-CH486f5J.js";const m=[];for(let e=0;e<256;++e)m.push((e+256).toString(16).slice(1));function fe(e,s=0){return(m[e[s+0]]+m[e[s+1]]+m[e[s+2]]+m[e[s+3]]+"-"+m[e[s+4]]+m[e[s+5]]+"-"+m[e[s+6]]+m[e[s+7]]+"-"+m[e[s+8]]+m[e[s+9]]+"-"+m[e[s+10]]+m[e[s+11]]+m[e[s+12]]+m[e[s+13]]+m[e[s+14]]+m[e[s+15]]).toLowerCase()}let Y;const me=new Uint8Array(16);function Ee(){if(!Y){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Y=crypto.getRandomValues.bind(crypto)}return Y(me)}const _e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ne={randomUUID:_e};function be(e,s,i){var c;if(ne.randomUUID&&!e)return ne.randomUUID();e=e||{};const h=e.random??((c=e.rng)==null?void 0:c.call(e))??Ee();if(h.length<16)throw new Error("Random bytes length must be >= 16");return h[6]=h[6]&15|64,h[8]=h[8]&63|128,fe(h)}var J=function(){var e=a(function(S,t,r,o){for(r=r||{},o=S.length;o--;r[S[o]]=t);return r},"o"),s=[1,4],i=[1,13],c=[1,12],h=[1,15],y=[1,16],u=[1,20],g=[1,19],L=[6,7,8],p=[1,26],C=[1,24],z=[1,25],b=[6,7,11],Q=[1,6,13,15,16,19,22],Z=[1,33],q=[1,34],R=[1,6,7,11,13,15,16,19,22],B={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:a(function(S,t,r,o,l,n,E){var d=n.length-1;switch(l){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",n[d].id),o.addNode(n[d-1].length,n[d].id,n[d].descr,n[d].type);break;case 16:o.getLogger().trace("Icon: ",n[d]),o.decorateNode({icon:n[d]});break;case 17:case 21:o.decorateNode({class:n[d]});break;case 18:o.getLogger().trace("SPACELIST");break;case 19:o.getLogger().trace("Node: ",n[d].id),o.addNode(0,n[d].id,n[d].descr,n[d].type);break;case 20:o.decorateNode({icon:n[d]});break;case 25:o.getLogger().trace("node found ..",n[d-2]),this.$={id:n[d-1],descr:n[d-1],type:o.getType(n[d-2],n[d])};break;case 26:this.$={id:n[d],descr:n[d],type:o.nodeType.DEFAULT};break;case 27:o.getLogger().trace("node found ..",n[d-3]),this.$={id:n[d-3],descr:n[d-1],type:o.getType(n[d-2],n[d])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:s},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:s},{6:i,7:[1,10],9:9,12:11,13:c,14:14,15:h,16:y,17:17,18:18,19:u,22:g},e(L,[2,3]),{1:[2,2]},e(L,[2,4]),e(L,[2,5]),{1:[2,6],6:i,12:21,13:c,14:14,15:h,16:y,17:17,18:18,19:u,22:g},{6:i,9:22,12:11,13:c,14:14,15:h,16:y,17:17,18:18,19:u,22:g},{6:p,7:C,10:23,11:z},e(b,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:u,22:g}),e(b,[2,18]),e(b,[2,19]),e(b,[2,20]),e(b,[2,21]),e(b,[2,23]),e(b,[2,24]),e(b,[2,26],{19:[1,30]}),{20:[1,31]},{6:p,7:C,10:32,11:z},{1:[2,7],6:i,12:21,13:c,14:14,15:h,16:y,17:17,18:18,19:u,22:g},e(Q,[2,14],{7:Z,11:q}),e(R,[2,8]),e(R,[2,9]),e(R,[2,10]),e(b,[2,15]),e(b,[2,16]),e(b,[2,17]),{20:[1,35]},{21:[1,36]},e(Q,[2,13],{7:Z,11:q}),e(R,[2,11]),e(R,[2,12]),{21:[1,37]},e(b,[2,25]),e(b,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:a(function(S,t){if(t.recoverable)this.trace(S);else{var r=new Error(S);throw r.hash=t,r}},"parseError"),parse:a(function(S){var t=this,r=[0],o=[],l=[null],n=[],E=this.table,d="",A=0,K=0,se=2,V=1,re=n.slice.call(arguments,1),f=Object.create(this.lexer),T={yy:{}};for(var j in this.yy)Object.prototype.hasOwnProperty.call(this.yy,j)&&(T.yy[j]=this.yy[j]);f.setInput(S,T.yy),T.yy.lexer=f,T.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var F=f.yylloc;n.push(F);var oe=f.options&&f.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ae(N){r.length=r.length-2*N,l.length=l.length-N,n.length=n.length-N}a(ae,"popStack");function ee(){var N;return N=o.pop()||f.lex()||V,typeof N!="number"&&(N instanceof Array&&(o=N,N=o.pop()),N=t.symbols_[N]||N),N}a(ee,"lex");for(var _,x,D,G,O={},$,k,te,U;;){if(x=r[r.length-1],this.defaultActions[x]?D=this.defaultActions[x]:((_===null||typeof _>"u")&&(_=ee()),D=E[x]&&E[x][_]),typeof D>"u"||!D.length||!D[0]){var H="";U=[];for($ in E[x])this.terminals_[$]&&$>se&&U.push("'"+this.terminals_[$]+"'");f.showPosition?H="Parse error on line "+(A+1)+`:
|
|
2
2
|
`+f.showPosition()+`
|
|
3
3
|
Expecting `+U.join(", ")+", got '"+(this.terminals_[_]||_)+"'":H="Parse error on line "+(A+1)+": Unexpected "+(_==V?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(H,{text:f.match,token:this.terminals_[_]||_,line:f.yylineno,loc:F,expected:U})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+_);switch(D[0]){case 1:r.push(_),l.push(f.yytext),n.push(f.yylloc),r.push(D[1]),_=null,K=f.yyleng,d=f.yytext,A=f.yylineno,F=f.yylloc;break;case 2:if(k=this.productions_[D[1]][1],O.$=l[l.length-k],O._$={first_line:n[n.length-(k||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(k||1)].first_column,last_column:n[n.length-1].last_column},oe&&(O._$.range=[n[n.length-(k||1)].range[0],n[n.length-1].range[1]]),G=this.performAction.apply(O,[d,K,A,T.yy,D[1],l,n].concat(re)),typeof G<"u")return G;k&&(r=r.slice(0,-1*k*2),l=l.slice(0,-1*k),n=n.slice(0,-1*k)),r.push(this.productions_[D[1]][0]),l.push(O.$),n.push(O._$),te=E[r[r.length-2]][r[r.length-1]],r.push(te);break;case 3:return!0}}return!0},"parse")},ie=function(){var S={EOF:1,parseError:a(function(t,r){if(this.yy.parser)this.yy.parser.parseError(t,r);else throw new Error(t)},"parseError"),setInput:a(function(t,r){return this.yy=r||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:a(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var r=t.match(/(?:\r\n?|\n).*/g);return r?(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:a(function(t){var r=t.length,o=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var l=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),o.length-1&&(this.yylineno-=o.length-1);var n=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:o?(o.length===l.length?this.yylloc.first_column:0)+l[l.length-o.length].length-o[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(t){this.unput(this.match.slice(t))},"less"),pastInput:a(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:a(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:a(function(){var t=this.pastInput(),r=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|