!function(){"use strict";vare=tinymce.util.Tools.resolve("tinymce.PluginManager");constt=e=>t=>(e=>{constt=typeofe;returnnull===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(r=a=e,(o=String).prototype.isPrototypeOf(r)||(null===(s=a.constructor)||void0===s?void0:s.name)===o.name)?"string":t;varr,a,o,s})(t)===e,r=t("string"),a=t("object"),o=t("array"),s=e=>!(e=>null==e)(e);classi{constructor(e,t){this.tag=e,this.value=t}staticsome(e){returnnewi(!0,e)}staticnone(){returni.singletonNone}fold(e,t){returnthis.tag?t(this.value):e()}isSome(){returnthis.tag}isNone(){return!this.tag}map(e){returnthis.tag?i.some(e(this.value)):i.none()}bind(e){returnthis.tag?e(this.value):i.none()}exists(e){returnthis.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:i.none()}getOr(e){returnthis.tag?this.value:e}or(e){returnthis.tag?this:e}getOrThunk(e){returnthis.tag?this.value:e()}orThunk(e){returnthis.tag?this:e()}getOrDie(e){if(this.tag)returnthis.value;thrownewError(null!=e?e:"Called getOrDie on None")}staticfrom(e){returns(e)?i.some(e):i.none()}getOrNull(){returnthis.tag?this.value:null}getOrUndefined(){returnthis.value}each(e){this.tag&&e(this.value)}toArray(){returnthis.tag?[this.value]:[]}toString(){returnthis.tag?`some(${this.value})`:"none()"}}i.singletonNone=newi(!1);constn=Array.prototype.push,c=(e,t)=>{for(letr=0,a=e.length;r<a;r++)t(e[r],r)},l=e=>{constt=[];for(letr=0,a=e.length;r<a;++r){if(!o(e[r]))thrownewError("Arr.flatten item "+r+" was not an array, input: "+e);n.apply(t,e[r])}returnt},m=Object.keys,u=Object.hasOwnProperty,d=(e,t)=>h(e,t)?i.from(e[t]):i.none(),h=(e,t)=>u.call(e,t),p=e=>t=>t.options.get(e),g=p("audio_template_callback"),b=p("video_template_callback"),w=p("iframe_template_callback"),v=p("media_live_embeds"),f=p("media_filter_html"),y=p("media_url_resolver"),x=p("media_alt_source"),_=p("media_poster"),j=p("media_dimensions");vark=tinymce.util.Tools.resolve("tinymce.util.Tools"),O=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),A=tinymce.util.Tools.resolve("tinymce.html.DomParser");constS=O.DOM,C=e=>e.replace(/px$/,""),D=e=>{constt=e.attr("style"),r=t?S.parseStyle(t):{};return{type:"ephox-embed-iri",source:e.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:d(r,"max-width").map(C).getOr(""),height:d(r,"max-height").map(C).getOr("")}},T=(e,t)=>{letr={};for(leta=A({validate:!1,forced_root_block:!1},t).parse(e);a;a=a.walk())if(1===a.type){conste=a.name;if(a.attr("data-ephox-embed-iri")){r=D(a);break}r.source||"param"!==e||(r.source=a.attr("movie")),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=k.extend(a.attributes.map,r)),"script"===e&&(r={type:"script",source:a.attr("src")}),"source"===e&&(r.source?r.altsource||(r.altsource=a.attr("src")):r.source=a.attr("src")),"img"!==e||r.poster||(r.poster=a.attr("src"))}returnr.source=r.source||r.src||"",r.altsource=r.altsource||"",r.poster=r.poster||"",r},z=e=>{vart;constr=null!==(t=e.toLowerCase().split(".").pop())&&void0!==t?t:"";returnd({mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},r).getOr("")};var$=tinymce.util.Tools.resolve("tinymce.html.Node"),M=tinymce.util.Tools.resolve("tinymce.html.Serializer");constF=(e,t={})=>A({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...t},e),N=O.DOM,R=e=>/^[0-9.]+$/.test(e)?e+"px":e,U=(e,t)=>{constr=t.attr("style"),a=r?N.parseStyle(r):{};s(e.width)&&(a["max-width"]=R(e.width)),s(e.height)&&(a["max-height"]=R(e.height)),t.attr("style",N.serializeStyle(a))},P=["source","altsource"],E=(e,t,r,a)=>{leto=0,s=0;consti=F(a);i.addNodeFilter("source",(e=>o=e.length));constn=i.parse(e);for(lete=n;e;e=e.walk())if(1===e.type){consta=e.name;if(e.attr("data-ephox-embed-iri")){U(t,e);break}switch(a){case"video":case"object":case"embed":case"img":case"iframe":void0!==t.height&&void0!==t.width&&(e.attr("width",t.width),e.attr("height",t.height))}if(r)switch(a){case"