chordsheetjs 6.2.2 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -9
- package/lib/bundle.js +607 -596
- package/lib/index.html +40 -0
- package/lib/index.js +607 -596
- package/lib/index.js.map +1 -1
- package/lib/main.d.ts +73 -21
- package/lib/main.d.ts.map +1 -1
- package/package.json +6 -6
package/lib/bundle.js
CHANGED
|
@@ -49,7 +49,7 @@ $parcel$export(module.exports, "NUMERIC", () => $af8d31735c159a26$export$4d31898
|
|
|
49
49
|
// https://peggyjs.org/ https://github.com/metadevpro/ts-pegjs
|
|
50
50
|
"use strict";
|
|
51
51
|
function $1a506a341538d943$var$peg$padEnd(str, targetLength, padString) {
|
|
52
|
-
padString = padString ||
|
|
52
|
+
padString = padString || " ";
|
|
53
53
|
if (str.length > targetLength) return str;
|
|
54
54
|
targetLength -= str.length;
|
|
55
55
|
padString += padString.repeat(targetLength);
|
|
@@ -61,19 +61,15 @@ class $1a506a341538d943$export$f21cea08b0dd60e8 extends Error {
|
|
|
61
61
|
return ch.charCodeAt(0).toString(16).toUpperCase();
|
|
62
62
|
}
|
|
63
63
|
function literalEscape(s) {
|
|
64
|
-
return s.replace(/\\/g, "\\\\").replace(/"/g, "
|
|
65
|
-
).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch)=>"\\x" + hex(ch)
|
|
66
|
-
);
|
|
64
|
+
return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch)=>"\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch)=>"\\x" + hex(ch));
|
|
67
65
|
}
|
|
68
66
|
function classEscape(s) {
|
|
69
|
-
return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch)=>"\\x0" + hex(ch)
|
|
70
|
-
).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch)=>"\\x" + hex(ch)
|
|
71
|
-
);
|
|
67
|
+
return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch)=>"\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch)=>"\\x" + hex(ch));
|
|
72
68
|
}
|
|
73
69
|
function describeExpectation(expectation) {
|
|
74
70
|
switch(expectation.type){
|
|
75
71
|
case "literal":
|
|
76
|
-
return "
|
|
72
|
+
return '"' + literalEscape(expectation.text) + '"';
|
|
77
73
|
case "class":
|
|
78
74
|
const escapedParts = expectation.parts.map((part)=>{
|
|
79
75
|
return Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part);
|
|
@@ -109,7 +105,7 @@ class $1a506a341538d943$export$f21cea08b0dd60e8 extends Error {
|
|
|
109
105
|
}
|
|
110
106
|
}
|
|
111
107
|
function describeFound(found1) {
|
|
112
|
-
return found1 ? "
|
|
108
|
+
return found1 ? '"' + literalEscape(found1) + '"' : "end of input";
|
|
113
109
|
}
|
|
114
110
|
return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
|
|
115
111
|
}
|
|
@@ -125,7 +121,7 @@ class $1a506a341538d943$export$f21cea08b0dd60e8 extends Error {
|
|
|
125
121
|
if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, $1a506a341538d943$export$f21cea08b0dd60e8);
|
|
126
122
|
}
|
|
127
123
|
format(sources) {
|
|
128
|
-
let str =
|
|
124
|
+
let str = "Error: " + this.message;
|
|
129
125
|
if (this.location) {
|
|
130
126
|
let src = null;
|
|
131
127
|
let k;
|
|
@@ -134,14 +130,14 @@ class $1a506a341538d943$export$f21cea08b0dd60e8 extends Error {
|
|
|
134
130
|
break;
|
|
135
131
|
}
|
|
136
132
|
let s = this.location.start;
|
|
137
|
-
let loc = this.location.source +
|
|
133
|
+
let loc = this.location.source + ":" + s.line + ":" + s.column;
|
|
138
134
|
if (src) {
|
|
139
135
|
let e = this.location.end;
|
|
140
|
-
let filler = $1a506a341538d943$var$peg$padEnd(
|
|
136
|
+
let filler = $1a506a341538d943$var$peg$padEnd("", s.line.toString().length, " ");
|
|
141
137
|
let line = src[s.line - 1];
|
|
142
138
|
let last = s.line === e.line ? e.column : line.length + 1;
|
|
143
|
-
str +=
|
|
144
|
-
} else str +=
|
|
139
|
+
str += "\n --> " + loc + "\n" + filler + " |\n" + s.line + " | " + line + "\n" + filler + " | " + $1a506a341538d943$var$peg$padEnd("", s.column - 1, " ") + $1a506a341538d943$var$peg$padEnd("", last - s.column, "^");
|
|
140
|
+
} else str += "\n at " + loc;
|
|
145
141
|
}
|
|
146
142
|
return str;
|
|
147
143
|
}
|
|
@@ -172,21 +168,20 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
172
168
|
items: [
|
|
173
169
|
lyrics ? {
|
|
174
170
|
type: "chordLyricsPair",
|
|
175
|
-
chords:
|
|
171
|
+
chords: "",
|
|
176
172
|
lyrics: lyrics
|
|
177
173
|
} : null,
|
|
178
174
|
...tokens,
|
|
179
175
|
chords ? {
|
|
180
176
|
type: "chordLyricsPair",
|
|
181
177
|
chords: chords,
|
|
182
|
-
lyrics:
|
|
178
|
+
lyrics: ""
|
|
183
179
|
} : null,
|
|
184
180
|
comment ? {
|
|
185
181
|
type: "comment",
|
|
186
182
|
comment: comment
|
|
187
183
|
} : null
|
|
188
|
-
].filter((x)=>x
|
|
189
|
-
)
|
|
184
|
+
].filter((x)=>x)
|
|
190
185
|
};
|
|
191
186
|
};
|
|
192
187
|
const peg$c3 = "#";
|
|
@@ -202,21 +197,19 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
202
197
|
const peg$c8 = function(chords, lyrics) {
|
|
203
198
|
return {
|
|
204
199
|
type: "chordLyricsPair",
|
|
205
|
-
chords: chords ||
|
|
200
|
+
chords: chords || "",
|
|
206
201
|
lyrics: lyrics
|
|
207
202
|
};
|
|
208
203
|
};
|
|
209
204
|
const peg$c9 = function(lyrics) {
|
|
210
|
-
return lyrics.map((c)=>c.char || c
|
|
211
|
-
).join("");
|
|
205
|
+
return lyrics.map((c)=>c.char || c).join("");
|
|
212
206
|
};
|
|
213
207
|
const peg$c10 = "[";
|
|
214
208
|
const peg$c11 = peg$literalExpectation("[", false);
|
|
215
209
|
const peg$c12 = "]";
|
|
216
210
|
const peg$c13 = peg$literalExpectation("]", false);
|
|
217
211
|
const peg$c14 = function(chords) {
|
|
218
|
-
return chords.map((c)=>c.char || c
|
|
219
|
-
).join("");
|
|
212
|
+
return chords.map((c)=>c.char || c).join("");
|
|
220
213
|
};
|
|
221
214
|
const peg$c15 = /^[^\]\r\n]/;
|
|
222
215
|
const peg$c16 = peg$classExpectation([
|
|
@@ -298,7 +291,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
298
291
|
const peg$c37 = function() {
|
|
299
292
|
return {
|
|
300
293
|
type: "char",
|
|
301
|
-
char: "
|
|
294
|
+
char: "}"
|
|
302
295
|
};
|
|
303
296
|
};
|
|
304
297
|
const peg$c38 = /^[^|[\]\\{}%#\r\n]/;
|
|
@@ -325,7 +318,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
325
318
|
const peg$c43 = function() {
|
|
326
319
|
return {
|
|
327
320
|
type: "char",
|
|
328
|
-
char: "
|
|
321
|
+
char: "{"
|
|
329
322
|
};
|
|
330
323
|
};
|
|
331
324
|
const peg$c44 = "%";
|
|
@@ -353,8 +346,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
353
346
|
const peg$c49 = ":";
|
|
354
347
|
const peg$c50 = peg$literalExpectation(":", false);
|
|
355
348
|
const peg$c51 = function(tagValue) {
|
|
356
|
-
return tagValue.map((c)=>c.char || c
|
|
357
|
-
).join('');
|
|
349
|
+
return tagValue.map((c)=>c.char || c).join("");
|
|
358
350
|
};
|
|
359
351
|
const peg$c52 = /^[a-zA-Z\-_]/;
|
|
360
352
|
const peg$c53 = peg$classExpectation([
|
|
@@ -380,7 +372,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
380
372
|
const peg$c57 = /^[ \t\n\r]/;
|
|
381
373
|
const peg$c58 = peg$classExpectation([
|
|
382
374
|
" ",
|
|
383
|
-
"
|
|
375
|
+
" ",
|
|
384
376
|
"\n",
|
|
385
377
|
"\r"
|
|
386
378
|
], false, false);
|
|
@@ -388,7 +380,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
388
380
|
const peg$c60 = /^[ \t]/;
|
|
389
381
|
const peg$c61 = peg$classExpectation([
|
|
390
382
|
" ",
|
|
391
|
-
"
|
|
383
|
+
" "
|
|
392
384
|
], false, false);
|
|
393
385
|
const peg$c62 = "\n";
|
|
394
386
|
const peg$c63 = peg$literalExpectation("\n", false);
|
|
@@ -407,7 +399,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
407
399
|
let peg$silentFails = 0;
|
|
408
400
|
let peg$result;
|
|
409
401
|
if (options.startRule !== undefined) {
|
|
410
|
-
if (!(options.startRule in peg$startRuleFunctions)) throw new Error("Can't start parsing from rule \"" + options.startRule + "
|
|
402
|
+
if (!(options.startRule in peg$startRuleFunctions)) throw new Error("Can't start parsing from rule \"" + options.startRule + '".');
|
|
411
403
|
peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
|
|
412
404
|
}
|
|
413
405
|
function text() {
|
|
@@ -1653,27 +1645,27 @@ class $e1378a714a1834c5$var$Literal {
|
|
|
1653
1645
|
var $e1378a714a1834c5$export$2e2bcd8739ae039 = $e1378a714a1834c5$var$Literal;
|
|
1654
1646
|
|
|
1655
1647
|
|
|
1656
|
-
const $af8d31735c159a26$export$4b194284baed1659 =
|
|
1657
|
-
const $af8d31735c159a26$export$8db6c706fc9142b2 =
|
|
1658
|
-
const $af8d31735c159a26$export$c53d0f541b41b88e =
|
|
1659
|
-
const $af8d31735c159a26$export$c5a6fe907430212e =
|
|
1660
|
-
const $af8d31735c159a26$export$f1c9dd0f5207dd5e =
|
|
1661
|
-
const $af8d31735c159a26$export$27c95a7104c1f7aa =
|
|
1662
|
-
const $af8d31735c159a26$export$4d318981b5a83836 =
|
|
1663
|
-
const $af8d31735c159a26$export$1321df9b16c30c6a =
|
|
1648
|
+
const $af8d31735c159a26$export$4b194284baed1659 = "verse";
|
|
1649
|
+
const $af8d31735c159a26$export$8db6c706fc9142b2 = "chorus";
|
|
1650
|
+
const $af8d31735c159a26$export$c53d0f541b41b88e = "none";
|
|
1651
|
+
const $af8d31735c159a26$export$c5a6fe907430212e = "indeterminate";
|
|
1652
|
+
const $af8d31735c159a26$export$f1c9dd0f5207dd5e = "tab";
|
|
1653
|
+
const $af8d31735c159a26$export$27c95a7104c1f7aa = "symbol";
|
|
1654
|
+
const $af8d31735c159a26$export$4d318981b5a83836 = "numeric";
|
|
1655
|
+
const $af8d31735c159a26$export$1321df9b16c30c6a = "numeral";
|
|
1664
1656
|
const $af8d31735c159a26$export$6145372d252f6576 = [
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1657
|
+
"I",
|
|
1658
|
+
"II",
|
|
1659
|
+
"III",
|
|
1660
|
+
"IV",
|
|
1661
|
+
"V",
|
|
1662
|
+
"VI",
|
|
1663
|
+
"VII"
|
|
1672
1664
|
];
|
|
1673
1665
|
|
|
1674
1666
|
|
|
1675
|
-
const $8fcf445ea0999053$var$A =
|
|
1676
|
-
const $8fcf445ea0999053$var$G =
|
|
1667
|
+
const $8fcf445ea0999053$var$A = "A".charCodeAt(0);
|
|
1668
|
+
const $8fcf445ea0999053$var$G = "G".charCodeAt(0);
|
|
1677
1669
|
const $8fcf445ea0999053$var$TRANSPOSE_DISTANCE_MAJOR = [
|
|
1678
1670
|
null,
|
|
1679
1671
|
0,
|
|
@@ -1704,14 +1696,14 @@ function $8fcf445ea0999053$var$clamp(note, min, max) {
|
|
|
1704
1696
|
return newNote;
|
|
1705
1697
|
}
|
|
1706
1698
|
function $8fcf445ea0999053$var$numeralToNumber(numeral) {
|
|
1707
|
-
for(let i = 0, count = $af8d31735c159a26$export$6145372d252f6576.length; i < count; i += 1){
|
|
1708
|
-
const romanNumeral = $af8d31735c159a26$export$6145372d252f6576[i];
|
|
1699
|
+
for(let i = 0, count = (0, $af8d31735c159a26$export$6145372d252f6576).length; i < count; i += 1){
|
|
1700
|
+
const romanNumeral = (0, $af8d31735c159a26$export$6145372d252f6576)[i];
|
|
1709
1701
|
if (romanNumeral === numeral || romanNumeral.toLowerCase() === numeral) return i + 1;
|
|
1710
1702
|
}
|
|
1711
1703
|
return null;
|
|
1712
1704
|
}
|
|
1713
1705
|
function $8fcf445ea0999053$var$numberToNumeral(number) {
|
|
1714
|
-
return $af8d31735c159a26$export$6145372d252f6576[number - 1];
|
|
1706
|
+
return (0, $af8d31735c159a26$export$6145372d252f6576)[number - 1];
|
|
1715
1707
|
}
|
|
1716
1708
|
class $8fcf445ea0999053$var$Note {
|
|
1717
1709
|
constructor({ note: note , type: type , minor: minor = false }){
|
|
@@ -1722,16 +1714,16 @@ class $8fcf445ea0999053$var$Note {
|
|
|
1722
1714
|
static parse(note) {
|
|
1723
1715
|
if (/^[A-Ga-g]$/.test(note)) return new $8fcf445ea0999053$var$Note({
|
|
1724
1716
|
note: note.toUpperCase(),
|
|
1725
|
-
type: $af8d31735c159a26$export$27c95a7104c1f7aa
|
|
1717
|
+
type: (0, $af8d31735c159a26$export$27c95a7104c1f7aa)
|
|
1726
1718
|
});
|
|
1727
1719
|
if (/^[1-7]$/.test(note)) return new $8fcf445ea0999053$var$Note({
|
|
1728
1720
|
note: parseInt(note, 10),
|
|
1729
|
-
type: $af8d31735c159a26$export$4d318981b5a83836
|
|
1721
|
+
type: (0, $af8d31735c159a26$export$4d318981b5a83836)
|
|
1730
1722
|
});
|
|
1731
1723
|
const romanNumeralValue = $8fcf445ea0999053$var$numeralToNumber(note);
|
|
1732
1724
|
if (romanNumeralValue) return new $8fcf445ea0999053$var$Note({
|
|
1733
1725
|
note: romanNumeralValue,
|
|
1734
|
-
type: $af8d31735c159a26$export$1321df9b16c30c6a,
|
|
1726
|
+
type: (0, $af8d31735c159a26$export$1321df9b16c30c6a),
|
|
1735
1727
|
minor: note.toLowerCase() === note
|
|
1736
1728
|
});
|
|
1737
1729
|
throw new Error(`Invalid note ${note}`);
|
|
@@ -1739,14 +1731,14 @@ class $8fcf445ea0999053$var$Note {
|
|
|
1739
1731
|
toNumeral() {
|
|
1740
1732
|
if (this.isNumeral()) return this.clone();
|
|
1741
1733
|
if (this.isNumeric()) return this.set({
|
|
1742
|
-
type: $af8d31735c159a26$export$1321df9b16c30c6a
|
|
1734
|
+
type: (0, $af8d31735c159a26$export$1321df9b16c30c6a)
|
|
1743
1735
|
});
|
|
1744
1736
|
throw new Error(`Converting a ${this.type} note to numeral is not supported`);
|
|
1745
1737
|
}
|
|
1746
1738
|
toNumeric() {
|
|
1747
1739
|
if (this.isNumeric()) return this.clone();
|
|
1748
1740
|
if (this.isNumeral()) return this.set({
|
|
1749
|
-
type: $af8d31735c159a26$export$4d318981b5a83836
|
|
1741
|
+
type: (0, $af8d31735c159a26$export$4d318981b5a83836)
|
|
1750
1742
|
});
|
|
1751
1743
|
throw new Error(`Converting a ${this.type} note to numeric is not supported`);
|
|
1752
1744
|
}
|
|
@@ -1769,13 +1761,13 @@ class $8fcf445ea0999053$var$Note {
|
|
|
1769
1761
|
return options.includes(this._note);
|
|
1770
1762
|
}
|
|
1771
1763
|
isNumeric() {
|
|
1772
|
-
return this.is($af8d31735c159a26$export$4d318981b5a83836);
|
|
1764
|
+
return this.is((0, $af8d31735c159a26$export$4d318981b5a83836));
|
|
1773
1765
|
}
|
|
1774
1766
|
isChordSymbol() {
|
|
1775
|
-
return this.is($af8d31735c159a26$export$27c95a7104c1f7aa);
|
|
1767
|
+
return this.is((0, $af8d31735c159a26$export$27c95a7104c1f7aa));
|
|
1776
1768
|
}
|
|
1777
1769
|
isNumeral() {
|
|
1778
|
-
return this.is($af8d31735c159a26$export$1321df9b16c30c6a);
|
|
1770
|
+
return this.is((0, $af8d31735c159a26$export$1321df9b16c30c6a));
|
|
1779
1771
|
}
|
|
1780
1772
|
is(noteType) {
|
|
1781
1773
|
return this.type === noteType;
|
|
@@ -1826,121 +1818,121 @@ var $8fcf445ea0999053$export$2e2bcd8739ae039 = $8fcf445ea0999053$var$Note;
|
|
|
1826
1818
|
|
|
1827
1819
|
|
|
1828
1820
|
var $6ebb068142750218$export$2e2bcd8739ae039 = {
|
|
1829
|
-
|
|
1830
|
-
|
|
1821
|
+
"Ab": {
|
|
1822
|
+
"B": "Cb"
|
|
1831
1823
|
},
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1824
|
+
"Cb": {
|
|
1825
|
+
"B": "Cb",
|
|
1826
|
+
"A#": "Bb",
|
|
1827
|
+
"E": "Fb"
|
|
1836
1828
|
},
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1829
|
+
"C": {
|
|
1830
|
+
"C#": "Db",
|
|
1831
|
+
"D#": "Eb",
|
|
1832
|
+
"F#": "Gb",
|
|
1833
|
+
"G#": "Ab",
|
|
1834
|
+
"A#": "Bb"
|
|
1843
1835
|
},
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1836
|
+
"C#": {
|
|
1837
|
+
"D#": "Eb",
|
|
1838
|
+
"A#": "Bb"
|
|
1847
1839
|
},
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1840
|
+
"Db": {
|
|
1841
|
+
"B": "Cb",
|
|
1842
|
+
"F#": "Gb"
|
|
1851
1843
|
},
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1844
|
+
"D": {
|
|
1845
|
+
"D#": "Eb",
|
|
1846
|
+
"A#": "Bb"
|
|
1855
1847
|
},
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1848
|
+
"E": {
|
|
1849
|
+
"Ab": "G#",
|
|
1850
|
+
"A#": "Bb",
|
|
1851
|
+
"D#": "Eb"
|
|
1860
1852
|
},
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1853
|
+
"F": {
|
|
1854
|
+
"A#": "Bb",
|
|
1855
|
+
"F#": "Gb",
|
|
1856
|
+
"C#": "Db",
|
|
1857
|
+
"D#": "Eb",
|
|
1858
|
+
"G#": "Ab"
|
|
1867
1859
|
},
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1860
|
+
"F#": {
|
|
1861
|
+
"A#": "Bb",
|
|
1862
|
+
"D#": "Eb"
|
|
1871
1863
|
},
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1864
|
+
"Gb": {
|
|
1865
|
+
"A#": "Bb",
|
|
1866
|
+
"D#": "Eb",
|
|
1867
|
+
"G#": "Ab",
|
|
1868
|
+
"B": "Cb",
|
|
1869
|
+
"E": "Fb"
|
|
1878
1870
|
},
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1871
|
+
"G": {
|
|
1872
|
+
"A#": "Bb",
|
|
1873
|
+
"D#": "Eb",
|
|
1874
|
+
"G#": "Ab"
|
|
1883
1875
|
},
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1876
|
+
"G#": {
|
|
1877
|
+
"A#": "Bb",
|
|
1878
|
+
"D#": "Eb"
|
|
1887
1879
|
},
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1880
|
+
"Am": {
|
|
1881
|
+
"Gb": "G",
|
|
1882
|
+
"G#": "Ab",
|
|
1883
|
+
"F#": "Gb",
|
|
1884
|
+
"C#": "Db",
|
|
1885
|
+
"D#": "Eb",
|
|
1886
|
+
"A#": "Bb"
|
|
1895
1887
|
},
|
|
1896
|
-
|
|
1897
|
-
|
|
1888
|
+
"Bbm": {
|
|
1889
|
+
"Cb": "B"
|
|
1898
1890
|
},
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1891
|
+
"Bm": {
|
|
1892
|
+
"A#": "Bb",
|
|
1893
|
+
"D#": "Eb"
|
|
1902
1894
|
},
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1895
|
+
"C#m": {
|
|
1896
|
+
"A#": "Bb",
|
|
1897
|
+
"D#": "Eb"
|
|
1906
1898
|
},
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1899
|
+
"Cm": {
|
|
1900
|
+
"G#": "Ab",
|
|
1901
|
+
"A#": "Bb",
|
|
1902
|
+
"D#": "Eb",
|
|
1903
|
+
"F#": "Gb",
|
|
1904
|
+
"C#": "Db"
|
|
1913
1905
|
},
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1906
|
+
"Dm": {
|
|
1907
|
+
"A#": "Bb",
|
|
1908
|
+
"D#": "Eb"
|
|
1917
1909
|
},
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1910
|
+
"Em": {
|
|
1911
|
+
"A#": "Bb",
|
|
1912
|
+
"D#": "Eb"
|
|
1921
1913
|
},
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1914
|
+
"F#m": {
|
|
1915
|
+
"A#": "Bb",
|
|
1916
|
+
"D#": "Eb",
|
|
1917
|
+
"Gb": "F#",
|
|
1918
|
+
"Ab": "G#",
|
|
1919
|
+
"Db": "C#"
|
|
1928
1920
|
},
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1921
|
+
"Fm": {
|
|
1922
|
+
"G#": "Ab",
|
|
1923
|
+
"A#": "Bb",
|
|
1924
|
+
"D#": "Eb",
|
|
1925
|
+
"F#": "Gb",
|
|
1926
|
+
"C#": "Db"
|
|
1935
1927
|
},
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1928
|
+
"Gm": {
|
|
1929
|
+
"G#": "Ab",
|
|
1930
|
+
"A#": "Bb",
|
|
1931
|
+
"D#": "Eb"
|
|
1940
1932
|
},
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1933
|
+
"G#m": {
|
|
1934
|
+
"A#": "Bb",
|
|
1935
|
+
"D#": "Eb"
|
|
1944
1936
|
}
|
|
1945
1937
|
};
|
|
1946
1938
|
|
|
@@ -1951,49 +1943,42 @@ const $21a34a464e7bc609$export$13215d9ce4923f76 = (collection, Klass)=>{
|
|
|
1951
1943
|
collection.push(newObject);
|
|
1952
1944
|
return newObject;
|
|
1953
1945
|
};
|
|
1954
|
-
const $21a34a464e7bc609$export$d332d76d125f0cbe = (line)=>line.items.some((item)=>!!item.chords
|
|
1955
|
-
|
|
1956
|
-
;
|
|
1957
|
-
const $21a34a464e7bc609$export$e3f63561d52b936d = (item)=>typeof item.evaluate === 'function'
|
|
1958
|
-
;
|
|
1946
|
+
const $21a34a464e7bc609$export$d332d76d125f0cbe = (line)=>line.items.some((item)=>!!item.chords);
|
|
1947
|
+
const $21a34a464e7bc609$export$e3f63561d52b936d = (item)=>typeof item.evaluate === "function";
|
|
1959
1948
|
const $21a34a464e7bc609$export$bc3bea8325045070 = (str, length)=>{
|
|
1960
1949
|
let paddedString = str;
|
|
1961
|
-
for(let l = str.length; l < length; l += 1, paddedString +=
|
|
1950
|
+
for(let l = str.length; l < length; l += 1, paddedString += " ");
|
|
1962
1951
|
return paddedString;
|
|
1963
1952
|
};
|
|
1964
|
-
const $21a34a464e7bc609$export$ee27c052bca048fb = (object)=>object && object.length > 0
|
|
1965
|
-
;
|
|
1966
|
-
const $21a34a464e7bc609$export$
|
|
1967
|
-
;
|
|
1968
|
-
const $21a34a464e7bc609$export$ed9b06b5ee264ad3 = (object)=>$21a34a464e7bc609$export$ee27c052bca048fb(object) ? object : null
|
|
1969
|
-
;
|
|
1953
|
+
const $21a34a464e7bc609$export$ee27c052bca048fb = (object)=>object && object.length > 0;
|
|
1954
|
+
const $21a34a464e7bc609$export$7ee701e290d9865 = (object)=>!$21a34a464e7bc609$export$ee27c052bca048fb(object);
|
|
1955
|
+
const $21a34a464e7bc609$export$ed9b06b5ee264ad3 = (object)=>$21a34a464e7bc609$export$ee27c052bca048fb(object) ? object : null;
|
|
1970
1956
|
function $21a34a464e7bc609$var$dasherize(string) {
|
|
1971
|
-
return string.replace(/[A-Z]/g, (match)=>`-${match.toLowerCase()}`
|
|
1972
|
-
);
|
|
1957
|
+
return string.replace(/[A-Z]/g, (match)=>`-${match.toLowerCase()}`);
|
|
1973
1958
|
}
|
|
1974
1959
|
function $21a34a464e7bc609$export$59d377d2a2e0150a(css, scope) {
|
|
1975
1960
|
return Object.entries(css).map(([selector, styles])=>{
|
|
1976
|
-
const rules = Object.entries(styles).map(([property, value])=>`${$21a34a464e7bc609$var$dasherize(property)}: ${value};`
|
|
1977
|
-
).join('\n ');
|
|
1961
|
+
const rules = Object.entries(styles).map(([property, value])=>`${$21a34a464e7bc609$var$dasherize(property)}: ${value};`).join("\n ");
|
|
1978
1962
|
const scopedSelector = `${scope} ${selector}`.trim();
|
|
1979
1963
|
return `
|
|
1980
1964
|
${scopedSelector} {
|
|
1981
1965
|
${rules}
|
|
1982
1966
|
}`.substring(1);
|
|
1983
|
-
}).join(
|
|
1967
|
+
}).join("\n\n");
|
|
1984
1968
|
}
|
|
1985
1969
|
function $21a34a464e7bc609$export$b680e6b2c82f8c2f(message) {
|
|
1986
1970
|
try {
|
|
1987
1971
|
throw new Error(`DEPRECATION: ${message}`);
|
|
1988
1972
|
} catch (e) {
|
|
1989
|
-
if (typeof $988mA$process ===
|
|
1973
|
+
if (typeof $988mA$process === "object" && typeof $988mA$process.emitWarning === "function") $988mA$process.emitWarning(`${message}\n${e.stack}`);
|
|
1990
1974
|
else console.warn(`${message}\n${e.stack}`);
|
|
1991
1975
|
}
|
|
1992
1976
|
}
|
|
1993
1977
|
function $21a34a464e7bc609$export$78d1711480f95c3e(string) {
|
|
1994
|
-
return string === null || string === undefined || string ===
|
|
1978
|
+
return string === null || string === undefined || string === "";
|
|
1995
1979
|
}
|
|
1996
1980
|
function $21a34a464e7bc609$export$595e981f61839426(string, constructor, regexes) {
|
|
1981
|
+
if ($21a34a464e7bc609$export$78d1711480f95c3e(string)) return null;
|
|
1997
1982
|
for(let i = 0, count = regexes.length; i < count; i += 1){
|
|
1998
1983
|
const match = string.match(regexes[i]);
|
|
1999
1984
|
if (match) return new constructor(match.groups);
|
|
@@ -2002,8 +1987,8 @@ function $21a34a464e7bc609$export$595e981f61839426(string, constructor, regexes)
|
|
|
2002
1987
|
}
|
|
2003
1988
|
|
|
2004
1989
|
|
|
2005
|
-
const $bff5407e03fdc8ee$var$FLAT =
|
|
2006
|
-
const $bff5407e03fdc8ee$var$SHARP =
|
|
1990
|
+
const $bff5407e03fdc8ee$var$FLAT = "b";
|
|
1991
|
+
const $bff5407e03fdc8ee$var$SHARP = "#";
|
|
2007
1992
|
const $bff5407e03fdc8ee$var$MODIFIER_TRANSPOSITION = {
|
|
2008
1993
|
[$bff5407e03fdc8ee$var$SHARP]: 1,
|
|
2009
1994
|
[$bff5407e03fdc8ee$var$FLAT]: -1
|
|
@@ -2020,7 +2005,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2020
2005
|
modifier = null;
|
|
2021
2006
|
minor = false;
|
|
2022
2007
|
static parse(keyString) {
|
|
2023
|
-
return $21a34a464e7bc609$export$595e981f61839426(keyString, $bff5407e03fdc8ee$var$Key, $bff5407e03fdc8ee$var$regexes);
|
|
2008
|
+
return (0, $21a34a464e7bc609$export$595e981f61839426)(keyString, $bff5407e03fdc8ee$var$Key, $bff5407e03fdc8ee$var$regexes);
|
|
2024
2009
|
}
|
|
2025
2010
|
static wrap(keyStringOrObject) {
|
|
2026
2011
|
if (keyStringOrObject instanceof $bff5407e03fdc8ee$var$Key) return keyStringOrObject;
|
|
@@ -2043,7 +2028,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2043
2028
|
return delta;
|
|
2044
2029
|
}
|
|
2045
2030
|
constructor({ note: note , modifier: modifier = null , minor: minor = false }){
|
|
2046
|
-
this.note = note instanceof $8fcf445ea0999053$export$2e2bcd8739ae039 ? note : $8fcf445ea0999053$export$2e2bcd8739ae039.parse(note);
|
|
2031
|
+
this.note = note instanceof (0, $8fcf445ea0999053$export$2e2bcd8739ae039) ? note : (0, $8fcf445ea0999053$export$2e2bcd8739ae039).parse(note);
|
|
2047
2032
|
this.modifier = modifier || null;
|
|
2048
2033
|
this.minor = !!minor || false;
|
|
2049
2034
|
}
|
|
@@ -2054,7 +2039,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2054
2039
|
return this.set({});
|
|
2055
2040
|
}
|
|
2056
2041
|
toChordSymbol(key) {
|
|
2057
|
-
if (this.is($af8d31735c159a26$export$27c95a7104c1f7aa)) return this.clone();
|
|
2042
|
+
if (this.is((0, $af8d31735c159a26$export$27c95a7104c1f7aa))) return this.clone();
|
|
2058
2043
|
const transposeDistance = this.note.getTransposeDistance(key.minor) + ($bff5407e03fdc8ee$var$MODIFIER_TRANSPOSITION[this.modifier] || 0);
|
|
2059
2044
|
return key.transpose(transposeDistance).normalize().useModifier(key.modifier);
|
|
2060
2045
|
}
|
|
@@ -2065,13 +2050,13 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2065
2050
|
return this.note.is(type);
|
|
2066
2051
|
}
|
|
2067
2052
|
isNumeric() {
|
|
2068
|
-
return this.is($af8d31735c159a26$export$4d318981b5a83836);
|
|
2053
|
+
return this.is((0, $af8d31735c159a26$export$4d318981b5a83836));
|
|
2069
2054
|
}
|
|
2070
2055
|
isChordSymbol() {
|
|
2071
|
-
return this.is($af8d31735c159a26$export$27c95a7104c1f7aa);
|
|
2056
|
+
return this.is((0, $af8d31735c159a26$export$27c95a7104c1f7aa));
|
|
2072
2057
|
}
|
|
2073
2058
|
isNumeral() {
|
|
2074
|
-
return this.is($af8d31735c159a26$export$1321df9b16c30c6a);
|
|
2059
|
+
return this.is((0, $af8d31735c159a26$export$1321df9b16c30c6a));
|
|
2075
2060
|
}
|
|
2076
2061
|
equals({ note: note , modifier: modifier = null }) {
|
|
2077
2062
|
return this.note.equals(note) && this.modifier === modifier;
|
|
@@ -2091,20 +2076,20 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2091
2076
|
if (this.isNumeric()) return this.set({
|
|
2092
2077
|
note: this.note.toNumeral()
|
|
2093
2078
|
});
|
|
2094
|
-
return this.transposeNoteUpToKey(
|
|
2079
|
+
return this.transposeNoteUpToKey("I", key);
|
|
2095
2080
|
}
|
|
2096
2081
|
toNumeralString(key = null) {
|
|
2097
2082
|
return this.toNumeral(key).toString();
|
|
2098
2083
|
}
|
|
2099
2084
|
toString() {
|
|
2100
|
-
if (this.isChordSymbol()) return `${this.note}${this.modifier ||
|
|
2101
|
-
return `${this.modifier ||
|
|
2085
|
+
if (this.isChordSymbol()) return `${this.note}${this.modifier || ""}`;
|
|
2086
|
+
return `${this.modifier || ""}${this.note}`;
|
|
2102
2087
|
}
|
|
2103
2088
|
transpose(delta) {
|
|
2104
2089
|
if (delta === 0) return this;
|
|
2105
2090
|
const originalModifier = this.modifier;
|
|
2106
2091
|
let transposedKey = this.clone();
|
|
2107
|
-
const func = delta < 0 ?
|
|
2092
|
+
const func = delta < 0 ? "transposeDown" : "transposeUp";
|
|
2108
2093
|
for(let i = 0, count = Math.abs(delta); i < count; i += 1)transposedKey = transposedKey[func]();
|
|
2109
2094
|
return transposedKey.useModifier(originalModifier);
|
|
2110
2095
|
}
|
|
@@ -2112,7 +2097,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2112
2097
|
if (this.modifier === $bff5407e03fdc8ee$var$FLAT) return this.set({
|
|
2113
2098
|
modifier: null
|
|
2114
2099
|
});
|
|
2115
|
-
if (this.note.isOneOf(3, 7,
|
|
2100
|
+
if (this.note.isOneOf(3, 7, "E", "B")) return this.set({
|
|
2116
2101
|
note: this.note.up()
|
|
2117
2102
|
});
|
|
2118
2103
|
if (this.modifier === $bff5407e03fdc8ee$var$SHARP) return this.set({
|
|
@@ -2127,7 +2112,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2127
2112
|
if (this.modifier === $bff5407e03fdc8ee$var$SHARP) return this.set({
|
|
2128
2113
|
modifier: null
|
|
2129
2114
|
});
|
|
2130
|
-
if (this.note.isOneOf(1, 4,
|
|
2115
|
+
if (this.note.isOneOf(1, 4, "C", "F")) return this.set({
|
|
2131
2116
|
note: this.note.down()
|
|
2132
2117
|
});
|
|
2133
2118
|
if (this.modifier === $bff5407e03fdc8ee$var$FLAT) return this.set({
|
|
@@ -2150,11 +2135,11 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2150
2135
|
return this.clone();
|
|
2151
2136
|
}
|
|
2152
2137
|
normalize() {
|
|
2153
|
-
if (this.modifier === $bff5407e03fdc8ee$var$SHARP && this.note.isOneOf(3, 7,
|
|
2138
|
+
if (this.modifier === $bff5407e03fdc8ee$var$SHARP && this.note.isOneOf(3, 7, "E", "B")) return this.set({
|
|
2154
2139
|
note: this.note.up(),
|
|
2155
2140
|
modifier: null
|
|
2156
2141
|
});
|
|
2157
|
-
if (this.modifier === $bff5407e03fdc8ee$var$FLAT && this.note.isOneOf(1, 4,
|
|
2142
|
+
if (this.modifier === $bff5407e03fdc8ee$var$FLAT && this.note.isOneOf(1, 4, "C", "F")) return this.set({
|
|
2158
2143
|
note: this.note.down(),
|
|
2159
2144
|
modifier: null
|
|
2160
2145
|
});
|
|
@@ -2163,7 +2148,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2163
2148
|
normalizeEnharmonics(key) {
|
|
2164
2149
|
if (key) {
|
|
2165
2150
|
const rootKeyString = key.minor ? `${key}m` : key.toString();
|
|
2166
|
-
const enharmonics = $6ebb068142750218$export$2e2bcd8739ae039[rootKeyString];
|
|
2151
|
+
const enharmonics = (0, $6ebb068142750218$export$2e2bcd8739ae039)[rootKeyString];
|
|
2167
2152
|
const thisKeyString = this.toString();
|
|
2168
2153
|
if (enharmonics && enharmonics[thisKeyString]) return $bff5407e03fdc8ee$var$Key.parse(enharmonics[thisKeyString]);
|
|
2169
2154
|
}
|
|
@@ -3106,20 +3091,18 @@ var $e12151f977ef7bf6$export$2e2bcd8739ae039 = $e12151f977ef7bf6$var$mapping;
|
|
|
3106
3091
|
|
|
3107
3092
|
|
|
3108
3093
|
function $26f57998457eb2d4$var$normalizeSuffix(suffix) {
|
|
3109
|
-
if ($e12151f977ef7bf6$export$2e2bcd8739ae039[suffix] ===
|
|
3110
|
-
return $e12151f977ef7bf6$export$2e2bcd8739ae039[suffix] || suffix;
|
|
3094
|
+
if ((0, $e12151f977ef7bf6$export$2e2bcd8739ae039)[suffix] === "[blank]") return null;
|
|
3095
|
+
return (0, $e12151f977ef7bf6$export$2e2bcd8739ae039)[suffix] || suffix;
|
|
3111
3096
|
}
|
|
3112
3097
|
const $26f57998457eb2d4$var$chordRegex = /^(?<base>[A-G])(?<modifier>#|b)?(?<suffix>[^/\s]*)(\/(?<bassBase>[A-G])(?<bassModifier>#|b)?)?$/i;
|
|
3113
3098
|
const $26f57998457eb2d4$var$numericChordRegex = /^(?<modifier>#|b)?(?<base>[1-7])(?<suffix>[^/\s]*)(\/(?<bassModifier>#|b)?(?<bassBase>[0-7]))?$/;
|
|
3114
3099
|
const $26f57998457eb2d4$var$sortedNumerals = [
|
|
3115
|
-
|
|
3116
|
-
].sort((numeralA, numeralB)=>numeralB.length - numeralA.length
|
|
3117
|
-
);
|
|
3100
|
+
...(0, $af8d31735c159a26$export$6145372d252f6576)
|
|
3101
|
+
].sort((numeralA, numeralB)=>numeralB.length - numeralA.length);
|
|
3118
3102
|
const $26f57998457eb2d4$var$numerals = [
|
|
3119
3103
|
...$26f57998457eb2d4$var$sortedNumerals,
|
|
3120
|
-
...$26f57998457eb2d4$var$sortedNumerals.map((numeral)=>numeral.toLowerCase()
|
|
3121
|
-
|
|
3122
|
-
].join('|');
|
|
3104
|
+
...$26f57998457eb2d4$var$sortedNumerals.map((numeral)=>numeral.toLowerCase()),
|
|
3105
|
+
].join("|");
|
|
3123
3106
|
const $26f57998457eb2d4$var$numeralChordRegex = // eslint-disable-next-line max-len
|
|
3124
3107
|
new RegExp(`^(?<modifier>#|b)?(?<base>${$26f57998457eb2d4$var$numerals})(?<suffix>[^/\\s]*)(\\/(?<bassModifier>#|b)?(?<bassBase>${$26f57998457eb2d4$var$numerals}))?$`);
|
|
3125
3108
|
const $26f57998457eb2d4$var$regexes = [
|
|
@@ -3135,7 +3118,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3135
3118
|
* @param chordString the chord string, eg `Esus4/G#` or `1sus4/#3`
|
|
3136
3119
|
* @returns {null|Chord}
|
|
3137
3120
|
*/ static parse(chordString) {
|
|
3138
|
-
return $21a34a464e7bc609$export$595e981f61839426(chordString, $26f57998457eb2d4$var$Chord, $26f57998457eb2d4$var$regexes);
|
|
3121
|
+
return (0, $21a34a464e7bc609$export$595e981f61839426)(chordString, $26f57998457eb2d4$var$Chord, $26f57998457eb2d4$var$regexes);
|
|
3139
3122
|
}
|
|
3140
3123
|
/**
|
|
3141
3124
|
* Returns a deep copy of the chord
|
|
@@ -3151,7 +3134,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3151
3134
|
* @returns {Chord} the chord symbol
|
|
3152
3135
|
*/ toChordSymbol(key = null) {
|
|
3153
3136
|
if (this.isChordSymbol()) return this.clone();
|
|
3154
|
-
const keyObj = $bff5407e03fdc8ee$export$2e2bcd8739ae039.wrap(key);
|
|
3137
|
+
const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(key);
|
|
3155
3138
|
const rootKey = this.root.toChordSymbol(keyObj).normalizeEnharmonics(keyObj);
|
|
3156
3139
|
let chordSymbolChord = new $26f57998457eb2d4$var$Chord({
|
|
3157
3140
|
suffix: $26f57998457eb2d4$var$normalizeSuffix(this.suffix),
|
|
@@ -3175,7 +3158,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3175
3158
|
* Determines whether the chord is a chord symbol
|
|
3176
3159
|
* @returns {boolean}
|
|
3177
3160
|
*/ isChordSymbol() {
|
|
3178
|
-
return this.is($af8d31735c159a26$export$27c95a7104c1f7aa);
|
|
3161
|
+
return this.is((0, $af8d31735c159a26$export$27c95a7104c1f7aa));
|
|
3179
3162
|
}
|
|
3180
3163
|
/**
|
|
3181
3164
|
* Converts the chord to a numeric chord, using the supplied key as a reference.
|
|
@@ -3188,7 +3171,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3188
3171
|
root: this.root.toNumeric(),
|
|
3189
3172
|
bass: this.bass?.toNumeric()
|
|
3190
3173
|
});
|
|
3191
|
-
const keyObj = $bff5407e03fdc8ee$export$2e2bcd8739ae039.wrap(key);
|
|
3174
|
+
const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(key);
|
|
3192
3175
|
return new $26f57998457eb2d4$var$Chord({
|
|
3193
3176
|
suffix: $26f57998457eb2d4$var$normalizeSuffix(this.suffix),
|
|
3194
3177
|
root: this.root.toNumeric(keyObj),
|
|
@@ -3206,7 +3189,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3206
3189
|
root: this.root.toNumeral(),
|
|
3207
3190
|
bass: this.bass?.toNumeral()
|
|
3208
3191
|
});
|
|
3209
|
-
const keyObj = $bff5407e03fdc8ee$export$2e2bcd8739ae039.wrap(key);
|
|
3192
|
+
const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(key);
|
|
3210
3193
|
return new $26f57998457eb2d4$var$Chord({
|
|
3211
3194
|
suffix: $26f57998457eb2d4$var$normalizeSuffix(this.suffix),
|
|
3212
3195
|
root: this.root.toNumeral(keyObj),
|
|
@@ -3226,7 +3209,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3226
3209
|
* Determines whether the chord is numeric
|
|
3227
3210
|
* @returns {boolean}
|
|
3228
3211
|
*/ isNumeric() {
|
|
3229
|
-
return this.is($af8d31735c159a26$export$4d318981b5a83836);
|
|
3212
|
+
return this.is((0, $af8d31735c159a26$export$4d318981b5a83836));
|
|
3230
3213
|
}
|
|
3231
3214
|
/**
|
|
3232
3215
|
* Converts the chord to a numeric chord string, using the supplied kye as a reference.
|
|
@@ -3241,13 +3224,13 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3241
3224
|
* Determines whether the chord is a numeral
|
|
3242
3225
|
* @returns {boolean}
|
|
3243
3226
|
*/ isNumeral() {
|
|
3244
|
-
return this.is($af8d31735c159a26$export$1321df9b16c30c6a);
|
|
3227
|
+
return this.is((0, $af8d31735c159a26$export$1321df9b16c30c6a));
|
|
3245
3228
|
}
|
|
3246
3229
|
/**
|
|
3247
3230
|
* Converts the chord to a string, eg `Esus4/G#` or `1sus4/#3`
|
|
3248
3231
|
* @returns {string} the chord string
|
|
3249
3232
|
*/ toString() {
|
|
3250
|
-
const chordString = this.root.toString() + (this.suffix ||
|
|
3233
|
+
const chordString = this.root.toString() + (this.suffix || "");
|
|
3251
3234
|
if (this.bass) return `${chordString}/${this.bass.toString()}`;
|
|
3252
3235
|
return chordString;
|
|
3253
3236
|
}
|
|
@@ -3267,12 +3250,12 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3267
3250
|
*
|
|
3268
3251
|
* @returns {Chord} the normalized chord
|
|
3269
3252
|
*/ normalize(key = null) {
|
|
3270
|
-
if ($21a34a464e7bc609$export$7ee701e290d9865(key)) return this.process(
|
|
3271
|
-
suffix: $21a34a464e7bc609$export$ed9b06b5ee264ad3($26f57998457eb2d4$var$normalizeSuffix(this.suffix))
|
|
3253
|
+
if ((0, $21a34a464e7bc609$export$7ee701e290d9865)(key)) return this.process("normalize").set({
|
|
3254
|
+
suffix: (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)($26f57998457eb2d4$var$normalizeSuffix(this.suffix))
|
|
3272
3255
|
});
|
|
3273
3256
|
return this.set({
|
|
3274
3257
|
root: this.root.normalizeEnharmonics(key),
|
|
3275
|
-
suffix: $21a34a464e7bc609$export$ed9b06b5ee264ad3($26f57998457eb2d4$var$normalizeSuffix(this.suffix)),
|
|
3258
|
+
suffix: (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)($26f57998457eb2d4$var$normalizeSuffix(this.suffix)),
|
|
3276
3259
|
bass: this.bass ? this.bass.normalizeEnharmonics(this.root.toString()) : null
|
|
3277
3260
|
});
|
|
3278
3261
|
}
|
|
@@ -3281,45 +3264,45 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3281
3264
|
* @param newModifier the modifier to use: `'#'` or `'b'`
|
|
3282
3265
|
* @returns {Chord} the new, changed chord
|
|
3283
3266
|
*/ useModifier(newModifier) {
|
|
3284
|
-
return this.process(
|
|
3267
|
+
return this.process("useModifier", newModifier);
|
|
3285
3268
|
}
|
|
3286
3269
|
/**
|
|
3287
3270
|
* Transposes the chord up by 1 semitone. Eg. A becomes A#, Eb becomes E
|
|
3288
3271
|
* @returns {Chord} the new, transposed chord
|
|
3289
3272
|
*/ transposeUp() {
|
|
3290
|
-
return this.process(
|
|
3273
|
+
return this.process("transposeUp");
|
|
3291
3274
|
}
|
|
3292
3275
|
/**
|
|
3293
3276
|
* Transposes the chord down by 1 semitone. Eg. A# becomes A, E becomes Eb
|
|
3294
3277
|
* @returns {Chord} the new, transposed chord
|
|
3295
3278
|
*/ transposeDown() {
|
|
3296
|
-
return this.process(
|
|
3279
|
+
return this.process("transposeDown");
|
|
3297
3280
|
}
|
|
3298
3281
|
/**
|
|
3299
3282
|
* Transposes the chord by the specified number of semitones
|
|
3300
3283
|
* @param delta de number of semitones
|
|
3301
3284
|
* @returns {Chord} the new, transposed chord
|
|
3302
3285
|
*/ transpose(delta) {
|
|
3303
|
-
return this.process(
|
|
3286
|
+
return this.process("transpose", delta);
|
|
3304
3287
|
}
|
|
3305
3288
|
constructor({ base: base = null , modifier: modifier = null , suffix: suffix = null , bassBase: bassBase = null , bassModifier: bassModifier = null , root: root = null , bass: bass = null , }){
|
|
3306
|
-
this.suffix = $21a34a464e7bc609$export$ed9b06b5ee264ad3(suffix);
|
|
3307
|
-
this.root = root || new $bff5407e03fdc8ee$export$2e2bcd8739ae039({
|
|
3289
|
+
this.suffix = (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)(suffix);
|
|
3290
|
+
this.root = root || new (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039)({
|
|
3308
3291
|
note: base,
|
|
3309
3292
|
modifier: modifier,
|
|
3310
|
-
minor: suffix ===
|
|
3293
|
+
minor: suffix === "m"
|
|
3311
3294
|
});
|
|
3312
3295
|
if (bass) this.bass = bass;
|
|
3313
|
-
else if (bassBase) this.bass = new $bff5407e03fdc8ee$export$2e2bcd8739ae039({
|
|
3296
|
+
else if (bassBase) this.bass = new (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039)({
|
|
3314
3297
|
note: bassBase,
|
|
3315
3298
|
modifier: bassModifier,
|
|
3316
|
-
minor: suffix ===
|
|
3299
|
+
minor: suffix === "m"
|
|
3317
3300
|
});
|
|
3318
3301
|
else this.bass = null;
|
|
3319
3302
|
}
|
|
3320
3303
|
makeMinor() {
|
|
3321
|
-
if (!this.suffix || this.suffix[0] !==
|
|
3322
|
-
suffix: `m${this.suffix ||
|
|
3304
|
+
if (!this.suffix || this.suffix[0] !== "m") return this.set({
|
|
3305
|
+
suffix: `m${this.suffix || ""}`
|
|
3323
3306
|
});
|
|
3324
3307
|
return this.clone();
|
|
3325
3308
|
}
|
|
@@ -3345,7 +3328,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3345
3328
|
}
|
|
3346
3329
|
}
|
|
3347
3330
|
function $26f57998457eb2d4$export$621b8187b24d90c6(chordString) {
|
|
3348
|
-
$21a34a464e7bc609$export$b680e6b2c82f8c2f(
|
|
3331
|
+
(0, $21a34a464e7bc609$export$b680e6b2c82f8c2f)("parseChord() is deprecated, please use Chord.parse() instead");
|
|
3349
3332
|
return $26f57998457eb2d4$var$Chord.parse(chordString);
|
|
3350
3333
|
}
|
|
3351
3334
|
var $26f57998457eb2d4$export$2e2bcd8739ae039 = $26f57998457eb2d4$var$Chord;
|
|
@@ -3358,17 +3341,17 @@ var $26f57998457eb2d4$export$2e2bcd8739ae039 = $26f57998457eb2d4$var$Chord;
|
|
|
3358
3341
|
* Initialises a ChordLyricsPair
|
|
3359
3342
|
* @param {string} chords The chords
|
|
3360
3343
|
* @param {string} lyrics The lyrics
|
|
3361
|
-
*/ constructor(chords =
|
|
3344
|
+
*/ constructor(chords = "", lyrics = ""){
|
|
3362
3345
|
/**
|
|
3363
3346
|
* The chords
|
|
3364
3347
|
* @member
|
|
3365
3348
|
* @type {string}
|
|
3366
|
-
*/ this.chords = chords ||
|
|
3349
|
+
*/ this.chords = chords || "";
|
|
3367
3350
|
/**
|
|
3368
3351
|
* The lyrics
|
|
3369
3352
|
* @member
|
|
3370
3353
|
* @type {string}
|
|
3371
|
-
*/ this.lyrics = lyrics ||
|
|
3354
|
+
*/ this.lyrics = lyrics || "";
|
|
3372
3355
|
}
|
|
3373
3356
|
/**
|
|
3374
3357
|
* Indicates whether a ChordLyricsPair should be visible in a formatted chord sheet (except for ChordPro sheets)
|
|
@@ -3388,8 +3371,13 @@ var $26f57998457eb2d4$export$2e2bcd8739ae039 = $26f57998457eb2d4$var$Chord;
|
|
|
3388
3371
|
set(properties) {
|
|
3389
3372
|
return new $d454f4215ba01af2$var$ChordLyricsPair(properties.chords || this.chords, properties.lyrics || this.lyrics);
|
|
3390
3373
|
}
|
|
3374
|
+
setLyrics(lyrics) {
|
|
3375
|
+
return this.set({
|
|
3376
|
+
lyrics: lyrics
|
|
3377
|
+
});
|
|
3378
|
+
}
|
|
3391
3379
|
transpose(delta, key) {
|
|
3392
|
-
const chordObj = $26f57998457eb2d4$export$2e2bcd8739ae039.parse(this.chords);
|
|
3380
|
+
const chordObj = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(this.chords);
|
|
3393
3381
|
if (chordObj) return this.set({
|
|
3394
3382
|
chords: chordObj.transpose(delta).normalize(key).toString()
|
|
3395
3383
|
});
|
|
@@ -3414,37 +3402,37 @@ class $cf00b4d3af89fa07$var$AstComponent {
|
|
|
3414
3402
|
var $cf00b4d3af89fa07$export$2e2bcd8739ae039 = $cf00b4d3af89fa07$var$AstComponent;
|
|
3415
3403
|
|
|
3416
3404
|
|
|
3417
|
-
const $5e9ede69210ec54a$export$10227cb086d1770c =
|
|
3418
|
-
const $5e9ede69210ec54a$export$17d8dfb3db842bf =
|
|
3419
|
-
const $5e9ede69210ec54a$export$866f445d49bad88e =
|
|
3420
|
-
const $5e9ede69210ec54a$export$a29989082612d0d9 =
|
|
3421
|
-
const $5e9ede69210ec54a$export$98424633dc8c377f =
|
|
3422
|
-
const $5e9ede69210ec54a$export$4ab8c75045d12480 =
|
|
3423
|
-
const $5e9ede69210ec54a$export$bacc88974c736870 =
|
|
3424
|
-
const $5e9ede69210ec54a$export$473c1a4819e5180b =
|
|
3425
|
-
const $5e9ede69210ec54a$export$66a0ef3ffeab32b7 =
|
|
3426
|
-
const $5e9ede69210ec54a$export$640d294ab83f9040 =
|
|
3427
|
-
const $5e9ede69210ec54a$export$7167c830cefcb6b5 =
|
|
3428
|
-
const $5e9ede69210ec54a$export$430b1920f5feeae =
|
|
3429
|
-
const $5e9ede69210ec54a$export$a6901bd008617c61 =
|
|
3430
|
-
const $5e9ede69210ec54a$export$4f5168acae064e01 =
|
|
3431
|
-
const $5e9ede69210ec54a$export$8dd1111100e0e88d =
|
|
3432
|
-
const $5e9ede69210ec54a$export$deca399f8cd9b7dc =
|
|
3433
|
-
const $5e9ede69210ec54a$export$5895c693c74b9cf4 =
|
|
3434
|
-
const $5e9ede69210ec54a$export$bd8d57d0bc5a8478 =
|
|
3435
|
-
const $5e9ede69210ec54a$export$a9905336c0111a3a =
|
|
3436
|
-
const $5e9ede69210ec54a$export$f1e53f710478ceb4 =
|
|
3437
|
-
const $5e9ede69210ec54a$export$ae60ab9b4739fc3d =
|
|
3438
|
-
const $5e9ede69210ec54a$export$b7627374a6424f68 =
|
|
3439
|
-
const $5e9ede69210ec54a$export$90b88dc425a06a95 =
|
|
3440
|
-
const $5e9ede69210ec54a$var$TITLE_SHORT =
|
|
3441
|
-
const $5e9ede69210ec54a$var$SUBTITLE_SHORT =
|
|
3442
|
-
const $5e9ede69210ec54a$var$COMMENT_SHORT =
|
|
3443
|
-
const $5e9ede69210ec54a$var$START_OF_CHORUS_SHORT =
|
|
3444
|
-
const $5e9ede69210ec54a$var$END_OF_CHORUS_SHORT =
|
|
3445
|
-
const $5e9ede69210ec54a$var$START_OF_TAB_SHORT =
|
|
3446
|
-
const $5e9ede69210ec54a$var$END_OF_TAB_SHORT =
|
|
3447
|
-
const $5e9ede69210ec54a$var$NEW_KEY_SHORT =
|
|
3405
|
+
const $5e9ede69210ec54a$export$10227cb086d1770c = "album";
|
|
3406
|
+
const $5e9ede69210ec54a$export$17d8dfb3db842bf = "artist";
|
|
3407
|
+
const $5e9ede69210ec54a$export$866f445d49bad88e = "capo";
|
|
3408
|
+
const $5e9ede69210ec54a$export$a29989082612d0d9 = "comment";
|
|
3409
|
+
const $5e9ede69210ec54a$export$98424633dc8c377f = "composer";
|
|
3410
|
+
const $5e9ede69210ec54a$export$4ab8c75045d12480 = "copyright";
|
|
3411
|
+
const $5e9ede69210ec54a$export$bacc88974c736870 = "duration";
|
|
3412
|
+
const $5e9ede69210ec54a$export$473c1a4819e5180b = "end_of_chorus";
|
|
3413
|
+
const $5e9ede69210ec54a$export$66a0ef3ffeab32b7 = "end_of_tab";
|
|
3414
|
+
const $5e9ede69210ec54a$export$640d294ab83f9040 = "end_of_verse";
|
|
3415
|
+
const $5e9ede69210ec54a$export$7167c830cefcb6b5 = "key";
|
|
3416
|
+
const $5e9ede69210ec54a$export$430b1920f5feeae = "_key";
|
|
3417
|
+
const $5e9ede69210ec54a$export$a6901bd008617c61 = "lyricist";
|
|
3418
|
+
const $5e9ede69210ec54a$export$4f5168acae064e01 = "start_of_chorus";
|
|
3419
|
+
const $5e9ede69210ec54a$export$8dd1111100e0e88d = "start_of_tab";
|
|
3420
|
+
const $5e9ede69210ec54a$export$deca399f8cd9b7dc = "start_of_verse";
|
|
3421
|
+
const $5e9ede69210ec54a$export$5895c693c74b9cf4 = "subtitle";
|
|
3422
|
+
const $5e9ede69210ec54a$export$bd8d57d0bc5a8478 = "tempo";
|
|
3423
|
+
const $5e9ede69210ec54a$export$a9905336c0111a3a = "time";
|
|
3424
|
+
const $5e9ede69210ec54a$export$f1e53f710478ceb4 = "title";
|
|
3425
|
+
const $5e9ede69210ec54a$export$ae60ab9b4739fc3d = "transpose";
|
|
3426
|
+
const $5e9ede69210ec54a$export$b7627374a6424f68 = "new_key";
|
|
3427
|
+
const $5e9ede69210ec54a$export$90b88dc425a06a95 = "year";
|
|
3428
|
+
const $5e9ede69210ec54a$var$TITLE_SHORT = "t";
|
|
3429
|
+
const $5e9ede69210ec54a$var$SUBTITLE_SHORT = "st";
|
|
3430
|
+
const $5e9ede69210ec54a$var$COMMENT_SHORT = "c";
|
|
3431
|
+
const $5e9ede69210ec54a$var$START_OF_CHORUS_SHORT = "soc";
|
|
3432
|
+
const $5e9ede69210ec54a$var$END_OF_CHORUS_SHORT = "eoc";
|
|
3433
|
+
const $5e9ede69210ec54a$var$START_OF_TAB_SHORT = "sot";
|
|
3434
|
+
const $5e9ede69210ec54a$var$END_OF_TAB_SHORT = "eot";
|
|
3435
|
+
const $5e9ede69210ec54a$var$NEW_KEY_SHORT = "nk";
|
|
3448
3436
|
const $5e9ede69210ec54a$var$RENDERABLE_TAGS = [
|
|
3449
3437
|
$5e9ede69210ec54a$export$a29989082612d0d9
|
|
3450
3438
|
];
|
|
@@ -3490,11 +3478,11 @@ const $5e9ede69210ec54a$var$translateTagNameAlias = (name)=>{
|
|
|
3490
3478
|
};
|
|
3491
3479
|
/**
|
|
3492
3480
|
* Represents a tag/directive. See https://www.chordpro.org/chordpro/chordpro-directives/
|
|
3493
|
-
*/ class $5e9ede69210ec54a$var$Tag extends $cf00b4d3af89fa07$export$2e2bcd8739ae039 {
|
|
3494
|
-
constructor(name, value =
|
|
3481
|
+
*/ class $5e9ede69210ec54a$var$Tag extends (0, $cf00b4d3af89fa07$export$2e2bcd8739ae039) {
|
|
3482
|
+
constructor(name, value = "", traceInfo = null){
|
|
3495
3483
|
super(traceInfo);
|
|
3496
3484
|
this.name = name;
|
|
3497
|
-
this.value = value ||
|
|
3485
|
+
this.value = value || "";
|
|
3498
3486
|
}
|
|
3499
3487
|
static parse(tag) {
|
|
3500
3488
|
if (tag instanceof $5e9ede69210ec54a$var$Tag) return tag;
|
|
@@ -3564,6 +3552,11 @@ const $5e9ede69210ec54a$var$translateTagNameAlias = (name)=>{
|
|
|
3564
3552
|
set({ value: value }) {
|
|
3565
3553
|
return new $5e9ede69210ec54a$var$Tag(this._originalName, value);
|
|
3566
3554
|
}
|
|
3555
|
+
setValue(value) {
|
|
3556
|
+
return this.set({
|
|
3557
|
+
value: value
|
|
3558
|
+
});
|
|
3559
|
+
}
|
|
3567
3560
|
}
|
|
3568
3561
|
var $5e9ede69210ec54a$export$2e2bcd8739ae039 = $5e9ede69210ec54a$var$Tag;
|
|
3569
3562
|
|
|
@@ -3607,7 +3600,7 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3607
3600
|
* Values can be {@link VERSE}, {@link CHORUS} or {@link NONE}
|
|
3608
3601
|
* @member
|
|
3609
3602
|
* @type {string}
|
|
3610
|
-
*/ type = $af8d31735c159a26$export$c53d0f541b41b88e;
|
|
3603
|
+
*/ type = (0, $af8d31735c159a26$export$c53d0f541b41b88e);
|
|
3611
3604
|
/**
|
|
3612
3605
|
* @ignore
|
|
3613
3606
|
* @type {ChordLyricsPair}
|
|
@@ -3621,7 +3614,7 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3621
3614
|
* @type {string|null}
|
|
3622
3615
|
*/ transposeKey = null;
|
|
3623
3616
|
constructor({ type: type , items: items } = {
|
|
3624
|
-
type: $af8d31735c159a26$export$c53d0f541b41b88e,
|
|
3617
|
+
type: (0, $af8d31735c159a26$export$c53d0f541b41b88e),
|
|
3625
3618
|
items: []
|
|
3626
3619
|
}){
|
|
3627
3620
|
this.type = type;
|
|
@@ -3637,17 +3630,16 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3637
3630
|
* Adds an item ({@link ChordLyricsPair} or {@link Tag}) to the line
|
|
3638
3631
|
* @param {ChordLyricsPair|Tag} item The item to be added
|
|
3639
3632
|
*/ addItem(item) {
|
|
3640
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039) this.addTag(item);
|
|
3641
|
-
else if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) this.addChordLyricsPair(item);
|
|
3642
|
-
else if (item instanceof $2115988b22311cb1$export$2e2bcd8739ae039) this.addComment(item);
|
|
3633
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)) this.addTag(item);
|
|
3634
|
+
else if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) this.addChordLyricsPair(item);
|
|
3635
|
+
else if (item instanceof (0, $2115988b22311cb1$export$2e2bcd8739ae039)) this.addComment(item);
|
|
3643
3636
|
else this.items.push(item);
|
|
3644
3637
|
}
|
|
3645
3638
|
/**
|
|
3646
3639
|
* Indicates whether the line contains items that are renderable
|
|
3647
3640
|
* @returns {boolean}
|
|
3648
3641
|
*/ hasRenderableItems() {
|
|
3649
|
-
return this.items.some((item)=>item.isRenderable()
|
|
3650
|
-
);
|
|
3642
|
+
return this.items.some((item)=>item.isRenderable());
|
|
3651
3643
|
}
|
|
3652
3644
|
/**
|
|
3653
3645
|
* Returns a deep copy of the line and all of its items
|
|
@@ -3660,8 +3652,7 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3660
3652
|
clonedLine.items = this.items.map((item)=>{
|
|
3661
3653
|
const clonedItem = item.clone();
|
|
3662
3654
|
return func ? func(clonedItem) : clonedItem;
|
|
3663
|
-
}).filter((item)=>item
|
|
3664
|
-
);
|
|
3655
|
+
}).filter((item)=>item);
|
|
3665
3656
|
clonedLine.type = this.type;
|
|
3666
3657
|
return clonedLine;
|
|
3667
3658
|
}
|
|
@@ -3669,13 +3660,13 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3669
3660
|
* Indicates whether the line type is {@link VERSE}
|
|
3670
3661
|
* @returns {boolean}
|
|
3671
3662
|
*/ isVerse() {
|
|
3672
|
-
return this.type === $af8d31735c159a26$export$4b194284baed1659;
|
|
3663
|
+
return this.type === (0, $af8d31735c159a26$export$4b194284baed1659);
|
|
3673
3664
|
}
|
|
3674
3665
|
/**
|
|
3675
3666
|
* Indicates whether the line type is {@link CHORUS}
|
|
3676
3667
|
* @returns {boolean}
|
|
3677
3668
|
*/ isChorus() {
|
|
3678
|
-
return this.type === $af8d31735c159a26$export$8db6c706fc9142b2;
|
|
3669
|
+
return this.type === (0, $af8d31735c159a26$export$8db6c706fc9142b2);
|
|
3679
3670
|
}
|
|
3680
3671
|
/**
|
|
3681
3672
|
* Indicates whether the line contains items that are renderable. Please use {@link hasRenderableItems}
|
|
@@ -3685,8 +3676,8 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3685
3676
|
return this.hasRenderableItems();
|
|
3686
3677
|
}
|
|
3687
3678
|
addChordLyricsPair(chords = null, lyrics = null) {
|
|
3688
|
-
if (chords instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) this.currentChordLyricsPair = chords;
|
|
3689
|
-
else this.currentChordLyricsPair = new $d454f4215ba01af2$export$2e2bcd8739ae039(chords, lyrics);
|
|
3679
|
+
if (chords instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) this.currentChordLyricsPair = chords;
|
|
3680
|
+
else this.currentChordLyricsPair = new (0, $d454f4215ba01af2$export$2e2bcd8739ae039)(chords, lyrics);
|
|
3690
3681
|
this.items.push(this.currentChordLyricsPair);
|
|
3691
3682
|
return this.currentChordLyricsPair;
|
|
3692
3683
|
}
|
|
@@ -3702,12 +3693,12 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3702
3693
|
this.currentChordLyricsPair.lyrics += chr;
|
|
3703
3694
|
}
|
|
3704
3695
|
addTag(name, value = null) {
|
|
3705
|
-
const tag = name instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 ? name : new $5e9ede69210ec54a$export$2e2bcd8739ae039(name, value);
|
|
3696
|
+
const tag = name instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) ? name : new (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)(name, value);
|
|
3706
3697
|
this.items.push(tag);
|
|
3707
3698
|
return tag;
|
|
3708
3699
|
}
|
|
3709
3700
|
addComment(content) {
|
|
3710
|
-
const comment = content instanceof $2115988b22311cb1$export$2e2bcd8739ae039 ? content : new $2115988b22311cb1$export$2e2bcd8739ae039(content);
|
|
3701
|
+
const comment = content instanceof (0, $2115988b22311cb1$export$2e2bcd8739ae039) ? content : new (0, $2115988b22311cb1$export$2e2bcd8739ae039)(content);
|
|
3711
3702
|
this.items.push(comment);
|
|
3712
3703
|
return comment;
|
|
3713
3704
|
}
|
|
@@ -3739,21 +3730,19 @@ var $bc411321e9739719$export$2e2bcd8739ae039 = $bc411321e9739719$var$Line;
|
|
|
3739
3730
|
* If not, it returns {@link INDETERMINATE}
|
|
3740
3731
|
* @returns {string}
|
|
3741
3732
|
*/ get type() {
|
|
3742
|
-
const types = this.lines.map((line)=>line.type
|
|
3743
|
-
);
|
|
3733
|
+
const types = this.lines.map((line)=>line.type);
|
|
3744
3734
|
const uniqueTypes = [
|
|
3745
3735
|
...new Set(types)
|
|
3746
3736
|
];
|
|
3747
3737
|
if (uniqueTypes.length === 1) return uniqueTypes[0];
|
|
3748
|
-
return $af8d31735c159a26$export$c5a6fe907430212e;
|
|
3738
|
+
return 0, $af8d31735c159a26$export$c5a6fe907430212e;
|
|
3749
3739
|
}
|
|
3750
3740
|
/**
|
|
3751
3741
|
* Indicates whether the paragraph contains lines with renderable items.
|
|
3752
3742
|
* @see {@link Line.hasRenderableItems}
|
|
3753
3743
|
* @returns {boolean}
|
|
3754
3744
|
*/ hasRenderableItems() {
|
|
3755
|
-
return this.lines.some((line)=>line.hasRenderableItems()
|
|
3756
|
-
);
|
|
3745
|
+
return this.lines.some((line)=>line.hasRenderableItems());
|
|
3757
3746
|
}
|
|
3758
3747
|
}
|
|
3759
3748
|
var $0c3420c6a3e8a9d7$export$2e2bcd8739ae039 = $0c3420c6a3e8a9d7$var$Paragraph;
|
|
@@ -3766,43 +3755,43 @@ var $0c3420c6a3e8a9d7$export$2e2bcd8739ae039 = $0c3420c6a3e8a9d7$var$Paragraph;
|
|
|
3766
3755
|
|
|
3767
3756
|
class $59abde4480df2d69$var$MetadataAccessors {
|
|
3768
3757
|
get key() {
|
|
3769
|
-
return this.getMetadata($5e9ede69210ec54a$export$7167c830cefcb6b5);
|
|
3758
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$7167c830cefcb6b5));
|
|
3770
3759
|
}
|
|
3771
3760
|
get title() {
|
|
3772
|
-
return this.getMetadata($5e9ede69210ec54a$export$f1e53f710478ceb4);
|
|
3761
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$f1e53f710478ceb4));
|
|
3773
3762
|
}
|
|
3774
3763
|
get subtitle() {
|
|
3775
|
-
return this.getMetadata($5e9ede69210ec54a$export$5895c693c74b9cf4);
|
|
3764
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$5895c693c74b9cf4));
|
|
3776
3765
|
}
|
|
3777
3766
|
get capo() {
|
|
3778
|
-
return this.getMetadata($5e9ede69210ec54a$export$866f445d49bad88e);
|
|
3767
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$866f445d49bad88e));
|
|
3779
3768
|
}
|
|
3780
3769
|
get duration() {
|
|
3781
|
-
return this.getMetadata($5e9ede69210ec54a$export$bacc88974c736870);
|
|
3770
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$bacc88974c736870));
|
|
3782
3771
|
}
|
|
3783
3772
|
get tempo() {
|
|
3784
|
-
return this.getMetadata($5e9ede69210ec54a$export$bd8d57d0bc5a8478);
|
|
3773
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$bd8d57d0bc5a8478));
|
|
3785
3774
|
}
|
|
3786
3775
|
get time() {
|
|
3787
|
-
return this.getMetadata($5e9ede69210ec54a$export$a9905336c0111a3a);
|
|
3776
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$a9905336c0111a3a));
|
|
3788
3777
|
}
|
|
3789
3778
|
get year() {
|
|
3790
|
-
return this.getMetadata($5e9ede69210ec54a$export$90b88dc425a06a95);
|
|
3779
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$90b88dc425a06a95));
|
|
3791
3780
|
}
|
|
3792
3781
|
get album() {
|
|
3793
|
-
return this.getMetadata($5e9ede69210ec54a$export$10227cb086d1770c);
|
|
3782
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$10227cb086d1770c));
|
|
3794
3783
|
}
|
|
3795
3784
|
get copyright() {
|
|
3796
|
-
return this.getMetadata($5e9ede69210ec54a$export$4ab8c75045d12480);
|
|
3785
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$4ab8c75045d12480));
|
|
3797
3786
|
}
|
|
3798
3787
|
get lyricist() {
|
|
3799
|
-
return this.getMetadata($5e9ede69210ec54a$export$a6901bd008617c61);
|
|
3788
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$a6901bd008617c61));
|
|
3800
3789
|
}
|
|
3801
3790
|
get artist() {
|
|
3802
|
-
return this.getMetadata($5e9ede69210ec54a$export$17d8dfb3db842bf);
|
|
3791
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$17d8dfb3db842bf));
|
|
3803
3792
|
}
|
|
3804
3793
|
get composer() {
|
|
3805
|
-
return this.getMetadata($5e9ede69210ec54a$export$98424633dc8c377f);
|
|
3794
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$98424633dc8c377f));
|
|
3806
3795
|
}
|
|
3807
3796
|
}
|
|
3808
3797
|
var $59abde4480df2d69$export$2e2bcd8739ae039 = $59abde4480df2d69$var$MetadataAccessors;
|
|
@@ -3819,12 +3808,11 @@ function $1406c61233580008$var$appendValue(array, key, value) {
|
|
|
3819
3808
|
* metadata.get('author') // => 'John'
|
|
3820
3809
|
*
|
|
3821
3810
|
* See {@link Metadata#get}
|
|
3822
|
-
*/ class $1406c61233580008$var$Metadata extends $59abde4480df2d69$export$2e2bcd8739ae039 {
|
|
3811
|
+
*/ class $1406c61233580008$var$Metadata extends (0, $59abde4480df2d69$export$2e2bcd8739ae039) {
|
|
3823
3812
|
metadata = {};
|
|
3824
3813
|
constructor(metadata = null){
|
|
3825
3814
|
super();
|
|
3826
|
-
Object.keys(metadata || {}).filter((key)
|
|
3827
|
-
).forEach((key)=>{
|
|
3815
|
+
Object.keys(metadata || {}).filter((key)=>!(0, $5e9ede69210ec54a$export$3ef04055cb4a269a)(key)).forEach((key)=>{
|
|
3828
3816
|
const value = metadata[key];
|
|
3829
3817
|
if (value instanceof Array) this.metadata[key] = [
|
|
3830
3818
|
...value
|
|
@@ -3836,7 +3824,7 @@ function $1406c61233580008$var$appendValue(array, key, value) {
|
|
|
3836
3824
|
return key in this.metadata;
|
|
3837
3825
|
}
|
|
3838
3826
|
add(key, value) {
|
|
3839
|
-
if ($5e9ede69210ec54a$export$3ef04055cb4a269a(key)) return;
|
|
3827
|
+
if ((0, $5e9ede69210ec54a$export$3ef04055cb4a269a)(key)) return;
|
|
3840
3828
|
if (!(key in this.metadata)) {
|
|
3841
3829
|
this.metadata[key] = value;
|
|
3842
3830
|
return;
|
|
@@ -3882,7 +3870,7 @@ function $1406c61233580008$var$appendValue(array, key, value) {
|
|
|
3882
3870
|
* @returns {Array<String>|String} the metadata value(s). If there is only one value, it will return a String,
|
|
3883
3871
|
* else it returns an array of strings.
|
|
3884
3872
|
*/ get(prop) {
|
|
3885
|
-
if (prop === $5e9ede69210ec54a$export$430b1920f5feeae) return this.calculateKeyFromCapo();
|
|
3873
|
+
if (prop === (0, $5e9ede69210ec54a$export$430b1920f5feeae)) return this.calculateKeyFromCapo();
|
|
3886
3874
|
if (prop in this.metadata) return this.metadata[prop];
|
|
3887
3875
|
return this.getArrayItem(prop);
|
|
3888
3876
|
}
|
|
@@ -3923,9 +3911,9 @@ function $1406c61233580008$var$appendValue(array, key, value) {
|
|
|
3923
3911
|
return new $1406c61233580008$var$Metadata(this.metadata);
|
|
3924
3912
|
}
|
|
3925
3913
|
calculateKeyFromCapo() {
|
|
3926
|
-
const capo = this.getSingle($5e9ede69210ec54a$export$866f445d49bad88e);
|
|
3927
|
-
const key = this.getSingle($5e9ede69210ec54a$export$7167c830cefcb6b5);
|
|
3928
|
-
if (capo && key) return $26f57998457eb2d4$export$2e2bcd8739ae039.parse(key).transpose(parseInt(capo, 10)).toString();
|
|
3914
|
+
const capo = this.getSingle((0, $5e9ede69210ec54a$export$866f445d49bad88e));
|
|
3915
|
+
const key = this.getSingle((0, $5e9ede69210ec54a$export$7167c830cefcb6b5));
|
|
3916
|
+
if (capo && key) return (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(key).transpose(parseInt(capo, 10)).toString();
|
|
3929
3917
|
return undefined;
|
|
3930
3918
|
}
|
|
3931
3919
|
}
|
|
@@ -3957,19 +3945,14 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
3957
3945
|
|
|
3958
3946
|
/**
|
|
3959
3947
|
* Represents a song in a chord sheet. Currently a chord sheet can only have one song.
|
|
3960
|
-
*/ class $6f653df65dfdf4ef$var$Song extends $59abde4480df2d69$export$2e2bcd8739ae039 {
|
|
3948
|
+
*/ class $6f653df65dfdf4ef$var$Song extends (0, $59abde4480df2d69$export$2e2bcd8739ae039) {
|
|
3961
3949
|
/**
|
|
3962
3950
|
* The {@link Line} items of which the song consists
|
|
3963
3951
|
* @member {Line[]}
|
|
3964
3952
|
*/ lines = [];
|
|
3965
|
-
/**
|
|
3966
|
-
* The {@link Paragraph} items of which the song consists
|
|
3967
|
-
* @member {Paragraph[]}
|
|
3968
|
-
*/ paragraphs = [];
|
|
3969
3953
|
currentLine = null;
|
|
3970
|
-
currentParagraph = null;
|
|
3971
3954
|
warnings = [];
|
|
3972
|
-
sectionType = $af8d31735c159a26$export$c53d0f541b41b88e;
|
|
3955
|
+
sectionType = (0, $af8d31735c159a26$export$c53d0f541b41b88e);
|
|
3973
3956
|
currentKey = null;
|
|
3974
3957
|
transposeKey = null;
|
|
3975
3958
|
/**
|
|
@@ -3977,7 +3960,7 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
3977
3960
|
* @param metadata {Object|Metadata} predefined metadata
|
|
3978
3961
|
*/ constructor(metadata = {}){
|
|
3979
3962
|
super();
|
|
3980
|
-
this.metadata = new $1406c61233580008$export$2e2bcd8739ae039(metadata);
|
|
3963
|
+
this.metadata = new (0, $1406c61233580008$export$2e2bcd8739ae039)(metadata);
|
|
3981
3964
|
}
|
|
3982
3965
|
get previousLine() {
|
|
3983
3966
|
const count = this.lines.length;
|
|
@@ -3989,7 +3972,7 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
3989
3972
|
* if you want to skip the "header lines": the lines that only contain meta data.
|
|
3990
3973
|
* @returns {Line[]} The song body lines
|
|
3991
3974
|
*/ get bodyLines() {
|
|
3992
|
-
return this.selectRenderableItems(
|
|
3975
|
+
return this.selectRenderableItems("_bodyLines", "lines");
|
|
3993
3976
|
}
|
|
3994
3977
|
/**
|
|
3995
3978
|
* Returns the song paragraphs, skipping the paragraphs that only contain empty lines
|
|
@@ -3997,7 +3980,7 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
3997
3980
|
* @see {@link bodyLines}
|
|
3998
3981
|
* @returns {Paragraph[]}
|
|
3999
3982
|
*/ get bodyParagraphs() {
|
|
4000
|
-
return this.selectRenderableItems(
|
|
3983
|
+
return this.selectRenderableItems("_bodyParagraphs", "paragraphs");
|
|
4001
3984
|
}
|
|
4002
3985
|
selectRenderableItems(targetProp, sourceProp) {
|
|
4003
3986
|
if (this[targetProp] === undefined) {
|
|
@@ -4016,42 +3999,40 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4016
3999
|
this.ensureLine();
|
|
4017
4000
|
this.currentLine.lyrics(chr);
|
|
4018
4001
|
}
|
|
4019
|
-
addLine() {
|
|
4020
|
-
this.
|
|
4021
|
-
this.flushLine();
|
|
4022
|
-
this.currentLine = $21a34a464e7bc609$export$13215d9ce4923f76(this.lines, $bc411321e9739719$export$2e2bcd8739ae039);
|
|
4002
|
+
addLine(line) {
|
|
4003
|
+
this.currentLine = line || (0, $21a34a464e7bc609$export$13215d9ce4923f76)(this.lines, (0, $bc411321e9739719$export$2e2bcd8739ae039));
|
|
4023
4004
|
this.setCurrentLineType(this.sectionType);
|
|
4024
4005
|
this.currentLine.transposeKey = this.transposeKey ?? this.currentKey;
|
|
4025
|
-
this.currentLine.key = this.currentKey || this.metadata.getSingle($5e9ede69210ec54a$export$7167c830cefcb6b5);
|
|
4006
|
+
this.currentLine.key = this.currentKey || this.metadata.getSingle((0, $5e9ede69210ec54a$export$7167c830cefcb6b5));
|
|
4026
4007
|
return this.currentLine;
|
|
4027
4008
|
}
|
|
4009
|
+
/**
|
|
4010
|
+
* The {@link Paragraph} items of which the song consists
|
|
4011
|
+
* @member {Paragraph[]}
|
|
4012
|
+
*/ get paragraphs() {
|
|
4013
|
+
let currentParagraph = new (0, $0c3420c6a3e8a9d7$export$2e2bcd8739ae039)();
|
|
4014
|
+
const paragraphs = [
|
|
4015
|
+
currentParagraph
|
|
4016
|
+
];
|
|
4017
|
+
this.lines.forEach((line)=>{
|
|
4018
|
+
if (line.isEmpty()) {
|
|
4019
|
+
currentParagraph = new (0, $0c3420c6a3e8a9d7$export$2e2bcd8739ae039)();
|
|
4020
|
+
paragraphs.push(currentParagraph);
|
|
4021
|
+
} else if (line.hasRenderableItems()) currentParagraph.addLine(line);
|
|
4022
|
+
});
|
|
4023
|
+
return paragraphs;
|
|
4024
|
+
}
|
|
4028
4025
|
setCurrentLineType(sectionType) {
|
|
4029
4026
|
this.currentLine.type = sectionType;
|
|
4030
4027
|
}
|
|
4031
|
-
flushLine() {
|
|
4032
|
-
if (this.currentLine !== null) {
|
|
4033
|
-
if (this.currentLine.isEmpty()) this.addParagraph();
|
|
4034
|
-
else if (this.currentLine.hasRenderableItems()) this.currentParagraph.addLine(this.currentLine);
|
|
4035
|
-
}
|
|
4036
|
-
}
|
|
4037
|
-
finish() {
|
|
4038
|
-
this.flushLine();
|
|
4039
|
-
}
|
|
4040
4028
|
ensureLine() {
|
|
4041
4029
|
if (this.currentLine === null) this.addLine();
|
|
4042
4030
|
}
|
|
4043
|
-
addParagraph() {
|
|
4044
|
-
this.currentParagraph = $21a34a464e7bc609$export$13215d9ce4923f76(this.paragraphs, $0c3420c6a3e8a9d7$export$2e2bcd8739ae039);
|
|
4045
|
-
return this.currentParagraph;
|
|
4046
|
-
}
|
|
4047
|
-
ensureParagraph() {
|
|
4048
|
-
if (this.currentParagraph === null) this.addParagraph();
|
|
4049
|
-
}
|
|
4050
4031
|
addTag(tagContents) {
|
|
4051
|
-
const tag = $5e9ede69210ec54a$export$2e2bcd8739ae039.parse(tagContents);
|
|
4032
|
+
const tag = (0, $5e9ede69210ec54a$export$2e2bcd8739ae039).parse(tagContents);
|
|
4052
4033
|
if (tag.isMetaTag()) this.setMetadata(tag.name, tag.value);
|
|
4053
|
-
else if (tag.name === $5e9ede69210ec54a$export$ae60ab9b4739fc3d) this.transposeKey = tag.value;
|
|
4054
|
-
else if (tag.name === $5e9ede69210ec54a$export$b7627374a6424f68) this.currentKey = tag.value;
|
|
4034
|
+
else if (tag.name === (0, $5e9ede69210ec54a$export$ae60ab9b4739fc3d)) this.transposeKey = tag.value;
|
|
4035
|
+
else if (tag.name === (0, $5e9ede69210ec54a$export$b7627374a6424f68)) this.currentKey = tag.value;
|
|
4055
4036
|
else this.setSectionTypeFromTag(tag);
|
|
4056
4037
|
this.ensureLine();
|
|
4057
4038
|
this.currentLine.addTag(tag);
|
|
@@ -4059,46 +4040,46 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4059
4040
|
}
|
|
4060
4041
|
setSectionTypeFromTag(tag) {
|
|
4061
4042
|
switch(tag.name){
|
|
4062
|
-
case $5e9ede69210ec54a$export$4f5168acae064e01:
|
|
4063
|
-
this.startSection($af8d31735c159a26$export$8db6c706fc9142b2, tag);
|
|
4043
|
+
case 0, $5e9ede69210ec54a$export$4f5168acae064e01:
|
|
4044
|
+
this.startSection((0, $af8d31735c159a26$export$8db6c706fc9142b2), tag);
|
|
4064
4045
|
break;
|
|
4065
|
-
case $5e9ede69210ec54a$export$473c1a4819e5180b:
|
|
4066
|
-
this.endSection($af8d31735c159a26$export$8db6c706fc9142b2, tag);
|
|
4046
|
+
case 0, $5e9ede69210ec54a$export$473c1a4819e5180b:
|
|
4047
|
+
this.endSection((0, $af8d31735c159a26$export$8db6c706fc9142b2), tag);
|
|
4067
4048
|
break;
|
|
4068
|
-
case $5e9ede69210ec54a$export$8dd1111100e0e88d:
|
|
4069
|
-
this.startSection($af8d31735c159a26$export$f1c9dd0f5207dd5e, tag);
|
|
4049
|
+
case 0, $5e9ede69210ec54a$export$8dd1111100e0e88d:
|
|
4050
|
+
this.startSection((0, $af8d31735c159a26$export$f1c9dd0f5207dd5e), tag);
|
|
4070
4051
|
break;
|
|
4071
|
-
case $5e9ede69210ec54a$export$66a0ef3ffeab32b7:
|
|
4072
|
-
this.endSection($af8d31735c159a26$export$f1c9dd0f5207dd5e, tag);
|
|
4052
|
+
case 0, $5e9ede69210ec54a$export$66a0ef3ffeab32b7:
|
|
4053
|
+
this.endSection((0, $af8d31735c159a26$export$f1c9dd0f5207dd5e), tag);
|
|
4073
4054
|
break;
|
|
4074
|
-
case $5e9ede69210ec54a$export$deca399f8cd9b7dc:
|
|
4075
|
-
this.startSection($af8d31735c159a26$export$4b194284baed1659, tag);
|
|
4055
|
+
case 0, $5e9ede69210ec54a$export$deca399f8cd9b7dc:
|
|
4056
|
+
this.startSection((0, $af8d31735c159a26$export$4b194284baed1659), tag);
|
|
4076
4057
|
break;
|
|
4077
|
-
case $5e9ede69210ec54a$export$640d294ab83f9040:
|
|
4078
|
-
this.endSection($af8d31735c159a26$export$4b194284baed1659, tag);
|
|
4058
|
+
case 0, $5e9ede69210ec54a$export$640d294ab83f9040:
|
|
4059
|
+
this.endSection((0, $af8d31735c159a26$export$4b194284baed1659), tag);
|
|
4079
4060
|
break;
|
|
4080
4061
|
default:
|
|
4081
4062
|
break;
|
|
4082
4063
|
}
|
|
4083
4064
|
}
|
|
4084
4065
|
startSection(sectionType, tag) {
|
|
4085
|
-
this.checkCurrentSectionType($af8d31735c159a26$export$c53d0f541b41b88e, tag);
|
|
4066
|
+
this.checkCurrentSectionType((0, $af8d31735c159a26$export$c53d0f541b41b88e), tag);
|
|
4086
4067
|
this.sectionType = sectionType;
|
|
4087
4068
|
this.setCurrentLineType(sectionType);
|
|
4088
4069
|
}
|
|
4089
4070
|
endSection(sectionType, tag) {
|
|
4090
4071
|
this.checkCurrentSectionType(sectionType, tag);
|
|
4091
|
-
this.sectionType = $af8d31735c159a26$export$c53d0f541b41b88e;
|
|
4072
|
+
this.sectionType = (0, $af8d31735c159a26$export$c53d0f541b41b88e);
|
|
4092
4073
|
}
|
|
4093
4074
|
checkCurrentSectionType(sectionType, tag) {
|
|
4094
4075
|
if (this.sectionType !== sectionType) this.addWarning(`Unexpected tag {${tag.originalName}, current section is: ${this.sectionType}`, tag);
|
|
4095
4076
|
}
|
|
4096
4077
|
addWarning(message, { line: line , column: column }) {
|
|
4097
|
-
const warning = new $ce1dd7d0f2cd2369$export$2e2bcd8739ae039(message, line, column);
|
|
4078
|
+
const warning = new (0, $ce1dd7d0f2cd2369$export$2e2bcd8739ae039)(message, line, column);
|
|
4098
4079
|
this.warnings.push(warning);
|
|
4099
4080
|
}
|
|
4100
4081
|
addItem(item) {
|
|
4101
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039) this.addTag(item);
|
|
4082
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)) this.addTag(item);
|
|
4102
4083
|
else {
|
|
4103
4084
|
this.ensureLine();
|
|
4104
4085
|
this.currentLine.addItem(item);
|
|
@@ -4108,7 +4089,7 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4108
4089
|
* Returns a deep clone of the song
|
|
4109
4090
|
* @returns {Song} The cloned song
|
|
4110
4091
|
*/ clone() {
|
|
4111
|
-
return this.mapItems(
|
|
4092
|
+
return this.mapItems((item)=>item);
|
|
4112
4093
|
}
|
|
4113
4094
|
setMetadata(name, value) {
|
|
4114
4095
|
this.metadata.add(name, value);
|
|
@@ -4118,57 +4099,86 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4118
4099
|
* @deprecated
|
|
4119
4100
|
* @returns {@link Metadata} The metadata
|
|
4120
4101
|
*/ get metaData() {
|
|
4121
|
-
$21a34a464e7bc609$export$b680e6b2c82f8c2f('metaData has been deprecated, please use metadata instead (notice the lowercase "d")');
|
|
4102
|
+
(0, $21a34a464e7bc609$export$b680e6b2c82f8c2f)('metaData has been deprecated, please use metadata instead (notice the lowercase "d")');
|
|
4122
4103
|
return this.metadata;
|
|
4123
4104
|
}
|
|
4124
4105
|
getMetadata(name) {
|
|
4125
4106
|
return this.metadata[name] || null;
|
|
4126
4107
|
}
|
|
4127
4108
|
/**
|
|
4128
|
-
* Returns a copy of the song with the
|
|
4109
|
+
* Returns a copy of the song with the key value set to the specified key. It changes:
|
|
4110
|
+
* - the value for `key` in the `metadata` set
|
|
4111
|
+
* - any existing `key` directive
|
|
4112
|
+
* @param {number|null} key the key. Passing `null` will:
|
|
4113
|
+
* - remove the current key from `metadata`
|
|
4114
|
+
* - remove any `key` directive
|
|
4115
|
+
* @returns {Song} The changed song
|
|
4116
|
+
*/ setKey(key) {
|
|
4117
|
+
return this.changeMetadata((0, $5e9ede69210ec54a$export$7167c830cefcb6b5), key);
|
|
4118
|
+
}
|
|
4119
|
+
/**
|
|
4120
|
+
* Returns a copy of the song with the key value set to the specified capo. It changes:
|
|
4129
4121
|
* - the value for `capo` in the `metadata` set
|
|
4130
|
-
* - any existing `capo` directive
|
|
4122
|
+
* - any existing `capo` directive
|
|
4131
4123
|
* @param {number|null} capo the capo. Passing `null` will:
|
|
4132
4124
|
* - remove the current key from `metadata`
|
|
4133
4125
|
* - remove any `capo` directive
|
|
4134
4126
|
* @returns {Song} The changed song
|
|
4135
4127
|
*/ setCapo(capo) {
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
, (item)=>item.set({
|
|
4141
|
-
value:
|
|
4142
|
-
})
|
|
4143
|
-
, (song)=>song.insertDirective($5e9ede69210ec54a$export$866f445d49bad88e, capo)
|
|
4144
|
-
);
|
|
4145
|
-
updatedSong.metadata.set('capo', capo);
|
|
4146
|
-
return updatedSong;
|
|
4128
|
+
return this.changeMetadata((0, $5e9ede69210ec54a$export$866f445d49bad88e), capo);
|
|
4129
|
+
}
|
|
4130
|
+
setDirective(name, value) {
|
|
4131
|
+
if (value === null) return this.removeItem((item)=>item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.name === name);
|
|
4132
|
+
return this.updateItem((item)=>item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.name === name, (item)=>item.set({
|
|
4133
|
+
value: value
|
|
4134
|
+
}), (song)=>song.insertDirective(name, value));
|
|
4147
4135
|
}
|
|
4148
4136
|
/**
|
|
4149
4137
|
* Returns a copy of the song with the key set to the specified key. It changes:
|
|
4150
4138
|
* - the value for `key` in the `metadata` set
|
|
4151
4139
|
* - any existing `key` directive
|
|
4152
4140
|
* - all chords, those are transposed according to the distance between the current and the new key
|
|
4153
|
-
* @param {string}
|
|
4141
|
+
* @param {string} newKey The new key.
|
|
4154
4142
|
* @returns {Song} The changed song
|
|
4155
|
-
*/
|
|
4156
|
-
const transpose =
|
|
4143
|
+
*/ changeKey(newKey) {
|
|
4144
|
+
const transpose = this.getTransposeDistance(newKey);
|
|
4157
4145
|
const updatedSong = this.mapItems((item)=>{
|
|
4158
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 && item.name === $5e9ede69210ec54a$export$7167c830cefcb6b5) return item.set({
|
|
4159
|
-
value:
|
|
4146
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.name === (0, $5e9ede69210ec54a$export$7167c830cefcb6b5)) return item.set({
|
|
4147
|
+
value: newKey
|
|
4160
4148
|
});
|
|
4161
|
-
if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) return item.transpose(transpose,
|
|
4149
|
+
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) return item.transpose(transpose, newKey);
|
|
4162
4150
|
return item;
|
|
4163
4151
|
});
|
|
4164
|
-
updatedSong.metadata.set(
|
|
4152
|
+
updatedSong.metadata.set("key", newKey);
|
|
4153
|
+
return updatedSong;
|
|
4154
|
+
}
|
|
4155
|
+
getTransposeDistance(newKey) {
|
|
4156
|
+
const wrappedKey = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(this.key);
|
|
4157
|
+
if (!wrappedKey) throw new Error(`
|
|
4158
|
+
Cannot change song key, the original key is unknown.
|
|
4159
|
+
|
|
4160
|
+
Either ensure a key directive is present in the song (when using chordpro):
|
|
4161
|
+
\`{key: C}\`
|
|
4162
|
+
|
|
4163
|
+
Or set the song key before changing key:
|
|
4164
|
+
\`song.setKey('C');\``.substring(1));
|
|
4165
|
+
return wrappedKey.distanceTo(newKey);
|
|
4166
|
+
}
|
|
4167
|
+
/**
|
|
4168
|
+
* Returns a copy of the song with the directive value set to the specified value.
|
|
4169
|
+
* - when there is a matching directive in the song, it will update the directive
|
|
4170
|
+
* - when there is no matching directive, it will be inserted
|
|
4171
|
+
* If `value` is `null` it will act as a delete, any directive matching `name` will be removed.
|
|
4172
|
+
* @param {string} name The directive name
|
|
4173
|
+
* @param {string | null} value The value to set, or `null` to remove the directive
|
|
4174
|
+
*/ changeMetadata(name, value) {
|
|
4175
|
+
const updatedSong = this.setDirective(name, value);
|
|
4176
|
+
updatedSong.metadata.set(name, value);
|
|
4165
4177
|
return updatedSong;
|
|
4166
4178
|
}
|
|
4167
4179
|
insertDirective(name, value, { after: after = null } = {}) {
|
|
4168
|
-
const insertIndex = this.lines.findIndex((line)=>line.items.some((item)=>!(item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039) || after && item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 && item.name === after
|
|
4169
|
-
|
|
4170
|
-
);
|
|
4171
|
-
const newLine = new $bc411321e9739719$export$2e2bcd8739ae039();
|
|
4180
|
+
const insertIndex = this.lines.findIndex((line)=>line.items.some((item)=>!(item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)) || after && item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.name === after));
|
|
4181
|
+
const newLine = new (0, $bc411321e9739719$export$2e2bcd8739ae039)();
|
|
4172
4182
|
newLine.addTag(name, value);
|
|
4173
4183
|
const clonedSong = this.clone();
|
|
4174
4184
|
const { lines: lines } = clonedSong;
|
|
@@ -4179,19 +4189,52 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4179
4189
|
];
|
|
4180
4190
|
return clonedSong;
|
|
4181
4191
|
}
|
|
4182
|
-
|
|
4192
|
+
/**
|
|
4193
|
+
* Change the song contents inline. Return a new {@link Item} to replace it. Return `null` to remove it.
|
|
4194
|
+
* @example
|
|
4195
|
+
* // transpose all chords:
|
|
4196
|
+
* song.mapItems((item) => {
|
|
4197
|
+
* if (item instanceof ChordLyricsPair) {
|
|
4198
|
+
* return item.transpose(2, 'D');
|
|
4199
|
+
* }
|
|
4200
|
+
*
|
|
4201
|
+
* return item;
|
|
4202
|
+
* });
|
|
4203
|
+
* @param {MapItemsCallback} func the callback function
|
|
4204
|
+
* @returns {Song} the changed song
|
|
4205
|
+
*/ mapItems(func) {
|
|
4183
4206
|
const clonedSong = new $6f653df65dfdf4ef$var$Song();
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4207
|
+
this.lines.forEach((line)=>{
|
|
4208
|
+
clonedSong.addLine();
|
|
4209
|
+
line.items.forEach((item)=>{
|
|
4210
|
+
const changedItem = func(item);
|
|
4211
|
+
if (changedItem) clonedSong.addItem(changedItem);
|
|
4212
|
+
});
|
|
4213
|
+
});
|
|
4187
4214
|
return clonedSong;
|
|
4188
4215
|
}
|
|
4189
|
-
|
|
4216
|
+
/**
|
|
4217
|
+
* Change the song contents inline. Return a new {@link Line} to replace it. Return `null` to remove it.
|
|
4218
|
+
* @example
|
|
4219
|
+
* // remove lines with only Tags:
|
|
4220
|
+
* song.mapLines((line) => {
|
|
4221
|
+
* if (line.items.every(item => item instanceof Tag)) {
|
|
4222
|
+
* return null;
|
|
4223
|
+
* }
|
|
4224
|
+
*
|
|
4225
|
+
* return line;
|
|
4226
|
+
* });
|
|
4227
|
+
* @param {MapLinesCallback} func the callback function
|
|
4228
|
+
* @returns {Song} the changed song
|
|
4229
|
+
*/ mapLines(func) {
|
|
4190
4230
|
const clonedSong = new $6f653df65dfdf4ef$var$Song();
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4231
|
+
this.lines.forEach((line)=>{
|
|
4232
|
+
const changedLine = func(line);
|
|
4233
|
+
if (changedLine) {
|
|
4234
|
+
clonedSong.addLine();
|
|
4235
|
+
changedLine.items.forEach((item)=>clonedSong.addItem(item));
|
|
4236
|
+
}
|
|
4237
|
+
});
|
|
4195
4238
|
return clonedSong;
|
|
4196
4239
|
}
|
|
4197
4240
|
updateItem(findCallback, updateCallback, notFoundCallback) {
|
|
@@ -4230,7 +4273,7 @@ var $6f653df65dfdf4ef$export$2e2bcd8739ae039 = $6f653df65dfdf4ef$var$Song;
|
|
|
4230
4273
|
class $55622b65d99fa8e1$var$EvaluationError extends Error {
|
|
4231
4274
|
constructor(message, line, column, offset){
|
|
4232
4275
|
super(`${message} on line ${line} column ${column}`);
|
|
4233
|
-
this.name =
|
|
4276
|
+
this.name = "ExpressionError";
|
|
4234
4277
|
this.line = line;
|
|
4235
4278
|
this.column = column;
|
|
4236
4279
|
this.offset = offset;
|
|
@@ -4247,16 +4290,14 @@ class $812df3771838671d$var$Composite {
|
|
|
4247
4290
|
this.variable = variable;
|
|
4248
4291
|
}
|
|
4249
4292
|
evaluate(metadata, metadataSeparator) {
|
|
4250
|
-
return this.expressions.map((expression)=>expression.evaluate(metadata, metadataSeparator, this.variable)
|
|
4251
|
-
).join('');
|
|
4293
|
+
return this.expressions.map((expression)=>expression.evaluate(metadata, metadataSeparator, this.variable)).join("");
|
|
4252
4294
|
}
|
|
4253
4295
|
isRenderable() {
|
|
4254
4296
|
return true;
|
|
4255
4297
|
}
|
|
4256
4298
|
clone() {
|
|
4257
4299
|
return new $812df3771838671d$var$Composite({
|
|
4258
|
-
expressions: this.expressions.map((expression)=>expression.clone()
|
|
4259
|
-
),
|
|
4300
|
+
expressions: this.expressions.map((expression)=>expression.clone()),
|
|
4260
4301
|
variable: this.variable
|
|
4261
4302
|
});
|
|
4262
4303
|
}
|
|
@@ -4265,7 +4306,7 @@ var $812df3771838671d$export$2e2bcd8739ae039 = $812df3771838671d$var$Composite;
|
|
|
4265
4306
|
|
|
4266
4307
|
|
|
4267
4308
|
|
|
4268
|
-
class $b6d84b168638423d$var$Ternary extends $cf00b4d3af89fa07$export$2e2bcd8739ae039 {
|
|
4309
|
+
class $b6d84b168638423d$var$Ternary extends (0, $cf00b4d3af89fa07$export$2e2bcd8739ae039) {
|
|
4269
4310
|
trueExpression = [];
|
|
4270
4311
|
falseExpression = [];
|
|
4271
4312
|
constructor({ variable: variable = null , valueTest: valueTest = null , trueExpression: trueExpression = null , falseExpression: falseExpression = null , line: line = null , column: column = null , offset: offset = null , } = {}){
|
|
@@ -4274,7 +4315,7 @@ class $b6d84b168638423d$var$Ternary extends $cf00b4d3af89fa07$export$2e2bcd8739a
|
|
|
4274
4315
|
column: column,
|
|
4275
4316
|
offset: offset
|
|
4276
4317
|
});
|
|
4277
|
-
this.variable = $21a34a464e7bc609$export$ed9b06b5ee264ad3(variable);
|
|
4318
|
+
this.variable = (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)(variable);
|
|
4278
4319
|
this.valueTest = valueTest;
|
|
4279
4320
|
this.trueExpression = trueExpression;
|
|
4280
4321
|
this.falseExpression = falseExpression;
|
|
@@ -4286,7 +4327,7 @@ class $b6d84b168638423d$var$Ternary extends $cf00b4d3af89fa07$export$2e2bcd8739a
|
|
|
4286
4327
|
* @returns {string} The evaluated expression
|
|
4287
4328
|
*/ evaluate(metadata, metadataSeparator = null, upperContext = null) {
|
|
4288
4329
|
if (this.variable) return this.evaluateWithVariable(metadata, metadataSeparator);
|
|
4289
|
-
if (!upperContext) throw new $55622b65d99fa8e1$export$2e2bcd8739ae039(
|
|
4330
|
+
if (!upperContext) throw new (0, $55622b65d99fa8e1$export$2e2bcd8739ae039)("Unexpected empty expression", this.line, this.column, this.offset);
|
|
4290
4331
|
return this.evaluateToString(metadata.get(upperContext), metadataSeparator);
|
|
4291
4332
|
}
|
|
4292
4333
|
evaluateToString(value, metadataSeparator) {
|
|
@@ -4295,12 +4336,12 @@ class $b6d84b168638423d$var$Ternary extends $cf00b4d3af89fa07$export$2e2bcd8739a
|
|
|
4295
4336
|
}
|
|
4296
4337
|
evaluateWithVariable(metadata, metadataSeparator) {
|
|
4297
4338
|
const value = metadata.get(this.variable);
|
|
4298
|
-
if ($21a34a464e7bc609$export$ee27c052bca048fb(value) && (!this.valueTest || value === this.valueTest)) return this.evaluateForTruthyValue(metadata, metadataSeparator, value);
|
|
4299
|
-
if (this.falseExpression) return new $812df3771838671d$export$2e2bcd8739ae039(this.falseExpression, this.variable).evaluate(metadata, metadataSeparator);
|
|
4300
|
-
return
|
|
4339
|
+
if ((0, $21a34a464e7bc609$export$ee27c052bca048fb)(value) && (!this.valueTest || value === this.valueTest)) return this.evaluateForTruthyValue(metadata, metadataSeparator, value);
|
|
4340
|
+
if (this.falseExpression) return new (0, $812df3771838671d$export$2e2bcd8739ae039)(this.falseExpression, this.variable).evaluate(metadata, metadataSeparator);
|
|
4341
|
+
return "";
|
|
4301
4342
|
}
|
|
4302
4343
|
evaluateForTruthyValue(metadata, metadataSeparator, value) {
|
|
4303
|
-
if (this.trueExpression) return new $812df3771838671d$export$2e2bcd8739ae039(this.trueExpression, this.variable).evaluate(metadata, metadataSeparator);
|
|
4344
|
+
if (this.trueExpression) return new (0, $812df3771838671d$export$2e2bcd8739ae039)(this.trueExpression, this.variable).evaluate(metadata, metadataSeparator);
|
|
4304
4345
|
return value;
|
|
4305
4346
|
}
|
|
4306
4347
|
isRenderable() {
|
|
@@ -4310,10 +4351,8 @@ class $b6d84b168638423d$var$Ternary extends $cf00b4d3af89fa07$export$2e2bcd8739a
|
|
|
4310
4351
|
return new $b6d84b168638423d$var$Ternary({
|
|
4311
4352
|
variable: this.variable,
|
|
4312
4353
|
valueTest: this.valueTest,
|
|
4313
|
-
trueExpression: this.trueExpression?.map((part)=>part.clone()
|
|
4314
|
-
),
|
|
4315
|
-
falseExpression: this.falseExpression?.map((part)=>part.clone()
|
|
4316
|
-
),
|
|
4354
|
+
trueExpression: this.trueExpression?.map((part)=>part.clone()),
|
|
4355
|
+
falseExpression: this.falseExpression?.map((part)=>part.clone()),
|
|
4317
4356
|
line: this.line,
|
|
4318
4357
|
column: this.column,
|
|
4319
4358
|
offset: this.offset
|
|
@@ -4324,12 +4363,12 @@ var $b6d84b168638423d$export$2e2bcd8739ae039 = $b6d84b168638423d$var$Ternary;
|
|
|
4324
4363
|
|
|
4325
4364
|
|
|
4326
4365
|
|
|
4327
|
-
const $1c14afc274b727b7$var$CHORD_SHEET =
|
|
4328
|
-
const $1c14afc274b727b7$var$CHORD_LYRICS_PAIR =
|
|
4329
|
-
const $1c14afc274b727b7$var$TAG =
|
|
4330
|
-
const $1c14afc274b727b7$var$COMMENT =
|
|
4331
|
-
const $1c14afc274b727b7$var$TERNARY =
|
|
4332
|
-
const $1c14afc274b727b7$var$LINE =
|
|
4366
|
+
const $1c14afc274b727b7$var$CHORD_SHEET = "chordSheet";
|
|
4367
|
+
const $1c14afc274b727b7$var$CHORD_LYRICS_PAIR = "chordLyricsPair";
|
|
4368
|
+
const $1c14afc274b727b7$var$TAG = "tag";
|
|
4369
|
+
const $1c14afc274b727b7$var$COMMENT = "comment";
|
|
4370
|
+
const $1c14afc274b727b7$var$TERNARY = "ternary";
|
|
4371
|
+
const $1c14afc274b727b7$var$LINE = "line";
|
|
4333
4372
|
/**
|
|
4334
4373
|
* Serializes a song into een plain object, and deserializes the serialized object back into a {@link Song}
|
|
4335
4374
|
*/ class $1c14afc274b727b7$var$ChordSheetSerializer {
|
|
@@ -4340,22 +4379,20 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4340
4379
|
*/ serialize(song) {
|
|
4341
4380
|
return {
|
|
4342
4381
|
type: $1c14afc274b727b7$var$CHORD_SHEET,
|
|
4343
|
-
lines: song.lines.map((line)=>this.serializeLine(line)
|
|
4344
|
-
)
|
|
4382
|
+
lines: song.lines.map((line)=>this.serializeLine(line))
|
|
4345
4383
|
};
|
|
4346
4384
|
}
|
|
4347
4385
|
serializeLine(line) {
|
|
4348
4386
|
return {
|
|
4349
4387
|
type: $1c14afc274b727b7$var$LINE,
|
|
4350
|
-
items: line.items.map((item)=>this.serializeItem(item)
|
|
4351
|
-
)
|
|
4388
|
+
items: line.items.map((item)=>this.serializeItem(item))
|
|
4352
4389
|
};
|
|
4353
4390
|
}
|
|
4354
4391
|
serializeItem(item) {
|
|
4355
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039) return this.serializeTag(item);
|
|
4356
|
-
if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) return this.serializeChordLyricsPair(item);
|
|
4357
|
-
if (item instanceof $b6d84b168638423d$export$2e2bcd8739ae039) return this.serializeTernary(item);
|
|
4358
|
-
if (item instanceof $e1378a714a1834c5$export$2e2bcd8739ae039) return this.serializeLiteral(item);
|
|
4392
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)) return this.serializeTag(item);
|
|
4393
|
+
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) return this.serializeChordLyricsPair(item);
|
|
4394
|
+
if (item instanceof (0, $b6d84b168638423d$export$2e2bcd8739ae039)) return this.serializeTernary(item);
|
|
4395
|
+
if (item instanceof (0, $e1378a714a1834c5$export$2e2bcd8739ae039)) return this.serializeLiteral(item);
|
|
4359
4396
|
throw new Error(`Don't know how to serialize ${item.constructor.name}`);
|
|
4360
4397
|
}
|
|
4361
4398
|
serializeTag(tag) {
|
|
@@ -4385,8 +4422,7 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4385
4422
|
return literal.string;
|
|
4386
4423
|
}
|
|
4387
4424
|
serializeExpression(expression) {
|
|
4388
|
-
return expression?.map((part)=>this.serializeItem(part)
|
|
4389
|
-
);
|
|
4425
|
+
return expression?.map((part)=>this.serializeItem(part));
|
|
4390
4426
|
}
|
|
4391
4427
|
/**
|
|
4392
4428
|
* Deserializes a song that has been serialized using {@link serialize}
|
|
@@ -4394,12 +4430,11 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4394
4430
|
* @returns {Song} The deserialized song
|
|
4395
4431
|
*/ deserialize(serializedSong) {
|
|
4396
4432
|
this.parseAstComponent(serializedSong);
|
|
4397
|
-
this.song.finish();
|
|
4398
4433
|
return this.song;
|
|
4399
4434
|
}
|
|
4400
4435
|
parseAstComponent(astComponent) {
|
|
4401
4436
|
if (!astComponent) return null;
|
|
4402
|
-
if (typeof astComponent ===
|
|
4437
|
+
if (typeof astComponent === "string") return new (0, $e1378a714a1834c5$export$2e2bcd8739ae039)(astComponent);
|
|
4403
4438
|
const { type: type } = astComponent;
|
|
4404
4439
|
switch(type){
|
|
4405
4440
|
case $1c14afc274b727b7$var$CHORD_SHEET:
|
|
@@ -4419,9 +4454,8 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4419
4454
|
}
|
|
4420
4455
|
parseChordSheet(astComponent) {
|
|
4421
4456
|
const { lines: lines } = astComponent;
|
|
4422
|
-
this.song = new $6f653df65dfdf4ef$export$2e2bcd8739ae039();
|
|
4423
|
-
lines.forEach((line)=>this.parseLine(line)
|
|
4424
|
-
);
|
|
4457
|
+
this.song = new (0, $6f653df65dfdf4ef$export$2e2bcd8739ae039)();
|
|
4458
|
+
lines.forEach((line)=>this.parseLine(line));
|
|
4425
4459
|
}
|
|
4426
4460
|
parseLine(astComponent) {
|
|
4427
4461
|
const { items: items } = astComponent;
|
|
@@ -4433,11 +4467,11 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4433
4467
|
}
|
|
4434
4468
|
parseChordLyricsPair(astComponent) {
|
|
4435
4469
|
const { chords: chords , lyrics: lyrics } = astComponent;
|
|
4436
|
-
return new $d454f4215ba01af2$export$2e2bcd8739ae039(chords, lyrics);
|
|
4470
|
+
return new (0, $d454f4215ba01af2$export$2e2bcd8739ae039)(chords, lyrics);
|
|
4437
4471
|
}
|
|
4438
4472
|
parseTag(astComponent) {
|
|
4439
4473
|
const { name: name , value: value , location: { offset: offset = null , line: line = null , column: column = null } = {} , } = astComponent;
|
|
4440
|
-
return new $5e9ede69210ec54a$export$2e2bcd8739ae039(name, value, {
|
|
4474
|
+
return new (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)(name, value, {
|
|
4441
4475
|
line: line,
|
|
4442
4476
|
column: column,
|
|
4443
4477
|
offset: offset
|
|
@@ -4445,11 +4479,11 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4445
4479
|
}
|
|
4446
4480
|
parseComment(astComponent) {
|
|
4447
4481
|
const { comment: comment } = astComponent;
|
|
4448
|
-
return new $2115988b22311cb1$export$2e2bcd8739ae039(comment);
|
|
4482
|
+
return new (0, $2115988b22311cb1$export$2e2bcd8739ae039)(comment);
|
|
4449
4483
|
}
|
|
4450
4484
|
parseTernary(astComponent) {
|
|
4451
4485
|
const { variable: variable , valueTest: valueTest , trueExpression: trueExpression , falseExpression: falseExpression , location: { offset: offset = null , line: line = null , column: column = null } = {} , } = astComponent;
|
|
4452
|
-
return new $b6d84b168638423d$export$2e2bcd8739ae039({
|
|
4486
|
+
return new (0, $b6d84b168638423d$export$2e2bcd8739ae039)({
|
|
4453
4487
|
variable: variable,
|
|
4454
4488
|
valueTest: valueTest,
|
|
4455
4489
|
trueExpression: this.parseExpression(trueExpression),
|
|
@@ -4460,9 +4494,8 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4460
4494
|
});
|
|
4461
4495
|
}
|
|
4462
4496
|
parseExpression(expression) {
|
|
4463
|
-
const parsedParts = (expression || []).map((part)=>this.parseAstComponent(part)
|
|
4464
|
-
);
|
|
4465
|
-
return $21a34a464e7bc609$export$ed9b06b5ee264ad3(parsedParts);
|
|
4497
|
+
const parsedParts = (expression || []).map((part)=>this.parseAstComponent(part));
|
|
4498
|
+
return (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)(parsedParts);
|
|
4466
4499
|
}
|
|
4467
4500
|
}
|
|
4468
4501
|
var $1c14afc274b727b7$export$2e2bcd8739ae039 = $1c14afc274b727b7$var$ChordSheetSerializer;
|
|
@@ -4476,12 +4509,8 @@ var $1c14afc274b727b7$export$2e2bcd8739ae039 = $1c14afc274b727b7$var$ChordSheetS
|
|
|
4476
4509
|
* @param {string} chordProChordSheet the ChordPro chord sheet
|
|
4477
4510
|
* @returns {Song} The parsed song
|
|
4478
4511
|
*/ parse(chordProChordSheet) {
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
* @member
|
|
4482
|
-
* @type {ParserWarning[]}
|
|
4483
|
-
*/ const ast = $1a506a341538d943$export$98e6a39c04603d36(chordProChordSheet);
|
|
4484
|
-
this.song = new $1c14afc274b727b7$export$2e2bcd8739ae039().deserialize(ast);
|
|
4512
|
+
const ast = (0, $1a506a341538d943$export$98e6a39c04603d36)(chordProChordSheet);
|
|
4513
|
+
this.song = new (0, $1c14afc274b727b7$export$2e2bcd8739ae039)().deserialize(ast);
|
|
4485
4514
|
return this.song;
|
|
4486
4515
|
}
|
|
4487
4516
|
/**
|
|
@@ -4528,7 +4557,6 @@ const $c049675f48c823b2$var$CHORD_LINE_REGEX = /^\s*((([A-G])(#|b)?([^/\s]*)(\/(
|
|
|
4528
4557
|
this.parseLine(line);
|
|
4529
4558
|
}
|
|
4530
4559
|
this.endOfSong();
|
|
4531
|
-
this.song.finish();
|
|
4532
4560
|
return this.song;
|
|
4533
4561
|
}
|
|
4534
4562
|
endOfSong() {}
|
|
@@ -4545,8 +4573,8 @@ const $c049675f48c823b2$var$CHORD_LINE_REGEX = /^\s*((([A-G])(#|b)?([^/\s]*)(\/(
|
|
|
4545
4573
|
} else this.chordLyricsPair.lyrics = `${line}`;
|
|
4546
4574
|
}
|
|
4547
4575
|
initialize(document, { song: song = null } = {}) {
|
|
4548
|
-
this.song = song || new $6f653df65dfdf4ef$export$2e2bcd8739ae039();
|
|
4549
|
-
this.lines = document.split(
|
|
4576
|
+
this.song = song || new (0, $6f653df65dfdf4ef$export$2e2bcd8739ae039)();
|
|
4577
|
+
this.lines = document.split("\n");
|
|
4550
4578
|
this.currentLine = 0;
|
|
4551
4579
|
this.lineCount = this.lines.length;
|
|
4552
4580
|
this.processingText = true;
|
|
@@ -4572,7 +4600,7 @@ const $c049675f48c823b2$var$CHORD_LINE_REGEX = /^\s*((([A-G])(#|b)?([^/\s]*)(\/(
|
|
|
4572
4600
|
const nextChar = chordsLine[c + 1];
|
|
4573
4601
|
const isWhiteSpace = $c049675f48c823b2$var$WHITE_SPACE.test(chr);
|
|
4574
4602
|
this.addCharacter(chr, nextChar);
|
|
4575
|
-
this.chordLyricsPair.lyrics += lyricsLine[c] ||
|
|
4603
|
+
this.chordLyricsPair.lyrics += lyricsLine[c] || "";
|
|
4576
4604
|
this.processingText = !isWhiteSpace;
|
|
4577
4605
|
}
|
|
4578
4606
|
}
|
|
@@ -4601,30 +4629,30 @@ const $db9c80925e255cd2$var$VERSE_LINE_REGEX = /^\[Verse.*]/;
|
|
|
4601
4629
|
const $db9c80925e255cd2$var$CHORUS_LINE_REGEX = /^\[Chorus]/;
|
|
4602
4630
|
const $db9c80925e255cd2$var$OTHER_METADATA_LINE_REGEX = /^\[([^\]]+)]/;
|
|
4603
4631
|
const $db9c80925e255cd2$var$startSectionTags = {
|
|
4604
|
-
[$af8d31735c159a26$export$4b194284baed1659]: $5e9ede69210ec54a$export$deca399f8cd9b7dc,
|
|
4605
|
-
[$af8d31735c159a26$export$8db6c706fc9142b2]: $5e9ede69210ec54a$export$4f5168acae064e01
|
|
4632
|
+
[(0, $af8d31735c159a26$export$4b194284baed1659)]: (0, $5e9ede69210ec54a$export$deca399f8cd9b7dc),
|
|
4633
|
+
[(0, $af8d31735c159a26$export$8db6c706fc9142b2)]: (0, $5e9ede69210ec54a$export$4f5168acae064e01)
|
|
4606
4634
|
};
|
|
4607
4635
|
const $db9c80925e255cd2$var$endSectionTags = {
|
|
4608
|
-
[$af8d31735c159a26$export$4b194284baed1659]: $5e9ede69210ec54a$export$640d294ab83f9040,
|
|
4609
|
-
[$af8d31735c159a26$export$8db6c706fc9142b2]: $5e9ede69210ec54a$export$473c1a4819e5180b
|
|
4636
|
+
[(0, $af8d31735c159a26$export$4b194284baed1659)]: (0, $5e9ede69210ec54a$export$640d294ab83f9040),
|
|
4637
|
+
[(0, $af8d31735c159a26$export$8db6c706fc9142b2)]: (0, $5e9ede69210ec54a$export$473c1a4819e5180b)
|
|
4610
4638
|
};
|
|
4611
4639
|
/**
|
|
4612
4640
|
* Parses an Ultimate Guitar chord sheet with metadata
|
|
4613
4641
|
* Inherits from {@link ChordSheetParser}
|
|
4614
|
-
*/ class $db9c80925e255cd2$var$UltimateGuitarParser extends $c049675f48c823b2$export$2e2bcd8739ae039 {
|
|
4642
|
+
*/ class $db9c80925e255cd2$var$UltimateGuitarParser extends (0, $c049675f48c823b2$export$2e2bcd8739ae039) {
|
|
4615
4643
|
parseLine(line) {
|
|
4616
4644
|
if (this.isSectionEnd()) this.endSection();
|
|
4617
4645
|
if ($db9c80925e255cd2$var$VERSE_LINE_REGEX.test(line)) {
|
|
4618
4646
|
this.startNewLine();
|
|
4619
|
-
this.startSection($af8d31735c159a26$export$4b194284baed1659);
|
|
4647
|
+
this.startSection((0, $af8d31735c159a26$export$4b194284baed1659));
|
|
4620
4648
|
} else if ($db9c80925e255cd2$var$CHORUS_LINE_REGEX.test(line)) {
|
|
4621
4649
|
this.startNewLine();
|
|
4622
|
-
this.startSection($af8d31735c159a26$export$8db6c706fc9142b2);
|
|
4650
|
+
this.startSection((0, $af8d31735c159a26$export$8db6c706fc9142b2));
|
|
4623
4651
|
} else if ($db9c80925e255cd2$var$OTHER_METADATA_LINE_REGEX.test(line)) {
|
|
4624
4652
|
this.startNewLine();
|
|
4625
4653
|
this.endSection();
|
|
4626
4654
|
const comment = line.match($db9c80925e255cd2$var$OTHER_METADATA_LINE_REGEX)[1];
|
|
4627
|
-
this.songLine.addTag(new $5e9ede69210ec54a$export$2e2bcd8739ae039($5e9ede69210ec54a$export$a29989082612d0d9, comment));
|
|
4655
|
+
this.songLine.addTag(new (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)((0, $5e9ede69210ec54a$export$a29989082612d0d9), comment));
|
|
4628
4656
|
} else super.parseLine(line);
|
|
4629
4657
|
}
|
|
4630
4658
|
isSectionEnd() {
|
|
@@ -4641,14 +4669,14 @@ const $db9c80925e255cd2$var$endSectionTags = {
|
|
|
4641
4669
|
if (this.currentSectionType) this.endSection();
|
|
4642
4670
|
this.currentSectionType = sectionType;
|
|
4643
4671
|
this.song.setCurrentLineType(sectionType);
|
|
4644
|
-
if (sectionType in $db9c80925e255cd2$var$startSectionTags) this.song.addTag(new $5e9ede69210ec54a$export$2e2bcd8739ae039($db9c80925e255cd2$var$startSectionTags[sectionType]));
|
|
4672
|
+
if (sectionType in $db9c80925e255cd2$var$startSectionTags) this.song.addTag(new (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)($db9c80925e255cd2$var$startSectionTags[sectionType]));
|
|
4645
4673
|
}
|
|
4646
4674
|
endSection({ addNewLine: addNewLine = true } = {}) {
|
|
4647
4675
|
if (this.currentSectionType in $db9c80925e255cd2$var$endSectionTags) {
|
|
4648
|
-
this.song.addTag(new $5e9ede69210ec54a$export$2e2bcd8739ae039($db9c80925e255cd2$var$endSectionTags[this.currentSectionType]));
|
|
4676
|
+
this.song.addTag(new (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)($db9c80925e255cd2$var$endSectionTags[this.currentSectionType]));
|
|
4649
4677
|
if (addNewLine) this.startNewLine();
|
|
4650
4678
|
}
|
|
4651
|
-
this.song.setCurrentLineType($af8d31735c159a26$export$c53d0f541b41b88e);
|
|
4679
|
+
this.song.setCurrentLineType((0, $af8d31735c159a26$export$c53d0f541b41b88e));
|
|
4652
4680
|
this.currentSectionType = null;
|
|
4653
4681
|
}
|
|
4654
4682
|
startNewLine() {
|
|
@@ -4669,13 +4697,13 @@ var $71c330be198ce421$export$2e2bcd8739ae039 = $71c330be198ce421$var$MetadataCon
|
|
|
4669
4697
|
|
|
4670
4698
|
class $bbcfd2c49e8e9957$var$Configuration {
|
|
4671
4699
|
constructor({ evaluate: evaluate = false , metadata: metadata = {
|
|
4672
|
-
separator:
|
|
4700
|
+
separator: ","
|
|
4673
4701
|
} }){
|
|
4674
4702
|
this.evaluate = evaluate;
|
|
4675
|
-
this.metadata = new $71c330be198ce421$export$2e2bcd8739ae039(metadata);
|
|
4703
|
+
this.metadata = new (0, $71c330be198ce421$export$2e2bcd8739ae039)(metadata);
|
|
4676
4704
|
}
|
|
4677
4705
|
get(key) {
|
|
4678
|
-
return ($parcel$interopDefault($988mA$lodashget))(this, key);
|
|
4706
|
+
return (0, ($parcel$interopDefault($988mA$lodashget)))(this, key);
|
|
4679
4707
|
}
|
|
4680
4708
|
}
|
|
4681
4709
|
var $bbcfd2c49e8e9957$export$2e2bcd8739ae039 = $bbcfd2c49e8e9957$var$Configuration;
|
|
@@ -4693,7 +4721,7 @@ var $bbcfd2c49e8e9957$export$2e2bcd8739ae039 = $bbcfd2c49e8e9957$var$Configurati
|
|
|
4693
4721
|
* @param {string} [configuration.metadata.separator=", "] The separator to be used when rendering a metadata value
|
|
4694
4722
|
* that has multiple values. See: https://bit.ly/2SC9c2u
|
|
4695
4723
|
*/ constructor(configuration = {}){
|
|
4696
|
-
this.configuration = new $bbcfd2c49e8e9957$export$2e2bcd8739ae039(configuration);
|
|
4724
|
+
this.configuration = new (0, $bbcfd2c49e8e9957$export$2e2bcd8739ae039)(configuration);
|
|
4697
4725
|
}
|
|
4698
4726
|
}
|
|
4699
4727
|
var $0055ecb09272ba2d$export$2e2bcd8739ae039 = $0055ecb09272ba2d$var$Formatter;
|
|
@@ -4705,33 +4733,33 @@ var $0055ecb09272ba2d$export$2e2bcd8739ae039 = $0055ecb09272ba2d$var$Formatter;
|
|
|
4705
4733
|
|
|
4706
4734
|
|
|
4707
4735
|
var $37d1d6d5b59826cf$exports = {};
|
|
4708
|
-
$37d1d6d5b59826cf$exports = JSON.parse(
|
|
4736
|
+
$37d1d6d5b59826cf$exports = JSON.parse('{"majorKeys":["A","Bb","B","C","C#","Db","D","Eb","E","F","F#","Gb","G","G#","Ab"],"minorKeys":["F#m","Gm","G#m","Am","Bbm","Bm","Cm","C#m","Dm","D#m","Ebm","Em","Fm"],"capos":{"Bb":{"1":"A","3":"G","6":"E","8":"D","10":"C"},"D":{"2":"C","5":"A","7":"G","10":"E"},"Eb":{"1":"D","3":"C","6":"A","8":"G"},"Db":{"1":"C","4":"A","6":"G","9":"E"},"C#":{"1":"C","4":"A","6":"G","9":"E"},"E":{"2":"D","4":"C","7":"A","9":"G"},"F":{"1":"E","3":"D","5":"C","6":"B","8":"A","10":"G"},"F#":{"2":"E","4":"D","6":"C","7":"B","9":"A"},"Gb":{"2":"E","4":"D","6":"C","7":"B","9":"A"},"G":{"3":"E","5":"D","7":"C","8":"B","10":"A"},"G#":{"1":"G","4":"E","6":"D","8":"C"},"Ab":{"1":"G","4":"E","6":"D","8":"C"},"A":{"2":"G","5":"E","7":"D","9":"C"},"B":{"2":"A","4":"G","7":"E","9":"D"},"C":{"3":"A","5":"G","8":"E","10":"D"},"Am":{"3":"F#m","5":"Em","7":"Dm"},"Bbm":{"1":"Am","4":"F#m","6":"Em","8":"Dm"},"Bm":{"2":"Am","5":"F#m","7":"Em"},"Cm":{"1":"Bm","3":"Am","6":"F#m","8":"Em"},"C#m":{"2":"Bm","4":"Am","7":"F#m","9":"Em"},"Dm":{"3":"Bm","5":"Am","8":"F#m"},"Ebm":{"1":"Dm","4":"Bm","6":"Am"},"D#m":{"1":"Dm","4":"Bm","6":"Am"}}}');
|
|
4709
4737
|
|
|
4710
4738
|
|
|
4711
4739
|
function $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey) {
|
|
4712
4740
|
if (/^\d+$/.test(transposeKey)) return parseInt(transposeKey, 10);
|
|
4713
|
-
return $bff5407e03fdc8ee$export$2e2bcd8739ae039.distance(songKey, transposeKey);
|
|
4741
|
+
return (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).distance(songKey, transposeKey);
|
|
4714
4742
|
}
|
|
4715
4743
|
function $dfecd32049fa58e9$var$chordTransposeDistance(capo, transposeKey, songKey) {
|
|
4716
4744
|
let transpose = -1 * (capo || 0);
|
|
4717
|
-
if ($21a34a464e7bc609$export$ee27c052bca048fb(transposeKey) && $21a34a464e7bc609$export$ee27c052bca048fb(songKey)) transpose += $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey);
|
|
4745
|
+
if ((0, $21a34a464e7bc609$export$ee27c052bca048fb)(transposeKey) && (0, $21a34a464e7bc609$export$ee27c052bca048fb)(songKey)) transpose += $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey);
|
|
4718
4746
|
return transpose;
|
|
4719
4747
|
}
|
|
4720
4748
|
function $dfecd32049fa58e9$export$596ec52955da9472(chord, lineKey, transposeKey, song) {
|
|
4721
|
-
let chordObj = $26f57998457eb2d4$export$2e2bcd8739ae039.parse(chord);
|
|
4749
|
+
let chordObj = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(chord);
|
|
4722
4750
|
const { capo: capo , key: songKey } = song;
|
|
4723
4751
|
if (!chordObj) return chord;
|
|
4724
4752
|
chordObj = chordObj.transpose($dfecd32049fa58e9$var$chordTransposeDistance(capo, transposeKey, songKey));
|
|
4725
|
-
if ($21a34a464e7bc609$export$ee27c052bca048fb(transposeKey)) chordObj = chordObj.useModifier(transposeKey.modifier);
|
|
4726
|
-
if ($21a34a464e7bc609$export$ee27c052bca048fb(lineKey)) chordObj = chordObj.normalize(lineKey);
|
|
4753
|
+
if ((0, $21a34a464e7bc609$export$ee27c052bca048fb)(transposeKey)) chordObj = chordObj.useModifier(transposeKey.modifier);
|
|
4754
|
+
if ((0, $21a34a464e7bc609$export$ee27c052bca048fb)(lineKey)) chordObj = chordObj.normalize(lineKey);
|
|
4727
4755
|
return chordObj.toString();
|
|
4728
4756
|
}
|
|
4729
4757
|
function $dfecd32049fa58e9$export$b07b16221c14aaa(key) {
|
|
4730
|
-
return $37d1d6d5b59826cf$exports.capos[$bff5407e03fdc8ee$export$2e2bcd8739ae039.toString(key)];
|
|
4758
|
+
return (0, $37d1d6d5b59826cf$exports.capos)[(0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).toString(key)];
|
|
4731
4759
|
}
|
|
4732
4760
|
function $dfecd32049fa58e9$export$74743eda5dda3ccf(key) {
|
|
4733
|
-
const keyObj = $bff5407e03fdc8ee$export$2e2bcd8739ae039.wrap(key);
|
|
4734
|
-
return keyObj.isMinor() ? $37d1d6d5b59826cf$exports.minorKeys : $37d1d6d5b59826cf$exports.majorKeys;
|
|
4761
|
+
const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(key);
|
|
4762
|
+
return keyObj.isMinor() ? (0, $37d1d6d5b59826cf$exports.minorKeys) : (0, $37d1d6d5b59826cf$exports.majorKeys);
|
|
4735
4763
|
}
|
|
4736
4764
|
|
|
4737
4765
|
|
|
@@ -4741,53 +4769,45 @@ function $dfecd32049fa58e9$export$74743eda5dda3ccf(key) {
|
|
|
4741
4769
|
|
|
4742
4770
|
|
|
4743
4771
|
|
|
4744
|
-
const $376e205ced98486b$var$lineHasContents = (line)=>line.items.some((item)=>item.isRenderable()
|
|
4745
|
-
|
|
4746
|
-
;
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper('isChordLyricsPair', (item)=>item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039
|
|
4751
|
-
);
|
|
4752
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper('isTag', (item)=>item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039
|
|
4753
|
-
);
|
|
4754
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper('isComment', (item)=>item.name === 'comment'
|
|
4755
|
-
);
|
|
4756
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper('shouldRenderLine', (line, options)=>{
|
|
4772
|
+
const $376e205ced98486b$var$lineHasContents = (line)=>line.items.some((item)=>item.isRenderable());
|
|
4773
|
+
const $376e205ced98486b$export$b8d631d9200974fa = (line)=>line.items.some((item)=>item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039) && item.lyrics || item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.isRenderable() || (0, $21a34a464e7bc609$export$e3f63561d52b936d)(item));
|
|
4774
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isChordLyricsPair", (item)=>item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039));
|
|
4775
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isTag", (item)=>item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039));
|
|
4776
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isComment", (item)=>item.name === "comment");
|
|
4777
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("shouldRenderLine", (line, options)=>{
|
|
4757
4778
|
if (options.data.root.renderBlankLines) return true;
|
|
4758
4779
|
return $376e205ced98486b$var$lineHasContents(line);
|
|
4759
4780
|
});
|
|
4760
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4761
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4762
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4763
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4781
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("hasChordContents", (0, $21a34a464e7bc609$export$d332d76d125f0cbe));
|
|
4782
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("hasTextContents", $376e205ced98486b$export$b8d631d9200974fa);
|
|
4783
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("lineHasContents", $376e205ced98486b$var$lineHasContents);
|
|
4784
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("lineClasses", (line)=>{
|
|
4764
4785
|
const classes = [
|
|
4765
|
-
|
|
4786
|
+
"row"
|
|
4766
4787
|
];
|
|
4767
|
-
if (!$376e205ced98486b$var$lineHasContents(line)) classes.push(
|
|
4768
|
-
return classes.join(
|
|
4788
|
+
if (!$376e205ced98486b$var$lineHasContents(line)) classes.push("empty-line");
|
|
4789
|
+
return classes.join(" ");
|
|
4769
4790
|
});
|
|
4770
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4771
|
-
)
|
|
4772
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper('paragraphClasses', (paragraph)=>{
|
|
4791
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("toUpperCase", (line)=>line.toUpperCase());
|
|
4792
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("paragraphClasses", (paragraph)=>{
|
|
4773
4793
|
const classes = [
|
|
4774
|
-
|
|
4794
|
+
"paragraph"
|
|
4775
4795
|
];
|
|
4776
|
-
if (paragraph.type !== $af8d31735c159a26$export$c5a6fe907430212e && paragraph.type !== $af8d31735c159a26$export$c53d0f541b41b88e) classes.push(paragraph.type);
|
|
4777
|
-
return classes.join(
|
|
4796
|
+
if (paragraph.type !== (0, $af8d31735c159a26$export$c5a6fe907430212e) && paragraph.type !== (0, $af8d31735c159a26$export$c53d0f541b41b88e)) classes.push(paragraph.type);
|
|
4797
|
+
return classes.join(" ");
|
|
4778
4798
|
});
|
|
4779
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4780
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4781
|
-
if (!metadata) throw new Error(
|
|
4782
|
-
return item.evaluate(metadata, configuration.get(
|
|
4799
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isEvaluatable", (0, $21a34a464e7bc609$export$e3f63561d52b936d));
|
|
4800
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("evaluate", (item, metadata, configuration)=>{
|
|
4801
|
+
if (!metadata) throw new Error("cannot evaluate, metadata is null");
|
|
4802
|
+
return item.evaluate(metadata, configuration.get("metadata.separator"));
|
|
4783
4803
|
});
|
|
4784
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4804
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("renderChord", (0, $dfecd32049fa58e9$export$596ec52955da9472));
|
|
4785
4805
|
|
|
4786
4806
|
|
|
4787
4807
|
|
|
4788
4808
|
/**
|
|
4789
4809
|
* Formats a song into a plain text chord sheet
|
|
4790
|
-
*/ class $525b2331e4b0ed83$var$TextFormatter extends $0055ecb09272ba2d$export$2e2bcd8739ae039 {
|
|
4810
|
+
*/ class $525b2331e4b0ed83$var$TextFormatter extends (0, $0055ecb09272ba2d$export$2e2bcd8739ae039) {
|
|
4791
4811
|
/**
|
|
4792
4812
|
* Formats a song into a plain text chord sheet
|
|
4793
4813
|
* @param {Song} song The song to be formatted
|
|
@@ -4797,77 +4817,71 @@ const $376e205ced98486b$export$b8d631d9200974fa = (line)=>line.items.some((item)
|
|
|
4797
4817
|
return [
|
|
4798
4818
|
this.formatHeader(),
|
|
4799
4819
|
this.formatParagraphs(),
|
|
4800
|
-
].join(
|
|
4820
|
+
].join("");
|
|
4801
4821
|
}
|
|
4802
4822
|
formatHeader() {
|
|
4803
4823
|
const { title: title , subtitle: subtitle } = this.song;
|
|
4804
|
-
const separator = title || subtitle ?
|
|
4824
|
+
const separator = title || subtitle ? "\n" : "";
|
|
4805
4825
|
return [
|
|
4806
4826
|
this.formatTitle(title),
|
|
4807
4827
|
this.formatSubTitle(subtitle),
|
|
4808
4828
|
separator,
|
|
4809
|
-
].join(
|
|
4829
|
+
].join("");
|
|
4810
4830
|
}
|
|
4811
4831
|
formatParagraphs() {
|
|
4812
4832
|
const { bodyParagraphs: bodyParagraphs , metadata: metadata } = this.song;
|
|
4813
|
-
return bodyParagraphs.map((paragraph)=>this.formatParagraph(paragraph, metadata)
|
|
4814
|
-
).join('\n\n');
|
|
4833
|
+
return bodyParagraphs.map((paragraph)=>this.formatParagraph(paragraph, metadata)).join("\n\n");
|
|
4815
4834
|
}
|
|
4816
4835
|
formatParagraph(paragraph, metadata) {
|
|
4817
|
-
return paragraph.lines.filter((line)=>line.hasRenderableItems()
|
|
4818
|
-
).map((line)=>this.formatLine(line, metadata)
|
|
4819
|
-
).join('\n');
|
|
4836
|
+
return paragraph.lines.filter((line)=>line.hasRenderableItems()).map((line)=>this.formatLine(line, metadata)).join("\n");
|
|
4820
4837
|
}
|
|
4821
4838
|
formatLine(line, metadata) {
|
|
4822
4839
|
const parts = [
|
|
4823
4840
|
this.formatLineTop(line),
|
|
4824
4841
|
this.formatLineBottom(line, metadata),
|
|
4825
4842
|
];
|
|
4826
|
-
return parts.filter((i)=>i !== null
|
|
4827
|
-
).map((part)=>part.trimRight()
|
|
4828
|
-
).join('\n');
|
|
4843
|
+
return parts.filter((i)=>i !== null).map((part)=>part.trimRight()).join("\n");
|
|
4829
4844
|
}
|
|
4830
4845
|
formatTitle(title) {
|
|
4831
4846
|
if (title) return `${title.toUpperCase()}\n`;
|
|
4832
|
-
return
|
|
4847
|
+
return "";
|
|
4833
4848
|
}
|
|
4834
4849
|
formatSubTitle(subtitle) {
|
|
4835
4850
|
if (subtitle) return `${subtitle}\n`;
|
|
4836
|
-
return
|
|
4851
|
+
return "";
|
|
4837
4852
|
}
|
|
4838
4853
|
formatLineTop(line) {
|
|
4839
|
-
if ($21a34a464e7bc609$export$d332d76d125f0cbe(line)) return this.formatLineWithFormatter(line, this.formatItemTop);
|
|
4854
|
+
if ((0, $21a34a464e7bc609$export$d332d76d125f0cbe)(line)) return this.formatLineWithFormatter(line, this.formatItemTop);
|
|
4840
4855
|
return null;
|
|
4841
4856
|
}
|
|
4842
4857
|
chordLyricsPairLength(chordLyricsPair, line) {
|
|
4843
|
-
const chords = $dfecd32049fa58e9$export$596ec52955da9472(chordLyricsPair.chords, line.key, line.transposeKey, this.song);
|
|
4858
|
+
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(chordLyricsPair.chords, line.key, line.transposeKey, this.song);
|
|
4844
4859
|
const { lyrics: lyrics } = chordLyricsPair;
|
|
4845
|
-
const chordsLength = (chords ||
|
|
4846
|
-
const lyricsLength = (lyrics ||
|
|
4860
|
+
const chordsLength = (chords || "").length;
|
|
4861
|
+
const lyricsLength = (lyrics || "").length;
|
|
4847
4862
|
if (chordsLength >= lyricsLength) return chordsLength + 1;
|
|
4848
4863
|
return Math.max(chordsLength, lyricsLength);
|
|
4849
4864
|
}
|
|
4850
4865
|
formatItemTop(item, metadata, line) {
|
|
4851
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 && item.isRenderable()) return $21a34a464e7bc609$export$bc3bea8325045070(
|
|
4852
|
-
if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) {
|
|
4853
|
-
const chords = $dfecd32049fa58e9$export$596ec52955da9472(item.chords, line.key, line.transposeKey, this.song);
|
|
4854
|
-
return $21a34a464e7bc609$export$bc3bea8325045070(chords, this.chordLyricsPairLength(item, line));
|
|
4866
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.isRenderable()) return (0, $21a34a464e7bc609$export$bc3bea8325045070)("", item.value);
|
|
4867
|
+
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) {
|
|
4868
|
+
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line.key, line.transposeKey, this.song);
|
|
4869
|
+
return (0, $21a34a464e7bc609$export$bc3bea8325045070)(chords, this.chordLyricsPairLength(item, line));
|
|
4855
4870
|
}
|
|
4856
|
-
return
|
|
4871
|
+
return "";
|
|
4857
4872
|
}
|
|
4858
4873
|
formatLineBottom(line, metadata) {
|
|
4859
|
-
if ($376e205ced98486b$export$b8d631d9200974fa(line)) return this.formatLineWithFormatter(line, this.formatItemBottom, metadata);
|
|
4874
|
+
if ((0, $376e205ced98486b$export$b8d631d9200974fa)(line)) return this.formatLineWithFormatter(line, this.formatItemBottom, metadata);
|
|
4860
4875
|
return null;
|
|
4861
4876
|
}
|
|
4862
4877
|
formatLineWithFormatter(line, formatter, metadata = null) {
|
|
4863
|
-
return line.items.map((item)=>formatter.call(this, item, metadata, line)
|
|
4864
|
-
).join('');
|
|
4878
|
+
return line.items.map((item)=>formatter.call(this, item, metadata, line)).join("");
|
|
4865
4879
|
}
|
|
4866
4880
|
formatItemBottom(item, metadata, line) {
|
|
4867
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 && item.isRenderable()) return item.value;
|
|
4868
|
-
if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) return $21a34a464e7bc609$export$bc3bea8325045070(item.lyrics, this.chordLyricsPairLength(item, line));
|
|
4869
|
-
if (typeof item.evaluate ===
|
|
4870
|
-
return
|
|
4881
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.isRenderable()) return item.value;
|
|
4882
|
+
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) return (0, $21a34a464e7bc609$export$bc3bea8325045070)(item.lyrics, this.chordLyricsPairLength(item, line));
|
|
4883
|
+
if (typeof item.evaluate === "function") return item.evaluate(metadata, this.configuration.get("metadata.separator"));
|
|
4884
|
+
return "";
|
|
4871
4885
|
}
|
|
4872
4886
|
}
|
|
4873
4887
|
var $525b2331e4b0ed83$export$2e2bcd8739ae039 = $525b2331e4b0ed83$var$TextFormatter;
|
|
@@ -4876,7 +4890,7 @@ var $525b2331e4b0ed83$export$2e2bcd8739ae039 = $525b2331e4b0ed83$var$TextFormatt
|
|
|
4876
4890
|
|
|
4877
4891
|
|
|
4878
4892
|
var $cc306339371360c4$var$template = $988mA$handlebars.template, $cc306339371360c4$var$templates = $988mA$handlebars.templates = $988mA$handlebars.templates || {};
|
|
4879
|
-
$cc306339371360c4$var$templates[
|
|
4893
|
+
$cc306339371360c4$var$templates["html_table_formatter"] = $cc306339371360c4$var$template({
|
|
4880
4894
|
"1": function(container, depth0, helpers, partials, data, blockParams) {
|
|
4881
4895
|
var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
4882
4896
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
@@ -4982,7 +4996,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
4982
4996
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
4983
4997
|
return undefined;
|
|
4984
4998
|
};
|
|
4985
|
-
return
|
|
4999
|
+
return '<div class="chord-sheet">' + ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : container.nullContext || {}, depth0 != null ? lookupProperty(depth0, "bodyParagraphs") : depth0, {
|
|
4986
5000
|
"name": "each",
|
|
4987
5001
|
"hash": {},
|
|
4988
5002
|
"fn": container.program(7, data, 1, blockParams),
|
|
@@ -5006,7 +5020,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5006
5020
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5007
5021
|
return undefined;
|
|
5008
5022
|
};
|
|
5009
|
-
return
|
|
5023
|
+
return '<div class="' + container.escapeExpression(lookupProperty(helpers, "paragraphClasses").call(alias1, blockParams[0][0], {
|
|
5010
5024
|
"name": "paragraphClasses",
|
|
5011
5025
|
"hash": {},
|
|
5012
5026
|
"data": data,
|
|
@@ -5021,7 +5035,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5021
5035
|
"column": 50
|
|
5022
5036
|
}
|
|
5023
5037
|
}
|
|
5024
|
-
})) + "
|
|
5038
|
+
})) + '">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "lines") : depth0, {
|
|
5025
5039
|
"name": "each",
|
|
5026
5040
|
"hash": {},
|
|
5027
5041
|
"fn": container.program(8, data, 1, blockParams),
|
|
@@ -5084,7 +5098,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5084
5098
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5085
5099
|
return undefined;
|
|
5086
5100
|
};
|
|
5087
|
-
return
|
|
5101
|
+
return '<table class="' + container.escapeExpression(lookupProperty(helpers, "lineClasses").call(alias1, blockParams[1][0], {
|
|
5088
5102
|
"name": "lineClasses",
|
|
5089
5103
|
"hash": {},
|
|
5090
5104
|
"data": data,
|
|
@@ -5099,7 +5113,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5099
5113
|
"column": 48
|
|
5100
5114
|
}
|
|
5101
5115
|
}
|
|
5102
|
-
})) + "
|
|
5116
|
+
})) + '">' + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "hasChordContents").call(alias1, blockParams[1][0], {
|
|
5103
5117
|
"name": "hasChordContents",
|
|
5104
5118
|
"hash": {},
|
|
5105
5119
|
"data": data,
|
|
@@ -5233,7 +5247,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5233
5247
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5234
5248
|
return undefined;
|
|
5235
5249
|
};
|
|
5236
|
-
return
|
|
5250
|
+
return '<td class="chord">' + container.escapeExpression((lookupProperty(helpers, "renderChord") || depth0 && lookupProperty(depth0, "renderChord") || container.hooks.helperMissing).call(depth0 != null ? depth0 : container.nullContext || {}, depth0 != null ? lookupProperty(depth0, "chords") : depth0, (stack1 = blockParams[4][0]) != null ? lookupProperty(stack1, "key") : stack1, (stack1 = blockParams[4][0]) != null ? lookupProperty(stack1, "transposeKey") : stack1, (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "song"), {
|
|
5237
5251
|
"name": "renderChord",
|
|
5238
5252
|
"hash": {},
|
|
5239
5253
|
"data": data,
|
|
@@ -5382,7 +5396,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5382
5396
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5383
5397
|
return undefined;
|
|
5384
5398
|
};
|
|
5385
|
-
return
|
|
5399
|
+
return '<td class="lyrics">' + container.escapeExpression((helper = (helper = lookupProperty(helpers, "lyrics") || (depth0 != null ? lookupProperty(depth0, "lyrics") : depth0)) != null ? helper : container.hooks.helperMissing, typeof helper === "function" ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, {
|
|
5386
5400
|
"name": "lyrics",
|
|
5387
5401
|
"hash": {},
|
|
5388
5402
|
"data": data,
|
|
@@ -5442,7 +5456,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5442
5456
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5443
5457
|
return undefined;
|
|
5444
5458
|
};
|
|
5445
|
-
return
|
|
5459
|
+
return '<td class="comment">' + container.escapeExpression((helper = (helper = lookupProperty(helpers, "value") || (depth0 != null ? lookupProperty(depth0, "value") : depth0)) != null ? helper : container.hooks.helperMissing, typeof helper === "function" ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, {
|
|
5446
5460
|
"name": "value",
|
|
5447
5461
|
"hash": {},
|
|
5448
5462
|
"data": data,
|
|
@@ -5463,7 +5477,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5463
5477
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5464
5478
|
return undefined;
|
|
5465
5479
|
};
|
|
5466
|
-
return
|
|
5480
|
+
return '<td class="lyrics">' + container.escapeExpression((lookupProperty(helpers, "evaluate") || depth0 && lookupProperty(depth0, "evaluate") || container.hooks.helperMissing).call(depth0 != null ? depth0 : container.nullContext || {}, blockParams[1][0], (stack1 = (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "song")) && lookupProperty(stack1, "metadata"), (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "configuration"), {
|
|
5467
5481
|
"name": "evaluate",
|
|
5468
5482
|
"hash": {},
|
|
5469
5483
|
"data": data,
|
|
@@ -5517,7 +5531,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5517
5531
|
|
|
5518
5532
|
/**
|
|
5519
5533
|
* Acts as a base class for HTML formatters, taking care of whitelisting prototype property access.
|
|
5520
|
-
*/ class $d834af97c9a2e4df$var$HtmlFormatter extends $0055ecb09272ba2d$export$2e2bcd8739ae039 {
|
|
5534
|
+
*/ class $d834af97c9a2e4df$var$HtmlFormatter extends (0, $0055ecb09272ba2d$export$2e2bcd8739ae039) {
|
|
5521
5535
|
formatWithTemplate(song, template) {
|
|
5522
5536
|
return template({
|
|
5523
5537
|
song: song,
|
|
@@ -5538,35 +5552,35 @@ var $d834af97c9a2e4df$export$2e2bcd8739ae039 = $d834af97c9a2e4df$var$HtmlFormatt
|
|
|
5538
5552
|
|
|
5539
5553
|
|
|
5540
5554
|
|
|
5541
|
-
const { html_table_formatter: $5b02ea769c63fd56$var$template } = ($parcel$interopDefault($988mA$handlebars)).templates;
|
|
5555
|
+
const { html_table_formatter: $5b02ea769c63fd56$var$template } = (0, ($parcel$interopDefault($988mA$handlebars))).templates;
|
|
5542
5556
|
const $5b02ea769c63fd56$export$200cf2de69532aa8 = {
|
|
5543
5557
|
h1: {
|
|
5544
|
-
fontSize:
|
|
5558
|
+
fontSize: "1.5em"
|
|
5545
5559
|
},
|
|
5546
5560
|
h2: {
|
|
5547
|
-
fontSize:
|
|
5561
|
+
fontSize: "1.1em"
|
|
5548
5562
|
},
|
|
5549
5563
|
table: {
|
|
5550
|
-
borderSpacing:
|
|
5551
|
-
color:
|
|
5564
|
+
borderSpacing: "0",
|
|
5565
|
+
color: "inherit"
|
|
5552
5566
|
},
|
|
5553
5567
|
td: {
|
|
5554
|
-
padding:
|
|
5568
|
+
padding: "3px 0"
|
|
5555
5569
|
},
|
|
5556
|
-
|
|
5557
|
-
paddingRight:
|
|
5570
|
+
".chord:not(:last-child)": {
|
|
5571
|
+
paddingRight: "10px"
|
|
5558
5572
|
},
|
|
5559
|
-
|
|
5560
|
-
marginBottom:
|
|
5573
|
+
".paragraph": {
|
|
5574
|
+
marginBottom: "1em"
|
|
5561
5575
|
}
|
|
5562
5576
|
};
|
|
5563
5577
|
function $5b02ea769c63fd56$export$aa5b6043dd05348b(scope) {
|
|
5564
|
-
return $21a34a464e7bc609$export$59d377d2a2e0150a($5b02ea769c63fd56$export$200cf2de69532aa8, scope);
|
|
5578
|
+
return (0, $21a34a464e7bc609$export$59d377d2a2e0150a)($5b02ea769c63fd56$export$200cf2de69532aa8, scope);
|
|
5565
5579
|
}
|
|
5566
5580
|
/**
|
|
5567
5581
|
* Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like
|
|
5568
5582
|
* PDF conversion.
|
|
5569
|
-
*/ class $5b02ea769c63fd56$var$HtmlTableFormatter extends $d834af97c9a2e4df$export$2e2bcd8739ae039 {
|
|
5583
|
+
*/ class $5b02ea769c63fd56$var$HtmlTableFormatter extends (0, $d834af97c9a2e4df$export$2e2bcd8739ae039) {
|
|
5570
5584
|
/**
|
|
5571
5585
|
* Formats a song into HTML.
|
|
5572
5586
|
* @param {Song} song The song to be formatted
|
|
@@ -5586,8 +5600,8 @@ function $5b02ea769c63fd56$export$aa5b6043dd05348b(scope) {
|
|
|
5586
5600
|
*
|
|
5587
5601
|
* @param scope the CSS scope to use, for example `.chordSheetViewer`
|
|
5588
5602
|
* @returns {string} the CSS string
|
|
5589
|
-
*/ static cssString(scope =
|
|
5590
|
-
return $21a34a464e7bc609$export$59d377d2a2e0150a($5b02ea769c63fd56$export$200cf2de69532aa8, scope);
|
|
5603
|
+
*/ static cssString(scope = "") {
|
|
5604
|
+
return (0, $21a34a464e7bc609$export$59d377d2a2e0150a)($5b02ea769c63fd56$export$200cf2de69532aa8, scope);
|
|
5591
5605
|
}
|
|
5592
5606
|
/**
|
|
5593
5607
|
* Basic CSS, in object style à la useStyles, to use with output generated by {@link HtmlTableFormatter}
|
|
@@ -5610,7 +5624,7 @@ var $5b02ea769c63fd56$export$2e2bcd8739ae039 = $5b02ea769c63fd56$var$HtmlTableFo
|
|
|
5610
5624
|
|
|
5611
5625
|
|
|
5612
5626
|
var $9d647eea0a7973fb$var$template = $988mA$handlebars.template, $9d647eea0a7973fb$var$templates = $988mA$handlebars.templates = $988mA$handlebars.templates || {};
|
|
5613
|
-
$9d647eea0a7973fb$var$templates[
|
|
5627
|
+
$9d647eea0a7973fb$var$templates["html_div_formatter"] = $9d647eea0a7973fb$var$template({
|
|
5614
5628
|
"1": function(container, depth0, helpers, partials, data, blockParams) {
|
|
5615
5629
|
var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
5616
5630
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
@@ -5650,7 +5664,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5650
5664
|
"column": 11
|
|
5651
5665
|
}
|
|
5652
5666
|
}
|
|
5653
|
-
})) != null ? stack1 : "") +
|
|
5667
|
+
})) != null ? stack1 : "") + '<div class="chord-sheet">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "bodyParagraphs") : depth0, {
|
|
5654
5668
|
"name": "each",
|
|
5655
5669
|
"hash": {},
|
|
5656
5670
|
"fn": container.program(6, data, 1, blockParams),
|
|
@@ -5716,7 +5730,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5716
5730
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5717
5731
|
return undefined;
|
|
5718
5732
|
};
|
|
5719
|
-
return
|
|
5733
|
+
return '<div class="' + container.escapeExpression(lookupProperty(helpers, "paragraphClasses").call(alias1, blockParams[0][0], {
|
|
5720
5734
|
"name": "paragraphClasses",
|
|
5721
5735
|
"hash": {},
|
|
5722
5736
|
"data": data,
|
|
@@ -5731,7 +5745,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5731
5745
|
"column": 48
|
|
5732
5746
|
}
|
|
5733
5747
|
}
|
|
5734
|
-
})) + "
|
|
5748
|
+
})) + '">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "lines") : depth0, {
|
|
5735
5749
|
"name": "each",
|
|
5736
5750
|
"hash": {},
|
|
5737
5751
|
"fn": container.program(7, data, 1, blockParams),
|
|
@@ -5794,7 +5808,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5794
5808
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5795
5809
|
return undefined;
|
|
5796
5810
|
};
|
|
5797
|
-
return
|
|
5811
|
+
return '<div class="' + container.escapeExpression(lookupProperty(helpers, "lineClasses").call(alias1, blockParams[1][0], {
|
|
5798
5812
|
"name": "lineClasses",
|
|
5799
5813
|
"hash": {},
|
|
5800
5814
|
"data": data,
|
|
@@ -5809,7 +5823,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5809
5823
|
"column": 44
|
|
5810
5824
|
}
|
|
5811
5825
|
}
|
|
5812
|
-
})) + "
|
|
5826
|
+
})) + '">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "items") : depth0, {
|
|
5813
5827
|
"name": "each",
|
|
5814
5828
|
"hash": {},
|
|
5815
5829
|
"fn": container.program(9, data, 1, blockParams),
|
|
@@ -5936,7 +5950,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5936
5950
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5937
5951
|
return undefined;
|
|
5938
5952
|
};
|
|
5939
|
-
return
|
|
5953
|
+
return '<div class="column"><div class="chord">' + alias3((lookupProperty(helpers, "renderChord") || depth0 && lookupProperty(depth0, "renderChord") || alias2).call(alias1, depth0 != null ? lookupProperty(depth0, "chords") : depth0, (stack1 = blockParams[3][0]) != null ? lookupProperty(stack1, "key") : stack1, (stack1 = blockParams[3][0]) != null ? lookupProperty(stack1, "transposeKey") : stack1, (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "song"), {
|
|
5940
5954
|
"name": "renderChord",
|
|
5941
5955
|
"hash": {},
|
|
5942
5956
|
"data": data,
|
|
@@ -5951,7 +5965,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5951
5965
|
"column": 117
|
|
5952
5966
|
}
|
|
5953
5967
|
}
|
|
5954
|
-
})) +
|
|
5968
|
+
})) + '</div><div class="lyrics">' + alias3((helper = (helper = lookupProperty(helpers, "lyrics") || (depth0 != null ? lookupProperty(depth0, "lyrics") : depth0)) != null ? helper : alias2, typeof helper === "function" ? helper.call(alias1, {
|
|
5955
5969
|
"name": "lyrics",
|
|
5956
5970
|
"hash": {},
|
|
5957
5971
|
"data": data,
|
|
@@ -6012,7 +6026,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
6012
6026
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
6013
6027
|
return undefined;
|
|
6014
6028
|
};
|
|
6015
|
-
return
|
|
6029
|
+
return '<div class="comment">' + container.escapeExpression((helper = (helper = lookupProperty(helpers, "value") || (depth0 != null ? lookupProperty(depth0, "value") : depth0)) != null ? helper : container.hooks.helperMissing, typeof helper === "function" ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, {
|
|
6016
6030
|
"name": "value",
|
|
6017
6031
|
"hash": {},
|
|
6018
6032
|
"data": data,
|
|
@@ -6033,7 +6047,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
6033
6047
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
6034
6048
|
return undefined;
|
|
6035
6049
|
};
|
|
6036
|
-
return
|
|
6050
|
+
return '<div class="column"><div class="chord"></div><div class="lyrics">' + container.escapeExpression((lookupProperty(helpers, "evaluate") || depth0 && lookupProperty(depth0, "evaluate") || container.hooks.helperMissing).call(depth0 != null ? depth0 : container.nullContext || {}, blockParams[1][0], (stack1 = (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "song")) && lookupProperty(stack1, "metadata"), (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "configuration"), {
|
|
6037
6051
|
"name": "evaluate",
|
|
6038
6052
|
"hash": {},
|
|
6039
6053
|
"data": data,
|
|
@@ -6086,27 +6100,27 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
6086
6100
|
|
|
6087
6101
|
|
|
6088
6102
|
|
|
6089
|
-
const { html_div_formatter: $ee0c149cc33dc156$var$template } = ($parcel$interopDefault($988mA$handlebars)).templates;
|
|
6103
|
+
const { html_div_formatter: $ee0c149cc33dc156$var$template } = (0, ($parcel$interopDefault($988mA$handlebars))).templates;
|
|
6090
6104
|
const $ee0c149cc33dc156$var$defaultCss = {
|
|
6091
|
-
|
|
6092
|
-
paddingRight:
|
|
6105
|
+
".chord:not(:last-child)": {
|
|
6106
|
+
paddingRight: "10px"
|
|
6093
6107
|
},
|
|
6094
|
-
|
|
6095
|
-
marginBottom:
|
|
6108
|
+
".paragraph": {
|
|
6109
|
+
marginBottom: "1em"
|
|
6096
6110
|
},
|
|
6097
|
-
|
|
6098
|
-
display:
|
|
6111
|
+
".row": {
|
|
6112
|
+
display: "flex"
|
|
6099
6113
|
},
|
|
6100
|
-
|
|
6101
|
-
content: '
|
|
6114
|
+
".chord:after": {
|
|
6115
|
+
content: "'\\200b'"
|
|
6102
6116
|
},
|
|
6103
|
-
|
|
6104
|
-
content: '
|
|
6117
|
+
".lyrics:after": {
|
|
6118
|
+
content: "'\\200b'"
|
|
6105
6119
|
}
|
|
6106
6120
|
};
|
|
6107
6121
|
/**
|
|
6108
6122
|
* Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes it useful for responsive web pages.
|
|
6109
|
-
*/ class $ee0c149cc33dc156$var$HtmlDivFormatter extends $d834af97c9a2e4df$export$2e2bcd8739ae039 {
|
|
6123
|
+
*/ class $ee0c149cc33dc156$var$HtmlDivFormatter extends (0, $d834af97c9a2e4df$export$2e2bcd8739ae039) {
|
|
6110
6124
|
/**
|
|
6111
6125
|
* Formats a song into HTML.
|
|
6112
6126
|
* @param {Song} song The song to be formatted
|
|
@@ -6126,8 +6140,8 @@ const $ee0c149cc33dc156$var$defaultCss = {
|
|
|
6126
6140
|
*
|
|
6127
6141
|
* @param scope the CSS scope to use, for example `.chordSheetViewer`
|
|
6128
6142
|
* @returns {string} the CSS string
|
|
6129
|
-
*/ static cssString(scope =
|
|
6130
|
-
return $21a34a464e7bc609$export$59d377d2a2e0150a($ee0c149cc33dc156$var$defaultCss, scope);
|
|
6143
|
+
*/ static cssString(scope = "") {
|
|
6144
|
+
return (0, $21a34a464e7bc609$export$59d377d2a2e0150a)($ee0c149cc33dc156$var$defaultCss, scope);
|
|
6131
6145
|
}
|
|
6132
6146
|
/**
|
|
6133
6147
|
* Basic CSS, in object style à la useStyles, to use with output generated by {@link HtmlDivFormatter}
|
|
@@ -6152,59 +6166,56 @@ var $ee0c149cc33dc156$export$2e2bcd8739ae039 = $ee0c149cc33dc156$var$HtmlDivForm
|
|
|
6152
6166
|
|
|
6153
6167
|
|
|
6154
6168
|
|
|
6155
|
-
const $b601b9602157ea5f$var$NEW_LINE =
|
|
6169
|
+
const $b601b9602157ea5f$var$NEW_LINE = "\n";
|
|
6156
6170
|
/**
|
|
6157
6171
|
* Formats a song into a ChordPro chord sheet
|
|
6158
|
-
*/ class $b601b9602157ea5f$var$ChordProFormatter extends $0055ecb09272ba2d$export$2e2bcd8739ae039 {
|
|
6172
|
+
*/ class $b601b9602157ea5f$var$ChordProFormatter extends (0, $0055ecb09272ba2d$export$2e2bcd8739ae039) {
|
|
6159
6173
|
/**
|
|
6160
6174
|
* Formats a song into a ChordPro chord sheet.
|
|
6161
6175
|
* @param {Song} song The song to be formatted
|
|
6162
6176
|
* @returns {string} The ChordPro string
|
|
6163
6177
|
*/ format(song) {
|
|
6164
6178
|
const { lines: lines , metadata: metadata } = song;
|
|
6165
|
-
return lines.map((line)=>this.formatLine(line, metadata)
|
|
6166
|
-
).join($b601b9602157ea5f$var$NEW_LINE);
|
|
6179
|
+
return lines.map((line)=>this.formatLine(line, metadata)).join($b601b9602157ea5f$var$NEW_LINE);
|
|
6167
6180
|
}
|
|
6168
6181
|
formatLine(line, metadata) {
|
|
6169
|
-
return line.items.map((item)=>this.formatItem(item, metadata)
|
|
6170
|
-
).join('');
|
|
6182
|
+
return line.items.map((item)=>this.formatItem(item, metadata)).join("");
|
|
6171
6183
|
}
|
|
6172
6184
|
formatItem(item, metadata) {
|
|
6173
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039) return this.formatTag(item);
|
|
6174
|
-
if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) return this.formatChordLyricsPair(item);
|
|
6175
|
-
if (typeof item.evaluate ===
|
|
6185
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)) return this.formatTag(item);
|
|
6186
|
+
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) return this.formatChordLyricsPair(item);
|
|
6187
|
+
if (typeof item.evaluate === "function") return this.formatOrEvaluateItem(item, metadata);
|
|
6176
6188
|
throw new Error(`Don't know how to format a ${item.constructor.name}`);
|
|
6177
6189
|
}
|
|
6178
6190
|
formatOrEvaluateItem(item, metadata) {
|
|
6179
|
-
if (this.configuration.evaluate) return item.evaluate(metadata, this.configuration.get(
|
|
6180
|
-
if (item instanceof $b6d84b168638423d$export$2e2bcd8739ae039) return this.formatTernary(item);
|
|
6181
|
-
if (item instanceof $e1378a714a1834c5$export$2e2bcd8739ae039) return item.evaluate();
|
|
6191
|
+
if (this.configuration.evaluate) return item.evaluate(metadata, this.configuration.get("metadata.separator"));
|
|
6192
|
+
if (item instanceof (0, $b6d84b168638423d$export$2e2bcd8739ae039)) return this.formatTernary(item);
|
|
6193
|
+
if (item instanceof (0, $e1378a714a1834c5$export$2e2bcd8739ae039)) return item.evaluate();
|
|
6182
6194
|
throw new Error(`Don't know how to format a ${item.constructor.name}`);
|
|
6183
6195
|
}
|
|
6184
6196
|
formatTernary(ternary) {
|
|
6185
6197
|
const { variable: variable , valueTest: valueTest , trueExpression: trueExpression , falseExpression: falseExpression , } = ternary;
|
|
6186
6198
|
return [
|
|
6187
|
-
|
|
6188
|
-
variable ||
|
|
6199
|
+
"%{",
|
|
6200
|
+
variable || "",
|
|
6189
6201
|
this.formatValueTest(valueTest),
|
|
6190
6202
|
this.formatExpressionRange(trueExpression),
|
|
6191
6203
|
this.formatExpressionRange(falseExpression),
|
|
6192
|
-
|
|
6193
|
-
].join(
|
|
6204
|
+
"}",
|
|
6205
|
+
].join("");
|
|
6194
6206
|
}
|
|
6195
6207
|
formatValueTest(valueTest) {
|
|
6196
|
-
if (!valueTest) return
|
|
6208
|
+
if (!valueTest) return "";
|
|
6197
6209
|
return `=${valueTest}`;
|
|
6198
6210
|
}
|
|
6199
6211
|
formatExpressionRange(expressionRange) {
|
|
6200
|
-
if (!expressionRange) return
|
|
6201
|
-
return `|${expressionRange.map((expression)=>this.formatExpression(expression)
|
|
6202
|
-
).join('')}`;
|
|
6212
|
+
if (!expressionRange) return "";
|
|
6213
|
+
return `|${expressionRange.map((expression)=>this.formatExpression(expression)).join("")}`;
|
|
6203
6214
|
}
|
|
6204
6215
|
formatExpression(expression) {
|
|
6205
|
-
if (expression instanceof $b6d84b168638423d$export$2e2bcd8739ae039) return this.formatTernary(expression);
|
|
6206
|
-
if (expression instanceof $e1378a714a1834c5$export$2e2bcd8739ae039) return expression.string;
|
|
6207
|
-
return
|
|
6216
|
+
if (expression instanceof (0, $b6d84b168638423d$export$2e2bcd8739ae039)) return this.formatTernary(expression);
|
|
6217
|
+
if (expression instanceof (0, $e1378a714a1834c5$export$2e2bcd8739ae039)) return expression.string;
|
|
6218
|
+
return "";
|
|
6208
6219
|
}
|
|
6209
6220
|
formatTag(tag) {
|
|
6210
6221
|
if (tag.hasValue()) return `{${tag.originalName}: ${tag.value}}`;
|
|
@@ -6214,14 +6225,14 @@ const $b601b9602157ea5f$var$NEW_LINE = '\n';
|
|
|
6214
6225
|
return [
|
|
6215
6226
|
this.formatChordLyricsPairChords(chordLyricsPair),
|
|
6216
6227
|
this.formatChordLyricsPairLyrics(chordLyricsPair),
|
|
6217
|
-
].join(
|
|
6228
|
+
].join("");
|
|
6218
6229
|
}
|
|
6219
6230
|
formatChordLyricsPairChords(chordLyricsPair) {
|
|
6220
6231
|
if (chordLyricsPair.chords) return `[${chordLyricsPair.chords}]`;
|
|
6221
|
-
return
|
|
6232
|
+
return "";
|
|
6222
6233
|
}
|
|
6223
6234
|
formatChordLyricsPairLyrics(chordLyricsPair) {
|
|
6224
|
-
return chordLyricsPair.lyrics ||
|
|
6235
|
+
return chordLyricsPair.lyrics || "";
|
|
6225
6236
|
}
|
|
6226
6237
|
}
|
|
6227
6238
|
var $b601b9602157ea5f$export$2e2bcd8739ae039 = $b601b9602157ea5f$var$ChordProFormatter;
|