1 (function(){function y(a
){return a
.split(";").map(function(a
){var a
=a
.split(":"),c
=a
.shift(),a
=a
.length
?a
.shift().split(","):[],f
=z(c
);a
.forEach(function(d
){"tilde-above"===d
?f
.addTildeAbove():"tilde-below"===d
?f
.addBarBelow():"y"===d
?f
.addBelow("y"):"s"===d
||"s-inverse"===d
||"s-extended"===d
||"s-flourish"===d
?"s"===d
&&("calma"===c
||"quesse"===c
)?f
.addBelow(d
):f
.addFollowing(d
):f
.addAbove(d
)});return f
})}function A(a
,e
){var c
;c
=g
.tehtaPositions
;if(!g
.tehtar
[e
])throw Error("No tehta for: "+JSON
.stringify(e
));
2 c
=g
.tehtar
[e
].special
&&!g
.tehtar
[e
][a
]?null:0<=g
.barsAndTildes
.indexOf(e
)?0<=["lambe","alda"].indexOf(a
)&&2<=g
.tehtar
[e
].length
?2:c
[a
].wide
?0:1:void 0!==c
[a
]?void 0!==c
[a
][e
]?c
[a
][e
]:void 0!==c
[a
].others
?c
[a
].others
:c
[a
]:0;return null===c
?null:g
.tehtar
[e
][a
]||g
.tehtar
[e
][c
]||""}function z(a
,e
,c
){return new i(a
,e
,c
)}function t(a
){a
=a
||L
;return{font
:a
.font
||M
,doubleNasalsWithTildeBelow
:a
.doubleNasalsWithTildeBelow
,noAchLaut
:a
.noAchLaut
}}function u(a
,e
){var e
=t(e
),c
=e
.font
,f
=c
.makeColumn
;return a
.split(/\n\n\n+/).map(function(d
){return d
.split(/\n\n/).map(function(b
){return b
.split(/\n/).map(function(b
){var d
=
3 [],h
=[];b
.toLowerCase().replace(/([\w\u00e1\u00e9\u00ed\u00f3\u00fa\u00eb\u00e2\u00ea\u00ee\u00f4\u00fb\u00f1']+)|(.)/g,function(b
,a
,q
){if(a
){a
=O(a
);try{B
[a
]?h
.push
.apply(h
,c
.decodeWord(B
[a
])):h
.push
.apply(h
,P(a
,e
))}catch(p
){h
.push(f().addError("Cannot transcribe "+JSON
.stringify(h
)+" because "+p
.message
))}}else C
[q
]?h
.push(f(C
[q
])):" "===q
?(d
.push(h
),h
=[]):h
.push(f().addError("Cannot transcribe "+JSON
.stringify(q
)))});h
.length
&&d
.push(h
);return d
})})})}function D(a
,e
,c
){var f
=function(b
){return b
.length
?
4 D(a
,e
,c
.concat(b
),b
[b
.length
-1]):a(c
)},d
=function(d
){return r
[d
]?b("long-carrier").addAbove(r
[d
]):b("short-carrier").addAbove(d
)},b
=e
.font
.makeColumn
,p
=function(b
){var a
=function(a
){return a
?b
?-1!==v
.indexOf(b
)&&a
.canAddAbove()?(a
.addAbove(b
),k(function(a
){return f([a
])},a
)):k(function(a
){return f([d(b
),a
])},a
):k(function(a
){return f([a
])},a
):b
?k(function(a
){return f([a
])},d(b
)):f([])},c
=e
.font
.makeColumn
;return function(d
){return"n"===d
?function(b
){return"n"===b
?e
.doubleNasalsWithTildeBelow
?a(c("numen").addTildeBelow()):
5 a(c("numen").addTildeAbove()):"t"===b
?function(b
){return"h"===b
?a(c("thule").addTildeAbove()):a(c("tinco").addTildeAbove())(b
)}:"d"===b
?a(c("ando").addTildeAbove()):"c"===b
?a(c("quesse").addTildeAbove()):"g"===b
?a(c("ungwe").addTildeAbove()):"j"===b
?a(c("anca").addTildeAbove()):"w"===b
?a(c("nwalme").addAbove("w")):a(c("numen"))(b
)}:"m"===d
?function(b
){return"m"===b
?e
.doubleNasalsWithTildeBelow
?a(c("malta").addTildeBelow()):a(c("malta").addTildeAbove()):"p"===b
?a(c("parma").addTildeAbove()):"b"===
6 b
?a(c("umbar").addTildeAbove()):"f"===b
?a(c("formen").addTildeAbove()):"v"===b
?a(c("ampa").addTildeAbove()):a(c("malta"))(b
)}:"\u00f1"===d
?function(b
){return"c"===b
?a(c("quesse").addTildeAbove()):"g"===b
?a(c("ungwe").addTildeAbove()):a(c("nwalme"))(b
)}:"t"===d
?function(b
){return"t"===b
?a(c("tinco").addTildeBelow()):"h"===b
?a(c("thule")):a(c("tinco"))(b
)}:"p"===d
?function(b
){return"p"===b
?a(c("parma").addTildeBelow()):a(c("parma"))(b
)}:"c"===d
?function(b
){return"c"===b
?a(c("calma")):"h"===b
?e
.noAchLaut
?
7 a(c("calma")):a(c("hwesta")):a(c("quesse"))(b
)}:"d"===d
?function(b
){return"d"===b
?a(c("ando").addTildeBelow()):"h"===b
?a(c("anto")):a(c("ando"))(b
)}:"b"===d
?function(b
){return"b"===b
?a(c("umbar").addTildeBelow()):a(c("umbar"))(b
)}:"g"===d
?function(b
){return"g"===b
?a(c("ungwe").addTildeBelow()):"h"===b
?a(c("unque")):a(c("ungwe"))(b
)}:"f"===d
?function(b
){return"f"===b
?a(c("formen").addTildeBelow()):a(c("formen"))(b
)}:"v"===d
?a(c("ampa")):"j"===d
?a(c("anca")):"s"===d
?function(b
){return"s"===b
?a(c("silme").addTildeBelow()):
8 "h"===b
?a(c("harma")):a(c("silme"))(b
)}:"z"===d
?function(b
){return"z"===b
?a(c("esse").addTildeBelow()):a(c("esse"))(b
)}:"h"===d
?function(b
){return"w"===b
?a(c("hwesta-sindarinwa")):a(c("hyarmen"))(b
)}:"r"===d
?function(b
){return"r"===b
?a(c("romen").addTildeBelow()):"h"===b
?a(c("arda")):""===b
?a(c("ore"))(b
):a(c("romen"))(b
)}:"l"===d
?function(b
){return"l"===b
?a(c("lambe").addTildeBelow()):"h"===b
?a(c("alda")):a(c("lambe"))(b
)}:"i"===d
?a(c("anna")):"u"===d
?a(c("vala")):"w"===d
?function(b
){return"h"===
9 b
?a(c("hwesta-sindarinwa")):a(c("vala"))(b
)}:"e"===d
&&(!b
||"a"===b
)?a(c("yanta")):"y"===d
?a(c("wilya").addBelow("y")):"\u00e1"===d
?a(c("wilya").addAbove("a")):r
[d
]&&-1==v
.indexOf(d
)?a(c("long-carrier").addAbove(r
[d
])):a()(d
)}};return function(b
){return-1!==v
.indexOf(b
)?p(b
):p()(b
)}}function k(a
,e
){var c
=function(c
){var d
=function(b
){return"quesse"===b
.tengwa
&&b
.canAddBelow()?function(c
){return"s"===c
?a(b
.addBelow("s")):a(b
)(c
)}:-1!==Q
.indexOf(b
.tengwa
)?function(c
){return"s"===c
?E(function(c
){return function(d
){return""===
10 d
?(0===c
?b
.addFollowing("s"):1===c
?b
.addFollowing("s-inverse"):2===c
?b
.addFollowing("s-extended"):3===c
?b
.addFollowing("s-flourish"):b
.addFollowing("s-flourish").addError("Following S only has 3 alternate flourishes."),a(b
)(d
)):a(b
)("s")(d
)}}):a(b
)(c
)}:a(b
)};return function(b
){return"y"===b
&&c
.canAddBelow()?d(c
.addBelow("y")):d(c
)(b
)}};return e
.canAddAbove()?function(a
){return"w"===a
?c(e
.addAbove("w")):c(e
)(a
)}:c(e
)}function E(a
,e
){e
=e
||0;return function(c
){return"'"===c
?E(a
,e
+1):a(e
)(c
)}}function w(a
){a
=
11 a
||R
;return{font
:a
.font
||S
,vilya
:a
.vilya
,harma
:a
.harma
,classical
:a
.classical
,iuRising
:a
.isRising
,longHalla
:a
.longHalla
}}function x(a
,e
){var e
=w(e
),c
=e
.font
.makeColumn
;return a
.split(/\n\n\n+/).map(function(a
){return a
.split(/\n\n/).map(function(a
){return a
.split(/\n/).map(function(b
){var a
=[],d
=[];b
.toLowerCase().replace(/([\w\u00e1\u00e9\u00ed\u00f3\u00fa\u00eb\u00e2\u00ea\u00ee\u00f4\u00fb\u00f1']+)|(.)/g,function(b
,f
,g
){if(f
)try{d
.push
.apply(d
,T(U(f
),e
))}catch(i
){d
.push(c().addError("Cannot transcribe "+
12 JSON
.stringify(f
)+" because "+i
.message
))}else F
[g
]?d
.push(c(F
[g
])):" "===g
?(a
.push(d
),d
=[]):d
.push(c().addError("Cannot transcribe "+JSON
.stringify(g
)))});d
.length
&&a
.push(d
);return a
})})})}function G(a
,e
,c
,f
){var d
=function(b
){var d
=b
.pop();return H(function(d
){d
=b
.concat(d
).filter(Boolean
);return d
.length
?G(a
,e
,c
.concat(d
),d
[d
.length
-1]):a(c
)},e
,d
)},b
=e
.font
.makeColumn
;return function(a
){return"n"===a
?function(a
){return"n"===a
?d([b("numen").addTildeBelow()]):"t"===a
?d([b("tinco")]):"d"===a
?d([b("ando")]):
13 "g"===a
?function(a
){return"w"===a
?d([b("ungwe")]):d([b("anga")])(a
)}:"c"===a
?function(a
){return"w"===a
?d([b("unque")]):d([b("anca")])(a
)}:d([b("numen")])(a
)}:"m"===a
?function(a
){return"m"===a
?d([b("malta").addTildeBelow()]):"p"===a
?d([b("ampa")]):"b"===a
?d([b("umbar")]):d([b("malta")])(a
)}:"\u00f1"===a
?function(a
){return"g"===a
?function(a
){return"w"===a
?d([b("ungwe")]):d([b("anga")])(a
)}:"c"===a
?function(a
){return"w"===a
?d([b("unque")]):d([b("anca")])}:d([b("noldo")])(a
)}:"t"===a
?function(a
){return"t"===
14 a
?function(a
){return"y"===a
?d([b("tinco").addBelow("y").addTildeBelow()]):d([b("tinco").addTildeBelow()])(a
)}:"y"===a
?d([b("tinco").addBelow("y")]):"h"===a
?d([b("thule")]):"s"===a
?function(a
){return""===a
?d([b("tinco").addFollowing("s")])(a
):d([b("tinco"),b("silme")])(a
)}:d([b("tinco")])(a
)}:"p"===a
?function(a
){return"p"===a
?function(a
){return"y"===a
?d([b("parma").addBelow("y").addTildeBelow()]):d([b("parma").addTildeBelow()])(a
)}:"y"===a
?d([b("parma").addBelow("y")]):"s"===a
?function(a
){return""===
15 a
?d([b("parma").addFollowing("s")])(a
):d([b("parma"),b("silme")])(a
)}:d([b("parma")])(a
)}:"c"===a
?function(a
){return"c"===a
?d([b("calma").addTildeBelow()]):"s"===a
?d([b("calma").addBelow("s")]):"h"===a
?d([b("harma")]):"w"===a
?d([b("quesse")]):d([b("calma")])(a
)}:"f"===a
?d([b("formen")]):"v"===a
?e
.vilya
?d([b("wilya")]):d([b("vala")]):"w"===a
?e
.wilya
?d([b("short-carrier").addAbove("u").addError("Before the introduction of vala, wilya was called vilya and represented the v sound. There is no tengwa to represent consonantal w.")]):
16 d([b("wilya")]):"r"===a
?function(a
){return"d"===a
?d([b("arda")]):"h"===a
?d([b("halla").addError("R should preceed H in the HR diagraph in Classical mode."),b("romen").addError("R should preceed H in the HR diagraph in Classical mode.")]):e
.classical
?f
&&f
.above
&&""!==a
&&-1!==I
.indexOf(a
)?d([b("ore")])(a
):d([b("romen")])(a
):""===a
||-1===I
.indexOf(a
)?d([b("ore")])(a
):d([b("romen")])(a
)}:"l"===a
?function(a
){return"l"===a
?function(a
){return"y"===a
?d([b("lambe").addBelow("y").addTildeBelow()]):d([b("lambe").addTildeBelow()])(a
)}:
17 "y"===a
?d([b("lambe").addBelow("y")]):"h"===a
?d([b("halla").addError("L should preceed H in the HL diagraph in Classical mode."),b("lambe").addError("L should preceed H in the HL diagraph in Classical mode.")]):"d"===a
?d([b("alda")]):"b"===a
?d([b("lambe"),b("umbar")]):d([b("lambe")])(a
)}:"s"===a
?function(a
){return"s"===a
?d([b("esse")]):d([b("silme")])(a
)}:"h"===a
?function(a
){return"l"===a
?d([b("halla"),b("lambe")]):"r"===a
?d([b("halla"),b("romen")]):"w"===a
?d([b("hwesta")]):"t"===a
?d([b("harma")]):
18 "y"===a
?e
.classical
&&e
.harma
?d([b("hyarmen")]):d([b("hyarmen").addBelow("y")]):f
?e
.classical
&&e
.harma
?d([b("harma")])(a
):e
.classical
?d([b("hyarmen")])(a
):d([b("harma")])(a
):e
.classical
&&e
.harma
?d([b("harma")])(a
):d([b("halla")])(a
)}:"d"===a
?d([b("ando").addError("D cannot appear except after N, L, or R")]):"b"===a
?d([b("umbar").addError("B cannot appear except after M or L")]):"g"===a
?d([b("anga").addError("G cannot appear except after N or \u00d1")]):"j"===a
?d([b().addError("J cannot be transcribed in Classical Mode")]):
19 d([])(a
)}}function H(a
,e
,c
){var f
=e
.font
.makeColumn
;return function(d
){if("a"===d
)return function(b
){return"i"===b
?a([c
,f("yanta","a")]):"u"===b
?a([c
,f("ure","a")]):c
&&c
.canAddAbove()?(c
.addAbove("a"),a([c
])(b
)):a([c
,f("short-carrier","a")])(b
)};if("e"===d
)return function(b
){return"u"===b
?a([c
,f("ure","e")]):c
&&c
.canAddAbove()?(c
.addAbove("e"),a([c
])(b
)):a([c
,f("short-carrier","e")])(b
)};if("i"===d
)return function(b
){return"u"===b
?e
.iuRising
?a([c
,f("anna","u").addBelow("y")]):a([c
,f("ure","i")]):
20 c
&&c
.canAddAbove()?(c
.addAbove("i"),a([c
])(b
)):a([c
,f("short-carrier","i")])(b
)};if("o"===d
)return function(b
){return"i"===b
?a([c
,f("yanta","o")]):c
&&c
.canAddAbove()?(c
.addAbove("o"),a([c
])(b
)):a([c
,f("short-carrier","o")])(b
)};if("u"===d
)return function(b
){return"i"===b
?a([c
,f("yanta","u")]):c
&&c
.canAddAbove()?(c
.addAbove("u"),a([c
])(b
)):a([c
,f("short-carrier","u")])(b
)};if("y"===d
){if(c
&&c
.canAddBelow())return a([c
.addBelow("y")]);d
=f("anna").addBelow("y");return H(function(b
){return a([c
].concat(b
))},
21 e
,d
)}return"\u00e1"===d
?a([c
,f("long-carrier","a")]):"\u00e9"===d
?a([c
,f("long-carrier","e")]):"\u00ed"===d
?a([c
,f("long-carrier","i")]):"\u00f3"===d
?c
&&c
.canAddAbove()?(c
.addAbove("\u00f3"),a([c
])):a([c
,f("long-carrier","o")]):"\u00fa"===d
?c
&&c
.canAddAbove()?(c
.addAbove("\u00fa"),a([c
])):a([c
,f("long-carrier","u")]):a([c
])(d
)}}var j
={},g
={names
:[["tinco","parma","calma","quesse"],["ando","umbar","anga","ungwe"],["thule","formen","harma","hwesta"],["anto","ampa","anca","unque"],["numen","malta","noldo",
22 "nwalme"],["ore","vala","anna","wilya"],["romen","arda","lambe","alda"],["silme","silme-nuquerna","esse","esse-nuquerna"],["hyarmen","hwesta-sindarinwa","yanta","ure"],["halla","short-carrier","long-carrier","round-carrier"],["tinco-extended","parma-extended","calma-extended","quesse-extended"]],aliases
:{vilya
:"wilya",aha
:"harma"},tengwar
:{tinco
:"1",parma
:"q",calma
:"a",quesse
:"z",ando
:"2",umbar
:"w",anga
:"s",ungwe
:"x",thule
:"3",formen
:"e",harma
:"d",hwesta
:"c",anto
:"4",ampa
:"r",anca
:"f",unque
:"v",numen
:"5",
23 malta
:"t",noldo
:"g",nwalme
:"b",ore
:"6",vala
:"y",anna
:"h",wilya
:"n",romen
:"7",arda
:"u",lambe
:"j",alda
:"m",silme
:"8","silme-nuquerna":"i",esse
:"k","esse-nuquerna":",",hyarmen
:"9","hwesta-sindarinwa":"o",yanta
:"l",ure
:".",halla
:"\u00bd","short-carrier":"`","long-carrier":"~","round-carrier":"]","tinco-extended":"!","parma-extended":"Q","calma-extended":"A","quesse-extended":"Z",comma
:"=","full-stop":"-","exclamation-point":"\u00c1","question-mark":"\u00c0","open-paren":"Œ","close-paren":"œ",
24 "flourish-left":"Ğ","flourish-right":"ğ"},tehtar
:{a
:"#EDC",e
:"$RFV",i
:"%TGB",o
:"^YHN",u
:"& U J M Ā ā Ă ă".split(" "),"\u00f3":["Ą","ą","Ć","ć"],"\u00fa":["Ĉ","ĉ","Ċ","ċ"],"\u00ed":["Ô","Õ","Ö","×"],w
:"\u00e8\u00e9\u00ea\u00eb",y
:"\u00cc\u00cd\u00ce\u00cf\u00b4",s
:{special
:!0,tinco
:"+",ando
:"+",numen
:"+",lambe
:"_",calma
:"|",quesse
:"|","short-carrier":"}"},"s-inverse":{special
:!0,tinco
:"\u00a1"},"s-extended":{special
:!0,
25 tinco
:"Ç"},"s-flourish":{special
:!0,tinco
:"£",lambe
:"¥"},"tilde-above":"Pp","tilde-below":[":",";","°"],"tilde-high-above":")0","tilde-far-below":"?/","bar-above":"{[","bar-below":['"',"'","¸"],"bar-high-above":"\u00ec\u00ee","bar-far-below":"\u00ed\u00ef"},barsAndTildes
:"tilde-above tilde-below tilde-high-above tilde-far-below bar-above bar-below bar-high-above bar-high-below".split(" "),tehtaPositions
:{tinco
:{o
:3,w
:3,others
:2},parma
:{o
:3,w
:3,others
:2},calma
:{o
:3,w
:3,u
:3,
26 others
:2},quesse
:{o
:3,w
:3,others
:2},ando
:{wide
:!0,e
:1,o
:2,"\u00f3":1,"\u00fa":1,others
:0},umbar
:{wide
:!0,e
:1,o
:2,"\u00f3":1,"\u00fa":1,others
:0},anga
:{wide
:!0,e
:1,"\u00f3":1,"\u00fa":1,others
:0},ungwe
:{wide
:!0,e
:1,o
:1,"\u00f3":1,"\u00fa":1,others
:0},thule
:{others
:3},formen
:3,harma
:{e
:0,o
:3,u
:7,"\u00f3":2,"\u00fa":2,w
:0,others
:1},hwesta
:{e
:0,o
:3,u
:7,w
:0,others
:1},anto
:{wide
:!0,"\u00f3":1,"\u00fa":1,others
:0},ampa
:{wide
:!0,"\u00f3":1,"\u00fa":1,others
:0},anca
:{wide
:!0,u
:7,"\u00f3":1,"\u00fa":1,others
:0},
27 unque
:{wide
:!0,u
:7,others
:0},numen
:{wide
:!0,"\u00f3":1,"\u00fa":1,others
:0},malta
:{wide
:!0,"\u00f3":1,"\u00fa":1,others
:0},noldo
:{wide
:!0,"\u00f3":1,"\u00fa":1,others
:0},nwalme
:{wide
:!0,"\u00f3":1,"\u00fa":1,others
:0},ore
:{e
:3,o
:3,u
:3,"\u00f3":3,"\u00fa":3,others
:1},vala
:{e
:3,o
:3,u
:3,"\u00f3":3,"\u00fa":3,others
:1},anna
:{e
:3,o
:3,u
:3,"\u00f3":2,"\u00fa":2,others
:1},wilya
:{e
:3,o
:3,u
:3,"\u00f3":3,"\u00fa":3,others
:1},romen
:{e
:3,o
:3,u
:3,"\u00f3":2,"\u00fa":2,y
:null,others
:1},arda
:{a
:1,e
:3,i
:1,o
:3,u
:3,
28 "\u00ed":1,"\u00f3":2,"\u00fa":2,y
:null,others
:0},lambe
:{wide
:!0,e
:1,y
:4,"\u00f3":1,"\u00fa":1,others
:0},alda
:{wide
:!0,others
:1},silme
:{y
:3,others
:null},"silme-nuquerna":{e
:3,o
:3,u
:3,"\u00f3":3,"\u00fa":3,y
:null,others
:1},esse
:{y
:null,others
:null},"esse-nuquerna":{e
:3,o
:3,u
:3,"\u00f3":3,"\u00fa":3,others
:1},hyarmen
:3,"hwesta-sindarinwa":{o
:2,u
:2,"\u00f3":1,"\u00fa":2,others
:0},yanta
:{e
:3,o
:3,u
:3,"\u00f3":2,"\u00fa":2,others
:1},ure
:{e
:3,o
:3,u
:3,"\u00f3":3,"\u00fa":3,others
:1},halla
:{others
:null},"short-carrier":3,
29 "long-carrier":{y
:null,others
:3},"round-carrier":3,"tinco-extended":3,"parma-extended":3,"calma-extended":{o
:3,u
:7,"\u00f3":2,"\u00fa":2,others
:1},"quesse-extended":{o
:0,u
:7,others
:1}},punctuation
:{"-":"comma",",":"comma",":":"comma",";":"full-stop",".":"full-stop","!":"exclamation-point","?":"question-mark","(":"open-paren",")":"close-paren",">":"flourish-left","<":"flourish-right"},annotations
:{tinco
:{tengwa
:"t"},parma
:{tengwa
:"p"},calma
:{tengwa
:"c"},quesse
:{tengwa
:"c"},ando
:{tengwa
:"d"},umbar
:{tengwa
:"b"},
30 anga
:{tengwa
:"ch"},ungwe
:{tengwa
:"g"},thule
:{tengwa
:"th"},formen
:{tengwa
:"f"},hyarmen
:{tengwa
:"h"},hwesta
:{tengwa
:"kh"},unque
:{tengwa
:"gh"},anto
:{tengwa
:"dh"},anca
:{tengwa
:"j"},ampa
:{tengwa
:"v"},numen
:{tengwa
:"n"},malta
:{tengwa
:"m"},nwalme
:{tengwa
:"\u00f1"},romen
:{tengwa
:"r"},ore
:{tengwa
:"-r"},lambe
:{tengwa
:"l"},silme
:{tengwa
:"s"},"silme-nuquerna":{tengwa
:"s"},esse
:{tengwa
:"z"},"esse-nuquerna":{tengwa
:"z"},harma
:{tengwa
:"sh"},alda
:{tengwa
:"lh"},arda
:{tengwa
:"rh"},wilya
:{tengwa
:"a"},vala
:{tengwa
:"w"},
31 anna
:{tengwa
:"i"},vala
:{tengwa
:"w"},yanta
:{tengwa
:"e"},"hwesta-sindarinwa":{tengwa
:"wh"},s
:{following
:"s"},"s-inverse":{following
:"s<sub>2</sub>"},"s-extended":{following:"s<sub>3</sub>"},"s-flourish":{following
:"s<sub>4</sub>"},"long-carrier":{tengwa
:"\u00b4"},"short-carrier":{},"tilde-above":{above
:"nm\u00f1-"},"tilde-below":{below
:"2"},a
:{"tehta-above":"a"},e
:{"tehta-above":"e"},i
:{"tehta-above":"i"},o
:{"tehta-above":"o"},u
:{"tehta-above":"u"},"\u00f3":{"tehta-above":"\u00f3"},"\u00fa":{"tehta-above":"\u00fa"},
32 "\u00ed":{"tehta-above":"y"},y
:{"tehta-below":"y"},w
:{"tehta-above":"w"},"full-stop":{tengwa
:"."},"exclamation-point":{tengwa
:"!"},"question-mark":{tengwa
:"?"},comma
:{tengwa
:"-"},"open-paren":{tengwa
:"("},"close-paren":{tengwa
:")"},"flourish-left":{tengwa
:"\u201c"},"flourish-right":{tengwa
:"\u201d"}}};j
.encode
=function(a
){return a
.map(function(a
){return a
.map(function(a
){return a
.map(function(a
){return a
.map(function(a
){return a
.map(function(a
){var c
=[];a
.above
&&c
.push(a
.above
);a
.below
&&c
.push(a
.below
);
33 a
.following
&&c
.push(a
.following
);a
.tildeAbove
&&c
.push("tilde-above");a
.tildeBelow
&&c
.push("tilde-below");return c
.length
?a
.tengwa
+":"+c
.join(","):a
.tengwa
}).join(";")}).join(" ")}).join("\n")}).join("\n\n")}).join("\n\n\n")};j
.decode
=function(a
){return a
.split("\n\n\n").map(function(a
){return a
.split("\n\n").map(function(a
){return a
.split("\n").map(function(a
){return a
.split(" ").map(y
)})})})};j
.decodeWord
=y
;j
.transcribe
=function(a
){return a
.map(function(a
){return a
.map(function(a
){return a
.map(function(a
){return a
.map(function(a
){return a
.map(function(a
){var c
=
34 a
.tengwa
||"anna",d
=[];a
.above
&&d
.push(a
.above
);a
.below
&&d
.push(a
.below
);a
.tildeBelow
&&d
.push("tilde-below");a
.tildeAbove
&&d
.push("tilde-above");a
.following
&&d
.push(a
.following
);d
=g
.tengwar
[c
]+d
.map(function(a
){return A(c
,a
)}).join("");a
.errors
&&(d
='<abbr class="error" title="'+a
.errors
.join("\n").replace(/"/g,""")+'">'+d
+"</abbr>");return d
}).join("")}).join(" ")}).join("\n")}).join("\n\n")}).join("\n\n\n")};j
.tehtaForTengwa
=A
;j
.makeColumn
=z
;var i
=function(a
,e
,c
){this.above
=e
;this.tildeAbove
=
35 void 0;this.tengwa
=a
;this.tildeBelow
=void 0;this.below
=c
;this.error
=this.following
=void 0};i
.prototype.canAddAbove
=function(){return!this.above
||("silme"===this.tengwa
||"esse"===this.tengwa
)&&!this.below
};i
.prototype.addAbove
=function(a
){"silme"===this.tengwa
&&(this.tengwa
="silme-nuquerna");"esse"===this.tengwa
&&(this.tengwa
="esse-nuquerna");this.above
=a
;return this};i
.prototype.canAddBelow
=function(){return!this.below
&&"silme-nuquerna"!==this.tengwa
};i
.prototype.addBelow
=function(a
){this.below
=a
;
36 return this};i
.prototype.addTildeAbove
=function(){this.tildeAbove
=!0;return this};i
.prototype.addTildeBelow
=function(){this.tildeBelow
=!0;return this};i
.prototype.addFollowing
=function(a
){this.following
=a
;return this};i
.prototype.addError
=function(a
){this.errors
=this.errors
||[];this.errors
.push(a
);return this};var l
={module
$exports
:function(a
,e
){e
=e
||function(a
){throw Error(a
);};return function(c
){var f
,d
=a
.apply(null,[function(a
){f
=a
;var d
=e
;return function(a
){""!==a
&&d("Unexpected "+JSON
.stringify(a
));
37 return function N(){return N
}}}].concat(Array
.prototype.slice
.call(arguments
,1)));for(Array
.prototype.forEach
.call(c
,function(a
){d
=d(a
)});!f
;)d
=d("");return f
}}};l
.module
$exports
&&(l
=l
.module
$exports
);var m
={module
$exports
:function(a
){return a
.replace(V
,function(a
,c
){return J
[c
]})}},J
={k
:"c",x
:"cs",qu
:"cw",q
:"cw",ph
:"f",bh
:"v","\u00eb":"e","\u00e2":"\u00e1","\u00ea":"\u00e9","\u00ee":"\u00ed","\u00f4":"\u00f3","\u00fb":"\u00fa"},V
=RegExp("("+Object
.keys(J
).join("|")+")","ig");m
.module
$exports
&&(m
=
38 m
.module
$exports
);var n
={module
$exports
:{"-":"comma",",":"comma",":":"comma",";":"full-stop",".":"full-stop","!":"exclamation-point","?":"question-mark","(":"open-paren",")":"close-paren",">":"flourish-left","<":"flourish-right"}};n
.module
$exports
&&(n
=n
.module
$exports
);var o
={},M
=j
,O
=m
,C
=n
,L
={};o
.transcribe
=function(a
,e
){e
=t(e
);return e
.font
.transcribe(u(a
,e
))};o
.encode
=function(a
,e
){e
=t(e
);return e
.font
.encode(u(a
,e
))};o
.parse
=u
;var B
={iant
:"yanta;tinco:a,tilde-above",iaur
:"yanta;vala:a;ore",baranduiniant
:"umbar;romen:a;ando:a,tilde-above;anna:u;yanta;anto:a,tilde-above",
39 ioreth
:"yanta;romen:o;thule:e",noldo
:"nwalme;lambe:o;ando;short-carrier:o",noldor
:"nwalme;lambe:o;ando;ore:o",is
:"short-carrier:i,s"},P
=l(function(a
,e
){return D(a
,e
,[])}),v
="aeiou\u00f3\u00fa",r
={"\u00e1":"a","\u00e9":"e","\u00ed":"i","\u00f3":"o","\u00fa":"u"};o
.parseTengwaAnnotations
=k
;var Q
=["tinco","parma","short-carrier","lambe"],s
={},S
=j
,U
=m
,F
=n
,R
={};s
.transcribe
=function(a
,e
){e
=w(e
);return e
.font
.transcribe(x(a
,e
))};s
.encode
=function(a
,e
){e
=w(e
);return e
.font
.encode(x(a
,e
))};s
.parse
=x
;var T
=
40 l(function(a
,e
){return G(a
,e
,[])}),I
="aeiouy\u00e1\u00e9\u00ed\u00f3\u00fa",K
=Array
.prototype;document
.addEventListener("DOMContentLoaded",function e(){if(document
.body
.dataset
&&document
.querySelectorAll
&&K
.forEach
){var c
=document
.querySelectorAll(".tengwar");K
.forEach
.call(c
,function(c
){var d
=c
.dataset
;d
.encoding
?c
.innerText
=j
.transcribe(d
.encoding
):d
.tengwar
&&(c
.innerText
=("general-use"===(d
.mode
||"general-use")?o
:s
).transcribe(d
.tengwar
))})}document
.removeEventListener("DOMContentLoaded",e
)})})();