import{Na as I,Ta as b,Wd as m,Xd as w,a as s,b as l,fc as D,gc as v,h as y,rb as j}from"./chunk-XNQ3RS5P.js";var r=Symbol("STATE_SIGNAL");function L(t,...n){t[r].update(o=>n.reduce((e,i)=>s(s({},e),typeof i=="function"?i(e):i),o))}function A(t){let n=w(()=>t());return M(n)?new Proxy(t,{get(o,e){return e in n?(D(o[e])||Object.defineProperty(o,e,{value:m(()=>o()[e]),configurable:!0}),A(o[e])):o[e]}}):t}function M(t){return(t==null?void 0:t.constructor)===Object}function N(...t){let n=[...t],o="providedIn"in n[0]?n.shift():{},e=n;return(()=>{let u=class u{constructor(){let d=e.reduce((g,H)=>H(g),R()),{slices:h,signals:K,methods:P,hooks:T}=d,S=s(s(s({},h),K),P);this[r]=d[r];for(let g in S)this[g]=S[g];let{onInit:p,onDestroy:k}=T;p&&p(),k&&b(j).onDestroy(k)}};y(u,"\u0275fac",function(h){return new(h||u)}),y(u,"\u0275prov",I({token:u,factory:u.\u0275fac,providedIn:o.providedIn||null}));let c=u;return c})()}function R(){return{[r]:v({}),slices:{},signals:{},methods:{},hooks:{}}}function O(t,...n){let o=typeof t=="function"?[t,...n]:n;return e=>o.reduce((i,c)=>c(i),e)}function a(t,n){return Object.keys(t).reduce((o,e)=>n.includes(e)?o:l(s({},o),{[e]:t[e]}),{})}function C(t){return n=>{let o=t(s(s({},n.slices),n.signals)),e=Object.keys(o),i=a(n.slices,e),c=a(n.methods,e);return l(s({},n),{slices:i,signals:s(s({},n.signals),o),methods:c})}}function q(t){return n=>{let o=s(s(s({[r]:n[r]},n.slices),n.signals),n.methods),e=typeof t=="function"?t(o):t,i=c=>{let u=e[c],f=n.hooks[c];return u?()=>{f&&f(),u(o)}:f};return l(s({},n),{hooks:{onInit:i("onInit"),onDestroy:i("onDestroy")}})}}function z(t){return n=>{let o=t(s(s(s({[r]:n[r]},n.slices),n.signals),n.methods)),e=Object.keys(o),i=a(n.slices,e),c=a(n.signals,e);return l(s({},n),{slices:i,signals:c,methods:s(s({},n.methods),o)})}}function B(t){return n=>{let o=typeof t=="function"?t():t,e=Object.keys(o);n[r].update(f=>s(s({},f),o));let i=e.reduce((f,d)=>{let h=m(()=>n[r]()[d]);return l(s({},f),{[d]:A(h)})},{}),c=a(n.signals,e),u=a(n.methods,e);return l(s({},n),{slices:s(s({},n.slices),i),signals:c,methods:u})}}export{L as a,N as b,O as c,C as d,q as e,z as f,B as g};