@lotte-innovate/ui-component-test 0.0.113 → 0.0.114

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/dist/lib/_virtual/index.mjs +1 -1
  2. package/dist/lib/_virtual/index11.mjs +1 -1
  3. package/dist/lib/_virtual/index13.mjs +1 -1
  4. package/dist/lib/_virtual/index3.mjs +1 -1
  5. package/dist/lib/lib/components/Editor/index.mjs +1 -1
  6. package/dist/lib/public/tinymce/icons/default/icons.mjs +2 -1
  7. package/dist/lib/public/tinymce/icons/default/icons.mjs.map +1 -1
  8. package/dist/lib/public/tinymce/models/dom/index.mjs +1 -1
  9. package/dist/lib/public/tinymce/plugins/advlist/plugin.mjs +1 -1
  10. package/dist/lib/public/tinymce/plugins/code/index.mjs +1 -1
  11. package/dist/lib/public/tinymce/plugins/code/index.mjs.map +1 -1
  12. package/dist/lib/public/tinymce/plugins/code/plugin.mjs +1 -1
  13. package/dist/lib/public/tinymce/plugins/code/plugin.mjs.map +1 -1
  14. package/dist/lib/public/tinymce/plugins/link/index.mjs +1 -1
  15. package/dist/lib/public/tinymce/plugins/link/plugin.mjs +1 -1
  16. package/dist/lib/public/tinymce/plugins/link/plugin.mjs.map +1 -1
  17. package/dist/lib/public/tinymce/plugins/lists/plugin.mjs +1 -1
  18. package/dist/lib/public/tinymce/plugins/table/plugin.mjs +1 -1
  19. package/dist/lib/public/tinymce/themes/silver/index.mjs +1 -1
  20. package/dist/public/tinymce/icons/default/index.js +1 -2
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +1 -2
  23. package/dist/lib/_virtual/icons.mjs +0 -2
  24. package/dist/lib/_virtual/icons.mjs.map +0 -1
  25. package/dist/lib/_virtual/index15.mjs +0 -2
  26. package/dist/lib/_virtual/index15.mjs.map +0 -1
  27. package/dist/lib/_virtual/index16.mjs +0 -2
  28. package/dist/lib/_virtual/index16.mjs.map +0 -1
  29. package/dist/lib/public/tinymce/icons/default/index.mjs +0 -2
  30. package/dist/lib/public/tinymce/icons/default/index.mjs.map +0 -1
  31. package/public/tinymce/CHANGELOG.md +0 -3453
  32. package/public/tinymce/README.md +0 -73
  33. package/public/tinymce/bower.json +0 -27
  34. package/public/tinymce/composer.json +0 -52
  35. package/public/tinymce/icons/default/icons.js +0 -194
  36. package/public/tinymce/icons/default/icons.min.js +0 -1
  37. package/public/tinymce/icons/default/index.js +0 -7
  38. package/public/tinymce/license.txt +0 -21
  39. package/public/tinymce/models/dom/index.js +0 -7
  40. package/public/tinymce/models/dom/model.js +0 -8040
  41. package/public/tinymce/models/dom/model.min.js +0 -4
  42. package/public/tinymce/package.json +0 -32
  43. package/public/tinymce/plugins/advlist/index.js +0 -7
  44. package/public/tinymce/plugins/advlist/plugin.js +0 -259
  45. package/public/tinymce/plugins/advlist/plugin.min.js +0 -4
  46. package/public/tinymce/plugins/autolink/index.js +0 -7
  47. package/public/tinymce/plugins/autolink/plugin.js +0 -228
  48. package/public/tinymce/plugins/autolink/plugin.min.js +0 -4
  49. package/public/tinymce/plugins/code/index.js +0 -7
  50. package/public/tinymce/plugins/code/plugin.js +0 -85
  51. package/public/tinymce/plugins/code/plugin.min.js +0 -4
  52. package/public/tinymce/plugins/codesample/index.js +0 -7
  53. package/public/tinymce/plugins/codesample/plugin.js +0 -2463
  54. package/public/tinymce/plugins/codesample/plugin.min.js +0 -4
  55. package/public/tinymce/plugins/image/index.js +0 -7
  56. package/public/tinymce/plugins/image/plugin.js +0 -1505
  57. package/public/tinymce/plugins/image/plugin.min.js +0 -4
  58. package/public/tinymce/plugins/link/index.js +0 -7
  59. package/public/tinymce/plugins/link/plugin.js +0 -1242
  60. package/public/tinymce/plugins/link/plugin.min.js +0 -4
  61. package/public/tinymce/plugins/lists/index.js +0 -7
  62. package/public/tinymce/plugins/lists/plugin.js +0 -2172
  63. package/public/tinymce/plugins/lists/plugin.min.js +0 -4
  64. package/public/tinymce/plugins/table/index.js +0 -7
  65. package/public/tinymce/plugins/table/plugin.js +0 -3462
  66. package/public/tinymce/plugins/table/plugin.min.js +0 -4
  67. package/public/tinymce/skins/content/default/content.css +0 -61
  68. package/public/tinymce/skins/content/default/content.js +0 -2
  69. package/public/tinymce/skins/content/default/content.min.css +0 -1
  70. package/public/tinymce/skins/ui/oxide/content.css +0 -785
  71. package/public/tinymce/skins/ui/oxide/content.inline.css +0 -779
  72. package/public/tinymce/skins/ui/oxide/content.inline.js +0 -2
  73. package/public/tinymce/skins/ui/oxide/content.inline.min.css +0 -1
  74. package/public/tinymce/skins/ui/oxide/content.js +0 -2
  75. package/public/tinymce/skins/ui/oxide/content.min.css +0 -1
  76. package/public/tinymce/skins/ui/oxide/skin.css +0 -3763
  77. package/public/tinymce/skins/ui/oxide/skin.js +0 -2
  78. package/public/tinymce/skins/ui/oxide/skin.min.css +0 -1
  79. package/public/tinymce/skins/ui/oxide/skin.shadowdom.css +0 -30
  80. package/public/tinymce/skins/ui/oxide/skin.shadowdom.js +0 -2
  81. package/public/tinymce/skins/ui/oxide/skin.shadowdom.min.css +0 -1
  82. package/public/tinymce/skins/ui/oxide-dark/content.css +0 -766
  83. package/public/tinymce/skins/ui/oxide-dark/content.inline.css +0 -779
  84. package/public/tinymce/skins/ui/oxide-dark/content.inline.js +0 -2
  85. package/public/tinymce/skins/ui/oxide-dark/content.inline.min.css +0 -1
  86. package/public/tinymce/skins/ui/oxide-dark/content.js +0 -2
  87. package/public/tinymce/skins/ui/oxide-dark/content.min.css +0 -1
  88. package/public/tinymce/skins/ui/oxide-dark/skin.css +0 -3766
  89. package/public/tinymce/skins/ui/oxide-dark/skin.js +0 -2
  90. package/public/tinymce/skins/ui/oxide-dark/skin.min.css +0 -1
  91. package/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +0 -30
  92. package/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +0 -2
  93. package/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +0 -1
  94. package/public/tinymce/themes/silver/index.js +0 -7
  95. package/public/tinymce/themes/silver/theme.js +0 -30775
  96. package/public/tinymce/themes/silver/theme.min.js +0 -384
  97. package/public/tinymce/tinymce.d.ts +0 -3238
  98. package/public/tinymce/tinymce.js +0 -31779
  99. package/public/tinymce/tinymce.min.js +0 -384
