@lotte-innovate/ui-component-test 0.2.57 → 0.2.58
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/components/Calendar/index.mjs +1 -1
- package/dist/lib/components/Editor/index.mjs +1 -1
- package/dist/lib/utils/useLoadTinyMCE.mjs +1 -1
- package/dist/lib/utils/useLoadTinyMCE.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/lib/_virtual/_commonjsHelpers.mjs +0 -2
- package/dist/lib/_virtual/_commonjsHelpers.mjs.map +0 -1
- package/dist/lib/_virtual/model.mjs +0 -2
- package/dist/lib/_virtual/model.mjs.map +0 -1
- package/dist/lib/_virtual/model2.mjs +0 -2
- package/dist/lib/_virtual/model2.mjs.map +0 -1
- package/dist/lib/_virtual/plugin.mjs +0 -2
- package/dist/lib/_virtual/plugin.mjs.map +0 -1
- package/dist/lib/_virtual/plugin10.mjs +0 -2
- package/dist/lib/_virtual/plugin10.mjs.map +0 -1
- package/dist/lib/_virtual/plugin11.mjs +0 -2
- package/dist/lib/_virtual/plugin11.mjs.map +0 -1
- package/dist/lib/_virtual/plugin12.mjs +0 -2
- package/dist/lib/_virtual/plugin12.mjs.map +0 -1
- package/dist/lib/_virtual/plugin13.mjs +0 -2
- package/dist/lib/_virtual/plugin13.mjs.map +0 -1
- package/dist/lib/_virtual/plugin14.mjs +0 -2
- package/dist/lib/_virtual/plugin14.mjs.map +0 -1
- package/dist/lib/_virtual/plugin15.mjs +0 -2
- package/dist/lib/_virtual/plugin15.mjs.map +0 -1
- package/dist/lib/_virtual/plugin16.mjs +0 -2
- package/dist/lib/_virtual/plugin16.mjs.map +0 -1
- package/dist/lib/_virtual/plugin17.mjs +0 -2
- package/dist/lib/_virtual/plugin17.mjs.map +0 -1
- package/dist/lib/_virtual/plugin18.mjs +0 -2
- package/dist/lib/_virtual/plugin18.mjs.map +0 -1
- package/dist/lib/_virtual/plugin19.mjs +0 -2
- package/dist/lib/_virtual/plugin19.mjs.map +0 -1
- package/dist/lib/_virtual/plugin2.mjs +0 -2
- package/dist/lib/_virtual/plugin2.mjs.map +0 -1
- package/dist/lib/_virtual/plugin20.mjs +0 -2
- package/dist/lib/_virtual/plugin20.mjs.map +0 -1
- package/dist/lib/_virtual/plugin21.mjs +0 -2
- package/dist/lib/_virtual/plugin21.mjs.map +0 -1
- package/dist/lib/_virtual/plugin22.mjs +0 -2
- package/dist/lib/_virtual/plugin22.mjs.map +0 -1
- package/dist/lib/_virtual/plugin23.mjs +0 -2
- package/dist/lib/_virtual/plugin23.mjs.map +0 -1
- package/dist/lib/_virtual/plugin24.mjs +0 -2
- package/dist/lib/_virtual/plugin24.mjs.map +0 -1
- package/dist/lib/_virtual/plugin25.mjs +0 -2
- package/dist/lib/_virtual/plugin25.mjs.map +0 -1
- package/dist/lib/_virtual/plugin26.mjs +0 -2
- package/dist/lib/_virtual/plugin26.mjs.map +0 -1
- package/dist/lib/_virtual/plugin27.mjs +0 -2
- package/dist/lib/_virtual/plugin27.mjs.map +0 -1
- package/dist/lib/_virtual/plugin28.mjs +0 -2
- package/dist/lib/_virtual/plugin28.mjs.map +0 -1
- package/dist/lib/_virtual/plugin29.mjs +0 -2
- package/dist/lib/_virtual/plugin29.mjs.map +0 -1
- package/dist/lib/_virtual/plugin3.mjs +0 -2
- package/dist/lib/_virtual/plugin3.mjs.map +0 -1
- package/dist/lib/_virtual/plugin30.mjs +0 -2
- package/dist/lib/_virtual/plugin30.mjs.map +0 -1
- package/dist/lib/_virtual/plugin31.mjs +0 -2
- package/dist/lib/_virtual/plugin31.mjs.map +0 -1
- package/dist/lib/_virtual/plugin32.mjs +0 -2
- package/dist/lib/_virtual/plugin32.mjs.map +0 -1
- package/dist/lib/_virtual/plugin33.mjs +0 -2
- package/dist/lib/_virtual/plugin33.mjs.map +0 -1
- package/dist/lib/_virtual/plugin34.mjs +0 -2
- package/dist/lib/_virtual/plugin34.mjs.map +0 -1
- package/dist/lib/_virtual/plugin35.mjs +0 -2
- package/dist/lib/_virtual/plugin35.mjs.map +0 -1
- package/dist/lib/_virtual/plugin36.mjs +0 -2
- package/dist/lib/_virtual/plugin36.mjs.map +0 -1
- package/dist/lib/_virtual/plugin37.mjs +0 -2
- package/dist/lib/_virtual/plugin37.mjs.map +0 -1
- package/dist/lib/_virtual/plugin38.mjs +0 -2
- package/dist/lib/_virtual/plugin38.mjs.map +0 -1
- package/dist/lib/_virtual/plugin39.mjs +0 -2
- package/dist/lib/_virtual/plugin39.mjs.map +0 -1
- package/dist/lib/_virtual/plugin4.mjs +0 -2
- package/dist/lib/_virtual/plugin4.mjs.map +0 -1
- package/dist/lib/_virtual/plugin40.mjs +0 -2
- package/dist/lib/_virtual/plugin40.mjs.map +0 -1
- package/dist/lib/_virtual/plugin41.mjs +0 -2
- package/dist/lib/_virtual/plugin41.mjs.map +0 -1
- package/dist/lib/_virtual/plugin42.mjs +0 -2
- package/dist/lib/_virtual/plugin42.mjs.map +0 -1
- package/dist/lib/_virtual/plugin43.mjs +0 -2
- package/dist/lib/_virtual/plugin43.mjs.map +0 -1
- package/dist/lib/_virtual/plugin44.mjs +0 -2
- package/dist/lib/_virtual/plugin44.mjs.map +0 -1
- package/dist/lib/_virtual/plugin45.mjs +0 -2
- package/dist/lib/_virtual/plugin45.mjs.map +0 -1
- package/dist/lib/_virtual/plugin46.mjs +0 -2
- package/dist/lib/_virtual/plugin46.mjs.map +0 -1
- package/dist/lib/_virtual/plugin47.mjs +0 -2
- package/dist/lib/_virtual/plugin47.mjs.map +0 -1
- package/dist/lib/_virtual/plugin48.mjs +0 -2
- package/dist/lib/_virtual/plugin48.mjs.map +0 -1
- package/dist/lib/_virtual/plugin49.mjs +0 -2
- package/dist/lib/_virtual/plugin49.mjs.map +0 -1
- package/dist/lib/_virtual/plugin5.mjs +0 -2
- package/dist/lib/_virtual/plugin5.mjs.map +0 -1
- package/dist/lib/_virtual/plugin50.mjs +0 -2
- package/dist/lib/_virtual/plugin50.mjs.map +0 -1
- package/dist/lib/_virtual/plugin51.mjs +0 -2
- package/dist/lib/_virtual/plugin51.mjs.map +0 -1
- package/dist/lib/_virtual/plugin52.mjs +0 -2
- package/dist/lib/_virtual/plugin52.mjs.map +0 -1
- package/dist/lib/_virtual/plugin53.mjs +0 -2
- package/dist/lib/_virtual/plugin53.mjs.map +0 -1
- package/dist/lib/_virtual/plugin54.mjs +0 -2
- package/dist/lib/_virtual/plugin54.mjs.map +0 -1
- package/dist/lib/_virtual/plugin55.mjs +0 -2
- package/dist/lib/_virtual/plugin55.mjs.map +0 -1
- package/dist/lib/_virtual/plugin56.mjs +0 -2
- package/dist/lib/_virtual/plugin56.mjs.map +0 -1
- package/dist/lib/_virtual/plugin6.mjs +0 -2
- package/dist/lib/_virtual/plugin6.mjs.map +0 -1
- package/dist/lib/_virtual/plugin7.mjs +0 -2
- package/dist/lib/_virtual/plugin7.mjs.map +0 -1
- package/dist/lib/_virtual/plugin8.mjs +0 -2
- package/dist/lib/_virtual/plugin8.mjs.map +0 -1
- package/dist/lib/_virtual/plugin9.mjs +0 -2
- package/dist/lib/_virtual/plugin9.mjs.map +0 -1
- package/dist/lib/_virtual/theme.mjs +0 -2
- package/dist/lib/_virtual/theme.mjs.map +0 -1
- package/dist/lib/_virtual/theme2.mjs +0 -2
- package/dist/lib/_virtual/theme2.mjs.map +0 -1
- package/dist/lib/_virtual/tinymce.mjs +0 -2
- package/dist/lib/_virtual/tinymce.mjs.map +0 -1
- package/dist/lib/_virtual/tinymce2.mjs +0 -2
- package/dist/lib/_virtual/tinymce2.mjs.map +0 -1
- package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.mjs +0 -2
- package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.mjs.map +0 -1
- package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.mjs +0 -2
- package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.mjs.map +0 -1
- package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.mjs +0 -2
- package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.mjs.map +0 -1
- package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.mjs +0 -2
- package/dist/lib/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.mjs.map +0 -1
- package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatDistance/index.mjs +0 -2
- package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatDistance/index.mjs.map +0 -1
- package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatLong/index.mjs +0 -2
- package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatLong/index.mjs.map +0 -1
- package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatRelative/index.mjs +0 -2
- package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/formatRelative/index.mjs.map +0 -1
- package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/localize/index.mjs +0 -2
- package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/localize/index.mjs.map +0 -1
- package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/match/index.mjs +0 -2
- package/dist/lib/node_modules/date-fns/esm/locale/ko/_lib/match/index.mjs.map +0 -1
- package/dist/lib/node_modules/date-fns/esm/locale/ko/index.mjs +0 -2
- package/dist/lib/node_modules/date-fns/esm/locale/ko/index.mjs.map +0 -1
- package/dist/lib/node_modules/style-inject/dist/style-inject.es.mjs +0 -2
- package/dist/lib/node_modules/style-inject/dist/style-inject.es.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/icons/default/icons.mjs +0 -2
- package/dist/lib/node_modules/tinymce/icons/default/icons.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/models/dom/model.mjs +0 -2
- package/dist/lib/node_modules/tinymce/models/dom/model.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/accordion/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/accordion/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/advlist/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/advlist/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/anchor/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/anchor/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/autolink/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/autolink/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/autosave/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/autosave/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/charmap/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/charmap/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/code/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/code/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/codesample/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/codesample/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/directionality/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/directionality/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/emoticons/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/emoticons/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/fullscreen/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/fullscreen/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/image/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/image/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/importcss/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/importcss/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/insertdatetime/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/insertdatetime/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/link/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/link/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/lists/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/lists/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/media/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/media/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/nonbreaking/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/nonbreaking/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/pagebreak/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/pagebreak/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/preview/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/preview/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/quickbars/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/quickbars/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/save/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/save/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/searchreplace/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/searchreplace/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/table/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/table/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/template/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/template/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/visualblocks/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/visualblocks/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/visualchars/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/visualchars/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/plugins/wordcount/plugin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/plugins/wordcount/plugin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/skins/ui/oxide/skin.mjs +0 -2
- package/dist/lib/node_modules/tinymce/skins/ui/oxide/skin.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/themes/silver/theme.mjs +0 -2
- package/dist/lib/node_modules/tinymce/themes/silver/theme.mjs.map +0 -1
- package/dist/lib/node_modules/tinymce/tinymce.mjs +0 -2
- package/dist/lib/node_modules/tinymce/tinymce.mjs.map +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sources":["../../../../../../node_modules/tinymce/plugins/media/plugin.js"],"sourcesContent":["/**\n * TinyMCE version 6.8.5 (TBD)\n */\n\n(function () {\n 'use strict';\n\n var global$6 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n\n const hasProto = (v, constructor, predicate) => {\n var _a;\n if (predicate(v, constructor.prototype)) {\n return true;\n } else {\n return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;\n }\n };\n const typeOf = x => {\n const t = typeof x;\n if (x === null) {\n return 'null';\n } else if (t === 'object' && Array.isArray(x)) {\n return 'array';\n } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {\n return 'string';\n } else {\n return t;\n }\n };\n const isType = type => value => typeOf(value) === type;\n const isString = isType('string');\n const isObject = isType('object');\n const isArray = isType('array');\n const isNullable = a => a === null || a === undefined;\n const isNonNullable = a => !isNullable(a);\n\n class Optional {\n constructor(tag, value) {\n this.tag = tag;\n this.value = value;\n }\n static some(value) {\n return new Optional(true, value);\n }\n static none() {\n return Optional.singletonNone;\n }\n fold(onNone, onSome) {\n if (this.tag) {\n return onSome(this.value);\n } else {\n return onNone();\n }\n }\n isSome() {\n return this.tag;\n }\n isNone() {\n return !this.tag;\n }\n map(mapper) {\n if (this.tag) {\n return Optional.some(mapper(this.value));\n } else {\n return Optional.none();\n }\n }\n bind(binder) {\n if (this.tag) {\n return binder(this.value);\n } else {\n return Optional.none();\n }\n }\n exists(predicate) {\n return this.tag && predicate(this.value);\n }\n forall(predicate) {\n return !this.tag || predicate(this.value);\n }\n filter(predicate) {\n if (!this.tag || predicate(this.value)) {\n return this;\n } else {\n return Optional.none();\n }\n }\n getOr(replacement) {\n return this.tag ? this.value : replacement;\n }\n or(replacement) {\n return this.tag ? this : replacement;\n }\n getOrThunk(thunk) {\n return this.tag ? this.value : thunk();\n }\n orThunk(thunk) {\n return this.tag ? this : thunk();\n }\n getOrDie(message) {\n if (!this.tag) {\n throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');\n } else {\n return this.value;\n }\n }\n static from(value) {\n return isNonNullable(value) ? Optional.some(value) : Optional.none();\n }\n getOrNull() {\n return this.tag ? this.value : null;\n }\n getOrUndefined() {\n return this.value;\n }\n each(worker) {\n if (this.tag) {\n worker(this.value);\n }\n }\n toArray() {\n return this.tag ? [this.value] : [];\n }\n toString() {\n return this.tag ? `some(${ this.value })` : 'none()';\n }\n }\n Optional.singletonNone = new Optional(false);\n\n const nativePush = Array.prototype.push;\n const each$1 = (xs, f) => {\n for (let i = 0, len = xs.length; i < len; i++) {\n const x = xs[i];\n f(x, i);\n }\n };\n const flatten = xs => {\n const r = [];\n for (let i = 0, len = xs.length; i < len; ++i) {\n if (!isArray(xs[i])) {\n throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);\n }\n nativePush.apply(r, xs[i]);\n }\n return r;\n };\n\n const Cell = initial => {\n let value = initial;\n const get = () => {\n return value;\n };\n const set = v => {\n value = v;\n };\n return {\n get,\n set\n };\n };\n\n const keys = Object.keys;\n const hasOwnProperty = Object.hasOwnProperty;\n const each = (obj, f) => {\n const props = keys(obj);\n for (let k = 0, len = props.length; k < len; k++) {\n const i = props[k];\n const x = obj[i];\n f(x, i);\n }\n };\n const get$1 = (obj, key) => {\n return has(obj, key) ? Optional.from(obj[key]) : Optional.none();\n };\n const has = (obj, key) => hasOwnProperty.call(obj, key);\n\n const option = name => editor => editor.options.get(name);\n const register$2 = editor => {\n const registerOption = editor.options.register;\n registerOption('audio_template_callback', { processor: 'function' });\n registerOption('video_template_callback', { processor: 'function' });\n registerOption('iframe_template_callback', { processor: 'function' });\n registerOption('media_live_embeds', {\n processor: 'boolean',\n default: true\n });\n registerOption('media_filter_html', {\n processor: 'boolean',\n default: true\n });\n registerOption('media_url_resolver', { processor: 'function' });\n registerOption('media_alt_source', {\n processor: 'boolean',\n default: true\n });\n registerOption('media_poster', {\n processor: 'boolean',\n default: true\n });\n registerOption('media_dimensions', {\n processor: 'boolean',\n default: true\n });\n };\n const getAudioTemplateCallback = option('audio_template_callback');\n const getVideoTemplateCallback = option('video_template_callback');\n const getIframeTemplateCallback = option('iframe_template_callback');\n const hasLiveEmbeds = option('media_live_embeds');\n const shouldFilterHtml = option('media_filter_html');\n const getUrlResolver = option('media_url_resolver');\n const hasAltSource = option('media_alt_source');\n const hasPoster = option('media_poster');\n const hasDimensions = option('media_dimensions');\n\n var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');\n\n var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');\n\n var global$3 = tinymce.util.Tools.resolve('tinymce.html.DomParser');\n\n const DOM$1 = global$4.DOM;\n const trimPx = value => value.replace(/px$/, '');\n const getEphoxEmbedData = node => {\n const style = node.attr('style');\n const styles = style ? DOM$1.parseStyle(style) : {};\n return {\n type: 'ephox-embed-iri',\n source: node.attr('data-ephox-embed-iri'),\n altsource: '',\n poster: '',\n width: get$1(styles, 'max-width').map(trimPx).getOr(''),\n height: get$1(styles, 'max-height').map(trimPx).getOr('')\n };\n };\n const htmlToData = (html, schema) => {\n let data = {};\n const parser = global$3({\n validate: false,\n forced_root_block: false\n }, schema);\n const rootNode = parser.parse(html);\n for (let node = rootNode; node; node = node.walk()) {\n if (node.type === 1) {\n const name = node.name;\n if (node.attr('data-ephox-embed-iri')) {\n data = getEphoxEmbedData(node);\n break;\n } else {\n if (!data.source && name === 'param') {\n data.source = node.attr('movie');\n }\n if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') {\n if (!data.type) {\n data.type = name;\n }\n data = global$5.extend(node.attributes.map, data);\n }\n if (name === 'source') {\n if (!data.source) {\n data.source = node.attr('src');\n } else if (!data.altsource) {\n data.altsource = node.attr('src');\n }\n }\n if (name === 'img' && !data.poster) {\n data.poster = node.attr('src');\n }\n }\n }\n }\n data.source = data.source || data.src || '';\n data.altsource = data.altsource || '';\n data.poster = data.poster || '';\n return data;\n };\n\n const guess = url => {\n var _a;\n const mimes = {\n mp3: 'audio/mpeg',\n m4a: 'audio/x-m4a',\n wav: 'audio/wav',\n mp4: 'video/mp4',\n webm: 'video/webm',\n ogg: 'video/ogg',\n swf: 'application/x-shockwave-flash'\n };\n const fileEnd = (_a = url.toLowerCase().split('.').pop()) !== null && _a !== void 0 ? _a : '';\n return get$1(mimes, fileEnd).getOr('');\n };\n\n var global$2 = tinymce.util.Tools.resolve('tinymce.html.Node');\n\n var global$1 = tinymce.util.Tools.resolve('tinymce.html.Serializer');\n\n const Parser = (schema, settings = {}) => global$3({\n forced_root_block: false,\n validate: false,\n allow_conditional_comments: true,\n ...settings\n }, schema);\n\n const DOM = global$4.DOM;\n const addPx = value => /^[0-9.]+$/.test(value) ? value + 'px' : value;\n const updateEphoxEmbed = (data, node) => {\n const style = node.attr('style');\n const styleMap = style ? DOM.parseStyle(style) : {};\n if (isNonNullable(data.width)) {\n styleMap['max-width'] = addPx(data.width);\n }\n if (isNonNullable(data.height)) {\n styleMap['max-height'] = addPx(data.height);\n }\n node.attr('style', DOM.serializeStyle(styleMap));\n };\n const sources = [\n 'source',\n 'altsource'\n ];\n const updateHtml = (html, data, updateAll, schema) => {\n let numSources = 0;\n let sourceCount = 0;\n const parser = Parser(schema);\n parser.addNodeFilter('source', nodes => numSources = nodes.length);\n const rootNode = parser.parse(html);\n for (let node = rootNode; node; node = node.walk()) {\n if (node.type === 1) {\n const name = node.name;\n if (node.attr('data-ephox-embed-iri')) {\n updateEphoxEmbed(data, node);\n break;\n } else {\n switch (name) {\n case 'video':\n case 'object':\n case 'embed':\n case 'img':\n case 'iframe':\n if (data.height !== undefined && data.width !== undefined) {\n node.attr('width', data.width);\n node.attr('height', data.height);\n }\n break;\n }\n if (updateAll) {\n switch (name) {\n case 'video':\n node.attr('poster', data.poster);\n node.attr('src', null);\n for (let index = numSources; index < 2; index++) {\n if (data[sources[index]]) {\n const source = new global$2('source', 1);\n source.attr('src', data[sources[index]]);\n source.attr('type', data[sources[index] + 'mime'] || null);\n node.append(source);\n }\n }\n break;\n case 'iframe':\n node.attr('src', data.source);\n break;\n case 'object':\n const hasImage = node.getAll('img').length > 0;\n if (data.poster && !hasImage) {\n node.attr('src', data.poster);\n const img = new global$2('img', 1);\n img.attr('src', data.poster);\n img.attr('width', data.width);\n img.attr('height', data.height);\n node.append(img);\n }\n break;\n case 'source':\n if (sourceCount < 2) {\n node.attr('src', data[sources[sourceCount]]);\n node.attr('type', data[sources[sourceCount] + 'mime'] || null);\n if (!data[sources[sourceCount]]) {\n node.remove();\n continue;\n }\n }\n sourceCount++;\n break;\n case 'img':\n if (!data.poster) {\n node.remove();\n }\n break;\n }\n }\n }\n }\n }\n return global$1({}, schema).serialize(rootNode);\n };\n\n const urlPatterns = [\n {\n regex: /youtu\\.be\\/([\\w\\-_\\?&=.]+)/i,\n type: 'iframe',\n w: 560,\n h: 314,\n url: 'www.youtube.com/embed/$1',\n allowFullscreen: true\n },\n {\n regex: /youtube\\.com(.+)v=([^&]+)(&([a-z0-9&=\\-_]+))?/i,\n type: 'iframe',\n w: 560,\n h: 314,\n url: 'www.youtube.com/embed/$2?$4',\n allowFullscreen: true\n },\n {\n regex: /youtube.com\\/embed\\/([a-z0-9\\?&=\\-_]+)/i,\n type: 'iframe',\n w: 560,\n h: 314,\n url: 'www.youtube.com/embed/$1',\n allowFullscreen: true\n },\n {\n regex: /vimeo\\.com\\/([0-9]+)\\?h=(\\w+)/,\n type: 'iframe',\n w: 425,\n h: 350,\n url: 'player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc',\n allowFullscreen: true\n },\n {\n regex: /vimeo\\.com\\/(.*)\\/([0-9]+)\\?h=(\\w+)/,\n type: 'iframe',\n w: 425,\n h: 350,\n url: 'player.vimeo.com/video/$2?h=$3&title=0&byline=0',\n allowFullscreen: true\n },\n {\n regex: /vimeo\\.com\\/([0-9]+)/,\n type: 'iframe',\n w: 425,\n h: 350,\n url: 'player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc',\n allowFullscreen: true\n },\n {\n regex: /vimeo\\.com\\/(.*)\\/([0-9]+)/,\n type: 'iframe',\n w: 425,\n h: 350,\n url: 'player.vimeo.com/video/$2?title=0&byline=0',\n allowFullscreen: true\n },\n {\n regex: /maps\\.google\\.([a-z]{2,3})\\/maps\\/(.+)msid=(.+)/,\n type: 'iframe',\n w: 425,\n h: 350,\n url: 'maps.google.com/maps/ms?msid=$2&output=embed\"',\n allowFullscreen: false\n },\n {\n regex: /dailymotion\\.com\\/video\\/([^_]+)/,\n type: 'iframe',\n w: 480,\n h: 270,\n url: 'www.dailymotion.com/embed/video/$1',\n allowFullscreen: true\n },\n {\n regex: /dai\\.ly\\/([^_]+)/,\n type: 'iframe',\n w: 480,\n h: 270,\n url: 'www.dailymotion.com/embed/video/$1',\n allowFullscreen: true\n }\n ];\n const getProtocol = url => {\n const protocolMatches = url.match(/^(https?:\\/\\/|www\\.)(.+)$/i);\n if (protocolMatches && protocolMatches.length > 1) {\n return protocolMatches[1] === 'www.' ? 'https://' : protocolMatches[1];\n } else {\n return 'https://';\n }\n };\n const getUrl = (pattern, url) => {\n const protocol = getProtocol(url);\n const match = pattern.regex.exec(url);\n let newUrl = protocol + pattern.url;\n if (isNonNullable(match)) {\n for (let i = 0; i < match.length; i++) {\n newUrl = newUrl.replace('$' + i, () => match[i] ? match[i] : '');\n }\n }\n return newUrl.replace(/\\?$/, '');\n };\n const matchPattern = url => {\n const patterns = urlPatterns.filter(pattern => pattern.regex.test(url));\n if (patterns.length > 0) {\n return global$5.extend({}, patterns[0], { url: getUrl(patterns[0], url) });\n } else {\n return null;\n }\n };\n\n const getIframeHtml = (data, iframeTemplateCallback) => {\n if (iframeTemplateCallback) {\n return iframeTemplateCallback(data);\n } else {\n const allowFullscreen = data.allowfullscreen ? ' allowFullscreen=\"1\"' : '';\n return '<iframe src=\"' + data.source + '\" width=\"' + data.width + '\" height=\"' + data.height + '\"' + allowFullscreen + '></iframe>';\n }\n };\n const getFlashHtml = data => {\n let html = '<object data=\"' + data.source + '\" width=\"' + data.width + '\" height=\"' + data.height + '\" type=\"application/x-shockwave-flash\">';\n if (data.poster) {\n html += '<img src=\"' + data.poster + '\" width=\"' + data.width + '\" height=\"' + data.height + '\" />';\n }\n html += '</object>';\n return html;\n };\n const getAudioHtml = (data, audioTemplateCallback) => {\n if (audioTemplateCallback) {\n return audioTemplateCallback(data);\n } else {\n return '<audio controls=\"controls\" src=\"' + data.source + '\">' + (data.altsource ? '\\n<source src=\"' + data.altsource + '\"' + (data.altsourcemime ? ' type=\"' + data.altsourcemime + '\"' : '') + ' />\\n' : '') + '</audio>';\n }\n };\n const getVideoHtml = (data, videoTemplateCallback) => {\n if (videoTemplateCallback) {\n return videoTemplateCallback(data);\n } else {\n return '<video width=\"' + data.width + '\" height=\"' + data.height + '\"' + (data.poster ? ' poster=\"' + data.poster + '\"' : '') + ' controls=\"controls\">\\n' + '<source src=\"' + data.source + '\"' + (data.sourcemime ? ' type=\"' + data.sourcemime + '\"' : '') + ' />\\n' + (data.altsource ? '<source src=\"' + data.altsource + '\"' + (data.altsourcemime ? ' type=\"' + data.altsourcemime + '\"' : '') + ' />\\n' : '') + '</video>';\n }\n };\n const dataToHtml = (editor, dataIn) => {\n var _a;\n const data = global$5.extend({}, dataIn);\n if (!data.source) {\n global$5.extend(data, htmlToData((_a = data.embed) !== null && _a !== void 0 ? _a : '', editor.schema));\n if (!data.source) {\n return '';\n }\n }\n if (!data.altsource) {\n data.altsource = '';\n }\n if (!data.poster) {\n data.poster = '';\n }\n data.source = editor.convertURL(data.source, 'source');\n data.altsource = editor.convertURL(data.altsource, 'source');\n data.sourcemime = guess(data.source);\n data.altsourcemime = guess(data.altsource);\n data.poster = editor.convertURL(data.poster, 'poster');\n const pattern = matchPattern(data.source);\n if (pattern) {\n data.source = pattern.url;\n data.type = pattern.type;\n data.allowfullscreen = pattern.allowFullscreen;\n data.width = data.width || String(pattern.w);\n data.height = data.height || String(pattern.h);\n }\n if (data.embed) {\n return updateHtml(data.embed, data, true, editor.schema);\n } else {\n const audioTemplateCallback = getAudioTemplateCallback(editor);\n const videoTemplateCallback = getVideoTemplateCallback(editor);\n const iframeTemplateCallback = getIframeTemplateCallback(editor);\n data.width = data.width || '300';\n data.height = data.height || '150';\n global$5.each(data, (value, key) => {\n data[key] = editor.dom.encode('' + value);\n });\n if (data.type === 'iframe') {\n return getIframeHtml(data, iframeTemplateCallback);\n } else if (data.sourcemime === 'application/x-shockwave-flash') {\n return getFlashHtml(data);\n } else if (data.sourcemime.indexOf('audio') !== -1) {\n return getAudioHtml(data, audioTemplateCallback);\n } else {\n return getVideoHtml(data, videoTemplateCallback);\n }\n }\n };\n\n const isMediaElement = element => element.hasAttribute('data-mce-object') || element.hasAttribute('data-ephox-embed-iri');\n const setup$2 = editor => {\n editor.on('click keyup touchend', () => {\n const selectedNode = editor.selection.getNode();\n if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) {\n if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) {\n selectedNode.setAttribute('data-mce-selected', '2');\n }\n }\n });\n editor.on('ObjectResized', e => {\n const target = e.target;\n if (target.getAttribute('data-mce-object')) {\n let html = target.getAttribute('data-mce-html');\n if (html) {\n html = unescape(html);\n target.setAttribute('data-mce-html', escape(updateHtml(html, {\n width: String(e.width),\n height: String(e.height)\n }, false, editor.schema)));\n }\n }\n });\n };\n\n const cache = {};\n const embedPromise = (data, dataToHtml, handler) => {\n return new Promise((res, rej) => {\n const wrappedResolve = response => {\n if (response.html) {\n cache[data.source] = response;\n }\n return res({\n url: data.source,\n html: response.html ? response.html : dataToHtml(data)\n });\n };\n if (cache[data.source]) {\n wrappedResolve(cache[data.source]);\n } else {\n handler({ url: data.source }, wrappedResolve, rej);\n }\n });\n };\n const defaultPromise = (data, dataToHtml) => Promise.resolve({\n html: dataToHtml(data),\n url: data.source\n });\n const loadedData = editor => data => dataToHtml(editor, data);\n const getEmbedHtml = (editor, data) => {\n const embedHandler = getUrlResolver(editor);\n return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor));\n };\n const isCached = url => has(cache, url);\n\n const extractMeta = (sourceInput, data) => get$1(data, sourceInput).bind(mainData => get$1(mainData, 'meta'));\n const getValue = (data, metaData, sourceInput) => prop => {\n const getFromData = () => get$1(data, prop);\n const getFromMetaData = () => get$1(metaData, prop);\n const getNonEmptyValue = c => get$1(c, 'value').bind(v => v.length > 0 ? Optional.some(v) : Optional.none());\n const getFromValueFirst = () => getFromData().bind(child => isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(() => Optional.from(child)));\n const getFromMetaFirst = () => getFromMetaData().orThunk(() => getFromData().bind(child => isObject(child) ? getNonEmptyValue(child) : Optional.from(child)));\n return { [prop]: (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr('') };\n };\n const getDimensions = (data, metaData) => {\n const dimensions = {};\n get$1(data, 'dimensions').each(dims => {\n each$1([\n 'width',\n 'height'\n ], prop => {\n get$1(metaData, prop).orThunk(() => get$1(dims, prop)).each(value => dimensions[prop] = value);\n });\n });\n return dimensions;\n };\n const unwrap = (data, sourceInput) => {\n const metaData = sourceInput && sourceInput !== 'dimensions' ? extractMeta(sourceInput, data).getOr({}) : {};\n const get = getValue(data, metaData, sourceInput);\n return {\n ...get('source'),\n ...get('altsource'),\n ...get('poster'),\n ...get('embed'),\n ...getDimensions(data, metaData)\n };\n };\n const wrap = data => {\n const wrapped = {\n ...data,\n source: { value: get$1(data, 'source').getOr('') },\n altsource: { value: get$1(data, 'altsource').getOr('') },\n poster: { value: get$1(data, 'poster').getOr('') }\n };\n each$1([\n 'width',\n 'height'\n ], prop => {\n get$1(data, prop).each(value => {\n const dimensions = wrapped.dimensions || {};\n dimensions[prop] = value;\n wrapped.dimensions = dimensions;\n });\n });\n return wrapped;\n };\n const handleError = editor => error => {\n const errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.';\n editor.notificationManager.open({\n type: 'error',\n text: errorMessage\n });\n };\n const getEditorData = editor => {\n const element = editor.selection.getNode();\n const snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : '';\n const data = htmlToData(snippet, editor.schema);\n const getDimensionsOfElement = () => {\n if (isEmbedIframe(data.source, data.type)) {\n const rect = editor.dom.getRect(element);\n return {\n width: rect.w.toString().replace(/px$/, ''),\n height: rect.h.toString().replace(/px$/, '')\n };\n } else {\n return {};\n }\n };\n const dimensions = getDimensionsOfElement();\n return {\n embed: snippet,\n ...data,\n ...dimensions\n };\n };\n const addEmbedHtml = (api, editor) => response => {\n if (isString(response.url) && response.url.trim().length > 0) {\n const html = response.html;\n const snippetData = htmlToData(html, editor.schema);\n const nuData = {\n ...snippetData,\n source: response.url,\n embed: html\n };\n api.setData(wrap(nuData));\n }\n };\n const selectPlaceholder = (editor, beforeObjects) => {\n const afterObjects = editor.dom.select('*[data-mce-object]');\n for (let i = 0; i < beforeObjects.length; i++) {\n for (let y = afterObjects.length - 1; y >= 0; y--) {\n if (beforeObjects[i] === afterObjects[y]) {\n afterObjects.splice(y, 1);\n }\n }\n }\n editor.selection.select(afterObjects[0]);\n };\n const handleInsert = (editor, html) => {\n const beforeObjects = editor.dom.select('*[data-mce-object]');\n editor.insertContent(html);\n selectPlaceholder(editor, beforeObjects);\n editor.nodeChanged();\n };\n const isEmbedIframe = (url, mediaDataType) => isNonNullable(mediaDataType) && mediaDataType === 'ephox-embed-iri' && isNonNullable(matchPattern(url));\n const shouldInsertAsNewIframe = (prevData, newData) => {\n const hasDimensionsChanged = (prevData, newData) => prevData.width !== newData.width || prevData.height !== newData.height;\n return hasDimensionsChanged(prevData, newData) && isEmbedIframe(newData.source, prevData.type);\n };\n const submitForm = (prevData, newData, editor) => {\n var _a;\n newData.embed = shouldInsertAsNewIframe(prevData, newData) && hasDimensions(editor) ? dataToHtml(editor, {\n ...newData,\n embed: ''\n }) : updateHtml((_a = newData.embed) !== null && _a !== void 0 ? _a : '', newData, false, editor.schema);\n if (newData.embed && (prevData.source === newData.source || isCached(newData.source))) {\n handleInsert(editor, newData.embed);\n } else {\n getEmbedHtml(editor, newData).then(response => {\n handleInsert(editor, response.html);\n }).catch(handleError(editor));\n }\n };\n const showDialog = editor => {\n const editorData = getEditorData(editor);\n const currentData = Cell(editorData);\n const initialData = wrap(editorData);\n const handleSource = (prevData, api) => {\n const serviceData = unwrap(api.getData(), 'source');\n if (prevData.source !== serviceData.source) {\n addEmbedHtml(win, editor)({\n url: serviceData.source,\n html: ''\n });\n getEmbedHtml(editor, serviceData).then(addEmbedHtml(win, editor)).catch(handleError(editor));\n }\n };\n const handleEmbed = api => {\n var _a;\n const data = unwrap(api.getData());\n const dataFromEmbed = htmlToData((_a = data.embed) !== null && _a !== void 0 ? _a : '', editor.schema);\n api.setData(wrap(dataFromEmbed));\n };\n const handleUpdate = (api, sourceInput, prevData) => {\n const dialogData = unwrap(api.getData(), sourceInput);\n const data = shouldInsertAsNewIframe(prevData, dialogData) && hasDimensions(editor) ? {\n ...dialogData,\n embed: ''\n } : dialogData;\n const embed = dataToHtml(editor, data);\n api.setData(wrap({\n ...data,\n embed\n }));\n };\n const mediaInput = [{\n name: 'source',\n type: 'urlinput',\n filetype: 'media',\n label: 'Source',\n picker_text: 'Browse files'\n }];\n const sizeInput = !hasDimensions(editor) ? [] : [{\n type: 'sizeinput',\n name: 'dimensions',\n label: 'Constrain proportions',\n constrain: true\n }];\n const generalTab = {\n title: 'General',\n name: 'general',\n items: flatten([\n mediaInput,\n sizeInput\n ])\n };\n const embedTextarea = {\n type: 'textarea',\n name: 'embed',\n label: 'Paste your embed code below:'\n };\n const embedTab = {\n title: 'Embed',\n items: [embedTextarea]\n };\n const advancedFormItems = [];\n if (hasAltSource(editor)) {\n advancedFormItems.push({\n name: 'altsource',\n type: 'urlinput',\n filetype: 'media',\n label: 'Alternative source URL'\n });\n }\n if (hasPoster(editor)) {\n advancedFormItems.push({\n name: 'poster',\n type: 'urlinput',\n filetype: 'image',\n label: 'Media poster (Image URL)'\n });\n }\n const advancedTab = {\n title: 'Advanced',\n name: 'advanced',\n items: advancedFormItems\n };\n const tabs = [\n generalTab,\n embedTab\n ];\n if (advancedFormItems.length > 0) {\n tabs.push(advancedTab);\n }\n const body = {\n type: 'tabpanel',\n tabs\n };\n const win = editor.windowManager.open({\n title: 'Insert/Edit Media',\n size: 'normal',\n body,\n buttons: [\n {\n type: 'cancel',\n name: 'cancel',\n text: 'Cancel'\n },\n {\n type: 'submit',\n name: 'save',\n text: 'Save',\n primary: true\n }\n ],\n onSubmit: api => {\n const serviceData = unwrap(api.getData());\n submitForm(currentData.get(), serviceData, editor);\n api.close();\n },\n onChange: (api, detail) => {\n switch (detail.name) {\n case 'source':\n handleSource(currentData.get(), api);\n break;\n case 'embed':\n handleEmbed(api);\n break;\n case 'dimensions':\n case 'altsource':\n case 'poster':\n handleUpdate(api, detail.name, currentData.get());\n break;\n }\n currentData.set(unwrap(api.getData()));\n },\n initialData\n });\n };\n\n const get = editor => {\n const showDialog$1 = () => {\n showDialog(editor);\n };\n return { showDialog: showDialog$1 };\n };\n\n const register$1 = editor => {\n const showDialog$1 = () => {\n showDialog(editor);\n };\n editor.addCommand('mceMedia', showDialog$1);\n };\n\n const checkRange = (str, substr, start) => substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;\n const startsWith = (str, prefix) => {\n return checkRange(str, prefix, 0);\n };\n\n var global = tinymce.util.Tools.resolve('tinymce.Env');\n\n const isLiveEmbedNode = node => {\n const name = node.name;\n return name === 'iframe' || name === 'video' || name === 'audio';\n };\n const getDimension = (node, styles, dimension, defaultValue = null) => {\n const value = node.attr(dimension);\n if (isNonNullable(value)) {\n return value;\n } else if (!has(styles, dimension)) {\n return defaultValue;\n } else {\n return null;\n }\n };\n const setDimensions = (node, previewNode, styles) => {\n const useDefaults = previewNode.name === 'img' || node.name === 'video';\n const defaultWidth = useDefaults ? '300' : null;\n const fallbackHeight = node.name === 'audio' ? '30' : '150';\n const defaultHeight = useDefaults ? fallbackHeight : null;\n previewNode.attr({\n width: getDimension(node, styles, 'width', defaultWidth),\n height: getDimension(node, styles, 'height', defaultHeight)\n });\n };\n const appendNodeContent = (editor, nodeName, previewNode, html) => {\n const newNode = Parser(editor.schema).parse(html, { context: nodeName });\n while (newNode.firstChild) {\n previewNode.append(newNode.firstChild);\n }\n };\n const createPlaceholderNode = (editor, node) => {\n const name = node.name;\n const placeHolder = new global$2('img', 1);\n retainAttributesAndInnerHtml(editor, node, placeHolder);\n setDimensions(node, placeHolder, {});\n placeHolder.attr({\n 'style': node.attr('style'),\n 'src': global.transparentSrc,\n 'data-mce-object': name,\n 'class': 'mce-object mce-object-' + name\n });\n return placeHolder;\n };\n const createPreviewNode = (editor, node) => {\n var _a;\n const name = node.name;\n const previewWrapper = new global$2('span', 1);\n previewWrapper.attr({\n 'contentEditable': 'false',\n 'style': node.attr('style'),\n 'data-mce-object': name,\n 'class': 'mce-preview-object mce-object-' + name\n });\n retainAttributesAndInnerHtml(editor, node, previewWrapper);\n const styles = editor.dom.parseStyle((_a = node.attr('style')) !== null && _a !== void 0 ? _a : '');\n const previewNode = new global$2(name, 1);\n setDimensions(node, previewNode, styles);\n previewNode.attr({\n src: node.attr('src'),\n style: node.attr('style'),\n class: node.attr('class')\n });\n if (name === 'iframe') {\n previewNode.attr({\n allowfullscreen: node.attr('allowfullscreen'),\n frameborder: '0',\n sandbox: node.attr('sandbox')\n });\n } else {\n const attrs = [\n 'controls',\n 'crossorigin',\n 'currentTime',\n 'loop',\n 'muted',\n 'poster',\n 'preload'\n ];\n each$1(attrs, attrName => {\n previewNode.attr(attrName, node.attr(attrName));\n });\n const sanitizedHtml = previewWrapper.attr('data-mce-html');\n if (isNonNullable(sanitizedHtml)) {\n appendNodeContent(editor, name, previewNode, unescape(sanitizedHtml));\n }\n }\n const shimNode = new global$2('span', 1);\n shimNode.attr('class', 'mce-shim');\n previewWrapper.append(previewNode);\n previewWrapper.append(shimNode);\n return previewWrapper;\n };\n const retainAttributesAndInnerHtml = (editor, sourceNode, targetNode) => {\n var _a;\n const attribs = (_a = sourceNode.attributes) !== null && _a !== void 0 ? _a : [];\n let ai = attribs.length;\n while (ai--) {\n const attrName = attribs[ai].name;\n let attrValue = attribs[ai].value;\n if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style' && !startsWith(attrName, 'data-mce-')) {\n if (attrName === 'data' || attrName === 'src') {\n attrValue = editor.convertURL(attrValue, attrName);\n }\n targetNode.attr('data-mce-p-' + attrName, attrValue);\n }\n }\n const serializer = global$1({ inner: true }, editor.schema);\n const tempNode = new global$2('div', 1);\n each$1(sourceNode.children(), child => tempNode.append(child));\n const innerHtml = serializer.serialize(tempNode);\n if (innerHtml) {\n targetNode.attr('data-mce-html', escape(innerHtml));\n targetNode.empty();\n }\n };\n const isPageEmbedWrapper = node => {\n const nodeClass = node.attr('class');\n return isString(nodeClass) && /\\btiny-pageembed\\b/.test(nodeClass);\n };\n const isWithinEmbedWrapper = node => {\n let tempNode = node;\n while (tempNode = tempNode.parent) {\n if (tempNode.attr('data-ephox-embed-iri') || isPageEmbedWrapper(tempNode)) {\n return true;\n }\n }\n return false;\n };\n const placeHolderConverter = editor => nodes => {\n let i = nodes.length;\n let node;\n while (i--) {\n node = nodes[i];\n if (!node.parent) {\n continue;\n }\n if (node.parent.attr('data-mce-object')) {\n continue;\n }\n if (isLiveEmbedNode(node) && hasLiveEmbeds(editor)) {\n if (!isWithinEmbedWrapper(node)) {\n node.replace(createPreviewNode(editor, node));\n }\n } else {\n if (!isWithinEmbedWrapper(node)) {\n node.replace(createPlaceholderNode(editor, node));\n }\n }\n }\n };\n\n const parseAndSanitize = (editor, context, html) => {\n const getEditorOption = editor.options.get;\n const sanitize = getEditorOption('xss_sanitization');\n const validate = shouldFilterHtml(editor);\n return Parser(editor.schema, {\n sanitize,\n validate\n }).parse(html, { context });\n };\n\n const setup$1 = editor => {\n editor.on('PreInit', () => {\n const {schema, serializer, parser} = editor;\n const boolAttrs = schema.getBoolAttrs();\n each$1('webkitallowfullscreen mozallowfullscreen'.split(' '), name => {\n boolAttrs[name] = {};\n });\n each({ embed: ['wmode'] }, (attrs, name) => {\n const rule = schema.getElementRule(name);\n if (rule) {\n each$1(attrs, attr => {\n rule.attributes[attr] = {};\n rule.attributesOrder.push(attr);\n });\n }\n });\n parser.addNodeFilter('iframe,video,audio,object,embed', placeHolderConverter(editor));\n serializer.addAttributeFilter('data-mce-object', (nodes, name) => {\n var _a;\n let i = nodes.length;\n while (i--) {\n const node = nodes[i];\n if (!node.parent) {\n continue;\n }\n const realElmName = node.attr(name);\n const realElm = new global$2(realElmName, 1);\n if (realElmName !== 'audio') {\n const className = node.attr('class');\n if (className && className.indexOf('mce-preview-object') !== -1 && node.firstChild) {\n realElm.attr({\n width: node.firstChild.attr('width'),\n height: node.firstChild.attr('height')\n });\n } else {\n realElm.attr({\n width: node.attr('width'),\n height: node.attr('height')\n });\n }\n }\n realElm.attr({ style: node.attr('style') });\n const attribs = (_a = node.attributes) !== null && _a !== void 0 ? _a : [];\n let ai = attribs.length;\n while (ai--) {\n const attrName = attribs[ai].name;\n if (attrName.indexOf('data-mce-p-') === 0) {\n realElm.attr(attrName.substr(11), attribs[ai].value);\n }\n }\n const innerHtml = node.attr('data-mce-html');\n if (innerHtml) {\n const fragment = parseAndSanitize(editor, realElmName, unescape(innerHtml));\n each$1(fragment.children(), child => realElm.append(child));\n }\n node.replace(realElm);\n }\n });\n });\n editor.on('SetContent', () => {\n const dom = editor.dom;\n each$1(dom.select('span.mce-preview-object'), elm => {\n if (dom.select('span.mce-shim', elm).length === 0) {\n dom.add(elm, 'span', { class: 'mce-shim' });\n }\n });\n });\n };\n\n const setup = editor => {\n editor.on('ResolveName', e => {\n let name;\n if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) {\n e.name = name;\n }\n });\n };\n\n const onSetupEditable = editor => api => {\n const nodeChanged = () => {\n api.setEnabled(editor.selection.isEditable());\n };\n editor.on('NodeChange', nodeChanged);\n nodeChanged();\n return () => {\n editor.off('NodeChange', nodeChanged);\n };\n };\n const register = editor => {\n const onAction = () => editor.execCommand('mceMedia');\n editor.ui.registry.addToggleButton('media', {\n tooltip: 'Insert/edit media',\n icon: 'embed',\n onAction,\n onSetup: buttonApi => {\n const selection = editor.selection;\n buttonApi.setActive(isMediaElement(selection.getNode()));\n const unbindSelectorChanged = selection.selectorChangedWithUnbind('img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]', buttonApi.setActive).unbind;\n const unbindEditable = onSetupEditable(editor)(buttonApi);\n return () => {\n unbindSelectorChanged();\n unbindEditable();\n };\n }\n });\n editor.ui.registry.addMenuItem('media', {\n icon: 'embed',\n text: 'Media...',\n onAction,\n onSetup: onSetupEditable(editor)\n });\n };\n\n var Plugin = () => {\n global$6.add('media', editor => {\n register$2(editor);\n register$1(editor);\n register(editor);\n setup(editor);\n setup$1(editor);\n setup$2(editor);\n return get(editor);\n });\n };\n\n Plugin();\n\n})();\n"],"names":["global$6","tinymce","util","Tools","resolve","isType","type","value","x","t","Array","isArray","o","v","proto","constructor","String","prototype","isPrototypeOf","_a","name","typeOf","isString","isObject","isNonNullable","a","isNullable","Optional","tag","this","some","none","singletonNone","fold","onNone","onSome","isSome","isNone","map","mapper","bind","binder","exists","predicate","forall","filter","getOr","replacement","or","getOrThunk","thunk","orThunk","getOrDie","message","Error","from","getOrNull","getOrUndefined","each","worker","toArray","toString","nativePush","push","each$1","xs","f","i","len","length","flatten","r","apply","keys","Object","hasOwnProperty","get$1","obj","key","has","call","option","editor","options","get","getAudioTemplateCallback","getVideoTemplateCallback","getIframeTemplateCallback","hasLiveEmbeds","shouldFilterHtml","getUrlResolver","hasAltSource","hasPoster","hasDimensions","global$5","global$4","global$3","DOM$1","DOM","trimPx","replace","getEphoxEmbedData","node","style","attr","styles","parseStyle","source","altsource","poster","width","height","htmlToData","html","schema","data","validate","forced_root_block","parse","walk","extend","attributes","src","guess","url","fileEnd","toLowerCase","split","pop","mp3","m4a","wav","mp4","webm","ogg","swf","global$2","global$1","Parser","settings","allow_conditional_comments","addPx","test","updateEphoxEmbed","styleMap","serializeStyle","sources","updateHtml","updateAll","numSources","sourceCount","parser","addNodeFilter","nodes","rootNode","undefined","index","append","hasImage","getAll","img","remove","serialize","urlPatterns","regex","w","h","allowFullscreen","getUrl","pattern","protocol","protocolMatches","match","getProtocol","exec","newUrl","matchPattern","patterns","dataToHtml","dataIn","embed","convertURL","sourcemime","altsourcemime","allowfullscreen","audioTemplateCallback","videoTemplateCallback","iframeTemplateCallback","dom","encode","getIframeHtml","getFlashHtml","indexOf","getAudioHtml","getVideoHtml","isMediaElement","element","hasAttribute","cache","loadedData","getEmbedHtml","embedHandler","handler","Promise","res","rej","wrappedResolve","response","embedPromise","defaultPromise","getDimensions","metaData","dimensions","dims","prop","unwrap","sourceInput","mainData","extractMeta","getFromData","getFromMetaData","getNonEmptyValue","c","child","getValue","wrap","wrapped","handleError","error","errorMessage","msg","notificationManager","open","text","addEmbedHtml","api","trim","nuData","setData","handleInsert","beforeObjects","select","insertContent","afterObjects","y","splice","selection","selectPlaceholder","nodeChanged","isEmbedIframe","mediaDataType","shouldInsertAsNewIframe","prevData","newData","hasDimensionsChanged","submitForm","then","catch","showDialog","editorData","getNode","snippet","serializer","rect","getRect","getDimensionsOfElement","getEditorData","currentData","initial","set","Cell","initialData","sizeInput","label","constrain","generalTab","title","items","filetype","picker_text","embedTab","advancedFormItems","advancedTab","tabs","body","win","windowManager","size","buttons","primary","onSubmit","serviceData","getData","close","onChange","detail","handleSource","dataFromEmbed","handleEmbed","dialogData","handleUpdate","global","isLiveEmbedNode","getDimension","dimension","defaultValue","setDimensions","previewNode","useDefaults","defaultWidth","fallbackHeight","defaultHeight","createPlaceholderNode","placeHolder","retainAttributesAndInnerHtml","transparentSrc","class","createPreviewNode","previewWrapper","contentEditable","frameborder","sandbox","attrName","sanitizedHtml","nodeName","newNode","context","firstChild","appendNodeContent","unescape","shimNode","sourceNode","targetNode","attribs","ai","attrValue","str","substr","start","checkRange","inner","tempNode","children","innerHtml","escape","empty","isPageEmbedWrapper","nodeClass","isWithinEmbedWrapper","parent","parseAndSanitize","sanitize","getEditorOption","setup$1","on","boolAttrs","getBoolAttrs","props","k","attrs","rule","getElementRule","attributesOrder","placeHolderConverter","addAttributeFilter","realElmName","realElm","className","fragment","elm","add","onSetupEditable","setEnabled","isEditable","off","registerOption","register","processor","default","register$2","addCommand","register$1","onAction","execCommand","ui","registry","addToggleButton","tooltip","icon","onSetup","buttonApi","setActive","unbindSelectorChanged","selectorChangedWithUnbind","unbind","unbindEditable","addMenuItem","e","target","nodeType","getAttribute","setup","selectedNode","hasClass","getAttrib","setAttribute","setup$2"],"mappings":"gGAIA,WAGI,IAAIA,EAAWC,QAAQC,KAAKC,MAAMC,QAAQ,yBAE1C,MAoBMC,EAASC,GAAQC,GAZRC,KACb,MAAMC,SAAWD,EACjB,OAAU,OAANA,EACK,OACQ,WAANC,GAAkBC,MAAMC,QAAQH,GAClC,QACQ,WAANC,IAAuCG,EAdlCC,EAcsBL,EAAeM,GAdlCC,EAcsBC,QAZZC,UAYkCH,EAAMI,cAAcN,KAThD,QAA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AAiB2C,IACzB,MAAMC,EAASD,EAAEC,OACjB,GAAIA,EAAOE,aAAa,mBAAoB,CAC1C,IAAI/R,EAAO6R,EAAOE,aAAa,iBAC3B/R,IACFA,EAAOwN,SAASxN,GAChB6R,EAAOO,aAAa,gBAAiB7D,OAAOrM,EAAWlC,EAAM,CAC3DH,MAAO9F,OAAO6X,EAAE/R,OAChBC,OAAQ/F,OAAO6X,EAAE9R,UAChB,EAAO7B,EAAOgC,UAE7B,IACQ,EAwlBAoS,CAAQpU,GA9SAA,KAIH,CAAEgL,WAHY,KACnBA,GAAWhL,EAAO,IA6SXE,CAAIF,KAMlB,CA5rCD"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{__exports as n}from"../../../../_virtual/plugin28.mjs";var e;function o(){return e||(e=1,function(){var n=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=n=>e=>typeof e===n,o=e("boolean"),a=e("number"),t=n=>e=>e.options.get(n),r=t("nonbreaking_force_tab"),i=t("nonbreaking_wrap"),s=(n,e)=>{let o="";for(let a=0;a<e;a++)o+=n;return o},l=(n,e)=>{const o=i(n)||n.plugins.visualchars?`<span class="${(n=>!!n.plugins.visualchars&&n.plugins.visualchars.isEnabled())(n)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap"}" contenteditable="false">${s(" ",e)}</span>`:s(" ",e);n.undoManager.transact((()=>n.insertContent(o)))};var c=tinymce.util.Tools.resolve("tinymce.util.VK");const u=n=>e=>{const o=()=>{e.setEnabled(n.selection.isEditable())};return n.on("NodeChange",o),o(),()=>{n.off("NodeChange",o)}};n.add("nonbreaking",(n=>{(n=>{const e=n.options.register;e("nonbreaking_force_tab",{processor:n=>o(n)?{value:n?3:0,valid:!0}:a(n)?{value:n,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),e("nonbreaking_wrap",{processor:"boolean",default:!0})})(n),(n=>{n.addCommand("mceNonBreaking",(()=>{l(n,1)}))})(n),(n=>{const e=()=>n.execCommand("mceNonBreaking");n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:e,onSetup:u(n)}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:e,onSetup:u(n)})})(n),(n=>{const e=r(n);e>0&&n.on("keydown",(o=>{if(o.keyCode===c.TAB&&!o.isDefaultPrevented()){if(o.shiftKey)return;o.preventDefault(),o.stopImmediatePropagation(),l(n,e)}}))})(n)}))}()),n}export{o as __require};
|
2
|
-
//# sourceMappingURL=plugin.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sources":["../../../../../../node_modules/tinymce/plugins/nonbreaking/plugin.js"],"sourcesContent":["/**\n * TinyMCE version 6.8.5 (TBD)\n */\n\n(function () {\n 'use strict';\n\n var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n\n const isSimpleType = type => value => typeof value === type;\n const isBoolean = isSimpleType('boolean');\n const isNumber = isSimpleType('number');\n\n const option = name => editor => editor.options.get(name);\n const register$2 = editor => {\n const registerOption = editor.options.register;\n registerOption('nonbreaking_force_tab', {\n processor: value => {\n if (isBoolean(value)) {\n return {\n value: value ? 3 : 0,\n valid: true\n };\n } else if (isNumber(value)) {\n return {\n value,\n valid: true\n };\n } else {\n return {\n valid: false,\n message: 'Must be a boolean or number.'\n };\n }\n },\n default: false\n });\n registerOption('nonbreaking_wrap', {\n processor: 'boolean',\n default: true\n });\n };\n const getKeyboardSpaces = option('nonbreaking_force_tab');\n const wrapNbsps = option('nonbreaking_wrap');\n\n const stringRepeat = (string, repeats) => {\n let str = '';\n for (let index = 0; index < repeats; index++) {\n str += string;\n }\n return str;\n };\n const isVisualCharsEnabled = editor => editor.plugins.visualchars ? editor.plugins.visualchars.isEnabled() : false;\n const insertNbsp = (editor, times) => {\n const classes = () => isVisualCharsEnabled(editor) ? 'mce-nbsp-wrap mce-nbsp' : 'mce-nbsp-wrap';\n const nbspSpan = () => `<span class=\"${ classes() }\" contenteditable=\"false\">${ stringRepeat(' ', times) }</span>`;\n const shouldWrap = wrapNbsps(editor);\n const html = shouldWrap || editor.plugins.visualchars ? nbspSpan() : stringRepeat(' ', times);\n editor.undoManager.transact(() => editor.insertContent(html));\n };\n\n const register$1 = editor => {\n editor.addCommand('mceNonBreaking', () => {\n insertNbsp(editor, 1);\n });\n };\n\n var global = tinymce.util.Tools.resolve('tinymce.util.VK');\n\n const setup = editor => {\n const spaces = getKeyboardSpaces(editor);\n if (spaces > 0) {\n editor.on('keydown', e => {\n if (e.keyCode === global.TAB && !e.isDefaultPrevented()) {\n if (e.shiftKey) {\n return;\n }\n e.preventDefault();\n e.stopImmediatePropagation();\n insertNbsp(editor, spaces);\n }\n });\n }\n };\n\n const onSetupEditable = editor => api => {\n const nodeChanged = () => {\n api.setEnabled(editor.selection.isEditable());\n };\n editor.on('NodeChange', nodeChanged);\n nodeChanged();\n return () => {\n editor.off('NodeChange', nodeChanged);\n };\n };\n const register = editor => {\n const onAction = () => editor.execCommand('mceNonBreaking');\n editor.ui.registry.addButton('nonbreaking', {\n icon: 'non-breaking',\n tooltip: 'Nonbreaking space',\n onAction,\n onSetup: onSetupEditable(editor)\n });\n editor.ui.registry.addMenuItem('nonbreaking', {\n icon: 'non-breaking',\n text: 'Nonbreaking space',\n onAction,\n onSetup: onSetupEditable(editor)\n });\n };\n\n var Plugin = () => {\n global$1.add('nonbreaking', editor => {\n register$2(editor);\n register$1(editor);\n register(editor);\n setup(editor);\n });\n };\n\n Plugin();\n\n})();\n"],"names":["global$1","tinymce","util","Tools","resolve","isSimpleType","type","value","isBoolean","isNumber","option","name","editor","options","get","getKeyboardSpaces","wrapNbsps","stringRepeat","string","repeats","str","index","insertNbsp","times","html","plugins","visualchars","isEnabled","isVisualCharsEnabled","undoManager","transact","insertContent","global","onSetupEditable","api","nodeChanged","setEnabled","selection","isEditable","on","off","add","registerOption","register","processor","valid","message","default","register$2","addCommand","register$1","onAction","execCommand","ui","registry","addButton","icon","tooltip","onSetup","addMenuItem","text","spaces","e","keyCode","TAB","isDefaultPrevented","shiftKey","preventDefault","stopImmediatePropagation","setup"],"mappings":"gGAIA,WAGI,IAAIA,EAAWC,QAAQC,KAAKC,MAAMC,QAAQ,yBAE1C,MAAMC,EAAeC,GAAQC,UAAgBA,IAAUD,EACjDE,EAAYH,EAAa,WACzBI,EAAWJ,EAAa,UAExBK,EAASC,GAAQC,GAAUA,EAAOC,QAAQC,IAAIH,GA6B9CI,EAAoBL,EAAO,yBAC3BM,EAAYN,EAAO,oBAEnBO,EAAe,CAACC,EAAQC,KAC5B,IAAIC,EAAM,GACV,IAAK,IAAIC,EAAQ,EAAGA,EAAQF,EAASE,IACnCD,GAAOF,EAET,OAAOE,CAAG,EAGNE,EAAa,CAACV,EAAQW,KAC1B,MAGMC,EADaR,EAAUJ,IACFA,EAAOa,QAAQC,YAFnB,gBAHId,MAAUA,EAAOa,QAAQC,aAAcd,EAAOa,QAAQC,YAAYC,YAEvEC,CAAqBhB,GAAU,yBAA2B,4CACAK,EAAa,SAAUM,YAElCN,EAAa,SAAUM,GAC5FX,EAAOiB,YAAYC,UAAS,IAAMlB,EAAOmB,cAAcP,IAAM,EAS/D,IAAIQ,EAAS/B,QAAQC,KAAKC,MAAMC,QAAQ,mBAExC,MAgBM6B,EAAkBrB,GAAUsB,IAChC,MAAMC,EAAc,KAClBD,EAAIE,WAAWxB,EAAOyB,UAAUC,aAAa,EAI/C,OAFA1B,EAAO2B,GAAG,aAAcJ,GACxBA,IACO,KACLvB,EAAO4B,IAAI,aAAcL,EAAY,CACtC,EAmBDnC,EAASyC,IAAI,eAAe7B,IAlGXA,KACjB,MAAM8B,EAAiB9B,EAAOC,QAAQ8B,SACtCD,EAAe,wBAAyB,CACtCE,UAAWrC,GACLC,EAAUD,GACL,CACLA,MAAOA,EAAQ,EAAI,EACnBsC,OAAO,GAEApC,EAASF,GACX,CACLA,QACAsC,OAAO,GAGF,CACLA,OAAO,EACPC,QAAS,gCAIfC,SAAS,IAEXL,EAAe,mBAAoB,CACjCE,UAAW,UACXG,SAAS,GACT,EAyEAC,CAAWpC,GApDIA,KACjBA,EAAOqC,WAAW,kBAAkB,KAClC3B,EAAWV,EAAQ,EAAE,GACrB,EAkDAsC,CAAWtC,GAnBEA,KACf,MAAMuC,EAAW,IAAMvC,EAAOwC,YAAY,kBAC1CxC,EAAOyC,GAAGC,SAASC,UAAU,cAAe,CAC1CC,KAAM,eACNC,QAAS,oBACTN,WACAO,QAASzB,EAAgBrB,KAE3BA,EAAOyC,GAAGC,SAASK,YAAY,cAAe,CAC5CH,KAAM,eACNI,KAAM,oBACNT,WACAO,QAASzB,EAAgBrB,IACzB,EAOA+B,CAAS/B,GA9CCA,KACZ,MAAMiD,EAAS9C,EAAkBH,GAC7BiD,EAAS,GACXjD,EAAO2B,GAAG,WAAWuB,IACnB,GAAIA,EAAEC,UAAY/B,EAAOgC,MAAQF,EAAEG,qBAAsB,CACvD,GAAIH,EAAEI,SACJ,OAEFJ,EAAEK,iBACFL,EAAEM,2BACF9C,EAAWV,EAAQiD,EAC/B,IAEA,EAkCQQ,CAAMzD,EAAO,GAMpB,CAtHD"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{__exports as e}from"../../../../_virtual/plugin14.mjs";var a;function t(){return a||(a=1,function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env");const t=e=>a=>a.options.get(e),r=t("pagebreak_separator"),n=t("pagebreak_split_block"),o="mce-pagebreak",s=e=>{const t=`<img src="${a.transparentSrc}" class="${o}" data-mce-resize="false" data-mce-placeholder />`;return e?`<p>${t}</p>`:t},i=e=>a=>{const t=()=>{a.setEnabled(e.selection.isEditable())};return e.on("NodeChange",t),t(),()=>{e.off("NodeChange",t)}};e.add("pagebreak",(e=>{(e=>{const a=e.options.register;a("pagebreak_separator",{processor:"string",default:"\x3c!-- pagebreak --\x3e"}),a("pagebreak_split_block",{processor:"boolean",default:!1})})(e),(e=>{e.addCommand("mcePageBreak",(()=>{e.insertContent(s(n(e)))}))})(e),(e=>{const a=()=>e.execCommand("mcePageBreak");e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:a,onSetup:i(e)}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:a,onSetup:i(e)})})(e),(e=>{const a=r(e),t=()=>n(e),i=new RegExp(a.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(e=>"\\"+e)),"gi");e.on("BeforeSetContent",(e=>{e.content=e.content.replace(i,s(t()))})),e.on("PreInit",(()=>{e.serializer.addNodeFilter("img",(r=>{let n,s,i=r.length;for(;i--;)if(n=r[i],s=n.attr("class"),s&&-1!==s.indexOf(o)){const r=n.parent;if(r&&e.schema.getBlockElements()[r.name]&&t()){r.type=3,r.value=a,r.raw=!0,n.remove();continue}n.type=3,n.value=a,n.raw=!0}}))}))})(e),(e=>{e.on("ResolveName",(a=>{"IMG"===a.target.nodeName&&e.dom.hasClass(a.target,o)&&(a.name="pagebreak")}))})(e)}))}()),e}export{t as __require};
|
2
|
-
//# sourceMappingURL=plugin.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sources":["../../../../../../node_modules/tinymce/plugins/pagebreak/plugin.js"],"sourcesContent":["/**\n * TinyMCE version 6.8.5 (TBD)\n */\n\n(function () {\n 'use strict';\n\n var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n\n var global = tinymce.util.Tools.resolve('tinymce.Env');\n\n const option = name => editor => editor.options.get(name);\n const register$2 = editor => {\n const registerOption = editor.options.register;\n registerOption('pagebreak_separator', {\n processor: 'string',\n default: '<!-- pagebreak -->'\n });\n registerOption('pagebreak_split_block', {\n processor: 'boolean',\n default: false\n });\n };\n const getSeparatorHtml = option('pagebreak_separator');\n const shouldSplitBlock = option('pagebreak_split_block');\n\n const pageBreakClass = 'mce-pagebreak';\n const getPlaceholderHtml = shouldSplitBlock => {\n const html = `<img src=\"${ global.transparentSrc }\" class=\"${ pageBreakClass }\" data-mce-resize=\"false\" data-mce-placeholder />`;\n return shouldSplitBlock ? `<p>${ html }</p>` : html;\n };\n const setup$1 = editor => {\n const separatorHtml = getSeparatorHtml(editor);\n const shouldSplitBlock$1 = () => shouldSplitBlock(editor);\n const pageBreakSeparatorRegExp = new RegExp(separatorHtml.replace(/[\\?\\.\\*\\[\\]\\(\\)\\{\\}\\+\\^\\$\\:]/g, a => {\n return '\\\\' + a;\n }), 'gi');\n editor.on('BeforeSetContent', e => {\n e.content = e.content.replace(pageBreakSeparatorRegExp, getPlaceholderHtml(shouldSplitBlock$1()));\n });\n editor.on('PreInit', () => {\n editor.serializer.addNodeFilter('img', nodes => {\n let i = nodes.length, node, className;\n while (i--) {\n node = nodes[i];\n className = node.attr('class');\n if (className && className.indexOf(pageBreakClass) !== -1) {\n const parentNode = node.parent;\n if (parentNode && editor.schema.getBlockElements()[parentNode.name] && shouldSplitBlock$1()) {\n parentNode.type = 3;\n parentNode.value = separatorHtml;\n parentNode.raw = true;\n node.remove();\n continue;\n }\n node.type = 3;\n node.value = separatorHtml;\n node.raw = true;\n }\n }\n });\n });\n };\n\n const register$1 = editor => {\n editor.addCommand('mcePageBreak', () => {\n editor.insertContent(getPlaceholderHtml(shouldSplitBlock(editor)));\n });\n };\n\n const setup = editor => {\n editor.on('ResolveName', e => {\n if (e.target.nodeName === 'IMG' && editor.dom.hasClass(e.target, pageBreakClass)) {\n e.name = 'pagebreak';\n }\n });\n };\n\n const onSetupEditable = editor => api => {\n const nodeChanged = () => {\n api.setEnabled(editor.selection.isEditable());\n };\n editor.on('NodeChange', nodeChanged);\n nodeChanged();\n return () => {\n editor.off('NodeChange', nodeChanged);\n };\n };\n const register = editor => {\n const onAction = () => editor.execCommand('mcePageBreak');\n editor.ui.registry.addButton('pagebreak', {\n icon: 'page-break',\n tooltip: 'Page break',\n onAction,\n onSetup: onSetupEditable(editor)\n });\n editor.ui.registry.addMenuItem('pagebreak', {\n text: 'Page break',\n icon: 'page-break',\n onAction,\n onSetup: onSetupEditable(editor)\n });\n };\n\n var Plugin = () => {\n global$1.add('pagebreak', editor => {\n register$2(editor);\n register$1(editor);\n register(editor);\n setup$1(editor);\n setup(editor);\n });\n };\n\n Plugin();\n\n})();\n"],"names":["global$1","tinymce","util","Tools","resolve","global","option","name","editor","options","get","getSeparatorHtml","shouldSplitBlock","pageBreakClass","getPlaceholderHtml","html","transparentSrc","onSetupEditable","api","nodeChanged","setEnabled","selection","isEditable","on","off","add","registerOption","register","processor","default","register$2","addCommand","insertContent","register$1","onAction","execCommand","ui","registry","addButton","icon","tooltip","onSetup","addMenuItem","text","separatorHtml","shouldSplitBlock$1","pageBreakSeparatorRegExp","RegExp","replace","a","e","content","serializer","addNodeFilter","nodes","node","className","i","length","attr","indexOf","parentNode","parent","schema","getBlockElements","type","value","raw","remove","setup$1","target","nodeName","dom","hasClass","setup"],"mappings":"gGAIA,WAGI,IAAIA,EAAWC,QAAQC,KAAKC,MAAMC,QAAQ,yBAEtCC,EAASJ,QAAQC,KAAKC,MAAMC,QAAQ,eAExC,MAAME,EAASC,GAAQC,GAAUA,EAAOC,QAAQC,IAAIH,GAY9CI,EAAmBL,EAAO,uBAC1BM,EAAmBN,EAAO,yBAE1BO,EAAiB,gBACjBC,EAAqBF,IACzB,MAAMG,EAAO,aAAcV,EAAOW,0BAA4BH,qDAC9D,OAAOD,EAAmB,MAAOG,QAAcA,CAAI,EAiD/CE,EAAkBT,GAAUU,IAChC,MAAMC,EAAc,KAClBD,EAAIE,WAAWZ,EAAOa,UAAUC,aAAa,EAI/C,OAFAd,EAAOe,GAAG,aAAcJ,GACxBA,IACO,KACLX,EAAOgB,IAAI,aAAcL,EAAY,CACtC,EAmBDnB,EAASyB,IAAI,aAAajB,IA7FTA,KACjB,MAAMkB,EAAiBlB,EAAOC,QAAQkB,SACtCD,EAAe,sBAAuB,CACpCE,UAAW,SACXC,QAAS,6BAEXH,EAAe,wBAAyB,C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AtBA,EAAEoB,OAAOC,UAAsB/D,EAAOgE,IAAIC,SAASvB,EAAEoB,OAAQzD,KAC/DqC,EAAE3C,KAAO,YACnB,GACQ,EAmCAmE,CAAMlE,EAAO,GAMpB,CAhHD"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{__exports as e}from"../../../../_virtual/plugin17.mjs";var t;function o(){return t||(t=1,function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=e=>t=>t.options.get(e),i=n("content_style"),s=n("content_css_cors"),r=n("body_class"),c=n("body_id"),a=e=>{const n=(e=>{var n;let a="";const l=e.dom.encode,d=null!==(n=i(e))&&void 0!==n?n:"";a+='<base href="'+l(e.documentBaseURI.getURI())+'">';const m=s(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(t=>{a+='<link type="text/css" rel="stylesheet" href="'+l(e.documentBaseURI.toAbsolute(t))+'"'+m+">"})),d&&(a+='<style type="text/css">'+d+"</style>");const y=c(e),u=r(e),p='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(t.os.isMacOS()||t.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",v=e.getBody().dir,w=v?' dir="'+l(v)+'"':"";return"<!DOCTYPE html><html><head>"+a+'</head><body id="'+l(y)+'" class="mce-content-body '+l(u)+'"'+w+">"+e.getContent()+p+"</body></html>"})(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0,transparent:!1}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:n}}).focus("close")};e.add("preview",(e=>{(e=>{e.addCommand("mcePreview",(()=>{a(e)}))})(e),(e=>{const t=()=>e.execCommand("mcePreview");e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:t}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:t})})(e)}))}()),e}export{o as __require};
|
2
|
-
//# sourceMappingURL=plugin.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sources":["../../../../../../node_modules/tinymce/plugins/preview/plugin.js"],"sourcesContent":["/**\n * TinyMCE version 6.8.5 (TBD)\n */\n\n(function () {\n 'use strict';\n\n var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n\n var global$1 = tinymce.util.Tools.resolve('tinymce.Env');\n\n var global = tinymce.util.Tools.resolve('tinymce.util.Tools');\n\n const option = name => editor => editor.options.get(name);\n const getContentStyle = option('content_style');\n const shouldUseContentCssCors = option('content_css_cors');\n const getBodyClass = option('body_class');\n const getBodyId = option('body_id');\n\n const getPreviewHtml = editor => {\n var _a;\n let headHtml = '';\n const encode = editor.dom.encode;\n const contentStyle = (_a = getContentStyle(editor)) !== null && _a !== void 0 ? _a : '';\n headHtml += '<base href=\"' + encode(editor.documentBaseURI.getURI()) + '\">';\n const cors = shouldUseContentCssCors(editor) ? ' crossorigin=\"anonymous\"' : '';\n global.each(editor.contentCSS, url => {\n headHtml += '<link type=\"text/css\" rel=\"stylesheet\" href=\"' + encode(editor.documentBaseURI.toAbsolute(url)) + '\"' + cors + '>';\n });\n if (contentStyle) {\n headHtml += '<style type=\"text/css\">' + contentStyle + '</style>';\n }\n const bodyId = getBodyId(editor);\n const bodyClass = getBodyClass(editor);\n const isMetaKeyPressed = global$1.os.isMacOS() || global$1.os.isiOS() ? 'e.metaKey' : 'e.ctrlKey && !e.altKey';\n const preventClicksOnLinksScript = '<script>' + 'document.addEventListener && document.addEventListener(\"click\", function(e) {' + 'for (var elm = e.target; elm; elm = elm.parentNode) {' + 'if (elm.nodeName === \"A\" && !(' + isMetaKeyPressed + ')) {' + 'e.preventDefault();' + '}' + '}' + '}, false);' + '</script> ';\n const directionality = editor.getBody().dir;\n const dirAttr = directionality ? ' dir=\"' + encode(directionality) + '\"' : '';\n const previewHtml = '<!DOCTYPE html>' + '<html>' + '<head>' + headHtml + '</head>' + '<body id=\"' + encode(bodyId) + '\" class=\"mce-content-body ' + encode(bodyClass) + '\"' + dirAttr + '>' + editor.getContent() + preventClicksOnLinksScript + '</body>' + '</html>';\n return previewHtml;\n };\n\n const open = editor => {\n const content = getPreviewHtml(editor);\n const dataApi = editor.windowManager.open({\n title: 'Preview',\n size: 'large',\n body: {\n type: 'panel',\n items: [{\n name: 'preview',\n type: 'iframe',\n sandboxed: true,\n transparent: false\n }]\n },\n buttons: [{\n type: 'cancel',\n name: 'close',\n text: 'Close',\n primary: true\n }],\n initialData: { preview: content }\n });\n dataApi.focus('close');\n };\n\n const register$1 = editor => {\n editor.addCommand('mcePreview', () => {\n open(editor);\n });\n };\n\n const register = editor => {\n const onAction = () => editor.execCommand('mcePreview');\n editor.ui.registry.addButton('preview', {\n icon: 'preview',\n tooltip: 'Preview',\n onAction\n });\n editor.ui.registry.addMenuItem('preview', {\n icon: 'preview',\n text: 'Preview',\n onAction\n });\n };\n\n var Plugin = () => {\n global$2.add('preview', editor => {\n register$1(editor);\n register(editor);\n });\n };\n\n Plugin();\n\n})();\n"],"names":["global$2","tinymce","util","Tools","resolve","global$1","global","option","name","editor","options","get","getContentStyle","shouldUseContentCssCors","getBodyClass","getBodyId","open","content","_a","headHtml","encode","dom","contentStyle","documentBaseURI","getURI","cors","each","contentCSS","url","toAbsolute","bodyId","bodyClass","preventClicksOnLinksScript","os","isMacOS","isiOS","directionality","getBody","dir","dirAttr","getContent","getPreviewHtml","windowManager","title","size","body","type","items","sandboxed","transparent","buttons","text","primary","initialData","preview","focus","add","addCommand","register$1","onAction","execCommand","ui","registry","addButton","icon","tooltip","addMenuItem","register"],"mappings":"gGAIA,WAGI,IAAIA,EAAWC,QAAQC,KAAKC,MAAMC,QAAQ,yBAEtCC,EAAWJ,QAAQC,KAAKC,MAAMC,QAAQ,eAEtCE,EAASL,QAAQC,K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wBtBvD,EAASwD,IAAI,WAAW/C,IArBPA,KACjBA,EAAOgD,WAAW,cAAc,KAC9BzC,EAAKP,EAAO,GACZ,EAmBAiD,CAAWjD,GAhBEA,KACf,MAAMkD,EAAW,IAAMlD,EAAOmD,YAAY,cAC1CnD,EAAOoD,GAAGC,SAASC,UAAU,UAAW,CACtCC,KAAM,UACNC,QAAS,UACTN,aAEFlD,EAAOoD,GAAGC,SAASI,YAAY,UAAW,CACxCF,KAAM,UACNb,KAAM,UACNQ,YACA,EAMAQ,CAAS1D,EAAO,GAMvB,CA5FD"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{__exports as e}from"../../../../_virtual/plugin42.mjs";var t;function o(){return t||(t=1,function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>typeof t===e,o=(r="string",e=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=r=e,(n=String).prototype.isPrototypeOf(o)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===n.name)?"string":t;var o,r,n,i})(e)===r);var r;const n=t("boolean"),i=t("function"),s=e=>t=>t.options.get(e),a=s("quickbars_selection_toolbar"),l=s("quickbars_insert_toolbar"),c=s("quickbars_image_toolbar");let u=0;const d=(e,t,o)=>{const r=e.editorUpload.blobCache,n=r.create((e=>{const t=(new Date).getTime(),o=Math.floor(1e9*Math.random());return u++,e+"_"+o+u+String(t)})("mceu"),o,t);r.add(n),e.insertContent(e.dom.createHTML("img",{src:n.blobUri()}))};var m=tinymce.util.Tools.resolve("tinymce.util.Delay");const h=e=>{e.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:()=>{(e=>new Promise((t=>{let o=!1;const r=document.createElement("input");r.type="file",r.accept="image/*",r.style.position="fixed",r.style.left="0",r.style.top="0",r.style.opacity="0.001",document.body.appendChild(r);const n=e=>{var n;o||(null===(n=r.parentNode)||void 0===n||n.removeChild(r),o=!0,t(e))},i=e=>{n(Array.prototype.slice.call(e.target.files))};r.addEventListener("input",i),r.addEventListener("change",i);const s=t=>{const r=()=>{n([])};o||("focusin"===t.type?m.setEditorTimeout(e,r,1e3):r()),e.off("focusin remove",s)};e.on("focusin remove",s),r.click()})))(e).then((t=>{if(t.length>0){const o=t[0];(e=>new Promise((t=>{const o=new FileReader;o.onloadend=()=>{t(o.result.split(",")[1])},o.readAsDataURL(e)})))(o).then((t=>{d(e,t,o)}))}}))}}),e.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:()=>{((e,t,o)=>{e.execCommand("mceInsertTable",!1,{rows:o,columns:t})})(e,2,2)}})},g=(f=!1,()=>f);var f;class p{constructor(e,t){this.tag=e,this.value=t}static some(e){return new p(!0,e)}static none(){return p.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?p.some(e(this.value)):p.none()}bind(e){return this.tag?e(this.value):p.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:p.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return(e=>null==e)(e)?p.none():p.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}p.singletonNone=new p(!1),"undefined"!=typeof window?window:Function("return this;")();var v=(e,t,o,r,n)=>e(o,r)?p.some(o):i(n)&&n(o)?p.none():t(o,r,n);const b=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},y={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return b(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return b(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return b(o)},fromDom:b,fromPoint:(e,t,o)=>p.from(e.dom.elementFromPoint(t,o)).map(b)},k=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},w=(e,t,o)=>{let r=e.dom;const n=i(o)?o:g;for(;r.parentNode;){r=r.parentNode;const e=y.fromDom(r);if(t(e))return p.some(e);if(n(e))break}return p.none()},T=(e,t,o)=>((e,t,o)=>v(((e,t)=>t(e)),w,e,t,o))(e,t,o).isSome(),_=(e,t,o)=>w(e,(e=>k(e,t)),o),N=e=>{const t=l(e);t.length>0&&e.ui.registry.addContextToolbar("quickblock",{predicate:t=>{const o=y.fromDom(t),r=e.schema.getTextBlockElements(),n=t=>t.dom===e.getBody();return!((e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)})(o,"data-mce-bogus")&&((e,t,o)=>v(((e,t)=>k(e,t)),_,e,t,o))(o,'table,[data-mce-bogus="all"]',n).fold((()=>T(o,(t=>t.dom.nodeName.toLowerCase()in r&&e.dom.isEmpty(t.dom)),n)),g)},items:t,position:"line",scope:"editor"})},q=e=>{const t=t=>e.dom.isEditable(t),o=e=>{const o="FIGURE"===e.nodeName&&/image/i.test(e.className),r="IMG"===e.nodeName||o,n=(i=y.fromDom(e),s="mce-pagebreak",(e=>void 0!==e.dom.classList)(i)&&i.dom.classList.contains(s));var i,s;return r&&t(e.parentElement)&&!n},r=c(e);r.length>0&&e.ui.registry.addContextToolbar("imageselection",{predicate:o,items:r,position:"node"});const n=a(e);n.length>0&&e.ui.registry.addContextToolbar("textselection",{predicate:r=>!o(r)&&!e.selection.isCollapsed()&&t(r),items:n,position:"selection",scope:"editor"})};e.add("quickbars",(e=>{(e=>{const t=e.options.register,r=e=>t=>{const r=n(t)||o(t);return r?n(t)?{value:t?e:"",valid:r}:{value:t.trim(),valid:r}:{valid:!1,message:"Must be a boolean or string."}},i="bold italic | quicklink h2 h3 blockquote";t("quickbars_selection_toolbar",{processor:r(i),default:i});const s="quickimage quicktable";t("quickbars_insert_toolbar",{processor:r(s),default:s});const a="alignleft aligncenter alignright";t("quickbars_image_toolbar",{processor:r(a),default:a})})(e),h(e),N(e),q(e)}))}()),e}export{o as __require};
|
2
|
-
//# sourceMappingURL=plugin.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sources":["../../../../../../node_modules/tinymce/plugins/quickbars/plugin.js"],"sourcesContent":["/**\n * TinyMCE version 6.8.5 (TBD)\n */\n\n(function () {\n 'use strict';\n\n var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n\n const hasProto = (v, constructor, predicate) => {\n var _a;\n if (predicate(v, constructor.prototype)) {\n return true;\n } else {\n return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;\n }\n };\n const typeOf = x => {\n const t = typeof x;\n if (x === null) {\n return 'null';\n } else if (t === 'object' && Array.isArray(x)) {\n return 'array';\n } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {\n return 'string';\n } else {\n return t;\n }\n };\n const isType = type => value => typeOf(value) === type;\n const isSimpleType = type => value => typeof value === type;\n const isString = isType('string');\n const isBoolean = isSimpleType('boolean');\n const isNullable = a => a === null || a === undefined;\n const isNonNullable = a => !isNullable(a);\n const isFunction = isSimpleType('function');\n\n const option = name => editor => editor.options.get(name);\n const register = editor => {\n const registerOption = editor.options.register;\n const toolbarProcessor = defaultValue => value => {\n const valid = isBoolean(value) || isString(value);\n if (valid) {\n if (isBoolean(value)) {\n return {\n value: value ? defaultValue : '',\n valid\n };\n } else {\n return {\n value: value.trim(),\n valid\n };\n }\n } else {\n return {\n valid: false,\n message: 'Must be a boolean or string.'\n };\n }\n };\n const defaultSelectionToolbar = 'bold italic | quicklink h2 h3 blockquote';\n registerOption('quickbars_selection_toolbar', {\n processor: toolbarProcessor(defaultSelectionToolbar),\n default: defaultSelectionToolbar\n });\n const defaultInsertToolbar = 'quickimage quicktable';\n registerOption('quickbars_insert_toolbar', {\n processor: toolbarProcessor(defaultInsertToolbar),\n default: defaultInsertToolbar\n });\n const defaultImageToolbar = 'alignleft aligncenter alignright';\n registerOption('quickbars_image_toolbar', {\n processor: toolbarProcessor(defaultImageToolbar),\n default: defaultImageToolbar\n });\n };\n const getTextSelectionToolbarItems = option('quickbars_selection_toolbar');\n const getInsertToolbarItems = option('quickbars_insert_toolbar');\n const getImageToolbarItems = option('quickbars_image_toolbar');\n\n let unique = 0;\n const generate = prefix => {\n const date = new Date();\n const time = date.getTime();\n const random = Math.floor(Math.random() * 1000000000);\n unique++;\n return prefix + '_' + random + unique + String(time);\n };\n\n const insertTable = (editor, columns, rows) => {\n editor.execCommand('mceInsertTable', false, {\n rows,\n columns\n });\n };\n const insertBlob = (editor, base64, blob) => {\n const blobCache = editor.editorUpload.blobCache;\n const blobInfo = blobCache.create(generate('mceu'), blob, base64);\n blobCache.add(blobInfo);\n editor.insertContent(editor.dom.createHTML('img', { src: blobInfo.blobUri() }));\n };\n\n const blobToBase64 = blob => {\n return new Promise(resolve => {\n const reader = new FileReader();\n reader.onloadend = () => {\n resolve(reader.result.split(',')[1]);\n };\n reader.readAsDataURL(blob);\n });\n };\n\n var global = tinymce.util.Tools.resolve('tinymce.util.Delay');\n\n const pickFile = editor => new Promise(resolve => {\n let resolved = false;\n const fileInput = document.createElement('input');\n fileInput.type = 'file';\n fileInput.accept = 'image/*';\n fileInput.style.position = 'fixed';\n fileInput.style.left = '0';\n fileInput.style.top = '0';\n fileInput.style.opacity = '0.001';\n document.body.appendChild(fileInput);\n const resolveFileInput = value => {\n var _a;\n if (!resolved) {\n (_a = fileInput.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(fileInput);\n resolved = true;\n resolve(value);\n }\n };\n const changeHandler = e => {\n resolveFileInput(Array.prototype.slice.call(e.target.files));\n };\n fileInput.addEventListener('input', changeHandler);\n fileInput.addEventListener('change', changeHandler);\n const cancelHandler = e => {\n const cleanup = () => {\n resolveFileInput([]);\n };\n if (!resolved) {\n if (e.type === 'focusin') {\n global.setEditorTimeout(editor, cleanup, 1000);\n } else {\n cleanup();\n }\n }\n editor.off('focusin remove', cancelHandler);\n };\n editor.on('focusin remove', cancelHandler);\n fileInput.click();\n });\n\n const setupButtons = editor => {\n editor.ui.registry.addButton('quickimage', {\n icon: 'image',\n tooltip: 'Insert image',\n onAction: () => {\n pickFile(editor).then(files => {\n if (files.length > 0) {\n const blob = files[0];\n blobToBase64(blob).then(base64 => {\n insertBlob(editor, base64, blob);\n });\n }\n });\n }\n });\n editor.ui.registry.addButton('quicktable', {\n icon: 'table',\n tooltip: 'Insert table',\n onAction: () => {\n insertTable(editor, 2, 2);\n }\n });\n };\n\n const constant = value => {\n return () => {\n return value;\n };\n };\n const never = constant(false);\n\n class Optional {\n constructor(tag, value) {\n this.tag = tag;\n this.value = value;\n }\n static some(value) {\n return new Optional(true, value);\n }\n static none() {\n return Optional.singletonNone;\n }\n fold(onNone, onSome) {\n if (this.tag) {\n return onSome(this.value);\n } else {\n return onNone();\n }\n }\n isSome() {\n return this.tag;\n }\n isNone() {\n return !this.tag;\n }\n map(mapper) {\n if (this.tag) {\n return Optional.some(mapper(this.value));\n } else {\n return Optional.none();\n }\n }\n bind(binder) {\n if (this.tag) {\n return binder(this.value);\n } else {\n return Optional.none();\n }\n }\n exists(predicate) {\n return this.tag && predicate(this.value);\n }\n forall(predicate) {\n return !this.tag || predicate(this.value);\n }\n filter(predicate) {\n if (!this.tag || predicate(this.value)) {\n return this;\n } else {\n return Optional.none();\n }\n }\n getOr(replacement) {\n return this.tag ? this.value : replacement;\n }\n or(replacement) {\n return this.tag ? this : replacement;\n }\n getOrThunk(thunk) {\n return this.tag ? this.value : thunk();\n }\n orThunk(thunk) {\n return this.tag ? this : thunk();\n }\n getOrDie(message) {\n if (!this.tag) {\n throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');\n } else {\n return this.value;\n }\n }\n static from(value) {\n return isNonNullable(value) ? Optional.some(value) : Optional.none();\n }\n getOrNull() {\n return this.tag ? this.value : null;\n }\n getOrUndefined() {\n return this.value;\n }\n each(worker) {\n if (this.tag) {\n worker(this.value);\n }\n }\n toArray() {\n return this.tag ? [this.value] : [];\n }\n toString() {\n return this.tag ? `some(${ this.value })` : 'none()';\n }\n }\n Optional.singletonNone = new Optional(false);\n\n typeof window !== 'undefined' ? window : Function('return this;')();\n\n const ELEMENT = 1;\n\n const name = element => {\n const r = element.dom.nodeName;\n return r.toLowerCase();\n };\n\n const has$1 = (element, key) => {\n const dom = element.dom;\n return dom && dom.hasAttribute ? dom.hasAttribute(key) : false;\n };\n\n var ClosestOrAncestor = (is, ancestor, scope, a, isRoot) => {\n if (is(scope, a)) {\n return Optional.some(scope);\n } else if (isFunction(isRoot) && isRoot(scope)) {\n return Optional.none();\n } else {\n return ancestor(scope, a, isRoot);\n }\n };\n\n const fromHtml = (html, scope) => {\n const doc = scope || document;\n const div = doc.createElement('div');\n div.innerHTML = html;\n if (!div.hasChildNodes() || div.childNodes.length > 1) {\n const message = 'HTML does not have a single root node';\n console.error(message, html);\n throw new Error(message);\n }\n return fromDom(div.childNodes[0]);\n };\n const fromTag = (tag, scope) => {\n const doc = scope || document;\n const node = doc.createElement(tag);\n return fromDom(node);\n };\n const fromText = (text, scope) => {\n const doc = scope || document;\n const node = doc.createTextNode(text);\n return fromDom(node);\n };\n const fromDom = node => {\n if (node === null || node === undefined) {\n throw new Error('Node cannot be null or undefined');\n }\n return { dom: node };\n };\n const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);\n const SugarElement = {\n fromHtml,\n fromTag,\n fromText,\n fromDom,\n fromPoint\n };\n\n const is = (element, selector) => {\n const dom = element.dom;\n if (dom.nodeType !== ELEMENT) {\n return false;\n } else {\n const elem = dom;\n if (elem.matches !== undefined) {\n return elem.matches(selector);\n } else if (elem.msMatchesSelector !== undefined) {\n return elem.msMatchesSelector(selector);\n } else if (elem.webkitMatchesSelector !== undefined) {\n return elem.webkitMatchesSelector(selector);\n } else if (elem.mozMatchesSelector !== undefined) {\n return elem.mozMatchesSelector(selector);\n } else {\n throw new Error('Browser lacks native selectors');\n }\n }\n };\n\n const ancestor$1 = (scope, predicate, isRoot) => {\n let element = scope.dom;\n const stop = isFunction(isRoot) ? isRoot : never;\n while (element.parentNode) {\n element = element.parentNode;\n const el = SugarElement.fromDom(element);\n if (predicate(el)) {\n return Optional.some(el);\n } else if (stop(el)) {\n break;\n }\n }\n return Optional.none();\n };\n const closest$2 = (scope, predicate, isRoot) => {\n const is = (s, test) => test(s);\n return ClosestOrAncestor(is, ancestor$1, scope, predicate, isRoot);\n };\n\n const closest$1 = (scope, predicate, isRoot) => closest$2(scope, predicate, isRoot).isSome();\n\n const ancestor = (scope, selector, isRoot) => ancestor$1(scope, e => is(e, selector), isRoot);\n const closest = (scope, selector, isRoot) => {\n const is$1 = (element, selector) => is(element, selector);\n return ClosestOrAncestor(is$1, ancestor, scope, selector, isRoot);\n };\n\n const addToEditor$1 = editor => {\n const insertToolbarItems = getInsertToolbarItems(editor);\n if (insertToolbarItems.length > 0) {\n editor.ui.registry.addContextToolbar('quickblock', {\n predicate: node => {\n const sugarNode = SugarElement.fromDom(node);\n const textBlockElementsMap = editor.schema.getTextBlockElements();\n const isRoot = elem => elem.dom === editor.getBody();\n return !has$1(sugarNode, 'data-mce-bogus') && closest(sugarNode, 'table,[data-mce-bogus=\"all\"]', isRoot).fold(() => closest$1(sugarNode, elem => name(elem) in textBlockElementsMap && editor.dom.isEmpty(elem.dom), isRoot), never);\n },\n items: insertToolbarItems,\n position: 'line',\n scope: 'editor'\n });\n }\n };\n\n const supports = element => element.dom.classList !== undefined;\n\n const has = (element, clazz) => supports(element) && element.dom.classList.contains(clazz);\n\n const addToEditor = editor => {\n const isEditable = node => editor.dom.isEditable(node);\n const isInEditableContext = el => isEditable(el.parentElement);\n const isImage = node => {\n const isImageFigure = node.nodeName === 'FIGURE' && /image/i.test(node.className);\n const isImage = node.nodeName === 'IMG' || isImageFigure;\n const isPagebreak = has(SugarElement.fromDom(node), 'mce-pagebreak');\n return isImage && isInEditableContext(node) && !isPagebreak;\n };\n const imageToolbarItems = getImageToolbarItems(editor);\n if (imageToolbarItems.length > 0) {\n editor.ui.registry.addContextToolbar('imageselection', {\n predicate: isImage,\n items: imageToolbarItems,\n position: 'node'\n });\n }\n const textToolbarItems = getTextSelectionToolbarItems(editor);\n if (textToolbarItems.length > 0) {\n editor.ui.registry.addContextToolbar('textselection', {\n predicate: node => !isImage(node) && !editor.selection.isCollapsed() && isEditable(node),\n items: textToolbarItems,\n position: 'selection',\n scope: 'editor'\n });\n }\n };\n\n var Plugin = () => {\n global$1.add('quickbars', editor => {\n register(editor);\n setupButtons(editor);\n addToEditor$1(editor);\n addToEditor(editor);\n });\n };\n\n Plugin();\n\n})();\n"],"names":["global$1","tinymce","util","Tools","resolve","isSimpleType","type","value","isString","x","t","Array","isArray","o","v","constructor","String","prototype","isPrototypeOf","_a","name","typeOf","isBoolean","isFunction","option","editor","options","get","getTextSelectionToolbarItems","getInsertToolbarItems","getImageToolbarItems","unique","insertBlob","base64","blob","blobCache","editorUpload","blobInfo","create","prefix","time","Date","getTime","random","Math","floor","generate","add","insertContent","dom","createHTML","src","blobUri","global","setupButtons","ui","registry","addButton","icon","tooltip","onAction","Promise","resolved","fileInput","document","createElement","accept","style","position","left","top","opacity","body","appendChild","resolveFileInput","parentNode","removeChild","changeHandler","e","slice","call","target","files","addEventListener","cancelHandler","cleanup","setEditorTimeout","off","on","click","pickFile","then","length","reader","FileReader","onloadend","result","split","readAsDataURL","blobToBase64","columns","rows","execCommand","insertTable","never","Optional","tag","this","some","none","singletonNone","fold","onNone","onSome","isSome","isNone","map","mapper","bind","binder","exists","predicate","forall","filter","getOr","replacement","or","getOrThunk","thunk","orThunk","getOrDie","message","Error","from","a","isNullable","getOrNull","getOrUndefined","each","worker","toArray","toString","window","Function","ClosestOrAncestor","is","ancestor","scope","isRoot","fromDom","node","SugarElement","fromHtml","html","div","innerHTML","hasChildNodes","childNodes","console","error","fromTag","fromText","text","createTextNode","fromPoint","docElm","y","elementFromPoint","element","selector","nodeType","elem","undefined","matches","msMatchesSelector","webkitMatchesSelector","mozMatchesSelector","ancestor$1","stop","el","closest$1","s","test","closest$2","addToEditor$1","insertToolbarItems","addContextToolbar","sugarNode","textBlockElementsMap","schema","getTextBlockElements","getBody","key","hasAttribute","has$1","closest","nodeName","toLowerCase","isEmpty","items","addToEditor","isEditable","isImage","isImageFigure","className","isPagebreak","clazz","classList","supports","contains","parentElement","imageToolbarItems","textToolbarItems","selection","isCollapsed","registerOption","register","toolbarProcessor","defaultValue","valid","trim","defaultSelectionToolbar","processor","default","defaultInsertToolbar","defaultImageToolbar"],"mappings":"gGAIA,WAGI,IAAIA,EAAWC,QAAQC,KAAKC,MAAMC,QAAQ,yBAE1C,MAqBMC,EAAeC,GAAQC,UAAgBA,IAAUD,EACjDE,GAFSF,EAES,SAFDC,GAZRE,KACb,MAAMC,SAAWD,EACjB,OAAU,OAANA,EACK,OACQ,WAANC,GAAkBC,MAAMC,QAAQH,GAClC,QACQ,WAANC,IAAuCG,EAdlCC,EAcsBL,GAdnBM,EAcsBC,QAZZC,UAYwCC,cAAcL,KAThD,QAAxBM,EAAKL,EAAEC,mBAAgC,IAAPI,OAAgB,EAASA,EAAGC,QAAUL,EAAYK,MAUpF,SAEAV,EAHwC,IAACG,EAdlCC,EAAGC,EACfI,CAiBV,EAEoCE,CAAOd,KAAWD,GAAnCA,MAGf,MAAMgB,EAAYjB,EAAa,WAGzBkB,EAAalB,EAAa,YAE1BmB,EAASJ,GAAQK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EAA0B,2CAChCN,EAAe,8BAA+B,CAC5CO,UAAWL,EAAiBI,GAC5BE,QAASF,IAEX,MAAMG,EAAuB,wBAC7BT,EAAe,2BAA4B,CACzCO,UAAWL,EAAiBO,GAC5BD,QAASC,IAEX,MAAMC,EAAsB,mCAC5BV,EAAe,0BAA2B,CACxCO,UAAWL,EAAiBQ,GAC5BF,QAASE,GACT,EA0WAT,CAAS/L,GACT6B,EAAa7B,GACb+J,EAAc/J,GACd+K,EAAY/K,EAAO,GAM1B,CA1bD"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{__exports as e}from"../../../../_virtual/plugin48.mjs";var o;function n(){return o||(o=1,function(){var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const o=(n="function",e=>typeof e===n);var n,t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),a=tinymce.util.Tools.resolve("tinymce.util.Tools");const i=e=>o=>o.options.get(e),r=i("save_enablewhendirty"),c=i("save_onsavecallback"),s=i("save_oncancelcallback"),l=(e,o)=>{e.notificationManager.open({text:o,type:"error"})},d=e=>{e.addCommand("mceSave",(()=>{(e=>{const n=t.DOM.getParent(e.id,"form");if(r(e)&&!e.isDirty())return;e.save();const a=c(e);if(o(a))return a.call(e,e),void e.nodeChanged();n?(e.setDirty(!1),n.onsubmit&&!n.onsubmit()||("function"==typeof n.submit?n.submit():l(e,"Error: Form submit field collision.")),e.nodeChanged()):l(e,"Error: No form element found.")})(e)})),e.addCommand("mceCancel",(()=>{(e=>{const n=a.trim(e.startContent),t=s(e);o(t)?t.call(e,e):e.resetContent(n)})(e)}))},m=e=>o=>{const n=()=>{o.setEnabled(!r(e)||e.isDirty())};return n(),e.on("NodeChange dirty",n),()=>e.off("NodeChange dirty",n)};e.add("save",(e=>{(e=>{const o=e.options.register;o("save_enablewhendirty",{processor:"boolean",default:!0}),o("save_onsavecallback",{processor:"function"}),o("save_oncancelcallback",{processor:"function"})})(e),(e=>{e.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>e.execCommand("mceSave"),onSetup:m(e)}),e.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>e.execCommand("mceCancel"),onSetup:m(e)}),e.addShortcut("Meta+S","","mceSave")})(e),d(e)}))}()),e}export{n as __require};
|
2
|
-
//# sourceMappingURL=plugin.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sources":["../../../../../../node_modules/tinymce/plugins/save/plugin.js"],"sourcesContent":["/**\n * TinyMCE version 6.8.5 (TBD)\n */\n\n(function () {\n 'use strict';\n\n var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n\n const isSimpleType = type => value => typeof value === type;\n const isFunction = isSimpleType('function');\n\n var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');\n\n var global = tinymce.util.Tools.resolve('tinymce.util.Tools');\n\n const option = name => editor => editor.options.get(name);\n const register$2 = editor => {\n const registerOption = editor.options.register;\n registerOption('save_enablewhendirty', {\n processor: 'boolean',\n default: true\n });\n registerOption('save_onsavecallback', { processor: 'function' });\n registerOption('save_oncancelcallback', { processor: 'function' });\n };\n const enableWhenDirty = option('save_enablewhendirty');\n const getOnSaveCallback = option('save_onsavecallback');\n const getOnCancelCallback = option('save_oncancelcallback');\n\n const displayErrorMessage = (editor, message) => {\n editor.notificationManager.open({\n text: message,\n type: 'error'\n });\n };\n const save = editor => {\n const formObj = global$1.DOM.getParent(editor.id, 'form');\n if (enableWhenDirty(editor) && !editor.isDirty()) {\n return;\n }\n editor.save();\n const onSaveCallback = getOnSaveCallback(editor);\n if (isFunction(onSaveCallback)) {\n onSaveCallback.call(editor, editor);\n editor.nodeChanged();\n return;\n }\n if (formObj) {\n editor.setDirty(false);\n if (!formObj.onsubmit || formObj.onsubmit()) {\n if (typeof formObj.submit === 'function') {\n formObj.submit();\n } else {\n displayErrorMessage(editor, 'Error: Form submit field collision.');\n }\n }\n editor.nodeChanged();\n } else {\n displayErrorMessage(editor, 'Error: No form element found.');\n }\n };\n const cancel = editor => {\n const h = global.trim(editor.startContent);\n const onCancelCallback = getOnCancelCallback(editor);\n if (isFunction(onCancelCallback)) {\n onCancelCallback.call(editor, editor);\n return;\n }\n editor.resetContent(h);\n };\n\n const register$1 = editor => {\n editor.addCommand('mceSave', () => {\n save(editor);\n });\n editor.addCommand('mceCancel', () => {\n cancel(editor);\n });\n };\n\n const stateToggle = editor => api => {\n const handler = () => {\n api.setEnabled(!enableWhenDirty(editor) || editor.isDirty());\n };\n handler();\n editor.on('NodeChange dirty', handler);\n return () => editor.off('NodeChange dirty', handler);\n };\n const register = editor => {\n editor.ui.registry.addButton('save', {\n icon: 'save',\n tooltip: 'Save',\n enabled: false,\n onAction: () => editor.execCommand('mceSave'),\n onSetup: stateToggle(editor)\n });\n editor.ui.registry.addButton('cancel', {\n icon: 'cancel',\n tooltip: 'Cancel',\n enabled: false,\n onAction: () => editor.execCommand('mceCancel'),\n onSetup: stateToggle(editor)\n });\n editor.addShortcut('Meta+S', '', 'mceSave');\n };\n\n var Plugin = () => {\n global$2.add('save', editor => {\n register$2(editor);\n register(editor);\n register$1(editor);\n });\n };\n\n Plugin();\n\n})();\n"],"names":["global$2","tinymce","util","Tools","resolve","isFunction","type","value","global$1","global","option","name","editor","options","get","enableWhenDirty","getOnSaveCallback","getOnCancelCallback","displayErrorMessage","message","notificationManager","open","text","register$1","addCommand","formObj","DOM","getParent","id","isDirty","save","onSaveCallback","call","nodeChanged","setDirty","onsubmit","submit","h","trim","startContent","onCancelCallback","resetContent","cancel","stateToggle","api","handler","setEnabled","on","off","add","registerOption","register","processor","default","register$2","ui","registry","addButton","icon","tooltip","enabled","onAction","execCommand","onSetup","addShortcut"],"mappings":"gGAIA,WAGI,IAAIA,EAAWC,QAAQC,KAAKC,MAAMC,QAAQ,yBAE1C,MACMC,GADeC,EACW,WADHC,UAAgBA,IAAUD,GAAlCA,MAGjBE,EAAWP,QAAQC,KAAKC,MAAMC,QA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B,CACrCE,UAAW,UACXC,SAAS,IAEXH,EAAe,sBAAuB,CAAEE,UAAW,aACnDF,EAAe,wBAAyB,CAAEE,UAAW,YAAa,EAqFhEE,CAAW1C,GApBEA,KACfA,EAAO2C,GAAGC,SAASC,UAAU,OAAQ,CACnCC,KAAM,OACNC,QAAS,OACTC,SAAS,EACTC,SAAU,IAAMjD,EAAOkD,YAAY,WACnCC,QAASpB,EAAY/B,KAEvBA,EAAO2C,GAAGC,SAASC,UAAU,SAAU,CACrCC,KAAM,SACNC,QAAS,SACTC,SAAS,EACTC,SAAU,IAAMjD,EAAOkD,YAAY,aACnCC,QAASpB,EAAY/B,KAEvBA,EAAOoD,YAAY,SAAU,GAAI,UAAU,EAMzCb,CAASvC,GACTW,EAAWX,EAAO,GAMzB,CAjHD"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{__exports as e}from"../../../../_virtual/plugin52.mjs";var t;function n(){return t||(t=1,function(){const e=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}};var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const n=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(n=r=e,o=(s=String).prototype,o.isPrototypeOf(n)||(null===(a=r.constructor)||void 0===a?void 0:a.name)===s.name)?"string":t;var n,o;var r,s,a})(t)===e,o=e=>t=>typeof t===e,r=n("string"),s=n("array"),a=o("boolean"),l=o("number"),i=()=>{},c=e=>()=>e,d=c(!0),m=c("[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]");class u{constructor(e,t){this.tag=e,this.value=t}static some(e){return new u(!0,e)}static none(){return u.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?u.some(e(this.value)):u.none()}bind(e){return this.tag?e(this.value):u.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:u.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return(e=>null==e)(e)?u.none():u.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}u.singletonNone=new u(!1);const h=m;var g=tinymce.util.Tools.resolve("tinymce.Env"),f=tinymce.util.Tools.resolve("tinymce.util.Tools");const p=Array.prototype.slice,x=Array.prototype.push,y=(e,t)=>{const n=e.length,o=new Array(n);for(let r=0;r<n;r++){const n=e[r];o[r]=t(n,r)}return o},v=(e,t)=>{for(let n=0,o=e.length;n<o;n++){t(e[n],n)}},w=(e,t)=>{for(let n=e.length-1;n>=0;n--){t(e[n],n)}},b=(e,t)=>(e=>{const t=[];for(let n=0,o=e.length;n<o;++n){if(!s(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);x.apply(t,e[n])}return t})(y(e,t)),E=Object.hasOwnProperty,N=(e,t)=>E.call(e,t);"undefined"!=typeof window?window:Function("return this;")();const C=(T=3,e=>(e=>e.dom.nodeType)(e)===T);var T;const O=(e,t,n)=>{((e,t,n)=>{if(!(r(n)||a(n)||l(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+"")})(e.dom,t,n)},k=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},A={fromHtml:(e,t)=>{const n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return k(n.childNodes[0])},fromTag:(e,t)=>{const n=(t||document).createElement(e);return k(n)},fromText:(e,t)=>{const n=(t||document).createTextNode(e);return k(n)},fromDom:k,fromPoint:(e,t,n)=>u.from(e.dom.elementFromPoint(t,n)).map(k)},D=(e,t)=>({element:e,offset:t}),S=(e,t)=>{const n=(e=>y(e.dom.childNodes,A.fromDom))(e);return n.length>0&&t<n.length?D(n[t],0):D(e,t)},B=(e,t)=>{const n=(e=>u.from(e.dom.parentNode).map(A.fromDom))(e);n.each((n=>{n.dom.insertBefore(t.dom,e.dom)}))},F=(e,t)=>{B(e,t),((e,t)=>{e.dom.appendChild(t.dom)})(t,e)},M=((e,t)=>{const n=t=>e(t)?u.from(t.dom.nodeValue):u.none();return{get:o=>{if(!e(o))throw new Error("Can only get "+t+" value of a "+t+" node");return n(o).getOr("")},getOption:n,set:(n,o)=>{if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=o}}})(C,"text"),I=e=>M.get(e),R=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return 1!==(o=n).nodeType&&9!==o.nodeType&&11!==o.nodeType||0===o.childElementCount?[]:y(n.querySelectorAll(e),A.fromDom);var o})(t,e);var P=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const W=(e,t)=>e.isBlock(t)||N(e.schema.getVoidElements(),t.nodeName),_=(e,t)=>!e.isEditable(t),$=(e,t)=>!e.isBlock(t)&&N(e.schema.getWhitespaceElements(),t.nodeName),j=(e,t)=>S(A.fromDom(e),t),V=(e,t,n,o,r,s=!0)=>{let a=s?t(!1):n;for(;a;){const n=_(e,a);if(n||$(e,a)){if(n?o.cef(a):o.boundary(a))break;a=t(!0)}else{if(W(e,a)){if(o.boundary(a))break}else 3===a.nodeType&&o.text(a);if(a===r)break;a=t(!1)}}},H=(e,t,n,o,r)=>{var s;if(((e,t)=>W(e,t)||_(e,t)||$(e,t)||((e,t)=>"true"===e.getContentEditable(t)&&t.parentNode&&!e.isEditable(t.parentNode))(e,t))(e,n))return;const a=null!==(s=e.getParent(o,e.isBlock))&&void 0!==s?s:e.getRoot(),l=new P(n,a),i=r?l.next.bind(l):l.prev.bind(l);V(e,i,n,{boundary:d,cef:d,text:e=>{r?t.fOffset+=e.length:t.sOffset+=e.length,t.elements.push(A.fromDom(e))}})},q=(e,t,n,o,r,s=!0)=>{const a=new P(n,t),l=[];let i={sOffset:0,fOffset:0,elements:[]};H(e,i,n,t,!1);const c=()=>(i.elements.length>0&&(l.push(i),i={sOffset:0,fOffset:0,elements:[]}),!1);return V(e,a.next.bind(a),n,{boundary:c,cef:e=>(c(),r&&l.push(...r.cef(e)),!1),text:e=>{i.elements.push(A.fromDom(e)),r&&r.text(e,i)}},o,s),o&&H(e,i,o,t,!0),c(),l},z=(e,t)=>{const n=j(t.startContainer,t.startOffset),o=n.element.dom,r=j(t.endContainer,t.endOffset),s=r.element.dom;return q(e,t.commonAncestorContainer,o,s,{text:(e,t)=>{e===s?t.fOffset+=e.length-r.offset:e===o&&(t.sOffset+=n.offset)},cef:t=>((e,t)=>{const n=p.call(e,0);return n.sort(t),n})(b(R(A.fromDom(t),"*[contenteditable=true]"),(t=>{const n=t.dom;return q(e,n,n)})),((e,t)=>((e,t)=>((e,t,n)=>!!(e.compareDocumentPosition(t)&n))(e,t,Node.DOCUMENT_POSITION_PRECEDING))(e.elements[0].dom,t.elements[0].dom)?1:-1))},!1)},L=(e,t)=>t.collapsed?[]:z(e,t),U=(e,t)=>{const n=e.createRng();return n.selectNode(t),L(e,n)},G=(e,t)=>{const n=(o=e,r=(e,n)=>{const o=I(n),r=e.last,s=r+o.length,a=b(t,((e,t)=>e.start<s&&e.finish>r?[{element:n,start:Math.max(r,e.start)-r,finish:Math.min(s,e.finish)-r,matchId:t}]:[]));return{results:e.results.concat(a),last:s}},s={results:[],last:0},v(o,((e,t)=>{s=r(s,e,t)})),s).results;var o,r,s;return((e,t)=>{if(0===e.length)return[];{let n=t(e[0]);const o=[];let r=[];for(let s=0,a=e.length;s<a;s++){const a=e[s],l=t(a);l!==n&&(o.push(r),r=[]),n=l,r.push(a)}return 0!==r.length&&o.push(r),o}})(n,(e=>e.matchId))},K=(e,t)=>b(t,(t=>{const n=t.elements,o=y(n,I).join(""),r=((e,t,n=0,o=e.length)=>{const r=t.regex;r.lastIndex=n;const s=[];let a;for(;a=r.exec(e);){const e=a[t.matchIndex],n=a.index+a[0].indexOf(e),l=n+e.length;if(l>o)break;s.push({start:n,finish:l}),r.lastIndex=l}return s})(o,e,t.sOffset,o.length-t.fOffset);return G(n,r)})),J=(e,t)=>{w(e,((e,n)=>{w(e,(e=>{const o=A.fromDom(t.cloneNode(!1));O(o,"data-mce-index",n);const r=e.element.dom;if(r.length===e.finish&&0===e.start)F(e.element,o);else{r.length!==e.finish&&r.splitText(e.finish);const t=r.splitText(e.start);F(A.fromDom(t),o)}}))}))},Q=(e,t,n,o)=>{const r=n.getBookmark(),s=e.select("td[data-mce-selected],th[data-mce-selected]"),a=s.length>0?((e,t)=>b(t,(t=>U(e,t))))(e,s):L(e,n.getRng()),l=K(t,a);return J(l,o),n.moveToBookmark(r),l.length},X=e=>e.getAttribute("data-mce-index"),Y=(e,t,n,o)=>{const r=e.dom.create("span",{"data-mce-bogus":1});r.className="mce-match-marker";const s=e.getBody();return ie(e,t,!1),o?Q(e.dom,n,e.selection,r):((e,t,n,o)=>{const r=U(e,n),s=K(t,r);return J(s,o),s.length})(e.dom,n,s,r)},Z=e=>{var t;const n=e.parentNode;e.firstChild&&n.insertBefore(e.firstChild,e),null===(t=e.parentNode)||void 0===t||t.removeChild(e)},ee=(e,t)=>{const n=[],o=f.toArray(e.getBody().getElementsByTagName("span"));if(o.length)for(let e=0;e<o.length;e++){const r=X(o[e]);null!==r&&r.length&&(r===t.toString()&&n.push(o[e]))}return n},te=(e,t,n)=>{const o=t.get();let r=o.index;const s=e.dom;n?r+1===o.count?r=0:r++:r-1==-1?r=o.count-1:r--,s.removeClass(ee(e,o.index),"mce-match-marker-selected");const a=ee(e,r);return a.length?(s.addClass(ee(e,r),"mce-match-marker-selected"),e.selection.scrollIntoView(a[0]),r):-1},ne=(e,t)=>{const n=t.parentNode;e.remove(t),n&&e.isEmpty(n)&&e.remove(n)},oe=(e,t,n,o,r,s)=>{const a=e.selection,l=((e,t)=>{const n="("+e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return t?`(?:^|\\s|${h()})`+n+`(?=$|\\s|${h()})`:n})(n,r),i=a.isForward(),c={regex:new RegExp(l,o?"g":"gi"),matchIndex:1},d=Y(e,t,c,s);if(g.browser.isSafari()&&a.setRng(a.getRng(),i),d){const a=te(e,t,!0);t.set({index:a,count:d,text:n,matchCase:o,wholeWord:r,inSelection:s})}return d},re=(e,t)=>{const n=te(e,t,!0);t.set({...t.get(),index:n})},se=(e,t)=>{const n=te(e,t,!1);t.set({...t.get(),index:n})},ae=e=>{const t=X(e);return null!==t&&t.length>0},le=(e,t,n,o,r)=>{const s=t.get(),a=s.index;let l,i=a;o=!1!==o;const c=e.getBody(),d=f.grep(f.toArray(c.getElementsByTagName("span")),ae);for(let t=0;t<d.length;t++){const c=X(d[t]);let m=l=parseInt(c,10);if(r||m===s.index){for(n.length?(d[t].innerText=n,Z(d[t])):ne(e.dom,d[t]);d[++t];){if(m=parseInt(X(d[t]),10),m!==l){t--;break}ne(e.dom,d[t])}o&&i--}else l>a&&d[t].setAttribute("data-mce-index",String(l-1))}return t.set({...s,count:r?0:s.count-1,index:i}),o?re(e,t):se(e,t),!r&&t.get().count>0},ie=(e,t,n)=>{let o,r;const s=t.get(),a=f.toArray(e.getBody().getElementsByTagName("span"));for(let e=0;e<a.length;e++){const t=X(a[e]);null!==t&&t.length&&(t===s.index.toString()&&(o||(o=a[e].firstChild),r=a[e].firstChild),Z(a[e]))}if(t.set({...s,index:-1,count:0,text:""}),o&&r){const t=e.dom.createRng();return t.setStart(o,0),t.setEnd(r,r.data.length),!1!==n&&e.selection.setRng(t),t}},ce=()=>{const t=(t=>{const n=e(u.none()),o=()=>n.get().each(t);return{clear:()=>{o(),n.set(u.none())},isSet:()=>n.get().isSome(),get:()=>n.get(),set:e=>{o(),n.set(u.some(e))}}})(i);return{...t,on:e=>t.get().each(e)}},de=(e,t)=>{const n=ce();e.undoManager.add();const o=f.trim(e.selection.getContent({format:"text"})),r=e=>{e.setEnabled("next",((e,t)=>t.get().count>1)(0,t)),e.setEnabled("prev",((e,t)=>t.get().count>1)(0,t))},s=(e,t)=>{v(["replace","replaceall","prev","next"],(n=>e.setEnabled(n,!t)))},a=(e,t)=>{t.redial(h(e,t.getData()))},l=(e,t)=>{g.browser.isSafari()&&g.deviceType.isTouch()&&("find"===t||"replace"===t||"replaceall"===t)&&e.focus(t)},i=n=>{ie(e,t,!1),s(n,!0),r(n)},c=n=>{const o=n.getData(),l=t.get();if(o.findtext.length){if(l.text===o.findtext&&l.matchCase===o.matchcase&&l.wholeWord===o.wholewords)re(e,t);else{const r=oe(e,t,o.findtext,o.matchcase,o.wholewords,o.inselection);r<=0&&a(!0,n),s(n,0===r)}r(n)}else i(n)},d=t.get(),m={findtext:o,replacetext:"",wholewords:d.wholeWord,matchcase:d.matchCase,inselection:d.inSelection},u=e=>{const t=[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",enabled:!1,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",enabled:!1,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}];return e&&t.push({type:"alertbanner",level:"error",text:"Could not find the specified string.",icon:"warning"}),t},h=(n,o)=>({title:"Find and Replace",size:"normal",body:{type:"panel",items:u(n)},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",enabled:!1},{type:"custom",name:"replaceall",text:"Replace all",enabled:!1}],initialData:o,onChange:(e,o)=>{n&&a(!1,e),"findtext"===o.name&&t.get().count>0&&i(e)},onAction:(n,o)=>{const s=n.getData();switch(o.name){case"find":c(n);break;case"replace":le(e,t,s.replacetext)?r(n):i(n);break;case"replaceall":le(e,t,s.replacetext,!0,!0),i(n);break;case"prev":se(e,t),r(n);break;case"next":re(e,t),r(n);break;case"matchcase":case"wholewords":case"inselection":a(!1,n),(e=>{const n=e.getData(),o=t.get();t.set({...o,matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection})})(n),i(n)}l(n,o.name)},onSubmit:e=>{c(e),l(e,"find")},onClose:()=>{e.focus(),ie(e,t),e.undoManager.add()}});n.set(e.windowManager.open(h(!1,m),{inline:"toolbar"}))},me=(e,t)=>()=>{de(e,t)};t.add("searchreplace",(t=>{const n=e({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return((e,t)=>{e.addCommand("SearchReplace",(()=>{de(e,t)}))})(t,n),((e,t)=>{e.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:me(e,t),icon:"search"}),e.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:me(e,t),icon:"search"}),e.shortcuts.add("Meta+F","",me(e,t))})(t,n),((e,t)=>({done:n=>ie(e,t,n),find:(n,o,r,s=!1)=>oe(e,t,n,o,r,s),next:()=>re(e,t),prev:()=>se(e,t),replace:(n,o,r)=>le(e,t,n,o,r)}))(t,n)}))}()),e}export{n as __require};
|
2
|
-
//# sourceMappingURL=plugin.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sources":["../../../../../../node_modules/tinymce/plugins/searchreplace/plugin.js"],"sourcesContent":["/**\n * TinyMCE version 6.8.5 (TBD)\n */\n\n(function () {\n 'use strict';\n\n const Cell = initial => {\n let value = initial;\n const get = () => {\n return value;\n };\n const set = v => {\n value = v;\n };\n return {\n get,\n set\n };\n };\n\n var global$3 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n\n const hasProto = (v, constructor, predicate) => {\n var _a;\n if (predicate(v, constructor.prototype)) {\n return true;\n } else {\n return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;\n }\n };\n const typeOf = x => {\n const t = typeof x;\n if (x === null) {\n return 'null';\n } else if (t === 'object' && Array.isArray(x)) {\n return 'array';\n } else if (t === 'object' && hasProto(x, String, (o, proto) => proto.isPrototypeOf(o))) {\n return 'string';\n } else {\n return t;\n }\n };\n const isType$1 = type => value => typeOf(value) === type;\n const isSimpleType = type => value => typeof value === type;\n const isString = isType$1('string');\n const isArray = isType$1('array');\n const isBoolean = isSimpleType('boolean');\n const isNullable = a => a === null || a === undefined;\n const isNonNullable = a => !isNullable(a);\n const isNumber = isSimpleType('number');\n\n const noop = () => {\n };\n const constant = value => {\n return () => {\n return value;\n };\n };\n const always = constant(true);\n\n const punctuationStr = `[~\\u2116|!-*+-\\\\/:;?@\\\\[-\\`{}\\u00A1\\u00AB\\u00B7\\u00BB\\u00BF;\\u00B7\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061E\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1361-\\u1368\\u1400\\u166D\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u3008\\u3009\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30\\u2E31\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]`;\n\n const punctuation$1 = constant(punctuationStr);\n\n class Optional {\n constructor(tag, value) {\n this.tag = tag;\n this.value = value;\n }\n static some(value) {\n return new Optional(true, value);\n }\n static none() {\n return Optional.singletonNone;\n }\n fold(onNone, onSome) {\n if (this.tag) {\n return onSome(this.value);\n } else {\n return onNone();\n }\n }\n isSome() {\n return this.tag;\n }\n isNone() {\n return !this.tag;\n }\n map(mapper) {\n if (this.tag) {\n return Optional.some(mapper(this.value));\n } else {\n return Optional.none();\n }\n }\n bind(binder) {\n if (this.tag) {\n return binder(this.value);\n } else {\n return Optional.none();\n }\n }\n exists(predicate) {\n return this.tag && predicate(this.value);\n }\n forall(predicate) {\n return !this.tag || predicate(this.value);\n }\n filter(predicate) {\n if (!this.tag || predicate(this.value)) {\n return this;\n } else {\n return Optional.none();\n }\n }\n getOr(replacement) {\n return this.tag ? this.value : replacement;\n }\n or(replacement) {\n return this.tag ? this : replacement;\n }\n getOrThunk(thunk) {\n return this.tag ? this.value : thunk();\n }\n orThunk(thunk) {\n return this.tag ? this : thunk();\n }\n getOrDie(message) {\n if (!this.tag) {\n throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');\n } else {\n return this.value;\n }\n }\n static from(value) {\n return isNonNullable(value) ? Optional.some(value) : Optional.none();\n }\n getOrNull() {\n return this.tag ? this.value : null;\n }\n getOrUndefined() {\n return this.value;\n }\n each(worker) {\n if (this.tag) {\n worker(this.value);\n }\n }\n toArray() {\n return this.tag ? [this.value] : [];\n }\n toString() {\n return this.tag ? `some(${ this.value })` : 'none()';\n }\n }\n Optional.singletonNone = new Optional(false);\n\n const punctuation = punctuation$1;\n\n var global$2 = tinymce.util.Tools.resolve('tinymce.Env');\n\n var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');\n\n const nativeSlice = Array.prototype.slice;\n const nativePush = Array.prototype.push;\n const map = (xs, f) => {\n const len = xs.length;\n const r = new Array(len);\n for (let i = 0; i < len; i++) {\n const x = xs[i];\n r[i] = f(x, i);\n }\n return r;\n };\n const each = (xs, f) => {\n for (let i = 0, len = xs.length; i < len; i++) {\n const x = xs[i];\n f(x, i);\n }\n };\n const eachr = (xs, f) => {\n for (let i = xs.length - 1; i >= 0; i--) {\n const x = xs[i];\n f(x, i);\n }\n };\n const groupBy = (xs, f) => {\n if (xs.length === 0) {\n return [];\n } else {\n let wasType = f(xs[0]);\n const r = [];\n let group = [];\n for (let i = 0, len = xs.length; i < len; i++) {\n const x = xs[i];\n const type = f(x);\n if (type !== wasType) {\n r.push(group);\n group = [];\n }\n wasType = type;\n group.push(x);\n }\n if (group.length !== 0) {\n r.push(group);\n }\n return r;\n }\n };\n const foldl = (xs, f, acc) => {\n each(xs, (x, i) => {\n acc = f(acc, x, i);\n });\n return acc;\n };\n const flatten = xs => {\n const r = [];\n for (let i = 0, len = xs.length; i < len; ++i) {\n if (!isArray(xs[i])) {\n throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);\n }\n nativePush.apply(r, xs[i]);\n }\n return r;\n };\n const bind = (xs, f) => flatten(map(xs, f));\n const sort = (xs, comparator) => {\n const copy = nativeSlice.call(xs, 0);\n copy.sort(comparator);\n return copy;\n };\n\n const hasOwnProperty = Object.hasOwnProperty;\n const has = (obj, key) => hasOwnProperty.call(obj, key);\n\n typeof window !== 'undefined' ? window : Function('return this;')();\n\n const DOCUMENT = 9;\n const DOCUMENT_FRAGMENT = 11;\n const ELEMENT = 1;\n const TEXT = 3;\n\n const type = element => element.dom.nodeType;\n const isType = t => element => type(element) === t;\n const isText$1 = isType(TEXT);\n\n const rawSet = (dom, key, value) => {\n if (isString(value) || isBoolean(value) || isNumber(value)) {\n dom.setAttribute(key, value + '');\n } else {\n console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);\n throw new Error('Attribute value was not simple');\n }\n };\n const set = (element, key, value) => {\n rawSet(element.dom, key, value);\n };\n\n const fromHtml = (html, scope) => {\n const doc = scope || document;\n const div = doc.createElement('div');\n div.innerHTML = html;\n if (!div.hasChildNodes() || div.childNodes.length > 1) {\n const message = 'HTML does not have a single root node';\n console.error(message, html);\n throw new Error(message);\n }\n return fromDom(div.childNodes[0]);\n };\n const fromTag = (tag, scope) => {\n const doc = scope || document;\n const node = doc.createElement(tag);\n return fromDom(node);\n };\n const fromText = (text, scope) => {\n const doc = scope || document;\n const node = doc.createTextNode(text);\n return fromDom(node);\n };\n const fromDom = node => {\n if (node === null || node === undefined) {\n throw new Error('Node cannot be null or undefined');\n }\n return { dom: node };\n };\n const fromPoint = (docElm, x, y) => Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom);\n const SugarElement = {\n fromHtml,\n fromTag,\n fromText,\n fromDom,\n fromPoint\n };\n\n const bypassSelector = dom => dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0;\n const all = (selector, scope) => {\n const base = scope === undefined ? document : scope.dom;\n return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom);\n };\n\n const parent = element => Optional.from(element.dom.parentNode).map(SugarElement.fromDom);\n const children = element => map(element.dom.childNodes, SugarElement.fromDom);\n const spot = (element, offset) => ({\n element,\n offset\n });\n const leaf = (element, offset) => {\n const cs = children(element);\n return cs.length > 0 && offset < cs.length ? spot(cs[offset], 0) : spot(element, offset);\n };\n\n const before = (marker, element) => {\n const parent$1 = parent(marker);\n parent$1.each(v => {\n v.dom.insertBefore(element.dom, marker.dom);\n });\n };\n const append = (parent, element) => {\n parent.dom.appendChild(element.dom);\n };\n const wrap = (element, wrapper) => {\n before(element, wrapper);\n append(wrapper, element);\n };\n\n const NodeValue = (is, name) => {\n const get = element => {\n if (!is(element)) {\n throw new Error('Can only get ' + name + ' value of a ' + name + ' node');\n }\n return getOption(element).getOr('');\n };\n const getOption = element => is(element) ? Optional.from(element.dom.nodeValue) : Optional.none();\n const set = (element, value) => {\n if (!is(element)) {\n throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');\n }\n element.dom.nodeValue = value;\n };\n return {\n get,\n getOption,\n set\n };\n };\n\n const api = NodeValue(isText$1, 'text');\n const get$1 = element => api.get(element);\n\n const compareDocumentPosition = (a, b, match) => {\n return (a.compareDocumentPosition(b) & match) !== 0;\n };\n const documentPositionPreceding = (a, b) => {\n return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_PRECEDING);\n };\n\n const descendants = (scope, selector) => all(selector, scope);\n\n var global = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');\n\n const isSimpleBoundary = (dom, node) => dom.isBlock(node) || has(dom.schema.getVoidElements(), node.nodeName);\n const isContentEditableFalse = (dom, node) => !dom.isEditable(node);\n const isContentEditableTrueInCef = (dom, node) => dom.getContentEditable(node) === 'true' && node.parentNode && !dom.isEditable(node.parentNode);\n const isHidden = (dom, node) => !dom.isBlock(node) && has(dom.schema.getWhitespaceElements(), node.nodeName);\n const isBoundary = (dom, node) => isSimpleBoundary(dom, node) || isContentEditableFalse(dom, node) || isHidden(dom, node) || isContentEditableTrueInCef(dom, node);\n const isText = node => node.nodeType === 3;\n const nuSection = () => ({\n sOffset: 0,\n fOffset: 0,\n elements: []\n });\n const toLeaf = (node, offset) => leaf(SugarElement.fromDom(node), offset);\n const walk = (dom, walkerFn, startNode, callbacks, endNode, skipStart = true) => {\n let next = skipStart ? walkerFn(false) : startNode;\n while (next) {\n const isCefNode = isContentEditableFalse(dom, next);\n if (isCefNode || isHidden(dom, next)) {\n const stopWalking = isCefNode ? callbacks.cef(next) : callbacks.boundary(next);\n if (stopWalking) {\n break;\n } else {\n next = walkerFn(true);\n continue;\n }\n } else if (isSimpleBoundary(dom, next)) {\n if (callbacks.boundary(next)) {\n break;\n }\n } else if (isText(next)) {\n callbacks.text(next);\n }\n if (next === endNode) {\n break;\n } else {\n next = walkerFn(false);\n }\n }\n };\n const collectTextToBoundary = (dom, section, node, rootNode, forwards) => {\n var _a;\n if (isBoundary(dom, node)) {\n return;\n }\n const rootBlock = (_a = dom.getParent(rootNode, dom.isBlock)) !== null && _a !== void 0 ? _a : dom.getRoot();\n const walker = new global(node, rootBlock);\n const walkerFn = forwards ? walker.next.bind(walker) : walker.prev.bind(walker);\n walk(dom, walkerFn, node, {\n boundary: always,\n cef: always,\n text: next => {\n if (forwards) {\n section.fOffset += next.length;\n } else {\n section.sOffset += next.length;\n }\n section.elements.push(SugarElement.fromDom(next));\n }\n });\n };\n const collect = (dom, rootNode, startNode, endNode, callbacks, skipStart = true) => {\n const walker = new global(startNode, rootNode);\n const sections = [];\n let current = nuSection();\n collectTextToBoundary(dom, current, startNode, rootNode, false);\n const finishSection = () => {\n if (current.elements.length > 0) {\n sections.push(current);\n current = nuSection();\n }\n return false;\n };\n walk(dom, walker.next.bind(walker), startNode, {\n boundary: finishSection,\n cef: node => {\n finishSection();\n if (callbacks) {\n sections.push(...callbacks.cef(node));\n }\n return false;\n },\n text: next => {\n current.elements.push(SugarElement.fromDom(next));\n if (callbacks) {\n callbacks.text(next, current);\n }\n }\n }, endNode, skipStart);\n if (endNode) {\n collectTextToBoundary(dom, current, endNode, rootNode, true);\n }\n finishSection();\n return sections;\n };\n const collectRangeSections = (dom, rng) => {\n const start = toLeaf(rng.startContainer, rng.startOffset);\n const startNode = start.element.dom;\n const end = toLeaf(rng.endContainer, rng.endOffset);\n const endNode = end.element.dom;\n return collect(dom, rng.commonAncestorContainer, startNode, endNode, {\n text: (node, section) => {\n if (node === endNode) {\n section.fOffset += node.length - end.offset;\n } else if (node === startNode) {\n section.sOffset += start.offset;\n }\n },\n cef: node => {\n const sections = bind(descendants(SugarElement.fromDom(node), '*[contenteditable=true]'), e => {\n const ceTrueNode = e.dom;\n return collect(dom, ceTrueNode, ceTrueNode);\n });\n return sort(sections, (a, b) => documentPositionPreceding(a.elements[0].dom, b.elements[0].dom) ? 1 : -1);\n }\n }, false);\n };\n const fromRng = (dom, rng) => rng.collapsed ? [] : collectRangeSections(dom, rng);\n const fromNode = (dom, node) => {\n const rng = dom.createRng();\n rng.selectNode(node);\n return fromRng(dom, rng);\n };\n const fromNodes = (dom, nodes) => bind(nodes, node => fromNode(dom, node));\n\n const find$2 = (text, pattern, start = 0, finish = text.length) => {\n const regex = pattern.regex;\n regex.lastIndex = start;\n const results = [];\n let match;\n while (match = regex.exec(text)) {\n const matchedText = match[pattern.matchIndex];\n const matchStart = match.index + match[0].indexOf(matchedText);\n const matchFinish = matchStart + matchedText.length;\n if (matchFinish > finish) {\n break;\n }\n results.push({\n start: matchStart,\n finish: matchFinish\n });\n regex.lastIndex = matchFinish;\n }\n return results;\n };\n const extract = (elements, matches) => {\n const nodePositions = foldl(elements, (acc, element) => {\n const content = get$1(element);\n const start = acc.last;\n const finish = start + content.length;\n const positions = bind(matches, (match, matchIdx) => {\n if (match.start < finish && match.finish > start) {\n return [{\n element,\n start: Math.max(start, match.start) - start,\n finish: Math.min(finish, match.finish) - start,\n matchId: matchIdx\n }];\n } else {\n return [];\n }\n });\n return {\n results: acc.results.concat(positions),\n last: finish\n };\n }, {\n results: [],\n last: 0\n }).results;\n return groupBy(nodePositions, position => position.matchId);\n };\n\n const find$1 = (pattern, sections) => bind(sections, section => {\n const elements = section.elements;\n const content = map(elements, get$1).join('');\n const positions = find$2(content, pattern, section.sOffset, content.length - section.fOffset);\n return extract(elements, positions);\n });\n const mark = (matches, replacementNode) => {\n eachr(matches, (match, idx) => {\n eachr(match, pos => {\n const wrapper = SugarElement.fromDom(replacementNode.cloneNode(false));\n set(wrapper, 'data-mce-index', idx);\n const textNode = pos.element.dom;\n if (textNode.length === pos.finish && pos.start === 0) {\n wrap(pos.element, wrapper);\n } else {\n if (textNode.length !== pos.finish) {\n textNode.splitText(pos.finish);\n }\n const matchNode = textNode.splitText(pos.start);\n wrap(SugarElement.fromDom(matchNode), wrapper);\n }\n });\n });\n };\n const findAndMark = (dom, pattern, node, replacementNode) => {\n const textSections = fromNode(dom, node);\n const matches = find$1(pattern, textSections);\n mark(matches, replacementNode);\n return matches.length;\n };\n const findAndMarkInSelection = (dom, pattern, selection, replacementNode) => {\n const bookmark = selection.getBookmark();\n const nodes = dom.select('td[data-mce-selected],th[data-mce-selected]');\n const textSections = nodes.length > 0 ? fromNodes(dom, nodes) : fromRng(dom, selection.getRng());\n const matches = find$1(pattern, textSections);\n mark(matches, replacementNode);\n selection.moveToBookmark(bookmark);\n return matches.length;\n };\n\n const getElmIndex = elm => {\n return elm.getAttribute('data-mce-index');\n };\n const markAllMatches = (editor, currentSearchState, pattern, inSelection) => {\n const marker = editor.dom.create('span', { 'data-mce-bogus': 1 });\n marker.className = 'mce-match-marker';\n const node = editor.getBody();\n done(editor, currentSearchState, false);\n if (inSelection) {\n return findAndMarkInSelection(editor.dom, pattern, editor.selection, marker);\n } else {\n return findAndMark(editor.dom, pattern, node, marker);\n }\n };\n const unwrap = node => {\n var _a;\n const parentNode = node.parentNode;\n if (node.firstChild) {\n parentNode.insertBefore(node.firstChild, node);\n }\n (_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(node);\n };\n const findSpansByIndex = (editor, index) => {\n const spans = [];\n const nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));\n if (nodes.length) {\n for (let i = 0; i < nodes.length; i++) {\n const nodeIndex = getElmIndex(nodes[i]);\n if (nodeIndex === null || !nodeIndex.length) {\n continue;\n }\n if (nodeIndex === index.toString()) {\n spans.push(nodes[i]);\n }\n }\n }\n return spans;\n };\n const moveSelection = (editor, currentSearchState, forward) => {\n const searchState = currentSearchState.get();\n let testIndex = searchState.index;\n const dom = editor.dom;\n if (forward) {\n if (testIndex + 1 === searchState.count) {\n testIndex = 0;\n } else {\n testIndex++;\n }\n } else {\n if (testIndex - 1 === -1) {\n testIndex = searchState.count - 1;\n } else {\n testIndex--;\n }\n }\n dom.removeClass(findSpansByIndex(editor, searchState.index), 'mce-match-marker-selected');\n const spans = findSpansByIndex(editor, testIndex);\n if (spans.length) {\n dom.addClass(findSpansByIndex(editor, testIndex), 'mce-match-marker-selected');\n editor.selection.scrollIntoView(spans[0]);\n return testIndex;\n }\n return -1;\n };\n const removeNode = (dom, node) => {\n const parent = node.parentNode;\n dom.remove(node);\n if (parent && dom.isEmpty(parent)) {\n dom.remove(parent);\n }\n };\n const escapeSearchText = (text, wholeWord) => {\n const escapedText = text.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&').replace(/\\s/g, '[^\\\\S\\\\r\\\\n\\\\uFEFF]');\n const wordRegex = '(' + escapedText + ')';\n return wholeWord ? `(?:^|\\\\s|${ punctuation() })` + wordRegex + `(?=$|\\\\s|${ punctuation() })` : wordRegex;\n };\n const find = (editor, currentSearchState, text, matchCase, wholeWord, inSelection) => {\n const selection = editor.selection;\n const escapedText = escapeSearchText(text, wholeWord);\n const isForwardSelection = selection.isForward();\n const pattern = {\n regex: new RegExp(escapedText, matchCase ? 'g' : 'gi'),\n matchIndex: 1\n };\n const count = markAllMatches(editor, currentSearchState, pattern, inSelection);\n if (global$2.browser.isSafari()) {\n selection.setRng(selection.getRng(), isForwardSelection);\n }\n if (count) {\n const newIndex = moveSelection(editor, currentSearchState, true);\n currentSearchState.set({\n index: newIndex,\n count,\n text,\n matchCase,\n wholeWord,\n inSelection\n });\n }\n return count;\n };\n const next = (editor, currentSearchState) => {\n const index = moveSelection(editor, currentSearchState, true);\n currentSearchState.set({\n ...currentSearchState.get(),\n index\n });\n };\n const prev = (editor, currentSearchState) => {\n const index = moveSelection(editor, currentSearchState, false);\n currentSearchState.set({\n ...currentSearchState.get(),\n index\n });\n };\n const isMatchSpan = node => {\n const matchIndex = getElmIndex(node);\n return matchIndex !== null && matchIndex.length > 0;\n };\n const replace = (editor, currentSearchState, text, forward, all) => {\n const searchState = currentSearchState.get();\n const currentIndex = searchState.index;\n let currentMatchIndex, nextIndex = currentIndex;\n forward = forward !== false;\n const node = editor.getBody();\n const nodes = global$1.grep(global$1.toArray(node.getElementsByTagName('span')), isMatchSpan);\n for (let i = 0; i < nodes.length; i++) {\n const nodeIndex = getElmIndex(nodes[i]);\n let matchIndex = currentMatchIndex = parseInt(nodeIndex, 10);\n if (all || matchIndex === searchState.index) {\n if (text.length) {\n nodes[i].innerText = text;\n unwrap(nodes[i]);\n } else {\n removeNode(editor.dom, nodes[i]);\n }\n while (nodes[++i]) {\n matchIndex = parseInt(getElmIndex(nodes[i]), 10);\n if (matchIndex === currentMatchIndex) {\n removeNode(editor.dom, nodes[i]);\n } else {\n i--;\n break;\n }\n }\n if (forward) {\n nextIndex--;\n }\n } else if (currentMatchIndex > currentIndex) {\n nodes[i].setAttribute('data-mce-index', String(currentMatchIndex - 1));\n }\n }\n currentSearchState.set({\n ...searchState,\n count: all ? 0 : searchState.count - 1,\n index: nextIndex\n });\n if (forward) {\n next(editor, currentSearchState);\n } else {\n prev(editor, currentSearchState);\n }\n return !all && currentSearchState.get().count > 0;\n };\n const done = (editor, currentSearchState, keepEditorSelection) => {\n let startContainer;\n let endContainer;\n const searchState = currentSearchState.get();\n const nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));\n for (let i = 0; i < nodes.length; i++) {\n const nodeIndex = getElmIndex(nodes[i]);\n if (nodeIndex !== null && nodeIndex.length) {\n if (nodeIndex === searchState.index.toString()) {\n if (!startContainer) {\n startContainer = nodes[i].firstChild;\n }\n endContainer = nodes[i].firstChild;\n }\n unwrap(nodes[i]);\n }\n }\n currentSearchState.set({\n ...searchState,\n index: -1,\n count: 0,\n text: ''\n });\n if (startContainer && endContainer) {\n const rng = editor.dom.createRng();\n rng.setStart(startContainer, 0);\n rng.setEnd(endContainer, endContainer.data.length);\n if (keepEditorSelection !== false) {\n editor.selection.setRng(rng);\n }\n return rng;\n } else {\n return undefined;\n }\n };\n const hasNext = (editor, currentSearchState) => currentSearchState.get().count > 1;\n const hasPrev = (editor, currentSearchState) => currentSearchState.get().count > 1;\n\n const get = (editor, currentState) => {\n const done$1 = keepEditorSelection => {\n return done(editor, currentState, keepEditorSelection);\n };\n const find$1 = (text, matchCase, wholeWord, inSelection = false) => {\n return find(editor, currentState, text, matchCase, wholeWord, inSelection);\n };\n const next$1 = () => {\n return next(editor, currentState);\n };\n const prev$1 = () => {\n return prev(editor, currentState);\n };\n const replace$1 = (text, forward, all) => {\n return replace(editor, currentState, text, forward, all);\n };\n return {\n done: done$1,\n find: find$1,\n next: next$1,\n prev: prev$1,\n replace: replace$1\n };\n };\n\n const singleton = doRevoke => {\n const subject = Cell(Optional.none());\n const revoke = () => subject.get().each(doRevoke);\n const clear = () => {\n revoke();\n subject.set(Optional.none());\n };\n const isSet = () => subject.get().isSome();\n const get = () => subject.get();\n const set = s => {\n revoke();\n subject.set(Optional.some(s));\n };\n return {\n clear,\n isSet,\n get,\n set\n };\n };\n const value = () => {\n const subject = singleton(noop);\n const on = f => subject.get().each(f);\n return {\n ...subject,\n on\n };\n };\n\n const open = (editor, currentSearchState) => {\n const dialogApi = value();\n editor.undoManager.add();\n const selectedText = global$1.trim(editor.selection.getContent({ format: 'text' }));\n const updateButtonStates = api => {\n api.setEnabled('next', hasNext(editor, currentSearchState));\n api.setEnabled('prev', hasPrev(editor, currentSearchState));\n };\n const updateSearchState = api => {\n const data = api.getData();\n const current = currentSearchState.get();\n currentSearchState.set({\n ...current,\n matchCase: data.matchcase,\n wholeWord: data.wholewords,\n inSelection: data.inselection\n });\n };\n const disableAll = (api, disable) => {\n const buttons = [\n 'replace',\n 'replaceall',\n 'prev',\n 'next'\n ];\n const toggle = name => api.setEnabled(name, !disable);\n each(buttons, toggle);\n };\n const toggleNotFoundAlert = (isVisible, api) => {\n api.redial(getDialogSpec(isVisible, api.getData()));\n };\n const focusButtonIfRequired = (api, name) => {\n if (global$2.browser.isSafari() && global$2.deviceType.isTouch() && (name === 'find' || name === 'replace' || name === 'replaceall')) {\n api.focus(name);\n }\n };\n const reset = api => {\n done(editor, currentSearchState, false);\n disableAll(api, true);\n updateButtonStates(api);\n };\n const doFind = api => {\n const data = api.getData();\n const last = currentSearchState.get();\n if (!data.findtext.length) {\n reset(api);\n return;\n }\n if (last.text === data.findtext && last.matchCase === data.matchcase && last.wholeWord === data.wholewords) {\n next(editor, currentSearchState);\n } else {\n const count = find(editor, currentSearchState, data.findtext, data.matchcase, data.wholewords, data.inselection);\n if (count <= 0) {\n toggleNotFoundAlert(true, api);\n }\n disableAll(api, count === 0);\n }\n updateButtonStates(api);\n };\n const initialState = currentSearchState.get();\n const initialData = {\n findtext: selectedText,\n replacetext: '',\n wholewords: initialState.wholeWord,\n matchcase: initialState.matchCase,\n inselection: initialState.inSelection\n };\n const getPanelItems = error => {\n const items = [\n {\n type: 'bar',\n items: [\n {\n type: 'input',\n name: 'findtext',\n placeholder: 'Find',\n maximized: true,\n inputMode: 'search'\n },\n {\n type: 'button',\n name: 'prev',\n text: 'Previous',\n icon: 'action-prev',\n enabled: false,\n borderless: true\n },\n {\n type: 'button',\n name: 'next',\n text: 'Next',\n icon: 'action-next',\n enabled: false,\n borderless: true\n }\n ]\n },\n {\n type: 'input',\n name: 'replacetext',\n placeholder: 'Replace with',\n inputMode: 'search'\n }\n ];\n if (error) {\n items.push({\n type: 'alertbanner',\n level: 'error',\n text: 'Could not find the specified string.',\n icon: 'warning'\n });\n }\n return items;\n };\n const getDialogSpec = (showNoMatchesAlertBanner, initialData) => ({\n title: 'Find and Replace',\n size: 'normal',\n body: {\n type: 'panel',\n items: getPanelItems(showNoMatchesAlertBanner)\n },\n buttons: [\n {\n type: 'menu',\n name: 'options',\n icon: 'preferences',\n tooltip: 'Preferences',\n align: 'start',\n items: [\n {\n type: 'togglemenuitem',\n name: 'matchcase',\n text: 'Match case'\n },\n {\n type: 'togglemenuitem',\n name: 'wholewords',\n text: 'Find whole words only'\n },\n {\n type: 'togglemenuitem',\n name: 'inselection',\n text: 'Find in selection'\n }\n ]\n },\n {\n type: 'custom',\n name: 'find',\n text: 'Find',\n primary: true\n },\n {\n type: 'custom',\n name: 'replace',\n text: 'Replace',\n enabled: false\n },\n {\n type: 'custom',\n name: 'replaceall',\n text: 'Replace all',\n enabled: false\n }\n ],\n initialData,\n onChange: (api, details) => {\n if (showNoMatchesAlertBanner) {\n toggleNotFoundAlert(false, api);\n }\n if (details.name === 'findtext' && currentSearchState.get().count > 0) {\n reset(api);\n }\n },\n onAction: (api, details) => {\n const data = api.getData();\n switch (details.name) {\n case 'find':\n doFind(api);\n break;\n case 'replace':\n if (!replace(editor, currentSearchState, data.replacetext)) {\n reset(api);\n } else {\n updateButtonStates(api);\n }\n break;\n case 'replaceall':\n replace(editor, currentSearchState, data.replacetext, true, true);\n reset(api);\n break;\n case 'prev':\n prev(editor, currentSearchState);\n updateButtonStates(api);\n break;\n case 'next':\n next(editor, currentSearchState);\n updateButtonStates(api);\n break;\n case 'matchcase':\n case 'wholewords':\n case 'inselection':\n toggleNotFoundAlert(false, api);\n updateSearchState(api);\n reset(api);\n break;\n }\n focusButtonIfRequired(api, details.name);\n },\n onSubmit: api => {\n doFind(api);\n focusButtonIfRequired(api, 'find');\n },\n onClose: () => {\n editor.focus();\n done(editor, currentSearchState);\n editor.undoManager.add();\n }\n });\n dialogApi.set(editor.windowManager.open(getDialogSpec(false, initialData), { inline: 'toolbar' }));\n };\n\n const register$1 = (editor, currentSearchState) => {\n editor.addCommand('SearchReplace', () => {\n open(editor, currentSearchState);\n });\n };\n\n const showDialog = (editor, currentSearchState) => () => {\n open(editor, currentSearchState);\n };\n const register = (editor, currentSearchState) => {\n editor.ui.registry.addMenuItem('searchreplace', {\n text: 'Find and replace...',\n shortcut: 'Meta+F',\n onAction: showDialog(editor, currentSearchState),\n icon: 'search'\n });\n editor.ui.registry.addButton('searchreplace', {\n tooltip: 'Find and replace',\n onAction: showDialog(editor, currentSearchState),\n icon: 'search'\n });\n editor.shortcuts.add('Meta+F', '', showDialog(editor, currentSearchState));\n };\n\n var Plugin = () => {\n global$3.add('searchreplace', editor => {\n const currentSearchState = Cell({\n index: -1,\n count: 0,\n text: '',\n matchCase: false,\n wholeWord: false,\n inSelection: false\n });\n register$1(editor, currentSearchState);\n register(editor, currentSearchState);\n return get(editor, currentSearchState);\n });\n };\n\n Plugin();\n\n})();\n"],"names":["Cell","initial","value","get","set","v","global$3","tinymce","util","Tools","resolve","isType$1","type","x","t","Array","isArray","o","proto","constructor","String","prototype","isPrototypeOf","_a","name","typeOf","isSimpleType","isString","isBoolean","isNumber","noop","constant","always","punctuation$1","Optional","tag","this","some","none","singletonNone","fold","onNone","onSome","isSome","isNone","map","mapper","bind","binder","exists","predicate","forall","filter","getOr","replacement","or","getOrThunk","thunk","orThunk","getOrDie","message","Error","from","a","isNullable","getOrNull","getOrUndefined","each","worker","toArray","toString","punctuation","global$2","global$1","nativeSlice","slice","nativePush","push","xs","f","len","length","r","i","eachr","apply","flatten","hasOwnProperty","Object","has","obj","key","call","window","Function","isText$1","element","dom","nodeType","console","error","setAttribute","rawSet","fromDom","node","SugarElement","fromHtml","html","scope","div","document","createElement","innerHTML","hasChildNodes","childNodes","fromTag","fromText","text","createTextNode","fromPoint","docElm","y","elementFromPoint","spot","offset","leaf","cs","children","before","marker","parent$1","parentNode","parent","insertBefore","wrap","wrapper","appendChild","append","api","is","getOption","nodeValue","NodeValue","get$1","descendants","selector","base","undefined","childElementCount","querySelectorAll","all","global","isSimpleBoundary","isBlock","schema","getVoidElements","nodeName","isContentEditableFalse","isEditable","isHidden","getWhitespaceElements","toLeaf","walk","walkerFn","startNode","callbacks","endNode","skipStart","next","isCefNode","cef","boundary","collectTextToBoundary","section","rootNode","forwards","getContentEditable","isContentEditableTrueInCef","isBoundary","rootBlock","getParent","getRoot","walker","prev","fOffset","sOffset","elements","collect","sections","current","finishSection","collectRangeSections","rng","start","startContainer","startOffset","end","endContainer","endOffset","commonAncestorContainer","comparator","copy","sort","e","ceTrueNode","b","match","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","documentPositionPreceding","fromRng","collapsed","fromNode","createRng","selectNode","extract","matches","nodePositions","acc","content","last","finish","positions","matchIdx","Math","max","min","matchId","results","concat","wasType","group","groupBy","position","find$1","pattern","join","regex","lastIndex","exec","matchedText","matchIndex","matchStart","index","indexOf","matchFinish","find$2","mark","replacementNode","idx","pos","cloneNode","textNode","splitText","matchNode","findAndMarkInSelection","selection","bookmark","getBookmark","nodes","select","textSections","fromNodes","getRng","moveToBookmark","getElmIndex","elm","getAttribute","markAllMatches","editor","currentSearchState","inSelection","create","className","getBody","done","findAndMark","unwrap","firstChild","removeChild","findSpansByIndex","spans","getElementsByTagName","nodeIndex","moveSelection","forward","searchState","testIndex","count","removeClass","addClass","scrollIntoView","removeNode","remove","isEmpty","find","matchCase","wholeWord","escapedText","wordRegex","replace","escapeSearchText","isForwardSelection","isForward","RegExp","browser","isSafari","setRng","newIndex","isMatchSpan","currentIndex","currentMatchIndex","nextIndex","grep","parseInt","innerText","keepEditorSelection","setStart","setEnd","data","subject","doRevoke","revoke","clear","isSet","s","singleton","on","open","dialogApi","undoManager","add","selectedText","trim","getContent","format","updateButtonStates","setEnabled","hasNext","hasPrev","disableAll","disable","toggleNotFoundAlert","isVisible","redial","getDialogSpec","getData","focusButtonIfRequired","deviceType","isTouch","focus","reset","doFind","findtext","matchcase","wholewords","inselection","initialState","initialData","replacetext","getPanelItems","items","placeholder","maximized","inputMode","icon","enabled","borderless","level","showNoMatchesAlertBanner","title","size","body","buttons","tooltip","align","primary","onChange","details","onAction","updateSearchState","onSubmit","onClose","windowManager","inline","showDialog","addCommand","register$1","ui","registry","addMenuItem","shortcut","addButton","shortcuts","register","currentState"],"mappings":"gGAIA,WAGI,MAAMA,EAAOC,IACX,IAAIC,EAAQD,EAOZ,MAAO,CACLE,IAPU,IACHD,EAOPE,IALUC,IACVH,EAAQG,CAAC,EAKV,EAGH,IAAIC,EAAWC,QAAQC,KAAKC,MAAMC,QAAQ,yBAE1C,MAoBMC,EAAWC,GAAQV,GAZVW,KACb,MAAMC,SAA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