YUI.add("aui-parse-content",function(e,t){var n=e.Lang,r=n.isString,i=e.config.doc,s="<div>_</div>",o={"":1,module:1,"module-shim":1,"text/javascript":1,"text/parsed":1},u=e.Component.create({NAME:"ParseContent",NS:"ParseContent",ATTRS:{queue:{value:null},preserveScriptNodes:{validator:n.isBoolean,value:!1}},EXTENDS:e.Plugin.Base,prototype:{initializer:function(){var t=this;u.superclass.initializer.apply(this,arguments),t.set("queue",new e.AsyncQueue),t._bindAOP()},globalEval:function(t){typeof t=="string"&&(t={text:t,type:"text/javascript"});var r=e.getDoc(),s=r.one("head")||r.get("documentElement"),o=i.createElement("script");o.type=t.type,t.text&&(o.text=n.trim(t.text)),s.appendChild(o).remove()},parseContent:function(e){var t=this,n=t._extractScripts(e);return t._dispatch(n),n},_bindAOP:function(){var t=this,n=function(n){var r=Array.prototype.slice.call(arguments),i=t.parseContent(n);return r.splice(0,1,i.fragment),new e.Do.AlterArgs(null,r)};this.doBefore("insert",n),this.doBefore("replaceChild",n);var r=function(n){var r=t.parseContent(n);return new e.Do.AlterArgs(null,[r.fragment])};this.doBefore("replace",r),this.doBefore("setContent",r)},_extractScripts:function(t){var n=this,i=e.Node.create("<div></div>"),u={},a=n.get("preserveScriptNodes");return r(t)?(t=s+t,e.DOM.addHTML(i,t,"append")):(i.append(s),i.append(t)),u.js=i.all("script").filter(function(e){var t=o[e.getAttribute("type").toLowerCase()];return a&&e.setAttribute("type","text/parsed"),t}),a||u.js.each(function(e){e.remove()}),i.get("firstChild").remove(),u.fragment=i.get("childNodes").toFrag(),u},_dispatch:function(t){var n=this,r=n.get("queue");t.js.each(function(t){var i=t.get("src");if(i)r.add({autoContinue:!1,fn:function(){e.Get.script(i,{onEnd:function(e){e.purge(),r.run()}})},timeout:0});else{var s=t._node;r.add({args:{type:s.type,text:s.text||s.textContent||s.innerHTML||""},context:n,fn:n.globalEval,timeout:0})}}),r.run()}}});e.namespace("Plugin").ParseContent=u},"3.1.0-deprecated.112",{requires:["async-queue","plugin","io-base","aui-component","aui-node-base"]});
