@platformos/pos-cli
Version:
Manage your platformOS application
2 lines (1 loc) • 825 B
JavaScript
import{x as z,p as B,o as C}from"./n7YEDvJi.js";function F(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function G(n,w){C(n,1,1,()=>{w.delete(n.key)})}function H(n,w,S,D,A,g,f,j,p,k,o,q){let i=n.length,d=g.length,c=i;const u={};for(;c--;)u[n[c].key]=c;const h=[],a=new Map,m=new Map,M=[];for(c=d;c--;){const e=q(A,g,c),s=S(e);let t=f.get(s);t?M.push(()=>t.p(e,w)):(t=k(s,e),t.c()),a.set(s,h[c]=t),s in u&&m.set(s,Math.abs(c-u[s]))}const v=new Set,x=new Set;function y(e){B(e,1),e.m(j,o),f.set(e.key,e),o=e.first,d--}for(;i&&d;){const e=h[d-1],s=n[i-1],t=e.key,l=s.key;e===s?(o=e.first,i--,d--):a.has(l)?!f.has(t)||v.has(t)?y(e):x.has(l)?i--:m.get(t)>m.get(l)?(x.add(t),y(e)):(v.add(l),i--):(p(s,f),i--)}for(;i--;){const e=n[i];a.has(e.key)||p(e,f)}for(;d;)y(h[d-1]);return z(M),h}export{F as e,G as o,H as u};