@lotte-innovate/ui-component-test 0.0.113 → 0.0.114
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/_virtual/index.mjs +1 -1
- package/dist/lib/_virtual/index11.mjs +1 -1
- package/dist/lib/_virtual/index13.mjs +1 -1
- package/dist/lib/_virtual/index3.mjs +1 -1
- package/dist/lib/lib/components/Editor/index.mjs +1 -1
- package/dist/lib/public/tinymce/icons/default/icons.mjs +2 -1
- package/dist/lib/public/tinymce/icons/default/icons.mjs.map +1 -1
- package/dist/lib/public/tinymce/models/dom/index.mjs +1 -1
- package/dist/lib/public/tinymce/plugins/advlist/plugin.mjs +1 -1
- package/dist/lib/public/tinymce/plugins/code/index.mjs +1 -1
- package/dist/lib/public/tinymce/plugins/code/index.mjs.map +1 -1
- package/dist/lib/public/tinymce/plugins/code/plugin.mjs +1 -1
- package/dist/lib/public/tinymce/plugins/code/plugin.mjs.map +1 -1
- package/dist/lib/public/tinymce/plugins/link/index.mjs +1 -1
- package/dist/lib/public/tinymce/plugins/link/plugin.mjs +1 -1
- package/dist/lib/public/tinymce/plugins/link/plugin.mjs.map +1 -1
- package/dist/lib/public/tinymce/plugins/lists/plugin.mjs +1 -1
- package/dist/lib/public/tinymce/plugins/table/plugin.mjs +1 -1
- package/dist/lib/public/tinymce/themes/silver/index.mjs +1 -1
- package/dist/public/tinymce/icons/default/index.js +1 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -2
- package/dist/lib/_virtual/icons.mjs +0 -2
- package/dist/lib/_virtual/icons.mjs.map +0 -1
- package/dist/lib/_virtual/index15.mjs +0 -2
- package/dist/lib/_virtual/index15.mjs.map +0 -1
- package/dist/lib/_virtual/index16.mjs +0 -2
- package/dist/lib/_virtual/index16.mjs.map +0 -1
- package/dist/lib/public/tinymce/icons/default/index.mjs +0 -2
- package/dist/lib/public/tinymce/icons/default/index.mjs.map +0 -1
- package/public/tinymce/CHANGELOG.md +0 -3453
- package/public/tinymce/README.md +0 -73
- package/public/tinymce/bower.json +0 -27
- package/public/tinymce/composer.json +0 -52
- package/public/tinymce/icons/default/icons.js +0 -194
- package/public/tinymce/icons/default/icons.min.js +0 -1
- package/public/tinymce/icons/default/index.js +0 -7
- package/public/tinymce/license.txt +0 -21
- package/public/tinymce/models/dom/index.js +0 -7
- package/public/tinymce/models/dom/model.js +0 -8040
- package/public/tinymce/models/dom/model.min.js +0 -4
- package/public/tinymce/package.json +0 -32
- package/public/tinymce/plugins/advlist/index.js +0 -7
- package/public/tinymce/plugins/advlist/plugin.js +0 -259
- package/public/tinymce/plugins/advlist/plugin.min.js +0 -4
- package/public/tinymce/plugins/autolink/index.js +0 -7
- package/public/tinymce/plugins/autolink/plugin.js +0 -228
- package/public/tinymce/plugins/autolink/plugin.min.js +0 -4
- package/public/tinymce/plugins/code/index.js +0 -7
- package/public/tinymce/plugins/code/plugin.js +0 -85
- package/public/tinymce/plugins/code/plugin.min.js +0 -4
- package/public/tinymce/plugins/codesample/index.js +0 -7
- package/public/tinymce/plugins/codesample/plugin.js +0 -2463
- package/public/tinymce/plugins/codesample/plugin.min.js +0 -4
- package/public/tinymce/plugins/image/index.js +0 -7
- package/public/tinymce/plugins/image/plugin.js +0 -1505
- package/public/tinymce/plugins/image/plugin.min.js +0 -4
- package/public/tinymce/plugins/link/index.js +0 -7
- package/public/tinymce/plugins/link/plugin.js +0 -1242
- package/public/tinymce/plugins/link/plugin.min.js +0 -4
- package/public/tinymce/plugins/lists/index.js +0 -7
- package/public/tinymce/plugins/lists/plugin.js +0 -2172
- package/public/tinymce/plugins/lists/plugin.min.js +0 -4
- package/public/tinymce/plugins/table/index.js +0 -7
- package/public/tinymce/plugins/table/plugin.js +0 -3462
- package/public/tinymce/plugins/table/plugin.min.js +0 -4
- package/public/tinymce/skins/content/default/content.css +0 -61
- package/public/tinymce/skins/content/default/content.js +0 -2
- package/public/tinymce/skins/content/default/content.min.css +0 -1
- package/public/tinymce/skins/ui/oxide/content.css +0 -785
- package/public/tinymce/skins/ui/oxide/content.inline.css +0 -779
- package/public/tinymce/skins/ui/oxide/content.inline.js +0 -2
- package/public/tinymce/skins/ui/oxide/content.inline.min.css +0 -1
- package/public/tinymce/skins/ui/oxide/content.js +0 -2
- package/public/tinymce/skins/ui/oxide/content.min.css +0 -1
- package/public/tinymce/skins/ui/oxide/skin.css +0 -3763
- package/public/tinymce/skins/ui/oxide/skin.js +0 -2
- package/public/tinymce/skins/ui/oxide/skin.min.css +0 -1
- package/public/tinymce/skins/ui/oxide/skin.shadowdom.css +0 -30
- package/public/tinymce/skins/ui/oxide/skin.shadowdom.js +0 -2
- package/public/tinymce/skins/ui/oxide/skin.shadowdom.min.css +0 -1
- package/public/tinymce/skins/ui/oxide-dark/content.css +0 -766
- package/public/tinymce/skins/ui/oxide-dark/content.inline.css +0 -779
- package/public/tinymce/skins/ui/oxide-dark/content.inline.js +0 -2
- package/public/tinymce/skins/ui/oxide-dark/content.inline.min.css +0 -1
- package/public/tinymce/skins/ui/oxide-dark/content.js +0 -2
- package/public/tinymce/skins/ui/oxide-dark/content.min.css +0 -1
- package/public/tinymce/skins/ui/oxide-dark/skin.css +0 -3766
- package/public/tinymce/skins/ui/oxide-dark/skin.js +0 -2
- package/public/tinymce/skins/ui/oxide-dark/skin.min.css +0 -1
- package/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +0 -30
- package/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +0 -2
- package/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +0 -1
- package/public/tinymce/themes/silver/index.js +0 -7
- package/public/tinymce/themes/silver/theme.js +0 -30775
- package/public/tinymce/themes/silver/theme.min.js +0 -384
- package/public/tinymce/tinymce.d.ts +0 -3238
- package/public/tinymce/tinymce.js +0 -31779
- package/public/tinymce/tinymce.min.js +0 -384
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__exports as t}from"../../../../_virtual/plugin.mjs";var n;function e(){if(n)return t;n=1;var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},e.apply(this,arguments)};return function(){var t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(n){return u=typeof(e=n),(null===e?"null":"object"===u&&Array.isArray(e)?"array":"object"===u&&(a=r=e,(o=String).prototype.isPrototypeOf(a)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===o.name)?"string":u)===t;var e,r,o,i,u,a}},o=function(t){return function(n){return typeof n===t}},i=r("string"),u=r("object"),a=r("array"),l=(t=null,function(n){return t===n}),c=o("boolean"),f=function(t){return!function(t){return null==t}(t)},s=o("function"),g=function(t,n){if(a(t)){for(var e=0,r=t.length;e<r;++e)if(!n(t[e]))return!1;return!0}return!1},d=function(){},m=function(t,n){return t===n},h=function(){function t(t,n){this.tag=t,this.value=n}return t.some=function(n){return new t(!0,n)},t.none=function(){return t.singletonNone},t.prototype.fold=function(t,n){return this.tag?n(this.value):t()},t.prototype.isSome=function(){return this.tag},t.prototype.isNone=function(){return!this.tag},t.prototype.map=function(n){return this.tag?t.some(n(this.value)):t.none()},t.prototype.bind=function(n){return this.tag?n(this.value):t.none()},t.prototype.exists=function(t){return this.tag&&t(this.value)},t.prototype.forall=function(t){return!this.tag||t(this.value)},t.prototype.filter=function(n){return!this.tag||n(this.value)?this:t.none()},t.prototype.getOr=function(t){return this.tag?this.value:t},t.prototype.or=function(t){return this.tag?this:t},t.prototype.getOrThunk=function(t){return this.tag?this.value:t()},t.prototype.orThunk=function(t){return this.tag?this:t()},t.prototype.getOrDie=function(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")},t.from=function(n){return f(n)?t.some(n):t.none()},t.prototype.getOrNull=function(){return this.tag?this.value:null},t.prototype.getOrUndefined=function(){return this.value},t.prototype.each=function(t){this.tag&&t(this.value)},t.prototype.toArray=function(){return this.tag?[this.value]:[]},t.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},t}();h.singletonNone=new h(!1);var p=Array.prototype.indexOf,v=Array.prototype.push,k=function(t,n){return function(t,n){return p.call(t,n)}(t,n)>-1},y=function(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!a(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);v.apply(n,t[e])}return n},x=function(t,n){return y(function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r}(t,n))},b=function(t,n){for(var e=0;e<t.length;e++){var r=n(t[e],e);if(r.isSome())return r}return h.none()},_=function(t,n,e){return void 0===e&&(e=m),t.exists((function(t){return e(t,n)}))},w=function(t){for(var n=[],e=function(t){n.push(t)},r=0;r<t.length;r++)t[r].each(e);return n},O=function(t,n){return t?h.some(n):h.none()},C=function(t){return function(n){return n.options.get(t)}},N=C("link_assume_external_targets"),A=C("link_context_toolbar"),S=C("link_list"),E=C("link_default_target"),T=C("link_default_protocol"),P=C("link_target_list"),R=C("link_rel_list"),L=C("link_class_list"),M=C("link_title"),D=C("allow_unsafe_link_target"),U=C("link_quicklink"),j=tinymce.util.Tools.resolve("tinymce.util.Tools"),B=function(t){return i(t.value)?t.value:""},I=function(t,n){var e=[];return j.each(t,(function(t){var r=function(t){return i(t.text)?t.text:i(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=I(t.menu,n);e.push({text:r,items:o})}else{var u=n(t);e.push({text:r,value:u})}})),e},K=function(t){return void 0===t&&(t=B),function(n){return h.from(n).map((function(n){return I(n,t)}))}},z={sanitize:function(t){return K(B)(t)},sanitizeWith:K,createUi:function(t,n){return function(e){return{name:t,type:"listbox",label:n,items:e}}},getValue:B},q=Object.keys,V=Object.hasOwnProperty,F=function(t,n,e,r){!function(t,n){for(var e=q(t),r=0,o=e.length;r<o;r++){var i=e[r];n(t[i],i)}}(t,(function(t,o){(n(t,o)?e:r)(t,o)}))},W=function(t,n){return V.call(t,n)},G=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),H=tinymce.util.Tools.resolve("tinymce.util.URI"),J=function(t){return f(t)&&"a"===t.nodeName.toLowerCase()},Q=function(t){return J(t)&&!!Z(t)},X=function(t,n){if(t.collapsed)return[];var e=t.cloneContents(),r=e.firstChild,o=new G(r,e),i=[],u=r;do{n(u)&&i.push(u)}while(u=o.next());return i},Y=function(t){return/^\w+:/i.test(t)},Z=function(t){var n,e;return null!==(e=null!==(n=t.getAttribute("data-mce-href"))&&void 0!==n?n:t.getAttribute("href"))&&void 0!==e?e:""},$=function(t,n){var e=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===j.inArray(e,t)}))},i=n?function(t){return(t=o(t)).length>0?t.concat(e):e}(r):o(r);return i.length>0?function(t){return j.trim(t.sort().join(" "))}(i):""},tt=function(t,n){return n=n||rt(t.selection.getRng())[0]||t.selection.getNode(),at(n)?h.from(t.dom.select("a[href]",n)[0]):h.from(t.dom.getParent(n,"a[href]"))},nt=function(t,n){return tt(t,n).isSome()},et=function(t,n){return function(t){return t.replace(/\uFEFF/g,"")}(n.fold((function(){return t.getContent({format:"text"})}),(function(t){return t.innerText||t.textContent||""})))},rt=function(t){return X(t,Q)},ot=function(t){return j.grep(t,Q)},it=function(t){return ot(t).length>0},ut=function(t){var n=t.schema.getTextInlineElements();if(tt(t).exists((function(t){return t.hasAttribute("data-mce-block")})))return!1;var e=t.selection.getRng();return!!e.collapsed||0===X(e,(function(t){return 1===t.nodeType&&!J(t)&&!W(n,t.nodeName.toLowerCase())})).length},at=function(t){return f(t)&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},lt=function(t,n){var r=e({},n);if(0===R(t).length&&!D(t)){var o=$(r.rel,"_blank"===r.target);r.rel=o||null}return h.from(r.target).isNone()&&!1===P(t)&&(r.target=E(t)),r.href=function(t,n){return"http"!==n&&"https"!==n||Y(t)?t:n+"://"+t}(r.href,N(t)),r},ct=function(t,n,e){var r=t.selection.getNode(),o=tt(t,r),i=lt(t,function(t){var n,e,r;return n=["title","rel","class","target"],e=function(n,e){return t[e].each((function(t){n[e]=t.length>0?t:null})),n},r={href:t.href},function(t,n){for(var e=0,r=t.length;e<r;e++)n(t[e],e)}(n,(function(t,n){r=e(r,t,n)})),r}(e));t.undoManager.transact((function(){e.href===n.href&&n.attach(),o.fold((function(){!function(t,n,e,r){var o=t.dom;at(n)?mt(o,n,r):e.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(n){t.insertContent(o.createHTML("a",r,o.encode(n)))}))}(t,r,e.text,i)}),(function(n){t.focus(),function(t,n,e,r){e.each((function(t){W(n,"innerText")?n.innerText=t:n.textContent=t})),t.dom.setAttribs(n,r),t.selection.select(n)}(t,n,e.text,i)}))}))},ft=function(t){var n=t.class,e=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return function(t,n){var e,r={};return F(t,n,(e=r,function(t,n){e[n]=t}),d),r}({class:n.getOrNull(),href:e,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()},(function(t,n){return!1===l(t)}))},st=function(t,n,r){var o=function(t,n){var r=t.options.get,o={allow_html_data_urls:r("allow_html_data_urls"),allow_script_urls:r("allow_script_urls"),allow_svg_data_urls:r("allow_svg_data_urls")},i=n.href;return e(e({},n),{href:H.isDomSafe(i,"a",o)?i:""})}(t,r);t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,ft(o)):ct(t,n,o)},gt=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var n=t.selection.getNode();at(n)?dt(t,n):function(t){var n=t.dom,e=t.selection,r=e.getBookmark(),o=e.getRng().cloneRange(),i=n.getParent(o.startContainer,"a[href]",t.getBody()),u=n.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),e.setRng(o),t.execCommand("unlink"),e.moveToBookmark(r)}(t),t.focus()}))}(t)},dt=function(t,n){var e,r=t.dom.select("img",n)[0];if(r){var o=t.dom.getParents(r,"a[href]",n)[0];o&&(null===(e=o.parentNode)||void 0===e||e.insertBefore(r,o),t.dom.remove(o))}},mt=function(t,n,e){var r,o=t.select("img",n)[0];if(o){var i=t.create("a",e);null===(r=o.parentNode)||void 0===r||r.insertBefore(i,o),i.appendChild(o)}},ht=function(t){return W(n=t,e="items")&&void 0!==n[e]&&null!==n[e];var n,e},pt=function(t,n){return b(n,(function(n){return ht(n)?pt(t,n.items):O(n.value===t,n)}))},vt=function(t,n,e,r){var o=r[n],i=t.length>0;return void 0!==o?pt(o,e).map((function(n){return{url:{value:n.value,meta:{text:i?t:n.text,attach:d}},text:i?t:n.text}})):h.none()},kt=function(t,n){var r={text:t.text,title:t.title},o=function(t){var n,o,i=(n=t.url,O(r.text.length<=0,h.from(null===(o=n.meta)||void 0===o?void 0:o.text).getOr(n.value))),u=function(t){var n;return O(r.title.length<=0,h.from(null===(n=t.meta)||void 0===n?void 0:n.title).getOr(""))}(t.url);return i.isSome()||u.isSome()?h.some(e(e({},i.map((function(t){return{text:t}})).getOr({})),u.map((function(t){return{title:t}})).getOr({}))):h.none()},i=function(t,e){var o,i,u=(o=n,i=e,"link"===i?o.link:"anchor"===i?o.anchor:h.none()).getOr([]);return vt(r.text,e,u,t)};return{onChange:function(t,n){var e=n.name;return"url"===e?o(t()):k(["anchor","link"],e)?i(t(),e):"text"===e||"title"===e?(r[e]=t()[e],h.none()):h.none()}}},yt=tinymce.util.Tools.resolve("tinymce.util.Delay"),xt=function(t){var n=t.href;return n.indexOf("@")>0&&-1===n.indexOf("/")&&-1===n.indexOf("mailto:")?h.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return e(e({},t),{href:"mailto:"+n})}}):h.none()},bt=function(t,n){return function(r){var o=r.href;return 1===t&&!Y(o)||0===t&&/^\s*www(\.|\d\.)/i.test(o)?h.some({message:"The URL you entered seems to be an external link. Do you want to add the required ".concat(n,":// prefix?"),preprocess:function(t){return e(e({},t),{href:n+"://"+o})}}):h.none()}},_t=function(t,n){return b([xt,bt(N(t),T(t))],(function(t){return t(n)})).fold((function(){return Promise.resolve(n)}),(function(e){return new Promise((function(r){!function(t,n,e){var r=t.selection.getRng();yt.setEditorTimeout(t,(function(){t.windowManager.confirm(n,(function(n){t.selection.setRng(r),e(n)}))}))}(t,e.message,(function(t){r(t?e.preprocess(n):n)}))}))}))},wt=function(t){var n=t.dom.select("a:not([href])"),e=x(n,(function(t){var n=t.name||t.id;return n?[{text:n,value:"#"+n}]:[]}));return e.length>0?h.some([{text:"None",value:""}].concat(e)):h.none()},Ot=function(t){var n=L(t);return n.length>0?z.sanitize(n):h.none()},Ct=function(t){try{return h.some(JSON.parse(t))}catch(t){return h.none()}},Nt=function(t){var n=function(n){return t.convertURL(n.value||n.url||"","href")},e=S(t);return new Promise((function(t){i(e)?fetch(e).then((function(t){return t.ok?t.text().then(Ct):Promise.reject()})).then(t,(function(){return t(h.none())})):s(e)?e((function(n){return t(h.some(n))})):t(h.from(e))})).then((function(t){return t.bind(z.sanitizeWith(n)).map((function(t){if(t.length>0){return[{text:"None",value:""}].concat(t)}return t}))}))},At=function(t,n){var e=R(t);if(e.length>0){var r=_(n,"_blank");return(!1===D(t)?z.sanitizeWith((function(t){return $(z.getValue(t),r)})):z.sanitize)(e)}return h.none()},St=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Et=function(t){var n=P(t);return a(n)?z.sanitize(n).orThunk((function(){return h.some(St)})):!1===n?h.none():h.some(St)},Tt=function(t,n,e){var r=t.getAttrib(n,e);return null!==r&&r.length>0?h.some(r):h.none()},Pt=function(t,n){return Nt(t).then((function(e){var r=function(t,n){var e=t.dom,r=ut(t)?h.some(et(t.selection,n)):h.none(),o=n.bind((function(t){return h.from(e.getAttrib(t,"href"))})),i=n.bind((function(t){return h.from(e.getAttrib(t,"target"))})),u=n.bind((function(t){return Tt(e,t,"rel")})),a=n.bind((function(t){return Tt(e,t,"class")}));return{url:o,text:r,title:n.bind((function(t){return Tt(e,t,"title")})),target:i,rel:u,linkClass:a}}(t,n);return{anchor:r,catalogs:{targets:Et(t),rels:At(t,r.target),classes:Ot(t),anchor:wt(t),link:e},optNode:n,flags:{titleEnabled:M(t)}}}))},Rt=function(t){var n=function(t){var n=tt(t);return Pt(t,n)}(t);n.then((function(n){var e=function(t,n){return function(e){var r=e.getData();if(!r.url.value)return gt(t),void e.close();var o=function(t){return h.from(r[t]).filter((function(e){return!_(n.anchor[t],e)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:d};_t(t,i).then((function(n){st(t,u,n)})),e.close()}}(t,n);return function(t,n,e){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,n){var e=t.anchor,r=e.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:e.text.getOr(""),title:e.title.getOr(""),anchor:r,link:r,rel:e.rel.getOr(""),target:e.target.or(n).getOr(""),linkClass:e.linkClass.getOr("")}}(t,h.from(E(e))),u=t.catalogs,a=kt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:y([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],r,o,w([u.anchor.map(z.createUi("anchor","Anchors")),u.rels.map(z.createUi("rel","Rel")),u.targets.map(z.createUi("target","Open link in...")),u.link.map(z.createUi("link","Link list")),u.classes.map(z.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,n){var e=n.name;a.onChange(t.getData,{name:e}).each((function(n){t.setData(n)}))},onSubmit:n}}(n,e,t)})).then((function(n){t.windowManager.open(n)}))},Lt=tinymce.util.Tools.resolve("tinymce.util.VK"),Mt=function(t){var n=document.createElement("a");n.target="_blank",n.href=t,n.rel="noreferrer noopener";var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,n){document.body.appendChild(t),t.dispatchEvent(n),document.body.removeChild(t)}(n,e)},Dt=function(t,n){return t.dom.getParent(n,"a[href]")},Ut=function(t){return Dt(t,t.selection.getStart())},jt=function(t,n){if(n){var e=Z(n);if(/^#/.test(e)){var r=t.dom.select(e);r.length&&t.selection.scrollIntoView(r[0],!0)}else Mt(n.href)}},Bt=function(t){return function(){t.execCommand("mceLink",!1,{dialog:!0})}},It=function(t){return function(){jt(t,Ut(t))}},Kt=function(t,n){return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},zt=function(t){return function(n){var e=function(){n.setActive(!t.mode.isReadOnly()&&nt(t,t.selection.getNode())),n.setEnabled(t.selection.isEditable())};return e(),Kt(t,e)}},qt=function(t){return function(n){var e=function(){n.setEnabled(t.selection.isEditable())};return e(),Kt(t,e)}},Vt=function(t){return function(n){var e=function(){return n.setEnabled(function(t){return 1===(t.selection.isCollapsed()?ot(t.dom.getParents(t.selection.getStart())):rt(t.selection.getRng())).length}(t))};return e(),Kt(t,e)}},Ft=function(t){return function(n){var e=function(n){return it(n)||(e=t.selection.getRng(),rt(e).length>0);var e},r=t.dom.getParents(t.selection.getStart()),o=function(r){n.setEnabled(e(r)&&t.selection.isEditable())};return o(r),Kt(t,(function(t){return o(t.parents)}))}},Wt=function(t){var n=function(n){var e=t.selection.getNode();return n.setEnabled(nt(t,e)),d};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:zt(t)},label:"Link",predicate:function(n){return A(t)&&nt(t,n)},initValue:function(){var n;return tt(t).fold((n="",function(){return n}),Z)},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(n){var e=t.selection.getNode();return n.setActive(nt(t,e)),zt(t)(n)},onAction:function(n){var e=n.getValue(),r=function(n){var e=tt(t),r=ut(t);if(e.isNone()&&r){var o=et(t.selection,e);return O(0===o.length,n)}return h.none()}(e);st(t,{href:e,attach:d},{href:e,text:r,title:h.none(),rel:h.none(),target:h.none(),class:h.none()}),function(t){t.selection.collapse(!1)}(t),n.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:function(n){gt(t),n.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:function(n){It(t)(),n.hide()}}]})};n.add("link",(function(t){!function(t){var n=t.options.register;n("link_assume_external_targets",{processor:function(t){var n=i(t)||c(t);return n?!0===t?{value:1,valid:n}:"http"===t||"https"===t?{value:t,valid:n}:{value:0,valid:n}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),n("link_context_toolbar",{processor:"boolean",default:!1}),n("link_list",{processor:function(t){return i(t)||s(t)||g(t,u)}}),n("link_default_target",{processor:"string"}),n("link_default_protocol",{processor:"string",default:"https"}),n("link_target_list",{processor:function(t){return c(t)||g(t,u)},default:!0}),n("link_rel_list",{processor:"object[]",default:[]}),n("link_class_list",{processor:"object[]",default:[]}),n("link_title",{processor:"boolean",default:!0}),n("allow_unsafe_link_target",{processor:"boolean",default:!1}),n("link_quicklink",{processor:"boolean",default:!1})}(t),function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Bt(t),onSetup:zt(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return gt(t)},onSetup:Ft(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onSetup:qt(t),onAction:Bt(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return gt(t)},onSetup:Ft(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(n){return t.dom.isEditable(n)?it(t.dom.getParents(n,"a"))?"link unlink openlink":"link":""}})}(t),Wt(t),function(t){t.on("click",(function(n){var e=Dt(t,n.target);e&&Lt.metaKeyPressed(n)&&(n.preventDefault(),jt(t,e))})),t.on("keydown",(function(n){if(!n.isDefaultPrevented()&&13===n.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(n)){var e=Ut(t);e&&(n.preventDefault(),jt(t,e))}}))}(t),function(t){t.addCommand("mceLink",(function(n,e){!0!==(null==e?void 0:e.dialog)&&U(t)?t.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Rt(t)}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}(),t}export{e as __require};
|
1
|
+
import{__exports as t}from"../../../../_virtual/plugin2.mjs";var n;function e(){if(n)return t;n=1;var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},e.apply(this,arguments)};return function(){var t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(n){return u=typeof(e=n),(null===e?"null":"object"===u&&Array.isArray(e)?"array":"object"===u&&(a=r=e,(o=String).prototype.isPrototypeOf(a)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===o.name)?"string":u)===t;var e,r,o,i,u,a}},o=function(t){return function(n){return typeof n===t}},i=r("string"),u=r("object"),a=r("array"),l=(t=null,function(n){return t===n}),c=o("boolean"),f=function(t){return!function(t){return null==t}(t)},s=o("function"),g=function(t,n){if(a(t)){for(var e=0,r=t.length;e<r;++e)if(!n(t[e]))return!1;return!0}return!1},d=function(){},m=function(t,n){return t===n},h=function(){function t(t,n){this.tag=t,this.value=n}return t.some=function(n){return new t(!0,n)},t.none=function(){return t.singletonNone},t.prototype.fold=function(t,n){return this.tag?n(this.value):t()},t.prototype.isSome=function(){return this.tag},t.prototype.isNone=function(){return!this.tag},t.prototype.map=function(n){return this.tag?t.some(n(this.value)):t.none()},t.prototype.bind=function(n){return this.tag?n(this.value):t.none()},t.prototype.exists=function(t){return this.tag&&t(this.value)},t.prototype.forall=function(t){return!this.tag||t(this.value)},t.prototype.filter=function(n){return!this.tag||n(this.value)?this:t.none()},t.prototype.getOr=function(t){return this.tag?this.value:t},t.prototype.or=function(t){return this.tag?this:t},t.prototype.getOrThunk=function(t){return this.tag?this.value:t()},t.prototype.orThunk=function(t){return this.tag?this:t()},t.prototype.getOrDie=function(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")},t.from=function(n){return f(n)?t.some(n):t.none()},t.prototype.getOrNull=function(){return this.tag?this.value:null},t.prototype.getOrUndefined=function(){return this.value},t.prototype.each=function(t){this.tag&&t(this.value)},t.prototype.toArray=function(){return this.tag?[this.value]:[]},t.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},t}();h.singletonNone=new h(!1);var p=Array.prototype.indexOf,v=Array.prototype.push,k=function(t,n){return function(t,n){return p.call(t,n)}(t,n)>-1},y=function(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!a(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);v.apply(n,t[e])}return n},x=function(t,n){return y(function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r}(t,n))},b=function(t,n){for(var e=0;e<t.length;e++){var r=n(t[e],e);if(r.isSome())return r}return h.none()},_=function(t,n,e){return void 0===e&&(e=m),t.exists((function(t){return e(t,n)}))},w=function(t){for(var n=[],e=function(t){n.push(t)},r=0;r<t.length;r++)t[r].each(e);return n},O=function(t,n){return t?h.some(n):h.none()},C=function(t){return function(n){return n.options.get(t)}},N=C("link_assume_external_targets"),A=C("link_context_toolbar"),S=C("link_list"),E=C("link_default_target"),T=C("link_default_protocol"),P=C("link_target_list"),R=C("link_rel_list"),L=C("link_class_list"),M=C("link_title"),D=C("allow_unsafe_link_target"),U=C("link_quicklink"),j=tinymce.util.Tools.resolve("tinymce.util.Tools"),B=function(t){return i(t.value)?t.value:""},I=function(t,n){var e=[];return j.each(t,(function(t){var r=function(t){return i(t.text)?t.text:i(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=I(t.menu,n);e.push({text:r,items:o})}else{var u=n(t);e.push({text:r,value:u})}})),e},K=function(t){return void 0===t&&(t=B),function(n){return h.from(n).map((function(n){return I(n,t)}))}},z={sanitize:function(t){return K(B)(t)},sanitizeWith:K,createUi:function(t,n){return function(e){return{name:t,type:"listbox",label:n,items:e}}},getValue:B},q=Object.keys,V=Object.hasOwnProperty,F=function(t,n,e,r){!function(t,n){for(var e=q(t),r=0,o=e.length;r<o;r++){var i=e[r];n(t[i],i)}}(t,(function(t,o){(n(t,o)?e:r)(t,o)}))},W=function(t,n){return V.call(t,n)},G=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),H=tinymce.util.Tools.resolve("tinymce.util.URI"),J=function(t){return f(t)&&"a"===t.nodeName.toLowerCase()},Q=function(t){return J(t)&&!!Z(t)},X=function(t,n){if(t.collapsed)return[];var e=t.cloneContents(),r=e.firstChild,o=new G(r,e),i=[],u=r;do{n(u)&&i.push(u)}while(u=o.next());return i},Y=function(t){return/^\w+:/i.test(t)},Z=function(t){var n,e;return null!==(e=null!==(n=t.getAttribute("data-mce-href"))&&void 0!==n?n:t.getAttribute("href"))&&void 0!==e?e:""},$=function(t,n){var e=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===j.inArray(e,t)}))},i=n?function(t){return(t=o(t)).length>0?t.concat(e):e}(r):o(r);return i.length>0?function(t){return j.trim(t.sort().join(" "))}(i):""},tt=function(t,n){return n=n||rt(t.selection.getRng())[0]||t.selection.getNode(),at(n)?h.from(t.dom.select("a[href]",n)[0]):h.from(t.dom.getParent(n,"a[href]"))},nt=function(t,n){return tt(t,n).isSome()},et=function(t,n){return function(t){return t.replace(/\uFEFF/g,"")}(n.fold((function(){return t.getContent({format:"text"})}),(function(t){return t.innerText||t.textContent||""})))},rt=function(t){return X(t,Q)},ot=function(t){return j.grep(t,Q)},it=function(t){return ot(t).length>0},ut=function(t){var n=t.schema.getTextInlineElements();if(tt(t).exists((function(t){return t.hasAttribute("data-mce-block")})))return!1;var e=t.selection.getRng();return!!e.collapsed||0===X(e,(function(t){return 1===t.nodeType&&!J(t)&&!W(n,t.nodeName.toLowerCase())})).length},at=function(t){return f(t)&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},lt=function(t,n){var r=e({},n);if(0===R(t).length&&!D(t)){var o=$(r.rel,"_blank"===r.target);r.rel=o||null}return h.from(r.target).isNone()&&!1===P(t)&&(r.target=E(t)),r.href=function(t,n){return"http"!==n&&"https"!==n||Y(t)?t:n+"://"+t}(r.href,N(t)),r},ct=function(t,n,e){var r=t.selection.getNode(),o=tt(t,r),i=lt(t,function(t){var n,e,r;return n=["title","rel","class","target"],e=function(n,e){return t[e].each((function(t){n[e]=t.length>0?t:null})),n},r={href:t.href},function(t,n){for(var e=0,r=t.length;e<r;e++)n(t[e],e)}(n,(function(t,n){r=e(r,t,n)})),r}(e));t.undoManager.transact((function(){e.href===n.href&&n.attach(),o.fold((function(){!function(t,n,e,r){var o=t.dom;at(n)?mt(o,n,r):e.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(n){t.insertContent(o.createHTML("a",r,o.encode(n)))}))}(t,r,e.text,i)}),(function(n){t.focus(),function(t,n,e,r){e.each((function(t){W(n,"innerText")?n.innerText=t:n.textContent=t})),t.dom.setAttribs(n,r),t.selection.select(n)}(t,n,e.text,i)}))}))},ft=function(t){var n=t.class,e=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return function(t,n){var e,r={};return F(t,n,(e=r,function(t,n){e[n]=t}),d),r}({class:n.getOrNull(),href:e,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()},(function(t,n){return!1===l(t)}))},st=function(t,n,r){var o=function(t,n){var r=t.options.get,o={allow_html_data_urls:r("allow_html_data_urls"),allow_script_urls:r("allow_script_urls"),allow_svg_data_urls:r("allow_svg_data_urls")},i=n.href;return e(e({},n),{href:H.isDomSafe(i,"a",o)?i:""})}(t,r);t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,ft(o)):ct(t,n,o)},gt=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var n=t.selection.getNode();at(n)?dt(t,n):function(t){var n=t.dom,e=t.selection,r=e.getBookmark(),o=e.getRng().cloneRange(),i=n.getParent(o.startContainer,"a[href]",t.getBody()),u=n.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),e.setRng(o),t.execCommand("unlink"),e.moveToBookmark(r)}(t),t.focus()}))}(t)},dt=function(t,n){var e,r=t.dom.select("img",n)[0];if(r){var o=t.dom.getParents(r,"a[href]",n)[0];o&&(null===(e=o.parentNode)||void 0===e||e.insertBefore(r,o),t.dom.remove(o))}},mt=function(t,n,e){var r,o=t.select("img",n)[0];if(o){var i=t.create("a",e);null===(r=o.parentNode)||void 0===r||r.insertBefore(i,o),i.appendChild(o)}},ht=function(t){return W(n=t,e="items")&&void 0!==n[e]&&null!==n[e];var n,e},pt=function(t,n){return b(n,(function(n){return ht(n)?pt(t,n.items):O(n.value===t,n)}))},vt=function(t,n,e,r){var o=r[n],i=t.length>0;return void 0!==o?pt(o,e).map((function(n){return{url:{value:n.value,meta:{text:i?t:n.text,attach:d}},text:i?t:n.text}})):h.none()},kt=function(t,n){var r={text:t.text,title:t.title},o=function(t){var n,o,i=(n=t.url,O(r.text.length<=0,h.from(null===(o=n.meta)||void 0===o?void 0:o.text).getOr(n.value))),u=function(t){var n;return O(r.title.length<=0,h.from(null===(n=t.meta)||void 0===n?void 0:n.title).getOr(""))}(t.url);return i.isSome()||u.isSome()?h.some(e(e({},i.map((function(t){return{text:t}})).getOr({})),u.map((function(t){return{title:t}})).getOr({}))):h.none()},i=function(t,e){var o,i,u=(o=n,i=e,"link"===i?o.link:"anchor"===i?o.anchor:h.none()).getOr([]);return vt(r.text,e,u,t)};return{onChange:function(t,n){var e=n.name;return"url"===e?o(t()):k(["anchor","link"],e)?i(t(),e):"text"===e||"title"===e?(r[e]=t()[e],h.none()):h.none()}}},yt=tinymce.util.Tools.resolve("tinymce.util.Delay"),xt=function(t){var n=t.href;return n.indexOf("@")>0&&-1===n.indexOf("/")&&-1===n.indexOf("mailto:")?h.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return e(e({},t),{href:"mailto:"+n})}}):h.none()},bt=function(t,n){return function(r){var o=r.href;return 1===t&&!Y(o)||0===t&&/^\s*www(\.|\d\.)/i.test(o)?h.some({message:"The URL you entered seems to be an external link. Do you want to add the required ".concat(n,":// prefix?"),preprocess:function(t){return e(e({},t),{href:n+"://"+o})}}):h.none()}},_t=function(t,n){return b([xt,bt(N(t),T(t))],(function(t){return t(n)})).fold((function(){return Promise.resolve(n)}),(function(e){return new Promise((function(r){!function(t,n,e){var r=t.selection.getRng();yt.setEditorTimeout(t,(function(){t.windowManager.confirm(n,(function(n){t.selection.setRng(r),e(n)}))}))}(t,e.message,(function(t){r(t?e.preprocess(n):n)}))}))}))},wt=function(t){var n=t.dom.select("a:not([href])"),e=x(n,(function(t){var n=t.name||t.id;return n?[{text:n,value:"#"+n}]:[]}));return e.length>0?h.some([{text:"None",value:""}].concat(e)):h.none()},Ot=function(t){var n=L(t);return n.length>0?z.sanitize(n):h.none()},Ct=function(t){try{return h.some(JSON.parse(t))}catch(t){return h.none()}},Nt=function(t){var n=function(n){return t.convertURL(n.value||n.url||"","href")},e=S(t);return new Promise((function(t){i(e)?fetch(e).then((function(t){return t.ok?t.text().then(Ct):Promise.reject()})).then(t,(function(){return t(h.none())})):s(e)?e((function(n){return t(h.some(n))})):t(h.from(e))})).then((function(t){return t.bind(z.sanitizeWith(n)).map((function(t){if(t.length>0){return[{text:"None",value:""}].concat(t)}return t}))}))},At=function(t,n){var e=R(t);if(e.length>0){var r=_(n,"_blank");return(!1===D(t)?z.sanitizeWith((function(t){return $(z.getValue(t),r)})):z.sanitize)(e)}return h.none()},St=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Et=function(t){var n=P(t);return a(n)?z.sanitize(n).orThunk((function(){return h.some(St)})):!1===n?h.none():h.some(St)},Tt=function(t,n,e){var r=t.getAttrib(n,e);return null!==r&&r.length>0?h.some(r):h.none()},Pt=function(t,n){return Nt(t).then((function(e){var r=function(t,n){var e=t.dom,r=ut(t)?h.some(et(t.selection,n)):h.none(),o=n.bind((function(t){return h.from(e.getAttrib(t,"href"))})),i=n.bind((function(t){return h.from(e.getAttrib(t,"target"))})),u=n.bind((function(t){return Tt(e,t,"rel")})),a=n.bind((function(t){return Tt(e,t,"class")}));return{url:o,text:r,title:n.bind((function(t){return Tt(e,t,"title")})),target:i,rel:u,linkClass:a}}(t,n);return{anchor:r,catalogs:{targets:Et(t),rels:At(t,r.target),classes:Ot(t),anchor:wt(t),link:e},optNode:n,flags:{titleEnabled:M(t)}}}))},Rt=function(t){var n=function(t){var n=tt(t);return Pt(t,n)}(t);n.then((function(n){var e=function(t,n){return function(e){var r=e.getData();if(!r.url.value)return gt(t),void e.close();var o=function(t){return h.from(r[t]).filter((function(e){return!_(n.anchor[t],e)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:d};_t(t,i).then((function(n){st(t,u,n)})),e.close()}}(t,n);return function(t,n,e){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,n){var e=t.anchor,r=e.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:e.text.getOr(""),title:e.title.getOr(""),anchor:r,link:r,rel:e.rel.getOr(""),target:e.target.or(n).getOr(""),linkClass:e.linkClass.getOr("")}}(t,h.from(E(e))),u=t.catalogs,a=kt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:y([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],r,o,w([u.anchor.map(z.createUi("anchor","Anchors")),u.rels.map(z.createUi("rel","Rel")),u.targets.map(z.createUi("target","Open link in...")),u.link.map(z.createUi("link","Link list")),u.classes.map(z.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,n){var e=n.name;a.onChange(t.getData,{name:e}).each((function(n){t.setData(n)}))},onSubmit:n}}(n,e,t)})).then((function(n){t.windowManager.open(n)}))},Lt=tinymce.util.Tools.resolve("tinymce.util.VK"),Mt=function(t){var n=document.createElement("a");n.target="_blank",n.href=t,n.rel="noreferrer noopener";var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,n){document.body.appendChild(t),t.dispatchEvent(n),document.body.removeChild(t)}(n,e)},Dt=function(t,n){return t.dom.getParent(n,"a[href]")},Ut=function(t){return Dt(t,t.selection.getStart())},jt=function(t,n){if(n){var e=Z(n);if(/^#/.test(e)){var r=t.dom.select(e);r.length&&t.selection.scrollIntoView(r[0],!0)}else Mt(n.href)}},Bt=function(t){return function(){t.execCommand("mceLink",!1,{dialog:!0})}},It=function(t){return function(){jt(t,Ut(t))}},Kt=function(t,n){return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},zt=function(t){return function(n){var e=function(){n.setActive(!t.mode.isReadOnly()&&nt(t,t.selection.getNode())),n.setEnabled(t.selection.isEditable())};return e(),Kt(t,e)}},qt=function(t){return function(n){var e=function(){n.setEnabled(t.selection.isEditable())};return e(),Kt(t,e)}},Vt=function(t){return function(n){var e=function(){return n.setEnabled(function(t){return 1===(t.selection.isCollapsed()?ot(t.dom.getParents(t.selection.getStart())):rt(t.selection.getRng())).length}(t))};return e(),Kt(t,e)}},Ft=function(t){return function(n){var e=function(n){return it(n)||(e=t.selection.getRng(),rt(e).length>0);var e},r=t.dom.getParents(t.selection.getStart()),o=function(r){n.setEnabled(e(r)&&t.selection.isEditable())};return o(r),Kt(t,(function(t){return o(t.parents)}))}},Wt=function(t){var n=function(n){var e=t.selection.getNode();return n.setEnabled(nt(t,e)),d};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:zt(t)},label:"Link",predicate:function(n){return A(t)&&nt(t,n)},initValue:function(){var n;return tt(t).fold((n="",function(){return n}),Z)},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(n){var e=t.selection.getNode();return n.setActive(nt(t,e)),zt(t)(n)},onAction:function(n){var e=n.getValue(),r=function(n){var e=tt(t),r=ut(t);if(e.isNone()&&r){var o=et(t.selection,e);return O(0===o.length,n)}return h.none()}(e);st(t,{href:e,attach:d},{href:e,text:r,title:h.none(),rel:h.none(),target:h.none(),class:h.none()}),function(t){t.selection.collapse(!1)}(t),n.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:function(n){gt(t),n.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:function(n){It(t)(),n.hide()}}]})};n.add("link",(function(t){!function(t){var n=t.options.register;n("link_assume_external_targets",{processor:function(t){var n=i(t)||c(t);return n?!0===t?{value:1,valid:n}:"http"===t||"https"===t?{value:t,valid:n}:{value:0,valid:n}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),n("link_context_toolbar",{processor:"boolean",default:!1}),n("link_list",{processor:function(t){return i(t)||s(t)||g(t,u)}}),n("link_default_target",{processor:"string"}),n("link_default_protocol",{processor:"string",default:"https"}),n("link_target_list",{processor:function(t){return c(t)||g(t,u)},default:!0}),n("link_rel_list",{processor:"object[]",default:[]}),n("link_class_list",{processor:"object[]",default:[]}),n("link_title",{processor:"boolean",default:!0}),n("allow_unsafe_link_target",{processor:"boolean",default:!1}),n("link_quicklink",{processor:"boolean",default:!1})}(t),function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Bt(t),onSetup:zt(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return gt(t)},onSetup:Ft(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onSetup:qt(t),onAction:Bt(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return gt(t)},onSetup:Ft(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(n){return t.dom.isEditable(n)?it(t.dom.getParents(n,"a"))?"link unlink openlink":"link":""}})}(t),Wt(t),function(t){t.on("click",(function(n){var e=Dt(t,n.target);e&&Lt.metaKeyPressed(n)&&(n.preventDefault(),jt(t,e))})),t.on("keydown",(function(n){if(!n.isDefaultPrevented()&&13===n.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(n)){var e=Ut(t);e&&(n.preventDefault(),jt(t,e))}}))}(t),function(t){t.addCommand("mceLink",(function(n,e){!0!==(null==e?void 0:e.dialog)&&U(t)?t.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Rt(t)}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}(),t}export{e as __require};
|
2
2
|
//# sourceMappingURL=plugin.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sources":["../../../../../public/tinymce/plugins/link/plugin.js"],"sourcesContent":["\"use strict\";\n/**\n * TinyMCE version 6.8.5 (TBD)\n */\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n(function () {\n 'use strict';\n var global$5 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n var hasProto = function (v, constructor, predicate) {\n var _a;\n if (predicate(v, constructor.prototype)) {\n return true;\n }\n else {\n return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;\n }\n };\n var typeOf = function (x) {\n var t = typeof x;\n if (x === null) {\n return 'null';\n }\n else if (t === 'object' && Array.isArray(x)) {\n return 'array';\n }\n else if (t === 'object' && hasProto(x, String, function (o, proto) { return proto.isPrototypeOf(o); })) {\n return 'string';\n }\n else {\n return t;\n }\n };\n var isType = function (type) { return function (value) { return typeOf(value) === type; }; };\n var isSimpleType = function (type) { return function (value) { return typeof value === type; }; };\n var eq = function (t) { return function (a) { return t === a; }; };\n var isString = isType('string');\n var isObject = isType('object');\n var isArray = isType('array');\n var isNull = eq(null);\n var isBoolean = isSimpleType('boolean');\n var isNullable = function (a) { return a === null || a === undefined; };\n var isNonNullable = function (a) { return !isNullable(a); };\n var isFunction = isSimpleType('function');\n var isArrayOf = function (value, pred) {\n if (isArray(value)) {\n for (var i = 0, len = value.length; i < len; ++i) {\n if (!pred(value[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n };\n var noop = function () {\n };\n var constant = function (value) {\n return function () {\n return value;\n };\n };\n var tripleEquals = function (a, b) {\n return a === b;\n };\n var Optional = /** @class */ (function () {\n function Optional(tag, value) {\n this.tag = tag;\n this.value = value;\n }\n Optional.some = function (value) {\n return new Optional(true, value);\n };\n Optional.none = function () {\n return Optional.singletonNone;\n };\n Optional.prototype.fold = function (onNone, onSome) {\n if (this.tag) {\n return onSome(this.value);\n }\n else {\n return onNone();\n }\n };\n Optional.prototype.isSome = function () {\n return this.tag;\n };\n Optional.prototype.isNone = function () {\n return !this.tag;\n };\n Optional.prototype.map = function (mapper) {\n if (this.tag) {\n return Optional.some(mapper(this.value));\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.bind = function (binder) {\n if (this.tag) {\n return binder(this.value);\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.exists = function (predicate) {\n return this.tag && predicate(this.value);\n };\n Optional.prototype.forall = function (predicate) {\n return !this.tag || predicate(this.value);\n };\n Optional.prototype.filter = function (predicate) {\n if (!this.tag || predicate(this.value)) {\n return this;\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.getOr = function (replacement) {\n return this.tag ? this.value : replacement;\n };\n Optional.prototype.or = function (replacement) {\n return this.tag ? this : replacement;\n };\n Optional.prototype.getOrThunk = function (thunk) {\n return this.tag ? this.value : thunk();\n };\n Optional.prototype.orThunk = function (thunk) {\n return this.tag ? this : thunk();\n };\n Optional.prototype.getOrDie = function (message) {\n if (!this.tag) {\n throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');\n }\n else {\n return this.value;\n }\n };\n Optional.from = function (value) {\n return isNonNullable(value) ? Optional.some(value) : Optional.none();\n };\n Optional.prototype.getOrNull = function () {\n return this.tag ? this.value : null;\n };\n Optional.prototype.getOrUndefined = function () {\n return this.value;\n };\n Optional.prototype.each = function (worker) {\n if (this.tag) {\n worker(this.value);\n }\n };\n Optional.prototype.toArray = function () {\n return this.tag ? [this.value] : [];\n };\n Optional.prototype.toString = function () {\n return this.tag ? \"some(\".concat(this.value, \")\") : 'none()';\n };\n return Optional;\n }());\n Optional.singletonNone = new Optional(false);\n var nativeIndexOf = Array.prototype.indexOf;\n var nativePush = Array.prototype.push;\n var rawIndexOf = function (ts, t) { return nativeIndexOf.call(ts, t); };\n var contains = function (xs, x) { return rawIndexOf(xs, x) > -1; };\n var map = function (xs, f) {\n var len = xs.length;\n var r = new Array(len);\n for (var i = 0; i < len; i++) {\n var x = xs[i];\n r[i] = f(x, i);\n }\n return r;\n };\n var each$1 = function (xs, f) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n f(x, i);\n }\n };\n var foldl = function (xs, f, acc) {\n each$1(xs, function (x, i) {\n acc = f(acc, x, i);\n });\n return acc;\n };\n var flatten = function (xs) {\n var r = [];\n for (var 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 var bind = function (xs, f) { return flatten(map(xs, f)); };\n var findMap = function (arr, f) {\n for (var i = 0; i < arr.length; i++) {\n var r = f(arr[i], i);\n if (r.isSome()) {\n return r;\n }\n }\n return Optional.none();\n };\n var is = function (lhs, rhs, comparator) {\n if (comparator === void 0) { comparator = tripleEquals; }\n return lhs.exists(function (left) { return comparator(left, rhs); });\n };\n var cat = function (arr) {\n var r = [];\n var push = function (x) {\n r.push(x);\n };\n for (var i = 0; i < arr.length; i++) {\n arr[i].each(push);\n }\n return r;\n };\n var someIf = function (b, a) { return b ? Optional.some(a) : Optional.none(); };\n var option = function (name) { return function (editor) { return editor.options.get(name); }; };\n var register$1 = function (editor) {\n var registerOption = editor.options.register;\n registerOption('link_assume_external_targets', {\n processor: function (value) {\n var valid = isString(value) || isBoolean(value);\n if (valid) {\n if (value === true) {\n return {\n value: 1,\n valid: valid\n };\n }\n else if (value === 'http' || value === 'https') {\n return {\n value: value,\n valid: valid\n };\n }\n else {\n return {\n value: 0,\n valid: valid\n };\n }\n }\n else {\n return {\n valid: false,\n message: 'Must be a string or a boolean.'\n };\n }\n },\n default: false\n });\n registerOption('link_context_toolbar', {\n processor: 'boolean',\n default: false\n });\n registerOption('link_list', { processor: function (value) { return isString(value) || isFunction(value) || isArrayOf(value, isObject); } });\n registerOption('link_default_target', { processor: 'string' });\n registerOption('link_default_protocol', {\n processor: 'string',\n default: 'https'\n });\n registerOption('link_target_list', {\n processor: function (value) { return isBoolean(value) || isArrayOf(value, isObject); },\n default: true\n });\n registerOption('link_rel_list', {\n processor: 'object[]',\n default: []\n });\n registerOption('link_class_list', {\n processor: 'object[]',\n default: []\n });\n registerOption('link_title', {\n processor: 'boolean',\n default: true\n });\n registerOption('allow_unsafe_link_target', {\n processor: 'boolean',\n default: false\n });\n registerOption('link_quicklink', {\n processor: 'boolean',\n default: false\n });\n };\n var assumeExternalTargets = option('link_assume_external_targets');\n var hasContextToolbar = option('link_context_toolbar');\n var getLinkList = option('link_list');\n var getDefaultLinkTarget = option('link_default_target');\n var getDefaultLinkProtocol = option('link_default_protocol');\n var getTargetList = option('link_target_list');\n var getRelList = option('link_rel_list');\n var getLinkClassList = option('link_class_list');\n var shouldShowLinkTitle = option('link_title');\n var allowUnsafeLinkTarget = option('allow_unsafe_link_target');\n var useQuickLink = option('link_quicklink');\n var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');\n var getValue = function (item) { return isString(item.value) ? item.value : ''; };\n var getText = function (item) {\n if (isString(item.text)) {\n return item.text;\n }\n else if (isString(item.title)) {\n return item.title;\n }\n else {\n return '';\n }\n };\n var sanitizeList = function (list, extractValue) {\n var out = [];\n global$4.each(list, function (item) {\n var text = getText(item);\n if (item.menu !== undefined) {\n var items = sanitizeList(item.menu, extractValue);\n out.push({\n text: text,\n items: items\n });\n }\n else {\n var value = extractValue(item);\n out.push({\n text: text,\n value: value\n });\n }\n });\n return out;\n };\n var sanitizeWith = function (extracter) {\n if (extracter === void 0) { extracter = getValue; }\n return function (list) { return Optional.from(list).map(function (list) { return sanitizeList(list, extracter); }); };\n };\n var sanitize = function (list) { return sanitizeWith(getValue)(list); };\n var createUi = function (name, label) { return function (items) { return ({\n name: name,\n type: 'listbox',\n label: label,\n items: items\n }); }; };\n var ListOptions = {\n sanitize: sanitize,\n sanitizeWith: sanitizeWith,\n createUi: createUi,\n getValue: getValue\n };\n var keys = Object.keys;\n var hasOwnProperty = Object.hasOwnProperty;\n var each = function (obj, f) {\n var props = keys(obj);\n for (var k = 0, len = props.length; k < len; k++) {\n var i = props[k];\n var x = obj[i];\n f(x, i);\n }\n };\n var objAcc = function (r) { return function (x, i) {\n r[i] = x;\n }; };\n var internalFilter = function (obj, pred, onTrue, onFalse) {\n each(obj, function (x, i) {\n (pred(x, i) ? onTrue : onFalse)(x, i);\n });\n };\n var filter = function (obj, pred) {\n var t = {};\n internalFilter(obj, pred, objAcc(t), noop);\n return t;\n };\n var has = function (obj, key) { return hasOwnProperty.call(obj, key); };\n var hasNonNullableKey = function (obj, key) { return has(obj, key) && obj[key] !== undefined && obj[key] !== null; };\n var global$3 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');\n var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI');\n var isAnchor = function (elm) { return isNonNullable(elm) && elm.nodeName.toLowerCase() === 'a'; };\n var isLink = function (elm) { return isAnchor(elm) && !!getHref(elm); };\n var collectNodesInRange = function (rng, predicate) {\n if (rng.collapsed) {\n return [];\n }\n else {\n var contents = rng.cloneContents();\n var firstChild = contents.firstChild;\n var walker = new global$3(firstChild, contents);\n var elements = [];\n var current = firstChild;\n do {\n if (predicate(current)) {\n elements.push(current);\n }\n } while (current = walker.next());\n return elements;\n }\n };\n var hasProtocol = function (url) { return /^\\w+:/i.test(url); };\n var getHref = function (elm) {\n var _a, _b;\n return (_b = (_a = elm.getAttribute('data-mce-href')) !== null && _a !== void 0 ? _a : elm.getAttribute('href')) !== null && _b !== void 0 ? _b : '';\n };\n var applyRelTargetRules = function (rel, isUnsafe) {\n var rules = ['noopener'];\n var rels = rel ? rel.split(/\\s+/) : [];\n var toString = function (rels) { return global$4.trim(rels.sort().join(' ')); };\n var addTargetRules = function (rels) {\n rels = removeTargetRules(rels);\n return rels.length > 0 ? rels.concat(rules) : rules;\n };\n var removeTargetRules = function (rels) { return rels.filter(function (val) { return global$4.inArray(rules, val) === -1; }); };\n var newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels);\n return newRels.length > 0 ? toString(newRels) : '';\n };\n var trimCaretContainers = function (text) { return text.replace(/\\uFEFF/g, ''); };\n var getAnchorElement = function (editor, selectedElm) {\n selectedElm = selectedElm || getLinksInSelection(editor.selection.getRng())[0] || editor.selection.getNode();\n if (isImageFigure(selectedElm)) {\n return Optional.from(editor.dom.select('a[href]', selectedElm)[0]);\n }\n else {\n return Optional.from(editor.dom.getParent(selectedElm, 'a[href]'));\n }\n };\n var isInAnchor = function (editor, selectedElm) { return getAnchorElement(editor, selectedElm).isSome(); };\n var getAnchorText = function (selection, anchorElm) {\n var text = anchorElm.fold(function () { return selection.getContent({ format: 'text' }); }, function (anchorElm) { return anchorElm.innerText || anchorElm.textContent || ''; });\n return trimCaretContainers(text);\n };\n var getLinksInSelection = function (rng) { return collectNodesInRange(rng, isLink); };\n var getLinks$1 = function (elements) { return global$4.grep(elements, isLink); };\n var hasLinks = function (elements) { return getLinks$1(elements).length > 0; };\n var hasLinksInSelection = function (rng) { return getLinksInSelection(rng).length > 0; };\n var isOnlyTextSelected = function (editor) {\n var inlineTextElements = editor.schema.getTextInlineElements();\n var isElement = function (elm) { return elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase()); };\n var isInBlockAnchor = getAnchorElement(editor).exists(function (anchor) { return anchor.hasAttribute('data-mce-block'); });\n if (isInBlockAnchor) {\n return false;\n }\n var rng = editor.selection.getRng();\n if (!rng.collapsed) {\n var elements = collectNodesInRange(rng, isElement);\n return elements.length === 0;\n }\n else {\n return true;\n }\n };\n var isImageFigure = function (elm) { return isNonNullable(elm) && elm.nodeName === 'FIGURE' && /\\bimage\\b/i.test(elm.className); };\n var getLinkAttrs = function (data) {\n var attrs = [\n 'title',\n 'rel',\n 'class',\n 'target'\n ];\n return foldl(attrs, function (acc, key) {\n data[key].each(function (value) {\n acc[key] = value.length > 0 ? value : null;\n });\n return acc;\n }, { href: data.href });\n };\n var handleExternalTargets = function (href, assumeExternalTargets) {\n if ((assumeExternalTargets === 'http' || assumeExternalTargets === 'https') && !hasProtocol(href)) {\n return assumeExternalTargets + '://' + href;\n }\n return href;\n };\n var applyLinkOverrides = function (editor, linkAttrs) {\n var newLinkAttrs = __assign({}, linkAttrs);\n if (getRelList(editor).length === 0 && !allowUnsafeLinkTarget(editor)) {\n var newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank');\n newLinkAttrs.rel = newRel ? newRel : null;\n }\n if (Optional.from(newLinkAttrs.target).isNone() && getTargetList(editor) === false) {\n newLinkAttrs.target = getDefaultLinkTarget(editor);\n }\n newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, assumeExternalTargets(editor));\n return newLinkAttrs;\n };\n var updateLink = function (editor, anchorElm, text, linkAttrs) {\n text.each(function (text) {\n if (has(anchorElm, 'innerText')) {\n anchorElm.innerText = text;\n }\n else {\n anchorElm.textContent = text;\n }\n });\n editor.dom.setAttribs(anchorElm, linkAttrs);\n editor.selection.select(anchorElm);\n };\n var createLink = function (editor, selectedElm, text, linkAttrs) {\n var dom = editor.dom;\n if (isImageFigure(selectedElm)) {\n linkImageFigure(dom, selectedElm, linkAttrs);\n }\n else {\n text.fold(function () {\n editor.execCommand('mceInsertLink', false, linkAttrs);\n }, function (text) {\n editor.insertContent(dom.createHTML('a', linkAttrs, dom.encode(text)));\n });\n }\n };\n var linkDomMutation = function (editor, attachState, data) {\n var selectedElm = editor.selection.getNode();\n var anchorElm = getAnchorElement(editor, selectedElm);\n var linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data));\n editor.undoManager.transact(function () {\n if (data.href === attachState.href) {\n attachState.attach();\n }\n anchorElm.fold(function () {\n createLink(editor, selectedElm, data.text, linkAttrs);\n }, function (elm) {\n editor.focus();\n updateLink(editor, elm, data.text, linkAttrs);\n });\n });\n };\n var unlinkSelection = function (editor) {\n var dom = editor.dom, selection = editor.selection;\n var bookmark = selection.getBookmark();\n var rng = selection.getRng().cloneRange();\n var startAnchorElm = dom.getParent(rng.startContainer, 'a[href]', editor.getBody());\n var endAnchorElm = dom.getParent(rng.endContainer, 'a[href]', editor.getBody());\n if (startAnchorElm) {\n rng.setStartBefore(startAnchorElm);\n }\n if (endAnchorElm) {\n rng.setEndAfter(endAnchorElm);\n }\n selection.setRng(rng);\n editor.execCommand('unlink');\n selection.moveToBookmark(bookmark);\n };\n var unlinkDomMutation = function (editor) {\n editor.undoManager.transact(function () {\n var node = editor.selection.getNode();\n if (isImageFigure(node)) {\n unlinkImageFigure(editor, node);\n }\n else {\n unlinkSelection(editor);\n }\n editor.focus();\n });\n };\n var unwrapOptions = function (data) {\n var cls = data.class, href = data.href, rel = data.rel, target = data.target, text = data.text, title = data.title;\n return filter({\n class: cls.getOrNull(),\n href: href,\n rel: rel.getOrNull(),\n target: target.getOrNull(),\n text: text.getOrNull(),\n title: title.getOrNull()\n }, function (v, _k) { return isNull(v) === false; });\n };\n var sanitizeData = function (editor, data) {\n var getOption = editor.options.get;\n var uriOptions = {\n allow_html_data_urls: getOption('allow_html_data_urls'),\n allow_script_urls: getOption('allow_script_urls'),\n allow_svg_data_urls: getOption('allow_svg_data_urls')\n };\n var href = data.href;\n return __assign(__assign({}, data), { href: global$2.isDomSafe(href, 'a', uriOptions) ? href : '' });\n };\n var link = function (editor, attachState, data) {\n var sanitizedData = sanitizeData(editor, data);\n editor.hasPlugin('rtc', true) ? editor.execCommand('createlink', false, unwrapOptions(sanitizedData)) : linkDomMutation(editor, attachState, sanitizedData);\n };\n var unlink = function (editor) {\n editor.hasPlugin('rtc', true) ? editor.execCommand('unlink') : unlinkDomMutation(editor);\n };\n var unlinkImageFigure = function (editor, fig) {\n var _a;\n var img = editor.dom.select('img', fig)[0];\n if (img) {\n var a = editor.dom.getParents(img, 'a[href]', fig)[0];\n if (a) {\n (_a = a.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(img, a);\n editor.dom.remove(a);\n }\n }\n };\n var linkImageFigure = function (dom, fig, attrs) {\n var _a;\n var img = dom.select('img', fig)[0];\n if (img) {\n var a = dom.create('a', attrs);\n (_a = img.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(a, img);\n a.appendChild(img);\n }\n };\n var isListGroup = function (item) { return hasNonNullableKey(item, 'items'); };\n var findTextByValue = function (value, catalog) { return findMap(catalog, function (item) {\n if (isListGroup(item)) {\n return findTextByValue(value, item.items);\n }\n else {\n return someIf(item.value === value, item);\n }\n }); };\n var getDelta = function (persistentText, fieldName, catalog, data) {\n var value = data[fieldName];\n var hasPersistentText = persistentText.length > 0;\n return value !== undefined ? findTextByValue(value, catalog).map(function (i) { return ({\n url: {\n value: i.value,\n meta: {\n text: hasPersistentText ? persistentText : i.text,\n attach: noop\n }\n },\n text: hasPersistentText ? persistentText : i.text\n }); }) : Optional.none();\n };\n var findCatalog = function (catalogs, fieldName) {\n if (fieldName === 'link') {\n return catalogs.link;\n }\n else if (fieldName === 'anchor') {\n return catalogs.anchor;\n }\n else {\n return Optional.none();\n }\n };\n var init = function (initialData, linkCatalog) {\n var persistentData = {\n text: initialData.text,\n title: initialData.title\n };\n var getTitleFromUrlChange = function (url) {\n var _a;\n return someIf(persistentData.title.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.title).getOr(''));\n };\n var getTextFromUrlChange = function (url) {\n var _a;\n return someIf(persistentData.text.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.text).getOr(url.value));\n };\n var onUrlChange = function (data) {\n var text = getTextFromUrlChange(data.url);\n var title = getTitleFromUrlChange(data.url);\n if (text.isSome() || title.isSome()) {\n return Optional.some(__assign(__assign({}, text.map(function (text) { return ({ text: text }); }).getOr({})), title.map(function (title) { return ({ title: title }); }).getOr({})));\n }\n else {\n return Optional.none();\n }\n };\n var onCatalogChange = function (data, change) {\n var catalog = findCatalog(linkCatalog, change).getOr([]);\n return getDelta(persistentData.text, change, catalog, data);\n };\n var onChange = function (getData, change) {\n var name = change.name;\n if (name === 'url') {\n return onUrlChange(getData());\n }\n else if (contains([\n 'anchor',\n 'link'\n ], name)) {\n return onCatalogChange(getData(), name);\n }\n else if (name === 'text' || name === 'title') {\n persistentData[name] = getData()[name];\n return Optional.none();\n }\n else {\n return Optional.none();\n }\n };\n return { onChange: onChange };\n };\n var DialogChanges = {\n init: init,\n getDelta: getDelta\n };\n var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');\n var delayedConfirm = function (editor, message, callback) {\n var rng = editor.selection.getRng();\n global$1.setEditorTimeout(editor, function () {\n editor.windowManager.confirm(message, function (state) {\n editor.selection.setRng(rng);\n callback(state);\n });\n });\n };\n var tryEmailTransform = function (data) {\n var url = data.href;\n var suggestMailTo = url.indexOf('@') > 0 && url.indexOf('/') === -1 && url.indexOf('mailto:') === -1;\n return suggestMailTo ? Optional.some({\n message: 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?',\n preprocess: function (oldData) { return (__assign(__assign({}, oldData), { href: 'mailto:' + url })); }\n }) : Optional.none();\n };\n var tryProtocolTransform = function (assumeExternalTargets, defaultLinkProtocol) { return function (data) {\n var url = data.href;\n var suggestProtocol = assumeExternalTargets === 1 && !hasProtocol(url) || assumeExternalTargets === 0 && /^\\s*www(\\.|\\d\\.)/i.test(url);\n return suggestProtocol ? Optional.some({\n message: \"The URL you entered seems to be an external link. Do you want to add the required \".concat(defaultLinkProtocol, \":// prefix?\"),\n preprocess: function (oldData) { return (__assign(__assign({}, oldData), { href: defaultLinkProtocol + '://' + url })); }\n }) : Optional.none();\n }; };\n var preprocess = function (editor, data) { return findMap([\n tryEmailTransform,\n tryProtocolTransform(assumeExternalTargets(editor), getDefaultLinkProtocol(editor))\n ], function (f) { return f(data); }).fold(function () { return Promise.resolve(data); }, function (transform) { return new Promise(function (callback) {\n delayedConfirm(editor, transform.message, function (state) {\n callback(state ? transform.preprocess(data) : data);\n });\n }); }); };\n var DialogConfirms = { preprocess: preprocess };\n var getAnchors = function (editor) {\n var anchorNodes = editor.dom.select('a:not([href])');\n var anchors = bind(anchorNodes, function (anchor) {\n var id = anchor.name || anchor.id;\n return id ? [{\n text: id,\n value: '#' + id\n }] : [];\n });\n return anchors.length > 0 ? Optional.some([{\n text: 'None',\n value: ''\n }].concat(anchors)) : Optional.none();\n };\n var AnchorListOptions = { getAnchors: getAnchors };\n var getClasses = function (editor) {\n var list = getLinkClassList(editor);\n if (list.length > 0) {\n return ListOptions.sanitize(list);\n }\n return Optional.none();\n };\n var ClassListOptions = { getClasses: getClasses };\n var parseJson = function (text) {\n try {\n return Optional.some(JSON.parse(text));\n }\n catch (err) {\n return Optional.none();\n }\n };\n var getLinks = function (editor) {\n var extractor = function (item) { return editor.convertURL(item.value || item.url || '', 'href'); };\n var linkList = getLinkList(editor);\n return new Promise(function (resolve) {\n if (isString(linkList)) {\n fetch(linkList).then(function (res) { return res.ok ? res.text().then(parseJson) : Promise.reject(); }).then(resolve, function () { return resolve(Optional.none()); });\n }\n else if (isFunction(linkList)) {\n linkList(function (output) { return resolve(Optional.some(output)); });\n }\n else {\n resolve(Optional.from(linkList));\n }\n }).then(function (optItems) { return optItems.bind(ListOptions.sanitizeWith(extractor)).map(function (items) {\n if (items.length > 0) {\n var noneItem = [{\n text: 'None',\n value: ''\n }];\n return noneItem.concat(items);\n }\n else {\n return items;\n }\n }); });\n };\n var LinkListOptions = { getLinks: getLinks };\n var getRels = function (editor, initialTarget) {\n var list = getRelList(editor);\n if (list.length > 0) {\n var isTargetBlank_1 = is(initialTarget, '_blank');\n var enforceSafe = allowUnsafeLinkTarget(editor) === false;\n var safeRelExtractor = function (item) { return applyRelTargetRules(ListOptions.getValue(item), isTargetBlank_1); };\n var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize;\n return sanitizer(list);\n }\n return Optional.none();\n };\n var RelOptions = { getRels: getRels };\n var fallbacks = [\n {\n text: 'Current window',\n value: ''\n },\n {\n text: 'New window',\n value: '_blank'\n }\n ];\n var getTargets = function (editor) {\n var list = getTargetList(editor);\n if (isArray(list)) {\n return ListOptions.sanitize(list).orThunk(function () { return Optional.some(fallbacks); });\n }\n else if (list === false) {\n return Optional.none();\n }\n return Optional.some(fallbacks);\n };\n var TargetOptions = { getTargets: getTargets };\n var nonEmptyAttr = function (dom, elem, name) {\n var val = dom.getAttrib(elem, name);\n return val !== null && val.length > 0 ? Optional.some(val) : Optional.none();\n };\n var extractFromAnchor = function (editor, anchor) {\n var dom = editor.dom;\n var onlyText = isOnlyTextSelected(editor);\n var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)) : Optional.none();\n var url = anchor.bind(function (anchorElm) { return Optional.from(dom.getAttrib(anchorElm, 'href')); });\n var target = anchor.bind(function (anchorElm) { return Optional.from(dom.getAttrib(anchorElm, 'target')); });\n var rel = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'rel'); });\n var linkClass = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'class'); });\n var title = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'title'); });\n return {\n url: url,\n text: text,\n title: title,\n target: target,\n rel: rel,\n linkClass: linkClass\n };\n };\n var collect = function (editor, linkNode) { return LinkListOptions.getLinks(editor).then(function (links) {\n var anchor = extractFromAnchor(editor, linkNode);\n return {\n anchor: anchor,\n catalogs: {\n targets: TargetOptions.getTargets(editor),\n rels: RelOptions.getRels(editor, anchor.target),\n classes: ClassListOptions.getClasses(editor),\n anchor: AnchorListOptions.getAnchors(editor),\n link: links\n },\n optNode: linkNode,\n flags: { titleEnabled: shouldShowLinkTitle(editor) }\n };\n }); };\n var DialogInfo = { collect: collect };\n var handleSubmit = function (editor, info) { return function (api) {\n var data = api.getData();\n if (!data.url.value) {\n unlink(editor);\n api.close();\n return;\n }\n var getChangedValue = function (key) { return Optional.from(data[key]).filter(function (value) { return !is(info.anchor[key], value); }); };\n var changedData = {\n href: data.url.value,\n text: getChangedValue('text'),\n target: getChangedValue('target'),\n rel: getChangedValue('rel'),\n class: getChangedValue('linkClass'),\n title: getChangedValue('title')\n };\n var attachState = {\n href: data.url.value,\n attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : noop\n };\n DialogConfirms.preprocess(editor, changedData).then(function (pData) {\n link(editor, attachState, pData);\n });\n api.close();\n }; };\n var collectData = function (editor) {\n var anchorNode = getAnchorElement(editor);\n return DialogInfo.collect(editor, anchorNode);\n };\n var getInitialData = function (info, defaultTarget) {\n var anchor = info.anchor;\n var url = anchor.url.getOr('');\n return {\n url: {\n value: url,\n meta: { original: { value: url } }\n },\n text: anchor.text.getOr(''),\n title: anchor.title.getOr(''),\n anchor: url,\n link: url,\n rel: anchor.rel.getOr(''),\n target: anchor.target.or(defaultTarget).getOr(''),\n linkClass: anchor.linkClass.getOr('')\n };\n };\n var makeDialog = function (settings, onSubmit, editor) {\n var urlInput = [{\n name: 'url',\n type: 'urlinput',\n filetype: 'file',\n label: 'URL',\n picker_text: 'Browse links'\n }];\n var displayText = settings.anchor.text.map(function () { return ({\n name: 'text',\n type: 'input',\n label: 'Text to display'\n }); }).toArray();\n var titleText = settings.flags.titleEnabled ? [{\n name: 'title',\n type: 'input',\n label: 'Title'\n }] : [];\n var defaultTarget = Optional.from(getDefaultLinkTarget(editor));\n var initialData = getInitialData(settings, defaultTarget);\n var catalogs = settings.catalogs;\n var dialogDelta = DialogChanges.init(initialData, catalogs);\n var body = {\n type: 'panel',\n items: flatten([\n urlInput,\n displayText,\n titleText,\n cat([\n catalogs.anchor.map(ListOptions.createUi('anchor', 'Anchors')),\n catalogs.rels.map(ListOptions.createUi('rel', 'Rel')),\n catalogs.targets.map(ListOptions.createUi('target', 'Open link in...')),\n catalogs.link.map(ListOptions.createUi('link', 'Link list')),\n catalogs.classes.map(ListOptions.createUi('linkClass', 'Class'))\n ])\n ])\n };\n return {\n title: 'Insert/Edit Link',\n size: 'normal',\n body: 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 initialData: initialData,\n onChange: function (api, _c) {\n var name = _c.name;\n dialogDelta.onChange(api.getData, { name: name }).each(function (newData) {\n api.setData(newData);\n });\n },\n onSubmit: onSubmit\n };\n };\n var open$1 = function (editor) {\n var data = collectData(editor);\n data.then(function (info) {\n var onSubmit = handleSubmit(editor, info);\n return makeDialog(info, onSubmit, editor);\n }).then(function (spec) {\n editor.windowManager.open(spec);\n });\n };\n var register = function (editor) {\n editor.addCommand('mceLink', function (_ui, value) {\n if ((value === null || value === void 0 ? void 0 : value.dialog) === true || !useQuickLink(editor)) {\n open$1(editor);\n }\n else {\n editor.dispatch('contexttoolbar-show', { toolbarKey: 'quicklink' });\n }\n });\n };\n var global = tinymce.util.Tools.resolve('tinymce.util.VK');\n var appendClickRemove = function (link, evt) {\n document.body.appendChild(link);\n link.dispatchEvent(evt);\n document.body.removeChild(link);\n };\n var open = function (url) {\n var link = document.createElement('a');\n link.target = '_blank';\n link.href = url;\n link.rel = 'noreferrer noopener';\n var evt = document.createEvent('MouseEvents');\n evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n appendClickRemove(link, evt);\n };\n var getLink = function (editor, elm) { return editor.dom.getParent(elm, 'a[href]'); };\n var getSelectedLink = function (editor) { return getLink(editor, editor.selection.getStart()); };\n var hasOnlyAltModifier = function (e) {\n return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false;\n };\n var gotoLink = function (editor, a) {\n if (a) {\n var href = getHref(a);\n if (/^#/.test(href)) {\n var targetEl = editor.dom.select(href);\n if (targetEl.length) {\n editor.selection.scrollIntoView(targetEl[0], true);\n }\n }\n else {\n open(a.href);\n }\n }\n };\n var openDialog = function (editor) { return function () {\n editor.execCommand('mceLink', false, { dialog: true });\n }; };\n var gotoSelectedLink = function (editor) { return function () {\n gotoLink(editor, getSelectedLink(editor));\n }; };\n var setupGotoLinks = function (editor) {\n editor.on('click', function (e) {\n var link = getLink(editor, e.target);\n if (link && global.metaKeyPressed(e)) {\n e.preventDefault();\n gotoLink(editor, link);\n }\n });\n editor.on('keydown', function (e) {\n if (!e.isDefaultPrevented() && e.keyCode === 13 && hasOnlyAltModifier(e)) {\n var link_1 = getSelectedLink(editor);\n if (link_1) {\n e.preventDefault();\n gotoLink(editor, link_1);\n }\n }\n });\n };\n var toggleState = function (editor, toggler) {\n editor.on('NodeChange', toggler);\n return function () { return editor.off('NodeChange', toggler); };\n };\n var toggleLinkState = function (editor) { return function (api) {\n var updateState = function () {\n api.setActive(!editor.mode.isReadOnly() && isInAnchor(editor, editor.selection.getNode()));\n api.setEnabled(editor.selection.isEditable());\n };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var toggleLinkMenuState = function (editor) { return function (api) {\n var updateState = function () {\n api.setEnabled(editor.selection.isEditable());\n };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var hasExactlyOneLinkInSelection = function (editor) {\n var links = editor.selection.isCollapsed() ? getLinks$1(editor.dom.getParents(editor.selection.getStart())) : getLinksInSelection(editor.selection.getRng());\n return links.length === 1;\n };\n var toggleGotoLinkState = function (editor) { return function (api) {\n var updateState = function () { return api.setEnabled(hasExactlyOneLinkInSelection(editor)); };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var toggleUnlinkState = function (editor) { return function (api) {\n var hasLinks$1 = function (parents) { return hasLinks(parents) || hasLinksInSelection(editor.selection.getRng()); };\n var parents = editor.dom.getParents(editor.selection.getStart());\n var updateEnabled = function (parents) {\n api.setEnabled(hasLinks$1(parents) && editor.selection.isEditable());\n };\n updateEnabled(parents);\n return toggleState(editor, function (e) { return updateEnabled(e.parents); });\n }; };\n var setup = function (editor) {\n editor.addShortcut('Meta+K', '', function () {\n editor.execCommand('mceLink');\n });\n };\n var setupButtons = function (editor) {\n editor.ui.registry.addToggleButton('link', {\n icon: 'link',\n tooltip: 'Insert/edit link',\n onAction: openDialog(editor),\n onSetup: toggleLinkState(editor)\n });\n editor.ui.registry.addButton('openlink', {\n icon: 'new-tab',\n tooltip: 'Open link',\n onAction: gotoSelectedLink(editor),\n onSetup: toggleGotoLinkState(editor)\n });\n editor.ui.registry.addButton('unlink', {\n icon: 'unlink',\n tooltip: 'Remove link',\n onAction: function () { return unlink(editor); },\n onSetup: toggleUnlinkState(editor)\n });\n };\n var setupMenuItems = function (editor) {\n editor.ui.registry.addMenuItem('openlink', {\n text: 'Open link',\n icon: 'new-tab',\n onAction: gotoSelectedLink(editor),\n onSetup: toggleGotoLinkState(editor)\n });\n editor.ui.registry.addMenuItem('link', {\n icon: 'link',\n text: 'Link...',\n shortcut: 'Meta+K',\n onSetup: toggleLinkMenuState(editor),\n onAction: openDialog(editor)\n });\n editor.ui.registry.addMenuItem('unlink', {\n icon: 'unlink',\n text: 'Remove link',\n onAction: function () { return unlink(editor); },\n onSetup: toggleUnlinkState(editor)\n });\n };\n var setupContextMenu = function (editor) {\n var inLink = 'link unlink openlink';\n var noLink = 'link';\n editor.ui.registry.addContextMenu('link', {\n update: function (element) {\n var isEditable = editor.dom.isEditable(element);\n if (!isEditable) {\n return '';\n }\n return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink;\n }\n });\n };\n var setupContextToolbars = function (editor) {\n var collapseSelectionToEnd = function (editor) {\n editor.selection.collapse(false);\n };\n var onSetupLink = function (buttonApi) {\n var node = editor.selection.getNode();\n buttonApi.setEnabled(isInAnchor(editor, node));\n return noop;\n };\n var getLinkText = function (value) {\n var anchor = getAnchorElement(editor);\n var onlyText = isOnlyTextSelected(editor);\n if (anchor.isNone() && onlyText) {\n var text = getAnchorText(editor.selection, anchor);\n return someIf(text.length === 0, value);\n }\n else {\n return Optional.none();\n }\n };\n editor.ui.registry.addContextForm('quicklink', {\n launch: {\n type: 'contextformtogglebutton',\n icon: 'link',\n tooltip: 'Link',\n onSetup: toggleLinkState(editor)\n },\n label: 'Link',\n predicate: function (node) { return hasContextToolbar(editor) && isInAnchor(editor, node); },\n initValue: function () {\n var elm = getAnchorElement(editor);\n return elm.fold(constant(''), getHref);\n },\n commands: [\n {\n type: 'contextformtogglebutton',\n icon: 'link',\n tooltip: 'Link',\n primary: true,\n onSetup: function (buttonApi) {\n var node = editor.selection.getNode();\n buttonApi.setActive(isInAnchor(editor, node));\n return toggleLinkState(editor)(buttonApi);\n },\n onAction: function (formApi) {\n var value = formApi.getValue();\n var text = getLinkText(value);\n var attachState = {\n href: value,\n attach: noop\n };\n link(editor, attachState, {\n href: value,\n text: text,\n title: Optional.none(),\n rel: Optional.none(),\n target: Optional.none(),\n class: Optional.none()\n });\n collapseSelectionToEnd(editor);\n formApi.hide();\n }\n },\n {\n type: 'contextformbutton',\n icon: 'unlink',\n tooltip: 'Remove link',\n onSetup: onSetupLink,\n onAction: function (formApi) {\n unlink(editor);\n formApi.hide();\n }\n },\n {\n type: 'contextformbutton',\n icon: 'new-tab',\n tooltip: 'Open link',\n onSetup: onSetupLink,\n onAction: function (formApi) {\n gotoSelectedLink(editor)();\n formApi.hide();\n }\n }\n ]\n });\n };\n var Plugin = function () {\n global$5.add('link', function (editor) {\n register$1(editor);\n setupButtons(editor);\n setupMenuItems(editor);\n setupContextMenu(editor);\n setupContextToolbars(editor);\n setupGotoLinks(editor);\n register(editor);\n setup(editor);\n });\n };\n Plugin();\n})();\n"],"names":["__assign","this","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","global$5","tinymce","util","Tools","resolve","isType","type","value","x","Array","isArray","o","v","constructor","String","isPrototypeOf","_a","name","isSimpleType","isString","isObject","isNull","a","isBoolean","isNonNullable","isNullable","isFunction","isArrayOf","pred","len","noop","tripleEquals","b","Optional","tag","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","concat","nativeIndexOf","indexOf","nativePush","push","contains","xs","ts","rawIndexOf","flatten","r","f","findMap","arr","is","lhs","rhs","comparator","left","cat","someIf","option","editor","options","get","assumeExternalTargets","hasContextToolbar","getLinkList","getDefaultLinkTarget","getDefaultLinkProtocol","getTargetList","getRelList","getLinkClassList","shouldShowLinkTitle","allowUnsafeLinkTarget","useQuickLink","global$4","getValue","item","sanitizeList","list","extractValue","out","text","title","getText","undefined","menu","items","sanitizeWith","extracter","ListOptions","sanitize","createUi","label","keys","internalFilter","obj","onTrue","onFalse","props","k","has","key","global$3","global$2","isAnchor","elm","nodeName","toLowerCase","isLink","getHref","collectNodesInRange","rng","collapsed","contents","cloneContents","firstChild","walker","elements","current","next","hasProtocol","url","test","_b","getAttribute","applyRelTargetRules","rel","isUnsafe","rules","rels","split","removeTargetRules","val","inArray","newRels","addTargetRules","trim","sort","join","getAnchorElement","selectedElm","getLinksInSelection","selection","getRng","getNode","isImageFigure","dom","select","getParent","isInAnchor","getAnchorText","anchorElm","replace","trimCaretContainers","getContent","format","innerText","textContent","getLinks$1","grep","hasLinks","isOnlyTextSelected","inlineTextElements","schema","getTextInlineElements","anchor","hasAttribute","nodeType","className","applyLinkOverrides","linkAttrs","newLinkAttrs","newRel","target","href","handleExternalTargets","linkDomMutation","attachState","data","acc","each$1","getLinkAttrs","undoManager","transact","attach","linkImageFigure","execCommand","insertContent","createHTML","encode","createLink","focus","setAttribs","updateLink","unwrapOptions","cls","class","_k","link","sanitizedData","getOption","uriOptions","allow_html_data_urls","allow_script_urls","allow_svg_data_urls","isDomSafe","sanitizeData","hasPlugin","unlink","node","unlinkImageFigure","bookmark","getBookmark","cloneRange","startAnchorElm","startContainer","getBody","endAnchorElm","endContainer","setStartBefore","setEndAfter","setRng","moveToBookmark","unlinkSelection","unlinkDomMutation","fig","img","getParents","parentNode","insertBefore","remove","attrs","create","appendChild","isListGroup","findTextByValue","catalog","getDelta","persistentText","fieldName","hasPersistentText","meta","DialogChanges","initialData","linkCatalog","persistentData","onUrlChange","getTitleFromUrlChange","onCatalogChange","change","catalogs","onChange","getData","global$1","tryEmailTransform","preprocess","oldData","tryProtocolTransform","defaultLinkProtocol","DialogConfirms","Promise","transform","callback","setEditorTimeout","windowManager","confirm","state","delayedConfirm","AnchorListOptions","anchorNodes","anchors","id","ClassListOptions","parseJson","JSON","parse","err","LinkListOptions","extractor","convertURL","linkList","fetch","then","res","ok","reject","output","optItems","RelOptions","initialTarget","isTargetBlank_1","fallbacks","TargetOptions","nonEmptyAttr","elem","getAttrib","DialogInfo","linkNode","links","linkClass","extractFromAnchor","targets","classes","optNode","flags","titleEnabled","open$1","anchorNode","collectData","info","onSubmit","api","close","getChangedValue","changedData","pData","handleSubmit","settings","displayText","titleText","defaultTarget","original","getInitialData","dialogDelta","size","body","filetype","picker_text","buttons","primary","_c","newData","setData","makeDialog","spec","open","global","document","createElement","evt","createEvent","initMouseEvent","window","dispatchEvent","removeChild","appendClickRemove","getLink","getSelectedLink","getStart","gotoLink","targetEl","scrollIntoView","openDialog","dialog","gotoSelectedLink","toggleState","toggler","on","off","toggleLinkState","updateState","setActive","mode","isReadOnly","setEnabled","isEditable","toggleLinkMenuState","toggleGotoLinkState","isCollapsed","hasExactlyOneLinkInSelection","toggleUnlinkState","hasLinks$1","parents","updateEnabled","e","setupContextToolbars","onSetupLink","buttonApi","ui","registry","addContextForm","launch","icon","tooltip","onSetup","initValue","commands","onAction","formApi","onlyText","getLinkText","collapse","collapseSelectionToEnd","hide","add","registerOption","register","processor","valid","default","register$1","addToggleButton","addButton","setupButtons","addMenuItem","shortcut","setupMenuItems","addContextMenu","update","element","setupContextMenu","metaKeyPressed","preventDefault","isDefaultPrevented","keyCode","altKey","shiftKey","ctrlKey","metaKey","hasOnlyAltModifier","link_1","setupGotoLinks","addCommand","_ui","dispatch","toolbarKey","addShortcut","setup"],"mappings":"iGAIA,IAAIA,EAAYC,GAAQA,EAAKD,UAAa,WAStC,OARAA,EAAWE,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,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AAUC,EAAK7b,IAC6B,KAAhEA,aAAqC,EAASA,EAAMuX,SAAqBxR,EAAab,GAIvFA,EAAO4W,SAAS,sBAAuB,CAAEC,WAAY,cAHrDvH,GAAOtP,EAKvB,IA0PYgV,CAAShV,GAzJL,SAAUA,GAClBA,EAAO8W,YAAY,SAAU,IAAI,WAC7B9W,EAAO8H,YAAY,UAC/B,IAuJYiP,CAAM/W,EAClB,GAGC,CA9sCD"}
|
1
|
+
{"version":3,"file":"plugin.mjs","sources":["../../../../../public/tinymce/plugins/link/plugin.js"],"sourcesContent":["\"use strict\";\n/**\n * TinyMCE version 6.8.5 (TBD)\n */\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n(function () {\n 'use strict';\n var global$5 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n var hasProto = function (v, constructor, predicate) {\n var _a;\n if (predicate(v, constructor.prototype)) {\n return true;\n }\n else {\n return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;\n }\n };\n var typeOf = function (x) {\n var t = typeof x;\n if (x === null) {\n return 'null';\n }\n else if (t === 'object' && Array.isArray(x)) {\n return 'array';\n }\n else if (t === 'object' && hasProto(x, String, function (o, proto) { return proto.isPrototypeOf(o); })) {\n return 'string';\n }\n else {\n return t;\n }\n };\n var isType = function (type) { return function (value) { return typeOf(value) === type; }; };\n var isSimpleType = function (type) { return function (value) { return typeof value === type; }; };\n var eq = function (t) { return function (a) { return t === a; }; };\n var isString = isType('string');\n var isObject = isType('object');\n var isArray = isType('array');\n var isNull = eq(null);\n var isBoolean = isSimpleType('boolean');\n var isNullable = function (a) { return a === null || a === undefined; };\n var isNonNullable = function (a) { return !isNullable(a); };\n var isFunction = isSimpleType('function');\n var isArrayOf = function (value, pred) {\n if (isArray(value)) {\n for (var i = 0, len = value.length; i < len; ++i) {\n if (!pred(value[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n };\n var noop = function () {\n };\n var constant = function (value) {\n return function () {\n return value;\n };\n };\n var tripleEquals = function (a, b) {\n return a === b;\n };\n var Optional = /** @class */ (function () {\n function Optional(tag, value) {\n this.tag = tag;\n this.value = value;\n }\n Optional.some = function (value) {\n return new Optional(true, value);\n };\n Optional.none = function () {\n return Optional.singletonNone;\n };\n Optional.prototype.fold = function (onNone, onSome) {\n if (this.tag) {\n return onSome(this.value);\n }\n else {\n return onNone();\n }\n };\n Optional.prototype.isSome = function () {\n return this.tag;\n };\n Optional.prototype.isNone = function () {\n return !this.tag;\n };\n Optional.prototype.map = function (mapper) {\n if (this.tag) {\n return Optional.some(mapper(this.value));\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.bind = function (binder) {\n if (this.tag) {\n return binder(this.value);\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.exists = function (predicate) {\n return this.tag && predicate(this.value);\n };\n Optional.prototype.forall = function (predicate) {\n return !this.tag || predicate(this.value);\n };\n Optional.prototype.filter = function (predicate) {\n if (!this.tag || predicate(this.value)) {\n return this;\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.getOr = function (replacement) {\n return this.tag ? this.value : replacement;\n };\n Optional.prototype.or = function (replacement) {\n return this.tag ? this : replacement;\n };\n Optional.prototype.getOrThunk = function (thunk) {\n return this.tag ? this.value : thunk();\n };\n Optional.prototype.orThunk = function (thunk) {\n return this.tag ? this : thunk();\n };\n Optional.prototype.getOrDie = function (message) {\n if (!this.tag) {\n throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');\n }\n else {\n return this.value;\n }\n };\n Optional.from = function (value) {\n return isNonNullable(value) ? Optional.some(value) : Optional.none();\n };\n Optional.prototype.getOrNull = function () {\n return this.tag ? this.value : null;\n };\n Optional.prototype.getOrUndefined = function () {\n return this.value;\n };\n Optional.prototype.each = function (worker) {\n if (this.tag) {\n worker(this.value);\n }\n };\n Optional.prototype.toArray = function () {\n return this.tag ? [this.value] : [];\n };\n Optional.prototype.toString = function () {\n return this.tag ? \"some(\".concat(this.value, \")\") : 'none()';\n };\n return Optional;\n }());\n Optional.singletonNone = new Optional(false);\n var nativeIndexOf = Array.prototype.indexOf;\n var nativePush = Array.prototype.push;\n var rawIndexOf = function (ts, t) { return nativeIndexOf.call(ts, t); };\n var contains = function (xs, x) { return rawIndexOf(xs, x) > -1; };\n var map = function (xs, f) {\n var len = xs.length;\n var r = new Array(len);\n for (var i = 0; i < len; i++) {\n var x = xs[i];\n r[i] = f(x, i);\n }\n return r;\n };\n var each$1 = function (xs, f) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n f(x, i);\n }\n };\n var foldl = function (xs, f, acc) {\n each$1(xs, function (x, i) {\n acc = f(acc, x, i);\n });\n return acc;\n };\n var flatten = function (xs) {\n var r = [];\n for (var 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 var bind = function (xs, f) { return flatten(map(xs, f)); };\n var findMap = function (arr, f) {\n for (var i = 0; i < arr.length; i++) {\n var r = f(arr[i], i);\n if (r.isSome()) {\n return r;\n }\n }\n return Optional.none();\n };\n var is = function (lhs, rhs, comparator) {\n if (comparator === void 0) { comparator = tripleEquals; }\n return lhs.exists(function (left) { return comparator(left, rhs); });\n };\n var cat = function (arr) {\n var r = [];\n var push = function (x) {\n r.push(x);\n };\n for (var i = 0; i < arr.length; i++) {\n arr[i].each(push);\n }\n return r;\n };\n var someIf = function (b, a) { return b ? Optional.some(a) : Optional.none(); };\n var option = function (name) { return function (editor) { return editor.options.get(name); }; };\n var register$1 = function (editor) {\n var registerOption = editor.options.register;\n registerOption('link_assume_external_targets', {\n processor: function (value) {\n var valid = isString(value) || isBoolean(value);\n if (valid) {\n if (value === true) {\n return {\n value: 1,\n valid: valid\n };\n }\n else if (value === 'http' || value === 'https') {\n return {\n value: value,\n valid: valid\n };\n }\n else {\n return {\n value: 0,\n valid: valid\n };\n }\n }\n else {\n return {\n valid: false,\n message: 'Must be a string or a boolean.'\n };\n }\n },\n default: false\n });\n registerOption('link_context_toolbar', {\n processor: 'boolean',\n default: false\n });\n registerOption('link_list', { processor: function (value) { return isString(value) || isFunction(value) || isArrayOf(value, isObject); } });\n registerOption('link_default_target', { processor: 'string' });\n registerOption('link_default_protocol', {\n processor: 'string',\n default: 'https'\n });\n registerOption('link_target_list', {\n processor: function (value) { return isBoolean(value) || isArrayOf(value, isObject); },\n default: true\n });\n registerOption('link_rel_list', {\n processor: 'object[]',\n default: []\n });\n registerOption('link_class_list', {\n processor: 'object[]',\n default: []\n });\n registerOption('link_title', {\n processor: 'boolean',\n default: true\n });\n registerOption('allow_unsafe_link_target', {\n processor: 'boolean',\n default: false\n });\n registerOption('link_quicklink', {\n processor: 'boolean',\n default: false\n });\n };\n var assumeExternalTargets = option('link_assume_external_targets');\n var hasContextToolbar = option('link_context_toolbar');\n var getLinkList = option('link_list');\n var getDefaultLinkTarget = option('link_default_target');\n var getDefaultLinkProtocol = option('link_default_protocol');\n var getTargetList = option('link_target_list');\n var getRelList = option('link_rel_list');\n var getLinkClassList = option('link_class_list');\n var shouldShowLinkTitle = option('link_title');\n var allowUnsafeLinkTarget = option('allow_unsafe_link_target');\n var useQuickLink = option('link_quicklink');\n var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');\n var getValue = function (item) { return isString(item.value) ? item.value : ''; };\n var getText = function (item) {\n if (isString(item.text)) {\n return item.text;\n }\n else if (isString(item.title)) {\n return item.title;\n }\n else {\n return '';\n }\n };\n var sanitizeList = function (list, extractValue) {\n var out = [];\n global$4.each(list, function (item) {\n var text = getText(item);\n if (item.menu !== undefined) {\n var items = sanitizeList(item.menu, extractValue);\n out.push({\n text: text,\n items: items\n });\n }\n else {\n var value = extractValue(item);\n out.push({\n text: text,\n value: value\n });\n }\n });\n return out;\n };\n var sanitizeWith = function (extracter) {\n if (extracter === void 0) { extracter = getValue; }\n return function (list) { return Optional.from(list).map(function (list) { return sanitizeList(list, extracter); }); };\n };\n var sanitize = function (list) { return sanitizeWith(getValue)(list); };\n var createUi = function (name, label) { return function (items) { return ({\n name: name,\n type: 'listbox',\n label: label,\n items: items\n }); }; };\n var ListOptions = {\n sanitize: sanitize,\n sanitizeWith: sanitizeWith,\n createUi: createUi,\n getValue: getValue\n };\n var keys = Object.keys;\n var hasOwnProperty = Object.hasOwnProperty;\n var each = function (obj, f) {\n var props = keys(obj);\n for (var k = 0, len = props.length; k < len; k++) {\n var i = props[k];\n var x = obj[i];\n f(x, i);\n }\n };\n var objAcc = function (r) { return function (x, i) {\n r[i] = x;\n }; };\n var internalFilter = function (obj, pred, onTrue, onFalse) {\n each(obj, function (x, i) {\n (pred(x, i) ? onTrue : onFalse)(x, i);\n });\n };\n var filter = function (obj, pred) {\n var t = {};\n internalFilter(obj, pred, objAcc(t), noop);\n return t;\n };\n var has = function (obj, key) { return hasOwnProperty.call(obj, key); };\n var hasNonNullableKey = function (obj, key) { return has(obj, key) && obj[key] !== undefined && obj[key] !== null; };\n var global$3 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');\n var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI');\n var isAnchor = function (elm) { return isNonNullable(elm) && elm.nodeName.toLowerCase() === 'a'; };\n var isLink = function (elm) { return isAnchor(elm) && !!getHref(elm); };\n var collectNodesInRange = function (rng, predicate) {\n if (rng.collapsed) {\n return [];\n }\n else {\n var contents = rng.cloneContents();\n var firstChild = contents.firstChild;\n var walker = new global$3(firstChild, contents);\n var elements = [];\n var current = firstChild;\n do {\n if (predicate(current)) {\n elements.push(current);\n }\n } while (current = walker.next());\n return elements;\n }\n };\n var hasProtocol = function (url) { return /^\\w+:/i.test(url); };\n var getHref = function (elm) {\n var _a, _b;\n return (_b = (_a = elm.getAttribute('data-mce-href')) !== null && _a !== void 0 ? _a : elm.getAttribute('href')) !== null && _b !== void 0 ? _b : '';\n };\n var applyRelTargetRules = function (rel, isUnsafe) {\n var rules = ['noopener'];\n var rels = rel ? rel.split(/\\s+/) : [];\n var toString = function (rels) { return global$4.trim(rels.sort().join(' ')); };\n var addTargetRules = function (rels) {\n rels = removeTargetRules(rels);\n return rels.length > 0 ? rels.concat(rules) : rules;\n };\n var removeTargetRules = function (rels) { return rels.filter(function (val) { return global$4.inArray(rules, val) === -1; }); };\n var newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels);\n return newRels.length > 0 ? toString(newRels) : '';\n };\n var trimCaretContainers = function (text) { return text.replace(/\\uFEFF/g, ''); };\n var getAnchorElement = function (editor, selectedElm) {\n selectedElm = selectedElm || getLinksInSelection(editor.selection.getRng())[0] || editor.selection.getNode();\n if (isImageFigure(selectedElm)) {\n return Optional.from(editor.dom.select('a[href]', selectedElm)[0]);\n }\n else {\n return Optional.from(editor.dom.getParent(selectedElm, 'a[href]'));\n }\n };\n var isInAnchor = function (editor, selectedElm) { return getAnchorElement(editor, selectedElm).isSome(); };\n var getAnchorText = function (selection, anchorElm) {\n var text = anchorElm.fold(function () { return selection.getContent({ format: 'text' }); }, function (anchorElm) { return anchorElm.innerText || anchorElm.textContent || ''; });\n return trimCaretContainers(text);\n };\n var getLinksInSelection = function (rng) { return collectNodesInRange(rng, isLink); };\n var getLinks$1 = function (elements) { return global$4.grep(elements, isLink); };\n var hasLinks = function (elements) { return getLinks$1(elements).length > 0; };\n var hasLinksInSelection = function (rng) { return getLinksInSelection(rng).length > 0; };\n var isOnlyTextSelected = function (editor) {\n var inlineTextElements = editor.schema.getTextInlineElements();\n var isElement = function (elm) { return elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase()); };\n var isInBlockAnchor = getAnchorElement(editor).exists(function (anchor) { return anchor.hasAttribute('data-mce-block'); });\n if (isInBlockAnchor) {\n return false;\n }\n var rng = editor.selection.getRng();\n if (!rng.collapsed) {\n var elements = collectNodesInRange(rng, isElement);\n return elements.length === 0;\n }\n else {\n return true;\n }\n };\n var isImageFigure = function (elm) { return isNonNullable(elm) && elm.nodeName === 'FIGURE' && /\\bimage\\b/i.test(elm.className); };\n var getLinkAttrs = function (data) {\n var attrs = [\n 'title',\n 'rel',\n 'class',\n 'target'\n ];\n return foldl(attrs, function (acc, key) {\n data[key].each(function (value) {\n acc[key] = value.length > 0 ? value : null;\n });\n return acc;\n }, { href: data.href });\n };\n var handleExternalTargets = function (href, assumeExternalTargets) {\n if ((assumeExternalTargets === 'http' || assumeExternalTargets === 'https') && !hasProtocol(href)) {\n return assumeExternalTargets + '://' + href;\n }\n return href;\n };\n var applyLinkOverrides = function (editor, linkAttrs) {\n var newLinkAttrs = __assign({}, linkAttrs);\n if (getRelList(editor).length === 0 && !allowUnsafeLinkTarget(editor)) {\n var newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank');\n newLinkAttrs.rel = newRel ? newRel : null;\n }\n if (Optional.from(newLinkAttrs.target).isNone() && getTargetList(editor) === false) {\n newLinkAttrs.target = getDefaultLinkTarget(editor);\n }\n newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, assumeExternalTargets(editor));\n return newLinkAttrs;\n };\n var updateLink = function (editor, anchorElm, text, linkAttrs) {\n text.each(function (text) {\n if (has(anchorElm, 'innerText')) {\n anchorElm.innerText = text;\n }\n else {\n anchorElm.textContent = text;\n }\n });\n editor.dom.setAttribs(anchorElm, linkAttrs);\n editor.selection.select(anchorElm);\n };\n var createLink = function (editor, selectedElm, text, linkAttrs) {\n var dom = editor.dom;\n if (isImageFigure(selectedElm)) {\n linkImageFigure(dom, selectedElm, linkAttrs);\n }\n else {\n text.fold(function () {\n editor.execCommand('mceInsertLink', false, linkAttrs);\n }, function (text) {\n editor.insertContent(dom.createHTML('a', linkAttrs, dom.encode(text)));\n });\n }\n };\n var linkDomMutation = function (editor, attachState, data) {\n var selectedElm = editor.selection.getNode();\n var anchorElm = getAnchorElement(editor, selectedElm);\n var linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data));\n editor.undoManager.transact(function () {\n if (data.href === attachState.href) {\n attachState.attach();\n }\n anchorElm.fold(function () {\n createLink(editor, selectedElm, data.text, linkAttrs);\n }, function (elm) {\n editor.focus();\n updateLink(editor, elm, data.text, linkAttrs);\n });\n });\n };\n var unlinkSelection = function (editor) {\n var dom = editor.dom, selection = editor.selection;\n var bookmark = selection.getBookmark();\n var rng = selection.getRng().cloneRange();\n var startAnchorElm = dom.getParent(rng.startContainer, 'a[href]', editor.getBody());\n var endAnchorElm = dom.getParent(rng.endContainer, 'a[href]', editor.getBody());\n if (startAnchorElm) {\n rng.setStartBefore(startAnchorElm);\n }\n if (endAnchorElm) {\n rng.setEndAfter(endAnchorElm);\n }\n selection.setRng(rng);\n editor.execCommand('unlink');\n selection.moveToBookmark(bookmark);\n };\n var unlinkDomMutation = function (editor) {\n editor.undoManager.transact(function () {\n var node = editor.selection.getNode();\n if (isImageFigure(node)) {\n unlinkImageFigure(editor, node);\n }\n else {\n unlinkSelection(editor);\n }\n editor.focus();\n });\n };\n var unwrapOptions = function (data) {\n var cls = data.class, href = data.href, rel = data.rel, target = data.target, text = data.text, title = data.title;\n return filter({\n class: cls.getOrNull(),\n href: href,\n rel: rel.getOrNull(),\n target: target.getOrNull(),\n text: text.getOrNull(),\n title: title.getOrNull()\n }, function (v, _k) { return isNull(v) === false; });\n };\n var sanitizeData = function (editor, data) {\n var getOption = editor.options.get;\n var uriOptions = {\n allow_html_data_urls: getOption('allow_html_data_urls'),\n allow_script_urls: getOption('allow_script_urls'),\n allow_svg_data_urls: getOption('allow_svg_data_urls')\n };\n var href = data.href;\n return __assign(__assign({}, data), { href: global$2.isDomSafe(href, 'a', uriOptions) ? href : '' });\n };\n var link = function (editor, attachState, data) {\n var sanitizedData = sanitizeData(editor, data);\n editor.hasPlugin('rtc', true) ? editor.execCommand('createlink', false, unwrapOptions(sanitizedData)) : linkDomMutation(editor, attachState, sanitizedData);\n };\n var unlink = function (editor) {\n editor.hasPlugin('rtc', true) ? editor.execCommand('unlink') : unlinkDomMutation(editor);\n };\n var unlinkImageFigure = function (editor, fig) {\n var _a;\n var img = editor.dom.select('img', fig)[0];\n if (img) {\n var a = editor.dom.getParents(img, 'a[href]', fig)[0];\n if (a) {\n (_a = a.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(img, a);\n editor.dom.remove(a);\n }\n }\n };\n var linkImageFigure = function (dom, fig, attrs) {\n var _a;\n var img = dom.select('img', fig)[0];\n if (img) {\n var a = dom.create('a', attrs);\n (_a = img.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(a, img);\n a.appendChild(img);\n }\n };\n var isListGroup = function (item) { return hasNonNullableKey(item, 'items'); };\n var findTextByValue = function (value, catalog) { return findMap(catalog, function (item) {\n if (isListGroup(item)) {\n return findTextByValue(value, item.items);\n }\n else {\n return someIf(item.value === value, item);\n }\n }); };\n var getDelta = function (persistentText, fieldName, catalog, data) {\n var value = data[fieldName];\n var hasPersistentText = persistentText.length > 0;\n return value !== undefined ? findTextByValue(value, catalog).map(function (i) { return ({\n url: {\n value: i.value,\n meta: {\n text: hasPersistentText ? persistentText : i.text,\n attach: noop\n }\n },\n text: hasPersistentText ? persistentText : i.text\n }); }) : Optional.none();\n };\n var findCatalog = function (catalogs, fieldName) {\n if (fieldName === 'link') {\n return catalogs.link;\n }\n else if (fieldName === 'anchor') {\n return catalogs.anchor;\n }\n else {\n return Optional.none();\n }\n };\n var init = function (initialData, linkCatalog) {\n var persistentData = {\n text: initialData.text,\n title: initialData.title\n };\n var getTitleFromUrlChange = function (url) {\n var _a;\n return someIf(persistentData.title.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.title).getOr(''));\n };\n var getTextFromUrlChange = function (url) {\n var _a;\n return someIf(persistentData.text.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.text).getOr(url.value));\n };\n var onUrlChange = function (data) {\n var text = getTextFromUrlChange(data.url);\n var title = getTitleFromUrlChange(data.url);\n if (text.isSome() || title.isSome()) {\n return Optional.some(__assign(__assign({}, text.map(function (text) { return ({ text: text }); }).getOr({})), title.map(function (title) { return ({ title: title }); }).getOr({})));\n }\n else {\n return Optional.none();\n }\n };\n var onCatalogChange = function (data, change) {\n var catalog = findCatalog(linkCatalog, change).getOr([]);\n return getDelta(persistentData.text, change, catalog, data);\n };\n var onChange = function (getData, change) {\n var name = change.name;\n if (name === 'url') {\n return onUrlChange(getData());\n }\n else if (contains([\n 'anchor',\n 'link'\n ], name)) {\n return onCatalogChange(getData(), name);\n }\n else if (name === 'text' || name === 'title') {\n persistentData[name] = getData()[name];\n return Optional.none();\n }\n else {\n return Optional.none();\n }\n };\n return { onChange: onChange };\n };\n var DialogChanges = {\n init: init,\n getDelta: getDelta\n };\n var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');\n var delayedConfirm = function (editor, message, callback) {\n var rng = editor.selection.getRng();\n global$1.setEditorTimeout(editor, function () {\n editor.windowManager.confirm(message, function (state) {\n editor.selection.setRng(rng);\n callback(state);\n });\n });\n };\n var tryEmailTransform = function (data) {\n var url = data.href;\n var suggestMailTo = url.indexOf('@') > 0 && url.indexOf('/') === -1 && url.indexOf('mailto:') === -1;\n return suggestMailTo ? Optional.some({\n message: 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?',\n preprocess: function (oldData) { return (__assign(__assign({}, oldData), { href: 'mailto:' + url })); }\n }) : Optional.none();\n };\n var tryProtocolTransform = function (assumeExternalTargets, defaultLinkProtocol) { return function (data) {\n var url = data.href;\n var suggestProtocol = assumeExternalTargets === 1 && !hasProtocol(url) || assumeExternalTargets === 0 && /^\\s*www(\\.|\\d\\.)/i.test(url);\n return suggestProtocol ? Optional.some({\n message: \"The URL you entered seems to be an external link. Do you want to add the required \".concat(defaultLinkProtocol, \":// prefix?\"),\n preprocess: function (oldData) { return (__assign(__assign({}, oldData), { href: defaultLinkProtocol + '://' + url })); }\n }) : Optional.none();\n }; };\n var preprocess = function (editor, data) { return findMap([\n tryEmailTransform,\n tryProtocolTransform(assumeExternalTargets(editor), getDefaultLinkProtocol(editor))\n ], function (f) { return f(data); }).fold(function () { return Promise.resolve(data); }, function (transform) { return new Promise(function (callback) {\n delayedConfirm(editor, transform.message, function (state) {\n callback(state ? transform.preprocess(data) : data);\n });\n }); }); };\n var DialogConfirms = { preprocess: preprocess };\n var getAnchors = function (editor) {\n var anchorNodes = editor.dom.select('a:not([href])');\n var anchors = bind(anchorNodes, function (anchor) {\n var id = anchor.name || anchor.id;\n return id ? [{\n text: id,\n value: '#' + id\n }] : [];\n });\n return anchors.length > 0 ? Optional.some([{\n text: 'None',\n value: ''\n }].concat(anchors)) : Optional.none();\n };\n var AnchorListOptions = { getAnchors: getAnchors };\n var getClasses = function (editor) {\n var list = getLinkClassList(editor);\n if (list.length > 0) {\n return ListOptions.sanitize(list);\n }\n return Optional.none();\n };\n var ClassListOptions = { getClasses: getClasses };\n var parseJson = function (text) {\n try {\n return Optional.some(JSON.parse(text));\n }\n catch (err) {\n return Optional.none();\n }\n };\n var getLinks = function (editor) {\n var extractor = function (item) { return editor.convertURL(item.value || item.url || '', 'href'); };\n var linkList = getLinkList(editor);\n return new Promise(function (resolve) {\n if (isString(linkList)) {\n fetch(linkList).then(function (res) { return res.ok ? res.text().then(parseJson) : Promise.reject(); }).then(resolve, function () { return resolve(Optional.none()); });\n }\n else if (isFunction(linkList)) {\n linkList(function (output) { return resolve(Optional.some(output)); });\n }\n else {\n resolve(Optional.from(linkList));\n }\n }).then(function (optItems) { return optItems.bind(ListOptions.sanitizeWith(extractor)).map(function (items) {\n if (items.length > 0) {\n var noneItem = [{\n text: 'None',\n value: ''\n }];\n return noneItem.concat(items);\n }\n else {\n return items;\n }\n }); });\n };\n var LinkListOptions = { getLinks: getLinks };\n var getRels = function (editor, initialTarget) {\n var list = getRelList(editor);\n if (list.length > 0) {\n var isTargetBlank_1 = is(initialTarget, '_blank');\n var enforceSafe = allowUnsafeLinkTarget(editor) === false;\n var safeRelExtractor = function (item) { return applyRelTargetRules(ListOptions.getValue(item), isTargetBlank_1); };\n var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize;\n return sanitizer(list);\n }\n return Optional.none();\n };\n var RelOptions = { getRels: getRels };\n var fallbacks = [\n {\n text: 'Current window',\n value: ''\n },\n {\n text: 'New window',\n value: '_blank'\n }\n ];\n var getTargets = function (editor) {\n var list = getTargetList(editor);\n if (isArray(list)) {\n return ListOptions.sanitize(list).orThunk(function () { return Optional.some(fallbacks); });\n }\n else if (list === false) {\n return Optional.none();\n }\n return Optional.some(fallbacks);\n };\n var TargetOptions = { getTargets: getTargets };\n var nonEmptyAttr = function (dom, elem, name) {\n var val = dom.getAttrib(elem, name);\n return val !== null && val.length > 0 ? Optional.some(val) : Optional.none();\n };\n var extractFromAnchor = function (editor, anchor) {\n var dom = editor.dom;\n var onlyText = isOnlyTextSelected(editor);\n var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)) : Optional.none();\n var url = anchor.bind(function (anchorElm) { return Optional.from(dom.getAttrib(anchorElm, 'href')); });\n var target = anchor.bind(function (anchorElm) { return Optional.from(dom.getAttrib(anchorElm, 'target')); });\n var rel = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'rel'); });\n var linkClass = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'class'); });\n var title = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'title'); });\n return {\n url: url,\n text: text,\n title: title,\n target: target,\n rel: rel,\n linkClass: linkClass\n };\n };\n var collect = function (editor, linkNode) { return LinkListOptions.getLinks(editor).then(function (links) {\n var anchor = extractFromAnchor(editor, linkNode);\n return {\n anchor: anchor,\n catalogs: {\n targets: TargetOptions.getTargets(editor),\n rels: RelOptions.getRels(editor, anchor.target),\n classes: ClassListOptions.getClasses(editor),\n anchor: AnchorListOptions.getAnchors(editor),\n link: links\n },\n optNode: linkNode,\n flags: { titleEnabled: shouldShowLinkTitle(editor) }\n };\n }); };\n var DialogInfo = { collect: collect };\n var handleSubmit = function (editor, info) { return function (api) {\n var data = api.getData();\n if (!data.url.value) {\n unlink(editor);\n api.close();\n return;\n }\n var getChangedValue = function (key) { return Optional.from(data[key]).filter(function (value) { return !is(info.anchor[key], value); }); };\n var changedData = {\n href: data.url.value,\n text: getChangedValue('text'),\n target: getChangedValue('target'),\n rel: getChangedValue('rel'),\n class: getChangedValue('linkClass'),\n title: getChangedValue('title')\n };\n var attachState = {\n href: data.url.value,\n attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : noop\n };\n DialogConfirms.preprocess(editor, changedData).then(function (pData) {\n link(editor, attachState, pData);\n });\n api.close();\n }; };\n var collectData = function (editor) {\n var anchorNode = getAnchorElement(editor);\n return DialogInfo.collect(editor, anchorNode);\n };\n var getInitialData = function (info, defaultTarget) {\n var anchor = info.anchor;\n var url = anchor.url.getOr('');\n return {\n url: {\n value: url,\n meta: { original: { value: url } }\n },\n text: anchor.text.getOr(''),\n title: anchor.title.getOr(''),\n anchor: url,\n link: url,\n rel: anchor.rel.getOr(''),\n target: anchor.target.or(defaultTarget).getOr(''),\n linkClass: anchor.linkClass.getOr('')\n };\n };\n var makeDialog = function (settings, onSubmit, editor) {\n var urlInput = [{\n name: 'url',\n type: 'urlinput',\n filetype: 'file',\n label: 'URL',\n picker_text: 'Browse links'\n }];\n var displayText = settings.anchor.text.map(function () { return ({\n name: 'text',\n type: 'input',\n label: 'Text to display'\n }); }).toArray();\n var titleText = settings.flags.titleEnabled ? [{\n name: 'title',\n type: 'input',\n label: 'Title'\n }] : [];\n var defaultTarget = Optional.from(getDefaultLinkTarget(editor));\n var initialData = getInitialData(settings, defaultTarget);\n var catalogs = settings.catalogs;\n var dialogDelta = DialogChanges.init(initialData, catalogs);\n var body = {\n type: 'panel',\n items: flatten([\n urlInput,\n displayText,\n titleText,\n cat([\n catalogs.anchor.map(ListOptions.createUi('anchor', 'Anchors')),\n catalogs.rels.map(ListOptions.createUi('rel', 'Rel')),\n catalogs.targets.map(ListOptions.createUi('target', 'Open link in...')),\n catalogs.link.map(ListOptions.createUi('link', 'Link list')),\n catalogs.classes.map(ListOptions.createUi('linkClass', 'Class'))\n ])\n ])\n };\n return {\n title: 'Insert/Edit Link',\n size: 'normal',\n body: 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 initialData: initialData,\n onChange: function (api, _c) {\n var name = _c.name;\n dialogDelta.onChange(api.getData, { name: name }).each(function (newData) {\n api.setData(newData);\n });\n },\n onSubmit: onSubmit\n };\n };\n var open$1 = function (editor) {\n var data = collectData(editor);\n data.then(function (info) {\n var onSubmit = handleSubmit(editor, info);\n return makeDialog(info, onSubmit, editor);\n }).then(function (spec) {\n editor.windowManager.open(spec);\n });\n };\n var register = function (editor) {\n editor.addCommand('mceLink', function (_ui, value) {\n if ((value === null || value === void 0 ? void 0 : value.dialog) === true || !useQuickLink(editor)) {\n open$1(editor);\n }\n else {\n editor.dispatch('contexttoolbar-show', { toolbarKey: 'quicklink' });\n }\n });\n };\n var global = tinymce.util.Tools.resolve('tinymce.util.VK');\n var appendClickRemove = function (link, evt) {\n document.body.appendChild(link);\n link.dispatchEvent(evt);\n document.body.removeChild(link);\n };\n var open = function (url) {\n var link = document.createElement('a');\n link.target = '_blank';\n link.href = url;\n link.rel = 'noreferrer noopener';\n var evt = document.createEvent('MouseEvents');\n evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n appendClickRemove(link, evt);\n };\n var getLink = function (editor, elm) { return editor.dom.getParent(elm, 'a[href]'); };\n var getSelectedLink = function (editor) { return getLink(editor, editor.selection.getStart()); };\n var hasOnlyAltModifier = function (e) {\n return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false;\n };\n var gotoLink = function (editor, a) {\n if (a) {\n var href = getHref(a);\n if (/^#/.test(href)) {\n var targetEl = editor.dom.select(href);\n if (targetEl.length) {\n editor.selection.scrollIntoView(targetEl[0], true);\n }\n }\n else {\n open(a.href);\n }\n }\n };\n var openDialog = function (editor) { return function () {\n editor.execCommand('mceLink', false, { dialog: true });\n }; };\n var gotoSelectedLink = function (editor) { return function () {\n gotoLink(editor, getSelectedLink(editor));\n }; };\n var setupGotoLinks = function (editor) {\n editor.on('click', function (e) {\n var link = getLink(editor, e.target);\n if (link && global.metaKeyPressed(e)) {\n e.preventDefault();\n gotoLink(editor, link);\n }\n });\n editor.on('keydown', function (e) {\n if (!e.isDefaultPrevented() && e.keyCode === 13 && hasOnlyAltModifier(e)) {\n var link_1 = getSelectedLink(editor);\n if (link_1) {\n e.preventDefault();\n gotoLink(editor, link_1);\n }\n }\n });\n };\n var toggleState = function (editor, toggler) {\n editor.on('NodeChange', toggler);\n return function () { return editor.off('NodeChange', toggler); };\n };\n var toggleLinkState = function (editor) { return function (api) {\n var updateState = function () {\n api.setActive(!editor.mode.isReadOnly() && isInAnchor(editor, editor.selection.getNode()));\n api.setEnabled(editor.selection.isEditable());\n };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var toggleLinkMenuState = function (editor) { return function (api) {\n var updateState = function () {\n api.setEnabled(editor.selection.isEditable());\n };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var hasExactlyOneLinkInSelection = function (editor) {\n var links = editor.selection.isCollapsed() ? getLinks$1(editor.dom.getParents(editor.selection.getStart())) : getLinksInSelection(editor.selection.getRng());\n return links.length === 1;\n };\n var toggleGotoLinkState = function (editor) { return function (api) {\n var updateState = function () { return api.setEnabled(hasExactlyOneLinkInSelection(editor)); };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var toggleUnlinkState = function (editor) { return function (api) {\n var hasLinks$1 = function (parents) { return hasLinks(parents) || hasLinksInSelection(editor.selection.getRng()); };\n var parents = editor.dom.getParents(editor.selection.getStart());\n var updateEnabled = function (parents) {\n api.setEnabled(hasLinks$1(parents) && editor.selection.isEditable());\n };\n updateEnabled(parents);\n return toggleState(editor, function (e) { return updateEnabled(e.parents); });\n }; };\n var setup = function (editor) {\n editor.addShortcut('Meta+K', '', function () {\n editor.execCommand('mceLink');\n });\n };\n var setupButtons = function (editor) {\n editor.ui.registry.addToggleButton('link', {\n icon: 'link',\n tooltip: 'Insert/edit link',\n onAction: openDialog(editor),\n onSetup: toggleLinkState(editor)\n });\n editor.ui.registry.addButton('openlink', {\n icon: 'new-tab',\n tooltip: 'Open link',\n onAction: gotoSelectedLink(editor),\n onSetup: toggleGotoLinkState(editor)\n });\n editor.ui.registry.addButton('unlink', {\n icon: 'unlink',\n tooltip: 'Remove link',\n onAction: function () { return unlink(editor); },\n onSetup: toggleUnlinkState(editor)\n });\n };\n var setupMenuItems = function (editor) {\n editor.ui.registry.addMenuItem('openlink', {\n text: 'Open link',\n icon: 'new-tab',\n onAction: gotoSelectedLink(editor),\n onSetup: toggleGotoLinkState(editor)\n });\n editor.ui.registry.addMenuItem('link', {\n icon: 'link',\n text: 'Link...',\n shortcut: 'Meta+K',\n onSetup: toggleLinkMenuState(editor),\n onAction: openDialog(editor)\n });\n editor.ui.registry.addMenuItem('unlink', {\n icon: 'unlink',\n text: 'Remove link',\n onAction: function () { return unlink(editor); },\n onSetup: toggleUnlinkState(editor)\n });\n };\n var setupContextMenu = function (editor) {\n var inLink = 'link unlink openlink';\n var noLink = 'link';\n editor.ui.registry.addContextMenu('link', {\n update: function (element) {\n var isEditable = editor.dom.isEditable(element);\n if (!isEditable) {\n return '';\n }\n return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink;\n }\n });\n };\n var setupContextToolbars = function (editor) {\n var collapseSelectionToEnd = function (editor) {\n editor.selection.collapse(false);\n };\n var onSetupLink = function (buttonApi) {\n var node = editor.selection.getNode();\n buttonApi.setEnabled(isInAnchor(editor, node));\n return noop;\n };\n var getLinkText = function (value) {\n var anchor = getAnchorElement(editor);\n var onlyText = isOnlyTextSelected(editor);\n if (anchor.isNone() && onlyText) {\n var text = getAnchorText(editor.selection, anchor);\n return someIf(text.length === 0, value);\n }\n else {\n return Optional.none();\n }\n };\n editor.ui.registry.addContextForm('quicklink', {\n launch: {\n type: 'contextformtogglebutton',\n icon: 'link',\n tooltip: 'Link',\n onSetup: toggleLinkState(editor)\n },\n label: 'Link',\n predicate: function (node) { return hasContextToolbar(editor) && isInAnchor(editor, node); },\n initValue: function () {\n var elm = getAnchorElement(editor);\n return elm.fold(constant(''), getHref);\n },\n commands: [\n {\n type: 'contextformtogglebutton',\n icon: 'link',\n tooltip: 'Link',\n primary: true,\n onSetup: function (buttonApi) {\n var node = editor.selection.getNode();\n buttonApi.setActive(isInAnchor(editor, node));\n return toggleLinkState(editor)(buttonApi);\n },\n onAction: function (formApi) {\n var value = formApi.getValue();\n var text = getLinkText(value);\n var attachState = {\n href: value,\n attach: noop\n };\n link(editor, attachState, {\n href: value,\n text: text,\n title: Optional.none(),\n rel: Optional.none(),\n target: Optional.none(),\n class: Optional.none()\n });\n collapseSelectionToEnd(editor);\n formApi.hide();\n }\n },\n {\n type: 'contextformbutton',\n icon: 'unlink',\n tooltip: 'Remove link',\n onSetup: onSetupLink,\n onAction: function (formApi) {\n unlink(editor);\n formApi.hide();\n }\n },\n {\n type: 'contextformbutton',\n icon: 'new-tab',\n tooltip: 'Open link',\n onSetup: onSetupLink,\n onAction: function (formApi) {\n gotoSelectedLink(editor)();\n formApi.hide();\n }\n }\n ]\n });\n };\n var Plugin = function () {\n global$5.add('link', function (editor) {\n register$1(editor);\n setupButtons(editor);\n setupMenuItems(editor);\n setupContextMenu(editor);\n setupContextToolbars(editor);\n setupGotoLinks(editor);\n register(editor);\n setup(editor);\n });\n };\n Plugin();\n})();\n"],"names":["__assign","this","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","global$5","tinymce","util","Tools","resolve","isType","type","value","x","Array","isArray","o","v","constructor","String","isPrototypeOf","_a","name","isSimpleType","isString","isObject","isNull","a","isBoolean","isNonNullable","isNullable","isFunction","isArrayOf","pred","len","noop","tripleEquals","b","Optional","tag","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","concat","nativeIndexOf","indexOf","nativePush","push","contains","xs","ts","rawIndexOf","flatten","r","f","findMap","arr","is","lhs","rhs","comparator","left","cat","someIf","option","editor","options","get","assumeExternalTargets","hasContextToolbar","getLinkList","getDefaultLinkTarget","getDefaultLinkProtocol","getTargetList","getRelList","getLinkClassList","shouldShowLinkTitle","allowUnsafeLinkTarget","useQuickLink","global$4","getValue","item","sanitizeList","list","extractValue","out","text","title","getText","undefined","menu","items","sanitizeWith","extracter","ListOptions","sanitize","createUi","label","keys","internalFilter","obj","onTrue","onFalse","props","k","has","key","global$3","global$2","isAnchor","elm","nodeName","toLowerCase","isLink","getHref","collectNodesInRange","rng","collapsed","contents","cloneContents","firstChild","walker","elements","current","next","hasProtocol","url","test","_b","getAttribute","applyRelTargetRules","rel","isUnsafe","rules","rels","split","removeTargetRules","val","inArray","newRels","addTargetRules","trim","sort","join","getAnchorElement","selectedElm","getLinksInSelection","selection","getRng","getNode","isImageFigure","dom","select","getParent","isInAnchor","getAnchorText","anchorElm","replace","trimCaretContainers","getContent","format","innerText","textContent","getLinks$1","grep","hasLinks","isOnlyTextSelected","inlineTextElements","schema","getTextInlineElements","anchor","hasAttribute","nodeType","className","applyLinkOverrides","linkAttrs","newLinkAttrs","newRel","target","href","handleExternalTargets","linkDomMutation","attachState","data","acc","each$1","getLinkAttrs","undoManager","transact","attach","linkImageFigure","execCommand","insertContent","createHTML","encode","createLink","focus","setAttribs","updateLink","unwrapOptions","cls","class","_k","link","sanitizedData","getOption","uriOptions","allow_html_data_urls","allow_script_urls","allow_svg_data_urls","isDomSafe","sanitizeData","hasPlugin","unlink","node","unlinkImageFigure","bookmark","getBookmark","cloneRange","startAnchorElm","startContainer","getBody","endAnchorElm","endContainer","setStartBefore","setEndAfter","setRng","moveToBookmark","unlinkSelection","unlinkDomMutation","fig","img","getParents","parentNode","insertBefore","remove","attrs","create","appendChild","isListGroup","findTextByValue","catalog","getDelta","persistentText","fieldName","hasPersistentText","meta","DialogChanges","initialData","linkCatalog","persistentData","onUrlChange","getTitleFromUrlChange","onCatalogChange","change","catalogs","onChange","getData","global$1","tryEmailTransform","preprocess","oldData","tryProtocolTransform","defaultLinkProtocol","DialogConfirms","Promise","transform","callback","setEditorTimeout","windowManager","confirm","state","delayedConfirm","AnchorListOptions","anchorNodes","anchors","id","ClassListOptions","parseJson","JSON","parse","err","LinkListOptions","extractor","convertURL","linkList","fetch","then","res","ok","reject","output","optItems","RelOptions","initialTarget","isTargetBlank_1","fallbacks","TargetOptions","nonEmptyAttr","elem","getAttrib","DialogInfo","linkNode","links","linkClass","extractFromAnchor","targets","classes","optNode","flags","titleEnabled","open$1","anchorNode","collectData","info","onSubmit","api","close","getChangedValue","changedData","pData","handleSubmit","settings","displayText","titleText","defaultTarget","original","getInitialData","dialogDelta","size","body","filetype","picker_text","buttons","primary","_c","newData","setData","makeDialog","spec","open","global","document","createElement","evt","createEvent","initMouseEvent","window","dispatchEvent","removeChild","appendClickRemove","getLink","getSelectedLink","getStart","gotoLink","targetEl","scrollIntoView","openDialog","dialog","gotoSelectedLink","toggleState","toggler","on","off","toggleLinkState","updateState","setActive","mode","isReadOnly","setEnabled","isEditable","toggleLinkMenuState","toggleGotoLinkState","isCollapsed","hasExactlyOneLinkInSelection","toggleUnlinkState","hasLinks$1","parents","updateEnabled","e","setupContextToolbars","onSetupLink","buttonApi","ui","registry","addContextForm","launch","icon","tooltip","onSetup","initValue","commands","onAction","formApi","onlyText","getLinkText","collapse","collapseSelectionToEnd","hide","add","registerOption","register","processor","valid","default","register$1","addToggleButton","addButton","setupButtons","addMenuItem","shortcut","setupMenuItems","addContextMenu","update","element","setupContextMenu","metaKeyPressed","preventDefault","isDefaultPrevented","keyCode","altKey","shiftKey","ctrlKey","metaKey","hasOnlyAltModifier","link_1","setupGotoLinks","addCommand","_ui","dispatch","toolbarKey","addShortcut","setup"],"mappings":"kGAIA,IAAIA,EAAYC,GAAQA,EAAKD,UAAa,WAStC,OARAA,EAAWE,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,GAEJJ,EAASc,MAAMb,KAAMO,mBAEhC,WAEI,IA2BmBJ,EA3BfW,EAAWC,QAAQC,KAAKC,MAAMC,QAAQ,yBAyBtCC,EAAS,SAAUC,GAAQ,OAAO,SAAUC,GAAS,OAdjDlB,SADemB,EAegDD,IAbzD,OAANC,EACO,OAEI,WAANnB,GAAkBoB,MAAMC,QAAQF,GAC9B,QAEI,WAANnB,IAAgDsB,EAjBpCC,EAiBeJ,GAjBZK,EAiBeC,QAfVlB,UAeqDmB,cAAcJ,KAX3D,QAAxBK,EAAKJ,EAAEC,mBAAgC,IAAPG,OAAgB,EAASA,EAAGC,QAAUJ,EAAYI,MAYpF,SAGA5B,KAGmEiB,EAfrE,IAAUE,EATEI,EAAGC,EACpBG,EASA3B,EAOqDsB,CAO0B,CAAG,EACtFO,EAAe,SAAUZ,GAAQ,OAAO,SAAUC,GAAS,cAAcA,IAAUD,CAAK,CAAG,EAE3Fa,EAAWd,EAAO,UAClBe,EAAWf,EAAO,UAClBK,EAAUL,EAAO,SACjBgB,GAJehC,EAIH,KAJe,SAAUiC,GAAK,OAAOjC,IAAMiC,CAAI,GAK3DC,EAAYL,EAAa,WAEzBM,EAAgB,SAAUF,GAAK,OADlB,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