lyco 1.3.6 → 1.3.8

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/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(require(`lit/directives/ref.js`)),r=e.__toESM(require(`lit/directives/style-map.js`)),i=typeof window>`u`,a=100;var o=class{constructor(e){this._capacity=e,this.buffer=Array(e)}set(e,t){this.buffer[e%this._capacity]=t}get(e){return this.buffer[e%this._capacity]}clear(){this.buffer.fill(void 0)}get capacity(){return this._capacity}},s=class{constructor(){this.data=new Float64Array}set(e,t){let n=e*3;this.data[n]=t.start,this.data[n+1]=t.end,this.data[n+2]=t.total}get(e){let t=e*3;return t<0||t+2>=this.data.length?{start:0,end:0,total:0}:{start:this.data[t],end:this.data[t+1],total:this.data[t+2]}}initialize(e){this.data=new Float64Array(Math.ceil(e/a)*3),this.data.fill(0)}},c=class{constructor(e,r,c){this._items=[],this._itemSize=50,this._layout=`vertical`,this._preloadCount=5,this._cacheSize=200,this._renderItem=()=>t.html``,this._containerRef=(0,n.createRef)(),this._firstVisible=0,this._lastVisible=0,this._positionCache=new Float64Array,this._sizeCache=new Float32Array,this._cacheInitialized=!1,this._totalContentSize=0,this._blockStore=new s,this._recycledNodes=[],this.RECYCLE_POOL_SIZE=20,this._preRenderChunkSize=5,this.CHUNK_SIZE=1e3,this._chunks=new Map,this._visibleChunkIndexes=new Set,this._loadedChunks=new Set,this._estimatedItemHeight=0,this._isLoading=!1,this._hasMore=!1,this._pageSize=50,this._fetchMoreThreshold=.8,this._getItemSize=e=>typeof this._itemSize==`function`?this._itemSize(e):this._itemSize,this._calculateMetrics=()=>{if(this._items.length===0){this._positionCache=new Float64Array,this._sizeCache=new Float32Array,this._blockStore.initialize(0),this._totalContentSize=0,this._cacheInitialized=!0,this._templateBuffer.clear();return}this._positionCache=new Float64Array(this._items.length),this._sizeCache=new Float32Array(this._items.length),this._blockStore.initialize(this._items.length);let e=0,t=0,n=0;for(let r=0;r<this._items.length;r++){let i=this._getItemSize(r);if(this._positionCache[r]=e,this._sizeCache[r]=i,n+=i,(r+1)%a===0||r===this._items.length-1){let o=Math.floor(r/a);this._blockStore.set(o,{start:t,end:e+i,total:n}),t=e+i,n=0}e+=i}this._totalContentSize=e,this._cacheInitialized=!0,this._templateBuffer.clear()},this._findItemIndexByOffset=e=>{if(!this._cacheInitialized||this._items.length===0)return 0;let t=0,n=this._items.length-1,r=0;for(;t<=n;){let i=Math.floor((t+n)/2);this._positionCache[i]<=e?(r=i,t=i+1):n=i-1}return r},this._updateVisibleRange=()=>{if(!this._containerRef.value)return;let e=this._layout===`vertical`,t=e?this._containerRef.value.scrollTop:this._containerRef.value.scrollLeft,n=e?this._containerRef.value.clientHeight:this._containerRef.value.clientWidth;this._firstVisible=Math.floor(t/this._estimatedItemHeight),this._lastVisible=Math.ceil((t+n)/this._estimatedItemHeight),this._checkAndLoadMore(),this.host.requestUpdate()},this._ticking=!1,this._lastUpdate=0,this.FRAME_BUDGET=16,this._scheduleUpdate=async()=>{if(this._ticking)return;let e=performance.now(),t=e-this._lastUpdate;t>=this.FRAME_BUDGET&&(this._ticking=!0,requestAnimationFrame(()=>{this._updateVisibleRange(),this._ticking=!1,this._lastUpdate=performance.now()}))},this.host=e,e.addController(this),this.updateConfig(r,c),this._templateBuffer=new o(this._cacheSize),this._pageSize=r.pageSize??50,this._fetchMoreThreshold=r.fetchMoreThreshold??.8,i||(this._setupObservers(),this._setupResizeObserver(),this._initializeChunks())}_initializeItems(e){this._items=[...e],this._calculateMetrics(),this._initializeChunks(),this.host.requestUpdate()}_updateMetricsForRange(e,t){if(t>this._positionCache.length){let e=new Float64Array(Math.max(t*1.5,1e3));e.set(this._positionCache),this._positionCache=e;let n=new Float32Array(Math.max(t*1.5,1e3));n.set(this._sizeCache),this._sizeCache=n}let n=e===0?0:this._positionCache[e-1]+this._sizeCache[e-1];for(let r=e;r<t;r++){let e=this._getItemSize(r);this._positionCache[r]=n,this._sizeCache[r]=e,n+=e}this._totalContentSize=n,this._updateChunkMetrics()}_setupObservers(){this._intersectionObserver=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&this._preRenderChunk()})},{rootMargin:`50%`}),this._mutationObserver=new MutationObserver(e=>{e.forEach(e=>{e.removedNodes.forEach(e=>{e instanceof HTMLElement&&this._recycledNodes.length<this.RECYCLE_POOL_SIZE&&this._recycledNodes.push(e)})})})}_setupResizeObserver(){this._resizeObserver=new ResizeObserver(e=>{for(let t of e)if(t.target instanceof HTMLElement){let e=t.contentRect.height;e>0&&(this._estimatedItemHeight=e,this._updateChunkMetrics())}})}_initializeChunks(){this._chunks.clear();let e=Math.ceil(this._items.length/this.CHUNK_SIZE);for(let t=0;t<e;t++){let e=t*this.CHUNK_SIZE,n=Math.min(e+this.CHUNK_SIZE,this._items.length);this._chunks.set(t,this._items.slice(e,n))}}_updateChunkMetrics(){if(!this._containerRef.value)return;let e=this._containerRef.value.clientHeight,t=this._items.length*this._estimatedItemHeight;this._blockStore.initialize(Math.ceil(this._items.length/this.CHUNK_SIZE));let n=0;for(let e=0;e<this._chunks.size;e++){let t=Math.min(this.CHUNK_SIZE,this._items.length-e*this.CHUNK_SIZE),r=t*this._estimatedItemHeight;this._blockStore.set(e,{start:n,end:n+r,total:r}),n+=r}this._totalContentSize=t,this._calculateVisibleChunks()}_calculateVisibleChunks(){if(!this._containerRef.value)return;let e=this._containerRef.value.scrollTop,t=this._containerRef.value.clientHeight,n=Math.floor(e/(this.CHUNK_SIZE*this._estimatedItemHeight)),r=Math.ceil((e+t)/(this.CHUNK_SIZE*this._estimatedItemHeight));this._visibleChunkIndexes.clear();for(let e=n;e<=r;e++)this._chunks.has(e)&&this._visibleChunkIndexes.add(e);this._preloadAdjacentChunks(n-1,r+1)}_preloadAdjacentChunks(e,t){for(let n=e;n<=t;n++)n>=0&&n<this._chunks.size&&!this._loadedChunks.has(n)&&requestIdleCallback(()=>{this._loadChunk(n)})}_loadChunk(e){if(this._loadedChunks.has(e))return;let t=e*this.CHUNK_SIZE,n=Math.min(t+this.CHUNK_SIZE,this._items.length),r=this._items.slice(t,n);this._chunks.set(e,r),this._loadedChunks.add(e),this._calculateMetricsForChunk(e)}_calculateMetricsForChunk(e){let t=e*this.CHUNK_SIZE,n=this._chunks.get(e)||[],r=t*this._estimatedItemHeight;for(let e=0;e<n.length;e++){let n=t+e;this._positionCache[n]=r,this._sizeCache[n]=this._estimatedItemHeight,r+=this._estimatedItemHeight}}_preRenderChunk(){this._idleCallbackId&&cancelIdleCallback(this._idleCallbackId),this._idleCallbackId=requestIdleCallback(e=>{let t=this._lastVisible+1,n=0;for(;e.timeRemaining()>0&&n<this._preRenderChunkSize&&t<this._items.length;)this._prerenderItem(t),t++,n++;t<this._items.length&&this._preRenderChunk()})}_prerenderItem(e){let t=e%this._cacheSize;if(!this._templateBuffer.get(t)){let n=this._positionCache[e],r=this._sizeCache[e];if(n!==void 0&&r!==void 0){let i=this._getItemStyle(n,r),a=this._createItemTemplate(this._items[e],e,i);this._templateBuffer.set(t,a)}}}_getItemStyle(e,t){let n=this._layout===`vertical`;return{position:`absolute`,[n?`top`:`left`]:`${e}px`,[n?`height`:`width`]:`${t}px`,width:n?`100%`:`auto`,height:n?`auto`:`100%`,willChange:`transform`,contain:`content`,backfaceVisibility:`hidden`,WebkitFontSmoothing:`subpixel-antialiased`}}_createItemTemplate(e,n,i){let a=this._recycledNodes.pop(),o=`item-${n}`;return t.html`
1
+ const e=require(`./core-BoB7sDMv.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(require(`lit/directives/ref.js`)),r=e.__toESM(require(`lit/directives/style-map.js`)),i=typeof window>`u`,a=100;var o=class{constructor(e){this._capacity=e,this.buffer=Array(e)}set(e,t){this.buffer[e%this._capacity]=t}get(e){return this.buffer[e%this._capacity]}clear(){this.buffer.fill(void 0)}get capacity(){return this._capacity}},s=class{constructor(){this.data=new Float64Array}set(e,t){let n=e*3;this.data[n]=t.start,this.data[n+1]=t.end,this.data[n+2]=t.total}get(e){let t=e*3;return t<0||t+2>=this.data.length?{start:0,end:0,total:0}:{start:this.data[t],end:this.data[t+1],total:this.data[t+2]}}initialize(e){this.data=new Float64Array(Math.ceil(e/a)*3),this.data.fill(0)}},c=class{constructor(e,r,c){this._items=[],this._itemSize=50,this._layout=`vertical`,this._preloadCount=5,this._cacheSize=200,this._renderItem=()=>t.html``,this._containerRef=(0,n.createRef)(),this._firstVisible=0,this._lastVisible=0,this._positionCache=new Float64Array,this._sizeCache=new Float32Array,this._cacheInitialized=!1,this._totalContentSize=0,this._blockStore=new s,this._recycledNodes=[],this.RECYCLE_POOL_SIZE=20,this._preRenderChunkSize=5,this.CHUNK_SIZE=1e3,this._chunks=new Map,this._visibleChunkIndexes=new Set,this._loadedChunks=new Set,this._estimatedItemHeight=0,this._isLoading=!1,this._hasMore=!1,this._pageSize=50,this._fetchMoreThreshold=.8,this._getItemSize=e=>typeof this._itemSize==`function`?this._itemSize(e):this._itemSize,this._calculateMetrics=()=>{if(this._items.length===0){this._positionCache=new Float64Array,this._sizeCache=new Float32Array,this._blockStore.initialize(0),this._totalContentSize=0,this._cacheInitialized=!0,this._templateBuffer.clear();return}this._positionCache=new Float64Array(this._items.length),this._sizeCache=new Float32Array(this._items.length),this._blockStore.initialize(this._items.length);let e=0,t=0,n=0;for(let r=0;r<this._items.length;r++){let i=this._getItemSize(r);if(this._positionCache[r]=e,this._sizeCache[r]=i,n+=i,(r+1)%a===0||r===this._items.length-1){let o=Math.floor(r/a);this._blockStore.set(o,{start:t,end:e+i,total:n}),t=e+i,n=0}e+=i}this._totalContentSize=e,this._cacheInitialized=!0,this._templateBuffer.clear()},this._findItemIndexByOffset=e=>{if(!this._cacheInitialized||this._items.length===0)return 0;let t=0,n=this._items.length-1,r=0;for(;t<=n;){let i=Math.floor((t+n)/2);this._positionCache[i]<=e?(r=i,t=i+1):n=i-1}return r},this._updateVisibleRange=()=>{if(!this._containerRef.value)return;let e=this._layout===`vertical`,t=e?this._containerRef.value.scrollTop:this._containerRef.value.scrollLeft,n=e?this._containerRef.value.clientHeight:this._containerRef.value.clientWidth;this._firstVisible=Math.floor(t/this._estimatedItemHeight),this._lastVisible=Math.ceil((t+n)/this._estimatedItemHeight),this._checkAndLoadMore(),this.host.requestUpdate()},this._ticking=!1,this._lastUpdate=0,this.FRAME_BUDGET=16,this._scheduleUpdate=async()=>{if(this._ticking)return;let e=performance.now(),t=e-this._lastUpdate;t>=this.FRAME_BUDGET&&(this._ticking=!0,requestAnimationFrame(()=>{this._updateVisibleRange(),this._ticking=!1,this._lastUpdate=performance.now()}))},this.host=e,e.addController(this),this.updateConfig(r,c),this._templateBuffer=new o(this._cacheSize),this._pageSize=r.pageSize??50,this._fetchMoreThreshold=r.fetchMoreThreshold??.8,i||(this._setupObservers(),this._setupResizeObserver(),this._initializeChunks())}_initializeItems(e){this._items=[...e],this._calculateMetrics(),this._initializeChunks(),this.host.requestUpdate()}_updateMetricsForRange(e,t){if(t>this._positionCache.length){let e=new Float64Array(Math.max(t*1.5,1e3));e.set(this._positionCache),this._positionCache=e;let n=new Float32Array(Math.max(t*1.5,1e3));n.set(this._sizeCache),this._sizeCache=n}let n=e===0?0:this._positionCache[e-1]+this._sizeCache[e-1];for(let r=e;r<t;r++){let e=this._getItemSize(r);this._positionCache[r]=n,this._sizeCache[r]=e,n+=e}this._totalContentSize=n,this._updateChunkMetrics()}_setupObservers(){this._intersectionObserver=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&this._preRenderChunk()})},{rootMargin:`50%`}),this._mutationObserver=new MutationObserver(e=>{e.forEach(e=>{e.removedNodes.forEach(e=>{e instanceof HTMLElement&&this._recycledNodes.length<this.RECYCLE_POOL_SIZE&&this._recycledNodes.push(e)})})})}_setupResizeObserver(){this._resizeObserver=new ResizeObserver(e=>{for(let t of e)if(t.target instanceof HTMLElement){let e=t.contentRect.height;e>0&&(this._estimatedItemHeight=e,this._updateChunkMetrics())}})}_initializeChunks(){this._chunks.clear();let e=Math.ceil(this._items.length/this.CHUNK_SIZE);for(let t=0;t<e;t++){let e=t*this.CHUNK_SIZE,n=Math.min(e+this.CHUNK_SIZE,this._items.length);this._chunks.set(t,this._items.slice(e,n))}}_updateChunkMetrics(){if(!this._containerRef.value)return;let e=this._containerRef.value.clientHeight,t=this._items.length*this._estimatedItemHeight;this._blockStore.initialize(Math.ceil(this._items.length/this.CHUNK_SIZE));let n=0;for(let e=0;e<this._chunks.size;e++){let t=Math.min(this.CHUNK_SIZE,this._items.length-e*this.CHUNK_SIZE),r=t*this._estimatedItemHeight;this._blockStore.set(e,{start:n,end:n+r,total:r}),n+=r}this._totalContentSize=t,this._calculateVisibleChunks()}_calculateVisibleChunks(){if(!this._containerRef.value)return;let e=this._containerRef.value.scrollTop,t=this._containerRef.value.clientHeight,n=Math.floor(e/(this.CHUNK_SIZE*this._estimatedItemHeight)),r=Math.ceil((e+t)/(this.CHUNK_SIZE*this._estimatedItemHeight));this._visibleChunkIndexes.clear();for(let e=n;e<=r;e++)this._chunks.has(e)&&this._visibleChunkIndexes.add(e);this._preloadAdjacentChunks(n-1,r+1)}_preloadAdjacentChunks(e,t){for(let n=e;n<=t;n++)n>=0&&n<this._chunks.size&&!this._loadedChunks.has(n)&&requestIdleCallback(()=>{this._loadChunk(n)})}_loadChunk(e){if(this._loadedChunks.has(e))return;let t=e*this.CHUNK_SIZE,n=Math.min(t+this.CHUNK_SIZE,this._items.length),r=this._items.slice(t,n);this._chunks.set(e,r),this._loadedChunks.add(e),this._calculateMetricsForChunk(e)}_calculateMetricsForChunk(e){let t=e*this.CHUNK_SIZE,n=this._chunks.get(e)||[],r=t*this._estimatedItemHeight;for(let e=0;e<n.length;e++){let n=t+e;this._positionCache[n]=r,this._sizeCache[n]=this._estimatedItemHeight,r+=this._estimatedItemHeight}}_preRenderChunk(){this._idleCallbackId&&cancelIdleCallback(this._idleCallbackId),this._idleCallbackId=requestIdleCallback(e=>{let t=this._lastVisible+1,n=0;for(;e.timeRemaining()>0&&n<this._preRenderChunkSize&&t<this._items.length;)this._prerenderItem(t),t++,n++;t<this._items.length&&this._preRenderChunk()})}_prerenderItem(e){let t=e%this._cacheSize;if(!this._templateBuffer.get(t)){let n=this._positionCache[e],r=this._sizeCache[e];if(n!==void 0&&r!==void 0){let i=this._getItemStyle(n,r),a=this._createItemTemplate(this._items[e],e,i);this._templateBuffer.set(t,a)}}}_getItemStyle(e,t){let n=this._layout===`vertical`;return{position:`absolute`,[n?`top`:`left`]:`${e}px`,[n?`height`:`width`]:`${t}px`,width:n?`100%`:`auto`,height:n?`auto`:`100%`,willChange:`transform`,contain:`content`,backfaceVisibility:`hidden`,WebkitFontSmoothing:`subpixel-antialiased`}}_createItemTemplate(e,n,i){let a=this._recycledNodes.pop(),o=`item-${n}`;return t.html`
2
2
  ${a?t.html`<div
3
3
  .key=${o}
4
4
  style=${(0,r.styleMap)(i)}
@@ -42,8 +42,8 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
42
42
  </div>
43
43
  `}function m(r,i){let a=e.createEventBinder(r?.on??{});return i===void 0?e=>m(r,e??[t.html``]):t.html`
44
44
  <div
45
- ${(0,n.ref)(e=>{e?a.bind(e):a.unbindAll()})}
46
45
  .class="${r?.className}"
46
+ ${(0,n.ref)(e=>{e?a.bind(e):a.unbindAll()})}
47
47
  style="
48
48
  display: flex;
49
49
  flex-direction: column;
@@ -582,13 +582,13 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
582
582
  ${r?.content??``}
583
583
  </div>
584
584
  </div>
585
- `}function I(e,t){return e?n=>{typeof e==`function`?e(n):e={value:n},typeof t==`function`?t(n):t={value:n}}:t}function L(r,i){if(!i)return e=>L(r,e??(0,n.createRef)());let a=e.createEventBinder(r?.on??{}),o=I(i,e=>{e?a.bind(e):a.unbindAll()});return t.html`
585
+ `}function I(r,i){if(!i)return e=>I(r,e??(0,n.createRef)());let a=e.createEventBinder(r?.on??{}),o=e=>{e?(a.bind(e),typeof i==`function`?i(e):i={value:e}):a.unbindAll()};return t.html`
586
586
  <canvas
587
587
  ${(0,n.ref)(o)}
588
588
  .class=${r?.className}
589
589
  style=${r?.style??``}
590
590
  ></canvas>
591
- `}function R(r,i){if(i===void 0)return e=>R(r,e??[t.html``]);let a=r?.padding??`16px`,o=r?.borderRadius??`8px`,s=r?.shadow??`0 2px 8px rgba(0,0,0,0.1)`,c=r?.background??`#fff`,l=e.createEventBinder(r?.on??{});return t.html`
591
+ `}function L(r,i){if(i===void 0)return e=>L(r,e??[t.html``]);let a=r?.padding??`16px`,o=r?.borderRadius??`8px`,s=r?.shadow??`0 2px 8px rgba(0,0,0,0.1)`,c=r?.background??`#fff`,l=e.createEventBinder(r?.on??{});return t.html`
592
592
  <div
593
593
  ${(0,n.ref)(e=>{e?l.bind(e):l.unbindAll()})}
594
594
  style="
@@ -601,7 +601,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
601
601
  >
602
602
  ${e.renderFnOrArray(i)}
603
603
  </div>
604
- `}function z(r,i){if(i===void 0){let e=e=>z(r,e??t.html``);return e.html=(e,...n)=>z(r,(0,t.html)(e,...n)),e}let a=r?.width?`width: ${r.width};`:``,o=r?.height?`height: ${r.height};`:``,s=r?.background?`background: ${r.background};`:``,c=e.createEventBinder(r?.on??{});return t.html`
604
+ `}function R(r,i){if(i===void 0){let e=e=>R(r,e??t.html``);return e.html=(e,...n)=>R(r,(0,t.html)(e,...n)),e}let a=r?.width?`width: ${r.width};`:``,o=r?.height?`height: ${r.height};`:``,s=r?.background?`background: ${r.background};`:``,c=e.createEventBinder(r?.on??{});return t.html`
605
605
  <div
606
606
  ${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
607
607
  style="
@@ -613,7 +613,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
613
613
  >
614
614
  ${e.renderFn(i)}
615
615
  </div>
616
- `}function B(r,i){if(i===void 0)return e=>B(r,e??[t.html``]);let a=r?.maxWidth??`1024px`,o=r?.padding??`0 16px`,s=r?.background?`background: ${r.background};`:``,c=r?.fullHeight?`height: 100%;`:``,l=e.createEventBinder(r?.on??{});return t.html`
616
+ `}function z(r,i){if(i===void 0)return e=>z(r,e??[t.html``]);let a=r?.maxWidth??`1024px`,o=r?.padding??`0 16px`,s=r?.background?`background: ${r.background};`:``,c=r?.fullHeight?`height: 100%;`:``,l=e.createEventBinder(r?.on??{});return t.html`
617
617
  <div
618
618
  ${(0,n.ref)(e=>{e?l.bind(e):l.unbindAll()})}
619
619
  style="
@@ -629,10 +629,10 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
629
629
  >
630
630
  ${e.renderFnOrArray(i)}
631
631
  </div>
632
- `}function V(r){let i=r?.orientation??`horizontal`,a=r?.thickness??`1px`,o=r?.color??`#e0e0e0`,s=r?.margin??(i===`horizontal`?`8px 0`:`0 8px`),c=e.createEventBinder(r?.on??{}),l=i===`horizontal`?`width: 100%; height: ${a}; background: ${o}; margin: ${s};`:`width: ${a}; height: 100%; background: ${o}; margin: ${s};`;return t.html`<div
632
+ `}function B(r){let i=r?.orientation??`horizontal`,a=r?.thickness??`1px`,o=r?.color??`#e0e0e0`,s=r?.margin??(i===`horizontal`?`8px 0`:`0 8px`),c=e.createEventBinder(r?.on??{}),l=i===`horizontal`?`width: 100%; height: ${a}; background: ${o}; margin: ${s};`:`width: ${a}; height: 100%; background: ${o}; margin: ${s};`;return t.html`<div
633
633
  ${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
634
634
  style="${l}"
635
- ></div>`}function H(r,i){if(i===void 0){let e=e=>H(r,e??t.html``);return e.html=(e,...n)=>H(r,(0,t.html)(e,...n)),e}let a=r?.columns??4,o=r?.gap??`24px`,s=r?.background??`#f8f8f8`,c=r?.padding??`40px 16px`,l=e.createEventBinder(r?.on??{});return t.html`
635
+ ></div>`}function V(r,i){if(i===void 0){let e=e=>V(r,e??t.html``);return e.html=(e,...n)=>V(r,(0,t.html)(e,...n)),e}let a=r?.columns??4,o=r?.gap??`24px`,s=r?.background??`#f8f8f8`,c=r?.padding??`40px 16px`,l=e.createEventBinder(r?.on??{});return t.html`
636
636
  <div
637
637
  ${(0,n.ref)(e=>{e?l.bind(e):l.unbindAll()})}
638
638
  style="
@@ -655,7 +655,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
655
655
  © ${new Date().getFullYear()} Your Company. All rights reserved.
656
656
  </div>
657
657
  </div>
658
- `}function U(e,t){return t?e.map((e,n)=>t(e,n)):t=>e.map((e,n)=>t(e,n))}function W(r,i){if(i===void 0){let e=e=>W(r,e??t.html``);return e.html=(e,...n)=>W(r,(0,t.html)(e,...n)),e}let a=r.defaultColumns??1,o=r.gap??`16px`,s=e.getComponentCount(`GridBreakpoint`),c=r.className??e.getRandomClassName(`GridBreakpoint::grid-breakpoint`)+`-lyco-now-`+s,l=Object.entries(r.breakpoints).map(([e,t])=>`@media`+e+`{
658
+ `}function H(e,t){return t?e.map((e,n)=>t(e,n)):t=>e.map((e,n)=>t(e,n))}function U(r,i){if(i===void 0){let e=e=>U(r,e??t.html``);return e.html=(e,...n)=>U(r,(0,t.html)(e,...n)),e}let a=r.defaultColumns??1,o=r.gap??`16px`,s=e.getComponentCount(`GridBreakpoint`),c=r.className??e.getRandomClassName(`GridBreakpoint::grid-breakpoint`)+`-lyco-now-`+s,l=Object.entries(r.breakpoints).map(([e,t])=>`@media`+e+`{
659
659
  `+c+`{ grid-template-columns: repeat(`+t+`, 1fr); }
660
660
  }`).join(`
661
661
  `),u=`
@@ -674,7 +674,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
674
674
  >
675
675
  ${e.renderFn(i)}
676
676
  </div>
677
- `)}function G(r,i){if(i===void 0)return e=>G(r,e??[t.html``]);let a=r?.backgroundImage?`background-image: url('${r.backgroundImage}');`:``,o=r?.height??`400px`,s=r?.overlayColor??`rgba(0, 0, 0, 0.3)`,c=e.createEventBinder(r?.on??{});return t.html`
677
+ `)}function W(r,i){if(i===void 0)return e=>W(r,e??[t.html``]);let a=r?.backgroundImage?`background-image: url('${r.backgroundImage}');`:``,o=r?.height??`400px`,s=r?.overlayColor??`rgba(0, 0, 0, 0.3)`,c=e.createEventBinder(r?.on??{});return t.html`
678
678
  <div
679
679
  ${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
680
680
  style="
@@ -712,7 +712,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
712
712
  ${e.renderFnOrArray(i)}
713
713
  </div>
714
714
  </div>
715
- `}function K(r,i){if(i===void 0){let e=e=>K(r,e??t.html``);return e.html=(e,...n)=>K(r,(0,t.html)(e,...n)),e}let a=r?.breakpoint??`(max-width: 600px)`,o=r?.mode??`hide`,s=e.getComponentCount(`Hidden`),c=r?.className??e.getRandomClassName(`Hidden::hidden-container`)+`-lyco-now-`+s,l=o===`hide`?`@media ${a} { .${c} { display: none !important; } }`:`@media ${a} { .${c} { display: block !important; } }
715
+ `}function G(r,i){if(i===void 0){let e=e=>G(r,e??t.html``);return e.html=(e,...n)=>G(r,(0,t.html)(e,...n)),e}let a=r?.breakpoint??`(max-width: 600px)`,o=r?.mode??`hide`,s=e.getComponentCount(`Hidden`),c=r?.className??e.getRandomClassName(`Hidden::hidden-container`)+`-lyco-now-`+s,l=o===`hide`?`@media ${a} { .${c} { display: none !important; } }`:`@media ${a} { .${c} { display: block !important; } }
716
716
  @media not ${a} { .${c} { display: none !important; } }`,u=`
717
717
  .${c} {
718
718
  display: block;
@@ -727,7 +727,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
727
727
  >
728
728
  ${e.renderFn(i)}
729
729
  </div>
730
- `)}function ee(n){return t.html` <li>${e.renderFnOrArray(n)}</li> `}function q(n,r){let i=n?.bordered?`border: 1px solid #ddd; border-radius: 4px`:``,a=n?.striped?`li:nth-child(even) { background: #f9f9f9; }`:``,o=n?.hover?`li:hover { background: #f1f1f1; cursor: pointer; }`:``,s=e.getComponentCount(`List`),c=n?.className??e.getRandomClassName(`List::list`)+`-lyco-now-${s}`,l=`
730
+ `)}function K(n){return t.html` <li>${e.renderFnOrArray(n)}</li> `}function ee(n,r){let i=n?.bordered?`border: 1px solid #ddd; border-radius: 4px`:``,a=n?.striped?`li:nth-child(even) { background: #f9f9f9; }`:``,o=n?.hover?`li:hover { background: #f1f1f1; cursor: pointer; }`:``,s=e.getComponentCount(`List`),c=n?.className??e.getRandomClassName(`List::list`)+`-lyco-now-${s}`,l=`
731
731
  ul.${c} {
732
732
  list-style: none;
733
733
  margin: 0;
@@ -750,7 +750,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
750
750
  <ul class="${c}">
751
751
  ${e.renderFnOrArray(n)}
752
752
  </ul>
753
- `);return r===void 0?u:u(r)}function J(r,i){let a=r?.bordered?`border: 1px solid #ddd; border-radius: 4px`:``,o=r?.striped?`li:nth-child(even) { background: #f9f9f9; }`:``,s=r?.hover?`li:hover { background: #f1f1f1; cursor: pointer; }`:``,c=e.getComponentCount(`ListGroup`),l=r?.className??e.getRandomClassName(`ListGroup::list-group`)+`-lyco-now-`+c,u=(e,n,r,i)=>r?t.html` <li>${e}</li> `:e,d=`
753
+ `);return r===void 0?u:u(r)}function q(r,i){let a=r?.bordered?`border: 1px solid #ddd; border-radius: 4px`:``,o=r?.striped?`li:nth-child(even) { background: #f9f9f9; }`:``,s=r?.hover?`li:hover { background: #f1f1f1; cursor: pointer; }`:``,c=e.getComponentCount(`ListGroup`),l=r?.className??e.getRandomClassName(`ListGroup::list-group`)+`-lyco-now-`+c,u=(e,n,r,i)=>r?t.html` <li>${e}</li> `:e,d=`
754
754
  ul.${l} {
755
755
  list-style: none;
756
756
  margin: 0;
@@ -776,7 +776,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
776
776
  >
777
777
  ${e.renderFnOrArray(r,u)}
778
778
  </ul>
779
- `);return e.renderFnOrArrayOrCurry(i,p)}function Y(r,i){if(i===void 0)return e=>Y(r,e??[t.html``]);let a=r?.background??`rgba(0, 0, 0, 0.5)`,o=r?.zIndex??1e3,s=r?.fullScreen!==!1,c=e.createEventBinder(r?.on??{});return t.html`
779
+ `);return e.renderFnOrArrayOrCurry(i,p)}function J(r,i){if(i===void 0)return e=>J(r,e??[t.html``]);let a=r?.background??`rgba(0, 0, 0, 0.5)`,o=r?.zIndex??1e3,s=r?.fullScreen!==!1,c=e.createEventBinder(r?.on??{});return t.html`
780
780
  <div
781
781
  ${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
782
782
  style="
@@ -791,7 +791,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
791
791
  >
792
792
  ${e.renderFnOrArray(i)}
793
793
  </div>
794
- `}function X(r,i){if(i===void 0){let e=e=>X(r,e??t.html``);return e.html=(e,...n)=>X(r,(0,t.html)(e,...n)),e}let a=r?.width?`width: ${r.width};`:``,o=r?.height?`height: ${r.height};`:``,s=r?.background?`background: ${r.background};`:``,c=e.createEventBinder(r?.on??{});return t.html`
794
+ `}function Y(r,i){if(i===void 0){let e=e=>Y(r,e??t.html``);return e.html=(e,...n)=>Y(r,(0,t.html)(e,...n)),e}let a=r?.width?`width: ${r.width};`:``,o=r?.height?`height: ${r.height};`:``,s=r?.background?`background: ${r.background};`:``,c=e.createEventBinder(r?.on??{});return t.html`
795
795
  <div
796
796
  ${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
797
797
  style="
@@ -824,7 +824,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
824
824
  `)}function re(r){let i=e.createEventBinder(r?.on??{});return t.html`<div
825
825
  ${(0,n.ref)(e=>{e?i.bind(e):i.unbindAll()})}
826
826
  style="flex: 1 1 auto;"
827
- ></div>`}function Z(r,i){if(i===void 0){let e=e=>Z(r,e??t.html``);return e.html=(e,...n)=>Z(r,(0,t.html)(e,...n)),e}let a=r?.top?`top: ${r.top};`:``,o=r?.bottom?`bottom: ${r.bottom};`:``,s=typeof r?.zIndex==`number`?`z-index: ${r.zIndex};`:``,c=e.createEventBinder(r?.on??{});return t.html`
827
+ ></div>`}function X(r,i){if(i===void 0){let e=e=>X(r,e??t.html``);return e.html=(e,...n)=>X(r,(0,t.html)(e,...n)),e}let a=r?.top?`top: ${r.top};`:``,o=r?.bottom?`bottom: ${r.bottom};`:``,s=typeof r?.zIndex==`number`?`z-index: ${r.zIndex};`:``,c=e.createEventBinder(r?.on??{});return t.html`
828
828
  <div
829
829
  ${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
830
830
  style="
@@ -835,7 +835,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
835
835
  >
836
836
  ${e.renderFn(i)}
837
837
  </div>
838
- `}function Q(r,i){if(i===void 0){let e=e=>Q(r,e??t.html``);return e.html=(e,...n)=>Q(r,(0,t.html)(e,...n)),e}let a=e.getComponentCount(`Table`),o=r?.className??e.getRandomClassName(`Table::table`)+`-lyco-now-${a}`,s=r?.striped?`
838
+ `}function Z(r,i){if(i===void 0){let e=e=>Z(r,e??t.html``);return e.html=(e,...n)=>Z(r,(0,t.html)(e,...n)),e}let a=e.getComponentCount(`Table`),o=r?.className??e.getRandomClassName(`Table::table`)+`-lyco-now-${a}`,s=r?.striped?`
839
839
  .${o} tr:nth-child(even) {
840
840
  background: ${O.colors.surface};
841
841
  }
@@ -901,7 +901,7 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
901
901
  >
902
902
  ${e.renderFnOrArray(i)}
903
903
  </div>
904
- `}function ae(r,i){let a=r?.width?`width: ${r.width};`:``,o=r?.height?`height: ${r.height};`:``,s=r?.background?`background: ${r.background};`:``,c=e.createEventBinder(r?.on??{});if(i===void 0)return e=>ae(r,e??[t.html``]);let l=`flex-start`,u=`flex-start`;switch(r?.align){case`top-right`:l=`flex-end`,u=`flex-start`;break;case`center`:l=`center`,u=`center`;break;case`bottom-left`:l=`flex-start`,u=`flex-end`;break;case`bottom-right`:l=`flex-end`,u=`flex-end`;break;default:l=`flex-start`,u=`flex-start`}return t.html`
904
+ `}function Q(r,i){let a=r?.width?`width: ${r.width};`:``,o=r?.height?`height: ${r.height};`:``,s=r?.background?`background: ${r.background};`:``,c=e.createEventBinder(r?.on??{});if(i===void 0)return e=>Q(r,e??[t.html``]);let l=`flex-start`,u=`flex-start`;switch(r?.align){case`top-right`:l=`flex-end`,u=`flex-start`;break;case`center`:l=`center`,u=`center`;break;case`bottom-left`:l=`flex-start`,u=`flex-end`;break;case`bottom-right`:l=`flex-end`,u=`flex-end`;break;default:l=`flex-start`,u=`flex-start`}return t.html`
905
905
  <div
906
906
  ${(0,n.ref)(e=>{e?c.bind(e):c.unbindAll()})}
907
907
  style="
@@ -914,7 +914,19 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
914
914
  >
915
915
  ${e.renderFnOrArray(i)}
916
916
  </div>
917
- `}function oe(r){let{value:i=``,options:a=[],placeholder:o=``,disabled:s=!1,error:c=!1,className:l=``,style:u=``,maxHeight:d=`300px`,onChange:f,onInput:p,onFocus:m,onBlur:h,on:g={},optionRender:_}=r??{},v=e.getComponentCount(`Combobox`),y=e.getRandomClassName(`Combobox::combobox`)+`-lyco-now-${v}`,b=!1,x=null,S=`
917
+ `}function ae(r,i,a=.1,o={}){let s=Array(r.length).fill(!1),c=`${a*100}vh`,l=`100vw`,u=r.map((r,a)=>t.html`
918
+ <div
919
+ ${(0,n.ref)(n=>{if(n&&!s[a]){let c=new IntersectionObserver((n,c)=>{n.forEach(n=>{if(n.isIntersecting&&!s[a]){let l=n.target;s[a]=!0,(0,t.render)(i(r,a),l),e.AnimationAPI.applyAnimation(l,o);let u=l.querySelector(`[data-fallback]`);u&&u.remove(),c.unobserve(l)}})},{root:null,rootMargin:`0px`});c.observe(n)}})}
920
+ data-index="${a}"
921
+ style="transition: transform ${o.duration||`1s`} ease;"
922
+ >
923
+ <!-- 占位元素 -->
924
+ <div
925
+ data-fallback
926
+ style="height: ${c}; width: ${l};"
927
+ ></div>
928
+ </div>
929
+ `);return u}function oe(r){let{value:i=``,options:a=[],placeholder:o=``,disabled:s=!1,error:c=!1,className:l=``,style:u=``,maxHeight:d=`300px`,onChange:f,onInput:p,onFocus:m,onBlur:h,on:g={},optionRender:_}=r??{},v=e.getComponentCount(`Combobox`),y=e.getRandomClassName(`Combobox::combobox`)+`-lyco-now-${v}`,b=!1,x=null,S=`
918
930
  .${y} {
919
931
  position: relative;
920
932
  width: 100%;
@@ -1311,5 +1323,5 @@ const e=require(`./core-DkUSnSgK.js`),t=e.__toESM(require(`lit`)),n=e.__toESM(re
1311
1323
  >
1312
1324
  ${e.renderFn(r)}
1313
1325
  </div>
1314
- `;return e.renderFnOrCurry(i,l)}function be(t){return e.renderFnOrArray(t)}exports.$Html=be,exports.AbsoluteBox=A,exports.AcrylicBar=j,exports.AspectRatio=M,exports.AutoFitGrid=N,exports.AvatarStack=P,exports.Badge=F,exports.Canvas=L,exports.Card=R,exports.Center=z,exports.Column=m,exports.ColumnSplit=C,exports.Combobox=oe,exports.Container=B,exports.Dialog=he,exports.DialogActions=ge,exports.DialogButton=_e,exports.DialogContent=ve,exports.DialogPlacement=ue,exports.DialogTitle=ye,exports.Divider=V,exports.Flex=h,exports.FlowItem=g,exports.FooterLayout=H,exports.ForEach=U,exports.Grid=_,exports.GridBreakpoint=W,exports.GridCol=v,exports.GridItem=y,exports.GridRow=b,exports.HeroSection=G,exports.Hidden=K,exports.LightboxContainer=p,exports.List=q,exports.ListGroup=J,exports.ListItem=ee,exports.Overlay=Y,exports.PositionContainer=X,exports.Progress=se,exports.Row=x,exports.RowSplit=w,exports.ScrollBar=T,exports.SideBarContainer=E,exports.SizedBox=te,exports.SkeletonLoader=ne,exports.Spacer=re,exports.Spinner=ce,exports.Sticky=Z,exports.Swiper=D,exports.SwitchInput=k,exports.Table=Q,exports.Virtualizer=f,exports.VirtualizerController=c,exports.WaterFlow=S,exports.WithTooltip=le,exports.Wrap=ie,exports.ZStack=ae;
1326
+ `;return e.renderFnOrCurry(i,l)}function be(t){return e.renderFnOrArray(t)}exports.$Html=be,exports.AbsoluteBox=A,exports.AcrylicBar=j,exports.AspectRatio=M,exports.AutoFitGrid=N,exports.AvatarStack=P,exports.Badge=F,exports.Canvas=I,exports.Card=L,exports.Center=R,exports.Column=m,exports.ColumnSplit=C,exports.Combobox=oe,exports.Container=z,exports.Dialog=he,exports.DialogActions=ge,exports.DialogButton=_e,exports.DialogContent=ve,exports.DialogPlacement=ue,exports.DialogTitle=ye,exports.Divider=B,exports.Flex=h,exports.FlowItem=g,exports.FooterLayout=V,exports.ForEach=H,exports.Grid=_,exports.GridBreakpoint=U,exports.GridCol=v,exports.GridItem=y,exports.GridRow=b,exports.HeroSection=W,exports.Hidden=G,exports.LazyForEach=ae,exports.LightboxContainer=p,exports.List=ee,exports.ListGroup=q,exports.ListItem=K,exports.Overlay=J,exports.PositionContainer=Y,exports.Progress=se,exports.Row=x,exports.RowSplit=w,exports.ScrollBar=T,exports.SideBarContainer=E,exports.SizedBox=te,exports.SkeletonLoader=ne,exports.Spacer=re,exports.Spinner=ce,exports.Sticky=X,exports.Swiper=D,exports.SwitchInput=k,exports.Table=Z,exports.Virtualizer=f,exports.VirtualizerController=c,exports.WaterFlow=S,exports.WithTooltip=le,exports.Wrap=ie,exports.ZStack=Q;
1315
1327
  //# sourceMappingURL=index.cjs.js.map