orbitchat 3.2.2 → 3.2.3

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.
Files changed (56) hide show
  1. package/dist/assets/{ChartRenderer-Dd-iDllj.js → ChartRenderer-BRZDGKXb.js} +1 -1
  2. package/dist/assets/{MermaidRenderer-b4CLxUY2.js → MermaidRenderer-By9E8Mka.js} +5 -5
  3. package/dist/assets/{MusicRenderer-46pIMJgC.js → MusicRenderer-CUeKRk9_.js} +2 -2
  4. package/dist/assets/{SVGRenderer-DPXNm96K.js → SVGRenderer-XqSV-WtQ.js} +1 -1
  5. package/dist/assets/{_basePickBy-CRNU2oh3.js → _basePickBy-Hf4aXm85.js} +1 -1
  6. package/dist/assets/{_baseUniq-D4EnRRPg.js → _baseUniq-D1bNmnwz.js} +1 -1
  7. package/dist/assets/{architectureDiagram-VXUJARFQ-Bmsde5Ld.js → architectureDiagram-VXUJARFQ-BVxn4r6b.js} +1 -1
  8. package/dist/assets/{blockDiagram-VD42YOAC-DkNKZeTU.js → blockDiagram-VD42YOAC-BkjBdjdz.js} +1 -1
  9. package/dist/assets/{c4Diagram-YG6GDRKO-Bxm9TWfp.js → c4Diagram-YG6GDRKO-DN9C0J4c.js} +1 -1
  10. package/dist/assets/channel-YSaYGfvU.js +1 -0
  11. package/dist/assets/{chunk-4BX2VUAB-Cid1RCdG.js → chunk-4BX2VUAB-DQjaxTxC.js} +1 -1
  12. package/dist/assets/{chunk-55IACEB6-DaMm9Sm9.js → chunk-55IACEB6-BAPmvzOA.js} +1 -1
  13. package/dist/assets/{chunk-B4BG7PRW-NJo0ZYrW.js → chunk-B4BG7PRW-BKn58Q3T.js} +1 -1
  14. package/dist/assets/{chunk-DI55MBZ5-DnBh4BcT.js → chunk-DI55MBZ5-D4T4cEvk.js} +1 -1
  15. package/dist/assets/{chunk-FMBD7UC4-C7uryJc0.js → chunk-FMBD7UC4-BBSfVL96.js} +1 -1
  16. package/dist/assets/{chunk-QN33PNHL-B359CDxs.js → chunk-QN33PNHL-2G6RGO0y.js} +1 -1
  17. package/dist/assets/{chunk-QZHKN3VN-BWKYBRsr.js → chunk-QZHKN3VN-3HkuNyaC.js} +1 -1
  18. package/dist/assets/{chunk-TZMSLE5B-BnBaUsND.js → chunk-TZMSLE5B-CGP8AgQu.js} +1 -1
  19. package/dist/assets/classDiagram-2ON5EDUG-DwTYgLtI.js +1 -0
  20. package/dist/assets/classDiagram-v2-WZHVMYZB-DwTYgLtI.js +1 -0
  21. package/dist/assets/clone-Dnm1uDjE.js +1 -0
  22. package/dist/assets/{cose-bilkent-S5V4N54A-Cn-0Rw3G.js → cose-bilkent-S5V4N54A-CjviFb5r.js} +1 -1
  23. package/dist/assets/{dagre-6UL2VRFP-BCy9sHJ_.js → dagre-6UL2VRFP-jOmi_c5R.js} +1 -1
  24. package/dist/assets/{diagram-PSM6KHXK-B0RMr1QC.js → diagram-PSM6KHXK-Dbp2IHQD.js} +1 -1
  25. package/dist/assets/{diagram-QEK2KX5R-Czad37E-.js → diagram-QEK2KX5R-BZYMok2J.js} +1 -1
  26. package/dist/assets/{diagram-S2PKOQOG-BdCIoL2c.js → diagram-S2PKOQOG-BrYZPEzc.js} +1 -1
  27. package/dist/assets/{erDiagram-Q2GNP2WA-B2v4aP_x.js → erDiagram-Q2GNP2WA-IzmpSNLX.js} +1 -1
  28. package/dist/assets/{flowDiagram-NV44I4VS-DKCjGiV2.js → flowDiagram-NV44I4VS-ah9osuE0.js} +1 -1
  29. package/dist/assets/{ganttDiagram-JELNMOA3-BM1BKdEi.js → ganttDiagram-JELNMOA3-4WG42_hu.js} +1 -1
  30. package/dist/assets/{gitGraphDiagram-V2S2FVAM--qI83Qf3.js → gitGraphDiagram-V2S2FVAM-_RIhHlSv.js} +1 -1
  31. package/dist/assets/{graph-DGfbBQxw.js → graph-CFhrCHAV.js} +1 -1
  32. package/dist/assets/{index-wu56yLEv.js → index-CX9xMrSE.js} +3 -3
  33. package/dist/assets/{index-cUciQe5_.js → index-Cw8cvkPe.js} +1 -1
  34. package/dist/assets/{infoDiagram-HS3SLOUP-DR_pKdtU.js → infoDiagram-HS3SLOUP-BGPObwg6.js} +1 -1
  35. package/dist/assets/{journeyDiagram-XKPGCS4Q-BcQ7sw-c.js → journeyDiagram-XKPGCS4Q-sVlgPfoV.js} +1 -1
  36. package/dist/assets/{kanban-definition-3W4ZIXB7-BUiYb7qQ.js → kanban-definition-3W4ZIXB7-B6QL8dmg.js} +1 -1
  37. package/dist/assets/{layout-D7FT5Uin.js → layout-kIMg9Yn-.js} +1 -1
  38. package/dist/assets/{mindmap-definition-VGOIOE7T-HTGX5tJM.js → mindmap-definition-VGOIOE7T-DQcLpIVB.js} +1 -1
  39. package/dist/assets/{pieDiagram-ADFJNKIX-C_PvxCSB.js → pieDiagram-ADFJNKIX-DjIo_IMA.js} +1 -1
  40. package/dist/assets/{quadrantDiagram-AYHSOK5B-DDhOIPoW.js → quadrantDiagram-AYHSOK5B-PlJT0Z8S.js} +1 -1
  41. package/dist/assets/{requirementDiagram-UZGBJVZJ-ClMyTh5u.js → requirementDiagram-UZGBJVZJ-jomV-cLl.js} +1 -1
  42. package/dist/assets/{sankeyDiagram-TZEHDZUN-BMLYipN_.js → sankeyDiagram-TZEHDZUN-Iih_Xpcv.js} +1 -1
  43. package/dist/assets/{sequenceDiagram-WL72ISMW-COwoFwcs.js → sequenceDiagram-WL72ISMW-pXhWBhIr.js} +1 -1
  44. package/dist/assets/{stateDiagram-FKZM4ZOC-CGM_7Cjh.js → stateDiagram-FKZM4ZOC-D8rwumaR.js} +1 -1
  45. package/dist/assets/stateDiagram-v2-4FDKWEC3-Dhf-0JeR.js +1 -0
  46. package/dist/assets/{timeline-definition-IT6M3QCI-C0EQUFm0.js → timeline-definition-IT6M3QCI-BJxh2E6G.js} +1 -1
  47. package/dist/assets/treemap-GDKQZRPO-BDXLLe9-.js +160 -0
  48. package/dist/assets/{xychartDiagram-PRI3JC2R-DPhl7kC1.js → xychartDiagram-PRI3JC2R-CgiuaYJ-.js} +1 -1
  49. package/dist/index.html +1 -1
  50. package/package.json +1 -1
  51. package/dist/assets/channel-DeMez_Hj.js +0 -1
  52. package/dist/assets/classDiagram-2ON5EDUG-BzXv5fTq.js +0 -1
  53. package/dist/assets/classDiagram-v2-WZHVMYZB-BzXv5fTq.js +0 -1
  54. package/dist/assets/clone-BMsGBMed.js +0 -1
  55. package/dist/assets/stateDiagram-v2-4FDKWEC3-CKgQtgpH.js +0 -1
  56. package/dist/assets/treemap-GDKQZRPO-BXbe6QGJ.js +0 -160
