@takumi-rs/helpers 1.0.3 → 1.0.5

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/dist/html.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./helpers-cmaAH67r.cjs`),t=require(`./markup-BoHMcJO0.cjs`);function n(n){let{nodes:r,stylesheets:i}=t.t(n);return r.length===0?{node:e.t({}),stylesheets:i}:r.length===1&&r[0]?{node:r[0],stylesheets:i}:{node:e.t({style:{width:e.a(100),height:e.a(100)},children:r}),stylesheets:i}}exports.fromHtml=n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./helpers-cmaAH67r.cjs`),t=require(`./markup-D15Z5Nl8.cjs`);function n(n){let{nodes:r,stylesheets:i}=t.t(n);return r.length===0?{node:e.t({}),stylesheets:i}:r.length===1&&r[0]?{node:r[0],stylesheets:i}:{node:e.t({style:{width:e.a(100),height:e.a(100)},children:r}),stylesheets:i}}exports.fromHtml=n;
package/dist/html.mjs CHANGED
@@ -1 +1 @@
1
- import{a as e,t}from"./helpers-6Yvy3K-3.mjs";import{t as n}from"./markup-KH2xSwwo.mjs";function r(r){let{nodes:i,stylesheets:a}=n(r);return i.length===0?{node:t({}),stylesheets:a}:i.length===1&&i[0]?{node:i[0],stylesheets:a}:{node:t({style:{width:e(100),height:e(100)},children:i}),stylesheets:a}}export{r as fromHtml};
1
+ import{a as e,t}from"./helpers-6Yvy3K-3.mjs";import{t as n}from"./markup-BiIG5JtU.mjs";function r(r){let{nodes:i,stylesheets:a}=n(r);return i.length===0?{node:t({}),stylesheets:a}:i.length===1&&i[0]?{node:i[0],stylesheets:a}:{node:t({style:{width:e(100),height:e(100)},children:i}),stylesheets:a}}export{r as fromHtml};
package/dist/jsx.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./helpers-cmaAH67r.cjs`),t=require(`./markup-BoHMcJO0.cjs`);function n(e){return typeof e==`string`||typeof e==`number`}function r(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function i(e){return Object.keys(e).map(t=>`${t.replace(/([A-Z])/g,`-$1`).toLowerCase()}:${String(e[t]).trim()}`).join(`;`)}const a=new Set(`stopColor.stopOpacity.strokeWidth.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.fillRule.clipRule.colorInterpolationFilters.floodColor.floodOpacity.accentHeight.alignmentBaseline.arabicForm.baselineShift.capHeight.clipPath.clipPathUnits.colorInterpolation.colorProfile.colorRendering.enableBackground.fillOpacity.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.horizAdvX.horizOriginX.imageRendering.letterSpacing.lightingColor.markerEnd.markerMid.markerStart.overlinePosition.overlineThickness.paintOrder.preserveAspectRatio.pointerEvents.shapeRendering.strokeMiterlimit.strokeOpacity.textAnchor.textDecoration.textRendering.transformOrigin.underlinePosition.underlineThickness.unicodeBidi.unicodeRange.unitsPerEm.vectorEffect.vertAdvY.vertOriginX.vertOriginY.vAlphabetic.vHanging.vIdeographic.vMathematical.wordSpacing.writingMode`.split(`.`));function o(e,n){if(e===`children`||n==null)return;let o;if(o=e===`className`?`class`:a.has(e)?t.n(e):e,typeof n==`boolean`)return`${o}="${String(n)}"`;if(e===`style`&&typeof n==`object`){let e=i(n);if(e)return`style="${r(e)}"`}return`${o}="${r(String(n))}"`}function s(e){return Object.entries(e).map(([e,t])=>o(e,t)).filter(e=>e!==void 0)}const c=(e,n)=>{let r=e.props||{};if(t.r(e.type))return l(e.type(e.props));if(typeof e.type==`symbol`||typeof e.type!=`string`)return``;let i=s(r),a=r.children,o=Array.isArray(a)?a.map(e=>n(e)).join(``):n(a);return`<${e.type}${i.length>0?` ${i.join(` `)}`:``}>${o}</${e.type}>`},l=e=>e==null||e===!1?``:n(e)?String(e):Array.isArray(e)?e.map(l).join(``):t.l(e)?c(e,l):``;function u(e){let t=e.props||{};return`xmlns`in t?l(e)||``:l({...e,props:{...t,xmlns:`http://www.w3.org/2000/svg`}})||``}const d=[/Invalid hook call\./,/Cannot read properties of null \(reading 'use[A-Z][A-Za-z]+'\)/,/null is not an object \(evaluating 'dispatcher\.use[A-Z][A-Za-z]+'\)/];let f,p;async function m(n,r){let i={defaultStyles:g(r),presets:t.d(r?.defaultStyles),tailwindClassesProperty:r?.tailwindClassesProperty??`tw`},a=await h(n,i).catch(async e=>{if(!v(e))throw e;return await D(n,i)||h(n,i)}),o=a.nodes,s;return s=o.length===0?e.t({}):o.length===1&&o[0]!==void 0?o[0]:e.t({children:o,style:{width:e.a(100),height:e.a(100)}}),{node:s,stylesheets:a.stylesheets}}async function h(n,r){return n==null||n===!1?{nodes:[],stylesheets:[]}:n instanceof Promise?h(await n,r):typeof n==`object`&&Symbol.iterator in n?z(n,r):t.l(n)?await M(n,r):{nodes:[e.l({text:String(n),preset:r.presets?.span})],stylesheets:[]}}function g(e){return e&&`defaultStyles`in e?e.defaultStyles??t.f:t.f}function _(e){return!t.l(e)||typeof e.type!=`object`||e.type===null||!(`$$typeof`in e.type)?!1:e.type.$$typeof===Symbol.for(`react.context`)||e.type.$$typeof===Symbol.for(`react.provider`)}function v(e){return e instanceof Error?d.some(t=>t.test(e.message)):!1}async function y(e){let t=console.error;console.error=(...e)=>{let[n]=e;typeof n==`string`&&d.some(e=>e.test(n))||t(...e)};try{return await e()}finally{console.error=t}}async function b(e,t,n){return y(()=>h(e(t),n))}function x(e,n){if(!(typeof e.type!=`object`||e.type===null)){if(t.o(e.type)&&`render`in e.type){let t=e.type;return b(e=>t.render(e,null),e.props,n)}if(t.c(e.type)&&`type`in e.type){let r=e.type.type;return t.r(r)?b(r,e.props,n):M({...e,type:r},n)}}}function S(e){if(typeof e.props==`object`&&e.props!==null&&`children`in e.props)return e.props.children}function C(e){return typeof e==`object`&&!!e&&`createElement`in e&&typeof e.createElement==`function`}function w(e){return typeof e==`object`&&!!e&&`renderToStaticMarkup`in e&&typeof e.renderToStaticMarkup==`function`}async function T(){return p??=import(`react`).then(e=>{let t=e.default??e;return C(t)?t:null}).catch(()=>null),p}async function E(){return f??=import(`react-dom/server`).then(e=>{let t=e.default??e;return w(t)?t:null}).catch(()=>null),f}async function D(e,n){let[r,i]=await Promise.all([T(),E()]);return!r||!i?null:t.t(i.renderToStaticMarkup(r.createElement(r.Fragment??void 0,null,e)),{defaultStyles:n.defaultStyles,tailwindClassesProperty:n.tailwindClassesProperty})}function O(e){if(!t.l(e))return;let n=S(e);if(typeof n==`string`)return n;if(typeof n==`number`)return String(n);if(Array.isArray(n)||typeof n==`object`&&n&&Symbol.iterator in n)return j(n);if(t.l(n)&&t.s(n))return O(n)}function k(e){let t=``;for(let n of e){let e=A(n);if(e===void 0)return;t+=e}return t}function A(e){if(typeof e==`string`)return e;if(typeof e==`number`)return String(e);if(e==null||typeof e==`boolean`||typeof e==`symbol`)return``;if(typeof e==`object`&&Symbol.iterator in e)return k(e);if(!t.l(e))return;if(t.s(e))return A(S(e));let n=S(e);return n===void 0?``:typeof n==`object`&&n&&Symbol.iterator in n?k(n):A(n)}function j(e){let n=``;for(let r of e){if(t.l(r))return;if(typeof r==`string`){n+=r;continue}if(typeof r==`number`){n+=String(r);continue}return}return n}async function M(n,r){if(_(n))return await D(n,r)||R(n,r);if(t.r(n.type))return b(n.type,n.props,r);let i=x(n,r);if(i!==void 0)return i;if(t.s(n))return R(n,r);if(t.i(n,`style`)){let e=A(S(n));return{nodes:[],stylesheets:e&&e.length>0?[e]:[]}}if(typeof n.type!=`string`||t.a(n.type))return{nodes:[],stylesheets:[]};let a=L(n,r);if(t.i(n,`br`))return{nodes:[e.l({text:`
2
- `,preset:r.presets?.span,...a})],stylesheets:[]};if(t.i(n,`img`))return{nodes:[N(n,r)],stylesheets:[]};if(t.i(n,`svg`))return{nodes:[P(n,r)],stylesheets:[]};let o=O(n);if(o!==void 0)return{nodes:[e.l({text:o,...a})],stylesheets:[]};let s=await R(n,r);return{nodes:[e.t({children:s.nodes,...a})],stylesheets:s.stylesheets}}function N(t,n){if(!t.props.src)throw Error(`Image element must have a 'src' prop.`);let r=L(t,n),i=t.props.width===void 0?void 0:Number(t.props.width),a=t.props.height===void 0?void 0:Number(t.props.height);return e.i({src:t.props.src,width:i,height:a,...r})}function P(t,n){let r=L(t,n);return e.i({src:u(t),width:t.props.width===void 0?void 0:Number(t.props.width),height:t.props.height===void 0?void 0:Number(t.props.height),...r})}function F(e,t){let n,r,i=t.presets;i&&typeof e.type==`string`&&e.type in i&&(n=i[e.type]);let a=typeof e.props==`object`&&e.props!==null&&`style`in e.props&&typeof e.props.style==`object`&&e.props.style!==null?e.props.style:void 0;if(a){for(let e in a)if(Object.hasOwn(a,e)){r=a;break}}return{preset:n,style:r}}function I(e,t){let n=t.tailwindClassesProperty;if(typeof e.props!=`object`||e.props===null||!(n in e.props))return;let r=e.props[n];if(typeof r==`string`)return r}function L(e,n){let r=e.props,{preset:i,style:a}=F(e,n),o=I(e,n),s=t.u(r,n.tailwindClassesProperty);return{tagName:typeof e.type==`string`?e.type:void 0,className:r.className??r.class,id:r.id,dir:r.dir,attributes:s,tw:o,style:a,preset:i}}function R(e,t){let n=S(e);return n===void 0?Promise.resolve({nodes:[],stylesheets:[]}):h(n,t)}async function z(e,t){let n=[],r=new Set,i=0;for(let a of e){let e=i;i+=1;let o=h(a,t).then(t=>{n[e]=t}).finally(()=>r.delete(o));r.add(o),r.size>=8&&await Promise.race(r)}await Promise.all(r);let a=[],o=[];for(let e of n)e&&(a.push(...e.nodes),o.push(...e.stylesheets));return{nodes:a,stylesheets:o}}exports.defaultStylePresets=t.f,exports.fromJsx=m;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./helpers-cmaAH67r.cjs`),t=require(`./markup-D15Z5Nl8.cjs`);function n(e){return typeof e==`string`||typeof e==`number`}function r(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function i(e){let n=[];for(let r in e)Object.hasOwn(e,r)&&n.push(`${t.n(r)}:${String(e[r]).trim()}`);return n.join(`;`)}const a=new Set(`stopColor.stopOpacity.strokeWidth.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.fillRule.clipRule.colorInterpolationFilters.floodColor.floodOpacity.accentHeight.alignmentBaseline.arabicForm.baselineShift.capHeight.clipPath.clipPathUnits.colorInterpolation.colorProfile.colorRendering.enableBackground.fillOpacity.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.horizAdvX.horizOriginX.imageRendering.letterSpacing.lightingColor.markerEnd.markerMid.markerStart.overlinePosition.overlineThickness.paintOrder.preserveAspectRatio.pointerEvents.shapeRendering.strokeMiterlimit.strokeOpacity.textAnchor.textDecoration.textRendering.transformOrigin.underlinePosition.underlineThickness.unicodeBidi.unicodeRange.unitsPerEm.vectorEffect.vertAdvY.vertOriginX.vertOriginY.vAlphabetic.vHanging.vIdeographic.vMathematical.wordSpacing.writingMode`.split(`.`));function o(e,n){if(e===`children`||n==null)return;let o;if(o=e===`className`?`class`:a.has(e)?t.n(e):e,typeof n==`boolean`)return`${o}="${String(n)}"`;if(e===`style`&&typeof n==`object`){let e=i(n);if(e)return`style="${r(e)}"`}return`${o}="${r(String(n))}"`}function s(e,t,n){let r=!1;for(let n in e){if(!Object.hasOwn(e,n))continue;let i=o(n,e[n]);i!==void 0&&(t.push(` `,i),n===`xmlns`&&(r=!0))}n&&!r&&t.push(` xmlns="http://www.w3.org/2000/svg"`)}const c=(e,n,r)=>{let i=e.props||{};if(t.r(e.type)){l(e.type(e.props),n,!1);return}if(typeof e.type==`symbol`||typeof e.type!=`string`)return;n.push(`<`,e.type),s(i,n,r&&e.type===`svg`);let a=i.children;n.push(`>`),l(a,n,!1),n.push(`</`,e.type,`>`)};function l(e,r,i){if(!(e==null||e===!1)){if(n(e)){r.push(String(e));return}if(Array.isArray(e)){for(let t of e)l(t,r,!1);return}t.l(e)&&c(e,r,i)}}function u(e){let t=[];return l(e,t,!0),t.join(``)}function d(){return{nodes:[],stylesheets:[]}}const f=[/Invalid hook call\./,/Cannot read properties of null \(reading 'use[A-Z][A-Za-z]+'\)/,/null is not an object \(evaluating 'dispatcher\.use[A-Z][A-Za-z]+'\)/];let p,m;async function h(n,r){let i={defaultStyles:_(r),presets:t.d(r?.defaultStyles),tailwindClassesProperty:r?.tailwindClassesProperty??`tw`},a=await g(n,i).catch(async e=>{if(!y(e))throw e;return await O(n,i)||g(n,i)}),o=a.nodes,s;return s=o.length===0?e.t({}):o.length===1&&o[0]!==void 0?o[0]:e.t({children:o,style:{width:e.a(100),height:e.a(100)}}),{node:s,stylesheets:a.stylesheets}}async function g(n,r){return n==null||n===!1?d():n instanceof Promise?g(await n,r):typeof n==`object`&&Symbol.iterator in n?B(n,r):t.l(n)?await N(n,r):{nodes:[e.l({text:String(n),preset:r.presets?.span})],stylesheets:[]}}function _(e){return e&&`defaultStyles`in e?e.defaultStyles??t.f:t.f}function v(e){return!t.l(e)||typeof e.type!=`object`||e.type===null||!(`$$typeof`in e.type)?!1:e.type.$$typeof===Symbol.for(`react.context`)||e.type.$$typeof===Symbol.for(`react.provider`)}function y(e){return e instanceof Error?f.some(t=>t.test(e.message)):!1}async function b(e){let t=console.error;console.error=(...e)=>{let[n]=e;typeof n==`string`&&f.some(e=>e.test(n))||t(...e)};try{return await e()}finally{console.error=t}}async function x(e,t,n){return b(()=>g(e(t),n))}function S(e,n){if(!(typeof e.type!=`object`||e.type===null)){if(t.o(e.type)&&`render`in e.type){let t=e.type;return x(e=>t.render(e,null),e.props,n)}if(t.c(e.type)&&`type`in e.type){let r=e.type.type;return t.r(r)?x(r,e.props,n):N({...e,type:r},n)}}}function C(e){if(typeof e.props==`object`&&e.props!==null&&`children`in e.props)return e.props.children}function w(e){return typeof e==`object`&&!!e&&`createElement`in e&&typeof e.createElement==`function`}function T(e){return typeof e==`object`&&!!e&&`renderToStaticMarkup`in e&&typeof e.renderToStaticMarkup==`function`}async function E(){return m??=import(`react`).then(e=>{let t=e.default??e;return w(t)?t:null}).catch(()=>null),m}async function D(){return p??=import(`react-dom/server`).then(e=>{let t=e.default??e;return T(t)?t:null}).catch(()=>null),p}async function O(e,n){let[r,i]=await Promise.all([E(),D()]);return!r||!i?null:t.t(i.renderToStaticMarkup(r.createElement(r.Fragment??void 0,null,e)),{defaultStyles:n.defaultStyles,tailwindClassesProperty:n.tailwindClassesProperty})}function k(e){if(!t.l(e))return;let n=C(e);if(typeof n==`string`)return n;if(typeof n==`number`)return String(n);if(Array.isArray(n)||typeof n==`object`&&n&&Symbol.iterator in n)return M(n);if(t.l(n)&&t.s(n))return k(n)}function A(e){let t=[];for(let n of e){let e=j(n);if(e===void 0)return;t.push(e)}return t.join(``)}function j(e){if(typeof e==`string`)return e;if(typeof e==`number`)return String(e);if(e==null||typeof e==`boolean`||typeof e==`symbol`)return``;if(typeof e==`object`&&Symbol.iterator in e)return A(e);if(!t.l(e))return;if(t.s(e))return j(C(e));let n=C(e);return n===void 0?``:typeof n==`object`&&n&&Symbol.iterator in n?A(n):j(n)}function M(e){let n=[];for(let r of e){if(t.l(r))return;if(typeof r==`string`){n.push(r);continue}if(typeof r==`number`){n.push(String(r));continue}return}return n.join(``)}async function N(n,r){if(v(n))return await O(n,r)||z(n,r);if(t.r(n.type))return x(n.type,n.props,r);let i=S(n,r);if(i!==void 0)return i;if(t.s(n))return z(n,r);if(t.i(n,`style`)){let e=j(C(n));return{nodes:[],stylesheets:e&&e.length>0?[e]:[]}}if(typeof n.type!=`string`||t.a(n.type))return d();let a=R(n,r);if(t.i(n,`br`))return{nodes:[e.l({text:`
2
+ `,preset:r.presets?.span,...a})],stylesheets:[]};if(t.i(n,`img`))return{nodes:[P(n,r)],stylesheets:[]};if(t.i(n,`svg`))return{nodes:[F(n,r)],stylesheets:[]};let o=k(n);if(o!==void 0)return{nodes:[e.l({text:o,...a})],stylesheets:[]};let s=await z(n,r);return{nodes:[e.t({children:s.nodes,...a})],stylesheets:s.stylesheets}}function P(t,n){if(!t.props.src)throw Error(`Image element must have a 'src' prop.`);let r=R(t,n),i=t.props.width===void 0?void 0:Number(t.props.width),a=t.props.height===void 0?void 0:Number(t.props.height);return e.i({src:t.props.src,width:i,height:a,...r})}function F(t,n){let r=R(t,n);return e.i({src:u(t),width:t.props.width===void 0?void 0:Number(t.props.width),height:t.props.height===void 0?void 0:Number(t.props.height),...r})}function I(e,t){let n=t.presets,r=n&&typeof e.type==`string`&&e.type in n?n[e.type]:void 0,i=typeof e.props==`object`&&e.props!==null&&`style`in e.props&&typeof e.props.style==`object`&&e.props.style!==null?e.props.style:void 0;if(!i)return{preset:r};for(let e in i)if(Object.hasOwn(i,e))return{preset:r,style:i};return{preset:r}}function L(e,t){let n=t.tailwindClassesProperty;if(typeof e.props!=`object`||e.props===null||!(n in e.props))return;let r=e.props[n];if(typeof r==`string`)return r}function R(e,n){let r=e.props,{preset:i,style:a}=I(e,n),o=L(e,n),s=t.u(r,n.tailwindClassesProperty);return{tagName:typeof e.type==`string`?e.type:void 0,className:r.className??r.class,id:r.id,dir:r.dir,attributes:s,tw:o,style:a,preset:i}}function z(e,t){let n=C(e);return n===void 0?Promise.resolve(d()):g(n,t)}async function B(e,t){let n=[],r=new Set,i=0;for(let a of e){let e=i;i+=1;let o=g(a,t).then(t=>{n[e]=t}).finally(()=>r.delete(o));r.add(o),r.size>=8&&await Promise.race(r)}await Promise.all(r);let a=[],o=[];for(let e of n)e&&(a.push(...e.nodes),o.push(...e.stylesheets));return{nodes:a,stylesheets:o}}exports.defaultStylePresets=t.f,exports.fromJsx=h;
package/dist/jsx.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{a as e,i as t,l as n,t as r}from"./helpers-6Yvy3K-3.mjs";import{a as i,c as a,d as o,f as s,i as c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./markup-KH2xSwwo.mjs";function g(e){return typeof e==`string`||typeof e==`number`}function _(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function v(e){return Object.keys(e).map(t=>`${t.replace(/([A-Z])/g,`-$1`).toLowerCase()}:${String(e[t]).trim()}`).join(`;`)}const y=new Set(`stopColor.stopOpacity.strokeWidth.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.fillRule.clipRule.colorInterpolationFilters.floodColor.floodOpacity.accentHeight.alignmentBaseline.arabicForm.baselineShift.capHeight.clipPath.clipPathUnits.colorInterpolation.colorProfile.colorRendering.enableBackground.fillOpacity.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.horizAdvX.horizOriginX.imageRendering.letterSpacing.lightingColor.markerEnd.markerMid.markerStart.overlinePosition.overlineThickness.paintOrder.preserveAspectRatio.pointerEvents.shapeRendering.strokeMiterlimit.strokeOpacity.textAnchor.textDecoration.textRendering.transformOrigin.underlinePosition.underlineThickness.unicodeBidi.unicodeRange.unitsPerEm.vectorEffect.vertAdvY.vertOriginX.vertOriginY.vAlphabetic.vHanging.vIdeographic.vMathematical.wordSpacing.writingMode`.split(`.`));function b(e,t){if(e===`children`||t==null)return;let n;if(n=e===`className`?`class`:y.has(e)?u(e):e,typeof t==`boolean`)return`${n}="${String(t)}"`;if(e===`style`&&typeof t==`object`){let e=v(t);if(e)return`style="${_(e)}"`}return`${n}="${_(String(t))}"`}function x(e){return Object.entries(e).map(([e,t])=>b(e,t)).filter(e=>e!==void 0)}const S=(e,t)=>{let n=e.props||{};if(f(e.type))return C(e.type(e.props));if(typeof e.type==`symbol`||typeof e.type!=`string`)return``;let r=x(n),i=n.children,a=Array.isArray(i)?i.map(e=>t(e)).join(``):t(i);return`<${e.type}${r.length>0?` ${r.join(` `)}`:``}>${a}</${e.type}>`},C=e=>e==null||e===!1?``:g(e)?String(e):Array.isArray(e)?e.map(C).join(``):l(e)?S(e,C):``;function w(e){let t=e.props||{};return`xmlns`in t?C(e)||``:C({...e,props:{...t,xmlns:`http://www.w3.org/2000/svg`}})||``}const T=[/Invalid hook call\./,/Cannot read properties of null \(reading 'use[A-Z][A-Za-z]+'\)/,/null is not an object \(evaluating 'dispatcher\.use[A-Z][A-Za-z]+'\)/];let E,D;async function O(t,n){let i={defaultStyles:A(n),presets:o(n?.defaultStyles),tailwindClassesProperty:n?.tailwindClassesProperty??`tw`},a=await k(t,i).catch(async e=>{if(!M(e))throw e;return await V(t,i)||k(t,i)}),s=a.nodes,c;return c=s.length===0?r({}):s.length===1&&s[0]!==void 0?s[0]:r({children:s,style:{width:e(100),height:e(100)}}),{node:c,stylesheets:a.stylesheets}}async function k(e,t){return e==null||e===!1?{nodes:[],stylesheets:[]}:e instanceof Promise?k(await e,t):typeof e==`object`&&Symbol.iterator in e?$(e,t):l(e)?await K(e,t):{nodes:[n({text:String(e),preset:t.presets?.span})],stylesheets:[]}}function A(e){return e&&`defaultStyles`in e?e.defaultStyles??s:s}function j(e){return!l(e)||typeof e.type!=`object`||e.type===null||!(`$$typeof`in e.type)?!1:e.type.$$typeof===Symbol.for(`react.context`)||e.type.$$typeof===Symbol.for(`react.provider`)}function M(e){return e instanceof Error?T.some(t=>t.test(e.message)):!1}async function N(e){let t=console.error;console.error=(...e)=>{let[n]=e;typeof n==`string`&&T.some(e=>e.test(n))||t(...e)};try{return await e()}finally{console.error=t}}async function P(e,t,n){return N(()=>k(e(t),n))}function F(e,t){if(!(typeof e.type!=`object`||e.type===null)){if(d(e.type)&&`render`in e.type){let n=e.type;return P(e=>n.render(e,null),e.props,t)}if(a(e.type)&&`type`in e.type){let n=e.type.type;return f(n)?P(n,e.props,t):K({...e,type:n},t)}}}function I(e){if(typeof e.props==`object`&&e.props!==null&&`children`in e.props)return e.props.children}function L(e){return typeof e==`object`&&!!e&&`createElement`in e&&typeof e.createElement==`function`}function R(e){return typeof e==`object`&&!!e&&`renderToStaticMarkup`in e&&typeof e.renderToStaticMarkup==`function`}async function z(){return D??=import(`react`).then(e=>{let t=e.default??e;return L(t)?t:null}).catch(()=>null),D}async function B(){return E??=import(`react-dom/server`).then(e=>{let t=e.default??e;return R(t)?t:null}).catch(()=>null),E}async function V(e,t){let[n,r]=await Promise.all([z(),B()]);return!n||!r?null:m(r.renderToStaticMarkup(n.createElement(n.Fragment??void 0,null,e)),{defaultStyles:t.defaultStyles,tailwindClassesProperty:t.tailwindClassesProperty})}function H(e){if(!l(e))return;let t=I(e);if(typeof t==`string`)return t;if(typeof t==`number`)return String(t);if(Array.isArray(t)||typeof t==`object`&&t&&Symbol.iterator in t)return G(t);if(l(t)&&p(t))return H(t)}function U(e){let t=``;for(let n of e){let e=W(n);if(e===void 0)return;t+=e}return t}function W(e){if(typeof e==`string`)return e;if(typeof e==`number`)return String(e);if(e==null||typeof e==`boolean`||typeof e==`symbol`)return``;if(typeof e==`object`&&Symbol.iterator in e)return U(e);if(!l(e))return;if(p(e))return W(I(e));let t=I(e);return t===void 0?``:typeof t==`object`&&t&&Symbol.iterator in t?U(t):W(t)}function G(e){let t=``;for(let n of e){if(l(n))return;if(typeof n==`string`){t+=n;continue}if(typeof n==`number`){t+=String(n);continue}return}return t}async function K(e,t){if(j(e))return await V(e,t)||Q(e,t);if(f(e.type))return P(e.type,e.props,t);let a=F(e,t);if(a!==void 0)return a;if(p(e))return Q(e,t);if(c(e,`style`)){let t=W(I(e));return{nodes:[],stylesheets:t&&t.length>0?[t]:[]}}if(typeof e.type!=`string`||i(e.type))return{nodes:[],stylesheets:[]};let o=Z(e,t);if(c(e,`br`))return{nodes:[n({text:`
2
- `,preset:t.presets?.span,...o})],stylesheets:[]};if(c(e,`img`))return{nodes:[q(e,t)],stylesheets:[]};if(c(e,`svg`))return{nodes:[J(e,t)],stylesheets:[]};let s=H(e);if(s!==void 0)return{nodes:[n({text:s,...o})],stylesheets:[]};let l=await Q(e,t);return{nodes:[r({children:l.nodes,...o})],stylesheets:l.stylesheets}}function q(e,n){if(!e.props.src)throw Error(`Image element must have a 'src' prop.`);let r=Z(e,n),i=e.props.width===void 0?void 0:Number(e.props.width),a=e.props.height===void 0?void 0:Number(e.props.height);return t({src:e.props.src,width:i,height:a,...r})}function J(e,n){let r=Z(e,n);return t({src:w(e),width:e.props.width===void 0?void 0:Number(e.props.width),height:e.props.height===void 0?void 0:Number(e.props.height),...r})}function Y(e,t){let n,r,i=t.presets;i&&typeof e.type==`string`&&e.type in i&&(n=i[e.type]);let a=typeof e.props==`object`&&e.props!==null&&`style`in e.props&&typeof e.props.style==`object`&&e.props.style!==null?e.props.style:void 0;if(a){for(let e in a)if(Object.hasOwn(a,e)){r=a;break}}return{preset:n,style:r}}function X(e,t){let n=t.tailwindClassesProperty;if(typeof e.props!=`object`||e.props===null||!(n in e.props))return;let r=e.props[n];if(typeof r==`string`)return r}function Z(e,t){let n=e.props,{preset:r,style:i}=Y(e,t),a=X(e,t),o=h(n,t.tailwindClassesProperty);return{tagName:typeof e.type==`string`?e.type:void 0,className:n.className??n.class,id:n.id,dir:n.dir,attributes:o,tw:a,style:i,preset:r}}function Q(e,t){let n=I(e);return n===void 0?Promise.resolve({nodes:[],stylesheets:[]}):k(n,t)}async function $(e,t){let n=[],r=new Set,i=0;for(let a of e){let e=i;i+=1;let o=k(a,t).then(t=>{n[e]=t}).finally(()=>r.delete(o));r.add(o),r.size>=8&&await Promise.race(r)}await Promise.all(r);let a=[],o=[];for(let e of n)e&&(a.push(...e.nodes),o.push(...e.stylesheets));return{nodes:a,stylesheets:o}}export{s as defaultStylePresets,O as fromJsx};
1
+ import{a as e,i as t,l as n,t as r}from"./helpers-6Yvy3K-3.mjs";import{a as i,c as a,d as o,f as s,i as c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./markup-BiIG5JtU.mjs";function g(e){return typeof e==`string`||typeof e==`number`}function _(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function v(e){let t=[];for(let n in e)Object.hasOwn(e,n)&&t.push(`${u(n)}:${String(e[n]).trim()}`);return t.join(`;`)}const y=new Set(`stopColor.stopOpacity.strokeWidth.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.fillRule.clipRule.colorInterpolationFilters.floodColor.floodOpacity.accentHeight.alignmentBaseline.arabicForm.baselineShift.capHeight.clipPath.clipPathUnits.colorInterpolation.colorProfile.colorRendering.enableBackground.fillOpacity.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.horizAdvX.horizOriginX.imageRendering.letterSpacing.lightingColor.markerEnd.markerMid.markerStart.overlinePosition.overlineThickness.paintOrder.preserveAspectRatio.pointerEvents.shapeRendering.strokeMiterlimit.strokeOpacity.textAnchor.textDecoration.textRendering.transformOrigin.underlinePosition.underlineThickness.unicodeBidi.unicodeRange.unitsPerEm.vectorEffect.vertAdvY.vertOriginX.vertOriginY.vAlphabetic.vHanging.vIdeographic.vMathematical.wordSpacing.writingMode`.split(`.`));function b(e,t){if(e===`children`||t==null)return;let n;if(n=e===`className`?`class`:y.has(e)?u(e):e,typeof t==`boolean`)return`${n}="${String(t)}"`;if(e===`style`&&typeof t==`object`){let e=v(t);if(e)return`style="${_(e)}"`}return`${n}="${_(String(t))}"`}function x(e,t,n){let r=!1;for(let n in e){if(!Object.hasOwn(e,n))continue;let i=b(n,e[n]);i!==void 0&&(t.push(` `,i),n===`xmlns`&&(r=!0))}n&&!r&&t.push(` xmlns="http://www.w3.org/2000/svg"`)}const S=(e,t,n)=>{let r=e.props||{};if(f(e.type)){C(e.type(e.props),t,!1);return}if(typeof e.type==`symbol`||typeof e.type!=`string`)return;t.push(`<`,e.type),x(r,t,n&&e.type===`svg`);let i=r.children;t.push(`>`),C(i,t,!1),t.push(`</`,e.type,`>`)};function C(e,t,n){if(!(e==null||e===!1)){if(g(e)){t.push(String(e));return}if(Array.isArray(e)){for(let n of e)C(n,t,!1);return}l(e)&&S(e,t,n)}}function w(e){let t=[];return C(e,t,!0),t.join(``)}function T(){return{nodes:[],stylesheets:[]}}const E=[/Invalid hook call\./,/Cannot read properties of null \(reading 'use[A-Z][A-Za-z]+'\)/,/null is not an object \(evaluating 'dispatcher\.use[A-Z][A-Za-z]+'\)/];let D,O;async function k(t,n){let i={defaultStyles:j(n),presets:o(n?.defaultStyles),tailwindClassesProperty:n?.tailwindClassesProperty??`tw`},a=await A(t,i).catch(async e=>{if(!N(e))throw e;return await H(t,i)||A(t,i)}),s=a.nodes,c;return c=s.length===0?r({}):s.length===1&&s[0]!==void 0?s[0]:r({children:s,style:{width:e(100),height:e(100)}}),{node:c,stylesheets:a.stylesheets}}async function A(e,t){return e==null||e===!1?T():e instanceof Promise?A(await e,t):typeof e==`object`&&Symbol.iterator in e?ee(e,t):l(e)?await q(e,t):{nodes:[n({text:String(e),preset:t.presets?.span})],stylesheets:[]}}function j(e){return e&&`defaultStyles`in e?e.defaultStyles??s:s}function M(e){return!l(e)||typeof e.type!=`object`||e.type===null||!(`$$typeof`in e.type)?!1:e.type.$$typeof===Symbol.for(`react.context`)||e.type.$$typeof===Symbol.for(`react.provider`)}function N(e){return e instanceof Error?E.some(t=>t.test(e.message)):!1}async function P(e){let t=console.error;console.error=(...e)=>{let[n]=e;typeof n==`string`&&E.some(e=>e.test(n))||t(...e)};try{return await e()}finally{console.error=t}}async function F(e,t,n){return P(()=>A(e(t),n))}function I(e,t){if(!(typeof e.type!=`object`||e.type===null)){if(d(e.type)&&`render`in e.type){let n=e.type;return F(e=>n.render(e,null),e.props,t)}if(a(e.type)&&`type`in e.type){let n=e.type.type;return f(n)?F(n,e.props,t):q({...e,type:n},t)}}}function L(e){if(typeof e.props==`object`&&e.props!==null&&`children`in e.props)return e.props.children}function R(e){return typeof e==`object`&&!!e&&`createElement`in e&&typeof e.createElement==`function`}function z(e){return typeof e==`object`&&!!e&&`renderToStaticMarkup`in e&&typeof e.renderToStaticMarkup==`function`}async function B(){return O??=import(`react`).then(e=>{let t=e.default??e;return R(t)?t:null}).catch(()=>null),O}async function V(){return D??=import(`react-dom/server`).then(e=>{let t=e.default??e;return z(t)?t:null}).catch(()=>null),D}async function H(e,t){let[n,r]=await Promise.all([B(),V()]);return!n||!r?null:m(r.renderToStaticMarkup(n.createElement(n.Fragment??void 0,null,e)),{defaultStyles:t.defaultStyles,tailwindClassesProperty:t.tailwindClassesProperty})}function U(e){if(!l(e))return;let t=L(e);if(typeof t==`string`)return t;if(typeof t==`number`)return String(t);if(Array.isArray(t)||typeof t==`object`&&t&&Symbol.iterator in t)return K(t);if(l(t)&&p(t))return U(t)}function W(e){let t=[];for(let n of e){let e=G(n);if(e===void 0)return;t.push(e)}return t.join(``)}function G(e){if(typeof e==`string`)return e;if(typeof e==`number`)return String(e);if(e==null||typeof e==`boolean`||typeof e==`symbol`)return``;if(typeof e==`object`&&Symbol.iterator in e)return W(e);if(!l(e))return;if(p(e))return G(L(e));let t=L(e);return t===void 0?``:typeof t==`object`&&t&&Symbol.iterator in t?W(t):G(t)}function K(e){let t=[];for(let n of e){if(l(n))return;if(typeof n==`string`){t.push(n);continue}if(typeof n==`number`){t.push(String(n));continue}return}return t.join(``)}async function q(e,t){if(M(e))return await H(e,t)||$(e,t);if(f(e.type))return F(e.type,e.props,t);let a=I(e,t);if(a!==void 0)return a;if(p(e))return $(e,t);if(c(e,`style`)){let t=G(L(e));return{nodes:[],stylesheets:t&&t.length>0?[t]:[]}}if(typeof e.type!=`string`||i(e.type))return T();let o=Q(e,t);if(c(e,`br`))return{nodes:[n({text:`
2
+ `,preset:t.presets?.span,...o})],stylesheets:[]};if(c(e,`img`))return{nodes:[J(e,t)],stylesheets:[]};if(c(e,`svg`))return{nodes:[Y(e,t)],stylesheets:[]};let s=U(e);if(s!==void 0)return{nodes:[n({text:s,...o})],stylesheets:[]};let l=await $(e,t);return{nodes:[r({children:l.nodes,...o})],stylesheets:l.stylesheets}}function J(e,n){if(!e.props.src)throw Error(`Image element must have a 'src' prop.`);let r=Q(e,n),i=e.props.width===void 0?void 0:Number(e.props.width),a=e.props.height===void 0?void 0:Number(e.props.height);return t({src:e.props.src,width:i,height:a,...r})}function Y(e,n){let r=Q(e,n);return t({src:w(e),width:e.props.width===void 0?void 0:Number(e.props.width),height:e.props.height===void 0?void 0:Number(e.props.height),...r})}function X(e,t){let n=t.presets,r=n&&typeof e.type==`string`&&e.type in n?n[e.type]:void 0,i=typeof e.props==`object`&&e.props!==null&&`style`in e.props&&typeof e.props.style==`object`&&e.props.style!==null?e.props.style:void 0;if(!i)return{preset:r};for(let e in i)if(Object.hasOwn(i,e))return{preset:r,style:i};return{preset:r}}function Z(e,t){let n=t.tailwindClassesProperty;if(typeof e.props!=`object`||e.props===null||!(n in e.props))return;let r=e.props[n];if(typeof r==`string`)return r}function Q(e,t){let n=e.props,{preset:r,style:i}=X(e,t),a=Z(e,t),o=h(n,t.tailwindClassesProperty);return{tagName:typeof e.type==`string`?e.type:void 0,className:n.className??n.class,id:n.id,dir:n.dir,attributes:o,tw:a,style:i,preset:r}}function $(e,t){let n=L(e);return n===void 0?Promise.resolve(T()):A(n,t)}async function ee(e,t){let n=[],r=new Set,i=0;for(let a of e){let e=i;i+=1;let o=A(a,t).then(t=>{n[e]=t}).finally(()=>r.delete(o));r.add(o),r.size>=8&&await Promise.race(r)}await Promise.all(r);let a=[],o=[];for(let e of n)e&&(a.push(...e.nodes),o.push(...e.stylesheets));return{nodes:a,stylesheets:o}}export{s as defaultStylePresets,k as fromJsx};
@@ -0,0 +1,2 @@
1
+ import{i as e,l as t,t as n}from"./helpers-6Yvy3K-3.mjs";const r={html:{display:`block`},head:{display:`none`},meta:{display:`none`},title:{display:`none`},link:{display:`none`},style:{display:`none`},script:{display:`none`},body:{margin:8,display:`block`},p:{marginTop:`1em`,marginBottom:`1em`,display:`block`},blockquote:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},center:{textAlign:`center`,display:`block`},hr:{marginTop:`0.5em`,marginBottom:`0.5em`,marginLeft:`auto`,marginRight:`auto`,borderWidth:1,display:`block`},h1:{fontSize:`2em`,marginTop:`0.67em`,marginBottom:`0.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h2:{fontSize:`1.5em`,marginTop:`0.83em`,marginBottom:`0.83em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h3:{fontSize:`1.17em`,marginTop:`1em`,marginBottom:`1em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h4:{marginTop:`1.33em`,marginBottom:`1.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h5:{fontSize:`0.83em`,marginTop:`1.67em`,marginBottom:`1.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h6:{fontSize:`0.67em`,marginTop:`2.33em`,marginBottom:`2.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},u:{textDecoration:`underline`},strong:{fontWeight:`bold`},b:{fontWeight:`bold`},i:{fontStyle:`italic`},em:{fontStyle:`italic`},code:{fontFamily:`monospace`},kbd:{fontFamily:`monospace`},pre:{fontFamily:`monospace`,margin:`1em 0`,display:`block`},mark:{backgroundColor:`yellow`,color:`black`},big:{fontSize:`1.2em`},small:{fontSize:`0.8em`},s:{textDecoration:`line-through`},div:{display:`block`}};function i(e){if(e!==!1)return e??r}function a(e,t){let n;for(let r in e){if(!Object.hasOwn(e,r))continue;let i=e[r];r===`children`||r===`className`||r===`class`||r===`id`||r===`style`||r===t||r===`ref`||r===`key`||r===`dangerouslySetInnerHTML`||r===`suppressHydrationWarning`||i==null||i===!1||typeof i==`function`||typeof i==`symbol`||typeof i!=`object`&&(n??={},n[r]=i===!0?``:String(i))}return n}var o=Symbol(`Fragment`),s=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),c=new Set([`script`,`style`]),l=/(?:<(\/?)([a-zA-Z][a-zA-Z0-9\:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<\!\-\-)([\s\S]*?)(\-\->)|(<\!)([\s\S]*?)(>))/gm,u=/[\@\.a-z0-9_\:\-]/i;function d(e){let t={};if(e){let n=`none`,r,i=``,a,o;for(let s=0;s<e.length;s++){let c=e[s];n===`none`?u.test(c)?(r&&(t[r]=i,r=void 0,i=``),a=s,n=`key`):c===`=`&&r&&(n=`value`):n===`key`?u.test(c)||(r=e.substring(a,s),n=c===`=`?`value`:`none`):c===o&&s>0&&e[s-1]!==`\\`?o&&(i=e.substring(a,s),o=void 0,n=`none`):(c===`"`||c===`'`)&&!o&&(a=s+1,o=c)}n===`key`&&a!=null&&a<e.length&&(r=e.substring(a,e.length)),r&&(t[r]=i)}return t}function f(e){let t=typeof e==`string`?e:e.value,n,r,i,a,o,u,f,p,m,h=[];l.lastIndex=0,r=n={type:0,children:[]};let g=0;function _(){a=t.substring(g,l.lastIndex-i[0].length),a&&r.children.push({type:2,value:a,parent:r})}for(;i=l.exec(t);){if(u=i[5]||i[8],f=i[6]||i[9],p=i[7]||i[10],c.has(r.name)&&i[2]!==r.name){o=l.lastIndex-i[0].length,r.children.length>0&&(r.children[0].value+=i[0]);continue}else if(u===`<!--`){if(o=l.lastIndex-i[0].length,c.has(r.name))continue;m={type:3,value:f,parent:r,loc:[{start:o,end:o+u.length},{start:l.lastIndex-p.length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m)}else if(u===`<!`)o=l.lastIndex-i[0].length,m={type:4,value:f,parent:r,loc:[{start:o,end:o+u.length},{start:l.lastIndex-p.length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m);else if(i[1]!==`/`)if(_(),c.has(r.name)){g=l.lastIndex,_();continue}else m={type:1,name:i[2]+``,attributes:d(i[3]),parent:r,children:[],loc:[{start:l.lastIndex-i[0].length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m),i[4]&&i[4].indexOf(`/`)>-1||s.has(m.name)?(m.loc[1]=m.loc[0],m.isSelfClosingTag=!0):r=m;else _(),i[2]+``===r.name?(m=r,r=m.parent,m.loc.push({start:l.lastIndex-i[0].length,end:l.lastIndex}),a=t.substring(m.loc[0].end,m.loc[1].start),m.children.length===0&&m.children.push({type:2,value:a,parent:r})):i[2]+``===h[h.length-1].name&&h[h.length-1].isSelfClosingTag===!0&&(m=h[h.length-1],m.loc.push({start:l.lastIndex-i[0].length,end:l.lastIndex}));g=l.lastIndex}return a=t.slice(g),r.children.push({type:2,value:a,parent:r}),n}var p=Symbol(`HTMLString`),m=Symbol(`AttrString`),h=Symbol(`RenderFn`);function g(e,t=[p]){let n={value:e};for(let e of t)Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!1});return n}var _={"&":`&amp;`,"<":`&lt;`,">":`&gt;`};function v(e){return e.replace(/[&<>]/g,e=>_[e]||e)}function y(e){let t=``;for(let[n,r]of Object.entries(e))t+=` ${n}="${r}"`;return g(t,[p,m])}function b(e){if(e.children.length===0){let t=e;for(;t=t.parent;)if(t.name===`svg`)return!0}return!1}function x(e){let{name:t,attributes:n={}}=e,r=e.children.map(e=>S(e)).join(``);if(h in e){let t=e[h](n,g(r));return t&&t[p]?t.value:v(String(t))}if(t===o)return r;let i=b(e);return i||s.has(t)?`<${e.name}${y(n).value}${i?` /`:``}>`:`<${e.name}${y(n).value}>${r}</${e.name}>`}function S(e){switch(e.type){case 0:return e.children.map(e=>S(e)).join(``);case 1:return x(e);case 2:return`${e.value}`;case 3:return`<!--${e.value}-->`;case 4:return`<!${e.value}>`}}const C=new Set([`head`,`meta`,`link`,`style`,`script`]);function w(e){return C.has(e)}function T(e,t){return e.type===t&&`props`in e}function E(e){return e.replace(/([A-Z])/g,`-$1`).toLowerCase()}function D(e){return typeof e==`object`&&!!e&&`type`in e}function O(e){return typeof e==`function`}const k=Symbol.for(`react.forward_ref`),A=Symbol.for(`react.memo`),j=Symbol.for(`react.fragment`);function M(e){return e.$$typeof===k}function N(e){return e.$$typeof===A}function P(e){return e.type===j}function F(e,t){let n=f(e),r={nodes:[],stylesheets:[]},a=i(t?.defaultStyles),o=t?.tailwindClassesProperty??`tw`;for(let e of n.children)I(e,a,o,r.nodes,r.stylesheets);return r}function I(r,i,a,o,s){if(r.type===3)return;if(r.type===2){let e=r.value??``;e&&o.push(t({text:e,preset:i?.span}));return}if(r.type===0){for(let e of r.children)I(e,i,a,o,s);return}if(r.type!==1)return;let c=r;if(c.name===`style`){let e=``;for(let t of c.children)t.type===2&&typeof t.value==`string`&&(e+=t.value);e&&s.push(e);return}let l=L(c,i,a);if(c.name===`br`){o.push(t({text:`
2
+ `,preset:i?.span,...l}));return}if(c.name===`img`){let t=c.attributes?.src;if(!t)throw Error(`Image element must have a 'src' prop.`);o.push(e({src:t,width:W(c.attributes?.width),height:W(c.attributes?.height),...l}));return}if(w(c.name))return;if(c.name===`svg`){o.push(e({src:S(c),width:W(c.attributes?.width),height:W(c.attributes?.height),...l}));return}let u=!0,d=``;for(let e of c.children)if(e.type!==3){if(e.type!==2){u=!1;break}d+=e.value??``}if(u&&d){o.push(t({text:d,...l}));return}let f=[];for(let e of c.children)I(e,i,a,f,s);o.push(n({children:f,...l}))}function L(e,t,n){let r=e.attributes?R(e.attributes):{},i=typeof r.style==`string`?H(r.style):void 0,o=a(r,n),s=typeof r[n]==`string`?r[n]:void 0,c=t&&e.name in t?t[e.name]:void 0;return{tagName:e.name,className:r.class,id:r.id,dir:r.dir,attributes:o,tw:s,style:i,preset:c}}function R(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=z(r))}return t}function z(e){return e.includes(`&`)?e.replace(/&(?:#(\d+)|#x([\da-fA-F]+)|([a-zA-Z][\w-]+));/g,(e,t,n,r)=>t?B(Number(t))??e:n?B(Number.parseInt(n,16))??e:V[r]??e):e}function B(e){if(!(!Number.isInteger(e)||e<0||e>1114111))try{return String.fromCodePoint(e)}catch{return}}const V={amp:`&`,apos:`'`,gt:`>`,lt:`<`,nbsp:`\xA0`,quot:`"`};function H(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[U(i)]=a)}return Object.keys(t).length>0?t:void 0}function U(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function W(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}export{w as a,N as c,i as d,r as f,T as i,D as l,E as n,M as o,O as r,P as s,F as t,a as u};
@@ -0,0 +1,2 @@
1
+ const e=require(`./helpers-cmaAH67r.cjs`),t={html:{display:`block`},head:{display:`none`},meta:{display:`none`},title:{display:`none`},link:{display:`none`},style:{display:`none`},script:{display:`none`},body:{margin:8,display:`block`},p:{marginTop:`1em`,marginBottom:`1em`,display:`block`},blockquote:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},center:{textAlign:`center`,display:`block`},hr:{marginTop:`0.5em`,marginBottom:`0.5em`,marginLeft:`auto`,marginRight:`auto`,borderWidth:1,display:`block`},h1:{fontSize:`2em`,marginTop:`0.67em`,marginBottom:`0.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h2:{fontSize:`1.5em`,marginTop:`0.83em`,marginBottom:`0.83em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h3:{fontSize:`1.17em`,marginTop:`1em`,marginBottom:`1em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h4:{marginTop:`1.33em`,marginBottom:`1.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h5:{fontSize:`0.83em`,marginTop:`1.67em`,marginBottom:`1.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h6:{fontSize:`0.67em`,marginTop:`2.33em`,marginBottom:`2.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},u:{textDecoration:`underline`},strong:{fontWeight:`bold`},b:{fontWeight:`bold`},i:{fontStyle:`italic`},em:{fontStyle:`italic`},code:{fontFamily:`monospace`},kbd:{fontFamily:`monospace`},pre:{fontFamily:`monospace`,margin:`1em 0`,display:`block`},mark:{backgroundColor:`yellow`,color:`black`},big:{fontSize:`1.2em`},small:{fontSize:`0.8em`},s:{textDecoration:`line-through`},div:{display:`block`}};function n(e){if(e!==!1)return e??t}function r(e,t){let n;for(let r in e){if(!Object.hasOwn(e,r))continue;let i=e[r];r===`children`||r===`className`||r===`class`||r===`id`||r===`style`||r===t||r===`ref`||r===`key`||r===`dangerouslySetInnerHTML`||r===`suppressHydrationWarning`||i==null||i===!1||typeof i==`function`||typeof i==`symbol`||typeof i!=`object`&&(n??={},n[r]=i===!0?``:String(i))}return n}var i=Symbol(`Fragment`),a=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),o=new Set([`script`,`style`]),s=/(?:<(\/?)([a-zA-Z][a-zA-Z0-9\:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<\!\-\-)([\s\S]*?)(\-\->)|(<\!)([\s\S]*?)(>))/gm,c=/[\@\.a-z0-9_\:\-]/i;function l(e){let t={};if(e){let n=`none`,r,i=``,a,o;for(let s=0;s<e.length;s++){let l=e[s];n===`none`?c.test(l)?(r&&(t[r]=i,r=void 0,i=``),a=s,n=`key`):l===`=`&&r&&(n=`value`):n===`key`?c.test(l)||(r=e.substring(a,s),n=l===`=`?`value`:`none`):l===o&&s>0&&e[s-1]!==`\\`?o&&(i=e.substring(a,s),o=void 0,n=`none`):(l===`"`||l===`'`)&&!o&&(a=s+1,o=l)}n===`key`&&a!=null&&a<e.length&&(r=e.substring(a,e.length)),r&&(t[r]=i)}return t}function u(e){let t=typeof e==`string`?e:e.value,n,r,i,c,u,d,f,p,m,h=[];s.lastIndex=0,r=n={type:0,children:[]};let g=0;function _(){c=t.substring(g,s.lastIndex-i[0].length),c&&r.children.push({type:2,value:c,parent:r})}for(;i=s.exec(t);){if(d=i[5]||i[8],f=i[6]||i[9],p=i[7]||i[10],o.has(r.name)&&i[2]!==r.name){u=s.lastIndex-i[0].length,r.children.length>0&&(r.children[0].value+=i[0]);continue}else if(d===`<!--`){if(u=s.lastIndex-i[0].length,o.has(r.name))continue;m={type:3,value:f,parent:r,loc:[{start:u,end:u+d.length},{start:s.lastIndex-p.length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m)}else if(d===`<!`)u=s.lastIndex-i[0].length,m={type:4,value:f,parent:r,loc:[{start:u,end:u+d.length},{start:s.lastIndex-p.length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m);else if(i[1]!==`/`)if(_(),o.has(r.name)){g=s.lastIndex,_();continue}else m={type:1,name:i[2]+``,attributes:l(i[3]),parent:r,children:[],loc:[{start:s.lastIndex-i[0].length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m),i[4]&&i[4].indexOf(`/`)>-1||a.has(m.name)?(m.loc[1]=m.loc[0],m.isSelfClosingTag=!0):r=m;else _(),i[2]+``===r.name?(m=r,r=m.parent,m.loc.push({start:s.lastIndex-i[0].length,end:s.lastIndex}),c=t.substring(m.loc[0].end,m.loc[1].start),m.children.length===0&&m.children.push({type:2,value:c,parent:r})):i[2]+``===h[h.length-1].name&&h[h.length-1].isSelfClosingTag===!0&&(m=h[h.length-1],m.loc.push({start:s.lastIndex-i[0].length,end:s.lastIndex}));g=s.lastIndex}return c=t.slice(g),r.children.push({type:2,value:c,parent:r}),n}var d=Symbol(`HTMLString`),f=Symbol(`AttrString`),p=Symbol(`RenderFn`);function m(e,t=[d]){let n={value:e};for(let e of t)Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!1});return n}var h={"&":`&amp;`,"<":`&lt;`,">":`&gt;`};function g(e){return e.replace(/[&<>]/g,e=>h[e]||e)}function _(e){let t=``;for(let[n,r]of Object.entries(e))t+=` ${n}="${r}"`;return m(t,[d,f])}function v(e){if(e.children.length===0){let t=e;for(;t=t.parent;)if(t.name===`svg`)return!0}return!1}function y(e){let{name:t,attributes:n={}}=e,r=e.children.map(e=>b(e)).join(``);if(p in e){let t=e[p](n,m(r));return t&&t[d]?t.value:g(String(t))}if(t===i)return r;let o=v(e);return o||a.has(t)?`<${e.name}${_(n).value}${o?` /`:``}>`:`<${e.name}${_(n).value}>${r}</${e.name}>`}function b(e){switch(e.type){case 0:return e.children.map(e=>b(e)).join(``);case 1:return y(e);case 2:return`${e.value}`;case 3:return`<!--${e.value}-->`;case 4:return`<!${e.value}>`}}const x=new Set([`head`,`meta`,`link`,`style`,`script`]);function S(e){return x.has(e)}function C(e,t){return e.type===t&&`props`in e}function w(e){return e.replace(/([A-Z])/g,`-$1`).toLowerCase()}function T(e){return typeof e==`object`&&!!e&&`type`in e}function E(e){return typeof e==`function`}const D=Symbol.for(`react.forward_ref`),O=Symbol.for(`react.memo`),k=Symbol.for(`react.fragment`);function A(e){return e.$$typeof===D}function j(e){return e.$$typeof===O}function M(e){return e.type===k}function N(e,t){let r=u(e),i={nodes:[],stylesheets:[]},a=n(t?.defaultStyles),o=t?.tailwindClassesProperty??`tw`;for(let e of r.children)P(e,a,o,i.nodes,i.stylesheets);return i}function P(t,n,r,i,a){if(t.type===3)return;if(t.type===2){let r=t.value??``;r&&i.push(e.l({text:r,preset:n?.span}));return}if(t.type===0){for(let e of t.children)P(e,n,r,i,a);return}if(t.type!==1)return;let o=t;if(o.name===`style`){let e=``;for(let t of o.children)t.type===2&&typeof t.value==`string`&&(e+=t.value);e&&a.push(e);return}let s=F(o,n,r);if(o.name===`br`){i.push(e.l({text:`
2
+ `,preset:n?.span,...s}));return}if(o.name===`img`){let t=o.attributes?.src;if(!t)throw Error(`Image element must have a 'src' prop.`);i.push(e.i({src:t,width:H(o.attributes?.width),height:H(o.attributes?.height),...s}));return}if(S(o.name))return;if(o.name===`svg`){i.push(e.i({src:b(o),width:H(o.attributes?.width),height:H(o.attributes?.height),...s}));return}let c=!0,l=``;for(let e of o.children)if(e.type!==3){if(e.type!==2){c=!1;break}l+=e.value??``}if(c&&l){i.push(e.l({text:l,...s}));return}let u=[];for(let e of o.children)P(e,n,r,u,a);i.push(e.t({children:u,...s}))}function F(e,t,n){let i=e.attributes?I(e.attributes):{},a=typeof i.style==`string`?B(i.style):void 0,o=r(i,n),s=typeof i[n]==`string`?i[n]:void 0,c=t&&e.name in t?t[e.name]:void 0;return{tagName:e.name,className:i.class,id:i.id,dir:i.dir,attributes:o,tw:s,style:a,preset:c}}function I(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=L(r))}return t}function L(e){return e.includes(`&`)?e.replace(/&(?:#(\d+)|#x([\da-fA-F]+)|([a-zA-Z][\w-]+));/g,(e,t,n,r)=>t?R(Number(t))??e:n?R(Number.parseInt(n,16))??e:z[r]??e):e}function R(e){if(!(!Number.isInteger(e)||e<0||e>1114111))try{return String.fromCodePoint(e)}catch{return}}const z={amp:`&`,apos:`'`,gt:`>`,lt:`<`,nbsp:`\xA0`,quot:`"`};function B(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[V(i)]=a)}return Object.keys(t).length>0?t:void 0}function V(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function H(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return r}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takumi-rs/helpers",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "author": {
6
6
  "name": "Kane Wang",
@@ -1,2 +0,0 @@
1
- const e=require(`./helpers-cmaAH67r.cjs`),t={html:{display:`block`},head:{display:`none`},meta:{display:`none`},title:{display:`none`},link:{display:`none`},style:{display:`none`},script:{display:`none`},body:{margin:8,display:`block`},p:{marginTop:`1em`,marginBottom:`1em`,display:`block`},blockquote:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},center:{textAlign:`center`,display:`block`},hr:{marginTop:`0.5em`,marginBottom:`0.5em`,marginLeft:`auto`,marginRight:`auto`,borderWidth:1,display:`block`},h1:{fontSize:`2em`,marginTop:`0.67em`,marginBottom:`0.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h2:{fontSize:`1.5em`,marginTop:`0.83em`,marginBottom:`0.83em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h3:{fontSize:`1.17em`,marginTop:`1em`,marginBottom:`1em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h4:{marginTop:`1.33em`,marginBottom:`1.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h5:{fontSize:`0.83em`,marginTop:`1.67em`,marginBottom:`1.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h6:{fontSize:`0.67em`,marginTop:`2.33em`,marginBottom:`2.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},u:{textDecoration:`underline`},strong:{fontWeight:`bold`},b:{fontWeight:`bold`},i:{fontStyle:`italic`},em:{fontStyle:`italic`},code:{fontFamily:`monospace`},kbd:{fontFamily:`monospace`},pre:{fontFamily:`monospace`,margin:`1em 0`,display:`block`},mark:{backgroundColor:`yellow`,color:`black`},big:{fontSize:`1.2em`},small:{fontSize:`0.8em`},s:{textDecoration:`line-through`},div:{display:`block`}};function n(e){if(e!==!1)return e??t}function r(e,t){let n={};for(let[r,i]of Object.entries(e))r===`children`||r===`className`||r===`class`||r===`id`||r===`style`||r===t||r===`ref`||r===`key`||r===`dangerouslySetInnerHTML`||r===`suppressHydrationWarning`||i==null||i===!1||typeof i==`function`||typeof i==`symbol`||typeof i!=`object`&&(n[r]=i===!0?``:String(i));if(Object.keys(n).length!==0)return n}var i=Symbol(`Fragment`),a=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),o=new Set([`script`,`style`]),s=/(?:<(\/?)([a-zA-Z][a-zA-Z0-9\:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<\!\-\-)([\s\S]*?)(\-\->)|(<\!)([\s\S]*?)(>))/gm,c=/[\@\.a-z0-9_\:\-]/i;function l(e){let t={};if(e){let n=`none`,r,i=``,a,o;for(let s=0;s<e.length;s++){let l=e[s];n===`none`?c.test(l)?(r&&(t[r]=i,r=void 0,i=``),a=s,n=`key`):l===`=`&&r&&(n=`value`):n===`key`?c.test(l)||(r=e.substring(a,s),n=l===`=`?`value`:`none`):l===o&&s>0&&e[s-1]!==`\\`?o&&(i=e.substring(a,s),o=void 0,n=`none`):(l===`"`||l===`'`)&&!o&&(a=s+1,o=l)}n===`key`&&a!=null&&a<e.length&&(r=e.substring(a,e.length)),r&&(t[r]=i)}return t}function u(e){let t=typeof e==`string`?e:e.value,n,r,i,c,u,d,f,p,m,h=[];s.lastIndex=0,r=n={type:0,children:[]};let g=0;function _(){c=t.substring(g,s.lastIndex-i[0].length),c&&r.children.push({type:2,value:c,parent:r})}for(;i=s.exec(t);){if(d=i[5]||i[8],f=i[6]||i[9],p=i[7]||i[10],o.has(r.name)&&i[2]!==r.name){u=s.lastIndex-i[0].length,r.children.length>0&&(r.children[0].value+=i[0]);continue}else if(d===`<!--`){if(u=s.lastIndex-i[0].length,o.has(r.name))continue;m={type:3,value:f,parent:r,loc:[{start:u,end:u+d.length},{start:s.lastIndex-p.length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m)}else if(d===`<!`)u=s.lastIndex-i[0].length,m={type:4,value:f,parent:r,loc:[{start:u,end:u+d.length},{start:s.lastIndex-p.length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m);else if(i[1]!==`/`)if(_(),o.has(r.name)){g=s.lastIndex,_();continue}else m={type:1,name:i[2]+``,attributes:l(i[3]),parent:r,children:[],loc:[{start:s.lastIndex-i[0].length,end:s.lastIndex}]},h.push(m),m.parent.children.push(m),i[4]&&i[4].indexOf(`/`)>-1||a.has(m.name)?(m.loc[1]=m.loc[0],m.isSelfClosingTag=!0):r=m;else _(),i[2]+``===r.name?(m=r,r=m.parent,m.loc.push({start:s.lastIndex-i[0].length,end:s.lastIndex}),c=t.substring(m.loc[0].end,m.loc[1].start),m.children.length===0&&m.children.push({type:2,value:c,parent:r})):i[2]+``===h[h.length-1].name&&h[h.length-1].isSelfClosingTag===!0&&(m=h[h.length-1],m.loc.push({start:s.lastIndex-i[0].length,end:s.lastIndex}));g=s.lastIndex}return c=t.slice(g),r.children.push({type:2,value:c,parent:r}),n}var d=Symbol(`HTMLString`),f=Symbol(`AttrString`),p=Symbol(`RenderFn`);function m(e,t=[d]){let n={value:e};for(let e of t)Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!1});return n}var h={"&":`&amp;`,"<":`&lt;`,">":`&gt;`};function g(e){return e.replace(/[&<>]/g,e=>h[e]||e)}function _(e){let t=``;for(let[n,r]of Object.entries(e))t+=` ${n}="${r}"`;return m(t,[d,f])}function v(e){if(e.children.length===0){let t=e;for(;t=t.parent;)if(t.name===`svg`)return!0}return!1}function y(e){let{name:t,attributes:n={}}=e,r=e.children.map(e=>b(e)).join(``);if(p in e){let t=e[p](n,m(r));return t&&t[d]?t.value:g(String(t))}if(t===i)return r;let o=v(e);return o||a.has(t)?`<${e.name}${_(n).value}${o?` /`:``}>`:`<${e.name}${_(n).value}>${r}</${e.name}>`}function b(e){switch(e.type){case 0:return e.children.map(e=>b(e)).join(``);case 1:return y(e);case 2:return`${e.value}`;case 3:return`<!--${e.value}-->`;case 4:return`<!${e.value}>`}}const x=new Set([`head`,`meta`,`link`,`style`,`script`]);function S(e){return x.has(e)}function C(e,t){return e.type===t&&`props`in e}function w(e){return e.replace(/([A-Z])/g,`-$1`).toLowerCase()}function T(e){return typeof e==`object`&&!!e&&`type`in e}function E(e){return typeof e==`function`}const D=Symbol.for(`react.forward_ref`),O=Symbol.for(`react.memo`),k=Symbol.for(`react.fragment`);function A(e){return e.$$typeof===D}function j(e){return e.$$typeof===O}function M(e){return e.type===k}function N(e,t){let r=u(e),i=[],a=[],o=n(t?.defaultStyles),s=t?.tailwindClassesProperty??`tw`;for(let e of r.children){let t=P(e,o,s);i.push(...t.nodes),a.push(...t.stylesheets)}return{nodes:i,stylesheets:a}}function P(t,n,r){if(t.type===3)return{nodes:[],stylesheets:[]};if(t.type===2){let r=t.value??``;return{nodes:r?[e.l({text:r,preset:n?.span})]:[],stylesheets:[]}}if(t.type===0)return t.children.reduce((e,t)=>{let i=P(t,n,r);return e.nodes.push(...i.nodes),e.stylesheets.push(...i.stylesheets),e},{nodes:[],stylesheets:[]});if(t.type!==1)return{nodes:[],stylesheets:[]};let i=t;if(i.name===`style`){let e=i.children.filter(e=>e.type===2&&typeof e.value==`string`).map(e=>e.value).join(``);return{nodes:[],stylesheets:e?[e]:[]}}let a=F(i,n,r);if(i.name===`br`)return{nodes:[e.l({text:`
2
- `,preset:n?.span,...a})],stylesheets:[]};if(i.name===`img`){let t=i.attributes?.src;if(!t)throw Error(`Image element must have a 'src' prop.`);return{nodes:[e.i({src:t,width:R(i.attributes?.width),height:R(i.attributes?.height),...a})],stylesheets:[]}}if(S(i.name))return{nodes:[],stylesheets:[]};if(i.name===`svg`)return{nodes:[e.i({src:b(i),width:R(i.attributes?.width),height:R(i.attributes?.height),...a})],stylesheets:[]};let o=i.children.reduce((e,t)=>{let i=P(t,n,r);return e.nodes.push(...i.nodes),e.stylesheets.push(...i.stylesheets),e},{nodes:[],stylesheets:[]});return{nodes:[i.children.every(e=>e.type===2||e.type===3)&&o.nodes.length>0?e.l({text:o.nodes.map(e=>e.type===`text`?e.text:``).join(``),...a}):e.t({children:o.nodes,...a})],stylesheets:o.stylesheets}}function F(e,t,n){let i=e.attributes??{},a=typeof i.style==`string`?I(i.style):void 0,o=r(i,n),s=typeof i[n]==`string`?i[n]:void 0,c=t&&e.name in t?t[e.name]:void 0;return{tagName:e.name,className:i.class,id:i.id,dir:i.dir,attributes:o,tw:s,style:a,preset:c}}function I(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[L(i)]=a)}return Object.keys(t).length>0?t:void 0}function L(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function R(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return r}});
@@ -1,2 +0,0 @@
1
- import{i as e,l as t,t as n}from"./helpers-6Yvy3K-3.mjs";const r={html:{display:`block`},head:{display:`none`},meta:{display:`none`},title:{display:`none`},link:{display:`none`},style:{display:`none`},script:{display:`none`},body:{margin:8,display:`block`},p:{marginTop:`1em`,marginBottom:`1em`,display:`block`},blockquote:{marginTop:`1em`,marginBottom:`1em`,marginLeft:40,marginRight:40,display:`block`},center:{textAlign:`center`,display:`block`},hr:{marginTop:`0.5em`,marginBottom:`0.5em`,marginLeft:`auto`,marginRight:`auto`,borderWidth:1,display:`block`},h1:{fontSize:`2em`,marginTop:`0.67em`,marginBottom:`0.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h2:{fontSize:`1.5em`,marginTop:`0.83em`,marginBottom:`0.83em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h3:{fontSize:`1.17em`,marginTop:`1em`,marginBottom:`1em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h4:{marginTop:`1.33em`,marginBottom:`1.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h5:{fontSize:`0.83em`,marginTop:`1.67em`,marginBottom:`1.67em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},h6:{fontSize:`0.67em`,marginTop:`2.33em`,marginBottom:`2.33em`,marginLeft:0,marginRight:0,fontWeight:`bold`,display:`block`},u:{textDecoration:`underline`},strong:{fontWeight:`bold`},b:{fontWeight:`bold`},i:{fontStyle:`italic`},em:{fontStyle:`italic`},code:{fontFamily:`monospace`},kbd:{fontFamily:`monospace`},pre:{fontFamily:`monospace`,margin:`1em 0`,display:`block`},mark:{backgroundColor:`yellow`,color:`black`},big:{fontSize:`1.2em`},small:{fontSize:`0.8em`},s:{textDecoration:`line-through`},div:{display:`block`}};function i(e){if(e!==!1)return e??r}function a(e,t){let n={};for(let[r,i]of Object.entries(e))r===`children`||r===`className`||r===`class`||r===`id`||r===`style`||r===t||r===`ref`||r===`key`||r===`dangerouslySetInnerHTML`||r===`suppressHydrationWarning`||i==null||i===!1||typeof i==`function`||typeof i==`symbol`||typeof i!=`object`&&(n[r]=i===!0?``:String(i));if(Object.keys(n).length!==0)return n}var o=Symbol(`Fragment`),s=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),c=new Set([`script`,`style`]),l=/(?:<(\/?)([a-zA-Z][a-zA-Z0-9\:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<\!\-\-)([\s\S]*?)(\-\->)|(<\!)([\s\S]*?)(>))/gm,u=/[\@\.a-z0-9_\:\-]/i;function d(e){let t={};if(e){let n=`none`,r,i=``,a,o;for(let s=0;s<e.length;s++){let c=e[s];n===`none`?u.test(c)?(r&&(t[r]=i,r=void 0,i=``),a=s,n=`key`):c===`=`&&r&&(n=`value`):n===`key`?u.test(c)||(r=e.substring(a,s),n=c===`=`?`value`:`none`):c===o&&s>0&&e[s-1]!==`\\`?o&&(i=e.substring(a,s),o=void 0,n=`none`):(c===`"`||c===`'`)&&!o&&(a=s+1,o=c)}n===`key`&&a!=null&&a<e.length&&(r=e.substring(a,e.length)),r&&(t[r]=i)}return t}function f(e){let t=typeof e==`string`?e:e.value,n,r,i,a,o,u,f,p,m,h=[];l.lastIndex=0,r=n={type:0,children:[]};let g=0;function _(){a=t.substring(g,l.lastIndex-i[0].length),a&&r.children.push({type:2,value:a,parent:r})}for(;i=l.exec(t);){if(u=i[5]||i[8],f=i[6]||i[9],p=i[7]||i[10],c.has(r.name)&&i[2]!==r.name){o=l.lastIndex-i[0].length,r.children.length>0&&(r.children[0].value+=i[0]);continue}else if(u===`<!--`){if(o=l.lastIndex-i[0].length,c.has(r.name))continue;m={type:3,value:f,parent:r,loc:[{start:o,end:o+u.length},{start:l.lastIndex-p.length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m)}else if(u===`<!`)o=l.lastIndex-i[0].length,m={type:4,value:f,parent:r,loc:[{start:o,end:o+u.length},{start:l.lastIndex-p.length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m);else if(i[1]!==`/`)if(_(),c.has(r.name)){g=l.lastIndex,_();continue}else m={type:1,name:i[2]+``,attributes:d(i[3]),parent:r,children:[],loc:[{start:l.lastIndex-i[0].length,end:l.lastIndex}]},h.push(m),m.parent.children.push(m),i[4]&&i[4].indexOf(`/`)>-1||s.has(m.name)?(m.loc[1]=m.loc[0],m.isSelfClosingTag=!0):r=m;else _(),i[2]+``===r.name?(m=r,r=m.parent,m.loc.push({start:l.lastIndex-i[0].length,end:l.lastIndex}),a=t.substring(m.loc[0].end,m.loc[1].start),m.children.length===0&&m.children.push({type:2,value:a,parent:r})):i[2]+``===h[h.length-1].name&&h[h.length-1].isSelfClosingTag===!0&&(m=h[h.length-1],m.loc.push({start:l.lastIndex-i[0].length,end:l.lastIndex}));g=l.lastIndex}return a=t.slice(g),r.children.push({type:2,value:a,parent:r}),n}var p=Symbol(`HTMLString`),m=Symbol(`AttrString`),h=Symbol(`RenderFn`);function g(e,t=[p]){let n={value:e};for(let e of t)Object.defineProperty(n,e,{value:!0,enumerable:!1,writable:!1});return n}var _={"&":`&amp;`,"<":`&lt;`,">":`&gt;`};function v(e){return e.replace(/[&<>]/g,e=>_[e]||e)}function y(e){let t=``;for(let[n,r]of Object.entries(e))t+=` ${n}="${r}"`;return g(t,[p,m])}function b(e){if(e.children.length===0){let t=e;for(;t=t.parent;)if(t.name===`svg`)return!0}return!1}function x(e){let{name:t,attributes:n={}}=e,r=e.children.map(e=>S(e)).join(``);if(h in e){let t=e[h](n,g(r));return t&&t[p]?t.value:v(String(t))}if(t===o)return r;let i=b(e);return i||s.has(t)?`<${e.name}${y(n).value}${i?` /`:``}>`:`<${e.name}${y(n).value}>${r}</${e.name}>`}function S(e){switch(e.type){case 0:return e.children.map(e=>S(e)).join(``);case 1:return x(e);case 2:return`${e.value}`;case 3:return`<!--${e.value}-->`;case 4:return`<!${e.value}>`}}const C=new Set([`head`,`meta`,`link`,`style`,`script`]);function w(e){return C.has(e)}function T(e,t){return e.type===t&&`props`in e}function E(e){return e.replace(/([A-Z])/g,`-$1`).toLowerCase()}function D(e){return typeof e==`object`&&!!e&&`type`in e}function O(e){return typeof e==`function`}const k=Symbol.for(`react.forward_ref`),A=Symbol.for(`react.memo`),j=Symbol.for(`react.fragment`);function M(e){return e.$$typeof===k}function N(e){return e.$$typeof===A}function P(e){return e.type===j}function F(e,t){let n=f(e),r=[],a=[],o=i(t?.defaultStyles),s=t?.tailwindClassesProperty??`tw`;for(let e of n.children){let t=I(e,o,s);r.push(...t.nodes),a.push(...t.stylesheets)}return{nodes:r,stylesheets:a}}function I(r,i,a){if(r.type===3)return{nodes:[],stylesheets:[]};if(r.type===2){let e=r.value??``;return{nodes:e?[t({text:e,preset:i?.span})]:[],stylesheets:[]}}if(r.type===0)return r.children.reduce((e,t)=>{let n=I(t,i,a);return e.nodes.push(...n.nodes),e.stylesheets.push(...n.stylesheets),e},{nodes:[],stylesheets:[]});if(r.type!==1)return{nodes:[],stylesheets:[]};let o=r;if(o.name===`style`){let e=o.children.filter(e=>e.type===2&&typeof e.value==`string`).map(e=>e.value).join(``);return{nodes:[],stylesheets:e?[e]:[]}}let s=L(o,i,a);if(o.name===`br`)return{nodes:[t({text:`
2
- `,preset:i?.span,...s})],stylesheets:[]};if(o.name===`img`){let t=o.attributes?.src;if(!t)throw Error(`Image element must have a 'src' prop.`);return{nodes:[e({src:t,width:B(o.attributes?.width),height:B(o.attributes?.height),...s})],stylesheets:[]}}if(w(o.name))return{nodes:[],stylesheets:[]};if(o.name===`svg`)return{nodes:[e({src:S(o),width:B(o.attributes?.width),height:B(o.attributes?.height),...s})],stylesheets:[]};let c=o.children.reduce((e,t)=>{let n=I(t,i,a);return e.nodes.push(...n.nodes),e.stylesheets.push(...n.stylesheets),e},{nodes:[],stylesheets:[]});return{nodes:[o.children.every(e=>e.type===2||e.type===3)&&c.nodes.length>0?t({text:c.nodes.map(e=>e.type===`text`?e.text:``).join(``),...s}):n({children:c.nodes,...s})],stylesheets:c.stylesheets}}function L(e,t,n){let r=e.attributes??{},i=typeof r.style==`string`?R(r.style):void 0,o=a(r,n),s=typeof r[n]==`string`?r[n]:void 0,c=t&&e.name in t?t[e.name]:void 0;return{tagName:e.name,className:r.class,id:r.id,dir:r.dir,attributes:o,tw:s,style:i,preset:c}}function R(e){let t={};for(let n of e.split(`;`)){let[e,...r]=n.split(`:`);if(!e||r.length===0)continue;let i=e.trim(),a=r.join(`:`).trim();!i||!a||(t[z(i)]=a)}return Object.keys(t).length>0?t:void 0}function z(e){return e.startsWith(`--`)?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function B(e){if(!e)return;let t=Number(e);return Number.isFinite(t)?t:void 0}export{w as a,N as c,i as d,r as f,T as i,D as l,E as n,M as o,O as r,P as s,F as t,a as u};