preact-render-to-string 6.6.4 → 6.6.6
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.
- package/README.md +98 -0
- package/dist/jsx/commonjs.js +1 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -1
- package/dist/jsx/index.module.js +1 -1
- package/dist/jsx/index.module.js.map +1 -1
- package/dist/jsx/index.umd.js +1 -1
- package/dist/jsx/index.umd.js.map +1 -1
- package/dist/stream/index.js +1 -1
- package/dist/stream/index.js.map +1 -1
- package/dist/stream/index.mjs +1 -1
- package/dist/stream/index.module.js +1 -1
- package/dist/stream/index.module.js.map +1 -1
- package/dist/stream/index.umd.js +1 -1
- package/dist/stream/index.umd.js.map +1 -1
- package/dist/stream/node/index.js +25 -4
- package/dist/stream/node/index.js.map +1 -1
- package/dist/stream/node/index.mjs +25 -4
- package/dist/stream/node/index.module.js +25 -4
- package/dist/stream/node/index.module.js.map +1 -1
- package/dist/stream/node/index.umd.js +25 -4
- package/dist/stream/node/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/chunked.js +23 -1
- package/src/lib/client.js +2 -2
- package/src/pretty.js +34 -8
package/README.md
CHANGED
|
@@ -144,6 +144,104 @@ main().catch((error) => {
|
|
|
144
144
|
|
|
145
145
|
---
|
|
146
146
|
|
|
147
|
+
### Streaming
|
|
148
|
+
|
|
149
|
+
> [!NOTE]
|
|
150
|
+
> This is an early version of our streaming implementation.
|
|
151
|
+
|
|
152
|
+
Preact supports streaming HTML to the client incrementally, flushing `<Suspense>` fallbacks immediately and replacing them with the resolved content as data arrives. This reduces Time to First Byte and allows the browser to start parsing earlier.
|
|
153
|
+
|
|
154
|
+
#### `renderToReadableStream` — Web Streams
|
|
155
|
+
|
|
156
|
+
```jsx
|
|
157
|
+
import { renderToReadableStream } from 'preact-render-to-string/stream';
|
|
158
|
+
import { Suspense, lazy } from 'preact/compat';
|
|
159
|
+
|
|
160
|
+
const Profile = lazy(() => import('./Profile'));
|
|
161
|
+
|
|
162
|
+
const App = () => (
|
|
163
|
+
<html>
|
|
164
|
+
<head><title>My App</title></head>
|
|
165
|
+
<body>
|
|
166
|
+
<Suspense fallback={<p>Loading profile…</p>}>
|
|
167
|
+
<Profile />
|
|
168
|
+
</Suspense>
|
|
169
|
+
</body>
|
|
170
|
+
</html>
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
// Works in any Web Streams environment (Deno, Bun, Cloudflare Workers, …)
|
|
174
|
+
export default {
|
|
175
|
+
fetch() {
|
|
176
|
+
const stream = renderToReadableStream(<App />);
|
|
177
|
+
|
|
178
|
+
// stream.allReady resolves once all suspended content has been flushed
|
|
179
|
+
return new Response(stream, {
|
|
180
|
+
headers: { 'Content-Type': 'text/html' }
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
The returned `ReadableStream` has an extra `allReady: Promise<void>` property that resolves once every suspended subtree has been written. Await it before sending the response if you need the complete document before anything is flushed (e.g. for static export). At which point you might be better off using `renderToStringAsync` though.
|
|
187
|
+
|
|
188
|
+
```js
|
|
189
|
+
const stream = renderToReadableStream(<App />);
|
|
190
|
+
await stream.allReady; // wait for full render
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
#### `renderToPipeableStream` — Node.js Streams
|
|
194
|
+
|
|
195
|
+
```jsx
|
|
196
|
+
import { createServer } from 'node:http';
|
|
197
|
+
import { renderToPipeableStream } from 'preact-render-to-string/stream-node';
|
|
198
|
+
import { Suspense, lazy } from 'preact/compat';
|
|
199
|
+
|
|
200
|
+
const Profile = lazy(() => import('./Profile'));
|
|
201
|
+
|
|
202
|
+
const App = () => (
|
|
203
|
+
<html>
|
|
204
|
+
<head><title>My App</title></head>
|
|
205
|
+
<body>
|
|
206
|
+
<Suspense fallback={<p>Loading profile…</p>}>
|
|
207
|
+
<Profile />
|
|
208
|
+
</Suspense>
|
|
209
|
+
</body>
|
|
210
|
+
</html>
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
createServer((req, res) => {
|
|
214
|
+
res.setHeader('Content-Type', 'text/html');
|
|
215
|
+
|
|
216
|
+
const { pipe, abort } = renderToPipeableStream(<App />, {
|
|
217
|
+
onShellReady() {
|
|
218
|
+
// Called once the synchronous shell is ready to stream.
|
|
219
|
+
pipe(res);
|
|
220
|
+
},
|
|
221
|
+
onAllReady() {
|
|
222
|
+
// Called once every suspended subtree has been flushed.
|
|
223
|
+
},
|
|
224
|
+
onError(error) {
|
|
225
|
+
console.error(error);
|
|
226
|
+
res.statusCode = 500;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
// Optional: abort the render after a timeout
|
|
231
|
+
setTimeout(abort, 10_000);
|
|
232
|
+
}).listen(8080);
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
| Option | Description |
|
|
236
|
+
|---|---|
|
|
237
|
+
| `onShellReady()` | Called synchronously once the initial shell has been rendered and streaming is about to start. Pipe here for fastest TTFB. |
|
|
238
|
+
| `onAllReady()` | Called after all `<Suspense>` boundaries have resolved and the stream is complete. |
|
|
239
|
+
| `onError(error)` | Called for render errors inside suspended subtrees. |
|
|
240
|
+
|
|
241
|
+
Calling `abort()` stops the render and destroys the stream; any pending suspended subtrees are dropped.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
147
245
|
### License
|
|
148
246
|
|
|
149
247
|
[MIT](http://choosealicense.com/licenses/mit/)
|
package/dist/jsx/commonjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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="diffed",r="__s",o="__d",i=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,a=/[\s\n\\/='"\0<>]/,c=/^(xlink|xmlns|xml)([A-Z])/,l=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,u=/^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/,s=new Set(["draggable","spellcheck"]);function f(t){void 0!==t.__g?t.__g|=8:t[o]=!0}function p(t){void 0!==t.__g?t.__g&=-9:t[o]=!1}function g(t){return void 0!==t.__g?!!(8&t.__g):!0===t[o]}var d=/["&<]/;function v(t){if(0===t.length||!1===d.test(t))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";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 y=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},b=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},h={},m=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"]),_=/[A-Z]/g;function x(t){var e="";for(var n in t){var r=t[n];if(null!=r&&""!==r){var o="-"==n[0]?n:h[n]||(h[n]=n.replace(_,"-$&").toLowerCase()),i=";";"number"!=typeof r||o.startsWith("--")||m.has(o)||(i="px;"),e=e+o+":"+r+i}}return e||void 0}function j(t,e){return Array.isArray(e)?e.reduce(j,t):null!=e&&!1!==e&&t.push(e),t}function S(){this.__d=!0}function w(t,e){return{__v:t,context:e,props:t.props,setState:S,forceUpdate:S,__d:!0,__h:new Array(0)}}function k(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var A=[],O=[],F=new Set(["pre","textarea"]);function C(e,n,o,i){var a=t.options[r];t.options[r]=!0;try{return E(e,n||{},o,i)}finally{t.options.__c&&t.options.__c(e,O),t.options[r]=a,O.length=0}}function E(e,r,o,d,h,m){if(null==e||"boolean"==typeof e)return"";if("object"!=typeof e)return"function"==typeof e?"":v(e+"");var _=o.pretty,S=_&&"string"==typeof _?_:"\t";if(Array.isArray(e)){for(var A="",O=0;O<e.length;O++)_&&O>0&&(A+="\n"),A+=E(e[O],r,o,d,h,m);return A}if(void 0!==e.constructor)return"";t.options.__b&&t.options.__b(e);var C,$=e.type,H=e.props,L=!1;if("function"==typeof $){if(L=!0,!o.shallow||!d&&!1!==o.renderRootComponent||$===t.Fragment){if($===t.Fragment){var I=[];return j(I,e.props.children),E(I,r,o,!1!==o.shallowHighOrder,h,m)}var N,D=e.__c=w(e,r),W=t.options.__r;if($.prototype&&"function"==typeof $.prototype.render){var T=k($,r);(D=e.__c=new $(H,T)).__v=e,f(D),D.props=H,null==D.state&&(D.state={}),null==D._nextState&&null==D.__s&&(D._nextState=D.__s=D.state),D.context=T,$.getDerivedStateFromProps?D.state=Object.assign({},D.state,$.getDerivedStateFromProps(D.props,D.state)):D.componentWillMount&&(D.componentWillMount(),D.state=D._nextState!==D.state?D._nextState:D.__s!==D.state?D.__s:D.state),W&&W(e),N=D.render(D.props,D.state,D.context)}else for(var U=k($,r),Z=0;g(D)&&Z++<25;)p(D),W&&W(e),N=$.call(e.__c,H,U);D.getChildContext&&(r=Object.assign({},r,D.getChildContext()));var P=E(N,r,o,!1!==o.shallowHighOrder,h,m);return t.options[n]&&t.options[n](e),P}$=(C=$).displayName||C!==Function&&C.name||M(C)}var R,q,z="<"+$,J=_&&"string"==typeof $&&F.has($);if(H){var V=Object.keys(H);o&&!0===o.sortAttributes&&V.sort();for(var B=0;B<V.length;B++){var G=V[B],K=H[G];if("children"!==G){if(!a.test(G)&&(o&&o.allAttributes||"key"!==G&&"ref"!==G&&"__self"!==G&&"__source"!==G)){if("defaultValue"===G)G="value";else if("defaultChecked"===G)G="checked";else if("defaultSelected"===G)G="selected";else if("className"===G){if(void 0!==H.class)continue;G="class"}else"acceptCharset"===G?G="accept-charset":"httpEquiv"===G?G="http-equiv":c.test(G)?G=G.replace(c,"$1:$2").toLowerCase():"-"!==G.at(4)&&!s.has(G)||null==K?h?u.test(G)&&(G="panose1"===G?"panose-1":G.replace(/([A-Z])/g,"-$1").toLowerCase()):l.test(G)&&(G=G.toLowerCase()):K+="";if("htmlFor"===G){if(H.for)continue;G="for"}"style"===G&&K&&"object"==typeof K&&(K=x(K)),"a"===G[0]&&"r"===G[1]&&"boolean"==typeof K&&(K=String(K));var Q=o.attributeHook&&o.attributeHook(G,K,r,o,L);if(Q||""===Q)z+=Q;else if("dangerouslySetInnerHTML"===G)q=K&&K.__html;else if("textarea"===$&&"value"===G)R=K;else if((K||0===K||""===K)&&"function"!=typeof K){if(!(!0!==K&&""!==K||(K=G,o&&o.xml))){z=z+" "+G;continue}if("value"===G){if("select"===$){m=K;continue}"option"===$&&m==K&&void 0===H.selected&&(z+=" selected")}z=z+" "+G+'="'+v(K+"")+'"'}}}else R=K}}if(_){var X=z.replace(/\n\s*/," ");X===z||~X.indexOf("\n")?_&&~z.indexOf("\n")&&(z+="\n"):z=X}if(z+=">",a.test($))throw new Error($+" is not a valid HTML tag name in "+z);var Y,tt=i.test($)||o.voidElements&&o.voidElements.test($),et=[];if(q)_&&!J&&b(q)&&(q="\n"+S+y(q,S)),z+=q;else if(null!=R&&j(Y=[],R).length){for(var nt=_&&!J&&"string"==typeof $,rt=nt&&~z.indexOf("\n"),ot=!1,it=0;it<Y.length;it++){var at=Y[it];if(null!=at&&!1!==at){var ct=E(at,r,o,!0,"svg"===$||"foreignObject"!==$&&h,m);if(nt&&!rt&&b(ct)&&(rt=!0),ct)if(nt){var lt=ct.length>0&&"<"!=ct[0];ot&<?et[et.length-1]+=ct:et.push(ct),ot=lt}else et.push(ct)}}if(nt&&rt)for(var ut=et.length;ut--;)et[ut]="\n"+S+y(et[ut],S)}if(t.options[n]&&t.options[n](e),et.length||q)z+=et.join("");else if(o&&o.xml)return z.substring(0,z.length-1)+" />";return!tt||Y||q?(_&&!J&&~z.indexOf("\n")&&(z+="\n"),z=z+"</"+$+">"):z=z.replace(/>$/," />"),z}function M(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=A.length;r--;)if(A[r]===t){n=r;break}n<0&&(n=A.push(t)-1),e="UnnamedComponent"+n}return e}var $=/(\\|\"|\')/g,H=function(t){return t.replace($,"\\$1")},L=Object.prototype.toString,I=Date.prototype.toISOString,N=Error.prototype.toString,D=RegExp.prototype.toString,W=Symbol.prototype.toString,T=/^Symbol\((.*)\)(.*)$/,U=/\n/gi,Z=Object.getOwnPropertySymbols||function(t){return[]};function P(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 R(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}function q(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function z(t){return W.call(t).replace(T,"Symbol($1)")}function J(t){return"["+N.call(t)+"]"}function V(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";var e=typeof t;if("number"===e)return R(t);if("string"===e)return'"'+H(t)+'"';if("function"===e)return q(t);if("symbol"===e)return z(t);var n=L.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?q(t,min):"[object Symbol]"===n?z(t):"[object Date]"===n?I.call(t):"[object Error]"===n?J(t):"[object RegExp]"===n?D.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":P(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&J(t)}function B(t,e,n,r,o,i,a,c,l,u){var s="";if(t.length){s+=o;for(var f=n+e,p=0;p<t.length;p++)s+=f+nt(t[p],e,f,r,o,i,a,c,l,u),p<t.length-1&&(s+=","+r);s+=o+n}return"["+s+"]"}function G(t,e,n,r,o,i,a,c,l,u){return(u?"":"Arguments ")+B(t,e,n,r,o,i,a,c,l,u)}function K(t,e,n,r,o,i,a,c,l,u){return(u?"":t.constructor.name+" ")+B(t,e,n,r,o,i,a,c,l,u)}function Q(t,e,n,r,o,i,a,c,l,u){var s="Map {",f=t.entries(),p=f.next();if(!p.done){s+=o;for(var g=n+e;!p.done;)s+=g+nt(p.value[0],e,g,r,o,i,a,c,l,u)+" => "+nt(p.value[1],e,g,r,o,i,a,c,l,u),(p=f.next()).done||(s+=","+r);s+=o+n}return s+"}"}function X(t,e,n,r,o,i,a,c,l,u){var s=(u?"":t.constructor?t.constructor.name+" ":"Object ")+"{",f=Object.keys(t).sort(),p=Z(t);if(p.length&&(f=f.filter(function(t){return!("symbol"==typeof t||"[object Symbol]"===L.call(t))}).concat(p)),f.length){s+=o;for(var g=n+e,d=0;d<f.length;d++){var v=f[d];s+=g+nt(v,e,g,r,o,i,a,c,l,u)+": "+nt(t[v],e,g,r,o,i,a,c,l,u),d<f.length-1&&(s+=","+r)}s+=o+n}return s+"}"}function Y(t,e,n,r,o,i,a,c,l,u){var s="Set {",f=t.entries(),p=f.next();if(!p.done){s+=o;for(var g=n+e;!p.done;)s+=g+nt(p.value[1],e,g,r,o,i,a,c,l,u),(p=f.next()).done||(s+=","+r);s+=o+n}return s+"}"}function tt(t,e,n,r,o,i,a,c,l,u){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);var s=++c>a;if(!s&&t.toJSON&&"function"==typeof t.toJSON)return nt(t.toJSON(),e,n,r,o,i,a,c,l,u);var f=L.call(t);return"[object Arguments]"===f?s?"[Arguments]":G(t,e,n,r,o,i,a,c,l,u):P(f)?s?"[Array]":K(t,e,n,r,o,i,a,c,l,u):"[object Map]"===f?s?"[Map]":Q(t,e,n,r,o,i,a,c,l,u):"[object Set]"===f?s?"[Set]":Y(t,e,n,r,o,i,a,c,l,u):"object"==typeof t?s?"[Object]":X(t,e,n,r,o,i,a,c,l,u):void 0}function et(t,e,n,r,o,i,a,c,l,u){for(var s,f=!1,p=0;p<l.length;p++)if((s=l[p]).test(t)){f=!0;break}return!!f&&s.print(t,function(t){return nt(t,e,n,r,o,i,a,c,l,u)},function(t){var r=n+e;return r+t.replace(U,"\n"+r)},{edgeSpacing:o,spacing:r})}function nt(t,e,n,r,o,i,a,c,l,u){return V(t)||et(t,e,n,r,o,i,a,c,l,u)||tt(t,e,n,r,o,i,a,c,l,u)}var rt={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function ot(t){if(Object.keys(t).forEach(function(t){if(!rt.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")}function it(t){var e={};return Object.keys(rt).forEach(function(n){return e[n]=t.hasOwnProperty(n)?t[n]:rt[n]}),e.min&&(e.indent=0),e}function at(t){return new Array(t+1).join(" ")}var ct=function(t,e){var n,r;e?(ot(e),e=it(e)):e=rt;var o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){var a=et(t,n=at(e.indent),"",o,i,r=[],e.maxDepth,0,e.plugins,e.min);if(a)return a}return V(t)||(n||(n=at(e.indent)),r||(r=[]),tt(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))},lt={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t){return C(t,lt.context,lt.opts,!0)}},ut={plugins:[lt]},st={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?(lt.context=n,lt.opts=r,~(e=ct(e,ut)).indexOf("\n")&&(e=y("\n"+e,a)+"\n")):e="Function",y("\n"+t+"={"+e+"}",a)):"\n"+a+t+'="'+v(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function ft(t,e,n){var r=Object.assign({},st,n||{});return r.jsx||(r.attributeHook=null),C(t,e,r)}var pt={shallow:!0};exports.default=ft,exports.render=ft,exports.shallowRender=function(t,e,n){return ft(t,e,Object.assign({},pt,n||{}))};
|
|
1
|
+
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="diffed",r="__s",o="__d",i=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,a=/[\s\n\\/='"\0<>]/,c=/^(xlink|xmlns|xml)([A-Z])/,l=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,u=/^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/,s=new Set(["draggable","spellcheck"]);function f(t){void 0!==t.__g?t.__g|=8:t[o]=!0}function p(t){void 0!==t.__g?t.__g&=-9:t[o]=!1}function g(t){return void 0!==t.__g?!!(8&t.__g):!0===t[o]}var d=/["&<]/;function v(t){if(0===t.length||!1===d.test(t))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";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 y=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},h=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},b={},m=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"]),_=/[A-Z]/g;function x(t){var e="";for(var n in t){var r=t[n];if(null!=r&&""!==r){var o="-"==n[0]?n:b[n]||(b[n]=n.replace(_,"-$&").toLowerCase()),i=";";"number"!=typeof r||o.startsWith("--")||m.has(o)||(i="px;"),e=e+o+":"+r+i}}return e||void 0}function j(t,e){return Array.isArray(e)?e.reduce(j,t):null!=e&&!1!==e&&t.push(e),t}function S(){this.__d=!0}function k(t,e){return{__v:t,context:e,props:t.props,setState:S,forceUpdate:S,__d:!0,__h:new Array(0)}}function w(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var A=[],O=[],F=new Set(["pre","textarea"]);function C(e,n,o,i){var a=t.options[r];t.options[r]=!0;var c=t.h(t.Fragment,null);c.__k=[e];try{return E(e,n||{},o,i,!1,void 0,c)}finally{t.options.__c&&t.options.__c(e,O),t.options[r]=a,O.length=0}}function E(e,r,o,d,b,m,_){if(null==e||"boolean"==typeof e)return"";if("object"!=typeof e)return"function"==typeof e?"":v(e+"");var S=o.pretty,A=S&&"string"==typeof S?S:"\t";if(Array.isArray(e)){var O="";_.__k=e;for(var C=0;C<e.length;C++)S&&C>0&&(O+="\n"),O+=E(e[C],r,o,d,b,m,_);return O}if(void 0!==e.constructor)return"";e.__=_,t.options.__b&&t.options.__b(e);var $,H=e.type,L=e.props,I=!1;if("function"==typeof H){if(I=!0,!o.shallow||!d&&!1!==o.renderRootComponent||H===t.Fragment){if(H===t.Fragment){var N=[];return j(N,e.props.children),E(N,r,o,!1!==o.shallowHighOrder,b,m,e)}var D,W=e.__c=k(e,r),T=t.options.__r;if(H.prototype&&"function"==typeof H.prototype.render){var U=w(H,r);(W=e.__c=new H(L,U)).__v=e,f(W),W.props=L,null==W.state&&(W.state={}),null==W._nextState&&null==W.__s&&(W._nextState=W.__s=W.state),W.context=U,H.getDerivedStateFromProps?W.state=Object.assign({},W.state,H.getDerivedStateFromProps(W.props,W.state)):W.componentWillMount&&(W.componentWillMount(),W.state=W._nextState!==W.state?W._nextState:W.__s!==W.state?W.__s:W.state),T&&T(e),D=W.render(W.props,W.state,W.context)}else for(var Z=w(H,r),P=0;g(W)&&P++<25;)p(W),T&&T(e),D=H.call(e.__c,L,Z);W.getChildContext&&(r=Object.assign({},r,W.getChildContext()));var R=E(D,r,o,!1!==o.shallowHighOrder,b,m,e);return t.options[n]&&t.options[n](e),R}H=($=H).displayName||$!==Function&&$.name||M($)}var q,z,J="<"+H,V=S&&"string"==typeof H&&F.has(H);if(L){var B=Object.keys(L);o&&!0===o.sortAttributes&&B.sort();for(var G=0;G<B.length;G++){var K=B[G],Q=L[K];if("children"!==K){if(!a.test(K)&&(o&&o.allAttributes||"key"!==K&&"ref"!==K&&"__self"!==K&&"__source"!==K)){if("defaultValue"===K)K="value";else if("defaultChecked"===K)K="checked";else if("defaultSelected"===K)K="selected";else if("className"===K){if(void 0!==L.class)continue;K="class"}else"acceptCharset"===K?K="accept-charset":"httpEquiv"===K?K="http-equiv":c.test(K)?K=K.replace(c,"$1:$2").toLowerCase():"-"!==K.at(4)&&!s.has(K)||null==Q?b?u.test(K)&&(K="panose1"===K?"panose-1":K.replace(/([A-Z])/g,"-$1").toLowerCase()):l.test(K)&&(K=K.toLowerCase()):Q+="";if("htmlFor"===K){if(L.for)continue;K="for"}"style"===K&&Q&&"object"==typeof Q&&(Q=x(Q)),"a"===K[0]&&"r"===K[1]&&"boolean"==typeof Q&&(Q=String(Q));var X=o.attributeHook&&o.attributeHook(K,Q,r,o,I);if(X||""===X)J+=X;else if("dangerouslySetInnerHTML"===K)z=Q&&Q.__html;else if("textarea"===H&&"value"===K)q=Q;else if((Q||0===Q||""===Q)&&"function"!=typeof Q){if(!(!0!==Q&&""!==Q||(Q=K,o&&o.xml))){J=J+" "+K;continue}if("value"===K){if("select"===H){m=Q;continue}"option"===H&&m==Q&&void 0===L.selected&&(J+=" selected")}J=J+" "+K+'="'+v(Q+"")+'"'}}}else q=Q}}if(S){var Y=J.replace(/\n\s*/," ");Y===J||~Y.indexOf("\n")?S&&~J.indexOf("\n")&&(J+="\n"):J=Y}if(J+=">",a.test(H))throw new Error(H+" is not a valid HTML tag name in "+J);var tt,et=i.test(H)||o.voidElements&&o.voidElements.test(H),nt=[];if(z)S&&!V&&h(z)&&(z="\n"+A+y(z,A)),J+=z;else if(null!=q&&j(tt=[],q).length){for(var rt=S&&!V&&"string"==typeof H,ot=rt&&~J.indexOf("\n"),it=!1,at=0;at<tt.length;at++){var ct=tt[at];if(null!=ct&&!1!==ct){var lt=E(ct,r,o,!0,"svg"===H||"foreignObject"!==H&&b,m,e);if(rt&&!ot&&h(lt)&&(ot=!0),lt)if(rt){var ut=lt.length>0&&"<"!=lt[0];it&&ut?nt[nt.length-1]+=lt:nt.push(lt),it=ut}else nt.push(lt)}}if(rt&&ot)for(var st=nt.length;st--;)nt[st]="\n"+A+y(nt[st],A)}if(t.options[n]&&t.options[n](e),nt.length||z)J+=nt.join("");else if(o&&o.xml)return J.substring(0,J.length-1)+" />";return!et||tt||z?(S&&!V&&~J.indexOf("\n")&&(J+="\n"),J=J+"</"+H+">"):J=J.replace(/>$/," />"),J}function M(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=A.length;r--;)if(A[r]===t){n=r;break}n<0&&(n=A.push(t)-1),e="UnnamedComponent"+n}return e}var $=/(\\|\"|\')/g,H=function(t){return t.replace($,"\\$1")},L=Object.prototype.toString,I=Date.prototype.toISOString,N=Error.prototype.toString,D=RegExp.prototype.toString,W=Symbol.prototype.toString,T=/^Symbol\((.*)\)(.*)$/,U=/\n/gi,Z=Object.getOwnPropertySymbols||function(t){return[]};function P(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 R(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}function q(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function z(t){return W.call(t).replace(T,"Symbol($1)")}function J(t){return"["+N.call(t)+"]"}function V(t){if(!0===t||!1===t)return""+t;if(void 0===t)return"undefined";if(null===t)return"null";var e=typeof t;if("number"===e)return R(t);if("string"===e)return'"'+H(t)+'"';if("function"===e)return q(t);if("symbol"===e)return z(t);var n=L.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?q(t,min):"[object Symbol]"===n?z(t):"[object Date]"===n?I.call(t):"[object Error]"===n?J(t):"[object RegExp]"===n?D.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":P(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&J(t)}function B(t,e,n,r,o,i,a,c,l,u){var s="";if(t.length){s+=o;for(var f=n+e,p=0;p<t.length;p++)s+=f+nt(t[p],e,f,r,o,i,a,c,l,u),p<t.length-1&&(s+=","+r);s+=o+n}return"["+s+"]"}function G(t,e,n,r,o,i,a,c,l,u){return(u?"":"Arguments ")+B(t,e,n,r,o,i,a,c,l,u)}function K(t,e,n,r,o,i,a,c,l,u){return(u?"":t.constructor.name+" ")+B(t,e,n,r,o,i,a,c,l,u)}function Q(t,e,n,r,o,i,a,c,l,u){var s="Map {",f=t.entries(),p=f.next();if(!p.done){s+=o;for(var g=n+e;!p.done;)s+=g+nt(p.value[0],e,g,r,o,i,a,c,l,u)+" => "+nt(p.value[1],e,g,r,o,i,a,c,l,u),(p=f.next()).done||(s+=","+r);s+=o+n}return s+"}"}function X(t,e,n,r,o,i,a,c,l,u){var s=(u?"":t.constructor?t.constructor.name+" ":"Object ")+"{",f=Object.keys(t).sort(),p=Z(t);if(p.length&&(f=f.filter(function(t){return!("symbol"==typeof t||"[object Symbol]"===L.call(t))}).concat(p)),f.length){s+=o;for(var g=n+e,d=0;d<f.length;d++){var v=f[d];s+=g+nt(v,e,g,r,o,i,a,c,l,u)+": "+nt(t[v],e,g,r,o,i,a,c,l,u),d<f.length-1&&(s+=","+r)}s+=o+n}return s+"}"}function Y(t,e,n,r,o,i,a,c,l,u){var s="Set {",f=t.entries(),p=f.next();if(!p.done){s+=o;for(var g=n+e;!p.done;)s+=g+nt(p.value[1],e,g,r,o,i,a,c,l,u),(p=f.next()).done||(s+=","+r);s+=o+n}return s+"}"}function tt(t,e,n,r,o,i,a,c,l,u){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);var s=++c>a;if(!s&&t.toJSON&&"function"==typeof t.toJSON)return nt(t.toJSON(),e,n,r,o,i,a,c,l,u);var f=L.call(t);return"[object Arguments]"===f?s?"[Arguments]":G(t,e,n,r,o,i,a,c,l,u):P(f)?s?"[Array]":K(t,e,n,r,o,i,a,c,l,u):"[object Map]"===f?s?"[Map]":Q(t,e,n,r,o,i,a,c,l,u):"[object Set]"===f?s?"[Set]":Y(t,e,n,r,o,i,a,c,l,u):"object"==typeof t?s?"[Object]":X(t,e,n,r,o,i,a,c,l,u):void 0}function et(t,e,n,r,o,i,a,c,l,u){for(var s,f=!1,p=0;p<l.length;p++)if((s=l[p]).test(t)){f=!0;break}return!!f&&s.print(t,function(t){return nt(t,e,n,r,o,i,a,c,l,u)},function(t){var r=n+e;return r+t.replace(U,"\n"+r)},{edgeSpacing:o,spacing:r})}function nt(t,e,n,r,o,i,a,c,l,u){return V(t)||et(t,e,n,r,o,i,a,c,l,u)||tt(t,e,n,r,o,i,a,c,l,u)}var rt={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function ot(t){if(Object.keys(t).forEach(function(t){if(!rt.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")}function it(t){var e={};return Object.keys(rt).forEach(function(n){return e[n]=t.hasOwnProperty(n)?t[n]:rt[n]}),e.min&&(e.indent=0),e}function at(t){return new Array(t+1).join(" ")}var ct=function(t,e){var n,r;e?(ot(e),e=it(e)):e=rt;var o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){var a=et(t,n=at(e.indent),"",o,i,r=[],e.maxDepth,0,e.plugins,e.min);if(a)return a}return V(t)||(n||(n=at(e.indent)),r||(r=[]),tt(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))},lt={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t){return C(t,lt.context,lt.opts,!0)}},ut={plugins:[lt]},st={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?(lt.context=n,lt.opts=r,~(e=ct(e,ut)).indexOf("\n")&&(e=y("\n"+e,a)+"\n")):e="Function",y("\n"+t+"={"+e+"}",a)):"\n"+a+t+'="'+v(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function ft(t,e,n){var r=Object.assign({},st,n||{});return r.jsx||(r.attributeHook=null),C(t,e,r)}var pt={shallow:!0};exports.default=ft,exports.render=ft,exports.shallowRender=function(t,e,n){return ft(t,e,Object.assign({},pt,n||{}))};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/jsx/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["index.js"],"sourcesContent":["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=\"diffed\",r=\"__s\",o=\"__d\",i=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,a=/[\\s\\n\\\\/='\"\\0<>]/,c=/^(xlink|xmlns|xml)([A-Z])/,s=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,l=/^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/,u=new Set([\"draggable\",\"spellcheck\"]);function f(t){void 0!==t.__g?t.__g|=8:t[o]=!0}function p(t){void 0!==t.__g?t.__g&=-9:t[o]=!1}function g(t){return void 0!==t.__g?!!(8&t.__g):!0===t[o]}var d=/[\"&<]/;function y(t){if(0===t.length||!1===d.test(t))return t;for(var e=0,n=0,r=\"\",o=\"\";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=\""\";break;case 38:o=\"&\";break;case 60:o=\"<\";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 b=function(t,e){return String(t).replace(/(\\n+)/g,\"$1\"+(e||\"\\t\"))},h=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf(\"\\n\")||-1!==String(t).indexOf(\"<\")},m={},v=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\"]),_=/[A-Z]/g;function x(t){var e=\"\";for(var n in t){var r=t[n];if(null!=r&&\"\"!==r){var o=\"-\"==n[0]?n:m[n]||(m[n]=n.replace(_,\"-$&\").toLowerCase()),i=\";\";\"number\"!=typeof r||o.startsWith(\"--\")||v.has(o)||(i=\"px;\"),e=e+o+\":\"+r+i}}return e||void 0}function j(t,e){return Array.isArray(e)?e.reduce(j,t):null!=e&&!1!==e&&t.push(e),t}function S(){this.__d=!0}function w(t,e){return{__v:t,context:e,props:t.props,setState:S,forceUpdate:S,__d:!0,__h:new Array(0)}}function k(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var A=[],O=[],F=new Set([\"pre\",\"textarea\"]);function C(e,n,o,i){var a=t.options[r];t.options[r]=!0;try{return E(e,n||{},o,i)}finally{t.options.__c&&t.options.__c(e,O),t.options[r]=a,O.length=0}}function E(e,r,o,d,m,v){if(null==e||\"boolean\"==typeof e)return\"\";if(\"object\"!=typeof e)return\"function\"==typeof e?\"\":y(e+\"\");var _=o.pretty,S=_&&\"string\"==typeof _?_:\"\\t\";if(Array.isArray(e)){for(var A=\"\",O=0;O<e.length;O++)_&&O>0&&(A+=\"\\n\"),A+=E(e[O],r,o,d,m,v);return A}if(void 0!==e.constructor)return\"\";t.options.__b&&t.options.__b(e);var C,$=e.type,H=e.props,L=!1;if(\"function\"==typeof $){if(L=!0,!o.shallow||!d&&!1!==o.renderRootComponent||$===t.Fragment){if($===t.Fragment){var I=[];return j(I,e.props.children),E(I,r,o,!1!==o.shallowHighOrder,m,v)}var N,D=e.__c=w(e,r),W=t.options.__r;if($.prototype&&\"function\"==typeof $.prototype.render){var T=k($,r);(D=e.__c=new $(H,T)).__v=e,f(D),D.props=H,null==D.state&&(D.state={}),null==D._nextState&&null==D.__s&&(D._nextState=D.__s=D.state),D.context=T,$.getDerivedStateFromProps?D.state=Object.assign({},D.state,$.getDerivedStateFromProps(D.props,D.state)):D.componentWillMount&&(D.componentWillMount(),D.state=D._nextState!==D.state?D._nextState:D.__s!==D.state?D.__s:D.state),W&&W(e),N=D.render(D.props,D.state,D.context)}else for(var U=k($,r),Z=0;g(D)&&Z++<25;)p(D),W&&W(e),N=$.call(e.__c,H,U);D.getChildContext&&(r=Object.assign({},r,D.getChildContext()));var P=E(N,r,o,!1!==o.shallowHighOrder,m,v);return t.options[n]&&t.options[n](e),P}$=(C=$).displayName||C!==Function&&C.name||M(C)}var R,q,z=\"<\"+$,J=_&&\"string\"==typeof $&&F.has($);if(H){var V=Object.keys(H);o&&!0===o.sortAttributes&&V.sort();for(var B=0;B<V.length;B++){var G=V[B],K=H[G];if(\"children\"!==G){if(!a.test(G)&&(o&&o.allAttributes||\"key\"!==G&&\"ref\"!==G&&\"__self\"!==G&&\"__source\"!==G)){if(\"defaultValue\"===G)G=\"value\";else if(\"defaultChecked\"===G)G=\"checked\";else if(\"defaultSelected\"===G)G=\"selected\";else if(\"className\"===G){if(void 0!==H.class)continue;G=\"class\"}else\"acceptCharset\"===G?G=\"accept-charset\":\"httpEquiv\"===G?G=\"http-equiv\":c.test(G)?G=G.replace(c,\"$1:$2\").toLowerCase():\"-\"!==G.at(4)&&!u.has(G)||null==K?m?l.test(G)&&(G=\"panose1\"===G?\"panose-1\":G.replace(/([A-Z])/g,\"-$1\").toLowerCase()):s.test(G)&&(G=G.toLowerCase()):K+=\"\";if(\"htmlFor\"===G){if(H.for)continue;G=\"for\"}\"style\"===G&&K&&\"object\"==typeof K&&(K=x(K)),\"a\"===G[0]&&\"r\"===G[1]&&\"boolean\"==typeof K&&(K=String(K));var Q=o.attributeHook&&o.attributeHook(G,K,r,o,L);if(Q||\"\"===Q)z+=Q;else if(\"dangerouslySetInnerHTML\"===G)q=K&&K.__html;else if(\"textarea\"===$&&\"value\"===G)R=K;else if((K||0===K||\"\"===K)&&\"function\"!=typeof K){if(!(!0!==K&&\"\"!==K||(K=G,o&&o.xml))){z=z+\" \"+G;continue}if(\"value\"===G){if(\"select\"===$){v=K;continue}\"option\"===$&&v==K&&void 0===H.selected&&(z+=\" selected\")}z=z+\" \"+G+'=\"'+y(K+\"\")+'\"'}}}else R=K}}if(_){var X=z.replace(/\\n\\s*/,\" \");X===z||~X.indexOf(\"\\n\")?_&&~z.indexOf(\"\\n\")&&(z+=\"\\n\"):z=X}if(z+=\">\",a.test($))throw new Error($+\" is not a valid HTML tag name in \"+z);var Y,tt=i.test($)||o.voidElements&&o.voidElements.test($),et=[];if(q)_&&!J&&h(q)&&(q=\"\\n\"+S+b(q,S)),z+=q;else if(null!=R&&j(Y=[],R).length){for(var nt=_&&!J&&\"string\"==typeof $,rt=nt&&~z.indexOf(\"\\n\"),ot=!1,it=0;it<Y.length;it++){var at=Y[it];if(null!=at&&!1!==at){var ct=E(at,r,o,!0,\"svg\"===$||\"foreignObject\"!==$&&m,v);if(nt&&!rt&&h(ct)&&(rt=!0),ct)if(nt){var st=ct.length>0&&\"<\"!=ct[0];ot&&st?et[et.length-1]+=ct:et.push(ct),ot=st}else et.push(ct)}}if(nt&&rt)for(var lt=et.length;lt--;)et[lt]=\"\\n\"+S+b(et[lt],S)}if(t.options[n]&&t.options[n](e),et.length||q)z+=et.join(\"\");else if(o&&o.xml)return z.substring(0,z.length-1)+\" />\";return!tt||Y||q?(_&&!J&&~z.indexOf(\"\\n\")&&(z+=\"\\n\"),z=z+\"</\"+$+\">\"):z=z.replace(/>$/,\" />\"),z}function M(t){var e=(Function.prototype.toString.call(t).match(/^\\s*function\\s+([^( ]+)/)||\"\")[1];if(!e){for(var n=-1,r=A.length;r--;)if(A[r]===t){n=r;break}n<0&&(n=A.push(t)-1),e=\"UnnamedComponent\"+n}return e}const $=/(\\\\|\\\"|\\')/g;var H=function(t){return t.replace($,\"\\\\$1\")};const L=Object.prototype.toString,I=Date.prototype.toISOString,N=Error.prototype.toString,D=RegExp.prototype.toString,W=Symbol.prototype.toString,T=/^Symbol\\((.*)\\)(.*)$/,U=/\\n/gi,Z=Object.getOwnPropertySymbols||(t=>[]);function P(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 R(t){return t!=+t?\"NaN\":0===t&&1/t<0?\"-0\":\"\"+t}function q(t){return\"\"===t.name?\"[Function anonymous]\":\"[Function \"+t.name+\"]\"}function z(t){return W.call(t).replace(T,\"Symbol($1)\")}function J(t){return\"[\"+N.call(t)+\"]\"}function V(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 R(t);if(\"string\"===e)return'\"'+H(t)+'\"';if(\"function\"===e)return q(t);if(\"symbol\"===e)return z(t);const n=L.call(t);return\"[object WeakMap]\"===n?\"WeakMap {}\":\"[object WeakSet]\"===n?\"WeakSet {}\":\"[object Function]\"===n||\"[object GeneratorFunction]\"===n?q(t,min):\"[object Symbol]\"===n?z(t):\"[object Date]\"===n?I.call(t):\"[object Error]\"===n?J(t):\"[object RegExp]\"===n?D.call(t):\"[object Arguments]\"===n&&0===t.length?\"Arguments []\":P(n)&&0===t.length?t.constructor.name+\" []\":t instanceof Error&&J(t)}function B(t,e,n,r,o,i,a,c,s,l){let u=\"\";if(t.length){u+=o;const f=n+e;for(let n=0;n<t.length;n++)u+=f+nt(t[n],e,f,r,o,i,a,c,s,l),n<t.length-1&&(u+=\",\"+r);u+=o+n}return\"[\"+u+\"]\"}function G(t,e,n,r,o,i,a,c,s,l){return(l?\"\":\"Arguments \")+B(t,e,n,r,o,i,a,c,s,l)}function K(t,e,n,r,o,i,a,c,s,l){return(l?\"\":t.constructor.name+\" \")+B(t,e,n,r,o,i,a,c,s,l)}function Q(t,e,n,r,o,i,a,c,s,l){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+nt(p.value[0],e,t,r,o,i,a,c,s,l)+\" => \"+nt(p.value[1],e,t,r,o,i,a,c,s,l),p=f.next(),p.done||(u+=\",\"+r);u+=o+n}return u+\"}\"}function X(t,e,n,r,o,i,a,c,s,l){let u=(l?\"\":t.constructor?t.constructor.name+\" \":\"Object \")+\"{\",f=Object.keys(t).sort();const p=Z(t);if(p.length&&(f=f.filter(t=>!(\"symbol\"==typeof t||\"[object Symbol]\"===L.call(t))).concat(p)),f.length){u+=o;const p=n+e;for(let n=0;n<f.length;n++){const g=f[n];u+=p+nt(g,e,p,r,o,i,a,c,s,l)+\": \"+nt(t[g],e,p,r,o,i,a,c,s,l),n<f.length-1&&(u+=\",\"+r)}u+=o+n}return u+\"}\"}function Y(t,e,n,r,o,i,a,c,s,l){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+nt(p.value[1],e,t,r,o,i,a,c,s,l),p=f.next(),p.done||(u+=\",\"+r);u+=o+n}return u+\"}\"}function tt(t,e,n,r,o,i,a,c,s,l){if((i=i.slice()).indexOf(t)>-1)return\"[Circular]\";i.push(t);const u=++c>a;if(!u&&t.toJSON&&\"function\"==typeof t.toJSON)return nt(t.toJSON(),e,n,r,o,i,a,c,s,l);const f=L.call(t);return\"[object Arguments]\"===f?u?\"[Arguments]\":G(t,e,n,r,o,i,a,c,s,l):P(f)?u?\"[Array]\":K(t,e,n,r,o,i,a,c,s,l):\"[object Map]\"===f?u?\"[Map]\":Q(t,e,n,r,o,i,a,c,s,l):\"[object Set]\"===f?u?\"[Set]\":Y(t,e,n,r,o,i,a,c,s,l):\"object\"==typeof t?u?\"[Object]\":X(t,e,n,r,o,i,a,c,s,l):void 0}function et(t,e,n,r,o,i,a,c,s,l){let u,f=!1;for(let e=0;e<s.length;e++)if(u=s[e],u.test(t)){f=!0;break}return!!f&&u.print(t,function(t){return nt(t,e,n,r,o,i,a,c,s,l)},function(t){const r=n+e;return r+t.replace(U,\"\\n\"+r)},{edgeSpacing:o,spacing:r})}function nt(t,e,n,r,o,i,a,c,s,l){return V(t)||et(t,e,n,r,o,i,a,c,s,l)||tt(t,e,n,r,o,i,a,c,s,l)}const rt={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function ot(t){if(Object.keys(t).forEach(t=>{if(!rt.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\")}function it(t){const e={};return Object.keys(rt).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:rt[n]),e.min&&(e.indent=0),e}function at(t){return new Array(t+1).join(\" \")}var ct=function(t,e){let n,r;e?(ot(e),e=it(e)):e=rt;const o=e.min?\" \":\"\\n\",i=e.min?\"\":\"\\n\";if(e&&e.plugins.length){n=at(e.indent),r=[];var a=et(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return V(t)||(n||(n=at(e.indent)),r||(r=[]),tt(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min))},st={test:function(t){return t&&\"object\"==typeof t&&\"type\"in t&&\"props\"in t&&\"key\"in t},print:function(t){return C(t,st.context,st.opts,!0)}},lt={plugins:[st]},ut={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?(st.context=n,st.opts=r,~(e=ct(e,lt)).indexOf(\"\\n\")&&(e=b(\"\\n\"+e,a)+\"\\n\")):e=\"Function\",b(\"\\n\"+t+\"={\"+e+\"}\",a)):\"\\n\"+a+t+'=\"'+y(e)+'\"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:\" \"};function ft(t,e,n){var r=Object.assign({},ut,n||{});return r.jsx||(r.attributeHook=null),C(t,e,r)}var pt={shallow:!0};exports.default=ft,exports.render=ft,exports.shallowRender=function(t,e,n){return ft(t,e,Object.assign({},pt,n||{}))};\n//# sourceMappingURL=index.js.map\n"],"names":["t","require","Symbol","c","s"],"mappings":"AAAA,IAAAA,EAAAC,QAAA,UAAA,GAAsB,mBAAXC,OAAuB,CACjC,IAAIC,EAAI,EAERD,OAAS,SAAUE,GAClB,MAAA,KAAYA,KAAMD,CAClB,EACDD,OAAAA,IAAa,SAACE,GAAD,MAAA,KAAAJ,CACb"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["index.js"],"sourcesContent":["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=\"diffed\",r=\"__s\",o=\"__d\",i=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,a=/[\\s\\n\\\\/='\"\\0<>]/,c=/^(xlink|xmlns|xml)([A-Z])/,s=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,l=/^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/,u=new Set([\"draggable\",\"spellcheck\"]);function f(t){void 0!==t.__g?t.__g|=8:t[o]=!0}function p(t){void 0!==t.__g?t.__g&=-9:t[o]=!1}function g(t){return void 0!==t.__g?!!(8&t.__g):!0===t[o]}var d=/[\"&<]/;function y(t){if(0===t.length||!1===d.test(t))return t;for(var e=0,n=0,r=\"\",o=\"\";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=\""\";break;case 38:o=\"&\";break;case 60:o=\"<\";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 h=function(t,e){return String(t).replace(/(\\n+)/g,\"$1\"+(e||\"\\t\"))},b=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf(\"\\n\")||-1!==String(t).indexOf(\"<\")},m={},v=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\"]),_=/[A-Z]/g;function x(t){var e=\"\";for(var n in t){var r=t[n];if(null!=r&&\"\"!==r){var o=\"-\"==n[0]?n:m[n]||(m[n]=n.replace(_,\"-$&\").toLowerCase()),i=\";\";\"number\"!=typeof r||o.startsWith(\"--\")||v.has(o)||(i=\"px;\"),e=e+o+\":\"+r+i}}return e||void 0}function j(t,e){return Array.isArray(e)?e.reduce(j,t):null!=e&&!1!==e&&t.push(e),t}function S(){this.__d=!0}function k(t,e){return{__v:t,context:e,props:t.props,setState:S,forceUpdate:S,__d:!0,__h:new Array(0)}}function w(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var A=[],O=[],F=new Set([\"pre\",\"textarea\"]);function C(e,n,o,i){var a=t.options[r];t.options[r]=!0;var c=t.h(t.Fragment,null);c.__k=[e];try{return E(e,n||{},o,i,!1,void 0,c)}finally{t.options.__c&&t.options.__c(e,O),t.options[r]=a,O.length=0}}function E(e,r,o,d,m,v,_){if(null==e||\"boolean\"==typeof e)return\"\";if(\"object\"!=typeof e)return\"function\"==typeof e?\"\":y(e+\"\");var S=o.pretty,A=S&&\"string\"==typeof S?S:\"\\t\";if(Array.isArray(e)){var O=\"\";_.__k=e;for(var C=0;C<e.length;C++)S&&C>0&&(O+=\"\\n\"),O+=E(e[C],r,o,d,m,v,_);return O}if(void 0!==e.constructor)return\"\";e.__=_,t.options.__b&&t.options.__b(e);var $,H=e.type,L=e.props,I=!1;if(\"function\"==typeof H){if(I=!0,!o.shallow||!d&&!1!==o.renderRootComponent||H===t.Fragment){if(H===t.Fragment){var N=[];return j(N,e.props.children),E(N,r,o,!1!==o.shallowHighOrder,m,v,e)}var D,W=e.__c=k(e,r),T=t.options.__r;if(H.prototype&&\"function\"==typeof H.prototype.render){var U=w(H,r);(W=e.__c=new H(L,U)).__v=e,f(W),W.props=L,null==W.state&&(W.state={}),null==W._nextState&&null==W.__s&&(W._nextState=W.__s=W.state),W.context=U,H.getDerivedStateFromProps?W.state=Object.assign({},W.state,H.getDerivedStateFromProps(W.props,W.state)):W.componentWillMount&&(W.componentWillMount(),W.state=W._nextState!==W.state?W._nextState:W.__s!==W.state?W.__s:W.state),T&&T(e),D=W.render(W.props,W.state,W.context)}else for(var Z=w(H,r),P=0;g(W)&&P++<25;)p(W),T&&T(e),D=H.call(e.__c,L,Z);W.getChildContext&&(r=Object.assign({},r,W.getChildContext()));var R=E(D,r,o,!1!==o.shallowHighOrder,m,v,e);return t.options[n]&&t.options[n](e),R}H=($=H).displayName||$!==Function&&$.name||M($)}var q,z,J=\"<\"+H,V=S&&\"string\"==typeof H&&F.has(H);if(L){var B=Object.keys(L);o&&!0===o.sortAttributes&&B.sort();for(var G=0;G<B.length;G++){var K=B[G],Q=L[K];if(\"children\"!==K){if(!a.test(K)&&(o&&o.allAttributes||\"key\"!==K&&\"ref\"!==K&&\"__self\"!==K&&\"__source\"!==K)){if(\"defaultValue\"===K)K=\"value\";else if(\"defaultChecked\"===K)K=\"checked\";else if(\"defaultSelected\"===K)K=\"selected\";else if(\"className\"===K){if(void 0!==L.class)continue;K=\"class\"}else\"acceptCharset\"===K?K=\"accept-charset\":\"httpEquiv\"===K?K=\"http-equiv\":c.test(K)?K=K.replace(c,\"$1:$2\").toLowerCase():\"-\"!==K.at(4)&&!u.has(K)||null==Q?m?l.test(K)&&(K=\"panose1\"===K?\"panose-1\":K.replace(/([A-Z])/g,\"-$1\").toLowerCase()):s.test(K)&&(K=K.toLowerCase()):Q+=\"\";if(\"htmlFor\"===K){if(L.for)continue;K=\"for\"}\"style\"===K&&Q&&\"object\"==typeof Q&&(Q=x(Q)),\"a\"===K[0]&&\"r\"===K[1]&&\"boolean\"==typeof Q&&(Q=String(Q));var X=o.attributeHook&&o.attributeHook(K,Q,r,o,I);if(X||\"\"===X)J+=X;else if(\"dangerouslySetInnerHTML\"===K)z=Q&&Q.__html;else if(\"textarea\"===H&&\"value\"===K)q=Q;else if((Q||0===Q||\"\"===Q)&&\"function\"!=typeof Q){if(!(!0!==Q&&\"\"!==Q||(Q=K,o&&o.xml))){J=J+\" \"+K;continue}if(\"value\"===K){if(\"select\"===H){v=Q;continue}\"option\"===H&&v==Q&&void 0===L.selected&&(J+=\" selected\")}J=J+\" \"+K+'=\"'+y(Q+\"\")+'\"'}}}else q=Q}}if(S){var Y=J.replace(/\\n\\s*/,\" \");Y===J||~Y.indexOf(\"\\n\")?S&&~J.indexOf(\"\\n\")&&(J+=\"\\n\"):J=Y}if(J+=\">\",a.test(H))throw new Error(H+\" is not a valid HTML tag name in \"+J);var tt,et=i.test(H)||o.voidElements&&o.voidElements.test(H),nt=[];if(z)S&&!V&&b(z)&&(z=\"\\n\"+A+h(z,A)),J+=z;else if(null!=q&&j(tt=[],q).length){for(var rt=S&&!V&&\"string\"==typeof H,ot=rt&&~J.indexOf(\"\\n\"),it=!1,at=0;at<tt.length;at++){var ct=tt[at];if(null!=ct&&!1!==ct){var st=E(ct,r,o,!0,\"svg\"===H||\"foreignObject\"!==H&&m,v,e);if(rt&&!ot&&b(st)&&(ot=!0),st)if(rt){var lt=st.length>0&&\"<\"!=st[0];it&<?nt[nt.length-1]+=st:nt.push(st),it=lt}else nt.push(st)}}if(rt&&ot)for(var ut=nt.length;ut--;)nt[ut]=\"\\n\"+A+h(nt[ut],A)}if(t.options[n]&&t.options[n](e),nt.length||z)J+=nt.join(\"\");else if(o&&o.xml)return J.substring(0,J.length-1)+\" />\";return!et||tt||z?(S&&!V&&~J.indexOf(\"\\n\")&&(J+=\"\\n\"),J=J+\"</\"+H+\">\"):J=J.replace(/>$/,\" />\"),J}function M(t){var e=(Function.prototype.toString.call(t).match(/^\\s*function\\s+([^( ]+)/)||\"\")[1];if(!e){for(var n=-1,r=A.length;r--;)if(A[r]===t){n=r;break}n<0&&(n=A.push(t)-1),e=\"UnnamedComponent\"+n}return e}const $=/(\\\\|\\\"|\\')/g;var H=function(t){return t.replace($,\"\\\\$1\")};const L=Object.prototype.toString,I=Date.prototype.toISOString,N=Error.prototype.toString,D=RegExp.prototype.toString,W=Symbol.prototype.toString,T=/^Symbol\\((.*)\\)(.*)$/,U=/\\n/gi,Z=Object.getOwnPropertySymbols||(t=>[]);function P(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 R(t){return t!=+t?\"NaN\":0===t&&1/t<0?\"-0\":\"\"+t}function q(t){return\"\"===t.name?\"[Function anonymous]\":\"[Function \"+t.name+\"]\"}function z(t){return W.call(t).replace(T,\"Symbol($1)\")}function J(t){return\"[\"+N.call(t)+\"]\"}function V(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 R(t);if(\"string\"===e)return'\"'+H(t)+'\"';if(\"function\"===e)return q(t);if(\"symbol\"===e)return z(t);const n=L.call(t);return\"[object WeakMap]\"===n?\"WeakMap {}\":\"[object WeakSet]\"===n?\"WeakSet {}\":\"[object Function]\"===n||\"[object GeneratorFunction]\"===n?q(t,min):\"[object Symbol]\"===n?z(t):\"[object Date]\"===n?I.call(t):\"[object Error]\"===n?J(t):\"[object RegExp]\"===n?D.call(t):\"[object Arguments]\"===n&&0===t.length?\"Arguments []\":P(n)&&0===t.length?t.constructor.name+\" []\":t instanceof Error&&J(t)}function B(t,e,n,r,o,i,a,c,s,l){let u=\"\";if(t.length){u+=o;const f=n+e;for(let n=0;n<t.length;n++)u+=f+nt(t[n],e,f,r,o,i,a,c,s,l),n<t.length-1&&(u+=\",\"+r);u+=o+n}return\"[\"+u+\"]\"}function G(t,e,n,r,o,i,a,c,s,l){return(l?\"\":\"Arguments \")+B(t,e,n,r,o,i,a,c,s,l)}function K(t,e,n,r,o,i,a,c,s,l){return(l?\"\":t.constructor.name+\" \")+B(t,e,n,r,o,i,a,c,s,l)}function Q(t,e,n,r,o,i,a,c,s,l){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+nt(p.value[0],e,t,r,o,i,a,c,s,l)+\" => \"+nt(p.value[1],e,t,r,o,i,a,c,s,l),p=f.next(),p.done||(u+=\",\"+r);u+=o+n}return u+\"}\"}function X(t,e,n,r,o,i,a,c,s,l){let u=(l?\"\":t.constructor?t.constructor.name+\" \":\"Object \")+\"{\",f=Object.keys(t).sort();const p=Z(t);if(p.length&&(f=f.filter(t=>!(\"symbol\"==typeof t||\"[object Symbol]\"===L.call(t))).concat(p)),f.length){u+=o;const p=n+e;for(let n=0;n<f.length;n++){const g=f[n];u+=p+nt(g,e,p,r,o,i,a,c,s,l)+\": \"+nt(t[g],e,p,r,o,i,a,c,s,l),n<f.length-1&&(u+=\",\"+r)}u+=o+n}return u+\"}\"}function Y(t,e,n,r,o,i,a,c,s,l){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+nt(p.value[1],e,t,r,o,i,a,c,s,l),p=f.next(),p.done||(u+=\",\"+r);u+=o+n}return u+\"}\"}function tt(t,e,n,r,o,i,a,c,s,l){if((i=i.slice()).indexOf(t)>-1)return\"[Circular]\";i.push(t);const u=++c>a;if(!u&&t.toJSON&&\"function\"==typeof t.toJSON)return nt(t.toJSON(),e,n,r,o,i,a,c,s,l);const f=L.call(t);return\"[object Arguments]\"===f?u?\"[Arguments]\":G(t,e,n,r,o,i,a,c,s,l):P(f)?u?\"[Array]\":K(t,e,n,r,o,i,a,c,s,l):\"[object Map]\"===f?u?\"[Map]\":Q(t,e,n,r,o,i,a,c,s,l):\"[object Set]\"===f?u?\"[Set]\":Y(t,e,n,r,o,i,a,c,s,l):\"object\"==typeof t?u?\"[Object]\":X(t,e,n,r,o,i,a,c,s,l):void 0}function et(t,e,n,r,o,i,a,c,s,l){let u,f=!1;for(let e=0;e<s.length;e++)if(u=s[e],u.test(t)){f=!0;break}return!!f&&u.print(t,function(t){return nt(t,e,n,r,o,i,a,c,s,l)},function(t){const r=n+e;return r+t.replace(U,\"\\n\"+r)},{edgeSpacing:o,spacing:r})}function nt(t,e,n,r,o,i,a,c,s,l){return V(t)||et(t,e,n,r,o,i,a,c,s,l)||tt(t,e,n,r,o,i,a,c,s,l)}const rt={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function ot(t){if(Object.keys(t).forEach(t=>{if(!rt.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\")}function it(t){const e={};return Object.keys(rt).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:rt[n]),e.min&&(e.indent=0),e}function at(t){return new Array(t+1).join(\" \")}var ct=function(t,e){let n,r;e?(ot(e),e=it(e)):e=rt;const o=e.min?\" \":\"\\n\",i=e.min?\"\":\"\\n\";if(e&&e.plugins.length){n=at(e.indent),r=[];var a=et(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return V(t)||(n||(n=at(e.indent)),r||(r=[]),tt(t,n,\"\",o,i,r,e.maxDepth,0,e.plugins,e.min))},st={test:function(t){return t&&\"object\"==typeof t&&\"type\"in t&&\"props\"in t&&\"key\"in t},print:function(t){return C(t,st.context,st.opts,!0)}},lt={plugins:[st]},ut={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?(st.context=n,st.opts=r,~(e=ct(e,lt)).indexOf(\"\\n\")&&(e=h(\"\\n\"+e,a)+\"\\n\")):e=\"Function\",h(\"\\n\"+t+\"={\"+e+\"}\",a)):\"\\n\"+a+t+'=\"'+y(e)+'\"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:\" \"};function ft(t,e,n){var r=Object.assign({},ut,n||{});return r.jsx||(r.attributeHook=null),C(t,e,r)}var pt={shallow:!0};exports.default=ft,exports.render=ft,exports.shallowRender=function(t,e,n){return ft(t,e,Object.assign({},pt,n||{}))};\n//# sourceMappingURL=index.js.map\n"],"names":["t","require","Symbol","c","s"],"mappings":"AAAA,IAAAA,EAAAC,QAAA,UAAA,GAAsB,mBAAXC,OAAuB,CACjC,IAAIC,EAAI,EAERD,OAAS,SAAUE,GAClB,MAAA,KAAYA,KAAMD,CAClB,EACDD,OAAAA,IAAa,SAACE,GAAD,MAAA,KAAAJ,CACb"}
|
package/dist/jsx/index.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="diffed",o="__s",i="__d",a=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,c=/[\s\n\\/='"\0<>]/,l=/^(xlink|xmlns|xml)([A-Z])/,s=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,u=/^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/,f=new Set(["draggable","spellcheck"]);function p(t){void 0!==t.__g?t.__g|=8:t[i]=!0}function g(t){void 0!==t.__g?t.__g&=-9:t[i]=!1}function d(t){return void 0!==t.__g?!!(8&t.__g):!0===t[i]}var y=/["&<]/;function b(t){if(0===t.length||!1===y.test(t))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";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 h=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},m=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},v={},_=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"]),x=/[A-Z]/g;function j(t){var e="";for(var n in t){var r=t[n];if(null!=r&&""!==r){var o="-"==n[0]?n:v[n]||(v[n]=n.replace(x,"-$&").toLowerCase()),i=";";"number"!=typeof r||o.startsWith("--")||_.has(o)||(i="px;"),e=e+o+":"+r+i}}return e||void 0}function S(t,e){return Array.isArray(e)?e.reduce(S,t):null!=e&&!1!==e&&t.push(e),t}function k(){this.__d=!0}function w(t,e){return{__v:t,context:e,props:t.props,setState:k,forceUpdate:k,__d:!0,__h:new Array(0)}}function A(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var O=[],C=[],F=new Set(["pre","textarea"]);function E(e,n,r,i){var a=t[o];t[o]=!0;try{return M(e,n||{},r,i)}finally{t.__c&&t.__c(e,C),t[o]=a,C.length=0}}function M(n,o,i,y,v,_){if(null==n||"boolean"==typeof n)return"";if("object"!=typeof n)return"function"==typeof n?"":b(n+"");var x=i.pretty,k=x&&"string"==typeof x?x:"\t";if(Array.isArray(n)){for(var O="",C=0;C<n.length;C++)x&&C>0&&(O+="\n"),O+=M(n[C],o,i,y,v,_);return O}if(void 0!==n.constructor)return"";t.__b&&t.__b(n);var E,H=n.type,L=n.props,I=!1;if("function"==typeof H){if(I=!0,!i.shallow||!y&&!1!==i.renderRootComponent||H===e){if(H===e){var N=[];return S(N,n.props.children),M(N,o,i,!1!==i.shallowHighOrder,v,_)}var D,W=n.__c=w(n,o),T=t.__r;if(H.prototype&&"function"==typeof H.prototype.render){var U=A(H,o);(W=n.__c=new H(L,U)).__v=n,p(W),W.props=L,null==W.state&&(W.state={}),null==W._nextState&&null==W.__s&&(W._nextState=W.__s=W.state),W.context=U,H.getDerivedStateFromProps?W.state=Object.assign({},W.state,H.getDerivedStateFromProps(W.props,W.state)):W.componentWillMount&&(W.componentWillMount(),W.state=W._nextState!==W.state?W._nextState:W.__s!==W.state?W.__s:W.state),T&&T(n),D=W.render(W.props,W.state,W.context)}else for(var Z=A(H,o),P=0;d(W)&&P++<25;)g(W),T&&T(n),D=H.call(n.__c,L,Z);W.getChildContext&&(o=Object.assign({},o,W.getChildContext()));var R=M(D,o,i,!1!==i.shallowHighOrder,v,_);return t[r]&&t[r](n),R}H=(E=H).displayName||E!==Function&&E.name||$(E)}var z,q,J="<"+H,V=x&&"string"==typeof H&&F.has(H);if(L){var B=Object.keys(L);i&&!0===i.sortAttributes&&B.sort();for(var G=0;G<B.length;G++){var K=B[G],Q=L[K];if("children"!==K){if(!c.test(K)&&(i&&i.allAttributes||"key"!==K&&"ref"!==K&&"__self"!==K&&"__source"!==K)){if("defaultValue"===K)K="value";else if("defaultChecked"===K)K="checked";else if("defaultSelected"===K)K="selected";else if("className"===K){if(void 0!==L.class)continue;K="class"}else"acceptCharset"===K?K="accept-charset":"httpEquiv"===K?K="http-equiv":l.test(K)?K=K.replace(l,"$1:$2").toLowerCase():"-"!==K.at(4)&&!f.has(K)||null==Q?v?u.test(K)&&(K="panose1"===K?"panose-1":K.replace(/([A-Z])/g,"-$1").toLowerCase()):s.test(K)&&(K=K.toLowerCase()):Q+="";if("htmlFor"===K){if(L.for)continue;K="for"}"style"===K&&Q&&"object"==typeof Q&&(Q=j(Q)),"a"===K[0]&&"r"===K[1]&&"boolean"==typeof Q&&(Q=String(Q));var X=i.attributeHook&&i.attributeHook(K,Q,o,i,I);if(X||""===X)J+=X;else if("dangerouslySetInnerHTML"===K)q=Q&&Q.__html;else if("textarea"===H&&"value"===K)z=Q;else if((Q||0===Q||""===Q)&&"function"!=typeof Q){if(!(!0!==Q&&""!==Q||(Q=K,i&&i.xml))){J=J+" "+K;continue}if("value"===K){if("select"===H){_=Q;continue}"option"===H&&_==Q&&void 0===L.selected&&(J+=" selected")}J=J+" "+K+'="'+b(Q+"")+'"'}}}else z=Q}}if(x){var Y=J.replace(/\n\s*/," ");Y===J||~Y.indexOf("\n")?x&&~J.indexOf("\n")&&(J+="\n"):J=Y}if(J+=">",c.test(H))throw new Error(H+" is not a valid HTML tag name in "+J);var tt,et=a.test(H)||i.voidElements&&i.voidElements.test(H),nt=[];if(q)x&&!V&&m(q)&&(q="\n"+k+h(q,k)),J+=q;else if(null!=z&&S(tt=[],z).length){for(var rt=x&&!V&&"string"==typeof H,ot=rt&&~J.indexOf("\n"),it=!1,at=0;at<tt.length;at++){var ct=tt[at];if(null!=ct&&!1!==ct){var lt=M(ct,o,i,!0,"svg"===H||"foreignObject"!==H&&v,_);if(rt&&!ot&&m(lt)&&(ot=!0),lt)if(rt){var st=lt.length>0&&"<"!=lt[0];it&&st?nt[nt.length-1]+=lt:nt.push(lt),it=st}else nt.push(lt)}}if(rt&&ot)for(var ut=nt.length;ut--;)nt[ut]="\n"+k+h(nt[ut],k)}if(t[r]&&t[r](n),nt.length||q)J+=nt.join("");else if(i&&i.xml)return J.substring(0,J.length-1)+" />";return!et||tt||q?(x&&!V&&~J.indexOf("\n")&&(J+="\n"),J=J+"</"+H+">"):J=J.replace(/>$/," />"),J}function $(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=O.length;r--;)if(O[r]===t){n=r;break}n<0&&(n=O.push(t)-1),e="UnnamedComponent"+n}return e}const H=/(\\|\"|\')/g;var L=function(t){return t.replace(H,"\\$1")};const I=Object.prototype.toString,N=Date.prototype.toISOString,D=Error.prototype.toString,W=RegExp.prototype.toString,T=Symbol.prototype.toString,U=/^Symbol\((.*)\)(.*)$/,Z=/\n/gi,P=Object.getOwnPropertySymbols||(t=>[]);function R(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 z(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}function q(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function J(t){return T.call(t).replace(U,"Symbol($1)")}function V(t){return"["+D.call(t)+"]"}function B(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 z(t);if("string"===e)return'"'+L(t)+'"';if("function"===e)return q(t);if("symbol"===e)return J(t);const n=I.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?q(t,min):"[object Symbol]"===n?J(t):"[object Date]"===n?N.call(t):"[object Error]"===n?V(t):"[object RegExp]"===n?W.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":R(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&V(t)}function G(t,e,n,r,o,i,a,c,l,s){let u="";if(t.length){u+=o;const f=n+e;for(let n=0;n<t.length;n++)u+=f+rt(t[n],e,f,r,o,i,a,c,l,s),n<t.length-1&&(u+=","+r);u+=o+n}return"["+u+"]"}function K(t,e,n,r,o,i,a,c,l,s){return(s?"":"Arguments ")+G(t,e,n,r,o,i,a,c,l,s)}function Q(t,e,n,r,o,i,a,c,l,s){return(s?"":t.constructor.name+" ")+G(t,e,n,r,o,i,a,c,l,s)}function X(t,e,n,r,o,i,a,c,l,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+rt(p.value[0],e,t,r,o,i,a,c,l,s)+" => "+rt(p.value[1],e,t,r,o,i,a,c,l,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}function Y(t,e,n,r,o,i,a,c,l,s){let u=(s?"":t.constructor?t.constructor.name+" ":"Object ")+"{",f=Object.keys(t).sort();const p=P(t);if(p.length&&(f=f.filter(t=>!("symbol"==typeof t||"[object Symbol]"===I.call(t))).concat(p)),f.length){u+=o;const p=n+e;for(let n=0;n<f.length;n++){const g=f[n];u+=p+rt(g,e,p,r,o,i,a,c,l,s)+": "+rt(t[g],e,p,r,o,i,a,c,l,s),n<f.length-1&&(u+=","+r)}u+=o+n}return u+"}"}function tt(t,e,n,r,o,i,a,c,l,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+rt(p.value[1],e,t,r,o,i,a,c,l,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}function et(t,e,n,r,o,i,a,c,l,s){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const u=++c>a;if(!u&&t.toJSON&&"function"==typeof t.toJSON)return rt(t.toJSON(),e,n,r,o,i,a,c,l,s);const f=I.call(t);return"[object Arguments]"===f?u?"[Arguments]":K(t,e,n,r,o,i,a,c,l,s):R(f)?u?"[Array]":Q(t,e,n,r,o,i,a,c,l,s):"[object Map]"===f?u?"[Map]":X(t,e,n,r,o,i,a,c,l,s):"[object Set]"===f?u?"[Set]":tt(t,e,n,r,o,i,a,c,l,s):"object"==typeof t?u?"[Object]":Y(t,e,n,r,o,i,a,c,l,s):void 0}function nt(t,e,n,r,o,i,a,c,l,s){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 rt(t,e,n,r,o,i,a,c,l,s)},function(t){const r=n+e;return r+t.replace(Z,"\n"+r)},{edgeSpacing:o,spacing:r})}function rt(t,e,n,r,o,i,a,c,l,s){return B(t)||nt(t,e,n,r,o,i,a,c,l,s)||et(t,e,n,r,o,i,a,c,l,s)}const ot={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function it(t){if(Object.keys(t).forEach(t=>{if(!ot.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")}function at(t){const e={};return Object.keys(ot).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:ot[n]),e.min&&(e.indent=0),e}function ct(t){return new Array(t+1).join(" ")}var lt=function(t,e){let n,r;e?(it(e),e=at(e)):e=ot;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=ct(e.indent),r=[];var a=nt(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return B(t)||(n||(n=ct(e.indent)),r||(r=[]),et(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))},st={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t){return E(t,st.context,st.opts,!0)}},ut={plugins:[st]},ft={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?(st.context=n,st.opts=r,~(e=lt(e,ut)).indexOf("\n")&&(e=h("\n"+e,a)+"\n")):e="Function",h("\n"+t+"={"+e+"}",a)):"\n"+a+t+'="'+b(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function pt(t,e,n){var r=Object.assign({},ft,n||{});return r.jsx||(r.attributeHook=null),E(t,e,r)}var gt={shallow:!0};function dt(t,e,n){return pt(t,e,Object.assign({},gt,n||{}))}export{pt as default,pt as render,dt as shallowRender};
|
|
1
|
+
import{options as t,h as e,Fragment 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="diffed",i="__s",a="__d",c=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,l=/[\s\n\\/='"\0<>]/,s=/^(xlink|xmlns|xml)([A-Z])/,u=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,f=/^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/,p=new Set(["draggable","spellcheck"]);function g(t){void 0!==t.__g?t.__g|=8:t[a]=!0}function d(t){void 0!==t.__g?t.__g&=-9:t[a]=!1}function y(t){return void 0!==t.__g?!!(8&t.__g):!0===t[a]}var b=/["&<]/;function h(t){if(0===t.length||!1===b.test(t))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";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 m=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},v=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},_={},x=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"]),j=/[A-Z]/g;function S(t){var e="";for(var n in t){var r=t[n];if(null!=r&&""!==r){var o="-"==n[0]?n:_[n]||(_[n]=n.replace(j,"-$&").toLowerCase()),i=";";"number"!=typeof r||o.startsWith("--")||x.has(o)||(i="px;"),e=e+o+":"+r+i}}return e||void 0}function k(t,e){return Array.isArray(e)?e.reduce(k,t):null!=e&&!1!==e&&t.push(e),t}function w(){this.__d=!0}function A(t,e){return{__v:t,context:e,props:t.props,setState:w,forceUpdate:w,__d:!0,__h:new Array(0)}}function O(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var C=[],F=[],E=new Set(["pre","textarea"]);function M(r,o,a,c){var l=t[i];t[i]=!0;var s=e(n,null);s.__k=[r];try{return $(r,o||{},a,c,!1,void 0,s)}finally{t.__c&&t.__c(r,F),t[i]=l,F.length=0}}function $(e,r,i,a,b,_,x){if(null==e||"boolean"==typeof e)return"";if("object"!=typeof e)return"function"==typeof e?"":h(e+"");var j=i.pretty,w=j&&"string"==typeof j?j:"\t";if(Array.isArray(e)){var C="";x.__k=e;for(var F=0;F<e.length;F++)j&&F>0&&(C+="\n"),C+=$(e[F],r,i,a,b,_,x);return C}if(void 0!==e.constructor)return"";e.__=x,t.__b&&t.__b(e);var M,L=e.type,I=e.props,N=!1;if("function"==typeof L){if(N=!0,!i.shallow||!a&&!1!==i.renderRootComponent||L===n){if(L===n){var D=[];return k(D,e.props.children),$(D,r,i,!1!==i.shallowHighOrder,b,_,e)}var W,T=e.__c=A(e,r),U=t.__r;if(L.prototype&&"function"==typeof L.prototype.render){var Z=O(L,r);(T=e.__c=new L(I,Z)).__v=e,g(T),T.props=I,null==T.state&&(T.state={}),null==T._nextState&&null==T.__s&&(T._nextState=T.__s=T.state),T.context=Z,L.getDerivedStateFromProps?T.state=Object.assign({},T.state,L.getDerivedStateFromProps(T.props,T.state)):T.componentWillMount&&(T.componentWillMount(),T.state=T._nextState!==T.state?T._nextState:T.__s!==T.state?T.__s:T.state),U&&U(e),W=T.render(T.props,T.state,T.context)}else for(var P=O(L,r),R=0;y(T)&&R++<25;)d(T),U&&U(e),W=L.call(e.__c,I,P);T.getChildContext&&(r=Object.assign({},r,T.getChildContext()));var z=$(W,r,i,!1!==i.shallowHighOrder,b,_,e);return t[o]&&t[o](e),z}L=(M=L).displayName||M!==Function&&M.name||H(M)}var q,J,V="<"+L,B=j&&"string"==typeof L&&E.has(L);if(I){var G=Object.keys(I);i&&!0===i.sortAttributes&&G.sort();for(var K=0;K<G.length;K++){var Q=G[K],X=I[Q];if("children"!==Q){if(!l.test(Q)&&(i&&i.allAttributes||"key"!==Q&&"ref"!==Q&&"__self"!==Q&&"__source"!==Q)){if("defaultValue"===Q)Q="value";else if("defaultChecked"===Q)Q="checked";else if("defaultSelected"===Q)Q="selected";else if("className"===Q){if(void 0!==I.class)continue;Q="class"}else"acceptCharset"===Q?Q="accept-charset":"httpEquiv"===Q?Q="http-equiv":s.test(Q)?Q=Q.replace(s,"$1:$2").toLowerCase():"-"!==Q.at(4)&&!p.has(Q)||null==X?b?f.test(Q)&&(Q="panose1"===Q?"panose-1":Q.replace(/([A-Z])/g,"-$1").toLowerCase()):u.test(Q)&&(Q=Q.toLowerCase()):X+="";if("htmlFor"===Q){if(I.for)continue;Q="for"}"style"===Q&&X&&"object"==typeof X&&(X=S(X)),"a"===Q[0]&&"r"===Q[1]&&"boolean"==typeof X&&(X=String(X));var Y=i.attributeHook&&i.attributeHook(Q,X,r,i,N);if(Y||""===Y)V+=Y;else if("dangerouslySetInnerHTML"===Q)J=X&&X.__html;else if("textarea"===L&&"value"===Q)q=X;else if((X||0===X||""===X)&&"function"!=typeof X){if(!(!0!==X&&""!==X||(X=Q,i&&i.xml))){V=V+" "+Q;continue}if("value"===Q){if("select"===L){_=X;continue}"option"===L&&_==X&&void 0===I.selected&&(V+=" selected")}V=V+" "+Q+'="'+h(X+"")+'"'}}}else q=X}}if(j){var tt=V.replace(/\n\s*/," ");tt===V||~tt.indexOf("\n")?j&&~V.indexOf("\n")&&(V+="\n"):V=tt}if(V+=">",l.test(L))throw new Error(L+" is not a valid HTML tag name in "+V);var et,nt=c.test(L)||i.voidElements&&i.voidElements.test(L),rt=[];if(J)j&&!B&&v(J)&&(J="\n"+w+m(J,w)),V+=J;else if(null!=q&&k(et=[],q).length){for(var ot=j&&!B&&"string"==typeof L,it=ot&&~V.indexOf("\n"),at=!1,ct=0;ct<et.length;ct++){var lt=et[ct];if(null!=lt&&!1!==lt){var st=$(lt,r,i,!0,"svg"===L||"foreignObject"!==L&&b,_,e);if(ot&&!it&&v(st)&&(it=!0),st)if(ot){var ut=st.length>0&&"<"!=st[0];at&&ut?rt[rt.length-1]+=st:rt.push(st),at=ut}else rt.push(st)}}if(ot&&it)for(var ft=rt.length;ft--;)rt[ft]="\n"+w+m(rt[ft],w)}if(t[o]&&t[o](e),rt.length||J)V+=rt.join("");else if(i&&i.xml)return V.substring(0,V.length-1)+" />";return!nt||et||J?(j&&!B&&~V.indexOf("\n")&&(V+="\n"),V=V+"</"+L+">"):V=V.replace(/>$/," />"),V}function H(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=C.length;r--;)if(C[r]===t){n=r;break}n<0&&(n=C.push(t)-1),e="UnnamedComponent"+n}return e}const L=/(\\|\"|\')/g;var I=function(t){return t.replace(L,"\\$1")};const N=Object.prototype.toString,D=Date.prototype.toISOString,W=Error.prototype.toString,T=RegExp.prototype.toString,U=Symbol.prototype.toString,Z=/^Symbol\((.*)\)(.*)$/,P=/\n/gi,R=Object.getOwnPropertySymbols||(t=>[]);function z(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 q(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}function J(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function V(t){return U.call(t).replace(Z,"Symbol($1)")}function B(t){return"["+W.call(t)+"]"}function G(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 q(t);if("string"===e)return'"'+I(t)+'"';if("function"===e)return J(t);if("symbol"===e)return V(t);const n=N.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?J(t,min):"[object Symbol]"===n?V(t):"[object Date]"===n?D.call(t):"[object Error]"===n?B(t):"[object RegExp]"===n?T.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":z(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&B(t)}function K(t,e,n,r,o,i,a,c,l,s){let u="";if(t.length){u+=o;const f=n+e;for(let n=0;n<t.length;n++)u+=f+ot(t[n],e,f,r,o,i,a,c,l,s),n<t.length-1&&(u+=","+r);u+=o+n}return"["+u+"]"}function Q(t,e,n,r,o,i,a,c,l,s){return(s?"":"Arguments ")+K(t,e,n,r,o,i,a,c,l,s)}function X(t,e,n,r,o,i,a,c,l,s){return(s?"":t.constructor.name+" ")+K(t,e,n,r,o,i,a,c,l,s)}function Y(t,e,n,r,o,i,a,c,l,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+ot(p.value[0],e,t,r,o,i,a,c,l,s)+" => "+ot(p.value[1],e,t,r,o,i,a,c,l,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}function tt(t,e,n,r,o,i,a,c,l,s){let u=(s?"":t.constructor?t.constructor.name+" ":"Object ")+"{",f=Object.keys(t).sort();const p=R(t);if(p.length&&(f=f.filter(t=>!("symbol"==typeof t||"[object Symbol]"===N.call(t))).concat(p)),f.length){u+=o;const p=n+e;for(let n=0;n<f.length;n++){const g=f[n];u+=p+ot(g,e,p,r,o,i,a,c,l,s)+": "+ot(t[g],e,p,r,o,i,a,c,l,s),n<f.length-1&&(u+=","+r)}u+=o+n}return u+"}"}function et(t,e,n,r,o,i,a,c,l,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+ot(p.value[1],e,t,r,o,i,a,c,l,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}function nt(t,e,n,r,o,i,a,c,l,s){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const u=++c>a;if(!u&&t.toJSON&&"function"==typeof t.toJSON)return ot(t.toJSON(),e,n,r,o,i,a,c,l,s);const f=N.call(t);return"[object Arguments]"===f?u?"[Arguments]":Q(t,e,n,r,o,i,a,c,l,s):z(f)?u?"[Array]":X(t,e,n,r,o,i,a,c,l,s):"[object Map]"===f?u?"[Map]":Y(t,e,n,r,o,i,a,c,l,s):"[object Set]"===f?u?"[Set]":et(t,e,n,r,o,i,a,c,l,s):"object"==typeof t?u?"[Object]":tt(t,e,n,r,o,i,a,c,l,s):void 0}function rt(t,e,n,r,o,i,a,c,l,s){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 ot(t,e,n,r,o,i,a,c,l,s)},function(t){const r=n+e;return r+t.replace(P,"\n"+r)},{edgeSpacing:o,spacing:r})}function ot(t,e,n,r,o,i,a,c,l,s){return G(t)||rt(t,e,n,r,o,i,a,c,l,s)||nt(t,e,n,r,o,i,a,c,l,s)}const it={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function at(t){if(Object.keys(t).forEach(t=>{if(!it.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")}function ct(t){const e={};return Object.keys(it).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:it[n]),e.min&&(e.indent=0),e}function lt(t){return new Array(t+1).join(" ")}var st=function(t,e){let n,r;e?(at(e),e=ct(e)):e=it;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=lt(e.indent),r=[];var a=rt(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return G(t)||(n||(n=lt(e.indent)),r||(r=[]),nt(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))},ut={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t){return M(t,ut.context,ut.opts,!0)}},ft={plugins:[ut]},pt={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?(ut.context=n,ut.opts=r,~(e=st(e,ft)).indexOf("\n")&&(e=m("\n"+e,a)+"\n")):e="Function",m("\n"+t+"={"+e+"}",a)):"\n"+a+t+'="'+h(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function gt(t,e,n){var r=Object.assign({},pt,n||{});return r.jsx||(r.attributeHook=null),M(t,e,r)}var dt={shallow:!0};function yt(t,e,n){return gt(t,e,Object.assign({},dt,n||{}))}export{gt as default,gt as render,yt as shallowRender};
|
|
2
2
|
//# sourceMappingURL=index.module.js.map
|
package/dist/jsx/index.module.js
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="diffed",o="__s",i="__d",a=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,c=/[\s\n\\/='"\0<>]/,l=/^(xlink|xmlns|xml)([A-Z])/,s=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,u=/^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/,f=new Set(["draggable","spellcheck"]);function p(t){void 0!==t.__g?t.__g|=8:t[i]=!0}function g(t){void 0!==t.__g?t.__g&=-9:t[i]=!1}function d(t){return void 0!==t.__g?!!(8&t.__g):!0===t[i]}var y=/["&<]/;function b(t){if(0===t.length||!1===y.test(t))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";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 h=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},m=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},v={},_=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"]),x=/[A-Z]/g;function j(t){var e="";for(var n in t){var r=t[n];if(null!=r&&""!==r){var o="-"==n[0]?n:v[n]||(v[n]=n.replace(x,"-$&").toLowerCase()),i=";";"number"!=typeof r||o.startsWith("--")||_.has(o)||(i="px;"),e=e+o+":"+r+i}}return e||void 0}function S(t,e){return Array.isArray(e)?e.reduce(S,t):null!=e&&!1!==e&&t.push(e),t}function k(){this.__d=!0}function w(t,e){return{__v:t,context:e,props:t.props,setState:k,forceUpdate:k,__d:!0,__h:new Array(0)}}function A(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var O=[],C=[],F=new Set(["pre","textarea"]);function E(e,n,r,i){var a=t[o];t[o]=!0;try{return M(e,n||{},r,i)}finally{t.__c&&t.__c(e,C),t[o]=a,C.length=0}}function M(n,o,i,y,v,_){if(null==n||"boolean"==typeof n)return"";if("object"!=typeof n)return"function"==typeof n?"":b(n+"");var x=i.pretty,k=x&&"string"==typeof x?x:"\t";if(Array.isArray(n)){for(var O="",C=0;C<n.length;C++)x&&C>0&&(O+="\n"),O+=M(n[C],o,i,y,v,_);return O}if(void 0!==n.constructor)return"";t.__b&&t.__b(n);var E,H=n.type,L=n.props,I=!1;if("function"==typeof H){if(I=!0,!i.shallow||!y&&!1!==i.renderRootComponent||H===e){if(H===e){var N=[];return S(N,n.props.children),M(N,o,i,!1!==i.shallowHighOrder,v,_)}var D,W=n.__c=w(n,o),T=t.__r;if(H.prototype&&"function"==typeof H.prototype.render){var U=A(H,o);(W=n.__c=new H(L,U)).__v=n,p(W),W.props=L,null==W.state&&(W.state={}),null==W._nextState&&null==W.__s&&(W._nextState=W.__s=W.state),W.context=U,H.getDerivedStateFromProps?W.state=Object.assign({},W.state,H.getDerivedStateFromProps(W.props,W.state)):W.componentWillMount&&(W.componentWillMount(),W.state=W._nextState!==W.state?W._nextState:W.__s!==W.state?W.__s:W.state),T&&T(n),D=W.render(W.props,W.state,W.context)}else for(var Z=A(H,o),P=0;d(W)&&P++<25;)g(W),T&&T(n),D=H.call(n.__c,L,Z);W.getChildContext&&(o=Object.assign({},o,W.getChildContext()));var R=M(D,o,i,!1!==i.shallowHighOrder,v,_);return t[r]&&t[r](n),R}H=(E=H).displayName||E!==Function&&E.name||$(E)}var z,q,J="<"+H,V=x&&"string"==typeof H&&F.has(H);if(L){var B=Object.keys(L);i&&!0===i.sortAttributes&&B.sort();for(var G=0;G<B.length;G++){var K=B[G],Q=L[K];if("children"!==K){if(!c.test(K)&&(i&&i.allAttributes||"key"!==K&&"ref"!==K&&"__self"!==K&&"__source"!==K)){if("defaultValue"===K)K="value";else if("defaultChecked"===K)K="checked";else if("defaultSelected"===K)K="selected";else if("className"===K){if(void 0!==L.class)continue;K="class"}else"acceptCharset"===K?K="accept-charset":"httpEquiv"===K?K="http-equiv":l.test(K)?K=K.replace(l,"$1:$2").toLowerCase():"-"!==K.at(4)&&!f.has(K)||null==Q?v?u.test(K)&&(K="panose1"===K?"panose-1":K.replace(/([A-Z])/g,"-$1").toLowerCase()):s.test(K)&&(K=K.toLowerCase()):Q+="";if("htmlFor"===K){if(L.for)continue;K="for"}"style"===K&&Q&&"object"==typeof Q&&(Q=j(Q)),"a"===K[0]&&"r"===K[1]&&"boolean"==typeof Q&&(Q=String(Q));var X=i.attributeHook&&i.attributeHook(K,Q,o,i,I);if(X||""===X)J+=X;else if("dangerouslySetInnerHTML"===K)q=Q&&Q.__html;else if("textarea"===H&&"value"===K)z=Q;else if((Q||0===Q||""===Q)&&"function"!=typeof Q){if(!(!0!==Q&&""!==Q||(Q=K,i&&i.xml))){J=J+" "+K;continue}if("value"===K){if("select"===H){_=Q;continue}"option"===H&&_==Q&&void 0===L.selected&&(J+=" selected")}J=J+" "+K+'="'+b(Q+"")+'"'}}}else z=Q}}if(x){var Y=J.replace(/\n\s*/," ");Y===J||~Y.indexOf("\n")?x&&~J.indexOf("\n")&&(J+="\n"):J=Y}if(J+=">",c.test(H))throw new Error(H+" is not a valid HTML tag name in "+J);var tt,et=a.test(H)||i.voidElements&&i.voidElements.test(H),nt=[];if(q)x&&!V&&m(q)&&(q="\n"+k+h(q,k)),J+=q;else if(null!=z&&S(tt=[],z).length){for(var rt=x&&!V&&"string"==typeof H,ot=rt&&~J.indexOf("\n"),it=!1,at=0;at<tt.length;at++){var ct=tt[at];if(null!=ct&&!1!==ct){var lt=M(ct,o,i,!0,"svg"===H||"foreignObject"!==H&&v,_);if(rt&&!ot&&m(lt)&&(ot=!0),lt)if(rt){var st=lt.length>0&&"<"!=lt[0];it&&st?nt[nt.length-1]+=lt:nt.push(lt),it=st}else nt.push(lt)}}if(rt&&ot)for(var ut=nt.length;ut--;)nt[ut]="\n"+k+h(nt[ut],k)}if(t[r]&&t[r](n),nt.length||q)J+=nt.join("");else if(i&&i.xml)return J.substring(0,J.length-1)+" />";return!et||tt||q?(x&&!V&&~J.indexOf("\n")&&(J+="\n"),J=J+"</"+H+">"):J=J.replace(/>$/," />"),J}function $(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=O.length;r--;)if(O[r]===t){n=r;break}n<0&&(n=O.push(t)-1),e="UnnamedComponent"+n}return e}const H=/(\\|\"|\')/g;var L=function(t){return t.replace(H,"\\$1")};const I=Object.prototype.toString,N=Date.prototype.toISOString,D=Error.prototype.toString,W=RegExp.prototype.toString,T=Symbol.prototype.toString,U=/^Symbol\((.*)\)(.*)$/,Z=/\n/gi,P=Object.getOwnPropertySymbols||(t=>[]);function R(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 z(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}function q(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function J(t){return T.call(t).replace(U,"Symbol($1)")}function V(t){return"["+D.call(t)+"]"}function B(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 z(t);if("string"===e)return'"'+L(t)+'"';if("function"===e)return q(t);if("symbol"===e)return J(t);const n=I.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?q(t,min):"[object Symbol]"===n?J(t):"[object Date]"===n?N.call(t):"[object Error]"===n?V(t):"[object RegExp]"===n?W.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":R(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&V(t)}function G(t,e,n,r,o,i,a,c,l,s){let u="";if(t.length){u+=o;const f=n+e;for(let n=0;n<t.length;n++)u+=f+rt(t[n],e,f,r,o,i,a,c,l,s),n<t.length-1&&(u+=","+r);u+=o+n}return"["+u+"]"}function K(t,e,n,r,o,i,a,c,l,s){return(s?"":"Arguments ")+G(t,e,n,r,o,i,a,c,l,s)}function Q(t,e,n,r,o,i,a,c,l,s){return(s?"":t.constructor.name+" ")+G(t,e,n,r,o,i,a,c,l,s)}function X(t,e,n,r,o,i,a,c,l,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+rt(p.value[0],e,t,r,o,i,a,c,l,s)+" => "+rt(p.value[1],e,t,r,o,i,a,c,l,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}function Y(t,e,n,r,o,i,a,c,l,s){let u=(s?"":t.constructor?t.constructor.name+" ":"Object ")+"{",f=Object.keys(t).sort();const p=P(t);if(p.length&&(f=f.filter(t=>!("symbol"==typeof t||"[object Symbol]"===I.call(t))).concat(p)),f.length){u+=o;const p=n+e;for(let n=0;n<f.length;n++){const g=f[n];u+=p+rt(g,e,p,r,o,i,a,c,l,s)+": "+rt(t[g],e,p,r,o,i,a,c,l,s),n<f.length-1&&(u+=","+r)}u+=o+n}return u+"}"}function tt(t,e,n,r,o,i,a,c,l,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+rt(p.value[1],e,t,r,o,i,a,c,l,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}function et(t,e,n,r,o,i,a,c,l,s){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const u=++c>a;if(!u&&t.toJSON&&"function"==typeof t.toJSON)return rt(t.toJSON(),e,n,r,o,i,a,c,l,s);const f=I.call(t);return"[object Arguments]"===f?u?"[Arguments]":K(t,e,n,r,o,i,a,c,l,s):R(f)?u?"[Array]":Q(t,e,n,r,o,i,a,c,l,s):"[object Map]"===f?u?"[Map]":X(t,e,n,r,o,i,a,c,l,s):"[object Set]"===f?u?"[Set]":tt(t,e,n,r,o,i,a,c,l,s):"object"==typeof t?u?"[Object]":Y(t,e,n,r,o,i,a,c,l,s):void 0}function nt(t,e,n,r,o,i,a,c,l,s){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 rt(t,e,n,r,o,i,a,c,l,s)},function(t){const r=n+e;return r+t.replace(Z,"\n"+r)},{edgeSpacing:o,spacing:r})}function rt(t,e,n,r,o,i,a,c,l,s){return B(t)||nt(t,e,n,r,o,i,a,c,l,s)||et(t,e,n,r,o,i,a,c,l,s)}const ot={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function it(t){if(Object.keys(t).forEach(t=>{if(!ot.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")}function at(t){const e={};return Object.keys(ot).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:ot[n]),e.min&&(e.indent=0),e}function ct(t){return new Array(t+1).join(" ")}var lt=function(t,e){let n,r;e?(it(e),e=at(e)):e=ot;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=ct(e.indent),r=[];var a=nt(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return B(t)||(n||(n=ct(e.indent)),r||(r=[]),et(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))},st={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t){return E(t,st.context,st.opts,!0)}},ut={plugins:[st]},ft={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?(st.context=n,st.opts=r,~(e=lt(e,ut)).indexOf("\n")&&(e=h("\n"+e,a)+"\n")):e="Function",h("\n"+t+"={"+e+"}",a)):"\n"+a+t+'="'+b(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function pt(t,e,n){var r=Object.assign({},ft,n||{});return r.jsx||(r.attributeHook=null),E(t,e,r)}var gt={shallow:!0};function dt(t,e,n){return pt(t,e,Object.assign({},gt,n||{}))}export{pt as default,pt as render,dt as shallowRender};
|
|
1
|
+
import{options as t,h as e,Fragment 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="diffed",i="__s",a="__d",c=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,l=/[\s\n\\/='"\0<>]/,s=/^(xlink|xmlns|xml)([A-Z])/,u=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,f=/^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/,p=new Set(["draggable","spellcheck"]);function g(t){void 0!==t.__g?t.__g|=8:t[a]=!0}function d(t){void 0!==t.__g?t.__g&=-9:t[a]=!1}function y(t){return void 0!==t.__g?!!(8&t.__g):!0===t[a]}var b=/["&<]/;function h(t){if(0===t.length||!1===b.test(t))return t;for(var e=0,n=0,r="",o="";n<t.length;n++){switch(t.charCodeAt(n)){case 34:o=""";break;case 38:o="&";break;case 60:o="<";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 m=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},v=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},_={},x=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"]),j=/[A-Z]/g;function S(t){var e="";for(var n in t){var r=t[n];if(null!=r&&""!==r){var o="-"==n[0]?n:_[n]||(_[n]=n.replace(j,"-$&").toLowerCase()),i=";";"number"!=typeof r||o.startsWith("--")||x.has(o)||(i="px;"),e=e+o+":"+r+i}}return e||void 0}function k(t,e){return Array.isArray(e)?e.reduce(k,t):null!=e&&!1!==e&&t.push(e),t}function w(){this.__d=!0}function A(t,e){return{__v:t,context:e,props:t.props,setState:w,forceUpdate:w,__d:!0,__h:new Array(0)}}function O(t,e){var n=t.contextType,r=n&&e[n.__c];return null!=n?r?r.props.value:n.__:e}var C=[],F=[],E=new Set(["pre","textarea"]);function M(r,o,a,c){var l=t[i];t[i]=!0;var s=e(n,null);s.__k=[r];try{return $(r,o||{},a,c,!1,void 0,s)}finally{t.__c&&t.__c(r,F),t[i]=l,F.length=0}}function $(e,r,i,a,b,_,x){if(null==e||"boolean"==typeof e)return"";if("object"!=typeof e)return"function"==typeof e?"":h(e+"");var j=i.pretty,w=j&&"string"==typeof j?j:"\t";if(Array.isArray(e)){var C="";x.__k=e;for(var F=0;F<e.length;F++)j&&F>0&&(C+="\n"),C+=$(e[F],r,i,a,b,_,x);return C}if(void 0!==e.constructor)return"";e.__=x,t.__b&&t.__b(e);var M,L=e.type,I=e.props,N=!1;if("function"==typeof L){if(N=!0,!i.shallow||!a&&!1!==i.renderRootComponent||L===n){if(L===n){var D=[];return k(D,e.props.children),$(D,r,i,!1!==i.shallowHighOrder,b,_,e)}var W,T=e.__c=A(e,r),U=t.__r;if(L.prototype&&"function"==typeof L.prototype.render){var Z=O(L,r);(T=e.__c=new L(I,Z)).__v=e,g(T),T.props=I,null==T.state&&(T.state={}),null==T._nextState&&null==T.__s&&(T._nextState=T.__s=T.state),T.context=Z,L.getDerivedStateFromProps?T.state=Object.assign({},T.state,L.getDerivedStateFromProps(T.props,T.state)):T.componentWillMount&&(T.componentWillMount(),T.state=T._nextState!==T.state?T._nextState:T.__s!==T.state?T.__s:T.state),U&&U(e),W=T.render(T.props,T.state,T.context)}else for(var P=O(L,r),R=0;y(T)&&R++<25;)d(T),U&&U(e),W=L.call(e.__c,I,P);T.getChildContext&&(r=Object.assign({},r,T.getChildContext()));var z=$(W,r,i,!1!==i.shallowHighOrder,b,_,e);return t[o]&&t[o](e),z}L=(M=L).displayName||M!==Function&&M.name||H(M)}var q,J,V="<"+L,B=j&&"string"==typeof L&&E.has(L);if(I){var G=Object.keys(I);i&&!0===i.sortAttributes&&G.sort();for(var K=0;K<G.length;K++){var Q=G[K],X=I[Q];if("children"!==Q){if(!l.test(Q)&&(i&&i.allAttributes||"key"!==Q&&"ref"!==Q&&"__self"!==Q&&"__source"!==Q)){if("defaultValue"===Q)Q="value";else if("defaultChecked"===Q)Q="checked";else if("defaultSelected"===Q)Q="selected";else if("className"===Q){if(void 0!==I.class)continue;Q="class"}else"acceptCharset"===Q?Q="accept-charset":"httpEquiv"===Q?Q="http-equiv":s.test(Q)?Q=Q.replace(s,"$1:$2").toLowerCase():"-"!==Q.at(4)&&!p.has(Q)||null==X?b?f.test(Q)&&(Q="panose1"===Q?"panose-1":Q.replace(/([A-Z])/g,"-$1").toLowerCase()):u.test(Q)&&(Q=Q.toLowerCase()):X+="";if("htmlFor"===Q){if(I.for)continue;Q="for"}"style"===Q&&X&&"object"==typeof X&&(X=S(X)),"a"===Q[0]&&"r"===Q[1]&&"boolean"==typeof X&&(X=String(X));var Y=i.attributeHook&&i.attributeHook(Q,X,r,i,N);if(Y||""===Y)V+=Y;else if("dangerouslySetInnerHTML"===Q)J=X&&X.__html;else if("textarea"===L&&"value"===Q)q=X;else if((X||0===X||""===X)&&"function"!=typeof X){if(!(!0!==X&&""!==X||(X=Q,i&&i.xml))){V=V+" "+Q;continue}if("value"===Q){if("select"===L){_=X;continue}"option"===L&&_==X&&void 0===I.selected&&(V+=" selected")}V=V+" "+Q+'="'+h(X+"")+'"'}}}else q=X}}if(j){var tt=V.replace(/\n\s*/," ");tt===V||~tt.indexOf("\n")?j&&~V.indexOf("\n")&&(V+="\n"):V=tt}if(V+=">",l.test(L))throw new Error(L+" is not a valid HTML tag name in "+V);var et,nt=c.test(L)||i.voidElements&&i.voidElements.test(L),rt=[];if(J)j&&!B&&v(J)&&(J="\n"+w+m(J,w)),V+=J;else if(null!=q&&k(et=[],q).length){for(var ot=j&&!B&&"string"==typeof L,it=ot&&~V.indexOf("\n"),at=!1,ct=0;ct<et.length;ct++){var lt=et[ct];if(null!=lt&&!1!==lt){var st=$(lt,r,i,!0,"svg"===L||"foreignObject"!==L&&b,_,e);if(ot&&!it&&v(st)&&(it=!0),st)if(ot){var ut=st.length>0&&"<"!=st[0];at&&ut?rt[rt.length-1]+=st:rt.push(st),at=ut}else rt.push(st)}}if(ot&&it)for(var ft=rt.length;ft--;)rt[ft]="\n"+w+m(rt[ft],w)}if(t[o]&&t[o](e),rt.length||J)V+=rt.join("");else if(i&&i.xml)return V.substring(0,V.length-1)+" />";return!nt||et||J?(j&&!B&&~V.indexOf("\n")&&(V+="\n"),V=V+"</"+L+">"):V=V.replace(/>$/," />"),V}function H(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=C.length;r--;)if(C[r]===t){n=r;break}n<0&&(n=C.push(t)-1),e="UnnamedComponent"+n}return e}const L=/(\\|\"|\')/g;var I=function(t){return t.replace(L,"\\$1")};const N=Object.prototype.toString,D=Date.prototype.toISOString,W=Error.prototype.toString,T=RegExp.prototype.toString,U=Symbol.prototype.toString,Z=/^Symbol\((.*)\)(.*)$/,P=/\n/gi,R=Object.getOwnPropertySymbols||(t=>[]);function z(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 q(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}function J(t){return""===t.name?"[Function anonymous]":"[Function "+t.name+"]"}function V(t){return U.call(t).replace(Z,"Symbol($1)")}function B(t){return"["+W.call(t)+"]"}function G(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 q(t);if("string"===e)return'"'+I(t)+'"';if("function"===e)return J(t);if("symbol"===e)return V(t);const n=N.call(t);return"[object WeakMap]"===n?"WeakMap {}":"[object WeakSet]"===n?"WeakSet {}":"[object Function]"===n||"[object GeneratorFunction]"===n?J(t,min):"[object Symbol]"===n?V(t):"[object Date]"===n?D.call(t):"[object Error]"===n?B(t):"[object RegExp]"===n?T.call(t):"[object Arguments]"===n&&0===t.length?"Arguments []":z(n)&&0===t.length?t.constructor.name+" []":t instanceof Error&&B(t)}function K(t,e,n,r,o,i,a,c,l,s){let u="";if(t.length){u+=o;const f=n+e;for(let n=0;n<t.length;n++)u+=f+ot(t[n],e,f,r,o,i,a,c,l,s),n<t.length-1&&(u+=","+r);u+=o+n}return"["+u+"]"}function Q(t,e,n,r,o,i,a,c,l,s){return(s?"":"Arguments ")+K(t,e,n,r,o,i,a,c,l,s)}function X(t,e,n,r,o,i,a,c,l,s){return(s?"":t.constructor.name+" ")+K(t,e,n,r,o,i,a,c,l,s)}function Y(t,e,n,r,o,i,a,c,l,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+ot(p.value[0],e,t,r,o,i,a,c,l,s)+" => "+ot(p.value[1],e,t,r,o,i,a,c,l,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}function tt(t,e,n,r,o,i,a,c,l,s){let u=(s?"":t.constructor?t.constructor.name+" ":"Object ")+"{",f=Object.keys(t).sort();const p=R(t);if(p.length&&(f=f.filter(t=>!("symbol"==typeof t||"[object Symbol]"===N.call(t))).concat(p)),f.length){u+=o;const p=n+e;for(let n=0;n<f.length;n++){const g=f[n];u+=p+ot(g,e,p,r,o,i,a,c,l,s)+": "+ot(t[g],e,p,r,o,i,a,c,l,s),n<f.length-1&&(u+=","+r)}u+=o+n}return u+"}"}function et(t,e,n,r,o,i,a,c,l,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+ot(p.value[1],e,t,r,o,i,a,c,l,s),p=f.next(),p.done||(u+=","+r);u+=o+n}return u+"}"}function nt(t,e,n,r,o,i,a,c,l,s){if((i=i.slice()).indexOf(t)>-1)return"[Circular]";i.push(t);const u=++c>a;if(!u&&t.toJSON&&"function"==typeof t.toJSON)return ot(t.toJSON(),e,n,r,o,i,a,c,l,s);const f=N.call(t);return"[object Arguments]"===f?u?"[Arguments]":Q(t,e,n,r,o,i,a,c,l,s):z(f)?u?"[Array]":X(t,e,n,r,o,i,a,c,l,s):"[object Map]"===f?u?"[Map]":Y(t,e,n,r,o,i,a,c,l,s):"[object Set]"===f?u?"[Set]":et(t,e,n,r,o,i,a,c,l,s):"object"==typeof t?u?"[Object]":tt(t,e,n,r,o,i,a,c,l,s):void 0}function rt(t,e,n,r,o,i,a,c,l,s){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 ot(t,e,n,r,o,i,a,c,l,s)},function(t){const r=n+e;return r+t.replace(P,"\n"+r)},{edgeSpacing:o,spacing:r})}function ot(t,e,n,r,o,i,a,c,l,s){return G(t)||rt(t,e,n,r,o,i,a,c,l,s)||nt(t,e,n,r,o,i,a,c,l,s)}const it={indent:2,min:!1,maxDepth:Infinity,plugins:[]};function at(t){if(Object.keys(t).forEach(t=>{if(!it.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")}function ct(t){const e={};return Object.keys(it).forEach(n=>e[n]=t.hasOwnProperty(n)?t[n]:it[n]),e.min&&(e.indent=0),e}function lt(t){return new Array(t+1).join(" ")}var st=function(t,e){let n,r;e?(at(e),e=ct(e)):e=it;const o=e.min?" ":"\n",i=e.min?"":"\n";if(e&&e.plugins.length){n=lt(e.indent),r=[];var a=rt(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min);if(a)return a}return G(t)||(n||(n=lt(e.indent)),r||(r=[]),nt(t,n,"",o,i,r,e.maxDepth,0,e.plugins,e.min))},ut={test:function(t){return t&&"object"==typeof t&&"type"in t&&"props"in t&&"key"in t},print:function(t){return M(t,ut.context,ut.opts,!0)}},ft={plugins:[ut]},pt={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?(ut.context=n,ut.opts=r,~(e=st(e,ft)).indexOf("\n")&&(e=m("\n"+e,a)+"\n")):e="Function",m("\n"+t+"={"+e+"}",a)):"\n"+a+t+'="'+h(e)+'"'},jsx:!0,xml:!1,functions:!0,functionNames:!0,skipFalseAttributes:!0,pretty:" "};function gt(t,e,n){var r=Object.assign({},pt,n||{});return r.jsx||(r.attributeHook=null),M(t,e,r)}var dt={shallow:!0};function yt(t,e,n){return gt(t,e,Object.assign({},dt,n||{}))}export{gt as default,gt as render,yt as shallowRender};
|
|
2
2
|
//# sourceMappingURL=index.module.js.map
|