summaryrefslogtreecommitdiffstats
path: root/web/gui/v2/5575.d6c19cc08835f9f741cf.chunk.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-24 09:54:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-24 09:54:44 +0000
commit836b47cb7e99a977c5a23b059ca1d0b5065d310e (patch)
tree1604da8f482d02effa033c94a84be42bc0c848c3 /web/gui/v2/5575.d6c19cc08835f9f741cf.chunk.js
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.tar.xz
netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.zip
Merging upstream version 1.46.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/gui/v2/5575.d6c19cc08835f9f741cf.chunk.js')
-rw-r--r--web/gui/v2/5575.d6c19cc08835f9f741cf.chunk.js2
1 files changed, 0 insertions, 2 deletions
diff --git a/web/gui/v2/5575.d6c19cc08835f9f741cf.chunk.js b/web/gui/v2/5575.d6c19cc08835f9f741cf.chunk.js
deleted file mode 100644
index b5e3bdb8..00000000
--- a/web/gui/v2/5575.d6c19cc08835f9f741cf.chunk.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see 5575.d6c19cc08835f9f741cf.chunk.js.LICENSE.txt */
-!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bea5ed86-d1e2-4afe-87e2-f96bf23bb7a8",e._sentryDebugIdIdentifier="sentry-dbid-bea5ed86-d1e2-4afe-87e2-f96bf23bb7a8")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"8b7b01b6c705cf50f8050ce0fb8fc6b58fe68567"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[5575],{7836:function(e){e.exports=function(e){var t={},n=arguments[1];if("string"===typeof n){n={};for(var i=1;i<arguments.length;i++)n[arguments[i]]=!0}for(var o in e)n[o]||(t[o]=e[o]);return t}},69748:function(e,t,n){var i;"classList"in document.createElement("_")||function(e){"use strict";if("Element"in e){var t="classList",n="prototype",i=e.Element[n],o=Object,s=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[n].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},l=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return r.call(e,t)},c=function(e){for(var t=s.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],i=0,o=n.length;i<o;i++)this.push(n[i]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=c[n]=[],d=function(){return new c(this)};if(a[n]=Error[n],u.item=function(e){return this[e]||null},u.contains=function(e){return-1!==l(this,e+="")},u.add=function(){var e,t=arguments,n=0,i=t.length,o=!1;do{-1===l(this,e=t[n]+"")&&(this.push(e),o=!0)}while(++n<i);o&&this._updateClassName()},u.remove=function(){var e,t,n=arguments,i=0,o=n.length,s=!1;do{for(t=l(this,e=n[i]+"");-1!==t;)this.splice(t,1),s=!0,t=l(this,e)}while(++i<o);s&&this._updateClassName()},u.toggle=function(e,t){e+="";var n=this.contains(e),i=n?!0!==t&&"remove":!1!==t&&"add";return i&&this[i](e),!0===t||!1===t?t:!n},u.toString=function(){return this.join(" ")},o.defineProperty){var h={get:d,enumerable:!0,configurable:!0};try{o.defineProperty(i,t,h)}catch(m){-2146823252===m.number&&(h.enumerable=!1,o.defineProperty(i,t,h))}}else o[n].__defineGetter__&&i.__defineGetter__(t,d)}}(self),function(e){"use strict";if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{return void new Blob}catch(i){}var t=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||function(e){var t=function(e){return Object.prototype.toString.call(e).match(/^\[object\s(.*)\]$/)[1]},n=function(){this.data=[]},i=function(e,t,n){this.data=e,this.size=e.length,this.type=t,this.encoding=n},o=n.prototype,s=i.prototype,r=e.FileReaderSync,a=function(e){this.code=this[this.name=e]},l="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),c=l.length,u=e.URL||e.webkitURL||e,d=u.createObjectURL,h=u.revokeObjectURL,m=u,f=e.btoa,p=e.atob,g=e.ArrayBuffer,b=e.Uint8Array,v=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(i.fake=s.fake=!0;c--;)a.prototype[l[c]]=c+1;return u.createObjectURL||(m=e.URL=function(e){var t,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");return n.href=e,"origin"in n||("data:"===n.protocol.toLowerCase()?n.origin=null:(t=e.match(v),n.origin=t&&t[1])),n}),m.createObjectURL=function(e){var t,n=e.type;return null===n&&(n="application/octet-stream"),e instanceof i?(t="data:"+n,"base64"===e.encoding?t+";base64,"+e.data:"URI"===e.encoding?t+","+decodeURIComponent(e.data):f?t+";base64,"+f(e.data):t+","+encodeURIComponent(e.data)):d?d.call(u,e):void 0},m.revokeObjectURL=function(e){"data:"!==e.substring(0,5)&&h&&h.call(u,e)},o.append=function(e){var n=this.data;if(b&&(e instanceof g||e instanceof b)){for(var o="",s=new b(e),l=0,c=s.length;l<c;l++)o+=String.fromCharCode(s[l]);n.push(o)}else if("Blob"===t(e)||"File"===t(e)){if(!r)throw new a("NOT_READABLE_ERR");var u=new r;n.push(u.readAsBinaryString(e))}else e instanceof i?"base64"===e.encoding&&p?n.push(p(e.data)):"URI"===e.encoding?n.push(decodeURIComponent(e.data)):"raw"===e.encoding&&n.push(e.data):("string"!==typeof e&&(e+=""),n.push(unescape(encodeURIComponent(e))))},o.getBlob=function(e){return arguments.length||(e=null),new i(this.data.join(""),e,"raw")},o.toString=function(){return"[object BlobBuilder]"},s.slice=function(e,t,n){var o=arguments.length;return o<3&&(n=null),new i(this.data.slice(e,o>1?t:this.data.length),n,this.encoding)},s.toString=function(){return"[object Blob]"},s.close=function(){this.size=0,delete this.data},n}(e);e.Blob=function(e,n){var i=n&&n.type||"",o=new t;if(e)for(var s=0,r=e.length;s<r;s++)Uint8Array&&e[s]instanceof Uint8Array?o.append(e[s].buffer):o.append(e[s]);var a=o.getBlob(i);return!a.slice&&a.webkitSlice&&(a.slice=a.webkitSlice),a};var n=Object.getPrototypeOf||function(e){return e.__proto__};e.Blob.prototype=n(new e.Blob)}("undefined"!==typeof self&&self||"undefined"!==typeof window&&window||this.content||this),function(o,s){"use strict";"undefined"!==typeof process&&process&&process.versions&&process.versions.electron?void 0===(i=function(){return s}.call(t,n,t,e))||(e.exports=i):e.exports=s}(0,function(){"use strict";function e(e,t){return this.init(e,t)}return e.extensions={},function(t){function n(e,t){var n,i=Array.prototype.slice.call(arguments,2);t=t||{};for(var o=0;o<i.length;o++){var s=i[o];if(s)for(n in s)s.hasOwnProperty(n)&&"undefined"!==typeof s[n]&&(e||!1===t.hasOwnProperty(n))&&(t[n]=s[n])}return t}var i=!1;try{var o=document.createElement("div"),s=document.createTextNode(" ");o.appendChild(s),i=o.contains(s)}catch(a){}var r={isIE:"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&null!==new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent),isEdge:null!==/Edge\/\d+/.exec(navigator.userAgent),isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:t.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(e){return!!(r.isMac&&e.metaKey||!r.isMac&&e.ctrlKey)},isKey:function(e,t){var n=r.getKeyCode(e);return!1===Array.isArray(t)?n===t:-1!==t.indexOf(n)},getKeyCode:function(e){var t=e.which;return null===t&&(t=null!==e.charCode?e.charCode:e.keyCode),t},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var e=[!0].concat(Array.prototype.slice.call(arguments));return n.apply(this,e)},defaults:function(){var e=[!1].concat(Array.prototype.slice.call(arguments));return n.apply(this,e)},createLink:function(e,t,n,i){var o=e.createElement("a");return r.moveTextRangeIntoElement(t[0],t[t.length-1],o),o.setAttribute("href",n),i&&("_blank"===i&&o.setAttribute("rel","noopener noreferrer"),o.setAttribute("target",i)),o},findOrCreateMatchingTextNodes:function(e,t,n){for(var i=e.createTreeWalker(t,NodeFilter.SHOW_ALL,null,!1),o=[],s=0,a=!1,l=null,c=null;null!==(l=i.nextNode());)if(!(l.nodeType>3))if(3===l.nodeType){if(!a&&n.start<s+l.nodeValue.length&&(a=!0,c=r.splitStartNodeIfNeeded(l,n.start,s)),a&&r.splitEndNodeIfNeeded(l,c,n.end,s),a&&s===n.end)break;if(a&&s>n.end+1)throw new Error("PerformLinking overshot the target!");a&&o.push(c||l),s+=l.nodeValue.length,null!==c&&(s+=c.nodeValue.length,i.nextNode()),c=null}else"img"===l.tagName.toLowerCase()&&(!a&&n.start<=s&&(a=!0),a&&o.push(l));return o},splitStartNodeIfNeeded:function(e,t,n){return t!==n?e.splitText(t-n):null},splitEndNodeIfNeeded:function(e,t,n,i){var o,s;o=i+e.nodeValue.length+(t?t.nodeValue.length:0)-1,s=n-i-(t?e.nodeValue.length:0),o>=n&&i!==o&&0!==s&&(t||e).splitText(s)},splitByBlockElements:function(t){if(3!==t.nodeType&&1!==t.nodeType)return[];var n=[],i=e.util.blockContainerElementNames.join(",");if(3===t.nodeType||0===t.querySelectorAll(i).length)return[t];for(var o=0;o<t.childNodes.length;o++){var s=t.childNodes[o];if(3===s.nodeType)n.push(s);else if(1===s.nodeType){0===s.querySelectorAll(i).length?n.push(s):n=n.concat(e.util.splitByBlockElements(s))}}return n},findAdjacentTextNodeWithContent:function(e,t,n){var i,o=!1,s=n.createNodeIterator(e,NodeFilter.SHOW_TEXT,null,!1);for(i=s.nextNode();i;){if(i===t)o=!0;else if(o&&3===i.nodeType&&i.nodeValue&&i.nodeValue.trim().length>0)break;i=s.nextNode()}return i},findPreviousSibling:function(e){if(!e||r.isMediumEditorElement(e))return!1;for(var t=e.previousSibling;!t&&!r.isMediumEditorElement(e.parentNode);)t=(e=e.parentNode).previousSibling;return t},isDescendant:function(e,t,n){if(!e||!t)return!1;if(e===t)return!!n;if(1!==e.nodeType)return!1;if(i||3!==t.nodeType)return e.contains(t);for(var o=t.parentNode;null!==o;){if(o===e)return!0;o=o.parentNode}return!1},isElement:function(e){return!(!e||1!==e.nodeType)},throttle:function(e,t){var n,i,o,s=null,r=0,a=function(){r=Date.now(),s=null,o=e.apply(n,i),s||(n=i=null)};return t||0===t||(t=50),function(){var l=Date.now(),c=t-(l-r);return n=this,i=arguments,c<=0||c>t?(s&&(clearTimeout(s),s=null),r=l,o=e.apply(n,i),s||(n=i=null)):s||(s=setTimeout(a,c)),o}},traverseUp:function(e,t){if(!e)return!1;do{if(1===e.nodeType){if(t(e))return e;if(r.isMediumEditorElement(e))return!1}e=e.parentNode}while(e);return!1},htmlEntities:function(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},insertHTMLCommand:function(t,n){var i,o,s,a,l,c,u,d=!1,h=["insertHTML",!1,n];if(!e.util.isEdge&&t.queryCommandSupported("insertHTML"))try{return t.execCommand.apply(t,h)}catch(m){}if((i=t.getSelection()).rangeCount){if(u=(o=i.getRangeAt(0)).commonAncestorContainer,r.isMediumEditorElement(u)&&!u.firstChild)o.selectNode(u.appendChild(t.createTextNode("")));else if(3===u.nodeType&&0===o.startOffset&&o.endOffset===u.nodeValue.length||3!==u.nodeType&&u.innerHTML===o.toString()){for(;!r.isMediumEditorElement(u)&&u.parentNode&&1===u.parentNode.childNodes.length&&!r.isMediumEditorElement(u.parentNode);)u=u.parentNode;o.selectNode(u)}for(o.deleteContents(),(s=t.createElement("div")).innerHTML=n,a=t.createDocumentFragment();s.firstChild;)l=s.firstChild,c=a.appendChild(l);o.insertNode(a),c&&((o=o.cloneRange()).setStartAfter(c),o.collapse(!0),e.selection.selectRange(t,o)),d=!0}return t.execCommand.callListeners&&t.execCommand.callListeners(h,d),d},execFormatBlock:function(t,n){var i=r.getTopBlockContainer(e.selection.getSelectionStart(t));if("blockquote"===n){if(i&&Array.prototype.slice.call(i.childNodes).some((function(e){return r.isBlockContainer(e)})))return t.execCommand("outdent",!1,null);if(r.isIE)return t.execCommand("indent",!1,n)}if(i&&n===i.nodeName.toLowerCase()&&(n="p"),r.isIE&&(n="<"+n+">"),i&&"blockquote"===i.nodeName.toLowerCase()){if(r.isIE&&"<p>"===n)return t.execCommand("outdent",!1,n);if((r.isFF||r.isEdge)&&"p"===n)return Array.prototype.slice.call(i.childNodes).some((function(e){return!r.isBlockContainer(e)}))&&t.execCommand("formatBlock",!1,n),t.execCommand("outdent",!1,n)}return t.execCommand("formatBlock",!1,n)},setTargetBlank:function(e,t){var n,i=t||!1;if("a"===e.nodeName.toLowerCase())e.target="_blank",e.rel="noopener noreferrer";else for(e=e.getElementsByTagName("a"),n=0;n<e.length;n+=1)!1!==i&&i!==e[n].attributes.href.value||(e[n].target="_blank",e[n].rel="noopener noreferrer")},removeTargetBlank:function(e,t){var n;if("a"===e.nodeName.toLowerCase())e.removeAttribute("target"),e.removeAttribute("rel");else for(e=e.getElementsByTagName("a"),n=0;n<e.length;n+=1)t===e[n].attributes.href.value&&(e[n].removeAttribute("target"),e[n].removeAttribute("rel"))},addClassToAnchors:function(e,t){var n,i,o=t.split(" ");if("a"===e.nodeName.toLowerCase())for(i=0;i<o.length;i+=1)e.classList.add(o[i]);else{var s=e.getElementsByTagName("a");if(0===s.length){var a=r.getClosestTag(e,"a");e=a?[a]:[]}else e=s;for(n=0;n<e.length;n+=1)for(i=0;i<o.length;i+=1)e[n].classList.add(o[i])}},isListItem:function(e){if(!e)return!1;if("li"===e.nodeName.toLowerCase())return!0;for(var t=e.parentNode,n=t.nodeName.toLowerCase();"li"===n||!r.isBlockContainer(t)&&"div"!==n;){if("li"===n)return!0;if(!(t=t.parentNode))return!1;n=t.nodeName.toLowerCase()}return!1},cleanListDOM:function(t,n){if("li"===n.nodeName.toLowerCase()){var i=n.parentElement;"p"===i.parentElement.nodeName.toLowerCase()&&(r.unwrap(i.parentElement,t),e.selection.moveCursor(t,n.firstChild,n.firstChild.textContent.length))}},splitOffDOMTree:function(e,t,n){for(var i=t,o=null,s=!n;i!==e;){var r,a=i.parentNode,l=a.cloneNode(!1),c=s?i:a.firstChild;for(o&&(s?l.appendChild(o):r=o),o=l;c;){var u=c.nextSibling;c===i?(c.hasChildNodes()?c=c.cloneNode(!1):c.parentNode.removeChild(c),c.textContent&&o.appendChild(c),c=s?u:null):(c.parentNode.removeChild(c),(c.hasChildNodes()||c.textContent)&&o.appendChild(c),c=u)}r&&o.appendChild(r),i=a}return o},moveTextRangeIntoElement:function(e,t,n){if(!e||!t)return!1;var i=r.findCommonRoot(e,t);if(!i)return!1;if(t===e){var o=e.parentNode,s=e.nextSibling;return o.removeChild(e),n.appendChild(e),s?o.insertBefore(n,s):o.appendChild(n),n.hasChildNodes()}for(var a,l,c,u=[],d=0;d<i.childNodes.length;d++)if(c=i.childNodes[d],a){if(r.isDescendant(c,t,!0)){l=c;break}u.push(c)}else r.isDescendant(c,e,!0)&&(a=c);var h=l.nextSibling,m=i.ownerDocument.createDocumentFragment();return a===e?(a.parentNode.removeChild(a),m.appendChild(a)):m.appendChild(r.splitOffDOMTree(a,e)),u.forEach((function(e){e.parentNode.removeChild(e),m.appendChild(e)})),l===t?(l.parentNode.removeChild(l),m.appendChild(l)):m.appendChild(r.splitOffDOMTree(l,t,!0)),n.appendChild(m),l.parentNode===i?i.insertBefore(n,l):h?i.insertBefore(n,h):i.appendChild(n),n.hasChildNodes()},depthOfNode:function(e){for(var t=0,n=e;null!==n.parentNode;)n=n.parentNode,t++;return t},findCommonRoot:function(e,t){for(var n=r.depthOfNode(e),i=r.depthOfNode(t),o=e,s=t;n!==i;)n>i?(o=o.parentNode,n-=1):(s=s.parentNode,i-=1);for(;o!==s;)o=o.parentNode,s=s.parentNode;return o},isElementAtBeginningOfBlock:function(e){for(var t;!r.isBlockContainer(e)&&!r.isMediumEditorElement(e);){for(t=e;t=t.previousSibling;)if((3===t.nodeType?t.nodeValue:t.textContent).length>0)return!1;e=e.parentNode}return!0},isMediumEditorElement:function(e){return e&&e.getAttribute&&!!e.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(e){return r.traverseUp(e,(function(e){return r.isMediumEditorElement(e)}))},isBlockContainer:function(e){return e&&3!==e.nodeType&&-1!==r.blockContainerElementNames.indexOf(e.nodeName.toLowerCase())},getClosestBlockContainer:function(e){return r.traverseUp(e,(function(e){return r.isBlockContainer(e)||r.isMediumEditorElement(e)}))},getTopBlockContainer:function(e){var t=!!r.isBlockContainer(e)&&e;return r.traverseUp(e,(function(e){return r.isBlockContainer(e)&&(t=e),!(t||!r.isMediumEditorElement(e))&&(t=e,!0)})),t},getFirstSelectableLeafNode:function(e){for(;e&&e.firstChild;)e=e.firstChild;if("table"===(e=r.traverseUp(e,(function(e){return-1===r.emptyElementNames.indexOf(e.nodeName.toLowerCase())}))).nodeName.toLowerCase()){var t=e.querySelector("th, td");t&&(e=t)}return e},getFirstTextNode:function(e){return r.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),r._getFirstTextNode(e)},_getFirstTextNode:function(e){if(3===e.nodeType)return e;for(var t=0;t<e.childNodes.length;t++){var n=r._getFirstTextNode(e.childNodes[t]);if(null!==n)return n}return null},ensureUrlHasProtocol:function(e){return-1===e.indexOf("://")?"http://"+e:e},warn:function(){void 0!==t.console&&"function"===typeof t.console.warn&&t.console.warn.apply(t.console,arguments)},deprecated:function(e,t,n){var i=e+" is deprecated, please use "+t+" instead.";n&&(i+=" Will be removed in "+n),r.warn(i)},deprecatedMethod:function(e,t,n,i){r.deprecated(e,t,i),"function"===typeof this[t]&&this[t].apply(this,n)},cleanupAttrs:function(e,t){t.forEach((function(t){e.removeAttribute(t)}))},cleanupTags:function(e,t){-1!==t.indexOf(e.nodeName.toLowerCase())&&e.parentNode.removeChild(e)},unwrapTags:function(t,n){-1!==n.indexOf(t.nodeName.toLowerCase())&&e.util.unwrap(t,document)},getClosestTag:function(e,t){return r.traverseUp(e,(function(e){return e.nodeName.toLowerCase()===t.toLowerCase()}))},unwrap:function(e,t){for(var n=t.createDocumentFragment(),i=Array.prototype.slice.call(e.childNodes),o=0;o<i.length;o++)n.appendChild(i[o]);n.childNodes.length?e.parentNode.replaceChild(n,e):e.parentNode.removeChild(e)},guid:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}};e.util=r}(window),function(){var t=function(t){e.util.extend(this,t)};t.extend=function(t){var n,i=this;n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return i.apply(this,arguments)},e.util.extend(n,i);var o=function(){this.constructor=n};return o.prototype=i.prototype,n.prototype=new o,t&&e.util.extend(n.prototype,t),n},t.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(e){return this.base.options[e]}},["execAction","on","off","subscribe","trigger"].forEach((function(e){t.prototype[e]=function(){return this.base[e].apply(this.base,arguments)}})),e.Extension=t}(),function(){function t(t){return e.util.isBlockContainer(t)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var n={findMatchingSelectionParent:function(t,n){var i,o=n.getSelection();return 0!==o.rangeCount&&(i=o.getRangeAt(0).commonAncestorContainer,e.util.traverseUp(i,t))},getSelectionElement:function(t){return this.findMatchingSelectionParent((function(t){return e.util.isMediumEditorElement(t)}),t)},exportSelection:function(e,t){if(!e)return null;var n=null,i=t.getSelection();if(i.rangeCount>0){var o,s=i.getRangeAt(0),r=s.cloneRange();r.selectNodeContents(e),r.setEnd(s.startContainer,s.startOffset),n={start:o=r.toString().length,end:o+s.toString().length},this.doesRangeStartWithImages(s,t)&&(n.startsWithImage=!0);var a=this.getTrailingImageCount(e,n,s.endContainer,s.endOffset);if(a&&(n.trailingImageCount=a),0!==o){var l=this.getIndexRelativeToAdjacentEmptyBlocks(t,e,s.startContainer,s.startOffset);-1!==l&&(n.emptyBlocksIndex=l)}}return n},importSelection:function(e,t,n,i){if(e&&t){var o=n.createRange();o.setStart(t,0),o.collapse(!0);var s,r=t,a=[],l=0,c=!1,u=!1,d=0,h=!1,m=!1,f=null;for((i||e.startsWithImage||"undefined"!==typeof e.emptyBlocksIndex)&&(m=!0);!h&&r;)if(r.nodeType>3)r=a.pop();else{if(3!==r.nodeType||u){if(e.trailingImageCount&&u&&("img"===r.nodeName.toLowerCase()&&d++,d===e.trailingImageCount)){for(var p=0;r.parentNode.childNodes[p]!==r;)p++;o.setEnd(r.parentNode,p+1),h=!0}if(!h&&1===r.nodeType)for(var g=r.childNodes.length-1;g>=0;)a.push(r.childNodes[g]),g-=1}else s=l+r.length,!c&&e.start>=l&&e.start<=s&&(m||e.start<s?(o.setStart(r,e.start-l),c=!0):f=r),c&&e.end>=l&&e.end<=s&&(e.trailingImageCount?u=!0:(o.setEnd(r,e.end-l),h=!0)),l=s;h||(r=a.pop())}!c&&f&&(o.setStart(f,f.length),o.setEnd(f,f.length)),"undefined"!==typeof e.emptyBlocksIndex&&(o=this.importSelectionMoveCursorPastBlocks(n,t,e.emptyBlocksIndex,o)),i&&(o=this.importSelectionMoveCursorPastAnchor(e,o)),this.selectRange(n,o)}},importSelectionMoveCursorPastAnchor:function(t,n){if(t.start===t.end&&3===n.startContainer.nodeType&&n.startOffset===n.startContainer.nodeValue.length&&e.util.traverseUp(n.startContainer,(function(e){return"a"===e.nodeName.toLowerCase()}))){for(var i=n.startContainer,o=n.startContainer.parentNode;null!==o&&"a"!==o.nodeName.toLowerCase();)o.childNodes[o.childNodes.length-1]!==i?o=null:(i=o,o=o.parentNode);if(null!==o&&"a"===o.nodeName.toLowerCase()){for(var s=null,r=0;null===s&&r<o.parentNode.childNodes.length;r++)o.parentNode.childNodes[r]===o&&(s=r);n.setStart(o.parentNode,s+1),n.collapse(!0)}}return n},importSelectionMoveCursorPastBlocks:function(n,i,o,s){var r,a,l=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,t,!1),c=s.startContainer,u=0;for(o=o||1,r=3===c.nodeType&&e.util.isBlockContainer(c.previousSibling)?c.previousSibling:e.util.getClosestBlockContainer(c);l.nextNode();)if(a){if(a=l.currentNode,++u===o)break;if(a.textContent.length>0)break}else r===l.currentNode&&(a=l.currentNode);return a||(a=r),s.setStart(e.util.getFirstSelectableLeafNode(a),0),s},getIndexRelativeToAdjacentEmptyBlocks:function(n,i,o,s){if(o.textContent.length>0&&s>0)return-1;var r=o;if(3!==r.nodeType&&(r=o.childNodes[s]),r){if(!e.util.isElementAtBeginningOfBlock(r))return-1;var a=e.util.findPreviousSibling(r);if(!a)return-1;if(a.nodeValue)return-1}for(var l=e.util.getClosestBlockContainer(o),c=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,t,!1),u=0;c.nextNode();){var d=""===c.currentNode.textContent;if((d||u>0)&&(u+=1),c.currentNode===l)return u;d||(u=0)}return u},doesRangeStartWithImages:function(e,t){if(0!==e.startOffset||1!==e.startContainer.nodeType)return!1;if("img"===e.startContainer.nodeName.toLowerCase())return!0;var n=e.startContainer.querySelector("img");if(!n)return!1;for(var i=t.createTreeWalker(e.startContainer,NodeFilter.SHOW_ALL,null,!1);i.nextNode();){var o=i.currentNode;if(o===n)break;if(o.nodeValue)return!1}return!0},getTrailingImageCount:function(e,t,n,i){if(0===i||1!==n.nodeType)return 0;if("img"!==n.nodeName.toLowerCase()&&!n.querySelector("img"))return 0;for(var o=n.childNodes[i-1];o.hasChildNodes();)o=o.lastChild;for(var s,r=e,a=[],l=0,c=!1,u=!1,d=!1,h=0;!d&&r;)if(r.nodeType>3)r=a.pop();else{if(3!==r.nodeType||u){if("img"===r.nodeName.toLowerCase()&&h++,r===o)d=!0;else if(1===r.nodeType)for(var m=r.childNodes.length-1;m>=0;)a.push(r.childNodes[m]),m-=1}else h=0,s=l+r.length,!c&&t.start>=l&&t.start<=s&&(c=!0),c&&t.end>=l&&t.end<=s&&(u=!0),l=s;d||(r=a.pop())}return h},selectionContainsContent:function(e){var t=e.getSelection();if(!t||t.isCollapsed||!t.rangeCount)return!1;if(""!==t.toString().trim())return!0;var n=this.getSelectedParentElement(t.getRangeAt(0));return!(!n||!("img"===n.nodeName.toLowerCase()||1===n.nodeType&&n.querySelector("img")))},selectionInContentEditableFalse:function(e){var t,n=this.findMatchingSelectionParent((function(e){var n=e&&e.getAttribute("contenteditable");return"true"===n&&(t=!0),"#text"!==e.nodeName&&"false"===n}),e);return!t&&n},getSelectionHtml:function(e){var t,n,i,o="",s=e.getSelection();if(s.rangeCount){for(i=e.createElement("div"),t=0,n=s.rangeCount;t<n;t+=1)i.appendChild(s.getRangeAt(t).cloneContents());o=i.innerHTML}return o},getCaretOffsets:function(e,t){var n,i;return t||(t=window.getSelection().getRangeAt(0)),n=t.cloneRange(),i=t.cloneRange(),n.selectNodeContents(e),n.setEnd(t.endContainer,t.endOffset),i.selectNodeContents(e),i.setStart(t.endContainer,t.endOffset),{left:n.toString().length,right:i.toString().length}},rangeSelectsSingleNode:function(e){var t=e.startContainer;return t===e.endContainer&&t.hasChildNodes()&&e.endOffset===e.startOffset+1},getSelectedParentElement:function(e){return e?this.rangeSelectsSingleNode(e)&&3!==e.startContainer.childNodes[e.startOffset].nodeType?e.startContainer.childNodes[e.startOffset]:3===e.startContainer.nodeType?e.startContainer.parentNode:e.startContainer:null},getSelectedElements:function(e){var t,n,i,o=e.getSelection();if(!o.rangeCount||o.isCollapsed||!o.getRangeAt(0).commonAncestorContainer)return[];if(3===(t=o.getRangeAt(0)).commonAncestorContainer.nodeType){for(n=[],i=t.commonAncestorContainer;i.parentNode&&1===i.parentNode.childNodes.length;)n.push(i.parentNode),i=i.parentNode;return n}return[].filter.call(t.commonAncestorContainer.getElementsByTagName("*"),(function(e){return"function"!==typeof o.containsNode||o.containsNode(e,!0)}))},selectNode:function(e,t){var n=t.createRange();n.selectNodeContents(e),this.selectRange(t,n)},select:function(e,t,n,i,o){var s=e.createRange();return s.setStart(t,n),i?s.setEnd(i,o):s.collapse(!0),this.selectRange(e,s),s},clearSelection:function(e,t){t?e.getSelection().collapseToStart():e.getSelection().collapseToEnd()},moveCursor:function(e,t,n){this.select(e,t,n)},getSelectionRange:function(e){var t=e.getSelection();return 0===t.rangeCount?null:t.getRangeAt(0)},selectRange:function(e,t){var n=e.getSelection();n.removeAllRanges(),n.addRange(t)},getSelectionStart:function(e){var t=e.getSelection().anchorNode;return t&&3===t.nodeType?t.parentNode:t}};e.selection=n}(),function(){function t(t,n){return!!t&&t.some((function(t){if("function"!==typeof t.getInteractionElements)return!1;var i=t.getInteractionElements();return!!i&&(Array.isArray(i)||(i=[i]),i.some((function(t){return e.util.isDescendant(t,n,!0)})))}))}var n=function(e){this.base=e,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};n.prototype={InputEventOnContenteditableSupported:!e.util.isIE&&!e.util.isEdge,attachDOMEvent:function(t,n,i,o){var s=this.base.options.contentWindow,r=this.base.options.ownerDocument;t=e.util.isElement(t)||[s,r].indexOf(t)>-1?[t]:t,Array.prototype.forEach.call(t,function(e){e.addEventListener(n,i,o),this.events.push([e,n,i,o])}.bind(this))},detachDOMEvent:function(t,n,i,o){var s,r,a=this.base.options.contentWindow,l=this.base.options.ownerDocument;t&&(t=e.util.isElement(t)||[a,l].indexOf(t)>-1?[t]:t,Array.prototype.forEach.call(t,function(e){-1!==(s=this.indexOfListener(e,n,i,o))&&(r=this.events.splice(s,1)[0])[0].removeEventListener(r[1],r[2],r[3])}.bind(this)))},indexOfListener:function(e,t,n,i){var o,s,r;for(o=0,s=this.events.length;o<s;o+=1)if((r=this.events[o])[0]===e&&r[1]===t&&r[2]===n&&r[3]===i)return o;return-1},detachAllDOMEvents:function(){for(var e=this.events.pop();e;)e[0].removeEventListener(e[1],e[2],e[3]),e=this.events.pop()},detachAllEventsFromElement:function(e){for(var t=this.events.filter((function(t){return t&&t[0].getAttribute&&t[0].getAttribute("medium-editor-index")===e.getAttribute("medium-editor-index")})),n=0,i=t.length;n<i;n++){var o=t[n];this.detachDOMEvent(o[0],o[1],o[2],o[3])}},attachAllEventsToElement:function(e){this.listeners.editableInput&&(this.contentCache[e.getAttribute("medium-editor-index")]=e.innerHTML),this.eventsCache&&this.eventsCache.forEach((function(t){this.attachDOMEvent(e,t.name,t.handler.bind(this))}),this)},enableCustomEvent:function(e){void 0!==this.disabledEvents[e]&&delete this.disabledEvents[e]},disableCustomEvent:function(e){this.disabledEvents[e]=!0},attachCustomEvent:function(e,t){this.setupListener(e),this.customEvents[e]||(this.customEvents[e]=[]),this.customEvents[e].push(t)},detachCustomEvent:function(e,t){var n=this.indexOfCustomListener(e,t);-1!==n&&this.customEvents[e].splice(n,1)},indexOfCustomListener:function(e,t){return this.customEvents[e]&&this.customEvents[e].length?this.customEvents[e].indexOf(t):-1},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(e,t,n){this.customEvents[e]&&!this.disabledEvents[e]&&this.customEvents[e].forEach((function(e){e(t,n)}))},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach((function(e){e.removeAttribute("data-medium-focused")}))},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=function(e){this.handleDocumentExecCommand(e)}.bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var e=this.options.ownerDocument;if(this.execCommandListener&&e.execCommand.listeners){var t=e.execCommand.listeners.indexOf(this.execCommandListener);-1!==t&&e.execCommand.listeners.splice(t,1),e.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var e=this.options.ownerDocument;if(!e.execCommand.listeners){var t=function(t,n){e.execCommand.listeners&&e.execCommand.listeners.forEach((function(e){e({command:t[0],value:t[2],args:t,result:n})}))},n=function(){var n=e.execCommand.orig.apply(this,arguments);if(!e.execCommand.listeners)return n;var i=Array.prototype.slice.call(arguments);return t(i,n),n};n.orig=e.execCommand,n.listeners=[],n.callListeners=t,e.execCommand=n}},unwrapExecCommand:function(){var e=this.options.ownerDocument;e.execCommand.orig&&(e.execCommand=e.execCommand.orig)},setupListener:function(e){if(!this.listeners[e]){switch(e){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach((function(e){this.contentCache[e.getAttribute("medium-editor-index")]=e.innerHTML}),this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":case"editableKeydownEnter":case"editableKeydownTab":case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste)}this.listeners[e]=!0}},attachToEachElement:function(e,t){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach((function(n){this.attachDOMEvent(n,e,t.bind(this))}),this),this.eventsCache.push({name:e,handler:t})},cleanupElement:function(e){var t=e.getAttribute("medium-editor-index");t&&(this.detachAllEventsFromElement(e),this.contentCache&&delete this.contentCache[t])},focusElement:function(e){e.focus(),this.updateFocus(e,{target:e,type:"focus"})},updateFocus:function(n,i){var o,s=this.base.getFocusedElement();s&&"click"===i.type&&this.lastMousedownTarget&&(e.util.isDescendant(s,this.lastMousedownTarget,!0)||t(this.base.extensions,this.lastMousedownTarget))&&(o=s),o||this.base.elements.some((function(t){return!o&&e.util.isDescendant(t,n,!0)&&(o=t),!!o}),this);var r=!e.util.isDescendant(s,n,!0)&&!t(this.base.extensions,n);o!==s&&(s&&r&&(s.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",i,s)),o&&(o.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",i,o))),r&&this.triggerCustomEvent("externalInteraction",i)},updateInput:function(e,t){if(this.contentCache){var n=e.getAttribute("medium-editor-index"),i=e.innerHTML;i!==this.contentCache[n]&&this.triggerCustomEvent("editableInput",t,e),this.contentCache[n]=i}},handleDocumentSelectionChange:function(t){if(t.currentTarget&&t.currentTarget.activeElement){var n,i=t.currentTarget.activeElement;this.base.elements.some((function(t){return!!e.util.isDescendant(t,i,!0)&&(n=t,!0)}),this),n&&this.updateInput(n,{target:i,currentTarget:n})}},handleDocumentExecCommand:function(){var e=this.base.getFocusedElement();e&&this.updateInput(e,{target:e,currentTarget:e})},handleBodyClick:function(e){this.updateFocus(e.target,e)},handleBodyFocus:function(e){this.updateFocus(e.target,e)},handleBodyMousedown:function(e){this.lastMousedownTarget=e.target},handleInput:function(e){this.updateInput(e.currentTarget,e)},handleClick:function(e){this.triggerCustomEvent("editableClick",e,e.currentTarget)},handleBlur:function(e){this.triggerCustomEvent("editableBlur",e,e.currentTarget)},handleKeypress:function(e){if(this.triggerCustomEvent("editableKeypress",e,e.currentTarget),this.keypressUpdateInput){var t={target:e.target,currentTarget:e.currentTarget};setTimeout(function(){this.updateInput(t.currentTarget,t)}.bind(this),0)}},handleKeyup:function(e){this.triggerCustomEvent("editableKeyup",e,e.currentTarget)},handleMouseover:function(e){this.triggerCustomEvent("editableMouseover",e,e.currentTarget)},handleDragging:function(e){this.triggerCustomEvent("editableDrag",e,e.currentTarget)},handleDrop:function(e){this.triggerCustomEvent("editableDrop",e,e.currentTarget)},handlePaste:function(e){this.triggerCustomEvent("editablePaste",e,e.currentTarget)},handleKeydown:function(t){return this.triggerCustomEvent("editableKeydown",t,t.currentTarget),e.util.isKey(t,e.util.keyCode.SPACE)?this.triggerCustomEvent("editableKeydownSpace",t,t.currentTarget):e.util.isKey(t,e.util.keyCode.ENTER)||t.ctrlKey&&e.util.isKey(t,e.util.keyCode.M)?this.triggerCustomEvent("editableKeydownEnter",t,t.currentTarget):e.util.isKey(t,e.util.keyCode.TAB)?this.triggerCustomEvent("editableKeydownTab",t,t.currentTarget):e.util.isKey(t,[e.util.keyCode.DELETE,e.util.keyCode.BACKSPACE])?this.triggerCustomEvent("editableKeydownDelete",t,t.currentTarget):void 0}},e.Events=n}(),function(){var t=e.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(n){t.isBuiltInButton(n)?e.Extension.call(this,this.defaults[n]):e.Extension.call(this,n)},init:function(){e.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return"function"===typeof this.action?this.action(this.base.options):this.action},getAria:function(){return"function"===typeof this.aria?this.aria(this.base.options):this.aria},getTagNames:function(){return"function"===typeof this.tagNames?this.tagNames(this.base.options):this.tagNames},createButton:function(){var e=this.document.createElement("button"),t=this.contentDefault,n=this.getAria(),i=this.getEditorOption("buttonLabels");return e.classList.add("medium-editor-action"),e.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach((function(t){e.classList.add(t)})),e.setAttribute("data-action",this.getAction()),n&&(e.setAttribute("title",n),e.setAttribute("aria-label",n)),this.attrs&&Object.keys(this.attrs).forEach((function(t){e.setAttribute(t,this.attrs[t])}),this),"fontawesome"===i&&this.contentFA&&(t=this.contentFA),e.innerHTML=t,e},handleClick:function(e){e.preventDefault(),e.stopPropagation();var t=this.getAction();t&&this.execAction(t)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var e=null;return this.useQueryState&&(e=this.base.queryCommandState(this.getAction())),e},isAlreadyApplied:function(e){var t,n,i=!1,o=this.getTagNames();return!1===this.knownState||!0===this.knownState?this.knownState:(o&&o.length>0&&(i=-1!==o.indexOf(e.nodeName.toLowerCase())),!i&&this.style&&(t=this.style.value.split("|"),n=this.window.getComputedStyle(e,null).getPropertyValue(this.style.prop),t.forEach((function(e){this.knownState||((i=-1!==n.indexOf(e))||"text-decoration"!==this.style.prop)&&(this.knownState=i)}),this)),i)}});t.isBuiltInButton=function(t){return"string"===typeof t&&e.extensions.button.prototype.defaults.hasOwnProperty(t)},e.extensions.button=t}(),e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>&bull;</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>&rarr;</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>&larr;</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>&ldquo;</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}},function(){var t=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"&#10003;",formCloseLabel:"&times;",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return!!this.hasForm&&this.getForm().classList.contains(this.activeClass)},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var e=this.base.getExtensionByName("toolbar");e&&e.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var e=this.base.getExtensionByName("toolbar");e&&e.hideToolbarDefaultActions()},setToolbarPosition:function(){var e=this.base.getExtensionByName("toolbar");e&&e.setToolbarPosition()}});e.extensions.form=t}(),function(){var t=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(t){t.preventDefault(),t.stopPropagation();var n=e.selection.getSelectionRange(this.document);return"a"===n.startContainer.nodeName.toLowerCase()||"a"===n.endContainer.nodeName.toLowerCase()||e.util.getClosestTag(e.selection.getSelectedParentElement(n),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(t){e.util.isKey(t,e.util.keyCode.K)&&e.util.isMetaCtrlKey(t)&&!t.shiftKey&&this.handleClick(t)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var e=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return e.push('<a href="#" class="medium-editor-toolbar-save">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),e.push('<a href="#" class="medium-editor-toolbar-close">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&e.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&e.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),e.join("")},isDisplayed:function(){return e.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){e.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(t){var n=this.getInput(),i=this.getAnchorTargetCheckbox(),o=this.getAnchorButtonCheckbox();if("string"===typeof(t=t||{value:""})&&(t={value:t}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),n.value=t.value,n.focus(),i&&(i.checked="_blank"===t.target),o){var s=t.buttonClass?t.buttonClass.split(" "):[];o.checked=-1!==s.indexOf(this.customClassOption)}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var e=this.getAnchorTargetCheckbox(),t=this.getAnchorButtonCheckbox(),n={value:this.getInput().value.trim()};return this.linkValidation&&(n.value=this.checkLinkFormat(n.value)),n.target="_self",e&&e.checked&&(n.target="_blank"),t&&t.checked&&(n.buttonClass=this.customClassOption),n},doFormSave:function(){var e=this.getFormOpts();this.completeFormSave(e)},completeFormSave:function(e){this.base.restoreSelection(),this.execAction(this.action,e),this.base.checkSelection()},ensureEncodedUri:function(e){return e===decodeURI(e)?encodeURI(e):e},ensureEncodedUriComponent:function(e){return e===decodeURIComponent(e)?encodeURIComponent(e):e},ensureEncodedParam:function(e){var t=e.split("="),n=t[0],i=t[1];return n+(void 0===i?"":"="+this.ensureEncodedUriComponent(i))},ensureEncodedQuery:function(e){return e.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(e){var t=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i.test(e),n="",i=e.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),o=i[1],s=i[2],r=i[3];if(/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/.test(e))return"tel:"+e;if(!t){var a=o.split("/")[0];(a.match(/.+(\.|:).+/)||"localhost"===a)&&(n="http://")}return n+this.ensureEncodedUri(o)+(void 0===s?"":"?"+this.ensureEncodedQuery(s))+(void 0===r?"":"#"+r)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(e){var t=e.querySelector(".medium-editor-toolbar-close"),n=e.querySelector(".medium-editor-toolbar-save"),i=e.querySelector(".medium-editor-toolbar-input");this.on(e,"click",this.handleFormClick.bind(this)),this.on(i,"keyup",this.handleTextboxKeyup.bind(this)),this.on(t,"click",this.handleCloseClick.bind(this)),this.on(n,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var e=this.document.createElement("div");return e.className="medium-editor-toolbar-form",e.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),e.innerHTML=this.getTemplate(),this.attachFormEvents(e),e},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(t){if(t.keyCode===e.util.keyCode.ENTER)return t.preventDefault(),void this.doFormSave();t.keyCode===e.util.keyCode.ESCAPE&&(t.preventDefault(),this.doFormCancel())},handleFormClick:function(e){e.stopPropagation()},handleSaveClick:function(e){e.preventDefault(),this.doFormSave()},handleCloseClick:function(e){e.preventDefault(),this.doFormCancel()}});e.extensions.anchor=t}(),function(){var t=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var e=this.document.createElement("div");return e.id="medium-editor-anchor-preview-"+this.getEditorId(),e.className="medium-editor-anchor-preview",e.innerHTML=this.getTemplate(),this.on(e,"click",this.handleClick.bind(this)),e},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(e){return!(!this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")&&!e.getAttribute("data-disable-preview"))||(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=e.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=e.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=e,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(e){e=e||this.activeAnchor;var t,n,i,o,s,r=this.window.innerWidth,a=this.anchorPreview.offsetHeight,l=e.getBoundingClientRect(),c=this.diffLeft,u=this.diffTop,d=this.getEditorOption("elementsContainer"),h=["absolute","fixed"].indexOf(window.getComputedStyle(d).getPropertyValue("position"))>-1,m={};t=this.anchorPreview.offsetWidth/2;var f=this.base.getExtensionByName("toolbar");f&&(c=f.diffLeft,u=f.diffTop),n=c-t,h?(o=d.getBoundingClientRect(),["top","left"].forEach((function(e){m[e]=l[e]-o[e]})),m.width=l.width,m.height=l.height,l=m,r=o.width,s=d.scrollTop):s=this.window.pageYOffset,i=l.left+l.width/2,s+=a+l.top+l.height-u-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(s)+"px",this.anchorPreview.style.right="initial",i<t?(this.anchorPreview.style.left=n+t+"px",this.anchorPreview.style.right="initial"):r-i<t?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=n+i+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(e){var t=this.base.getExtensionByName("anchor"),n=this.activeAnchor;t&&n&&(e.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay(function(){if(n){var e={value:n.attributes.href.value,target:n.getAttribute("target"),buttonClass:n.getAttribute("class")};t.showForm(e),n=null}}.bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(t){var n=e.util.getClosestTag(t.target,"a");if(!1!==n){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(n.outerHTML)||/href=["']#\S+["']/.test(n.outerHTML)))return!0;var i=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&i&&i.isDisplayed&&i.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==n&&this.detachPreviewHandlers(),this.anchorToPreview=n,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay(function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}.bind(this))}},handlePreviewMouseover:function(){this.lastOver=(new Date).getTime(),this.hovering=!0},handlePreviewMouseout:function(e){e.relatedTarget&&/anchor-preview/.test(e.relatedTarget.className)||(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;(new Date).getTime()-this.lastOver>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=(new Date).getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=t}(),function(){var t,n,i,o,s;t=[" ","\t","\n","\r","\xa0","\u2000","\u2001","\u2002","\u2003","\u2028","\u2029"],i="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+(n="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw")+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?\xab\xbb\u201c\u201d\u2018\u2019])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+n+"))",o=new RegExp("^("+n+")$","i"),s=new RegExp(i,"gi");var r=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var e=0,t=0;t<this.window._mediumEditors.length;t++){var n=this.window._mediumEditors[t];null!==n&&void 0!==n.getExtensionByName("autoLink")&&e++}return 1===e},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(e,t){this.performLinking(t)},onKeypress:function(t){this.disableEventHandling||e.util.isKey(t,[e.util.keyCode.SPACE,e.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout(function(){try{var e=this.base.exportSelection();this.performLinking(t.target)&&this.base.importSelection(e,!0)}catch(n){window.console&&window.console.error("Failed to perform linking",n),this.disableEventHandling=!0}}.bind(this),0))},performLinking:function(t){var n=e.util.splitByBlockElements(t),i=!1;0===n.length&&(n=[t]);for(var o=0;o<n.length;o++)i=this.removeObsoleteAutoLinkSpans(n[o])||i,i=this.performLinkingWithinElement(n[o])||i;return this.base.events.updateInput(t,{target:t,currentTarget:t}),i},removeObsoleteAutoLinkSpans:function(t){if(!t||3===t.nodeType)return!1;for(var n,i=t.querySelectorAll('span[data-auto-link="true"]'),o=!1,s=0;s<i.length;s++){var r=i[s].textContent;if(-1===r.indexOf("://")&&(r=e.util.ensureUrlHasProtocol(r)),i[s].getAttribute("data-href")!==r&&(n=i[s],!e.util.getClosestTag(n,"a"))){o=!0;var a=r.replace(/\s+$/,"");if(i[s].getAttribute("data-href")===a){var l=r.length-a.length,c=e.util.splitOffDOMTree(i[s],this.splitTextBeforeEnd(i[s],l));i[s].parentNode.insertBefore(c,i[s].nextSibling)}else e.util.unwrap(i[s],this.document)}}return o},splitTextBeforeEnd:function(e,t){for(var n,i,o,s=this.document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r=!0;r;)r=null!==s.lastChild();for(;t>0&&null!==o;)(i=(n=s.currentNode).nodeValue).length>t?(o=n.splitText(i.length-t),t=0):(o=s.previousNode(),t-=i.length);return o},performLinkingWithinElement:function(t){for(var n=this.findLinkableText(t),i=0;i<n.length;i++){var o=e.util.findOrCreateMatchingTextNodes(this.document,t,n[i]);this.shouldNotLink(o)||this.createAutoLink(o,n[i].href)}return!1},shouldNotLink:function(t){for(var n=!1,i=0;i<t.length&&!1===n;i++)n=!!e.util.traverseUp(t[i],(function(e){return"a"===e.nodeName.toLowerCase()||e.getAttribute&&"true"===e.getAttribute("data-auto-link")}));return n},findLinkableText:function(e){for(var n=e.textContent,i=null,r=[];null!==(i=s.exec(n));){var a=i.index+i[0].length;(0===i.index||-1!==t.indexOf(n[i.index-1]))&&(a===n.length||-1!==t.indexOf(n[a]))&&(-1!==i[0].indexOf("/")||o.test(i[0].split(".").pop().split("?").shift()))&&r.push({href:i[0],start:i.index,end:a})}return r},createAutoLink:function(t,n){n=e.util.ensureUrlHasProtocol(n);var i=e.util.createLink(this.document,t,n,this.getEditorOption("targetBlank")?"_blank":null),o=this.document.createElement("span");for(o.setAttribute("data-auto-link","true"),o.setAttribute("data-href",n),i.insertBefore(o,i.firstChild);i.childNodes.length>1;)o.appendChild(i.childNodes[1])}});e.extensions.autoLink=r}(),function(){var t="medium-editor-dragover";function n(n){var i=e.util.getContainerEditorElement(n);Array.prototype.slice.call(i.parentElement.querySelectorAll("."+t)).forEach((function(e){e.classList.remove(t)}))}var i=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(e){e.preventDefault(),e.dataTransfer.dropEffect="copy";var i=e.target.classList?e.target:e.target.parentElement;n(i),"dragover"===e.type&&i.classList.add(t)},handleDrop:function(e){e.preventDefault(),e.stopPropagation(),this.base.selectElement(e.target);var t=this.base.exportSelection();t.start=t.end,this.base.importSelection(t),e.dataTransfer.files&&Array.prototype.slice.call(e.dataTransfer.files).forEach((function(e){this.isAllowedFile(e)&&e.type.match("image")&&this.insertImageFile(e)}),this),n(e.target)},isAllowedFile:function(e){return this.allowedTypes.some((function(t){return!!e.type.match(t)}))},insertImageFile:function(t){if("function"===typeof FileReader){var n=new FileReader;n.readAsDataURL(t),n.addEventListener("load",function(t){var n=this.document.createElement("img");n.src=t.target.result,e.util.insertHTMLCommand(this.document,n.outerHTML)}.bind(this))}}});e.extensions.fileDragging=i}(),function(){var t=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach((function(e){var t=e.key.charCodeAt(0);this.keys[t]||(this.keys[t]=[]),this.keys[t].push(e)}),this)},handleKeydown:function(t){var n=e.util.getKeyCode(t);if(this.keys[n]){var i=e.util.isMetaCtrlKey(t),o=!!t.shiftKey,s=!!t.altKey;this.keys[n].forEach((function(e){e.meta!==i||e.shift!==o||e.alt!==s&&void 0!==e.alt||(t.preventDefault(),t.stopPropagation(),"function"===typeof e.command?e.command.apply(this):!1!==e.command&&this.execAction(e.command))}),this)}}});e.extensions.keyboardCommands=t}(),function(){var t=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"&#xB1;",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(e){if(e.preventDefault(),e.stopPropagation(),!this.isDisplayed()){var t=this.document.queryCommandValue("fontName")+"";this.showForm(t)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(e){var t=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),t.value=e||"",t.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var e,t=this.document,n=t.createElement("div"),i=t.createElement("select"),o=t.createElement("a"),s=t.createElement("a");n.className="medium-editor-toolbar-form",n.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(n,"click",this.handleFormClick.bind(this));for(var r=0;r<this.fonts.length;r++)(e=t.createElement("option")).innerHTML=this.fonts[r],e.value=this.fonts[r],i.appendChild(e);return i.className="medium-editor-toolbar-select",n.appendChild(i),this.on(i,"change",this.handleFontChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"&#10003;",n.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),o.setAttribute("href","#"),o.className="medium-editor-toobar-close",o.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"&times;",n.appendChild(o),this.on(o,"click",this.handleCloseClick.bind(this)),n},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach((function(e){"font"===e.nodeName.toLowerCase()&&e.hasAttribute("face")&&e.removeAttribute("face")}))},handleFontChange:function(){var e=this.getSelect().value;""===e?this.clearFontName():this.execAction("fontName",{value:e})},handleFormClick:function(e){e.stopPropagation()},handleSaveClick:function(e){e.preventDefault(),this.doFormSave()},handleCloseClick:function(e){e.preventDefault(),this.doFormCancel()}});e.extensions.fontName=t}(),function(){var t=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"&#xB1;",contentFA:'<i class="fa fa-text-height"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(e){if(e.preventDefault(),e.stopPropagation(),!this.isDisplayed()){var t=this.document.queryCommandValue("fontSize")+"";this.showForm(t)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(e){var t=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),t.value=e||"",t.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var e=this.document,t=e.createElement("div"),n=e.createElement("input"),i=e.createElement("a"),o=e.createElement("a");return t.className="medium-editor-toolbar-form",t.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(t,"click",this.handleFormClick.bind(this)),n.setAttribute("type","range"),n.setAttribute("min","1"),n.setAttribute("max","7"),n.className="medium-editor-toolbar-input",t.appendChild(n),this.on(n,"change",this.handleSliderChange.bind(this)),o.setAttribute("href","#"),o.className="medium-editor-toobar-save",o.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"&#10003;",t.appendChild(o),this.on(o,"click",this.handleSaveClick.bind(this),!0),i.setAttribute("href","#"),i.className="medium-editor-toobar-close",i.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"&times;",t.appendChild(i),this.on(i,"click",this.handleCloseClick.bind(this)),t},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach((function(e){"font"===e.nodeName.toLowerCase()&&e.hasAttribute("size")&&e.removeAttribute("size")}))},handleSliderChange:function(){var e=this.getInput().value;"4"===e?this.clearFontSize():this.execAction("fontSize",{value:e})},handleFormClick:function(e){e.stopPropagation()},handleSaveClick:function(e){e.preventDefault(),this.doFormSave()},handleCloseClick:function(e){e.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=t}(),function(){var t="%ME_PASTEBIN%",n=null,i=null,o=function(e){e.stopPropagation()};function s(e,t,n){var i=e.clipboardData||t.clipboardData||n.dataTransfer,o={};if(!i)return o;if(i.getData){var s=i.getData("Text");s&&s.length>0&&(o["text/plain"]=s)}if(i.types)for(var r=0;r<i.types.length;r++){var a=i.types[r];o[a]=i.getData(a)}return o}var r=e.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){e.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach((function(e){this.on(e,"paste",this.handlePaste.bind(this))}),this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(e,t){this.on(t,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(e,t){if(!e.defaultPrevented){var n=s(e,this.window,this.document),i=n["text/html"],o=n["text/plain"];this.window.clipboardData&&void 0===e.clipboardData&&!i&&(i=o),(i||o)&&(e.preventDefault(),this.doPaste(i,o,t))}},doPaste:function(t,n,i){var o,s,r="";if(this.cleanPastedHTML&&t)return this.cleanPaste(t);if(n){if(this.getEditorOption("disableReturn")||i&&i.getAttribute("data-disable-return"))r=e.util.htmlEntities(n);else if((o=n.split(/[\r\n]+/g)).length>1)for(s=0;s<o.length;s+=1)""!==o[s]&&(r+="<p>"+e.util.htmlEntities(o[s])+"</p>");else r=e.util.htmlEntities(o[0]);e.util.insertHTMLCommand(this.document,r)}},handlePasteBinPaste:function(e){if(e.defaultPrevented)this.removePasteBin();else{var t=s(e,this.window,this.document),n=t["text/html"],o=t["text/plain"],r=i;if(!this.cleanPastedHTML||n)return e.preventDefault(),this.removePasteBin(),this.doPaste(n,o,r),void this.trigger("editablePaste",{currentTarget:r,target:r},r);setTimeout(function(){this.cleanPastedHTML&&(n=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(n,o,r),this.trigger("editablePaste",{currentTarget:r,target:r},r)}.bind(this),0)}},handleKeydown:function(t,n){e.util.isKey(t,e.util.keyCode.V)&&e.util.isMetaCtrlKey(t)&&(t.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(n))},createPasteBin:function(s){var r,a=e.selection.getSelectionRange(this.document),l=this.window.pageYOffset;i=s,a&&((r=a.getClientRects()).length?l+=r[0].top:void 0!==a.startContainer.getBoundingClientRect?l+=a.startContainer.getBoundingClientRect().top:l+=a.getBoundingClientRect().top),n=a;var c=this.document.createElement("div");c.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),c.setAttribute("style","border: 1px red solid; position: absolute; top: "+l+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),c.setAttribute("contentEditable",!0),c.innerHTML=t,this.document.body.appendChild(c),this.on(c,"focus",o),this.on(c,"focusin",o),this.on(c,"focusout",o),c.focus(),e.selection.selectNode(c,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(c,"paste",this.boundHandlePaste)},removePasteBin:function(){null!==n&&(e.selection.selectRange(this.document,n),n=null),null!==i&&(i=null);var t=this.getPasteBin();t&&t&&(this.off(t,"focus",o),this.off(t,"focusin",o),this.off(t,"focusout",o),this.off(t,"paste",this.boundHandlePaste),t.parentElement.removeChild(t))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var e=this.getPasteBin();if(!e)return!1;if(e.firstChild&&"mcepastebin"===e.firstChild.id)return!1;var n=e.innerHTML;return!(!n||n===t)&&n},cleanPaste:function(e){var t,n,i,o,s=/<p|<br|<div/.test(e),r=[].concat(this.preCleanReplacements||[],[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/&lt;(\/?)(i|b|a)&gt;/gi),"<$1$2>"],[new RegExp(/&lt;a(?:(?!href).)+href=(?:&quot;|&rdquo;|&ldquo;|"|\u201c|\u201d)(((?!&quot;|&rdquo;|&ldquo;|"|\u201c|\u201d).)*)(?:&quot;|&rdquo;|&ldquo;|"|\u201c|\u201d)(?:(?!&gt;).)*&gt;/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]],this.cleanReplacements||[]);for(t=0;t<r.length;t+=1)e=e.replace(r[t][0],r[t][1]);if(!s)return this.pasteHTML(e);for((i=this.document.createElement("div")).innerHTML="<p>"+e.split("<br><br>").join("</p><p>")+"</p>",n=i.querySelectorAll("a,p,div,br"),t=0;t<n.length;t+=1)switch((o=n[t]).innerHTML=o.innerHTML.replace(/\n/gi," "),o.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(o);break;case"br":this.filterLineBreak(o)}this.pasteHTML(i.innerHTML)},pasteHTML:function(t,n){n=e.util.defaults({},n,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var i,o,s,r,a=this.document.createDocumentFragment();for(a.appendChild(this.document.createElement("body")),(r=a.querySelector("body")).innerHTML=t,this.cleanupSpans(r),i=r.querySelectorAll("*"),s=0;s<i.length;s+=1)"a"===(o=i[s]).nodeName.toLowerCase()&&this.getEditorOption("targetBlank")&&e.util.setTargetBlank(o),e.util.cleanupAttrs(o,n.cleanAttrs),e.util.cleanupTags(o,n.cleanTags),e.util.unwrapTags(o,n.unwrapTags);e.util.insertHTMLCommand(this.document,r.innerHTML.replace(/&nbsp;/g," "))},isCommonBlock:function(e){return e&&("p"===e.nodeName.toLowerCase()||"div"===e.nodeName.toLowerCase())},filterCommonBlocks:function(e){/^\s*$/.test(e.textContent)&&e.parentNode&&e.parentNode.removeChild(e)},filterLineBreak:function(e){this.isCommonBlock(e.previousElementSibling)?this.removeWithParent(e):!this.isCommonBlock(e.parentNode)||e.parentNode.firstChild!==e&&e.parentNode.lastChild!==e?e.parentNode&&1===e.parentNode.childElementCount&&""===e.parentNode.textContent&&this.removeWithParent(e):this.removeWithParent(e)},removeWithParent:function(e){e&&e.parentNode&&(e.parentNode.parentNode&&1===e.parentNode.childElementCount?e.parentNode.parentNode.removeChild(e.parentNode):e.parentNode.removeChild(e))},cleanupSpans:function(t){var n,i,o,s=t.querySelectorAll(".replace-with"),r=function(e){return e&&"#text"!==e.nodeName&&"false"===e.getAttribute("contenteditable")};for(n=0;n<s.length;n+=1)i=s[n],o=this.document.createElement(i.classList.contains("bold")?"b":"i"),i.classList.contains("bold")&&i.classList.contains("italic")?o.innerHTML="<i>"+i.innerHTML+"</i>":o.innerHTML=i.innerHTML,i.parentNode.replaceChild(o,i);for(s=t.querySelectorAll("span"),n=0;n<s.length;n+=1){if(i=s[n],e.util.traverseUp(i,r))return!1;e.util.unwrap(i,this.document)}}});e.extensions.paste=r}(),function(){var t=e.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(e,t){this.initElement(t)},initElement:function(e){e.getAttribute("data-placeholder")||e.setAttribute("data-placeholder",this.text),this.updatePlaceholder(e)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(e,t){this.cleanupElement(t)},cleanupElement:function(e){e.getAttribute("data-placeholder")===this.text&&e.removeAttribute("data-placeholder")},showPlaceholder:function(t){t&&(e.util.isFF&&0===t.childNodes.length?(t.classList.add("medium-editor-placeholder-relative"),t.classList.remove("medium-editor-placeholder")):(t.classList.add("medium-editor-placeholder"),t.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(e){e&&(e.classList.remove("medium-editor-placeholder"),e.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(e,t){if(e.querySelector("img, blockquote, ul, ol, table")||""!==e.textContent.replace(/^\s+|\s+$/g,""))return this.hidePlaceholder(e);t||this.showPlaceholder(e)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(e,t){var n=this.hideOnClick&&t===this.base.getFocusedElement();this.updatePlaceholder(t,n)},handleFocus:function(e,t){this.hidePlaceholder(t)},handleBlur:function(e,t){this.updatePlaceholder(t)}});e.extensions.placeholder=t}(),function(){var t=e.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(e,t){return this.base.extensions.forEach((function(n){if(n!==this)return e.apply(t||this,arguments)}),this)},createToolbar:function(){var e=this.document.createElement("div");return e.id="medium-editor-toolbar-"+this.getEditorId(),e.className="medium-editor-toolbar",this.static?e.className+=" static-toolbar":this.relativeContainer?e.className+=" medium-editor-relative-toolbar":e.className+=" medium-editor-stalker-toolbar",e.appendChild(this.createToolbarButtons()),this.forEachExtension((function(t){t.hasForm&&e.appendChild(t.getForm())})),this.attachEventHandlers(),e},createToolbarButtons:function(){var t,n,i,o,s,r,a=this.document.createElement("ul");return a.id="medium-editor-toolbar-actions"+this.getEditorId(),a.className="medium-editor-toolbar-actions",a.style.display="block",this.buttons.forEach((function(i){"string"===typeof i?(s=i,r=null):(s=i.name,r=i),(o=this.base.addBuiltInExtension(s,r))&&"function"===typeof o.getButton&&(n=o.getButton(this.base),t=this.document.createElement("li"),e.util.isElement(n)?t.appendChild(n):t.innerHTML=n,a.appendChild(t))}),this),(i=a.querySelectorAll("button")).length>0&&(i[0].classList.add(this.firstButtonClass),i[i.length-1].classList.add(this.lastButtonClass)),a},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle(function(){this.base.isActive&&this.positionToolbarIfShown()}.bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(t){if(t&&t.target&&e.util.isDescendant(this.getToolbarElement(),t.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout(function(){this.checkState()}.bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout(function(){this.hideToolbar()}.bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return"block"===this.getToolbarActionsElement().style.display},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay(function(){this.showToolbar()}.bind(this))},hideExtensionForms:function(){this.forEachExtension((function(e){e.hasForm&&e.isDisplayed()&&e.hideForm()}))},multipleBlockElementsSelected:function(){var t=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),n=e.selection.getSelectionHtml(this.document).replace(/<[^\/>][^>]*><\/[^>]+>/gim,"").match(t);return!!n&&n.length>1},modifySelection:function(){var t=this.window.getSelection().getRangeAt(0);if(this.standardizeSelectionStart&&t.startContainer.nodeValue&&t.startOffset===t.startContainer.nodeValue.length){var n=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),t.startContainer,this.document);if(n){for(var i=0;0===n.nodeValue.substr(i,1).trim().length;)i+=1;t=e.selection.select(this.document,n,i,t.endContainer,t.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var t=e.selection.getSelectionElement(this.window);return!t||-1===this.getEditorElements().indexOf(t)||t.getAttribute("data-disable-toolbar")?this.hideToolbar():this.updateOnEmptySelection&&this.static?this.showAndUpdateToolbar():!e.selection.selectionContainsContent(this.document)||!1===this.allowMultiParagraphSelection&&this.multipleBlockElementsSelected()?this.hideToolbar():void this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension((function(e){"function"===typeof e.isActive&&"function"===typeof e.setInactive&&e.setInactive()})),this.checkActiveButtons()},checkActiveButtons:function(){var t,n=[],i=null,o=e.selection.getSelectionRange(this.document),s=function(e){"function"===typeof e.checkState?e.checkState(t):"function"===typeof e.isActive&&"function"===typeof e.isAlreadyApplied&&"function"===typeof e.setActive&&!e.isActive()&&e.isAlreadyApplied(t)&&e.setActive()};if(o&&(this.forEachExtension((function(e){"function"!==typeof e.queryCommandState||null===(i=e.queryCommandState())?n.push(e):i&&"function"===typeof e.setActive&&e.setActive()})),t=e.selection.getSelectedParentElement(o),this.getEditorElements().some((function(n){return e.util.isDescendant(n,t,!0)}))))for(;t&&(n.forEach(s),!e.util.isMediumEditorElement(t));)t=t.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var e=this.base.getFocusedElement(),t=this.window.getSelection();if(!e)return this;!this.static&&t.isCollapsed||(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(e):this.positionToolbar(t)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(e){this.getToolbarElement().style.left="0";var t,n=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,i=this.window.innerWidth,o=this.getToolbarElement(),s=e.getBoundingClientRect(),r=s.top+n,a=s.left+s.width/2,l=o.offsetHeight,c=o.offsetWidth,u=c/2;switch(this.sticky?n>r+e.offsetHeight-l-this.stickyTopOffset?(o.style.top=r+e.offsetHeight-l+"px",o.classList.remove("medium-editor-sticky-toolbar")):n>r-l-this.stickyTopOffset?(o.classList.add("medium-editor-sticky-toolbar"),o.style.top=this.stickyTopOffset+"px"):(o.classList.remove("medium-editor-sticky-toolbar"),o.style.top=r-l+"px"):o.style.top=r-l+"px",this.align){case"left":t=s.left;break;case"right":t=s.right-c;break;case"center":t=a-u}t<0?t=0:t+c>i&&(t=i-Math.ceil(c)-1),o.style.left=t+"px"},positionToolbar:function(e){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var t=e.getRangeAt(0),n=t.getBoundingClientRect();(!n||0===n.height&&0===n.width&&t.startContainer===t.endContainer)&&(n=1===t.startContainer.nodeType&&t.startContainer.querySelector("img")?t.startContainer.querySelector("img").getBoundingClientRect():t.startContainer.getBoundingClientRect());var i,o,s=this.window.innerWidth,r=this.getToolbarElement(),a=r.offsetHeight,l=r.offsetWidth/2,c=this.diffLeft-l,u=this.getEditorOption("elementsContainer"),d=["absolute","fixed"].indexOf(window.getComputedStyle(u).getPropertyValue("position"))>-1,h={},m={};d?(o=u.getBoundingClientRect(),["top","left"].forEach((function(e){m[e]=n[e]-o[e]})),m.width=n.width,m.height=n.height,n=m,s=o.width,h.top=u.scrollTop):h.top=this.window.pageYOffset,i=n.left+n.width/2,h.top+=n.top-a,n.top<50?(r.classList.add("medium-toolbar-arrow-over"),r.classList.remove("medium-toolbar-arrow-under"),h.top+=50+n.height-this.diffTop):(r.classList.add("medium-toolbar-arrow-under"),r.classList.remove("medium-toolbar-arrow-over"),h.top+=this.diffTop),i<l?(h.left=c+l,h.right="initial"):s-i<l?(h.left="auto",h.right=0):(h.left=c+i,h.right="initial"),["top","left","right"].forEach((function(e){r.style[e]=h[e]+(isNaN(h[e])?"":"px")}))}});e.extensions.toolbar=t}(),function(){var t=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(e){var t="medium-editor-dragover";e.preventDefault(),e.dataTransfer.dropEffect="copy","dragover"===e.type?e.target.classList.add(t):"dragleave"===e.type&&e.target.classList.remove(t)},handleDrop:function(t){t.preventDefault(),t.stopPropagation(),t.dataTransfer.files&&Array.prototype.slice.call(t.dataTransfer.files,0).some(function(t){var n,i;t.type.match("image")&&((n=new FileReader).readAsDataURL(t),i="medium-img-"+ +new Date,e.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+i+'" />'),n.onload=function(){var e=this.document.getElementById(i);e&&(e.removeAttribute("id"),e.removeAttribute("class"),e.src=n.result)}.bind(this))}.bind(this)),t.target.classList.remove("medium-editor-dragover")}});e.extensions.imageDragging=t}(),function(){function t(t){var n=e.selection.getSelectionStart(this.options.ownerDocument),i=n.textContent,o=e.selection.getCaretOffsets(n);(void 0===i[o.left-1]||""===i[o.left-1].trim()||void 0!==i[o.left]&&""===i[o.left].trim())&&t.preventDefault()}function n(t,n){if(this.options.disableReturn||n.getAttribute("data-disable-return"))t.preventDefault();else if(this.options.disableDoubleReturn||n.getAttribute("data-disable-double-return")){var i=e.selection.getSelectionStart(this.options.ownerDocument);(i&&""===i.textContent.trim()&&"li"!==i.nodeName.toLowerCase()||i.previousElementSibling&&"br"!==i.previousElementSibling.nodeName.toLowerCase()&&""===i.previousElementSibling.textContent.trim())&&t.preventDefault()}}function i(t){var n=e.selection.getSelectionStart(this.options.ownerDocument);"pre"===(n&&n.nodeName.toLowerCase())&&(t.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(n)&&(t.preventDefault(),t.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function o(t){var n,i=e.selection.getSelectionStart(this.options.ownerDocument),o=i.nodeName.toLowerCase(),s=/^(\s+|<br\/?>)?$/i,r=/h\d/i;e.util.isKey(t,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&i.previousElementSibling&&r.test(o)&&0===e.selection.getCaretOffsets(i).left?e.util.isKey(t,e.util.keyCode.BACKSPACE)&&s.test(i.previousElementSibling.innerHTML)?(i.previousElementSibling.parentNode.removeChild(i.previousElementSibling),t.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(t,e.util.keyCode.ENTER)&&((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",i.previousElementSibling.parentNode.insertBefore(n,i),t.preventDefault()):e.util.isKey(t,e.util.keyCode.DELETE)&&i.nextElementSibling&&i.previousElementSibling&&!r.test(o)&&s.test(i.innerHTML)&&r.test(i.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,i.nextElementSibling),i.previousElementSibling.parentNode.removeChild(i),t.preventDefault()):e.util.isKey(t,e.util.keyCode.BACKSPACE)&&"li"===o&&s.test(i.innerHTML)&&!i.previousElementSibling&&!i.parentElement.previousElementSibling&&i.nextElementSibling&&"li"===i.nextElementSibling.nodeName.toLowerCase()?((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",i.parentElement.parentElement.insertBefore(n,i.parentElement),e.selection.moveCursor(this.options.ownerDocument,n),i.parentElement.removeChild(i),t.preventDefault()):e.util.isKey(t,e.util.keyCode.BACKSPACE)&&!1!==e.util.getClosestTag(i,"blockquote")&&0===e.selection.getCaretOffsets(i).left?(t.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p")):e.util.isKey(t,e.util.keyCode.ENTER)&&!1!==e.util.getClosestTag(i,"blockquote")&&0===e.selection.getCaretOffsets(i).right?((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",i.parentElement.insertBefore(n,i.nextSibling),e.selection.moveCursor(this.options.ownerDocument,n),t.preventDefault()):e.util.isKey(t,e.util.keyCode.BACKSPACE)&&e.util.isMediumEditorElement(i.parentElement)&&!i.previousElementSibling&&i.nextElementSibling&&s.test(i.innerHTML)&&(t.preventDefault(),e.selection.moveCursor(this.options.ownerDocument,i.nextSibling),i.parentElement.removeChild(i))}function s(t){var n=e.selection.getSelectionStart(this.options.ownerDocument);n&&(e.util.isMediumEditorElement(n)&&0===n.children.length&&!e.util.isBlockContainer(n)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),!e.util.isKey(t,e.util.keyCode.ENTER)||e.util.isListItem(n)||e.util.isBlockContainer(n)||("a"===n.nodeName.toLowerCase()?this.options.ownerDocument.execCommand("unlink",!1,null):t.shiftKey||t.ctrlKey||this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function r(e,t){var n=t.parentNode.querySelector('textarea[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]');n&&(n.value=t.innerHTML.trim())}function a(e){e._mediumEditors||(e._mediumEditors=[null]),this.id||(this.id=e._mediumEditors.length),e._mediumEditors[this.id]=this}function l(e){e._mediumEditors&&e._mediumEditors[this.id]&&(e._mediumEditors[this.id]=null)}function c(t,n,i){var o=[];if(t||(t=[]),"string"===typeof t&&(t=n.querySelectorAll(t)),e.util.isElement(t)&&(t=[t]),i)for(var s=0;s<t.length;s++){var r=t[s];!e.util.isElement(r)||r.getAttribute("data-medium-editor-element")||r.getAttribute("medium-editor-textarea-id")||o.push(r)}else o=Array.prototype.slice.apply(t);return o}function u(e){var t=e.parentNode.querySelector('textarea[medium-editor-textarea-id="'+e.getAttribute("medium-editor-textarea-id")+'"]');t&&(t.classList.remove("medium-editor-hidden"),t.removeAttribute("medium-editor-textarea-id")),e.parentNode&&e.parentNode.removeChild(e)}function d(e,t,n){return"function"===typeof(e=function(e,t){return Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])})),e}(e,{window:n.options.contentWindow,document:n.options.ownerDocument,base:n})).init&&e.init(),e.name||(e.name=t),e}function h(){return!this.elements.every((function(e){return!!e.getAttribute("data-disable-toolbar")}))&&!1!==this.options.toolbar}function m(){return!!h.call(this)&&!1!==this.options.anchorPreview}function f(){return!1!==this.options.placeholder}function p(){return!1!==this.options.autoLink}function g(){return!1!==this.options.imageDragging}function b(){return!1!==this.options.keyboardCommands}function v(){return!this.options.extensions.imageDragging}function E(e){for(var t=this.options.ownerDocument.createElement("div"),n=Date.now(),i="medium-editor-"+n,o=e.attributes;this.options.ownerDocument.getElementById(i);)n++,i="medium-editor-"+n;t.className=e.className,t.id=i,t.innerHTML=e.value,e.setAttribute("medium-editor-textarea-id",i);for(var s=0,r=o.length;s<r;s++)t.hasAttribute(o[s].nodeName)||t.setAttribute(o[s].nodeName,o[s].value);return e.form&&this.on(e.form,"reset",function(e){e.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(i))}.bind(this)),e.classList.add("medium-editor-hidden"),e.parentNode.insertBefore(t,e),t}function y(t,i){if(!t.getAttribute("data-medium-editor-element")){"textarea"===t.nodeName.toLowerCase()&&(t=E.call(this,t),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=r.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),this.options.disableEditing||t.getAttribute("data-disable-editing")||(t.setAttribute("contentEditable",!0),t.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(t.getAttribute("data-disable-return")||t.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),this.options.disableReturn||t.getAttribute("data-disable-return")||this.on(t,"keyup",s.bind(this));var o=e.util.guid();t.setAttribute("data-medium-editor-element",!0),t.classList.add("medium-editor-element"),t.setAttribute("role","textbox"),t.setAttribute("aria-multiline",!0),t.setAttribute("data-medium-editor-editor-index",i),t.setAttribute("medium-editor-index",o),S[o]=t.innerHTML,this.events.attachAllEventsToElement(t)}return t}function C(){this.subscribe("editableKeydownTab",i.bind(this)),this.subscribe("editableKeydownDelete",o.bind(this)),this.subscribe("editableKeydownEnter",o.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",t.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function w(){if(this.extensions=[],Object.keys(this.options.extensions).forEach((function(e){"toolbar"!==e&&this.options.extensions[e]&&this.extensions.push(d(this.options.extensions[e],e,this))}),this),v.call(this)){var t=this.options.fileDragging;t||(t={},g.call(this)||(t.allowedTypes=[])),this.addBuiltInExtension("fileDragging",t)}var n={paste:!0,"anchor-preview":m.call(this),autoLink:p.call(this),keyboardCommands:b.call(this),placeholder:f.call(this)};Object.keys(n).forEach((function(e){n[e]&&this.addBuiltInExtension(e)}),this);var i=this.options.extensions.toolbar;if(!i&&h.call(this)){var o=e.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});i=new e.extensions.toolbar(o)}i&&this.extensions.push(d(i,"toolbar",this))}function x(t,n){return n&&[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]].forEach((function(t){n.hasOwnProperty(t[0])&&void 0!==n[t[0]]&&e.util.deprecated(t[0],t[1],"v6.0.0")})),e.util.defaults({},n,t)}function T(t,n){var i,o;if(i=/^append-(.+)$/gi.exec(t))return e.util.execFormatBlock(this.options.ownerDocument,i[1]);if("fontSize"===t)return n.size&&e.util.deprecated(".size option for fontSize command",".value","6.0.0"),o=n.value||n.size,this.options.ownerDocument.execCommand("fontSize",!1,o);if("fontName"===t)return n.name&&e.util.deprecated(".name option for fontName command",".value","6.0.0"),o=n.value||n.name,this.options.ownerDocument.execCommand("fontName",!1,o);if("createLink"===t)return this.createLink(n);if("image"===t){var s=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,s)}if("html"===t){var r=this.options.contentWindow.getSelection().toString().trim();return e.util.insertHTMLCommand(this.options.ownerDocument,r)}if(/justify([A-Za-z]*)$/g.exec(t)){var a=this.options.ownerDocument.execCommand(t,!1,null),l=e.selection.getSelectedParentElement(e.selection.getSelectionRange(this.options.ownerDocument));return l&&k.call(this,e.util.getTopBlockContainer(l)),a}return o=n&&n.value,this.options.ownerDocument.execCommand(t,!1,o)}function k(t){if(t){var n,i=Array.prototype.slice.call(t.childNodes).filter((function(e){var t="div"===e.nodeName.toLowerCase();return t&&!n&&(n=e.style.textAlign),t}));i.length&&(this.saveSelection(),i.forEach((function(t){if(t.style.textAlign===n){var i=t.lastChild;if(i){e.util.unwrap(t,this.options.ownerDocument);var o=this.options.ownerDocument.createElement("BR");i.parentNode.insertBefore(o,i.nextSibling)}}}),this),t.style.textAlign=n,this.restoreSelection())}}var S={};e.prototype={init:function(e,t){return this.options=x.call(this,this.defaults,t),this.origElements=e,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(a.call(this,this.options.contentWindow),this.events=new e.Events(this),this.elements=[],this.addElements(this.origElements),0!==this.elements.length&&(this.isActive=!0,w.call(this),C.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach((function(e){"function"===typeof e.destroy&&e.destroy()}),this),this.events.destroy(),this.elements.forEach((function(e){this.options.spellcheck&&(e.innerHTML=e.innerHTML),e.removeAttribute("contentEditable"),e.removeAttribute("spellcheck"),e.removeAttribute("data-medium-editor-element"),e.classList.remove("medium-editor-element"),e.removeAttribute("role"),e.removeAttribute("aria-multiline"),e.removeAttribute("medium-editor-index"),e.removeAttribute("data-medium-editor-editor-index"),e.getAttribute("medium-editor-textarea-id")&&u(e)}),this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,l.call(this,this.options.contentWindow))},on:function(e,t,n,i){return this.events.attachDOMEvent(e,t,n,i),this},off:function(e,t,n,i){return this.events.detachDOMEvent(e,t,n,i),this},subscribe:function(e,t){return this.events.attachCustomEvent(e,t),this},unsubscribe:function(e,t){return this.events.detachCustomEvent(e,t),this},trigger:function(e,t,n){return this.events.triggerCustomEvent(e,t,n),this},delay:function(e){var t=this;return setTimeout((function(){t.isActive&&e()}),this.options.delay)},serialize:function(){var e,t={},n=this.elements.length;for(e=0;e<n;e+=1)t[""!==this.elements[e].id?this.elements[e].id:"element-"+e]={value:this.elements[e].innerHTML.trim()};return t},getExtensionByName:function(e){var t;return this.extensions&&this.extensions.length&&this.extensions.some((function(n){return n.name===e&&(t=n,!0)})),t},addBuiltInExtension:function(t,n){var i,o=this.getExtensionByName(t);if(o)return o;switch(t){case"anchor":i=e.util.extend({},this.options.anchor,n),o=new e.extensions.anchor(i);break;case"anchor-preview":o=new e.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":o=new e.extensions.autoLink;break;case"fileDragging":o=new e.extensions.fileDragging(n);break;case"fontname":o=new e.extensions.fontName(this.options.fontName);break;case"fontsize":o=new e.extensions.fontSize(n);break;case"keyboardCommands":o=new e.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":o=new e.extensions.paste(this.options.paste);break;case"placeholder":o=new e.extensions.placeholder(this.options.placeholder);break;default:e.extensions.button.isBuiltInButton(t)&&(n?(i=e.util.defaults({},n,e.extensions.button.prototype.defaults[t]),o=new e.extensions.button(i)):o=new e.extensions.button(t))}return o&&this.extensions.push(d(o,t,this)),o},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var e=this.getExtensionByName("toolbar");return e&&e.checkState(),this},queryCommandState:function(e){var t,n=null;(t=/^full-(.+)$/gi.exec(e))&&(e=t[1]);try{n=this.options.ownerDocument.queryCommandState(e)}catch(i){n=null}return n},execAction:function(t,n){var i,o;return(i=/^full-(.+)$/gi.exec(t))?(this.saveSelection(),this.selectAllContents(),o=T.call(this,i[1],n),this.restoreSelection()):o=T.call(this,t,n),"insertunorderedlist"!==t&&"insertorderedlist"!==t||e.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),o},getSelectedParentElement:function(t){return void 0===t&&(t=this.options.contentWindow.getSelection().getRangeAt(0)),e.selection.getSelectedParentElement(t)},selectAllContents:function(){var t=e.selection.getSelectionElement(this.options.contentWindow);if(t){for(;1===t.children.length;)t=t.children[0];this.selectElement(t)}},selectElement:function(t){e.selection.selectNode(t,this.options.ownerDocument);var n=e.selection.getSelectionElement(this.options.contentWindow);n&&this.events.focusElement(n)},getFocusedElement:function(){var e;return this.elements.some((function(t){return!e&&t.getAttribute("data-medium-focused")&&(e=t),!!e}),this),e},exportSelection:function(){var t=e.selection.getSelectionElement(this.options.contentWindow),n=this.elements.indexOf(t),i=null;return n>=0&&(i=e.selection.exportSelection(t,this.options.ownerDocument)),null!==i&&0!==n&&(i.editableElementIndex=n),i},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(t,n){if(t){var i=this.elements[t.editableElementIndex||0];e.selection.importSelection(t,i,this.options.ownerDocument,n)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(t){var n,i=e.selection.getSelectionElement(this.options.contentWindow),o={};if(-1!==this.elements.indexOf(i)){try{if(this.events.disableCustomEvent("editableInput"),t.url&&e.util.deprecated(".url option for createLink",".value","6.0.0"),(n=t.url||t.value)&&n.trim().length>0){var s=this.options.contentWindow.getSelection();if(s){var r,a,l,c,u=s.getRangeAt(0),d=u.commonAncestorContainer;if(3===u.endContainer.nodeType&&3!==u.startContainer.nodeType&&0===u.startOffset&&u.startContainer.firstChild===u.endContainer&&(d=u.endContainer),a=e.util.getClosestBlockContainer(u.startContainer),l=e.util.getClosestBlockContainer(u.endContainer),3!==d.nodeType&&0!==d.textContent.length&&a===l){var h=a||i,m=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),r=this.exportSelection(),m.appendChild(h.cloneNode(!0)),i===h?e.selection.select(this.options.ownerDocument,h.firstChild,0,h.lastChild,3===h.lastChild.nodeType?h.lastChild.nodeValue.length:h.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,h,0,h,h.childNodes.length);var f=this.exportSelection();0===(c=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,m,{start:r.start-f.start,end:r.end-f.start,editableElementIndex:r.editableElementIndex})).length&&((m=this.options.ownerDocument.createDocumentFragment()).appendChild(d.cloneNode(!0)),c=[m.firstChild.firstChild,m.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,c,n.trim());var p=(m.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,m.firstChild.innerHTML.replace(/^\s+/,"")),r.start-=p,r.end-=p,this.importSelection(r)}else this.options.ownerDocument.execCommand("createLink",!1,n);this.options.targetBlank||"_blank"===t.target?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),n):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),n),t.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),t.buttonClass)}}if(this.options.targetBlank||"_blank"===t.target||t.buttonClass){(o=this.options.ownerDocument.createEvent("HTMLEvents")).initEvent("input",!0,!0,this.options.contentWindow);for(var g=0,b=this.elements.length;g<b;g+=1)this.elements[g].dispatchEvent(o)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",o,i)}},cleanPaste:function(e){this.getExtensionByName("paste").cleanPaste(e)},pasteHTML:function(e,t){this.getExtensionByName("paste").pasteHTML(e,t)},setContent:function(e,t){if(t=t||0,this.elements[t]){var n=this.elements[t];n.innerHTML=e,this.checkContentChanged(n)}},getContent:function(e){return e=e||0,this.elements[e]?this.elements[e].innerHTML.trim():null},checkContentChanged:function(t){t=t||e.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(t,{target:t,currentTarget:t})},resetContent:function(e){if(e){var t=this.elements.indexOf(e);-1!==t&&this.setContent(S[e.getAttribute("medium-editor-index")],t)}else this.elements.forEach((function(e,t){this.setContent(S[e.getAttribute("medium-editor-index")],t)}),this)},addElements:function(e){var t=c(e,this.options.ownerDocument,!0);if(0===t.length)return!1;t.forEach((function(e){e=y.call(this,e,this.id),this.elements.push(e),this.trigger("addElement",{target:e,currentTarget:e},e)}),this)},removeElements:function(e){var t=c(e,this.options.ownerDocument).map((function(e){return e.getAttribute("medium-editor-textarea-id")&&e.parentNode?e.parentNode.querySelector('div[medium-editor-textarea-id="'+e.getAttribute("medium-editor-textarea-id")+'"]'):e}));this.elements=this.elements.filter((function(e){return-1===t.indexOf(e)||(this.events.cleanupElement(e),e.getAttribute("medium-editor-textarea-id")&&u(e),this.trigger("removeElement",{target:e,currentTarget:e},e),!1)}),this)}},e.getEditorFromElement=function(e){var t=e.getAttribute("data-medium-editor-editor-index"),n=e&&e.ownerDocument&&(e.ownerDocument.defaultView||e.ownerDocument.parentWindow);return n&&n._mediumEditors&&n._mediumEditors[t]?n._mediumEditors[t]:null}}(),e.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0},e.parseVersionString=function(e){var t=e.split("-"),n=t[0].split("."),i=t.length>1?t[1]:"";return{major:parseInt(n[0],10),minor:parseInt(n[1],10),revision:parseInt(n[2],10),preRelease:i,toString:function(){return[n[0],n[1],n[2]].join(".")+(i?"-"+i:"")}}},e.version=e.parseVersionString.call(this,"5.23.3"),e}())},70743:function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=l(n(27418)),s=l(n(7836)),r=l(n(67294)),a=l(n(73935));function l(e){return e&&e.__esModule?e:{default:e}}if("undefined"!==typeof document)var c=n(69748);var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,Object.getPrototypeOf(t).call(this,e));return n.state={text:n.props.text},n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this,t=a.default.findDOMNode(this);this.medium=new c(t,this.props.options),this.medium.subscribe("editableInput",(function(n){e._updated=!0,e.change(t.innerHTML)}))}},{key:"componentDidUpdate",value:function(){this.medium.restoreSelection()}},{key:"componentWillUnmount",value:function(){this.medium.destroy()}},{key:"componentWillReceiveProps",value:function(e){e.text===this.state.text||this._updated||this.setState({text:e.text}),this._updated&&(this._updated=!1)}},{key:"render",value:function(){var e=this.props.tag,t=(0,s.default)(this.props,"options","text","tag","contentEditable","dangerouslySetInnerHTML");return(0,o.default)(t,{dangerouslySetInnerHTML:{__html:this.state.text}}),this.medium&&this.medium.saveSelection(),r.default.createElement(e,t)}},{key:"change",value:function(e){this.props.onChange&&this.props.onChange(e,this.medium)}}]),t}(r.default.Component);u.defaultProps={tag:"div"},t.default=u},5575:function(e,t,n){e.exports=n(70743)}}]); \ No newline at end of file