@lotte-innovate/ui-component-test 0.1.121 → 0.1.123

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. package/_virtual/icons.mjs +2 -0
  2. package/_virtual/icons.mjs.map +1 -0
  3. package/_virtual/index.mjs +2 -0
  4. package/_virtual/index.mjs.map +1 -0
  5. package/_virtual/index10.mjs +2 -0
  6. package/_virtual/index10.mjs.map +1 -0
  7. package/_virtual/index11.mjs +2 -0
  8. package/_virtual/index11.mjs.map +1 -0
  9. package/_virtual/index12.mjs +2 -0
  10. package/_virtual/index12.mjs.map +1 -0
  11. package/_virtual/index13.mjs +2 -0
  12. package/_virtual/index13.mjs.map +1 -0
  13. package/_virtual/index14.mjs +2 -0
  14. package/_virtual/index14.mjs.map +1 -0
  15. package/_virtual/index15.mjs +2 -0
  16. package/_virtual/index15.mjs.map +1 -0
  17. package/_virtual/index16.mjs +2 -0
  18. package/_virtual/index16.mjs.map +1 -0
  19. package/_virtual/index17.mjs +2 -0
  20. package/_virtual/index17.mjs.map +1 -0
  21. package/_virtual/index18.mjs +2 -0
  22. package/_virtual/index18.mjs.map +1 -0
  23. package/_virtual/index19.mjs +2 -0
  24. package/_virtual/index19.mjs.map +1 -0
  25. package/_virtual/index2.mjs +2 -0
  26. package/_virtual/index2.mjs.map +1 -0
  27. package/_virtual/index20.mjs +2 -0
  28. package/_virtual/index20.mjs.map +1 -0
  29. package/_virtual/index3.mjs +2 -0
  30. package/_virtual/index3.mjs.map +1 -0
  31. package/_virtual/index4.mjs +2 -0
  32. package/_virtual/index4.mjs.map +1 -0
  33. package/_virtual/index5.mjs +2 -0
  34. package/_virtual/index5.mjs.map +1 -0
  35. package/_virtual/index6.mjs +2 -0
  36. package/_virtual/index6.mjs.map +1 -0
  37. package/_virtual/index7.mjs +2 -0
  38. package/_virtual/index7.mjs.map +1 -0
  39. package/_virtual/index8.mjs +2 -0
  40. package/_virtual/index8.mjs.map +1 -0
  41. package/_virtual/index9.mjs +2 -0
  42. package/_virtual/index9.mjs.map +1 -0
  43. package/_virtual/model.mjs +2 -0
  44. package/_virtual/model.mjs.map +1 -0
  45. package/_virtual/plugin.mjs +2 -0
  46. package/_virtual/plugin.mjs.map +1 -0
  47. package/_virtual/plugin2.mjs +2 -0
  48. package/_virtual/plugin2.mjs.map +1 -0
  49. package/_virtual/plugin3.mjs +2 -0
  50. package/_virtual/plugin3.mjs.map +1 -0
  51. package/_virtual/plugin4.mjs +2 -0
  52. package/_virtual/plugin4.mjs.map +1 -0
  53. package/_virtual/plugin5.mjs +2 -0
  54. package/_virtual/plugin5.mjs.map +1 -0
  55. package/_virtual/plugin6.mjs +2 -0
  56. package/_virtual/plugin6.mjs.map +1 -0
  57. package/_virtual/plugin7.mjs +2 -0
  58. package/_virtual/plugin7.mjs.map +1 -0
  59. package/_virtual/theme.mjs +2 -0
  60. package/_virtual/theme.mjs.map +1 -0
  61. package/_virtual/tinymce.mjs +2 -0
  62. package/_virtual/tinymce.mjs.map +1 -0
  63. package/_virtual/tinymce2.mjs +2 -0
  64. package/_virtual/tinymce2.mjs.map +1 -0
  65. package/dist/lib/components/Editor/index.mjs +1 -1
  66. package/dist/tsconfig.tsbuildinfo +1 -1
  67. package/package.json +2 -1
  68. package/public/tinymce/icons/default/icons.mjs +2 -0
  69. package/public/tinymce/icons/default/icons.mjs.map +1 -0
  70. package/public/tinymce/icons/default/index.mjs +2 -0
  71. package/public/tinymce/icons/default/index.mjs.map +1 -0
  72. package/public/tinymce/models/dom/index.mjs +2 -0
  73. package/public/tinymce/models/dom/index.mjs.map +1 -0
  74. package/public/tinymce/models/dom/model.mjs +2 -0
  75. package/public/tinymce/models/dom/model.mjs.map +1 -0
  76. package/public/tinymce/plugins/advlist/index.mjs +2 -0
  77. package/public/tinymce/plugins/advlist/index.mjs.map +1 -0
  78. package/public/tinymce/plugins/advlist/plugin.mjs +2 -0
  79. package/public/tinymce/plugins/advlist/plugin.mjs.map +1 -0
  80. package/public/tinymce/plugins/code/index.mjs +2 -0
  81. package/public/tinymce/plugins/code/index.mjs.map +1 -0
  82. package/public/tinymce/plugins/code/plugin.mjs +2 -0
  83. package/public/tinymce/plugins/code/plugin.mjs.map +1 -0
  84. package/public/tinymce/plugins/codesample/index.mjs +2 -0
  85. package/public/tinymce/plugins/codesample/index.mjs.map +1 -0
  86. package/public/tinymce/plugins/codesample/plugin.mjs +2 -0
  87. package/public/tinymce/plugins/codesample/plugin.mjs.map +1 -0
  88. package/public/tinymce/plugins/image/index.mjs +2 -0
  89. package/public/tinymce/plugins/image/index.mjs.map +1 -0
  90. package/public/tinymce/plugins/image/plugin.mjs +2 -0
  91. package/public/tinymce/plugins/image/plugin.mjs.map +1 -0
  92. package/public/tinymce/plugins/link/index.mjs +2 -0
  93. package/public/tinymce/plugins/link/index.mjs.map +1 -0
  94. package/public/tinymce/plugins/link/plugin.mjs +2 -0
  95. package/public/tinymce/plugins/link/plugin.mjs.map +1 -0
  96. package/public/tinymce/plugins/lists/index.mjs +2 -0
  97. package/public/tinymce/plugins/lists/index.mjs.map +1 -0
  98. package/public/tinymce/plugins/lists/plugin.mjs +2 -0
  99. package/public/tinymce/plugins/lists/plugin.mjs.map +1 -0
  100. package/public/tinymce/plugins/table/index.mjs +2 -0
  101. package/public/tinymce/plugins/table/index.mjs.map +1 -0
  102. package/public/tinymce/plugins/table/plugin.mjs +2 -0
  103. package/public/tinymce/plugins/table/plugin.mjs.map +1 -0
  104. package/public/tinymce/skins/content/default/content.mjs +2 -0
  105. package/public/tinymce/skins/content/default/content.mjs.map +1 -0
  106. package/public/tinymce/skins/ui/oxide/content.mjs +2 -0
  107. package/public/tinymce/skins/ui/oxide/content.mjs.map +1 -0
  108. package/public/tinymce/skins/ui/oxide/skin.mjs +2 -0
  109. package/public/tinymce/skins/ui/oxide/skin.mjs.map +1 -0
  110. package/public/tinymce/themes/silver/index.mjs +2 -0
  111. package/public/tinymce/themes/silver/index.mjs.map +1 -0
  112. package/public/tinymce/themes/silver/theme.mjs +2 -0
  113. package/public/tinymce/themes/silver/theme.mjs.map +1 -0
  114. package/public/tinymce/tinymce.mjs +2 -0
  115. package/public/tinymce/tinymce.mjs.map +1 -0
  116. package/dist/public/tinymce/icons/default/icons.d.ts +0 -0
  117. package/dist/public/tinymce/icons/default/icons.js +0 -195
  118. package/dist/public/tinymce/icons/default/index.js +0 -8
  119. package/dist/public/tinymce/models/dom/index.js +0 -8
  120. package/dist/public/tinymce/models/dom/model.d.ts +0 -0
  121. package/dist/public/tinymce/models/dom/model.js +0 -7988
  122. package/dist/public/tinymce/plugins/advlist/index.js +0 -8
  123. package/dist/public/tinymce/plugins/advlist/plugin.d.ts +0 -0
  124. package/dist/public/tinymce/plugins/advlist/plugin.js +0 -255
  125. package/dist/public/tinymce/plugins/code/index.js +0 -8
  126. package/dist/public/tinymce/plugins/code/plugin.d.ts +0 -0
  127. package/dist/public/tinymce/plugins/code/plugin.js +0 -77
  128. package/dist/public/tinymce/plugins/codesample/index.js +0 -8
  129. package/dist/public/tinymce/plugins/codesample/plugin.js +0 -2462
  130. package/dist/public/tinymce/plugins/image/index.js +0 -8
  131. package/dist/public/tinymce/plugins/image/plugin.d.ts +0 -0
  132. package/dist/public/tinymce/plugins/image/plugin.js +0 -1523
  133. package/dist/public/tinymce/plugins/link/index.js +0 -8
  134. package/dist/public/tinymce/plugins/link/plugin.d.ts +0 -0
  135. package/dist/public/tinymce/plugins/link/plugin.js +0 -1246
  136. package/dist/public/tinymce/plugins/lists/index.js +0 -8
  137. package/dist/public/tinymce/plugins/lists/plugin.d.ts +0 -0
  138. package/dist/public/tinymce/plugins/lists/plugin.js +0 -2191
  139. package/dist/public/tinymce/plugins/table/index.js +0 -8
  140. package/dist/public/tinymce/plugins/table/plugin.d.ts +0 -0
  141. package/dist/public/tinymce/plugins/table/plugin.js +0 -3399
  142. package/dist/public/tinymce/skins/content/default/content.d.ts +0 -0
  143. package/dist/public/tinymce/skins/content/default/content.js +0 -3
  144. package/dist/public/tinymce/skins/ui/oxide/content.d.ts +0 -0
  145. package/dist/public/tinymce/skins/ui/oxide/content.js +0 -3
  146. package/dist/public/tinymce/skins/ui/oxide/skin.d.ts +0 -0
  147. package/dist/public/tinymce/skins/ui/oxide/skin.js +0 -3
  148. package/dist/public/tinymce/themes/silver/index.js +0 -8
  149. package/dist/public/tinymce/themes/silver/theme.d.ts +0 -0
  150. package/dist/public/tinymce/themes/silver/theme.js +0 -29731
  151. /package/{dist/public → public}/tinymce/icons/default/index.d.ts +0 -0
  152. /package/{dist/public → public}/tinymce/models/dom/index.d.ts +0 -0
  153. /package/{dist/public → public}/tinymce/plugins/advlist/index.d.ts +0 -0
  154. /package/{dist/public → public}/tinymce/plugins/code/index.d.ts +0 -0
  155. /package/{dist/public → public}/tinymce/plugins/codesample/index.d.ts +0 -0
  156. /package/{dist/public → public}/tinymce/plugins/codesample/plugin.d.ts +0 -0
  157. /package/{dist/public → public}/tinymce/plugins/image/index.d.ts +0 -0
  158. /package/{dist/public → public}/tinymce/plugins/link/index.d.ts +0 -0
  159. /package/{dist/public → public}/tinymce/plugins/lists/index.d.ts +0 -0
  160. /package/{dist/public → public}/tinymce/plugins/table/index.d.ts +0 -0
  161. /package/{dist/public → public}/tinymce/themes/silver/index.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.mjs","sources":["../../../../../../public/tinymce/plugins/lists/plugin.js"],"sourcesContent":["/**\n * TinyMCE version 6.8.5 (TBD)\n */\n\n(function () {\n 'use strict';\n\n var global$7 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n\n const hasProto = (v, constructor, predicate) => {\n var _a;\n if (predicate(v, constructor.prototype)) {\n return true;\n } else {\n return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;\n }\n };\n const typeOf = x => {\n const t = typeof x;\n if (x === null) {\n return 'null';\n } else if (t === 'object' && Array.isArray(x)) {\n return 'array';\n } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {\n return 'string';\n } else {\n return t;\n }\n };\n const isType$1 = type => value => typeOf(value) === type;\n const isSimpleType = type => value => typeof value === type;\n const isString = isType$1('string');\n const isObject = isType$1('object');\n const isArray = isType$1('array');\n const isBoolean = isSimpleType('boolean');\n const isNullable = a => a === null || a === undefined;\n const isNonNullable = a => !isNullable(a);\n const isFunction = isSimpleType('function');\n const isNumber = isSimpleType('number');\n\n const noop = () => {\n };\n const compose1 = (fbc, fab) => a => fbc(fab(a));\n const constant = value => {\n return () => {\n return value;\n };\n };\n const tripleEquals = (a, b) => {\n return a === b;\n };\n function curry(fn, ...initialArgs) {\n return (...restArgs) => {\n const all = initialArgs.concat(restArgs);\n return fn.apply(null, all);\n };\n }\n const not = f => t => !f(t);\n const never = constant(false);\n\n class Optional {\n constructor(tag, value) {\n this.tag = tag;\n this.value = value;\n }\n static some(value) {\n return new Optional(true, value);\n }\n static none() {\n return Optional.singletonNone;\n }\n fold(onNone, onSome) {\n if (this.tag) {\n return onSome(this.value);\n } else {\n return onNone();\n }\n }\n isSome() {\n return this.tag;\n }\n isNone() {\n return !this.tag;\n }\n map(mapper) {\n if (this.tag) {\n return Optional.some(mapper(this.value));\n } else {\n return Optional.none();\n }\n }\n bind(binder) {\n if (this.tag) {\n return binder(this.value);\n } else {\n return Optional.none();\n }\n }\n exists(predicate) {\n return this.tag && predicate(this.value);\n }\n forall(predicate) {\n return !this.tag || predicate(this.value);\n }\n filter(predicate) {\n if (!this.tag || predicate(this.value)) {\n return this;\n } else {\n return Optional.none();\n }\n }\n getOr(replacement) {\n return this.tag ? this.value : replacement;\n }\n or(replacement) {\n return this.tag ? this : replacement;\n }\n getOrThunk(thunk) {\n return this.tag ? this.value : thunk();\n }\n orThunk(thunk) {\n return this.tag ? this : thunk();\n }\n getOrDie(message) {\n if (!this.tag) {\n throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');\n } else {\n return this.value;\n }\n }\n static from(value) {\n return isNonNullable(value) ? Optional.some(value) : Optional.none();\n }\n getOrNull() {\n return this.tag ? this.value : null;\n }\n getOrUndefined() {\n return this.value;\n }\n each(worker) {\n if (this.tag) {\n worker(this.value);\n }\n }\n toArray() {\n return this.tag ? [this.value] : [];\n }\n toString() {\n return this.tag ? `some(${ this.value })` : 'none()';\n }\n }\n Optional.singletonNone = new Optional(false);\n\n const nativeSlice = Array.prototype.slice;\n const nativeIndexOf = Array.prototype.indexOf;\n const nativePush = Array.prototype.push;\n const rawIndexOf = (ts, t) => nativeIndexOf.call(ts, t);\n const contains$1 = (xs, x) => rawIndexOf(xs, x) > -1;\n const exists = (xs, pred) => {\n for (let i = 0, len = xs.length; i < len; i++) {\n const x = xs[i];\n if (pred(x, i)) {\n return true;\n }\n }\n return false;\n };\n const map = (xs, f) => {\n const len = xs.length;\n const r = new Array(len);\n for (let i = 0; i < len; i++) {\n const x = xs[i];\n r[i] = f(x, i);\n }\n return r;\n };\n const each$1 = (xs, f) => {\n for (let i = 0, len = xs.length; i < len; i++) {\n const x = xs[i];\n f(x, i);\n }\n };\n const filter$1 = (xs, pred) => {\n const r = [];\n for (let i = 0, len = xs.length; i < len; i++) {\n const x = xs[i];\n if (pred(x, i)) {\n r.push(x);\n }\n }\n return r;\n };\n const groupBy = (xs, f) => {\n if (xs.length === 0) {\n return [];\n } else {\n let wasType = f(xs[0]);\n const r = [];\n let group = [];\n for (let i = 0, len = xs.length; i < len; i++) {\n const x = xs[i];\n const type = f(x);\n if (type !== wasType) {\n r.push(group);\n group = [];\n }\n wasType = type;\n group.push(x);\n }\n if (group.length !== 0) {\n r.push(group);\n }\n return r;\n }\n };\n const foldl = (xs, f, acc) => {\n each$1(xs, (x, i) => {\n acc = f(acc, x, i);\n });\n return acc;\n };\n const findUntil = (xs, pred, until) => {\n for (let i = 0, len = xs.length; i < len; i++) {\n const x = xs[i];\n if (pred(x, i)) {\n return Optional.some(x);\n } else if (until(x, i)) {\n break;\n }\n }\n return Optional.none();\n };\n const find = (xs, pred) => {\n return findUntil(xs, pred, never);\n };\n const flatten = xs => {\n const r = [];\n for (let i = 0, len = xs.length; i < len; ++i) {\n if (!isArray(xs[i])) {\n throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);\n }\n nativePush.apply(r, xs[i]);\n }\n return r;\n };\n const bind = (xs, f) => flatten(map(xs, f));\n const reverse = xs => {\n const r = nativeSlice.call(xs, 0);\n r.reverse();\n return r;\n };\n const get$1 = (xs, i) => i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none();\n const head = xs => get$1(xs, 0);\n const last = xs => get$1(xs, xs.length - 1);\n const unique = (xs, comparator) => {\n const r = [];\n const isDuplicated = isFunction(comparator) ? x => exists(r, i => comparator(i, x)) : x => contains$1(r, x);\n for (let i = 0, len = xs.length; i < len; i++) {\n const x = xs[i];\n if (!isDuplicated(x)) {\n r.push(x);\n }\n }\n return r;\n };\n\n const is$2 = (lhs, rhs, comparator = tripleEquals) => lhs.exists(left => comparator(left, rhs));\n const equals = (lhs, rhs, comparator = tripleEquals) => lift2(lhs, rhs, comparator).getOr(lhs.isNone() && rhs.isNone());\n const lift2 = (oa, ob, f) => oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none();\n\n const COMMENT = 8;\n const DOCUMENT = 9;\n const DOCUMENT_FRAGMENT = 11;\n const ELEMENT = 1;\n const TEXT = 3;\n\n const fromHtml = (html, scope) => {\n const doc = scope || document;\n const div = doc.createElement('div');\n div.innerHTML = html;\n if (!div.hasChildNodes() || div.childNodes.length > 1) {\n const message = 'HTML does not have a single root node';\n console.error(message, html);\n throw new Error(message);\n }\n return fromDom$1(div.childNodes[0]);\n };\n const fromTag = (tag, scope) => {\n const doc = scope || document;\n const node = doc.createElement(tag);\n return fromDom$1(node);\n };\n const fromText = (text, scope) => {\n const doc = scope || document;\n const node = doc.createTextNode(text);\n return fromDom$1(node);\n };\n const fromDom$1 = node => {\n if (node === null || node === undefined) {\n throw new Error('Node cannot be null or undefined');\n }\n return { dom: node };\n };\n const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom$1);\n const SugarElement = {\n fromHtml,\n fromTag,\n fromText,\n fromDom: fromDom$1,\n fromPoint\n };\n\n const is$1 = (element, selector) => {\n const dom = element.dom;\n if (dom.nodeType !== ELEMENT) {\n return false;\n } else {\n const elem = dom;\n if (elem.matches !== undefined) {\n return elem.matches(selector);\n } else if (elem.msMatchesSelector !== undefined) {\n return elem.msMatchesSelector(selector);\n } else if (elem.webkitMatchesSelector !== undefined) {\n return elem.webkitMatchesSelector(selector);\n } else if (elem.mozMatchesSelector !== undefined) {\n return elem.mozMatchesSelector(selector);\n } else {\n throw new Error('Browser lacks native selectors');\n }\n }\n };\n\n const eq = (e1, e2) => e1.dom === e2.dom;\n const contains = (e1, e2) => {\n const d1 = e1.dom;\n const d2 = e2.dom;\n return d1 === d2 ? false : d1.contains(d2);\n };\n const is = is$1;\n\n const Global = typeof window !== 'undefined' ? window : Function('return this;')();\n\n const path = (parts, scope) => {\n let o = scope !== undefined && scope !== null ? scope : Global;\n for (let i = 0; i < parts.length && o !== undefined && o !== null; ++i) {\n o = o[parts[i]];\n }\n return o;\n };\n const resolve = (p, scope) => {\n const parts = p.split('.');\n return path(parts, scope);\n };\n\n const unsafe = (name, scope) => {\n return resolve(name, scope);\n };\n const getOrDie = (name, scope) => {\n const actual = unsafe(name, scope);\n if (actual === undefined || actual === null) {\n throw new Error(name + ' not available on this browser');\n }\n return actual;\n };\n\n const getPrototypeOf = Object.getPrototypeOf;\n const sandHTMLElement = scope => {\n return getOrDie('HTMLElement', scope);\n };\n const isPrototypeOf = x => {\n const scope = resolve('ownerDocument.defaultView', x);\n return isObject(x) && (sandHTMLElement(scope).prototype.isPrototypeOf(x) || /^HTML\\w*Element$/.test(getPrototypeOf(x).constructor.name));\n };\n\n const name = element => {\n const r = element.dom.nodeName;\n return r.toLowerCase();\n };\n const type = element => element.dom.nodeType;\n const isType = t => element => type(element) === t;\n const isComment = element => type(element) === COMMENT || name(element) === '#comment';\n const isHTMLElement = element => isElement$1(element) && isPrototypeOf(element.dom);\n const isElement$1 = isType(ELEMENT);\n const isText = isType(TEXT);\n const isDocument = isType(DOCUMENT);\n const isDocumentFragment = isType(DOCUMENT_FRAGMENT);\n const isTag = tag => e => isElement$1(e) && name(e) === tag;\n\n const owner = element => SugarElement.fromDom(element.dom.ownerDocument);\n const documentOrOwner = dos => isDocument(dos) ? dos : owner(dos);\n const parent = element => Optional.from(element.dom.parentNode).map(SugarElement.fromDom);\n const parentElement = element => Optional.from(element.dom.parentElement).map(SugarElement.fromDom);\n const nextSibling = element => Optional.from(element.dom.nextSibling).map(SugarElement.fromDom);\n const children = element => map(element.dom.childNodes, SugarElement.fromDom);\n const child = (element, index) => {\n const cs = element.dom.childNodes;\n return Optional.from(cs[index]).map(SugarElement.fromDom);\n };\n const firstChild = element => child(element, 0);\n const lastChild = element => child(element, element.dom.childNodes.length - 1);\n\n const isShadowRoot = dos => isDocumentFragment(dos) && isNonNullable(dos.dom.host);\n const supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode);\n const getRootNode = supported ? e => SugarElement.fromDom(e.dom.getRootNode()) : documentOrOwner;\n const getShadowRoot = e => {\n const r = getRootNode(e);\n return isShadowRoot(r) ? Optional.some(r) : Optional.none();\n };\n const getShadowHost = e => SugarElement.fromDom(e.dom.host);\n\n const inBody = element => {\n const dom = isText(element) ? element.dom.parentNode : element.dom;\n if (dom === undefined || dom === null || dom.ownerDocument === null) {\n return false;\n }\n const doc = dom.ownerDocument;\n return getShadowRoot(SugarElement.fromDom(dom)).fold(() => doc.body.contains(dom), compose1(inBody, getShadowHost));\n };\n\n var ClosestOrAncestor = (is, ancestor, scope, a, isRoot) => {\n if (is(scope, a)) {\n return Optional.some(scope);\n } else if (isFunction(isRoot) && isRoot(scope)) {\n return Optional.none();\n } else {\n return ancestor(scope, a, isRoot);\n }\n };\n\n const ancestor$3 = (scope, predicate, isRoot) => {\n let element = scope.dom;\n const stop = isFunction(isRoot) ? isRoot : never;\n while (element.parentNode) {\n element = element.parentNode;\n const el = SugarElement.fromDom(element);\n if (predicate(el)) {\n return Optional.some(el);\n } else if (stop(el)) {\n break;\n }\n }\n return Optional.none();\n };\n const closest$2 = (scope, predicate, isRoot) => {\n const is = (s, test) => test(s);\n return ClosestOrAncestor(is, ancestor$3, scope, predicate, isRoot);\n };\n\n const ancestor$2 = (scope, selector, isRoot) => ancestor$3(scope, e => is$1(e, selector), isRoot);\n const closest$1 = (scope, selector, isRoot) => {\n const is = (element, selector) => is$1(element, selector);\n return ClosestOrAncestor(is, ancestor$2, scope, selector, isRoot);\n };\n\n const closest = target => closest$1(target, '[contenteditable]');\n const isEditable = (element, assumeEditable = false) => {\n if (inBody(element)) {\n return element.dom.isContentEditable;\n } else {\n return closest(element).fold(constant(assumeEditable), editable => getRaw(editable) === 'true');\n }\n };\n const getRaw = element => element.dom.contentEditable;\n\n const before$1 = (marker, element) => {\n const parent$1 = parent(marker);\n parent$1.each(v => {\n v.dom.insertBefore(element.dom, marker.dom);\n });\n };\n const after = (marker, element) => {\n const sibling = nextSibling(marker);\n sibling.fold(() => {\n const parent$1 = parent(marker);\n parent$1.each(v => {\n append$1(v, element);\n });\n }, v => {\n before$1(v, element);\n });\n };\n const prepend = (parent, element) => {\n const firstChild$1 = firstChild(parent);\n firstChild$1.fold(() => {\n append$1(parent, element);\n }, v => {\n parent.dom.insertBefore(element.dom, v.dom);\n });\n };\n const append$1 = (parent, element) => {\n parent.dom.appendChild(element.dom);\n };\n\n const before = (marker, elements) => {\n each$1(elements, x => {\n before$1(marker, x);\n });\n };\n const append = (parent, elements) => {\n each$1(elements, x => {\n append$1(parent, x);\n });\n };\n\n const empty = element => {\n element.dom.textContent = '';\n each$1(children(element), rogue => {\n remove(rogue);\n });\n };\n const remove = element => {\n const dom = element.dom;\n if (dom.parentNode !== null) {\n dom.parentNode.removeChild(dom);\n }\n };\n\n var global$6 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');\n\n var global$5 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');\n\n var global$4 = tinymce.util.Tools.resolve('tinymce.util.VK');\n\n const fromDom = nodes => map(nodes, SugarElement.fromDom);\n\n const keys = Object.keys;\n const each = (obj, f) => {\n const props = keys(obj);\n for (let k = 0, len = props.length; k < len; k++) {\n const i = props[k];\n const x = obj[i];\n f(x, i);\n }\n };\n const objAcc = r => (x, i) => {\n r[i] = x;\n };\n const internalFilter = (obj, pred, onTrue, onFalse) => {\n each(obj, (x, i) => {\n (pred(x, i) ? onTrue : onFalse)(x, i);\n });\n };\n const filter = (obj, pred) => {\n const t = {};\n internalFilter(obj, pred, objAcc(t), noop);\n return t;\n };\n\n const rawSet = (dom, key, value) => {\n if (isString(value) || isBoolean(value) || isNumber(value)) {\n dom.setAttribute(key, value + '');\n } else {\n console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);\n throw new Error('Attribute value was not simple');\n }\n };\n const setAll = (element, attrs) => {\n const dom = element.dom;\n each(attrs, (v, k) => {\n rawSet(dom, k, v);\n });\n };\n const clone$1 = element => foldl(element.dom.attributes, (acc, attr) => {\n acc[attr.name] = attr.value;\n return acc;\n }, {});\n\n const clone = (original, isDeep) => SugarElement.fromDom(original.dom.cloneNode(isDeep));\n const deep = original => clone(original, true);\n const shallowAs = (original, tag) => {\n const nu = SugarElement.fromTag(tag);\n const attributes = clone$1(original);\n setAll(nu, attributes);\n return nu;\n };\n const mutate = (original, tag) => {\n const nu = shallowAs(original, tag);\n after(original, nu);\n const children$1 = children(original);\n append(nu, children$1);\n remove(original);\n return nu;\n };\n\n var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');\n\n var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');\n\n const matchNodeName = name => node => isNonNullable(node) && node.nodeName.toLowerCase() === name;\n const matchNodeNames = regex => node => isNonNullable(node) && regex.test(node.nodeName);\n const isTextNode$1 = node => isNonNullable(node) && node.nodeType === 3;\n const isElement = node => isNonNullable(node) && node.nodeType === 1;\n const isListNode = matchNodeNames(/^(OL|UL|DL)$/);\n const isOlUlNode = matchNodeNames(/^(OL|UL)$/);\n const isOlNode = matchNodeName('ol');\n const isListItemNode = matchNodeNames(/^(LI|DT|DD)$/);\n const isDlItemNode = matchNodeNames(/^(DT|DD)$/);\n const isTableCellNode = matchNodeNames(/^(TH|TD)$/);\n const isBr = matchNodeName('br');\n const isFirstChild = node => {\n var _a;\n return ((_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.firstChild) === node;\n };\n const isTextBlock = (editor, node) => isNonNullable(node) && node.nodeName in editor.schema.getTextBlockElements();\n const isBlock = (node, blockElements) => isNonNullable(node) && node.nodeName in blockElements;\n const isVoid = (editor, node) => isNonNullable(node) && node.nodeName in editor.schema.getVoidElements();\n const isBogusBr = (dom, node) => {\n if (!isBr(node)) {\n return false;\n }\n return dom.isBlock(node.nextSibling) && !isBr(node.previousSibling);\n };\n const isEmpty$2 = (dom, elm, keepBookmarks) => {\n const empty = dom.isEmpty(elm);\n if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) {\n return false;\n }\n return empty;\n };\n const isChildOfBody = (dom, elm) => dom.isChildOf(elm, dom.getRoot());\n\n const option = name => editor => editor.options.get(name);\n const register$3 = editor => {\n const registerOption = editor.options.register;\n registerOption('lists_indent_on_tab', {\n processor: 'boolean',\n default: true\n });\n };\n const shouldIndentOnTab = option('lists_indent_on_tab');\n const getForcedRootBlock = option('forced_root_block');\n const getForcedRootBlockAttrs = option('forced_root_block_attrs');\n\n const createTextBlock = (editor, contentNode) => {\n const dom = editor.dom;\n const blockElements = editor.schema.getBlockElements();\n const fragment = dom.createFragment();\n const blockName = getForcedRootBlock(editor);\n const blockAttrs = getForcedRootBlockAttrs(editor);\n let node;\n let textBlock;\n let hasContentNode = false;\n textBlock = dom.create(blockName, blockAttrs);\n if (!isBlock(contentNode.firstChild, blockElements)) {\n fragment.appendChild(textBlock);\n }\n while (node = contentNode.firstChild) {\n const nodeName = node.nodeName;\n if (!hasContentNode && (nodeName !== 'SPAN' || node.getAttribute('data-mce-type') !== 'bookmark')) {\n hasContentNode = true;\n }\n if (isBlock(node, blockElements)) {\n fragment.appendChild(node);\n textBlock = null;\n } else {\n if (!textBlock) {\n textBlock = dom.create(blockName, blockAttrs);\n fragment.appendChild(textBlock);\n }\n textBlock.appendChild(node);\n }\n }\n if (!hasContentNode && textBlock) {\n textBlock.appendChild(dom.create('br', { 'data-mce-bogus': '1' }));\n }\n return fragment;\n };\n\n const DOM$2 = global$3.DOM;\n const splitList = (editor, list, li) => {\n const removeAndKeepBookmarks = targetNode => {\n const parent = targetNode.parentNode;\n if (parent) {\n global$2.each(bookmarks, node => {\n parent.insertBefore(node, li.parentNode);\n });\n }\n DOM$2.remove(targetNode);\n };\n const bookmarks = DOM$2.select('span[data-mce-type=\"bookmark\"]', list);\n const newBlock = createTextBlock(editor, li);\n const tmpRng = DOM$2.createRng();\n tmpRng.setStartAfter(li);\n tmpRng.setEndAfter(list);\n const fragment = tmpRng.extractContents();\n for (let node = fragment.firstChild; node; node = node.firstChild) {\n if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) {\n DOM$2.remove(node);\n break;\n }\n }\n if (!editor.dom.isEmpty(fragment)) {\n DOM$2.insertAfter(fragment, list);\n }\n DOM$2.insertAfter(newBlock, list);\n const parent = li.parentElement;\n if (parent && isEmpty$2(editor.dom, parent)) {\n removeAndKeepBookmarks(parent);\n }\n DOM$2.remove(li);\n if (isEmpty$2(editor.dom, list)) {\n DOM$2.remove(list);\n }\n };\n\n const isDescriptionDetail = isTag('dd');\n const isDescriptionTerm = isTag('dt');\n const outdentDlItem = (editor, item) => {\n if (isDescriptionDetail(item)) {\n mutate(item, 'dt');\n } else if (isDescriptionTerm(item)) {\n parentElement(item).each(dl => splitList(editor, dl.dom, item.dom));\n }\n };\n const indentDlItem = item => {\n if (isDescriptionTerm(item)) {\n mutate(item, 'dd');\n }\n };\n const dlIndentation = (editor, indentation, dlItems) => {\n if (indentation === 'Indent') {\n each$1(dlItems, indentDlItem);\n } else {\n each$1(dlItems, item => outdentDlItem(editor, item));\n }\n };\n\n const getNormalizedPoint = (container, offset) => {\n if (isTextNode$1(container)) {\n return {\n container,\n offset\n };\n }\n const node = global$6.getNode(container, offset);\n if (isTextNode$1(node)) {\n return {\n container: node,\n offset: offset >= container.childNodes.length ? node.data.length : 0\n };\n } else if (node.previousSibling && isTextNode$1(node.previousSibling)) {\n return {\n container: node.previousSibling,\n offset: node.previousSibling.data.length\n };\n } else if (node.nextSibling && isTextNode$1(node.nextSibling)) {\n return {\n container: node.nextSibling,\n offset: 0\n };\n }\n return {\n container,\n offset\n };\n };\n const normalizeRange = rng => {\n const outRng = rng.cloneRange();\n const rangeStart = getNormalizedPoint(rng.startContainer, rng.startOffset);\n outRng.setStart(rangeStart.container, rangeStart.offset);\n const rangeEnd = getNormalizedPoint(rng.endContainer, rng.endOffset);\n outRng.setEnd(rangeEnd.container, rangeEnd.offset);\n return outRng;\n };\n\n const listNames = [\n 'OL',\n 'UL',\n 'DL'\n ];\n const listSelector = listNames.join(',');\n const getParentList = (editor, node) => {\n const selectionStart = node || editor.selection.getStart(true);\n return editor.dom.getParent(selectionStart, listSelector, getClosestListHost(editor, selectionStart));\n };\n const isParentListSelected = (parentList, selectedBlocks) => isNonNullable(parentList) && selectedBlocks.length === 1 && selectedBlocks[0] === parentList;\n const findSubLists = parentList => filter$1(parentList.querySelectorAll(listSelector), isListNode);\n const getSelectedSubLists = editor => {\n const parentList = getParentList(editor);\n const selectedBlocks = editor.selection.getSelectedBlocks();\n if (isParentListSelected(parentList, selectedBlocks)) {\n return findSubLists(parentList);\n } else {\n return filter$1(selectedBlocks, elm => {\n return isListNode(elm) && parentList !== elm;\n });\n }\n };\n const findParentListItemsNodes = (editor, elms) => {\n const listItemsElms = global$2.map(elms, elm => {\n const parentLi = editor.dom.getParent(elm, 'li,dd,dt', getClosestListHost(editor, elm));\n return parentLi ? parentLi : elm;\n });\n return unique(listItemsElms);\n };\n const getSelectedListItems = editor => {\n const selectedBlocks = editor.selection.getSelectedBlocks();\n return filter$1(findParentListItemsNodes(editor, selectedBlocks), isListItemNode);\n };\n const getSelectedDlItems = editor => filter$1(getSelectedListItems(editor), isDlItemNode);\n const getClosestEditingHost = (editor, elm) => {\n const parentTableCell = editor.dom.getParents(elm, 'TD,TH');\n return parentTableCell.length > 0 ? parentTableCell[0] : editor.getBody();\n };\n const isListHost = (schema, node) => !isListNode(node) && !isListItemNode(node) && exists(listNames, listName => schema.isValidChild(node.nodeName, listName));\n const getClosestListHost = (editor, elm) => {\n const parentBlocks = editor.dom.getParents(elm, editor.dom.isBlock);\n const parentBlock = find(parentBlocks, elm => isListHost(editor.schema, elm));\n return parentBlock.getOr(editor.getBody());\n };\n const isListInsideAnLiWithFirstAndLastNotListElement = list => parent(list).exists(parent => isListItemNode(parent.dom) && firstChild(parent).exists(firstChild => !isListNode(firstChild.dom)) && lastChild(parent).exists(lastChild => !isListNode(lastChild.dom)));\n const findLastParentListNode = (editor, elm) => {\n const parentLists = editor.dom.getParents(elm, 'ol,ul', getClosestListHost(editor, elm));\n return last(parentLists);\n };\n const getSelectedLists = editor => {\n const firstList = findLastParentListNode(editor, editor.selection.getStart());\n const subsequentLists = filter$1(editor.selection.getSelectedBlocks(), isOlUlNode);\n return firstList.toArray().concat(subsequentLists);\n };\n const getParentLists = editor => {\n const elm = editor.selection.getStart();\n return editor.dom.getParents(elm, 'ol,ul', getClosestListHost(editor, elm));\n };\n const getSelectedListRoots = editor => {\n const selectedLists = getSelectedLists(editor);\n const parentLists = getParentLists(editor);\n return find(parentLists, p => isListInsideAnLiWithFirstAndLastNotListElement(SugarElement.fromDom(p))).fold(() => getUniqueListRoots(editor, selectedLists), l => [l]);\n };\n const getUniqueListRoots = (editor, lists) => {\n const listRoots = map(lists, list => findLastParentListNode(editor, list).getOr(list));\n return unique(listRoots);\n };\n\n const isCustomList = list => /\\btox\\-/.test(list.className);\n const inList = (parents, listName) => findUntil(parents, isListNode, isTableCellNode).exists(list => list.nodeName === listName && !isCustomList(list));\n const isWithinNonEditable = (editor, element) => element !== null && !editor.dom.isEditable(element);\n const selectionIsWithinNonEditableList = editor => {\n const parentList = getParentList(editor);\n return isWithinNonEditable(editor, parentList);\n };\n const isWithinNonEditableList = (editor, element) => {\n const parentList = editor.dom.getParent(element, 'ol,ul,dl');\n return isWithinNonEditable(editor, parentList);\n };\n const setNodeChangeHandler = (editor, nodeChangeHandler) => {\n const initialNode = editor.selection.getNode();\n nodeChangeHandler({\n parents: editor.dom.getParents(initialNode),\n element: initialNode\n });\n editor.on('NodeChange', nodeChangeHandler);\n return () => editor.off('NodeChange', nodeChangeHandler);\n };\n\n const fromElements = (elements, scope) => {\n const doc = scope || document;\n const fragment = doc.createDocumentFragment();\n each$1(elements, element => {\n fragment.appendChild(element.dom);\n });\n return SugarElement.fromDom(fragment);\n };\n\n const fireListEvent = (editor, action, element) => editor.dispatch('ListMutation', {\n action,\n element\n });\n\n const blank = r => s => s.replace(r, '');\n const trim = blank(/^\\s+|\\s+$/g);\n const isNotEmpty = s => s.length > 0;\n const isEmpty$1 = s => !isNotEmpty(s);\n\n const isSupported = dom => dom.style !== undefined && isFunction(dom.style.getPropertyValue);\n\n const internalSet = (dom, property, value) => {\n if (!isString(value)) {\n console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom);\n throw new Error('CSS value must be a string: ' + value);\n }\n if (isSupported(dom)) {\n dom.style.setProperty(property, value);\n }\n };\n const set = (element, property, value) => {\n const dom = element.dom;\n internalSet(dom, property, value);\n };\n\n const isList = el => is(el, 'OL,UL');\n const isListItem = el => is(el, 'LI');\n const hasFirstChildList = el => firstChild(el).exists(isList);\n const hasLastChildList = el => lastChild(el).exists(isList);\n\n const isEntryList = entry => 'listAttributes' in entry;\n const isEntryComment = entry => 'isComment' in entry;\n const isEntryFragment = entry => 'isFragment' in entry;\n const isIndented = entry => entry.depth > 0;\n const isSelected = entry => entry.isSelected;\n const cloneItemContent = li => {\n const children$1 = children(li);\n const content = hasLastChildList(li) ? children$1.slice(0, -1) : children$1;\n return map(content, deep);\n };\n const createEntry = (li, depth, isSelected) => parent(li).filter(isElement$1).map(list => ({\n depth,\n dirty: false,\n isSelected,\n content: cloneItemContent(li),\n itemAttributes: clone$1(li),\n listAttributes: clone$1(list),\n listType: name(list),\n isInPreviousLi: false\n }));\n\n const joinSegment = (parent, child) => {\n append$1(parent.item, child.list);\n };\n const joinSegments = segments => {\n for (let i = 1; i < segments.length; i++) {\n joinSegment(segments[i - 1], segments[i]);\n }\n };\n const appendSegments = (head$1, tail) => {\n lift2(last(head$1), head(tail), joinSegment);\n };\n const createSegment = (scope, listType) => {\n const segment = {\n list: SugarElement.fromTag(listType, scope),\n item: SugarElement.fromTag('li', scope)\n };\n append$1(segment.list, segment.item);\n return segment;\n };\n const createSegments = (scope, entry, size) => {\n const segments = [];\n for (let i = 0; i < size; i++) {\n segments.push(createSegment(scope, isEntryList(entry) ? entry.listType : entry.parentListType));\n }\n return segments;\n };\n const populateSegments = (segments, entry) => {\n for (let i = 0; i < segments.length - 1; i++) {\n set(segments[i].item, 'list-style-type', 'none');\n }\n last(segments).each(segment => {\n if (isEntryList(entry)) {\n setAll(segment.list, entry.listAttributes);\n setAll(segment.item, entry.itemAttributes);\n }\n append(segment.item, entry.content);\n });\n };\n const normalizeSegment = (segment, entry) => {\n if (name(segment.list) !== entry.listType) {\n segment.list = mutate(segment.list, entry.listType);\n }\n setAll(segment.list, entry.listAttributes);\n };\n const createItem = (scope, attr, content) => {\n const item = SugarElement.fromTag('li', scope);\n setAll(item, attr);\n append(item, content);\n return item;\n };\n const appendItem = (segment, item) => {\n append$1(segment.list, item);\n segment.item = item;\n };\n const writeShallow = (scope, cast, entry) => {\n const newCast = cast.slice(0, entry.depth);\n last(newCast).each(segment => {\n if (isEntryList(entry)) {\n const item = createItem(scope, entry.itemAttributes, entry.content);\n appendItem(segment, item);\n normalizeSegment(segment, entry);\n } else if (isEntryFragment(entry)) {\n append(segment.item, entry.content);\n } else {\n const item = SugarElement.fromHtml(`<!--${ entry.content }-->`);\n append$1(segment.list, item);\n }\n });\n return newCast;\n };\n const writeDeep = (scope, cast, entry) => {\n const segments = createSegments(scope, entry, entry.depth - cast.length);\n joinSegments(segments);\n populateSegments(segments, entry);\n appendSegments(cast, segments);\n return cast.concat(segments);\n };\n const composeList = (scope, entries) => {\n let firstCommentEntryOpt = Optional.none();\n const cast = foldl(entries, (cast, entry, i) => {\n if (!isEntryComment(entry)) {\n return entry.depth > cast.length ? writeDeep(scope, cast, entry) : writeShallow(scope, cast, entry);\n } else {\n if (i === 0) {\n firstCommentEntryOpt = Optional.some(entry);\n return cast;\n }\n return writeShallow(scope, cast, entry);\n }\n }, []);\n firstCommentEntryOpt.each(firstCommentEntry => {\n const item = SugarElement.fromHtml(`<!--${ firstCommentEntry.content }-->`);\n head(cast).each(fistCast => {\n prepend(fistCast.list, item);\n });\n });\n return head(cast).map(segment => segment.list);\n };\n\n const indentEntry = (indentation, entry) => {\n switch (indentation) {\n case 'Indent':\n entry.depth++;\n break;\n case 'Outdent':\n entry.depth--;\n break;\n case 'Flatten':\n entry.depth = 0;\n }\n entry.dirty = true;\n };\n\n const cloneListProperties = (target, source) => {\n if (isEntryList(target) && isEntryList(source)) {\n target.listType = source.listType;\n target.listAttributes = { ...source.listAttributes };\n }\n };\n const cleanListProperties = entry => {\n entry.listAttributes = filter(entry.listAttributes, (_value, key) => key !== 'start');\n };\n const closestSiblingEntry = (entries, start) => {\n const depth = entries[start].depth;\n const matches = entry => entry.depth === depth && !entry.dirty;\n const until = entry => entry.depth < depth;\n return findUntil(reverse(entries.slice(0, start)), matches, until).orThunk(() => findUntil(entries.slice(start + 1), matches, until));\n };\n const normalizeEntries = entries => {\n each$1(entries, (entry, i) => {\n closestSiblingEntry(entries, i).fold(() => {\n if (entry.dirty && isEntryList(entry)) {\n cleanListProperties(entry);\n }\n }, matchingEntry => cloneListProperties(entry, matchingEntry));\n });\n return entries;\n };\n\n const Cell = initial => {\n let value = initial;\n const get = () => {\n return value;\n };\n const set = v => {\n value = v;\n };\n return {\n get,\n set\n };\n };\n\n const parseSingleItem = (depth, itemSelection, selectionState, item) => {\n var _a;\n if (isComment(item)) {\n return [{\n depth: depth + 1,\n content: (_a = item.dom.nodeValue) !== null && _a !== void 0 ? _a : '',\n dirty: false,\n isSelected: false,\n isComment: true\n }];\n }\n itemSelection.each(selection => {\n if (eq(selection.start, item)) {\n selectionState.set(true);\n }\n });\n const currentItemEntry = createEntry(item, depth, selectionState.get());\n itemSelection.each(selection => {\n if (eq(selection.end, item)) {\n selectionState.set(false);\n }\n });\n const childListEntries = lastChild(item).filter(isList).map(list => parseList(depth, itemSelection, selectionState, list)).getOr([]);\n return currentItemEntry.toArray().concat(childListEntries);\n };\n const parseItem = (depth, itemSelection, selectionState, item) => firstChild(item).filter(isList).fold(() => parseSingleItem(depth, itemSelection, selectionState, item), list => {\n const parsedSiblings = foldl(children(item), (acc, liChild, i) => {\n if (i === 0) {\n return acc;\n } else {\n if (isListItem(liChild)) {\n return acc.concat(parseSingleItem(depth, itemSelection, selectionState, liChild));\n } else {\n const fragment = {\n isFragment: true,\n depth,\n content: [liChild],\n isSelected: false,\n dirty: false,\n parentListType: name(list)\n };\n return acc.concat(fragment);\n }\n }\n }, []);\n return parseList(depth, itemSelection, selectionState, list).concat(parsedSiblings);\n });\n const parseList = (depth, itemSelection, selectionState, list) => bind(children(list), element => {\n const parser = isList(element) ? parseList : parseItem;\n const newDepth = depth + 1;\n return parser(newDepth, itemSelection, selectionState, element);\n });\n const parseLists = (lists, itemSelection) => {\n const selectionState = Cell(false);\n const initialDepth = 0;\n return map(lists, list => ({\n sourceList: list,\n entries: parseList(initialDepth, itemSelection, selectionState, list)\n }));\n };\n\n const outdentedComposer = (editor, entries) => {\n const normalizedEntries = normalizeEntries(entries);\n return map(normalizedEntries, entry => {\n const content = !isEntryComment(entry) ? fromElements(entry.content) : fromElements([SugarElement.fromHtml(`<!--${ entry.content }-->`)]);\n return SugarElement.fromDom(createTextBlock(editor, content.dom));\n });\n };\n const indentedComposer = (editor, entries) => {\n const normalizedEntries = normalizeEntries(entries);\n return composeList(editor.contentDocument, normalizedEntries).toArray();\n };\n const composeEntries = (editor, entries) => bind(groupBy(entries, isIndented), entries => {\n const groupIsIndented = head(entries).exists(isIndented);\n return groupIsIndented ? indentedComposer(editor, entries) : outdentedComposer(editor, entries);\n });\n const indentSelectedEntries = (entries, indentation) => {\n each$1(filter$1(entries, isSelected), entry => indentEntry(indentation, entry));\n };\n const getItemSelection = editor => {\n const selectedListItems = map(getSelectedListItems(editor), SugarElement.fromDom);\n return lift2(find(selectedListItems, not(hasFirstChildList)), find(reverse(selectedListItems), not(hasFirstChildList)), (start, end) => ({\n start,\n end\n }));\n };\n const listIndentation = (editor, lists, indentation) => {\n const entrySets = parseLists(lists, getItemSelection(editor));\n each$1(entrySets, entrySet => {\n indentSelectedEntries(entrySet.entries, indentation);\n const composedLists = composeEntries(editor, entrySet.entries);\n each$1(composedLists, composedList => {\n fireListEvent(editor, indentation === 'Indent' ? 'IndentList' : 'OutdentList', composedList.dom);\n });\n before(entrySet.sourceList, composedLists);\n remove(entrySet.sourceList);\n });\n };\n\n const selectionIndentation = (editor, indentation) => {\n const lists = fromDom(getSelectedListRoots(editor));\n const dlItems = fromDom(getSelectedDlItems(editor));\n let isHandled = false;\n if (lists.length || dlItems.length) {\n const bookmark = editor.selection.getBookmark();\n listIndentation(editor, lists, indentation);\n dlIndentation(editor, indentation, dlItems);\n editor.selection.moveToBookmark(bookmark);\n editor.selection.setRng(normalizeRange(editor.selection.getRng()));\n editor.nodeChanged();\n isHandled = true;\n }\n return isHandled;\n };\n const handleIndentation = (editor, indentation) => !selectionIsWithinNonEditableList(editor) && selectionIndentation(editor, indentation);\n const indentListSelection = editor => handleIndentation(editor, 'Indent');\n const outdentListSelection = editor => handleIndentation(editor, 'Outdent');\n const flattenListSelection = editor => handleIndentation(editor, 'Flatten');\n\n const zeroWidth = '\\uFEFF';\n const isZwsp = char => char === zeroWidth;\n\n const ancestor$1 = (scope, predicate, isRoot) => ancestor$3(scope, predicate, isRoot).isSome();\n\n const ancestor = (element, target) => ancestor$1(element, curry(eq, target));\n\n var global$1 = tinymce.util.Tools.resolve('tinymce.dom.BookmarkManager');\n\n const DOM$1 = global$3.DOM;\n const createBookmark = rng => {\n const bookmark = {};\n const setupEndPoint = start => {\n let container = rng[start ? 'startContainer' : 'endContainer'];\n let offset = rng[start ? 'startOffset' : 'endOffset'];\n if (isElement(container)) {\n const offsetNode = DOM$1.create('span', { 'data-mce-type': 'bookmark' });\n if (container.hasChildNodes()) {\n offset = Math.min(offset, container.childNodes.length - 1);\n if (start) {\n container.insertBefore(offsetNode, container.childNodes[offset]);\n } else {\n DOM$1.insertAfter(offsetNode, container.childNodes[offset]);\n }\n } else {\n container.appendChild(offsetNode);\n }\n container = offsetNode;\n offset = 0;\n }\n bookmark[start ? 'startContainer' : 'endContainer'] = container;\n bookmark[start ? 'startOffset' : 'endOffset'] = offset;\n };\n setupEndPoint(true);\n if (!rng.collapsed) {\n setupEndPoint();\n }\n return bookmark;\n };\n const resolveBookmark = bookmark => {\n const restoreEndPoint = start => {\n const nodeIndex = container => {\n var _a;\n let node = (_a = container.parentNode) === null || _a === void 0 ? void 0 : _a.firstChild;\n let idx = 0;\n while (node) {\n if (node === container) {\n return idx;\n }\n if (!isElement(node) || node.getAttribute('data-mce-type') !== 'bookmark') {\n idx++;\n }\n node = node.nextSibling;\n }\n return -1;\n };\n let container = bookmark[start ? 'startContainer' : 'endContainer'];\n let offset = bookmark[start ? 'startOffset' : 'endOffset'];\n if (!container) {\n return;\n }\n if (isElement(container) && container.parentNode) {\n const node = container;\n offset = nodeIndex(container);\n container = container.parentNode;\n DOM$1.remove(node);\n if (!container.hasChildNodes() && DOM$1.isBlock(container)) {\n container.appendChild(DOM$1.create('br'));\n }\n }\n bookmark[start ? 'startContainer' : 'endContainer'] = container;\n bookmark[start ? 'startOffset' : 'endOffset'] = offset;\n };\n restoreEndPoint(true);\n restoreEndPoint();\n const rng = DOM$1.createRng();\n rng.setStart(bookmark.startContainer, bookmark.startOffset);\n if (bookmark.endContainer) {\n rng.setEnd(bookmark.endContainer, bookmark.endOffset);\n }\n return normalizeRange(rng);\n };\n\n const listToggleActionFromListName = listName => {\n switch (listName) {\n case 'UL':\n return 'ToggleUlList';\n case 'OL':\n return 'ToggleOlList';\n case 'DL':\n return 'ToggleDLList';\n }\n };\n\n const updateListStyle = (dom, el, detail) => {\n const type = detail['list-style-type'] ? detail['list-style-type'] : null;\n dom.setStyle(el, 'list-style-type', type);\n };\n const setAttribs = (elm, attrs) => {\n global$2.each(attrs, (value, key) => {\n elm.setAttribute(key, value);\n });\n };\n const updateListAttrs = (dom, el, detail) => {\n setAttribs(el, detail['list-attributes']);\n global$2.each(dom.select('li', el), li => {\n setAttribs(li, detail['list-item-attributes']);\n });\n };\n const updateListWithDetails = (dom, el, detail) => {\n updateListStyle(dom, el, detail);\n updateListAttrs(dom, el, detail);\n };\n const removeStyles = (dom, element, styles) => {\n global$2.each(styles, style => dom.setStyle(element, style, ''));\n };\n const isInline = (editor, node) => isNonNullable(node) && !isBlock(node, editor.schema.getBlockElements());\n const getEndPointNode = (editor, rng, start, root) => {\n let container = rng[start ? 'startContainer' : 'endContainer'];\n const offset = rng[start ? 'startOffset' : 'endOffset'];\n if (isElement(container)) {\n container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;\n }\n if (!start && isBr(container.nextSibling)) {\n container = container.nextSibling;\n }\n const findBlockAncestor = node => {\n while (!editor.dom.isBlock(node) && node.parentNode && root !== node) {\n node = node.parentNode;\n }\n return node;\n };\n const findBetterContainer = (container, forward) => {\n var _a;\n const walker = new global$5(container, findBlockAncestor(container));\n const dir = forward ? 'next' : 'prev';\n let node;\n while (node = walker[dir]()) {\n if (!(isVoid(editor, node) || isZwsp(node.textContent) || ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length) === 0)) {\n return Optional.some(node);\n }\n }\n return Optional.none();\n };\n if (start && isTextNode$1(container)) {\n if (isZwsp(container.textContent)) {\n container = findBetterContainer(container, false).getOr(container);\n } else {\n if (container.parentNode !== null && isInline(editor, container.parentNode)) {\n container = container.parentNode;\n }\n while (container.previousSibling !== null && (isInline(editor, container.previousSibling) || isTextNode$1(container.previousSibling))) {\n container = container.previousSibling;\n }\n }\n }\n if (!start && isTextNode$1(container)) {\n if (isZwsp(container.textContent)) {\n container = findBetterContainer(container, true).getOr(container);\n } else {\n if (container.parentNode !== null && isInline(editor, container.parentNode)) {\n container = container.parentNode;\n }\n while (container.nextSibling !== null && (isInline(editor, container.nextSibling) || isTextNode$1(container.nextSibling))) {\n container = container.nextSibling;\n }\n }\n }\n while (container.parentNode !== root) {\n const parent = container.parentNode;\n if (isTextBlock(editor, container)) {\n return container;\n }\n if (/^(TD|TH)$/.test(parent.nodeName)) {\n return container;\n }\n container = parent;\n }\n return container;\n };\n const getSelectedTextBlocks = (editor, rng, root) => {\n const textBlocks = [];\n const dom = editor.dom;\n const startNode = getEndPointNode(editor, rng, true, root);\n const endNode = getEndPointNode(editor, rng, false, root);\n let block;\n const siblings = [];\n for (let node = startNode; node; node = node.nextSibling) {\n siblings.push(node);\n if (node === endNode) {\n break;\n }\n }\n global$2.each(siblings, node => {\n var _a;\n if (isTextBlock(editor, node)) {\n textBlocks.push(node);\n block = null;\n return;\n }\n if (dom.isBlock(node) || isBr(node)) {\n if (isBr(node)) {\n dom.remove(node);\n }\n block = null;\n return;\n }\n const nextSibling = node.nextSibling;\n if (global$1.isBookmarkNode(node)) {\n if (isListNode(nextSibling) || isTextBlock(editor, nextSibling) || !nextSibling && node.parentNode === root) {\n block = null;\n return;\n }\n }\n if (!block) {\n block = dom.create('p');\n (_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(block, node);\n textBlocks.push(block);\n }\n block.appendChild(node);\n });\n return textBlocks;\n };\n const hasCompatibleStyle = (dom, sib, detail) => {\n const sibStyle = dom.getStyle(sib, 'list-style-type');\n let detailStyle = detail ? detail['list-style-type'] : '';\n detailStyle = detailStyle === null ? '' : detailStyle;\n return sibStyle === detailStyle;\n };\n const getRootSearchStart = (editor, range) => {\n const start = editor.selection.getStart(true);\n const startPoint = getEndPointNode(editor, range, true, editor.getBody());\n if (ancestor(SugarElement.fromDom(startPoint), SugarElement.fromDom(range.commonAncestorContainer))) {\n return range.commonAncestorContainer;\n } else {\n return start;\n }\n };\n const applyList = (editor, listName, detail) => {\n const rng = editor.selection.getRng();\n let listItemName = 'LI';\n const root = getClosestListHost(editor, getRootSearchStart(editor, rng));\n const dom = editor.dom;\n if (dom.getContentEditable(editor.selection.getNode()) === 'false') {\n return;\n }\n listName = listName.toUpperCase();\n if (listName === 'DL') {\n listItemName = 'DT';\n }\n const bookmark = createBookmark(rng);\n const selectedTextBlocks = filter$1(getSelectedTextBlocks(editor, rng, root), editor.dom.isEditable);\n global$2.each(selectedTextBlocks, block => {\n let listBlock;\n const sibling = block.previousSibling;\n const parent = block.parentNode;\n if (!isListItemNode(parent)) {\n if (sibling && isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(dom, sibling, detail)) {\n listBlock = sibling;\n block = dom.rename(block, listItemName);\n sibling.appendChild(block);\n } else {\n listBlock = dom.create(listName);\n parent.insertBefore(listBlock, block);\n listBlock.appendChild(block);\n block = dom.rename(block, listItemName);\n }\n removeStyles(dom, block, [\n 'margin',\n 'margin-right',\n 'margin-bottom',\n 'margin-left',\n 'margin-top',\n 'padding',\n 'padding-right',\n 'padding-bottom',\n 'padding-left',\n 'padding-top'\n ]);\n updateListWithDetails(dom, listBlock, detail);\n mergeWithAdjacentLists(editor.dom, listBlock);\n }\n });\n editor.selection.setRng(resolveBookmark(bookmark));\n };\n const isValidLists = (list1, list2) => {\n return isListNode(list1) && list1.nodeName === (list2 === null || list2 === void 0 ? void 0 : list2.nodeName);\n };\n const hasSameListStyle = (dom, list1, list2) => {\n const targetStyle = dom.getStyle(list1, 'list-style-type', true);\n const style = dom.getStyle(list2, 'list-style-type', true);\n return targetStyle === style;\n };\n const hasSameClasses = (elm1, elm2) => {\n return elm1.className === elm2.className;\n };\n const shouldMerge = (dom, list1, list2) => {\n return isValidLists(list1, list2) && hasSameListStyle(dom, list1, list2) && hasSameClasses(list1, list2);\n };\n const mergeWithAdjacentLists = (dom, listBlock) => {\n let node;\n let sibling = listBlock.nextSibling;\n if (shouldMerge(dom, listBlock, sibling)) {\n const liSibling = sibling;\n while (node = liSibling.firstChild) {\n listBlock.appendChild(node);\n }\n dom.remove(liSibling);\n }\n sibling = listBlock.previousSibling;\n if (shouldMerge(dom, listBlock, sibling)) {\n const liSibling = sibling;\n while (node = liSibling.lastChild) {\n listBlock.insertBefore(node, listBlock.firstChild);\n }\n dom.remove(liSibling);\n }\n };\n const updateList$1 = (editor, list, listName, detail) => {\n if (list.nodeName !== listName) {\n const newList = editor.dom.rename(list, listName);\n updateListWithDetails(editor.dom, newList, detail);\n fireListEvent(editor, listToggleActionFromListName(listName), newList);\n } else {\n updateListWithDetails(editor.dom, list, detail);\n fireListEvent(editor, listToggleActionFromListName(listName), list);\n }\n };\n const updateCustomList = (editor, list, listName, detail) => {\n list.classList.forEach((cls, _, classList) => {\n if (cls.startsWith('tox-')) {\n classList.remove(cls);\n if (classList.length === 0) {\n list.removeAttribute('class');\n }\n }\n });\n if (list.nodeName !== listName) {\n const newList = editor.dom.rename(list, listName);\n updateListWithDetails(editor.dom, newList, detail);\n fireListEvent(editor, listToggleActionFromListName(listName), newList);\n } else {\n updateListWithDetails(editor.dom, list, detail);\n fireListEvent(editor, listToggleActionFromListName(listName), list);\n }\n };\n const toggleMultipleLists = (editor, parentList, lists, listName, detail) => {\n const parentIsList = isListNode(parentList);\n if (parentIsList && parentList.nodeName === listName && !hasListStyleDetail(detail) && !isCustomList(parentList)) {\n flattenListSelection(editor);\n } else {\n applyList(editor, listName, detail);\n const bookmark = createBookmark(editor.selection.getRng());\n const allLists = parentIsList ? [\n parentList,\n ...lists\n ] : lists;\n const updateFunction = parentIsList && isCustomList(parentList) ? updateCustomList : updateList$1;\n global$2.each(allLists, elm => {\n updateFunction(editor, elm, listName, detail);\n });\n editor.selection.setRng(resolveBookmark(bookmark));\n }\n };\n const hasListStyleDetail = detail => {\n return 'list-style-type' in detail;\n };\n const toggleSingleList = (editor, parentList, listName, detail) => {\n if (parentList === editor.getBody()) {\n return;\n }\n if (parentList) {\n if (parentList.nodeName === listName && !hasListStyleDetail(detail) && !isCustomList(parentList)) {\n flattenListSelection(editor);\n } else {\n const bookmark = createBookmark(editor.selection.getRng());\n if (isCustomList(parentList)) {\n parentList.classList.forEach((cls, _, classList) => {\n if (cls.startsWith('tox-')) {\n classList.remove(cls);\n if (classList.length === 0) {\n parentList.removeAttribute('class');\n }\n }\n });\n }\n updateListWithDetails(editor.dom, parentList, detail);\n const newList = editor.dom.rename(parentList, listName);\n mergeWithAdjacentLists(editor.dom, newList);\n editor.selection.setRng(resolveBookmark(bookmark));\n applyList(editor, listName, detail);\n fireListEvent(editor, listToggleActionFromListName(listName), newList);\n }\n } else {\n applyList(editor, listName, detail);\n fireListEvent(editor, listToggleActionFromListName(listName), parentList);\n }\n };\n const toggleList = (editor, listName, _detail) => {\n const parentList = getParentList(editor);\n if (isWithinNonEditableList(editor, parentList)) {\n return;\n }\n const selectedSubLists = getSelectedSubLists(editor);\n const detail = isObject(_detail) ? _detail : {};\n if (selectedSubLists.length > 0) {\n toggleMultipleLists(editor, parentList, selectedSubLists, listName, detail);\n } else {\n toggleSingleList(editor, parentList, listName, detail);\n }\n };\n\n const DOM = global$3.DOM;\n const normalizeList = (dom, list) => {\n const parentNode = list.parentElement;\n if (parentNode && parentNode.nodeName === 'LI' && parentNode.firstChild === list) {\n const sibling = parentNode.previousSibling;\n if (sibling && sibling.nodeName === 'LI') {\n sibling.appendChild(list);\n if (isEmpty$2(dom, parentNode)) {\n DOM.remove(parentNode);\n }\n } else {\n DOM.setStyle(parentNode, 'listStyleType', 'none');\n }\n }\n if (isListNode(parentNode)) {\n const sibling = parentNode.previousSibling;\n if (sibling && sibling.nodeName === 'LI') {\n sibling.appendChild(list);\n }\n }\n };\n const normalizeLists = (dom, element) => {\n const lists = global$2.grep(dom.select('ol,ul', element));\n global$2.each(lists, list => {\n normalizeList(dom, list);\n });\n };\n\n const findNextCaretContainer = (editor, rng, isForward, root) => {\n let node = rng.startContainer;\n const offset = rng.startOffset;\n if (isTextNode$1(node) && (isForward ? offset < node.data.length : offset > 0)) {\n return node;\n }\n const nonEmptyBlocks = editor.schema.getNonEmptyElements();\n if (isElement(node)) {\n node = global$6.getNode(node, offset);\n }\n const walker = new global$5(node, root);\n if (isForward) {\n if (isBogusBr(editor.dom, node)) {\n walker.next();\n }\n }\n const walkFn = isForward ? walker.next.bind(walker) : walker.prev2.bind(walker);\n while (node = walkFn()) {\n if (node.nodeName === 'LI' && !node.hasChildNodes()) {\n return node;\n }\n if (nonEmptyBlocks[node.nodeName]) {\n return node;\n }\n if (isTextNode$1(node) && node.data.length > 0) {\n return node;\n }\n }\n return null;\n };\n const hasOnlyOneBlockChild = (dom, elm) => {\n const childNodes = elm.childNodes;\n return childNodes.length === 1 && !isListNode(childNodes[0]) && dom.isBlock(childNodes[0]);\n };\n const isUnwrappable = node => Optional.from(node).map(SugarElement.fromDom).filter(isHTMLElement).exists(el => isEditable(el) && !contains$1(['details'], name(el)));\n const unwrapSingleBlockChild = (dom, elm) => {\n if (hasOnlyOneBlockChild(dom, elm) && isUnwrappable(elm.firstChild)) {\n dom.remove(elm.firstChild, true);\n }\n };\n const moveChildren = (dom, fromElm, toElm) => {\n let node;\n const targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm;\n unwrapSingleBlockChild(dom, fromElm);\n if (!isEmpty$2(dom, fromElm, true)) {\n while (node = fromElm.firstChild) {\n targetElm.appendChild(node);\n }\n }\n };\n const mergeLiElements = (dom, fromElm, toElm) => {\n let listNode;\n const ul = fromElm.parentNode;\n if (!isChildOfBody(dom, fromElm) || !isChildOfBody(dom, toElm)) {\n return;\n }\n if (isListNode(toElm.lastChild)) {\n listNode = toElm.lastChild;\n }\n if (ul === toElm.lastChild) {\n if (isBr(ul.previousSibling)) {\n dom.remove(ul.previousSibling);\n }\n }\n const node = toElm.lastChild;\n if (node && isBr(node) && fromElm.hasChildNodes()) {\n dom.remove(node);\n }\n if (isEmpty$2(dom, toElm, true)) {\n empty(SugarElement.fromDom(toElm));\n }\n moveChildren(dom, fromElm, toElm);\n if (listNode) {\n toElm.appendChild(listNode);\n }\n const contains$1 = contains(SugarElement.fromDom(toElm), SugarElement.fromDom(fromElm));\n const nestedLists = contains$1 ? dom.getParents(fromElm, isListNode, toElm) : [];\n dom.remove(fromElm);\n each$1(nestedLists, list => {\n if (isEmpty$2(dom, list) && list !== dom.getRoot()) {\n dom.remove(list);\n }\n });\n };\n const mergeIntoEmptyLi = (editor, fromLi, toLi) => {\n empty(SugarElement.fromDom(toLi));\n mergeLiElements(editor.dom, fromLi, toLi);\n editor.selection.setCursorLocation(toLi, 0);\n };\n const mergeForward = (editor, rng, fromLi, toLi) => {\n const dom = editor.dom;\n if (dom.isEmpty(toLi)) {\n mergeIntoEmptyLi(editor, fromLi, toLi);\n } else {\n const bookmark = createBookmark(rng);\n mergeLiElements(dom, fromLi, toLi);\n editor.selection.setRng(resolveBookmark(bookmark));\n }\n };\n const mergeBackward = (editor, rng, fromLi, toLi) => {\n const bookmark = createBookmark(rng);\n mergeLiElements(editor.dom, fromLi, toLi);\n const resolvedBookmark = resolveBookmark(bookmark);\n editor.selection.setRng(resolvedBookmark);\n };\n const backspaceDeleteFromListToListCaret = (editor, isForward) => {\n const dom = editor.dom, selection = editor.selection;\n const selectionStartElm = selection.getStart();\n const root = getClosestEditingHost(editor, selectionStartElm);\n const li = dom.getParent(selection.getStart(), 'LI', root);\n if (li) {\n const ul = li.parentElement;\n if (ul === editor.getBody() && isEmpty$2(dom, ul)) {\n return true;\n }\n const rng = normalizeRange(selection.getRng());\n const otherLi = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root);\n const willMergeParentIntoChild = otherLi && (isForward ? dom.isChildOf(li, otherLi) : dom.isChildOf(otherLi, li));\n if (otherLi && otherLi !== li && !willMergeParentIntoChild) {\n editor.undoManager.transact(() => {\n if (isForward) {\n mergeForward(editor, rng, otherLi, li);\n } else {\n if (isFirstChild(li)) {\n outdentListSelection(editor);\n } else {\n mergeBackward(editor, rng, li, otherLi);\n }\n }\n });\n return true;\n } else if (willMergeParentIntoChild && !isForward && otherLi !== li) {\n editor.undoManager.transact(() => {\n if (rng.commonAncestorContainer.parentElement) {\n const bookmark = createBookmark(rng);\n const oldParentElRef = rng.commonAncestorContainer.parentElement;\n moveChildren(dom, rng.commonAncestorContainer.parentElement, otherLi);\n oldParentElRef.remove();\n const resolvedBookmark = resolveBookmark(bookmark);\n editor.selection.setRng(resolvedBookmark);\n }\n });\n return true;\n } else if (!otherLi) {\n if (!isForward && rng.startOffset === 0 && rng.endOffset === 0) {\n editor.undoManager.transact(() => {\n flattenListSelection(editor);\n });\n return true;\n }\n }\n }\n return false;\n };\n const removeBlock = (dom, block, root) => {\n const parentBlock = dom.getParent(block.parentNode, dom.isBlock, root);\n dom.remove(block);\n if (parentBlock && dom.isEmpty(parentBlock)) {\n dom.remove(parentBlock);\n }\n };\n const backspaceDeleteIntoListCaret = (editor, isForward) => {\n const dom = editor.dom;\n const selectionStartElm = editor.selection.getStart();\n const root = getClosestEditingHost(editor, selectionStartElm);\n const block = dom.getParent(selectionStartElm, dom.isBlock, root);\n if (block && dom.isEmpty(block)) {\n const rng = normalizeRange(editor.selection.getRng());\n const otherLi = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root);\n if (otherLi) {\n const findValidElement = element => contains$1([\n 'td',\n 'th',\n 'caption'\n ], name(element));\n const findRoot = node => node.dom === root;\n const otherLiCell = closest$2(SugarElement.fromDom(otherLi), findValidElement, findRoot);\n const caretCell = closest$2(SugarElement.fromDom(rng.startContainer), findValidElement, findRoot);\n if (!equals(otherLiCell, caretCell, eq)) {\n return false;\n }\n editor.undoManager.transact(() => {\n const parentNode = otherLi.parentNode;\n removeBlock(dom, block, root);\n mergeWithAdjacentLists(dom, parentNode);\n editor.selection.select(otherLi, true);\n editor.selection.collapse(isForward);\n });\n return true;\n }\n }\n return false;\n };\n const backspaceDeleteCaret = (editor, isForward) => {\n return backspaceDeleteFromListToListCaret(editor, isForward) || backspaceDeleteIntoListCaret(editor, isForward);\n };\n const hasListSelection = editor => {\n const selectionStartElm = editor.selection.getStart();\n const root = getClosestEditingHost(editor, selectionStartElm);\n const startListParent = editor.dom.getParent(selectionStartElm, 'LI,DT,DD', root);\n return startListParent || getSelectedListItems(editor).length > 0;\n };\n const backspaceDeleteRange = editor => {\n if (hasListSelection(editor)) {\n editor.undoManager.transact(() => {\n editor.execCommand('Delete');\n normalizeLists(editor.dom, editor.getBody());\n });\n return true;\n }\n return false;\n };\n const backspaceDelete = (editor, isForward) => {\n const selection = editor.selection;\n return !isWithinNonEditableList(editor, selection.getNode()) && (selection.isCollapsed() ? backspaceDeleteCaret(editor, isForward) : backspaceDeleteRange(editor));\n };\n const setup$2 = editor => {\n editor.on('ExecCommand', e => {\n const cmd = e.command.toLowerCase();\n if ((cmd === 'delete' || cmd === 'forwarddelete') && hasListSelection(editor)) {\n normalizeLists(editor.dom, editor.getBody());\n }\n });\n editor.on('keydown', e => {\n if (e.keyCode === global$4.BACKSPACE) {\n if (backspaceDelete(editor, false)) {\n e.preventDefault();\n }\n } else if (e.keyCode === global$4.DELETE) {\n if (backspaceDelete(editor, true)) {\n e.preventDefault();\n }\n }\n });\n };\n\n const get = editor => ({\n backspaceDelete: isForward => {\n backspaceDelete(editor, isForward);\n }\n });\n\n const updateList = (editor, update) => {\n const parentList = getParentList(editor);\n if (parentList === null || isWithinNonEditableList(editor, parentList)) {\n return;\n }\n editor.undoManager.transact(() => {\n if (isObject(update.styles)) {\n editor.dom.setStyles(parentList, update.styles);\n }\n if (isObject(update.attrs)) {\n each(update.attrs, (v, k) => editor.dom.setAttrib(parentList, k, v));\n }\n });\n };\n\n const parseAlphabeticBase26 = str => {\n const chars = reverse(trim(str).split(''));\n const values = map(chars, (char, i) => {\n const charValue = char.toUpperCase().charCodeAt(0) - 'A'.charCodeAt(0) + 1;\n return Math.pow(26, i) * charValue;\n });\n return foldl(values, (sum, v) => sum + v, 0);\n };\n const composeAlphabeticBase26 = value => {\n value--;\n if (value < 0) {\n return '';\n } else {\n const remainder = value % 26;\n const quotient = Math.floor(value / 26);\n const rest = composeAlphabeticBase26(quotient);\n const char = String.fromCharCode('A'.charCodeAt(0) + remainder);\n return rest + char;\n }\n };\n const isUppercase = str => /^[A-Z]+$/.test(str);\n const isLowercase = str => /^[a-z]+$/.test(str);\n const isNumeric = str => /^[0-9]+$/.test(str);\n const deduceListType = start => {\n if (isNumeric(start)) {\n return 2;\n } else if (isUppercase(start)) {\n return 0;\n } else if (isLowercase(start)) {\n return 1;\n } else if (isEmpty$1(start)) {\n return 3;\n } else {\n return 4;\n }\n };\n const parseStartValue = start => {\n switch (deduceListType(start)) {\n case 2:\n return Optional.some({\n listStyleType: Optional.none(),\n start\n });\n case 0:\n return Optional.some({\n listStyleType: Optional.some('upper-alpha'),\n start: parseAlphabeticBase26(start).toString()\n });\n case 1:\n return Optional.some({\n listStyleType: Optional.some('lower-alpha'),\n start: parseAlphabeticBase26(start).toString()\n });\n case 3:\n return Optional.some({\n listStyleType: Optional.none(),\n start: ''\n });\n case 4:\n return Optional.none();\n }\n };\n const parseDetail = detail => {\n const start = parseInt(detail.start, 10);\n if (is$2(detail.listStyleType, 'upper-alpha')) {\n return composeAlphabeticBase26(start);\n } else if (is$2(detail.listStyleType, 'lower-alpha')) {\n return composeAlphabeticBase26(start).toLowerCase();\n } else {\n return detail.start;\n }\n };\n\n const open = editor => {\n const currentList = getParentList(editor);\n if (!isOlNode(currentList) || isWithinNonEditableList(editor, currentList)) {\n return;\n }\n editor.windowManager.open({\n title: 'List Properties',\n body: {\n type: 'panel',\n items: [{\n type: 'input',\n name: 'start',\n label: 'Start list at number',\n inputMode: 'numeric'\n }]\n },\n initialData: {\n start: parseDetail({\n start: editor.dom.getAttrib(currentList, 'start', '1'),\n listStyleType: Optional.from(editor.dom.getStyle(currentList, 'list-style-type'))\n })\n },\n buttons: [\n {\n type: 'cancel',\n name: 'cancel',\n text: 'Cancel'\n },\n {\n type: 'submit',\n name: 'save',\n text: 'Save',\n primary: true\n }\n ],\n onSubmit: api => {\n const data = api.getData();\n parseStartValue(data.start).each(detail => {\n editor.execCommand('mceListUpdate', false, {\n attrs: { start: detail.start === '1' ? '' : detail.start },\n styles: { 'list-style-type': detail.listStyleType.getOr('') }\n });\n });\n api.close();\n }\n });\n };\n\n const queryListCommandState = (editor, listName) => () => {\n const parentList = getParentList(editor);\n return isNonNullable(parentList) && parentList.nodeName === listName;\n };\n const registerDialog = editor => {\n editor.addCommand('mceListProps', () => {\n open(editor);\n });\n };\n const register$2 = editor => {\n editor.on('BeforeExecCommand', e => {\n const cmd = e.command.toLowerCase();\n if (cmd === 'indent') {\n indentListSelection(editor);\n } else if (cmd === 'outdent') {\n outdentListSelection(editor);\n }\n });\n editor.addCommand('InsertUnorderedList', (ui, detail) => {\n toggleList(editor, 'UL', detail);\n });\n editor.addCommand('InsertOrderedList', (ui, detail) => {\n toggleList(editor, 'OL', detail);\n });\n editor.addCommand('InsertDefinitionList', (ui, detail) => {\n toggleList(editor, 'DL', detail);\n });\n editor.addCommand('RemoveList', () => {\n flattenListSelection(editor);\n });\n registerDialog(editor);\n editor.addCommand('mceListUpdate', (ui, detail) => {\n if (isObject(detail)) {\n updateList(editor, detail);\n }\n });\n editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState(editor, 'UL'));\n editor.addQueryStateHandler('InsertOrderedList', queryListCommandState(editor, 'OL'));\n editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState(editor, 'DL'));\n };\n\n var global = tinymce.util.Tools.resolve('tinymce.html.Node');\n\n const isTextNode = node => node.type === 3;\n const isEmpty = nodeBuffer => nodeBuffer.length === 0;\n const wrapInvalidChildren = list => {\n const insertListItem = (buffer, refNode) => {\n const li = global.create('li');\n each$1(buffer, node => li.append(node));\n if (refNode) {\n list.insert(li, refNode, true);\n } else {\n list.append(li);\n }\n };\n const reducer = (buffer, node) => {\n if (isTextNode(node)) {\n return [\n ...buffer,\n node\n ];\n } else if (!isEmpty(buffer) && !isTextNode(node)) {\n insertListItem(buffer, node);\n return [];\n } else {\n return buffer;\n }\n };\n const restBuffer = foldl(list.children(), reducer, []);\n if (!isEmpty(restBuffer)) {\n insertListItem(restBuffer);\n }\n };\n const setup$1 = editor => {\n editor.on('PreInit', () => {\n const {parser} = editor;\n parser.addNodeFilter('ul,ol', nodes => each$1(nodes, wrapInvalidChildren));\n });\n };\n\n const setupTabKey = editor => {\n editor.on('keydown', e => {\n if (e.keyCode !== global$4.TAB || global$4.metaKeyPressed(e)) {\n return;\n }\n editor.undoManager.transact(() => {\n if (e.shiftKey ? outdentListSelection(editor) : indentListSelection(editor)) {\n e.preventDefault();\n }\n });\n });\n };\n const setup = editor => {\n if (shouldIndentOnTab(editor)) {\n setupTabKey(editor);\n }\n setup$2(editor);\n };\n\n const setupToggleButtonHandler = (editor, listName) => api => {\n const toggleButtonHandler = e => {\n api.setActive(inList(e.parents, listName));\n api.setEnabled(!isWithinNonEditableList(editor, e.element) && editor.selection.isEditable());\n };\n api.setEnabled(editor.selection.isEditable());\n return setNodeChangeHandler(editor, toggleButtonHandler);\n };\n const register$1 = editor => {\n const exec = command => () => editor.execCommand(command);\n if (!editor.hasPlugin('advlist')) {\n editor.ui.registry.addToggleButton('numlist', {\n icon: 'ordered-list',\n active: false,\n tooltip: 'Numbered list',\n onAction: exec('InsertOrderedList'),\n onSetup: setupToggleButtonHandler(editor, 'OL')\n });\n editor.ui.registry.addToggleButton('bullist', {\n icon: 'unordered-list',\n active: false,\n tooltip: 'Bullet list',\n onAction: exec('InsertUnorderedList'),\n onSetup: setupToggleButtonHandler(editor, 'UL')\n });\n }\n };\n\n const setupMenuButtonHandler = (editor, listName) => api => {\n const menuButtonHandler = e => api.setEnabled(inList(e.parents, listName) && !isWithinNonEditableList(editor, e.element));\n return setNodeChangeHandler(editor, menuButtonHandler);\n };\n const register = editor => {\n const listProperties = {\n text: 'List properties...',\n icon: 'ordered-list',\n onAction: () => editor.execCommand('mceListProps'),\n onSetup: setupMenuButtonHandler(editor, 'OL')\n };\n editor.ui.registry.addMenuItem('listprops', listProperties);\n editor.ui.registry.addContextMenu('lists', {\n update: node => {\n const parentList = getParentList(editor, node);\n return isOlNode(parentList) ? ['listprops'] : [];\n }\n });\n };\n\n var Plugin = () => {\n global$7.add('lists', editor => {\n register$3(editor);\n setup$1(editor);\n if (!editor.hasPlugin('rtc', true)) {\n setup(editor);\n register$2(editor);\n } else {\n registerDialog(editor);\n }\n register$1(editor);\n register(editor);\n return get(editor);\n });\n };\n\n Plugin();\n\n})();\n"],"names":["global$7","tinymce","util","Tools","resolve","isType$1","type","value","x","t","Array","isArray","o","v","proto","constructor","String","prototype","isPrototypeOf","_a","name","typeOf","isSimpleType","isString","isObject","isBoolean","isNonNullable","a","isNullable","isFunction","isNumber","noop","constant","tripleEquals","b","not","f","never","Optional","tag","this","some","none","singletonNone","fold","onNone","onSome","isSome","isNone","map","mapper","bind","binder","exists","predicate","forall","filter","getOr","replacement","or","getOrThunk","thunk","orThunk","getOrDie","message","Error","from","getOrNull","getOrUndefined","each","worker","toArray","toString","nativeSlice","slice","nativeIndexOf","indexOf","nativePush","push","contains$1","xs","rawIndexOf","ts","call","pred","i","len","length","r","each$1","filter$1","foldl","acc","findUntil","until","find","apply","flatten","reverse","get$1","head","last","unique","comparator","isDuplicated","is$2","lhs","rhs","left","lift2","oa","ob","fromDom$1","node","dom","SugarElement","fromHtml","html","scope","div","document","createElement","innerHTML","hasChildNodes","childNodes","console","error","fromTag","fromText","text","createTextNode","fromDom","fromPoint","docElm","y","elementFromPoint","is$1","element","selector","nodeType","elem","undefined","matches","msMatchesSelector","webkitMatchesSelector","mozMatchesSelector","eq","e1","e2","is","Global","window","Function","p","parts","path","split","actual","unsafe","getPrototypeOf","Object","sandHTMLElement","test","nodeName","toLowerCase","isType","isHTMLElement","isElement$1","isText","isDocument","isDocumentFragment","isTag","e","parent","parentNode","children","child","index","cs","firstChild","lastChild","getRootNode","Element","attachShadow","Node","dos","ownerDocument","getShadowRoot","host","getShadowHost","inBody","doc","body","contains","fbc","fab","ClosestOrAncestor","ancestor","isRoot","ancestor$3","stop","el","closest$2","s","ancestor$2","closest","target","closest$1","getRaw","contentEditable","before$1","marker","insertBefore","after","sibling","nextSibling","append$1","appendChild","append","elements","empty","textContent","rogue","remove","removeChild","global$6","global$5","global$4","nodes","keys","obj","props","k","onTrue","onFalse","internalFilter","setAll","attrs","key","setAttribute","rawSet","clone$1","attributes","attr","deep","original","isDeep","cloneNode","clone","mutate","nu","shallowAs","children$1","global$3","global$2","matchNodeName","matchNodeNames","regex","isTextNode$1","isElement","isListNode","isOlUlNode","isOlNode","isListItemNode","isDlItemNode","isTableCellNode","isBr","isTextBlock","editor","schema","getTextBlockElements","isBlock","blockElements","isVoid","getVoidElements","isEmpty$2","elm","keepBookmarks","isEmpty","select","isChildOfBody","isChildOf","getRoot","option","options","get","shouldIndentOnTab","getForcedRootBlock","getForcedRootBlockAttrs","createTextBlock","contentNode","getBlockElements","fragment","createFragment","blockName","blockAttrs","textBlock","hasContentNode","create","getAttribute","DOM$2","DOM","splitList","list","li","bookmarks","newBlock","tmpRng","createRng","setStartAfter","setEndAfter","extractContents","insertAfter","parentElement","targetNode","removeAndKeepBookmarks","isDescriptionDetail","isDescriptionTerm","outdentDlItem","item","dl","indentDlItem","getNormalizedPoint","container","offset","getNode","data","previousSibling","normalizeRange","rng","outRng","cloneRange","rangeStart","startContainer","startOffset","setStart","rangeEnd","endContainer","endOffset","setEnd","listNames","listSelector","join","getParentList","selectionStart","selection","getStart","getParent","getClosestListHost","getSelectedSubLists","parentList","selectedBlocks","getSelectedBlocks","isParentListSelected","querySelectorAll","findSubLists","getSelectedListItems","elms","listItemsElms","findParentListItemsNodes","getClosestEditingHost","parentTableCell","getParents","getBody","parentBlocks","parentBlock","isListHost","listName","isValidChild","findLastParentListNode","parentLists","getSelectedListRoots","selectedLists","firstList","subsequentLists","concat","getSelectedLists","getParentLists","isListInsideAnLiWithFirstAndLastNotListElement","getUniqueListRoots","l","lists","listRoots","isCustomList","className","inList","parents","isWithinNonEditable","isEditable","isWithinNonEditableList","setNodeChangeHandler","nodeChangeHandler","initialNode","on","off","fromElements","createDocumentFragment","fireListEvent","action","dispatch","trim","replace","internalSet","property","style","getPropertyValue","isSupported","setProperty","set","isList","hasFirstChildList","isEntryList","entry","isEntryComment","isIndented","depth","isSelected","cloneItemContent","content","joinSegment","createSegment","listType","segment","writeShallow","cast","newCast","createItem","itemAttributes","appendItem","listAttributes","normalizeSegment","isEntryFragment","writeDeep","segments","size","parentListType","createSegments","tail","joinSegments","populateSegments","composeList","entries","firstCommentEntryOpt","firstCommentEntry","fistCast","prepend","normalizeEntries","start","dirty","closestSiblingEntry","_value","cleanListProperties","matchingEntry","cloneListProperties","source","parseSingleItem","itemSelection","selectionState","nodeValue","isComment","currentItemEntry","isInPreviousLi","createEntry","end","childListEntries","parseList","parseItem","parsedSiblings","liChild","isFragment","composeEntries","wasType","group","groupBy","normalizedEntries","contentDocument","indentedComposer","outdentedComposer","listIndentation","indentation","entrySets","initial","Cell","sourceList","parseLists","selectedListItems","getItemSelection","entrySet","indentEntry","indentSelectedEntries","composedLists","composedList","selectionIndentation","dlItems","getSelectedDlItems","isHandled","bookmark","getBookmark","dlIndentation","moveToBookmark","setRng","getRng","nodeChanged","handleIndentation","selectionIsWithinNonEditableList","indentListSelection","outdentListSelection","flattenListSelection","isZwsp","char","ancestor$1","fn","initialArgs","restArgs","all","curry","global$1","DOM$1","createBookmark","setupEndPoint","offsetNode","Math","min","collapsed","resolveBookmark","restoreEndPoint","idx","nodeIndex","listToggleActionFromListName","setAttribs","updateListWithDetails","detail","setStyle","updateListStyle","updateListAttrs","isInline","getEndPointNode","root","findBetterContainer","forward","walker","findBlockAncestor","dir","applyList","listItemName","range","startPoint","commonAncestorContainer","getRootSearchStart","getContentEditable","toUpperCase","selectedTextBlocks","textBlocks","startNode","endNode","block","siblings","isBookmarkNode","getSelectedTextBlocks","listBlock","sib","sibStyle","getStyle","detailStyle","hasCompatibleStyle","rename","styles","removeStyles","mergeWithAdjacentLists","shouldMerge","list1","list2","isValidLists","hasSameListStyle","elm2","liSibling","updateList$1","newList","updateCustomList","classList","forEach","cls","_","startsWith","removeAttribute","hasListStyleDetail","toggleList","_detail","selectedSubLists","parentIsList","allLists","updateFunction","toggleMultipleLists","toggleSingleList","normalizeLists","grep","normalizeList","findNextCaretContainer","isForward","nonEmptyBlocks","getNonEmptyElements","isBogusBr","next","walkFn","prev2","hasOnlyOneBlockChild","isUnwrappable","assumeEditable","isContentEditable","editable","moveChildren","fromElm","toElm","targetElm","unwrapSingleBlockChild","mergeLiElements","listNode","ul","nestedLists","d1","d2","mergeForward","fromLi","toLi","setCursorLocation","mergeIntoEmptyLi","backspaceDeleteFromListToListCaret","selectionStartElm","otherLi","willMergeParentIntoChild","undoManager","transact","resolvedBookmark","mergeBackward","oldParentElRef","backspaceDeleteIntoListCaret","findValidElement","findRoot","equals","removeBlock","collapse","hasListSelection","backspaceDelete","isCollapsed","backspaceDeleteCaret","execCommand","backspaceDeleteRange","parseAlphabeticBase26","str","chars","values","charValue","charCodeAt","pow","sum","composeAlphabeticBase26","remainder","quotient","floor","fromCharCode","parseDetail","parseInt","listStyleType","open","currentList","windowManager","title","items","label","inputMode","initialData","getAttrib","buttons","primary","onSubmit","api","isLowercase","deduceListType","parseStartValue","getData","close","queryListCommandState","registerDialog","addCommand","register$2","cmd","command","ui","update","setStyles","setAttrib","updateList","addQueryStateHandler","global","isTextNode","nodeBuffer","wrapInvalidChildren","insertListItem","buffer","refNode","insert","restBuffer","setup","keyCode","TAB","metaKeyPressed","shiftKey","preventDefault","setupTabKey","BACKSPACE","DELETE","setup$2","setupToggleButtonHandler","setEnabled","setActive","setupMenuButtonHandler","add","registerOption","register","processor","default","register$3","parser","addNodeFilter","setup$1","hasPlugin","exec","registry","addToggleButton","icon","active","tooltip","onAction","onSetup","register$1","listProperties","addMenuItem","addContextMenu"],"mappings":"+FAIA,WAGI,IAAIA,EAAWC,QAAQC,KAAKC,MAAMC,QAAQ,yBAE1C,MAoBMC,EAAWC,GAAQC,GAZVC,KACb,MAAMC,SAAWD,EACjB,OAAU,OAANA,EACK,OACQ,WAANC,GAAkBC,MAAMC,QAAQH,GAClC,QACQ,WAANC,IAAuCG,EAdlCC,EAcsBL,EAAeM,GAdlCC,EAcsBC,QAZZC,UAYkCH,EAAMI,cAAcN,KAThD,QAAxBO,EAAKN,EAAEE,mBAAgC,IAAPI,OAAgB,EAASA,EAAGC,QAAUL,EAAYK,MAUpF,SAEAX,EAHwC,IAACG,EAAGE,EAdtC,IAACD,EAAGE,EACfI,CAiBV,EAEsCE,CAAOd,KAAWD,EAC9CgB,EAAehB,GAAQC,UAAgBA,IAAUD,EACjDiB,EAAWlB,EAAS,UACpBmB,EAAWnB,EAAS,UACpBM,EAAUN,EAAS,SACnBoB,EAAYH,EAAa,WAEzBI,EAAgBC,IADHA,IAAKA,QACIC,CAAWD,GACjCE,EAAaP,EAAa,YAC1BQ,EAAWR,EAAa,UAExBS,EAAO,OAGPC,EAAWzB,GACR,IACEA,EAGL0B,EAAe,CAACN,EAAGO,IAChBP,IAAMO,EAQf,MAAMC,EAAMC,GAAK3B,IAAM2B,EAAE3B,GACnB4B,EAAQL,GAAS,GAEvB,MAAMM,EACJ,WAAAvB,CAAYwB,EAAKhC,GACfiC,KAAKD,IAAMA,EACXC,KAAKjC,MAAQA,CACrB,CACM,WAAOkC,CAAKlC,GACV,OAAO,IAAI+B,GAAS,EAAM/B,EAClC,CAC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kb,GAAMlb,GACNga,GAAWha,IA9CEA,KACjB,MAAM0c,EAAOxC,GAAW,IAAMla,EAAOyX,YAAYyC,GAC5Cla,EAAOyc,UAAU,aACpBzc,EAAOma,GAAGwC,SAASC,gBAAgB,UAAW,CAC5CC,KAAM,eACNC,QAAQ,EACRC,QAAS,gBACTC,SAAUN,EAAK,qBACfO,QAASrB,GAAyB5b,EAAQ,QAE5CA,EAAOma,GAAGwC,SAASC,gBAAgB,UAAW,CAC5CC,KAAM,iBACNC,QAAQ,EACRC,QAAS,cACTC,SAAUN,EAAK,uBACfO,QAASrB,GAAyB5b,EAAQ,QAEpD,EAiCQkd,CAAWld,GA1BEA,KACf,MAAMmd,EAAiB,CACrB9lB,KAAM,qBACNwlB,KAAM,eACNG,SAAU,IAAMhd,EAAOyX,YAAY,gBACnCwF,QAASlB,GAAuB/b,EAAQ,OAE1CA,EAAOma,GAAGwC,SAASS,YAAY,YAAaD,GAC5Cnd,EAAOma,GAAGwC,SAASU,eAAe,QAAS,CACzCjD,OAAQ/jB,IACN,MAAM6O,EAAaP,GAAc3E,EAAQ3J,GACzC,OAAOqJ,GAASwF,GAAc,CAAC,aAAe,EAAE,GAElD,EAcAgX,CAASlc,GA5SDA,KAAW,CACrBsX,gBAAiB5C,IACf4C,GAAgBtX,EAAQ0U,EAAU,IA2S3BzT,CAAIjB,KAMlB,CAvnED"}
@@ -0,0 +1,2 @@
1
+ import{__exports as r}from"../../../../_virtual/index6.mjs";import{__require as e}from"./plugin.mjs";var i;function o(){return i||(i=1,e()),r}export{o as __require};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../../public/tinymce/plugins/table/index.js"],"sourcesContent":["// Exports the \"table\" plugin for usage with module loaders\n// Usage:\n// CommonJS:\n// require('tinymce/plugins/table')\n// ES2015:\n// import 'tinymce/plugins/table'\nrequire('./plugin.js');"],"names":["require$$0"],"mappings":"uIAMsBA"}
@@ -0,0 +1,2 @@
1
+ import{__exports as e}from"../../../../_virtual/plugin.mjs";var t;function o(){return t||(t=1,function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=n=e,l=(r=String).prototype,l.isPrototypeOf(o)||(null===(a=n.constructor)||void 0===a?void 0:a.name)===r.name)?"string":t;var o,l;var n,r,a})(t)===e,o=e=>t=>typeof t===e,l=t("string"),n=t("array"),r=o("boolean"),a=(s=void 0,e=>s===e);var s;const c=e=>!(e=>null==e)(e),i=o("function"),m=o("number"),d=()=>{},u=e=>()=>e,p=e=>e,b=(e,t)=>e===t;function g(e,...t){return(...o)=>{const l=t.concat(o);return e.apply(null,l)}}const h=e=>{e()},f=u(!1),y=u(!0);class w{constructor(e,t){this.tag=e,this.value=t}static some(e){return new w(!0,e)}static none(){return w.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?w.some(e(this.value)):w.none()}bind(e){return this.tag?e(this.value):w.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:w.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return c(e)?w.some(e):w.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}w.singletonNone=new w(!1);const S=Object.keys,C=Object.hasOwnProperty,v=(e,t)=>{const o=S(e);for(let l=0,n=o.length;l<n;l++){const n=o[l];t(e[n],n)}},T=(e,t)=>{const o={};var l;return((e,t,o,l)=>{v(e,((e,n)=>{(t(e,n)?o:l)(e,n)}))})(e,t,(l=o,(e,t)=>{l[t]=e}),d),o},x=e=>((e,t)=>{const o=[];return v(e,((e,l)=>{o.push(t(e,l))})),o})(e,p),A=e=>S(e).length,R=(e,t)=>_(e,t)?w.from(e[t]):w.none(),_=(e,t)=>C.call(e,t),O=(e,t)=>_(e,t)&&void 0!==e[t]&&null!==e[t],D=Array.prototype.indexOf,N=Array.prototype.push,I=(e,t)=>((e,t)=>D.call(e,t))(e,t)>-1,M=(e,t)=>{for(let o=0,l=e.length;o<l;o++){if(t(e[o],o))return!0}return!1},P=(e,t)=>{const o=[];for(let l=0;l<e;l++)o.push(t(l));return o},k=(e,t)=>{const o=e.length,l=new Array(o);for(let n=0;n<o;n++){const o=e[n];l[n]=t(o,n)}return l},E=(e,t)=>{for(let o=0,l=e.length;o<l;o++){t(e[o],o)}},B=(e,t)=>{const o=[];for(let l=0,n=e.length;l<n;l++){const n=e[l];t(n,l)&&o.push(n)}return o},F=(e,t,o)=>(E(e,((e,l)=>{o=t(o,e,l)})),o),q=(e,t)=>((e,t,o)=>{for(let l=0,n=e.length;l<n;l++){const n=e[l];if(t(n,l))return w.some(n);if(o(n,l))break}return w.none()})(e,t,f),L=(e,t)=>(e=>{const t=[];for(let o=0,l=e.length;o<l;++o){if(!n(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);N.apply(t,e[o])}return t})(k(e,t)),j=(e,t)=>{for(let o=0,l=e.length;o<l;++o){if(!0!==t(e[o],o))return!1}return!0},H=(e,t)=>t>=0&&t<e.length?w.some(e[t]):w.none(),V=(e,t)=>{for(let o=0;o<e.length;o++){const l=t(e[o],o);if(l.isSome())return l}return w.none()},$=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},W={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return $(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return $(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return $(o)},fromDom:$,fromPoint:(e,t,o)=>w.from(e.dom.elementFromPoint(t,o)).map($)},z=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},U=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,G=(e,t)=>e.dom===t.dom,K=z;"undefined"!=typeof window?window:Function("return this;")();const J=e=>e.dom.nodeName.toLowerCase(),Q=e=>e.dom.nodeType,X=e=>t=>Q(t)===e,Y=e=>8===Q(e)||"#comment"===J(e),Z=X(1),ee=X(3),te=X(9),oe=X(11),le=e=>t=>Z(t)&&J(t)===e,ne=e=>{return te(e)?e:(t=e,W.fromDom(t.dom.ownerDocument));var t},re=e=>w.from(e.dom.parentNode).map(W.fromDom),ae=(e,t)=>{const o=i(t)?t:f;let l=e.dom;const n=[];for(;null!==l.parentNode&&void 0!==l.parentNode;){const e=l.parentNode,t=W.fromDom(e);if(n.push(t),!0===o(t))break;l=e}return n},se=e=>w.from(e.dom.previousSibling).map(W.fromDom),ce=e=>w.from(e.dom.nextSibling).map(W.fromDom),ie=e=>k(e.dom.childNodes,W.fromDom),me=e=>((e,t)=>{const o=e.dom.childNodes;return w.from(o[t]).map(W.fromDom)})(e,0),de=i(Element.prototype.attachShadow)&&i(Node.prototype.getRootNode)?e=>W.fromDom(e.dom.getRootNode()):ne,ue=e=>{const t=de(e);return oe(o=t)&&c(o.dom.host)?w.some(t):w.none();var o},pe=e=>W.fromDom(e.dom.host),be=e=>{const t=ee(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return ue(W.fromDom(t)).fold((()=>o.body.contains(t)),(l=be,n=pe,e=>l(n(e))));var l,n};var ge=(e,t,o,l,n)=>e(o,l)?w.some(o):i(n)&&n(o)?w.none():t(o,l,n);const he=(e,t,o)=>{let l=e.dom;const n=i(o)?o:f;for(;l.parentNode;){l=l.parentNode;const e=W.fromDom(l);if(t(e))return w.some(e);if(n(e))break}return w.none()},fe=(e,t,o)=>he(e,(e=>z(e,t)),o),ye=(e,t)=>((e,t)=>q(e.dom.childNodes,(e=>t(W.fromDom(e)))).map(W.fromDom))(e,(e=>z(e,t))),we=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return U(o)?w.none():w.from(o.querySelector(e)).map(W.fromDom)})(t,e),Se=(e,t,o)=>ge(((e,t)=>z(e,t)),fe,e,t,o),Ce=(e,t=!1)=>{return be(e)?e.dom.isContentEditable:(o=e,Se(o,"[contenteditable]")).fold(u(t),(e=>"true"===ve(e)));var o},ve=e=>e.dom.contentEditable,Te=e=>t=>G(t,(e=>W.fromDom(e.getBody()))(e)),xe=e=>/^\d+(\.\d+)?$/.test(e)?e+"px":e,Ae=e=>W.fromDom(e.selection.getStart()),Re=e=>{return(t=e,o=le("table"),ge(((e,t)=>t(e)),he,t,o,l)).forall(Ce);var t,o,l},_e=(e,t)=>{let o=[];return E(ie(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(_e(e,t))})),o},Oe=(e,t)=>((e,t)=>B(ie(e),t))(e,(e=>z(e,t))),De=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return U(o)?[]:k(o.querySelectorAll(e),W.fromDom)})(t,e),Ne=(e,t,o)=>{if(!(l(o)||r(o)||m(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},Ie=(e,t,o)=>{Ne(e.dom,t,o)},Me=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},Pe=(e,t)=>w.from(Me(e,t)),ke=(e,t)=>{e.dom.removeAttribute(t)},Ee=(e,t,o=b)=>e.exists((e=>o(e,t))),Be=(e,t,o)=>e.isSome()&&t.isSome()?w.some(o(e.getOrDie(),t.getOrDie())):w.none(),Fe=(e,t)=>((e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t)(e,t,0),qe=(Le=/^\s+|\s+$/g,e=>e.replace(Le,""));var Le;const je=e=>e.length>0,He=(e,t=10)=>{const o=parseInt(e,t);return isNaN(o)?w.none():w.some(o)},Ve=e=>void 0!==e.style&&i(e.style.getPropertyValue),$e=(e,t,o)=>{((e,t,o)=>{if(!l(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Ve(e)&&e.style.setProperty(t,o)})(e.dom,t,o)},We=(e,t)=>{const o=e.dom,l=window.getComputedStyle(o).getPropertyValue(t);return""!==l||be(e)?l:ze(o,t)},ze=(e,t)=>Ve(e)?e.style.getPropertyValue(t):"",Ue=(e,t)=>{const o=e.dom,l=ze(o,t);return w.from(l).filter((e=>e.length>0))},Ge=(e,t)=>{((e,t)=>{Ve(e)&&e.style.removeProperty(t)})(e.dom,t),Ee(Pe(e,"style").map(qe),"")&&ke(e,"style")},Ke=(e,t,o=0)=>Pe(e,t).map((e=>parseInt(e,10))).getOr(o),Je=(e,t)=>Qe(e,t,y),Qe=(e,t,o)=>L(ie(e),(e=>z(e,t)?o(e)?[e]:[]:Qe(e,t,o))),Xe=["tfoot","thead","tbody","colgroup"],Ye=(e,t,o)=>({element:e,rowspan:t,colspan:o}),Ze=(e,t,o)=>({element:e,cells:t,section:o}),et=(e,t)=>((e,t,o=f)=>o(t)?w.none():I(e,J(t))?w.some(t):fe(t,e.join(","),(e=>z(e,"table")||o(e))))(["td","th"],e,t),tt=(e,t)=>Se(e,"table",t),ot=e=>Je(e,"tr"),lt=e=>tt(e).fold(u([]),(e=>Oe(e,"colgroup"))),nt=(e,t)=>k(e,(e=>{if("colgroup"===J(e)){const t=k((e=>z(e,"colgroup")?Oe(e,"col"):L(lt(e),(e=>Oe(e,"col"))))(e),(e=>{const t=Ke(e,"span",1);return Ye(e,1,t)}));return Ze(e,t,"colgroup")}{const o=k((e=>Je(e,"th,td"))(e),(e=>{const t=Ke(e,"rowspan",1),o=Ke(e,"colspan",1);return Ye(e,t,o)}));return Ze(e,o,t(e))}})),rt=e=>re(e).map((e=>{const t=J(e);return(e=>I(Xe,e))(t)?t:"tbody"})).getOr("tbody"),at=e=>Pe(e,"data-snooker-locked-cols").bind((e=>w.from(e.match(/\d+/g)))).map((e=>((e,t)=>{const o={};for(let l=0,n=e.length;l<n;l++){const n=e[l];o[String(n)]=t(n,l)}return o})(e,y))),st=(e,t)=>e+","+t,ct=(e,t)=>{const o=L(e.all,(e=>e.cells));return B(o,t)},it=e=>{const t={},o=[];var l;const n=(l=e,H(l,0)).map((e=>e.element)).bind(tt).bind(at).getOr({});let r=0,a=0,s=0;const{pass:c,fail:i}=((e,t)=>{const o=[],l=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];(t(r,n)?o:l).push(r)}return{pass:o,fail:l}})(e,(e=>"colgroup"===e.section));E(i,(e=>{const l=[];E(e.cells,(e=>{let o=0;for(;void 0!==t[st(s,o)];)o++;const r=O(n,o.toString()),c=((e,t,o,l,n,r)=>({element:e,rowspan:t,colspan:o,row:l,column:n,isLocked:r}))(e.element,e.rowspan,e.colspan,s,o,r);for(let l=0;l<e.colspan;l++)for(let n=0;n<e.rowspan;n++){const e=o+l,r=st(s+n,e);t[r]=c,a=Math.max(a,e+1)}l.push(c)})),r++,o.push(Ze(e.element,l,e.section)),s++}));const{columns:m,colgroups:d}=(e=>H(e,e.length-1))(c).map((e=>{const t=(e=>{const t={};let o=0;return E(e.cells,(e=>{const l=e.colspan;P(l,(n=>{const r=o+n;t[r]=((e,t,o)=>({element:e,colspan:t,column:o}))(e.element,l,r)})),o+=l})),t})(e),o=((e,t)=>({element:e,columns:t}))(e.element,x(t));return{colgroups:[o],columns:t}})).getOrThunk((()=>({colgroups:[],columns:{}}))),u=((e,t)=>({rows:e,columns:t}))(r,a);return{grid:u,access:t,all:o,columns:m,colgroups:d}},mt=e=>{const t=(e=>{const t=ot(e),o=[...lt(e),...t];return nt(o,rt)})(e);return it(t)},dt=(e,t,o)=>w.from(e.access[st(t,o)]),ut=(e,t,o)=>{const l=ct(e,(e=>o(t,e.element)));return l.length>0?w.some(l[0]):w.none()},pt=e=>L(e.all,(e=>e.cells)),bt=(e,t)=>w.from(e.columns[t]);var gt=tinymce.util.Tools.resolve("tinymce.util.Tools");const ht=(e,t,o)=>{const l=e.select("td,th",t);let n;for(let t=0;t<l.length;t++){const r=e.getStyle(l[t],o);if(a(n)&&(n=r),n!==r)return""}return n},ft=(e,t,o)=>{gt.each("left center right".split(" "),(l=>{l!==o&&e.formatter.remove("align"+l,{},t)})),o&&e.formatter.apply("align"+o,{},t)},yt=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})},wt=(e,t)=>(e=>{const t=parseFloat(e);return isNaN(t)?w.none():w.some(t)})(e).getOr(t),St=(e,t,o)=>wt(We(e,t),o),Ct=(e,t)=>{const o=e.dom,l=o.getBoundingClientRect().width||o.offsetWidth;return"border-box"===t?l:((e,t,o,l)=>t-St(e,`padding-${o}`,0)-St(e,`padding-${l}`,0)-St(e,`border-${o}-width`,0)-St(e,`border-${l}-width`,0))(e,l,"left","right")},vt=e=>Ct(e,"content-box");var Tt=tinymce.util.Tools.resolve("tinymce.Env");const xt=P(5,(e=>{const t=`${e+1}px`;return{title:t,value:t}})),At=k(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(e=>({title:e,value:e.toLowerCase()}))),Rt="100%",_t=e=>{var t;const o=e.dom,l=null!==(t=o.getParent(e.selection.getStart(),o.isBlock))&&void 0!==t?t:e.getBody();return vt(W.fromDom(l))+"px"},Ot=e=>t=>t.options.get(e),Dt=Ot("table_sizing_mode"),Nt=Ot("table_border_widths"),It=Ot("table_border_styles"),Mt=Ot("table_cell_advtab"),Pt=Ot("table_row_advtab"),kt=Ot("table_advtab"),Et=Ot("table_appearance_options"),Bt=Ot("table_grid"),Ft=Ot("table_style_by_css"),qt=Ot("table_cell_class_list"),Lt=Ot("table_row_class_list"),jt=Ot("table_class_list"),Ht=Ot("table_toolbar"),Vt=Ot("table_background_color_map"),$t=Ot("table_border_color_map"),Wt=e=>"fixed"===Dt(e),zt=e=>"responsive"===Dt(e),Ut=e=>{const t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:((e,t)=>zt(e)||!Ft(e)?t:Wt(e)?{...t,width:_t(e)}:{...t,width:Rt})(e,o)},Gt=e=>{const t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:((e,t)=>zt(e)||Ft(e)?t:Wt(e)?{...t,width:_t(e)}:{...t,width:Rt})(e,o)},Kt=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,Jt=(e,t,o)=>{const l=ut(e,t,G),n=ut(e,o,G);return l.bind((e=>n.map((t=>{return o=e,l=t,n=Math.min(o.row,l.row),r=Math.min(o.column,l.column),a=Math.max(o.row+o.rowspan-1,l.row+l.rowspan-1),s=Math.max(o.column+o.colspan-1,l.column+l.colspan-1),{startRow:n,startCol:r,finishRow:a,finishCol:s};var o,l,n,r,a,s}))))},Qt=(e,t,o)=>Jt(e,t,o).bind((t=>((e,t)=>{let o=!0;const l=g(Kt,t);for(let n=t.startRow;n<=t.finishRow;n++)for(let r=t.startCol;r<=t.finishCol;r++)o=o&&dt(e,n,r).exists(l);return o?w.some(t):w.none()})(e,t))),Xt=mt,Yt=(e,t)=>{re(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},Zt=(e,t)=>{ce(e).fold((()=>{re(e).each((e=>{to(e,t)}))}),(e=>{Yt(e,t)}))},eo=(e,t)=>{me(e).fold((()=>{to(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},to=(e,t)=>{e.dom.appendChild(t.dom)},oo=(e,t)=>{Yt(e,t),to(t,e)},lo=(e,t)=>{E(t,((o,l)=>{const n=0===l?e:t[l-1];Zt(n,o)}))},no=(e,t)=>{E(t,(t=>{to(e,t)}))},ro=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},ao=e=>{const t=ie(e);t.length>0&&lo(e,t),ro(e)},so=((e,t)=>{const o=t=>e(t)?w.from(t.dom.nodeValue):w.none();return{get:l=>{if(!e(l))throw new Error("Can only get "+t+" value of a "+t+" node");return o(l).getOr("")},getOption:o,set:(o,l)=>{if(!e(o))throw new Error("Can only set raw "+t+" value of a "+t+" node");o.dom.nodeValue=l}}})(ee,"text"),co=e=>so.get(e),io=(e,t)=>so.set(e,t);var mo=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];const uo=(e,t,o,l)=>{const n=t(e,o);return r=(o,l)=>{const n=t(e,l);return po(e,o,n)},a=n,((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(l,((e,t)=>{a=r(a,e,t)})),a;var r,a},po=(e,t,o)=>t.bind((t=>o.filter(g(e.eq,t)))),bo=(e,t,o)=>o.length>0?((e,t,o,l)=>l(e,t,o[0],o.slice(1)))(e,t,o,uo):w.none(),go={up:u({selector:fe,closest:Se,predicate:he,all:ae}),down:u({selector:De,predicate:_e}),styles:u({get:We,getRaw:Ue,set:$e,remove:Ge}),attrs:u({get:Me,set:Ie,remove:ke,copyTo:(e,t)=>{((e,t)=>{const o=e.dom;v(t,((e,t)=>{Ne(o,t,e)}))})(t,F(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}))}}),insert:u({before:Yt,after:Zt,afterAll:lo,append:to,appendAll:no,prepend:eo,wrap:oo}),remove:u({unwrap:ao,remove:ro}),create:u({nu:W.fromTag,clone:e=>W.fromDom(e.dom.cloneNode(!1)),text:W.fromText}),query:u({comparePosition:(e,t)=>e.dom.compareDocumentPosition(t.dom),prevSibling:se,nextSibling:ce}),property:u({children:ie,name:J,parent:re,document:e=>ne(e).dom,isText:ee,isComment:Y,isElement:Z,isSpecial:e=>{const t=J(e);return I(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:e=>Z(e)?Pe(e,"lang"):w.none(),getText:co,setText:io,isBoundary:e=>!!Z(e)&&("body"===J(e)||I(mo,J(e))),isEmptyTag:e=>!!Z(e)&&I(["br","img","hr","input"],J(e)),isNonEditable:e=>Z(e)&&"false"===Me(e,"contenteditable")}),eq:G,is:K},ho=e=>fe(e,"table"),fo=(e,t,o)=>we(e,t).bind((t=>we(e,o).bind((e=>{return(o=ho,l=[t,e],bo(go,((e,t)=>o(t)),l)).map((o=>({first:t,last:e,table:o})));var o,l})))),yo=(e,t)=>((e,t)=>{const o=De(e,t);return o.length>0?w.some(o):w.none()})(e,t),wo=(e,t,o)=>fo(e,t,o).bind((t=>{const o=t=>G(e,t),l="thead,tfoot,tbody,table",n=fe(t.first,l,o),r=fe(t.last,l,o);return n.bind((e=>r.bind((o=>G(e,o)?((e,t,o)=>{const l=Xt(e);return Qt(l,t,o)})(t.table,t.first,t.last):w.none()))))})),So=e=>k(e,W.fromDom),Co="data-mce-selected",vo="data-mce-first-selected",To="data-mce-last-selected",xo={selected:Co,selectedSelector:"td["+Co+"],th["+Co+"]",firstSelected:vo,firstSelectedSelector:"td["+vo+"],th["+vo+"]",lastSelected:To,lastSelectedSelector:"td["+To+"],th["+To+"]"},Ao=e=>(t,o)=>{const l=J(t),n="col"===l||"colgroup"===l?tt(r=t).bind((e=>yo(e,xo.firstSelectedSelector))).fold(u(r),(e=>e[0])):t;var r;return Se(n,e,o)},Ro=Ao("th,td,caption"),_o=Ao("th,td"),Oo=e=>So(e.model.table.getSelectedCells()),Do=(e,t)=>{const o=_o(e),l=o.bind((e=>tt(e))).map((e=>ot(e)));return Be(o,l,((e,o)=>B(o,(o=>M(So(o.dom.cells),(o=>"1"===Me(o,t)||G(o,e))))))).getOr([])},No=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],Io=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Mo=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Po=e=>{return(t=e,o="#",Fe(t,o)?((e,t)=>e.substring(t))(t,o.length):t).toUpperCase();var t,o},ko=e=>(e=>Io.test(e)||Mo.test(e))(e)?w.some({value:Po(e)}):w.none(),Eo=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},Bo=e=>(e=>({value:Po(e)}))(Eo(e.red)+Eo(e.green)+Eo(e.blue)),Fo=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,qo=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Lo=(e,t,o,l)=>({red:e,green:t,blue:o,alpha:l}),jo=(e,t,o,l)=>{const n=parseInt(e,10),r=parseInt(t,10),a=parseInt(o,10),s=parseFloat(l);return Lo(n,r,a,s)},Ho=e=>{if("transparent"===e)return w.some(Lo(0,0,0,0));const t=Fo.exec(e);if(null!==t)return w.some(jo(t[1],t[2],t[3],"1"));const o=qo.exec(e);return null!==o?w.some(jo(o[1],o[2],o[3],o[4])):w.none()},Vo=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},$o=()=>(e=>{const t=Vo(w.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(w.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(w.some(e))}}})((e=>e.unbind())),Wo=(e,t,o)=>l=>{const n=$o(),r=!je(o);const a=()=>{const a=Oo(e),s=l=>e.formatter.match(t,{value:o},l.dom,r);r?(l.setActive(!M(a,s)),n.set(e.formatter.formatChanged(t,(e=>l.setActive(!e)),!0))):(l.setActive(j(a,s)),n.set(e.formatter.formatChanged(t,l.setActive,!1,{value:o})))};return e.initialized?a():e.on("init",a),n.clear},zo=e=>O(e,"menu"),Uo=e=>k(e,(e=>{const t=e.text||e.title||"";return zo(e)?{text:t,items:Uo(e.menu)}:{text:t,value:e.value}})),Go=(e,t,o,l)=>k(t,(t=>{const n=t.text||t.title;return zo(t)?{type:"nestedmenuitem",text:n,getSubmenuItems:()=>Go(e,t.menu,o,l)}:{text:n,type:"togglemenuitem",onAction:()=>l(t.value),onSetup:Wo(e,o,t.value)}})),Ko=(e,t)=>o=>{e.execCommand("mceTableApplyCellStyle",!1,{[t]:o})},Jo=e=>L(e,(e=>zo(e)?[{...e,menu:Jo(e.menu)}]:je(e.value)?[e]:[])),Qo=(e,t,o,l)=>n=>n(Go(e,t,o,l)),Xo=(e,t,o)=>{const l=k(t,(e=>{return{text:e.title,value:"#"+(t=e.value,ko(t).orThunk((()=>Ho(t).map(Bo))).getOrThunk((()=>{const e=document.createElement("canvas");e.height=1,e.width=1;const o=e.getContext("2d");o.clearRect(0,0,e.width,e.height),o.fillStyle="#FFFFFF",o.fillStyle=t,o.fillRect(0,0,1,1);const l=o.getImageData(0,0,1,1).data,n=l[0],r=l[1],a=l[2],s=l[3];return Bo(Lo(n,r,a,s))}))).value,type:"choiceitem"};var t}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:l.length>0?l:void 0,allowCustomColors:!1},onAction:t=>{const l="remove"===t.value?"":t.value;e.execCommand("mceTableApplyCellStyle",!1,{[o]:l})}}]},Yo=e=>()=>{const t="header"===e.queryCommandValue("mceTableRowType")?"body":"header";e.execCommand("mceTableRowType",!1,{type:t})},Zo=e=>()=>{const t="th"===e.queryCommandValue("mceTableColType")?"td":"th";e.execCommand("mceTableColType",!1,{type:t})},el=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:No}],tl=e=>el.concat((e=>{const t=Uo(qt(e));return t.length>0?w.some({name:"class",type:"listbox",label:"Class",items:t}):w.none()})(e).toArray()),ol=(e,t)=>{const o=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Uo(It(e)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===t?[{name:"borderwidth",type:"input",label:"Border width"}].concat(o):o}},ll=(e,t)=>{const o=e.dom;return{setAttrib:(e,l)=>{o.setAttrib(t,e,l)},setStyle:(e,l)=>{o.setStyle(t,e,l)},setFormat:(o,l)=>{""===l?e.formatter.remove(o,{value:null},t,!0):e.formatter.apply(o,{value:l},t)}}},nl=le("th"),rl=(e,t)=>e&&t?"sectionCells":e?"section":"cells",al=e=>{const t=B(e,(e=>nl(e.element)));return 0===t.length?w.some("td"):t.length===e.length?w.some("th"):w.none()},sl=e=>{const t=k(e,(e=>(e=>{const t="thead"===e.section,o=Ee(al(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||o?{type:"header",subType:rl(t,o)}:{type:"body"}})(e).type)),o=I(t,"header"),l=I(t,"footer");if(o||l){const e=I(t,"body");return!o||e||l?o||e||!l?w.none():w.some("footer"):w.some("header")}return w.some("body")},cl=(e,t)=>V(e.all,(e=>q(e.cells,(e=>G(t,e.element))))),il=(e,t,o)=>{const l=(e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t})(k(t.selection,(t=>et(t).bind((t=>cl(e,t))).filter(o))));return n=l.length>0,r=l,n?w.some(r):w.none();var n,r},ml=(e,t)=>il(e,t,y),dl=(e,t)=>j(t,(t=>((e,t)=>cl(e,t).exists((e=>!e.isLocked)))(e,t))),ul=(e,t)=>((e,t)=>t.mergable)(0,t).filter((t=>dl(e,t.cells))),pl=(e,t)=>((e,t)=>t.unmergable)(0,t).filter((t=>dl(e,t))),bl=e=>{if(!n(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return E(e,((l,r)=>{const a=S(l);if(1!==a.length)throw new Error("one and only one name per case");const s=a[0],c=l[s];if(void 0!==o[s])throw new Error("duplicate key detected:"+s);if("cata"===s)throw new Error("cannot have a case named cata (sorry)");if(!n(c))throw new Error("case arguments must be an array");t.push(s),o[s]=(...o)=>{const l=o.length;if(l!==c.length)throw new Error("Wrong number of arguments to case "+s+". Expected "+c.length+" ("+c+"), got "+l);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const l=S(e);if(t.length!==l.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+l.join(","));if(!j(t,(e=>I(l,e))))throw new Error("Not all branches were specified when using match. Specified: "+l.join(", ")+"\nRequired: "+t.join(", "));return e[s].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:s,params:o})}}}})),o},gl=(bl([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),(e,t)=>{const o=mt(e);return ml(o,t).bind((e=>{const t=e[e.length-1],l=e[0].row,n=t.row+t.rowspan,r=o.all.slice(l,n);return sl(r)})).getOr("")}),hl=e=>{return Fe(e,"rgb")?Ho(t=e).map(Bo).map((e=>"#"+e.value)).getOr(t):e;var t},fl=e=>{const t=W.fromDom(e);return{borderwidth:Ue(t,"border-width").getOr(""),borderstyle:Ue(t,"border-style").getOr(""),bordercolor:Ue(t,"border-color").map(hl).getOr(""),backgroundcolor:Ue(t,"background-color").map(hl).getOr("")}},yl=e=>{const t=e[0],o=e.slice(1);return E(o,(e=>{E(S(t),(o=>{v(e,((e,l)=>{const n=t[o];""!==n&&o===l&&n!==e&&(t[o]="")}))}))})),t},wl=(e,t,o,l)=>q(e,(e=>!a(o.formatter.matchNode(l,t+e)))).getOr(""),Sl=g(wl,["left","center","right"],"align"),Cl=g(wl,["top","middle","bottom"],"valign"),vl=e=>tt(W.fromDom(e)).map((t=>{const o={selection:So(e.cells)};return gl(t,o)})).getOr(""),Tl=(e,t)=>{const o=mt(e),l=pt(o),n=B(l,(e=>M(t,(t=>G(e.element,t)))));return k(n,(e=>({element:e.element.dom,column:bt(o,e.column).map((e=>e.element.dom))})))},xl=(e,t,o,l)=>{const n=1===t.length;E(t,(t=>{const r=t.element,a=n?y:l,s=ll(e,r);((e,t,o,l)=>{l("scope")&&e.setAttrib("scope",o.scope),l("class")&&e.setAttrib("class",o.class),l("height")&&e.setStyle("height",xe(o.height)),l("width")&&t.setStyle("width",xe(o.width))})(s,t.column.map((t=>ll(e,t))).getOr(s),o,a),Mt(e)&&((e,t,o)=>{o("backgroundcolor")&&e.setFormat("tablecellbackgroundcolor",t.backgroundcolor),o("bordercolor")&&e.setFormat("tablecellbordercolor",t.bordercolor),o("borderstyle")&&e.setFormat("tablecellborderstyle",t.borderstyle),o("borderwidth")&&e.setFormat("tablecellborderwidth",xe(t.borderwidth))})(s,o,a),l("halign")&&ft(e,r,o.halign),l("valign")&&((e,t,o)=>{gt.each("top middle bottom".split(" "),(l=>{l!==o&&e.formatter.remove("valign"+l,{},t)})),o&&e.formatter.apply("valign"+o,{},t)})(e,r,o.valign)}))},Al=(e,t,o,l)=>{const n=l.getData();l.close(),e.undoManager.transact((()=>{((e,t,o,l)=>{const n=T(l,((e,t)=>o[t]!==e));A(n)>0&&t.length>=1&&tt(t[0]).each((o=>{const r=Tl(o,t),a=A(T(n,((e,t)=>"scope"!==t&&"celltype"!==t)))>0,s=_(n,"celltype");(a||_(n,"scope"))&&xl(e,r,l,g(_,n)),s&&((e,t)=>{e.execCommand("mceTableCellType",!1,{type:t.celltype,no_events:!0})})(e,l),yt(e,o.dom,{structure:s,style:a})}))})(e,t,o,n),e.focus()}))},Rl=(e,t)=>{const o=tt(t[0]).map((o=>k(Tl(o,t),(t=>((e,t,o,l)=>{const n=e.dom,r=(e,t)=>n.getStyle(e,t)||n.getAttrib(e,t);return{width:r(l.getOr(t),"width"),height:r(t,"height"),scope:n.getAttrib(t,"scope"),celltype:(a=t,a.nodeName.toLowerCase()),class:n.getAttrib(t,"class",""),halign:Sl(e,t),valign:Cl(e,t),...o?fl(t):{}};var a})(e,t.element,Mt(e),t.column)))));return yl(o.getOrDie())},_l=e=>{const t=Oo(e);if(0===t.length)return;const o=Rl(e,t),l={type:"tabpanel",tabs:[{title:"General",name:"general",items:tl(e)},ol(e,"cell")]},n={type:"panel",items:[{type:"grid",columns:2,items:tl(e)}]};e.windowManager.open({title:"Cell Properties",size:"normal",body:Mt(e)?l:n,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:g(Al,e,t,o)})},Ol=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Dl=e=>Ol.concat((e=>{const t=Uo(Lt(e));return t.length>0?w.some({name:"class",type:"listbox",label:"Class",items:t}):w.none()})(e).toArray()),Nl=(e,t,o,l)=>{const n=1===t.length?y:l;E(t,(t=>{const r=ll(e,t);((e,t,o)=>{o("class")&&e.setAttrib("class",t.class),o("height")&&e.setStyle("height",xe(t.height))})(r,o,n),Pt(e)&&((e,t,o)=>{o("backgroundcolor")&&e.setStyle("background-color",t.backgroundcolor),o("bordercolor")&&e.setStyle("border-color",t.bordercolor),o("borderstyle")&&e.setStyle("border-style",t.borderstyle)})(r,o,n),l("align")&&ft(e,t,o.align)}))},Il=(e,t,o,l)=>{const n=l.getData();l.close(),e.undoManager.transact((()=>{((e,t,o,l)=>{const n=T(l,((e,t)=>o[t]!==e));if(A(n)>0){const o=_(n,"type"),r=!o||A(n)>1;r&&Nl(e,t,l,g(_,n)),o&&((e,t)=>{e.execCommand("mceTableRowType",!1,{type:t.type,no_events:!0})})(e,l),tt(W.fromDom(t[0])).each((t=>yt(e,t.dom,{structure:o,style:r})))}})(e,t,o,n),e.focus()}))},Ml=e=>{const t=Do(Ae(e),xo.selected);if(0===t.length)return;const o=k(t,(t=>((e,t,o)=>{const l=e.dom;return{height:l.getStyle(t,"height")||l.getAttrib(t,"height"),class:l.getAttrib(t,"class",""),type:vl(t),align:Sl(e,t),...o?fl(t):{}}})(e,t.dom,Pt(e)))),l=yl(o),n={type:"tabpanel",tabs:[{title:"General",name:"general",items:Dl(e)},ol(e,"row")]},r={type:"panel",items:[{type:"grid",columns:2,items:Dl(e)}]};e.windowManager.open({title:"Row Properties",size:"normal",body:Pt(e)?n:r,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l,onSubmit:g(Il,e,k(t,(e=>e.dom)),l)})},Pl=(e,t,o)=>{const l=o?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],n=Et(e)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],r=t.length>0?[{type:"listbox",name:"class",label:"Class",items:t}]:[];return l.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(n).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(r)},kl=(e,t,o,n)=>{if("TD"===t.tagName||"TH"===t.tagName)l(o)&&c(n)?e.setStyle(t,o,n):e.setStyles(t,o);else if(t.children)for(let l=0;l<t.children.length;l++)kl(e,t.children[l],o,n)},El=(e,t,o,l)=>{const n=e.dom,r={},s={},c=Ft(e),i=kt(e);if(a(o.class)||(r.class=o.class),s.height=xe(o.height),c?s.width=xe(o.width):n.getAttrib(t,"width")&&(r.width=(e=>e?e.replace(/px$/,""):"")(o.width)),c?(s["border-width"]=xe(o.border),s["border-spacing"]=xe(o.cellspacing)):(r.border=o.border,r.cellpadding=o.cellpadding,r.cellspacing=o.cellspacing),c&&t.children){const e={};if(l.border&&(e["border-width"]=xe(o.border)),l.cellpadding&&(e.padding=xe(o.cellpadding)),i&&l.bordercolor&&(e["border-color"]=o.bordercolor),!(e=>{for(const t in e)if(C.call(e,t))return!1;return!0})(e))for(let o=0;o<t.children.length;o++)kl(n,t.children[o],e)}if(i){const e=o;s["background-color"]=e.backgroundcolor,s["border-color"]=e.bordercolor,s["border-style"]=e.borderstyle}n.setStyles(t,{...Ut(e),...s}),n.setAttribs(t,{...Gt(e),...r})},Bl=(e,t,o,l)=>{const n=e.dom,r=l.getData(),a=T(r,((e,t)=>o[t]!==e));l.close(),""===r.class&&delete r.class,e.undoManager.transact((()=>{if(!t){const o=He(r.cols).getOr(1),l=He(r.rows).getOr(1);e.execCommand("mceInsertTable",!1,{rows:l,columns:o}),t=_o(Ae(e),Te(e)).bind((t=>tt(t,Te(e)))).map((e=>e.dom)).getOrDie()}if(A(a)>0){const o={border:_(a,"border"),bordercolor:_(a,"bordercolor"),cellpadding:_(a,"cellpadding")};El(e,t,r,o);const l=n.select("caption",t)[0];(l&&!r.caption||!l&&r.caption)&&e.execCommand("mceTableToggleCaption"),ft(e,t,r.align)}if(e.focus(),e.addVisual(),A(a)>0){const o=_(a,"caption"),l=!o||A(a)>1;yt(e,t,{structure:o,style:l})}}))},Fl=(e,t)=>{const o=e.dom;let l,n=((e,t)=>{const o=Ut(e),l=Gt(e),n=t?{borderstyle:R(o,"border-style").getOr(""),bordercolor:hl(R(o,"border-color").getOr("")),backgroundcolor:hl(R(o,"background-color").getOr(""))}:{};return{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:"",...o,...l,...n,...(()=>{const t=o["border-width"];return Ft(e)&&t?{border:t}:R(l,"border").fold((()=>({})),(e=>({border:e})))})(),...{...R(o,"border-spacing").or(R(l,"cellspacing")).fold((()=>({})),(e=>({cellspacing:e}))),...R(o,"border-padding").or(R(l,"cellpadding")).fold((()=>({})),(e=>({cellpadding:e})))}}})(e,kt(e));t?(n.cols="1",n.rows="1",kt(e)&&(n.borderstyle="",n.bordercolor="",n.backgroundcolor="")):(l=o.getParent(e.selection.getStart(),"table",e.getBody()),l?n=((e,t,o)=>{const l=e.dom,n=Ft(e)?l.getStyle(t,"border-spacing")||l.getAttrib(t,"cellspacing"):l.getAttrib(t,"cellspacing")||l.getStyle(t,"border-spacing"),r=Ft(e)?ht(l,t,"padding")||l.getAttrib(t,"cellpadding"):l.getAttrib(t,"cellpadding")||ht(l,t,"padding");return{width:l.getStyle(t,"width")||l.getAttrib(t,"width"),height:l.getStyle(t,"height")||l.getAttrib(t,"height"),cellspacing:null!=n?n:"",cellpadding:null!=r?r:"",border:((t,o)=>{const l=Ue(W.fromDom(o),"border-width");return Ft(e)&&l.isSome()?l.getOr(""):t.getAttrib(o,"border")||ht(e.dom,o,"border-width")||ht(e.dom,o,"border")||""})(l,t),caption:!!l.select("caption",t)[0],class:l.getAttrib(t,"class",""),align:Sl(e,t),...o?fl(t):{}}})(e,l,kt(e)):kt(e)&&(n.borderstyle="",n.bordercolor="",n.backgroundcolor=""));const r=Uo(jt(e));r.length>0&&n.class&&(n.class=n.class.replace(/\s*mce\-item\-table\s*/g,""));const a={type:"grid",columns:2,items:Pl(e,r,t)},s=kt(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},ol(e,"table")]}:{type:"panel",items:[a]};e.windowManager.open({title:"Table Properties",size:"normal",body:s,onSubmit:g(Bl,e,l,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:n})},ql=e=>{v({mceTableProps:g(Fl,e,!1),mceTableRowProps:g(Ml,e),mceTableCellProps:g(_l,e),mceInsertTableDialog:g(Fl,e,!0)},((t,o)=>e.addCommand(o,(()=>{return o=t,void(Re(Ae(e))&&o());var o}))))},Ll=p,jl=e=>{const t=(e,t)=>Pe(e,t).exists((e=>parseInt(e,10)>1));return e.length>0&&j(e,(e=>t(e,"rowspan")||t(e,"colspan")))?w.some(e):w.none()},Hl=(e,t,o)=>t.length<=1?w.none():wo(e,o.firstSelectedSelector,o.lastSelectedSelector).map((e=>({bounds:e,cells:t}))),Vl=e=>{const t=Vo(w.none()),o=Vo([]);let l=w.none();const n=le("caption"),r=e=>l.forall((t=>!t[e])),a=()=>Ro((e=>W.fromDom(e.selection.getEnd()))(e),Te(e)),s=()=>Ro(Ae(e),Te(e)).bind((t=>{return o=Be(tt(t),a().bind(tt),((o,l)=>G(o,l)?n(t)?w.some((e=>({element:e,mergable:w.none(),unmergable:w.none(),selection:[e]}))(t)):w.some(((e,t,o)=>({element:o,mergable:Hl(t,e,xo),unmergable:jl(e),selection:Ll(e)}))(Oo(e),o,t)):w.none())),o.bind(p);var o})),c=e=>tt(e.element).map((t=>{const o=mt(t),l=ml(o,e).getOr([]),n=F(l,((e,t)=>(t.isLocked&&(e.onAny=!0,0===t.column?e.onFirst=!0:t.column+t.colspan>=o.grid.columns&&(e.onLast=!0)),e)),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:ul(o,e).isSome(),unmergeable:pl(o,e).isSome(),locked:n}})),i=()=>{t.set((e=>{let t,o=!1;return(...l)=>(o||(o=!0,t=e.apply(null,l)),t)})(s)()),l=t.get().bind(c),E(o.get(),h)},m=e=>(e(),o.set(o.get().concat([e])),()=>{o.set(B(o.get(),(t=>t!==e)))}),d=(o,l)=>m((()=>t.get().fold((()=>{o.setEnabled(!1)}),(t=>{o.setEnabled(!l(t)&&e.selection.isEditable())})))),u=(o,l,n)=>m((()=>t.get().fold((()=>{o.setEnabled(!1),o.setActive(!1)}),(t=>{o.setEnabled(!l(t)&&e.selection.isEditable()),o.setActive(n(t))})))),b=e=>l.exists((t=>t.locked[e])),g=(t,o)=>l=>u(l,(e=>n(e.element)),(()=>e.queryCommandValue(t)===o)),y=g("mceTableRowType","header"),S=g("mceTableColType","th");return e.on("NodeChange ExecCommand TableSelectorChange",i),{onSetupTable:e=>d(e,(e=>!1)),onSetupCellOrRow:e=>d(e,(e=>n(e.element))),onSetupColumn:e=>t=>d(t,(t=>n(t.element)||b(e))),onSetupPasteable:e=>t=>d(t,(t=>n(t.element)||e().isNone())),onSetupPasteableColumn:(e,t)=>o=>d(o,(o=>n(o.element)||e().isNone()||b(t))),onSetupMergeable:e=>d(e,(e=>r("mergeable"))),onSetupUnmergeable:e=>d(e,(e=>r("unmergeable"))),resetTargets:i,onSetupTableWithCaption:t=>u(t,f,(t=>tt(t.element,Te(e)).exists((e=>ye(e,"caption").isSome())))),onSetupTableRowHeaders:y,onSetupTableColumnHeaders:S,targets:t.get}};var $l=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Wl="x-tinymce/dom-table-",zl=Wl+"rows",Ul=Wl+"columns",Gl=e=>{var t;const o=null!==(t=$l.read())&&void 0!==t?t:[];return V(o,(t=>w.from(t.getType(e))))},Kl=()=>Gl(zl),Jl=()=>Gl(Ul),Ql=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}},Xl=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}},Yl=e=>{const t=Vl(e);(e=>{const t=e.options.register;t("table_border_widths",{processor:"object[]",default:xt}),t("table_border_styles",{processor:"object[]",default:At}),t("table_cell_advtab",{processor:"boolean",default:!0}),t("table_row_advtab",{processor:"boolean",default:!0}),t("table_advtab",{processor:"boolean",default:!0}),t("table_appearance_options",{processor:"boolean",default:!0}),t("table_grid",{processor:"boolean",default:!Tt.deviceType.isTouch()}),t("table_cell_class_list",{processor:"object[]",default:[]}),t("table_row_class_list",{processor:"object[]",default:[]}),t("table_class_list",{processor:"object[]",default:[]}),t("table_toolbar",{processor:"string",default:"tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol"}),t("table_background_color_map",{processor:"object[]",default:[]}),t("table_border_color_map",{processor:"object[]",default:[]})})(e),ql(e),((e,t)=>{const o=t=>()=>e.execCommand(t),l=(t,l)=>!!e.queryCommandSupported(l.command)&&(e.ui.registry.addMenuItem(t,{...l,onAction:i(l.onAction)?l.onAction:o(l.command)}),!0),n=(t,l)=>{e.queryCommandSupported(l.command)&&e.ui.registry.addToggleMenuItem(t,{...l,onAction:i(l.onAction)?l.onAction:o(l.command)})},r=t=>{e.execCommand("mceInsertTable",!1,{rows:t.numRows,columns:t.numColumns})},a=[l("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:t.onSetupCellOrRow}),l("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:t.onSetupCellOrRow}),l("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:t.onSetupCellOrRow}),l("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:t.onSetupCellOrRow}),l("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:t.onSetupCellOrRow}),l("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:t.onSetupCellOrRow}),l("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:t.onSetupPasteable(Kl)}),l("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:t.onSetupPasteable(Kl)})],s=[l("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:t.onSetupColumn("onFirst")}),l("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:t.onSetupColumn("onLast")}),l("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:t.onSetupColumn("onAny")}),l("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:t.onSetupColumn("onAny")}),l("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:t.onSetupColumn("onAny")}),l("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:t.onSetupPasteableColumn(Jl,"onFirst")}),l("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:t.onSetupPasteableColumn(Jl,"onLast")})],c=[l("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:t.onSetupCellOrRow}),l("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:t.onSetupMergeable}),l("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:t.onSetupUnmergeable})];Bt(e)?e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:r}],onSetup:Xl(e)}):e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:Xl(e)}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:Xl(e)}),l("tableprops",{text:"Table properties",onSetup:t.onSetupTable,command:"mceTableProps"}),l("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:t.onSetupTable,command:"mceTableDelete"}),I(a,!0)&&e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:u("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),I(s,!0)&&e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:u("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),I(c,!0)&&e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:u("tablecellprops tablemergecells tablesplitcells")}),e.ui.registry.addContextMenu("table",{update:()=>(t.resetTargets(),t.targets().fold(u(""),(e=>"caption"===J(e.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable")))});const m=Jo(jt(e));0!==m.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Go(e,m,"tableclass",(t=>e.execCommand("mceTableToggleClass",!1,t))),onSetup:t.onSetupTable});const d=Jo(qt(e));0!==d.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Go(e,d,"tablecellclass",(t=>e.execCommand("mceTableCellToggleClass",!1,t))),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Go(e,No,"tablecellverticalalign",Ko(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Go(e,Nt(e),"tablecellborderwidth",Ko(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Go(e,It(e),"tablecellborderstyle",Ko(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>Xo(e,Vt(e),"background-color"),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>Xo(e,$t(e),"border-color"),onSetup:t.onSetupCellOrRow})),n("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),n("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Yo(e),onSetup:t.onSetupTableRowHeaders}),n("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Zo(e),onSetup:t.onSetupTableRowHeaders})})(e,t),((e,t)=>{e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:Ql(e),fetch:e=>e("inserttable | cell row column | advtablesort | tableprops deletetable")});const o=t=>()=>e.execCommand(t),l=(t,l)=>{e.queryCommandSupported(l.command)&&e.ui.registry.addButton(t,{...l,onAction:i(l.onAction)?l.onAction:o(l.command)})},n=(t,l)=>{e.queryCommandSupported(l.command)&&e.ui.registry.addToggleButton(t,{...l,onAction:i(l.onAction)?l.onAction:o(l.command)})};l("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:t.onSetupTable}),l("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:t.onSetupTable}),l("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:t.onSetupCellOrRow}),l("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:t.onSetupMergeable}),l("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:t.onSetupUnmergeable}),l("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:t.onSetupCellOrRow}),l("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:t.onSetupCellOrRow}),l("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:t.onSetupCellOrRow}),l("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:t.onSetupCellOrRow}),l("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:t.onSetupColumn("onFirst")}),l("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:t.onSetupColumn("onLast")}),l("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:t.onSetupColumn("onAny")}),l("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:t.onSetupCellOrRow}),l("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:t.onSetupCellOrRow}),l("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:t.onSetupPasteable(Kl)}),l("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:t.onSetupPasteable(Kl)}),l("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:t.onSetupColumn("onAny")}),l("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:t.onSetupColumn("onAny")}),l("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:t.onSetupPasteableColumn(Jl,"onFirst")}),l("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:t.onSetupPasteableColumn(Jl,"onLast")}),l("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:Ql(e)});const r=Jo(jt(e));0!==r.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Qo(e,r,"tableclass",(t=>e.execCommand("mceTableToggleClass",!1,t))),onSetup:t.onSetupTable});const a=Jo(qt(e));0!==a.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Qo(e,a,"tablecellclass",(t=>e.execCommand("mceTableCellToggleClass",!1,t))),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Qo(e,No,"tablecellverticalalign",Ko(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Qo(e,Nt(e),"tablecellborderwidth",Ko(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Qo(e,It(e),"tablecellborderstyle",Ko(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:t=>t(Xo(e,Vt(e),"background-color")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:t=>t(Xo(e,$t(e),"border-color")),onSetup:t.onSetupCellOrRow})),n("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),n("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Yo(e),onSetup:t.onSetupTableRowHeaders}),n("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Zo(e),onSetup:t.onSetupTableColumnHeaders})})(e,t),(e=>{const t=t=>e.dom.is(t,"table")&&e.getBody().contains(t)&&e.dom.isEditable(t.parentNode),o=Ht(e);o.length>0&&e.ui.registry.addContextToolbar("table",{predicate:t,items:o,scope:"node",position:"node"})})(e)};e.add("table",Yl)}()),e}export{o as __require};
2
+ //# sourceMappingURL=plugin.mjs.map