Home
last modified time | relevance | path

Searched refs:getWidth (Results 126 – 148 of 148) sorted by relevance

123456

/plugin/openlayersmap/ol7/
H A Dol.js.map
/plugin/jdraw/lib/
H A Djgraphx.jarMETA-INF/MANIFEST.MF META-INF/HAMMURAP.SF META-INF/HAMMURAP ...
/plugin/authgoogle/google/contrib/
H A DGoogle_YouTubeService.php3904 public function getWidth() { function in Google_Thumbnail
/plugin/combo/resources/library/combo/
H A Dcombo.min.js.map1 {"mappings":"6DAAA,SAASA,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQC,EAAKC,GACpE,IACE,IAAIC,EAAOP,EAAIK,GAAKC,GAChBE,EAAQD,EAAKC,MACjB,MAAOC,GAEP,YADAP,EAAOO,GAILF,EAAKG,KACPT,EAAQO,GAERG,QAAQV,QAAQO,GAAOI,KAAKT,EAAOC,GAIxB,SAAAS,EAA2BC,GACxC,OAAO,WACL,IAAIC,EAAOC,KACTC,EAAOC,UACT,OAAO,IAAIP,SAAQ,SAAUV,EAASC,GACpC,IAAIF,EAAMc,EAAGK,MAAMJ,EAAME,GAEzB,SAASd,EAAMK,GACbT,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQ,OAAQI,GAGlE,SAASJ,EAAOgB,GACdrB,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQ,QAASgB,GAGnEjB,OAAMkB,OC/BG,SAAAC,EAAyBC,EAAUC,GAChD,KAAMD,aAAoBC,GACxB,MAAM,IAAIC,UAAU,qCCFxB,SAASC,EAAkBC,EAAQC,GACjC,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CACrC,IAAIE,EAAaH,EAAMC,GACvBE,EAAWC,WAAaD,EAAWC,aAAc,EACjDD,EAAWE,cAAe,EACtB,UAAWF,IAAYA,EAAWG,UAAW,GACjDC,OAAOC,eAAeT,EAAQI,EAAW1B,IAAK0B,IAInC,SAAAM,EAAsBb,EAAac,EAAYC,GAG5D,OAFID,GAAYZ,EAAkB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,yBAAP,SAAwBwD,GACpB,OAAOqN,EAAWkO,YAAYvb,MAG3BxD,IAAA,wBAAP,WACI6Q,EAAWmO,oBAIRhf,IAAA,sBAAP,SAAqBif,GACjB,OAAOjC,EAAQkC,WAAWD,MAGvBjf,IAAA,qBAAP,WACI,OAAOgd,EAAQmC,kBAGZnf,IAAA,4BAAP,SAA2BwE,GACvB,OAAOD,EAAc8E,eAAe7E,MASjCxE,IAAA,2BAAP,SAA0B+L,EAAQ/C,GAC9B,OAAOiC,EAASb,eAAe2B,EAAQ/C,MAMpChJ,IAAA,6BAAP,WACI,OAAO6Q,EAAWiM,wBA5CR,GAMP,YAAYoB,GACnB9b,EAAAyc,EAAO,UAAU7B,GAAQ6B","sources":["node_modules/@swc/helpers/src/_async_to_generator.js","node_modules/@swc/helpers/src/_class_call_check.js","node_modules/@swc/helpers/src/_create_class.js","node_modules/@swc/helpers/src/_define_property.js","js/packages/combo/Boolean.js","js/packages/combo/Logger.js","node_modules/nanoid/index.browser.js","js/packages/combo/Html.js","js/packages/combo/FormMetaField.js","js/packages/combo/FormMetaTab.js","js/packages/combo/FormMeta.js","%3C%3Cjsx-config-pragma.js%3E%3E","bootstrap.js","js/packages/combo/ComboModal.js","node_modules/@swc/helpers/src/_type_of.js","node_modules/regenerator-runtime/runtime.js","js/packages/combo/Browser.js","js/packages/combo/DokuRequest.js","js/packages/combo/DokuUrl.js","js/packages/combo/ComboDate.js","js/packages/combo/combo.js"],"sourcesContent":["function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n","\n\nexport default class Boolean {\n\n static toBoolean(value) {\n if (typeof value === \"boolean\") {\n return value;\n }\n return (value === 'true');\n }\n}\n","\nlet logger;\n\n// KISS for now\n// Otherwise, see https://datacadamia.com/web/javascript/logger#library\nexport default class Logger {\n\n static getLogger(){\n if(logger===undefined){\n logger = new Logger();\n }\n return logger;\n }\n\n error(value){\n console.error(value);\n /**\n * Removed by parcel when build\n * https://parceljs.org/features/production/#development-branch-removal\n * And set by Jest to test\n * https://jestjs.io/docs/environment-variables#node_env\n */\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(value);\n }\n }\n\n\n}\n","import { urlAlphabet } from './url-alphabet/index.js'\nif (process.env.NODE_ENV !== 'production') {\n if (\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative' &&\n typeof crypto === 'undefined'\n ) {\n throw new Error(\n 'React Native does not have a built-in secure random generator. ' +\n 'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +\n 'For secure IDs, import `react-native-get-random-values` ' +\n 'before Nano ID.'\n )\n }\n if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {\n throw new Error(\n 'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' +\n ' before importing Nano ID to fix IE 11 support'\n )\n }\n if (typeof crypto === 'undefined') {\n throw new Error(\n 'Your browser does not have secure random generator. ' +\n 'If you don’t need unpredictable IDs, you can use nanoid/non-secure.'\n )\n }\n}\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, size, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * size) / alphabet.length)\n return () => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)\nlet nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n while (size--) {\n let byte = bytes[size] & 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte < 63) {\n id += '_'\n } else {\n id += '-'\n }\n }\n return id\n}\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","import {customAlphabet} from \"nanoid\";\n\nexport default class Html {\n\n static toHtmlId(s) {\n /**\n * A point is also replaced otherwise you\n * can't use the id as selector in CSS\n */\n return s\n .toString() // in case of number\n .replace(/[_.\\s:\\/\\\\]/g, \"-\");\n }\n\n static createRandomId() {\n /**\n * Shorthand selector does not support numbers\n * as first position\n * The alphabet does not allow them then\n */\n const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz', 10)\n return nanoid();\n }\n\n static toEntities(text) {\n let entities = [];\n for (let i = 0; i < text.length; i++) {\n let entity = `&#${text.charCodeAt(i)};`\n entities.push(entity);\n }\n return entities.join('');\n }\n}\n","import Boolean from \"./Boolean\";\nimport Logger from \"./Logger\";\nimport Html from \"./Html\";\n\n\n/**\n * A form field may hold:\n * * a simple scalar value\n * * or a table (list of values)\n */\nexport default class FormMetaField {\n\n\n tab = \"unknown\";\n mutable = true;\n values = [];\n defaultValues = [];\n multiple = false;\n\n /**\n * Static const function\n * Waiting for the const keyword\n * to make them not mutable\n * @type {string}\n */\n static TABULAR_TYPE = \"tabular\";\n static DATE_TIME = \"datetime\";\n static PARAGRAPH = \"paragraph\";\n static BOOLEAN = \"boolean\";\n\n children = {};\n static JSON = \"json\";\n\n\n constructor(name) {\n this.name = name;\n }\n\n getLabelAnchor() {\n if (this.getUrl() === undefined && this.getDescription() === undefined) {\n return this.getLabel();\n }\n let url = this.getUrl();\n if (this.getUrl() === undefined) {\n url = \"#\";\n return `\n<span class=\"d-inline-block\" tabindex=\"0\" data-bs-toggle=\"tooltip\" title=\"${this.getDescription()}\">\n <a href=\"${url}\" title=\"${this.getDescription()}\" style=\"text-decoration:none;pointer-events: none;\">${this.getLabel()}</a>\n</span>`;\n } else {\n return `<a href=\"${url}\" title=\"${this.getDescription()}\" data-bs-toggle=\"tooltip\" style=\"text-decoration:none\" target=\"_blank\">${this.getLabel()}</a>`;\n }\n }\n\n /**\n * The form field type\n * @param {string} type\n * @return {FormMetaField}\n */\n setType(type) {\n this.type = type;\n return this;\n }\n\n /**\n * The global label\n * (should be not null in case of tabular data)\n * @param {string} label\n * @return {FormMetaField}\n */\n setLabel(label) {\n this.label = label;\n return this;\n }\n\n /**\n * The global Url\n * (should be not null in case of tabular data)\n * @param {string} url\n * @return {FormMetaField}\n */\n setUrl(url) {\n this.url = url;\n return this;\n }\n\n\n /**\n * @param value\n * @param defaultValue\n * @return {FormMetaField}\n */\n addValue(value, defaultValue) {\n this.values.push(value);\n this.defaultValues.push(defaultValue);\n return this;\n }\n\n\n getType() {\n return this.type;\n }\n\n getLabel() {\n if (this.label === undefined) {\n return this.getName()\n .split(/[_\\-]/)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n }\n return this.label;\n }\n\n getUrl() {\n return this.url;\n }\n\n getName() {\n return this.name;\n }\n\n getDescription() {\n return this.description;\n }\n\n getTab() {\n return this.tab;\n }\n\n /**\n *\n * @param json\n * @param {FormMetaField} parent\n * @return {FormMetaField}\n */\n static createFromJson(json, parent = null) {\n if (!json.hasOwnProperty(\"name\")) {\n Logger.getLogger().error(\"To create a form meta field, the name property is mandatory.\");\n }\n let name = json[\"name\"];\n let formMetaField = FormMetaField.createFromName(name);\n if (parent != null) {\n formMetaField.setParent(parent);\n }\n\n let value;\n let valueDefault;\n for (let property in json) {\n if (!json.hasOwnProperty(property)) {\n continue;\n }\n let jsonValue = json[property];\n switch (property) {\n case \"name\":\n continue;\n case \"label\":\n formMetaField.setLabel(jsonValue);\n continue;\n case \"tab\":\n formMetaField.setTab(jsonValue);\n continue;\n case \"type\":\n formMetaField.setType(jsonValue);\n continue;\n case \"mutable\":\n formMetaField.setMutable(jsonValue);\n continue;\n case \"description\":\n formMetaField.setDescription(jsonValue);\n continue;\n case \"url\":\n formMetaField.setUrl(jsonValue);\n continue;\n case \"value\":\n value = jsonValue;\n continue;\n case \"default\":\n valueDefault = jsonValue;\n continue;\n case \"domain-values\":\n formMetaField.setDomainValues(jsonValue);\n continue;\n case \"multiple\":\n formMetaField.setMultiple(jsonValue);\n continue;\n case \"width\":\n formMetaField.setControlWidth(jsonValue);\n continue;\n case \"children\":\n let jsonChildren = jsonValue;\n for (let jsonChildProp in jsonChildren) {\n if (!jsonChildren.hasOwnProperty(jsonChildProp)) {\n continue;\n }\n let child = FormMetaField.createFromJson(jsonChildren[jsonChildProp], formMetaField);\n formMetaField.addChild(child);\n }\n continue;\n default:\n Logger.getLogger().error(`The property (${property}) of the form (${name}) is unknown`);\n }\n }\n if (!Array.isArray(value)) {\n formMetaField.addValue(value, valueDefault);\n } else {\n value.forEach((element, index) => {\n let valueDefaultElement = valueDefault[index];\n if (valueDefaultElement !== undefined) {\n formMetaField.addValue(element, valueDefaultElement);\n } else {\n formMetaField.addValue(element);\n }\n })\n }\n return formMetaField;\n }\n\n setMultiple(multiple) {\n this.multiple = multiple;\n return this;\n }\n\n setParent(parent) {\n this.parent = parent;\n return this;\n }\n\n /**\n *\n * @param name\n * @return {FormMetaField}\n */\n static createFromName(name) {\n return new FormMetaField(name);\n }\n\n isMutable() {\n return this.mutable;\n }\n\n setTab(value) {\n this.tab = value;\n return this;\n }\n\n /**\n *\n * @param {boolean} value\n */\n setMutable(value) {\n this.mutable = Boolean.toBoolean(value);\n return this;\n }\n\n setDescription(value) {\n this.description = value;\n return this;\n }\n\n getDefaultValue() {\n return this.defaultValues[0];\n }\n\n getValue() {\n return this.values[0];\n }\n\n getDomainValues() {\n return this.domainValues;\n }\n\n setDomainValues(value) {\n if (!Array.isArray(value)) {\n console.error(`The domains values should be an array. (${value}) is not an array`);\n return;\n }\n this.domainValues = value;\n return this;\n }\n\n /**\n *\n * @param width - the width of the control, not of the label as it can be derived - in a tabular form, there is none, otherwise the {@link FormMetaTab.getWidth total width} of the tab minus this control width)\n * @return {FormMetaField}\n */\n setControlWidth(width) {\n this.width = width;\n return this;\n }\n\n getControlWidth() {\n if (this.width === undefined && this.parent !== undefined) {\n return 12 / this.parent.getChildren().length;\n }\n return this.width;\n }\n\n getValues() {\n return this.values;\n }\n\n getDefaultValues() {\n return this.defaultValues;\n }\n\n /**\n *\n * @return {FormMetaField[]}\n *\n * See also the concept of list of objects\n * https://react-jsonschema-form.readthedocs.io/en/latest/usage/arrays/#arrays-of-objects\n *\n */\n getChildren() {\n return Object.values(this.children);\n }\n\n addChild(child) {\n this.children[child.getName()] = child;\n return this;\n }\n\n toHtmlLabel(forId, customClass) {\n let label = this.getLabelAnchor();\n let classLabel;\n if (this.getType() === FormMetaField.BOOLEAN) {\n classLabel = \"form-check-label\"\n } else {\n classLabel = \"col-form-label\";\n }\n if(typeof customClass !== 'undefined'){\n classLabel =`${customClass} ${classLabel}`\n }\n return `<label for=\"${forId}\" class=\"${classLabel}\">${label}</label>`\n }\n\n toHtmlControl(id, value = null, defaultValue = null) {\n\n let metadataType = this.getType();\n let mutable = this.isMutable();\n let domainValues = this.getDomainValues();\n let disabled;\n let htmlElement;\n\n /**\n * The creation of the form element\n */\n if (domainValues !== undefined) {\n\n /**\n * Select element\n * @type {string}\n */\n htmlElement = \"select\";\n let defaultValueHtml = \"\";\n if (defaultValue !== undefined) {\n defaultValueHtml = ` (${defaultValue})`;\n }\n\n let multiple = \"\";\n if (this.getMultiple()) {\n multiple = \"multiple\";\n }\n\n htmlElement = `<select class=\"form-select\" aria-label=\"${this.getLabel()}\" name=\"${this.getName()}\" id=\"${id}\" ${multiple}>`;\n let selected = \"\";\n if (value === null) {\n selected = \"selected\";\n }\n htmlElement += `<option value=\"\" ${selected}>Default${defaultValueHtml}</option>`;\n for (let selectValue of domainValues) {\n if (selectValue === value) {\n selected = \"selected\";\n } else {\n selected = \"\";\n }\n htmlElement += `<option value=\"${selectValue}\" ${selected}>${selectValue}</option>`;\n }\n htmlElement += `</select>`;\n return htmlElement;\n\n\n } else {\n\n /**\n * Placeholder default\n * @type {string}\n */\n let placeholderValue = `No value`;\n if (mutable) {\n placeholderValue = `Enter a ${this.getLabel()}`;\n }\n // value\n if (!(defaultValue === null || defaultValue === undefined)) {\n if (typeof defaultValue === 'string' || defaultValue instanceof String) {\n // json data for instance\n placeholderValue = Html.toEntities(defaultValue);\n } else {\n placeholderValue = defaultValue;\n }\n }\n let htmlPlaceholder = `placeholder=\"${placeholderValue}\"`;\n\n let htmlValue = \"\";\n let inputType;\n let name = this.getName();\n\n /**\n * With disable, the data is not in the form\n */\n if (mutable !== undefined && mutable === false) {\n disabled = \"disabled\";\n } else {\n disabled = \"\";\n }\n\n /**\n * Input Element\n * @type {string}\n */\n let htmlTag = \"input\";\n let htmlClass = \"form-control\";\n let checked = \"\";\n /**\n * Text area\n */\n let rows = 3;\n\n /**\n * Type ?\n */\n switch (metadataType) {\n case FormMetaField.DATE_TIME:\n inputType = \"datetime-local\";\n if (value !== null) {\n value = value.slice(0, 19);\n htmlValue = `value=\"${value}\"`;\n } else {\n if (!mutable && defaultValue !== null) {\n defaultValue = defaultValue.slice(0, 19);\n htmlValue = `value=\"${defaultValue}\"`;\n }\n }\n htmlPlaceholder = \"\"; // does not apply to local date time\n\n break;\n case FormMetaField.PARAGRAPH:\n htmlTag = \"textarea\";\n if (value !== null) {\n value = Html.toEntities(value);\n htmlValue = `${value}`;\n }\n break;\n case FormMetaField.JSON:\n htmlTag = \"textarea\";\n if (value !== null) {\n if(typeof value === 'object'){\n value = JSON.stringify(value, null, 2);\n }\n value = Html.toEntities(value);\n htmlValue = `${value}`;\n }\n rows = 15;\n break;\n case FormMetaField.BOOLEAN:\n inputType = \"checkbox\";\n htmlClass = \"form-check-input\";\n if (defaultValue !== null) {\n htmlValue = `value=\"${defaultValue}\"`;\n if (value === defaultValue) {\n checked = \"checked\"\n }\n } else {\n if (value === \"on\") {\n checked = \"checked\"\n }\n }\n\n htmlPlaceholder = \"\";\n break;\n default:\n inputType = \"text\";\n if (!(value === null || value === undefined)) {\n htmlValue = `value=\"${value}\"`;\n }\n }\n\n switch (htmlTag) {\n case \"textarea\":\n htmlElement = `<textarea id=\"${id}\" name=\"${name}\" class=\"${htmlClass}\" rows=\"${rows}\" ${htmlPlaceholder} ${disabled}>${htmlValue}</textarea>`;\n break;\n default:\n case \"input\":\n htmlElement = `<input type=\"${inputType}\" name=\"${name}\" class=\"${htmlClass}\" id=\"${id}\" ${htmlPlaceholder} ${htmlValue} ${checked} ${disabled}/>`;\n break;\n\n }\n return htmlElement;\n }\n\n }\n\n /**\n * Added to be able to add metadata to the returned Json Form\n * It has not yet all properties\n * @return\n */\n toJavascriptObject() {\n return {\n \"name\": this.getName(),\n \"label\": this.getLabel(),\n \"type\": this.getType(),\n \"description\": this.getDescription(),\n \"tab\": this.getTab(),\n \"mutable\": this.isMutable(),\n \"value\": this.getValue(),\n \"default\": this.getDefaultValue(),\n \"url\": this.getUrl()\n }\n }\n\n getMultiple() {\n return this.multiple;\n }\n}\n","import Logger from \"./Logger\";\n\n\nexport default class FormMetaTab {\n\n\n constructor(name) {\n this.name = name;\n }\n\n getName() {\n return this.name;\n }\n\n setWidth(width) {\n this.width = width;\n }\n\n /**\n * The width of the tab\n */\n getWidth() {\n return this.width;\n }\n\n static createFromJson(json) {\n if (!json.has (…)
/plugin/combo/resources/library/combo/dist/
H A Dcombo.min.js.map1 {"mappings":"6DAAA,SAASA,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQC,EAAKC,GACpE,IACE,IAAIC,EAAOP,EAAIK,GAAKC,GAChBE,EAAQD,EAAKC,MACjB,MAAOC,GAEP,YADAP,EAAOO,GAILF,EAAKG,KACPT,EAAQO,GAERG,QAAQV,QAAQO,GAAOI,KAAKT,EAAOC,GAIxB,SAAAS,EAA2BC,GACxC,OAAO,WACL,IAAIC,EAAOC,KACTC,EAAOC,UACT,OAAO,IAAIP,SAAQ,SAAUV,EAASC,GACpC,IAAIF,EAAMc,EAAGK,MAAMJ,EAAME,GAEzB,SAASd,EAAMK,GACbT,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQ,OAAQI,GAGlE,SAASJ,EAAOgB,GACdrB,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQ,QAASgB,GAGnEjB,OAAMkB,OC/BG,SAAAC,EAAyBC,EAAUC,GAChD,KAAMD,aAAoBC,GACxB,MAAM,IAAIC,UAAU,qCCFxB,SAASC,EAAkBC,EAAQC,GACjC,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CACrC,IAAIE,EAAaH,EAAMC,GACvBE,EAAWC,WAAaD,EAAWC,aAAc,EACjDD,EAAWE,cAAe,EACtB,UAAWF,IAAYA,EAAWG,UAAW,GACjDC,OAAOC,eAAeT,EAAQI,EAAW1B,IAAK0B,IAInC,SAAAM,EAAsBb,EAAac,EAAYC,GAG5D,OAFID,GAAYZ,EAAkBF,EAAYgB,UAAWF,GACrDC,GAAab,EAAkBF,EAA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jB,OAAO,IAAIT,EADA,IAAIU,KAAKD,UARb,GCOftC,OAAc,OAMVna,EANW2c,EAAG,iCAAMC,gCAEbhf,IAAA,iBAAP,SAAgBwE,GACZ,OAAOb,EAAKwI,SAAS3H,MAMlBxE,IAAA,yBAAP,SAAwBwD,GACpB,OAAOqN,EAAWoO,YAAYzb,MAG3BxD,IAAA,wBAAP,WACI6Q,EAAWqO,oBAGRlf,IAAA,0BAAP,SAAyBmf,GACrB,OAAO9B,EAAgB+B,kBAAkBD,MAGtCnf,IAAA,qBAAP,WACI,OAAOmc,EAAQkD,kBAGZrf,IAAA,4BAAP,SAA2BwE,GACvB,OAAOD,EAAc8E,eAAe7E,MASjCxE,IAAA,2BAAP,SAA0B+L,EAAQ/C,GAC9B,OAAOiC,EAASb,eAAe2B,EAAQ/C,MAMpChJ,IAAA,6BAAP,WACI,OAAO6Q,EAAWoN,wBA3CR,GAMP,YAAYG,GACnBhc,EAAA2c,EAAO,UAAU5C,GAAQ4C","sources":["node_modules/@swc/helpers/src/_async_to_generator.js","node_modules/@swc/helpers/src/_class_call_check.js","node_modules/@swc/helpers/src/_create_class.js","node_modules/@swc/helpers/src/_define_property.js","resources/library/combo/Boolean.js","resources/library/combo/Logger.js","node_modules/nanoid/index.browser.js","resources/library/combo/Html.js","resources/library/combo/FormMetaField.js","resources/library/combo/FormMetaTab.js","resources/library/combo/FormMeta.js","%3C%3Cjsx-config-pragma.js%3E%3E","bootstrap.js","resources/library/combo/ComboModal.js","node_modules/@swc/helpers/src/_type_of.js","node_modules/regenerator-runtime/runtime.js","resources/library/combo/Browser.js","resources/library/combo/DokuRequest.js","resources/library/combo/ComboDate.js","resources/library/combo/combo.js"],"sourcesContent":["function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n","\n\nexport default class Boolean {\n\n static toBoolean(value) {\n if (typeof value === \"boolean\") {\n return value;\n }\n return (value === 'true');\n }\n}\n","\nlet logger;\n\n// KISS for now\n// Otherwise, see https://datacadamia.com/web/javascript/logger#library\nexport default class Logger {\n\n static getLogger(){\n if(logger===undefined){\n logger = new Logger();\n }\n return logger;\n }\n\n error(value){\n console.error(value);\n /**\n * Removed by parcel when build\n * https://parceljs.org/features/production/#development-branch-removal\n * And set by Jest to test\n * https://jestjs.io/docs/environment-variables#node_env\n */\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(value);\n }\n }\n\n\n}\n","import { urlAlphabet } from './url-alphabet/index.js'\nif (process.env.NODE_ENV !== 'production') {\n if (\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative' &&\n typeof crypto === 'undefined'\n ) {\n throw new Error(\n 'React Native does not have a built-in secure random generator. ' +\n 'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +\n 'For secure IDs, import `react-native-get-random-values` ' +\n 'before Nano ID.'\n )\n }\n if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {\n throw new Error(\n 'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' +\n ' before importing Nano ID to fix IE 11 support'\n )\n }\n if (typeof crypto === 'undefined') {\n throw new Error(\n 'Your browser does not have secure random generator. ' +\n 'If you don’t need unpredictable IDs, you can use nanoid/non-secure.'\n )\n }\n}\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nlet customRandom = (alphabet, size, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n let step = -~((1.6 * mask * size) / alphabet.length)\n return () => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\nlet customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)\nlet nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n while (size--) {\n let byte = bytes[size] & 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte < 63) {\n id += '_'\n } else {\n id += '-'\n }\n }\n return id\n}\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","import {customAlphabet, nanoid} from \"nanoid\";\n\nexport default class Html {\n\n static toHtmlId(s) {\n /**\n * A point is also replaced otherwise you\n * can't use the id as selector in CSS\n */\n return s\n .toString() // in case of number\n .replace(/[_.\\s:\\/\\\\]/g, \"-\");\n }\n\n static createRandomId() {\n /**\n * Shorthand selector does not support numbers\n * as first position\n * The alphabet does not allow them then\n */\n const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz', 10)\n return nanoid();\n }\n\n static toEntities(text) {\n let entities = [];\n for (let i = 0; i < text.length; i++) {\n let entity = `&#${text[i].charCodeAt()};`\n entities.push(entity);\n }\n return entities.join('');\n }\n}\n","import Boolean from \"./Boolean\";\nimport Logger from \"./Logger\";\nimport Html from \"./Html\";\n\n\n/**\n * A form field may hold:\n * * a simple scalar value\n * * or a table (list of values)\n */\nexport default class FormMetaField {\n\n\n tab = \"unknown\";\n mutable = true;\n values = [];\n defaultValues = [];\n multiple = false;\n\n /**\n * Static const function\n * Waiting for the const keyword\n * to make them not mutable\n * @type {string}\n */\n static TABULAR_TYPE = \"tabular\";\n static DATE_TIME = \"datetime\";\n static PARAGRAPH = \"paragraph\";\n static BOOLEAN = \"boolean\";\n\n children = {};\n static JSON = \"json\";\n\n\n constructor(name) {\n this.name = name;\n }\n\n getLabelAnchor() {\n if (this.getUrl() === undefined && this.getDescription() === undefined) {\n return this.getLabel();\n }\n let url = this.getUrl();\n if (this.getUrl() === undefined) {\n url = \"#\";\n return `\n<span class=\"d-inline-block\" tabindex=\"0\" data-bs-toggle=\"tooltip\" title=\"${this.getDescription()}\">\n <a href=\"${url}\" title=\"${this.getDescription()}\" style=\"text-decoration:none;pointer-events: none;\">${this.getLabel()}</a>\n</span>`;\n } else {\n return `<a href=\"${url}\" title=\"${this.getDescription()}\" data-bs-toggle=\"tooltip\" style=\"text-decoration:none\" target=\"_blank\">${this.getLabel()}</a>`;\n }\n }\n\n /**\n * The form field type\n * @param {string} type\n * @return {FormMetaField}\n */\n setType(type) {\n this.type = type;\n return this;\n }\n\n /**\n * The global label\n * (should be not null in case of tabular data)\n * @param {string} label\n * @return {FormMetaField}\n */\n setLabel(label) {\n this.label = label;\n return this;\n }\n\n /**\n * The global Url\n * (should be not null in case of tabular data)\n * @param {string} url\n * @return {FormMetaField}\n */\n setUrl(url) {\n this.url = url;\n return this;\n }\n\n\n /**\n * @param value\n * @param defaultValue\n * @return {FormMetaField}\n */\n addValue(value, defaultValue) {\n this.values.push(value);\n this.defaultValues.push(defaultValue);\n return this;\n }\n\n\n getType() {\n return this.type;\n }\n\n getLabel() {\n if (this.label === undefined) {\n return this.getName()\n .split(/_|-/)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n }\n return this.label;\n }\n\n getUrl() {\n return this.url;\n }\n\n getName() {\n return this.name;\n }\n\n getDescription() {\n return this.description;\n }\n\n getTab() {\n return this.tab;\n }\n\n /**\n *\n * @param json\n * @param {FormMetaField} parent\n * @return {FormMetaField}\n */\n static createFromJson(json, parent = null) {\n if (!json.hasOwnProperty(\"name\")) {\n Logger.getLogger().error(\"To create a form meta field, the name property is mandatory.\");\n }\n let name = json[\"name\"];\n let formMetaField = FormMetaField.createFromName(name);\n if (parent != null) {\n formMetaField.setParent(parent);\n }\n\n let value;\n let valueDefault;\n for (let property in json) {\n if (!json.hasOwnProperty(property)) {\n continue;\n }\n let jsonValue = json[property];\n switch (property) {\n case \"name\":\n continue;\n case \"label\":\n formMetaField.setLabel(jsonValue);\n continue;\n case \"tab\":\n formMetaField.setTab(jsonValue);\n continue;\n case \"type\":\n formMetaField.setType(jsonValue);\n continue;\n case \"mutable\":\n formMetaField.setMutable(jsonValue);\n continue;\n case \"description\":\n formMetaField.setDescription(jsonValue);\n continue;\n case \"url\":\n formMetaField.setUrl(jsonValue);\n continue;\n case \"value\":\n value = jsonValue;\n continue;\n case \"default\":\n valueDefault = jsonValue;\n continue;\n case \"domain-values\":\n formMetaField.setDomainValues(jsonValue);\n continue;\n case \"multiple\":\n formMetaField.setMultiple(jsonValue);\n continue;\n case \"width\":\n formMetaField.setControlWidth(jsonValue);\n continue;\n case \"children\":\n let jsonChildren = jsonValue;\n for (let jsonChildProp in jsonChildren) {\n if (!jsonChildren.hasOwnProperty(jsonChildProp)) {\n continue;\n }\n let child = FormMetaField.createFromJson(jsonChildren[jsonChildProp], formMetaField);\n formMetaField.addChild(child);\n }\n continue;\n default:\n Logger.getLogger().error(`The property (${property}) of the form (${name}) is unknown`);\n }\n }\n if (!Array.isArray(value)) {\n formMetaField.addValue(value, valueDefault);\n } else {\n value.forEach((element, index) => {\n let valueDefaultElement = valueDefault[index];\n if (valueDefaultElement !== undefined) {\n formMetaField.addValue(element, valueDefaultElement);\n } else {\n formMetaField.addValue(element);\n }\n })\n }\n return formMetaField;\n }\n\n setMultiple(multiple) {\n this.multiple = multiple;\n return this;\n }\n\n setParent(parent) {\n this.parent = parent;\n return this;\n }\n\n /**\n *\n * @param name\n * @return {FormMetaField}\n */\n static createFromName(name) {\n return new FormMetaField(name);\n }\n\n isMutable() {\n return this.mutable;\n }\n\n setTab(value) {\n this.tab = value;\n return this;\n }\n\n /**\n *\n * @param {boolean} value\n */\n setMutable(value) {\n this.mutable = Boolean.toBoolean(value);\n return this;\n }\n\n setDescription(value) {\n this.description = value;\n return this;\n }\n\n getDefaultValue() {\n return this.defaultValues[0];\n }\n\n getValue() {\n return this.values[0];\n }\n\n getDomainValues() {\n return this.domainValues;\n }\n\n setDomainValues(value) {\n if (!Array.isArray(value)) {\n console.error(`The domains values should be an array. (${value}) is not an array`);\n return;\n }\n this.domainValues = value;\n return this;\n }\n\n /**\n *\n * @param width - the width of the control, not of the label as it can be derived - in a tabular form, there is none, otherwise the {@link FormMetaTab.getWidth total width} of the tab minus this control width)\n * @return {FormMetaField}\n */\n setControlWidth(width) {\n this.width = width;\n return this;\n }\n\n getControlWidth() {\n if (this.width === undefined && this.parent !== undefined) {\n return 12 / this.parent.getChildren().length;\n }\n return this.width;\n }\n\n getValues() {\n return this.values;\n }\n\n getDefaultValues() {\n return this.defaultValues;\n }\n\n /**\n *\n * @return {FormMetaField[]}\n *\n * See also the concept of list of objects\n * https://react-jsonschema-form.readthedocs.io/en/latest/usage/arrays/#arrays-of-objects\n *\n */\n getChildren() {\n return Object.values(this.children);\n }\n\n addChild(child) {\n this.children[child.getName()] = child;\n return this;\n }\n\n toHtmlLabel(forId, customClass) {\n let label = this.getLabelAnchor();\n let classLabel = \"\";\n if (this.getType() === FormMetaField.BOOLEAN) {\n classLabel = \"form-check-label\"\n } else {\n classLabel = \"col-form-label\";\n }\n if(typeof customClass !== 'undefined'){\n classLabel =`${customClass} ${classLabel}`\n }\n return `<label for=\"${forId}\" class=\"${classLabel}\">${label}</label>`\n }\n\n toHtmlControl(id, value = null, defaultValue = null) {\n\n let metadataType = this.getType();\n let mutable = this.isMutable();\n let domainValues = this.getDomainValues();\n let disabled;\n let htmlElement;\n\n /**\n * The creation of the form element\n */\n if (domainValues !== undefined) {\n\n /**\n * Select element\n * @type {string}\n */\n htmlElement = \"select\";\n let defaultValueHtml = \"\";\n if (defaultValue !== undefined) {\n defaultValueHtml = ` (${defaultValue})`;\n }\n\n let multiple = \"\";\n if (this.getMultiple()) {\n multiple = \"multiple\";\n }\n\n htmlElement = `<select class=\"form-select\" aria-label=\"${this.getLabel()}\" name=\"${this.getName()}\" id=\"${id}\" ${multiple}>`;\n let selected = \"\";\n if (value === null) {\n selected = \"selected\";\n }\n htmlElement += `<option value=\"\" ${selected}>Default${defaultValueHtml}</option>`;\n for (let selectValue of domainValues) {\n if (selectValue === value) {\n selected = \"selected\";\n } else {\n selected = \"\";\n }\n htmlElement += `<option value=\"${selectValue}\" ${selected}>${selectValue}</option>`;\n }\n htmlElement += `</select>`;\n return htmlElement;\n\n\n } else {\n\n /**\n * Placeholder default\n * @type {string}\n */\n let placeholderValue = `No value`;\n if (mutable) {\n placeholderValue = `Enter a ${this.getLabel()}`;\n }\n // value\n if (!(defaultValue === null || defaultValue === undefined)) {\n if (typeof defaultValue === 'string' || defaultValue instanceof String) {\n // json data for instance\n placeholderValue = Html.toEntities(defaultValue);\n } else {\n placeholderValue = defaultValue;\n }\n }\n let htmlPlaceholder = `placeholder=\"${placeholderValue}\"`;\n\n let htmlValue = \"\";\n let inputType;\n let name = this.getName();\n\n /**\n * With disable, the data is not in the form\n */\n if (mutable !== undefined && mutable === false) {\n disabled = \"disabled\";\n } else {\n disabled = \"\";\n }\n\n /**\n * Input Element\n * @type {string}\n */\n let htmlTag = \"input\";\n let htmlClass = \"form-control\";\n let checked = \"\";\n /**\n * Text area\n */\n let rows = 3;\n\n /**\n * Type ?\n */\n switch (metadataType) {\n case FormMetaField.DATE_TIME:\n inputType = \"datetime-local\";\n if (value !== null) {\n value = value.slice(0, 19);\n htmlValue = `value=\"${value}\"`;\n } else {\n if (!mutable && defaultValue !== null) {\n defaultValue = defaultValue.slice(0, 19);\n htmlValue = `value=\"${defaultValue}\"`;\n }\n }\n htmlPlaceholder = \"\"; // does not apply to local date time\n\n break;\n case FormMetaField.PARAGRAPH:\n htmlTag = \"textarea\";\n if (value !== null) {\n value = Html.toEntities(value);\n htmlValue = `${value}`;\n }\n break;\n case FormMetaField.JSON:\n htmlTag = \"textarea\";\n if (value !== null) {\n if(typeof value === 'object'){\n value = JSON.stringify(value, null, 2);\n }\n value = Html.toEntities(value);\n htmlValue = `${value}`;\n }\n rows = 15;\n break;\n case FormMetaField.BOOLEAN:\n inputType = \"checkbox\";\n htmlClass = \"form-check-input\";\n if (defaultValue !== null) {\n htmlValue = `value=\"${defaultValue}\"`;\n if (value === defaultValue) {\n checked = \"checked\"\n }\n } else {\n if (value === \"on\") {\n checked = \"checked\"\n }\n }\n\n htmlPlaceholder = \"\";\n break;\n default:\n inputType = \"text\";\n if (!(value === null || value === undefined)) {\n htmlValue = `value=\"${value}\"`;\n }\n }\n\n switch (htmlTag) {\n case \"textarea\":\n htmlElement = `<textarea id=\"${id}\" name=\"${name}\" class=\"${htmlClass}\" rows=\"${rows}\" ${htmlPlaceholder} ${disabled}>${htmlValue}</textarea>`;\n break;\n default:\n case \"input\":\n htmlElement = `<input type=\"${inputType}\" name=\"${name}\" class=\"${htmlClass}\" id=\"${id}\" ${htmlPlaceholder} ${htmlValue} ${checked} ${disabled}/>`;\n break;\n\n }\n return htmlElement;\n }\n\n }\n\n /**\n * Added to be able to add metadata to the returned Json Form\n * It has not yet all properties\n * @return\n */\n toJavascriptObject() {\n return {\n \"name\": this.getName(),\n \"label\": this.getLabel(),\n \"type\": this.getType(),\n \"description\": this.getDescription(),\n \"tab\": this.getTab(),\n \"mutable\": this.isMutable(),\n \"value\": this.getValue(),\n \"default\": this.getDefaultValue(),\n \"url\": this.getUrl()\n }\n }\n\n getMultiple() {\n return this.multiple;\n }\n}\n","import Logger from \"./Logger\";\n\n\nexport default class FormMetaTab {\n\n\n constructor(name) {\n this.name = name;\n }\n\n getName() {\n return this.name;\n }\n\n setWidth(width) {\n this.width = width;\n }\n\n /**\n * The width of the tab\n */\n getWidth() {\n return this.width;\n }\n\n static createFromJson(json) {\n if (!json.has (…)
/plugin/ol3/
H A Dscript.js8getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prot… method in t
/plugin/diagramsnet/lib/js/
H A Dextensions.min.js1334 …b){if(null!=this.x&&null!=this.y&&null!=this.a){var c=b.getHeight(),g=b.getWidth(),d=Math.floor(Ma…
1338 …is.a&&null!=this.b&&null!=this.c&&null!=this.d){var c=b.getHeight(),g=b.getWidth(),d=this.x*f.mxgr…
1342 …is.a&&null!=this.b&&null!=this.c&&null!=this.d){var c=b.getHeight(),g=b.getWidth(),d=this.x*f.mxgr…
1348 …b);a.prototype.handle=function(a,b){var c=a.x,g=a.y,d=b.getHeight(),e=b.getWidth();null!=this.x&&n…
1350 …b);a.prototype.handle=function(a,b){var c=a.x,g=a.y,d=b.getHeight(),e=b.getWidth();null!=this.x&&n…
1352 …ull!=this.x&&null!=this.y&&null!=this.formulaE){var c=g.getHeight(),d=g.getWidth(),e=this.x*f.mxgr…
1358 …ull!=this.x&&null!=this.y&&null!=this.formulaA){var g=b.getHeight(),d=b.getWidth(),e=this.x*f.mxgr…
1373 …null!=this.a&&null!=this.b&&null!=this.c&&null!=this.d){b.getHeight();b.getWidth();var c=this.x*f.…
1424 …g.getHeight()/f.mxgraph.io.vsdx.mxVsdxUtils.conversionFactor_$LI$(),d=g.getWidth()/f.mxgraph.io.vs…
1436 …unction(){return null!=this.text?this.text.childNodes:null};b.prototype.getWidth=function(){return… method in b
[all …]
/plugin/aceeditor/
H A Dbuild.js1getWidth=function(){return this.width},this.getHeight=function(){return this.height},this.setHeigh… function
/plugin/jmol2/jmol/
H A DJmolApplet0.jarMETA-INF/ META-INF/MANIFEST.MF com/ com/obrador/ javax/ ...
H A DJmolAppletSigned0.jarMETA-INF/MANIFEST.MF META-INF/SELFSIGN.SF META-INF/SELFSIGN ...
H A DJmolApplet.jarMETA-INF/ META-INF/MANIFEST.MF org/ org/jmol/ org/ ...
H A DJmolAppletSigned.jarMETA-INF/MANIFEST.MF META-INF/SELFSIGN.SF META-INF/SELFSIGN ...
/plugin/edittable/lib/
H A Dhandsontable.full.js18371 value: function getWidth() {
46884 width: selectedRange.getWidth(),
46897 width: selectedRange.getWidth(),
46954 rangeWidth = selectedRange.getWidth();
/plugin/abc2/abc-libraries/abcjs/
H A Dabcjs_plugin-midi_6.0.0-beta.25-min.js3 !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.abcjs=t():e.ABCJS=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=27)}([function(e,t){var n={clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},cloneArray:function(e){for(var t=[],r=0;r<e.length;r++)t.push(n.clone(e[r]));return t},cloneHashOfHash:function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=n.clone(e[r]));return t},cloneHashOfArrayOfHash:function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=n.cloneArray(e[r]));return t},gsub:function(e,t,n){return e.split(t).join(n)},strip:function(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")},startsWith:function(e,t){return 0===e.indexOf(t)},endsWith:function(e,t){var n=e.length-t.length;return n>=0&&e.lastIndexOf(t)===n},each:function(e,t,n){for(var r=0,i=e.length;r<i;r++)t.apply(n,[e[r],r])},last:function(e){return 0===e.length?null:e[e.length-1]},compact:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},detect:function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return!0;return!1}};try{[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach((function(e){e.hasOwnProperty("remove")||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})}))}catch(e){}e.exports=n},function(e,t){var n={FONTEM:360,FONTSIZE:30};n.STEP=93*n.FONTSIZE/720,n.SPACE=10,n.TOPNOTE=15,n.STAVEHEIGHT=100,n.INDENT=50,e.exports=n},function(e,t){var n=function(e,t,n,r,i){switch(i=i||{},this.x=0,this.c=e,this.dx=t,this.w=n,this.pitch=r,this.scalex=i.scalex||1,this.scaley=i.scaley||1,this.type=i.type||"symbol",this.pitch2=i.pitch2,this.linewidth=i.linewidth,this.klass=i.klass,this.top=r,void 0!==this.pitch2&&this.pitch2>this.top&&(this.top=this.pitch2),this.bottom=r,void 0!==this.pitch2&&this.pitch2<this.bottom&&(this.bottom=this.pitch2),i.thickness&&(this.top+=i.thickness/2,this.bottom-=i.thickness/2),i.stemHeight&&(i.stemHeight>0?this.top+=i.stemHeight:this.bottom+=i.stemHeight),i.dim&&(this.dim=i.dim),i.position&&(this.position=i.position),this.height=i.height?i.height:4,i.top&&(this.top=i.top),i.bottom&&(this.bottom=i.bottom),i.realWidth?this.realWidth=i.realWidth:this.realWidth=this.w,this.centerVertically=!1,this.type){case"debug":this.chordHeightAbove=this.height;break;case"lyric":i.position&&"below"===i.position?this.lyricHeightBelow=this.height:this.lyricHeightAbove=this.height;break;case"chord":i.position&&"below"===i.position?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height;break;case"text":void 0===this.pitch?i.position&&"below"===i.position?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height:this.centerVertically=!0;break;case"part":this.partHeightAbove=this.height}};n.prototype.getChordDim=function(){if("debug"===this.type)return null;if(!this.chordHeightAbove&&!this.chordHeightBelow)return null;var e=this.dim.font.size/4;1===this.c.length&&(e/=2);var t="chord"===this.type?this.realWidth/2:0,n=this.x-t-e;return{left:n,right:n+this.realWidth+e}},n.prototype.invertLane=function(e){void 0===this.lane&&(this.lane=0),this.lane=e-this.lane-1},n.prototype.putChordInLane=function(e){this.lane=e,this.chordHeightAbove?this.chordHeightAbove=1.25*this.height*this.lane:this.chordHeightBelow=1.25*this.height*this.lane},n.prototype.getLane=function(){return void 0===this.lane?0:this.lane},n.prototype.setX=function(e){this.x=e+this.dx},e.exports=n},function(e,t){e.exports=function(e){return parseFloat(e.toFixed(2))}},function(e,t,n){var r=n(3);e.exports=function(e,t){var n,i=t.y;if(t.lane){var a=.25*t.dim.font.size;i+=(t.dim.font.size+a)*t.lane}t.dim?(n=t.dim).attr.class=t.klass:n=e.controller.getFontAndAttr.calc(t.type,t.klass),t.anchor&&(n.attr["text-anchor"]=t.anchor),n.attr.x=t.x,n.attr.y=i,t.centerVertically||(n.attr.y+=n.font.size),"debugfont"===t.type&&(console.log("Debug msg: "+t.text),n.attr.stroke="#ff0000");var s=t.text.replace(/\n\n/g,"\n \n");s=s.replace(/^\n/," \n"),n.font.box&&(e.paper.openGroup({klass:n.attr.class,fill:"#000000"}),"end"===n.attr["text-anchor"]?n.attr.x-=n.font.padding:"start"===n.attr["text-anchor"]&&(n.attr.x+=n.font.padding),n.attr.y+=n.font.padding,delete n.attr.class),t.noClass&&delete n.attr.class,n.attr.x=r(n.attr.x),n.attr.y=r(n.attr.y);var o=e.paper.text(s,n.attr);if(n.font.box){var c=o.getBBox(),l=0;"middle"===n.attr["text-anchor"]?l=c.width/2+n.font.padding:"end"===n.attr["text-anchor"]&&(l=c.width+2*n.font.padding);var h=0;t.centerVertically&&(h=c.height-n.font.padding),e.paper.rect({x:Math.round(t.x-l),y:Math.round(i-h),width:Math.round(c.width+2*n.font.padding),height:Math.round(c.height+2*n.font.padding)}),o=e.paper.closeGroup()}return o}},function(e,t,n){var r=n(1),i={0:{d:[["M",4.83,-14.97],["c",.33,-.03,1.11,0,1.47,.06],["c",1.68,.36,2.97,1.59,3.78,3.6],["c",1.2,2.97,.81,6.96,-.9,9.27],["c",-.78,1.08,-1.71,1.71,-2.91,1.95],["c",-.45,.09,-1.32,.09,-1.77,0],["c",-.81,-.18,-1.47,-.51,-2.07,-1.02],["c",-2.34,-2.07,-3.15,-6.72,-1.74,-10.2],["c",.87,-2.16,2.28,-3.42,4.14,-3.66],["z"],["m",1.11,.87],["c",-.21,-.06,-.69,-.09,-.87,-.06],["c",-.54,.12,-.87,.42,-1.17,.99],["c",-.36,.66,-.51,1.56,-.6,3],["c",-.03,.75,-.03,4.59,0,5.31],["c",.09,1.5,.27,2.4,.6,3.06],["c",.24,.48,.57,.78,.96,.9],["c",.27,.09,.78,.09,1.05,0],["c",.39,-.12,.72,-.42,.96,-.9],["c",.33,-.66,.51,-1.56,.6,-3.06],["c",.03,-.72,.03,-4.56,0,-5.31],["c",-.09,-1.47,-.27,-2.37,-.6,-3.03],["c",-.24,-.48,-.54,-.78,-.93,-.9],["z"]],w:10.78,h:14.959},1:{d:[["M",3.3,-15.06],["c",.06,-.06,.21,-.03,.66,.15],["c",.81,.39,1.08,.39,1.83,.03],["c",.21,-.09,.39,-.15,.42,-.15],["c",.12,0,.21,.09,.27,.21],["c",.06,.12,.06,.33,.06,5.94],["c",0,3.93,0,5.85,.03,6.03],["c",.06,.36,.15,.69,.27,.96],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.12,-.27,.21,-.6,.27,-.96],["c",.03,-.18,.03,-1.59,.03,-4.29],["c",0,-3.87,0,-4.05,-.06,-4.14],["c",-.09,-.15,-.18,-.24,-.39,-.24],["c",-.12,0,-.15,.03,-.21,.06],["c",-.03,.06,-.45,.99,-.96,2.13],["c",-.48,1.14,-.9,2.1,-.93,2.16],["c",-.06,.15,-.21,.24,-.33,.24],["c",-.24,0,-.42,-.18,-.42,-.39],["c",0,-.06,3.27,-7.62,3.33,-7.74],["z"]],w:8.94,h:15.058},2:{d:[["M",4.23,-14.97],["c",.57,-.06,1.68,0,2.34,.18],["c",.69,.18,1.5,.54,2.01,.9],["c",1.35,.96,1.95,2.25,1.77,3.81],["c",-.15,1.35,-.66,2.34,-1.68,3.15],["c",-.6,.48,-1.44,.93,-3.12,1.65],["c",-1.32,.57,-1.8,.81,-2.37,1.14],["c",-.57,.33,-.57,.33,-.24,.27],["c",.39,-.09,1.26,-.09,1.68,0],["c",.72,.15,1.41,.45,2.1,.9],["c",.99,.63,1.86,.87,2.55,.75],["c",.24,-.06,.42,-.15,.57,-.3],["c",.12,-.09,.3,-.42,.3,-.51],["c",0,-.09,.12,-.21,.24,-.24],["c",.18,-.03,.39,.12,.39,.3],["c",0,.12,-.15,.57,-.3,.87],["c",-.54,1.02,-1.56,1.74,-2.79,2.01],["c",-.42,.09,-1.23,.09,-1.62,.03],["c",-.81,-.18,-1.32,-.45,-2.01,-1.11],["c",-.45,-.45,-.63,-.57,-.96,-.69],["c",-.84,-.27,-1.89,.12,-2.25,.9],["c",-.12,.21,-.21,.54,-.21,.72],["c",0,.12,-.12,.21,-.27,.24],["c",-.15,0,-.27,-.03,-.33,-.15],["c",-.09,-.21,.09,-1.08,.33,-1.71],["c",.24,-.66,.66,-1.26,1.29,-1.89],["c",.45,-.45,.9,-.81,1.92,-1.56],["c",1.29,-.93,1.89,-1.44,2.34,-1.98],["c",.87,-1.05,1.26,-2.19,1.2,-3.63],["c",-.06,-1.29,-.39,-2.31,-.96,-2.91],["c",-.36,-.33,-.72,-.51,-1.17,-.54],["c",-.84,-.03,-1.53,.42,-1.59,1.05],["c",-.03,.33,.12,.6,.57,1.14],["c",.45,.54,.54,.87,.42,1.41],["c",-.15,.63,-.54,1.11,-1.08,1.38],["c",-.63,.33,-1.2,.33,-1.83,0],["c",-.24,-.12,-.33,-.18,-.54,-.39],["c",-.18,-.18,-.27,-.3,-.36,-.51],["c",-.24,-.45,-.27,-.84,-.21,-1.38],["c",.12,-.75,.45,-1.41,1.02,-1.98],["c",.72,-.72,1.74,-1.17,2.85,-1.32],["z"]],w:10.764,h:14.97},3:{d:[["M",3.78,-14.97],["c",.3,-.03,1.41,0,1.83,.06],["c",2.22,.3,3.51,1.32,3.72,2.91],["c",.03,.33,.03,1.26,-.03,1.65],["c",-.12,.84,-.48,1.47,-1.05,1.77],["c",-.27,.15,-.36,.24,-.45,.39],["c",-.09,.21,-.09,.36,0,.57],["c",.09,.15,.18,.24,.51,.39],["c",.75,.42,1.23,1.14,1.41,2.13],["c",.06,.42,.06,1.35,0,1.71],["c",-.18,.81,-.48,1.38,-1.02,1.95],["c",-.75,.72,-1.8,1.2,-3.18,1.38],["c",-.42,.06,-1.56,.06,-1.95,0],["c",-1.89,-.33,-3.18,-1.29,-3.51,-2.64],["c",-.03,-.12,-.03,-.33,-.03,-.6],["c",0,-.36,0,-.42,.06,-.63],["c",.12,-.3,.27,-.51,.51,-.75],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.51,.36,-.63,.54,-.6,.87],["c",.06,.54,.54,.9,1.38,.99],["c",.36,.06,.72,.03,.96,-.06],["c",.81,-.27,1.29,-1.23,1.44,-2.79],["c",.03,-.45,.03,-1.95,-.03,-2.37],["c",-.09,-.75,-.33,-1.23,-.75,-1.44],["c",-.33,-.18,-.45,-.18,-1.98,-.18],["c",-1.35,0,-1.41,0,-1.5,-.06],["c",-.18,-.12,-.24,-.39,-.12,-.6],["c",.12,-.15,.15,-.15,1.68,-.15],["c",1.5,0,1.62,0,1.89,-.15],["c",.18,-.09,.42,-.36,.54,-.57],["c",.18,-.42,.27,-.9,.3,-1.95],["c",.03,-1.2,-.06,-1.8,-.36,-2.37],["c",-.24,-.48,-.63,-.81,-1.14,-.96],["c",-.3,-.06,-1.08,-.06,-1.38,.03],["c",-.6,.15,-.9,.42,-.96,.84],["c",-.03,.3,.06,.45,.63,.84],["c",.33,.24,.42,.39,.45,.63],["c",.03,.72,-.57,1.5,-1.32,1.65],["c",-1.05,.27,-2.1,-.57,-2.1,-1.65],["c",0,-.45,.15,-.96,.39,-1.38],["c",.12,-.21,.54,-.63,.81,-.81],["c",.57,-.42,1.38,-.69,2.25,-.81],["z"]],w:9.735,h:14.967},4:{d:[["M",8.64,-14.94],["c",.27,-.09,.42,-.12,.54,-.03],["c",.09,.06,.15,.21,.15,.3],["c",-.03,.06,-1.92,2.31,-4.23,5.04],["c",-2.31,2.73,-4.23,4.98,-4.26,5.01],["c",-.03,.06,.12,.06,2.55,.06],["l",2.61,0],["l",0,-2.37],["c",0,-2.19,.03,-2.37,.06,-2.46],["c",.03,-.06,.21,-.18,.57,-.42],["c",1.08,-.72,1.38,-1.08,1.86,-2.16],["c",.12,-.3,.24,-.54,.27,-.57],["c",.12,-.12,.39,-.06,.45,.12],["c",.06,.09,.06,.57,.06,3.96],["l",0,3.9],["l",1.08,0],["c",1.05,0,1.11,0,1.2,.06],["c",.24,.15,.24,.54,0,.69],["c",-.09,.06,-.15,.06,-1.2,.06],["l",-1.08,0],["l",0,.33],["c",0,.57,.09,1.11,.3,1.53],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.21,-.42,.3,-.96,.3,-1.53],["l",0,-.33],["l",-2.7,0],["c",-2.91,0,-2.85,0,-3.09,-.15],["c",-.18,-.12,-.3,-.39,-.27,-.54],["c",.03,-.06,.18,-.24,.33,-.45],["c",.75,-.9,1.59,-2.07,2.13,-3.03],["c",.33,-.54,.84,-1.62,1.05,-2.16],["c",.57,-1.41,.84,-2.64,.9,-4.05],["c",.03,-.63,.06,-.72,.24,-.81],["l",.12,-.06],["l",.45,.12],["c",.66,.18,1.02,.24,1.47,.27],["c",.6,.03,1.23,-.09,2.01,-.33],["z"]],w:11.795,h:14.994},5:{d:[["M",1.02,-14.94],["c",.12,-.09,.03,-.09,1.08,.06],["c",2.49,.36,4.35,.36,6.96,-.06],["c",.57,-.09,.66,-.06,.81,.06],["c",.15,.18,.12,.24,-.15,.51],["c",-1.29,1.26,-3.24,2.04,-5.58,2.31],["c",-.6,.09,-1.2,.12,-1.71,.12],["c",-.39,0,-.45,0,-.57,.06],["c",-.09,.06,-.15,.12,-.21,.21],["l",-.06,.12],["l",0,1.65],["l",0,1.65],["l",.21,-.21],["c",.66,-.57,1.41,-.96,2.19,-1.14],["c",.33,-.06,1.41,-.06,1.95,0],["c",2.61,.36,4.02,1.74,4.26,4.14],["c",.03,.45,.03,1.08,-.03,1.44],["c",-.18,1.02,-.78,2.01,-1.59,2.7],["c",-.72,.57,-1.62,1.02,-2.49,1.2],["c",-1.38,.27,-3.03,.06,-4.2,-.54],["c",-1.08,-.54,-1.71,-1.32,-1.86,-2.28],["c",-.09,-.69,.09,-1.29,.57,-1.74],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.18,.12,-.36,.3,-.42,.33],["c",-.36,.42,-.18,.99,.36,1.26],["c",.51,.27,1.47,.36,2.01,.27],["c",.93,-.21,1.47,-1.17,1.65,-2.91],["c",.06,-.45,.06,-1.89,0,-2.31],["c",-.15,-1.2,-.51,-2.1,-1.05,-2.55],["c",-.21,-.18,-.54,-.36,-.81,-.39],["c",-.3,-.06,-.84,-.03,-1.26,.06],["c",-.93,.18,-1.65,.6,-2.16,1.2],["c",-.15,.21,-.27,.3,-.39,.3],["c",-.15,0,-.3,-.09,-.36,-.18],["c",-.06,-.09,-.06,-.15,-.06,-3.66],["c",0,-3.39,0,-3.57,.06,-3.66],["c",.03,-.06,.09,-.15,.15,-.18],["z"]],w:10.212,h:14.997},6:{d:[["M",4.98,-14.97],["c",.36,-.03,1.2,0,1.59,.06],["c",.9,.15,1.68,.51,2.25,1.05],["c",.57,.51,.87,1.23,.84,1.98],["c",-.03,.51,-.21,.9,-.6,1.26],["c",-.24,.24,-.45,.39,-.75,.51],["c",-.21,.06,-.27,.06,-.6,.06],["c",-.33,0,-.39,0,-.6,-.06],["c",-.3,-.12,-.51,-.27,-.75,-.51],["c",-.39,-.36,-.57,-.78,-.57,-1.26],["c",0,-.27,0,-.3,.09,-.42],["c",.03,-.09,.18,-.21,.3,-.3],["c",.12,-.09,.3,-.21,.39,-.27],["c",.09,-.06,.21,-.18,.27,-.24],["c",.06,-.12,.09,-.15,.09,-.33],["c",0,-.18,-.03,-.24,-.09,-.36],["c",-.24,-.39,-.75,-.6,-1.38,-.57],["c",-.54,.03,-.9,.18,-1.23,.48],["c",-.81,.72,-1.08,2.16,-.96,5.37],["l",0,.63],["l",.3,-.12],["c",.78,-.27,1.29,-.33,2.1,-.27],["c",1.47,.12,2.49,.54,3.27,1.29],["c",.48,.51,.81,1.11,.96,1.89],["c",.06,.27,.06,.42,.06,.93],["c",0,.54,0,.69,-.06,.96],["c",-.15,.78,-.48,1.38,-.96,1.89],["c",-.54,.51,-1.17,.87,-1.98,1.08],["c",-1.14,.3,-2.4,.33,-3.24,.03],["c",-1.5,-.48,-2.64,-1.89,-3.27,-4.02],["c",-.36,-1.23,-.51,-2.82,-.42,-4.08],["c",.3,-3.66,2.28,-6.3,4.95,-6.66],["z"],["m",.66,7.41],["c",-.27,-.09,-.81,-.12,-1.08,-.06],["c",-.72,.18,-1.08,.69,-1.23,1.71],["c",-.06,.54,-.06,3,0,3.54],["c",.18,1.26,.72,1.77,1.8,1.74],["c",.39,-.03,.63,-.09,.9,-.27],["c",.66,-.42,.9,-1.32,.9,-3.24],["c",0,-2.22,-.36,-3.12,-1.29,-3.42],["z"]],w:9.956,h:14.982},7:{d:[["M",.21,-14.97],["c",.21,-.06,.45,0,.54,.15],["c",.06,.09,.06,.15,.06,.39],["c",0,.24,0,.33,.06,.42],["c",.06,.12,.21,.24,.27,.24],["c",.03,0,.12,-.12,.24,-.21],["c",.96,-1.2,2.58,-1.35,3.99,-.42],["c",.15,.12,.42,.3,.54,.45],["c",.48,.39,.81,.57,1.29,.6],["c",.69,.03,1.5,-.3,2.13,-.87],["c",.09,-.09,.27,-.3,.39,-.45],["c",.12,-.15,.24,-.27,.3,-.3],["c",.18,-.06,.39,.03,.51,.21],["c",.06,.18,.06,.24,-.27,.72],["c",-.18,.24,-.54,.78,-.78,1.17],["c",-2.37,3.54,-3.54,6.27,-3.87,9],["c",-.03,.33,-.03,.66,-.03,1.26],["c",0,.9,0,1.08,.15,1.89],["c",.06,.45,.06,.48,.03,.6],["c",-.06,.09,-.21,.21,-.3,.21],["c",-.03,0,-.27,-.06,-.54,-.15],["c",-.84,-.27,-1.11,-.3,-1.65,-.3],["c",-.57,0,-.84,.03,-1.56,.27],["c",-.6,.18,-.69,.21,-.81,.15],["c",-.12,-.06,-.21,-.18,-.21,-.3],["c",0,-.15,.6,-1.44,1.2,-2.61],["c",1.14,-2.22,2.73,-4.68,5.1,-8.01],["c",.21,-.27,.36,-.48,.33,-.48],["c",0,0,-.12,.06,-.27,.12],["c",-.54,.3,-.99,.39,-1.56,.39],["c",-.75,.03,-1.2,-.18,-1.83,-.75],["c",-.99,-.9,-1.83,-1.17,-2.31,-.72],["c",-.18,.15,-.36,.51,-.45,.84],["c",-.06,.24,-.06,.33,-.09,1.98],["c",0,1.62,-.03,1.74,-.06,1.8],["c",-.15,.24,-.54,.24,-.69,0],["c",-.06,-.09,-.06,-.15,-.06,-3.57],["c",0,-3.42,0,-3.48,.06,-3.57],["c",.03,-.06,.09,-.12,.15,-.15],["z"]],w:10.561,h:15.093},8:{d:[["M",4.98,-14.97],["c",.33,-.03,1.02,-.03,1.32,0],["c",1.32,.12,2.49,.6,3.21,1.32],["c",.39,.39,.66,.81,.78,1.29],["c",.09,.36,.09,1.08,0,1.44],["c",-.21,.84,-.66,1.59,-1.59,2.55],["l",-.3,.3],["l",.27,.18],["c",1.47,.93,2.31,2.31,2.25,3.75],["c",-.03,.75,-.24,1.35,-.63,1.95],["c",-.45,.66,-1.02,1.14,-1.83,1.53],["c",-1.8,.87,-4.2,.87,-6,.03],["c",-1.62,-.78,-2.52,-2.16,-2.46,-3.66],["c",.06,-.99,.54,-1.77,1.8,-2.97],["c",.54,-.51,.54,-.54,.48,-.57],["c",-.39,-.27,-.96,-.78,-1.2,-1.14],["c",-.75,-1.11,-.87,-2.4,-.3,-3.6],["c",.69,-1.35,2.25,-2.25,4.2,-2.4],["z"],["m",1.53,.69],["c",-.42,-.09,-1.11,-.12,-1.38,-.06],["c",-.3,.06,-.6,.18,-.81,.3],["c",-.21,.12,-.6,.51,-.72,.72],["c",-.51,.87,-.42,1.89,.21,2.52],["c",.21,.21,.36,.3,1.95,1.23],["c",.96,.54,1.74,.99,1.77,1.02],["c",.09,0,.63,-.6,.99,-1.11],["c",.21,-.36,.48,-.87,.57,-1.23],["c",.06,-.24,.06,-.36,.06,-.72],["c",0,-.45,-.03,-.66,-.15,-.99],["c",-.39,-.81,-1.29,-1.44,-2.49,-1.68],["z"],["m",-1.44,8.07],["l",-1.89,-1.08],["c",-.03,0,-.18,.15,-.39,.33],["c",-1.2,1.08,-1.65,1.95,-1.59,3],["c",.09,1.59,1.35,2.85,3.21,3.24],["c",.33,.06,.45,.06,.93,.06],["c",.63,0,.81,-.03,1.29,-.27],["c",.9,-.42,1.47,-1.41,1.41,-2.4],["c",-.06,-.66,-.39,-1.29,-.9,-1.65],["c",-.12,-.09,-1.05,-.63,-2.07,-1.23],["z"]],w:10.926,h:14.989},9:{d:[["M",4.23,-14.97],["c",.42,-.03,1.29,0,1.62,.06],["c",.51,.12,.93,.3,1.38,.57],["c",1.53,1.02,2.52,3.24,2.73,5.94],["c",.18,2.55,-.48,4.98,-1.83,6.57],["c",-1.05,1.26,-2.4,1.89,-3.93,1.83],["c",-1.23,-.06,-2.31,-.45,-3.03,-1.14],["c",-.57,-.51,-.87,-1.23,-.84,-1.98],["c",.03,-.51,.21,-.9,.6,-1.26],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.39,.36,.57,.78,.57,1.26],["c",0,.27,0,.3,-.09,.42],["c",-.03,.09,-.18,.21,-.3,.3],["c",-.12,.09,-.3,.21,-.39,.27],["c",-.09,.06,-.21,.18,-.27,.24],["c",-.06,.12,-.06,.15,-.06,.33],["c",0,.18,0,.24,.06,.36],["c",.24,.39,.75,.6,1.38,.57],["c",.54,-.03,.9,-.18,1.23,-.48],["c",.81,-.72,1.08,-2.16,.96,-5.37],["l",0,-.63],["l",-.3,.12],["c",-.78,.27,-1.29,.33,-2.1,.27],["c",-1.47,-.12,-2.49,-.54,-3.27,-1.29],["c",-.48,-.51,-.81,-1.11,-.96,-1.89],["c",-.06,-.27,-.06,-.42,-.06,-.96],["c",0,-.51,0,-.66,.06,-.93],["c",.15,-.78,.48,-1.38,.96,-1.89],["c",.15,-.12,.33,-.27,.42,-.36],["c",.69,-.51,1.62,-.81,2.76,-.93],["z"],["m",1.17,.66],["c",-.21,-.06,-.57,-.06,-.81,-.03],["c",-.78,.12,-1.26,.69,-1.41,1.74],["c",-.12,.63,-.15,1.95,-.09,2.79],["c",.12,1.71,.63,2.4,1.77,2.46],["c",1.08,.03,1.62,-.48,1.8,-1.74],["c",.06,-.54,.06,-3,0,-3.54],["c",-.15,-1.05,-.51,-1.53,-1.26,-1.68],["z"]],w:9.959,h:14.986},"rests.multimeasure":{d:[["M",0,-4],["l",0,16],["l",1,0],["l",0,-5],["l",40,0],["l",0,5],["l",1,0],["l",0,-16],["l",-1,0],["l",0,5],["l",-40,0],["l",0,-5],["z"]],w:42,h:18},"rests.whole":{d:[["M",.06,.03],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.half":{d:[["M",.06,-4.62],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.quarter":{d:[["M",1.89,-11.82],["c",.12,-.06,.24,-.06,.36,-.03],["c",.09,.06,4.74,5.58,4.86,5.82],["c",.21,.39,.15,.78,-.15,1.26],["c",-.24,.33,-.72,.81,-1.62,1.56],["c",-.45,.36,-.87,.75,-.96,.84],["c",-.93,.99,-1.14,2.49,-.6,3.63],["c",.18,.39,.27,.48,1.32,1.68],["c",1.92,2.25,1.83,2.16,1.83,2.34],["c",0,.18,-.18,.36,-.36,.39],["c",-.15,0,-.27,-.06,-.48,-.27],["c",-.75,-.75,-2.46,-1.29,-3.39,-1.08],["c",-.45,.09,-.69,.27,-.9,.69],["c",-.12,.3,-.21,.66,-.24,1.14],["c",-.03,.66,.09,1.35,.3,2.01],["c",.15,.42,.24,.66,.45,.96],["c",.18,.24,.18,.33,.03,.42],["c",-.12,.06,-.18,.03,-.45,-.3],["c",-1.08,-1.38,-2.07,-3.36,-2.4,-4.83],["c",-.27,-1.05,-.15,-1.77,.27,-2.07],["c",.21,-.12,.42,-.15,.87,-.15],["c",.87,.06,2.1,.39,3.3,.9],["l",.39,.18],["l",-1.65,-1.95],["c",-2.52,-2.97,-2.61,-3.09,-2.7,-3.27],["c",-.09,-.24,-.12,-.48,-.03,-.75],["c",.15,-.48,.57,-.96,1.83,-2.01],["c",.45,-.36,.84,-.72,.93,-.78],["c",.69,-.75,1.02,-1.8,.9,-2.79],["c",-.06,-.33,-.21,-.84,-.39,-1.11],["c",-.09,-.15,-.45,-.6,-.81,-1.05],["c",-.36,-.42,-.69,-.81,-.72,-.87],["c",-.09,-.18,0,-.42,.21,-.51],["z"]],w:7.888,h:21.435},"rests.8th":{d:[["M",1.68,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.33,-.09],["c",.39,-.18,1.32,-1.29,1.68,-1.98],["c",.09,-.21,.24,-.3,.39,-.3],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.27,1.11,-1.86,6.42],["c",-1.02,3.48,-1.89,6.39,-1.92,6.42],["c",0,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.15,-.57,1.68,-4.92],["c",.96,-2.67,1.74,-4.89,1.71,-4.89],["l",-.51,.15],["c",-1.08,.36,-1.74,.48,-2.55,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:7.534,h:13.883},"rests.16th":{d:[["M",3.33,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.87,.42],["c",.39,-.18,1.2,-1.23,1.62,-2.07],["c",.06,-.15,.24,-.24,.36,-.24],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.45,1.86,-2.67,10.17],["c",-1.5,5.55,-2.73,10.14,-2.76,10.17],["c",-.03,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.12,-.57,1.44,-4.92],["c",.81,-2.67,1.47,-4.86,1.47,-4.89],["c",-.03,0,-.27,.06,-.54,.15],["c",-1.08,.36,-1.77,.48,-2.58,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.12,0,.18,0,.33,-.09],["c",.33,-.15,1.02,-.93,1.41,-1.59],["c",.12,-.21,.18,-.39,.39,-1.08],["c",.66,-2.1,1.17,-3.84,1.17,-3.87],["c",0,0,-.21,.06,-.42,.15],["c",-.51,.15,-1.2,.33,-1.68,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:9.724,h:21.383},"rests.32nd":{d:[["M",4.23,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.27,-.06],["c",.33,-.21,.99,-1.11,1.44,-1.98],["c",.09,-.24,.21,-.33,.39,-.33],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.57,2.67,-3.21,13.89],["c",-1.8,7.62,-3.3,13.89,-3.3,13.92],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.09,-.57,1.23,-4.92],["c",.69,-2.67,1.26,-4.86,1.29,-4.89],["c",0,-.03,-.12,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.12,.09,.3,.18,.48,.21],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.29,-1.29,1.56,-1.89],["c",.03,-.12,1.23,-4.59,1.23,-4.65],["c",0,-.03,-.18,.03,-.39,.12],["c",-.63,.18,-1.2,.36,-1.74,.45],["c",-.39,.06,-.54,.06,-1.02,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.18,.18,.51,.27,.72,.15],["c",.3,-.12,.69,-.57,1.08,-1.17],["c",.42,-.6,.39,-.51,1.05,-3.03],["c",.33,-1.26,.6,-2.31,.6,-2.34],["c",0,0,-.21,.03,-.45,.12],["c",-.57,.18,-1.14,.33,-1.62,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:11.373,h:28.883},"rests.64th":{d:[["M",5.13,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.54,.3,.75,.18],["c",.24,-.12,.63,-.66,1.08,-1.56],["c",.33,-.66,.39,-.72,.6,-.72],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.69,3.66,-3.54,17.64],["c",-1.95,9.66,-3.57,17.61,-3.57,17.64],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.06,-.57,1.05,-4.95],["c",.6,-2.7,1.08,-4.89,1.08,-4.92],["c",0,0,-.24,.06,-.51,.15],["c",-.66,.24,-1.2,.36,-1.77,.48],["c",-.42,.06,-.57,.06,-1.05,.06],["c",-.69,0,-.87,-.03,-1.35,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.21,.03,.39,-.09,.72,-.42],["c",.45,-.45,1.02,-1.26,1.17,-1.65],["c",.03,-.09,.27,-1.14,.54,-2.34],["c",.27,-1.2,.48,-2.19,.51,-2.22],["c",0,-.03,-.09,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.9,.42],["c",.36,-.18,1.2,-1.26,1.47,-1.89],["c",.03,-.09,.3,-1.2,.57,-2.43],["l",.51,-2.28],["l",-.54,.18],["c",-1.11,.36,-1.8,.48,-2.61,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.21,.21,.54,.3,.75,.18],["c",.36,-.18,.93,-.93,1.29,-1.68],["c",.12,-.24,.18,-.48,.63,-2.55],["l",.51,-2.31],["c",0,-.03,-.18,.03,-.39,.12],["c",-1.14,.36,-2.1,.54,-2.82,.51],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.453,h:36.383},"rests.128th":{d:[["M",6.03,-21.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.21,0,.33,-.06,.54,-.36],["c",.15,-.21,.54,-.93,.78,-1.47],["c",.15,-.33,.18,-.39,.3,-.48],["c",.18,-.09,.45,0,.51,.15],["c",.03,.09,-7.11,42.75,-7.17,42.84],["c",-.03,.03,-.15,.09,-.24,.15],["c",-.18,.06,-.24,.06,-.45,.06],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.03,-.57,.84,-4.98],["c",.51,-2.7,.93,-4.92,.9,-4.92],["c",0,0,-.15,.06,-.36,.12],["c",-.78,.27,-1.62,.48,-2.31,.57],["c",-.15,.03,-.54,.03,-.81,.03],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.63,.48],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.14,-1.11,1.5,-1.83],["c",.12,-.27,.12,-.27,.54,-2.52],["c",.24,-1.23,.42,-2.25,.39,-2.25],["c",0,0,-.24,.06,-.51,.18],["c",-1.26,.39,-2.25,.57,-3.06,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.51,.3,.75,.18],["c",.36,-.15,1.05,-.99,1.41,-1.77],["l",.15,-.3],["l",.42,-2.25],["c",.21,-1.26,.42,-2.28,.39,-2.28],["l",-.51,.15],["c",-1.11,.39,-1.89,.51,-2.7,.51],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.18,.48,.27,.72,.21],["c",.33,-.12,1.14,-1.26,1.41,-1.95],["c",0,-.09,.21,-1.11,.45,-2.34],["c",.21,-1.2,.39,-2.22,.39,-2.28],["c",.03,-.03,0,-.03,-.45,.12],["c",-.57,.18,-1.2,.33,-1.71,.42],["c",-.3,.06,-.51,.06,-.93,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.18,0,.36,-.09,.57,-.33],["c",.33,-.36,.78,-1.14,.93,-1.56],["c",.03,-.12,.24,-1.2,.45,-2.4],["c",.24,-1.2,.42,-2.22,.42,-2.28],["c",.03,-.03,0,-.03,-.39,.09],["c",-1.05,.36,-1.8,.48,-2.58,.48],["c",-.63,0,-.84,-.03,-1.29,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.992,h:43.883},"accidentals.sharp":{d:[["M",5.73,-11.19],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.31],["c",0,1.23,0,2.22,.03,2.22],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.43],["c",0,1.32,0,2.43,.03,2.43],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.52],["c",0,2.28,-.03,2.55,-.06,2.64],["c",-.21,.36,-.72,.36,-.93,0],["c",-.03,-.09,-.06,-.33,-.06,-2.43],["l",0,-2.31],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.43],["c",0,2.58,0,2.52,-.15,2.67],["c",-.06,.09,-.27,.18,-.36,.18],["c",-.12,0,-.33,-.09,-.39,-.18],["c",-.15,-.15,-.15,-.09,-.15,-2.43],["c",0,-1.23,0,-2.22,-.03,-2.22],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.43],["c",0,-1.32,0,-2.43,-.03,-2.43],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.52],["c",0,-2.28,.03,-2.55,.06,-2.64],["c",.21,-.36,.72,-.36,.93,0],["c",.03,.09,.06,.33,.06,2.43],["l",.03,2.31],["l",1.26,-.51],["l",1.26,-.51],["l",0,-2.43],["c",0,-2.28,0,-2.43,.06,-2.55],["c",.06,-.12,.12,-.18,.27,-.24],["z"],["m",-.33,10.65],["l",0,-2.43],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.46],["l",0,2.43],["l",.09,-.03],["c",.06,-.03,.63,-.27,1.29,-.51],["l",1.17,-.48],["l",0,-2.46],["z"]],w:8.25,h:22.462},"accidentals.halfsharp":{d:[["M",2.43,-10.05],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.01],["c",0,1.05,0,1.89,.03,1.89],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.37],["c",0,1.32,0,2.37,.03,2.37],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.25],["c",0,1.95,0,2.28,-.06,2.37],["c",-.06,.12,-.12,.21,-.24,.27],["c",-.27,.12,-.54,.03,-.69,-.24],["c",-.06,-.12,-.06,-.21,-.06,-2.01],["c",0,-1.05,0,-1.89,-.03,-1.89],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.37],["c",0,-1.32,0,-2.37,-.03,-2.37],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.25],["c",0,-2.13,0,-2.28,.06,-2.4],["c",.06,-.12,.12,-.18,.27,-.24],["z"]],w:5.25,h:20.174},"accidentals.nat":{d:[["M",.21,-11.4],["c",.24,-.06,.78,0,.99,.15],["c",.03,.03,.03,.48,0,2.61],["c",-.03,1.44,-.03,2.61,-.03,2.61],["c",0,.03,.75,-.09,1.68,-.24],["c",.96,-.18,1.71,-.27,1.74,-.27],["c",.15,.03,.27,.15,.36,.3],["l",.06,.12],["l",.09,8.67],["c",.09,6.96,.12,8.67,.09,8.67],["c",-.03,.03,-.12,.06,-.21,.09],["c",-.24,.09,-.72,.09,-.96,0],["c",-.09,-.03,-.18,-.06,-.21,-.09],["c",-.03,-.03,-.03,-.48,0,-2.61],["c",.03,-1.44,.03,-2.61,.03,-2.61],["c",0,-.03,-.75,.09,-1.68,.24],["c",-.96,.18,-1.71,.27,-1.74,.27],["c",-.15,-.03,-.27,-.15,-.36,-.3],["l",-.06,-.15],["l",-.09,-7.53],["c",-.06,-4.14,-.09,-8.04,-.12,-8.67],["l",0,-1.11],["l",.15,-.06],["c",.09,-.03,.21,-.06,.27,-.09],["z"],["m",3.75,8.4],["c",0,-.33,0,-.42,-.03,-.42],["c",-.12,0,-2.79,.45,-2.79,.48],["c",-.03,0,-.09,6.3,-.09,6.33],["c",.03,0,2.79,-.45,2.82,-.48],["c",0,0,.09,-4.53,.09,-5.91],["z"]],w:5.4,h:22.8},"accidentals.flat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:6.75,h:18.801},"accidentals.halfflat":{d:[["M",4.83,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.6,-.12,9.06],["c",-.09,5.55,-.15,9.06,-.18,9.12],["c",-.03,.09,-.09,.18,-.15,.27],["c",-.24,.21,-.54,.24,-.81,.06],["c",-.06,-.03,-.27,-.24,-.45,-.42],["c",-.36,-.42,-.66,-.66,-1.8,-1.44],["c",-1.23,-.84,-1.83,-1.32,-2.25,-1.77],["c",-.66,-.78,-.96,-1.56,-.93,-2.46],["c",.09,-1.41,1.11,-2.58,2.4,-2.79],["c",.3,-.06,.84,-.03,1.23,.06],["c",.54,.12,1.08,.33,1.53,.63],["c",.12,.09,.24,.15,.24,.12],["c",0,0,-.12,-8.37,-.18,-9.75],["l",0,-.66],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",-1.65,10.95],["c",-.6,-.18,-1.08,.09,-1.38,.69],["c",-.27,.6,-.36,1.38,-.18,2.07],["c",.12,.42,.42,.99,.72,1.41],["c",.3,.42,.93,1.05,1.56,1.59],["l",.48,.39],["l",0,-.12],["c",.03,-.09,.03,-.48,.06,-.9],["c",.03,-.57,.03,-1.08,0,-2.22],["c",-.03,-1.62,-.03,-1.62,-.24,-2.07],["c",-.21,-.42,-.6,-.75,-1.02,-.84],["z"]],w:6.728,h:18.801},"accidentals.dblflat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"],["m",3,-11],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:12.1,h:18.804},"accidentals.dblsharp":{d:[["M",-.18,-3.96],["c",.06,-.03,.12,-.06,.15,-.06],["c",.09,0,2.76,.27,2.79,.3],["c",.12,.03,.15,.12,.15,.51],["c",.06,.96,.24,1.59,.57,2.1],["c",.06,.09,.15,.21,.18,.24],["l",.09,.06],["l",.09,-.06],["c",.03,-.03,.12,-.15,.18,-.24],["c",.33,-.51,.51,-1.14,.57,-2.1],["c",0,-.39,.03,-.45,.12,-.51],["c",.03,0,.66,-.09,1.44,-.15],["c",1.47,-.15,1.5,-.15,1.56,-.03],["c",.03,.06,0,.42,-.09,1.44],["c",-.09,.72,-.15,1.35,-.15,1.38],["c",0,.03,-.03,.09,-.06,.12],["c",-.06,.06,-.12,.09,-.51,.09],["c",-1.08,.06,-1.8,.3,-2.28,.75],["l",-.12,.09],["l",.09,.09],["c",.12,.15,.39,.33,.63,.45],["c",.42,.18,.96,.27,1.68,.33],["c",.39,0,.45,.03,.51,.09],["c",.03,.03,.06,.09,.06,.12],["c",0,.03,.06,.66,.15,1.38],["c",.09,1.02,.12,1.38,.09,1.44],["c",-.06,.12,-.09,.12,-1.56,-.03],["c",-.78,-.06,-1.41,-.15,-1.44,-.15],["c",-.09,-.06,-.12,-.12,-.12,-.54],["c",-.06,-.93,-.24,-1.56,-.57,-2.07],["c",-.06,-.09,-.15,-.21,-.18,-.24],["l",-.09,-.06],["l",-.09,.06],["c",-.03,.03,-.12,.15,-.18,.24],["c",-.33,.51,-.51,1.14,-.57,2.07],["c",0,.42,-.03,.48,-.12,.54],["c",-.03,0,-.66,.09,-1.44,.15],["c",-1.47,.15,-1.5,.15,-1.56,.03],["c",-.03,-.06,0,-.42,.09,-1.44],["c",.09,-.72,.15,-1.35,.15,-1.38],["c",0,-.03,.03,-.09,.06,-.12],["c",.06,-.06,.12,-.09,.51,-.09],["c",.72,-.06,1.26,-.15,1.68,-.33],["c",.24,-.12,.51,-.3,.63,-.45],["l",.09,-.09],["l",-.12,-.09],["c",-.48,-.45,-1.2,-.69,-2.28,-.75],["c",-.39,0,-.45,-.03,-.51,-.09],["c",-.03,-.03,-.06,-.09,-.06,-.12],["c",0,-.03,-.06,-.63,-.12,-1.38],["c",-.09,-.72,-.15,-1.35,-.15,-1.38],["z"]],w:7.95,h:7.977},"dots.dot":{d:[["M",1.32,-1.68],["c",.09,-.03,.27,-.06,.39,-.06],["c",.96,0,1.74,.78,1.74,1.71],["c",0,.96,-.78,1.74,-1.71,1.74],["c",-.96,0,-1.74,-.78,-1.74,-1.71],["c",0,-.78,.54,-1.5,1.32,-1.68],["z"]],w:3.45,h:3.45},"noteheads.dbl":{d:[["M",-.69,-4.02],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["c",.06,.15,.06,.18,.06,1.41],["l",0,1.23],["l",.12,-.18],["c",.72,-1.26,2.64,-2.31,4.86,-2.64],["c",.81,-.15,1.11,-.15,2.13,-.15],["c",.99,0,1.29,0,2.1,.15],["c",.75,.12,1.38,.27,2.04,.54],["c",1.35,.51,2.34,1.26,2.82,2.1],["l",.12,.18],["l",0,-1.23],["c",0,-1.2,0,-1.26,.06,-1.38],["c",.09,-.18,.15,-.24,.33,-.33],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,3.54],["l",0,3.54],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.38],["l",0,-1.23],["l",-.12,.18],["c",-.48,.84,-1.47,1.59,-2.82,2.1],["c",-.84,.33,-1.71,.54,-2.85,.66],["c",-.45,.06,-2.16,.06,-2.61,0],["c",-1.14,-.12,-2.01,-.33,-2.85,-.66],["c",-1.35,-.51,-2.34,-1.26,-2.82,-2.1],["l",-.12,-.18],["l",0,1.23],["c",0,1.23,0,1.26,-.06,1.38],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-3.54],["c",0,-3.48,0,-3.54,.06,-3.66],["c",.09,-.18,.15,-.24,.33,-.33],["z"],["m",7.71,.63],["c",-.36,-.06,-.9,-.06,-1.14,0],["c",-.3,.03,-.66,.24,-.87,.42],["c",-.6,.54,-.9,1.62,-.75,2.82],["c",.12,.93,.51,1.68,1.11,2.31],["c",.75,.72,1.83,1.2,2.85,1.26],["c",1.05,.06,1.83,-.54,2.1,-1.65],["c",.21,-.9,.12,-1.95,-.24,-2.82],["c",-.36,-.81,-1.08,-1.53,-1.95,-1.95],["c",-.3,-.15,-.78,-.3,-1.11,-.39],["z"]],w:16.83,h:8.145},"noteheads.whole":{d:[["M",6.51,-4.05],["c",.51,-.03,2.01,0,2.52,.03],["c",1.41,.18,2.64,.51,3.72,1.08],["c",1.2,.63,1.95,1.41,2.19,2.31],["c",.09,.33,.09,.9,0,1.23],["c",-.24,.9,-.99,1.68,-2.19,2.31],["c",-1.08,.57,-2.28,.9,-3.75,1.08],["c",-.66,.06,-2.31,.06,-2.97,0],["c",-1.47,-.18,-2.67,-.51,-3.75,-1.08],["c",-1.2,-.63,-1.95,-1.41,-2.19,-2.31],["c",-.09,-.33,-.09,-.9,0,-1.23],["c",.24,-.9,.99,-1.68,2.19,-2.31],["c",1.2,-.63,2.61,-.99,4.23,-1.11],["z"],["m",.57,.66],["c",-.87,-.15,-1.53,0,-2.04,.51],["c",-.15,.15,-.24,.27,-.33,.48],["c",-.24,.51,-.36,1.08,-.33,1.77],["c",.03,.69,.18,1.26,.42,1.77],["c",.6,1.17,1.74,1.98,3.18,2.22],["c",1.11,.21,1.95,-.15,2.34,-.99],["c",.24,-.51,.36,-1.08,.33,-1.8],["c",-.06,-1.11,-.45,-2.04,-1.17,-2.76],["c",-.63,-.63,-1.47,-1.05,-2.4,-1.2],["z"]],w:14.985,h:8.097},"noteheads.half":{d:[["M",7.44,-4.05],["c",.06,-.03,.27,-.03,.48,-.03],["c",1.05,0,1.71,.24,2.1,.81],["c",.42,.6,.45,1.35,.18,2.4],["c",-.42,1.59,-1.14,2.73,-2.16,3.39],["c",-1.41,.93,-3.18,1.44,-5.4,1.53],["c",-1.17,.03,-1.89,-.21,-2.28,-.81],["c",-.42,-.6,-.45,-1.35,-.18,-2.4],["c",.42,-1.59,1.14,-2.73,2.16,-3.39],["c",.63,-.42,1.23,-.72,1.98,-.96],["c",.9,-.3,1.65,-.42,3.12,-.54],["z"],["m",1.29,.87],["c",-.27,-.09,-.63,-.12,-.9,-.03],["c",-.72,.24,-1.53,.69,-3.27,1.8],["c",-2.34,1.5,-3.3,2.25,-3.57,2.79],["c",-.36,.72,-.06,1.5,.66,1.77],["c",.24,.12,.69,.09,.99,0],["c",.84,-.3,1.92,-.93,4.14,-2.37],["c",1.62,-1.08,2.37,-1.71,2.61,-2.19],["c",.36,-.72,.06,-1.5,-.66,-1.77],["z"]],w:10.37,h:8.132},"noteheads.quarter":{d:[["M",6.09,-4.05],["c",.36,-.03,1.2,0,1.53,.06],["c",1.17,.24,1.89,.84,2.16,1.83],["c",.06,.18,.06,.3,.06,.66],["c",0,.45,0,.63,-.15,1.08],["c",-.66,2.04,-3.06,3.93,-5.52,4.38],["c",-.54,.09,-1.44,.09,-1.83,.03],["c",-1.23,-.27,-1.98,-.87,-2.25,-1.86],["c",-.06,-.18,-.06,-.3,-.06,-.66],["c",0,-.45,0,-.63,.15,-1.08],["c",.24,-.78,.75,-1.53,1.44,-2.22],["c",1.2,-1.2,2.85,-2.01,4.47,-2.22],["z"]],w:9.81,h:8.094},"noteheads.slash.nostem":{d:[["M",9.3,-7.77],["c",.06,-.06,.18,-.06,1.71,-.06],["l",1.65,0],["l",.09,.09],["c",.06,.06,.06,.09,.06,.15],["c",-.03,.12,-9.21,15.24,-9.3,15.33],["c",-.06,.06,-.18,.06,-1.71,.06],["l",-1.65,0],["l",-.09,-.09],["c",-.06,-.06,-.06,-.09,-.06,-.15],["c",.03,-.12,9.21,-15.24,9.3,-15.33],["z"]],w:12.81,h:15.63},"noteheads.indeterminate":{d:[["M",.78,-4.05],["c",.12,-.03,.24,-.03,.36,.03],["c",.03,.03,.93,.72,1.95,1.56],["l",1.86,1.5],["l",1.86,-1.5],["c",1.02,-.84,1.92,-1.53,1.95,-1.56],["c",.21,-.12,.33,-.09,.75,.24],["c",.3,.27,.36,.36,.36,.54],["c",0,.03,-.03,.12,-.06,.18],["c",-.03,.06,-.9,.75,-1.89,1.56],["l",-1.8,1.47],["c",0,.03,.81,.69,1.8,1.5],["c",.99,.81,1.86,1.5,1.89,1.56],["c",.03,.06,.06,.15,.06,.18],["c",0,.18,-.06,.27,-.36,.54],["c",-.42,.33,-.54,.36,-.75,.24],["c",-.03,-.03,-.93,-.72,-1.95,-1.56],["l",-1.86,-1.5],["l",-1.86,1.5],["c",-1.02,.84,-1.92,1.53,-1.95,1.56],["c",-.21,.12,-.33,.09,-.75,-.24],["c",-.3,-.27,-.36,-.36,-.36,-.54],["c",0,-.03,.03,-.12,.06,-.18],["c",.03,-.06,.9,-.75,1.89,-1.56],["l",1.8,-1.47],["c",0,-.03,-.81,-.69,-1.8,-1.5],["c",-.99,-.81,-1.86,-1.5,-1.89,-1.56],["c",-.06,-.12,-.09,-.21,-.03,-.36],["c",.03,-.09,.57,-.57,.72,-.63],["z"]],w:9.843,h:8.139},"scripts.ufermata":{d:[["M",-.75,-10.77],["c",.12,0,.45,-.03,.69,-.03],["c",2.91,-.03,5.55,1.53,7.41,4.35],["c",1.17,1.71,1.95,3.72,2.43,6.03],["c",.12,.51,.12,.57,.03,.69],["c",-.12,.21,-.48,.27,-.69,.12],["c",-.12,-.09,-.18,-.24,-.27,-.69],["c",-.78,-3.63,-3.42,-6.54,-6.78,-7.38],["c",-.78,-.21,-1.2,-.24,-2.07,-.24],["c",-.63,0,-.84,0,-1.2,.06],["c",-1.83,.27,-3.42,1.08,-4.8,2.37],["c",-1.41,1.35,-2.4,3.21,-2.85,5.19],["c",-.09,.45,-.15,.6,-.27,.69],["c",-.21,.15,-.57,.09,-.69,-.12],["c",-.09,-.12,-.09,-.18,.03,-.69],["c",.33,-1.62,.78,-3,1.47,-4.38],["c",1.77,-3.54,4.44,-5.67,7.56,-5.97],["z"],["m",.33,7.47],["c",1.38,-.3,2.58,.9,2.31,2.25],["c",-.15,.72,-.78,1.35,-1.47,1.5],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.748,h:11.289},"scripts.dfermata":{d:[["M",-9.63,-.42],["c",.15,-.09,.36,-.06,.51,.03],["c",.12,.09,.18,.24,.27,.66],["c",.78,3.66,3.42,6.57,6.78,7.41],["c",.78,.21,1.2,.24,2.07,.24],["c",.63,0,.84,0,1.2,-.06],["c",1.83,-.27,3.42,-1.08,4.8,-2.37],["c",1.41,-1.35,2.4,-3.21,2.85,-5.22],["c",.09,-.42,.15,-.57,.27,-.66],["c",.21,-.15,.57,-.09,.69,.12],["c",.09,.12,.09,.18,-.03,.69],["c",-.33,1.62,-.78,3,-1.47,4.38],["c",-1.92,3.84,-4.89,6,-8.31,6],["c",-3.42,0,-6.39,-2.16,-8.31,-6],["c",-.48,-.96,-.84,-1.92,-1.14,-2.97],["c",-.18,-.69,-.42,-1.74,-.42,-1.92],["c",0,-.12,.09,-.27,.24,-.33],["z"],["m",9.21,0],["c",1.2,-.27,2.34,.63,2.34,1.86],["c",0,.9,-.66,1.68,-1.5,1.89],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.744,h:11.274},"scripts.sforzato":{d:[["M",-6.45,-3.69],["c",.06,-.03,.15,-.06,.18,-.06],["c",.06,0,2.85,.72,6.24,1.59],["l",6.33,1.65],["c",.33,.06,.45,.21,.45,.51],["c",0,.3,-.12,.45,-.45,.51],["l",-6.33,1.65],["c",-3.39,.87,-6.18,1.59,-6.21,1.59],["c",-.21,0,-.48,-.24,-.51,-.45],["c",0,-.15,.06,-.36,.18,-.45],["c",.09,-.06,.87,-.27,3.84,-1.05],["c",2.04,-.54,3.84,-.99,4.02,-1.02],["c",.15,-.06,1.14,-.24,2.22,-.42],["c",1.05,-.18,1.92,-.36,1.92,-.36],["c",0,0,-.87,-.18,-1.92,-.36],["c",-1.08,-.18,-2.07,-.36,-2.22,-.42],["c",-.18,-.03,-1.98,-.48,-4.02,-1.02],["c",-2.97,-.78,-3.75,-.99,-3.84,-1.05],["c",-.12,-.09,-.18,-.3,-.18,-.45],["c",.03,-.15,.15,-.3,.3,-.39],["z"]],w:13.5,h:7.5},"scripts.staccato":{d:[["M",-.36,-1.47],["c",.93,-.21,1.86,.51,1.86,1.47],["c",0,.93,-.87,1.65,-1.8,1.47],["c",-.54,-.12,-1.02,-.57,-1.14,-1.08],["c",-.21,-.81,.27,-1.65,1.08,-1.86],["z"]],w:2.989,h:3.004},"scripts.tenuto":{d:[["M",-4.2,-.48],["l",.12,-.06],["l",4.08,0],["l",4.08,0],["l",.12,.06],["c",.39,.21,.39,.75,0,.96],["l",-.12,.06],["l",-4.08,0],["l",-4.08,0],["l",-.12,-.06],["c",-.39,-.21,-.39,-.75,0,-.96],["z"]],w:8.985,h:1.08},"scripts.umarcato":{d:[["M",-.15,-8.19],["c",.15,-.12,.36,-.03,.45,.15],["c",.21,.42,3.45,7.65,3.45,7.71],["c",0,.12,-.12,.27,-.21,.3],["c",-.03,.03,-.51,.03,-1.14,.03],["c",-1.05,0,-1.08,0,-1.17,-.06],["c",-.09,-.06,-.24,-.36,-1.17,-2.4],["c",-.57,-1.29,-1.05,-2.34,-1.08,-2.34],["c",0,-.03,-.51,1.02,-1.08,2.34],["c",-.93,2.07,-1.08,2.34,-1.14,2.4],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.06,3.24,-7.32,3.45,-7.71],["c",.03,-.06,.09,-.15,.15,-.15],["z"]],w:7.5,h:8.245},"scripts.dmarcato":{d:[["M",-3.57,.03],["c",.03,0,.57,-.03,1.17,-.03],["c",1.05,0,1.08,0,1.17,.06],["c",.09,.06,.24,.36,1.17,2.4],["c",.57,1.29,1.05,2.34,1.08,2.34],["c",0,.03,.51,-1.02,1.08,-2.34],["c",.93,-2.07,1.08,-2.34,1.14,-2.4],["c",.06,-.03,.15,-.06,.18,-.06],["c",.15,0,.33,.18,.33,.33],["c",0,.09,-3.45,7.74,-3.54,7.83],["c",-.12,.12,-.3,.12,-.42,0],["c",-.09,-.09,-3.54,-7.74,-3.54,-7.83],["c",0,-.09,.12,-.27,.18,-.3],["z"]],w:7.5,h:8.25},"scripts.stopped":{d:[["M",-.27,-4.08],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.5],["l",0,1.47],["l",1.47,0],["l",1.5,0],["l",.15,.06],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.09,.36,0,.54],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.12,.06,-.18,.06,-1.62,.06],["l",-1.47,0],["l",0,1.47],["l",0,1.47],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-1.47],["l",0,-1.47],["l",-1.47,0],["c",-1.44,0,-1.5,0,-1.62,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.47,0],["l",1.47,0],["l",0,-1.47],["c",0,-1.44,0,-1.5,.06,-1.62],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:8.295,h:8.295},"scripts.upbow":{d:[["M",-4.65,-15.54],["c",.12,-.09,.36,-.06,.48,.03],["c",.03,.03,.09,.09,.12,.15],["c",.03,.06,.66,2.13,1.41,4.62],["c",1.35,4.41,1.38,4.56,2.01,6.96],["l",.63,2.46],["l",.63,-2.46],["c",.63,-2.4,.66,-2.55,2.01,-6.96],["c",.75,-2.49,1.38,-4.56,1.41,-4.62],["c",.06,-.15,.18,-.21,.36,-.24],["c",.15,0,.3,.06,.39,.18],["c",.15,.21,.24,-.18,-2.1,7.56],["c",-1.2,3.96,-2.22,7.32,-2.25,7.41],["c",0,.12,-.06,.27,-.09,.3],["c",-.12,.21,-.6,.21,-.72,0],["c",-.03,-.03,-.09,-.18,-.09,-.3],["c",-.03,-.09,-1.05,-3.45,-2.25,-7.41],["c",-2.34,-7.74,-2.25,-7.35,-2.1,-7.56],["c",.03,-.03,.09,-.09,.15,-.12],["z"]],w:9.73,h:15.608},"scripts.downbow":{d:[["M",-5.55,-9.93],["l",.09,-.06],["l",5.46,0],["l",5.46,0],["l",.09,.06],["l",.06,.09],["l",0,4.77],["c",0,5.28,0,4.89,-.18,5.01],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.06,-.09,-.06,-.18,-.06,-2.97],["l",0,-2.85],["l",-4.83,0],["l",-4.83,0],["l",0,2.85],["c",0,2.79,0,2.88,-.06,2.97],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.21,-.06,-4.89],["l",0,-4.77],["z"]],w:11.22,h:9.992},"scripts.turn":{d:[["M",-4.77,-3.9],["c",.36,-.06,1.05,-.06,1.44,.03],["c",.78,.15,1.5,.51,2.34,1.14],["c",.6,.45,1.05,.87,2.22,2.01],["c",1.11,1.08,1.62,1.5,2.22,1.86],["c",.6,.36,1.32,.57,1.92,.57],["c",.9,0,1.71,-.57,1.89,-1.35],["c",.24,-.93,-.39,-1.89,-1.35,-2.1],["l",-.15,-.06],["l",-.09,.15],["c",-.03,.09,-.15,.24,-.24,.33],["c",-.72,.72,-2.04,.54,-2.49,-.36],["c",-.48,-.93,.03,-1.86,1.17,-2.19],["c",.3,-.09,1.02,-.09,1.35,0],["c",.99,.27,1.74,.87,2.25,1.83],["c",.69,1.41,.63,3,-.21,4.26],["c",-.21,.3,-.69,.81,-.99,1.02],["c",-.3,.21,-.84,.45,-1.17,.54],["c",-1.23,.36,-2.49,.15,-3.72,-.6],["c",-.75,-.48,-1.41,-1.02,-2.85,-2.46],["c",-1.11,-1.08,-1.62,-1.5,-2.22,-1.86],["c",-.6,-.36,-1.32,-.57,-1.92,-.57],["c",-.9,0,-1.71,.57,-1.89,1.35],["c",-.24,.93,.39,1.89,1.35,2.1],["l",.15,.06],["l",.09,-.15],["c",.03,-.09,.15,-.24,.24,-.33],["c",.72,-.72,2.04,-.54,2.49,.36],["c",.48,.93,-.03,1.86,-1.17,2.19],["c",-.3,.09,-1.02,.09,-1.35,0],["c",-.99,-.27,-1.74,-.87,-2.25,-1.83],["c",-.69,-1.41,-.63,-3,.21,-4.26],["c",.21,-.3,.69,-.81,.99,-1.02],["c",.48,-.33,1.11,-.57,1.74,-.66],["z"]],w:16.366,h:7.893},"scripts.trill":{d:[["M",-.51,-16.02],["c",.12,-.09,.21,-.18,.21,-.18],["l",-.81,4.02],["l",-.81,4.02],["c",.03,0,.51,-.27,1.08,-.6],["c",.6,-.3,1.14,-.63,1.26,-.66],["c",1.14,-.54,2.31,-.6,3.09,-.18],["c",.27,.15,.54,.36,.6,.51],["l",.06,.12],["l",.21,-.21],["c",.9,-.81,2.22,-.99,3.12,-.42],["c",.6,.42,.9,1.14,.78,2.07],["c",-.15,1.29,-1.05,2.31,-1.95,2.25],["c",-.48,-.03,-.78,-.3,-.96,-.81],["c",-.09,-.27,-.09,-.9,-.03,-1.2],["c",.21,-.75,.81,-1.23,1.59,-1.32],["l",.24,-.03],["l",-.09,-.12],["c",-.51,-.66,-1.62,-.63,-2.31,.03],["c",-.39,.42,-.3,.09,-1.23,4.77],["l",-.81,4.14],["c",-.03,0,-.12,-.03,-.21,-.09],["c",-.33,-.15,-.54,-.18,-.99,-.18],["c",-.42,0,-.66,.03,-1.05,.18],["c",-.12,.06,-.21,.09,-.21,.09],["c",0,-.03,.36,-1.86,.81,-4.11],["c",.9,-4.47,.87,-4.26,.69,-4.53],["c",-.21,-.36,-.66,-.51,-1.17,-.36],["c",-.15,.06,-2.22,1.14,-2.58,1.38],["c",-.12,.09,-.12,.09,-.21,.6],["l",-.09,.51],["l",.21,.24],["c",.63,.75,1.02,1.47,1.2,2.19],["c",.06,.27,.06,.36,.06,.81],["c",0,.42,0,.54,-.06,.78],["c",-.15,.54,-.33,.93,-.63,1.35],["c",-.18,.24,-.57,.63,-.81,.78],["c",-.24,.15,-.63,.36,-.84,.42],["c",-.27,.06,-.66,.06,-.87,.03],["c",-.81,-.18,-1.32,-1.05,-1.38,-2.46],["c",-.03,-.6,.03,-.99,.33,-2.46],["c",.21,-1.08,.24,-1.32,.21,-1.29],["c",-1.2,.48,-2.4,.75,-3.21,.72],["c",-.69,-.06,-1.17,-.3,-1.41,-.72],["c",-.39,-.75,-.12,-1.8,.66,-2.46],["c",.24,-.18,.69,-.42,1.02,-.51],["c",.69,-.18,1.53,-.15,2.31,.09],["c",.3,.09,.75,.3,.99,.45],["c",.12,.09,.15,.09,.15,.03],["c",.03,-.03,.33,-1.59,.72,-3.45],["c",.36,-1.86,.66,-3.42,.69,-3.45],["c",0,-.03,.03,-.03,.21,.03],["c",.21,.06,.27,.06,.48,.06],["c",.42,-.03,.78,-.18,1.26,-.48],["c",.15,-.12,.36,-.27,.48,-.39],["z"],["m",-5.73,7.68],["c",-.27,-.03,-.96,-.06,-1.2,-.03],["c",-.81,.12,-1.35,.57,-1.5,1.2],["c",-.18,.66,.12,1.14,.75,1.29],["c",.66,.12,1.92,-.12,3.18,-.66],["l",.33,-.15],["l",.09,-.39],["c",.06,-.21,.09,-.42,.09,-.45],["c",0,-.03,-.45,-.3,-.75,-.45],["c",-.27,-.15,-.66,-.27,-.99,-.36],["z"],["m",4.29,3.63],["c",-.24,-.39,-.51,-.75,-.51,-.69],["c",-.06,.12,-.39,1.92,-.45,2.28],["c",-.09,.54,-.12,1.14,-.06,1.38],["c",.06,.42,.21,.6,.51,.57],["c",.39,-.06,.75,-.48,.93,-1.14],["c",.09,-.33,.09,-1.05,0,-1.38],["c",-.09,-.39,-.24,-.69,-.42,-1.02],["z"]],w:17.963,h:16.49},"scripts.segno":{d:[["M",-3.72,-11.22],["c",.78,-.09,1.59,.03,2.31,.42],["c",1.2,.6,2.01,1.71,2.31,3.09],["c",.09,.42,.09,1.2,.03,1.5],["c",-.15,.45,-.39,.81,-.66,.93],["c",-.33,.18,-.84,.21,-1.23,.15],["c",-.81,-.18,-1.32,-.93,-1.26,-1.89],["c",.03,-.36,.09,-.57,.24,-.9],["c",.15,-.33,.45,-.6,.72,-.75],["c",.12,-.06,.18,-.09,.18,-.12],["c",0,-.03,-.03,-.15,-.09,-.24],["c",-.18,-.45,-.54,-.87,-.96,-1.08],["c",-1.11,-.57,-2.34,-.18,-2.88,.9],["c",-.24,.51,-.33,1.11,-.24,1.83],["c",.27,1.92,1.5,3.54,3.93,5.13],["c",.48,.33,1.26,.78,1.29,.78],["c",.03,0,1.35,-2.19,2.94,-4.89],["l",2.88,-4.89],["l",.84,0],["l",.87,0],["l",-.03,.06],["c",-.15,.21,-6.15,10.41,-6.15,10.44],["c",0,0,.21,.15,.48,.27],["c",2.61,1.47,4.35,3.03,5.13,4.65],["c",1.14,2.34,.51,5.07,-1.44,6.39],["c",-.66,.42,-1.32,.63,-2.13,.69],["c",-2.01,.09,-3.81,-1.41,-4.26,-3.54],["c",-.09,-.42,-.09,-1.2,-.03,-1.5],["c",.15,-.45,.39,-.81,.66,-.93],["c",.33,-.18,.84,-.21,1.23,-.15],["c",.81,.18,1.32,.93,1.26,1.89],["c",-.03,.36,-.09,.57,-.24,.9],["c",-.15,.33,-.45,.6,-.72,.75],["c",-.12,.06,-.18,.09,-.18,.12],["c",0,.03,.03,.15,.09,.24],["c",.18,.45,.54,.87,.96,1.08],["c",1.11,.57,2.34,.18,2.88,-.9],["c",.24,-.51,.33,-1.11,.24,-1.83],["c",-.27,-1.92,-1.5,-3.54,-3.93,-5.13],["c",-.48,-.33,-1.26,-.78,-1.29,-.78],["c",-.03,0,-1.35,2.19,-2.91,4.89],["l",-2.88,4.89],["l",-.87,0],["l",-.87,0],["l",.03,-.06],["c",.15,-.21,6.15,-10.41,6.15,-10.44],["c",0,0,-.21,-.15,-.48,-.3],["c",-2.61,-1.44,-4.35,-3,-5.13,-4.62],["c",-.9,-1.89,-.72,-4.02,.48,-5.52],["c",.69,-.84,1.68,-1.41,2.73,-1.53],["z"],["m",8.76,9.09],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"],["m",-10.53,2.61],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"]],w:15,h:22.504},"scripts.coda":{d:[["M",-.21,-10.47],["c",.18,-.12,.42,-.06,.54,.12],["c",.06,.09,.06,.18,.06,1.5],["l",0,1.38],["l",.18,0],["c",.39,.06,.96,.24,1.38,.48],["c",1.68,.93,2.82,3.24,3.03,6.12],["c",.03,.24,.03,.45,.03,.45],["c",0,.03,.6,.03,1.35,.03],["c",1.5,0,1.47,0,1.59,.18],["c",.09,.12,.09,.3,0,.42],["c",-.12,.18,-.09,.18,-1.59,.18],["c",-.75,0,-1.35,0,-1.35,.03],["c",0,0,0,.21,-.03,.42],["c",-.24,3.15,-1.53,5.58,-3.45,6.36],["c",-.27,.12,-.72,.24,-.96,.27],["l",-.18,0],["l",0,1.38],["c",0,1.32,0,1.41,-.06,1.5],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.18,-.06,-1.5],["l",0,-1.38],["l",-.18,0],["c",-.39,-.06,-.96,-.24,-1.38,-.48],["c",-1.68,-.93,-2.82,-3.24,-3.03,-6.15],["c",-.03,-.21,-.03,-.42,-.03,-.42],["c",0,-.03,-.6,-.03,-1.35,-.03],["c",-1.5,0,-1.47,0,-1.59,-.18],["c",-.09,-.12,-.09,-.3,0,-.42],["c",.12,-.18,.09,-.18,1.59,-.18],["c",.75,0,1.35,0,1.35,-.03],["c",0,0,0,-.21,.03,-.45],["c",.24,-3.12,1.53,-5.55,3.45,-6.33],["c",.27,-.12,.72,-.24,.96,-.27],["l",.18,0],["l",0,-1.38],["c",0,-1.53,0,-1.5,.18,-1.62],["z"],["m",-.18,6.93],["c",0,-2.97,0,-3.15,-.06,-3.15],["c",-.09,0,-.51,.15,-.66,.21],["c",-.87,.51,-1.38,1.62,-1.56,3.51],["c",-.06,.54,-.12,1.59,-.12,2.16],["l",0,.42],["l",1.2,0],["l",1.2,0],["l",0,-3.15],["z"],["m",1.17,-3.06],["c",-.09,-.03,-.21,-.06,-.27,-.09],["l",-.12,0],["l",0,3.15],["l",0,3.15],["l",1.2,0],["l",1.2,0],["l",0,-.81],["c",-.06,-2.4,-.33,-3.69,-.93,-4.59],["c",-.27,-.39,-.66,-.69,-1.08,-.81],["z"],["m",-1.17,10.14],["l",0,-3.15],["l",-1.2,0],["l",-1.2,0],["l",0,.81],["c",.03,.96,.06,1.47,.15,2.13],["c",.24,2.04,.96,3.12,2.13,3.36],["l",.12,0],["l",0,-3.15],["z"],["m",3.18,-2.34],["l",0,-.81],["l",-1.2,0],["l",-1.2,0],["l",0,3.15],["l",0,3.15],["l",.12,0],["c",1.17,-.24,1.89,-1.32,2.13,-3.36],["c",.09,-.66,.12,-1.17,.15,-2.13],["z"]],w:16.035,h:21.062},"scripts.comma":{d:[["M",1.14,-4.62],["c",.3,-.12,.69,-.03,.93,.15],["c",.12,.12,.36,.45,.51,.78],["c",.9,1.77,.54,4.05,-1.08,6.75],["c",-.36,.63,-.87,1.38,-.96,1.44],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.09,-.18,-.09,-.3,.12,-.6],["c",.96,-1.44,1.44,-2.97,1.38,-4.35],["c",-.06,-.93,-.3,-1.68,-.78,-2.46],["c",-.27,-.39,-.33,-.63,-.24,-.96],["c",.09,-.27,.36,-.54,.66,-.63],["z"]],w:3.042,h:9.237},"scripts.roll":{d:[["M",1.95,-6],["c",.21,-.09,.36,-.09,.57,0],["c",.39,.15,.63,.39,1.47,1.35],["c",.66,.75,.78,.87,1.08,1.05],["c",.75,.45,1.65,.42,2.4,-.06],["c",.12,-.09,.27,-.27,.54,-.6],["c",.42,-.54,.51,-.63,.69,-.63],["c",.09,0,.3,.12,.36,.21],["c",.09,.12,.12,.3,.03,.42],["c",-.06,.12,-3.15,3.9,-3.3,4.08],["c",-.06,.06,-.18,.12,-.27,.18],["c",-.27,.12,-.6,.06,-.99,-.27],["c",-.27,-.21,-.42,-.39,-1.08,-1.14],["c",-.63,-.72,-.81,-.9,-1.17,-1.08],["c",-.36,-.18,-.57,-.21,-.99,-.21],["c",-.39,0,-.63,.03,-.93,.18],["c",-.36,.15,-.51,.27,-.9,.81],["c",-.24,.27,-.45,.51,-.48,.54],["c",-.12,.09,-.27,.06,-.39,0],["c",-.24,-.15,-.33,-.39,-.21,-.6],["c",.09,-.12,3.18,-3.87,3.33,-4.02],["c",.06,-.06,.18,-.15,.24,-.21],["z"]],w:10.817,h:6.125},"scripts.prall":{d:[["M",-4.38,-3.69],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.57,-.84,1.23,-1.83],["c",1.14,-1.68,1.23,-1.83,1.35,-1.89],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["c",-.03,0,-.57,.84,-1.23,1.83],["c",-1.14,1.68,-1.23,1.83,-1.35,1.89],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["z"]],w:15.011,h:7.5},"scripts.arpeggio":{d:[["M",1.5,0],["c",1.5,2,1.5,3,1.5,3],["s",0,1,-2,1.5],["s",-.5,3,1,5.5],["l",1.5,0],["s",-1.75,-2,-1.9,-3.25],["s",2.15,-.6,2.95,-1.6],["s",.45,-1,.5,-1.25],["s",0,-1,-2,-3.9],["l",-1.5,0],["z"]],w:5,h:10},"scripts.mordent":{d:[["M",-.21,-4.95],["c",.27,-.15,.63,0,.75,.27],["c",.06,.12,.06,.24,.06,1.44],["l",0,1.29],["l",.57,-.84],["c",.51,-.75,.57,-.84,.69,-.9],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.83,-1.89],["c",-.81,-.99,-1.5,-1.8,-1.53,-1.86],["c",-.06,-.03,-.06,-.03,-.12,.03],["c",-.06,.06,-.06,.15,-.06,2.28],["c",0,1.95,0,2.25,-.06,2.34],["c",-.18,.45,-.81,.48,-1.05,.03],["c",-.03,-.06,-.06,-.24,-.06,-1.41],["l",0,-1.35],["l",-.57,.84],["c",-.54,.78,-.6,.87,-.72,.93],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.06,-.06,.09,-.09],["c",.06,-.12,.06,-.15,.06,-2.28],["c",0,-1.92,0,-2.22,.06,-2.31],["c",.06,-.15,.15,-.24,.3,-.3],["z"]],w:15.011,h:10.012},"flags.u8th":{d:[["M",-.42,3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",0,.18],["c",0,.3,.06,.84,.12,1.23],["c",.24,1.53,.9,3.12,2.13,5.16],["l",.99,1.59],["c",.87,1.44,1.38,2.34,1.77,3.09],["c",.81,1.68,1.2,3.06,1.26,4.53],["c",.03,1.53,-.21,3.27,-.75,5.01],["c",-.21,.69,-.51,1.5,-.6,1.59],["c",-.09,.12,-.27,.21,-.42,.21],["c",-.15,0,-.42,-.12,-.51,-.21],["c",-.15,-.18,-.18,-.42,-.09,-.66],["c",.15,-.33,.45,-1.2,.57,-1.62],["c",.42,-1.38,.6,-2.58,.6,-3.9],["c",0,-.66,0,-.81,-.06,-1.11],["c",-.39,-2.07,-1.8,-4.26,-4.59,-7.14],["l",-.42,-.45],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["z"]],w:6.692,h:22.59},"flags.u16th":{d:[["M",-.42,7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,.39],["c",.06,1.08,.39,2.19,.99,3.39],["c",.45,.9,.87,1.59,1.95,3.12],["c",1.29,1.86,1.77,2.64,2.22,3.57],["c",.45,.93,.72,1.8,.87,2.64],["c",.06,.51,.06,1.5,0,1.92],["c",-.12,.6,-.3,1.2,-.54,1.71],["l",-.09,.24],["l",.18,.45],["c",.51,1.2,.72,2.22,.69,3.42],["c",-.06,1.53,-.39,3.03,-.99,4.53],["c",-.3,.75,-.36,.81,-.57,.9],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.12,-.75],["c",.66,-1.41,1.02,-2.88,1.08,-4.32],["c",0,-.6,-.03,-1.05,-.18,-1.59],["c",-.3,-1.2,-.99,-2.4,-2.25,-3.87],["c",-.42,-.48,-1.53,-1.62,-2.19,-2.22],["l",-.45,-.42],["l",-.03,1.11],["l",0,1.11],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["z"],["m",1.65,.09],["c",-.3,-.3,-.69,-.72,-.9,-.87],["l",-.33,-.33],["l",0,.15],["c",0,.3,.06,.81,.15,1.26],["c",.27,1.29,.87,2.61,2.04,4.29],["c",.15,.24,.6,.87,.96,1.38],["l",1.08,1.53],["l",.42,.63],["c",.03,0,.12,-.36,.21,-.72],["c",.06,-.33,.06,-1.2,0,-1.62],["c",-.33,-1.71,-1.44,-3.48,-3.63,-5.7],["z"]],w:6.693,h:26.337},"flags.u32nd":{d:[["M",-.42,11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,.36],["c",.09,1.68,.69,3.27,2.07,5.46],["l",.87,1.35],["c",1.02,1.62,1.47,2.37,1.86,3.18],["c",.48,1.02,.78,1.92,.93,2.88],["c",.06,.48,.06,1.5,0,1.89],["c",-.09,.42,-.21,.87,-.36,1.26],["l",-.12,.3],["l",.15,.39],["c",.69,1.56,.84,2.88,.54,4.38],["c",-.09,.45,-.27,1.08,-.45,1.47],["l",-.12,.24],["l",.18,.36],["c",.33,.72,.57,1.56,.69,2.34],["c",.12,1.02,-.06,2.52,-.42,3.84],["c",-.27,.93,-.75,2.13,-.93,2.31],["c",-.18,.15,-.45,.18,-.66,.09],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.06,-.6],["c",.21,-.36,.42,-.9,.57,-1.38],["c",.51,-1.41,.69,-3.06,.48,-4.08],["c",-.15,-.81,-.57,-1.68,-1.2,-2.55],["c",-.72,-.99,-1.83,-2.13,-3.3,-3.33],["l",-.48,-.42],["l",-.03,1.53],["l",0,1.56],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["z"],["m",1.26,-3.96],["c",-.27,-.3,-.54,-.6,-.66,-.72],["l",-.18,-.21],["l",0,.42],["c",.06,.87,.24,1.74,.66,2.67],["c",.36,.87,.96,1.86,1.92,3.18],["c",.21,.33,.63,.87,.87,1.23],["c",.27,.39,.6,.84,.75,1.08],["l",.27,.39],["l",.03,-.12],["c",.12,-.45,.15,-1.05,.09,-1.59],["c",-.27,-1.86,-1.38,-3.78,-3.75,-6.33],["z"],["m",-.27,6.09],["c",-.27,-.21,-.48,-.42,-.51,-.45],["c",-.06,-.03,-.06,-.03,-.06,.21],["c",0,.9,.3,2.04,.81,3.09],["c",.48,1.02,.96,1.77,2.37,3.63],["c",.6,.78,1.05,1.44,1.29,1.77],["c",.06,.12,.15,.21,.15,.18],["c",.03,-.03,.18,-.57,.24,-.87],["c",.06,-.45,.06,-1.32,-.03,-1.74],["c",-.09,-.48,-.24,-.9,-.51,-1.44],["c",-.66,-1.35,-1.83,-2.7,-3.75,-4.38],["z"]],w:6.697,h:32.145},"flags.u64th":{d:[["M",-.42,15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,.36],["c",.06,1.2,.39,2.37,1.02,3.66],["c",.39,.81,.84,1.56,1.8,3.09],["c",.81,1.26,1.05,1.68,1.35,2.22],["c",.87,1.5,1.35,2.79,1.56,4.08],["c",.06,.54,.06,1.56,-.03,2.04],["c",-.09,.48,-.21,.99,-.36,1.35],["l",-.12,.27],["l",.12,.27],["c",.09,.15,.21,.45,.27,.66],["c",.69,1.89,.63,3.66,-.18,5.46],["l",-.18,.39],["l",.15,.33],["c",.3,.66,.51,1.44,.63,2.1],["c",.06,.48,.06,1.35,0,1.71],["c",-.15,.57,-.42,1.2,-.78,1.68],["l",-.21,.27],["l",.18,.33],["c",.57,1.05,.93,2.13,1.02,3.18],["c",.06,.72,0,1.83,-.21,2.79],["c",-.18,1.02,-.63,2.34,-1.02,3.09],["c",-.15,.33,-.48,.45,-.78,.3],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.03,-.54],["c",.75,-1.5,1.23,-3.45,1.17,-4.89],["c",-.06,-1.02,-.42,-2.01,-1.17,-3.15],["c",-.48,-.72,-1.02,-1.35,-1.89,-2.22],["c",-.57,-.57,-1.56,-1.5,-1.92,-1.77],["l",-.12,-.09],["l",0,1.68],["l",0,1.68],["l",-.21,0],["l",-.21,0],["l",0,-15],["z"],["m",.93,-8.07],["c",-.27,-.3,-.48,-.54,-.51,-.54],["c",0,0,0,.69,.03,1.02],["c",.15,1.47,.75,2.94,2.04,4.83],["l",1.08,1.53],["c",.39,.57,.84,1.2,.99,1.44],["c",.15,.24,.3,.45,.3,.45],["c",0,0,.03,-.09,.06,-.21],["c",.36,-1.59,-.15,-3.33,-1.47,-5.4],["c",-.63,-.93,-1.35,-1.83,-2.52,-3.12],["z"],["m",.06,6.72],["c",-.24,-.21,-.48,-.42,-.51,-.45],["l",-.06,-.06],["l",0,.33],["c",0,1.2,.3,2.34,.93,3.6],["c",.45,.9,.96,1.68,2.25,3.51],["c",.39,.54,.84,1.17,1.02,1.44],["c",.21,.33,.33,.51,.33,.48],["c",.06,-.09,.21,-.63,.3,-.99],["c",.06,-.33,.06,-.45,.06,-.96],["c",0,-.6,-.03,-.84,-.18,-1.35],["c",-.3,-1.08,-1.02,-2.28,-2.13,-3.57],["c",-.39,-.45,-1.44,-1.47,-2.01,-1.98],["z"],["m",0,6.72],["c",-.24,-.21,-.48,-.39,-.51,-.42],["l",-.06,-.06],["l",0,.33],["c",0,1.41,.45,2.82,1.38,4.35],["c",.42,.72,.72,1.14,1.86,2.73],["c",.36,.45,.75,.99,.87,1.2],["c",.15,.21,.3,.36,.3,.36],["c",.06,0,.3,-.48,.39,-.75],["c",.09,-.36,.12,-.63,.12,-1.05],["c",-.06,-1.05,-.45,-2.04,-1.2,-3.18],["c",-.57,-.87,-1.11,-1.53,-2.07,-2.49],["c",-.36,-.33,-.84,-.78,-1.08,-1.02],["z"]],w:6.682,h:39.694},"flags.d8th":{d:[["M",5.67,-21.63],["c",.24,-.12,.54,-.06,.69,.15],["c",.06,.06,.21,.36,.39,.66],["c",.84,1.77,1.26,3.36,1.32,5.1],["c",.03,1.29,-.21,2.37,-.81,3.63],["c",-.6,1.23,-1.26,2.13,-3.21,4.38],["c",-1.35,1.53,-1.86,2.19,-2.4,2.97],["c",-.63,.93,-1.11,1.92,-1.38,2.79],["c",-.15,.54,-.27,1.35,-.27,1.8],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",.48,-.3],["c",1.83,-1.11,3.12,-2.1,4.17,-3.12],["c",.78,-.81,1.32,-1.53,1.71,-2.31],["c",.45,-.93,.6,-1.74,.51,-2.88],["c",-.12,-1.56,-.63,-3.18,-1.47,-4.68],["c",-.12,-.21,-.15,-.33,-.06,-.51],["c",.06,-.15,.15,-.24,.33,-.33],["z"]],w:8.492,h:21.691},"flags.ugrace":{d:[["M",6.03,6.93],["c",.15,-.09,.33,-.06,.51,0],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.06,.39,-.03,.54],["c",-.06,.15,-10.89,8.88,-11.07,8.97],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.06,-.39,.03,-.54],["c",.06,-.15,10.89,-8.88,11.07,-8.97],["z"]],w:12.019,h:9.954},"flags.dgrace":{d:[["M",-6.06,-15.93],["c",.18,-.09,.33,-.12,.48,-.06],["c",.18,.09,14.01,8.04,14.1,8.1],["c",.12,.12,.18,.33,.18,.51],["c",-.03,.21,-.15,.39,-.36,.48],["c",-.18,.09,-.33,.12,-.48,.06],["c",-.18,-.09,-14.01,-8.04,-14.1,-8.1],["c",-.12,-.12,-.18,-.33,-.18,-.51],["c",.03,-.21,.15,-.39,.36,-.48],["z"]],w:15.12,h:9.212},"flags.d16th":{d:[["M",6.84,-22.53],["c",.27,-.12,.57,-.06,.72,.15],["c",.15,.15,.33,.87,.45,1.56],["c",.06,.33,.06,1.35,0,1.65],["c",-.06,.33,-.15,.78,-.27,1.11],["c",-.12,.33,-.45,.96,-.66,1.32],["l",-.18,.27],["l",.09,.18],["c",.48,1.02,.72,2.25,.69,3.3],["c",-.06,1.23,-.42,2.28,-1.26,3.45],["c",-.57,.87,-.99,1.32,-3,3.39],["c",-1.56,1.56,-2.22,2.4,-2.76,3.45],["c",-.42,.84,-.66,1.8,-.66,2.55],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,1.14],["l",0,1.11],["l",.27,-.15],["c",1.11,-.57,1.77,-.99,2.52,-1.47],["c",2.37,-1.56,3.69,-3.15,4.05,-4.83],["c",.03,-.18,.03,-.39,.03,-.78],["c",0,-.6,-.03,-.93,-.24,-1.5],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.5],["c",-.06,-.18,-.15,-.36,-.15,-.36],["c",-.03,0,-.03,.03,-.06,.06],["c",-.06,.12,-.96,1.02,-1.95,1.98],["c",-.63,.57,-1.26,1.17,-1.44,1.35],["c",-1.53,1.62,-2.28,2.85,-2.55,4.32],["c",-.03,.18,-.03,.54,-.06,.99],["l",0,.69],["l",.18,-.09],["c",.93,-.54,2.1,-1.29,2.82,-1.83],["c",.69,-.51,1.02,-.81,1.53,-1.29],["c",1.86,-1.89,2.37,-3.66,1.68,-5.82],["z"]],w:8.475,h:22.591},"flags.d32nd":{d:[["M",6.84,-29.13],["c",.27,-.12,.57,-.06,.72,.15],["c",.12,.12,.27,.63,.36,1.11],["c",.33,1.59,.06,3.06,-.81,4.47],["l",-.18,.27],["l",.09,.15],["c",.12,.24,.33,.69,.45,1.05],["c",.63,1.83,.45,3.57,-.57,5.22],["l",-.18,.3],["l",.15,.27],["c",.42,.87,.6,1.71,.57,2.61],["c",-.06,1.29,-.48,2.46,-1.35,3.78],["c",-.54,.81,-.93,1.29,-2.46,3],["c",-.51,.54,-1.05,1.17,-1.26,1.41],["c",-1.56,1.86,-2.25,3.36,-2.37,5.01],["l",0,.33],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,1.35],["l",.03,1.35],["l",.78,-.39],["c",1.38,-.69,2.34,-1.26,3.24,-1.92],["c",1.38,-1.02,2.28,-2.13,2.64,-3.21],["c",.15,-.48,.18,-.72,.18,-1.29],["c",0,-.57,-.06,-.9,-.24,-1.47],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.2],["c",-.09,-.18,-.12,-.21,-.12,-.15],["c",-.03,.09,-1.02,1.08,-2.04,2.04],["c",-1.17,1.08,-1.65,1.56,-2.07,2.04],["c",-.84,.96,-1.38,1.86,-1.68,2.76],["c",-.21,.57,-.27,.99,-.3,1.65],["l",0,.54],["l",.66,-.33],["c",3.57,-1.86,5.49,-3.69,5.94,-5.7],["c",.06,-.39,.06,-1.2,-.03,-1.65],["c",-.06,-.39,-.24,-.9,-.36,-1.2],["z"],["m",-.06,7.2],["c",-.06,-.15,-.12,-.33,-.15,-.45],["l",-.06,-.18],["l",-.18,.21],["l",-1.83,1.83],["c",-.87,.9,-1.77,1.8,-1.95,2.01],["c",-1.08,1.29,-1.62,2.31,-1.89,3.51],["c",-.06,.3,-.06,.51,-.09,.93],["l",0,.57],["l",.09,-.06],["c",.75,-.45,1.89,-1.26,2.52,-1.74],["c",.81,-.66,1.74,-1.53,2.22,-2.16],["c",1.26,-1.53,1.68,-3.06,1.32,-4.47],["z"]],w:8.385,h:29.191},"flags.d64th":{d:[["M",7.08,-32.88],["c",.3,-.12,.66,-.03,.78,.24],["c",.18,.33,.27,2.1,.15,2.64],["c",-.09,.39,-.21,.78,-.39,1.08],["l",-.15,.3],["l",.09,.27],["c",.03,.12,.09,.45,.12,.69],["c",.27,1.44,.18,2.55,-.3,3.6],["l",-.12,.33],["l",.06,.42],["c",.27,1.35,.33,2.82,.21,3.63],["c",-.12,.6,-.3,1.23,-.57,1.8],["l",-.15,.27],["l",.03,.42],["c",.06,1.02,.06,2.7,.03,3.06],["c",-.15,1.47,-.66,2.76,-1.74,4.41],["c",-.45,.69,-.75,1.11,-1.74,2.37],["c",-1.05,1.38,-1.5,1.98,-1.95,2.73],["c",-.93,1.5,-1.38,2.82,-1.44,4.2],["l",0,.42],["l",-.21,0],["l",-.21,0],["l",0,-15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,1.86],["l",0,1.89],["c",0,0,.21,-.03,.45,-.09],["c",2.22,-.39,4.08,-1.11,5.19,-2.01],["c",.63,-.54,1.02,-1.14,1.2,-1.8],["c",.06,-.3,.06,-1.14,-.03,-1.65],["c",-.03,-.18,-.06,-.39,-.09,-.48],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.45,6.15],["c",-.03,-.18,-.06,-.42,-.06,-.54],["l",-.03,-.18],["l",-.33,.3],["c",-.42,.36,-.87,.72,-1.68,1.29],["c",-1.98,1.38,-2.25,1.59,-2.85,2.16],["c",-.75,.69,-1.23,1.44,-1.47,2.19],["c",-.15,.45,-.18,.63,-.21,1.35],["l",0,.66],["l",.39,-.18],["c",1.83,-.9,3.45,-1.95,4.47,-2.91],["c",.93,-.9,1.53,-1.83,1.74,-2.82],["c",.06,-.33,.06,-.87,.03,-1.32],["z"],["m",-.27,4.86],["c",-.03,-.21,-.06,-.36,-.06,-.36],["c",0,-.03,-.12,.09,-.24,.24],["c",-.39,.48,-.99,1.08,-2.16,2.19],["c",-1.47,1.38,-1.92,1.83,-2.46,2.49],["c",-.66,.87,-1.08,1.74,-1.29,2.58],["c",-.09,.42,-.15,.87,-.15,1.44],["l",0,.54],["l",.48,-.33],["c",1.5,-1.02,2.58,-1.89,3.51,-2.82],["c",1.47,-1.47,2.25,-2.85,2.4,-4.26],["c",.03,-.39,.03,-1.17,-.03,-1.71],["z"],["m",-.66,7.68],["c",.03,-.15,.03,-.6,.03,-.99],["l",0,-.72],["l",-.27,.33],["l",-1.74,1.98],["c",-1.77,1.92,-2.43,2.76,-2.97,3.9],["c",-.51,1.02,-.72,1.77,-.75,2.91],["c",0,.63,0,.63,.06,.6],["c",.03,-.03,.3,-.27,.63,-.54],["c",.66,-.6,1.86,-1.8,2.31,-2.31],["c",1.65,-1.89,2.52,-3.54,2.7,-5.16],["z"]],w:8.485,h:32.932},"clefs.C":{d:[["M",.06,-14.94],["l",.09,-.06],["l",1.92,0],["l",1.92,0],["l",.09,.06],["l",.06,.09],["l",0,14.85],["l",0,14.82],["l",-.06,.09],["l",-.09,.06],["l",-1.92,0],["l",-1.92,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"],["m",5.37,0],["c",.09,-.06,.09,-.06,.57,-.06],["c",.45,0,.45,0,.54,.06],["l",.06,.09],["l",0,7.14],["l",0,7.11],["l",.09,-.06],["c",.18,-.18,.72,-.84,.96,-1.2],["c",.3,-.45,.66,-1.17,.84,-1.65],["c",.36,-.9,.57,-1.83,.6,-2.79],["c",.03,-.48,.03,-.54,.09,-.63],["c",.12,-.18,.36,-.21,.54,-.12],["c",.18,.09,.21,.15,.24,.66],["c",.06,.87,.21,1.56,.57,2.22],["c",.51,1.02,1.26,1.68,2.22,1.92],["c",.21,.06,.33,.06,.78,.06],["c",.45,0,.57,0,.84,-.06],["c",.45,-.12,.81,-.33,1.08,-.6],["c",.57,-.57,.87,-1.41,.99,-2.88],["c",.06,-.54,.06,-3,0,-3.57],["c",-.21,-2.58,-.84,-3.87,-2.16,-4.5],["c",-.48,-.21,-1.17,-.36,-1.77,-.36],["c",-.69,0,-1.29,.27,-1.5,.72],["c",-.06,.15,-.06,.21,-.06,.42],["c",0,.24,0,.3,.06,.45],["c",.12,.24,.24,.39,.63,.66],["c",.42,.3,.57,.48,.69,.72],["c",.06,.15,.06,.21,.06,.48],["c",0,.39,-.03,.63,-.21,.96],["c",-.3,.6,-.87,1.08,-1.5,1.26],["c",-.27,.06,-.87,.06,-1.14,0],["c",-.78,-.24,-1.44,-.87,-1.65,-1.68],["c",-.12,-.42,-.09,-1.17,.09,-1.71],["c",.51,-1.65,1.98,-2.82,3.81,-3.09],["c",.84,-.09,2.46,.03,3.51,.27],["c",2.22,.57,3.69,1.8,4.44,3.75],["c",.36,.93,.57,2.13,.57,3.36],["c",0,1.44,-.48,2.73,-1.38,3.81],["c",-1.26,1.5,-3.27,2.43,-5.28,2.43],["c",-.48,0,-.51,0,-.75,-.09],["c",-.15,-.03,-.48,-.21,-.78,-.36],["c",-.69,-.36,-.87,-.42,-1.26,-.42],["c",-.27,0,-.3,0,-.51,.09],["c",-.57,.3,-.81,.9,-.81,2.1],["c",0,1.23,.24,1.83,.81,2.13],["c",.21,.09,.24,.09,.51,.09],["c",.39,0,.57,-.06,1.26,-.42],["c",.3,-.15,.63,-.33,.78,-.36],["c",.24,-.09,.27,-.09,.75,-.09],["c",2.01,0,4.02,.93,5.28,2.4],["c",.9,1.11,1.38,2.4,1.38,3.84],["c",0,1.5,-.3,2.88,-.84,3.96],["c",-.78,1.59,-2.19,2.64,-4.17,3.15],["c",-1.05,.24,-2.67,.36,-3.51,.27],["c",-1.83,-.27,-3.3,-1.44,-3.81,-3.09],["c",-.18,-.54,-.21,-1.29,-.09,-1.74],["c",.15,-.6,.63,-1.2,1.23,-1.47],["c",.36,-.18,.57,-.21,.99,-.21],["c",.42,0,.63,.03,1.02,.21],["c",.42,.21,.84,.63,1.05,1.05],["c",.18,.36,.21,.6,.21,.96],["c",0,.3,0,.36,-.06,.51],["c",-.12,.24,-.27,.42,-.69,.72],["c",-.57,.42,-.69,.63,-.69,1.08],["c",0,.24,0,.3,.06,.45],["c",.12,.21,.3,.39,.57,.54],["c",.42,.18,.87,.21,1.53,.15],["c",1.08,-.15,1.8,-.57,2.34,-1.32],["c",.54,-.75,.84,-1.83,.99,-3.51],["c",.06,-.57,.06,-3.03,0,-3.57],["c",-.12,-1.47,-.42,-2.31,-.99,-2.88],["c",-.27,-.27,-.63,-.48,-1.08,-.6],["c",-.27,-.06,-.39,-.06,-.84,-.06],["c",-.45,0,-.57,0,-.78,.06],["c",-1.14,.27,-2.01,1.17,-2.46,2.49],["c",-.21,.57,-.3,.99,-.33,1.65],["c",-.03,.51,-.06,.57,-.24,.66],["c",-.12,.06,-.27,.06,-.39,0],["c",-.21,-.09,-.21,-.15,-.24,-.75],["c",-.09,-1.92,-.78,-3.72,-2.01,-5.19],["c",-.18,-.21,-.36,-.42,-.39,-.45],["l",-.09,-.06],["l",0,7.11],["l",0,7.14],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.54,.06],["c",-.48,0,-.48,0,-.57,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"]],w:20.31,h:29.97},"clefs.F":{d:[["M",6.3,-7.8],["c",.36,-.03,1.65,0,2.13,.03],["c",3.6,.42,6.03,2.1,6.93,4.86],["c",.27,.84,.36,1.5,.36,2.58],["c",0,.9,-.03,1.35,-.18,2.16],["c",-.78,3.78,-3.54,7.08,-8.37,9.96],["c",-1.74,1.05,-3.87,2.13,-6.18,3.12],["c",-.39,.18,-.75,.33,-.81,.36],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.15,.06,-.21,.51,-.48],["c",3,-1.77,5.13,-3.21,6.84,-4.74],["c",.51,-.45,1.59,-1.5,1.95,-1.95],["c",1.89,-2.19,2.88,-4.32,3.15,-6.78],["c",.06,-.42,.06,-1.77,0,-2.19],["c",-.24,-2.01,-.93,-3.63,-2.04,-4.71],["c",-.63,-.63,-1.29,-1.02,-2.07,-1.2],["c",-1.62,-.39,-3.36,.15,-4.56,1.44],["c",-.54,.6,-1.05,1.47,-1.32,2.22],["l",-.09,.21],["l",.24,-.12],["c",.39,-.21,.63,-.24,1.11,-.24],["c",.3,0,.45,0,.66,.06],["c",1.92,.48,2.85,2.55,1.95,4.38],["c",-.45,.99,-1.41,1.62,-2.46,1.71],["c",-1.47,.09,-2.91,-.87,-3.39,-2.25],["c",-.18,-.57,-.21,-1.32,-.03,-2.28],["c",.39,-2.25,1.83,-4.2,3.81,-5.19],["c",.69,-.36,1.59,-.6,2.37,-.69],["z"],["m",11.58,2.52],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.3,1.17,-.72,2.19,-1.89,1.89],["c",-.99,-.21,-1.5,-1.32,-1.02,-2.25],["c",.18,-.39,.6,-.69,1.02,-.78],["z"],["m",0,7.5],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.21,.87,-.3,1.71,-1.14,1.89],["c",-.87,.21,-1.71,-.3,-1.89,-1.14],["c",-.21,-.84,.3,-1.71,1.14,-1.89],["z"]],w:20.153,h:23.142},"clefs.G":{d:[["M",9.69,-37.41],["c",.09,-.09,.24,-.06,.36,0],["c",.12,.09,.57,.6,.96,1.11],["c",1.77,2.34,3.21,5.85,3.57,8.73],["c",.21,1.56,.03,3.27,-.45,4.86],["c",-.69,2.31,-1.92,4.47,-4.23,7.44],["c",-.3,.39,-.57,.72,-.6,.75],["c",-.03,.06,0,.15,.18,.78],["c",.54,1.68,1.38,4.44,1.68,5.49],["l",.09,.42],["l",.39,0],["c",1.47,.09,2.76,.51,3.96,1.29],["c",1.83,1.23,3.06,3.21,3.39,5.52],["c",.09,.45,.12,1.29,.06,1.74],["c",-.09,1.02,-.33,1.83,-.75,2.73],["c",-.84,1.71,-2.28,3.06,-4.02,3.72],["l",-.33,.12],["l",.03,1.26],["c",0,1.74,-.06,3.63,-.21,4.62],["c",-.45,3.06,-2.19,5.49,-4.47,6.21],["c",-.57,.18,-.9,.21,-1.59,.21],["c",-.69,0,-1.02,-.03,-1.65,-.21],["c",-1.14,-.27,-2.13,-.84,-2.94,-1.65],["c",-.99,-.99,-1.56,-2.16,-1.71,-3.54],["c",-.09,-.81,.06,-1.53,.45,-2.13],["c",.63,-.99,1.83,-1.56,3,-1.53],["c",1.5,.09,2.64,1.32,2.73,2.94],["c",.06,1.47,-.93,2.7,-2.37,2.97],["c",-.45,.06,-.84,.03,-1.29,-.09],["l",-.21,-.09],["l",.09,.12],["c",.39,.54,.78,.93,1.32,1.26],["c",1.35,.87,3.06,1.02,4.35,.36],["c",1.44,-.72,2.52,-2.28,2.97,-4.35],["c",.15,-.66,.24,-1.5,.3,-3.03],["c",.03,-.84,.03,-2.94,0,-3],["c",-.03,0,-.18,0,-.36,.03],["c",-.66,.12,-.99,.12,-1.83,.12],["c",-1.05,0,-1.71,-.06,-2.61,-.3],["c",-4.02,-.99,-7.11,-4.35,-7.8,-8.46],["c",-.12,-.66,-.12,-.99,-.12,-1.83],["c",0,-.84,0,-1.14,.15,-1.92],["c",.36,-2.28,1.41,-4.62,3.3,-7.29],["l",2.79,-3.6],["c",.54,-.66,.96,-1.2,.96,-1.23],["c",0,-.03,-.09,-.33,-.18,-.69],["c",-.96,-3.21,-1.41,-5.28,-1.59,-7.68],["c",-.12,-1.38,-.15,-3.09,-.06,-3.96],["c",.33,-2.67,1.38,-5.07,3.12,-7.08],["c",.36,-.42,.99,-1.05,1.17,-1.14],["z"],["m",2.01,4.71],["c",-.15,-.3,-.3,-.54,-.3,-.54],["c",-.03,0,-.18,.09,-.3,.21],["c",-2.4,1.74,-3.87,4.2,-4.26,7.11],["c",-.06,.54,-.06,1.41,-.03,1.89],["c",.09,1.29,.48,3.12,1.08,5.22],["c",.15,.42,.24,.78,.24,.81],["c",0,.03,.84,-1.11,1.23,-1.68],["c",1.89,-2.73,2.88,-5.07,3.15,-7.53],["c",.09,-.57,.12,-1.74,.06,-2.37],["c",-.09,-1.23,-.27,-1.92,-.87,-3.12],["z"],["m",-2.94,20.7],["c",-.21,-.72,-.39,-1.32,-.42,-1.32],["c",0,0,-1.2,1.47,-1.86,2.37],["c",-2.79,3.63,-4.02,6.3,-4.35,9.3],["c",-.03,.21,-.03,.69,-.03,1.08],["c",0,.69,0,.75,.06,1.11],["c",.12,.54,.27,.99,.51,1.47],["c",.69,1.38,1.83,2.55,3.42,3.42],["c",.96,.54,2.07,.9,3.21,1.08],["c",.78,.12,2.04,.12,2.94,-.03],["c",.51,-.06,.45,-.03,.42,-.3],["c",-.24,-3.33,-.72,-6.33,-1.62,-10.08],["c",-.09,-.39,-.18,-.75,-.18,-.78],["c",-.03,-.03,-.42,0,-.81,.09],["c",-.9,.18,-1.65,.57,-2.22,1.14],["c",-.72,.72,-1.08,1.65,-1.05,2.64],["c",.06,.96,.48,1.83,1.23,2.58],["c",.36,.36,.72,.63,1.17,.9],["c",.33,.18,.36,.21,.42,.33],["c",.18,.42,-.18,.9,-.6,.87],["c",-.18,-.03,-.84,-.36,-1.26,-.63],["c",-.78,-.51,-1.38,-1.11,-1.86,-1.83],["c",-1.77,-2.7,-.99,-6.42,1.71,-8.19],["c",.3,-.21,.81,-.48,1.17,-.63],["c",.3,-.09,1.02,-.3,1.14,-.3],["c",.06,0,.09,0,.09,-.03],["c",.03,-.03,-.51,-1.92,-1.23,-4.26],["z"],["m",3.78,7.41],["c",-.18,-.03,-.36,-.06,-.39,-.06],["c",-.03,0,0,.21,.18,1.02],["c",.75,3.18,1.26,6.3,1.5,9.09],["c",.06,.72,0,.69,.51,.42],["c",.78,-.36,1.44,-.96,1.98,-1.77],["c",1.08,-1.62,1.2,-3.69,.3,-5.55],["c",-.81,-1.62,-2.31,-2.79,-4.08,-3.15],["z"]],w:19.051,h:57.057},"clefs.perc":{d:[["M",5.07,-7.44],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"],["m",6.63,0],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"]],w:21,h:14.97},"timesig.common":{d:[["M",6.66,-7.83],["c",.72,-.06,1.41,-.03,1.98,.09],["c",1.2,.27,2.34,.96,3.09,1.92],["c",.63,.81,1.08,1.86,1.14,2.73],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,0,-.09,-.12,-.24,-.27],["c",-1.02,-1.11,-2.55,-1.68,-4.08,-1.5],["c",-1.29,.15,-2.04,.69,-2.4,1.74],["c",-.36,.93,-.42,1.89,-.42,5.37],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.63,1.68,1.41,2.07],["c",.81,.39,2.16,.45,3.18,.09],["c",1.29,-.45,2.37,-1.53,3.03,-2.97],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.06,.39,-.42,1.38,-.69,1.89],["c",-.96,1.8,-2.49,2.94,-4.23,3.18],["c",-.99,.12,-2.58,-.06,-3.63,-.45],["c",-.96,-.36,-1.71,-.84,-2.4,-1.5],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.9,-3.45,2.01,-4.56],["c",.69,-.66,1.44,-1.11,2.37,-1.47],["c",.63,-.24,1.47,-.42,2.22,-.48],["z"]],w:13.038,h:15.689},"timesig.cut":{d:[["M",6.24,-10.44],["c",.09,-.06,.09,-.06,.48,-.06],["c",.36,0,.36,0,.45,.06],["l",.06,.09],["l",0,1.23],["l",0,1.26],["l",.27,0],["c",1.26,0,2.49,.45,3.48,1.29],["c",1.05,.87,1.8,2.28,1.89,3.48],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,-.03,-.45,-.51,-.66,-.69],["c",-.87,-.69,-1.83,-1.05,-2.94,-1.11],["l",-.42,0],["l",0,7.17],["l",0,7.14],["l",.42,0],["c",.69,-.03,1.23,-.18,1.86,-.51],["c",1.05,-.51,1.89,-1.47,2.46,-2.7],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.03,.24,-.21,.78,-.39,1.2],["c",-.96,2.37,-2.94,3.9,-5.13,3.9],["l",-.3,0],["l",0,1.26],["l",0,1.23],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.45,.06],["c",-.39,0,-.39,0,-.48,-.06],["l",-.06,-.09],["l",0,-1.29],["l",0,-1.29],["l",-.21,-.03],["c",-1.23,-.21,-2.31,-.63,-3.21,-1.29],["c",-.15,-.09,-.45,-.36,-.66,-.57],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.93,-3.45,2.04,-4.59],["c",.42,-.39,.78,-.66,1.26,-.93],["c",.75,-.45,1.65,-.75,2.61,-.9],["l",.21,-.03],["l",0,-1.29],["l",0,-1.29],["z"],["m",-.06,10.44],["c",0,-5.58,0,-6.99,-.03,-6.99],["c",-.15,0,-.63,.27,-.87,.45],["c",-.45,.36,-.75,.93,-.93,1.77],["c",-.18,.81,-.24,1.8,-.24,4.74],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.66,1.68,1.41,2.07],["c",.12,.06,.3,.12,.33,.15],["l",.09,0],["l",0,-6.96],["z"]],w:13.038,h:20.97},"timesig.imperfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.imperfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},f:{d:[["M",9.93,-14.28],["c",1.53,-.18,2.88,.45,3.12,1.5],["c",.12,.51,0,1.32,-.27,1.86],["c",-.15,.3,-.42,.57,-.63,.69],["c",-.69,.36,-1.56,.03,-1.83,-.69],["c",-.09,-.24,-.09,-.69,0,-.87],["c",.06,-.12,.21,-.24,.45,-.42],["c",.42,-.24,.57,-.45,.6,-.72],["c",.03,-.33,-.09,-.39,-.63,-.42],["c",-.3,0,-.45,0,-.6,.03],["c",-.81,.21,-1.35,.93,-1.74,2.46],["c",-.06,.27,-.48,2.25,-.48,2.31],["c",0,.03,.39,.03,.9,.03],["c",.72,0,.9,0,.99,.06],["c",.42,.15,.45,.72,.03,.9],["c",-.12,.06,-.24,.06,-1.17,.06],["l",-1.05,0],["l",-.78,2.55],["c",-.45,1.41,-.87,2.79,-.96,3.06],["c",-.87,2.37,-2.37,4.74,-3.78,5.91],["c",-1.05,.9,-2.04,1.23,-3.09,1.08],["c",-1.11,-.18,-1.89,-.78,-2.04,-1.59],["c",-.12,-.66,.15,-1.71,.54,-2.19],["c",.69,-.75,1.86,-.54,2.22,.39],["c",.06,.15,.09,.27,.09,.48],["c",0,.24,-.03,.27,-.12,.42],["c",-.03,.09,-.15,.18,-.27,.27],["c",-.09,.06,-.27,.21,-.36,.27],["c",-.24,.18,-.36,.36,-.39,.6],["c",-.03,.33,.09,.39,.63,.42],["c",.42,0,.63,-.03,.9,-.15],["c",.6,-.3,.96,-.96,1.38,-2.64],["c",.09,-.42,.63,-2.55,1.17,-4.77],["l",1.02,-4.08],["c",0,-.03,-.36,-.03,-.81,-.03],["c",-.72,0,-.81,0,-.93,-.06],["c",-.42,-.18,-.39,-.75,.03,-.9],["c",.09,-.06,.27,-.06,1.05,-.06],["l",.96,0],["l",0,-.09],["c",.06,-.18,.3,-.72,.51,-1.17],["c",1.2,-2.46,3.3,-4.23,5.34,-4.5],["z"]],w:16.155,h:19.445},m:{d:[["M",2.79,-8.91],["c",.09,0,.3,-.03,.45,-.03],["c",.24,.03,.3,.03,.45,.12],["c",.36,.15,.63,.54,.75,1.02],["l",.03,.21],["l",.33,-.3],["c",.69,-.69,1.38,-1.02,2.07,-1.02],["c",.27,0,.33,0,.48,.06],["c",.21,.09,.48,.36,.63,.6],["c",.03,.09,.12,.27,.18,.42],["c",.03,.15,.09,.27,.12,.27],["c",0,0,.09,-.09,.18,-.21],["c",.33,-.39,.87,-.81,1.29,-.99],["c",.78,-.33,1.47,-.21,2.01,.33],["c",.3,.33,.48,.69,.6,1.14],["c",.09,.42,.06,.54,-.54,3.06],["c",-.33,1.29,-.57,2.4,-.57,2.43],["c",0,.12,.09,.21,.21,.21],["c",.24,0,.75,-.3,1.2,-.72],["c",.45,-.39,.6,-.45,.78,-.27],["c",.18,.18,.09,.36,-.45,.87],["c",-1.05,.96,-1.83,1.47,-2.58,1.71],["c",-.93,.33,-1.53,.21,-1.8,-.33],["c",-.06,-.15,-.06,-.21,-.06,-.45],["c",0,-.24,.03,-.48,.6,-2.82],["c",.42,-1.71,.6,-2.64,.63,-2.79],["c",.03,-.57,-.3,-.75,-.84,-.48],["c",-.24,.12,-.54,.39,-.66,.63],["c",-.03,.09,-.42,1.38,-.9,3],["c",-.9,3.15,-.84,3,-1.14,3.15],["l",-.15,.09],["l",-.78,0],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.36,-1.38,.84,-2.97],["c",.57,-2.04,.81,-2.97,.84,-3.12],["c",.03,-.54,-.3,-.72,-.84,-.45],["c",-.24,.12,-.57,.42,-.66,.63],["c",-.06,.09,-.51,1.44,-1.05,2.97],["c",-.51,1.56,-.99,2.85,-.99,2.91],["c",-.06,.12,-.21,.24,-.36,.3],["c",-.12,.06,-.21,.06,-.9,.06],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.45,-1.38,.99,-2.97],["c",1.05,-3.18,1.05,-3.18,.93,-3.45],["c",-.12,-.27,-.39,-.3,-.72,-.15],["c",-.54,.27,-1.14,1.17,-1.56,2.4],["c",-.06,.15,-.15,.3,-.18,.36],["c",-.21,.21,-.57,.27,-.72,.09],["c",-.09,-.09,-.06,-.21,.06,-.63],["c",.48,-1.26,1.26,-2.46,2.01,-3.21],["c",.57,-.54,1.2,-.87,1.83,-1.02],["z"]],w:14.687,h:9.126},p:{d:[["M",1.92,-8.7],["c",.27,-.09,.81,-.06,1.11,.03],["c",.54,.18,.93,.51,1.17,.99],["c",.09,.15,.15,.33,.18,.36],["l",0,.12],["l",.3,-.27],["c",.66,-.6,1.35,-1.02,2.13,-1.2],["c",.21,-.06,.33,-.06,.78,-.06],["c",.45,0,.51,0,.84,.09],["c",1.29,.33,2.07,1.32,2.25,2.79],["c",.09,.81,-.09,2.01,-.45,2.79],["c",-.54,1.26,-1.86,2.55,-3.18,3.03],["c",-.45,.18,-.81,.24,-1.29,.24],["c",-.69,-.03,-1.35,-.18,-1.86,-.45],["c",-.3,-.15,-.51,-.18,-.69,-.09],["c",-.09,.03,-.18,.09,-.18,.12],["c",-.09,.12,-1.05,2.94,-1.05,3.06],["c",0,.24,.18,.48,.51,.63],["c",.18,.06,.54,.15,.75,.15],["c",.21,0,.36,.06,.42,.18],["c",.12,.18,.06,.42,-.12,.54],["c",-.09,.03,-.15,.03,-.78,0],["c",-1.98,-.15,-3.81,-.15,-5.79,0],["c",-.63,.03,-.69,.03,-.78,0],["c",-.24,-.15,-.24,-.57,.03,-.66],["c",.06,-.03,.48,-.09,.99,-.12],["c",.87,-.06,1.11,-.09,1.35,-.21],["c",.18,-.06,.33,-.18,.39,-.3],["c",.06,-.12,3.24,-9.42,3.27,-9.6],["c",.06,-.33,.03,-.57,-.15,-.69],["c",-.09,-.06,-.12,-.06,-.3,-.06],["c",-.69,.06,-1.53,1.02,-2.28,2.61],["c",-.09,.21,-.21,.45,-.27,.51],["c",-.09,.12,-.33,.24,-.48,.24],["c",-.18,0,-.36,-.15,-.36,-.3],["c",0,-.24,.78,-1.83,1.26,-2.55],["c",.72,-1.11,1.47,-1.74,2.28,-1.92],["z"],["m",5.37,1.47],["c",-.27,-.12,-.75,-.03,-1.14,.21],["c",-.75,.48,-1.47,1.68,-1.89,3.15],["c",-.45,1.47,-.42,2.34,0,2.7],["c",.45,.39,1.26,.21,1.83,-.36],["c",.51,-.51,.99,-1.68,1.38,-3.27],["c",.3,-1.17,.33,-1.74,.15,-2.13],["c",-.09,-.15,-.15,-.21,-.33,-.3],["z"]],w:14.689,h:13.127},r:{d:[["M",6.33,-9.12],["c",.27,-.03,.93,0,1.2,.06],["c",.84,.21,1.23,.81,1.02,1.53],["c",-.24,.75,-.9,1.17,-1.56,.96],["c",-.33,-.09,-.51,-.3,-.66,-.75],["c",-.03,-.12,-.09,-.24,-.12,-.3],["c",-.09,-.15,-.3,-.24,-.48,-.24],["c",-.57,0,-1.38,.54,-1.65,1.08],["c",-.06,.15,-.33,1.17,-.9,3.27],["c",-.57,2.31,-.81,3.12,-.87,3.21],["c",-.03,.06,-.12,.15,-.18,.21],["l",-.12,.06],["l",-.81,.03],["c",-.69,0,-.81,0,-.9,-.03],["c",-.09,-.06,-.18,-.21,-.18,-.3],["c",0,-.06,.39,-1.62,.9,-3.51],["c",.84,-3.24,.87,-3.45,.87,-3.72],["c",0,-.21,0,-.27,-.03,-.36],["c",-.12,-.15,-.21,-.24,-.42,-.24],["c",-.24,0,-.45,.15,-.78,.42],["c",-.33,.36,-.45,.54,-.72,1.14],["c",-.03,.12,-.21,.24,-.36,.27],["c",-.12,0,-.15,0,-.24,-.06],["c",-.18,-.12,-.18,-.21,-.06,-.54],["c",.21,-.57,.42,-.93,.78,-1.32],["c",.54,-.51,1.2,-.81,1.95,-.87],["c",.81,-.03,1.53,.3,1.92,.87],["l",.12,.18],["l",.09,-.09],["c",.57,-.45,1.41,-.84,2.19,-.96],["z"]],w:9.41,h:9.132},s:{d:[["M",4.47,-8.73],["c",.09,0,.36,-.03,.57,-.03],["c",.75,.03,1.29,.24,1.71,.63],["c",.51,.54,.66,1.26,.36,1.83],["c",-.24,.42,-.63,.57,-1.11,.42],["c",-.33,-.09,-.6,-.36,-.6,-.57],["c",0,-.03,.06,-.21,.15,-.39],["c",.12,-.21,.15,-.33,.18,-.48],["c",0,-.24,-.06,-.48,-.15,-.6],["c",-.15,-.21,-.42,-.24,-.75,-.15],["c",-.27,.06,-.48,.18,-.69,.36],["c",-.39,.39,-.51,.96,-.33,1.38],["c",.09,.21,.42,.51,.78,.72],["c",1.11,.69,1.59,1.11,1.89,1.68],["c",.21,.39,.24,.78,.15,1.29],["c",-.18,1.2,-1.17,2.16,-2.52,2.52],["c",-1.02,.24,-1.95,.12,-2.7,-.42],["c",-.72,-.51,-.99,-1.47,-.6,-2.19],["c",.24,-.48,.72,-.63,1.17,-.42],["c",.33,.18,.54,.45,.57,.81],["c",0,.21,-.03,.3,-.33,.51],["c",-.33,.24,-.39,.42,-.27,.69],["c",.06,.15,.21,.27,.45,.33],["c",.3,.09,.87,.09,1.2,0],["c",.75,-.21,1.23,-.72,1.29,-1.35],["c",.03,-.42,-.15,-.81,-.54,-1.2],["c",-.24,-.24,-.48,-.42,-1.41,-1.02],["c",-.69,-.42,-1.05,-.93,-1.05,-1.47],["c",0,-.39,.12,-.87,.3,-1.23],["c",.27,-.57,.78,-1.05,1.38,-1.35],["c",.24,-.12,.63,-.27,.9,-.3],["z"]],w:6.632,h:8.758},z:{d:[["M",2.64,-7.95],["c",.36,-.09,.81,-.03,1.71,.27],["c",.78,.21,.96,.27,1.74,.3],["c",.87,.06,1.02,.03,1.38,-.21],["c",.21,-.15,.33,-.15,.48,-.06],["c",.15,.09,.21,.3,.15,.45],["c",-.03,.06,-1.26,1.26,-2.76,2.67],["l",-2.73,2.55],["l",.54,.03],["c",.54,.03,.72,.03,2.01,.15],["c",.36,.03,.9,.06,1.2,.09],["c",.66,0,.81,-.03,1.02,-.24],["c",.3,-.3,.39,-.72,.27,-1.23],["c",-.06,-.27,-.06,-.27,-.03,-.39],["c",.15,-.3,.54,-.27,.69,.03],["c",.15,.33,.27,1.02,.27,1.5],["c",0,1.47,-1.11,2.7,-2.52,2.79],["c",-.57,.03,-1.02,-.09,-2.01,-.51],["c",-1.02,-.42,-1.23,-.48,-2.13,-.54],["c",-.81,-.06,-.96,-.03,-1.26,.18],["c",-.12,.06,-.24,.12,-.27,.12],["c",-.27,0,-.45,-.3,-.36,-.51],["c",.03,-.06,1.32,-1.32,2.91,-2.79],["l",2.88,-2.73],["c",-.03,0,-.21,.03,-.42,.06],["c",-.21,.03,-.78,.09,-1.23,.12],["c",-1.11,.12,-1.23,.15,-1.95,.27],["c",-.72,.15,-1.17,.18,-1.29,.09],["c",-.27,-.18,-.21,-.75,.12,-1.26],["c",.39,-.6,.93,-1.02,1.59,-1.2],["z"]],w:8.573,h:8.743},"+":{d:[["M",3.48,-9.3],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.29],["l",0,1.29],["l",1.29,0],["c",1.23,0,1.29,0,1.41,.06],["c",.06,.03,.15,.09,.18,.12],["c",.12,.09,.21,.33,.21,.48],["c",0,.15,-.09,.39,-.21,.48],["c",-.03,.03,-.12,.09,-.18,.12],["c",-.12,.06,-.18,.06,-1.41,.06],["l",-1.29,0],["l",0,1.29],["c",0,1.23,0,1.29,-.06,1.41],["c",-.09,.18,-.15,.24,-.3,.33],["c",-.21,.09,-.39,.09,-.57,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.41],["l",0,-1.29],["l",-1.29,0],["c",-1.23,0,-1.29,0,-1.41,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.26,0],["l",1.29,0],["l",0,-1.29],["c",0,-1.23,0,-1.29,.06,-1.41],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:7.507,h:7.515},",":{d:[["M",1.32,-3.36],["c",.57,-.15,1.17,.03,1.59,.45],["c",.45,.45,.6,.96,.51,1.89],["c",-.09,1.23,-.42,2.46,-.99,3.93],["c",-.3,.72,-.72,1.62,-.78,1.68],["c",-.18,.21,-.51,.18,-.66,-.06],["c",-.03,-.06,-.06,-.15,-.06,-.18],["c",0,-.06,.12,-.33,.24,-.63],["c",.84,-1.8,1.02,-2.61,.69,-3.24],["c",-.12,-.24,-.27,-.36,-.75,-.6],["c",-.36,-.15,-.42,-.21,-.6,-.39],["c",-.69,-.69,-.69,-1.71,0,-2.4],["c",.21,-.21,.51,-.39,.81,-.45],["z"]],w:3.452,h:8.143},"-":{d:[["M",.18,-5.34],["c",.09,-.06,.15,-.06,2.31,-.06],["c",2.46,0,2.37,0,2.46,.21],["c",.12,.21,.03,.42,-.15,.54],["c",-.09,.06,-.15,.06,-2.28,.06],["c",-2.16,0,-2.22,0,-2.31,-.06],["c",-.27,-.15,-.27,-.54,-.03,-.69],["z"]],w:5.001,h:.81},".":{d:[["M",1.32,-3.36],["c",1.05,-.27,2.1,.57,2.1,1.65],["c",0,1.08,-1.05,1.92,-2.1,1.65],["c",-.9,-.21,-1.5,-1.14,-1.26,-2.04],["c",.12,-.63,.63,-1.11,1.26,-1.26],["z"]],w:3.413,h:3.402},"scripts.wedge":{d:[["M",-3.66,-7.44],["c",.06,-.09,0,-.09,.81,.03],["c",1.86,.3,3.84,.3,5.73,0],["c",.78,-.12,.72,-.12,.78,-.03],["c",.15,.15,.12,.24,-.24,.6],["c",-.93,.93,-1.98,2.76,-2.67,4.62],["c",-.3,.78,-.51,1.71,-.51,2.13],["c",0,.15,0,.18,-.06,.27],["c",-.12,.09,-.24,.09,-.36,0],["c",-.06,-.09,-.06,-.12,-.06,-.27],["c",0,-.42,-.21,-1.35,-.51,-2.13],["c",-.69,-1.86,-1.74,-3.69,-2.67,-4.62],["c",-.36,-.36,-.39,-.45,-.24,-.6],["z"]],w:7.49,h:7.752},"scripts.thumb":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.27,1.41,-1.08,2.43,-2.16,2.73],["l",-.18,.06],["l",0,.12],["c",.03,.06,.06,.45,.09,.87],["c",.03,.57,.03,.78,0,.84],["c",-.09,.27,-.39,.48,-.66,.48],["c",-.27,0,-.57,-.21,-.66,-.48],["c",-.03,-.06,-.03,-.27,0,-.84],["c",.03,-.42,.06,-.81,.09,-.87],["l",0,-.12],["l",-.18,-.06],["c",-1.08,-.3,-1.89,-1.32,-2.16,-2.73],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.05,.9],["c",-.15,-.09,-.21,-.09,-.45,-.12],["c",-.15,0,-.3,.03,-.39,.03],["c",-.57,.18,-.9,.72,-1.08,1.74],["c",-.06,.48,-.06,1.8,0,2.28],["c",.15,.9,.42,1.44,.9,1.65],["c",.18,.09,.21,.09,.51,.09],["c",.3,0,.33,0,.51,-.09],["c",.48,-.21,.75,-.75,.9,-1.65],["c",.03,-.27,.03,-.54,.03,-1.14],["c",0,-.6,0,-.87,-.03,-1.14],["c",-.15,-.9,-.45,-1.44,-.9,-1.65],["z"]],w:5.955,h:9.75},"scripts.open":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.33,1.74,-1.47,2.85,-2.91,2.85],["c",-1.44,0,-2.58,-1.11,-2.91,-2.85],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.11,.9],["c",-.21,-.09,-.27,-.09,-.51,-.12],["c",-.3,0,-.42,.03,-.66,.15],["c",-.24,.12,-.51,.39,-.66,.63],["c",-.54,.93,-.63,2.64,-.21,3.81],["c",.21,.54,.51,.9,.93,1.11],["c",.21,.09,.24,.09,.54,.09],["c",.3,0,.33,0,.54,-.09],["c",.42,-.21,.72,-.57,.93,-1.11],["c",.36,-.99,.36,-2.37,0,-3.36],["c",-.21,-.54,-.51,-.9,-.9,-1.11],["z"]],w:5.955,h:7.5},"scripts.longphrase":{d:[["M",1.47,-15.09],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.54,.06,11.25],["l",0,11.25],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-3.39,-.03,-11.25],["l",0,-11.25],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:23.04},"scripts.mediumphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.39,.06,7.5],["l",0,7.5],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-2.28,-.03,-7.5],["l",0,-7.5],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:15.54},"scripts.shortphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.21,.06,3.75],["l",0,3.75],["l",-.42,.09],["c",-.57,.18,-1.65,.45,-1.71,.45],["c",-.03,0,-.03,-.72,-.03,-3.75],["l",0,-3.75],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:8.04},"scripts.snap":{d:[["M",4.5,-3.39],["c",.36,-.03,.96,-.03,1.35,0],["c",1.56,.15,3.15,.9,4.2,2.01],["c",.24,.27,.33,.42,.33,.6],["c",0,.27,.03,.24,-2.46,2.22],["c",-1.29,1.02,-2.4,1.86,-2.49,1.92],["c",-.18,.09,-.3,.09,-.48,0],["c",-.09,-.06,-1.2,-.9,-2.49,-1.92],["c",-2.49,-1.98,-2.46,-1.95,-2.46,-2.22],["c",0,-.18,.09,-.33,.33,-.6],["c",1.05,-1.08,2.64,-1.86,4.17,-2.01],["z"],["m",1.29,1.17],["c",-1.47,-.15,-2.97,.3,-4.14,1.2],["l",-.18,.15],["l",.06,.09],["c",.15,.12,3.63,2.85,3.66,2.85],["c",.03,0,3.51,-2.73,3.66,-2.85],["l",.06,-.09],["l",-.18,-.15],["c",-.84,-.66,-1.89,-1.08,-2.94,-1.2],["z"]],w:10.38,h:6.84},"noteheads.slash.whole":{d:[["M",5,-5],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"],["m",0,-2],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",-4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"]],w:10.81,h:15.63},"noteheads.slash.quarter":{d:[["M",9,-6],["l",0,4],["l",-9,9],["l",0,-4],["z"]],w:9,h:9},"noteheads.harmonic.quarter":{d:[["M",3.63,-4.02],["c",.09,-.06,.18,-.09,.24,-.03],["c",.03,.03,.87,.93,1.83,2.01],["c",1.5,1.65,1.8,1.98,1.8,2.04],["c",0,.06,-.3,.39,-1.8,2.04],["c",-.96,1.08,-1.8,1.98,-1.83,2.01],["c",-.06,.06,-.15,.03,-.24,-.03],["c",-.12,-.09,-3.54,-3.84,-3.6,-3.93],["c",-.03,-.03,-.03,-.09,-.03,-.15],["c",.03,-.06,3.45,-3.84,3.63,-3.96],["z"]],w:7.5,h:8.165}},a=function(e){for(var t=[],n=0,r=e.length;n<r;n++){t[n]=[];for(var i=0,a=e[n].length;i<a;i++)t[n][i]=e[n][i]}return t},s={printSymbol:function(e,t,n,r,s,o,c){if(!i[n])return null;var l=a(i[n].d);l[0][1]+=e,l[0][2]+=t;for(var h="",u=0;u<l.length;u++)h+=l[u].join(" ");return r.path({path:h,stroke:o,fill:c,class:s})},getPathForSymbol:function(e,t,n,r,s){if(r=r||1,s=s||1,!i[n])return null;var o=a(i[n].d);return 1===r&&1===s||function(e,t,n){for(var r=0,i=e.length;r<i;r++){var a,s,o=e[r];for(a=1,s=o.length;a<s;a++)o[a]*=a%2?t:n}}(o,r,s),o[0][1]+=e,o[0][2]+=t,o},getSymbolWidth:function(e){return i[e]?i[e].w:0},symbolHeightInPitches:function(e){return(i[e]?i[e].h:0)/r.STEP},getSymbolAlign:function(e){return"scripts"===e.substring(0,7)&&"scripts.roll"!==e?"center":"left"},getYCorr:function(e){switch(e){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":return-2;case"timesig.common":case"timesig.cut":return 0;case"flags.d32nd":return-1;case"flags.d64th":return-2;case"flags.u32nd":return 1;case"flags.u64th":return 3;case"rests.whole":return 1;case"rests.half":case"rests.8th":case"rests.quarter":case"rests.16th":case"rests.32nd":case"rests.64th":return-1;case"f":case"m":case"p":case"s":case"z":return-4;case"scripts.trill":case"scripts.upbow":case"scripts.downbow":return-2;case"scripts.ufermata":case"scripts.wedge":case"scripts.roll":case"scripts.shortphrase":case"scripts.longphrase":return-1;case"scripts.dfermata":return 1;default:return 0}},setSymbol:function(e,t){i[e]=t}};e.exports=s},function(e,t,n){var r=n(8),i=function(e,t,n,r,i,a){a||(a={}),this.tuneNumber=i,this.abcelem=e,this.duration=t,this.durationClass=a.durationClassOveride?a.durationClassOveride:this.duration,this.minspacing=n||0,this.x=0,this.children=[],this.heads=[],this.extra=[],this.extraw=0,this.w=0,this.right=[],this.invisible=!1,this.bottom=void 0,this.top=void 0,this.type=r,this.fixed={w:0,t:void 0,b:void 0},this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};i.prototype.getFixedCoords=function(){return{x:this.x,w:this.fixed.w,t:this.fixed.t,b:this.fixed.b}},i.prototype.addExtra=function(e){this.fixed.w=Math.max(this.fixed.w,e.dx+e.w),void 0===this.fixed.t?this.fixed.t=e.top:this.fixed.t=Math.max(this.fixed.t,e.top),void 0===this.fixed.b?this.fixed.b=e.bottom:this.fixed.b=Math.min(this.fixed.b,e.bottom),e.dx<this.extraw&&(this.extraw=e.dx),this.extra[this.extra.length]=e,this._addChild(e)},i.prototype.addHead=function(e){e.dx<this.extraw&&(this.extraw=e.dx),this.heads[this.heads.length]=e,this.addRight(e)},i.prototype.addRight=function(e){this.fixed.w=Math.max(this.fixed.w,e.dx+e.w),void 0!==e.top&&(void 0===this.fixed.t?this.fixed.t=e.top:this.fixed.t=Math.max(this.fixed.t,e.top)),void 0!==e.bottom&&(void 0===this.fixed.b?this.fixed.b=e.bottom:this.fixed.b=Math.min(this.fixed.b,e.bottom)),isNaN(this.fixed.t)||isNaN(this.fixed.b),e.dx+e.w>this.w&&(this.w=e.dx+e.w),this.right[this.right.length]=e,this._addChild(e)},i.prototype.addFixed=function(e){this._addChild(e)},i.prototype.addFixedX=function(e){this._addChild(e)},i.prototype.addCentered=function(e){var t=e.w/2;-t<this.extraw&&(this.extraw=-t),this.extra[this.extra.length]=e,e.dx+t>this.w&&(this.w=e.dx+t),this.right[this.right.length]=e,this._addChild(e)},i.prototype.setLimit=function(e,t){t[e]&&(this.specialY[e]?this.specialY[e]=Math.max(this.specialY[e],t[e]):this.specialY[e]=t[e])},i.prototype._addChild=function(e){e.parent=this,this.children[this.children.length]=e,this.pushTop(e.top),this.pushBottom(e.bottom),this.setLimit("tempoHeightAbove",e),this.setLimit("partHeightAbove",e),this.setLimit("volumeHeightAbove",e),this.setLimit("dynamicHeightAbove",e),this.setLimit("endingHeightAbove",e),this.setLimit("chordHeightAbove",e),this.setLimit("lyricHeightAbove",e),this.setLimit("lyricHeightBelow",e),this.setLimit("chordHeightBelow",e),this.setLimit("volumeHeightBelow",e),this.setLimit("dynamicHeightBelow",e)},i.prototype.pushTop=function(e){void 0!==e&&(void 0===this.top?this.top=e:this.top=Math.max(e,this.top))},i.prototype.pushBottom=function(e){void 0!==e&&(void 0===this.bottom?this.bottom=e:this.bottom=Math.min(e,this.bottom))},i.prototype.setX=function(e){this.x=e;for(var t=0;t<this.children.length;t++)this.children[t].setX(e)},i.prototype.center=function(e,t){var n=(t.x-e.x)/2+e.x;this.x=n-this.w/2;for(var r=0;r<this.children.length;r++)this.children[r].setX(this.x)},i.prototype.setHint=function(){this.hint=!0},i.prototype.isIE=!1,i.prototype.highlight=function(e,t){void 0===e&&(e="abcjs-note_selected"),void 0===t&&(t="#ff0000"),r(this.elemset,e,"",t)},i.prototype.unhighlight=function(e,t){void 0===e&&(e="abcjs-note_selected"),void 0===t&&(t="#000000"),r(this.elemset,"",e,t)},e.exports=i},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(){for(var e,t,r,i,a,s=0,o=arguments[s++],c=[];o;){if(t=/^[^\x25]+/.exec(o))c.push(t[0]);else if(t=/^\x25{2}/.exec(o))c.push("%");else{if(!(t=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(o)))throw"Huh ?!";if(null==(e=arguments[t[1]||s++])||null==e)throw"Too few arguments.";if(/[^s]/.test(t[7])&&"number"!=typeof e)throw"Expecting number but found "+n(e);switch(t[7]){case"b":e=e.toString(2);break;case"c":e=String.fromCharCode(e);break;case"d":e=parseInt(e);break;case"e":e=t[6]?e.toExponential(t[6]):e.toExponential();break;case"f":e=t[6]?parseFloat(e).toFixed(t[6]):parseFloat(e);break;case"o":e=e.toString(8);break;case"s":e=(e=String(e))&&t[6]?e.substring(0,t[6]):e;break;case"u":e=Math.abs(e);break;case"x":e=e.toString(16);break;case"X":e=e.toString(16).toUpperCase()}e=/[def]/.test(t[7])&&t[2]&&e>0?"+"+e:e,i=t[3]?"0"==t[3]?"0":t[3].charAt(1):" ",a=t[5]-String(e).length,r=t[5]?str_repeat(i,a):"",c.push(t[4]?e+r:r+e)}o=o.substring(t[0].length)}return c.join("")}},function(e,t){e.exports=function(e,t,n,r){if(e)for(var i=0;i<e.length;i++){var a=e[i],s=a.getAttribute("highlight");s||(s="fill"),a.setAttribute(s,r);var o=a.getAttribute("class");o||(o=""),o=(o=o.replace(n,"")).replace(t,""),t.length>0&&(o.length>0&&" "!==o.charAt(o.length-1)&&(o+=" "),o+=t),a.setAttribute("class",o)}}},function(e,t){e.exports=function(e,t,n){return e.paper.path(t)}},function(e,t,n){var r=n(0),i={};!function(){"use strict";var e,t,n,a,s;i.initialize=function(r,i,o,c,l){e=r,t=i,a=c,s=l,(n=o).annotationfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},n.gchordfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},n.historyfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},n.infofont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},n.measurefont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},n.partsfont={face:'"Times New Roman"',size:15,weight:"normal",style:"normal",decoration:"none"},n.repeatfont={face:'"Times New Roman"',size:13,weight:"normal",style:"normal",decoration:"none"},n.textfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},n.tripletfont={face:"Times",size:11,weight:"normal",style:"italic",decoration:"none"},n.vocalfont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},n.wordsfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},a.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},a.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},a.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},a.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},a.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},a.formatting.annotationfont=n.annotationfont,a.formatting.gchordfont=n.gchordfont,a.formatting.historyfont=n.historyfont,a.formatting.infofont=n.infofont,a.formatting.measurefont=n.measurefont,a.formatting.partsfont=n.partsfont,a.formatting.repeatfont=n.repeatfont,a.formatting.textfont=n.textfont,a.formatting.tripletfont=n.tripletfont,a.formatting.vocalfont=n.vocalfont,a.formatting.wordsfont=n.wordsfont};var o={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},c=function(e,n,r,i,a){function s(){var s=parseInt(e[0].token);return e.shift(),n?0===e.length?{face:n.face,weight:n.weight,style:n.style,decoration:n.decoration,size:s}:1===e.length&&"box"===e[0].token&&o[a]?{face:n.face,weight:n.weight,style:n.style,decoration:n.decoration,size:s,box:!0}:(t("Extra parameters in font definition.",r,i),{face:n.face,weight:n.weight,style:n.style,decoration:n.decoration,size:s}):(t("Can't set just the size of the font since there is no default value.",r,i),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:s})}if("*"===e[0].token){if(e.shift(),"number"===e[0].type)return s();t("Expected font size number after *.",r,i)}if("number"===e[0].type)return s();for(var c,l=[],h="normal",u="normal",d="none",f=!1,p="face",m=!1;e.length;){var g=e.shift(),v=g.token.toLowerCase();switch(p){case"face":m||"utf"!==v&&"number"!==g.type&&"bold"!==v&&"italic"!==v&&"underline"!==v&&"box"!==v?l.length>0&&"-"===g.token?(m=!0,l[l.length-1]=l[l.length-1]+g.token):m?(m=!1,l[l.length-1]=l[l.length-1]+g.token):l.push(g.token):"number"===g.type?(c?t("Font size specified twice in font definition.",r,i):c=g.token,p="modifier"):"bold"===v?h="bold":"italic"===v?u="italic":"underline"===v?d="underline":"box"===v?(o[a]?f=!0:t('This font style doesn\'t support "box"',r,i),p="finished"):"utf"===v?(g=e.shift(),p="size"):t("Unknown parameter "+g.token+" in font definition.",r,i);break;case"size":"number"===g.type?c?t("Font size specified twice in font definition.",r,i):c=g.token:t("Expected font size in font definition.",r,i),p="modifier";break;case"modifier":"bold"===v?h="bold":"italic"===v?u="italic":"underline"===v?d="underline":"box"===v?(o[a]?f=!0:t('This font style doesn\'t support "box"',r,i),p="finished"):t("Unknown parameter "+g.token+" in font definition.",r,i);break;case"finished":t('Extra characters found after "box" in font definition.',r,i)}}void 0===c?n?c=n.size:(t("Must specify the size of the font since there is no default value.",r,i),c=12):c=parseFloat(c),""===(l=l.join(" "))&&(n?l=n.face:(t("Must specify the name of the font since there is no default value.",r,i),l="sans-serif"));var b=function(e){switch(e){case"Arial-Italic":return{face:"Arial",weight:"normal",style:"italic",decoration:"none"};case"Arial-Bold":return{face:"Arial",weight:"bold",style:"normal",decoration:"none"};case"Bookman-Demi":return{face:"Bookman,serif",weight:"bold",style:"normal",decoration:"none"};case"Bookman-DemiItalic":return{face:"Bookman,serif",weight:"bold",style:"italic",decoration:"none"};case"Bookman-Light":return{face:"Bookman,serif",weight:"normal",style:"normal",decoration:"none"};case"Bookman-LightItalic":return{face:"Bookman,serif",weight:"normal",style:"italic",decoration:"none"};case"Courier":return{face:'"Courier New"',weight:"normal",style:"normal",decoration:"none"};case"Courier-Oblique":return{face:'"Courier New"',weight:"normal",style:"italic",decoration:"none"};case"Courier-Bold":return{face:'"Courier New"',weight:"bold",style:"normal",decoration:"none"};case"Courier-BoldOblique":return{face:'"Courier New"',weight:"bold",style:"italic",decoration:"none"};case"AvantGarde-Book":return{face:"AvantGarde,Arial",weight:"normal",style:"normal",decoration:"none"};case"AvantGarde-BookOblique":return{face:"AvantGarde,Arial",weight:"normal",style:"italic",decoration:"none"};case"AvantGarde-Demi":case"Avant-Garde-Demi":return{face:"AvantGarde,Arial",weight:"bold",style:"normal",decoration:"none"};case"AvantGarde-DemiOblique":return{face:"AvantGarde,Arial",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Oblique":return{face:"Helvetica",weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Bold":return{face:"Helvetica",weight:"bold",style:"normal",decoration:"none"};case"Helvetica-BoldOblique":return{face:"Helvetica",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Narrow":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"normal",decoration:"none"};case"Helvetica-Narrow-Oblique":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Narrow-Bold":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"normal",decoration:"none"};case"Helvetica-Narrow-BoldOblique":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"italic",decoration:"none"};case"Palatino-Roman":return{face:"Palatino",weight:"normal",style:"normal",decoration:"none"};case"Palatino-Italic":return{face:"Palatino",weight:"normal",style:"italic",decoration:"none"};case"Palatino-Bold":return{face:"Palatino",weight:"bold",style:"normal",decoration:"none"};case"Palatino-BoldItalic":return{face:"Palatino",weight:"bold",style:"italic",decoration:"none"};case"NewCenturySchlbk-Roman":return{face:'"New Century",serif',weight:"normal",style:"normal",decoration:"none"};case"NewCenturySchlbk-Italic":return{face:'"New Century",serif',weight:"normal",style:"italic",decoration:"none"};case"NewCenturySchlbk-Bold":return{face:'"New Century",serif',weight:"bold",style:"normal",decoration:"none"};case"NewCenturySchlbk-BoldItalic":return{face:'"New Century",serif',weight:"bold",style:"italic",decoration:"none"};case"Times":case"Times-Roman":case"Times-Narrow":case"Times-Courier":case"Times-New-Roman":return{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none"};case"Times-Italic":case"Times-Italics":return{face:'"Times New Roman"',weight:"normal",style:"italic",decoration:"none"};case"Times-Bold":return{face:'"Times New Roman"',weight:"bold",style:"normal",decoration:"none"};case"Times-BoldItalic":return{face:'"Times New Roman"',weight:"bold",style:"italic",decoration:"none"};case"ZapfChancery-MediumItalic":return{face:'"Zapf Chancery",cursive,serif',weight:"normal",style:"normal",decoration:"none"};default:return null}}(l),y={};return b?(y.face=b.face,y.weight=b.weight,y.style=b.style,y.decoration=b.decoration,y.size=c,f&&(y.box=!0),y):(y.face=l,y.weight=h,y.style=u,y.decoration=d,y.size=c,f&&(y.box=!0),y)},l=function(e,t,r){return 0===t.length?'Directive "'+e+'" requires a font as a parameter.':(n[e]=c(t,n[e],r,0,e),n.is_in_header&&(a.formatting[e]=n[e]),null)},h=function(e,t){var n="";r.each(t,(function(e){n+=e.token}));var i=parseFloat(n);if(isNaN(i)||0===i)return'Directive "'+e+'" requires a number as a parameter.';a.formatting.scale=i},u=function(e,t,r,i,a){if(1!==r.length||"number"!==r[0].type)return'Directive "'+t+'" requires a number as a parameter.';var s=r[0].intt;return void 0!==i&&s<i?'Directive "'+t+'" requires a number greater than or equal to '+i+" as a parameter.":void 0!==a&&s>a?'Directive "'+t+'" requires a number less than or equal to '+a+" as a parameter.":(n[e]=s,null)},d=function(e,t,r){if(1===r.length&&("true"===r[0].token||"false"===r[0].token))return n[e]="true"===r[0].token,null;var i=u(e,t,r,0,1);return null!==i?i:(n[e]=1===n[e],null)},f=function(e,t,r,i){if(1!==r.length)return'Directive "'+t+'" requires one of [ '+i.join(", ")+" ] as a parameter.";for(var a=r[0].token,s=!1,o=0;!s&&o<i.length;o++)i[o]===a&&(s=!0);return s?(n[e]=a,null):'Directive "'+t+'" requires one of [ '+i.join(", ")+" ] as a parameter."},p=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],m=["gchord","ptstress","beatstring"],g=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc"],v=["program"],b=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],y=["beat"],w=["drone"],x=["portamento"],k=["expand","grace","trim"],A=["drum","chordname"];i.parseFontChangeLine=function(e){var t=e.split("$");if(t.length>1&&n.setfont){for(var r=[{text:t[0]}],i=1;i<t.length;i++)"0"===t[i].charAt(0)?r.push({text:t[i].substring(1)}):"1"===t[i].charAt(0)&&n.setfont[1]?r.push({font:n.setfont[1],text:t[i].substring(1)}):"2"===t[i].charAt(0)&&n.setfont[2]?r.push({font:n.setfont[2],text:t[i].substring(1)}):"3"===t[i].charAt(0)&&n.setfont[3]?r.push({font:n.setfont[3],text:t[i].substring(1)}):"4"===t[i].charAt(0)&&n.setfont[4]?r.push({font:n.setfont[4],text:t[i].substring(1)}):r[r.length-1].text+="$"+t[i];if(r.length>1)return r}return e};var T=["auto","above","below","hidden"];i.addDirective=function(o){var S=e.tokenize(o,0,o.length);if(0===S.length||"alpha"!==S[0].type)return null;var M=o.substring(o.indexOf(S[0].token)+S[0].token.length);M=e.stripComment(M);var N=S.shift().token.toLowerCase(),C="";switch(N){case"bagpipes":a.formatting.bagpipes=!0;break;case"flatbeams":a.formatting.flatbeams=!0;break;case"landscape":n.landscape=!0;break;case"papersize":n.papersize=M;break;case"graceslurs":if(1!==S.length)return"Directive graceslurs requires one parameter: 0 or 1";if("0"===S[0].token||"false"===S[0].token)a.formatting.graceSlurs=!1;else{if("1"!==S[0].token&&"true"!==S[0].token)return"Directive graceslurs requires one parameter: 0 or 1 (received "+S[0].token+")";a.formatting.graceSlurs=!0}break;case"stretchlast":a.formatting.stretchlast=!0;break;case"titlecaps":n.titlecaps=!0;break;case"titleleft":a.formatting.titleleft=!0;break;case"measurebox":a.formatting.measurebox=!0;break;case"vocal":return f("vocalPosition",N,S,T);case"dynamic":return f("dynamicPosition",N,S,T);case"gchord":return f("chordPosition",N,S,T);case"ornament":return f("ornamentPosition",N,S,T);case"volume":return f("volumePosition",N,S,T);case"botmargin":case"botspace":case"composerspace":case"indent":case"leftmargin":case"linesep":case"musicspace":case"partsspace":case"pageheight":case"pagewidth":case"rightmargin":case"staffsep":case"staffwidth":case"subtitlespace":case"sysstaffsep":case"systemsep":case"textspace":case"titlespace":case"topmargin":case"topspace":case"vocalspace":case"wordsspace":return function(t,n){var r=e.getMeasurement(n);return 0===r.used||0!==n.length?'Directive "'+t+'" requires a measurement as a parameter.':(a.formatting[t]=r.value,null)}(N,S);case"voicescale":if(1!==S.length||"number"!==S[0].type)return"voicescale requires one float as a parameter";var E=S.shift();return n.currentVoice&&(n.currentVoice.scale=E.floatt,s.changeVoiceScale(n.currentVoice.scale)),null;case"vskip":var I=Math.round(function(t,n){var r=e.getMeasurement(n);return 0===r.used||0!==n.length?{error:'Directive "'+t+'" requires a measurement as a parameter.'}:r.value}(N,S));return I.error?I.error:(s.addSpacing(I),null);case"scale":h(N,S);break;case"sep":if(0===S.length)s.addSeparator(14,14,85);else{var _=e.getMeasurement(S);if(0===_.used)return'Directive "'+N+'" requires 3 numbers: space above, space below, length of line';var B=_.value;if(0===(_=e.getMeasurement(S)).used)return'Directive "'+N+'" requires 3 numbers: space above, space below, length of line';var P=_.value;if(0===(_=e.getMeasurement(S)).used||0!==S.length)return'Directive "'+N+'" requires 3 numbers: space above, space below, length of line';var D=_.value;s.addSeparator(B,P,D)}break;case"barsperstaff":if(null!==(C=u("barsperstaff",N,S)))return C;break;case"staffnonote":if(1!==S.length)return"Directive staffnonote requires one parameter: 0 or 1";if("0"===S[0].token)n.staffnonote=!0;else{if("1"!==S[0].token)return"Directive staffnonote requires one parameter: 0 or 1 (received "+S[0].token+")";n.staffnonote=!1}break;case"printtempo":if(null!==(C=d("printTempo",N,S)))return C;break;case"partsbox":if(null!==(C=d("partsBox",N,S)))return C;n.partsfont.box=n.partsBox;break;case"freegchord":if(null!==(C=d("freegchord",N,S)))return C;break;case"measurenb":case"barnumbers":if(null!==(C=u("barNumbers",N,S)))return C;break;case"setbarnb":if(1!==S.length||"number"!==S[0].type)return"Directive setbarnb requires a number as a parameter.";n.currBarNumber=s.setBarNumberImmediate(S[0].intt);break;case"begintext":n.inTextBlock=!0;break;case"continueall":n.continueall=!0;break;case"beginps":n.inPsBlock=!0,t("Postscript ignored",o,0);break;case"deco":M.length>0&&n.ignoredDecorations.push(M.substring(0,M.indexOf(" "))),t("Decoration redefinition ignored",o,0);break;case"text":var L=e.translateString(M);s.addText(i.parseFontChangeLine(L));break;case"center":var O=e.translateString(M);s.addCentered(i.parseFontChangeLine(O));break;case"font":break;case"setfont":var H=e.tokenize(M,0,M.length);if(H.length>=4&&"-"===H[0].token&&"number"===H[1].type){var V=parseInt(H[1].token);V>=1&&V<=4&&(n.setfont||(n.setfont=[]),H.shift(),H.shift(),n.setfont[V]=c(H,n.setfont[V],o,0,"setfont"))}break;case"gchordfont":case"partsfont":case"tripletfont":case"vocalfont":case"textfont":case"annotationfont":case"historyfont":case"infofont":case"measurefont":case"repeatfont":case"wordsfont":return l(N,S,o);case"composerfont":case"subtitlefont":case"tempofont":case"titlefont":case"voicefont":case"footerfont":case"headerfont":return function(e,t,n){return 0===t.length?'Directive "'+e+'" requires a font as a parameter.':(a.formatting[e]=c(t,a.formatting[e],n,0,e),null)}(N,S,o);case"barlabelfont":case"barnumberfont":case"barnumfont":return l("measurefont",S,o);case"staves":case"score":n.score_is_present=!0;for(var F,z=function(e,t,i,a,s){(t||0===n.staves.length)&&n.staves.push({index:n.staves.length,numVoices:0});var o=r.last(n.staves);void 0!==i&&void 0===o.bracket&&(o.bracket=i),void 0!==a&&void 0===o.brace&&(o.brace=a),s&&(o.connectBarLines="end"),void 0===n.voices[e]&&(n.voices[e]={staffNum:o.index,index:o.numVoices},o.numVoices++)},j=!1,q=!1,Y=!1,W=!1,R=!1,G=!1,U=!1,X=function(){if(U=!0,F){var e="start";F.staffNum>0&&("start"!==n.staves[F.staffNum-1].connectBarLines&&"continue"!==n.staves[F.staffNum-1].connectBarLines||(e="continue")),n.staves[F.staffNum].connectBarLines=e}};S.length;){var K=S.shift();switch(K.token){case"(":j?t("Can't nest parenthesis in %%score",o,K.start):(j=!0,W=!0);break;case")":!j||W?t("Unexpected close parenthesis in %%score",o,K.start):j=!1;break;case"[":q?t("Can't nest brackets in %%score",o,K.start):(q=!0,R=!0);break;case"]":!q||R?t("Unexpected close bracket in %%score",o,K.start):(q=!1,n.staves[F.staffNum].bracket="end");break;case"{":Y?t("Can't nest braces in %%score",o,K.start):(Y=!0,G=!0);break;case"}":!Y||G?t("Unexpected close brace in %%score",o,K.start):(Y=!1,n.staves[F.staffNum].brace="end");break;case"|":X();break;default:for(var Z="";("alpha"===K.type||"number"===K.type)&&(Z+=K.token,K.continueId);)K=S.shift();z(Z,!j||W,R?"start":q?"continue":void 0,G?"start":Y?"continue":void 0,U),W=!1,R=!1,G=!1,U=!1,F=n.voices[Z],"staves"===N&&X()}}break;case"newpage":var Q=e.getInt(M);s.addNewPage(0===Q.digits?-1:Q.value);break;case"abc":var J=M.split(" ");switch(J[0]){case"-copyright":case"-creator":case"-edited-by":case"-version":case"-charset":var $=J.shift();s.addMetaText(N+$,J.join(" "));break;default:return"Unknown directive: "+N+J[0]}break;case"header":case"footer":var ee=e.getMeat(M,0,M.length);'"'===(ee=M.substring(ee.start,ee.end)).charAt(0)&&'"'===ee.charAt(ee.length-1)&&(ee=ee.substring(1,ee.length-1));var te=ee.split("\t"),ne={};ne=1===te.length?{left:"",center:te[0],right:""}:2===te.length?{left:te[0],center:te[1],right:""}:{left:te[0],center:te[1],right:te[2]},te.length>3&&t("Too many tabs in "+N+": "+te.length+" found.",M,0),s.addMetaTextObj(N,ne);break;case"midi":var re=e.tokenize(M,0,M.length,!0);re.length>0&&"="===re[0].token&&re.shift(),0===re.length?t("Expected midi command",M,0):function(e,n,r){var i=e.shift().token,a=[];if(p.indexOf(i)>=0)0!==e.length&&t("Unexpected parameter in MIDI "+i,r,0);else if(m.indexOf(i)>=0)1!==e.length?t("Expected one parameter in MIDI "+i,r,0):a.push(e[0].token);else if(g.indexOf(i)>=0)1!==e.length?t("Expected one parameter in MIDI "+i,r,0):"number"!==e[0].type?t("Expected one integer parameter in MIDI "+i,r,0):a.push(e[0].intt);else if(v.indexOf(i)>=0)1!==e.length&&2!==e.length?t("Expected one or two parameters in MIDI "+i,r,0):"number"!==e[0].type||2===e.length&&"number"!==e[1].type?t("Expected integer parameter in MIDI "+i,r,0):(a.push(e[0].intt),2===e.length&&a.push(e[1].intt));else if(b.indexOf(i)>=0)2!==e.length?t("Expected two parameters in MIDI "+i,r,0):"number"!==e[0].type||"number"!==e[1].type?t("Expected two integer parameters in MIDI "+i,r,0):(a.push(e[0].intt),a.push(e[1].intt));else if(x.indexOf(i)>=0)2!==e.length?t("Expected two parameters in MIDI "+i,r,0):"alpha"!==e[0].type||"number"!==e[1].type?t("Expected one string and one integer parameters in MIDI "+i,r,0):(a.push(e[0].token),a.push(e[1].intt));else if("drummap"===i)2===e.length&&"alpha"===e[0].type&&"number"===e[1].type?(n.formatting||(n.formatting={}),n.formatting.midi||(n.formatting.midi={}),n.formatting.midi.drummap||(n.formatting.midi.drummap={}),n.formatting.midi.drummap[e[0].token]=e[1].intt,a=n.formatting.midi.drummap):3===e.length&&"punct"===e[0].type&&"alpha"===e[1].type&&"number"===e[2].type?(n.formatting||(n.formatting={}),n.formatting.midi||(n.formatting.midi={}),n.formatting.midi.drummap||(n.formatting.midi.drummap={}),n.formatting.midi.drummap[e[0].token+e[1].token]=e[2].intt,a=n.formatting.midi.drummap):t("Expected one note name and one integer parameter in MIDI "+i,r,0);else if(k.indexOf(i)>=0)3!==e.length||"number"!==e[0].type||"/"!==e[1].token||"number"!==e[2].type?t("Expected fraction parameter in MIDI "+i,r,0):(a.push(e[0].intt),a.push(e[2].intt));else if(y.indexOf(i)>=0)4!==e.length?t("Expected four parameters in MIDI "+i,r,0):"number"!==e[0].type||"number"!==e[1].type||"number"!==e[2].type||"number"!==e[3].type?t("Expected four integer parameters in MIDI "+i,r,0):(a.push(e[0].intt),a.push(e[1].intt),a.push(e[2].intt),a.push(e[3].intt));else if(w.indexOf(i)>=0)5!==e.length?t("Expected five parameters in MIDI "+i,r,0):"number"!==e[0].type||"number"!==e[1].type||"number"!==e[2].type||"number"!==e[3].type||"number"!==e[4].type?t("Expected five integer parameters in MIDI "+i,r,0):(a.push(e[0].intt),a.push(e[1].intt),a.push(e[2].intt),a.push(e[3].intt),a.push(e[4].intt));else if(v.indexOf(i)>=0)1!==e.length||4!==e.length?t("Expected one or two parameters in MIDI "+i,r,0):"number"!==e[0].type?t("Expected integer parameter in MIDI "+i,r,0):4===e.length?("octave"!==e[1].token&&t("Expected octave parameter in MIDI "+i,r,0),"="!==e[2].token&&t("Expected octave parameter in MIDI "+i,r,0),"number"!==e[3].type&&t("Expected integer parameter for octave in MIDI "+i,r,0)):(a.push(e[0].intt),4===e.length&&a.push(e[3].intt));else if(A.indexOf(i)>=0)if(e.length<2)t("Expected string parameter and at least one integer parameter in MIDI "+i,r,0);else if("alpha"!==e[0].type)t("Expected string parameter and at least one integer parameter in MIDI "+i,r,0);else{var o=e.shift();for(a.push(o.token);e.length>0;)"number"!==(o=e.shift()).type&&t("Expected integer parameter in MIDI "+i,r,0),a.push(o.intt)}s.hasBeginMusic()?s.appendElement("midi",-1,-1,{cmd:i,params:a}):(void 0===n.formatting.midi&&(n.formatting.midi={}),n.formatting.midi[i]=a)}(re,a,M);break;case"map":case"percmap":case"playtempo":case"auquality":case"continuous":case"nobarcheck":a.formatting[N]=M;break;default:return"Unknown directive: "+N}return null},i.globalFormatting=function(r){for(var i in r)if(r.hasOwnProperty(i)){var s,o=""+r[i],c=e.tokenize(o,0,o.length);switch(i){case"titlefont":case"gchordfont":case"composerfont":case"footerfont":case"headerfont":case"historyfont":case"infofont":case"measurefont":case"partsfont":case"repeatfont":case"subtitlefont":case"tempofont":case"textfont":case"voicefont":case"tripletfont":case"vocalfont":case"wordsfont":case"annotationfont":l(i,c,o);break;case"scale":h(i,c);break;case"partsbox":null!==(s=d("partsBox",i,c))&&t(s),n.partsfont.box=n.partsBox;break;case"freegchord":null!==(s=d("freegchord",i,c))&&t(s);break;case"fontboxpadding":1===c.length&&"number"===c[0].type||t('Directive "'+i+'" requires a number as a parameter.'),a.formatting.fontboxpadding=c[0].floatt;break;case"stretchlast":a.formatting.stretchlast="true"===o||!0===o;break;default:t("Formatting directive unrecognized: ",i,0)}}}}(),e.exports=i},function(e,t,n){var r=n(0),i=n(10),a=n(16),s={};!function(){var e,t,n,o;s.initialize=function(r,i,a,s,c){e=r,t=i,n=a,s,o=c},s.standardKey=function(e,t,r,i){var s={acc:"sharp",note:"f"},o={acc:"sharp",note:"c"},c={acc:"sharp",note:"g"},l={acc:"sharp",note:"d"},h={acc:"sharp",note:"A"},u={acc:"sharp",note:"e"},d={acc:"sharp",note:"B"},f={acc:"flat",note:"B"},p={acc:"flat",note:"e"},m={acc:"flat",note:"A"},g={acc:"flat",note:"d"},v={acc:"flat",note:"G"},b={acc:"flat",note:"c"},y={acc:"flat",note:"F"},w={"C#":[s,o,c,l,h,u,d],"A#m":[s,o,c,l,h,u,d],"G#Mix":[s,o,c,l,h,u,d],"D#Dor":[s,o,c,l,h,u,d],"E#Phr":[s,o,c,l,h,u,d],"F#Lyd":[s,o,c,l,h,u,d],"B#Loc":[s,o,c,l,h,u,d],"F#":[s,o,c,l,h,u],"D#m":[s,o,c,l,h,u],"C#Mix":[s,o,c,l,h,u],"G#Dor":[s,o,c,l,h,u],"A#Phr":[s,o,c,l,h,u],BLyd:[s,o,c,l,h,u],"E#Loc":[s,o,c,l,h,u],B:[s,o,c,l,h],"G#m":[s,o,c,l,h],"F#Mix":[s,o,c,l,h],"C#Dor":[s,o,c,l,h],"D#Phr":[s,o,c,l,h],ELyd:[s,o,c,l,h],"A#Loc":[s,o,c,l,h],E:[s,o,c,l],"C#m":[s,o,c,l],BMix:[s,o,c,l],"F#Dor":[s,o,c,l],"G#Phr":[s,o,c,l],ALyd:[s,o,c,l],"D#Loc":[s,o,c,l],A:[s,o,c],"F#m":[s,o,c],EMix:[s,o,c],BDor:[s,o,c],"C#Phr":[s,o,c],DLyd:[s,o,c],"G#Loc":[s,o,c],D:[s,o],Bm:[s,o],AMix:[s,o],EDor:[s,o],"F#Phr":[s,o],GLyd:[s,o],"C#Loc":[s,o],G:[s],Em:[s],DMix:[s],ADor:[s],BPhr:[s],CLyd:[s],"F#Loc":[s],C:[],Am:[],GMix:[],DDor:[],EPhr:[],FLyd:[],BLoc:[],F:[f],Dm:[f],CMix:[f],GDor:[f],APhr:[f],BbLyd:[f],ELoc:[f],Bb:[f,p],Gm:[f,p],FMix:[f,p],CDor:[f,p],DPhr:[f,p],EbLyd:[f,p],ALoc:[f,p],Eb:[f,p,m],Cm:[f,p,m],BbMix:[f,p,m],FDor:[f,p,m],GPhr:[f,p,m],AbLyd:[f,p,m],DLoc:[f,p,m],Ab:[f,p,m,g],Fm:[f,p,m,g],EbMix:[f,p,m,g],BbDor:[f,p,m,g],CPhr:[f,p,m,g],DbLyd:[f,p,m,g],GLoc:[f,p,m,g],Db:[f,p,m,g,v],Bbm:[f,p,m,g,v],AbMix:[f,p,m,g,v],EbDor:[f,p,m,g,v],FPhr:[f,p,m,g,v],GbLyd:[f,p,m,g,v],CLoc:[f,p,m,g,v],Gb:[f,p,m,g,v,b],Ebm:[f,p,m,g,v,b],DbMix:[f,p,m,g,v,b],AbDor:[f,p,m,g,v,b],BbPhr:[f,p,m,g,v,b],CbLyd:[f,p,m,g,v,b],FLoc:[f,p,m,g,v,b],Cb:[f,p,m,g,v,b,y],Abm:[f,p,m,g,v,b,y],GbMix:[f,p,m,g,v,b,y],DbDor:[f,p,m,g,v,b,y],EbPhr:[f,p,m,g,v,b,y],FbLyd:[f,p,m,g,v,b,y],BbLoc:[f,p,m,g,v,b,y],"A#":[f,p],"B#":[],"D#":[f,p,m],"E#":[f],"G#":[f,p,m,g],Gbm:[s,o,c,l,h,u,d],none:[]};return a.keySignature(n,w,e,t,r,i)};var c={treble:{clef:"treble",pitch:4,mid:0},"treble+8":{clef:"treble+8",pitch:4,mid:0},"treble-8":{clef:"treble-8",pitch:4,mid:0},"treble^8":{clef:"treble+8",pitch:4,mid:0},treble_8:{clef:"treble-8",pitch:4,mid:0},treble1:{clef:"treble",pitch:2,mid:2},treble2:{clef:"treble",pitch:4,mid:0},treble3:{clef:"treble",pitch:6,mid:-2},treble4:{clef:"treble",pitch:8,mid:-4},treble5:{clef:"treble",pitch:10,mid:-6},perc:{clef:"perc",pitch:6,mid:0},none:{clef:"none",mid:0},bass:{clef:"bass",pitch:8,mid:-12},"bass+8":{clef:"bass+8",pitch:8,mid:-12},"bass-8":{clef:"bass-8",pitch:8,mid:-12},"bass^8":{clef:"bass+8",pitch:8,mid:-12},bass_8:{clef:"bass-8",pitch:8,mid:-12},"bass+16":{clef:"bass",pitch:8,mid:-12},"bass-16":{clef:"bass",pitch:8,mid:-12},"bass^16":{clef:"bass",pitch:8,mid:-12},bass_16:{clef:"bass",pitch:8,mid:-12},bass1:{clef:"bass",pitch:2,mid:-6},bass2:{clef:"bass",pitch:4,mid:-8},bass3:{clef:"bass",pitch:6,mid:-10},bass4:{clef:"bass",pitch:8,mid:-12},bass5:{clef:"bass",pitch:10,mid:-14},tenor:{clef:"alto",pitch:8,mid:-8},tenor1:{clef:"alto",pitch:2,mid:-2},tenor2:{clef:"alto",pitch:4,mid:-4},tenor3:{clef:"alto",pitch:6,mid:-6},tenor4:{clef:"alto",pitch:8,mid:-8},tenor5:{clef:"alto",pitch:10,mid:-10},alto:{clef:"alto",pitch:6,mid:-6},alto1:{clef:"alto",pitch:2,mid:-2},alto2:{clef:"alto",pitch:4,mid:-4},alto3:{clef:"alto",pitch:6,mid:-6},alto4:{clef:"alto",pitch:8,mid:-8},alto5:{clef:"alto",pitch:10,mid:-10},"alto+8":{clef:"alto+8",pitch:6,mid:-6},"alto-8":{clef:"alto-8",pitch:6,mid:-6},"alto^8":{clef:"alto+8",pitch:6,mid:-6},alto_8:{clef:"alto-8",pitch:6,mid:-6}},l=function(e,t){var n=c[e];return(n?n.mid:0)+t};s.fixClef=function(e){var t=c[e.type];t&&(e.clefPos=t.pitch,e.type=t.clef)},s.deepCopyKey=function(e){var t={accidentals:[],root:e.root,acc:e.acc,mode:e.mode};return r.each(e.accidentals,(function(e){t.accidentals.push(r.clone(e))})),t};var h={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};s.addPosToKey=function(e,t){var n=e.verticalPos;r.each(t.accidentals,(function(e){var t=h[e.note];t-=n,e.verticalPos=t})),t.impliedNaturals&&r.each(t.impliedNaturals,(function(e){var t=h[e.note];t-=n,e.verticalPos=t})),n<-10?(r.each(t.accidentals,(function(e){e.verticalPos-=7,(e.verticalPos>=11||10===e.verticalPos&&"flat"===e.acc)&&(e.verticalPos-=7),"A"===e.note&&"sharp"===e.acc&&(e.verticalPos-=7),"G"!==e.note&&"F"!==e.note||"flat"!==e.acc||(e.verticalPos-=7)})),t.impliedNaturals&&r.each(t.impliedNaturals,(function(e){e.verticalPos-=7,(e.verticalPos>=11||10===e.verticalPos&&"flat"===e.acc)&&(e.verticalPos-=7),"A"===e.note&&"sharp"===e.acc&&(e.verticalPos-=7),"G"!==e.note&&"F"!==e.note||"flat"!==e.acc||(e.verticalPos-=7)}))):n<-4?(r.each(t.accidentals,(function(e){e.verticalPos-=7,-8!==n||"f"!==e.note&&"g"!==e.note||"sharp"!==e.acc||(e.verticalPos-=7)})),t.impliedNaturals&&r.each(t.impliedNaturals,(function(e){e.verticalPos-=7,-8!==n||"f"!==e.note&&"g"!==e.note||"sharp"!==e.acc||(e.verticalPos-=7)}))):n>=7&&(r.each(t.accidentals,(function(e){e.verticalPos+=7})),t.impliedNaturals&&r.each(t.impliedNaturals,(function(e){e.verticalPos+=7})))},s.fixKey=function(e,t){var n=r.clone(t);return s.addPosToKey(e,n),n};var u=function(e){var t=0,n=e.charAt(t++);"^"!==n&&"_"!==n||(n=e.charAt(t++));var r=h[n];for(void 0===r&&(r=6);t<e.length;t++)if(","===e.charAt(t))r-=7;else{if("'"!==e.charAt(t))break;r+=7}return{mid:r-6,str:e.substring(t)}};s.parseKey=function(r){0===r.length&&(r="none");var a=e.tokenize(r,0,r.length),o={};switch(a[0].token){case"HP":i.addDirective("bagpipes"),n.key={root:"HP",accidentals:[],acc:"",mode:""},o.foundKey=!0,a.shift();break;case"Hp":i.addDirective("bagpipes"),n.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},o.foundKey=!0,a.shift();break;case"none":n.key={root:"none",accidentals:[],acc:"",mode:""},o.foundKey=!0,a.shift();break;default:var c=e.getKeyPitch(a[0].token);if(c.len>0){o.foundKey=!0;var h="",u="";a[0].token.length>1?a[0].token=a[0].token.substring(1):a.shift();var d=c.token;if(a.length>0){var f=e.getSharpFlat(a[0].token);if(f.len>0&&(a[0].token.length>1?a[0].token=a[0].token.substring(1):a.shift(),d+=f.token,h=f.token),a.length>0){var p=e.getMode(a[0].token);p.len>0&&(a.shift(),d+=p.token,u=p.token)}if(void 0===s.standardKey(d,c.token,h,0))return t("Unsupported key signature: "+d,r,0),o}var m=s.deepCopyKey(n.key),g=n.globalTranspose?-n.globalTranspose:0;if(n.key=s.deepCopyKey(s.standardKey(d,c.token,h,g)),n.key.mode=u,m){for(var v,b=0;b<n.key.accidentals.length;b++)for(v=0;v<m.accidentals.length;v++)m.accidentals[v].note&&n.key.accidentals[b].note.toLowerCase()===m.accidentals[v].note.toLowerCase()&&(m.accidentals[v].note=null);for(v=0;v<m.accidentals.length;v++)m.accidentals[v].note&&(n.key.impliedNaturals||(n.key.impliedNaturals=[]),n.key.impliedNaturals.push({acc:"natural",note:m.accidentals[v].note}))}}}if(0===a.length)return o;if("exp"===a[0].token&&a.shift(),0===a.length)return o;if("oct"===a[0].token&&a.shift(),0===a.length)return o;var y,w=e.getKeyAccidentals2(a);if(w.warn&&t(w.warn,r,0),w.accs){o.foundKey||(o.foundKey=!0,n.key={root:"none",acc:"",mode:"",accidentals:[]}),function(e){for(var t=0;t<e.length;t++)"b"===e[t].note?e[t].note="B":"a"===e[t].note?e[t].note="A":"F"===e[t].note?e[t].note="f":"E"===e[t].note?e[t].note="e":"D"===e[t].note?e[t].note="d":"C"===e[t].note?e[t].note="c":"G"===e[t].note&&"sharp"===e[t].acc?e[t].note="g":"g"===e[t].note&&"flat"===e[t].acc&&(e[t].note="G")}(w.accs);for(var x=0;x<w.accs.length;x++){for(var k=!1,A=0;A<n.key.accidentals.length&&!k;A++)n.key.accidentals[A].note===w.accs[x].note&&(k=!0,n.key.accidentals[A].acc!==w.accs[x].acc&&(n.key.accidentals[A].acc=w.accs[x].acc,n.key.explicitAccidentals||(n.key.explicitAccidentals=[]),n.key.explicitAccidentals.push(w.accs[x])));if(!k&&(n.key.explicitAccidentals||(n.key.explicitAccidentals=[]),n.key.explicitAccidentals.push(w.accs[x]),n.key.accidentals.push(w.accs[x]),n.key.impliedNaturals))for(var T=0;T<n.key.impliedNaturals.length;T++)n.key.impliedNaturals[T].note===w.accs[x].note&&n.key.impliedNaturals.splice(T,1)}}for(;a.length>0;)switch(a[0].token){case"m":case"middle":if(a.shift(),0===a.length)return t("Expected = after middle",r,0),o;if("="!==(y=a.shift()).token){t("Expected = after middle",r,y.start);break}if(0===a.length)return t("Expected parameter after middle=",r,0),o;var S=e.getPitchFromTokens(a);S.warn&&t(S.warn,r,0),S.position&&(n.clef.verticalPos=S.position-6);break;case"transpose":if(a.shift(),0===a.length)return t("Expected = after transpose",r,0),o;if("="!==(y=a.shift()).token){t("Expected = after transpose",r,y.start);break}if(0===a.length)return t("Expected parameter after transpose=",r,0),o;if("number"!==a[0].type){t("Expected number after transpose",r,a[0].start);break}n.clef.transpose=a[0].intt,a.shift();break;case"stafflines":if(a.shift(),0===a.length)return t("Expected = after stafflines",r,0),o;if("="!==(y=a.shift()).token){t("Expected = after stafflines",r,y.start);break}if(0===a.length)return t("Expected parameter after stafflines=",r,0),o;if("number"!==a[0].type){t("Expected number after stafflines",r,a[0].start);break}n.clef.stafflines=a[0].intt,a.shift();break;case"staffscale":if(a.shift(),0===a.length)return t("Expected = after staffscale",r,0),o;if("="!==(y=a.shift()).token){t("Expected = after staffscale",r,y.start);break}if(0===a.length)return t("Expected parameter after staffscale=",r,0),o;if("number"!==a[0].type){t("Expected number after staffscale",r,a[0].start);break}n.clef.staffscale=a[0].floatt,a.shift();break;case"style":if(a.shift(),0===a.length)return t("Expected = after style",r,0),o;if("="!==(y=a.shift()).token){t("Expected = after style",r,y.start);break}if(0===a.length)return t("Expected parameter after style=",r,0),o;switch(a[0].token){case"normal":case"harmonic":case"rhythm":case"x":n.style=a[0].token,a.shift();break;default:t("error parsing style element: "+a[0].token,r,a[0].start)}break;case"clef":if(a.shift(),0===a.length)return t("Expected = after clef",r,0),o;if("="!==(y=a.shift()).token){t("Expected = after clef",r,y.start);break}if(0===a.length)return t("Expected parameter after clef=",r,0),o;case"treble":case"bass":case"alto":case"tenor":case"perc":case"none":var M=a.shift();switch(M.token){case"treble":case"tenor":case"alto":case"bass":case"perc":case"none":break;case"C":M.token="alto";break;case"F":M.token="bass";break;case"G":M.token="treble";break;case"c":M.token="alto";break;case"f":M.token="bass";break;case"g":M.token="treble";break;default:t("Expected clef name. Found "+M.token,r,M.start)}a.length>0&&"number"===a[0].type&&(M.token+=a[0].token,a.shift()),a.length>1&&("-"===a[0].token||"+"===a[0].token||"^"===a[0].token||"_"===a[0].token)&&"8"===a[1].token&&(M.token+=a[0].token+a[1].token,a.shift(),a.shift()),n.clef={type:M.token,verticalPos:l(M.token,0)},n.currentVoice&&void 0!==n.currentVoice.transpose&&(n.clef.transpose=n.currentVoice.transpose),o.foundClef=!0;break;default:t("Unknown parameter: "+a[0].token,r,a[0].start),a.shift()}return o};s.parseVoice=function(r,i,a){var s=e.getMeat(r,i,a),c=s.start,h=s.end,d=e.getToken(r,c,h);if(0!==d.length){var f=!1;void 0===n.voices[d]&&(n.voices[d]={},f=!0,n.score_is_present&&t("Can't have an unknown V: id when the %score directive is present",r,c)),c+=d.length,c+=e.eatWhiteSpace(r,c);for(var p={startStaff:f},m=function(n){var i=e.getVoiceToken(r,c,h);void 0!==i.warn?t("Expected value for "+n+" in voice: "+i.warn,r,c):void 0!==i.err?t("Expected value for "+n+" in voice: "+i.err,r,c):0===i.token.length&&'"'!==r.charAt(c)?t("Expected value for "+n+" in voice",r,c):p[n]=i.token,c+=i.len},g=function(i,a,s){var o=e.getVoiceToken(r,c,h);void 0!==o.warn?t("Expected value for "+a+" in voice: "+o.warn,r,c):void 0!==o.err?t("Expected value for "+a+" in voice: "+o.err,r,c):0===o.token.length&&'"'!==r.charAt(c)?t("Expected value for "+a+" in voice",r,c):("number"===s&&(o.token=parseFloat(o.token)),n.voices[i][a]=o.token),c+=o.len},v=function(n,i){var a=e.getVoiceToken(r,c,h);if(void 0!==a.warn)t("Expected value for "+n+" in voice: "+a.warn,r,c);else if(void 0!==a.err)t("Expected value for "+n+" in voice: "+a.err,r,c);else{if(0!==a.token.length||'"'===r.charAt(c))return"number"===i&&(a.token=parseFloat(a.token)),a.token;t("Expected value for "+n+" in voice",r,c)}c+=a.len},b=function(i,a){var s=e.getVoiceToken(r,c,h);if(void 0!==s.warn)t("Expected one of (_B, _E, _b, _e) for "+a+" in voice: "+s.warn,r,c);else if(0===s.token.length&&'"'!==r.charAt(c))t("Expected one of (_B, _E, _b, _e) for "+a+" in voice",r,c);else{var o={_B:2,_E:9,_b:-10,_e:-3}[s.token];o?n.voices[i][a]=o:t("Expected one of (_B, _E, _b, _e) for "+a+" in voice",r,c)}c+=s.len};c<h;){var y=e.getVoiceToken(r,c,h);if(c+=y.len,y.warn)t("Error parsing voice: "+y.warn,r,c);else{var w=null;switch(y.token){case"clef":case"cl":m("clef");var x=0;void 0!==p.clef&&(p.clef=p.clef.replace(/[',]/g,""),-1!==p.clef.indexOf("+16")&&(x+=14,p.clef=p.clef.replace("+16","")),p.verticalPos=l(p.clef,x));break;case"treble":case"bass":case"tenor":case"alto":case"perc":case"none":case"treble'":case"bass'":case"tenor'":case"alto'":case"none'":case"treble''":case"bass''":case"tenor''":case"alto''":case"none''":case"treble,":case"bass,":case"tenor,":case"alto,":case"none,":case"treble,,":case"bass,,":case"tenor,,":case"alto,,":case"none,,":p.clef=y.token.replace(/[',]/g,""),p.verticalPos=l(p.clef,0),n.voices[d].clef=y.token;break;case"staves":case"stave":case"stv":m("staves");break;case"brace":case"brc":m("brace");break;case"bracket":case"brk":m("bracket");break;case"name":case"nm":m("name");break;case"subname":case"sname":case"snm":m("subname");break;case"merge":p.startStaff=!1;break;case"stem":case"stems":void 0!==(w=e.getVoiceToken(r,c,h)).warn?t("Expected value for stems in voice: "+w.warn,r,c):void 0!==w.err?t("Expected value for stems in voice: "+w.err,r,c):"up"===w.token||"down"===w.token?n.voices[d].stem=w.token:t("Expected up or down for voice stem",r,c),c+=w.len;break;case"up":case"down":n.voices[d].stem=y.token;break;case"middle":case"m":m("verticalPos"),p.verticalPos=u(p.verticalPos).mid;break;case"gchords":case"gch":n.voices[d].suppressChords=!0,"0"===(w=e.getVoiceToken(r,c,h)).token&&(c+=w.len);break;case"space":case"spc":m("spacing");break;case"scale":g(d,"scale","number");break;case"score":b(d,"scoreTranspose");break;case"transpose":g(d,"transpose","number");break;case"stafflines":g(d,"stafflines","number");break;case"staffscale":g(d,"staffscale","number");break;case"octave":g(d,"octave","number");break;case"volume":g(d,"volume","number");break;case"cue":var k=v("cue","string");n.voices[d].scale="on"===k?.6:1;break;case"style":void 0!==(w=e.getVoiceToken(r,c,h)).warn?t("Expected value for style in voice: "+w.warn,r,c):void 0!==w.err?t("Expected value for style in voice: "+w.err,r,c):"normal"===w.token||"harmonic"===w.token||"rhythm"===w.token||"x"===w.token?n.voices[d].style=w.token:t("Expected one of [normal, harmonic, rhythm, x] for voice style",r,c),c+=w.len}}c+=e.eatWhiteSpace(r,c)}if((p.startStaff||0===n.staves.length)&&(n.staves.push({index:n.staves.length,meter:n.origMeter}),n.score_is_present||(n.staves[n.staves.length-1].numVoices=0)),void 0===n.voices[d].staffNum){n.voices[d].staffNum=n.staves.length-1;var A=0;for(var T in n.voices)n.voices.hasOwnProperty(T)&&n.voices[T].staffNum===n.voices[d].staffNum&&A++;n.voices[d].index=A-1}var S=n.staves[n.voices[d].staffNum];n.score_is_present||S.numVoices++,p.clef&&(S.clef={type:p.clef,verticalPos:p.verticalPos}),p.spacing&&(S.spacing_below_offset=p.spacing),p.verticalPos&&(S.verticalPos=p.verticalPos),p.name&&(S.name?S.name.push(p.name):S.name=[p.name]),p.subname&&(S.subname?S.subname.push(p.subname):S.subname=[p.subname]),function(e){n.currentVoice=n.voices[e],o.setCurrentVoice(n.currentVoice.staffNum,n.currentVoice.index)}(d)}else t("Expected a voice id",r,c)}}(),e.exports=s},function(e,t){e.exports=function(e,t,n,r,i){return t+(r-t)/(n-e)*(i-e)}},function(e,t,n){var r,i=n(3);!function(){"use strict";function e(){this.ingroup=!1}e.prototype.beginGroup=function(e,t){this.paper=e,this.controller=t,this.path=[],this.lastM=[0,0],this.ingroup=!0},e.prototype.isInGroup=function(){return this.ingroup},e.prototype.addPath=function(e){if(0!==(e=e||[]).length){e[0][0]="m",e[0][1]=i(e[0][1]-this.lastM[0]),e[0][2]=i(e[0][2]-this.lastM[1]),this.lastM[0]+=e[0][1],this.lastM[1]+=e[0][2],this.path.push(e[0]);for(var t=1,n=e.length;t<n;t++)"m"===e[t][0]&&(this.lastM[0]+=e[t][1],this.lastM[1]+=e[t][2]),this.path.push(e[t])}},e.prototype.endGroup=function(e){if(this.ingroup=!1,0===this.path.length)return null;for(var t="",n=0;n<this.path.length;n++)t+=this.path[n].join(" ");var r=this.paper.path({path:t,stroke:"none",fill:"#000000",class:this.controller.classes.generate(e)});return this.path=[],r},r=new e}(),e.exports=r},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(15),a=n(36),s={};!function(){"use strict";s.numberOfTunes=function(e){var t=e.split("\nX:").length;return 0===t&&(t=1),t};var e=s.TuneBook=function(e){var t=a(e);this.header=t.header,this.tunes=t.tunes};e.prototype.getTuneById=function(e){for(var t=0;t<this.tunes.length;t++)if(this.tunes[t].id===""+e)return this.tunes[t];return null},e.prototype.getTuneByTitle=function(e){for(var t=0;t<this.tunes.length;t++)if(this.tunes[t].title===e)return this.tunes[t];return null},s.parseOnly=function(e,t){for(var n=s.numberOfTunes(e),r=[],i=0;i<n;i++)r.push(1);return s.renderEngine((function(){}),r,e,t)},s.renderEngine=function(t,n,a,s){var o=[];if(void 0!==n&&void 0!==a){var c;(!(c=n)||c.propertyIsEnumerable("length")||"object"!==r(c)||"number"!=typeof c.length)&&(n=[n]),void 0===s&&(s={});for(var l=s.startingTune?parseInt(s.startingTune,10):0,h=new e(a),u=new i,d=0;d<n.length;d++){var f=n[d];if("*"===f||"string"==typeof f&&(f=document.getElementById(f)),f)if(l>=0&&l<h.tunes.length){u.parse(h.tunes[l].abc,s,h.tunes[l].startPos-h.header.length);var p=u.getTune(),m=u.getWarnings();m&&(p.warnings=m);var g=t(f,p,d,h.tunes[l].abc);o.push(g||p)}else f.innerHTML&&(f.innerHTML="");l++}return o}},s.extractMeasures=function(t){for(var n=[],r=new e(t),i=0;i<r.tunes.length;i++){for(var a=r.tunes[i],o=a.abc.split("K:"),c=o[1].split("\n"),l=o[0]+"K:"+c[0]+"\n",h=null,u=null,d=null,f=[],p=!1,m=s.parseOnly(a.abc)[0],g=m.getPickupLength()>0,v=0;v<m.lines.length;v++){var b=m.lines[v];if(b.staff)for(var y=0;y<1;y++)for(var w=b.staff[y],x=0;x<1;x++)for(var k=w.voices[x],A=0;A<k.length;A++){var T=k[A];if(null===d&&T.startChar>=0&&(d=T.startChar,u=void 0===T.chord?h:null),T.chord&&(h=T),"bar"===T.el_type){if(p){var S={abc:a.abc.substring(d,T.endChar)};(h=u&&u.chord&&u.chord.length>0?u.chord[0].name:null)&&(S.lastChord=h),T.startEnding&&(S.startEnding=T.startEnding),T.endEnding&&(S.endEnding=T.endEnding),f.push(S),d=null,p=!1}}else"note"===T.el_type&&(p=!0)}}n.push({header:l,measures:f,hasPickup:g})}return n}}(),e.exports=s},function(e,t,n){var r=n(0),i=n(10),a=n(31),s=n(11),o=n(32),c=n(16),l=n(17),h=n(18),u=n(35);e.exports=function(){"use strict";var e=new h,t=new u(e),n=new o;function d(e,t,n){e.positioning||(e.positioning={}),e.positioning[t]=n}function f(e,t,n){e.fonts||(e.fonts={}),e.fonts[t]=n}this.getTune=function(){var t={formatting:e.formatting,lines:e.lines,media:e.media,metaText:e.metaText,version:e.version,addElementToEvents:e.addElementToEvents,addUsefulCallbackInfo:e.addUsefulCallbackInfo,getBarLength:e.getBarLength,getBeatLength:e.getBeatLength,getBeatsPerMeasure:e.getBeatsPerMeasure,getBpm:e.getBpm,getMeter:e.getMeter,getMeterFraction:e.getMeterFraction,getPickupLength:e.getPickupLength,getKeySignature:e.getKeySignature,getElementFromChar:e.getElementFromChar,makeVoicesArray:e.makeVoicesArray,millisecondsPerMeasure:e.millisecondsPerMeasure,setupEvents:e.setupEvents,setTiming:e.setTiming,setUpAudio:e.setUpAudio};return e.visualTranspose&&(t.visualTranspose=e.visualTranspose),t};var p={reset:function(){for(var e in this)this.hasOwnProperty(e)&&"function"!=typeof this[e]&&delete this[e];this.iChar=0,this.key={accidentals:[],root:"none",acc:"",mode:""},this.meter=null,this.origMeter=null,this.hasMainTitle=!1,this.default_length=.125,this.clef={type:"treble",verticalPos:0},this.next_note_duration=0,this.start_new_line=!0,this.is_in_header=!0,this.is_in_history=!1,this.partForNextLine={},this.tempoForNextLine=[],this.havent_set_length=!0,this.voices={},this.staves=[],this.macros={},this.currBarNumber=1,this.barCounter={},this.inTextBlock=!1,this.inPsBlock=!1,this.ignoredDecorations=[],this.textBlock="",this.score_is_present=!1,this.inEnding=!1,this.inTie=[],this.inTieChord={},this.vocalPosition="auto",this.dynamicPosition="auto",this.chordPosition="auto",this.ornamentPosition="auto",this.volumePosition="auto",this.openSlurs=[],this.freegchord=!1,this.endingHoldOver={}},differentFont:function(e,t){return this[e].decoration!==t[e].decoration||(this[e].face!==t[e].face||(this[e].size!==t[e].size||(this[e].style!==t[e].style||this[e].weight!==t[e].weight)))},addFormattingOptions:function(e,t,n){"note"===n?("auto"!==this.vocalPosition&&d(e,"vocalPosition",this.vocalPosition),"auto"!==this.dynamicPosition&&d(e,"dynamicPosition",this.dynamicPosition),"auto"!==this.chordPosition&&d(e,"chordPosition",this.chordPosition),"auto"!==this.ornamentPosition&&d(e,"ornamentPosition",this.ornamentPosition),"auto"!==this.volumePosition&&d(e,"volumePosition",this.volumePosition),this.differentFont("annotationfont",t)&&f(e,"annotationfont",this.annotationfont),this.differentFont("gchordfont",t)&&f(e,"gchordfont",this.gchordfont),this.differentFont("vocalfont",t)&&f(e,"vocalfont",this.vocalfont),this.differentFont("tripletfont",t)&&f(e,"tripletfont",this.tripletfont)):"bar"===n&&("auto"!==this.dynamicPosition&&d(e,"dynamicPosition",this.dynamicPosition),"auto"!==this.chordPosition&&d(e,"chordPosition",this.chordPosition),"auto"!==this.ornamentPosition&&d(e,"ornamentPosition",this.ornamentPosition),"auto"!==this.volumePosition&&d(e,"volumePosition",this.volumePosition),this.differentFont("measurefont",t)&&f(e,"measurefont",this.measurefont),this.differentFont("repeatfont",t)&&f(e,"repeatfont",this.repeatfont))},duplicateStartEndingHoldOvers:function(){this.endingHoldOver={inTie:[],inTieChord:{}};for(var e=0;e<this.inTie.length;e++){this.endingHoldOver.inTie.push([]);for(var t=0;t<this.inTie[e].length;t++)this.endingHoldOver.inTie[e].push(this.inTie[e][t])}for(var n in this.inTieChord)this.inTieChord.hasOwnProperty(n)&&(this.endingHoldOver.inTieChord[n]=this.inTieChord[n])},restoreStartEndingHoldOvers:function(){if(this.endingHoldOver.inTie){this.inTie=[],this.inTieChord={};for(var e=0;e<this.endingHoldOver.inTie.length;e++){this.inTie.push([]);for(var t=0;t<this.endingHoldOver.inTie[e].length;t++)this.inTie[e].push(this.endingHoldOver.inTie[e][t])}for(var n in this.endingHoldOver.inTieChord)this.endingHoldOver.inTieChord.hasOwnProperty(n)&&(this.inTieChord[n]=this.endingHoldOver.inTieChord[n])}}},m=function(e){var t=r.gsub(e,""," ");return t=r.gsub(t,"&","&amp;"),t=r.gsub(t,"<","&lt;"),r.gsub(t,">","&gt;")},g=function(e,n,r){n||(n=" ");var i=n.charAt(r);" "===i&&(i="SPACE");var a,s=m(n.substring(0,r))+'<span style="text-decoration:underline;font-size:1.3em;font-weight:bold;">'+i+"</span>"+m(n.substring(r+1));!function(e){p.warnings||(p.warnings=[]),p.warnings.push(e)}("Music Line:"+t.getNumLines()+":"+(r+1)+": "+e+": "+s),a={message:e,line:n,startChar:p.iChar+r,column:r},p.warningObjects||(p.warningObjects=[]),p.warningObjects.push(a)},v=new a(n,g,p,e,t);this.getWarnings=function(){return p.warnings},this.getWarningObjects=function(){return p.warningObjects};var b=function(e,t){if('"'===e.charAt(t)){var r=n.getBrackettedSubstring(e,t,5);if(r[2]||g("Missing the closing quote while parsing the chord symbol",e,t),r[0]>0&&r[1].length>0&&"^"===r[1].charAt(0))r[1]=r[1].substring(1),r[2]="above";else if(r[0]>0&&r[1].length>0&&"_"===r[1].charAt(0))r[1]=r[1].substring(1),r[2]="below";else if(r[0]>0&&r[1].length>0&&"<"===r[1].charAt(0))r[1]=r[1].substring(1),r[2]="left";else if(r[0]>0&&r[1].length>0&&">"===r[1].charAt(0))r[1]=r[1].substring(1),r[2]="right";else if(r[0]>0&&r[1].length>0&&"@"===r[1].charAt(0)){r[1]=r[1].substring(1);var i=n.getFloat(r[1]);0===i.digits&&g("Missing first position in absolutely positioned annotation.",e,t),r[1]=r[1].substring(i.digits),","!==r[1][0]&&g("Missing comma absolutely positioned annotation.",e,t),r[1]=r[1].substring(1);var a=n.getFloat(r[1]);0===a.digits&&g("Missing second position in absolutely positioned annotation.",e,t),r[1]=r[1].substring(a.digits);var s=n.skipWhiteSpace(r[1]);r[1]=r[1].substring(s),r[2]=null,r[3]={x:i.value,y:a.value}}else!0!==p.freegchord&&(r[1]=r[1].replace(/([ABCDEFG0-9])b/g,"$1♭"),r[1]=r[1].replace(/([ABCDEFG0-9])#/g,"$1♯"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)o([^A-Za-z])/g,"$1$2°$3"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)o$/g,"$1$2°"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)0([^A-Za-z])/g,"$1$2ø$3"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)\^([^A-Za-z])/g,"$1$2∆$3")),r[2]="default",r[1]=c.chordName(p,r[1]);return r}return[0,""]},y=["trill","lowermordent","uppermordent","mordent","pralltriller","accent","fermata","invertedfermata","tenuto","0","1","2","3","4","5","+","wedge","open","thumb","snap","turn","roll","breath","shortphrase","mediumphrase","longphrase","segno","coda","D.S.","D.C.","fine","beambr1","beambr2","slide","marcato","upbow","downbow","/","//","///","////","trem1","trem2","trem3","trem4","turnx","invertedturn","invertedturnx","trill(","trill)","arpeggio","xstem","mark","umarcato","style=normal","style=harmonic","style=rhythm","style=x"],w=["p","pp","f","ff","mf","mp","ppp","pppp","fff","ffff","sfz"],x=["crescendo(","crescendo)","diminuendo(","diminuendo)"],k=[["<","accent"],[">","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]],A=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]],T=function(e,t){var i=p.macros[e.charAt(t)];if(void 0!==i)return"!"!==i.charAt(0)&&"+"!==i.charAt(0)||(i=i.substring(1)),"!"!==i.charAt(i.length-1)&&"+"!==i.charAt(i.length-1)||(i=i.substring(0,i.length-1)),r.detect(y,(function(e){return i===e}))?[1,i]:r.detect(w,(function(e){return i===e}))?("hidden"===p.volumePosition&&(i=""),[1,i]):r.detect(x,(function(e){return"hidden"===p.dynamicPosition&&(i=""),i===e}))?[1,i]:(r.detect(p.ignoredDecorations,(function(e){return i===e}))||g("Unknown macro: "+i,e,t),[1,""]);switch(e.charAt(t)){case".":if("("===e[t+1]||"-"===e[t+1])break;return[1,"staccato"];case"u":return[1,"upbow"];case"v":return[1,"downbow"];case"~":return[1,"irishroll"];case"!":case"+":var a=n.getBrackettedSubstring(e,t,5);return a[1].length>1&&("^"===a[1].charAt(0)||"_"===a[1].charAt(0))&&(a[1]=a[1].substring(1)),r.detect(y,(function(e){return a[1]===e}))?a:r.detect(w,(function(e){return a[1]===e}))?("hidden"===p.volumePosition&&(a[1]=""),a):r.detect(x,(function(e){return a[1]===e}))?("hidden"===p.dynamicPosition&&(a[1]=""),a):r.detect(k,(function(e){return a[1]===e[0]&&(a[1]=e[1],!0)}))?a:r.detect(A,(function(e){return a[1]===e[0]&&(a[1]=e[1],!0)}))?("hidden"===p.dynamicPosition&&(a[1]=""),a):"!"!==e.charAt(t)||1!==a[0]&&"!"===e.charAt(t+a[0]-1)?(g("Unknown decoration: "+a[1],e,t),a[1]="",a):[1,null];case"H":return[1,"fermata"];case"J":return[1,"slide"];case"L":return[1,"accent"];case"M":return[1,"mordent"];case"O":return[1,"coda"];case"P":return[1,"pralltriller"];case"R":return[1,"roll"];case"S":return[1,"segno"];case"T":return[1,"trill"]}return[0,0]},S=function(e,t){for(var r=t;n.isWhiteSpace(e.charAt(t));)t++;return[t-r]},M=function(e,t){var r=n.getBarLine(e,t);if(0===r.len)return[0,""];if(r.warn)return g(r.warn,e,t),[r.len,""];for(var i=0;i<e.length&&" "===e.charAt(t+r.len+i);i++);var a=r.len;if("["===e.charAt(t+r.len+i)&&(r.len+=i+1),'"'===e.charAt(t+r.len)&&"["===e.charAt(t+r.len-1)){var s=n.getBrackettedSubstring(e,t+r.len,5);return[r.len+s[0],r.token,s[1]]}var o=n.getTokenOf(e.substring(t+r.len),"1234567890-,");return 0===o.len||"-"===o.token[0]?[a,r.token]:[r.len+o.len,r.token,o.token]},N={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2},C=function(e,t){var r={},i=t;for("."===e[t]&&"("===e[t+1]&&(r.dottedSlur=!0,t++);"("===e.charAt(t)||n.isWhiteSpace(e.charAt(t));)"("===e.charAt(t)&&(t+1<e.length&&e.charAt(t+1)>="2"&&e.charAt(t+1)<="9"?(void 0!==r.triplet?g("Can't nest triplets",e,t):(r.triplet=e.charAt(t+1)-"0",r.tripletQ=N[r.triplet],r.num_notes=r.triplet,t+2<e.length&&":"===e.charAt(t+2)&&(t+3<e.length&&":"===e.charAt(t+3)?t+4<e.length&&e.charAt(t+4)>="1"&&e.charAt(t+4)<="9"?(r.num_notes=e.charAt(t+4)-"0",t+=3):g("expected number after the two colons after the triplet to mark the duration",e,t):t+3<e.length&&e.charAt(t+3)>="1"&&e.charAt(t+3)<="9"?(r.tripletQ=e.charAt(t+3)-"0",t+4<e.length&&":"===e.charAt(t+4)?t+5<e.length&&e.charAt(t+5)>="1"&&e.charAt(t+5)<="9"&&(r.num_notes=e.charAt(t+5)-"0",t+=4):t+=2):g("expected number after the triplet to mark the duration",e,t))),t++):void 0===r.startSlur?r.startSlur=1:r.startSlur++),t++;return r.consumed=t-i,r},E=function(e,t){switch(e.charAt(t)){case">":return t<e.length-1&&">"===e.charAt(t+1)?[2,1.75,.25]:[1,1.5,.5];case"<":return t<e.length-1&&"<"===e.charAt(t+1)?[2,.25,1.75]:[1,.5,1.5]}return null},I=function(e){return void 0!==e.duration&&e.duration<.25&&(e.end_beam=!0),e},_={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11},B={x:"invisible",y:"spacer",z:"rest",Z:"multimeasure"},P=function(r,i,a,s){var o,l=function(e){return"octave"===e||"duration"===e||"Zduration"===e||"broken_rhythm"===e||"end_slur"===e};"."===r[i]&&"-"===r[i+1]&&(o=!0,i++);for(var h="startSlur",u=!1;;){switch(r.charAt(i)){case"(":if("startSlur"!==h)return l(h)?(a.endChar=i,a):null;void 0===a.startSlur?a.startSlur=1:a.startSlur++;break;case")":if(!l(h))return null;void 0===a.endSlur?a.endSlur=1:a.endSlur++;break;case"^":if("startSlur"===h)a.accidental="sharp",h="sharp2";else{if("sharp2"!==h)return l(h)?(a.endChar=i,a):null;a.accidental="dblsharp",h="pitch"}break;case"_":if("startSlur"===h)a.accidental="flat",h="flat2";else{if("flat2"!==h)return l(h)?(a.endChar=i,a):null;a.accidental="dblflat",h="pitch"}break;case"=":if("startSlur"!==h)return l(h)?(a.endChar=i,a):null;a.accidental="natural",h="pitch";break;case"A":case"B":case"C":case"D":case"E":case"F":case"G":case"a":case"b":case"c":case"d":case"e":case"f":case"g":if("startSlur"!==h&&"sharp2"!==h&&"flat2"!==h&&"pitch"!==h)return l(h)?(a.endChar=i,a):null;if(a.pitch=_[r.charAt(i)],c.note(p,a),h="octave",s&&0!==p.next_note_duration?(a.duration=p.default_length*p.next_note_duration,p.next_note_duration=0,u=!0):a.duration=p.default_length,p.clef&&"perc"===p.clef.type||p.currentVoice&&"perc"===p.currentVoice.clef){var d=r.charAt(i);if(a.accidental){d={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^"}[a.accidental]+d}e.formatting&&e.formatting.midi&&e.formatting.midi.drummap&&(a.midipitch=e.formatting.midi.drummap[d])}else p.clef&&p.clef.type.indexOf("-")>=0?a.soundPitch=a.pitch-7:p.clef&&p.clef.type.indexOf("+")>=0&&(a.soundPitch=a.pitch+7);break;case",":if("octave"!==h)return l(h)?(a.endChar=i,a):null;a.pitch-=7,void 0!==a.soundPitch&&(a.soundPitch-=7);break;case"'":if("octave"!==h)return l(h)?(a.endChar=i,a):null;a.pitch+=7,void 0!==a.soundPitch&&(a.soundPitch+=7);break;case"x":case"y":case"z":case"Z":if("startSlur"!==h)return l(h)?(a.endChar=i,a):null;a.rest={type:B[r.charAt(i)]},delete a.accidental,delete a.startSlur,delete a.startTie,delete a.endSlur,delete a.endTie,delete a.end_beam,delete a.grace_notes,"multimeasure"===a.rest.type?(a.duration=e.getBarLength(),a.rest.text=1,h="Zduration"):(s&&0!==p.next_note_duration?(a.duration=p.default_length*p.next_note_duration,p.next_note_duration=0,u=!0):a.duration=p.default_length,h="duration");break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"0":case"/":if("octave"===h||"duration"===h){var f=n.getFraction(r,i);for(a.duration=a.duration*f.value,a.endChar=f.index;f.index<r.length&&(n.isWhiteSpace(r.charAt(f.index))||"-"===r.charAt(f.index));)"-"===r.charAt(f.index)?a.startTie={}:a=I(a),f.index++;i=f.index-1,h="broken_rhythm"}else if("sharp2"===h)a.accidental="quartersharp",h="pitch";else{if("flat2"!==h){if("Zduration"===h){var m=n.getNumber(r,i);return a.duration=m.num*e.getBarLength(),a.rest.text=m.num,a.endChar=m.index,a}return null}a.accidental="quarterflat",h="pitch"}break;case"-":if("startSlur"===h)t.addTieToLastNote(o),a.endTie=!0;else{if("octave"!==h&&"duration"!==h&&"end_slur"!==h)return"broken_rhythm"===h?(a.endChar=i,a):null;if(a.startTie={},u||!s)return n.isWhiteSpace(r.charAt(i+1))&&I(a),a.endChar=i+1,a;h="broken_rhythm"}break;case" ":case"\t":if(!l(h))return null;a.end_beam=!0,o=!1;do{"."===r.charAt(i)&&"-"===r.charAt(i+1)&&(o=!0,i++),"-"===r.charAt(i)&&(a.startTie={},o&&(a.startTie.style="dotted")),i++}while(i<r.length&&(n.isWhiteSpace(r.charAt(i))||"-"===r.charAt(i))||"."===r.charAt(i)&&"-"===r.charAt(i+1));if(a.endChar=i,u||!s||"<"!==r.charAt(i)&&">"!==r.charAt(i))return a;i--,h="broken_rhythm";break;case">":case"<":if(!l(h))return null;if(!s)return a.endChar=i,a;var g=E(r,i);i+=g[0]-1,p.next_note_duration=g[2],a.duration=g[1]*a.duration,h="end_slur";break;default:return l(h)?(a.endChar=i,a):null}if(++i===r.length)return l(h)?(a.endChar=i,a):null}return null};function D(){var e={startChar:-1,endChar:-1};p.partForNextLine.title&&(e.part=p.partForNextLine),e.clef=p.currentVoice&&void 0!==p.staves[p.currentVoice.staffNum].clef?r.clone(p.staves[p.currentVoice.staffNum].clef):r.clone(p.clef);var n=p.currentVoice?p.currentVoice.scoreTranspose:0;if(e.key=s.standardKey(p.key.root+p.key.acc+p.key.mode,p.key.root,p.key.acc,n),e.key.mode=p.key.mode,p.key.impliedNaturals&&(e.key.impliedNaturals=p.key.impliedNaturals),p.key.explicitAccidentals)for(var i=0;i<p.key.explicitAccidentals.length;i++){for(var a=!1,o=0;o<e.key.accidentals.length;o++)e.key.accidentals[o].note===p.key.explicitAccidentals[i].note&&(e.key.accidentals[o].acc=p.key.explicitAccidentals[i].acc,a=!0);a||e.key.accidentals.push(p.key.explicitAccidentals[i])}if(p.targetKey=e.key,e.key.explicitAccidentals&&delete e.key.explicitAccidentals,s.addPosToKey(e.clef,e.key),null!==p.meter?(p.currentVoice?(r.each(p.staves,(function(e){e.meter=p.meter})),e.meter=p.staves[p.currentVoice.staffNum].meter,p.staves[p.currentVoice.staffNum].meter=null):e.meter=p.meter,p.meter=null):p.currentVoice&&p.staves[p.currentVoice.staffNum].meter&&(e.meter=p.staves[p.currentVoice.staffNum].meter,p.staves[p.currentVoice.staffNum].meter=null),p.currentVoice&&p.currentVoice.name&&(e.name=p.currentVoice.name),p.vocalfont&&(e.vocalfont=p.vocalfont),p.tripletfont&&(e.tripletfont=p.tripletfont),p.gchordfont&&(e.gchordfont=p.gchordfont),p.style&&(e.style=p.style),p.currentVoice){var c=p.staves[p.currentVoice.staffNum];c.brace&&(e.brace=c.brace),c.bracket&&(e.bracket=c.bracket),c.connectBarLines&&(e.connectBarLines=c.connectBarLines),c.name&&(e.name=c.name[p.currentVoice.index]),c.subname&&(e.subname=c.subname[p.currentVoice.index]),p.currentVoice.stem&&(e.stem=p.currentVoice.stem),p.currentVoice.stafflines&&(e.stafflines=p.currentVoice.stafflines),p.currentVoice.staffscale&&(e.staffscale=p.currentVoice.staffscale),p.currentVoice.scale&&(e.scale=p.currentVoice.scale),p.currentVoice.style&&(e.style=p.currentVoice.style),p.currentVoice.transpose&&(e.clef.transpose=p.currentVoice.transpose)}var l=void 0===p.currentVoice||0===p.currentVoice.staffNum&&0===p.currentVoice.index;0===p.barNumbers&&l&&1!==p.currBarNumber&&(e.barNumber=p.currBarNumber),t.startNewLine(e),p.key.impliedNaturals&&delete p.key.impliedNaturals,p.partForNextLine={},4===p.tempoForNextLine.length&&t.appendElement(p.tempoForNextLine[0],p.tempoForNextLine[1],p.tempoForNextLine[2],p.tempoForNextLine[3]),p.tempoForNextLine=[]}var L=function(e,t){if("{"===e.charAt(t)){var r=n.getBrackettedSubstring(e,t,1,"}");r[2]||g("Missing the closing '}' while parsing grace note",e,t),")"===e[t+r[0]]&&(r[0]++,r[1]+=")");for(var i=[],a=0,s=!1;a<r[1].length;){var o=!1;"/"===r[1].charAt(a)&&(o=!0,a++);var c=P(r[1],a,{},!1);null!==c?(c.duration=c.duration/(8*p.default_length),o&&(c.acciaccatura=!0),i.push(c),s&&(c.endTie=!0,s=!1),c.startTie&&(s=!0),a=c.endChar,delete c.endChar):(" "===r[1].charAt(a)?i.length>0&&(i[i.length-1].end_beam=!0):g("Unknown character '"+r[1].charAt(a)+"' while parsing grace note",e,t),a++)}if(i.length)return[r[0],i]}return[0]};function O(e,t){if("&"===e.charAt(t)){for(var n=t;e.charAt(t)&&":"!==e.charAt(t)&&"|"!==e.charAt(t);)t++;return[t-n,e.substring(n+1,t)]}return[0]}function H(e){var t=e.origMeter;return t&&"specified"===t.type&&t.value&&0!==t.value.length?parseInt(t.value[0].num,10)/parseInt(t.value[0].den,10):1}var V=function(e,t,n){if(void 0===e.inTie[t])return!1;var r=e.currentVoice?e.currentVoice.index:0;return!(!e.inTie[t][r]||void 0===n.pitches&&"spacer"===n.rest.type)},F=function(e,t,n){var r=e.currentVoice?e.currentVoice.index:0;void 0===e.inTie[t]&&(e.inTie[t]=[]),e.inTie[t][r]=n},z=function i(a){var s=v.parseHeader(a);s.regular&&function(i){v.resolveTempo(),p.is_in_header=!1;for(var a=0,s=p.iChar;n.isWhiteSpace(i.charAt(a))&&a<i.length;)a++;if(a!==i.length&&"%"!==i.charAt(a)){var o=p.start_new_line;void 0===p.continueall?p.start_new_line=!0:p.start_new_line=!1;var c=0,l=v.letter_to_body_header(i,a);l[0]>0&&(a+=l[0],"V"===l[1]&&(o=!0));for(var h={},u=0;a<i.length;){var d=a;if("%"===i.charAt(a))break;var f=v.letter_to_inline_header(i,a);if(f[0]>0)a+=f[0],"V"===f[1]&&(o=!0);else{var m;for(o&&(D(),o=!1);;)if((m=n.eatWhiteSpace(i,a))>0&&(a+=m),a>0&&""===i.charAt(a-1)&&(m=v.letter_to_body_header(i,a))[0]>0&&("V"===m[1]&&D(),a=m[0],p.start_new_line=!1),(m=S(i,a))[0]>0&&(a+=m[0]),(m=b(i,a))[0]>0){h.chord||(h.chord=[]);var y=n.translateString(m[1]);y=y.replace(/;/g,"\n");for(var w=!1,x=0;x<h.chord.length;x++)h.chord[x].position===m[2]&&(w=!0,h.chord[x].name+="\n"+y);!1===w&&(null===m[2]&&m[3]?h.chord.push({name:y,rel_position:m[3]}):h.chord.push({name:y,position:m[2]})),a+=m[0];var k=n.skipWhiteSpace(i.substring(a));k>0&&(h.force_end_beam_last=!0),a+=k}else if((m=-1==="ABCDEFGabcdefgxyzZ[]|^_{".indexOf(i.charAt(a))?T(i,a):[0])[0]>0)null===m[1]?a+1<i.length&&D():m[1].length>0&&(0===m[1].indexOf("style=")?h.style=m[1].substr(6):(void 0===h.decoration&&(h.decoration=[]),"beambr1"===m[1]?h.beambr=1:"beambr2"===m[1]?h.beambr=2:h.decoration.push(m[1]))),a+=m[0];else{if(!((m=L(i,a))[0]>0))break;h.gracenotes=m[1],a+=m[0]}if((m=M(i,a))[0]>0){u=0,void 0!==h.gracenotes&&(h.rest={type:"spacer"},h.duration=.125,p.addFormattingOptions(h,e.formatting,"note"),t.appendElement("note",s+a,s+a+m[0],h),p.measureNotEmpty=!0,h={});var A={type:m[1]};if(0===A.type.length)g("Unknown bar type",i,a);else{if(p.inEnding&&"bar_thin"!==A.type&&(A.endEnding=!0,p.inEnding=!1),m[2]&&(A.startEnding=m[2],p.inEnding&&(A.endEnding=!0),p.inEnding=!0,"bar_right_repeat"===m[1]?p.restoreStartEndingHoldOvers():p.duplicateStartEndingHoldOvers()),void 0!==h.decoration&&(A.decoration=h.decoration),void 0!==h.chord&&(A.chord=h.chord),A.startEnding&&void 0===p.barFirstEndingNum?p.barFirstEndingNum=p.currBarNumber:A.startEnding&&A.endEnding&&p.barFirstEndingNum?p.currBarNumber=p.barFirstEndingNum:A.endEnding&&(p.barFirstEndingNum=void 0),"bar_invisible"!==A.type&&p.measureNotEmpty)(void 0===p.currentVoice||0===p.currentVoice.staffNum&&0===p.currentVoice.index)&&(p.currBarNumber++,p.barNumbers&&p.currBarNumber%p.barNumbers==0&&(A.barNumber=p.currBarNumber));p.addFormattingOptions(h,e.formatting,"bar"),t.appendElement("bar",s+a,s+a+m[0],A),p.measureNotEmpty=!1,h={}}a+=m[0]}else if("&"===i[a])(m=O(i,a))[0]>0&&(t.appendElement("overlay",s,s+1,{}),a+=1,u++);else{if((m=C(i,a)).consumed>0&&(void 0!==m.startSlur&&(h.startSlur=m.startSlur),m.dottedSlur&&(h.dottedSlur=!0),void 0!==m.triplet&&(c>0?g("Can't nest triplets",i,a):(h.startTriplet=m.triplet,h.tripletMultiplier=m.tripletQ/m.triplet,c=void 0===m.num_notes?m.triplet:m.num_notes)),a+=m.consumed),"["===i.charAt(a)){var N=a;a++;for(var _=null,B=!1,z=!1;!z;){var j=T(i,a);j[0]>0&&(a+=j[0]);var q=P(i,a,{},!1);if(null!==q&&void 0!==q.pitch)j[0]>0&&0!==j[1].indexOf("style=")&&(void 0===h.decoration&&(h.decoration=[]),h.decoration.push(j[1])),q.end_beam&&(h.end_beam=!0,delete q.end_beam),void 0===h.pitches?(h.duration=q.duration,h.pitches=[q]):h.pitches.push(q),delete q.duration,j[0]>0&&0===j[1].indexOf("style=")&&(h.pitches[h.pitches.length-1].style=j[1].substr(6)),p.inTieChord[h.pitches.length]&&(q.endTie=!0,p.inTieChord[h.pitches.length]=void 0),q.startTie&&(p.inTieChord[h.pitches.length]=!0),a=q.endChar,delete q.endChar;else if(" "===i.charAt(a))g("Spaces are not allowed in chords",i,a),a++;else{if(a<i.length&&"]"===i.charAt(a)){a++,0!==p.next_note_duration&&(h.duration=h.duration*p.next_note_duration,p.next_note_duration=0),V(p,u,h)&&(r.each(h.pitches,(function(e){e.endTie=!0})),F(p,u,!1)),c>0&&(!h.rest||"spacer"!==h.rest.type)&&0===--c&&(h.endTriplet=!0);for(var Y=!1;a<i.length&&!Y;){switch(i.charAt(a)){case" ":case"\t":I(h);break;case")":void 0===h.endSlur?h.endSlur=1:h.endSlur++;break;case"-":r.each(h.pitches,(function(e){e.startTie={}})),F(p,u,!0);break;case">":case"<":var W=E(i,a);a+=W[0]-1,p.next_note_duration=W[2],_?_*=W[1]:_=W[1];break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"/":var R=n.getFraction(i,a);_=R.value,a=R.index," "===i.charAt(a)&&(B=!0),"-"===i.charAt(a)||")"===i.charAt(a)||" "===i.charAt(a)||"<"===i.charAt(a)||">"===i.charAt(a)?a--:Y=!0;break;default:Y=!0}Y||a++}}else g("Expected ']' to end the chords",i,a);void 0!==h.pitches&&(null!==_&&(h.duration=h.duration*_,B&&I(h)),p.addFormattingOptions(h,e.formatting,"note"),t.appendElement("note",s+N,s+a,h),p.measureNotEmpty=!0,h={}),z=!0}}}else{var G={},U=P(i,a,G,!0);void 0!==G.endTie&&F(p,u,!0),null!==U&&(void 0!==U.pitch?(h.pitches=[{}],void 0!==U.accidental&&(h.pitches[0].accidental=U.accidental),h.pitches[0].pitch=U.pitch,(U.soundPitch||0===U.soundPitch)&&(h.pitches[0].soundPitch=U.soundPitch),(U.midipitch||0===U.midipitch)&&(h.pitches[0].midipitch=U.midipitch),void 0!==U.endSlur&&(h.pitches[0].endSlur=U.endSlur),void 0!==U.endTie&&(h.pitches[0].endTie=U.endTie),void 0!==U.startSlur&&(h.pitches[0].startSlur=U.startSlur),void 0!==h.startSlur&&(h.pitches[0].startSlur=h.startSlur),void 0!==h.dottedSlur&&(h.pitches[0].dottedSlur=!0),void 0!==U.startTie&&(h.pitches[0].startTie=U.startTie),void 0!==h.startTie&&(h.pitches[0].startTie=h.startTie)):(h.rest=U.rest,void 0!==U.endSlur&&(h.endSlur=U.endSlur),void 0!==U.endTie&&(h.rest.endTie=U.endTie),void 0!==U.startSlur&&(h.startSlur=U.startSlur),void 0!==U.startTie&&(h.rest.startTie=U.startTie),void 0!==h.startTie&&(h.rest.startTie=h.startTie)),void 0!==U.chord&&(h.chord=U.chord),void 0!==U.duration&&(h.duration=U.duration),void 0!==U.decoration&&(h.decoration=U.decoration),void 0!==U.graceNotes&&(h.graceNotes=U.graceNotes),delete h.startSlur,delete h.dottedSlur,V(p,u,h)&&(void 0!==h.pitches?h.pitches[0].endTie=!0:"spacer"!==h.rest.type&&(h.rest.endTie=!0),F(p,u,!1)),(U.startTie||h.startTie)&&F(p,u,!0),a=U.endChar,c>0&&(!U.rest||"spacer"!==U.rest.type)&&0===--c&&(h.endTriplet=!0),U.end_beam&&I(h),h.rest&&"rest"===h.rest.type&&1===h.duration&&H(p)<=1&&(h.rest.type="whole",h.duration=H(p)),p.addFormattingOptions(h,e.formatting,"note"),t.appendElement("note",s+d,s+a,h),p.measureNotEmpty=!0,h={})}a===d&&(" "!==i.charAt(a)&&"`"!==i.charAt(a)&&g("Unknown character ignored",i,a),a++)}}}}}(s.str),s.newline&&D(),s.words&&function(e,t){if(e){"-"!==(t=r.strip(t)).charAt(t.length-1)&&(t+=" ");for(var i=[],a=0,s=!1,o=function(e){var o=r.strip(t.substring(a,e));if(a=e+1,o.length>0){s&&(o=r.gsub(o,"~"," "));var c=t.charAt(e);return"_"!==c&&"-"!==c&&(c=" "),i.push({syllable:n.translateString(o),divider:c}),s=!1,!0}return!1},c=0;c<t.length;c++)switch(t.charAt(c)){case" ":case"":o(c);break;case"-":!o(c)&&i.length>0&&(r.last(i).divider="-",i.push({skip:!0,to:"next"}));break;case"_":o(c),i.push({skip:!0,to:"slur"});break;case"*":o(c),i.push({skip:!0,to:"next"});break;case"|":o(c),i.push({skip:!0,to:"bar"});break;case"~":s=!0}r.each(e,(function(e){if(0!==i.length)if(i[0].skip){switch(i[0].to){case"next":case"slur":"note"===e.el_type&&null!==e.pitches&&i.shift();break;case"bar":"bar"===e.el_type&&i.shift()}"bar"!==e.el_type&&(void 0===e.lyric?e.lyric=[{syllable:"",divider:" "}]:e.lyric.push({syllable:"",divider:" "}))}else if("note"===e.el_type&&void 0===e.rest){var t=i.shift();t.syllable&&(t.syllable=t.syllable.replace(/ +/g," ")),void 0===e.lyric?e.lyric=[t]:e.lyric.push(t)}}))}else g("Can't add words before the first line of music",e,0)}(t.getCurrentVoice(),a.substring(2)),s.symbols&&function(e,t){if(e){"-"!==(t=r.strip(t)).charAt(t.length-1)&&(t+=" ");for(var i=[],a=0,s=!1,o=function(e){var o=r.strip(t.substring(a,e));if(a=e+1,o.length>0){s&&(o=r.gsub(o,"~"," "));var c=t.charAt(e);return"_"!==c&&"-"!==c&&(c=" "),i.push({syllable:n.translateString(o),divider:c}),s=!1,!0}return!1},c=0;c<t.length;c++)switch(t.charAt(c)){case" ":case"":o(c);break;case"-":!o(c)&&i.length>0&&(r.last(i).divider="-",i.push({skip:!0,to:"next"}));break;case"_":o(c),i.push({skip:!0,to:"slur"});break;case"*":o(c),i.push({skip:!0,to:"next"});break;case"|":o(c),i.push({skip:!0,to:"bar"});break;case"~":s=!0}r.each(e,(function(e){if(0!==i.length)if(i[0].skip)switch(i[0].to){case"next":case"slur":"note"===e.el_type&&null!==e.pitches&&i.shift();break;case"bar":"bar"===e.el_type&&i.shift()}else if("note"===e.el_type&&void 0===e.rest){var t=i.shift();void 0===e.lyric?e.lyric=[t]:e.lyric.push(t)}}))}else g("Can't add symbols before the first line of music",e,0)}(t.getCurrentVoice(),a.substring(2)),s.recurse&&i(s.str)};function j(e,t){e.push({el_type:"hint"});for(var n=0;n<t.length;n++){var i=t[n],a=r.clone(i);if(e.push(a),"bar"===i.el_type)return}}function q(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=t[n];if(i)for(var a=0;a<i.voices.length;a++){var s=i.voices[a],o=r.voices[a];o&&j(o,s)}}}this.parse=function(a,s,o){if(s||(s={}),o||(o=0),t.reset(),s.print&&(e.media="print"),p.reset(),p.iChar=o,s.visualTranspose?(p.globalTranspose=parseInt(s.visualTranspose),0===p.globalTranspose?p.globalTranspose=void 0:t.setVisualTranspose(s.visualTranspose)):p.globalTranspose=void 0,s.lineBreaks){p.lineBreaks={};for(var c=0;c<s.lineBreaks.length;c++)p.lineBreaks[""+(s.lineBreaks[c]+1)]=!0}v.reset(n,g,p,e),a=r.gsub(a,"\r\n","\n"),a=r.gsub(a,"\r","\n");var h=(a+="\n").split("\n\\");if(h.length>1){for(var u=1;u<h.length;u++)for(;h[u].length>0&&"\n"!==h[u][0];)h[u]=h[u].substr(1),h[u-1]+=" ";a=h.join(" ")}var d=(a=a.replace(/\\([ \t]*)(%.*)*\n/g,(function(e,t,n){return t+" "+(n?" ".substring(0,n.length):"")}))).split("\n");0===r.last(d).length&&d.pop();try{s.format&&i.globalFormatting(s.format),r.each(d,(function(e){if(s.header_only&&!1===p.is_in_header)throw"normal_abort";if(s.stop_on_warning&&p.warnings)throw"normal_abort";if(p.is_in_history)":"===e.charAt(1)?(p.is_in_history=!1,z(e)):t.addMetaText("history",n.translateString(n.stripComment(e)));else if(p.inTextBlock)r.startsWith(e,"%%endtext")?(t.addText(p.textBlock),p.inTextBlock=!1):r.startsWith(e,"%%")?p.textBlock+=e.substring(2)+"\n":p.textBlock+=e+"\n";else if(p.inPsBlock)r.startsWith(e,"%%endps")?p.inPsBlock=!1:p.textBlock+=" "+e;else{var i=p.is_in_header;z(e),i&&!p.is_in_header&&(t.setRunningFont("annotationfont",p.annotationfont),t.setRunningFont("gchordfont",p.gchordfont),t.setRunningFont("tripletfont",p.tripletfont),t.setRunningFont("vocalfont",p.vocalfont))}p.iChar+=e.length+1}));var f=792,m=612;switch(p.papersize){case"legal":f=1008,m=612;break;case"A4":f=842.4,m=597.6}if(p.landscape){var b=f;f=m,m=b}p.openSlurs=t.cleanUp(m,f,p.barsperstaff,p.staffnonote,p.openSlurs)}catch(e){if("normal_abort"!==e)throw e}s.hint_measures&&function(){for(var t=0;t<e.lines.length;t++){var n=e.lines[t].staff;if(n){for(var r=t+1;r<e.lines.length&&void 0===e.lines[r].staff;)r++;if(r<e.lines.length)q(n,e.lines[r].staff)}}}(),l.wrapLines(e,p.lineBreaks)}}},function(e,t){var n={},r={C:0,"C#":1,Db:1,D:2,"D#":3,Eb:3,E:4,F:5,"F#":6,Gb:6,G:7,"G#":8,Ab:8,A:9,"A#":10,Bb:10,B:11},i=["C","Db","D","Eb","E","F","F#","G","Ab","A","Bb","B"],a=["C","C#","D","D#","E","F","F#","G","G#","A","Bb","B"];n.keySignature=function(e,t,n,s,o,c){if("perc"===e.clef.type)return{accidentals:t[n],root:s,acc:o};c||(c=0),e.localTransposeVerticalMovement=0,e.localTransposePreferFlats=!1;var l=t[n];if(!l)return e.key;if(e.localTranspose=(e.globalTranspose?e.globalTranspose:0)+c,!e.localTranspose)return{accidentals:l,root:s,acc:o};if(e.globalTransposeOrigKeySig=l,e.localTranspose%12==0)return e.localTransposeVerticalMovement=e.localTranspose/12*7,{accidentals:l,root:s,acc:o};var h=n[0];"b"===n[1]||"#"===n[1]?(h+=n[1],n=n.substr(2)):n=n.substr(1);for(var u=r[h]+e.localTranspose;u<0;)u+=12;u>11&&(u%=12);var d="m"===n[0]?a[u]:i[u],f=d+n,p=t[f];p.length>0&&"flat"===p[0].acc&&(e.localTransposePreferFlats=!0);var m=f.charCodeAt(0)-h.charCodeAt(0);return e.localTranspose>0?m<0?m+=7:0===m&&("#"!==h[1]&&"b"!==f[1]||(m+=7)):e.localTranspose<0&&(m>0?m-=7:0===m&&("b"!==h[1]&&"#"!==f[1]||(m-=7))),e.localTranspose>0?e.localTransposeVerticalMovement=m+7*Math.floor(e.localTranspose/12):e.localTransposeVerticalMovement=m+7*Math.ceil(e.localTranspose/12),{accidentals:p,root:d[0],acc:d.length>1?d[1]:""}};var s=["C","C♯","D","D♯","E","F","F♯","G","G♯","A","A♯","B"],o=["C","D♭","D","E♭","E","F","G♭","G","A♭","A","B♭","B"],c=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],l=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"];n.chordName=function(e,t){if(e.localTranspose&&e.localTranspose%12!=0){for(var n=e.localTranspose;n<0;)n+=12;n>11&&(n%=12);for(var r=(t=(t=(t=(t=(t=(t=(t=(t=e.freegchord?(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/Cb/g,"`~11`")).replace(/Db/g,"`~1`")).replace(/Eb/g,"`~3`")).replace(/Fb/g,"`~4`")).replace(/Gb/g,"`~6`")).replace(/Ab/g,"`~8`")).replace(/Bb/g,"`~10`")).replace(/C#/g,"`~1`")).replace(/D#/g,"`~3`")).replace(/E#/g,"`~5`")).replace(/F#/g,"`~6`")).replace(/G#/g,"`~8`")).replace(/A#/g,"`~10`")).replace(/B#/g,"`~0`"):(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/C♭/g,"`~11`")).replace(/D♭/g,"`~1`")).replace(/E♭/g,"`~3`")).replace(/F♭/g,"`~4`")).replace(/G♭/g,"`~6`")).replace(/A♭/g,"`~8`")).replace(/B♭/g,"`~10`")).replace(/C♯/g,"`~1`")).replace(/D♯/g,"`~3`")).replace(/E♯/g,"`~5`")).replace(/F♯/g,"`~6`")).replace(/G♯/g,"`~8`")).replace(/A♯/g,"`~10`")).replace(/B♯/g,"`~0`")).replace(/C/g,"`~0`")).replace(/D/g,"`~2`")).replace(/E/g,"`~4`")).replace(/F/g,"`~5`")).replace(/G/g,"`~7`")).replace(/A/g,"`~9`")).replace(/B/g,"`~11`")).split("`"),i=0;i<r.length;i++)if("~"===r[i][0]){var a=parseInt(r[i].substr(1),10);(a+=n)>11&&(a-=12),e.freegchord?r[i]=e.localTransposePreferFlats?l[a]:c[a]:r[i]=e.localTransposePreferFlats?o[a]:s[a]}t=r.join("")}return t};var h=["c","d","e","f","g","a","b"];var u={dblflat:-2,flat:-1,natural:0,sharp:1,dblsharp:2},d={"-2":"dblflat","-1":"flat",0:"natural",1:"sharp",2:"dblsharp"};n.note=function(e,t){if(e.localTranspose&&"perc"!==e.clef.type){var n=t.pitch;if(t.pitch=t.pitch+e.localTransposeVerticalMovement,t.accidental){var r=function(e,t,n,r,i){for(var a=h[(e+49)%7],s=0,o=0;o<r.length;o++)r[o].note.toLowerCase()===a&&(s=u[r[o].acc]);for(var c=u[n]-s,l=h[(t+49)%7],d=0,f=0;f<i.accidentals.length;f++)i.accidentals[f].note.toLowerCase()===l&&(d=u[i.accidentals[f].acc]);var p=c+d;return p<-2&&(t--,p+="c"===l||"f"===l?1:2),p>2&&(t++,p-="b"===l||"e"===l?1:2),[t,p]}(n,t.pitch,t.accidental,e.globalTransposeOrigKeySig,e.targetKey);t.pitch=r[0],t.accidental=d[r[1]]}}},e.exports=n},function(e,t){function n(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t}function r(e,t,r,i,a,s,o,c,l,h,u){for(var d=h;d<e.length;d++){var f=e[d];r+=f,i+=f;var p=Math.abs(r-t[c]);if(Math.abs(p-s)<t[0]/10)if(p<s){var m=n(a),g=n(l);g.push(d-1),m.push(i-f),u.push({accumulator:r,lineAccumulator:f,lineWidths:m,lastVariance:Math.abs(r-t[c+1]),highestVariance:Math.max(o,s),currLine:c+1,lineBreaks:g,startIndex:d+1})}else p>s&&d<e.length-1&&(m=n(a),g=n(l),u.push({accumulator:r,lineAccumulator:i,lineWidths:m,lastVariance:p,highestVariance:Math.max(o,p),currLine:c,lineBreaks:g,startIndex:d+1}));p>s?(l.push(d-1),c++,o=Math.max(o,s),s=Math.abs(r-t[c]),a.push(i-f),i=f):s=p}a.push(i)}function i(e,t,n,r,i){var a=new i,s={lineBreaks:e,staffwidth:t};for(var o in r)r.hasOwnProperty(o)&&"wrap"!==o&&"staffwidth"!==o&&(s[o]=r[o]);return a.parse(n,s),{tune:a.getTune(),revisedParams:s}}e.exports={wrapLines:function(e,t){if(t&&0!==e.lines.length){for(var n=[],r=[],i=[],a=[],s=[],o="",c={},l=0,h=0;h<e.lines.length;h++){var u=e.lines[h];if(u.staff){for(var d=u.staff,f=0;f<d.length;f++){void 0===r[f]&&(r[f]=[],i[f]=[],a[f]=[],s[f]=[]);for(var p=d[f],m=p.voices,g=0;g<m.length;g++){void 0===r[f][g]&&(r[f][g]=!0,i[f][g]=0,a[f][g]=0,s[f][g]=0),l>0&&(i[f][g]+=l);for(var v=m[g],b=0;b<v.length;b++){if(r[f][g]){if(n[i[f][g]]||(n[i[f][g]]={staff:[]}),!n[i[f][g]].staff[f])for(var y in n[i[f][g]].staff[f]={voices:[]},p)p.hasOwnProperty(y)&&("meter"===y?0!==i[f][g]&&o===JSON.stringify(p[y])||(o=JSON.stringify(p[y]),n[i[f][g]].staff[f][y]=p[y]):"voices"!==y&&(n[i[f][g]].staff[f][y]=p[y]));s[f][g]&&(n[i[f][g]].staff[f].barNumber=s[f][g]),r[f][g]=!1}var w=v[b];if(!n[i[f][g]].staff[f].voices[g])for(var x in n[i[f][g]].staff[f].voices[g]=[],c)c.hasOwnProperty(x)&&n[i[f][g]].staff[f].voices[g].push(c[x]);n[i[f][g]].staff[f].voices[g].push(w),"stem"===w.el_type&&(c[w.el_type]=w),"bar"===w.el_type&&(a[f][g]++,t[a[f][g]]&&(r[f][g]=!0,i[f][g]++,s[f][g]=w.barNumber,delete w.barNumber))}}}l=0}else n.push(u),l++}e.lines=n}},calcLineWraps:function(e,t,n,a,s,o){if(a.staffwidth<t.left)return{explanation:"Staffwidth is narrower than the margin",tune:e,revisedParams:a};var c=a.scale?Math.max(a.scale,.1):1,l=a.wrap.minSpacing?Math.max(parseFloat(a.wrap.minSpacing),1):1,h=a.wrap.minSpacingLimit?Math.max(parseFloat(a.wrap.minSpacingLimit),1):l-.1,u=a.wrap.maxSpacing?Math.max(parseFloat(a.wrap.maxSpacing),1):void 0;a.wrap.lastLineLimit&&!u&&(u=Math.max(parseFloat(a.wrap.lastLineLimit),1));var d=a.wrap.preferredMeasuresPerLine?Math.max(parseInt(a.wrap.preferredMeasuresPerLine,10),1):void 0,f=(a.staffwidth-t.left)/l/c,p=(a.staffwidth-t.left)/u/c,m=(a.staffwidth-t.left)/h/c,g={widths:t,lineBreakPoint:f,minLineSize:p,attempts:[],staffWidth:a.staffwidth,minWidth:Math.round(m)},v=null;if(d){var b=function(e,t,n){for(var r=[],i=[],a=0,s=!1,o=0;o<e.length;o++)(a+=e[o])>t&&(s=!0),o%n==n-1&&(o!==e.length-1&&r.push(o),i.push(Math.round(a)),a=0);return{failed:s,totals:i,lineBreaks:r}}(t.measureWidths,f,d);g.attempts.push({type:"Fixed Measures Per Line",preferredMeasuresPerLine:d,lineBreaks:b.lineBreaks,failed:b.failed,totals:b.totals}),b.failed||(v=b.lineBreaks)}if(!v){var y=function(e,t){for(var n=[],r=[],i=0,a=0;a<e.length;a++){var s=e[a],o=i+s;if(o<t)i=o;else t-i<o-t&&i>0?(n.push(a-1),r.push(Math.round(i-s)),i=s):a<e.length-1&&(n.push(a),r.push(Math.round(i)),i=0)}return r.push(Math.round(i)),{lineBreaks:n,totals:r}}(t.measureWidths,f);g.attempts.push({type:"Free Form",lineBreaks:y.lineBreaks,totals:y.totals}),v=y.lineBreaks,y=function(e,t,n,i){for(var a=Math.ceil(e.total/t)+1,s=Math.floor(e.total/a),o=[],c=0;c<a;c++)o.push(s*(c+1));var l=[];l.push({accumulator:0,lineAccumulator:0,lineWidths:[],lastVariance:999999,highestVariance:0,currLine:0,lineBreaks:[],startIndex:0});for(var h=0;h<l.length;)r(e.measureWidths,o,l[h].accumulator,l[h].lineAccumulator,l[h].lineWidths,l[h].lastVariance,l[h].highestVariance,l[h].currLine,l[h].lineBreaks,l[h].startIndex,l),h++;for(c=0;c<l.length;c++){var u=l[c];u.variances=[],u.aveVariance=0;for(var d=0;d<u.lineWidths.length;d++){var f=u.lineWidths[d];u.variances.push(f-o[0]),u.aveVariance+=Math.abs(f-o[0])}u.aveVariance=u.aveVariance/u.lineWidths.length,i.attempts.push({type:"optimizeLineWidths",lineBreaks:u.lineBreaks,variances:u.variances,aveVariance:u.aveVariance,widths:e.measureWidths})}var p=9999999,m=-1;for(c=0;c<l.length;c++)(u=l[c]).aveVariance<p&&(p=u.aveVariance,m=c);return{failed:!1,lineBreaks:l[m].lineBreaks,variance:l[m].highestVariance}}(t,f,0,g),g.attempts.push({type:"Optimize",failed:y.failed,reason:y.reason,lineBreaks:y.lineBreaks,totals:y.totals}),y.failed||(v=y.lineBreaks)}var w=a.staffwidth,x=i(v,w,n,a,s),k=o.getMeasureWidths(x.tune),A=!0;return g.attempts.push({type:"heightCheck",height:k.height}),0===v.length&&p>t.total&&(w=t.total*u*c+t.left,g.attempts.push({type:"too sparse",newWidth:Math.round(w)}),A=!1),A||(x=i(v,w,n,a,s)),x.explanation=g,x}}},function(e,t,n){var r=n(0),i=n(1),a=n(33),s=n(34);e.exports=function(){function e(e,t){for(;t<e.length&&null===e[t].left;)t++;return e[t]}this.getBeatLength=function(){var e=this.getMeterFraction(),t=1;return(6===e.num||9===e.num||12===e.num||3===e.num&&8===e.den)&&(t=3),t/e.den},this.getPickupLength=function(){var e=this.getBarLength(),t=function(e,t){for(var n=0,r=0;r<e.length;r++)if(e[r].staff)for(var i=0;i<e[r].staff.length;i++)for(var a=0;a<e[r].staff[i].voices.length;a++)for(var s=e[r].staff[i].voices[a],o=1,c=0;c<s.length;c++){var l=s[c].rest&&"spacer"===s[c].rest.type;if(s[c].startTriplet&&(o=s[c].tripletMultiplier),s[c].duration&&!l&&"tempo"!==s[c].el_type&&(n+=s[c].duration*o),s[c].endTriplet&&(o=1),n>=t&&(n-=t),"bar"===s[c].el_type)return n}return n}(this.lines,e);return t<1e-8||e-t<1e-8?0:t},this.getBarLength=function(){var e=this.getMeterFraction();return e.num/e.den},this.millisecondsPerMeasure=function(e){var t;if(e)t=e;else{var n=this.metaText?this.metaText.tempo:null;t=this.getBpm(n)}return t<=0&&(t=1),6e4*(this.getBeatsPerMeasure()/t)},this.getBeatsPerMeasure=function(){var e=this.getBeatLength();return this.getBarLength()/e},this.getMeter=function(){for(var e=0;e<this.lines.length;e++){var t=this.lines[e];if(t.staff)for(var n=0;n<t.staff.length;n++){var r=t.staff[n].meter;if(r)return r}}return{type:"common_time"}},this.getMeterFraction=function(){var e=this.getMeter(),t=4,n=4;return e&&("specified"===e.type?(t=parseInt(e.value[0].num,10),n=parseInt(e.value[0].den,10)):"cut_time"===e.type?(t=2,n=2):"common_time"===e.type&&(t=4,n=4)),this.meter={num:t,den:n},this.meter},this.getKeySignature=function(){for(var e=0;e<this.lines.length;e++){var t=this.lines[e];if(t.staff)for(var n=0;n<t.staff.length;n++)if(t.staff[n].key)return t.staff[n].key}return{}},this.getElementFromChar=function(e){for(var t=0;t<this.lines.length;t++){var n=this.lines[t];if(n.staff)for(var r=0;r<n.staff.length;r++)for(var i=n.staff[r],a=0;a<i.voices.length;a++)for(var s=i.voices[a],o=0;o<s.length;o++){var c=s[o];if(c.startChar&&c.endChar&&c.startChar<=e&&c.endChar>e)return c}}return null},this.addElementToEvents=function(e,t,n,i,a,s,o,c,l,h){if(t.hint)return{isTiedState:void 0,duration:0};var u=t.durationClass?t.durationClass:t.duration;if(t.abcelem.rest&&"spacer"===t.abcelem.rest.type&&(u=0),u>0){for(var d=[],f=0;f<t.elemset.length;f++)null!==t.elemset[f]&&d.push(t.elemset[f]);var p=t.startTie;if(void 0!==l)e["event"+l].elements.push(d),h&&(e["event"+n]||(e["event"+n]={type:"event",milliseconds:n,line:s,measureNumber:o,top:i,height:a,left:null,width:0,elements:[],startChar:null,endChar:null,startCharArray:[],endCharArray:[]}),e["event"+n].measureStart=!0,h=!1),p||(l=void 0);else{if(e["event"+n]){if(e["event"+n].left?e["event"+n].left=Math.min(e["event"+n].left,t.x):e["event"+n].left=t.x,e["event"+n].elements.push(d),e["event"+n].startCharArray.push(t.abcelem.startChar),e["event"+n].endCharArray.push(t.abcelem.endChar),null===e["event"+n].startChar&&(e["event"+n].startChar=t.abcelem.startChar),null===e["event"+n].endChar&&(e["event"+n].endChar=t.abcelem.endChar),t.abcelem.midiPitches&&t.abcelem.midiPitches.length){e["event"+n].midiPitches||(e["event"+n].midiPitches=[]);for(f=0;f<t.abcelem.midiPitches.length;f++)e["event"+n].midiPitches.push(t.abcelem.midiPitches[f])}if(t.abcelem.midiGraceNotePitches&&t.abcelem.midiGraceNotePitches.length){e["event"+n].midiGraceNotePitches||(e["event"+n].midiGraceNotePitches=[]);for(var m=0;m<t.abcelem.midiGraceNotePitches.length;m++)e["event"+n].midiGraceNotePitches.push(t.abcelem.midiGraceNotePitches[m])}}else e["event"+n]={type:"event",milliseconds:n,line:s,measureNumber:o,top:i,height:a,left:t.x,width:t.w,elements:[d],startChar:t.abcelem.startChar,endChar:t.abcelem.endChar,startCharArray:[t.abcelem.startChar],endCharArray:[t.abcelem.endChar],midiPitches:t.abcelem.midiPitches?r.cloneArray(t.abcelem.midiPitches):[]},t.abcelem.midiGraceNotePitches&&(e["event"+n].midiGraceNotePitches=r.cloneArray(t.abcelem.midiGraceNotePitches));h&&(e["event"+n].measureStart=!0,h=!1),p&&(l=n)}}return{isTiedState:l,duration:u/c,nextIsBar:h||"bar"===t.type}},this.makeVoicesArray=function(){for(var e=[],t=[],n={},r=0;r<this.engraver.staffgroups.length;r++)for(var a=this.engraver.staffgroups[r],s=a.staffs[0],o=s.absoluteY,c=o-s.top*i.STEP,l=a.staffs[a.staffs.length-1],h=(o=l.absoluteY)-l.bottom*i.STEP-c,u=a.voices,d=0;d<u.length;d++){var f=!1;e[d]||(e[d]=[]),void 0===t[d]&&(t[d]=0);for(var p=u[d].children,m=0;m<p.length;m++)"tempo"===p[m].type&&(n[t[d]]=this.getBpm(p[m].abcelem)),e[d].push({top:c,height:h,line:a.line,measureNumber:t[d],elem:p[m]}),"bar"===p[m].type&&f&&t[d]++,"note"!==p[m].type&&"rest"!==p[m].type||(f=!0)}return this.tempoLocations=n,e},this.setupEvents=function(t,n,r){for(var i,a=[],s={},o=t,c=!0,l=this.makeVoicesArray(),h=0;h<l.length;h++){var u=o,d=Math.round(1e3*u),f=0,p=-1,m=l[h],g=r;n=this.getBeatLength()*g/60;for(var v=-1,b=0;b<m.length;b++){var y=m[b].measureNumber;v!==y&&this.tempoLocations[y]&&(g=this.tempoLocations[y],n=this.getBeatLength()*g/60,v=y);var w,x=m[b].elem,k=this.addElementToEvents(s,x,d,m[b].top,m[b].height,m[b].line,m[b].measureNumber,n,i,c);if(i=k.isTiedState,c=k.nextIsBar,u+=k.duration,x.duration>0&&(w="event"+d),d=Math.round(1e3*u),"bar"===x.type){var A=x.abcelem.type,T="bar_right_repeat"===A||"bar_dbl_repeat"===A,S="1"===x.abcelem.startEnding,M="bar_left_repeat"===A||"bar_dbl_repeat"===A||"bar_right_repeat"===A;if(T){b>0&&(s[w].endX=x.x),-1===p&&(p=b);var N=0;v=-1;for(var C=f;C<p;C++){v!==(y=m[C].measureNumber)&&this.tempoLocations[y]&&(g=this.tempoLocations[y],n=this.getBeatLength()*g/60,v=y);var E=m[C].elem;i=(k=this.addElementToEvents(s,E,d,m[C].top,m[C].height,m[C].line,m[C].measureNumber,n,i,c)).isTiedState,c=k.nextIsBar,u+=k.duration,N=d,d=Math.round(1e3*u)}s["event"+N]&&(s["event"+N].endX=m[p].elem.x),c=!0,p=-1}S&&(p=b),M&&(f=b)}}}return function(e){for(var t,n,r,i,a=e.length-1;a>=0;a--){var s=e[a];"bar"===s.type?(s.top=r,s.nextTop=t,t=r,s.bottom=i,s.nextBottom=n,n=i):"event"===s.type&&(r=s.top,i=s.top+s.height)}}(a=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t=t.sort((function(e,t){var n=e.milliseconds-t.milliseconds;return 0!==n?n:"bar"===e.type?-1:1}))}(s)),function(t,n){if(n.length<1)return;for(var r=0;r<n.length-1;r++){var i=n[r],a=e(n,r+1);if(null!==i.left){var s=a&&i.top===a.top?a.left:t[i.line].staffGroup.w;void 0!==i.endX?s>i.left&&(i.endX=Math.min(i.endX,s)):i.endX=s}}var o=n[n.length-1];o.endX=t[o.line].staffGroup.w}(this.lines,a),a.push({type:"end",milliseconds:d}),this.addUsefulCallbackInfo(a,g),a},this.addUsefulCallbackInfo=function(e,t){for(var n=this.millisecondsPerMeasure(t),r=0;r<e.length;r++){e[r].millisecondsPerMeasure=n}},this.getBpm=function(e){var t;if(e){t=e.bpm;var n=this.getBeatLength();t=t*(e.duration&&e.duration.length>0?e.duration[0]:n)/n}if(!t){t=180;var r=this.getMeterFraction();r&&3!==r.num&&r.num%3==0&&(t=120)}return t},this.setTiming=function(e,t){if(t=t||0,!this.engraver||!this.engraver.staffgroups)return console.log("setTiming cannot be called before the tune is drawn."),void(this.noteTimings=[]);if(!e){var n=this.metaText?this.metaText.tempo:null;e=this.getBpm(n)}var r=this.getBeatLength(),i=e/60,a=this.getBarLength()/r*t/i;a&&(a-=this.getPickupLength()/r/i);var s=r*i;return this.noteTimings=this.setupEvents(a,s,e),this.noteTimings},this.setUpAudio=function(e){e||(e={});var t=a(this,e);return s(t,e)}}},function(e,t){var n=function(e){this.type="TieElem",this.anchor1=e.anchor1,this.anchor2=e.anchor2,e.isGrace&&(this.isGrace=!0),e.fixedY&&(this.fixedY=!0),e.stemDir&&(this.stemDir=e.stemDir),void 0!==e.voiceNumber&&(this.voiceNumber=e.voiceNumber),void 0!==e.style&&(this.dotted=!0),this.internalNotes=[]};n.prototype.addInternalNote=function(e){this.internalNotes.push(e)},n.prototype.setEndAnchor=function(e){this.anchor2=e},n.prototype.setStartX=function(e){this.startLimitX=e},n.prototype.setEndX=function(e){this.endLimitX=e},n.prototype.setHint=function(){this.hint=!0},n.prototype.calcTieDirection=function(){if(this.isGrace)this.above=!1;else if(0===this.voiceNumber)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var e;e=this.anchor1?this.anchor1.pitch:this.anchor2?this.anchor2.pitch:14,this.anchor1&&"down"===this.anchor1.stemDir&&this.anchor2&&"down"===this.anchor2.stemDir?this.above=!0:this.anchor1&&"up"===this.anchor1.stemDir&&this.anchor2&&"up"===this.anchor2.stemDir?this.above=!1:this.anchor1&&this.anchor2?this.above=e>=6:this.anchor1?this.above="down"===this.anchor1.stemDir:this.anchor2?this.above="down"===this.anchor2.stemDir:this.above=e>=6}},n.prototype.calcSlurDirection=function(){if(this.isGrace)this.above=!1;else if(0===this.voiceNumber)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var e=!1;this.anchor1&&"down"===this.anchor1.stemDir&&(e=!0),this.anchor2&&"down"===this.anchor2.stemDir&&(e=!0);for(var t=0;t<this.internalNotes.length;t++){"down"===this.internalNotes[t].stemDir&&(e=!0)}this.above=e}},n.prototype.calcX=function(e,t){this.anchor1?(this.startX=this.anchor1.x,this.anchor1.scalex<1&&(this.startX-=3)):this.startLimitX?this.startX=this.startLimitX.x+this.startLimitX.w:this.startX=e,!this.anchor1&&this.dotted&&(this.startX-=3),this.anchor2?this.endX=this.anchor2.x:this.endLimitX?this.endX=this.endLimitX.x:this.endX=t},n.prototype.calcTieY=function(){this.anchor1?this.startY=this.anchor1.pitch:this.anchor2?this.startY=this.anchor2.pitch:this.startY=this.above?14:0,this.anchor2?this.endY=this.anchor2.pitch:this.anchor1?this.endY=this.anchor1.pitch:this.endY=this.above?14:0},n.prototype.calcSlurY=function(){if(this.anchor1&&this.anchor2){this.above&&"up"===this.anchor1.stemDir&&!this.fixedY?(this.startY=(this.anchor1.highestVert+this.anchor1.pitch)/2,this.startX+=this.anchor1.w/2):this.startY=this.anchor1.pitch;var e=this.anchor2.parent.beam&&this.anchor2.parent.beam.stemsUp&&this.anchor2.parent.beam.elems[0]!==this.anchor2.parent,t=(this.anchor2.highestVert+this.anchor2.pitch)/2;this.above&&"up"===this.anchor2.stemDir&&!this.fixedY&&!e&&t<this.startY?(this.endY=t,this.endX+=Math.round(this.anchor2.w/2)):this.endY=this.above&&e?this.anchor2.highestVert:this.anchor2.pitch}else this.anchor1?this.startY=this.endY=this.anchor1.pitch:this.anchor2?this.startY=this.endY=this.anchor2.pitch:(this.startY=this.above?14:0,this.endY=this.above?14:0)},n.prototype.avoidCollisionAbove=function(){if(this.above){for(var e=-50,t=0;t<this.internalNotes.length;t++)this.internalNotes[t].highestVert>e&&(e=this.internalNotes[t].highestVert);e>this.startY&&e>this.endY&&(this.startY=this.endY=e-1)}},e.exports=n},function(e,t){e.exports=function(e){for(var t=0,n=0;n<e.voices.length;n++){var r=e.voices[n].staff;e.voices[n].duplicate||(t+=r.top,r.bottom<0&&(t+=-r.bottom))}return t}},function(e,t,n){var r=n(8);e.exports=function(e,t){void 0===e&&(e="abcjs-note_selected"),void 0===t&&(t="#ff0000"),r(this.elemset,e,"",t)}},function(e,t,n){var r=n(8);e.exports=function(e,t){void 0===e&&(e="abcjs-note_selected"),void 0===t&&(t="#000000"),r(this.elemset,"",e,t)}},function(e,t,n){var r=n(4),i=n(5),a=n(13);function s(e,t,n){var r=n;return"f"===e&&"f"===t&&(r=2*r/3),"p"===e&&"p"===t&&(r=5*r/6),"f"===e&&"z"===t&&(r=5*r/8),r}e.exports=function(e,t,n,o,c,l,h){var u,d;if(!o)return null;if(o.length>1&&o.indexOf(".")<0){e.paper.openGroup({klass:h});for(var f=0,p=0;p<o.length;p++){var m=o.charAt(p);d=i.getYCorr(m),(u=i.printSymbol(t+f,e.calcY(n+d),m,e.paper,"","",""))?p<o.length-1&&(f+=s(m,o.charAt(p+1),i.getSymbolWidth(m))):r(e,{x:t,y:e.y,text:"no symbol:"+o,type:"debugfont",klass:"debug-msg",anchor:"start"})}return e.paper.closeGroup()}if(d=i.getYCorr(o),a.isInGroup())a.addPath(i.getPathForSymbol(t,e.calcY(n+d),o,c,l));else{if(u=i.printSymbol(t,e.calcY(n+d),o,e.paper,h,"none","#000000"))return u;r(e,{x:t,y:e.y,text:"no symbol:"+o,type:"debugfont",klass:"debug-msg",anchor:"start"})}return null}},function(e,t,n){var r=n(4),i=n(25),a=n(26),s=n(23);e.exports=function(e,t,n,o){void 0===t.pitch&&window.console.error(t.type+" Relative Element y-coordinate not set.");var c=e.calcY(t.pitch);switch(t.type){case"symbol":if(null===t.c)return null;var l="symbol";t.klass&&(l+=" "+t.klass),t.graphelem=s(e,t.x,t.pitch,t.c,t.scalex,t.scaley,e.controller.classes.generate(l),"none","#000000");break;case"debug":t.graphelem=r(e,{x:t.x,y:e.calcY(15),text:""+t.c,type:"debugfont",klass:e.controller.classes.generate("debug-msg"),anchor:"start",centerVertically:!1,dim:t.dim});break;case"barNumber":t.graphelem=r(e,{x:t.x,y:c,text:""+t.c,type:"measurefont",klass:e.controller.classes.generate("bar-number"),anchor:"middle",dim:t.dim});break;case"lyric":t.graphelem=r(e,{x:t.x,y:c,text:t.c,type:"vocalfont",klass:e.controller.classes.generate("lyric"),anchor:"middle",dim:t.dim});break;case"chord":t.graphelem=r(e,{x:t.x,y:c,text:t.c,type:"gchordfont",klass:e.controller.classes.generate("chord"),anchor:"middle",dim:t.dim,lane:t.getLane()});break;case"decoration":t.graphelem=r(e,{x:t.x,y:c+6,text:t.c,type:"annotationfont",klass:e.controller.classes.generate("annotation"),anchor:"middle",centerVertically:!0,dim:t.dim});break;case"text":t.graphelem=r(e,{x:t.x,y:c,text:t.c,type:"annotationfont",klass:e.controller.classes.generate("annotation"),anchor:"start",centerVertically:t.centerVertically,dim:t.dim,lane:t.getLane()});break;case"multimeasure-text":t.graphelem=r(e,{x:t.x+t.w/2,y:c,text:t.c,type:"tempofont",klass:e.controller.classes.generate("rest"),anchor:"middle",centerVertically:!1,dim:t.dim});break;case"part":t.graphelem=r(e,{x:t.x,y:c,text:t.c,type:"partsfont",klass:e.controller.classes.generate("part"),anchor:"start",dim:t.dim});break;case"bar":t.graphelem=i(e,t.x,t.linewidth,c,n||e.calcY(t.pitch2));break;case"stem":t.graphelem=i(e,t.x,t.linewidth,c,e.calcY(t.pitch2));break;case"ledger":t.graphelem=a(e,t.x,t.x+t.w,t.pitch,e.controller.classes.generate("ledger"))}return 1!==t.scalex&&t.graphelem&&function(e,t,n,r,i,a){e.setAttributeOnElement(t,{style:"transform:scale("+n+","+r+");transform-origin:"+i+"px "+a+"px;"})}(e.paper,t.graphelem,t.scalex,t.scaley,t.x,c),t.graphelem}},function(e,t,n){var r=n(13),i=n(3);e.exports=function(e,t,n,a,s){if(n<0||a<s){var o=i(s);s=i(a),a=o}else a=i(a),s=i(s);t=i(t);var c=i(t+n),l=[["M",t,a],["L",t,s],["L",c,s],["L",c,a],["z"]];if(!r.isInGroup()){for(var h="",u=0;u<l.length;u++)h+=l[u].join(" ");return e.paper.pathToBack({path:h,stroke:"none",fill:"#000000",class:e.controller.classes.generate("stem")})}r.addPath(l)}},function(e,t,n){var r=n(7),i=n(3);e.exports=function(e,t,n,a,s){var o=.35,c="#000000",l=e.calcY(a);t=i(t),n=i(n);var h=i(l-o),u=i(l+o),d={path:r("M %f %f L %f %f L %f %f L %f %f z",t,h,n,h,n,u,t,u),stroke:"none",fill:c};return s&&(d.class=s),e.paper.pathToBack(d)}},function(e,t,n){n(28);var r={plugin:n(29)};e.exports=r},function(e,t){},function(e,t,n){var r=n(30),i=n(91),a=new function(){"use strict";try{abcjs_is_user_script}catch(e){}this.show_midi=!0,this.hide_abc=!1,this.render_before=!1,this.midi_options={},this.render_options={},this.render_classname="abcrendered",this.text_classname="abctext",this.auto_render_threshold=20,this.show_text="show score",this.debug=!1};a.start=function(){var e=window.document.body;this.errors="";var t=this.getABCContainingElements(e);if(0!==t.length){if(this.debug)for(var n=0;n<t.length;n++){var r="Possible ABC found ("+(n+1)+" of "+t.length+"):\n\n"+t[n].innerText;alert(r)}var i=t.map(this.convertToDivs,this).reduce((function(e,t){return e.concat(t)}));this.auto_render=i.length<=this.auto_render_threshold,i.forEach((function(e){this.render(e,e.abctext_)}),this)}},a.getABCContainingElements=function(e){for(var t,n=[],r=!1,i=0,a=e.childNodes.length;i<a;++i)3!==(t=e.childNodes[i]).nodeType||r?1===t.nodeType&&"TEXTAREA"!==t.tagName&&(n=n.concat(this.getABCContainingElements(t))):t.nodeValue.match(/^\s*X:/m)&&"TEXTAREA"!==t.parentNode.tagName&&(n.push(e),r=!0);return n},a.convertToDivs=function(e){for(var t,n="",r=null,i=!1,a=[],s=Array.prototype.slice.call(e.childNodes),o=0,c=s.length;o<c;++o)if(3!==(t=s[o]).nodeType||t.nodeValue.match(/^\s*$/))i&&"BR"===t.tagName?(n+="\n",r.appendChild(t)):i&&1===t.nodeType?(n+="\n",r.appendChild(t)):i&&(i=!1,0,n=n.replace(/\n+/,"\n"),r.abctext_=n,a.push(r));else{0;var l=t.nodeValue;l.match(/^\s*X:/m)&&(i=!0,n="",(r=document.createElement("DIV")).className=this.text_classname,t.parentElement.insertBefore(r,t),this.hide_abc&&(r.style.display="none")),i&&(n+=l.replace(/^\n+/,""),r.appendChild(t))}return i&&(n=n.replace(/\n+$/,"\n").replace(/^\n+/,"\n"),r.abctext_=n,a.push(r)),a},a.render=function(e,t){var n=document.createElement("DIV");this.render_before?e.parentElement.insertBefore(n,e):e.nextSibling?e.parentElement.insertBefore(n,e.nextSibling):e.parentElement.appendChild(n);var a=this;try{this.debug&&alert("About to render:\n\n"+t);var s=function(){var e=document.createElement("DIV");if(e.className=a.render_classname,n.appendChild(e),r(e,t,a.render_options),a.show_midi){var s=document.createElement("DIV");n.appendChild(s),i(s,t,a.render_options)}};if(this.auto_render)s();else{var o=document.createElement("A");o.className="abcshow",o.href="#",o.innerHTML=this.show_text,o.onclick=function(){return s(),o.remove(),!1},abcdiv.parentElement.insertBefore(o,abcdiv)}}catch(e){this.errors+=e}};var s=!0;"undefined"!=typeof abcjs_plugin_autostart&&(s=abcjs_plugin_autostart),s&&"undefined"!=typeof window&&void 0!==window.document&&("loading"!==window.document.readyState?a.start():document.addEventListener("DOMContentLoaded",(function(){a.start()}))),e.exports=a},function(e,t,n){var r=n(14),i=n(18),a=n(37),s=n(15),o=n(17),c=n(0),l={};function h(){var e=window.innerWidth;for(var t in l)if(l.hasOwnProperty(t)){var n=l[t];e-=2*n.offsetLeft,n.style.width=e+"px"}}try{window.addEventListener("resize",h),window.addEventListener("orientationChange",h)}catch(e){}function u(e,t,n,r){n.viewportHorizontal?(e.innerHTML='<div class="abcjs-inner"></div>',n.scrollHorizontal?(e.style.overflowX="auto",e.style.overflowY="hidden"):e.style.overflow="hidden",l[e.id]=e,e=e.children[0]):n.viewportVertical?(e.innerHTML='<div class="abcjs-inner scroll-amount"></div>',e.style.overflowX="hidden",e.style.overflowY="auto",e=e.children[0]):e.innerHTML="";var i=new a(e,n);(i.engraveABC(t,r),t.engraver=i,n.viewportVertical||n.viewportHorizontal)&&(e.parentNode.style.width=e.style.width)}function d(e,t,n,r){function a(e){var t=new i;return t.formatting=e.formatting,t.media=e.media,t.version=e.version,t.metaText={},t.lines=[],t}for(var s,o=[],l=0;l<t.lines.length;l++){var h=t.lines[l];s||(s=a(t)),0===l&&(s.metaText.tempo=t.metaText.tempo,s.metaText.title=t.metaText.title,s.metaText.header=t.metaText.header,s.metaText.rhythm=t.metaText.rhythm,s.metaText.origin=t.metaText.origin,s.metaText.composer=t.metaText.composer,s.metaText.author=t.metaText.author,s.metaText.partOrder=t.metaText.partOrder),s.lines.push(h),h.staff&&(o.push(s),s=void 0)}if(s)for(var d=o[o.length-1],f=0;f<s.lines.length;f++)d.lines.push(s.lines[f]);(s=o[o.length-1]).metaText.unalignedWords=t.metaText.unalignedWords,s.metaText.book=t.metaText.book,s.metaText.source=t.metaText.source,s.metaText.discography=t.metaText.discography,s.metaText.notes=t.metaText.notes,s.metaText.transcription=t.metaText.transcription,s.metaText.history=t.metaText.history,s.metaText["abc-copyright"]=t.metaText["abc-copyright"],s.metaText["abc-creator"]=t.metaText["abc-creator"],s.metaText["abc-edited-by"]=t.metaText["abc-edited-by"],s.metaText.footer=t.metaText.footer;var p={};for(var m in n)n.hasOwnProperty(m)&&(p[m]=n[m]);var g=p.paddingtop,v=p.paddingbottom;e.innerHTML="";for(var b=0;b<o.length;b++){var y=document.createElement("div");e.appendChild(y),0===b?(p.paddingtop=g,p.paddingbottom=-20):b===o.length-1?(p.paddingtop=10,p.paddingbottom=v):(p.paddingtop=10,p.paddingbottom=-20),b<o.length-1&&(o[b].formatting=c.clone(o[b].formatting),o[b].formatting.stretchlast=!0),u(y,o[b],p,r),0===b?t.engraver=o[b].engraver:t.engraver.staffgroups?o[b].engraver.staffgroups.length>0&&t.engraver.staffgroups.push(o[b].engraver.staffgroups[0]):t.engraver.staffgroups=o[b].engraver.staffgroups}}e.exports=function(e,t,n,i,c){var l,h={};if(n)for(l in n)n.hasOwnProperty(l)&&(h[l]=n[l]);if(i)for(l in i)i.hasOwnProperty(l)&&("listener"===l?i[l].highlight&&(h.clickListener=i[l].highlight):h[l]=i[l]);if(c)for(l in c)c.hasOwnProperty(l)&&(h[l]=c[l]);return r.renderEngine((function(e,t,n,r){var i=!1;return"*"===e&&(i=!0,(e=document.createElement("div")).setAttribute("style","visibility: hidden;"),document.body.appendChild(e)),h.afterParsing&&h.afterParsing(t,n,r),!i&&h.wrap&&h.staffwidth?t=function(e,t,n,r,i){var c=new a(e,i),l=c.getMeasureWidths(t),h=o.calcLineWraps(t,l,r,i,s,c);!i.oneSvgPerLine||h.tune.lines.length<2?u(e,h.tune,h.revisedParams,n):d(e,h.tune,h.revisedParams,n);return h.tune.explanation=h.explanation,h.tune}(e,t,n,r,h):(i||!h.oneSvgPerLine||t.lines.length<2?u(e,t,h,n):d(e,t,h,n),i&&e.parentNode.removeChild(e),null)}),e,t,h)}},function(e,t,n){var r=n(0),i=n(10),a=n(11);e.exports=function(e,t,n,s,o){this.reset=function(e,t,n,r){a.initialize(e,t,n,r,o),i.initialize(e,t,n,r,o)},this.reset(e,t,n,s),this.setTitle=function(t){if(n.hasMainTitle)o.addSubtitle(e.translateString(e.stripComment(t)));else{var r=e.translateString(e.theReverser(e.stripComment(t)));n.titlecaps&&(r=r.toUpperCase()),o.addMetaText("title",r),n.hasMainTitle=!0}},this.setMeter=function(r){if("C"===(r=e.stripComment(r)))return!0===n.havent_set_length&&(n.default_length=.125,n.havent_set_length=!1),{type:"common_time"};if("C|"===r)return!0===n.havent_set_length&&(n.default_length=.125,n.havent_set_length=!1),{type:"cut_time"};if("o"===r)return!0===n.havent_set_length&&(n.default_length=.125,n.havent_set_length=!1),{type:"tempus_perfectum"};if("c"===r)return!0===n.havent_set_length&&(n.default_length=.125,n.havent_set_length=!1),{type:"tempus_imperfectum"};if("o."===r)return!0===n.havent_set_length&&(n.default_length=.125,n.havent_set_length=!1),{type:"tempus_perfectum_prolatio"};if("c."===r)return!0===n.havent_set_length&&(n.default_length=.125,n.havent_set_length=!1),{type:"tempus_imperfectum_prolatio"};if(0===r.length||"none"===r.toLowerCase())return!0===n.havent_set_length&&(n.default_length=.125,n.havent_set_length=!1),null;var i=e.tokenize(r,0,r.length);try{var a=function(){var e=function(){var e={value:0,num:""},t=i.shift();for("("===t.token&&(t=i.shift());;){if("number"!==t.type)throw"Expected top number of meter";if(e.value+=parseInt(t.token),e.num+=t.token,0===i.length||"/"===i[0].token)return e;if(")"===(t=i.shift()).token){if(0===i.length||"/"===i[0].token)return e;throw"Unexpected paren in meter"}if("."!==t.token&&"+"!==t.token)throw"Expected top number of meter";if(e.num+=t.token,0===i.length)throw"Expected top number of meter";t=i.shift()}return e}();if(0===i.length)return e;var t=i.shift();if("/"!==t.token)throw"Expected slash in meter";if("number"!==(t=i.shift()).type)throw"Expected bottom number of meter";return e.den=t.token,e.value=e.value/parseInt(e.den),e};if(0===i.length)throw"Expected meter definition in M: line";for(var s={type:"specified",value:[]},o=0;;){var c=a();o+=c.value;var l={num:c.num};if(void 0!==c.den&&(l.den=c.den),s.value.push(l),0===i.length)break}return!0===n.havent_set_length&&(n.default_length=o<.75?.0625:.125,n.havent_set_length=!1),s}catch(e){t(e,r,0)}return null},this.calcTempo=function(e){var t=1/4;n.meter&&"specified"===n.meter.type?t=1/parseInt(n.meter.value[0].den):n.origMeter&&"specified"===n.origMeter.type&&(t=1/parseInt(n.origMeter.value[0].den));for(var r=0;r<e.duration;r++)e.duration[r]=t*e.duration[r];return e},this.resolveTempo=function(){n.tempo&&(this.calcTempo(n.tempo),s.metaText.tempo=n.tempo,delete n.tempo)},this.addUserDefinition=function(e,i,a){var s=e.indexOf("=",i);if(-1!==s){var o=r.strip(e.substring(i,s)),c=r.strip(e.substring(s+1));if(1===o.length){-1!=="HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw~".indexOf(o)?0!==c.length?(void 0===n.macros&&(n.macros={}),n.macros[o]=c):t("Missing macro definition",e,i):t("Macro definitions must be H-Y, h-w, or tilde",e,i)}else t("Macro definitions can only be one character",e,i)}else t("Need an = in a macro definition",e,i)},this.setDefaultLength=function(e,t,i){var a=r.gsub(e.substring(t,i)," ","").split("/");if(2===a.length){var s=parseInt(a[0]),o=parseInt(a[1]);o>0&&(n.default_length=s/o,n.havent_set_length=!1)}else 1===a.length&&"1"===a[0]&&(n.default_length=1,n.havent_set_length=!1)};var c={larghissimo:20,adagissimo:24,sostenuto:28,grave:32,largo:40,lento:50,larghetto:60,adagio:68,adagietto:74,andante:80,andantino:88,"marcia moderato":84,"andante moderato":100,moderato:112,allegretto:116,"allegro moderato":120,allegro:126,animato:132,agitato:140,veloce:148,"mosso vivo":156,vivace:164,vivacissimo:172,allegrissimo:176,presto:184,prestissimo:210};this.setTempo=function(r,i,a){try{var s=e.tokenize(r,i,a);if(0===s.length)throw"Missing parameter in Q: field";var o={},l=!0,h=s.shift();if("quote"===h.type&&(o.preString=h.token,h=s.shift(),0===s.length))return c[o.preString.toLowerCase()]&&(o.bpm=c[o.preString.toLowerCase()],o.suppressBpm=!0),{type:"immediate",tempo:o};if("alpha"===h.type&&"C"===h.token){if(0===s.length)throw"Missing tempo after C in Q: field";if("punct"===(h=s.shift()).type&&"="===h.token){if(0===s.length)throw"Missing tempo after = in Q: field";if("number"!==(h=s.shift()).type)throw"Expected number after = in Q: field";o.duration=[1],o.bpm=parseInt(h.token)}else{if("number"!==h.type)throw"Expected number or equal after C in Q: field";if(o.duration=[parseInt(h.token)],0===s.length)throw"Missing = after duration in Q: field";if("punct"!==(h=s.shift()).type||"="!==h.token)throw"Expected = after duration in Q: field";if(0===s.length)throw"Missing tempo after = in Q: field";if("number"!==(h=s.shift()).type)throw"Expected number after = in Q: field";o.bpm=parseInt(h.token)}}else{if("number"!==h.type)throw"Unknown value in Q: field";var u=parseInt(h.token);if(0===s.length||"quote"===s[0].type)o.duration=[1],o.bpm=u;else{if(l=!1,"punct"!==(h=s.shift()).type&&"/"!==h.token)throw"Expected fraction in Q: field";if("number"!==(h=s.shift()).type)throw"Expected fraction in Q: field";var d=parseInt(h.token);for(o.duration=[u/d];s.length>0&&"="!==s[0].token&&"quote"!==s[0].type;){if("number"!==(h=s.shift()).type)throw"Expected fraction in Q: field";if(u=parseInt(h.token),"punct"!==(h=s.shift()).type&&"/"!==h.token)throw"Expected fraction in Q: field";if("number"!==(h=s.shift()).type)throw"Expected fraction in Q: field";d=parseInt(h.token),o.duration.push(u/d)}if("punct"!==(h=s.shift()).type&&"="!==h.token)throw"Expected = in Q: field";if("number"!==(h=s.shift()).type)throw"Expected tempo in Q: field";o.bpm=parseInt(h.token)}}if(0!==s.length&&("quote"===(h=s.shift()).type&&(o.postString=h.token,h=s.shift()),0!==s.length))throw"Unexpected string at end of Q: field";return!1===n.printTempo&&(o.suppress=!0),{type:l?"delaySet":"immediate",tempo:o}}catch(e){return t(e,r,i),{type:"none"}}},this.letter_to_inline_header=function(r,c){var l=e.eatWhiteSpace(r,c);if(c+=l,r.length>=c+5&&"["===r.charAt(c)&&":"===r.charAt(c+2)){var h=r.indexOf("]",c),u=n.iChar+c,d=n.iChar+h+1;switch(r.substring(c,c+3)){case"[I:":var f=i.addDirective(r.substring(c+3,h));return f&&t(f,r,c),[h-c+1+l];case"[M:":var p=this.setMeter(r.substring(c+3,h));return o.hasBeginMusic()&&p?o.appendStartingElement("meter",u,d,p):n.meter=p,[h-c+1+l];case"[K:":var m=a.parseKey(r.substring(c+3,h));return m.foundClef&&o.hasBeginMusic()&&o.appendStartingElement("clef",u,d,n.clef),m.foundKey&&o.hasBeginMusic()&&o.appendStartingElement("key",u,d,a.fixKey(n.clef,n.key)),[h-c+1+l];case"[P:":return s.lines.length<=s.lineNum?n.partForNextLine={title:r.substring(c+3,h),startChar:u,endChar:d}:o.appendElement("part",u,d,{title:r.substring(c+3,h)}),[h-c+1+l];case"[L:":return this.setDefaultLength(r,c+3,h),[h-c+1+l];case"[Q:":if(h>0){var g=this.setTempo(r,c+3,h);return"delaySet"===g.type?o.hasBeginMusic()?o.appendElement("tempo",u,d,this.calcTempo(g.tempo)):n.tempoForNextLine=["tempo",u,d,this.calcTempo(g.tempo)]:"immediate"===g.type&&(o.hasBeginMusic()?o.appendElement("tempo",u,d,g.tempo):n.tempoForNextLine=["tempo",u,d,g.tempo]),[h-c+1+l,r.charAt(c+1),r.substring(c+3,h)]}break;case"[V:":if(h>0)return a.parseVoice(r,c+3,h),[h-c+1+l,r.charAt(c+1),r.substring(c+3,h)]}}return[0]},this.letter_to_body_header=function(e,s){if(e.length>=s+3)switch(e.substring(s,s+2)){case"I:":var c=i.addDirective(e.substring(s+2));return c&&t(c,e,s),[e.length];case"M:":var l=this.setMeter(e.substring(s+2));return o.hasBeginMusic()&&l&&o.appendStartingElement("meter",n.iChar+s,n.iChar+e.length,l),[e.length];case"K:":var h=a.parseKey(e.substring(s+2));return h.foundClef&&o.hasBeginMusic()&&o.appendStartingElement("clef",n.iChar+s,n.iChar+e.length,n.clef),h.foundKey&&o.hasBeginMusic()&&o.appendStartingElement("key",n.iChar+s,n.iChar+e.length,a.fixKey(n.clef,n.key)),[e.length];case"P:":return o.hasBeginMusic()&&o.appendElement("part",n.iChar+s,n.iChar+e.length,{title:e.substring(s+2)}),[e.length];case"L:":return this.setDefaultLength(e,s+2,e.length),[e.length];case"Q:":var u=e.indexOf("",s+2);-1===u&&(u=e.length);var d=this.setTempo(e,s+2,u);return"delaySet"===d.type?o.appendElement("tempo",n.iChar+s,n.iChar+e.length,this.calcTempo(d.tempo)):"immediate"===d.type&&o.appendElement("tempo",n.iChar+s,n.iChar+e.length,d.tempo),[u,e.charAt(s),r.strip(e.substring(s+2))];case"V:":return a.parseVoice(e,s+2,e.length),[e.length,e.charAt(s),r.strip(e.substring(s+2))]}return[0]};var l={A:"author",B:"book",C:"composer",D:"discography",F:"url",G:"group",I:"instruction",N:"notes",O:"origin",R:"rhythm",S:"source",W:"unalignedWords",Z:"transcription"};this.parseHeader=function(c){if(r.startsWith(c,"%%")){var h=i.addDirective(c.substring(2));return h&&t(h,c,2),{}}var u=c.indexOf("%");if(u>=0&&(c=c.substring(0,u)),0===(c=c.replace(/\s+$/,"")).length)return{};if(c.length>=2&&":"===c.charAt(1)){var d="";c.indexOf("")>=0&&"w"!==c.charAt(0)&&(d=c.substring(c.indexOf("")+1),c=c.substring(0,c.indexOf("")));var f=l[c.charAt(0)];if(void 0!==f)return"unalignedWords"===f?o.addMetaTextArray(f,i.parseFontChangeLine(e.translateString(e.stripComment(c.substring(2))))):o.addMetaText(f,e.translateString(e.stripComment(c.substring(2)))),{};var p=n.iChar,m=p+c.length;switch(c.charAt(0)){case"H":o.addMetaText("history",e.translateString(e.stripComment(c.substring(2)))),n.is_in_history=!0;break;case"K":this.resolveTempo();var g=a.parseKey(c.substring(2));!n.is_in_header&&o.hasBeginMusic()&&(g.foundClef&&o.appendStartingElement("clef",p,m,n.clef),g.foundKey&&o.appendStartingElement("key",p,m,a.fixKey(n.clef,n.key))),n.is_in_header=!1;break;case"L":this.setDefaultLength(c,2,c.length);break;case"M":n.origMeter=n.meter=this.setMeter(c.substring(2));break;case"P":n.is_in_header?o.addMetaText("partOrder",e.translateString(e.stripComment(c.substring(2)))):n.partForNextLine={title:e.translateString(e.stripComment(c.substring(2))),startChar:p,endChar:m};break;case"Q":var v=this.setTempo(c,2,c.length);"delaySet"===v.type?n.tempo=v.tempo:"immediate"===v.type&&(s.metaText.tempo=v.tempo);break;case"T":this.setTitle(c.substring(2));break;case"U":this.addUserDefinition(c,2,c.length);break;case"V":if(a.parseVoice(c,2,c.length),!n.is_in_header)return{newline:!0};break;case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":t("Ignored header",c,0);break;default:return d.length&&(d=""+d),{regular:!0,str:c+d}}return d.length>0?{recurse:!0,str:d}:{}}return{regular:!0,str:c}}}},function(e,t,n){var r=n(0);e.exports=function(){this.skipWhiteSpace=function(e){for(var t=0;t<e.length;t++)if(!this.isWhiteSpace(e.charAt(t)))return t;return e.length};var e=function(e,t){return t>=e.length};this.eatWhiteSpace=function(e,t){for(var n=t;n<e.length;n++)if(!this.isWhiteSpace(e.charAt(n)))return n-t;return n-t},this.getKeyPitch=function(t){var n=this.skipWhiteSpace(t);if(e(t,n))return{len:0};switch(t.charAt(n)){case"A":return{len:n+1,token:"A"};case"B":return{len:n+1,token:"B"};case"C":return{len:n+1,token:"C"};case"D":return{len:n+1,token:"D"};case"E":return{len:n+1,token:"E"};case"F":return{len:n+1,token:"F"};case"G":return{len:n+1,token:"G"}}return{len:0}},this.getSharpFlat=function(e){if("bass"===e)return{len:0};switch(e.charAt(0)){case"#":return{len:1,token:"#"};case"b":return{len:1,token:"b"}}return{len:0}},this.getMode=function(t){var n=function(e,t){for(;t<e.length&&(e.charAt(t)>="a"&&e.charAt(t)<="z"||e.charAt(t)>="A"&&e.charAt(t)<="Z");)t++;return t},r=this.skipWhiteSpace(t);if(e(t,r))return{len:0};var i=t.substring(r,r+3).toLowerCase();switch((i.length>1&&" "===i.charAt(1)||"^"===i.charAt(1)||"_"===i.charAt(1)||"="===i.charAt(1))&&(i=i.charAt(0)),i){case"mix":return{len:n(t,r),token:"Mix"};case"dor":return{len:n(t,r),token:"Dor"};case"phr":return{len:n(t,r),token:"Phr"};case"lyd":return{len:n(t,r),token:"Lyd"};case"loc":return{len:n(t,r),token:"Loc"};case"aeo":return{len:n(t,r),token:"m"};case"maj":case"ion":return{len:n(t,r),token:""};case"min":case"m":return{len:n(t,r),token:"m"}}return{len:0}},this.getClef=function(t,n){var i=t,a=this.skipWhiteSpace(t);if(e(t,a))return{len:0};var s=!1,o=t.substring(a);if(r.startsWith(o,"clef=")&&(s=!0,o=o.substring(5),a+=5),0===o.length&&s)return{len:a+5,warn:"No clef specified: "+i};var c=this.skipWhiteSpace(o);if(e(o,c))return{len:0};c>0&&(a+=c,o=o.substring(c));var l=null;if(r.startsWith(o,"treble"))l="treble";else if(r.startsWith(o,"bass3"))l="bass3";else if(r.startsWith(o,"bass"))l="bass";else if(r.startsWith(o,"tenor"))l="tenor";else if(r.startsWith(o,"alto2"))l="alto2";else if(r.startsWith(o,"alto1"))l="alto1";else if(r.startsWith(o,"alto"))l="alto";else if(!n&&s&&r.startsWith(o,"none"))l="none";else if(r.startsWith(o,"perc"))l="perc";else if(!n&&s&&r.startsWith(o,"C"))l="tenor";else if(!n&&s&&r.startsWith(o,"F"))l="bass";else{if(n||!s||!r.startsWith(o,"G"))return{len:a+5,warn:"Unknown clef specified: "+i};l="treble"}return o=o.substring(l.length),(c=this.isMatch(o,"+8"))>0?l+="+8":(c=this.isMatch(o,"-8"))>0&&(l+="-8"),{len:a+l.length,token:l,explicit:s}},this.getBarLine=function(e,t){switch(e.charAt(t)){case"]":switch(++t,e.charAt(t)){case"|":return{len:2,token:"bar_thick_thin"};case"[":return++t,e.charAt(t)>="1"&&e.charAt(t)<="9"||'"'===e.charAt(t)?{len:2,token:"bar_invisible"}:{len:1,warn:"Unknown bar symbol"};default:return{len:1,token:"bar_invisible"}}break;case":":switch(++t,e.charAt(t)){case":":return{len:2,token:"bar_dbl_repeat"};case"|":switch(++t,e.charAt(t)){case"]":switch(++t,e.charAt(t)){case"|":return++t,":"===e.charAt(t)?{len:5,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:3,token:"bar_right_repeat"}}break;case"|":return++t,":"===e.charAt(t)?{len:4,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:2,token:"bar_right_repeat"}}break;default:return{len:1,warn:"Unknown bar symbol"}}break;case"[":if(++t,"|"!==e.charAt(t))return e.charAt(t)>="1"&&e.charAt(t)<="9"||'"'===e.charAt(t)?{len:1,token:"bar_invisible"}:{len:0};switch(++t,e.charAt(t)){case":":return{len:3,token:"bar_left_repeat"};case"]":return{len:3,token:"bar_invisible"};default:return{len:2,token:"bar_thick_thin"}}break;case"|":switch(++t,e.charAt(t)){case"]":return{len:2,token:"bar_thin_thick"};case"|":return++t,":"===e.charAt(t)?{len:3,token:"bar_left_repeat"}:{len:2,token:"bar_thin_thin"};case":":for(var n=0;":"===e.charAt(t+n);)n++;return{len:1+n,token:"bar_left_repeat"};default:return{len:1,token:"bar_thin"}}}return{len:0}},this.getTokenOf=function(e,t){for(var n=0;n<e.length;n++)if(t.indexOf(e.charAt(n))<0)return{len:n,token:e.substring(0,n)};return{len:n,token:e}},this.getToken=function(e,t,n){for(var r=t;r<n&&!this.isWhiteSpace(e.charAt(r));)r++;return e.substring(t,r)},this.isMatch=function(t,n){var i=this.skipWhiteSpace(t);return e(t,i)?0:r.startsWith(t.substring(i),n)?i+n.length:0},this.getPitchFromTokens=function(e){var t={};if(t.position={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11}[e[0].token],void 0===t.position)return{warn:"Pitch expected. Found: "+e[0].token};for(e.shift();e.length;)switch(e[0].token){case",":t.position-=7,e.shift();break;case"'":t.position+=7,e.shift();break;default:return t}return t},this.getKeyAccidentals2=function(e){for(var t;e.length>0;){var n;if("^"===e[0].token){if(n="sharp",e.shift(),0===e.length)return{accs:t,warn:"Expected note name after "+n};switch(e[0].token){case"^":n="dblsharp",e.shift();break;case"/":n="quartersharp",e.shift()}}else if("="===e[0].token)n="natural",e.shift();else{if("_"!==e[0].token)return{accs:t};if(n="flat",e.shift(),0===e.length)return{accs:t,warn:"Expected note name after "+n};switch(e[0].token){case"_":n="dblflat",e.shift();break;case"/":n="quarterflat",e.shift()}}if(0===e.length)return{accs:t,warn:"Expected note name after "+n};switch(e[0].token.charAt(0)){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":void 0===t&&(t=[]),t.push({acc:n,note:e[0].token.charAt(0)}),1===e[0].token.length?e.shift():e[0].token=e[0].token.substring(1);break;default:return{accs:t,warn:"Expected note name after "+n+" Found: "+e[0].token}}}return{accs:t}},this.getKeyAccidental=function(t){var n={"^":"sharp","^^":"dblsharp","=":"natural",_:"flat",__:"dblflat","_/":"quarterflat","^/":"quartersharp"},r=this.skipWhiteSpace(t);if(e(t,r))return{len:0};var i=null;switch(t.charAt(r)){case"^":case"_":case"=":i=t.charAt(r);break;default:return{len:0}}if(r++,e(t,r))return{len:1,warn:"Expected note name after accidental"};switch(t.charAt(r)){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:r+1,token:{acc:n[i],note:t.charAt(r)}};case"^":case"_":case"/":if(i+=t.charAt(r),r++,e(t,r))return{len:2,warn:"Expected note name after accidental"};switch(t.charAt(r)){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:r+1,token:{acc:n[i],note:t.charAt(r)}};default:return{len:2,warn:"Expected note name after accidental"}}break;default:return{len:1,warn:"Expected note name after accidental"}}},this.isWhiteSpace=function(e){return" "===e||"\t"===e||""===e},this.getMeat=function(e,t,n){var r=e.indexOf("%",t);for(r>=0&&r<n&&(n=r);t<n&&(" "===e.charAt(t)||"\t"===e.charAt(t)||""===e.charAt(t));)t++;for(;t<n&&(" "===e.charAt(n-1)||"\t"===e.charAt(n-1)||""===e.charAt(n-1));)n--;return{start:t,end:n}};var t=function(e){return e>="A"&&e<="Z"||e>="a"&&e<="z"},n=function(e){return e>="0"&&e<="9"};this.tokenize=function(e,r,i,a){var s=this.getMeat(e,r,i);r=s.start,i=s.end;for(var o,c=[];r<i;){if('"'===e.charAt(r)){for(o=r+1;o<i&&'"'!==e.charAt(o);)o++;c.push({type:"quote",token:e.substring(r+1,o),start:r+1,end:o}),o++}else if(t(e.charAt(r))){if(o=r+1,a)for(;o<i&&!this.isWhiteSpace(e.charAt(o));)o++;else for(;o<i&&t(e.charAt(o));)o++;c.push({type:"alpha",token:e.substring(r,o),continueId:n(e.charAt(o)),start:r,end:o}),r=o+1}else if("."===e.charAt(r)&&n(e.charAt(o+1))){o=r+1;for(var l;o<i&&n(e.charAt(o));)o++;l=parseFloat(e.substring(r,o)),c.push({type:"number",token:e.substring(r,o),intt:null,floatt:l,continueId:t(e.charAt(o)),start:r,end:o}),r=o+1}else if(n(e.charAt(r))||"-"===e.charAt(r)&&n(e.charAt(o+1))){o=r+1;for(var h,u=null;o<i&&n(e.charAt(o));)o++;if("."===e.charAt(o)&&n(e.charAt(o+1)))for(o++;o<i&&n(e.charAt(o));)o++;else u=parseInt(e.substring(r,o));h=parseFloat(e.substring(r,o)),c.push({type:"number",token:e.substring(r,o),intt:u,floatt:h,continueId:t(e.charAt(o)),start:r,end:o}),r=o+1}else" "===e.charAt(r)||"\t"===e.charAt(r)||c.push({type:"punct",token:e.charAt(r),start:r,end:r+1}),o=r+1;r=o}return c},this.getVoiceToken=function(e,t,n){for(var r=t;r<n&&this.isWhiteSpace(e.charAt(r))||"="===e.charAt(r);)r++;if('"'===e.charAt(r)){var i=e.indexOf('"',r+1);return-1===i||i>=n?{len:1,err:"Missing close quote"}:{len:i-t+1,token:this.translateString(e.substring(r+1,i))}}for(var a=r;a<n&&!this.isWhiteSpace(e.charAt(a))&&"="!==e.charAt(a);)a++;return{len:a-t+1,token:e.substring(r,a)}};var i={"`a":"à","'a":"á","^a":"â","~a":"ã",'"a':"ä",oa:"å",aa:"å","=a":"ā",ua:"ă",";a":"ą","`e":"è","'e":"é","^e":"ê",'"e':"ë","=e":"ē",ue:"ĕ",";e":"ę",".e":"ė","`i":"ì","'i":"í","^i":"î",'"i':"ï","=i":"ī",ui:"ĭ",";i":"į","`o":"ò","'o":"ó","^o":"ô","~o":"õ",'"o':"ö","=o":"ō",uo:"ŏ","/o":"ø","`u":"ù","'u":"ú","^u":"û","~u":"ũ",'"u':"ü",ou:"ů","=u":"ū",uu:"ŭ",";u":"ų","`A":"À","'A":"Á","^A":"Â","~A":"Ã",'"A':"Ä",oA:"Å",AA:"Å","=A":"Ā",uA:"Ă",";A":"Ą","`E":"È","'E":"É","^E":"Ê",'"E':"Ë","=E":"Ē",uE:"Ĕ",";E":"Ę",".E":"Ė","`I":"Ì","'I":"Í","^I":"Î","~I":"Ĩ",'"I':"Ï","=I":"Ī",uI:"Ĭ",";I":"Į",".I":"İ","`O":"Ò","'O":"Ó","^O":"Ô","~O":"Õ",'"O':"Ö","=O":"Ō",uO:"Ŏ","/O":"Ø","`U":"Ù","'U":"Ú","^U":"Û","~U":"Ũ",'"U':"Ü",oU:"Ů","=U":"Ū",uU:"Ŭ",";U":"Ų",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",ss:"ß","'c":"ć","^c":"ĉ",uc:"č",cc:"ç",".c":"ċ",cC:"Ç","'C":"Ć","^C":"Ĉ",uC:"Č",".C":"Ċ","~N":"Ñ","~n":"ñ","=s":"š",vs:"š",DH:"Ð",dh:"ð",HO:"Ő",Ho:"ő",HU:"Ű",Hu:"ű","'Y":"Ý","'y":"ý","^Y":"Ŷ","^y":"ŷ",'"Y':"Ÿ",'"y':"ÿ",vS:"Š",vZ:"Ž",vz:"ž"},a={"#":"♯",b:"♭","=":"♮"},s={201:"♯",202:"♭",203:"♮",241:"¡",242:"¢",252:"a",262:"2",272:"o",302:"Â",312:"Ê",322:"Ò",332:"Ú",342:"â",352:"ê",362:"ò",372:"ú",243:"£",253:"«",263:"3",273:"»",303:"Ã",313:"Ë",323:"Ó",333:"Û",343:"ã",353:"ë",363:"ó",373:"û",244:"¤",254:"¬",264:" ́",274:"1⁄4",304:"Ä",314:"Ì",324:"Ô",334:"Ü",344:"ä",354:"ì",364:"ô",374:"ü",245:"¥",255:"-",265:"μ",275:"1⁄2",305:"Å",315:"Í",325:"Õ",335:"Ý",345:"å",355:"í",365:"õ",375:"ý",246:"¦",256:"®",266:"¶",276:"3⁄4",306:"Æ",316:"Î",326:"Ö",336:"Þ",346:"æ",356:"î",366:"ö",376:"þ",247:"§",257:" ̄",267:"·",277:"¿",307:"Ç",317:"Ï",327:"×",337:"ß",347:"ç",357:"ï",367:"÷",377:"ÿ",250:" ̈",260:"°",270:" ̧",300:"À",310:"È",320:"Ð",330:"Ø",340:"à",350:"è",360:"ð",370:"ø",251:"©",261:"±",271:"1",301:"Á",311:"É",321:"Ñ",331:"Ù",341:"á",351:"é",361:"ñ",371:"ù"};this.translateString=function(e){var t=e.split("\\");if(1===t.length)return e;var n=null;return r.each(t,(function(e){if(null===n)n=e;else{var t=i[e.substring(0,2)];void 0!==t?n+=t+e.substring(2):void 0!==(t=s[e.substring(0,3)])?n+=t+e.substring(3):(t=a[e.substring(0,1)],n+=void 0!==t?t+e.substring(1):"\\"+e)}})),n},this.getNumber=function(e,t){for(var n=0;t<e.length;)switch(e.charAt(t)){case"0":n*=10,t++;break;case"1":n=10*n+1,t++;break;case"2":n=10*n+2,t++;break;case"3":n=10*n+3,t++;break;case"4":n=10*n+4,t++;break;case"5":n=10*n+5,t++;break;case"6":n=10*n+6,t++;break;case"7":n=10*n+7,t++;break;case"8":n=10*n+8,t++;break;case"9":n=10*n+9,t++;break;default:return{num:n,index:t}}return{num:n,index:t}},this.getFraction=function(e,t){var n=1,r=1;if("/"!==e.charAt(t)){var i=this.getNumber(e,t);n=i.num,t=i.index}if("/"===e.charAt(t)){if(t++,"/"===e.charAt(t)){for(var a=.5;"/"===e.charAt(t++);)a/=2;return{value:n*a,index:t-1}}var s=t,o=this.getNumber(e,t);0===o.num&&s===t&&(o.num=2),0!==o.num&&(r=o.num),t=o.index}return{value:n/r,index:t}},this.theReverser=function(e){return r.endsWith(e,", The")?"The "+e.substring(0,e.length-5):r.endsWith(e,", A")?"A "+e.substring(0,e.length-3):e},this.stripComment=function(e){var t=e.indexOf("%");return t>=0?r.strip(e.substring(0,t)):r.strip(e)},this.getInt=function(e){var t=parseInt(e);if(isNaN(t))return{digits:0};var n=""+t;return{value:t,digits:e.indexOf(n)+n.length}},this.getFloat=function(e){var t=parseFloat(e);if(isNaN(t))return{digits:0};var n=""+t;return{value:t,digits:e.indexOf(n)+n.length}},this.getMeasurement=function(e){if(0===e.length)return{used:0};var t=1,n="";if("-"===e[0].token)e.shift(),n="-",t++;else if("number"!==e[0].type)return{used:0};if(n+=e.shift().token,0===e.length)return{used:1,value:parseInt(n)};var r=e.shift();if("."===r.token){if(t++,0===e.length)return{used:t,value:parseInt(n)};if("number"===e[0].type&&(n=n+"."+(r=e.shift()).token,t++,0===e.length))return{used:t,value:parseFloat(n)};r=e.shift()}switch(r.token){case"pt":return{used:t+1,value:parseFloat(n)};case"cm":return{used:t+1,value:parseFloat(n)/2.54*72};case"in":return{used:t+1,value:72*parseFloat(n)};default:return e.unshift(r),{used:t,value:parseFloat(n)}}return{used:0}};var o=function(e){for(;-1!==e.indexOf("\\n");)e=e.replace("\\n","\n");return e};this.getBrackettedSubstring=function(e,t,n,r){for(var i=r||e.charAt(t),a=t+1;a<e.length&&e.charAt(a)!==i;)++a;return e.charAt(a)===i?[a-t+1,o(e.substring(t+1,a)),!0]:((a=t+n)>e.length-1&&(a=e.length-1),[a-t+1,o(e.substring(t+1,a)),!1])}}},function(e,t,n){var r,i=n(0);!function(){"use strict";var e;function t(e,t,n){for(var r=0,i=t+1;i<e.length;i++)if("note"===e[i].el_type&&r++,e[i].decoration&&e[i].decoration.indexOf(n)>=0)return r;return r}function n(e,t,n){for(var r=Math.min(e.length,t+3),i=t;i<r;i++)if("note"===e[i].el_type&&e[i].decoration)for(var a=0;a<e[i].decoration.length;a++)if(n.indexOf(e[i].decoration[a])>=0)return e[i].decoration[a];return null}function a(e){for(var t=0;t<e.length;t++)for(var n=e[t],r=n.length-1;r>=0&&"bar"!==n[r].el_type;)n[r].noChordVoice=!0,r--}function s(e,t){if(e&&!(e.length<=t)&&e[t].title)return e[t].title.join(" ")}function o(e,t){var n=1/4;e.duration&&(n=e.duration[0]);var r=60;return e.bpm&&(r=e.bpm),n*r/t}function c(t){var n;switch(t.type){case"common_time":n={el_type:"meter",num:4,den:4};break;case"cut_time":n={el_type:"meter",num:2,den:2};break;case"specified":n={el_type:"meter",num:t.value[0].num,den:t.value[0].den};break;default:n={el_type:"meter"}}return e=n.num/n.den,n}r=function(r,l){var h,u=(l=l||{}).program||0,d=l.midiTranspose||0;r.visualTranspose&&(d-=r.visualTranspose);var f=l.channel||0,p=!1,m=l.drum||"",g=l.drumBars||1,v=l.drumIntro||0,b=""!==m,y=[];u=parseInt(u,10),d=parseInt(d,10),10===(f=parseInt(f,10))&&(u=128),m=m.split(" "),g=parseInt(g,10),v=parseInt(v,10);var w=r.formatting.bagpipes;w&&(u=71);var x=[];if(r.formatting.midi){var k=r.formatting.midi;k.program&&k.program.length>0&&(u=k.program[0],k.program.length>1&&(u=k.program[1],f=k.program[0]),p=!0),k.transpose&&(d=k.transpose[0]),k.channel&&(f=k.channel[0],p=!0),k.drum&&(m=k.drum),k.drumbars&&(g=k.drumbars[0]),k.drumon&&(b=!0),10===f&&(u=128),k.beat&&x.push({el_type:"beat",beats:k.beat}),k.nobeataccents&&x.push({el_type:"beataccents",value:!1})}h=l.qpm?parseInt(l.qpm,10):r.metaText.tempo?o(r.metaText.tempo,r.getBeatLength()):l.defaultQpm?l.defaultQpm:180;var A=[];w&&A.push({el_type:"bagpipes"}),A.push({el_type:"instrument",program:u}),f&&A.push({el_type:"channel",channel:f}),d&&A.push({el_type:"transpose",transpose:d}),A.push({el_type:"tempo",qpm:h});for(var T=0;T<x.length;T++)A.push(x[T]);for(var S,M=[],N=[],C=[],E=[0],I={},_=[],B=[],P=!1,D=0;D<r.lines.length;D++){var L=r.lines[D];if(L.staff)for(var O=function(e){var r,i={pppp:[15,10,5,1],ppp:[30,20,10,1],pp:[45,35,20,1],p:[60,50,35,1],mp:[75,65,50,1],mf:[90,80,65,1],f:[105,95,80,1],ff:[120,110,95,1],fff:[127,125,110,1],ffff:[127,125,110,1]};if(e.decoration)if(e.decoration.indexOf("pppp")>=0?r="pppp":e.decoration.indexOf("ppp")>=0?r="ppp":e.decoration.indexOf("pp")>=0?r="pp":e.decoration.indexOf("p")>=0?r="p":e.decoration.indexOf("mp")>=0?r="mp":e.decoration.indexOf("mf")>=0?r="mf":e.decoration.indexOf("f")>=0?r="f":e.decoration.indexOf("ff")>=0?r="ff":e.decoration.indexOf("fff")>=0?r="fff":e.decoration.indexOf("ffff")>=0&&(r="ffff"),r&&(S=i[r].slice(0),M[V].push({el_type:"beat",beats:S.slice(0)}),N[j]=!1,C[j]=!1),e.decoration.indexOf("crescendo(")>=0){var a=t(q,K,"crescendo)"),s=Math.min(127,S[0]+50),o=n(q,K+a+1,Object.keys(i));o&&(s=i[o][0]),N[j]=a>0&&Math.floor((s-S[0])/a),C[j]=!1}else if(e.decoration.indexOf("crescendo)")>=0)N[j]=!1;else if(e.decoration.indexOf("diminuendo(")>=0){var c=t(q,K,"diminuendo)"),l=Math.max(15,S[0]-50),h=n(q,K+c+1,Object.keys(i));h&&(l=i[h][0]),N[j]=!1,C[j]=c>0&&Math.floor((l-S[0])/c)}else e.decoration.indexOf("diminuendo)")>=0&&(C[j]=!1)},H=L.staff,V=0,F=0;F<H.length;F++)for(var z=H[F],j=0;j<z.voices.length;j++){var q=z.voices[j];if(!M[V]){M[V]=[].concat(JSON.parse(JSON.stringify(A)));var Y=s(L.staff,V);Y&&M[V].unshift({el_type:"name",trackName:Y})}if(d&&"perc"===z.clef.type&&M[V].push({el_type:"transpose",transpose:0}),z.clef&&"perc"===z.clef.type&&!p)for(var W=0;W<M[V].length;W++)"instrument"===M[V][W].el_type&&(M[V][W].program=128);else z.key&&("HP"===z.key.root?M[V].push({el_type:"key",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}]}):M[V].push({el_type:"key",accidentals:z.key.accidentals}));z.meter&&M[V].push(c(z.meter)),!P&&b&&(M[V].push({el_type:"drum",params:{pattern:m,bars:g,on:b,intro:v}}),P=!0),z.clef&&"perc"!==z.clef.type&&z.clef.transpose&&(z.clef.el_type="clef",M[V].push({el_type:"transpose",transpose:z.clef.transpose})),z.clef&&z.clef.type&&(z.clef.type.indexOf("-8")>=0?M[V].push({el_type:"transpose",transpose:-12}):z.clef.type.indexOf("+8")>=0&&M[V].push({el_type:"transpose",transpose:12})),r.formatting.midi&&r.formatting.midi.drumoff&&(M[V].push({el_type:"bar"}),M[V].push({el_type:"drum",params:{pattern:"",on:!1}}));var R=0,G=0,U=0,X=0;S=[105,95,85,1];for(var K=0;K<q.length;K++){var Z=q[K];switch(Z.el_type){case"note":if(N[j]&&(S[0]+=N[j],S[1]+=N[j],S[2]+=N[j],M[V].push({el_type:"beat",beats:S.slice(0)})),C[j]&&(S[0]+=C[j],S[1]+=C[j],S[2]+=C[j],M[V].push({el_type:"beat",beats:S.slice(0)})),O(Z),!Z.rest||"spacer"!==Z.rest.type){var Q={elem:Z,el_type:"note",timing:E[V]};Z.style?Q.style=Z.style:y[V]&&(Q.style=y[V]),Q.duration=0===Z.duration?.25:Z.duration,Z.startTriplet?(G=Z.tripletMultiplier,U=Z.startTriplet*G*Z.duration,Q.duration=Q.duration*G,Q.duration=Math.round(1e6*Q.duration)/1e6,X=Q.duration):G&&(Z.endTriplet?(G=0,Q.duration=Math.round(1e6*(U-X))/1e6):(Q.duration=Q.duration*G,Q.duration=Math.round(1e6*Q.duration)/1e6,X+=Q.duration)),Z.rest&&(Q.rest=Z.rest),Z.decoration&&(Q.decoration=Z.decoration.slice(0)),Z.pitches&&(Q.pitches=i.cloneArray(Z.pitches)),Z.gracenotes&&(Q.gracenotes=i.cloneArray(Z.gracenotes)),Z.chord&&(Q.chord=i.cloneArray(Z.chord)),M[V].push(Q),"rhythm"===Z.style&&(!0,a(M)),R++,E[V]+=Q.duration}break;case"key":"HP"===Z.root?M[V].push({el_type:"key",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}]}):M[V].push({el_type:"key",accidentals:Z.accidentals});break;case"meter":M[V].push(c(Z));break;case"clef":Z.transpose&&M[V].push({el_type:"transpose",transpose:Z.transpose}),Z.type&&(Z.type.indexOf("-8")>=0?M[V].push({el_type:"transpose",transpose:-12}):Z.type.indexOf("+8")>=0&&M[V].push({el_type:"transpose",transpose:12}));break;case"tempo":h=o(Z,r.getBeatLength()),M[V].push({el_type:"tempo",qpm:h,timing:E[V]}),I[""+E[V]]={el_type:"tempo",qpm:h,timing:E[V]};break;case"bar":R>0&&M[V].push({el_type:"bar"}),O(Z),R=0;var J="bar_right_repeat"===Z.type||"bar_dbl_repeat"===Z.type,$="1"===Z.startEnding,ee="bar_left_repeat"===Z.type||"bar_dbl_repeat"===Z.type||"bar_right_repeat"===Z.type;if(J){var te=_[V];te||(te=0);var ne=B[V];ne||(ne=M[V].length);for(var re=te;re<ne;re++){var ie=i.clone(M[V][re]);ie.pitches&&(ie.pitches=i.cloneArray(ie.pitches)),M[V].push(ie)}B[V]=void 0,_[V]=void 0}$&&(B[V]=M[V].length),ee&&(_[V]=M[V].length),!1;break;case"style":y[V]=Z.head;break;case"timeSignature":M[V].push(c(Z));break;case"part":break;case"stem":case"scale":break;case"midi":var ae=!1;switch(Z.cmd){case"drumon":b=!0,ae=!0;break;case"drumoff":b=!1,ae=!0;break;case"drum":m=Z.params,ae=!0;break;case"drumbars":g=Z.params[0],ae=!0;break;case"drummap":break;case"channel":10===Z.params[0]&&M[V].push({el_type:"instrument",program:128});break;case"program":M[V].push({el_type:"instrument",program:Z.params[0]}),p=!0;break;case"transpose":M[V].push({el_type:"transpose",transpose:Z.params[0]});break;case"gchordoff":M[V].push({el_type:"gchord",tacet:!0});break;case"gchordon":M[V].push({el_type:"gchord",tacet:!1});break;case"beat":M[V].push({el_type:"beat",beats:Z.params});break;case"nobeataccents":M[V].push({el_type:"beataccents",value:!1});break;case"beataccents":M[V].push({el_type:"beataccents",value:!0});break;case"vol":M[V].push({el_type:"vol",volume:Z.params[0]});break;case"volinc":M[V].push({el_type:"volinc",volume:Z.params[0]});break;default:console.log("MIDI seq: midi cmd not handled: ",Z.cmd,Z)}ae&&(M[0].push({el_type:"drum",params:{pattern:m,bars:g,intro:v,on:b}}),P=!0);break;default:console.log("MIDI: element type "+Z.el_type+" not handled.")}}E[++V]||(E[V]=0)}}if(function(e,t){for(var n=Object.keys(t),r=0;r<e.length;r++)for(var i=e[r],a=0;a<i.length;a++){var s=i[a];n.indexOf(""+s.timing)>=0&&("tempo"===s.el_type?(s.qpm=t[""+s.timing].qpm,a++):(e[r].splice(a,0,{el_type:"tempo",qpm:t[""+s.timing].qpm,timing:s.timing}),a+=2))}}(M,I),v)for(var se=r.getPickupLength(),oe=0;oe<M.length;oe++){for(var ce=0;"note"!==M[oe][ce].el_type&&M[oe].length>ce;)ce++;if(M[oe].length>ce)for(var le=0;le<v;le++)0===se||le<v-1?M[oe].splice(ce,0,{el_type:"note",rest:{type:"rest"},duration:e},{el_type:"bar"}):M[oe].splice(ce,0,{el_type:"note",rest:{type:"rest"},duration:e-se})}return M.length>0&&M[0].length>0&&(M[0][0].pickupLength=r.getPickupLength()),M}}(),e.exports=r},function(e,t,n){var r,i=n(0);!function(){"use strict";var e,t,n,a,s,o,c,l,h,u,d,f,p,m,g,v,b,y,w,x,k,A,T=1,S={num:4,den:4},M=64,N=48,C=!1,E=!1,I=!0,_=105,B=95,P=85,D=.25,L=0,O={},H=0;function V(e){for(var t=h.length-1;t>=0;t--)if("program"===h[t].cmd)return void(h[t].channel=e)}function F(e){return e/1e6}function z(e){return Math.round(e*T*1e6)/1e6}function j(e){switch(parseInt(e.den,10)){case 2:return.5;case 4:return.25;case 8:return.375;case 16:return.125}return.25}r=function(r,i){i||(i={}),e=[],t=[0,0,0,0,0,0,0],!1,a=[],s=void 0,o=void 0,T=1,c=void 0,l=void 0,h=void 0,u=void 0,d=0,S={num:4,den:4},f=[],p=!1,g=r.length,m=!1,v=[],M=64,N=48,b=void 0,y=void 0,C=!!i.chordsOff,E=!1,I=!0,_=105,B=95,P=85,D=.25,x=void 0,k=void 0,L=0,A=[],!1,O={},r.length>0&&r[0].length>0&&(H=r[0][0].pickupLength),function(e){for(var t=0;t<e.length;t++){for(var n=e[t],r={},i=0,a=0,s=1,o=0;o<n.length;o++){var c=n[o];if("tempo"!==c.el_type){c.time=a;var l=c.duration?c.duration:0;if(a+=Math.round(l*s*1e6),c.pitches){for(var h=0;h<c.pitches.length;h++){var u=c.pitches[h];if(u)if(u.duration=c.duration,u.startTie)void 0===r[u.pitch]?r[u.pitch]={el:o,pitch:h}:(n[r[u.pitch].el].pitches[r[u.pitch].pitch].duration+=u.duration,c.pitches[h]=null);else if(u.endTie){var d=r[u.pitch];if(d){var f=u.duration;delete n[d.el].pitches[d.pitch].startTie,n[d.el].pitches[d.pitch].duration+=f,c.pitches[h]=null,delete r[u.pitch]}else delete u.endTie}}delete c.duration}}else i?s=c.qpm?i/c.qpm:1:i=c.qpm}for(var p in r)if(r.hasOwnProperty(p)){var m=r[p];delete n[m.el].pitches[m.pitch].startTie}}}(r);for(var z=0;z<r.length;z++){n=0,-1;var q=r[z];h=[{cmd:"program",channel:z,instrument:c}],u=void 0,w=0;var Y=!1;(!0===i.voicesOff||i.voicesOff&&i.voicesOff.length&&i.voicesOff.indexOf(z)>=0)&&(Y=!0);for(var W=0;W<q.length;W++){var R=q[W];switch(R.el_type){case"name":u={cmd:"text",type:"name",text:R.trackName};break;case"note":G(R,Y)&&(p=z);break;case"key":t=K(R);break;case"meter":o||(o=R),D=j(S=R);break;case"tempo":s?T=R.qpm?s/R.qpm:1:s=R.qpm;break;case"transpose":n=R.transpose;break;case"bar":f.length>0&&(!1===p||z===p)&&(re(w,F(R.time)),v=[]),e=[],0===z&&ae(r.length+1),E=!1,y=b,w=F(R.time);break;case"bagpipes":!0;break;case"instrument":if(void 0===c&&(c=R.program),l=R.program,h.length>0&&"program"===h[h.length-1].cmd)h[h.length-1].instrument=R.program;else{var U;for(U=h.length-1;U>=0&&"program"!==h[U].cmd;U--);(U<0||h[U].instrument!==R.program)&&h.push({cmd:"program",channel:0,instrument:R.program})}break;case"channel":V(R.channel);break;case"drum":O=ie(R.params);break;case"gchord":i.chordsOff||(C=R.tacet);break;case"beat":_=R.beats[0],B=R.beats[1],P=R.beats[2];break;case"vol":x=R.volume;break;case"volinc":k=R.volume;break;case"beataccents":I=R.value;break;default:console.log("MIDI creation. Unknown el_type: "+R.el_type+"\n")}}void 0===h[0].instrument&&(h[0].instrument=c||0),u&&h.unshift(u),a.push(h),f.length>0&&(m=!0),A.length>0&&!0}return f.length>0&&a.push(f),A.length>0&&a.push(A),{tempo:s,instrument:c,tracks:a,totalDuration:d}};var q=["break","(break)","no chord","n.c.","tacet"];function Y(e,t,n){return(n-e)/t}function W(e){var t=!1,r=function(e){if(C)return"break";if(m||!e.chord||0===e.chord.length)return null;for(var t=0;t<e.chord.length;t++){var n=e.chord[t];if("default"===n.position)return n.name;if(q.indexOf(n.name.toLowerCase())>=0)return"break"}return null}(e);if(r){var i=function(e){if(0===e.length)return;if("break"===e)return{chick:[]};var t=e.substring(0,1);if("("===t){if(0===(e=e.substring(1,e.length-2)).length)return;t=e.substring(0,1)}var r=Q[t];if(!r)return;var i=n;for(;i<-8;)i+=12;for(;i>8;)i-=12;var a,s=(r+=i)-5;1===e.length&&(a=$(r,""));var o=e.substring(1),c=o.substring(0,1);"b"===c||"♭"===c?(r--,s--,o=o.substring(1)):"#"!==c&&"♯"!==c||(r++,s++,o=o.substring(1));var l=o.split("/");if((a=$(r,l[0])).length>=3){var h=a[2]-a[0];s=s+h-7}if(2===l.length){if(Q[l[1].substring(0,1)]){var u={"#":1,"♯":1,b:-1,"♭":-1}[l[1].substring(1)]||0;r=Q[l[1].substring(0,1)]+u+i,s=r}}return{boom:r,boom2:s,chick:a}}(r);if(i){0===f.length&&(t=!0,f.push({cmd:"program",channel:g,instrument:0})),b=i;var a=Y(w,j(S),F(e.time));v.push({chord:b,beat:a,start:F(e.time)})}}return t}function R(e,t){var n=t.start,r=t.duration,i=z(1/32);switch(e){case"trill":for(var a=1;r>0;)h.push({cmd:"note",pitch:t.pitch+a,volume:t.volume,start:n,duration:i,gap:0,instrument:l,style:"decoration"}),a=1===a?0:1,r-=i,n+=i;break;case"mordent":h.push({cmd:"note",pitch:t.pitch,volume:t.volume,start:n,duration:i,gap:0,instrument:l,style:"decoration"}),r-=i,n+=i,h.push({cmd:"note",pitch:t.pitch+1,volume:t.volume,start:n,duration:i,gap:0,instrument:l,style:"decoration"}),r-=i,n+=i,h.push({cmd:"note",pitch:t.pitch,volume:t.volume,start:n,duration:r,gap:0,instrument:l});break;case"lowermordent":h.push({cmd:"note",pitch:t.pitch,volume:t.volume,start:n,duration:i,gap:0,instrument:l,style:"decoration"}),r-=i,n+=i,h.push({cmd:"note",pitch:t.pitch-1,volume:t.volume,start:n,duration:i,gap:0,instrument:l,style:"decoration"}),r-=i,n+=i,h.push({cmd:"note",pitch:t.pitch,volume:t.volume,start:n,duration:r,gap:0,instrument:l});break;case"turn":i=t.duration/5,h.push({cmd:"note",pitch:t.pitch,volume:t.volume,start:n,duration:i,gap:0,instrument:l,style:"decoration"}),h.push({cmd:"note",pitch:t.pitch+1,volume:t.volume,start:n+i,duration:i,gap:0,instrument:l,style:"decoration"}),h.push({cmd:"note",pitch:t.pitch,volume:t.volume,start:n+2*i,duration:i,gap:0,instrument:l,style:"decoration"}),h.push({cmd:"note",pitch:t.pitch+1,volume:t.volume,start:n+3*i,duration:i,gap:0,instrument:l,style:"decoration"}),h.push({cmd:"note",pitch:t.pitch,volume:t.volume,start:n+4*i,duration:i,gap:0,instrument:l});break;case"roll":for(;r>0;)h.push({cmd:"note",pitch:t.pitch,volume:t.volume,start:n,duration:i,gap:0,instrument:l,style:"decoration"}),r-=2*i,n+=2*i}}function G(e,t){h.length;var n,r=function(e,t){if(t)return 0;var n;if(x)n=x,x=void 0;else if(I)if(H>e)n=P;else{S.num,S.den;var r=Y(w,j(S),e);n=0===r?_:parseInt(r,10)===r?B:P}else n=B;return k&&(n+=k,k=void 0),n<0&&(n=0),n>127&&(n=127),t?0:n}(F(e.time),t),a=W(e);if(e.gracenotes&&e.pitches&&e.pitches.length>0&&e.pitches[0]&&(n=function(e,t){for(var n,r=0,i=[],a=0;a<e.length;a++)n=e[a],r+=n.duration;var s=t/2/r;for(a=0;a<e.length;a++){var o=X(n=e[a]);i.push({pitch:o,duration:n.duration*s})}return i}(e.gracenotes,e.pitches[0].duration),e.elem&&(e.elem.midiGraceNotePitches=function(e,t,n,r){var i=[];n=Math.round(n);for(var a=0;a<e.length;a++){var s=e[a];h.push({cmd:"note",pitch:s.pitch,volume:n,start:t,duration:s.duration,gap:0,instrument:r,style:"grace"}),i.push({pitch:s.pitch,durationInMeasures:s.duration,volume:n,instrument:r}),t+=s.duration}return i}(n,F(e.time),2*r/3,l))),e.elem){var o=F(e.time)/D/s*60*1e3;void 0===e.elem.currentTrackMilliseconds?e.elem.currentTrackMilliseconds=o:void 0===e.elem.currentTrackMilliseconds.length?e.elem.currentTrackMilliseconds=[e.elem.currentTrackMilliseconds,o]:e.elem.currentTrackMilliseconds.push(o)}if(e.pitches){var c="",u=function(e,t){var n={};if(e.decoration)for(var r=0;r<e.decoration.length;r++)"staccato"===e.decoration[r]?n.thisBreakBetweenNotes="staccato":"tenuto"===e.decoration[r]?n.thisBreakBetweenNotes="tenuto":"accent"===e.decoration[r]?n.velocity=Math.min(127,1.5*t):"trill"===e.decoration[r]?n.noteModification="trill":"lowermordent"===e.decoration[r]?n.noteModification="lowermordent":"uppermordent"===e.decoration[r]||"mordent"===e.decoration[r]?n.noteModification="mordent":"turn"===e.decoration[r]?n.noteModification="turn":"roll"===e.decoration[r]&&(n.noteModification="roll");return n}(e,r);u.thisBreakBetweenNotes&&(c=u.thisBreakBetweenNotes),u.velocity&&(r=u.velocity);var f=e.pitches;if("rhythm"===e.style&&(E=!0,b&&b.chick)){f=[];for(var p=0;p<b.chick.length;p++){var m=i.clone(e.pitches[0]);m.actualPitch=b.chick[p],f.push(m)}}e.elem&&(e.elem.midiPitches=[]);for(var g=0;g<f.length;g++){var v=f[g];if(v){v.startSlur&&(L+=v.startSlur.length),v.endSlur&&(L-=v.endSlur.length);var y={cmd:"note",pitch:v.actualPitch?v.actualPitch:X(v),volume:r,start:F(e.time),duration:z(v.duration),instrument:l};if(e.gracenotes&&(y.duration=y.duration/2,y.start=y.start+y.duration),e.elem&&e.elem.midiPitches.push(y),u.noteModification)R(u.noteModification,y);else{switch(L>0?y.endType="tenuto":c&&(y.endType=c),y.endType){case"tenuto":y.gap=-.001;break;case"staccato":var A=.4*y.duration;y.gap=s/60*A;break;default:y.gap=0}h.push(y)}}}h.length-1}var T=function(e){return e.pitches&&e.pitches.length>0&&e.pitches[0]?e.pitches[0].duration:e.elem?e.elem.duration:e.duration}(e);return d=Math.max(d,F(e.time)+z(T)),a}var U=[0,2,4,5,7,9,11];function X(r){if(void 0!==r.midipitch)return r.midipitch;var i=r.soundPitch||0===r.soundPitch?r.soundPitch:r.pitch;if(r.accidental)switch(r.accidental){case"sharp":e[i]=1;break;case"flat":e[i]=-1;break;case"natural":e[i]=0;break;case"dblsharp":e[i]=2;break;case"dblflat":e[i]=-2}var a=12*function(e){return Math.floor(e/7)}(i)+U[Z(i)]+60;if(void 0!==e[i]){var s=t[Z(i)],o=e[i],c=0;-1===s?c=o+1:0===s?c=o:1===s&&(c=o-1),a+=s+c}else a+=t[Z(i)];return a+=n}function K(e){var t=[0,0,0,0,0,0,0];if(!e.accidentals)return t;for(var n=0;n<e.accidentals.length;n++){var r=e.accidentals[n],i="sharp"===r.acc?1:"natural"===r.acc?0:-1;t[Z(r.note.toLowerCase().charCodeAt(0)-"c".charCodeAt(0))]+=i}return t}function Z(e){return(e%=7)<0&&(e+=7),e}var Q={A:33,B:35,C:36,D:38,E:40,F:41,G:43};var J={dim:[0,3,6],"°":[0,3,6],"˚":[0,3,6],dim7:[0,3,6,9],"°7":[0,3,6,9],"˚7":[0,3,6,9],"ø7":[0,3,6,10],"m7(b5)":[0,3,6,10],m7b5:[0,3,6,10],"m7♭5":[0,3,6,10],"-7(b5)":[0,3,6,10],"-7b5":[0,3,6,10],"7b5":[0,4,6,10],"7(b5)":[0,4,6,10],"7♭5":[0,4,6,10],"7(b9,b5)":[0,4,6,10,13],"7b9,b5":[0,4,6,10,13],"7(#9,b5)":[0,4,6,10,15],"7#9b5":[0,4,6,10,15],"maj7(b5)":[0,4,6,11],maj7b5:[0,4,6,11],"13(b5)":[0,4,6,10,14,21],"13b5":[0,4,6,10,14,21],m:[0,3,7],"-":[0,3,7],m6:[0,3,7,9],"-6":[0,3,7,9],m7:[0,3,7,10],"-7":[0,3,7,10],"-(b6)":[0,3,7,8],"-b6":[0,3,7,8],"-6/9":[0,3,7,9,14],"-7(b9)":[0,3,7,10,13],"-7b9":[0,3,7,10,13],"-maj7":[0,3,7,11],"-9+7":[0,3,7,11,13],"-11":[0,3,7,11,14,17],m11:[0,3,7,11,14,17],"-maj9":[0,3,7,11,14],"-∆9":[0,3,7,11,14],mM9:[0,3,7,11,14],M:[0,4,7],6:[0,4,7,9],"6/9":[0,4,7,9,14],"6add9":[0,4,7,9,14],69:[0,4,7,9,14],7:[0,4,7,10],9:[0,4,7,10,14],11:[0,7,10,14,17],13:[0,4,7,10,14,21],"7b9":[0,4,7,10,13],"7♭9":[0,4,7,10,13],"7(b9)":[0,4,7,10,13],"7(#9)":[0,4,7,10,15],"7#9":[0,4,7,10,15],"(13)":[0,4,7,10,14,21],"7(9,13)":[0,4,7,10,14,21],"7(#9,b13)":[0,4,7,10,15,20],"7(#11)":[0,4,7,10,14,18],"7#11":[0,4,7,10,14,18],"7(b13)":[0,4,7,10,20],"7b13":[0,4,7,10,20],"9(#11)":[0,4,7,10,14,18],"9#11":[0,4,7,10,14,18],"13(#11)":[0,4,7,10,18,21],"13#11":[0,4,7,10,18,21],maj7:[0,4,7,11],"∆7":[0,4,7,11],"Δ7":[0,4,7,11],maj9:[0,4,7,11,14],"maj7(9)":[0,4,7,11,14],"maj7(11)":[0,4,7,11,17],"maj7(#11)":[0,4,7,11,18],"maj7(13)":[0,4,7,14,21],"maj7(9,13)":[0,4,7,11,14,21],"7sus4":[0,5,7,10],m7sus4:[0,3,7,10,17],sus4:[0,5,7],sus2:[0,2,7],"7sus2":[0,2,7,10],"9sus4":[0,5,7,10,14],"13sus4":[0,5,7,10,14,21],aug7:[0,4,8,10],"+7":[0,4,8,10],"+":[0,4,8],"7#5":[0,4,8,10],"7♯5":[0,4,8,10],"7+5":[0,4,8,10],"9#5":[0,4,8,10,14],"9♯5":[0,4,8,10,14],"9+5":[0,4,8,10,14],"-7(#5)":[0,3,8,10],"-7#5":[0,3,8,10],"7(#5)":[0,4,8,10],"7(b9,#5)":[0,4,8,10,13],"7b9#5":[0,4,8,10,13],"maj7(#5)":[0,4,8,11],"maj7#5":[0,4,8,11],"maj7(#5,#11)":[0,4,8,11,18],"maj7#5#11":[0,4,8,11,18],"9(#5)":[0,4,8,10,14],"13(#5)":[0,4,8,10,14,21],"13#5":[0,4,8,10,14,21]};function $(e,t){var n=J[t];n||(n="ma"===t.slice(0,2).toLowerCase()||"M"===t.charAt(0)?J.M:"m"===t.charAt(0)||"-"===t.charAt(0)?J.m:J.M),e+=12;for(var r=[],i=0;i<n.length;i++)r.push(e+n[i]);return r}function ee(e,t,n,r,i){void 0!==e&&f.push({cmd:"note",pitch:e,volume:n,start:w+r*z(t),duration:z(i),gap:0,instrument:0})}function te(e,t,n,r,i){for(var a=0;a<e.length;a++)f.push({cmd:"note",pitch:e[a],volume:n,start:w+r*z(t),duration:z(i),gap:0,instrument:0})}var ne={"2/2":["boom","chick"],"2/4":["boom","chick"],"3/4":["boom","chick","chick"],"4/4":["boom","chick","boom2","chick"],"5/4":["boom","chick","chick","boom2","chick"],"6/8":["boom","","chick","boom2","","chick"],"9/8":["boom","","chick","boom2","","chick","boom2","","chick"],"12/8":["boom","","chick","boom2","","chick","boom","","chick","boom2","","chick"]};function re(e,t){var n=S.num,r=S.den,i=1/r,a=i/2,s=ne[n+"/"+r],o=parseInt(n,10)/parseInt(r,10)-(t-e)/T;if(Math.abs(o)<1e-5&&(o=!1),!s||o){s=[];for(var c=(t-e)/T/i,l=0;l<c;l++)s.push("chick")}if(0===v.length&&v.push({beat:0,chord:b}),0!==v[0].beat&&b&&y&&v.unshift({beat:0,chord:y}),1!==v.length){for(var h=.125===i?3:1,u={},d=0;d<v.length;d++){var f=v[d];u[""+Math.round(f.beat*h)]=f}for(var p=0;p<s.length;p++){var m,g;if(u[""+p]&&(m=u[""+p]),!E&&m)switch(s[p]){case"boom":u[""+(p+1)]?te(m.chord.chick,i,N,p,a):(ee(m.chord.boom,i,M,p,a),g=m.chord.boom);break;case"boom2":u[""+(p+1)]?te(m.chord.chick,i,N,p,a):g===m.chord.boom?(ee(m.chord.boom2,i,M,p,a),g=void 0):(ee(m.chord.boom,i,M,p,a),g=m.chord.boom);break;case"chick":te(m.chord.chick,i,N,p,a);break;case"":u[""+p]&&te(m.chord.chick,i,N,p,a)}}}else for(var w=v[0].beat;w<s.length;w++)if(!E)switch(s[w]){case"boom":ee(v[0].chord.boom,i,M,w,a);break;case"boom2":ee(v[0].chord.boom2,i,M,w,a);break;case"chick":te(v[0].chord.chick,i,N,w,a)}}function ie(e){if(0===e.pattern.length||!1===e.on)return{on:!1};for(var t=e.pattern[0],n=[],r="",i=0,a=0;a<t.length;a++)if("d"===t[a]&&i++,"d"===t[a]||"z"===t[a])0!==r.length?(n.push(r),r=t[a]):r+=t[a];else{if(0===r.length)return{on:!1};r+=t[a]}if(0!==r.length&&n.push(r),e.pattern.length!==2*i+1)return{on:!1};for(var s={on:!0,bars:e.bars,pattern:[]},o=j(S),c=0,l=0;l<n.length;l++){r=n[l];for(var h=1,u=!1,d=0,f=1;f<r.length;f++)switch(r[f]){case"/":0!==d&&(h*=d),d=0,u=!0;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":d=10*d+r[f];break;default:return{on:!1}}u?(0===d&&(d=2),h/=d):d&&(h*=d),"d"===r[0]?(s.pattern.push({len:h*o,pitch:e.pattern[1+c],velocity:e.pattern[1+c+i]}),c++):s.pattern.push({len:h*o,pitch:null})}for(var p=0,m=S.num/S.den,g=0;g<s.pattern.length;g++)p+=s.pattern[g].len;var v=p/(e.bars?e.bars:1)/m;for(g=0;g<s.pattern.length;g++)s.pattern[g].len=s.pattern[g].len/v;return s}function ae(e){if(0!==A.length||O.on){var t=S.num/S.den;if(0===A.length){if(d<t)return;A.push({cmd:"program",channel:e,instrument:128})}if(O.on)for(var n=w,r=0;r<O.pattern.length;r++){var i=z(O.pattern[r].len);O.pattern[r].pitch&&A.push({cmd:"note",pitch:O.pattern[r].pitch,volume:O.pattern[r].velocity,start:n,duration:i,gap:0,instrument:128}),n+=i}}}}(),e.exports=r},function(e,t,n){var r=n(11),i=n(0);e.exports=function(e){var t=this;this.reset=function(){e.version="1.1.0",e.media="screen",e.metaText={},e.formatting={},e.lines=[],e.staffNum=0,e.voiceNum=0,e.lineNum=0,e.runningFonts={},delete e.visualTranspose},this.setVisualTranspose=function(t){t&&(e.visualTranspose=t)},this.resolveOverlays=function(){for(var t=!1,n=[],r=0;r<e.lines.length;r++){var a=e.lines[r];if(a.staff)for(var s=0;s<a.staff.length;s++){for(var o=a.staff[s],c=[],l=0;l<o.voices.length;l++){var h=o.voices[l];c.push({hasOverlay:!1,voice:[],snip:[]}),n[r]=0;for(var u=0,d=!1,f=0,p=-1,m=0;m<h.length;m++){var g=h[m];if("overlay"!==g.el_type||d)"bar"===g.el_type?(d?(d=!1,c[l].snip.push({start:p,len:m-p}),c[l].voice.push(g)):(u>0&&c[l].voice.push({el_type:"note",duration:u,rest:{type:"invisible"},startChar:g.startChar,endChar:g.endChar}),c[l].voice.push(g)),u=0):"note"===g.el_type?d?c[l].voice.push(g):(u+=g.duration,n[r]+=g.duration):"scale"!==g.el_type&&"stem"!==g.el_type&&"overlay"!==g.el_type&&"style"!==g.el_type&&"transpose"!==g.el_type||c[l].voice.push(g);else{t=!0,d=!0,p=m,c[l].hasOverlay=!0,0===f&&(f=n[r]);for(var v=0;v<r;v++)n[v]&&e.lines[v].staff&&o.voices.length>=e.lines[v].staff[0].voices.length&&e.lines[v].staff[0].voices.push([{el_type:"note",duration:n[v],rest:{type:"invisible"},startChar:g.startChar,endChar:g.endChar}])}}c[l].hasOverlay&&0===c[l].snip.length&&c[l].snip.push({start:p,len:h.length-p})}for(l=0;l<c.length;l++){var b=c[l];if(b.hasOverlay){o.voices.push(b.voice);for(var y=b.snip.length-1;y>=0;y--){var w=b.snip[y];o.voices[l].splice(w.start,w.len)}for(y=0;y<o.voices[o.voices.length-1].length;y++){o.voices[o.voices.length-1][y]=i.clone(o.voices[o.voices.length-1][y]);var x=o.voices[o.voices.length-1][y];"bar"===x.el_type&&x.startEnding&&delete x.startEnding,"bar"===x.el_type&&x.endEnding&&delete x.endEnding}}}}}return t},this.cleanUp=function(t,n,a,s,o){this.closeLine(),delete e.runningFonts,e.metaText.tempo&&e.metaText.tempo.bpm&&!e.metaText.tempo.duration&&(e.metaText.tempo.duration=[e.getBeatLength()]);var c,l,h,u=!1;for(c=0;c<e.lines.length;c++)if(void 0!==e.lines[c].staff){var d=!1;for(l=0;l<e.lines[c].staff.length;l++)if(void 0===e.lines[c].staff[l])u=!0,e.lines[c].staff[l]=null;else for(h=0;h<e.lines[c].staff[l].voices.length;h++)void 0===e.lines[c].staff[l].voices[h]?e.lines[c].staff[l].voices[h]=[]:this.containsNotes(e.lines[c].staff[l].voices[h])&&(d=!0);d||(e.lines[c]=null,u=!0)}if(u&&(e.lines=i.compact(e.lines),i.each(e.lines,(function(e){e.staff&&(e.staff=i.compact(e.staff))}))),a)for(;g(e.lines,a););if(s){for(u=!1,c=0;c<e.lines.length;c++)if(void 0!==e.lines[c].staff)for(l=0;l<e.lines[c].staff.length;l++){var f=!1;for(h=0;h<e.lines[c].staff[l].voices.length;h++)this.containsNotesStrict(e.lines[c].staff[l].voices[h])&&(f=!0);f||(u=!0,e.lines[c].staff[l]=null)}u&&i.each(e.lines,(function(e){e.staff&&(e.staff=i.compact(e.staff))}))}for(function(e){for(var t=!0,n=0;n<e.length;n++){var r=e[n];if(r.staff){for(var i=0;i<r.staff.length;i++){var a=r.staff[i];if(a.title){for(var s=!1,o=0;o<a.title.length;o++)a.title[o]?(a.title[o]=t?a.title[o].name:a.title[o].subname,a.title[o]?s=!0:a.title[o]=""):a.title[o]="";s||delete a.title}}t=!1}}}(e.lines),c=0;c<e.lines.length;c++)if(e.lines[c].staff)for(l=0;l<e.lines[c].staff.length;l++)delete e.lines[c].staff[l].workingClef;for(;this.resolveOverlays(););function p(e){for(var t,n=function(e,n,r){if(void 0===o[r]){for(t=0;t<o.length;t++)if(void 0!==o[t]){r=t;break}if(void 0===o[r]){var a=100*r+1;i.each(e.endSlur,(function(e){a===e&&--a})),o[r]=[a]}}for(var s,c=0;c<n;c++)s=o[r].pop(),e.endSlur.push(s);return 0===o[r].length&&delete o[r],s},r=function(e,t,n,r){e.startSlur=[],void 0===o[n]&&(o[n]=[]);for(var a=100*n+1,s=0;s<t;s++)r&&(i.each(r,(function(e){a===e&&++a})),i.each(r,(function(e){a===e&&++a})),i.each(r,(function(e){a===e&&++a}))),i.each(o[n],(function(e){a===e&&++a})),i.each(o[n],(function(e){a===e&&++a})),o[n].push(a),e.startSlur.push({label:a}),e.dottedSlur&&(e.startSlur[e.startSlur.length-1].style="dotted",delete e.dottedSlur),a++},a=0;a<e.length;a++){var s=e[a];if("note"===s.el_type){if(s.gracenotes)for(var c=0;c<s.gracenotes.length;c++){if(s.gracenotes[c].endSlur){var l=s.gracenotes[c].endSlur;s.gracenotes[c].endSlur=[];for(var h=0;h<l;h++)n(s.gracenotes[c],1,20)}s.gracenotes[c].startSlur&&(t=s.gracenotes[c].startSlur,r(s.gracenotes[c],t,20))}if(s.endSlur&&(t=s.endSlur,s.endSlur=[],n(s,t,0)),s.startSlur&&r(s,t=s.startSlur,0),s.pitches){for(var u=[],d=0;d<s.pitches.length;d++)if(s.pitches[d].endSlur){var f=s.pitches[d].endSlur;s.pitches[d].endSlur=[];for(var p=0;p<f;p++){var m=n(s.pitches[d],1,d+1);u.push(m)}}for(d=0;d<s.pitches.length;d++)s.pitches[d].startSlur&&(t=s.pitches[d].startSlur,r(s.pitches[d],t,d+1,u));s.gracenotes&&s.pitches[0].endSlur&&100===s.pitches[0].endSlur[0]&&s.pitches[0].startSlur&&(s.gracenotes[0].endSlur?s.gracenotes[0].endSlur.push(s.pitches[0].startSlur[0].label):s.gracenotes[0].endSlur=[s.pitches[0].startSlur[0].label],1===s.pitches[0].endSlur.length?delete s.pitches[0].endSlur:100===s.pitches[0].endSlur[0]?s.pitches[0].endSlur.shift():100===s.pitches[0].endSlur[s.pitches[0].endSlur.length-1]&&s.pitches[0].endSlur.pop(),1===o[1].length?delete o[1]:o[1].pop())}}}}function m(e){r.fixClef(e)}function g(e,t){for(c=0;c<e.length;c++)if(void 0!==e[c].staff)for(l=0;l<e[c].staff.length;l++){var n=[];for(h=0;h<e[c].staff[l].voices.length;h++)for(var r=e[c].staff[l].voices[h],a=0,s=0;s<r.length;s++)if("bar"===r[s].el_type){if(++a>=t&&s<r.length-1){var o=v(e,c);if(!o){var u=JSON.parse(JSON.stringify(e[c]));e.push(i.clone(u)),o=e[e.length-1];for(var d=0;d<o.staff.length;d++)for(var f=0;f<o.staff[d].voices.length;f++)o.staff[d].voices[f]=[]}var p=s+1,m=e[c].staff[l].voices[h].slice(p);return e[c].staff[l].voices[h]=e[c].staff[l].voices[h].slice(0,p),o.staff[l].voices[h]=n.concat(m.concat(o.staff[l].voices[h])),!0}}else r[s].duration||n.push(r[s])}return!1}function v(e,t){for(t++;e.length>t;){if(e[t].staff)return e[t];t++}return null}for(e.lineNum=0;e.lineNum<e.lines.length;e.lineNum++){var b=e.lines[e.lineNum].staff;if(b)for(e.staffNum=0;e.staffNum<b.length;e.staffNum++)for(b[e.staffNum].clef&&m(b[e.staffNum].clef),e.voiceNum=0;e.voiceNum<b[e.staffNum].voices.length;e.voiceNum++){var y=b[e.staffNum].voices[e.voiceNum];p(y);for(var w=0;w<y.length;w++)"clef"===y[w].el_type&&m(y[w]);if(y.length>0&&y[y.length-1].barNumber){var x=v(e.lines,e.lineNum);x&&(x.staff[0].barNumber=y[y.length-1].barNumber),delete y[y.length-1].barNumber}}}return e.formatting.pagewidth||(e.formatting.pagewidth=t),e.formatting.pageheight||(e.formatting.pageheight=n),delete e.staffNum,delete e.voiceNum,delete e.lineNum,delete e.potentialStartBeam,delete e.potentialEndBeam,delete e.vskipPending,o},this.reset(),this.getLastNote=function(){if(e.lines[e.lineNum]&&e.lines[e.lineNum].staff&&e.lines[e.lineNum].staff[e.staffNum]&&e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum])for(var t=e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum].length-1;t>=0;t--){var n=e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum][t];if("note"===n.el_type)return n}return null},this.addTieToLastNote=function(e){var t=this.getLastNote();return!!(t&&t.pitches&&t.pitches.length>0)&&(t.pitches[0].startTie={},e&&(t.pitches[0].startTie.style="dotted"),!0)},this.getDuration=function(e){return e.duration?e.duration:0},this.closeLine=function(){e.potentialStartBeam&&e.potentialEndBeam&&(e.potentialStartBeam.startBeam=!0,e.potentialEndBeam.endBeam=!0),delete e.potentialStartBeam,delete e.potentialEndBeam},this.appendElement=function(n,r,a,s){var o=e;s.el_type=n,null!==r&&(s.startChar=r),null!==a&&(s.endChar=a);var c=function(){void 0!==o.potentialStartBeam&&void 0!==o.potentialEndBeam&&(o.potentialStartBeam.startBeam=!0,o.potentialEndBeam.endBeam=!0),delete o.potentialStartBeam,delete o.potentialEndBeam};"note"===n?t.getDuration(s)>=.25||s.force_end_beam_last&&void 0!==o.potentialStartBeam?c():s.end_beam&&void 0!==o.potentialStartBeam?void 0===s.rest?(o.potentialStartBeam.startBeam=!0,s.endBeam=!0,delete o.potentialStartBeam,delete o.potentialEndBeam):c():void 0===s.rest&&(void 0===o.potentialStartBeam?s.end_beam||(o.potentialStartBeam=s,delete o.potentialEndBeam):o.potentialEndBeam=s):c();delete s.end_beam,delete s.force_end_beam_last,function(e){var t=o.lines[o.lineNum].staff[o.staffNum];if(t){if(void 0!==e.pitches){var n=t.workingClef.verticalPos;i.each(e.pitches,(function(e){e.verticalPos=e.pitch-n}))}if(void 0!==e.gracenotes){var r=t.workingClef.verticalPos;i.each(e.gracenotes,(function(e){e.verticalPos=e.pitch-r}))}t.voices[o.voiceNum].push(e)}}(s)},this.appendStartingElement=function(t,n,r,a){var s;this.closeLine(),"key"===t&&(s=a.impliedNaturals,delete a.impliedNaturals,delete a.explicitAccidentals);var o=i.clone(a);if(e.lines[e.lineNum].staff){e.lines[e.lineNum].staff.length<=e.staffNum&&(e.lines[e.lineNum].staff[e.staffNum]={},e.lines[e.lineNum].staff[e.staffNum].clef=i.clone(e.lines[e.lineNum].staff[0].clef),e.lines[e.lineNum].staff[e.staffNum].key=i.clone(e.lines[e.lineNum].staff[0].key),e.lines[e.lineNum].staff[0].meter&&(e.lines[e.lineNum].staff[e.staffNum].meter=i.clone(e.lines[e.lineNum].staff[0].meter)),e.lines[e.lineNum].staff[e.staffNum].workingClef=i.clone(e.lines[e.lineNum].staff[0].workingClef),e.lines[e.lineNum].staff[e.staffNum].voices=[[]]),"clef"===t&&(e.lines[e.lineNum].staff[e.staffNum].workingClef=o);for(var c=e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum],l=0;l<c.length;l++){if("note"===c[l].el_type||"bar"===c[l].el_type)return o.el_type=t,o.startChar=n,o.endChar=r,s&&(o.accidentals=s.concat(o.accidentals)),void c.push(o);if(c[l].el_type===t)return o.el_type=t,o.startChar=n,o.endChar=r,s&&(o.accidentals=s.concat(o.accidentals)),void(c[l]=o)}e.lines[e.lineNum].staff[e.staffNum][t]=a}},this.getNumLines=function(){return e.lines.length},this.pushLine=function(t){e.vskipPending&&(t.vskip=e.vskipPending,delete e.vskipPending),e.lines.push(t)},this.addSubtitle=function(e){this.pushLine({subtitle:e})},this.addSpacing=function(t){e.vskipPending=t},this.addNewPage=function(e){this.pushLine({newpage:e})},this.addSeparator=function(e,t,n){this.pushLine({separator:{spaceAbove:Math.round(e),spaceBelow:Math.round(t),lineLength:Math.round(n)}})},this.addText=function(e){this.pushLine({text:e})},this.addCentered=function(e){this.pushLine({text:[{text:e,center:!0}]})},this.containsNotes=function(e){for(var t=0;t<e.length;t++)if("note"===e[t].el_type||"bar"===e[t].el_type)return!0;return!1},this.containsNotesStrict=function(e){for(var t=0;t<e.length;t++)if("note"===e[t].el_type&&void 0===e[t].rest)return!0;return!1},this.changeVoiceScale=function(e){t.appendElement("scale",null,null,{size:e})},this.startNewLine=function(n){var r=e;this.closeLine();var i=function(e){var n=r.lines[r.lineNum].staff[r.staffNum];if(n.voices[r.voiceNum]=[],n.title||(n.title=[]),n.title[r.voiceNum]={name:e.name,subname:e.subname},e.style&&t.appendElement("style",null,null,{head:e.style}),e.stem)t.appendElement("stem",null,null,{direction:e.stem});else if(r.voiceNum>0){if(void 0!==n.voices[0]){for(var i=!1,a=0;a<n.voices[0].length;a++)"stem"===n.voices[0].el_type&&(i=!0);if(!i){n.voices[0].splice(0,0,{el_type:"stem",direction:"up"})}}t.appendElement("stem",null,null,{direction:"down"})}e.scale&&t.appendElement("scale",null,null,{size:e.scale})},a=function(e){e.key&&e.key.impliedNaturals&&(e.key.accidentals=e.key.accidentals.concat(e.key.impliedNaturals),delete e.key.impliedNaturals),r.lines[r.lineNum].staff[r.staffNum]={voices:[],clef:e.clef,key:e.key,workingClef:e.clef},void 0!==e.stafflines&&(r.lines[r.lineNum].staff[r.staffNum].clef.stafflines=e.stafflines,r.lines[r.lineNum].staff[r.staffNum].workingClef.stafflines=e.stafflines),e.staffscale&&(r.lines[r.lineNum].staff[r.staffNum].staffscale=e.staffscale),e.annotationfont&&t.setLineFont("annotationfont",e.annotationfont),e.gchordfont&&t.setLineFont("gchordfont",e.gchordfont),e.tripletfont&&t.setLineFont("tripletfont",e.tripletfont),e.vocalfont&&t.setLineFont("vocalfont",e.vocalfont),e.bracket&&(r.lines[r.lineNum].staff[r.staffNum].bracket=e.bracket),e.brace&&(r.lines[r.lineNum].staff[r.staffNum].brace=e.brace),e.connectBarLines&&(r.lines[r.lineNum].staff[r.staffNum].connectBarLines=e.connectBarLines),e.barNumber&&(r.lines[r.lineNum].staff[r.staffNum].barNumber=e.barNumber),i(e),e.part&&t.appendElement("part",e.part.startChar,e.part.endChar,{title:e.part.title}),void 0!==e.meter&&(r.lines[r.lineNum].staff[r.staffNum].meter=e.meter),r.vskipPending&&(r.lines[r.lineNum].vskip=r.vskipPending,delete r.vskipPending)};if(void 0===e.lines[e.lineNum])!function(e){r.lines[r.lineNum]={staff:[]},a(e)}(n);else if(void 0===e.lines[e.lineNum].staff)e.lineNum++,this.startNewLine(n);else if(void 0===e.lines[e.lineNum].staff[e.staffNum])a(n);else if(void 0===e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum])i(n);else{if(!this.containsNotes(e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum]))return;e.lineNum++,this.startNewLine(n)}},this.setRunningFont=function(t,n){e.runningFonts[t]=n},this.setLineFont=function(t,n){if(e.runningFonts[t]){for(var r=!1,i=Object.keys(n),a=0;a<i.length;a++)e.runningFonts[t][i[a]]!==n[i[a]]&&(r=!0);r&&(e.lines[e.lineNum].staff[e.staffNum][t]=n)}e.runningFonts[t]=n},this.setBarNumberImmediate=function(e){var t=this.getCurrentVoice();if(t&&t.length>0){var n=t[t.length-1];if("bar"!==n.el_type)return e-1;void 0!==n.barNumber&&(n.barNumber=e)}return e},this.hasBeginMusic=function(){for(var t=0;t<e.lines.length;t++)if(e.lines[t].staff)return!0;return!1},this.isFirstLine=function(t){for(var n=t-1;n>=0;n--)if(void 0!==e.lines[n].staff)return!1;return!0},this.getCurrentVoice=function(){var t=e.lines[e.lineNum];if(!t)return null;var n=t.staff[e.staffNum];return n&&void 0!==n.voices[e.voiceNum]?n.voices[e.voiceNum]:null},this.setCurrentVoice=function(t,n){e.staffNum=t,e.voiceNum=n;for(var r=0;r<e.lines.length;r++)if(e.lines[r].staff&&(void 0===e.lines[r].staff[t]||void 0===e.lines[r].staff[t].voices[n]||!this.containsNotes(e.lines[r].staff[t].voices[n])))return void(e.lineNum=r);e.lineNum=r},this.addMetaText=function(t,n){void 0===e.metaText[t]?e.metaText[t]=n:e.metaText[t]+="\n"+n},this.addMetaTextArray=function(t,n){void 0===e.metaText[t]?e.metaText[t]=[n]:e.metaText[t].push(n)},this.addMetaTextObj=function(t,n){e.metaText[t]=n}}},function(e,t,n){var r=n(0);e.exports=function(e){"use strict";for(var t="",n=(e=r.strip(e)).split("\nX:"),i=1;i<n.length;i++)n[i]="X:"+n[i];var a=0,s=[];if(r.each(n,(function(e){s.push({abc:e,startPos:a}),a+=e.length+1})),s.length>1&&!r.startsWith(s[0].abc,"X:")){var o=s.shift().abc.split("\n");r.each(o,(function(e){r.startsWith(e,"%%")&&(t+=e+"\n")}))}var c=t;return r.each(s,(function(e){var n=e.abc.indexOf("\n\n");n>0&&(e.abc=e.abc.substring(0,n)),e.pure=e.abc,e.abc=t+e.abc,e.title="";var i=e.pure.split("T:");i.length>1&&(i=i[1].split("\n"),e.title=r.strip(i[0]));var a=e.pure.substring(2,e.pure.indexOf("\n"));e.id=r.strip(a)})),{header:c,tunes:s}}},function(e,t,n){var r=n(1),i=n(38),a=n(54),s=n(56),o=n(57),c=n(58),l=n(59),h=n(60),u=n(61),d=n(62),f=n(70),p=n(71),m=n(72),g=n(73),v=n(20),b=function(e,t){t=t||{},this.selectionColor=t.selectionColor,this.dragColor=t.dragColor?t.dragColor:t.selectionColor,this.dragging=!!t.dragging,this.selectTypes=t.selectTypes,this.responsive=t.responsive,this.space=3*r.SPACE,this.scale=t.scale?parseFloat(t.scale):0,this.classes=new f({shouldAddClasses:t.add_classes}),this.scale>.1||(this.scale=void 0),t.staffwidth?(this.staffwidthScreen=t.staffwidth,this.staffwidthPrint=t.staffwidth):(this.staffwidthScreen=740,this.staffwidthPrint=680),this.listeners=[],t.clickListener&&this.addSelectListener(t.clickListener),this.renderer=new a(e,t.regression),this.renderer.setPaddingOverride(t),t.showDebug&&(this.renderer.showDebug=t.showDebug),this.renderer.controller=this,this.reset()};b.prototype.reset=function(){this.selected=[],this.staffgroups=[],this.engraver&&this.engraver.reset(),this.engraver=null,this.renderer.reset(),this.dragTarget=null,this.dragIndex=-1,this.dragMouseStart={x:-1,y:-1},this.dragYStep=0},b.prototype.engraveABC=function(e,t){void 0===e[0]&&(e=[e]),this.reset();for(var n=0;n<e.length;n++)void 0===t&&(t=n),this.getFontAndAttr=new p(e[n].formatting,this.classes),this.getTextSize=new m(this.getFontAndAttr,this.renderer.paper),this.engraveTune(e[n],t)},b.prototype.adjustNonScaledItems=function(e){this.width/=e,this.renderer.adjustNonScaledItems(e)},b.prototype.getMeasureWidths=function(e){this.reset(),this.getFontAndAttr=new p(e.formatting,this.classes),this.getTextSize=new m(this.getFontAndAttr,this.renderer.paper),this.setupTune(e,0),this.constructTuneElements(e);d(this.renderer,e,0,this.space);var t={left:0,measureWidths:[],height:0,total:0};t.height=this.renderer.padding.top+this.renderer.spacing.music+this.renderer.padding.bottom+24;for(var n=0;n<e.lines.length;n++){var i=e.lines[n];if(i.staff){if(i.staffGroup.voices.length>0)for(var a=i.staffGroup.voices[0],s=!1,o=0,c=0;c<a.children.length;c++){var l=a.children[c];s||l.isClef||l.isKeySig||(s=!0,t.left=l.x,o=l.x),"bar"===l.type&&(t.measureWidths.push(l.x-o),t.total+=l.x-o,o=l.x)}t.height+=v(i.staffGroup)*r.STEP}}return t},b.prototype.setupTune=function(e,t){this.classes.reset(),this.renderer.newTune(e),this.engraver=new i(this.getTextSize,t,{bagpipes:e.formatting.bagpipes,flatbeams:e.formatting.flatbeams,graceSlurs:!1!==e.formatting.graceSlurs}),this.engraver.setStemHeight(this.renderer.spacing.stemHeight),this.engraver.measureLength=e.getMeterFraction().num/e.getMeterFraction().den,e.formatting.staffwidth?this.width=1.33*e.formatting.staffwidth:this.width=this.renderer.isPrint?this.staffwidthPrint:this.staffwidthScreen;var n=e.formatting.scale?e.formatting.scale:this.scale;return"resize"===this.responsive&&(n=void 0),void 0===n&&(n=this.renderer.isPrint?.75:1),this.adjustNonScaledItems(n),n},b.prototype.constructTuneElements=function(e){var t,n;e.topText=new l(e.metaText,e.formatting,e.lines,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.getTextSize);var r=!1,i=!1;for(t=0;t<e.lines.length;t++)if((n=e.lines[t]).staff)i=!0,n.staffGroup=this.engraver.createABCLine(n.staff,r?null:e.metaText.tempo,this.getTextSize),r=!0;else if(n.subtitle){if(i){var a=this.width/2+this.renderer.padding.left;n.nonMusic=new c(this.renderer.spacing.subtitle,e.formatting,n.subtitle,a,this.renderer.padding.left,this.getTextSize)}}else void 0!==n.text?(i=!0,n.nonMusic=new s(n.text,n.vskip,this.getFontAndAttr,this.renderer.padding.left,this.width,this.getTextSize)):void 0!==n.separator&&n.separator.lineLength&&(i=!0,n.nonMusic=new o(n.separator.spaceAbove,n.separator.lineLength,n.separator.spaceBelow));e.bottomText=new h(e.metaText,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.getTextSize)},b.prototype.engraveTune=function(e,t){var n=this.setupTune(e,t);this.constructTuneElements(e);var r=d(this.renderer,e,this.width,this.space),i=g(this.renderer,this.classes,e,this.width,r,this.responsive,n,this.selectTypes,t);this.staffgroups=i.staffgroups,this.selectables=i.selectables,u(this)},b.prototype.getDim=function(e){if(!e.dim){var t=e.svgEl.getBBox();e.dim={left:Math.round(t.x),top:Math.round(t.y),right:Math.round(t.x+t.width),bottom:Math.round(t.y+t.height)}}return e.dim},b.prototype.addSelectListener=function(e){this.listeners[this.listeners.length]=e},e.exports=b},function(e,t,n){var r,i=n(6),a=n(39),s=n(40),o=n(41),c=n(42),l=n(43),h=n(44),u=n(45),d=n(48),f=n(5),p=n(2),m=n(1),g=n(49),v=n(50),b=n(19),y=n(51),w=n(52),x=n(53),k=n(0);!function(){"use strict";var e=function(e){var t=0;return e.duration&&(t=e.duration),t},t=!1,n={rest:{0:"rests.whole",1:"rests.half",2:"rests.quarter",3:"rests.8th",4:"rests.16th",5:"rests.32nd",6:"rests.64th",7:"rests.128th",multi:"rests.multimeasure"},note:{"-1":"noteheads.dbl",0:"noteheads.whole",1:"noteheads.half",2:"noteheads.quarter",3:"noteheads.quarter",4:"noteheads.quarter",5:"noteheads.quarter",6:"noteheads.quarter",7:"noteheads.quarter",nostem:"noteheads.quarter"},rhythm:{"-1":"noteheads.slash.whole",0:"noteheads.slash.whole",1:"noteheads.slash.whole",2:"noteheads.slash.quarter",3:"noteheads.slash.quarter",4:"noteheads.slash.quarter",5:"noteheads.slash.quarter",6:"noteheads.slash.quarter",7:"noteheads.slash.quarter",nostem:"noteheads.slash.nostem"},x:{"-1":"noteheads.indeterminate",0:"noteheads.indeterminate",1:"noteheads.indeterminate",2:"noteheads.indeterminate",3:"noteheads.indeterminate",4:"noteheads.indeterminate",5:"noteheads.indeterminate",6:"noteheads.indeterminate",7:"noteheads.indeterminate",nostem:"noteheads.indeterminate"},harmonic:{"-1":"noteheads.harmonic.quarter",0:"noteheads.harmonic.quarter",1:"noteheads.harmonic.quarter",2:"noteheads.harmonic.quarter",3:"noteheads.harmonic.quarter",4:"noteheads.harmonic.quarter",5:"noteheads.harmonic.quarter",6:"noteheads.harmonic.quarter",7:"noteheads.harmonic.quarter",nostem:"noteheads.harmonic.quarter"},uflags:{3:"flags.u8th",4:"flags.u16th",5:"flags.u32nd",6:"flags.u64th"},dflags:{3:"flags.d8th",4:"flags.d16th",5:"flags.d32nd",6:"flags.d64th"}};function A(e,t){var n=e[t];if("note"!==n.el_type||!n.startBeam||n.endBeam)return{count:1,elem:n};for(var r=[];t<e.length&&"note"===e[t].el_type&&(r.push(e[t]),!e[t].endBeam);)t++;return{count:r.length,elem:r}}function T(e){if(e.pitches){S(e);for(var t=0,n=0;n<e.pitches.length;n++)t+=e.pitches[n].verticalPos;e.averagepitch=t/e.pitches.length,e.minpitch=e.pitches[0].verticalPos,e.maxpitch=e.pitches[e.pitches.length-1].verticalPos}}(r=function(e,t,n){this.decoration=new u,this.getTextSize=e,this.tuneNumber=t,this.isBagpipes=n.bagpipes,this.flatBeams=n.flatbeams,this.graceSlurs=n.graceSlurs,this.reset()}).prototype.reset=function(){this.slurs={},this.ties=[],this.voiceScale=1,this.slursbyvoice={},this.tiesbyvoice={},this.endingsbyvoice={},this.scaleByVoice={},this.tripletmultiplier=1,this.abcline=void 0,this.accidentalSlot=void 0,this.accidentalshiftx=void 0,this.dotshiftx=void 0,this.hasVocals=!1,this.minY=void 0,this.partstartelem=void 0,this.startlimitelem=void 0,this.stemdir=void 0},r.prototype.setStemHeight=function(e){this.stemHeight=Math.round(10*e/m.STEP)/10},r.prototype.getCurrentVoiceId=function(e,t){return"s"+e+"v"+t},r.prototype.pushCrossLineElems=function(e,t){this.slursbyvoice[this.getCurrentVoiceId(e,t)]=this.slurs,this.tiesbyvoice[this.getCurrentVoiceId(e,t)]=this.ties,this.endingsbyvoice[this.getCurrentVoiceId(e,t)]=this.partstartelem,this.scaleByVoice[this.getCurrentVoiceId(e,t)]=this.voiceScale},r.prototype.popCrossLineElems=function(e,t){this.slurs=this.slursbyvoice[this.getCurrentVoiceId(e,t)]||{},this.ties=this.tiesbyvoice[this.getCurrentVoiceId(e,t)]||[],this.partstartelem=this.endingsbyvoice[this.getCurrentVoiceId(e,t)],this.voiceScale=this.scaleByVoice[this.getCurrentVoiceId(e,t)],void 0===this.voiceScale&&(this.voiceScale=1)},r.prototype.containsLyrics=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e[t].voices.length;n++)for(var r=0;r<e[t].voices[n].length;r++){var i=e[t].voices[n][r];if(i.lyric)return void(i.positioning&&"below"!==i.positioning.vocalPosition||(this.hasVocals=!0))}},r.prototype.createABCLine=function(e,n,r){this.minY=2,this.containsLyrics(e);var i=new g(this.getTextSize);this.tempoSet=!1;for(var a=0;a<e.length;a++)t&&this.restoreState(),t=!1,this.createABCStaff(i,e[a],n,a);return i},r.prototype.createABCStaff=function(e,t,n,r){e.getTextSize.updateFonts(t);for(var i=0;i<t.voices.length;i++){var a=new w(i,t.voices.length);0===i?(a.barfrom="start"===t.connectBarLines||"continue"===t.connectBarLines,a.barto="continue"===t.connectBarLines||"end"===t.connectBarLines):a.duplicate=!0,t.title&&t.title[i]&&(a.header=t.title[i].replace(/\\n/g,"\n"),a.headerPosition=6+e.getTextSize.baselineToCenter(a.header,"voicefont","staff-extra voice-name",i,t.voices.length)/m.STEP);var l=o(t.clef,this.tuneNumber);l&&(0===i&&t.barNumber&&this.addMeasureNumber(t.barNumber,l),a.addChild(l),this.startlimitelem=l);var u=c(t.key,this.tuneNumber);if(u&&(a.addChild(u),this.startlimitelem=u),t.meter){"specified"===t.meter.type?this.measureLength=t.meter.value[0].num/t.meter.value[0].den:this.measureLength=1;var d=h(t.meter,this.tuneNumber);a.addChild(d),this.startlimitelem=d}a.duplicate&&(a.children=[]);var f=t.clef.stafflines||0===t.clef.stafflines?t.clef.stafflines:5;e.addVoice(a,r,f);var p=1===f;this.createABCVoice(t.voices[i],n,r,i,p,a),e.setStaffLimits(a),0===i&&("start"===t.brace||!e.brace&&t.brace?(e.brace||(e.brace=[]),e.brace.push(new s(a,"brace"))):"end"===t.brace&&e.brace?e.brace[e.brace.length-1].setBottomStaff(a):"continue"===t.brace&&e.brace&&e.brace[e.brace.length-1].continuing(a),"start"===t.bracket||!e.bracket&&t.bracket?(e.bracket||(e.bracket=[]),e.bracket.push(new s(a,"bracket"))):"end"===t.bracket&&e.bracket?e.bracket[e.bracket.length-1].setBottomStaff(a):"continue"===t.bracket&&e.bracket&&e.bracket[e.bracket.length-1].continuing(a))}},r.prototype.createABCVoice=function(e,n,r,a,s,o){this.popCrossLineElems(r,a),this.stemdir=this.isBagpipes?"down":null,this.abcline=e,this.partstartelem&&(this.partstartelem=new d("",null,null),o.addOther(this.partstartelem));var c=o.voicetotal<2?-1:o.voicenumber;for(var h in this.slurs)this.slurs.hasOwnProperty(h)&&(this.slurs[h]=new b({force:this.slurs[h].force,voiceNumber:c,stemDir:this.slurs[h].stemDir,style:this.slurs[h].dotted}),t&&this.slurs[h].setHint(),o.addOther(this.slurs[h]));for(var u=0;u<this.ties.length;u++)this.ties[u]=new b({force:this.ties[u].force,stemDir:this.ties[u].stemDir,voiceNumber:c,style:this.ties[u].dotted}),t&&this.ties[u].setHint(),o.addOther(this.ties[u]);for(var f=0;f<this.abcline.length;f++)T(this.abcline[f]),this.minY=Math.min(this.abcline[f].minpitch,this.minY);for(var p=0===r,m=0;m<this.abcline.length;){var g=A(this.abcline,m),y=this.createABCElement(p,s,o,g.elem);if(y)for(u=0;u<y.length;u++){if(!this.tempoSet&&n&&!n.suppress){this.tempoSet=!0;var w=new i(n,0,0,"tempo",this.tuneNumber,{});w.addFixedX(new v(n,this.tuneNumber,l)),o.addChild(w)}o.addChild(y[u])}m+=g.count}this.pushCrossLineElems(r,a)},r.prototype.saveState=function(){this.tiesSave=k.cloneArray(this.ties),this.slursSave=k.cloneHashOfHash(this.slurs),this.slursbyvoiceSave=k.cloneHashOfHash(this.slursbyvoice),this.tiesbyvoiceSave=k.cloneHashOfArrayOfHash(this.tiesbyvoice)},r.prototype.restoreState=function(){this.ties=k.cloneArray(this.tiesSave),this.slurs=k.cloneHashOfHash(this.slursSave),this.slursbyvoice=k.cloneHashOfHash(this.slursbyvoiceSave),this.tiesbyvoice=k.cloneHashOfArrayOfHash(this.tiesbyvoiceSave)},r.prototype.createABCElement=function(e,n,r,a){var s=[];switch(a.el_type){case void 0:s=this.createBeam(n,r,a);break;case"note":s[0]=this.createNote(a,!1,n,r),this.triplet&&this.triplet.isClosed()&&(r.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1);break;case"bar":s[0]=this.createBarLine(r,a,e),r.duplicate&&s.length>0&&(s[0].invisible=!0);break;case"meter":s[0]=h(a,this.tuneNumber),this.startlimitelem=s[0],r.duplicate&&s.length>0&&(s[0].invisible=!0);break;case"clef":if(s[0]=o(a,this.tuneNumber),!s[0])return null;r.duplicate&&s.length>0&&(s[0].invisible=!0);break;case"key":var u=c(a,this.tuneNumber);u&&(s[0]=u,this.startlimitelem=s[0]),r.duplicate&&s.length>0&&(s[0].invisible=!0);break;case"stem":this.stemdir=a.direction;break;case"part":var d=new i(a,0,0,"part",this.tuneNumber),f=this.getTextSize.calc(a.title,"partsfont","part");d.addFixedX(new p(a.title,0,0,void 0,{type:"part",height:f.height/m.STEP})),s[0]=d;break;case"tempo":var g=new i(a,0,0,"tempo",this.tuneNumber);g.addFixedX(new v(a,this.tuneNumber,l)),s[0]=g;break;case"style":"normal"===a.head?delete this.style:this.style=a.head;break;case"hint":t=!0,this.saveState();break;case"midi":break;case"scale":this.voiceScale=a.size;break;default:var b=new i(a,0,0,"unsupported",this.tuneNumber);b.addFixed(new p("element type "+a.el_type,0,0,void 0,{type:"debug"})),s[0]=b}return s},r.prototype.createBeam=function(e,n,r){var i=[],s=new a(this.stemHeight*this.voiceScale,this.stemdir,this.flatBeams,r[0]);t&&s.setHint();for(var o=0;o<r.length;o++){var c=r[o],l=this.createNote(c,!0,e,n);i.push(l),s.add(l),this.triplet&&this.triplet.isClosed()&&(n.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1)}return s.calcDir(),n.addBeam(s),i};var S=function(e){var t;do{t=!0;for(var n=0;n<e.pitches.length-1;n++)if(e.pitches[n].pitch>e.pitches[n+1].pitch){t=!1;var r=e.pitches[n];e.pitches[n]=e.pitches[n+1],e.pitches[n+1]=r}}while(!t)},M=function(e,t,n,r,i,a,s,o,c){for(var l=n;l>11;l--)l%2!=0||r||e.addFixed(new p(null,o,(i+4)*c,l,{type:"ledger"}));for(l=t;l<1;l++)l%2!=0||r||e.addFixed(new p(null,o,(i+4)*c,l,{type:"ledger"}));for(l=0;l<a.length;l++){var h=i;"down"===s&&(h=-h),e.addFixed(new p(null,h+o,(i+4)*c,a[l],{type:"ledger"}))}};function N(e,t){for(var n=0;n<e.length;n++)if(JSON.stringify(e[n])===JSON.stringify(t))return;e.push(t)}r.prototype.addGraceNotes=function(e,r,i,s,o,c,h){o=Math.round(.7*o);var u,d,m=null;e.gracenotes.length>1&&(m=new a(o,"grace",c),t&&m.setHint(),m.mainNote=i);var g=[];for(d=e.gracenotes.length-1;d>=0;d--)h+=10,g[d]=h,e.gracenotes[d].accidental&&(h+=7);for(d=0;d<e.gracenotes.length;d++){var v=e.gracenotes[d].verticalPos;u=m?null:n.uflags[c?5:3];var y=l(i,"noteheads.quarter",e.gracenotes[d],"up",-g[d],-g[d],u,0,0,.6*this.voiceScale,[],!1);y.notehead.highestVert=y.notehead.pitch+o;var w=y.notehead;if(this.addSlursAndTies(i,e.gracenotes[d],w,r,"up",!0),i.addExtra(w),e.gracenotes[d].acciaccatura){var x=e.gracenotes[d].verticalPos+4.2,k=m?5:6;i.addRight(new p("flags.ugrace",-g[d]+k,0,x,{scalex:.6,scaley:.6}))}if(m){var A=e.gracenotes[d].duration/2;c&&(A/=2);var T={heads:[w],abcelem:{averagepitch:v,minpitch:v,maxpitch:v,duration:A}};m.add(T)}else{var S=v+1/3*.6,N=v+4.2,C=w.dx+w.w;i.addExtra(new p(null,C,0,S,{type:"stem",pitch2:N,linewidth:-.6}))}M(i,v,v,!1,f.getSymbolWidth("noteheads.quarter"),[],!0,w.dx-1,.6);var E=e.rest&&("spacer"===e.rest.type||"invisible"===e.rest.type);0!==d||c||!this.graceSlurs||E||r.addOther(new b({anchor1:w,anchor2:s,isGrace:!0}))}return m&&(m.calcDir(),r.addBeam(m)),h},r.prototype.addNoteToAbcElement=function(t,r,i,a,s,o,c,h,u){var d,m,g,v,b,y=0,w=0,x=0,k=[],A=[],T=0,S=r.averagepitch>=6?"down":"up";for(a&&(S=a),(s=r.style?r.style:s)&&"normal"!==s||(s="note"),(v=o?n[s].nostem:n[s][-c])||console.log("noteSymbol:",s,c,o),b="down"===S?r.pitches.length-2:1;"down"===S?b>=0:b<r.pitches.length;b="down"===S?b-1:b+1){var M=r.pitches["down"===S?b+1:b-1],C=r.pitches[b],E="down"===S?M.pitch-C.pitch:C.pitch-M.pitch;E<=1&&!M.printer_shift&&(C.printer_shift=E?"different":"same",(C.verticalPos>11||C.verticalPos<1)&&k.push(C.verticalPos-C.verticalPos%2),"down"===S?w=f.getSymbolWidth(v)+2:y=f.getSymbolWidth(v)+2)}var I=r.pitches.length;for(b=0;b<r.pitches.length;b++){var _,B;if(!h)_="down"===S&&0!==b||"up"===S&&b!==I-1?null:n["down"===S?"dflags":"uflags"][-c];if(B=r.pitches[b].style?n[r.pitches[b].style][-c]:v,r.pitches[b].highestVert=r.pitches[b].verticalPos,("up"===a||"up"===S)&&0===b||("down"===a||"down"===S)&&b===I-1){if((r.startSlur||1===I)&&(r.pitches[b].highestVert=r.pitches[I-1].verticalPos,e(r)<1&&("up"===a||"up"===S)&&(r.pitches[b].highestVert+=6)),r.startSlur)for(r.pitches[b].startSlur||(r.pitches[b].startSlur=[]),g=0;g<r.startSlur.length;g++)N(r.pitches[b].startSlur,r.startSlur[g]);if(r.endSlur)for(r.pitches[b].highestVert=r.pitches[I-1].verticalPos,e(r)<1&&("up"===a||"up"===S)&&(r.pitches[b].highestVert+=6),r.pitches[b].endSlur||(r.pitches[b].endSlur=[]),g=0;g<r.endSlur.length;g++)N(r.pitches[b].endSlur,r.endSlur[g])}var P=!h&&c<=-1,D=l(t,B,r.pitches[b],S,0,-w,_,i,y,this.voiceScale,A,!a);T=Math.max(f.getSymbolWidth(B),T),t.extraw-=D.extraLeft,(d=D.notehead)&&(this.addSlursAndTies(t,r.pitches[b],d,u,P?S:null,!1),r.gracenotes&&r.gracenotes.length>0&&(d.bottom=d.bottom-1),t.addHead(d)),w+=D.accidentalshiftx,x=Math.max(x,D.dotshiftx)}if(P){var L=Math.round(70*this.voiceScale)/10,O="down"===S?r.minpitch-L:r.minpitch+1/3;O>6&&!a&&(O=6);var H="down"===S?r.maxpitch-1/3:r.maxpitch+L;H<6&&!a&&(H=6);var V="down"===S||0===t.heads.length?0:t.heads[0].w,F="down"===S?1:-1;"noteheads.slash.quarter"===d.c&&("down"===S?H-=1:O+=1),t.addRight(new p(null,V,0,O,{type:"stem",pitch2:H,linewidth:F})),m=Math.min(O,H)}return{noteHead:d,roomTaken:w,roomTakenRight:x,min:m,additionalLedgers:k,dir:S,symbolWidth:T}},r.prototype.addLyric=function(e,t){var n="";k.each(t.lyric,(function(e){var t=" "===e.divider?"":e.divider;n+=e.syllable+t+"\n"}));var r=this.getTextSize.calc(n,"vocalfont","lyric"),i=t.positioning?t.positioning.vocalPosition:"below";e.addCentered(new p(n,0,r.width,void 0,{type:"lyric",position:i,height:r.height/m.STEP,dim:this.getTextSize.attr("vocalfont","lyric")}))},r.prototype.createNote=function(r,a,s,o){var c,h=null,u=0,d=0,m=0,g=[],v=e(r),b=!1;0===v&&(b=!0,v=.25,a=!0);for(var w=Math.floor(Math.log(v)/Math.log(2)),k=0,A=Math.pow(2,w),T=A/2;A<v;k++,A+=T,T/=2);r.startTriplet&&(this.tripletmultiplier=r.tripletMultiplier);var S=v*this.tripletmultiplier;r.rest&&"multimeasure"===r.rest.type&&(S=v);var N=r.rest?"rest":"note",C=new i(r,S,1,N,this.tuneNumber,{durationClassOveride:r.duration*this.tripletmultiplier});if(t&&C.setHint(),r.rest){this.measureLength===v&&"invisible"!==r.rest.type&&"spacer"!==r.rest.type&&"multimeasure"!==r.rest.type&&(r.rest.type="whole");var E=function(e,t,r,i,a,s,o,c,h){var u,d,m,g,v=7;switch(a&&("down"===s&&(v=3),"up"===s&&(v=11)),o&&(v=r<.5||r<1?7:5),t.rest.type){case"whole":u=n.rest[0],t.averagepitch=v,t.minpitch=v,t.maxpitch=v,i=0;break;case"rest":u="rhythm"===t.style?n.rhythm[-c]:n.rest[-c],t.averagepitch=v,t.minpitch=v,t.maxpitch=v;break;case"invisible":case"spacer":u="",t.averagepitch=v,t.minpitch=v,t.maxpitch=v;break;case"multimeasure":u=n.rest.multi,t.averagepitch=v,t.minpitch=v,t.maxpitch=v,i=0;var b=f.getSymbolWidth(u);e.addHead(new p(u,-b,2*b,7));var y=new p(""+t.rest.text,0,b,16,{type:"multimeasure-text"});e.addExtra(y)}if("multimeasure"!==t.rest.type){var w=l(e,u,{verticalPos:v},null,0,0,null,i,0,h,[],!1);(d=w.notehead)&&(e.addHead(d),m=w.accidentalshiftx,g=w.dotshiftx)}return{noteHead:d,roomTaken:m,roomTakenRight:g}}(C,r,v,k,o.voicetotal>1,this.stemdir,s,w,this.voiceScale);h=E.noteHead,u=E.roomTaken,d=E.roomTakenRight}else{var I=this.addNoteToAbcElement(C,r,k,this.stemdir,this.style,b,w,a,o);void 0!==I.min&&(this.minY=Math.min(I.min,this.minY)),h=I.noteHead,u=I.roomTaken,d=I.roomTakenRight,g=I.additionalLedgers,c=I.dir,m=I.symbolWidth}if(void 0!==r.lyric&&this.addLyric(C,r),void 0!==r.gracenotes&&(u+=this.addGraceNotes(r,o,C,h,this.stemHeight*this.voiceScale,this.isBagpipes,u)),r.decoration&&this.decoration.createDecoration(o,r.decoration,C.top,h?h.w:0,C,u,c,C.bottom,r.positioning,this.hasVocals),r.barNumber&&C.addFixed(new p(r.barNumber,-10,0,0,{type:"barNumber"})),M(C,r.minpitch,r.maxpitch,r.rest,m,g,c,-2,1),void 0!==r.chord){var _=x(this.getTextSize,C,r,u,d,m);u=_.roomTaken,d=_.roomTakenRight}return r.startTriplet&&(this.triplet=new y(r.startTriplet,h,{flatBeams:this.flatBeams})),r.endTriplet&&this.triplet&&this.triplet.setCloseAnchor(h),!this.triplet||r.startTriplet||r.endTriplet||r.rest&&"spacer"===r.rest.type||this.triplet.middleNote(h),C},r.prototype.addSlursAndTies=function(e,n,r,i,a,s){if(n.endTie&&this.ties.length>0){for(var o=!1,c=0;c<this.ties.length;c++)if(this.ties[c].anchor1&&this.ties[c].anchor1.pitch===r.pitch){this.ties[c].setEndAnchor(r),this.ties.splice(c,1),o=!0;break}o||(this.ties[0].setEndAnchor(r),this.ties.splice(0,1))}var l,h,u=i.voicetotal<2?-1:i.voicenumber;if(n.startTie){var d=new b({anchor1:r,force:"down"===this.stemdir||"up"===this.stemdir,stemDir:this.stemdir,isGrace:s,voiceNumber:u,style:n.startTie.style});t&&d.setHint(),this.ties[this.ties.length]=d,i.addOther(d),e.startTie=!0}if(n.endSlur)for(var f=0;f<n.endSlur.length;f++)h=n.endSlur[f],this.slurs[h]?((l=this.slurs[h]).setEndAnchor(r),delete this.slurs[h]):(l=new b({anchor2:r,stemDir:this.stemdir,voiceNumber:u}),t&&l.setHint(),i.addOther(l)),this.startlimitelem&&l.setStartX(this.startlimitelem);else if(!s)for(var p in this.slurs)this.slurs.hasOwnProperty(p)&&this.slurs[p].addInternalNote(r);if(n.startSlur)for(f=0;f<n.startSlur.length;f++)h=n.startSlur[f].label,l=new b({anchor1:r,stemDir:this.stemdir,voiceNumber:u,style:n.startSlur[f].style}),t&&l.setHint(),this.slurs[h]=l,i.addOther(l)},r.prototype.addMeasureNumber=function(e,t){var n=this.getTextSize.calc(e,"measurefont","bar-number"),r=n.width>18&&"treble"===t.abcelem.type?-7:0;t.addFixed(new p(e,r,n.width,11+n.height/m.STEP,{type:"barNumber",dim:this.getTextSize.attr("measurefont","bar-number")}))},r.prototype.createBarLine=function(e,t,n){var r=new i(t,0,10,"bar",this.tuneNumber),a=null,s=0;t.barNumber&&this.addMeasureNumber(t.barNumber,r);var o="bar_right_repeat"===t.type||"bar_dbl_repeat"===t.type,c="bar_left_repeat"!==t.type&&"bar_thick_thin"!==t.type&&"bar_invisible"!==t.type,l="bar_right_repeat"===t.type||"bar_dbl_repeat"===t.type||"bar_left_repeat"===t.type||"bar_thin_thick"===t.type||"bar_thick_thin"===t.type,h="bar_left_repeat"===t.type||"bar_thick_thin"===t.type||"bar_thin_thin"===t.type||"bar_dbl_repeat"===t.type,u="bar_left_repeat"===t.type||"bar_dbl_repeat"===t.type;if(o||u){for(var f in this.slurs)this.slurs.hasOwnProperty(f)&&this.slurs[f].setEndX(r);this.startlimitelem=r}if(o&&(r.addRight(new p("dots.dot",s,1,7)),r.addRight(new p("dots.dot",s,1,5)),s+=6),c&&(a=new p(null,s,1,2,{type:"bar",pitch2:10,linewidth:.6}),r.addRight(a)),"bar_invisible"===t.type&&(a=new p(null,s,1,2,{type:"none",pitch2:10,linewidth:.6}),r.addRight(a)),t.decoration&&this.decoration.createDecoration(e,t.decoration,12,l?3:1,r,0,"down",2,t.positioning,this.hasVocals),l&&(a=new p(null,s+=4,4,2,{type:"bar",pitch2:10,linewidth:4}),r.addRight(a),s+=5),this.partstartelem&&t.endEnding&&(this.partstartelem.anchor2=a,this.partstartelem=null),h&&(a=new p(null,s+=3,1,2,{type:"bar",pitch2:10,linewidth:.6}),r.addRight(a)),u&&(s+=3,r.addRight(new p("dots.dot",s,1,7)),r.addRight(new p("dots.dot",s,1,5))),t.startEnding&&n){var m=this.getTextSize.calc(t.startEnding,"repeatfont","").width;r.minspacing+=m+10,this.partstartelem=new d(t.startEnding,a,null),e.addOther(this.partstartelem)}return r.extraw-=5,r}}(),e.exports=r},function(e,t){var n;!function(){"use strict";(n=function(e,t,n,r){this.type="BeamElem",this.isflat=!!n,this.isgrace=!(!t||"grace"!==t),this.forceup=!!(this.isgrace||t&&"up"===t),this.forcedown=!(!t||"down"!==t),this.elems=[],this.total=0,this.average=6,this.allrests=!0,this.stemHeight=e,this.beams=[],r&&r.duration?(this.duration=r.duration,r.startTriplet&&(this.duration*=r.tripletMultiplier),this.duration=Math.round(1e3*this.duration)/1e3):this.duration=0}).prototype.setHint=function(){this.hint=!0},n.prototype.add=function(e){var t=e.abcelem.averagepitch;void 0!==t&&(e.abcelem.rest||(this.allrests=!1),e.beam=this,this.elems.push(e),this.total=Math.round(this.total+t),(void 0===this.min||e.abcelem.minpitch<this.min)&&(this.min=e.abcelem.minpitch),(void 0===this.max||e.abcelem.maxpitch>this.max)&&(this.max=e.abcelem.maxpitch))},n.prototype.addBeam=function(e){this.beams.push(e)},n.prototype.calcDir=function(){var e,t;if(this.average=(e=this.total,(t=this.elems.length)?e/t:0),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{this.stemsUp=this.average<6}for(var n=this.stemsUp?"up":"down",r=0;r<this.elems.length;r++)for(var i=0;i<this.elems[r].heads.length;i++)this.elems[r].heads[i].stemDir=n}}(),e.exports=n},function(e,t){var n=function(e,t){this.startVoice=e,this.type=t};n.prototype.setBottomStaff=function(e){this.endVoice=e,this.startVoice.header&&!this.endVoice.header&&(this.header=this.startVoice.header,delete this.startVoice.header)},n.prototype.continuing=function(e){this.lastContinuedVoice=e},n.prototype.getWidth=function(){return 10},n.prototype.isStartVoice=function(e){return!!(this.startVoice&&this.startVoice.staff&&this.startVoice.staff.voices.length>0&&this.startVoice.staff.voices[0]===e)},e.exports=n},function(e,t,n){var r,i=n(6),a=n(5),s=n(2);!function(){"use strict";r=function(e,t){var n,r=0;e.el_type="clef";var o=new i(e,0,10,"staff-extra clef",t);switch(o.isClef=!0,e.type){case"treble":n="clefs.G";break;case"tenor":case"alto":n="clefs.C";break;case"bass":n="clefs.F";break;case"treble+8":n="clefs.G",r=1;break;case"tenor+8":n="clefs.C",r=1;break;case"bass+8":n="clefs.F",r=1;break;case"alto+8":n="clefs.C",r=1;break;case"treble-8":n="clefs.G",r=-1;break;case"tenor-8":n="clefs.C",r=-1;break;case"bass-8":n="clefs.F",r=-1;break;case"alto-8":n="clefs.C",r=-1;break;case"none":return null;case"perc":n="clefs.perc";break;default:o.addFixed(new s("clef="+e.type,0,0,void 0,{type:"debug"}))}if(n){var c=a.symbolHeightInPitches(n),l=function(e){switch(e){case"clefs.G":return-5;case"clefs.C":case"clefs.F":return-4;case"clefs.perc":return-2;default:return 0}}(n);if(o.addRight(new s(n,5,a.getSymbolWidth(n),e.clefPos,{top:c+e.clefPos+l,bottom:e.clefPos+l})),0!==r){var h=(a.getSymbolWidth(n)-a.getSymbolWidth("8")*(2/3))/2,u=r>0?o.top+3:o.bottom-1,d=r>0?o.top+3:o.bottom-3,f=d-2;"bass-8"===e.type&&(u=3,h=0),o.addRight(new s("8",5+h,a.getSymbolWidth("8")*(2/3),u,{scalex:2/3,scaley:2/3,top:d,bottom:f}))}}return o}}(),e.exports=r},function(e,t,n){var r,i=n(6),a=n(5),s=n(2),o=n(0);!function(){"use strict";r=function(e,t){if(!e.accidentals||0===e.accidentals.length)return null;e.el_type="keySignature";var n=new i(e,0,10,"staff-extra key-signature",t);n.isKeySig=!0;var r=0;return o.each(e.accidentals,(function(e){var t,i=0;switch(e.acc){case"sharp":t="accidentals.sharp",i=-3;break;case"natural":t="accidentals.nat";break;case"flat":t="accidentals.flat",i=-1.2;break;case"quartersharp":t="accidentals.halfsharp",i=-2.5;break;case"quarterflat":t="accidentals.halfflat",i=-1.2;break;default:t="accidentals.flat"}n.addRight(new s(t,r,a.getSymbolWidth(t),e.verticalPos,{thickness:a.symbolHeightInPitches(t),top:e.verticalPos+a.symbolHeightInPitches(t)+i,bottom:e.verticalPos+i})),r+=a.getSymbolWidth(t)+2}),this),n}}(),e.exports=r},function(e,t,n){var r,i=n(5),a=n(2);r=function(e,t,n,r,s,o,c,l,h,u,d,f){var p,m=n.verticalPos,g=0,v=0,b=0;if(void 0===t)e.addFixed(new a("pitch is undefined",0,0,0,{type:"debug"}));else if(""===t)p=new a(null,0,0,m);else{var y=s;if(n.printer_shift){var w="same"===n.printer_shift?1:0;y="down"===r?-i.getSymbolWidth(t)*u+w:i.getSymbolWidth(t)*u-w}var x={scalex:u,scaley:u,thickness:i.symbolHeightInPitches(t)*u};if((p=new a(t,y,i.getSymbolWidth(t)*u,m,x)).stemDir=r,c){var k=m+("down"===r?-7:7)*u;f&&("down"===r&&k>6&&(k=6),"up"===r&&k<6&&(k=6));var A="down"===r?s:s+p.w-.6;e.addRight(new a(c,A,i.getSymbolWidth(c)*u,k,{scalex:u,scaley:u}))}for(v=p.w+h-2+5*l;l>0;l--){var T=1-Math.abs(m)%2;e.addRight(new a("dots.dot",p.w+h-2+5*l,i.getSymbolWidth("dots.dot"),m+T))}}if(p&&(p.highestVert=n.highestVert),n.accidental){var S;switch(n.accidental){case"quartersharp":S="accidentals.halfsharp";break;case"dblsharp":S="accidentals.dblsharp";break;case"sharp":S="accidentals.sharp";break;case"quarterflat":S="accidentals.halfflat";break;case"flat":S="accidentals.flat";break;case"dblflat":S="accidentals.dblflat";break;case"natural":S="accidentals.nat"}for(var M=!1,N=o,C=0;C<d.length;C++)if(m-d[C][0]>=6){d[C][0]=m,N=d[C][1],M=!0;break}!1===M&&(N-=i.getSymbolWidth(S)*u+2,d.push([m,N]),g=i.getSymbolWidth(S)*u+2);var E=i.symbolHeightInPitches(S);e.addExtra(new a(S,N,i.getSymbolWidth(S),m,{scalex:u,scaley:u,top:m+E/2,bottom:m-E/2})),b=i.getSymbolWidth(S)/2}return{notehead:p,accidentalshiftx:g,dotshiftx:v,extraLeft:b}},e.exports=r},function(e,t,n){var r,i=n(6),a=n(5),s=n(2);!function(){"use strict";r=function(e,t){e.el_type="timeSignature";var n=new i(e,0,10,"staff-extra time-signature",t);if("specified"===e.type)for(var r=0,o=0;o<e.value.length;o++)if(0!==o&&(n.addRight(new s("+",r+1,a.getSymbolWidth("+"),6,{thickness:a.symbolHeightInPitches("+")})),r+=a.getSymbolWidth("+")+2),e.value[o].den){for(var c=0,l=0;l<e.value[o].num.length;l++)c+=a.getSymbolWidth(e.value[o].num.charAt(l));var h=0;for(l=0;l<e.value[o].num.length;l++)h+=a.getSymbolWidth(e.value[o].den.charAt(l));var u=Math.max(c,h);n.addRight(new s(e.value[o].num,r+(u-c)/2,c,8,{thickness:a.symbolHeightInPitches(e.value[o].num.charAt(0))})),n.addRight(new s(e.value[o].den,r+(u-h)/2,h,4,{thickness:a.symbolHeightInPitches(e.value[o].den.charAt(0))})),r+=u}else{for(var d=0,f=0;f<e.value[o].num.length;f++)d+=a.getSymbolWidth(e.value[o].num.charAt(f));n.addRight(new s(e.value[o].num,r,d,6,{thickness:a.symbolHeightInPitches(e.value[o].num.charAt(0))})),r+=d}else"common_time"===e.type?n.addRight(new s("timesig.common",0,a.getSymbolWidth("timesig.common"),6,{thickness:a.symbolHeightInPitches("timesig.common")})):"cut_time"===e.type?n.addRight(new s("timesig.cut",0,a.getSymbolWidth("timesig.cut"),6,{thickness:a.symbolHeightInPitches("timesig.cut")})):"tempus_imperfectum"===e.type?n.addRight(new s("timesig.imperfectum",0,a.getSymbolWidth("timesig.imperfectum"),6,{thickness:a.symbolHeightInPitches("timesig.imperfectum")})):"tempus_imperfectum_prolatio"===e.type?n.addRight(new s("timesig.imperfectum2",0,a.getSymbolWidth("timesig.imperfectum2"),6,{thickness:a.symbolHeightInPitches("timesig.imperfectum2")})):"tempus_perfectum"===e.type?n.addRight(new s("timesig.perfectum",0,a.getSymbolWidth("timesig.perfectum"),6,{thickness:a.symbolHeightInPitches("timesig.perfectum")})):"tempus_perfectum_prolatio"===e.type?n.addRight(new s("timesig.perfectum2",0,a.getSymbolWidth("timesig.perfectum2"),6,{thickness:a.symbolHeightInPitches("timesig.perfectum2")})):console.log("time signature:",e);return n}}(),e.exports=r},function(e,t,n){var r,i=n(46),a=n(47),s=n(5),o=n(2),c=n(19);!function(){"use strict";var e=function(e,t,n,r,i){function a(e,t){var a="down"===i?function(){if(0===r.heads.length)return 2;for(var e=r.heads[0].pitch,t=1;t<r.heads.length;t++)e=Math.min(e,r.heads[t].pitch);return e}()+1:function(){if(0===r.heads.length)return 10;for(var e=r.heads[0].pitch,t=1;t<r.heads.length;t++)e=Math.max(e,r.heads[t].pitch);return e}()+9;"down"!==i&&1===t&&a--;var c=n/2;c+="down"===i?-5:3;for(var l=0;l<t;l++)a-=1,r.addFixedX(new o(e,c,s.getSymbolWidth(e),a))}for(var c=0;c<e.length;c++)switch(e[c]){case"/":a("flags.ugrace",1);break;case"//":a("flags.ugrace",2);break;case"///":a("flags.ugrace",3);break;case"////":a("flags.ugrace",4)}};(r=function(){this.startDiminuendoX=void 0,this.startCrescendoX=void 0,this.minTop=12,this.minBottom=0}).prototype.dynamicDecoration=function(e,t,n,r){for(var i,s,o=0;o<t.length;o++)switch(t[o]){case"diminuendo(":this.startDiminuendoX=n,i=void 0;break;case"diminuendo)":i={start:this.startDiminuendoX,stop:n},this.startDiminuendoX=void 0;break;case"crescendo(":this.startCrescendoX=n,s=void 0;break;case"crescendo)":s={start:this.startCrescendoX,stop:n},this.startCrescendoX=void 0}i&&e.addOther(new a(i.start,i.stop,">",r)),s&&e.addOther(new a(s.start,s.stop,"<",r))},r.prototype.createDecoration=function(t,n,r,a,l,h,u,d,f,p){f||(f={ornamentPosition:"above",volumePosition:p?"above":"below",dynamicPosition:p?"above":"below"}),function(e,t,n,r){for(var a=0;a<t.length;a++)switch(t[a]){case"p":case"mp":case"pp":case"ppp":case"pppp":case"f":case"ff":case"fff":case"ffff":case"sfz":case"mf":var s=new i(n,t[a],r);e.addOther(s)}}(t,n,l,f.volumePosition),this.dynamicDecoration(t,n,l,f.dynamicPosition),e(n,0,a,l,u);var m=function(e,t,n,r,i,a,l,h){for(var u,d=0;d<t.length;d++){if("staccato"===t[d]||"tenuto"===t[d]||"accent"===t[d]){var f="scripts."+t[d];if("accent"===t[d]&&(f="scripts.sforzato"),u=void 0===u?"down"===l?n+2:h-2:"down"===l?u+2:u-2,"accent"===t[d])"up"===l?u--:u++;else switch(u){case 2:case 4:case 6:case 8:case 10:"up"===l?u--:u++}n>9&&u++;var p=r/2;"center"!==s.getSymbolAlign(f)&&(p-=s.getSymbolWidth(f)/2),i.addFixedX(new o(f,p,s.getSymbolWidth(f),u))}if("slide"===t[d]&&i.heads[0]){var m=i.heads[0].pitch,g=new o("",-a-15,0,(m-=2)-1),v=new o("",-a-5,0,m+1);i.addFixedX(g),i.addFixedX(v),e.addOther(new c({anchor1:g,anchor2:v,fixedY:!0}))}}return void 0===u&&(u=n),{above:u,below:i.bottom}}(t,n,r,a,l,h,u,d);m.above=Math.max(m.above,this.minTop);!function(e,t,n,r,i,a,c){function l(e,t){"above"===e?r.above+=t:r.below-=t}function h(e){var t;return"above"===e?(t=r.above)<a&&(t=a):(t=r.below)>c&&(t=c),t}function u(e,r){var i=h(r);n.addFixedX(new o(e,t/2,0,i+2,{type:"decoration",klass:"ornament",thickness:3})),l(r,5)}function d(e,r){var i=t/2;"center"!==s.getSymbolAlign(e)&&(i-=s.getSymbolWidth(e)/2);var a=s.symbolHeightInPitches(e)+1,c=h(r);c="above"===r?c+a/2:c-a/2,n.addFixedX(new o(e,i,s.getSymbolWidth(e),c,{klass:"ornament",thickness:s.symbolHeightInPitches(e)})),l(r,a)}for(var f={"+":"scripts.stopped",open:"scripts.open",snap:"scripts.snap",wedge:"scripts.wedge",thumb:"scripts.thumb",shortphrase:"scripts.shortphrase",mediumphrase:"scripts.mediumphrase",longphrase:"scripts.longphrase",trill:"scripts.trill",roll:"scripts.roll",irishroll:"scripts.roll",marcato:"scripts.umarcato",dmarcato:"scripts.dmarcato",umarcato:"scripts.umarcato",turn:"scripts.turn",uppermordent:"scripts.prall",pralltriller:"scripts.prall",mordent:"scripts.mordent",lowermordent:"scripts.mordent",downbow:"scripts.downbow",upbow:"scripts.upbow",fermata:"scripts.ufermata",invertedfermata:"scripts.dfermata",breath:",",coda:"scripts.coda",segno:"scripts.segno"},p=!1,m=0;m<e.length;m++)switch(e[m]){case"0":case"1":case"2":case"3":case"4":case"5":case"D.C.":case"D.S.":u(e[m],i),p=!0;break;case"fine":u("FINE",i),p=!0;break;case"+":case"open":case"snap":case"wedge":case"thumb":case"shortphrase":case"mediumphrase":case"longphrase":case"trill":case"roll":case"irishroll":case"marcato":case"dmarcato":case"turn":case"uppermordent":case"pralltriller":case"mordent":case"lowermordent":case"downbow":case"upbow":case"fermata":case"breath":case"umarcato":case"coda":case"segno":d(f[e[m]],i),p=!0;break;case"invertedfermata":d(f[e[m]],"below"),p=!0;break;case"mark":n.klass="mark"}}(n,a,l,m,f.ornamentPosition,this.minTop,this.minBottom);!function(e,t,n){for(var r=0;r<e.length;r++)switch(e[r]){case"arpeggio":for(var i=t.abcelem.minpitch-1;i<=t.abcelem.maxpitch;i+=2)t.addExtra(new o("scripts.arpeggio",2*-s.getSymbolWidth("scripts.arpeggio")-n,0,i+2,{klass:"ornament",thickness:s.symbolHeightInPitches("scripts.arpeggio")}))}}(n,l,h)}}(),e.exports=r},function(e,t){e.exports=function(e,t,n){this.type="DynamicDecoration",this.anchor=e,this.dec=t,"below"===n?this.volumeHeightBelow=6:this.volumeHeightAbove=6,this.pitch=void 0}},function(e,t){e.exports=function(e,t,n,r){this.type="CrescendoElem",this.anchor1=e,this.anchor2=t,this.dir=n,"above"===r?this.dynamicHeightAbove=6:this.dynamicHeightBelow=6,this.pitch=void 0}},function(e,t){e.exports=function(e,t,n){this.type="EndingElem",this.text=e,this.anchor1=t,this.anchor2=n,this.endingHeightAbove=5,this.pitch=void 0}},function(e,t,n){var r=n(20),i=function(e){this.getTextSize=e,this.voices=[],this.staffs=[],this.brace=void 0,this.bracket=void 0};i.prototype.setLimit=function(e,t){t.specialY[e]&&(t.staff.specialY[e]?t.staff.specialY[e]=Math.max(t.staff.specialY[e],t.specialY[e]):t.staff.specialY[e]=t.specialY[e])},i.prototype.addVoice=function(e,t,n){var r=this.voices.length;this.voices[r]=e,this.staffs[t]?this.staffs[t].voices.push(r):this.staffs[this.staffs.length]={top:10,bottom:2,lines:n,voices:[r],specialY:{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}},e.staff=this.staffs[t]},i.prototype.setHeight=function(){this.height=r(this)},i.prototype.setWidth=function(e){this.w=e;for(var t=0;t<this.voices.length;t++)this.voices[t].setWidth(e)},i.prototype.setStaffLimits=function(e){e.staff.top=Math.max(e.staff.top,e.top),e.staff.bottom=Math.min(e.staff.bottom,e.bottom),this.setLimit("tempoHeightAbove",e),this.setLimit("partHeightAbove",e),this.setLimit("volumeHeightAbove",e),this.setLimit("dynamicHeightAbove",e),this.setLimit("endingHeightAbove",e),this.setLimit("chordHeightAbove",e),this.setLimit("lyricHeightAbove",e),this.setLimit("lyricHeightBelow",e),this.setLimit("chordHeightBelow",e),this.setLimit("volumeHeightBelow",e),this.setLimit("dynamicHeightBelow",e)},e.exports=i},function(e,t,n){var r,i=n(6),a=n(2);!function(){"use strict";(r=function(e,t,n){this.type="TempoElement",this.tempo=e,this.tempo.type="tempo",this.tuneNumber=t,this.totalHeightInPitches=6,this.tempoHeightAbove=this.totalHeightInPitches,this.pitch=void 0,this.tempo.duration&&!this.tempo.suppressBpm&&(this.note=this.createNote(n,e,t))}).prototype.setX=function(e){this.x=e},r.prototype.createNote=function(e,t,n){var r,s,o,c=t.duration[0],l=new i(t,c,1,"tempo",n);c<=1/32?(o="noteheads.quarter",s="flags.u32nd",r=0):c<=1/16?(o="noteheads.quarter",s="flags.u16th",r=0):c<=3/32?(o="noteheads.quarter",s="flags.u16nd",r=1):c<=1/8?(o="noteheads.quarter",s="flags.u8th",r=0):c<=3/16?(o="noteheads.quarter",s="flags.u8th",r=1):c<=1/4?(o="noteheads.quarter",r=0):c<=3/8?(o="noteheads.quarter",r=1):c<=.5?(o="noteheads.half",r=0):c<=3/4?(o="noteheads.half",r=1):c<=1?(o="noteheads.whole",r=0):c<=1.5?(o="noteheads.whole",r=1):c<=2?(o="noteheads.dbl",r=0):(o="noteheads.dbl",r=1);var h,u=e(l,o,{verticalPos:0},"up",0,0,s,r,0,.75,[],!1).notehead;if(l.addHead(u),"noteheads.whole"!==o&&"noteheads.dbl"!==o){var d=u.dx+u.w;h=new a(null,d,0,.25,{type:"stem",pitch2:3.75,linewidth:-.6}),l.addRight(h)}return l}}(),e.exports=r},function(e,t){var n;!function(){"use strict";(n=function(e,t,n){this.type="TripletElem",this.anchor1=t,this.number=e,this.durationClass=("d"+Math.round(1e3*t.parent.durationClass)/1e3).replace(/\./,"-"),this.middleElems=[],this.flatBeams=n.flatBeams}).prototype.isClosed=function(){return!!this.anchor2},n.prototype.middleNote=function(e){this.middleElems.push(e)},n.prototype.setCloseAnchor=function(e){this.anchor2=e,this.anchor1.parent.beam&&(this.endingHeightAbove=4)}}(),e.exports=n},function(e,t){var n=function(e,t){this.children=[],this.beams=[],this.otherchildren=[],this.w=0,this.duplicate=!1,this.voicenumber=e,this.voicetotal=t,this.bottom=7,this.top=7,this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};n.prototype.addChild=function(e){if("bar"===e.type){for(var t=!0,n=0;t&&n<this.children.length;n++)this.children[n].type.indexOf("staff-extra")<0&&"tempo"!==this.children[n].type&&(t=!1);t||(this.beams.push("bar"),this.otherchildren.push("bar"))}this.children[this.children.length]=e,this.setRange(e)},n.prototype.setLimit=function(e,t){var n=t.specialY;n||(n=t),n[e]&&(this.specialY[e]?this.specialY[e]=Math.max(this.specialY[e],n[e]):this.specialY[e]=n[e])},n.prototype.adjustRange=function(e){void 0!==e.bottom&&(this.bottom=Math.min(this.bottom,e.bottom)),void 0!==e.top&&(this.top=Math.max(this.top,e.top))},n.prototype.setRange=function(e){this.adjustRange(e),this.setLimit("tempoHeightAbove",e),this.setLimit("partHeightAbove",e),this.setLimit("volumeHeightAbove",e),this.setLimit("dynamicHeightAbove",e),this.setLimit("endingHeightAbove",e),this.setLimit("chordHeightAbove",e),this.setLimit("lyricHeightAbove",e),this.setLimit("lyricHeightBelow",e),this.setLimit("chordHeightBelow",e),this.setLimit("volumeHeightBelow",e),this.setLimit("dynamicHeightBelow",e)},n.prototype.addOther=function(e){this.otherchildren.push(e),this.setRange(e)},n.prototype.addBeam=function(e){this.beams.push(e)},n.prototype.setWidth=function(e){this.w=e},e.exports=n},function(e,t,n){var r,i=n(2),a=n(1);!function(){"use strict";r=function(e,t,n,r,s,o){for(var c=0;c<n.chord.length;c++)for(var l=n.chord[c].position,h=n.chord[c].rel_position,u=n.chord[c].name.split("\n"),d=u.length-1;d>=0;d--){var f,p,m,g=u[d],v=0;"left"===l||"right"===l||"below"===l||"above"===l?(p="annotationfont",m="annotation"):(p="gchordfont",m="chord");var b=e.attr(p,m),y=e.calc(g,p,m),w=y.width,x=y.height/a.STEP;switch(l){case"left":v=-(r+=w+7),f=n.averagepitch,t.addExtra(new i(g,v,w+4,f,{type:"text",height:x,dim:b,position:"left"}));break;case"right":v=s+=4,f=n.averagepitch,t.addRight(new i(g,v,w+4,f,{type:"text",height:x,dim:b,position:"right"}));break;case"below":t.addRight(new i(g,0,0,void 0,{type:"text",position:"below",height:x,dim:b,realWidth:w}));break;case"above":t.addRight(new i(g,0,0,void 0,{type:"text",position:"above",height:x,dim:b,realWidth:w}));break;default:if(h){var k=h.y+3*a.STEP;t.addRight(new i(g,v+h.x,0,n.minpitch+k/a.STEP,{position:"relative",type:"text",height:x,dim:b}))}else{var A="above";n.positioning&&n.positioning.chordPosition&&(A=n.positioning.chordPosition),"hidden"!==A&&t.addCentered(new i(g,o/2,w,void 0,{type:"chord",position:A,height:x,dim:b,realWidth:w}))}}}return{roomTaken:r,roomTakenRight:s}}}(),e.exports=r},function(e,t,n){var r=n(1),i=n(55),a=(n(6),function(e){this.paper=new i(e),this.controller=null,this.space=3*r.SPACE,this.padding={},this.reset()});a.prototype.reset=function(){this.paper.clear(),this.y=0,this.abctune=null,this.path=null,this.isPrint=!1,this.initVerticalSpace()},a.prototype.newTune=function(e){this.abctune=e,this.setVerticalSpace(e.formatting),this.isPrint="print"===e.media,this.setPadding(e)},a.prototype.setPaddingOverride=function(e){this.paddingOverride={top:e.paddingtop,bottom:e.paddingbottom,right:e.paddingright,left:e.paddingleft}},a.prototype.setPadding=function(e){function t(t,n,r,i,a){void 0!==e.formatting[r]?t.padding[n]=e.formatting[r]:void 0!==t.paddingOverride[n]?t.padding[n]=t.paddingOverride[n]:t.isPrint?t.padding[n]=i:t.padding[n]=a}t(this,"top","topmargin",38,15),t(this,"bottom","botmargin",38,15),t(this,"left","leftmargin",68,15),t(this,"right","rightmargin",68,15)},a.prototype.adjustNonScaledItems=function(e){this.padding.top/=e,this.padding.bottom/=e,this.padding.left/=e,this.padding.right/=e,this.abctune.formatting.headerfont.size/=e,this.abctune.formatting.footerfont.size/=e},a.prototype.initVerticalSpace=function(){this.spacing={composer:7.56,graceBefore:8.67,graceInside:10.67,graceAfter:16,info:0,lineSkipFactor:1.1,music:7.56,paragraphSkipFactor:.4,parts:11.33,slurHeight:1,staffSeparation:61.33,stemHeight:36.67,subtitle:3.78,systemStaffSeparation:48,text:18.9,title:7.56,top:30.24,vocal:0,words:0}},a.prototype.setVerticalSpace=function(e){void 0!==e.staffsep&&(this.spacing.staffSeparation=4*e.staffsep/3),void 0!==e.composerspace&&(this.spacing.composer=4*e.composerspace/3),void 0!==e.partsspace&&(this.spacing.parts=4*e.partsspace/3),void 0!==e.textspace&&(this.spacing.text=4*e.textspace/3),void 0!==e.musicspace&&(this.spacing.music=4*e.musicspace/3),void 0!==e.titlespace&&(this.spacing.title=4*e.titlespace/3),void 0!==e.sysstaffsep&&(this.spacing.systemStaffSeparation=4*e.sysstaffsep/3),void 0!==e.subtitlespace&&(this.spacing.subtitle=4*e.subtitlespace/3),void 0!==e.topspace&&(this.spacing.top=4*e.topspace/3),void 0!==e.vocalspace&&(this.spacing.vocal=4*e.vocalspace/3),void 0!==e.wordsspace&&(this.spacing.words=4*e.wordsspace/3)},a.prototype.calcY=function(e){return this.y-e*r.STEP},a.prototype.moveY=function(e,t){void 0===t&&(t=1),this.y+=e*t},e.exports=a},function(e,t){var n="http://www.w3.org/2000/svg";function r(e){this.svg=o(),e.appendChild(this.svg)}function i(e,t,n){var r=n-e;return"M "+e+" "+t+" l "+r+" 0 l 0 1 l "+-r+" 0 z "}function a(e,t,n){var r=n-t;return"M "+e+" "+t+" l 0 "+r+" l 1 0 l 0 "+-r+" z "}r.prototype.clear=function(){if(this.svg){var e=this.svg.parentNode;this.svg=o(),e&&(e.innerHTML="",e.appendChild(this.svg))}},r.prototype.setTitle=function(e){var t=document.createElement("title"),n=document.createTextNode(e);t.appendChild(n),this.svg.insertBefore(t,this.svg.firstChild)},r.prototype.setResponsiveWidth=function(e,t){if(this.svg.setAttribute("viewBox","0 0 "+e+" "+t),this.svg.setAttribute("preserveAspectRatio","xMinYMin meet"),this.svg.removeAttribute("height"),this.svg.removeAttribute("width"),this.svg.style.display="inline-block",this.svg.style.position="absolute",this.svg.style.top="0",this.svg.style.left="0",this.svg.parentNode){var n=this.svg.parentNode.getAttribute("class");n?n.indexOf("abcjs-container")<0&&this.svg.parentNode.setAttribute("class",n+" abcjs-container"):this.svg.parentNode.setAttribute("class","abcjs-container"),this.svg.parentNode.style.display="inline-block",this.svg.parentNode.style.position="relative",this.svg.parentNode.style.width="100%";var r=t/e*100;this.svg.parentNode.style["padding-bottom"]=r+"%",this.svg.parentNode.style["vertical-align"]="middle",this.svg.parentNode.style.overflow="hidden"}},r.prototype.setSize=function(e,t){this.svg.setAttribute("width",e),this.svg.setAttribute("height",t)},r.prototype.setScale=function(e){1!==e?(this.svg.style.transform="scale("+e+","+e+")",this.svg.style["-ms-transform"]="scale("+e+","+e+")",this.svg.style["-webkit-transform"]="scale("+e+","+e+")",this.svg.style["transform-origin"]="0 0",this.svg.style["-ms-transform-origin-x"]="0",this.svg.style["-ms-transform-origin-y"]="0",this.svg.style["-webkit-transform-origin-x"]="0",this.svg.style["-webkit-transform-origin-y"]="0"):(this.svg.style.transform="",this.svg.style["-ms-transform"]="",this.svg.style["-webkit-transform"]="")},r.prototype.insertStyles=function(e){var t=document.createElementNS(n,"style");t.textContent=e,this.svg.insertBefore(t,this.svg.firstChild)},r.prototype.setParentStyles=function(e){for(var t in e)e.hasOwnProperty(t)&&this.svg.parentNode&&(this.svg.parentNode.style[t]=e[t]);this.dummySvg&&(document.querySelector("body").removeChild(this.dummySvg),this.dummySvg=null)},r.prototype.rect=function(e){var t=[],n=e.x,r=e.y,s=e.x+e.width,o=e.y+e.height;return t.push(i(n,r,s)),t.push(i(n,o,s)),t.push(a(s,r,o)),t.push(a(n,o,r)),this.path({path:t.join(" "),stroke:"none"})},r.prototype.dottedLine=function(e){var t=document.createElementNS(n,"line");t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2),t.setAttribute("stroke",e.stroke),t.setAttribute("stroke-dasharray","5,5"),this.svg.insertBefore(t,this.svg.firstChild)},r.prototype.rectBeneath=function(e){var t=document.createElementNS(n,"rect");t.setAttribute("x",e.x),t.setAttribute("width",e.width),t.setAttribute("y",e.y),t.setAttribute("height",e.height),e.stroke&&t.setAttribute("stroke",e.stroke),e["stroke-opacity"]&&t.setAttribute("stroke-opacity",e["stroke-opacity"]),e.fill&&t.setAttribute("fill",e.fill),e["fill-opacity"]&&t.setAttribute("fill-opacity",e["fill-opacity"]),this.svg.insertBefore(t,this.svg.firstChild)},r.prototype.text=function(e,t,r){var i=document.createElementNS(n,"text");for(var a in t)t.hasOwnProperty(a)&&i.setAttribute(a,t[a]);for(var s=(""+e).split("\n"),o=0;o<s.length;o++){var c=document.createElementNS(n,"tspan");c.textContent=s[o],c.setAttribute("x",t.x?t.x:0),0!==o&&c.setAttribute("dy","1.2em"),i.appendChild(c)}return r?r.appendChild(i):this.append(i),i},r.prototype.guessWidth=function(e,t){var n,r=this.createDummySvg(),i=this.text(e,t,r);try{n=i.getBBox(),n=isNaN(n.height)||!n.height?{width:t["font-size"]/2,height:t["font-size"]+2}:{width:n.width,height:n.height}}catch(e){n={width:t["font-size"]/2,height:t["font-size"]+2}}return r.removeChild(i),n},r.prototype.createDummySvg=function(){if(!this.dummySvg){this.dummySvg=o();this.dummySvg.setAttribute("style",["display: block !important;","height: 1px;","width: 1px;","position: absolute;"].join("")),document.querySelector("body").appendChild(this.dummySvg)}return this.dummySvg};var s={};function o(){var e=document.createElementNS(n,"svg");return e.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),e.setAttribute("role","img"),e}r.prototype.getTextSize=function(e,t,n){if("number"==typeof e&&(e=""+e),!e||e.match(/^\s+$/))return{width:0,height:0};var r;if(e.length<20&&(r=e+JSON.stringify(t),s[r]))return s[r];var i,a=!n;n||(n=this.text(e,t));try{i=n.getBBox(),i=isNaN(i.height)||!i.height?this.guessWidth(e,t):{width:i.width,height:i.height}}catch(n){i=this.guessWidth(e,t)}return a&&(this.currentGroup?this.currentGroup.removeChild(n):this.svg.removeChild(n)),r&&(s[r]=i),i},r.prototype.openGroup=function(e){e=e||{};var t=document.createElementNS(n,"g");return e.klass&&t.setAttribute("class",e.klass),e.fill&&t.setAttribute("fill",e.fill),e.stroke&&t.setAttribute("stroke",e.stroke),e.prepend?this.svg.insertBefore(t,this.svg.firstChild):this.svg.appendChild(t),this.currentGroup=t,t},r.prototype.closeGroup=function(){var e=this.currentGroup;return this.currentGroup=null,e},r.prototype.path=function(e){var t=document.createElementNS(n,"path");for(var r in e)e.hasOwnProperty(r)&&("path"===r?t.setAttributeNS(null,"d",e.path):t.setAttributeNS(null,r,e[r]));return this.append(t),t},r.prototype.pathToBack=function(e){var t=document.createElementNS(n,"path");for(var r in e)e.hasOwnProperty(r)&&("path"===r?t.setAttributeNS(null,"d",e.path):t.setAttributeNS(null,r,e[r]));return this.prepend(t),t},r.prototype.append=function(e){this.currentGroup?this.currentGroup.appendChild(e):this.svg.appendChild(e)},r.prototype.prepend=function(e){this.currentGroup?this.currentGroup.appendChild(e):this.svg.insertBefore(e,this.svg.firstChild)},r.prototype.setAttributeOnElement=function(e,t){for(var n in t)t.hasOwnProperty(n)&&e.setAttributeNS(null,n,t[n])},r.prototype.moveElementToChild=function(e,t){e.appendChild(t)},e.exports=r},function(e,t){e.exports=function(e,t,n,r,i,a){var s;this.rows=[],t&&this.rows.push({move:t});var o=n.calc("textfont","defined-text");if(""===e)this.rows.push({move:2*o.attr["font-size"]});else if("string"==typeof e)this.rows.push({move:o.attr["font-size"]/2}),this.rows.push({left:r,text:e,font:"textfont",klass:"defined-text",anchor:"start",absElemType:"freeText"}),s=a.calc(e,"textfont","defined-text"),this.rows.push({move:s.height});else for(var c="textfont",l=!1,h=0;h<e.length;h++){c=e[h].font?e[h].font:"textfont",e[h].center&&(l=!0);var u=l?"middle":"start",d=l?i/2:r;this.rows.push({left:d,text:e[h].text,font:c,klass:"defined-text",anchor:u,absElemType:"freeText"}),s=a.calc(e[h].text,c,"defined-text"),this.rows.push({move:s.height})}}},function(e,t){e.exports=function(e,t,n){this.rows=[],e&&this.rows.push({move:e}),this.rows.push({separator:t}),n&&this.rows.push({move:n})}},function(e,t){e.exports=function(e,t,n,r,i,a){this.rows=[],e&&this.rows.push({move:e});var s=t.titleleft?"start":"middle";t.titleleft,this.rows.push({left:r,text:n,font:"subtitlefont",klass:"text subtitle",anchor:s});var o=a.calc(n,"subtitlefont","text subtitle");this.rows.push({move:o.height})}},function(e,t){function n(e,t,n,r,i,a,s,o){if(this.rows=[],e.header&&i){var c=o.calc("XXXX","headerfont","abcjs-header abcjs-meta-top").height;this.addTextIf(a,e.header.left,"headerfont","header meta-top",-c,0,"start",o),this.addTextIf(a+r/2,e.header.center,"headerfont","header meta-top",-c,null,"middle",o),this.addTextIf(a+r,e.header.right,"headerfont","header meta-top",-c,null,"end",o)}i&&this.rows.push({move:s.top});var l=t.titleleft?"start":"middle",h=t.titleleft?a:a+r/2;if(e.title&&this.addTextIf(h,e.title,"titlefont","title meta-top",s.title,0,l,o,"title"),n[0]&&n[0].subtitle&&this.addTextIf(h,n[0].subtitle,"subtitlefont","text meta-top subtitle",s.subtitle,0,l,o,"subtitle"),e.rhythm||e.origin||e.composer){if(this.rows.push({move:s.composer}),e.rhythm&&e.rhythm.length>0){var u=!(!e.composer&&!e.origin);this.addTextIf(a,e.rhythm,"infofont","meta-top rhythm",0,null,"start",o,"rhythm",u)}var d="";e.composer&&(d+=e.composer),e.origin&&(d+=" ("+e.origin+")"),d.length>0&&this.addTextIf(a+r,d,"composerfont","meta-top composer",0,null,"end",o,"composer")}e.author&&e.author.length>0&&this.addTextIf(a+r,e.author,"composerfont","meta-top author",0,0,"end",o,"author"),e.partOrder&&e.partOrder.length>0&&this.addTextIf(a,e.partOrder,"partsfont","meta-top part-order",0,0,"start",o,"partOrder")}n.prototype.addTextIf=function(e,t,n,r,i,a,s,o,c,l){if(t&&(i&&this.rows.push({move:i}),this.rows.push({left:e,text:t,font:n,klass:r,anchor:s,absElemType:c}),!l)){var h=o.calc(t,n,r);this.rows.push({move:h.height}),a&&this.rows.push({move:a})}},e.exports=n},function(e,t){function n(e,t,n,r,i,a){this.rows=[],e.unalignedWords&&e.unalignedWords.length>0&&this.unalignedWords(e.unalignedWords,r,i,a),this.extraText(e,r,i,a),e.footer&&n&&this.footer(e.footer,r,a)}n.prototype.unalignedWords=function(e,t,n,r){var i="meta-bottom unaligned-words";this.rows.push({startGroup:"unalignedWords",klass:"abcjs-meta-bottom abcjs-unaligned-words"});var a=r.calc("i","wordsfont",i);this.rows.push({move:n.words});for(var s=0;s<e.length;s++)if(""===e[s])this.rows.push({move:a.height});else if("string"==typeof e[s])this.addTextIf(t+50,e[s],"wordsfont",i,0,0,"start",r,null,!0);else{for(var o=0,c=0,l=0;l<e[s].length;l++){var h=e[s][l],u=h.font?h.font:"wordsfont";this.rows.push({left:t+50+c,text:h.text,font:u,anchor:"start"});var d=r.calc(h.text,"wordsfont",i);o=Math.max(o,d.height),c+=d.width," "===h.text[h.text.length-1]&&(c+=a.width)}this.rows.push({move:o})}this.rows.push({move:2*a.height}),this.rows.push({endGroup:"unalignedWords",absElemType:"unalignedWords"})},n.prototype.extraText=function(e,t,n,r){var i="";e.book&&(i+="Book: "+e.book+"\n"),e.source&&(i+="Source: "+e.source+"\n"),e.discography&&(i+="Discography: "+e.discography+"\n"),e.notes&&(i+="Notes: "+e.notes+"\n"),e.transcription&&(i+="Transcription: "+e.transcription+"\n"),e.history&&(i+="History: "+e.history+"\n"),e["abc-copyright"]&&(i+="Copyright: "+e["abc-copyright"]+"\n"),e["abc-creator"]&&(i+="Creator: "+e["abc-creator"]+"\n"),e["abc-edited-by"]&&(i+="Edited By: "+e["abc-edited-by"]+"\n"),i.length>0&&this.addTextIf(t,i,"historyfont","meta-bottom extra-text",n.info,0,"start",r,"extraText")},n.prototype.footer=function(e,t,n){var r="header meta-bottom",i="footerfont";this.rows.push({startGroup:"footer",klass:r}),this.addTextIf(paddingLeft,e.left,i,r,0,0,"start",n),this.addTextIf(paddingLeft+width/2,e.center,i,r,0,0,"middle",n),this.addTextIf(paddingLeft+width,e.right,i,r,0,0,"end",n)},n.prototype.addTextIf=function(e,t,n,r,i,a,s,o,c,l){if(t){i&&this.rows.push({move:i});var h={left:e,text:t,font:n,anchor:s};c&&(h.absElemType=c),l||(h.klass=r),this.rows.push(h);var u=o.calc("A",n,r),d=t.split("\n").length;"\n"===t[t.length-1]&&d--;var f=1.1*u.height*d;this.rows.push({move:Math.round(f)}),a&&this.rows.push({move:a})}},e.exports=n},function(e,t,n){var r=n(1);function i(e){"keyboard"===this.dragMechanism&&0!==this.dragYStep&&this.dragTarget&&d.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,e),this.dragYStep=0}function a(e){switch(e.keyCode){case 38:case 40:e.preventDefault()}}function s(e){var t=!1,n=e.target.dataset.index;switch(e.keyCode){case 13:case 32:t=!0,this.dragTarget=this.selectables[n],this.dragIndex=n,this.dragMechanism="keyboard",h.bind(this)();break;case 38:t=!0,this.dragTarget=this.selectables[n],this.dragIndex=n,this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep--,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*r.STEP+")"));break;case 40:t=!0,this.dragTarget=this.selectables[n],this.dragIndex=n,this.dragMechanism="keyboard",this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep++,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*r.STEP+")"));break;case 9:0!==this.dragYStep&&h.bind(this)()}t&&e.preventDefault()}function o(e,t){var n,r,i,a=function(e,t){for(var n=0;n<e.length;n++)if(t===e[n].svgEl)return n;return-1}(e.selectables,function(e){if("svg"===e.tagName)return e;for(var t=e.getAttribute("selectable");!t;)t="svg"===(e=e.parentElement).tagName||e.getAttribute("selectable");return e}(t.target));return a>=0?(n=(i=function(e,t){return e.x<=t.offsetX&&e.x+e.width>=t.offsetX&&e.y<=t.offsetY&&e.y+e.height>=t.offsetY?[t.offsetX,t.offsetY]:[t.layerX,t.layerY]}(e.selectables[a].svgEl.getBBox(),t))[0],r=i[1]):(i=function(e,t){var n,r,i=1,a=1;return t.viewBox.baseVal&&(0!==t.viewBox.baseVal.width&&(i=t.viewBox.baseVal.width/t.clientWidth),0!==t.viewBox.baseVal.height&&(a=t.viewBox.baseVal.height/t.clientHeight)),"svg"===e.target.tagName?(n=e.offsetX,r=e.offsetY):(n=e.layerX,r=e.layerY),[n*=i,r*=a]}(t,e.renderer.paper.svg),a=function(e,t,n){for(var r=9999999,i=-1,a=0;a<e.selectables.length&&r>0;a++){var s=e.selectables[a];if(e.getDim(s),s.dim.left<t&&s.dim.right>t&&s.dim.top<n&&s.dim.bottom>n)i=a,r=0;else if(s.dim.top<n&&s.dim.bottom>n){var o=Math.min(Math.abs(s.dim.left-t),Math.abs(s.dim.right-t));o<r&&(r=o,i=a)}else if(s.dim.left<t&&s.dim.right>t){var c=Math.min(Math.abs(s.dim.top-n),Math.abs(s.dim.bottom-n));c<r&&(r=c,i=a)}else{var l=Math.abs(t-s.dim.left)>Math.abs(t-s.dim.right)?Math.abs(t-s.dim.right):Math.abs(t-s.dim.left),h=Math.abs(n-s.dim.top)>Math.abs(n-s.dim.bottom)?Math.abs(n-s.dim.bottom):Math.abs(n-s.dim.top),u=Math.sqrt(l*l+h*h);u<r&&(r=u,i=a)}}return i>=0&&r<=12?i:-1}(e,n=i[0],r=i[1])),{x:n,y:r,clickedOn:a}}function c(e){var t=o(this,e);t.clickedOn>=0&&0===e.button&&(this.dragTarget=this.selectables[t.clickedOn],this.dragIndex=t.clickedOn,this.dragMechanism="mouse",this.dragMouseStart={x:t.x,y:t.y},this.dragging&&this.dragTarget.isDraggable&&(!function(e,t){if(e){var n=g(e.svg);n[t]=!0,v(e.svg,n)}}(this.renderer.paper,"abcjs-dragging-in-progress"),this.dragTarget.absEl.highlight(void 0,this.dragColor)))}function l(e){if(this.dragTarget&&this.dragging&&this.dragTarget.isDraggable&&"mouse"===this.dragMechanism){var t=o(this,e),n=Math.round((t.y-this.dragMouseStart.y)/r.STEP);n!==this.dragYStep&&(this.dragYStep=n,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+n*r.STEP+")"))}}function h(e){this.dragTarget&&(p.bind(this)(),this.dragTarget.absEl&&this.dragTarget.absEl.highlight&&(this.selected=[this.dragTarget.absEl],this.dragTarget.absEl.highlight(void 0,this.selectionColor)),d.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,e),this.dragTarget.svgEl&&this.dragTarget.svgEl.focus&&(this.dragTarget.svgEl.focus(),this.dragTarget=null,this.dragIndex=-1),function(e,t){if(e){var n=g(e.svg);delete n[t],v(e.svg,n)}}(this.renderer.svg,"abcjs-dragging-in-progress"))}function u(e){e>=0&&e<this.selectables.length&&(this.dragTarget=this.selectables[e],this.dragIndex=e,this.dragMechanism="keyboard",h.bind(this)())}function d(e,t,n,r,i){var a=[];if(e.absEl.elemset){for(var s={},o=0;o<e.absEl.elemset.length;o++){var c=e.absEl.elemset[o];if(c)for(var l=c.getAttribute("class").split(" "),h=0;h<l.length;h++)s[l[h]]=!0}for(var d=0;d<Object.keys(s).length;d++)a.push(Object.keys(s)[d])}for(var p={},m=0;m<a.length;m++)f(a[m],"abcjs-v",p,"voice"),f(a[m],"abcjs-l",p,"line"),f(a[m],"abcjs-m",p,"measure");e.staffPos&&(p.staffPos=e.staffPos);for(var g=0;g<this.listeners.length;g++)this.listeners[g](e.absEl.abcelem,e.absEl.tuneNumber,a.join(" "),p,{step:t,max:n,index:r,setSelection:u.bind(this)},i)}function f(e,t,n,r){if(0===e.indexOf(t)){var i=e.replace(t,""),a=parseInt(i,10);""+a===i&&(n[r]=a)}}function p(){for(var e=0;e<this.selected.length;e++)this.selected[e].unhighlight();this.selected=[]}function m(e,t){p.bind(this)();for(var n=0;n<this.staffgroups.length;n++)for(var r=this.staffgroups[n].voices,i=0;i<r.length;i++)for(var a=r[i].children,s=0;s<a.length;s++){var o=a[s].abcelem.startChar,c=a[s].abcelem.endChar;(t>o&&e<c||t===e&&t===c)&&(this.selected[this.selected.length]=a[s],a[s].highlight(void 0,this.selectionColor))}}function g(e){var t=e.getAttribute("class");t||(t="");for(var n=t.split(" "),r={},i=0;i<n.length;i++)r[n[i]]=!0;return r}function v(e,t){var n=[];for(var r in t)t.hasOwnProperty(r)&&n.push(r);e.setAttribute("class",n.join(" "))}e.exports=function(e){if(e.rangeHighlight=m,e.dragging)for(var t=0;t<e.selectables.length;t++){var n=e.selectables[t];n.selectable&&(n.svgEl.setAttribute("tabindex",0),n.svgEl.setAttribute("data-index",t),n.svgEl.addEventListener("keydown",a.bind(e)),n.svgEl.addEventListener("keyup",s.bind(e)),n.svgEl.addEventListener("focus",i.bind(e)))}e.renderer.paper.svg.addEventListener("mousedown",c.bind(e)),e.renderer.paper.svg.addEventListener("mousemove",l.bind(e)),e.renderer.paper.svg.addEventListener("mouseup",h.bind(e))}},function(e,t,n){var r,i=n(63),a=n(66),s=n(67),o=n(69);!function(){"use strict";r=function(t,n,r,s){var o,c,l=r;for(o=0;o<n.lines.length;o++)(c=n.lines[o]).staff&&(e(t,r,s,c.staffGroup,n.formatting,o===n.lines.length-1,!1),c.staffGroup.w>l&&(l=c.staffGroup.w));for(o=0;o<n.lines.length;o++)if((c=n.lines[o]).staffGroup&&c.staffGroup.voices){for(var h=0;h<c.staffGroup.voices.length;h++)i(c.staffGroup.voices[h]);a(t,c.staffGroup)}for(o=0;o<n.lines.length;o++)(c=n.lines[o]).staffGroup&&c.staffGroup.setHeight();return l};var e=function(e,n,r,i,a,c,l){for(var h=o(e,i.getTextSize,i.voices,i.brace,i.bracket),u=r,d=0;d<8;d++){var f=s(u,e,l,i,h);if(u=t(c,!!a.stretchlast&&a.stretchlast,n+e.padding.left,i.w,u,f.spacingUnits,f.minSpace),l&&console.log("setXSpace",d,i.w,u,i.minspace),null===u)break}!function(e){for(var t=0;t<e.length;t++)for(var n=e[t],r=1;r<n.children.length-1;r++){var i=n.children[r];if(i.abcelem.rest&&("whole"===i.abcelem.rest.type||"multimeasure"===i.abcelem.rest.type)){var a=n.children[r-1],s=n.children[r+1];i.center(a,s)}}}(i.voices)};function t(e,t,n,r,i,a,s){return e&&r/n<.66&&!t||Math.abs(n-r)<2?null:a>0?((i=(n-(r-a*i))/a)*s>50&&(i=50/s),i):null}}(),e.exports=r},function(e,t,n){var r=n(64),i=n(12),a=n(65);function s(e){for(var t=0;t<e.elems.length;t++){var n=e.elems[t];if(n.top)for(var r=l(n,e),i=0;i<n.children.length;i++){var a=n.children[i];if("ornament"===a.klass&&a.bottom-1.5<r){var s=r-a.bottom+1.5;a.bottom+=s,a.top+=s,a.pitch+=s,r=n.top=a.top}}}}function o(e,t){var n=t.getChordDim();if(n){for(var r=0;r<e.length;r++){if(e[r]<n.left)return r>0&&t.putChordInLane(r),void(e[r]=n.right)}e.push(n.right),t.putChordInLane(e.length-1)}}function c(e){for(var t=0,n=0;n<e.children.length;n++){e.children[n].chordHeightBelow&&t++}return t}function l(e,t){return t=t.beams[0],i(t.startX,t.startY,t.endX,t.endY,e.x)}e.exports=function(e){for(var t=0;t<e.beams.length;t++)if("BeamElem"===e.beams[t].type){r(e.beams[t]),s(e.beams[t]);for(var n=0;n<e.beams[t].elems.length;n++)e.adjustRange(e.beams[t].elems[n])}for(e.staff.specialY.chordLines=function(e){var t,n,r,i=[0],a=[0];for(t=0;t<e.length;t++){for(n=0;n<e[t].children.length;n++)(r=e[t].children[n]).chordHeightAbove&&o(i,r);for(n=e[t].children.length-1;n>=0;n--)(r=e[t].children[n]).chordHeightBelow&&o(a,r)}(i.length>1||a.length>1)&&function(e,t,n){for(var r=0;r<e.length;r++){c(e[r]);for(var i=0;i<e[r].children.length;i++){var a=e[r].children[i];a.chordHeightAbove&&a.invertLane(t)}}}(e,i.length);return{above:i.length,below:a.length}}(e.children),t=0;t<e.otherchildren.length;t++){var i=e.otherchildren[t];"TripletElem"===i.type&&(a(i),e.adjustRange(i))}e.staff.top=Math.max(e.staff.top,e.top),e.staff.bottom=Math.min(e.staff.bottom,e.bottom)}},function(e,t,n){var r=n(2),i=n(1),a=n(12),s=function(e){return void 0===e?0:Math.floor(Math.log(e)/Math.log(2))};function o(e,t,n,r){if(!e.children)return r;for(var i=0;i<e.children.length;i++){var a=e.children[i];t&&void 0!==a.top&&"flags.ugrace"===a.c?r=Math.max(r,a.top-n):t||void 0===a.bottom||"flags.ugrace"!==a.c||(r=Math.max(r,n-a.bottom+7))}return r}function c(e,t,n){var r=t.heads[e?0:t.heads.length-1],i=n.heads[e?0:n.heads.length-1],a=r.x;e&&(a+=r.w-.6);var s=i.x;return[a,s+=e?i.w:.6]}e.exports=function(e){if(0!==e.elems.length&&!e.allrests){var t=function(e,t){var n=e?i.STEP:-i.STEP;t&&(n*=.4);return n}(e.stemsUp,e.isgrace),n=e.elems[0],l=e.elems[e.elems.length-1],h=0,u=e.stemsUp?n.abcelem.maxpitch:n.abcelem.minpitch;h=o(n,e.stemsUp,u,h),h=o(l,e.stemsUp,u,h),h=Math.max(e.stemHeight,h+3);var d=function(e,t,n,r,i,a,s,o,c,l){var h=n-2,u=n-2,d=Math.round(r?Math.max(e+h,c+u):Math.min(e-h,o-u)),f=function(e,t,n,r){if(r)return 0;var i=e-t,a=n/2;i>a&&(i=a);i<-a&&(i=-a);return i}(i,a,t,s),p=d+Math.floor(f/2),m=d+Math.floor(-f/2);l||(r&&d<6||!r&&d>6)&&(p=6,m=6);return[p,m]}(e.average,e.elems.length,h,e.stemsUp,n.abcelem.averagepitch,l.abcelem.averagepitch,e.isflat,e.min,e.max,e.isgrace),f=c(e.stemsUp,n,l);e.addBeam({startX:f[0],endX:f[1],startY:d[0],endY:d[1],dy:t});for(var p=function(e,t,n,r,i){for(var o=[],l=[],h=0;h<e.length;h++){var u=e[h];if(!u.abcelem.rest){var d=u.heads[t?0:u.heads.length-1],f=d.x+(t?d.w:0),p=a(n.startX,n.startY,n.endX,n.endY,f),m=t?-1.5:1.5;r&&(m=2*m/3);var g=u.abcelem.duration;0===g&&(g=.25);for(var v=s(g);v<-3;v++){var b=-4-v;if(l[b]?l[b].single=!1:l[b]={x:f+(t?-.6:0),y:p+m*(b+1),durlog:v,single:!0},h>0&&u.abcelem.beambr&&u.abcelem.beambr<=b+1){l[b].split||(l[b].split=[l[b].x]);var y=c(t,e[h-1],u);l[b].split[l[b].split.length-1]>=y[0]&&(y[0]+=u.w),l[b].split.push(y[0]),l[b].split.push(y[1])}}for(var w=l.length-1;w>=0;w--)if(h===e.length-1||s(e[h+1].abcelem.duration)>-w-4){var x=f,k=p+m*(w+1);l[w].single&&(x=0===h?f+5:f-5,k=a(n.startX,n.startY,n.endX,n.endY,x)+m*(w+1));var A={startX:l[w].x,endX:x,startY:l[w].y,endY:k,dy:i};if(void 0!==l[w].split){var T=l[w].split;A.endX<=T[T.length-1]&&(T[T.length-1]-=u.w),T.push(A.endX),A.split=l[w].split}o.push(A),l=l.slice(0,w)}}}return o}(e.elems,e.stemsUp,e.beams[0],e.isgrace,t),m=0;m<p.length;m++)e.addBeam(p[m]);!function(e,t,n,s,o){for(var c=0;c<e.length;c++){var l=e[c];if(!l.abcelem.rest){var h=!l.addExtra,u=h?o:l,d=l.heads[t?0:l.heads.length-1],f=d.pitch+(t?.2:-.2),p=t?d.w:0,m=d.x+p,g=a(n.startX,n.startY,n.endX,n.endY,m),v=t?-.6:.6;t||(g-=s/2/i.STEP),h&&(p+=l.heads[0].dx),"noteheads.slash.quarter"===d.c&&(t?f+=1:f-=1);var b=new r(null,p,0,f,{type:"stem",pitch2:g,linewidth:v});b.setX(u.x),u.addRight(b)}}}(e.elems,e.stemsUp,e.beams[0],t,e.mainNote)}}},function(e,t,n){var r=n(12);function i(e){return e.stemsUp}e.exports=function(e){if(e.anchor1&&e.anchor2){e.hasBeam=!!e.anchor1.parent.beam&&e.anchor1.parent.beam===e.anchor2.parent.beam;var t=e.anchor1.parent.beam;if(!e.hasBeam||t.elems[0]===e.anchor1.parent&&t.elems[t.elems.length-1]===e.anchor2.parent||(e.hasBeam=!1),e.hasBeam){var n=i(t)?e.anchor1.x+e.anchor1.w:e.anchor1.x;e.yTextPos=function(e,t,n){if(0===n.beams.length)return 0;n=n.beams[0];var i=e+(t-e)/2;return r(n.startX,n.startY,n.endX,n.endY,i)}(n,e.anchor2.x,t),e.yTextPos+=i(t)?3:-2,e.xTextPos=(o=n,c=e.anchor2.x,o+(c-o)/2),e.top=e.yTextPos+1,e.bottom=e.yTextPos-2,i(t)&&(e.endingHeightAbove=4)}else{e.startNote=Math.max(e.anchor1.parent.top,9)+4,e.endNote=Math.max(e.anchor2.parent.top,9)+4,"rest"===e.anchor1.parent.type&&"rest"!==e.anchor2.parent.type?e.startNote=e.endNote:"rest"===e.anchor2.parent.type&&"rest"!==e.anchor1.parent.type&&(e.endNote=e.startNote);for(var a=0,s=0;s<e.middleElems.length;s++)a=Math.max(a,e.middleElems[s].top);((a+=4)>e.startNote||a>e.endNote)&&(e.startNote=a,e.endNote=a),e.flatBeams&&(e.startNote=Math.max(e.startNote,e.endNote),e.endNote=Math.max(e.startNote,e.endNote)),e.yTextPos=e.startNote+(e.endNote-e.startNote)/2,e.xTextPos=e.anchor1.x+(e.anchor2.x+e.anchor2.w-e.anchor1.x)/2,e.top=e.yTextPos+1}}var o,c;delete e.middleElems,delete e.flatBeams}},function(e,t,n){var r=n(1),i=1;function a(e,t,n,r){if(e.specialY[n]){var a=e.specialY[n];r&&(a*=r),e.top+=a+i,t[n]=e.top}}function s(e,t,n){var r,i;for(r=0;r<t.children.length;r++)o(e,i=t.children[r],n);for(r=0;r<t.otherchildren.length;r++)switch((i=t.otherchildren[r]).type){case"CrescendoElem":c(e,i);break;case"DynamicDecoration":l(e,i);break;case"EndingElem":h(e,i)}}function o(e,t,n){for(var r=0;r<t.children.length;r++){var i=t.children[r];for(var a in t.specialY)t.specialY.hasOwnProperty(a)&&i[a]&&(i.pitch=e[a],void 0===i.top&&("TempoElement"===i.type?u(e,i):d(e,i,n),t.pushTop(i.top),t.pushBottom(i.bottom)))}}function c(e,t){t.dynamicHeightAbove?t.pitch=e.dynamicHeightAbove:t.pitch=e.dynamicHeightBelow}function l(e,t){t.volumeHeightAbove?t.pitch=e.volumeHeightAbove:t.pitch=e.volumeHeightBelow}function h(e,t){t.pitch=e.endingHeightAbove-2}function u(e,t){if(t.pitch=e.tempoHeightAbove,t.top=e.tempoHeightAbove,t.bottom=e.tempoHeightAbove,t.note){var n=t.pitch-t.totalHeightInPitches+1;t.note.top=n,t.note.bottom=n;for(var r=0;r<t.note.children.length;r++){var i=t.note.children[r];i.top+=n,i.bottom+=n,i.pitch+=n,void 0!==i.pitch2&&(i.pitch2+=n)}}}function d(e,t,n){switch(t.type){case"part":t.top=e.partHeightAbove+t.height,t.bottom=e.partHeightAbove;break;case"text":case"chord":t.chordHeightAbove?(t.top=e.chordHeightAbove,t.bottom=e.chordHeightAbove):(t.top=e.chordHeightBelow,t.bottom=e.chordHeightBelow);break;case"lyric":t.lyricHeightAbove?(t.top=e.lyricHeightAbove,t.bottom=e.lyricHeightAbove):(t.top=e.lyricHeightBelow+n.vocal/r.STEP,t.bottom=e.lyricHeightBelow+n.vocal/r.STEP,t.pitch-=n.vocal/r.STEP);break;case"debug":t.top=e.chordHeightAbove,t.bottom=e.chordHeightAbove}void 0!==t.pitch&&void 0!==t.top||console.error("RelativeElement position not set.",t.type,t.pitch,t.top,e)}e.exports=function(e,t){for(var n,o=0;o<t.staffs.length;o++){var c=t.staffs[o],l={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0};if(e.showDebug&&e.showDebug.indexOf("box")>=0&&(c.originalTop=c.top,c.originalBottom=c.bottom),a(c,l,"lyricHeightAbove"),a(c,l,"chordHeightAbove",c.specialY.chordLines.above),c.specialY.endingHeightAbove&&(c.specialY.chordHeightAbove?c.top+=2:c.top+=c.specialY.endingHeightAbove+i,l.endingHeightAbove=c.top),c.specialY.dynamicHeightAbove&&c.specialY.volumeHeightAbove?(c.top+=Math.max(c.specialY.dynamicHeightAbove,c.specialY.volumeHeightAbove)+i,l.dynamicHeightAbove=c.top,l.volumeHeightAbove=c.top):(a(c,l,"dynamicHeightAbove"),a(c,l,"volumeHeightAbove")),a(c,l,"partHeightAbove"),a(c,l,"tempoHeightAbove"),c.specialY.lyricHeightBelow&&(c.specialY.lyricHeightBelow+=e.spacing.vocal/r.STEP,l.lyricHeightBelow=c.bottom,c.bottom-=c.specialY.lyricHeightBelow+i),c.specialY.chordHeightBelow){l.chordHeightBelow=c.bottom;var h=c.specialY.chordHeightBelow;c.specialY.chordLines.below&&(h*=c.specialY.chordLines.below),c.bottom-=h+i}c.specialY.volumeHeightBelow&&c.specialY.dynamicHeightBelow?(l.volumeHeightBelow=c.bottom,l.dynamicHeightBelow=c.bottom,c.bottom-=Math.max(c.specialY.volumeHeightBelow,c.specialY.dynamicHeightBelow)+i):c.specialY.volumeHeightBelow?(l.volumeHeightBelow=c.bottom,c.bottom-=c.specialY.volumeHeightBelow+i):c.specialY.dynamicHeightBelow&&(l.dynamicHeightBelow=c.bottom,c.bottom-=c.specialY.dynamicHeightBelow+i),e.showDebug&&e.showDebug.indexOf("box")>=0&&(c.positionY=l);for(var u=0;u<c.voices.length;u++){s(l,t.voices[c.voices[u]],e.spacing)}if(void 0!==n){var d=n+(c.top-10),f=e.spacing.systemStaffSeparation/r.STEP-d;f>0&&(c.top+=f)}n=2-c.bottom}}},function(e,t,n){var r=n(68);function i(e){for(var t=0;t<e.length;t++)if(!r.layoutEnded(e[t]))return!1;return!0}function a(e){return e.durationindex-(e.children[e.i]&&e.children[e.i].duration>0?0:5e-7)}e.exports=function(e,t,n,s,o){var c,l=0,h=1e3,u=o;s.startx=u;var d=0;for(n&&console.log("init layout",e),c=0;c<s.voices.length;c++)r.beginLayout(u,s.voices[c]);for(var f=0;!i(s.voices);){for(d=null,c=0;c<s.voices.length;c++)r.layoutEnded(s.voices[c])||d&&!(a(s.voices[c])<d)||(d=a(s.voices[c]));var p=[],m=[];for(c=0;c<s.voices.length;c++){a(s.voices[c])-d>1e-7?m.push(s.voices[c]):p.push(s.voices[c])}f=0;var g=0;for(c=0;c<p.length;c++)r.getNextX(p[c])>u&&(u=r.getNextX(p[c]),f=r.getSpacingUnits(p[c]),g=p[c].spacingduration);for(l+=f,h=Math.min(h,f),n&&console.log("currentduration: ",d,l,h),c=0;c<p.length;c++){var v=r.layoutOneItem(u,e,p[c]),b=v-u;if(b>0){u=v;for(var y=0;y<c;y++)r.shiftRight(b,p[y])}}for(c=0;c<m.length;c++)m[c].spacingduration-=g,r.updateNextX(u,e,m[c]);for(c=0;c<p.length;c++){var w=p[c];r.updateIndices(w)}}for(c=0;c<s.voices.length;c++)r.getNextX(s.voices[c])>u&&(u=r.getNextX(s.voices[c]),f=r.getSpacingUnits(s.voices[c]));return l+=f,s.setWidth(u),{spacingUnits:l,minSpace:h}}},function(e,t){var n=function(){};n.beginLayout=function(e,t){t.i=0,t.durationindex=0,t.startx=e,t.minx=e,t.nextx=e,t.spacingduration=0},n.layoutEnded=function(e){return e.i>=e.children.length},n.getNextX=function(e){return Math.max(e.minx,e.nextx)},n.getSpacingUnits=function(e){return Math.sqrt(8*e.spacingduration)},n.layoutOneItem=function(e,t,n){var r=n.children[n.i];if(!r)return 0;var i=e-n.minx,a=function(e){return-e.extraw}(r);return i<a&&(0===n.i||"bar"!==r.type||"part"!==n.children[n.i-1].type&&"tempo"!==n.children[n.i-1].type)&&(e+=a-i),r.setX(e),n.spacingduration=r.duration,n.minx=e+function(e){return e.w}(r),n.i!==n.children.length-1&&(n.minx+=r.minspacing),this.updateNextX(e,t,n),e},n.shiftRight=function(e,t){var n=t.children[t.i];n&&(n.setX(n.x+e),t.minx+=e,t.nextx+=e)},n.updateNextX=function(e,t,n){n.nextx=e+t*Math.sqrt(8*n.spacingduration)},n.updateIndices=function(e){this.layoutEnded(e)||(e.durationindex+=e.children[e.i].duration,"bar"===e.children[e.i].type&&(e.durationindex=Math.round(64*e.durationindex)/64),e.i++)},e.exports=n},function(e,t){function n(e,t,n){if(e)for(var i=0;i<e.length;i++)r(t,e[i]),n=Math.max(n,e[i].getWidth());return n}function r(e,t){t.x=e}e.exports=function(e,t,r,i,a){var s,o,c=e.padding.left,l=0;for(s=0;s<r.length;s++)r[s].header&&(o=t.calc(r[s].header,"voicefont",""),l=Math.max(l,o.width));if(i)for(s=0;s<i.length;s++)i[s].header&&(o=t.calc(i[s].header,"voicefont",""),l=Math.max(l,o.width));if(a)for(s=0;s<a.length;s++)a[s].header&&(o=t.calc(a[s].header,"voicefont",""),l=Math.max(l,o.width));l&&(l+=t.calc("A","voicefont","").width);var h=0;return h=n(i,c+=l,h),c+(h=n(a,c,h))}},function(e,t){var n=function(e){this.shouldAddClasses=e.shouldAddClasses,this.reset()};n.prototype.reset=function(){this.lineNumber=null,this.voiceNumber=null,this.measureNumber=null,this.measureTotalPerLine=[],this.noteNumber=null},n.prototype.incrLine=function(){null===this.lineNumber?this.lineNumber=0:this.lineNumber++,this.voiceNumber=null,this.measureNumber=null,this.noteNumber=null},n.prototype.incrVoice=function(){null===this.voiceNumber?this.voiceNumber=0:this.voiceNumber++,this.measureNumber=null,this.noteNumber=null},n.prototype.isInMeasure=function(){return null!==this.measureNumber},n.prototype.newMeasure=function(){this.measureNumber&&(this.measureTotalPerLine[this.lineNumber]=this.measureNumber),this.measureNumber=null,this.noteNumber=null},n.prototype.startMeasure=function(){this.measureNumber=0,this.noteNumber=0},n.prototype.incrMeasure=function(){this.measureNumber++,this.noteNumber=0},n.prototype.incrNote=function(){this.noteNumber++},n.prototype.measureTotal=function(){for(var e=0,t=0;t<this.lineNumber;t++)e+=this.measureTotalPerLine[t]?this.measureTotalPerLine[t]:0;return this.measureNumber&&(e+=this.measureNumber),e},n.prototype.getCurrent=function(e){return{line:this.lineNumber,measure:this.measureNumber,measureTotal:this.measureTotal(),voice:this.voiceNumber,note:this.noteNumber}},n.prototype.generate=function(e){if(!this.shouldAddClasses)return"";var t=[];if(e&&e.length>0&&t.push(e),null!==this.lineNumber&&t.push("l"+this.lineNumber),null!==this.measureNumber&&t.push("m"+this.measureNumber),null!==this.measureNumber&&t.push("mm"+this.measureTotal()),null!==this.voiceNumber&&t.push("v"+this.voiceNumber),e&&(e.indexOf("note")>=0||e.indexOf("rest")>=0||e.indexOf("lyric")>=0)&&null!==this.noteNumber&&t.push("n"+this.noteNumber),t.length>0){t=(t=t.join(" ")).split(" ");for(var n=0;n<t.length;n++)0!==t[n].indexOf("abcjs-")&&t[n].length>0&&(t[n]="abcjs-"+t[n])}return t.join(" ")},e.exports=n},function(e,t){var n=function(e,t){this.formatting=e,this.classes=t};n.prototype.updateFonts=function(e){e.gchordfont&&(this.formatting.gchordfont=e.gchordfont),e.tripletfont&&(this.formatting.tripletfont=e.tripletfont),e.annotationfont&&(this.formatting.annotationfont=e.annotationfont),e.vocalfont&&(this.formatting.vocalfont=e.vocalfont)},n.prototype.calc=function(e,t){var n;n="string"==typeof e?(n=this.formatting[e])?{face:n.face,size:Math.round(4*n.size/3),decoration:n.decoration,style:n.style,weight:n.weight,box:n.box}:{face:"Arial",size:Math.round(16),decoration:"underline",style:"normal",weight:"normal"}:{face:e.face,size:Math.round(4*e.size/3),decoration:e.decoration,style:e.style,weight:e.weight,box:e.box};var r=this.formatting.fontboxpadding?this.formatting.fontboxpadding:.1;return n.padding=n.size*r,{font:n,attr:{"font-size":n.size,"font-style":n.style,"font-family":n.face,"font-weight":n.weight,"text-decoration":n.decoration,class:this.classes.generate(t)}}},e.exports=n},function(e,t){var n=function(e,t){this.getFontAndAttr=e,this.svg=t};n.prototype.updateFonts=function(e){this.getFontAndAttr.updateFonts(e)},n.prototype.attr=function(e,t){return this.getFontAndAttr.calc(e,t)},n.prototype.calc=function(e,t,n,r){var i;i="string"==typeof t?this.attr(t,n):{font:{face:t.face,size:t.size,decoration:t.decoration,style:t.style,weight:t.weight},attr:{"font-size":t.size,"font-style":t.style,"font-family":t.face,"font-weight":t.weight,"text-decoration":t.decoration,class:this.getFontAndAttr.classes.generate(n)}};var a=this.svg.getTextSize(e,i.attr,r);return i.font.box?{height:a.height+4*i.font.padding,width:a.width+4*i.font.padding}:a},n.prototype.baselineToCenter=function(e,t,n,r,i){return.5*this.calc(e,t,n).height+(i-r-2)*this.attr(t,n).font.size},e.exports=n},function(e,t,n){var r=n(74),i=n(87),a=n(88),s=n(1),o=n(90);function c(e,t,n){r(e,t,n);var i=t.height*s.STEP;return e.y+=i,t}function l(e,t,n,r){var i=-(n.staffs[n.staffs.length-1].bottom-2),a=(r.staffs[0].top-10+i)*s.STEP;a<t&&e.moveY(t-a)}e.exports=function(e,t,n,r,s,h,u,d,f){var p=new o(e.paper,d,f);e.moveY(e.padding.top),a(e,n.topText,p),e.moveY(e.spacing.music);for(var m=[],g=0;g<n.lines.length;g++){t.incrLine();var v=n.lines[g];if(v.staff){v.vskip&&e.moveY(v.vskip),m.length>=1&&l(e,e.spacing.staffSeparation,m[m.length-1],v.staffGroup);var b=c(e,v.staffGroup,p);b.line=g,m.push(b)}else v.nonMusic&&a(e,v.nonMusic,p)}return t.reset(),e.moveY(24),a(e,n.bottomText,p),i(e,s,u,h),{staffgroups:m,selectables:p.getElements()}}},function(e,t,n){var r=n(1),i=n(75),a=n(76),s=n(85),o=n(86),c=n(25);function l(e,t,n,a,s){if(n)for(var o=0;o<n.length;o++)n[o].isStartVoice(a)&&(n[o].startY=t-10*r.STEP,n[o].elemset=i(e,n[o],s))}function h(e,t,n){for(var i=0;i<n.length;i++)for(var a=t[n[i]].children,s=0;s<a.length;s++){var c=a[s],l=c.getFixedCoords();if(!c.invisible&&void 0!==l.t&&void 0!==l.b){var h=(l.t-l.b)*r.STEP;o(e,{x:l.x,y:e.calcY(l.t),width:l.w,height:h,fill:"#88e888","fill-opacity":.4,stroke:"#4aa93d","stroke-opacity":.8});for(var u=0;u<c.children.length;u++){var d=c.children[u],f=d.getChordDim();if(f){var p=e.calcY(d.pitch);p+=d.dim.font.size*d.getLane(),o(e,{x:f.left,y:p,width:f.right-f.left,height:d.dim.font.size,fill:"none",stroke:"#4aa93d","stroke-opacity":.8})}}}}}e.exports=function(e,t,n){var i;!function(e,t){var n=Math.round(e.y);e.paper.pathToBack({path:"M 0 "+n+" L 0 0",stroke:"none",fill:"none","stroke-opacity":0,"fill-opacity":0,class:e.controller.classes.generate(t),"data-vertical":n})}(e,"abcjs-top-of-system");for(var u,d,f=e.y,p=0;p<t.staffs.length;p++){var m=t.staffs[p];e.moveY(r.STEP,m.top),m.absoluteY=e.y,e.showDebug&&(e.showDebug.indexOf("box")>=0&&h(e,t.voices,m.voices),e.showDebug.indexOf("grid")>=0&&(e.paper.dottedLine({x1:e.padding.left,x2:e.padding.left+e.controller.width,y1:f,y2:f,stroke:"#0000ff"}),o(e,{x:e.padding.left,y:e.calcY(m.originalTop),width:e.controller.width,height:e.calcY(m.originalBottom)-e.calcY(m.originalTop),fill:"#000000",stroke:"#000000","fill-opacity":.1,"stroke-opacity":.1}),i=0,y(m,"chordHeightAbove"),y(m,"chordHeightBelow"),y(m,"dynamicHeightAbove"),y(m,"dynamicHeightBelow"),y(m,"endingHeightAbove"),y(m,"lyricHeightAbove"),y(m,"lyricHeightBelow"),y(m,"partHeightAbove"),y(m,"tempoHeightAbove"),y(m,"volumeHeightAbove"),y(m,"volumeHeightBelow"))),e.moveY(r.STEP,-m.bottom),e.showDebug&&e.showDebug.indexOf("grid")>=0&&e.paper.dottedLine({x1:e.padding.left,x2:e.padding.left+e.controller.width,y1:e.y,y2:e.y,stroke:"#0000aa"})}for(var g=0,v=0;v<t.voices.length;v++){var b=t.voices[v].staff;e.y=b.absoluteY,e.controller.classes.incrVoice(),t.voices[v].duplicate||(u||(u=e.calcY(10)),d=e.calcY(2),0!==b.lines&&(e.controller.classes.newMeasure(),s(e,t.startx,t.w,b.lines)),l(e,b.absoluteY,t.brace,v,n),l(e,b.absoluteY,t.bracket,v,n)),a(e,t.voices[v],g,n,{top:f,height:t.height*r.STEP}),e.controller.classes.newMeasure(),t.voices[v].duplicate||(g=e.calcY(2))}function y(t,n){var a=["rgb(207,27,36)","rgb(168,214,80)","rgb(110,161,224)","rgb(191,119,218)","rgb(195,30,151)","rgb(31,170,177)","rgb(220,166,142)"];if(t.positionY[n]){var s=t.specialY[n]*r.STEP;"chordHeightAbove"===n&&t.specialY.chordLines&&t.specialY.chordLines.above&&(s*=t.specialY.chordLines.above),"chordHeightBelow"===n&&t.specialY.chordLines&&t.specialY.chordLines.below&&(s*=t.specialY.chordLines.below),o(e,{x:e.padding.left,y:e.calcY(t.positionY[n]),width:e.controller.width,height:s,fill:a[i],stroke:a[i],"fill-opacity":.4,"stroke-opacity":.4},n.substr(0,4)),(i+=1)>6&&(i=0)}}e.controller.classes.newMeasure(),t.staffs.length>1&&c(e,t.startx,.6,u,d),e.y=f}},function(e,t,n){var r=n(7),i=n(1),a=n(4);var s=function(e,t,n,s,o,c,l){var h;if(c){e.paper.openGroup({klass:e.controller.classes.generate("staff-extra voice-name")});var u=n+(s-n)/2;u-=e.controller.getTextSize.baselineToCenter(c,"voicefont","staff-extra voice-name",0,1),a(e,{x:e.padding.left,y:u,text:c,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0})}return"brace"===o?h=function(e,t,n,i,a){var s=i-n,o=[7.5,-8,21,0,18.5,-10.5,7.5],c=[0,s/5.5,s/3.14,s/2,s/2.93,s/4.88,0],l=r("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",t+o[0],n+c[0],t+o[1],n+c[1],t+o[2],n+c[2],t+o[3],n+c[3],t+o[4],n+c[4],t+o[5],n+c[5],t+o[6],n+c[6]);return l+=r("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",t+(o=[0,17.5,-7.5,6.6,-5,20,0])[0],n+(c=[s/2,s/1.46,s/1.22,s,s/1.19,s/1.42,s/2])[0],t+o[1],n+c[1],t+o[2],n+c[2],t+o[3],n+c[3],t+o[4],n+c[4],t+o[5],n+c[5],t+o[6],n+c[6]),e.paper.path({path:l,stroke:"#000000",fill:"#000000",class:e.controller.classes.generate(a)})}(e,t,n,s,o):"bracket"===o&&(h=function(e,t,n,a,s){t+=i.STEP;var o=.75*i.STEP,c=.75*i.STEP,l=a-n,h=r("M %f %f l %f %f l %f %f l %f %f z",t,n-c,0,l+2*c,o,0,0,-(l+2*c)),u=2*i.STEP,d=i.STEP;return h+=r("M %f %f q %f %f %f %f q %f %f %f %f z",t+o,n-c,.6*u,.2*d,u,-d,.1*-u,.3*d,-u,d+i.STEP),h+=r("M %f %f q %f %f %f %f q %f %f %f %f z",t+o,n+c+l,.6*u,.2*-d,u,d,.1*-u,.3*-d,-u,-d-i.STEP),e.paper.path({path:h,stroke:"#000000",fill:"#000000",class:e.controller.classes.generate(s)})}(e,t,n,s,o)),c&&(h=e.paper.closeGroup()),l.wrapSvgEl({el_type:o,startChar:-1,endChar:-1},h),h};e.exports=function(e,t,n){var r=t.startVoice.staff.absoluteY-10*i.STEP;return t.endVoice&&t.endVoice.staff?t.endY=t.endVoice.staff.absoluteY-2*i.STEP:t.lastContinuedVoice&&t.lastContinuedVoice.staff?t.endY=t.lastContinuedVoice.staff.absoluteY-2*i.STEP:t.endY=t.startVoice.staff.absoluteY-2*i.STEP,s(e,t.x,r,t.endY,t.type,t.header,n)}},function(e,t,n){var r=n(77),i=n(78),a=n(79),s=n(80),o=n(81),c=n(82),l=n(4),h=n(83);function u(e){return"rest"===e.type&&!(!e.abcelem||!e.abcelem.rest||"spacer"===e.abcelem.rest.type)}e.exports=function(e,t,n,d,f){var p,m,g=t.w-1;if(e.staffbottom=t.staff.bottom,t.header){var v=l(e,{x:e.padding.left,y:e.calcY(t.headerPosition),text:t.header,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0});d.wrapSvgEl({el_type:"voiceName",startChar:-1,endChar:-1,text:t.header},v)}for(p=0;p<t.children.length;p++){var b=!1;"staff-extra"===(m=t.children[p]).type||e.controller.classes.isInMeasure()||(e.controller.classes.startMeasure(),b=!0),m.type,h(e,m,t.barto||p===t.children.length-1?n:0,d,f),("note"===m.type||u(m))&&e.controller.classes.incrNote(),"bar"!==m.type||b||e.controller.classes.incrMeasure()}for(e.controller.classes.startMeasure(),p=0;p<t.beams.length;p++){var y=t.beams[p];"bar"===y?e.controller.classes.incrMeasure():c(e,y,d)}for(e.controller.classes.startMeasure(),p=0;p<t.otherchildren.length;p++)if("bar"===(m=t.otherchildren[p]))e.controller.classes.incrMeasure();else switch(m.type){case"CrescendoElem":m.elemset=r(e,m,d);break;case"DynamicDecoration":m.elemset=i(e,m,d);break;case"TripletElem":a(e,m,d);break;case"EndingElem":m.elemset=s(e,m,t.startx+10,g,d);break;case"TieElem":m.elemset=o(e,m,t.startx+10,g,d);break;default:console.log(m),h(e,m,t.startx+10,g,d,f)}}},function(e,t,n){n(21),n(22);var r=n(7),i=n(9),a=n(3);var s=function(e,t,n,s,o,c,l){t=a(t),n=a(n),s=a(s),o=a(o),c=a(c),l=a(l);var h=r("M %f %f L %f %f M %f %f L %f %f",c,t,l,n,c,s,l,o);return i(e,{path:h,highlight:"stroke",stroke:"#000000",class:e.controller.classes.generate("dynamics decoration")})};e.exports=function(e,t,n){void 0===t.pitch&&window.console.error("Crescendo Element y-coordinate not set.");var r,i=e.calcY(t.pitch)+4,a=t.anchor1?t.anchor1.x:0,o=t.anchor2?t.anchor2.x:800;return r="<"===t.dir?s(e,i+4,i,i+4,i+8,a,o):s(e,i,i+4,i+8,i+4,a,o),n.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1},r),[r]}},function(e,t,n){var r=n(23);e.exports=function(e,t,n){void 0===t.pitch&&window.console.error("Dynamic Element y-coordinate not set.");var i=r(e,t.anchor.x,t.pitch,t.dec,1,1,e.controller.classes.generate("decoration dynamics"));return n.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1,decoration:t.dec},i),[i]}},function(e,t,n){var r=n(7),i=n(4),a=n(9),s=n(3);function o(e,t,n,i){return r("M %f %f L %f %f",s(e),s(t),s(n),s(i))}e.exports=function(e,t,n){e.paper.openGroup({klass:e.controller.classes.generate("triplet "+t.durationClass)}),t.hasBeam||function(e,t,n,r,i){n=e.calcY(n),i=e.calcY(i);var s="";s+=o(t,n,t,n+5),s+=o(r,i,r,i+5);var c=t+(r-t)/2,l=(i-n)/(r-t),h=c-8;s+=o(t,n,h,n+(h-t)*l);var u=c+8;s+=o(u,n+(u-t)*l,r,i),a(e,{path:s,stroke:"#000000"})}(e,t.anchor1.x,t.startNote,t.anchor2.x+t.anchor2.w,t.endNote),i(e,{x:t.xTextPos,y:e.calcY(t.yTextPos-1),text:""+t.number,type:"tripletfont",anchor:"middle",centerVertically:!0,noClass:!0});var r=e.paper.closeGroup();return n.wrapSvgEl({el_type:"triplet",startChar:-1,endChar:-1},r),r}},function(e,t,n){var r=n(7),i=n(4),a=n(9),s=n(3);e.exports=function(e,t,n,o,c){void 0===t.pitch&&window.console.error("Ending Element y-coordinate not set.");var l=s(e.calcY(t.pitch)),h="";t.anchor1&&(n=s(t.anchor1.x+t.anchor1.w),h+=r("M %f %f L %f %f ",n,l,n,s(l+20))),t.anchor2&&(o=s(t.anchor2.x),h+=r("M %f %f L %f %f ",o,l,o,s(l+20))),h+=r("M %f %f L %f %f ",n,l,o,l),e.paper.openGroup({klass:e.controller.classes.generate("ending")}),a(e,{path:h,stroke:"#000000",fill:"#000000"}),t.anchor1&&i(e,{x:s(n+5),y:s(e.calcY(t.pitch-.5)),text:t.text,type:"repeatfont",klass:"ending",anchor:"start",noClass:!0});var u=e.paper.closeGroup();return c.wrapSvgEl({el_type:"ending",startChar:-1,endChar:-1},u),[u]}},function(e,t,n){var r=n(7),i=n(3);var a=function(e,t,n){e.anchor1&&e.anchor2?e.anchor1.pitch===e.anchor2.pitch&&0===e.internalNotes.length?e.isTie=!0:e.isTie=!1:e.isTie=!0,e.isTie?(e.calcTieDirection(),e.calcX(t,n),e.calcTieY()):(e.calcSlurDirection(),e.calcX(t,n),e.calcSlurY()),e.avoidCollisionAbove()},s=function(e,t,n,a,s,o,c,l,h){var u=l?1.2:1.5;t=i(t+6),n=i(n+4),a+=o?u:-u,s+=o?u:-u;var d,f=i(e.calcY(a)),p=i(e.calcY(s)),m=n-t,g=p-f,v=Math.sqrt(m*m+g*g),b=m/v,y=g/v,w=v/3.5,x=l?10:25,k=(o?-1:1)*Math.min(x,Math.max(4,w)),A=i(t+w*b-k*y),T=i(f+w*y+k*b),S=i(n-w*b-k*y),M=i(p-w*y+k*b);if(c?c+=" slur":c="slur",c+=l?" tie":" legato",h){c+=" dotted";var N=r("M %f %f C %f %f %f %f %f %f",t,f,A,T,S,M,n,p);d=e.paper.path({path:N,stroke:"#000000",fill:"none","stroke-dasharray":"5 5",class:e.controller.classes.generate(c)})}else{var C=r("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",t,f,A,T,S,M,n,p,i(S-2*y),i(M+2*b),i(A-2*y),i(T+2*b),t,f);d=e.paper.path({path:C,stroke:"none",fill:"#000000",class:e.controller.classes.generate(c)})}return d};e.exports=function(e,t,n,r,i){a(t,n,r);var o="";t.anchor1?o+="abcjs-start-m"+t.anchor1.parent.counters.measure+"-n"+t.anchor1.parent.counters.note:o+="abcjs-start-edge",t.anchor2?o+=" abcjs-end-m"+t.anchor2.parent.counters.measure+"-n"+t.anchor2.parent.counters.note:o+=" abcjs-end-edge",t.hint&&(o="abcjs-hint");var c=t.fixedY?1.5:0,l=s(e,t.startX,t.endX,t.startY+c,t.endY+c,t.above,o,t.isTie,t.dotted);return i.wrapSvgEl({el_type:"slur",startChar:-1,endChar:-1},l),[l]}},function(e,t,n){var r=n(9),i=n(3);function a(e,t,n,r,a,s){n=i(e.calcY(n)),a=i(e.calcY(a)),t=i(t),r=i(r);var o=i(n+s);return"M"+t+" "+n+" L"+r+" "+a+"L"+r+" "+i(a+s)+" L"+t+" "+o+"z"}function s(e,t,n,r,i){return(i-n)/(r-t)}function o(e,t,n,r){return t+(r-e)*n}e.exports=function(e,t){if(0!==t.beams.length){t.hint&&" abcjs-hint";for(var n="",i=0;i<t.beams.length;i++){var c=t.beams[i];if(c.split){for(var l=s(e,c.startX,c.startY,c.endX,c.endY),h=[],u=0;u<c.split.length;u+=2)h.push([c.split[u],c.split[u+1]]);for(u=0;u<h.length;u++){var d=o(c.startX,c.startY,l,h[u][0]),f=o(c.startX,c.startY,l,h[u][1]);n+=a(e,h[u][0],d,h[u][1],f,c.dy)}}else n+=a(e,c.startX,c.startY,c.endX,c.endY,c.dy)}var p=("abcjs-d"+t.duration).replace(/\./g,"-"),m=e.controller.classes.generate("beam-elem "+p);return[r(e,{path:n,stroke:"none",fill:"#000000",class:m})]}}},function(e,t,n){var r=n(84),i=n(24),a=n(1),s=n(8),o=n(13);e.exports=function(e,t,n,c,l){if(!t.invisible){var h=t.children.length>0&&"TempoElement"===t.children[0].type;t.elemset=[],o.beginGroup(e.paper,e.controller);for(var u=0;u<t.children.length;u++){var d,f=t.children[u];switch(f.type){case"TempoElement":(d=r(e,f,c))&&(t.elemset=t.elemset.concat(d));break;default:(d=i(e,f,n,c))&&t.elemset.push(d)}}var p=t.type;if(("note"===t.type||"rest"===t.type)&&(t.counters=e.controller.classes.getCurrent(),p=(p+=" d"+Math.round(1e3*t.durationClass)/1e3).replace(/\./g,"-"),t.abcelem.pitches))for(var m=0;m<t.abcelem.pitches.length;m++)p+=" p"+t.abcelem.pitches[m].pitch;var g=o.endGroup(p);g?h&&t.elemset.length>0?(e.paper.moveElementToChild(t.elemset[0],g),c.add(t,t.elemset[0],!1,l)):(t.elemset.push(g),c.add(t,g,"note"===t.type,l)):t.elemset.length>0&&c.add(t,t.elemset[0],"note"===t.type,l),t.klass&&s(t.elemset,"mark","","#00ff00"),t.hint&&s(t.elemset,"abcjs-hint","",null),t.abcelem.abselem=t;a.STEP}}},function(e,t,n){var r=n(24),i=n(4);e.exports=function(e,t,n){var a=t.x;void 0===t.pitch&&window.console.error("Tempo Element y-coordinate not set."),t.tempo.el_type="tempo",e.paper.openGroup({klass:e.controller.classes.generate("tempo")});var s,o=e.calcY(t.pitch)+2;if(t.tempo.preString){s=i(e,{x:a,y:o,text:t.tempo.preString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,"dominant-baseline":"ideographic"});var c=e.controller.getTextSize.calc(t.tempo.preString,"tempofont","tempo",s).width;a+=c+c/t.tempo.preString.length}if(t.note){t.note.setX(a);for(var l=0;l<t.note.children.length;l++)r(e,t.note.children[l],a,n);a+=t.note.w+5;var h="= "+t.tempo.bpm;s=i(e,{x:a,y:o,text:h,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0});var u=e.controller.getTextSize.calc(h,"tempofont","tempo",s).width;a+=u+u/h.length}return t.tempo.postString&&i(e,{x:a,y:o,text:t.tempo.postString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0}),[e.paper.closeGroup()]}},function(e,t,n){var r=n(26);e.exports=function(e,t,n,i){var a="abcjs-top-line";if(e.paper.openGroup({prepend:!0,klass:e.controller.classes.generate("abcjs-staff")}),1===i)r(e,t,n,6,a);else for(var s=i-1;s>=0;s--)r(e,t,n,2*(s+1),a),a=void 0;e.paper.closeGroup()}},function(e,t){e.exports=function(e,t,n){var r=e.paper.rectBeneath(t);return n&&e.paper.text(n,{x:0,y:t.y+7,"text-anchor":"start","font-size":"14px",fill:"rgba(0,0,255,.4)",stroke:"rgba(0,0,255,.4)"}),r}},function(e,t){e.exports=function(e,t,n,r){var i=(t+e.padding.right)*n,a=(e.y+e.padding.bottom)*n;e.isPrint&&(a=Math.max(a,1056));var s="Sheet Music";e.abctune&&e.abctune.metaText&&e.abctune.metaText.title&&(s+=' for "'+e.abctune.metaText.title+'"'),e.paper.setTitle(s),e.paper.insertStyles(".abcjs-dragging-in-progress text, .abcjs-dragging-in-progress tspan {"+["-webkit-touch-callout: none;","-webkit-user-select: none;","-khtml-user-select: none;","-moz-user-select: none;","-ms-user-select: none;","user-select: none;"].join(" ")+"}");var o={overflow:"hidden"};"resize"===r?e.paper.setResponsiveWidth(i,a):(o.width="",o.height=a+"px",n<1?(o.width=i+"px",e.paper.setSize(i/n,a/n)):e.paper.setSize(i,a)),e.paper.setScale(n),e.paper.setParentStyles(o)}},function(e,t,n){var r=n(89),i=n(4);e.exports=function(e,t,n){for(var a=0;a<t.rows.length;a++){var s=t.rows[a];if(s.move)e.moveY(s.move);else if(s.text){var o=s.left?s.left:0,c=i(e,{x:o,y:e.y,text:s.text,type:s.font,klass:s.klass,anchor:s.anchor});s.absElemType&&n.wrapSvgEl({el_type:s.absElemType,startChar:-1,endChar:-1,text:s.text},c)}else if(s.separator)r(e,s.separator);else if(s.startGroup)e.paper.openGroup({klass:s.klass});else if(s.endGroup){var l=e.paper.closeGroup();s.absElemType&&n.wrapSvgEl({el_type:s.absElemType,startChar:-1,endChar:-1,text:""},l)}}}},function(e,t){e.exports=function(e,t){var n=Math.round(e.y),r=(e.controller.width-t)/2,i=r+t,a="M "+r+" "+n+" L "+i+" "+n+" L "+i+" "+(n+1)+" L "+r+" "+(n+1)+" L "+r+" "+n+" z";e.paper.pathToBack({path:a,stroke:"rgba(0,0,0,0)",fill:"rgba(0,0,0,255)",class:e.controller.classes.generate("defined-text")})}},function(e,t,n){var r=n(21),i=n(22);function a(e,t,n){this.elements=[],this.paper=e,this.tuneNumber=n,this.selectTypes=t}a.prototype.getElements=function(){return this.elements},a.prototype.add=function(e,t,n,r){if(this.canSelect(e)){var i;i=void 0===this.selectTypes?{selectable:!1,"data-index":this.elements.length}:{selectable:!0,tabindex:0,"data-index":this.elements.length},this.paper.setAttributeOnElement(t,i);var a={absEl:e,svgEl:t,isDraggable:n};void 0!==r&&(a.staffPos=r),this.elements.push(a)}},a.prototype.canSelect=function(e){return!1!==this.selectTypes&&(!(!e||!e.abcelem)&&(!0===this.selectTypes||(void 0===this.selectTypes?"note"===e.abcelem.el_type:this.selectTypes.indexOf(e.abcelem.el_type)>=0)))},a.prototype.wrapSvgEl=function(e,t){var n={tuneNumber:this.tuneNumber,abcelem:e,elemset:[t],highlight:r,unhighlight:i};this.add(n,t,!1)},e.exports=a},function(e,t,n){var r=n(14),i=n(92),a=n(105);e.exports=function(e,t,n,s,o){var c,l={};if(n)for(c in n)n.hasOwnProperty(c)&&(l[c]=n[c]);if(s)for(c in s)s.hasOwnProperty(c)&&("listener"===c?l.midiListener=s[c]:"transpose"===c?l.midiTranspose=s[c]:l[c]=s[c]);if(o)for(c in o)o.hasOwnProperty(c)&&(l[c]=o[c]);return void 0===l.generateInline&&(l.generateInline=!0),l.inlineControls&&(l.inlineControls.selectionToggle=!1),r.renderEngine((function(e,t,n,r){var s="",o=a(t,l);if(l.generateInline){var c=o.inline?o.inline:o,h=e.innerHTML.indexOf("abcjs-midi-current")>=0;s+=i.generateMidiControls(t,l,c,n,h)}if(l.generateDownload){var u=o.download?o.download:o;s+=i.generateMidiDownloadLink(t,l,u,n)}e.innerHTML=s,l.generateInline&&i.attachListeners(e);var d=function(e,t){var n=e.getElementsByClassName(t);return 0===n.length?null:n[0]};if(l.generateInline&&(l.animate||l.midiListener)){var f=d(e,"abcjs-inline-midi");if(f.abcjsTune=t,f.abcjsListener=l.midiListener,f.abcjsQpm=l.qpm,f.abcjsContext=l.context,l.animate){var p=l.drumIntro?l.drumIntro:0;f.abcjsAnimate=l.animate.listener,f.abcjsTune=l.animate.target,f.abcjsTune.setTiming(l.qpm,p)}}if(l.generateInline&&l.inlineControls&&l.inlineControls.startPlaying){var m=d(e,"abcjs-midi-start");i.startPlaying(m)}}),e,t,l)}},function(e,t,n){function r(){return"performance"in window&&"now"in window.performance}r()&&("galactic"in window||(window.galactic={}),window.galactic.loc={isLocalUrl:function(){return!1}},n(93),n(94)(window.galactic),n(95),n(96),n(97),n(98),n(99),n(100),n(101),n(102),n(103),n(104));var i={};!function(){"use strict";function e(e,t){return e.replace(/%T/g,t)}i.generateMidiDownloadLink=function(e,t,n,r){var i=["abcjs-download-midi","abcjs-midi-"+r];t.downloadClass&&i.push(t.downloadClass);var a='<div class="'+i.join(" ")+'">';t.preTextDownload&&(a+=t.preTextDownload);var s,o,c=e.metaText&&e.metaText.title?e.metaText.title:"Untitled";return s=t.downloadLabel&&((o=t.downloadLabel)&&"[object Function]"==={}.toString.call(o))?t.downloadLabel(e,r):t.downloadLabel?t.downloadLabel.replace(/%T/,c):'Download MIDI for "'+c+'"',a+='<a download="'+(c=c.toLowerCase().replace(/'/g,"").replace(/\W/g,"_").replace(/__/g,"_"))+'.midi" href="'+n+'">'+s+"</a>",t.postTextDownload&&(a+=t.postTextDownload),a+"</div>"},i.deviceSupportsMidi=function(){return!!r()&&"not loaded"!==i.midiInlineInitialized},i.generateMidiControls=function(t,n,i,a,s){if(!r())return'<div class="abcjs-inline-midi abcjs-midi-'+a+"\">ERROR: this browser doesn't support window.performance</div>";if("not loaded"===i.midiInlineInitialized)return'<div class="abcjs-inline-midi abcjs-midi-'+a+'">MIDI NOT PRESENT</div>';s&&g();var o=t.metaText&&t.metaText.title?t.metaText.title:"Untitled",c=n.inlineControls||{};void 0===c.standard&&(c.standard=!0),void 0===c.tooltipSelection&&(c.tooltipSelection="Click to toggle play selection/play all."),void 0===c.tooltipLoop&&(c.tooltipLoop="Click to toggle play once/repeat."),void 0===c.tooltipReset&&(c.tooltipReset="Click to go to beginning."),void 0===c.tooltipPlay&&(c.tooltipPlay="Click to play/pause."),void 0===c.tooltipProgress&&(c.tooltipProgress="Click to change the playback position."),void 0===c.tooltipTempo&&(c.tooltipTempo="Change the playback speed.");var l="";c.hide&&(l='style="display:none;"');var h='<div class="abcjs-inline-midi abcjs-midi-'+a+'" '+l+">";if(h+='<span class="abcjs-data" style="display:none;">'+JSON.stringify(i)+"</span>",n.preTextInline&&(h+='<span class="abcjs-midi-pre">'+e(n.preTextInline,o)+"</span>"),c.selectionToggle&&(h+='<button type="button" class="abcjs-midi-selection abcjs-btn" title="'+c.tooltipSelection+'"></button>'),c.loopToggle&&(h+='<button type="button" class="abcjs-midi-loop abcjs-btn" title="'+c.tooltipLoop+'"></button>'),c.standard&&(h+='<button type="button" class="abcjs-midi-reset abcjs-btn" title="'+c.tooltipReset+'"></button><button type="button" class="abcjs-midi-start abcjs-btn" title="'+c.tooltipPlay+'"></button><button type="button" class="abcjs-midi-progress-background" title="'+c.tooltipProgress+'"><span class="abcjs-midi-progress-indicator"></span></button><span class="abcjs-midi-clock"> 0:00</span>'),c.tempo){var u=t&&t.metaText&&t.metaText.tempo&&t.metaText.tempo.bpm?t.metaText.tempo.bpm:180;h+='<span class="abcjs-tempo-wrapper"><input class="abcjs-midi-tempo" value="100" type="number" min="1" max="300" data-start-tempo="'+u+'" title="'+c.tooltipTempo+'" />% (<span class="abcjs-midi-current-tempo">'+u+"</span> BPM)</span>"}return n.postTextInline&&(h+='<span class="abcjs-midi-post">'+e(n.postTextInline,o)+"</span>"),h+"</div>"};var t="https://paulrosen.github.io/midi-js-soundfonts/FluidR3_GM/";i.setSoundFont=function(e){t=e};var n=!0;function a(e,t){return!!e&&(" "+e.className+" ").indexOf(" "+t+" ")>-1}function s(e,t){e&&(a(e,t)||(e.className=e.className+" "+t))}function o(e,t){e&&(e.className=e.className.replace(t,"").trim().replace(" "," "))}function c(e,t){e&&(a(e,t)?o(e,t):s(e,t))}function l(e,t){if(!e)return null;for(;e!==document.body;){if(a(e,t))return e;e=e.parentNode}return null}function h(e,t){if(!e)return null;var n=e.getElementsByClassName(t);return 0===n.length?null:n[0]}i.setInteractiveProgressBar=function(e){n=e};var u,d=!1;function f(e,t,n){MIDI.player.currentTime=0,MIDI.player.warp=e,MIDI.player.load({events:t}),n()}function p(e){for(var t=[],n=0;n<e.length;n++)e[n][0]&&e[n][0].event&&e[n][0].event.programNumber&&t.push(e[n][0].event.programNumber);return t}function m(){MIDI.player.start(MIDI.player.currentTime)}function g(){MIDI.player.stop()}function v(){MIDI.player.pause()}function b(e,t,n){var r=t/n,i=MIDI.player.duration;if(e&&v(),MIDI.player.currentTime=i*r,e)m();else if(x){var a=MIDI.player,s=a.currentTime/a.duration;x({currentTime:a.currentTime/1e3,duration:a.duration/1e3,progress:s})}}function y(e,n){var r=h(e,"abcjs-data"),i=JSON.parse(r.innerHTML),a=1,s=h(e,"abcjs-midi-tempo");if(s){var o=parseInt(s.value,10);o>0&&(a=100/o)}!function(e,n,r){d?f(e,n,r):MIDI.setup({debug:!1,soundfontUrl:t,instruments:p(n)}).then((function(){d=!0,f(e,n,r)})).catch((function(e){console.log("MIDI.setup failed:",e.message)}))}(a,i,n)}function w(){var e=h(document,"abcjs-midi-current");e&&(g(),o(e,"abcjs-midi-current"),o(h(e,"abcjs-midi-start"),"abcjs-pushed"))}function x(e){var t;if(e.duration>0&&u!==e.progress&&(u=e.progress,(t=h(document,"abcjs-midi-current"))&&a(h(t,"abcjs-midi-start"),"abcjs-loaded"))){if(!O){var n=h(t,"abcjs-midi-progress-background").offsetWidth,r=h(t,"abcjs-midi-progress-indicator"),i=n*u;r.style.left=i+"px"}var s=h(t,"abcjs-midi-clock");if(s){var o=Math.floor(e.currentTime),c=Math.floor(o/60);(o%=60)<10&&(o="0"+o),c<10&&(c=" "+c),s.innerHTML=c+":"+o}var l=t.abcjsQpm;!l&&t.abcjsTune&&t.abcjsTune.metaText&&t.abcjsTune.metaText.tempo&&(l=t.abcjsTune.metaText.tempo.bpm),l||(l=180);var d=parseInt(l,10)/60,f=e.currentTime;if(t.abcjsListener){var p=Math.floor(f*d);e.newBeat=p!==t.abcjsLastBeat,e.thisBeat=p,t.abcjsLastBeat=p,t.abcjsListener(t,e,t.abcjsContext)}if(t.abcjsAnimate){var m=d/64,g=function(e,t,n){for(var r,i,a=0,s=e.length-1;a<=s;)if((i=e[r=Math.floor((a+s)/2)]).milliseconds/1e3-n<t)a=r+1;else{if(!(i.milliseconds/1e3-n>t))return r;s=r-1}for(;e[r].milliseconds/1e3-n>=t&&r>0;)r--;return 0===r&&e[r].milliseconds/1e3-n>=t?-1:r}(t.abcjsTune.noteTimings,f,m);if(g!==t.abcjsLastIndex){var v=t.abcjsLastIndex>=0?t.abcjsTune.noteTimings[t.abcjsLastIndex]:null;t.abcjsAnimate(v,t.abcjsTune.noteTimings[g],t.abcjsContext),t.abcjsLastIndex=g}}}if(1===e.progress){t=h(document,"abcjs-midi-current");var b=h(t,"abcjs-midi-loop"),y=function(){b&&a(b,"abcjs-pushed")&&k(h(t,"abcjs-midi-start"))};setTimeout((function(){C(t,y),t&&t.abcjsAnimate&&t.abcjsAnimate(t.abcjsTune.noteTimings[t.abcjsLastIndex],null,t.abcjsContext)}),1)}}function k(e){var t=l(e,"abcjs-inline-midi");if(a(e,"abcjs-pushed"))return v(),void o(e,"abcjs-pushed");a(t,"abcjs-midi-current")?m():(w(),T(e,t,(function(){m()}))),s(e,"abcjs-pushed")}function A(e){for(var t=document.querySelectorAll(".abcjs-midi-current"),n=0;n<t.length;n++)o(t[n],"abcjs-midi-current");s(e,"abcjs-midi-current")}function T(e,t,n){s(e,"abcjs-loading"),y(t,(function(){o(e,"abcjs-loading"),A(t),s(e,"abcjs-loaded"),n&&n()})),t.abcjsLastBeat=-1,t.abcjsLastIndex=-1,function(e){e?MIDI.player.setAnimation(e):MIDI.player.clearAnimation()}(x)}function S(e){h(e,"abcjs-midi-progress-indicator").style.left="0px",h(e,"abcjs-midi-clock").innerHTML=" 0:00"}function M(e){c(e,"abcjs-pushed")}function N(e){c(e,"abcjs-pushed")}function C(e,t){var n=l(e,"abcjs-inline-midi");w(),n&&y(n,(function(){A(n),S(n),t&&t()}))}function E(e){var t=l(e,"abcjs-inline-midi"),n=h(t,"abcjs-midi-start"),r=a(n,"abcjs-pushed");a(t,"abcjs-midi-current")&&C(e,(function(){r&&(m(),s(n,"abcjs-pushed"))}))}function I(e,t){var n=0,r=e.offsetWidth;do{n+=e.offsetLeft-e.scrollLeft,e=e.offsetParent}while(e);var i=t.pageX-n;return i<0&&(i=0),i>r&&(i=r-1),i}function _(e){var t=l(e,"abcjs-inline-midi"),n=h(t,"abcjs-midi-start");return!!a(t,"abcjs-midi-current")&&a(n,"abcjs-pushed")}function B(e,t){var n=l(e,"abcjs-inline-midi"),r=h(n,"abcjs-midi-start"),i=e.offsetWidth,s=I(e,t);a(n,"abcjs-midi-current")?b(_(e),s,i):T(r,n,(function(){b(!1,s,i)}))}function P(e){for(var t=parseInt(e.value,10),n=parseInt(e.getAttribute("data-start-tempo"),10);e&&!a(e,"abcjs-midi-current-tempo");)e=e.nextSibling;e.innerHTML=Math.floor(t*n/100),function(e){MIDI.player.warp=e>0?100/e:1}(t)}i.startPlaying=function(e){var t=e;a(e,"abcjs-inline-midi")&&(t=e.querySelector(".abcjs-midi-start")),k(t)},i.stopPlaying=function(){g();var e=document.querySelector(".abcjs-midi-current");if(e){S(e);var t=h(e,"abcjs-midi-start");t&&o(t,"abcjs-pushed")}},i.restartPlaying=function(){E(document.querySelector(".abcjs-midi-current"))},i.setLoop=function(e,t){var n=e.querySelector(".abcjs-midi-loop");n&&(t?s(n,"abcjs-pushed"):o(n,"abcjs-pushed"))},i.setRandomProgress=function(e){var t=a(h(document.querySelector(".abcjs-midi-current"),"abcjs-midi-start"),"abcjs-pushed"),n=MIDI.player.duration;t&&v(),MIDI.player.currentTime=n*e,t&&m()};var D,L,O=!1,H=!1;i.attachListeners=function(e){for(var t=e.querySelectorAll(".abcjs-inline-midi"),r=0;r<t.length;r++){var s=t[r];s.addEventListener("click",(function(e){for(var t=(e=e||window.event).target||e.srcElement;t&&t!==document.body;){if(a(t,"abcjs-midi-start"))return void k(t);if(a(t,"abcjs-midi-selection"))return void M(t);if(a(t,"abcjs-midi-loop"))return void N(t);if(a(t,"abcjs-midi-reset"))return void E(t);if(a(t,"abcjs-midi-progress-background"))return void(n&&B(t,e));t=t.parentNode}})),s.addEventListener("change",(function(e){for(var t=(e=e||window.event).target||e.srcElement;t!==document.body;)a(t,"abcjs-midi-tempo")&&P(t),t=t.parentNode})),s.addEventListener("mousedown",(function(e){if(n){var t=(e=e||window.event).target||e.srcElement;a(t,"abcjs-midi-progress-indicator")&&(D=t,O=!0,L=l(t,"abcjs-midi-progress-background"))}}))}if(H||(H=!0,document.body.addEventListener("mousemove",(function(e){if(O){(e=e||window.event).preventDefault();var t=I(L,e);D.style.left=t+"px"}}),!0),document.body.addEventListener("mouseup",(function(e){if(O){(e=e||window.event).preventDefault();var t=I(L,e),n=L.offsetWidth;b(_(L),t,n),B(L,e),O=!1,D=null,L=null}}))),void 0===window.MIDI){i.midiInlineInitialized="not loaded";for(var o=document.getElementsByClassName("abcjs-inline-midi"),c=0;c<o.length;c++)o[c].innerHTML="MIDI NOT PRESENT"}}}(),e.exports=i},function(e,t,n){"undefined"==typeof galactic&&(galactic={}),function(t){"use strict";t.request=function(e,n,r,i){"string"==typeof e&&(e={url:e});var a=e.data,s=e.url,o=e.method||(e.data?"POST":"GET"),c=e.format,l=e.headers,h=e.mimeType,u=e.responseType,d=e.withCredentials||!1;i=i||e.onprogress,n=n||e.onsuccess,r=r||e.onerror;if("undefined"==typeof NodeFS||!t.loc.isLocalUrl(s)){var f=new XMLHttpRequest;if(f.open(o,s,!0),l)for(var p in l)f.setRequestHeader(p,l[p]);else a&&f.setRequestHeader("Content-type","application/x-www-form-urlencoded");return h&&f.overrideMimeType(h),u&&(f.responseType=u),d&&(f.withCredentials=!0),r&&"onerror"in f&&(f.onerror=r),i&&f.upload&&"onprogress"in f.upload&&(a?f.upload.onprogress=function(e){i.call(f,e,event.loaded/event.total)}:f.addEventListener("progress",(function(e){var t=0;if(e.lengthComputable)t=e.total;else if(f.totalBytes)t=f.totalBytes;else{var n=parseInt(f.getResponseHeader("Content-Length-Raw"));if(!isFinite(n))return;f.totalBytes=t=n}i.call(f,e,e.loaded/t)}),!1)),f.onreadystatechange=function(e){if(4===f.readyState)if(200===f.status||304===f.status||308===f.status||0===f.status&&window.top.cordova){if(n){var t;if("json"===c)try{t=JSON.parse(e.target.response)}catch(t){r&&r.call(f,e)}else t="xml"===c?e.target.responseXML:"text"===c?e.target.responseText:e.target.response;n.call(f,e,t)}}else r&&r.call(f,e)},f.send(a),f}NodeFS.readFile(s,"utf8",(function(e,t){e?r&&r(e):n&&n({responseText:t},t)}))},e.exports&&(e.exports=t.request)}(galactic)},function(e,t,n){"undefined"==typeof galactic&&(galactic={}),function(t){"use strict";t.module=t.module||{},t.module.DOMMisc=function(e){var t,n,r,i=e.util||(e.util={});i.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},i.errorHandler=function(e){return function(){console.warn(e,arguments)}},i.requestKioskMode=function(){e.client.nodewebkit&&win.enterKioskMode()},i.diff=function(e,t,n){if(e!==t){var r=new e.constructor,a=new t.constructor,s=!0;for(var o in e)if(n&&-1!==n.indexOf(o))r[o]=e[o],a[o]=t[o];else if(o in t){if(e[o]!==t[o])if("object"==typeof e[o]&&"object"==typeof t[o]){var c=i.diff(e[o],t[o],n);void 0!==c&&(s=!1,r[o]=c.from,a[o]=c.to)}else s=!1,r[o]=e[o],a[o]=t[o]}else s=!1,r[o]=e[o],a[o]=t[o];for(var o in t)o in e||(s=!1,r[o]=e[o],a[o]=t[o]);return s?void 0:{from:r,to:a}}},i.sort=function(e){var t,n=i.sort[e.fn]||e.fn,r=e.data||e,a=e.param;return Array.isArray(r)?t=a?r.sort((function(e,t){return n(e[a],t[a])})):r.sort(n):(t={},Object.keys(r).sort(n).forEach((function(e){t[e]=r[e]}))),t},i.sort.numeric=function(e,t){return e-t},i.sort.natural=function(e,t){var n=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,r=/(^[ ]*|[ ]*$)/g,i=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,a=/^0x[0-9a-f]+$/i,s=/^0/,o=e.toString().replace(r,"")||"",c=t.toString().replace(r,"")||"",l=o.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=c.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),u=parseInt(o.match(a))||1!=l.length&&o.match(i)&&Date.parse(o),d=parseInt(c.match(a))||u&&c.match(i)&&Date.parse(c)||null;if(d){if(u<d)return-1;if(u>d)return 1}for(var f=0,p=Math.max(l.length,h.length);f<p;f++){var m=!(l[f]||"").match(s)&&parseFloat(l[f])||l[f]||0,g=!(h[f]||"").match(s)&&parseFloat(h[f])||h[f]||0;if(isNaN(m)!==isNaN(g))return isNaN(m)?1:-1;if(typeof m!=typeof g&&(m+="",g+=""),m<g)return-1;if(m>g)return 1}return 0},i.getItems=function(e,t){var n=e.length,r={};i.each(e,(function(e){i.getItem(e,(function(i){r[e]=i,--n||t(r)}))}))},i.getItem=function(t,n){n=n||function(e){console.log(e)};var r=function(e){if(e)try{e=JSON.parse(e)}catch(e){}n(e)};if(i.exists("chrome.storage.local"))chrome.storage.local.get(t,(function(e){r(e[t])}));else{var a=(e.feature&&e.feature.prefix||"")+"/"+t,s=localStorage.getItem(a)||"";r(s)}},i.setItem=function(t,n){if(i.exists("chrome.storage.local")){var r={};r[t]=n,chrome.storage.local.set(r)}else{var a=(e.feature&&e.feature.prefix||"")+"/"+t;localStorage.setItem(a,n)}},i.Canvas=function(t,n,r){if("undefined"==typeof document){if(void 0===Canvas)return{ctx:{}};var i=new Canvas}else{i=document.createElement("canvas");"function"==typeof FlashCanvas&&(i.onload=e.client.fn.detect)}return i.ctx=i.getContext(r||"2d"),isFinite(t)&&(i.width=t||1),isFinite(n)&&(i.height=n||1),i},i.Canvas.resize=function(e,t,n){t&&n?(e.width=t,e.height=n):e.width=e.width},i.Canvas.clear=function(e){e.ctx.clearRect(0,0,e.width,e.height)},i.Context3d=function(e,t){return i.Canvas(e,t,"webgl").ctx},i.Context2d=function(e,t){return i.Canvas(e,t,"2d").ctx},i.json={},i.json.pretty=function(e){return JSON.stringify(e,null,"\t")},i.json.stringify=function(e){return JSON.stringify(e,(function(e,t){if("object"==typeof t){if(null===t)return;if(t.nodeName)return;if(t.tagName)return}return t}))},i.timestamp=function(){if("object"==typeof window){var e=window.performance;if(e&&e.now)return e.now.bind(e)}return Date.now}(),i.perf=function(e,t,n){if(!t||!e){var r=i.timestamp();return function(e,t){var n=i.timestamp(),a=Math.round(n-r);return e&&console.log(a+"ms",e),t&&(r=n),a}}for(var a=i.perf(),s=0;s<t;s++)e();console.log(a()+"ms",n||"")},i.exists=function(e,t){try{for(var n=e.split("."),r=t||window,i=0,a=n.length;i<a;i++){var s=n[i];if(null==r[s])return!1;r=r[s]}return!0}catch(e){return!1}},i.copy=(t="function"==typeof CanvasPattern,n=function(e){if(!e||"object"!=typeof e)return e;if(!(e.nodeType||t&&e instanceof CanvasPattern)){if(e.clone&&"function"==typeof e.clone)return e.clone();if(e.constructor){var r=new e.constructor;for(var i in e){var a=e[i];r[i]=a&&"object"==typeof a?n(a):a}return r}}}),i.copyInto=r=function(e,t,n){if(n=n||{},e&&"object"==typeof e)for(var i in e){var a=t[i],s=e[i],o=n.filter;if(!o||!o(s,a)){var c=typeof s;if(s&&"object"===c)if(s.nodeType){if(!n.referenceNodes)continue;t[i]=s}else t[i]=r(s,typeof a===c?a:new s.constructor,n);else t[i]=s}}return t},i.count=function(e,t,n){if(!e)return 0;if(isFinite(e.length))return e.length;if("object"==typeof e){var r=0,i=void 0!==t;if(i&&void 0!==n)for(var a in e)e[a]&&e[a][t]===n&&++r;else if(i)for(var a in e)void 0!==e[a]&&++r;else for(var a in e)++r;return r}},i.isEmpty=function(e){if(null==e)return!0;if(e.length>=0)return!e.length;for(var t in e)return!1;return!0},i.isNotEmpty=function(e){return!i.isEmpty(e)},i.clamp=function(e,t,n){return n<e?e:n>t?t:n},i.clampFinite=function(e){var t=i.INFINITY;return e>+t&&(e=+t),e<-t&&(e=-t),e},i.arrayEmpty=function(e){e.splice(0,e.length)},i.arrayIntersects=function(e,t){return t.some((function(t){return-1!==e.indexOf(t)}))},i.inArray=function(e,t){return-1!==e.indexOf(t)},i.isArray=function(e){return Array.isArray(e)||e instanceof NodeList},i.each=function(e,t){if(i.isArray(e))for(var n=0;n<e.length;n++)t(e[n],n);else for(var r in e)t(e[r],r)},i.equals=function(e,t){return"object"==typeof e?"object"==typeof t&&i.json.stringify(e)===i.json.stringify(t):e===t},i.objectToArray=function(e){var t=[];for(var n in e)t.push(e[n]);return t},i.arrayToObject=function(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n]]=!0;return t},i.addFileInput=function(t,n){e.uploader.addFileInput({target:t,onchange:function(t){t.fileInput.value="",t.addMedia({openAsNew:n,self:e.uploader})}})},i.bytesToSize=function(e,t){if(e){t=t||1;var n=Math.floor(Math.log(Math.abs(e))/Math.log(1024));return(e/Math.pow(1024,n)).toFixed(t)+["Bytes","kb","mb","gb","tb"][n]}return"0Bytes"},i.getTimeFormat=function(e,t){var n=(e/=1e3)/3600>>0,r=(e-3600*n)/60>>0,i=e-3600*n-60*r>>0;return t?(n<10&&(n="0"+n),r<10&&(r="0"+r),i<10&&(i="0"+i),n+":"+r+":"+i):{hours:n,minutes:r,seconds:i}},i.require=function(e){"string"==typeof e&&(e={url:e});var t=e.url,n=e.type||(-1!==t.indexOf(".css")?"css":"js"),r=e.async||!1,i=e.onsuccess;if("css"===n)r?setTimeout(o,0):o();else{var a=document.createElement("script");if(a.src=t,a.async=r,i){var s=!1;a.onload=a.onreadystatechange=function(){if(!1===s){var e=a.readyState;e&&!/loaded|complete/.test(e)||(s=!0,i(),a.onload=a.onreadystatechange=null)}}}document.head.appendChild(a)}function o(){var e=document.createElement("link");e.href=t,e.setAttribute("type","text/css"),e.setAttribute("rel","stylesheet"),document.head.appendChild(e)}},i.isEditingText=function(){var e=document.activeElement;if(!e)return!1;var t=e.nodeName;return("INPUT"===t||"TEXTAREA"===t||"true"===e.contentEditable)&&!e.classList.contains("sk-canvas-dummy")},i.pending=function(e,t){var n=e;return{add:function(e){n+=e||1},next:function(){--n||t()}}}},e.exports?e.exports=t.module.DOMMisc:t.module.DOMMisc(galactic)}(galactic)},function(e,t){!function(){"use strict";var e,t={},n={};function r(n){return new Promise((function(r,c){var l=n.format,h=n.codec,u=n.base64,d="audio/"+l+'; codecs="'+h+'"',f="data:"+d+";base64,"+u,p=new Audio;function m(n){function a(e,n,r,i){!t[n]&&(t[n]=i),!t[r]&&(t[r]=i),!e[n]&&(e[n]=i),e[r]=i}a(t.audio,l,h,n),t.audioapi?function(t){return new Promise((function(n,r){(e=e||new i).decodeAudioData(o(t),n,r).then((function(e){})).catch((function(e){})),setTimeout(r,250)}))}(f).then((function(){a(t.audioapi,l,h,!0),r()}),(function(e){a(t.audioapi,l,h,!1),r()})):r()}p.canPlayType(d).replace(/no/i,"")?(p.id="audio",p.controls=!1,p.setAttribute("autobuffer",!0),p.setAttribute("preload","auto"),p.addEventListener("error",(function e(t){var n;a&&!p.testedBlobURL?(p.testedBlobURL=!0,p.src=a((n=f,new Blob([o(n)],{type:s(n)})))):(p.removeEventListener("error",e),m(!1))})),p.addEventListener("canplaythrough",(function e(){p.removeEventListener("canplaythrough",e),m(!0)})),p.src=f,p.load()):m(!1)}))}var i=self.AudioContext||self.mozAudioContext||self.webkitAudioContext,a=(self.URL||self.webkitURL||{}).createObjectURL;function s(e){return(e=e.split(","))[0].split(":")[1].split(";")[0]}function o(e){e=e.split(",");for(var t=atob(e[1]),n=new ArrayBuffer(t.length),r=new Uint8Array(n),i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return n}function c(e,t,r){n[e+"_"+t]={format:e,codec:t,base64:r}}c("mpeg","mp3","//MUxAAB6AXgAAAAAPP+c6nf//yi/6f3//MUxAMAAAIAAAjEcH//0fTX6C9Lf//0//MUxA4BeAIAAAAAAKX2/6zv//+IlR4f//MUxBMCMAH8AAAAABYWalVMQU1FMy45//MUxBUB0AH0AAAAADkuM1VVVVVVVVVV//MUxBgBUATowAAAAFVVVVVVVVVVVVVV"),c("ogg","opus","T2dnUwACAAAAAAAAAAAAAAAAAAAAAEVP7KoBE09wdXNIZWFkAQEAD0SsAAAAAABPZ2dTAAAAAAAAAAAAAAAAAAABAAAAVewFUgEYT3B1c1RhZ3MIAAAAUmVjb3JkZXIAAAAAT2dnUwAEwAMAAAAAAAAAAAAAAgAAAHSiY8oBA/j//g=="),c("ogg","vorbis","T2dnUwACAAAAAAAAAAD/QwAAAAAAAM2LVKsBHgF2b3JiaXMAAAAAAUSsAAAAAAAAgLsAAAAAAAC4AU9nZ1MAAAAAAAAAAAAA/0MAAAEAAADmvOe6Dy3/////////////////MgN2b3JiaXMdAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAwNzA2MjIAAAA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hoyEoAIAMAgDAGIYMQQgYhhJBSSiGllBIAADDgAAAQYEIZKDRkRQAQJwAAGEMppJRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkgppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkqppJRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoplVJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSCgCQinAAkHowoQwUGrISAEgFAACMUUopxpyDEDHmGGPQSSgpYsw5xhyUklLlHIQQUmktt8o5CCGk1FJtmXNSWosx5hgz56SkFFvNOYdSUoux5ppr7qS0VmuuNedaWqs115xzzbm0FmuuOdecc8sx15xzzjnnGHPOOeecc84FAOA0OACAHtiwOsJJ0VhgoSErAYBUAAACGaUYc8456BBSjDnnHIQQIoUYc845CCFUjDnnHHQQQqgYc8w5CCGEkDnnHIQQQgghcw466CCEEEIHHYQQQgihlM5BCCGEEEooIYQQQgghhBA6CCGEEEIIIYQQQgghhFJKCCGEEEIJoZRQAABggQMAQIANqyOcFI0FFhqyEgAAAgCAHJagUs6EQY5Bjw1BylEzDUJMOdGZYk5qMxVTkDkQnXQSGWpB2V4yCwAAgCAAIMAEEBggKPhCCIgxAABBiMwQCYVVsMCgDBoc5gHAA0SERACQmKBIu7iALgNc0MVdB0IIQhCCWBxAAQk4OOGGJ97whBucoFNU6iAAAAAAAAwA4AEA4KAAIiKaq7C4wMjQ2ODo8AgAAAAAABYA+AAAOD6AiIjmKiwuMDI0Njg6PAIAAAAAAAAAAICAgAAAAAAAQAAAAICAT2dnUwAE7AwAAAAAAAD/QwAAAgAAADuydfsFAQEBAQEACg4ODg=="),self.AudioSupports=function(){return t.audio=!!self.Audio&&{},function(){if(navigator.requestMIDIAccess){if(-1!==Function.prototype.toString.call(navigator.requestMIDIAccess).indexOf("[native code]"))return t.midiapi={};for(var e=0;navigator.plugins.length>e;e++){if(navigator.plugins[e].name.indexOf("Jazz-Plugin")>=0)return t.midiapi={}}}t.midiapi=!1}(),t.audioapi=!!i&&{},new Promise((function(e,i){if(!t.audio)return e();setTimeout(e,5e3),Promise.all([r(n.mpeg_mp3),r(n.ogg_opus),r(n.ogg_vorbis)]).then(e)})).then((function(){return t}))},self.AudioSupports.register=c}()},function(e,t){"undefined"==typeof galactic&&(galactic={}),function(e){"use strict";galactic.EventEmitter=function(e){var t=1;function n(e,n){if("function"==typeof n)return e+"."+(n.uniqueId||(n.uniqueId=t++));console.warn(e,"listener does not exist")}function r(t){return e.on[t]?e.on[t]:e.on[t]=function(t){var r={};function i(){var t=!1;for(var n in r)r[n].apply(e,arguments)&&(t=!0);return t}return i.add=function(e){var i=n(t,e);if(void 0===r[i]&&e)return r[i]=e,{add:function(){r[i]=e},remove:function(){delete r[i]}}},i.remove=function(e){var i=n(t,e);void 0!==r[i]&&e&&delete r[i]},i.stack=r,i}(t)}e.on=function(e,t){return r(e).add(t)},e.off=function(t,n){n?r(t).remove(n):delete e.on[t]},e.emit=function(t){var n=e.on[t];if(n){var r=Array.prototype.slice.call(arguments).slice(1);return n.apply(e,r)}}}}()},function(e,t){"undefined"==typeof MIDI&&(MIDI={}),function(e){"use strict";e.DEBUG=!1,e.USE_XHR=!0,e.PATH="./soundfont/",e.DEBUG&&console&&console.log&&console.log("%c♥ MIDI.js 0.4.2 ♥","color: red;");var t={midiapi:0,audioapi:1,audio:2},n={ogg:0,mp3:1};e.setup=function(r){return new Promise((function(i,a){"function"==typeof(r=r||{})&&(r={onsuccess:r}),isFinite(r.debug)&&(e.DEBUG=!!r.debug),r.soundfontUrl&&(e.PATH=r.soundfontUrl),AudioSupports().then((function(s){function o(n){n=n.toLowerCase();var c=e.adaptor.format;function l(e){var r=parseInt(t[n])+1,i=Object.keys(t)[r];i?o(i):a&&a({message:"All plugins failed."})}s[n][c]?(r.tech=n,e.loadProgram(r).then((function(){i()})).catch((function(t){e.DEBUG&&console.error(n,t),l(t)}))):l()}!function(){for(var t in e.adaptor)delete e.adaptor[t];for(var r in n)if(s[r])return e.adaptor.format=r,!0}()?a({message:"MIDIJS: Browser does not have necessary audio support."}):s[location.hash.substr(1)]?o(location.hash.substr(1)):s.midi_api?o("midiapi"):window.AudioContext?o("audioapi"):window.Audio&&o("Audio")}),a)}))},e.loadProgram=function(t){return t||(t={}),"object"==typeof t||(t={instrument:t}),t.instruments=function(){var n=t.instruments||t.instrument||e.channels[0].program;"object"==typeof n?Array.isArray(n)||(n=Object.keys(n)):n=void 0===n?[]:[n];for(var r=0;r<n.length;r++){var i=n[r];if(i>=0){var a=e.getProgram(i);a&&(n[r]=a.nameId)}}0===n.length&&(n=["acoustic_grand_piano"]);return n}(),t.tech=t.tech||e.adaptor.id,e.adaptors._load(t)}}(MIDI)},function(e,t){"undefined"==typeof MIDI&&(MIDI={}),function(e){"use strict";var t=e.adaptor={},n=e.adaptors={},r=n._requests={};n._load=function(a){return i(),"midiapi"===a.tech?n.midiapi.connect(a):function(i){return new Promise((function(e,s){for(var o=t.format.split("_").shift(),c=i.instruments,l=i.onprogress,h=i.tech,u=c.length,d=0;d<u;d++){var f=c[d],p=r[f]||(r[f]={});p.loaded?m([f]):p.loading?p.queue.push(e):(p.queue=[e],p.loading=!0,a(f,o).then((function(e){m(e)})).catch(s))}function m(e){r[e].loading=!1;var t=!1;for(var a in r)r.hasOwnProperty(a)&&r[a].loading&&(t=!0);t||(!function e(t,n){e.progress!==t&&(e.progress=t,l&&l("load",t,n))}(1),n[h].connect(i).then((function(){c.forEach((function(e){for(var t,n=r[e];t=n.queue.pop();)t()}))})).catch(s))}}));function a(t,n,r){return new Promise((function(i,a){var s=e.PATH+t+"-"+n+".js";e.USE_XHR?galactic.request({url:s,format:"text",onerror:a,onprogress:r,onsuccess:function(e,n){var r=document.createElement("script");r.language="javascript",r.type="text/javascript",r.text=n,document.body.appendChild(r),i(t)}}):dom.loadScript.add({url:s,verify:'MIDI.Soundfont["'+t+'"]',onerror:a,onsuccess:i})}))}}(a)};function i(){var n;function r(t,n,r){e.adaptor.id&&(e.player.playing?e.loadProgram(n).then(e.player.start):e.loadProgram(n))}function i(e,t){return{configurable:!0,get:function(){return t},set:function(n){t=n,a(e)}}}function a(n){e.DEBUG&&console.warn("The "+t.id+' adaptor does not support "'+n+'".')}function s(e){return function(){a(e)}}n=performance.now(),Object.defineProperties(e,{currentTime:{configurable:!0,get:function(){return performance.now()-n}}}),e.set=function(t,n,r){if(r)return setTimeout((function(){e[t]=n}),1e3*r);e[t]=n},e.messageHandler={},e.programChange=function(t,n,i){var a=e.getProgram(n);if(a&&Number.isFinite(n=a.id)){var s=e.channels[t];if(s&&s.program!==n){i?setTimeout((function(){s.program=n}),i):s.program=n;var o=e.messageHandler.program||r;o&&o(t,n,i)}}},Object.defineProperties(e,{context:i(null),detune:i("detune",0),fx:i("fx",null),mute:i("mute",!1),volume:i("volume",1)}),e.send=s("send"),e.noteOn=s("noteOn"),e.noteOff=s("noteOff"),e.cancelNotes=s("cancelNotes"),e.setController=s("setController"),e.setEffects=s("setEffects"),e.setPitchBend=s("setPitchBend"),e.setProperty=s("setProperty"),e.setVolume=s("setVolume"),e.iOSUnlock=s("iOSUnlock")}i()}(MIDI)},function(e,t){window.Audio&&function(){"use strict";var e=MIDI.adaptors.audio={},t=[],n=-1,r=[],i={};function a(e,t,n,r){var i,a=MIDI.getNoteName(t);return r?i=setTimeout((function(){l(e,a,n)}),1e3*r):l(e,a,n),{cancel:function(){clearTimeout(i)}}}function s(e,t,n){return{cancel:function(){clearTimeout(void 0)}}}function o(e,t,n,r){for(var i=0;i<t.length;i++){var a=t[i],s=MIDI.getNoteName(a);if(s){if(r)return setTimeout((function(){l(e,s,n)}),1e3*r);l(e,s,n)}}}function c(e,t,n){for(var r=0;r<t.length;r++){var i=t[r],a=MIDI.getNoteName(i);if(a){if(n)return setTimeout((function(){h(e,a)}),1e3*n);h(e,a)}}}function l(e,a,s){var o=MIDI.channels[e];if(o){var c=o.program,l=MIDI.getProgram(c).nameId,h=l+""+a,u=(n+1)%t.length,d=MIDI.Soundfont[l];if(d){var f=t[u];f.src=d[a],f._channel=o,f._volume=s,f._id=h,i.volume(f),f.play(),n=u,r[u]=f}else MIDI.DEBUG&&console.log("404",l)}}function h(e,i){var a=MIDI.channels[e];if(a)for(var s=a.program,o=MIDI.getProgram(s).nameId+""+i,c=0,l=t.length;c<l;c++){var h=(c+n+1)%l,u=r[h];if(u&&u._id===o)return t[h].pause(),void(r[h]=null)}}e.connect=function(e){MIDI.adaptor.id="audio";for(var n=0;n<12;n++)t[n]||(t[n]=new Audio);return function(){function e(e,t,n){return{configurable:!0,get:function(){return t},set:function(r){typeof r===e&&(t=r,n&&n())}}}function t(e){return function(){for(var t in r)i[e](r[t])}}Object.defineProperties(MIDI,{mute:e("boolean",!1,t("volume")),volume:e("number",1,t("volume"))})}(),i.volume=function(e){var t=e._channel;if(MIDI.mute||t.mute)e.volume=0;else{var n=MIDI.volume*t.volume*e._volume;e.volume=Math.min(1,Math.max(-1,2*n))}},MIDI.noteOn=function(e,t,n,r){switch(typeof t){case"number":return a.apply(null,arguments);case"string":break;case"object":return o.apply(null,arguments)}},MIDI.noteOff=function(e,t,n){switch(typeof t){case"number":return s.apply(null,arguments);case"string":break;case"object":return c.apply(null,arguments)}},MIDI.stopAllNotes=function(e){if(isFinite(e));else for(var n=0,r=t.length;n<r;n++)t[n].pause()},new Promise((function(e,t){var n=MIDI.adaptors._requests,r=MIDI.Soundfont;for(var i in r){var a=n[i]||(n[i]={});a.loaded=!0,a.loading=!1}e()}))}}()},function(e,t){window.AudioContext&&function(){"use strict";var e=MIDI.adaptors,t=e.audioapi={},n=((n=new(window.AudioContext||window.webkitAudioContext)).hasDetune=function(){n.createBuffer(1,1,44100);var e=n.createBufferSource();try{return e.detune.value=1200,!0}catch(e){return!1}}(),n),r={},i=e._requests,a={},s={};function o(e,t){var n=s[e];for(var r in n)for(var i=n[r],a=0;a<i.length;a++)t(i,i[a])}t.connect=function(e){return MIDI.adaptor.id="audioapi",function(){function e(e,t,n){return{configurable:!0,get:function(){return t},set:function(r){typeof r===e&&(t=r,n&&n())}}}function t(e){return function(){MIDI.setProperty(e)}}Object.defineProperties(MIDI,{context:{configurable:!0,get:function(){return n},set:function(e){n=e}},detune:e("number",0,t("detune")),fx:e("object",null,t("fx")),mute:e("boolean",!1,t("volume")),volume:e("number",1,t("volume"))}),MIDI.setProperty=function(e,t){if(a[e])if(isFinite(t))"fx"===e&&i(MIDI.channels[t]),r();else for(var t in"fx"===e&&i(MIDI),s)r();function r(){o(t,(function(t,n){a[e](n)}))}function i(e){var t=e.fxNodes||(e.fxNodes={});for(var r in t)t[r].disconnect(n.destination),delete t[r];if(n.tunajs)for(var i=e.fx,a=0;a<i.length;a++){var s=i[a],o=s.type,c=new n.tunajs[o](s);c.connect(n.destination),t[o]=c}else MIDI.DEBUG&&console.error("fx not installed.",arguments)}}}(),a.volume=function(e){var t=e.gainNode.gain,r=e._channel;if(MIDI.mute||r.mute)t.value=0;else{var i=MIDI.volume*r.volume*e._volume;t.value=Math.min(2,Math.max(0,i))}t._fadeout&&(t.cancelScheduledValues(n.currentTime),t.linearRampToValueAtTime(t.value,t._startAt),t.linearRampToValueAtTime(0,t._startAt+.3))},a.detune=function(e){if(n.hasDetune){var t=e._channel,r=MIDI.detune+t.detune;r&&(e.detune.value=r)}},a.fx=function(e){var t=e._channel,n=e.gainNode;function r(e){if(e)for(var t in e){var r=e[t];n.connect(r.input),n=r}}e.disconnect(0),e.connect(n),r(MIDI.fxNodes),r(t.fxNodes)},MIDI.noteOn=function(e,n,r,i){switch(typeof n){case"number":return t.apply(null,arguments);case"string":break;case"object":return l.apply(null,arguments)}},MIDI.noteOff=function(e,t,n){switch(typeof t){case"number":return c.apply(null,arguments);case"string":break;case"object":return h.apply(null,arguments)}},MIDI.cancelNotes=function(e){if(isFinite(e))t(e);else for(var e in s)t(e);function t(e){o(e,(function(e,t){u(e,t)}))}},MIDI.iOSUnlock=function(){if(!0!==n.unlocked){n.unlocked=!0;var e=n.createBuffer(1,1,44100),t=n.createBufferSource();t.buffer=e,t.connect(n.destination),t.start(0)}},"suspended"===n.state&&n.resume(),new Promise((function(e,t){window.Tuna&&(n.tunajs instanceof Tuna||(n.tunajs=new Tuna(n)));var a=MIDI.Soundfont,s=Object.keys(a);for(var o in a){var c=MIDI.getProgram(o);if(c){var l=i[o]||(i[o]={});if(l.loaded)continue;if(l.decoding)l.queue.push(e);else{l.decoding=!0,l.queue.push(e),l.pending=0;var h=a[o];for(var u in h)f(o,c.id,u)}}}function d(){for(var e=0;e<s.length;e++){var t=s[e];if((r=i[t]).pending)return}for(e=0;e<s.length;e++){t=s[e];for(var n,r=i[t];n=r.queue.pop();)n()}}function f(e,t,s){var o=i[e],c=a[e][s];c&&(o.pending++,function(e){return new Promise((function(t,r){if(0===e.indexOf("data:audio"))a(function(e){e=e.split(",");for(var t=atob(e[1]),n=(e[0].split(":")[1].split(";")[0],new ArrayBuffer(t.length)),r=new Uint8Array(n),i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return n}(e));else{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){a(i.response)},i.send()}function a(e){n.decodeAudioData(e,t,r)}}))}(c).then((function(n){n.id=s;var i=MIDI.getNoteNumber(s);r[t+"x"+i]=n,--o.pending||(o.decoding=!1,o.loading=!1,o.loaded=!0,MIDI.DEBUG&&console.log("loaded: ",e),d())})).catch((function(e){MIDI.DEBUG&&console.error("audio could not load",arguments)})))}setTimeout(d,0)}));function t(e,t,i,o){var c;o=o||0;var l=MIDI.volume;if(l){var h=MIDI.channels[e],u=h.program,d=u+"x"+t,f=r[d];f?((c=n.createBufferSource()).buffer=f,c.gainNode=n.createGain(),c.gainNode.connect(n.destination),c._channel=h,c._volume=i,a.volume(c),a.detune(c),a.fx(c),c.start(o+n.currentTime),s[e]=s[e]||{},s[e][t]=s[e][t]||[],s[e][t].push(c),s[e][t].active=c):MIDI.DEBUG&&console.error(["no buffer",arguments])}return{cancel:function(){c&&c.disconnect(0)}}}function c(e,t,n){n=n||0;var r=s[e];if(r){var i=r[t];if(i){var a=i.active;a&&u(i,a,n)}}return{cancel:function(){a&&a.disconnect(0)}}}function l(e,t,n,r){for(var i,a={},s=0,o=t.length;s<o;s++)a[i=t[s]]=MIDI.noteOn(e,i,n,r);return a}function h(e,t,n){for(var r,i={},a=0,s=t.length;a<s;a++)i[r=t[a]]=MIDI.noteOff(e,r,n);return i}function u(e,t,r){var i=(r||0)+n.currentTime,a=t.gainNode.gain;a._fadeout=!0,a._startAt=i,a.linearRampToValueAtTime(a.value,i),a.linearRampToValueAtTime(0,i+.3),t.stop(i+.5),setTimeout((function(){e.shift()}),1e3*r)}}}()},function(e,t){!function(){"use strict";var e,t=MIDI.adaptors.midiapi={},n={},r={};function i(t,r,i,a){return e.send([144+t,r,127*i>>0],1e3*(a||0)),n[t+"x"+r]={_channel:MIDI.channels[t],_volume:i},{cancel:function(){}}}function a(t,r,i){return e.send([128+t,r,0],1e3*(i||0)),delete n[t+"x"+r],{cancel:function(){}}}function s(t,n,r,i){for(var a=0;a<n.length;a++)e.send([144+t,n[a],r],1e3*(i||0))}function o(t,n,r){for(var i=0;i<n.length;i++)e.send([128+t,n[i],0],1e3*(r||0))}function c(t,n,r,i){e.send([t,n,r],1e3*(i||0))}function l(t,n,r){e.send([224+t,n],1e3*(r||0))}function h(t,n,r){e.send([176+t,7,n],1e3*(r||0))}t.connect=function(t){return MIDI.adaptor.id="midiapi",function(){function t(e,t,n){return{configurable:!0,get:function(){return t},set:function(r){typeof r===e&&(t=r,n&&n())}}}function i(e){return function(){for(var t in n)r[e](n[t])}}Object.defineProperties(MIDI,{context:{configurable:!0,set:function(t){e=t},get:function(){return e}},detune:t("number",0,i("detune")),mute:t("boolean",!1,i("volume")),volume:t("number",1,i("volume"))})}(),r.volume=function(e){var t=e._channel;if(MIDI.mute||t.mute)h(t.id,0);else{var n=MIDI.volume*t.volume*e._volume;h(t.id,Math.min(1,Math.max(-1,2*n)))}},r.detune=function(e){var t=e._channel,n=MIDI.detune+t.detune;n&&l(t.id,n)},MIDI.setController=c,MIDI.setPitchBend=l,MIDI.setVolume=h,MIDI.messageHandler.program=function(t,n,r){e.send([192+t,n],1e3*(r||0))},MIDI.send=function(t,n){e.send(t,1e3*(n||0))},MIDI.noteOn=function(e,t,n,r){switch(typeof t){case"number":return i.apply(null,arguments);case"string":break;case"object":return s.apply(null,arguments)}},MIDI.noteOff=function(e,t,n){switch(typeof t){case"number":return a.apply(null,arguments);case"string":break;case"object":return o.apply(null,arguments)}},MIDI.cancelNotes=function(t){if(isFinite(t))e.send([176+t,123,0]);else{e.cancel();for(t=0;t<16;t++)e.send([176+t,123,0])}},new Promise((function(t,n){function r(e){n&&n(e)}navigator.requestMIDIAccess().then((function(n){var i=n.outputs;i.size&&i.forEach((function(t){"connected"===t.state&&"input"===t.type&&(e=t)})),null==e?r({message:"No available outputs."}):t()}),r)}))}}()},function(e,t){"undefined"==typeof MIDI&&(MIDI={}),function(e){"use strict";e.channels=function(t){for(var n=0;n<=15;n++)r(n);return t;function r(r){var i=t[r]={};function a(t,n,i){return{configurable:!0,enumerable:!0,get:function(){return i},set:function(a){typeof a===t&&(i=a,e.setProperty(n,r))}}}i.noteOn=function(t,n,i){return e.noteOn(r,t,n,i)},i.noteOff=function(t,n){return e.noteOff(r,t,n)},i.cancelNotes=function(){return e.cancelNotes(r)},i.set=function(){},Object.defineProperties(i,{id:{value:n,enumerable:!0,writable:!0},program:{value:n,enumerable:!0,writable:!0},volume:a("number","volume",1),mute:a("boolean","volume",!1),mono:a("boolean","*",!1),omni:a("boolean","*",!1),solo:a("boolean","*",!1),detune:a("number","detune",0),fx:a("object","fx",null)})}}({})}(MIDI)},function(e,t){"undefined"==typeof MIDI&&(MIDI={}),function(e){"use strict";function t(e){return e.replace(/[^a-z0-9_ ]/gi,"").replace(/[ ]/g,"_").toLowerCase()}e.getProgram=function(n){return"string"==typeof n?e.getProgram.byName[t(n)]:e.getProgram.byId[n]},function(n){var r=e.GM={},i=e.getProgram.byId={},a=e.getProgram.byName={};for(var s in n)for(var o=n[s],c=0,l=o.length;c<l;c++){var h=o[c];if(h){var u=parseInt(h.substr(0,h.indexOf(" ")),10),d=h.replace(u+" ",""),f=t(d),p=t(s),m={id:--u,name:d,nameId:f,category:s};i[u]=m,a[f]=m,r[p]=r[p]||[],r[p].push(m)}}}({Piano:["1 Acoustic Grand Piano","2 Bright Acoustic Piano","3 Electric Grand Piano","4 Honky-tonk Piano","5 Electric Piano 1","6 Electric Piano 2","7 Harpsichord","8 Clavinet"],"Chromatic Percussion":["9 Celesta","10 Glockenspiel","11 Music Box","12 Vibraphone","13 Marimba","14 Xylophone","15 Tubular Bells","16 Dulcimer"],Organ:["17 Drawbar Organ","18 Percussive Organ","19 Rock Organ","20 Church Organ","21 Reed Organ","22 Accordion","23 Harmonica","24 Tango Accordion"],Guitar:["25 Acoustic Guitar (nylon)","26 Acoustic Guitar (steel)","27 Electric Guitar (jazz)","28 Electric Guitar (clean)","29 Electric Guitar (muted)","30 Overdriven Guitar","31 Distortion Guitar","32 Guitar Harmonics"],Bass:["33 Acoustic Bass","34 Electric Bass (finger)","35 Electric Bass (pick)","36 Fretless Bass","37 Slap Bass 1","38 Slap Bass 2","39 Synth Bass 1","40 Synth Bass 2"],Strings:["41 Violin","42 Viola","43 Cello","44 Contrabass","45 Tremolo Strings","46 Pizzicato Strings","47 Orchestral Harp","48 Timpani"],Ensemble:["49 String Ensemble 1","50 String Ensemble 2","51 Synth Strings 1","52 Synth Strings 2","53 Choir Aahs","54 Voice Oohs","55 Synth Choir","56 Orchestra Hit"],Brass:["57 Trumpet","58 Trombone","59 Tuba","60 Muted Trumpet","61 French Horn","62 Brass Section","63 Synth Brass 1","64 Synth Brass 2"],Reed:["65 Soprano Sax","66 Alto Sax","67 Tenor Sax","68 Baritone Sax","69 Oboe","70 English Horn","71 Bassoon","72 Clarinet"],Pipe:["73 Piccolo","74 Flute","75 Recorder","76 Pan Flute","77 Blown Bottle","78 Shakuhachi","79 Whistle","80 Ocarina"],"Synth Lead":["81 Lead 1 (square)","82 Lead 2 (sawtooth)","83 Lead 3 (calliope)","84 Lead 4 (chiff)","85 Lead 5 (charang)","86 Lead 6 (voice)","87 Lead 7 (fifths)","88 Lead 8 (bass + lead)"],"Synth Pad":["89 Pad 1 (new age)","90 Pad 2 (warm)","91 Pad 3 (polysynth)","92 Pad 4 (choir)","93 Pad 5 (bowed)","94 Pad 6 (metallic)","95 Pad 7 (halo)","96 Pad 8 (sweep)"],"Synth Effects":["97 FX 1 (rain)","98 FX 2 (soundtrack)","99 FX 3 (crystal)","100 FX 4 (atmosphere)","101 FX 5 (brightness)","102 FX 6 (goblins)","103 FX 7 (echoes)","104 FX 8 (sci-fi)"],Ethnic:["105 Sitar","106 Banjo","107 Shamisen","108 Koto","109 Kalimba","110 Bagpipe","111 Fiddle","112 Shanai"],Percussive:["113 Tinkle Bell","114 Agogo","115 Steel Drums","116 Woodblock","117 Taiko Drum","118 Melodic Tom","119 Synth Drum","129 Percussion"],"Sound effects":["120 Reverse Cymbal","121 Guitar Fret Noise","122 Breath Noise","123 Seashore","124 Bird Tweet","125 Telephone Ring","126 Helicopter","127 Applause","128 Gunshot"]}),function(){for(var t=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"],n={},r={},i=21;i<=108;i++){var a=t[i%12]+((i-12)/12>>0);n[a]=i,r[i]=a}e.getNoteName=function(e){return e in n?e:e in r?r[e]:void 0},e.getNoteNumber=function(e){return e in r?e:e in n?n[e]:void 0}}()}(MIDI)},function(e,t){"undefined"==typeof MIDI&&(MIDI={}),MIDI.player=new function(){"use strict";var e=this;galactic.EventEmitter(e);var t,n,r,i={},a=[],s={};function o(r,h){if(!(r>e.duration)){if(h){e.playing?c():e.playing=!0;var d=(v=function(e){for(var t=0,n=s.length,r=0;r<n;r++){var i=s[r][1];if(!(t+i<e))break;t+=i}return{idx:r,time:t}}(r)).idx,f=n=v.time}else d=t,f=n;for(var p=r-e.currentTime,m=0,g=s.length;d<g&&m<=20;){var v=s[d];t=++d,n+=v[1],r=n-f;var b=v[0].event,y=b.type,w=b.subtype;if(u[w])switch(y){case"channel":k();break;case"meta":x()}}}function x(){w}function k(){var t=b.channel,i=MIDI.channels[t],s=Math.max(0,(r+p)/1e3);switch(w){case"controller":MIDI.setController(t,b.controllerType,b.value,s);break;case"programChange":var o=b.programNumber;(function(t){var n=MIDI.getProgram(t);return n&&e.instruments[n.nameId]})(o)&&MIDI.programChange(t,o,s);break;case"pitchBend":var c=b.value;MIDI.setPitchBend(t,c,s);break;case"noteOn":var l=T(b.noteNumber);a.push({promise:i.noteOn(l,b.velocity/127,s),timeout:A(b,l,n,s)}),m++;break;case"noteOff":l=T(b.noteNumber);a.push({promise:i.noteOff(l,s),timeout:A(b,l,n,s)}),m++}}function A(t,r,s,c){return setTimeout((function(){var s=galactic.util.copy(t);s.noteNumber=r,e.emit("event",s),a.shift();var c=s.channel+"x"+s.noteNumber;switch(s.subtype){case"noteOn":i[c]=s;break;case"noteOff":delete i[c]}a.length<=100&&o(n)}),1e3*c)}function T(t){return l(0,127,t+e.transpose)}}function c(){if(e.playing){for(e.playing=!1;a.length;){var t=a.pop();t&&(t.promise&&t.promise.cancel(),clearTimeout(t.timeout))}for(var n in i){var r=i[n];e.emit("event",{channel:r.channel,noteNumber:r.noteNumber,status:r.status-16,subtype:"noteOff",type:"channel"})}}}function l(e,t,n){return n<e?e:n>t?t:n}function h(){r&&(s=Replayer(MidiFile(r),e.bpm)),e.duration=function(){for(var e=s.length,t=0,n=0;n<e;n++)t+=s[n][1];return t}()}!function(){var t=0,n=!1,i=0;function a(t,n){return{get:function(){return t},set:function(i){Number.isFinite(i)&&(t=i,n&&r&&(e.stop(),h(),o(0,!0)))}}}function s(n){i=performance.now(),t=l(0,e.duration,n)}Object.defineProperties(e,{bpm:a(null,!0),warp:a(1,!0),transpose:a(0,!0),currentTime:{get:function(){return e.playing?t+(performance.now()-i):t},set:function(e){Number.isFinite(e)&&s(e)}},duration:a(0,!1),playing:{get:function(){return n},set:function(t){s(e.currentTime),n=t}}})}(),e.start=function(t){c(),e.currentTime=t,o(e.currentTime,!0)},e.stop=function(){c(),e.currentTime=0},e.pause=function(){c()},e.setAnimation=function(t){var n=0,r=0,i=0;e.clearAnimation(),requestAnimationFrame((function a(){if(e.frameId=requestAnimationFrame(a),e.duration){e.playing?(n=i===e.currentTime?r-Date.now():0,n=0===e.currentTime?0:e.currentTime-n,i!==e.currentTime&&(r=Date.now(),i=e.currentTime)):n=e.currentTime;var s=e.duration,o=n/1e3,c=o/60,l=60*c+(o-60*c),h=s/1e3;if(h-l<-1)return;var u=Math.min(1,l/h);u!==t.progress&&(t.progress=u,t({progress:u,currentTime:l,duration:h}))}}))},e.clearAnimation=function(){e.frameId&&cancelAnimationFrame(e.frameId)};var u={controller:!0,noteOff:!0,noteOn:!0,pitchBend:!0,setTempo:!0,programChange:!0};e.handleEvent=function(e,t){u[e]=t},e.load=function(t){return new Promise((function(n,i){"string"==typeof t&&(t={src:t});var a=t.src,o=t.onprogress;function c(){try{h(),e.instruments=function(){for(var e={},t={},n=0;n<s.length;n++){var r=s[n][0].event;if("channel"===r.type){var i=r.channel;switch(r.subtype){case"programChange":t[i]=r.programNumber;break;case"noteOn":var a=t[i];if(Number.isFinite(a)){if(u.programChange)var o=MIDI.getProgram(a);else i=MIDI.channels[i],o=MIDI.getProgram(i.program);e[o.nameId]=!0}}}}return e}(),MIDI.setup({instruments:e.instruments,onprogress:o}).then((function(e){n(e)})).catch((function(e){i(e)}))}catch(e){i&&i(e)}}e.stop(),t.events?(s=t.events,r=void 0,c()):-1!==a.indexOf("base64,")?(r=atob(a.split(",")[1]),c()):galactic.request({url:a,mimeType:"text/plain; charset=x-user-defined",onerror:function(){i&&i("Unable to load MIDI file: "+a)},onsuccess:function(e,t){r=function(e){for(var t=[],n=String.fromCharCode,r=0,i=e.length;r<i;r++)t[r]=n(255&e.charCodeAt(r));return t.join("")}(t),c()}})}))}}},function(e,t,n){var r,i=n(106),a=n(107);!function(){"use strict";function e(e,t,n,r){for(var i=Object.keys(n),a=0;a<i.length;a++)i[a]=parseFloat(i[a]);i.sort((function(e,t){return e-t}));for(var s=0,o=0;o<i.length;o++){var c=n[i[o]];if(i[o]>s){var l=(i[o]-s)*r;e.addRest(l),t.addRest(l),s=i[o]}for(var h=0;h<c.length;h++){var u=c[h];u.volume?(e.startNote(u.pitch,u.volume),t.startNote(u.pitch,u.volume)):(e.endNote(u.pitch),t.endNote(u.pitch))}}}r=function(t,n){void 0===n&&(n={});var r=t.setUpAudio(n),s=a(),o=new i,c=t.metaText?t.metaText.title:void 0;c&&c.length>128&&(c=c.substring(0,124)+"...");var l=t.getKeySignature(),h=t.getMeterFraction();s.setGlobalInfo(r.tempo,c,l,h),o.setGlobalInfo(r.tempo,c);for(var u=0;u<r.tracks.length;u++){s.startTrack(),o.startTrack();for(var d={},f=0;f<r.tracks[u].length;f++){var p=r.tracks[u][f];switch(p.cmd){case"text":s.setText(p.type,p.text);break;case"program":var m=0;n.pan&&n.pan.length>u&&(m=n.pan[u]),s.setChannel(p.channel,m),s.setInstrument(p.instrument),o.setChannel(p.channel),o.setInstrument(p.instrument);break;case"note":var g=p.start,v=g+p.duration;d[g]||(d[g]=[]),d[g].push({pitch:p.pitch,volume:p.volume}),d[v]||(d[v]=[]),d[v].push({pitch:p.pitch,volume:0});break;default:console.log("MIDI create Unknown: "+p.cmd)}}e(s,o,d,1920),s.endTrack(),o.endTrack()}var b=s.getData(),y=o.getData();return void 0===n.generateInline&&(n.generateInline=!0),n.generateInline&&n.generateDownload?{download:b,inline:y}:n.generateInline?y:b}}(),e.exports=r},function(e,t){var n;!function(){"use strict";(n=function(){this.tempo=0,this.timeFactor=0,this.output=[],this.currentChannel=0,this.currentInstrument=0,this.track=0,this.nextDuration=0,this.tracks=[[]]}).prototype.setInstrument=function(e){this.currentInstrument=e;var t=[{ticksToEvent:0,track:this.track,event:{channel:this.currentChannel,deltaTime:0,programNumber:this.currentInstrument,subtype:"programChange",type:"channel"}},this.nextDuration*this.timeFactor];this.tracks[this.track].push(t)},n.prototype.setChannel=function(e){this.currentChannel=e},n.prototype.startTrack=function(){this.track++,this.tracks[this.track]=[],this.nextDuration=0},n.prototype.setGlobalInfo=function(e,t){this.tempo=e;var n=Math.round(1/e*6e7);this.timeFactor=n/48e4;this.track,this.nextDuration,this.timeFactor;this.track,this.nextDuration,this.timeFactor,this.track,this.nextDuration,this.timeFactor},n.prototype.startNote=function(e,t){var n=5*Math.floor(this.nextDuration/5),r=[{ticksToEvent:n,track:this.track,event:{deltaTime:n,channel:this.currentChannel,type:"channel",noteNumber:e,velocity:t,subtype:"noteOn"}},this.nextDuration*this.timeFactor];this.tracks[this.track].push(r),this.nextDuration=0},n.prototype.endNote=function(e){var t=5*Math.floor(this.nextDuration/5),n=[{ticksToEvent:t,track:this.track,event:{deltaTime:t,channel:this.currentChannel,type:"channel",noteNumber:e,velocity:0,subtype:"noteOff"}},this.nextDuration*this.timeFactor];this.tracks[this.track].push(n),this.nextDuration=0},n.prototype.addRest=function(e){this.nextDuration+=e},n.prototype.endTrack=function(){this.track},n.prototype.getData=function(){return function(e){!function(e){for(var t=0;t<e.length;t++)for(var n=0,r=0;r<e[t].length;r++)n+=e[t][r][1],e[t][r].absTime=n}(e);var t=function(e){for(var t=[],n=0;n<e.length;n++)for(var r=0;r<e[n].length;r++)t.push(e[n][r]);return t}(e);return function(e){for(var t=0,n=0;n<e.length;n++){var r=e[n].absTime;e[n][1]=r-t,t=r}}(t=function(e){return e.sort((function(e,t){if(e.absTime>t.absTime)return 1;if(e.absTime===t.absTime&&e.length>0&&t.length>0&&e[0].event&&t[0].event){var n=e[0].event.channel,r=t[0].event.channel;if(n>r)return 1;if(n<r)return-1;if("programChange"===t[0].event.subtype)return 1}return-1}))}(t)),t}(this.tracks)}}(),e.exports=n},function(e,t){var n;!function(){"use strict";function e(e,t){for(var n in t)t.hasOwnProperty(n)&&e.setAttribute(n,t[n]);return e}function t(){this.trackstrings="",this.trackcount=0,this.noteOnAndChannel="%90",this.noteOffAndChannel="%80"}function r(e,t){for(var n="",r=0;r<e.length;r++)n+=i(e.charCodeAt(r),2);return"%00%FF"+t+i(n.length/3,2)+n}function i(e,t){for(var n=e.toString(16);n.length<t;)n="0"+n;return function(e){for(var t="",n=0;n<e.length;n+=2)t+="%",t+=e.substr(n,2);return t}(n)}function a(e){var t=0,n=[];for(e=Math.round(e);0!==e;)n.push(127&e),e>>=7;for(var r=n.length-1;r>=0;r--){t<<=8;var a=n[r];0!==r&&(a|=128),t|=a}var s=t.toString(16).length;return i(t,s+=s%2)}t.prototype.setTempo=function(e){0===this.trackcount&&(this.startTrack(),this.track+="%00%FF%51%03"+i(Math.round(6e7/e),6),this.endTrack())},t.prototype.setGlobalInfo=function(e,t,n,a){if(0===this.trackcount){this.startTrack();var s=Math.round(6e7/e);this.track+="%00%FF%51%03"+i(s,6),n&&(this.track+=function(e){if(!e||!e.accidentals)return"";for(var t=0,n=256,r=0;r<e.accidentals.length;r++)"sharp"===e.accidentals[r].acc?t++:"flat"===e.accidentals[r].acc&&n--;var a=i(256!==n?n:t,2),s="m"===e.mode?"%01":"%00";return"%00%FF%59%02"+a+s}(n)),a&&(this.track+=function(e){var t,n="%00%FF%58%04"+i(e.num,2),r={1:0,2:1,4:2,8:3,16:4,32:5}[e.den];if(!r)return"";switch(n+=i(r,2),e.num+"/"+e.den){case"2/4":case"3/4":case"4/4":case"5/4":t=24;break;case"6/4":t=72;break;case"2/2":case"3/2":case"4/2":t=48;break;case"3/8":case"6/8":case"9/8":case"12/8":t=36}return t?(n+=i(t,2))+"%08":""}(a)),t&&(this.track+=r(t,"%01")),this.endTrack()}},t.prototype.startTrack=function(){this.track="",this.trackName="",this.trackInstrument="",this.silencelength=0,this.trackcount++,this.instrument&&this.setInstrument(this.instrument)},t.prototype.endTrack=function(){this.track=this.trackName+this.trackInstrument+this.track;var e=i(this.track.length/3+4,8);this.track="MTrk"+e+this.track+"%00%FF%2F%00",this.trackstrings+=this.track},t.prototype.setText=function(e,t){switch(e){case"name":this.trackName=r(t,"%03")}},t.prototype.setInstrument=function(e){this.trackInstrument="%00%C0"+i(e,2),this.instrument=e},t.prototype.setChannel=function(e,t){this.channel=e;var n="%00%B"+this.channel.toString(16);this.track+=n+"%79%00",this.track+=n+"%40%00",this.track+=n+"%5B%30",t||(t=0),t=Math.round(64*(t+1)),this.track+=n+"%0A"+i(t,2),this.track+=n+"%07%64",this.noteOnAndChannel="%9"+this.channel.toString(16),this.noteOffAndChannel="%8"+this.channel.toString(16)},t.prototype.startNote=function(e,t){this.track+=a(this.silencelength),this.silencelength=0,this.track+=this.noteOnAndChannel,this.track+="%"+e.toString(16)+i(t,2)},t.prototype.endNote=function(e){this.track+=a(this.silencelength),this.silencelength=0,this.track+=this.noteOffAndChannel,this.track+="%"+e.toString(16)+"%00"},t.prototype.addRest=function(e){this.silencelength+=e,this.silencelength<0&&(this.silencelength=0)},t.prototype.getData=function(){return"data:audio/midi,MThd%00%00%00%06%00%01"+i(this.trackcount,4)+"%01%e0"+this.trackstrings},t.prototype.embed=function(t,n){var r=this.getData(),i=e(document.createElement("a"),{href:r});if(i.innerHTML="download midi",t.insertBefore(i,t.firstChild),!n){var a=e(document.createElement("embed"),{src:r,type:"video/quicktime",controller:"true",autoplay:"false",loop:"false",enablejavascript:"true",style:"display:block; height: 20px;"});t.insertBefore(a,t.firstChild)}},n=function(){return new t}}(),e.exports=n}])})); method in n
/plugin/amcharts/assets/amcharts/plugins/export/libs/pdfmake/
H A Dpdfmake.js16430 var lineWidth = line.getWidth();
16693 Line.prototype.getWidth = function() {
H A Dpdfmake.min.js10getWidth(),r=t.inlines&&t.inlines.length>0&&t.inlines[0].alignment,i=0;switch(r){case"right":i=e-n… method in n
H A Dpdfmake.min.js.map1getWidth","newLineForced","additionalSpacing","alignImage","imageWidth","block","ctx","img","conte…
/plugin/prosemirror/lib/
H A Dbundle.js1 !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=27)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,t.svgIcon=function(e){var t=document.createElement("span");return t.innerHTML=o(e),t};var r={"alert-circle-outline":"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z","chevron-down":"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z","file-image-outline":"M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M17,13V19H7L12,14L14,16M10,10.5A1.5,1.5 0 0,1 8.5,12A1.5,1.5 0 0,1 7,10.5A1.5,1.5 0 0,1 8.5,9A1.5,1.5 0 0,1 10,10.5Z","format-bold":"M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z","format-header-pound":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M13,8H15.31L15.63,5H17.63L17.31,8H19.31L19.63,5H21.63L21.31,8H23V10H21.1L20.9,12H23V14H20.69L20.37,17H18.37L18.69,14H16.69L16.37,17H14.37L14.69,14H13V12H14.9L15.1,10H13V8M17.1,10L16.9,12H18.9L19.1,10H17.1Z","format-header-1":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M14,18V16H16V6.31L13.5,7.75V5.44L16,4H18V16H20V18H14Z","format-header-2":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M21,18H15A2,2 0 0,1 13,16C13,15.47 13.2,15 13.54,14.64L18.41,9.41C18.78,9.05 19,8.55 19,8A2,2 0 0,0 17,6A2,2 0 0,0 15,8H13A4,4 0 0,1 17,4A4,4 0 0,1 21,8C21,9.1 20.55,10.1 19.83,10.83L15,16H21V18Z","format-header-3":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H19A2,2 0 0,1 21,6V16A2,2 0 0,1 19,18H15A2,2 0 0,1 13,16V15H15V16H19V12H15V10H19V6H15V7H13V6A2,2 0 0,1 15,4Z","format-header-4":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M18,18V13H13V11L18,4H20V11H21V13H20V18H18M18,11V7.42L15.45,11H18Z","format-header-5":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H20V6H15V10H17A4,4 0 0,1 21,14A4,4 0 0,1 17,18H15A2,2 0 0,1 13,16V15H15V16H17A2,2 0 0,0 19,14A2,2 0 0,0 17,12H15A2,2 0 0,1 13,10V6A2,2 0 0,1 15,4Z","format-header-6":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H19A2,2 0 0,1 21,6V7H19V6H15V10H19A2,2 0 0,1 21,12V16A2,2 0 0,1 19,18H15A2,2 0 0,1 13,16V6A2,2 0 0,1 15,4M15,12V16H19V12H15Z","format-header-decrease":"M4,4H6V10H10V4H12V18H10V12H6V18H4V4M20.42,7.41L16.83,11L20.42,14.59L19,16L14,11L19,6L20.42,7.41Z","format-header-equal":"M4,4H6V10H10V4H12V18H10V12H6V18H4V4M14,10V8H21V10H14M14,12H21V14H14V12Z","format-header-increase":"M4,4H6V10H10V4H12V18H10V12H6V18H4V4M14.59,7.41L18.17,11L14.59,14.59L16,16L21,11L16,6L14.59,7.41Z","format-text":"M18.5,4L19.66,8.35L18.7,8.61C18.25,7.74 17.79,6.87 17.26,6.43C16.73,6 16.11,6 15.5,6H13V16.5C13,17 13,17.5 13.33,17.75C13.67,18 14.33,18 15,18V19H9V18C9.67,18 10.33,18 10.67,17.75C11,17.5 11,17 11,16.5V6H8.5C7.89,6 7.27,6 6.74,6.43C6.21,6.87 5.75,7.74 5.3,8.61L4.34,8.35L5.5,4H18.5Z","format-italic":"M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z","format-list-bulleted":"M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z","format-list-numbers":"M7,13H21V11H7M7,19H21V17H7M7,7H21V5H7M2,11H3.8L2,13.1V14H5V13H3.2L5,10.9V10H2M3,8H4V4H2V5H3M2,17H4V17.5H3V18.5H4V19H2V20H5V16H2V17Z","format-paragraph":"M13,4A4,4 0 0,1 17,8A4,4 0 0,1 13,12H11V18H9V4H13M13,10A2,2 0 0,0 15,8A2,2 0 0,0 13,6H11V10H13Z","format-strikethrough":"M3,14H21V12H3M5,4V7H10V10H14V7H19V4M10,19H14V16H10V19Z","format-superscript":"M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,9H16.97V8L17.86,7.18C18.62,6.54 19.18,6 19.56,5.55C19.93,5.11 20.12,4.7 20.13,4.32C20.14,4.04 20.05,3.8 19.86,3.62C19.68,3.43 19.39,3.34 19,3.33C18.69,3.34 18.42,3.4 18.16,3.5L17.5,3.89L17.05,2.72C17.32,2.5 17.64,2.33 18.03,2.19C18.42,2.05 18.85,2 19.32,2C20.1,2 20.7,2.2 21.1,2.61C21.5,3 21.72,3.54 21.72,4.18C21.71,4.74 21.53,5.26 21.18,5.73C20.84,6.21 20.42,6.66 19.91,7.09L19.27,7.61V7.63H21.85V9Z","format-subscript":"M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,21.03H16.97V20.03L17.86,19.23C18.62,18.58 19.18,18.04 19.56,17.6C19.93,17.16 20.12,16.75 20.13,16.36C20.14,16.08 20.05,15.85 19.86,15.66C19.68,15.5 19.39,15.38 19,15.38C18.69,15.38 18.42,15.44 18.16,15.56L17.5,15.94L17.05,14.77C17.32,14.56 17.64,14.38 18.03,14.24C18.42,14.1 18.85,14 19.32,14C20.1,14.04 20.7,14.25 21.1,14.66C21.5,15.07 21.72,15.59 21.72,16.23C21.71,16.79 21.53,17.31 21.18,17.78C20.84,18.25 20.42,18.7 19.91,19.14L19.27,19.66V19.68H21.85V21.03Z","format-underline":"M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z","format-quote-close":"M14,17H17L19,13V7H13V13H16M6,17H9L11,13V7H5V13H8L6,17Z","console-line":"M13,19V16H21V19H13M8.5,13L2.47,7H6.71L11.67,11.95C12.25,12.54 12.25,13.5 11.67,14.07L6.74,19H2.5L8.5,13Z","translate-off":"M12.17,5.81C11.87,6.69 11.47,7.55 11,8.39L12.35,9.74C13.11,8.5 13.71,7.18 14.13,5.81H17.16V3.75H9.94V1.69H7.87V3.75H6.37L8.43,5.81H12.17M15.53,12.91L17.03,14.41L17.67,12.69L19.08,16.47L22.39,19.77L18.7,9.94H16.64L15.53,12.91M1.31,1.31L0,2.62L1.13,3.75H0.65V5.81H3.19L5.26,7.88H4.46C5.21,9.56 6.24,11.15 7.53,12.58L2.28,17.76L3.75,19.22L8.91,14.07L12.11,17.27L12.8,15.43L14.1,16.72L12,22.31H14.06L15.22,19.22H16.6L21.38,24L22.69,22.69L1.31,1.31Z","link-variant":"M10.59,13.41C11,13.8 11,14.44 10.59,14.83C10.2,15.22 9.56,15.22 9.17,14.83C7.22,12.88 7.22,9.71 9.17,7.76V7.76L12.71,4.22C14.66,2.27 17.83,2.27 19.78,4.22C21.73,6.17 21.73,9.34 19.78,11.29L18.29,12.78C18.3,11.96 18.17,11.14 17.89,10.36L18.36,9.88C19.54,8.71 19.54,6.81 18.36,5.64C17.19,4.46 15.29,4.46 14.12,5.64L10.59,9.17C9.41,10.34 9.41,12.24 10.59,13.41M13.41,9.17C13.8,8.78 14.44,8.78 14.83,9.17C16.78,11.12 16.78,14.29 14.83,16.24V16.24L11.29,19.78C9.34,21.73 6.17,21.73 4.22,19.78C2.27,17.83 2.27,14.66 4.22,12.71L5.71,11.22C5.7,12.04 5.83,12.86 6.11,13.65L5.64,14.12C4.46,15.29 4.46,17.19 5.64,18.36C6.81,19.54 8.71,19.54 9.88,18.36L13.41,14.83C14.59,13.66 14.59,11.76 13.41,10.59C13,10.2 13,9.56 13.41,9.17Z",image:"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z","arrow-expand-left":"M20,22H22V2H20V11H5.83L11.33,5.5L9.92,4.08L2,12L9.92,19.92L11.33,18.5L5.83,13H20V22Z","arrow-expand-right":"M4,2H2V22H4V13H18.17L12.67,18.5L14.08,19.92L22,12L14.08,4.08L12.67,5.5L18.17,11H4V2Z",puzzle:"M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z","puzzle-outline":"M22,13.5C22,15.26 20.7,16.72 19,16.96V20A2,2 0 0,1 17,22H13.2V21.7A2.7,2.7 0 0,0 10.5,19C9,19 7.8,20.21 7.8,21.7V22H4A2,2 0 0,1 2,20V16.2H2.3C3.79,16.2 5,15 5,13.5C5,12 3.79,10.8 2.3,10.8H2V7A2,2 0 0,1 4,5H7.04C7.28,3.3 8.74,2 10.5,2C12.26,2 13.72,3.3 13.96,5H17A2,2 0 0,1 19,7V10.04C20.7,10.28 22,11.74 22,13.5M17,15H18.5A1.5,1.5 0 0,0 20,13.5A1.5,1.5 0 0,0 18.5,12H17V7H12V5.5A1.5,1.5 0 0,0 10.5,4A1.5,1.5 0 0,0 9,5.5V7H4V9.12C5.76,9.8 7,11.5 7,13.5C7,15.5 5.75,17.2 4,17.88V20H6.12C6.8,18.25 8.5,17 10.5,17C12.5,17 14.2,18.25 14.88,20H17V15Z","code-braces":"M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",rss:"M6.18,15.64A2.18,2.18 0 0,1 8.36,17.82C8.36,19 7.38,20 6.18,20C5,20 4,19 4,17.82A2.18,2.18 0 0,1 6.18,15.64M4,4.44A15.56,15.56 0 0,1 19.56,20H16.73A12.73,12.73 0 0,0 4,7.27V4.44M4,10.1A9.9,9.9 0 0,1 13.9,20H11.07A7.07,7.07 0 0,0 4,12.93V10.1Z",emoticon:"M12,17.5C14.33,17.5 16.3,16.04 17.11,14H6.89C7.69,16.04 9.67,17.5 12,17.5M8.5,11A1.5,1.5 0 0,0 10,9.5A1.5,1.5 0 0,0 8.5,8A1.5,1.5 0 0,0 7,9.5A1.5,1.5 0 0,0 8.5,11M15.5,11A1.5,1.5 0 0,0 17,9.5A1.5,1.5 0 0,0 15.5,8A1.5,1.5 0 0,0 14,9.5A1.5,1.5 0 0,0 15.5,11M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","note-plus-outline":"M15,10H20.5L15,4.5V10M4,3H16L22,9V19A2,2 0 0,1 20,21H4C2.89,21 2,20.1 2,19V5C2,3.89 2.89,3 4,3M4,5V19H20V12H13V5H4M8,17V15H6V13H8V11H10V13H12V15H10V17H8Z","table-plus":"M18,14H20V17H23V19H20V22H18V19H15V17H18V14M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z","table-edit":"M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.08 20.21,11.08 20.42,11.3L21.7,12.58C21.92,12.79 21.92,13.14 21.7,13.35M12,18.94L18.07,12.88L20.12,14.93L14.06,21H12V18.94M4,2H18A2,2 0 0,1 20,4V8.17L16.17,12H12V16.17L10.17,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M4,6V10H10V6H4M12,6V10H18V6H12M4,12V16H10V12H4Z","table-row-plus-before":"M22,14A2,2 0 0,0 20,12H4A2,2 0 0,0 2,14V21H4V19H8V21H10V19H14V21H16V19H20V21H22V14M4,14H8V17H4V14M10,14H14V17H10V14M20,14V17H16V14H20M11,10H13V7H16V5H13V2H11V5H8V7H11V10Z","table-row-plus-after":"M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z","table-row-remove":"M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z","table-column-plus-before":"M13,2A2,2 0 0,0 11,4V20A2,2 0 0,0 13,22H22V2H13M20,10V14H13V10H20M20,16V20H13V16H20M20,4V8H13V4H20M9,11H6V8H4V11H1V13H4V16H6V13H9V11Z","table-column-plus-after":"M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z","table-column-remove":"M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z","table-border":"M21,19A1,1 0 0,1 20,20H19V18H21V19M15,20V18H17V20H15M11,20V18H13V20H11M7,20V18H9V20H7M4,20A1,1 0 0,1 3,19V18H5V20H4M19,4H5A2,2 0 0,0 3,6V8H5L11,8H13L19,8H21V6C21,4.89 20.11,4 19,4M5,14H3V16H5V14M5,10H3V12H5V10M21,10H19V12H21V10M21,14H19V16H21V14M11,16V14H13V16H11M11,12V10H13V12H11","format-align-left":"M3,3H21V5H3V3M3,7H15V9H3V7M3,11H21V13H3V11M3,15H15V17H3V15M3,19H21V21H3V19Z","format-align-center":"M3,3H21V5H3V3M7,7H17V9H7V7M3,11H21V13H3V11M7,15H17V17H7V15M3,19H21V21H3V19Z","format-align-right":"M3,3H21V5H3V3M9,7H21V9H9V7M3,11H21V13H3V11M9,15H21V17H9V15M3,19H21V21H3V19Z","table-merge-cells":"M5,10H3V6A2,2 0 0,1 5,4H11V6H5V10M19,18H13V20H19A2,2 0 0,0 21,18V14H19V18M5,18V14H3V18A2,2 0 0,0 5,20H11V18H5M19,4H13V6H19V10H21V6A2,2 0 0,0 19,4M8,13V15L11,12L8,9V11H3V13H8M16,11V9L13,12L16,15V13H21V11H16Z","arrow-split-vertical":"M18,16V13H15V22H13V2H15V11H18V8L22,12L18,16M2,12L6,16V13H9V22H11V2H9V11H6V8L2,12Z","table-remove":"M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z","settings-outline":"M19.43,12.97L21.54,14.63C21.73,14.78 21.78,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.03 19.05,18.95L16.56,17.94C16.04,18.34 15.5,18.67 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.78,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,12.97M6.5,12C6.5,12.58 6.59,13.13 6.75,13.66L4.68,15.36L5.43,16.66L7.95,15.72C8.69,16.53 9.68,17.12 10.8,17.37L11.24,20H12.74L13.18,17.37C14.3,17.13 15.3,16.54 16.05,15.73L18.56,16.67L19.31,15.37L17.24,13.67C17.41,13.14 17.5,12.58 17.5,12C17.5,11.43 17.41,10.87 17.25,10.35L19.31,8.66L18.56,7.36L16.06,8.29C15.31,7.47 14.31,6.88 13.19,6.63L12.75,4H11.25L10.81,6.63C9.69,6.88 8.69,7.47 7.94,8.29L5.44,7.35L4.69,8.65L6.75,10.35C6.59,10.87 6.5,11.43 6.5,12M12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5M12,10.5A1.5,1.5 0 0,0 10.5,12A1.5,1.5 0 0,0 12,13.5A1.5,1.5 0 0,0 13.5,12A1.5,1.5 0 0,0 12,10.5Z","checkbox-blank-outline":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z","checkbox-marked-outline":"M19,19H5V5H15V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V11H19M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z",undo:"M12.5,8C9.85,8 7.45,9 5.6,10.6L2,7V16H11L7.38,12.38C8.77,11.22 10.54,10.5 12.5,10.5C16.04,10.5 19.05,12.81 20.1,16L22.47,15.22C21.08,11.03 17.15,8 12.5,8Z",redo:"M18.4,10.6C16.55,9 14.15,8 11.5,8C6.85,8 2.92,11.03 1.54,15.22L3.9,16C4.95,12.81 7.95,10.5 11.5,10.5C13.45,10.5 15.23,11.22 16.62,12.38L13,16H22V7L18.4,10.6Z"};function o(e){var t=r["alert-circle-outline"];return void 0!==r[e]?t=r[e]:console.error("SVG icon "+e+" does not exist"),'<svg viewBox="0 0 24 24"><path d="'+t+'" /></svg>'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),"function"!=typeof t.command)throw new TypeError("command is not a function!");this.options=t,"function"==typeof t.isActive&&(this.isActive=t.isActive)}return r(e,[{key:"isActive",value:function(e){return!1}}]),r(e,[{key:"render",value:function(e){var t=this,n=this.renderDOM(e);if(!n)throw new Error("Could not generate dom for "+this.options.label+" "+JSON.stringify(this.options));return n.addEventListener("mousedown",(function(n){n.preventDefault(),t.options.command(e.state,e.dispatch,e)})),this.dom=n,n}},{key:"renderDOM",value:function(t){var n=void 0;return"function"==typeof this.options.render?n=this.options.render(t):(n=jQuery("<span>").addClass("menuitem"),this.options.icon instanceof Element&&n.append(e.renderSVGIcon(this.options.icon,this.options.label)),"string"==typeof this.options.label&&n.append(jQuery("<span>").addClass("menulabel").attr("title",this.options.label).text(this.options.label).get(0)),n=n.get(0)),n}},{key:"update",value:function(e){"function"==typeof this.options.update&&this.options.update(e,this.dom),this.isActive(e.state)?this.dom.classList.add("is-active"):this.dom.classList.remove("is-active"),this.options.command(e.state,null,e)?this.dom.classList.remove("is-disabled"):this.dom.classList.add("is-disabled")}}],[{key:"renderSVGIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return jQuery(e).addClass("menuicon").attr("title",t)}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"isAvailable",value:function(e){throw new Error("isAvailable is not implemented!")}},{key:"getMenuItem",value:function(e){throw new Error("getMenuItem is not implemented!")}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,i=n(4),a=n(13),s=n(5),l=n(6),c=n(16);if("undefined"!=typeof WeakMap){var u=new WeakMap;r=function(e){return u.get(e)},o=function(e,t){return u.set(e,t),t}}else{var f=[],p=0;r=function(e){for(var t=0;t<f.length;t+=2)if(f[t]==e)return f[t+1]},o=function(e,t){return 10==p&&(p=0),f[p++]=e,f[p++]=t}}var d=function(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r},h=function(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r};function v(e){if(e.colwidth)return e.colwidth.slice();for(var t=[],n=0;n<e.colspan;n++)t.push(0);return t}h.prototype.findCell=function(e){for(var t=0;t<this.map.length;t++){var n=this.map[t];if(n==e){for(var r=t%this.width,o=t/this.width|0,i=r+1,a=o+1,s=1;i<this.width&&this.map[t+s]==n;s++)i++;for(var l=1;a<this.height&&this.map[t+this.width*l]==n;l++)a++;return new d(r,o,i,a)}}throw new RangeError("No cell with offset "+e+" found")},h.prototype.colCount=function(e){for(var t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")},h.prototype.nextCell=function(e,t,n){var r=this.findCell(e),o=r.left,i=r.right,a=r.top,s=r.bottom;return"horiz"==t?(n<0?0==o:i==this.width)?null:this.map[a*this.width+(n<0?o-1:i)]:(n<0?0==a:s==this.height)?null:this.map[o+this.width*(n<0?a-1:s)]},h.prototype.rectBetween=function(e,t){var n=this.findCell(e),r=n.left,o=n.right,i=n.top,a=n.bottom,s=this.findCell(t),l=s.left,c=s.right,u=s.top,f=s.bottom;return new d(Math.min(r,l),Math.min(i,u),Math.max(o,c),Math.max(a,f))},h.prototype.cellsInRect=function(e){for(var t=[],n={},r=e.top;r<e.bottom;r++)for(var o=e.left;o<e.right;o++){var i=r*this.width+o,a=this.map[i];n[a]||(n[a]=!0,o==e.left&&o&&this.map[i-1]==a||r==e.top&&r&&this.map[i-this.width]==a||t.push(a))}return t},h.prototype.positionAt=function(e,t,n){for(var r=0,o=0;;r++){var i=o+n.child(r).nodeSize;if(r==e){for(var a=t+e*this.width,s=(e+1)*this.width;a<s&&this.map[a]<o;)a++;return a==s?i-1:this.map[a]}o=i}},h.get=function(e){return r(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);for(var t=function(e){for(var t=-1,n=!1,r=0;r<e.childCount;r++){var o=e.child(r),i=0;if(n)for(var a=0;a<r;a++)for(var s=e.child(a),l=0;l<s.childCount;l++){var c=s.child(l);a+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}for(var u=0;u<o.childCount;u++){var f=o.child(u);i+=f.attrs.colspan,f.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,a=[],s=0,l=t*n;s<l;s++)r[s]=0;for(var c=0,u=0;c<n;c++){var f=e.child(c);u++;for(var p=0;;p++){for(;o<r.length&&0!=r[o];)o++;if(p==f.childCount)break;for(var d=f.child(p),m=d.attrs,y=m.colspan,g=m.rowspan,b=m.colwidth,w=0;w<g;w++){if(w+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:g-w});break}for(var k=o+w*t,O=0;O<y;O++){0==r[k+O]?r[k+O]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:y-O});var M=b&&b[O];if(M){var S=(k+O)%t*2,_=a[S];null==_||_!=M&&1==a[S+1]?(a[S]=M,a[S+1]=1):_==M&&a[S+1]++}}}o+=y,u+=d.nodeSize}for(var C=(c+1)*t,x=0;o<C;)0==r[o++]&&x++;x&&(i||(i=[])).push({type:"missing",row:c,n:x}),u++}for(var A=new h(t,n,r,i),T=!1,V=0;!T&&V<a.length;V+=2)null!=a[V]&&a[V+1]<n&&(T=!0);T&&function(e,t,n){e.problems||(e.problems=[]);for(var r=0,o={};r<e.map.length;r++){var i=e.map[r];if(!o[i]){o[i]=!0;for(var a=n.nodeAt(i),s=null,l=0;l<a.attrs.colspan;l++){var c=(r+l)%e.width,u=t[2*c];null==u||a.attrs.colwidth&&a.attrs.colwidth[l]==u||((s||(s=v(a.attrs)))[l]=u)}s&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}}(A,a,e);return A}(e))};var m=new i.PluginKey("selectingCells");function y(e){for(var t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function g(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function b(e){var t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:y(t.$head)||function(e){for(var t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){var r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(var o=e.nodeBefore,i=e.pos;o;o=o.lastChild,i--){var a=o.type.spec.tableRole;if("cell"==a||"header_cell"==a)return e.doc.resolve(i-o.nodeSize)}}(t.$head)}function w(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function k(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function O(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function M(e,t,n){var r=e.start(-1),o=h.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function S(e,t,n){var r={};for(var o in e)r[o]=e[o];return r[t]=n,r}function _(e,t,n){void 0===n&&(n=1);var r=S(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((function(e){return e>0}))||(r.colwidth=null)),r}function C(e,t,n){void 0===n&&(n=1);var r=S(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o<n;o++)r.colwidth.splice(t,0,0)}return r}var x=function(e){function t(t,n){void 0===n&&(n=t);var r=t.node(-1),o=h.get(r),a=t.start(-1),s=o.rectBetween(t.pos-a,n.pos-a),l=t.node(0),c=o.cellsInRect(s).filter((function(e){return e!=n.pos-a}));c.unshift(n.pos-a);var u=c.map((function(e){var t=r.nodeAt(e),n=e+a+1;return new i.SelectionRange(l.resolve(n),l.resolve(n+t.content.size))}));e.call(this,u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(e,n){var r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(w(r)&&w(o)&&O(r,o)){var a=this.$anchorCell.node(-1)!=r.node(-1);return a&&this.isRowSelection()?t.rowSelection(r,o):a&&this.isColSelection()?t.colSelection(r,o):new t(r,o)}return i.TextSelection.between(r,o)},t.prototype.content=function(){for(var e=this.$anchorCell.node(-1),t=h.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[],a=r.top;a<r.bottom;a++){for(var l=[],c=a*t.width+r.left,u=r.left;u<r.right;u++,c++){var f=t.map[c];if(!o[f]){o[f]=!0;var p=t.findCell(f),d=e.nodeAt(f),v=r.left-p.left,m=p.right-r.right;if(v>0||m>0){var y=d.attrs;v>0&&(y=_(y,0,v)),m>0&&(y=_(y,y.colspan-m,m)),d=p.left<r.left?d.type.createAndFill(y):d.type.create(y,d.content)}if(p.top<r.top||p.bottom>r.bottom){var g=S(d.attrs,"rowspan",Math.min(p.bottom,r.bottom)-Math.max(p.top,r.top));d=p.top<r.top?d.type.createAndFill(g):d.type.create(g,d.content)}l.push(d)}}i.push(e.child(a).copy(s.Fragment.from(l)))}var b=this.isColSelection()&&this.isRowSelection()?e:i;return new s.Slice(s.Fragment.from(b),1,1)},t.prototype.replace=function(t,n){void 0===n&&(n=s.Slice.empty);for(var r=t.steps.length,o=this.ranges,i=0;i<o.length;i++){var a=o[i],l=a.$from,c=a.$to,u=t.mapping.slice(r);t.replace(u.map(l.pos),u.map(c.pos),i?s.Slice.empty:n)}var f=e.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);f&&t.setSelection(f)},t.prototype.replaceWith=function(e,t){this.replace(e,new s.Slice(s.Fragment.from(t),0,0))},t.prototype.forEachCell=function(e){for(var t=this.$anchorCell.node(-1),n=h.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r)),i=0;i<o.length;i++)e(t.nodeAt(o[i]),r+o[i])},t.prototype.isColSelection=function(){var e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;var n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount},t.colSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),a=r.findCell(n.pos-o),s=e.node(0);return i.top<=a.top?(i.top>0&&(e=s.resolve(o+r.map[i.left])),a.bottom<r.height&&(n=s.resolve(o+r.map[r.width*(r.height-1)+a.right-1]))):(a.top>0&&(n=s.resolve(o+r.map[a.left])),i.bottom<r.height&&(e=s.resolve(o+r.map[r.width*(r.height-1)+i.right-1]))),new t(e,n)},t.prototype.isRowSelection=function(){var e=h.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;var o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width},t.prototype.eq=function(e){return e instanceof t&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos},t.rowSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),a=r.findCell(n.pos-o),s=e.node(0);return i.left<=a.left?(i.left>0&&(e=s.resolve(o+r.map[i.top*r.width])),a.right<r.width&&(n=s.resolve(o+r.map[r.width*(a.top+1)-1]))):(a.left>0&&(n=s.resolve(o+r.map[a.top*r.width])),i.right<r.width&&(e=s.resolve(o+r.map[r.width*(i.top+1)-1]))),new t(e,n)},t.prototype.toJSON=function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}},t.fromJSON=function(e,n){return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,n,r){return void 0===r&&(r=n),new t(e.resolve(n),e.resolve(r))},t.prototype.getBookmark=function(){return new A(this.$anchorCell.pos,this.$headCell.pos)},t}(i.Selection);x.prototype.visible=!1,i.Selection.jsonID("cell",x);var A=function(e,t){this.anchor=e,this.head=t};function T(e){if(!(e.selection instanceof x))return null;var t=[];return e.selection.forEachCell((function(e,n){t.push(a.Decoration.node(n,n+e.nodeSize,{class:"selectedCell"}))})),a.DecorationSet.create(e.doc,t)}function V(e,t){var n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((function(e){return Number(e)})):null,o=Number(e.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(var a in t){var s=t[a].getFromDOM,l=s&&s(e);null!=l&&(i[a]=l)}return i}function j(e,t){var n={};for(var r in 1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(",")),t){var o=t[r].setDOMAttr;o&&o(e.attrs[r],n)}return n}function E(e){var t=e.cached.tableNodeTypes;if(!t)for(var n in t=e.cached.tableNodeTypes={},e.nodes){var r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}return t}function P(e){if(!e.size)return null;for(var t=e.content,n=e.openStart,r=e.openEnd;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;var o=t.firstChild,i=o.type.spec.tableRole,a=o.type.schema,l=[];if("row"==i)for(var c=0;c<t.childCount;c++){var u=t.child(c).content,f=c?0:Math.max(0,n-1),p=c<t.childCount-1?0:Math.max(0,r-1);(f||p)&&(u=N(E(a).row,new s.Slice(u,f,p)).content),l.push(u)}else{if("cell"!=i&&"header_cell"!=i)return null;l.push(n||r?N(E(a).row,new s.Slice(t,n,r)).content:t)}return function(e,t){for(var n=[],r=0;r<t.length;r++)for(var o=t[r],i=o.childCount-1;i>=0;i--)for(var a=o.child(i).attrs,l=a.rowspan,c=a.colspan,u=r;u<r+l;u++)n[u]=(n[u]||0)+c;for(var f=0,p=0;p<n.length;p++)f=Math.max(f,n[p]);for(var d=0;d<n.length;d++)if(d>=t.length&&t.push(s.Fragment.empty),n[d]<f){for(var h=E(e).cell.createAndFill(),v=[],m=n[d];m<f;m++)v.push(h);t[d]=t[d].append(s.Fragment.from(v))}return{height:t.length,width:f,rows:t}}(a,l)}function N(e,t){var n=e.createAndFill();return new l.Transform(n).replace(0,n.content.size,t).doc}function H(e,t,n){var r=e.width,o=e.height,i=e.rows;if(r!=t){for(var a=[],l=[],c=0;c<i.length;c++){for(var u=i[c],f=[],p=a[c]||0,d=0;p<t;d++){var h=u.child(d%u.childCount);p+h.attrs.colspan>t&&(h=h.type.create(_(h.attrs,h.attrs.colspan,p+h.attrs.colspan-t),h.content)),f.push(h),p+=h.attrs.colspan;for(var v=1;v<h.attrs.rowspan;v++)a[c+v]=(a[c+v]||0)+h.attrs.colspan}l.push(s.Fragment.from(f))}i=l,r=t}if(o!=n){for(var m=[],y=0,g=0;y<n;y++,g++){for(var b=[],w=i[g%o],k=0;k<w.childCount;k++){var O=w.child(k);y+O.attrs.rowspan>n&&(O=O.type.create(S(O.attrs,"rowspan",n-O.attrs.rowspan),O.content)),b.push(O)}m.push(s.Fragment.from(b))}i=m,o=n}return{width:r,height:o,rows:i}}function L(e,t,n,r,o,i,a,s){if(0==a||a==t.height)return!1;for(var l=!1,c=o;c<i;c++){var u=a*t.width+c,f=t.map[u];if(t.map[u-t.width]==f){l=!0;var p=n.nodeAt(f),d=t.findCell(f),h=d.top,v=d.left;e.setNodeMarkup(e.mapping.slice(s).map(f+r),null,S(p.attrs,"rowspan",a-h)),e.insert(e.mapping.slice(s).map(t.positionAt(a,v,n)),p.type.createAndFill(S(p.attrs,"rowspan",h+p.attrs.rowspan-a))),c+=p.attrs.colspan-1}}return l}function D(e,t,n,r,o,i,a,s){if(0==a||a==t.width)return!1;for(var l=!1,c=o;c<i;c++){var u=c*t.width+a,f=t.map[u];if(t.map[u-1]==f){l=!0;var p=n.nodeAt(f),d=t.colCount(f),h=e.mapping.slice(s).map(f+r);e.setNodeMarkup(h,null,_(p.attrs,a-d,p.attrs.colspan-(a-d))),e.insert(h+p.nodeSize,p.type.createAndFill(_(p.attrs,0,a-d))),c+=p.attrs.rowspan-1}}return l}function I(e,t,n,r,o){var i=n?e.doc.nodeAt(n-1):e.doc,a=h.get(i),l=r.top,c=r.left,u=c+o.width,f=l+o.height,p=e.tr,d=0;function v(){i=n?p.doc.nodeAt(n-1):p.doc,a=h.get(i),d=p.mapping.maps.length}(function(e,t,n,r,o,i,a){var l,c,u=E(e.doc.type.schema);if(o>t.width)for(var f=0,p=0;f<t.height;f++){var d=n.child(f);p+=d.nodeSize;var h=[],v=void 0;v=null==d.lastChild||d.lastChild.type==u.cell?l||(l=u.cell.createAndFill()):c||(c=u.header_cell.createAndFill());for(var m=t.width;m<o;m++)h.push(v);e.insert(e.mapping.slice(a).map(p-1+r),h)}if(i>t.height){for(var y=[],g=0,b=(t.height-1)*t.width;g<Math.max(t.width,o);g++){var w=!(g>=t.width)&&n.nodeAt(t.map[b+g]).type==u.header_cell;y.push(w?c||(c=u.header_cell.createAndFill()):l||(l=u.cell.createAndFill()))}for(var k=u.row.create(null,s.Fragment.from(y)),O=[],M=t.height;M<i;M++)O.push(k);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),O)}return!(!l&&!c)})(p,a,i,n,u,f,d)&&v(),L(p,a,i,n,c,u,l,d)&&v(),L(p,a,i,n,c,u,f,d)&&v(),D(p,a,i,n,l,f,c,d)&&v(),D(p,a,i,n,l,f,u,d)&&v();for(var m=l;m<f;m++){var y=a.positionAt(m,c,i),g=a.positionAt(m,u,i);p.replace(p.mapping.slice(d).map(y+n),p.mapping.slice(d).map(g+n),new s.Slice(o.rows[m-l],0,0))}v(),p.setSelection(new x(p.doc.resolve(n+a.positionAt(l,c,i)),p.doc.resolve(n+a.positionAt(f-1,u-1,i)))),t(p)}A.prototype.map=function(e){return new A(e.map(this.anchor),e.map(this.head))},A.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&O(t,n)?new x(t,n):i.Selection.near(n,1)};var R=c.keydownHandler({ArrowLeft:F("horiz",-1),ArrowRight:F("horiz",1),ArrowUp:F("vert",-1),ArrowDown:F("vert",1),"Shift-ArrowLeft":z("horiz",-1),"Shift-ArrowRight":z("horiz",1),"Shift-ArrowUp":z("vert",-1),"Shift-ArrowDown":z("vert",1),Backspace:B,"Mod-Backspace":B,Delete:B,"Mod-Delete":B});function $(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function F(e,t){return function(n,r,o){var a=n.selection;if(a instanceof x)return $(n,r,i.Selection.near(a.$headCell,t));if("horiz"!=e&&!a.empty)return!1;var s=K(o,e,t);if(null==s)return!1;if("horiz"==e)return $(n,r,i.Selection.near(n.doc.resolve(a.head+t),t));var l,c=n.doc.resolve(s),u=M(c,e,t);return l=u?i.Selection.near(u,1):t<0?i.Selection.near(n.doc.resolve(c.before(-1)),-1):i.Selection.near(n.doc.resolve(c.after(-1)),1),$(n,r,l)}}function z(e,t){return function(n,r,o){var i=n.selection;if(!(i instanceof x)){var a=K(o,e,t);if(null==a)return!1;i=new x(n.doc.resolve(a))}var s=M(i.$headCell,e,t);return!!s&&$(n,r,new x(i.$anchorCell,s))}}function B(e,t){var n=e.selection;if(!(n instanceof x))return!1;if(t){var r=e.tr,o=E(e.schema).cell.createAndFill().content;n.forEachCell((function(e,t){e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new s.Slice(o,0,0))})),r.docChanged&&t(r)}return!0}function J(e,t){var n=y(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new x(n))),!0)}function W(e,t,n){if(!g(e.state))return!1;var r=P(n),o=e.state.selection;if(o instanceof x){r||(r={width:1,height:1,rows:[s.Fragment.from(N(E(e.state.schema).cell,n))]});var i=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),l=h.get(i).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=H(r,l.right-l.left,l.bottom-l.top),I(e.state,e.dispatch,a,l,r),!0}if(r){var c=b(e.state),u=c.start(-1);return I(e.state,e.dispatch,u,h.get(c.node(-1)).findCell(c.pos-u),r),!0}return!1}function q(e,t){if(!t.ctrlKey&&!t.metaKey){var n,r=G(e,t.target);if(t.shiftKey&&e.state.selection instanceof x)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=y(e.state.selection.$anchor))&&Q(e,t).pos!=n.pos)o(n,t),t.preventDefault();else if(!r)return;e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",a)}function o(t,n){var r=Q(e,n),o=null==m.getState(e.state);if(!r||!O(t,r)){if(!o)return;r=t}var i=new x(t,r);if(o||!e.state.selection.eq(i)){var a=e.state.tr.setSelection(i);o&&a.setMeta(m,t.pos),e.dispatch(a)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",a),null!=m.getState(e.state)&&e.dispatch(e.state.tr.setMeta(m,-1))}function a(n){var a,s=m.getState(e.state);if(null!=s)a=e.state.doc.resolve(s);else if(G(e,n.target)!=r&&!(a=Q(e,t)))return i();a&&o(a,n)}}function K(e,t,n){if(!(e.state.selection instanceof i.TextSelection))return null;for(var r=e.state.selection.$head,o=r.depth-1;o>=0;o--){var a=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:a.childCount))return null;if("cell"==a.type.spec.tableRole||"header_cell"==a.type.spec.tableRole){var s=r.before(o),l="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?s:null}}return null}function G(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function Q(e,t){var n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?y(e.state.doc.resolve(n.pos)):null}function Z(e,t){var n,r=function(t,r){"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){var o=h.get(t);if(!o.problems)return r;r||(r=e.tr);for(var i,a,s=[],l=0;l<o.height;l++)s.push(0);for(var c=0;c<o.problems.length;c++){var u=o.problems[c];if("collision"==u.type){for(var f=t.nodeAt(u.pos),p=0;p<f.attrs.rowspan;p++)s[u.row+p]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,_(f.attrs,f.attrs.colspan-u.n,u.n))}else if("missing"==u.type)s[u.row]+=u.n;else if("overlong_rowspan"==u.type){var d=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,S(d.attrs,"rowspan",d.attrs.rowspan-u.n))}else if("colwidth mismatch"==u.type){var v=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,S(v.attrs,"colwidth",u.colwidth))}}for(var m=0;m<s.length;m++)s[m]&&(null==i&&(i=m),a=m);for(var y=0,g=n+1;y<o.height;y++){var b=t.child(y),w=g+b.nodeSize,k=s[y];if(k>0){var O="cell";b.firstChild&&(O=b.firstChild.type.spec.tableRole);for(var M=[],C=0;C<k;C++)M.push(E(e.schema)[O].createAndFill());var x=0!=y&&i!=y-1||a!=y?w-1:g+1;r.insert(r.mapping.map(x),M)}g=w}return r}(e,t,r,n))};return t?t.doc!=e.doc&&function e(t,n,r,o){var i=t.childCount,a=n.childCount;e:for(var s=0,l=0;s<a;s++){for(var c=n.child(s),u=l,f=Math.min(i,s+3);u<f;u++)if(t.child(u)==c){l=u+1,r+=c.nodeSize;continue e}o(c,r),l<i&&t.child(l).sameMarkup(c)?e(t.child(l),c,r+1,o):c.nodesBetween(0,c.content.size,o,r+1),r+=c.nodeSize}}(t.doc,e.doc,0,r):e.doc.descendants(r),n}function U(e){var t,n=e.selection,r=b(e),o=r.node(-1),i=r.start(-1),a=h.get(o);return(t=n instanceof x?a.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):a.findCell(r.pos-i)).tableStart=i,t.map=a,t.table=o,t}function X(e,t,n){var r=t.map,o=t.tableStart,i=t.table,a=n>0?-1:0;(function(e,t,n){for(var r=E(t.type.schema).header_cell,o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(r,i,n+a)&&(a=0==n||n==r.width?null:0);for(var s=0;s<r.height;s++){var l=s*r.width+n;if(n>0&&n<r.width&&r.map[l-1]==r.map[l]){var c=r.map[l],u=i.nodeAt(c);e.setNodeMarkup(e.mapping.map(o+c),null,C(u.attrs,n-r.colCount(c))),s+=u.attrs.rowspan-1}else{var f=null==a?E(i.type.schema).cell:i.nodeAt(r.map[l+a]).type,p=r.positionAt(s,n,i);e.insert(e.mapping.map(o+p),f.createAndFill())}}return e}function Y(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,a=e.mapping.maps.length,s=0;s<r.height;){var l=s*r.width+n,c=r.map[l],u=o.nodeAt(c);if(n>0&&r.map[l-1]==c||n<r.width-1&&r.map[l+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(i+c),null,_(u.attrs,n-r.colCount(c)));else{var f=e.mapping.slice(a).map(i+c);e.delete(f,f+u.nodeSize)}s+=u.attrs.rowspan}}function ee(e,t,n){for(var r=t.map,o=t.tableStart,i=t.table,a=o,s=0;s<n;s++)a+=i.child(s).nodeSize;var l=[],c=n>0?-1:0;(function(e,t,n){for(var r=E(t.type.schema).header_cell,o=0;o<e.width;o++)if(t.nodeAt(e.map[o+n*e.width]).type!=r)return!1;return!0})(r,i,n+c)&&(c=0==n||n==r.height?null:0);for(var u=0,f=r.width*n;u<r.width;u++,f++)if(n>0&&n<r.height&&r.map[f]==r.map[f-r.width]){var p=r.map[f],d=i.nodeAt(p).attrs;e.setNodeMarkup(o+p,null,S(d,"rowspan",d.rowspan+1)),u+=d.colspan-1}else{var h=null==c?E(i.type.schema).cell:i.nodeAt(r.map[f+c*r.width]).type;l.push(h.createAndFill())}return e.insert(a,E(i.type.schema).row.create(null,l)),e}function te(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,a=0,s=0;s<n;s++)a+=o.child(s).nodeSize;var l=a+o.child(n).nodeSize,c=e.mapping.maps.length;e.delete(a+i,l+i);for(var u=0,f=n*r.width;u<r.width;u++,f++){var p=r.map[f];if(n>0&&p==r.map[f-r.width]){var d=o.nodeAt(p).attrs;e.setNodeMarkup(e.mapping.slice(c).map(p+i),null,S(d,"rowspan",d.rowspan-1)),u+=d.colspan-1}else if(n<r.width&&p==r.map[f+r.width]){var h=o.nodeAt(p),v=h.type.create(S(h.attrs,"rowspan",h.attrs.rowspan-1),h.content),m=r.positionAt(n+1,u,o);e.insert(e.mapping.slice(c).map(i+m),v),u+=h.attrs.colspan-1}}}function ne(e){var t=e.content;return 1==t.childCount&&t.firstChild.isTextblock&&0==t.firstChild.childCount}function re(e,t,n){for(var r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1}),o=0;o<r.length;o++){var i=t.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function oe(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!g(t))return!1;if(n){for(var r=E(t.schema),o=U(t),i=t.tr,a=o.map.cellsInRect("column"==e?new d(o.left,0,o.right,o.map.height):"row"==e?new d(0,o.top,o.map.width,o.bottom):o),s=a.map((function(e){return o.table.nodeAt(e)})),l=0;l<a.length;l++)s[l].type==r.header_cell&&i.setNodeMarkup(o.tableStart+a[l],r.cell,s[l].attrs);if(0==i.steps.length)for(var c=0;c<a.length;c++)i.setNodeMarkup(o.tableStart+a[c],r.header_cell,s[c].attrs);n(i)}return!0}}(e):function(t,n){if(!g(t))return!1;if(n){var r=E(t.schema),o=U(t),i=t.tr,a=re("row",o,r),s=re("column",o,r),l=("column"===e?a:"row"===e&&s)?1:0,c="column"==e?new d(0,l,1,o.map.height):"row"==e?new d(l,0,o.map.width,1):o,u="column"==e?s?r.cell:r.header_cell:"row"==e?a?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach((function(e){var t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,u,n.attrs)})),n(i)}return!0}}var ie=oe("row",{useDeprecatedLogic:!0}),ae=oe("column",{useDeprecatedLogic:!0}),se=oe("cell",{useDeprecatedLogic:!0});var le=function(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ce(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function ce(e,t,n,r,o,i){for(var a=0,s=!0,l=t.firstChild,c=e.firstChild,u=0,f=0;u<c.childCount;u++)for(var p=c.child(u).attrs,d=p.colspan,h=p.colwidth,v=0;v<d;v++,f++){var m=o==f?i:h&&h[v],y=m?m+"px":"";a+=m||r,m||(s=!1),l?(l.style.width!=y&&(l.style.width=y),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=y}for(;l;){var g=l.nextSibling;l.parentNode.removeChild(l),l=g}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}le.prototype.update=function(e){return e.type==this.node.type&&(this.node=e,ce(e,this.colgroup,this.table,this.cellMinWidth),!0)},le.prototype.ignoreMutation=function(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))};var ue=new i.PluginKey("tableColumnResizing");var fe=function(e,t){this.activeHandle=e,this.dragging=t};function pe(e,t,n){var r=e.posAtCoords({left:t.clientX,top:t.clientY}).pos,o=y(e.state.doc.resolve(r));if(!o)return-1;if("right"==n)return o.pos;var i=h.get(o.node(-1)),a=o.start(-1),s=i.map.indexOf(o.pos-a);return s%i.width==0?-1:a+i.map[s-1]}function de(e,t,n){var r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function he(e,t){e.dispatch(e.state.tr.setMeta(ue,{setHandle:t}))}function ve(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}fe.prototype.apply=function(e){var t=this,n=e.getMeta(ue);if(n&&null!=n.setHandle)return new fe(n.setHandle,null);if(n&&void 0!==n.setDragging)return new fe(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){var r=e.mapping.map(t.activeHandle,-1);w(e.doc.resolve(r))||(r=null),t=new fe(r,t.dragging)}return t},t.tableEditing=function(e){void 0===e&&(e={});var t=e.allowTableNodeSelection;return void 0===t&&(t=!1),new i.Plugin({key:m,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(m);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;var r=e.mapping.mapResult(t),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:T,handleDOMEvents:{mousedown:q},createSelectionBetween:function(e){if(null!=m.getState(e.state))return e.state.selection},handleTripleClick:J,handleKeyDown:R,handlePaste:W},appendTransaction:function(e,n,r){return function(e,t,n){var r,o,a=(t||e).selection,s=(t||e).doc;if(a instanceof i.NodeSelection&&(o=a.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=x.create(s,a.from);else if("row"==o){var l=s.resolve(a.from+1);r=x.rowSelection(l,l)}else if(!n){var c=h.get(a.node),u=a.from+1,f=u+c.map[c.width*c.height-1];r=x.create(s,u+1,f)}}else a instanceof i.TextSelection&&function(e){var t=e.$from,n=e.$to;if(t.pos==n.pos||t.pos<t.pos-6)return!1;for(var r=t.pos,o=n.pos,i=t.depth;i>=0&&!(t.after(i+1)<t.end(i));i--,r++);for(var a=n.depth;a>=0&&!(n.before(a+1)>n.start(a));a--,o--);return r==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(a)?r=i.TextSelection.create(s,a.from):a instanceof i.TextSelection&&function(e){for(var t,n,r=e.$from,o=e.$to,i=r.depth;i>0;i--){var a=r.node(i);if("cell"===a.type.spec.tableRole||"header_cell"===a.type.spec.tableRole){t=a;break}}for(var s=o.depth;s>0;s--){var l=o.node(s);if("cell"===l.type.spec.tableRole||"header_cell"===l.type.spec.tableRole){n=l;break}}return t!==n&&0===o.parentOffset}(a)&&(r=i.TextSelection.create(s,a.$from.start(),a.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,Z(r,n),t)}})},t.fixTables=Z,t.handlePaste=W,t.cellAround=y,t.isInTable=g,t.selectionCell=b,t.moveCellForward=k,t.inSameTable=O,t.findCell=function(e){return h.get(e.node(-1)).findCell(e.pos-e.start(-1))},t.colCount=function(e){return h.get(e.node(-1)).colCount(e.pos-e.start(-1))},t.nextCell=M,t.tableNodes=function(e){var t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var r in t)n[r]={default:t[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:function(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:function(){return["tr",0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(e){return V(e,t)}}],toDOM:function(e){return["td",j(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(e){return V(e,t)}}],toDOM:function(e){return["th",j(e,t),0]}}}},t.CellSelection=x,t.TableMap=h,t.columnResizing=function(e){void 0===e&&(e={});var t=e.handleWidth;void 0===t&&(t=5);var n=e.cellMinWidth;void 0===n&&(n=25);var r=e.View;void 0===r&&(r=le);var o=e.lastColumnResizable;return void 0===o&&(o=!0),new i.Plugin({key:ue,state:{init:function(e,t){return this.spec.props.nodeViews[E(t.schema).table.name]=function(e,t){return new r(e,n,t)},new fe(-1,!1)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return ue.getState(e).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,n){!function(e,t,n,r,o){var i=ue.getState(e.state);if(!i.dragging){var a=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=-1;if(a){var l=a.getBoundingClientRect(),c=l.left,u=l.right;t.clientX-c<=n?s=pe(e,t,"left"):u-t.clientX<=n&&(s=pe(e,t,"right"))}if(s!=i.activeHandle){if(!o&&-1!==s){var f=e.state.doc.resolve(s),p=f.node(-1),d=h.get(p),v=f.start(-1);if(d.colCount(f.pos-v)+f.nodeAfter.attrs.colspan-1==d.width-1)return}he(e,s)}}}(e,n,t,0,o)},mouseleave:function(e){!function(e){var t=ue.getState(e.state);t.activeHandle>-1&&!t.dragging&&he(e,-1)}(e)},mousedown:function(e,t){!function(e,t,n){var r=ue.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;var o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var a=e.domAtPos(t),s=a.node.childNodes[a.offset].offsetWidth,l=r;if(o)for(var c=0;c<r;c++)o[c]&&(s-=o[c],l--);return s/l}(e,r.activeHandle,o.attrs);function a(t){window.removeEventListener("mouseup",a),window.removeEventListener("mousemove",s);var r=ue.getState(e.state);r.dragging&&(!function(e,t,n){for(var r=e.state.doc.resolve(t),o=r.node(-1),i=h.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,l=e.state.tr,c=0;c<i.height;c++){var u=c*i.width+s;if(!c||i.map[u]!=i.map[u-i.width]){var f=i.map[u],p=o.nodeAt(f).attrs,d=1==p.colspan?0:s-i.colCount(f);if(!p.colwidth||p.colwidth[d]!=n){var v=p.colwidth?p.colwidth.slice():ve(p.colspan);v[d]=n,l.setNodeMarkup(a+f,null,S(p,"colwidth",v))}}}l.docChanged&&e.dispatch(l)}(e,r.activeHandle,de(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(ue,{setDragging:null})))}function s(t){if(!t.which)return a(t);var r=ue.getState(e.state),o=de(r.dragging,t,n);!function(e,t,n,r){var o=e.state.doc.resolve(t),i=o.node(-1),a=o.start(-1),s=h.get(i).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1,l=e.domAtPos(o.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;ce(i,l.firstChild,l,r,s,n)}(e,r.activeHandle,o,n)}e.dispatch(e.state.tr.setMeta(ue,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",a),window.addEventListener("mousemove",s),t.preventDefault()}(e,t,n)}},decorations:function(e){var t=ue.getState(e);if(t.activeHandle>-1)return function(e,t){for(var n=[],r=e.doc.resolve(t),o=r.node(-1),i=h.get(o),s=r.start(-1),l=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan,c=0;c<i.height;c++){var u=l+c*i.width-1;if(!(l!=i.width&&i.map[u]==i.map[u+1]||0!=c&&i.map[u-1]==i.map[u-1-i.width])){var f=i.map[u],p=s+f+o.nodeAt(f).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",n.push(a.Decoration.widget(p,d))}}return a.DecorationSet.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}})},t.columnResizingPluginKey=ue,t.updateColumnsOnResize=ce,t.__pastedCells=P,t.__insertCells=I,t.__clipCells=H,t.addColumn=X,t.addColumnBefore=function(e,t){if(!g(e))return!1;if(t){var n=U(e);t(X(e.tr,n,n.left))}return!0},t.addColumnAfter=function(e,t){if(!g(e))return!1;if(t){var n=U(e);t(X(e.tr,n,n.right))}return!0},t.removeColumn=Y,t.deleteColumn=function(e,t){if(!g(e))return!1;if(t){var n=U(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;Y(r,n,o),o!=n.left;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=h.get(n.table);t(r)}return!0},t.addRow=ee,t.addRowBefore=function(e,t){if(!g(e))return!1;if(t){var n=U(e);t(ee(e.tr,n,n.top))}return!0},t.addRowAfter=function(e,t){if(!g(e))return!1;if(t){var n=U(e);t(ee(e.tr,n,n.bottom))}return!0},t.removeRow=te,t.deleteRow=function(e,t){if(!g(e))return!1;if(t){var n=U(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;te(r,n,o),o!=n.top;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=h.get(n.table);t(r)}return!0},t.mergeCells=function(e,t){var n=e.selection;if(!(n instanceof x)||n.$anchorCell.pos==n.$headCell.pos)return!1;var r=U(e),o=r.map;if(function(e,t){for(var n=e.width,r=e.height,o=e.map,i=t.top*n+t.left,a=i,s=(t.bottom-1)*n+t.left,l=i+(t.right-t.left-1),c=t.top;c<t.bottom;c++){if(t.left>0&&o[a]==o[a-1]||t.right<n&&o[l]==o[l+1])return!0;a+=n,l+=n}for(var u=t.left;u<t.right;u++){if(t.top>0&&o[i]==o[i-n]||t.bottom<r&&o[s]==o[s+n])return!0;i++,s++}return!1}(o,r))return!1;if(t){for(var i,a,l=e.tr,c={},u=s.Fragment.empty,f=r.top;f<r.bottom;f++)for(var p=r.left;p<r.right;p++){var d=o.map[f*o.width+p],h=r.table.nodeAt(d);if(!c[d])if(c[d]=!0,null==i)i=d,a=h;else{ne(h)||(u=u.append(h.content));var v=l.mapping.map(d+r.tableStart);l.delete(v,v+h.nodeSize)}}if(l.setNodeMarkup(i+r.tableStart,null,S(C(a.attrs,a.attrs.colspan,r.right-r.left-a.attrs.colspan),"rowspan",r.bottom-r.top)),u.size){var m=i+1+a.content.size,y=ne(a)?i+1:m;l.replaceWith(y+r.tableStart,m+r.tableStart,u)}l.setSelection(new x(l.doc.resolve(i+r.tableStart))),t(l)}return!0},t.splitCell=function(e,t){var n,r,o=e.selection;if(o instanceof x){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;n=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{if(!(n=function(e){for(var t=e.depth-1;t>0;t--){var n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(o.$from)))return!1;r=y(o.$from).pos}if(1==n.attrs.colspan&&1==n.attrs.rowspan)return!1;if(t){var i=n.attrs,a=[],s=i.colwidth;i.rowspan>1&&(i=S(i,"rowspan",1)),i.colspan>1&&(i=S(i,"colspan",1));for(var l=U(e),c=e.tr,u=0;u<l.right-l.left;u++)a.push(s?S(i,"colwidth",s&&s[u]?[s[u]]:null):i);for(var f,p=E(e.schema)[n.type.spec.tableRole],d=0;d<l.bottom;d++)if(d>=l.top){var h=l.map.positionAt(d,l.left,l.table);d==l.top&&(h+=n.nodeSize);for(var v=l.left,m=0;v<l.right;v++,m++)v==l.left&&d==l.top||c.insert(f=c.mapping.map(h+l.tableStart,1),p.createAndFill(a[m]))}c.setNodeMarkup(r,null,a[0]),o instanceof x&&c.setSelection(new x(c.doc.resolve(o.$anchorCell.pos),f&&c.doc.resolve(f))),t(c)}return!0},t.setCellAttr=function(e,t){return function(n,r){if(!g(n))return!1;var o=b(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){var i=n.tr;n.selection instanceof x?n.selection.forEachCell((function(n,r){n.attrs[e]!==t&&i.setNodeMarkup(r,null,S(n.attrs,e,t))})):i.setNodeMarkup(o.pos,null,S(o.nodeAfter.attrs,e,t)),r(i)}return!0}},t.toggleHeader=oe,t.toggleHeaderRow=ie,t.toggleHeaderColumn=ae,t.toggleHeaderCell=se,t.goToNextCell=function(e){return function(t,n){if(!g(t))return!1;var r=function(e,t){if(t<0){var n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(var r=e.index(-1)-1,o=e.before();r>=0;r--){var i=e.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;for(var a=e.node(-1),s=e.indexAfter(-1),l=e.after();s<a.childCount;s++){var c=a.child(s);if(c.childCount)return l+1;l+=c.nodeSize}}}(b(t),e);if(null!=r){if(n){var o=t.doc.resolve(r);n(t.tr.setSelection(i.TextSelection.between(o,k(o))).scrollIntoView())}return!0}}},t.deleteTable=function(e,t){for(var n=e.selection.$anchor,r=n.depth;r>0;r--){if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0}return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(6),i=Object.create(null),a=function(e,t,n){this.ranges=n||[new l(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},s={anchor:{},head:{},from:{},to:{},$from:{},$to:{},empty:{}};s.anchor.get=function(){return this.$anchor.pos},s.head.get=function(){return this.$head.pos},s.from.get=function(){return this.$from.pos},s.to.get=function(){return this.$to.pos},s.$from.get=function(){return this.ranges[0].$from},s.$to.get=function(){return this.ranges[0].$to},s.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},a.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},a.prototype.replace=function(e,t){void 0===t&&(t=r.Slice.empty);for(var n=t.content.lastChild,o=null,i=0;i<t.openEnd;i++)o=n,n=n.lastChild;for(var a=e.steps.length,s=this.ranges,l=0;l<s.length;l++){var c=s[l],u=c.$from,f=c.$to,p=e.mapping.slice(a);e.replaceRange(p.map(u.pos),p.map(f.pos),l?r.Slice.empty:t),0==l&&m(e,a,(n?n.isInline:o&&o.isTextblock)?-1:1)}},a.prototype.replaceWith=function(e,t){for(var n=e.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],a=i.$from,s=i.$to,l=e.mapping.slice(n),c=l.map(a.pos),u=l.map(s.pos);o?e.deleteRange(c,u):(e.replaceRangeWith(c,u,t),m(e,n,t.isInline?-1:1))}},a.findFrom=function(e,t,n){var r=e.parent.inlineContent?new c(e):v(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var o=e.depth-1;o>=0;o--){var i=t<0?v(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):v(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}},a.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new d(e.node(0))},a.atStart=function(e){return v(e,e,0,0,1)||new d(e)},a.atEnd=function(e){return v(e,e,e.content.size,e.childCount,-1)||new d(e)},a.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=i[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},a.jsonID=function(e,t){if(e in i)throw new RangeError("Duplicate use of selection JSON ID "+e);return i[e]=t,t.prototype.jsonID=e,t},a.prototype.getBookmark=function(){return c.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(a.prototype,s),a.prototype.visible=!0;var l=function(e,t){this.$from=e,this.$to=t},c=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return e.near(o);var i=n.resolve(r.map(this.anchor));return new t(i.parent.inlineContent?i:o,o)},t.prototype.replace=function(t,n){if(void 0===n&&(n=r.Slice.empty),e.prototype.replace.call(this,t,n),n==r.Slice.empty){var o=this.$from.marksAcross(this.$to);o&&t.ensureMarks(o)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new u(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))},t.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var a=e.findFrom(r,o,!0)||e.findFrom(r,-o,!0);if(!a)return e.near(r,o);r=a.$head}return n.parent.inlineContent||(0==i||(n=(e.findFrom(n,-o,!0)||e.findFrom(n,o,!0)).$anchor).pos<r.pos!=i<0)&&(n=r),new t(n,r)},Object.defineProperties(t.prototype,n),t}(a);a.jsonID("text",c);var u=function(e,t){this.anchor=e,this.head=t};u.prototype.map=function(e){return new u(e.map(this.anchor),e.map(this.head))},u.prototype.resolve=function(e){return c.between(e.resolve(this.anchor),e.resolve(this.head))};var f=function(e){function t(t){var n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);e.call(this,t,r),this.node=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var o=r.mapResult(this.anchor),i=o.deleted,a=o.pos,s=n.resolve(a);return i?e.near(s):new t(s)},t.prototype.content=function(){return new r.Slice(r.Fragment.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new p(this.anchor)},t.fromJSON=function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(a);f.prototype.visible=!1,a.jsonID("node",f);var p=function(e){this.anchor=e};p.prototype.map=function(e){var t=e.mapResult(this.anchor),n=t.deleted,r=t.pos;return n?new u(r,r):new p(r)},p.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&f.isSelectable(n)?new f(t):a.near(t)};var d=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return h},t}(a);a.jsonID("all",d);var h={map:function(){return this},resolve:function(e){return new d(e)}};function v(e,t,n,r,o,i){if(t.inlineContent)return c.create(e,n);for(var a=r-(o>0?0:1);o>0?a<t.childCount:a>=0;a+=o){var s=t.child(a);if(s.isAtom){if(!i&&f.isSelectable(s))return f.create(e,n-(o<0?s.nodeSize:0))}else{var l=v(e,s,n+o,o<0?s.childCount:0,o,i);if(l)return l}n+=s.nodeSize*o}}function m(e,t,n){var r=e.steps.length-1;if(!(r<t)){var i,s=e.steps[r];if(s instanceof o.ReplaceStep||s instanceof o.ReplaceAroundStep)e.mapping.maps[r].forEach((function(e,t,n,r){null==i&&(i=r)})),e.setSelection(a.near(e.doc.resolve(i),n))}}var y=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={selection:{},selectionSet:{},storedMarksSet:{},isGeneric:{},scrolledIntoView:{}};return n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},t.prototype.setSelection=function(e){return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return r.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.Mark.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(a.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(o.Transform);function g(e,t){return t&&e?e.bind(t):e}var b=function(e,t,n){this.name=e,this.init=g(t.init,n),this.apply=g(t.apply,n)},w=[new b("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new b("selection",{init:function(e,t){return e.selection||a.atStart(t.doc)},apply:function(e){return e.selection}}),new b("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new b("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],k=function(e,t){var n=this;this.schema=e,this.fields=w.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new b(e.key,e.spec.state,e))}))},O=function(e){this.config=e},M={schema:{},plugins:{},tr:{}};M.schema.get=function(){return this.config.schema},M.plugins.get=function(){return this.config.plugins},O.prototype.apply=function(e){return this.applyTransaction(e).state},O.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=t){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0},O.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var a=this.config.plugins[i];if(a.spec.appendTransaction){var s=r?r[i].n:0,l=r?r[i].state:this,c=s<t.length&&a.spec.appendTransaction.call(a,s?t.slice(s):t,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(var u=0;u<this.config.plugins.length;u++)r.push(u<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}},O.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new O(this.config),n=this.config.fields,r=0;r<n.length;r++){var o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}for(var i=0;i<S.length;i++)S[i](this,e,t);return t},M.tr.get=function(){return new y(this)},O.create=function(e){for(var t=new k(e.schema||e.doc.type.schema,e.plugins),n=new O(t),r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n},O.prototype.reconfigure=function(e){for(var t=new k(e.schema||this.schema,e.plugins),n=t.fields,r=new O(t),o=0;o<n.length;o++){var i=n[o].name;r[i]=this.hasOwnProperty(i)?this[i]:n[o].init(e,r)}return r},O.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t},O.fromJSON=function(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var o=new k(e.schema,e.plugins),i=new O(o);return o.fields.forEach((function(o){if("doc"==o.name)i.doc=r.Node.fromJSON(e.schema,t.doc);else if("selection"==o.name)i.selection=a.fromJSON(i.doc,t.selection);else if("storedMarks"==o.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(var s in n){var l=n[s],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,s))return void(i[o.name]=c.fromJSON.call(l,e,t[s],i))}i[o.name]=o.init(e,i)}})),i},O.addApplyListener=function(e){S.push(e)},O.removeApplyListener=function(e){var t=S.indexOf(e);t>-1&&S.splice(t,1)},Object.defineProperties(O.prototype,M);var S=[];var _=function(e){this.props={},e.props&&function e(t,n,r){for(var o in t){var i=t[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=e(i,n,{})),r[o]=i}return r}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:x("plugin")};_.prototype.getState=function(e){return e[this.key]};var C=Object.create(null);function x(e){return e in C?e+"$"+ ++C[e]:(C[e]=0,e+"$")}var A=function(e){void 0===e&&(e="key"),this.key=x(e)};A.prototype.get=function(e){return e.config.pluginsByKey[this.key]},A.prototype.getState=function(e){return e[this.key]},t.Selection=a,t.SelectionRange=l,t.TextSelection=c,t.NodeSelection=f,t.AllSelection=d,t.Transaction=y,t.EditorState=O,t.Plugin=_,t.PluginKey=A},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(28))&&"object"==typeof r&&"default"in r?r.default:r;var i=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;n<e.length;n++)this.size+=e[n].nodeSize},a={firstChild:{},lastChild:{},childCount:{}};i.prototype.nodesBetween=function(e,t,n,r,o){void 0===r&&(r=0);for(var i=0,a=0;a<t;i++){var s=this.content[i],l=a+s.nodeSize;if(l>e&&!1!==n(s,r+a,o,i)&&s.content.size){var c=a+1;s.nodesBetween(Math.max(0,e-c),Math.min(s.content.size,t-c),n,r+c)}a=l}},i.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},i.prototype.textBetween=function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,(function(a,s){a.isText?(o+=a.text.slice(Math.max(e,s)-s,t-s),i=!n):a.isLeaf&&r?(o+=r,i=!n):!i&&a.isBlock&&(o+=n,i=!0)}),0),o},i.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new i(r,this.size+e.size)},i.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var n=[],r=0;if(t>e)for(var o=0,a=0;a<t;o++){var s=this.content[o],l=a+s.nodeSize;l>e&&((a<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-a),Math.min(s.text.length,t-a)):s.cut(Math.max(0,e-a-1),Math.min(s.content.size,t-a-1))),n.push(s),r+=s.nodeSize),a=l}return new i(n,r)},i.prototype.cutByIndex=function(e,t){return e==t?i.empty:0==e&&t==this.content.length?this:new i(this.content.slice(e,t))},i.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new i(r,o)},i.prototype.addToStart=function(e){return new i([e].concat(this.content),this.size+e.nodeSize)},i.prototype.addToEnd=function(e){return new i(this.content.concat(e),this.size+e.nodeSize)},i.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0},a.firstChild.get=function(){return this.content.length?this.content[0]:null},a.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},a.childCount.get=function(){return this.content.length},i.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},i.prototype.maybeChild=function(e){return this.content[e]},i.prototype.forEach=function(e){for(var t=0,n=0;t<this.content.length;t++){var r=this.content[t];e(r,n,t),n+=r.nodeSize}},i.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,n,r){for(var o=0;;o++){if(o==t.childCount||o==n.childCount)return t.childCount==n.childCount?null:r;var i=t.child(o),a=n.child(o);if(i!=a){if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){for(var s=0;i.text[s]==a.text[s];s++)r++;return r}if(i.content.size||a.content.size){var l=e(i.content,a.content,r+1);if(null!=l)return l}r+=i.nodeSize}else r+=i.nodeSize}}(this,e,t)},i.prototype.findDiffEnd=function(e,t,n){return void 0===t&&(t=this.size),void 0===n&&(n=e.size),function e(t,n,r,o){for(var i=t.childCount,a=n.childCount;;){if(0==i||0==a)return i==a?null:{a:r,b:o};var s=t.child(--i),l=n.child(--a),c=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:r,b:o};if(s.isText&&s.text!=l.text){for(var u=0,f=Math.min(s.text.length,l.text.length);u<f&&s.text[s.text.length-u-1]==l.text[l.text.length-u-1];)u++,r--,o--;return{a:r,b:o}}if(s.content.size||l.content.size){var p=e(s.content,l.content,r-1,o-1);if(p)return p}r-=c,o-=c}else r-=c,o-=c}}(this,e,t,n)},i.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return l(0,e);if(e==this.size)return l(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?l(n+1,o):l(n,r);r=o}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},i.fromJSON=function(e,t){if(!t)return i.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(t.map(e.nodeFromJSON))},i.fromArray=function(e){if(!e.length)return i.empty;for(var t,n=0,r=0;r<e.length;r++){var o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new i(t||e,n)},i.from=function(e){if(!e)return i.empty;if(e instanceof i)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new i([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(i.prototype,a);var s={index:0,offset:0};function l(e,t){return s.index=e,s.offset=t,s}function c(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!c(e[r],t[r]))return!1}else{for(var o in e)if(!(o in t)||!c(e[o],t[o]))return!1;for(var i in t)if(!(i in e))return!1}return!0}i.empty=new i([],0);var u=function(e,t){this.type=e,this.attrs=t};function f(e){var t=Error.call(this,e);return t.__proto__=f.prototype,t}u.prototype.addToSet=function(e){for(var t,n=!1,r=0;r<e.length;r++){var o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t},u.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},u.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},u.prototype.eq=function(e){return this==e||this.type==e.type&&c(this.attrs,e.attrs)},u.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},u.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type "+t.type+" in this schema");return n.create(t.attrs)},u.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0},u.setFrom=function(e){if(!e||0==e.length)return u.none;if(e instanceof u)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},u.none=[],f.prototype=Object.create(Error.prototype),f.prototype.constructor=f,f.prototype.name="ReplaceError";var p=function(e,t,n){this.content=e,this.openStart=t,this.openEnd=n},d={size:{}};function h(e,t,n){if(n.openStart>e.depth)throw new f("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new f("Inconsistent open depths");return function e(t,n,r,o){var a=t.index(o),s=t.node(o);if(a==n.index(o)&&o<t.depth-r.openStart){var l=e(t,n,r,o+1);return s.copy(s.content.replaceChild(a,l))}if(r.content.size){if(r.openStart||r.openEnd||t.depth!=o||n.depth!=o){var c=function(e,t){for(var n=t.depth-e.openStart,r=t.node(n).copy(e.content),o=n-1;o>=0;o--)r=t.node(o).copy(i.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t),u=c.start,f=c.end;return b(s,function e(t,n,r,o,a){var s=t.depth>a&&m(t,n,a+1),l=o.depth>a&&m(r,o,a+1),c=[];g(null,t,a,c),s&&l&&n.index(a)==r.index(a)?(v(s,l),y(b(s,e(t,n,r,o,a+1)),c)):(s&&y(b(s,w(t,n,a+1)),c),g(n,r,a,c),l&&y(b(l,w(r,o,a+1)),c));return g(o,null,a,c),new i(c)}(t,u,f,n,o))}var p=t.parent,d=p.content;return b(p,d.cut(0,t.parentOffset).append(r.content).append(d.cut(n.parentOffset)))}return b(s,w(t,n,o))}(e,t,n,0)}function v(e,t){if(!t.type.compatibleContent(e.type))throw new f("Cannot join "+t.type.name+" onto "+e.type.name)}function m(e,t,n){var r=e.node(n);return v(r,t.node(n)),r}function y(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function g(e,t,n,r){var o=(t||e).node(n),i=0,a=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(y(e.nodeAfter,r),i++));for(var s=i;s<a;s++)y(o.child(s),r);t&&t.depth==n&&t.textOffset&&y(t.nodeBefore,r)}function b(e,t){if(!e.type.validContent(t))throw new f("Invalid content for node "+e.type.name);return e.copy(t)}function w(e,t,n){var r=[];(g(null,e,n,r),e.depth>n)&&y(b(m(e,t,n+1),w(e,t,n+1)),r);return g(t,null,n,r),new i(r)}d.size.get=function(){return this.content.size-this.openStart-this.openEnd},p.prototype.insertAt=function(e,t){var n=function e(t,n,r,o){var i=t.findIndex(n),a=i.index,s=i.offset,l=t.maybeChild(a);if(s==n||l.isText)return o&&!o.canReplace(a,a,r)?null:t.cut(0,n).append(r).append(t.cut(n));var c=e(l.content,n-s-1,r);return c&&t.replaceChild(a,l.copy(c))}(this.content,e+this.openStart,t,null);return n&&new p(n,this.openStart,this.openEnd)},p.prototype.removeBetween=function(e,t){return new p(function e(t,n,r){var o=t.findIndex(n),i=o.index,a=o.offset,s=t.maybeChild(i),l=t.findIndex(r),c=l.index,u=l.offset;if(a==n||s.isText){if(u!=r&&!t.child(c).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=c)throw new RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(e(s.content,n-a-1,r-a-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},p.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},p.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},p.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},p.fromJSON=function(e,t){if(!t)return p.empty;var n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new p(i.fromJSON(e,t.content),t.openStart||0,t.openEnd||0)},p.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,r=0,o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new p(e,n,r)},Object.defineProperties(p.prototype,d),p.empty=new p(i.empty,0,0);var k=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},O={parent:{},doc:{},textOffset:{},nodeAfter:{},nodeBefore:{}};k.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},O.parent.get=function(){return this.node(this.depth)},O.doc.get=function(){return this.node(0)},k.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},k.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},k.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},k.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},k.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},k.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},k.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},O.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},O.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r},O.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},k.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return u.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){var o=n;n=r,r=o}for(var i=n.marks,a=0;a<i.length;a++)!1!==i[a].type.spec.inclusive||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i},k.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,r=e.parent.maybeChild(e.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n},k.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},k.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new C(this,e,n)},k.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},k.prototype.max=function(e){return e.pos>this.pos?e:this},k.prototype.min=function(e){return e.pos<this.pos?e:this},k.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},k.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],r=0,o=t,i=e;;){var a=i.content.findIndex(o),s=a.index,l=a.offset,c=o-l;if(n.push(i,s,r+l),!c)break;if((i=i.child(s)).isText)break;o=c-1,r+=l+1}return new k(t,n,o)},k.resolveCached=function(e,t){for(var n=0;n<M.length;n++){var r=M[n];if(r.pos==t&&r.doc==e)return r}var o=M[S]=k.resolve(e,t);return S=(S+1)%_,o},Object.defineProperties(k.prototype,O);var M=[],S=0,_=12,C=function(e,t,n){this.$from=e,this.$to=t,this.depth=n},x={start:{},end:{},parent:{},startIndex:{},endIndex:{}};x.start.get=function(){return this.$from.before(this.depth+1)},x.end.get=function(){return this.$to.after(this.depth+1)},x.parent.get=function(){return this.$from.node(this.depth)},x.startIndex.get=function(){return this.$from.index(this.depth)},x.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(C.prototype,x);var A=Object.create(null),T=function(e,t,n,r){this.type=e,this.attrs=t,this.content=n||i.empty,this.marks=r||u.none},V={nodeSize:{},childCount:{},textContent:{},firstChild:{},lastChild:{},isBlock:{},isTextblock:{},inlineContent:{},isInline:{},isText:{},isLeaf:{},isAtom:{}};V.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},V.childCount.get=function(){return this.content.childCount},T.prototype.child=function(e){return this.content.child(e)},T.prototype.maybeChild=function(e){return this.content.maybeChild(e)},T.prototype.forEach=function(e){this.content.forEach(e)},T.prototype.nodesBetween=function(e,t,n,r){void 0===r&&(r=0),this.content.nodesBetween(e,t,n,r,this)},T.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},V.textContent.get=function(){return this.textBetween(0,this.content.size,"")},T.prototype.textBetween=function(e,t,n,r){return this.content.textBetween(e,t,n,r)},V.firstChild.get=function(){return this.content.firstChild},V.lastChild.get=function(){return this.content.lastChild},T.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},T.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},T.prototype.hasMarkup=function(e,t,n){return this.type==e&&c(this.attrs,t||e.defaultAttrs||A)&&u.sameSet(this.marks,n||u.none)},T.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},T.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},T.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},T.prototype.slice=function(e,t,n){if(void 0===t&&(t=this.content.size),void 0===n&&(n=!1),e==t)return p.empty;var r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),a=r.start(i),s=r.node(i).content.cut(r.pos-a,o.pos-a);return new p(s,r.depth-i,o.depth-i)},T.prototype.replace=function(e,t,n){return h(this.resolve(e),this.resolve(t),n)},T.prototype.nodeAt=function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,o=n.offset;if(!(t=t.maybeChild(r)))return null;if(o==e||t.isText)return t;e-=o+1}},T.prototype.childAfter=function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},T.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(r<e)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}},T.prototype.resolve=function(e){return k.resolveCached(this,e)},T.prototype.resolveNoCache=function(e){return k.resolve(this,e)},T.prototype.rangeHasMark=function(e,t,n){var r=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(r=!0),!r})),r},V.isBlock.get=function(){return this.type.isBlock},V.isTextblock.get=function(){return this.type.isTextblock},V.inlineContent.get=function(){return this.type.inlineContent},V.isInline.get=function(){return this.type.isInline},V.isText.get=function(){return this.type.isText},V.isLeaf.get=function(){return this.type.isLeaf},V.isAtom.get=function(){return this.type.isAtom},T.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),E(this.marks,e)},T.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},T.prototype.canReplace=function(e,t,n,r,o){void 0===n&&(n=i.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var a=this.contentMatchAt(e).matchFragment(n,r,o),s=a&&a.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(var l=r;l<o;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0},T.prototype.canReplaceWith=function(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd},T.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},T.prototype.defaultContentType=function(e){return this.contentMatchAt(e).defaultType},T.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));this.content.forEach((function(e){return e.check()}))},T.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e},T.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var r=i.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)},Object.defineProperties(T.prototype,V);var j=function(e){function t(t,n,r,o){if(e.call(this,t,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={textContent:{},nodeSize:{}};return t.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):E(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},t.prototype.textBetween=function(e,t){return this.text.slice(e,t)},n.nodeSize.get=function(){return this.text.length},t.prototype.mark=function(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)},t.prototype.withText=function(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)},t.prototype.cut=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.text.length),0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))},t.prototype.eq=function(e){return this.sameMarkup(e)&&this.text==e.text},t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.text=this.text,t},Object.defineProperties(t.prototype,n),t}(T);function E(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var P=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},N={inlineContent:{},defaultType:{},edgeCount:{}};P.parse=function(e,t){var n=new H(e,t);if(null==n.next)return P.empty;var r=D(n);n.next&&n.err("Unexpected trailing text");var o=function(e){var t=Object.create(null);return function n(r){var o=[];r.forEach((function(t){e[t].forEach((function(t){var n=t.term,r=t.to;if(n){var i=o.indexOf(n),a=i>-1&&o[i+1];B(e,r).forEach((function(e){a||o.push(n,a=[]),-1==a.indexOf(e)&&a.push(e)}))}}))}));for(var i=t[r.join(",")]=new P(r.indexOf(e.length-1)>-1),a=0;a<o.length;a+=2){var s=o[a+1].sort(z);i.next.push(o[a],t[s.join(",")]||n(s))}return i}(B(e,0))}(function(e){var t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(e(n,i))}),[]);if("seq"==t.type)for(var a=0;;a++){var s=e(t.exprs[a],i);if(a==t.exprs.length-1)return s;o(s,i=n())}else{if("star"==t.type){var l=n();return r(i,l),o(e(t.expr,l),l),[r(l)]}if("plus"==t.type){var c=n();return o(e(t.expr,i),c),o(e(t.expr,c),c),[r(c)]}if("opt"==t.type)return[r(i)].concat(e(t.expr,i));if("range"==t.type){for(var u=i,f=0;f<t.min;f++){var p=n();o(e(t.expr,u),p),u=p}if(-1==t.max)o(e(t.expr,u),u);else for(var d=t.min;d<t.max;d++){var h=n();r(u,h),o(e(t.expr,u),h),u=h}return[r(u)]}if("name"==t.type)return[r(i,null,t.value)]}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){var o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((function(e){return e.to=t}))}}(r));return function(e,t){for(var n=0,r=[e];n<r.length;n++){for(var o=r[n],i=!o.validEnd,a=[],s=0;s<o.next.length;s+=2){var l=o.next[s],c=o.next[s+1];a.push(l.name),!i||l.isText||l.hasRequiredAttrs()||(i=!1),-1==r.indexOf(c)&&r.push(c)}i&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position")}}(o,n),o},P.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},P.prototype.matchFragment=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.childCount);for(var r=this,o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r},N.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},N.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},P.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var n=0;n<e.next.length;n+=2)if(this.next[t]==e.next[n])return!0;return!1},P.prototype.fillBefore=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=0);var r=[this];return function o(a,s){var l=a.matchFragment(e,n);if(l&&(!t||l.validEnd))return i.from(s.map((function(e){return e.createAndFill()})));for(var c=0;c<a.next.length;c+=2){var u=a.next[c],f=a.next[c+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==r.indexOf(f)){r.push(f);var p=o(f,s.concat(u));if(p)return p}}}(this,[])},P.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n},P.prototype.computeWrapping=function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(e)){for(var i=[],a=r;a.type;a=a.via)i.push(a.type);return i.reverse()}for(var s=0;s<o.next.length;s+=2){var l=o.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||r.type&&!o.next[s+1].validEnd||(n.push({match:l.contentMatch,type:l,via:r}),t[l.name]=!0)}}},N.edgeCount.get=function(){return this.next.length>>1},P.prototype.edge=function(e){var t=e<<1;if(t>this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},P.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var r=1;r<n.next.length;r+=2)-1==e.indexOf(n.next[r])&&t(n.next[r])}(this),e.map((function(t,n){for(var r=n+(t.validEnd?"*":" ")+" ",o=0;o<t.next.length;o+=2)r+=(o?", ":"")+t.next[o].name+"->"+e.indexOf(t.next[o+1]);return r})).join("\n")},Object.defineProperties(P.prototype,N),P.empty=new P(!0);var H=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.unshift()},L={next:{}};function D(e){var t=[];do{t.push(I(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function I(e){var t=[];do{t.push(R(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function R(e){for(var t=function(e){if(e.eat("(")){var t=D(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var o=[];for(var i in n){var a=n[i];a.groups.indexOf(t)>-1&&o.push(a)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=F(e,t)}return t}function $(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function F(e,t){var n=$(e),r=n;return e.eat(",")&&(r="}"!=e.next?$(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function z(e,t){return e-t}function B(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var a=o[i],s=a.term,l=a.to;s||-1!=n.indexOf(l)||t(l)}}(t),n.sort(z)}function J(e){var t=Object.create(null);for(var n in e){var r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function W(e,t){var n=Object.create(null);for(var r in e){var o=t&&t[r];if(void 0===o){var i=e[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function q(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new Q(e[n]);return t}L.next.get=function(){return this.tokens[this.pos]},H.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},H.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(H.prototype,L);var K=function(e,t,n){this.name=e,this.schema=t,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=q(n.attrs),this.defaultAttrs=J(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e},G={isInline:{},isTextblock:{},isLeaf:{},isAtom:{}};G.isInline.get=function(){return!this.isBlock},G.isTextblock.get=function(){return this.isBlock&&this.inlineContent},G.isLeaf.get=function(){return this.contentMatch==P.empty},G.isAtom.get=function(){return this.isLeaf||this.spec.atom},K.prototype.hasRequiredAttrs=function(e){for(var t in this.attrs)if(this.attrs[t].isRequired&&(!e||!(t in e)))return!0;return!1},K.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},K.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:W(this.attrs,e)},K.prototype.create=function(e,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new T(this,this.computeAttrs(e),i.from(t),u.setFrom(n))},K.prototype.createChecked=function(e,t,n){if(t=i.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new T(this,this.computeAttrs(e),t,u.setFrom(n))},K.prototype.createAndFill=function(e,t,n){if(e=this.computeAttrs(e),(t=i.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var o=this.contentMatch.matchFragment(t).fillBefore(i.empty,!0);return o?new T(this,e,t.append(o),u.setFrom(n)):null},K.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0},K.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},K.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},K.prototype.allowedMarks=function(e){var t;if(null==this.markSet)return e;for(var n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:u.empty:e},K.compile=function(e,t){var n=Object.create(null);e.forEach((function(e,r){return n[e]=new K(e,t,r)}));var r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(K.prototype,G);var Q=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},Z={isRequired:{}};Z.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(Q.prototype,Z);var U=function(e,t,n,r){this.name=e,this.schema=n,this.spec=r,this.attrs=q(r.attrs),this.rank=t,this.excluded=null;var o=J(this.attrs);this.instance=o&&new u(this,o)};U.prototype.create=function(e){return!e&&this.instance?this.instance:new u(this,W(this.attrs,e))},U.compile=function(e,t){var n=Object.create(null),r=0;return e.forEach((function(e,o){return n[e]=new U(e,r++,t,o)})),n},U.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e.slice(0,t).concat(e.slice(t+1));return e},U.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},U.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var X=function(e){for(var t in this.spec={},e)this.spec[t]=e[t];this.spec.nodes=o.from(e.nodes),this.spec.marks=o.from(e.marks),this.nodes=K.compile(this.spec.nodes,this),this.marks=U.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],a=i.spec.content||"",s=i.spec.marks;i.contentMatch=n[a]||(n[a]=P.parse(a,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==s?null:s?Y(this,s.split(" ")):""!=s&&i.inlineContent?null:[]}for(var l in this.marks){var c=this.marks[l],u=c.spec.excludes;c.excluded=null==u?[c]:""==u?[]:Y(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function Y(e,t){for(var n=[],r=0;r<t.length;r++){var o=t[r],i=e.marks[o],a=i;if(i)n.push(i);else for(var s in e.marks){var l=e.marks[s];("_"==o||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}X.prototype.node=function(e,t,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof K))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)},X.prototype.text=function(e,t){var n=this.nodes.text;return new j(n,n.defaultAttrs,e,u.setFrom(t))},X.prototype.mark=function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)},X.prototype.nodeFromJSON=function(e){return T.fromJSON(this,e)},X.prototype.markFromJSON=function(e){return u.fromJSON(this,e)},X.prototype.nodeType=function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t};var ee=function(e,t){var n=this;this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((function(e){e.tag?n.tags.push(e):e.style&&n.styles.push(e)}))};ee.prototype.parse=function(e,t){void 0===t&&(t={});var n=new ae(this,t,!1);return n.addAll(e,null,t.from,t.to),n.finish()},ee.prototype.parseSlice=function(e,t){void 0===t&&(t={});var n=new ae(this,t,!0);return n.addAll(e,null,t.from,t.to),p.maxOpen(n.finish())},ee.prototype.matchTag=function(e,t){for(var n=0;n<this.tags.length;n++){var r=this.tags[n];if(le(e,r.tag)&&(void 0===r.namespace||e.namespaceURI==r.namespace)&&(!r.context||t.matchesContext(r.context))){if(r.getAttrs){var o=r.getAttrs(e);if(!1===o)continue;r.attrs=o}return r}}},ee.prototype.matchStyle=function(e,t,n){for(var r=0;r<this.styles.length;r++){var o=this.styles[r];if(!(0!=o.style.indexOf(e)||o.context&&!n.matchesContext(o.context)||o.style.length>e.length&&(61!=o.style.charCodeAt(e.length)||o.style.slice(e.length+1)!=t))){if(o.getAttrs){var i=o.getAttrs(t);if(!1===i)continue;o.attrs=i}return o}}},ee.schemaRules=function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r<t.length;r++){var o=t[r];if((null==o.priority?50:o.priority)<n)break}t.splice(r,0,e)}var r=function(t){var r=e.marks[t].spec.parseDOM;r&&r.forEach((function(e){n(e=ce(e)),e.mark=t}))};for(var o in e.marks)r(o);var i;for(var a in e.nodes)i=void 0,(i=e.nodes[a].spec.parseDOM)&&i.forEach((function(e){n(e=ce(e)),e.node=a}));return t},ee.fromSchema=function(e){return e.cached.domParser||(e.cached.domParser=new ee(e,ee.schemaRules(e)))};var te={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ne={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},re={ol:!0,ul:!0};function oe(e){return(e?1:0)|("full"===e?2:0)}var ie=function(e,t,n,r,o,i){this.type=e,this.attrs=t,this.solid=r,this.match=o||(4&i?null:e.contentMatch),this.options=i,this.content=[],this.marks=n,this.activeMarks=u.none};ie.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(i.from(e));if(!t){var n,r=this.type.contentMatch;return(n=r.findWrapping(e.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},ie.prototype.finish=function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];n&&n.isText&&(t=/\s+$/.exec(n.text))&&(n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length)))}var r=i.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r};var ae=function(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.pendingMarks=[];var r,o=t.topNode,i=oe(t.preserveWhitespace)|(n?4:0);r=o?new ie(o.type,o.attrs,u.none,!0,t.topMatch||o.type.contentMatch,i):new ie(n?null:e.schema.topNodeType,null,u.none,!0,null,i),this.nodes=[r],this.open=0,this.find=t.findPositions,this.needsBlock=!1},se={top:{},currentPos:{}};function le(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ce(e){var t={};for(var n in e)t[n]=e[n];return t}se.top.get=function(){return this.nodes[this.open]},ae.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null;if(null!=n)for(var r=0;r<n.length;r++)this.addPendingMark(n[r]);if(this.addElement(e),null!=n)for(var o=0;o<n.length;o++)this.removePendingMark(n[o])}},ae.prototype.addTextNode=function(e){var t=e.nodeValue,n=this.top;if((n.type?n.type.inlineContent:n.content.length&&n.content[0].isInline)||/\S/.test(t)){if(1&n.options)2&n.options||(t=t.replace(/\r?\n|\r/g," "));else if(t=t.replace(/\s+/g," "),/^\s/.test(t)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],o=e.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/\s$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},ae.prototype.addElement=function(e){var t=e.nodeName.toLowerCase();re.hasOwnProperty(t)&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var r=1==t.nodeType?t.nodeName.toLowerCase():null;r&&re.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):"li"==r?n=t:r&&(n=null)}}(e);var n=this.options.ruleFromNode&&this.options.ruleFromNode(e)||this.parser.matchTag(e,this);if(n?n.ignore:ne.hasOwnProperty(t))this.findInside(e);else if(!n||n.skip){n&&n.skip.nodeType&&(e=n.skip);var r,o=this.top,i=this.needsBlock;te.hasOwnProperty(t)&&(r=!0,o.type||(this.needsBlock=!0)),this.addAll(e),r&&this.sync(o),this.needsBlock=i}else this.addElementByRule(e,n)},ae.prototype.readStyles=function(e){for(var t=u.none,n=0;n<e.length;n+=2){var r=this.parser.matchStyle(e[n],e[n+1],this);if(r){if(r.ignore)return null;t=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(t)}}return t},ae.prototype.addElementByRule=function(e,t){var n,r,o,i=this;t.node?(r=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(r.create(t.attrs)):n=this.enter(r,t.attrs,t.preserveWhitespace):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));var a=this.top;if(r&&r.isLeaf)this.findInside(e);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return i.insertNode(e)}));else{var s=t.contentElement;"string"==typeof s?s=e.querySelector(s):"function"==typeof s&&(s=s(e)),s||(s=e),this.findAround(e,s,!0),this.addAll(s,n)}return n&&(this.sync(a),this.open--),o&&this.removePendingMark(o),!0},ae.prototype.addAll=function(e,t,n,r){for(var o=n||0,i=n?e.childNodes[n]:e.firstChild,a=null==r?null:e.childNodes[r];i!=a;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i),t&&te.hasOwnProperty(i.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,o)},ae.prototype.findPlace=function(e){for(var t,n,r=this.open;r>=0;r--){var o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var a=0;a<t.length;a++)this.enterInner(t[a],null,!1);return!0},ae.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;this.applyPendingMarks(n),n.match&&(n.match=n.match.matchType(e.type));for(var r=n.activeMarks,o=0;o<e.marks.length;o++)n.type&&!n.type.allowsMarkType(e.marks[o].type)||(r=e.marks[o].addToSet(r));n.content.push(e.mark(r))}},ae.prototype.applyPendingMarks=function(e){for(var t=0;t<this.pendingMarks.length;t++){var n=this.pendingMarks[t];e.type&&!e.type.allowsMarkType(n.type)||n.isInSet(e.activeMarks)||(e.activeMarks=n.addToSet(e.activeMarks),this.pendingMarks.splice(t--,1))}},ae.prototype.enter=function(e,t,n){var r=this.findPlace(e.create(t));return r&&(this.applyPendingMarks(this.top),this.enterInner(e,t,!0,n)),r},ae.prototype.enterInner=function(e,t,n,r){this.closeExtra();var o=this.top;o.match=o.match&&o.match.matchType(e,t);var i=null==r?-5&o.options:oe(r);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new ie(e,t,o.activeMarks,n,null,i)),this.open++},ae.prototype.closeExtra=function(e){var t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},ae.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},ae.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},ae.prototype.addPendingMark=function(e){this.pendingMarks.push(e)},ae.prototype.removePendingMark=function(e){var t=this.pendingMarks.lastIndexOf(e);if(t>-1)this.pendingMarks.splice(t,1);else{var n=this.top;n.activeMarks=e.removeFromSet(n.activeMarks)}},se.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e},ae.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)},ae.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},ae.prototype.findAround=function(e,t,n){if(e!=t&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node))t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},ae.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},ae.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),a=function(e,s){for(;e>=0;e--){var l=n[e];if(""==l){if(e==n.length-1||0==e)continue;for(;s>=i;s--)if(a(e-1,s))return!0;return!1}var c=s>0||0==s&&o?t.nodes[s].type:r&&s>=i?r.node(s-i).type:null;if(!c||c.name!=l&&-1==c.groups.indexOf(l))return!1;s--}return!0};return a(n.length-1,this.open)},ae.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},Object.defineProperties(ae.prototype,se);var ue=function(e,t){this.nodes=e||{},this.marks=t||{}};function fe(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function pe(e){return e.document||window.document}ue.prototype.serializeFragment=function(e,t,n){var r=this;void 0===t&&(t={}),n||(n=pe(t).createDocumentFragment());var o=n,i=null;return e.forEach((function(e){if(i||e.marks.length){i||(i=[]);for(var n=0,a=0;n<i.length&&a<e.marks.length;){var s=e.marks[a];if(r.marks[s.type.name]){if(!s.eq(i[n])||!1===s.type.spec.spanning)break;n+=2,a++}else a++}for(;n<i.length;)o=i.pop(),i.pop();for(;a<e.marks.length;){var l=e.marks[a++],c=r.serializeMark(l,e.isInline,t);c&&(i.push(l,o),o.appendChild(c.dom),o=c.contentDOM||c.dom)}}o.appendChild(r.serializeNode(e,t))})),n},ue.prototype.serializeNode=function(e,t){void 0===t&&(t={});var n=ue.renderSpec(pe(t),this.nodes[e.type.name](e)),r=n.dom,o=n.contentDOM;if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");t.onContent?t.onContent(e,o,t):this.serializeFragment(e.content,t,o)}return r},ue.prototype.serializeNodeAndMarks=function(e,t){void 0===t&&(t={});for(var n=this.serializeNode(e,t),r=e.marks.length-1;r>=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},ue.prototype.serializeMark=function(e,t,n){void 0===n&&(n={});var r=this.marks[e.type.name];return r&&ue.renderSpec(pe(n),r(e,t))},ue.renderSpec=function(e,t){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};var n=e.createElement(t[0]),r=null,o=t[1],i=1;if(o&&"object"==typeof o&&null==o.nodeType&&!Array.isArray(o))for(var a in i=2,o)null!=o[a]&&n.setAttribute(a,o[a]);for(var s=i;s<t.length;s++){var l=t[s];if(0===l){if(s<t.length-1||s>i)throw new RangeError("Content hole must be the only child of its parent node");return{dom:n,contentDOM:n}}var c=ue.renderSpec(e,l),u=c.dom,f=c.contentDOM;if(n.appendChild(u),f){if(r)throw new RangeError("Multiple content holes");r=f}}return{dom:n,contentDOM:r}},ue.fromSchema=function(e){return e.cached.domSerializer||(e.cached.domSerializer=new ue(this.nodesFromSchema(e),this.marksFromSchema(e)))},ue.nodesFromSchema=function(e){var t=fe(e.nodes);return t.text||(t.text=function(e){return e.text}),t},ue.marksFromSchema=function(e){return fe(e.marks)},t.Node=T,t.ResolvedPos=k,t.NodeRange=C,t.Fragment=i,t.Slice=p,t.ReplaceError=f,t.Mark=u,t.Schema=X,t.NodeType=K,t.MarkType=U,t.ContentMatch=P,t.DOMParser=ee,t.DOMSerializer=ue},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=Math.pow(2,16);function i(e){return 65535&e}var a=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},s=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};s.prototype.recover=function(e){var t=0,n=i(e);if(!this.inverted)for(var r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/o}(e)},s.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},s.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},s.prototype._map=function(e,t,n){for(var r=0,i=this.inverted?2:1,s=this.inverted?1:2,l=0;l<this.ranges.length;l+=3){var c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;var u=this.ranges[l+i],f=this.ranges[l+s],p=c+u;if(e<=p){var d=c+r+((u?e==c?-1:e==p?1:t:t)<0?0:f);if(n)return d;var h=l/3+(e-c)*o;return new a(d,t<0?e!=c:e!=p,h)}r+=f-u}return n?e+r:new a(e+r)},s.prototype.touches=function(e,t){for(var n=0,r=i(t),o=this.inverted?2:1,a=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var l=this.ranges[s]-(this.inverted?n:0);if(l>e)break;var c=this.ranges[s+o];if(e<=l+c&&s==3*r)return!0;n+=this.ranges[s+a]-c}return!1},s.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r<this.ranges.length;r+=3){var i=this.ranges[r],a=i-(this.inverted?o:0),s=i+(this.inverted?0:o),l=this.ranges[r+t],c=this.ranges[r+n];e(a,a+l,s,s+c),o+=c-l}},s.prototype.invert=function(){return new s(this.ranges,!this.inverted)},s.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},s.offset=function(e){return 0==e?s.empty:new s(e<0?[0,-e,0]:[0,0,e])},s.empty=new s([]);var l=function(e,t,n,r){this.maps=e||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=t};function c(e){var t=Error.call(this,e);return t.__proto__=c.prototype,t}l.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new l(this.maps,this.mirror,e,t)},l.prototype.copy=function(){return new l(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},l.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},l.prototype.appendMapping=function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:null)}},l.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},l.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},l.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:null)}},l.prototype.invert=function(){var e=new l;return e.appendMappingInverted(this),e},l.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e},l.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},l.prototype._map=function(e,t,n){for(var r=!1,o=null,i=this.from;i<this.to;i++){var s=this.maps[i],l=o&&o[i];if(null!=l&&s.touches(e,l))e=s.recover(l);else{var c=s.mapResult(e,t);if(null!=c.recover){var u=this.getMirror(i);if(null!=u&&u>i&&u<this.to){if(c.deleted){i=u,e=this.maps[u].recover(c.recover);continue}(o||(o=Object.create(null)))[u]=c.recover}}c.deleted&&(r=!0),e=c.pos}}return n?e:new a(e,r)},c.prototype=Object.create(Error.prototype),c.prototype.constructor=c,c.prototype.name="TransformError";var u=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new l},f={before:{},docChanged:{}};function p(){throw new Error("Override me")}f.before.get=function(){return this.docs.length?this.docs[0]:this.doc},u.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new c(t.failed);return this},u.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},f.docChanged.get=function(){return this.steps.length>0},u.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(u.prototype,f);var d=Object.create(null),h=function(){};h.prototype.apply=function(e){return p()},h.prototype.getMap=function(){return s.empty},h.prototype.invert=function(e){return p()},h.prototype.map=function(e){return p()},h.prototype.merge=function(e){return null},h.prototype.toJSON=function(){return p()},h.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=d[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},h.jsonID=function(e,t){if(e in d)throw new RangeError("Duplicate use of step JSON ID "+e);return d[e]=t,t.prototype.jsonID=e,t};var v=function(e,t){this.doc=e,this.failed=t};v.ok=function(e){return new v(e,null)},v.fail=function(e){return new v(null,e)},v.fromReplace=function(e,t,n,o){try{return v.ok(e.replace(t,n,o))}catch(e){if(e instanceof r.ReplaceError)return v.fail(e.message);throw e}};var m=function(e){function t(t,n,r,o){e.call(this),this.from=t,this.to=n,this.slice=r,this.structure=!!o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&g(e,this.from,this.to)?v.fail("Structure replace would overwrite content"):v.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new s([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure!=this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var o=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),o,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,r.Slice.fromJSON(e,n.slice),!!n.structure)},t}(h);h.jsonID("replace",m);var y=function(e){function t(t,n,r,o,i,a,s){e.call(this),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=a,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(g(e,this.from,this.gapFrom)||g(e,this.gapTo,this.to)))return v.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return v.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?v.fromReplace(e,this.from,this.to,n):v.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new s([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return n.deleted&&r.deleted||o<n.pos||i>r.pos?null:new t(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,r.Slice.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(h);function g(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var a=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}return!1}function b(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function w(e){return{type:e,attrs:null}}function k(e,t){return e&&t&&!e.isLeaf&&e.canAppend(t)}function O(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var s=r.indexAfter(a);if(r.node(a).canReplaceWith(s,s,n))return r.after(a+1);if(s<r.node(a).childCount)return null}}function M(e,t,n){for(var o=[],i=0;i<e.childCount;i++){var a=e.child(i);a.content.size&&(a=a.copy(M(a.content,t,a))),a.isInline&&(a=t(a,n,i)),o.push(a)}return r.Fragment.fromArray(o)}h.jsonID("replaceAround",y),u.prototype.lift=function(e,t){for(var n=e.$from,o=e.$to,i=e.depth,a=n.before(i+1),s=o.after(i+1),l=a,c=s,u=r.Fragment.empty,f=0,p=i,d=!1;p>t;p--)d||n.index(p)>0?(d=!0,u=r.Fragment.from(n.node(p).copy(u)),f++):l--;for(var h=r.Fragment.empty,v=0,m=i,g=!1;m>t;m--)g||o.after(m+1)<o.end(m)?(g=!0,h=r.Fragment.from(o.node(m).copy(h)),v++):c++;return this.step(new y(l,c,a,s,new r.Slice(u.append(h),f,v),u.size-f,!0))},u.prototype.wrap=function(e,t){for(var n=r.Fragment.empty,o=t.length-1;o>=0;o--)n=r.Fragment.from(t[o].type.create(t[o].attrs,n));var i=e.start,a=e.end;return this.step(new y(i,a,i,a,new r.Slice(n,0,0),t.length,!0))},u.prototype.setBlockType=function(e,t,n,o){var i=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var a=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(n,o)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(i.doc,i.mapping.slice(a).map(t),n)){i.clearIncompatible(i.mapping.slice(a).map(t,1),n);var s=i.mapping.slice(a),l=s.map(t,1),c=s.map(t+e.nodeSize,1);return i.step(new y(l,c,l+1,c-1,new r.Slice(r.Fragment.from(n.create(o,null,e.marks)),0,0),1,!0)),!1}})),this},u.prototype.setNodeMarkup=function(e,t,n,o){var i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);var a=t.create(n,null,o||i.marks);if(i.isLeaf)return this.replaceWith(e,e+i.nodeSize,a);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new y(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new r.Slice(r.Fragment.from(a),0,0),1,!0))},u.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var o=this.doc.resolve(e),i=r.Fragment.empty,a=r.Fragment.empty,s=o.depth,l=o.depth-t,c=t-1;s>l;s--,c--){i=r.Fragment.from(o.node(s).copy(i));var u=n&&n[c];a=r.Fragment.from(u?u.type.create(u.attrs,a):o.node(s).copy(a))}return this.step(new m(e,e,new r.Slice(i.append(a),t,t,!0)))},u.prototype.join=function(e,t){void 0===t&&(t=1);var n=new m(e-t,e+t,r.Slice.empty,!0);return this.step(n)};var S=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=e.resolve(this.from),i=o.node(o.sharedDepth(this.to)),a=new r.Slice(M(n.content,(function(e,n){return n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),i),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,a)},t.prototype.invert=function(){return new _(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(h);h.jsonID("addMark",S);var _=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=new r.Slice(M(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,o)},t.prototype.invert=function(){return new S(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(h);function C(e,t,n,o){if(void 0===n&&(n=t),void 0===o&&(o=r.Slice.empty),t==n&&!o.size)return null;var i=e.resolve(t),a=e.resolve(n);if(T(i,a,o))return new m(t,n,o);var s=function(e,t){var n=function e(t,n,o,i){var a=r.Fragment.empty,s=0,l=o[n];if(t.depth>n){var c=e(t,n+1,o,i||l);s=c.openEnd+1,a=r.Fragment.from(t.node(n+1).copy(c.content))}l&&(a=a.append(l.content),s=l.openEnd);i&&(a=a.append(t.node(n).contentMatchAt(t.indexAfter(n)).fillBefore(r.Fragment.empty,!0)),s=0);return{content:a,openEnd:s}}(e,0,t,!1),o=n.content,i=n.openEnd;return new r.Slice(o,e.depth,i||0)}(i,function(e,t){for(var n=new V(e),r=1;t.size&&r<=3;r++)t=n.placeSlice(t.content,t.openStart,t.openEnd,r);for(;n.open.length;)n.closeNode();return n.placed}(i,o)),l=A(i,a,s);if(!l)return null;if(s.size!=l.size&&function(e,t,n){if(!t.parent.isTextblock)return!1;var r,o=n.openEnd?function(e,t){for(var n=1;n<t;n++)e=e.lastChild.content;return e.lastChild}(n.content,n.openEnd):e.node(e.depth-(n.openStart-n.openEnd));if(!o.isTextblock)return!1;for(var i=t.index();i<t.parent.childCount;i++)if(!o.type.allowsMarks(t.parent.child(i).marks))return!1;n.openEnd?r=o.contentMatchAt(o.childCount):(r=o.contentMatchAt(o.childCount),n.size&&(r=r.matchFragment(n.content,n.openStart?1:0)));return(r=r.matchFragment(t.parent.content,t.index()))&&r.validEnd}(i,a,s)){for(var c=a.depth,u=a.after(c);c>1&&u==a.end(--c);)++u;var f=A(i,e.resolve(u),s);if(f)return new y(t,u,n,a.end(),f,s.size)}return l.size||t!=n?new m(t,n,l):null}function x(e,t,n,o,i,a,s){var l,c=e.childCount,u=c-(s>0?1:0),f=a<0?t:n.node(i);l=a<0?f.contentMatchAt(u):1==c&&s>0?f.contentMatchAt(a?n.index(i):n.indexAfter(i)):f.contentMatchAt(n.indexAfter(i)).matchFragment(e,c>0&&a?1:0,u);var p=o.node(i);if(s>0&&i<o.depth){var d=p.content.cutByIndex(o.indexAfter(i)).addToStart(e.lastChild),h=l.fillBefore(d,!0);if(h&&h.size&&a>0&&1==c&&(h=null),h){var v=x(e.lastChild.content,e.lastChild,n,o,i+1,1==c?a-1:-1,s-1);if(v){var m=e.lastChild.copy(v);return h.size?e.cutByIndex(0,c-1).append(h).addToEnd(m):e.replaceChild(c-1,m)}}}s>0&&(l=l.matchType((1==c&&a>0?n.node(i+1):e.lastChild).type));var y=o.index(i);if(y==p.childCount&&!p.type.compatibleContent(t.type))return null;for(var g=l.fillBefore(p.content,!0,y),b=y;g&&b<p.content.childCount;b++)f.type.allowsMarks(p.content.child(b).marks)||(g=null);if(!g)return null;if(s>0){var w=function e(t,n,o,i,a){var s,l=t.content,c=l.childCount;s=a>=0?o.node(i).contentMatchAt(o.indexAfter(i)).matchFragment(l,a>0?1:0,c):t.contentMatchAt(c);if(n>0){var u=e(l.lastChild,n-1,o,i+1,1==c?a-1:-1);l=l.replaceChild(c-1,u)}return t.copy(l.append(s.fillBefore(r.Fragment.empty,!0)))}(e.lastChild,s-1,n,i+1,1==c?a-1:-1);e=e.replaceChild(c-1,w)}return e=e.append(g),o.depth>i&&(e=e.addToEnd(function e(t,n){var r=t.node(n),o=r.contentMatchAt(0).fillBefore(r.content,!0,t.index(n));t.depth>n&&(o=o.addToEnd(e(t,n+1)));return r.copy(o)}(o,i+1))),e}function A(e,t,n){var o=x(n.content,e.node(0),e,t,0,n.openStart,n.openEnd);return o?function(e,t,n){for(;t>0&&n>0&&1==e.childCount;)e=e.firstChild.content,t--,n--;return new r.Slice(e,t,n)}(o,n.openStart,t.depth):null}function T(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}h.jsonID("removeMark",_),u.prototype.addMark=function(e,t,n){var r=this,o=[],i=[],a=null,s=null;return this.doc.nodesBetween(e,t,(function(r,l,c){if(r.isInline){var u=r.marks;if(!n.isInSet(u)&&c.type.allowsMarkType(n.type)){for(var f=Math.max(l,e),p=Math.min(l+r.nodeSize,t),d=n.addToSet(u),h=0;h<u.length;h++)u[h].isInSet(d)||(a&&a.to==f&&a.mark.eq(u[h])?a.to=p:o.push(a=new _(f,p,u[h])));s&&s.to==f?s.to=p:i.push(s=new S(f,p,n))}}})),o.forEach((function(e){return r.step(e)})),i.forEach((function(e){return r.step(e)})),this},u.prototype.removeMark=function(e,t,n){var o=this;void 0===n&&(n=null);var i=[],a=0;return this.doc.nodesBetween(e,t,(function(o,s){if(o.isInline){a++;var l=null;if(n instanceof r.MarkType){var c=n.isInSet(o.marks);c&&(l=[c])}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length)for(var u=Math.min(s+o.nodeSize,t),f=0;f<l.length;f++){for(var p=l[f],d=void 0,h=0;h<i.length;h++){var v=i[h];v.step==a-1&&p.eq(i[h].style)&&(d=v)}d?(d.to=u,d.step=a):i.push({style:p,from:Math.max(s,e),to:u,step:a})}}})),i.forEach((function(e){return o.step(new _(e.from,e.to,e.style))})),this},u.prototype.clearIncompatible=function(e,t,n){void 0===n&&(n=t.contentMatch);for(var o=this.doc.nodeAt(e),i=[],a=e+1,s=0;s<o.childCount;s++){var l=o.child(s),c=a+l.nodeSize,u=n.matchType(l.type,l.attrs);if(u){n=u;for(var f=0;f<l.marks.length;f++)t.allowsMarkType(l.marks[f].type)||this.step(new _(a,c,l.marks[f]))}else i.push(new m(a,c,r.Slice.empty));a=c}if(!n.validEnd){var p=n.fillBefore(r.Fragment.empty,!0);this.replace(a,a,new r.Slice(p,0,0))}for(var d=i.length-1;d>=0;d--)this.step(i[d]);return this},u.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=r.Slice.empty);var o=C(this.doc,e,t,n);return o&&this.step(o),this},u.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new r.Slice(r.Fragment.from(n),0,0))},u.prototype.delete=function(e,t){return this.replace(e,t,r.Slice.empty)},u.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var V=function(e){this.open=[];for(var t=0;t<=e.depth;t++){var n=e.node(t),o=n.contentMatchAt(e.indexAfter(t));this.open.push({parent:n,match:o,content:r.Fragment.empty,wrapper:!1,openEnd:0,depth:t})}this.placed=[]};function j(e,t,n){var r=e.content;if(t>1){var o=j(e.firstChild,t-1,1==e.childCount?n-1:0);r=e.content.replaceChild(0,o)}var i=e.type.contentMatch.fillBefore(r,0==n);return e.copy(i.append(r))}function E(e,t,n,r,o){if(t<n){var i=e.firstChild;e=e.replaceChild(0,i.copy(E(i.content,t+1,n,r,i)))}return t>r&&(e=o.contentMatchAt(0).fillBefore(e,!0).append(e)),e}function P(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;o==t.start(r)&&n.push(r)}return n}V.prototype.placeSlice=function(e,t,n,o,i){if(t>0){var a=e.firstChild,s=this.placeSlice(a.content,Math.max(0,t-1),n&&1==e.childCount?n-1:0,o,a);s.content!=a.content&&(s.content.size?(e=e.replaceChild(0,a.copy(s.content)),t=s.openStart+1):(1==e.childCount&&(n=0),e=e.cutByIndex(1),t=0))}var l=this.placeContent(e,t,n,o,i);if(o>2&&l.size&&0==t){for(var c=0;c<l.content.childCount;c++){var u=l.content.child(c);this.placeContent(u.content,0,n&&c==l.content.childCount.length-1?n-1:0,o,u)}l=r.Fragment.empty}return l},V.prototype.placeContent=function(e,t,n,o,i){for(var a=0;a<e.childCount;a++){for(var s=e.child(a),l=!1,c=a==e.childCount-1,u=this.open.length-1;u>=0;u--){var f=this.open[u],p=void 0;if(o>1&&(p=f.match.findWrapping(s.type))&&(!i||!p.length||p[p.length-1]!=i.type)){for(;this.open.length-1>u;)this.closeNode();for(var d=0;d<p.length;d++)f.match=f.match.matchType(p[d]),u++,f={parent:p[d].create(),match:p[d].contentMatch,content:r.Fragment.empty,wrapper:!0,openEnd:0,depth:u+d},this.open.push(f)}var h=f.match.matchType(s.type);if(!h){var v=f.match.fillBefore(r.Fragment.from(s));if(!v){if(i&&f.match.matchType(i.type))break;continue}for(var m=0;m<v.childCount;m++){var y=v.child(m);this.addNode(f,y,0),h=f.match.matchFragment(y)}}for(;this.open.length-1>u;)this.closeNode();s=s.mark(f.parent.type.allowedMarks(s.marks)),t&&(s=j(s,t,c?n:0),t=0),this.addNode(f,s,c?n:0),f.match=h,c&&(n=0),l=!0;break}if(!l)break}return this.open.length>1&&(a>0&&a==e.childCount||i&&this.open[this.open.length-1].parent.type==i.type)&&this.closeNode(),new r.Slice(e.cutByIndex(a),t,n)},V.prototype.addNode=function(e,t,n){var o,i;e.content=(o=e.content,i=e.openEnd,i?o.replaceChild(o.childCount-1,function e(t,n){var o=t.content;if(n>1){var i=e(t.lastChild,n-1);o=t.content.replaceChild(t.childCount-1,i)}var a=t.contentMatchAt(t.childCount).fillBefore(r.Fragment.empty,!0);return t.copy(o.append(a))}(o.lastChild,i)):o).addToEnd(t),e.openEnd=n},V.prototype.closeNode=function(){var e=this.open.pop();0==e.content.size||(e.wrapper?this.addNode(this.open[this.open.length-1],e.parent.copy(e.content),e.openEnd+1):this.placed[e.depth]={depth:e.depth,content:e.content,openEnd:e.openEnd})},u.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var o=this.doc.resolve(e),i=this.doc.resolve(t);if(T(o,i,n))return this.step(new m(e,t,n));var a=P(o,this.doc.resolve(t));0==a[a.length-1]&&a.pop();var s=-(o.depth+1);a.unshift(s);for(var l=o.depth,c=o.pos-1;l>0;l--,c--){var u=o.node(l).type.spec;if(u.defining||u.isolating)break;a.indexOf(l)>-1?s=l:o.before(l)==c&&a.splice(1,0,-l)}for(var f=a.indexOf(s),p=[],d=n.openStart,h=n.content,v=0;;v++){var y=h.firstChild;if(p.push(y),v==n.openStart)break;h=y.content}d>0&&p[d-1].type.spec.defining&&o.node(f).type!=p[d-1].type?d-=1:d>=2&&p[d-1].isTextblock&&p[d-2].type.spec.defining&&o.node(f).type!=p[d-2].type&&(d-=2);for(var g=n.openStart;g>=0;g--){var b=(g+d+1)%(n.openStart+1),w=p[b];if(w)for(var k=0;k<a.length;k++){var O=a[(k+f)%a.length],M=!0;O<0&&(M=!1,O=-O);var S=o.node(O-1),_=o.index(O-1);if(S.canReplaceWith(_,_,w.type,w.marks))return this.replace(o.before(O),M?i.after(O):t,new r.Slice(E(n.content,0,n.openStart,b),b,n.openEnd))}}return this.replace(e,t,n)},u.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var o=O(this.doc,e,n.type);null!=o&&(e=t=o)}return this.replaceRange(e,t,new r.Slice(r.Fragment.from(n),0,0))},u.prototype.deleteRange=function(e,t){for(var n=this.doc.resolve(e),r=this.doc.resolve(t),o=P(n,r),i=0;i<o.length;i++){var a=o[i],s=i==o.length-1;if(s&&0==a||n.node(a).type.contentMatch.validEnd)return this.delete(n.start(a),r.end(a));if(a>0&&(s||n.node(a-1).canReplace(n.index(a-1),r.indexAfter(a-1))))return this.delete(n.before(a),r.after(a))}for(var l=1;l<=n.depth;l++)if(e-n.start(l)==n.depth-l&&t>n.end(l))return this.delete(n.before(l),t);return this.delete(e,t)},t.Transform=u,t.TransformError=c,t.Step=h,t.StepResult=v,t.joinPoint=function(e,t,n){void 0===n&&(n=-1);for(var r=e.resolve(t),o=r.depth;;o--){var i=void 0,a=void 0;if(o==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(o+1),a=r.node(o).maybeChild(r.index(o)+1)):(i=r.node(o).maybeChild(r.index(o)-1),a=r.node(o+1)),i&&!i.isTextblock&&k(i,a))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}},t.canJoin=function(e,t){var n=e.resolve(t),r=n.index();return k(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)},t.canSplit=function(e,t,n,r){void 0===n&&(n=1);var o=e.resolve(t),i=o.depth-n,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var s=o.depth-1,l=n-2;s>i;s--,l--){var c=o.node(s),u=o.index(s);if(c.type.spec.isolating)return!1;var f=c.content.cutByIndex(u,c.childCount),p=r&&r[l]||c;if(p!=c&&(f=f.replaceChild(0,p.type.create(p.attrs))),!c.canReplace(u+1,c.childCount)||!p.type.validContent(f))return!1}var d=o.indexAfter(i),h=r&&r[0];return o.node(i).canReplaceWith(d,d,h?h.type:o.node(i+1).type)},t.insertPoint=O,t.dropPoint=function(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i<n.openStart;i++)o=o.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=r.depth;s>=0;s--){var l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(l>0?1:0);if(1==a?r.node(s).canReplace(c,c,o):r.node(s).contentMatchAt(c).findWrapping(o.firstChild.type))return 0==l?r.pos:l<0?r.before(s+1):r.after(s+1)}return null},t.liftTarget=function(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!b(r,o,i))break}},t.findWrapping=function(e,t,n,r){void 0===r&&(r=e);var o=function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;var a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}(e,t),i=o&&function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:t).contentMatch,l=r;s&&l<o;l++)s=s.matchType(n.child(l).type);if(!s||!s.validEnd)return null;return a}(r,t);return i?o.map(w).concat({type:t,attrs:n}).concat(i.map(w)):null},t.StepMap=s,t.MapResult=a,t.Mapping=l,t.AddMarkStep=S,t.RemoveMarkStep=_,t.ReplaceStep=m,t.ReplaceAroundStep=y,t.replaceStep=C},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),o=n(5),i=["ol",0],a=["ul",0],s=["li",0],l={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:function(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1}}}],toDOM:function(e){return 1==e.attrs.order?i:["ol",{start:e.attrs.order},0]}},c={parseDOM:[{tag:"ul"}],toDOM:function(){return a}},u={parseDOM:[{tag:"li"}],toDOM:function(){return s},defining:!0};function f(e,t){var n={};for(var r in e)n[r]=e[r];for(var o in t)n[o]=t[o];return n}t.orderedList=l,t.bulletList=c,t.listItem=u,t.addListNodes=function(e,t,n){return e.append({ordered_list:f(l,{content:"list_item+",group:n}),bullet_list:f(c,{content:"list_item+",group:n}),list_item:f(u,{content:t})})},t.wrapInList=function(e,t){return function(n,i){var a=n.selection,s=a.$from,l=a.$to,c=s.blockRange(l),u=!1,f=c;if(!c)return!1;if(c.depth>=2&&s.node(c.depth-1).type.compatibleContent(e)&&0==c.startIndex){if(0==s.index(c.depth-1))return!1;var p=n.doc.resolve(c.start-2);f=new o.NodeRange(p,p,c.depth),c.endIndex<c.parent.childCount&&(c=new o.NodeRange(s,n.doc.resolve(l.end(c.depth)),c.depth)),u=!0}var d=r.findWrapping(f,e,t,c);return!!d&&(i&&i(function(e,t,n,i,a){for(var s=o.Fragment.empty,l=n.length-1;l>=0;l--)s=o.Fragment.from(n[l].type.create(n[l].attrs,s));e.step(new r.ReplaceAroundStep(t.start-(i?2:0),t.end,t.start,t.end,new o.Slice(s,0,0),n.length,!0));for(var c=0,u=0;u<n.length;u++)n[u].type==a&&(c=u+1);for(var f=n.length-c,p=t.start+n.length-(i?2:0),d=t.parent,h=t.startIndex,v=t.endIndex,m=!0;h<v;h++,m=!1)!m&&r.canSplit(e.doc,p,f)&&(e.split(p,f),p+=2*f),p+=d.child(h).nodeSize;return e}(n.tr,c,d,u,e).scrollIntoView()),!0)}},t.splitListItem=function(e){return function(t,n){var i=t.selection,a=i.$from,s=i.$to,l=i.node;if(l&&l.isBlock||a.depth<2||!a.sameParent(s))return!1;var c=a.node(-1);if(c.type!=e)return!1;if(0==a.parent.content.size){if(2==a.depth||a.node(-3).type!=e||a.index(-2)!=a.node(-2).childCount-1)return!1;if(n){for(var u=o.Fragment.empty,f=a.index(-1)>0,p=a.depth-(f?1:2);p>=a.depth-3;p--)u=o.Fragment.from(a.node(p).copy(u));u=u.append(o.Fragment.from(e.createAndFill()));var d=t.tr.replace(a.before(f?null:-1),a.after(-3),new o.Slice(u,f?3:2,2));d.setSelection(t.selection.constructor.near(d.doc.resolve(a.pos+(f?3:2)))),n(d.scrollIntoView())}return!0}var h=s.pos==a.end()?c.contentMatchAt(a.indexAfter(-1)).defaultType:null,v=t.tr.delete(a.pos,s.pos),m=h&&[null,{type:h}];return!!r.canSplit(v.doc,a.pos,2,m)&&(n&&n(v.split(a.pos,2,m).scrollIntoView()),!0)}},t.liftListItem=function(e){return function(t,n){var i=t.selection,a=i.$from,s=i.$to,l=a.blockRange(s,(function(t){return t.childCount&&t.firstChild.type==e}));return!!l&&(!n||(a.node(l.depth-1).type==e?function(e,t,n,i){var a=e.tr,s=i.end,l=i.$to.end(i.depth);s<l&&(a.step(new r.ReplaceAroundStep(s-1,l,s,l,new o.Slice(o.Fragment.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new o.NodeRange(a.doc.resolve(i.$from.pos),a.doc.resolve(l),i.depth));return t(a.lift(i,r.liftTarget(i)).scrollIntoView()),!0}(t,n,e,l):function(e,t,n){for(var i=e.tr,a=n.parent,s=n.end,l=n.endIndex-1,c=n.startIndex;l>c;l--)s-=a.child(l).nodeSize,i.delete(s-1,s+1);var u=i.doc.resolve(n.start),f=u.nodeAfter,p=0==n.startIndex,d=n.endIndex==a.childCount,h=u.node(-1),v=u.index(-1);if(!h.canReplace(v+(p?0:1),v+1,f.content.append(d?o.Fragment.empty:o.Fragment.from(a))))return!1;var m=u.pos,y=m+f.nodeSize;return i.step(new r.ReplaceAroundStep(m-(p?1:0),y+(d?1:0),m+1,y-1,new o.Slice((p?o.Fragment.empty:o.Fragment.from(a.copy(o.Fragment.empty))).append(d?o.Fragment.empty:o.Fragment.from(a.copy(o.Fragment.empty))),p?0:1,d?0:1),p?0:1)),t(i.scrollIntoView()),!0}(t,n,l)))}},t.sinkListItem=function(e){return function(t,n){var i=t.selection,a=i.$from,s=i.$to,l=a.blockRange(s,(function(t){return t.childCount&&t.firstChild.type==e}));if(!l)return!1;var c=l.startIndex;if(0==c)return!1;var u=l.parent,f=u.child(c-1);if(f.type!=e)return!1;if(n){var p=f.lastChild&&f.lastChild.type==u.type,d=o.Fragment.from(p?e.create():null),h=new o.Slice(o.Fragment.from(e.create(null,o.Fragment.from(u.type.create(null,d)))),p?3:1,0),v=l.start,m=l.end;n(t.tr.step(new r.ReplaceAroundStep(v-(p?3:1),m,v,m,h,1,!0)).scrollIntoView())}return!0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),o=n(5),i=n(4);function a(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function s(e,t,n){var o=e.selection.$cursor;if(!o||(n?!n.endOfTextblock("backward",e):o.parentOffset>0))return!1;var a=u(o);if(!a){var s=o.blockRange(),c=s&&r.liftTarget(s);return null!=c&&(t&&t(e.tr.lift(s,c).scrollIntoView()),!0)}var f=a.nodeBefore;if(!f.type.spec.isolating&&w(e,a,t))return!0;if(0==o.parent.content.size&&(l(f,"end")||i.NodeSelection.isSelectable(f))){if(t){var p=e.tr.deleteRange(o.before(),o.after());p.setSelection(l(f,"end")?i.Selection.findFrom(p.doc.resolve(p.mapping.map(a.pos,-1)),-1):i.NodeSelection.create(p.doc,a.pos-f.nodeSize)),t(p.scrollIntoView())}return!0}return!(!f.isAtom||a.depth!=o.depth-1)&&(t&&t(e.tr.delete(a.pos-f.nodeSize,a.pos).scrollIntoView()),!0)}function l(e,t){for(;e;e="start"==t?e.firstChild:e.lastChild)if(e.isTextblock)return!0;return!1}function c(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var o=u(r),a=o&&o.nodeBefore;return!(!a||!i.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)}function u(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function f(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;var o=d(r);if(!o)return!1;var a=o.nodeAfter;if(w(e,o,t))return!0;if(0==r.parent.content.size&&(l(a,"start")||i.NodeSelection.isSelectable(a))){if(t){var s=e.tr.deleteRange(r.before(),r.after());s.setSelection(l(a,"start")?i.Selection.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):i.NodeSelection.create(s.doc,s.mapping.map(o.pos))),t(s.scrollIntoView())}return!0}return!(!a.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+a.nodeSize).scrollIntoView()),!0)}function p(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;var o=d(r),a=o&&o.nodeAfter;return!(!a||!i.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,o.pos)).scrollIntoView()),!0)}function d(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function h(e,t){var n=e.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)}function v(e,t){var n=e.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var a=r.node(-1),s=r.indexAfter(-1),l=a.contentMatchAt(s).defaultType;if(!a.canReplaceWith(s,s,l))return!1;if(t){var c=r.after(),u=e.tr.replaceWith(c,c,l.createAndFill());u.setSelection(i.Selection.near(u.doc.resolve(c),1)),t(u.scrollIntoView())}return!0}function m(e,t){var n=e.selection,r=n.$from,o=n.$to;if(r.parent.inlineContent||o.parent.inlineContent)return!1;var a=r.parent.contentMatchAt(o.indexAfter()).defaultType;if(!a||!a.isTextblock)return!1;if(t){var s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=e.tr.insert(s,a.createAndFill());l.setSelection(i.TextSelection.create(l.doc,s+1)),t(l.scrollIntoView())}return!0}function y(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var o=n.before();if(r.canSplit(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),a=i&&r.liftTarget(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}function g(e,t){var n=e.selection,a=n.$from,s=n.$to;if(e.selection instanceof i.NodeSelection&&e.selection.node.isBlock)return!(!a.parentOffset||!r.canSplit(e.doc,a.pos))&&(t&&t(e.tr.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(t){var l=s.parentOffset==s.parent.content.size,c=e.tr;e.selection instanceof i.TextSelection&&c.deleteSelection();var u=0==a.depth?null:a.node(-1).contentMatchAt(a.indexAfter(-1)).defaultType,f=l&&u?[{type:u}]:null,p=r.canSplit(c.doc,c.mapping.map(a.pos),1,f);f||p||!r.canSplit(c.doc,c.mapping.map(a.pos),1,u&&[{type:u}])||(f=[{type:u}],p=!0),p&&(c.split(c.mapping.map(a.pos),1,f),l||a.parentOffset||a.parent.type==u||!a.node(-1).canReplace(a.index(-1),a.indexAfter(-1),o.Fragment.from(u.create(),a.parent))||c.setNodeMarkup(c.mapping.map(a.before()),u)),t(c.scrollIntoView())}return!0}function b(e,t){return t&&t(e.tr.setSelection(new i.AllSelection(e.doc))),!0}function w(e,t,n){var a,s,l=t.nodeBefore,c=t.nodeAfter;if(l.type.spec.isolating||c.type.spec.isolating)return!1;if(function(e,t,n){var o=t.nodeBefore,i=t.nodeAfter,a=t.index();return!!(o&&i&&o.type.compatibleContent(i.type))&&(!o.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(a,a+1)||!i.isTextblock&&!r.canJoin(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,o.type,o.contentMatchAt(o.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;if(t.parent.canReplace(t.index(),t.index()+1)&&(a=(s=l.contentMatchAt(l.childCount)).findWrapping(c.type))&&s.matchType(a[0]||c.type).validEnd){if(n){for(var u=t.pos+c.nodeSize,f=o.Fragment.empty,p=a.length-1;p>=0;p--)f=o.Fragment.from(a[p].create(null,f));f=o.Fragment.from(l.copy(f));var d=e.tr.step(new r.ReplaceAroundStep(t.pos-1,u,t.pos,u,new o.Slice(f,1,0),a.length,!0)),h=u+2*a.length;r.canJoin(d.doc,h)&&d.join(h),n(d.scrollIntoView())}return!0}var v=i.Selection.findFrom(t,1),m=v&&v.$from.blockRange(v.$to),y=m&&r.liftTarget(m);return null!=y&&y>=t.depth&&(n&&n(e.tr.lift(m,y).scrollIntoView()),!0)}function k(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(t,n,r){for(var o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}var O=k(a,s,c),M=k(a,f,p),S={Enter:k(h,m,y,g),"Mod-Enter":v,Backspace:O,"Mod-Backspace":O,Delete:M,"Mod-Delete":M,"Mod-a":b},_={"Ctrl-h":S.Backspace,"Alt-Backspace":S["Mod-Backspace"],"Ctrl-d":S.Delete,"Ctrl-Alt-Backspace":S["Mod-Delete"],"Alt-Delete":S["Mod-Delete"],"Alt-d":S["Mod-Delete"]};for(var C in S)_[C]=S[C];var x=("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?_:S;t.deleteSelection=a,t.joinBackward=s,t.selectNodeBackward=c,t.joinForward=f,t.selectNodeForward=p,t.joinUp=function(e,t){var n,o=e.selection,a=o instanceof i.NodeSelection;if(a){if(o.node.isTextblock||!r.canJoin(e.doc,o.from))return!1;n=o.from}else if(null==(n=r.joinPoint(e.doc,o.from,-1)))return!1;if(t){var s=e.tr.join(n);a&&s.setSelection(i.NodeSelection.create(s.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(s.scrollIntoView())}return!0},t.joinDown=function(e,t){var n,o=e.selection;if(o instanceof i.NodeSelection){if(o.node.isTextblock||!r.canJoin(e.doc,o.to))return!1;n=o.to}else if(null==(n=r.joinPoint(e.doc,o.to,1)))return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0},t.lift=function(e,t){var n=e.selection,o=n.$from,i=n.$to,a=o.blockRange(i),s=a&&r.liftTarget(a);return null!=s&&(t&&t(e.tr.lift(a,s).scrollIntoView()),!0)},t.newlineInCode=h,t.exitCode=v,t.createParagraphNear=m,t.liftEmptyBlock=y,t.splitBlock=g,t.splitBlockKeepMarks=function(e,t){return g(e,t&&function(n){var r=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();r&&n.ensureMarks(r),t(n)})},t.selectParentNode=function(e,t){var n,r=e.selection,o=r.$from,a=r.to,s=o.sharedDepth(a);return 0!=s&&(n=o.before(s),t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,n))),!0)},t.selectAll=b,t.wrapIn=function(e,t){return function(n,o){var i=n.selection,a=i.$from,s=i.$to,l=a.blockRange(s),c=l&&r.findWrapping(l,e,t);return!!c&&(o&&o(n.tr.wrap(l,c).scrollIntoView()),!0)}},t.setBlockType=function(e,t){return function(n,r){var o=n.selection,i=o.from,a=o.to,s=!1;return n.doc.nodesBetween(i,a,(function(r,o){if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{var i=n.doc.resolve(o),a=i.index();s=i.parent.canReplaceWith(a,a+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,a,e,t).scrollIntoView()),!0)}},t.toggleMark=function(e,t){return function(n,r){var o=n.selection,i=o.empty,a=o.$cursor,s=o.ranges;if(i&&!a||!function(e,t,n){for(var r=function(r){var o=t[r],i=o.$from,a=o.$to,s=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,a.pos,(function(e){if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return{v:!0}},o=0;o<t.length;o++){var i=r(o);if(i)return i.v}return!1}(n.doc,s,e))return!1;if(r)if(a)e.isInSet(n.storedMarks||a.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{for(var l=!1,c=n.tr,u=0;!l&&u<s.length;u++){var f=s[u],p=f.$from,d=f.$to;l=n.doc.rangeHasMark(p.pos,d.pos,e)}for(var h=0;h<s.length;h++){var v=s[h],m=v.$from,y=v.$to;l?c.removeMark(m.pos,y.pos,e):c.addMark(m.pos,y.pos,e.create(t))}r(c.scrollIntoView())}return!0}},t.autoJoin=function(e,t){if(Array.isArray(t)){var n=t;t=function(e){return n.indexOf(e.type.name)>-1}}return function(n,o){return e(n,o&&function(e,t){return function(n){if(!n.isGeneric)return e(n);for(var o=[],i=0;i<n.mapping.maps.length;i++){for(var a=n.mapping.maps[i],s=0;s<o.length;s++)o[s]=a.map(o[s]);a.forEach((function(e,t,n,r){return o.push(n,r)}))}for(var l=[],c=0;c<o.length;c+=2)for(var u=o[c],f=o[c+1],p=n.doc.resolve(u),d=p.sharedDepth(f),h=p.node(d),v=p.indexAfter(d),m=p.after(d+1);m<=f;++v){var y=h.maybeChild(v);if(!y)break;if(v&&-1==l.indexOf(m)){var g=h.child(v-1);g.type==y.type&&t(g,y)&&l.push(m)}m+=y.nodeSize}l.sort((function(e,t){return e-t}));for(var b=l.length-1;b>=0;b--)r.canJoin(n.doc,l[b])&&n.join(l[b]);e(n)}}(o,t))}},t.chainCommands=k,t.pcBaseKeymap=S,t.macBaseKeymap=_,t.baseKeymap=x},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.node=t,this.outerView=n,this.getPos=r,this.renderNode(t.attrs)}return r(e,[{key:"renderNode",value:function(e){throw console.log(this.node,e),new Error("renderNode must be implemented by child class!")}}],[{key:"unsetPrefixAttributes",value:function(e,t){var n={};return Object.keys(t).forEach((function(r){r.substr(0,e.length)!==e&&(n[r]=t[r])})),n}}]),e}();t.default=o,window.AbstractNodeView=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(39),a=(r=i)&&r.__esModule?r:{default:r};var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.items=t}return o(e,[{key:"isAvailable",value:function(e){return this.items.some((function(t){return t.isAvailable(e)}))}},{key:"getMenuItem",value:function(e,t){if(!this.isAvailable(e))throw new Error("None of the items is valid for this Schema!");if(!t)throw new Error("dropdown attributes missing!");return new a.default(this.items.filter((function(t){return t.isAvailable(e)})).map((function(t){return t.getMenuItem(e)})),t)}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(30))&&"object"==typeof r&&"default"in r?r.default:r,i=n(6),a=n(4),s=function(e,t){this.items=e,this.eventCount=t};s.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(n.items.get(i-1).selection){--i;break}}t&&(r=this.remapping(i,this.items.length),o=r.maps.length);var a,c,u=e.tr,f=[],p=[];return this.items.forEach((function(e,t){if(!e.step)return r||(r=n.remapping(i,t+1),o=r.maps.length),o--,void p.push(e);if(r){p.push(new l(e.map));var d,h=e.step.map(r.slice(o));h&&u.maybeStep(h).doc&&(d=u.mapping.maps[u.mapping.maps.length-1],f.push(new l(d,null,null,f.length+p.length))),o--,d&&r.appendMap(d,o)}else u.maybeStep(e.step);return e.selection?(a=r?e.selection.map(r.slice(o)):e.selection,c=new s(n.items.slice(0,i).append(p.reverse().concat(f)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:c,transform:u,selection:a}},s.prototype.addTransform=function(e,t,n,r){for(var o=[],i=this.eventCount,a=this.items,c=!r&&a.length?a.get(a.length-1):null,f=0;f<e.steps.length;f++){var p,d=e.steps[f].invert(e.docs[f]),h=new l(e.mapping.maps[f],d,t);(p=c&&c.merge(h))&&(h=p,f?o.pop():a=a.slice(0,a.length-1)),o.push(h),t&&(i++,t=null),r||(c=h)}var v,m,y,g=i-n.depth;return g>u&&(m=g,(v=a).forEach((function(e,t){if(e.selection&&0==m--)return y=t,!1})),a=v.slice(y),i-=g),new s(a.append(o),i)},s.prototype.remapping=function(e,t){var n=new i.Mapping;return this.items.forEach((function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?o=n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,o)}),e,t),n},s.prototype.addMaps=function(e){return 0==this.eventCount?this:new s(this.items.append(e.map((function(e){return new l(e)}))),this.eventCount)},s.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach((function(e){e.selection&&a--}),r);var c=t;this.items.forEach((function(t){var r=o.getMirror(--c);if(null!=r){i=Math.min(i,r);var s=o.maps[r];if(t.step){var u=e.steps[r].invert(e.docs[r]),f=t.selection&&t.selection.map(o.slice(c+1,r));f&&a++,n.push(new l(s,u,f))}else n.push(new l(s))}}),r);for(var u=[],f=t;f<i;f++)u.push(new l(o.maps[f]));var p=this.items.slice(0,r).append(u).append(n),d=new s(p,a);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d},s.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},s.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((function(o,a){if(a>=e)r.push(o),o.selection&&i++;else if(o.step){var s=o.step.map(t.slice(n)),c=s&&s.getMap();if(n--,c&&t.appendMap(c,n),s){var u=o.selection&&o.selection.map(t.slice(n));u&&i++;var f,p=new l(c.invert(),s,u),d=r.length-1;(f=r.length&&r[d].merge(p))?r[d]=f:r.push(p)}}else o.map&&n--}),this.items.length,0),new s(o.from(r.reverse()),i)},s.empty=new s(o.empty,0);var l=function(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r};l.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new l(t.getMap().invert(),t,this.selection)}};var c=function(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r},u=20;function f(e){var t=[];return e.forEach((function(e,n,r,o){return t.push(r,o)})),t}function p(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function d(e,t,n,r){var o=m(t),i=y.get(t).spec.config,a=(r?e.undone:e.done).popEvent(t,o);if(a){var s=a.selection.resolve(a.transform.doc),l=(r?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,o),u=new c(r?l:a.remaining,r?a.remaining:l,null,0);n(a.transform.setSelection(s).setMeta(y,{redo:r,historyState:u}).scrollIntoView())}}var h=!1,v=null;function m(e){var t=e.plugins;if(v!=t){h=!1,v=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){h=!0;break}}return h}var y=new a.PluginKey("history"),g=new a.PluginKey("closeHistory");t.HistoryState=c,t.closeHistory=function(e){return e.setMeta(g,!0)},t.history=function(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new a.Plugin({key:y,state:{init:function(){return new c(s.empty,s.empty,null,0)},apply:function(t,n,r){return function(e,t,n,r){var o,i=n.getMeta(y);if(i)return i.historyState;n.getMeta(g)&&(e=new c(e.done,e.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(y))return a.getMeta(y).redo?new c(e.done.addTransform(n,null,r,m(t)),e.undone,f(n.mapping.maps[n.steps.length-1]),e.prevTime):new c(e.done,e.undone.addTransform(n,null,r,m(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new c(e.done.rebased(n,o),e.undone.rebased(n,o),p(e.prevRanges,n.mapping),e.prevTime):new c(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),p(e.prevRanges,n.mapping),e.prevTime);var l=e.prevTime<(n.time||0)-r.newGroupDelay||!a&&!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,r){for(var o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges),u=a?p(e.prevRanges,n.mapping):f(n.mapping.maps[n.steps.length-1]);return new c(e.done.addTransform(n,l?t.selection.getBookmark():null,r,m(t)),s.empty,u,n.time)}(n,r,t,e)}},config:e})},t.undo=function(e,t){var n=y.getState(e);return!(!n||0==n.done.eventCount)&&(t&&d(n,e,t,!1),!0)},t.redo=function(e,t){var n=y.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&d(n,e,t,!0),!0)},t.undoDepth=function(e){var t=y.getState(e);return t?t.done.eventCount:0},t.redoDepth=function(e){var t=y.getState(e);return t?t.undone.eventCount:0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setBlockTypeNoAttrCheck=function(e,t){return function(n,r){var o=n.selection,i=o.from,a=o.to,s=!1;return n.doc.nodesBetween(i,a,(function(t,r){if(s)return!1;if(!t.isTextblock||t.type===e)return!0;var o=n.doc.resolve(r),i=o.index();return s=o.parent.canReplaceWith(i,i+1,e),!0})),!!s&&(r&&r(n.tr.setBlockType(i,a,e,t).scrollIntoView()),!0)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(4),i=n(6),a={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var s=/Edge\/(\d+)/.exec(navigator.userAgent),l=/MSIE \d/.test(navigator.userAgent),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);a.mac=/Mac/.test(navigator.platform);var u=a.ie=!!(l||c||s);a.ie_version=l?document.documentMode||6:c?+c[1]:s?+s[1]:null,a.gecko=!u&&/gecko\/(\d+)/i.test(navigator.userAgent),a.gecko_version=a.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var f=!u&&/Chrome\/(\d+)/.exec(navigator.userAgent);a.chrome=!!f,a.chrome_version=f&&+f[1],a.ios=!u&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),a.android=/Android \d/.test(navigator.userAgent),a.webkit=!u&&"WebkitAppearance"in document.documentElement.style,a.safari=/Apple Computer/.test(navigator.vendor),a.webkit_version=a.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var p=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},d=function(e){var t=e.parentNode;return t&&11==t.nodeType?t.host:t},h=function(e,t,n){var r=document.createRange();return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},v=function(e,t,n,r){return n&&(y(e,t,n,r,-1)||y(e,t,n,r,1))},m=/^(img|br|input|textarea|hr)$/i;function y(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:g(e))||3==e.nodeType&&"\ufeff"==e.nodeValue){var i=e.parentNode;if(1!=i.nodeType||(a=void 0,(a=e.pmViewDesc)&&a.node&&a.node.isBlock)||m.test(e.nodeName)||"false"==e.contentEditable)return!1;t=p(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;e=e.childNodes[t+(o<0?-1:0)],t=o<0?g(e):0}}var a}function g(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}var b=function(e){var t=e.isCollapsed;return t&&a.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function w(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function k(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function O(e,t){return"number"==typeof e?e:e[t]}function M(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,a=i.defaultView,s=n||e.dom;s;s=d(s))if(1==s.nodeType){var l=s==i.body||1!=s.nodeType,c=l?k(a):s.getBoundingClientRect(),u=0,f=0;if(t.top<c.top+O(r,"top")?f=-(c.top-t.top+O(o,"top")):t.bottom>c.bottom-O(r,"bottom")&&(f=t.bottom-c.bottom+O(o,"bottom")),t.left<c.left+O(r,"left")?u=-(c.left-t.left+O(o,"left")):t.right>c.right-O(r,"right")&&(u=t.right-c.right+O(o,"right")),(u||f)&&(l?a.scrollBy(u,f):(f&&(s.scrollTop+=f),u&&(s.scrollLeft+=u))),l)break}}function S(e,t){for(var n,r,o=2e8,i=0,a=t.top,s=t.top,l=e.firstChild,c=0;l;l=l.nextSibling,c++){var u=void 0;if(1==l.nodeType)u=l.getClientRects();else{if(3!=l.nodeType)continue;u=h(l).getClientRects()}for(var f=0;f<u.length;f++){var p=u[f];if(p.top<=a&&p.bottom>=s){a=Math.max(p.bottom,a),s=Math.min(p.top,s);var d=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(d<o){n=l,o=d,r=d&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==l.nodeType&&d&&(i=c+(t.left>=(p.left+p.right)/2?1:0));continue}}!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(i=c+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);var i=x(r,1);if(i.top!=i.bottom&&_(t,i))return{node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:S(n,r)}function _(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function C(e,t){var n,r,o=e.root;if(o.caretPositionFromPoint){var i,a=o.caretPositionFromPoint(t.left,t.top);if(a)n=(i=a).offsetNode,r=i.offset}if(!n&&o.caretRangeFromPoint){var s,l=o.caretRangeFromPoint(t.left,t.top);if(l)n=(s=l).startContainer,r=s.startOffset}var c,u=o.elementFromPoint(t.left,t.top+1);if(!u||!e.dom.contains(1!=u.nodeType?u.parentNode:u)){var f=e.dom.getBoundingClientRect();if(!_(t,f))return null;if(!(u=function e(t,n,r){var o=t.childNodes.length;if(o&&r.top<r.bottom)for(var i=Math.max(0,Math.floor(o*(n.top-r.top)/(r.bottom-r.top))-2),a=i;;){var s=t.childNodes[a];if(1==s.nodeType)for(var l=s.getClientRects(),c=0;c<l.length;c++){var u=l[c];if(_(n,u))return e(s,n,u)}if((a=(a+1)%o)==i)break}return t}(e.dom,t,f)))return null}u=function(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(u,t),n&&(1==n.nodeType&&(r=Math.min(r,n.childNodes.length)),n==e.dom&&r==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?c=e.state.doc.content.size:0!=r&&1==n.nodeType&&"BR"==n.childNodes[r-1].nodeName||(c=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>r.left||s.top>r.top)o=a.posBefore;else{if(!(s.right<r.left||s.bottom<r.top))break;o=a.posAfter}}i=a.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n)}(e,n,r,t))),null==c&&(c=function(e,t,n){var r=S(t,n),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var s=o.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(o,i,a)}(e,u,t));var p=e.docView.nearestDesc(u,!0);return{pos:c,inside:p?p.posAtStart-p.border:-1}}function x(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}function A(e,t){var n=e.docView.domFromPos(t),r=n.node,o=n.offset;if(3==r.nodeType&&(a.chrome||a.gecko)){var i=x(h(r,o,o),0);if(a.gecko&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){var s=x(h(r,o-1,o-1),-1);if(Math.abs(s.left-i.left)<1&&s.top==i.top){var l=x(h(r,o,o+1),-1);return T(l,l.left<s.left)}}return i}if(1==r.nodeType&&!e.state.doc.resolve(t).parent.inlineContent){var c,u=!0;if(o<r.childNodes.length){var f=r.childNodes[o];1==f.nodeType&&(c=f.getBoundingClientRect())}if(!c&&o){var p=r.childNodes[o-1];1==p.nodeType&&(c=p.getBoundingClientRect(),u=!1)}return function(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}(c||r.getBoundingClientRect(),u)}for(var d=-1;d<2;d+=2)if(d<0&&o){var v=void 0,m=3==r.nodeType?h(r,o-1,o):3==(v=r.childNodes[o-1]).nodeType?h(v):1==v.nodeType&&"BR"!=v.nodeName?v:null;if(m){var y=x(m,1);if(y.top<y.bottom)return T(y,!1)}}else if(d>0&&o<g(r)){var b=void 0,w=3==r.nodeType?h(r,o,o+1):3==(b=r.childNodes[o]).nodeType?h(b):1==b.nodeType?b:null;if(w){var k=x(w,-1);if(k.top<k.bottom)return T(k,!0)}}return T(x(3==r.nodeType?h(r):r,0),!1)}function T(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function V(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o.focus()}}var j=/[\u0590-\u08ac]/;var E=null,P=null,N=!1;function H(e,t,n){return E==t&&P==n?N:(E=t,P=n,N="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$anchor.min(r.$head):r.$anchor.max(r.$head);return V(e,t,(function(){for(var t=e.docView.domFromPos(o.pos).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.dom;break}t=r.dom.parentNode}for(var i=A(e,o.pos),a=t.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=h(a,0,a.nodeValue.length).getClientRects()}for(var l=0;l<s.length;l++){var c=s[l];if(c.bottom>c.top&&("up"==n?c.bottom<i.top+1:c.top>i.bottom-1))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=getSelection();return j.test(r.parent.textContent)&&s.modify?V(e,t,(function(){var t=s.getRangeAt(0),o=s.focusNode,i=s.focusOffset;s.modify("move",n,"character");var a=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||o==s.focusNode&&i==s.focusOffset;return s.removeAllRanges(),s.addRange(t),a})):"left"==n||"backward"==n?i:a}(e,t,n))}var L=function(e,t,n,r){this.parent=e,this.children=t,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},D={beforePosition:{},size:{},border:{},posBefore:{},posAtStart:{},posAfter:{},posAtEnd:{},contentLost:{}};L.prototype.matchesWidget=function(){return!1},L.prototype.matchesMark=function(){return!1},L.prototype.matchesNode=function(){return!1},L.prototype.matchesHack=function(){return!1},D.beforePosition.get=function(){return!1},L.prototype.parseRule=function(){return null},L.prototype.stopEvent=function(){return!1},D.size.get=function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e},D.border.get=function(){return 0},L.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var e=0;e<this.children.length;e++)this.children[e].destroy()},L.prototype.posBeforeChild=function(e){for(var t=0,n=this.posAtStart;t<this.children.length;t++){var r=this.children[t];if(r==e)return n;n+=r.size}},D.posBefore.get=function(){return this.parent.posBeforeChild(this)},D.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},D.posAfter.get=function(){return this.posBefore+this.size},D.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},L.prototype.localPosFromDOM=function(e,t,n){var r;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var o,i;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&(!(i=o.pmViewDesc)||i.parent!=this);)o=o.previousSibling;return o?this.posBeforeChild(i)+i.size:this.posAtStart}var a,s;if(e==this.contentDOM)a=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;a=e.nextSibling}for(;a&&(!(s=a.pmViewDesc)||s.parent!=this);)a=a.nextSibling;return a?this.posBeforeChild(s):this.posAtEnd}if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var l=e;;l=l.parentNode){if(l==this.dom){r=!1;break}if(l.parentNode.firstChild!=l)break}if(null==r&&t==e.childNodes.length)for(var c=e;;c=c.parentNode){if(c==this.dom){r=!0;break}if(c.parentNode.lastChild!=c)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart},L.prototype.nearestDesc=function(e,t){for(var n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(e):o.nodeDOM==e))return o;n=!1}}},L.prototype.getDesc=function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t},L.prototype.posFromDOM=function(e,t,n){for(var r=e;;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}},L.prototype.descAt=function(e){for(var t=0,n=0;t<this.children.length;t++){var r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}},L.prototype.domFromPos=function(e){if(!this.contentDOM)return{node:this.dom,offset:0};for(var t=0,n=0;;n++){if(t==e){for(;n<this.children.length&&(this.children[n].beforePosition||this.children[n].dom.parentNode!=this.contentDOM);)n++;return{node:this.contentDOM,offset:n==this.children.length?this.contentDOM.childNodes.length:p(this.children[n].dom)}}if(n==this.children.length)throw new Error("Invalid position "+e);var r=this.children[n],o=t+r.size;if(e<o)return r.domFromPos(e-t-r.border);t=o}},L.prototype.parseRange=function(e,t,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,a=0;;a++){var s=this.children[a],l=i+s.size;if(-1==r&&e<=l){var c=i+s.border;if(e>=c&&t<=l-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,t,c);e=i;for(var u=a;u>0;u--){var f=this.children[u-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){r=p(f.dom)+1;break}e-=f.size}-1==r&&(r=0)}if(r>-1&&t<=l){t=l;for(var d=a+1;d<this.children.length;d++){var h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=p(h.dom);break}t+=h.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}},L.prototype.emptyChildAt=function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)},L.prototype.domAfterPos=function(e){var t=this.domFromPos(e),n=t.node,r=t.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]},L.prototype.setSelection=function(e,t,n,r){for(var o=Math.min(e,t),i=Math.max(e,t),a=0,s=0;a<this.children.length;a++){var l=this.children[a],c=s+l.size;if(o>s&&i<c)return l.setSelection(e-s-l.border,t-s-l.border,n,r);s=c}var u=this.domFromPos(e),f=this.domFromPos(t),p=n.getSelection(),d=document.createRange();if(r||!v(u.node,u.offset,p.anchorNode,p.anchorOffset)||!v(f.node,f.offset,p.focusNode,p.focusOffset)){if(p.extend)d.setEnd(u.node,u.offset),d.collapse(!1);else{if(e>t){var h=u;u=f,f=h}d.setEnd(f.node,f.offset),d.setStart(u.node,u.offset)}p.removeAllRanges(),p.addRange(d),p.extend&&p.extend(f.node,f.offset)}},L.prototype.ignoreMutation=function(e){return!this.contentDOM},D.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},L.prototype.markDirty=function(e,t){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){var a=n+o.border,s=i-o.border;if(e>=a&&t<=s)return this.dirty=e==n||t==i?2:1,void(e==a&&t==s&&o.contentLost?o.dirty=3:o.markDirty(e-a,t-a));o.dirty=3}n=i}this.dirty=2},L.prototype.markParentsDirty=function(){for(var e=this.parent;e;e=e.parent){e.dirty<2&&(e.dirty=2)}},Object.defineProperties(L.prototype,D);var I=[],R=function(e){function t(t,n,r,o){var i,a=n.type.toDOM;if("function"==typeof a&&(a=a(r,(function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:o}))),!n.type.spec.raw){if(1!=a.nodeType){var s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable=!1,a.classList.add("ProseMirror-widget")}e.call(this,t,I,a,null),this.widget=n,i=this}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={beforePosition:{}};return n.beforePosition.get=function(){return this.widget.type.side<0},t.prototype.matchesWidget=function(e){return 0==this.dirty&&e.type.eq(this.widget.type)},t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.stopEvent=function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)},Object.defineProperties(t.prototype,n),t}(L),$=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){return{skip:ie(this.dom)}},t.prototype.ignoreMutation=function(){return!1},t}(R),F=function(e){function t(t,n,r,o){e.call(this,t,I,n,null),this.textDOM=r,this.text=o}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{}};return n.size.get=function(){return this.text.length},t.prototype.parseRule=function(){return{skip:ie(this.dom)}},t.prototype.localPosFromDOM=function(e,t){if(e!=this.textDOM)return this.posAtStart+(t?this.size:0);var n=this.textDOM.nodeValue.indexOf("\ufeff");return this.posAtStart+t-(n>-1&&n<t?1:0)},t.prototype.domFromPos=function(e){var t=this.textDOM.nodeValue.indexOf("\ufeff");return{node:this.textDOM,offset:e+(t>-1&&t<=e?1:0)}},t.prototype.ignoreMutation=function(){return!1},Object.defineProperties(t.prototype,n),t}(L),z=function(e){function t(t,n,r,o){e.call(this,t,[],r,o),this.mark=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.create=function(e,n,o,i){var a=i.nodeViews[n.type.name],s=a&&a(n,i,o);return s&&s.dom||(s=r.DOMSerializer.renderSpec(document,n.type.spec.toDOM(n,o))),new t(e,n,s.dom,s.contentDOM||s.dom)},t.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},t.prototype.matchesMark=function(e){return 3!=this.dirty&&this.mark.eq(e)},t.prototype.markDirty=function(t,n){if(e.prototype.markDirty.call(this,t,n),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}},t.prototype.slice=function(e,n,r){var o=t.create(this.parent,this.mark,!0,r),i=this.children,a=this.size;n<a&&(i=oe(i,n,a,r)),e>0&&(i=oe(i,0,e,r));for(var s=0;s<i.length;s++)i[s].parent=o;return o.children=i,o},t}(L),B=function(e){function t(t,n,r,o,i,a,s,l,c){e.call(this,t,n.isLeaf?I:[],i,a),this.nodeDOM=s,this.node=n,this.outerDeco=r,this.innerDeco=o,a&&this.updateChildren(l,c)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{},border:{}};return t.create=function(e,n,o,i,a,s){var l,c=a.nodeViews[n.type.name],u=c&&c(n,a,(function(){return l?l.parent?l.parent.posBeforeChild(l):void 0:s}),o),f=u&&u.dom,p=u&&u.contentDOM;if(n.isText)if(f){if(3!=f.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else f=document.createTextNode(n.text);else if(!f){var d;f=(d=r.DOMSerializer.renderSpec(document,n.type.spec.toDOM(n))).dom,p=d.contentDOM}p||n.isText||"BR"==f.nodeName||(f.hasAttribute("contenteditable")||(f.contentEditable=!1),n.type.spec.draggable&&(f.draggable=!0));var h=f;return f=Y(f,o,n),u?l=new K(e,n,o,i,f,p,h,u,a,s+1):n.isText?new W(e,n,o,i,f,h,a):new t(e,n,o,i,f,p,h,a,s+1)},t.prototype.parseRule=function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};return this.node.type.spec.code&&(t.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?t.contentElement=this.contentDOM:t.getContent=function(){return e.contentDOM?r.Fragment.empty:e.node.content},t},t.prototype.matchesNode=function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ee(t,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},t.prototype.updateChildren=function(e,t){var n=this,o=this.node.inlineContent,i=t,a=o&&e.composing&&this.localCompositionNode(e,t),s=new ne(this,a&&a.node);!function(e,t,n,r){var o=t.locals(e),i=0;if(0==o.length){for(var a=0;a<e.childCount;a++){var s=e.child(a);r(s,o,t.forChild(i,s),a),i+=s.nodeSize}return}for(var l=0,c=[],u=null,f=0;;){if(l<o.length&&o[l].to==i){for(var p=o[l++],d=void 0;l<o.length&&o[l].to==i;)(d||(d=[p])).push(o[l++]);if(d){d.sort(re);for(var h=0;h<d.length;h++)n(d[h],f)}else n(p,f)}var v=void 0,m=void 0;if(u)m=-1,v=u,u=null;else{if(!(f<e.childCount))break;m=f,v=e.child(f++)}for(var y=0;y<c.length;y++)c[y].to<=i&&c.splice(y--,1);for(;l<o.length&&o[l].from==i;)c.push(o[l++]);var g=i+v.nodeSize;if(v.isText){var b=g;l<o.length&&o[l].from<b&&(b=o[l].from);for(var w=0;w<c.length;w++)c[w].to<b&&(b=c[w].to);b<g&&(u=v.cut(b-i),v=v.cut(0,b-i),g=b,m=-1)}r(v,c.length?c.slice():I,t.forChild(i,v),m),i=g}}(this.node,this.innerDeco,(function(t,a){t.spec.marks?s.syncToMarks(t.spec.marks,o,e):t.type.side>=0&&s.syncToMarks(a==n.node.childCount?r.Mark.none:n.node.child(a).marks,o,e),s.placeWidget(t,e,i)}),(function(t,n,r,a){s.syncToMarks(t.marks,o,e),s.findNodeMatch(t,n,r,a)||s.updateNextNode(t,n,r,e,a)||s.addNode(t,n,r,e,i),i+=t.nodeSize})),s.syncToMarks(I,o,e),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),this.renderChildren())},t.prototype.renderChildren=function(){!function e(t,n){for(var r=t.firstChild,o=0;o<n.length;o++){var i=n[o],a=i.dom;if(a.parentNode==t){for(;a!=r;)r=te(r);r=r.nextSibling}else t.insertBefore(a,r);if(i instanceof z){var s=r?r.previousSibling:t.lastChild;e(i.contentDOM,i.children),r=s?s.nextSibling:t.firstChild}}for(;r;)r=te(r)}(this.contentDOM,this.children,t.is),a.ios&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom)},t.prototype.localCompositionNode=function(e,t){var n=e.state.selection,r=n.from,i=n.to;if(!(!(e.state.selection instanceof o.TextSelection)||r<t||i>t+this.node.content.size)){var a=e.root.getSelection(),s=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0)e=e.childNodes[t-1],t=g(e);else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(a.focusNode,a.focusOffset);if(s&&this.dom.contains(s.parentNode)){var l=s.nodeValue.replace(/\ufeff/g,""),c=function(e,t,n,r){for(var o="",i=0,a=0;i<e.childCount;i++){var s=e.child(i),l=a+s.nodeSize;if(s.isText){if(o+=s.text,l>=r){for(var c=l-o.length,u=o.lastIndexOf(t);u>-1&&c+u>n;)u=o.lastIndexOf(t,u-1);if(u>-1&&c+u+t.length>=r)return c+u;if(l>r-t.length)break}}else o="";a=l}return-1}(this.node.content,l,r-t,i-t);return c<0?null:{node:s,pos:c,text:l}}}},t.prototype.protectLocalComposition=function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var a=new F(this,i,n,o);e.compositionNodes.push(a),this.children=oe(this.children,r,r+o.length,e,a)}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)},t.prototype.updateInner=function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},t.prototype.updateOuterDeco=function(e){if(!ee(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=U(this.dom,this.nodeDOM,Z(this.outerDeco,this.node,t),Z(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=e}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!1)},Object.defineProperties(t.prototype,n),t}(L);function J(e,t,n,r,o){return Y(r,t,e),new B(null,e,t,n,r,r,r,o,0)}var W=function(e){function t(t,n,r,o,i,a,s){e.call(this,t,n,r,o,i,null,a,s)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){var e=this.nodeDOM.parentNode;return e?{skip:e}:{ignore:!0}},t.prototype.update=function(e,t){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text),this.node=e,this.dirty=0,!0)},t.prototype.inParent=function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1},t.prototype.domFromPos=function(e){return{node:this.nodeDOM,offset:e}},t.prototype.localPosFromDOM=function(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):e.prototype.localPosFromDOM.call(this,t,n,r)},t.prototype.ignoreMutation=function(e){return"characterData"!=e.type},t.prototype.slice=function(e,n,r){var o=this.node.cut(e,n),i=document.createTextNode(o.text);return new t(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},t}(B),q=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(){return 0==this.dirty},t}(L),K=function(e){function t(t,n,r,o,i,a,s,l,c,u){e.call(this,t,n,r,o,i,a,s,c,u),this.spec=l}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(t,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(t,n);return i&&this.updateInner(t,n,r,o),i}return!(!this.contentDOM&&!t.isLeaf)&&e.prototype.update.call(this,t,n,r,o)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):e.prototype.setSelection.call(this,t,n,r,o)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)},t.prototype.ignoreMutation=function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):e.prototype.ignoreMutation.call(this,t)},t}(B);function G(e){e&&(this.nodeName=e)}G.prototype=Object.create(null);var Q=[new G];function Z(e,t,n){if(0==e.length)return Q;for(var r=n?Q[0]:new G,o=[r],i=0;i<e.length;i++){var a=e[i].type.attrs,s=r;if(a)for(var l in a.nodeName&&o.push(s=new G(a.nodeName)),a){var c=a[l];null!=c&&(n&&1==o.length&&o.push(s=r=new G(t.isInline?"span":"div")),"class"==l?s.class=(s.class?s.class+" ":"")+c:"style"==l?s.style=(s.style?s.style+";":"")+c:"nodeName"!=l&&(s[l]=c))}}return o}function U(e,t,n,r){if(n==Q&&r==Q)return t;for(var o=t,i=0;i<r.length;i++){var a=r[i],s=n[i];if(i){var l=void 0;s&&s.nodeName==a.nodeName&&o!=e&&(l=t.parentNode)&&l.tagName.toLowerCase()==a.nodeName||(l=document.createElement(a.nodeName)).appendChild(o),o=l}X(o,s||Q[0],a)}return o}function X(e,t,n){for(var r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){for(var i=t.class?t.class.split(" "):I,a=n.class?n.class.split(" "):I,s=0;s<i.length;s++)-1==a.indexOf(i[s])&&e.classList.remove(i[s]);for(var l=0;l<a.length;l++)-1==i.indexOf(a[l])&&e.classList.add(a[l])}if(t.style!=n.style){if(t.style)for(var c,u=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;c=u.exec(t.style);)e.style[c[1].toLowerCase()]="";n.style&&(e.style.cssText+=n.style)}}function Y(e,t,n){return U(e,e,Q,Z(t,n,1!=e.nodeType))}function ee(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function te(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var ne=function(e,t){this.top=e,this.lock=t,this.index=0,this.stack=[],this.changed=!1;var n=function(e,t){for(var n=[],r=e.childCount,o=t.length-1;r>0&&o>=0;o--){var i=t[o],a=i.node;if(a){if(a!=e.child(r-1))break;n.push(i),--r}}return{nodes:n.reverse(),offset:r}}(e.node.content,e.children);this.preMatched=n.nodes,this.preMatchOffset=n.offset};function re(e,t){return e.type.side-t.type.side}function oe(e,t,n,r,o){for(var i=[],a=0,s=0;a<e.length;a++){var l=e[a],c=s,u=s+=l.size;c>=n||u<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=null),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function ie(e){var t=e.cloneNode(!0);return function e(t){if(1==t.nodeType)for(var n=t.firstChild;n;n=n.nextSibling)e(n);else 3==t.nodeType&&(t.nodeValue=t.nodeValue.replace(/\ufeff/g,""))}(t),t}function ae(e,t){var n=e.selection,r=n.$anchor,i=n.$head,a=t>0?r.max(i):r.min(i),s=a.parent.inlineContent?a.depth?e.doc.resolve(t>0?a.after():a.before()):null:a;return s&&o.Selection.findFrom(s,t)}function se(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function le(e,t,n){var r=e.state.selection;if(r instanceof o.TextSelection){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=ae(e.state,t);return!!(i&&i instanceof o.NodeSelection)&&se(e,i)}var s,l=r.$head,c=l.textOffset?null:t<0?l.nodeBefore:l.nodeAfter;if(!c||c.isText)return!1;var u=t<0?l.pos-c.nodeSize:l.pos;return!!(c.isAtom||(s=e.docView.descAt(u))&&!s.contentDOM)&&(o.NodeSelection.isSelectable(c)?se(e,new o.NodeSelection(t<0?e.state.doc.resolve(l.pos-c.nodeSize):l)):!!a.webkit&&se(e,new o.TextSelection(e.state.doc.resolve(t<0?u:u+c.nodeSize))))}if(r instanceof o.NodeSelection&&r.node.isInline)return se(e,new o.TextSelection(t>0?r.$to:r.$from));var f=ae(e.state,t);return!!f&&se(e,f)}function ce(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function ue(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function fe(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,s=!1;for(a.gecko&&1==n.nodeType&&r<ce(n)&&ue(n.childNodes[r])&&(s=!0);;)if(r>0)if(1!=n.nodeType){if(3!=n.nodeType||"\ufeff"!=n.nodeValue.charAt(r-1))break;a.ie&&a.ie_version<=11&&(s=!0),o=n,i=--r}else{var l=n.childNodes[r-1];if(ue(l))o=n,i=--r;else{if(3!=l.nodeType)break;r=(n=l).nodeValue.length}}else{if(de(n))break;for(var c=n.previousSibling;c&&ue(c);)o=n.parentNode,i=p(c),c=c.previousSibling;if(c)r=ce(n=c);else{if((n=n.parentNode)==e.dom)break;r=0}}s?he(e,t,n,r):o&&he(e,t,o,i)}}function pe(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=ce(n);;)if(r<a){if(1!=n.nodeType)break;if(!ue(n.childNodes[r]))break;o=n,i=++r}else{if(de(n))break;for(var s=n.nextSibling;s&&ue(s);)o=s.parentNode,i=p(s)+1,s=s.nextSibling;if(s)r=0,a=ce(n=s);else{if((n=n.parentNode)==e.dom)break;r=a=0}}o&&he(e,t,o,i)}}function de(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function he(e,t,n,r){if(b(t)){var o=document.createRange();o.setEnd(n,r),o.setStart(n,r),t.removeAllRanges(),t.addRange(o)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection()}function ve(e,t,n){var r=e.state.selection;if(r instanceof o.TextSelection&&!r.empty||n.indexOf("s")>-1)return!1;var i=r.$from,a=r.$to;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var s=ae(e.state,t);if(s&&s instanceof o.NodeSelection)return se(e,s)}if(!i.parent.inlineContent){var l=o.Selection.findFrom(t<0?i:a,t);return!l||se(e,l)}return!1}function me(e,t){if(!(e.state.selection instanceof o.TextSelection))return!0;var n=e.state.selection,r=n.$head,i=n.$anchor,a=n.empty;if(!r.sameParent(i))return!0;if(!a)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var s=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var l=e.state.tr;return t<0?l.delete(r.pos-s.nodeSize,r.pos):l.delete(r.pos,r.pos+s.nodeSize),e.dispatch(l),!0}return!1}function ye(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ge(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||a.mac&&72==n&&"c"==r?me(e,-1)||fe(e):46==n||a.mac&&68==n&&"c"==r?me(e,1)||pe(e):13==n||27==n||(37==n?le(e,-1,r)||fe(e):39==n?le(e,1,r)||pe(e):38==n?ve(e,-1,r)||fe(e):40==n?function(e){if(a.chrome&&!(e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;ye(e,o,!0),setTimeout((function(){return ye(e,o,!1)}),20)}}}(e)||ve(e,1,r)||pe(e):r==(a.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function be(e,t,n){var r=e.state.selection;if(Oe(e,r),e.editable&&!e.hasFocus()){if(!t)return;a.gecko&&a.gecko_version<=55&&(e.domObserver.disconnectSelection(),e.dom.focus(),e.domObserver.connectSelection())}else if(!(e.editable||_e(e)&&document.activeElement.contains(e.dom)||t))return;if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){var t=e.root.getSelection(),n=document.createRange(),r=e.cursorWrapper.dom;n.setEnd(r,r.childNodes.length),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!e.state.selection.visible&&a.ie&&a.ie_version<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{var i,s,l=r.anchor,c=r.head;!we||r instanceof o.TextSelection||(r.$from.parent.inlineContent||(i=ke(e,r.from)),r.empty||r.$from.parent.inlineContent||(s=ke(e,r.to))),e.docView.setSelection(l,c,e.root,n),we&&(i&&(i.contentEditable="false"),s&&(s.contentEditable="false")),r.visible?e.dom.classList.remove("ProseMirror-hideselection"):l!=c&&(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.hideSelectionGuard);var n=e.root.getSelection(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.hideSelectionGuard),e.dom.classList.remove("ProseMirror-hideselection"))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}ne.prototype.getPreMatch=function(e){return e>=this.preMatchOffset?this.preMatched[e-this.preMatchOffset]:null},ne.prototype.destroyBetween=function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}},ne.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},ne.prototype.syncToMarks=function(e,t,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,e.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);for(var a=-1,s=this.index;s<Math.min(this.index+3,this.top.children.length);s++)if(this.top.children[s].matchesMark(e[o])){a=s;break}if(a>-1)a>this.index&&(this.changed=!0,this.top.children.splice(this.index,a-this.index)),this.top=this.top.children[this.index];else{var l=z.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}},ne.prototype.findNodeMatch=function(e,t,n,r){var o=-1,i=r<0?void 0:this.getPreMatch(r),a=this.top.children;if(i&&i.matchesNode(e,t,n))o=a.indexOf(i);else for(var s=this.index,l=Math.min(a.length,s+5);s<l;s++){var c=a[s];if(c.matchesNode(e,t,n)&&this.preMatched.indexOf(c)<0){o=s;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)},ne.prototype.updateNextNode=function(e,t,n,r,o){if(this.index==this.top.children.length)return!1;var i=this.top.children[this.index];if(i instanceof B){var a=this.preMatched.indexOf(i);if(a>-1&&a+this.preMatchOffset!=o)return!1;var s=i.dom;if(!(this.lock&&(s==this.lock||1==s.nodeType&&s.contains(this.lock.parentNode))&&!(e.isText&&i.node&&i.node.isText&&i.nodeDOM.nodeValue==e.text&&3!=i.dirty&&ee(t,i.outerDeco)))&&i.update(e,t,n,r))return i.dom!=s&&(this.changed=!0),this.index++,!0}return!1},ne.prototype.addNode=function(e,t,n,r,o){this.top.children.splice(this.index++,0,B.create(this.top,e,t,n,r,o)),this.changed=!0},ne.prototype.placeWidget=function(e,t,n){if(this.index<this.top.children.length&&this.top.children[this.index].matchesWidget(e))this.index++;else{var r=new(e.spec.isCursorWrapper?$:R)(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}},ne.prototype.placeComposition=function(e,t){this.syncToMarks(I,!0,e),this.top.children[this.index]==t?this.index++:(this.top.children.splice(this.index++,0,t),this.changed=!0)},ne.prototype.addTextblockHacks=function(){for(var e=this.top.children[this.index-1];e instanceof z;)e=e.children[e.children.length-1];if(!e||!(e instanceof W)||/\n$/.test(e.node.text))if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack())this.index++;else{var t=document.createElement("br");this.top.children.splice(this.index++,0,new q(this.top,I,t,null)),this.changed=!0}};var we=a.safari||a.chrome&&a.chrome_version<63;function ke(e,t){var n=e.docView.domFromPos(t),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,a=o?r.childNodes[o-1]:null;if(!(i&&"false"!=i.contentEditable||a&&"false"!=a.contentEditable)){if(i)return i.contentEditable="true",i;if(a)return a.contentEditable="true",a}}function Oe(e,t){if(t instanceof o.NodeSelection){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Me(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Me(e)}function Me(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=null)}function Se(e,t,n,r){return e.someProp("createSelectionBetween",(function(r){return r(e,t,n)}))||o.TextSelection.between(t,n,r)}function _e(e){var t=e.root.getSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Ce(e){return!1===e.type.spec.inclusive}function xe(e){var t=e.selection,n=t.$head,r=t.$anchor,o=t.visible,i=n.pos!=r.pos||o&&!n.parent.inlineContent?null:n;return i&&(!o||e.storedMarks||0==i.parent.content.length||i.parentOffset&&!i.textOffset&&i.nodeBefore.marks.some(Ce))?i:null}function Ae(e,t){return function(n){var r=n.pmViewDesc;if(r)return r.parseRule();if("BR"==n.nodeName&&n.parentNode){if(a.safari&&/^(ul|ol)$/i.test(n.parentNode.nodeName))return e.matchTag(document.createElement("li"),t);if(n.parentNode.lastChild==n||a.safari&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}}}function Te(e,t,n,i){if(t<0){var s=e.lastSelectionTime>Date.now()-50?e.lastSelectionOrigin:null,l=function(e,t){var n,r,i=e.root.getSelection(),a=e.state.doc,s=e.docView.nearestDesc(i.focusNode),l=s&&0==s.size,c=e.docView.posFromDOM(i.focusNode,i.focusOffset),u=a.resolve(c);if(b(i)){for(n=u;s&&!s.node;)s=s.parent;if(s&&s.node.isAtom&&o.NodeSelection.isSelectable(s.node)&&s.parent){var f=s.posBefore;r=new o.NodeSelection(c==f?u:a.resolve(f))}}else n=a.resolve(e.docView.posFromDOM(i.anchorNode,i.anchorOffset));return r||(r=Se(e,n,u,"pointer"==t||e.state.selection.head<u.pos&&!l?1:-1)),r}(e,s);if(!e.state.selection.eq(l)){var c=e.state.tr.setSelection(l);"pointer"==s?c.setMeta("pointer",!0):"key"==s&&c.scrollIntoView(),e.dispatch(c)}}else{var u=e.state.doc.resolve(t),f=u.sharedDepth(n);t=u.before(f+1),n=e.state.doc.resolve(n).after(f+1);var p,d,h=e.state.selection,v=function(e,t,n){var o=e.docView.parseRange(t,n),i=o.node,s=o.fromOffset,l=o.toOffset,c=o.from,u=o.to,f=e.root.getSelection(),p=null,d=f.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(p=[{node:d,offset:f.anchorOffset}],b(f)||p.push({node:f.focusNode,offset:f.focusOffset})),a.chrome&&8===e.lastKeyCode)for(var h=l;h>s;h--){var v=i.childNodes[h-1],m=v.pmViewDesc;if("BR"==v.nodeType&&!m){l=h;break}if(!m||m.size)break}var y=e.state.doc,g=e.someProp("domParser")||r.DOMParser.fromSchema(e.state.schema),w=y.resolve(c),k=null,O=g.parse(i,{topNode:w.parent,topMatch:w.parent.contentMatchAt(w.index()),topOpen:!0,from:s,to:l,preserveWhitespace:!w.parent.type.spec.code||"full",editableContent:!0,findPositions:p,ruleFromNode:Ae(g,w),context:w});if(p&&null!=p[0].pos){var M=p[0].pos,S=p[1]&&p[1].pos;null==S&&(S=M),k={anchor:M+c,head:S+c}}return{doc:O,sel:k,from:c,to:u}}(e,t,n),m=e.state.doc,y=m.slice(v.from,v.to);8===e.lastKeyCode&&Date.now()-100<e.lastKeyCodeTime?(p=e.state.selection.to,d="end"):(p=e.state.selection.from,d="start"),e.lastKeyCode=null;var g=function(e,t,n,r,o){var i=e.findDiffStart(t,n);if(null==i)return null;var a=e.findDiffEnd(t,n+e.size,n+t.size),s=a.a,l=a.b;if("end"==o){var c=Math.max(0,i-Math.min(s,l));r-=s+c-i}if(s<i&&e.size<t.size){l=(i-=r<=i&&r>=s?i-r:0)+(l-s),s=i}else if(l<i){s=(i-=r<=i&&r>=l?i-r:0)+(s-l),l=i}return{start:i,endA:s,endB:l}}(y.content,v.doc.content,v.from,p,d);if(g){e.domChangeCount++,e.state.selection.from<e.state.selection.to&&g.start==g.endB&&e.state.selection instanceof o.TextSelection&&(g.start>e.state.selection.from&&g.start<=e.state.selection.from+2?g.start=e.state.selection.from:g.endA<e.state.selection.to&&g.endA>=e.state.selection.to-2&&(g.endB+=e.state.selection.to-g.endA,g.endA=e.state.selection.to));var k,O=v.doc.resolveNoCache(g.start-v.from),M=v.doc.resolveNoCache(g.endB-v.from);if(!(!O.sameParent(M)&&O.pos<v.doc.content.size&&(k=o.Selection.findFrom(v.doc.resolve(O.pos+1),1,!0))&&k.head==M.pos&&e.someProp("handleKeyDown",(function(t){return t(e,w(13,"Enter"))}))))if(e.state.selection.anchor>g.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||je(r,!0,!1)<o.pos)return!1;var i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var a=e.resolve(je(i,!0,!0));if(!a.parent.isTextblock||a.pos>n||je(a,!0,!1)<n)return!1;return r.parent.content.cut(r.parentOffset).eq(a.parent.content)}(m,g.start,g.endA,O,M)&&e.someProp("handleKeyDown",(function(t){return t(e,w(8,"Backspace"))})))a.android&&a.chrome&&e.domObserver.suppressSelectionUpdates();else{var S,_,C,x,A=g.start,T=g.endA;if(O.sameParent(M)&&O.parent.inlineContent)if(O.pos==M.pos)a.ie&&a.ie_version<=11&&0==O.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((function(){return be(e)}),20)),S=e.state.tr.delete(A,T),_=m.resolve(g.start).marksAcross(m.resolve(g.endA));else if(g.endA==g.endB&&(x=m.resolve(g.start))&&(C=function(e,t){for(var n,o,i,a=e.firstChild.marks,s=t.firstChild.marks,l=a,c=s,u=0;u<s.length;u++)l=s[u].removeFromSet(l);for(var f=0;f<a.length;f++)c=a[f].removeFromSet(c);if(1==l.length&&0==c.length)o=l[0],n="add",i=function(e){return e.mark(o.addToSet(e.marks))};else{if(0!=l.length||1!=c.length)return null;o=c[0],n="remove",i=function(e){return e.mark(o.removeFromSet(e.marks))}}for(var p=[],d=0;d<t.childCount;d++)p.push(i(t.child(d)));if(r.Fragment.from(p).eq(e))return{mark:o,type:n}}(O.parent.content.cut(O.parentOffset,M.parentOffset),x.parent.content.cut(x.parentOffset,g.endA-x.start()))))S=e.state.tr,"add"==C.type?S.addMark(A,T,C.mark):S.removeMark(A,T,C.mark);else if(O.parent.child(O.index()).isText&&O.index()==M.index()-(M.textOffset?0:1)){var V=O.parent.textBetween(O.parentOffset,M.parentOffset);if(e.someProp("handleTextInput",(function(t){return t(e,A,T,V)})))return;S=e.state.tr.insertText(V,A,T)}if(S||(S=e.state.tr.replace(A,T,v.doc.slice(g.start-v.from,g.endB-v.from))),v.sel){var j=Ve(e,S.doc,v.sel);j&&S.setSelection(j)}_&&S.ensureMarks(_),e.dispatch(S.scrollIntoView())}}else if(!(i&&h instanceof o.TextSelection&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||v.sel&&v.sel.anchor!=v.sel.head){if(v.sel){var E=Ve(e,e.state.doc,v.sel);E&&!E.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(E))}}else{var P=e.state,N=P.selection;e.dispatch(P.tr.replaceSelectionWith(P.schema.text(P.doc.textBetween(N.from,N.to)),!0).scrollIntoView())}}}function Ve(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Se(e,t.resolve(n.anchor),t.resolve(n.head))}function je(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Ee(e,t){for(var n=[],o=t.content,i=t.openStart,a=t.openEnd;i>1&&a>1&&1==o.childCount&&1==o.firstChild.childCount;){i--,a--;var s=o.firstChild;n.push(s.type.name,s.type.hasRequiredAttrs()?s.attrs:null),o=s.content}var l=e.someProp("clipboardSerializer")||r.DOMSerializer.fromSchema(e.state.schema),c=document.createElement("div");c.appendChild(l.serializeFragment(o));for(var u,f=c.firstChild;f&&1==f.nodeType&&(u=Le[f.nodeName.toLowerCase()]);){for(var p=u.length-1;p>=0;p--){for(var d=document.createElement(u[p]);c.firstChild;)d.appendChild(c.firstChild);c.appendChild(d)}f=c.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice",i+" "+a+" "+JSON.stringify(n)),{dom:c,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function Pe(e,t,n,o,i){var a,s,l=i.parent.type.spec.code;if(!n&&!t)return null;var c=t&&(o||l||!n);if(c){if(e.someProp("transformPastedText",(function(e){t=e(t)})),l)return new r.Slice(r.Fragment.from(e.state.schema.text(t)),0,0);var u=e.someProp("clipboardTextParser",(function(e){return e(t,i)}));u?s=u:(a=document.createElement("div"),t.trim().split(/(?:\r\n?|\n)+/).forEach((function(e){a.appendChild(document.createElement("p")).textContent=e})))}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),a=function(e){var t=/(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=(De||(De=document.implementation.createHTMLDocument("title"))).createElement("div"),o=/(?:<meta [^>]*>)*<([a-z][^>\s]+)/i.exec(e),i=0;(n=o&&Le[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return"</"+e+">"})).reverse().join(""),i=n.length);r.innerHTML=e;for(var a=0;a<i;a++)r=r.firstChild;return r}(n);var f=a&&a.querySelector("[data-pm-slice]"),p=f&&/^(\d+) (\d+) (.*)/.exec(f.getAttribute("data-pm-slice"));if(!s){var d=e.someProp("clipboardParser")||e.someProp("domParser")||r.DOMParser.fromSchema(e.state.schema);s=d.parseSlice(a,{preserveWhitespace:!(!c&&!p),context:i})}return s=p?function(e,t){if(!e.size)return e;var n,o=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}for(var i=e.content,a=e.openStart,s=e.openEnd,l=n.length-2;l>=0;l-=2){var c=o.nodes[n[l]];if(!c||c.hasRequiredAttrs())break;i=r.Fragment.from(c.create(n[l+1],i)),a++,s++}return new r.Slice(i,a,s)}(function(e,t,n){t<e.openStart&&(e=new r.Slice(He(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd));n<e.openEnd&&(e=new r.Slice(He(e.content,1,n,e.openEnd,0,0),e.openStart,n));return e}(s,+p[1],+p[2]),p[3]):r.Slice.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var o=t.node(n).contentMatchAt(t.index(n)),i=void 0,a=[];if(e.forEach((function(e){if(a){var t,n=o.findWrapping(e.type);if(!n)return a=null;if(t=a.length&&i.length&&function e(t,n,o,i,a){if(a<t.length&&a<n.length&&t[a]==n[a]){var s=e(t,n,o,i.lastChild,a+1);if(s)return i.copy(i.content.replaceChild(i.childCount-1,s));if(i.contentMatchAt(i.childCount).matchType(a==t.length-1?o.type:t[a+1]))return i.copy(i.content.append(r.Fragment.from(Ne(o,t,a+1))))}}(n,i,e,a[a.length-1],0))a[a.length-1]=t;else{a.length&&(a[a.length-1]=function e(t,n){if(0==n)return t;var o=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(r.Fragment.empty,!0);return t.copy(o.append(i))}(a[a.length-1],i.length));var s=Ne(e,n);a.push(s),o=o.matchType(s.type,s.attrs),i=n}}})),a)return{v:r.Fragment.from(a)}},o=t.depth;o>=0;o--){var i=n(o);if(i)return i.v}return e}(s.content,i),!1),e.someProp("transformPasted",(function(e){s=e(s)})),s}function Ne(e,t,n){void 0===n&&(n=0);for(var o=t.length-1;o>=n;o--)e=t[o].create(null,r.Fragment.from(e));return e}function He(e,t,n,o,i,a){var s=t<0?e.firstChild:e.lastChild,l=s.content;return i<o-1&&(l=He(l,t,n,o,i+1,a)),i>=n&&(l=t<0?s.contentMatchAt(0).fillBefore(l,e.childCount>1||a<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(r.Fragment.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(l))}var Le={thead:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},De=null;var Ie={childList:!0,characterData:!0,attributes:!0,subtree:!0,characterDataOldValue:!0},Re=a.ie&&a.ie_version<=11,$e=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};$e.prototype.set=function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset},$e.prototype.eq=function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset};var Fe=function(e,t){var n=this;this.view=e,this.handleDOMChange=t,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){a.ie&&a.ie_version<=11&&e.some((function(e){return"childList"==e.type&&1==e.removedNodes.length&&e.removedNodes[0].parentNode==e.target}))?setTimeout((function(){return n.flush(e)}),10):n.flush(e)})),this.currentSelection=new $e,this.queue=[],Re&&(this.onCharData=function(e){n.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),window.setTimeout((function(){return n.flush()}),20)}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};Fe.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,Ie),Re&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},Fe.prototype.stop=function(){var e=this,t=this.observer.takeRecords();if(t.length){for(var n=0;n<t.length;n++)e.queue.push(t[n]);window.setTimeout((function(){return e.flush()}),20)}this.observer&&this.observer.disconnect(),Re&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},Fe.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},Fe.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},Fe.prototype.suppressSelectionUpdates=function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return e.suppressingSelectionUpdates=!1}),50)},Fe.prototype.onSelectionChange=function(){var e;if((!(e=this.view).editable||e.root.activeElement==e.dom)&&_e(e))return this.suppressingSelectionUpdates?be(this.view):void this.flush()},Fe.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},Fe.prototype.flush=function(e){if(this.view.docView){e||(e=this.observer.takeRecords()),this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&_e(this.view),r=-1,o=-1,i=!1;if(this.view.editable)for(var a=0;a<e.length;a++){var s=this.registerMutation(e[a]);s&&(r=r<0?s.from:Math.min(s.from,r),o=o<0?s.to:Math.max(s.to,o),s.typeOver&&(i=!0))}(r>-1||n)&&(r>-1&&this.view.docView.markDirty(r,o),this.handleDOMChange(r,o,i),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||be(this.view))}},Fe.prototype.registerMutation=function(e){var t=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(t==this.view.docView||"contenteditable"==e.attributeName))return null;if(!t||t.ignoreMutation(e))return null;if("childList"==e.type){var n=e.previousSibling&&e.previousSibling.parentNode==e.target?p(e.previousSibling)+1:0,r=t.localPosFromDOM(e.target,n,-1),o=e.nextSibling&&e.nextSibling.parentNode==e.target?p(e.nextSibling):e.target.childNodes.length;return{from:r,to:t.localPosFromDOM(e.target,o,1)}}return"attributes"==e.type?{from:t.posAtStart-t.border,to:t.posAtEnd+t.border}:{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}};var ze={},Be={};function Je(e,t){e.lastSelectionOrigin=t,e.lastSelectionTime=Date.now()}function We(e){e.someProp("handleDOMEvents",(function(t){for(var n in t)e.eventHandlers[n]||e.dom.addEventListener(n,e.eventHandlers[n]=function(t){return qe(e,t)})}))}function qe(e,t){return e.someProp("handleDOMEvents",(function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Ke(e){return{left:e.clientX,top:e.clientY}}function Ge(e,t,n,r,o){if(-1==r)return!1;for(var i=e.state.doc.resolve(r),a=function(r){if(e.someProp(t,(function(t){return r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},s=i.depth+1;s>0;s--){var l=a(s);if(l)return l.v}return!1}function Qe(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Ze(e,t,n,r,i){return Ge(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(function(n){return n(e,t,r)}))||(i?function(e,t){if(-1==t)return!1;var n,r,i=e.state.selection;i instanceof o.NodeSelection&&(n=i.node);for(var a=e.state.doc.resolve(t),s=a.depth+1;s>0;s--){var l=s>a.depth?a.nodeAfter:a.node(s);if(o.NodeSelection.isSelectable(l)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&a.before(i.$from.depth+1)==i.$from.pos?a.before(i.$from.depth):a.before(s);break}}return null!=r&&(Qe(e,o.NodeSelection.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&o.NodeSelection.isSelectable(r))&&(Qe(e,new o.NodeSelection(n),"pointer"),!0)}(e,n))}function Ue(e,t,n,r){return Ge(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function Xe(e,t,n,r){return Ge(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(function(n){return n(e,t,r)}))||function(e,t){var n=e.state.doc;if(-1==t)return!!n.inlineContent&&(Qe(e,o.TextSelection.create(n,0,n.content.size),"pointer"),!0);for(var r=n.resolve(t),i=r.depth+1;i>0;i--){var a=i>r.depth?r.nodeAfter:r.node(i),s=r.before(i);if(a.inlineContent)Qe(e,o.TextSelection.create(n,s+1,s+1+a.content.size),"pointer");else{if(!o.NodeSelection.isSelectable(a))continue;Qe(e,o.NodeSelection.create(n,s),"pointer")}return!0}}(e,n)}function Ye(e){return it(e)}Be.keydown=function(e,t){e.shiftKey=16==t.keyCode||t.shiftKey,nt(e,t)||(e.lastKeyCode=t.keyCode,e.lastKeyCodeTime=Date.now(),e.someProp("handleKeyDown",(function(n){return n(e,t)}))||ge(e,t)?t.preventDefault():Je(e,"key"))},Be.keyup=function(e,t){16==t.keyCode&&(e.shiftKey=!1)},Be.keypress=function(e,t){if(!(nt(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||a.mac&&t.metaKey))if(e.someProp("handleKeyPress",(function(n){return n(e,t)})))t.preventDefault();else{var n=e.state.selection;if(!(n instanceof o.TextSelection&&n.$from.sameParent(n.$to))){var r=String.fromCharCode(t.charCode);e.someProp("handleTextInput",(function(t){return t(e,n.$from.pos,n.$to.pos,r)}))||e.dispatch(e.state.tr.insertText(r).scrollIntoView()),t.preventDefault()}}};var et=a.mac?"metaKey":"ctrlKey";ze.mousedown=function(e,t){e.shiftKey=t.shiftKey;var n=Ye(e),r=Date.now(),o="singleClick";r-e.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(t,e.lastClick)&&!t[et]&&("singleClick"==e.lastClick.type?o="doubleClick":"doubleClick"==e.lastClick.type&&(o="tripleClick")),e.lastClick={time:r,x:t.clientX,y:t.clientY,type:o};var i=e.posAtCoords(Ke(t));i&&("singleClick"==o?e.mouseDown=new tt(e,i,t,n):("doubleClick"==o?Ue:Xe)(e,i.pos,i.inside,t)?t.preventDefault():Je(e,"pointer"))};var tt=function(e,t,n,r){var i,s,l=this;if(this.view=e,this.startDoc=e.state.doc,this.pos=t,this.event=n,this.flushed=r,this.selectNode=n[et],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{var c=e.state.doc.resolve(t.pos);i=c.parent,s=c.depth?c.before():0}this.mightDrag=null;var u=r?null:n.target,f=u?e.docView.nearestDesc(u,!0):null;this.target=f?f.dom:null,(i.type.spec.draggable&&!1!==i.type.spec.selectable||e.state.selection instanceof o.NodeSelection&&s==e.state.selection.from)&&(this.mightDrag={node:i,pos:s,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&a.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){return l.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Je(e,"pointer")};function nt(e,t){return!!e.composing||!!(a.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500)&&(e.compositionEndedAt=-2e8,!0)}tt.prototype.done=function(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!1),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.view.mouseDown=null},tt.prototype.up=function(e){if(this.done(),this.view.dom.contains(3==e.target.nodeType?e.target.parentNode:e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ke(e))),this.allowDefault||!t?(a.ie&&xe(this.view.state)&&this.view.updateState(this.view.state),Je(this.view,"pointer")):Ze(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():!this.flushed&&(!a.chrome||this.view.state.selection instanceof o.TextSelection||t.pos!=this.view.state.selection.from&&t.pos!=this.view.state.selection.to)?Je(this.view,"pointer"):(Qe(this.view,o.Selection.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault())}},tt.prototype.move=function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Je(this.view,"pointer")},ze.touchdown=function(e){Ye(e),Je(e,"pointer")},ze.contextmenu=function(e){return Ye(e)};var rt=a.android?5e3:-1;function ot(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout((function(){return it(e)}),t))}function it(e){for(e.composing=!1;e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty();return!!e.docView.dirty&&(e.updateState(e.state),!0)}Be.compositionstart=Be.compositionupdate=function(e){e.composing||(e.domObserver.flush(),it(e),e.composing=!0),ot(e,rt)},Be.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,ot(e,20))};var at=a.ie&&a.ie_version<15||a.ios&&a.webkit_version<604;function st(e,t,n,o){var i=Pe(e,t,n,e.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,o,i||r.Slice.empty)}))||!i)return!0;var a=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=a?e.state.tr.replaceSelectionWith(a,e.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ze.copy=Be.cut=function(e,t){var n=e.state.selection,r="cut"==t.type;if(!n.empty){var o=at?null:t.clipboardData,i=Ee(e,n.content()),a=i.dom,s=i.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",s)):function(e,t){var n=t.ownerDocument,r=n.body.appendChild(n.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";var o=getSelection(),i=n.createRange();i.selectNodeContents(t),e.dom.blur(),o.removeAllRanges(),o.addRange(i),setTimeout((function(){n.body.removeChild(r),e.focus()}),50)}(e,a),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Be.paste=function(e,t){var n=at?null:t.clipboardData;n&&(st(e,n.getData("text/plain"),n.getData("text/html"),t)||n.files.length>0)?t.preventDefault():function(e,t){var n=e.dom.ownerDocument,r=e.shiftKey||e.state.selection.$from.parent.type.spec.code,o=n.body.appendChild(n.createElement(r?"textarea":"div"));r||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus(),setTimeout((function(){e.focus(),n.body.removeChild(o),r?st(e,o.value,null,t):st(e,o.textContent,o.innerHTML,t)}),50)}(e,t)};var lt=function(e,t){this.slice=e,this.move=t},ct=a.mac?"altKey":"ctrlKey";for(var ut in ze.dragstart=function(e,t){var n=e.mouseDown;if(n&&n.done(),t.dataTransfer){var r=e.state.selection,i=r.empty?null:e.posAtCoords(Ke(t));if(i&&i.pos>=r.from&&i.pos<=(r instanceof o.NodeSelection?r.to-1:r.to));else if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(o.NodeSelection.create(e.state.doc,n.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){var a=e.docView.nearestDesc(t.target,!0);if(!a||!a.node.type.spec.draggable||a==e.docView)return;e.dispatch(e.state.tr.setSelection(o.NodeSelection.create(e.state.doc,a.posBefore)))}var s=e.state.selection.content(),l=Ee(e,s),c=l.dom,u=l.text;t.dataTransfer.clearData(),t.dataTransfer.setData(at?"Text":"text/html",c.innerHTML),at||t.dataTransfer.setData("text/plain",u),e.dragging=new lt(s,!t[ct])}},ze.dragend=function(e){window.setTimeout((function(){return e.dragging=null}),50)},Be.dragover=Be.dragenter=function(e,t){return t.preventDefault()},Be.drop=function(e,t){var n=e.dragging;if(e.dragging=null,t.dataTransfer){var r=e.posAtCoords(Ke(t));if(r){var a=e.state.doc.resolve(r.pos);if(a){var s=n&&n.slice||Pe(e,t.dataTransfer.getData(at?"Text":"text/plain"),at?null:t.dataTransfer.getData("text/html"),!1,a);if(s&&(t.preventDefault(),!e.someProp("handleDrop",(function(r){return r(e,t,s,n&&n.move)})))){var l=s?i.dropPoint(e.state.doc,a.pos,s):a.pos;null==l&&(l=a.pos);var c=e.state.tr;n&&n.move&&c.deleteSelection();var u=c.mapping.map(l),f=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=c.doc;if(f?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),!c.doc.eq(p)){var d=c.doc.resolve(u);f&&o.NodeSelection.isSelectable(s.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(s.content.firstChild)?c.setSelection(new o.NodeSelection(d)):c.setSelection(Se(e,d,c.doc.resolve(c.mapping.map(l)))),e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}}}}}},ze.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0)},ze.blur=function(e){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),e.focused=!1)},ze.beforeinput=function(e,t){if(a.chrome&&a.android&&"deleteContentBackward"==t.inputType){var n=e.domChangeCount;setTimeout((function(){if(e.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,w(8,"Backspace"))})))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}}),50)}},Be)ze[ut]=Be[ut];function ft(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var pt=function(e,t){this.spec=t||gt,this.side=this.spec.side||0,this.toDOM=e};pt.prototype.map=function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new vt(i-n,i-n,this)},pt.prototype.valid=function(){return!0},pt.prototype.eq=function(e){return this==e||e instanceof pt&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ft(this.spec,e.spec))};var dt=function(e,t){this.spec=t||gt,this.attrs=e};dt.prototype.map=function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new vt(o,i,this)},dt.prototype.valid=function(e,t){return t.from<t.to},dt.prototype.eq=function(e){return this==e||e instanceof dt&&ft(this.attrs,e.attrs)&&ft(this.spec,e.spec)},dt.is=function(e){return e.type instanceof dt};var ht=function(e,t){this.spec=t||gt,this.attrs=e};ht.prototype.map=function(e,t,n,r){var o=e.mapResult(t.from+r,1);if(o.deleted)return null;var i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new vt(o.pos-n,i.pos-n,this)},ht.prototype.valid=function(e,t){var n=e.content.findIndex(t.from),r=n.index,o=n.offset;return o==t.from&&o+e.child(r).nodeSize==t.to},ht.prototype.eq=function(e){return this==e||e instanceof ht&&ft(this.attrs,e.attrs)&&ft(this.spec,e.spec)};var vt=function(e,t,n){this.from=e,this.to=t,this.type=n},mt={spec:{}};vt.prototype.copy=function(e,t){return new vt(e,t,this.type)},vt.prototype.eq=function(e){return this.type.eq(e.type)&&this.from==e.from&&this.to==e.to},vt.prototype.map=function(e,t,n){return this.type.map(e,this,t,n)},vt.widget=function(e,t,n){return new vt(e,e,new pt(t,n))},vt.inline=function(e,t,n,r){return new vt(e,t,new dt(n,r))},vt.node=function(e,t,n,r){return new vt(e,t,new ht(n,r))},mt.spec.get=function(){return this.type.spec},Object.defineProperties(vt.prototype,mt);var yt=[],gt={},bt=function(e,t){this.local=e&&e.length?e:yt,this.children=t&&t.length?t:yt};bt.create=function(e,t){return t.length?_t(t,e,0,gt):wt},bt.prototype.find=function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r},bt.prototype.findInner=function(e,t,n,r,o){for(var i=0;i<this.local.length;i++){var a=this.local[i];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){var l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,n,r+l,o)}},bt.prototype.map=function(e,t,n){return this==wt||0==e.maps.length?this:this.mapInner(e,t,0,0,n||gt)},bt.prototype.mapInner=function(e,t,n,r,o){for(var i,a=0;a<this.local.length;a++){var s=this.local[a].map(e,n,r);s&&s.type.valid(t,s)?(i||(i=[])).push(s):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?function(e,t,n,r,o,i,a){for(var s=e.slice(),l=function(e,t,n,r){for(var a=0;a<s.length;a+=3){var l=s[a+1],c=void 0;-1==l||e>l+i||(t>=s[a]+i?s[a+1]=-1:(c=r-n-(t-e)+(i-o))&&(s[a]+=c,s[a+1]+=c))}},c=0;c<n.maps.length;c++)n.maps[c].forEach(l);for(var u=!1,f=0;f<s.length;f+=3)if(-1==s[f+1]){var p=n.map(s[f]+i),d=p-o;if(d<0||d>=r.content.size){u=!0;continue}var h=n.map(e[f+1]+i,-1)-o,v=r.content.findIndex(d),m=v.index,y=v.offset,g=r.maybeChild(m);if(g&&y==d&&y+g.nodeSize==h){var b=s[f+2].mapInner(n,g,p+1,s[f]+i+1,a);b!=wt?(s[f]=d,s[f+1]=h,s[f+2]=b):(s[f+1]=-2,u=!0)}else u=!0}if(u){var w=_t(function(e,t,n,r,o,i,a){function s(e,t){for(var i=0;i<e.local.length;i++){var l=e.local[i].map(r,o,t);l?n.push(l):a.onRemove&&a.onRemove(e.local[i].spec)}for(var c=0;c<e.children.length;c+=3)s(e.children[c+2],e.children[c]+t+1)}for(var l=0;l<e.length;l+=3)-1==e[l+1]&&s(e[l+2],t[l]+i+1);return n}(s,e,t||[],n,o,i,a),r,0,a);t=w.local;for(var k=0;k<s.length;k+=3)s[k+1]<0&&(s.splice(k,3),k-=3);for(var O=0,M=0;O<w.children.length;O+=3){for(var S=w.children[O];M<s.length&&s[M]<S;)M+=3;s.splice(M,0,w.children[O],w.children[O+1],w.children[O+2])}}return new bt(t&&t.sort(Ct),s)}(this.children,i,e,t,n,r,o):i?new bt(i.sort(Ct)):wt},bt.prototype.add=function(e,t){return t.length?this==wt?bt.create(e,t):this.addInner(e,t,0):this},bt.prototype.addInner=function(e,t,n){var r,o=this,i=0;e.forEach((function(e,a){var s,l=a+n;if(s=Mt(t,e,l)){for(r||(r=o.children.slice());i<r.length&&r[i]<a;)i+=3;r[i]==a?r[i+2]=r[i+2].addInner(e,s,l+1):r.splice(i,0,a,a+e.nodeSize,_t(s,e,l+1,gt)),i+=3}}));var a=Ot(i?St(t):t,-n);return new bt(a.length?this.local.concat(a).sort(Ct):this.local,r||this.children)},bt.prototype.remove=function(e){return 0==e.length||this==wt?this:this.removeInner(e,0)},bt.prototype.removeInner=function(e,t){for(var n=this.children,r=this.local,o=0;o<n.length;o+=3){for(var i=void 0,a=n[o]+t,s=n[o+1]+t,l=0,c=void 0;l<e.length;l++)(c=e[l])&&c.from>a&&c.to<s&&(e[l]=null,(i||(i=[])).push(c));if(i){n==this.children&&(n=this.children.slice());var u=n[o+2].removeInner(i,a+1);u!=wt?n[o+2]=u:(n.splice(o,3),o-=3)}}if(r.length)for(var f=0,p=void 0;f<e.length;f++)if(p=e[f])for(var d=0;d<r.length;d++)r[d].type.eq(p.type)&&(r==this.local&&(r=this.local.slice()),r.splice(d--,1));return n==this.children&&r==this.local?this:r.length||n.length?new bt(r,n):wt},bt.prototype.forChild=function(e,t){var n,r;if(this==wt)return this;if(t.isLeaf)return bt.empty;for(var o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(n=this.children[o+2]);break}for(var i=e+1,a=i+t.content.size,s=0;s<this.local.length;s++){var l=this.local[s];if(l.from<a&&l.to>i&&l.type instanceof dt){var c=Math.max(i,l.from)-i,u=Math.min(a,l.to)-i;c<u&&(r||(r=[])).push(l.copy(c,u))}}if(r){var f=new bt(r.sort(Ct));return n?new kt([f,n]):f}return n||wt},bt.prototype.eq=function(e){if(this==e)return!0;if(!(e instanceof bt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(var t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0},bt.prototype.locals=function(e){return xt(this.localsInner(e))},bt.prototype.localsInner=function(e){if(this==wt)return yt;if(e.inlineContent||!this.local.some(dt.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof dt||t.push(this.local[n]);return t};var wt=new bt;bt.empty=wt,bt.removeOverlap=xt;var kt=function(e){this.members=e};function Ot(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(new vt(o.from+t,o.to+t,o.type))}return n}function Mt(e,t,n){if(t.isLeaf)return null;for(var r=n+t.nodeSize,o=null,i=0,a=void 0;i<e.length;i++)(a=e[i])&&a.from>n&&a.to<r&&((o||(o=[])).push(a),e[i]=null);return o}function St(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function _t(e,t,n,r){var o=[],i=!1;t.forEach((function(t,a){var s=Mt(e,t,a+n);if(s){i=!0;var l=_t(s,t,n+a+1,r);l!=wt&&o.push(a,a+t.nodeSize,l)}}));for(var a=Ot(i?St(e):e,-n).sort(Ct),s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||o.length?new bt(a,o):wt}function Ct(e,t){return e.from-t.from||e.to-t.to}function xt(e){for(var t=e,n=0;n<t.length-1;n++){var r=t[n];if(r.from!=r.to)for(var o=n+1;o<t.length;o++){var i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),At(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),At(t,o+1,i.copy(r.to,i.to)))}}return t}function At(e,t,n){for(;t<e.length&&Ct(n,e[t])>0;)t++;e.splice(t,0,n)}function Tt(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=wt&&t.push(r)})),e.cursorWrapper&&t.push(bt.create(e.state.doc,[e.cursorWrapper.deco])),kt.from(t)}kt.prototype.forChild=function(e,t){if(t.isLeaf)return bt.empty;for(var n=[],r=0;r<this.members.length;r++){var o=this.members[r].forChild(e,t);o!=wt&&(o instanceof kt?n=n.concat(o.members):n.push(o))}return kt.from(n)},kt.prototype.eq=function(e){if(!(e instanceof kt)||e.members.length!=this.members.length)return!1;for(var t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0},kt.prototype.locals=function(e){for(var t,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(var i=0;i<o.length;i++)t.push(o[i])}else t=o}return t?xt(n?t:t.sort(Ct)):yt},kt.from=function(e){switch(e.length){case 0:return wt;case 1:return e[0];default:return new kt(e)}};var Vt=function(e,t){this._props=t,this.state=t.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):e.apply?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Nt(this),this.cursorWrapper=null,Pt(this),this.nodeViews=Lt(this),this.docView=J(this.state.doc,Et(this),Tt(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(e){e.shiftKey=!1,e.mouseDown=null,e.lastKeyCode=null,e.lastKeyCodeTime=0,e.lastClick={time:0,x:0,y:0,type:""},e.lastSelectionOrigin=null,e.lastSelectionTime=0,e.composing=!1,e.composingTimeout=null,e.compositionNodes=[],e.compositionEndedAt=-2e8,e.domObserver=new Fe(e,(function(t,n,r){return Te(e,t,n,r)})),e.domObserver.start(),e.domChangeCount=0,e.eventHandlers=Object.create(null);var t=function(t){var n=ze[t];e.dom.addEventListener(t,e.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||qe(e,t)||!e.editable&&t.type in Be||n(e,t)})};for(var n in ze)t(n);a.safari&&e.dom.addEventListener("input",(function(){return null})),We(e)}(this),this.pluginViews=[],this.updatePluginViews()},jt={props:{},root:{}};function Et(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r?t.class+=" "+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))})),[vt.node(0,e.state.doc.content.size,t)]}function Pt(e){var t=xe(e.state);if(!t||a.ie&&e.mouseDown)e.cursorWrapper=null;else{var n,o=e.state.selection.visible,i=e.state.storedMarks||t.marks();e.cursorWrapper&&r.Mark.sameSet(e.cursorWrapper.deco.spec.marks,i)&&"\ufeff"==e.cursorWrapper.dom.textContent&&e.cursorWrapper.deco.spec.visible==o?e.cursorWrapper.deco.pos!=t.pos&&(n=e.cursorWrapper.dom):n=function(e){var t=document.createElement("span");return t.textContent="\ufeff",e||(t.style.position="absolute",t.style.left="-100000px"),t}(o),n&&(e.cursorWrapper={dom:n,deco:vt.widget(t.pos,n,{isCursorWrapper:!0,marks:i,raw:!0,visible:o})})}}function Nt(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function Ht(e){var t=e.getSelection(),n=t.focusOffset,r=t.focusNode;return r&&3!=r.nodeType?[r,n,1==r.nodeType?r.childNodes[n-1]:null,1==r.nodeType?r.childNodes[n]:null]:null}function Lt(e){var t={};return e.someProp("nodeViews",(function(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])})),t}jt.props.get=function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props},Vt.prototype.update=function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&We(this),this._props=e,this.updateStateInner(e.state,!0)},Vt.prototype.setProps=function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)},Vt.prototype.updateState=function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)},Vt.prototype.updateStateInner=function(e,t){var n=this,r=this.state,i=!1;if(this.state=e,t){var s=Lt(this);(function(e,t){var n=0,r=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var i in t)r++;return n!=r})(s,this.nodeViews)&&(this.nodeViews=s,i=!0),We(this)}this.editable=Nt(this),Pt(this);var l,c,u,f=Tt(this),p=Et(this),h=t?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",m=i||!this.docView.matchesNode(e.doc,p,f),y=m||!e.selection.eq(r.selection),g="preserve"==h&&y&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=e.dom.ownerDocument,a=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){var l=e.root.elementFromPoint(a,s);if(l!=e.dom&&e.dom.contains(l)){var c=l.getBoundingClientRect();if(c.top>=o-20){t=l,n=c.top;break}}}for(var u=[],f=e.dom;f&&(u.push({dom:f,top:f.scrollTop,left:f.scrollLeft}),f!=i.body);f=d(f));return{refDOM:t,refTop:n,stack:u}}(this);if(y){this.domObserver.stop();var b=!1;if(m){var w=a.chrome&&Ht(this.root);!i&&this.docView.update(e.doc,p,f,this)||(this.docView.destroy(),this.docView=J(e.doc,p,f,this.dom,this)),w&&(b=function(e,t){var n=Ht(t);if(!n||3==n[0].nodeType)return!1;for(var r=0;r<e.length;r++)if(n[r]!=e[r])return!0;return!1}(w,this.root))}b||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(l=this,c=l.docView.domFromPos(l.state.selection.anchor),u=l.root.getSelection(),v(c.node,c.offset,u.anchorNode,u.anchorOffset)))?be(this,!1,b):(Oe(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==h)this.dom.scrollTop=0;else if("to selection"==h){var k=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(e){return e(n)}))||(e.selection instanceof o.NodeSelection?M(this,this.docView.domAfterPos(e.selection.from).getBoundingClientRect(),k):M(this,this.coordsAtPos(e.selection.head),k))}else g&&function(e){for(var t=e.refDOM,n=e.refTop,r=e.stack,o=t?t.getBoundingClientRect().top:0,i=0==o?0:o-n,a=0;a<r.length;a++){var s=r[a],l=s.dom,c=s.top,u=s.left;l.scrollTop!=c+i&&(l.scrollTop=c+i),l.scrollLeft!=u&&(l.scrollLeft=u)}}(g)},Vt.prototype.destroyPluginViews=function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()},Vt.prototype.updatePluginViews=function(e){if(e&&e.plugins==this.state.plugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.destroyPluginViews();for(var r=0;r<this.state.plugins.length;r++){var o=this.state.plugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}},Vt.prototype.someProp=function(e,t){var n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;var o=this.state.plugins;if(o)for(var i=0;i<o.length;i++){var a=o[i].props[e];if(null!=a&&(n=t?t(a):a))return n}},Vt.prototype.hasFocus=function(){return this.root.activeElement==this.dom},Vt.prototype.focus=function(){this.domObserver.stop(),be(this,!0),this.domObserver.start(),this.editable&&this.dom.focus()},jt.root.get=function(){var e=this._root;if(null==e)for(var t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return this._root=t;return e||document},Vt.prototype.posAtCoords=function(e){return C(this,e)},Vt.prototype.coordsAtPos=function(e){return A(this,e)},Vt.prototype.domAtPos=function(e){return this.docView.domFromPos(e)},Vt.prototype.nodeDOM=function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null},Vt.prototype.posAtDOM=function(e,t,n){void 0===n&&(n=-1);var r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r},Vt.prototype.endOfTextblock=function(e,t){return H(this,t||this.state,e)},Vt.prototype.destroy=function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),e.eventHandlers)e.dom.removeEventListener(t,e.eventHandlers[t]);clearTimeout(e.composingTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Tt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},Vt.prototype.dispatchEvent=function(e){return function(e,t){qe(e,t)||!ze[t.type]||!e.editable&&t.type in Be||ze[t.type](e,t)}(this,e)},Vt.prototype.dispatch=function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},Object.defineProperties(Vt.prototype,jt),t.EditorView=Vt,t.Decoration=vt,t.DecorationSet=bt,t.__serializeForClipboard=Ee,t.__parseFromClipboard=Pe,t.__endComposition=it},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(20);function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var s=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.name=e,r.$form=jQuery("<form>").addClass("plugin_prosemirror_keyvalueform"),t.buildForm(r.$form,n),r.$form.append(jQuery("<button>",{type:"submit"}).text("OK")),r.$form.find('[name="cancel-button"]').on("click",r.hide.bind(r)),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,null,[{key:"buildForm",value:function(e,n){var r=jQuery("<fieldset>").appendTo(e);n.forEach((function(e){switch(e.type){case"textarea":t.addTextarea(r,e);break;case"select":t.addSelect(r,e);break;default:t.addInput(r,e)}}))}},{key:"addSelect",value:function(e,t){var n=t.label,r=(t.type,t.options),o=a(t,["label","type","options"]),i=jQuery("<label>").addClass("block").append(jQuery("<span>").text(n)),s=jQuery("<select>",o);r.forEach((function(e){var t=e.label,n=a(e,["label"]);jQuery("<option>",n).text(t).appendTo(s)})),i.append(s),e.append(i)}},{key:"addTextarea",value:function(e,t){var n=t.label,r=(t.type,t.value),o=a(t,["label","type","value"]),i=jQuery("<label>").addClass("block").append(jQuery("<span>").text(n));i.append(jQuery("<textarea>",o).val(r)),e.append(i)}},{key:"addInput",value:function(e,t){var n=t.label,r=a(t,["label"]),o=jQuery("<label>").addClass("block").append(jQuery("<span>").text(n));o.append(jQuery("<input>",r).addClass("edit")),e.append(o)}}]),t}(((r=i)&&r.__esModule?r:{default:r}).default);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(24);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prosemirror-mediaform";l(this,t);var n=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.instance||(n.name=LANG.plugins.prosemirror.mediaConfig,n.$form.find(".js-open-mediamanager").on("click",t.openMediaManager),window.pmMediaSelect=n.mediaSelect.bind(n),n.instance=n),c(n,n.instance)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"mediaSelect",value:function(e,t,n,r){if(this.setSource(t),n){var o=/\?([a-z]+)?&?(\d+)?/.exec(n),a=i(o,3),s=a[1],l=a[2];this.setWidth(l),this.setHeight(),this.setLinking(s);this.setAlignment({1:"",2:"left",3:"center",4:"right"}[r])}}},{key:"setSource",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.$form.find('[name="mediatarget"]').val(e)}},{key:"getSource",value:function(){return this.$form.find('[name="mediatarget"]').val()}},{key:"setCaption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.$form.find('[name="mediacaption"]').val(e)}},{key:"getCaption",value:function(){return this.$form.find('[name="mediacaption"]').val()}},{key:"setWidth",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.$form.find('[name="width"]').val(e)}},{key:"getWidth",value:function(){return this.$form.find('[name="width"]').val()}},{key:"setHeight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.$form.find('[name="height"]').val(e)}},{key:"getHeight",value:function(){return this.$form.find('[name="height"]').val()}},{key:"setAlignment",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.$form.find('[name="alignment"]').prop("checked",""),this.$form.find('[name="alignment"][value="'+e+'"]').prop("checked","checked")}},{key:"getAlignment",value:function(){return this.$form.find('[name="alignment"]:checked').val()}},{key:"setLinking",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"details";this.$form.find('[name="linking"]').prop("checked",""),this.$form.find('[name="linking"][value="'+e+'"]').prop("checked","checked")}},{key:"getLinking",value:function(){return this.$form.find('[name="linking"]:checked').val()}},{key:"setCache",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.$form.find('[name="caching"]').prop("checked",""),this.$form.find('[name="caching"][value="'+e+'"]').prop("checked","checked")}},{key:"getCache",value:function(){return this.$form.find('[name="caching"]:checked').val()}},{key:"resetForm",value:function(){this.setSource(),this.setCaption(),this.setWidth(),this.setHeight(),this.setAlignment(),this.setLinking(),this.setCache()}}],[{key:"openMediaManager",value:function(){window.open(DOKU_BASE+"lib/exe/mediamanager.php?ns="+encodeURIComponent(JSINFO.namespace)+"&onselect=pmMediaSelect","mediaselect","width=750,height=500,left=20,top=20,scrollbars=yes,resizable=yes")}},{key:"resolveSubmittedLinkData",value:function(e,t,n){var r=this;return function(i){i.preventDefault();var a=o({},e);a.id=t.getSource(),a.title=t.getCaption(),a.width=t.getWidth(),a.height=t.getHeight(),a.align=t.getAlignment(),a.linking=t.getLinking(),a.cache=t.getCache(),r.resolveImageAttributes(a,n)}}},{key:"resolveImageAttributes",value:function(e,t){var n=DOKU_BASE+"lib/exe/ajax.php",r={call:"plugin_prosemirror",actions:["resolveMedia"],attrs:e,id:JSINFO.id};jQuery.get(n,r).done((function(n){var r=o({},e,{"data-resolvedHtml":n.resolveMedia["data-resolvedHtml"]});t(r)})).fail((function(e,t,o){var i="There was an error resolving this image -- "+o+": "+t+".";window.SentryPlugin&&(window.SentryPlugin.logSentryException(new Error("Ajax Request failed"),{tags:{plugin:"prosemirror",id:JSINFO.id},extra:{ajaxEndpoint:n,ajaxParams:r,textStatus:t,errorThrown:o}}),i+=" The error has been logged to Sentry."),i+=" You may want to continue your work in the syntax editor.",jQuery("#draft__status").after(jQuery('<div class="error"></div>').text(i))}))}}]),t}(((r=s)&&r.__esModule?r:{default:r}).default);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(29))&&"object"==typeof r&&"default"in r?r.default:r,i=n(4),a="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function s(e){var t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var l=0;l<i.length-1;l++){var c=i[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))t=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))r=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);a?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function l(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function c(e){var t=function(e){var t=Object.create(null);for(var n in e)t[s(n)]=e[n];return t}(e);return function(e,n){var r,i=o(n),a=1==i.length&&" "!=i,s=t[l(i,n,!a)];if(s&&s(e.state,e.dispatch,e))return!0;if(a&&(n.shiftKey||n.altKey||n.metaKey)&&(r=o.base[n.keyCode])&&r!=i){var c=t[l(r,n,!0)];if(c&&c(e.state,e.dispatch,e))return!0}return!1}}t.keymap=function(e){return new i.Plugin({props:{handleKeyDown:c(e)}})},t.keydownHandler=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};t.default=function(){var e=i.schema.spec,t=e.nodes,n=e.marks,l=t.get("doc");l.content="(block | baseonly | container | protected_block | substitution_block)+",l.attrs={nocache:{default:!1},notoc:{default:!1}};var c=(t=t.update("doc",l)).get("heading");c.content="text*",c.marks="",c.group="baseonly",t=t.update("heading",c),s.orderedList.group="container",s.orderedList.content="list_item+",t=t.update("ordered_list",s.orderedList),s.bulletList.group="container",s.bulletList.content="list_item+",t=t.update("bullet_list",s.bulletList),s.listItem.content="(paragraph | protected_block | substitution_block)+ (ordered_list | bullet_list)?";var u=(t=(t=t.update("list_item",s.listItem)).append((0,a.tableNodes)({tableGroup:"container",cellContent:"(paragraph | protected_block | substitution_block)+",cellAttributes:{align:{default:"",setDOMAttr:function(e,t){t.class=e?e+"align":null}}}}))).get("table");u.toDOM=function(){return["div",{class:"table"},["table",{class:"inline"},["tbody",0]]]},t.update("table",u);var f=(t=t.addToEnd("preformatted",{content:"text*",marks:"",group:"protected_block",code:!0,toDOM:function(){return["pre",{class:"code"},0]}})).get("code_block");f.attrs={class:{default:"code"},"data-filename":{default:""},"data-language":{default:""}},f.toDOM=function(e){return["pre",e.attrs,0]},f.group="protected_block";var p=(t=t.update("code_block",f)).get("blockquote");p.content="(block | blockquote | protected_block)+",p.group="container",p.toDom=function(){return["blockquote",{},["div",{class:"no"},0]]},t.update("blockquote",p);var d=t.get("image");d.attrs.width={default:""},d.attrs.height={default:""},d.attrs.align={default:""},d.attrs.linking={default:""},d.attrs.cache={default:""},d.attrs["data-resolvedHtml"]={default:""},d.attrs.id={},delete d.attrs.src,d.parseDOM=[{tag:"img.media,img.medialeft,img.mediacenter,img.mediaright",getAttrs:function(e){var t=e.getAttribute("src"),n=DOKU_BASE+"lib/exe/fetch.php";if(t.includes(n)){var r=t.split("?"),i=o(r,2)[1].split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=o(t,2),r=n[0],i=n[1];return e[r]=decodeURIComponent(i),e}),{}),a="";return e.classList.contains("medialeft")?a="left":e.classList.contains("mediaright")?a="right":e.classList.contains("mediacenter")&&(a="center"),{id:i.media,title:e.getAttribute("alt"),width:i.w,height:i.h,align:a,"data-resolvedHtml":e.outerHTML}}}},{tag:"img[src]:not(.icon)",getAttrs:function(e){return{id:e.getAttribute("src"),title:e.getAttribute("alt")||e.getAttribute("title"),width:e.getAttribute("width"),height:e.getAttribute("height")}}}],t=t.update("image",d);var h={};Object.keys(d.attrs).forEach((function(e){h["image-"+e]={default:null}})),t=(t=(t=(t=(t=(t=t.addToEnd("link",{group:"inline",inline:!0,attrs:r({"data-type":{},"data-inner":{},"data-name":{default:null},"data-resolvedID":{default:null},"data-resolvedUrl":{default:null},"data-resolvedName":{default:null},"data-resolvedClass":{default:null},"data-resolvedTitle":{default:null},"data-resolvedImage":{default:""}},h),toDOM:function(e){return["a",e.attrs]}})).addToEnd("footnote",{content:"",marks:"",attrs:{contentJSON:{default:""}},group:"inline",inline:!0,atom:!0})).addToEnd("smiley",{attrs:{icon:{},syntax:{}},inline:!0,group:"inline",draggable:!0,toDOM:function(e){return["img",{src:DOKU_BASE+"lib/images/smileys/"+e.attrs.icon,alt:e.attrs.syntax,class:"icon smiley"}]},parseDOM:[{tag:"img.icon",getAttrs:function(e){var t=e.getAttribute("src").split("/"),n=t.pop();return!!t.join("/").endsWith("lib/images/smileys")&&{icon:n,syntax:e.getAttribute("alt")}}}]})).addToEnd("rss",{group:"substitution_block",atom:!0,attrs:{class:{default:"rss"},url:{},max:{default:8},reverse:{default:null},author:{default:null},date:{default:null},details:{default:null},refresh:{default:""},renderedHTML:{default:null}}})).addToEnd("dwplugin_block",{content:"text*",marks:"",attrs:{class:{default:"dwplugin"},"data-pluginname":{default:" "}},draggable:!0,inline:!1,group:"protected_block",defining:!0,isolating:!0,code:!0,toDOM:function(e){return["pre",e.attrs,0]}})).addToEnd("dwplugin_inline",{content:"text*",attrs:{class:{default:"dwplugin"},"data-pluginname":{default:" "}},marks:"",draggable:!0,inline:!0,group:"inline",defining:!0,isolating:!0,code:!0}),n=(n=(n=(n=(n=(n=n.remove("link")).addToEnd("deleted",{parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:function(e){return"strikethrough"===e&&null}}],toDOM:function(){return["del"]}})).addToEnd("underline",{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:function(e){return"underline"===e&&null}}],toDOM:function(){return["u"]}})).addToEnd("subscript",{parseDOM:[{tag:"sub"},{style:"vertical-align",getAttrs:function(e){return"sub"===e&&null}}],toDOM:function(){return["sub"]}})).addToEnd("superscript",{parseDOM:[{tag:"sup"},{style:"vertical-align",getAttrs:function(e){return"super"===e&&null}}],toDOM:function(){return["sup"]}})).addToEnd("unformatted",{excludes:"_",toDOM:function(){return["span",{class:"unformatted"}]}}),window.Prosemirror&&window.Prosemirror.pluginSchemas&&window.Prosemirror.pluginSchemas.forEach((function(e){var r=e(t,n);t=r.nodes,n=r.marks}));return{nodes:t,marks:n}};var i=n(31),a=n(3),s=n(7)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(16),i=n(7),a=n(8),s=n(11);t.default=function(e){var t="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),n={};n.Enter=(0,i.splitListItem)(e.nodes.list_item);var l=Object.keys(n).reduce((function(e,t){return a.baseKeymap[t]&&(e[t]=(0,a.chainCommands)(n[t],a.baseKeymap[t])),e}),{}),c={"Mod-z":s.undo,"Mod-Shift-z":s.redo};t||(c["Mod-y"]=s.redo);var u={Tab:(0,i.sinkListItem)(e.nodes.list_item),"Shift-Tab":(0,i.liftListItem)(e.nodes.list_item)},f=r({},a.baseKeymap,n,l,c,u);return(0,o.keymap)(f)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"getSmileys",value:function(){return JSINFO.SMILEY_CONF}},{key:"escapeRegExp",value:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}},{key:"getRegex",value:function(){var t=Object.keys(this.getSmileys()).map((function(t){return e.escapeRegExp(t)}));return new RegExp("(?:\\W|^)("+t.join("|")+")(?=\\W|$)")}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"show",value:function(){var e=this;this.hasBeenOpened=!0,this.$form.dialog({title:this.name,closeText:LANG.plugins.prosemirror.cancel,width:600,appendTo:".dokuwiki",modal:!0,open:function(){window.setTimeout((function(){e.$form.dialog("moveToTop")}),50)}})}},{key:"hide",value:function(){this.hasBeenOpened&&this.$form.dialog("close")}},{key:"on",value:function(e,t){this.$form.on(e,t)}},{key:"off",value:function(e){this.$form.off(e)}},{key:"destroy",value:function(){this.$form.remove()}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=B(n(35)),i=B(n(36)),a=B(n(38)),s=B(n(40)),l=B(n(41)),c=B(n(42)),u=B(n(43)),f=B(n(44)),p=B(n(45)),d=B(n(46)),h=B(n(47)),v=B(n(48)),m=B(n(49)),y=B(n(50)),g=B(n(51)),b=B(n(52)),w=B(n(53)),k=B(n(54)),O=B(n(55)),M=B(n(56)),S=B(n(57)),_=B(n(58)),C=B(n(59)),x=B(n(60)),A=B(n(61)),T=B(n(62)),V=B(n(63)),j=B(n(64)),E=B(n(65)),P=B(n(66)),N=B(n(67)),H=B(n(68)),L=B(n(69)),D=B(n(70)),I=B(n(71)),R=B(n(72)),$=B(n(74)),F=B(n(75)),z=B(n(19));function B(e){return e&&e.__esModule?e:{default:e}}function J(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var W=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schema=t}return r(e,[{key:"getMenuPlugin",value:function(){var e=this;return(0,i.default)(this.collectMenuItems().map((function(t){return t.getMenuItem(e.schema)})))}},{key:"collectMenuItems",value:function(){var e=this,t=LANG.plugins.prosemirror,n=z.default.getSmileys(),r=Object.keys(n).map((function(e){return new w.default(n[e],e)}));return[new O.default([new M.default("strong","format-bold",t["label:strong"]),new M.default("em","format-italic",t["label:em"]),new M.default("underline","format-underline",t["label:underline"]),new M.default("superscript","format-superscript",t["label:superscript"]),new M.default("subscript","format-subscript",t["label:subscript"]),new M.default("deleted","format-strikethrough",t["label:deleted"]),new M.default("code","console-line",t["label:monospaced"]),new M.default("unformatted","translate-off",t["label:unformatted"])]),l.default,c.default,u.default,f.default,p.default,d.default,$.default,F.default,h.default,v.default,m.default,S.default,o.default,new k.default(r),new g.default([new b.default(1),new b.default(2),new b.default(3),new b.default(4),new b.default(5)]),_.default,new C.default([x.default,A.default,T.default,V.default,j.default,E.default,P.default,new D.default("left"),new D.default("center"),new D.default("right"),N.default,H.default,L.default]),new a.default([s.default,y.default].concat(J(window.Prosemirror.pluginMenuItemDispatchers))),new I.default([new R.default("NOCACHE"),new R.default("NOTOC")])].filter((function(t){return t.isAvailable(e.schema)}))}}]),e}();t.default=W},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(9)),a=s(n(14));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));return o.form=new a.default(LANG.plugins.prosemirror.rssConfig,t.getFields(e.attrs)),o.form.on("submit",o.handleFormSubmit.bind(o)),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,null,[{key:"getFields",value:function(e){return[{label:LANG.plugins.prosemirror["label:rss url"],type:"url",name:"url",required:!0,value:e.url},{label:LANG.plugins.prosemirror["label:rss nOfItems"],type:"number",min:"1",name:"max",value:e.max},{label:LANG.plugins.prosemirror["label:rss reverse"],type:"checkbox",name:"reverse",value:"1",checked:e.reverse},{label:LANG.plugins.prosemirror["label:rss author"],name:"author",type:"checkbox",value:"1",checked:e.author},{label:LANG.plugins.prosemirror["label:rss date"],name:"date",type:"checkbox",value:"1",checked:e.date},{label:LANG.plugins.prosemirror["label:rss details"],name:"details",type:"checkbox",value:"1",checked:e.details},{label:LANG.plugins.prosemirror["label:rss refresh"],name:"refresh",type:"text",placeholder:"4h",value:e.refresh}]}}]),o(t,[{key:"handleFormSubmit",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.form.$form.serializeArray().reduce((function(e,t){var n=t.name,r=t.value;return e[n]=r,e}),{});this.form.hide(),this.outerView.dispatch(this.outerView.state.tr.setNodeMarkup(this.getPos(),null,t,this.node.marks))}},{key:"retrieveRenderedHTML",value:function(e){var t=this,n=DOKU_BASE+"lib/exe/ajax.php";jQuery.post(n,{call:"plugin_prosemirror",actions:["resolveRSS"],attrs:JSON.stringify(e),contentType:"application/json"}).done((function(n){var o=n.resolveRSS,i=r({},e,{renderedHTML:o});t.outerView.dispatch(t.outerView.state.tr.setNodeMarkup(t.getPos(),null,i,t.node.marks))}))}},{key:"renderNode",value:function(e){var t=this;if(!this.dom){var n=jQuery("<div>").addClass("nodeHasForm");n.on("click",(function(){t.form.show()})),this.dom=n.get(0)}e.renderedHTML?jQuery(e.renderedHTML).css("pointer-events","none").appendTo(this.dom):this.retrieveRenderedHTML(e,this)}}]),t}(i.default);t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=l(n(24)),s=l(n(15));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"prosemirror-linkform"));if(!t.instance){if(e.name=LANG.plugins.prosemirror.linkConfig,jQuery("#prosemirror-linkform").length)return e.initializeLinkForm(),t.instance=e,c(e,t.instance);jQuery(e.initializeLinkForm.bind(e))}return e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"getLinkType",value:function(){return this.$form.find('[name="linktype"]:checked').val()}},{key:"setLinkType",value:function(e){var t=this.$form.find('[name="linktype"]').map((function(){return jQuery(this).val()})).get();t.includes(e)?this.$form.find('[name="linktype"][value="'+e+'"]').prop("checked",!0).trigger("change"):console.error("invalid link type "+e+". Only the following are valid: ",t)}},{key:"getLinkTarget",value:function(){return"interwikilink"===this.getLinkType()?this.$form.find('[name="iwshortcut"]').val()+">"+this.$form.find('[name="linktarget"]').val():this.$form.find('[name="linktarget"]').val()}},{key:"setLinkTarget",value:function(e,t){if("interwikilink"===e){var n=t.split(">",2),r=o(n,2),i=r[0],a=r[1];return a||(a=i,i="go"),this.$form.find('[name="iwshortcut"]').show().val(i),void this.$form.find('[name="linktarget"]').val(a)}this.$form.find('[name="linktarget"]').val(t)}},{key:"getLinkNameType",value:function(){return this.$form.find('[name="nametype"]:checked').val()}},{key:"setLinkNameType",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.$form.find('[name="nametype"]').map((function(){return jQuery(this).val()})).get();n.includes(e)?(this.$form.find('[name="nametype"][value="'+e+'"]').prop("checked",!0).trigger("change"),"custom"===e?this.$form.find('[name="linkname"]').val(t):"image"===e&&(this.MediaForm=new s.default("prosemirror-linkform"),this.MediaForm.setSource(t.id),this.MediaForm.setCaption(t.title),this.MediaForm.setWidth(t.width),this.MediaForm.setHeight(t.height),this.MediaForm.setAlignment(t.align),this.MediaForm.setCache(t.cache))):console.error("invalid link type "+e+". Only the following are valid: ",n)}},{key:"getLinkName",value:function(){return this.$form.find('[name="linkname"]').val()}},{key:"resetForm",value:function(){this.setLinkTarget(""),this.setLinkType("externallink"),this.setLinkNameType("automatic"),this.off()}},{key:"initializeLinkForm",value:function(){var e=this;this.$form.find('[name="nametype"]').on("change",this.handleNameTypeChange.bind(this)),this.$form.find('[name="linktype"]').on("change",this.handleLinkTypeChange.bind(this)),this.$form.find(".js-open-linkwiz").on("click",(function(){window.dw_linkwiz.insertLink=e.insertLink.bind(e),window.dw_linkwiz.toggle()})),this.resetForm()}},{key:"insertLink",value:function(){var e=window.dw_linkwiz.$entry.val();this.setLinkTarget(null,e),window.dw_linkwiz.toggle(),window.dw_linkwiz.$entry.val(window.dw_linkwiz.$entry.val().replace(/[^:]*$/,""))}},{key:"handleNameTypeChange",value:function(){var e=this.$form.find('[name="nametype"]:checked').val();switch(e){case"automatic":this.$form.find(".js-media-fieldset").remove(),this.$form.find('[name="linkname"]').val("").attr("type","hidden").closest("label").hide();break;case"custom":this.$form.find(".js-media-fieldset").remove(),this.$form.find('[name="linkname"]').val("").attr("type","text").closest("label").show();break;case"image":this.$form.find('[name="linkname"]').val("").attr("type","hidden").closest("label").hide();var t=jQuery("#prosemirror-mediaform").find(".js-media-fieldset").clone();this.$form.find(".js-media-wrapper").html(t),this.MediaForm=new s.default("prosemirror-linkform");break;default:console.log(e)}}},{key:"handleLinkTypeChange",value:function(){var e=this.$form.find(".js-open-linkwiz").hide(),t=this.$form.find('[name="linktype"]:checked').val(),n=this.$form.find('[name="linktarget"]');switch(this.$form.find('[name="iwshortcut"]').closest("label").hide(),t){case"externallink":n.attr("type","url").prop("placeholder","https://www.example.com");break;case"emaillink":n.attr("type","email").prop("placeholder","mail@example.com");break;case"internallink":e.show(),n.attr("type","text").prop("placeholder",LANG.plugins.prosemirror["placeholder:page"]);break;case"interwikilink":this.$form.find('[name="iwshortcut"]').closest("label").show(),n.attr("type","text").prop("placeholder","");break;case"other":n.attr("type","text").prop("placeholder","");break;default:console.warn("unknown / unhandled linktype "+t)}}}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}},{key:"resolveSubmittedLinkData",value:function(e,t,n){return function(i){i.preventDefault(),i.stopPropagation();var a=t;a["data-inner"]=e.getLinkTarget(),a["data-type"]=e.getLinkType();var s=e.getLinkNameType();"custom"===s&&(a["data-name"]=e.getLinkName()),"automatic"===s&&delete a["data-name"];var l=[],c={},u={};if("image"===s&&(delete a["data-name"],l.push("resolveImageTitle"),u.id=e.MediaForm.getSource(),u.title=e.MediaForm.getCaption(),u.width=e.MediaForm.getWidth(),u.height=e.MediaForm.getHeight(),u.align=e.MediaForm.getAlignment(),u.cache=e.MediaForm.getCache (…)
/plugin/davcal/fullcalendar-3.10.5/
H A Dfullcalendar.js6199 CoordCache.prototype.getWidth = function (leftIndex) {
/plugin/datatables/assets/pdfmake/build/
H A Dpdfmake.min.js
/plugin/dirtylittlehelper/mermaid/editor/docs/
H A Dbundle.js.map1getWidth(),\n outerHeight: this._elementSizeObserver.getHeight(),\n emptySel…
H A Dbundle.js396 …eferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this.wid…
/plugin/dirtylittlehelper/mermaid/editor/
H A Dbundle.js396 …eferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this.wid…

123456