react-motion-gallery 2.0.28 → 2.0.29
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/{chunk-LSHR3FZM.mjs → chunk-2R7OFQOQ.mjs} +1 -1
- package/dist/{chunk-3RVITFUD.mjs → chunk-4JKJJ7NK.mjs} +1 -1
- package/dist/{chunk-7AEUL74Y.mjs → chunk-HQOT2YXE.mjs} +2 -2
- package/dist/chunk-OGKEGMFG.mjs +2 -0
- package/dist/{chunk-4ZOW533S.mjs → chunk-OXSTAD2V.mjs} +1 -1
- package/dist/{chunk-MFTASEWB.mjs → chunk-PEPL24ZV.mjs} +1 -1
- package/dist/{chunk-63CVVCOL.mjs → chunk-Q4ITTHWE.mjs} +1 -1
- package/dist/{chunk-X3W6JPNH.mjs → chunk-Q5SLFTYJ.mjs} +1 -1
- package/dist/entries.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/masonry.mjs +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/skeleton-base.mjs +1 -1
- package/dist/skeleton-grid.mjs +1 -1
- package/dist/skeleton-masonry.mjs +1 -1
- package/dist/skeleton-slider.mjs +3 -3
- package/package.json +1 -1
- package/dist/chunk-4BTS6IIA.mjs +0 -2
package/dist/skeleton-base.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as Skeleton,a as SkeletonFrame,b as default}from'./chunk-
|
|
1
|
+
export{b as Skeleton,a as SkeletonFrame,b as default}from'./chunk-OXSTAD2V.mjs';import'./chunk-OGKEGMFG.mjs';import'./chunk-Z34PSRMG.mjs';import'./chunk-UUAWLGWO.mjs';import'./chunk-LVYED5ZM.mjs';import'./chunk-B4CC5AGE.mjs';import'./chunk-HK2DPKES.mjs';
|
package/dist/skeleton-grid.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as GridSkeleton,a as Skeleton,a as default}from'./chunk-
|
|
1
|
+
export{a as GridSkeleton,a as Skeleton,a as default}from'./chunk-Q5SLFTYJ.mjs';import'./chunk-OXSTAD2V.mjs';import'./chunk-OGKEGMFG.mjs';import'./chunk-Z34PSRMG.mjs';import'./chunk-Y7NUGXTR.mjs';import'./chunk-UUAWLGWO.mjs';import'./chunk-LVYED5ZM.mjs';import'./chunk-B4CC5AGE.mjs';import'./chunk-HK2DPKES.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as MasonrySkeleton,a as Skeleton,a as default}from'./chunk-
|
|
1
|
+
export{a as MasonrySkeleton,a as Skeleton,a as default}from'./chunk-HQOT2YXE.mjs';import'./chunk-2R7OFQOQ.mjs';import'./chunk-OXSTAD2V.mjs';import'./chunk-OGKEGMFG.mjs';import'./chunk-Z34PSRMG.mjs';import'./chunk-UUAWLGWO.mjs';import'./chunk-LVYED5ZM.mjs';import'./chunk-B4CC5AGE.mjs';import'./chunk-HK2DPKES.mjs';
|
package/dist/skeleton-slider.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-R6EGYRTJ.mjs';import {a as a$4}from'./chunk-KJZTKXTM.mjs';import {a as a$3}from'./chunk-
|
|
1
|
+
import {a as a$2}from'./chunk-R6EGYRTJ.mjs';import {a as a$4}from'./chunk-KJZTKXTM.mjs';import {a as a$3}from'./chunk-OXSTAD2V.mjs';import {n,l,t,i as i$1,u,w,x,b,k as k$1,y,s,q,d as d$1,f,h,g,r,j}from'./chunk-OGKEGMFG.mjs';import'./chunk-Z34PSRMG.mjs';import {a as a$1}from'./chunk-UUAWLGWO.mjs';import'./chunk-LVYED5ZM.mjs';import'./chunk-B4CC5AGE.mjs';import {i,a,d,e}from'./chunk-HK2DPKES.mjs';import*as C from'react';import {jsxs,jsx}from'react/jsx-runtime';var ut=300*1e3,ct=2,dt="rmg:slider-restore",Vt=new Set(["reload","back_forward"]);function Xt(e,t){return (e%t+t)%t}function Jt(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}function St(){return Date.now()}function mt(e,t=typeof window<"u"?window.location:void 0){let n=t?`${t.pathname}${t.search}`:"";return `${dt}:${e}:${n}`}function Ut(e=window){let n=(e.performance?.getEntriesByType?.("navigation")??[])[0];if(n?.type)return n.type;let r=e.performance?.navigation;return r?r.type===r.TYPE_RELOAD?"reload":r.type===r.TYPE_BACK_FORWARD?"back_forward":null:null}function Zt(e=window){let t=Ut(e);return !!t&&Vt.has(t)}function Qt(e){if(!e)return null;let t;try{t=JSON.parse(e);}catch{return null}if(!Jt(t)||t.version!==1)return null;let n=Number(t.index),r=Number(t.viewportWidth),i=Number(t.slideCount),o=Number(t.skeletonSlotCount),l=Number(t.timestamp),a=Number(t.scrollY),c=Number(t.scrollMax),u=t.heightPx==null?void 0:Number(t.heightPx);return !Number.isInteger(n)||n<0||!Number.isFinite(r)||r<=0||!Number.isInteger(i)||i<=0||!Number.isInteger(o)||o<=0||!Number.isFinite(l)||l<=0||u!=null&&(!Number.isFinite(u)||u<=0)?null:{version:1,index:n,heightPx:u,viewportWidth:r,slideCount:i,skeletonSlotCount:o,timestamp:l,scrollY:Number.isFinite(a)?Math.max(0,a):0,scrollMax:Number.isFinite(c)?Math.max(0,c):0,wasAtBottom:t.wasAtBottom===true}}function en(e,t){if(!e)return null;let n=Math.max(0,t.ttlMs),r=(t.now??St())-e.timestamp;if(n>0&&(r<0||r>n)||e.slideCount!==t.slideCount||e.skeletonSlotCount!==t.skeletonSlotCount||e.index<0||e.index>=t.slideCount)return null;let i=t.viewportTolerancePx??ct;return Math.abs(e.viewportWidth-t.viewportWidth)>i?null:e}function ft(e,t=window,n={}){if(!e?.enabled||e.controlled||n.requireNavigationRestore!==false&&!Zt(t))return null;try{let r=t.sessionStorage.getItem(mt(e.storageKeyId,t.location));return en(Qt(r),{ttlMs:e.ttlMs,viewportWidth:t.innerWidth||t.document.documentElement.clientWidth||0,slideCount:e.slideCount,skeletonSlotCount:e.skeletonSlotCount})}catch{return null}}function pt(e,t,n=window){if(!(!e?.enabled||e.controlled))try{let r=n.document.documentElement,i=n.document.body,o=Math.max(r?.scrollHeight??0,i?.scrollHeight??0),l=n.innerHeight||r?.clientHeight||0,a=Math.max(0,o-l),c=Math.max(0,n.scrollY||n.pageYOffset||0),u=a>0&&a-c<=4,s={version:1,index:Math.max(0,Math.floor(t.index)),heightPx:t.heightPx,viewportWidth:n.innerWidth||r?.clientWidth||0,slideCount:t.slideCount,skeletonSlotCount:t.skeletonSlotCount,timestamp:St(),scrollY:c,scrollMax:a,wasAtBottom:u};n.sessionStorage.setItem(mt(e.storageKeyId,n.location),JSON.stringify(s));}catch{}}function gt(e){let t=Math.max(0,Math.floor(e.slotCount)),n=Math.min(t,Math.max(0,Math.floor(e.visibleCount)));if(t<=0||n<=0)return [];let r=Math.min(Math.max(0,Math.floor(e.activeIndex)),Math.max(0,t-1)),i=Math.min(Math.max(0,Math.floor(e.activeSlotOffset)),Math.max(0,n-1)),o=e.loop?r:Math.min(Math.max(0,r-i),Math.max(0,t-n)),l=[],a=new Set;for(let c=0;c<n;c+=1){let u=o+c,s=e.loop?Xt(u,t):u;s<0||s>=t||a.has(s)||(a.add(s),l.push({slot:s+1,order:c}));}return l}function tn(e){return JSON.stringify(e).replace(/</g,"\\u003c")}function nn(e){return `(function(){try{
|
|
2
2
|
var cfg=${tn(e)};
|
|
3
3
|
var nav=(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||{}).type;
|
|
4
4
|
if(!nav&&performance.navigation){nav=performance.navigation.type===performance.navigation.TYPE_RELOAD?"reload":performance.navigation.type===performance.navigation.TYPE_BACK_FORWARD?"back_forward":"";}
|
|
@@ -34,7 +34,7 @@ style.setAttribute("data-rmg-slider-restore-style",cfg.scopeId);
|
|
|
34
34
|
style.textContent=css;
|
|
35
35
|
document.head.appendChild(style);
|
|
36
36
|
if(state.wasAtBottom){var keep=function(){var doc=document.documentElement;var body=document.body;var max=Math.max(0,Math.max(doc.scrollHeight,body?body.scrollHeight:0)-(innerHeight||doc.clientHeight||0));scrollTo(scrollX||0,max);};requestAnimationFrame(keep);setTimeout(keep,50);addEventListener("load",function(){requestAnimationFrame(keep);setTimeout(keep,120);},{once:true});}
|
|
37
|
-
}catch(e){}})();`}function ht(e){if(e.slideCount<=0||e.skeletonSlotCount<=0)return "";let t=i(e.responsiveCount,e.fallbackCount,e.breakpointMap),n={scopeId:e.scopeId,storageKeyId:e.storageKeyId,ttlMs:e.ttlMs,slideCount:e.slideCount,skeletonSlotCount:e.skeletonSlotCount,maxSlots:e.maxSlots,loop:e.loop,activeSlotOffset:e.activeSlotOffset,countRules:t,dotStyles:e.dotStyles??[],viewportTolerancePx:ct};return nn(n)}function m(e){if(e!=null)return typeof e=="number"?`${e}px`:e}function He(e){if(!e)return {};let t=m(e.margin),n=m(e.marginTop),r=m(e.marginRight),i=m(e.marginBottom),o=m(e.marginLeft),l={};return t!=null&&(l.margin=t),n!=null&&(l.marginTop=n),r!=null&&(l.marginRight=r),i!=null&&(l.marginBottom=i),o!=null&&(l.marginLeft=o),l}function rn(e,t){if(!(!e&&!t))return {...e||{},...t||{}}}function Ie(e,t){let n=e.slots?.[t];return {item:n?.item??e.item,itemWrapStyle:rn(e.itemWrapStyle,n?.itemWrapStyle)}}function We(e,t){let n$1={}
|
|
37
|
+
}catch(e){}})();`}function ht(e){if(e.slideCount<=0||e.skeletonSlotCount<=0)return "";let t=i(e.responsiveCount,e.fallbackCount,e.breakpointMap),n={scopeId:e.scopeId,storageKeyId:e.storageKeyId,ttlMs:e.ttlMs,slideCount:e.slideCount,skeletonSlotCount:e.skeletonSlotCount,maxSlots:e.maxSlots,loop:e.loop,activeSlotOffset:e.activeSlotOffset,countRules:t,dotStyles:e.dotStyles??[],viewportTolerancePx:ct};return nn(n)}function m(e){if(e!=null)return typeof e=="number"?`${e}px`:e}function He(e){if(!e)return {};let t=m(e.margin),n=m(e.marginTop),r=m(e.marginRight),i=m(e.marginBottom),o=m(e.marginLeft),l={};return t!=null&&(l.margin=t),n!=null&&(l.marginTop=n),r!=null&&(l.marginRight=r),i!=null&&(l.marginBottom=i),o!=null&&(l.marginLeft=o),l}function rn(e,t){if(!(!e&&!t))return {...e||{},...t||{}}}function Ie(e,t){let n=e.slots?.[t];return {item:n?.item??e.item,itemWrapStyle:rn(e.itemWrapStyle,n?.itemWrapStyle)}}function We(e,t){let n$1={},r=m(e?.height),i=m(e?.maxHeight),o=m(e?.width),l=m(e?.maxWidth);return r!=null?n$1.height=r:e?.aspectRatio!=null&&(n$1.height="auto"),i!=null&&(n$1.maxHeight=i),e?.aspectRatio!=null&&(n$1.aspectRatio=e.aspectRatio),o!=null&&(n$1.inlineSize=o,n$1.width=o),l!=null&&(n$1.maxInlineSize=l,n$1.maxWidth=l),e?.aspectRatio!=null&&e?.width==null&&e?.height==null&&(n$1.inlineSize="100%",n$1.width="100%"),e?.backgroundColor&&(n$1["--rmg-skel-bg"]=e.backgroundColor),e?.borderRadius!=null&&(n$1["--rmg-skel-radius"]=m(e.borderRadius)),e?.overflow!=null&&(n$1.overflow=e.overflow),e?.alignSelf&&(n$1.alignSelf=e.alignSelf),e?.scale!=null&&(n$1.transform=`scale(${e.scale})`),Object.assign(n$1,n(t)),n$1}function on(e,t){let n={};t!=null&&(n.height=`${t}px`);let r=m(e?.width),i=m(e?.maxWidth);return r!=null&&(n.inlineSize=r,n.width=r),i!=null&&(n.maxInlineSize=i,n.maxWidth=i),e?.alignSelf&&(n.alignSelf=e.alignSelf),e?.scale!=null&&(n.transform=`scale(${e.scale})`),n}function $e(e){return typeof e=="string"&&e.trim()==="max-content"}function ln(e){return !e||typeof e!="object"?false:$e(e.width)?true:Object.values(e).some(n=>!!n&&typeof n=="object"&&$e(n.width))}function sn(e){let t=We(e,void 0);return delete t["--rmg-skel-bg"],e?.backgroundColor!=null&&(t.backgroundColor=e.backgroundColor),e?.border!=null&&(t.border=e.border),e?.boxShadow!=null&&(t.boxShadow=e.boxShadow),e?.borderRadius!=null?(t.borderRadius=m(e.borderRadius),t.overflow=e?.overflow??"hidden"):e?.overflow!=null&&(t.overflow=e.overflow),t.boxSizing="border-box",t}function an(e){if(!e)return {outerStyle:void 0,innerStyle:void 0};let t=sn(e),n={};return t.boxShadow!=null&&(n["--rmg-slider-skel-wrap-shadow"]=t.boxShadow,delete t.boxShadow),t.borderRadius!=null&&(n["--rmg-slider-skel-wrap-shadow-radius"]=t.borderRadius),{outerStyle:Object.keys(n).length?n:void 0,innerStyle:t}}function Be(e){let t={};return e&&(e.height!=null&&(t.height=m(e.height)),e.minHeight!=null&&(t.minHeight=m(e.minHeight)),e.maxHeight!=null&&(t.maxHeight=m(e.maxHeight)),e.position!=null&&(t.position=e.position),e.inset!=null&&(t.inset=m(e.inset)),e.insetBlock!=null&&(t.insetBlock=m(e.insetBlock)),e.insetInline!=null&&(t.insetInline=m(e.insetInline)),e.top!=null&&(t.top=m(e.top)),e.right!=null&&(t.right=m(e.right)),e.bottom!=null&&(t.bottom=m(e.bottom)),e.left!=null&&(t.left=m(e.left)),e.zIndex!=null&&(t.zIndex=e.zIndex),e.gap!=null&&(t.gap=m(e.gap)),e.padding!=null&&(t.padding=m(e.padding)),e.align&&(t.alignItems=e.align),e.justify&&(t.justifyContent=e.justify),e.wrap&&(t.flexWrap="wrap"),e.width!=null&&(t.width=m(e.width)),e.maxWidth!=null&&(t.maxWidth=m(e.maxWidth)),e.backgroundColor!=null&&(t.backgroundColor=e.backgroundColor),e.borderRadius!=null&&(t.borderRadius=m(e.borderRadius)),e.border!=null&&(t.border=e.border),e.boxShadow!=null&&(t.boxShadow=e.boxShadow),e.margin!=null&&(t.margin=m(e.margin)),e.marginTop!=null&&(t.marginTop=m(e.marginTop)),e.marginRight!=null&&(t.marginRight=m(e.marginRight)),e.marginBottom!=null&&(t.marginBottom=m(e.marginBottom)),e.marginLeft!=null&&(t.marginLeft=m(e.marginLeft)),e.flex!=null&&(t.flex=e.flex),e.flexGrow!=null&&(t.flexGrow=e.flexGrow),e.flexShrink!=null&&(t.flexShrink=e.flexShrink),e.flexBasis!=null&&(t.flexBasis=m(e.flexBasis)),e.order!=null&&(t.order=e.order),e.alignSelf!=null&&(t.alignSelf=e.alignSelf),e.overflow!=null&&(t.overflow=e.overflow),e.transform!=null&&(t.transform=e.transform),e.pointerEvents!=null&&(t.pointerEvents=e.pointerEvents),e.opacity!=null&&(t.opacity=e.opacity)),t}function Ae(e){let t=We(e,void 0);return delete t["--rmg-skel-bg"],e?.backgroundColor!=null&&(t.backgroundColor=e.backgroundColor),e?.borderRadius!=null&&(t.borderRadius=m(e.borderRadius)),e?.overflow!=null&&(t.overflow=e.overflow),{...t,...He(e)}}function bt(e){return e.replace(/"/g,'\\"')}function ne(e,t,n,r=a){switch(e.kind){case "rect":case "square":case "circle":{let i=x({style:e.style,breakpointMap:r});if(!i.length)return e;let o=t();return n.push({nodeId:o,rules:i}),{...e,__rmgNodeId:o}}case "text":{let i=[...k$1({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,fitContent:ln(e.style),breakpointMap:r}).map(l=>({...l,raw:true})),...y({style:e.style,breakpointMap:r})];if(!i.length)return e;let o=t();return n.push({nodeId:o,rules:i}),{...e,__rmgNodeId:o}}case "media":{let i=[...w({style:e.style,breakpointMap:r}),...x({style:e.tile?.style,breakpointMap:r,selector:`${b} [data-rmg-skel-media-tile="true"]`})];if(!i.length)return e;let o=t();return n.push({nodeId:o,rules:i}),{...e,__rmgNodeId:o}}case "sliderDots":{let i=[...w({style:e.style,breakpointMap:r}),...x({style:e.dotStyle,breakpointMap:r,selector:`${b} [data-rmg-skel-slider-dot]`}),...x({style:e.activeStyle,breakpointMap:r,selector:`${b} [data-rmg-skel-dot-active="true"]`}),...x({style:e.inactiveStyle,breakpointMap:r,selector:`${b} [data-rmg-skel-dot-active="false"]`})];if(!i.length)return e;let o=t();return n.push({nodeId:o,rules:i}),{...e,__rmgNodeId:o}}case "stack":case "row":case "col":{let i=w({style:e.style,breakpointMap:r}),o=i.length?t():void 0;o&&i.length&&n.push({nodeId:o,rules:i});let l=e.children.map(a=>ne(a,t,n,r));return {...e,...o?{__rmgNodeId:o}:null,children:l}}case "slider":{let i=w({style:e.style,breakpointMap:r}),o=i.length?t():void 0;o&&i.length&&n.push({nodeId:o,rules:i});let l=ne(e.item,t,n,r),a=e.children?.map(s=>ne(s,t,n,r)),c=e.overlays?.map(s=>ne(s,t,n,r)),u=e.slots?.map(s=>({...s,item:s.item?ne(s.item,t,n,r):void 0}));return {...e,...o?{__rmgNodeId:o}:null,item:l,children:a,overlays:c,slots:u}}default:return e}}function un(e,t){if(!t.length)return "";let n=[];for(let r of t){let i=`${e} [data-rmg-skel-node="${bt(r.nodeId)}"]`;for(let o of r.rules){let l=o.raw?o.css.split("__NODE_SEL__").join(i):`${i}{${o.css}}`;o.minWidth<=0?n.push(l):n.push(`@media (min-width:${o.minWidth}px){${l}}`);}}return n.join(`
|
|
38
38
|
`)}function kt(e){let{kind:t,style:n,shimmer:r,breakpointMap:i,mediaTile:o}=e,l={},a=s(n,i),c=e.__rmgNodeId;return t==="circle"&&(l.borderRadius="9999px"),t==="square"&&a?.aspectRatio==null&&(l.aspectRatio="1"),a?.aspectRatio!=null&&a?.height==null&&(l.height="auto"),jsx("div",{"data-rmg-skel-node":c,"data-rmg-skel-media-tile":o?"true":void 0,className:a$4.sliderSkeleton,style:{...We(a,r),...He(a),...l}})}function cn({node:e,breakpointMap:t}){let n=j({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,breakpointMap:t}),r=s(e.style,t),i=n.states.some(({state:s})=>s.lineCount!==n.baseState.lineCount||s.metrics.totalHeight!==n.baseState.metrics.totalHeight||s.metrics.barHeight!==n.baseState.metrics.barHeight||s.metrics.paddingBlock!==n.baseState.metrics.paddingBlock||s.metrics.rowGap!==n.baseState.metrics.rowGap),o=n.states.some(({state:s})=>s.lineCount!==n.baseState.lineCount||s.barWidths.length!==n.baseState.barWidths.length||s.barWidths.some((p,S)=>p!==n.baseState.barWidths[S])),l=e.__rmgNodeId,a=on(r,i?void 0:n.metrics.totalHeight),c={height:n.metrics.barHeight,backgroundColor:r?.backgroundColor,borderRadius:r?.borderRadius},u=$e(r?.width);return jsx("div",{"data-rmg-skel-node":l,"data-rmg-skel-text":"true",className:a$4.sliderSkeletonText,style:{...a,...He(r),...i?null:{paddingBlock:`${n.metrics.paddingBlock}px`,rowGap:`${n.metrics.rowGap}px`}},children:Array.from({length:n.maxLines}).map((s,p)=>jsx("div",{"data-rmg-skel-text-line":"true",className:[a$4.sliderSkeleton,a$4.sliderSkeletonTextLine].join(" "),style:{...We(c,e.shimmer),...o?null:{display:p>=n.baseLines?"none":void 0,width:u?n.baseState.barWidths[p]??"100%":"100%",maxWidth:n.baseState.barWidths[p]??"100%"}}},p))})}function Le({node:e,breakpointMap:t$1,activeDotIndex:n$1}){switch(e.kind){case "rect":case "square":case "circle":return jsx(kt,{...e,breakpointMap:t$1});case "media":{let r=Math.max(0,e.count|0),i=e.direction??"row",o=e.tile?.shape??"rect",l=e.__rmgNodeId,a=Be(t(e.style,t$1));return jsx("div",{"data-rmg-skel-node":l,className:a$4.sliderSkeletonGroup,style:{display:"flex",flexDirection:i==="row"?"row":"column",...a||{}},children:Array.from({length:r}).map((c,u)=>jsx(kt,{kind:o,style:e.tile?.style,shimmer:e.tile?.shimmer,breakpointMap:t$1,mediaTile:true},u))})}case "sliderDots":{let r=Math.max(0,e.count|0),i=e.__rmgNodeId,o=Be(t(e.style,t$1)),l=Ae(s(e.dotStyle,t$1)),a=Ae(s(e.activeStyle,t$1)),c=Ae(s(e.inactiveStyle,t$1)),u=typeof n$1=="number"&&Number.isFinite(n$1)?Math.max(0,Math.min(r-1,Math.floor(n$1))):0;return jsx("div",{"data-rmg-skel-node":i,"data-rmg-skel-slider-dots":"true","data-rmg-skel-dot-active-style":JSON.stringify(a),"data-rmg-skel-dot-inactive-style":JSON.stringify(c),className:a$4.sliderSkeletonGroup,style:{display:"flex",flexDirection:"row",...o||{}},children:Array.from({length:r}).map((s,p)=>{let S=p===u;return jsx("div",{"data-rmg-skel-slider-dot":p,"data-rmg-skel-dot-active":S?"true":"false",className:a$4.sliderSkeleton,style:{...n(e.shimmer),...l,...S?a:c}},p)})})}case "stack":case "row":case "col":{let r=e.kind==="row"?"row":"column",i=e.__rmgNodeId,o=Be(t(e.style,t$1));return jsx("div",{"data-rmg-skel-node":i,className:a$4.sliderSkeletonGroup,style:{display:"flex",flexDirection:r,...o||{}},children:e.children.map((l,a)=>jsx(Le,{node:l,breakpointMap:t$1,activeDotIndex:n$1},a))})}case "text":return jsx(cn,{node:e,breakpointMap:t$1});default:return null}}function yt(){return {layout:{kind:"slider",direction:"row",item:{kind:"rect",style:{width:"100%",height:"100%",borderRadius:2}},itemWrapStyle:void 0},radius:12}}function Ee(e){return /%$/.test(e.trim())}function Rt(e){let t=e.trim();if(!t.length)return null;if(t==="0")return {value:0,unit:"px"};let n=t.match(/^(\d+(?:\.\d+)?|\.\d+)([a-zA-Z]+)$/);if(!n)return null;let r=Number(n[1]);return !Number.isFinite(r)||r<0?null:{value:r,unit:n[2]}}function Ct(e){let t=[],n="",r=0;for(let i of e.trim()){if(/\s/.test(i)&&r===0){n&&(t.push(n),n="");continue}n+=i,i==="("?r+=1:i===")"&&(r=Math.max(0,r-1));}return n&&t.push(n),t}function dn(e){let t=e.trim();return t.length?t==="0"?"0px":/^(?:var|calc|min|max|clamp)\(.+\)$/i.test(t)||Rt(t)?t:null:null}function Sn(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)&&e>=0?e===0?"0px":`${e}px`:null;for(let t of Ct(String(e))){let n=dn(t);if(n)return n}return null}function _(e){return e==null?null:typeof e=="number"?`${e}px`:String(e)}function Me(e,t){if(!e)return null;if(t===0)return "0px";if(e==="0px")return e;let n=Rt(e);return n?`${n.value*t}${n.unit}`:`calc(${e} * ${t})`}function wt(e){if(e==null)return null;if(typeof e=="number")return e>0?e:null;let t=String(e).trim(),n=t.match(/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/);if(n){let i=Number(n[1]),o=Number(n[2]);return i>0&&o>0?i/o:null}let r=Number(t);return Number.isFinite(r)&&r>0?r:null}function k(e){let t=e.filter(r=>!!r&&r.trim().length>0);if(!t.length)return null;let n=t.filter(r=>{let i=r.trim();return i!=="0"&&i!=="0px"});return n.length?n.length===1?n[0]:`calc(${n.join(" + ")})`:"0px"}function ve(e){let t=e.filter(n=>!!n&&n.trim().length>0);return t.length?t.length===1?t[0]:`max(${t.join(", ")})`:null}function mn(e){let t=e.filter(n=>!!n&&n.trim().length>0);return t.length?t.length===1?t[0]:`min(${t.join(", ")})`:null}function ae(e,t){if(e.trim()==="0"||e.trim()==="0px"||t.trim()==="0"||t.trim()==="0px")return "0px";if(t.trim()==="1")return e;let n=Number(t);return Number.isFinite(n)?Me(e,n)??`calc(${e} * ${t})`:`calc(${e} * ${t})`}function Fe(e,t){return t.trim()==="1"?e:`calc(${e} / ${t})`}function Nt(e,t){return t.trim()==="0"||t.trim()==="0px"?e:`calc(${e} - ${t})`}function Bt(e,t){let n=_(t);return !e||!n?e:mn([e,n])}function re(e){let t=_(e?.margin),n=_(e?.marginTop),r=_(e?.marginBottom);return t&&!n&&!r?Me(t,2):!t&&!n&&!r?null:k([n??t??"0px",r??t??"0px"])}function Lt(e){if(e==null)return null;let t=typeof e=="number"?`${e}px`:String(e).trim();if(!t.length)return null;let n=Ct(t);if(!n.length||n.length>4)return null;let[r,i,o,l]=n;return n.length===1?{top:r,right:r,bottom:r,left:r}:n.length===2?{top:r,right:i,bottom:r,left:i}:n.length===3?{top:r,right:i,bottom:o,left:i}:{top:r,right:i,bottom:o,left:l}}function Et(e){return Sn(e?.border)}function fn(e){return Me(Et(e),2)}function pn(e){return Me(Et(e),2)}function V(e){let t=Lt(e?.padding);return t?k([t.top,t.bottom]):null}function Ht(e){let t=Lt(e?.padding);return t?k([t.left,t.right]):null}function be(e){return _(e?.gap)}function xt(e,t){let n=Ht(t);return !n||n==="0px"?e:Nt(e,n)}function ue(e,t=0,n=a){return r(e,t,n)}function De(e,t,n,r,i=0,o=a){let l=ue(e.style,i,o),a=be(l)??"0px",c=Ht(l)??"0px",u=Math.max(1,t|0),s=u>1?ae(a,String(u-1)):"0px",p=`calc(100cqw - ${c} - ${s})`,{itemWrapStyle:S}=Ie(e,n),g=S?.width?_(S.width):null,v;return r==="peek"&&g&&!Ee(g)?v=g:v=Fe(p,String(u)),Bt(v,S?.maxWidth)??v}function gn(e,t,n,r,i=0,o=a){let l=De(e,t,n,r,i,o),{itemWrapStyle:a}=Ie(e,n),c=fn(a);return !c||c==="0px"?l:Nt(l,c)}function hn(e$1,t=0,n=a){let r=e(d(e$1.rowHeightCompensation,n),t);return r==null||!Number.isFinite(r)||r<=0?null:`${r}px`}function It(e,t,n,r=0,i=a){let o=ue(e.style,r,i),l=be(o)??"0px",a=V(o)??"0px",c=hn(e,r,i),u=Math.max(1,t|0),s=e.direction??"row",p=Array.from({length:u},(g,v)=>{let{item:M,itemWrapStyle:W}=Ie(e,v),O=De(e,u,v,n,r,i),N=gn(e,u,v,n,r,i),b=ce(M,N,r,i),y=pn(W),B=re(W),f=k([y,B]),d=null,H=null;if(b&&!Ee(b)&&(H=k([b,y,B])),W){let q=_(W.height);if(q)d=k([q,B]);else {let P=wt(W.aspectRatio);P?d=k([Fe(O,String(P)),B]):d=f;}}return b?d?Ee(b)?d:ve([d,H??b]):b:d}),S=s==="row"?(()=>{let g=e.initialHeightSlot;if(g==null)return ve(p);let v=Math.min(Math.max(0,Math.trunc(g)),Math.max(0,u-1));return p[v]??ve(p)})():k([k(p),u>1?ae(l,String(u-1)):"0px"]);return k([S,a,c])}function Wt(e,t=0,n=a){return k((e.children??[]).map(r=>ce(r,"100cqw",t,n)))}function ce(e,t,n=0,r=a){if(e.kind==="rect"||e.kind==="square"||e.kind==="circle"){let i=q(e.style,n,r),o=_(i?.height),l=wt(i?.aspectRatio);if(o)return k([o,re(i)]);if(l){let a=_(i?.width),c=a&&!Ee(a)?a:t,u=Bt(c,i?.maxWidth)??c,s=String(l),p=Fe(u,s);return k([p,re(i)])}return re(i)??null}if(e.kind==="media"){let i=e.direction??"row",o=ue(e.style,n,r),l=be(o)??"0px",a=Math.max(0,e.count|0),c=xt(t,o),u=e.tile?{kind:e.tile.shape??"rect",style:e.tile.style,shimmer:e.tile.shimmer}:{kind:"rect",style:{width:"100%",height:"100%"}},s=ce(u,c,n,r);return s?i==="row"?k([s,V(o)]):a<=1?k([s,V(o)]):k([ae(s,String(a)),ae(l,String(a-1)),V(o)]):null}if(e.kind==="sliderDots"){let i=ue(e.style,n,r),o=q(e.dotStyle,n,r),l=q(e.activeStyle,n,r),a=q(e.inactiveStyle,n,r),c=[o,l,a].map(s=>k([_(s?.height),re(s)])).filter(s=>!!s),u=ve(c);return u?k([u,V(i)]):V(i)}if(e.kind==="row"||e.kind==="col"||e.kind==="stack"){let i=e.kind==="row"?"row":"col",o=ue(e.style,n,r),l=be(o)??"0px",a=V(o)??"0px",c=xt(t,o),u=e.children.map(s=>ce(s,c,n,r));if(i==="row"){let s=ve(u);return s?k([s,a]):null}else {let s=u.filter(S=>!!S);if(!s.length)return a;let p=s.length>1?ae(l,String(s.length-1)):"0px";return k([k(s)??null,p,a])}}if(e.kind==="text"){let i=q(e.style,n,r),o=d$1({barHeight:g(e.barHeight,typeof e.barHeight=="number"?e.barHeight:0,n,r),lineHeight:h(e.lineHeight,typeof e.lineHeight=="number"?e.lineHeight:1,n,r),lines:f(e.lines,1,n,r)});return k([`${o.totalHeight}px`,re(i)])}return null}function Mt(e,t,n,r=0,i=a){let o=e.kind==="slider"?e:null;if(!o)return ce(e,"100cqw",r,i);let l=It(o,t,n,r,i),a=Wt(o,r,i);return k([l,a])}function Pt(e,t=0,n=a){let r=e.kind==="slider"?e:null;return r?Wt(r,t,n):null}function Tt(e,t,n,r=0,i=a){let o=e.kind==="slider"?e:null;if(!o||n!=="peek")return null;let l=Math.max(1,t|0);if(l<=1)return null;let a=ue(o.style,r,i),c=be(a)??"0px",u=Array.from({length:l-1},(p,S)=>De(o,l,S+1,n,r,i)),s=l>2?ae(c,String(l-2)):null;return k([...u,s])}function _t(e,t,n,r=0,i=a){let o=e.kind==="slider"?e:null;return o?It(o,t,n,r,i):ce(e,"100cqw",r,i)}function ie(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":case "media":case "sliderDots":return;case "text":for(let r of i$1({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,breakpointMap:n}))t.add(r);return;case "stack":case "row":case "col":for(let r of e.children)ie(r,t,n);return;case "slider":ie(e.item,t,n);for(let r of e.children??[])ie(r,t,n);for(let r of e.overlays??[])ie(r,t,n);for(let r of e.slots??[])r.item&&ie(r.item,t,n);return;default:return e}}function oe(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":u(e.style,t,n);return;case "media":u(e.tile?.style,t,n);return;case "sliderDots":u(e.dotStyle,t,n),u(e.activeStyle,t,n),u(e.inactiveStyle,t,n);return;case "text":u(e.style,t,n);return;case "stack":case "row":case "col":for(let r of e.children)oe(r,t,n);return;case "slider":oe(e.item,t,n);for(let r of e.children??[])oe(r,t,n);for(let r of e.overlays??[])oe(r,t,n);for(let r of e.slots??[])r.item&&oe(r.item,t,n);return;default:return e}}function Ne(e,t,n=a){u(e,t,n);}function le(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":case "text":return;case "media":Ne(e.style,t,n);return;case "sliderDots":Ne(e.style,t,n);return;case "stack":case "row":case "col":Ne(e.style,t,n);for(let r of e.children)le(r,t,n);return;case "slider":Ne(e.style,t,n),le(e.item,t,n);for(let r of e.children??[])le(r,t,n);for(let r of e.overlays??[])le(r,t,n);for(let r of e.slots??[])r.item&&le(r.item,t,n);return;default:return e}}function se(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":case "media":case "sliderDots":case "text":return;case "stack":case "row":case "col":for(let r of e.children)se(r,t,n);return;case "slider":for(let r of d(e.rowHeightCompensation,n))t.add(r.minWidth);se(e.item,t,n);for(let r of e.children??[])se(r,t,n);for(let r of e.overlays??[])se(r,t,n);for(let r of e.slots??[])r.item&&se(r.item,t,n);return;default:return e}}function Ot(e,t=a){let n=new Set;return ie(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function At(e,t=a){let n=new Set;return le(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function $t(e,t=a){let n=new Set;return oe(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function Ft(e,t=a){let n=new Set;return se(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function Dt({count:e,maxSlots:t$1,activeDotIndex:n$1,rowStyle:r,spec:i,breakpoints:o,centerFirst:l=false,hasLeadingSpacer:a$2=false,responsiveCssScopeSelector:c}){let u=i??yt(),s=C.useMemo(()=>({...a,...o??{}}),[o]),p=u.layout??yt().layout,S=C.useMemo(()=>a$1("ssk_",{breakpoints:s,centerFirst:l,count:e,hasLeadingSpacer:a$2,maxSlots:t$1,rowStyle:r,spec:u}),[l,e,s,a$2,t$1,r,u]),g=C.useMemo(()=>`[data-rmg-slider-skel-scope="${bt(S)}"]`,[S]),v=c??g,M={...r||{},...n(u.shimmer)};u.backgroundColor&&(M["--rmg-skel-bg"]=u.backgroundColor),u.radius!=null&&(M["--rmg-skel-radius"]=m(u.radius));let{layout:W,responsiveCss:O}=C.useMemo(()=>{let T=0,I=()=>`n${++T}`,A=[],Se=ne(p,I,A,s),z=un(v,A);return {layout:Se,responsiveCss:z}},[p,v,s]),N=W,b=N.__rmgNodeId,y=Be(t(N.style,s)),B=N.count!=null?Math.max(0,N.count|0):Math.max(0,e|0),f=N.direction??"row",d=N.children??[],H=N.overlays??[],q=l&&f==="row",P=a$2&&f==="row",Re=N.itemStretch??true,J=Math.max(0,t$1|0),U=u.mode??"fit";return jsxs("div",{"data-rmg-slider-skel-scope":c?void 0:S,"data-rmg-skel-mode":U,"data-rmg-skel-has-extras":d.length?"true":void 0,className:[a$4.sliderSkeletonOverlay,u.className].filter(Boolean).join(" "),style:u.style,"data-rmg-skel-part":"overlay",children:[O?jsx("style",{dangerouslySetInnerHTML:{__html:O}}):null,jsxs("div",{className:a$4.sliderSkeletonLayout,"data-rmg-skel-part":"layout","data-rmg-skel-has-extras":d.length?"true":void 0,children:[jsx("div",{"data-rmg-skel-node":b,className:a$4.sliderSkeletonRow,"data-rmg-skel-part":"row",style:{...M,...y||{},display:"flex",flexDirection:f==="row"?"row":"column",...q?{justifyContent:"center"}:null},children:Array.from({length:J}).map((T,I)=>{let A=P&&I===0,Se=P?I-1:I,z=A?{item:{kind:"rect",style:{width:"100%",height:"100%",backgroundColor:"transparent"},shimmer:{enabled:false}},itemWrapStyle:{width:"var(--rmg-slider-center-first-spacer-width, 0px)",height:0}}:Ie(N,Se),E=z.itemWrapStyle,{outerStyle:$,innerStyle:Ce}=an(E);return jsx("div",{className:a$4.sliderSkeletonItem,"data-rmg-skel-slot":I+1,"data-rmg-skel-visible-count":B,"data-rmg-skel-center-first-spacer":A?"true":void 0,style:{boxSizing:"border-box",...E?He(E):null,...$??null,...f==="col"?{flex:"0 0 auto",height:"auto"}:Re?{height:"100%"}:{alignSelf:"flex-start",height:"auto"},minWidth:0,minHeight:0},children:jsx("div",{className:a$4.sliderSkeletonItemInner,style:{...Ce??null,...f==="row"&&!Re?{height:"auto"}:null},children:jsx(Le,{node:z.item,breakpointMap:s,activeDotIndex:n$1})})},`rmg-slider-skel-${I}`)})}),d.length?jsx("div",{className:a$4.sliderSkeletonExtras,"data-rmg-skel-part":"extras",children:d.map((T,I)=>jsx(Le,{node:T,breakpointMap:s,activeDotIndex:n$1},`rmg-slider-skel-extra-${I}`))}):null]}),H.length?jsx("div",{className:a$4.sliderSkeletonOverlays,"data-rmg-skel-part":"overlays",children:H.map((T,I)=>jsx(Le,{node:T,breakpointMap:s,activeDotIndex:n$1},`rmg-slider-skel-overlay-${I}`))}):null]})}function ze(e){return !!e&&typeof e=="object"&&!("kind"in e)&&"layout"in e&&e.layout?.kind==="slider"}function jt(e){return !!e&&typeof e=="object"&&"kind"in e&&e.kind==="slider"}function kn(e){if(ze(e))return e;let{mode:t,centering:n,className:r,visibleCount:i,backgroundColor:o,radius:l,shimmer:a,...c}=e;return {mode:t,centering:n,className:r,visibleCount:i,backgroundColor:o,radius:l,shimmer:a,layout:c}}function qt(e){if(!e||typeof e!="object"||Array.isArray(e))return {};let t={};for(let[n,r]of Object.entries(e))r!=null&&(typeof r=="string"||typeof r=="number"||typeof r=="boolean")&&(t[n]=r);return t}function de(e,t=[]){return !e||typeof e!="object"?t:e.kind==="sliderDots"?(t.push({activeStyle:qt(e.activeStyle),inactiveStyle:qt(e.inactiveStyle)}),t):e.kind==="slider"?(de(e.item,t),e.children?.forEach?.(n=>de(n,t)),e.overlays?.forEach?.(n=>de(n,t)),e.slots?.forEach?.(n=>de(n.item,t)),t):(e.children?.forEach?.(n=>de(n,t)),t)}function je(e,t,n){return i(e,t,n).reduce((r,i)=>Math.max(r,i.count),0)}function yn(e,t){let n=Math.max(0,Math.floor(e));return n<=0?[]:n===1?t>=2?[2]:[]:Array.from({length:Math.min(t,n+1)},(r,i)=>i+1)}function zt(e){return `[data-rmg-scope="${e}"] > [data-rmg-scope-shell="true"]`}function qe(e){typeof document>"u"||document.querySelectorAll("style[data-rmg-slider-restore-style]").forEach(t=>{t.getAttribute("data-rmg-slider-restore-style")===e&&t.remove();});}function xn(e,t){if(t==null||!Number.isFinite(t)||t<=0)return "";let n=Math.round((t+Number.EPSILON)*1e3)/1e3;return `${zt(e)}{--rmg-slider-initial-height:${n}px!important;--rmg-slider-row-height:${n}px!important;}`}function Kt(e){let t=e.skeletonSpec.layout;if(!t)return "";let n=e.skeletonSpec.mode??"fit",r=zt(e.scopeId),i$1=i(e.responsiveCount,e.fallbackCount,e.breakpointMap),o=Ot(t,e.breakpointMap),l=At(t,e.breakpointMap),a=$t(t,e.breakpointMap),c=Ft(t,e.breakpointMap),u=S=>{let g=e.fallbackCount;for(let v of i$1)S>=v.minWidth&&(g=v.count);return Math.max(1,g|0)},s=(S,g)=>{let v=Mt(t,S,n,g,e.breakpointMap),M=_t(t,S,n,g,e.breakpointMap),W=Pt(t,g,e.breakpointMap),O=e.centerFirstSpacer?Tt(t,S,n,g,e.breakpointMap):null;if(!v&&!M&&!W&&!O)return "";let N=[v?`--rmg-slider-initial-height:${v};`:"",M?`--rmg-slider-row-height:${M};`:"",W?`--rmg-slider-extras-height:${W};`:"",e.centerFirstSpacer?`--rmg-slider-center-first-spacer-width:${O??"0px"};`:""].join("");return `${r}{${N}}`};return Array.from(new Set([...i$1.map(S=>S.minWidth),...a,...l,...o,...c])).sort((S,g)=>S-g).map(S=>{let g=s(u(S),S);return g?S<=0?g:`@media (min-width:${S}px){${g}}`:""}).filter(Boolean).join(`
|
|
39
|
-
`)}function Ke({layout:e,children:t,breakpoints:n$1,className:r,style:i,shellClassName:o,shellStyle:l$1,contentClassName:a$4,contentStyle:c,backgroundColor:u,radius:s,shimmer:p,disableShimmer:S,ariaLabel:g,ready:v,enabled:M,force:W,timing:O,restore:N}){let b=C.useMemo(()=>({...a,...n$1??{}}),[n$1]),y=C.useMemo(()=>a$1("skel_",{layout:e,breakpoints:b,backgroundColor:u,radius:s,shimmer:p,disableShimmer:S}),[e,b,u,s,p,S]),B=C.useMemo(()=>jt(e)||ze(e)?kn(e):null,[e]),f=B?.layout?.kind==="slider"?B.layout:null,d=N?.kind==="slider"?N:null,H=d?.slider?.handleRef??null,q=d&&d.enabled!==false&&d.slider?.handleRef?[d.key??"",d.itemCount,JSON.stringify(d.visibleCount??null),d.loop===true?"loop":"no-loop",d.activeSlotOffset??""].join(":"):"",P=q!=="",[Re,J]=C.useState(()=>!P),[U,T]=C.useState(null),[I,A]=C.useState(null),Se=v===true&&(!P||Re),z=!!f,E=d?.visibleCount??(jt(e)?e.visibleCount:void 0)??(ze(e)?e.visibleCount:void 0)??(typeof f?.count=="number"?f.count:void 0),$=typeof E=="number"?Math.max(1,E|0):typeof f?.count=="number"?Math.max(1,f.count|0):1,Ce=!!f&&B?.centering==="first"&&(B.mode??"fit")==="peek",K=Ce&&je(E,$,b)>1,me=Array.isArray(f?.slots)&&f.slots.length>0?f.slots.length:Math.max(d?.itemCount??0,typeof f?.count=="number"?f.count:0,$),fe=f?Math.max(12,K?me+1:me,K?je(E,$,b)+1:je(E,$,b)):0,w=C.useMemo(()=>{if(!d||d.enabled===false||!z)return null;let x=Math.max(0,Math.floor(d.itemCount));return x<=0||me<=0?null:{enabled:true,storageKeyId:typeof d.key=="string"&&d.key.trim()?d.key.trim():y,ttlMs:typeof d.ttlMs=="number"&&Number.isFinite(d.ttlMs)?Math.max(0,d.ttlMs):ut,slideCount:x,skeletonSlotCount:Math.max(x,me)}},[z,y,d?.enabled,d?.itemCount,d?.key,d?.ttlMs,me]),G=C.useMemo(()=>f?a$2({scopeId:y,responsiveCount:E,fallbackCount:$,breakpointMap:b,maxSlots:fe,visibleSlotsForCount:K?yn:void 0,slotOrderForCount:U==null||!w?.enabled||!d?void 0:x=>gt({activeIndex:U,visibleCount:x,slotCount:w.skeletonSlotCount,loop:d.loop===true,activeSlotOffset:d.activeSlotOffset??(typeof f.initialHeightSlot=="number"?f.initialHeightSlot:0)})}):{cssText:"",ssrBaseCount:$},[b,y,K,$,f,fe,d,U,w,E]),Ge=C.useMemo(()=>!f||!B?"":Kt({scopeId:y,skeletonSpec:B,responsiveCount:E,fallbackCount:G.ssrBaseCount,breakpointMap:b,centerFirstSpacer:K}),[b,y,K,G.ssrBaseCount,f,B,E]),Ye=C.useMemo(()=>!w?.enabled||!d||!f?"":ht({scopeId:y,storageKeyId:w.storageKeyId,ttlMs:w.ttlMs,slideCount:w.slideCount,skeletonSlotCount:w.skeletonSlotCount,maxSlots:fe,loop:d.loop===true,activeSlotOffset:d.activeSlotOffset??(typeof f.initialHeightSlot=="number"?f.initialHeightSlot:0),responsiveCount:E,fallbackCount:G.ssrBaseCount,breakpointMap:b,dotStyles:de(f)}),[b,y,G.ssrBaseCount,f,fe,d?.activeSlotOffset,d?.enabled,d?.loop,w,E]),Ve=C.useMemo(()=>xn(y,I),[y,I]),Pe=C.useRef(null);C.useLayoutEffect(()=>{J(!P),T(null),A(null);},[P,q]),C.useLayoutEffect(()=>{if(!w?.enabled||!H||typeof window>"u")return;let x=null,F=false,pe=()=>{if(F)return;let Y=H.current;if(!Y){x=window.requestAnimationFrame(pe);return}let D=ft(w,window,{requireNavigationRestore:false});if(!D){qe(y),T(null),A(null),J(true);return}T(D.index),A(D.heightPx??null),qe(y);let _e=[w.storageKeyId,D.timestamp,D.index,D.heightPx??""].join(":");if(Pe.current!==_e&&Y.setIndex(D.index,"instant"),Pe.current===_e){J(true);return}if(!Y.isReady()){x=window.requestAnimationFrame(pe);return}if(!H.current?.isReady()){x=window.requestAnimationFrame(pe);return}Pe.current=_e,x=window.requestAnimationFrame(()=>{x=null,!F&&(H.current?.setIndex(D.index,"instant"),x=window.requestAnimationFrame(()=>{x=null,!F&&(x=window.requestAnimationFrame(()=>{x=null,F||J(true);}));}));});};return pe(),()=>{F=true,x!=null&&window.cancelAnimationFrame(x),qe(y);}},[y,H,w]),C.useEffect(()=>{if(!w?.enabled||!H||typeof window>"u")return;let x=()=>{let F=H.current;if(!F)return;let Y=F.getViewportNode()?.getBoundingClientRect().height;pt(w,{index:F.getIndex(),slideCount:w.slideCount,skeletonSlotCount:w.skeletonSlotCount,heightPx:Y&&Y>0?Y:void 0});};return window.addEventListener("pagehide",x),window.addEventListener("beforeunload",x),()=>{x(),window.removeEventListener("pagehide",x),window.removeEventListener("beforeunload",x);}},[H,w]);let Gt={
|
|
39
|
+
`)}function Ke({layout:e,children:t,breakpoints:n$1,className:r,style:i,shellClassName:o,shellStyle:l$1,contentClassName:a$4,contentStyle:c,backgroundColor:u,radius:s,shimmer:p,disableShimmer:S,ariaLabel:g,ready:v,enabled:M,force:W,timing:O,restore:N}){let b=C.useMemo(()=>({...a,...n$1??{}}),[n$1]),y=C.useMemo(()=>a$1("skel_",{layout:e,breakpoints:b,backgroundColor:u,radius:s,shimmer:p,disableShimmer:S}),[e,b,u,s,p,S]),B=C.useMemo(()=>jt(e)||ze(e)?kn(e):null,[e]),f=B?.layout?.kind==="slider"?B.layout:null,d=N?.kind==="slider"?N:null,H=d?.slider?.handleRef??null,q=d&&d.enabled!==false&&d.slider?.handleRef?[d.key??"",d.itemCount,JSON.stringify(d.visibleCount??null),d.loop===true?"loop":"no-loop",d.activeSlotOffset??""].join(":"):"",P=q!=="",[Re,J]=C.useState(()=>!P),[U,T]=C.useState(null),[I,A]=C.useState(null),Se=v===true&&(!P||Re),z=!!f,E=d?.visibleCount??(jt(e)?e.visibleCount:void 0)??(ze(e)?e.visibleCount:void 0)??(typeof f?.count=="number"?f.count:void 0),$=typeof E=="number"?Math.max(1,E|0):typeof f?.count=="number"?Math.max(1,f.count|0):1,Ce=!!f&&B?.centering==="first"&&(B.mode??"fit")==="peek",K=Ce&&je(E,$,b)>1,me=Array.isArray(f?.slots)&&f.slots.length>0?f.slots.length:Math.max(d?.itemCount??0,typeof f?.count=="number"?f.count:0,$),fe=f?Math.max(12,K?me+1:me,K?je(E,$,b)+1:je(E,$,b)):0,w=C.useMemo(()=>{if(!d||d.enabled===false||!z)return null;let x=Math.max(0,Math.floor(d.itemCount));return x<=0||me<=0?null:{enabled:true,storageKeyId:typeof d.key=="string"&&d.key.trim()?d.key.trim():y,ttlMs:typeof d.ttlMs=="number"&&Number.isFinite(d.ttlMs)?Math.max(0,d.ttlMs):ut,slideCount:x,skeletonSlotCount:Math.max(x,me)}},[z,y,d?.enabled,d?.itemCount,d?.key,d?.ttlMs,me]),G=C.useMemo(()=>f?a$2({scopeId:y,responsiveCount:E,fallbackCount:$,breakpointMap:b,maxSlots:fe,visibleSlotsForCount:K?yn:void 0,slotOrderForCount:U==null||!w?.enabled||!d?void 0:x=>gt({activeIndex:U,visibleCount:x,slotCount:w.skeletonSlotCount,loop:d.loop===true,activeSlotOffset:d.activeSlotOffset??(typeof f.initialHeightSlot=="number"?f.initialHeightSlot:0)})}):{cssText:"",ssrBaseCount:$},[b,y,K,$,f,fe,d,U,w,E]),Ge=C.useMemo(()=>!f||!B?"":Kt({scopeId:y,skeletonSpec:B,responsiveCount:E,fallbackCount:G.ssrBaseCount,breakpointMap:b,centerFirstSpacer:K}),[b,y,K,G.ssrBaseCount,f,B,E]),Ye=C.useMemo(()=>!w?.enabled||!d||!f?"":ht({scopeId:y,storageKeyId:w.storageKeyId,ttlMs:w.ttlMs,slideCount:w.slideCount,skeletonSlotCount:w.skeletonSlotCount,maxSlots:fe,loop:d.loop===true,activeSlotOffset:d.activeSlotOffset??(typeof f.initialHeightSlot=="number"?f.initialHeightSlot:0),responsiveCount:E,fallbackCount:G.ssrBaseCount,breakpointMap:b,dotStyles:de(f)}),[b,y,G.ssrBaseCount,f,fe,d?.activeSlotOffset,d?.enabled,d?.loop,w,E]),Ve=C.useMemo(()=>xn(y,I),[y,I]),Pe=C.useRef(null);C.useLayoutEffect(()=>{J(!P),T(null),A(null);},[P,q]),C.useLayoutEffect(()=>{if(!w?.enabled||!H||typeof window>"u")return;let x=null,F=false,pe=()=>{if(F)return;let Y=H.current;if(!Y){x=window.requestAnimationFrame(pe);return}let D=ft(w,window,{requireNavigationRestore:false});if(!D){qe(y),T(null),A(null),J(true);return}T(D.index),A(D.heightPx??null),qe(y);let _e=[w.storageKeyId,D.timestamp,D.index,D.heightPx??""].join(":");if(Pe.current!==_e&&Y.setIndex(D.index,"instant"),Pe.current===_e){J(true);return}if(!Y.isReady()){x=window.requestAnimationFrame(pe);return}if(!H.current?.isReady()){x=window.requestAnimationFrame(pe);return}Pe.current=_e,x=window.requestAnimationFrame(()=>{x=null,!F&&(H.current?.setIndex(D.index,"instant"),x=window.requestAnimationFrame(()=>{x=null,!F&&(x=window.requestAnimationFrame(()=>{x=null,F||J(true);}));}));});};return pe(),()=>{F=true,x!=null&&window.cancelAnimationFrame(x),qe(y);}},[y,H,w]),C.useEffect(()=>{if(!w?.enabled||!H||typeof window>"u")return;let x=()=>{let F=H.current;if(!F)return;let Y=F.getViewportNode()?.getBoundingClientRect().height;pt(w,{index:F.getIndex(),slideCount:w.slideCount,skeletonSlotCount:w.skeletonSlotCount,heightPx:Y&&Y>0?Y:void 0});};return window.addEventListener("pagehide",x),window.addEventListener("beforeunload",x),()=>{x(),window.removeEventListener("pagehide",x),window.removeEventListener("beforeunload",x);}},[H,w]);let Gt={minHeight:"var(--rmg-slider-initial-height, var(--rmg-slider-height, 320px))",position:"relative",width:"100%",minWidth:0,overflow:"hidden",...i,...u?{"--rmg-skel-bg":u}:null,...s!=null?{"--rmg-skel-radius":l(s)}:null,...S?null:n(p)},Te=f&&B?jsxs("div",{"data-rmg-skeleton-scope":y,className:r,style:Gt,"aria-hidden":g?void 0:true,"aria-label":g,role:g?"status":void 0,"aria-live":g?"polite":void 0,children:[G.cssText||Ge||Ve?jsx("style",{dangerouslySetInnerHTML:{__html:[Ge,Ve,G.cssText].filter(Boolean).join(`
|
|
40
40
|
`)}}):null,jsx(Dt,{count:G.ssrBaseCount,maxSlots:fe,activeDotIndex:U??void 0,spec:B,breakpoints:b,centerFirst:Ce,hasLeadingSpacer:K,responsiveCssScopeSelector:`[data-rmg-scope="${y}"]`}),Ye?jsx("script",{dangerouslySetInnerHTML:{__html:Ye}}):null]}):null,Xe={containerType:"inline-size",width:"100%"},Yt=f?{minHeight:"var(--rmg-slider-initial-height, var(--rmg-slider-height, 320px))"}:null;return Te?t===void 0?jsx("div",{"data-rmg-scope":y,style:Xe,children:jsx("div",{"data-rmg-scope-shell":"true",style:{minHeight:"var(--rmg-slider-initial-height, var(--rmg-slider-height, 320px))"},children:Te})}):jsx("div",{"data-rmg-scope":y,style:Xe,children:jsx(a$3,{skeletonNode:Te,ready:Se,enabled:M,force:W,timing:O,shellClassName:o,shellStyle:l$1,loadingShellStyle:Yt,contentClassName:a$4,contentStyle:c,contentOwnsWrapperLayout:true,shellDataAttributes:{"data-rmg-scope-shell":"true"},children:t})}):null}export{Ke as Skeleton,Ke as SliderSkeleton,Kt as buildScopedInitialHeightCss,Ke as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-motion-gallery",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.29",
|
|
4
4
|
"description": "Composable React media gallery primitives for sliders, grids, masonry, fullscreen, video, zoom/pan, and stable skeleton loading",
|
|
5
5
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
6
6
|
"author": "React Motion Gallery",
|
package/dist/chunk-4BTS6IIA.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-HK2DPKES.mjs';import {jsx}from'react/jsx-runtime';var h={skelRect:"ge",skelSquare:"ce",skelCircle:"pe",skelGroup:"he",skelRow:"fe",skelCol:"be",skelStack:"ve",skelText:"B",skelTextLine:"ue",skelTile:"ye",skelCardShimmer:"p",rmgSharedSkeletonShimmer:"h",skelShimmer:"C"};var R="68%",W="__NODE_SEL__",se="(font: -apple-system-body) and (-webkit-hyphens: none)";function ae(e){let n=Math.max(1,Math.trunc(e.lines??1)),t=Math.max(0,e.barHeight*e.lineHeight),o=Math.min(Math.max(0,e.barHeight),t),r=Math.max(t-o,0);return {lines:n,lineBoxHeight:t,barHeight:o,leading:r,paddingBlock:r/2,rowGap:r,totalHeight:t*n}}function L(e){let n=Math.max(e.barHeight,Math.floor(e.lineBoxHeight)),t=Math.max(n-e.barHeight,0);return {...e,lineBoxHeight:n,leading:t,paddingBlock:t/2,rowGap:t,totalHeight:n*e.lines}}function v(e,n=a$1){return !e||typeof e!="object"||Array.isArray(e)?false:Object.keys(e).some(t=>S(t,n)!=null)}function k(e,n){let t=Number.isFinite(e)?Math.trunc(e):n;return Math.max(1,t)}function C(e,n){let t=Number.isFinite(e)?Number(e):n;return Math.max(0,t)}function w(e,n){let t=Number.isFinite(e)?Number(e):n;return Math.max(0,t)}function S(e,n=a$1){let t=n[e];if(Number.isFinite(t))return Math.max(0,t);let o=Number(e);return Number.isFinite(o)?Math.max(0,o):null}function c(e){return typeof e=="number"?`${e}px`:e}function b(e){return Array.isArray(e)?e.map(c):c(e)}function le(e){let{barWidths:n,lineCount:t,finalBarWidthFallback:o}=e;return t<=0?[o]:n.length>=t?n.slice(0,t):Array.from({length:t},(r,i)=>i<n.length?n[i]:i===t-1?o:"100%")}function z(e){let n=ce(e.lines,1,e.minWidth,e.breakpointMap),t=ge(e.barHeight,typeof e.barHeight=="number"?e.barHeight:0,e.minWidth,e.breakpointMap),o=Se(e.lineHeight,typeof e.lineHeight=="number"?e.lineHeight:1,e.minWidth,e.breakpointMap),r=ke(e.lastBarWidth,R,e.minWidth,e.breakpointMap),i=xe(e.barWidth,"100%",e.minWidth,e.breakpointMap),s=e.barWidth==null?Array.from({length:n},(l,u)=>u===n-1?r:"100%"):Array.isArray(i)?i:Array.from({length:n},()=>i);return {lineCount:n,barWidths:le({barWidths:s,lineCount:n,finalBarWidthFallback:e.barWidth==null?r:"100%"}),metrics:ae({barHeight:t,lineHeight:o,lines:n})}}function ue(e,n){return e.lineCount===n.lineCount&&e.metrics.totalHeight===n.metrics.totalHeight&&e.metrics.barHeight===n.metrics.barHeight&&e.metrics.paddingBlock===n.metrics.paddingBlock&&e.metrics.rowGap===n.metrics.rowGap&&e.barWidths.length===n.barWidths.length&&e.barWidths.every((t,o)=>t===n.barWidths[o])}function de(e,n=a$1){return v(e,n)}function pe(e,n=a$1){return v(e,n)}function he(e,n=a$1){return v(e,n)}function me(e,n=a$1){return v(e,n)}function fe(e,n=a$1){return v(e,n)}function A(e,n=1,t=a$1){if(!de(e,t))return [{minWidth:0,lines:k(typeof e=="number"?e:void 0,n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null?null:{minWidth:s,lines:k(typeof i=="number"?i:Number(i),n)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.lines=i.lines:r.push(i),r},[]);return o.length===0?[{minWidth:0,lines:k(void 0,n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,lines:k(void 0,n)}),o)}function E(e,n=0,t=a$1){if(!pe(e,t))return [{minWidth:0,barHeight:C(typeof e=="number"?e:void 0,n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null?null:{minWidth:s,barHeight:C(typeof i=="number"?i:Number(i),n)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.barHeight=i.barHeight:r.push(i),r},[]);return o.length===0?[{minWidth:0,barHeight:C(void 0,n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,barHeight:o[0].barHeight}),o)}function G(e,n=1,t=a$1){if(!he(e,t))return [{minWidth:0,lineHeight:w(typeof e=="number"?e:void 0,n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null?null:{minWidth:s,lineHeight:w(typeof i=="number"?i:Number(i),n)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.lineHeight=i.lineHeight:r.push(i),r},[]);return o.length===0?[{minWidth:0,lineHeight:w(void 0,n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,lineHeight:o[0].lineHeight}),o)}function ce(e,n=1,t=0,o=a$1){let r=A(e,n,o),i=r[0]?.lines??k(void 0,n);for(let s of r)t>=s.minWidth&&(i=s.lines);return i}function ge(e,n=0,t=0,o=a$1){let r=E(e,n,o),i=r[0]?.barHeight??C(void 0,n);for(let s of r)t>=s.minWidth&&(i=s.barHeight);return i}function Se(e,n=1,t=0,o=a$1){let r=G(e,n,o),i=r[0]?.lineHeight??w(void 0,n);for(let s of r)t>=s.minWidth&&(i=s.lineHeight);return i}function xe(e,n="100%",t=0,o=a$1){let r=O(e,n,o),i=r[0]?.barWidth??b(n);for(let s of r)t>=s.minWidth&&(i=s.barWidth);return i}function O(e,n="100%",t=a$1){if(!me(e,t))return [{minWidth:0,barWidth:b(e??n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null||i==null?null:{minWidth:s,barWidth:b(i)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.barWidth=i.barWidth:r.push(i),r},[]);return o.length===0?[{minWidth:0,barWidth:b(n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,barWidth:b(n)}),o)}function D(e,n=R,t=a$1){if(!fe(e,t))return [{minWidth:0,lastBarWidth:c(e??n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null||i==null?null:{minWidth:s,lastBarWidth:c(i)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.lastBarWidth=i.lastBarWidth:r.push(i),r},[]);return o.length===0?[{minWidth:0,lastBarWidth:c(n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,lastBarWidth:c(n)}),o)}function ke(e,n=R,t=0,o=a$1){let r=D(e,n,o),i=r[0]?.lastBarWidth??c(n);for(let s of r)t>=s.minWidth&&(i=s.lastBarWidth);return i}function be(e){let n=new Set,t=e.breakpointMap??a$1;for(let r of E(e.barHeight,typeof e.barHeight=="number"?e.barHeight:0,t))n.add(r.minWidth);for(let r of A(e.lines,1,t))n.add(r.minWidth);for(let r of G(e.lineHeight,typeof e.lineHeight=="number"?e.lineHeight:1,t))n.add(r.minWidth);let o=e.barWidth!=null?O(e.barWidth,"100%",t):D(e.lastBarWidth,R,t);for(let r of o)n.add(r.minWidth);return Array.from(n).sort((r,i)=>r-i)}function H(e){let n=e.breakpointMap??a$1,t=e.responsiveBy??"viewport",r=be({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,breakpointMap:n}).reduce((l,u)=>{let p=z({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,minWidth:u,breakpointMap:n}),m=l[l.length-1];return m&&ue(m.state,p)||l.push({minWidth:u,state:p}),l},[]),i=r[0]?.state??z({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,minWidth:0,breakpointMap:n}),s=r.reduce((l,u)=>Math.max(l,u.state.lineCount),i.lineCount);return {baseState:i,states:r.length?r:[{minWidth:0,state:i}],maxLines:s,usesResponsiveBarCss:r.length>1,baseLines:i.lineCount,baseLastBarWidth:i.barWidths[i.lineCount-1]??R,metrics:i.metrics,responsiveBy:t}}function F(e){let n="renderState"in e?e.renderState:H({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,responsiveBy:e.responsiveBy,breakpointMap:e.breakpointMap});if(!n.usesResponsiveBarCss)return [];let t=e.selectorPlaceholder??W,o=e.fitContent===true;return n.states.map(({minWidth:r,state:i})=>{let s=`${t} [data-rmg-skel-text-line="true"]`,l=`${s}:nth-child(-n+${i.lineCount})`,u=i.lineCount<n.maxLines?`${s}:nth-child(n+${i.lineCount+1})`:null,p=i.barWidths.map((g,y)=>o?`${s}:nth-child(${y+1}){width:${g} !important;max-width:${g} !important;}`:`${s}:nth-child(${y+1}){max-width:${g} !important;}`),m=o?`${l}{display:block !important;max-width:100% !important;}`:`${l}{display:block !important;width:100% !important;max-width:100% !important;}`,x=L(i.metrics);return {minWidth:r,query:n.responsiveBy,css:[`${t}{height:${i.metrics.totalHeight}px !important;padding-block:${i.metrics.paddingBlock}px !important;row-gap:${i.metrics.rowGap}px !important;}`,`@supports ${se}{${t}{height:${x.totalHeight}px !important;padding-block:${x.paddingBlock}px !important;row-gap:${x.rowGap}px !important;}}`,`${s}{display:none !important;height:${i.metrics.barHeight}px !important;}`,m,...u?[`${u}{display:none !important;}`]:[],...p].join("")}})}function V(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}function Re(e,n=a$1){let t=n[e];if(Number.isFinite(t))return Math.max(0,t);let o=Number(e);return Number.isFinite(o)?Math.max(0,o):null}function B(e,n=a$1){if(!V(e))return {baseStyle:e,rules:[]};let t={},o=new Map;for(let[r,i]of Object.entries(e)){let s=Re(r,n);if(s!=null&&V(i)){o.set(s,{...o.get(s)??{},...i});continue}t[r]=i;}return {baseStyle:Object.keys(t).length?t:void 0,rules:Array.from(o.entries()).sort((r,i)=>r[0]-i[0]).map(([r,i])=>({minWidth:r,style:i}))}}function P(e,n,t=a$1){let{baseStyle:o,rules:r}=B(e,t),i={...o??{}};for(let s of r){if(s.minWidth>n)break;Object.assign(i,s.style);}return Object.keys(i).length?i:void 0}function J(e,n=a$1){let{baseStyle:t,rules:o}=B(e,n);if(!t)return;if(!o.length)return t;let r=new Set;for(let s of o)for(let l of Object.keys(s.style))r.add(l);let i={};for(let[s,l]of Object.entries(t))r.has(s)||(i[s]=l);return Object.keys(i).length?i:void 0}function Y(e,n,t=a$1){let{rules:o}=B(e,t);for(let r of o)r.minWidth>0&&n.add(r.minWidth);}function ee(e){let n=e.breakpointMap??a$1,t=e.selector??W,o=[],{rules:r}=B(e.value,n);if(!r.length)return [];let i=new Set([0]);for(let s of r)i.add(s.minWidth);for(let s of Array.from(i).sort((l,u)=>l-u)){let l=P(e.value,s,n),u=l?e.serialize(l):"";u&&o.push({minWidth:s,css:`${t}{${u}}`,raw:true});}return o}function a(e){if(e!=null)return typeof e=="number"?`${e}px`:e}function ne(e){if(!e)return {};let n=a(e.margin),t=a(e.marginTop),o=a(e.marginRight),r=a(e.marginBottom),i=a(e.marginLeft),s={};return n!=null&&(s.margin=n),t!=null&&(s.marginTop=t),o!=null&&(s.marginRight=o),r!=null&&(s.marginBottom=r),i!=null&&(s.marginLeft=i),s}function _(e,n){n&&(n.flex!=null&&(e.flex=n.flex),n.flexGrow!=null&&(e.flexGrow=n.flexGrow),n.flexShrink!=null&&(e.flexShrink=n.flexShrink),n.flexBasis!=null&&(e.flexBasis=a(n.flexBasis)),n.order!=null&&(e.order=n.order),n.alignSelf&&(e.alignSelf=n.alignSelf),n.boxSizing!=null&&(e.boxSizing=n.boxSizing));}function j(e,n){n&&(n.flex!=null&&e.push(`flex:${n.flex};`),n.flexGrow!=null&&e.push(`flex-grow:${n.flexGrow};`),n.flexShrink!=null&&e.push(`flex-shrink:${n.flexShrink};`),n.flexBasis!=null&&e.push(`flex-basis:${a(n.flexBasis)};`),n.order!=null&&e.push(`order:${n.order};`),n.alignSelf&&e.push(`align-self:${n.alignSelf};`),n.boxSizing!=null&&e.push(`box-sizing:${n.boxSizing};`));}function te(e,n){let t={};e?.aspectRatio!=null&&(t.aspectRatio=e.aspectRatio);let o=a(e?.width),r=a(e?.minWidth),i=a(e?.maxWidth),s=a(e?.height),l=a(e?.minHeight),u=a(e?.maxHeight);return o!=null&&(t.inlineSize=o,t.width=o),r!=null&&(t.minInlineSize=r,t.minWidth=r),i!=null&&(t.maxInlineSize=i,t.maxWidth=i),s!=null&&(t.height=s),l!=null&&(t.minHeight=l),u!=null&&(t.maxHeight=u),e?.aspectRatio!=null&&e?.height==null&&(t.height="auto"),e?.aspectRatio!=null&&e?.width==null&&e?.height==null&&(t.inlineSize="100%",t.width="100%",t.height="auto"),e?.backgroundColor&&(t["--rmg-skel-bg"]=e.backgroundColor),e?.borderRadius!=null&&(t["--rmg-skel-radius"]=a(e.borderRadius)),e?.overflow!=null&&(t.overflow=e.overflow),_(t,e),e?.scale!=null&&(t.transform=`scale(${e.scale})`),Object.assign(t,Te(n)),t}function I(e,n){let t=a(n?.margin),o=a(n?.marginTop),r=a(n?.marginRight),i=a(n?.marginBottom),s=a(n?.marginLeft);t!=null&&e.push(`margin:${t};`),o!=null&&e.push(`margin-top:${o};`),r!=null&&e.push(`margin-right:${r};`),i!=null&&e.push(`margin-bottom:${i};`),s!=null&&e.push(`margin-left:${s};`);}function We(e){if(!e)return "";let n=[],t=a(e.width),o=a(e.minWidth),r=a(e.maxWidth),i=a(e.height),s=a(e.minHeight),l=a(e.maxHeight);return e.aspectRatio!=null&&n.push(`aspect-ratio:${String(e.aspectRatio)};`),t!=null&&(n.push(`inline-size:${t};`),n.push(`width:${t};`)),o!=null&&(n.push(`min-inline-size:${o};`),n.push(`min-width:${o};`)),r!=null&&(n.push(`max-inline-size:${r};`),n.push(`max-width:${r};`)),i!=null&&n.push(`height:${i};`),s!=null&&n.push(`min-height:${s};`),l!=null&&n.push(`max-height:${l};`),e.aspectRatio!=null&&e.height==null&&n.push("height:auto;"),e.aspectRatio!=null&&e.width==null&&e.height==null&&(n.push("inline-size:100%;"),n.push("width:100%;"),n.push("height:auto;")),e.backgroundColor&&n.push(`--rmg-skel-bg:${e.backgroundColor};`),e.borderRadius!=null&&n.push(`--rmg-skel-radius:${a(e.borderRadius)};`),e.overflow!=null&&n.push(`overflow:${e.overflow};`),j(n,e),e.scale!=null&&n.push(`transform:scale(${e.scale});`),I(n,e),n.join("")}function ve(e){if(!e)return "";let n=[],t=a(e.width),o=a(e.minWidth),r=a(e.maxWidth);return t!=null&&(n.push(`inline-size:${t};`),n.push(`width:${t};`)),o!=null&&(n.push(`min-inline-size:${o};`),n.push(`min-width:${o};`)),r!=null&&(n.push(`max-inline-size:${r};`),n.push(`max-width:${r};`)),j(n,e),e.scale!=null&&n.push(`transform:scale(${e.scale});`),I(n,e),n.join("")}function Be(e){if(!e)return "";let n=[];return e.backgroundColor&&n.push(`--rmg-skel-bg:${e.backgroundColor};`),e.borderRadius!=null&&n.push(`--rmg-skel-radius:${a(e.borderRadius)};`),n.join("")}function Te(e,n){let t={},o=n?.enabledVarName??"--rmg-skel-shimmer-enabled";return e?.enabled===false&&(t[o]="0"),e?.durationMs!=null&&(t["--rmg-skel-shimmer-duration"]=`${e.durationMs}ms`),e?.angleDeg!=null&&(t["--rmg-skel-shimmer-angle"]=`${e.angleDeg}deg`),e?.opacity!=null&&(t["--rmg-skel-shimmer-opacity"]=String(e.opacity)),e?.blurPx!=null&&(t["--rmg-skel-shimmer-blur"]=`${e.blurPx}px`,t["--rmg-skel-shimmer-filter"]=e.blurPx>0?`blur(${e.blurPx}px)`:"none"),e?.timing&&(t["--rmg-skel-shimmer-timing"]=e.timing),e?.c1&&(t["--rmg-skel-shimmer-c1"]=e.c1),e?.c2&&(t["--rmg-skel-shimmer-c2"]=e.c2),e?.c3&&(t["--rmg-skel-shimmer-c3"]=e.c3),t}function q(e,n){let t={};n!=null&&(t.height=`${n}px`);let o=a(e?.width),r=a(e?.minWidth),i=a(e?.maxWidth);return o!=null&&(t.inlineSize=o,t.width=o),r!=null&&(t.minInlineSize=r,t.minWidth=r),i!=null&&(t.maxInlineSize=i,t.maxWidth=i),_(t,e),e?.scale!=null&&(t.transform=`scale(${e.scale})`),t}function N(e){return typeof e=="string"&&e.trim()==="max-content"}function Ce(e){return !e||typeof e!="object"?false:N(e.width)?true:Object.values(e).some(t=>!!t&&typeof t=="object"&&N(t.width))}function Ae(e){let n=te(e,void 0);return delete n["--rmg-skel-bg"],e?.backgroundColor!=null&&(n.backgroundColor=e.backgroundColor),e?.padding!=null&&(n.padding=a(e.padding)),e?.border!=null&&(n.border=e.border),e?.boxShadow!=null&&(n.boxShadow=e.boxShadow),e?.borderRadius!=null?(n.borderRadius=a(e.borderRadius),n.overflow=e?.overflow??"hidden"):e?.overflow!=null&&(n.overflow=e.overflow),n.boxSizing="border-box",n}function K(e){let n={};return e&&(e.position!=null&&(n.position=e.position),e.inset!=null&&(n.inset=a(e.inset)),e.insetBlock!=null&&(n.insetBlock=a(e.insetBlock)),e.insetInline!=null&&(n.insetInline=a(e.insetInline)),e.top!=null&&(n.top=a(e.top)),e.right!=null&&(n.right=a(e.right)),e.bottom!=null&&(n.bottom=a(e.bottom)),e.left!=null&&(n.left=a(e.left)),e.zIndex!=null&&(n.zIndex=e.zIndex),e.display!=null&&(n.display=e.display),e.flexDirection!=null&&(n.flexDirection=e.flexDirection),e.gap!=null&&(n.gap=a(e.gap)),e.rowGap!=null&&(n.rowGap=a(e.rowGap)),e.columnGap!=null&&(n.columnGap=a(e.columnGap)),e.padding!=null&&(n.padding=a(e.padding)),(e.align??e.alignItems)&&(n.alignItems=e.alignItems??e.align),e.alignContent!=null&&(n.alignContent=e.alignContent),(e.justify??e.justifyContent)&&(n.justifyContent=e.justifyContent??e.justify),e.aspectRatio!=null&&(n.aspectRatio=e.aspectRatio),e.flexWrap!=null?n.flexWrap=e.flexWrap:e.wrap&&(n.flexWrap="wrap"),e.width!=null&&(n.width=a(e.width)),e.minWidth!=null&&(n.minWidth=a(e.minWidth)),e.maxWidth!=null&&(n.maxWidth=a(e.maxWidth)),e.height!=null&&(n.height=a(e.height)),e.minHeight!=null&&(n.minHeight=a(e.minHeight)),e.maxHeight!=null&&(n.maxHeight=a(e.maxHeight)),e.aspectRatio!=null&&e.height==null&&(n.height="auto"),e.backgroundColor!=null&&(n.backgroundColor=e.backgroundColor),e.borderRadius!=null&&(n.borderRadius=a(e.borderRadius)),e.border!=null&&(n.border=e.border),e.boxShadow!=null&&(n.boxShadow=e.boxShadow),e.margin!=null&&(n.margin=a(e.margin)),e.marginTop!=null&&(n.marginTop=a(e.marginTop)),e.marginRight!=null&&(n.marginRight=a(e.marginRight)),e.marginBottom!=null&&(n.marginBottom=a(e.marginBottom)),e.marginLeft!=null&&(n.marginLeft=a(e.marginLeft)),_(n,e),e.overflow!=null&&(n.overflow=e.overflow),e.transform!=null&&(n.transform=e.transform),e.pointerEvents!=null&&(n.pointerEvents=e.pointerEvents),e.opacity!=null&&(n.opacity=e.opacity)),n}function we(e,n=a$1){return B(e,n).rules.length>0}function He(e,n=0,t=a$1){return P(e,n,t)}function Ee(e,n=0,t=a$1){return P(e,n,t)}function ie(e,n=a$1){return J(e,n)}function X(e,n=a$1){return J(e,n)}function Ge(e,n,t=a$1){Y(e,n,t);}function U(e){return e.replace(/"/g,'\\"')}function ye(e){let n=[];return e.position!=null&&n.push(`position:${e.position};`),e.inset!=null&&n.push(`inset:${a(e.inset)};`),e.insetBlock!=null&&n.push(`inset-block:${a(e.insetBlock)};`),e.insetInline!=null&&n.push(`inset-inline:${a(e.insetInline)};`),e.top!=null&&n.push(`top:${a(e.top)};`),e.right!=null&&n.push(`right:${a(e.right)};`),e.bottom!=null&&n.push(`bottom:${a(e.bottom)};`),e.left!=null&&n.push(`left:${a(e.left)};`),e.zIndex!=null&&n.push(`z-index:${e.zIndex};`),e.display!=null&&n.push(`display:${e.display};`),e.flexDirection!=null&&n.push(`flex-direction:${e.flexDirection};`),e.gap!=null&&n.push(`gap:${a(e.gap)};`),e.rowGap!=null&&n.push(`row-gap:${a(e.rowGap)};`),e.columnGap!=null&&n.push(`column-gap:${a(e.columnGap)};`),e.padding!=null&&n.push(`padding:${a(e.padding)};`),(e.align??e.alignItems)&&n.push(`align-items:${e.alignItems??e.align};`),e.alignContent!=null&&n.push(`align-content:${e.alignContent};`),(e.justify??e.justifyContent)&&n.push(`justify-content:${e.justifyContent??e.justify};`),e.aspectRatio!=null&&n.push(`aspect-ratio:${String(e.aspectRatio)};`),e.flexWrap!=null?n.push(`flex-wrap:${e.flexWrap};`):e.wrap&&n.push("flex-wrap:wrap;"),e.width!=null&&n.push(`width:${a(e.width)};`),e.minWidth!=null&&n.push(`min-width:${a(e.minWidth)};`),e.maxWidth!=null&&n.push(`max-width:${a(e.maxWidth)};`),e.height!=null&&n.push(`height:${a(e.height)};`),e.minHeight!=null&&n.push(`min-height:${a(e.minHeight)};`),e.maxHeight!=null&&n.push(`max-height:${a(e.maxHeight)};`),e.aspectRatio!=null&&e.height==null&&n.push("height:auto;"),e.backgroundColor!=null&&n.push(`background-color:${e.backgroundColor};`),e.borderRadius!=null&&n.push(`border-radius:${a(e.borderRadius)};`),e.border!=null&&n.push(`border:${e.border};`),e.boxShadow!=null&&n.push(`box-shadow:${e.boxShadow};`),I(n,e),j(n,e),e.overflow!=null&&n.push(`overflow:${e.overflow};`),e.transform!=null&&n.push(`transform:${e.transform};`),e.pointerEvents!=null&&n.push(`pointer-events:${e.pointerEvents};`),e.opacity!=null&&n.push(`opacity:${e.opacity};`),n.join("")}function $(e){return ee({value:e.style,breakpointMap:e.breakpointMap,selector:e.selector,serialize:ye})}function Q(e){return ee({value:e.style,breakpointMap:e.breakpointMap,selector:e.selector,serialize:We})}function Le(e){let n=e.breakpointMap??a$1;if(!we(e.style,n))return [];let t=e.selector??W,o=[],r=new Set([0]);Y(e.style,r,n);for(let i of Array.from(r).sort((s,l)=>s-l)){let s=He(e.style,i,n),l=ve(s),u=Be(s),p=[l?`${t}{${l}}`:"",u?`${t} [data-rmg-skel-text-line="true"]{${u}}`:""].filter(Boolean).join("");p&&o.push({minWidth:i,css:p,raw:true});}return o}function M(e,n,t,o,r=a$1){if(e.kind===o){let i=e,s=$({style:i.style,breakpointMap:r}),l=s.length?n():void 0;l&&s.length&&t.push({nodeId:l,rules:s});let u=M(i.item,n,t,o,r),p=Array.isArray(i.slots)?i.slots.map(m=>({...m,item:m?.item?M(m.item,n,t,o,r):m?.item})):void 0;return {...i,...l?{__rmgNodeId:l}:null,item:u,...p?{slots:p}:null}}switch(e.kind){case "rect":case "square":case "circle":{let i=e,s=Q({style:i.style,breakpointMap:r});if(!s.length)return e;let l=n();return t.push({nodeId:l,rules:s}),{...i,__rmgNodeId:l}}case "text":{let i=e,s=i.__rmgTextRenderState??H({barHeight:i.barHeight,barWidth:i.barWidth,lineHeight:i.lineHeight,lines:i.lines,lastBarWidth:i.lastBarWidth,responsiveBy:i.responsiveBy,breakpointMap:r}),l=[...F({renderState:s,fitContent:Ce(i.style)}).map(p=>({...p,raw:true})),...Le({style:i.style,breakpointMap:r})];if(!l.length&&!i.__rmgTextRenderState)return e;let u=l.length?n():void 0;return u&&l.length&&t.push({nodeId:u,rules:l}),{...i,...u?{__rmgNodeId:u}:null,__rmgTextRenderState:s}}case "media":{let i=e,s=[...$({style:i.style,breakpointMap:r}),...Q({style:i.tile?.style,breakpointMap:r,selector:`${W} [data-rmg-skel-media-tile="true"]`})];if(!s.length)return e;let l=n();return t.push({nodeId:l,rules:s}),{...e,__rmgNodeId:l}}case "stack":case "row":case "col":{let i=e,s=$({style:i.style,breakpointMap:r}),l=s.length?n():void 0;l&&s.length&&t.push({nodeId:l,rules:s});let u=i.children.map(p=>M(p,n,t,o,r));return {...i,...l?{__rmgNodeId:l}:null,children:u}}default:return e}}function Oe(e){if(!e.rules.length)return "";let n=`[${e.scopeAttr}="${U(e.scopeId)}"]`,t=[];for(let o of e.rules){let r=`${n} [data-rmg-skel-node="${U(o.nodeId)}"]`;for(let i of o.rules){let s=i.raw?i.css.split("__NODE_SEL__").join(r):`${r}{${i.css}}`;i.minWidth<=0?t.push(s):i.query==="container"?t.push(`@container (min-width:${i.minWidth}px){${s}}`):t.push(`@media (min-width:${i.minWidth}px){${s}}`);}}return t.join(`
|
|
2
|
-
`)}function re(e,n,t){return te(e,t?void 0:n)}function Z(e){let{kind:n,style:t,shimmer:o,disableShimmer:r,breakpointMap:i,mediaTile:s}=e,l=n==="circle"?h.skelCircle:n==="square"?h.skelSquare:h.skelRect,u=ie(t,i),p=e.__rmgNodeId;return jsx("div",{"data-rmg-skel-node":p,"data-rmg-skel-media-tile":s?"true":void 0,className:[h.skelTile,l,r?null:h.skelShimmer].filter(Boolean).join(" "),style:{...re(u,o,r),...ne(u)}})}function $e({node:e,disableShimmer:n,breakpointMap:t}){let o=e.__rmgTextRenderState??H({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,responsiveBy:e.responsiveBy,breakpointMap:t}),r=ie(e.style,t),i=e.__rmgNodeId,s=o.responsiveBy==="container"&&o.usesResponsiveBarCss,l=L(o.baseState.metrics),u=q(s?void 0:r,o.baseState.metrics.totalHeight),p=ne(r),m={height:o.baseState.metrics.barHeight,backgroundColor:r?.backgroundColor,borderRadius:r?.borderRadius},x=N(r?.width),g=jsx("div",{"data-rmg-skel-node":i,"data-rmg-skel-text":"true",className:h.skelText,style:{...u,...s?null:p,paddingBlock:`${o.baseState.metrics.paddingBlock}px`,rowGap:`${o.baseState.metrics.rowGap}px`,"--rmg-skel-text-safari-height":`${l.totalHeight}px`,"--rmg-skel-text-safari-padding-block":`${l.paddingBlock}px`,"--rmg-skel-text-safari-row-gap":`${l.rowGap}px`},children:Array.from({length:o.maxLines}).map((y,T)=>jsx("div",{"data-rmg-skel-text-line":"true",className:[h.skelTile,n?null:h.skelShimmer,h.skelTextLine].filter(Boolean).join(" "),style:{...re(m,e.shimmer,n),display:T>=o.baseState.lineCount?"none":void 0,width:x?o.baseState.barWidths[T]??"100%":"100%",maxWidth:o.baseState.barWidths[T]??"100%"}},T))});return s?jsx("div",{"data-rmg-skel-text-container":"true",style:{...q(r),...p,containerType:"inline-size"},children:g}):g}function Me({node:e,disableShimmer:n,breakpointMap:t}){let o=t??a$1;switch(e.kind){case "rect":case "square":case "circle":return jsx(Z,{...e,disableShimmer:n,breakpointMap:o});case "media":{let r=Math.max(0,e.count|0),i=e.direction??"row",s=e.tile?.shape??"rect",l=e.__rmgNodeId,u=K(X(e.style,o));return jsx("div",{"data-rmg-skel-node":l,className:[h.skelGroup,i==="row"?h.skelRow:h.skelCol].join(" "),style:u,children:Array.from({length:r}).map((p,m)=>jsx(Z,{kind:s,style:e.tile?.style,shimmer:e.tile?.shimmer,disableShimmer:n,breakpointMap:o,mediaTile:true},m))})}case "stack":case "row":case "col":{let r=e.kind==="row"?h.skelRow:e.kind==="col"?h.skelCol:h.skelStack,i=e.__rmgNodeId,s=K(X(e.style,o));return jsx("div",{"data-rmg-skel-node":i,className:[h.skelGroup,r].join(" "),style:s,children:e.children.map((l,u)=>jsx(Me,{node:l,disableShimmer:n,breakpointMap:o},u))})}case "text":return jsx($e,{node:e,disableShimmer:n,breakpointMap:o});default:return null}}export{Oe as A,Me as B,h as a,W as b,se as c,ae as d,L as e,ce as f,ge as g,Se as h,be as i,H as j,F as k,a as l,ne as m,Te as n,Ae as o,K as p,He as q,Ee as r,ie as s,X as t,Ge as u,U as v,$ as w,Q as x,Le as y,M as z};
|