!function(L){L.ui.Factory.add("WPLinkPreview",L.ui.Control.extend({url:"#",renderHtml:function(){return'<div id="'+this._id+'" class="wp-link-preview"><a href="'+this.url+'" target="_blank" rel="noopener" tabindex="-1">'+this.url+"</a></div>"},setURL:function(e){varn,t;this.url!==e&&(this.url=e,40<(e=""===(e="/"===(e=(e=-1!==(n=(e=-1!==(n=(e=(e=window.decodeURIComponent(e)).replace(/^(?:https?:)?\/\/(?:www\.)?/,"")).indexOf("?"))?e.slice(0,n):e).indexOf("#"))?e.slice(0,n):e).replace(/(?:index)?\.html$/,"")).charAt(e.length-1)?e.slice(0,-1):e)?this.url:e).length&&-1!==(n=e.indexOf("/"))&&-1!==(t=e.lastIndexOf("/"))&&t!==n&&(n+e.length-t<40&&(t=-(40-(n+1))),e=e.slice(0,n+1)+"\u2026"+e.slice(t)),L.$(this.getEl().firstChild).attr("href",this.url).text(e))}})),L.ui.Factory.add("WPLinkInput",L.ui.Control.extend({renderHtml:function(){return'<div id="'+this._id+'" class="wp-link-input"><label for="'+this._id+'_label">'+L.translate("Paste URL or type to search")+'</label><input id="'+this._id+'_label" type="text" value="" /><input type="text" style="display:none" value="" /></div>'},setURL:function(e){this.getEl().firstChild.nextSibling.value=e},getURL:function(){returnL.trim(this.getEl().firstChild.nextSibling.value)},getLinkText:function(){vare=this.getEl().firstChild.nextSibling.nextSibling.value;returnL.trim(e)?e.replace(/[\r\n\t ]+/g," "):""},reset:function(){vare=this.getEl().firstChild.nextSibling;e.value="",e.nextSibling.value=""}})),L.PluginManager.add("wplink",function(l){vara,r,d,c,i,t,n,p=window.jQuery,o=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i,s=/^https?:\/\/([^\s/?.#-][^\s\/?.#]*\.?)+(\/[^\s"]*)?$/i,u=/^https?:\/\/[^\/]+\.[^\/]+($|\/)/i,w=void0!==window.wp&&window.wp.a11y&&window.wp.a11y.speak?window.wp.a11y.speak:function(){},k=!1,m=window.wp.i18n.__,f=window.wp.i18n._n,h=window.wp.i18n.sprintf;function_(){l.$("a").each(function(e,n){vart=l.$(n);"_wp_link_placeholder"===t.attr("href")?l.dom.remove(n,!0):t.attr("data-wplink-edit")&&t.attr("data-wplink-edit",null)})}functionv(e,i){returne.replace(/(<a [^>]+>)([\s\S]*?)<\/a>/g,function(e,n,t){return-1<n.indexOf(' href="_wp_link_placeholder"')?t:(n=(n=i?n.replace(/ data-wplink-edit="true"/g,""):n).replace(/ data-wplink-url-error="true"/g,""))+t+"</a>"})}functiong(e){vare=l.$(e),n=e.attr("href");n&&void0!==p&&(k=!1,!/^http/i.test(n)||s.test(n)&&u.test(n)?e.removeAttr("data-wplink-url-error"):(k=!0,e.attr("data-wplink-url-error","true"),w(l.translate("Warning: the link has been inserted but may have errors. Please test it."),"assertive")))}returnl.on("preinit",function(){vare;l.wp&&l.wp._createToolbar&&(a=l.wp._createToolbar(["wp_link_preview","wp_link_edit","wp_link_remove"],!0),e=["wp_link_input","wp_link_apply"],void0!==window.wpLink&&e.push("wp_link_advanced"),(r=l.wp._createToolbar(e,!0)).on("show",function(){void0!==window.wpLink&&window.wpLink.modalOpen||window.setTimeout(function(){vare=r.$el.find("input.ui-autocomplete-input")[0],n=i&&(i.textContent||i.innerText);e&&(!e.value&&n&&void0!==window.wpLink&&(e.value=window.wpLink.getUrlFromSelection(n)),t||(e.focus(),e.select()))})}),r.on("hide",function(){r.scrolling||l.execCommand("wp_link_cancel")}))}),l.addCommand("WP_Link",function(){vare,n,t;L.Env.ie&&L.Env.ie<10&&void0!==window.wpLink?window.wpLink.open(l.id):(n=l.selection.getStart(),(t=l.dom.getParent(n,"a[href]"))||(e=l.selection.getContent({format:"raw"}))&&-1!==e.indexOf("</a>")&&(t=(e=e.match(/href="([^">]+)"/))&&e[1]?l.$('a[href="'+e[1]+'"]',n)[0]:t)&&l.selection.select(t),i=t,r.tempHide=!1,i||(_(),l.execCommand("mceInsertLink",!1,{href:"_wp_link_placeholder"}),i=l.$('a[href="_wp_link_placeholder"]')[0],l.nodeChanged()),l.dom.setAttribs(i,{"data-wplink-edit":!0}))}),l.addCommand("wp_link_apply",function(){if(!r.scrolling){vare,n;if(i){e=c.getURL(),n=c.getLinkText(),l.focus();vart=document.createElement("a");if(t.href=e,!(e="javascript:"!==t.protocol&&"data:"!==t.protocol?e:""))returnvoidl.dom.remove(i,!0);/^(?:[a-z]+:|#|\?|\.|\/)/.test(e)||o.test(e)||(e="http://"+e),l.dom.setAttribs(i,{href:e,"data-wplin