@lytjs/renderer 3.2.1 → 4.0.1

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/dom.cjs ADDED
@@ -0,0 +1 @@
1
+ var M=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var me=(n,e)=>{for(var t in e)M(n,t,{get:e[t],enumerable:!0})},ve=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ye(e))!ue.call(n,r)&&r!==t&&M(n,r,{get:()=>e[r],enumerable:!(o=de(e,r))||o.enumerable});return n};var Ne=n=>ve(M({},"__esModule",{value:!0}),n);var Ie={};me(Ie,{Comment:()=>K,DOMRenderer:()=>C,Fragment:()=>P,PatchFlags:()=>x,PatchPropFlags:()=>X,ShapeFlags:()=>u,Text:()=>k,createInvoker:()=>z,createRenderer:()=>ee,domRenderer:()=>pe,getEventInvokers:()=>se,getEventKey:()=>G,getSVGPropName:()=>ie,isSVGElement:()=>_,normalizeEventName:()=>I,parseEventModifier:()=>B,patchAllProps:()=>T,patchClass:()=>v,patchDOMProp:()=>w,patchDOMProps:()=>re,patchElementProps:()=>fe,patchEvent:()=>L,patchEventOnElement:()=>le,patchProp:()=>y,patchStyle:()=>N,removeAllEventListeners:()=>D,removeDOMProp:()=>h,setDOMProp:()=>E});module.exports=Ne(Ie);var $=require("@lytjs/vdom");var u=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(u||{}),x=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(x||{}),P=Symbol("Fragment"),k=Symbol("Text"),K=Symbol("Comment");function m(n){return n.type===P}function R(n){return n.type===k}function V(n){return n.type===K}function F(n,e){return n.type===e.type&&n.key===e.key}function W(n){return Array.isArray(n.dynamicChildren)}function J(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function H(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function j(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&H(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function U(n,e,t,o,r,i){let{shapeFlag:s}=t;if(m(t)){he(n,e,t,o,r,i);return}if(R(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(V(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){Ee(n,e,t,o,r,i);return}if(s&6){ge(e,t,o,r,i);return}}function Ee(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];J(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&A(e,f,a,null,i),n.insert(o,a,r)}function A(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function he(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&A(e,s,o,a,i),t.el=a,t.anchor=a}function ge(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function Q(n,e,t,o){let{shapeFlag:r,children:i}=t;if(m(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function b(n,e){for(let t=0;t<e.length;t++)n(e[t])}var S=require("@lytjs/vdom");function O(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){U(n,Y(n,e),o,r,i,s);return}if(W(o)&&W(t)){xe(n,e,t,o,r,s);return}if(!F(t,o)){e(t,r),U(n,Y(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(m(o)){Ce(n,e,t,o,r,i,s);return}if(R(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(V(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){Le(n,e,t,o,s);return}if(a&6){Re(t,o,s);return}}function Y(n,e){return(t,o,r,i,s)=>{O(n,e,t,o,r,i,s)}}function Le(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:l,dynamicProps:f}=o;if(l&&l>0){if(l&1&&t.children!==o.children&&(i.textContent=o.children),l&2&&s.class!==a.class&&n.setClass(i,a.class),l&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],q=a[d];q!==c&&H(n,i,d,q,c)}l&16&&j(n,i,s,a)}else j(n,i,s,a);(!l||!(l&1))&&Z(n,e,t,o,i,null,r)}function Z(n,e,t,o,r,i,s){let a=t.shapeFlag,l=o.shapeFlag,f=t.children,p=o.children;if(l&8){a&16&&b(e,f),f!==p&&(r.textContent=p);return}if(l&16){a&16?Te(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),A(Y(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&b(e,f))}function Te(n,e,t,o,r,i,s){o.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?(0,S.patchKeyedChildren)(t,o,r,i,s,null,!1):(0,S.patchUnkeyedChildren)(t,o,r,i,s,null,!1)}function Ce(n,e,t,o,r,i,s){let a=t.children,l=o.children;Array.isArray(l)&&l.length>0?(Z(n,e,t,o,r,i,s),o.el=l[0].el,o.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):i):Array.isArray(a)&&a.length>0&&l===null?(b(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function xe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let l=0;l<a.length;l++)O(n,e,s[l],a[l],r,null,i)}function Re(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ee(n){function e(r,i){Q(n,e,r,i)}(0,$.registerDOMOperations)({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,l,f,p){o(null,r,i,s,a)},patch(r,i,s,a,l,f,p,d){o(r,i,s,a,l)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,l){O(n,e,r,i,s,a,l)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var ne={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},oe={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},Ve={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function E(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in oe){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=ne[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function h(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in oe){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=ne[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function te(n){return n.startsWith("on")||n.startsWith("@")}function re(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],l=e?e[s]:void 0;s==="key"||s==="ref"||a!==l&&(s==="class"?n.className=a==null?"":String(a):s==="style"?Ae(n,a,l):te(s)||E(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":te(s)||h(n,s))}}function Ae(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function _(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function ie(n){return Ve[n]||n}var be=/^(?:@|on)/;function I(n){return n.replace(be,"").toLowerCase()}function G(n){let e=I(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Se={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function B(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=Se[i];s&&(o[s]=!0)}return o}function z(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var g="_vei";function se(n){return n[g]||null}function L(n,e,t,o,r){let i=G(e),s=B(I(e)),a=s.name,l=n[g];l||(l=n[g]={});let f=l[i];if(t&&f)f.value=t;else if(t&&!f){let p=z(t);l[i]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),l[i]=void 0)}function D(n){let e=n[g];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[g]={}}}var X=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(X||{});function v(n,e,t){let o=ce(e);o!==t&&(n.className=o)}function ce(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ce(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function N(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function ae(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function le(n,e,t,o){L(n,"",e,t,o)}var Oe=new Set(["class","style","key","ref"]);function _e(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function w(n,e,t,o,r){if(!Oe.has(e)){if(e==="class"){v(n,t,o);return}if(e==="style"){N(n,t,o);return}if(_e(e)){L(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function y(n,e,t,o,r){w(n,e,t,o,r)}function T(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&y(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&y(n,r,null,e[r],o)}function fe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){T(n,r,i,o);return}if(s===-2){T(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&v(n,i.class,r.class),s&4&&r.style!==i.style&&N(n,i.style,r.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=r[f],d=i[f];d!==p&&y(n,f,d,p,o)}s&16&&T(n,r,i,o)}var C=class{createElement(e){return _(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){E(e,t,o)}removeAttribute(e,t){h(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){v(e,t,o)}setStyleWithOld(e,t,o){N(e,t,o)}setAttributeWithOld(e,t,o,r){y(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){D(e)}},pe=new C;
package/dist/dom.mjs ADDED
@@ -0,0 +1 @@
1
+ import{registerDOMOperations as de}from"@lytjs/vdom";var m=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(m||{}),S=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(S||{}),H=Symbol("Fragment"),j=Symbol("Text"),U=Symbol("Comment");function y(n){return n.type===H}function h(n){return n.type===j}function g(n){return n.type===U}function Y(n,e){return n.type===e.type&&n.key===e.key}function O(n){return Array.isArray(n.dynamicChildren)}function G(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function _(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function I(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&_(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function D(n,e,t,o,r,i){let{shapeFlag:s}=t;if(y(t)){oe(n,e,t,o,r,i);return}if(h(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(g(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){ne(n,e,t,o,r,i);return}if(s&6){re(e,t,o,r,i);return}}function ne(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];G(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&L(e,f,a,null,i),n.insert(o,a,r)}function L(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function oe(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&L(e,s,o,a,i),t.el=a,t.anchor=a}function re(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function B(n,e,t,o){let{shapeFlag:r,children:i}=t;if(y(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function T(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as ie,patchUnkeyedChildren as se}from"@lytjs/vdom";function C(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){D(n,M(n,e),o,r,i,s);return}if(O(o)&&O(t)){fe(n,e,t,o,r,s);return}if(!Y(t,o)){e(t,r),D(n,M(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(y(o)){le(n,e,t,o,r,i,s);return}if(h(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(g(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){ae(n,e,t,o,s);return}if(a&6){pe(t,o,s);return}}function M(n,e){return(t,o,r,i,s)=>{C(n,e,t,o,r,i,s)}}function ae(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:l,dynamicProps:f}=o;if(l&&l>0){if(l&1&&t.children!==o.children&&(i.textContent=o.children),l&2&&s.class!==a.class&&n.setClass(i,a.class),l&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],W=a[d];W!==c&&_(n,i,d,W,c)}l&16&&I(n,i,s,a)}else I(n,i,s,a);(!l||!(l&1))&&z(n,e,t,o,i,null,r)}function z(n,e,t,o,r,i,s){let a=t.shapeFlag,l=o.shapeFlag,f=t.children,p=o.children;if(l&8){a&16&&T(e,f),f!==p&&(r.textContent=p);return}if(l&16){a&16?ce(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),L(M(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&T(e,f))}function ce(n,e,t,o,r,i,s){o.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?ie(t,o,r,i,s,null,!1):se(t,o,r,i,s,null,!1)}function le(n,e,t,o,r,i,s){let a=t.children,l=o.children;Array.isArray(l)&&l.length>0?(z(n,e,t,o,r,i,s),o.el=l[0].el,o.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):i):Array.isArray(a)&&a.length>0&&l===null?(T(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function fe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let l=0;l<a.length;l++)C(n,e,s[l],a[l],r,null,i)}function pe(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ye(n){function e(r,i){B(n,e,r,i)}de({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,l,f,p){o(null,r,i,s,a)},patch(r,i,s,a,l,f,p,d){o(r,i,s,a,l)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,l){C(n,e,r,i,s,a,l)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var w={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},q={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},ue={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function x(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in q){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=w[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function R(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in q){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=w[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function X(n){return n.startsWith("on")||n.startsWith("@")}function me(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],l=e?e[s]:void 0;s==="key"||s==="ref"||a!==l&&(s==="class"?n.className=a==null?"":String(a):s==="style"?ve(n,a,l):X(s)||x(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":X(s)||R(n,s))}}function ve(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function P(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function Ne(n){return ue[n]||n}var Ee=/^(?:@|on)/;function k(n){return n.replace(Ee,"").toLowerCase()}function F(n){let e=k(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var he={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function J(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=he[i];s&&(o[s]=!0)}return o}function Q(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var v="_vei";function ge(n){return n[v]||null}function V(n,e,t,o,r){let i=F(e),s=J(k(e)),a=s.name,l=n[v];l||(l=n[v]={});let f=l[i];if(t&&f)f.value=t;else if(t&&!f){let p=Q(t);l[i]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),l[i]=void 0)}function K(n){let e=n[v];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[v]={}}}var $=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))($||{});function N(n,e,t){let o=ee(e);o!==t&&(n.className=o)}function ee(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ee(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function E(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function Z(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function Le(n,e,t,o){V(n,"",e,t,o)}var Te=new Set(["class","style","key","ref"]);function Ce(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function te(n,e,t,o,r){if(!Te.has(e)){if(e==="class"){N(n,t,o);return}if(e==="style"){E(n,t,o);return}if(Ce(e)){V(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function u(n,e,t,o,r){te(n,e,t,o,r)}function A(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&u(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&u(n,r,null,e[r],o)}function xe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){A(n,r,i,o);return}if(s===-2){A(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&N(n,i.class,r.class),s&4&&r.style!==i.style&&E(n,i.style,r.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=r[f],d=i[f];d!==p&&u(n,f,d,p,o)}s&16&&A(n,r,i,o)}var b=class{createElement(e){return P(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){x(e,t,o)}removeAttribute(e,t){R(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){N(e,t,o)}setStyleWithOld(e,t,o){E(e,t,o)}setAttributeWithOld(e,t,o,r){u(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){K(e)}},Re=new b;export{U as Comment,b as DOMRenderer,H as Fragment,S as PatchFlags,$ as PatchPropFlags,m as ShapeFlags,j as Text,Q as createInvoker,ye as createRenderer,Re as domRenderer,ge as getEventInvokers,F as getEventKey,Ne as getSVGPropName,P as isSVGElement,k as normalizeEventName,J as parseEventModifier,A as patchAllProps,N as patchClass,te as patchDOMProp,me as patchDOMProps,xe as patchElementProps,V as patchEvent,Le as patchEventOnElement,u as patchProp,E as patchStyle,K as removeAllEventListeners,R as removeDOMProp,x as setDOMProp};
package/dist/index.cjs CHANGED
@@ -1,8 +1 @@
1
- var Ne=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var Pt=Object.prototype.hasOwnProperty;var Dt=(n,e)=>{for(var t in e)Ne(n,t,{get:e[t],enumerable:!0})},Ft=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jt(e))!Pt.call(n,i)&&i!==t&&Ne(n,i,{get:()=>e[i],enumerable:!(r=It(e,i))||r.enumerable});return n};var Wt=n=>Ft(Ne({},"__esModule",{value:!0}),n);var kn={};Dt(kn,{Comment:()=>Te,DOMRenderer:()=>z,Fragment:()=>ve,MiniAppRenderer:()=>G,NativeRenderer:()=>k,PatchFlags:()=>q,PatchPropFlags:()=>Oe,ShapeFlags:()=>R,StringRenderer:()=>K,Text:()=>xe,bindAttr:()=>fe,bindClass:()=>de,bindEach:()=>ze,bindEvent:()=>ue,bindIf:()=>Be,bindProp:()=>U,bindText:()=>pe,clearIslandRegistry:()=>At,clearMismatchWarnings:()=>Rt,compileToVapor:()=>he,createHydrationIsland:()=>Vt,createInvoker:()=>Le,createRenderer:()=>Je,createVaporApp:()=>Ht,createVaporElement:()=>Ke,defineVaporComponent:()=>wt,domRenderer:()=>lt,getEventInvokers:()=>rt,getEventKey:()=>Ce,getHydrateStats:()=>ht,getIslandRegistry:()=>St,getMismatchWarnings:()=>Ct,getSVGPropName:()=>nt,getVaporDOMFactory:()=>j,hydrate:()=>vt,hydrateAllIslands:()=>Tt,hydrateIsland:()=>De,isHydrating:()=>mt,isSVGElement:()=>re,miniAppRenderer:()=>Ot,nativeRenderer:()=>Lt,normalizeEventName:()=>ie,onHydrated:()=>Nt,parseEventModifier:()=>Re,parseTemplate:()=>ge,patchAllProps:()=>B,patchClass:()=>O,patchDOMProp:()=>_e,patchDOMProps:()=>tt,patchElementProps:()=>at,patchEvent:()=>W,patchEventOnElement:()=>st,patchProp:()=>T,patchStyle:()=>_,registerIslandComponent:()=>bt,removeAllEventListeners:()=>oe,removeDOMProp:()=>D,renderToStream:()=>ft,renderToStreamGenerator:()=>dt,renderToString:()=>pt,renderVaporComponent:()=>$t,renderVaporNode:()=>v,resetHydrateStats:()=>je,setDOMProp:()=>P,setHydrating:()=>gt,setVaporDOMFactory:()=>Mt,ssrRenderer:()=>ut,unmountIsland:()=>Et,vaporMount:()=>me,vaporPatch:()=>ke});module.exports=Wt(kn);var qe=require("@lytjs/vdom");var R=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(R||{}),q=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(q||{}),ve=Symbol("Fragment"),xe=Symbol("Text"),Te=Symbol("Comment");function L(n){return n.type===ve}function J(n){return n.type===xe}function Z(n){return n.type===Te}function Ge(n,e){return n.type===e.type&&n.key===e.key}function be(n){return Array.isArray(n.dynamicChildren)}function Ue(n,e,t,r){if(t==="class")n.setClass(e,r);else if(t==="style")n.setStyle(e,r);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,i,r)}else t==="key"||t==="ref"||n.setAttribute(e,t,r)}function Ee(n,e,t,r,i){if(t==="class")n.setClass(e,r);else if(t==="style")n.setStyle(e,r||{});else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&n.removeEventListener(e,o,i),r&&n.addEventListener(e,o,r)}else n.setAttribute(e,t,r)}function Se(n,e,t,r){for(let i in r){if(i==="key"||i==="ref")continue;let o=t[i],s=r[i];s!==o&&Ee(n,e,i,s,o)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in r))if(i==="class")n.setClass(e,"");else if(i==="style")n.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let o=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();n.removeEventListener(e,o,t[i])}else n.removeAttribute(e,i)}function Ae(n,e,t,r,i,o){let{shapeFlag:s}=t;if(L(t)){zt(n,e,t,r,i,o);return}if(J(t)){let a=n.createText(t.children);t.el=a,n.insert(r,a,i);return}if(Z(t)){let a=n.createComment(t.children);t.el=a,n.insert(r,a,i);return}if(s&1){Bt(n,e,t,r,i,o);return}if(s&6){Kt(e,t,r,i,o);return}}function Bt(n,e,t,r,i,o){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];Ue(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&Q(e,f,a,null,o),n.insert(r,a,i)}function Q(n,e,t,r,i){for(let o=0;o<e.length;o++)n(null,e[o],t,r,i)}function zt(n,e,t,r,i,o){let{children:s}=t,a=n.createComment("");n.insert(r,a,i),Array.isArray(s)&&s.length>0&&Q(e,s,r,a,o),t.el=a,t.anchor=a}function Kt(n,e,t,r,i){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(n(null,o.subTree,t,r,o),e.el=o.subTree.el)}function Ye(n,e,t,r){let{shapeFlag:i,children:o}=t;if(L(t)){if(Array.isArray(o))for(let s=0;s<o.length;s++)e(o[s],r);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,r);return}t.el&&n.remove(t.el)}function ee(n,e){for(let t=0;t<e.length;t++)n(e[t])}var te=require("@lytjs/vdom");function ne(n,e,t,r,i,o=null,s=null){if(r==null){t&&e(t,i);return}if(t===null){Ae(n,Ve(n,e),r,i,o,s);return}if(be(r)&&be(t)){Yt(n,e,t,r,i,s);return}if(!Ge(t,r)){e(t,i),Ae(n,Ve(n,e),r,i,o,s);return}r.el=t.el,r.anchor=t.anchor;let{shapeFlag:a}=r;if(L(r)){Ut(n,e,t,r,i,o,s);return}if(J(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(Z(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(a&1){kt(n,e,t,r,s);return}if(a&6){Xt(t,r,s);return}}function Ve(n,e){return(t,r,i,o,s)=>{ne(n,e,t,r,i,o,s)}}function kt(n,e,t,r,i=null){let o=r.el=t.el,s=t.props||{},a=r.props||{},{patchFlag:l,dynamicProps:f}=r;if(l&&l>0){if(l&1&&t.children!==r.children&&(o.textContent=r.children),l&2&&s.class!==a.class&&n.setClass(o,a.class),l&4&&s.style!==a.style&&n.setStyle(o,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],u=a[d];u!==c&&Ee(n,o,d,u,c)}l&16&&Se(n,o,s,a)}else Se(n,o,s,a);(!l||!(l&1))&&Xe(n,e,t,r,o,null,i)}function Xe(n,e,t,r,i,o,s){let a=t.shapeFlag,l=r.shapeFlag,f=t.children,p=r.children;if(l&8){a&16&&ee(e,f),f!==p&&(i.textContent=p);return}if(l&16){a&16?Gt(n,e,f,p,i,o,s):(a&8&&(i.textContent=""),Q(Ve(n,e),p,i,o,s));return}p==null&&(a&8?i.textContent="":a&16&&ee(e,f))}function Gt(n,e,t,r,i,o,s){r.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?(0,te.patchKeyedChildren)(t,r,i,o,s,null,!1):(0,te.patchUnkeyedChildren)(t,r,i,o,s,null,!1)}function Ut(n,e,t,r,i,o,s){let a=t.children,l=r.children;Array.isArray(l)&&l.length>0?(Xe(n,e,t,r,i,o,s),r.el=l[0].el,r.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(ee(e,a),r.el=t.el,r.anchor=t.anchor):(r.el=t.el,r.anchor=t.anchor)}function Yt(n,e,t,r,i,o){let s=t.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)ne(n,e,s[l],a[l],i,null,o)}function Xt(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function Je(n){function e(i,o){Ye(n,e,i,o)}(0,qe.registerDOMOperations)({insert(i,o,s){n.insert(o,i,s)},createElement(i){return n.createElement(i)},createText(i){return n.createText(i)},setText(i,o){i.nodeValue=o},setElementText(i,o){i.textContent=o},remove(i){n.remove(i)},createComment(i){return n.createComment(i)},mount(i,o,s,a,l,f,p){r(null,i,o,s,a)},patch(i,o,s,a,l,f,p,d){r(i,o,s,a,l)},unmount(i,o,s,a){e(i)},move(i,o,s){n.insert(o,i.el,s)}});function r(i,o,s,a,l){ne(n,e,i,o,s,a,l)}return{mount(i,o){o.nodeType===1&&(o.textContent=""),r(null,i,o,null,null)},patch(i,o,s){var a;r(i,o,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,o){e(i,o)}}}var Qe={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},et={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},qt={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function P(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let i in t)n.style[i]=t[i];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let i=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(i,t);return}if(e in et){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let r=Qe[e]||e;if(r in n){try{n[r]=t==null?"":t}catch(i){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function D(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),i=n._vei;if(i){let o="on"+r.charAt(0).toUpperCase()+r.slice(1),s=i[o];s&&(n.removeEventListener(r,s),i[o]=void 0)}return}if(e in et){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=Qe[e]||e;if(t in n){try{n[t]=""}catch(r){n.removeAttribute(e)}return}n.removeAttribute(e)}function Ze(n){return n.startsWith("on")||n.startsWith("@")}function tt(n,e,t){let r=e?Object.keys(e):[],i=t?Object.keys(t):[];for(let o=0;o<i.length;o++){let s=i[o],a=t[s],l=e?e[s]:void 0;s==="key"||s==="ref"||a!==l&&(s==="class"?n.className=a==null?"":String(a):s==="style"?Jt(n,a,l):Ze(s)||P(n,s,a))}for(let o=0;o<r.length;o++){let s=r[o];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":Ze(s)||D(n,s))}}function Jt(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let r in t)r in e||(n.style[r]="");for(let r in e)n.style[r]=e[r]}function re(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function nt(n){return qt[n]||n}var Zt=/^(?:@|on)/;function ie(n){return n.replace(Zt,"").toLowerCase()}function Ce(n){let e=ie(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Qt={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function Re(n){let e=n.split("."),r={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let i=1;i<e.length;i++){let o=e[i],s=Qt[o];s&&(r[s]=!0)}return r}function Le(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var F="_vei";function rt(n){return n[F]||null}function W(n,e,t,r,i){let o=Ce(e),s=Re(ie(e)),a=s.name,l=n[F];l||(l=n[F]={});let f=l[o];if(t&&f)f.value=t;else if(t&&!f){let p=Le(t);l[o]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),l[o]=void 0)}function oe(n){let e=n[F];if(e){for(let t in e){let r=e[t];if(r){let i=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(i,r)}}n[F]={}}}var Oe=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(Oe||{});function O(n,e,t){let r=ot(e);r!==t&&(n.className=r)}function ot(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let r=0;r<n.length;r++){let i=ot(n[r]);i&&(t+=(t?" ":"")+i)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function _(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&it(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&it(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let r in t)r in e||(n.style[r]="");for(let r in e){let i=e[r],o=t[r];i!==o&&(n.style[r]=i==null?"":i)}}}function it(n,e){for(let t in e)n.style[t]=e[t]==null?"":e[t]}function st(n,e,t,r){W(n,"",e,t,r)}var en=new Set(["class","style","key","ref"]);function tn(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function _e(n,e,t,r,i){if(!en.has(e)){if(e==="class"){O(n,t,r);return}if(e==="style"){_(n,t,r);return}if(tn(e)){W(n,e,t,r,i);return}if(t===!1||t==null){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(o){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function T(n,e,t,r,i){_e(n,e,t,r,i)}function B(n,e,t,r){if(t)for(let i in t){if(i==="key"||i==="ref")continue;let o=t[i],s=e?e[i]:void 0;o!==s&&T(n,i,o,s,r)}if(e)for(let i in e)i==="key"||i==="ref"||(!t||!(i in t))&&T(n,i,null,e[i],r)}function at(n,e,t,r){let i=e.props||{},o=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){B(n,i,o,r);return}if(s===-2){B(n,i,o,r);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&i.class!==o.class&&O(n,o.class,i.class),s&4&&i.style!==o.style&&_(n,o.style,i.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=i[f],d=o[f];d!==p&&T(n,f,d,p,r)}s&16&&B(n,i,o,r)}var z=class{createElement(e){return re(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,r){P(e,t,r)}removeAttribute(e,t){D(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let r in t)e.style[r]=t[r]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let r="";for(let i in t)t[i]&&(r+=(r?" ":"")+i);e.className=r}else e.className=""}insert(e,t,r){r!=null?e.insertBefore(t,r):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,r){e.replaceChild(r,t)}addEventListener(e,t,r,i){e.addEventListener(t,r,i)}removeEventListener(e,t,r){e.removeEventListener(t,r)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,r){O(e,t,r)}setStyleWithOld(e,t,r){_(e,t,r)}setAttributeWithOld(e,t,r,i){T(e,t,r,i)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,r){r!=null?e.insertBefore(t,r):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){oe(e)}},lt=new z;var Me=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),nn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},rn=/[&<>"']/g,x={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},on=0;function y(n){return n.replace(rn,e=>nn[e])}function sn(n,e){return n.startsWith("on")||n.startsWith("@")||n==="key"||n==="ref"||n==="__vccOpts"||n.startsWith("__")?"":e===!0?n:e===!1||e==null?"":n==="class"?`class="${y(ct(e))}"`:n==="style"?`style="${y(an(e))}"`:n==="dangerouslySetInnerHTML"||n==="innerHTML"?"":`${n}="${y(String(e))}"`}function ct(n){if(!n)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(ct).filter(Boolean).join(" ");if(typeof n=="object"){let e=[];for(let t in n)n[t]&&e.push(t);return e.join(" ")}return String(n)}function an(n){if(!n)return"";if(typeof n=="string")return n;if(typeof n=="object"){let e=[];for(let t in n)if(n[t]){let r=t.replace(/([A-Z])/g,"-$1").toLowerCase();e.push(`${r}: ${n[t]}`)}return e.join("; ")}return String(n)}function we(n){if(!n)return"";let e=[];for(let t in n){let r=n[t],i=sn(t,r);i&&e.push(i)}return e.length>0?" "+e.join(" "):""}var K=class{createElement(e){return{tag:e,props:{},children:[]}}createText(e){return{type:"text",value:e}}createComment(e){return{type:"comment",value:e}}insert(e,t,r){e.children.push(t)}renderToString(e){return g(e)}async*renderToStream(e){yield*se(e)}};function g(n){if(n==null)return"";let{type:e,props:t,children:r}=n;return typeof e=="symbol"&&String(e)==="Symbol(Fragment)"?Array.isArray(r)?r.map(i=>g(i)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?y(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?ln(e,t,r,n):typeof e=="object"&&e!==null||typeof e=="function"?M(n):""}function ln(n,e,t,r){let i=we(e);if(Me.has(n))return`<${n}${i} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${n}${i}>${a}</${n}>`}let o="",s=r.shapeFlag||0;return s&x.TEXT_CHILDREN?o=y(String(t||"")):s&x.ARRAY_CHILDREN&&Array.isArray(t)?o=t.map(a=>g(a)).join(""):s&x.SLOTS_CHILDREN&&typeof t=="object"&&t!==null?o=He(t):typeof t=="string"?o=y(t):Array.isArray(t)?o=t.map(a=>g(a)).join(""):typeof t=="number"&&(o=y(String(t))),`<${n}${i}>${o}</${n}>`}function He(n){let e=[];for(let t in n){let r=n[t];if(typeof r=="function"){let i=r();Array.isArray(i)?e.push(i.map(o=>g(o)).join("")):i!=null&&e.push(g(i))}else Array.isArray(r)?e.push(r.map(i=>g(i)).join("")):r!=null&&e.push(g(r))}return e.join("")}function M(n){let e=n.type;if(e&&e.__island)return cn(n,e);if(typeof e=="function"){let t=e(n.props||{},{slots:n.children||{}});return g(t)}if(typeof e=="object"&&e!==null){if(typeof e.render=="function"){let t=e.render(n.props||{},{slots:n.children||{},emit:()=>{}});return g(t)}if(typeof e.setup=="function"){let t=e.setup(n.props||{},{emit:()=>{},slots:n.children||{}});if(typeof t=="function"){let r=t();return g(r)}if(typeof e.render=="function"){let r=e.render(t||{},{slots:n.children||{},emit:()=>{}});return g(r)}}}return n.component&&n.component.subTree?g(n.component.subTree):"<!---->"}function cn(n,e){var u;let t=e.name||((u=n.props)==null?void 0:u["data-island-id"])||"anonymous",r=n.props||{},i=r["data-hydrate-when"]||e.__hydrateWhen||"",o=e.__islandTag||"div",s={};for(let m in r)m==="data-hydrate-when"||m==="data-island-id"||(s[m]=r[m]);let a=JSON.stringify(s),l=y(a),f="";if(typeof e.render=="function"){let m=e.render(r,{slots:n.children||{},emit:()=>{}});f=g(m)}else if(typeof e=="function"){let m=e(r,{slots:n.children||{}});f=g(m)}let p=i?` data-hydrate-when="${y(i)}"`:"",d=`<${o} data-hydrate="${y(t)}" data-props="${l}"${p}>${f}</${o}>`,c=`<script type="application/json" data-hydrate-props="${y(t)}">${a}<\/script>`;return d+c}async function*se(n){if(n==null)return;let{type:e,props:t,children:r}=n;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)"){if(Array.isArray(r))for(let i of r)yield*se(i);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield y(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*pn(e,t,r,n);return}if(typeof e=="object"||typeof e=="function"){yield M(n);return}}async function*pn(n,e,t,r){let i=we(e);if(Me.has(n)){yield`<${n}${i} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let s=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${n}${i}>${s}</${n}>`;return}yield`<${n}${i}>`;let o=r.shapeFlag||0;if(o&x.TEXT_CHILDREN)yield y(String(t||""));else if(o&x.ARRAY_CHILDREN&&Array.isArray(t))for(let s of t)yield*se(s);else if(o&x.SLOTS_CHILDREN&&typeof t=="object"&&t!==null)yield He(t);else if(typeof t=="string")yield y(t);else if(Array.isArray(t))for(let s of t)yield*se(s);else typeof t=="number"&&(yield y(String(t)));yield`</${n}>`}function pt(n){return g(n)}function ft(n,e){let t=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=b(n,t);return new ReadableStream({async pull(i){let{value:o,done:s}=await r.next();s?i.close():i.enqueue(o)},async cancel(){await r.return(void 0)}})}async function*dt(n,e){let t=(e==null?void 0:e.suspenseIdPrefix)||"suspense";yield*b(n,t)}async function*b(n,e){if(n==null)return;let{type:t,props:r,children:i}=n;if(typeof t=="symbol"&&String(t)==="Symbol(Fragment)"){if(Array.isArray(i))for(let o of i)yield*b(o,e);return}if(typeof t=="symbol"&&String(t).includes("Text")){yield y(String(i||""));return}if(typeof t=="symbol"&&String(t).includes("Comment")){yield`<!--${String(i||"")}-->`;return}if(typeof t=="string"){yield*fn(t,r,i,n,e);return}if(typeof t=="object"&&t!==null){let o=t;if(o.name==="Suspense"||o._isSuspense){yield*dn(n,e);return}if(o._isAsyncComponent||o.__asyncSetup){yield*un(n,e);return}yield M(n);return}if(typeof t=="function"){yield M(n);return}}async function*fn(n,e,t,r,i){let o=we(e);if(Me.has(n)){yield`<${n}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${n}${o}>${a}</${n}>`;return}yield`<${n}${o}>`;let s=r.shapeFlag||0;if(s&x.TEXT_CHILDREN)yield y(String(t||""));else if(s&x.ARRAY_CHILDREN&&Array.isArray(t))for(let a of t)yield*b(a,i);else if(s&x.SLOTS_CHILDREN&&typeof t=="object"&&t!==null)yield He(t);else if(typeof t=="string")yield y(t);else if(Array.isArray(t))for(let a of t)yield*b(a,i);else typeof t=="number"&&(yield y(String(t)));yield`</${n}>`}async function*dn(n,e){let t=`${e}-${on++}`,r=n.type,o=(n.props||{}).fallback,s="";o&&(typeof o=="object"&&o!==null?s=g(o):typeof o=="string"&&(s=o));let a=n.children,l=[];if(typeof a=="object"&&a!==null){if(Array.isArray(a))l=a;else if(typeof a.default=="function"){let d=a.default();Array.isArray(d)?l=d:d!=null&&(l=[d])}}let f=[];function p(d){for(let c of d){if(c==null)continue;let u=c.type;if(u&&(u._isAsyncComponent||u.__asyncSetup||c.__asyncSetup)){let m=c.__asyncPromise||u.__asyncPromise;m&&f.push(m.then(()=>{}))}}}if(p(l),f.length===0){for(let d of l)yield*b(d,e);return}yield`<!--${t}-fallback-->`,yield s,await Promise.all(f),yield`<!--${t}-resolved-->`;for(let d of l)yield*b(d,e);yield`<!--/${t}-->`}async function*un(n,e){let t=n.type,r=n.__asyncPromise||t.__asyncPromise;if(r)try{await r}catch(i){yield"<!--async-component-error-->";return}yield M(n)}var ut=new K;var le={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},N=!1,Ie=[],h={success:!0,mismatches:0,hydratedNodes:0};function mt(){return N}function gt(n){N=n}function ht(){return{...h}}function je(){h={success:!0,mismatches:0,hydratedNodes:0}}function Nt(n){N?Ie.push(n):n()}function vt(n,e,t={}){je(),t.onHydrated&&Ie.push(t.onHydrated),N=!0;try{let r=e.firstElementChild;return r?(n._vnode||n.mount(e),n._vnode&&S(r,n._vnode,t),N=!1,$e(),h):(console.warn("[lyt] \u5BB9\u5668\u4E3A\u7A7A\uFF0C\u56DE\u9000\u5230\u5BA2\u6237\u7AEF\u6E32\u67D3"),N=!1,n.mount(e),h.success=!1,$e(),h)}catch(r){return console.error("[lyt] \u6CE8\u6C34\u5931\u8D25\uFF0C\u56DE\u9000\u5230\u5BA2\u6237\u7AEF\u6E32\u67D3:",r),N=!1,h.success=!1,e.innerHTML="",n.mount(e),$e(),h}}function $e(){let n=Ie.splice(0);for(let e of n)try{e()}catch(t){console.error("[lyt] onHydrated \u56DE\u8C03\u6267\u884C\u5931\u8D25:",t)}}function S(n,e,t){if(Tn(e)){hn(n,e,t);return}if(bn(e)){mn(n,e,t);return}if(En(e)){gn(n,e,t);return}if(Sn(e)){Nn(n,e,t);return}if(typeof e.type=="string"){yn(n,e,t);return}}function yn(n,e,t){let r=n.tagName.toLowerCase(),i=e.type.toLowerCase();if(r!==i){ce(n,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${i}"`,t);return}e.el=n,e.props&&Pe(n,e.props),e.ref&&xn(n,e.ref),vn(n,e,t),h.hydratedNodes++}function mn(n,e,t){if(n.nodeType!==3){ce(n,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",t);return}e.el=n;let r=n.nodeValue||"",i=String(e.children||"");r!==i&&(n.nodeValue=i,t.strict&&console.warn(`[lyt] \u6CE8\u6C34\u6587\u672C\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${i}"`)),h.hydratedNodes++}function gn(n,e,t){if(n.nodeType!==8){ce(n,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",t);return}e.el=n;let r=n.nodeValue||"",i=String(e.children||"");r!==i&&(n.nodeValue=i),h.hydratedNodes++}function hn(n,e,t){if(!Array.isArray(e.children))return;let r=Array.from(n.childNodes);for(let i=0;i<e.children.length;i++){let o=e.children[i],s=r[i];if(!s){console.warn(`[lyt] Fragment \u5B50\u8282\u70B9\u6570\u91CF\u4E0D\u5339\u914D: VNode \u6709 ${e.children.length} \u4E2A\u5B50\u8282\u70B9\uFF0CDOM \u53EA\u6709 ${r.length} \u4E2A`),h.mismatches++;break}S(s,o,t)}}function Nn(n,e,t){if(e.component&&e.component.subTree){S(n,e.component.subTree,t),e.el=e.component.subTree.el;return}let r=e.type;if(typeof r=="function")try{let i=r(e.props||{},{slots:e.children||{}});if(i){S(n,i,t),e.el=i.el;return}}catch(i){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let i=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(i){S(n,i,t),e.el=i.el;return}}catch(i){}ce(n,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",t)}function vn(n,e,t){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&le.TEXT_CHILDREN){let i=n.textContent||"",o=String(e.children||"");i!==o&&(n.textContent=o,t.strict&&console.warn(`[lyt] \u6CE8\u6C34\u5B50\u8282\u70B9\u6587\u672C\u4E0D\u5339\u914D: DOM "${i}" vs VNode "${o}"`));return}if(Array.isArray(e.children)){let i=Array.from(n.childNodes),o=0;for(let s=0;s<i.length&&o<e.children.length;s++){let a=e.children[o];if(a==null){o++;continue}S(i[s],a,t),o++}o<e.children.length&&(console.warn(`[lyt] \u5B50\u8282\u70B9\u6570\u91CF\u4E0D\u5339\u914D: VNode \u6709 ${e.children.length} \u4E2A\uFF0CDOM \u53EA\u6709 ${i.length} \u4E2A`),h.mismatches++)}r&le.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function Pe(n,e){for(let t in e){let r=e[t];if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase();n.addEventListener(i,r)}}}function xn(n,e){typeof e=="function"?e(n):e&&typeof e=="object"&&(e.current=n)}function Tn(n){return typeof n.type=="symbol"&&String(n.type)==="Symbol(Fragment)"}function bn(n){return typeof n.type=="symbol"&&String(n.type).includes("Text")}function En(n){return typeof n.type=="symbol"&&String(n.type).includes("Comment")}function Sn(n){return!!((n.shapeFlag||0)&(le.STATEFUL_COMPONENT|le.FUNCTIONAL_COMPONENT)||typeof n.type=="object"&&n.type!==null||typeof n.type=="function")}function ce(n,e,t,r){let i=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${t}`;if(h.mismatches++,r.strict)throw new Error(i);console.warn(i)}var V=new Map,H=new Map,An={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Vn=/[&<>"']/g;function A(n){return n.replace(Vn,e=>An[e])}function De(n,e,t={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let i=r.querySelector(n);if(!i)return console.warn(`[lyt] hydrateIsland: \u672A\u627E\u5230\u5339\u914D\u5143\u7D20 "${n}"`),{success:!1,mismatches:0,hydratedNodes:0};let o=i.getAttribute("data-hydrate");if(!o)return console.warn("[lyt] hydrateIsland: \u5143\u7D20\u7F3A\u5C11 data-hydrate \u5C5E\u6027"),{success:!1,mismatches:0,hydratedNodes:0};if(i.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let s=Cn(o,r);if(s===null)return console.warn(`[lyt] hydrateIsland: \u65E0\u6CD5\u89E3\u6790 island "${o}" \u7684 props`),{success:!1,mismatches:0,hydratedNodes:0};let a=i.getAttribute("data-hydrate-when");return a||t.lazy?Rn(i,o,e,s,a||"visible",t):E(i,o,e,s,t)}function Cn(n,e){let t=e.querySelector(`script[type="application/json"][data-hydrate-props="${n}"]`);if(!t){let r=e.querySelector(`[data-hydrate="${n}"]`);if(r){let i=r.getAttribute("data-props");if(i)try{return JSON.parse(i)}catch(o){return null}}return{}}try{return JSON.parse(t.textContent||"{}")}catch(r){return null}}function E(n,e,t,r,i){let o={success:!0,mismatches:0,hydratedNodes:0};try{N=!0;let s=null;if(typeof t.render=="function")s=t.render(r,{slots:t.slots||{},emit:()=>{}});else if(typeof t.setup=="function"){let l=t.setup(r,{emit:()=>{},slots:t.slots||{}});typeof l=="function"&&(s=l())}if(!s)return console.warn(`[lyt] island "${e}": \u7EC4\u4EF6\u672A\u8FD4\u56DE VNode`),N=!1,o.success=!1,o;if(i.dev!==!1){let l=On(n,s,e);o.mismatches=l}S(n,s,i),o.hydratedNodes=h.hydratedNodes,s.props&&Pe(n,s.props),ae(n,s),n.setAttribute("data-hydrated","");let a={id:e,hydrated:!0,instance:t,eventListeners:[],timeoutId:null,observer:null,interactionHandler:null};return V.set(e,a),H.set(e,t),N=!1,i.onHydrated&&i.onHydrated(),o}catch(s){return N=!1,console.error(`[lyt] island "${e}" \u6CE8\u6C34\u5931\u8D25:`,s),o.success=!1,o}}function ae(n,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let t=Array.from(n.children),r=0;for(let i=0;i<t.length&&r<e.children.length;i++){let o=e.children[r];if(o==null){r++;continue}if(typeof o.type=="string"&&o.props)Pe(t[i],o.props),ae(t[i],o);else if(typeof o.type=="object"||typeof o.type=="function"){let s=o.type;if(typeof s=="function")try{let a=s(o.props||{},{slots:o.children||{}});a&&t[i]&&ae(t[i],a)}catch(a){}else if(s&&typeof s.render=="function")try{let a=s.render(o.props||{},{slots:o.children||{},emit:()=>{}});a&&t[i]&&ae(t[i],a)}catch(a){}}r++}}}function Rn(n,e,t,r,i,o){let s={success:!0,mismatches:0,hydratedNodes:0},a=null;o.timeout&&o.timeout>0&&(a=setTimeout(()=>{xt(n,e),E(n,e,t,r,o)},o.timeout));let l={id:e,hydrated:!1,instance:t,eventListeners:[],timeoutId:a,observer:null,interactionHandler:null};switch(V.set(e,l),H.set(e,t),i){case"visible":{if(typeof IntersectionObserver!="undefined"){let f=new IntersectionObserver(p=>{for(let d of p)d.isIntersecting&&(f.unobserve(d.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,E(n,e,t,r,o))},{rootMargin:"200px"});f.observe(n),l.observer=f}else a&&clearTimeout(a),E(n,e,t,r,o);break}case"idle":{(p=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(p,{timeout:o.timeout||2e3}):setTimeout(p,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,n.hasAttribute("data-hydrated")||E(n,e,t,r,o)});break}case"interaction":{let f=()=>{a&&clearTimeout(a),l.timeoutId=null,l.interactionHandler=null,document.removeEventListener("click",f),document.removeEventListener("keydown",f),document.removeEventListener("scroll",f),document.removeEventListener("touchstart",f),n.hasAttribute("data-hydrated")||E(n,e,t,r,o)};document.addEventListener("click",f,{once:!1,passive:!0}),document.addEventListener("keydown",f,{once:!1,passive:!0}),document.addEventListener("scroll",f,{once:!1,passive:!0}),document.addEventListener("touchstart",f,{once:!1,passive:!0}),l.interactionHandler=f;break}default:a&&clearTimeout(a),E(n,e,t,r,o)}return s}function xt(n,e){let t=V.get(e);t&&(t.observer&&(t.observer.disconnect(),t.observer=null),t.timeoutId!==null&&(clearTimeout(t.timeoutId),t.timeoutId=null),t.interactionHandler&&(document.removeEventListener("click",t.interactionHandler),document.removeEventListener("keydown",t.interactionHandler),document.removeEventListener("scroll",t.interactionHandler),document.removeEventListener("touchstart",t.interactionHandler),t.interactionHandler=null))}function Tt(n={}){let e=typeof document!="undefined"?document:null;if(!e)return{success:!1,mismatches:0,hydratedNodes:0};let t=e.querySelectorAll("[data-hydrate]:not([data-hydrated])"),r={success:!0,mismatches:0,hydratedNodes:0};return t.forEach(i=>{let o=i.getAttribute("data-hydrate"),s=H.get(o);if(!s){console.warn(`[lyt] hydrateAllIslands: \u672A\u627E\u5230 island "${o}" \u7684\u7EC4\u4EF6\u6CE8\u518C`),r.success=!1;return}let a=De(`[data-hydrate="${o}"]`,s,n);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function bt(n,e){H.set(n,e)}function Et(n){if(!V.get(n))return;let t=typeof document!="undefined"?document.querySelector(`[data-hydrate="${n}"]`):null;t&&(xt(t,n),t.removeAttribute("data-hydrated")),V.delete(n),H.delete(n)}function St(){return V}function At(){V.clear(),H.clear()}function Vt(n,e={},t="div",r){let i=n.name||"anonymous",o=JSON.stringify(e),s=A(o),a="";if(typeof n.render=="function"){let d=n.render(e,{slots:n.slots||{},emit:()=>{}});a=w(d)}let l=r?` data-hydrate-when="${r}"`:"",f=`<${t} data-hydrate="${i}" data-props="${s}"${l}>${a}</${t}>`,p=`<script type="application/json" data-hydrate-props="${i}">${o}<\/script>`;return f+p}function w(n){if(n==null)return"";let{type:e,props:t,children:r}=n;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)")return Array.isArray(r)?r.map(i=>w(i)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return A(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${String(r||"")}-->`;if(typeof e=="string"){let i=Ln(t);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${i} />`;let s="";return typeof r=="string"?s=A(r):Array.isArray(r)?s=r.map(a=>w(a)).join(""):typeof r=="number"&&(s=A(String(r))),`<${e}${i}>${s}</${e}>`}if(typeof e=="function"){let i=e(t||{},{slots:r||{}});return w(i)}if(typeof e=="object"&&e!==null){let i=e;if(typeof i.render=="function"){let o=i.render(t||{},{slots:r||{},emit:()=>{}});return w(o)}}return""}function Ln(n){if(!n)return"";let e=[];for(let t in n){let r=n[t];if(!(t.startsWith("on")||t.startsWith("@")||t==="key"||t==="ref")&&!(t==="__vccOpts"||t.startsWith("__"))&&!(t==="dangerouslySetInnerHTML"||t==="innerHTML"))if(r===!0)e.push(t);else{if(r===!1||r==null)continue;t==="class"&&typeof r=="string"?e.push(`class="${A(r)}"`):t==="style"&&typeof r=="string"?e.push(`style="${A(r)}"`):e.push(`${t}="${A(String(r))}"`)}}return e.length>0?" "+e.join(" "):""}var Fe=[];function On(n,e,t){let r=0,i=_n(n),o=w(e);if(i!==o){r++;let s={islandId:t,expected:o,actual:i,suggestion:Mn(i,o,t)};Fe.push(s),console.warn(`[lyt] Hydration mismatch in island "${t}":
2
- \u670D\u52A1\u7AEF: ${i}
3
- \u5BA2\u6237\u7AEF: ${o}
4
- \u5EFA\u8BAE: ${s.suggestion}`)}return r}function _n(n){let e=n.cloneNode(!0);return e.removeAttribute("data-hydrate"),e.removeAttribute("data-props"),e.removeAttribute("data-hydrate-when"),e.removeAttribute("data-hydrated"),e.innerHTML}function Mn(n,e,t){if(n.trim()==="")return`\u670D\u52A1\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${t}" \u7684\u670D\u52A1\u7AEF\u6E32\u67D3\u903B\u8F91`;if(e.trim()==="")return`\u5BA2\u6237\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${t}" \u7684 render \u51FD\u6570`;let r=/\d{10,13}/;return r.test(n)||r.test(e)?"\u68C0\u6D4B\u5230\u65F6\u95F4\u6233\u5DEE\u5F02\uFF0C\u8003\u8651\u4F7F\u7528\u7EDF\u4E00\u7684\u65F6\u95F4\u6E90\u6216\u5EF6\u8FDF\u6CE8\u6C34":yt(n)===yt(e)?"HTML \u5185\u5BB9\u76F8\u540C\u4F46\u5C5E\u6027\u987A\u5E8F\u4E0D\u540C\uFF0C\u8FD9\u4E0D\u5F71\u54CD\u529F\u80FD\u4F46\u53EF\u80FD\u5BFC\u81F4 mismatch \u8B66\u544A":`\u8BF7\u786E\u4FDD\u7EC4\u4EF6 "${t}" \u5728\u670D\u52A1\u7AEF\u548C\u5BA2\u6237\u7AEF\u6E32\u67D3\u76F8\u540C\u7684\u8F93\u51FA`}function yt(n){return n.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function Ct(){return[...Fe]}function Rt(){Fe.length=0}var wn={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",img:"Image",input:"TextInput",textarea:"TextInput",button:"TouchableOpacity",scroll:"ScrollView",list:"FlatList",a:"TouchableOpacity",ul:"View",ol:"View",li:"View",form:"View",header:"View",footer:"View",nav:"View",main:"View",section:"View",article:"View",aside:"View"},Hn={flexDirection:"flexDirection",justifyContent:"justifyContent",alignItems:"alignItems",alignSelf:"alignSelf",flexWrap:"flexWrap",flex:"flex",flexGrow:"flexGrow",flexShrink:"flexShrink",flexBasis:"flexBasis",backgroundColor:"backgroundColor",color:"color",fontSize:"fontSize",fontWeight:"fontWeight",fontStyle:"fontStyle",textAlign:"textAlign",lineHeight:"lineHeight",letterSpacing:"letterSpacing",padding:"padding",paddingTop:"paddingTop",paddingBottom:"paddingBottom",paddingLeft:"paddingLeft",paddingRight:"paddingRight",paddingHorizontal:"paddingHorizontal",paddingVertical:"paddingVertical",margin:"margin",marginTop:"marginTop",marginBottom:"marginBottom",marginLeft:"marginLeft",marginRight:"marginRight",marginHorizontal:"marginHorizontal",marginVertical:"marginVertical",width:"width",height:"height",minWidth:"minWidth",maxWidth:"maxWidth",minHeight:"minHeight",maxHeight:"maxHeight",borderRadius:"borderRadius",borderWidth:"borderWidth",borderColor:"borderColor",overflow:"overflow",opacity:"opacity",position:"position",top:"top",left:"left",right:"right",bottom:"bottom",zIndex:"zIndex",shadowColor:"shadowColor",shadowOffset:"shadowOffset",shadowOpacity:"shadowOpacity",shadowRadius:"shadowRadius"},$n={click:"onPress",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",change:"onChange",input:"onChangeText",focus:"onFocus",blur:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",longpress:"onLongPress"},In=0;function We(){return`native_${++In}`}var k=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:We()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:We()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:We()}}setAttribute(e,t,r){if(e){if(t==="style"&&typeof r=="object"&&r!==null){e.props.style={...e.props.style,...this.mapStyle(r)};return}if(t==="className"||t==="class"){e.props.className=r;return}if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase(),o=this.mapEvent(i);e.props[o]=r;return}if(t==="src"&&e.type==="Image"){e.props.source={uri:r};return}if(t==="href"){e.props.href=r;return}if(t==="placeholder"){e.props.placeholder=r;return}e.props[t]=r}}removeAttribute(e,t){if(e)if(t==="style")delete e.props.style;else if(t.startsWith("on")){let r=t.slice(2).toLowerCase(),i=this.mapEvent(r);delete e.props[i]}else delete e.props[t]}setStyle(e,t){if(!e)return;let r=this.mapStyle(t);e.props.style={...e.props.style,...r}}setClass(e,t){if(e){if(typeof t=="string")e.props.className=t;else if(typeof t=="object"&&t!==null){let r=[];for(let[i,o]of Object.entries(t))o&&r.push(i);e.props.className=r.join(" ")}}}insert(e,t,r){if(!(!e||!t)){if(t._parent){let i=t._parent,o=i.children.indexOf(t);o!==-1&&i.children.splice(o,1)}if(t._parent=e,r){let i=e.children.indexOf(r);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,r=t.children.indexOf(e);r!==-1&&t.children.splice(r,1),e._parent=void 0}replace(e,t,r){if(!e||!t||!r)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,r._parent=e,e.children[i]=r)}addEventListener(e,t,r,i){if(!e)return;let o=this.mapEvent(t);e.props[o]=r}removeEventListener(e,t,r){if(!e)return;let i=this.mapEvent(t);e.props[i]===r&&delete e.props[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,r=t.indexOf(e);return r!==-1&&r+1<t.length?t[r+1]:null}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,r,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let o=t.slice(2).toLowerCase(),s=this.mapEvent(o);e.props[s]=i}else this.setAttribute(e,t,i)}}querySelector(e){let t=e.replace(/[.#\[\]]/g,"").trim();return null}renderToNativeTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__Fragment");if(Array.isArray(e.children))for(let r of e.children){let i=this.renderToNativeTree(r);this.insert(t,i)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[r,i]of Object.entries(e.props))r==="key"||r==="ref"||this.setAttribute(t,r,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToNativeTree(r))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToNativeTree(r));return t}return this.createComment("unknown vnode type")}serializeToJSON(e){let t=r=>{let i={type:r.type,props:{...r.props},children:r.children.map(t)};return r.nativeId&&(i.nativeId=r.nativeId),i};return JSON.stringify(t(e),null,2)}getComponentType(e){return wn[e]||jn(e)}mapStyle(e){let t={};for(let[r,i]of Object.entries(e)){let o=Hn[r]||r;typeof i=="string"&&/^\d+px$/.test(i)?t[o]=parseInt(i,10):t[o]=i}return t}mapEvent(e){return $n[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function jn(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var Lt=new k;var Pn={if:{attr:"if"},else:{attr:"else"},each:{attr:"for",prefix:""},bind:{attr:"model:"},on:{attr:"bind",prefix:""},ref:{attr:""},slot:{attr:"slot"},class:{attr:"class"},style:{attr:"style"},show:{attr:"hidden"}},$={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"},Dn={div:"view",span:"text",p:"text",h1:"text",h2:"text",h3:"text",h4:"text",h5:"text",h6:"text",img:"image",input:"input",textarea:"textarea",button:"button",scroll:"scroll-view",list:"view",a:"navigator",ul:"view",ol:"view",li:"view",form:"form",header:"view",footer:"view",nav:"view",main:"view",section:"view",article:"view",aside:"view"},I={wechat:{if:"wx:if",else:"wx:else",for:"wx:for",forKey:"wx:key",bind:"bind",catch:"catch"},alipay:{if:"a:if",else:"a:else",for:"a:for",forKey:"a:key",bind:"on",catch:"catchEvent"},bytedance:{if:"tt:if",else:"tt:else",for:"tt:for",forKey:"tt:key",bind:"bind",catch:"catch"}},G=class{createElement(e){return{tag:Dn[e]||e,attrs:{},children:[],bindEvents:{},modelBindings:{}}}createText(e){return{tag:"__text__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}createComment(e){return{tag:"__comment__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}setAttribute(e,t,r){if(e){if(t.startsWith("lyt:")){let i=t.slice(4);this._applyDirective(e,i,r);return}if(t==="v-if"||t==="if"){e.wxIf=String(r);return}if(t==="v-else"||t==="else"){e.attrs["wx:else"]="";return}if(t==="v-for"||t==="each"){let i=String(r),o=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);o?(e.wxFor=o[4]||o[3],e.wxForKey=o[1]||o[3]):e.wxFor=i;return}if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase(),o=$[i]||i;e.bindEvents[o]=r.name||"handleEvent";return}if(t==="v-model"||t==="model"){e.modelBindings.value=String(r);return}if(t==="class"||t==="className"){e.attrs.class=String(r);return}if(t==="style"){typeof r=="object"&&r!==null?e.attrs.style=this._styleObjectToString(r):e.attrs.style=String(r);return}if(t==="href"&&e.tag==="navigator"){e.attrs.url=String(r);return}e.attrs[t]=String(r)}}removeAttribute(e,t){if(e)if(t==="v-if"||t==="if")delete e.wxIf;else if(t==="v-for"||t==="each")delete e.wxFor,delete e.wxForKey;else if(t.startsWith("on")){let r=t.slice(2).toLowerCase(),i=$[r]||r;delete e.bindEvents[i]}else delete e.attrs[t]}setStyle(e,t){if(!e)return;let r=this._styleObjectToString(t);e.attrs.style=r}setClass(e,t){if(e){if(typeof t=="string")e.attrs.class=t;else if(typeof t=="object"&&t!==null){let r=[];for(let[i,o]of Object.entries(t))o&&r.push(i);e.attrs.class=r.join(" ")}}}insert(e,t,r){if(!(!e||!t)){if(t._parent){let i=t._parent,o=i.children.indexOf(t);o!==-1&&i.children.splice(o,1)}if(t._parent=e,r){let i=e.children.indexOf(r);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,r=t.children.indexOf(e);r!==-1&&t.children.splice(r,1),e._parent=void 0}replace(e,t,r){if(!e||!t||!r)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,r._parent=e,e.children[i]=r)}addEventListener(e,t,r,i){if(!e)return;let o=$[t]||t;e.bindEvents[o]=r.name||"handleEvent"}removeEventListener(e,t,r){if(!e)return;let i=$[t]||t;delete e.bindEvents[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,r=t.indexOf(e);return r!==-1&&r+1<t.length?t[r+1]:null}setText(e,t){e&&e.tag==="__text__"&&(e.text=t)}patchProp(e,t,r,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let o=t.slice(2).toLowerCase(),s=$[o]||o;e.bindEvents[s]=i.name||"handleEvent"}else this.setAttribute(e,t,i)}}querySelector(e){return null}renderToMiniAppTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__fragment__");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r));return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[r,i]of Object.entries(e.props))r==="key"||r==="ref"||this.setAttribute(t,r,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r));return t}return this.createComment("unknown vnode type")}serializeToWXML(e,t=0){return this._serializeToTemplate(e,t,"wechat")}serializeToAXML(e,t=0){return this._serializeToTemplate(e,t,"alipay")}serializeToTTML(e,t=0){return this._serializeToTemplate(e,t,"bytedance")}getPlatformTemplate(e,t){return this._serializeToTemplate(e,0,t)}mapDirective(e,t,r="wechat"){let i=I[r]||I.wechat,o=Pn[e];if(!o)return"";switch(e){case"if":return`${i.if}="{{${t}}}"`;case"else":return`${i.else}`;case"each":{let s=t.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);if(s){let a=s[1]||s[3],l=s[4]||s[3];return`${i.for}="{{${l}}}" ${i.forKey}="{{${a}}}"`}return`${i.for}="{{${t}}}"`}case"show":return`hidden="{{!${t}}}"`;default:return`${o.attr}="${t}"`}}mapEvent(e,t="wechat"){let r=I[t]||I.wechat,i=$[e]||e;return r.bind==="on"?`on${i.charAt(0).toUpperCase()}${i.slice(1)}`:`${r.bind}${i}`}_applyDirective(e,t,r){switch(t){case"if":e.wxIf=String(r);break;case"else":e.attrs["wx:else"]="";break;case"each":{let i=String(r),o=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);o?(e.wxFor=o[4]||o[3],e.wxForKey=o[1]||o[3]):e.wxFor=i;break}case"show":e.attrs.hidden=String(r);break;default:e.attrs[t]=String(r)}}_styleObjectToString(e){return Object.entries(e).map(([t,r])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${r}`).join("; ")}_serializeToTemplate(e,t,r){let i=" ".repeat(t),o=I[r]||I.wechat;if(e.tag==="__text__")return`${i}${e.text||""}`;if(e.tag==="__comment__")return`${i}<!-- ${e.text||""} -->`;if(e.tag==="__fragment__")return e.children.map(p=>this._serializeToTemplate(p,t,r)).join(`
5
- `);let s=[];for(let[p,d]of Object.entries(e.attrs)){if(p==="wx:else"){s.push(o.else);continue}s.push(`${p}="${d}"`)}e.wxIf&&s.unshift(`${o.if}="{{${e.wxIf}}}"`),e.wxFor&&(s.unshift(`${o.for}="{{${e.wxFor}}}"`),e.wxForKey&&s.unshift(`${o.forKey}="{{${e.wxForKey}}}"`));for(let[p,d]of Object.entries(e.bindEvents)){let c=o.bind==="on"?`on${p.charAt(0).toUpperCase()}${p.slice(1)}`:`${o.bind}${p}`;s.push(`${c}="${d}"`)}for(let[p,d]of Object.entries(e.modelBindings))s.push(`model:${p}="{{${d}}}"`);let a=s.length>0?" "+s.join(" "):"",l=new Set(["image","input"]);if(e.children.length===0&&l.has(e.tag))return`${i}<${e.tag}${a} />`;if(e.children.length===0)return`${i}<${e.tag}${a}></${e.tag}>`;let f=e.children.map(p=>this._serializeToTemplate(p,t+1,r)).join(`
6
- `);return`${i}<${e.tag}${a}>
7
- ${f}
8
- ${i}</${e.tag}>`}};var Ot=new G;var C=require("@lytjs/reactivity/signal");function pe(n,e){return(0,C.effect)(()=>{let r=e();n.textContent=r==null?"":String(r)})}function U(n,e,t){return(0,C.effect)(()=>{let i=t();n[e]=i})}function fe(n,e,t){return(0,C.effect)(()=>{let i=t();i==null||i===!1?n.removeAttribute(e):n.setAttribute(e,i===!0?"":String(i))})}function de(n,e){return(0,C.effect)(()=>{let r=e();if(typeof r=="string")n.className=r;else if(Array.isArray(r))n.className=r.filter(Boolean).join(" ");else if(typeof r=="object"&&r!==null){let i=[];for(let o of Object.keys(r))r[o]&&i.push(o);n.className=i.join(" ")}else n.className=""})}function ue(n,e,t){return n.addEventListener(e,t),()=>{n.removeEventListener(e,t)}}function Be(n,e){return(0,C.effect)(()=>{e()?(n.style=n.style||{},n.style.display==="none"&&(n.style.display=""),n.hidden=!1):(n.style=n.style||{},n.style.display="none",n.hidden=!0)})}function ze(n,e,t,r){let i=[],o=[],s=new Map,a=(0,C.effect)(()=>{let l=e();if(!Array.isArray(l))return;let f=l.map((p,d)=>r?r(p,d):d);if(f.length===o.length){let p=!0;for(let d=0;d<f.length;d++)if(f[d]!==o[d]){p=!1;break}if(p){for(let d=0;d<l.length;d++){let c=t(l[d],d),u=i[d];u&&u.parentNode===n&&n.replaceChild(c,u),i[d]=c}return}}for(let p of i)p.parentNode===n&&n.removeChild(p);s.clear(),i=[],o=[];for(let p=0;p<l.length;p++){let d=t(l[p],p);n.appendChild(d),i.push(d),o.push(f[p]),s.set(f[p],d)}});return()=>{a();for(let l of i)l.parentNode===n&&n.removeChild(l);i=[],o=[],s.clear()}}var ye=n=>{if(typeof document!="undefined")return document.createElement(n);throw new Error("[lyt:vapor] \u672A\u8BBE\u7F6E DOM \u5DE5\u5382\u51FD\u6570\u3002\u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\u8BF7\u8C03\u7528 setVaporDOMFactory()")};function Mt(n){ye=n}function j(){return ye}function Ke(n,e,...t){let r={tag:n,children:[],props:{},events:{},bindings:[]};if(e)for(let[i,o]of Object.entries(e))if(i.startsWith("on")&&typeof o=="function"&&!_t(o)){let s=i.slice(2).toLowerCase();r.events[s]=o}else _t(o)?i==="textContent"||i==="text"?r.bindings.push({type:"text",target:"textContent",signal:o}):i==="className"||i==="class"?r.bindings.push({type:"class",target:"className",signal:o}):i==="style"?r.bindings.push({type:"style",target:"style",signal:o}):r.bindings.push({type:"prop",target:i,signal:o}):r.props[i]=o;for(let i of t)typeof i=="string"?r.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:i}):r.children.push(i);return r}function _t(n){return typeof n!="function"?!1:!!(n._subscribe||n.set)&&!n.toString().startsWith("class")}function v(n){if(n.tag==="#text"){let t=ye("#text");return t.textContent=n.text||"",t.nodeType=3,t}let e=ye(n.tag);n.el=e;for(let[t,r]of Object.entries(n.props))if(t==="style"&&typeof r=="object")for(let[i,o]of Object.entries(r))e.style[i]=o;else t==="className"||t==="class"?e.className=String(r):e[t]=r;for(let t of n.bindings)t.type==="text"?pe(e,t.signal):t.type==="prop"?U(e,t.target,t.signal):t.type==="attr"?fe(e,t.target,t.signal):t.type==="class"?de(e,t.signal):t.type==="style"&&U(e,"style",t.signal);for(let[t,r]of Object.entries(n.events))ue(e,t,r);for(let t of n.children){let r=v(t);e.appendChild(r)}return e}function ke(n,e,t){if(n.tag!==e.tag){let o=v(e);n.el&&n.el.parentNode===t&&t.removeChild(n.el),t.appendChild(o);return}let r=n.el||v(n);e.el=r;for(let[o,s]of Object.entries(e.props))if(o==="style"&&typeof s=="object")for(let[a,l]of Object.entries(s))r.style[a]=l;else o==="className"||o==="class"?r.className=String(s):r[o]=s;e.text!==void 0&&(r.textContent=e.text);for(let[o,s]of Object.entries(n.events))e.events[o]||r.removeEventListener(o,s);for(let[o,s]of Object.entries(e.events))n.events[o]!==s&&(n.events[o]&&r.removeEventListener(o,n.events[o]),r.addEventListener(o,s));let i=Math.max(n.children.length,e.children.length);for(let o=0;o<i;o++){let s=n.children[o],a=e.children[o];if(!s&&a){let l=v(a);r.appendChild(l)}else s&&!a?s.el&&s.el.parentNode===r&&r.removeChild(s.el):s&&a&&ke(s,a,r)}}function me(n,e){let t=e.setup?e.setup():{};e.beforeMount&&e.beforeMount();let r;if(e.render){let o=e.render(t,Ke);r=Array.isArray(o)?o:[o]}else r=[];let i=[];for(let o of r){let s=v(o);n.appendChild(s),i.push(s)}return e.mounted&&e.mounted(),()=>{e.beforeUnmount&&e.beforeUnmount();for(let o of i)n.removeChild(o);e.unmounted&&e.unmounted()}}function ge(n){let e={type:"fragment",children:[]},t=n.trim();for(;t.length>0;){let r=t.match(/^<([a-zA-Z][a-zA-Z0-9-]*)([\s\S]*?)(\/?)>/);if(r){let i=r[1],o=r[2],s=r[3]==="/",{props:a,events:l,directives:f}=Wn(o),p={type:"element",tag:i,props:a,events:l,directives:f,children:[]};if(t=t.slice(r[0].length),s){e.children.push(p);continue}let d=`</${i}>`,c=Fn(t,i);if(c===-1)throw new Error(`[lyt:vapor:compiler] \u672A\u627E\u5230\u95ED\u5408\u6807\u7B7E: </${i}>`);let u=t.slice(0,c);t=t.slice(c+d.length);let m=ge(u);p.children=m.children||[],e.children.push(p)}else{let i=t.indexOf("<"),o;if(i===-1?(o=t,t=""):(o=t.slice(0,i),t=t.slice(i)),o.trim())if(o.includes("{{")){let s=Bn(o);for(let a of s)a.type==="text"?e.children.push({type:"text",text:a.value}):e.children.push({type:"interpolation",expression:a.value})}else e.children.push({type:"text",text:o})}}return e}function Fn(n,e){let t=1,r=0,i=`<${e}`,o=`</${e}>`;for(;r<n.length&&t>0;){let s=n.indexOf(i,r),a=n.indexOf(o,r);if(a===-1)return-1;if(s!==-1&&s<a){let l=n[s+i.length];l===">"||l===" "||l==="/"?(t++,r=s+i.length):(r=a+o.length,t--)}else r=a+o.length,t--}return t===0?r-o.length:-1}function Wn(n){let e={},t={},r={},i=/([a-zA-Z@:][a-zA-Z0-9@:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,o;for(;(o=i.exec(n))!==null;){let s=o[1],a=o[2]||o[3];if(s.startsWith("on:")){let l=s.slice(3);t[l]=a}else if(s.startsWith(":")){let l=s.slice(1);e[l]=a}else if(s==="v-if")r.if=a;else if(s==="v-each"){let l=a.match(/^\s*(\w+)\s+in\s+(.+)\s*$/);l&&(r.each={item:l[1],expression:l[2]})}else e[s]=a}return{props:e,events:t,directives:r}}function Bn(n){let e=[],t=/\{\{([\s\S]*?)\}\}/g,r=0,i;for(;(i=t.exec(n))!==null;)i.index>r&&e.push({type:"text",value:n.slice(r,i.index)}),e.push({type:"interpolation",value:i[1].trim()}),r=i.index+i[0].length;return r<n.length&&e.push({type:"text",value:n.slice(r)}),e}function he(n){let e=ge(n);return{render:zn(e),ast:e}}function zn(n){return function(t){let r=j();return X(n,t,r)}}function X(n,e,t){var r,i;if(n.type==="fragment"){if(n.children&&n.children.length===1)return X(n.children[0],e,t);let o=t("div");if(o.nodeType=11,n.children)for(let s of n.children){let a=X(s,e,t);o.appendChild(a)}return o}if(n.type==="text"){let o=t("#text");return o.textContent=n.text||"",o.nodeType=3,o}if(n.type==="interpolation"){let o=t("span"),s=n.expression||"",a=Y(e,s);return o.textContent=a!=null?String(a):"",o}if(n.type==="element"){if((r=n.directives)!=null&&r.each){let{item:s,expression:a}=n.directives.each,l=Y(e,a),f=t("#fragment");if(f.childNodes=[],f.nodeType=11,Array.isArray(l))for(let p=0;p<l.length;p++){let d={...e,[s]:l[p],index:p},c=t(n.tag);if(n.props)for(let[u,m]of Object.entries(n.props))u==="class"||u==="className"?c.className=m:c[u]=m;if(n.children)for(let u of n.children){let m=X(u,d,t);c.appendChild(m)}f.appendChild(c)}return f}let o=t(n.tag);if((i=n.directives)!=null&&i.if&&(Y(e,n.directives.if)||(o.style=o.style||{},o.style.display="none",o.hidden=!0)),n.props)for(let[s,a]of Object.entries(n.props))if(s.startsWith(":")){let l=s.slice(1),f=Y(e,a);o[l]=f}else s==="class"||s==="className"?o.className=a:o[s]=a;if(n.events)for(let[s,a]of Object.entries(n.events)){let l=Y(e,a);typeof l=="function"&&o.addEventListener(s,l)}if(n.children)for(let s of n.children){let a=X(s,e,t);if(a.nodeType===11&&a.childNodes)for(let l of a.childNodes)o.appendChild(l);else o.appendChild(a)}return o}return t("div")}function Y(n,e){let t=e.trim();if(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)){let o=n[t];return typeof o=="function"&&!o.prototype?o():o}let r=t.split("."),i=n;for(let o of r){if(i==null)return;i=i[o],typeof i=="function"&&!i.prototype&&r.indexOf(o)<r.length-1&&(i=i())}return i}function wt(n){return n}function Ht(n){let e=!1,t=null,r=null;return{mount(i){if(e){console.warn("[lyt:vapor] App \u5DF2\u7ECF\u6302\u8F7D\uFF0C\u4E0D\u80FD\u91CD\u590D\u6302\u8F7D");return}if(typeof i=="string")if(typeof document!="undefined"){let o=document.querySelector(i);if(!o)throw new Error(`[lyt:vapor] \u672A\u627E\u5230\u6302\u8F7D\u76EE\u6807: ${i}`);r=o}else throw new Error("[lyt:vapor] \u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\uFF0C\u8BF7\u76F4\u63A5\u4F20\u5165\u5BB9\u5668\u5143\u7D20");else r=i;t=me(r,n),e=!0},unmount(){if(!e){console.warn("[lyt:vapor] App \u672A\u6302\u8F7D\uFF0C\u4E0D\u80FD\u5378\u8F7D");return}t&&(t(),t=null),e=!1,r=null}}}function $t(n){let e=n.setup?n.setup():{};n.beforeMount&&n.beforeMount();let t;if(n.template){let{render:r}=he(n.template);t=r(e)}else if(n.render){let r=n.render(e,Kn),i=Array.isArray(r)?r:[r];if(i.length===1)t=v(i[0]);else{t=j()("div");for(let s of i)t.appendChild(v(s))}}else throw new Error("[lyt:vapor] \u7EC4\u4EF6\u5FC5\u987B\u63D0\u4F9B template \u6216 render \u51FD\u6570");return n.mounted&&n.mounted(),t}function Kn(n,e,...t){let r={tag:n,children:[],props:e||{},events:{},bindings:[]};for(let i of t)typeof i=="string"?r.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:i}):r.children.push(i);return r}
1
+ var M=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var me=(n,e)=>{for(var t in e)M(n,t,{get:e[t],enumerable:!0})},ve=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ye(e))!ue.call(n,r)&&r!==t&&M(n,r,{get:()=>e[r],enumerable:!(o=de(e,r))||o.enumerable});return n};var Ne=n=>ve(M({},"__esModule",{value:!0}),n);var Ie={};me(Ie,{Comment:()=>K,DOMRenderer:()=>C,Fragment:()=>P,PatchFlags:()=>x,PatchPropFlags:()=>X,ShapeFlags:()=>u,Text:()=>k,createInvoker:()=>z,createRenderer:()=>ee,domRenderer:()=>pe,getEventInvokers:()=>se,getEventKey:()=>G,getSVGPropName:()=>ie,isSVGElement:()=>_,normalizeEventName:()=>I,parseEventModifier:()=>B,patchAllProps:()=>T,patchClass:()=>v,patchDOMProp:()=>w,patchDOMProps:()=>re,patchElementProps:()=>fe,patchEvent:()=>L,patchEventOnElement:()=>le,patchProp:()=>y,patchStyle:()=>N,removeAllEventListeners:()=>D,removeDOMProp:()=>h,setDOMProp:()=>E});module.exports=Ne(Ie);var $=require("@lytjs/vdom");var u=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(u||{}),x=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(x||{}),P=Symbol("Fragment"),k=Symbol("Text"),K=Symbol("Comment");function m(n){return n.type===P}function R(n){return n.type===k}function V(n){return n.type===K}function F(n,e){return n.type===e.type&&n.key===e.key}function W(n){return Array.isArray(n.dynamicChildren)}function J(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function H(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function j(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&H(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function U(n,e,t,o,r,i){let{shapeFlag:s}=t;if(m(t)){he(n,e,t,o,r,i);return}if(R(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(V(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){Ee(n,e,t,o,r,i);return}if(s&6){ge(e,t,o,r,i);return}}function Ee(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];J(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&A(e,f,a,null,i),n.insert(o,a,r)}function A(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function he(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&A(e,s,o,a,i),t.el=a,t.anchor=a}function ge(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function Q(n,e,t,o){let{shapeFlag:r,children:i}=t;if(m(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function b(n,e){for(let t=0;t<e.length;t++)n(e[t])}var S=require("@lytjs/vdom");function O(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){U(n,Y(n,e),o,r,i,s);return}if(W(o)&&W(t)){xe(n,e,t,o,r,s);return}if(!F(t,o)){e(t,r),U(n,Y(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(m(o)){Ce(n,e,t,o,r,i,s);return}if(R(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(V(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){Le(n,e,t,o,s);return}if(a&6){Re(t,o,s);return}}function Y(n,e){return(t,o,r,i,s)=>{O(n,e,t,o,r,i,s)}}function Le(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:l,dynamicProps:f}=o;if(l&&l>0){if(l&1&&t.children!==o.children&&(i.textContent=o.children),l&2&&s.class!==a.class&&n.setClass(i,a.class),l&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],q=a[d];q!==c&&H(n,i,d,q,c)}l&16&&j(n,i,s,a)}else j(n,i,s,a);(!l||!(l&1))&&Z(n,e,t,o,i,null,r)}function Z(n,e,t,o,r,i,s){let a=t.shapeFlag,l=o.shapeFlag,f=t.children,p=o.children;if(l&8){a&16&&b(e,f),f!==p&&(r.textContent=p);return}if(l&16){a&16?Te(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),A(Y(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&b(e,f))}function Te(n,e,t,o,r,i,s){o.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?(0,S.patchKeyedChildren)(t,o,r,i,s,null,!1):(0,S.patchUnkeyedChildren)(t,o,r,i,s,null,!1)}function Ce(n,e,t,o,r,i,s){let a=t.children,l=o.children;Array.isArray(l)&&l.length>0?(Z(n,e,t,o,r,i,s),o.el=l[0].el,o.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):i):Array.isArray(a)&&a.length>0&&l===null?(b(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function xe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let l=0;l<a.length;l++)O(n,e,s[l],a[l],r,null,i)}function Re(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ee(n){function e(r,i){Q(n,e,r,i)}(0,$.registerDOMOperations)({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,l,f,p){o(null,r,i,s,a)},patch(r,i,s,a,l,f,p,d){o(r,i,s,a,l)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,l){O(n,e,r,i,s,a,l)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var ne={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},oe={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},Ve={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function E(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in oe){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=ne[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function h(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in oe){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=ne[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function te(n){return n.startsWith("on")||n.startsWith("@")}function re(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],l=e?e[s]:void 0;s==="key"||s==="ref"||a!==l&&(s==="class"?n.className=a==null?"":String(a):s==="style"?Ae(n,a,l):te(s)||E(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":te(s)||h(n,s))}}function Ae(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function _(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function ie(n){return Ve[n]||n}var be=/^(?:@|on)/;function I(n){return n.replace(be,"").toLowerCase()}function G(n){let e=I(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Se={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function B(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=Se[i];s&&(o[s]=!0)}return o}function z(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var g="_vei";function se(n){return n[g]||null}function L(n,e,t,o,r){let i=G(e),s=B(I(e)),a=s.name,l=n[g];l||(l=n[g]={});let f=l[i];if(t&&f)f.value=t;else if(t&&!f){let p=z(t);l[i]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),l[i]=void 0)}function D(n){let e=n[g];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[g]={}}}var X=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(X||{});function v(n,e,t){let o=ce(e);o!==t&&(n.className=o)}function ce(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ce(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function N(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function ae(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function le(n,e,t,o){L(n,"",e,t,o)}var Oe=new Set(["class","style","key","ref"]);function _e(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function w(n,e,t,o,r){if(!Oe.has(e)){if(e==="class"){v(n,t,o);return}if(e==="style"){N(n,t,o);return}if(_e(e)){L(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function y(n,e,t,o,r){w(n,e,t,o,r)}function T(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&y(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&y(n,r,null,e[r],o)}function fe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){T(n,r,i,o);return}if(s===-2){T(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&v(n,i.class,r.class),s&4&&r.style!==i.style&&N(n,i.style,r.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=r[f],d=i[f];d!==p&&y(n,f,d,p,o)}s&16&&T(n,r,i,o)}var C=class{createElement(e){return _(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){E(e,t,o)}removeAttribute(e,t){h(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){v(e,t,o)}setStyleWithOld(e,t,o){N(e,t,o)}setAttributeWithOld(e,t,o,r){y(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){D(e)}},pe=new C;
package/dist/index.mjs CHANGED
@@ -1,8 +1 @@
1
- import{registerDOMOperations as ut}from"@lytjs/vdom";var H=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(H||{}),se=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(se||{}),Oe=Symbol("Fragment"),_e=Symbol("Text"),Me=Symbol("Comment");function V(n){return n.type===Oe}function W(n){return n.type===_e}function B(n){return n.type===Me}function we(n,e){return n.type===e.type&&n.key===e.key}function ae(n){return Array.isArray(n.dynamicChildren)}function He(n,e,t,r){if(t==="class")n.setClass(e,r);else if(t==="style")n.setStyle(e,r);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,i,r)}else t==="key"||t==="ref"||n.setAttribute(e,t,r)}function le(n,e,t,r,i){if(t==="class")n.setClass(e,r);else if(t==="style")n.setStyle(e,r||{});else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&n.removeEventListener(e,o,i),r&&n.addEventListener(e,o,r)}else n.setAttribute(e,t,r)}function ce(n,e,t,r){for(let i in r){if(i==="key"||i==="ref")continue;let o=t[i],s=r[i];s!==o&&le(n,e,i,s,o)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in r))if(i==="class")n.setClass(e,"");else if(i==="style")n.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let o=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();n.removeEventListener(e,o,t[i])}else n.removeAttribute(e,i)}function pe(n,e,t,r,i,o){let{shapeFlag:s}=t;if(V(t)){it(n,e,t,r,i,o);return}if(W(t)){let a=n.createText(t.children);t.el=a,n.insert(r,a,i);return}if(B(t)){let a=n.createComment(t.children);t.el=a,n.insert(r,a,i);return}if(s&1){rt(n,e,t,r,i,o);return}if(s&6){ot(e,t,r,i,o);return}}function rt(n,e,t,r,i,o){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];He(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&z(e,f,a,null,o),n.insert(r,a,i)}function z(n,e,t,r,i){for(let o=0;o<e.length;o++)n(null,e[o],t,r,i)}function it(n,e,t,r,i,o){let{children:s}=t,a=n.createComment("");n.insert(r,a,i),Array.isArray(s)&&s.length>0&&z(e,s,r,a,o),t.el=a,t.anchor=a}function ot(n,e,t,r,i){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(n(null,o.subTree,t,r,o),e.el=o.subTree.el)}function $e(n,e,t,r){let{shapeFlag:i,children:o}=t;if(V(t)){if(Array.isArray(o))for(let s=0;s<o.length;s++)e(o[s],r);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,r);return}t.el&&n.remove(t.el)}function K(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as st,patchUnkeyedChildren as at}from"@lytjs/vdom";function k(n,e,t,r,i,o=null,s=null){if(r==null){t&&e(t,i);return}if(t===null){pe(n,fe(n,e),r,i,o,s);return}if(ae(r)&&ae(t)){ft(n,e,t,r,i,s);return}if(!we(t,r)){e(t,i),pe(n,fe(n,e),r,i,o,s);return}r.el=t.el,r.anchor=t.anchor;let{shapeFlag:a}=r;if(V(r)){pt(n,e,t,r,i,o,s);return}if(W(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(B(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(a&1){lt(n,e,t,r,s);return}if(a&6){dt(t,r,s);return}}function fe(n,e){return(t,r,i,o,s)=>{k(n,e,t,r,i,o,s)}}function lt(n,e,t,r,i=null){let o=r.el=t.el,s=t.props||{},a=r.props||{},{patchFlag:l,dynamicProps:f}=r;if(l&&l>0){if(l&1&&t.children!==r.children&&(o.textContent=r.children),l&2&&s.class!==a.class&&n.setClass(o,a.class),l&4&&s.style!==a.style&&n.setStyle(o,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],u=a[d];u!==c&&le(n,o,d,u,c)}l&16&&ce(n,o,s,a)}else ce(n,o,s,a);(!l||!(l&1))&&Ie(n,e,t,r,o,null,i)}function Ie(n,e,t,r,i,o,s){let a=t.shapeFlag,l=r.shapeFlag,f=t.children,p=r.children;if(l&8){a&16&&K(e,f),f!==p&&(i.textContent=p);return}if(l&16){a&16?ct(n,e,f,p,i,o,s):(a&8&&(i.textContent=""),z(fe(n,e),p,i,o,s));return}p==null&&(a&8?i.textContent="":a&16&&K(e,f))}function ct(n,e,t,r,i,o,s){r.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?st(t,r,i,o,s,null,!1):at(t,r,i,o,s,null,!1)}function pt(n,e,t,r,i,o,s){let a=t.children,l=r.children;Array.isArray(l)&&l.length>0?(Ie(n,e,t,r,i,o,s),r.el=l[0].el,r.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(K(e,a),r.el=t.el,r.anchor=t.anchor):(r.el=t.el,r.anchor=t.anchor)}function ft(n,e,t,r,i,o){let s=t.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)k(n,e,s[l],a[l],i,null,o)}function dt(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function yt(n){function e(i,o){$e(n,e,i,o)}ut({insert(i,o,s){n.insert(o,i,s)},createElement(i){return n.createElement(i)},createText(i){return n.createText(i)},setText(i,o){i.nodeValue=o},setElementText(i,o){i.textContent=o},remove(i){n.remove(i)},createComment(i){return n.createComment(i)},mount(i,o,s,a,l,f,p){r(null,i,o,s,a)},patch(i,o,s,a,l,f,p,d){r(i,o,s,a,l)},unmount(i,o,s,a){e(i)},move(i,o,s){n.insert(o,i.el,s)}});function r(i,o,s,a,l){k(n,e,i,o,s,a,l)}return{mount(i,o){o.nodeType===1&&(o.textContent=""),r(null,i,o,null,null)},patch(i,o,s){var a;r(i,o,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,o){e(i,o)}}}var Pe={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},De={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},mt={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function G(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let i in t)n.style[i]=t[i];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let i=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(i,t);return}if(e in De){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let r=Pe[e]||e;if(r in n){try{n[r]=t==null?"":t}catch(i){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function U(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),i=n._vei;if(i){let o="on"+r.charAt(0).toUpperCase()+r.slice(1),s=i[o];s&&(n.removeEventListener(r,s),i[o]=void 0)}return}if(e in De){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=Pe[e]||e;if(t in n){try{n[t]=""}catch(r){n.removeAttribute(e)}return}n.removeAttribute(e)}function je(n){return n.startsWith("on")||n.startsWith("@")}function gt(n,e,t){let r=e?Object.keys(e):[],i=t?Object.keys(t):[];for(let o=0;o<i.length;o++){let s=i[o],a=t[s],l=e?e[s]:void 0;s==="key"||s==="ref"||a!==l&&(s==="class"?n.className=a==null?"":String(a):s==="style"?ht(n,a,l):je(s)||G(n,s,a))}for(let o=0;o<r.length;o++){let s=r[o];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":je(s)||U(n,s))}}function ht(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let r in t)r in e||(n.style[r]="");for(let r in e)n.style[r]=e[r]}function de(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function Nt(n){return mt[n]||n}var vt=/^(?:@|on)/;function ue(n){return n.replace(vt,"").toLowerCase()}function Fe(n){let e=ue(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var xt={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function We(n){let e=n.split("."),r={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let i=1;i<e.length;i++){let o=e[i],s=xt[o];s&&(r[s]=!0)}return r}function Be(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var $="_vei";function Tt(n){return n[$]||null}function Y(n,e,t,r,i){let o=Fe(e),s=We(ue(e)),a=s.name,l=n[$];l||(l=n[$]={});let f=l[o];if(t&&f)f.value=t;else if(t&&!f){let p=Be(t);l[o]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),l[o]=void 0)}function ye(n){let e=n[$];if(e){for(let t in e){let r=e[t];if(r){let i=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(i,r)}}n[$]={}}}var Ke=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(Ke||{});function I(n,e,t){let r=ke(e);r!==t&&(n.className=r)}function ke(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let r=0;r<n.length;r++){let i=ke(n[r]);i&&(t+=(t?" ":"")+i)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function j(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ze(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ze(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let r in t)r in e||(n.style[r]="");for(let r in e){let i=e[r],o=t[r];i!==o&&(n.style[r]=i==null?"":i)}}}function ze(n,e){for(let t in e)n.style[t]=e[t]==null?"":e[t]}function bt(n,e,t,r){Y(n,"",e,t,r)}var Et=new Set(["class","style","key","ref"]);function St(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function Ge(n,e,t,r,i){if(!Et.has(e)){if(e==="class"){I(n,t,r);return}if(e==="style"){j(n,t,r);return}if(St(e)){Y(n,e,t,r,i);return}if(t===!1||t==null){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(o){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function C(n,e,t,r,i){Ge(n,e,t,r,i)}function X(n,e,t,r){if(t)for(let i in t){if(i==="key"||i==="ref")continue;let o=t[i],s=e?e[i]:void 0;o!==s&&C(n,i,o,s,r)}if(e)for(let i in e)i==="key"||i==="ref"||(!t||!(i in t))&&C(n,i,null,e[i],r)}function At(n,e,t,r){let i=e.props||{},o=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){X(n,i,o,r);return}if(s===-2){X(n,i,o,r);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&i.class!==o.class&&I(n,o.class,i.class),s&4&&i.style!==o.style&&j(n,o.style,i.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=i[f],d=o[f];d!==p&&C(n,f,d,p,r)}s&16&&X(n,i,o,r)}var q=class{createElement(e){return de(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,r){G(e,t,r)}removeAttribute(e,t){U(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let r in t)e.style[r]=t[r]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let r="";for(let i in t)t[i]&&(r+=(r?" ":"")+i);e.className=r}else e.className=""}insert(e,t,r){r!=null?e.insertBefore(t,r):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,r){e.replaceChild(r,t)}addEventListener(e,t,r,i){e.addEventListener(t,r,i)}removeEventListener(e,t,r){e.removeEventListener(t,r)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,r){I(e,t,r)}setStyleWithOld(e,t,r){j(e,t,r)}setAttributeWithOld(e,t,r,i){C(e,t,r,i)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,r){r!=null?e.insertBefore(t,r):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){ye(e)}},Vt=new q;var me=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ct={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Rt=/[&<>"']/g,v={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},Lt=0;function y(n){return n.replace(Rt,e=>Ct[e])}function Ot(n,e){return n.startsWith("on")||n.startsWith("@")||n==="key"||n==="ref"||n==="__vccOpts"||n.startsWith("__")?"":e===!0?n:e===!1||e==null?"":n==="class"?`class="${y(Ue(e))}"`:n==="style"?`style="${y(_t(e))}"`:n==="dangerouslySetInnerHTML"||n==="innerHTML"?"":`${n}="${y(String(e))}"`}function Ue(n){if(!n)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(Ue).filter(Boolean).join(" ");if(typeof n=="object"){let e=[];for(let t in n)n[t]&&e.push(t);return e.join(" ")}return String(n)}function _t(n){if(!n)return"";if(typeof n=="string")return n;if(typeof n=="object"){let e=[];for(let t in n)if(n[t]){let r=t.replace(/([A-Z])/g,"-$1").toLowerCase();e.push(`${r}: ${n[t]}`)}return e.join("; ")}return String(n)}function ge(n){if(!n)return"";let e=[];for(let t in n){let r=n[t],i=Ot(t,r);i&&e.push(i)}return e.length>0?" "+e.join(" "):""}var J=class{createElement(e){return{tag:e,props:{},children:[]}}createText(e){return{type:"text",value:e}}createComment(e){return{type:"comment",value:e}}insert(e,t,r){e.children.push(t)}renderToString(e){return g(e)}async*renderToStream(e){yield*Z(e)}};function g(n){if(n==null)return"";let{type:e,props:t,children:r}=n;return typeof e=="symbol"&&String(e)==="Symbol(Fragment)"?Array.isArray(r)?r.map(i=>g(i)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?y(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?Mt(e,t,r,n):typeof e=="object"&&e!==null||typeof e=="function"?R(n):""}function Mt(n,e,t,r){let i=ge(e);if(me.has(n))return`<${n}${i} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${n}${i}>${a}</${n}>`}let o="",s=r.shapeFlag||0;return s&v.TEXT_CHILDREN?o=y(String(t||"")):s&v.ARRAY_CHILDREN&&Array.isArray(t)?o=t.map(a=>g(a)).join(""):s&v.SLOTS_CHILDREN&&typeof t=="object"&&t!==null?o=he(t):typeof t=="string"?o=y(t):Array.isArray(t)?o=t.map(a=>g(a)).join(""):typeof t=="number"&&(o=y(String(t))),`<${n}${i}>${o}</${n}>`}function he(n){let e=[];for(let t in n){let r=n[t];if(typeof r=="function"){let i=r();Array.isArray(i)?e.push(i.map(o=>g(o)).join("")):i!=null&&e.push(g(i))}else Array.isArray(r)?e.push(r.map(i=>g(i)).join("")):r!=null&&e.push(g(r))}return e.join("")}function R(n){let e=n.type;if(e&&e.__island)return wt(n,e);if(typeof e=="function"){let t=e(n.props||{},{slots:n.children||{}});return g(t)}if(typeof e=="object"&&e!==null){if(typeof e.render=="function"){let t=e.render(n.props||{},{slots:n.children||{},emit:()=>{}});return g(t)}if(typeof e.setup=="function"){let t=e.setup(n.props||{},{emit:()=>{},slots:n.children||{}});if(typeof t=="function"){let r=t();return g(r)}if(typeof e.render=="function"){let r=e.render(t||{},{slots:n.children||{},emit:()=>{}});return g(r)}}}return n.component&&n.component.subTree?g(n.component.subTree):"<!---->"}function wt(n,e){var u;let t=e.name||((u=n.props)==null?void 0:u["data-island-id"])||"anonymous",r=n.props||{},i=r["data-hydrate-when"]||e.__hydrateWhen||"",o=e.__islandTag||"div",s={};for(let m in r)m==="data-hydrate-when"||m==="data-island-id"||(s[m]=r[m]);let a=JSON.stringify(s),l=y(a),f="";if(typeof e.render=="function"){let m=e.render(r,{slots:n.children||{},emit:()=>{}});f=g(m)}else if(typeof e=="function"){let m=e(r,{slots:n.children||{}});f=g(m)}let p=i?` data-hydrate-when="${y(i)}"`:"",d=`<${o} data-hydrate="${y(t)}" data-props="${l}"${p}>${f}</${o}>`,c=`<script type="application/json" data-hydrate-props="${y(t)}">${a}<\/script>`;return d+c}async function*Z(n){if(n==null)return;let{type:e,props:t,children:r}=n;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)"){if(Array.isArray(r))for(let i of r)yield*Z(i);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield y(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*Ht(e,t,r,n);return}if(typeof e=="object"||typeof e=="function"){yield R(n);return}}async function*Ht(n,e,t,r){let i=ge(e);if(me.has(n)){yield`<${n}${i} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let s=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${n}${i}>${s}</${n}>`;return}yield`<${n}${i}>`;let o=r.shapeFlag||0;if(o&v.TEXT_CHILDREN)yield y(String(t||""));else if(o&v.ARRAY_CHILDREN&&Array.isArray(t))for(let s of t)yield*Z(s);else if(o&v.SLOTS_CHILDREN&&typeof t=="object"&&t!==null)yield he(t);else if(typeof t=="string")yield y(t);else if(Array.isArray(t))for(let s of t)yield*Z(s);else typeof t=="number"&&(yield y(String(t)));yield`</${n}>`}function $t(n){return g(n)}function It(n,e){let t=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=T(n,t);return new ReadableStream({async pull(i){let{value:o,done:s}=await r.next();s?i.close():i.enqueue(o)},async cancel(){await r.return(void 0)}})}async function*jt(n,e){let t=(e==null?void 0:e.suspenseIdPrefix)||"suspense";yield*T(n,t)}async function*T(n,e){if(n==null)return;let{type:t,props:r,children:i}=n;if(typeof t=="symbol"&&String(t)==="Symbol(Fragment)"){if(Array.isArray(i))for(let o of i)yield*T(o,e);return}if(typeof t=="symbol"&&String(t).includes("Text")){yield y(String(i||""));return}if(typeof t=="symbol"&&String(t).includes("Comment")){yield`<!--${String(i||"")}-->`;return}if(typeof t=="string"){yield*Pt(t,r,i,n,e);return}if(typeof t=="object"&&t!==null){let o=t;if(o.name==="Suspense"||o._isSuspense){yield*Dt(n,e);return}if(o._isAsyncComponent||o.__asyncSetup){yield*Ft(n,e);return}yield R(n);return}if(typeof t=="function"){yield R(n);return}}async function*Pt(n,e,t,r,i){let o=ge(e);if(me.has(n)){yield`<${n}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${n}${o}>${a}</${n}>`;return}yield`<${n}${o}>`;let s=r.shapeFlag||0;if(s&v.TEXT_CHILDREN)yield y(String(t||""));else if(s&v.ARRAY_CHILDREN&&Array.isArray(t))for(let a of t)yield*T(a,i);else if(s&v.SLOTS_CHILDREN&&typeof t=="object"&&t!==null)yield he(t);else if(typeof t=="string")yield y(t);else if(Array.isArray(t))for(let a of t)yield*T(a,i);else typeof t=="number"&&(yield y(String(t)));yield`</${n}>`}async function*Dt(n,e){let t=`${e}-${Lt++}`,r=n.type,o=(n.props||{}).fallback,s="";o&&(typeof o=="object"&&o!==null?s=g(o):typeof o=="string"&&(s=o));let a=n.children,l=[];if(typeof a=="object"&&a!==null){if(Array.isArray(a))l=a;else if(typeof a.default=="function"){let d=a.default();Array.isArray(d)?l=d:d!=null&&(l=[d])}}let f=[];function p(d){for(let c of d){if(c==null)continue;let u=c.type;if(u&&(u._isAsyncComponent||u.__asyncSetup||c.__asyncSetup)){let m=c.__asyncPromise||u.__asyncPromise;m&&f.push(m.then(()=>{}))}}}if(p(l),f.length===0){for(let d of l)yield*T(d,e);return}yield`<!--${t}-fallback-->`,yield s,await Promise.all(f),yield`<!--${t}-resolved-->`;for(let d of l)yield*T(d,e);yield`<!--/${t}-->`}async function*Ft(n,e){let t=n.type,r=n.__asyncPromise||t.__asyncPromise;if(r)try{await r}catch(i){yield"<!--async-component-error-->";return}yield R(n)}var Wt=new J;var ee={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},N=!1,ve=[],h={success:!0,mismatches:0,hydratedNodes:0};function Bt(){return N}function zt(n){N=n}function Kt(){return{...h}}function Xe(){h={success:!0,mismatches:0,hydratedNodes:0}}function kt(n){N?ve.push(n):n()}function Gt(n,e,t={}){Xe(),t.onHydrated&&ve.push(t.onHydrated),N=!0;try{let r=e.firstElementChild;return r?(n._vnode||n.mount(e),n._vnode&&E(r,n._vnode,t),N=!1,Ne(),h):(console.warn("[lyt] \u5BB9\u5668\u4E3A\u7A7A\uFF0C\u56DE\u9000\u5230\u5BA2\u6237\u7AEF\u6E32\u67D3"),N=!1,n.mount(e),h.success=!1,Ne(),h)}catch(r){return console.error("[lyt] \u6CE8\u6C34\u5931\u8D25\uFF0C\u56DE\u9000\u5230\u5BA2\u6237\u7AEF\u6E32\u67D3:",r),N=!1,h.success=!1,e.innerHTML="",n.mount(e),Ne(),h}}function Ne(){let n=ve.splice(0);for(let e of n)try{e()}catch(t){console.error("[lyt] onHydrated \u56DE\u8C03\u6267\u884C\u5931\u8D25:",t)}}function E(n,e,t){if(en(e)){qt(n,e,t);return}if(tn(e)){Yt(n,e,t);return}if(nn(e)){Xt(n,e,t);return}if(rn(e)){Jt(n,e,t);return}if(typeof e.type=="string"){Ut(n,e,t);return}}function Ut(n,e,t){let r=n.tagName.toLowerCase(),i=e.type.toLowerCase();if(r!==i){te(n,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${i}"`,t);return}e.el=n,e.props&&xe(n,e.props),e.ref&&Qt(n,e.ref),Zt(n,e,t),h.hydratedNodes++}function Yt(n,e,t){if(n.nodeType!==3){te(n,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",t);return}e.el=n;let r=n.nodeValue||"",i=String(e.children||"");r!==i&&(n.nodeValue=i,t.strict&&console.warn(`[lyt] \u6CE8\u6C34\u6587\u672C\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${i}"`)),h.hydratedNodes++}function Xt(n,e,t){if(n.nodeType!==8){te(n,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",t);return}e.el=n;let r=n.nodeValue||"",i=String(e.children||"");r!==i&&(n.nodeValue=i),h.hydratedNodes++}function qt(n,e,t){if(!Array.isArray(e.children))return;let r=Array.from(n.childNodes);for(let i=0;i<e.children.length;i++){let o=e.children[i],s=r[i];if(!s){console.warn(`[lyt] Fragment \u5B50\u8282\u70B9\u6570\u91CF\u4E0D\u5339\u914D: VNode \u6709 ${e.children.length} \u4E2A\u5B50\u8282\u70B9\uFF0CDOM \u53EA\u6709 ${r.length} \u4E2A`),h.mismatches++;break}E(s,o,t)}}function Jt(n,e,t){if(e.component&&e.component.subTree){E(n,e.component.subTree,t),e.el=e.component.subTree.el;return}let r=e.type;if(typeof r=="function")try{let i=r(e.props||{},{slots:e.children||{}});if(i){E(n,i,t),e.el=i.el;return}}catch(i){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let i=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(i){E(n,i,t),e.el=i.el;return}}catch(i){}te(n,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",t)}function Zt(n,e,t){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&ee.TEXT_CHILDREN){let i=n.textContent||"",o=String(e.children||"");i!==o&&(n.textContent=o,t.strict&&console.warn(`[lyt] \u6CE8\u6C34\u5B50\u8282\u70B9\u6587\u672C\u4E0D\u5339\u914D: DOM "${i}" vs VNode "${o}"`));return}if(Array.isArray(e.children)){let i=Array.from(n.childNodes),o=0;for(let s=0;s<i.length&&o<e.children.length;s++){let a=e.children[o];if(a==null){o++;continue}E(i[s],a,t),o++}o<e.children.length&&(console.warn(`[lyt] \u5B50\u8282\u70B9\u6570\u91CF\u4E0D\u5339\u914D: VNode \u6709 ${e.children.length} \u4E2A\uFF0CDOM \u53EA\u6709 ${i.length} \u4E2A`),h.mismatches++)}r&ee.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function xe(n,e){for(let t in e){let r=e[t];if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase();n.addEventListener(i,r)}}}function Qt(n,e){typeof e=="function"?e(n):e&&typeof e=="object"&&(e.current=n)}function en(n){return typeof n.type=="symbol"&&String(n.type)==="Symbol(Fragment)"}function tn(n){return typeof n.type=="symbol"&&String(n.type).includes("Text")}function nn(n){return typeof n.type=="symbol"&&String(n.type).includes("Comment")}function rn(n){return!!((n.shapeFlag||0)&(ee.STATEFUL_COMPONENT|ee.FUNCTIONAL_COMPONENT)||typeof n.type=="object"&&n.type!==null||typeof n.type=="function")}function te(n,e,t,r){let i=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${t}`;if(h.mismatches++,r.strict)throw new Error(i);console.warn(i)}var A=new Map,O=new Map,on={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},sn=/[&<>"']/g;function S(n){return n.replace(sn,e=>on[e])}function qe(n,e,t={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let i=r.querySelector(n);if(!i)return console.warn(`[lyt] hydrateIsland: \u672A\u627E\u5230\u5339\u914D\u5143\u7D20 "${n}"`),{success:!1,mismatches:0,hydratedNodes:0};let o=i.getAttribute("data-hydrate");if(!o)return console.warn("[lyt] hydrateIsland: \u5143\u7D20\u7F3A\u5C11 data-hydrate \u5C5E\u6027"),{success:!1,mismatches:0,hydratedNodes:0};if(i.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let s=an(o,r);if(s===null)return console.warn(`[lyt] hydrateIsland: \u65E0\u6CD5\u89E3\u6790 island "${o}" \u7684 props`),{success:!1,mismatches:0,hydratedNodes:0};let a=i.getAttribute("data-hydrate-when");return a||t.lazy?ln(i,o,e,s,a||"visible",t):b(i,o,e,s,t)}function an(n,e){let t=e.querySelector(`script[type="application/json"][data-hydrate-props="${n}"]`);if(!t){let r=e.querySelector(`[data-hydrate="${n}"]`);if(r){let i=r.getAttribute("data-props");if(i)try{return JSON.parse(i)}catch(o){return null}}return{}}try{return JSON.parse(t.textContent||"{}")}catch(r){return null}}function b(n,e,t,r,i){let o={success:!0,mismatches:0,hydratedNodes:0};try{N=!0;let s=null;if(typeof t.render=="function")s=t.render(r,{slots:t.slots||{},emit:()=>{}});else if(typeof t.setup=="function"){let l=t.setup(r,{emit:()=>{},slots:t.slots||{}});typeof l=="function"&&(s=l())}if(!s)return console.warn(`[lyt] island "${e}": \u7EC4\u4EF6\u672A\u8FD4\u56DE VNode`),N=!1,o.success=!1,o;if(i.dev!==!1){let l=gn(n,s,e);o.mismatches=l}E(n,s,i),o.hydratedNodes=h.hydratedNodes,s.props&&xe(n,s.props),Q(n,s),n.setAttribute("data-hydrated","");let a={id:e,hydrated:!0,instance:t,eventListeners:[],timeoutId:null,observer:null,interactionHandler:null};return A.set(e,a),O.set(e,t),N=!1,i.onHydrated&&i.onHydrated(),o}catch(s){return N=!1,console.error(`[lyt] island "${e}" \u6CE8\u6C34\u5931\u8D25:`,s),o.success=!1,o}}function Q(n,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let t=Array.from(n.children),r=0;for(let i=0;i<t.length&&r<e.children.length;i++){let o=e.children[r];if(o==null){r++;continue}if(typeof o.type=="string"&&o.props)xe(t[i],o.props),Q(t[i],o);else if(typeof o.type=="object"||typeof o.type=="function"){let s=o.type;if(typeof s=="function")try{let a=s(o.props||{},{slots:o.children||{}});a&&t[i]&&Q(t[i],a)}catch(a){}else if(s&&typeof s.render=="function")try{let a=s.render(o.props||{},{slots:o.children||{},emit:()=>{}});a&&t[i]&&Q(t[i],a)}catch(a){}}r++}}}function ln(n,e,t,r,i,o){let s={success:!0,mismatches:0,hydratedNodes:0},a=null;o.timeout&&o.timeout>0&&(a=setTimeout(()=>{Je(n,e),b(n,e,t,r,o)},o.timeout));let l={id:e,hydrated:!1,instance:t,eventListeners:[],timeoutId:a,observer:null,interactionHandler:null};switch(A.set(e,l),O.set(e,t),i){case"visible":{if(typeof IntersectionObserver!="undefined"){let f=new IntersectionObserver(p=>{for(let d of p)d.isIntersecting&&(f.unobserve(d.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,b(n,e,t,r,o))},{rootMargin:"200px"});f.observe(n),l.observer=f}else a&&clearTimeout(a),b(n,e,t,r,o);break}case"idle":{(p=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(p,{timeout:o.timeout||2e3}):setTimeout(p,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,n.hasAttribute("data-hydrated")||b(n,e,t,r,o)});break}case"interaction":{let f=()=>{a&&clearTimeout(a),l.timeoutId=null,l.interactionHandler=null,document.removeEventListener("click",f),document.removeEventListener("keydown",f),document.removeEventListener("scroll",f),document.removeEventListener("touchstart",f),n.hasAttribute("data-hydrated")||b(n,e,t,r,o)};document.addEventListener("click",f,{once:!1,passive:!0}),document.addEventListener("keydown",f,{once:!1,passive:!0}),document.addEventListener("scroll",f,{once:!1,passive:!0}),document.addEventListener("touchstart",f,{once:!1,passive:!0}),l.interactionHandler=f;break}default:a&&clearTimeout(a),b(n,e,t,r,o)}return s}function Je(n,e){let t=A.get(e);t&&(t.observer&&(t.observer.disconnect(),t.observer=null),t.timeoutId!==null&&(clearTimeout(t.timeoutId),t.timeoutId=null),t.interactionHandler&&(document.removeEventListener("click",t.interactionHandler),document.removeEventListener("keydown",t.interactionHandler),document.removeEventListener("scroll",t.interactionHandler),document.removeEventListener("touchstart",t.interactionHandler),t.interactionHandler=null))}function cn(n={}){let e=typeof document!="undefined"?document:null;if(!e)return{success:!1,mismatches:0,hydratedNodes:0};let t=e.querySelectorAll("[data-hydrate]:not([data-hydrated])"),r={success:!0,mismatches:0,hydratedNodes:0};return t.forEach(i=>{let o=i.getAttribute("data-hydrate"),s=O.get(o);if(!s){console.warn(`[lyt] hydrateAllIslands: \u672A\u627E\u5230 island "${o}" \u7684\u7EC4\u4EF6\u6CE8\u518C`),r.success=!1;return}let a=qe(`[data-hydrate="${o}"]`,s,n);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function pn(n,e){O.set(n,e)}function fn(n){if(!A.get(n))return;let t=typeof document!="undefined"?document.querySelector(`[data-hydrate="${n}"]`):null;t&&(Je(t,n),t.removeAttribute("data-hydrated")),A.delete(n),O.delete(n)}function dn(){return A}function un(){A.clear(),O.clear()}function yn(n,e={},t="div",r){let i=n.name||"anonymous",o=JSON.stringify(e),s=S(o),a="";if(typeof n.render=="function"){let d=n.render(e,{slots:n.slots||{},emit:()=>{}});a=L(d)}let l=r?` data-hydrate-when="${r}"`:"",f=`<${t} data-hydrate="${i}" data-props="${s}"${l}>${a}</${t}>`,p=`<script type="application/json" data-hydrate-props="${i}">${o}<\/script>`;return f+p}function L(n){if(n==null)return"";let{type:e,props:t,children:r}=n;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)")return Array.isArray(r)?r.map(i=>L(i)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return S(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${String(r||"")}-->`;if(typeof e=="string"){let i=mn(t);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${i} />`;let s="";return typeof r=="string"?s=S(r):Array.isArray(r)?s=r.map(a=>L(a)).join(""):typeof r=="number"&&(s=S(String(r))),`<${e}${i}>${s}</${e}>`}if(typeof e=="function"){let i=e(t||{},{slots:r||{}});return L(i)}if(typeof e=="object"&&e!==null){let i=e;if(typeof i.render=="function"){let o=i.render(t||{},{slots:r||{},emit:()=>{}});return L(o)}}return""}function mn(n){if(!n)return"";let e=[];for(let t in n){let r=n[t];if(!(t.startsWith("on")||t.startsWith("@")||t==="key"||t==="ref")&&!(t==="__vccOpts"||t.startsWith("__"))&&!(t==="dangerouslySetInnerHTML"||t==="innerHTML"))if(r===!0)e.push(t);else{if(r===!1||r==null)continue;t==="class"&&typeof r=="string"?e.push(`class="${S(r)}"`):t==="style"&&typeof r=="string"?e.push(`style="${S(r)}"`):e.push(`${t}="${S(String(r))}"`)}}return e.length>0?" "+e.join(" "):""}var Te=[];function gn(n,e,t){let r=0,i=hn(n),o=L(e);if(i!==o){r++;let s={islandId:t,expected:o,actual:i,suggestion:Nn(i,o,t)};Te.push(s),console.warn(`[lyt] Hydration mismatch in island "${t}":
2
- \u670D\u52A1\u7AEF: ${i}
3
- \u5BA2\u6237\u7AEF: ${o}
4
- \u5EFA\u8BAE: ${s.suggestion}`)}return r}function hn(n){let e=n.cloneNode(!0);return e.removeAttribute("data-hydrate"),e.removeAttribute("data-props"),e.removeAttribute("data-hydrate-when"),e.removeAttribute("data-hydrated"),e.innerHTML}function Nn(n,e,t){if(n.trim()==="")return`\u670D\u52A1\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${t}" \u7684\u670D\u52A1\u7AEF\u6E32\u67D3\u903B\u8F91`;if(e.trim()==="")return`\u5BA2\u6237\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${t}" \u7684 render \u51FD\u6570`;let r=/\d{10,13}/;return r.test(n)||r.test(e)?"\u68C0\u6D4B\u5230\u65F6\u95F4\u6233\u5DEE\u5F02\uFF0C\u8003\u8651\u4F7F\u7528\u7EDF\u4E00\u7684\u65F6\u95F4\u6E90\u6216\u5EF6\u8FDF\u6CE8\u6C34":Ye(n)===Ye(e)?"HTML \u5185\u5BB9\u76F8\u540C\u4F46\u5C5E\u6027\u987A\u5E8F\u4E0D\u540C\uFF0C\u8FD9\u4E0D\u5F71\u54CD\u529F\u80FD\u4F46\u53EF\u80FD\u5BFC\u81F4 mismatch \u8B66\u544A":`\u8BF7\u786E\u4FDD\u7EC4\u4EF6 "${t}" \u5728\u670D\u52A1\u7AEF\u548C\u5BA2\u6237\u7AEF\u6E32\u67D3\u76F8\u540C\u7684\u8F93\u51FA`}function Ye(n){return n.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function vn(){return[...Te]}function xn(){Te.length=0}var Tn={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",img:"Image",input:"TextInput",textarea:"TextInput",button:"TouchableOpacity",scroll:"ScrollView",list:"FlatList",a:"TouchableOpacity",ul:"View",ol:"View",li:"View",form:"View",header:"View",footer:"View",nav:"View",main:"View",section:"View",article:"View",aside:"View"},bn={flexDirection:"flexDirection",justifyContent:"justifyContent",alignItems:"alignItems",alignSelf:"alignSelf",flexWrap:"flexWrap",flex:"flex",flexGrow:"flexGrow",flexShrink:"flexShrink",flexBasis:"flexBasis",backgroundColor:"backgroundColor",color:"color",fontSize:"fontSize",fontWeight:"fontWeight",fontStyle:"fontStyle",textAlign:"textAlign",lineHeight:"lineHeight",letterSpacing:"letterSpacing",padding:"padding",paddingTop:"paddingTop",paddingBottom:"paddingBottom",paddingLeft:"paddingLeft",paddingRight:"paddingRight",paddingHorizontal:"paddingHorizontal",paddingVertical:"paddingVertical",margin:"margin",marginTop:"marginTop",marginBottom:"marginBottom",marginLeft:"marginLeft",marginRight:"marginRight",marginHorizontal:"marginHorizontal",marginVertical:"marginVertical",width:"width",height:"height",minWidth:"minWidth",maxWidth:"maxWidth",minHeight:"minHeight",maxHeight:"maxHeight",borderRadius:"borderRadius",borderWidth:"borderWidth",borderColor:"borderColor",overflow:"overflow",opacity:"opacity",position:"position",top:"top",left:"left",right:"right",bottom:"bottom",zIndex:"zIndex",shadowColor:"shadowColor",shadowOffset:"shadowOffset",shadowOpacity:"shadowOpacity",shadowRadius:"shadowRadius"},En={click:"onPress",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",change:"onChange",input:"onChangeText",focus:"onFocus",blur:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",longpress:"onLongPress"},Sn=0;function be(){return`native_${++Sn}`}var ne=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:be()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:be()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:be()}}setAttribute(e,t,r){if(e){if(t==="style"&&typeof r=="object"&&r!==null){e.props.style={...e.props.style,...this.mapStyle(r)};return}if(t==="className"||t==="class"){e.props.className=r;return}if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase(),o=this.mapEvent(i);e.props[o]=r;return}if(t==="src"&&e.type==="Image"){e.props.source={uri:r};return}if(t==="href"){e.props.href=r;return}if(t==="placeholder"){e.props.placeholder=r;return}e.props[t]=r}}removeAttribute(e,t){if(e)if(t==="style")delete e.props.style;else if(t.startsWith("on")){let r=t.slice(2).toLowerCase(),i=this.mapEvent(r);delete e.props[i]}else delete e.props[t]}setStyle(e,t){if(!e)return;let r=this.mapStyle(t);e.props.style={...e.props.style,...r}}setClass(e,t){if(e){if(typeof t=="string")e.props.className=t;else if(typeof t=="object"&&t!==null){let r=[];for(let[i,o]of Object.entries(t))o&&r.push(i);e.props.className=r.join(" ")}}}insert(e,t,r){if(!(!e||!t)){if(t._parent){let i=t._parent,o=i.children.indexOf(t);o!==-1&&i.children.splice(o,1)}if(t._parent=e,r){let i=e.children.indexOf(r);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,r=t.children.indexOf(e);r!==-1&&t.children.splice(r,1),e._parent=void 0}replace(e,t,r){if(!e||!t||!r)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,r._parent=e,e.children[i]=r)}addEventListener(e,t,r,i){if(!e)return;let o=this.mapEvent(t);e.props[o]=r}removeEventListener(e,t,r){if(!e)return;let i=this.mapEvent(t);e.props[i]===r&&delete e.props[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,r=t.indexOf(e);return r!==-1&&r+1<t.length?t[r+1]:null}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,r,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let o=t.slice(2).toLowerCase(),s=this.mapEvent(o);e.props[s]=i}else this.setAttribute(e,t,i)}}querySelector(e){let t=e.replace(/[.#\[\]]/g,"").trim();return null}renderToNativeTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__Fragment");if(Array.isArray(e.children))for(let r of e.children){let i=this.renderToNativeTree(r);this.insert(t,i)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[r,i]of Object.entries(e.props))r==="key"||r==="ref"||this.setAttribute(t,r,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToNativeTree(r))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToNativeTree(r));return t}return this.createComment("unknown vnode type")}serializeToJSON(e){let t=r=>{let i={type:r.type,props:{...r.props},children:r.children.map(t)};return r.nativeId&&(i.nativeId=r.nativeId),i};return JSON.stringify(t(e),null,2)}getComponentType(e){return Tn[e]||An(e)}mapStyle(e){let t={};for(let[r,i]of Object.entries(e)){let o=bn[r]||r;typeof i=="string"&&/^\d+px$/.test(i)?t[o]=parseInt(i,10):t[o]=i}return t}mapEvent(e){return En[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function An(n){return n.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var Vn=new ne;var Cn={if:{attr:"if"},else:{attr:"else"},each:{attr:"for",prefix:""},bind:{attr:"model:"},on:{attr:"bind",prefix:""},ref:{attr:""},slot:{attr:"slot"},class:{attr:"class"},style:{attr:"style"},show:{attr:"hidden"}},_={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"},Rn={div:"view",span:"text",p:"text",h1:"text",h2:"text",h3:"text",h4:"text",h5:"text",h6:"text",img:"image",input:"input",textarea:"textarea",button:"button",scroll:"scroll-view",list:"view",a:"navigator",ul:"view",ol:"view",li:"view",form:"form",header:"view",footer:"view",nav:"view",main:"view",section:"view",article:"view",aside:"view"},M={wechat:{if:"wx:if",else:"wx:else",for:"wx:for",forKey:"wx:key",bind:"bind",catch:"catch"},alipay:{if:"a:if",else:"a:else",for:"a:for",forKey:"a:key",bind:"on",catch:"catchEvent"},bytedance:{if:"tt:if",else:"tt:else",for:"tt:for",forKey:"tt:key",bind:"bind",catch:"catch"}},re=class{createElement(e){return{tag:Rn[e]||e,attrs:{},children:[],bindEvents:{},modelBindings:{}}}createText(e){return{tag:"__text__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}createComment(e){return{tag:"__comment__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}setAttribute(e,t,r){if(e){if(t.startsWith("lyt:")){let i=t.slice(4);this._applyDirective(e,i,r);return}if(t==="v-if"||t==="if"){e.wxIf=String(r);return}if(t==="v-else"||t==="else"){e.attrs["wx:else"]="";return}if(t==="v-for"||t==="each"){let i=String(r),o=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);o?(e.wxFor=o[4]||o[3],e.wxForKey=o[1]||o[3]):e.wxFor=i;return}if(t.startsWith("on")&&typeof r=="function"){let i=t.slice(2).toLowerCase(),o=_[i]||i;e.bindEvents[o]=r.name||"handleEvent";return}if(t==="v-model"||t==="model"){e.modelBindings.value=String(r);return}if(t==="class"||t==="className"){e.attrs.class=String(r);return}if(t==="style"){typeof r=="object"&&r!==null?e.attrs.style=this._styleObjectToString(r):e.attrs.style=String(r);return}if(t==="href"&&e.tag==="navigator"){e.attrs.url=String(r);return}e.attrs[t]=String(r)}}removeAttribute(e,t){if(e)if(t==="v-if"||t==="if")delete e.wxIf;else if(t==="v-for"||t==="each")delete e.wxFor,delete e.wxForKey;else if(t.startsWith("on")){let r=t.slice(2).toLowerCase(),i=_[r]||r;delete e.bindEvents[i]}else delete e.attrs[t]}setStyle(e,t){if(!e)return;let r=this._styleObjectToString(t);e.attrs.style=r}setClass(e,t){if(e){if(typeof t=="string")e.attrs.class=t;else if(typeof t=="object"&&t!==null){let r=[];for(let[i,o]of Object.entries(t))o&&r.push(i);e.attrs.class=r.join(" ")}}}insert(e,t,r){if(!(!e||!t)){if(t._parent){let i=t._parent,o=i.children.indexOf(t);o!==-1&&i.children.splice(o,1)}if(t._parent=e,r){let i=e.children.indexOf(r);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,r=t.children.indexOf(e);r!==-1&&t.children.splice(r,1),e._parent=void 0}replace(e,t,r){if(!e||!t||!r)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,r._parent=e,e.children[i]=r)}addEventListener(e,t,r,i){if(!e)return;let o=_[t]||t;e.bindEvents[o]=r.name||"handleEvent"}removeEventListener(e,t,r){if(!e)return;let i=_[t]||t;delete e.bindEvents[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,r=t.indexOf(e);return r!==-1&&r+1<t.length?t[r+1]:null}setText(e,t){e&&e.tag==="__text__"&&(e.text=t)}patchProp(e,t,r,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let o=t.slice(2).toLowerCase(),s=_[o]||o;e.bindEvents[s]=i.name||"handleEvent"}else this.setAttribute(e,t,i)}}querySelector(e){return null}renderToMiniAppTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__fragment__");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r));return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[r,i]of Object.entries(e.props))r==="key"||r==="ref"||this.setAttribute(t,r,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r));return t}return this.createComment("unknown vnode type")}serializeToWXML(e,t=0){return this._serializeToTemplate(e,t,"wechat")}serializeToAXML(e,t=0){return this._serializeToTemplate(e,t,"alipay")}serializeToTTML(e,t=0){return this._serializeToTemplate(e,t,"bytedance")}getPlatformTemplate(e,t){return this._serializeToTemplate(e,0,t)}mapDirective(e,t,r="wechat"){let i=M[r]||M.wechat,o=Cn[e];if(!o)return"";switch(e){case"if":return`${i.if}="{{${t}}}"`;case"else":return`${i.else}`;case"each":{let s=t.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);if(s){let a=s[1]||s[3],l=s[4]||s[3];return`${i.for}="{{${l}}}" ${i.forKey}="{{${a}}}"`}return`${i.for}="{{${t}}}"`}case"show":return`hidden="{{!${t}}}"`;default:return`${o.attr}="${t}"`}}mapEvent(e,t="wechat"){let r=M[t]||M.wechat,i=_[e]||e;return r.bind==="on"?`on${i.charAt(0).toUpperCase()}${i.slice(1)}`:`${r.bind}${i}`}_applyDirective(e,t,r){switch(t){case"if":e.wxIf=String(r);break;case"else":e.attrs["wx:else"]="";break;case"each":{let i=String(r),o=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);o?(e.wxFor=o[4]||o[3],e.wxForKey=o[1]||o[3]):e.wxFor=i;break}case"show":e.attrs.hidden=String(r);break;default:e.attrs[t]=String(r)}}_styleObjectToString(e){return Object.entries(e).map(([t,r])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${r}`).join("; ")}_serializeToTemplate(e,t,r){let i=" ".repeat(t),o=M[r]||M.wechat;if(e.tag==="__text__")return`${i}${e.text||""}`;if(e.tag==="__comment__")return`${i}<!-- ${e.text||""} -->`;if(e.tag==="__fragment__")return e.children.map(p=>this._serializeToTemplate(p,t,r)).join(`
5
- `);let s=[];for(let[p,d]of Object.entries(e.attrs)){if(p==="wx:else"){s.push(o.else);continue}s.push(`${p}="${d}"`)}e.wxIf&&s.unshift(`${o.if}="{{${e.wxIf}}}"`),e.wxFor&&(s.unshift(`${o.for}="{{${e.wxFor}}}"`),e.wxForKey&&s.unshift(`${o.forKey}="{{${e.wxForKey}}}"`));for(let[p,d]of Object.entries(e.bindEvents)){let c=o.bind==="on"?`on${p.charAt(0).toUpperCase()}${p.slice(1)}`:`${o.bind}${p}`;s.push(`${c}="${d}"`)}for(let[p,d]of Object.entries(e.modelBindings))s.push(`model:${p}="{{${d}}}"`);let a=s.length>0?" "+s.join(" "):"",l=new Set(["image","input"]);if(e.children.length===0&&l.has(e.tag))return`${i}<${e.tag}${a} />`;if(e.children.length===0)return`${i}<${e.tag}${a}></${e.tag}>`;let f=e.children.map(p=>this._serializeToTemplate(p,t+1,r)).join(`
6
- `);return`${i}<${e.tag}${a}>
7
- ${f}
8
- ${i}</${e.tag}>`}};var Ln=new re;import{effect as w}from"@lytjs/reactivity/signal";function Ee(n,e){return w(()=>{let r=e();n.textContent=r==null?"":String(r)})}function ie(n,e,t){return w(()=>{let i=t();n[e]=i})}function Se(n,e,t){return w(()=>{let i=t();i==null||i===!1?n.removeAttribute(e):n.setAttribute(e,i===!0?"":String(i))})}function Ae(n,e){return w(()=>{let r=e();if(typeof r=="string")n.className=r;else if(Array.isArray(r))n.className=r.filter(Boolean).join(" ");else if(typeof r=="object"&&r!==null){let i=[];for(let o of Object.keys(r))r[o]&&i.push(o);n.className=i.join(" ")}else n.className=""})}function Ve(n,e,t){return n.addEventListener(e,t),()=>{n.removeEventListener(e,t)}}function Ze(n,e){return w(()=>{e()?(n.style=n.style||{},n.style.display==="none"&&(n.style.display=""),n.hidden=!1):(n.style=n.style||{},n.style.display="none",n.hidden=!0)})}function Qe(n,e,t,r){let i=[],o=[],s=new Map,a=w(()=>{let l=e();if(!Array.isArray(l))return;let f=l.map((p,d)=>r?r(p,d):d);if(f.length===o.length){let p=!0;for(let d=0;d<f.length;d++)if(f[d]!==o[d]){p=!1;break}if(p){for(let d=0;d<l.length;d++){let c=t(l[d],d),u=i[d];u&&u.parentNode===n&&n.replaceChild(c,u),i[d]=c}return}}for(let p of i)p.parentNode===n&&n.removeChild(p);s.clear(),i=[],o=[];for(let p=0;p<l.length;p++){let d=t(l[p],p);n.appendChild(d),i.push(d),o.push(f[p]),s.set(f[p],d)}});return()=>{a();for(let l of i)l.parentNode===n&&n.removeChild(l);i=[],o=[],s.clear()}}var oe=n=>{if(typeof document!="undefined")return document.createElement(n);throw new Error("[lyt:vapor] \u672A\u8BBE\u7F6E DOM \u5DE5\u5382\u51FD\u6570\u3002\u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\u8BF7\u8C03\u7528 setVaporDOMFactory()")};function On(n){oe=n}function P(){return oe}function tt(n,e,...t){let r={tag:n,children:[],props:{},events:{},bindings:[]};if(e)for(let[i,o]of Object.entries(e))if(i.startsWith("on")&&typeof o=="function"&&!et(o)){let s=i.slice(2).toLowerCase();r.events[s]=o}else et(o)?i==="textContent"||i==="text"?r.bindings.push({type:"text",target:"textContent",signal:o}):i==="className"||i==="class"?r.bindings.push({type:"class",target:"className",signal:o}):i==="style"?r.bindings.push({type:"style",target:"style",signal:o}):r.bindings.push({type:"prop",target:i,signal:o}):r.props[i]=o;for(let i of t)typeof i=="string"?r.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:i}):r.children.push(i);return r}function et(n){return typeof n!="function"?!1:!!(n._subscribe||n.set)&&!n.toString().startsWith("class")}function x(n){if(n.tag==="#text"){let t=oe("#text");return t.textContent=n.text||"",t.nodeType=3,t}let e=oe(n.tag);n.el=e;for(let[t,r]of Object.entries(n.props))if(t==="style"&&typeof r=="object")for(let[i,o]of Object.entries(r))e.style[i]=o;else t==="className"||t==="class"?e.className=String(r):e[t]=r;for(let t of n.bindings)t.type==="text"?Ee(e,t.signal):t.type==="prop"?ie(e,t.target,t.signal):t.type==="attr"?Se(e,t.target,t.signal):t.type==="class"?Ae(e,t.signal):t.type==="style"&&ie(e,"style",t.signal);for(let[t,r]of Object.entries(n.events))Ve(e,t,r);for(let t of n.children){let r=x(t);e.appendChild(r)}return e}function nt(n,e,t){if(n.tag!==e.tag){let o=x(e);n.el&&n.el.parentNode===t&&t.removeChild(n.el),t.appendChild(o);return}let r=n.el||x(n);e.el=r;for(let[o,s]of Object.entries(e.props))if(o==="style"&&typeof s=="object")for(let[a,l]of Object.entries(s))r.style[a]=l;else o==="className"||o==="class"?r.className=String(s):r[o]=s;e.text!==void 0&&(r.textContent=e.text);for(let[o,s]of Object.entries(n.events))e.events[o]||r.removeEventListener(o,s);for(let[o,s]of Object.entries(e.events))n.events[o]!==s&&(n.events[o]&&r.removeEventListener(o,n.events[o]),r.addEventListener(o,s));let i=Math.max(n.children.length,e.children.length);for(let o=0;o<i;o++){let s=n.children[o],a=e.children[o];if(!s&&a){let l=x(a);r.appendChild(l)}else s&&!a?s.el&&s.el.parentNode===r&&r.removeChild(s.el):s&&a&&nt(s,a,r)}}function Ce(n,e){let t=e.setup?e.setup():{};e.beforeMount&&e.beforeMount();let r;if(e.render){let o=e.render(t,tt);r=Array.isArray(o)?o:[o]}else r=[];let i=[];for(let o of r){let s=x(o);n.appendChild(s),i.push(s)}return e.mounted&&e.mounted(),()=>{e.beforeUnmount&&e.beforeUnmount();for(let o of i)n.removeChild(o);e.unmounted&&e.unmounted()}}function Re(n){let e={type:"fragment",children:[]},t=n.trim();for(;t.length>0;){let r=t.match(/^<([a-zA-Z][a-zA-Z0-9-]*)([\s\S]*?)(\/?)>/);if(r){let i=r[1],o=r[2],s=r[3]==="/",{props:a,events:l,directives:f}=Mn(o),p={type:"element",tag:i,props:a,events:l,directives:f,children:[]};if(t=t.slice(r[0].length),s){e.children.push(p);continue}let d=`</${i}>`,c=_n(t,i);if(c===-1)throw new Error(`[lyt:vapor:compiler] \u672A\u627E\u5230\u95ED\u5408\u6807\u7B7E: </${i}>`);let u=t.slice(0,c);t=t.slice(c+d.length);let m=Re(u);p.children=m.children||[],e.children.push(p)}else{let i=t.indexOf("<"),o;if(i===-1?(o=t,t=""):(o=t.slice(0,i),t=t.slice(i)),o.trim())if(o.includes("{{")){let s=wn(o);for(let a of s)a.type==="text"?e.children.push({type:"text",text:a.value}):e.children.push({type:"interpolation",expression:a.value})}else e.children.push({type:"text",text:o})}}return e}function _n(n,e){let t=1,r=0,i=`<${e}`,o=`</${e}>`;for(;r<n.length&&t>0;){let s=n.indexOf(i,r),a=n.indexOf(o,r);if(a===-1)return-1;if(s!==-1&&s<a){let l=n[s+i.length];l===">"||l===" "||l==="/"?(t++,r=s+i.length):(r=a+o.length,t--)}else r=a+o.length,t--}return t===0?r-o.length:-1}function Mn(n){let e={},t={},r={},i=/([a-zA-Z@:][a-zA-Z0-9@:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,o;for(;(o=i.exec(n))!==null;){let s=o[1],a=o[2]||o[3];if(s.startsWith("on:")){let l=s.slice(3);t[l]=a}else if(s.startsWith(":")){let l=s.slice(1);e[l]=a}else if(s==="v-if")r.if=a;else if(s==="v-each"){let l=a.match(/^\s*(\w+)\s+in\s+(.+)\s*$/);l&&(r.each={item:l[1],expression:l[2]})}else e[s]=a}return{props:e,events:t,directives:r}}function wn(n){let e=[],t=/\{\{([\s\S]*?)\}\}/g,r=0,i;for(;(i=t.exec(n))!==null;)i.index>r&&e.push({type:"text",value:n.slice(r,i.index)}),e.push({type:"interpolation",value:i[1].trim()}),r=i.index+i[0].length;return r<n.length&&e.push({type:"text",value:n.slice(r)}),e}function Le(n){let e=Re(n);return{render:Hn(e),ast:e}}function Hn(n){return function(t){let r=P();return F(n,t,r)}}function F(n,e,t){var r,i;if(n.type==="fragment"){if(n.children&&n.children.length===1)return F(n.children[0],e,t);let o=t("div");if(o.nodeType=11,n.children)for(let s of n.children){let a=F(s,e,t);o.appendChild(a)}return o}if(n.type==="text"){let o=t("#text");return o.textContent=n.text||"",o.nodeType=3,o}if(n.type==="interpolation"){let o=t("span"),s=n.expression||"",a=D(e,s);return o.textContent=a!=null?String(a):"",o}if(n.type==="element"){if((r=n.directives)!=null&&r.each){let{item:s,expression:a}=n.directives.each,l=D(e,a),f=t("#fragment");if(f.childNodes=[],f.nodeType=11,Array.isArray(l))for(let p=0;p<l.length;p++){let d={...e,[s]:l[p],index:p},c=t(n.tag);if(n.props)for(let[u,m]of Object.entries(n.props))u==="class"||u==="className"?c.className=m:c[u]=m;if(n.children)for(let u of n.children){let m=F(u,d,t);c.appendChild(m)}f.appendChild(c)}return f}let o=t(n.tag);if((i=n.directives)!=null&&i.if&&(D(e,n.directives.if)||(o.style=o.style||{},o.style.display="none",o.hidden=!0)),n.props)for(let[s,a]of Object.entries(n.props))if(s.startsWith(":")){let l=s.slice(1),f=D(e,a);o[l]=f}else s==="class"||s==="className"?o.className=a:o[s]=a;if(n.events)for(let[s,a]of Object.entries(n.events)){let l=D(e,a);typeof l=="function"&&o.addEventListener(s,l)}if(n.children)for(let s of n.children){let a=F(s,e,t);if(a.nodeType===11&&a.childNodes)for(let l of a.childNodes)o.appendChild(l);else o.appendChild(a)}return o}return t("div")}function D(n,e){let t=e.trim();if(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)){let o=n[t];return typeof o=="function"&&!o.prototype?o():o}let r=t.split("."),i=n;for(let o of r){if(i==null)return;i=i[o],typeof i=="function"&&!i.prototype&&r.indexOf(o)<r.length-1&&(i=i())}return i}function $n(n){return n}function In(n){let e=!1,t=null,r=null;return{mount(i){if(e){console.warn("[lyt:vapor] App \u5DF2\u7ECF\u6302\u8F7D\uFF0C\u4E0D\u80FD\u91CD\u590D\u6302\u8F7D");return}if(typeof i=="string")if(typeof document!="undefined"){let o=document.querySelector(i);if(!o)throw new Error(`[lyt:vapor] \u672A\u627E\u5230\u6302\u8F7D\u76EE\u6807: ${i}`);r=o}else throw new Error("[lyt:vapor] \u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\uFF0C\u8BF7\u76F4\u63A5\u4F20\u5165\u5BB9\u5668\u5143\u7D20");else r=i;t=Ce(r,n),e=!0},unmount(){if(!e){console.warn("[lyt:vapor] App \u672A\u6302\u8F7D\uFF0C\u4E0D\u80FD\u5378\u8F7D");return}t&&(t(),t=null),e=!1,r=null}}}function jn(n){let e=n.setup?n.setup():{};n.beforeMount&&n.beforeMount();let t;if(n.template){let{render:r}=Le(n.template);t=r(e)}else if(n.render){let r=n.render(e,Pn),i=Array.isArray(r)?r:[r];if(i.length===1)t=x(i[0]);else{t=P()("div");for(let s of i)t.appendChild(x(s))}}else throw new Error("[lyt:vapor] \u7EC4\u4EF6\u5FC5\u987B\u63D0\u4F9B template \u6216 render \u51FD\u6570");return n.mounted&&n.mounted(),t}function Pn(n,e,...t){let r={tag:n,children:[],props:e||{},events:{},bindings:[]};for(let i of t)typeof i=="string"?r.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:i}):r.children.push(i);return r}export{Me as Comment,q as DOMRenderer,Oe as Fragment,re as MiniAppRenderer,ne as NativeRenderer,se as PatchFlags,Ke as PatchPropFlags,H as ShapeFlags,J as StringRenderer,_e as Text,Se as bindAttr,Ae as bindClass,Qe as bindEach,Ve as bindEvent,Ze as bindIf,ie as bindProp,Ee as bindText,un as clearIslandRegistry,xn as clearMismatchWarnings,Le as compileToVapor,yn as createHydrationIsland,Be as createInvoker,yt as createRenderer,In as createVaporApp,tt as createVaporElement,$n as defineVaporComponent,Vt as domRenderer,Tt as getEventInvokers,Fe as getEventKey,Kt as getHydrateStats,dn as getIslandRegistry,vn as getMismatchWarnings,Nt as getSVGPropName,P as getVaporDOMFactory,Gt as hydrate,cn as hydrateAllIslands,qe as hydrateIsland,Bt as isHydrating,de as isSVGElement,Ln as miniAppRenderer,Vn as nativeRenderer,ue as normalizeEventName,kt as onHydrated,We as parseEventModifier,Re as parseTemplate,X as patchAllProps,I as patchClass,Ge as patchDOMProp,gt as patchDOMProps,At as patchElementProps,Y as patchEvent,bt as patchEventOnElement,C as patchProp,j as patchStyle,pn as registerIslandComponent,ye as removeAllEventListeners,U as removeDOMProp,It as renderToStream,jt as renderToStreamGenerator,$t as renderToString,jn as renderVaporComponent,x as renderVaporNode,Xe as resetHydrateStats,G as setDOMProp,zt as setHydrating,On as setVaporDOMFactory,Wt as ssrRenderer,fn as unmountIsland,Ce as vaporMount,nt as vaporPatch};
1
+ import{registerDOMOperations as de}from"@lytjs/vdom";var m=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(m||{}),S=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(S||{}),H=Symbol("Fragment"),j=Symbol("Text"),U=Symbol("Comment");function y(n){return n.type===H}function h(n){return n.type===j}function g(n){return n.type===U}function Y(n,e){return n.type===e.type&&n.key===e.key}function O(n){return Array.isArray(n.dynamicChildren)}function G(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function _(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function I(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&_(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function D(n,e,t,o,r,i){let{shapeFlag:s}=t;if(y(t)){oe(n,e,t,o,r,i);return}if(h(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(g(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){ne(n,e,t,o,r,i);return}if(s&6){re(e,t,o,r,i);return}}function ne(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];G(n,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&L(e,f,a,null,i),n.insert(o,a,r)}function L(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function oe(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&L(e,s,o,a,i),t.el=a,t.anchor=a}function re(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function B(n,e,t,o){let{shapeFlag:r,children:i}=t;if(y(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function T(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as ie,patchUnkeyedChildren as se}from"@lytjs/vdom";function C(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){D(n,M(n,e),o,r,i,s);return}if(O(o)&&O(t)){fe(n,e,t,o,r,s);return}if(!Y(t,o)){e(t,r),D(n,M(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(y(o)){le(n,e,t,o,r,i,s);return}if(h(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(g(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){ae(n,e,t,o,s);return}if(a&6){pe(t,o,s);return}}function M(n,e){return(t,o,r,i,s)=>{C(n,e,t,o,r,i,s)}}function ae(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:l,dynamicProps:f}=o;if(l&&l>0){if(l&1&&t.children!==o.children&&(i.textContent=o.children),l&2&&s.class!==a.class&&n.setClass(i,a.class),l&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],W=a[d];W!==c&&_(n,i,d,W,c)}l&16&&I(n,i,s,a)}else I(n,i,s,a);(!l||!(l&1))&&z(n,e,t,o,i,null,r)}function z(n,e,t,o,r,i,s){let a=t.shapeFlag,l=o.shapeFlag,f=t.children,p=o.children;if(l&8){a&16&&T(e,f),f!==p&&(r.textContent=p);return}if(l&16){a&16?ce(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),L(M(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&T(e,f))}function ce(n,e,t,o,r,i,s){o.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?ie(t,o,r,i,s,null,!1):se(t,o,r,i,s,null,!1)}function le(n,e,t,o,r,i,s){let a=t.children,l=o.children;Array.isArray(l)&&l.length>0?(z(n,e,t,o,r,i,s),o.el=l[0].el,o.anchor=l[l.length-1].el?n.nextSibling(l[l.length-1].el):i):Array.isArray(a)&&a.length>0&&l===null?(T(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function fe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let l=0;l<a.length;l++)C(n,e,s[l],a[l],r,null,i)}function pe(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ye(n){function e(r,i){B(n,e,r,i)}de({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,l,f,p){o(null,r,i,s,a)},patch(r,i,s,a,l,f,p,d){o(r,i,s,a,l)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,l){C(n,e,r,i,s,a,l)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var w={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},q={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},ue={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function x(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in q){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=w[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function R(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in q){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=w[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function X(n){return n.startsWith("on")||n.startsWith("@")}function me(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],l=e?e[s]:void 0;s==="key"||s==="ref"||a!==l&&(s==="class"?n.className=a==null?"":String(a):s==="style"?ve(n,a,l):X(s)||x(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":X(s)||R(n,s))}}function ve(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function P(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function Ne(n){return ue[n]||n}var Ee=/^(?:@|on)/;function k(n){return n.replace(Ee,"").toLowerCase()}function F(n){let e=k(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var he={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function J(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=he[i];s&&(o[s]=!0)}return o}function Q(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var v="_vei";function ge(n){return n[v]||null}function V(n,e,t,o,r){let i=F(e),s=J(k(e)),a=s.name,l=n[v];l||(l=n[v]={});let f=l[i];if(t&&f)f.value=t;else if(t&&!f){let p=Q(t);l[i]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),l[i]=void 0)}function K(n){let e=n[v];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[v]={}}}var $=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))($||{});function N(n,e,t){let o=ee(e);o!==t&&(n.className=o)}function ee(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ee(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function E(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function Z(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function Le(n,e,t,o){V(n,"",e,t,o)}var Te=new Set(["class","style","key","ref"]);function Ce(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function te(n,e,t,o,r){if(!Te.has(e)){if(e==="class"){N(n,t,o);return}if(e==="style"){E(n,t,o);return}if(Ce(e)){V(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function u(n,e,t,o,r){te(n,e,t,o,r)}function A(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&u(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&u(n,r,null,e[r],o)}function xe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){A(n,r,i,o);return}if(s===-2){A(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&N(n,i.class,r.class),s&4&&r.style!==i.style&&E(n,i.style,r.style),s&8&&a)for(let l=0;l<a.length;l++){let f=a[l],p=r[f],d=i[f];d!==p&&u(n,f,d,p,o)}s&16&&A(n,r,i,o)}var b=class{createElement(e){return P(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){x(e,t,o)}removeAttribute(e,t){R(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){N(e,t,o)}setStyleWithOld(e,t,o){E(e,t,o)}setAttributeWithOld(e,t,o,r){u(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){K(e)}},Re=new b;export{U as Comment,b as DOMRenderer,H as Fragment,S as PatchFlags,$ as PatchPropFlags,m as ShapeFlags,j as Text,Q as createInvoker,ye as createRenderer,Re as domRenderer,ge as getEventInvokers,F as getEventKey,Ne as getSVGPropName,P as isSVGElement,k as normalizeEventName,J as parseEventModifier,A as patchAllProps,N as patchClass,te as patchDOMProp,me as patchDOMProps,xe as patchElementProps,V as patchEvent,Le as patchEventOnElement,u as patchProp,E as patchStyle,K as removeAllEventListeners,R as removeDOMProp,x as setDOMProp};
@@ -0,0 +1,5 @@
1
+ var C=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var B=(o,t)=>{for(var e in t)C(o,e,{get:t[e],enumerable:!0})},X=(o,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of W(t))!z.call(o,n)&&n!==e&&C(o,n,{get:()=>t[n],enumerable:!(i=H(t,n))||i.enumerable});return o};var Y=o=>X(C({},"__esModule",{value:!0}),o);var rt={};B(rt,{Comment:()=>V,Fragment:()=>R,MiniAppRenderer:()=>N,PatchFlags:()=>g,ShapeFlags:()=>m,Text:()=>v,createRenderer:()=>j,miniAppRenderer:()=>U});module.exports=Y(rt);var K=require("@lytjs/vdom");var m=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(m||{}),g=(p=>(p[p.TEXT=1]="TEXT",p[p.CLASS=2]="CLASS",p[p.STYLE=4]="STYLE",p[p.PROPS=8]="PROPS",p[p.FULL_PROPS=16]="FULL_PROPS",p[p.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",p[p.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",p[p.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",p[p.NEED_PATCH=256]="NEED_PATCH",p[p.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",p[p.HOISTED=-1]="HOISTED",p[p.BAIL=-2]="BAIL",p))(g||{}),R=Symbol("Fragment"),v=Symbol("Text"),V=Symbol("Comment");function u(o){return o.type===R}function x(o){return o.type===v}function T(o){return o.type===V}function I(o,t){return o.type===t.type&&o.key===t.key}function L(o){return Array.isArray(o.dynamicChildren)}function P(o,t,e,i){if(e==="class")o.setClass(t,i);else if(e==="style")o.setStyle(t,i);else if(e.startsWith("on")||e.startsWith("@")){let n=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();o.addEventListener(t,n,i)}else e==="key"||e==="ref"||o.setAttribute(t,e,i)}function w(o,t,e,i,n){if(e==="class")o.setClass(t,i);else if(e==="style")o.setStyle(t,i||{});else if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();n&&o.removeEventListener(t,r,n),i&&o.addEventListener(t,r,i)}else o.setAttribute(t,e,i)}function M(o,t,e,i){for(let n in i){if(n==="key"||n==="ref")continue;let r=e[n],s=i[n];s!==r&&w(o,t,n,s,r)}for(let n in e)if(!(n==="key"||n==="ref")&&!(n in i))if(n==="class")o.setClass(t,"");else if(n==="style")o.setStyle(t,{});else if(n.startsWith("on")||n.startsWith("@")){let r=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();o.removeEventListener(t,r,e[n])}else o.removeAttribute(t,n)}function S(o,t,e,i,n,r){let{shapeFlag:s}=e;if(u(e)){q(o,t,e,i,n,r);return}if(x(e)){let a=o.createText(e.children);e.el=a,o.insert(i,a,n);return}if(T(e)){let a=o.createComment(e.children);e.el=a,o.insert(i,a,n);return}if(s&1){G(o,t,e,i,n,r);return}if(s&6){Z(t,e,i,n,r);return}}function G(o,t,e,i,n,r){let s=e.type,a=o.createElement(s);if(e.el=a,e.props)for(let l in e.props){let d=e.props[l];P(o,a,l,d)}let{shapeFlag:c,children:f}=e;c&8?a.textContent=f:c&16&&A(t,f,a,null,r),o.insert(i,a,n)}function A(o,t,e,i,n){for(let r=0;r<t.length;r++)o(null,t[r],e,i,n)}function q(o,t,e,i,n,r){let{children:s}=e,a=o.createComment("");o.insert(i,a,n),Array.isArray(s)&&s.length>0&&A(t,s,i,a,r),e.el=a,e.anchor=a}function Z(o,t,e,i,n){let r=t.component;r&&r.update&&r.update(),r&&r.subTree&&(o(null,r.subTree,e,i,r),t.el=r.subTree.el)}function D(o,t,e,i){let{shapeFlag:n,children:r}=e;if(u(e)){if(Array.isArray(r))for(let s=0;s<r.length;s++)t(r[s],i);e.anchor&&e.anchor.parentNode&&o.remove(e.anchor);return}if(n&6){e.component&&e.component.subTree&&t(e.component.subTree,i);return}e.el&&o.remove(e.el)}function E(o,t){for(let e=0;e<t.length;e++)o(t[e])}var _=require("@lytjs/vdom");function b(o,t,e,i,n,r=null,s=null){if(i==null){e&&t(e,n);return}if(e===null){S(o,O(o,t),i,n,r,s);return}if(L(i)&&L(e)){tt(o,t,e,i,n,s);return}if(!I(e,i)){t(e,n),S(o,O(o,t),i,n,r,s);return}i.el=e.el,i.anchor=e.anchor;let{shapeFlag:a}=i;if(u(i)){k(o,t,e,i,n,r,s);return}if(x(i)){i.children!==e.children&&(i.el.nodeValue=i.children);return}if(T(i)){i.children!==e.children&&(i.el.nodeValue=i.children);return}if(a&1){J(o,t,e,i,s);return}if(a&6){et(e,i,s);return}}function O(o,t){return(e,i,n,r,s)=>{b(o,t,e,i,n,r,s)}}function J(o,t,e,i,n=null){let r=i.el=e.el,s=e.props||{},a=i.props||{},{patchFlag:c,dynamicProps:f}=i;if(c&&c>0){if(c&1&&e.children!==i.children&&(r.textContent=i.children),c&2&&s.class!==a.class&&o.setClass(r,a.class),c&4&&s.style!==a.style&&o.setStyle(r,a.style||{}),c&8&&f)for(let l=0;l<f.length;l++){let d=f[l],p=s[d],$=a[d];$!==p&&w(o,r,d,$,p)}c&16&&M(o,r,s,a)}else M(o,r,s,a);(!c||!(c&1))&&F(o,t,e,i,r,null,n)}function F(o,t,e,i,n,r,s){let a=e.shapeFlag,c=i.shapeFlag,f=e.children,l=i.children;if(c&8){a&16&&E(t,f),f!==l&&(n.textContent=l);return}if(c&16){a&16?Q(o,t,f,l,n,r,s):(a&8&&(n.textContent=""),A(O(o,t),l,n,r,s));return}l==null&&(a&8?n.textContent="":a&16&&E(t,f))}function Q(o,t,e,i,n,r,s){i.every(c=>c.key!=null)&&e.every(c=>c.key!=null)?(0,_.patchKeyedChildren)(e,i,n,r,s,null,!1):(0,_.patchUnkeyedChildren)(e,i,n,r,s,null,!1)}function k(o,t,e,i,n,r,s){let a=e.children,c=i.children;Array.isArray(c)&&c.length>0?(F(o,t,e,i,n,r,s),i.el=c[0].el,i.anchor=c[c.length-1].el?o.nextSibling(c[c.length-1].el):r):Array.isArray(a)&&a.length>0&&c===null?(E(t,a),i.el=e.el,i.anchor=e.anchor):(i.el=e.el,i.anchor=e.anchor)}function tt(o,t,e,i,n,r){let s=e.dynamicChildren,a=i.dynamicChildren;for(let c=0;c<a.length;c++)b(o,t,s[c],a[c],n,null,r)}function et(o,t,e){t.component=o.component,t.el=o.el,t.component&&t.component.update&&t.component.update()}function j(o){function t(n,r){D(o,t,n,r)}(0,K.registerDOMOperations)({insert(n,r,s){o.insert(r,n,s)},createElement(n){return o.createElement(n)},createText(n){return o.createText(n)},setText(n,r){n.nodeValue=r},setElementText(n,r){n.textContent=r},remove(n){o.remove(n)},createComment(n){return o.createComment(n)},mount(n,r,s,a,c,f,l){i(null,n,r,s,a)},patch(n,r,s,a,c,f,l,d){i(n,r,s,a,c)},unmount(n,r,s,a){t(n)},move(n,r,s){o.insert(r,n.el,s)}});function i(n,r,s,a,c){b(o,t,n,r,s,a,c)}return{mount(n,r){r.nodeType===1&&(r.textContent=""),i(null,n,r,null,null)},patch(n,r,s){var a;i(n,r,s||((a=n.el)==null?void 0:a.parentNode),null,null)},unmount(n,r){t(n,r)}}}var nt={if:{attr:"if"},else:{attr:"else"},each:{attr:"for",prefix:""},bind:{attr:"model:"},on:{attr:"bind",prefix:""},ref:{attr:""},slot:{attr:"slot"},class:{attr:"class"},style:{attr:"style"},show:{attr:"hidden"}},y={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"},it={div:"view",span:"text",p:"text",h1:"text",h2:"text",h3:"text",h4:"text",h5:"text",h6:"text",img:"image",input:"input",textarea:"textarea",button:"button",scroll:"scroll-view",list:"view",a:"navigator",ul:"view",ol:"view",li:"view",form:"form",header:"view",footer:"view",nav:"view",main:"view",section:"view",article:"view",aside:"view"},h={wechat:{if:"wx:if",else:"wx:else",for:"wx:for",forKey:"wx:key",bind:"bind",catch:"catch"},alipay:{if:"a:if",else:"a:else",for:"a:for",forKey:"a:key",bind:"on",catch:"catchEvent"},bytedance:{if:"tt:if",else:"tt:else",for:"tt:for",forKey:"tt:key",bind:"bind",catch:"catch"}},N=class{createElement(t){return{tag:it[t]||t,attrs:{},children:[],bindEvents:{},modelBindings:{}}}createText(t){return{tag:"__text__",attrs:{},children:[],text:t,bindEvents:{},modelBindings:{}}}createComment(t){return{tag:"__comment__",attrs:{},children:[],text:t,bindEvents:{},modelBindings:{}}}setAttribute(t,e,i){if(t){if(e.startsWith("lyt:")){let n=e.slice(4);this._applyDirective(t,n,i);return}if(e==="v-if"||e==="if"){t.wxIf=String(i);return}if(e==="v-else"||e==="else"){t.attrs["wx:else"]="";return}if(e==="v-for"||e==="each"){let n=String(i),r=n.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(t.wxFor=r[4]||r[3],t.wxForKey=r[1]||r[3]):t.wxFor=n;return}if(e.startsWith("on")&&typeof i=="function"){let n=e.slice(2).toLowerCase(),r=y[n]||n;t.bindEvents[r]=i.name||"handleEvent";return}if(e==="v-model"||e==="model"){t.modelBindings.value=String(i);return}if(e==="class"||e==="className"){t.attrs.class=String(i);return}if(e==="style"){typeof i=="object"&&i!==null?t.attrs.style=this._styleObjectToString(i):t.attrs.style=String(i);return}if(e==="href"&&t.tag==="navigator"){t.attrs.url=String(i);return}t.attrs[e]=String(i)}}removeAttribute(t,e){if(t)if(e==="v-if"||e==="if")delete t.wxIf;else if(e==="v-for"||e==="each")delete t.wxFor,delete t.wxForKey;else if(e.startsWith("on")){let i=e.slice(2).toLowerCase(),n=y[i]||i;delete t.bindEvents[n]}else delete t.attrs[e]}setStyle(t,e){if(!t)return;let i=this._styleObjectToString(e);t.attrs.style=i}setClass(t,e){if(t){if(typeof e=="string")t.attrs.class=e;else if(typeof e=="object"&&e!==null){let i=[];for(let[n,r]of Object.entries(e))r&&i.push(n);t.attrs.class=i.join(" ")}}}insert(t,e,i){if(!(!t||!e)){if(e._parent){let n=e._parent,r=n.children.indexOf(e);r!==-1&&n.children.splice(r,1)}if(e._parent=t,i){let n=t.children.indexOf(i);n!==-1?t.children.splice(n,0,e):t.children.push(e)}else t.children.push(e)}}remove(t){if(!t||!t._parent)return;let e=t._parent,i=e.children.indexOf(t);i!==-1&&e.children.splice(i,1),t._parent=void 0}replace(t,e,i){if(!t||!e||!i)return;let n=t.children.indexOf(e);n!==-1&&(e._parent=void 0,i._parent=t,t.children[n]=i)}addEventListener(t,e,i,n){if(!t)return;let r=y[e]||e;t.bindEvents[r]=i.name||"handleEvent"}removeEventListener(t,e,i){if(!t)return;let n=y[e]||e;delete t.bindEvents[n]}nextTick(t){Promise.resolve().then(()=>t())}parentNode(t){var e;return(e=t==null?void 0:t._parent)!=null?e:null}nextSibling(t){if(!t||!t._parent)return null;let e=t._parent.children,i=e.indexOf(t);return i!==-1&&i+1<e.length?e[i+1]:null}setText(t,e){t&&t.tag==="__text__"&&(t.text=e)}patchProp(t,e,i,n){if(t){if(n==null){this.removeAttribute(t,e);return}if(e==="style")this.setStyle(t,n);else if(e==="class"||e==="className")this.setClass(t,n);else if(e.startsWith("on")&&typeof n=="function"){let r=e.slice(2).toLowerCase(),s=y[r]||r;t.bindEvents[s]=n.name||"handleEvent"}else this.setAttribute(t,e,n)}}querySelector(t){return null}renderToMiniAppTree(t){if(!t)return this.createComment("empty vnode");if(typeof t=="string")return this.createText(t);if(t.type===Symbol.for("lyt.comment")||t.type==="comment")return this.createComment(t.children||"");if(t.type===Symbol.for("lyt.text")||t.type==="text")return this.createText(t.children||"");if(t.type===Symbol.for("lyt.fragment")||t.type==="fragment"){let e=this.createElement("__fragment__");if(Array.isArray(t.children))for(let i of t.children)this.insert(e,this.renderToMiniAppTree(i));return e}if(typeof t.type=="string"){let e=this.createElement(t.type);if(t.props)for(let[i,n]of Object.entries(t.props))i==="key"||i==="ref"||this.setAttribute(e,i,n);if(t.children){if(typeof t.children=="string")this.insert(e,this.createText(t.children));else if(Array.isArray(t.children))for(let i of t.children)this.insert(e,this.renderToMiniAppTree(i))}return e}if(typeof t.type=="object"||typeof t.type=="function"){let e=this.createElement("div");if(Array.isArray(t.children))for(let i of t.children)this.insert(e,this.renderToMiniAppTree(i));return e}return this.createComment("unknown vnode type")}serializeToWXML(t,e=0){return this._serializeToTemplate(t,e,"wechat")}serializeToAXML(t,e=0){return this._serializeToTemplate(t,e,"alipay")}serializeToTTML(t,e=0){return this._serializeToTemplate(t,e,"bytedance")}getPlatformTemplate(t,e){return this._serializeToTemplate(t,0,e)}mapDirective(t,e,i="wechat"){let n=h[i]||h.wechat,r=nt[t];if(!r)return"";switch(t){case"if":return`${n.if}="{{${e}}}"`;case"else":return`${n.else}`;case"each":{let s=e.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);if(s){let a=s[1]||s[3],c=s[4]||s[3];return`${n.for}="{{${c}}}" ${n.forKey}="{{${a}}}"`}return`${n.for}="{{${e}}}"`}case"show":return`hidden="{{!${e}}}"`;default:return`${r.attr}="${e}"`}}mapEvent(t,e="wechat"){let i=h[e]||h.wechat,n=y[t]||t;return i.bind==="on"?`on${n.charAt(0).toUpperCase()}${n.slice(1)}`:`${i.bind}${n}`}_applyDirective(t,e,i){switch(e){case"if":t.wxIf=String(i);break;case"else":t.attrs["wx:else"]="";break;case"each":{let n=String(i),r=n.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(t.wxFor=r[4]||r[3],t.wxForKey=r[1]||r[3]):t.wxFor=n;break}case"show":t.attrs.hidden=String(i);break;default:t.attrs[e]=String(i)}}_styleObjectToString(t){return Object.entries(t).map(([e,i])=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${i}`).join("; ")}_serializeToTemplate(t,e,i){let n=" ".repeat(e),r=h[i]||h.wechat;if(t.tag==="__text__")return`${n}${t.text||""}`;if(t.tag==="__comment__")return`${n}<!-- ${t.text||""} -->`;if(t.tag==="__fragment__")return t.children.map(l=>this._serializeToTemplate(l,e,i)).join(`
2
+ `);let s=[];for(let[l,d]of Object.entries(t.attrs)){if(l==="wx:else"){s.push(r.else);continue}s.push(`${l}="${d}"`)}t.wxIf&&s.unshift(`${r.if}="{{${t.wxIf}}}"`),t.wxFor&&(s.unshift(`${r.for}="{{${t.wxFor}}}"`),t.wxForKey&&s.unshift(`${r.forKey}="{{${t.wxForKey}}}"`));for(let[l,d]of Object.entries(t.bindEvents)){let p=r.bind==="on"?`on${l.charAt(0).toUpperCase()}${l.slice(1)}`:`${r.bind}${l}`;s.push(`${p}="${d}"`)}for(let[l,d]of Object.entries(t.modelBindings))s.push(`model:${l}="{{${d}}}"`);let a=s.length>0?" "+s.join(" "):"",c=new Set(["image","input"]);if(t.children.length===0&&c.has(t.tag))return`${n}<${t.tag}${a} />`;if(t.children.length===0)return`${n}<${t.tag}${a}></${t.tag}>`;let f=t.children.map(l=>this._serializeToTemplate(l,e+1,i)).join(`
3
+ `);return`${n}<${t.tag}${a}>
4
+ ${f}
5
+ ${n}</${t.tag}>`}};var U=new N;
@@ -0,0 +1,5 @@
1
+ import{registerDOMOperations as Y}from"@lytjs/vdom";var h=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(h||{}),_=(p=>(p[p.TEXT=1]="TEXT",p[p.CLASS=2]="CLASS",p[p.STYLE=4]="STYLE",p[p.PROPS=8]="PROPS",p[p.FULL_PROPS=16]="FULL_PROPS",p[p.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",p[p.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",p[p.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",p[p.NEED_PATCH=256]="NEED_PATCH",p[p.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",p[p.HOISTED=-1]="HOISTED",p[p.BAIL=-2]="BAIL",p))(_||{}),w=Symbol("Fragment"),M=Symbol("Text"),S=Symbol("Comment");function m(o){return o.type===w}function N(o){return o.type===M}function g(o){return o.type===S}function O(o,t){return o.type===t.type&&o.key===t.key}function b(o){return Array.isArray(o.dynamicChildren)}function $(o,t,e,n){if(e==="class")o.setClass(t,n);else if(e==="style")o.setStyle(t,n);else if(e.startsWith("on")||e.startsWith("@")){let i=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();o.addEventListener(t,i,n)}else e==="key"||e==="ref"||o.setAttribute(t,e,n)}function C(o,t,e,n,i){if(e==="class")o.setClass(t,n);else if(e==="style")o.setStyle(t,n||{});else if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();i&&o.removeEventListener(t,r,i),n&&o.addEventListener(t,r,n)}else o.setAttribute(t,e,n)}function R(o,t,e,n){for(let i in n){if(i==="key"||i==="ref")continue;let r=e[i],s=n[i];s!==r&&C(o,t,i,s,r)}for(let i in e)if(!(i==="key"||i==="ref")&&!(i in n))if(i==="class")o.setClass(t,"");else if(i==="style")o.setStyle(t,{});else if(i.startsWith("on")||i.startsWith("@")){let r=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();o.removeEventListener(t,r,e[i])}else o.removeAttribute(t,i)}function v(o,t,e,n,i,r){let{shapeFlag:s}=e;if(m(e)){F(o,t,e,n,i,r);return}if(N(e)){let a=o.createText(e.children);e.el=a,o.insert(n,a,i);return}if(g(e)){let a=o.createComment(e.children);e.el=a,o.insert(n,a,i);return}if(s&1){D(o,t,e,n,i,r);return}if(s&6){K(t,e,n,i,r);return}}function D(o,t,e,n,i,r){let s=e.type,a=o.createElement(s);if(e.el=a,e.props)for(let l in e.props){let d=e.props[l];$(o,a,l,d)}let{shapeFlag:c,children:f}=e;c&8?a.textContent=f:c&16&&x(t,f,a,null,r),o.insert(n,a,i)}function x(o,t,e,n,i){for(let r=0;r<t.length;r++)o(null,t[r],e,n,i)}function F(o,t,e,n,i,r){let{children:s}=e,a=o.createComment("");o.insert(n,a,i),Array.isArray(s)&&s.length>0&&x(t,s,n,a,r),e.el=a,e.anchor=a}function K(o,t,e,n,i){let r=t.component;r&&r.update&&r.update(),r&&r.subTree&&(o(null,r.subTree,e,n,r),t.el=r.subTree.el)}function I(o,t,e,n){let{shapeFlag:i,children:r}=e;if(m(e)){if(Array.isArray(r))for(let s=0;s<r.length;s++)t(r[s],n);e.anchor&&e.anchor.parentNode&&o.remove(e.anchor);return}if(i&6){e.component&&e.component.subTree&&t(e.component.subTree,n);return}e.el&&o.remove(e.el)}function T(o,t){for(let e=0;e<t.length;e++)o(t[e])}import{patchKeyedChildren as j,patchUnkeyedChildren as U}from"@lytjs/vdom";function A(o,t,e,n,i,r=null,s=null){if(n==null){e&&t(e,i);return}if(e===null){v(o,V(o,t),n,i,r,s);return}if(b(n)&&b(e)){B(o,t,e,n,i,s);return}if(!O(e,n)){t(e,i),v(o,V(o,t),n,i,r,s);return}n.el=e.el,n.anchor=e.anchor;let{shapeFlag:a}=n;if(m(n)){z(o,t,e,n,i,r,s);return}if(N(n)){n.children!==e.children&&(n.el.nodeValue=n.children);return}if(g(n)){n.children!==e.children&&(n.el.nodeValue=n.children);return}if(a&1){H(o,t,e,n,s);return}if(a&6){X(e,n,s);return}}function V(o,t){return(e,n,i,r,s)=>{A(o,t,e,n,i,r,s)}}function H(o,t,e,n,i=null){let r=n.el=e.el,s=e.props||{},a=n.props||{},{patchFlag:c,dynamicProps:f}=n;if(c&&c>0){if(c&1&&e.children!==n.children&&(r.textContent=n.children),c&2&&s.class!==a.class&&o.setClass(r,a.class),c&4&&s.style!==a.style&&o.setStyle(r,a.style||{}),c&8&&f)for(let l=0;l<f.length;l++){let d=f[l],p=s[d],L=a[d];L!==p&&C(o,r,d,L,p)}c&16&&R(o,r,s,a)}else R(o,r,s,a);(!c||!(c&1))&&P(o,t,e,n,r,null,i)}function P(o,t,e,n,i,r,s){let a=e.shapeFlag,c=n.shapeFlag,f=e.children,l=n.children;if(c&8){a&16&&T(t,f),f!==l&&(i.textContent=l);return}if(c&16){a&16?W(o,t,f,l,i,r,s):(a&8&&(i.textContent=""),x(V(o,t),l,i,r,s));return}l==null&&(a&8?i.textContent="":a&16&&T(t,f))}function W(o,t,e,n,i,r,s){n.every(c=>c.key!=null)&&e.every(c=>c.key!=null)?j(e,n,i,r,s,null,!1):U(e,n,i,r,s,null,!1)}function z(o,t,e,n,i,r,s){let a=e.children,c=n.children;Array.isArray(c)&&c.length>0?(P(o,t,e,n,i,r,s),n.el=c[0].el,n.anchor=c[c.length-1].el?o.nextSibling(c[c.length-1].el):r):Array.isArray(a)&&a.length>0&&c===null?(T(t,a),n.el=e.el,n.anchor=e.anchor):(n.el=e.el,n.anchor=e.anchor)}function B(o,t,e,n,i,r){let s=e.dynamicChildren,a=n.dynamicChildren;for(let c=0;c<a.length;c++)A(o,t,s[c],a[c],i,null,r)}function X(o,t,e){t.component=o.component,t.el=o.el,t.component&&t.component.update&&t.component.update()}function G(o){function t(i,r){I(o,t,i,r)}Y({insert(i,r,s){o.insert(r,i,s)},createElement(i){return o.createElement(i)},createText(i){return o.createText(i)},setText(i,r){i.nodeValue=r},setElementText(i,r){i.textContent=r},remove(i){o.remove(i)},createComment(i){return o.createComment(i)},mount(i,r,s,a,c,f,l){n(null,i,r,s,a)},patch(i,r,s,a,c,f,l,d){n(i,r,s,a,c)},unmount(i,r,s,a){t(i)},move(i,r,s){o.insert(r,i.el,s)}});function n(i,r,s,a,c){A(o,t,i,r,s,a,c)}return{mount(i,r){r.nodeType===1&&(r.textContent=""),n(null,i,r,null,null)},patch(i,r,s){var a;n(i,r,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,r){t(i,r)}}}var q={if:{attr:"if"},else:{attr:"else"},each:{attr:"for",prefix:""},bind:{attr:"model:"},on:{attr:"bind",prefix:""},ref:{attr:""},slot:{attr:"slot"},class:{attr:"class"},style:{attr:"style"},show:{attr:"hidden"}},u={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"},Z={div:"view",span:"text",p:"text",h1:"text",h2:"text",h3:"text",h4:"text",h5:"text",h6:"text",img:"image",input:"input",textarea:"textarea",button:"button",scroll:"scroll-view",list:"view",a:"navigator",ul:"view",ol:"view",li:"view",form:"form",header:"view",footer:"view",nav:"view",main:"view",section:"view",article:"view",aside:"view"},y={wechat:{if:"wx:if",else:"wx:else",for:"wx:for",forKey:"wx:key",bind:"bind",catch:"catch"},alipay:{if:"a:if",else:"a:else",for:"a:for",forKey:"a:key",bind:"on",catch:"catchEvent"},bytedance:{if:"tt:if",else:"tt:else",for:"tt:for",forKey:"tt:key",bind:"bind",catch:"catch"}},E=class{createElement(t){return{tag:Z[t]||t,attrs:{},children:[],bindEvents:{},modelBindings:{}}}createText(t){return{tag:"__text__",attrs:{},children:[],text:t,bindEvents:{},modelBindings:{}}}createComment(t){return{tag:"__comment__",attrs:{},children:[],text:t,bindEvents:{},modelBindings:{}}}setAttribute(t,e,n){if(t){if(e.startsWith("lyt:")){let i=e.slice(4);this._applyDirective(t,i,n);return}if(e==="v-if"||e==="if"){t.wxIf=String(n);return}if(e==="v-else"||e==="else"){t.attrs["wx:else"]="";return}if(e==="v-for"||e==="each"){let i=String(n),r=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(t.wxFor=r[4]||r[3],t.wxForKey=r[1]||r[3]):t.wxFor=i;return}if(e.startsWith("on")&&typeof n=="function"){let i=e.slice(2).toLowerCase(),r=u[i]||i;t.bindEvents[r]=n.name||"handleEvent";return}if(e==="v-model"||e==="model"){t.modelBindings.value=String(n);return}if(e==="class"||e==="className"){t.attrs.class=String(n);return}if(e==="style"){typeof n=="object"&&n!==null?t.attrs.style=this._styleObjectToString(n):t.attrs.style=String(n);return}if(e==="href"&&t.tag==="navigator"){t.attrs.url=String(n);return}t.attrs[e]=String(n)}}removeAttribute(t,e){if(t)if(e==="v-if"||e==="if")delete t.wxIf;else if(e==="v-for"||e==="each")delete t.wxFor,delete t.wxForKey;else if(e.startsWith("on")){let n=e.slice(2).toLowerCase(),i=u[n]||n;delete t.bindEvents[i]}else delete t.attrs[e]}setStyle(t,e){if(!t)return;let n=this._styleObjectToString(e);t.attrs.style=n}setClass(t,e){if(t){if(typeof e=="string")t.attrs.class=e;else if(typeof e=="object"&&e!==null){let n=[];for(let[i,r]of Object.entries(e))r&&n.push(i);t.attrs.class=n.join(" ")}}}insert(t,e,n){if(!(!t||!e)){if(e._parent){let i=e._parent,r=i.children.indexOf(e);r!==-1&&i.children.splice(r,1)}if(e._parent=t,n){let i=t.children.indexOf(n);i!==-1?t.children.splice(i,0,e):t.children.push(e)}else t.children.push(e)}}remove(t){if(!t||!t._parent)return;let e=t._parent,n=e.children.indexOf(t);n!==-1&&e.children.splice(n,1),t._parent=void 0}replace(t,e,n){if(!t||!e||!n)return;let i=t.children.indexOf(e);i!==-1&&(e._parent=void 0,n._parent=t,t.children[i]=n)}addEventListener(t,e,n,i){if(!t)return;let r=u[e]||e;t.bindEvents[r]=n.name||"handleEvent"}removeEventListener(t,e,n){if(!t)return;let i=u[e]||e;delete t.bindEvents[i]}nextTick(t){Promise.resolve().then(()=>t())}parentNode(t){var e;return(e=t==null?void 0:t._parent)!=null?e:null}nextSibling(t){if(!t||!t._parent)return null;let e=t._parent.children,n=e.indexOf(t);return n!==-1&&n+1<e.length?e[n+1]:null}setText(t,e){t&&t.tag==="__text__"&&(t.text=e)}patchProp(t,e,n,i){if(t){if(i==null){this.removeAttribute(t,e);return}if(e==="style")this.setStyle(t,i);else if(e==="class"||e==="className")this.setClass(t,i);else if(e.startsWith("on")&&typeof i=="function"){let r=e.slice(2).toLowerCase(),s=u[r]||r;t.bindEvents[s]=i.name||"handleEvent"}else this.setAttribute(t,e,i)}}querySelector(t){return null}renderToMiniAppTree(t){if(!t)return this.createComment("empty vnode");if(typeof t=="string")return this.createText(t);if(t.type===Symbol.for("lyt.comment")||t.type==="comment")return this.createComment(t.children||"");if(t.type===Symbol.for("lyt.text")||t.type==="text")return this.createText(t.children||"");if(t.type===Symbol.for("lyt.fragment")||t.type==="fragment"){let e=this.createElement("__fragment__");if(Array.isArray(t.children))for(let n of t.children)this.insert(e,this.renderToMiniAppTree(n));return e}if(typeof t.type=="string"){let e=this.createElement(t.type);if(t.props)for(let[n,i]of Object.entries(t.props))n==="key"||n==="ref"||this.setAttribute(e,n,i);if(t.children){if(typeof t.children=="string")this.insert(e,this.createText(t.children));else if(Array.isArray(t.children))for(let n of t.children)this.insert(e,this.renderToMiniAppTree(n))}return e}if(typeof t.type=="object"||typeof t.type=="function"){let e=this.createElement("div");if(Array.isArray(t.children))for(let n of t.children)this.insert(e,this.renderToMiniAppTree(n));return e}return this.createComment("unknown vnode type")}serializeToWXML(t,e=0){return this._serializeToTemplate(t,e,"wechat")}serializeToAXML(t,e=0){return this._serializeToTemplate(t,e,"alipay")}serializeToTTML(t,e=0){return this._serializeToTemplate(t,e,"bytedance")}getPlatformTemplate(t,e){return this._serializeToTemplate(t,0,e)}mapDirective(t,e,n="wechat"){let i=y[n]||y.wechat,r=q[t];if(!r)return"";switch(t){case"if":return`${i.if}="{{${e}}}"`;case"else":return`${i.else}`;case"each":{let s=e.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);if(s){let a=s[1]||s[3],c=s[4]||s[3];return`${i.for}="{{${c}}}" ${i.forKey}="{{${a}}}"`}return`${i.for}="{{${e}}}"`}case"show":return`hidden="{{!${e}}}"`;default:return`${r.attr}="${e}"`}}mapEvent(t,e="wechat"){let n=y[e]||y.wechat,i=u[t]||t;return n.bind==="on"?`on${i.charAt(0).toUpperCase()}${i.slice(1)}`:`${n.bind}${i}`}_applyDirective(t,e,n){switch(e){case"if":t.wxIf=String(n);break;case"else":t.attrs["wx:else"]="";break;case"each":{let i=String(n),r=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(t.wxFor=r[4]||r[3],t.wxForKey=r[1]||r[3]):t.wxFor=i;break}case"show":t.attrs.hidden=String(n);break;default:t.attrs[e]=String(n)}}_styleObjectToString(t){return Object.entries(t).map(([e,n])=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n}`).join("; ")}_serializeToTemplate(t,e,n){let i=" ".repeat(e),r=y[n]||y.wechat;if(t.tag==="__text__")return`${i}${t.text||""}`;if(t.tag==="__comment__")return`${i}<!-- ${t.text||""} -->`;if(t.tag==="__fragment__")return t.children.map(l=>this._serializeToTemplate(l,e,n)).join(`
2
+ `);let s=[];for(let[l,d]of Object.entries(t.attrs)){if(l==="wx:else"){s.push(r.else);continue}s.push(`${l}="${d}"`)}t.wxIf&&s.unshift(`${r.if}="{{${t.wxIf}}}"`),t.wxFor&&(s.unshift(`${r.for}="{{${t.wxFor}}}"`),t.wxForKey&&s.unshift(`${r.forKey}="{{${t.wxForKey}}}"`));for(let[l,d]of Object.entries(t.bindEvents)){let p=r.bind==="on"?`on${l.charAt(0).toUpperCase()}${l.slice(1)}`:`${r.bind}${l}`;s.push(`${p}="${d}"`)}for(let[l,d]of Object.entries(t.modelBindings))s.push(`model:${l}="{{${d}}}"`);let a=s.length>0?" "+s.join(" "):"",c=new Set(["image","input"]);if(t.children.length===0&&c.has(t.tag))return`${i}<${t.tag}${a} />`;if(t.children.length===0)return`${i}<${t.tag}${a}></${t.tag}>`;let f=t.children.map(l=>this._serializeToTemplate(l,e+1,n)).join(`
3
+ `);return`${i}<${t.tag}${a}>
4
+ ${f}
5
+ ${i}</${t.tag}>`}};var J=new E;export{S as Comment,w as Fragment,E as MiniAppRenderer,_ as PatchFlags,h as ShapeFlags,M as Text,G as createRenderer,J as miniAppRenderer};
@@ -0,0 +1 @@
1
+ var C=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var F=(o,e)=>{for(var t in e)C(o,t,{get:e[t],enumerable:!0})},K=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Y(e))!z.call(o,i)&&i!==t&&C(o,i,{get:()=>e[i],enumerable:!(n=B(e,i))||n.enumerable});return o};var X=o=>K(C({},"__esModule",{value:!0}),o);var se={};F(se,{Comment:()=>L,Fragment:()=>E,NativeRenderer:()=>u,PatchFlags:()=>N,ShapeFlags:()=>y,Text:()=>R,createRenderer:()=>U,nativeRenderer:()=>j});module.exports=X(se);var W=require("@lytjs/vdom");var y=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(y||{}),N=(d=>(d[d.TEXT=1]="TEXT",d[d.CLASS=2]="CLASS",d[d.STYLE=4]="STYLE",d[d.PROPS=8]="PROPS",d[d.FULL_PROPS=16]="FULL_PROPS",d[d.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",d[d.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",d[d.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",d[d.NEED_PATCH=256]="NEED_PATCH",d[d.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",d[d.HOISTED=-1]="HOISTED",d[d.BAIL=-2]="BAIL",d))(N||{}),E=Symbol("Fragment"),R=Symbol("Text"),L=Symbol("Comment");function m(o){return o.type===E}function h(o){return o.type===R}function g(o){return o.type===L}function D(o,e){return o.type===e.type&&o.key===e.key}function A(o){return Array.isArray(o.dynamicChildren)}function H(o,e,t,n){if(t==="class")o.setClass(e,n);else if(t==="style")o.setStyle(e,n);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();o.addEventListener(e,i,n)}else t==="key"||t==="ref"||o.setAttribute(e,t,n)}function b(o,e,t,n,i){if(t==="class")o.setClass(e,n);else if(t==="style")o.setStyle(e,n||{});else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&o.removeEventListener(e,r,i),n&&o.addEventListener(e,r,n)}else o.setAttribute(e,t,n)}function S(o,e,t,n){for(let i in n){if(i==="key"||i==="ref")continue;let r=t[i],s=n[i];s!==r&&b(o,e,i,s,r)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in n))if(i==="class")o.setClass(e,"");else if(i==="style")o.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let r=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();o.removeEventListener(e,r,t[i])}else o.removeAttribute(e,i)}function _(o,e,t,n,i,r){let{shapeFlag:s}=t;if(m(t)){$(o,e,t,n,i,r);return}if(h(t)){let a=o.createText(t.children);t.el=a,o.insert(n,a,i);return}if(g(t)){let a=o.createComment(t.children);t.el=a,o.insert(n,a,i);return}if(s&1){G(o,e,t,n,i,r);return}if(s&6){q(e,t,n,i,r);return}}function G(o,e,t,n,i,r){let s=t.type,a=o.createElement(s);if(t.el=a,t.props)for(let c in t.props){let f=t.props[c];H(o,a,c,f)}let{shapeFlag:l,children:p}=t;l&8?a.textContent=p:l&16&&v(e,p,a,null,r),o.insert(n,a,i)}function v(o,e,t,n,i){for(let r=0;r<e.length;r++)o(null,e[r],t,n,i)}function $(o,e,t,n,i,r){let{children:s}=t,a=o.createComment("");o.insert(n,a,i),Array.isArray(s)&&s.length>0&&v(e,s,n,a,r),t.el=a,t.anchor=a}function q(o,e,t,n,i){let r=e.component;r&&r.update&&r.update(),r&&r.subTree&&(o(null,r.subTree,t,n,r),e.el=r.subTree.el)}function M(o,e,t,n){let{shapeFlag:i,children:r}=t;if(m(t)){if(Array.isArray(r))for(let s=0;s<r.length;s++)e(r[s],n);t.anchor&&t.anchor.parentNode&&o.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,n);return}t.el&&o.remove(t.el)}function T(o,e){for(let t=0;t<e.length;t++)o(e[t])}var x=require("@lytjs/vdom");function V(o,e,t,n,i,r=null,s=null){if(n==null){t&&e(t,i);return}if(t===null){_(o,O(o,e),n,i,r,s);return}if(A(n)&&A(t)){k(o,e,t,n,i,s);return}if(!D(t,n)){e(t,i),_(o,O(o,e),n,i,r,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(m(n)){Z(o,e,t,n,i,r,s);return}if(h(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(g(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){J(o,e,t,n,s);return}if(a&6){ee(t,n,s);return}}function O(o,e){return(t,n,i,r,s)=>{V(o,e,t,n,i,r,s)}}function J(o,e,t,n,i=null){let r=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:l,dynamicProps:p}=n;if(l&&l>0){if(l&1&&t.children!==n.children&&(r.textContent=n.children),l&2&&s.class!==a.class&&o.setClass(r,a.class),l&4&&s.style!==a.style&&o.setStyle(r,a.style||{}),l&8&&p)for(let c=0;c<p.length;c++){let f=p[c],d=s[f],w=a[f];w!==d&&b(o,r,f,w,d)}l&16&&S(o,r,s,a)}else S(o,r,s,a);(!l||!(l&1))&&P(o,e,t,n,r,null,i)}function P(o,e,t,n,i,r,s){let a=t.shapeFlag,l=n.shapeFlag,p=t.children,c=n.children;if(l&8){a&16&&T(e,p),p!==c&&(i.textContent=c);return}if(l&16){a&16?Q(o,e,p,c,i,r,s):(a&8&&(i.textContent=""),v(O(o,e),c,i,r,s));return}c==null&&(a&8?i.textContent="":a&16&&T(e,p))}function Q(o,e,t,n,i,r,s){n.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?(0,x.patchKeyedChildren)(t,n,i,r,s,null,!1):(0,x.patchUnkeyedChildren)(t,n,i,r,s,null,!1)}function Z(o,e,t,n,i,r,s){let a=t.children,l=n.children;Array.isArray(l)&&l.length>0?(P(o,e,t,n,i,r,s),n.el=l[0].el,n.anchor=l[l.length-1].el?o.nextSibling(l[l.length-1].el):r):Array.isArray(a)&&a.length>0&&l===null?(T(e,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function k(o,e,t,n,i,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let l=0;l<a.length;l++)V(o,e,s[l],a[l],i,null,r)}function ee(o,e,t){e.component=o.component,e.el=o.el,e.component&&e.component.update&&e.component.update()}function U(o){function e(i,r){M(o,e,i,r)}(0,W.registerDOMOperations)({insert(i,r,s){o.insert(r,i,s)},createElement(i){return o.createElement(i)},createText(i){return o.createText(i)},setText(i,r){i.nodeValue=r},setElementText(i,r){i.textContent=r},remove(i){o.remove(i)},createComment(i){return o.createComment(i)},mount(i,r,s,a,l,p,c){n(null,i,r,s,a)},patch(i,r,s,a,l,p,c,f){n(i,r,s,a,l)},unmount(i,r,s,a){e(i)},move(i,r,s){o.insert(r,i.el,s)}});function n(i,r,s,a,l){V(o,e,i,r,s,a,l)}return{mount(i,r){r.nodeType===1&&(r.textContent=""),n(null,i,r,null,null)},patch(i,r,s){var a;n(i,r,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,r){e(i,r)}}}var te={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",img:"Image",input:"TextInput",textarea:"TextInput",button:"TouchableOpacity",scroll:"ScrollView",list:"FlatList",a:"TouchableOpacity",ul:"View",ol:"View",li:"View",form:"View",header:"View",footer:"View",nav:"View",main:"View",section:"View",article:"View",aside:"View"},ne={flexDirection:"flexDirection",justifyContent:"justifyContent",alignItems:"alignItems",alignSelf:"alignSelf",flexWrap:"flexWrap",flex:"flex",flexGrow:"flexGrow",flexShrink:"flexShrink",flexBasis:"flexBasis",backgroundColor:"backgroundColor",color:"color",fontSize:"fontSize",fontWeight:"fontWeight",fontStyle:"fontStyle",textAlign:"textAlign",lineHeight:"lineHeight",letterSpacing:"letterSpacing",padding:"padding",paddingTop:"paddingTop",paddingBottom:"paddingBottom",paddingLeft:"paddingLeft",paddingRight:"paddingRight",paddingHorizontal:"paddingHorizontal",paddingVertical:"paddingVertical",margin:"margin",marginTop:"marginTop",marginBottom:"marginBottom",marginLeft:"marginLeft",marginRight:"marginRight",marginHorizontal:"marginHorizontal",marginVertical:"marginVertical",width:"width",height:"height",minWidth:"minWidth",maxWidth:"maxWidth",minHeight:"minHeight",maxHeight:"maxHeight",borderRadius:"borderRadius",borderWidth:"borderWidth",borderColor:"borderColor",overflow:"overflow",opacity:"opacity",position:"position",top:"top",left:"left",right:"right",bottom:"bottom",zIndex:"zIndex",shadowColor:"shadowColor",shadowOffset:"shadowOffset",shadowOpacity:"shadowOpacity",shadowRadius:"shadowRadius"},ie={click:"onPress",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",change:"onChange",input:"onChangeText",focus:"onFocus",blur:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",longpress:"onLongPress"},oe=0;function I(){return`native_${++oe}`}var u=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:I()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:I()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:I()}}setAttribute(e,t,n){if(e){if(t==="style"&&typeof n=="object"&&n!==null){e.props.style={...e.props.style,...this.mapStyle(n)};return}if(t==="className"||t==="class"){e.props.className=n;return}if(t.startsWith("on")&&typeof n=="function"){let i=t.slice(2).toLowerCase(),r=this.mapEvent(i);e.props[r]=n;return}if(t==="src"&&e.type==="Image"){e.props.source={uri:n};return}if(t==="href"){e.props.href=n;return}if(t==="placeholder"){e.props.placeholder=n;return}e.props[t]=n}}removeAttribute(e,t){if(e)if(t==="style")delete e.props.style;else if(t.startsWith("on")){let n=t.slice(2).toLowerCase(),i=this.mapEvent(n);delete e.props[i]}else delete e.props[t]}setStyle(e,t){if(!e)return;let n=this.mapStyle(t);e.props.style={...e.props.style,...n}}setClass(e,t){if(e){if(typeof t=="string")e.props.className=t;else if(typeof t=="object"&&t!==null){let n=[];for(let[i,r]of Object.entries(t))r&&n.push(i);e.props.className=n.join(" ")}}}insert(e,t,n){if(!(!e||!t)){if(t._parent){let i=t._parent,r=i.children.indexOf(t);r!==-1&&i.children.splice(r,1)}if(t._parent=e,n){let i=e.children.indexOf(n);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,n=t.children.indexOf(e);n!==-1&&t.children.splice(n,1),e._parent=void 0}replace(e,t,n){if(!e||!t||!n)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,n._parent=e,e.children[i]=n)}addEventListener(e,t,n,i){if(!e)return;let r=this.mapEvent(t);e.props[r]=n}removeEventListener(e,t,n){if(!e)return;let i=this.mapEvent(t);e.props[i]===n&&delete e.props[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,n=t.indexOf(e);return n!==-1&&n+1<t.length?t[n+1]:null}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,n,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let r=t.slice(2).toLowerCase(),s=this.mapEvent(r);e.props[s]=i}else this.setAttribute(e,t,i)}}querySelector(e){let t=e.replace(/[.#\[\]]/g,"").trim();return null}renderToNativeTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__Fragment");if(Array.isArray(e.children))for(let n of e.children){let i=this.renderToNativeTree(n);this.insert(t,i)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[n,i]of Object.entries(e.props))n==="key"||n==="ref"||this.setAttribute(t,n,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n));return t}return this.createComment("unknown vnode type")}serializeToJSON(e){let t=n=>{let i={type:n.type,props:{...n.props},children:n.children.map(t)};return n.nativeId&&(i.nativeId=n.nativeId),i};return JSON.stringify(t(e),null,2)}getComponentType(e){return te[e]||re(e)}mapStyle(e){let t={};for(let[n,i]of Object.entries(e)){let r=ne[n]||n;typeof i=="string"&&/^\d+px$/.test(i)?t[r]=parseInt(i,10):t[r]=i}return t}mapEvent(e){return ie[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function re(o){return o.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var j=new u;
@@ -0,0 +1 @@
1
+ import{registerDOMOperations as X}from"@lytjs/vdom";var m=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(m||{}),x=(d=>(d[d.TEXT=1]="TEXT",d[d.CLASS=2]="CLASS",d[d.STYLE=4]="STYLE",d[d.PROPS=8]="PROPS",d[d.FULL_PROPS=16]="FULL_PROPS",d[d.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",d[d.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",d[d.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",d[d.NEED_PATCH=256]="NEED_PATCH",d[d.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",d[d.HOISTED=-1]="HOISTED",d[d.BAIL=-2]="BAIL",d))(x||{}),S=Symbol("Fragment"),_=Symbol("Text"),O=Symbol("Comment");function y(r){return r.type===S}function u(r){return r.type===_}function N(r){return r.type===O}function I(r,e){return r.type===e.type&&r.key===e.key}function V(r){return Array.isArray(r.dynamicChildren)}function w(r,e,t,n){if(t==="class")r.setClass(e,n);else if(t==="style")r.setStyle(e,n);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r.addEventListener(e,i,n)}else t==="key"||t==="ref"||r.setAttribute(e,t,n)}function C(r,e,t,n,i){if(t==="class")r.setClass(e,n);else if(t==="style")r.setStyle(e,n||{});else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&r.removeEventListener(e,o,i),n&&r.addEventListener(e,o,n)}else r.setAttribute(e,t,n)}function E(r,e,t,n){for(let i in n){if(i==="key"||i==="ref")continue;let o=t[i],s=n[i];s!==o&&C(r,e,i,s,o)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in n))if(i==="class")r.setClass(e,"");else if(i==="style")r.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let o=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();r.removeEventListener(e,o,t[i])}else r.removeAttribute(e,i)}function R(r,e,t,n,i,o){let{shapeFlag:s}=t;if(y(t)){P(r,e,t,n,i,o);return}if(u(t)){let a=r.createText(t.children);t.el=a,r.insert(n,a,i);return}if(N(t)){let a=r.createComment(t.children);t.el=a,r.insert(n,a,i);return}if(s&1){M(r,e,t,n,i,o);return}if(s&6){W(e,t,n,i,o);return}}function M(r,e,t,n,i,o){let s=t.type,a=r.createElement(s);if(t.el=a,t.props)for(let c in t.props){let f=t.props[c];w(r,a,c,f)}let{shapeFlag:l,children:p}=t;l&8?a.textContent=p:l&16&&h(e,p,a,null,o),r.insert(n,a,i)}function h(r,e,t,n,i){for(let o=0;o<e.length;o++)r(null,e[o],t,n,i)}function P(r,e,t,n,i,o){let{children:s}=t,a=r.createComment("");r.insert(n,a,i),Array.isArray(s)&&s.length>0&&h(e,s,n,a,o),t.el=a,t.anchor=a}function W(r,e,t,n,i){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(r(null,o.subTree,t,n,o),e.el=o.subTree.el)}function D(r,e,t,n){let{shapeFlag:i,children:o}=t;if(y(t)){if(Array.isArray(o))for(let s=0;s<o.length;s++)e(o[s],n);t.anchor&&t.anchor.parentNode&&r.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,n);return}t.el&&r.remove(t.el)}function g(r,e){for(let t=0;t<e.length;t++)r(e[t])}import{patchKeyedChildren as U,patchUnkeyedChildren as j}from"@lytjs/vdom";function v(r,e,t,n,i,o=null,s=null){if(n==null){t&&e(t,i);return}if(t===null){R(r,L(r,e),n,i,o,s);return}if(V(n)&&V(t)){F(r,e,t,n,i,s);return}if(!I(t,n)){e(t,i),R(r,L(r,e),n,i,o,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(y(n)){z(r,e,t,n,i,o,s);return}if(u(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(N(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){B(r,e,t,n,s);return}if(a&6){K(t,n,s);return}}function L(r,e){return(t,n,i,o,s)=>{v(r,e,t,n,i,o,s)}}function B(r,e,t,n,i=null){let o=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:l,dynamicProps:p}=n;if(l&&l>0){if(l&1&&t.children!==n.children&&(o.textContent=n.children),l&2&&s.class!==a.class&&r.setClass(o,a.class),l&4&&s.style!==a.style&&r.setStyle(o,a.style||{}),l&8&&p)for(let c=0;c<p.length;c++){let f=p[c],d=s[f],b=a[f];b!==d&&C(r,o,f,b,d)}l&16&&E(r,o,s,a)}else E(r,o,s,a);(!l||!(l&1))&&H(r,e,t,n,o,null,i)}function H(r,e,t,n,i,o,s){let a=t.shapeFlag,l=n.shapeFlag,p=t.children,c=n.children;if(l&8){a&16&&g(e,p),p!==c&&(i.textContent=c);return}if(l&16){a&16?Y(r,e,p,c,i,o,s):(a&8&&(i.textContent=""),h(L(r,e),c,i,o,s));return}c==null&&(a&8?i.textContent="":a&16&&g(e,p))}function Y(r,e,t,n,i,o,s){n.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?U(t,n,i,o,s,null,!1):j(t,n,i,o,s,null,!1)}function z(r,e,t,n,i,o,s){let a=t.children,l=n.children;Array.isArray(l)&&l.length>0?(H(r,e,t,n,i,o,s),n.el=l[0].el,n.anchor=l[l.length-1].el?r.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(g(e,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function F(r,e,t,n,i,o){let s=t.dynamicChildren,a=n.dynamicChildren;for(let l=0;l<a.length;l++)v(r,e,s[l],a[l],i,null,o)}function K(r,e,t){e.component=r.component,e.el=r.el,e.component&&e.component.update&&e.component.update()}function G(r){function e(i,o){D(r,e,i,o)}X({insert(i,o,s){r.insert(o,i,s)},createElement(i){return r.createElement(i)},createText(i){return r.createText(i)},setText(i,o){i.nodeValue=o},setElementText(i,o){i.textContent=o},remove(i){r.remove(i)},createComment(i){return r.createComment(i)},mount(i,o,s,a,l,p,c){n(null,i,o,s,a)},patch(i,o,s,a,l,p,c,f){n(i,o,s,a,l)},unmount(i,o,s,a){e(i)},move(i,o,s){r.insert(o,i.el,s)}});function n(i,o,s,a,l){v(r,e,i,o,s,a,l)}return{mount(i,o){o.nodeType===1&&(o.textContent=""),n(null,i,o,null,null)},patch(i,o,s){var a;n(i,o,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,o){e(i,o)}}}var $={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",img:"Image",input:"TextInput",textarea:"TextInput",button:"TouchableOpacity",scroll:"ScrollView",list:"FlatList",a:"TouchableOpacity",ul:"View",ol:"View",li:"View",form:"View",header:"View",footer:"View",nav:"View",main:"View",section:"View",article:"View",aside:"View"},q={flexDirection:"flexDirection",justifyContent:"justifyContent",alignItems:"alignItems",alignSelf:"alignSelf",flexWrap:"flexWrap",flex:"flex",flexGrow:"flexGrow",flexShrink:"flexShrink",flexBasis:"flexBasis",backgroundColor:"backgroundColor",color:"color",fontSize:"fontSize",fontWeight:"fontWeight",fontStyle:"fontStyle",textAlign:"textAlign",lineHeight:"lineHeight",letterSpacing:"letterSpacing",padding:"padding",paddingTop:"paddingTop",paddingBottom:"paddingBottom",paddingLeft:"paddingLeft",paddingRight:"paddingRight",paddingHorizontal:"paddingHorizontal",paddingVertical:"paddingVertical",margin:"margin",marginTop:"marginTop",marginBottom:"marginBottom",marginLeft:"marginLeft",marginRight:"marginRight",marginHorizontal:"marginHorizontal",marginVertical:"marginVertical",width:"width",height:"height",minWidth:"minWidth",maxWidth:"maxWidth",minHeight:"minHeight",maxHeight:"maxHeight",borderRadius:"borderRadius",borderWidth:"borderWidth",borderColor:"borderColor",overflow:"overflow",opacity:"opacity",position:"position",top:"top",left:"left",right:"right",bottom:"bottom",zIndex:"zIndex",shadowColor:"shadowColor",shadowOffset:"shadowOffset",shadowOpacity:"shadowOpacity",shadowRadius:"shadowRadius"},J={click:"onPress",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",change:"onChange",input:"onChangeText",focus:"onFocus",blur:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",longpress:"onLongPress"},Q=0;function A(){return`native_${++Q}`}var T=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:A()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:A()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:A()}}setAttribute(e,t,n){if(e){if(t==="style"&&typeof n=="object"&&n!==null){e.props.style={...e.props.style,...this.mapStyle(n)};return}if(t==="className"||t==="class"){e.props.className=n;return}if(t.startsWith("on")&&typeof n=="function"){let i=t.slice(2).toLowerCase(),o=this.mapEvent(i);e.props[o]=n;return}if(t==="src"&&e.type==="Image"){e.props.source={uri:n};return}if(t==="href"){e.props.href=n;return}if(t==="placeholder"){e.props.placeholder=n;return}e.props[t]=n}}removeAttribute(e,t){if(e)if(t==="style")delete e.props.style;else if(t.startsWith("on")){let n=t.slice(2).toLowerCase(),i=this.mapEvent(n);delete e.props[i]}else delete e.props[t]}setStyle(e,t){if(!e)return;let n=this.mapStyle(t);e.props.style={...e.props.style,...n}}setClass(e,t){if(e){if(typeof t=="string")e.props.className=t;else if(typeof t=="object"&&t!==null){let n=[];for(let[i,o]of Object.entries(t))o&&n.push(i);e.props.className=n.join(" ")}}}insert(e,t,n){if(!(!e||!t)){if(t._parent){let i=t._parent,o=i.children.indexOf(t);o!==-1&&i.children.splice(o,1)}if(t._parent=e,n){let i=e.children.indexOf(n);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,n=t.children.indexOf(e);n!==-1&&t.children.splice(n,1),e._parent=void 0}replace(e,t,n){if(!e||!t||!n)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,n._parent=e,e.children[i]=n)}addEventListener(e,t,n,i){if(!e)return;let o=this.mapEvent(t);e.props[o]=n}removeEventListener(e,t,n){if(!e)return;let i=this.mapEvent(t);e.props[i]===n&&delete e.props[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,n=t.indexOf(e);return n!==-1&&n+1<t.length?t[n+1]:null}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,n,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let o=t.slice(2).toLowerCase(),s=this.mapEvent(o);e.props[s]=i}else this.setAttribute(e,t,i)}}querySelector(e){let t=e.replace(/[.#\[\]]/g,"").trim();return null}renderToNativeTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__Fragment");if(Array.isArray(e.children))for(let n of e.children){let i=this.renderToNativeTree(n);this.insert(t,i)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[n,i]of Object.entries(e.props))n==="key"||n==="ref"||this.setAttribute(t,n,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n));return t}return this.createComment("unknown vnode type")}serializeToJSON(e){let t=n=>{let i={type:n.type,props:{...n.props},children:n.children.map(t)};return n.nativeId&&(i.nativeId=n.nativeId),i};return JSON.stringify(t(e),null,2)}getComponentType(e){return $[e]||Z(e)}mapStyle(e){let t={};for(let[n,i]of Object.entries(e)){let o=q[n]||n;typeof i=="string"&&/^\d+px$/.test(i)?t[o]=parseInt(i,10):t[o]=i}return t}mapEvent(e){return J[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function Z(r){return r.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var k=new T;export{O as Comment,S as Fragment,T as NativeRenderer,x as PatchFlags,m as ShapeFlags,_ as Text,G as createRenderer,k as nativeRenderer};
package/dist/ssr.cjs ADDED
@@ -0,0 +1 @@
1
+ var W=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var $e=Object.prototype.hasOwnProperty;var ve=(t,e)=>{for(var n in e)W(t,n,{get:e[n],enumerable:!0})},we=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ie(e))!$e.call(t,s)&&s!==n&&W(t,s,{get:()=>e[s],enumerable:!(r=Oe(e,s))||r.enumerable});return t};var De=t=>we(W({},"__esModule",{value:!0}),t);var Vt={};ve(Vt,{Comment:()=>Y,Fragment:()=>G,PatchFlags:()=>M,ShapeFlags:()=>C,StringRenderer:()=>_,Text:()=>U,clearIslandRegistry:()=>Ae,clearMismatchWarnings:()=>Me,createHydrationIsland:()=>xe,createRenderer:()=>ye,getHydrateStats:()=>Se,getIslandRegistry:()=>He,getMismatchWarnings:()=>_e,hydrate:()=>Ve,hydrateAllIslands:()=>be,hydrateIsland:()=>se,isHydrating:()=>Ne,onHydrated:()=>Le,registerIslandComponent:()=>Ce,renderToStream:()=>me,renderToStreamGenerator:()=>pe,renderToString:()=>fe,resetHydrateStats:()=>ne,setHydrating:()=>Te,ssrRenderer:()=>ge,unmountIsland:()=>Re});module.exports=De(Vt);var de=require("@lytjs/vdom");var C=(i=>(i[i.ELEMENT=1]="ELEMENT",i[i.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",i[i.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",i[i.TEXT_CHILDREN=8]="TEXT_CHILDREN",i[i.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",i[i.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",i))(C||{}),M=(d=>(d[d.TEXT=1]="TEXT",d[d.CLASS=2]="CLASS",d[d.STYLE=4]="STYLE",d[d.PROPS=8]="PROPS",d[d.FULL_PROPS=16]="FULL_PROPS",d[d.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",d[d.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",d[d.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",d[d.NEED_PATCH=256]="NEED_PATCH",d[d.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",d[d.HOISTED=-1]="HOISTED",d[d.BAIL=-2]="BAIL",d))(M||{}),G=Symbol("Fragment"),U=Symbol("Text"),Y=Symbol("Comment");function R(t){return t.type===G}function O(t){return t.type===U}function I(t){return t.type===Y}function ie(t,e){return t.type===e.type&&t.key===e.key}function X(t){return Array.isArray(t.dynamicChildren)}function ae(t,e,n,r){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r);else if(n.startsWith("on")||n.startsWith("@")){let s=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();t.addEventListener(e,s,r)}else n==="key"||n==="ref"||t.setAttribute(e,n,r)}function z(t,e,n,r,s){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r||{});else if(n.startsWith("on")||n.startsWith("@")){let o=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();s&&t.removeEventListener(e,o,s),r&&t.addEventListener(e,o,r)}else t.setAttribute(e,n,r)}function q(t,e,n,r){for(let s in r){if(s==="key"||s==="ref")continue;let o=n[s],i=r[s];i!==o&&z(t,e,s,i,o)}for(let s in n)if(!(s==="key"||s==="ref")&&!(s in r))if(s==="class")t.setClass(e,"");else if(s==="style")t.setStyle(e,{});else if(s.startsWith("on")||s.startsWith("@")){let o=s.startsWith("@")?s.slice(1).toLowerCase():s.slice(2).toLowerCase();t.removeEventListener(e,o,n[s])}else t.removeAttribute(e,s)}function B(t,e,n,r,s,o){let{shapeFlag:i}=n;if(R(n)){je(t,e,n,r,s,o);return}if(O(n)){let a=t.createText(n.children);n.el=a,t.insert(r,a,s);return}if(I(n)){let a=t.createComment(n.children);n.el=a,t.insert(r,a,s);return}if(i&1){Pe(t,e,n,r,s,o);return}if(i&6){Fe(e,n,r,s,o);return}}function Pe(t,e,n,r,s,o){let i=n.type,a=t.createElement(i);if(n.el=a,n.props)for(let y in n.props){let u=n.props[y];ae(t,a,y,u)}let{shapeFlag:l,children:c}=n;l&8?a.textContent=c:l&16&&$(e,c,a,null,o),t.insert(r,a,s)}function $(t,e,n,r,s){for(let o=0;o<e.length;o++)t(null,e[o],n,r,s)}function je(t,e,n,r,s,o){let{children:i}=n,a=t.createComment("");t.insert(r,a,s),Array.isArray(i)&&i.length>0&&$(e,i,r,a,o),n.el=a,n.anchor=a}function Fe(t,e,n,r,s){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(t(null,o.subTree,n,r,o),e.el=o.subTree.el)}function le(t,e,n,r){let{shapeFlag:s,children:o}=n;if(R(n)){if(Array.isArray(o))for(let i=0;i<o.length;i++)e(o[i],r);n.anchor&&n.anchor.parentNode&&t.remove(n.anchor);return}if(s&6){n.component&&n.component.subTree&&e(n.component.subTree,r);return}n.el&&t.remove(n.el)}function v(t,e){for(let n=0;n<e.length;n++)t(e[n])}var w=require("@lytjs/vdom");function D(t,e,n,r,s,o=null,i=null){if(r==null){n&&e(n,s);return}if(n===null){B(t,K(t,e),r,s,o,i);return}if(X(r)&&X(n)){Ue(t,e,n,r,s,i);return}if(!ie(n,r)){e(n,s),B(t,K(t,e),r,s,o,i);return}r.el=n.el,r.anchor=n.anchor;let{shapeFlag:a}=r;if(R(r)){Ge(t,e,n,r,s,o,i);return}if(O(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(I(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(a&1){ke(t,e,n,r,i);return}if(a&6){Ye(n,r,i);return}}function K(t,e){return(n,r,s,o,i)=>{D(t,e,n,r,s,o,i)}}function ke(t,e,n,r,s=null){let o=r.el=n.el,i=n.props||{},a=r.props||{},{patchFlag:l,dynamicProps:c}=r;if(l&&l>0){if(l&1&&n.children!==r.children&&(o.textContent=r.children),l&2&&i.class!==a.class&&t.setClass(o,a.class),l&4&&i.style!==a.style&&t.setStyle(o,a.style||{}),l&8&&c)for(let y=0;y<c.length;y++){let u=c[y],d=i[u],N=a[u];N!==d&&z(t,o,u,N,d)}l&16&&q(t,o,i,a)}else q(t,o,i,a);(!l||!(l&1))&&ce(t,e,n,r,o,null,s)}function ce(t,e,n,r,s,o,i){let a=n.shapeFlag,l=r.shapeFlag,c=n.children,y=r.children;if(l&8){a&16&&v(e,c),c!==y&&(s.textContent=y);return}if(l&16){a&16?We(t,e,c,y,s,o,i):(a&8&&(s.textContent=""),$(K(t,e),y,s,o,i));return}y==null&&(a&8?s.textContent="":a&16&&v(e,c))}function We(t,e,n,r,s,o,i){r.every(l=>l.key!=null)&&n.every(l=>l.key!=null)?(0,w.patchKeyedChildren)(n,r,s,o,i,null,!1):(0,w.patchUnkeyedChildren)(n,r,s,o,i,null,!1)}function Ge(t,e,n,r,s,o,i){let a=n.children,l=r.children;Array.isArray(l)&&l.length>0?(ce(t,e,n,r,s,o,i),r.el=l[0].el,r.anchor=l[l.length-1].el?t.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(v(e,a),r.el=n.el,r.anchor=n.anchor):(r.el=n.el,r.anchor=n.anchor)}function Ue(t,e,n,r,s,o){let i=n.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)D(t,e,i[l],a[l],s,null,o)}function Ye(t,e,n){e.component=t.component,e.el=t.el,e.component&&e.component.update&&e.component.update()}function ye(t){function e(s,o){le(t,e,s,o)}(0,de.registerDOMOperations)({insert(s,o,i){t.insert(o,s,i)},createElement(s){return t.createElement(s)},createText(s){return t.createText(s)},setText(s,o){s.nodeValue=o},setElementText(s,o){s.textContent=o},remove(s){t.remove(s)},createComment(s){return t.createComment(s)},mount(s,o,i,a,l,c,y){r(null,s,o,i,a)},patch(s,o,i,a,l,c,y,u){r(s,o,i,a,l)},unmount(s,o,i,a){e(s)},move(s,o,i){t.insert(o,s.el,i)}});function r(s,o,i,a,l){D(t,e,s,o,i,a,l)}return{mount(s,o){o.nodeType===1&&(o.textContent=""),r(null,s,o,null,null)},patch(s,o,i){var a;r(s,o,i||((a=s.el)==null?void 0:a.parentNode),null,null)},unmount(s,o){e(s,o)}}}var J=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Xe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ze=/[&<>"']/g,T={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},qe=0;function f(t){return t.replace(ze,e=>Xe[e])}function Be(t,e){return t.startsWith("on")||t.startsWith("@")||t==="key"||t==="ref"||t==="__vccOpts"||t.startsWith("__")?"":e===!0?t:e===!1||e===null||e===void 0?"":t==="class"?`class="${f(ue(e))}"`:t==="style"?`style="${f(Ke(e))}"`:t==="dangerouslySetInnerHTML"||t==="innerHTML"?"":`${t}="${f(String(e))}"`}function ue(t){if(!t)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(ue).filter(Boolean).join(" ");if(typeof t=="object"){let e=[];for(let n in t)t[n]&&e.push(n);return e.join(" ")}return String(t)}function Ke(t){if(!t)return"";if(typeof t=="string")return t;if(typeof t=="object"){let e=[];for(let n in t)if(t[n]){let r=n.replace(/([A-Z])/g,"-$1").toLowerCase();e.push(`${r}: ${t[n]}`)}return e.join("; ")}return String(t)}function Z(t){if(!t)return"";let e=[];for(let n in t){let r=t[n],s=Be(n,r);s&&e.push(s)}return e.length>0?" "+e.join(" "):""}var _=class{createElement(e){return{tag:e,props:{},children:[]}}createText(e){return{type:"text",value:e}}createComment(e){return{type:"comment",value:e}}insert(e,n,r){e.children.push(n)}renderToString(e){return m(e)}async*renderToStream(e){yield*P(e)}};function m(t){if(t==null)return"";let{type:e,props:n,children:r}=t;return typeof e=="symbol"&&String(e)==="Symbol(Fragment)"?Array.isArray(r)?r.map(s=>m(s)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?f(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?Je(e,n,r,t):typeof e=="object"&&e!==null||typeof e=="function"?H(t):""}function Je(t,e,n,r){let s=Z(e);if(J.has(t))return`<${t}${s} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${t}${s}>${a}</${t}>`}let o="",i=r.shapeFlag||0;return i&T.TEXT_CHILDREN?o=f(String(n||"")):i&T.ARRAY_CHILDREN&&Array.isArray(n)?o=n.map(a=>m(a)).join(""):i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null?o=Q(n):typeof n=="string"?o=f(n):Array.isArray(n)?o=n.map(a=>m(a)).join(""):typeof n=="number"&&(o=f(String(n))),`<${t}${s}>${o}</${t}>`}function Q(t){let e=[];for(let n in t){let r=t[n];if(typeof r=="function"){let s=r();Array.isArray(s)?e.push(s.map(o=>m(o)).join("")):s!=null&&e.push(m(s))}else Array.isArray(r)?e.push(r.map(s=>m(s)).join("")):r!=null&&e.push(m(r))}return e.join("")}function H(t){let e=t.type;if(e&&e.__island)return Ze(t,e);if(typeof e=="function"){let n=e(t.props||{},{slots:t.children||{}});return m(n)}if(typeof e=="object"&&e!==null){if(typeof e.render=="function"){let n=e.render(t.props||{},{slots:t.children||{},emit:()=>{}});return m(n)}if(typeof e.setup=="function"){let n=e.setup(t.props||{},{emit:()=>{},slots:t.children||{}});if(typeof n=="function"){let r=n();return m(r)}if(typeof e.render=="function"){let r=e.render(n||{},{slots:t.children||{},emit:()=>{}});return m(r)}}}return t.component&&t.component.subTree?m(t.component.subTree):"<!---->"}function Ze(t,e){var N;let n=e.name||((N=t.props)==null?void 0:N["data-island-id"])||"anonymous",r=t.props||{},s=r["data-hydrate-when"]||e.__hydrateWhen||"",o=e.__islandTag||"div",i={};for(let g in r)g==="data-hydrate-when"||g==="data-island-id"||(i[g]=r[g]);let a=JSON.stringify(i),l=f(a),c="";if(typeof e.render=="function"){let g=e.render(r,{slots:t.children||{},emit:()=>{}});c=m(g)}else if(typeof e=="function"){let g=e(r,{slots:t.children||{}});c=m(g)}let y=s?` data-hydrate-when="${f(s)}"`:"",u=`<${o} data-hydrate="${f(n)}" data-props="${l}"${y}>${c}</${o}>`,d=`<script type="application/json" data-hydrate-props="${f(n)}">${a}<\/script>`;return u+d}async function*P(t){if(t==null)return;let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)"){if(Array.isArray(r))for(let s of r)yield*P(s);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield f(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*Qe(e,n,r,t);return}if(typeof e=="object"||typeof e=="function"){yield H(t);return}}async function*Qe(t,e,n,r){let s=Z(e);if(J.has(t)){yield`<${t}${s} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let i=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${s}>${i}</${t}>`;return}yield`<${t}${s}>`;let o=r.shapeFlag||0;if(o&T.TEXT_CHILDREN)yield f(String(n||""));else if(o&T.ARRAY_CHILDREN&&Array.isArray(n))for(let i of n)yield*P(i);else if(o&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield Q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let i of n)yield*P(i);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}function fe(t){return m(t)}function me(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=S(t,n);return new ReadableStream({async pull(s){let{value:o,done:i}=await r.next();i?s.close():s.enqueue(o)},async cancel(){await r.return(void 0)}})}async function*pe(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense";yield*S(t,n)}async function*S(t,e){if(t==null)return;let{type:n,props:r,children:s}=t;if(typeof n=="symbol"&&String(n)==="Symbol(Fragment)"){if(Array.isArray(s))for(let o of s)yield*S(o,e);return}if(typeof n=="symbol"&&String(n).includes("Text")){yield f(String(s||""));return}if(typeof n=="symbol"&&String(n).includes("Comment")){yield`<!--${String(s||"")}-->`;return}if(typeof n=="string"){yield*et(n,r,s,t,e);return}if(typeof n=="object"&&n!==null){let o=n;if(o.name==="Suspense"||o._isSuspense){yield*tt(t,e);return}if(o._isAsyncComponent||o.__asyncSetup){yield*nt(t,e);return}yield H(t);return}if(typeof n=="function"){yield H(t);return}}async function*et(t,e,n,r,s){let o=Z(e);if(J.has(t)){yield`<${t}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${o}>${a}</${t}>`;return}yield`<${t}${o}>`;let i=r.shapeFlag||0;if(i&T.TEXT_CHILDREN)yield f(String(n||""));else if(i&T.ARRAY_CHILDREN&&Array.isArray(n))for(let a of n)yield*S(a,s);else if(i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield Q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let a of n)yield*S(a,s);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}async function*tt(t,e){let n=`${e}-${qe++}`,r=t.type,o=(t.props||{}).fallback,i="";o&&(typeof o=="object"&&o!==null?i=m(o):typeof o=="string"&&(i=o));let a=t.children,l=[];if(typeof a=="object"&&a!==null){if(Array.isArray(a))l=a;else if(typeof a.default=="function"){let u=a.default();Array.isArray(u)?l=u:u!=null&&(l=[u])}}let c=[];function y(u){for(let d of u){if(d==null)continue;let N=d.type;if(N&&(N._isAsyncComponent||N.__asyncSetup||d.__asyncSetup)){let g=d.__asyncPromise||N.__asyncPromise;g&&c.push(g.then(()=>{}))}}}if(y(l),c.length===0){for(let u of l)yield*S(u,e);return}yield`<!--${n}-fallback-->`,yield i,await Promise.all(c),yield`<!--${n}-resolved-->`;for(let u of l)yield*S(u,e);yield`<!--/${n}-->`}async function*nt(t,e){let n=t.type,r=t.__asyncPromise||n.__asyncPromise;if(r)try{await r}catch(s){yield"<!--async-component-error-->";return}yield H(t)}var ge=new _;var F={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},h=!1,te=[],p={success:!0,mismatches:0,hydratedNodes:0};function Ne(){return h}function Te(t){h=t}function Se(){return{...p}}function ne(){p={success:!0,mismatches:0,hydratedNodes:0}}function Le(t){h?te.push(t):t()}function Ve(t,e,n={}){ne(),n.onHydrated&&te.push(n.onHydrated),h=!0;try{let r=e.firstElementChild;return r?(t._vnode||t.mount(e),t._vnode&&V(r,t._vnode,n),h=!1,ee(),p):(h=!1,t.mount(e),p.success=!1,ee(),p)}catch(r){return h=!1,p.success=!1,e.innerHTML="",t.mount(e),ee(),p}}function ee(){let t=te.splice(0);for(let e of t)try{e()}catch(n){}}function V(t,e,n){if(dt(e)){it(t,e,n);return}if(yt(e)){st(t,e,n);return}if(ut(e)){ot(t,e,n);return}if(ft(e)){at(t,e,n);return}if(typeof e.type=="string"){rt(t,e,n);return}}function rt(t,e,n){let r=t.tagName.toLowerCase(),s=e.type.toLowerCase();if(r!==s){k(t,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${s}"`,n);return}e.el=t,e.props&&re(t,e.props),e.ref&&ct(t,e.ref),lt(t,e,n),p.hydratedNodes++}function st(t,e,n){if(t.nodeType!==3){k(t,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s,n.strict),p.hydratedNodes++}function ot(t,e,n){if(t.nodeType!==8){k(t,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s),p.hydratedNodes++}function it(t,e,n){if(!Array.isArray(e.children))return;let r=Array.from(t.childNodes);for(let s=0;s<e.children.length;s++){let o=e.children[s],i=r[s];if(!i){p.mismatches++;break}V(i,o,n)}}function at(t,e,n){if(e.component&&e.component.subTree){V(t,e.component.subTree,n),e.el=e.component.subTree.el;return}let r=e.type;if(typeof r=="function")try{let s=r(e.props||{},{slots:e.children||{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let s=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}k(t,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",n)}function lt(t,e,n){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&F.TEXT_CHILDREN){let s=t.textContent||"",o=String(e.children||"");s!==o&&(t.textContent=o,n.strict);return}if(Array.isArray(e.children)){let s=Array.from(t.childNodes),o=0;for(let i=0;i<s.length&&o<e.children.length;i++){let a=e.children[o];if(a==null){o++;continue}V(s[i],a,n),o++}o<e.children.length&&p.mismatches++}r&F.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function re(t,e){for(let n in e){let r=e[n];if(n.startsWith("on")&&typeof r=="function"){let s=n.slice(2).toLowerCase();t.addEventListener(s,r)}}}function ct(t,e){typeof e=="function"?e(t):e&&typeof e=="object"&&(e.current=t)}function dt(t){return typeof t.type=="symbol"&&String(t.type)==="Symbol(Fragment)"}function yt(t){return typeof t.type=="symbol"&&String(t.type).includes("Text")}function ut(t){return typeof t.type=="symbol"&&String(t.type).includes("Comment")}function ft(t){return!!((t.shapeFlag||0)&(F.STATEFUL_COMPONENT|F.FUNCTIONAL_COMPONENT)||typeof t.type=="object"&&t.type!==null||typeof t.type=="function")}function k(t,e,n,r){let s=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${n}`;if(p.mismatches++,r.strict)throw new Error(s)}var b=new Map,x=new Map,mt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pt=/[&<>"']/g;function E(t){return t.replace(pt,e=>mt[e])}function se(t,e,n={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let s=r.querySelector(t);if(!s)return{success:!1,mismatches:0,hydratedNodes:0};let o=s.getAttribute("data-hydrate");if(!o)return{success:!1,mismatches:0,hydratedNodes:0};if(s.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let i=gt(o,r);if(i===null)return{success:!1,mismatches:0,hydratedNodes:0};let a=s.getAttribute("data-hydrate-when");return a||n.lazy?ht(s,o,e,i,a||"visible",n):L(s,o,e,i,n)}function gt(t,e){let n=e.querySelector(`script[type="application/json"][data-hydrate-props="${t}"]`);if(!n){let r=e.querySelector(`[data-hydrate="${t}"]`);if(r){let s=r.getAttribute("data-props");if(s)try{return JSON.parse(s)}catch(o){return null}}return{}}try{return JSON.parse(n.textContent||"{}")}catch(r){return null}}function L(t,e,n,r,s){let o={success:!0,mismatches:0,hydratedNodes:0};try{h=!0;let i=null;if(typeof n.render=="function")i=n.render(r,{slots:n.slots||{},emit:()=>{}});else if(typeof n.setup=="function"){let l=n.setup(r,{emit:()=>{},slots:n.slots||{}});typeof l=="function"&&(i=l())}if(!i)return h=!1,o.success=!1,o;if(s.dev!==!1){let l=Tt(t,i,e);o.mismatches=l}V(t,i,s),o.hydratedNodes=p.hydratedNodes,i.props&&re(t,i.props),j(t,i),t.setAttribute("data-hydrated","");let a={id:e,hydrated:!0,instance:n,eventListeners:[],timeoutId:null,observer:null,interactionHandler:null};return b.set(e,a),x.set(e,n),h=!1,s.onHydrated&&s.onHydrated(),o}catch(i){return h=!1,o.success=!1,o}}function j(t,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let n=Array.from(t.children),r=0;for(let s=0;s<n.length&&r<e.children.length;s++){let o=e.children[r];if(o==null){r++;continue}if(typeof o.type=="string"&&o.props)re(n[s],o.props),j(n[s],o);else if(typeof o.type=="object"||typeof o.type=="function"){let i=o.type;if(typeof i=="function")try{let a=i(o.props||{},{slots:o.children||{}});a&&n[s]&&j(n[s],a)}catch(a){}else if(i&&typeof i.render=="function")try{let a=i.render(o.props||{},{slots:o.children||{},emit:()=>{}});a&&n[s]&&j(n[s],a)}catch(a){}}r++}}}function ht(t,e,n,r,s,o){let i={success:!0,mismatches:0,hydratedNodes:0},a=null;o.timeout&&o.timeout>0&&(a=setTimeout(()=>{Ee(t,e),L(t,e,n,r,o)},o.timeout));let l={id:e,hydrated:!1,instance:n,eventListeners:[],timeoutId:a,observer:null,interactionHandler:null};switch(b.set(e,l),x.set(e,n),s){case"visible":{if(typeof IntersectionObserver!="undefined"){let c=new IntersectionObserver(y=>{for(let u of y)u.isIntersecting&&(c.unobserve(u.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,L(t,e,n,r,o))},{rootMargin:"200px"});c.observe(t),l.observer=c}else a&&clearTimeout(a),L(t,e,n,r,o);break}case"idle":{(y=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(y,{timeout:o.timeout||2e3}):setTimeout(y,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,t.hasAttribute("data-hydrated")||L(t,e,n,r,o)});break}case"interaction":{let c=()=>{a&&clearTimeout(a),l.timeoutId=null,l.interactionHandler=null,document.removeEventListener("click",c),document.removeEventListener("keydown",c),document.removeEventListener("scroll",c),document.removeEventListener("touchstart",c),t.hasAttribute("data-hydrated")||L(t,e,n,r,o)};document.addEventListener("click",c,{once:!1,passive:!0}),document.addEventListener("keydown",c,{once:!1,passive:!0}),document.addEventListener("scroll",c,{once:!1,passive:!0}),document.addEventListener("touchstart",c,{once:!1,passive:!0}),l.interactionHandler=c;break}default:a&&clearTimeout(a),L(t,e,n,r,o)}return i}function Ee(t,e){let n=b.get(e);n&&(n.observer&&(n.observer.disconnect(),n.observer=null),n.timeoutId!==null&&(clearTimeout(n.timeoutId),n.timeoutId=null),n.interactionHandler&&(document.removeEventListener("click",n.interactionHandler),document.removeEventListener("keydown",n.interactionHandler),document.removeEventListener("scroll",n.interactionHandler),document.removeEventListener("touchstart",n.interactionHandler),n.interactionHandler=null))}function be(t={}){let e=typeof document!="undefined"?document:null;if(!e)return{success:!1,mismatches:0,hydratedNodes:0};let n=e.querySelectorAll("[data-hydrate]:not([data-hydrated])"),r={success:!0,mismatches:0,hydratedNodes:0};return n.forEach(s=>{let o=s.getAttribute("data-hydrate"),i=x.get(o);if(!i){r.success=!1;return}let a=se(`[data-hydrate="${o}"]`,i,t);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function Ce(t,e){x.set(t,e)}function Re(t){if(!b.get(t))return;let n=typeof document!="undefined"?document.querySelector(`[data-hydrate="${t}"]`):null;n&&(Ee(n,t),n.removeAttribute("data-hydrated")),b.delete(t),x.delete(t)}function He(){return b}function Ae(){b.clear(),x.clear()}function xe(t,e={},n="div",r){let s=t.name||"anonymous",o=JSON.stringify(e),i=E(o),a="";if(typeof t.render=="function"){let u=t.render(e,{slots:t.slots||{},emit:()=>{}});a=A(u)}let l=r?` data-hydrate-when="${r}"`:"",c=`<${n} data-hydrate="${s}" data-props="${i}"${l}>${a}</${n}>`,y=`<script type="application/json" data-hydrate-props="${s}">${o}<\/script>`;return c+y}function A(t){if(t==null)return"";let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)")return Array.isArray(r)?r.map(s=>A(s)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return E(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${String(r||"")}-->`;if(typeof e=="string"){let s=Nt(n);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${s} />`;let i="";return typeof r=="string"?i=E(r):Array.isArray(r)?i=r.map(a=>A(a)).join(""):typeof r=="number"&&(i=E(String(r))),`<${e}${s}>${i}</${e}>`}if(typeof e=="function"){let s=e(n||{},{slots:r||{}});return A(s)}if(typeof e=="object"&&e!==null){let s=e;if(typeof s.render=="function"){let o=s.render(n||{},{slots:r||{},emit:()=>{}});return A(o)}}return""}function Nt(t){if(!t)return"";let e=[];for(let n in t){let r=t[n];if(!(n.startsWith("on")||n.startsWith("@")||n==="key"||n==="ref")&&!(n==="__vccOpts"||n.startsWith("__"))&&!(n==="dangerouslySetInnerHTML"||n==="innerHTML"))if(r===!0)e.push(n);else{if(r===!1||r===null||r===void 0)continue;n==="class"&&typeof r=="string"?e.push(`class="${E(r)}"`):n==="style"&&typeof r=="string"?e.push(`style="${E(r)}"`):e.push(`${n}="${E(String(r))}"`)}}return e.length>0?" "+e.join(" "):""}var oe=[];function Tt(t,e,n){let r=0,s=St(t),o=A(e);if(s!==o){r++;let i={islandId:n,expected:o,actual:s,suggestion:Lt(s,o,n)};oe.push(i)}return r}function St(t){let e=t.cloneNode(!0);return e.removeAttribute("data-hydrate"),e.removeAttribute("data-props"),e.removeAttribute("data-hydrate-when"),e.removeAttribute("data-hydrated"),e.innerHTML}function Lt(t,e,n){if(t.trim()==="")return`\u670D\u52A1\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684\u670D\u52A1\u7AEF\u6E32\u67D3\u903B\u8F91`;if(e.trim()==="")return`\u5BA2\u6237\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684 render \u51FD\u6570`;let r=/\d{10,13}/;return r.test(t)||r.test(e)?"\u68C0\u6D4B\u5230\u65F6\u95F4\u6233\u5DEE\u5F02\uFF0C\u8003\u8651\u4F7F\u7528\u7EDF\u4E00\u7684\u65F6\u95F4\u6E90\u6216\u5EF6\u8FDF\u6CE8\u6C34":he(t)===he(e)?"HTML \u5185\u5BB9\u76F8\u540C\u4F46\u5C5E\u6027\u987A\u5E8F\u4E0D\u540C\uFF0C\u8FD9\u4E0D\u5F71\u54CD\u529F\u80FD\u4F46\u53EF\u80FD\u5BFC\u81F4 mismatch \u8B66\u544A":`\u8BF7\u786E\u4FDD\u7EC4\u4EF6 "${n}" \u5728\u670D\u52A1\u7AEF\u548C\u5BA2\u6237\u7AEF\u6E32\u67D3\u76F8\u540C\u7684\u8F93\u51FA`}function he(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function _e(){return[...oe]}function Me(){oe.length=0}
package/dist/ssr.mjs ADDED
@@ -0,0 +1 @@
1
+ import{registerDOMOperations as Le}from"@lytjs/vdom";var x=(i=>(i[i.ELEMENT=1]="ELEMENT",i[i.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",i[i.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",i[i.TEXT_CHILDREN=8]="TEXT_CHILDREN",i[i.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",i[i.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",i))(x||{}),F=(d=>(d[d.TEXT=1]="TEXT",d[d.CLASS=2]="CLASS",d[d.STYLE=4]="STYLE",d[d.PROPS=8]="PROPS",d[d.FULL_PROPS=16]="FULL_PROPS",d[d.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",d[d.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",d[d.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",d[d.NEED_PATCH=256]="NEED_PATCH",d[d.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",d[d.HOISTED=-1]="HOISTED",d[d.BAIL=-2]="BAIL",d))(F||{}),Q=Symbol("Fragment"),ee=Symbol("Text"),te=Symbol("Comment");function C(t){return t.type===Q}function _(t){return t.type===ee}function M(t){return t.type===te}function ne(t,e){return t.type===e.type&&t.key===e.key}function k(t){return Array.isArray(t.dynamicChildren)}function re(t,e,n,r){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r);else if(n.startsWith("on")||n.startsWith("@")){let s=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();t.addEventListener(e,s,r)}else n==="key"||n==="ref"||t.setAttribute(e,n,r)}function W(t,e,n,r,s){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r||{});else if(n.startsWith("on")||n.startsWith("@")){let o=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();s&&t.removeEventListener(e,o,s),r&&t.addEventListener(e,o,r)}else t.setAttribute(e,n,r)}function G(t,e,n,r){for(let s in r){if(s==="key"||s==="ref")continue;let o=n[s],i=r[s];i!==o&&W(t,e,s,i,o)}for(let s in n)if(!(s==="key"||s==="ref")&&!(s in r))if(s==="class")t.setClass(e,"");else if(s==="style")t.setStyle(e,{});else if(s.startsWith("on")||s.startsWith("@")){let o=s.startsWith("@")?s.slice(1).toLowerCase():s.slice(2).toLowerCase();t.removeEventListener(e,o,n[s])}else t.removeAttribute(e,s)}function U(t,e,n,r,s,o){let{shapeFlag:i}=n;if(C(n)){ue(t,e,n,r,s,o);return}if(_(n)){let a=t.createText(n.children);n.el=a,t.insert(r,a,s);return}if(M(n)){let a=t.createComment(n.children);n.el=a,t.insert(r,a,s);return}if(i&1){ye(t,e,n,r,s,o);return}if(i&6){fe(e,n,r,s,o);return}}function ye(t,e,n,r,s,o){let i=n.type,a=t.createElement(i);if(n.el=a,n.props)for(let y in n.props){let u=n.props[y];re(t,a,y,u)}let{shapeFlag:l,children:c}=n;l&8?a.textContent=c:l&16&&O(e,c,a,null,o),t.insert(r,a,s)}function O(t,e,n,r,s){for(let o=0;o<e.length;o++)t(null,e[o],n,r,s)}function ue(t,e,n,r,s,o){let{children:i}=n,a=t.createComment("");t.insert(r,a,s),Array.isArray(i)&&i.length>0&&O(e,i,r,a,o),n.el=a,n.anchor=a}function fe(t,e,n,r,s){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(t(null,o.subTree,n,r,o),e.el=o.subTree.el)}function se(t,e,n,r){let{shapeFlag:s,children:o}=n;if(C(n)){if(Array.isArray(o))for(let i=0;i<o.length;i++)e(o[i],r);n.anchor&&n.anchor.parentNode&&t.remove(n.anchor);return}if(s&6){n.component&&n.component.subTree&&e(n.component.subTree,r);return}n.el&&t.remove(n.el)}function I(t,e){for(let n=0;n<e.length;n++)t(e[n])}import{patchKeyedChildren as me,patchUnkeyedChildren as pe}from"@lytjs/vdom";function $(t,e,n,r,s,o=null,i=null){if(r==null){n&&e(n,s);return}if(n===null){U(t,Y(t,e),r,s,o,i);return}if(k(r)&&k(n)){Te(t,e,n,r,s,i);return}if(!ne(n,r)){e(n,s),U(t,Y(t,e),r,s,o,i);return}r.el=n.el,r.anchor=n.anchor;let{shapeFlag:a}=r;if(C(r)){Ne(t,e,n,r,s,o,i);return}if(_(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(M(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(a&1){ge(t,e,n,r,i);return}if(a&6){Se(n,r,i);return}}function Y(t,e){return(n,r,s,o,i)=>{$(t,e,n,r,s,o,i)}}function ge(t,e,n,r,s=null){let o=r.el=n.el,i=n.props||{},a=r.props||{},{patchFlag:l,dynamicProps:c}=r;if(l&&l>0){if(l&1&&n.children!==r.children&&(o.textContent=r.children),l&2&&i.class!==a.class&&t.setClass(o,a.class),l&4&&i.style!==a.style&&t.setStyle(o,a.style||{}),l&8&&c)for(let y=0;y<c.length;y++){let u=c[y],d=i[u],N=a[u];N!==d&&W(t,o,u,N,d)}l&16&&G(t,o,i,a)}else G(t,o,i,a);(!l||!(l&1))&&oe(t,e,n,r,o,null,s)}function oe(t,e,n,r,s,o,i){let a=n.shapeFlag,l=r.shapeFlag,c=n.children,y=r.children;if(l&8){a&16&&I(e,c),c!==y&&(s.textContent=y);return}if(l&16){a&16?he(t,e,c,y,s,o,i):(a&8&&(s.textContent=""),O(Y(t,e),y,s,o,i));return}y==null&&(a&8?s.textContent="":a&16&&I(e,c))}function he(t,e,n,r,s,o,i){r.every(l=>l.key!=null)&&n.every(l=>l.key!=null)?me(n,r,s,o,i,null,!1):pe(n,r,s,o,i,null,!1)}function Ne(t,e,n,r,s,o,i){let a=n.children,l=r.children;Array.isArray(l)&&l.length>0?(oe(t,e,n,r,s,o,i),r.el=l[0].el,r.anchor=l[l.length-1].el?t.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(I(e,a),r.el=n.el,r.anchor=n.anchor):(r.el=n.el,r.anchor=n.anchor)}function Te(t,e,n,r,s,o){let i=n.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)$(t,e,i[l],a[l],s,null,o)}function Se(t,e,n){e.component=t.component,e.el=t.el,e.component&&e.component.update&&e.component.update()}function Ve(t){function e(s,o){se(t,e,s,o)}Le({insert(s,o,i){t.insert(o,s,i)},createElement(s){return t.createElement(s)},createText(s){return t.createText(s)},setText(s,o){s.nodeValue=o},setElementText(s,o){s.textContent=o},remove(s){t.remove(s)},createComment(s){return t.createComment(s)},mount(s,o,i,a,l,c,y){r(null,s,o,i,a)},patch(s,o,i,a,l,c,y,u){r(s,o,i,a,l)},unmount(s,o,i,a){e(s)},move(s,o,i){t.insert(o,s.el,i)}});function r(s,o,i,a,l){$(t,e,s,o,i,a,l)}return{mount(s,o){o.nodeType===1&&(o.textContent=""),r(null,s,o,null,null)},patch(s,o,i){var a;r(s,o,i||((a=s.el)==null?void 0:a.parentNode),null,null)},unmount(s,o){e(s,o)}}}var X=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ee={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},be=/[&<>"']/g,T={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},Ce=0;function f(t){return t.replace(be,e=>Ee[e])}function Re(t,e){return t.startsWith("on")||t.startsWith("@")||t==="key"||t==="ref"||t==="__vccOpts"||t.startsWith("__")?"":e===!0?t:e===!1||e===null||e===void 0?"":t==="class"?`class="${f(ie(e))}"`:t==="style"?`style="${f(He(e))}"`:t==="dangerouslySetInnerHTML"||t==="innerHTML"?"":`${t}="${f(String(e))}"`}function ie(t){if(!t)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(ie).filter(Boolean).join(" ");if(typeof t=="object"){let e=[];for(let n in t)t[n]&&e.push(n);return e.join(" ")}return String(t)}function He(t){if(!t)return"";if(typeof t=="string")return t;if(typeof t=="object"){let e=[];for(let n in t)if(t[n]){let r=n.replace(/([A-Z])/g,"-$1").toLowerCase();e.push(`${r}: ${t[n]}`)}return e.join("; ")}return String(t)}function z(t){if(!t)return"";let e=[];for(let n in t){let r=t[n],s=Re(n,r);s&&e.push(s)}return e.length>0?" "+e.join(" "):""}var v=class{createElement(e){return{tag:e,props:{},children:[]}}createText(e){return{type:"text",value:e}}createComment(e){return{type:"comment",value:e}}insert(e,n,r){e.children.push(n)}renderToString(e){return m(e)}async*renderToStream(e){yield*w(e)}};function m(t){if(t==null)return"";let{type:e,props:n,children:r}=t;return typeof e=="symbol"&&String(e)==="Symbol(Fragment)"?Array.isArray(r)?r.map(s=>m(s)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?f(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?Ae(e,n,r,t):typeof e=="object"&&e!==null||typeof e=="function"?R(t):""}function Ae(t,e,n,r){let s=z(e);if(X.has(t))return`<${t}${s} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${t}${s}>${a}</${t}>`}let o="",i=r.shapeFlag||0;return i&T.TEXT_CHILDREN?o=f(String(n||"")):i&T.ARRAY_CHILDREN&&Array.isArray(n)?o=n.map(a=>m(a)).join(""):i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null?o=q(n):typeof n=="string"?o=f(n):Array.isArray(n)?o=n.map(a=>m(a)).join(""):typeof n=="number"&&(o=f(String(n))),`<${t}${s}>${o}</${t}>`}function q(t){let e=[];for(let n in t){let r=t[n];if(typeof r=="function"){let s=r();Array.isArray(s)?e.push(s.map(o=>m(o)).join("")):s!=null&&e.push(m(s))}else Array.isArray(r)?e.push(r.map(s=>m(s)).join("")):r!=null&&e.push(m(r))}return e.join("")}function R(t){let e=t.type;if(e&&e.__island)return xe(t,e);if(typeof e=="function"){let n=e(t.props||{},{slots:t.children||{}});return m(n)}if(typeof e=="object"&&e!==null){if(typeof e.render=="function"){let n=e.render(t.props||{},{slots:t.children||{},emit:()=>{}});return m(n)}if(typeof e.setup=="function"){let n=e.setup(t.props||{},{emit:()=>{},slots:t.children||{}});if(typeof n=="function"){let r=n();return m(r)}if(typeof e.render=="function"){let r=e.render(n||{},{slots:t.children||{},emit:()=>{}});return m(r)}}}return t.component&&t.component.subTree?m(t.component.subTree):"<!---->"}function xe(t,e){var N;let n=e.name||((N=t.props)==null?void 0:N["data-island-id"])||"anonymous",r=t.props||{},s=r["data-hydrate-when"]||e.__hydrateWhen||"",o=e.__islandTag||"div",i={};for(let g in r)g==="data-hydrate-when"||g==="data-island-id"||(i[g]=r[g]);let a=JSON.stringify(i),l=f(a),c="";if(typeof e.render=="function"){let g=e.render(r,{slots:t.children||{},emit:()=>{}});c=m(g)}else if(typeof e=="function"){let g=e(r,{slots:t.children||{}});c=m(g)}let y=s?` data-hydrate-when="${f(s)}"`:"",u=`<${o} data-hydrate="${f(n)}" data-props="${l}"${y}>${c}</${o}>`,d=`<script type="application/json" data-hydrate-props="${f(n)}">${a}<\/script>`;return u+d}async function*w(t){if(t==null)return;let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)"){if(Array.isArray(r))for(let s of r)yield*w(s);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield f(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*_e(e,n,r,t);return}if(typeof e=="object"||typeof e=="function"){yield R(t);return}}async function*_e(t,e,n,r){let s=z(e);if(X.has(t)){yield`<${t}${s} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let i=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${s}>${i}</${t}>`;return}yield`<${t}${s}>`;let o=r.shapeFlag||0;if(o&T.TEXT_CHILDREN)yield f(String(n||""));else if(o&T.ARRAY_CHILDREN&&Array.isArray(n))for(let i of n)yield*w(i);else if(o&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let i of n)yield*w(i);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}function Me(t){return m(t)}function Oe(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=S(t,n);return new ReadableStream({async pull(s){let{value:o,done:i}=await r.next();i?s.close():s.enqueue(o)},async cancel(){await r.return(void 0)}})}async function*Ie(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense";yield*S(t,n)}async function*S(t,e){if(t==null)return;let{type:n,props:r,children:s}=t;if(typeof n=="symbol"&&String(n)==="Symbol(Fragment)"){if(Array.isArray(s))for(let o of s)yield*S(o,e);return}if(typeof n=="symbol"&&String(n).includes("Text")){yield f(String(s||""));return}if(typeof n=="symbol"&&String(n).includes("Comment")){yield`<!--${String(s||"")}-->`;return}if(typeof n=="string"){yield*$e(n,r,s,t,e);return}if(typeof n=="object"&&n!==null){let o=n;if(o.name==="Suspense"||o._isSuspense){yield*ve(t,e);return}if(o._isAsyncComponent||o.__asyncSetup){yield*we(t,e);return}yield R(t);return}if(typeof n=="function"){yield R(t);return}}async function*$e(t,e,n,r,s){let o=z(e);if(X.has(t)){yield`<${t}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${o}>${a}</${t}>`;return}yield`<${t}${o}>`;let i=r.shapeFlag||0;if(i&T.TEXT_CHILDREN)yield f(String(n||""));else if(i&T.ARRAY_CHILDREN&&Array.isArray(n))for(let a of n)yield*S(a,s);else if(i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let a of n)yield*S(a,s);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}async function*ve(t,e){let n=`${e}-${Ce++}`,r=t.type,o=(t.props||{}).fallback,i="";o&&(typeof o=="object"&&o!==null?i=m(o):typeof o=="string"&&(i=o));let a=t.children,l=[];if(typeof a=="object"&&a!==null){if(Array.isArray(a))l=a;else if(typeof a.default=="function"){let u=a.default();Array.isArray(u)?l=u:u!=null&&(l=[u])}}let c=[];function y(u){for(let d of u){if(d==null)continue;let N=d.type;if(N&&(N._isAsyncComponent||N.__asyncSetup||d.__asyncSetup)){let g=d.__asyncPromise||N.__asyncPromise;g&&c.push(g.then(()=>{}))}}}if(y(l),c.length===0){for(let u of l)yield*S(u,e);return}yield`<!--${n}-fallback-->`,yield i,await Promise.all(c),yield`<!--${n}-resolved-->`;for(let u of l)yield*S(u,e);yield`<!--/${n}-->`}async function*we(t,e){let n=t.type,r=t.__asyncPromise||n.__asyncPromise;if(r)try{await r}catch(s){yield"<!--async-component-error-->";return}yield R(t)}var De=new v;var P={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},h=!1,K=[],p={success:!0,mismatches:0,hydratedNodes:0};function Pe(){return h}function je(t){h=t}function Fe(){return{...p}}function le(){p={success:!0,mismatches:0,hydratedNodes:0}}function ke(t){h?K.push(t):t()}function We(t,e,n={}){le(),n.onHydrated&&K.push(n.onHydrated),h=!0;try{let r=e.firstElementChild;return r?(t._vnode||t.mount(e),t._vnode&&V(r,t._vnode,n),h=!1,B(),p):(h=!1,t.mount(e),p.success=!1,B(),p)}catch(r){return h=!1,p.success=!1,e.innerHTML="",t.mount(e),B(),p}}function B(){let t=K.splice(0);for(let e of t)try{e()}catch(n){}}function V(t,e,n){if(Ke(e)){Xe(t,e,n);return}if(Je(e)){Ue(t,e,n);return}if(Ze(e)){Ye(t,e,n);return}if(Qe(e)){ze(t,e,n);return}if(typeof e.type=="string"){Ge(t,e,n);return}}function Ge(t,e,n){let r=t.tagName.toLowerCase(),s=e.type.toLowerCase();if(r!==s){j(t,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${s}"`,n);return}e.el=t,e.props&&J(t,e.props),e.ref&&Be(t,e.ref),qe(t,e,n),p.hydratedNodes++}function Ue(t,e,n){if(t.nodeType!==3){j(t,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s,n.strict),p.hydratedNodes++}function Ye(t,e,n){if(t.nodeType!==8){j(t,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s),p.hydratedNodes++}function Xe(t,e,n){if(!Array.isArray(e.children))return;let r=Array.from(t.childNodes);for(let s=0;s<e.children.length;s++){let o=e.children[s],i=r[s];if(!i){p.mismatches++;break}V(i,o,n)}}function ze(t,e,n){if(e.component&&e.component.subTree){V(t,e.component.subTree,n),e.el=e.component.subTree.el;return}let r=e.type;if(typeof r=="function")try{let s=r(e.props||{},{slots:e.children||{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let s=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}j(t,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",n)}function qe(t,e,n){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&P.TEXT_CHILDREN){let s=t.textContent||"",o=String(e.children||"");s!==o&&(t.textContent=o,n.strict);return}if(Array.isArray(e.children)){let s=Array.from(t.childNodes),o=0;for(let i=0;i<s.length&&o<e.children.length;i++){let a=e.children[o];if(a==null){o++;continue}V(s[i],a,n),o++}o<e.children.length&&p.mismatches++}r&P.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function J(t,e){for(let n in e){let r=e[n];if(n.startsWith("on")&&typeof r=="function"){let s=n.slice(2).toLowerCase();t.addEventListener(s,r)}}}function Be(t,e){typeof e=="function"?e(t):e&&typeof e=="object"&&(e.current=t)}function Ke(t){return typeof t.type=="symbol"&&String(t.type)==="Symbol(Fragment)"}function Je(t){return typeof t.type=="symbol"&&String(t.type).includes("Text")}function Ze(t){return typeof t.type=="symbol"&&String(t.type).includes("Comment")}function Qe(t){return!!((t.shapeFlag||0)&(P.STATEFUL_COMPONENT|P.FUNCTIONAL_COMPONENT)||typeof t.type=="object"&&t.type!==null||typeof t.type=="function")}function j(t,e,n,r){let s=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${n}`;if(p.mismatches++,r.strict)throw new Error(s)}var b=new Map,A=new Map,et={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tt=/[&<>"']/g;function E(t){return t.replace(tt,e=>et[e])}function ce(t,e,n={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let s=r.querySelector(t);if(!s)return{success:!1,mismatches:0,hydratedNodes:0};let o=s.getAttribute("data-hydrate");if(!o)return{success:!1,mismatches:0,hydratedNodes:0};if(s.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let i=nt(o,r);if(i===null)return{success:!1,mismatches:0,hydratedNodes:0};let a=s.getAttribute("data-hydrate-when");return a||n.lazy?rt(s,o,e,i,a||"visible",n):L(s,o,e,i,n)}function nt(t,e){let n=e.querySelector(`script[type="application/json"][data-hydrate-props="${t}"]`);if(!n){let r=e.querySelector(`[data-hydrate="${t}"]`);if(r){let s=r.getAttribute("data-props");if(s)try{return JSON.parse(s)}catch(o){return null}}return{}}try{return JSON.parse(n.textContent||"{}")}catch(r){return null}}function L(t,e,n,r,s){let o={success:!0,mismatches:0,hydratedNodes:0};try{h=!0;let i=null;if(typeof n.render=="function")i=n.render(r,{slots:n.slots||{},emit:()=>{}});else if(typeof n.setup=="function"){let l=n.setup(r,{emit:()=>{},slots:n.slots||{}});typeof l=="function"&&(i=l())}if(!i)return h=!1,o.success=!1,o;if(s.dev!==!1){let l=yt(t,i,e);o.mismatches=l}V(t,i,s),o.hydratedNodes=p.hydratedNodes,i.props&&J(t,i.props),D(t,i),t.setAttribute("data-hydrated","");let a={id:e,hydrated:!0,instance:n,eventListeners:[],timeoutId:null,observer:null,interactionHandler:null};return b.set(e,a),A.set(e,n),h=!1,s.onHydrated&&s.onHydrated(),o}catch(i){return h=!1,o.success=!1,o}}function D(t,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let n=Array.from(t.children),r=0;for(let s=0;s<n.length&&r<e.children.length;s++){let o=e.children[r];if(o==null){r++;continue}if(typeof o.type=="string"&&o.props)J(n[s],o.props),D(n[s],o);else if(typeof o.type=="object"||typeof o.type=="function"){let i=o.type;if(typeof i=="function")try{let a=i(o.props||{},{slots:o.children||{}});a&&n[s]&&D(n[s],a)}catch(a){}else if(i&&typeof i.render=="function")try{let a=i.render(o.props||{},{slots:o.children||{},emit:()=>{}});a&&n[s]&&D(n[s],a)}catch(a){}}r++}}}function rt(t,e,n,r,s,o){let i={success:!0,mismatches:0,hydratedNodes:0},a=null;o.timeout&&o.timeout>0&&(a=setTimeout(()=>{de(t,e),L(t,e,n,r,o)},o.timeout));let l={id:e,hydrated:!1,instance:n,eventListeners:[],timeoutId:a,observer:null,interactionHandler:null};switch(b.set(e,l),A.set(e,n),s){case"visible":{if(typeof IntersectionObserver!="undefined"){let c=new IntersectionObserver(y=>{for(let u of y)u.isIntersecting&&(c.unobserve(u.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,L(t,e,n,r,o))},{rootMargin:"200px"});c.observe(t),l.observer=c}else a&&clearTimeout(a),L(t,e,n,r,o);break}case"idle":{(y=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(y,{timeout:o.timeout||2e3}):setTimeout(y,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,t.hasAttribute("data-hydrated")||L(t,e,n,r,o)});break}case"interaction":{let c=()=>{a&&clearTimeout(a),l.timeoutId=null,l.interactionHandler=null,document.removeEventListener("click",c),document.removeEventListener("keydown",c),document.removeEventListener("scroll",c),document.removeEventListener("touchstart",c),t.hasAttribute("data-hydrated")||L(t,e,n,r,o)};document.addEventListener("click",c,{once:!1,passive:!0}),document.addEventListener("keydown",c,{once:!1,passive:!0}),document.addEventListener("scroll",c,{once:!1,passive:!0}),document.addEventListener("touchstart",c,{once:!1,passive:!0}),l.interactionHandler=c;break}default:a&&clearTimeout(a),L(t,e,n,r,o)}return i}function de(t,e){let n=b.get(e);n&&(n.observer&&(n.observer.disconnect(),n.observer=null),n.timeoutId!==null&&(clearTimeout(n.timeoutId),n.timeoutId=null),n.interactionHandler&&(document.removeEventListener("click",n.interactionHandler),document.removeEventListener("keydown",n.interactionHandler),document.removeEventListener("scroll",n.interactionHandler),document.removeEventListener("touchstart",n.interactionHandler),n.interactionHandler=null))}function st(t={}){let e=typeof document!="undefined"?document:null;if(!e)return{success:!1,mismatches:0,hydratedNodes:0};let n=e.querySelectorAll("[data-hydrate]:not([data-hydrated])"),r={success:!0,mismatches:0,hydratedNodes:0};return n.forEach(s=>{let o=s.getAttribute("data-hydrate"),i=A.get(o);if(!i){r.success=!1;return}let a=ce(`[data-hydrate="${o}"]`,i,t);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function ot(t,e){A.set(t,e)}function it(t){if(!b.get(t))return;let n=typeof document!="undefined"?document.querySelector(`[data-hydrate="${t}"]`):null;n&&(de(n,t),n.removeAttribute("data-hydrated")),b.delete(t),A.delete(t)}function at(){return b}function lt(){b.clear(),A.clear()}function ct(t,e={},n="div",r){let s=t.name||"anonymous",o=JSON.stringify(e),i=E(o),a="";if(typeof t.render=="function"){let u=t.render(e,{slots:t.slots||{},emit:()=>{}});a=H(u)}let l=r?` data-hydrate-when="${r}"`:"",c=`<${n} data-hydrate="${s}" data-props="${i}"${l}>${a}</${n}>`,y=`<script type="application/json" data-hydrate-props="${s}">${o}<\/script>`;return c+y}function H(t){if(t==null)return"";let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)")return Array.isArray(r)?r.map(s=>H(s)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return E(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${String(r||"")}-->`;if(typeof e=="string"){let s=dt(n);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${s} />`;let i="";return typeof r=="string"?i=E(r):Array.isArray(r)?i=r.map(a=>H(a)).join(""):typeof r=="number"&&(i=E(String(r))),`<${e}${s}>${i}</${e}>`}if(typeof e=="function"){let s=e(n||{},{slots:r||{}});return H(s)}if(typeof e=="object"&&e!==null){let s=e;if(typeof s.render=="function"){let o=s.render(n||{},{slots:r||{},emit:()=>{}});return H(o)}}return""}function dt(t){if(!t)return"";let e=[];for(let n in t){let r=t[n];if(!(n.startsWith("on")||n.startsWith("@")||n==="key"||n==="ref")&&!(n==="__vccOpts"||n.startsWith("__"))&&!(n==="dangerouslySetInnerHTML"||n==="innerHTML"))if(r===!0)e.push(n);else{if(r===!1||r===null||r===void 0)continue;n==="class"&&typeof r=="string"?e.push(`class="${E(r)}"`):n==="style"&&typeof r=="string"?e.push(`style="${E(r)}"`):e.push(`${n}="${E(String(r))}"`)}}return e.length>0?" "+e.join(" "):""}var Z=[];function yt(t,e,n){let r=0,s=ut(t),o=H(e);if(s!==o){r++;let i={islandId:n,expected:o,actual:s,suggestion:ft(s,o,n)};Z.push(i)}return r}function ut(t){let e=t.cloneNode(!0);return e.removeAttribute("data-hydrate"),e.removeAttribute("data-props"),e.removeAttribute("data-hydrate-when"),e.removeAttribute("data-hydrated"),e.innerHTML}function ft(t,e,n){if(t.trim()==="")return`\u670D\u52A1\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684\u670D\u52A1\u7AEF\u6E32\u67D3\u903B\u8F91`;if(e.trim()==="")return`\u5BA2\u6237\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684 render \u51FD\u6570`;let r=/\d{10,13}/;return r.test(t)||r.test(e)?"\u68C0\u6D4B\u5230\u65F6\u95F4\u6233\u5DEE\u5F02\uFF0C\u8003\u8651\u4F7F\u7528\u7EDF\u4E00\u7684\u65F6\u95F4\u6E90\u6216\u5EF6\u8FDF\u6CE8\u6C34":ae(t)===ae(e)?"HTML \u5185\u5BB9\u76F8\u540C\u4F46\u5C5E\u6027\u987A\u5E8F\u4E0D\u540C\uFF0C\u8FD9\u4E0D\u5F71\u54CD\u529F\u80FD\u4F46\u53EF\u80FD\u5BFC\u81F4 mismatch \u8B66\u544A":`\u8BF7\u786E\u4FDD\u7EC4\u4EF6 "${n}" \u5728\u670D\u52A1\u7AEF\u548C\u5BA2\u6237\u7AEF\u6E32\u67D3\u76F8\u540C\u7684\u8F93\u51FA`}function ae(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function mt(){return[...Z]}function pt(){Z.length=0}export{te as Comment,Q as Fragment,F as PatchFlags,x as ShapeFlags,v as StringRenderer,ee as Text,lt as clearIslandRegistry,pt as clearMismatchWarnings,ct as createHydrationIsland,Ve as createRenderer,Fe as getHydrateStats,at as getIslandRegistry,mt as getMismatchWarnings,We as hydrate,st as hydrateAllIslands,ce as hydrateIsland,Pe as isHydrating,ke as onHydrated,ot as registerIslandComponent,Oe as renderToStream,Ie as renderToStreamGenerator,Me as renderToString,le as resetHydrateStats,je as setHydrating,De as ssrRenderer,it as unmountIsland};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Lyt.js DOM 渲染器 — 独立入口
3
+ *
4
+ * 仅包含浏览器 DOM 渲染相关的 API,适用于 Web 端按需引入。
5
+ * 使用者可通过 `import '@lytjs/renderer/dom'` 仅加载 DOM 渲染器,
6
+ * 避免引入 SSR / Native / MiniApp / Vapor 等平台代码。
7
+ */
8
+ export type { LytRenderer, RendererInstance } from '../renderer-interfaces';
9
+ export type { VNode } from '../vnode';
10
+ export { createRenderer, } from '../create-renderer';
11
+ export { Fragment, Text, Comment, ShapeFlags, PatchFlags, } from '../vnode';
12
+ export { DOMRenderer, domRenderer } from './dom-renderer';
13
+ export { setDOMProp, removeDOMProp, patchDOMProps, isSVGElement, getSVGPropName, } from './dom-ops';
14
+ export { patchClass, patchStyle, patchEventOnElement, patchDOMProp, patchProp, patchAllProps, patchElementProps, PatchFlags as PatchPropFlags, } from './patch-props';
15
+ export { normalizeEventName, getEventKey, parseEventModifier, createInvoker, getEventInvokers, patchEvent, removeAllEventListeners, } from './patch-events';
16
+ export type { ParsedEvent, EventInvoker } from './patch-events';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dom/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAGrC,OAAO,EACL,cAAc,GACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,UAAU,CAAA;AAGjB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAGzD,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,WAAW,CAAA;AAGlB,OAAO,EACL,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,UAAU,IAAI,cAAc,GAC7B,MAAM,eAAe,CAAA;AAGtB,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,uBAAuB,GACxB,MAAM,gBAAgB,CAAA;AACvB,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA"}
@@ -1,7 +1,12 @@
1
1
  /**
2
- * Lyt.js 渲染器 — 统一导出入口
2
+ * Lyt.js 渲染器 — 统一导出入口(仅 DOM)
3
3
  *
4
- * 将所有模块的公共 API 统一导出,使用者只需从此文件导入即可。
4
+ * 主入口仅导出浏览器 DOM 渲染相关的 API,适用于大多数 Web 端场景。
5
+ * 其他平台(SSR/Native/MiniApp/Vapor)通过子路径独立引入:
6
+ * - `@lytjs/renderer/ssr` — 服务端渲染
7
+ * - `@lytjs/renderer/native` — 移动端原生渲染
8
+ * - `@lytjs/renderer/miniapp`— 小程序渲染
9
+ * - `@lytjs/renderer/vapor` — Vapor Mode(无虚拟 DOM)
5
10
  *
6
11
  * 使用示例:
7
12
  * ```ts
@@ -28,21 +33,4 @@ export { setDOMProp, removeDOMProp, patchDOMProps, isSVGElement, getSVGPropName,
28
33
  export { patchClass, patchStyle, patchEventOnElement, patchDOMProp, patchProp, patchAllProps, patchElementProps, PatchFlags as PatchPropFlags, } from './dom/patch-props';
29
34
  export { normalizeEventName, getEventKey, parseEventModifier, createInvoker, getEventInvokers, patchEvent, removeAllEventListeners, } from './dom/patch-events';
30
35
  export type { ParsedEvent, EventInvoker } from './dom/patch-events';
31
- export { StringRenderer, ssrRenderer, renderToString, renderToStream, renderToStreamGenerator } from './ssr/ssr-renderer';
32
- export type { SSRVNode, SSRTextVNode, ComponentOptions, RenderToStreamOptions } from './ssr/ssr-renderer';
33
- export { hydrate, isHydrating, setHydrating, onHydrated, getHydrateStats, resetHydrateStats, } from './ssr/hydration';
34
- export type { HydrateOptions, HydrateResult } from './ssr/hydration';
35
- export { hydrateIsland, hydrateAllIslands, createHydrationIsland, registerIslandComponent, unmountIsland, getIslandRegistry, clearIslandRegistry, getMismatchWarnings, clearMismatchWarnings, } from './ssr/hydration';
36
- export type { ComponentOptions as IslandComponentOptions } from './ssr/hydration';
37
- export { NativeRenderer, nativeRenderer } from './native/native-renderer';
38
- export type { NativeNode } from './native/native-renderer';
39
- export { MiniAppRenderer, miniAppRenderer } from './miniapp/miniapp-renderer';
40
- export type { MiniAppNode } from './miniapp/miniapp-renderer';
41
- export { createVaporElement, renderVaporNode, vaporPatch, vaporMount, setVaporDOMFactory, getVaporDOMFactory, } from './vapor/vapor-renderer';
42
- export type { VaporNode, VaporBinding, VaporBindingType, VaporContainer, VaporComponentOptions, VaporApp, VaporElement, BindingCleanup, } from './vapor/vapor-renderer';
43
- export { bindText, bindProp, bindAttr, bindClass, bindEvent, bindIf, bindEach, } from './vapor/vapor-reactive';
44
- export { compileToVapor, parseTemplate, } from './vapor/vapor-compiler';
45
- export type { VaporRenderFunction, VaporCompileResult } from './vapor/vapor-compiler';
46
- export { defineVaporComponent, createVaporApp, renderVaporComponent, } from './vapor/vapor-component';
47
- export type { VaporComponentInstance } from './vapor/vapor-component';
48
36
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC1E,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAGpC,OAAO,EACL,cAAc,GACf,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAG7D,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,eAAe,CAAA;AAGtB,OAAO,EACL,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,UAAU,IAAI,cAAc,GAC7B,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,uBAAuB,GACxB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGnE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AACzH,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AACzG,OAAO,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,iBAAiB,GAClB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAGpE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,gBAAgB,IAAI,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAGjF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAG1D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC7E,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAG7D,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EACV,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,QAAQ,EACR,YAAY,EACZ,cAAc,GACf,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EACL,cAAc,EACd,aAAa,GACd,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAErF,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,oBAAoB,GACrB,MAAM,yBAAyB,CAAA;AAChC,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC1E,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAGpC,OAAO,EACL,cAAc,GACf,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAG7D,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,eAAe,CAAA;AAGtB,OAAO,EACL,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,UAAU,IAAI,cAAc,GAC7B,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,uBAAuB,GACxB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,6 +1,13 @@
1
1
  /**
2
- * 小程序渲染器统一导出
2
+ * Lyt.js MiniApp 渲染器 独立入口
3
+ *
4
+ * 仅包含小程序渲染相关的 API。
5
+ * 使用者可通过 `import '@lytjs/renderer/miniapp'` 仅加载 MiniApp 渲染器。
3
6
  */
4
- export { MiniAppRenderer, miniAppRenderer, createMiniAppRenderer } from './miniapp-renderer';
5
- export type { MiniAppNode, MiniAppPlatform } from './miniapp-renderer';
7
+ export type { LytRenderer, RendererInstance } from '../renderer-interfaces';
8
+ export type { VNode } from '../vnode';
9
+ export { createRenderer, } from '../create-renderer';
10
+ export { Fragment, Text, Comment, ShapeFlags, PatchFlags, } from '../vnode';
11
+ export { MiniAppRenderer, miniAppRenderer } from './miniapp-renderer';
12
+ export type { MiniAppNode } from './miniapp-renderer';
6
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/miniapp/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC5F,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/miniapp/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAGrC,OAAO,EACL,cAAc,GACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,UAAU,CAAA;AAGjB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACrE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,6 +1,13 @@
1
1
  /**
2
- * 移动端渲染器统一导出
2
+ * Lyt.js Native 渲染器 独立入口
3
+ *
4
+ * 仅包含移动端原生渲染相关的 API。
5
+ * 使用者可通过 `import '@lytjs/renderer/native'` 仅加载 Native 渲染器。
3
6
  */
4
- export { NativeRenderer, nativeRenderer, createNativeRenderer } from './native-renderer';
5
- export type { NativeNode, LytRendererPlatform } from './native-renderer';
7
+ export type { LytRenderer, RendererInstance } from '../renderer-interfaces';
8
+ export type { VNode } from '../vnode';
9
+ export { createRenderer, } from '../create-renderer';
10
+ export { Fragment, Text, Comment, ShapeFlags, PatchFlags, } from '../vnode';
11
+ export { NativeRenderer, nativeRenderer } from './native-renderer';
12
+ export type { NativeNode } from './native-renderer';
6
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/native/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxF,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/native/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAGrC,OAAO,EACL,cAAc,GACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,UAAU,CAAA;AAGjB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Lyt.js SSR 渲染器 — 独立入口
3
+ *
4
+ * 仅包含服务端渲染(SSR)相关的 API。
5
+ * 使用者可通过 `import '@lytjs/renderer/ssr'` 仅加载 SSR 渲染器。
6
+ */
7
+ export type { LytRenderer, RendererInstance } from '../renderer-interfaces';
8
+ export type { VNode } from '../vnode';
9
+ export { createRenderer, } from '../create-renderer';
10
+ export { Fragment, Text, Comment, ShapeFlags, PatchFlags, } from '../vnode';
11
+ export { StringRenderer, ssrRenderer, renderToString, renderToStream, renderToStreamGenerator } from './ssr-renderer';
12
+ export type { SSRVNode, SSRTextVNode, ComponentOptions, RenderToStreamOptions } from './ssr-renderer';
13
+ export { hydrate, isHydrating, setHydrating, onHydrated, getHydrateStats, resetHydrateStats, hydrateIsland, hydrateAllIslands, createHydrationIsland, registerIslandComponent, unmountIsland, getIslandRegistry, clearIslandRegistry, getMismatchWarnings, clearMismatchWarnings, } from './hydration';
14
+ export type { HydrateOptions, HydrateResult, ComponentOptions as IslandComponentOptions } from './hydration';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ssr/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAGrC,OAAO,EACL,cAAc,GACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,UAAU,CAAA;AAGjB,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AACrH,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAGrG,OAAO,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Lyt.js Vapor Mode — 独立入口
3
+ *
4
+ * 仅包含 Vapor Mode 相关的 API(无虚拟 DOM,直接操作真实 DOM)。
5
+ * 使用者可通过 `import '@lytjs/renderer/vapor'` 仅加载 Vapor 渲染器。
6
+ */
7
+ export type { LytRenderer, RendererInstance } from '../renderer-interfaces';
8
+ export type { VNode } from '../vnode';
9
+ export { createRenderer, } from '../create-renderer';
10
+ export { Fragment, Text, Comment, ShapeFlags, PatchFlags, } from '../vnode';
11
+ export { createVaporElement, renderVaporNode, vaporPatch, vaporMount, setVaporDOMFactory, getVaporDOMFactory, } from './vapor-renderer';
12
+ export type { VaporNode, VaporBinding, VaporBindingType, VaporContainer, VaporComponentOptions, VaporApp, VaporElement, BindingCleanup, } from './vapor-renderer';
13
+ export { bindText, bindProp, bindAttr, bindClass, bindEvent, bindIf, bindEach, } from './vapor-reactive';
14
+ export { compileToVapor, parseTemplate, } from './vapor-compiler';
15
+ export type { VaporRenderFunction, VaporCompileResult } from './vapor-compiler';
16
+ export { defineVaporComponent, createVaporApp, renderVaporComponent, } from './vapor-component';
17
+ export type { VaporComponentInstance } from './vapor-component';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vapor/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAGrC,OAAO,EACL,cAAc,GACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,UAAU,GACX,MAAM,UAAU,CAAA;AAGjB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACV,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,QAAQ,EACR,YAAY,EACZ,cAAc,GACf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,cAAc,EACd,aAAa,GACd,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE/E,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,oBAAoB,GACrB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA"}
package/dist/vapor.cjs ADDED
@@ -0,0 +1 @@
1
+ var j=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ce=Object.prototype.hasOwnProperty;var de=(e,i)=>{for(var t in i)j(e,t,{get:i[t],enumerable:!0})},fe=(e,i,t,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of pe(i))!ce.call(e,o)&&o!==t&&j(e,o,{get:()=>i[o],enumerable:!(n=le(i,o))||n.enumerable});return e};var ye=e=>fe(j({},"__esModule",{value:!0}),e);var Re={};de(Re,{Comment:()=>k,Fragment:()=>P,PatchFlags:()=>E,ShapeFlags:()=>h,Text:()=>U,bindAttr:()=>M,bindClass:()=>_,bindEach:()=>X,bindEvent:()=>D,bindIf:()=>z,bindProp:()=>v,bindText:()=>O,compileToVapor:()=>w,createRenderer:()=>ne,createVaporApp:()=>se,createVaporElement:()=>Z,defineVaporComponent:()=>ie,getVaporDOMFactory:()=>N,parseTemplate:()=>F,renderVaporComponent:()=>ae,renderVaporNode:()=>u,setVaporDOMFactory:()=>re,vaporMount:()=>B,vaporPatch:()=>G});module.exports=ye(Re);var te=require("@lytjs/vdom");var h=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(h||{}),E=(p=>(p[p.TEXT=1]="TEXT",p[p.CLASS=2]="CLASS",p[p.STYLE=4]="STYLE",p[p.PROPS=8]="PROPS",p[p.FULL_PROPS=16]="FULL_PROPS",p[p.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",p[p.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",p[p.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",p[p.NEED_PATCH=256]="NEED_PATCH",p[p.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",p[p.HOISTED=-1]="HOISTED",p[p.BAIL=-2]="BAIL",p))(E||{}),P=Symbol("Fragment"),U=Symbol("Text"),k=Symbol("Comment");function V(e){return e.type===P}function b(e){return e.type===U}function T(e){return e.type===k}function q(e,i){return e.type===i.type&&e.key===i.key}function H(e){return Array.isArray(e.dynamicChildren)}function J(e,i,t,n){if(t==="class")e.setClass(i,n);else if(t==="style")e.setStyle(i,n);else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();e.addEventListener(i,o,n)}else t==="key"||t==="ref"||e.setAttribute(i,t,n)}function W(e,i,t,n,o){if(t==="class")e.setClass(i,n);else if(t==="style")e.setStyle(i,n||{});else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();o&&e.removeEventListener(i,r,o),n&&e.addEventListener(i,r,n)}else e.setAttribute(i,t,n)}function K(e,i,t,n){for(let o in n){if(o==="key"||o==="ref")continue;let r=t[o],s=n[o];s!==r&&W(e,i,o,s,r)}for(let o in t)if(!(o==="key"||o==="ref")&&!(o in n))if(o==="class")e.setClass(i,"");else if(o==="style")e.setStyle(i,{});else if(o.startsWith("on")||o.startsWith("@")){let r=o.startsWith("@")?o.slice(1).toLowerCase():o.slice(2).toLowerCase();e.removeEventListener(i,r,t[o])}else e.removeAttribute(i,o)}function Y(e,i,t,n,o,r){let{shapeFlag:s}=t;if(V(t)){me(e,i,t,n,o,r);return}if(b(t)){let a=e.createText(t.children);t.el=a,e.insert(n,a,o);return}if(T(t)){let a=e.createComment(t.children);t.el=a,e.insert(n,a,o);return}if(s&1){ue(e,i,t,n,o,r);return}if(s&6){ge(i,t,n,o,r);return}}function ue(e,i,t,n,o,r){let s=t.type,a=e.createElement(s);if(t.el=a,t.props)for(let c in t.props){let d=t.props[c];J(e,a,c,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&A(i,f,a,null,r),e.insert(n,a,o)}function A(e,i,t,n,o){for(let r=0;r<i.length;r++)e(null,i[r],t,n,o)}function me(e,i,t,n,o,r){let{children:s}=t,a=e.createComment("");e.insert(n,a,o),Array.isArray(s)&&s.length>0&&A(i,s,n,a,r),t.el=a,t.anchor=a}function ge(e,i,t,n,o){let r=i.component;r&&r.update&&r.update(),r&&r.subTree&&(e(null,r.subTree,t,n,r),i.el=r.subTree.el)}function Q(e,i,t,n){let{shapeFlag:o,children:r}=t;if(V(t)){if(Array.isArray(r))for(let s=0;s<r.length;s++)i(r[s],n);t.anchor&&t.anchor.parentNode&&e.remove(t.anchor);return}if(o&6){t.component&&t.component.subTree&&i(t.component.subTree,n);return}t.el&&e.remove(t.el)}function R(e,i){for(let t=0;t<i.length;t++)e(i[t])}var L=require("@lytjs/vdom");function S(e,i,t,n,o,r=null,s=null){if(n==null){t&&i(t,o);return}if(t===null){Y(e,$(e,i),n,o,r,s);return}if(H(n)&&H(t)){ve(e,i,t,n,o,s);return}if(!q(t,n)){i(t,o),Y(e,$(e,i),n,o,r,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(V(n)){Ne(e,i,t,n,o,r,s);return}if(b(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(T(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){he(e,i,t,n,s);return}if(a&6){xe(t,n,s);return}}function $(e,i){return(t,n,o,r,s)=>{S(e,i,t,n,o,r,s)}}function he(e,i,t,n,o=null){let r=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:l,dynamicProps:f}=n;if(l&&l>0){if(l&1&&t.children!==n.children&&(r.textContent=n.children),l&2&&s.class!==a.class&&e.setClass(r,a.class),l&4&&s.style!==a.style&&e.setStyle(r,a.style||{}),l&8&&f)for(let c=0;c<f.length;c++){let d=f[c],p=s[d],y=a[d];y!==p&&W(e,r,d,y,p)}l&16&&K(e,r,s,a)}else K(e,r,s,a);(!l||!(l&1))&&ee(e,i,t,n,r,null,o)}function ee(e,i,t,n,o,r,s){let a=t.shapeFlag,l=n.shapeFlag,f=t.children,c=n.children;if(l&8){a&16&&R(i,f),f!==c&&(o.textContent=c);return}if(l&16){a&16?Ve(e,i,f,c,o,r,s):(a&8&&(o.textContent=""),A($(e,i),c,o,r,s));return}c==null&&(a&8?o.textContent="":a&16&&R(i,f))}function Ve(e,i,t,n,o,r,s){n.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?(0,L.patchKeyedChildren)(t,n,o,r,s,null,!1):(0,L.patchUnkeyedChildren)(t,n,o,r,s,null,!1)}function Ne(e,i,t,n,o,r,s){let a=t.children,l=n.children;Array.isArray(l)&&l.length>0?(ee(e,i,t,n,o,r,s),n.el=l[0].el,n.anchor=l[l.length-1].el?e.nextSibling(l[l.length-1].el):r):Array.isArray(a)&&a.length>0&&l===null?(R(i,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function ve(e,i,t,n,o,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let l=0;l<a.length;l++)S(e,i,s[l],a[l],o,null,r)}function xe(e,i,t){i.component=e.component,i.el=e.el,i.component&&i.component.update&&i.component.update()}function ne(e){function i(o,r){Q(e,i,o,r)}(0,te.registerDOMOperations)({insert(o,r,s){e.insert(r,o,s)},createElement(o){return e.createElement(o)},createText(o){return e.createText(o)},setText(o,r){o.nodeValue=r},setElementText(o,r){o.textContent=r},remove(o){e.remove(o)},createComment(o){return e.createComment(o)},mount(o,r,s,a,l,f,c){n(null,o,r,s,a)},patch(o,r,s,a,l,f,c,d){n(o,r,s,a,l)},unmount(o,r,s,a){i(o)},move(o,r,s){e.insert(r,o.el,s)}});function n(o,r,s,a,l){S(e,i,o,r,s,a,l)}return{mount(o,r){r.nodeType===1&&(r.textContent=""),n(null,o,r,null,null)},patch(o,r,s){var a;n(o,r,s||((a=o.el)==null?void 0:a.parentNode),null,null)},unmount(o,r){i(o,r)}}}var m=require("@lytjs/reactivity/signal");function O(e,i){return(0,m.effect)(()=>{let n=i();e.textContent=n==null?"":String(n)})}function v(e,i,t){return(0,m.effect)(()=>{let o=t();e[i]=o})}function M(e,i,t){return(0,m.effect)(()=>{let o=t();o==null||o===!1?e.removeAttribute(i):e.setAttribute(i,o===!0?"":String(o))})}function _(e,i){return(0,m.effect)(()=>{let n=i();if(typeof n=="string")e.className=n;else if(Array.isArray(n))e.className=n.filter(Boolean).join(" ");else if(typeof n=="object"&&n!==null){let o=[];for(let r of Object.keys(n))n[r]&&o.push(r);e.className=o.join(" ")}else e.className=""})}function D(e,i,t){return e.addEventListener(i,t),()=>{e.removeEventListener(i,t)}}function z(e,i){return(0,m.effect)(()=>{i()?(e.style=e.style||{},e.style.display==="none"&&(e.style.display=""),e.hidden=!1):(e.style=e.style||{},e.style.display="none",e.hidden=!0)})}function X(e,i,t,n){let o=[],r=[],s=new Map,a=(0,m.effect)(()=>{let l=i();if(!Array.isArray(l))return;let f=l.map((c,d)=>n?n(c,d):d);if(f.length===r.length){let c=!0;for(let d=0;d<f.length;d++)if(f[d]!==r[d]){c=!1;break}if(c){for(let d=0;d<l.length;d++){let p=t(l[d],d),y=o[d];y&&y.parentNode===e&&e.replaceChild(p,y),o[d]=p}return}}for(let c of o)c.parentNode===e&&e.removeChild(c);s.clear(),o=[],r=[];for(let c=0;c<l.length;c++){let d=t(l[c],c);e.appendChild(d),o.push(d),r.push(f[c]),s.set(f[c],d)}});return()=>{a();for(let l of o)l.parentNode===e&&e.removeChild(l);o=[],r=[],s.clear()}}var I=e=>{if(typeof document!="undefined")return document.createElement(e);throw new Error("[lyt:vapor] \u672A\u8BBE\u7F6E DOM \u5DE5\u5382\u51FD\u6570\u3002\u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\u8BF7\u8C03\u7528 setVaporDOMFactory()")};function re(e){I=e}function N(){return I}function Z(e,i,...t){let n={tag:e,children:[],props:{},events:{},bindings:[]};if(i)for(let[o,r]of Object.entries(i))if(o.startsWith("on")&&typeof r=="function"&&!oe(r)){let s=o.slice(2).toLowerCase();n.events[s]=r}else oe(r)?o==="textContent"||o==="text"?n.bindings.push({type:"text",target:"textContent",signal:r}):o==="className"||o==="class"?n.bindings.push({type:"class",target:"className",signal:r}):o==="style"?n.bindings.push({type:"style",target:"style",signal:r}):n.bindings.push({type:"prop",target:o,signal:r}):n.props[o]=r;for(let o of t)typeof o=="string"?n.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:o}):n.children.push(o);return n}function oe(e){return typeof e!="function"?!1:!!(e._subscribe||e.set)&&!e.toString().startsWith("class")}function u(e){if(e.tag==="#text"){let t=I("#text");return t.textContent=e.text||"",t.nodeType=3,t}let i=I(e.tag);e.el=i;for(let[t,n]of Object.entries(e.props))if(t==="style"&&typeof n=="object")for(let[o,r]of Object.entries(n))i.style[o]=r;else t==="className"||t==="class"?i.className=String(n):i[t]=n;for(let t of e.bindings)t.type==="text"?O(i,t.signal):t.type==="prop"?v(i,t.target,t.signal):t.type==="attr"?M(i,t.target,t.signal):t.type==="class"?_(i,t.signal):t.type==="style"&&v(i,"style",t.signal);for(let[t,n]of Object.entries(e.events))D(i,t,n);for(let t of e.children){let n=u(t);i.appendChild(n)}return i}function G(e,i,t){if(e.tag!==i.tag){let r=u(i);e.el&&e.el.parentNode===t&&t.removeChild(e.el),t.appendChild(r);return}let n=e.el||u(e);i.el=n;for(let[r,s]of Object.entries(i.props))if(r==="style"&&typeof s=="object")for(let[a,l]of Object.entries(s))n.style[a]=l;else r==="className"||r==="class"?n.className=String(s):n[r]=s;i.text!==void 0&&(n.textContent=i.text);for(let[r,s]of Object.entries(e.events))i.events[r]||n.removeEventListener(r,s);for(let[r,s]of Object.entries(i.events))e.events[r]!==s&&(e.events[r]&&n.removeEventListener(r,e.events[r]),n.addEventListener(r,s));let o=Math.max(e.children.length,i.children.length);for(let r=0;r<o;r++){let s=e.children[r],a=i.children[r];if(!s&&a){let l=u(a);n.appendChild(l)}else s&&!a?s.el&&s.el.parentNode===n&&n.removeChild(s.el):s&&a&&G(s,a,n)}}function B(e,i){let t=i.setup?i.setup():{};i.beforeMount&&i.beforeMount();let n;if(i.render){let r=i.render(t,Z);n=Array.isArray(r)?r:[r]}else n=[];let o=[];for(let r of n){let s=u(r);e.appendChild(s),o.push(s)}return i.mounted&&i.mounted(),()=>{i.beforeUnmount&&i.beforeUnmount();for(let r of o)e.removeChild(r);i.unmounted&&i.unmounted()}}function F(e){let i={type:"fragment",children:[]},t=e.trim();for(;t.length>0;){let n=t.match(/^<([a-zA-Z][a-zA-Z0-9-]*)([\s\S]*?)(\/?)>/);if(n){let o=n[1],r=n[2],s=n[3]==="/",{props:a,events:l,directives:f}=Ee(r),c={type:"element",tag:o,props:a,events:l,directives:f,children:[]};if(t=t.slice(n[0].length),s){i.children.push(c);continue}let d=`</${o}>`,p=Ce(t,o);if(p===-1)throw new Error(`[lyt:vapor:compiler] \u672A\u627E\u5230\u95ED\u5408\u6807\u7B7E: </${o}>`);let y=t.slice(0,p);t=t.slice(p+d.length);let g=F(y);c.children=g.children||[],i.children.push(c)}else{let o=t.indexOf("<"),r;if(o===-1?(r=t,t=""):(r=t.slice(0,o),t=t.slice(o)),r.trim())if(r.includes("{{")){let s=be(r);for(let a of s)a.type==="text"?i.children.push({type:"text",text:a.value}):i.children.push({type:"interpolation",expression:a.value})}else i.children.push({type:"text",text:r})}}return i}function Ce(e,i){let t=1,n=0,o=`<${i}`,r=`</${i}>`;for(;n<e.length&&t>0;){let s=e.indexOf(o,n),a=e.indexOf(r,n);if(a===-1)return-1;if(s!==-1&&s<a){let l=e[s+o.length];l===">"||l===" "||l==="/"?(t++,n=s+o.length):(n=a+r.length,t--)}else n=a+r.length,t--}return t===0?n-r.length:-1}function Ee(e){let i={},t={},n={},o=/([a-zA-Z@:][a-zA-Z0-9@:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,r;for(;(r=o.exec(e))!==null;){let s=r[1],a=r[2]||r[3];if(s.startsWith("on:")){let l=s.slice(3);t[l]=a}else if(s.startsWith(":")){let l=s.slice(1);i[l]=a}else if(s==="v-if")n.if=a;else if(s==="v-each"){let l=a.match(/^\s*(\w+)\s+in\s+(.+)\s*$/);l&&(n.each={item:l[1],expression:l[2]})}else i[s]=a}return{props:i,events:t,directives:n}}function be(e){let i=[],t=/\{\{([\s\S]*?)\}\}/g,n=0,o;for(;(o=t.exec(e))!==null;)o.index>n&&i.push({type:"text",value:e.slice(n,o.index)}),i.push({type:"interpolation",value:o[1].trim()}),n=o.index+o[0].length;return n<e.length&&i.push({type:"text",value:e.slice(n)}),i}function w(e){let i=F(e);return{render:Te(i),ast:i}}function Te(e){return function(t){let n=N();return C(e,t,n)}}function C(e,i,t){var n,o;if(e.type==="fragment"){if(e.children&&e.children.length===1)return C(e.children[0],i,t);let r=t("div");if(r.nodeType=11,e.children)for(let s of e.children){let a=C(s,i,t);r.appendChild(a)}return r}if(e.type==="text"){let r=t("#text");return r.textContent=e.text||"",r.nodeType=3,r}if(e.type==="interpolation"){let r=t("span"),s=e.expression||"",a=x(i,s);return r.textContent=a!=null?String(a):"",r}if(e.type==="element"){if((n=e.directives)!=null&&n.each){let{item:s,expression:a}=e.directives.each,l=x(i,a),f=t("#fragment");if(f.childNodes=[],f.nodeType=11,Array.isArray(l))for(let c=0;c<l.length;c++){let d={...i,[s]:l[c],index:c},p=t(e.tag);if(e.props)for(let[y,g]of Object.entries(e.props))y==="class"||y==="className"?p.className=g:p[y]=g;if(e.children)for(let y of e.children){let g=C(y,d,t);p.appendChild(g)}f.appendChild(p)}return f}let r=t(e.tag);if((o=e.directives)!=null&&o.if&&(x(i,e.directives.if)||(r.style=r.style||{},r.style.display="none",r.hidden=!0)),e.props)for(let[s,a]of Object.entries(e.props))if(s.startsWith(":")){let l=s.slice(1),f=x(i,a);r[l]=f}else s==="class"||s==="className"?r.className=a:r[s]=a;if(e.events)for(let[s,a]of Object.entries(e.events)){let l=x(i,a);typeof l=="function"&&r.addEventListener(s,l)}if(e.children)for(let s of e.children){let a=C(s,i,t);if(a.nodeType===11&&a.childNodes)for(let l of a.childNodes)r.appendChild(l);else r.appendChild(a)}return r}return t("div")}function x(e,i){let t=i.trim();if(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)){let r=e[t];return typeof r=="function"&&!r.prototype?r():r}let n=t.split("."),o=e;for(let r of n){if(o==null)return;o=o[r],typeof o=="function"&&!o.prototype&&n.indexOf(r)<n.length-1&&(o=o())}return o}function ie(e){return e}function se(e){let i=!1,t=null,n=null;return{mount(o){if(!i){if(typeof o=="string")if(typeof document!="undefined"){let r=document.querySelector(o);if(!r)throw new Error(`[lyt:vapor] \u672A\u627E\u5230\u6302\u8F7D\u76EE\u6807: ${o}`);n=r}else throw new Error("[lyt:vapor] \u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\uFF0C\u8BF7\u76F4\u63A5\u4F20\u5165\u5BB9\u5668\u5143\u7D20");else n=o;t=B(n,e),i=!0}},unmount(){i&&(t&&(t(),t=null),i=!1,n=null)}}}function ae(e){let i=e.setup?e.setup():{};e.beforeMount&&e.beforeMount();let t;if(e.template){let{render:n}=w(e.template);t=n(i)}else if(e.render){let n=e.render(i,Ae),o=Array.isArray(n)?n:[n];if(o.length===1)t=u(o[0]);else{t=N()("div");for(let s of o)t.appendChild(u(s))}}else throw new Error("[lyt:vapor] \u7EC4\u4EF6\u5FC5\u987B\u63D0\u4F9B template \u6216 render \u51FD\u6570");return e.mounted&&e.mounted(),t}function Ae(e,i,...t){let n={tag:e,children:[],props:i||{},events:{},bindings:[]};for(let o of t)typeof o=="string"?n.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:o}):n.children.push(o);return n}
package/dist/vapor.mjs ADDED
@@ -0,0 +1 @@
1
+ import{registerDOMOperations as ce}from"@lytjs/vdom";var V=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(V||{}),S=(p=>(p[p.TEXT=1]="TEXT",p[p.CLASS=2]="CLASS",p[p.STYLE=4]="STYLE",p[p.PROPS=8]="PROPS",p[p.FULL_PROPS=16]="FULL_PROPS",p[p.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",p[p.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",p[p.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",p[p.NEED_PATCH=256]="NEED_PATCH",p[p.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",p[p.HOISTED=-1]="HOISTED",p[p.BAIL=-2]="BAIL",p))(S||{}),H=Symbol("Fragment"),W=Symbol("Text"),K=Symbol("Comment");function g(e){return e.type===H}function C(e){return e.type===W}function E(e){return e.type===K}function Y(e,i){return e.type===i.type&&e.key===i.key}function O(e){return Array.isArray(e.dynamicChildren)}function $(e,i,t,n){if(t==="class")e.setClass(i,n);else if(t==="style")e.setStyle(i,n);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();e.addEventListener(i,r,n)}else t==="key"||t==="ref"||e.setAttribute(i,t,n)}function M(e,i,t,n,r){if(t==="class")e.setClass(i,n);else if(t==="style")e.setStyle(i,n||{});else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&e.removeEventListener(i,o,r),n&&e.addEventListener(i,o,n)}else e.setAttribute(i,t,n)}function _(e,i,t,n){for(let r in n){if(r==="key"||r==="ref")continue;let o=t[r],s=n[r];s!==o&&M(e,i,r,s,o)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in n))if(r==="class")e.setClass(i,"");else if(r==="style")e.setStyle(i,{});else if(r.startsWith("on")||r.startsWith("@")){let o=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();e.removeEventListener(i,o,t[r])}else e.removeAttribute(i,r)}function D(e,i,t,n,r,o){let{shapeFlag:s}=t;if(g(t)){te(e,i,t,n,r,o);return}if(C(t)){let a=e.createText(t.children);t.el=a,e.insert(n,a,r);return}if(E(t)){let a=e.createComment(t.children);t.el=a,e.insert(n,a,r);return}if(s&1){ee(e,i,t,n,r,o);return}if(s&6){ne(i,t,n,r,o);return}}function ee(e,i,t,n,r,o){let s=t.type,a=e.createElement(s);if(t.el=a,t.props)for(let c in t.props){let d=t.props[c];$(e,a,c,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&b(i,f,a,null,o),e.insert(n,a,r)}function b(e,i,t,n,r){for(let o=0;o<i.length;o++)e(null,i[o],t,n,r)}function te(e,i,t,n,r,o){let{children:s}=t,a=e.createComment("");e.insert(n,a,r),Array.isArray(s)&&s.length>0&&b(i,s,n,a,o),t.el=a,t.anchor=a}function ne(e,i,t,n,r){let o=i.component;o&&o.update&&o.update(),o&&o.subTree&&(e(null,o.subTree,t,n,o),i.el=o.subTree.el)}function z(e,i,t,n){let{shapeFlag:r,children:o}=t;if(g(t)){if(Array.isArray(o))for(let s=0;s<o.length;s++)i(o[s],n);t.anchor&&t.anchor.parentNode&&e.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&i(t.component.subTree,n);return}t.el&&e.remove(t.el)}function T(e,i){for(let t=0;t<i.length;t++)e(i[t])}import{patchKeyedChildren as oe,patchUnkeyedChildren as re}from"@lytjs/vdom";function A(e,i,t,n,r,o=null,s=null){if(n==null){t&&i(t,r);return}if(t===null){D(e,I(e,i),n,r,o,s);return}if(O(n)&&O(t)){le(e,i,t,n,r,s);return}if(!Y(t,n)){i(t,r),D(e,I(e,i),n,r,o,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(g(n)){ae(e,i,t,n,r,o,s);return}if(C(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(E(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){ie(e,i,t,n,s);return}if(a&6){pe(t,n,s);return}}function I(e,i){return(t,n,r,o,s)=>{A(e,i,t,n,r,o,s)}}function ie(e,i,t,n,r=null){let o=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:l,dynamicProps:f}=n;if(l&&l>0){if(l&1&&t.children!==n.children&&(o.textContent=n.children),l&2&&s.class!==a.class&&e.setClass(o,a.class),l&4&&s.style!==a.style&&e.setStyle(o,a.style||{}),l&8&&f)for(let c=0;c<f.length;c++){let d=f[c],p=s[d],y=a[d];y!==p&&M(e,o,d,y,p)}l&16&&_(e,o,s,a)}else _(e,o,s,a);(!l||!(l&1))&&X(e,i,t,n,o,null,r)}function X(e,i,t,n,r,o,s){let a=t.shapeFlag,l=n.shapeFlag,f=t.children,c=n.children;if(l&8){a&16&&T(i,f),f!==c&&(r.textContent=c);return}if(l&16){a&16?se(e,i,f,c,r,o,s):(a&8&&(r.textContent=""),b(I(e,i),c,r,o,s));return}c==null&&(a&8?r.textContent="":a&16&&T(i,f))}function se(e,i,t,n,r,o,s){n.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?oe(t,n,r,o,s,null,!1):re(t,n,r,o,s,null,!1)}function ae(e,i,t,n,r,o,s){let a=t.children,l=n.children;Array.isArray(l)&&l.length>0?(X(e,i,t,n,r,o,s),n.el=l[0].el,n.anchor=l[l.length-1].el?e.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(T(i,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function le(e,i,t,n,r,o){let s=t.dynamicChildren,a=n.dynamicChildren;for(let l=0;l<a.length;l++)A(e,i,s[l],a[l],r,null,o)}function pe(e,i,t){i.component=e.component,i.el=e.el,i.component&&i.component.update&&i.component.update()}function de(e){function i(r,o){z(e,i,r,o)}ce({insert(r,o,s){e.insert(o,r,s)},createElement(r){return e.createElement(r)},createText(r){return e.createText(r)},setText(r,o){r.nodeValue=o},setElementText(r,o){r.textContent=o},remove(r){e.remove(r)},createComment(r){return e.createComment(r)},mount(r,o,s,a,l,f,c){n(null,r,o,s,a)},patch(r,o,s,a,l,f,c,d){n(r,o,s,a,l)},unmount(r,o,s,a){i(r)},move(r,o,s){e.insert(o,r.el,s)}});function n(r,o,s,a,l){A(e,i,r,o,s,a,l)}return{mount(r,o){o.nodeType===1&&(o.textContent=""),n(null,r,o,null,null)},patch(r,o,s){var a;n(r,o,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,o){i(r,o)}}}import{effect as h}from"@lytjs/reactivity/signal";function B(e,i){return h(()=>{let n=i();e.textContent=n==null?"":String(n)})}function R(e,i,t){return h(()=>{let r=t();e[i]=r})}function F(e,i,t){return h(()=>{let r=t();r==null||r===!1?e.removeAttribute(i):e.setAttribute(i,r===!0?"":String(r))})}function w(e,i){return h(()=>{let n=i();if(typeof n=="string")e.className=n;else if(Array.isArray(n))e.className=n.filter(Boolean).join(" ");else if(typeof n=="object"&&n!==null){let r=[];for(let o of Object.keys(n))n[o]&&r.push(o);e.className=r.join(" ")}else e.className=""})}function j(e,i,t){return e.addEventListener(i,t),()=>{e.removeEventListener(i,t)}}function Z(e,i){return h(()=>{i()?(e.style=e.style||{},e.style.display==="none"&&(e.style.display=""),e.hidden=!1):(e.style=e.style||{},e.style.display="none",e.hidden=!0)})}function G(e,i,t,n){let r=[],o=[],s=new Map,a=h(()=>{let l=i();if(!Array.isArray(l))return;let f=l.map((c,d)=>n?n(c,d):d);if(f.length===o.length){let c=!0;for(let d=0;d<f.length;d++)if(f[d]!==o[d]){c=!1;break}if(c){for(let d=0;d<l.length;d++){let p=t(l[d],d),y=r[d];y&&y.parentNode===e&&e.replaceChild(p,y),r[d]=p}return}}for(let c of r)c.parentNode===e&&e.removeChild(c);s.clear(),r=[],o=[];for(let c=0;c<l.length;c++){let d=t(l[c],c);e.appendChild(d),r.push(d),o.push(f[c]),s.set(f[c],d)}});return()=>{a();for(let l of r)l.parentNode===e&&e.removeChild(l);r=[],o=[],s.clear()}}var L=e=>{if(typeof document!="undefined")return document.createElement(e);throw new Error("[lyt:vapor] \u672A\u8BBE\u7F6E DOM \u5DE5\u5382\u51FD\u6570\u3002\u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\u8BF7\u8C03\u7528 setVaporDOMFactory()")};function fe(e){L=e}function N(){return L}function J(e,i,...t){let n={tag:e,children:[],props:{},events:{},bindings:[]};if(i)for(let[r,o]of Object.entries(i))if(r.startsWith("on")&&typeof o=="function"&&!q(o)){let s=r.slice(2).toLowerCase();n.events[s]=o}else q(o)?r==="textContent"||r==="text"?n.bindings.push({type:"text",target:"textContent",signal:o}):r==="className"||r==="class"?n.bindings.push({type:"class",target:"className",signal:o}):r==="style"?n.bindings.push({type:"style",target:"style",signal:o}):n.bindings.push({type:"prop",target:r,signal:o}):n.props[r]=o;for(let r of t)typeof r=="string"?n.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:r}):n.children.push(r);return n}function q(e){return typeof e!="function"?!1:!!(e._subscribe||e.set)&&!e.toString().startsWith("class")}function u(e){if(e.tag==="#text"){let t=L("#text");return t.textContent=e.text||"",t.nodeType=3,t}let i=L(e.tag);e.el=i;for(let[t,n]of Object.entries(e.props))if(t==="style"&&typeof n=="object")for(let[r,o]of Object.entries(n))i.style[r]=o;else t==="className"||t==="class"?i.className=String(n):i[t]=n;for(let t of e.bindings)t.type==="text"?B(i,t.signal):t.type==="prop"?R(i,t.target,t.signal):t.type==="attr"?F(i,t.target,t.signal):t.type==="class"?w(i,t.signal):t.type==="style"&&R(i,"style",t.signal);for(let[t,n]of Object.entries(e.events))j(i,t,n);for(let t of e.children){let n=u(t);i.appendChild(n)}return i}function Q(e,i,t){if(e.tag!==i.tag){let o=u(i);e.el&&e.el.parentNode===t&&t.removeChild(e.el),t.appendChild(o);return}let n=e.el||u(e);i.el=n;for(let[o,s]of Object.entries(i.props))if(o==="style"&&typeof s=="object")for(let[a,l]of Object.entries(s))n.style[a]=l;else o==="className"||o==="class"?n.className=String(s):n[o]=s;i.text!==void 0&&(n.textContent=i.text);for(let[o,s]of Object.entries(e.events))i.events[o]||n.removeEventListener(o,s);for(let[o,s]of Object.entries(i.events))e.events[o]!==s&&(e.events[o]&&n.removeEventListener(o,e.events[o]),n.addEventListener(o,s));let r=Math.max(e.children.length,i.children.length);for(let o=0;o<r;o++){let s=e.children[o],a=i.children[o];if(!s&&a){let l=u(a);n.appendChild(l)}else s&&!a?s.el&&s.el.parentNode===n&&n.removeChild(s.el):s&&a&&Q(s,a,n)}}function P(e,i){let t=i.setup?i.setup():{};i.beforeMount&&i.beforeMount();let n;if(i.render){let o=i.render(t,J);n=Array.isArray(o)?o:[o]}else n=[];let r=[];for(let o of n){let s=u(o);e.appendChild(s),r.push(s)}return i.mounted&&i.mounted(),()=>{i.beforeUnmount&&i.beforeUnmount();for(let o of r)e.removeChild(o);i.unmounted&&i.unmounted()}}function U(e){let i={type:"fragment",children:[]},t=e.trim();for(;t.length>0;){let n=t.match(/^<([a-zA-Z][a-zA-Z0-9-]*)([\s\S]*?)(\/?)>/);if(n){let r=n[1],o=n[2],s=n[3]==="/",{props:a,events:l,directives:f}=ue(o),c={type:"element",tag:r,props:a,events:l,directives:f,children:[]};if(t=t.slice(n[0].length),s){i.children.push(c);continue}let d=`</${r}>`,p=ye(t,r);if(p===-1)throw new Error(`[lyt:vapor:compiler] \u672A\u627E\u5230\u95ED\u5408\u6807\u7B7E: </${r}>`);let y=t.slice(0,p);t=t.slice(p+d.length);let m=U(y);c.children=m.children||[],i.children.push(c)}else{let r=t.indexOf("<"),o;if(r===-1?(o=t,t=""):(o=t.slice(0,r),t=t.slice(r)),o.trim())if(o.includes("{{")){let s=me(o);for(let a of s)a.type==="text"?i.children.push({type:"text",text:a.value}):i.children.push({type:"interpolation",expression:a.value})}else i.children.push({type:"text",text:o})}}return i}function ye(e,i){let t=1,n=0,r=`<${i}`,o=`</${i}>`;for(;n<e.length&&t>0;){let s=e.indexOf(r,n),a=e.indexOf(o,n);if(a===-1)return-1;if(s!==-1&&s<a){let l=e[s+r.length];l===">"||l===" "||l==="/"?(t++,n=s+r.length):(n=a+o.length,t--)}else n=a+o.length,t--}return t===0?n-o.length:-1}function ue(e){let i={},t={},n={},r=/([a-zA-Z@:][a-zA-Z0-9@:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,o;for(;(o=r.exec(e))!==null;){let s=o[1],a=o[2]||o[3];if(s.startsWith("on:")){let l=s.slice(3);t[l]=a}else if(s.startsWith(":")){let l=s.slice(1);i[l]=a}else if(s==="v-if")n.if=a;else if(s==="v-each"){let l=a.match(/^\s*(\w+)\s+in\s+(.+)\s*$/);l&&(n.each={item:l[1],expression:l[2]})}else i[s]=a}return{props:i,events:t,directives:n}}function me(e){let i=[],t=/\{\{([\s\S]*?)\}\}/g,n=0,r;for(;(r=t.exec(e))!==null;)r.index>n&&i.push({type:"text",value:e.slice(n,r.index)}),i.push({type:"interpolation",value:r[1].trim()}),n=r.index+r[0].length;return n<e.length&&i.push({type:"text",value:e.slice(n)}),i}function k(e){let i=U(e);return{render:ge(i),ast:i}}function ge(e){return function(t){let n=N();return x(e,t,n)}}function x(e,i,t){var n,r;if(e.type==="fragment"){if(e.children&&e.children.length===1)return x(e.children[0],i,t);let o=t("div");if(o.nodeType=11,e.children)for(let s of e.children){let a=x(s,i,t);o.appendChild(a)}return o}if(e.type==="text"){let o=t("#text");return o.textContent=e.text||"",o.nodeType=3,o}if(e.type==="interpolation"){let o=t("span"),s=e.expression||"",a=v(i,s);return o.textContent=a!=null?String(a):"",o}if(e.type==="element"){if((n=e.directives)!=null&&n.each){let{item:s,expression:a}=e.directives.each,l=v(i,a),f=t("#fragment");if(f.childNodes=[],f.nodeType=11,Array.isArray(l))for(let c=0;c<l.length;c++){let d={...i,[s]:l[c],index:c},p=t(e.tag);if(e.props)for(let[y,m]of Object.entries(e.props))y==="class"||y==="className"?p.className=m:p[y]=m;if(e.children)for(let y of e.children){let m=x(y,d,t);p.appendChild(m)}f.appendChild(p)}return f}let o=t(e.tag);if((r=e.directives)!=null&&r.if&&(v(i,e.directives.if)||(o.style=o.style||{},o.style.display="none",o.hidden=!0)),e.props)for(let[s,a]of Object.entries(e.props))if(s.startsWith(":")){let l=s.slice(1),f=v(i,a);o[l]=f}else s==="class"||s==="className"?o.className=a:o[s]=a;if(e.events)for(let[s,a]of Object.entries(e.events)){let l=v(i,a);typeof l=="function"&&o.addEventListener(s,l)}if(e.children)for(let s of e.children){let a=x(s,i,t);if(a.nodeType===11&&a.childNodes)for(let l of a.childNodes)o.appendChild(l);else o.appendChild(a)}return o}return t("div")}function v(e,i){let t=i.trim();if(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)){let o=e[t];return typeof o=="function"&&!o.prototype?o():o}let n=t.split("."),r=e;for(let o of n){if(r==null)return;r=r[o],typeof r=="function"&&!r.prototype&&n.indexOf(o)<n.length-1&&(r=r())}return r}function he(e){return e}function Ve(e){let i=!1,t=null,n=null;return{mount(r){if(!i){if(typeof r=="string")if(typeof document!="undefined"){let o=document.querySelector(r);if(!o)throw new Error(`[lyt:vapor] \u672A\u627E\u5230\u6302\u8F7D\u76EE\u6807: ${r}`);n=o}else throw new Error("[lyt:vapor] \u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\uFF0C\u8BF7\u76F4\u63A5\u4F20\u5165\u5BB9\u5668\u5143\u7D20");else n=r;t=P(n,e),i=!0}},unmount(){i&&(t&&(t(),t=null),i=!1,n=null)}}}function Ne(e){let i=e.setup?e.setup():{};e.beforeMount&&e.beforeMount();let t;if(e.template){let{render:n}=k(e.template);t=n(i)}else if(e.render){let n=e.render(i,ve),r=Array.isArray(n)?n:[n];if(r.length===1)t=u(r[0]);else{t=N()("div");for(let s of r)t.appendChild(u(s))}}else throw new Error("[lyt:vapor] \u7EC4\u4EF6\u5FC5\u987B\u63D0\u4F9B template \u6216 render \u51FD\u6570");return e.mounted&&e.mounted(),t}function ve(e,i,...t){let n={tag:e,children:[],props:i||{},events:{},bindings:[]};for(let r of t)typeof r=="string"?n.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:r}):n.children.push(r);return n}export{K as Comment,H as Fragment,S as PatchFlags,V as ShapeFlags,W as Text,F as bindAttr,w as bindClass,G as bindEach,j as bindEvent,Z as bindIf,R as bindProp,B as bindText,k as compileToVapor,de as createRenderer,Ve as createVaporApp,J as createVaporElement,he as defineVaporComponent,N as getVaporDOMFactory,U as parseTemplate,Ne as renderVaporComponent,u as renderVaporNode,fe as setVaporDOMFactory,P as vaporMount,Q as vaporPatch};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lytjs/renderer",
3
- "version": "3.2.1",
3
+ "version": "4.0.1",
4
4
  "description": "Lyt.js 渲染器 - 多平台渲染抽象层(DOM/SSR/Native/MiniApp)",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -11,6 +11,36 @@
11
11
  "import": "./dist/index.mjs",
12
12
  "require": "./dist/index.cjs",
13
13
  "default": "./dist/index.mjs"
14
+ },
15
+ "./dom": {
16
+ "types": "./dist/types/dom/index.d.ts",
17
+ "import": "./dist/dom.mjs",
18
+ "require": "./dist/dom.cjs",
19
+ "default": "./dist/dom.mjs"
20
+ },
21
+ "./ssr": {
22
+ "types": "./dist/types/ssr/index.d.ts",
23
+ "import": "./dist/ssr.mjs",
24
+ "require": "./dist/ssr.cjs",
25
+ "default": "./dist/ssr.mjs"
26
+ },
27
+ "./native": {
28
+ "types": "./dist/types/native/index.d.ts",
29
+ "import": "./dist/native.mjs",
30
+ "require": "./dist/native.cjs",
31
+ "default": "./dist/native.mjs"
32
+ },
33
+ "./miniapp": {
34
+ "types": "./dist/types/miniapp/index.d.ts",
35
+ "import": "./dist/miniapp.mjs",
36
+ "require": "./dist/miniapp.cjs",
37
+ "default": "./dist/miniapp.mjs"
38
+ },
39
+ "./vapor": {
40
+ "types": "./dist/types/vapor/index.d.ts",
41
+ "import": "./dist/vapor.mjs",
42
+ "require": "./dist/vapor.cjs",
43
+ "default": "./dist/vapor.mjs"
14
44
  }
15
45
  },
16
46
  "sideEffects": false,
@@ -27,8 +57,8 @@
27
57
  "lightweight", "zero-dependency", "renderer", "dom", "ssr"
28
58
  ],
29
59
  "dependencies": {
30
- "@lytjs/reactivity": "^3.2.0",
31
- "@lytjs/vdom": "^3.2.0"
60
+ "@lytjs/reactivity": "^4.0.0",
61
+ "@lytjs/vdom": "^4.0.0"
32
62
  },
33
63
  "engines": {
34
64
  "node": ">=18.0.0"