@@ -1,2 +1,2 @@
1
- import{__exports as t}from"../../../../_virtual/plugin3.mjs";var n;function e(){if(n)return t;n=1;var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},e.apply(this,arguments)},r=t&&t.__spreadArray||function(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))};return function(){var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return function(n){return u=typeof(e=n),(null===e?"null":"object"===u&&Array.isArray(e)?"array":"object"===u&&(a=r=e,(o=String).prototype.isPrototypeOf(a)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===o.name)?"string":u)===t;var e,r,o,i,u,a}},o=function(t){return function(n){return typeof n===t}},i=n("string"),u=n("object"),a=n("array"),c=o("boolean"),s=function(t){return!function(t){return null==t}(t)},f=o("function"),l=o("number"),d=function(){},m=function(t){return function(){return t}},p=function(t,n){return t===n};var v=function(t){return function(n){return!t(n)}},g=m(!1),h=function(){function t(t,n){this.tag=t,this.value=n}return t.some=function(n){return new t(!0,n)},t.none=function(){return t.singletonNone},t.prototype.fold=function(t,n){return this.tag?n(this.value):t()},t.prototype.isSome=function(){return this.tag},t.prototype.isNone=function(){return!this.tag},t.prototype.map=function(n){return this.tag?t.some(n(this.value)):t.none()},t.prototype.bind=function(n){return this.tag?n(this.value):t.none()},t.prototype.exists=function(t){return this.tag&&t(this.value)},t.prototype.forall=function(t){return!this.tag||t(this.value)},t.prototype.filter=function(n){return!this.tag||n(this.value)?this:t.none()},t.prototype.getOr=function(t){return this.tag?this.value:t},t.prototype.or=function(t){return this.tag?this:t},t.prototype.getOrThunk=function(t){return this.tag?this.value:t()},t.prototype.orThunk=function(t){return this.tag?this:t()},t.prototype.getOrDie=function(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")},t.from=function(n){return s(n)?t.some(n):t.none()},t.prototype.getOrNull=function(){return this.tag?this.value:null},t.prototype.getOrUndefined=function(){return this.value},t.prototype.each=function(t){this.tag&&t(this.value)},t.prototype.toArray=function(){return this.tag?[this.value]:[]},t.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},t}();h.singletonNone=new h(!1);var y,C=Array.prototype.slice,b=Array.prototype.indexOf,N=Array.prototype.push,S=function(t,n){return e=t,r=n,b.call(e,r)>-1;var e,r},L=function(t,n){for(var e=0,r=t.length;e<r;e++){if(n(t[e],e))return!0}return!1},D=function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r},O=function(t,n){for(var e=0,r=t.length;e<r;e++){n(t[e],e)}},T=function(t,n){for(var e=[],r=0,o=t.length;r<o;r++){var i=t[r];n(i,r)&&e.push(i)}return e},A=function(t,n,e){return O(t,(function(t,r){e=n(e,t,r)})),e},x=function(t,n,e){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(n(i,r))return h.some(i);if(e(i,r))break}return h.none()},w=function(t,n){return x(t,n,g)},E=function(t,n){return function(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!a(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);N.apply(n,t[e])}return n}(D(t,n))},k=function(t){var n=C.call(t,0);return n.reverse(),n},B=function(t,n){return n>=0&&n<t.length?h.some(t[n]):h.none()},P=function(t){return B(t,0)},M=function(t){return B(t,t.length-1)},I=function(t,n){for(var e=[],r=f(n)?function(t){return L(e,(function(e){return n(e,t)}))}:function(t){return S(e,t)},o=0,i=t.length;o<i;o++){var u=t[o];r(u)||e.push(u)}return e},R=function(t,n,e){return void 0===e&&(e=p),t.exists((function(t){return e(t,n)}))},_=function(t,n,e){return t.isSome()&&n.isSome()?h.some(e(t.getOrDie(),n.getOrDie())):h.none()},U=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},H={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||e.childNodes.length>1){var r="HTML does not have a single root node";throw console.error(r,t),new Error(r)}return U(e.childNodes[0])},fromTag:function(t,n){var e=(n||document).createElement(t);return U(e)},fromText:function(t,n){var e=(n||document).createTextNode(t);return U(e)},fromDom:U,fromPoint:function(t,n,e){return h.from(t.dom.elementFromPoint(n,e)).map(U)}},$=function(t,n){var e=t.dom;if(1!==e.nodeType)return!1;var r=e;if(void 0!==r.matches)return r.matches(n);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(n);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(n);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},j=function(t,n){return t.dom===n.dom},F=$,V="undefined"!=typeof window?window:Function("return this;")(),K=function(t,n){return function(t,n){for(var e=null!=n?n:V,r=0;r<t.length&&null!=e;++r)e=e[t[r]];return e}(t.split("."),n)},z=function(t,n){var e=function(t,n){return K(t,n)}(t,n);if(null==e)throw new Error(t+" not available on this browser");return e},Q=Object.getPrototypeOf,W=function(t){var n=K("ownerDocument.defaultView",t);return u(t)&&(function(t){return z("HTMLElement",t)}(n).prototype.isPrototypeOf(t)||/^HTML\w*Element$/.test(Q(t).constructor.name))},q=function(t){return t.dom.nodeName.toLowerCase()},Z=function(t){return t.dom.nodeType},G=function(t){return function(n){return Z(n)===t}},J=function(t){return X(t)&&W(t.dom)},X=G(1),Y=G(3),tt=G(9),nt=G(11),et=function(t){return function(n){return X(n)&&q(n)===t}},rt=function(t){return h.from(t.dom.parentNode).map(H.fromDom)},ot=function(t){return D(t.dom.childNodes,H.fromDom)},it=function(t,n){var e=t.dom.childNodes;return h.from(e[n]).map(H.fromDom)},ut=function(t){return it(t,0)},at=function(t){return it(t,t.dom.childNodes.length-1)},ct=f(Element.prototype.attachShadow)&&f(Node.prototype.getRootNode),st=ct?function(t){return H.fromDom(t.dom.getRootNode())}:function(t){return tt(t)?t:(n=t,H.fromDom(n.dom.ownerDocument));var n},ft=function(t){var n,e=st(t);return nt(n=e)&&s(n.dom.host)?h.some(e):h.none()},lt=function(t){return H.fromDom(t.dom.host)},dt=function(t){var n=Y(t)?t.dom.parentNode:t.dom;if(null==n||null===n.ownerDocument)return!1;var e,r,o=n.ownerDocument;return ft(H.fromDom(n)).fold((function(){return o.body.contains(n)}),(e=dt,r=lt,function(t){return e(r(t))}))},mt=function(t,n,e,r,o){return t(e,r)?h.some(e):f(o)&&o(e)?h.none():n(e,r,o)},pt=function(t,n,e){for(var r=t.dom,o=f(e)?e:g;r.parentNode;){r=r.parentNode;var i=H.fromDom(r);if(n(i))return h.some(i);if(o(i))break}return h.none()},vt=function(t,n,e){return mt((function(t,n){return n(t)}),pt,t,n,e)},gt=function(t,n,e){return pt(t,(function(t){return $(t,n)}),e)},ht=function(t){return mt((function(t,n){return $(t,n)}),gt,t,"[contenteditable]",n);var n},yt=function(t){return t.dom.contentEditable},Ct=function(t,n){rt(t).each((function(e){e.dom.insertBefore(n.dom,t.dom)}))},bt=function(t,n){var e=function(t){return h.from(t.dom.nextSibling).map(H.fromDom)}(t);e.fold((function(){rt(t).each((function(t){Nt(t,n)}))}),(function(t){Ct(t,n)}))},Nt=function(t,n){t.dom.appendChild(n.dom)},St=function(t,n){O(n,(function(n){Nt(t,n)}))},Lt=function(t){t.dom.textContent="",O(ot(t),(function(t){Dt(t)}))},Dt=function(t){var n=t.dom;null!==n.parentNode&&n.parentNode.removeChild(n)},Ot=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Tt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),At=tinymce.util.Tools.resolve("tinymce.util.VK"),xt=function(t){return D(t,H.fromDom)},wt=Object.keys,Et=function(t,n){for(var e=wt(t),r=0,o=e.length;r<o;r++){var i=e[r];n(t[i],i)}},kt=function(t,n){var e,r={};return function(t,n,e,r){Et(t,(function(t,o){(n(t,o)?e:r)(t,o)}))}(t,n,(e=r,function(t,n){e[n]=t}),d),r},Bt=function(t,n){var e=t.dom;Et(n,(function(t,n){!function(t,n,e){if(!(i(e)||c(e)||l(e)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")}(e,n,t)}))},Pt=function(t){return A(t.dom.attributes,(function(t,n){return t[n.name]=n.value,t}),{})},Mt=function(t){return function(t,n){return H.fromDom(t.dom.cloneNode(n))}(t,!0)},It=function(t,n){var e=function(t,n){var e=H.fromTag(n),r=Pt(t);return Bt(e,r),e}(t,n);bt(t,e);var r=ot(t);return St(e,r),Dt(t),e},Rt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),_t=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ut=function(t){return function(n){return s(n)&&n.nodeName.toLowerCase()===t}},Ht=function(t){return function(n){return s(n)&&t.test(n.nodeName)}},$t=function(t){return s(t)&&3===t.nodeType},jt=function(t){return s(t)&&1===t.nodeType},Ft=Ht(/^(OL|UL|DL)$/),Vt=Ht(/^(OL|UL)$/),Kt=Ut("ol"),zt=Ht(/^(LI|DT|DD)$/),Qt=Ht(/^(DT|DD)$/),Wt=Ht(/^(TH|TD)$/),qt=Ut("br"),Zt=function(t,n){return s(n)&&n.nodeName in t.schema.getTextBlockElements()},Gt=function(t,n){return s(t)&&t.nodeName in n},Jt=function(t,n){return s(n)&&n.nodeName in t.schema.getVoidElements()},Xt=function(t,n,e){var r=t.isEmpty(n);return!(e&&t.select("span[data-mce-type=bookmark]",n).length>0)&&r},Yt=function(t,n){return t.isChildOf(n,t.getRoot())},tn=function(t){return function(n){return n.options.get(t)}},nn=tn("lists_indent_on_tab"),en=tn("forced_root_block"),rn=tn("forced_root_block_attrs"),on=function(t,n){var e,r,o=t.dom,i=t.schema.getBlockElements(),u=o.createFragment(),a=en(t),c=rn(t),s=!1;for(r=o.create(a,c),Gt(n.firstChild,i)||u.appendChild(r);e=n.firstChild;){var f=e.nodeName;s||"SPAN"===f&&"bookmark"===e.getAttribute("data-mce-type")||(s=!0),Gt(e,i)?(u.appendChild(e),r=null):(r||(r=o.create(a,c),u.appendChild(r)),r.appendChild(e))}return!s&&r&&r.appendChild(o.create("br",{"data-mce-bogus":"1"})),u},un=Rt.DOM,an=et("dd"),cn=et("dt"),sn=function(t,n){var e;an(n)?It(n,"dt"):cn(n)&&(e=n,h.from(e.dom.parentElement).map(H.fromDom)).each((function(e){return function(t,n,e){var r=un.select('span[data-mce-type="bookmark"]',n),o=on(t,e),i=un.createRng();i.setStartAfter(e),i.setEndAfter(n);for(var u=i.extractContents(),a=u.firstChild;a;a=a.firstChild)if("LI"===a.nodeName&&t.dom.isEmpty(a)){un.remove(a);break}t.dom.isEmpty(u)||un.insertAfter(u,n),un.insertAfter(o,n);var c=e.parentElement;c&&Xt(t.dom,c)&&function(t){var n=t.parentNode;n&&_t.each(r,(function(t){n.insertBefore(t,e.parentNode)})),un.remove(t)}(c),un.remove(e),Xt(t.dom,n)&&un.remove(n)}(t,e.dom,n.dom)}))},fn=function(t){cn(t)&&It(t,"dd")},ln=function(t,n){if($t(t))return{container:t,offset:n};var e=Ot.getNode(t,n);return $t(e)?{container:e,offset:n>=t.childNodes.length?e.data.length:0}:e.previousSibling&&$t(e.previousSibling)?{container:e.previousSibling,offset:e.previousSibling.data.length}:e.nextSibling&&$t(e.nextSibling)?{container:e.nextSibling,offset:0}:{container:t,offset:n}},dn=function(t){var n=t.cloneRange(),e=ln(t.startContainer,t.startOffset);n.setStart(e.container,e.offset);var r=ln(t.endContainer,t.endOffset);return n.setEnd(r.container,r.offset),n},mn=["OL","UL","DL"],pn=mn.join(","),vn=function(t,n){var e=n||t.selection.getStart(!0);return t.dom.getParent(e,pn,Cn(t,e))},gn=function(t){var n=vn(t),e=t.selection.getSelectedBlocks();return function(t,n){return s(t)&&1===n.length&&n[0]===t}(n,e)?function(t){return T(t.querySelectorAll(pn),Ft)}(n):T(e,(function(t){return Ft(t)&&n!==t}))},hn=function(t){var n=t.selection.getSelectedBlocks();return T(function(t,n){var e=_t.map(n,(function(n){return t.dom.getParent(n,"li,dd,dt",Cn(t,n))||n}));return I(e)}(t,n),zt)},yn=function(t,n){var e=t.dom.getParents(n,"TD,TH");return e.length>0?e[0]:t.getBody()},Cn=function(t,n){var e=t.dom.getParents(n,t.dom.isBlock),r=w(e,(function(n){return e=t.schema,!Ft(r=n)&&!zt(r)&&L(mn,(function(t){return e.isValidChild(r.nodeName,t)}));var e,r}));return r.getOr(t.getBody())},bn=function(t,n){var e=t.dom.getParents(n,"ol,ul",Cn(t,n));return M(e)},Nn=function(t){var n=function(t){var n=bn(t,t.selection.getStart()),e=T(t.selection.getSelectedBlocks(),Vt);return n.toArray().concat(e)}(t),e=function(t){var n=t.selection.getStart();return t.dom.getParents(n,"ol,ul",Cn(t,n))}(t);return w(e,(function(t){return n=H.fromDom(t),rt(n).exists((function(t){return zt(t.dom)&&ut(t).exists((function(t){return!Ft(t.dom)}))&&at(t).exists((function(t){return!Ft(t.dom)}))}));var n})).fold((function(){return Sn(t,n)}),(function(t){return[t]}))},Sn=function(t,n){var e=D(n,(function(n){return bn(t,n).getOr(n)}));return I(e)},Ln=function(t){return/\btox\-/.test(t.className)},Dn=function(t,n){return x(t,Ft,Wt).exists((function(t){return t.nodeName===n&&!Ln(t)}))},On=function(t,n){return null!==n&&!t.dom.isEditable(n)},Tn=function(t,n){var e=t.dom.getParent(n,"ol,ul,dl");return On(t,e)},An=function(t,n){var e=t.selection.getNode();return n({parents:t.dom.getParents(e),element:e}),t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},xn=function(t,n){var e=(n||document).createDocumentFragment();return O(t,(function(t){e.appendChild(t.dom)})),H.fromDom(e)},wn=function(t,n,e){return t.dispatch("ListMutation",{action:n,element:e})},En=(y=/^\s+|\s+$/g,function(t){return t.replace(y,"")}),kn=function(t,n,e){if(!i(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);(function(t){return void 0!==t.style&&f(t.style.getPropertyValue)})(t)&&t.style.setProperty(n,e)},Bn=function(t){return F(t,"OL,UL")},Pn=function(t){return ut(t).exists(Bn)},Mn=function(t){return"listAttributes"in t},In=function(t){return"isComment"in t},Rn=function(t){return t.depth>0},_n=function(t){return t.isSelected},Un=function(t){var n=ot(t),e=at(t).exists(Bn)?n.slice(0,-1):n;return D(e,Mt)},Hn=function(t,n){Nt(t.item,n.list)},$n=function(t,n){var e={list:H.fromTag(n,t),item:H.fromTag("li",t)};return Nt(e.list,e.item),e},jn=function(t,n,e){var r=n.slice(0,e.depth);return M(r).each((function(n){if(Mn(e)){var r=function(t,n,e){var r=H.fromTag("li",t);return Bt(r,n),St(r,e),r}(t,e.itemAttributes,e.content);!function(t,n){Nt(t.list,n),t.item=n}(n,r),function(t,n){q(t.list)!==n.listType&&(t.list=It(t.list,n.listType)),Bt(t.list,n.listAttributes)}(n,e)}else if(function(t){return"isFragment"in t}(e))St(n.item,e.content);else{r=H.fromHtml("\x3c!--".concat(e.content,"--\x3e"));Nt(n.list,r)}})),r},Fn=function(t,n,e){var r,o=function(t,n,e){for(var r=[],o=0;o<e;o++)r.push($n(t,Mn(n)?n.listType:n.parentListType));return r}(t,e,e.depth-n.length);return function(t){for(var n=1;n<t.length;n++)Hn(t[n-1],t[n])}(o),function(t,n){for(var e=0;e<t.length-1;e++)r=t[e].item,o="list-style-type",i="none",u=void 0,u=r.dom,kn(u,o,i);var r,o,i,u;M(t).each((function(t){Mn(n)&&(Bt(t.list,n.listAttributes),Bt(t.item,n.itemAttributes)),St(t.item,n.content)}))}(o,e),r=o,_(M(n),P(r),Hn),n.concat(o)},Vn=function(t,n){var e=h.none(),r=A(n,(function(n,r,o){return In(r)?0===o?(e=h.some(r),n):jn(t,n,r):r.depth>n.length?Fn(t,n,r):jn(t,n,r)}),[]);return e.each((function(t){var n=H.fromHtml("\x3c!--".concat(t.content,"--\x3e"));P(r).each((function(t){!function(t,n){ut(t).fold((function(){Nt(t,n)}),(function(e){t.dom.insertBefore(n.dom,e.dom)}))}(t.list,n)}))})),P(r).map((function(t){return t.list}))},Kn=function(t){return O(t,(function(n,r){(function(t,n){var e=t[n].depth,r=function(t){return t.depth===e&&!t.dirty},o=function(t){return t.depth<e};return x(k(t.slice(0,n)),r,o).orThunk((function(){return x(t.slice(n+1),r,o)}))})(t,r).fold((function(){n.dirty&&Mn(n)&&function(t){t.listAttributes=kt(t.listAttributes,(function(t,n){return"start"!==n}))}(n)}),(function(t){return o=t,void(Mn(r=n)&&Mn(o)&&(r.listType=o.listType,r.listAttributes=e({},o.listAttributes)));var r,o}))})),t},zn=function(t,n,e,r){var o,i;if(8===Z(i=r)||"#comment"===q(i))return[{depth:t+1,content:null!==(o=r.dom.nodeValue)&&void 0!==o?o:"",dirty:!1,isSelected:!1,isComment:!0}];n.each((function(t){j(t.start,r)&&e.set(!0)}));var u=function(t,n,e){return rt(t).filter(X).map((function(r){return{depth:n,dirty:!1,isSelected:e,content:Un(t),itemAttributes:Pt(t),listAttributes:Pt(r),listType:q(r),isInPreviousLi:!1}}))}(r,t,e.get());n.each((function(t){j(t.end,r)&&e.set(!1)}));var a=at(r).filter(Bn).map((function(r){return Wn(t,n,e,r)})).getOr([]);return u.toArray().concat(a)},Qn=function(t,n,e,r){return ut(r).filter(Bn).fold((function(){return zn(t,n,e,r)}),(function(o){var i=A(ot(r),(function(r,i,u){if(0===u)return r;if(F(i,"LI"))return r.concat(zn(t,n,e,i));var a={isFragment:!0,depth:t,content:[i],isSelected:!1,dirty:!1,parentListType:q(o)};return r.concat(a)}),[]);return Wn(t,n,e,o).concat(i)}))},Wn=function(t,n,e,r){return E(ot(r),(function(r){return(Bn(r)?Wn:Qn)(t+1,n,e,r)}))},qn=function(t,n){return E(function(t,n){if(0===t.length)return[];for(var e=n(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=n(a);c!==e&&(r.push(o),o=[]),e=c,o.push(a)}return 0!==o.length&&r.push(o),r}(n,Rn),(function(n){return P(n).exists(Rn)?function(t,n){var e=Kn(n);return Vn(t.contentDocument,e).toArray()}(t,n):function(t,n){var e=Kn(n);return D(e,(function(n){var e=In(n)?xn([H.fromHtml("\x3c!--".concat(n.content,"--\x3e"))]):xn(n.content);return H.fromDom(on(t,e.dom))}))}(t,n)}))},Zn=function(t,n,e){var r=function(t,n){var e,r=(e=!1,{get:function(){return e},set:function(t){e=t}});return D(t,(function(t){return{sourceList:t,entries:Wn(0,n,r,t)}}))}(n,function(t){var n=D(hn(t),H.fromDom);return _(w(n,v(Pn)),w(k(n),v(Pn)),(function(t,n){return{start:t,end:n}}))}(t));O(r,(function(n){!function(t,n){O(T(t,_n),(function(t){return function(t,n){switch(t){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}n.dirty=!0}(n,t)}))}(n.entries,e);var r,o=qn(t,n.entries);O(o,(function(n){wn(t,"Indent"===e?"IndentList":"OutdentList",n.dom)})),r=n.sourceList,O(o,(function(t){Ct(r,t)})),Dt(n.sourceList)}))},Gn=function(t,n){var e=xt(Nn(t)),r=xt(function(t){return T(hn(t),Qt)}(t)),o=!1;if(e.length||r.length){var i=t.selection.getBookmark();Zn(t,e,n),function(t,n,e){O(e,"Indent"===n?fn:function(n){return sn(t,n)})}(t,n,r),t.selection.moveToBookmark(i),t.selection.setRng(dn(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Jn=function(t,n){return!function(t){var n=vn(t);return On(t,n)}(t)&&Gn(t,n)},Xn=function(t){return Jn(t,"Indent")},Yn=function(t){return Jn(t,"Outdent")},te=function(t){return Jn(t,"Flatten")},ne=function(t){return"\ufeff"===t},ee=function(t,n){return e=t,r=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=n.concat(e);return t.apply(null,o)}}(j,n),pt(e,r,o).isSome();var e,r,o},re=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),oe=Rt.DOM,ie=function(t){var n={},e=function(e){var r=t[e?"startContainer":"endContainer"],o=t[e?"startOffset":"endOffset"];if(jt(r)){var i=oe.create("span",{"data-mce-type":"bookmark"});r.hasChildNodes()?(o=Math.min(o,r.childNodes.length-1),e?r.insertBefore(i,r.childNodes[o]):oe.insertAfter(i,r.childNodes[o])):r.appendChild(i),r=i,o=0}n[e?"startContainer":"endContainer"]=r,n[e?"startOffset":"endOffset"]=o};return e(!0),t.collapsed||e(),n},ue=function(t){var n=function(n){var e=t[n?"startContainer":"endContainer"],r=t[n?"startOffset":"endOffset"];if(e){if(jt(e)&&e.parentNode){var o=e;r=function(t){for(var n,e=null===(n=t.parentNode)||void 0===n?void 0:n.firstChild,r=0;e;){if(e===t)return r;jt(e)&&"bookmark"===e.getAttribute("data-mce-type")||r++,e=e.nextSibling}return-1}(e),e=e.parentNode,oe.remove(o),!e.hasChildNodes()&&oe.isBlock(e)&&e.appendChild(oe.create("br"))}t[n?"startContainer":"endContainer"]=e,t[n?"startOffset":"endOffset"]=r}};n(!0),n();var e=oe.createRng();return e.setStart(t.startContainer,t.startOffset),t.endContainer&&e.setEnd(t.endContainer,t.endOffset),dn(e)},ae=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},ce=function(t,n){_t.each(n,(function(n,e){t.setAttribute(e,n)}))},se=function(t,n,e){!function(t,n,e){var r=e["list-style-type"]?e["list-style-type"]:null;t.setStyle(n,"list-style-type",r)}(t,n,e),function(t,n,e){ce(n,e["list-attributes"]),_t.each(t.select("li",n),(function(t){ce(t,e["list-item-attributes"])}))}(t,n,e)},fe=function(t,n){return s(n)&&!Gt(n,t.schema.getBlockElements())},le=function(t,n,e,r){var o=n[e?"startContainer":"endContainer"],i=n[e?"startOffset":"endOffset"];jt(o)&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!e&&qt(o.nextSibling)&&(o=o.nextSibling);var u=function(n,e){for(var o,i,u=new Tt(n,function(n){for(;!t.dom.isBlock(n)&&n.parentNode&&r!==n;)n=n.parentNode;return n}(n)),a=e?"next":"prev";i=u[a]();)if(!Jt(t,i)&&!ne(i.textContent)&&0!==(null===(o=i.textContent)||void 0===o?void 0:o.length))return h.some(i);return h.none()};if(e&&$t(o))if(ne(o.textContent))o=u(o,!1).getOr(o);else for(null!==o.parentNode&&fe(t,o.parentNode)&&(o=o.parentNode);null!==o.previousSibling&&(fe(t,o.previousSibling)||$t(o.previousSibling));)o=o.previousSibling;if(!e&&$t(o))if(ne(o.textContent))o=u(o,!0).getOr(o);else for(null!==o.parentNode&&fe(t,o.parentNode)&&(o=o.parentNode);null!==o.nextSibling&&(fe(t,o.nextSibling)||$t(o.nextSibling));)o=o.nextSibling;for(;o.parentNode!==r;){var a=o.parentNode;if(Zt(t,o))return o;if(/^(TD|TH)$/.test(a.nodeName))return o;o=a}return o},de=function(t,n,e){var r=t.selection.getRng(),o="LI",i=Cn(t,function(t,n){var e=t.selection.getStart(!0),r=le(t,n,!0,t.getBody());return ee(H.fromDom(r),H.fromDom(n.commonAncestorContainer))?n.commonAncestorContainer:e}(t,r)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){"DL"===(n=n.toUpperCase())&&(o="DT");var a=ie(r),c=T(function(t,n,e){for(var r,o=[],i=t.dom,u=le(t,n,!0,e),a=le(t,n,!1,e),c=[],s=u;s&&(c.push(s),s!==a);s=s.nextSibling);return _t.each(c,(function(n){var u;if(Zt(t,n))return o.push(n),void(r=null);if(i.isBlock(n)||qt(n))return qt(n)&&i.remove(n),void(r=null);var a=n.nextSibling;re.isBookmarkNode(n)&&(Ft(a)||Zt(t,a)||!a&&n.parentNode===e)?r=null:(r||(r=i.create("p"),null===(u=n.parentNode)||void 0===u||u.insertBefore(r,n),o.push(r)),r.appendChild(n))})),o}(t,r,i),t.dom.isEditable);_t.each(c,(function(r){var i,a=r.previousSibling,c=r.parentNode;zt(c)||(a&&Ft(a)&&a.nodeName===n&&function(t,n,e){var r=t.getStyle(n,"list-style-type"),o=e?e["list-style-type"]:"";return r===(null===o?"":o)}(u,a,e)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(n),c.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),function(t,n,e){_t.each(e,(function(e){return t.setStyle(n,e,"")}))}(u,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),se(u,i,e),pe(t.dom,i))})),t.selection.setRng(ue(a))}},me=function(t,n,e){return function(t,n){return Ft(t)&&t.nodeName===(null==n?void 0:n.nodeName)}(n,e)&&function(t,n,e){return t.getStyle(n,"list-style-type",!0)===t.getStyle(e,"list-style-type",!0)}(t,n,e)&&(r=e,n.className===r.className);var r},pe=function(t,n){var e,r=n.nextSibling;if(me(t,n,r)){for(var o=r;e=o.firstChild;)n.appendChild(e);t.remove(o)}if(r=n.previousSibling,me(t,n,r)){for(o=r;e=o.lastChild;)n.insertBefore(e,n.firstChild);t.remove(o)}},ve=function(t,n,e,r){if(n.nodeName!==e){var o=t.dom.rename(n,e);se(t.dom,o,r),wn(t,ae(e),o)}else se(t.dom,n,r),wn(t,ae(e),n)},ge=function(t,n,e,r){if(n.classList.forEach((function(t,e,r){t.startsWith("tox-")&&(r.remove(t),0===r.length&&n.removeAttribute("class"))})),n.nodeName!==e){var o=t.dom.rename(n,e);se(t.dom,o,r),wn(t,ae(e),o)}else se(t.dom,n,r),wn(t,ae(e),n)},he=function(t){return"list-style-type"in t},ye=function(t,n,e){var o=vn(t);if(!Tn(t,o)){var i=gn(t),a=u(e)?e:{};i.length>0?function(t,n,e,o,i){var u=Ft(n);if(!u||n.nodeName!==o||he(i)||Ln(n)){de(t,o,i);var a=ie(t.selection.getRng()),c=u?r([n],e,!0):e,s=u&&Ln(n)?ge:ve;_t.each(c,(function(n){s(t,n,o,i)})),t.selection.setRng(ue(a))}else te(t)}(t,o,i,n,a):function(t,n,e,r){if(n!==t.getBody())if(n)if(n.nodeName!==e||he(r)||Ln(n)){var o=ie(t.selection.getRng());Ln(n)&&n.classList.forEach((function(t,e,r){t.startsWith("tox-")&&(r.remove(t),0===r.length&&n.removeAttribute("class"))})),se(t.dom,n,r);var i=t.dom.rename(n,e);pe(t.dom,i),t.selection.setRng(ue(o)),de(t,e,r),wn(t,ae(e),i)}else te(t);else de(t,e,r),wn(t,ae(e),n)}(t,o,n,a)}},Ce=Rt.DOM,be=function(t,n){var e=_t.grep(t.select("ol,ul",n));_t.each(e,(function(n){!function(t,n){var e,r=n.parentElement;r&&"LI"===r.nodeName&&r.firstChild===n&&((e=r.previousSibling)&&"LI"===e.nodeName?(e.appendChild(n),Xt(t,r)&&Ce.remove(r)):Ce.setStyle(r,"listStyleType","none")),Ft(r)&&(e=r.previousSibling)&&"LI"===e.nodeName&&e.appendChild(n)}(t,n)}))},Ne=function(t,n,e,r){var o=n.startContainer,i=n.startOffset;if($t(o)&&(e?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();jt(o)&&(o=Ot.getNode(o,i));var a=new Tt(o,r);e&&function(t,n){return!!qt(n)&&t.isBlock(n.nextSibling)&&!qt(n.previousSibling)}(t.dom,o)&&a.next();for(var c=e?a.next.bind(a):a.prev2.bind(a);o=c();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if($t(o)&&o.data.length>0)return o}return null},Se=function(t,n){var e=n.childNodes;return 1===e.length&&!Ft(e[0])&&t.isBlock(e[0])},Le=function(t){return h.from(t).map(H.fromDom).filter(J).exists((function(t){return void 0===e&&(e=!1),(dt(n=t)?n.dom.isContentEditable:ht(n).fold(m(e),(function(t){return"true"===yt(t)})))&&!S(["details"],q(t));var n,e}))},De=function(t,n,e){var r,o=Se(t,e)?e.firstChild:e;if(function(t,n){Se(t,n)&&Le(n.firstChild)&&t.remove(n.firstChild,!0)}(t,n),!Xt(t,n,!0))for(;r=n.firstChild;)o.appendChild(r)},Oe=function(t,n,e){var r,o=n.parentNode;if(Yt(t,n)&&Yt(t,e)){Ft(e.lastChild)&&(r=e.lastChild),o===e.lastChild&&qt(o.previousSibling)&&t.remove(o.previousSibling);var i=e.lastChild;i&&qt(i)&&n.hasChildNodes()&&t.remove(i),Xt(t,e,!0)&&Lt(H.fromDom(e)),De(t,n,e),r&&e.appendChild(r);var u,a,c,s,f=(u=H.fromDom(e),a=H.fromDom(n),c=u.dom,s=a.dom,c!==s&&c.contains(s))?t.getParents(n,Ft,e):[];t.remove(n),O(f,(function(n){Xt(t,n)&&n!==t.getRoot()&&t.remove(n)}))}},Te=function(t,n,e,r){var o=t.dom;if(o.isEmpty(r))!function(t,n,e){Lt(H.fromDom(e)),Oe(t.dom,n,e),t.selection.setCursorLocation(e,0)}(t,e,r);else{var i=ie(n);Oe(o,e,r),t.selection.setRng(ue(i))}},Ae=function(t,n){var e=t.dom,r=t.selection,o=r.getStart(),i=yn(t,o),u=e.getParent(r.getStart(),"LI",i);if(u){var a=u.parentElement;if(a===t.getBody()&&Xt(e,a))return!0;var c=dn(r.getRng()),s=e.getParent(Ne(t,c,n,i),"LI",i),f=s&&(n?e.isChildOf(u,s):e.isChildOf(s,u));if(s&&s!==u&&!f)return t.undoManager.transact((function(){var e,r;n?Te(t,c,s,u):(null===(r=(e=u).parentNode)||void 0===r?void 0:r.firstChild)===e?Yn(t):function(t,n,e,r){var o=ie(n);Oe(t.dom,e,r);var i=ue(o);t.selection.setRng(i)}(t,c,u,s)})),!0;if(f&&!n&&s!==u)return t.undoManager.transact((function(){if(c.commonAncestorContainer.parentElement){var n=ie(c),r=c.commonAncestorContainer.parentElement;De(e,c.commonAncestorContainer.parentElement,s),r.remove();var o=ue(n);t.selection.setRng(o)}})),!0;if(!s&&!n&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){te(t)})),!0}return!1},xe=function(t,n){var e,r,o,i=t.dom,u=t.selection.getStart(),a=yn(t,u),c=i.getParent(u,i.isBlock,a);if(c&&i.isEmpty(c)){var s=dn(t.selection.getRng()),f=i.getParent(Ne(t,s,n,a),"LI",a);if(f){var l=function(t){return S(["td","th","caption"],q(t))},d=function(t){return t.dom===a},m=vt(H.fromDom(f),l,d),v=vt(H.fromDom(s.startContainer),l,d);return void 0===(o=j)&&(o=p),_(e=m,r=v,o).getOr(e.isNone()&&r.isNone())?(t.undoManager.transact((function(){var e=f.parentNode;!function(t,n,e){var r=t.getParent(n.parentNode,t.isBlock,e);t.remove(n),r&&t.isEmpty(r)&&t.remove(r)}(i,c,a),pe(i,e),t.selection.select(f,!0),t.selection.collapse(n)})),!0):!1}}return!1},we=function(t){var n=t.selection.getStart(),e=yn(t,n);return t.dom.getParent(n,"LI,DT,DD",e)||hn(t).length>0},Ee=function(t,n){var e=t.selection;return!Tn(t,e.getNode())&&(e.isCollapsed()?function(t,n){return Ae(t,n)||xe(t,n)}(t,n):function(t){return!!we(t)&&(t.undoManager.transact((function(){t.execCommand("Delete"),be(t.dom,t.getBody())})),!0)}(t))},ke=function(t){var n=k(En(t).split("")),e=D(n,(function(t,n){var e=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,n)*e}));return A(e,(function(t,n){return t+n}),0)},Be=function(t){if(--t<0)return"";var n=t%26,e=Math.floor(t/26);return Be(e)+String.fromCharCode("A".charCodeAt(0)+n)},Pe=function(t){var n,e,r=vn(t);Kt(r)&&!Tn(t,r)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:(n={start:t.dom.getAttrib(r,"start","1"),listStyleType:h.from(t.dom.getStyle(r,"list-style-type"))},e=parseInt(n.start,10),R(n.listStyleType,"upper-alpha")?Be(e):R(n.listStyleType,"lower-alpha")?Be(e).toLowerCase():n.start)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(n){(function(t){switch(function(t){return/^[0-9]+$/.test(t)?2:/^[A-Z]+$/.test(t)?0:function(t){return/^[a-z]+$/.test(t)}(t)?1:t.length>0?4:3}(t)){case 2:return h.some({listStyleType:h.none(),start:t});case 0:return h.some({listStyleType:h.some("upper-alpha"),start:ke(t).toString()});case 1:return h.some({listStyleType:h.some("lower-alpha"),start:ke(t).toString()});case 3:return h.some({listStyleType:h.none(),start:""});case 4:return h.none()}})(n.getData().start).each((function(n){t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===n.start?"":n.start},styles:{"list-style-type":n.listStyleType.getOr("")}})})),n.close()}})},Me=function(t,n){return function(){var e=vn(t);return s(e)&&e.nodeName===n}},Ie=function(t){t.addCommand("mceListProps",(function(){Pe(t)}))},Re=function(t){t.on("BeforeExecCommand",(function(n){var e=n.command.toLowerCase();"indent"===e?Xn(t):"outdent"===e&&Yn(t)})),t.addCommand("InsertUnorderedList",(function(n,e){ye(t,"UL",e)})),t.addCommand("InsertOrderedList",(function(n,e){ye(t,"OL",e)})),t.addCommand("InsertDefinitionList",(function(n,e){ye(t,"DL",e)})),t.addCommand("RemoveList",(function(){te(t)})),Ie(t),t.addCommand("mceListUpdate",(function(n,e){u(e)&&function(t,n){var e=vn(t);null===e||Tn(t,e)||t.undoManager.transact((function(){u(n.styles)&&t.dom.setStyles(e,n.styles),u(n.attrs)&&Et(n.attrs,(function(n,r){return t.dom.setAttrib(e,r,n)}))}))}(t,e)})),t.addQueryStateHandler("InsertUnorderedList",Me(t,"UL")),t.addQueryStateHandler("InsertOrderedList",Me(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",Me(t,"DL"))},_e=tinymce.util.Tools.resolve("tinymce.html.Node"),Ue=function(t){return 3===t.type},He=function(t){return 0===t.length},$e=function(t){var n=function(n,e){var r=_e.create("li");O(n,(function(t){return r.append(t)})),e?t.insert(r,e,!0):t.append(r)},e=A(t.children(),(function(t,e){return Ue(e)?r(r([],t,!0),[e],!1):He(t)||Ue(e)?t:(n(t,e),[])}),[]);He(e)||n(e)},je=function(t){nn(t)&&function(t){t.on("keydown",(function(n){n.keyCode!==At.TAB||At.metaKeyPressed(n)||t.undoManager.transact((function(){(n.shiftKey?Yn(t):Xn(t))&&n.preventDefault()}))}))}(t),function(t){t.on("ExecCommand",(function(n){var e=n.command.toLowerCase();"delete"!==e&&"forwarddelete"!==e||!we(t)||be(t.dom,t.getBody())})),t.on("keydown",(function(n){n.keyCode===At.BACKSPACE?Ee(t,!1)&&n.preventDefault():n.keyCode===At.DELETE&&Ee(t,!0)&&n.preventDefault()}))}(t)},Fe=function(t,n){return function(e){return e.setEnabled(t.selection.isEditable()),An(t,(function(r){e.setActive(Dn(r.parents,n)),e.setEnabled(!Tn(t,r.element)&&t.selection.isEditable())}))}},Ve=function(t,n){return function(e){return An(t,(function(r){return e.setEnabled(Dn(r.parents,n)&&!Tn(t,r.element))}))}};t.add("lists",(function(t){return function(t){(0,t.options.register)("lists_indent_on_tab",{processor:"boolean",default:!0})}(t),function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("ul,ol",(function(t){return O(t,$e)}))}))}(t),t.hasPlugin("rtc",!0)?Ie(t):(je(t),Re(t)),function(t){var n=function(n){return function(){return t.execCommand(n)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:n("InsertOrderedList"),onSetup:Fe(t,"OL")}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:n("InsertUnorderedList"),onSetup:Fe(t,"UL")}))}(t),function(t){var n={text:"List properties...",icon:"ordered-list",onAction:function(){return t.execCommand("mceListProps")},onSetup:Ve(t,"OL")};t.ui.registry.addMenuItem("listprops",n),t.ui.registry.addContextMenu("lists",{update:function(n){var e=vn(t,n);return Kt(e)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(n){Ee(t,n)}}}(t)}))}(),t}export{e as __require};
1
+ import{__exports as t}from"../../../../_virtual/plugin4.mjs";var n;function e(){if(n)return t;n=1;var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},e.apply(this,arguments)},r=t&&t.__spreadArray||function(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return t.concat(r||Array.prototype.slice.call(n))};return function(){var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return function(n){return u=typeof(e=n),(null===e?"null":"object"===u&&Array.isArray(e)?"array":"object"===u&&(a=r=e,(o=String).prototype.isPrototypeOf(a)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===o.name)?"string":u)===t;var e,r,o,i,u,a}},o=function(t){return function(n){return typeof n===t}},i=n("string"),u=n("object"),a=n("array"),c=o("boolean"),s=function(t){return!function(t){return null==t}(t)},f=o("function"),l=o("number"),d=function(){},m=function(t){return function(){return t}},p=function(t,n){return t===n};var v=function(t){return function(n){return!t(n)}},g=m(!1),h=function(){function t(t,n){this.tag=t,this.value=n}return t.some=function(n){return new t(!0,n)},t.none=function(){return t.singletonNone},t.prototype.fold=function(t,n){return this.tag?n(this.value):t()},t.prototype.isSome=function(){return this.tag},t.prototype.isNone=function(){return!this.tag},t.prototype.map=function(n){return this.tag?t.some(n(this.value)):t.none()},t.prototype.bind=function(n){return this.tag?n(this.value):t.none()},t.prototype.exists=function(t){return this.tag&&t(this.value)},t.prototype.forall=function(t){return!this.tag||t(this.value)},t.prototype.filter=function(n){return!this.tag||n(this.value)?this:t.none()},t.prototype.getOr=function(t){return this.tag?this.value:t},t.prototype.or=function(t){return this.tag?this:t},t.prototype.getOrThunk=function(t){return this.tag?this.value:t()},t.prototype.orThunk=function(t){return this.tag?this:t()},t.prototype.getOrDie=function(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")},t.from=function(n){return s(n)?t.some(n):t.none()},t.prototype.getOrNull=function(){return this.tag?this.value:null},t.prototype.getOrUndefined=function(){return this.value},t.prototype.each=function(t){this.tag&&t(this.value)},t.prototype.toArray=function(){return this.tag?[this.value]:[]},t.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},t}();h.singletonNone=new h(!1);var y,C=Array.prototype.slice,b=Array.prototype.indexOf,N=Array.prototype.push,S=function(t,n){return e=t,r=n,b.call(e,r)>-1;var e,r},L=function(t,n){for(var e=0,r=t.length;e<r;e++){if(n(t[e],e))return!0}return!1},D=function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r},O=function(t,n){for(var e=0,r=t.length;e<r;e++){n(t[e],e)}},T=function(t,n){for(var e=[],r=0,o=t.length;r<o;r++){var i=t[r];n(i,r)&&e.push(i)}return e},A=function(t,n,e){return O(t,(function(t,r){e=n(e,t,r)})),e},x=function(t,n,e){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(n(i,r))return h.some(i);if(e(i,r))break}return h.none()},w=function(t,n){return x(t,n,g)},E=function(t,n){return function(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!a(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);N.apply(n,t[e])}return n}(D(t,n))},k=function(t){var n=C.call(t,0);return n.reverse(),n},B=function(t,n){return n>=0&&n<t.length?h.some(t[n]):h.none()},P=function(t){return B(t,0)},M=function(t){return B(t,t.length-1)},I=function(t,n){for(var e=[],r=f(n)?function(t){return L(e,(function(e){return n(e,t)}))}:function(t){return S(e,t)},o=0,i=t.length;o<i;o++){var u=t[o];r(u)||e.push(u)}return e},R=function(t,n,e){return void 0===e&&(e=p),t.exists((function(t){return e(t,n)}))},_=function(t,n,e){return t.isSome()&&n.isSome()?h.some(e(t.getOrDie(),n.getOrDie())):h.none()},U=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},H={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||e.childNodes.length>1){var r="HTML does not have a single root node";throw console.error(r,t),new Error(r)}return U(e.childNodes[0])},fromTag:function(t,n){var e=(n||document).createElement(t);return U(e)},fromText:function(t,n){var e=(n||document).createTextNode(t);return U(e)},fromDom:U,fromPoint:function(t,n,e){return h.from(t.dom.elementFromPoint(n,e)).map(U)}},$=function(t,n){var e=t.dom;if(1!==e.nodeType)return!1;var r=e;if(void 0!==r.matches)return r.matches(n);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(n);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(n);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},j=function(t,n){return t.dom===n.dom},F=$,V="undefined"!=typeof window?window:Function("return this;")(),K=function(t,n){return function(t,n){for(var e=null!=n?n:V,r=0;r<t.length&&null!=e;++r)e=e[t[r]];return e}(t.split("."),n)},z=function(t,n){var e=function(t,n){return K(t,n)}(t,n);if(null==e)throw new Error(t+" not available on this browser");return e},Q=Object.getPrototypeOf,W=function(t){var n=K("ownerDocument.defaultView",t);return u(t)&&(function(t){return z("HTMLElement",t)}(n).prototype.isPrototypeOf(t)||/^HTML\w*Element$/.test(Q(t).constructor.name))},q=function(t){return t.dom.nodeName.toLowerCase()},Z=function(t){return t.dom.nodeType},G=function(t){return function(n){return Z(n)===t}},J=function(t){return X(t)&&W(t.dom)},X=G(1),Y=G(3),tt=G(9),nt=G(11),et=function(t){return function(n){return X(n)&&q(n)===t}},rt=function(t){return h.from(t.dom.parentNode).map(H.fromDom)},ot=function(t){return D(t.dom.childNodes,H.fromDom)},it=function(t,n){var e=t.dom.childNodes;return h.from(e[n]).map(H.fromDom)},ut=function(t){return it(t,0)},at=function(t){return it(t,t.dom.childNodes.length-1)},ct=f(Element.prototype.attachShadow)&&f(Node.prototype.getRootNode),st=ct?function(t){return H.fromDom(t.dom.getRootNode())}:function(t){return tt(t)?t:(n=t,H.fromDom(n.dom.ownerDocument));var n},ft=function(t){var n,e=st(t);return nt(n=e)&&s(n.dom.host)?h.some(e):h.none()},lt=function(t){return H.fromDom(t.dom.host)},dt=function(t){var n=Y(t)?t.dom.parentNode:t.dom;if(null==n||null===n.ownerDocument)return!1;var e,r,o=n.ownerDocument;return ft(H.fromDom(n)).fold((function(){return o.body.contains(n)}),(e=dt,r=lt,function(t){return e(r(t))}))},mt=function(t,n,e,r,o){return t(e,r)?h.some(e):f(o)&&o(e)?h.none():n(e,r,o)},pt=function(t,n,e){for(var r=t.dom,o=f(e)?e:g;r.parentNode;){r=r.parentNode;var i=H.fromDom(r);if(n(i))return h.some(i);if(o(i))break}return h.none()},vt=function(t,n,e){return mt((function(t,n){return n(t)}),pt,t,n,e)},gt=function(t,n,e){return pt(t,(function(t){return $(t,n)}),e)},ht=function(t){return mt((function(t,n){return $(t,n)}),gt,t,"[contenteditable]",n);var n},yt=function(t){return t.dom.contentEditable},Ct=function(t,n){rt(t).each((function(e){e.dom.insertBefore(n.dom,t.dom)}))},bt=function(t,n){var e=function(t){return h.from(t.dom.nextSibling).map(H.fromDom)}(t);e.fold((function(){rt(t).each((function(t){Nt(t,n)}))}),(function(t){Ct(t,n)}))},Nt=function(t,n){t.dom.appendChild(n.dom)},St=function(t,n){O(n,(function(n){Nt(t,n)}))},Lt=function(t){t.dom.textContent="",O(ot(t),(function(t){Dt(t)}))},Dt=function(t){var n=t.dom;null!==n.parentNode&&n.parentNode.removeChild(n)},Ot=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Tt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),At=tinymce.util.Tools.resolve("tinymce.util.VK"),xt=function(t){return D(t,H.fromDom)},wt=Object.keys,Et=function(t,n){for(var e=wt(t),r=0,o=e.length;r<o;r++){var i=e[r];n(t[i],i)}},kt=function(t,n){var e,r={};return function(t,n,e,r){Et(t,(function(t,o){(n(t,o)?e:r)(t,o)}))}(t,n,(e=r,function(t,n){e[n]=t}),d),r},Bt=function(t,n){var e=t.dom;Et(n,(function(t,n){!function(t,n,e){if(!(i(e)||c(e)||l(e)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")}(e,n,t)}))},Pt=function(t){return A(t.dom.attributes,(function(t,n){return t[n.name]=n.value,t}),{})},Mt=function(t){return function(t,n){return H.fromDom(t.dom.cloneNode(n))}(t,!0)},It=function(t,n){var e=function(t,n){var e=H.fromTag(n),r=Pt(t);return Bt(e,r),e}(t,n);bt(t,e);var r=ot(t);return St(e,r),Dt(t),e},Rt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),_t=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ut=function(t){return function(n){return s(n)&&n.nodeName.toLowerCase()===t}},Ht=function(t){return function(n){return s(n)&&t.test(n.nodeName)}},$t=function(t){return s(t)&&3===t.nodeType},jt=function(t){return s(t)&&1===t.nodeType},Ft=Ht(/^(OL|UL|DL)$/),Vt=Ht(/^(OL|UL)$/),Kt=Ut("ol"),zt=Ht(/^(LI|DT|DD)$/),Qt=Ht(/^(DT|DD)$/),Wt=Ht(/^(TH|TD)$/),qt=Ut("br"),Zt=function(t,n){return s(n)&&n.nodeName in t.schema.getTextBlockElements()},Gt=function(t,n){return s(t)&&t.nodeName in n},Jt=function(t,n){return s(n)&&n.nodeName in t.schema.getVoidElements()},Xt=function(t,n,e){var r=t.isEmpty(n);return!(e&&t.select("span[data-mce-type=bookmark]",n).length>0)&&r},Yt=function(t,n){return t.isChildOf(n,t.getRoot())},tn=function(t){return function(n){return n.options.get(t)}},nn=tn("lists_indent_on_tab"),en=tn("forced_root_block"),rn=tn("forced_root_block_attrs"),on=function(t,n){var e,r,o=t.dom,i=t.schema.getBlockElements(),u=o.createFragment(),a=en(t),c=rn(t),s=!1;for(r=o.create(a,c),Gt(n.firstChild,i)||u.appendChild(r);e=n.firstChild;){var f=e.nodeName;s||"SPAN"===f&&"bookmark"===e.getAttribute("data-mce-type")||(s=!0),Gt(e,i)?(u.appendChild(e),r=null):(r||(r=o.create(a,c),u.appendChild(r)),r.appendChild(e))}return!s&&r&&r.appendChild(o.create("br",{"data-mce-bogus":"1"})),u},un=Rt.DOM,an=et("dd"),cn=et("dt"),sn=function(t,n){var e;an(n)?It(n,"dt"):cn(n)&&(e=n,h.from(e.dom.parentElement).map(H.fromDom)).each((function(e){return function(t,n,e){var r=un.select('span[data-mce-type="bookmark"]',n),o=on(t,e),i=un.createRng();i.setStartAfter(e),i.setEndAfter(n);for(var u=i.extractContents(),a=u.firstChild;a;a=a.firstChild)if("LI"===a.nodeName&&t.dom.isEmpty(a)){un.remove(a);break}t.dom.isEmpty(u)||un.insertAfter(u,n),un.insertAfter(o,n);var c=e.parentElement;c&&Xt(t.dom,c)&&function(t){var n=t.parentNode;n&&_t.each(r,(function(t){n.insertBefore(t,e.parentNode)})),un.remove(t)}(c),un.remove(e),Xt(t.dom,n)&&un.remove(n)}(t,e.dom,n.dom)}))},fn=function(t){cn(t)&&It(t,"dd")},ln=function(t,n){if($t(t))return{container:t,offset:n};var e=Ot.getNode(t,n);return $t(e)?{container:e,offset:n>=t.childNodes.length?e.data.length:0}:e.previousSibling&&$t(e.previousSibling)?{container:e.previousSibling,offset:e.previousSibling.data.length}:e.nextSibling&&$t(e.nextSibling)?{container:e.nextSibling,offset:0}:{container:t,offset:n}},dn=function(t){var n=t.cloneRange(),e=ln(t.startContainer,t.startOffset);n.setStart(e.container,e.offset);var r=ln(t.endContainer,t.endOffset);return n.setEnd(r.container,r.offset),n},mn=["OL","UL","DL"],pn=mn.join(","),vn=function(t,n){var e=n||t.selection.getStart(!0);return t.dom.getParent(e,pn,Cn(t,e))},gn=function(t){var n=vn(t),e=t.selection.getSelectedBlocks();return function(t,n){return s(t)&&1===n.length&&n[0]===t}(n,e)?function(t){return T(t.querySelectorAll(pn),Ft)}(n):T(e,(function(t){return Ft(t)&&n!==t}))},hn=function(t){var n=t.selection.getSelectedBlocks();return T(function(t,n){var e=_t.map(n,(function(n){return t.dom.getParent(n,"li,dd,dt",Cn(t,n))||n}));return I(e)}(t,n),zt)},yn=function(t,n){var e=t.dom.getParents(n,"TD,TH");return e.length>0?e[0]:t.getBody()},Cn=function(t,n){var e=t.dom.getParents(n,t.dom.isBlock),r=w(e,(function(n){return e=t.schema,!Ft(r=n)&&!zt(r)&&L(mn,(function(t){return e.isValidChild(r.nodeName,t)}));var e,r}));return r.getOr(t.getBody())},bn=function(t,n){var e=t.dom.getParents(n,"ol,ul",Cn(t,n));return M(e)},Nn=function(t){var n=function(t){var n=bn(t,t.selection.getStart()),e=T(t.selection.getSelectedBlocks(),Vt);return n.toArray().concat(e)}(t),e=function(t){var n=t.selection.getStart();return t.dom.getParents(n,"ol,ul",Cn(t,n))}(t);return w(e,(function(t){return n=H.fromDom(t),rt(n).exists((function(t){return zt(t.dom)&&ut(t).exists((function(t){return!Ft(t.dom)}))&&at(t).exists((function(t){return!Ft(t.dom)}))}));var n})).fold((function(){return Sn(t,n)}),(function(t){return[t]}))},Sn=function(t,n){var e=D(n,(function(n){return bn(t,n).getOr(n)}));return I(e)},Ln=function(t){return/\btox\-/.test(t.className)},Dn=function(t,n){return x(t,Ft,Wt).exists((function(t){return t.nodeName===n&&!Ln(t)}))},On=function(t,n){return null!==n&&!t.dom.isEditable(n)},Tn=function(t,n){var e=t.dom.getParent(n,"ol,ul,dl");return On(t,e)},An=function(t,n){var e=t.selection.getNode();return n({parents:t.dom.getParents(e),element:e}),t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},xn=function(t,n){var e=(n||document).createDocumentFragment();return O(t,(function(t){e.appendChild(t.dom)})),H.fromDom(e)},wn=function(t,n,e){return t.dispatch("ListMutation",{action:n,element:e})},En=(y=/^\s+|\s+$/g,function(t){return t.replace(y,"")}),kn=function(t,n,e){if(!i(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);(function(t){return void 0!==t.style&&f(t.style.getPropertyValue)})(t)&&t.style.setProperty(n,e)},Bn=function(t){return F(t,"OL,UL")},Pn=function(t){return ut(t).exists(Bn)},Mn=function(t){return"listAttributes"in t},In=function(t){return"isComment"in t},Rn=function(t){return t.depth>0},_n=function(t){return t.isSelected},Un=function(t){var n=ot(t),e=at(t).exists(Bn)?n.slice(0,-1):n;return D(e,Mt)},Hn=function(t,n){Nt(t.item,n.list)},$n=function(t,n){var e={list:H.fromTag(n,t),item:H.fromTag("li",t)};return Nt(e.list,e.item),e},jn=function(t,n,e){var r=n.slice(0,e.depth);return M(r).each((function(n){if(Mn(e)){var r=function(t,n,e){var r=H.fromTag("li",t);return Bt(r,n),St(r,e),r}(t,e.itemAttributes,e.content);!function(t,n){Nt(t.list,n),t.item=n}(n,r),function(t,n){q(t.list)!==n.listType&&(t.list=It(t.list,n.listType)),Bt(t.list,n.listAttributes)}(n,e)}else if(function(t){return"isFragment"in t}(e))St(n.item,e.content);else{r=H.fromHtml("\x3c!--".concat(e.content,"--\x3e"));Nt(n.list,r)}})),r},Fn=function(t,n,e){var r,o=function(t,n,e){for(var r=[],o=0;o<e;o++)r.push($n(t,Mn(n)?n.listType:n.parentListType));return r}(t,e,e.depth-n.length);return function(t){for(var n=1;n<t.length;n++)Hn(t[n-1],t[n])}(o),function(t,n){for(var e=0;e<t.length-1;e++)r=t[e].item,o="list-style-type",i="none",u=void 0,u=r.dom,kn(u,o,i);var r,o,i,u;M(t).each((function(t){Mn(n)&&(Bt(t.list,n.listAttributes),Bt(t.item,n.itemAttributes)),St(t.item,n.content)}))}(o,e),r=o,_(M(n),P(r),Hn),n.concat(o)},Vn=function(t,n){var e=h.none(),r=A(n,(function(n,r,o){return In(r)?0===o?(e=h.some(r),n):jn(t,n,r):r.depth>n.length?Fn(t,n,r):jn(t,n,r)}),[]);return e.each((function(t){var n=H.fromHtml("\x3c!--".concat(t.content,"--\x3e"));P(r).each((function(t){!function(t,n){ut(t).fold((function(){Nt(t,n)}),(function(e){t.dom.insertBefore(n.dom,e.dom)}))}(t.list,n)}))})),P(r).map((function(t){return t.list}))},Kn=function(t){return O(t,(function(n,r){(function(t,n){var e=t[n].depth,r=function(t){return t.depth===e&&!t.dirty},o=function(t){return t.depth<e};return x(k(t.slice(0,n)),r,o).orThunk((function(){return x(t.slice(n+1),r,o)}))})(t,r).fold((function(){n.dirty&&Mn(n)&&function(t){t.listAttributes=kt(t.listAttributes,(function(t,n){return"start"!==n}))}(n)}),(function(t){return o=t,void(Mn(r=n)&&Mn(o)&&(r.listType=o.listType,r.listAttributes=e({},o.listAttributes)));var r,o}))})),t},zn=function(t,n,e,r){var o,i;if(8===Z(i=r)||"#comment"===q(i))return[{depth:t+1,content:null!==(o=r.dom.nodeValue)&&void 0!==o?o:"",dirty:!1,isSelected:!1,isComment:!0}];n.each((function(t){j(t.start,r)&&e.set(!0)}));var u=function(t,n,e){return rt(t).filter(X).map((function(r){return{depth:n,dirty:!1,isSelected:e,content:Un(t),itemAttributes:Pt(t),listAttributes:Pt(r),listType:q(r),isInPreviousLi:!1}}))}(r,t,e.get());n.each((function(t){j(t.end,r)&&e.set(!1)}));var a=at(r).filter(Bn).map((function(r){return Wn(t,n,e,r)})).getOr([]);return u.toArray().concat(a)},Qn=function(t,n,e,r){return ut(r).filter(Bn).fold((function(){return zn(t,n,e,r)}),(function(o){var i=A(ot(r),(function(r,i,u){if(0===u)return r;if(F(i,"LI"))return r.concat(zn(t,n,e,i));var a={isFragment:!0,depth:t,content:[i],isSelected:!1,dirty:!1,parentListType:q(o)};return r.concat(a)}),[]);return Wn(t,n,e,o).concat(i)}))},Wn=function(t,n,e,r){return E(ot(r),(function(r){return(Bn(r)?Wn:Qn)(t+1,n,e,r)}))},qn=function(t,n){return E(function(t,n){if(0===t.length)return[];for(var e=n(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=n(a);c!==e&&(r.push(o),o=[]),e=c,o.push(a)}return 0!==o.length&&r.push(o),r}(n,Rn),(function(n){return P(n).exists(Rn)?function(t,n){var e=Kn(n);return Vn(t.contentDocument,e).toArray()}(t,n):function(t,n){var e=Kn(n);return D(e,(function(n){var e=In(n)?xn([H.fromHtml("\x3c!--".concat(n.content,"--\x3e"))]):xn(n.content);return H.fromDom(on(t,e.dom))}))}(t,n)}))},Zn=function(t,n,e){var r=function(t,n){var e,r=(e=!1,{get:function(){return e},set:function(t){e=t}});return D(t,(function(t){return{sourceList:t,entries:Wn(0,n,r,t)}}))}(n,function(t){var n=D(hn(t),H.fromDom);return _(w(n,v(Pn)),w(k(n),v(Pn)),(function(t,n){return{start:t,end:n}}))}(t));O(r,(function(n){!function(t,n){O(T(t,_n),(function(t){return function(t,n){switch(t){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}n.dirty=!0}(n,t)}))}(n.entries,e);var r,o=qn(t,n.entries);O(o,(function(n){wn(t,"Indent"===e?"IndentList":"OutdentList",n.dom)})),r=n.sourceList,O(o,(function(t){Ct(r,t)})),Dt(n.sourceList)}))},Gn=function(t,n){var e=xt(Nn(t)),r=xt(function(t){return T(hn(t),Qt)}(t)),o=!1;if(e.length||r.length){var i=t.selection.getBookmark();Zn(t,e,n),function(t,n,e){O(e,"Indent"===n?fn:function(n){return sn(t,n)})}(t,n,r),t.selection.moveToBookmark(i),t.selection.setRng(dn(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Jn=function(t,n){return!function(t){var n=vn(t);return On(t,n)}(t)&&Gn(t,n)},Xn=function(t){return Jn(t,"Indent")},Yn=function(t){return Jn(t,"Outdent")},te=function(t){return Jn(t,"Flatten")},ne=function(t){return"\ufeff"===t},ee=function(t,n){return e=t,r=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=n.concat(e);return t.apply(null,o)}}(j,n),pt(e,r,o).isSome();var e,r,o},re=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),oe=Rt.DOM,ie=function(t){var n={},e=function(e){var r=t[e?"startContainer":"endContainer"],o=t[e?"startOffset":"endOffset"];if(jt(r)){var i=oe.create("span",{"data-mce-type":"bookmark"});r.hasChildNodes()?(o=Math.min(o,r.childNodes.length-1),e?r.insertBefore(i,r.childNodes[o]):oe.insertAfter(i,r.childNodes[o])):r.appendChild(i),r=i,o=0}n[e?"startContainer":"endContainer"]=r,n[e?"startOffset":"endOffset"]=o};return e(!0),t.collapsed||e(),n},ue=function(t){var n=function(n){var e=t[n?"startContainer":"endContainer"],r=t[n?"startOffset":"endOffset"];if(e){if(jt(e)&&e.parentNode){var o=e;r=function(t){for(var n,e=null===(n=t.parentNode)||void 0===n?void 0:n.firstChild,r=0;e;){if(e===t)return r;jt(e)&&"bookmark"===e.getAttribute("data-mce-type")||r++,e=e.nextSibling}return-1}(e),e=e.parentNode,oe.remove(o),!e.hasChildNodes()&&oe.isBlock(e)&&e.appendChild(oe.create("br"))}t[n?"startContainer":"endContainer"]=e,t[n?"startOffset":"endOffset"]=r}};n(!0),n();var e=oe.createRng();return e.setStart(t.startContainer,t.startOffset),t.endContainer&&e.setEnd(t.endContainer,t.endOffset),dn(e)},ae=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},ce=function(t,n){_t.each(n,(function(n,e){t.setAttribute(e,n)}))},se=function(t,n,e){!function(t,n,e){var r=e["list-style-type"]?e["list-style-type"]:null;t.setStyle(n,"list-style-type",r)}(t,n,e),function(t,n,e){ce(n,e["list-attributes"]),_t.each(t.select("li",n),(function(t){ce(t,e["list-item-attributes"])}))}(t,n,e)},fe=function(t,n){return s(n)&&!Gt(n,t.schema.getBlockElements())},le=function(t,n,e,r){var o=n[e?"startContainer":"endContainer"],i=n[e?"startOffset":"endOffset"];jt(o)&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!e&&qt(o.nextSibling)&&(o=o.nextSibling);var u=function(n,e){for(var o,i,u=new Tt(n,function(n){for(;!t.dom.isBlock(n)&&n.parentNode&&r!==n;)n=n.parentNode;return n}(n)),a=e?"next":"prev";i=u[a]();)if(!Jt(t,i)&&!ne(i.textContent)&&0!==(null===(o=i.textContent)||void 0===o?void 0:o.length))return h.some(i);return h.none()};if(e&&$t(o))if(ne(o.textContent))o=u(o,!1).getOr(o);else for(null!==o.parentNode&&fe(t,o.parentNode)&&(o=o.parentNode);null!==o.previousSibling&&(fe(t,o.previousSibling)||$t(o.previousSibling));)o=o.previousSibling;if(!e&&$t(o))if(ne(o.textContent))o=u(o,!0).getOr(o);else for(null!==o.parentNode&&fe(t,o.parentNode)&&(o=o.parentNode);null!==o.nextSibling&&(fe(t,o.nextSibling)||$t(o.nextSibling));)o=o.nextSibling;for(;o.parentNode!==r;){var a=o.parentNode;if(Zt(t,o))return o;if(/^(TD|TH)$/.test(a.nodeName))return o;o=a}return o},de=function(t,n,e){var r=t.selection.getRng(),o="LI",i=Cn(t,function(t,n){var e=t.selection.getStart(!0),r=le(t,n,!0,t.getBody());return ee(H.fromDom(r),H.fromDom(n.commonAncestorContainer))?n.commonAncestorContainer:e}(t,r)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){"DL"===(n=n.toUpperCase())&&(o="DT");var a=ie(r),c=T(function(t,n,e){for(var r,o=[],i=t.dom,u=le(t,n,!0,e),a=le(t,n,!1,e),c=[],s=u;s&&(c.push(s),s!==a);s=s.nextSibling);return _t.each(c,(function(n){var u;if(Zt(t,n))return o.push(n),void(r=null);if(i.isBlock(n)||qt(n))return qt(n)&&i.remove(n),void(r=null);var a=n.nextSibling;re.isBookmarkNode(n)&&(Ft(a)||Zt(t,a)||!a&&n.parentNode===e)?r=null:(r||(r=i.create("p"),null===(u=n.parentNode)||void 0===u||u.insertBefore(r,n),o.push(r)),r.appendChild(n))})),o}(t,r,i),t.dom.isEditable);_t.each(c,(function(r){var i,a=r.previousSibling,c=r.parentNode;zt(c)||(a&&Ft(a)&&a.nodeName===n&&function(t,n,e){var r=t.getStyle(n,"list-style-type"),o=e?e["list-style-type"]:"";return r===(null===o?"":o)}(u,a,e)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(n),c.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),function(t,n,e){_t.each(e,(function(e){return t.setStyle(n,e,"")}))}(u,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),se(u,i,e),pe(t.dom,i))})),t.selection.setRng(ue(a))}},me=function(t,n,e){return function(t,n){return Ft(t)&&t.nodeName===(null==n?void 0:n.nodeName)}(n,e)&&function(t,n,e){return t.getStyle(n,"list-style-type",!0)===t.getStyle(e,"list-style-type",!0)}(t,n,e)&&(r=e,n.className===r.className);var r},pe=function(t,n){var e,r=n.nextSibling;if(me(t,n,r)){for(var o=r;e=o.firstChild;)n.appendChild(e);t.remove(o)}if(r=n.previousSibling,me(t,n,r)){for(o=r;e=o.lastChild;)n.insertBefore(e,n.firstChild);t.remove(o)}},ve=function(t,n,e,r){if(n.nodeName!==e){var o=t.dom.rename(n,e);se(t.dom,o,r),wn(t,ae(e),o)}else se(t.dom,n,r),wn(t,ae(e),n)},ge=function(t,n,e,r){if(n.classList.forEach((function(t,e,r){t.startsWith("tox-")&&(r.remove(t),0===r.length&&n.removeAttribute("class"))})),n.nodeName!==e){var o=t.dom.rename(n,e);se(t.dom,o,r),wn(t,ae(e),o)}else se(t.dom,n,r),wn(t,ae(e),n)},he=function(t){return"list-style-type"in t},ye=function(t,n,e){var o=vn(t);if(!Tn(t,o)){var i=gn(t),a=u(e)?e:{};i.length>0?function(t,n,e,o,i){var u=Ft(n);if(!u||n.nodeName!==o||he(i)||Ln(n)){de(t,o,i);var a=ie(t.selection.getRng()),c=u?r([n],e,!0):e,s=u&&Ln(n)?ge:ve;_t.each(c,(function(n){s(t,n,o,i)})),t.selection.setRng(ue(a))}else te(t)}(t,o,i,n,a):function(t,n,e,r){if(n!==t.getBody())if(n)if(n.nodeName!==e||he(r)||Ln(n)){var o=ie(t.selection.getRng());Ln(n)&&n.classList.forEach((function(t,e,r){t.startsWith("tox-")&&(r.remove(t),0===r.length&&n.removeAttribute("class"))})),se(t.dom,n,r);var i=t.dom.rename(n,e);pe(t.dom,i),t.selection.setRng(ue(o)),de(t,e,r),wn(t,ae(e),i)}else te(t);else de(t,e,r),wn(t,ae(e),n)}(t,o,n,a)}},Ce=Rt.DOM,be=function(t,n){var e=_t.grep(t.select("ol,ul",n));_t.each(e,(function(n){!function(t,n){var e,r=n.parentElement;r&&"LI"===r.nodeName&&r.firstChild===n&&((e=r.previousSibling)&&"LI"===e.nodeName?(e.appendChild(n),Xt(t,r)&&Ce.remove(r)):Ce.setStyle(r,"listStyleType","none")),Ft(r)&&(e=r.previousSibling)&&"LI"===e.nodeName&&e.appendChild(n)}(t,n)}))},Ne=function(t,n,e,r){var o=n.startContainer,i=n.startOffset;if($t(o)&&(e?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();jt(o)&&(o=Ot.getNode(o,i));var a=new Tt(o,r);e&&function(t,n){return!!qt(n)&&t.isBlock(n.nextSibling)&&!qt(n.previousSibling)}(t.dom,o)&&a.next();for(var c=e?a.next.bind(a):a.prev2.bind(a);o=c();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if($t(o)&&o.data.length>0)return o}return null},Se=function(t,n){var e=n.childNodes;return 1===e.length&&!Ft(e[0])&&t.isBlock(e[0])},Le=function(t){return h.from(t).map(H.fromDom).filter(J).exists((function(t){return void 0===e&&(e=!1),(dt(n=t)?n.dom.isContentEditable:ht(n).fold(m(e),(function(t){return"true"===yt(t)})))&&!S(["details"],q(t));var n,e}))},De=function(t,n,e){var r,o=Se(t,e)?e.firstChild:e;if(function(t,n){Se(t,n)&&Le(n.firstChild)&&t.remove(n.firstChild,!0)}(t,n),!Xt(t,n,!0))for(;r=n.firstChild;)o.appendChild(r)},Oe=function(t,n,e){var r,o=n.parentNode;if(Yt(t,n)&&Yt(t,e)){Ft(e.lastChild)&&(r=e.lastChild),o===e.lastChild&&qt(o.previousSibling)&&t.remove(o.previousSibling);var i=e.lastChild;i&&qt(i)&&n.hasChildNodes()&&t.remove(i),Xt(t,e,!0)&&Lt(H.fromDom(e)),De(t,n,e),r&&e.appendChild(r);var u,a,c,s,f=(u=H.fromDom(e),a=H.fromDom(n),c=u.dom,s=a.dom,c!==s&&c.contains(s))?t.getParents(n,Ft,e):[];t.remove(n),O(f,(function(n){Xt(t,n)&&n!==t.getRoot()&&t.remove(n)}))}},Te=function(t,n,e,r){var o=t.dom;if(o.isEmpty(r))!function(t,n,e){Lt(H.fromDom(e)),Oe(t.dom,n,e),t.selection.setCursorLocation(e,0)}(t,e,r);else{var i=ie(n);Oe(o,e,r),t.selection.setRng(ue(i))}},Ae=function(t,n){var e=t.dom,r=t.selection,o=r.getStart(),i=yn(t,o),u=e.getParent(r.getStart(),"LI",i);if(u){var a=u.parentElement;if(a===t.getBody()&&Xt(e,a))return!0;var c=dn(r.getRng()),s=e.getParent(Ne(t,c,n,i),"LI",i),f=s&&(n?e.isChildOf(u,s):e.isChildOf(s,u));if(s&&s!==u&&!f)return t.undoManager.transact((function(){var e,r;n?Te(t,c,s,u):(null===(r=(e=u).parentNode)||void 0===r?void 0:r.firstChild)===e?Yn(t):function(t,n,e,r){var o=ie(n);Oe(t.dom,e,r);var i=ue(o);t.selection.setRng(i)}(t,c,u,s)})),!0;if(f&&!n&&s!==u)return t.undoManager.transact((function(){if(c.commonAncestorContainer.parentElement){var n=ie(c),r=c.commonAncestorContainer.parentElement;De(e,c.commonAncestorContainer.parentElement,s),r.remove();var o=ue(n);t.selection.setRng(o)}})),!0;if(!s&&!n&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){te(t)})),!0}return!1},xe=function(t,n){var e,r,o,i=t.dom,u=t.selection.getStart(),a=yn(t,u),c=i.getParent(u,i.isBlock,a);if(c&&i.isEmpty(c)){var s=dn(t.selection.getRng()),f=i.getParent(Ne(t,s,n,a),"LI",a);if(f){var l=function(t){return S(["td","th","caption"],q(t))},d=function(t){return t.dom===a},m=vt(H.fromDom(f),l,d),v=vt(H.fromDom(s.startContainer),l,d);return void 0===(o=j)&&(o=p),_(e=m,r=v,o).getOr(e.isNone()&&r.isNone())?(t.undoManager.transact((function(){var e=f.parentNode;!function(t,n,e){var r=t.getParent(n.parentNode,t.isBlock,e);t.remove(n),r&&t.isEmpty(r)&&t.remove(r)}(i,c,a),pe(i,e),t.selection.select(f,!0),t.selection.collapse(n)})),!0):!1}}return!1},we=function(t){var n=t.selection.getStart(),e=yn(t,n);return t.dom.getParent(n,"LI,DT,DD",e)||hn(t).length>0},Ee=function(t,n){var e=t.selection;return!Tn(t,e.getNode())&&(e.isCollapsed()?function(t,n){return Ae(t,n)||xe(t,n)}(t,n):function(t){return!!we(t)&&(t.undoManager.transact((function(){t.execCommand("Delete"),be(t.dom,t.getBody())})),!0)}(t))},ke=function(t){var n=k(En(t).split("")),e=D(n,(function(t,n){var e=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,n)*e}));return A(e,(function(t,n){return t+n}),0)},Be=function(t){if(--t<0)return"";var n=t%26,e=Math.floor(t/26);return Be(e)+String.fromCharCode("A".charCodeAt(0)+n)},Pe=function(t){var n,e,r=vn(t);Kt(r)&&!Tn(t,r)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:(n={start:t.dom.getAttrib(r,"start","1"),listStyleType:h.from(t.dom.getStyle(r,"list-style-type"))},e=parseInt(n.start,10),R(n.listStyleType,"upper-alpha")?Be(e):R(n.listStyleType,"lower-alpha")?Be(e).toLowerCase():n.start)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(n){(function(t){switch(function(t){return/^[0-9]+$/.test(t)?2:/^[A-Z]+$/.test(t)?0:function(t){return/^[a-z]+$/.test(t)}(t)?1:t.length>0?4:3}(t)){case 2:return h.some({listStyleType:h.none(),start:t});case 0:return h.some({listStyleType:h.some("upper-alpha"),start:ke(t).toString()});case 1:return h.some({listStyleType:h.some("lower-alpha"),start:ke(t).toString()});case 3:return h.some({listStyleType:h.none(),start:""});case 4:return h.none()}})(n.getData().start).each((function(n){t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===n.start?"":n.start},styles:{"list-style-type":n.listStyleType.getOr("")}})})),n.close()}})},Me=function(t,n){return function(){var e=vn(t);return s(e)&&e.nodeName===n}},Ie=function(t){t.addCommand("mceListProps",(function(){Pe(t)}))},Re=function(t){t.on("BeforeExecCommand",(function(n){var e=n.command.toLowerCase();"indent"===e?Xn(t):"outdent"===e&&Yn(t)})),t.addCommand("InsertUnorderedList",(function(n,e){ye(t,"UL",e)})),t.addCommand("InsertOrderedList",(function(n,e){ye(t,"OL",e)})),t.addCommand("InsertDefinitionList",(function(n,e){ye(t,"DL",e)})),t.addCommand("RemoveList",(function(){te(t)})),Ie(t),t.addCommand("mceListUpdate",(function(n,e){u(e)&&function(t,n){var e=vn(t);null===e||Tn(t,e)||t.undoManager.transact((function(){u(n.styles)&&t.dom.setStyles(e,n.styles),u(n.attrs)&&Et(n.attrs,(function(n,r){return t.dom.setAttrib(e,r,n)}))}))}(t,e)})),t.addQueryStateHandler("InsertUnorderedList",Me(t,"UL")),t.addQueryStateHandler("InsertOrderedList",Me(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",Me(t,"DL"))},_e=tinymce.util.Tools.resolve("tinymce.html.Node"),Ue=function(t){return 3===t.type},He=function(t){return 0===t.length},$e=function(t){var n=function(n,e){var r=_e.create("li");O(n,(function(t){return r.append(t)})),e?t.insert(r,e,!0):t.append(r)},e=A(t.children(),(function(t,e){return Ue(e)?r(r([],t,!0),[e],!1):He(t)||Ue(e)?t:(n(t,e),[])}),[]);He(e)||n(e)},je=function(t){nn(t)&&function(t){t.on("keydown",(function(n){n.keyCode!==At.TAB||At.metaKeyPressed(n)||t.undoManager.transact((function(){(n.shiftKey?Yn(t):Xn(t))&&n.preventDefault()}))}))}(t),function(t){t.on("ExecCommand",(function(n){var e=n.command.toLowerCase();"delete"!==e&&"forwarddelete"!==e||!we(t)||be(t.dom,t.getBody())})),t.on("keydown",(function(n){n.keyCode===At.BACKSPACE?Ee(t,!1)&&n.preventDefault():n.keyCode===At.DELETE&&Ee(t,!0)&&n.preventDefault()}))}(t)},Fe=function(t,n){return function(e){return e.setEnabled(t.selection.isEditable()),An(t,(function(r){e.setActive(Dn(r.parents,n)),e.setEnabled(!Tn(t,r.element)&&t.selection.isEditable())}))}},Ve=function(t,n){return function(e){return An(t,(function(r){return e.setEnabled(Dn(r.parents,n)&&!Tn(t,r.element))}))}};t.add("lists",(function(t){return function(t){(0,t.options.register)("lists_indent_on_tab",{processor:"boolean",default:!0})}(t),function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("ul,ol",(function(t){return O(t,$e)}))}))}(t),t.hasPlugin("rtc",!0)?Ie(t):(je(t),Re(t)),function(t){var n=function(n){return function(){return t.execCommand(n)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:n("InsertOrderedList"),onSetup:Fe(t,"OL")}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:n("InsertUnorderedList"),onSetup:Fe(t,"UL")}))}(t),function(t){var n={text:"List properties...",icon:"ordered-list",onAction:function(){return t.execCommand("mceListProps")},onSetup:Ve(t,"OL")};t.ui.registry.addMenuItem("listprops",n),t.ui.registry.addContextMenu("lists",{update:function(n){var e=vn(t,n);return Kt(e)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(n){Ee(t,n)}}}(t)}))}(),t}export{e as __require};
2
2
  //# sourceMappingURL=plugin.mjs.map
@@ -1,2 +1,2 @@
1
- import{__exports as e}from"../../../../_virtual/plugin4.mjs";var t;function n(){if(t)return e;t=1;var n=e&&e.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},o=e&&e.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,l=t.length;r<l;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};return function(){var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(e){return function(t){return u=typeof(n=t),(null===n?"null":"object"===u&&Array.isArray(n)?"array":"object"===u&&(a=o=n,(r=String).prototype.isPrototypeOf(a)||(null===(l=o.constructor)||void 0===l?void 0:l.name)===r.name)?"string":u)===e;var n,o,r,l,u,a}},l=function(e){return function(t){return typeof t===e}},u=r("string"),a=r("array"),i=l("boolean"),c=(e=void 0,function(t){return e===t}),s=function(e){return!function(e){return null==e}(e)},f=l("function"),m=l("number"),d=function(){},p=function(e){return function(){return e}},b=function(e){return e},g=function(e,t){return e===t};function h(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=t.concat(n);return e.apply(null,r)}}var v=function(e){e()},y=p(!1),w=p(!0),S=function(){function e(e,t){this.tag=e,this.value=t}return e.some=function(t){return new e(!0,t)},e.none=function(){return e.singletonNone},e.prototype.fold=function(e,t){return this.tag?t(this.value):e()},e.prototype.isSome=function(){return this.tag},e.prototype.isNone=function(){return!this.tag},e.prototype.map=function(t){return this.tag?e.some(t(this.value)):e.none()},e.prototype.bind=function(t){return this.tag?t(this.value):e.none()},e.prototype.exists=function(e){return this.tag&&e(this.value)},e.prototype.forall=function(e){return!this.tag||e(this.value)},e.prototype.filter=function(t){return!this.tag||t(this.value)?this:e.none()},e.prototype.getOr=function(e){return this.tag?this.value:e},e.prototype.or=function(e){return this.tag?this:e},e.prototype.getOrThunk=function(e){return this.tag?this.value:e()},e.prototype.orThunk=function(e){return this.tag?this:e()},e.prototype.getOrDie=function(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")},e.from=function(t){return s(t)?e.some(t):e.none()},e.prototype.getOrNull=function(){return this.tag?this.value:null},e.prototype.getOrUndefined=function(){return this.value},e.prototype.each=function(e){this.tag&&e(this.value)},e.prototype.toArray=function(){return this.tag?[this.value]:[]},e.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},e}();S.singletonNone=new S(!1);var C=Object.keys,T=Object.hasOwnProperty,x=function(e,t){for(var n=C(e),o=0,r=n.length;o<r;o++){var l=n[o];t(e[l],l)}},A=function(e,t){var n,o={};return function(e,t,n,o){x(e,(function(e,r){(t(e,r)?n:o)(e,r)}))}(e,t,(n=o,function(e,t){n[t]=e}),d),o},R=function(e){return function(e,t){var n=[];return x(e,(function(e,o){n.push(t(e,o))})),n}(e,b)},_=function(e){return C(e).length},O=function(e,t){return D(e,t)?S.from(e[t]):S.none()},D=function(e,t){return T.call(e,t)},N=function(e,t){return D(e,t)&&void 0!==e[t]&&null!==e[t]},I=Array.prototype.indexOf,M=Array.prototype.push,P=function(e,t){return function(e,t){return I.call(e,t)}(e,t)>-1},k=function(e,t){for(var n=0,o=e.length;n<o;n++){if(t(e[n],n))return!0}return!1},E=function(e,t){for(var n=[],o=0;o<e;o++)n.push(t(o));return n},B=function(e,t){for(var n=e.length,o=new Array(n),r=0;r<n;r++){var l=e[r];o[r]=t(l,r)}return o},F=function(e,t){for(var n=0,o=e.length;n<o;n++){t(e[n],n)}},q=function(e,t){for(var n=[],o=0,r=e.length;o<r;o++){var l=e[o];t(l,o)&&n.push(l)}return n},j=function(e,t,n){return F(e,(function(e,o){n=t(n,e,o)})),n},L=function(e,t){return function(e,t,n){for(var o=0,r=e.length;o<r;o++){var l=e[o];if(t(l,o))return S.some(l);if(n(l,o))break}return S.none()}(e,t,y)},H=function(e,t){return function(e){for(var t=[],n=0,o=e.length;n<o;++n){if(!a(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);M.apply(t,e[n])}return t}(B(e,t))},V=function(e,t){for(var n=0,o=e.length;n<o;++n){if(!0!==t(e[n],n))return!1}return!0},W=function(e,t){return t>=0&&t<e.length?S.some(e[t]):S.none()},z=function(e,t){for(var n=0;n<e.length;n++){var o=t(e[n],n);if(o.isSome())return o}return S.none()},$=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},U={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){var o="HTML does not have a single root node";throw console.error(o,e),new Error(o)}return $(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return $(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return $(n)},fromDom:$,fromPoint:function(e,t,n){return S.from(e.dom.elementFromPoint(t,n)).map($)}},G=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var o=n;if(void 0!==o.matches)return o.matches(t);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(t);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(t);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},K=function(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount},J=function(e,t){return e.dom===t.dom},Q=G;"undefined"!=typeof window?window:Function("return this;")();var X,Y=function(e){return e.dom.nodeName.toLowerCase()},Z=function(e){return e.dom.nodeType},ee=function(e){return function(t){return Z(t)===e}},te=function(e){return 8===Z(e)||"#comment"===Y(e)},ne=ee(1),oe=ee(3),re=ee(9),le=ee(11),ue=function(e){return function(t){return ne(t)&&Y(t)===e}},ae=function(e){return re(e)?e:(t=e,U.fromDom(t.dom.ownerDocument));var t},ie=function(e){return S.from(e.dom.parentNode).map(U.fromDom)},ce=function(e,t){for(var n=f(t)?t:y,o=e.dom,r=[];null!==o.parentNode&&void 0!==o.parentNode;){var l=o.parentNode,u=U.fromDom(l);if(r.push(u),!0===n(u))break;o=l}return r},se=function(e){return S.from(e.dom.previousSibling).map(U.fromDom)},fe=function(e){return S.from(e.dom.nextSibling).map(U.fromDom)},me=function(e){return B(e.dom.childNodes,U.fromDom)},de=function(e){return function(e,t){var n=e.dom.childNodes;return S.from(n[t]).map(U.fromDom)}(e,0)},pe=f(Element.prototype.attachShadow)&&f(Node.prototype.getRootNode),be=pe?function(e){return U.fromDom(e.dom.getRootNode())}:ae,ge=function(e){var t,n=be(e);return le(t=n)&&s(t.dom.host)?S.some(n):S.none()},he=function(e){return U.fromDom(e.dom.host)},ve=function(e){var t=oe(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n,o,r=t.ownerDocument;return ge(U.fromDom(t)).fold((function(){return r.body.contains(t)}),(n=ve,o=he,function(e){return n(o(e))}))},ye=function(e,t,n,o,r){return e(n,o)?S.some(n):f(r)&&r(n)?S.none():t(n,o,r)},we=function(e,t,n){for(var o=e.dom,r=f(n)?n:y;o.parentNode;){o=o.parentNode;var l=U.fromDom(o);if(t(l))return S.some(l);if(r(l))break}return S.none()},Se=function(e,t,n){return we(e,(function(e){return G(e,t)}),n)},Ce=function(e,t){return function(e,t){return L(e.dom.childNodes,(function(e){return t(U.fromDom(e))})).map(U.fromDom)}(e,(function(e){return G(e,t)}))},Te=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return K(n)?S.none():S.from(n.querySelector(e)).map(U.fromDom)}(t,e)},xe=function(e,t,n){return ye((function(e,t){return G(e,t)}),Se,e,t,n)},Ae=function(e,t){return void 0===t&&(t=!1),ve(e)?e.dom.isContentEditable:(n=e,xe(n,"[contenteditable]")).fold(p(t),(function(e){return"true"===Re(e)}));var n},Re=function(e){return e.dom.contentEditable},_e=function(e){return function(t){return J(t,function(e){return U.fromDom(e.getBody())}(e))}},Oe=function(e){return/^\d+(\.\d+)?$/.test(e)?e+"px":e},De=function(e){return U.fromDom(e.selection.getStart())},Ne=function(e){return(t=e,n=ue("table"),ye((function(e,t){return t(e)}),we,t,n,o)).forall(Ae);var t,n,o},Ie=function(e,t){var n=[];return F(me(e),(function(e){t(e)&&(n=n.concat([e])),n=n.concat(Ie(e,t))})),n},Me=function(e,t){return function(e,t){return q(me(e),t)}(e,(function(e){return G(e,t)}))},Pe=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return K(n)?[]:B(n.querySelectorAll(e),U.fromDom)}(t,e)},ke=function(e,t,n){if(!(u(n)||i(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Ee=function(e,t,n){ke(e.dom,t,n)},Be=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n},Fe=function(e,t){return S.from(Be(e,t))},qe=function(e,t){e.dom.removeAttribute(t)},je=function(e,t,n){return void 0===n&&(n=g),e.exists((function(e){return n(e,t)}))},Le=function(e,t,n){return e.isSome()&&t.isSome()?S.some(n(e.getOrDie(),t.getOrDie())):S.none()},He=function(e,t){return function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}(e,t,0)},Ve=(X=/^\s+|\s+$/g,function(e){return e.replace(X,"")}),We=function(e){return e.length>0},ze=function(e,t){void 0===t&&(t=10);var n=parseInt(e,t);return isNaN(n)?S.none():S.some(n)},$e=function(e){return void 0!==e.style&&f(e.style.getPropertyValue)},Ue=function(e,t,n){!function(e,t,n){if(!u(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);$e(e)&&e.style.setProperty(t,n)}(e.dom,t,n)},Ge=function(e,t){var n=e.dom,o=window.getComputedStyle(n).getPropertyValue(t);return""!==o||ve(e)?o:Ke(n,t)},Ke=function(e,t){return $e(e)?e.style.getPropertyValue(t):""},Je=function(e,t){var n=e.dom,o=Ke(n,t);return S.from(o).filter((function(e){return e.length>0}))},Qe=function(e,t){!function(e,t){$e(e)&&e.style.removeProperty(t)}(e.dom,t),je(Fe(e,"style").map(Ve),"")&&qe(e,"style")},Xe=function(e,t,n){return void 0===n&&(n=0),Fe(e,t).map((function(e){return parseInt(e,10)})).getOr(n)},Ye=function(e,t){return Ze(e,t,w)},Ze=function(e,t,n){return H(me(e),(function(e){return G(e,t)?n(e)?[e]:[]:Ze(e,t,n)}))},et=["tfoot","thead","tbody","colgroup"],tt=function(e,t,n){return{element:e,rowspan:t,colspan:n}},nt=function(e,t,n){return{element:e,cells:t,section:n}},ot=function(e,t){return function(e,t,n){return void 0===n&&(n=y),n(t)?S.none():P(e,Y(t))?S.some(t):Se(t,e.join(","),(function(e){return G(e,"table")||n(e)}))}(["td","th"],e,t)},rt=function(e,t){return xe(e,"table",t)},lt=function(e){return Ye(e,"tr")},ut=function(e){return rt(e).fold(p([]),(function(e){return Me(e,"colgroup")}))},at=function(e,t){return B(e,(function(e){if("colgroup"===Y(e)){var n=B(function(e){return G(e,"colgroup")?Me(e,"col"):H(ut(e),(function(e){return Me(e,"col")}))}(e),(function(e){var t=Xe(e,"span",1);return tt(e,1,t)}));return nt(e,n,"colgroup")}var o=B(function(e){return Ye(e,"th,td")}(e),(function(e){var t=Xe(e,"rowspan",1),n=Xe(e,"colspan",1);return tt(e,t,n)}));return nt(e,o,t(e))}))},it=function(e){return ie(e).map((function(e){var t=Y(e);return function(e){return P(et,e)}(t)?t:"tbody"})).getOr("tbody")},ct=function(e){return Fe(e,"data-snooker-locked-cols").bind((function(e){return S.from(e.match(/\d+/g))})).map((function(e){return function(e,t){for(var n={},o=0,r=e.length;o<r;o++){var l=e[o];n[String(l)]=t(l,o)}return n}(e,w)}))},st=function(e,t){return e+","+t},ft=function(e,t){var n=H(e.all,(function(e){return e.cells}));return q(n,t)},mt=function(e){var t,n={},o=[],r=(t=e,W(t,0)).map((function(e){return e.element})).bind(rt).bind(ct).getOr({}),l=0,u=0,a=0,i=function(e,t){for(var n=[],o=[],r=0,l=e.length;r<l;r++){var u=e[r];(t(u,r)?n:o).push(u)}return{pass:n,fail:o}}(e,(function(e){return"colgroup"===e.section})),c=i.pass,s=i.fail;F(s,(function(e){var t=[];F(e.cells,(function(e){for(var o=0;void 0!==n[st(a,o)];)o++;for(var l=N(r,o.toString()),i=function(e,t,n,o,r,l){return{element:e,rowspan:t,colspan:n,row:o,column:r,isLocked:l}}(e.element,e.rowspan,e.colspan,a,o,l),c=0;c<e.colspan;c++)for(var s=0;s<e.rowspan;s++){var f=o+c,m=st(a+s,f);n[m]=i,u=Math.max(u,f+1)}t.push(i)})),l++,o.push(nt(e.element,t,e.section)),a++}));var f=function(e){return W(e,e.length-1)}(c).map((function(e){var t=function(e){var t={},n=0;return F(e.cells,(function(e){var o=e.colspan;E(o,(function(r){var l=n+r;t[l]=function(e,t,n){return{element:e,colspan:t,column:n}}(e.element,o,l)})),n+=o})),t}(e),n=function(e,t){return{element:e,columns:t}}(e.element,R(t));return{colgroups:[n],columns:t}})).getOrThunk((function(){return{colgroups:[],columns:{}}})),m=f.columns,d=f.colgroups,p=function(e,t){return{rows:e,columns:t}}(l,u);return{grid:p,access:n,all:o,columns:m,colgroups:d}},dt=function(e){var t=function(e){var t=lt(e),n=ut(e),r=o(o([],n,!0),t,!0);return at(r,it)}(e);return mt(t)},pt=function(e,t,n){return S.from(e.access[st(t,n)])},bt=function(e,t,n){var o=ft(e,(function(e){return n(t,e.element)}));return o.length>0?S.some(o[0]):S.none()},gt=function(e){return H(e.all,(function(e){return e.cells}))},ht=function(e,t){return S.from(e.columns[t])},vt=tinymce.util.Tools.resolve("tinymce.util.Tools"),yt=function(e,t,n){for(var o,r=e.select("td,th",t),l=0;l<r.length;l++){var u=e.getStyle(r[l],n);if(c(o)&&(o=u),o!==u)return""}return o},wt=function(e,t,n){vt.each("left center right".split(" "),(function(o){o!==n&&e.formatter.remove("align"+o,{},t)})),n&&e.formatter.apply("align"+n,{},t)},St=function(e,t,o){e.dispatch("TableModified",n(n({},o),{table:t}))},Ct=function(e,t){return(n=e,o=parseFloat(n),isNaN(o)?S.none():S.some(o)).getOr(t);var n,o},Tt=function(e,t,n){return Ct(Ge(e,t),n)},xt=function(e,t){var n=e.dom,o=n.getBoundingClientRect().width||n.offsetWidth;return"border-box"===t?o:function(e,t,n,o){return t-Tt(e,"padding-".concat(n),0)-Tt(e,"padding-".concat(o),0)-Tt(e,"border-".concat(n,"-width"),0)-Tt(e,"border-".concat(o,"-width"),0)}(e,o,"left","right")},At=function(e){return xt(e,"content-box")},Rt=tinymce.util.Tools.resolve("tinymce.Env"),_t=E(5,(function(e){var t="".concat(e+1,"px");return{title:t,value:t}})),Ot=B(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(e){return{title:e,value:e.toLowerCase()}})),Dt="100%",Nt=function(e){var t,n=e.dom,o=null!==(t=n.getParent(e.selection.getStart(),n.isBlock))&&void 0!==t?t:e.getBody();return At(U.fromDom(o))+"px"},It=function(e){return function(t){return t.options.get(e)}},Mt=It("table_sizing_mode"),Pt=It("table_border_widths"),kt=It("table_border_styles"),Et=It("table_cell_advtab"),Bt=It("table_row_advtab"),Ft=It("table_advtab"),qt=It("table_appearance_options"),jt=It("table_grid"),Lt=It("table_style_by_css"),Ht=It("table_cell_class_list"),Vt=It("table_row_class_list"),Wt=It("table_class_list"),zt=It("table_toolbar"),$t=It("table_background_color_map"),Ut=It("table_border_color_map"),Gt=function(e){return"fixed"===Mt(e)},Kt=function(e){return"responsive"===Mt(e)},Jt=function(e){var t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:function(e,t){return Kt(e)||!Lt(e)?t:Gt(e)?n(n({},t),{width:Nt(e)}):n(n({},t),{width:Dt})}(e,o)},Qt=function(e){var t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:function(e,t){return Kt(e)||Lt(e)?t:Gt(e)?n(n({},t),{width:Nt(e)}):n(n({},t),{width:Dt})}(e,o)},Xt=function(e,t){return t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow},Yt=function(e,t,n){var o=bt(e,t,J),r=bt(e,n,J);return o.bind((function(e){return r.map((function(t){return n=e,o=t,r=Math.min(n.row,o.row),l=Math.min(n.column,o.column),u=Math.max(n.row+n.rowspan-1,o.row+o.rowspan-1),a=Math.max(n.column+n.colspan-1,o.column+o.colspan-1),{startRow:r,startCol:l,finishRow:u,finishCol:a};var n,o,r,l,u,a}))}))},Zt=function(e,t,n){return Yt(e,t,n).bind((function(t){return function(e,t){for(var n=!0,o=h(Xt,t),r=t.startRow;r<=t.finishRow;r++)for(var l=t.startCol;l<=t.finishCol;l++)n=n&&pt(e,r,l).exists(o);return n?S.some(t):S.none()}(e,t)}))},en=dt,tn=function(e,t){ie(e).each((function(n){n.dom.insertBefore(t.dom,e.dom)}))},nn=function(e,t){fe(e).fold((function(){ie(e).each((function(e){rn(e,t)}))}),(function(e){tn(e,t)}))},on=function(e,t){de(e).fold((function(){rn(e,t)}),(function(n){e.dom.insertBefore(t.dom,n.dom)}))},rn=function(e,t){e.dom.appendChild(t.dom)},ln=function(e,t){tn(e,t),rn(t,e)},un=function(e,t){F(t,(function(n,o){var r=0===o?e:t[o-1];nn(r,n)}))},an=function(e,t){F(t,(function(t){rn(e,t)}))},cn=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},sn=function(e){var t=me(e);t.length>0&&un(e,t),cn(e)},fn=function(e,t){var n=function(t){return e(t)?S.from(t.dom.nodeValue):S.none()};return{get:function(o){if(!e(o))throw new Error("Can only get "+t+" value of a "+t+" node");return n(o).getOr("")},getOption:n,set:function(n,o){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=o}}}(oe,"text"),mn=function(e){return fn.get(e)},dn=function(e,t){return fn.set(e,t)},pn=["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"],bn=function(e,t,n,o){var r,l,u=t(e,n);return r=function(n,o){var r=t(e,o);return gn(e,n,r)},l=u,function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n)}(o,(function(e,t){l=r(l,e,t)})),l},gn=function(e,t,n){return t.bind((function(t){return n.filter(h(e.eq,t))}))},hn=function(e,t,n){return n.length>0?function(e,t,n,o){return o(e,t,n[0],n.slice(1))}(e,t,n,bn):S.none()},vn={up:p({selector:Se,closest:xe,predicate:we,all:ce}),down:p({selector:Pe,predicate:Ie}),styles:p({get:Ge,getRaw:Je,set:Ue,remove:Qe}),attrs:p({get:Be,set:Ee,remove:qe,copyTo:function(e,t){!function(e,t){var n=e.dom;x(t,(function(e,t){ke(n,t,e)}))}(t,j(e.dom.attributes,(function(e,t){return e[t.name]=t.value,e}),{}))}}),insert:p({before:tn,after:nn,afterAll:un,append:rn,appendAll:an,prepend:on,wrap:ln}),remove:p({unwrap:sn,remove:cn}),create:p({nu:U.fromTag,clone:function(e){return U.fromDom(e.dom.cloneNode(!1))},text:U.fromText}),query:p({comparePosition:function(e,t){return e.dom.compareDocumentPosition(t.dom)},prevSibling:se,nextSibling:fe}),property:p({children:me,name:Y,parent:ie,document:function(e){return ae(e).dom},isText:oe,isComment:te,isElement:ne,isSpecial:function(e){var t=Y(e);return P(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:function(e){return ne(e)?Fe(e,"lang"):S.none()},getText:mn,setText:dn,isBoundary:function(e){return!!ne(e)&&("body"===Y(e)||P(pn,Y(e)))},isEmptyTag:function(e){return!!ne(e)&&P(["br","img","hr","input"],Y(e))},isNonEditable:function(e){return ne(e)&&"false"===Be(e,"contenteditable")}}),eq:J,is:Q},yn=function(e){return Se(e,"table")},wn=function(e,t,n){return Te(e,t).bind((function(t){return Te(e,n).bind((function(e){return(n=yn,o=[t,e],hn(vn,(function(e,t){return n(t)}),o)).map((function(n){return{first:t,last:e,table:n}}));var n,o}))}))},Sn=function(e,t){return function(e,t){var n=Pe(e,t);return n.length>0?S.some(n):S.none()}(e,t)},Cn=function(e,t,n){return wn(e,t,n).bind((function(t){var n=function(t){return J(e,t)},o="thead,tfoot,tbody,table",r=Se(t.first,o,n),l=Se(t.last,o,n);return r.bind((function(e){return l.bind((function(n){return J(e,n)?function(e,t,n){var o=en(e);return Zt(o,t,n)}(t.table,t.first,t.last):S.none()}))}))}))},Tn=function(e){return B(e,U.fromDom)},xn="data-mce-selected",An="data-mce-first-selected",Rn="data-mce-last-selected",_n={selected:xn,selectedSelector:"td["+xn+"],th["+xn+"]",firstSelected:An,firstSelectedSelector:"td["+An+"],th["+An+"]",lastSelected:Rn,lastSelectedSelector:"td["+Rn+"],th["+Rn+"]"},On=function(e){return function(t,n){var o,r=Y(t),l="col"===r||"colgroup"===r?rt(o=t).bind((function(e){return Sn(e,_n.firstSelectedSelector)})).fold(p(o),(function(e){return e[0]})):t;return xe(l,e,n)}},Dn=On("th,td,caption"),Nn=On("th,td"),In=function(e){return Tn(e.model.table.getSelectedCells())},Mn=function(e,t){var n=Nn(e),o=n.bind((function(e){return rt(e)})).map((function(e){return lt(e)}));return Le(n,o,(function(e,n){return q(n,(function(n){return k(Tn(n.dom.cells),(function(n){return"1"===Be(n,t)||J(n,e)}))}))})).getOr([])},Pn=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],kn=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,En=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Bn=function(e){return(t=e,n="#",He(t,n)?function(e,t){return e.substring(t)}(t,n.length):t).toUpperCase();var t,n},Fn=function(e){return function(e){return kn.test(e)||En.test(e)}(e)?S.some({value:Bn(e)}):S.none()},qn=function(e){var t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},jn=function(e){return function(e){return{value:Bn(e)}}(qn(e.red)+qn(e.green)+qn(e.blue))},Ln=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,Hn=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Vn=function(e,t,n,o){return{red:e,green:t,blue:n,alpha:o}},Wn=function(e,t,n,o){var r=parseInt(e,10),l=parseInt(t,10),u=parseInt(n,10),a=parseFloat(o);return Vn(r,l,u,a)},zn=function(e){if("transparent"===e)return S.some(Vn(0,0,0,0));var t=Ln.exec(e);if(null!==t)return S.some(Wn(t[1],t[2],t[3],"1"));var n=Hn.exec(e);return null!==n?S.some(Wn(n[1],n[2],n[3],n[4])):S.none()},$n=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},Un=function(){return e=function(e){return e.unbind()},t=$n(S.none()),n=function(){return t.get().each(e)},{clear:function(){n(),t.set(S.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(S.some(e))}};var e,t,n},Gn=function(e,t,n){return function(o){var r=Un(),l=!We(n),u=function(){var u=In(e),a=function(o){return e.formatter.match(t,{value:n},o.dom,l)};l?(o.setActive(!k(u,a)),r.set(e.formatter.formatChanged(t,(function(e){return o.setActive(!e)}),!0))):(o.setActive(V(u,a)),r.set(e.formatter.formatChanged(t,o.setActive,!1,{value:n})))};return e.initialized?u():e.on("init",u),r.clear}},Kn=function(e){return N(e,"menu")},Jn=function(e){return B(e,(function(e){var t=e.text||e.title||"";return Kn(e)?{text:t,items:Jn(e.menu)}:{text:t,value:e.value}}))},Qn=function(e,t,n,o){return B(t,(function(t){var r=t.text||t.title;return Kn(t)?{type:"nestedmenuitem",text:r,getSubmenuItems:function(){return Qn(e,t.menu,n,o)}}:{text:r,type:"togglemenuitem",onAction:function(){return o(t.value)},onSetup:Gn(e,n,t.value)}}))},Xn=function(e,t){return function(n){var o;e.execCommand("mceTableApplyCellStyle",!1,((o={})[t]=n,o))}},Yn=function(e){return H(e,(function(e){return Kn(e)?[n(n({},e),{menu:Yn(e.menu)})]:We(e.value)?[e]:[]}))},Zn=function(e,t,n,o){return function(r){return r(Qn(e,t,n,o))}},eo=function(e,t,n){var o=B(t,(function(e){return{text:e.title,value:"#"+(t=e.value,Fn(t).orThunk((function(){return zn(t).map(jn)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var o=n.getImageData(0,0,1,1).data,r=o[0],l=o[1],u=o[2],a=o[3];return jn(Vn(r,l,u,a))}))).value,type:"choiceitem"};var t}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:o.length>0?o:void 0,allowCustomColors:!1},onAction:function(t){var o,r="remove"===t.value?"":t.value;e.execCommand("mceTableApplyCellStyle",!1,((o={})[n]=r,o))}}]},to=function(e){return function(){var t="header"===e.queryCommandValue("mceTableRowType")?"body":"header";e.execCommand("mceTableRowType",!1,{type:t})}},no=function(e){return function(){var t="th"===e.queryCommandValue("mceTableColType")?"td":"th";e.execCommand("mceTableColType",!1,{type:t})}},oo=[{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:Pn}],ro=function(e){return oo.concat(function(e){var t=Jn(Ht(e));return t.length>0?S.some({name:"class",type:"listbox",label:"Class",items:t}):S.none()}(e).toArray())},lo=function(e,t){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Jn(kt(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(n):n}},uo=function(e,t){var n=e.dom;return{setAttrib:function(e,o){n.setAttrib(t,e,o)},setStyle:function(e,o){n.setStyle(t,e,o)},setFormat:function(n,o){""===o?e.formatter.remove(n,{value:null},t,!0):e.formatter.apply(n,{value:o},t)}}},ao=ue("th"),io=function(e,t){return e&&t?"sectionCells":e?"section":"cells"},co=function(e){var t=q(e,(function(e){return ao(e.element)}));return 0===t.length?S.some("td"):t.length===e.length?S.some("th"):S.none()},so=function(e){var t=B(e,(function(e){return function(e){var t="thead"===e.section,n=je(co(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||n?{type:"header",subType:io(t,n)}:{type:"body"}}(e).type})),n=P(t,"header"),o=P(t,"footer");if(n||o){var r=P(t,"body");return!n||r||o?n||r||!o?S.none():S.some("footer"):S.some("header")}return S.some("body")},fo=function(e,t){return z(e.all,(function(e){return L(e.cells,(function(e){return J(t,e.element)}))}))},mo=function(e,t,n){var o,r,l=function(e){for(var t=[],n=function(e){t.push(e)},o=0;o<e.length;o++)e[o].each(n);return t}(B(t.selection,(function(t){return ot(t).bind((function(t){return fo(e,t)})).filter(n)})));return o=l.length>0,r=l,o?S.some(r):S.none()},po=function(e,t){return mo(e,t,w)},bo=function(e,t){return V(t,(function(t){return function(e,t){return fo(e,t).exists((function(e){return!e.isLocked}))}(e,t)}))},go=function(e,t){return function(e,t){return t.mergable}(0,t).filter((function(t){return bo(e,t.cells)}))},ho=function(e,t){return function(e,t){return t.unmergable}(0,t).filter((function(t){return bo(e,t)}))},vo=function(e){if(!a(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return F(e,(function(o,r){var l=C(o);if(1!==l.length)throw new Error("one and only one name per case");var u=l[0],i=o[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!a(i))throw new Error("case arguments must be an array");t.push(u),n[u]=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var l=n.length;if(l!==i.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+i.length+" ("+i+"), got "+l);return{fold:function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];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,n)},match:function(e){var o=C(e);if(t.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+o.join(","));if(!V(t,(function(e){return P(o,e)})))throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+t.join(", "));return e[u].apply(null,n)},log:function(e){console.log(e,{constructors:t,constructor:u,params:n})}}}})),n},yo=vo([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]);n({},yo);var wo=function(e,t){var n=dt(e);return po(n,t).bind((function(e){var t=e[e.length-1],o=e[0].row,r=t.row+t.rowspan,l=n.all.slice(o,r);return so(l)})).getOr("")},So=function(e){return He(e,"rgb")?zn(t=e).map(jn).map((function(e){return"#"+e.value})).getOr(t):e;var t},Co=function(e){var t=U.fromDom(e);return{borderwidth:Je(t,"border-width").getOr(""),borderstyle:Je(t,"border-style").getOr(""),bordercolor:Je(t,"border-color").map(So).getOr(""),backgroundcolor:Je(t,"background-color").map(So).getOr("")}},To=function(e){var t=e[0],n=e.slice(1);return F(n,(function(e){F(C(t),(function(n){x(e,(function(e,o){var r=t[n];""!==r&&n===o&&r!==e&&(t[n]="")}))}))})),t},xo=function(e,t,n,o){return L(e,(function(e){return!c(n.formatter.matchNode(o,t+e))})).getOr("")},Ao=h(xo,["left","center","right"],"align"),Ro=h(xo,["top","middle","bottom"],"valign"),_o=function(e){return rt(U.fromDom(e)).map((function(t){var n={selection:Tn(e.cells)};return wo(t,n)})).getOr("")},Oo=function(e,t){var n=dt(e),o=gt(n),r=q(o,(function(e){return k(t,(function(t){return J(e.element,t)}))}));return B(r,(function(e){return{element:e.element.dom,column:ht(n,e.column).map((function(e){return e.element.dom}))}}))},Do=function(e,t,n,o){var r=1===t.length;F(t,(function(t){var l=t.element,u=r?w:o,a=uo(e,l);!function(e,t,n,o){o("scope")&&e.setAttrib("scope",n.scope),o("class")&&e.setAttrib("class",n.class),o("height")&&e.setStyle("height",Oe(n.height)),o("width")&&t.setStyle("width",Oe(n.width))}(a,t.column.map((function(t){return uo(e,t)})).getOr(a),n,u),Et(e)&&function(e,t,n){n("backgroundcolor")&&e.setFormat("tablecellbackgroundcolor",t.backgroundcolor),n("bordercolor")&&e.setFormat("tablecellbordercolor",t.bordercolor),n("borderstyle")&&e.setFormat("tablecellborderstyle",t.borderstyle),n("borderwidth")&&e.setFormat("tablecellborderwidth",Oe(t.borderwidth))}(a,n,u),o("halign")&&wt(e,l,n.halign),o("valign")&&function(e,t,n){vt.each("top middle bottom".split(" "),(function(o){o!==n&&e.formatter.remove("valign"+o,{},t)})),n&&e.formatter.apply("valign"+n,{},t)}(e,l,n.valign)}))},No=function(e,t,n,o){var r=o.getData();o.close(),e.undoManager.transact((function(){!function(e,t,n,o){var r=A(o,(function(e,t){return n[t]!==e}));_(r)>0&&t.length>=1&&rt(t[0]).each((function(n){var l=Oo(n,t),u=_(A(r,(function(e,t){return"scope"!==t&&"celltype"!==t})))>0,a=D(r,"celltype");(u||D(r,"scope"))&&Do(e,l,o,h(D,r)),a&&function(e,t){e.execCommand("mceTableCellType",!1,{type:t.celltype,no_events:!0})}(e,o),St(e,n.dom,{structure:a,style:u})}))}(e,t,n,r),e.focus()}))},Io=function(e,t){var o=rt(t[0]).map((function(o){return B(Oo(o,t),(function(t){return function(e,t,o,r){var l,u=e.dom,a=r.getOr(t),i=function(e,t){return u.getStyle(e,t)||u.getAttrib(e,t)};return n({width:i(a,"width"),height:i(t,"height"),scope:u.getAttrib(t,"scope"),celltype:(l=t,l.nodeName.toLowerCase()),class:u.getAttrib(t,"class",""),halign:Ao(e,t),valign:Ro(e,t)},o?Co(t):{})}(e,t.element,Et(e),t.column)}))}));return To(o.getOrDie())},Mo=function(e){var t=In(e);if(0!==t.length){var n=Io(e,t),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:ro(e)},lo(e,"cell")]},r={type:"panel",items:[{type:"grid",columns:2,items:ro(e)}]};e.windowManager.open({title:"Cell Properties",size:"normal",body:Et(e)?o:r,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:n,onSubmit:h(No,e,t,n)})}},Po=[{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"}],ko=function(e){return Po.concat(function(e){var t=Jn(Vt(e));return t.length>0?S.some({name:"class",type:"listbox",label:"Class",items:t}):S.none()}(e).toArray())},Eo=function(e,t,n,o){var r=1===t.length?w:o;F(t,(function(t){var l=uo(e,t);!function(e,t,n){n("class")&&e.setAttrib("class",t.class),n("height")&&e.setStyle("height",Oe(t.height))}(l,n,r),Bt(e)&&function(e,t,n){n("backgroundcolor")&&e.setStyle("background-color",t.backgroundcolor),n("bordercolor")&&e.setStyle("border-color",t.bordercolor),n("borderstyle")&&e.setStyle("border-style",t.borderstyle)}(l,n,r),o("align")&&wt(e,t,n.align)}))},Bo=function(e,t,n,o){var r=o.getData();o.close(),e.undoManager.transact((function(){!function(e,t,n,o){var r=A(o,(function(e,t){return n[t]!==e}));if(_(r)>0){var l=D(r,"type"),u=!l||_(r)>1;u&&Eo(e,t,o,h(D,r)),l&&function(e,t){e.execCommand("mceTableRowType",!1,{type:t.type,no_events:!0})}(e,o),rt(U.fromDom(t[0])).each((function(t){return St(e,t.dom,{structure:l,style:u})}))}}(e,t,n,r),e.focus()}))},Fo=function(e){var t=Mn(De(e),_n.selected);if(0!==t.length){var o=B(t,(function(t){return function(e,t,o){var r=e.dom;return n({height:r.getStyle(t,"height")||r.getAttrib(t,"height"),class:r.getAttrib(t,"class",""),type:_o(t),align:Ao(e,t)},o?Co(t):{})}(e,t.dom,Bt(e))})),r=To(o),l={type:"tabpanel",tabs:[{title:"General",name:"general",items:ko(e)},lo(e,"row")]},u={type:"panel",items:[{type:"grid",columns:2,items:ko(e)}]};e.windowManager.open({title:"Row Properties",size:"normal",body:Bt(e)?l:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:h(Bo,e,B(t,(function(e){return e.dom})),r)})}},qo=function(e,t,n){var o=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],r=qt(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"}]}]:[],l=t.length>0?[{type:"listbox",name:"class",label:"Class",items:t}]:[];return o.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(r).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(l)},jo=function(e,t,n,o){if("TD"===t.tagName||"TH"===t.tagName)u(n)&&s(o)?e.setStyle(t,n,o):e.setStyles(t,n);else if(t.children)for(var r=0;r<t.children.length;r++)jo(e,t.children[r],n,o)},Lo=function(e,t,o,r){var l=e.dom,u={},a={},i=Lt(e),s=Ft(e);if(c(o.class)||(u.class=o.class),a.height=Oe(o.height),i?a.width=Oe(o.width):l.getAttrib(t,"width")&&(u.width=function(e){return e?e.replace(/px$/,""):""}(o.width)),i?(a["border-width"]=Oe(o.border),a["border-spacing"]=Oe(o.cellspacing)):(u.border=o.border,u.cellpadding=o.cellpadding,u.cellspacing=o.cellspacing),i&&t.children){var f={};if(r.border&&(f["border-width"]=Oe(o.border)),r.cellpadding&&(f.padding=Oe(o.cellpadding)),s&&r.bordercolor&&(f["border-color"]=o.bordercolor),!function(e){for(var t in e)if(T.call(e,t))return!1;return!0}(f))for(var m=0;m<t.children.length;m++)jo(l,t.children[m],f)}if(s){var d=o;a["background-color"]=d.backgroundcolor,a["border-color"]=d.bordercolor,a["border-style"]=d.borderstyle}l.setStyles(t,n(n({},Jt(e)),a)),l.setAttribs(t,n(n({},Qt(e)),u))},Ho=function(e,t,n,o){var r=e.dom,l=o.getData(),u=A(l,(function(e,t){return n[t]!==e}));o.close(),""===l.class&&delete l.class,e.undoManager.transact((function(){if(!t){var n=ze(l.cols).getOr(1),o=ze(l.rows).getOr(1);e.execCommand("mceInsertTable",!1,{rows:o,columns:n}),t=Nn(De(e),_e(e)).bind((function(t){return rt(t,_e(e))})).map((function(e){return e.dom})).getOrDie()}if(_(u)>0){var a={border:D(u,"border"),bordercolor:D(u,"bordercolor"),cellpadding:D(u,"cellpadding")};Lo(e,t,l,a);var i=r.select("caption",t)[0];(i&&!l.caption||!i&&l.caption)&&e.execCommand("mceTableToggleCaption"),wt(e,t,l.align)}if(e.focus(),e.addVisual(),_(u)>0){var c=D(u,"caption"),s=!c||_(u)>1;St(e,t,{structure:c,style:s})}}))},Vo=function(e,t){var o,r=e.dom,l=function(e,t){var o,r,l,u=Jt(e),a=Qt(e),i=t?{borderstyle:O(u,"border-style").getOr(""),bordercolor:So(O(u,"border-color").getOr("")),backgroundcolor:So(O(u,"background-color").getOr(""))}:{};return n(n(n(n(n(n({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),i),(l=u["border-width"],Lt(e)&&l?{border:l}:O(a,"border").fold((function(){return{}}),(function(e){return{border:e}})))),(o=O(u,"border-spacing").or(O(a,"cellspacing")).fold((function(){return{}}),(function(e){return{cellspacing:e}})),r=O(u,"border-padding").or(O(a,"cellpadding")).fold((function(){return{}}),(function(e){return{cellpadding:e}})),n(n({},o),r)))}(e,Ft(e));t?(l.cols="1",l.rows="1",Ft(e)&&(l.borderstyle="",l.bordercolor="",l.backgroundcolor="")):(o=r.getParent(e.selection.getStart(),"table",e.getBody()))?l=function(e,t,o){var r=e.dom,l=Lt(e)?r.getStyle(t,"border-spacing")||r.getAttrib(t,"cellspacing"):r.getAttrib(t,"cellspacing")||r.getStyle(t,"border-spacing"),u=Lt(e)?yt(r,t,"padding")||r.getAttrib(t,"cellpadding"):r.getAttrib(t,"cellpadding")||yt(r,t,"padding");return n({width:r.getStyle(t,"width")||r.getAttrib(t,"width"),height:r.getStyle(t,"height")||r.getAttrib(t,"height"),cellspacing:null!=l?l:"",cellpadding:null!=u?u:"",border:function(t,n){var o=Je(U.fromDom(n),"border-width");return Lt(e)&&o.isSome()?o.getOr(""):t.getAttrib(n,"border")||yt(e.dom,n,"border-width")||yt(e.dom,n,"border")||""}(r,t),caption:!!r.select("caption",t)[0],class:r.getAttrib(t,"class",""),align:Ao(e,t)},o?Co(t):{})}(e,o,Ft(e)):Ft(e)&&(l.borderstyle="",l.bordercolor="",l.backgroundcolor="");var u=Jn(Wt(e));u.length>0&&l.class&&(l.class=l.class.replace(/\s*mce\-item\-table\s*/g,""));var a={type:"grid",columns:2,items:qo(e,u,t)},i=Ft(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},lo(e,"table")]}:{type:"panel",items:[a]};e.windowManager.open({title:"Table Properties",size:"normal",body:i,onSubmit:h(Ho,e,o,l),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l})},Wo=function(e){x({mceTableProps:h(Vo,e,!1),mceTableRowProps:h(Fo,e),mceTableCellProps:h(Mo,e),mceInsertTableDialog:h(Vo,e,!0)},(function(t,n){return e.addCommand(n,(function(){return n=t,void(Ne(De(e))&&n());var n}))}))},zo=b,$o=function(e){var t=function(e,t){return Fe(e,t).exists((function(e){return parseInt(e,10)>1}))};return e.length>0&&V(e,(function(e){return t(e,"rowspan")||t(e,"colspan")}))?S.some(e):S.none()},Uo=function(e,t,n){return t.length<=1?S.none():Cn(e,n.firstSelectedSelector,n.lastSelectedSelector).map((function(e){return{bounds:e,cells:t}}))},Go=function(e){var t=$n(S.none()),n=$n([]),o=S.none(),r=ue("caption"),l=function(e){return o.forall((function(t){return!t[e]}))},u=function(){return Dn(function(e){return U.fromDom(e.selection.getEnd())}(e),_e(e))},a=function(){return Dn(De(e),_e(e)).bind((function(t){return n=Le(rt(t),u().bind(rt),(function(n,o){return J(n,o)?r(t)?S.some(function(e){return{element:e,mergable:S.none(),unmergable:S.none(),selection:[e]}}(t)):S.some(function(e,t,n){return{element:n,mergable:Uo(t,e,_n),unmergable:$o(e),selection:zo(e)}}(In(e),n,t)):S.none()})),n.bind(b);var n}))},i=function(e){return rt(e.element).map((function(t){var n=dt(t),o=po(n,e).getOr([]),r=j(o,(function(e,t){return t.isLocked&&(e.onAny=!0,0===t.column?e.onFirst=!0:t.column+t.colspan>=n.grid.columns&&(e.onLast=!0)),e}),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:go(n,e).isSome(),unmergeable:ho(n,e).isSome(),locked:r}}))},c=function(){t.set(function(e){var t,n=!1;return function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];return n||(n=!0,t=e.apply(null,o)),t}}(a)()),o=t.get().bind(i),F(n.get(),v)},s=function(e){return e(),n.set(n.get().concat([e])),function(){n.set(q(n.get(),(function(t){return t!==e})))}},f=function(n,o){return s((function(){return t.get().fold((function(){n.setEnabled(!1)}),(function(t){n.setEnabled(!o(t)&&e.selection.isEditable())}))}))},m=function(n,o,r){return s((function(){return t.get().fold((function(){n.setEnabled(!1),n.setActive(!1)}),(function(t){n.setEnabled(!o(t)&&e.selection.isEditable()),n.setActive(r(t))}))}))},d=function(e){return o.exists((function(t){return t.locked[e]}))},p=function(t,n){return function(o){return m(o,(function(e){return r(e.element)}),(function(){return e.queryCommandValue(t)===n}))}},g=p("mceTableRowType","header"),h=p("mceTableColType","th");return e.on("NodeChange ExecCommand TableSelectorChange",c),{onSetupTable:function(e){return f(e,(function(e){return!1}))},onSetupCellOrRow:function(e){return f(e,(function(e){return r(e.element)}))},onSetupColumn:function(e){return function(t){return f(t,(function(t){return r(t.element)||d(e)}))}},onSetupPasteable:function(e){return function(t){return f(t,(function(t){return r(t.element)||e().isNone()}))}},onSetupPasteableColumn:function(e,t){return function(n){return f(n,(function(n){return r(n.element)||e().isNone()||d(t)}))}},onSetupMergeable:function(e){return f(e,(function(e){return l("mergeable")}))},onSetupUnmergeable:function(e){return f(e,(function(e){return l("unmergeable")}))},resetTargets:c,onSetupTableWithCaption:function(t){return m(t,y,(function(t){return rt(t.element,_e(e)).exists((function(e){return Ce(e,"caption").isSome()}))}))},onSetupTableRowHeaders:g,onSetupTableColumnHeaders:h,targets:t.get}},Ko=tinymce.util.Tools.resolve("tinymce.FakeClipboard"),Jo="x-tinymce/dom-table-",Qo=Jo+"rows",Xo=Jo+"columns",Yo=function(e){var t,n=null!==(t=Ko.read())&&void 0!==t?t:[];return z(n,(function(t){return S.from(t.getType(e))}))},Zo=function(){return Yo(Qo)},er=function(){return Yo(Xo)},tr=function(e){return function(t){var n=function(){t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),n(),function(){e.off("NodeChange",n)}}},nr=function(e){return function(t){var n=function(){t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),n(),function(){e.off("NodeChange",n)}}},or=function(e){var t=Go(e);!function(e){var t=e.options.register;t("table_border_widths",{processor:"object[]",default:_t}),t("table_border_styles",{processor:"object[]",default:Ot}),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:!Rt.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),Wo(e),function(e,t){var o=function(t){return function(){return e.execCommand(t)}},r=function(t,r){return!!e.queryCommandSupported(r.command)&&(e.ui.registry.addMenuItem(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)})),!0)},l=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addToggleMenuItem(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))},u=function(t){e.execCommand("mceInsertTable",!1,{rows:t.numRows,columns:t.numColumns})},a=[r("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:t.onSetupCellOrRow}),r("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:t.onSetupCellOrRow}),r("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:t.onSetupCellOrRow}),r("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:t.onSetupCellOrRow}),r("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:t.onSetupCellOrRow}),r("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:t.onSetupCellOrRow}),r("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:t.onSetupPasteable(Zo)}),r("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:t.onSetupPasteable(Zo)})],i=[r("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:t.onSetupColumn("onFirst")}),r("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:t.onSetupColumn("onLast")}),r("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:t.onSetupColumn("onAny")}),r("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:t.onSetupColumn("onAny")}),r("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:t.onSetupColumn("onAny")}),r("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:t.onSetupPasteableColumn(er,"onFirst")}),r("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:t.onSetupPasteableColumn(er,"onLast")})],c=[r("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:t.onSetupCellOrRow}),r("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:t.onSetupMergeable}),r("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:t.onSetupUnmergeable})];jt(e)?e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:u}]},onSetup:nr(e)}):e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:nr(e)}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:nr(e)}),r("tableprops",{text:"Table properties",onSetup:t.onSetupTable,command:"mceTableProps"}),r("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:t.onSetupTable,command:"mceTableDelete"}),P(a,!0)&&e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:p("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),P(i,!0)&&e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:p("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),P(c,!0)&&e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:p("tablecellprops tablemergecells tablesplitcells")}),e.ui.registry.addContextMenu("table",{update:function(){return t.resetTargets(),t.targets().fold(p(""),(function(e){return"caption"===Y(e.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var s=Yn(Wt(e));0!==s.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return Qn(e,s,"tableclass",(function(t){return e.execCommand("mceTableToggleClass",!1,t)}))},onSetup:t.onSetupTable});var m=Yn(Ht(e));0!==m.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return Qn(e,m,"tablecellclass",(function(t){return e.execCommand("mceTableCellToggleClass",!1,t)}))},onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return Qn(e,Pn,"tablecellverticalalign",Xn(e,"vertical-align"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return Qn(e,Pt(e),"tablecellborderwidth",Xn(e,"border-width"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return Qn(e,kt(e),"tablecellborderstyle",Xn(e,"border-style"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return eo(e,$t(e),"background-color")},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return eo(e,Ut(e),"border-color")},onSetup:t.onSetupCellOrRow})),l("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),l("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:to(e),onSetup:t.onSetupTableRowHeaders}),l("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:no(e),onSetup:t.onSetupTableRowHeaders})}(e,t),function(e,t){e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:tr(e),fetch:function(e){return e("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(t){return function(){return e.execCommand(t)}},r=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addButton(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))},l=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addToggleButton(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))};r("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:t.onSetupTable}),r("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:t.onSetupTable}),r("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:t.onSetupCellOrRow}),r("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:t.onSetupMergeable}),r("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:t.onSetupUnmergeable}),r("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:t.onSetupCellOrRow}),r("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:t.onSetupCellOrRow}),r("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:t.onSetupCellOrRow}),r("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:t.onSetupCellOrRow}),r("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:t.onSetupColumn("onFirst")}),r("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:t.onSetupColumn("onLast")}),r("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:t.onSetupColumn("onAny")}),r("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:t.onSetupCellOrRow}),r("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:t.onSetupCellOrRow}),r("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:t.onSetupPasteable(Zo)}),r("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:t.onSetupPasteable(Zo)}),r("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:t.onSetupColumn("onAny")}),r("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:t.onSetupColumn("onAny")}),r("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:t.onSetupPasteableColumn(er,"onFirst")}),r("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:t.onSetupPasteableColumn(er,"onLast")}),r("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:tr(e)});var u=Yn(Wt(e));0!==u.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Zn(e,u,"tableclass",(function(t){return e.execCommand("mceTableToggleClass",!1,t)})),onSetup:t.onSetupTable});var a=Yn(Ht(e));0!==a.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Zn(e,a,"tablecellclass",(function(t){return e.execCommand("mceTableCellToggleClass",!1,t)})),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Zn(e,Pn,"tablecellverticalalign",Xn(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Zn(e,Pt(e),"tablecellborderwidth",Xn(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Zn(e,kt(e),"tablecellborderstyle",Xn(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(t){return t(eo(e,$t(e),"background-color"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(t){return t(eo(e,Ut(e),"border-color"))},onSetup:t.onSetupCellOrRow})),l("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),l("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:to(e),onSetup:t.onSetupTableRowHeaders}),l("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:no(e),onSetup:t.onSetupTableColumnHeaders})}(e,t),function(e){var t=zt(e);t.length>0&&e.ui.registry.addContextToolbar("table",{predicate:function(t){return e.dom.is(t,"table")&&e.getBody().contains(t)&&e.dom.isEditable(t.parentNode)},items:t,scope:"node",position:"node"})}(e)};t.add("table",or)}(),e}export{n as __require};
1
+ import{__exports as e}from"../../../../_virtual/plugin5.mjs";var t;function n(){if(t)return e;t=1;var n=e&&e.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},o=e&&e.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,l=t.length;r<l;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};return function(){var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(e){return function(t){return u=typeof(n=t),(null===n?"null":"object"===u&&Array.isArray(n)?"array":"object"===u&&(a=o=n,(r=String).prototype.isPrototypeOf(a)||(null===(l=o.constructor)||void 0===l?void 0:l.name)===r.name)?"string":u)===e;var n,o,r,l,u,a}},l=function(e){return function(t){return typeof t===e}},u=r("string"),a=r("array"),i=l("boolean"),c=(e=void 0,function(t){return e===t}),s=function(e){return!function(e){return null==e}(e)},f=l("function"),m=l("number"),d=function(){},p=function(e){return function(){return e}},b=function(e){return e},g=function(e,t){return e===t};function h(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=t.concat(n);return e.apply(null,r)}}var v=function(e){e()},y=p(!1),w=p(!0),S=function(){function e(e,t){this.tag=e,this.value=t}return e.some=function(t){return new e(!0,t)},e.none=function(){return e.singletonNone},e.prototype.fold=function(e,t){return this.tag?t(this.value):e()},e.prototype.isSome=function(){return this.tag},e.prototype.isNone=function(){return!this.tag},e.prototype.map=function(t){return this.tag?e.some(t(this.value)):e.none()},e.prototype.bind=function(t){return this.tag?t(this.value):e.none()},e.prototype.exists=function(e){return this.tag&&e(this.value)},e.prototype.forall=function(e){return!this.tag||e(this.value)},e.prototype.filter=function(t){return!this.tag||t(this.value)?this:e.none()},e.prototype.getOr=function(e){return this.tag?this.value:e},e.prototype.or=function(e){return this.tag?this:e},e.prototype.getOrThunk=function(e){return this.tag?this.value:e()},e.prototype.orThunk=function(e){return this.tag?this:e()},e.prototype.getOrDie=function(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")},e.from=function(t){return s(t)?e.some(t):e.none()},e.prototype.getOrNull=function(){return this.tag?this.value:null},e.prototype.getOrUndefined=function(){return this.value},e.prototype.each=function(e){this.tag&&e(this.value)},e.prototype.toArray=function(){return this.tag?[this.value]:[]},e.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},e}();S.singletonNone=new S(!1);var C=Object.keys,T=Object.hasOwnProperty,x=function(e,t){for(var n=C(e),o=0,r=n.length;o<r;o++){var l=n[o];t(e[l],l)}},A=function(e,t){var n,o={};return function(e,t,n,o){x(e,(function(e,r){(t(e,r)?n:o)(e,r)}))}(e,t,(n=o,function(e,t){n[t]=e}),d),o},R=function(e){return function(e,t){var n=[];return x(e,(function(e,o){n.push(t(e,o))})),n}(e,b)},_=function(e){return C(e).length},O=function(e,t){return D(e,t)?S.from(e[t]):S.none()},D=function(e,t){return T.call(e,t)},N=function(e,t){return D(e,t)&&void 0!==e[t]&&null!==e[t]},I=Array.prototype.indexOf,M=Array.prototype.push,P=function(e,t){return function(e,t){return I.call(e,t)}(e,t)>-1},k=function(e,t){for(var n=0,o=e.length;n<o;n++){if(t(e[n],n))return!0}return!1},E=function(e,t){for(var n=[],o=0;o<e;o++)n.push(t(o));return n},B=function(e,t){for(var n=e.length,o=new Array(n),r=0;r<n;r++){var l=e[r];o[r]=t(l,r)}return o},F=function(e,t){for(var n=0,o=e.length;n<o;n++){t(e[n],n)}},q=function(e,t){for(var n=[],o=0,r=e.length;o<r;o++){var l=e[o];t(l,o)&&n.push(l)}return n},j=function(e,t,n){return F(e,(function(e,o){n=t(n,e,o)})),n},L=function(e,t){return function(e,t,n){for(var o=0,r=e.length;o<r;o++){var l=e[o];if(t(l,o))return S.some(l);if(n(l,o))break}return S.none()}(e,t,y)},H=function(e,t){return function(e){for(var t=[],n=0,o=e.length;n<o;++n){if(!a(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);M.apply(t,e[n])}return t}(B(e,t))},V=function(e,t){for(var n=0,o=e.length;n<o;++n){if(!0!==t(e[n],n))return!1}return!0},W=function(e,t){return t>=0&&t<e.length?S.some(e[t]):S.none()},z=function(e,t){for(var n=0;n<e.length;n++){var o=t(e[n],n);if(o.isSome())return o}return S.none()},$=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},U={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){var o="HTML does not have a single root node";throw console.error(o,e),new Error(o)}return $(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return $(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return $(n)},fromDom:$,fromPoint:function(e,t,n){return S.from(e.dom.elementFromPoint(t,n)).map($)}},G=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var o=n;if(void 0!==o.matches)return o.matches(t);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(t);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(t);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},K=function(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount},J=function(e,t){return e.dom===t.dom},Q=G;"undefined"!=typeof window?window:Function("return this;")();var X,Y=function(e){return e.dom.nodeName.toLowerCase()},Z=function(e){return e.dom.nodeType},ee=function(e){return function(t){return Z(t)===e}},te=function(e){return 8===Z(e)||"#comment"===Y(e)},ne=ee(1),oe=ee(3),re=ee(9),le=ee(11),ue=function(e){return function(t){return ne(t)&&Y(t)===e}},ae=function(e){return re(e)?e:(t=e,U.fromDom(t.dom.ownerDocument));var t},ie=function(e){return S.from(e.dom.parentNode).map(U.fromDom)},ce=function(e,t){for(var n=f(t)?t:y,o=e.dom,r=[];null!==o.parentNode&&void 0!==o.parentNode;){var l=o.parentNode,u=U.fromDom(l);if(r.push(u),!0===n(u))break;o=l}return r},se=function(e){return S.from(e.dom.previousSibling).map(U.fromDom)},fe=function(e){return S.from(e.dom.nextSibling).map(U.fromDom)},me=function(e){return B(e.dom.childNodes,U.fromDom)},de=function(e){return function(e,t){var n=e.dom.childNodes;return S.from(n[t]).map(U.fromDom)}(e,0)},pe=f(Element.prototype.attachShadow)&&f(Node.prototype.getRootNode),be=pe?function(e){return U.fromDom(e.dom.getRootNode())}:ae,ge=function(e){var t,n=be(e);return le(t=n)&&s(t.dom.host)?S.some(n):S.none()},he=function(e){return U.fromDom(e.dom.host)},ve=function(e){var t=oe(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n,o,r=t.ownerDocument;return ge(U.fromDom(t)).fold((function(){return r.body.contains(t)}),(n=ve,o=he,function(e){return n(o(e))}))},ye=function(e,t,n,o,r){return e(n,o)?S.some(n):f(r)&&r(n)?S.none():t(n,o,r)},we=function(e,t,n){for(var o=e.dom,r=f(n)?n:y;o.parentNode;){o=o.parentNode;var l=U.fromDom(o);if(t(l))return S.some(l);if(r(l))break}return S.none()},Se=function(e,t,n){return we(e,(function(e){return G(e,t)}),n)},Ce=function(e,t){return function(e,t){return L(e.dom.childNodes,(function(e){return t(U.fromDom(e))})).map(U.fromDom)}(e,(function(e){return G(e,t)}))},Te=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return K(n)?S.none():S.from(n.querySelector(e)).map(U.fromDom)}(t,e)},xe=function(e,t,n){return ye((function(e,t){return G(e,t)}),Se,e,t,n)},Ae=function(e,t){return void 0===t&&(t=!1),ve(e)?e.dom.isContentEditable:(n=e,xe(n,"[contenteditable]")).fold(p(t),(function(e){return"true"===Re(e)}));var n},Re=function(e){return e.dom.contentEditable},_e=function(e){return function(t){return J(t,function(e){return U.fromDom(e.getBody())}(e))}},Oe=function(e){return/^\d+(\.\d+)?$/.test(e)?e+"px":e},De=function(e){return U.fromDom(e.selection.getStart())},Ne=function(e){return(t=e,n=ue("table"),ye((function(e,t){return t(e)}),we,t,n,o)).forall(Ae);var t,n,o},Ie=function(e,t){var n=[];return F(me(e),(function(e){t(e)&&(n=n.concat([e])),n=n.concat(Ie(e,t))})),n},Me=function(e,t){return function(e,t){return q(me(e),t)}(e,(function(e){return G(e,t)}))},Pe=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return K(n)?[]:B(n.querySelectorAll(e),U.fromDom)}(t,e)},ke=function(e,t,n){if(!(u(n)||i(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Ee=function(e,t,n){ke(e.dom,t,n)},Be=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n},Fe=function(e,t){return S.from(Be(e,t))},qe=function(e,t){e.dom.removeAttribute(t)},je=function(e,t,n){return void 0===n&&(n=g),e.exists((function(e){return n(e,t)}))},Le=function(e,t,n){return e.isSome()&&t.isSome()?S.some(n(e.getOrDie(),t.getOrDie())):S.none()},He=function(e,t){return function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}(e,t,0)},Ve=(X=/^\s+|\s+$/g,function(e){return e.replace(X,"")}),We=function(e){return e.length>0},ze=function(e,t){void 0===t&&(t=10);var n=parseInt(e,t);return isNaN(n)?S.none():S.some(n)},$e=function(e){return void 0!==e.style&&f(e.style.getPropertyValue)},Ue=function(e,t,n){!function(e,t,n){if(!u(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);$e(e)&&e.style.setProperty(t,n)}(e.dom,t,n)},Ge=function(e,t){var n=e.dom,o=window.getComputedStyle(n).getPropertyValue(t);return""!==o||ve(e)?o:Ke(n,t)},Ke=function(e,t){return $e(e)?e.style.getPropertyValue(t):""},Je=function(e,t){var n=e.dom,o=Ke(n,t);return S.from(o).filter((function(e){return e.length>0}))},Qe=function(e,t){!function(e,t){$e(e)&&e.style.removeProperty(t)}(e.dom,t),je(Fe(e,"style").map(Ve),"")&&qe(e,"style")},Xe=function(e,t,n){return void 0===n&&(n=0),Fe(e,t).map((function(e){return parseInt(e,10)})).getOr(n)},Ye=function(e,t){return Ze(e,t,w)},Ze=function(e,t,n){return H(me(e),(function(e){return G(e,t)?n(e)?[e]:[]:Ze(e,t,n)}))},et=["tfoot","thead","tbody","colgroup"],tt=function(e,t,n){return{element:e,rowspan:t,colspan:n}},nt=function(e,t,n){return{element:e,cells:t,section:n}},ot=function(e,t){return function(e,t,n){return void 0===n&&(n=y),n(t)?S.none():P(e,Y(t))?S.some(t):Se(t,e.join(","),(function(e){return G(e,"table")||n(e)}))}(["td","th"],e,t)},rt=function(e,t){return xe(e,"table",t)},lt=function(e){return Ye(e,"tr")},ut=function(e){return rt(e).fold(p([]),(function(e){return Me(e,"colgroup")}))},at=function(e,t){return B(e,(function(e){if("colgroup"===Y(e)){var n=B(function(e){return G(e,"colgroup")?Me(e,"col"):H(ut(e),(function(e){return Me(e,"col")}))}(e),(function(e){var t=Xe(e,"span",1);return tt(e,1,t)}));return nt(e,n,"colgroup")}var o=B(function(e){return Ye(e,"th,td")}(e),(function(e){var t=Xe(e,"rowspan",1),n=Xe(e,"colspan",1);return tt(e,t,n)}));return nt(e,o,t(e))}))},it=function(e){return ie(e).map((function(e){var t=Y(e);return function(e){return P(et,e)}(t)?t:"tbody"})).getOr("tbody")},ct=function(e){return Fe(e,"data-snooker-locked-cols").bind((function(e){return S.from(e.match(/\d+/g))})).map((function(e){return function(e,t){for(var n={},o=0,r=e.length;o<r;o++){var l=e[o];n[String(l)]=t(l,o)}return n}(e,w)}))},st=function(e,t){return e+","+t},ft=function(e,t){var n=H(e.all,(function(e){return e.cells}));return q(n,t)},mt=function(e){var t,n={},o=[],r=(t=e,W(t,0)).map((function(e){return e.element})).bind(rt).bind(ct).getOr({}),l=0,u=0,a=0,i=function(e,t){for(var n=[],o=[],r=0,l=e.length;r<l;r++){var u=e[r];(t(u,r)?n:o).push(u)}return{pass:n,fail:o}}(e,(function(e){return"colgroup"===e.section})),c=i.pass,s=i.fail;F(s,(function(e){var t=[];F(e.cells,(function(e){for(var o=0;void 0!==n[st(a,o)];)o++;for(var l=N(r,o.toString()),i=function(e,t,n,o,r,l){return{element:e,rowspan:t,colspan:n,row:o,column:r,isLocked:l}}(e.element,e.rowspan,e.colspan,a,o,l),c=0;c<e.colspan;c++)for(var s=0;s<e.rowspan;s++){var f=o+c,m=st(a+s,f);n[m]=i,u=Math.max(u,f+1)}t.push(i)})),l++,o.push(nt(e.element,t,e.section)),a++}));var f=function(e){return W(e,e.length-1)}(c).map((function(e){var t=function(e){var t={},n=0;return F(e.cells,(function(e){var o=e.colspan;E(o,(function(r){var l=n+r;t[l]=function(e,t,n){return{element:e,colspan:t,column:n}}(e.element,o,l)})),n+=o})),t}(e),n=function(e,t){return{element:e,columns:t}}(e.element,R(t));return{colgroups:[n],columns:t}})).getOrThunk((function(){return{colgroups:[],columns:{}}})),m=f.columns,d=f.colgroups,p=function(e,t){return{rows:e,columns:t}}(l,u);return{grid:p,access:n,all:o,columns:m,colgroups:d}},dt=function(e){var t=function(e){var t=lt(e),n=ut(e),r=o(o([],n,!0),t,!0);return at(r,it)}(e);return mt(t)},pt=function(e,t,n){return S.from(e.access[st(t,n)])},bt=function(e,t,n){var o=ft(e,(function(e){return n(t,e.element)}));return o.length>0?S.some(o[0]):S.none()},gt=function(e){return H(e.all,(function(e){return e.cells}))},ht=function(e,t){return S.from(e.columns[t])},vt=tinymce.util.Tools.resolve("tinymce.util.Tools"),yt=function(e,t,n){for(var o,r=e.select("td,th",t),l=0;l<r.length;l++){var u=e.getStyle(r[l],n);if(c(o)&&(o=u),o!==u)return""}return o},wt=function(e,t,n){vt.each("left center right".split(" "),(function(o){o!==n&&e.formatter.remove("align"+o,{},t)})),n&&e.formatter.apply("align"+n,{},t)},St=function(e,t,o){e.dispatch("TableModified",n(n({},o),{table:t}))},Ct=function(e,t){return(n=e,o=parseFloat(n),isNaN(o)?S.none():S.some(o)).getOr(t);var n,o},Tt=function(e,t,n){return Ct(Ge(e,t),n)},xt=function(e,t){var n=e.dom,o=n.getBoundingClientRect().width||n.offsetWidth;return"border-box"===t?o:function(e,t,n,o){return t-Tt(e,"padding-".concat(n),0)-Tt(e,"padding-".concat(o),0)-Tt(e,"border-".concat(n,"-width"),0)-Tt(e,"border-".concat(o,"-width"),0)}(e,o,"left","right")},At=function(e){return xt(e,"content-box")},Rt=tinymce.util.Tools.resolve("tinymce.Env"),_t=E(5,(function(e){var t="".concat(e+1,"px");return{title:t,value:t}})),Ot=B(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(e){return{title:e,value:e.toLowerCase()}})),Dt="100%",Nt=function(e){var t,n=e.dom,o=null!==(t=n.getParent(e.selection.getStart(),n.isBlock))&&void 0!==t?t:e.getBody();return At(U.fromDom(o))+"px"},It=function(e){return function(t){return t.options.get(e)}},Mt=It("table_sizing_mode"),Pt=It("table_border_widths"),kt=It("table_border_styles"),Et=It("table_cell_advtab"),Bt=It("table_row_advtab"),Ft=It("table_advtab"),qt=It("table_appearance_options"),jt=It("table_grid"),Lt=It("table_style_by_css"),Ht=It("table_cell_class_list"),Vt=It("table_row_class_list"),Wt=It("table_class_list"),zt=It("table_toolbar"),$t=It("table_background_color_map"),Ut=It("table_border_color_map"),Gt=function(e){return"fixed"===Mt(e)},Kt=function(e){return"responsive"===Mt(e)},Jt=function(e){var t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:function(e,t){return Kt(e)||!Lt(e)?t:Gt(e)?n(n({},t),{width:Nt(e)}):n(n({},t),{width:Dt})}(e,o)},Qt=function(e){var t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:function(e,t){return Kt(e)||Lt(e)?t:Gt(e)?n(n({},t),{width:Nt(e)}):n(n({},t),{width:Dt})}(e,o)},Xt=function(e,t){return t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow},Yt=function(e,t,n){var o=bt(e,t,J),r=bt(e,n,J);return o.bind((function(e){return r.map((function(t){return n=e,o=t,r=Math.min(n.row,o.row),l=Math.min(n.column,o.column),u=Math.max(n.row+n.rowspan-1,o.row+o.rowspan-1),a=Math.max(n.column+n.colspan-1,o.column+o.colspan-1),{startRow:r,startCol:l,finishRow:u,finishCol:a};var n,o,r,l,u,a}))}))},Zt=function(e,t,n){return Yt(e,t,n).bind((function(t){return function(e,t){for(var n=!0,o=h(Xt,t),r=t.startRow;r<=t.finishRow;r++)for(var l=t.startCol;l<=t.finishCol;l++)n=n&&pt(e,r,l).exists(o);return n?S.some(t):S.none()}(e,t)}))},en=dt,tn=function(e,t){ie(e).each((function(n){n.dom.insertBefore(t.dom,e.dom)}))},nn=function(e,t){fe(e).fold((function(){ie(e).each((function(e){rn(e,t)}))}),(function(e){tn(e,t)}))},on=function(e,t){de(e).fold((function(){rn(e,t)}),(function(n){e.dom.insertBefore(t.dom,n.dom)}))},rn=function(e,t){e.dom.appendChild(t.dom)},ln=function(e,t){tn(e,t),rn(t,e)},un=function(e,t){F(t,(function(n,o){var r=0===o?e:t[o-1];nn(r,n)}))},an=function(e,t){F(t,(function(t){rn(e,t)}))},cn=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},sn=function(e){var t=me(e);t.length>0&&un(e,t),cn(e)},fn=function(e,t){var n=function(t){return e(t)?S.from(t.dom.nodeValue):S.none()};return{get:function(o){if(!e(o))throw new Error("Can only get "+t+" value of a "+t+" node");return n(o).getOr("")},getOption:n,set:function(n,o){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=o}}}(oe,"text"),mn=function(e){return fn.get(e)},dn=function(e,t){return fn.set(e,t)},pn=["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"],bn=function(e,t,n,o){var r,l,u=t(e,n);return r=function(n,o){var r=t(e,o);return gn(e,n,r)},l=u,function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n)}(o,(function(e,t){l=r(l,e,t)})),l},gn=function(e,t,n){return t.bind((function(t){return n.filter(h(e.eq,t))}))},hn=function(e,t,n){return n.length>0?function(e,t,n,o){return o(e,t,n[0],n.slice(1))}(e,t,n,bn):S.none()},vn={up:p({selector:Se,closest:xe,predicate:we,all:ce}),down:p({selector:Pe,predicate:Ie}),styles:p({get:Ge,getRaw:Je,set:Ue,remove:Qe}),attrs:p({get:Be,set:Ee,remove:qe,copyTo:function(e,t){!function(e,t){var n=e.dom;x(t,(function(e,t){ke(n,t,e)}))}(t,j(e.dom.attributes,(function(e,t){return e[t.name]=t.value,e}),{}))}}),insert:p({before:tn,after:nn,afterAll:un,append:rn,appendAll:an,prepend:on,wrap:ln}),remove:p({unwrap:sn,remove:cn}),create:p({nu:U.fromTag,clone:function(e){return U.fromDom(e.dom.cloneNode(!1))},text:U.fromText}),query:p({comparePosition:function(e,t){return e.dom.compareDocumentPosition(t.dom)},prevSibling:se,nextSibling:fe}),property:p({children:me,name:Y,parent:ie,document:function(e){return ae(e).dom},isText:oe,isComment:te,isElement:ne,isSpecial:function(e){var t=Y(e);return P(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:function(e){return ne(e)?Fe(e,"lang"):S.none()},getText:mn,setText:dn,isBoundary:function(e){return!!ne(e)&&("body"===Y(e)||P(pn,Y(e)))},isEmptyTag:function(e){return!!ne(e)&&P(["br","img","hr","input"],Y(e))},isNonEditable:function(e){return ne(e)&&"false"===Be(e,"contenteditable")}}),eq:J,is:Q},yn=function(e){return Se(e,"table")},wn=function(e,t,n){return Te(e,t).bind((function(t){return Te(e,n).bind((function(e){return(n=yn,o=[t,e],hn(vn,(function(e,t){return n(t)}),o)).map((function(n){return{first:t,last:e,table:n}}));var n,o}))}))},Sn=function(e,t){return function(e,t){var n=Pe(e,t);return n.length>0?S.some(n):S.none()}(e,t)},Cn=function(e,t,n){return wn(e,t,n).bind((function(t){var n=function(t){return J(e,t)},o="thead,tfoot,tbody,table",r=Se(t.first,o,n),l=Se(t.last,o,n);return r.bind((function(e){return l.bind((function(n){return J(e,n)?function(e,t,n){var o=en(e);return Zt(o,t,n)}(t.table,t.first,t.last):S.none()}))}))}))},Tn=function(e){return B(e,U.fromDom)},xn="data-mce-selected",An="data-mce-first-selected",Rn="data-mce-last-selected",_n={selected:xn,selectedSelector:"td["+xn+"],th["+xn+"]",firstSelected:An,firstSelectedSelector:"td["+An+"],th["+An+"]",lastSelected:Rn,lastSelectedSelector:"td["+Rn+"],th["+Rn+"]"},On=function(e){return function(t,n){var o,r=Y(t),l="col"===r||"colgroup"===r?rt(o=t).bind((function(e){return Sn(e,_n.firstSelectedSelector)})).fold(p(o),(function(e){return e[0]})):t;return xe(l,e,n)}},Dn=On("th,td,caption"),Nn=On("th,td"),In=function(e){return Tn(e.model.table.getSelectedCells())},Mn=function(e,t){var n=Nn(e),o=n.bind((function(e){return rt(e)})).map((function(e){return lt(e)}));return Le(n,o,(function(e,n){return q(n,(function(n){return k(Tn(n.dom.cells),(function(n){return"1"===Be(n,t)||J(n,e)}))}))})).getOr([])},Pn=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],kn=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,En=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Bn=function(e){return(t=e,n="#",He(t,n)?function(e,t){return e.substring(t)}(t,n.length):t).toUpperCase();var t,n},Fn=function(e){return function(e){return kn.test(e)||En.test(e)}(e)?S.some({value:Bn(e)}):S.none()},qn=function(e){var t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},jn=function(e){return function(e){return{value:Bn(e)}}(qn(e.red)+qn(e.green)+qn(e.blue))},Ln=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,Hn=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Vn=function(e,t,n,o){return{red:e,green:t,blue:n,alpha:o}},Wn=function(e,t,n,o){var r=parseInt(e,10),l=parseInt(t,10),u=parseInt(n,10),a=parseFloat(o);return Vn(r,l,u,a)},zn=function(e){if("transparent"===e)return S.some(Vn(0,0,0,0));var t=Ln.exec(e);if(null!==t)return S.some(Wn(t[1],t[2],t[3],"1"));var n=Hn.exec(e);return null!==n?S.some(Wn(n[1],n[2],n[3],n[4])):S.none()},$n=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},Un=function(){return e=function(e){return e.unbind()},t=$n(S.none()),n=function(){return t.get().each(e)},{clear:function(){n(),t.set(S.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(S.some(e))}};var e,t,n},Gn=function(e,t,n){return function(o){var r=Un(),l=!We(n),u=function(){var u=In(e),a=function(o){return e.formatter.match(t,{value:n},o.dom,l)};l?(o.setActive(!k(u,a)),r.set(e.formatter.formatChanged(t,(function(e){return o.setActive(!e)}),!0))):(o.setActive(V(u,a)),r.set(e.formatter.formatChanged(t,o.setActive,!1,{value:n})))};return e.initialized?u():e.on("init",u),r.clear}},Kn=function(e){return N(e,"menu")},Jn=function(e){return B(e,(function(e){var t=e.text||e.title||"";return Kn(e)?{text:t,items:Jn(e.menu)}:{text:t,value:e.value}}))},Qn=function(e,t,n,o){return B(t,(function(t){var r=t.text||t.title;return Kn(t)?{type:"nestedmenuitem",text:r,getSubmenuItems:function(){return Qn(e,t.menu,n,o)}}:{text:r,type:"togglemenuitem",onAction:function(){return o(t.value)},onSetup:Gn(e,n,t.value)}}))},Xn=function(e,t){return function(n){var o;e.execCommand("mceTableApplyCellStyle",!1,((o={})[t]=n,o))}},Yn=function(e){return H(e,(function(e){return Kn(e)?[n(n({},e),{menu:Yn(e.menu)})]:We(e.value)?[e]:[]}))},Zn=function(e,t,n,o){return function(r){return r(Qn(e,t,n,o))}},eo=function(e,t,n){var o=B(t,(function(e){return{text:e.title,value:"#"+(t=e.value,Fn(t).orThunk((function(){return zn(t).map(jn)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var o=n.getImageData(0,0,1,1).data,r=o[0],l=o[1],u=o[2],a=o[3];return jn(Vn(r,l,u,a))}))).value,type:"choiceitem"};var t}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:o.length>0?o:void 0,allowCustomColors:!1},onAction:function(t){var o,r="remove"===t.value?"":t.value;e.execCommand("mceTableApplyCellStyle",!1,((o={})[n]=r,o))}}]},to=function(e){return function(){var t="header"===e.queryCommandValue("mceTableRowType")?"body":"header";e.execCommand("mceTableRowType",!1,{type:t})}},no=function(e){return function(){var t="th"===e.queryCommandValue("mceTableColType")?"td":"th";e.execCommand("mceTableColType",!1,{type:t})}},oo=[{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:Pn}],ro=function(e){return oo.concat(function(e){var t=Jn(Ht(e));return t.length>0?S.some({name:"class",type:"listbox",label:"Class",items:t}):S.none()}(e).toArray())},lo=function(e,t){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Jn(kt(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(n):n}},uo=function(e,t){var n=e.dom;return{setAttrib:function(e,o){n.setAttrib(t,e,o)},setStyle:function(e,o){n.setStyle(t,e,o)},setFormat:function(n,o){""===o?e.formatter.remove(n,{value:null},t,!0):e.formatter.apply(n,{value:o},t)}}},ao=ue("th"),io=function(e,t){return e&&t?"sectionCells":e?"section":"cells"},co=function(e){var t=q(e,(function(e){return ao(e.element)}));return 0===t.length?S.some("td"):t.length===e.length?S.some("th"):S.none()},so=function(e){var t=B(e,(function(e){return function(e){var t="thead"===e.section,n=je(co(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||n?{type:"header",subType:io(t,n)}:{type:"body"}}(e).type})),n=P(t,"header"),o=P(t,"footer");if(n||o){var r=P(t,"body");return!n||r||o?n||r||!o?S.none():S.some("footer"):S.some("header")}return S.some("body")},fo=function(e,t){return z(e.all,(function(e){return L(e.cells,(function(e){return J(t,e.element)}))}))},mo=function(e,t,n){var o,r,l=function(e){for(var t=[],n=function(e){t.push(e)},o=0;o<e.length;o++)e[o].each(n);return t}(B(t.selection,(function(t){return ot(t).bind((function(t){return fo(e,t)})).filter(n)})));return o=l.length>0,r=l,o?S.some(r):S.none()},po=function(e,t){return mo(e,t,w)},bo=function(e,t){return V(t,(function(t){return function(e,t){return fo(e,t).exists((function(e){return!e.isLocked}))}(e,t)}))},go=function(e,t){return function(e,t){return t.mergable}(0,t).filter((function(t){return bo(e,t.cells)}))},ho=function(e,t){return function(e,t){return t.unmergable}(0,t).filter((function(t){return bo(e,t)}))},vo=function(e){if(!a(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return F(e,(function(o,r){var l=C(o);if(1!==l.length)throw new Error("one and only one name per case");var u=l[0],i=o[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!a(i))throw new Error("case arguments must be an array");t.push(u),n[u]=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var l=n.length;if(l!==i.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+i.length+" ("+i+"), got "+l);return{fold:function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];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,n)},match:function(e){var o=C(e);if(t.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+o.join(","));if(!V(t,(function(e){return P(o,e)})))throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+t.join(", "));return e[u].apply(null,n)},log:function(e){console.log(e,{constructors:t,constructor:u,params:n})}}}})),n},yo=vo([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]);n({},yo);var wo=function(e,t){var n=dt(e);return po(n,t).bind((function(e){var t=e[e.length-1],o=e[0].row,r=t.row+t.rowspan,l=n.all.slice(o,r);return so(l)})).getOr("")},So=function(e){return He(e,"rgb")?zn(t=e).map(jn).map((function(e){return"#"+e.value})).getOr(t):e;var t},Co=function(e){var t=U.fromDom(e);return{borderwidth:Je(t,"border-width").getOr(""),borderstyle:Je(t,"border-style").getOr(""),bordercolor:Je(t,"border-color").map(So).getOr(""),backgroundcolor:Je(t,"background-color").map(So).getOr("")}},To=function(e){var t=e[0],n=e.slice(1);return F(n,(function(e){F(C(t),(function(n){x(e,(function(e,o){var r=t[n];""!==r&&n===o&&r!==e&&(t[n]="")}))}))})),t},xo=function(e,t,n,o){return L(e,(function(e){return!c(n.formatter.matchNode(o,t+e))})).getOr("")},Ao=h(xo,["left","center","right"],"align"),Ro=h(xo,["top","middle","bottom"],"valign"),_o=function(e){return rt(U.fromDom(e)).map((function(t){var n={selection:Tn(e.cells)};return wo(t,n)})).getOr("")},Oo=function(e,t){var n=dt(e),o=gt(n),r=q(o,(function(e){return k(t,(function(t){return J(e.element,t)}))}));return B(r,(function(e){return{element:e.element.dom,column:ht(n,e.column).map((function(e){return e.element.dom}))}}))},Do=function(e,t,n,o){var r=1===t.length;F(t,(function(t){var l=t.element,u=r?w:o,a=uo(e,l);!function(e,t,n,o){o("scope")&&e.setAttrib("scope",n.scope),o("class")&&e.setAttrib("class",n.class),o("height")&&e.setStyle("height",Oe(n.height)),o("width")&&t.setStyle("width",Oe(n.width))}(a,t.column.map((function(t){return uo(e,t)})).getOr(a),n,u),Et(e)&&function(e,t,n){n("backgroundcolor")&&e.setFormat("tablecellbackgroundcolor",t.backgroundcolor),n("bordercolor")&&e.setFormat("tablecellbordercolor",t.bordercolor),n("borderstyle")&&e.setFormat("tablecellborderstyle",t.borderstyle),n("borderwidth")&&e.setFormat("tablecellborderwidth",Oe(t.borderwidth))}(a,n,u),o("halign")&&wt(e,l,n.halign),o("valign")&&function(e,t,n){vt.each("top middle bottom".split(" "),(function(o){o!==n&&e.formatter.remove("valign"+o,{},t)})),n&&e.formatter.apply("valign"+n,{},t)}(e,l,n.valign)}))},No=function(e,t,n,o){var r=o.getData();o.close(),e.undoManager.transact((function(){!function(e,t,n,o){var r=A(o,(function(e,t){return n[t]!==e}));_(r)>0&&t.length>=1&&rt(t[0]).each((function(n){var l=Oo(n,t),u=_(A(r,(function(e,t){return"scope"!==t&&"celltype"!==t})))>0,a=D(r,"celltype");(u||D(r,"scope"))&&Do(e,l,o,h(D,r)),a&&function(e,t){e.execCommand("mceTableCellType",!1,{type:t.celltype,no_events:!0})}(e,o),St(e,n.dom,{structure:a,style:u})}))}(e,t,n,r),e.focus()}))},Io=function(e,t){var o=rt(t[0]).map((function(o){return B(Oo(o,t),(function(t){return function(e,t,o,r){var l,u=e.dom,a=r.getOr(t),i=function(e,t){return u.getStyle(e,t)||u.getAttrib(e,t)};return n({width:i(a,"width"),height:i(t,"height"),scope:u.getAttrib(t,"scope"),celltype:(l=t,l.nodeName.toLowerCase()),class:u.getAttrib(t,"class",""),halign:Ao(e,t),valign:Ro(e,t)},o?Co(t):{})}(e,t.element,Et(e),t.column)}))}));return To(o.getOrDie())},Mo=function(e){var t=In(e);if(0!==t.length){var n=Io(e,t),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:ro(e)},lo(e,"cell")]},r={type:"panel",items:[{type:"grid",columns:2,items:ro(e)}]};e.windowManager.open({title:"Cell Properties",size:"normal",body:Et(e)?o:r,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:n,onSubmit:h(No,e,t,n)})}},Po=[{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"}],ko=function(e){return Po.concat(function(e){var t=Jn(Vt(e));return t.length>0?S.some({name:"class",type:"listbox",label:"Class",items:t}):S.none()}(e).toArray())},Eo=function(e,t,n,o){var r=1===t.length?w:o;F(t,(function(t){var l=uo(e,t);!function(e,t,n){n("class")&&e.setAttrib("class",t.class),n("height")&&e.setStyle("height",Oe(t.height))}(l,n,r),Bt(e)&&function(e,t,n){n("backgroundcolor")&&e.setStyle("background-color",t.backgroundcolor),n("bordercolor")&&e.setStyle("border-color",t.bordercolor),n("borderstyle")&&e.setStyle("border-style",t.borderstyle)}(l,n,r),o("align")&&wt(e,t,n.align)}))},Bo=function(e,t,n,o){var r=o.getData();o.close(),e.undoManager.transact((function(){!function(e,t,n,o){var r=A(o,(function(e,t){return n[t]!==e}));if(_(r)>0){var l=D(r,"type"),u=!l||_(r)>1;u&&Eo(e,t,o,h(D,r)),l&&function(e,t){e.execCommand("mceTableRowType",!1,{type:t.type,no_events:!0})}(e,o),rt(U.fromDom(t[0])).each((function(t){return St(e,t.dom,{structure:l,style:u})}))}}(e,t,n,r),e.focus()}))},Fo=function(e){var t=Mn(De(e),_n.selected);if(0!==t.length){var o=B(t,(function(t){return function(e,t,o){var r=e.dom;return n({height:r.getStyle(t,"height")||r.getAttrib(t,"height"),class:r.getAttrib(t,"class",""),type:_o(t),align:Ao(e,t)},o?Co(t):{})}(e,t.dom,Bt(e))})),r=To(o),l={type:"tabpanel",tabs:[{title:"General",name:"general",items:ko(e)},lo(e,"row")]},u={type:"panel",items:[{type:"grid",columns:2,items:ko(e)}]};e.windowManager.open({title:"Row Properties",size:"normal",body:Bt(e)?l:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:h(Bo,e,B(t,(function(e){return e.dom})),r)})}},qo=function(e,t,n){var o=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],r=qt(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"}]}]:[],l=t.length>0?[{type:"listbox",name:"class",label:"Class",items:t}]:[];return o.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(r).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(l)},jo=function(e,t,n,o){if("TD"===t.tagName||"TH"===t.tagName)u(n)&&s(o)?e.setStyle(t,n,o):e.setStyles(t,n);else if(t.children)for(var r=0;r<t.children.length;r++)jo(e,t.children[r],n,o)},Lo=function(e,t,o,r){var l=e.dom,u={},a={},i=Lt(e),s=Ft(e);if(c(o.class)||(u.class=o.class),a.height=Oe(o.height),i?a.width=Oe(o.width):l.getAttrib(t,"width")&&(u.width=function(e){return e?e.replace(/px$/,""):""}(o.width)),i?(a["border-width"]=Oe(o.border),a["border-spacing"]=Oe(o.cellspacing)):(u.border=o.border,u.cellpadding=o.cellpadding,u.cellspacing=o.cellspacing),i&&t.children){var f={};if(r.border&&(f["border-width"]=Oe(o.border)),r.cellpadding&&(f.padding=Oe(o.cellpadding)),s&&r.bordercolor&&(f["border-color"]=o.bordercolor),!function(e){for(var t in e)if(T.call(e,t))return!1;return!0}(f))for(var m=0;m<t.children.length;m++)jo(l,t.children[m],f)}if(s){var d=o;a["background-color"]=d.backgroundcolor,a["border-color"]=d.bordercolor,a["border-style"]=d.borderstyle}l.setStyles(t,n(n({},Jt(e)),a)),l.setAttribs(t,n(n({},Qt(e)),u))},Ho=function(e,t,n,o){var r=e.dom,l=o.getData(),u=A(l,(function(e,t){return n[t]!==e}));o.close(),""===l.class&&delete l.class,e.undoManager.transact((function(){if(!t){var n=ze(l.cols).getOr(1),o=ze(l.rows).getOr(1);e.execCommand("mceInsertTable",!1,{rows:o,columns:n}),t=Nn(De(e),_e(e)).bind((function(t){return rt(t,_e(e))})).map((function(e){return e.dom})).getOrDie()}if(_(u)>0){var a={border:D(u,"border"),bordercolor:D(u,"bordercolor"),cellpadding:D(u,"cellpadding")};Lo(e,t,l,a);var i=r.select("caption",t)[0];(i&&!l.caption||!i&&l.caption)&&e.execCommand("mceTableToggleCaption"),wt(e,t,l.align)}if(e.focus(),e.addVisual(),_(u)>0){var c=D(u,"caption"),s=!c||_(u)>1;St(e,t,{structure:c,style:s})}}))},Vo=function(e,t){var o,r=e.dom,l=function(e,t){var o,r,l,u=Jt(e),a=Qt(e),i=t?{borderstyle:O(u,"border-style").getOr(""),bordercolor:So(O(u,"border-color").getOr("")),backgroundcolor:So(O(u,"background-color").getOr(""))}:{};return n(n(n(n(n(n({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),i),(l=u["border-width"],Lt(e)&&l?{border:l}:O(a,"border").fold((function(){return{}}),(function(e){return{border:e}})))),(o=O(u,"border-spacing").or(O(a,"cellspacing")).fold((function(){return{}}),(function(e){return{cellspacing:e}})),r=O(u,"border-padding").or(O(a,"cellpadding")).fold((function(){return{}}),(function(e){return{cellpadding:e}})),n(n({},o),r)))}(e,Ft(e));t?(l.cols="1",l.rows="1",Ft(e)&&(l.borderstyle="",l.bordercolor="",l.backgroundcolor="")):(o=r.getParent(e.selection.getStart(),"table",e.getBody()))?l=function(e,t,o){var r=e.dom,l=Lt(e)?r.getStyle(t,"border-spacing")||r.getAttrib(t,"cellspacing"):r.getAttrib(t,"cellspacing")||r.getStyle(t,"border-spacing"),u=Lt(e)?yt(r,t,"padding")||r.getAttrib(t,"cellpadding"):r.getAttrib(t,"cellpadding")||yt(r,t,"padding");return n({width:r.getStyle(t,"width")||r.getAttrib(t,"width"),height:r.getStyle(t,"height")||r.getAttrib(t,"height"),cellspacing:null!=l?l:"",cellpadding:null!=u?u:"",border:function(t,n){var o=Je(U.fromDom(n),"border-width");return Lt(e)&&o.isSome()?o.getOr(""):t.getAttrib(n,"border")||yt(e.dom,n,"border-width")||yt(e.dom,n,"border")||""}(r,t),caption:!!r.select("caption",t)[0],class:r.getAttrib(t,"class",""),align:Ao(e,t)},o?Co(t):{})}(e,o,Ft(e)):Ft(e)&&(l.borderstyle="",l.bordercolor="",l.backgroundcolor="");var u=Jn(Wt(e));u.length>0&&l.class&&(l.class=l.class.replace(/\s*mce\-item\-table\s*/g,""));var a={type:"grid",columns:2,items:qo(e,u,t)},i=Ft(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},lo(e,"table")]}:{type:"panel",items:[a]};e.windowManager.open({title:"Table Properties",size:"normal",body:i,onSubmit:h(Ho,e,o,l),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l})},Wo=function(e){x({mceTableProps:h(Vo,e,!1),mceTableRowProps:h(Fo,e),mceTableCellProps:h(Mo,e),mceInsertTableDialog:h(Vo,e,!0)},(function(t,n){return e.addCommand(n,(function(){return n=t,void(Ne(De(e))&&n());var n}))}))},zo=b,$o=function(e){var t=function(e,t){return Fe(e,t).exists((function(e){return parseInt(e,10)>1}))};return e.length>0&&V(e,(function(e){return t(e,"rowspan")||t(e,"colspan")}))?S.some(e):S.none()},Uo=function(e,t,n){return t.length<=1?S.none():Cn(e,n.firstSelectedSelector,n.lastSelectedSelector).map((function(e){return{bounds:e,cells:t}}))},Go=function(e){var t=$n(S.none()),n=$n([]),o=S.none(),r=ue("caption"),l=function(e){return o.forall((function(t){return!t[e]}))},u=function(){return Dn(function(e){return U.fromDom(e.selection.getEnd())}(e),_e(e))},a=function(){return Dn(De(e),_e(e)).bind((function(t){return n=Le(rt(t),u().bind(rt),(function(n,o){return J(n,o)?r(t)?S.some(function(e){return{element:e,mergable:S.none(),unmergable:S.none(),selection:[e]}}(t)):S.some(function(e,t,n){return{element:n,mergable:Uo(t,e,_n),unmergable:$o(e),selection:zo(e)}}(In(e),n,t)):S.none()})),n.bind(b);var n}))},i=function(e){return rt(e.element).map((function(t){var n=dt(t),o=po(n,e).getOr([]),r=j(o,(function(e,t){return t.isLocked&&(e.onAny=!0,0===t.column?e.onFirst=!0:t.column+t.colspan>=n.grid.columns&&(e.onLast=!0)),e}),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:go(n,e).isSome(),unmergeable:ho(n,e).isSome(),locked:r}}))},c=function(){t.set(function(e){var t,n=!1;return function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];return n||(n=!0,t=e.apply(null,o)),t}}(a)()),o=t.get().bind(i),F(n.get(),v)},s=function(e){return e(),n.set(n.get().concat([e])),function(){n.set(q(n.get(),(function(t){return t!==e})))}},f=function(n,o){return s((function(){return t.get().fold((function(){n.setEnabled(!1)}),(function(t){n.setEnabled(!o(t)&&e.selection.isEditable())}))}))},m=function(n,o,r){return s((function(){return t.get().fold((function(){n.setEnabled(!1),n.setActive(!1)}),(function(t){n.setEnabled(!o(t)&&e.selection.isEditable()),n.setActive(r(t))}))}))},d=function(e){return o.exists((function(t){return t.locked[e]}))},p=function(t,n){return function(o){return m(o,(function(e){return r(e.element)}),(function(){return e.queryCommandValue(t)===n}))}},g=p("mceTableRowType","header"),h=p("mceTableColType","th");return e.on("NodeChange ExecCommand TableSelectorChange",c),{onSetupTable:function(e){return f(e,(function(e){return!1}))},onSetupCellOrRow:function(e){return f(e,(function(e){return r(e.element)}))},onSetupColumn:function(e){return function(t){return f(t,(function(t){return r(t.element)||d(e)}))}},onSetupPasteable:function(e){return function(t){return f(t,(function(t){return r(t.element)||e().isNone()}))}},onSetupPasteableColumn:function(e,t){return function(n){return f(n,(function(n){return r(n.element)||e().isNone()||d(t)}))}},onSetupMergeable:function(e){return f(e,(function(e){return l("mergeable")}))},onSetupUnmergeable:function(e){return f(e,(function(e){return l("unmergeable")}))},resetTargets:c,onSetupTableWithCaption:function(t){return m(t,y,(function(t){return rt(t.element,_e(e)).exists((function(e){return Ce(e,"caption").isSome()}))}))},onSetupTableRowHeaders:g,onSetupTableColumnHeaders:h,targets:t.get}},Ko=tinymce.util.Tools.resolve("tinymce.FakeClipboard"),Jo="x-tinymce/dom-table-",Qo=Jo+"rows",Xo=Jo+"columns",Yo=function(e){var t,n=null!==(t=Ko.read())&&void 0!==t?t:[];return z(n,(function(t){return S.from(t.getType(e))}))},Zo=function(){return Yo(Qo)},er=function(){return Yo(Xo)},tr=function(e){return function(t){var n=function(){t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),n(),function(){e.off("NodeChange",n)}}},nr=function(e){return function(t){var n=function(){t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),n(),function(){e.off("NodeChange",n)}}},or=function(e){var t=Go(e);!function(e){var t=e.options.register;t("table_border_widths",{processor:"object[]",default:_t}),t("table_border_styles",{processor:"object[]",default:Ot}),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:!Rt.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),Wo(e),function(e,t){var o=function(t){return function(){return e.execCommand(t)}},r=function(t,r){return!!e.queryCommandSupported(r.command)&&(e.ui.registry.addMenuItem(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)})),!0)},l=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addToggleMenuItem(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))},u=function(t){e.execCommand("mceInsertTable",!1,{rows:t.numRows,columns:t.numColumns})},a=[r("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:t.onSetupCellOrRow}),r("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:t.onSetupCellOrRow}),r("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:t.onSetupCellOrRow}),r("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:t.onSetupCellOrRow}),r("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:t.onSetupCellOrRow}),r("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:t.onSetupCellOrRow}),r("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:t.onSetupPasteable(Zo)}),r("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:t.onSetupPasteable(Zo)})],i=[r("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:t.onSetupColumn("onFirst")}),r("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:t.onSetupColumn("onLast")}),r("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:t.onSetupColumn("onAny")}),r("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:t.onSetupColumn("onAny")}),r("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:t.onSetupColumn("onAny")}),r("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:t.onSetupPasteableColumn(er,"onFirst")}),r("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:t.onSetupPasteableColumn(er,"onLast")})],c=[r("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:t.onSetupCellOrRow}),r("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:t.onSetupMergeable}),r("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:t.onSetupUnmergeable})];jt(e)?e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:u}]},onSetup:nr(e)}):e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:nr(e)}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:nr(e)}),r("tableprops",{text:"Table properties",onSetup:t.onSetupTable,command:"mceTableProps"}),r("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:t.onSetupTable,command:"mceTableDelete"}),P(a,!0)&&e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:p("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),P(i,!0)&&e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:p("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),P(c,!0)&&e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:p("tablecellprops tablemergecells tablesplitcells")}),e.ui.registry.addContextMenu("table",{update:function(){return t.resetTargets(),t.targets().fold(p(""),(function(e){return"caption"===Y(e.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var s=Yn(Wt(e));0!==s.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return Qn(e,s,"tableclass",(function(t){return e.execCommand("mceTableToggleClass",!1,t)}))},onSetup:t.onSetupTable});var m=Yn(Ht(e));0!==m.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return Qn(e,m,"tablecellclass",(function(t){return e.execCommand("mceTableCellToggleClass",!1,t)}))},onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return Qn(e,Pn,"tablecellverticalalign",Xn(e,"vertical-align"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return Qn(e,Pt(e),"tablecellborderwidth",Xn(e,"border-width"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return Qn(e,kt(e),"tablecellborderstyle",Xn(e,"border-style"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return eo(e,$t(e),"background-color")},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return eo(e,Ut(e),"border-color")},onSetup:t.onSetupCellOrRow})),l("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),l("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:to(e),onSetup:t.onSetupTableRowHeaders}),l("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:no(e),onSetup:t.onSetupTableRowHeaders})}(e,t),function(e,t){e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:tr(e),fetch:function(e){return e("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(t){return function(){return e.execCommand(t)}},r=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addButton(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))},l=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addToggleButton(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))};r("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:t.onSetupTable}),r("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:t.onSetupTable}),r("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:t.onSetupCellOrRow}),r("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:t.onSetupMergeable}),r("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:t.onSetupUnmergeable}),r("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:t.onSetupCellOrRow}),r("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:t.onSetupCellOrRow}),r("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:t.onSetupCellOrRow}),r("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:t.onSetupCellOrRow}),r("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:t.onSetupColumn("onFirst")}),r("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:t.onSetupColumn("onLast")}),r("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:t.onSetupColumn("onAny")}),r("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:t.onSetupCellOrRow}),r("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:t.onSetupCellOrRow}),r("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:t.onSetupPasteable(Zo)}),r("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:t.onSetupPasteable(Zo)}),r("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:t.onSetupColumn("onAny")}),r("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:t.onSetupColumn("onAny")}),r("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:t.onSetupPasteableColumn(er,"onFirst")}),r("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:t.onSetupPasteableColumn(er,"onLast")}),r("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:tr(e)});var u=Yn(Wt(e));0!==u.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Zn(e,u,"tableclass",(function(t){return e.execCommand("mceTableToggleClass",!1,t)})),onSetup:t.onSetupTable});var a=Yn(Ht(e));0!==a.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Zn(e,a,"tablecellclass",(function(t){return e.execCommand("mceTableCellToggleClass",!1,t)})),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Zn(e,Pn,"tablecellverticalalign",Xn(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Zn(e,Pt(e),"tablecellborderwidth",Xn(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Zn(e,kt(e),"tablecellborderstyle",Xn(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(t){return t(eo(e,$t(e),"background-color"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(t){return t(eo(e,Ut(e),"border-color"))},onSetup:t.onSetupCellOrRow})),l("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),l("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:to(e),onSetup:t.onSetupTableRowHeaders}),l("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:no(e),onSetup:t.onSetupTableColumnHeaders})}(e,t),function(e){var t=zt(e);t.length>0&&e.ui.registry.addContextToolbar("table",{predicate:function(t){return e.dom.is(t,"table")&&e.getBody().contains(t)&&e.dom.isEditable(t.parentNode)},items:t,scope:"node",position:"node"})}(e)};t.add("table",or)}(),e}export{n as __require};
2
2
  //# sourceMappingURL=plugin.mjs.map
@@ -1,2 +1,2 @@
1
- import{__exports as r}from"../../../../_virtual/index16.mjs";import{__require as e}from"./theme.mjs";var t;function i(){return t||(t=1,e()),r}export{i as __require};
1
+ import{__exports as r}from"../../../../_virtual/index14.mjs";import{__require as e}from"./theme.mjs";var t;function i(){return t||(t=1,e()),r}export{i as __require};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,8 +1,7 @@
1
- "use strict";
2
1
  // Exports the "default" icons for usage with module loaders
3
2
  // Usage:
4
3
  // CommonJS:
5
4
  // require('tinymce/icons/default')
6
5
  // ES2015:
7
6
  // import 'tinymce/icons/default'
8
- require('./icons.js');
7
+ import './icons.js';