zigbee2mqtt-windfront
Version:
[](https://npmjs.org/package/zigbee2mqtt-windfront) [](https://github.com/Nerivec/zigbee2mqtt-windf
2 lines (1 loc) • 18 kB
JavaScript
import{r as p,b4 as Ze,j as N}from"./index-Cg_dwqpD.js";var et=Object.defineProperty,tt=(t,e,n)=>e in t?et(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e,n)=>tt(t,typeof e!="symbol"?e+"":e,n);class ye{constructor(e=new Map){this.map=e}clone(){return new ye(new Map(this.map))}decrement(e,n){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&n())}increment(e){const n=this.map.get(e)??0;this.map.set(e,n+1)}}class te{constructor(){V(this,"map",new Map)}delete(e){return this.map.delete(e)}get(e){return this.map.get(e)}getOrCreate(e){let n=this.map.get(e);return n===void 0&&(n=new Set,this.map.set(e,n)),n}use(e,n){const r=this.get(e);r!==void 0&&n(r)}}function R(t,e){return e(t),t}function Ve(){}const ke="cell",nt="signal";function Oe(t,e){return t===e}const fe=new Map;let G;class rt{constructor(e={}){V(this,"definitionRegistry",new Set),V(this,"distinctNodes",new Map),V(this,"executionMaps",new Map),V(this,"graph",new te),V(this,"pipeMap",new Map),V(this,"singletonSubscriptions",new Map),V(this,"state",new Map),V(this,"subscriptions",new te);for(const n of Object.getOwnPropertySymbols(e))this.state.set(n,e[n])}cellInstance(e,n=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),n!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,n===!0?Oe:n),r}changeWith(e,n,r){this.connect({map:s=>(i,o)=>{s(r(o,i))},pulls:[e],sink:e,sources:[n]})}combine(...e){return R(this.signalInstance(),n=>{this.connect({map:r=>(...s)=>{r(s)},sink:n,sources:e})})}combineCells(...e){return R(this.cellInstance(e.map(n=>this.getValue(n)),!0),n=>{this.connect({map:r=>(...s)=>{r(s)},sink:n,sources:e})})}connect({map:e,pulls:n=[],sink:r,sources:s}){const i={map:e,pulls:new Set(n),sink:this.register(r),sources:new Set(s)};for(const o of[...s,...n])this.register(o),this.graph.getOrCreate(o).add(i);this.executionMaps.clear()}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(n=>this.getValue(n))}inContext(e){const n=G;G=this;const r=e();return G=n,r}link(e,n){this.connect({map:r=>s=>{r(s)},sink:n,sources:[e]})}pipe(e,...n){return this.combineOperators(...n)(e)}pub(e,n){this.pubIn({[e]:n})}pubIn(e){var n;const r=Reflect.ownKeys(e).map(d=>this.pipeMap.get(d)??d),s=Reflect.ownKeys(e).reduce((d,f)=>{const v=f,C=e[v],a=this.pipeMap.get(v)??v;return d[a]=C,d},{}),i=this.getExecutionMap(r),o=i.refCount.clone(),u=i.participatingNodes.slice(),l=new Map(this.state),c=d=>{this.graph.use(d,f=>{for(const{sink:v,sources:C}of f)C.has(d)&&o.decrement(v,()=>{u.splice(u.indexOf(v),1),c(v)})})};for(;;){const d=u.shift();if(d===void 0)break;const f=d;let v=!1;const C=a=>{const h=this.distinctNodes.get(f);if(h!=null&&h(l.get(f),a)){v=!1;return}v=!0,l.set(f,a),this.state.has(f)&&this.state.set(f,a)};if(Object.hasOwn(s,f)?C(s[f]):i.projections.use(f,a=>{for(const h of a){const m=[...Array.from(h.sources),...Array.from(h.pulls)].map(M=>l.get(M));h.map(C)(...m)}}),v){const a=l.get(f);this.inContext(()=>{this.subscriptions.use(f,h=>{for(const m of h)m(a)})}),(n=this.singletonSubscriptions.get(f))==null||n(a)}else c(f)}}register(e){const n=fe.get(e);if(n===void 0)return e;if(!this.definitionRegistry.has(e)){if(this.definitionRegistry.add(e),n.type===ke)return R(this.cellInstance(n.initial,n.distinct,e),o=>{this.inContext(()=>{n.init(this,o)})});if(n.type===nt)return R(this.signalInstance(n.distinct,e),o=>{this.inContext(()=>{n.init(this,o)})});const r=this.signalInstance(n.distinct),s=this.cellInstance(n.initial,!0),i=this.cellInstance(n.initial,n.distinct,e);return this.link(s,i),this.pipeMap.set(i,r),this.inContext(()=>{n.init(this,r,s)}),i}return e}resetSingletonSubs(){this.singletonSubscriptions.clear()}signalInstance(e=!0,n=Symbol()){return e!==!1&&this.distinctNodes.set(n,e===!0?Oe:e),n}singletonSub(e,n){return this.register(e),n===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,n),()=>this.singletonSubscriptions.delete(e)}sub(e,n){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(n),()=>r.delete(n)}subMultiple(e,n){const r=this.signalInstance();return this.connect({map:s=>(...i)=>{s(i)},sink:r,sources:e}),this.sub(r,n)}transformer(...e){return n=>R(this.signalInstance(),r=>(this.link(this.pipe(r,...e),n),r))}calculateExecutionMap(e){const n=[],r=new Set,s=new te,i=new ye,o=new te,u=(l,c=0)=>{i.increment(l),!r.has(l)&&(this.register(l),s.use(l,d=>{c=Math.max(...Array.from(d).map(f=>n.indexOf(f)))+1}),this.graph.use(l,d=>{for(const f of d)f.sources.has(l)?(o.getOrCreate(f.sink).add(f),u(f.sink,c)):s.getOrCreate(f.sink).add(l)}),r.add(l),n.splice(c,0,l))};return e.forEach(u),{participatingNodes:n,pendingPulls:s,projections:o,refCount:i}}combineOperators(...e){return n=>{for(const r of e)n=r(n,this);return n}}getExecutionMap(e){let n=e;if(e.length===1){n=e[0];const s=this.executionMaps.get(n);if(s!==void 0)return s}else for(const[s,i]of this.executionMaps.entries())if(Array.isArray(s)&&s.length===e.length&&s.every(o=>e.includes(o)))return i;const r=this.calculateExecutionMap(e);return this.executionMaps.set(n,r),r}}function I(t,e=Ve,n=!0){return R(Symbol(),r=>{fe.set(r,{distinct:n,init:e,initial:t,type:ke})})}function O(t,e,n=!0){return R(Symbol(),r=>{fe.set(r,{distinct:n,init:(s,i)=>{s.link(e(s,i),i)},initial:t,type:ke})})}function ze(t=Ve,e=!1){return R(Symbol(),n=>{fe.set(n,{distinct:e,init:t,type:"signal"})})}function _(){if(!G)throw new Error("This function must be called within a realm instance");return G}const Ce=(t,e)=>{_().link(t,e)},st=(...t)=>{_().pub(...t)},it=(...t)=>_().sub(...t),S=(...t)=>_().pipe(...t),Re=(...t)=>{_().changeWith(...t)},Me=(...t)=>_().combine(...t),je=p.createContext(null),ot=typeof document<"u"?p.useLayoutEffect:p.useEffect;function he(){const t=p.useContext(je);if(t===null)throw new Error("useRealm must be used within a RealmContextProvider");return t}function ut(t){const e=he();e.register(t);const n=p.useCallback(r=>e.sub(t,r),[e,t]);return p.useSyncExternalStore(n,()=>e.getValue(t),()=>e.getValue(t))}function lt(t){const e=he();e.register(t);const[n,r]=p.useState(()=>e.getValue(t));return ot(()=>{const s=e.sub(t,()=>{r(()=>e.getValue(t))});return()=>{s()}},[e,t]),n}const Ae="useSyncExternalStore"in Ze?ut:lt;function ct(...t){const e=he();return Ae(e.combineCells.apply(e,t))}function E(t){return(e,n)=>{const r=n.signalInstance();return n.connect({map:s=>i=>{s(t(i))},sink:r,sources:[e]}),r}}function Se(...t){return(e,n)=>{const r=n.signalInstance();return n.connect({map:s=>(...i)=>{s(i)},pulls:t,sink:r,sources:[e]}),r}}function $e(t){return(e,n)=>{const r=n.signalInstance();return n.connect({map:s=>i=>{t(i)&&s(i)},sink:r,sources:[e]}),r}}function He(t,e){return(n,r)=>{const s=r.signalInstance();return r.connect({map:i=>o=>{i(e=t(e,o))},sink:s,sources:[n]}),s}}const Be=({index:t})=>N.jsxs("div",{children:["Item ",t]}),Pe=I(Be),U=I(0),ve=I(null),ie=I(null,()=>{Ce(S(ie,$e(t=>t!==null),E(t=>t.length)),U)}),re=I(0),xe=I(0),at=I(0),ne=I(0),ft=re,oe=I(0),q=I(!1),ht=O(0,()=>S(Me(xe,q,oe),E(([t,e,n])=>e?t-Math.max(n,0):t))),J={lvl:0};function Fe(t,e,n,r=J,s=J){return{k:t,l:r,lvl:n,r:s,v:e}}function g(t){return t===J}function ue(){return J}function be(t,e){if(g(t))return J;const{k:n,l:r,r:s}=t;if(e===n){if(g(r))return s;if(g(s))return r;const[i,o]=Le(r);return se(x(t,{k:i,l:We(r),v:o}))}return e<n?se(x(t,{l:be(r,e)})):se(x(t,{r:be(s,e)}))}function Q(t,e,n="k"){if(g(t))return[Number.NEGATIVE_INFINITY,void 0];if(t[n]===e)return[t.k,t.v];if(t[n]<e){const r=Q(t.r,e,n);return r[0]===Number.NEGATIVE_INFINITY?[t.k,t.v]:r}return Q(t.l,e,n)}function P(t,e,n){return g(t)?Fe(e,n,1):e===t.k?x(t,{k:e,v:n}):e<t.k?Te(x(t,{l:P(t.l,e,n)})):Te(x(t,{r:P(t.r,e,n)}))}function we(t,e,n){if(g(t))return[];const{k:r,l:s,r:i,v:o}=t;let u=[];return r>e&&(u=u.concat(we(s,e,n))),r>=e&&r<=n&&u.push({k:r,v:o}),r<=n&&(u=u.concat(we(i,e,n))),u}function Le(t){return g(t.r)?[t.k,t.v]:Le(t.r)}function We(t){return g(t.r)?t.l:se(x(t,{r:We(t.r)}))}function x(t,e){return Fe(e.k??t.k,e.v??t.v,e.lvl??t.lvl,e.l??t.l,e.r??t.r)}function ge(t){return g(t)||t.lvl>t.r.lvl}function Te(t){return Ie(De(t))}function se(t){const{l:e,lvl:n,r}=t;if(r.lvl>=n-1&&e.lvl>=n-1)return t;if(n>r.lvl+1){if(ge(e))return De(x(t,{lvl:n-1}));if(!g(e)&&!g(e.r))return x(e.r,{l:x(e,{r:e.r.l}),lvl:n,r:x(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(ge(t))return Ie(x(t,{lvl:n-1}));if(!g(r)&&!g(r.l)){const s=r.l,i=ge(s)?r.lvl-1:r.lvl;return x(s,{l:x(t,{lvl:n-1,r:s.l}),lvl:s.lvl+1,r:Ie(x(r,{l:s.r,lvl:i}))})}throw new Error("Unexpected empty nodes")}function Ye(t,e,n){if(g(t))return[];const r=Q(t,e)[0];return dt(we(t,r,n))}function _e(t,e){const n=t.length;if(n===0)return[];let{index:r,value:s}=e(t[0]);const i=[];for(let o=1;o<n;o++){const{index:u,value:l}=e(t[o]);i.push({end:u-1,start:r,value:s}),r=u,s=l}return i.push({end:Number.POSITIVE_INFINITY,start:r,value:s}),i}function dt(t){return _e(t,({k:e,v:n})=>({index:e,value:n}))}function Ie(t){const{lvl:e,r:n}=t;return!g(n)&&!g(n.r)&&n.lvl===e&&n.r.lvl===e?x(n,{l:x(t,{r:n.l}),lvl:e+1}):t}function De(t){const{l:e}=t;return!g(e)&&e.lvl===t.lvl?x(e,{r:x(t,{l:e.r})}):t}function pt(t){const{endIndex:e,size:n,startIndex:r}=t;return s=>s.start===r&&(s.end===e||s.end===Number.POSITIVE_INFINITY)&&s.value===n}function Ge(t,e){let n=g(t)?0:Number.POSITIVE_INFINITY;for(const r of e){const{endIndex:s,size:i,startIndex:o}=r;if(n=Math.min(n,o),g(t)){t=P(t,0,i);continue}const u=Ye(t,o-1,s+1);if(u.some(pt(r)))continue;let l=!1,c=!1;for(const{end:d,start:f,value:v}of u)l?(s>=f||i===v)&&(t=be(t,f)):(c=v!==i,l=!0),d>s&&s>=f&&v!==i&&(t=P(t,s+1,v));c&&(t=P(t,o,i))}return[t,n]}function le(t,e,n,r=0){let s=t.length-1;for(;r<=s;){const i=Math.floor((r+s)/2),o=t[i],u=n(o,e);if(u===0)return i;if(u===-1){if(s-r<2)return i-1;s=i-1}else{if(s===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function mt(t,e,n){return t[le(t,e,n)]}function gt(t,e,n,r){const s=le(t,e,r),i=le(t,n,r,s);return t.slice(s,i+1)}function Ke({index:t},e){return e===t?0:e<t?-1:1}function vt({offset:t},e){return e===t?0:e<t?-1:1}function xt(t){return{index:t.index,value:t}}function bt(t,e,n,r=0){return r>0&&(e=Math.max(e,mt(t,r,Ke).offset)),e=Math.max(0,e),_e(gt(t,e,n,vt),xt)}function wt(t,[e,n]){let r=0,s=0,i=0,o=0;if(n!==0){o=le(t,n-1,Ke),i=t[o].offset;const u=Q(e,n-1);if(u[1]===void 0)throw new Error("Invariant violation");r=u[0],s=u[1],t.length&&t[o].height===Q(e,n)[1]&&(o-=1),t=t.slice(0,o+1)}else t=[];for(const{start:u,value:l}of Ye(e,n,Number.POSITIVE_INFINITY)){const c=(u-r)*s+i;t.push({height:l,index:u,offset:c}),r=u,i=c,s=l}return[t,s,i,r]}function It(t,[e,n]){if(n.length>0&&g(t)&&e.length===2){const r=e[0].size,s=e[1].size;return[n.reduce((i,o)=>P(P(i,o,r),o+1,s),ue()),0]}return Ge(t,e)}const Ue=ze(),qe=ze(),de=I([],()=>{Re(de,qe,(t,e)=>{const n=t.slice();for(const[r,s]of Object.entries(e))n[Number.parseInt(r,10)]=s;for(let r=0;r<n.length;r++)if(n[r]===void 0)return t;return n})}),F=I(0),Ee=I(0),ce=I([],()=>{Ce(S(F,Se(de),E(([t,e])=>{const n=Array.from({length:t},()=>[ue(),0]);if(e.length>0){const r=Array.from({length:t},()=>0),s=Array.from({length:t},()=>0);for(let i=0;i<e.length;i++){const o=e[i],u=r.indexOf(Math.min(...r)),l=s[u];s[u]++,r[u]+=o,n[u]=Ge(n[u][0],[{endIndex:l,size:o,startIndex:l}])}}return n.map(([r])=>[r,0])})),ce),Re(ce,Ue,(t,e)=>{const n=t.map(([s])=>s),r=[];for(let s=0;s<e.length;s++){const i=n[s]??ue();if(e[s].length===0){r.push([i,0]);continue}r.push(It(i,[e[s],[]]))}return r})}),Je=O([],()=>S(ce,E(t=>t.map(([e])=>e)))),yt=O([],t=>t.pipe(ce,E(e=>e.map(([,n])=>n)))),pe=O([],()=>S(Je,Se(yt),He((t,[e,n])=>{const r=[];for(let s=0;s<e.length;s++){const i=t[s]??[[]];r.push(wt(i[0],[e[s],n[s]]))}return r},[]))),kt=O([],()=>S(pe,E(t=>t.map(([e])=>e)))),Ct=O([],()=>S(pe,E(t=>t.map(([,e])=>e)))),Mt=O([],()=>S(pe,E(t=>t.map(([,,e])=>e)))),St=O([],t=>t.pipe(pe,E(e=>e.map(([,,,n])=>n)))),K=O([],()=>S(F,Se(U,Ee,de),E(([t,e,n,r])=>{if(r.length>0){const i=Array.from({length:t},()=>0),o=Array.from({length:t},()=>[]);for(let u=0;u<r.length;u++){const l=r[u],c=i.indexOf(Math.min(...i));o[c].push(u),i[c]+=l}return o}const s=n===0?Math.min(t,e):n;return Array.from({length:t},(i,o)=>{const u=[];for(let l=o;l<s;l+=t)u.push(l);return u})}))),Et=O([],()=>S(Me(F,U,St,Mt,Ct,K),E(([t,e,n,r,s,i])=>{const o=i.reduce((l,c)=>l+c.length,0),u=Math.ceil((e-o)/t);return Array.from({length:t},(l,c)=>{const d=i[c].length+u-n[c];return r[c]+d*s[c]})}))),ae=I({columns:[],data:[],indexesInColumns:[],totalCount:-1},t=>{Ce(S(Me(F,ft,ht,Je,kt,U,Et,ie,K,Ee,oe,q),He((e,[n,r,s,i,o,u,l,c,d,f,v,C])=>{if(u===0)return e;const a=C?v+r:0,h=Math.min(Math.max(r-a,0),Math.max(...l)-s),m=h+s,M=f===0?Math.min(n,u):f;return{columns:Array.from({length:n},(X,y)=>{const b=e.columns[y],j=i[y]??ue(),T=o[y]??[],k=l[y]??0,A=d[y]??[];if(g(j)||A.length===0){const H=[];let B=0;for(let z=y;z<M;z+=n)H.push({columnIndex:y,data:c?.[z],height:0,index:z,indexInColumn:B++,offset:0});return{index:y,items:H,listBottom:0,listTop:0,offsetTree:T,totalHeight:0,viewportBottom:m}}if(b&&b.offsetTree===T&&e.totalCount===u&&e.data===c&&e.indexesInColumns===d&&h>=b.listTop&&m<=b.listBottom)return b;const Z=[],L=A.length-1,W=0,me=bt(T,h,m,W);let w=0,D=0,$=!1;for(const H of me){const{value:{height:B,offset:z}}=H;let Y=H.start;w=z,z<h&&(Y+=Math.floor((h-z)/B),w+=(Y-H.start)*B),Y<W&&(w+=(W-Y)*B,Y=W);const Qe=Math.min(H.end,L);for(let ee=Y;ee<=Qe&&!(w>=m);ee++){const Ne=A[ee],Xe={columnIndex:y,data:c?.[Ne],height:B,index:Ne,indexInColumn:ee,offset:w};$||($=!0,D=w),Z.push(Xe),w+=B}}return{index:y,items:Z,listBottom:w,listTop:D,offsetTree:T,totalHeight:k,viewportBottom:m}}),data:c,indexesInColumns:d,totalCount:u}},{columns:[],data:[],indexesInColumns:[],totalCount:-1})),ae),it(S(ae,$e(e=>e.columns.some(n=>n.listBottom<n.viewportBottom))),e=>{const n=e.columns.slice().sort((o,u)=>o.listBottom-u.listBottom)[0],r=t.getValue(K),s=r.flat(),i=s.length?Math.max(...s)+1:0;i>=t.getValue(U)||st(K,r.map((o,u)=>u===n.index?[...o,i]:o))})}),Nt=p.forwardRef(({columnCount:t,context:e,data:n,initialItemCount:r=0,ItemContent:s=Be,useWindowScroll:i=!1,...o},u)=>{const l=p.useMemo(()=>{const c=new rt;return c.register(K),c.register(ae),c.register(de),c.pubIn({[F]:t,[ve]:e,[ie]:n.slice(),[Ee]:r,[Pe]:s,[q]:i}),c},[]);return p.useImperativeHandle(u,()=>({}),[]),p.useEffect(()=>{l.pubIn({[F]:t,[ve]:e,[ie]:n.slice()})}),N.jsx(je.Provider,{value:l,children:N.jsx(Tt,{...o})})});Nt.displayName="VirtuosoMasonry";const Ot={observe:()=>{},unobserve:()=>{}},Tt=({style:t,...e})=>{const n=he(),[r]=p.useState(()=>{if(typeof ResizeObserver>"u"){if(typeof window<"u")throw new Error("ResizeObserver not found. Please ensure that you have a polyfill installed.");return Ot}return new ResizeObserver(a=>{const h=a.length,m=n.getValue(F),M=n.getValue(q),X=Array.from({length:m},()=>[]),y={};let b={};for(let j=0;j<h;j++){const T=a[j],k=T.target;if(k===o.current){const $=k.ownerDocument.defaultView;b={...b,[ne]:M?$.document.documentElement.scrollHeight:k.scrollHeight,[re]:M?$.scrollY:k.scrollTop,[xe]:M?$.innerHeight:T.contentRect.height,[at]:M?$.innerWidth:k.clientWidth,...M?{}:{[oe]:T.contentRect.top,[ne]:k.scrollHeight}};continue}if(k.dataset.role==="column"){o.current&&(b={...b,[ne]:o.current.scrollHeight});continue}if(k.dataset.index===void 0)continue;const A=Number.parseInt(k.dataset.index),Z=Number.parseFloat(k.dataset.knownSize??""),L=T.contentRect.height,W=Number.parseInt(k.dataset.columnIndex??"0"),me=Number.parseInt(k.dataset.absoluteIndex??"0");if(y[me]=L,L===Z)continue;const w=X[W],D=w[w.length-1];w.length===0||D.size!==L||D.endIndex!==A-1?w.push({endIndex:A,size:L,startIndex:A}):w[w.length-1].endIndex++}X.some(j=>j.length>0)&&(b={...b,[Ue]:X}),Object.keys(y).length>0&&(b={...b,[qe]:y}),n.pubIn(b)})}),s=p.useCallback(a=>{r.observe(a)},[r]),i=p.useCallback(a=>{r.unobserve(a)},[r]),o=p.useRef(null),u=p.useRef([]),l=p.useCallback(a=>h=>{if(h)u.current[a]=h,r.observe(h,{box:"border-box"});else{const m=u.current[a];m!=null&&(r.unobserve(m),u.current[a]=null)}},[r]),c=p.useCallback(()=>{const a=o.current;a!==null&&n.pub(re,a.scrollTop)},[n]),d=p.useCallback(a=>{a?(o.current=a,a.addEventListener("scroll",c),r.observe(a,{box:"border-box"})):o.current&&(o.current.removeEventListener("scroll",c),r.unobserve(o.current),o.current=null)},[r,c]),[f,v,C]=ct(ae,Pe,q);return p.useEffect(()=>{var a;if(C){const h=(a=o.current)==null?void 0:a.ownerDocument.defaultView,m=()=>{var M;n.pubIn({[oe]:((M=o.current)==null?void 0:M.getBoundingClientRect().top)??0,[ne]:h.document.documentElement.scrollHeight,[re]:h.scrollY,[xe]:h.innerHeight})};return h.addEventListener("scroll",m),m(),()=>{h.removeEventListener("scroll",m)}}},[C,n]),N.jsx(N.Fragment,{children:N.jsx("div",{...e,"data-testid":"virtuoso-scroller",ref:d,style:{...C?{boxSizing:"border-box",display:"flex",flexDirection:"row"}:{boxSizing:"border-box",display:"flex",flexDirection:"row",overflowY:"scroll"},...t},children:f.columns.map((a,h)=>N.jsx("div",{"data-testid":"virtuoso-list",ref:l(h),style:{boxSizing:"content-box",flexGrow:1,height:a.totalHeight,overflowAnchor:"none",position:"relative"},children:a.items.map(m=>N.jsx(Vt,{item:m,ItemContent:v,mount:s,unmount:i},m.index))},`column-${h}`))})})},Vt=({item:t,ItemContent:e,mount:n,unmount:r})=>{const s=Ae(ve),i=p.useRef(null),o=p.useCallback(u=>{u?(i.current=u,n(u)):i.current&&(r(i.current),i.current=null)},[n,r]);return N.jsx("div",{"data-absolute-index":t.index,"data-column-index":t.columnIndex,"data-index":t.indexInColumn,"data-known-size":t.height,ref:o,style:{boxSizing:"border-box",overflowAnchor:"none",position:"absolute",top:t.offset,width:"100%"},children:N.jsx(e,{context:s,data:t.data,index:t.index})})};function Rt(){const[t,e]=p.useState(window.innerWidth);return p.useEffect(()=>{const r=()=>{e(window.innerWidth)};return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),p.useMemo(()=>t<640?1:t<1024?2:t<1280?3:t<2048?4:t<2304?5:6,[t])}export{Nt as b,Rt as u};