import{d as $,l as k,m as U,q as V,s as h}from"./chunk-ALDBR463.js";import{Da as x,F as b,Ia as E,K as l,La as i,M as v,Na as a,Oa as c,Sa as D,U as m,V as p,Z as F,Za as N,_ as y,a as d,ba as O,ca as _,fa as C,ia as A,l as T,la as M,lb as P,o as j,oa as w}from"./chunk-V6BPA3D7.js";function X(t){return y(r=>{let e=t(r),n=Array.isArray(e)?e:[e];return b(r).pipe(x(...n))})}var Z={dispatch:!0,functional:!1,useEffectsErrorHandler:!0},g="__@ngrx/effects_create__";function zt(t,r={}){let e=r.functional?t:t(),n=d(d({},Z),r);return Object.defineProperty(e,g,{value:n}),e}function q(t){return Object.getOwnPropertyNames(t).filter(n=>t[n]&&t[n].hasOwnProperty(g)?t[n][g].hasOwnProperty("dispatch"):!1).map(n=>{let s=t[n][g];return d({propertyName:n},s)})}function Q(t){return q(t)}function z(t){return Object.getPrototypeOf(t)}function W(t){return!!t.constructor&&t.constructor.name!=="Object"&&t.constructor.name!=="Function"}function G(t){return typeof t=="function"}function tt(t){return t.filter(G)}function et(t,r,e){let n=z(t),o=!!n&&n.constructor.name!=="Object"?n.constructor.name:null,u=Q(t).map(({propertyName:f,dispatch:L,useEffectsErrorHandler:K})=>{let I=typeof t[f]=="function"?t[f]():t[f],R=K?e(I,r):I;return L===!1?R.pipe(_()):R.pipe(w()).pipe(l(Y=>({effect:t[f],notification:Y,propertyName:f,sourceName:o,sourceInstance:t})))});return m(...u)}var nt=10;function H(t,r,e=nt){return t.pipe(F(n=>(r&&r.handleError(n),e<=1?t:H(t,r,e-1))))}var Gt=(()=>{class t extends T{constructor(e){super(),e&&(this.source=e)}lift(e){let n=new t;return n.source=this,n.operator=e,n}static{this.\u0275fac=function(n){return new(n||t)(a(V))}}static{this.\u0275prov=E({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Ht(...t){return p(r=>t.some(e=>typeof e=="string"?e===r.type:e.type===r.type))}var Bt=new i("@ngrx/effects Internal Root Guard"),Lt=new i("@ngrx/effects User Provided Effects"),Kt=new i("@ngrx/effects Internal Root Effects"),Yt=new i("@ngrx/effects Internal Root Effects Instances"),Jt=new i("@ngrx/effects Internal Feature Effects"),Xt=new i("@ngrx/effects Internal Feature Effects Instance Groups"),rt=new i("@ngrx/effects Effects Error Handler",{providedIn:"root",factory:()=>H}),ot="@ngrx/effects/init",st=$(ot);function it(t,r){if(t.notification.kind==="N"){let e=t.notification.value;!ft(e)&&r.handleError(new Error(`Effect ${ct(t)} dispatched an invalid action: ${ut(e)}`))}}function ft(t){return typeof t!="function"&&t&&t.type&&typeof t.type=="string"}function ct({propertyName:t,sourceInstance:r,sourceName:e}){let n=typeof r[t]=="function";return!!e?`"${e}.${String(t)}${n?"()":""}"`:`"${String(t)}()"`}function ut(t){try{return JSON.stringify(t)}catch{return t}}var at="ngrxOnIdentifyEffects";function dt(t){return S(t,at)}var lt="ngrxOnRunEffects";function pt(t){return S(t,lt)}var Et="ngrxOnInitEffects";function ht(t){return S(t,Et)}function S(t,r){return t&&r in t&&typeof t[r]=="function"}var B=(()=>{class t extends j{constructor(e,n){super(),this.errorHandler=e,this.effectsErrorHandler=n}addEffects(e){this.next(e)}toActions(){return this.pipe(M(e=>W(e)?z(e):e),v(e=>e.pipe(M(gt))),v(e=>{let n=e.pipe(A(o=>vt(this.errorHandler,this.effectsErrorHandler)(o)),l(o=>(it(o,this.errorHandler),o.notification)),p(o=>o.kind==="N"&&o.value!=null),C()),s=e.pipe(O(1),p(ht),l(o=>o.ngrxOnInitEffects()));return m(n,s)}))}static{this.\u0275fac=function(n){return new(n||t)(a(P),a(rt))}}static{this.\u0275prov=E({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function gt(t){return dt(t)?t.ngrxOnIdentifyEffects():""}function vt(t,r){return e=>{let n=et(e,t,r);return pt(e)?e.ngrxOnRunEffects(n):n}}var mt=(()=>{class t{get isStarted(){return!!this.effectsSubscription}constructor(e,n){this.effectSources=e,this.store=n,this.effectsSubscription=null}start(){this.effectsSubscription||(this.effectsSubscription=this.effectSources.toActions().subscribe(this.store))}ngOnDestroy(){this.effectsSubscription&&(this.effectsSubscription.unsubscribe(),this.effectsSubscription=null)}static{this.\u0275fac=function(n){return new(n||t)(a(B),a(h))}}static{this.\u0275prov=E({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Zt(...t){let r=t.flat(),e=tt(r);return N([e,{provide:D,multi:!0,useValue:()=>{c(k),c(U,{optional:!0});let n=c(mt),s=c(B),o=!n.isStarted;o&&n.start();for(let u of r){let f=G(u)?c(u):u;s.addEffects(f)}o&&c(h).dispatch(st())}}])}export{X as a,zt as b,Gt as c,Ht as d,Zt as e};