preact-render-to-string 5.2.1 → 5.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"jsx.js","sources":["jsx.js"],"sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?e(exports,require(\"preact\")):\"function\"==typeof define&&define.amd?define([\"exports\",\"preact\"],e):e((t||self).preactRenderToString={},t.preact)}(this,function(t,e){if(\"function\"!=typeof Symbol){var n=0;Symbol=function(t){return\"@@\"+t+ ++n},Symbol.for=function(t){return\"@@\"+t}}var r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/[&<>\"]/;function i(t){var e=String(t);return o.test(e)?e.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\"):e}var a=function(t,e){return String(t).replace(/(\\n+)/g,\"$1\"+(e||\"\\t\"))},c=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf(\"\\n\")||-1!==String(t).indexOf(\"<\")},l={};function u(t){var e=\"\";for(var n in t){var o=t[n];null!=o&&\"\"!==o&&(e&&(e+=\" \"),e+=\"-\"==n[0]?n:l[n]||(l[n]=n.replace(/([A-Z])/g,\"-$1\").toLowerCase()),e+=\": \",e+=o,\"number\"==typeof o&&!1===r.test(n)&&(e+=\"px\"),e+=\";\")}return e||void 0}function s(t,e){for(var n in e)t[n]=e[n];return t}function f(t,e){return Array.isArray(e)?e.reduce(f,t):null!=e&&!1!==e&&t.push(e),t}var p={shallow:!0},d=[],y=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,g=/[\\s\\n\\\\/='\"\\0<>]/;function b(){this.__d=!0}_.render=_;var m=[];function _(t,n,r){n=n||{},r=r||{};var o=e.options.__s;e.options.__s=!0;var i=h(t,n,r);return e.options.__c&&e.options.__c(t,m),m.length=0,e.options.__s=o,i}function h(t,n,r,o,l,p){if(null==t||\"boolean\"==typeof t)return\"\";if(\"object\"!=typeof t)return i(t);var m=r.pretty,_=m&&\"string\"==typeof m?m:\"\\t\";if(Array.isArray(t)){for(var v=\"\",x=0;x<t.length;x++)m&&x>0&&(v+=\"\\n\"),v+=h(t[x],n,r,o,l,p);return v}var j,S=t.type,A=t.props,O=!1;if(\"function\"==typeof S){if(O=!0,!r.shallow||!o&&!1!==r.renderRootComponent){if(S===e.Fragment){var k=[];return f(k,t.props.children),h(k,n,r,!1!==r.shallowHighOrder,l,p)}var w,F=t.__c={__v:t,context:n,props:t.props,setState:b,forceUpdate:b,__d:!0,__h:[]};e.options.__b&&e.options.__b(t);var C=e.options.__r;if(S.prototype&&\"function\"==typeof S.prototype.render){var E=S.contextType,M=E&&n[E.__c],N=null!=E?M?M.props.value:E.__:n;(F=t.__c=new S(A,N)).__v=t,F._dirty=F.__d=!0,F.props=A,null==F.state&&(F.state={}),null==F._nextState&&null==F.__s&&(F._nextState=F.__s=F.state),F.context=N,S.getDerivedStateFromProps?F.state=s(s({},F.state),S.getDerivedStateFromProps(F.props,F.state)):F.componentWillMount&&(F.componentWillMount(),F.state=F._nextState!==F.state?F._nextState:F.__s!==F.state?F.__s:F.state),C&&C(t),w=F.render(F.props,F.state,F.context)}else for(var D=S.contextType,H=D&&n[D.__c],I=null!=D?H?H.props.value:D.__:n,T=0;F.__d&&T++<25;)F.__d=!1,C&&C(t),w=S.call(t.__c,A,I);return F.getChildContext&&(n=s(s({},n),F.getChildContext())),e.options.diffed&&e.options.diffed(t),h(w,n,r,!1!==r.shallowHighOrder,l,p)}S=(j=S).displayName||j!==Function&&j.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\\s*function\\s+([^( ]+)/)||\"\")[1];if(!e){for(var n=-1,r=d.length;r--;)if(d[r]===t){n=r;break}n<0&&(n=d.push(t)-1),e=\"UnnamedComponent\"+n}return e}(j)}var $,U,W=\"<\"+S;if(A){var L=Object.keys(A);r&&!0===r.sortAttributes&&L.sort();for(var P=0;P<L.length;P++){var R=L[P],J=A[R];if(\"children\"!==R){if(!g.test(R)&&(r&&r.allAttributes||\"key\"!==R&&\"ref\"!==R&&\"__self\"!==R&&\"__source\"!==R)){if(\"defaultValue\"===R)R=\"value\";else if(\"defaultChecked\"===R)R=\"checked\";else if(\"defaultSelected\"===R)R=\"selected\";else if(\"className\"===R){if(void 0!==A.class)continue;R=\"class\"}else l&&/^xlink:?./.test(R)&&(R=R.toLowerCase().replace(/^xlink:?/,\"xlink:\"));if(\"htmlFor\"===R){if(A.for)continue;R=\"for\"}\"style\"===R&&J&&\"object\"==typeof J&&(J=u(J)),\"a\"===R[0]&&\"r\"===R[1]&&\"boolean\"==typeof J&&(J=String(J));var q=r.attributeHook&&r.attributeHook(R,J,n,r,O);if(q||\"\"===q)W+=q;else if(\"dangerouslySetInnerHTML\"===R)U=J&&J.__html;else if(\"textarea\"===S&&\"value\"===R)$=J;else if((J||0===J||\"\"===J)&&\"function\"!=typeof J){if(!(!0!==J&&\"\"!==J||(J=R,r&&r.xml))){W=W+\" \"+R;continue}if(\"value\"===R){if(\"select\"===S){p=J;continue}\"option\"===S&&p==J&&void 0===A.selected&&(W+=\" selected\")}W=W+\" \"+R+'=\"'+i(J)+'\"'}}}else $=J}}if(m){var V=W.replace(/\\n\\s*/,\" \");V===W||~V.indexOf(\"\\n\")?m&&~W.indexOf(\"\\n\")&&(W+=\"\\n\"):W=V}if(W+=\">\",g.test(S))throw new Error(S+\" is not a valid HTML tag name in \"+W);var z,B=y.test(S)||r.voidElements&&r.voidElements.test(S),G=[];if(U)m&&c(U)&&(U=\"\\n\"+_+a(U,_)),W+=U;else if(null!=$&&f(z=[],$).length){for(var Z=m&&~W.indexOf(\"\\n\"),K=!1,Q=0;Q<z.length;Q++){var X=z[Q];if(null!=X&&!1!==X){var Y=h(X,n,r,!0,\"svg\"===S||\"foreignObject\"!==S&&l,p);if(m&&!Z&&c(Y)&&(Z=!0),Y)if(m){var tt=Y.length>0&&\"<\"!=Y[0];K&&tt?G[G.length-1]+=Y:G.push(Y),K=tt}else G.push(Y)}}if(m&&Z)for(var et=G.length;et--;)G[et]=\"\\n\"+_+a(G[et],_)}if(G.length||U)W+=G.join(\"\");else if(r&&r.xml)return W.substring(0,W.length-1)+\" />\";return!B||z||U?(m&&~W.indexOf(\"\\n\")&&(W+=\"\\n\"),W=W+\"</\"+S+\">\"):W=W.replace(/>$/,\" />\"),W}_.shallowRender=function(t,e){return _(t,e,p)};const v=/(\\\\|\\\"|\\')/g,x=Object.prototype.toString,j=Date.prototype.toISOString,S=Error.prototype.toString,A=RegExp.prototype.toString,O=Symbol.prototype.toString,k=/^Symbol\\((.*)\\)(.*)$/,w=/\\n/gi,F=Object.getOwnPropertySymbols||(t=>[]);function C(t){return\"[object Array]\"===t||\"[object ArrayBuffer]\"===t||\"[object DataView]\"===t||\"[object Float32Array]\"===t||\"[object Float64Array]\"===t||\"[object Int8Array]\"===t||\"[object Int16Array]\"===t||\"[object Int32Array]\"===t||\"[object Uint8Array]\"===t||\"[object Uint8ClampedArray]\"===t||\"[object Uint16Array]\"===t||\"[object Uint32Array]\"===t}function E(t){return\"\"===t.name?\"[Function anonymous]\":\"[Function \"+t.name+\"]\"}function M(t){return O.call(t).replace(k,\"Symbol($1)\")}function N(t){return\"[\"+S.call(t)+\"]\"}function D(t){if(!0===t||!1===t)return\"\"+t;if(void 0===t)return\"undefined\";if(null===t)return\"null\";const e=typeof t;if(\"number\"===e)return function(t){return t!=+t?\"NaN\":0===t&&1/t<0?\"-0\":\"\"+t}(t);if(\"string\"===e)return'\"'+function(t){return t.replace(v,\"\\\\$1\")}(t)+'\"';if(\"function\"===e)return E(t);if(\"symbol\"===e)return M(t);const n=x.call(t);return\"[object WeakMap]\"===n?\"WeakMap {}\":\"[object WeakSet]\"===n?\"WeakSet {}\":\"[object Function]\"===n||\"[object GeneratorFunction]\"===n?E(t,min):\"[object Symbol]\"===n?M(t):\"[object Date]\"===n?j.call(t):\"[object Error]\"===n?N(t):\"[object RegExp]\"===n?A.call(t):\"[object Arguments]\"===n&&0===t.length?\"Arguments []\":C(n)&&0===t.length?t.constructor.name+\" []\":t instanceof Error&&N(t)}function H(t,e,n,r,o,i,a,c,l,u){let s=\"\";if(t.length){s+=o;const f=n+e;for(let n=0;n<t.length;n++)s+=f+$(t[n],e,f,r,o,i,a,c,l,u),n<t.length-1&&(s+=\",\"+r);s+=o+n}return\"[\"+s+\"]\"}function I(t,e,n,r,o,i,a,c,l,u){if((i=i.slice()).indexOf(t)>-1)return\"[Circular]\";i.push(t);const s=++c>a;if(!s&&t.toJSON&&\"function\"==typeof t.toJSON)return $(t.toJSON(),e,n,r,o,i,a,c,l,u);const f=x.call(t);return\"[object Arguments]\"===f?s?\"[Arguments]\":function(t,e,n,r,o,i,a,c,l,u){return(u?\"\":\"Arguments \")+H(t,e,n,r,o,i,a,c,l,u)}(t,e,n,r,o,i,a,c,l,u):C(f)?s?\"[Array]\":function(t,e,n,r,o,i,a,c,l,u){return(u?\"\":t.constructor.name+\" \")+H(t,e,n,r,o,i,a,c,l,u)}(t,e,n,r,o,i,a,c,l,u):\"[object Map]\"===f?s?\"[Map]\":function(t,e,n,r,o,i,a,c,l,u){let s=\"Map {\";const f=t.entries();let p=f.next();if(!p.done){s+=o;const t=n+e;for(;!p.done;)s+=t+$(p.value[0],e,t,r,o,i,a,c,l,u)+\" => \"+$(p.value[1],e,t,r,o,i,a,c,l,u),p=f.next(),p.done||(s+=\",\"+r);s+=o+n}return s+\"}\"}(t,e,n,r,o,i,a,c,l,u):\"[object Set]\"===f?s?\"[Set]\":function(t,e,n,r,o,i,a,c,l,u){let s=\"Set {\";const f=t.entries();let p=f.next();if(!p.done){s+=o;const t=n+e;for(;!p.done;)s+=t+$(p.value[1],e,t,r,o,i,a,c,l,u),p=f.next(),p.done||(s+=\",\"+r);s+=o+n}return s+\"}\"}(t,e,n,r,o,i,a,c,l,u):\"object\"==typeof t?s?\"[Object]\":function(t,e,n,r,o,i,a,c,l,u){let s=(u?\"\":t.constructor?t.constructor.name+\" \":\"Object \")+\"{\",f=Object.keys(t).sort();const p=F(t);if(p.length&&(f=f.filter(t=>!(\"symbol\"==typeof t||\"[object Symbol]\"===x.call(t))).concat(p)),f.length){s+=o;const p=n+e;for(let n=0;n<f.length;n++){const d=f[n];s+=p+$(d,e,p,r,o,i,a,c,l,u)+\": \"+$(t[d],e,p,r,o,i,a,c,l,u),n<f.length-1&&(s+=\",\"+r)}s+=o+n}return s+\"}\"}(t,e,n,r,o,i,a,c,l,u):void 0}function T(t,e,n,r,o,i,a,c,l,u){let s,f=!1;for(let e=0;e<l.length;e++)if(s=l[e],s.test(t)){f=!0;break}return!!f&&s.print(t,function(t){return $(t,e,n,r,o,i,a,c,l,u)},function(t){const r=n+e;return r+t.replace(w,\"\\n\"+r)},{edgeSpacing:o,spacing:r})}function $(t,e,n,r,o,i,a,c,l,u){return D(t)||T(t,e,n,r,o,i,a,c,l,u)||I(t,e,n,r,o,i,a,c,l,u)}const U={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function W(t){return new Array(t+1).join(\" \")}var L={test:function(t){return t&&\"object\"==typeof t&&\"type\"in t&&\"props\"in t&&\"key\"in t},print:function(t,e,n){return _(t,L.context,L.opts)}},P={plugins:[L]},R={attributeHook:function(t,e,n,r,o){var c=typeof e;if(\"dangerouslySetInnerHTML\"===t)return!1;if(null==e||\"function\"===c&&!r.functions)return\"\";if(r.skipFalseAttributes&&!o&&(!1===e||(\"class\"===t||\"style\"===t)&&\"\"===e))return\"\";var l=\"string\"==typeof r.pretty?r.pretty:\"\\t\";return\"string\"!==c?(\"function\"!==c||r.functionNames?(L.context=n,L.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!U.hasOwnProperty(t))throw new Error(\"prettyFormat: Invalid option: \"+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error(\"prettyFormat: Cannot run with min option and indent\")}(e),e=function(t){const e={};return Object.keys(U).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:U[n]),e.min&&(e.indent=0),e}(e)):e=U;const o=e.min?\" \":\"\\n\",i=e.min?\"\":\"\\n\";if(e&&e.plugins.length){n=W(e.indent),r=[];var a=T(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return D(t)||(n||(n=W(e.indent)),r||(r=[]),I(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,P)).indexOf(\"\\n\")&&(e=a(\"\\n\"+e,l)+\"\\n\")):e=\"Function\",a(\"\\n\"+t+\"={\"+e+\"}\",l)):\"\\n\"+l+t+'=\"'+i(e)+'\"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:\" \"};function J(t,e,n,r){return _(t,e,n=s(s({},R),n||{}))}t.default=J,t.render=J});\n//# sourceMappingURL=jsx.js.map\n"],"names":["t","Symbol","n","s","c"],"mappings":"mEAAA,SAAsBA,GAAA,MAAXC,KAAAA,KAAuBC,GACjCD,WAEAA,SAASD,GAAUG,MAClB,KAAAH,OAAkBI,EAAAA"}
1
+ {"version":3,"file":"jsx.js","sources":["jsx.js"],"sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?e(exports,require(\"preact\")):\"function\"==typeof define&&define.amd?define([\"exports\",\"preact\"],e):e((t||self).preactRenderToString={},t.preact)}(this,function(t,e){if(\"function\"!=typeof Symbol){var n=0;Symbol=function(t){return\"@@\"+t+ ++n},Symbol.for=function(t){return\"@@\"+t}}var r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,i=/[\\s\\n\\\\/='\"\\0<>]/,a=/^xlink:?./,s=/[\"&<]/;function l(t){if(!1===s.test(t+=\"\"))return t;for(var e=0,n=0,r=\"\",o=\"\";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=\"&quot;\";break;case 38:o=\"&amp;\";break;case 60:o=\"&lt;\";break;default:continue}n!==e&&(r+=t.slice(e,n)),r+=o,e=n+1}return n!==e&&(r+=t.slice(e,n)),r}var c=function(t,e){return String(t).replace(/(\\n+)/g,\"$1\"+(e||\"\\t\"))},u=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf(\"\\n\")||-1!==String(t).indexOf(\"<\")},f={},p=/([A-Z])/g;function d(t){var e=\"\";for(var n in t){var o=t[n];null!=o&&\"\"!==o&&(e&&(e+=\" \"),e+=\"-\"==n[0]?n:f[n]||(f[n]=n.replace(p,\"-$1\").toLowerCase()),e=\"number\"==typeof o&&!1===r.test(n)?e+\": \"+o+\"px;\":e+\": \"+o+\";\")}return e||void 0}function _(t,e){return Array.isArray(e)?e.reduce(_,t):null!=e&&!1!==e&&t.push(e),t}function y(){this.__d=!0}function g(t,e){return{__v:t,context:e,props:t.props,setState:y,forceUpdate:y,__d:!0,__h:[]}}function v(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var b=[];function m(t,n,r,s,f,p){if(null==t||\"boolean\"==typeof t)return\"\";if(\"object\"!=typeof t)return l(t);var y=r.pretty,h=y&&\"string\"==typeof y?y:\"\\t\";if(Array.isArray(t)){for(var j=\"\",x=0;x<t.length;x++)y&&x>0&&(j+=\"\\n\"),j+=m(t[x],n,r,s,f,p);return j}var S,k=t.type,A=t.props,O=!1;if(\"function\"==typeof k){if(O=!0,!r.shallow||!s&&!1!==r.renderRootComponent){if(k===e.Fragment){var w=[];return _(w,t.props.children),m(w,n,r,!1!==r.shallowHighOrder,f,p)}var F,C=t.__c=g(t,n);e.options.__b&&e.options.__b(t);var E=e.options.__r;if(k.prototype&&\"function\"==typeof k.prototype.render){var M=v(k,n);(C=t.__c=new k(A,M)).__v=t,C._dirty=C.__d=!0,C.props=A,null==C.state&&(C.state={}),null==C._nextState&&null==C.__s&&(C._nextState=C.__s=C.state),C.context=M,k.getDerivedStateFromProps?C.state=Object.assign({},C.state,k.getDerivedStateFromProps(C.props,C.state)):C.componentWillMount&&(C.componentWillMount(),C.state=C._nextState!==C.state?C._nextState:C.__s!==C.state?C.__s:C.state),E&&E(t),F=C.render(C.props,C.state,C.context)}else for(var H=v(k,n),N=0;C.__d&&N++<25;)C.__d=!1,E&&E(t),F=k.call(t.__c,A,H);return C.getChildContext&&(n=Object.assign({},n,C.getChildContext())),e.options.diffed&&e.options.diffed(t),m(F,n,r,!1!==r.shallowHighOrder,f,p)}k=(S=k).displayName||S!==Function&&S.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\\s*function\\s+([^( ]+)/)||\"\")[1];if(!e){for(var n=-1,r=b.length;r--;)if(b[r]===t){n=r;break}n<0&&(n=b.push(t)-1),e=\"UnnamedComponent\"+n}return e}(S)}var D,I,T=\"<\"+k;if(A){var L=Object.keys(A);r&&!0===r.sortAttributes&&L.sort();for(var W=0;W<L.length;W++){var $=L[W],P=A[$];if(\"children\"!==$){if(!i.test($)&&(r&&r.allAttributes||\"key\"!==$&&\"ref\"!==$&&\"__self\"!==$&&\"__source\"!==$)){if(\"defaultValue\"===$)$=\"value\";else if(\"defaultChecked\"===$)$=\"checked\";else if(\"defaultSelected\"===$)$=\"selected\";else if(\"className\"===$){if(void 0!==A.class)continue;$=\"class\"}else f&&a.test($)&&($=$.toLowerCase().replace(/^xlink:?/,\"xlink:\"));if(\"htmlFor\"===$){if(A.for)continue;$=\"for\"}\"style\"===$&&P&&\"object\"==typeof P&&(P=d(P)),\"a\"===$[0]&&\"r\"===$[1]&&\"boolean\"==typeof P&&(P=String(P));var U=r.attributeHook&&r.attributeHook($,P,n,r,O);if(U||\"\"===U)T+=U;else if(\"dangerouslySetInnerHTML\"===$)I=P&&P.__html;else if(\"textarea\"===k&&\"value\"===$)D=P;else if((P||0===P||\"\"===P)&&\"function\"!=typeof P){if(!(!0!==P&&\"\"!==P||(P=$,r&&r.xml))){T=T+\" \"+$;continue}if(\"value\"===$){if(\"select\"===k){p=P;continue}\"option\"===k&&p==P&&void 0===A.selected&&(T+=\" selected\")}T=T+\" \"+$+'=\"'+l(P)+'\"'}}}else D=P}}if(y){var R=T.replace(/\\n\\s*/,\" \");R===T||~R.indexOf(\"\\n\")?y&&~T.indexOf(\"\\n\")&&(T+=\"\\n\"):T=R}if(T+=\">\",i.test(k))throw new Error(k+\" is not a valid HTML tag name in \"+T);var J,V=o.test(k)||r.voidElements&&r.voidElements.test(k),q=[];if(I)y&&u(I)&&(I=\"\\n\"+h+c(I,h)),T+=I;else if(null!=D&&_(J=[],D).length){for(var z=y&&~T.indexOf(\"\\n\"),B=!1,G=0;G<J.length;G++){var Z=J[G];if(null!=Z&&!1!==Z){var K=m(Z,n,r,!0,\"svg\"===k||\"foreignObject\"!==k&&f,p);if(y&&!z&&u(K)&&(z=!0),K)if(y){var Q=K.length>0&&\"<\"!=K[0];B&&Q?q[q.length-1]+=K:q.push(K),B=Q}else q.push(K)}}if(y&&z)for(var X=q.length;X--;)q[X]=\"\\n\"+h+c(q[X],h)}if(q.length||I)T+=q.join(\"\");else if(r&&r.xml)return T.substring(0,T.length-1)+\" />\";return!V||J||I?(y&&~T.indexOf(\"\\n\")&&(T+=\"\\n\"),T=T+\"</\"+k+\">\"):T=T.replace(/>$/,\" />\"),T}var h={shallow:!0};x.render=x;var j=[];function x(t,n,r){n=n||{};var o=e.options.__s;e.options.__s=!0;var i,a=e.h(e.Fragment,null);return a.__k=[t],i=r&&(r.pretty||r.voidElements||r.sortAttributes||r.shallow||r.allAttributes||r.xml||r.attributeHook)?m(t,n,r):w(t,n,!1,void 0,a),e.options.__c&&e.options.__c(t,j),e.options.__s=o,j.length=0,i}function S(t,e){return\"className\"===t?\"class\":\"htmlFor\"===t?\"for\":\"defaultValue\"===t?\"value\":\"defaultChecked\"===t?\"checked\":\"defaultSelected\"===t?\"selected\":e&&a.test(t)?t.toLowerCase().replace(/^xlink:?/,\"xlink:\"):t}function k(t,e){return\"style\"===t&&null!=e&&\"object\"==typeof e?d(e):\"a\"===t[0]&&\"r\"===t[1]&&\"boolean\"==typeof e?String(e):e}var A=Array.isArray,O=Object.assign;function w(t,n,r,a,s){if(null==t||!0===t||!1===t||\"\"===t)return\"\";if(\"object\"!=typeof t)return l(t);if(A(t)){var c=\"\";s.__k=t;for(var u=0;u<t.length;u++)c+=w(t[u],n,r,a,s);return c}t.__=s,e.options.__b&&e.options.__b(t);var f=t.type,p=t.props;if(\"function\"==typeof f){var d;if(f===e.Fragment)d=p.children;else{d=f.prototype&&\"function\"==typeof f.prototype.render?function(t,n){var r=t.type,o=v(r,n),i=new r(t.props,o);t.__c=i,i.__v=t,i.__d=!0,i.props=t.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=O({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var a=e.options.__r;return a&&a(t),i.render(i.props,i.state,i.context)}(t,n):function(t,n){var r,o=g(t,n),i=v(t.type,n);t.__c=o;for(var a=e.options.__r,s=0;o.__d&&s++<25;)o.__d=!1,a&&a(t),r=t.type.call(o,t.props,i);return r}(t,n);var _=t.__c;_.getChildContext&&(n=O({},n,_.getChildContext()))}var y=w(d,n,r,a,t);return e.options.diffed&&e.options.diffed(t),t.__=void 0,e.options.unmount&&e.options.unmount(t),y}var b,m,h=\"<\";if(h+=f,p)for(var j in b=p.children,p){var x=p[j];if(!(\"key\"===j||\"ref\"===j||\"__self\"===j||\"__source\"===j||\"children\"===j||\"className\"===j&&\"class\"in p||\"htmlFor\"===j&&\"for\"in p||i.test(j)))if(x=k(j=S(j,r),x),\"dangerouslySetInnerHTML\"===j)m=x&&x.__html;else if(\"textarea\"===f&&\"value\"===j)b=x;else if((x||0===x||\"\"===x)&&\"function\"!=typeof x){if(!0===x||\"\"===x){x=j,h=h+\" \"+j;continue}if(\"value\"===j){if(\"select\"===f){a=x;continue}\"option\"!==f||a!=x||\"selected\"in p||(h+=\" selected\")}h=h+\" \"+j+'=\"'+l(x)+'\"'}}var F=h;if(h+=\">\",i.test(f))throw new Error(f+\" is not a valid HTML tag name in \"+h);var C=\"\",E=!1;if(m)C+=m,E=!0;else if(\"string\"==typeof b)C+=l(b),E=!0;else if(A(b)){t.__k=b;for(var M=0;M<b.length;M++){var H=b[M];if(null!=H&&!1!==H){var N=w(H,n,\"svg\"===f||\"foreignObject\"!==f&&r,a,t);N&&(C+=N,E=!0)}}}else if(null!=b&&!1!==b&&!0!==b){t.__k=[b];var D=w(b,n,\"svg\"===f||\"foreignObject\"!==f&&r,a,t);D&&(C+=D,E=!0)}if(e.options.diffed&&e.options.diffed(t),t.__=void 0,e.options.unmount&&e.options.unmount(t),E)h+=C;else if(o.test(f))return F+\" />\";return h+\"</\"+f+\">\"}x.shallowRender=function(t,e){return x(t,e,h)};const F=/(\\\\|\\\"|\\')/g,C=Object.prototype.toString,E=Date.prototype.toISOString,M=Error.prototype.toString,H=RegExp.prototype.toString,N=Symbol.prototype.toString,D=/^Symbol\\((.*)\\)(.*)$/,I=/\\n/gi,T=Object.getOwnPropertySymbols||(t=>[]);function L(t){return\"[object Array]\"===t||\"[object ArrayBuffer]\"===t||\"[object DataView]\"===t||\"[object Float32Array]\"===t||\"[object Float64Array]\"===t||\"[object Int8Array]\"===t||\"[object Int16Array]\"===t||\"[object Int32Array]\"===t||\"[object Uint8Array]\"===t||\"[object Uint8ClampedArray]\"===t||\"[object Uint16Array]\"===t||\"[object Uint32Array]\"===t}function W(t){return\"\"===t.name?\"[Function anonymous]\":\"[Function \"+t.name+\"]\"}function $(t){return N.call(t).replace(D,\"Symbol($1)\")}function P(t){return\"[\"+M.call(t)+\"]\"}function U(t){if(!0===t||!1===t)return\"\"+t;if(void 0===t)return\"undefined\";if(null===t)return\"null\";const e=typeof t;if(\"number\"===e)return function(t){return t!=+t?\"NaN\":0===t&&1/t<0?\"-0\":\"\"+t}(t);if(\"string\"===e)return'\"'+function(t){return t.replace(F,\"\\\\$1\")}(t)+'\"';if(\"function\"===e)return W(t);if(\"symbol\"===e)return $(t);const n=C.call(t);return\"[object WeakMap]\"===n?\"WeakMap {}\":\"[object WeakSet]\"===n?\"WeakSet {}\":\"[object Function]\"===n||\"[object GeneratorFunction]\"===n?W(t,min):\"[object Symbol]\"===n?$(t):\"[object Date]\"===n?E.call(t):\"[object Error]\"===n?P(t):\"[object RegExp]\"===n?H.call(t):\"[object Arguments]\"===n&&0===t.length?\"Arguments []\":L(n)&&0===t.length?t.constructor.name+\" []\":t instanceof Error&&P(t)}function R(t,e,n,r,o,i,a,s,l,c){let u=\"\";if(t.length){u+=o;const f=n+e;for(let n=0;n<t.length;n++)u+=f+q(t[n],e,f,r,o,i,a,s,l,c),n<t.length-1&&(u+=\",\"+r);u+=o+n}return\"[\"+u+\"]\"}function J(t,e,n,r,o,i,a,s,l,c){if((i=i.slice()).indexOf(t)>-1)return\"[Circular]\";i.push(t);const u=++s>a;if(!u&&t.toJSON&&\"function\"==typeof t.toJSON)return q(t.toJSON(),e,n,r,o,i,a,s,l,c);const f=C.call(t);return\"[object Arguments]\"===f?u?\"[Arguments]\":function(t,e,n,r,o,i,a,s,l,c){return(c?\"\":\"Arguments \")+R(t,e,n,r,o,i,a,s,l,c)}(t,e,n,r,o,i,a,s,l,c):L(f)?u?\"[Array]\":function(t,e,n,r,o,i,a,s,l,c){return(c?\"\":t.constructor.name+\" \")+R(t,e,n,r,o,i,a,s,l,c)}(t,e,n,r,o,i,a,s,l,c):\"[object Map]\"===f?u?\"[Map]\":function(t,e,n,r,o,i,a,s,l,c){let u=\"Map {\";const f=t.entries();let p=f.next();if(!p.done){u+=o;const t=n+e;for(;!p.done;)u+=t+q(p.value[0],e,t,r,o,i,a,s,l,c)+\" => \"+q(p.value[1],e,t,r,o,i,a,s,l,c),p=f.next(),p.done||(u+=\",\"+r);u+=o+n}return u+\"}\"}(t,e,n,r,o,i,a,s,l,c):\"[object Set]\"===f?u?\"[Set]\":function(t,e,n,r,o,i,a,s,l,c){let u=\"Set {\";const f=t.entries();let p=f.next();if(!p.done){u+=o;const t=n+e;for(;!p.done;)u+=t+q(p.value[1],e,t,r,o,i,a,s,l,c),p=f.next(),p.done||(u+=\",\"+r);u+=o+n}return u+\"}\"}(t,e,n,r,o,i,a,s,l,c):\"object\"==typeof t?u?\"[Object]\":function(t,e,n,r,o,i,a,s,l,c){let u=(c?\"\":t.constructor?t.constructor.name+\" \":\"Object \")+\"{\",f=Object.keys(t).sort();const p=T(t);if(p.length&&(f=f.filter(t=>!(\"symbol\"==typeof t||\"[object Symbol]\"===C.call(t))).concat(p)),f.length){u+=o;const p=n+e;for(let n=0;n<f.length;n++){const d=f[n];u+=p+q(d,e,p,r,o,i,a,s,l,c)+\": \"+q(t[d],e,p,r,o,i,a,s,l,c),n<f.length-1&&(u+=\",\"+r)}u+=o+n}return u+\"}\"}(t,e,n,r,o,i,a,s,l,c):void 0}function V(t,e,n,r,o,i,a,s,l,c){let u,f=!1;for(let e=0;e<l.length;e++)if(u=l[e],u.test(t)){f=!0;break}return!!f&&u.print(t,function(t){return q(t,e,n,r,o,i,a,s,l,c)},function(t){const r=n+e;return r+t.replace(I,\"\\n\"+r)},{edgeSpacing:o,spacing:r})}function q(t,e,n,r,o,i,a,s,l,c){return U(t)||V(t,e,n,r,o,i,a,s,l,c)||J(t,e,n,r,o,i,a,s,l,c)}const z={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function B(t){return new Array(t+1).join(\" \")}var G={test:function(t){return t&&\"object\"==typeof t&&\"type\"in t&&\"props\"in t&&\"key\"in t},print:function(t,e,n){return x(t,G.context,G.opts)}},Z={plugins:[G]},K={attributeHook:function(t,e,n,r,o){var i=typeof e;if(\"dangerouslySetInnerHTML\"===t)return!1;if(null==e||\"function\"===i&&!r.functions)return\"\";if(r.skipFalseAttributes&&!o&&(!1===e||(\"class\"===t||\"style\"===t)&&\"\"===e))return\"\";var a=\"string\"==typeof r.pretty?r.pretty:\"\\t\";return\"string\"!==i?(\"function\"!==i||r.functionNames?(G.context=n,G.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!z.hasOwnProperty(t))throw new Error(\"prettyFormat: Invalid option: \"+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error(\"prettyFormat: Cannot run with min option and indent\")}(e),e=function(t){const e={};return Object.keys(z).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:z[n]),e.min&&(e.indent=0),e}(e)):e=z;const o=e.min?\" \":\"\\n\",i=e.min?\"\":\"\\n\";if(e&&e.plugins.length){n=B(e.indent),r=[];var a=V(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return U(t)||(n||(n=B(e.indent)),r||(r=[]),J(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,Z)).indexOf(\"\\n\")&&(e=c(\"\\n\"+e,a)+\"\\n\")):e=\"Function\",c(\"\\n\"+t+\"={\"+e+\"}\",a)):\"\\n\"+a+t+'=\"'+l(e)+'\"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:\" \"};function Q(t,e,n,r){return x(t,e,n=Object.assign({},K,n||{}))}t.default=Q,t.render=Q});\n//# sourceMappingURL=jsx.js.map\n"],"names":["t","Symbol","n","s","c"],"mappings":"mEAAA,SAAsBA,GAAA,MAAXC,KAAAA,KAAuBC,GACjCD,WAEAA,SAASD,GAAUG,MAClB,KAAAH,OAAkBI,EAAAA"}
package/dist/jsx.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { VNode } from 'preact';
2
-
3
- interface Options {
4
- jsx?: boolean;
5
- xml?: boolean;
6
- functions?: boolean;
7
- functionNames?: boolean;
8
- skipFalseAttributes?: boolean;
9
- pretty?: boolean | string;
10
- }
11
-
12
- export function render(vnode: VNode, context?: any, options?: Options): string;
13
- export default render;
1
+ import { VNode } from 'preact';
2
+
3
+ interface Options {
4
+ jsx?: boolean;
5
+ xml?: boolean;
6
+ functions?: boolean;
7
+ functionNames?: boolean;
8
+ skipFalseAttributes?: boolean;
9
+ pretty?: boolean | string;
10
+ }
11
+
12
+ export function render(vnode: VNode, context?: any, options?: Options): string;
13
+ export default render;
package/dist/jsx.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"jsx.js","sources":["jsx.js"],"sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?e(exports,require(\"preact\")):\"function\"==typeof define&&define.amd?define([\"exports\",\"preact\"],e):e((t||self).preactRenderToString={},t.preact)}(this,function(t,e){if(\"function\"!=typeof Symbol){var n=0;Symbol=function(t){return\"@@\"+t+ ++n},Symbol.for=function(t){return\"@@\"+t}}var r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/[&<>\"]/;function i(t){var e=String(t);return o.test(e)?e.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\"):e}var a=function(t,e){return String(t).replace(/(\\n+)/g,\"$1\"+(e||\"\\t\"))},c=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf(\"\\n\")||-1!==String(t).indexOf(\"<\")},l={};function u(t){var e=\"\";for(var n in t){var o=t[n];null!=o&&\"\"!==o&&(e&&(e+=\" \"),e+=\"-\"==n[0]?n:l[n]||(l[n]=n.replace(/([A-Z])/g,\"-$1\").toLowerCase()),e+=\": \",e+=o,\"number\"==typeof o&&!1===r.test(n)&&(e+=\"px\"),e+=\";\")}return e||void 0}function s(t,e){for(var n in e)t[n]=e[n];return t}function f(t,e){return Array.isArray(e)?e.reduce(f,t):null!=e&&!1!==e&&t.push(e),t}var p={shallow:!0},d=[],y=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,g=/[\\s\\n\\\\/='\"\\0<>]/;function b(){this.__d=!0}_.render=_;var m=[];function _(t,n,r){n=n||{},r=r||{};var o=e.options.__s;e.options.__s=!0;var i=h(t,n,r);return e.options.__c&&e.options.__c(t,m),m.length=0,e.options.__s=o,i}function h(t,n,r,o,l,p){if(null==t||\"boolean\"==typeof t)return\"\";if(\"object\"!=typeof t)return i(t);var m=r.pretty,_=m&&\"string\"==typeof m?m:\"\\t\";if(Array.isArray(t)){for(var v=\"\",x=0;x<t.length;x++)m&&x>0&&(v+=\"\\n\"),v+=h(t[x],n,r,o,l,p);return v}var j,S=t.type,A=t.props,O=!1;if(\"function\"==typeof S){if(O=!0,!r.shallow||!o&&!1!==r.renderRootComponent){if(S===e.Fragment){var k=[];return f(k,t.props.children),h(k,n,r,!1!==r.shallowHighOrder,l,p)}var w,F=t.__c={__v:t,context:n,props:t.props,setState:b,forceUpdate:b,__d:!0,__h:[]};e.options.__b&&e.options.__b(t);var C=e.options.__r;if(S.prototype&&\"function\"==typeof S.prototype.render){var E=S.contextType,M=E&&n[E.__c],N=null!=E?M?M.props.value:E.__:n;(F=t.__c=new S(A,N)).__v=t,F._dirty=F.__d=!0,F.props=A,null==F.state&&(F.state={}),null==F._nextState&&null==F.__s&&(F._nextState=F.__s=F.state),F.context=N,S.getDerivedStateFromProps?F.state=s(s({},F.state),S.getDerivedStateFromProps(F.props,F.state)):F.componentWillMount&&(F.componentWillMount(),F.state=F._nextState!==F.state?F._nextState:F.__s!==F.state?F.__s:F.state),C&&C(t),w=F.render(F.props,F.state,F.context)}else for(var D=S.contextType,H=D&&n[D.__c],I=null!=D?H?H.props.value:D.__:n,T=0;F.__d&&T++<25;)F.__d=!1,C&&C(t),w=S.call(t.__c,A,I);return F.getChildContext&&(n=s(s({},n),F.getChildContext())),e.options.diffed&&e.options.diffed(t),h(w,n,r,!1!==r.shallowHighOrder,l,p)}S=(j=S).displayName||j!==Function&&j.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\\s*function\\s+([^( ]+)/)||\"\")[1];if(!e){for(var n=-1,r=d.length;r--;)if(d[r]===t){n=r;break}n<0&&(n=d.push(t)-1),e=\"UnnamedComponent\"+n}return e}(j)}var $,U,W=\"<\"+S;if(A){var L=Object.keys(A);r&&!0===r.sortAttributes&&L.sort();for(var P=0;P<L.length;P++){var R=L[P],J=A[R];if(\"children\"!==R){if(!g.test(R)&&(r&&r.allAttributes||\"key\"!==R&&\"ref\"!==R&&\"__self\"!==R&&\"__source\"!==R)){if(\"defaultValue\"===R)R=\"value\";else if(\"defaultChecked\"===R)R=\"checked\";else if(\"defaultSelected\"===R)R=\"selected\";else if(\"className\"===R){if(void 0!==A.class)continue;R=\"class\"}else l&&/^xlink:?./.test(R)&&(R=R.toLowerCase().replace(/^xlink:?/,\"xlink:\"));if(\"htmlFor\"===R){if(A.for)continue;R=\"for\"}\"style\"===R&&J&&\"object\"==typeof J&&(J=u(J)),\"a\"===R[0]&&\"r\"===R[1]&&\"boolean\"==typeof J&&(J=String(J));var q=r.attributeHook&&r.attributeHook(R,J,n,r,O);if(q||\"\"===q)W+=q;else if(\"dangerouslySetInnerHTML\"===R)U=J&&J.__html;else if(\"textarea\"===S&&\"value\"===R)$=J;else if((J||0===J||\"\"===J)&&\"function\"!=typeof J){if(!(!0!==J&&\"\"!==J||(J=R,r&&r.xml))){W=W+\" \"+R;continue}if(\"value\"===R){if(\"select\"===S){p=J;continue}\"option\"===S&&p==J&&void 0===A.selected&&(W+=\" selected\")}W=W+\" \"+R+'=\"'+i(J)+'\"'}}}else $=J}}if(m){var V=W.replace(/\\n\\s*/,\" \");V===W||~V.indexOf(\"\\n\")?m&&~W.indexOf(\"\\n\")&&(W+=\"\\n\"):W=V}if(W+=\">\",g.test(S))throw new Error(S+\" is not a valid HTML tag name in \"+W);var z,B=y.test(S)||r.voidElements&&r.voidElements.test(S),G=[];if(U)m&&c(U)&&(U=\"\\n\"+_+a(U,_)),W+=U;else if(null!=$&&f(z=[],$).length){for(var Z=m&&~W.indexOf(\"\\n\"),K=!1,Q=0;Q<z.length;Q++){var X=z[Q];if(null!=X&&!1!==X){var Y=h(X,n,r,!0,\"svg\"===S||\"foreignObject\"!==S&&l,p);if(m&&!Z&&c(Y)&&(Z=!0),Y)if(m){var tt=Y.length>0&&\"<\"!=Y[0];K&&tt?G[G.length-1]+=Y:G.push(Y),K=tt}else G.push(Y)}}if(m&&Z)for(var et=G.length;et--;)G[et]=\"\\n\"+_+a(G[et],_)}if(G.length||U)W+=G.join(\"\");else if(r&&r.xml)return W.substring(0,W.length-1)+\" />\";return!B||z||U?(m&&~W.indexOf(\"\\n\")&&(W+=\"\\n\"),W=W+\"</\"+S+\">\"):W=W.replace(/>$/,\" />\"),W}_.shallowRender=function(t,e){return _(t,e,p)};const v=/(\\\\|\\\"|\\')/g,x=Object.prototype.toString,j=Date.prototype.toISOString,S=Error.prototype.toString,A=RegExp.prototype.toString,O=Symbol.prototype.toString,k=/^Symbol\\((.*)\\)(.*)$/,w=/\\n/gi,F=Object.getOwnPropertySymbols||(t=>[]);function C(t){return\"[object Array]\"===t||\"[object ArrayBuffer]\"===t||\"[object DataView]\"===t||\"[object Float32Array]\"===t||\"[object Float64Array]\"===t||\"[object Int8Array]\"===t||\"[object Int16Array]\"===t||\"[object Int32Array]\"===t||\"[object Uint8Array]\"===t||\"[object Uint8ClampedArray]\"===t||\"[object Uint16Array]\"===t||\"[object Uint32Array]\"===t}function E(t){return\"\"===t.name?\"[Function anonymous]\":\"[Function \"+t.name+\"]\"}function M(t){return O.call(t).replace(k,\"Symbol($1)\")}function N(t){return\"[\"+S.call(t)+\"]\"}function D(t){if(!0===t||!1===t)return\"\"+t;if(void 0===t)return\"undefined\";if(null===t)return\"null\";const e=typeof t;if(\"number\"===e)return function(t){return t!=+t?\"NaN\":0===t&&1/t<0?\"-0\":\"\"+t}(t);if(\"string\"===e)return'\"'+function(t){return t.replace(v,\"\\\\$1\")}(t)+'\"';if(\"function\"===e)return E(t);if(\"symbol\"===e)return M(t);const n=x.call(t);return\"[object WeakMap]\"===n?\"WeakMap {}\":\"[object WeakSet]\"===n?\"WeakSet {}\":\"[object Function]\"===n||\"[object GeneratorFunction]\"===n?E(t,min):\"[object Symbol]\"===n?M(t):\"[object Date]\"===n?j.call(t):\"[object Error]\"===n?N(t):\"[object RegExp]\"===n?A.call(t):\"[object Arguments]\"===n&&0===t.length?\"Arguments []\":C(n)&&0===t.length?t.constructor.name+\" []\":t instanceof Error&&N(t)}function H(t,e,n,r,o,i,a,c,l,u){let s=\"\";if(t.length){s+=o;const f=n+e;for(let n=0;n<t.length;n++)s+=f+$(t[n],e,f,r,o,i,a,c,l,u),n<t.length-1&&(s+=\",\"+r);s+=o+n}return\"[\"+s+\"]\"}function I(t,e,n,r,o,i,a,c,l,u){if((i=i.slice()).indexOf(t)>-1)return\"[Circular]\";i.push(t);const s=++c>a;if(!s&&t.toJSON&&\"function\"==typeof t.toJSON)return $(t.toJSON(),e,n,r,o,i,a,c,l,u);const f=x.call(t);return\"[object Arguments]\"===f?s?\"[Arguments]\":function(t,e,n,r,o,i,a,c,l,u){return(u?\"\":\"Arguments \")+H(t,e,n,r,o,i,a,c,l,u)}(t,e,n,r,o,i,a,c,l,u):C(f)?s?\"[Array]\":function(t,e,n,r,o,i,a,c,l,u){return(u?\"\":t.constructor.name+\" \")+H(t,e,n,r,o,i,a,c,l,u)}(t,e,n,r,o,i,a,c,l,u):\"[object Map]\"===f?s?\"[Map]\":function(t,e,n,r,o,i,a,c,l,u){let s=\"Map {\";const f=t.entries();let p=f.next();if(!p.done){s+=o;const t=n+e;for(;!p.done;)s+=t+$(p.value[0],e,t,r,o,i,a,c,l,u)+\" => \"+$(p.value[1],e,t,r,o,i,a,c,l,u),p=f.next(),p.done||(s+=\",\"+r);s+=o+n}return s+\"}\"}(t,e,n,r,o,i,a,c,l,u):\"[object Set]\"===f?s?\"[Set]\":function(t,e,n,r,o,i,a,c,l,u){let s=\"Set {\";const f=t.entries();let p=f.next();if(!p.done){s+=o;const t=n+e;for(;!p.done;)s+=t+$(p.value[1],e,t,r,o,i,a,c,l,u),p=f.next(),p.done||(s+=\",\"+r);s+=o+n}return s+\"}\"}(t,e,n,r,o,i,a,c,l,u):\"object\"==typeof t?s?\"[Object]\":function(t,e,n,r,o,i,a,c,l,u){let s=(u?\"\":t.constructor?t.constructor.name+\" \":\"Object \")+\"{\",f=Object.keys(t).sort();const p=F(t);if(p.length&&(f=f.filter(t=>!(\"symbol\"==typeof t||\"[object Symbol]\"===x.call(t))).concat(p)),f.length){s+=o;const p=n+e;for(let n=0;n<f.length;n++){const d=f[n];s+=p+$(d,e,p,r,o,i,a,c,l,u)+\": \"+$(t[d],e,p,r,o,i,a,c,l,u),n<f.length-1&&(s+=\",\"+r)}s+=o+n}return s+\"}\"}(t,e,n,r,o,i,a,c,l,u):void 0}function T(t,e,n,r,o,i,a,c,l,u){let s,f=!1;for(let e=0;e<l.length;e++)if(s=l[e],s.test(t)){f=!0;break}return!!f&&s.print(t,function(t){return $(t,e,n,r,o,i,a,c,l,u)},function(t){const r=n+e;return r+t.replace(w,\"\\n\"+r)},{edgeSpacing:o,spacing:r})}function $(t,e,n,r,o,i,a,c,l,u){return D(t)||T(t,e,n,r,o,i,a,c,l,u)||I(t,e,n,r,o,i,a,c,l,u)}const U={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function W(t){return new Array(t+1).join(\" \")}var L={test:function(t){return t&&\"object\"==typeof t&&\"type\"in t&&\"props\"in t&&\"key\"in t},print:function(t,e,n){return _(t,L.context,L.opts)}},P={plugins:[L]},R={attributeHook:function(t,e,n,r,o){var c=typeof e;if(\"dangerouslySetInnerHTML\"===t)return!1;if(null==e||\"function\"===c&&!r.functions)return\"\";if(r.skipFalseAttributes&&!o&&(!1===e||(\"class\"===t||\"style\"===t)&&\"\"===e))return\"\";var l=\"string\"==typeof r.pretty?r.pretty:\"\\t\";return\"string\"!==c?(\"function\"!==c||r.functionNames?(L.context=n,L.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!U.hasOwnProperty(t))throw new Error(\"prettyFormat: Invalid option: \"+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error(\"prettyFormat: Cannot run with min option and indent\")}(e),e=function(t){const e={};return Object.keys(U).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:U[n]),e.min&&(e.indent=0),e}(e)):e=U;const o=e.min?\" \":\"\\n\",i=e.min?\"\":\"\\n\";if(e&&e.plugins.length){n=W(e.indent),r=[];var a=T(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return D(t)||(n||(n=W(e.indent)),r||(r=[]),I(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,P)).indexOf(\"\\n\")&&(e=a(\"\\n\"+e,l)+\"\\n\")):e=\"Function\",a(\"\\n\"+t+\"={\"+e+\"}\",l)):\"\\n\"+l+t+'=\"'+i(e)+'\"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:\" \"};function J(t,e,n,r){return _(t,e,n=s(s({},R),n||{}))}t.default=J,t.render=J});\n//# sourceMappingURL=jsx.js.map\n"],"names":["t","Symbol","n","s","c"],"mappings":"mEAAA,SAAsBA,GAAA,MAAXC,KAAAA,KAAuBC,GACjCD,WAEAA,SAASD,GAAUG,MAClB,KAAAH,OAAkBI,EAAAA"}
1
+ {"version":3,"file":"jsx.js","sources":["jsx.js"],"sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?e(exports,require(\"preact\")):\"function\"==typeof define&&define.amd?define([\"exports\",\"preact\"],e):e((t||self).preactRenderToString={},t.preact)}(this,function(t,e){if(\"function\"!=typeof Symbol){var n=0;Symbol=function(t){return\"@@\"+t+ ++n},Symbol.for=function(t){return\"@@\"+t}}var r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,i=/[\\s\\n\\\\/='\"\\0<>]/,a=/^xlink:?./,s=/[\"&<]/;function l(t){if(!1===s.test(t+=\"\"))return t;for(var e=0,n=0,r=\"\",o=\"\";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=\"&quot;\";break;case 38:o=\"&amp;\";break;case 60:o=\"&lt;\";break;default:continue}n!==e&&(r+=t.slice(e,n)),r+=o,e=n+1}return n!==e&&(r+=t.slice(e,n)),r}var c=function(t,e){return String(t).replace(/(\\n+)/g,\"$1\"+(e||\"\\t\"))},u=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf(\"\\n\")||-1!==String(t).indexOf(\"<\")},f={},p=/([A-Z])/g;function d(t){var e=\"\";for(var n in t){var o=t[n];null!=o&&\"\"!==o&&(e&&(e+=\" \"),e+=\"-\"==n[0]?n:f[n]||(f[n]=n.replace(p,\"-$1\").toLowerCase()),e=\"number\"==typeof o&&!1===r.test(n)?e+\": \"+o+\"px;\":e+\": \"+o+\";\")}return e||void 0}function _(t,e){return Array.isArray(e)?e.reduce(_,t):null!=e&&!1!==e&&t.push(e),t}function y(){this.__d=!0}function g(t,e){return{__v:t,context:e,props:t.props,setState:y,forceUpdate:y,__d:!0,__h:[]}}function v(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var b=[];function m(t,n,r,s,f,p){if(null==t||\"boolean\"==typeof t)return\"\";if(\"object\"!=typeof t)return l(t);var y=r.pretty,h=y&&\"string\"==typeof y?y:\"\\t\";if(Array.isArray(t)){for(var j=\"\",x=0;x<t.length;x++)y&&x>0&&(j+=\"\\n\"),j+=m(t[x],n,r,s,f,p);return j}var S,k=t.type,A=t.props,O=!1;if(\"function\"==typeof k){if(O=!0,!r.shallow||!s&&!1!==r.renderRootComponent){if(k===e.Fragment){var w=[];return _(w,t.props.children),m(w,n,r,!1!==r.shallowHighOrder,f,p)}var F,C=t.__c=g(t,n);e.options.__b&&e.options.__b(t);var E=e.options.__r;if(k.prototype&&\"function\"==typeof k.prototype.render){var M=v(k,n);(C=t.__c=new k(A,M)).__v=t,C._dirty=C.__d=!0,C.props=A,null==C.state&&(C.state={}),null==C._nextState&&null==C.__s&&(C._nextState=C.__s=C.state),C.context=M,k.getDerivedStateFromProps?C.state=Object.assign({},C.state,k.getDerivedStateFromProps(C.props,C.state)):C.componentWillMount&&(C.componentWillMount(),C.state=C._nextState!==C.state?C._nextState:C.__s!==C.state?C.__s:C.state),E&&E(t),F=C.render(C.props,C.state,C.context)}else for(var H=v(k,n),N=0;C.__d&&N++<25;)C.__d=!1,E&&E(t),F=k.call(t.__c,A,H);return C.getChildContext&&(n=Object.assign({},n,C.getChildContext())),e.options.diffed&&e.options.diffed(t),m(F,n,r,!1!==r.shallowHighOrder,f,p)}k=(S=k).displayName||S!==Function&&S.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\\s*function\\s+([^( ]+)/)||\"\")[1];if(!e){for(var n=-1,r=b.length;r--;)if(b[r]===t){n=r;break}n<0&&(n=b.push(t)-1),e=\"UnnamedComponent\"+n}return e}(S)}var D,I,T=\"<\"+k;if(A){var L=Object.keys(A);r&&!0===r.sortAttributes&&L.sort();for(var W=0;W<L.length;W++){var $=L[W],P=A[$];if(\"children\"!==$){if(!i.test($)&&(r&&r.allAttributes||\"key\"!==$&&\"ref\"!==$&&\"__self\"!==$&&\"__source\"!==$)){if(\"defaultValue\"===$)$=\"value\";else if(\"defaultChecked\"===$)$=\"checked\";else if(\"defaultSelected\"===$)$=\"selected\";else if(\"className\"===$){if(void 0!==A.class)continue;$=\"class\"}else f&&a.test($)&&($=$.toLowerCase().replace(/^xlink:?/,\"xlink:\"));if(\"htmlFor\"===$){if(A.for)continue;$=\"for\"}\"style\"===$&&P&&\"object\"==typeof P&&(P=d(P)),\"a\"===$[0]&&\"r\"===$[1]&&\"boolean\"==typeof P&&(P=String(P));var U=r.attributeHook&&r.attributeHook($,P,n,r,O);if(U||\"\"===U)T+=U;else if(\"dangerouslySetInnerHTML\"===$)I=P&&P.__html;else if(\"textarea\"===k&&\"value\"===$)D=P;else if((P||0===P||\"\"===P)&&\"function\"!=typeof P){if(!(!0!==P&&\"\"!==P||(P=$,r&&r.xml))){T=T+\" \"+$;continue}if(\"value\"===$){if(\"select\"===k){p=P;continue}\"option\"===k&&p==P&&void 0===A.selected&&(T+=\" selected\")}T=T+\" \"+$+'=\"'+l(P)+'\"'}}}else D=P}}if(y){var R=T.replace(/\\n\\s*/,\" \");R===T||~R.indexOf(\"\\n\")?y&&~T.indexOf(\"\\n\")&&(T+=\"\\n\"):T=R}if(T+=\">\",i.test(k))throw new Error(k+\" is not a valid HTML tag name in \"+T);var J,V=o.test(k)||r.voidElements&&r.voidElements.test(k),q=[];if(I)y&&u(I)&&(I=\"\\n\"+h+c(I,h)),T+=I;else if(null!=D&&_(J=[],D).length){for(var z=y&&~T.indexOf(\"\\n\"),B=!1,G=0;G<J.length;G++){var Z=J[G];if(null!=Z&&!1!==Z){var K=m(Z,n,r,!0,\"svg\"===k||\"foreignObject\"!==k&&f,p);if(y&&!z&&u(K)&&(z=!0),K)if(y){var Q=K.length>0&&\"<\"!=K[0];B&&Q?q[q.length-1]+=K:q.push(K),B=Q}else q.push(K)}}if(y&&z)for(var X=q.length;X--;)q[X]=\"\\n\"+h+c(q[X],h)}if(q.length||I)T+=q.join(\"\");else if(r&&r.xml)return T.substring(0,T.length-1)+\" />\";return!V||J||I?(y&&~T.indexOf(\"\\n\")&&(T+=\"\\n\"),T=T+\"</\"+k+\">\"):T=T.replace(/>$/,\" />\"),T}var h={shallow:!0};x.render=x;var j=[];function x(t,n,r){n=n||{};var o=e.options.__s;e.options.__s=!0;var i,a=e.h(e.Fragment,null);return a.__k=[t],i=r&&(r.pretty||r.voidElements||r.sortAttributes||r.shallow||r.allAttributes||r.xml||r.attributeHook)?m(t,n,r):w(t,n,!1,void 0,a),e.options.__c&&e.options.__c(t,j),e.options.__s=o,j.length=0,i}function S(t,e){return\"className\"===t?\"class\":\"htmlFor\"===t?\"for\":\"defaultValue\"===t?\"value\":\"defaultChecked\"===t?\"checked\":\"defaultSelected\"===t?\"selected\":e&&a.test(t)?t.toLowerCase().replace(/^xlink:?/,\"xlink:\"):t}function k(t,e){return\"style\"===t&&null!=e&&\"object\"==typeof e?d(e):\"a\"===t[0]&&\"r\"===t[1]&&\"boolean\"==typeof e?String(e):e}var A=Array.isArray,O=Object.assign;function w(t,n,r,a,s){if(null==t||!0===t||!1===t||\"\"===t)return\"\";if(\"object\"!=typeof t)return l(t);if(A(t)){var c=\"\";s.__k=t;for(var u=0;u<t.length;u++)c+=w(t[u],n,r,a,s);return c}t.__=s,e.options.__b&&e.options.__b(t);var f=t.type,p=t.props;if(\"function\"==typeof f){var d;if(f===e.Fragment)d=p.children;else{d=f.prototype&&\"function\"==typeof f.prototype.render?function(t,n){var r=t.type,o=v(r,n),i=new r(t.props,o);t.__c=i,i.__v=t,i.__d=!0,i.props=t.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=O({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var a=e.options.__r;return a&&a(t),i.render(i.props,i.state,i.context)}(t,n):function(t,n){var r,o=g(t,n),i=v(t.type,n);t.__c=o;for(var a=e.options.__r,s=0;o.__d&&s++<25;)o.__d=!1,a&&a(t),r=t.type.call(o,t.props,i);return r}(t,n);var _=t.__c;_.getChildContext&&(n=O({},n,_.getChildContext()))}var y=w(d,n,r,a,t);return e.options.diffed&&e.options.diffed(t),t.__=void 0,e.options.unmount&&e.options.unmount(t),y}var b,m,h=\"<\";if(h+=f,p)for(var j in b=p.children,p){var x=p[j];if(!(\"key\"===j||\"ref\"===j||\"__self\"===j||\"__source\"===j||\"children\"===j||\"className\"===j&&\"class\"in p||\"htmlFor\"===j&&\"for\"in p||i.test(j)))if(x=k(j=S(j,r),x),\"dangerouslySetInnerHTML\"===j)m=x&&x.__html;else if(\"textarea\"===f&&\"value\"===j)b=x;else if((x||0===x||\"\"===x)&&\"function\"!=typeof x){if(!0===x||\"\"===x){x=j,h=h+\" \"+j;continue}if(\"value\"===j){if(\"select\"===f){a=x;continue}\"option\"!==f||a!=x||\"selected\"in p||(h+=\" selected\")}h=h+\" \"+j+'=\"'+l(x)+'\"'}}var F=h;if(h+=\">\",i.test(f))throw new Error(f+\" is not a valid HTML tag name in \"+h);var C=\"\",E=!1;if(m)C+=m,E=!0;else if(\"string\"==typeof b)C+=l(b),E=!0;else if(A(b)){t.__k=b;for(var M=0;M<b.length;M++){var H=b[M];if(null!=H&&!1!==H){var N=w(H,n,\"svg\"===f||\"foreignObject\"!==f&&r,a,t);N&&(C+=N,E=!0)}}}else if(null!=b&&!1!==b&&!0!==b){t.__k=[b];var D=w(b,n,\"svg\"===f||\"foreignObject\"!==f&&r,a,t);D&&(C+=D,E=!0)}if(e.options.diffed&&e.options.diffed(t),t.__=void 0,e.options.unmount&&e.options.unmount(t),E)h+=C;else if(o.test(f))return F+\" />\";return h+\"</\"+f+\">\"}x.shallowRender=function(t,e){return x(t,e,h)};const F=/(\\\\|\\\"|\\')/g,C=Object.prototype.toString,E=Date.prototype.toISOString,M=Error.prototype.toString,H=RegExp.prototype.toString,N=Symbol.prototype.toString,D=/^Symbol\\((.*)\\)(.*)$/,I=/\\n/gi,T=Object.getOwnPropertySymbols||(t=>[]);function L(t){return\"[object Array]\"===t||\"[object ArrayBuffer]\"===t||\"[object DataView]\"===t||\"[object Float32Array]\"===t||\"[object Float64Array]\"===t||\"[object Int8Array]\"===t||\"[object Int16Array]\"===t||\"[object Int32Array]\"===t||\"[object Uint8Array]\"===t||\"[object Uint8ClampedArray]\"===t||\"[object Uint16Array]\"===t||\"[object Uint32Array]\"===t}function W(t){return\"\"===t.name?\"[Function anonymous]\":\"[Function \"+t.name+\"]\"}function $(t){return N.call(t).replace(D,\"Symbol($1)\")}function P(t){return\"[\"+M.call(t)+\"]\"}function U(t){if(!0===t||!1===t)return\"\"+t;if(void 0===t)return\"undefined\";if(null===t)return\"null\";const e=typeof t;if(\"number\"===e)return function(t){return t!=+t?\"NaN\":0===t&&1/t<0?\"-0\":\"\"+t}(t);if(\"string\"===e)return'\"'+function(t){return t.replace(F,\"\\\\$1\")}(t)+'\"';if(\"function\"===e)return W(t);if(\"symbol\"===e)return $(t);const n=C.call(t);return\"[object WeakMap]\"===n?\"WeakMap {}\":\"[object WeakSet]\"===n?\"WeakSet {}\":\"[object Function]\"===n||\"[object GeneratorFunction]\"===n?W(t,min):\"[object Symbol]\"===n?$(t):\"[object Date]\"===n?E.call(t):\"[object Error]\"===n?P(t):\"[object RegExp]\"===n?H.call(t):\"[object Arguments]\"===n&&0===t.length?\"Arguments []\":L(n)&&0===t.length?t.constructor.name+\" []\":t instanceof Error&&P(t)}function R(t,e,n,r,o,i,a,s,l,c){let u=\"\";if(t.length){u+=o;const f=n+e;for(let n=0;n<t.length;n++)u+=f+q(t[n],e,f,r,o,i,a,s,l,c),n<t.length-1&&(u+=\",\"+r);u+=o+n}return\"[\"+u+\"]\"}function J(t,e,n,r,o,i,a,s,l,c){if((i=i.slice()).indexOf(t)>-1)return\"[Circular]\";i.push(t);const u=++s>a;if(!u&&t.toJSON&&\"function\"==typeof t.toJSON)return q(t.toJSON(),e,n,r,o,i,a,s,l,c);const f=C.call(t);return\"[object Arguments]\"===f?u?\"[Arguments]\":function(t,e,n,r,o,i,a,s,l,c){return(c?\"\":\"Arguments \")+R(t,e,n,r,o,i,a,s,l,c)}(t,e,n,r,o,i,a,s,l,c):L(f)?u?\"[Array]\":function(t,e,n,r,o,i,a,s,l,c){return(c?\"\":t.constructor.name+\" \")+R(t,e,n,r,o,i,a,s,l,c)}(t,e,n,r,o,i,a,s,l,c):\"[object Map]\"===f?u?\"[Map]\":function(t,e,n,r,o,i,a,s,l,c){let u=\"Map {\";const f=t.entries();let p=f.next();if(!p.done){u+=o;const t=n+e;for(;!p.done;)u+=t+q(p.value[0],e,t,r,o,i,a,s,l,c)+\" => \"+q(p.value[1],e,t,r,o,i,a,s,l,c),p=f.next(),p.done||(u+=\",\"+r);u+=o+n}return u+\"}\"}(t,e,n,r,o,i,a,s,l,c):\"[object Set]\"===f?u?\"[Set]\":function(t,e,n,r,o,i,a,s,l,c){let u=\"Set {\";const f=t.entries();let p=f.next();if(!p.done){u+=o;const t=n+e;for(;!p.done;)u+=t+q(p.value[1],e,t,r,o,i,a,s,l,c),p=f.next(),p.done||(u+=\",\"+r);u+=o+n}return u+\"}\"}(t,e,n,r,o,i,a,s,l,c):\"object\"==typeof t?u?\"[Object]\":function(t,e,n,r,o,i,a,s,l,c){let u=(c?\"\":t.constructor?t.constructor.name+\" \":\"Object \")+\"{\",f=Object.keys(t).sort();const p=T(t);if(p.length&&(f=f.filter(t=>!(\"symbol\"==typeof t||\"[object Symbol]\"===C.call(t))).concat(p)),f.length){u+=o;const p=n+e;for(let n=0;n<f.length;n++){const d=f[n];u+=p+q(d,e,p,r,o,i,a,s,l,c)+\": \"+q(t[d],e,p,r,o,i,a,s,l,c),n<f.length-1&&(u+=\",\"+r)}u+=o+n}return u+\"}\"}(t,e,n,r,o,i,a,s,l,c):void 0}function V(t,e,n,r,o,i,a,s,l,c){let u,f=!1;for(let e=0;e<l.length;e++)if(u=l[e],u.test(t)){f=!0;break}return!!f&&u.print(t,function(t){return q(t,e,n,r,o,i,a,s,l,c)},function(t){const r=n+e;return r+t.replace(I,\"\\n\"+r)},{edgeSpacing:o,spacing:r})}function q(t,e,n,r,o,i,a,s,l,c){return U(t)||V(t,e,n,r,o,i,a,s,l,c)||J(t,e,n,r,o,i,a,s,l,c)}const z={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function B(t){return new Array(t+1).join(\" \")}var G={test:function(t){return t&&\"object\"==typeof t&&\"type\"in t&&\"props\"in t&&\"key\"in t},print:function(t,e,n){return x(t,G.context,G.opts)}},Z={plugins:[G]},K={attributeHook:function(t,e,n,r,o){var i=typeof e;if(\"dangerouslySetInnerHTML\"===t)return!1;if(null==e||\"function\"===i&&!r.functions)return\"\";if(r.skipFalseAttributes&&!o&&(!1===e||(\"class\"===t||\"style\"===t)&&\"\"===e))return\"\";var a=\"string\"==typeof r.pretty?r.pretty:\"\\t\";return\"string\"!==i?(\"function\"!==i||r.functionNames?(G.context=n,G.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!z.hasOwnProperty(t))throw new Error(\"prettyFormat: Invalid option: \"+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error(\"prettyFormat: Cannot run with min option and indent\")}(e),e=function(t){const e={};return Object.keys(z).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:z[n]),e.min&&(e.indent=0),e}(e)):e=z;const o=e.min?\" \":\"\\n\",i=e.min?\"\":\"\\n\";if(e&&e.plugins.length){n=B(e.indent),r=[];var a=V(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return U(t)||(n||(n=B(e.indent)),r||(r=[]),J(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,Z)).indexOf(\"\\n\")&&(e=c(\"\\n\"+e,a)+\"\\n\")):e=\"Function\",c(\"\\n\"+t+\"={\"+e+\"}\",a)):\"\\n\"+a+t+'=\"'+l(e)+'\"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:\" \"};function Q(t,e,n,r){return x(t,e,n=Object.assign({},K,n||{}))}t.default=Q,t.render=Q});\n//# sourceMappingURL=jsx.js.map\n"],"names":["t","Symbol","n","s","c"],"mappings":"mEAAA,SAAsBA,GAAA,MAAXC,KAAAA,KAAuBC,GACjCD,WAEAA,SAASD,GAAUG,MAClB,KAAAH,OAAkBI,EAAAA"}
package/dist/jsx.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{options as t,Fragment as e}from"preact";if("function"!=typeof Symbol){var n=0;Symbol=function(t){return"@@"+t+ ++n},Symbol.for=function(t){return"@@"+t}}var r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/[&<>"]/;function i(t){var e=String(t);return o.test(e)?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):e}var a=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},c=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},l={};function u(t){var e="";for(var n in t){var o=t[n];null!=o&&""!==o&&(e&&(e+=" "),e+="-"==n[0]?n:l[n]||(l[n]=n.replace(/([A-Z])/g,"-$1").toLowerCase()),e+=": ",e+=o,"number"==typeof o&&!1===r.test(n)&&(e+="px"),e+=";")}return e||void 0}function f(t,e){for(var n in e)t[n]=e[n];return t}function s(t,e){return Array.isArray(e)?e.reduce(s,t):null!=e&&!1!==e&&t.push(e),t}var p={shallow:!0},y=[],d=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,g=/[\s\n\\/='"\0<>]/;function b(){this.__d=!0}_.render=_;var m=[];function _(e,n,r){n=n||{},r=r||{};var o=t.__s;t.__s=!0;var i=v(e,n,r);return t.__c&&t.__c(e,m),m.length=0,t.__s=o,i}function v(n,r,o,l,p,m){if(null==n||"boolean"==typeof n)return"";if("object"!=typeof n)return i(n);var _=o.pretty,h=_&&"string"==typeof _?_:"\t";if(Array.isArray(n)){for(var x="",j=0;j<n.length;j++)_&&j>0&&(x+="\n"),x+=v(n[j],r,o,l,p,m);return x}var S,A=n.type,O=n.props,k=!1;if("function"==typeof A){if(k=!0,!o.shallow||!l&&!1!==o.renderRootComponent){if(A===e){var w=[];return s(w,n.props.children),v(w,r,o,!1!==o.shallowHighOrder,p,m)}var F,C=n.__c={__v:n,context:r,props:n.props,setState:b,forceUpdate:b,__d:!0,__h:[]};t.__b&&t.__b(n);var E=t.__r;if(A.prototype&&"function"==typeof A.prototype.render){var M=A.contextType,N=M&&r[M.__c],D=null!=M?N?N.props.value:M.__:r;(C=n.__c=new A(O,D)).__v=n,C._dirty=C.__d=!0,C.props=O,null==C.state&&(C.state={}),null==C._nextState&&null==C.__s&&(C._nextState=C.__s=C.state),C.context=D,A.getDerivedStateFromProps?C.state=f(f({},C.state),A.getDerivedStateFromProps(C.props,C.state)):C.componentWillMount&&(C.componentWillMount(),C.state=C._nextState!==C.state?C._nextState:C.__s!==C.state?C.__s:C.state),E&&E(n),F=C.render(C.props,C.state,C.context)}else for(var H=A.contextType,I=H&&r[H.__c],$=null!=H?I?I.props.value:H.__:r,U=0;C.__d&&U++<25;)C.__d=!1,E&&E(n),F=A.call(n.__c,O,$);return C.getChildContext&&(r=f(f({},r),C.getChildContext())),t.diffed&&t.diffed(n),v(F,r,o,!1!==o.shallowHighOrder,p,m)}A=(S=A).displayName||S!==Function&&S.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=y.length;r--;)if(y[r]===t){n=r;break}n<0&&(n=y.push(t)-1),e="UnnamedComponent"+n}return e}(S)}var W,L,P="<"+A;if(O){var T=Object.keys(O);o&&!0===o.sortAttributes&&T.sort();for(var R=0;R<T.length;R++){var J=T[R],V=O[J];if("children"!==J){if(!g.test(J)&&(o&&o.allAttributes||"key"!==J&&"ref"!==J&&"__self"!==J&&"__source"!==J)){if("defaultValue"===J)J="value";else if("defaultChecked"===J)J="checked";else if("defaultSelected"===J)J="selected";else if("className"===J){if(void 0!==O.class)continue;J="class"}else p&&/^xlink:?./.test(J)&&(J=J.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===J){if(O.for)continue;J="for"}"style"===J&&V&&"object"==typeof V&&(V=u(V)),"a"===J[0]&&"r"===J[1]&&"boolean"==typeof V&&(V=String(V));var q=o.attributeHook&&o.attributeHook(J,V,r,o,k);if(q||""===q)P+=q;else if("dangerouslySetInnerHTML"===J)L=V&&V.__html;else if("textarea"===A&&"value"===J)W=V;else if((V||0===V||""===V)&&"function"!=typeof V){if(!(!0!==V&&""!==V||(V=J,o&&o.xml))){P=P+" "+J;continue}if("value"===J){if("select"===A){m=V;continue}"option"===A&&m==V&&void 0===O.selected&&(P+=" selected")}P=P+" "+J+'="'+i(V)+'"'}}}else W=V}}if(_){var z=P.replace(/\n\s*/," ");z===P||~z.indexOf("\n")?_&&~P.indexOf("\n")&&(P+="\n"):P=z}if(P+=">",g.test(A))throw new Error(A+" is not a valid HTML tag name in "+P);var B,G=d.test(A)||o.voidElements&&o.voidElements.test(A),Z=[];if(L)_&&c(L)&&(L="\n"+h+a(L,h)),P+=L;else if(null!=W&&s(B=[],W).length){for(var K=_&&~P.indexOf("\n"),Q=!1,X=0;X<B.length;X++){var Y=B[X];if(null!=Y&&!1!==Y){var tt=v(Y,r,o,!0,"svg"===A||"foreignObject"!==A&&p,m);if(_&&!K&&c(tt)&&(K=!0),tt)if(_){var et=tt.length>0&&"<"!=tt[0];Q&&et?Z[Z.length-1]+=tt:Z.push(tt),Q=et}else Z.push(tt)}}if(_&&K)for(var nt=Z.length;nt--;)Z[nt]="\n"+h+a(Z[nt],h)}if(Z.length||L)P+=Z.join("");else if(o&&o.xml)return P.substring(0,P.length-1)+" />";return!G||B||L?(_&&~P.indexOf("\n")&&(P+="\n"),P=P+"</"+A+">"):P=P.replace(/>$/," />"),P}_.shallowRender=function(t,e){return _(t,e,p)};const h=/(\\|\"|\')/g,x=Object.prototype.toString,j=Date.prototype.toISOString,S=Error.prototype.toString,A=RegExp.prototype.toString,O=Symbol.prototype.toString,k=/^Symbol\((.*)\)(.*)$/,w=/\n/gi,F=Object.getOwnPropertySymbols||(t=>[]);function C(t){return"[object Array]"===t||"[object ArrayBuffer]"===t||"[object DataView]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object Int8Array]"===t||"[object Int16Array]"===t||"[object Int32Array]"===t||"[object Uint8Array]"===t||"[object Uint8ClampedArray]"===t||"[object Uint16Array]"===t||"[object Uint32Array]"===t}function E(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function M(t){return O.call(t).replace(k,"Symbol($1)")}function N(t){return"["+S.call(t)+"]"}function D(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";const e=typeof t;if("number"===e)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===e)return'"'+function(t){return t.replace(h,"\\$1")}(t)+'"';if("function"===e)return E(t);if("symbol"===e)return M(t);const n=x.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?E(t,min):"[object Symbol]"===n?M(t):"[object Date]"===n?j.call(t):"[object Error]"===n?N(t):"[object RegExp]"===n?A.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":C(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&N(t)}function H(t,e,n,r,o,i,a,c,l,u){let f="";if(t.length){f+=o;const s=n+e;for(let n=0;n<t.length;n++)f+=s+U(t[n],e,s,r,o,i,a,c,l,u),n<t.length-1&&(f+=","+r);f+=o+n}return"["+f+"]"}function I(t,e,n,r,o,i,a,c,l,u){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const f=++c>a;if(!f&&t.toJSON&&"function"==typeof t.toJSON)return U(t.toJSON(),e,n,r,o,i,a,c,l,u);const s=x.call(t);return"[object Arguments]"===s?f?"[Arguments]":function(t,e,n,r,o,i,a,c,l,u){return(u?"":"Arguments ")+H(t,e,n,r,o,i,a,c,l,u)}(t,e,n,r,o,i,a,c,l,u):C(s)?f?"[Array]":function(t,e,n,r,o,i,a,c,l,u){return(u?"":t.constructor.name+" ")+H(t,e,n,r,o,i,a,c,l,u)}(t,e,n,r,o,i,a,c,l,u):"[object Map]"===s?f?"[Map]":function(t,e,n,r,o,i,a,c,l,u){let f="Map {";const s=t.entries();let p=s.next();if(!p.done){f+=o;const t=n+e;for(;!p.done;)f+=t+U(p.value[0],e,t,r,o,i,a,c,l,u)+" => "+U(p.value[1],e,t,r,o,i,a,c,l,u),p=s.next(),p.done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,a,c,l,u):"[object Set]"===s?f?"[Set]":function(t,e,n,r,o,i,a,c,l,u){let f="Set {";const s=t.entries();let p=s.next();if(!p.done){f+=o;const t=n+e;for(;!p.done;)f+=t+U(p.value[1],e,t,r,o,i,a,c,l,u),p=s.next(),p.done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,a,c,l,u):"object"==typeof t?f?"[Object]":function(t,e,n,r,o,i,a,c,l,u){let f=(u?"":t.constructor?t.constructor.name+" ":"Object ")+"{",s=Object.keys(t).sort();const p=F(t);if(p.length&&(s=s.filter(t=>!("symbol"==typeof t||"[object Symbol]"===x.call(t))).concat(p)),s.length){f+=o;const p=n+e;for(let n=0;n<s.length;n++){const y=s[n];f+=p+U(y,e,p,r,o,i,a,c,l,u)+": "+U(t[y],e,p,r,o,i,a,c,l,u),n<s.length-1&&(f+=","+r)}f+=o+n}return f+"}"}(t,e,n,r,o,i,a,c,l,u):void 0}function $(t,e,n,r,o,i,a,c,l,u){let f,s=!1;for(let e=0;e<l.length;e++)if(f=l[e],f.test(t)){s=!0;break}return!!s&&f.print(t,function(t){return U(t,e,n,r,o,i,a,c,l,u)},function(t){const r=n+e;return r+t.replace(w,"\n"+r)},{edgeSpacing:o,spacing:r})}function U(t,e,n,r,o,i,a,c,l,u){return D(t)||$(t,e,n,r,o,i,a,c,l,u)||I(t,e,n,r,o,i,a,c,l,u)}const W={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function L(t){return new Array(t+1).join(" ")}var P={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t,e,n){return _(t,P.context,P.opts)}},T={plugins:[P]},R={attributeHook:function(t,e,n,r,o){var c=typeof e;if("dangerouslySetInnerHTML"===t)return!1;if(null==e||"function"===c&&!r.functions)return"";if(r.skipFalseAttributes&&!o&&(!1===e||("class"===t||"style"===t)&&""===e))return"";var l="string"==typeof r.pretty?r.pretty:"\t";return"string"!==c?("function"!==c||r.functionNames?(P.context=n,P.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!W.hasOwnProperty(t))throw new Error("prettyFormat: Invalid option: "+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error("prettyFormat: Cannot run with min option and indent")}(e),e=function(t){const e={};return Object.keys(W).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:W[n]),e.min&&(e.indent=0),e}(e)):e=W;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=L(e.indent),r=[];var a=$(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return D(t)||(n||(n=L(e.indent)),r||(r=[]),I(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,T)).indexOf("\n")&&(e=a("\n"+e,l)+"\n")):e="Function",a("\n"+t+"={"+e+"}",l)):"\n"+l+t+'="'+i(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function J(t,e,n,r){return _(t,e,n=f(f({},R),n||{}))}export default J;export{J as render};
1
+ import{Fragment as t,options as e,h as n}from"preact";if("function"!=typeof Symbol){var r=0;Symbol=function(t){return"@@"+t+ ++r},Symbol.for=function(t){return"@@"+t}}var o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,i=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,a=/[\s\n\\/='"\0<>]/,l=/^xlink:?./,c=/["&<]/;function s(t){if(!1===c.test(t+=""))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 60:o="&lt;";break;default:continue}n!==e&&(r+=t.slice(e,n)),r+=o,e=n+1}return n!==e&&(r+=t.slice(e,n)),r}var u=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},f=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},p={},d=/([A-Z])/g;function _(t){var e="";for(var n in t){var r=t[n];null!=r&&""!==r&&(e&&(e+=" "),e+="-"==n[0]?n:p[n]||(p[n]=n.replace(d,"-$1").toLowerCase()),e="number"==typeof r&&!1===o.test(n)?e+": "+r+"px;":e+": "+r+";")}return e||void 0}function y(t,e){return Array.isArray(e)?e.reduce(y,t):null!=e&&!1!==e&&t.push(e),t}function v(){this.__d=!0}function g(t,e){return{__v:t,context:e,props:t.props,setState:v,forceUpdate:v,__d:!0,__h:[]}}function b(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var m=[];function h(n,r,o,c,p,d){if(null==n||"boolean"==typeof n)return"";if("object"!=typeof n)return s(n);var v=o.pretty,j=v&&"string"==typeof v?v:"\t";if(Array.isArray(n)){for(var x="",S=0;S<n.length;S++)v&&S>0&&(x+="\n"),x+=h(n[S],r,o,c,p,d);return x}var k,A=n.type,O=n.props,w=!1;if("function"==typeof A){if(w=!0,!o.shallow||!c&&!1!==o.renderRootComponent){if(A===t){var F=[];return y(F,n.props.children),h(F,r,o,!1!==o.shallowHighOrder,p,d)}var C,E=n.__c=g(n,r);e.__b&&e.__b(n);var M=e.__r;if(A.prototype&&"function"==typeof A.prototype.render){var H=b(A,r);(E=n.__c=new A(O,H)).__v=n,E._dirty=E.__d=!0,E.props=O,null==E.state&&(E.state={}),null==E._nextState&&null==E.__s&&(E._nextState=E.__s=E.state),E.context=H,A.getDerivedStateFromProps?E.state=Object.assign({},E.state,A.getDerivedStateFromProps(E.props,E.state)):E.componentWillMount&&(E.componentWillMount(),E.state=E._nextState!==E.state?E._nextState:E.__s!==E.state?E.__s:E.state),M&&M(n),C=E.render(E.props,E.state,E.context)}else for(var N=b(A,r),D=0;E.__d&&D++<25;)E.__d=!1,M&&M(n),C=A.call(n.__c,O,N);return E.getChildContext&&(r=Object.assign({},r,E.getChildContext())),e.diffed&&e.diffed(n),h(C,r,o,!1!==o.shallowHighOrder,p,d)}A=(k=A).displayName||k!==Function&&k.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=m.length;r--;)if(m[r]===t){n=r;break}n<0&&(n=m.push(t)-1),e="UnnamedComponent"+n}return e}(k)}var I,L,W="<"+A;if(O){var $=Object.keys(O);o&&!0===o.sortAttributes&&$.sort();for(var P=0;P<$.length;P++){var T=$[P],U=O[T];if("children"!==T){if(!a.test(T)&&(o&&o.allAttributes||"key"!==T&&"ref"!==T&&"__self"!==T&&"__source"!==T)){if("defaultValue"===T)T="value";else if("defaultChecked"===T)T="checked";else if("defaultSelected"===T)T="selected";else if("className"===T){if(void 0!==O.class)continue;T="class"}else p&&l.test(T)&&(T=T.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===T){if(O.for)continue;T="for"}"style"===T&&U&&"object"==typeof U&&(U=_(U)),"a"===T[0]&&"r"===T[1]&&"boolean"==typeof U&&(U=String(U));var R=o.attributeHook&&o.attributeHook(T,U,r,o,w);if(R||""===R)W+=R;else if("dangerouslySetInnerHTML"===T)L=U&&U.__html;else if("textarea"===A&&"value"===T)I=U;else if((U||0===U||""===U)&&"function"!=typeof U){if(!(!0!==U&&""!==U||(U=T,o&&o.xml))){W=W+" "+T;continue}if("value"===T){if("select"===A){d=U;continue}"option"===A&&d==U&&void 0===O.selected&&(W+=" selected")}W=W+" "+T+'="'+s(U)+'"'}}}else I=U}}if(v){var J=W.replace(/\n\s*/," ");J===W||~J.indexOf("\n")?v&&~W.indexOf("\n")&&(W+="\n"):W=J}if(W+=">",a.test(A))throw new Error(A+" is not a valid HTML tag name in "+W);var V,q=i.test(A)||o.voidElements&&o.voidElements.test(A),z=[];if(L)v&&f(L)&&(L="\n"+j+u(L,j)),W+=L;else if(null!=I&&y(V=[],I).length){for(var B=v&&~W.indexOf("\n"),G=!1,Z=0;Z<V.length;Z++){var K=V[Z];if(null!=K&&!1!==K){var Q=h(K,r,o,!0,"svg"===A||"foreignObject"!==A&&p,d);if(v&&!B&&f(Q)&&(B=!0),Q)if(v){var X=Q.length>0&&"<"!=Q[0];G&&X?z[z.length-1]+=Q:z.push(Q),G=X}else z.push(Q)}}if(v&&B)for(var Y=z.length;Y--;)z[Y]="\n"+j+u(z[Y],j)}if(z.length||L)W+=z.join("");else if(o&&o.xml)return W.substring(0,W.length-1)+" />";return!q||V||L?(v&&~W.indexOf("\n")&&(W+="\n"),W=W+"</"+A+">"):W=W.replace(/>$/," />"),W}var j={shallow:!0};S.render=S;var x=[];function S(r,o,i){o=o||{};var a=e.__s;e.__s=!0;var l,c=n(t,null);return c.__k=[r],l=i&&(i.pretty||i.voidElements||i.sortAttributes||i.shallow||i.allAttributes||i.xml||i.attributeHook)?h(r,o,i):F(r,o,!1,void 0,c),e.__c&&e.__c(r,x),e.__s=a,x.length=0,l}function k(t,e){return"className"===t?"class":"htmlFor"===t?"for":"defaultValue"===t?"value":"defaultChecked"===t?"checked":"defaultSelected"===t?"selected":e&&l.test(t)?t.toLowerCase().replace(/^xlink:?/,"xlink:"):t}function A(t,e){return"style"===t&&null!=e&&"object"==typeof e?_(e):"a"===t[0]&&"r"===t[1]&&"boolean"==typeof e?String(e):e}var O=Array.isArray,w=Object.assign;function F(n,r,o,l,c){if(null==n||!0===n||!1===n||""===n)return"";if("object"!=typeof n)return s(n);if(O(n)){var u="";c.__k=n;for(var f=0;f<n.length;f++)u+=F(n[f],r,o,l,c);return u}n.__=c,e.__b&&e.__b(n);var p=n.type,d=n.props;if("function"==typeof p){var _;if(p===t)_=d.children;else{_=p.prototype&&"function"==typeof p.prototype.render?function(t,n){var r=t.type,o=b(r,n),i=new r(t.props,o);t.__c=i,i.__v=t,i.__d=!0,i.props=t.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=w({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);var a=e.__r;return a&&a(t),i.render(i.props,i.state,i.context)}(n,r):function(t,n){var r,o=g(t,n),i=b(t.type,n);t.__c=o;for(var a=e.__r,l=0;o.__d&&l++<25;)o.__d=!1,a&&a(t),r=t.type.call(o,t.props,i);return r}(n,r);var y=n.__c;y.getChildContext&&(r=w({},r,y.getChildContext()))}var v=F(_,r,o,l,n);return e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),v}var m,h,j="<";if(j+=p,d)for(var x in m=d.children,d){var S=d[x];if(!("key"===x||"ref"===x||"__self"===x||"__source"===x||"children"===x||"className"===x&&"class"in d||"htmlFor"===x&&"for"in d||a.test(x)))if(S=A(x=k(x,o),S),"dangerouslySetInnerHTML"===x)h=S&&S.__html;else if("textarea"===p&&"value"===x)m=S;else if((S||0===S||""===S)&&"function"!=typeof S){if(!0===S||""===S){S=x,j=j+" "+x;continue}if("value"===x){if("select"===p){l=S;continue}"option"!==p||l!=S||"selected"in d||(j+=" selected")}j=j+" "+x+'="'+s(S)+'"'}}var C=j;if(j+=">",a.test(p))throw new Error(p+" is not a valid HTML tag name in "+j);var E="",M=!1;if(h)E+=h,M=!0;else if("string"==typeof m)E+=s(m),M=!0;else if(O(m)){n.__k=m;for(var H=0;H<m.length;H++){var N=m[H];if(null!=N&&!1!==N){var D=F(N,r,"svg"===p||"foreignObject"!==p&&o,l,n);D&&(E+=D,M=!0)}}}else if(null!=m&&!1!==m&&!0!==m){n.__k=[m];var I=F(m,r,"svg"===p||"foreignObject"!==p&&o,l,n);I&&(E+=I,M=!0)}if(e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),M)j+=E;else if(i.test(p))return C+" />";return j+"</"+p+">"}S.shallowRender=function(t,e){return S(t,e,j)};const C=/(\\|\"|\')/g,E=Object.prototype.toString,M=Date.prototype.toISOString,H=Error.prototype.toString,N=RegExp.prototype.toString,D=Symbol.prototype.toString,I=/^Symbol\((.*)\)(.*)$/,L=/\n/gi,W=Object.getOwnPropertySymbols||(t=>[]);function $(t){return"[object Array]"===t||"[object ArrayBuffer]"===t||"[object DataView]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object Int8Array]"===t||"[object Int16Array]"===t||"[object Int32Array]"===t||"[object Uint8Array]"===t||"[object Uint8ClampedArray]"===t||"[object Uint16Array]"===t||"[object Uint32Array]"===t}function P(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function T(t){return D.call(t).replace(I,"Symbol($1)")}function U(t){return"["+H.call(t)+"]"}function R(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";const e=typeof t;if("number"===e)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===e)return'"'+function(t){return t.replace(C,"\\$1")}(t)+'"';if("function"===e)return P(t);if("symbol"===e)return T(t);const n=E.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?P(t,min):"[object Symbol]"===n?T(t):"[object Date]"===n?M.call(t):"[object Error]"===n?U(t):"[object RegExp]"===n?N.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":$(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&U(t)}function J(t,e,n,r,o,i,a,l,c,s){let u="";if(t.length){u+=o;const f=n+e;for(let n=0;n<t.length;n++)u+=f+z(t[n],e,f,r,o,i,a,l,c,s),n<t.length-1&&(u+=","+r);u+=o+n}return"["+u+"]"}function V(t,e,n,r,o,i,a,l,c,s){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const u=++l>a;if(!u&&t.toJSON&&"function"==typeof t.toJSON)return z(t.toJSON(),e,n,r,o,i,a,l,c,s);const f=E.call(t);return"[object Arguments]"===f?u?"[Arguments]":function(t,e,n,r,o,i,a,l,c,s){return(s?"":"Arguments ")+J(t,e,n,r,o,i,a,l,c,s)}(t,e,n,r,o,i,a,l,c,s):$(f)?u?"[Array]":function(t,e,n,r,o,i,a,l,c,s){return(s?"":t.constructor.name+" ")+J(t,e,n,r,o,i,a,l,c,s)}(t,e,n,r,o,i,a,l,c,s):"[object Map]"===f?u?"[Map]":function(t,e,n,r,o,i,a,l,c,s){let u="Map {";const f=t.entries();let p=f.next();if(!p.done){u+=o;const t=n+e;for(;!p.done;)u+=t+z(p.value[0],e,t,r,o,i,a,l,c,s)+" => "+z(p.value[1],e,t,r,o,i,a,l,c,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}(t,e,n,r,o,i,a,l,c,s):"[object Set]"===f?u?"[Set]":function(t,e,n,r,o,i,a,l,c,s){let u="Set {";const f=t.entries();let p=f.next();if(!p.done){u+=o;const t=n+e;for(;!p.done;)u+=t+z(p.value[1],e,t,r,o,i,a,l,c,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}(t,e,n,r,o,i,a,l,c,s):"object"==typeof t?u?"[Object]":function(t,e,n,r,o,i,a,l,c,s){let u=(s?"":t.constructor?t.constructor.name+" ":"Object ")+"{",f=Object.keys(t).sort();const p=W(t);if(p.length&&(f=f.filter(t=>!("symbol"==typeof t||"[object Symbol]"===E.call(t))).concat(p)),f.length){u+=o;const p=n+e;for(let n=0;n<f.length;n++){const d=f[n];u+=p+z(d,e,p,r,o,i,a,l,c,s)+": "+z(t[d],e,p,r,o,i,a,l,c,s),n<f.length-1&&(u+=","+r)}u+=o+n}return u+"}"}(t,e,n,r,o,i,a,l,c,s):void 0}function q(t,e,n,r,o,i,a,l,c,s){let u,f=!1;for(let e=0;e<c.length;e++)if(u=c[e],u.test(t)){f=!0;break}return!!f&&u.print(t,function(t){return z(t,e,n,r,o,i,a,l,c,s)},function(t){const r=n+e;return r+t.replace(L,"\n"+r)},{edgeSpacing:o,spacing:r})}function z(t,e,n,r,o,i,a,l,c,s){return R(t)||q(t,e,n,r,o,i,a,l,c,s)||V(t,e,n,r,o,i,a,l,c,s)}const B={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function G(t){return new Array(t+1).join(" ")}var Z={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t,e,n){return S(t,Z.context,Z.opts)}},K={plugins:[Z]},Q={attributeHook:function(t,e,n,r,o){var i=typeof e;if("dangerouslySetInnerHTML"===t)return!1;if(null==e||"function"===i&&!r.functions)return"";if(r.skipFalseAttributes&&!o&&(!1===e||("class"===t||"style"===t)&&""===e))return"";var a="string"==typeof r.pretty?r.pretty:"\t";return"string"!==i?("function"!==i||r.functionNames?(Z.context=n,Z.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!B.hasOwnProperty(t))throw new Error("prettyFormat: Invalid option: "+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error("prettyFormat: Cannot run with min option and indent")}(e),e=function(t){const e={};return Object.keys(B).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:B[n]),e.min&&(e.indent=0),e}(e)):e=B;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=G(e.indent),r=[];var a=q(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return R(t)||(n||(n=G(e.indent)),r||(r=[]),V(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,K)).indexOf("\n")&&(e=u("\n"+e,a)+"\n")):e="Function",u("\n"+t+"={"+e+"}",a)):"\n"+a+t+'="'+s(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function X(t,e,n,r){return S(t,e,n=Object.assign({},Q,n||{}))}export default X;export{X as render};
2
2
  //# sourceMappingURL=jsx.module.js.map
@@ -1,2 +1,2 @@
1
- import{options as t,Fragment as e}from"preact";if("function"!=typeof Symbol){let t=0;Symbol=function(e){return`@@${e}${++t}`},Symbol.for=t=>`@@${t}`}const n=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,r=/[&<>"]/;function o(t){const e=String(t);return r.test(e)?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):e}let i=(t,e)=>String(t).replace(/(\n+)/g,"$1"+(e||"\t")),l=(t,e,n)=>String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<");const c={};function u(t){let e="";for(let r in t){let o=t[r];null!=o&&""!==o&&(e&&(e+=" "),e+="-"==r[0]?r:c[r]||(c[r]=r.replace(/([A-Z])/g,"-$1").toLowerCase()),e+=": ",e+=o,"number"==typeof o&&!1===n.test(r)&&(e+="px"),e+=";")}return e||void 0}function s(t,e){for(let n in e)t[n]=e[n];return t}function f(t,e){return Array.isArray(e)?e.reduce(f,t):null!=e&&!1!==e&&t.push(e),t}const a={shallow:!0},p=[],y=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,d=/[\s\n\\/='"\0<>]/;function g(){this.__d=!0}m.render=m;const b=[];function m(e,n,r){n=n||{},r=r||{};const o=t.__s;t.__s=!0;const i=_(e,n,r);return t.__c&&t.__c(e,b),b.length=0,t.__s=o,i}function _(n,r,c,a,b,m){if(null==n||"boolean"==typeof n)return"";if("object"!=typeof n)return o(n);let h=c.pretty,x=h&&"string"==typeof h?h:"\t";if(Array.isArray(n)){let t="";for(let e=0;e<n.length;e++)h&&e>0&&(t+="\n"),t+=_(n[e],r,c,a,b,m);return t}let j=n.type,S=n.props,A=!1;if("function"==typeof j){if(A=!0,!c.shallow||!a&&!1!==c.renderRootComponent){if(j===e){const t=[];return f(t,n.props.children),_(t,r,c,!1!==c.shallowHighOrder,b,m)}{let e,o=n.__c={__v:n,context:r,props:n.props,setState:g,forceUpdate:g,__d:!0,__h:[]};t.__b&&t.__b(n);let i=t.__r;if(j.prototype&&"function"==typeof j.prototype.render){let t=j.contextType,l=t&&r[t.__c],c=null!=t?l?l.props.value:t.__:r;o=n.__c=new j(S,c),o.__v=n,o._dirty=o.__d=!0,o.props=S,null==o.state&&(o.state={}),null==o._nextState&&null==o.__s&&(o._nextState=o.__s=o.state),o.context=c,j.getDerivedStateFromProps?o.state=s(s({},o.state),j.getDerivedStateFromProps(o.props,o.state)):o.componentWillMount&&(o.componentWillMount(),o.state=o._nextState!==o.state?o._nextState:o.__s!==o.state?o.__s:o.state),i&&i(n),e=o.render(o.props,o.state,o.context)}else{let t=j.contextType,l=t&&r[t.__c],c=null!=t?l?l.props.value:t.__:r,u=0;for(;o.__d&&u++<25;)o.__d=!1,i&&i(n),e=j.call(n.__c,S,c)}return o.getChildContext&&(r=s(s({},r),o.getChildContext())),t.diffed&&t.diffed(n),_(e,r,c,!1!==c.shallowHighOrder,b,m)}}j=(O=j).displayName||O!==Function&&O.name||function(t){let e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){let n=-1;for(let e=p.length;e--;)if(p[e]===t){n=e;break}n<0&&(n=p.push(t)-1),e=`UnnamedComponent${n}`}return e}(O)}var O;let v,k,w="<"+j;if(S){let t=Object.keys(S);c&&!0===c.sortAttributes&&t.sort();for(let e=0;e<t.length;e++){let n=t[e],i=S[n];if("children"===n){v=i;continue}if(d.test(n))continue;if(!(c&&c.allAttributes||"key"!==n&&"ref"!==n&&"__self"!==n&&"__source"!==n))continue;if("defaultValue"===n)n="value";else if("defaultChecked"===n)n="checked";else if("defaultSelected"===n)n="selected";else if("className"===n){if(void 0!==S.class)continue;n="class"}else b&&/^xlink:?./.test(n)&&(n=n.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===n){if(S.for)continue;n="for"}"style"===n&&i&&"object"==typeof i&&(i=u(i)),"a"===n[0]&&"r"===n[1]&&"boolean"==typeof i&&(i=String(i));let l=c.attributeHook&&c.attributeHook(n,i,r,c,A);if(l||""===l)w+=l;else if("dangerouslySetInnerHTML"===n)k=i&&i.__html;else if("textarea"===j&&"value"===n)v=i;else if((i||0===i||""===i)&&"function"!=typeof i){if(!(!0!==i&&""!==i||(i=n,c&&c.xml))){w=w+" "+n;continue}if("value"===n){if("select"===j){m=i;continue}"option"===j&&m==i&&void 0===S.selected&&(w+=" selected")}w+=` ${n}="${o(i)}"`}}}if(h){let t=w.replace(/\n\s*/," ");t===w||~t.indexOf("\n")?h&&~w.indexOf("\n")&&(w+="\n"):w=t}if(w+=">",d.test(j))throw new Error(`${j} is not a valid HTML tag name in ${w}`);let $,F=y.test(j)||c.voidElements&&c.voidElements.test(j),C=[];if(k)h&&l(k)&&(k="\n"+x+i(k,x)),w+=k;else if(null!=v&&f($=[],v).length){let t=h&&~w.indexOf("\n"),e=!1;for(let n=0;n<$.length;n++){let o=$[n];if(null!=o&&!1!==o){let n=_(o,r,c,!0,"svg"===j||"foreignObject"!==j&&b,m);if(h&&!t&&l(n)&&(t=!0),n)if(h){let t=n.length>0&&"<"!=n[0];e&&t?C[C.length-1]+=n:C.push(n),e=t}else C.push(n)}}if(h&&t)for(let t=C.length;t--;)C[t]="\n"+x+i(C[t],x)}if(C.length||k)w+=C.join("");else if(c&&c.xml)return w.substring(0,w.length-1)+" />";return!F||$||k?(h&&~w.indexOf("\n")&&(w+="\n"),w+=`</${j}>`):w=w.replace(/>$/," />"),w}m.shallowRender=(t,e)=>m(t,e,a);const h=/(\\|\"|\')/g,x=Object.prototype.toString,j=Date.prototype.toISOString,S=Error.prototype.toString,A=RegExp.prototype.toString,O=Symbol.prototype.toString,v=/^Symbol\((.*)\)(.*)$/,k=/\n/gi,w=Object.getOwnPropertySymbols||(t=>[]);function $(t){return"[object Array]"===t||"[object ArrayBuffer]"===t||"[object DataView]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object Int8Array]"===t||"[object Int16Array]"===t||"[object Int32Array]"===t||"[object Uint8Array]"===t||"[object Uint8ClampedArray]"===t||"[object Uint16Array]"===t||"[object Uint32Array]"===t}function F(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function C(t){return O.call(t).replace(v,"Symbol($1)")}function E(t){return"["+S.call(t)+"]"}function M(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";const e=typeof t;if("number"===e)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===e)return'"'+function(t){return t.replace(h,"\\$1")}(t)+'"';if("function"===e)return F(t);if("symbol"===e)return C(t);const n=x.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?F(t,min):"[object Symbol]"===n?C(t):"[object Date]"===n?j.call(t):"[object Error]"===n?E(t):"[object RegExp]"===n?A.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":$(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&E(t)}function N(t,e,n,r,o,i,l,c,u,s){let f="";if(t.length){f+=o;const a=n+e;for(let n=0;n<t.length;n++)f+=a+I(t[n],e,a,r,o,i,l,c,u,s),n<t.length-1&&(f+=","+r);f+=o+n}return"["+f+"]"}function D(t,e,n,r,o,i,l,c,u,s){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const f=++c>l;if(!f&&t.toJSON&&"function"==typeof t.toJSON)return I(t.toJSON(),e,n,r,o,i,l,c,u,s);const a=x.call(t);return"[object Arguments]"===a?f?"[Arguments]":function(t,e,n,r,o,i,l,c,u,s){return(s?"":"Arguments ")+N(t,e,n,r,o,i,l,c,u,s)}(t,e,n,r,o,i,l,c,u,s):$(a)?f?"[Array]":function(t,e,n,r,o,i,l,c,u,s){return(s?"":t.constructor.name+" ")+N(t,e,n,r,o,i,l,c,u,s)}(t,e,n,r,o,i,l,c,u,s):"[object Map]"===a?f?"[Map]":function(t,e,n,r,o,i,l,c,u,s){let f="Map {";const a=t.entries();let p=a.next();if(!p.done){f+=o;const t=n+e;for(;!p.done;)f+=t+I(p.value[0],e,t,r,o,i,l,c,u,s)+" => "+I(p.value[1],e,t,r,o,i,l,c,u,s),p=a.next(),p.done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,l,c,u,s):"[object Set]"===a?f?"[Set]":function(t,e,n,r,o,i,l,c,u,s){let f="Set {";const a=t.entries();let p=a.next();if(!p.done){f+=o;const t=n+e;for(;!p.done;)f+=t+I(p.value[1],e,t,r,o,i,l,c,u,s),p=a.next(),p.done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,l,c,u,s):"object"==typeof t?f?"[Object]":function(t,e,n,r,o,i,l,c,u,s){let f=(s?"":t.constructor?t.constructor.name+" ":"Object ")+"{",a=Object.keys(t).sort();const p=w(t);if(p.length&&(a=a.filter(t=>!("symbol"==typeof t||"[object Symbol]"===x.call(t))).concat(p)),a.length){f+=o;const p=n+e;for(let n=0;n<a.length;n++){const y=a[n];f+=p+I(y,e,p,r,o,i,l,c,u,s)+": "+I(t[y],e,p,r,o,i,l,c,u,s),n<a.length-1&&(f+=","+r)}f+=o+n}return f+"}"}(t,e,n,r,o,i,l,c,u,s):void 0}function H(t,e,n,r,o,i,l,c,u,s){let f,a=!1;for(let e=0;e<u.length;e++)if(f=u[e],f.test(t)){a=!0;break}return!!a&&f.print(t,function(t){return I(t,e,n,r,o,i,l,c,u,s)},function(t){const r=n+e;return r+t.replace(k,"\n"+r)},{edgeSpacing:o,spacing:r})}function I(t,e,n,r,o,i,l,c,u,s){return M(t)||H(t,e,n,r,o,i,l,c,u,s)||D(t,e,n,r,o,i,l,c,u,s)}const U={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function W(t){return new Array(t+1).join(" ")}let L={test:t=>t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t,print:(t,e,n)=>m(t,L.context,L.opts)},P={plugins:[L]},T={attributeHook:function(t,e,n,r,l){let c=typeof e;if("dangerouslySetInnerHTML"===t)return!1;if(null==e||"function"===c&&!r.functions)return"";if(r.skipFalseAttributes&&!l&&(!1===e||("class"===t||"style"===t)&&""===e))return"";let u="string"==typeof r.pretty?r.pretty:"\t";return"string"!==c?("function"!==c||r.functionNames?(L.context=n,L.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!U.hasOwnProperty(t))throw new Error("prettyFormat: Invalid option: "+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error("prettyFormat: Cannot run with min option and indent")}(e),e=function(t){const e={};return Object.keys(U).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:U[n]),e.min&&(e.indent=0),e}(e)):e=U;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=W(e.indent),r=[];var l=H(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(l)return l}return M(t)||(n||(n=W(e.indent)),r||(r=[]),D(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,P)).indexOf("\n")&&(e=`${i("\n"+e,u)}\n`)):e="Function",i(`\n${t}={${e}}`,u)):`\n${u}${t}="${o(e)}"`},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function R(t,e,n,r){return m(t,e,n=s(s({},T),n||{}))}export default R;export{R as render};
1
+ import{Fragment as t,options as e,h as n}from"preact";if("function"!=typeof Symbol){let t=0;Symbol=function(e){return`@@${e}${++t}`},Symbol.for=t=>`@@${t}`}const r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,o=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,i=/[\s\n\\/='"\0<>]/,l=/^xlink:?./,s=/["&<]/;function c(t){if(!1===s.test(t+=""))return t;let e=0,n=0,r="",o="";for(;n<t.length;n++){switch(t.charCodeAt(n)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 60:o="&lt;";break;default:continue}n!==e&&(r+=t.slice(e,n)),r+=o,e=n+1}return n!==e&&(r+=t.slice(e,n)),r}let u=(t,e)=>String(t).replace(/(\n+)/g,"$1"+(e||"\t")),f=(t,e,n)=>String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<");const a={},p=/([A-Z])/g;function d(t){let e="";for(let n in t){let o=t[n];null!=o&&""!==o&&(e&&(e+=" "),e+="-"==n[0]?n:a[n]||(a[n]=n.replace(p,"-$1").toLowerCase()),e="number"==typeof o&&!1===r.test(n)?e+": "+o+"px;":e+": "+o+";")}return e||void 0}function _(t,e){return Array.isArray(e)?e.reduce(_,t):null!=e&&!1!==e&&t.push(e),t}function y(){this.__d=!0}function g(t,e){return{__v:t,context:e,props:t.props,setState:y,forceUpdate:y,__d:!0,__h:[]}}function b(t,e){let n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}const m=[];function h(n,r,s,a,p,y){if(null==n||"boolean"==typeof n)return"";if("object"!=typeof n)return c(n);let j=s.pretty,x=j&&"string"==typeof j?j:"\t";if(Array.isArray(n)){let t="";for(let e=0;e<n.length;e++)j&&e>0&&(t+="\n"),t+=h(n[e],r,s,a,p,y);return t}let S=n.type,k=n.props,v=!1;if("function"==typeof S){if(v=!0,!s.shallow||!a&&!1!==s.renderRootComponent){if(S===t){const t=[];return _(t,n.props.children),h(t,r,s,!1!==s.shallowHighOrder,p,y)}{let t,o=n.__c=g(n,r);e.__b&&e.__b(n);let i=e.__r;if(S.prototype&&"function"==typeof S.prototype.render){let e=b(S,r);o=n.__c=new S(k,e),o.__v=n,o._dirty=o.__d=!0,o.props=k,null==o.state&&(o.state={}),null==o._nextState&&null==o.__s&&(o._nextState=o.__s=o.state),o.context=e,S.getDerivedStateFromProps?o.state=Object.assign({},o.state,S.getDerivedStateFromProps(o.props,o.state)):o.componentWillMount&&(o.componentWillMount(),o.state=o._nextState!==o.state?o._nextState:o.__s!==o.state?o.__s:o.state),i&&i(n),t=o.render(o.props,o.state,o.context)}else{let e=b(S,r),l=0;for(;o.__d&&l++<25;)o.__d=!1,i&&i(n),t=S.call(n.__c,k,e)}return o.getChildContext&&(r=Object.assign({},r,o.getChildContext())),e.diffed&&e.diffed(n),h(t,r,s,!1!==s.shallowHighOrder,p,y)}}S=(A=S).displayName||A!==Function&&A.name||function(t){let e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){let n=-1;for(let e=m.length;e--;)if(m[e]===t){n=e;break}n<0&&(n=m.push(t)-1),e=`UnnamedComponent${n}`}return e}(A)}var A;let O,w,$="<"+S;if(k){let t=Object.keys(k);s&&!0===s.sortAttributes&&t.sort();for(let e=0;e<t.length;e++){let n=t[e],o=k[n];if("children"===n){O=o;continue}if(i.test(n))continue;if(!(s&&s.allAttributes||"key"!==n&&"ref"!==n&&"__self"!==n&&"__source"!==n))continue;if("defaultValue"===n)n="value";else if("defaultChecked"===n)n="checked";else if("defaultSelected"===n)n="selected";else if("className"===n){if(void 0!==k.class)continue;n="class"}else p&&l.test(n)&&(n=n.toLowerCase().replace(/^xlink:?/,"xlink:"));if("htmlFor"===n){if(k.for)continue;n="for"}"style"===n&&o&&"object"==typeof o&&(o=d(o)),"a"===n[0]&&"r"===n[1]&&"boolean"==typeof o&&(o=String(o));let u=s.attributeHook&&s.attributeHook(n,o,r,s,v);if(u||""===u)$+=u;else if("dangerouslySetInnerHTML"===n)w=o&&o.__html;else if("textarea"===S&&"value"===n)O=o;else if((o||0===o||""===o)&&"function"!=typeof o){if(!(!0!==o&&""!==o||(o=n,s&&s.xml))){$=$+" "+n;continue}if("value"===n){if("select"===S){y=o;continue}"option"===S&&y==o&&void 0===k.selected&&($+=" selected")}$+=` ${n}="${c(o)}"`}}}if(j){let t=$.replace(/\n\s*/," ");t===$||~t.indexOf("\n")?j&&~$.indexOf("\n")&&($+="\n"):$=t}if($+=">",i.test(S))throw new Error(`${S} is not a valid HTML tag name in ${$}`);let F,C=o.test(S)||s.voidElements&&s.voidElements.test(S),E=[];if(w)j&&f(w)&&(w="\n"+x+u(w,x)),$+=w;else if(null!=O&&_(F=[],O).length){let t=j&&~$.indexOf("\n"),e=!1;for(let n=0;n<F.length;n++){let o=F[n];if(null!=o&&!1!==o){let n=h(o,r,s,!0,"svg"===S||"foreignObject"!==S&&p,y);if(j&&!t&&f(n)&&(t=!0),n)if(j){let t=n.length>0&&"<"!=n[0];e&&t?E[E.length-1]+=n:E.push(n),e=t}else E.push(n)}}if(j&&t)for(let t=E.length;t--;)E[t]="\n"+x+u(E[t],x)}if(E.length||w)$+=E.join("");else if(s&&s.xml)return $.substring(0,$.length-1)+" />";return!C||F||w?(j&&~$.indexOf("\n")&&($+="\n"),$+=`</${S}>`):$=$.replace(/>$/," />"),$}const j={shallow:!0};S.render=S;const x=[];function S(r,o,i){o=o||{};const l=e.__s;e.__s=!0;const s=n(t,null);let c;return s.__k=[r],c=i&&(i.pretty||i.voidElements||i.sortAttributes||i.shallow||i.allAttributes||i.xml||i.attributeHook)?h(r,o,i):w(r,o,!1,void 0,s),e.__c&&e.__c(r,x),e.__s=l,x.length=0,c}function k(t,e){return"className"===t?"class":"htmlFor"===t?"for":"defaultValue"===t?"value":"defaultChecked"===t?"checked":"defaultSelected"===t?"selected":e&&l.test(t)?t.toLowerCase().replace(/^xlink:?/,"xlink:"):t}function v(t,e){return"style"===t&&null!=e&&"object"==typeof e?d(e):"a"===t[0]&&"r"===t[1]&&"boolean"==typeof e?String(e):e}const A=Array.isArray,O=Object.assign;function w(n,r,l,s,u){if(null==n||!0===n||!1===n||""===n)return"";if("object"!=typeof n)return c(n);if(A(n)){let t="";u.__k=n;for(let e=0;e<n.length;e++)t+=w(n[e],r,l,s,u);return t}n.__=u,e.__b&&e.__b(n);let f=n.type,a=n.props;if("function"==typeof f){let o;if(f===t)o=a.children;else{o=f.prototype&&"function"==typeof f.prototype.render?function(t,n){let r=t.type,o=b(r,n),i=new r(t.props,o);t.__c=i,i.__v=t,i.__d=!0,i.props=t.props,null==i.state&&(i.state={}),null==i.__s&&(i.__s=i.state),i.context=o,r.getDerivedStateFromProps?i.state=O({},i.state,r.getDerivedStateFromProps(i.props,i.state)):i.componentWillMount&&(i.componentWillMount(),i.state=i.__s!==i.state?i.__s:i.state);let l=e.__r;return l&&l(t),i.render(i.props,i.state,i.context)}(n,r):function(t,n){let r,o=g(t,n),i=b(t.type,n);t.__c=o;let l=e.__r,s=0;for(;o.__d&&s++<25;)o.__d=!1,l&&l(t),r=t.type.call(o,t.props,i);return r}(n,r);let t=n.__c;t.getChildContext&&(r=O({},r,t.getChildContext()))}const i=w(o,r,l,s,n);return e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),i}let p,d,_="<";if(_+=f,a){p=a.children;for(let t in a){let e=a[t];if(!("key"===t||"ref"===t||"__self"===t||"__source"===t||"children"===t||"className"===t&&"class"in a||"htmlFor"===t&&"for"in a||i.test(t)))if(t=k(t,l),e=v(t,e),"dangerouslySetInnerHTML"===t)d=e&&e.__html;else if("textarea"===f&&"value"===t)p=e;else if((e||0===e||""===e)&&"function"!=typeof e){if(!0===e||""===e){e=t,_=_+" "+t;continue}if("value"===t){if("select"===f){s=e;continue}"option"!==f||s!=e||"selected"in a||(_+=" selected")}_=_+" "+t+'="'+c(e)+'"'}}}let y=_;if(_+=">",i.test(f))throw new Error(`${f} is not a valid HTML tag name in ${_}`);let m="",h=!1;if(d)m+=d,h=!0;else if("string"==typeof p)m+=c(p),h=!0;else if(A(p)){n.__k=p;for(let t=0;t<p.length;t++){let e=p[t];if(null!=e&&!1!==e){let t=w(e,r,"svg"===f||"foreignObject"!==f&&l,s,n);t&&(m+=t,h=!0)}}}else if(null!=p&&!1!==p&&!0!==p){n.__k=[p];let t=w(p,r,"svg"===f||"foreignObject"!==f&&l,s,n);t&&(m+=t,h=!0)}if(e.diffed&&e.diffed(n),n.__=void 0,e.unmount&&e.unmount(n),h)_+=m;else if(o.test(f))return y+" />";return _+"</"+f+">"}S.shallowRender=(t,e)=>S(t,e,j);const $=/(\\|\"|\')/g,F=Object.prototype.toString,C=Date.prototype.toISOString,E=Error.prototype.toString,M=RegExp.prototype.toString,H=Symbol.prototype.toString,N=/^Symbol\((.*)\)(.*)$/,D=/\n/gi,I=Object.getOwnPropertySymbols||(t=>[]);function L(t){return"[object Array]"===t||"[object ArrayBuffer]"===t||"[object DataView]"===t||"[object Float32Array]"===t||"[object Float64Array]"===t||"[object Int8Array]"===t||"[object Int16Array]"===t||"[object Int32Array]"===t||"[object Uint8Array]"===t||"[object Uint8ClampedArray]"===t||"[object Uint16Array]"===t||"[object Uint32Array]"===t}function W(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function P(t){return H.call(t).replace(N,"Symbol($1)")}function T(t){return"["+E.call(t)+"]"}function U(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";const e=typeof t;if("number"===e)return function(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}(t);if("string"===e)return'"'+function(t){return t.replace($,"\\$1")}(t)+'"';if("function"===e)return W(t);if("symbol"===e)return P(t);const n=F.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?W(t,min):"[object Symbol]"===n?P(t):"[object Date]"===n?C.call(t):"[object Error]"===n?T(t):"[object RegExp]"===n?M.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":L(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&T(t)}function R(t,e,n,r,o,i,l,s,c,u){let f="";if(t.length){f+=o;const a=n+e;for(let n=0;n<t.length;n++)f+=a+q(t[n],e,a,r,o,i,l,s,c,u),n<t.length-1&&(f+=","+r);f+=o+n}return"["+f+"]"}function J(t,e,n,r,o,i,l,s,c,u){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const f=++s>l;if(!f&&t.toJSON&&"function"==typeof t.toJSON)return q(t.toJSON(),e,n,r,o,i,l,s,c,u);const a=F.call(t);return"[object Arguments]"===a?f?"[Arguments]":function(t,e,n,r,o,i,l,s,c,u){return(u?"":"Arguments ")+R(t,e,n,r,o,i,l,s,c,u)}(t,e,n,r,o,i,l,s,c,u):L(a)?f?"[Array]":function(t,e,n,r,o,i,l,s,c,u){return(u?"":t.constructor.name+" ")+R(t,e,n,r,o,i,l,s,c,u)}(t,e,n,r,o,i,l,s,c,u):"[object Map]"===a?f?"[Map]":function(t,e,n,r,o,i,l,s,c,u){let f="Map {";const a=t.entries();let p=a.next();if(!p.done){f+=o;const t=n+e;for(;!p.done;)f+=t+q(p.value[0],e,t,r,o,i,l,s,c,u)+" => "+q(p.value[1],e,t,r,o,i,l,s,c,u),p=a.next(),p.done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,l,s,c,u):"[object Set]"===a?f?"[Set]":function(t,e,n,r,o,i,l,s,c,u){let f="Set {";const a=t.entries();let p=a.next();if(!p.done){f+=o;const t=n+e;for(;!p.done;)f+=t+q(p.value[1],e,t,r,o,i,l,s,c,u),p=a.next(),p.done||(f+=","+r);f+=o+n}return f+"}"}(t,e,n,r,o,i,l,s,c,u):"object"==typeof t?f?"[Object]":function(t,e,n,r,o,i,l,s,c,u){let f=(u?"":t.constructor?t.constructor.name+" ":"Object ")+"{",a=Object.keys(t).sort();const p=I(t);if(p.length&&(a=a.filter(t=>!("symbol"==typeof t||"[object Symbol]"===F.call(t))).concat(p)),a.length){f+=o;const p=n+e;for(let n=0;n<a.length;n++){const d=a[n];f+=p+q(d,e,p,r,o,i,l,s,c,u)+": "+q(t[d],e,p,r,o,i,l,s,c,u),n<a.length-1&&(f+=","+r)}f+=o+n}return f+"}"}(t,e,n,r,o,i,l,s,c,u):void 0}function V(t,e,n,r,o,i,l,s,c,u){let f,a=!1;for(let e=0;e<c.length;e++)if(f=c[e],f.test(t)){a=!0;break}return!!a&&f.print(t,function(t){return q(t,e,n,r,o,i,l,s,c,u)},function(t){const r=n+e;return r+t.replace(D,"\n"+r)},{edgeSpacing:o,spacing:r})}function q(t,e,n,r,o,i,l,s,c,u){return U(t)||V(t,e,n,r,o,i,l,s,c,u)||J(t,e,n,r,o,i,l,s,c,u)}const z={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function B(t){return new Array(t+1).join(" ")}let G={test:t=>t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t,print:(t,e,n)=>S(t,G.context,G.opts)},Z={plugins:[G]},K={attributeHook:function(t,e,n,r,o){let i=typeof e;if("dangerouslySetInnerHTML"===t)return!1;if(null==e||"function"===i&&!r.functions)return"";if(r.skipFalseAttributes&&!o&&(!1===e||("class"===t||"style"===t)&&""===e))return"";let l="string"==typeof r.pretty?r.pretty:"\t";return"string"!==i?("function"!==i||r.functionNames?(G.context=n,G.opts=r,~(e=function(t,e){let n,r;e?(function(t){if(Object.keys(t).forEach(t=>{if(!z.hasOwnProperty(t))throw new Error("prettyFormat: Invalid option: "+t)}),t.min&&void 0!==t.indent&&0!==t.indent)throw new Error("prettyFormat: Cannot run with min option and indent")}(e),e=function(t){const e={};return Object.keys(z).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:z[n]),e.min&&(e.indent=0),e}(e)):e=z;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=B(e.indent),r=[];var l=V(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(l)return l}return U(t)||(n||(n=B(e.indent)),r||(r=[]),J(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))}(e,Z)).indexOf("\n")&&(e=`${u("\n"+e,l)}\n`)):e="Function",u(`\n${t}={${e}}`,l)):`\n${l}${t}="${c(e)}"`},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function Q(t,e,n,r){return S(t,e,n=Object.assign({},K,n||{}))}export default Q;export{Q as render};
2
2
  //# sourceMappingURL=jsx.modern.js.map