import { options as l$1, createElement as y$1, Fragment as k$1 } from '../../preact/dist/preact.js';

var o=/[\s\n\\/='"\0<>]/,n=/^xlink:?./,a=/["&<]/;function i(e){if(0===e.length||!1===a.test(e))return e;for(var t=0,r=0,o="",n="";r<e.length;r++){switch(e.charCodeAt(r)){case 34:n="&quot;";break;case 38:n="&amp;";break;case 60:n="&lt;";break;default:continue}r!==t&&(o+=e.slice(t,r)),o+=n,t=r+1;}return r!==t&&(o+=e.slice(t,r)),o}var l={},c=new Set(["animation-iteration-count","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","fill-opacity","flex","flex-grow","flex-negative","flex-order","flex-positive","flex-shrink","flood-opacity","font-weight","grid-column","grid-row","line-clamp","line-height","opacity","order","orphans","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","widows","z-index","zoom"]),s=/[A-Z]/g;function _(e){var t="";for(var r in e){var o=e[r];if(null!=o&&""!==o){var n="-"==r[0]?r:l[r]||(l[r]=r.replace(s,"-$&").toLowerCase()),a=";";"number"!=typeof o||n.startsWith("--")||c.has(n)||(a="px;"),t=t+n+":"+o+a;}}return t||void 0}var u,p,d,f,v=[],h=Array.isArray,m=Object.assign;function y(o,n){var a=l$1.__s;l$1.__s=!0,u=l$1.__b,p=l$1.diffed,d=l$1.__r,f=l$1.unmount;var i=y$1(k$1,null);i.__k=[o];try{return x(o,n||k,!1,void 0,i)}finally{l$1.__c&&l$1.__c(o,v),l$1.__s=a,v.length=0;}}function g(){this.__d=!0;}var k={};function b(e,t){var r,o=e.type,n=!0;return e.__c?(n=!1,(r=e.__c).state=r.__s):r=new o(e.props,t),e.__c=r,r.__v=e,r.props=e.props,r.context=t,r.__d=!0,null==r.state&&(r.state=k),null==r.__s&&(r.__s=r.state),o.getDerivedStateFromProps?r.state=m({},r.state,o.getDerivedStateFromProps(r.props,r.state)):n&&r.componentWillMount?(r.componentWillMount(),r.state=r.__s!==r.state?r.__s:r.state):!n&&r.componentWillUpdate&&r.componentWillUpdate(),d&&d(e),r.render(r.props,r.state,t)}function x(t,a,l,c,s){if(null==t||!0===t||!1===t||""===t)return "";if("object"!=typeof t)return "function"==typeof t?"":i(t+"");if(h(t)){var v="";s.__k=t;for(var y=0;y<t.length;y++){var k=t[y];null!=k&&"boolean"!=typeof k&&(v+=x(k,a,l,c,s));}return v}if(void 0!==t.constructor)return "";t.__=s,u&&u(t);var S,D,A,E=t.type,F=t.props,L=a;if("function"==typeof E){if(E===k$1){if(F.UNSTABLE_comment)return "\x3c!--"+i(F.UNSTABLE_comment||"")+"--\x3e";D=F.children;}else {if(null!=(S=E.contextType)){var T=a[S.__c];L=T?T.props.value:S.__;}if(E.prototype&&"function"==typeof E.prototype.render)D=b(t,L),A=t.__c;else {t.__c=A={__v:t,props:F,context:L,setState:g,forceUpdate:g,__d:!0,__h:[]};for(var U=0;A.__d&&U++<25;)A.__d=!1,d&&d(t),D=E.call(A,F,L);A.__d=!0;}if(null!=A.getChildContext&&(a=m({},a,A.getChildContext())),(E.getDerivedStateFromError||A.componentDidCatch)&&l$1.errorBoundaries){var W="";D=null!=D&&D.type===k$1&&null==D.key?D.props.children:D;try{return W=x(D,a,l,c,t)}catch(e){return E.getDerivedStateFromError&&(A.__s=E.getDerivedStateFromError(e)),A.componentDidCatch&&A.componentDidCatch(e,{}),A.__d&&(D=b(t,a),null!=(A=t.__c).getChildContext&&(a=m({},a,A.getChildContext())),W=x(D=null!=D&&D.type===k$1&&null==D.key?D.props.children:D,a,l,c,t)),W}finally{p&&p(t),t.__=void 0,f&&f(t);}}}var j=x(D=null!=D&&D.type===k$1&&null==D.key?D.props.children:D,a,l,c,t);return p&&p(t),t.__=void 0,f&&f(t),j}var M,z="<"+E,B="";for(var N in F){var H=F[N];switch(N){case"children":M=H;continue;case"key":case"ref":case"__self":case"__source":continue;case"htmlFor":if("for"in F)continue;N="for";break;case"className":if("class"in F)continue;N="class";break;case"defaultChecked":N="checked";break;case"defaultSelected":N="selected";break;case"defaultValue":case"value":switch(N="value",E){case"textarea":M=H;continue;case"select":c=H;continue;case"option":c!=H||"selected"in F||(z+=" selected");}break;case"dangerouslySetInnerHTML":B=H&&H.__html;continue;case"style":"object"==typeof H&&(H=_(H));break;default:if(l&&n.test(N))N=N.toLowerCase().replace(w,"xlink:");else {if(o.test(N))continue;"-"!==N[4]&&"draggable"!==N||null==H||(H+="");}}null!=H&&!1!==H&&"function"!=typeof H&&(z=!0===H||""===H?z+" "+N:z+" "+N+'="'+i(H+"")+'"');}if(o.test(E))throw new Error(E+" is not a valid HTML tag name in "+z+">");return B||("string"==typeof M?B=i(M):null!=M&&!1!==M&&!0!==M&&(B=x(M,a,"svg"===E||"foreignObject"!==E&&l,c,t))),p&&p(t),t.__=void 0,f&&f(t),!B&&C.has(E)?z+"/>":z+">"+B+"</"+E+">"}var w=/^xlink:?/,C=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),S=y;

export { y as default, S as render, y as renderToString };