@@ -1,4 +1,4 @@
1
- import{g as ss}from"./index-wu56yLEv.js";function cs(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in e)){const n=Object.getOwnPropertyDescriptor(a,i);n&&Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var os="6.6.2",ls=os,hs=function(e,t){var r=this;if(t||(t={}),r.qpm=t.qpm?parseInt(t.qpm,10):null,!r.qpm){var a=e.metaText?e.metaText.tempo:null;r.qpm=e.getBpm(a)}r.extraMeasuresAtBeginning=t.extraMeasuresAtBeginning?parseInt(t.extraMeasuresAtBeginning,10):0,r.beatCallback=t.beatCallback,r.eventCallback=t.eventCallback,r.lineEndCallback=t.lineEndCallback,r.lineEndAnticipation=t.lineEndAnticipation?parseInt(t.lineEndAnticipation,10):0,r.beatSubdivisions=t.beatSubdivisions?parseInt(t.beatSubdivisions,10):1,r.beatSubdivisions||(r.beatSubdivisions=1),r.joggerTimer=null,r.replaceTarget=function(n){if(r.noteTimings=n.setTiming(r.qpm,r.extraMeasuresAtBeginning),n.noteTimings.length===0&&(r.noteTimings=n.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=fs(n.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;var s=n.getMeter(),c="";if(s&&s.type==="specified"&&s.value&&s.value.length>0&&s.value[0].num.indexOf("+")>0&&(c=s.value[0].num),r.beatStarts=[],c){for(var o=r.noteTimings[r.noteTimings.length-1].millisecondsPerMeasure,f=r.lastMoment/o,u=c.split("+"),l=0;l<u.length;l++)u[l]=parseInt(u[l],10)/2;for(var h=0,d=0,p=0;p<f;p++)for(var g=p*o,v=0,m=0;m<u.length;m++){var y=u[m];if(r.beatSubdivisions===1)r.beatSubdivisions===1&&h<r.lastMoment&&r.beatStarts.push({b:d,ts:h}),h+=y*r.millisecondsPerBeat;else for(var x=y*r.beatSubdivisions,b=0;b<Math.floor(x);b++){var w=b/x,C=Math.round(g+v*r.millisecondsPerBeat);C<r.lastMoment&&r.beatStarts.push({b:d+w,ts:C}),v++}d++}r.beatStarts.push({b:f*u.length,ts:r.lastMoment}),r.totalBeats=r.beatStarts.length}else{r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat);for(var T=0;T<r.totalBeats+1;T++)r.beatStarts.push({b:T/r.beatSubdivisions,ts:Math.round(T*r.millisecondsPerBeat)})}}},r.replaceTarget(e),r.doTiming=function(n){if(r.lastTimestamp!==n&&(r.lastTimestamp=n,!r.isPaused&&r.isRunning)){for(r.startTime||(r.startTime=n),r.currentTime=n-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 s=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),s!==r.startTime&&(r.currentTime=n-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 c=r.noteTimings[r.currentEvent].milliseconds===r.currentTime?r.noteTimings[r.currentEvent]:r.noteTimings[r.currentEvent-1];r.lineEndCallback(r.lineEndTimings[r.currentLine],c,{line:r.currentLine,endTimings:r.lineEndTimings,currentTime:r.currentTime}),r.currentLine++}if(r.currentTime<r.lastMoment){if(requestAnimationFrame(r.doTiming),r.currentBeat<r.beatStarts.length&&r.beatStarts[r.currentBeat].ts<=r.currentTime){var o=r.doBeatCallback(n);r.currentBeat++,o!==null&&(r.currentTime=o)}}else if(r.currentBeat<=r.totalBeats&&r.beatCallback){var f=r.doBeatCallback(n);r.currentBeat++,f!==null&&(r.currentTime=f),requestAnimationFrame(r.doTiming)}if(r.currentTime>=r.lastMoment)if(r.eventCallback){var u=r.eventCallback(null);r.shouldStop(u).then(function(l){l&&r.stop()})}else r.stop()}},r.shouldStop=function(n){return new Promise(function(s){if(!n)return s(!0);if(n==="continue")return s(!1);n.then&&n.then(function(c){s(c!=="continue")})})},r.doBeatCallback=function(n){if(r.beatCallback){for(var s=r.currentEvent;s<r.noteTimings.length&&r.noteTimings[s].left===null;)s++;var c,o;if(s<r.noteTimings.length){for(c=r.noteTimings[s].milliseconds,s=Math.max(0,r.currentEvent-1);s>=0&&r.noteTimings[s].left===null;)s--;o=r.noteTimings[s]}var f={},u={};if(o){f.top=o.top,f.height=o.height;var l=Math.max(0,n-r.startTime-o.milliseconds),h=c-o.milliseconds,d=o.endX-o.left,p=h?l*d/h:0;f.left=o.left+p,r.currentEvent===0&&o.milliseconds>n-r.startTime&&(f.left=void 0),u={timestamp:n,startTime:r.startTime,ev:o,endMs:c,offMs:l,offPx:p,gapMs:h,gapPx:d}}else u={timestamp:n,startTime:r.startTime};var g=r.startTime;if(r.beatCallback(r.beatStarts[r.currentBeat].b,r.totalBeats/r.beatSubdivisions,r.lastMoment,f,u),g!==r.startTime)return n-r.startTime}return null};var i=60;r.animationJogger=function(){r.isRunning&&(r.doTiming(performance.now()),r.joggerTimer=setTimeout(r.animationJogger,i))},r.start=function(n,s){if(r.isRunning=!0,r.isPaused&&(r.isPaused=!1,n===void 0&&(r.justUnpaused=!0)),n)r.setProgress(n,s);else if(n===0)r.reset();else if(r.pausedPercent!==null){var c=performance.now();r.currentTime=r.lastMoment*r.pausedPercent,r.startTime=c-r.currentTime,r.pausedPercent=null,r.reportNext=!0}requestAnimationFrame(r.doTiming),r.joggerTimer=setTimeout(r.animationJogger,i)},r.pause=function(){r.isPaused=!0;var n=performance.now();r.pausedPercent=(n-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(n,s){var c;switch(s){case"seconds":r.currentTime=n*1e3,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),c=r.currentTime/r.lastMoment;break;case"beats":r.currentTime=n*r.millisecondsPerBeat*r.beatSubdivisions,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),c=r.currentTime/r.lastMoment;break;default:c=n,c<0&&(c=0),c>1&&(c=1),r.currentTime=r.lastMoment*c;break}r.isRunning||(r.pausedPercent=c);var o=performance.now();for(r.startTime=o-r.currentTime,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 f=r.currentBeat;for(r.currentBeat=0;r.currentBeat<r.beatStarts.length&&!(r.beatStarts[r.currentBeat].ts>r.currentTime);r.currentBeat++);r.currentBeat--,r.beatCallback&&f!==r.currentBeat&&(r.doBeatCallback(r.startTime+r.currentTime),r.currentBeat++),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,i)}};function fs(e,t){for(var r=[],a=null,i=0;i<e.length;i++){var n=e[i];n.type!=="end"&&n.top!==a&&(r.push({measureNumber:n.measureNumber,milliseconds:n.milliseconds-t,top:n.top,bottom:n.top+n.height}),a=n.top)}return r}var $r=hs,us=$r,X0={};(function(){var e,t;X0.startAnimation=function(r,a,i){e&&(e.stop(),e=void 0),i.showCursor&&(t=r.querySelector(".abcjs-cursor"),t||(t=document.createElement("DIV"),t.className="abcjs-cursor cursor",t.style.position="absolute",r.appendChild(t),r.style.position="relative"));function n(h){for(var d=0;d<h.length;d++){var p=h[d];p.classList.contains("abcjs-bar")||(p.style.display="none")}}var s;function c(h){if(s){var d=r.querySelectorAll(s);n(d)}s=h}function o(h){var d=r.querySelectorAll(h);n(d)}function f(h){i.hideCurrentMeasure?o(h):i.hideFinishedMeasures&&c(h)}function u(h){return".abcjs-l"+h.line+".abcjs-m"+h.measureNumber}function l(h){if(h){if(h.measureStart){var d=u(h);d&&f(d)}t&&(t.style.left=h.left+"px",t.style.top=h.top+"px",t.style.width=h.width+"px",t.style.height=h.height+"px")}else e.stop(),e=void 0}e=new us(a,{qpm:i.bpm,eventCallback:l}),e.start()},X0.pauseAnimation=function(r){e&&(r?e.pause():e.start())},X0.stopAnimation=function(){e&&(e.stop(),e=void 0)}})();var ds=X0,lt={};lt.cloneArray=function(e){for(var t=[],r=0;r<e.length;r++)t.push(Object.assign({},e[r]));return t};lt.cloneHashOfHash=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=Object.assign({},e[r]));return t};lt.cloneHashOfArrayOfHash=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=lt.cloneArray(e[r]));return t};lt.strip=function(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")};lt.startsWith=function(e,t){return e.indexOf(t)===0};lt.endsWith=function(e,t){var r=e.length-t.length;return r>=0&&e.lastIndexOf(t)===r};lt.last=function(e){return e.length===0?null:e[e.length-1]};var rt=lt,da=rt,At={};(function(){var e,t,r,a,i;At.initialize=function(k,_,L,A,R){e=k,t=_,r=L,a=A,i=R,n()};function n(){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"},a.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},a.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},a.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},a.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},a.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},a.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},a.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},a.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},a.formatting.annotationfont=r.annotationfont,a.formatting.gchordfont=r.gchordfont,a.formatting.historyfont=r.historyfont,a.formatting.infofont=r.infofont,a.formatting.measurefont=r.measurefont,a.formatting.partsfont=r.partsfont,a.formatting.repeatfont=r.repeatfont,a.formatting.textfont=r.textfont,a.formatting.tripletfont=r.tripletfont,a.formatting.vocalfont=r.vocalfont,a.formatting.wordsfont=r.wordsfont}var s={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},c=function(k){switch(k){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}},o=function(k,_,L,A,R){function V(){var Ae=parseInt(k[0].token);return k.shift(),_?k.length===0?{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae}:k.length===1&&k[0].token==="box"&&s[R]?{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae,box:!0}:(t("Extra parameters in font definition.",L,A),{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae}):(t("Can't set just the size of the font since there is no default value.",L,A),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:Ae})}if(k[0].token==="*"){if(k.shift(),k[0].type==="number")return V();t("Expected font size number after *.",L,A)}if(k[0].type==="number")return V();for(var Q=[],le,Qe="normal",Ye="normal",Me="none",me=!1,q="face",Ie=!1;k.length;){var te=k.shift(),Z=te.token.toLowerCase();switch(q){case"face":Ie||Z!=="utf"&&te.type!=="number"&&Z!=="bold"&&Z!=="italic"&&Z!=="underline"&&Z!=="box"?Q.length>0&&te.token==="-"?(Ie=!0,Q[Q.length-1]=Q[Q.length-1]+te.token):Ie?(Ie=!1,Q[Q.length-1]=Q[Q.length-1]+te.token):Q.push(te.token):te.type==="number"?(le?t("Font size specified twice in font definition.",L,A):le=te.token,q="modifier"):Z==="bold"?Qe="bold":Z==="italic"?Ye="italic":Z==="underline"?Me="underline":Z==="box"?(s[R]?me=!0:t(`This font style doesn't support "box"`,L,A),q="finished"):Z==="utf"?(te=k.shift(),q="size"):t("Unknown parameter "+te.token+" in font definition.",L,A);break;case"size":te.type==="number"?le?t("Font size specified twice in font definition.",L,A):le=te.token:t("Expected font size in font definition.",L,A),q="modifier";break;case"modifier":Z==="bold"?Qe="bold":Z==="italic"?Ye="italic":Z==="underline"?Me="underline":Z==="box"?(s[R]?me=!0:t(`This font style doesn't support "box"`,L,A),q="finished"):t("Unknown parameter "+te.token+" in font definition.",L,A);break;case"finished":t('Extra characters found after "box" in font definition.',L,A);break}}le===void 0?_?le=_.size:(t("Must specify the size of the font since there is no default value.",L,A),le=12):le=parseFloat(le),Q=Q.join(" "),Q===""&&(_?Q=_.face:(t("Must specify the name of the font since there is no default value.",L,A),Q="sans-serif"));var ge=c(Q),ce={};return ge?(ce.face=ge.face,ce.weight=ge.weight,ce.style=ge.style,ce.decoration=ge.decoration,ce.size=le,me&&(ce.box=!0),ce):(ce.face=Q,ce.weight=Qe,ce.style=Ye,ce.decoration=Me,ce.size=le,me&&(ce.box=!0),ce)},f=function(k,_,L){return _.length===0?'Directive "'+k+'" requires a font as a parameter.':(r[k]=o(_,r[k],L,0,k),r.is_in_header&&(a.formatting[k]=r[k]),null)},u=function(k,_,L){return _.length===0?'Directive "'+k+'" requires a font as a parameter.':(a.formatting[k]=o(_,a.formatting[k],L,0,k),null)},l=function(k,_){var L="";_.forEach(function(R){L+=R.token});var A=parseFloat(L);if(isNaN(A)||A===0)return'Directive "'+k+'" requires a number as a parameter.';a.formatting.scale=A},h=["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"],d=function(k){var _=k.split(/\s+/);if(_.length!==2&&_.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var L=_[0],A=parseInt(_[1],10);if((isNaN(A)||A<35||A>81)&&_[1]&&(A=h.indexOf(_[1].toLowerCase())+35),isNaN(A)||A<35||A>81)return{error:'Expected drum name, received "'+_[1]+'"'};var R={sound:A};return _.length===3&&(R.noteHead=_[2]),{key:L,value:R}},p=function(k,_){var L=e.getMeasurement(_);return L.used===0||_.length!==0?{error:'Directive "'+k+'" requires a measurement as a parameter.'}:L.value},g=function(k,_){var L=e.getMeasurement(_);return L.used===0||_.length!==0?'Directive "'+k+'" requires a measurement as a parameter.':(a.formatting[k]=L.value,null)},v=function(k,_,L,A,R){if(L.length!==1||L[0].type!=="number")return'Directive "'+_+'" requires a number as a parameter.';var V=L[0].intt;return A!==void 0&&V<A?'Directive "'+_+'" requires a number greater than or equal to '+A+" as a parameter.":R!==void 0&&V>R?'Directive "'+_+'" requires a number less than or equal to '+R+" as a parameter.":(r[k]=V,null)},m=function(k,_,L){if(L.length===1&&(L[0].token==="true"||L[0].token==="false"))return r[k]=L[0].token==="true",null;var A=v(k,_,L,0,1);return A!==null?A:(r[k]=r[k]===1,null)},y=function(k,_,L,A){if(L.length!==1)return'Directive "'+_+'" requires one of [ '+A.join(", ")+" ] as a parameter.";for(var R=L[0].token,V=!1,Q=0;!V&&Q<A.length;Q++)A[Q]===R&&(V=!0);return V?(r[k]=R,null):'Directive "'+_+'" requires one of [ '+A.join(", ")+" ] as a parameter."},x=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],b=["gchord","ptstress","beatstring"],w=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],C=["program"],T=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],B=["beat"],E=["drone"],z=["portamento"],I=["expand","grace","trim"],F=["drum","chordname"],G=["bassprog","chordprog"],Y=function(k,_,L){var A=k.shift().token,R=[];if(x.indexOf(A)>=0)k.length!==0&&t("Unexpected parameter in MIDI "+A,L,0);else if(b.indexOf(A)>=0)k.length!==1?t("Expected one parameter in MIDI "+A,L,0):R.push(k[0].token);else if(w.indexOf(A)>=0)k.length!==1?t("Expected one parameter in MIDI "+A,L,0):k[0].type!=="number"?t("Expected one integer parameter in MIDI "+A,L,0):R.push(k[0].intt);else if(C.indexOf(A)>=0)k.length!==1&&k.length!==2?t("Expected one or two parameters in MIDI "+A,L,0):k[0].type!=="number"||k.length===2&&k[1].type!=="number"?t("Expected integer parameter in MIDI "+A,L,0):(R.push(k[0].intt),k.length===2&&R.push(k[1].intt));else if(T.indexOf(A)>=0)k.length!==2?t("Expected two parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"?t("Expected two integer parameters in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[1].intt));else if(z.indexOf(A)>=0)k.length!==2?t("Expected two parameters in MIDI "+A,L,0):k[0].type!=="alpha"||k[1].type!=="number"?t("Expected one string and one integer parameters in MIDI "+A,L,0):(R.push(k[0].token),R.push(k[1].intt));else if(A==="drummap")k.length===2&&k[0].type==="alpha"&&k[1].type==="number"?(_.formatting||(_.formatting={}),_.formatting.midi||(_.formatting.midi={}),_.formatting.midi.drummap||(_.formatting.midi.drummap={}),_.formatting.midi.drummap[k[0].token]=k[1].intt,R=_.formatting.midi.drummap):k.length===3&&k[0].type==="punct"&&k[1].type==="alpha"&&k[2].type==="number"?(_.formatting||(_.formatting={}),_.formatting.midi||(_.formatting.midi={}),_.formatting.midi.drummap||(_.formatting.midi.drummap={}),_.formatting.midi.drummap[k[0].token+k[1].token]=k[2].intt,R=_.formatting.midi.drummap):t("Expected one note name and one integer parameter in MIDI "+A,L,0);else if(I.indexOf(A)>=0)k.length!==3||k[0].type!=="number"||k[1].token!=="/"||k[2].type!=="number"?t("Expected fraction parameter in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[2].intt));else if(B.indexOf(A)>=0)k.length!==4?t("Expected four parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"||k[2].type!=="number"||k[3].type!=="number"?t("Expected four integer parameters in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[1].intt),R.push(k[2].intt),R.push(k[3].intt));else if(E.indexOf(A)>=0)k.length!==5?t("Expected five parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"||k[2].type!=="number"||k[3].type!=="number"||k[4].type!=="number"?t("Expected five integer parameters in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[1].intt),R.push(k[2].intt),R.push(k[3].intt),R.push(k[4].intt));else if(C.indexOf(A)>=0)k.length!==1||k.length!==4?t("Expected one or two parameters in MIDI "+A,L,0):k[0].type!=="number"?t("Expected integer parameter in MIDI "+A,L,0):k.length===4?(k[1].token!=="octave"&&t("Expected octave parameter in MIDI "+A,L,0),k[2].token!=="="&&t("Expected octave parameter in MIDI "+A,L,0),k[3].type!=="number"&&t("Expected integer parameter for octave in MIDI "+A,L,0)):(R.push(k[0].intt),k.length===4&&R.push(k[3].intt));else if(F.indexOf(A)>=0)if(k.length<2)t("Expected string parameter and at least one integer parameter in MIDI "+A,L,0);else if(k[0].type!=="alpha")t("Expected string parameter and at least one integer parameter in MIDI "+A,L,0);else{var V=k.shift();for(R.push(V.token);k.length>0;)V=k.shift(),V.type!=="number"&&t("Expected integer parameter in MIDI "+A,L,0),R.push(V.intt)}else if(G.indexOf(A)>=0){if(k.length!==1&&k.length!==2)t("Expected one or two parameters in MIDI "+A,L,0);else if(k[0].type!=="number")t("Expected integer parameter in MIDI "+A,L,0);else if(k.length===2&&k[1].type!=="alpha")t("Expected alpha parameter in MIDI "+A,L,0);else if(R.push(k[0].intt),k.length===2){var Q=k[1].token;Q.indexOf("octave=")!=-1?(Q=Q.replace("octave=",""),Q=parseInt(Q),isNaN(Q)?t("Expected octave value in MIDI"+A):(Q<-1&&(t("Expected octave= in MIDI "+A+" to be >= -1 (recv:"+Q+")"),Q=-1),Q>3&&(t("Expected octave= in MIDI "+A+" to be <= 3 (recv:"+Q+")"),Q=3),R.push(Q))):t("Expected octave= in MIDI"+A)}}i.hasBeginMusic()?i.appendElement("midi",-1,-1,{cmd:A,params:R}):(_.formatting.midi===void 0&&(_.formatting.midi={}),_.formatting.midi[A]=R)};At.parseFontChangeLine=function(k){k=k.replace(/\$\$/g,"");var _=k.split("$");if(_.length>1&&r.setfont){var L=[];_[0]!==""&&L.push({text:_[0]});for(var A=1;A<_.length;A++)if(_[A][0]==="0")L.push({text:_[A].substring(1).replace(/\x03/g,"$$")});else{var R=parseInt(_[A][0],10);r.setfont[R]?L.push({font:r.setfont[R],text:_[A].substring(1).replace(/\x03/g,"$$")}):L[L.length-1].text+="$"+_[A].replace(/\x03/g,"$$")}return L}return k.replace(/\x03/g,"$$")};var K=["auto","above","below","hidden"];At.addDirective=function(k){var _=e.tokenize(k,0,k.length);if(_.length===0||_[0].type!=="alpha")return null;var L=k.substring(k.indexOf(_[0].token)+_[0].token.length);L=e.stripComment(L);var A=_.shift().token.toLowerCase(),R="",V;switch(A){case"bagpipes":a.formatting.bagpipes=!0;break;case"flatbeams":a.formatting.flatbeams=!0;break;case"jazzchords":a.formatting.jazzchords=!0;break;case"accentAbove":a.formatting.accentAbove=!0;break;case"germanAlphabet":a.formatting.germanAlphabet=!0;break;case"landscape":r.landscape=!0;break;case"papersize":r.papersize=L;break;case"graceslurs":if(_.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(_[0].token==="0"||_[0].token==="false")a.formatting.graceSlurs=!1;else if(_[0].token==="1"||_[0].token==="true")a.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+_[0].token+")";break;case"lineThickness":var Q=P(_);if(Q.value!==void 0&&(a.formatting.lineThickness=Q.value),Q.error)return Q.error;break;case"stretchlast":var le=P(_);if(le.value!==void 0&&(a.formatting.stretchlast=le.value),le.error)return le.error;break;case"titlecaps":r.titlecaps=!0;break;case"titleleft":a.formatting.titleleft=!0;break;case"measurebox":a.formatting.measurebox=!0;break;case"vocal":return y("vocalPosition",A,_,K);case"dynamic":return y("dynamicPosition",A,_,K);case"gchord":return y("chordPosition",A,_,K);case"ornament":return y("ornamentPosition",A,_,K);case"volume":return y("volumePosition",A,_,K);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 g(A,_);case"voicescale":if(_.length!==1||_[0].type!=="number")return"voicescale requires one float as a parameter";var Qe=_.shift();return r.currentVoice&&(r.currentVoice.scale=Qe.floatt,i.changeVoiceScale(r.currentVoice.scale)),null;case"voicecolor":if(_.length!==1)return"voicecolor requires one string as a parameter";var Ye=_.shift();return r.currentVoice&&(r.currentVoice.color=Ye.token,i.changeVoiceColor(r.currentVoice.color)),null;case"vskip":var Me=Math.round(p(A,_));return Me.error?Me.error:(i.addSpacing(Me),null);case"scale":l(A,_);break;case"sep":if(_.length===0)i.addSeparator(14,14,85,{startChar:r.iChar,endChar:r.iChar+5});else{var me=e.getMeasurement(_);if(me.used===0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var q=me.value;if(me=e.getMeasurement(_),me.used===0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var Ie=me.value;if(me=e.getMeasurement(_),me.used===0||_.length!==0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var te=me.value;i.addSeparator(q,Ie,te,{startChar:r.iChar,endChar:r.iChar+L.length})}break;case"barsperstaff":if(R=v("barsperstaff",A,_),R!==null)return R;break;case"staffnonote":if(_.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(_[0].token==="0")r.staffnonote=!0;else if(_[0].token==="1")r.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+_[0].token+")";break;case"printtempo":if(R=m("printTempo",A,_),R!==null)return R;break;case"partsbox":if(R=m("partsBox",A,_),R!==null)return R;r.partsfont.box=r.partsBox;break;case"freegchord":if(R=m("freegchord",A,_),R!==null)return R;break;case"measurenb":case"barnumbers":if(R=v("barNumbers",A,_),R!==null)return R;break;case"setbarnb":if(_.length!==1||_[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";r.currBarNumber=i.setBarNumberImmediate(_[0].intt);break;case"keywarn":if(_.length!==1||_[0].type!=="number"||_[0].intt!==1&&_[0].intt!==0)return"Directive "+A+" requires 0 or 1 as a parameter.";r[A]=_[0].intt===1;break;case"begintext":var Z="";for(V=e.nextLine();V&&V.indexOf("%%endtext")!==0;){if(da.startsWith(V,"%%")){var ge=V.substring(2);ge=ge.trim()+`
1
+ import{g as ss}from"./index-CX9xMrSE.js";function cs(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in e)){const n=Object.getOwnPropertyDescriptor(a,i);n&&Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var os="6.6.2",ls=os,hs=function(e,t){var r=this;if(t||(t={}),r.qpm=t.qpm?parseInt(t.qpm,10):null,!r.qpm){var a=e.metaText?e.metaText.tempo:null;r.qpm=e.getBpm(a)}r.extraMeasuresAtBeginning=t.extraMeasuresAtBeginning?parseInt(t.extraMeasuresAtBeginning,10):0,r.beatCallback=t.beatCallback,r.eventCallback=t.eventCallback,r.lineEndCallback=t.lineEndCallback,r.lineEndAnticipation=t.lineEndAnticipation?parseInt(t.lineEndAnticipation,10):0,r.beatSubdivisions=t.beatSubdivisions?parseInt(t.beatSubdivisions,10):1,r.beatSubdivisions||(r.beatSubdivisions=1),r.joggerTimer=null,r.replaceTarget=function(n){if(r.noteTimings=n.setTiming(r.qpm,r.extraMeasuresAtBeginning),n.noteTimings.length===0&&(r.noteTimings=n.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=fs(n.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;var s=n.getMeter(),c="";if(s&&s.type==="specified"&&s.value&&s.value.length>0&&s.value[0].num.indexOf("+")>0&&(c=s.value[0].num),r.beatStarts=[],c){for(var o=r.noteTimings[r.noteTimings.length-1].millisecondsPerMeasure,f=r.lastMoment/o,u=c.split("+"),l=0;l<u.length;l++)u[l]=parseInt(u[l],10)/2;for(var h=0,d=0,p=0;p<f;p++)for(var g=p*o,v=0,m=0;m<u.length;m++){var y=u[m];if(r.beatSubdivisions===1)r.beatSubdivisions===1&&h<r.lastMoment&&r.beatStarts.push({b:d,ts:h}),h+=y*r.millisecondsPerBeat;else for(var x=y*r.beatSubdivisions,b=0;b<Math.floor(x);b++){var w=b/x,C=Math.round(g+v*r.millisecondsPerBeat);C<r.lastMoment&&r.beatStarts.push({b:d+w,ts:C}),v++}d++}r.beatStarts.push({b:f*u.length,ts:r.lastMoment}),r.totalBeats=r.beatStarts.length}else{r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat);for(var T=0;T<r.totalBeats+1;T++)r.beatStarts.push({b:T/r.beatSubdivisions,ts:Math.round(T*r.millisecondsPerBeat)})}}},r.replaceTarget(e),r.doTiming=function(n){if(r.lastTimestamp!==n&&(r.lastTimestamp=n,!r.isPaused&&r.isRunning)){for(r.startTime||(r.startTime=n),r.currentTime=n-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 s=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),s!==r.startTime&&(r.currentTime=n-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 c=r.noteTimings[r.currentEvent].milliseconds===r.currentTime?r.noteTimings[r.currentEvent]:r.noteTimings[r.currentEvent-1];r.lineEndCallback(r.lineEndTimings[r.currentLine],c,{line:r.currentLine,endTimings:r.lineEndTimings,currentTime:r.currentTime}),r.currentLine++}if(r.currentTime<r.lastMoment){if(requestAnimationFrame(r.doTiming),r.currentBeat<r.beatStarts.length&&r.beatStarts[r.currentBeat].ts<=r.currentTime){var o=r.doBeatCallback(n);r.currentBeat++,o!==null&&(r.currentTime=o)}}else if(r.currentBeat<=r.totalBeats&&r.beatCallback){var f=r.doBeatCallback(n);r.currentBeat++,f!==null&&(r.currentTime=f),requestAnimationFrame(r.doTiming)}if(r.currentTime>=r.lastMoment)if(r.eventCallback){var u=r.eventCallback(null);r.shouldStop(u).then(function(l){l&&r.stop()})}else r.stop()}},r.shouldStop=function(n){return new Promise(function(s){if(!n)return s(!0);if(n==="continue")return s(!1);n.then&&n.then(function(c){s(c!=="continue")})})},r.doBeatCallback=function(n){if(r.beatCallback){for(var s=r.currentEvent;s<r.noteTimings.length&&r.noteTimings[s].left===null;)s++;var c,o;if(s<r.noteTimings.length){for(c=r.noteTimings[s].milliseconds,s=Math.max(0,r.currentEvent-1);s>=0&&r.noteTimings[s].left===null;)s--;o=r.noteTimings[s]}var f={},u={};if(o){f.top=o.top,f.height=o.height;var l=Math.max(0,n-r.startTime-o.milliseconds),h=c-o.milliseconds,d=o.endX-o.left,p=h?l*d/h:0;f.left=o.left+p,r.currentEvent===0&&o.milliseconds>n-r.startTime&&(f.left=void 0),u={timestamp:n,startTime:r.startTime,ev:o,endMs:c,offMs:l,offPx:p,gapMs:h,gapPx:d}}else u={timestamp:n,startTime:r.startTime};var g=r.startTime;if(r.beatCallback(r.beatStarts[r.currentBeat].b,r.totalBeats/r.beatSubdivisions,r.lastMoment,f,u),g!==r.startTime)return n-r.startTime}return null};var i=60;r.animationJogger=function(){r.isRunning&&(r.doTiming(performance.now()),r.joggerTimer=setTimeout(r.animationJogger,i))},r.start=function(n,s){if(r.isRunning=!0,r.isPaused&&(r.isPaused=!1,n===void 0&&(r.justUnpaused=!0)),n)r.setProgress(n,s);else if(n===0)r.reset();else if(r.pausedPercent!==null){var c=performance.now();r.currentTime=r.lastMoment*r.pausedPercent,r.startTime=c-r.currentTime,r.pausedPercent=null,r.reportNext=!0}requestAnimationFrame(r.doTiming),r.joggerTimer=setTimeout(r.animationJogger,i)},r.pause=function(){r.isPaused=!0;var n=performance.now();r.pausedPercent=(n-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(n,s){var c;switch(s){case"seconds":r.currentTime=n*1e3,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),c=r.currentTime/r.lastMoment;break;case"beats":r.currentTime=n*r.millisecondsPerBeat*r.beatSubdivisions,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),c=r.currentTime/r.lastMoment;break;default:c=n,c<0&&(c=0),c>1&&(c=1),r.currentTime=r.lastMoment*c;break}r.isRunning||(r.pausedPercent=c);var o=performance.now();for(r.startTime=o-r.currentTime,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 f=r.currentBeat;for(r.currentBeat=0;r.currentBeat<r.beatStarts.length&&!(r.beatStarts[r.currentBeat].ts>r.currentTime);r.currentBeat++);r.currentBeat--,r.beatCallback&&f!==r.currentBeat&&(r.doBeatCallback(r.startTime+r.currentTime),r.currentBeat++),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,i)}};function fs(e,t){for(var r=[],a=null,i=0;i<e.length;i++){var n=e[i];n.type!=="end"&&n.top!==a&&(r.push({measureNumber:n.measureNumber,milliseconds:n.milliseconds-t,top:n.top,bottom:n.top+n.height}),a=n.top)}return r}var $r=hs,us=$r,X0={};(function(){var e,t;X0.startAnimation=function(r,a,i){e&&(e.stop(),e=void 0),i.showCursor&&(t=r.querySelector(".abcjs-cursor"),t||(t=document.createElement("DIV"),t.className="abcjs-cursor cursor",t.style.position="absolute",r.appendChild(t),r.style.position="relative"));function n(h){for(var d=0;d<h.length;d++){var p=h[d];p.classList.contains("abcjs-bar")||(p.style.display="none")}}var s;function c(h){if(s){var d=r.querySelectorAll(s);n(d)}s=h}function o(h){var d=r.querySelectorAll(h);n(d)}function f(h){i.hideCurrentMeasure?o(h):i.hideFinishedMeasures&&c(h)}function u(h){return".abcjs-l"+h.line+".abcjs-m"+h.measureNumber}function l(h){if(h){if(h.measureStart){var d=u(h);d&&f(d)}t&&(t.style.left=h.left+"px",t.style.top=h.top+"px",t.style.width=h.width+"px",t.style.height=h.height+"px")}else e.stop(),e=void 0}e=new us(a,{qpm:i.bpm,eventCallback:l}),e.start()},X0.pauseAnimation=function(r){e&&(r?e.pause():e.start())},X0.stopAnimation=function(){e&&(e.stop(),e=void 0)}})();var ds=X0,lt={};lt.cloneArray=function(e){for(var t=[],r=0;r<e.length;r++)t.push(Object.assign({},e[r]));return t};lt.cloneHashOfHash=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=Object.assign({},e[r]));return t};lt.cloneHashOfArrayOfHash=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=lt.cloneArray(e[r]));return t};lt.strip=function(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")};lt.startsWith=function(e,t){return e.indexOf(t)===0};lt.endsWith=function(e,t){var r=e.length-t.length;return r>=0&&e.lastIndexOf(t)===r};lt.last=function(e){return e.length===0?null:e[e.length-1]};var rt=lt,da=rt,At={};(function(){var e,t,r,a,i;At.initialize=function(k,_,L,A,R){e=k,t=_,r=L,a=A,i=R,n()};function n(){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"},a.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},a.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},a.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},a.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},a.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},a.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},a.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},a.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},a.formatting.annotationfont=r.annotationfont,a.formatting.gchordfont=r.gchordfont,a.formatting.historyfont=r.historyfont,a.formatting.infofont=r.infofont,a.formatting.measurefont=r.measurefont,a.formatting.partsfont=r.partsfont,a.formatting.repeatfont=r.repeatfont,a.formatting.textfont=r.textfont,a.formatting.tripletfont=r.tripletfont,a.formatting.vocalfont=r.vocalfont,a.formatting.wordsfont=r.wordsfont}var s={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},c=function(k){switch(k){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}},o=function(k,_,L,A,R){function V(){var Ae=parseInt(k[0].token);return k.shift(),_?k.length===0?{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae}:k.length===1&&k[0].token==="box"&&s[R]?{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae,box:!0}:(t("Extra parameters in font definition.",L,A),{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae}):(t("Can't set just the size of the font since there is no default value.",L,A),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:Ae})}if(k[0].token==="*"){if(k.shift(),k[0].type==="number")return V();t("Expected font size number after *.",L,A)}if(k[0].type==="number")return V();for(var Q=[],le,Qe="normal",Ye="normal",Me="none",me=!1,q="face",Ie=!1;k.length;){var te=k.shift(),Z=te.token.toLowerCase();switch(q){case"face":Ie||Z!=="utf"&&te.type!=="number"&&Z!=="bold"&&Z!=="italic"&&Z!=="underline"&&Z!=="box"?Q.length>0&&te.token==="-"?(Ie=!0,Q[Q.length-1]=Q[Q.length-1]+te.token):Ie?(Ie=!1,Q[Q.length-1]=Q[Q.length-1]+te.token):Q.push(te.token):te.type==="number"?(le?t("Font size specified twice in font definition.",L,A):le=te.token,q="modifier"):Z==="bold"?Qe="bold":Z==="italic"?Ye="italic":Z==="underline"?Me="underline":Z==="box"?(s[R]?me=!0:t(`This font style doesn't support "box"`,L,A),q="finished"):Z==="utf"?(te=k.shift(),q="size"):t("Unknown parameter "+te.token+" in font definition.",L,A);break;case"size":te.type==="number"?le?t("Font size specified twice in font definition.",L,A):le=te.token:t("Expected font size in font definition.",L,A),q="modifier";break;case"modifier":Z==="bold"?Qe="bold":Z==="italic"?Ye="italic":Z==="underline"?Me="underline":Z==="box"?(s[R]?me=!0:t(`This font style doesn't support "box"`,L,A),q="finished"):t("Unknown parameter "+te.token+" in font definition.",L,A);break;case"finished":t('Extra characters found after "box" in font definition.',L,A);break}}le===void 0?_?le=_.size:(t("Must specify the size of the font since there is no default value.",L,A),le=12):le=parseFloat(le),Q=Q.join(" "),Q===""&&(_?Q=_.face:(t("Must specify the name of the font since there is no default value.",L,A),Q="sans-serif"));var ge=c(Q),ce={};return ge?(ce.face=ge.face,ce.weight=ge.weight,ce.style=ge.style,ce.decoration=ge.decoration,ce.size=le,me&&(ce.box=!0),ce):(ce.face=Q,ce.weight=Qe,ce.style=Ye,ce.decoration=Me,ce.size=le,me&&(ce.box=!0),ce)},f=function(k,_,L){return _.length===0?'Directive "'+k+'" requires a font as a parameter.':(r[k]=o(_,r[k],L,0,k),r.is_in_header&&(a.formatting[k]=r[k]),null)},u=function(k,_,L){return _.length===0?'Directive "'+k+'" requires a font as a parameter.':(a.formatting[k]=o(_,a.formatting[k],L,0,k),null)},l=function(k,_){var L="";_.forEach(function(R){L+=R.token});var A=parseFloat(L);if(isNaN(A)||A===0)return'Directive "'+k+'" requires a number as a parameter.';a.formatting.scale=A},h=["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"],d=function(k){var _=k.split(/\s+/);if(_.length!==2&&_.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var L=_[0],A=parseInt(_[1],10);if((isNaN(A)||A<35||A>81)&&_[1]&&(A=h.indexOf(_[1].toLowerCase())+35),isNaN(A)||A<35||A>81)return{error:'Expected drum name, received "'+_[1]+'"'};var R={sound:A};return _.length===3&&(R.noteHead=_[2]),{key:L,value:R}},p=function(k,_){var L=e.getMeasurement(_);return L.used===0||_.length!==0?{error:'Directive "'+k+'" requires a measurement as a parameter.'}:L.value},g=function(k,_){var L=e.getMeasurement(_);return L.used===0||_.length!==0?'Directive "'+k+'" requires a measurement as a parameter.':(a.formatting[k]=L.value,null)},v=function(k,_,L,A,R){if(L.length!==1||L[0].type!=="number")return'Directive "'+_+'" requires a number as a parameter.';var V=L[0].intt;return A!==void 0&&V<A?'Directive "'+_+'" requires a number greater than or equal to '+A+" as a parameter.":R!==void 0&&V>R?'Directive "'+_+'" requires a number less than or equal to '+R+" as a parameter.":(r[k]=V,null)},m=function(k,_,L){if(L.length===1&&(L[0].token==="true"||L[0].token==="false"))return r[k]=L[0].token==="true",null;var A=v(k,_,L,0,1);return A!==null?A:(r[k]=r[k]===1,null)},y=function(k,_,L,A){if(L.length!==1)return'Directive "'+_+'" requires one of [ '+A.join(", ")+" ] as a parameter.";for(var R=L[0].token,V=!1,Q=0;!V&&Q<A.length;Q++)A[Q]===R&&(V=!0);return V?(r[k]=R,null):'Directive "'+_+'" requires one of [ '+A.join(", ")+" ] as a parameter."},x=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],b=["gchord","ptstress","beatstring"],w=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],C=["program"],T=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],B=["beat"],E=["drone"],z=["portamento"],I=["expand","grace","trim"],F=["drum","chordname"],G=["bassprog","chordprog"],Y=function(k,_,L){var A=k.shift().token,R=[];if(x.indexOf(A)>=0)k.length!==0&&t("Unexpected parameter in MIDI "+A,L,0);else if(b.indexOf(A)>=0)k.length!==1?t("Expected one parameter in MIDI "+A,L,0):R.push(k[0].token);else if(w.indexOf(A)>=0)k.length!==1?t("Expected one parameter in MIDI "+A,L,0):k[0].type!=="number"?t("Expected one integer parameter in MIDI "+A,L,0):R.push(k[0].intt);else if(C.indexOf(A)>=0)k.length!==1&&k.length!==2?t("Expected one or two parameters in MIDI "+A,L,0):k[0].type!=="number"||k.length===2&&k[1].type!=="number"?t("Expected integer parameter in MIDI "+A,L,0):(R.push(k[0].intt),k.length===2&&R.push(k[1].intt));else if(T.indexOf(A)>=0)k.length!==2?t("Expected two parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"?t("Expected two integer parameters in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[1].intt));else if(z.indexOf(A)>=0)k.length!==2?t("Expected two parameters in MIDI "+A,L,0):k[0].type!=="alpha"||k[1].type!=="number"?t("Expected one string and one integer parameters in MIDI "+A,L,0):(R.push(k[0].token),R.push(k[1].intt));else if(A==="drummap")k.length===2&&k[0].type==="alpha"&&k[1].type==="number"?(_.formatting||(_.formatting={}),_.formatting.midi||(_.formatting.midi={}),_.formatting.midi.drummap||(_.formatting.midi.drummap={}),_.formatting.midi.drummap[k[0].token]=k[1].intt,R=_.formatting.midi.drummap):k.length===3&&k[0].type==="punct"&&k[1].type==="alpha"&&k[2].type==="number"?(_.formatting||(_.formatting={}),_.formatting.midi||(_.formatting.midi={}),_.formatting.midi.drummap||(_.formatting.midi.drummap={}),_.formatting.midi.drummap[k[0].token+k[1].token]=k[2].intt,R=_.formatting.midi.drummap):t("Expected one note name and one integer parameter in MIDI "+A,L,0);else if(I.indexOf(A)>=0)k.length!==3||k[0].type!=="number"||k[1].token!=="/"||k[2].type!=="number"?t("Expected fraction parameter in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[2].intt));else if(B.indexOf(A)>=0)k.length!==4?t("Expected four parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"||k[2].type!=="number"||k[3].type!=="number"?t("Expected four integer parameters in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[1].intt),R.push(k[2].intt),R.push(k[3].intt));else if(E.indexOf(A)>=0)k.length!==5?t("Expected five parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"||k[2].type!=="number"||k[3].type!=="number"||k[4].type!=="number"?t("Expected five integer parameters in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[1].intt),R.push(k[2].intt),R.push(k[3].intt),R.push(k[4].intt));else if(C.indexOf(A)>=0)k.length!==1||k.length!==4?t("Expected one or two parameters in MIDI "+A,L,0):k[0].type!=="number"?t("Expected integer parameter in MIDI "+A,L,0):k.length===4?(k[1].token!=="octave"&&t("Expected octave parameter in MIDI "+A,L,0),k[2].token!=="="&&t("Expected octave parameter in MIDI "+A,L,0),k[3].type!=="number"&&t("Expected integer parameter for octave in MIDI "+A,L,0)):(R.push(k[0].intt),k.length===4&&R.push(k[3].intt));else if(F.indexOf(A)>=0)if(k.length<2)t("Expected string parameter and at least one integer parameter in MIDI "+A,L,0);else if(k[0].type!=="alpha")t("Expected string parameter and at least one integer parameter in MIDI "+A,L,0);else{var V=k.shift();for(R.push(V.token);k.length>0;)V=k.shift(),V.type!=="number"&&t("Expected integer parameter in MIDI "+A,L,0),R.push(V.intt)}else if(G.indexOf(A)>=0){if(k.length!==1&&k.length!==2)t("Expected one or two parameters in MIDI "+A,L,0);else if(k[0].type!=="number")t("Expected integer parameter in MIDI "+A,L,0);else if(k.length===2&&k[1].type!=="alpha")t("Expected alpha parameter in MIDI "+A,L,0);else if(R.push(k[0].intt),k.length===2){var Q=k[1].token;Q.indexOf("octave=")!=-1?(Q=Q.replace("octave=",""),Q=parseInt(Q),isNaN(Q)?t("Expected octave value in MIDI"+A):(Q<-1&&(t("Expected octave= in MIDI "+A+" to be >= -1 (recv:"+Q+")"),Q=-1),Q>3&&(t("Expected octave= in MIDI "+A+" to be <= 3 (recv:"+Q+")"),Q=3),R.push(Q))):t("Expected octave= in MIDI"+A)}}i.hasBeginMusic()?i.appendElement("midi",-1,-1,{cmd:A,params:R}):(_.formatting.midi===void 0&&(_.formatting.midi={}),_.formatting.midi[A]=R)};At.parseFontChangeLine=function(k){k=k.replace(/\$\$/g,"");var _=k.split("$");if(_.length>1&&r.setfont){var L=[];_[0]!==""&&L.push({text:_[0]});for(var A=1;A<_.length;A++)if(_[A][0]==="0")L.push({text:_[A].substring(1).replace(/\x03/g,"$$")});else{var R=parseInt(_[A][0],10);r.setfont[R]?L.push({font:r.setfont[R],text:_[A].substring(1).replace(/\x03/g,"$$")}):L[L.length-1].text+="$"+_[A].replace(/\x03/g,"$$")}return L}return k.replace(/\x03/g,"$$")};var K=["auto","above","below","hidden"];At.addDirective=function(k){var _=e.tokenize(k,0,k.length);if(_.length===0||_[0].type!=="alpha")return null;var L=k.substring(k.indexOf(_[0].token)+_[0].token.length);L=e.stripComment(L);var A=_.shift().token.toLowerCase(),R="",V;switch(A){case"bagpipes":a.formatting.bagpipes=!0;break;case"flatbeams":a.formatting.flatbeams=!0;break;case"jazzchords":a.formatting.jazzchords=!0;break;case"accentAbove":a.formatting.accentAbove=!0;break;case"germanAlphabet":a.formatting.germanAlphabet=!0;break;case"landscape":r.landscape=!0;break;case"papersize":r.papersize=L;break;case"graceslurs":if(_.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(_[0].token==="0"||_[0].token==="false")a.formatting.graceSlurs=!1;else if(_[0].token==="1"||_[0].token==="true")a.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+_[0].token+")";break;case"lineThickness":var Q=P(_);if(Q.value!==void 0&&(a.formatting.lineThickness=Q.value),Q.error)return Q.error;break;case"stretchlast":var le=P(_);if(le.value!==void 0&&(a.formatting.stretchlast=le.value),le.error)return le.error;break;case"titlecaps":r.titlecaps=!0;break;case"titleleft":a.formatting.titleleft=!0;break;case"measurebox":a.formatting.measurebox=!0;break;case"vocal":return y("vocalPosition",A,_,K);case"dynamic":return y("dynamicPosition",A,_,K);case"gchord":return y("chordPosition",A,_,K);case"ornament":return y("ornamentPosition",A,_,K);case"volume":return y("volumePosition",A,_,K);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 g(A,_);case"voicescale":if(_.length!==1||_[0].type!=="number")return"voicescale requires one float as a parameter";var Qe=_.shift();return r.currentVoice&&(r.currentVoice.scale=Qe.floatt,i.changeVoiceScale(r.currentVoice.scale)),null;case"voicecolor":if(_.length!==1)return"voicecolor requires one string as a parameter";var Ye=_.shift();return r.currentVoice&&(r.currentVoice.color=Ye.token,i.changeVoiceColor(r.currentVoice.color)),null;case"vskip":var Me=Math.round(p(A,_));return Me.error?Me.error:(i.addSpacing(Me),null);case"scale":l(A,_);break;case"sep":if(_.length===0)i.addSeparator(14,14,85,{startChar:r.iChar,endChar:r.iChar+5});else{var me=e.getMeasurement(_);if(me.used===0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var q=me.value;if(me=e.getMeasurement(_),me.used===0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var Ie=me.value;if(me=e.getMeasurement(_),me.used===0||_.length!==0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var te=me.value;i.addSeparator(q,Ie,te,{startChar:r.iChar,endChar:r.iChar+L.length})}break;case"barsperstaff":if(R=v("barsperstaff",A,_),R!==null)return R;break;case"staffnonote":if(_.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(_[0].token==="0")r.staffnonote=!0;else if(_[0].token==="1")r.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+_[0].token+")";break;case"printtempo":if(R=m("printTempo",A,_),R!==null)return R;break;case"partsbox":if(R=m("partsBox",A,_),R!==null)return R;r.partsfont.box=r.partsBox;break;case"freegchord":if(R=m("freegchord",A,_),R!==null)return R;break;case"measurenb":case"barnumbers":if(R=v("barNumbers",A,_),R!==null)return R;break;case"setbarnb":if(_.length!==1||_[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";r.currBarNumber=i.setBarNumberImmediate(_[0].intt);break;case"keywarn":if(_.length!==1||_[0].type!=="number"||_[0].intt!==1&&_[0].intt!==0)return"Directive "+A+" requires 0 or 1 as a parameter.";r[A]=_[0].intt===1;break;case"begintext":var Z="";for(V=e.nextLine();V&&V.indexOf("%%endtext")!==0;){if(da.startsWith(V,"%%")){var ge=V.substring(2);ge=ge.trim()+`
2
2
  `,Z+=ge}else Z+=V.trim()+`
3
3
  `;V=e.nextLine()}i.addText(Z,{startChar:r.iChar,endChar:r.iChar+Z.length+7});break;case"continueall":r.continueall=!0;break;case"beginps":for(V=e.nextLine();V&&V.indexOf("%%endps")!==0;)e.nextLine();t("Postscript ignored",k,0);break;case"deco":L.length>0&&r.ignoredDecorations.push(L.substring(0,L.indexOf(" "))),t("Decoration redefinition ignored",k,0);break;case"text":var ce=e.translateString(L);i.addText(At.parseFontChangeLine(ce),{startChar:r.iChar,endChar:r.iChar+L.length+7});break;case"center":var Ae=e.translateString(L);i.addCentered(At.parseFontChangeLine(Ae));break;case"font":break;case"setfont":var ke=e.tokenize(L,0,L.length);if(ke.length>=4&&ke[0].token==="-"&&ke[1].type==="number"){var _e=parseInt(ke[1].token);_e>=1&&_e<=9&&(r.setfont||(r.setfont=[]),ke.shift(),ke.shift(),r.setfont[_e]=o(ke,r.setfont[_e],k,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 f(A,_,k);case"composerfont":case"subtitlefont":case"tempofont":case"titlefont":case"voicefont":case"footerfont":case"headerfont":return u(A,_,k);case"barlabelfont":case"barnumberfont":case"barnumfont":return f("measurefont",_,k);case"staves":case"score":r.score_is_present=!0;for(var xt=function(a0,is,fa,ua,ns){(is||r.staves.length===0)&&r.staves.push({index:r.staves.length,numVoices:0});var ut=da.last(r.staves);fa!==void 0&&ut.bracket===void 0&&(ut.bracket=fa),ua!==void 0&&ut.brace===void 0&&(ut.brace=ua),ns&&(ut.connectBarLines="end"),r.voices[a0]===void 0&&(r.voices[a0]={staffNum:ut.index,index:ut.numVoices},ut.numVoices++)},M=!1,O=!1,N=!1,D=!1,$=!1,W=!1,J=!1,ee,j=function(){if(J=!0,ee){var a0="start";ee.staffNum>0&&(r.staves[ee.staffNum-1].connectBarLines==="start"||r.staves[ee.staffNum-1].connectBarLines==="continue")&&(a0="continue"),r.staves[ee.staffNum].connectBarLines=a0}};_.length;){var X=_.shift();switch(X.token){case"(":M?t("Can't nest parenthesis in %%score",k,X.start):(M=!0,D=!0);break;case")":!M||D?t("Unexpected close parenthesis in %%score",k,X.start):M=!1;break;case"[":O?t("Can't nest brackets in %%score",k,X.start):(O=!0,$=!0);break;case"]":!O||$?t("Unexpected close bracket in %%score",k,X.start):(O=!1,r.staves[ee.staffNum].bracket="end");break;case"{":N?t("Can't nest braces in %%score",k,X.start):(N=!0,W=!0);break;case"}":!N||W?t("Unexpected close brace in %%score",k,X.start):(N=!1,r.staves[ee.staffNum].brace="end");break;case"|":j();break;default:for(var re="";(X.type==="alpha"||X.type==="number")&&(re+=X.token,X.continueId);)X=_.shift();var se=!M||D,U=$?"start":O?"continue":void 0,ne=W?"start":N?"continue":void 0;xt(re,se,U,ne,J),D=!1,$=!1,W=!1,J=!1,ee=r.voices[re],A==="staves"&&j();break}}break;case"maxstaves":var he=e.getInt(L);he.digits===0?t("Expected number of staves in maxstaves"):he.value>0&&(a.formatting.maxStaves=he.value);break;case"newpage":var ae=e.getInt(L);i.addNewPage(ae.digits===0?-1:ae.value);break;case"abc":var Fe=L.split(" ");switch(Fe[0]){case"-copyright":case"-creator":case"-edited-by":case"-version":case"-charset":var Ft=Fe.shift();i.addMetaText(A+Ft,Fe.join(" "),{startChar:r.iChar,endChar:r.iChar+L.length+5});break;default:return"Unknown directive: "+A+Fe[0]}break;case"header":case"footer":var ye=e.getMeat(L,0,L.length);ye=L.substring(ye.start,ye.end),ye[0]==='"'&&ye[ye.length-1]==='"'&&(ye=ye.substring(1,ye.length-1));var Be=ye.split(" "),Ct={};Be.length===1?Ct={left:"",center:Be[0],right:""}:Be.length===2?Ct={left:Be[0],center:Be[1],right:""}:Ct={left:Be[0],center:Be[1],right:Be[2]},Be.length>3&&t("Too many tabs in "+A+": "+Be.length+" found.",L,0),i.addMetaTextObj(A,Ct,{startChar:r.iChar,endChar:r.iChar+k.length});break;case"midi":var st=e.tokenize(L,0,L.length,!0);st.length>0&&st[0].token==="="&&st.shift(),st.length===0?t("Expected midi command",L,0):Y(st,a,L);break;case"percmap":var kt=d(L);kt.error?t(kt.error,k,8):(a.formatting.percmap||(a.formatting.percmap={}),a.formatting.percmap[kt.key]=kt.value);break;case"visualtranspose":var ha=e.getInt(L);ha.digits===0?t("Expected number of half steps in visualTranspose"):r.globalTranspose=ha.value;break;case"map":case"playtempo":case"auquality":case"continuous":case"nobarcheck":a.formatting[A]=L;break;default:return"Unknown directive: "+A}return null},At.globalFormatting=function(k){for(var _ in k)if(k.hasOwnProperty(_)){var L=""+k[_],A=e.tokenize(L,0,L.length),R;switch(_){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":f(_,A,L);break;case"scale":l(_,A);break;case"partsbox":R=m("partsBox",_,A),R!==null&&t(R),r.partsfont.box=r.partsBox;break;case"freegchord":R=m("freegchord",_,A),R!==null&&t(R);break;case"fontboxpadding":(A.length!==1||A[0].type!=="number")&&t('Directive "'+_+'" requires a number as a parameter.'),a.formatting.fontboxpadding=A[0].floatt;break;case"stafftopmargin":(A.length!==1||A[0].type!=="number")&&t('Directive "'+_+'" requires a number as a parameter.'),a.formatting.stafftopmargin=A[0].floatt;break;case"stretchlast":var V=P(A);if(V.value!==void 0&&(a.formatting.stretchlast=V.value),V.error)return V.error;break;default:t("Formatting directive unrecognized: ",_,0)}}};function P(k){if(k.length===0)return{value:1};if(k.length===1)if(k[0].type==="number"){if(k[0].floatt>=0||k[0].floatt<=1)return{value:k[0].floatt}}else{if(k[0].token==="false")return{value:0};if(k[0].token==="true")return{value:1}}return{error:"Directive stretchlast requires zero or one parameter: false, true, or number between 0 and 1 (received "+k[0].token+")"}}})();var Gr=At,Rr={};const Gi=["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'''"];Rr.pitchIndex=function(e){return Gi.indexOf(e)};Rr.noteName=function(e){return Gi[e]};var ps=Rr,M0=["C","C♯","D","D♯","E","F","F♯","G","G♯","A","A♯","B"],A0=["C","D♭","D","E♭","E","F","G♭","G","A♭","A","B♭","B"],B0=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],N0=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"];function vs(e,t,r,a){if(!t||t%12===0)return e;for(;t<0;)t+=12;t>11&&(t=t%12);var i=e.match(/^([A-G][b#♭♯]?)([^\/]+)?\/?([A-G][b#♭♯]?)?(.+)?/);if(!i)return e;var n=i[1],s=i[2],c=i[3],o=i[4],f=M0.indexOf(n);if(f<0&&(f=A0.indexOf(n)),f<0&&(f=B0.indexOf(n)),f<0&&(f=N0.indexOf(n)),f<0)return e;f+=t,f=f%12,r?a?e=N0[f]:e=A0[f]:a?e=B0[f]:e=M0[f];var u=s&&(s.indexOf("dim")>=0||s.indexOf("°")>=0);if(u&&e==="A#"&&(e="Bb"),u&&e==="D#"&&(e="Eb"),u&&e==="A♯"&&(e="B♭"),u&&e==="D♯"&&(e="E♭"),s&&(e+=s),c){var f=M0.indexOf(c);f<0&&(f=A0.indexOf(c)),f<0&&(f=B0.indexOf(c)),f<0&&(f=N0.indexOf(c)),e+="/",f>=0?(f+=t,f=f%12,r?a?e+=N0[f]:e+=A0[f]:a?e+=B0[f]:e+=M0[f]):e+=c}return o&&(e+=o),e}var Ri=vs,Bt={C:{modes:["CMaj","CIon","Amin","AAeo","Am","GMix","DDor","EPhr","FLyd","BLoc"],stepsFromC:0},Db:{modes:["DbMaj","DbIon","Bbmin","BbAeo","Bbm","AbMix","EbDor","FPhr","GbLyd","CLoc"],stepsFromC:1},D:{modes:["DMaj","DIon","Bmin","BAeo","Bm","AMix","EDor","F#Phr","GLyd","C#Loc"],stepsFromC:2},Eb:{modes:["EbMaj","EbIon","Cmin","CAeo","Cm","BbMix","FDor","GPhr","AbLyd","DLoc"],stepsFromC:3},E:{modes:["EMaj","EIon","C#min","C#Aeo","C#m","BMix","F#Dor","G#Phr","ALyd","D#Loc"],stepsFromC:4},F:{modes:["FMaj","FIon","Dmin","DAeo","Dm","CMix","GDor","APhr","BbLyd","ELoc"],stepsFromC:5},Gb:{modes:["GbMaj","GbIon","Ebmin","EbAeo","Ebm","DbMix","AbDor","BbPhr","CbLyd","FLoc"],stepsFromC:6},G:{modes:["GMaj","GIon","Emin","EAeo","Em","DMix","ADor","BPhr","CLyd","F#Loc"],stepsFromC:7},Ab:{modes:["AbMaj","AbIon","Fmin","FAeo","Fm","EbMix","BbDor","CPhr","DbLyd","GLoc"],stepsFromC:8},A:{modes:["AMaj","AIon","F#min","F#Aeo","F#m","EMix","BDor","C#Phr","DLyd","G#Loc"],stepsFromC:9},Bb:{modes:["BbMaj","BbIon","Gmin","GAeo","Gm","FMix","CDor","DPhr","EbLyd","ALoc"],stepsFromC:10},B:{modes:["BMaj","BIon","G#min","G#Aeo","G#m","F#Mix","C#Dor","D#Phr","ELyd","A#Loc"],stepsFromC:11},"C#":{modes:["C#Maj","C#Ion","A#min","A#Aeo","A#m","G#Mix","D#Dor","E#Phr","F#Lyd","B#Loc"],stepsFromC:1},"F#":{modes:["F#Maj","F#Ion","D#min","D#Aeo","D#m","C#Mix","G#Dor","A#Phr","BLyd","E#Loc"],stepsFromC:6},Cb:{modes:["CbMaj","CbIon","Abmin","AbAeo","Abm","GbMix","DbDor","EbPhr","FbLyd","BbLoc"],stepsFromC:11}},gs=["maj","ion","min","aeo","m","mix","dor","phr","lyd","loc"];function bs(e){return gs.indexOf(e.toLowerCase())>=0}var v0=null;function ms(){v0={};for(var e=Object.keys(Bt),t=0;t<e.length;t++){var r=Bt[e[t]];v0[e[t].toLowerCase()]=e[t];for(var a=0;a<r.modes.length;a++){var i=r.modes[a].toLowerCase();v0[i]=e[t]}}}function ys(e){v0||ms();var t=e.toLowerCase().match(/([a-g][b#]?)(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)?/);if(!t||!t[2])return e;t=t[1]+t[2];var r=v0[t];return r||e}function ws(e,t){var r=Bt[e];if(!r||t==="")return e;var a=t.toLowerCase().match(/^(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)/);if(!a)return e;for(var i=a[1],n=0;n<r.modes.length;n++){var s=r.modes[n],c=s.toLowerCase().indexOf(i);if(c!==-1&&c===s.length-i.length)return s.substring(0,s.length-i.length)}return e}function xs(e,t){var r=Bt[e];if(!r)return e;for(;t<0;)t+=12;for(var a=(r.stepsFromC+t)%12,i=0;i<Object.keys(Bt).length;i++){var n=Object.keys(Bt)[i];if(Bt[n].stepsFromC===a)return n}return e}var Yi={relativeMajor:ys,relativeMode:ws,transposeKey:xs,isLegalMode:bs},{relativeMajor:Cs}=Yi,_t={acc:"sharp",note:"f"},Ot={acc:"sharp",note:"c"},i0={acc:"sharp",note:"g"},L0={acc:"sharp",note:"d"},or={acc:"sharp",note:"A"},pa={acc:"sharp",note:"e"},ks={acc:"sharp",note:"B"},Oe={acc:"flat",note:"B"},Je={acc:"flat",note:"e"},dt={acc:"flat",note:"A"},n0={acc:"flat",note:"d"},lr={acc:"flat",note:"G"},va={acc:"flat",note:"c"},_s={acc:"flat",note:"F"},Ts={"C#":[_t,Ot,i0,L0,or,pa,ks],"F#":[_t,Ot,i0,L0,or,pa],B:[_t,Ot,i0,L0,or],E:[_t,Ot,i0,L0],A:[_t,Ot,i0],D:[_t,Ot],G:[_t],C:[],F:[Oe],Bb:[Oe,Je],Eb:[Oe,Je,dt],Cm:[Oe,Je,dt],Ab:[Oe,Je,dt,n0],Db:[Oe,Je,dt,n0,lr],Gb:[Oe,Je,dt,n0,lr,va],Cb:[Oe,Je,dt,n0,lr,va,_s],"A#":[Oe,Je],"B#":[],"D#":[Oe,Je,dt],"E#":[Oe],"G#":[Oe,Je,dt,n0],none:[]};function Es(e){var t=Ts[Cs(e)];return t?JSON.parse(JSON.stringify(t)):null}var qi=Es,ga=ps,Ss=Ri,hr=qi,Z0={},Ms={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},As=["C","Db","D","Eb","E","F","F#","G","Ab","A","Bb","B"],Bs=["C","C#","D","D#","E","F","F#","G","G#","A","Bb","B"];Z0.keySignature=function(e,t,r,a,i){if(e.clef.type==="perc"||e.clef.type==="none")return{accidentals:hr(t),root:r,acc:a};i||(i=0),e.localTransposeVerticalMovement=0,e.localTransposePreferFlats=!1;var n=hr(t);if(!n)return e.key;if(e.localTranspose=(e.globalTranspose?e.globalTranspose:0)+i,!e.localTranspose)return{accidentals:n,root:r,acc:a};if(e.globalTransposeOrigKeySig=n,e.localTranspose%12===0)return e.localTransposeVerticalMovement=e.localTranspose/12*7,{accidentals:n,root:r,acc:a};var s=t[0];t[1]==="b"||t[1]==="#"?(s+=t[1],t=t.substr(2)):t=t.substr(1);var c=Ms[s],o=c!==void 0;o||(c=0,s="C",t="");for(var f=c+e.localTranspose;f<0;)f+=12;f>11&&(f=f%12);var u=t[0]==="m"?Bs[f]:As[f],l=u+t,h=hr(l);(h.length===0||h[0].acc==="flat")&&(e.localTransposePreferFlats=!0);var d=l.charCodeAt(0)-s.charCodeAt(0);return e.localTranspose>0?(d<0||d===0&&(s[1]==="#"||l[1]==="b"))&&(d+=7):e.localTranspose<0&&(d>0||d===0&&(s[1]==="b"||l[1]==="#"))&&(d-=7),e.localTranspose>0?e.localTransposeVerticalMovement=d+Math.floor(e.localTranspose/12)*7:e.localTransposeVerticalMovement=d+Math.ceil(e.localTranspose/12)*7,o?{accidentals:h,root:u[0],acc:u.length>1?u[1]:""}:{accidentals:[],root:r,acc:a}};Z0.chordName=function(e,t){return Ss(t,e.localTranspose,e.localTransposePreferFlats,e.freegchord)};var ba=["c","d","e","f","g","a","b"];function Ns(e,t,r,a,i){for(var n=ba[(e+49)%7],s=0,c=0;c<a.length;c++)a[c].note.toLowerCase()===n&&(s=fr[a[c].acc]);for(var o=fr[r],f=o-s,u=ba[(t+49)%7],l=0,h=0;h<i.accidentals.length;h++)i.accidentals[h].note.toLowerCase()===u&&(l=fr[i.accidentals[h].acc]);var d=f+l;return d<-2&&(t--,d+=u==="c"||u==="f"?1:2),d>2&&(t++,d-=u==="b"||u==="e"?1:2),[t,d]}var fr={dblflat:-2,flat:-1,natural:0,sharp:1,dblsharp:2},Ls={"-2":"dblflat","-1":"flat",0:"natural",1:"sharp",2:"dblsharp"},Ps={"-2":"__","-1":"_",0:"=",1:"^",2:"^^"};Z0.note=function(e,t){if(!(!e.localTranspose||e.clef.type==="perc")){var r=t.pitch;if(e.localTransposeVerticalMovement&&(t.pitch=t.pitch+e.localTransposeVerticalMovement,t.name)){var a=t.accidental?t.name.substring(1):t.name,i=t.accidental?t.name[0]:"",n=ga.pitchIndex(a);t.name=i+ga.noteName(n+e.localTransposeVerticalMovement)}if(t.accidental){var s=Ns(r,t.pitch,t.accidental,e.globalTransposeOrigKeySig,e.targetKey);t.pitch=s[0],t.accidental=Ls[s[1]],t.name&&(t.name=Ps[s[1]]+t.name.replace(/[_^=]/g,""))}}};var Wi=Z0,ma=Gr,Ds=Wi,Te={};(function(){var e,t,r,a;Te.initialize=function(u,l,h,d,p){e=u,t=l,r=h,a=p},Te.standardKey=function(u,l,h,d){return Ds.keySignature(r,u,l,h,d)};var i={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}},n=function(u,l){var h=i[u],d=h?h.mid:0;return d+l};Te.fixClef=function(u){var l=i[u.type];l&&(u.clefPos=l.pitch,u.type=l.clef)},Te.deepCopyKey=function(u){var l={accidentals:[],root:u.root,acc:u.acc,mode:u.mode};return u.accidentals.forEach(function(h){l.accidentals.push(Object.assign({},h))}),l};var s={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};Te.addPosToKey=function(u,l){var h=u.verticalPos;l.accidentals.forEach(function(d){var p=s[d.note];p=p-h,d.verticalPos=p}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){var p=s[d.note];p=p-h,d.verticalPos=p}),h<-10?(l.accidentals.forEach(function(d){d.verticalPos-=7,(d.verticalPos>=11||d.verticalPos===10&&d.acc==="flat")&&(d.verticalPos-=7),d.note==="A"&&d.acc==="sharp"&&(d.verticalPos-=7),(d.note==="G"||d.note==="F")&&d.acc==="flat"&&(d.verticalPos-=7)}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){d.verticalPos-=7,(d.verticalPos>=11||d.verticalPos===10&&d.acc==="flat")&&(d.verticalPos-=7),d.note==="A"&&d.acc==="sharp"&&(d.verticalPos-=7),(d.note==="G"||d.note==="F")&&d.acc==="flat"&&(d.verticalPos-=7)})):h<-4?(l.accidentals.forEach(function(d){d.verticalPos-=7,h===-8&&(d.note==="f"||d.note==="g")&&d.acc==="sharp"&&(d.verticalPos-=7)}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){d.verticalPos-=7,h===-8&&(d.note==="f"||d.note==="g")&&d.acc==="sharp"&&(d.verticalPos-=7)})):h>=7&&(l.accidentals.forEach(function(d){d.verticalPos+=7}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){d.verticalPos+=7}))},Te.fixKey=function(u,l){var h=Object.assign({},l);return Te.addPosToKey(u,h),h};var c=function(u){var l=0,h=u[l++];(h==="^"||h==="_")&&(h=u[l++]);var d=s[h];for(d===void 0&&(d=6);l<u.length;l++)if(u[l]===",")d-=7;else if(u[l]==="'")d+=7;else break;return{mid:d-6,str:u.substring(l)}},o=function(u){for(var l=0;l<u.length;l++)u[l].note==="b"?u[l].note="B":u[l].note==="a"?u[l].note="A":u[l].note==="F"?u[l].note="f":u[l].note==="E"?u[l].note="e":u[l].note==="D"?u[l].note="d":u[l].note==="C"?u[l].note="c":u[l].note==="G"&&u[l].acc==="sharp"?u[l].note="g":u[l].note==="g"&&u[l].acc==="flat"&&(u[l].note="G")};Te.parseKey=function(u,l){u.length===0&&(u="none");var h=e.tokenize(u,0,u.length),d={};if(h.length===0)return t("Must pass in key signature.",u,0),d;switch(h[0].token){case"HP":ma.addDirective("bagpipes"),r.key={root:"HP",accidentals:[],acc:"",mode:""},d.foundKey=!0,h.shift();break;case"Hp":ma.addDirective("bagpipes"),r.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},d.foundKey=!0,h.shift();break;case"none":r.key={root:"none",accidentals:[],acc:"",mode:""},d.foundKey=!0,h.shift();break;default:var p=e.getKeyPitch(h[0].token);if(p.len>0){d.foundKey=!0;var g="",v="";h[0].token.length>1?h[0].token=h[0].token.substring(1):h.shift();var m=p.token;if(h.length>0){var y=e.getSharpFlat(h[0].token);if(y.len>0&&(h[0].token.length>1?h[0].token=h[0].token.substring(1):h.shift(),m+=y.token,g=y.token),h.length>0){var x=e.getMode(h[0].token);x.len>0&&(h.shift(),m+=x.token,v=x.token)}if(Te.standardKey(m,p.token,g,0)===void 0)return t("Unsupported key signature: "+m,u,0),d}var b=Te.deepCopyKey(r.key),w=!l&&r.globalTranspose?-r.globalTranspose:0,C;if(l&&(C=r.globalTransposeOrigKeySig),r.key=Te.deepCopyKey(Te.standardKey(m,p.token,g,w)),l&&(r.globalTransposeOrigKeySig=C),r.key.mode=v,b&&r.keywarn!==!1){for(var T,B=0;B<r.key.accidentals.length;B++)for(T=0;T<b.accidentals.length;T++)b.accidentals[T].note&&r.key.accidentals[B].note.toLowerCase()===b.accidentals[T].note.toLowerCase()&&(b.accidentals[T].note=null);for(T=0;T<b.accidentals.length;T++)b.accidentals[T].note&&(r.key.impliedNaturals||(r.key.impliedNaturals=[]),r.key.impliedNaturals.push({acc:"natural",note:b.accidentals[T].note}))}}break}if(h.length===0||(h[0].token==="exp"&&h.shift(),h.length===0)||(h[0].token==="oct"&&h.shift(),h.length===0))return d;var E=e.getKeyAccidentals2(h);if(E.warn&&t(E.warn,u,0),E.accs){d.foundKey||(d.foundKey=!0,r.key={root:"none",acc:"",mode:"",accidentals:[]}),o(E.accs);for(var z=0;z<E.accs.length;z++){for(var I=!1,F=0;F<r.key.accidentals.length&&!I;F++)r.key.accidentals[F].note===E.accs[z].note&&(I=!0,r.key.accidentals[F].acc!==E.accs[z].acc&&(r.key.accidentals[F].acc=E.accs[z].acc,r.key.explicitAccidentals||(r.key.explicitAccidentals=[]),r.key.explicitAccidentals.push(E.accs[z])));if(!I&&(r.key.explicitAccidentals||(r.key.explicitAccidentals=[]),r.key.explicitAccidentals.push(E.accs[z]),r.key.accidentals.push(E.accs[z]),r.key.impliedNaturals))for(var G=0;G<r.key.impliedNaturals.length;G++)r.key.impliedNaturals[G].note===E.accs[z].note&&r.key.impliedNaturals.splice(G,1)}}for(var Y;h.length>0;)switch(h[0].token){case"m":case"middle":if(h.shift(),h.length===0)return t("Expected = after middle",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after middle",u,Y.start);break}if(h.length===0)return t("Expected parameter after middle=",u,0),d;var K=e.getPitchFromTokens(h);K.warn&&t(K.warn,u,0),K.position&&(r.clef.verticalPos=K.position-6);break;case"transpose":if(h.shift(),h.length===0)return t("Expected = after transpose",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after transpose",u,Y.start);break}if(h.length===0)return t("Expected parameter after transpose=",u,0),d;if(h[0].type!=="number"){t("Expected number after transpose",u,h[0].start);break}r.clef.transpose=h[0].intt,h.shift();break;case"stafflines":if(h.shift(),h.length===0)return t("Expected = after stafflines",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after stafflines",u,Y.start);break}if(h.length===0)return t("Expected parameter after stafflines=",u,0),d;if(h[0].type!=="number"){t("Expected number after stafflines",u,h[0].start);break}r.clef.stafflines=h[0].intt,h.shift();break;case"staffscale":if(h.shift(),h.length===0)return t("Expected = after staffscale",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after staffscale",u,Y.start);break}if(h.length===0)return t("Expected parameter after staffscale=",u,0),d;if(h[0].type!=="number"){t("Expected number after staffscale",u,h[0].start);break}r.clef.staffscale=h[0].floatt,h.shift();break;case"octave":if(h.shift(),h.length===0)return t("Expected = after octave",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after octave",u,Y.start);break}if(h.length===0)return t("Expected parameter after octave=",u,0),d;if(h[0].type!=="number"){t("Expected number after octave",u,h[0].start);break}r.octave=h[0].intt,h.shift();break;case"style":if(h.shift(),h.length===0)return t("Expected = after style",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after style",u,Y.start);break}if(h.length===0)return t("Expected parameter after style=",u,0),d;switch(h[0].token){case"normal":case"harmonic":case"rhythm":case"x":case"triangle":r.style=h[0].token,h.shift();break;default:t("error parsing style element: "+h[0].token,u,h[0].start);break}break;case"clef":if(h.shift(),h.length===0)return t("Expected = after clef",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after clef",u,Y.start);break}if(h.length===0)return t("Expected parameter after clef=",u,0),d;case"treble":case"bass":case"alto":case"tenor":case"perc":case"none":var P=h.shift();switch(P.token){case"treble":case"tenor":case"alto":case"bass":case"perc":case"none":break;case"C":P.token="alto";break;case"F":P.token="bass";break;case"G":P.token="treble";break;case"c":P.token="alto";break;case"f":P.token="bass";break;case"g":P.token="treble";break;default:t("Expected clef name. Found "+P.token,u,P.start);break}h.length>0&&h[0].type==="number"&&(P.token+=h[0].token,h.shift()),h.length>1&&(h[0].token==="-"||h[0].token==="+"||h[0].token==="^"||h[0].token==="_")&&h[1].token==="8"&&(P.token+=h[0].token+h[1].token,h.shift(),h.shift()),r.clef={type:P.token,verticalPos:n(P.token,0)},r.currentVoice&&r.currentVoice.transpose!==void 0&&(r.clef.transpose=r.currentVoice.transpose),d.foundClef=!0;break;default:t("Unknown parameter: "+h[0].token,u,h[0].start),h.shift()}return d};var f=function(u){var l=r.voices[u];if(!(r.currentVoice&&r.currentVoice.index===l.index&&r.currentVoice.staffNum===l.staffNum))return r.currentVoice=l,a.setCurrentVoice(l.staffNum,l.index,u)};Te.parseVoice=function(u,l,h){var d=e.getMeat(u,l,h),p=d.start,g=d.end,v=e.getToken(u,p,g);if(v.length===0){t("Expected a voice id",u,p);return}var m=!1;r.voices[v]===void 0&&(r.voices[v]={},m=!0,r.score_is_present&&t("Can't have an unknown V: id when the %score directive is present",u,p)),p+=v.length,p+=e.eatWhiteSpace(u,p);for(var y={startStaff:m},x=function(K){var P=e.getVoiceToken(u,p,g);P.warn!==void 0?t("Expected value for "+K+" in voice: "+P.warn,u,p):P.err!==void 0?t("Expected value for "+K+" in voice: "+P.err,u,p):P.token.length===0&&u[p]!=='"'?t("Expected value for "+K+" in voice",u,p):y[K]=P.token,p+=P.len},b=function(K,P,k){var _=e.getVoiceToken(u,p,g);_.warn!==void 0?t("Expected value for "+P+" in voice: "+_.warn,u,p):_.err!==void 0?t("Expected value for "+P+" in voice: "+_.err,u,p):_.token.length===0&&u[p]!=='"'?t("Expected value for "+P+" in voice",u,p):(_.token=parseFloat(_.token),r.voices[K][P]=_.token),p+=_.len},w=function(K,P){var k=e.getVoiceToken(u,p,g);if(k.warn!==void 0)t("Expected value for "+K+" in voice: "+k.warn,u,p);else if(k.err!==void 0)t("Expected value for "+K+" in voice: "+k.err,u,p);else if(k.token.length===0&&u[p]!=='"')t("Expected value for "+K+" in voice",u,p);else return k.token;p+=k.len},C=function(K,P){var k={_B:2,_E:9,_b:-10,_e:-3},_=e.getVoiceToken(u,p,g);if(_.warn!==void 0)t("Expected one of (_B, _E, _b, _e) for "+P+" in voice: "+_.warn,u,p);else if(_.token.length===0&&u[p]!=='"')t("Expected one of (_B, _E, _b, _e) for "+P+" in voice",u,p);else{var L=k[_.token];L?r.voices[K][P]=L:t("Expected one of (_B, _E, _b, _e) for "+P+" in voice",u,p)}p+=_.len};p<g;){var T=e.getVoiceToken(u,p,g);if(p+=T.len,T.warn)t("Error parsing voice: "+T.warn,u,p);else{var B=null;switch(T.token){case"clef":case"cl":x("clef");var E=0;y.clef!==void 0&&(y.clef=y.clef.replace(/[',]/g,""),y.clef.indexOf("+16")!==-1&&(E+=14,y.clef=y.clef.replace("+16","")),y.verticalPos=n(y.clef,E));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 z=0;y.clef=T.token.replace(/[',]/g,""),y.verticalPos=n(y.clef,z),r.voices[v].clef=T.token;break;case"staves":case"stave":case"stv":x("staves");break;case"brace":case"brc":x("brace");break;case"bracket":case"brk":x("bracket");break;case"name":case"nm":x("name");break;case"subname":case"sname":case"snm":x("subname");break;case"merge":y.startStaff=!1;break;case"stem":case"stems":B=e.getVoiceToken(u,p,g),B.warn!==void 0?t("Expected value for stems in voice: "+B.warn,u,p):B.err!==void 0?t("Expected value for stems in voice: "+B.err,u,p):B.token==="up"||B.token==="down"?r.voices[v].stem=B.token:t("Expected up or down for voice stem",u,p),p+=B.len;break;case"up":case"down":r.voices[v].stem=T.token;break;case"middle":case"m":x("verticalPos"),y.verticalPos=c(y.verticalPos).mid;break;case"gchords":case"gch":r.voices[v].suppressChords=!0,B=e.getVoiceToken(u,p,g),B.token==="0"&&(p=p+B.len);break;case"space":case"spc":x("spacing");break;case"scale":b(v,"scale");break;case"score":C(v,"scoreTranspose");break;case"transpose":b(v,"transpose");break;case"stafflines":b(v,"stafflines");break;case"staffscale":b(v,"staffscale");break;case"octave":b(v,"octave");break;case"volume":b(v,"volume");break;case"cue":var I=w("cue");I==="on"?r.voices[v].scale=.6:r.voices[v].scale=1;break;case"style":B=e.getVoiceToken(u,p,g),B.warn!==void 0?t("Expected value for style in voice: "+B.warn,u,p):B.err!==void 0?t("Expected value for style in voice: "+B.err,u,p):B.token==="normal"||B.token==="harmonic"||B.token==="rhythm"||B.token==="x"||B.token==="triangle"?r.voices[v].style=B.token:t("Expected one of [normal, harmonic, rhythm, x, triangle] for voice style",u,p),p+=B.len;break}}p+=e.eatWhiteSpace(u,p)}if((y.startStaff||r.staves.length===0)&&(r.staves.push({index:r.staves.length,meter:r.origMeter}),r.score_is_present||(r.staves[r.staves.length-1].numVoices=0)),r.voices[v].staffNum===void 0){r.voices[v].staffNum=r.staves.length-1;var F=0;for(var G in r.voices)r.voices.hasOwnProperty(G)&&r.voices[G].staffNum===r.voices[v].staffNum&&F++;r.voices[v].index=F-1}var Y=r.staves[r.voices[v].staffNum];return r.score_is_present||Y.numVoices++,y.clef&&(Y.clef={type:y.clef,verticalPos:y.verticalPos}),y.spacing&&(Y.spacing_below_offset=y.spacing),y.verticalPos&&(Y.verticalPos=y.verticalPos),y.name&&(Y.name?Y.name.push(y.name):Y.name=[y.name]),y.subname&&(Y.subname?Y.subname.push(y.subname):Y.subname=[y.subname]),f(v)}})();var Yr=Te,P0=rt,Ze=Gr,et=Yr,Is=function(e,t,r,a,i){this.reset=function(c,o,f,u){et.initialize(c,o,f,u,i),Ze.initialize(c,o,f,u,i)},this.reset(e,t,r,a),this.setTitle=function(c,o){r.hasMainTitle?i.addSubtitle(c,{startChar:r.iChar,endChar:r.iChar+o+2}):(i.addMetaText("title",c,{startChar:r.iChar,endChar:r.iChar+o+2}),r.hasMainTitle=!0)},this.setMeter=function(c){if(c=e.stripComment(c),c==="C")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"common_time"};if(c==="C|")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"cut_time"};if(c==="o")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_perfectum"};if(c==="c")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_imperfectum"};if(c==="o.")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_perfectum_prolatio"};if(c==="c.")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_imperfectum_prolatio"};if(c.length===0||c.toLowerCase()==="none")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),null;var o=e.tokenize(c,0,c.length);try{var f=function(){var g={value:0,num:""},v=o.shift();for(v.token==="("&&(v=o.shift());;){if(v.type!=="number")throw"Expected top number of meter";if(g.value+=parseInt(v.token),g.num+=v.token,o.length===0||o[0].token==="/")return g;if(v=o.shift(),v.token===")"){if(o.length===0||o[0].token==="/")return g;throw"Unexpected paren in meter"}if(v.token!=="."&&v.token!=="+"||(g.num+=v.token,o.length===0))throw"Expected top number of meter";v=o.shift()}return g},u=function(){var g=f();if(o.length===0)return g;var v=o.shift();if(v.token!=="/")throw"Expected slash in meter";if(v=o.shift(),v.type!=="number")throw"Expected bottom number of meter";return g.den=v.token,g.value=g.value/parseInt(g.den),g};if(o.length===0)throw"Expected meter definition in M: line";for(var l={type:"specified",value:[]},h=0;;){var d=u();h+=d.value;var p={num:d.num};if(d.den!==void 0&&(p.den=d.den),l.value.push(p),o.length===0)break}return r.havent_set_length===!0&&(r.default_length=h<.75?.0625:.125,r.havent_set_length=!1),l}catch(g){t(g,c,0)}return null},this.calcTempo=function(c){var o=.25;r.meter&&r.meter.type==="specified"?o=1/parseInt(r.meter.value[0].den):r.origMeter&&r.origMeter.type==="specified"&&(o=1/parseInt(r.origMeter.value[0].den));for(var f=0;f<c.duration;f++)c.duration[f]=o*c.duration[f];return c},this.resolveTempo=function(){r.tempo&&(this.calcTempo(r.tempo),a.metaText.tempo=r.tempo,delete r.tempo)},this.addUserDefinition=function(c,o,f){var u=c.indexOf("=",o);if(u===-1){t("Need an = in a macro definition",c,o);return}var l=P0.strip(c.substring(o,u)),h=P0.strip(c.substring(u+1));if(l.length!==1){t("Macro definitions can only be one character",c,o);return}var d="HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw~";if(d.indexOf(l)===-1){t("Macro definitions must be H-Y, h-w, or tilde",c,o);return}if(h.length===0){t("Missing macro definition",c,o);return}r.macros===void 0&&(r.macros={}),r.macros[l]=h},this.setDefaultLength=function(c,o,f){var u=c.substring(o,f).replace(/ /g,""),l=u.split("/");if(l.length===2){var h=parseInt(l[0]),d=parseInt(l[1]);d>0&&(r.default_length=h/d,r.havent_set_length=!1)}else l.length===1&&l[0]==="1"&&(r.default_length=1,r.havent_set_length=!1)};var n={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(c,o,f,u){try{var l=e.tokenize(c,o,f);if(l.length===0)throw"Missing parameter in Q: field";var h={startChar:u+o-2,endChar:u+f},d=!0,p=l.shift();if(p.type==="quote"&&(h.preString=p.token,p=l.shift(),l.length===0))return n[h.preString.toLowerCase()]&&(h.bpm=n[h.preString.toLowerCase()],h.suppressBpm=!0),{type:"immediate",tempo:h};if(p.type==="alpha"&&p.token==="C"){if(l.length===0)throw"Missing tempo after C in Q: field";if(p=l.shift(),p.type==="punct"&&p.token==="="){if(l.length===0)throw"Missing tempo after = in Q: field";if(p=l.shift(),p.type!=="number")throw"Expected number after = in Q: field";h.duration=[1],h.bpm=parseInt(p.token)}else if(p.type==="number"){if(h.duration=[parseInt(p.token)],l.length===0)throw"Missing = after duration in Q: field";if(p=l.shift(),p.type!=="punct"||p.token!=="=")throw"Expected = after duration in Q: field";if(l.length===0)throw"Missing tempo after = in Q: field";if(p=l.shift(),p.type!=="number")throw"Expected number after = in Q: field";h.bpm=parseInt(p.token)}else throw"Expected number or equal after C in Q: field"}else if(p.type==="number"){var g=parseInt(p.token);if(l.length===0||l[0].type==="quote")h.duration=[1],h.bpm=g;else{if(d=!1,p=l.shift(),p.type!=="punct"&&p.token!=="/"||(p=l.shift(),p.type!=="number"))throw"Expected fraction in Q: field";var v=parseInt(p.token);for(h.duration=[g/v];l.length>0&&l[0].token!=="="&&l[0].type!=="quote";){if(p=l.shift(),p.type!=="number"||(g=parseInt(p.token),p=l.shift(),p.type!=="punct"&&p.token!=="/")||(p=l.shift(),p.type!=="number"))throw"Expected fraction in Q: field";v=parseInt(p.token),h.duration.push(g/v)}if(p=l.shift(),p.type!=="punct"&&p.token!=="=")throw"Expected = in Q: field";if(p=l.shift(),p.type!=="number")throw"Expected tempo in Q: field";h.bpm=parseInt(p.token)}}else throw"Unknown value in Q: field";if(l.length!==0&&(p=l.shift(),p.type==="quote"&&(h.postString=p.token,p=l.shift()),l.length!==0))throw"Unexpected string at end of Q: field";return r.printTempo===!1&&(h.suppress=!0),{type:d?"delaySet":"immediate",tempo:h}}catch(m){return t(m,c,o),{type:"none"}}},this.letter_to_inline_header=function(c,o,f){var u=!1,l=e.eatWhiteSpace(c,o);if(o+=l,c.length>=o+5&&c[o]==="["&&c[o+2]===":"){var h=c.indexOf("]",o),d=r.iChar+o,p=r.iChar+h+1;switch(c.substring(o,o+3)){case"[I:":var g=Ze.addDirective(c.substring(o+3,h));return g&&t(g,c,o),[h-o+1+l];case"[M:":var v=this.setMeter(c.substring(o+3,h));return i.hasBeginMusic()&&v?i.appendStartingElement("meter",d,p,v):r.meter=v,[h-o+1+l];case"[K:":var m=et.parseKey(c.substring(o+3,h),!0);return m.foundClef&&i.hasBeginMusic()&&i.appendStartingElement("clef",d,p,r.clef),m.foundKey&&i.hasBeginMusic()&&i.appendStartingElement("key",d,p,et.fixKey(r.clef,r.key)),[h-o+1+l];case"[P:":var y=Ze.parseFontChangeLine(c.substring(o+3,h));return f||a.lines.length<=a.lineNum?r.partForNextLine={title:y,startChar:d,endChar:p}:i.appendElement("part",d,p,{title:y}),[h-o+1+l];case"[L:":return this.setDefaultLength(c,o+3,h),[h-o+1+l];case"[Q:":if(h>0){var x=this.setTempo(c,o+3,h,r.iChar);return x.type==="delaySet"?i.hasBeginMusic()?i.appendElement("tempo",d,p,this.calcTempo(x.tempo)):r.tempoForNextLine=["tempo",d,p,this.calcTempo(x.tempo)]:x.type==="immediate"&&(!f&&i.hasBeginMusic()?i.appendElement("tempo",d,p,x.tempo):r.tempoForNextLine=["tempo",d,p,x.tempo]),[h-o+1+l,c[o+1],c.substring(o+3,h)]}break;case"[V:":if(h>0)return u=et.parseVoice(c,o+3,h),[h-o+1+l,c[o+1],c.substring(o+3,h),u];break;case"[r:":return[h-o+1+l]}}return[0]},this.letter_to_body_header=function(c,o){var f=!1;if(c.length>=o+3)switch(c.substring(o,o+2)){case"I:":var u=Ze.addDirective(c.substring(o+2));return u&&t(u,c,o),[c.length];case"M:":var l=this.setMeter(c.substring(o+2));return i.hasBeginMusic()&&l&&i.appendStartingElement("meter",r.iChar+o,r.iChar+c.length,l),[c.length];case"K:":var h=et.parseKey(c.substring(o+2),i.hasBeginMusic());return h.foundClef&&i.hasBeginMusic()&&r.keywarn!==!1&&i.appendStartingElement("clef",r.iChar+o,r.iChar+c.length,r.clef),h.foundKey&&i.hasBeginMusic()&&r.keywarn!==!1&&i.appendStartingElement("key",r.iChar+o,r.iChar+c.length,et.fixKey(r.clef,r.key)),[c.length];case"P:":return i.hasBeginMusic()&&i.appendElement("part",r.iChar+o,r.iChar+c.length,{title:c.substring(o+2)}),[c.length];case"L:":return this.setDefaultLength(c,o+2,c.length),[c.length];case"Q:":var d=c.indexOf("",o+2);d===-1&&(d=c.length);var p=this.setTempo(c,o+2,d,r.iChar);return p.type==="delaySet"?i.appendElement("tempo",r.iChar+o,r.iChar+c.length,this.calcTempo(p.tempo)):p.type==="immediate"&&i.appendElement("tempo",r.iChar+o,r.iChar+c.length,p.tempo),[d,c[o],P0.strip(c.substring(o+2))];case"V:":return f=et.parseVoice(c,o+2,c.length),[c.length,c[o],P0.strip(c.substring(o+2)),f]}return[0]};var s={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(c){var o=s[c[0]],f=c.length-2,u=e.translateString(e.stripComment(c.substring(2)));if(o==="unalignedWords"||o==="notes")i.addMetaTextArray(o,Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+c.length});else if(o!==void 0)i.addMetaText(o,Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+c.length});else{var l=r.iChar,h=l+c.length;switch(c[0]){case"H":for(i.addMetaTextArray("history",Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+c.length}),c=e.peekLine();c&&c[1]!==":";)e.nextLine(),i.addMetaTextArray("history",Ze.parseFontChangeLine(e.translateString(e.stripComment(c))),{startChar:r.iChar,endChar:r.iChar+c.length}),c=e.peekLine();break;case"K":this.resolveTempo();var d=et.parseKey(c.substring(2),!1);!r.is_in_header&&i.hasBeginMusic()&&r.keywarn!==!1&&(d.foundClef&&i.appendStartingElement("clef",l,h,r.clef),d.foundKey&&i.appendStartingElement("key",l,h,et.fixKey(r.clef,r.key))),r.is_in_header=!1;break;case"L":this.setDefaultLength(c,2,c.length);break;case"M":r.origMeter=r.meter=this.setMeter(c.substring(2));break;case"P":r.is_in_header?i.addMetaText("partOrder",Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+c.length}):r.partForNextLine={title:u,startChar:l,endChar:h};break;case"Q":var p=this.setTempo(c,2,c.length,r.iChar);p.type==="delaySet"?r.tempo=p.tempo:p.type==="immediate"&&(a.metaText.tempo?r.tempoForNextLine=["tempo",l,h,p.tempo]:a.metaText.tempo=p.tempo);break;case"T":r.titlecaps&&(u=u.toUpperCase()),this.setTitle(Ze.parseFontChangeLine(e.theReverser(u)),f);break;case"U":this.addUserDefinition(c,2,c.length);break;case"V":if(et.parseVoice(c,2,c.length),!r.is_in_header)return{newline:!0};break;case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":t("Ignored header",c,0);break;default:return{regular:!0}}}return{}}},Fs=Is,$e={};$e.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"];$e.volumeDecorations=["p","pp","f","ff","mf","mp","ppp","pppp","fff","ffff","sfz"];$e.dynamicDecorations=["crescendo(","crescendo)","diminuendo(","diminuendo)","glissando(","glissando)","~(","~)"];$e.accentPseudonyms=[["<","accent"],[">","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]];$e.accentDynamicPseudonyms=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]];$e.nonDecorations="ABCDEFGabcdefgxyzZ[]|^_{";$e.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];$e.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};$e.rests={x:"invisible",X:"invisible-multimeasure",y:"spacer",z:"rest",Z:"multimeasure"};$e.accMap={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^",quarterflat:"_/",quartersharp:"^/"};$e.tripletQ={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2};var ya=Yr,Xi=Wi,fe,be,S,Ue,We,p0,{legalAccents:wa,volumeDecorations:xa,dynamicDecorations:Ca,accentPseudonyms:ka,accentDynamicPseudonyms:_a,nonDecorations:Os,durations:Hs,pitches:zs,rests:$s,accMap:Ta,tripletQ:Gs}=$e,qr=function(e,t,r,a,i,n){fe=e,be=t,S=r,Ue=a,We=i,p0=n,this.lineContinuation=!1},Ea=function(e,t,r){if(e.inTie[t]===void 0)return!1;var a=e.currentVoice?e.currentVoice.staffNum*100+e.currentVoice.index:0;return!!(e.inTie[t][a]&&(r.pitches!==void 0||r.rest.type!=="spacer"))},H={};qr.prototype.parseMusic=function(e){p0.resolveTempo(),S.is_in_header=!1;for(var t=0,r=S.iChar;fe.isWhiteSpace(e[t])&&t<e.length;)t++;if(!(t===e.length||e[t]==="%")){var a=S.start_new_line;S.continueall===void 0?S.start_new_line=!0:S.start_new_line=!1;var i=0,n=p0.letter_to_body_header(e,t);n[0]>0&&(t+=n[0],n[1]==="V"&&this.startNewLine());for(var s=0;t<e.length;){var c=t;if(e[t]==="%")break;var o=p0.letter_to_inline_header(e,t,a);if(o[0]>0)t+=o[0],o[1]==="V"&&(a=!0);else{(!We.hasBeginMusic()||a&&!this.lineContinuation)&&(this.startNewLine(),a=!1);for(var f;;)if(f=fe.eatWhiteSpace(e,t),f>0&&(t+=f),t>0&&e[t-1]===""&&(f=p0.letter_to_body_header(e,t),f[0]>0&&(f[1]==="V"&&this.startNewLine(),t=f[0],S.start_new_line=!1)),f=Ws(e,t),f[0]>0&&(t+=f[0]),f=Rs(e,t),f[0]>0){H.chord||(H.chord=[]);var u=fe.translateString(f[1]);u=u.replace(/;/g,`
4
4
  `);for(var l=!1,h=0;h<H.chord.length;h++)H.chord[h].position===f[2]&&(l=!0,H.chord[h].name+=`
@@ -1,2 +1,2 @@
1
- import{_ as e,l as o,H as i,e as n,I as p}from"./MermaidRenderer-b4CLxUY2.js";import{p as g}from"./treemap-GDKQZRPO-BXbe6QGJ.js";import"./index-wu56yLEv.js";import"./purify.es-A66Cw1IH.js";import"./step-EjIQ8UIn.js";import"./_baseUniq-D4EnRRPg.js";import"./_basePickBy-CRNU2oh3.js";import"./clone-BMsGBMed.js";var m={parse:e(async r=>{const a=await g("info",r);o.debug(a)},"parse")},v={version:p.version+""},d=e(()=>v.version,"getVersion"),c={getVersion:d},l=e((r,a,s)=>{o.debug(`rendering info diagram
1
+ import{_ as e,l as o,H as i,e as n,I as p}from"./MermaidRenderer-By9E8Mka.js";import{p as g}from"./treemap-GDKQZRPO-BDXLLe9-.js";import"./index-CX9xMrSE.js";import"./purify.es-A66Cw1IH.js";import"./step-EjIQ8UIn.js";import"./_baseUniq-D1bNmnwz.js";import"./_basePickBy-Hf4aXm85.js";import"./clone-Dnm1uDjE.js";var m={parse:e(async r=>{const a=await g("info",r);o.debug(a)},"parse")},v={version:p.version+""},d=e(()=>v.version,"getVersion"),c={getVersion:d},l=e((r,a,s)=>{o.debug(`rendering info diagram
2
2
  `+r);const t=i(a);n(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${s}`)},"draw"),f={draw:l},E={parser:m,db:c,renderer:f};export{E as diagram};
@@ -1,4 +1,4 @@
1
- import{a as gt,g as lt,f as mt,d as xt}from"./chunk-TZMSLE5B-BnBaUsND.js";import{g as kt}from"./chunk-FMBD7UC4-C7uryJc0.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as n,c as R,d as G,e as $t,y as Mt}from"./MermaidRenderer-b4CLxUY2.js";import{d as et}from"./arc-BSnyvXPh.js";import"./index-wu56yLEv.js";import"./purify.es-A66Cw1IH.js";import"./step-EjIQ8UIn.js";var U=function(){var t=n(function(h,i,a,l){for(a=a||{},l=h.length;l--;a[h[l]]=i);return a},"o"),e=[6,8,10,11,12,14,16,17,18],s=[1,9],c=[1,10],r=[1,11],f=[1,12],u=[1,13],y=[1,14],g={trace:n(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:n(function(i,a,l,d,p,o,b){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:d.setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),d.setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),d.setAccDescription(this.$);break;case 12:d.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 13:d.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:s,12:c,14:r,16:f,17:u,18:y},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:s,12:c,14:r,16:f,17:u,18:y},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:n(function(i,a){if(a.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=a,l}},"parseError"),parse:n(function(i){var a=this,l=[0],d=[],p=[null],o=[],b=this.table,k="",C=0,K=0,dt=2,Q=1,yt=o.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(i,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;o.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,p.length=p.length-w,o.length=o.length-w}n(pt,"popStack");function D(){var w;return w=d.pop()||_.lex()||Q,typeof w!="number"&&(w instanceof Array&&(d=w,w=d.pop()),w=a.symbols_[w]||w),w}n(D,"lex");for(var v,A,T,q,F={},N,M,tt,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((v===null||typeof v>"u")&&(v=D()),T=b[A]&&b[A][v]),typeof T>"u"||!T.length||!T[0]){var X="";z=[];for(N in b[A])this.terminals_[N]&&N>dt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
1
+ import{a as gt,g as lt,f as mt,d as xt}from"./chunk-TZMSLE5B-CGP8AgQu.js";import{g as kt}from"./chunk-FMBD7UC4-BBSfVL96.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as n,c as R,d as G,e as $t,y as Mt}from"./MermaidRenderer-By9E8Mka.js";import{d as et}from"./arc-BSnyvXPh.js";import"./index-CX9xMrSE.js";import"./purify.es-A66Cw1IH.js";import"./step-EjIQ8UIn.js";var U=function(){var t=n(function(h,i,a,l){for(a=a||{},l=h.length;l--;a[h[l]]=i);return a},"o"),e=[6,8,10,11,12,14,16,17,18],s=[1,9],c=[1,10],r=[1,11],f=[1,12],u=[1,13],y=[1,14],g={trace:n(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:n(function(i,a,l,d,p,o,b){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:d.setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),d.setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),d.setAccDescription(this.$);break;case 12:d.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 13:d.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:s,12:c,14:r,16:f,17:u,18:y},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:s,12:c,14:r,16:f,17:u,18:y},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:n(function(i,a){if(a.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=a,l}},"parseError"),parse:n(function(i){var a=this,l=[0],d=[],p=[null],o=[],b=this.table,k="",C=0,K=0,dt=2,Q=1,yt=o.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(i,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;o.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,p.length=p.length-w,o.length=o.length-w}n(pt,"popStack");function D(){var w;return w=d.pop()||_.lex()||Q,typeof w!="number"&&(w instanceof Array&&(d=w,w=d.pop()),w=a.symbols_[w]||w),w}n(D,"lex");for(var v,A,T,q,F={},N,M,tt,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((v===null||typeof v>"u")&&(v=D()),T=b[A]&&b[A][v]),typeof T>"u"||!T.length||!T[0]){var X="";z=[];for(N in b[A])this.terminals_[N]&&N>dt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+z.join(", ")+", got '"+(this.terminals_[v]||v)+"'":X="Parse error on line "+(C+1)+": Unexpected "+(v==Q?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(X,{text:_.match,token:this.terminals_[v]||v,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+v);switch(T[0]){case 1:l.push(v),p.push(_.yytext),o.push(_.yylloc),l.push(T[1]),v=null,K=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=p[p.length-M],F._$={first_line:o[o.length-(M||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(M||1)].first_column,last_column:o[o.length-1].last_column},ft&&(F._$.range=[o[o.length-(M||1)].range[0],o[o.length-1].range[1]]),q=this.performAction.apply(F,[k,K,C,I.yy,T[1],p,o].concat(yt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),p=p.slice(0,-1*M),o=o.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),p.push(F.$),o.push(F._$),tt=b[l[l.length-2]][l[l.length-1]],l.push(tt);break;case 3:return!0}}return!0},"parse")},m=function(){var h={EOF:1,parseError:n(function(a,l){if(this.yy.parser)this.yy.parser.parseError(a,l);else throw new Error(a)},"parseError"),setInput:n(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:n(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:n(function(i){var a=i.length,l=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 d=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),l.length-1&&(this.yylineno-=l.length-1);var p=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:l?(l.length===d.length?this.yylloc.first_column:0)+d[d.length-l.length].length-l[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(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:n(function(i){this.unput(this.match.slice(i))},"less"),pastInput:n(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:n(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:n(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{_ as c,l as te,c as W,H as fe,$ as ye,a0 as be,a1 as me,U as Ee,E as Y,i as G,t as _e,J as ke,V as Se,W as le,X as ce}from"./MermaidRenderer-b4CLxUY2.js";import{g as Ne}from"./chunk-FMBD7UC4-C7uryJc0.js";import"./index-wu56yLEv.js";import"./purify.es-A66Cw1IH.js";import"./step-EjIQ8UIn.js";var $=function(){var t=c(function(E,s,n,a){for(n=n||{},a=E.length;a--;n[E[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],_=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],U=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],H=[1,35],M=[1,36],A=[1,6,7,11,13,16,17,20,23],j=[1,38],V={trace:c(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:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){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: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:_,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:_,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:_,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:U}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:_,18:17,19:18,20:f,23:h},t(P,[2,14],{7:H,11:M}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:U}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:j}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:H,11:M}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:j}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),b=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]);b.setInput(s,T.yy),T.yy.lexer=b,T.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;e.push(q);var de=b.options&&b.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var k,R,v,Q,F={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((k===null||typeof k>"u")&&(k=ae()),v=B[R]&&B[R][k]),typeof v>"u"||!v.length||!v[0]){var Z="";K=[];for(X in B[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");b.showPosition?Z="Parse error on line "+(z+1)+`:
1
+ import{_ as c,l as te,c as W,H as fe,$ as ye,a0 as be,a1 as me,U as Ee,E as Y,i as G,t as _e,J as ke,V as Se,W as le,X as ce}from"./MermaidRenderer-By9E8Mka.js";import{g as Ne}from"./chunk-FMBD7UC4-BBSfVL96.js";import"./index-CX9xMrSE.js";import"./purify.es-A66Cw1IH.js";import"./step-EjIQ8UIn.js";var $=function(){var t=c(function(E,s,n,a){for(n=n||{},a=E.length;a--;n[E[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],_=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],U=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],H=[1,35],M=[1,36],A=[1,6,7,11,13,16,17,20,23],j=[1,38],V={trace:c(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:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){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: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:_,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:_,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:_,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:U}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:_,18:17,19:18,20:f,23:h},t(P,[2,14],{7:H,11:M}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:U}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:j}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:H,11:M}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:j}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),b=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]);b.setInput(s,T.yy),T.yy.lexer=b,T.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;e.push(q);var de=b.options&&b.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var k,R,v,Q,F={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((k===null||typeof k>"u")&&(k=ae()),v=B[R]&&B[R][k]),typeof v>"u"||!v.length||!v[0]){var Z="";K=[];for(X in B[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");b.showPosition?Z="Parse error on line "+(z+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+K.join(", ")+", got '"+(this.terminals_[k]||k)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(k==re?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(Z,{text:b.match,token:this.terminals_[k]||k,line:b.yylineno,loc:q,expected:K})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+k);switch(v[0]){case 1:a.push(k),u.push(b.yytext),e.push(b.yylloc),a.push(v[1]),k=null,ie=b.yyleng,l=b.yytext,z=b.yylineno,q=b.yylloc;break;case 2:if(I=this.productions_[v[1]][1],F.$=u[u.length-I],F._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(F._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(F,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(F.$),e.push(F._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},m=function(){var E={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,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:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.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),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=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),a.length-1&&(this.yylineno-=a.length-1);var u=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:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(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:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{G as g}from"./graph-DGfbBQxw.js";import{b as Te,p as ce,q as le,g as z,e as ee,l as F,o as Ie,s as Me,c as Se,u as je,d as f,i as m,f as _,v as x,r as M}from"./_baseUniq-D4EnRRPg.js";import{f as O,b as he,a as Fe,c as Ve,d as Ae,t as V,m as w,e as P,h as ve,g as X,l as T,i as Be}from"./_basePickBy-CRNU2oh3.js";import{aF as Ge,aG as Ye,aH as De,aw as qe,aI as $e,aA as pe,az as we,aJ as We,av as q,ak as ze,aC as Xe,am as Ue,aK as $}from"./MermaidRenderer-b4CLxUY2.js";function He(e){return Ge(Ye(e,void 0,O),e+"")}var Je=1,Ke=4;function Ze(e){return Te(e,Je|Ke)}function Qe(e,n){return e==null?e:De(e,ce(n),qe)}function en(e,n){return e&&le(e,ce(n))}function nn(e,n){return e>n}function S(e,n){var r={};return n=z(n),le(e,function(t,a,i){$e(r,a,n(t,a,i))}),r}function y(e){return e&&e.length?he(e,pe,nn):void 0}function U(e,n){return e&&e.length?he(e,z(n),Fe):void 0}function rn(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function tn(e,n){if(e!==n){var r=e!==void 0,t=e===null,a=e===e,i=ee(e),o=n!==void 0,u=n===null,d=n===n,s=ee(n);if(!u&&!s&&!i&&e>n||i&&o&&d&&!u&&!s||t&&o&&d||!r&&d||!a)return 1;if(!t&&!i&&!s&&e<n||s&&r&&a&&!t&&!i||u&&r&&a||!o&&a||!d)return-1}return 0}function an(e,n,r){for(var t=-1,a=e.criteria,i=n.criteria,o=a.length,u=r.length;++t<o;){var d=tn(a[t],i[t]);if(d){if(t>=u)return d;var s=r[t];return d*(s=="desc"?-1:1)}}return e.index-n.index}function on(e,n,r){n.length?n=F(n,function(i){return we(i)?function(o){return Ie(o,i.length===1?i[0]:i)}:i}):n=[pe];var t=-1;n=F(n,We(z));var a=Ve(e,function(i,o,u){var d=F(n,function(s){return s(i)});return{criteria:d,index:++t,value:i}});return rn(a,function(i,o){return an(i,o,r)})}function un(e,n){return Ae(e,n,function(r,t){return Me(e,t)})}var I=He(function(e,n){return e==null?{}:un(e,n)}),dn=Math.ceil,sn=Math.max;function fn(e,n,r,t){for(var a=-1,i=sn(dn((n-e)/(r||1)),0),o=Array(i);i--;)o[++a]=e,e+=r;return o}function cn(e){return function(n,r,t){return t&&typeof t!="number"&&q(n,r,t)&&(r=t=void 0),n=V(n),r===void 0?(r=n,n=0):r=V(r),t=t===void 0?n<r?1:-1:V(t),fn(n,r,t)}}var E=cn(),R=ze(function(e,n){if(e==null)return[];var r=n.length;return r>1&&q(e,n[0],n[1])?n=[]:r>2&&q(n[0],n[1],n[2])&&(n=[n[0]]),on(e,Se(n),[])}),ln=0;function H(e){var n=++ln;return je(e)+n}function hn(e,n,r){for(var t=-1,a=e.length,i=n.length,o={};++t<a;){var u=t<i?n[t]:void 0;r(o,e[t],u)}return o}function vn(e,n){return hn(e||[],n||[],Xe)}class pn{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return ne(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&ne(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,wn)),t=t._prev;return"["+n.join(", ")+"]"}}function ne(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function wn(e,n){if(e!=="_next"&&e!=="_prev")return n}var bn=Ue(1);function mn(e,n){if(e.nodeCount()<=1)return[];var r=yn(e,n||bn),t=gn(r.graph,r.buckets,r.zeroIdx);return O(w(t,function(a){return e.outEdges(a.v,a.w)}))}function gn(e,n,r){for(var t=[],a=n[n.length-1],i=n[0],o;e.nodeCount();){for(;o=i.dequeue();)A(e,n,r,o);for(;o=a.dequeue();)A(e,n,r,o);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(o=n[u].dequeue(),o){t=t.concat(A(e,n,r,o,!0));break}}}return t}function A(e,n,r,t,a){var i=a?[]:void 0;return f(e.inEdges(t.v),function(o){var u=e.edge(o),d=e.node(o.v);a&&i.push({v:o.v,w:o.w}),d.out-=u,W(n,r,d)}),f(e.outEdges(t.v),function(o){var u=e.edge(o),d=o.w,s=e.node(d);s.in-=u,W(n,r,s)}),e.removeNode(t.v),i}function yn(e,n){var r=new g,t=0,a=0;f(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var d=r.edge(u.v,u.w)||0,s=n(u),c=d+s;r.setEdge(u.v,u.w,c),a=Math.max(a,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var i=E(a+t+3).map(function(){return new pn}),o=t+1;return f(r.nodes(),function(u){W(i,o,r.node(u))}),{graph:r,buckets:i,zeroIdx:o}}function W(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function kn(e){var n=e.graph().acyclicer==="greedy"?mn(e,r(e)):xn(e);f(n,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,H("rev"))});function r(t){return function(a){return t.edge(a).weight}}}function xn(e){var n=[],r={},t={};function a(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,f(e.outEdges(i),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?n.push(o):a(o.w)}),delete r[i])}return f(e.nodes(),a),n}function En(e){f(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function L(e,n,r,t){var a;do a=H(t);while(e.hasNode(a));return r.dummy=n,e.setNode(a,r),a}function On(e){var n=new g().setGraph(e.graph());return f(e.nodes(),function(r){n.setNode(r,e.node(r))}),f(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),n}function be(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),f(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function re(e,n){var r=e.x,t=e.y,a=n.x-r,i=n.y-t,o=e.width/2,u=e.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var d,s;return Math.abs(i)*o>Math.abs(a)*u?(i<0&&(u=-u),d=u*a/i,s=u):(a<0&&(o=-o),d=o,s=o*i/a),{x:r+d,y:t+s}}function j(e){var n=w(E(me(e)+1),function(){return[]});return f(e.nodes(),function(r){var t=e.node(r),a=t.rank;m(a)||(n[a][t.order]=r)}),n}function Ln(e){var n=P(w(e.nodes(),function(r){return e.node(r).rank}));f(e.nodes(),function(r){var t=e.node(r);ve(t,"rank")&&(t.rank-=n)})}function Nn(e){var n=P(w(e.nodes(),function(i){return e.node(i).rank})),r=[];f(e.nodes(),function(i){var o=e.node(i).rank-n;r[o]||(r[o]=[]),r[o].push(i)});var t=0,a=e.graph().nodeRankFactor;f(r,function(i,o){m(i)&&o%a!==0?--t:t&&f(i,function(u){e.node(u).rank+=t})})}function te(e,n,r,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=t),L(e,"border",a,n)}function me(e){return y(w(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function Pn(e,n){var r={lhs:[],rhs:[]};return f(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Cn(e,n){return n()}function _n(e){function n(r){var t=e.children(r),a=e.node(r);if(t.length&&f(t,n),Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,o=a.maxRank+1;i<o;++i)ae(e,"borderLeft","_bl",r,a,i),ae(e,"borderRight","_br",r,a,i)}}f(e.children(),n)}function ae(e,n,r,t,a,i){var o={width:0,height:0,rank:i,borderType:n},u=a[n][i-1],d=L(e,"border",o,r);a[n][i]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function Rn(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&ge(e)}function Tn(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&In(e),(n==="lr"||n==="rl")&&(Mn(e),ge(e))}function ge(e){f(e.nodes(),function(n){ie(e.node(n))}),f(e.edges(),function(n){ie(e.edge(n))})}function ie(e){var n=e.width;e.width=e.height,e.height=n}function In(e){f(e.nodes(),function(n){B(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,B),Object.prototype.hasOwnProperty.call(r,"y")&&B(r)})}function B(e){e.y=-e.y}function Mn(e){f(e.nodes(),function(n){G(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,G),Object.prototype.hasOwnProperty.call(r,"x")&&G(r)})}function G(e){var n=e.x;e.x=e.y,e.y=n}function Sn(e){e.graph().dummyChains=[],f(e.edges(),function(n){jn(e,n)})}function jn(e,n){var r=n.v,t=e.node(r).rank,a=n.w,i=e.node(a).rank,o=n.name,u=e.edge(n),d=u.labelRank;if(i!==t+1){e.removeEdge(n);var s=void 0,c,l;for(l=0,++t;t<i;++l,++t)u.points=[],s={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},c=L(e,"edge",s,"_d"),t===d&&(s.width=u.width,s.height=u.height,s.dummy="edge-label",s.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},o),l===0&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,a,{weight:u.weight},o)}}function Fn(e){f(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,a;for(e.setEdge(r.edgeObj,t);r.dummy;)a=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=a,r=e.node(n)})}function J(e){var n={};function r(t){var a=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return a.rank;n[t]=!0;var i=P(w(e.outEdges(t),function(o){return r(o.w)-e.edge(o).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),a.rank=i}f(e.sources(),r)}function C(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function ye(e){var n=new g({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var a,i;Vn(n,e)<t;)a=An(n,e),i=n.hasNode(a.v)?C(e,a):-C(e,a),Bn(n,e,i);return n}function Vn(e,n){function r(t){f(n.nodeEdges(t),function(a){var i=a.v,o=t===i?a.w:i;!e.hasNode(o)&&!C(n,a)&&(e.setNode(o,{}),e.setEdge(t,o,{}),r(o))})}return f(e.nodes(),r),e.nodeCount()}function An(e,n){return U(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return C(n,r)})}function Bn(e,n,r){f(e.nodes(),function(t){n.node(t).rank+=r})}function Gn(){}Gn.prototype=new Error;function ke(e,n,r){we(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],i={};return f(n,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);xe(e,o,r==="post",i,t,a)}),a}function xe(e,n,r,t,a,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),f(a(n),function(o){xe(e,o,r,t,a,i)}),r&&i.push(n))}function Yn(e,n){return ke(e,n,"post")}function Dn(e,n){return ke(e,n,"pre")}k.initLowLimValues=Z;k.initCutValues=K;k.calcCutValue=Ee;k.leaveEdge=Le;k.enterEdge=Ne;k.exchangeEdges=Pe;function k(e){e=On(e),J(e);var n=ye(e);Z(n),K(n,e);for(var r,t;r=Le(n);)t=Ne(n,e,r),Pe(n,e,r,t)}function K(e,n){var r=Yn(e,e.nodes());r=r.slice(0,r.length-1),f(r,function(t){qn(e,n,t)})}function qn(e,n,r){var t=e.node(r),a=t.parent;e.edge(r,a).cutvalue=Ee(e,n,r)}function Ee(e,n,r){var t=e.node(r),a=t.parent,i=!0,o=n.edge(r,a),u=0;return o||(i=!1,o=n.edge(a,r)),u=o.weight,f(n.nodeEdges(r),function(d){var s=d.v===r,c=s?d.w:d.v;if(c!==a){var l=s===i,h=n.edge(d).weight;if(u+=l?h:-h,Wn(e,r,c)){var v=e.edge(r,c).cutvalue;u+=l?-v:v}}}),u}function Z(e,n){arguments.length<2&&(n=e.nodes()[0]),Oe(e,{},1,n)}function Oe(e,n,r,t,a){var i=r,o=e.node(t);return n[t]=!0,f(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=Oe(e,n,r,u,t))}),o.low=i,o.lim=r++,a?o.parent=a:delete o.parent,r}function Le(e){return X(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Ne(e,n,r){var t=r.v,a=r.w;n.hasEdge(t,a)||(t=r.w,a=r.v);var i=e.node(t),o=e.node(a),u=i,d=!1;i.lim>o.lim&&(u=o,d=!0);var s=_(n.edges(),function(c){return d===oe(e,e.node(c.v),u)&&d!==oe(e,e.node(c.w),u)});return U(s,function(c){return C(n,c)})}function Pe(e,n,r,t){var a=r.v,i=r.w;e.removeEdge(a,i),e.setEdge(t.v,t.w,{}),Z(e),K(e,n),$n(e,n)}function $n(e,n){var r=X(e.nodes(),function(a){return!n.node(a).parent}),t=Dn(e,r);t=t.slice(1),f(t,function(a){var i=e.node(a).parent,o=n.edge(a,i),u=!1;o||(o=n.edge(i,a),u=!0),n.node(a).rank=n.node(i).rank+(u?o.minlen:-o.minlen)})}function Wn(e,n,r){return e.hasEdge(n,r)}function oe(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function zn(e){switch(e.graph().ranker){case"network-simplex":ue(e);break;case"tight-tree":Un(e);break;case"longest-path":Xn(e);break;default:ue(e)}}var Xn=J;function Un(e){J(e),ye(e)}function ue(e){k(e)}function Hn(e){var n=L(e,"root",{},"_root"),r=Jn(e),t=y(x(r))-1,a=2*t+1;e.graph().nestingRoot=n,f(e.edges(),function(o){e.edge(o).minlen*=a});var i=Kn(e)+1;f(e.children(),function(o){Ce(e,n,a,i,t,r,o)}),e.graph().nodeRankFactor=a}function Ce(e,n,r,t,a,i,o){var u=e.children(o);if(!u.length){o!==n&&e.setEdge(n,o,{weight:0,minlen:r});return}var d=te(e,"_bt"),s=te(e,"_bb"),c=e.node(o);e.setParent(d,o),c.borderTop=d,e.setParent(s,o),c.borderBottom=s,f(u,function(l){Ce(e,n,r,t,a,i,l);var h=e.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,b=h.borderTop?t:2*t,N=v!==p?1:a-i[o]+1;e.setEdge(d,v,{weight:b,minlen:N,nestingEdge:!0}),e.setEdge(p,s,{weight:b,minlen:N,nestingEdge:!0})}),e.parent(o)||e.setEdge(n,d,{weight:0,minlen:a+i[o]})}function Jn(e){var n={};function r(t,a){var i=e.children(t);i&&i.length&&f(i,function(o){r(o,a+1)}),n[t]=a}return f(e.children(),function(t){r(t,1)}),n}function Kn(e){return M(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Zn(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Qn(e,n,r){var t={},a;f(r,function(i){for(var o=e.parent(i),u,d;o;){if(u=e.parent(o),u?(d=t[u],t[u]=o):(d=a,a=o),d&&d!==o){n.setEdge(d,o);return}o=u}})}function er(e,n,r){var t=nr(e),a=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return e.node(i)});return f(e.nodes(),function(i){var o=e.node(i),u=e.parent(i);(o.rank===n||o.minRank<=n&&n<=o.maxRank)&&(a.setNode(i),a.setParent(i,u||t),f(e[r](i),function(d){var s=d.v===i?d.w:d.v,c=a.edge(s,i),l=m(c)?0:c.weight;a.setEdge(s,i,{weight:e.edge(d).weight+l})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&a.setNode(i,{borderLeft:o.borderLeft[n],borderRight:o.borderRight[n]}))}),a}function nr(e){for(var n;e.hasNode(n=H("_root")););return n}function rr(e,n){for(var r=0,t=1;t<n.length;++t)r+=tr(e,n[t-1],n[t]);return r}function tr(e,n,r){for(var t=vn(r,w(r,function(s,c){return c})),a=O(w(n,function(s){return R(w(e.outEdges(s),function(c){return{pos:t[c.w],weight:e.edge(c).weight}}),"pos")})),i=1;i<r.length;)i<<=1;var o=2*i-1;i-=1;var u=w(new Array(o),function(){return 0}),d=0;return f(a.forEach(function(s){var c=s.pos+i;u[c]+=s.weight;for(var l=0;c>0;)c%2&&(l+=u[c+1]),c=c-1>>1,u[c]+=s.weight;d+=s.weight*l})),d}function ar(e){var n={},r=_(e.nodes(),function(u){return!e.children(u).length}),t=y(w(r,function(u){return e.node(u).rank})),a=w(E(t+1),function(){return[]});function i(u){if(!ve(n,u)){n[u]=!0;var d=e.node(u);a[d.rank].push(u),f(e.successors(u),i)}}var o=R(r,function(u){return e.node(u).rank});return f(o,i),a}function ir(e,n){return w(n,function(r){var t=e.inEdges(r);if(t.length){var a=M(t,function(i,o){var u=e.edge(o),d=e.node(o.v);return{sum:i.sum+u.weight*d.order,weight:i.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}function or(e,n){var r={};f(e,function(a,i){var o=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};m(a.barycenter)||(o.barycenter=a.barycenter,o.weight=a.weight)}),f(n.edges(),function(a){var i=r[a.v],o=r[a.w];!m(i)&&!m(o)&&(o.indegree++,i.out.push(r[a.w]))});var t=_(r,function(a){return!a.indegree});return ur(t)}function ur(e){var n=[];function r(i){return function(o){o.merged||(m(o.barycenter)||m(i.barycenter)||o.barycenter>=i.barycenter)&&dr(i,o)}}function t(i){return function(o){o.in.push(i),--o.indegree===0&&e.push(o)}}for(;e.length;){var a=e.pop();n.push(a),f(a.in.reverse(),r(a)),f(a.out,t(a))}return w(_(n,function(i){return!i.merged}),function(i){return I(i,["vs","i","barycenter","weight"])})}function dr(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function sr(e,n){var r=Pn(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,a=R(r.rhs,function(c){return-c.i}),i=[],o=0,u=0,d=0;t.sort(fr(!!n)),d=de(i,a,d),f(t,function(c){d+=c.vs.length,i.push(c.vs),o+=c.barycenter*c.weight,u+=c.weight,d=de(i,a,d)});var s={vs:O(i)};return u&&(s.barycenter=o/u,s.weight=u),s}function de(e,n,r){for(var t;n.length&&(t=T(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function fr(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function _e(e,n,r,t){var a=e.children(n),i=e.node(n),o=i?i.borderLeft:void 0,u=i?i.borderRight:void 0,d={};o&&(a=_(a,function(p){return p!==o&&p!==u}));var s=ir(e,a);f(s,function(p){if(e.children(p.v).length){var b=_e(e,p.v,r,t);d[p.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&lr(p,b)}});var c=or(s,r);cr(c,d);var l=sr(c,t);if(o&&(l.vs=O([o,l.vs,u]),e.predecessors(o).length)){var h=e.node(e.predecessors(o)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function cr(e,n){f(e,function(r){r.vs=O(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function lr(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function hr(e){var n=me(e),r=se(e,E(1,n+1),"inEdges"),t=se(e,E(n-1,-1,-1),"outEdges"),a=ar(e);fe(e,a);for(var i=Number.POSITIVE_INFINITY,o,u=0,d=0;d<4;++u,++d){vr(u%2?r:t,u%4>=2),a=j(e);var s=rr(e,a);s<i&&(d=0,o=Ze(a),i=s)}fe(e,o)}function se(e,n,r){return w(n,function(t){return er(e,t,r)})}function vr(e,n){var r=new g;f(e,function(t){var a=t.graph().root,i=_e(t,a,r,n);f(i.vs,function(o,u){t.node(o).order=u}),Qn(t,r,i.vs)})}function fe(e,n){f(n,function(r){f(r,function(t,a){e.node(t).order=a})})}function pr(e){var n=br(e);f(e.graph().dummyChains,function(r){for(var t=e.node(r),a=t.edgeObj,i=wr(e,n,a.v,a.w),o=i.path,u=i.lca,d=0,s=o[d],c=!0;r!==a.w;){if(t=e.node(r),c){for(;(s=o[d])!==u&&e.node(s).maxRank<t.rank;)d++;s===u&&(c=!1)}if(!c){for(;d<o.length-1&&e.node(s=o[d+1]).minRank<=t.rank;)d++;s=o[d]}e.setParent(r,s),r=e.successors(r)[0]}})}function wr(e,n,r,t){var a=[],i=[],o=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),d,s;d=r;do d=e.parent(d),a.push(d);while(d&&(n[d].low>o||u>n[d].lim));for(s=d,d=t;(d=e.parent(d))!==s;)i.push(d);return{path:a.concat(i.reverse()),lca:s}}function br(e){var n={},r=0;function t(a){var i=r;f(e.children(a),t),n[a]={low:i,lim:r++}}return f(e.children(),t),n}function mr(e,n){var r={};function t(a,i){var o=0,u=0,d=a.length,s=T(i);return f(i,function(c,l){var h=yr(e,c),v=h?e.node(h).order:d;(h||c===s)&&(f(i.slice(u,l+1),function(p){f(e.predecessors(p),function(b){var N=e.node(b),Q=N.order;(Q<o||v<Q)&&!(N.dummy&&e.node(p).dummy)&&Re(r,b,p)})}),u=l+1,o=v)}),i}return M(n,t),r}function gr(e,n){var r={};function t(i,o,u,d,s){var c;f(E(o,u),function(l){c=i[l],e.node(c).dummy&&f(e.predecessors(c),function(h){var v=e.node(h);v.dummy&&(v.order<d||v.order>s)&&Re(r,h,c)})})}function a(i,o){var u=-1,d,s=0;return f(o,function(c,l){if(e.node(c).dummy==="border"){var h=e.predecessors(c);h.length&&(d=e.node(h[0]).order,t(o,s,l,u,d),s=l,u=d)}t(o,s,o.length,d,i.length)}),o}return M(n,a),r}function yr(e,n){if(e.node(n).dummy)return X(e.predecessors(n),function(r){return e.node(r).dummy})}function Re(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=e[n];Object.defineProperty(a,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function kr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function xr(e,n,r,t){var a={},i={},o={};return f(n,function(u){f(u,function(d,s){a[d]=d,i[d]=d,o[d]=s})}),f(n,function(u){var d=-1;f(u,function(s){var c=t(s);if(c.length){c=R(c,function(b){return o[b]});for(var l=(c.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=c[h];i[s]===s&&d<o[p]&&!kr(r,s,p)&&(i[p]=s,i[s]=a[s]=a[p],d=o[p])}}})}),{root:a,align:i}}function Er(e,n,r,t,a){var i={},o=Or(e,n,r,a),u=a?"borderLeft":"borderRight";function d(l,h){for(var v=o.nodes(),p=v.pop(),b={};p;)b[p]?l(p):(b[p]=!0,v.push(p),v=v.concat(h(p))),p=v.pop()}function s(l){i[l]=o.inEdges(l).reduce(function(h,v){return Math.max(h,i[v.v]+o.edge(v))},0)}function c(l){var h=o.outEdges(l).reduce(function(p,b){return Math.min(p,i[b.w]-o.edge(b))},Number.POSITIVE_INFINITY),v=e.node(l);h!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(i[l]=Math.max(i[l],h))}return d(s,o.predecessors.bind(o)),d(c,o.successors.bind(o)),f(t,function(l){i[l]=i[r[l]]}),i}function Or(e,n,r,t){var a=new g,i=e.graph(),o=_r(i.nodesep,i.edgesep,t);return f(n,function(u){var d;f(u,function(s){var c=r[s];if(a.setNode(c),d){var l=r[d],h=a.edge(l,c);a.setEdge(l,c,Math.max(o(e,s,d),h||0))}d=s})}),a}function Lr(e,n){return U(x(n),function(r){var t=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return Qe(r,function(i,o){var u=Rr(e,o)/2;t=Math.max(i+u,t),a=Math.min(i-u,a)}),t-a})}function Nr(e,n){var r=x(n),t=P(r),a=y(r);f(["u","d"],function(i){f(["l","r"],function(o){var u=i+o,d=e[u],s;if(d!==n){var c=x(d);s=o==="l"?t-P(c):a-y(c),s&&(e[u]=S(d,function(l){return l+s}))}})})}function Pr(e,n){return S(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var a=R(w(e,t));return(a[1]+a[2])/2})}function Cr(e){var n=j(e),r=$(mr(e,n),gr(e,n)),t={},a;f(["u","d"],function(o){a=o==="u"?n:x(n).reverse(),f(["l","r"],function(u){u==="r"&&(a=w(a,function(l){return x(l).reverse()}));var d=(o==="u"?e.predecessors:e.successors).bind(e),s=xr(e,a,r,d),c=Er(e,a,s.root,s.align,u==="r");u==="r"&&(c=S(c,function(l){return-l})),t[o+u]=c})});var i=Lr(e,t);return Nr(t,i),Pr(t,e.graph().align)}function _r(e,n,r){return function(t,a,i){var o=t.node(a),u=t.node(i),d=0,s;if(d+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=-o.width/2;break;case"r":s=o.width/2;break}if(s&&(d+=r?s:-s),s=0,d+=(o.dummy?n:e)/2,d+=(u.dummy?n:e)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2;break}return s&&(d+=r?s:-s),s=0,d}}function Rr(e,n){return e.node(n).width}function Tr(e){e=be(e),Ir(e),en(Cr(e),function(n,r){e.node(r).x=n})}function Ir(e){var n=j(e),r=e.graph().ranksep,t=0;f(n,function(a){var i=y(w(a,function(o){return e.node(o).height}));f(a,function(o){e.node(o).y=t+i/2}),t+=i+r})}function ot(e,n){var r=Cn;r("layout",()=>{var t=r(" buildLayoutGraph",()=>qr(e));r(" runLayout",()=>Mr(t,r)),r(" updateInputGraph",()=>Sr(e,t))})}function Mr(e,n){n(" makeSpaceForEdgeLabels",()=>$r(e)),n(" removeSelfEdges",()=>Qr(e)),n(" acyclic",()=>kn(e)),n(" nestingGraph.run",()=>Hn(e)),n(" rank",()=>zn(be(e))),n(" injectEdgeLabelProxies",()=>Wr(e)),n(" removeEmptyRanks",()=>Nn(e)),n(" nestingGraph.cleanup",()=>Zn(e)),n(" normalizeRanks",()=>Ln(e)),n(" assignRankMinMax",()=>zr(e)),n(" removeEdgeLabelProxies",()=>Xr(e)),n(" normalize.run",()=>Sn(e)),n(" parentDummyChains",()=>pr(e)),n(" addBorderSegments",()=>_n(e)),n(" order",()=>hr(e)),n(" insertSelfEdges",()=>et(e)),n(" adjustCoordinateSystem",()=>Rn(e)),n(" position",()=>Tr(e)),n(" positionSelfEdges",()=>nt(e)),n(" removeBorderNodes",()=>Zr(e)),n(" normalize.undo",()=>Fn(e)),n(" fixupEdgeLabelCoords",()=>Jr(e)),n(" undoCoordinateSystem",()=>Tn(e)),n(" translateGraph",()=>Ur(e)),n(" assignNodeIntersects",()=>Hr(e)),n(" reversePoints",()=>Kr(e)),n(" acyclic.undo",()=>En(e))}function Sr(e,n){f(e.nodes(),function(r){var t=e.node(r),a=n.node(r);t&&(t.x=a.x,t.y=a.y,n.children(r).length&&(t.width=a.width,t.height=a.height))}),f(e.edges(),function(r){var t=e.edge(r),a=n.edge(r);t.points=a.points,Object.prototype.hasOwnProperty.call(a,"x")&&(t.x=a.x,t.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var jr=["nodesep","edgesep","ranksep","marginx","marginy"],Fr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Vr=["acyclicer","ranker","rankdir","align"],Ar=["width","height"],Br={width:0,height:0},Gr=["minlen","weight","width","height","labeloffset"],Yr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Dr=["labelpos"];function qr(e){var n=new g({multigraph:!0,compound:!0}),r=D(e.graph());return n.setGraph($({},Fr,Y(r,jr),I(r,Vr))),f(e.nodes(),function(t){var a=D(e.node(t));n.setNode(t,Be(Y(a,Ar),Br)),n.setParent(t,e.parent(t))}),f(e.edges(),function(t){var a=D(e.edge(t));n.setEdge(t,$({},Yr,Y(a,Gr),I(a,Dr)))}),n}function $r(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Wr(e){f(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),a=e.node(n.w),i={rank:(a.rank-t.rank)/2+t.rank,e:n};L(e,"edge-proxy",i,"_ep")}})}function zr(e){var n=0;f(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=y(n,t.maxRank))}),e.graph().maxRank=n}function Xr(e){f(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Ur(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,a=0,i=e.graph(),o=i.marginx||0,u=i.marginy||0;function d(s){var c=s.x,l=s.y,h=s.width,v=s.height;n=Math.min(n,c-h/2),r=Math.max(r,c+h/2),t=Math.min(t,l-v/2),a=Math.max(a,l+v/2)}f(e.nodes(),function(s){d(e.node(s))}),f(e.edges(),function(s){var c=e.edge(s);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),n-=o,t-=u,f(e.nodes(),function(s){var c=e.node(s);c.x-=n,c.y-=t}),f(e.edges(),function(s){var c=e.edge(s);f(c.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),i.width=r-n+o,i.height=a-t+u}function Hr(e){f(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),a=e.node(n.w),i,o;r.points?(i=r.points[0],o=r.points[r.points.length-1]):(r.points=[],i=a,o=t),r.points.unshift(re(t,i)),r.points.push(re(a,o))})}function Jr(e){f(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Kr(e){f(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Zr(e){f(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),a=e.node(r.borderBottom),i=e.node(T(r.borderLeft)),o=e.node(T(r.borderRight));r.width=Math.abs(o.x-i.x),r.height=Math.abs(a.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function Qr(e){f(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function et(e){var n=j(e);f(n,function(r){var t=0;f(r,function(a,i){var o=e.node(a);o.order=i+t,f(o.selfEdges,function(u){L(e,"selfedge",{width:u.label.width,height:u.label.height,rank:o.rank,order:i+ ++t,e:u.e,label:u.label},"_se")}),delete o.selfEdges})})}function nt(e){f(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),a=t.x+t.width/2,i=t.y,o=r.x-a,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:a+2*o/3,y:i-u},{x:a+5*o/6,y:i-u},{x:a+o,y:i},{x:a+5*o/6,y:i+u},{x:a+2*o/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}})}function Y(e,n){return S(I(e,n),Number)}function D(e){var n={};return f(e,function(r,t){n[t.toLowerCase()]=r}),n}export{ot as l};
1
+ import{G as g}from"./graph-CFhrCHAV.js";import{b as Te,p as ce,q as le,g as z,e as ee,l as F,o as Ie,s as Me,c as Se,u as je,d as f,i as m,f as _,v as x,r as M}from"./_baseUniq-D1bNmnwz.js";import{f as O,b as he,a as Fe,c as Ve,d as Ae,t as V,m as w,e as P,h as ve,g as X,l as T,i as Be}from"./_basePickBy-Hf4aXm85.js";import{aF as Ge,aG as Ye,aH as De,aw as qe,aI as $e,aA as pe,az as we,aJ as We,av as q,ak as ze,aC as Xe,am as Ue,aK as $}from"./MermaidRenderer-By9E8Mka.js";function He(e){return Ge(Ye(e,void 0,O),e+"")}var Je=1,Ke=4;function Ze(e){return Te(e,Je|Ke)}function Qe(e,n){return e==null?e:De(e,ce(n),qe)}function en(e,n){return e&&le(e,ce(n))}function nn(e,n){return e>n}function S(e,n){var r={};return n=z(n),le(e,function(t,a,i){$e(r,a,n(t,a,i))}),r}function y(e){return e&&e.length?he(e,pe,nn):void 0}function U(e,n){return e&&e.length?he(e,z(n),Fe):void 0}function rn(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function tn(e,n){if(e!==n){var r=e!==void 0,t=e===null,a=e===e,i=ee(e),o=n!==void 0,u=n===null,d=n===n,s=ee(n);if(!u&&!s&&!i&&e>n||i&&o&&d&&!u&&!s||t&&o&&d||!r&&d||!a)return 1;if(!t&&!i&&!s&&e<n||s&&r&&a&&!t&&!i||u&&r&&a||!o&&a||!d)return-1}return 0}function an(e,n,r){for(var t=-1,a=e.criteria,i=n.criteria,o=a.length,u=r.length;++t<o;){var d=tn(a[t],i[t]);if(d){if(t>=u)return d;var s=r[t];return d*(s=="desc"?-1:1)}}return e.index-n.index}function on(e,n,r){n.length?n=F(n,function(i){return we(i)?function(o){return Ie(o,i.length===1?i[0]:i)}:i}):n=[pe];var t=-1;n=F(n,We(z));var a=Ve(e,function(i,o,u){var d=F(n,function(s){return s(i)});return{criteria:d,index:++t,value:i}});return rn(a,function(i,o){return an(i,o,r)})}function un(e,n){return Ae(e,n,function(r,t){return Me(e,t)})}var I=He(function(e,n){return e==null?{}:un(e,n)}),dn=Math.ceil,sn=Math.max;function fn(e,n,r,t){for(var a=-1,i=sn(dn((n-e)/(r||1)),0),o=Array(i);i--;)o[++a]=e,e+=r;return o}function cn(e){return function(n,r,t){return t&&typeof t!="number"&&q(n,r,t)&&(r=t=void 0),n=V(n),r===void 0?(r=n,n=0):r=V(r),t=t===void 0?n<r?1:-1:V(t),fn(n,r,t)}}var E=cn(),R=ze(function(e,n){if(e==null)return[];var r=n.length;return r>1&&q(e,n[0],n[1])?n=[]:r>2&&q(n[0],n[1],n[2])&&(n=[n[0]]),on(e,Se(n),[])}),ln=0;function H(e){var n=++ln;return je(e)+n}function hn(e,n,r){for(var t=-1,a=e.length,i=n.length,o={};++t<a;){var u=t<i?n[t]:void 0;r(o,e[t],u)}return o}function vn(e,n){return hn(e||[],n||[],Xe)}class pn{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return ne(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&ne(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,wn)),t=t._prev;return"["+n.join(", ")+"]"}}function ne(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function wn(e,n){if(e!=="_next"&&e!=="_prev")return n}var bn=Ue(1);function mn(e,n){if(e.nodeCount()<=1)return[];var r=yn(e,n||bn),t=gn(r.graph,r.buckets,r.zeroIdx);return O(w(t,function(a){return e.outEdges(a.v,a.w)}))}function gn(e,n,r){for(var t=[],a=n[n.length-1],i=n[0],o;e.nodeCount();){for(;o=i.dequeue();)A(e,n,r,o);for(;o=a.dequeue();)A(e,n,r,o);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(o=n[u].dequeue(),o){t=t.concat(A(e,n,r,o,!0));break}}}return t}function A(e,n,r,t,a){var i=a?[]:void 0;return f(e.inEdges(t.v),function(o){var u=e.edge(o),d=e.node(o.v);a&&i.push({v:o.v,w:o.w}),d.out-=u,W(n,r,d)}),f(e.outEdges(t.v),function(o){var u=e.edge(o),d=o.w,s=e.node(d);s.in-=u,W(n,r,s)}),e.removeNode(t.v),i}function yn(e,n){var r=new g,t=0,a=0;f(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var d=r.edge(u.v,u.w)||0,s=n(u),c=d+s;r.setEdge(u.v,u.w,c),a=Math.max(a,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var i=E(a+t+3).map(function(){return new pn}),o=t+1;return f(r.nodes(),function(u){W(i,o,r.node(u))}),{graph:r,buckets:i,zeroIdx:o}}function W(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function kn(e){var n=e.graph().acyclicer==="greedy"?mn(e,r(e)):xn(e);f(n,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,H("rev"))});function r(t){return function(a){return t.edge(a).weight}}}function xn(e){var n=[],r={},t={};function a(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,f(e.outEdges(i),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?n.push(o):a(o.w)}),delete r[i])}return f(e.nodes(),a),n}function En(e){f(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function L(e,n,r,t){var a;do a=H(t);while(e.hasNode(a));return r.dummy=n,e.setNode(a,r),a}function On(e){var n=new g().setGraph(e.graph());return f(e.nodes(),function(r){n.setNode(r,e.node(r))}),f(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),n}function be(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),f(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function re(e,n){var r=e.x,t=e.y,a=n.x-r,i=n.y-t,o=e.width/2,u=e.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var d,s;return Math.abs(i)*o>Math.abs(a)*u?(i<0&&(u=-u),d=u*a/i,s=u):(a<0&&(o=-o),d=o,s=o*i/a),{x:r+d,y:t+s}}function j(e){var n=w(E(me(e)+1),function(){return[]});return f(e.nodes(),function(r){var t=e.node(r),a=t.rank;m(a)||(n[a][t.order]=r)}),n}function Ln(e){var n=P(w(e.nodes(),function(r){return e.node(r).rank}));f(e.nodes(),function(r){var t=e.node(r);ve(t,"rank")&&(t.rank-=n)})}function Nn(e){var n=P(w(e.nodes(),function(i){return e.node(i).rank})),r=[];f(e.nodes(),function(i){var o=e.node(i).rank-n;r[o]||(r[o]=[]),r[o].push(i)});var t=0,a=e.graph().nodeRankFactor;f(r,function(i,o){m(i)&&o%a!==0?--t:t&&f(i,function(u){e.node(u).rank+=t})})}function te(e,n,r,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=t),L(e,"border",a,n)}function me(e){return y(w(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function Pn(e,n){var r={lhs:[],rhs:[]};return f(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Cn(e,n){return n()}function _n(e){function n(r){var t=e.children(r),a=e.node(r);if(t.length&&f(t,n),Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,o=a.maxRank+1;i<o;++i)ae(e,"borderLeft","_bl",r,a,i),ae(e,"borderRight","_br",r,a,i)}}f(e.children(),n)}function ae(e,n,r,t,a,i){var o={width:0,height:0,rank:i,borderType:n},u=a[n][i-1],d=L(e,"border",o,r);a[n][i]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function Rn(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&ge(e)}function Tn(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&In(e),(n==="lr"||n==="rl")&&(Mn(e),ge(e))}function ge(e){f(e.nodes(),function(n){ie(e.node(n))}),f(e.edges(),function(n){ie(e.edge(n))})}function ie(e){var n=e.width;e.width=e.height,e.height=n}function In(e){f(e.nodes(),function(n){B(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,B),Object.prototype.hasOwnProperty.call(r,"y")&&B(r)})}function B(e){e.y=-e.y}function Mn(e){f(e.nodes(),function(n){G(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,G),Object.prototype.hasOwnProperty.call(r,"x")&&G(r)})}function G(e){var n=e.x;e.x=e.y,e.y=n}function Sn(e){e.graph().dummyChains=[],f(e.edges(),function(n){jn(e,n)})}function jn(e,n){var r=n.v,t=e.node(r).rank,a=n.w,i=e.node(a).rank,o=n.name,u=e.edge(n),d=u.labelRank;if(i!==t+1){e.removeEdge(n);var s=void 0,c,l;for(l=0,++t;t<i;++l,++t)u.points=[],s={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},c=L(e,"edge",s,"_d"),t===d&&(s.width=u.width,s.height=u.height,s.dummy="edge-label",s.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},o),l===0&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,a,{weight:u.weight},o)}}function Fn(e){f(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,a;for(e.setEdge(r.edgeObj,t);r.dummy;)a=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=a,r=e.node(n)})}function J(e){var n={};function r(t){var a=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return a.rank;n[t]=!0;var i=P(w(e.outEdges(t),function(o){return r(o.w)-e.edge(o).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),a.rank=i}f(e.sources(),r)}function C(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function ye(e){var n=new g({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var a,i;Vn(n,e)<t;)a=An(n,e),i=n.hasNode(a.v)?C(e,a):-C(e,a),Bn(n,e,i);return n}function Vn(e,n){function r(t){f(n.nodeEdges(t),function(a){var i=a.v,o=t===i?a.w:i;!e.hasNode(o)&&!C(n,a)&&(e.setNode(o,{}),e.setEdge(t,o,{}),r(o))})}return f(e.nodes(),r),e.nodeCount()}function An(e,n){return U(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return C(n,r)})}function Bn(e,n,r){f(e.nodes(),function(t){n.node(t).rank+=r})}function Gn(){}Gn.prototype=new Error;function ke(e,n,r){we(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],i={};return f(n,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);xe(e,o,r==="post",i,t,a)}),a}function xe(e,n,r,t,a,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),f(a(n),function(o){xe(e,o,r,t,a,i)}),r&&i.push(n))}function Yn(e,n){return ke(e,n,"post")}function Dn(e,n){return ke(e,n,"pre")}k.initLowLimValues=Z;k.initCutValues=K;k.calcCutValue=Ee;k.leaveEdge=Le;k.enterEdge=Ne;k.exchangeEdges=Pe;function k(e){e=On(e),J(e);var n=ye(e);Z(n),K(n,e);for(var r,t;r=Le(n);)t=Ne(n,e,r),Pe(n,e,r,t)}function K(e,n){var r=Yn(e,e.nodes());r=r.slice(0,r.length-1),f(r,function(t){qn(e,n,t)})}function qn(e,n,r){var t=e.node(r),a=t.parent;e.edge(r,a).cutvalue=Ee(e,n,r)}function Ee(e,n,r){var t=e.node(r),a=t.parent,i=!0,o=n.edge(r,a),u=0;return o||(i=!1,o=n.edge(a,r)),u=o.weight,f(n.nodeEdges(r),function(d){var s=d.v===r,c=s?d.w:d.v;if(c!==a){var l=s===i,h=n.edge(d).weight;if(u+=l?h:-h,Wn(e,r,c)){var v=e.edge(r,c).cutvalue;u+=l?-v:v}}}),u}function Z(e,n){arguments.length<2&&(n=e.nodes()[0]),Oe(e,{},1,n)}function Oe(e,n,r,t,a){var i=r,o=e.node(t);return n[t]=!0,f(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=Oe(e,n,r,u,t))}),o.low=i,o.lim=r++,a?o.parent=a:delete o.parent,r}function Le(e){return X(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Ne(e,n,r){var t=r.v,a=r.w;n.hasEdge(t,a)||(t=r.w,a=r.v);var i=e.node(t),o=e.node(a),u=i,d=!1;i.lim>o.lim&&(u=o,d=!0);var s=_(n.edges(),function(c){return d===oe(e,e.node(c.v),u)&&d!==oe(e,e.node(c.w),u)});return U(s,function(c){return C(n,c)})}function Pe(e,n,r,t){var a=r.v,i=r.w;e.removeEdge(a,i),e.setEdge(t.v,t.w,{}),Z(e),K(e,n),$n(e,n)}function $n(e,n){var r=X(e.nodes(),function(a){return!n.node(a).parent}),t=Dn(e,r);t=t.slice(1),f(t,function(a){var i=e.node(a).parent,o=n.edge(a,i),u=!1;o||(o=n.edge(i,a),u=!0),n.node(a).rank=n.node(i).rank+(u?o.minlen:-o.minlen)})}function Wn(e,n,r){return e.hasEdge(n,r)}function oe(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function zn(e){switch(e.graph().ranker){case"network-simplex":ue(e);break;case"tight-tree":Un(e);break;case"longest-path":Xn(e);break;default:ue(e)}}var Xn=J;function Un(e){J(e),ye(e)}function ue(e){k(e)}function Hn(e){var n=L(e,"root",{},"_root"),r=Jn(e),t=y(x(r))-1,a=2*t+1;e.graph().nestingRoot=n,f(e.edges(),function(o){e.edge(o).minlen*=a});var i=Kn(e)+1;f(e.children(),function(o){Ce(e,n,a,i,t,r,o)}),e.graph().nodeRankFactor=a}function Ce(e,n,r,t,a,i,o){var u=e.children(o);if(!u.length){o!==n&&e.setEdge(n,o,{weight:0,minlen:r});return}var d=te(e,"_bt"),s=te(e,"_bb"),c=e.node(o);e.setParent(d,o),c.borderTop=d,e.setParent(s,o),c.borderBottom=s,f(u,function(l){Ce(e,n,r,t,a,i,l);var h=e.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,b=h.borderTop?t:2*t,N=v!==p?1:a-i[o]+1;e.setEdge(d,v,{weight:b,minlen:N,nestingEdge:!0}),e.setEdge(p,s,{weight:b,minlen:N,nestingEdge:!0})}),e.parent(o)||e.setEdge(n,d,{weight:0,minlen:a+i[o]})}function Jn(e){var n={};function r(t,a){var i=e.children(t);i&&i.length&&f(i,function(o){r(o,a+1)}),n[t]=a}return f(e.children(),function(t){r(t,1)}),n}function Kn(e){return M(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Zn(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Qn(e,n,r){var t={},a;f(r,function(i){for(var o=e.parent(i),u,d;o;){if(u=e.parent(o),u?(d=t[u],t[u]=o):(d=a,a=o),d&&d!==o){n.setEdge(d,o);return}o=u}})}function er(e,n,r){var t=nr(e),a=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return e.node(i)});return f(e.nodes(),function(i){var o=e.node(i),u=e.parent(i);(o.rank===n||o.minRank<=n&&n<=o.maxRank)&&(a.setNode(i),a.setParent(i,u||t),f(e[r](i),function(d){var s=d.v===i?d.w:d.v,c=a.edge(s,i),l=m(c)?0:c.weight;a.setEdge(s,i,{weight:e.edge(d).weight+l})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&a.setNode(i,{borderLeft:o.borderLeft[n],borderRight:o.borderRight[n]}))}),a}function nr(e){for(var n;e.hasNode(n=H("_root")););return n}function rr(e,n){for(var r=0,t=1;t<n.length;++t)r+=tr(e,n[t-1],n[t]);return r}function tr(e,n,r){for(var t=vn(r,w(r,function(s,c){return c})),a=O(w(n,function(s){return R(w(e.outEdges(s),function(c){return{pos:t[c.w],weight:e.edge(c).weight}}),"pos")})),i=1;i<r.length;)i<<=1;var o=2*i-1;i-=1;var u=w(new Array(o),function(){return 0}),d=0;return f(a.forEach(function(s){var c=s.pos+i;u[c]+=s.weight;for(var l=0;c>0;)c%2&&(l+=u[c+1]),c=c-1>>1,u[c]+=s.weight;d+=s.weight*l})),d}function ar(e){var n={},r=_(e.nodes(),function(u){return!e.children(u).length}),t=y(w(r,function(u){return e.node(u).rank})),a=w(E(t+1),function(){return[]});function i(u){if(!ve(n,u)){n[u]=!0;var d=e.node(u);a[d.rank].push(u),f(e.successors(u),i)}}var o=R(r,function(u){return e.node(u).rank});return f(o,i),a}function ir(e,n){return w(n,function(r){var t=e.inEdges(r);if(t.length){var a=M(t,function(i,o){var u=e.edge(o),d=e.node(o.v);return{sum:i.sum+u.weight*d.order,weight:i.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}function or(e,n){var r={};f(e,function(a,i){var o=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};m(a.barycenter)||(o.barycenter=a.barycenter,o.weight=a.weight)}),f(n.edges(),function(a){var i=r[a.v],o=r[a.w];!m(i)&&!m(o)&&(o.indegree++,i.out.push(r[a.w]))});var t=_(r,function(a){return!a.indegree});return ur(t)}function ur(e){var n=[];function r(i){return function(o){o.merged||(m(o.barycenter)||m(i.barycenter)||o.barycenter>=i.barycenter)&&dr(i,o)}}function t(i){return function(o){o.in.push(i),--o.indegree===0&&e.push(o)}}for(;e.length;){var a=e.pop();n.push(a),f(a.in.reverse(),r(a)),f(a.out,t(a))}return w(_(n,function(i){return!i.merged}),function(i){return I(i,["vs","i","barycenter","weight"])})}function dr(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function sr(e,n){var r=Pn(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,a=R(r.rhs,function(c){return-c.i}),i=[],o=0,u=0,d=0;t.sort(fr(!!n)),d=de(i,a,d),f(t,function(c){d+=c.vs.length,i.push(c.vs),o+=c.barycenter*c.weight,u+=c.weight,d=de(i,a,d)});var s={vs:O(i)};return u&&(s.barycenter=o/u,s.weight=u),s}function de(e,n,r){for(var t;n.length&&(t=T(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function fr(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function _e(e,n,r,t){var a=e.children(n),i=e.node(n),o=i?i.borderLeft:void 0,u=i?i.borderRight:void 0,d={};o&&(a=_(a,function(p){return p!==o&&p!==u}));var s=ir(e,a);f(s,function(p){if(e.children(p.v).length){var b=_e(e,p.v,r,t);d[p.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&lr(p,b)}});var c=or(s,r);cr(c,d);var l=sr(c,t);if(o&&(l.vs=O([o,l.vs,u]),e.predecessors(o).length)){var h=e.node(e.predecessors(o)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function cr(e,n){f(e,function(r){r.vs=O(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function lr(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function hr(e){var n=me(e),r=se(e,E(1,n+1),"inEdges"),t=se(e,E(n-1,-1,-1),"outEdges"),a=ar(e);fe(e,a);for(var i=Number.POSITIVE_INFINITY,o,u=0,d=0;d<4;++u,++d){vr(u%2?r:t,u%4>=2),a=j(e);var s=rr(e,a);s<i&&(d=0,o=Ze(a),i=s)}fe(e,o)}function se(e,n,r){return w(n,function(t){return er(e,t,r)})}function vr(e,n){var r=new g;f(e,function(t){var a=t.graph().root,i=_e(t,a,r,n);f(i.vs,function(o,u){t.node(o).order=u}),Qn(t,r,i.vs)})}function fe(e,n){f(n,function(r){f(r,function(t,a){e.node(t).order=a})})}function pr(e){var n=br(e);f(e.graph().dummyChains,function(r){for(var t=e.node(r),a=t.edgeObj,i=wr(e,n,a.v,a.w),o=i.path,u=i.lca,d=0,s=o[d],c=!0;r!==a.w;){if(t=e.node(r),c){for(;(s=o[d])!==u&&e.node(s).maxRank<t.rank;)d++;s===u&&(c=!1)}if(!c){for(;d<o.length-1&&e.node(s=o[d+1]).minRank<=t.rank;)d++;s=o[d]}e.setParent(r,s),r=e.successors(r)[0]}})}function wr(e,n,r,t){var a=[],i=[],o=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),d,s;d=r;do d=e.parent(d),a.push(d);while(d&&(n[d].low>o||u>n[d].lim));for(s=d,d=t;(d=e.parent(d))!==s;)i.push(d);return{path:a.concat(i.reverse()),lca:s}}function br(e){var n={},r=0;function t(a){var i=r;f(e.children(a),t),n[a]={low:i,lim:r++}}return f(e.children(),t),n}function mr(e,n){var r={};function t(a,i){var o=0,u=0,d=a.length,s=T(i);return f(i,function(c,l){var h=yr(e,c),v=h?e.node(h).order:d;(h||c===s)&&(f(i.slice(u,l+1),function(p){f(e.predecessors(p),function(b){var N=e.node(b),Q=N.order;(Q<o||v<Q)&&!(N.dummy&&e.node(p).dummy)&&Re(r,b,p)})}),u=l+1,o=v)}),i}return M(n,t),r}function gr(e,n){var r={};function t(i,o,u,d,s){var c;f(E(o,u),function(l){c=i[l],e.node(c).dummy&&f(e.predecessors(c),function(h){var v=e.node(h);v.dummy&&(v.order<d||v.order>s)&&Re(r,h,c)})})}function a(i,o){var u=-1,d,s=0;return f(o,function(c,l){if(e.node(c).dummy==="border"){var h=e.predecessors(c);h.length&&(d=e.node(h[0]).order,t(o,s,l,u,d),s=l,u=d)}t(o,s,o.length,d,i.length)}),o}return M(n,a),r}function yr(e,n){if(e.node(n).dummy)return X(e.predecessors(n),function(r){return e.node(r).dummy})}function Re(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=e[n];Object.defineProperty(a,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function kr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function xr(e,n,r,t){var a={},i={},o={};return f(n,function(u){f(u,function(d,s){a[d]=d,i[d]=d,o[d]=s})}),f(n,function(u){var d=-1;f(u,function(s){var c=t(s);if(c.length){c=R(c,function(b){return o[b]});for(var l=(c.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=c[h];i[s]===s&&d<o[p]&&!kr(r,s,p)&&(i[p]=s,i[s]=a[s]=a[p],d=o[p])}}})}),{root:a,align:i}}function Er(e,n,r,t,a){var i={},o=Or(e,n,r,a),u=a?"borderLeft":"borderRight";function d(l,h){for(var v=o.nodes(),p=v.pop(),b={};p;)b[p]?l(p):(b[p]=!0,v.push(p),v=v.concat(h(p))),p=v.pop()}function s(l){i[l]=o.inEdges(l).reduce(function(h,v){return Math.max(h,i[v.v]+o.edge(v))},0)}function c(l){var h=o.outEdges(l).reduce(function(p,b){return Math.min(p,i[b.w]-o.edge(b))},Number.POSITIVE_INFINITY),v=e.node(l);h!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(i[l]=Math.max(i[l],h))}return d(s,o.predecessors.bind(o)),d(c,o.successors.bind(o)),f(t,function(l){i[l]=i[r[l]]}),i}function Or(e,n,r,t){var a=new g,i=e.graph(),o=_r(i.nodesep,i.edgesep,t);return f(n,function(u){var d;f(u,function(s){var c=r[s];if(a.setNode(c),d){var l=r[d],h=a.edge(l,c);a.setEdge(l,c,Math.max(o(e,s,d),h||0))}d=s})}),a}function Lr(e,n){return U(x(n),function(r){var t=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return Qe(r,function(i,o){var u=Rr(e,o)/2;t=Math.max(i+u,t),a=Math.min(i-u,a)}),t-a})}function Nr(e,n){var r=x(n),t=P(r),a=y(r);f(["u","d"],function(i){f(["l","r"],function(o){var u=i+o,d=e[u],s;if(d!==n){var c=x(d);s=o==="l"?t-P(c):a-y(c),s&&(e[u]=S(d,function(l){return l+s}))}})})}function Pr(e,n){return S(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var a=R(w(e,t));return(a[1]+a[2])/2})}function Cr(e){var n=j(e),r=$(mr(e,n),gr(e,n)),t={},a;f(["u","d"],function(o){a=o==="u"?n:x(n).reverse(),f(["l","r"],function(u){u==="r"&&(a=w(a,function(l){return x(l).reverse()}));var d=(o==="u"?e.predecessors:e.successors).bind(e),s=xr(e,a,r,d),c=Er(e,a,s.root,s.align,u==="r");u==="r"&&(c=S(c,function(l){return-l})),t[o+u]=c})});var i=Lr(e,t);return Nr(t,i),Pr(t,e.graph().align)}function _r(e,n,r){return function(t,a,i){var o=t.node(a),u=t.node(i),d=0,s;if(d+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=-o.width/2;break;case"r":s=o.width/2;break}if(s&&(d+=r?s:-s),s=0,d+=(o.dummy?n:e)/2,d+=(u.dummy?n:e)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2;break}return s&&(d+=r?s:-s),s=0,d}}function Rr(e,n){return e.node(n).width}function Tr(e){e=be(e),Ir(e),en(Cr(e),function(n,r){e.node(r).x=n})}function Ir(e){var n=j(e),r=e.graph().ranksep,t=0;f(n,function(a){var i=y(w(a,function(o){return e.node(o).height}));f(a,function(o){e.node(o).y=t+i/2}),t+=i+r})}function ot(e,n){var r=Cn;r("layout",()=>{var t=r(" buildLayoutGraph",()=>qr(e));r(" runLayout",()=>Mr(t,r)),r(" updateInputGraph",()=>Sr(e,t))})}function Mr(e,n){n(" makeSpaceForEdgeLabels",()=>$r(e)),n(" removeSelfEdges",()=>Qr(e)),n(" acyclic",()=>kn(e)),n(" nestingGraph.run",()=>Hn(e)),n(" rank",()=>zn(be(e))),n(" injectEdgeLabelProxies",()=>Wr(e)),n(" removeEmptyRanks",()=>Nn(e)),n(" nestingGraph.cleanup",()=>Zn(e)),n(" normalizeRanks",()=>Ln(e)),n(" assignRankMinMax",()=>zr(e)),n(" removeEdgeLabelProxies",()=>Xr(e)),n(" normalize.run",()=>Sn(e)),n(" parentDummyChains",()=>pr(e)),n(" addBorderSegments",()=>_n(e)),n(" order",()=>hr(e)),n(" insertSelfEdges",()=>et(e)),n(" adjustCoordinateSystem",()=>Rn(e)),n(" position",()=>Tr(e)),n(" positionSelfEdges",()=>nt(e)),n(" removeBorderNodes",()=>Zr(e)),n(" normalize.undo",()=>Fn(e)),n(" fixupEdgeLabelCoords",()=>Jr(e)),n(" undoCoordinateSystem",()=>Tn(e)),n(" translateGraph",()=>Ur(e)),n(" assignNodeIntersects",()=>Hr(e)),n(" reversePoints",()=>Kr(e)),n(" acyclic.undo",()=>En(e))}function Sr(e,n){f(e.nodes(),function(r){var t=e.node(r),a=n.node(r);t&&(t.x=a.x,t.y=a.y,n.children(r).length&&(t.width=a.width,t.height=a.height))}),f(e.edges(),function(r){var t=e.edge(r),a=n.edge(r);t.points=a.points,Object.prototype.hasOwnProperty.call(a,"x")&&(t.x=a.x,t.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var jr=["nodesep","edgesep","ranksep","marginx","marginy"],Fr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Vr=["acyclicer","ranker","rankdir","align"],Ar=["width","height"],Br={width:0,height:0},Gr=["minlen","weight","width","height","labeloffset"],Yr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Dr=["labelpos"];function qr(e){var n=new g({multigraph:!0,compound:!0}),r=D(e.graph());return n.setGraph($({},Fr,Y(r,jr),I(r,Vr))),f(e.nodes(),function(t){var a=D(e.node(t));n.setNode(t,Be(Y(a,Ar),Br)),n.setParent(t,e.parent(t))}),f(e.edges(),function(t){var a=D(e.edge(t));n.setEdge(t,$({},Yr,Y(a,Gr),I(a,Dr)))}),n}function $r(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Wr(e){f(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),a=e.node(n.w),i={rank:(a.rank-t.rank)/2+t.rank,e:n};L(e,"edge-proxy",i,"_ep")}})}function zr(e){var n=0;f(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=y(n,t.maxRank))}),e.graph().maxRank=n}function Xr(e){f(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Ur(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,a=0,i=e.graph(),o=i.marginx||0,u=i.marginy||0;function d(s){var c=s.x,l=s.y,h=s.width,v=s.height;n=Math.min(n,c-h/2),r=Math.max(r,c+h/2),t=Math.min(t,l-v/2),a=Math.max(a,l+v/2)}f(e.nodes(),function(s){d(e.node(s))}),f(e.edges(),function(s){var c=e.edge(s);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),n-=o,t-=u,f(e.nodes(),function(s){var c=e.node(s);c.x-=n,c.y-=t}),f(e.edges(),function(s){var c=e.edge(s);f(c.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),i.width=r-n+o,i.height=a-t+u}function Hr(e){f(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),a=e.node(n.w),i,o;r.points?(i=r.points[0],o=r.points[r.points.length-1]):(r.points=[],i=a,o=t),r.points.unshift(re(t,i)),r.points.push(re(a,o))})}function Jr(e){f(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Kr(e){f(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Zr(e){f(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),a=e.node(r.borderBottom),i=e.node(T(r.borderLeft)),o=e.node(T(r.borderRight));r.width=Math.abs(o.x-i.x),r.height=Math.abs(a.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function Qr(e){f(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function et(e){var n=j(e);f(n,function(r){var t=0;f(r,function(a,i){var o=e.node(a);o.order=i+t,f(o.selfEdges,function(u){L(e,"selfedge",{width:u.label.width,height:u.label.height,rank:o.rank,order:i+ ++t,e:u.e,label:u.label},"_se")}),delete o.selfEdges})})}function nt(e){f(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),a=t.x+t.width/2,i=t.y,o=r.x-a,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:a+2*o/3,y:i-u},{x:a+5*o/6,y:i-u},{x:a+o,y:i},{x:a+5*o/6,y:i+u},{x:a+2*o/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}})}function Y(e,n){return S(I(e,n),Number)}function D(e){var n={};return f(e,function(r,t){n[t.toLowerCase()]=r}),n}export{ot as l};
@@ -1,4 +1,4 @@
1
- import{g as le}from"./chunk-55IACEB6-DaMm9Sm9.js";import{s as he}from"./chunk-QN33PNHL-B359CDxs.js";import{_ as l,l as C,o as de,r as ge,E as j,c as X,i as F,ap as ue,V as pe,W as fe,X as ye}from"./MermaidRenderer-b4CLxUY2.js";import"./index-wu56yLEv.js";import"./purify.es-A66Cw1IH.js";import"./step-EjIQ8UIn.js";const E=[];for(let t=0;t<256;++t)E.push((t+256).toString(16).slice(1));function me(t,e=0){return(E[t[e+0]]+E[t[e+1]]+E[t[e+2]]+E[t[e+3]]+"-"+E[t[e+4]]+E[t[e+5]]+"-"+E[t[e+6]]+E[t[e+7]]+"-"+E[t[e+8]]+E[t[e+9]]+"-"+E[t[e+10]]+E[t[e+11]]+E[t[e+12]]+E[t[e+13]]+E[t[e+14]]+E[t[e+15]]).toLowerCase()}let Y;const Ee=new Uint8Array(16);function _e(){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(Ee)}const be=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ne={randomUUID:be};function Se(t,e,n){var u;if(ne.randomUUID&&!t)return ne.randomUUID();t=t||{};const c=t.random??((u=t.rng)==null?void 0:u.call(t))??_e();if(c.length<16)throw new Error("Random bytes length must be >= 16");return c[6]=c[6]&15|64,c[8]=c[8]&63|128,me(c)}var q=function(){var t=l(function(v,s,i,o){for(i=i||{},o=v.length;o--;i[v[o]]=s);return i},"o"),e=[1,4],n=[1,13],c=[1,12],u=[1,15],h=[1,16],p=[1,20],y=[1,19],_=[6,7,8],b=[1,26],m=[1,24],w=[1,25],D=[6,7,11],J=[1,6,13,15,16,19,22],K=[1,33],Q=[1,34],A=[1,6,7,11,13,15,16,19,22],G={trace:l(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:l(function(s,i,o,a,g,r,U){var d=r.length-1;switch(g){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",r[d].id),a.addNode(r[d-1].length,r[d].id,r[d].descr,r[d].type);break;case 16:a.getLogger().trace("Icon: ",r[d]),a.decorateNode({icon:r[d]});break;case 17:case 21:a.decorateNode({class:r[d]});break;case 18:a.getLogger().trace("SPACELIST");break;case 19:a.getLogger().trace("Node: ",r[d].id),a.addNode(0,r[d].id,r[d].descr,r[d].type);break;case 20:a.decorateNode({icon:r[d]});break;case 25:a.getLogger().trace("node found ..",r[d-2]),this.$={id:r[d-1],descr:r[d-1],type:a.getType(r[d-2],r[d])};break;case 26:this.$={id:r[d],descr:r[d],type:a.nodeType.DEFAULT};break;case 27:a.getLogger().trace("node found ..",r[d-3]),this.$={id:r[d-3],descr:r[d-1],type:a.getType(r[d-2],r[d])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:n,7:[1,10],9:9,12:11,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},t(_,[2,3]),{1:[2,2]},t(_,[2,4]),t(_,[2,5]),{1:[2,6],6:n,12:21,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},{6:n,9:22,12:11,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},{6:b,7:m,10:23,11:w},t(D,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(D,[2,18]),t(D,[2,19]),t(D,[2,20]),t(D,[2,21]),t(D,[2,23]),t(D,[2,24]),t(D,[2,26],{19:[1,30]}),{20:[1,31]},{6:b,7:m,10:32,11:w},{1:[2,7],6:n,12:21,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},t(J,[2,14],{7:K,11:Q}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(D,[2,15]),t(D,[2,16]),t(D,[2,17]),{20:[1,35]},{21:[1,36]},t(J,[2,13],{7:K,11:Q}),t(A,[2,11]),t(A,[2,12]),{21:[1,37]},t(D,[2,25]),t(D,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],a=[],g=[null],r=[],U=this.table,d="",V=0,Z=0,re=2,ee=1,oe=r.slice.call(arguments,1),f=Object.create(this.lexer),T={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(T.yy[H]=this.yy[H]);f.setInput(s,T.yy),T.yy.lexer=f,T.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var $=f.yylloc;r.push($);var ae=f.options&&f.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(N){o.length=o.length-2*N,g.length=g.length-N,r.length=r.length-N}l(ce,"popStack");function te(){var N;return N=a.pop()||f.lex()||ee,typeof N!="number"&&(N instanceof Array&&(a=N,N=a.pop()),N=i.symbols_[N]||N),N}l(te,"lex");for(var S,O,k,W,I={},M,L,ie,B;;){if(O=o[o.length-1],this.defaultActions[O]?k=this.defaultActions[O]:((S===null||typeof S>"u")&&(S=te()),k=U[O]&&U[O][S]),typeof k>"u"||!k.length||!k[0]){var z="";B=[];for(M in U[O])this.terminals_[M]&&M>re&&B.push("'"+this.terminals_[M]+"'");f.showPosition?z="Parse error on line "+(V+1)+`:
1
+ import{g as le}from"./chunk-55IACEB6-BAPmvzOA.js";import{s as he}from"./chunk-QN33PNHL-2G6RGO0y.js";import{_ as l,l as C,o as de,r as ge,E as j,c as X,i as F,ap as ue,V as pe,W as fe,X as ye}from"./MermaidRenderer-By9E8Mka.js";import"./index-CX9xMrSE.js";import"./purify.es-A66Cw1IH.js";import"./step-EjIQ8UIn.js";const E=[];for(let t=0;t<256;++t)E.push((t+256).toString(16).slice(1));function me(t,e=0){return(E[t[e+0]]+E[t[e+1]]+E[t[e+2]]+E[t[e+3]]+"-"+E[t[e+4]]+E[t[e+5]]+"-"+E[t[e+6]]+E[t[e+7]]+"-"+E[t[e+8]]+E[t[e+9]]+"-"+E[t[e+10]]+E[t[e+11]]+E[t[e+12]]+E[t[e+13]]+E[t[e+14]]+E[t[e+15]]).toLowerCase()}let Y;const Ee=new Uint8Array(16);function _e(){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(Ee)}const be=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ne={randomUUID:be};function Se(t,e,n){var u;if(ne.randomUUID&&!t)return ne.randomUUID();t=t||{};const c=t.random??((u=t.rng)==null?void 0:u.call(t))??_e();if(c.length<16)throw new Error("Random bytes length must be >= 16");return c[6]=c[6]&15|64,c[8]=c[8]&63|128,me(c)}var q=function(){var t=l(function(v,s,i,o){for(i=i||{},o=v.length;o--;i[v[o]]=s);return i},"o"),e=[1,4],n=[1,13],c=[1,12],u=[1,15],h=[1,16],p=[1,20],y=[1,19],_=[6,7,8],b=[1,26],m=[1,24],w=[1,25],D=[6,7,11],J=[1,6,13,15,16,19,22],K=[1,33],Q=[1,34],A=[1,6,7,11,13,15,16,19,22],G={trace:l(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:l(function(s,i,o,a,g,r,U){var d=r.length-1;switch(g){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",r[d].id),a.addNode(r[d-1].length,r[d].id,r[d].descr,r[d].type);break;case 16:a.getLogger().trace("Icon: ",r[d]),a.decorateNode({icon:r[d]});break;case 17:case 21:a.decorateNode({class:r[d]});break;case 18:a.getLogger().trace("SPACELIST");break;case 19:a.getLogger().trace("Node: ",r[d].id),a.addNode(0,r[d].id,r[d].descr,r[d].type);break;case 20:a.decorateNode({icon:r[d]});break;case 25:a.getLogger().trace("node found ..",r[d-2]),this.$={id:r[d-1],descr:r[d-1],type:a.getType(r[d-2],r[d])};break;case 26:this.$={id:r[d],descr:r[d],type:a.nodeType.DEFAULT};break;case 27:a.getLogger().trace("node found ..",r[d-3]),this.$={id:r[d-3],descr:r[d-1],type:a.getType(r[d-2],r[d])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:n,7:[1,10],9:9,12:11,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},t(_,[2,3]),{1:[2,2]},t(_,[2,4]),t(_,[2,5]),{1:[2,6],6:n,12:21,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},{6:n,9:22,12:11,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},{6:b,7:m,10:23,11:w},t(D,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(D,[2,18]),t(D,[2,19]),t(D,[2,20]),t(D,[2,21]),t(D,[2,23]),t(D,[2,24]),t(D,[2,26],{19:[1,30]}),{20:[1,31]},{6:b,7:m,10:32,11:w},{1:[2,7],6:n,12:21,13:c,14:14,15:u,16:h,17:17,18:18,19:p,22:y},t(J,[2,14],{7:K,11:Q}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(D,[2,15]),t(D,[2,16]),t(D,[2,17]),{20:[1,35]},{21:[1,36]},t(J,[2,13],{7:K,11:Q}),t(A,[2,11]),t(A,[2,12]),{21:[1,37]},t(D,[2,25]),t(D,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],a=[],g=[null],r=[],U=this.table,d="",V=0,Z=0,re=2,ee=1,oe=r.slice.call(arguments,1),f=Object.create(this.lexer),T={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(T.yy[H]=this.yy[H]);f.setInput(s,T.yy),T.yy.lexer=f,T.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var $=f.yylloc;r.push($);var ae=f.options&&f.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(N){o.length=o.length-2*N,g.length=g.length-N,r.length=r.length-N}l(ce,"popStack");function te(){var N;return N=a.pop()||f.lex()||ee,typeof N!="number"&&(N instanceof Array&&(a=N,N=a.pop()),N=i.symbols_[N]||N),N}l(te,"lex");for(var S,O,k,W,I={},M,L,ie,B;;){if(O=o[o.length-1],this.defaultActions[O]?k=this.defaultActions[O]:((S===null||typeof S>"u")&&(S=te()),k=U[O]&&U[O][S]),typeof k>"u"||!k.length||!k[0]){var z="";B=[];for(M in U[O])this.terminals_[M]&&M>re&&B.push("'"+this.terminals_[M]+"'");f.showPosition?z="Parse error on line "+(V+1)+`:
2
2
  `+f.showPosition()+`
3
3
  Expecting `+B.join(", ")+", got '"+(this.terminals_[S]||S)+"'":z="Parse error on line "+(V+1)+": Unexpected "+(S==ee?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(z,{text:f.match,token:this.terminals_[S]||S,line:f.yylineno,loc:$,expected:B})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+S);switch(k[0]){case 1:o.push(S),g.push(f.yytext),r.push(f.yylloc),o.push(k[1]),S=null,Z=f.yyleng,d=f.yytext,V=f.yylineno,$=f.yylloc;break;case 2:if(L=this.productions_[k[1]][1],I.$=g[g.length-L],I._$={first_line:r[r.length-(L||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(L||1)].first_column,last_column:r[r.length-1].last_column},ae&&(I._$.range=[r[r.length-(L||1)].range[0],r[r.length-1].range[1]]),W=this.performAction.apply(I,[d,Z,V,T.yy,k[1],g,r].concat(oe)),typeof W<"u")return W;L&&(o=o.slice(0,-1*L*2),g=g.slice(0,-1*L),r=r.slice(0,-1*L)),o.push(this.productions_[k[1]][0]),g.push(I.$),r.push(I._$),ie=U[o[o.length-2]][o[o.length-1]],o.push(ie);break;case 3:return!0}}return!0},"parse")},se=function(){var v={EOF:1,parseError:l(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:l(function(s,i){return this.yy=i||this.yy||{},this._input=s,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:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var a=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 g=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===a.length?this.yylloc.first_column:0)+a[a.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`