UNPKG

dynamictemplate

Version:
1 lines 20.8 kB
(function(){var a=function(b,c){var d=a.resolve(b,c||"/"),e=a.modules[d];if(!e)throw new Error("Failed to resolve module "+b+", tried "+d);var f=e._cached?e._cached:e();return f},b=a;a.paths=[],a.modules={},a.extensions=[".js",".coffee"],a._core={assert:!0,events:!0,fs:!0,path:!0,vm:!0},a.resolve=function(){return function(b,c){function h(b){if(a.modules[b])return b;for(var c=0;c<a.extensions.length;c++){var d=a.extensions[c];if(a.modules[b+d])return b+d}}function i(b){b=b.replace(/\/+$/,"");var c=b+"/package.json";if(a.modules[c]){var e=a.modules[c](),f=e.browserify;if(typeof f=="object"&&f.main){var g=h(d.resolve(b,f.main));if(g)return g}else if(typeof f=="string"){var g=h(d.resolve(b,f));if(g)return g}else if(e.main){var g=h(d.resolve(b,e.main));if(g)return g}}return h(b+"/index")}function j(a,b){var c=k(b);for(var d=0;d<c.length;d++){var e=c[d],f=h(e+"/"+a);if(f)return f;var g=i(e+"/"+a);if(g)return g}var f=h(a);if(f)return f}function k(a){var b;a==="/"?b=[""]:b=d.normalize(a).split("/");var c=[];for(var e=b.length-1;e>=0;e--){if(b[e]==="node_modules")continue;var f=b.slice(0,e+1).join("/")+"/node_modules";c.push(f)}return c}c||(c="/");if(a._core[b])return b;var d=a.modules.path(),e=c||".";if(b.match(/^(?:\.\.?\/|\/)/)){var f=h(d.resolve(e,b))||i(d.resolve(e,b));if(f)return f}var g=j(b,e);if(g)return g;throw new Error("Cannot find module '"+b+"'")}}(),a.alias=function(b,d){var e=a.modules.path(),f=null;try{f=a.resolve(b+"/package.json","/")}catch(g){f=a.resolve(b,"/")}var h=e.dirname(f),i=c(a.modules);for(var j=0;j<i.length;j++){var k=i[j];if(k.slice(0,h.length+1)===h+"/"){var l=k.slice(h.length);a.modules[d+l]=a.modules[h+l]}else k===h&&(a.modules[d]=a.modules[h])}},a.define=function(b,c){var d=a._core[b]?"":a.modules.path().dirname(b),e=function(b){return a(b,d)};e.resolve=function(b){return a.resolve(b,d)},e.modules=a.modules;var f={exports:{}};a.modules[b]=function(){return c.call(f.exports,e,f,f.exports,d,b),a.modules[b]._cached=f.exports,f.exports}};var c=Object.keys||function(a){var b=[];for(var c in a)b.push(c);return b};typeof process=="undefined"&&(process={}),process.nextTick||(process.nextTick=function(a){setTimeout(a,0)}),process.title||(process.title="browser"),process.binding||(process.binding=function(b){if(b==="evals")return a("vm");throw new Error("No such module")}),process.cwd||(process.cwd=function(){return"."}),a.define("path",function(a,b,c,d,e){function f(a,b){var c=[];for(var d=0;d<a.length;d++)b(a[d],d,a)&&c.push(a[d]);return c}function g(a,b){var c=0;for(var d=a.length;d>=0;d--){var e=a[d];e=="."?a.splice(d,1):e===".."?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}var h=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;c.resolve=function(){var a="",b=!1;for(var c=arguments.length;c>=-1&&!b;c--){var d=c<0?process.cwd():arguments[c];if(typeof d!="string"||!d)continue;a=d+"/"+a,b=d.charAt(0)==="/"}return a=g(f(a.split("/"),function(a){return!!a}),!b).join("/"),(b?"/":"")+a||"."},c.normalize=function(a){var b=a.charAt(0)==="/",c=a.slice(-1)==="/";return a=g(f(a.split("/"),function(a){return!!a}),!b).join("/"),!a&&!b&&(a="."),a&&c&&(a+="/"),(b?"/":"")+a},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(f(a,function(a,b){return a&&typeof a=="string"}).join("/"))},c.dirname=function(a){var b=h.exec(a)[1]||"",c=!1;return b?b.length===1||c&&b.length<=3&&b.charAt(1)===":"?b:b.substring(0,b.length-1):"."},c.basename=function(a,b){var c=h.exec(a)[2]||"";return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){return h.exec(a)[3]||""}}),a.define("/dynamictemplate.js",function(a,b,c,d,e){(function(){var c,d,e,f;f=a("asyncxml"),d=f.Tag,c=f.Builder,e=a("./template"),b.exports={Tag:d,Builder:c,Template:e},process.title==="browser"&&function(){return this.dynamictemplate!=null?(this.dynamictemplate.Template=e,this.dynamictemplate.Builder=c,this.dynamictemplate.Tag=d):this.dynamictemplate=b.exports}.call(window)}).call(this)}),a.define("/node_modules/asyncxml/package.json",function(a,b,c,d,e){b.exports={name:"asyncxml",description:"async xml builder and generator",version:"0.2.0",homepage:"https://github.com/dodo/node-asyncxml",author:"dodo (https://github.com/dodo)",repository:{type:"git",url:"git://github.com/dodo/node-asyncxml.git"},main:"asyncxml.js",engines:{node:">= 0.4.x"},keywords:["async","xml","generation","stream","browser"],scripts:{test:"cake build && nodeunit test",prepublish:"cake build"},devDependencies:{"coffee-script":">= 1.1.2",muffin:">= 0.2.6",browserify:"1.6.1",scopify:">= 0.1.0",nodeunit:">= 0.5.4"}}}),a.define("/node_modules/asyncxml/asyncxml.js",function(a,b,c,d,e){b.exports=a("./lib/asyncxml")}),a.define("/node_modules/asyncxml/lib/asyncxml.js",function(a,b,c,d,e){(function(){var c,d,e;e=a("./xml"),d=e.Tag,c=e.Builder,this.asyncxml=b.exports={Tag:d,Builder:c}}).call(this)}),a.define("/node_modules/asyncxml/lib/xml.js",function(a,b,c,d,e){(function(){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q=Array.prototype.slice,r=function(a,b){return function(){return a.apply(b,arguments)}},s=Object.prototype.hasOwnProperty,t=function(a,b){function d(){this.constructor=a}for(var c in b)s.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};e=a("events").EventEmitter,p=a("./util"),g=p.deep_merge,l=p.prettify,i=p.new_attrs,n=p.safe,d=["add","attr","attr:remove","text","remove","close","attach","detach"],k=function(a,b,c,d){var e;return typeof b!="object"?(e=[c,b,{}],d=e[0],c=e[1],b=e[2]):b==null&&(b={}),d==null&&(d={}),[a,b,c,d]},h=function(){var a,b,c,d;if(this.buffer.length){d=this.buffer;for(b=0,c=d.length;b<c;b++)a=d[b],this.write(a);return this.buffer=[]}},m=function(a){var b,c,e,f;this.removeListener("data",a.data),f=[];for(c=0,e=d.length;c<e;c++)b=d[c],f.push(this.removeListener(b,a[b]));return f},j=function(){var a,b,c,e,f,i,j,l,n=this;return j=k.apply(null,arguments),e=j[0],a=j[1],b=j[2],i=j[3],c={},(l=i.level)==null&&(i.level=this.level+1),i=g(this.builder.opts,i),i.builder=this.builder,f=new this.builder.Tag(e,a,null,i),f.parent=this,this.builder.approve("new",this,f,function(a,e){var f,g,j,k,l;e.on("data",c.data=function(a){return n.pending[0]===e?n.write(a):n.buffer.push(a)}),j=function(a){return e.on(a,c[a]=function(){return n.emit.apply(n,[a].concat(q.call(arguments)))})};for(k=0,l=d.length;k<l;k++)f=d[k],j(f);e.once("end",g=function(){var a,b,d,f,i;if(n.pending[0]===e)e.pending.length?e.pending[0].once("end",g):(e.buffer.length&&(n.buffer=n.buffer.concat(e.buffer),e.buffer=[]),n.pending=n.pending.slice(1),m.call(e,c),h.call(n),n.closed&&n.pending.length===0&&n.end());else{i=n.pending;for(b=0,f=i.length;b<f;b++){d=i[b];if(e===d){n.pending=n.pending.slice(0,b).concat(n.pending.slice(b+1)),n.buffer.length&&(a=n.pending[b-1],a.buffer=a.buffer.concat(n.buffer),n.buffer=[]),m.call(e,c),n.closed==="pending"&&(h.call(n),n.end());return}}throw new Error("this shouldn't happen D:")}}),n.pending.push(e),n.emit("new",e),n.emit("add",e);if(b!=null)return e.children(b,i)}),f},o=function(){var a,b,c,d,e,f;return f=k.apply(null,arguments),c=f[0],a=f[1],b=f[2],d=f[3],e=function(){return this.children(b),this.end()},j.call(this,c,a,e,d)},f=function(){function a(){this.detach=r(this.detach,this),this.attach=r(this.attach,this),this.remove=r(this.remove,this),this.toString=r(this.toString,this),this.end=r(this.end,this),this.up=r(this.up,this),this.write=r(this.write,this),this.text=r(this.text,this),this.children=r(this.children,this),this.removeAttr=r(this.removeAttr,this),this.attr=r(this.attr,this),this.emit=r(this.emit,this);var a,b,c,d;c=k.apply(null,arguments),this.name=c[0],this.attrs=c[1],a=c[2],b=c[3],this.pretty=(d=b.pretty)!=null?d:!1,this.level=b.level,this.builder=b.builder,this.buffer=[],this.pending=[],this.parent=this.builder,this.closed=!1,this.writable=!0,this.isempty=!0,this.content="",this.children(a,b),this.$tag=o,this.tag=j}return t(a,e),a.prototype.emit=function(){var b;return this.builder.closed===!0&&this.parent.closed===!0?(b=this.builder).emit.apply(b,arguments):a.__super__.emit.apply(this,arguments)},a.prototype.attr=function(a,b){var c,d,e;if(typeof a=="string"){if(b==null&&(c=this.builder.query("attr",this,a))!=null)return this.attrs[a]=c,c;this.attrs[a]=b,this.emit("attr",this,a,b)}else for(d in a){if(!s.call(a,d))continue;e=a[d],this.attrs[d]=e,this.emit("attr",this,d,e)}return this},a.prototype.removeAttr=function(a){var b,c;if(typeof a=="string")delete this.attrs[a],this.emit("attr:remove",this,a);else for(b in a){if(!s.call(a,b))continue;c=a[b],delete this.attr[a],this.emit("attr:remove",this,a)}return this},a.prototype.children=function(a){return a==null?this:(typeof a=="function"?a.call(this):this.text(a),this)},a.prototype.text=function(a,b){return b==null&&(b={}),a==null&&!b.force?this.content=this.builder.query("text",this):(b.escape&&(a=n(a)),this.write(a,g(b,{escape:!1})),b.append?this.content+=a:this.content=a,this.emit("text",this,this.content),this)},a.prototype.write=function(a,b){var c;return c=(b!=null?b:{}).escape,c&&(a=n(a)),this.isempty&&(this.emit("data",l(this,"<"+this.name+i(this.attrs)+">")),this.isempty=!1),a&&this.emit("data",l(this,""+a)),!0},a.prototype.up=function(a){var b;return a==null&&(a={}),(b=a.end)==null&&(a.end=!0),a.end&&this.end.apply(this,arguments),this.parent},a.prototype.end=function(){var a=this;return!this.closed||this.closed==="pending"||this.closed==="approving"?this.pending.length?this.closed="pending":this.closed!=="approving"&&(this.closed="approving",this.builder.approve("end",this,function(){var b;return a.isempty?(b="<"+a.name+i(a.attrs)+"/>",a.closed="self"):(b="</"+a.name+">",a.closed=!0),a.emit("data",l(a,b)),a.emit("close",a),a.emit("end"),a.writable=!1})):this.closed==="removed"?(this.emit("end"),this.writable=!1):(this.closed=!0,this.writable=!1),this},a.prototype.toString=function(){return"<"+this.name+i(this.attrs)+(this.closed==="self"?"/>":this.closed?">"+this.content+"</"+this.name+">":void 0)},a.prototype.remove=function(){return this.closed||(this.closed="removed"),this.emit("remove",this),this},a.prototype.attach=function(a){return a.parent=this,this.emit("attach",a),this},a.prototype.detach=function(){return this.emit("detach",this),this},a}(),c=function(){function a(a){var b,c,d;this.opts=a!=null?a:{},this.end=r(this.end,this),this.write=r(this.write,this),this.builder=this,this.buffer=[],this.pending=[],this.checkers={},this.closed=!1,(c=(b=this.opts).pretty)==null&&(b.pretty=!1),this.level=(d=this.opts.level)!=null?d:-1,this.Tag=f,this.tag=j,this.$tag=o}return t(a,e),a.prototype.write=function(a){return this.emit("data",a)},a.prototype.end=function(){return this.pending.length?(this.closed="pending",this.pending[0].once("end",this.end)):((!this.closed||this.closed==="pending")&&this.emit("end"),this.closed=!0),this},a.prototype.query=function(a,b,c){if(a==="attr")return b.attrs[c];if(a==="text")return b.content},a.prototype.register=function(a,b){var c,d;if(a!=="new"&&a!=="end")throw new Error("only type 'new' or 'end' allowed.");return(d=(c=this.checkers)[a])==null&&(c[a]=[]),this.checkers[a].push(b)},a.prototype.approve=function(a,b,c,d){var e,f,g,h,i;e=(g=(h=this.checkers[a])!=null?typeof h.slice==="function"?h.slice():void 0:void 0)!=null?g:[];if(a==="new")f=function(a){var c,g;return c=(g=e.shift())!=null?g:d,c(b,a,f)};else if(a==="end")i=[c,b],d=i[0],c=i[1],f=function(a){var b,c;return b=(c=e.shift())!=null?c:d,b(a,f)};else throw new Error("type '"+a+"' not supported.");return f(c)},a}(),b.exports={Tag:f,Builder:c}}).call(this)}),a.define("events",function(a,b,c,d,e){process.EventEmitter||(process.EventEmitter=function(){});var f=c.EventEmitter=process.EventEmitter,g=typeof Array.isArray=="function"?Array.isArray:function(a){return Object.toString.call(a)==="[object Array]"},h=10;f.prototype.setMaxListeners=function(a){this._events||(this._events={}),this._events.maxListeners=a},f.prototype.emit=function(a){if(a==="error")if(!this._events||!this._events.error||g(this._events.error)&&!this._events.error.length)throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var b=this._events[a];if(!b)return!1;if(typeof b=="function"){switch(arguments.length){case 1:b.call(this);break;case 2:b.call(this,arguments[1]);break;case 3:b.call(this,arguments[1],arguments[2]);break;default:var c=Array.prototype.slice.call(arguments,1);b.apply(this,c)}return!0}if(g(b)){var c=Array.prototype.slice.call(arguments,1),d=b.slice();for(var e=0,f=d.length;e<f;e++)d[e].apply(this,c);return!0}return!1},f.prototype.addListener=function(a,b){if("function"!=typeof b)throw new Error("addListener only takes instances of Function");this._events||(this._events={}),this.emit("newListener",a,b);if(!this._events[a])this._events[a]=b;else if(g(this._events[a])){if(!this._events[a].warned){var c;this._events.maxListeners!==undefined?c=this._events.maxListeners:c=h,c&&c>0&&this._events[a].length>c&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),console.trace())}this._events[a].push(b)}else this._events[a]=[this._events[a],b];return this},f.prototype.on=f.prototype.addListener,f.prototype.once=function(a,b){var c=this;return c.on(a,function d(){c.removeListener(a,d),b.apply(this,arguments)}),this},f.prototype.removeListener=function(a,b){if("function"!=typeof b)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[a])return this;var c=this._events[a];if(g(c)){var d=c.indexOf(b);if(d<0)return this;c.splice(d,1),c.length==0&&delete this._events[a]}else this._events[a]===b&&delete this._events[a];return this},f.prototype.removeAllListeners=function(a){return a&&this._events&&this._events[a]&&(this._events[a]=null),this},f.prototype.listeners=function(a){return this._events||(this._events={}),this._events[a]||(this._events[a]=[]),g(this._events[a])||(this._events[a]=[this._events[a]]),this._events[a]}}),a.define("/node_modules/asyncxml/lib/util.js",function(a,b,c,d,e){(function(){var a,c,d,e,f,g,h,i=Array.prototype.slice;e=Array.isArray,c=function(){var a,b,d,f,g,h,j;d=1>arguments.length?[]:i.call(arguments,0),e(d[0])&&(d=d[0]),f={};for(h=0,j=d.length;h<j;h++){b=d[h];for(a in b)g=b[a],typeof g=="object"&&!e(g)?f[a]=c(f[a]||{},g):f[a]=g}return f},d=function(a){var b,c;return b=a.level,c=a.pretty,!c||b===0?"":(c===!0&&(c=" "),c)},a=function(a,b){var c,d;return c=a.level,d=a.pretty,d?(b!=null?b[(b!=null?b.length:void 0)-1]:void 0)==="\n"?b:""+b+"\n":b},g=function(b,c){return(b!=null?!b.pretty:!void 0)?c:""+d(b)+a(b,c)},f=function(a){var b,c,d;return a==null&&(a={}),c=function(){var c;c=[];for(b in a)d=a[b],d!=null?(typeof d!="number"&&(d='"'+d+'"'),c.push(""+b+"="+d)):c.push(""+b);return c}(),c.length&&c.unshift(""),c.join(" ")},h=function(a){return String(a).replace(/&(?!\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},b.exports={deep_merge:c,prettify:g,indent:d,new_attrs:f,safe:h}}).call(this)}),a.define("/template.js",function(a,b,c,d,e){(function(){var c,d,e,f,g,h,i,j,k,l,m=function(a,b){return function(){return a.apply(b,arguments)}},n=Object.prototype.hasOwnProperty,o=function(a,b){function d(){this.constructor=a}for(var c in b)n.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},p=Array.prototype.slice;e=a("events").EventEmitter,c=a("asyncxml").Builder,d=["new","add","attach","detach","attr","attr:remove","text","remove","data","close","end"],k={xml:function(){return""},html:function(){return""+k.xml()+" "+k["html-obsolete"]()+" iframe label legend "+(""+l.html()+" html body div ul li a b body button colgroup ")+"dfn div dl dt em dd del form h1 h2 h3 h4 h5 h6 head hgroup html ins "+"li map i mark menu meter nav noscript object ol optgroup option p "+"pre script select small span strong style sub sup table tbody tfoot "+"td textarea th thead title tr u ul"},html5:function(){return""+k.html()+" "+l.html5()+" section article video q s "+"audio abbr address aside bdi bdo blockquote canvas caption cite code "+"datalist details fieldset figcaption figure footer header kbd output "+"progress rp rt ruby samp summary time"},strict:function(){return""+k.html()},"xhtml1.1":function(){return""+k.xhtml()},xhtml:function(){return""+k.xhtml()},frameset:function(){return""+k.xhtml()},transitional:function(){return""+k.xhtml()},mobile:function(){return""+k.xhtml()},"html-ce":function(){return""+k.xhtml()},"html-obsolete":function(){return"applet acronym bgsound dir frameset noframes isindex listing nextid noembed plaintext rb strike xmp big blink center font marquee nobr multicol spacer tt"}},l={xml:function(){return!0},html:function(){return"area br col embed hr img input link meta param"},html5:function(){return""+l.html()+" base command keygen source track wbr"},mobile:function(){return""+l.xhtml()},"html-ce":function(){return""+l.xhtml()},strict:function(){return""+l.xhtml()},"xhtml1.1":function(){return""+l.xhtml()},xhtml:function(){return""+l.xhtml()},frameset:function(){return""+l.xhtml()},transitional:function(){return""+l.xhtml()}},h={xml:function(a){var b;return b=a.encoding,'<?xml version="1.0" encoding="'+b+'" ?>'},html:function(){return"<!DOCTYPE html>"},html5:function(){return""+h.html()},mobile:function(){return'<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">'},"html-ce":function(){return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "ce-html-1.0-transitional.dtd">'},strict:function(){return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'},"xhtml1.1":function(){return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'},xhtml:function(){return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">'},frameset:function(){return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'},transitional:function(){return'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'}},g={"default":"xml",5:"html5",5:"html5",ce:"html-ce",1.1:"xhtml1.1",html11:"xhtml1.1",basic:"xhtml",xhtml1:"xhtml","xhtml-basic":"xhtml","xhtml-strict":"strict","xhtml-mobile":"mobile","xhtml-frameset":"frameset","xhtml-trasitional":"transitional"},j=function(a,b){return a[b]=function(){var a;return this.tag.apply(this,(a=[b]).concat.apply(a,arguments))},a["$"+b]=function(){var a;return this.$tag.apply(this,(a=[b]).concat.apply(a,arguments))}},i=function(a,b){var c,d,e;for(d=0,e=b.length;d<e;d++)c=b[d],c&&j(a,c)},f=function(){function a(a,b){var e,f,j,n,q,r,s,t,u,v,w,x,y=this;a==null&&(a={}),this.ready=m(this.ready,this),this.end=m(this.end,this),this.register=m(this.register,this),typeof a=="function"&&(t=[a,{}],b=t[0],a=t[1]),(u=a.encoding)==null&&(a.encoding="utf-8"),(v=a.doctype)==null&&(a.doctype=!1),(w=a.end)==null&&(a.end=!0),s=a.schema,r=g[s]||s||"xml",a.self_closing=typeof l[r]=="function"?l[r](a):void 0,a.schema=typeof k[r]=="function"?k[r](a).split(" "):void 0,e=(x=a.Builder)!=null?x:c,f=function(){function a(){a.__super__.constructor.apply(this,arguments)}return o(a,e),a}(),i(f.prototype,a.schema),this.xml=new f(a),n=this.xml.Tag,j=function(){function a(){a.__super__.constructor.apply(this,arguments)}return o(a,n),a}(),i(j.prototype,a.schema),this.xml.Tag=this.xml.opts.Tag=j,q=n.prototype.end,this.xml.Tag.prototype.end=function(){return a.self_closing===!0||a.self_closing.match(this.name)?q.call.apply(q,[this].concat(p.call(arguments))):(this.isempty&&this.text("",{force:!0}),q.call.apply(q,[this].concat(p.call(arguments))))},d.forEach(function(a){return y.xml.on(a,function(){var b;return b=1>arguments.length?[]:p.call(arguments,0),y.emit.apply(y,[a].concat(p.call(b)))})}),process.nextTick(function(){var c,d;a.doctype===!0&&(a.doctype="html"),c=g[a.doctype]||a.doctype,a.doctype&&(d=typeof h[c]=="function"?h[c](a):void 0)&&(a.pretty&&(d+="\n"),y.xml.emit("data",d));if(typeof b!="function")return y.end(b);b.call(y.xml);if(a.end)return y.end()})}return o(a,e),a.prototype.register=function(){var a;return(a=this.xml).register.apply(a,arguments)},a.prototype.end=function(){var a;return(a=this.xml).end.apply(a,arguments)},a.prototype.ready=function(a){return this.xml.closed===!0?a():this.xml.once("end",a)},a}(),f.schema=k,f.doctype=h,b.exports=f,f.self_closing=l}).call(this)})}).call(this)