UNPKG

flexium

Version:

A lightweight, signals-based UI framework with cross-platform renderers

2 lines 1.09 kB
'use strict';var chunkMOEFWUNZ_js=require('./chunk-MOEFWUNZ.js');function w(e){let{each:r,children:n}=e,l=n[0],i=new Map;return ()=>{let a=r()||[],o=new Map,s=a.map((t,f)=>{let c=i.get(t);if(c)c.indexSig.peek()!==f&&c.indexSig.set(f);else {let u=chunkMOEFWUNZ_js.b(f),d=l(t,u);d.key==null&&(t!=null&&t.id!=null?d.key=t.id:(typeof t=="string"||typeof t=="number")&&(d.key=t)),c={vnode:d,indexSig:u};}return o.set(t,c),c.vnode});return i=o,s}}function g(e){return ()=>{let r=e.when();if(r){let n=e.children[0];return typeof n=="function"&&e.children.length===1?n(r):n}return e.fallback?typeof e.fallback=="function"?e.fallback():e.fallback:null}}function y(e){return e}function N(e){return ()=>{let r=Array.isArray(e.children)?e.children:[e.children];for(let n of r.flat())if(n&&n.type===y){let l=n.props.when,i=typeof l=="function"?l():l;if(i){let a=n.children;if(a&&a.length>0){let o=a[0];return typeof o=="function"?o(i):o}return null}}return e.fallback||null}}exports.a=w;exports.b=g;exports.c=y;exports.d=N;//# sourceMappingURL=chunk-QRIMUWMH.js.map //# sourceMappingURL=chunk-QRIMUWMH.js.map