/* SCEditor v2.1.2 | (C) 2017, Sam Clarke | sceditor.com/license */

!function(e,t){"use strict";function n(e){return'<iframe width="560" height="315" frameborder="0" src="https://www.youtube-nocookie.com/embed/'+e+'" data-youtube-id="'+e+'" allowfullscreen></iframe>'}function o(t){for(var s=t.firstChild;s;){if(3===s.nodeType){var u=s.nodeValue,a=s.parentNode,c=u.match(r);c&&(a.insertBefore(e.createTextNode(u.substr(0,c.index)+c[1]),s),a.insertBefore(i.parseHTML(n(c[2])),s),s.nodeValue=c[3]+u.substr(c.index+c[0].length))}else i.is(s,"code")||o(s);s=s.nextSibling}}var i=t.dom,r=/(^|\s)(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/watch\?v=)([^"&?\/ ]{11})(?:\&[\&_\?0-9a-z\#]+)?(\s|$)/i;t.plugins.autoyoutube=function(){this.signalPasteRaw=function(t){if(!i.closest(this.currentNode(),"code")&&(t.html||t.text)){var n=e.createElement("div");t.html?n.innerHTML=t.html:n.textContent=t.text,o(n),t.html=n.innerHTML}}}}(document,sceditor);