inferno-server
Version:
Provides methods to render HTML strings from Inferno elements
2 lines (1 loc) • 19.8 kB
JavaScript
!function(e,t){"object"===typeof exports&&"undefined"!==typeof module?t(exports,require("inferno"),require("stream")):"function"===typeof define&&define.amd?define(["exports","inferno","stream"],t):t(((e="undefined"!==typeof globalThis?globalThis:e||self).Inferno=e.Inferno||{},e.Inferno.Server=e.Inferno.Server||{}),e.Inferno,e.stream)}(this,(function(e,t,r){"use strict";var n=Array.isArray;function o(e){return void 0===e||null===e}function i(e){return null===e||!1===e||!0===e||void 0===e}function u(e){return"function"===typeof e}function a(e){return"string"===typeof e}function s(e){return"number"===typeof e}function c(e){return null===e}function l(e){return void 0===e}function f(e){throw e||(e="a runtime error occured! Use Inferno in development environment to find the error."),new Error("Inferno Error: "+e)}function h(e){if(a(e))return e;var t,r="";for(var n in e){var o=e[n];("string"===(t=typeof o)||"number"===t)&&(r+=n+":"+o+";")}return r}function p(e){var t=h(e);if(t)return' style="'+t+'"';return""}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d.apply(null,arguments)}var v=/["'&<>]/;function y(e){if(!v.test(e))return e;for(var t="",r="",n=0,o=0;o<e.length;++o){switch(e.charCodeAt(o)){case 34:r=""";break;case 39:r="'";break;case 38:r="&";break;case 60:r="<";break;case 62:r=">";break;default:continue}o>n&&(t+=e.slice(n,o)),t+=r,n=o+1}return t+e.slice(n,o)}var g=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",m=new RegExp("^["+g+"]["+g+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),b={},w={};function x(e){if(void 0!==w[e])return!0;if(void 0!==b[e])return!1;if(m.test(e))return w[e]=!0,!0;return b[e]=!0,!1}var T=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function k(e,t,r){if(e.constructor.getDerivedStateFromProps)return d({},r,e.constructor.getDerivedStateFromProps(t,r));return r}function O(e,r){var n=e.props||t.EMPTY_OBJ;return 32768&e.flags?e.type.render(n,e.ref,r):e.type(n,r)}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},P.apply(null,arguments)}function S(e,r,l){var h=e.flags,d=e.type,v=e.props||t.EMPTY_OBJ,g=e.children;if(0!==(14&h)){if(4&h){var m,b=new d(v,l),w=Boolean(d.getDerivedStateFromProps);if(b.$BS=!1,b.$SSR=!0,u(b.getChildContext)&&(m=b.getChildContext()),m=o(m)?l:P({},l,m),b.props===t.EMPTY_OBJ&&(b.props=v),b.context=l,!w&&u(b.componentWillMount)){b.$BR=!0,b.componentWillMount(),b.$BR=!1;var F=b.$PS;if(F){var Q=b.state;if(null===Q)b.state=F;else for(var _ in F)Q[_]=F[_];b.$PSS=!1,b.$PS=null}}w&&(b.state=k(b,v,b.state));var E=b.render(v,b.state,b.context);if(i(E))return"\x3c!--!--\x3e";if(a(E))return y(E);if(s(E))return E+"";return S(E,e,m)}var j=O(e,l);if(i(j))return"\x3c!--!--\x3e";if(a(j))return y(j);if(s(j))return j+"";return S(j,e,l)}if(0!==(481&h)){var N,L="<"+d,C=T.has(d),B=e.className;if(a(B)?L+=' class="'+y(B)+'"':s(B)&&(L+=' class="'+B+'"'),!c(v)){for(var M in v){var $=v[M];switch(M){case"dangerouslySetInnerHTML":N=$.__html;break;case"style":o(v.style)||(L+=p(v.style));break;case"children":case"className":break;case"defaultValue":v.value||(L+=' value="'+(a($)?y($):$)+'"');break;case"defaultChecked":v.checked||(L+=' checked="'+$+'"');break;default:x(M)&&(a($)?L+=" "+M+'="'+y($)+'"':s($)?L+=" "+M+'="'+$+'"':!0===$&&(L+=" "+M))}}"option"===d&&"undefined"!==typeof v.value&&v.value===r.props.value&&(L+=" selected")}if(C)L+=">";else{L+=">";var I=e.childFlags;if(2===I)L+=S(g,e,l);else if(12&I)for(var D=0,R=g.length;D<R;++D)L+=S(g[D],e,l);else 16===I?L+=""===g?" ":y(g):N&&(L+=N);C||(L+="</"+d+">")}if(String(d).match(/[\s\n/='"\0<>]/))throw L;return L}if(0!==(16&h))return""===g?" ":y(g);if(n(e)||0!==(8192&h)){var A=e.childFlags;if(2===A||n(e)&&0===e.length)return"\x3c!--!--\x3e";if(12&A||n(e)){for(var V=n(e)?e:g,G="",Y=0,W=V.length;Y<W;++Y)G+=S(V[Y],e,l);return G}}else f();return""}function F(e){return S(e,{},{})}function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Q.apply(null,arguments)}function _(e){var t=e.$PS;if(t){var r=e.state;e.state=null===r?t:Q({},r,t),e.$PS=null}e.$BR=!1}function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E.apply(null,arguments)}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},j(e,t)}var N=function(e){function r(t){var r;return(r=e.call(this)||this).collector=[1/0],r.promises=[],r.pushQueue=r.pushQueue.bind(r),t&&r.renderVNodeToQueue(t,null,null),r}var h,d;d=e,(h=r).prototype=Object.create(d.prototype),h.prototype.constructor=h,j(h,d);var v=r.prototype;return v._read=function(){setTimeout(this.pushQueue,0)},v.addToQueue=function(e,t){if(o(t))"string"===typeof e&&this.collector.length-1===0?this.push(e):"string"===typeof e&&"string"===typeof this.collector[this.collector.length-2]?this.collector[this.collector.length-2]+=e:this.collector.splice(-1,0,e);else{var r=this.promises[t].length-1;"string"===typeof this.promises[t][r]&&"string"===typeof e?this.promises[t][r]+=e:this.promises[t].push(e)}},v.pushQueue=function(){var e=this,t=this.collector[0];"string"===typeof t?(this.push(t),this.collector.shift()):t&&("object"===typeof t||u(t))&&u(t.then)?(t.then((function(t){var r;(r=e.collector).splice.apply(r,[0,1].concat(e.promises[t])),e.promises[t]=null,setTimeout(e.pushQueue,0)})),this.collector[0]=null):t===1/0&&this.emit("end")},v.renderVNodeToQueue=function(e,r,h){var d=this,v=e.flags,g=e.type,m=e.props||t.EMPTY_OBJ,b=e.children;if((14&v)>0)if(4&v){var w,P=new g(m,r),S=Boolean(g.getDerivedStateFromProps);if(P.$BS=!1,P.$SSR=!0,l(P.getChildContext)||(w=P.getChildContext()),o(w)||(r=E({},r,w)),P.props===t.EMPTY_OBJ&&(P.props=m),P.context=r,!S&&u(P.componentWillMount)&&(P.$BR=!0,P.componentWillMount(),_(P)),u(P.getInitialProps)){var F=P.getInitialProps(P.props,P.context);if(F){if(Promise.resolve(F)===F){var Q=this.promises.push([])-1;return void this.addToQueue(F.then((function(e){"object"===typeof e&&(P.props=E({},P.props,e));var t=P.render(P.props,P.state,P.context);return i(t)?d.addToQueue("\x3c!--!--\x3e",Q):a(t)?d.addToQueue(y(t),Q):s(t)?d.addToQueue(t+"",Q):d.renderVNodeToQueue(t,P.context,Q),setTimeout(d.pushQueue,0),Q})),h)}P.props=E({},P.props,F)}}S&&(P.state=k(P,m,P.state));var j=P.render(P.props,P.state,P.context);i(j)?this.addToQueue("\x3c!--!--\x3e",h):a(j)?this.addToQueue(y(j),h):s(j)?this.addToQueue(j+"",h):this.renderVNodeToQueue(j,r,h)}else{var N=O(e,r);i(N)?this.addToQueue("\x3c!--!--\x3e",h):a(N)?this.addToQueue(y(N),h):s(N)?this.addToQueue(N+"",h):this.renderVNodeToQueue(N,r,h)}else if((481&v)>0){var L,C="<"+g,B=T.has(g),M=e.className;if(a(M)?C+=' class="'+y(M)+'"':s(M)&&(C+=' class="'+M+'"'),!c(m))for(var $ in m){var I=m[$];switch($){case"dangerouslySetInnerHTML":L=I.__html;break;case"style":o(m.style)||(C+=p(m.style));break;case"children":case"className":break;case"defaultValue":m.value||(C+=' value="'+(a(I)?y(I):I)+'"');break;case"defaultChecked":m.checked||(C+=' checked="'+I+'"');break;default:x($)&&(a(I)?C+=" "+$+'="'+y(I)+'"':s(I)?C+=" "+$+'="'+I+'"':!0===I&&(C+=" "+$))}}if(C+=">",String(g).match(/[\s\n/='"\0<>]/))throw C;if(B)this.addToQueue(C,h);else{var D=e.childFlags;if(2===D)return this.addToQueue(C,h),this.renderVNodeToQueue(b,r,h),void this.addToQueue("</"+g+">",h);if(16===D)return this.addToQueue(C,h),this.addToQueue(""===b?" ":y(b+""),h),void this.addToQueue("</"+g+">",h);if(12&D){this.addToQueue(C,h);for(var R=0,A=b.length;R<A;++R)this.renderVNodeToQueue(b[R],r,h);return void this.addToQueue("</"+g+">",h)}if(L)return void this.addToQueue(C+L+"</"+g+">",h);B||this.addToQueue(C+"</"+g+">",h)}}else if((16&v)>0)this.addToQueue(""===b?" ":y(b),h);else if(n(e)||0!==(8192&v)){var V=e.childFlags;if(2===V||n(e)&&0===e.length)this.addToQueue("\x3c!--!--\x3e",h);else if(12&V||n(e))for(var G=n(e)?e:e.children,Y=0,W=G.length;Y<W;++Y)this.renderVNodeToQueue(G[Y],r,h)}else f()},r}(r.Readable);function L(e){return new N(e)}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},C.apply(null,arguments)}function B(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */B=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,u=Object.create(i.prototype),a=new E(n||[]);return o(u,"_invoke",{value:S(e,r,a)}),u}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",y={};function g(){}function m(){}function b(){}var w={};c(w,u,(function(){return this}));var x=Object.getPrototypeOf,T=x&&x(x(j([])));T&&T!==r&&n.call(T,u)&&(w=T);var k=b.prototype=g.prototype=Object.create(w);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function r(o,i,u,a){var s=f(e[o],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,u,a)}),(function(e){r("throw",e,u,a)})):t.resolve(l).then((function(e){c.value=e,u(c)}),(function(e){return r("throw",e,u,a)}))}a(s.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function S(t,r,n){var o=h;return function(i,u){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===i)throw u;return{value:e,done:!0}}for(n.method=i,n.arg=u;;){var a=n.delegate;if(a){var s=F(a,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?v:p,c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function F(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,F(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var u=i.arg;return u?u.done?(r[t.resultName]=u.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):u:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function Q(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(Q,this),this.reset(!0)}function j(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:m,configurable:!0}),m.displayName=c(b,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,s,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},O(P.prototype),c(P.prototype,a,(function(){return this})),t.AsyncIterator=P,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var u=new P(l(e,r,n,o),i);return t.isGeneratorFunction(r)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},O(k),c(k,s,"Generator"),c(k,u,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=j,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(_),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return a.type="throw",a.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],a=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var s=n.call(u,"catchLoc"),c=n.call(u,"finallyLoc");if(s&&c){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=e,u.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function M(e,t,r,n,o,i,u){try{var a=e[i](u),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function $(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){M(i,n,o,u,a,"next",e)}function a(e){M(i,n,o,u,a,"throw",e)}u(void 0)}))}}function I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}var D=Promise.resolve(),R=function(e){function t(t){var r;return(r=e.call(this)||this).initNode=void 0,r.started=!1,r.initNode=t,r}var r,l;l=e,(r=t).prototype=Object.create(l.prototype),r.prototype.constructor=r,I(r,l);var f=t.prototype;return f._read=function(){var e=this;if(this.started)return;this.started=!0,D.then((function(){return e.renderNode(e.initNode,null)})).then((function(){e.push(null)})).catch((function(t){e.emit("error",t)}))},f.renderNode=function(e,t){var r=e.flags;if((14&r)>0)return this.renderComponent(e,t,4&r);if((481&r)>0)return this.renderElement(e,t);if(n(e)||0!==(8192&r))return this.renderArrayOrFragment(e,t);this.renderText(e)},f.renderArrayOrFragment=function(e,t){var r=this,o=e.childFlags;if(2===o||n(e)&&0===e.length)return this.push("\x3c!--!--\x3e");if(12&o||n(e))return(n(e)?e:e.children).reduce(function(){var e=$(B().mark((function e(n,o){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.then($(B().mark((function e(){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve(r.renderNode(o,t)).then((function(){return!!(16&o.flags)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Promise.resolve(!1))},f.renderComponent=function(e,t,r){var n=this,c=e.type,l=e.props;if(!r){var f=O(e,t);if(i(f))return this.push("\x3c!--!--\x3e");if(a(f))return this.push(y(f));if(s(f))return this.push(f+"");return this.renderNode(f,t)}var h,p=new c(l,t),d=Boolean(c.getDerivedStateFromProps);return p.$BS=!1,p.$SSR=!0,u(p.getChildContext)&&(h=p.getChildContext()),o(h)||(t=C({},t,h)),p.context=t,p.$BR=!0,Promise.resolve(!d&&(null==p.componentWillMount?void 0:p.componentWillMount())).then((function(){_(p),d&&(p.state=k(p,l,p.state));var e=p.render(p.props,p.state,p.context);if(i(e))return n.push("\x3c!--!--\x3e");if(a(e))return n.push(y(e));if(s(e))return n.push(e+"");return n.renderNode(e,t)}))},f.renderChildren=function(e,t,r){var n=this;if(2===r)return this.renderNode(e,t);if(16===r)return this.push(""===e?" ":y(e+""));if(12&r)return e.reduce(function(){var e=$(B().mark((function e(r,o){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.then($(B().mark((function e(){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve(n.renderNode(o,t)).then((function(){return!!(16&o.flags)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Promise.resolve(!1))},f.renderText=function(e){this.push(""===e.children?" ":y(e.children))},f.renderElement=function(e,t){var r,n=this,i=e.type,u=e.props,l="<"+i,f=T.has(i),h=e.className;if(a(h)?l+=' class="'+y(h)+'"':s(h)&&(l+=' class="'+h+'"'),!c(u))for(var d in u){var v=u[d];switch(d){case"dangerouslySetInnerHTML":r=v.__html;break;case"style":o(u.style)||(l+=p(u.style));break;case"children":case"className":break;case"defaultValue":u.value||(l+=' value="'+(a(v)?y(v):v)+'"');break;case"defaultChecked":u.checked||(l+=' checked="'+v+'"');break;default:if(x(d)){a(v)?l+=" "+d+'="'+y(v)+'"':s(v)?l+=" "+d+'="'+v+'"':!0===v&&(l+=" "+d);break}}}if(l+=">",this.push(l),String(i).match(/[\s\n/='"\0<>]/))throw l;if(f)return;if(r)return this.push(r),void this.push("</"+i+">");var g=e.childFlags;if(1===g)return void this.push("</"+i+">");return Promise.resolve(this.renderChildren(e.children,t,g)).then((function(){n.push("</"+i+">")}))},t}(r.Readable);function A(e){return new R(e)}e.RenderQueueStream=N,e.RenderStream=R,e.renderToStaticMarkup=F,e.renderToString=F,e.streamAsStaticMarkup=A,e.streamAsString=A,e.streamQueueAsStaticMarkup=L,e.streamQueueAsString=L}));