site/node_modules/preact-render-to-string/dist/jsx-entry.js

3 lines
11 KiB
JavaScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
var t=require("preact");if("function"!=typeof Symbol){var e=0;Symbol=function(t){return"@@"+t+ ++e},Symbol.for=function(t){return"@@"+t}}var n=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,r=/[\s\n\\/='"\0<>]/,o=/^(xlink|xmlns|xml)([A-Z])/,i=/^accessK|^auto[A-Z]|^ch|^col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|readO|rowS|spellC|src[A-Z]|tabI|item[A-Z]/,a=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,c=/["&<]/;function l(t){if(0===t.length||!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 s=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=new Set(["animation-iteration-count","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","fill-opacity","flex","flex-grow","flex-negative","flex-order","flex-positive","flex-shrink","flood-opacity","font-weight","grid-column","grid-row","line-clamp","line-height","opacity","order","orphans","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","widows","z-index","zoom"]),d=/[A-Z]/g;function g(t){var e="";for(var n in t){var r=t[n];if(null!=r&&""!==r){var o="-"==n[0]?n:f[n]||(f[n]=n.replace(d,"-$&").toLowerCase()),i=";";"number"!=typeof r||o.startsWith("--")||p.has(o)||(i="px;"),e=e+o+":"+r+i}}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 b(){this.__d=!0}function v(t,e){return{__v:t,context:e,props:t.props,setState:b,forceUpdate:b,__d:!0,__h:[]}}var m=[],h=[];function _(e,n,r,o){var i=t.options.__s;t.options.__s=!0;try{return x(e,n||{},r,o)}finally{t.options.__c&&t.options.__c(e,h),t.options.__s=i,h.length=0}}function x(e,c,f,p,d,b){if(null==e||"boolean"==typeof e)return"";if("object"!=typeof e)return"function"==typeof e?"":l(e+"");var m=f.pretty,h=m&&"string"==typeof m?m:"\t";if(Array.isArray(e)){for(var _="",S=0;S<e.length;S++)m&&S>0&&(_+="\n"),_+=x(e[S],c,f,p,d,b);return _}if(void 0!==e.constructor)return"";t.options.__b&&t.options.__b(e);var k,w=e.type,A=e.props,O=!1;if("function"==typeof w){if(O=!0,!f.shallow||!p&&!1!==f.renderRootComponent){if(w===t.Fragment){var C=[];return y(C,e.props.children),x(C,c,f,!1!==f.shallowHighOrder,d,b)}var F,E=e.__c=v(e,c),$=t.options.__r,H=c,L=w.contextType;if(null!=L){var M=c[L.__c];H=M?M.props.value:L.__}if(w.prototype&&"function"==typeof w.prototype.render)(E=e.__c=new w(A,H)).__v=e,E._dirty=E.__d=!0,E.props=A,null==E.state&&(E.state={}),null==E._nextState&&null==E.__s&&(E._nextState=E.__s=E.state),E.context=H,w.getDerivedStateFromProps?E.state=Object.assign({},E.state,w.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),$&&$(e),F=E.render(E.props,E.state,E.context);else for(var I=0;E.__d&&I++<25;)E.__d=!1,$&&$(e),F=w.call(e.__c,A,H);E.getChildContext&&(c=Object.assign({},c,E.getChildContext()));var N=x(F,c,f,!1!==f.shallowHighOrder,d,b);return t.options.diffed&&t.options.diffed(e),N}w=(k=w).displayName||k!==Function&&k.name||j(k)}var D,W,U="<"+w;if(A){var Z=Object.keys(A);f&&!0===f.sortAttributes&&Z.sort();for(var P=0;P<Z.length;P++){var R=Z[P],T=A[R];if("children"!==R){if(!r.test(R)&&(f&&f.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="
//# sourceMappingURL=jsx.js.map