1import{a as pw,b as pi,c as mw,d as mi,e as lw,f as li,g as Oa}from"./chunk-BVZE4AX6.js";import{A as Jv,B as ga,C as Sa,D as Yv,E as vm,F as Zv,G as Xv,H as eb,I as tb,J as sb,K as rb,L as ib,M as ob,N as ab,O as nb,P as cb,Q as pb,R as mb,T as lb,V as db,a as Vh,b as Iv,c as Tv,d as fa,e as ha,f as Mv,g as Dv,h as Rv,i as Cv,j as Gv,k as zv,l as Kv,m as ym,r as Bv,s as Am,u as qv,v as ua,w as Wv,x as Hv,y as Vv,z as Qv}from"./chunk-LV36QHHL.js";import{a as Na,b as bt,c as cw,e as gw,f as Sw}from"./chunk-C2K7I3MW.js";import{a as dw,b as fw,c as hw,d as uw,e as rr}from"./chunk-P62PB5FM.js";import{a as dv,b as nm,c as Js}from"./chunk-V3Z3NBEJ.js";import{B as Fe,E as _a,F as Fa,H as sw,J as rw,K as iw,N as ow,R as aw,S as nw,a as ni,b as qk,c as Wk,d as Hk,e as Hm,h as ci,i as Pa,j as Vm,k as Vk,l as Qk,m as La,n as Jk,o as Yk,p as Zk,q as Xk,r as Qm,w as Jm,x as ew,y as Gt,z as tw}from"./chunk-RLZBP2JW.js";import{a as Wa,b as _w,c as tl,d as Fw}from"./chunk-WOSTD4O2.js";import{a as Ow}from"./chunk-6DJ62AFD.js";import{a as xe,b as jw,c as sl,d as xw,e as Uw}from"./chunk-OQGFXGQ4.js";import{C as vw,D as bw,E as kw,F as ww,G as Ym,H as $w,J as Iw,K as Tw,L as Ew,M as Zm,Q as Mw,R as Dw,S as ut,V as ir,a as Xt,b as Cr,c as Es,d as ko,e as au,f as Pr,g as nu,h as cu,i as pu,j as lt,k as mu,l as zc,n as Lu,o as _u,p as Je,s as yw,t as di,u as ja,v as xa,w as Ua,x as fi,y as Ga,z as Aw}from"./chunk-ZRUB5RAM.js";import{b as za,c as Ka,d as Ba,e as qa,f as Xm,g as it,h as hi,i as el,j as Rw,k as Cw,l as Pw,m as Lw}from"./chunk-MWUYUP4S.js";import{a as Ay,b as vy,c as by,d as ky,e as Dp,f as Rp,g as Cp,i as qA}from"./chunk-OANXR7UF.js";import{L as fk,M as hk,S as uk,T as gk,Z as Ea,a as Pv,aa as sr,b as Lv,c as fm,d as _v,e as hm,g as um,h as Fv,i as Nv,j as gm,k as Ov,l as Sm,m as jv,n as xv,o as Uv,r as pk,s as mk,t as lk,u as dk,v as tr,w as ri}from"./chunk-FWLW7ANH.js";import{a as Fb,b as Nb,d as Ob,f as wa,g as jb}from"./chunk-TIYXYLYF.js";import{a as Ie}from"./chunk-VKXJRDSK.js";import{a as vu,b as qc,c as bu,d as ku,e as wu,f as Wc,g as $u,h as Iu,i as Tu,j as Eu,n as Mu,o as Du,q as Ru,r as Hc,s as Cu,u as Pu}from"./chunk-MJIKW5YK.js";import{$ as $e,A as xy,B as Hr,C as Uy,D as Gy,Da as wb,E as zy,Ea as ba,Fa as $b,G as Ky,Ga as Ib,Ha as Tb,Ia as Eb,J as Ks,K as By,Ka as Mb,La as km,N as Bs,Na as wm,O as qs,Oa as ka,Pa as $m,Q as qy,Ra as Db,Sa as Rb,T as Wy,U as Hy,V as Fp,Va as Zs,W as Vy,Wa as Cb,X as Np,Y as Qy,Z as Op,_a as Pb,aa as Jy,b as Lp,ba as Ye,c as Ey,d as My,e as Dy,f as Ry,ha as jp,j as Cy,k as Py,la as fb,ma as hb,n as _p,na as va,oa as ub,p as Ly,pa as gb,qa as Sb,r as _y,s as zs,t as Fy,ta as yb,u as Ny,ua as bm,v as Oy,va as Ab,w as jy,wa as vb,xa as bb,ya as kb}from"./chunk-VT4LLTKZ.js";import{a as wy,b as Pp,d as $y,e as Iy,f as Ty}from"./chunk-HG344ULH.js";import{a as OA,b as jA,e as xA,f as UA,g as GA,h as zA}from"./chunk-NTDUQ24P.js";import{a as WA,b as HA,d as VA,e as ia,h as tm,j as rt,k as QA,l as Qs,s as JA,t as YA,u as ZA}from"./chunk-VTXPDQTS.js";import{a as Vs,b as ya,c as Aa}from"./chunk-MESOV7IC.js";import{a as Ia,b as Ta}from"./chunk-5V2DHGB5.js";import{A as ek,B as tk,C as sk,D as rk,E as er,F as ik,G as $a,R as ok,W as si,a as xb,b as Mm,c as Ub,d as Gb,e as zb,f as Kb,h as Bb,i as qb,j as Wb,k as Hb,l as Xs,o as Vb,p as Qb,q as Jb,r as Yb,s as Zb,y as Xb,z as xt}from"./chunk-KE3KLFVA.js";import{D as cv,E as pv,G as mv,H as lv,a as XA,b as sm,c as ev,d as rm,e as tv,f as sv,g as im,j as oa,l as Zr,m as rv,n as iv,o as ov,p as om,q as aa,r as am,s as av,t as Ot,u as nv,w as os}from"./chunk-2D46AI4J.js";import{a as KA,b as ra,c as Jp,d as BA,e as Yp,g as Yr,h as Zp,i as Xp,k as em}from"./chunk-RBWYWP5P.js";import{b as Nw}from"./chunk-5IEINFNL.js";import{$ as Zu,$b as zg,$d as QS,A as jr,Aa as Sg,Ac as ts,Ad as FS,B as Zc,Ba as yg,Bb as jo,Bd as NS,C as Mo,Ca as ap,Cc as sS,Cd as Vo,D as Bu,Da as Ag,Dc as rS,Dd as Qo,De as Sy,E as xr,Ea as Pt,Ec as Ap,Ed as Br,F as Xc,Fa as np,Fb as Cg,Fc as iS,Fe as vt,Ga as Lt,Gb as Pg,Gd as OS,H as qu,Ha as es,Hb as mp,Hc as oS,Hd as Jo,He as yy,I as ep,Ib as xo,Ic as aS,Id as jS,J as tp,Ja as cp,Jb as Lg,Jc as nS,Jd as xS,K as Wu,Ka as vg,Kb as _g,Kc as Le,Kd as US,La as bg,Lc as vp,Ld as Yo,Ma as kg,Mb as lp,Md as GS,N as Do,Na as wg,Nc as Go,Nd as Zo,O as Hu,Od as zS,Pc as Fs,Pd as KS,Qb as Fg,Qc as Ft,Qd as qr,R as Ro,Rb as Ng,Rc as Ns,Rd as BS,S as Vu,Sa as Ps,Sb as Uo,Sc as Os,Sd as qS,Ta as $g,Tb as dp,Tc as zo,Td as WS,U as Qu,Ua as Ig,Ub as Og,Uc as js,Ud as HS,V as sp,Vb as fp,Vc as xs,W as Ju,Wa as Tg,Wb as jg,Wd as Tp,X as Co,Xb as xg,Xc as ht,Xd as Ep,Y as Rs,Ya as Eg,Yb as Ug,Yd as Mp,Z as Cs,Za as Mg,Zd as Wr,_ as Yu,_a as Dg,_b as Gg,_d as VS,aa as Xu,ac as Kg,ae as JS,ba as Ur,bc as Bg,be as YS,c as Fu,ca as eg,cb as ce,cc as qg,ce as ZS,da as rp,db as pp,dc as Wg,de as XS,e as Nu,ea as Gr,ec as hp,ee as ey,fa as Po,fb as je,fc as Hg,fe as ty,g as Ou,ga as tg,gd as IS,h as Vc,hc as Ls,hd as TS,he as sy,ic as _s,id as ES,ie as ry,j as Ms,ja as Lo,jd as Wo,je as iy,k as Ds,ka as sg,ke as oy,l as Qc,lc as Vg,le as ay,m as ju,ma as rg,mc as up,me as ny,na as ig,nc as Qg,ne as cy,oa as zr,oc as gp,oe as py,p as Jc,pb as _t,pc as Jg,pe as my,q as To,qa as Oo,qc as Yg,qe as ly,r as Yc,ra as ft,rc as Zg,re as dy,s as Or,sa as mg,sc as Sp,sd as Ho,se as fy,t as xu,ta as Ae,td as MS,te as hy,u as Uu,ua as lg,uc as Xg,ud as DS,v as Gu,va as dg,vc as eS,vd as RS,ve as uy,w as Re,wa as fg,wd as CS,we as gy,x as zu,xa as hg,xc as tS,xd as PS,xe as rs,y as Ku,ya as ug,yc as yp,yd as LS,ye as ve,z as Eo,za as gg,zb as Rg,zd as _S,ze as Ce}from"./chunk-FPV3P67W.js";import{B as $p,C as st,D as Ip,E as bS,J as Gs,K as kS,b as Io,c as dS,d as Bo,e as fS,f as hS,g as Kr,h as qo,p as uS,q as gS,r as SS,w as yS,x as AS,y as vS}from"./chunk-3OGZZWZI.js";import{a as _o,b as dt,c as og,d as Fo,e as No,f as ag,g as ng,h as cg,i as pg,j as ip,k as op,m as wS,n as $S,o as ss}from"./chunk-ERF7X4QR.js";import"./chunk-ZOXUN7KU.js";import"./chunk-YS7FR74X.js";import"./chunk-AWMXOLHB.js";import"./chunk-VNEK3QQJ.js";import"./chunk-NKY4LFZ2.js";import{a as ui,b as gi,d as qw,e as Ww,f as Hw,g as Vw,h as Qw,i as Jw,j as kt,l as nl,m as cl}from"./chunk-OL7GZXH7.js";import{B as Ek,C as Mk,G as Um,H as Dk,K as Gm,O as Ha,Q as gt,a as Sk,b as yk,c as Pm,d as Ak,e as ii,f as Lm,g as vk,h as _m,i as bk,k as Fm,l as Nm,m as kk,o as Ut,s as wk,t as $k,u as Ik,v as Om,w as jm,x as Tk,z as xm}from"./chunk-GVRWML7P.js";import{B as Gk,C as zk,E as Da,F as Ra,G as Ca,H as Kk,K as Bk,a as Rk,b as zm,e as Km,f as Ck,g as Pk,h as Bm,i as Lk,j as _k,k as Ma,l as qm,m as oi,o as Fk,p as Nk,q as ai,r as Ok,s as jk,t as xk,u as Wm,w as as,x as Uk}from"./chunk-3ZQJRP35.js";import{a as Wf}from"./chunk-IRHOMBAX.js";import"./chunk-K5CHPDPM.js";import"./chunk-SJEMHCU5.js";import"./chunk-6YKQPAFB.js";import"./chunk-6XP4NHCS.js";import"./chunk-C6G32BO3.js";import"./chunk-AGSZ5YOG.js";import"./chunk-KJ646VJZ.js";import{a as Ja,b as Ya,c as Za,d as ar}from"./chunk-4XF6ZOWO.js";import{b as Yw}from"./chunk-Z5C5KD4X.js";import{c as Qh,d as we,e as Jh}from"./chunk-TJA3BSLM.js";import"./chunk-ZBOUF5EW.js";import{a as nk,b as Dm,c as Rm,d as ck,e as Cm}from"./chunk-3PMH4ZAL.js";import{a as Lb,b as Im,c as _b,d as Tm,e as Em}from"./chunk-O5R5EUQD.js";import{a as Va,b as Qa,d as or,e as Gw,f as rl,g as zw,h as il,i as Kw,j as Bw,l as ol,m as al}from"./chunk-AQEORGQU.js";import{a as lu,b as du,c as wo,d as Lr,e as fu,f as $o,g as _r,h as hu,i as uu,j as gu,k as Su,l as yu,m as Kc,n as Bc,o as Au,p as Fr,q as Nr}from"./chunk-ZGJTNUU7.js";import{f as Ev}from"./chunk-NP454CYM.js";import{A as lm,B as pa,C as ma,D as ti,E as la,F as dm,G as da,a as uv,b as gv,c as Xr,d as Sv,e as Ys,f as yv,g as cm,h as Av,i as na,j as pm,k as vv,l as ei,m as bv,n as ca,o as kv,p as wv,q as $v,t as jt,z as mm}from"./chunk-4MVAO5AW.js";import{e as Qp,f as be,g as NA,i as is}from"./chunk-3T4VQCHI.js";import{A as gA,B as Qr,C as SA,D as Jr,H as Kp,I as $A,J as IA,K as Bp,L as TA,M as qp,N as EA,O as Wp,P as MA,Q as Hp,R as DA,S as RA,V as CA,W as PA,Y as LA,_ as Vp,a as Yy,b as Zy,ba as _e,e as oA,f as aA,g as nA,h as cA,i as pA,ia as sa,j as mA,k as Vr,ka as _A,l as lA,la as FA,m as Gp,n as dA,o as zp,p as fA,t as Ws,u as Xo,w as hA,x as Hs,y as uA,z as ea}from"./chunk-SE7KMSRX.js";import{c as ta,d as yA,e as AA,f as vA,g as bA,w as kA,x as wA}from"./chunk-3LU6VDAM.js";import{j as fv,x as hv}from"./chunk-ODA5X37U.js";import"./chunk-2RTZPCT2.js";import{a as E}from"./chunk-X2T3X2RS.js";import"./chunk-CZRXZ7LT.js";import"./chunk-GN45IZLP.js";import"./chunk-QOY55ZI6.js";import"./chunk-NJ7DPYL4.js";import"./chunk-HUQUY6LH.js";import"./chunk-JZIRNZ4O.js";import{b as Xy,c as eA,d as tA,e as xp,f as sA,g as rA,h as iA,i as Up}from"./chunk-HOM2UZO3.js";import{t as Nt}from"./chunk-KZOZNFQA.js";import{F as Ko,K as pS,L as mS,M as wp,N as Us,O as lS,n as bp,u as cS,z as kp}from"./chunk-U7LC6A3A.js";import{b as Zh,c as Xh,d as Ao,e as vo,f as eu,g as Rr,h as tu,i as su,j as ru,k as Uc,m as iu,n as Gc,o as ou,q as bo}from"./chunk-EY2VZUZB.js";import{a as p,b as w,c,d as he}from"./chunk-BFS7WB7G.js";import{a as ak}from"./chunk-77ES6LV3.js";import{a as oe,b as tt,f as Yh,g as xc,k as Zt,l as yo,m as Dr}from"./chunk-GSDNJFEX.js";import"./chunk-WRAKFX24.js";import"./chunk-IORNFJFE.js";import"./chunk-NCFG7NMN.js";import"./chunk-2ULRYTGT.js";import{b as $}from"./chunk-QVFXGM2U.js";import"./chunk-VAXT7SEG.js";import"./chunk-IW5X5NS4.js";import{$ as Dh,A as br,Aa as U,B as uh,Ba as Oe,Ca as ye,D as ie,E as Ct,F as se,G as bh,H as kh,Ha as L,I as et,J as wh,K as ue,L as $h,M as ro,Ma as Jt,N as Ih,Na as At,O as Dc,Oa as Ke,P as Th,Pa as Yt,Q as x,Qa as mt,R as Eh,Ra as Mr,S as Mh,T as Ne,U as io,V as Rc,W as Se,Y as oo,Z as Cc,_ as pt,a as $s,aa as Pc,b as Xi,ba as Rh,c as eo,ca as Ch,da as Ph,e as vc,ea as ao,f as ih,fa as
1no,g as oh,ga as Lh,h as ah,ha as yt,i as bc,ia as Ir,j as nh,ja as _h,k as Is,ka as co,l as kc,la as Lc,m as wc,ma as Fh,n as ch,na as _c,o as $c,oa as Nh,p as ph,pa as Fc,q as mh,qa as Oh,r as lh,ra as Tr,s as dh,sa as Qt,t as Vt,ta as jh,u as Ic,ua as Bh,v as fh,va as qh,w as Ar,wa as K,x as to,xa as Wh,y as vr,ya as Hh,z as hh,za as So}from"./chunk-5H5SGHCH.js";import{a as Ts,b as xh,c as po,f as Uh,g as Ve,h as mo,i as Nc,j as lo,k as fo,l as Qe,m as ho,o as uo,p as go,q as Gh,r as Oc,s as zh,t as jc,u as Kh,v as Er}from"./chunk-3XS3ZBPH.js";import{a as so,b as kr,c as gh,d as Sh,f as yh,g as wr,h as Tc,j as Ah,m as $r,n as Ec,q as vh,r as Mc,s as Rt}from"./chunk-GSK5XISC.js";import{a as Ht,b as eh,c as Ac,d as th,e as sh,f as rh,g as T}from"./chunk-ZGGTSUVP.js";import{A as Q,B as Xf,C as Dt,D as Zi,d as Hf,f as de,g as He,h as Pe,i as Sc,j as Ji,k as Vf,p as Qf,q as Jf,r as yc,s as Yf,t as Zf,u as I,z as Yi}from"./chunk-YDKCM3XM.js";import{j as Bf,k as me,n as qf}from"./chunk-Z4IUR6GC.js";import"./chunk-AGLEDWR5.js";import{a as Of,b as jf,f as ws,g as xf,h as Uf,i as Gf,j as zf,k as Kf}from"./chunk-E7QCVT25.js";import{w as Mt,x as gc}from"./chunk-XD6NS5E4.js";import{$a as Rf,A as Af,Aa as Mf,Ab as Cf,B as m,C as vf,D as N,Eb as Pf,F as bf,Gd as Ff,H as Wi,Hd as Nf,J as Wt,Ka as Qi,L as fc,M as We,N as kf,Nb as Lf,Oa as vs,P as h,Pa as Df,Q as V,R as ys,S as Hi,V as hc,Wa as bs,X as wf,Y as _,_ as z,a as f,b as y,bb as ks,c as qi,cb as uc,ea as $f,fa as If,ha as Vi,j as dc,ja as A,ka as As,l as ff,la as Tf,m as hf,ma as X,n as uf,nc as _f,oa as S,pa as ne,q as gf,s as Sf,sa as k,t as yf,u as ge,v as d,va as yr,w as Me,wa as De,xa as l,ya as Ef}from"./chunk-2GZCTCDN.js";var Zw=(()=>{class r{constructor(){this.store=l(I),this.platformId=l(ks),this.document=l(Qi),this.scriptService=l(Wf),this.analyticsService=l(Vh),this.title="Momently",this.isAnalyticsLoaded=!1;let e=this.store;vf([e.select(Oe),e.select(L)]).pipe(We(([t,s])=>t.isAuthenticated&&s),Hi(1)).subscribe(([t,s])=>{if(!gc(this.platformId)&&($.production&&(this.user=t.user),t.user&&!t.user.isAdmin)){let i=y(f({},t.user),{workspace:s.name});this.addChat(i),this.addAnalytics(i),this.isAnalyticsLoaded=!0}}),gc(this.platformId)?this.setBaseHref():e.select(So).subscribe(t=>{this.isAnalyticsLoaded&&t?.navigationId!==1&&this.analyticsService.track("pageview")})}setBaseHref(){let e=this.document.getElementsByTagName("base");e.length>0&&e[0].setAttribute("href",$.baseHref)}addChat(e){window._authUser=e,this.scriptService.load({name:"chatlio",id:"",src:"/assets/chat.js",lazy:!0})}addAnalytics(e){this.scriptService.load({name:"mixpanel",id:"",src:"/assets/mixpanel.js",lazy:!0}),this.analyticsService.init(e)}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275cmp=Lf({type:r,selectors:[["app-root"]],decls:1,vars:0,template:function(t,s){t&1&&_f(0,"router-outlet")},dependencies:[Bf],encapsulation:2,changeDetection:0})}}return r})();function Xw(r){return new ne(3e3,!1)}function cM(){return new ne(3100,!1)}function pM(){return new ne(3101,!1)}function mM(r){return new ne(3001,!1)}function lM(r){return new ne(3003,!1)}function dM(r){return new ne(3004,!1)}function t$(r,o){return new ne(3005,!1)}function s$(){return new ne(3006,!1)}function r$(){return new ne(3007,!1)}function i$(r,o){return new ne(3008,!1)}function o$(r){return new ne(3002,!1)}function a$(r,o,e,t,s){return new ne(3010,!1)}function n$(){return new ne(3011,!1)}function c$(){return new ne(3012,!1)}function p$(){return new ne(3200,!1)}function m$(){return new ne(3202,!1)}function l$(){return new ne(3013,!1)}function d$(r){return new ne(3014,!1)}function f$(r){return new ne(3015,!1)}function h$(r){return new ne(3016,!1)}function u$(r,o){return new ne(3404,!1)}function fM(r){return new ne(3502,!1)}function g$(r){return new ne(3503,!1)}function S$(){return new ne(3300,!1)}function y$(r){return new ne(3504,!1)}function A$(r){return new ne(3301,!1)}function v$(r,o){return new ne(3302,!1)}function b$(r){return new ne(3303,!1)}function k$(r,o){return new ne(3400,!1)}function w$(r){return new ne(3401,!1)}function $$(r){return new ne(3402,!1)}function I$(r,o){return new ne(3505,!1)}function wt(r){switch(r.length){case 0:return new Zt;case 1:return r[0];default:return new yo(r)}}function dl(r,o,e=new Map,t=new Map){let s=[],i=[],a=-1,n=null;
vendor: 57,556 bytes, line 1
1if(o.forEach(u=>{let g=u.get("offset"),v=g==a,b=v&&n||new Map;u.forEach((M,P)=>{let D=P,C=M;if(P!=="offset")switch(D=r.normalizePropertyName(D,s),C){case Dr:C=e.get(P);break;case tt:C=t.get(P);break;default:C=r.normalizeStyleValue(P,D,C,s);break}b.set(D,C)}),v||i.push(b),n=b,a=g}),s.length)throw fM(s);return i}function Xa(r,o,e,t){switch(o){case"start":r.onStart(()=>t(e&&pl(e,"start",r)));break;case"done":r.onDone(()=>t(e&&pl(e,"done",r)));break;case"destroy":r.onDestroy(()=>t(e&&pl(e,"destroy",r)));break}}function pl(r,o,e){let t=e.totalTime,s=!!e.disabled,i=en(r.element,r.triggerName,r.fromState,r.toState,o||r.phaseName,t??r.totalTime,s),a=r._data;return a!=null&&(i._data=a),i}function en(r,o,e,t,s="",i=0,a){return{element:r,triggerName:o,fromState:e,toState:t,phaseName:s,totalTime:i,disabled:!!a}}function Ue(r,o,e){let t=r.get(o);return t||r.set(o,t=e),t}function fl(r){let o=r.indexOf(":"),e=r.substring(1,o),t=r.slice(o+1);return[e,t]}var hM=typeof document>"u"?null:document.documentElement;function tn(r){let o=r.parentNode||r.host||null;return o===hM?null:o}function uM(r){return r.substring(1,6)=="ebkit"}var ns=null,e$=!1;function T$(r){ns||(ns=gM()||{},e$=ns.style?"WebkitAppearance"in ns.style:!1);let o=!0;return ns.style&&!uM(r)&&(o=r in ns.style,!o&&e$&&(o="Webkit"+r.charAt(0).toUpperCase()+r.slice(1)in ns.style)),o}function gM(){return typeof document<"u"?document.body:null}function hl(r,o){for(;o;){if(o===r)return!0;o=tn(o)}return!1}function ul(r,o,e){if(e)return Array.from(r.querySelectorAll(o));let t=r.querySelector(o);return t?[t]:[]}var SM=1e3,gl="{{",yM="}}",Sl="ng-enter",sn="ng-leave",Si="ng-trigger",yi=".ng-trigger",yl="ng-animating",rn=".ng-animating";function St(r){if(typeof r=="number")return r;let o=r.match(/^(-?[\.\d]+)(m?s)/);return!o||o.length<2?0:ml(parseFloat(o[1]),o[2])}function ml(r,o){return o==="s"?r*SM:r}function Ai(r,o,e){return r.hasOwnProperty("duration")?r:vM(r,o,e)}var AM=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function vM(r,o,e){let t,s=0,i="";if(typeof r=="string"){let a=r.match(AM);if(a===null)return o.push(Xw(r)),{duration:0,delay:0,easing:""};t=ml(parseFloat(a[1]),a[2]);let n=a[3];n!=null&&(s=ml(parseFloat(n),a[4]));let u=a[5];u&&(i=u)}else t=r;if(!e){let a=!1,n=o.length;t<0&&(o.push(cM()),a=!0),s<0&&(o.push(pM()),a=!0),a&&o.splice(n,0,Xw(r))}return{duration:t,delay:s,easing:i}}function E$(r){return r.length?r[0]instanceof Map?r:r.map(o=>new Map(Object.entries(o))):[]}function ot(r,o,e){o.forEach((t,s)=>{let i=on(s);e&&!e.has(s)&&e.set(s,r.style[i]),r.style[i]=t})}function zt(r,o){o.forEach((e,t)=>{let s=on(t);r.style[s]=""})}function nr(r){return Array.isArray(r)?r.length==1?r[0]:Yh(r):r}function M$(r,o,e){let t=o.params||{},s=Al(r);s.length&&s.forEach(i=>{t.hasOwnProperty(i)||e.push(mM(i))})}var ll=new RegExp(`${gl}\\s*(.+?)\\s*${yM}`,"g");function Al(r){let o=[];if(typeof r=="string"){let e;for(;e=ll.exec(r);)o.push(e[1]);ll.lastIndex=0}return o}function cr(r,o,e){let t=`${r}`,s=t.replace(ll,(i,a)=>{let n=o[a];return n==null&&(e.push(lM(a)),n=""),n.toString()});return s==t?r:s}var bM=/-+([a-z0-9])/g;function on(r){return r.replace(bM,(...o)=>o[1].toUpperCase())}function D$(r,o){return r===0||o===0}function R$(r,o,e){if(e.size&&o.length){let t=o[0],s=[];if(e.forEach((i,a)=>{t.has(a)||s.push(a),t.set(a,i)}),s.length)for(let i=1;i<o.length;i++){let a=o[i];s.forEach(n=>a.set(n,an(r,n)))}}return o}function Ge(r,o,e){switch(o.type){case oe.Trigger:return r.visitTrigger(o,e);case oe.State:return r.visitState(o,e);case oe.Transition:return r.visitTransition(o,e);case oe.Sequence:return r.visitSequence(o,e);case oe.Group:return r.visitGroup(o,e);case oe.Animate:return r.visitAnimate(o,e);case oe.Keyframes:return r.visitKeyframes(o,e);case oe.Style:return r.visitStyle(o,e);case oe.Reference:return r.visitReference(o,e);case oe.AnimateChild:return r.visitAnimateChild(o,e);case oe.AnimateRef:return r.visitAnimateRef(o,e);case oe.Query:return r.visitQuery(o,e);case oe.Stagger:return r.visitStagger(o,e);default:throw dM(o.type)}}function an(r,o){return window.getComputedStyle(r)[o]}var Nl=(()=>{class r{validateStyleProperty(e){return T$(e)}containsElement(e,t){return hl(e,t)}getParentElement(e){return tn(e)}query(e,t,s){return ul(e,t,s)}computeStyle(e,t,s){return s||""}animate(e,t,s,i,a,n=[],u){return new Zt(s,i)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac})}return r})(),ps=class{static NOOP=new Nl},ms=class{};var kM=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),ln=class extends ms{normalizePropertyName(o,e){return on(o)}normalizeStyleValue(o,e,t,s){let i="",a=t.toString().trim();if(kM.has(e)&&t!==0&&t!=="0")if(typeof t=="number")i="px";else{let n=t.match(/^[+-]?[\d\.]+([a-z]*)$/);n&&n[1].length==0&&s.push(t$(o,t))}return a+i}};var dn="*";function wM(r,o){let e=[];return typeof r=="string"?r.split(/\s*,\s*/).forEach(t=>$M(t,e,o)):e.push(r),e}function $M(r,o,e){if(r[0]==":"){let u=IM(r,e);if(typeof u=="function"){o.push(u);return}r=u}let t=r.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(t==null||t.length<4)return e.push(f$(r)),o;let s=t[1],i=t[2],a=t[3];o.push(C$(s,a));let n=s==dn&&a==dn;i[0]=="<"&&!n&&o.push(C$(a,s))}function IM(r,o){switch(r){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,t)=>parseFloat(t)>parseFloat(e);case":decrement":return(e,t)=>parseFloat(t)<parseFloat(e);default:return o.push(h$(r)),"* => *"}}var nn=new Set(["true","1"]),cn=new Set(["false","0"]);function C$(r,o){let e=nn.has(r)||cn.has(r),t=nn.has(o)||cn.has(o);return(s,i)=>{let a=r==dn||r==s,n=o==dn||o==i;return!a&&e&&typeof s=="boolean"&&(a=s?nn.has(r):cn.has(r)),!n&&t&&typeof i=="boolean"&&(n=i?nn.has(o):cn.has(o)),a&&n}}var G$=":self",TM=new RegExp(`s*${G$}s*,?`,"g");function z$(r,o,e,t){return new Il(r).build(o,e,t)}var P$="",Il=class{_driver;constructor(o){this._driver=o}build(o,e,t){let s=new Tl(e);return this._resetContextStyleTimingState(s),Ge(this,nr(o),s)}_resetContextStyleTimingState(o){o.currentQuerySelector=P$,o.collectedStyles=new Map,o.collectedStyles.set(P$,new Map),o.currentTime=0}visitTrigger(o,e){let t=e.queryCount=0,s=e.depCount=0,i=[],a=[];return o.name.charAt(0)=="@"&&e.errors.push(s$()),o.definitions.forEach(n=>{if(this._resetContextStyleTimingState(e),n.type==oe.State){let u=n,g=u.name;g.toString().split(/\s*,\s*/).forEach(v=>{u.name=v,i.push(this.visitState(u,e))}),u.name=g}else if(n.type==oe.Transition){let u=this.visitTransition(n,e);t+=u.queryCount,s+=u.depCount,a.push(u)}else e.errors.push(r$())}),{type:oe.Trigger,name:o.name,states:i,transitions:a,queryCount:t,depCount:s,options:null}}visitState(o,e){let t=this.visitStyle(o.styles,e),s=o.options&&o.options.params||null;if(t.containsDynamicStyles){let i=new Set,a=s||{};t.styles.forEach(n=>{n instanceof Map&&n.forEach(u=>{Al(u).forEach(g=>{a.hasOwnProperty(g)||i.add(g)})})}),i.size&&e.errors.push(i$(o.name,[...i.values()]))}return{type:oe.State,name:o.name,style:t,options:s?{params:s}:null}}visitTransition(o,e){e.queryCount=0,e.depCount=0;let t=Ge(this,nr(o.animation),e),s=wM(o.expr,e.errors);return{type:oe.Transition,matchers:s,animation:t,queryCount:e.queryCount,depCount:e.depCount,options:cs(o.options)}}visitSequence(o,e){return{type:oe.Sequence,steps:o.steps.map(t=>Ge(this,t,e)),options:cs(o.options)}}visitGroup(o,e){let t=e.currentTime,s=0,i=o.steps.map(a=>{e.currentTime=t;let n=Ge(this,a,e);return s=Math.max(s,e.currentTime),n});return e.currentTime=s,{type:oe.Group,steps:i,options:cs(o.options)}}visitAnimate(o,e){let t=RM(o.timings,e.errors);e.currentAnimateTimings=t;let s,i=o.styles?o.styles:xc({});if(i.type==oe.Keyframes)s=this.visitKeyframes(i,e);else{let a=o.styles,n=!1;if(!a){n=!0;let g={};t.easing&&(g.easing=t.easing),a=xc(g)}e.currentTime+=t.duration+t.delay;let u=this.visitStyle(a,e);u.isEmptyStep=n,s=u}return e.currentAnimateTimings=null,{type:oe.Animate,timings:t,style:s,options:null}}visitStyle(o,e){let t=this._makeStyleAst(o,e);return this._validateStyleAst(t,e),t}_makeStyleAst(o,e){let t=[],s=Array.isArray(o.styles)?o.styles:[o.styles];for(let n of s)typeof n=="string"?n===tt?t.push(n):e.errors.push(o$(n)):t.push(new Map(Object.entries(n)));let i=!1,a=null;return t.forEach(n=>{if(n instanceof Map&&(n.has("easing")&&(a=n.get("easing"),n.delete("easing")),!i)){for(let u of n.values())if(u.toString().indexOf(gl)>=0){i=!0;break}}}),{type:oe.Style,styles:t,easing:a,offset:o.offset,containsDynamicStyles:i,options:null}}_validateStyleAst(o,e){let t=e.currentAnimateTimings,s=e.currentTime,i=e.currentTime;t&&i>0&&(i-=t.duration+t.delay),o.styles.forEach(a=>{typeof a!="string"&&a.forEach((n,u)=>{let g=e.collectedStyles.get(e.currentQuerySelector),v=g.get(u),b=!0;v&&(i!=s&&i>=v.startTime&&s<=v.endTime&&(e.errors.push(a$(u,v.startTime,v.endTime,i,s)),b=!1),i=v.startTime),b&&g.set(u,{startTime:i,endTime:s}),e.options&&M$(n,e.options,e.errors)})})}visitKeyframes(o,e){let t={type:oe.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(n$()),t;let s=1,i=0,a=[],n=!1,u=!1,g=0,v=o.steps.map(j=>{let q=this._makeStyleAst(j,e),J=q.offset!=null?q.offset:DM(q.styles),O=0;return J!=null&&(i++,O=q.offset=J),u=u||O<0||O>1,n=n||O<g,g=O,a.push(O),q});u&&e.errors.push(c$()),n&&e.errors.push(p$());let b=o.steps.length,M=0;i>0&&i<b?e.errors.push(m$()):i==0&&(M=s/(b-1));let P=b-1,D=e.currentTime,C=e.currentAnimateTimings,F=C.duration;return v.forEach((j,q)=>{let J=M>0?q==P?1:M*q:a[q],O=J*F;e.currentTime=D+C.delay+O,C.duration=O,this._validateStyleAst(j,e),j.offset=J,t.styles.push(j)}),t}visitReference(o,e){return{type:oe.Reference,animation:Ge(this,nr(o.animation),e),options:cs(o.options)}}visitAnimateChild(o,e){return e.depCount++,{type:oe.AnimateChild,options:cs(o.options)}}visitAnimateRef(o,e){return{type:oe.AnimateRef,animation:this.visitReference(o.animation,e),options:cs(o.options)}}visitQuery(o,e){let t=e.currentQuerySelector,s=o.options||{};e.queryCount++,e.currentQuery=o;let[i,a]=EM(o.selector);e.currentQuerySelector=t.length?t+" "+i:i,Ue(e.collectedStyles,e.currentQuerySelector,new Map);let n=Ge(this,nr(o.animation),e);return e.currentQuery=null,e.currentQuerySelector=t,{type:oe.Query,selector:i,limit:s.limit||0,optional:!!s.optional,includeSelf:a,animation:n,originalSelector:o.selector,options:cs(o.options)}}visitStagger(o,e){e.currentQuery||e.errors.push(l$());let t=o.timings==="full"?{duration:0,delay:0,easing:"full"}:Ai(o.timings,e.errors,!0);return{type:oe.Stagger,animation:Ge(this,nr(o.animation),e),timings:t,options:null}}};function EM(r){let o=!!r.split(/\s*,\s*/).find(e=>e==G$);return o&&(r=r.replace(TM,"")),r=r.replace(/@\*/g,yi).replace(/@\w+/g,e=>yi+"-"+e.slice(1)).replace(/:animating/g,rn),[r,o]}function MM(r){return r?f({},r):null}var Tl=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(o){this.errors=o}};function DM(r){if(typeof r=="string")return null;let o=null;if(Array.isArray(r))r.forEach(e=>{if(e instanceof Map&&e.has("offset")){let t=e;o=parseFloat(t.get("offset")),t.delete("offset")}});else if(r instanceof Map&&r.has("offset")){let e=r;o=parseFloat(e.get("offset")),e.delete("offset")}return o}function RM(r,o){if(r.hasOwnProperty("duration"))return r;if(typeof r=="number"){let i=Ai(r,o).duration;return vl(i,0,"")}let e=r;if(e.split(/\s+/).some(i=>i.charAt(0)=="{"&&i.charAt(1)=="{")){let i=vl(0,0,"");return i.dynamic=!0,i.strValue=e,i}let s=Ai(e,o);return vl(s.duration,s.delay,s.easing)}function cs(r){return r?(r=f({},r),r.params&&(r.params=MM(r.params))):r={},r}function vl(r,o,e){return{duration:r,delay:o,easing:e}}function Ol(r,o,e,t,s,i,a=null,n=!1){return{type:1,element:r,keyframes:o,preStyleProps:e,postStyleProps:t,duration:s,delay:i,totalTime:s+i,easing:a,subTimeline:n}}var bi=class{_map=new Map;get(o){return this._map.get(o)||[]}append(o,e){let t=this._map.get(o);t||this._map.set(o,t=[]),t.push(...e)}has(o){return this._map.has(o)}clear(){this._map.clear()}},CM=1,PM=":enter",LM=new RegExp(PM,"g"),_M=":leave",FM=new RegExp(_M,"g");function K$(r,o,e,t,s,i=new Map,a=new Map,n,u,g=[]){return new El().buildKeyframes(r,o,e,t,s,i,a,n,u,g)}var El=class{buildKeyframes(o,e,t,s,i,a,n,u,g,v=[]){g=g||new bi;let b=new Ml(o,e,g,s,i,v,[]);b.options=u;let M=u.delay?St(u.delay):0;b.currentTimeline.delayNextStep(M),b.currentTimeline.setStyles([a],null,b.errors,u),Ge(this,t,b);let P=b.timelines.filter(D=>D.containsAnimation());if(P.length&&n.size){let D;for(let C=P.length-1;C>=0;C--){let F=P[C];if(F.element===e){D=F;break}}D&&!D.allowOnlyTimelineStyles()&&D.setStyles([n],null,b.errors,u)}return P.length?P.map(D=>D.buildKeyframes()):[Ol(e,[],[],[],0,M,"",!1)]}visitTrigger(o,e){}visitState(o,e){}visitTransition(o,e){}visitAnimateChild(o,e){let t=e.subInstructions.get(e.element);if(t){let s=e.createSubContext(o.options),i=e.currentTimeline.currentTime,a=this._visitSubInstructions(t,s,s.options);i!=a&&e.transformIntoNewTimeline(a)}e.previousNode=o}visitAnimateRef(o,e){let t=e.createSubContext(o.options);t.transformIntoNewTimeline(),this._applyAnimationRefDelays([o.options,o.animation.options],e,t),this.visitReference(o.animation,t),e.transformIntoNewTimeline(t.currentTimeline.currentTime),e.previousNode=o}_applyAnimationRefDelays(o,e,t){for(let s of o){let i=s?.delay;if(i){let a=typeof i=="number"?i:St(cr(i,s?.params??{},e.errors));t.delayNextStep(a)}}}_visitSubInstructions(o,e,t){let i=e.currentTimeline.currentTime,a=t.duration!=null?St(t.duration):null,n=t.delay!=null?St(t.delay):null;return a!==0&&o.forEach(u=>{let g=e.appendInstructionToTimeline(u,a,n);i=Math.max(i,g.duration+g.delay)}),i}visitReference(o,e){e.updateOptions(o.options,!0),Ge(this,o.animation,e),e.previousNode=o}visitSequence(o,e){let t=e.subContextCount,s=e,i=o.options;if(i&&(i.params||i.delay)&&(s=e.createSubContext(i),s.transformIntoNewTimeline(),i.delay!=null)){s.previousNode.type==oe.Style&&(s.currentTimeline.snapshotCurrentStyles(),s.previousNode=fn);let a=St(i.delay);s.delayNextStep(a)}o.steps.length&&(o.steps.forEach(a=>Ge(this,a,s)),s.currentTimeline.applyStylesToKeyframe(),s.subContextCount>t&&s.transformIntoNewTimeline()),e.previousNode=o}visitGroup(o,e){let t=[],s=e.currentTimeline.currentTime,i=o.options&&o.options.delay?St(o.options.delay):0;o.steps.forEach(a=>{let n=e.createSubContext(o.options);i&&n.delayNextStep(i),Ge(this,a,n),s=Math.max(s,n.currentTimeline.currentTime),t.push(n.currentTimeline)}),t.forEach(a=>e.currentTimeline.mergeTimelineCollectedStyles(a)),e.transformIntoNewTimeline(s),e.previousNode=o}_visitTiming(o,e){if(o.dynamic){let t=o.strValue,s=e.params?cr(t,e.params,e.errors):t;return Ai(s,e.errors)}else return{duration:o.duration,delay:o.delay,easing:o.easing}}visitAnimate(o,e){let t=e.currentAnimateTimings=this._visitTiming(o.timings,e),s=e.currentTimeline;t.delay&&(e.incrementTime(t.delay),s.snapshotCurrentStyles());let i=o.style;i.type==oe.Keyframes?this.visitKeyframes(i,e):(e.incrementTime(t.duration),this.visitStyle(i,e),s.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=o}visitStyle(o,e){let t=e.currentTimeline,s=e.currentAnimateTimings;!s&&t.hasCurrentStyleProperties()&&t.forwardFrame();let i=s&&s.easing||o.easing;o.isEmptyStep?t.applyEmptyStep(i):t.setStyles(o.styles,i,e.errors,e.options),e.previousNode=o}visitKeyframes(o,e){let t=e.currentAnimateTimings,s=e.currentTimeline.duration,i=t.duration,n=e.createSubContext().currentTimeline;n.easing=t.easing,o.styles.forEach(u=>{let g=u.offset||0;n.forwardTime(g*i),n.setStyles(u.styles,u.easing,e.errors,e.options),n.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(n),e.transformIntoNewTimeline(s+i),e.previousNode=o}visitQuery(o,e){let t=e.currentTimeline.currentTime,s=o.options||{},i=s.delay?St(s.delay):0;i&&(e.previousNode.type===oe.Style||t==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=fn);let a=t,n=e.invokeQuery(o.selector,o.originalSelector,o.limit,o.includeSelf,!!s.optional,e.errors);e.currentQueryTotal=n.length;let u=null;n.forEach((g,v)=>{e.currentQueryIndex=v;let b=e.createSubContext(o.options,g);i&&b.delayNextStep(i),g===e.element&&(u=b.currentTimeline),Ge(this,o.animation,b),b.currentTimeline.applyStylesToKeyframe();let M=b.currentTimeline.currentTime;a=Math.max(a,M)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(a),u&&(e.currentTimeline.mergeTimelineCollectedStyles(u),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=o}visitStagger(o,e){let t=e.parentContext,s=e.currentTimeline,i=o.timings,a=Math.abs(i.duration),n=a*(e.currentQueryTotal-1),u=a*e.currentQueryIndex;switch(i.duration<0?"reverse":i.easing){case"reverse":u=n-u;break;case"full":u=t.currentStaggerTime;break}let v=e.currentTimeline;u&&v.delayNextStep(u);let b=v.currentTime;Ge(this,o.animation,e),e.previousNode=o,t.currentStaggerTime=s.currentTime-b+(s.startTime-t.currentTimeline.startTime)}},fn={},Ml=class r{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=fn;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(o,e,t,s,i,a,n,u){this._driver=o,this.element=e,this.subInstructions=t,this._enterClassName=s,this._leaveClassName=i,this.errors=a,this.timelines=n,this.currentTimeline=u||new hn(this._driver,e,0),n.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(o,e){if(!o)return;let t=o,s=this.options;t.duration!=null&&(s.duration=St(t.duration)),t.delay!=null&&(s.delay=St(t.delay));let i=t.params;if(i){let a=s.params;a||(a=this.options.params={}),Object.keys(i).forEach(n=>{(!e||!a.hasOwnProperty(n))&&(a[n]=cr(i[n],a,this.errors))})}}_copyOptions(){let o={};if(this.options){let e=this.options.params;if(e){let t=o.params={};Object.keys(e).forEach(s=>{t[s]=e[s]})}}return o}createSubContext(o=null,e,t){let s=e||this.element,i=new r(this._driver,s,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(s,t||0));return i.previousNode=this.previousNode,i.currentAnimateTimings=this.currentAnimateTimings,i.options=this._copyOptions(),i.updateOptions(o),i.currentQueryIndex=this.currentQueryIndex,i.currentQueryTotal=this.currentQueryTotal,i.parentContext=this,this.subContextCount++,i}transformIntoNewTimeline(o){return this.previousNode=fn,this.currentTimeline=this.currentTimeline.fork(this.element,o),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(o,e,t){let s={duration:e??o.duration,delay:this.currentTimeline.currentTime+(t??0)+o.delay,easing:""},i=new Dl(this._driver,o.element,o.keyframes,o.preStyleProps,o.postStyleProps,s,o.stretchStartingKeyframe);return this.timelines.push(i),s}incrementTime(o){this.currentTimeline.forwardTime(this.currentTimeline.duration+o)}delayNextStep(o){o>0&&this.currentTimeline.delayNextStep(o)}invokeQuery(o,e,t,s,i,a){let n=[];if(s&&n.push(this.element),o.length>0){o=o.replace(LM,"."+this._enterClassName),o=o.replace(FM,"."+this._leaveClassName);let u=t!=1,g=this._driver.query(this.element,o,u);t!==0&&(g=t<0?g.slice(g.length+t,g.length):g.slice(0,t)),n.push(...g)}return!i&&n.length==0&&a.push(d$(e)),n}},hn=class r{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(o,e,t,s){this._driver=o,this.element=e,this.startTime=t,this._elementTimelineStylesLookup=s,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(o){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+o),e&&this.snapshotCurrentStyles()):this.startTime+=o}fork(o,e){return this.applyStylesToKeyframe(),new r(this._driver,o,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=CM,this._loadKeyframe()}forwardTime(o){this.applyStylesToKeyframe(),this.duration=o,this._loadKeyframe()}_updateStyle(o,e){this._localTimelineStyles.set(o,e),this._globalTimelineStyles.set(o,e),this._styleSummary.set(o,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(o){o&&this._previousKeyframe.set("easing",o);for(let[e,t]of this._globalTimelineStyles)this._backFill.set(e,t||tt),this._currentKeyframe.set(e,tt);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(o,e,t,s){e&&this._previousKeyframe.set("easing",e);let i=s&&s.params||{},a=NM(o,this._globalTimelineStyles);for(let[n,u]of a){let g=cr(u,i,t);this._pendingStyles.set(n,g),this._localTimelineStyles.has(n)||this._backFill.set(n,this._globalTimelineStyles.get(n)??tt),this._updateStyle(n,g)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((o,e)=>{this._currentKeyframe.set(e,o)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((o,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,o)}))}snapshotCurrentStyles(){for(let[o,e]of this._localTimelineStyles)this._pendingStyles.set(o,e),this._updateStyle(o,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let o=[];for(let e in this._currentKeyframe)o.push(e);return o}mergeTimelineCollectedStyles(o){o._styleSummary.forEach((e,t)=>{let s=this._styleSummary.get(t);(!s||e.time>s.time)&&this._updateStyle(t,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let o=new Set,e=new Set,t=this._keyframes.size===1&&this.duration===0,s=[];this._keyframes.forEach((n,u)=>{let g=new Map([...this._backFill,...n]);g.forEach((v,b)=>{v===Dr?o.add(b):v===tt&&e.add(b)}),t||g.set("offset",u/this.duration),s.push(g)});let i=[...o.values()],a=[...e.values()];if(t){let n=s[0],u=new Map(n);n.set("offset",0),u.set("offset",1),s=[n,u]}return Ol(this.element,s,i,a,this.duration,this.startTime,this.easing,!1)}},Dl=class extends hn{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(o,e,t,s,i,a,n=!1){super(o,e,a.delay),this.keyframes=t,this.preStyleProps=s,this.postStyleProps=i,this._stretchStartingKeyframe=n,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let o=this.keyframes,{delay:e,duration:t,easing:s}=this.timings;if(this._stretchStartingKeyframe&&e){let i=[],a=t+e,n=e/a,u=new Map(o[0]);u.set("offset",0),i.push(u);let g=new Map(o[0]);g.set("offset",L$(n)),i.push(g);let v=o.length-1;for(let b=1;b<=v;b++){let M=new Map(o[b]),P=M.get("offset"),D=e+P*t;M.set("offset",L$(D/a)),i.push(M)}t=a,e=0,s="",o=i}return Ol(this.element,o,this.preStyleProps,this.postStyleProps,t,e,s,!0)}};function L$(r,o=3){let e=Math.pow(10,o-1);return Math.round(r*e)/e}function NM(r,o){let e=new Map,t;return r.forEach(s=>{if(s==="*"){t??=o.keys();for(let i of t)e.set(i,tt)}else for(let[i,a]of s)e.set(i,a)}),e}function _$(r,o,e,t,s,i,a,n,u,g,v,b,M){return{type:0,element:r,triggerName:o,isRemovalTransition:s,fromState:e,fromStyles:i,toState:t,toStyles:a,timelines:n,queriedElements:u,preStyleProps:g,postStyleProps:v,totalTime:b,errors:M}}var bl={},un=class{_triggerName;ast;_stateStyles;constructor(o,e,t){this._triggerName=o,this.ast=e,this._stateStyles=t}match(o,e,t,s){return OM(this.ast.matchers,o,e,t,s)}buildStyles(o,e,t){let s=this._stateStyles.get("*");return o!==void 0&&(s=this._stateStyles.get(o?.toString())||s),s?s.buildStyles(e,t):new Map}build(o,e,t,s,i,a,n,u,g,v){let b=[],M=this.ast.options&&this.ast.options.params||bl,P=n&&n.params||bl,D=this.buildStyles(t,P,b),C=u&&u.params||bl,F=this.buildStyles(s,C,b),j=new Set,q=new Map,J=new Map,O=s==="void",re={params:B$(C,M),delay:this.ast.options?.delay},Y=v?[]:K$(o,e,this.ast.animation,i,a,D,F,re,g,b),Z=0;return Y.forEach(ee=>{Z=Math.max(ee.duration+ee.delay,Z)}),b.length?_$(e,this._triggerName,t,s,O,D,F,[],[],q,J,Z,b):(Y.forEach(ee=>{let le=ee.element,Be=Ue(q,le,new Set);ee.preStyleProps.forEach(Xe=>Be.add(Xe));let Ki=Ue(J,le,new Set);ee.postStyleProps.forEach(Xe=>Ki.add(Xe)),le!==e&&j.add(le)}),_$(e,this._triggerName,t,s,O,D,F,Y,[...j.values()],q,J,Z))}};function OM(r,o,e,t,s){return r.some(i=>i(o,e,t,s))}function B$(r,o){let e=f({},o);return Object.entries(r).forEach(([t,s])=>{s!=null&&(e[t]=s)}),e}var Rl=class{styles;defaultParams;normalizer;constructor(o,e,t){this.styles=o,this.defaultParams=e,this.normalizer=t}buildStyles(o,e){let t=new Map,s=B$(o,this.defaultParams);return this.styles.styles.forEach(i=>{typeof i!="string"&&i.forEach((a,n)=>{a&&(a=cr(a,s,e));let u=this.normalizer.normalizePropertyName(n,e);a=this.normalizer.normalizeStyleValue(n,u,a,e),t.set(n,a)})}),t}};function jM(r,o,e){return new Cl(r,o,e)}var Cl=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(o,e,t){this.name=o,this.ast=e,this._normalizer=t,e.states.forEach(s=>{let i=s.options&&s.options.params||{};this.states.set(s.name,new Rl(s.style,i,t))}),F$(this.states,"true","1"),F$(this.states,"false","0"),e.transitions.forEach(s=>{this.transitionFactories.push(new un(o,s,this.states))}),this.fallbackTransition=xM(o,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(o,e,t,s){return this.transitionFactories.find(a=>a.match(o,e,t,s))||null}matchStyles(o,e,t){return this.fallbackTransition.buildStyles(o,e,t)}};function xM(r,o,e){let t=[(a,n)=>!0],s={type:oe.Sequence,steps:[],options:null},i={type:oe.Transition,animation:s,matchers:t,options:null,queryCount:0,depCount:0};return new un(r,i,o)}function F$(r,o,e){r.has(o)?r.has(e)||r.set(e,r.get(o)):r.has(e)&&r.set(o,r.get(e))}var UM=new bi,Pl=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(o,e,t){this.bodyNode=o,this._driver=e,this._normalizer=t}register(o,e){let t=[],s=[],i=z$(this._driver,e,t,s);if(t.length)throw g$(t);this._animations.set(o,i)}_buildPlayer(o,e,t){let s=o.element,i=dl(this._normalizer,o.keyframes,e,t);return this._driver.animate(s,i,o.duration,o.delay,o.easing,[],!0)}create(o,e,t={}){let s=[],i=this._animations.get(o),a,n=new Map;if(i?(a=K$(this._driver,e,i,Sl,sn,new Map,new Map,t,UM,s),a.forEach(v=>{let b=Ue(n,v.element,new Map);v.postStyleProps.forEach(M=>b.set(M,null))})):(s.push(S$()),a=[]),s.length)throw y$(s);n.forEach((v,b)=>{v.forEach((M,P)=>{v.set(P,this._driver.computeStyle(b,P,tt))})});let u=a.map(v=>{let b=n.get(v.element);return this._buildPlayer(v,new Map,b)}),g=wt(u);return this._playersById.set(o,g),g.onDestroy(()=>this.destroy(o)),this.players.push(g),g}destroy(o){let e=this._getPlayer(o);e.destroy(),this._playersById.delete(o);let t=this.players.indexOf(e);t>=0&&this.players.splice(t,1)}_getPlayer(o){let e=this._playersById.get(o);if(!e)throw A$(o);return e}listen(o,e,t,s){let i=en(e,"","","");return Xa(this._getPlayer(o),t,i,s),()=>{}}command(o,e,t,s){if(t=="register"){this.register(o,s[0]);return}if(t=="create"){let a=s[0]||{};this.create(o,e,a);return}let i=this._getPlayer(o);switch(t){case"play":i.play();break;case"pause":i.pause();break;case"reset":i.reset();break;case"restart":i.restart();break;case"finish":i.finish();break;case"init":i.init();break;case"setPosition":i.setPosition(parseFloat(s[0]));break;case"destroy":this.destroy(o);break}}},N$="ng-animate-queued",GM=".ng-animate-queued",kl="ng-animate-disabled",zM=".ng-animate-disabled",KM="ng-star-inserted",BM=".ng-star-inserted",qM=[],q$={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},WM={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},at="__ng_removed",ki=class{namespaceId;value;options;get params(){return this.options.params}constructor(o,e=""){this.namespaceId=e;let t=o&&o.hasOwnProperty("value"),s=t?o.value:o;if(this.value=VM(s),t){let i=o,{value:a}=i,n=qi(i,["value"]);this.options=n}else this.options={};this.options.params||(this.options.params={})}absorbOptions(o){let e=o.params;if(e){let t=this.options.params;Object.keys(e).forEach(s=>{t[s]==null&&(t[s]=e[s])})}}},vi="void",wl=new ki(vi),Ll=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(o,e,t){this.id=o,this.hostElement=e,this._engine=t,this._hostClassName="ng-tns-"+o,Ze(e,this._hostClassName)}listen(o,e,t,s){if(!this._triggers.has(e))throw v$(t,e);if(t==null||t.length==0)throw b$(e);if(!QM(t))throw k$(t,e);let i=Ue(this._elementListeners,o,[]),a={name:e,phase:t,callback:s};i.push(a);let n=Ue(this._engine.statesByElement,o,new Map);return n.has(e)||(Ze(o,Si),Ze(o,Si+"-"+e),n.set(e,wl)),()=>{this._engine.afterFlush(()=>{let u=i.indexOf(a);u>=0&&i.splice(u,1),this._triggers.has(e)||n.delete(e)})}}register(o,e){return this._triggers.has(o)?!1:(this._triggers.set(o,e),!0)}_getTrigger(o){let e=this._triggers.get(o);if(!e)throw w$(o);return e}trigger(o,e,t,s=!0){let i=this._getTrigger(e),a=new wi(this.id,e,o),n=this._engine.statesByElement.get(o);n||(Ze(o,Si),Ze(o,Si+"-"+e),this._engine.statesByElement.set(o,n=new Map));let u=n.get(e),g=new ki(t,this.id);if(!(t&&t.hasOwnProperty("value"))&&u&&g.absorbOptions(u.options),n.set(e,g),u||(u=wl),!(g.value===vi)&&u.value===g.value){if(!ZM(u.params,g.params)){let C=[],F=i.matchStyles(u.value,u.params,C),j=i.matchStyles(g.value,g.params,C);C.length?this._engine.reportError(C):this._engine.afterFlush(()=>{zt(o,F),ot(o,j)})}return}let M=Ue(this._engine.playersByElement,o,[]);M.forEach(C=>{C.namespaceId==this.id&&C.triggerName==e&&C.queued&&C.destroy()});let P=i.matchTransition(u.value,g.value,o,g.params),D=!1;if(!P){if(!s)return;P=i.fallbackTransition,D=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:o,triggerName:e,transition:P,fromState:u,toState:g,player:a,isFallbackTransition:D}),D||(Ze(o,N$),a.onStart(()=>{pr(o,N$)})),a.onDone(()=>{let C=this.players.indexOf(a);C>=0&&this.players.splice(C,1);let F=this._engine.playersByElement.get(o);if(F){let j=F.indexOf(a);j>=0&&F.splice(j,1)}}),this.players.push(a),M.push(a),a}deregister(o){this._triggers.delete(o),this._engine.statesByElement.forEach(e=>e.delete(o)),this._elementListeners.forEach((e,t)=>{this._elementListeners.set(t,e.filter(s=>s.name!=o))})}clearElementCache(o){this._engine.statesByElement.delete(o),this._elementListeners.delete(o);let e=this._engine.playersByElement.get(o);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(o))}_signalRemovalForInnerTriggers(o,e){let t=this._engine.driver.query(o,yi,!0);t.forEach(s=>{if(s[at])return;let i=this._engine.fetchNamespacesByElement(s);i.size?i.forEach(a=>a.triggerLeaveAnimation(s,e,!1,!0)):this.clearElementCache(s)}),this._engine.afterFlushAnimationsDone(()=>t.forEach(s=>this.clearElementCache(s)))}triggerLeaveAnimation(o,e,t,s){let i=this._engine.statesByElement.get(o),a=new Map;if(i){let n=[];if(i.forEach((u,g)=>{if(a.set(g,u.value),this._triggers.has(g)){let v=this.trigger(o,g,vi,s);v&&n.push(v)}}),n.length)return this._engine.markElementAsRemoved(this.id,o,!0,e,a),t&&wt(n).onDone(()=>this._engine.processLeaveNode(o)),!0}return!1}prepareLeaveAnimationListeners(o){let e=this._elementListeners.get(o),t=this._engine.statesByElement.get(o);if(e&&t){let s=new Set;e.forEach(i=>{let a=i.name;if(s.has(a))return;s.add(a);let u=this._triggers.get(a).fallbackTransition,g=t.get(a)||wl,v=new ki(vi),b=new wi(this.id,a,o);this._engine.totalQueuedPlayers++,this._queue.push({element:o,triggerName:a,transition:u,fromState:g,toState:v,player:b,isFallbackTransition:!0})})}}removeNode(o,e){let t=this._engine;if(o.childElementCount&&this._signalRemovalForInnerTriggers(o,e),this.triggerLeaveAnimation(o,e,!0))return;let s=!1;if(t.totalAnimations){let i=t.players.length?t.playersByQueriedElement.get(o):[];if(i&&i.length)s=!0;else{let a=o;for(;a=a.parentNode;)if(t.statesByElement.get(a)){s=!0;break}}}if(this.prepareLeaveAnimationListeners(o),s)t.markElementAsRemoved(this.id,o,!1,e);else{let i=o[at];(!i||i===q$)&&(t.afterFlush(()=>this.clearElementCache(o)),t.destroyInnerAnimations(o),t._onRemovalComplete(o,e))}}insertNode(o,e){Ze(o,this._hostClassName)}drainQueuedTransitions(o){let e=[];return this._queue.forEach(t=>{let s=t.player;if(s.destroyed)return;let i=t.element,a=this._elementListeners.get(i);a&&a.forEach(n=>{if(n.name==t.triggerName){let u=en(i,t.triggerName,t.fromState.value,t.toState.value);u._data=o,Xa(t.player,n.phase,u,n.callback)}}),s.markedForDestroy?this._engine.afterFlush(()=>{s.destroy()}):e.push(t)}),this._queue=[],e.sort((t,s)=>{let i=t.transition.ast.depCount,a=s.transition.ast.depCount;return i==0||a==0?i-a:this._engine.driver.containsElement(t.element,s.element)?1:-1})}destroy(o){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,o)}},_l=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(o,e)=>{};_onRemovalComplete(o,e){this.onRemovalComplete(o,e)}constructor(o,e,t){this.bodyNode=o,this.driver=e,this._normalizer=t}get queuedPlayers(){let o=[];return this._namespaceList.forEach(e=>{e.players.forEach(t=>{t.queued&&o.push(t)})}),o}createNamespace(o,e){let t=new Ll(o,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(t,e):(this.newHostElements.set(e,t),this.collectEnterElement(e)),this._namespaceLookup[o]=t}_balanceNamespaceList(o,e){let t=this._namespaceList,s=this.namespacesByHostElement;if(t.length-1>=0){let a=!1,n=this.driver.getParentElement(e);for(;n;){let u=s.get(n);if(u){let g=t.indexOf(u);t.splice(g+1,0,o),a=!0;break}n=this.driver.getParentElement(n)}a||t.unshift(o)}else t.push(o);return s.set(e,o),o}register(o,e){let t=this._namespaceLookup[o];return t||(t=this.createNamespace(o,e)),t}registerTrigger(o,e,t){let s=this._namespaceLookup[o];s&&s.register(e,t)&&this.totalAnimations++}destroy(o,e){o&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let t=this._fetchNamespace(o);this.namespacesByHostElement.delete(t.hostElement);let s=this._namespaceList.indexOf(t);s>=0&&this._namespaceList.splice(s,1),t.destroy(e),delete this._namespaceLookup[o]}))}_fetchNamespace(o){return this._namespaceLookup[o]}fetchNamespacesByElement(o){let e=new Set,t=this.statesByElement.get(o);if(t){for(let s of t.values())if(s.namespaceId){let i=this._fetchNamespace(s.namespaceId);i&&e.add(i)}}return e}trigger(o,e,t,s){if(pn(e)){let i=this._fetchNamespace(o);if(i)return i.trigger(e,t,s),!0}return!1}insertNode(o,e,t,s){if(!pn(e))return;let i=e[at];if(i&&i.setForRemoval){i.setForRemoval=!1,i.setForMove=!0;let a=this.collectedLeaveElements.indexOf(e);a>=0&&this.collectedLeaveElements.splice(a,1)}if(o){let a=this._fetchNamespace(o);a&&a.insertNode(e,t)}s&&this.collectEnterElement(e)}collectEnterElement(o){this.collectedEnterElements.push(o)}markElementAsDisabled(o,e){e?this.disabledNodes.has(o)||(this.disabledNodes.add(o),Ze(o,kl)):this.disabledNodes.has(o)&&(this.disabledNodes.delete(o),pr(o,kl))}removeNode(o,e,t){if(pn(e)){let s=o?this._fetchNamespace(o):null;s?s.removeNode(e,t):this.markElementAsRemoved(o,e,!1,t);let i=this.namespacesByHostElement.get(e);i&&i.id!==o&&i.removeNode(e,t)}else this._onRemovalComplete(e,t)}markElementAsRemoved(o,e,t,s,i){this.collectedLeaveElements.push(e),e[at]={namespaceId:o,setForRemoval:s,hasAnimation:t,removedBeforeQueried:!1,previousTriggersValues:i}}listen(o,e,t,s,i){return pn(e)?this._fetchNamespace(o).listen(e,t,s,i):()=>{}}_buildInstruction(o,e,t,s,i){return o.transition.build(this.driver,o.element,o.fromState.value,o.toState.value,t,s,o.fromState.options,o.toState.options,e,i)}destroyInnerAnimations(o){let e=this.driver.query(o,yi,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(o,rn,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(o){let e=this.playersByElement.get(o);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(o){let e=this.playersByQueriedElement.get(o);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(o=>{if(this.players.length)return wt(this.players).onDone(()=>o());o()})}processLeaveNode(o){let e=o[at];if(e&&e.setForRemoval){if(o[at]=q$,e.namespaceId){this.destroyInnerAnimations(o);let t=this._fetchNamespace(e.namespaceId);t&&t.clearElementCache(o)}this._onRemovalComplete(o,e.setForRemoval)}o.classList?.contains(kl)&&this.markElementAsDisabled(o,!1),this.driver.query(o,zM,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(o=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,s)=>this._balanceNamespaceList(t,s)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let t=0;t<this.collectedEnterElements.length;t++){let s=this.collectedEnterElements[t];Ze(s,KM)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let t=[];try{e=this._flushAnimations(t,o)}finally{for(let s=0;s<t.length;s++)t[s]()}}else for(let t=0;t<this.collectedLeaveElements.length;t++){let s=this.collectedLeaveElements[t];this.processLeaveNode(s)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(t=>t()),this._flushFns=[],this._whenQuietFns.length){let t=this._whenQuietFns;this._whenQuietFns=[],e.length?wt(e).onDone(()=>{t.forEach(s=>s())}):t.forEach(s=>s())}}reportError(o){throw $$(o)}_flushAnimations(o,e){let t=new bi,s=[],i=new Map,a=[],n=new Map,u=new Map,g=new Map,v=new Set;this.disabledNodes.forEach(G=>{v.add(G);let B=this.driver.query(G,GM,!0);for(let H=0;H<B.length;H++)v.add(B[H])});let b=this.bodyNode,M=Array.from(this.statesByElement.keys()),P=x$(M,this.collectedEnterElements),D=new Map,C=0;P.forEach((G,B)=>{let H=Sl+C++;D.set(B,H),G.forEach(ae=>Ze(ae,H))});let F=[],j=new Set,q=new Set;for(let G=0;G<this.collectedLeaveElements.length;G++){let B=this.collectedLeaveElements[G],H=B[at];H&&H.setForRemoval&&(F.push(B),j.add(B),H.hasAnimation?this.driver.query(B,BM,!0).forEach(ae=>j.add(ae)):q.add(B))}let J=new Map,O=x$(M,Array.from(j));O.forEach((G,B)=>{let H=sn+C++;J.set(B,H),G.forEach(ae=>Ze(ae,H))}),o.push(()=>{P.forEach((G,B)=>{let H=D.get(B);G.forEach(ae=>pr(ae,H))}),O.forEach((G,B)=>{let H=J.get(B);G.forEach(ae=>pr(ae,H))}),F.forEach(G=>{this.processLeaveNode(G)})});let re=[],Y=[];for(let G=this._namespaceList.length-1;G>=0;G--)this._namespaceList[G].drainQueuedTransitions(e).forEach(H=>{let ae=H.player,ke=H.element;if(re.push(ae),this.collectedEnterElements.length){let Ee=ke[at];if(Ee&&Ee.setForMove){if(Ee.previousTriggersValues&&Ee.previousTriggersValues.has(H.triggerName)){let qt=Ee.previousTriggersValues.get(H.triggerName),qe=this.statesByElement.get(H.element);if(qe&&qe.has(H.triggerName)){let Bi=qe.get(H.triggerName);Bi.value=qt,qe.set(H.triggerName,Bi)}}ae.destroy();return}}let ct=!b||!this.driver.containsElement(b,ke),ze=J.get(ke),Et=D.get(ke),fe=this._buildInstruction(H,t,Et,ze,ct);if(fe.errors&&fe.errors.length){Y.push(fe);return}if(ct){ae.onStart(()=>zt(ke,fe.fromStyles)),ae.onDestroy(()=>ot(ke,fe.toStyles)),s.push(ae);return}if(H.isFallbackTransition){ae.onStart(()=>zt(ke,fe.fromStyles)),ae.onDestroy(()=>ot(ke,fe.toStyles)),s.push(ae);return}let df=[];fe.timelines.forEach(Ee=>{Ee.stretchStartingKeyframe=!0,this.disabledNodes.has(Ee.element)||df.push(Ee)}),fe.timelines=df,t.append(ke,fe.timelines);let nM={instruction:fe,player:ae,element:ke};a.push(nM),fe.queriedElements.forEach(Ee=>Ue(n,Ee,[]).push(ae)),fe.preStyleProps.forEach((Ee,qt)=>{if(Ee.size){let qe=u.get(qt);qe||u.set(qt,qe=new Set),Ee.forEach((Bi,lc)=>qe.add(lc))}}),fe.postStyleProps.forEach((Ee,qt)=>{let qe=g.get(qt);qe||g.set(qt,qe=new Set),Ee.forEach((Bi,lc)=>qe.add(lc))})});if(Y.length){let G=[];Y.forEach(B=>{G.push(I$(B.triggerName,B.errors))}),re.forEach(B=>B.destroy()),this.reportError(G)}let Z=new Map,ee=new Map;a.forEach(G=>{let B=G.element;t.has(B)&&(ee.set(B,B),this._beforeAnimationBuild(G.player.namespaceId,G.instruction,Z))}),s.forEach(G=>{let B=G.element;this._getPreviousPlayers(B,!1,G.namespaceId,G.triggerName,null).forEach(ae=>{Ue(Z,B,[]).push(ae),ae.destroy()})});let le=F.filter(G=>U$(G,u,g)),Be=new Map;j$(Be,this.driver,q,g,tt).forEach(G=>{U$(G,u,g)&&le.push(G)});let Xe=new Map;P.forEach((G,B)=>{j$(Xe,this.driver,new Set(G),u,Dr)}),le.forEach(G=>{let B=Be.get(G),H=Xe.get(G);Be.set(G,new Map([...B?.entries()??[],...H?.entries()??[]]))});let mc=[],mf=[],lf={};a.forEach(G=>{let{element:B,player:H,instruction:ae}=G;if(t.has(B)){if(v.has(B)){H.onDestroy(()=>ot(B,ae.toStyles)),H.disabled=!0,H.overrideTotalTime(ae.totalTime),s.push(H);return}let ke=lf;if(ee.size>1){let ze=B,Et=[];for(;ze=ze.parentNode;){let fe=ee.get(ze);if(fe){ke=fe;break}Et.push(ze)}Et.forEach(fe=>ee.set(fe,ke))}let ct=this._buildAnimation(H.namespaceId,ae,Z,i,Xe,Be);if(H.setRealPlayer(ct),ke===lf)mc.push(H);else{let ze=this.playersByElement.get(ke);ze&&ze.length&&(H.parentPlayer=wt(ze)),s.push(H)}}else zt(B,ae.fromStyles),H.onDestroy(()=>ot(B,ae.toStyles)),mf.push(H),v.has(B)&&s.push(H)}),mf.forEach(G=>{let B=i.get(G.element);if(B&&B.length){let H=wt(B);G.setRealPlayer(H)}}),s.forEach(G=>{G.parentPlayer?G.syncPlayerEvents(G.parentPlayer):G.destroy()});for(let G=0;G<F.length;G++){let B=F[G],H=B[at];if(pr(B,sn),H&&H.hasAnimation)continue;let ae=[];if(n.size){let ct=n.get(B);ct&&ct.length&&ae.push(...ct);let ze=this.driver.query(B,rn,!0);for(let Et=0;Et<ze.length;Et++){let fe=n.get(ze[Et]);fe&&fe.length&&ae.push(...fe)}}let ke=ae.filter(ct=>!ct.destroyed);ke.length?JM(this,B,ke):this.processLeaveNode(B)}return F.length=0,mc.forEach(G=>{this.players.push(G),G.onDone(()=>{G.destroy();let B=this.players.indexOf(G);this.players.splice(B,1)}),G.play()}),mc}afterFlush(o){this._flushFns.push(o)}afterFlushAnimationsDone(o){this._whenQuietFns.push(o)}_getPreviousPlayers(o,e,t,s,i){let a=[];if(e){let n=this.playersByQueriedElement.get(o);n&&(a=n)}else{let n=this.playersByElement.get(o);if(n){let u=!i||i==vi;n.forEach(g=>{g.queued||!u&&g.triggerName!=s||a.push(g)})}}return(t||s)&&(a=a.filter(n=>!(t&&t!=n.namespaceId||s&&s!=n.triggerName))),a}_beforeAnimationBuild(o,e,t){let s=e.triggerName,i=e.element,a=e.isRemovalTransition?void 0:o,n=e.isRemovalTransition?void 0:s;for(let u of e.timelines){let g=u.element,v=g!==i,b=Ue(t,g,[]);this._getPreviousPlayers(g,v,a,n,e.toState).forEach(P=>{let D=P.getRealPlayer();D.beforeDestroy&&D.beforeDestroy(),P.destroy(),b.push(P)})}zt(i,e.fromStyles)}_buildAnimation(o,e,t,s,i,a){let n=e.triggerName,u=e.element,g=[],v=new Set,b=new Set,M=e.timelines.map(D=>{let C=D.element;v.add(C);let F=C[at];if(F&&F.removedBeforeQueried)return new Zt(D.duration,D.delay);let j=C!==u,q=YM((t.get(C)||qM).map(Z=>Z.getRealPlayer())).filter(Z=>{let ee=Z;return ee.element?ee.element===C:!1}),J=i.get(C),O=a.get(C),re=dl(this._normalizer,D.keyframes,J,O),Y=this._buildPlayer(D,re,q);if(D.subTimeline&&s&&b.add(C),j){let Z=new wi(o,n,C);Z.setRealPlayer(Y),g.push(Z)}return Y});g.forEach(D=>{Ue(this.playersByQueriedElement,D.element,[]).push(D),D.onDone(()=>HM(this.playersByQueriedElement,D.element,D))}),v.forEach(D=>Ze(D,yl));let P=wt(M);return P.onDestroy(()=>{v.forEach(D=>pr(D,yl)),ot(u,e.toStyles)}),b.forEach(D=>{Ue(s,D,[]).push(P)}),P}_buildPlayer(o,e,t){return e.length>0?this.driver.animate(o.element,e,o.duration,o.delay,o.easing,t):new Zt(o.duration,o.delay)}},wi=class{namespaceId;triggerName;element;_player=new Zt;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(o,e,t){this.namespaceId=o,this.triggerName=e,this.element=t}setRealPlayer(o){this._containsRealPlayer||(this._player=o,this._queuedCallbacks.forEach((e,t)=>{e.forEach(s=>Xa(o,t,void 0,s))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(o.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(o){this.totalTime=o}syncPlayerEvents(o){let e=this._player;e.triggerCallback&&o.onStart(()=>e.triggerCallback("start")),o.onDone(()=>this.finish()),o.onDestroy(()=>this.destroy())}_queueEvent(o,e){Ue(this._queuedCallbacks,o,[]).push(e)}onDone(o){this.queued&&this._queueEvent("done",o),this._player.onDone(o)}onStart(o){this.queued&&this._queueEvent("start",o),this._player.onStart(o)}onDestroy(o){this.queued&&this._queueEvent("destroy",o),this._player.onDestroy(o)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(o){this.queued||this._player.setPosition(o)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(o){let e=this._player;e.triggerCallback&&e.triggerCallback(o)}};function HM(r,o,e){let t=r.get(o);if(t){if(t.length){let s=t.indexOf(e);t.splice(s,1)}t.length==0&&r.delete(o)}return t}function VM(r){return r??null}function pn(r){return r&&r.nodeType===1}function QM(r){return r=="start"||r=="done"}function O$(r,o){let e=r.style.display;return r.style.display=o??"none",e}function j$(r,o,e,t,s){let i=[];e.forEach(u=>i.push(O$(u)));let a=[];t.forEach((u,g)=>{let v=new Map;u.forEach(b=>{let M=o.computeStyle(g,b,s);v.set(b,M),(!M||M.length==0)&&(g[at]=WM,a.push(g))}),r.set(g,v)});let n=0;return e.forEach(u=>O$(u,i[n++])),a}function x$(r,o){let e=new Map;if(r.forEach(n=>e.set(n,[])),o.length==0)return e;let t=1,s=new Set(o),i=new Map;function a(n){if(!n)return t;let u=i.get(n);if(u)return u;let g=n.parentNode;return e.has(g)?u=g:s.has(g)?u=t:u=a(g),i.set(n,u),u}return o.forEach(n=>{let u=a(n);u!==t&&e.get(u).push(n)}),e}function Ze(r,o){r.classList?.add(o)}function pr(r,o){r.classList?.remove(o)}function JM(r,o,e){wt(e).onDone(()=>r.processLeaveNode(o))}function YM(r){let o=[];return W$(r,o),o}function W$(r,o){for(let e=0;e<r.length;e++){let t=r[e];t instanceof yo?W$(t.players,o):o.push(t)}}function ZM(r,o){let e=Object.keys(r),t=Object.keys(o);if(e.length!=t.length)return!1;for(let s=0;s<e.length;s++){let i=e[s];if(!o.hasOwnProperty(i)||r[i]!==o[i])return!1}return!0}function U$(r,o,e){let t=e.get(r);if(!t)return!1;let s=o.get(r);return s?t.forEach(i=>s.add(i)):o.set(r,t),e.delete(r),!0}var mr=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(o,e)=>{};constructor(o,e,t){this._driver=e,this._normalizer=t,this._transitionEngine=new _l(o.body,e,t),this._timelineEngine=new Pl(o.body,e,t),this._transitionEngine.onRemovalComplete=(s,i)=>this.onRemovalComplete(s,i)}registerTrigger(o,e,t,s,i){let a=o+"-"+s,n=this._triggerCache[a];if(!n){let u=[],g=[],v=z$(this._driver,i,u,g);if(u.length)throw u$(s,u);n=jM(s,v,this._normalizer),this._triggerCache[a]=n}this._transitionEngine.registerTrigger(e,s,n)}register(o,e){this._transitionEngine.register(o,e)}destroy(o,e){this._transitionEngine.destroy(o,e)}onInsert(o,e,t,s){this._transitionEngine.insertNode(o,e,t,s)}onRemove(o,e,t){this._transitionEngine.removeNode(o,e,t)}disableAnimations(o,e){this._transitionEngine.markElementAsDisabled(o,e)}process(o,e,t,s){if(t.charAt(0)=="@"){let[i,a]=fl(t),n=s;this._timelineEngine.command(i,e,a,n)}else this._transitionEngine.trigger(o,e,t,s)}listen(o,e,t,s,i){if(t.charAt(0)=="@"){let[a,n]=fl(t);return this._timelineEngine.listen(a,e,n,i)}return this._transitionEngine.listen(o,e,t,s,i)}flush(o=-1){this._transitionEngine.flush(o)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(o){this._transitionEngine.afterFlushAnimationsDone(o)}};function XM(r,o){let e=null,t=null;return Array.isArray(o)&&o.length?(e=$l(o[0]),o.length>1&&(t=$l(o[o.length-1]))):o instanceof Map&&(e=$l(o)),e||t?new eD(r,e,t):null}var eD=(()=>{class r{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,t,s){this._element=e,this._startStyles=t,this._endStyles=s;let i=r.initialStylesByElement.get(e);i||r.initialStylesByElement.set(e,i=new Map),this._initialStyles=i}start(){this._state<1&&(this._startStyles&&ot(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(ot(this._element,this._initialStyles),this._endStyles&&(ot(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(r.initialStylesByElement.delete(this._element),this._startStyles&&(zt(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(zt(this._element,this._endStyles),this._endStyles=null),ot(this._element,this._initialStyles),this._state=3)}}return r})();function $l(r){let o=null;return r.forEach((e,t)=>{tD(t)&&(o=o||new Map,o.set(t,e))}),o}function tD(r){return r==="display"||r==="position"}var gn=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer=null;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(o,e,t,s){this.element=o,this.keyframes=e,this.options=t,this._specialStyles=s,this._duration=t.duration,this._delay=t.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(o=>o()),this._onDoneFns=[])}init(){this._buildPlayer()&&this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return this.domPlayer;this._initialized=!0;let o=this.keyframes,e=this._triggerWebAnimation(this.element,o,this.options);if(!e)return this._onFinish(),null;this.domPlayer=e,this._finalKeyframe=o.length?o[o.length-1]:new Map;let t=()=>this._onFinish();return e.addEventListener("finish",t),this.onDestroy(()=>{e.removeEventListener("finish",t)}),e}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer?.pause()}_convertKeyframesToObject(o){let e=[];return o.forEach(t=>{e.push(Object.fromEntries(t))}),e}_triggerWebAnimation(o,e,t){let s=this._convertKeyframesToObject(e);try{return o.animate(s,t)}catch(i){return null}}onStart(o){this._originalOnStartFns.push(o),this._onStartFns.push(o)}onDone(o){this._originalOnDoneFns.push(o),this._onDoneFns.push(o)}onDestroy(o){this._onDestroyFns.push(o)}play(){let o=this._buildPlayer();o&&(this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),o.play())}pause(){this.init(),this.domPlayer?.pause()}finish(){this.init(),this.domPlayer&&(this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish())}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer?.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(o=>o()),this._onDestroyFns=[])}setPosition(o){this.domPlayer||this.init(),this.domPlayer&&(this.domPlayer.currentTime=o*this.time)}getPosition(){return this.domPlayer?+(this.domPlayer.currentTime??0)/this.time:this._initialized?1:0}get totalTime(){return this._delay+this._duration}beforeDestroy(){let o=new Map;this.hasStarted()&&this._finalKeyframe.forEach((t,s)=>{s!=="offset"&&o.set(s,this._finished?t:an(this.element,s))}),this.currentSnapshot=o}triggerCallback(o){let e=o==="start"?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}},Sn=class{validateStyleProperty(o){return!0}validateAnimatableStyleProperty(o){return!0}containsElement(o,e){return hl(o,e)}getParentElement(o){return tn(o)}query(o,e,t){return ul(o,e,t)}computeStyle(o,e,t){return an(o,e)}animate(o,e,t,s,i,a=[]){let n=s==0?"both":"forwards",u={duration:t,delay:s,fill:n};i&&(u.easing=i);let g=new Map,v=a.filter(P=>P instanceof gn);D$(t,s)&&v.forEach(P=>{P.currentSnapshot.forEach((D,C)=>g.set(C,D))});let b=E$(e).map(P=>new Map(P));b=R$(o,b,g);let M=XM(o,b);return new gn(o,b,u,M)}};var mn="@",H$="@.disabled",yn=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(o,e,t,s){this.namespaceId=o,this.delegate=e,this.engine=t,this._onDestroy=s}get data(){return this.delegate.data}destroyNode(o){this.delegate.destroyNode?.(o)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(o,e){return this.delegate.createElement(o,e)}createComment(o){return this.delegate.createComment(o)}createText(o){return this.delegate.createText(o)}appendChild(o,e){this.delegate.appendChild(o,e),this.engine.onInsert(this.namespaceId,e,o,!1)}insertBefore(o,e,t,s=!0){this.delegate.insertBefore(o,e,t),this.engine.onInsert(this.namespaceId,e,o,s)}removeChild(o,e,t,s){if(s){this.delegate.removeChild(o,e,t,s);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(o,e){return this.delegate.selectRootElement(o,e)}parentNode(o){return this.delegate.parentNode(o)}nextSibling(o){return this.delegate.nextSibling(o)}setAttribute(o,e,t,s){this.delegate.setAttribute(o,e,t,s)}removeAttribute(o,e,t){this.delegate.removeAttribute(o,e,t)}addClass(o,e){this.delegate.addClass(o,e)}removeClass(o,e){this.delegate.removeClass(o,e)}setStyle(o,e,t,s){this.delegate.setStyle(o,e,t,s)}removeStyle(o,e,t){this.delegate.removeStyle(o,e,t)}setProperty(o,e,t){e.charAt(0)==mn&&e==H$?this.disableAnimations(o,!!t):this.delegate.setProperty(o,e,t)}setValue(o,e){this.delegate.setValue(o,e)}listen(o,e,t,s){return this.delegate.listen(o,e,t,s)}disableAnimations(o,e){this.engine.disableAnimations(o,e)}},Fl=class extends yn{factory;constructor(o,e,t,s,i){super(e,t,s,i),this.factory=o,this.namespaceId=e}setProperty(o,e,t){e.charAt(0)==mn?e.charAt(1)=="."&&e==H$?(t=t===void 0?!0:!!t,this.disableAnimations(o,t)):this.engine.process(this.namespaceId,o,e.slice(1),t):this.delegate.setProperty(o,e,t)}listen(o,e,t,s){if(e.charAt(0)==mn){let i=sD(o),a=e.slice(1),n="";return a.charAt(0)!=mn&&([a,n]=rD(a)),this.engine.listen(this.namespaceId,i,a,n,u=>{let g=u._data||-1;this.factory.scheduleListenerCallback(g,t,u)})}return this.delegate.listen(o,e,t,s)}};function sD(r){switch(r){case"body":return document.body;case"document":return document;case"window":return window;default:return r}}function rD(r){let o=r.indexOf("."),e=r.substring(0,o),t=r.slice(o+1);return[e,t]}var An=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(o,e,t){this.delegate=o,this.engine=e,this._zone=t,e.onRemovalComplete=(s,i)=>{i?.removeChild(null,s)}}createRenderer(o,e){let s=this.delegate.createRenderer(o,e);if(!o||!e?.data?.animation){let g=this._rendererCache,v=g.get(s);if(!v){let b=()=>g.delete(s);v=new yn("",s,this.engine,b),g.set(s,v)}return v}let i=e.id,a=e.id+"-"+this._currentId;this._currentId++,this.engine.register(a,o);let n=g=>{Array.isArray(g)?g.forEach(n):this.engine.registerTrigger(i,a,o,g.name,g)};return e.data.animation.forEach(n),new Fl(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(o,e,t){if(o>=0&&o<this._microtaskId){this._zone.run(()=>e(t));return}let s=this._animationCallbacksBuffer;s.length==0&&queueMicrotask(()=>{this._zone.run(()=>
1{s.forEach(i=>{let[a,n]=i;a(n)}),this._animationCallbacksBuffer=[]})}),s.push([e,t])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(o){this.engine.flush(),this.delegate.componentReplaced?.(o)}};var nD=(()=>{class r extends mr{constructor(e,t,s){super(e,t,s)}ngOnDestroy(){this.flush()}static \u0275fac=function(t){return new(t||r)(De(Qi),De(ps),De(ms))};static \u0275prov=k({token:r,factory:r.\u0275fac})}return r})();function cD(){return new ln}function pD(){return new An(l(Of),l(mr),l(vs))}var V$=[{provide:ms,useFactory:cD},{provide:mr,useClass:nD},{provide:Pf,useFactory:pD}],WR=[{provide:ps,useClass:Nl},{provide:uc,useValue:"NoopAnimations"},...V$],mD=[{provide:ps,useFactory:()=>new Sn},{provide:uc,useFactory:()=>"BrowserAnimations"},...V$];function Q$(){return Cf("NgEagerAnimations"),[...mD]}var lD=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(
1Boolean).map(r=>[r.name,r]),dD=new Map(lD),J$=dD;var fD=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],jl=new WeakSet,hD=r=>{jl.add(r);let o=r.toJSON();return jl.delete(r),o},uD=r=>J$.get(r)??Error,Z$=({from:r,seen:o,to:e,forceEnumerable:t,maxDepth:s,depth:i,useToJSON:a,serialize:n})=>{if(!e)if(Array.isArray(r))e=[];else if(!n&&Y$(r)){let g=uD(r.name);e=new g}else e={};if(o.push(r),i>=s)return e;if(a&&typeof r.toJSON=="function"&&!jl.has(r))return hD(r);let u=g=>Z$({from:g,seen:[...o],forceEnumerable:t,maxDepth:s,depth:i,useToJSON:a,serialize:n});for(let[g,v]of Object.entries(r)){if(v&&v instanceof Uint8Array&&v.constructor.name==="Buffer"){e[g]="[object Buffer]";continue}if(v!==null&&typeof v=="object"&&typeof v.pipe=="function"){e[g]="[object Stream]";continue}if(typeof v!="function"){if(!v||typeof v!="object"){try{e[g]=v}catch(b){}continue}if(!o.includes(r[g])){i++,e[g]=u(r[g]);continue}e[g]="[Circular]"}}for(let{property:g,enumerable:v}of fD)typeof r[g]<"u"&&r[g]!==null&&Object.defineProperty(e,g,{value:Y$(r[g])?u(r[g]):r[g],enumerable:t?!0:v,configurable:!0,writable:!0});return e};function Kt(r,o={}){let{maxDepth:e=Number.POSITIVE_INFINITY,useToJSON:t=!0}=o;return typeof r=="object"&&r!==null?Z$({from:r,seen:[],forceEnumerable:!0,maxDepth:e,depth:0,useToJSON:t,serialize:!0}):typeof r=="function"?`[Function: ${r.name||"anonymous"}]`:r}function Y$(r){return!!r&&typeof r=="object"&&"name"in r&&"message"in r&&"stack"in r}var ls=$.endpoints.workspaces,xl=$.endpoints.notifications,X$=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.router=l(me),this.snackBar=l(we),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c($s),S(this.store.select(U),this.store.select(Oe)),A(([e,t,s])=>this.appService.get(`${ls}/slug/${t?.params.workspaceId}`).pipe(m(i=>Is({data:this.formatData(i.data)})),h(()=>s.isAuthenticated?Object.keys(t.params).includes("dashboardId")?d(vr({data:{}})):d(Ar({data:"/404"})):d(to())))))),this.error404$=p(()=>this.actions$.pipe(c(Ar),X(e=>{this.router.navigate([e.data],{skipLocationChange:!0})})),{dispatch:!1}),this.fetchReport$=p(()=>this.actions$.pipe(c(Xi),S(this.store.select(U)),A(([e,t])=>this.appService.get(`${ls}/slug/${t?.params.workspaceId}`).pipe(m(s=>kc({data:this.formatData(s.data)})),h(s=>(this.snackBar.open("You have guest access to this workspace","Error",{duration:2500}),d(fo()))))))),this.fetchSuccessReport$=p(()=>this.actions$.pipe(c(kc),m(()=>Ve()))),this.fetchHighlight$=p(()=>this.actions$.pipe(c(eo),S(this.store.select(U)),A(([e,t])=>this.appService.get(`${ls}/slug/${t?.params.workspaceId}`).pipe(m(s=>wc({data:this.formatData(s.data)})),h(s=>(this.snackBar.open("You have guest access to this workspace","Error",{duration:2500}),d(Xt()))))))),this.fetchSuccessHighlight$=p(()=>this.actions$.pipe(c(wc),m(()=>Xt()))),this.fetchSuccess$=p(()=>this.actions$.pipe(c(Is),S(this.store.select(U),this.store.select(L)),X(([e,t,s])=>{setTimeout(()=>{let i=t?.url.split("/");if(i&&i.length!==0&&i[i.length-1]===s.slug){let a="campaigns";s.limited&&(a="partners"),this.router.navigate([`/${s.slug}/${a}`],{replaceUrl:!1})}},0)})),{dispatch:!1}),this.fetchSuccess2$=p(()=>this.actions$.pipe(c(Is,vr),m(e=>Object.keys(e.data).includes("access")?K():jh()))),this.fetchNotification$=p(()=>this.actions$.pipe(c(ch),A(e=>this.appService.get(`${xl}`).pipe(m(t=>$c(t)),h(t=>d(T({message:t.message}))))))),this.seenNotification$=p(()=>this.actions$.pipe(c($c),A(e=>this.appService.update2(`${xl}/seen`,{}).pipe(m(()=>ph()),h(t=>d(T({message:t.message}))))))),this.removeNotification$=p(()=>this.actions$.pipe(c(mh),A(e=>{let t={ids:e.data.join(",")};return this.appService.remove2(`${xl}`,t).pipe(m(s=>lh({data:{ids:e.data,hasNotification:s.hasNotification}})),h(s=>d(T({message:s.message}))))}))),this.uploadSaved$=p(()=>this.actions$.pipe(c(Ic),m(e=>nh({data:e.data})),h(e=>d(T({message:e.message}))))),this.updateTz$=p(()=>this.actions$.pipe(c(ih),S(this.store.select(L)),A(([e,t])=>this.appService.update2(`${ls}/${t.id}`,{timezone:e.data}).pipe(N(()=>[oh({data:e.data}),Vt({message:"Timezone updated successfully!"})]),h(s=>d(T({message:s.message}))))))),this.updateColor$=p(()=>this.actions$.pipe(c(ah),S(this.store.select(L)),A(([e,t])=>this.appService.update2(`${ls}/${t.id}`,{[e.data.key]:e.data.value}).pipe(m(()=>bc({data:e.data})),h(s=>d(T({message:Kt(s).message}))))))),this.updateCampaignSettings$=p(()=>this.actions$.pipe(c(hh),S(this.store.select(L)),A(([e,t])=>this.appService.update2(`${ls}/${t.id}`,{campaignSettings:t.campaignSettings}).pipe(m(()=>K()),h(s=>d(T({message:Kt(s).message}))))))),this.upload$=p(()=>this.actions$.pipe(c(fh),S(this.store.select(L)),A(([e,t])=>this.appService.update2(`${ls}/${t.id}`,{[e.data.id]:e.data.url}).pipe(m(()=>{if(e.data.id==="banner"){let s={key:e.data.id,value:{url:e.data.url,type:e.data.type}};return bc({data:s})}else return Ic({data:{id:e.data.id,url:e.data.url}})}),h(s=>d(T({message:Kt(s).message}))))))),this.success$=p(()=>this.actions$.pipe(c(Vt),X(e=>{setTimeout(()=>this.snackBar.open(e.message,"Success",{duration:2500}),0)})),{dispatch:!1})}formatData(e){let t=!1;(e.slug==="front-centre"||e.slug==="test-workspace")&&(t=!0);let s={columns:[{id:"name",name:"Name",template:"report",disabled:!0},{id:"clientName",name:"Client",disabled:!0,template:"link2"},{id:"progress",name:"Progress",template:"progress"},{id:"owner",name:"Created By"},{id:"createdAtSince",name:"Created At"},{id:"mediaIcons",name:"Media",template:"mediaIcons"}]},i=Xh.flatMap(n=>{let u=n.items.filter(g=>e.sources.includes(g.id));return u.length?u:[]}),a={};return i.map(n=>{a[n.id]=n}),y(f({},e),{limited:e.creatorWorkspace,sourcesObj:a,settings:{hasCreators:t,campaigns:s,clients:{columns:[{id:"name",name:"Name",template:"link"},{id:"ownerName",name:"Created By"},{id:"createdAtSince",name:"Created At"}],ctas:[{id:"delete",name:"Delete"}]},groups:{columns:[{id:"name",name:"Name",template:"report",disabled:!0},{id:"assignedToName",name:"Assigned To"},{id:"owner",name:"Created By"},{id:"createdAtSince",name:"Created At"}],ctas:[{id:"delete",name:"Delete"}]},"creator-invites":{columns:[{id:"email",name:"Email"},{id:"status",name:"Status"},{id:"createdAtSince",name:"Created At"}],ctas:[{id:"delete",name:"Delete"}]},creators:{columns:[{id:"name",name:"Name",template:"link"},{id:"status",name:"Status"},{id:"ownerName",name:"Created By"},{id:"createdAtSince",name:"Created At"}],ctas:[{id:"delete",name:"Delete"}]},partners:{columns:[{id:"name",name:"Name",template:"link"},{id:"status",name:"Status"},{id:"ownerName",name:"Created By"},{id:"createdAtSince",name:"Created At"}],ctas:[{id:"delete",name:"Delete"}]},"shared-media":{columns:[{id:"icon",name:"",template:"icon"},{id:"name",name:"Name",template:"media"},{id:"status",name:"Status",template:"sourceStatus"},{id:"createdAtSince",name:"Added At"}],ctas:[{id:"delete",name:"Delete"}]},"shared-media-creator":{columns:[{id:"icon",name:"",template:"icon"},{id:"name",name:"Name",template:"media"},{id:"status",name:"Status",template:"sourceStatus"},{id:"createdAtSince",name:"Added At"}],ctas:[{id:"delete",name:"Delete"}]},users:{columns:[{id:"email",name:"Email",template:"link"},{id:"name",name:"Name"},{id:"status",name:"Status"},{id:"type",name:"Role"},{id:"createdAtSince",name:"Created At"}],ctas:[{id:"delete",name:"Delete"}]},sources:{columns:[{id:"name",name:"Name",template:"link"},{id:"status",name:"Status",template:"sourceStatus"},{id:"network",name:"Network"},{id:"taxonomy",name:"Taxonomy",template:"taxonomy"},{id:"createdAtSince",name:"Created At"}],ctas:[{id:"delete",name:"Delete"},{id:"buildTaxonomy",name:"Build taxonomy"}]},dashboards:{columns:[{id:"name",name:"Name",template:"dashboard"},{id:"folder",name:"Folder",template:"folder"},{id:"ownerName",name:"Created By"},{id:"createdAtSince",name:"Created At"}],ctas:[{id:"delete",name:"Delete"}]}}})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var eI=(r,o)=>{let e=r.url.indexOf("assets/")===-1,t=r.url.indexOf("amazonaws")===-1,s=r.url.indexOf("/pdf")===-1;return e&&t&&s||r.method!=="GET"&&t&&s?ge(Lr()).pipe(_(i=>(r=r.clone({headers:r.headers.set("Authorization",i.tokens?.idToken.toString())}),o(r))),h(i=>r.url.indexOf("reports")!==-1||r.url.indexOf("dashboards")!==-1?o(r):Me(i))):o(r)};var tI=(r,o)=>{let e=l(I),t=l(we),s=r.url;return s.includes("assets/")||s.includes("amazonaws")||s.includes("/pdf")?o(r):o(r).pipe(h(a=>(a.status===401&&!s.includes("reports")&&!s.includes("dashboards")&&e.dispatch(co()),a.status===429&&t.open("Too many requests. Please try again later.","Error",{duration:3e3}),Me(()=>a))))};
1function sI(r,o,e){if(!(!r||r.redirect!==!0)){if(r.restricted===!0){o.navigate(["/unavailable"]);return}e.dispatch(th({data:r.message})),r.goPortal?o.navigate(["/subscribe/contact"],{queryParams:{portal:!0}}):o.navigate(["/subscribe/contact"])}}var rI=(r,o)=>{let e=l(me),t=l(I);return o(r).pipe(X(s=>{s instanceof xf&&sI(s.body,e,t)}),h(s=>(s instanceof Uf&&s.status===403&&sI(s.error,e,t),Me(()=>s))))};var iI=(r,o)=>{let e=l(I),t=r.url.indexOf("amazonaws")===-1;return e.select(L).pipe(z(),A(s=>{if(r.url.indexOf("assets/")===-1&&t&&r.url.indexOf("reports")===-1||r.method!=="GET"&&t){let i=s&&s.id?r.clone({setParams:{workspaceId:s.id}}):r;return o(i)}else return o(r)}))};var oI=(()=>{class r{serialize(e){return{url:e.url,params:Gl(e.root,t=>t.params),queryParams:Gl(e.root,t=>t.queryParams),data:aI(e.root)}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();function Gl(r,o){if(!r)return{};let e=o(r),t=r.children.find(s=>s.outlet==="primary")||r.firstChild;return f(f({},e),Gl(t,o))}function aI(r){if(!r)return{};let o=r.data,e=r.children.find(t=>t.outlet==="primary")||r.firstChild;return f(f({},o),aI(e))}var fs=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(ao()),this.actions$.pipe(c(yt,Tr,pt),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var nI=(()=>{class r{constructor(){this.actions$=l(w),this.snackBar=l(we),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(sh),A(e=>{let t=`${e.data}`;return this.appService.get(t).pipe(m(s=>rh({data:{type:e.data,payload:s}})),h(s=>d(T({message:s.message}))))}))),this.portal$=p(()=>this.actions$.pipe(c(eh),A(e=>{let t=`${$.endpoints.sub}/portal`;return this.appService.get(t).pipe(m(s=>Ac({data:s.url})),h(s=>d(T({message:s.message}))))}))),this.redirect$=p(()=>this.actions$.pipe(c(Ac),X(e=>{window.location.replace(e.data)})),{dispatch:!1}),this.handleError$=p(()=>this.actions$.pipe(We(e=>{let t=e.type??"";return/error/i.test(t)&&!t.includes("Reset")&&!t.includes("Redirect")&&!t.includes("404")}),X(e=>{this.snackBar.open(e.message,"Error",{duration:2500})})),{dispatch:!1})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var zl=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.router=l(me)}resolve(e){return this.store.select(L).pipe(z(),A(t=>t&&t.slug===e.params.workspaceId?d(this.router.createUrlTree([`manage/${t.slug}/campaigns`])):(this.store.dispatch($s()),this.actions$.pipe(c(Is,Ar,to,vr),z()))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var cI=(()=>{class r{constructor(){this._monitoredElements=new Map}monitor(e){let t=this._monitoredElements.get(e);if(t)return t.subject.asObservable();let s=new ff,i=a=>{a.animationName==="onAutoFillStart"?(e.classList.add("input-autofilled"),s.next({target:a.target,isAutofilled:!0})):a.animationName==="onAutoFillCancel"&&(e.classList.remove("input-autofilled"),s.next({target:a.target,isAutofilled:!1}))};return e.addEventListener("animationstart",i),e.classList.add("input-autofill-monitored"),this._monitoredElements.set(e,{subject:s,unlisten:()=>{e.removeEventListener("animationstart",i)}}),s.asObservable()}stopMonitoring(e){let t=this._monitoredElements.get(e);t&&(t.unlisten(),t.subject.complete(),e.classList.remove("input-autofill-monitored"),e.classList.remove("input-autofilled"),this._monitoredElements.delete(e))}ngOnDestroy(){this._monitoredElements.forEach((e,t)=>this.stopMonitoring(t))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var vn=$.endpoints.users,bn={page:0,size:40,sizeOptions:[5,10,15,20],sort:"name",order:"asc"},pI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(vu),A(()=>{let e=this.setParam(bn);return this.appService.get(vn,e).pipe(m(t=>qc(this.formatData(t,e))),h(t=>d(T({message:t.message}))))}))),this.fetchMore$=p(()=>this.actions$.pipe(c(bu),S(this.store.select(Cu)),A(([e,t])=>{let s=y(f({},this.setParam(bn,t)),{page:e.data/bn.size});return this.appService.get(vn,s).pipe(m(i=>ku(this.formatData(i,s))),h(i=>d(T({message:i.message}))))}))),this.search$=p(()=>this.actions$.pipe(c(wu),S(this.store.select(Hc)),A(([e,t])=>
1{if(!e.data)return d(Wc());let s=this.setParam(t,e.data.trim());return this.appService.search(vn,s).pipe(m(i=>qc(this.formatData(i,s))),h(()=>d(T({message:"could not search!"}))))}))),this.restoreSearch$=p(()=>this.actions$.pipe(c(Wc),S(this.store.select(Hc)),A(([e,t])=>{let s=this.setParam(t);return this.appService.get(vn,s).pipe(m(i=>$u(this.formatData(i,s))),h(i=>d(T({message:i.message}))))}))),this.updateContact$=p(()=>this.actions$.pipe(c(Tu,Eu),m(()=>vc()))),this.updateContact2$=p(()=>this.actions$.pipe(c(vc),S(this.store.select(L),this.store.select(Ru),this.store.select(Pu)),A(([e,t,s,i])=>i?this.appService.update2(`${i}/${t.id}`,{contacts:s.map(a=>({id:a.id,name:a.name,email:a.email}))}).pipe(m(()=>Vt({message:"Contact info updated successfully!"})),h(a=>d(dh({message:a.message})))):d(K()))))}setParam(e,t){let s={page:0,size:e.size,sort:e.sort,order:e.order,status:"is|active"};return t&&(s=y(f({},s),{searchString:t})),s}formatData(e,t){return{data:e.data.map(s=>y(f({},s),{expanded:!1,isLoading:!1})),meta:y(f(f({},e.meta),t),{sizeOptions:bn.sizeOptions})}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var yD=He({source:"Editor API",events:{"Fetch Gd More":de(),"Fetch Gd":de(),"Fetch Gd Success":de(),"Fetch Gd Token":Pe(),"Fetch Gd Token Success":de(),Upload:de(),"Upload Success":de()}}),{fetchGdMore:kn,fetchGd:wn,fetchGdSuccess:Ii,fetchGdToken:mI,fetchGdTokenSuccess:$n,upload:lI,uploadSuccess:dI}=yD;var AD={state:null,ui:null,isLoading:!1},lr=Yi({name:"editor",reducer:Zi(AD,Dt($n,(r,o)=>y(f({},r),{state:o.data})),Dt(wn,kn,r=>y(f({},r),{isLoading:!0})),Dt(Ii,(r,o)=>y(f({},r),{state:y(f({},r.state),{googleDrive:o.data}),isLoading:!1})))});var hI=lr.name,uI=lr.reducer,bP=lr.selectEditorState,Kl=lr.selectState,kP=lr.selectIsLoading;var Bl=$.endpoints.sources,SI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetchGd$=p(()=>this.actions$.pipe(c(wn),S(this.store.select(Je),this.store.select(Kl),this.store.select(U)),A(([e,t,s,i])=>{let a={workspaceId:i?.params.workspaceId,orderBy:"modifiedTime"};return e.data.folderId&&(a=y(f({},a),{folder:e.data.folderId})),e.data.search&&(a=y(f({},a),{search:e.data.search})),e.data.orderBy&&(a=y(f({},a),{orderBy:e.data.orderBy})),this.appService.get(`${Bl}/gd/list`,a).pipe(m(n=>Ii({data:n})),h(n=>d(T({message:n.message}))))}))),this.fetchGdMore$=p(()=>this.actions$.pipe(c(kn),S(this.store.select(Je),this.store.select(Kl),this.store.select(U)),A(([e,t,s,i])=>{let a={workspaceId:i?.params.workspaceId,orderBy:"createdTime"};return e.data.folderId&&(a=y(f({},a),{folder:e.data.folderId})),e.data.search&&(a=y(f({},a),{search:e.data.search})),e.data.orderBy&&(a=y(f({},a),{orderBy:e.data.orderBy})),s.googleDrive&&s.googleDrive.pageToken&&(a=y(f({},a),{pageToken:s.googleDrive.pageToken})),this.appService.get(`${Bl}/gd/list`,a).pipe(m(n=>{let u=n;return n.data.files.length!==0&&(u=y(f({},u),{data:y(f({},u.data),{files:[...s.googleDrive.data.files,...n.data.files]})})),n.data.folders.length!==0&&(u=y(f({},u),{data:y(f({},u.data),{folders:[...s.googleDrive.data.folders,...n.data.folders]})})),Ii({data:u})}),h(n=>d(T({message:n.message}))))}))),this.fetchGdToken$=p(()=>this.actions$.pipe(c(mI),S(this.store.select(Je),this.store.select(U)),A(([e,t,s])=>{let i={workspaceId:s?.params.workspaceId};return this.appService.get(`${Bl}/gd`,i).pipe(m(a=>$n({data:a})),h(a=>d(T({message:a.message}))))}))),this.upload$=p(()=>this.actions$.pipe(c(lI),S(this.store.select(Je)),A(([e,t])=>{let s={googleDrive:!0,items:e.data.ids,accessToken:e.data.accessToken};return this.appService.post("images-cache",s).pipe(m(i=>dI({data:{holderId:e.data.holderId,urls:i.urls}})),h(i=>d(T({message:i.message}))))})))}formatData(e){return e}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var AI=(()=>{class r{constructor(){this.actions$=l(w),this.fetch$=p(()=>this.actions$.pipe(c(Ds),m(e=>Qc({data:e.data,meta:e.meta})))),this.fetch2$=p(()=>this.actions$.pipe(c(Ms),m(e=>ju({data:e.data,meta:e.meta})))),this.save$=p(()=>this.actions$.pipe(c(Ou),m(e=>{let t=e.data.filter,s=e.data.filterDetail,i=s.info,a=[{info:i,selected:s.selected}],n;return e.data.found?n=[...t.chips,...a]:n=t.chips?.map(u=>u.info.id===i.id?a[0]:u),e.meta.key===vt&&(n=[n[n.length-1]]),Jc({data:{state:this.addFlag(t.backup,a),chips:n},meta:e.meta})}))),this.setSuccess$=p(()=>this.actions$.pipe(c(Jc),m(e=>To({meta:e.meta})))),this.set1Success$=p(()=>this.actions$.pipe(c(Yc),m(e=>Or({meta:e.meta})))),this.fetchSuccess$=p(()=>this.actions$.pipe(c(Qc),m(e=>{if(e.data.chips){let t=e.data.chips;return Yc({data:{state:this.addFlag(e.data.data,t),chips:t},meta:e.meta})}else return Or({meta:e.meta})})))}addFlag(e,t){return e.map(s=>{let i=!1;return t.map(a=>{a.info.id===s.id&&(i=!0)}),i?y(f({},s),{flag:!0}):s})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var bD=$.endpoints.sources,Wl=(()=>
1{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetchToken$=p(()=>this.actions$.pipe(c(Ay),S(this.store.select(U)),A(([e,t])=>{let s={workspaceId:t.params.workspaceId};return this.appService.get(`${bD}/gd`,s).pipe(m(i=>vy({data:i})),h(i=>d(Dp({message:i.message}))))}))),this.upload$=p(()=>this.actions$.pipe(c(by),A(e=>{let t={googleDrive:!0,items:e.data.ids};return this.appService.post("images-cache",t).pipe(m(s=>ky({data:{holderId:e.data.holderId,urls:s.urls}})),h(s=>d(Dp({message:"file is not uploaded"}))))})))}formatData(e){return e}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var kD=He({source:"Google Drive API",events:{Fetch:de(),"Fetch Success":de(),"Fetch More":de(),"Fetch Token":Pe(),"Fetch Token Success":de(),Upload:de(),"Upload Success":de()}}),{fetch:In,fetchSuccess:Ti,fetchMore:Tn,fetchToken:vI,fetchTokenSuccess:En,upload:bI,uploadSuccess:kI}=kD;var wD={token:null,state:null,ui:null,isLoading:!1},dr=Yi({name:"google-drive",reducer:Zi(wD,Dt(En,(r,o)=>y(f({},r),{token:o.data})),Dt(In,Tn,r=>y(f({},r),{isLoading:!0})),Dt(Ti,(r,o)=>y(f({},r),{state:o.data,isLoading:!1})))});var $I=dr.name,II=dr.reducer,TI=dr.selectState,tL=dr.selectToken,sL=dr.selectIsLoading;var Hl=$.endpoints.sources,MI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetchToken$=p(()=>this.actions$.pipe(c(vI),S(this.store.select(U)),A(([e,t])=>{let s={workspaceId:t.params.workspaceId};return this.appService.get(`${Hl}/gd`,s).pipe(m(i=>En({data:i})),h(i=>d(T({message:i.message}))))}))),this.fetch$=p(()=>this.actions$.pipe(c(In),S(this.store.select(U)),A(([e,t])=>{let s={workspaceId:t.params.workspaceId,orderBy:"modifiedTime"};return e.data.folderId&&(s=y(f({},s),{folder:e.data.folderId})),e.data.search&&(s=y(f({},s),{search:e.data.search})),e.data.orderBy&&(s=y(f({},s),{orderBy:e.data.orderBy})),this.appService.get(`${Hl}/gd/list`,s).pipe(m(i=>Ti({data:i})),h(i=>d(T({message:i.message}))))}))),this.fetchMore$=p(()=>this.actions$.pipe(c(Tn),S(this.store.select(TI),this.store.select(U)),A(([e,t,s])=>{let i={workspaceId:s?.params.workspaceId,orderBy:"createdTime"};return e.data.folderId&&(i=y(f({},i),{folder:e.data.folderId})),e.data.search&&(i=y(f({},i),{search:e.data.search})),e.data.orderBy&&(i=y(f({},i),{orderBy:e.data.orderBy})),t&&t.pageToken&&(i=y(f({},i),{pageToken:t.pageToken})),this.appService.get(`${Hl}/gd/list`,i).pipe(m(a=>{let n=a;return a.data.files.length!==0&&(n=y(f({},n),{data:y(f({},n.data),{files:[...t.data.files,...a.data.files]})})),a.data.folders.length!==0&&(n=y(f({},n),{data:y(f({},n.data),{folders:[...t.data.folders,...a.data.folders]})})),Ti({data:n})}),h(a=>d(T({message:a.message}))))}))),this.upload$=p(()=>this.actions$.pipe(c(bI),A(e=>{let t={googleDrive:!0,items:e.data.ids,accessToken:e.data.accessToken};return this.appService.post("images-cache",t).pipe(m(s=>kI({data:{holderId:e.data.holderId,urls:s.urls}})),h(s=>d(T({message:s.message}))))})))}formatData(e){return e}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var DI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(wy),S(this.store.select(Ty)),A(([e,t])=>t.length===0?this.appService.get(`${e.data}/labels`,{}).pipe(m(s=>Pp({data:s.data,meta:{}})),h(s=>d(T({message:s.message})))):d(Pp({data:t,meta:{}})))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var RI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Lp),V(e=>d(e).pipe(S(this.store.select(_p({key:e.meta.key})),this.store.select(L)))),A(([e,t,s])=>{let i=this.setParam(e.data,s.id);return this.appService.get(`${t}`,i).pipe(m(a=>e.data.total===0?Ey(this.formatData(a,e.meta.key)):My(this.formatData(a,e.meta.key))),h(a=>d(T({message:a.message}))))}))),this.search$=p(()=>this.actions$.pipe(c(Dy),V(e=>d(e).pipe(S(this.store.select(_p({key:e.meta.key})),this.store.select(L)))),A(([e,t,s])=>{if(!e.data)return d(Lp({data:{total:0},meta:{key:e.meta.key}}));let i=this.setParam({total:0},s.id,e.data.trim());return this.appService.search(t,i).pipe(m(a=>Ry(this.formatData(a,e.meta.key))),h(()=>d(T({message:"could not search!"}
1))))})))}setParam(e,t,s){let n={page:Math.floor(e.total/20),size:20,sort:"createdAtSince",order:"desc",workspaceId:t};return e.searchString&&(n=y(f({},n),{searchString:e.searchString})),s&&(n=y(f({},n),{searchString:s})),n}formatData(e,t){return{data:e.data,meta:{total:e.meta.total,key:t}}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var CI=$.endpoints.campaigns;function LI(r){return r?.filter(o=>Zh.some(e=>e.id===o&&!e.hideInCampaign))||[]}function Mi(r,o){let e=r.meta.goalSet?r.meta.goalSet.map(s=>y(f({},s),{goals:s.goals?s.goals.map(i=>f({mediaType:i.id.substring(0,i.id.lastIndexOf("/"))},i)):[]})):[],t={id:r.id,createdAt:r.createdAt,workspaceId:r.workspaceId,name:r.name,client:{id:r.clientId,name:r.clientName,logo:r.clientLogo},media:r.meta.media,links:r.meta.links?r.meta.links:[],reports:r.meta.reports&&r.meta.reports.length!==0?r.meta.reports:null,creators:r.meta.creators?r.meta.creators:null,sourceTypes:LI(o.sources),timezone:r.meta.timezone?r.meta.timezone:o.timezone,startDate:r.meta.startDate?r.meta.startDate:"",endDate:r.meta.endDate?r.meta.endDate:"",templateName:r.meta?.templateName,goalSet:e};return r.groupId&&(t=y(f({},t),{groups:r.groupId.map((s,i)=>({id:s,name:r.groupName[i]}))})),r.assignedToId&&(t=y(f({},t),{assignedTo:{id:r.assignedToId,name:r.assignedToName}})),r.displayName&&(t=y(f({},t),{displayName:r.displayName})),r.labels&&(t=y(f({},t),{labels:r.labels})),t}var Vl=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.snackBar=l(we),this.appService=l(E),this.init$=p(()=>this.actions$.pipe(c(zu),S(this.store.select(L)),m(([,e])=>{let t={sources:LI(e.sources),timezone:e.timezone,goalSet:[]};return Ku({data:t})}))),this.fetch2$=p(()=>this.actions$.pipe(c(jr),S(this.store.select(L)),A(([e,t])=>this.appService.get(`${CI}/${e.data}`).pipe(m(s=>Zc(this.formatData(s,t))),h(s=>d(Ro({message:s.message}))))))),this.fetch2Success$=p(()=>this.actions$.pipe(c(Zc),S(this.store.select(_y)),N(([e,t])=>t!==null?[Mo({data:e.data,meta:e.meta}),Lo({data:{campaignId:e.data.id,goalSetIndex:t}})]:[Mo({data:e.data,meta:e.meta})]))),this.fetch$=p(()=>this.actions$.pipe(c(Eo),S(this.store.select(L)),A(([e,t])=>this.appService.get(`${CI}/${e.data}`).pipe(m(s=>Mo(this.formatData(s,t))),h(s=>d(Ro({message:s.message}))))))),this.updateDataArray$=p(()=>this.actions$.pipe(c(Do),S(this.store.select(je)),m(([,e])=>e?.id?Rs():K()))),this.updateCampaignMediaStore$=p(()=>this.actions$.pipe(c(ep,ip),S(this.store.select(Go)),m(([,e])=>qu({data:{type:"media",prop:e}})))),this.updateCampaignMediaFromReport$=p(()=>this.actions$.pipe(c(ip),m(()=>op()))),this.updateCampaignMediaFromReportSuccess$=p(()=>this.actions$.pipe(c(op),m(()=>Fo()))),this.updateCampaignMedia$=p(()=>this.actions$.pipe(c(ep),m(()=>tp()))),this.updateMediaSuccess$=p(()=>this.actions$.pipe(c(tp),S(this.store.select(je)),m(([,e])=>e?.id?Rs():K()))),this.setSelectedSuccess$=p(()=>this.actions$.pipe(c(Gg),m(()=>zg()))),this.update$=p(()=>this.actions$.pipe(c(Cs),S(this.store.select(je)),m(([,e])=>{setTimeout(()=>this.snackBar.open("Campaign is updated successfully","Ok",{duration:1500,horizontalPosition:"right",panelClass:["success-snackbar"]}),0);let t=e?.media,s=!0;for(let i in t)if(t.hasOwnProperty(i)&&t[i].length!==0){s=!1;break}return e?.reports?K():s?K():Ur({data:e})}))),this.addToGroup$=p(()=>this.actions$.pipe(c(Bu),S(this.store.select(je),this.store.select(jo)),N(([,e,t])=>{let s=t.map(i=>({id:i.id,name:i.name}));if(e?.id)return[Xc({data:s})];{let i=t[0],a={},n,u,g,v,b=["assignedTo","client"];for(let D=0;D<b.length;D++)n=b[D],u=n+"Id",g=n+"Name",v=this.formatGroupData(i[u],i[g]),v.length!==0&&(a[n]=v[0]);i.labels&&i.labels.length!==0&&(a.labels=i.labels);let M=!1,P=[];P.push("client");for(let D=0;D<P.length;D++)if(n=P[D],e?.[n]){M=!0;break}return!M&&a&&Object.keys(a).length!==0?[xr({data:s}),Wu({data:a})]:[xr({data:s})]}}),h(e=>d(Ro({message:e.message}))))),this.addToGroupSuccess$=p(()=>this.actions$.pipe(c(Xc),m(()=>Rs()))),this.reset$=p(()=>this.actions$.pipe(c(Vu),N(()=>[Ls(),rg()])))}formatGroupData(e,t){return e!==void 0?e.map((s,i)=>({id:s,name:t[i]})):[]}formatData(e,t){return{data:Mi(e,t),meta:{}}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Di=$.endpoints.campaigns,ED=$.endpoints.groups;function Ql(r,o,e){let t=[],s;r.meta&&r.meta.reports&&(t=r.meta.reports.map(n=>(s=n.slug,y(f({},n),{slug:`/${e}${s}`}))));let i=[];return r.mediaArr?.map(n=>{let u=n.split("_")[0];i.includes(u)||i.push(u)}),{id:r.id,name:r.name,status:r.status,clientId:r.clientId,clientName:r.clientName,assignedToName:r.assignedToName,progressSet:r.progressSet,progressStatus:r.progressStatus,owner:r.ownerName.toLowerCase()===o.name.toLowerCase()?"Me":r.ownerName,createdAt:r.createdAt?Nt(r.createdAt,"MMM dd, yyyy"):"",modifiedAt:r.modifiedAt?Nt(r.modifiedAt,"MMM dd, yyyy"):"",createdAtSince:r.createdAtSince,modifiedAtSince:r.modifiedAtSince,isNew:r.isNew,reports:t,mediaIcons:i,startDate:r.startDate?Nt(r.startDate,"MMM dd, yyyy"):"",endDate:r.endDate?Nt(r.endDate,"MMM dd, yyyy"):""}}function Rn(r){let o=[];if(r.media)for(let t of Object.keys(r.media))for(let s of r.media[t])o.push({id:s.id,connectionId:s.connectionId,mediaType:s.mediaType,type:s.type,postUrl:s.postUrl?s.postUrl:""});
1let e={id:r.id,workspaceId:r.workspaceId,name:r.name,clientId:r.client.id,clientName:r.client.name,media:o,creators:r.creators?.map(t=>({id:t.id,creatorWorkspaceId:t.creatorWorkspaceId,name:t.name})),timezone:r.timezone,endDate:r.endDate,startDate:r.startDate};if(r.client.logo&&(e=y(f({},e),{clientLogo:r.client.logo})),r.goalSet){let t;e=y(f({},e),{goalSet:r.goalSet.map(s=>y(f({},s),{goals:s.goals.map(i=>(t={id:i.id,name:i.name,searchName:i.searchName,type:i.type,quantity:i.quantity,itemMap:i.itemMap},i.exclude&&(t=y(f({},t),{exclude:i.exclude})),i.include&&(t=y(f({},t),{include:i.include})),t))}))})}return r.displayName&&(e=y(f({},e),{displayName:r.displayName})),r.labels&&(e=y(f({},e),{labels:r.labels})),r.assignedTo&&(e=y(f({},e),{assignedToId:r.assignedTo.id,assignedToName:r.assignedTo.name})),r.templateName&&(e=y(f({},e),{templateName:r.templateName})),r.groups&&r.groups[0]?.id&&(e=y(f({},e),{groupId:r.groups.map(t=>t.id),groupName:r.groups.map(t=>t.name)})),e}var NI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.preFetch$=p(()=>this.actions$.pipe(c(Po),m(e=>ie({meta:{key:ce}})))),this.fetchSuccess$=p(()=>this.actions$.pipe(c(se),m(e=>e.meta.key===ce?Gr():K()))),this.fetchSuccess2$=p(()=>this.actions$.pipe(c(Gr),S(this.store.select(Ye)),m(([e,t])=>t?zs({data:{total:0}}):K()))),this.add$=p(()=>this.actions$.pipe(c(Ju),S(this.store.select(je),this.store.select(Ye),this.store.select(L)),_(([e,t,s,i])=>this.appService.add(Di,Rn(t)).pipe(N(a=>{let n=[];return s&&(n=[jy({data:Mi(a,i)})]),a.meta&&a.meta.media.length!==0||e.data?.report?[...n,Ur({data:a})]:[...n,Co({data:a})]}),h(a=>d(x({message:a.message,meta:{key:ce}}))))))),this.addSuccess$=p(()=>this.actions$.pipe(c(Co,rp),m(()=>ie({meta:{key:ce}})))),this.remove$=p(()=>this.actions$.pipe(c(Yu),S(this.store.select(je)),_(([e,t])=>this.appService.remove(Di,t).pipe(m(()=>ue({data:t,meta:{key:ce}})),h(s=>d(x({message:s.message,meta:{key:ce}}))))))),this.archive$=p(()=>this.actions$.pipe(c(Xu),V(e=>d(e).pipe(S(this.store.select(mt({key:ce}))))),_(([e,t])=>{let s={ids:t.map(i=>i.id),archive:e.data};return this.appService.post(`${Di}/archive`,s).pipe(m(()=>Ct({meta:{key:ce}})),h(i=>d(x({message:i.message,meta:{key:ce}}))))}))),this.duplicate$=p(()=>this.actions$.pipe(c(Zu),V(e=>d(e).pipe(S(this.store.select(mt({key:ce}))))),_(([e,t])=>{let s={ids:t.map(i=>i.id),withMedia:!!e.data};return this.appService.post(`${Di}/copy`,s).pipe(m(()=>Ct({meta:{key:ce}})),h(i=>d(x({message:i.message,meta:{key:ce}}))))}))),this.update2$=p(()=>this.actions$.pipe(c(Rs),V(e=>d(e).pipe(S(this.store.select(Ke({key:ce})),this.store.select(je),this.store.select(ye),this.store.select(L)))),_(([e,t,s,i,a])=>this.appService.update(Di,Rn(s)).pipe(m(n=>t?Ne({data:this.format(n,i,a.slug),meta:{key:ce}}):Cs()),h(n=>d(x({message:n.message,meta:{key:ce}}))))))),this.update2Success$=p(()=>this.actions$.pipe(c(Ne),m(e=>e.meta.key===ce?Cs():K()))),this.update2SuccessSuccess$=p(()=>this.actions$.pipe(c(Cs),S(this.store.select(je),this.store.select(Ye)),N(([e,t,s])=>s?[jr({data:t.id}),Ks({data:s})]:[jr({data:t.id})]))),this.addReport$=p(()=>this.actions$.pipe(c(Ur),_(e=>this.appService.add($.endpoints.reports,this.formatReportData(e.data)).pipe(m(t=>Co({data:t})),h(t=>d(x({message:t.message,meta:{key:ce}}))))))),this.removeReport$=p(()=>this.actions$.pipe(c(eg),_(e=>this.appService.remove($.endpoints.reports,e.data).pipe(m(t=>rp()),h(t=>d(x({message:t.message,meta:{key:ce}}))))))),this.addToGroup$=p(()=>this.actions$.pipe(c(Qu),S(this.store.select(mt({key:ce})),this.store.select(jo)),_(([e,t,s])=>{let i={campaignIds:(t||[]).map(a=>a.id),groupIds:s.map(a=>a.id),isRemove:!1};return this.appService.update2(`${ED}`,i).pipe(m(a=>sp()),h(a=>d(x({message:a.message,meta:{key:ce}}))))}))),this.addToGroup$Success$=p(()=>this.actions$.pipe(c(sp),N(e=>[Eh({meta:{key:ce}}),qs()]),h(e=>d(Bs({message:e.message})))))}format(e,t,s){return Ql(e,t,s)}formatReportData(e){return{name:"Default Report",campaign:e.id}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var MD=He({source:"Explore API",events:{"Update Tabs":Pe()}}),{updateTabs:Cn}=MD;var OI="overview",jI=(()=>
1{class r{constructor(){this.store=l(I),this.actions$=l(w),this.defaultStorage=l(Vs),this.tableSuccess$=p(()=>this.actions$.pipe(c(se,et,Ne,ro,ue),m(e=>e.meta.key===Ie?Cn():K()))),this.folderSuccess$=p(()=>this.actions$.pipe(c(Xo,ea,Qr,Jr,Hs),m(()=>Cn()))),this.updateTabs$=p(()=>this.actions$.pipe(c(Cn),V(e=>d(e).pipe(S(this.store.select(Jt({key:Ie})),this.store.select(L),this.store.select(_A)))),m(([e,t,s,i])=>{let a=Array.isArray(i)?i:[];return(!t||t.length===0)&&a.length===0?br({data:[]}):br({data:NA(t??[],s,this.defaultStorage,a)})})))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Jl=$.endpoints.groups;function Yl(r,o,e){let t=[],s;return r.meta&&r.meta.reports&&(t=r.meta.reports.map(a=>(s=a.slug,y(f({},a),{slug:`/${e}${s}`})))),{id:r.id,name:r.name,assignedToName:r.assignedToName?r.assignedToName[0]:null,owner:r.ownerName.toLowerCase()===o.name.toLowerCase()?"Me":r.ownerName,createdAt:r.createdAt?Nt(r.createdAt,"MMM dd, yyyy"):"",modifiedAt:r.modifiedAt?Nt(r.modifiedAt,"MMM dd, yyyy"):"",createdAtSince:r.createdAtSince,modifiedAtSince:r.modifiedAtSince,isNew:r.isNew,reports:t}}var xI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetchSuccess$=p(()=>this.actions$.pipe(c(se),m(e=>e.meta.key===$e?Wy():K()))),this.add$=p(()=>this.actions$.pipe(c(Hy),S(this.store.select(Ye),this.store.select(ye),this.store.select(L)),_(([e,t,s,i])=>this.appService.add(Jl,this.formatDataForServer(t)).pipe(N(a=>[et({data:this.formatGroup(a,s,i.slug),meta:{key:$e}}),Fp()]),h(a=>d(x({message:a.message,meta:{key:$e}}))))))),this.update2$=p(()=>this.actions$.pipe(c(Qy),S(this.store.select(Ye),this.store.select(ye),this.store.select(L)),_(([e,t,s,i])=>this.appService.update2(`${Jl}/${t.id}`,this.formatDataForServer(t)).pipe(m(a=>Ne({data:this.formatGroup(a,s,i.slug),meta:{key:$e}})),h(a=>d(x({message:a.message,meta:{key:$e}}))))))),this.update2Success$=p(()=>this.actions$.pipe(c(Ne),m(e=>e.meta.key===$e?Op():K()))),this.remove$=p(()=>this.actions$.pipe(c(Vy),S(this.store.select(Ye)),_(([e,t])=>this.appService.remove(Jl,t).pipe(m(()=>ue({data:t,meta:{key:$e}})),h(s=>d(x({message:s.message,meta:{key:$e}}))))))),this.removeSuccess$=p(()=>this.actions$.pipe(c(ue),m(e=>e.meta.key===$e?Np():K()))),this.addSuccess$=p(()=>this.actions$.pipe(c(et),S(this.store.select(Rg)),N(([e,t])=>e.meta.key===$e&&t?[Ps({data:{total:0}}),Tg({data:[e.data]})]:[K()]))),this.success$=p(()=>this.actions$.pipe(c(Fp,Op,Np,Hr),m(()=>ie({meta:{key:$e}}))))}formatGroup(e,t,s){return Yl(e,t,s)}formatDataForServer(e){return{name:e.name,campaignIds:e.campaigns?e.campaigns.map(s=>s.id):[],overwrite:!0}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var UI={localStorage:$.localStorage["shared-media"].filter,endpoint:$.endpoints["shared-media"],sorting:{sort:"createdAtSince",order:"desc"},filter:{data:[{id:"authors",name:"Created By"},{id:"status",name:"Status"}]}},Te={campaigns:{localStorage:$.localStorage.campaigns.filter,localStorageCols:$.localStorage.campaigns.columns,endpoint:$.endpoints.campaigns,sorting:{sort:"createdAtSince",order:"desc"},filter:{chips:[{info:{id:"isArchived",name:"Archived",type:Io.Radio,operator:"is"},selected:[{id:0,name:"False"}]}]}},groups:{localStorage:$.localStorage.groups.filter,endpoint:$.endpoints.groups,sorting:{sort:"createdAtSince",order:"desc"}},clients:{localStorage:$.localStorage.clients.filter,endpoint:$.endpoints.clients,sorting:{sort:"createdAtSince",order:"desc"}},links:{localStorage:$.localStorage.links.filter,endpoint:$.endpoints.links,sorting:{sort:"createdAt",order:"desc"}},"creator-invites":{localStorage:$.localStorage["creator-invites"].filter,endpoint:$.endpoints["creator-invites"],sorting:{sort:"createdAtSince",order:"desc"}},creators:{localStorage:$.localStorage.creators.filter,endpoint:$.endpoints.creators,sorting:{sort:"createdAtSince",order:"desc"}},partners:{localStorage:$.localStorage.partners.filter,endpoint:$.endpoints.partners,sorting:{sort:"createdAtSince",order:"desc"}},"shared-media":UI,"shared-media-creator":UI,users:{localStorage:$.localStorage.users.filter,endpoint:$.endpoints.users,sorting:{sort:"createdAtSince",order:"desc"}},sources:{localStorage:$.localStorage.sources.filter,endpoint:$.endpoints.sources,sorting:{sort:"createdAtSince",order:"desc"}},dashboards:{localStorage:$.localStorage.dashboards.filter,endpoint:$.endpoints.dashboards,sorting:{sort:"createdAtSince",order:"desc"},pagination:{page:0,size:500,sizeOptions:[50,100,200,500]}}},hr={page:0,size:50,sizeOptions:[5,10,20,50,100]},zI=(()=>
1{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.router=l(me),this.loadingOn$=p(()=>this.actions$.pipe(c(ie,Rc),m(()=>Ht({data:!0})))),this.loadingOff$=p(()=>this.actions$.pipe(c(se,x),m(()=>Ht({data:!1})))),this.changeColumns$=p(()=>this.actions$.pipe(c(Rc),m(e=>{localStorage.setItem(Te[e.meta.key].localStorageCols,JSON.stringify(e.data)),window.location.reload()})),{dispatch:!1}),this.beforeFetch$=p(()=>this.actions$.pipe(c(ie),V(e=>d(e).pipe(S(this.store.select(Ke({key:e.meta.key})),this.store.select(L)))),N(([e,t,s])=>{let i=f({},Te[e.meta.key].filter),a=Te[e.meta.key].localStorage,n=localStorage.getItem(a);if(n){let b=JSON.parse(n);i.chips&&i.chips.map(M=>{b.filter(D=>D.info.id===M.info.id).length===0&&b.push(M)}),i=y(f({},i),{chips:b})}let u,g=Te[e.meta.key].localStorageCols,v=g?localStorage.getItem(g):null;return v?(u=JSON.parse(v),u.filter(M=>M.id===Te[e.meta.key].sorting.sort).length):u=s.settings?.[e.meta.key]?.columns,[Ds({data:y(f({},i),{data:[]}),meta:{key:e.meta.key}}),io({data:{ctas:s.settings?.[e.meta.key]?.ctas,columns:u},meta:{key:e.meta.key}})]}))),this.onFetch$=p(()=>this.actions$.pipe(c(Or),m(e=>e.meta.key===Le?Ng():e.meta.key===vt||e.meta.key===OI?K():Ct({meta:e.meta})))),this.fetch$=p(()=>this.actions$.pipe(c(Ct),V(e=>d(e).pipe(S(this.store.select(Re({key:e.meta.key})),this.store.select(At({key:e.meta.key})),this.store.select(Ke({key:e.meta.key})),this.store.select(ye),this.store.select(L)))),A(([e,t,s,i,a,n])=>{let u=this.getEndpoint(Te[e.meta.key].endpoint,s),g=Te[e.meta.key].pagination??hr,v=y(f({},Te[e.meta.key].sorting),{page:g.page,size:g.size,workspaceId:n.id});return v=this.addFilterParam(v,t),v=this.addInfoParam(v,s,e.meta),this.appService.get(u,v).pipe(N(b=>{let M=b.meta.filter,D={data:Object.keys(M).map(C=>({id:C,name:M[C].info.name}))};return[se(this.formatDataInit(b,y(f(f({},v),i),{key:e.meta.key}),a,n.slug,g)),Ms({data:D,meta:{key:e.meta.key}})]}),h(b=>n?d(Se({meta:e.meta})):d(x({message:b.message,meta:e.meta}))))}))),this.bypass$=p(()=>this.actions$.pipe(c(Se),m(()=>Ht({data:!1})))),this.fetchPage$=p(()=>this.actions$.pipe(c(kh),V(e=>d(e).pipe(S(this.store.select(Mr({key:e.meta.key})),this.store.select(Ke({key:e.meta.key})),this.store.select(Yt({key:e.meta.key})),this.store.select(Re({key:e.meta.key})),this.store.select(At({key:e.meta.key})),this.store.select(ye),this.store.select(L)))),A(([e,t,s,i,a,n,u,g])=>{let v=this.getEndpoint(Te[e.meta.key].endpoint,n),b=y(f({},s),{page:e.data.page,size:e.data.size,key:e.meta.key});return this.appService.get(v,this.addParam(b,i,t,a,n)).pipe(m(M=>se(this.formatData(M,b,u,g.slug))),h(M=>d(x({message:M.message,meta:e.meta}))))}))),this.fetchSort$=p(()=>this.actions$.pipe(c(bh),V(e=>d(e).pipe(S(this.store.select(Mr({key:e.meta.key})),this.store.select(Ke({key:e.meta.key})),this.store.select(Yt({key:e.meta.key})),this.store.select(Re({key:e.meta.key})),this.store.select(At({key:e.meta.key})),this.store.select(ye),this.store.select(L)))),A(([e,t,s,i,a,n,u,g])=>{let v=this.getEndpoint(Te[e.meta.key].endpoint,n),b=y(f({},s),{page:0,sort:e.data.sort,order:e.data.order});return this.appService.get(v,this.addParam(b,i,t,a,n)).pipe(m(M=>se(this.formatData(M,b,u,g.slug))),h(M=>d(x({message:M.message,meta:e.meta}))))}))),this.addSuccess$=p(()=>this.actions$.pipe(c(et),V(e=>d(e).pipe(S(this.store.select(Jt({key:e.meta.key}))))),m(([e,t])=>t?wh(e):K()))),this.removeSuccess$=p(()=>this.actions$.pipe(c(ue),m(e=>{e.redirect&&this.router.navigate(["/"])})),{dispatch:!1}),this.remove2$=p(()=>this.actions$.pipe(c($h),V(e=>d(e).pipe(S(this.store.select(mt({key:e.meta.key})),this.store.select(At({key:e.meta.key}))))),A(([e,t,s])=>{let i=this.getEndpoint(Te[e.meta.key].endpoint,s),a={};return a=this.addIdsParam(a,t,e.meta.key),a=this.addInfoParam(a,s,e.meta),this.appService.remove2(i,a).pipe(m(()=>ro({meta:e.meta})),h(n=>d(x({message:n.message,meta:e.meta}))))}))),this.search$=p(()=>this.actions$.pipe(c(Ih),V(e=>d(e).pipe(S(this.store.select(Ke({key:e.meta.key})),this.store.select(Yt({key:e.meta.key})),this.store.select(Re({key:e.meta.key})),this.store.select(At({key:e.meta.key})),this.store.select(ye),this.store.select(L)))),A(([e,t,s,i,a,n,u])=>{let g=this.getEndpoint(Te[e.meta.key].endpoint,a);if(!e.data.queryString)return d(Dc({meta:e.meta}));let v=y(f({},t),{page:0});return this.appService.search(g,this.addParam(v,s,e.data.queryString.trim(),i,a)).pipe(m(b=>se(this.formatData(b,v,n,u.slug))),h(()=>d(x({message:"could not search!",meta:e.meta}))))}))),this.restoreSearch$=p(()=>this.actions$.pipe(c(Dc),V(e=>d(e).pipe(S(this.store.select(Ke({key:e.meta.key})),this.store.select(Yt({key:e.meta.key})),this.store.select(Re({key:e.meta.key})),this.store.select(At({key:e.meta.key})),this.store.select(ye),this.store.select(L)))),A(([e,t,s,i,a,n,u])=>{let g=this.getEndpoint(Te[e.meta.key].endpoint,a),v=y(f({},t),{page:0});return this.appService.get(g,this.addParam(v,s,null,i,a)).pipe(m(b=>Th(this.formatData(b,v,n,u.slug))),h(b=>d(x({message:b.message,meta:e.meta}))))}))),this.update$=p(()=>this.actions$.pipe(c(Mh),V(e=>d(e).pipe(S(this.store.select(Mr({key:e.meta.key})),this.store.select(Ke({key:e.meta.key})),this.store.select(Yt({key:e.meta.key})),this.store.select(Re({key:e.meta.key})),this.store.select(At({key:e.meta.key})),this.store.select(ye),this.store.select(L)))),A(([e,t,s,i,a,n,u,g])=>{let v=this.getEndpoint(Te[e.meta.key].endpoint,n),b=y(f({},s),{page:0});return this.appService.get(v,this.addParam(b,i,t,a,n)).pipe(m(M=>se(this.formatData(M,b,u,g.slug))),h(M=>d(x({message:M.message,meta:e.meta}))))}))),this.filter$=p(()=>this.actions$.pipe(c(To,xu),V(e=>d(e).pipe(S(this.store.select(Mr({key:e.meta.key})),this.store.select(Ke({key:e.meta.key})),this.store.select(Yt({key:e.meta.key})),this.store.select(Re({key:e.meta.key})),this.store.select(At({key:e.meta.key})),this.store.select(ye),this.store.select(L)))),A(([e,t,s,i,a,n,u,g])=>
1{if(e.meta.key===Le)return d(Uo());if(e.meta.key===vt)return d(ho());{let v=this.getEndpoint(Te[e.meta.key].endpoint,n),b=y(f({},s),{page:0});return this.appService.get(v,this.addParam(b,i,t,a,n)).pipe(m(M=>(a.chips.length!==0?localStorage.setItem(Te[e.meta.key].localStorage,JSON.stringify(a.chips)):localStorage.removeItem(Te[e.meta.key].localStorage),se(this.formatData(M,b,u,g.slug)))),h(M=>d(x({message:M.message,meta:e.meta}))))}})))}setParam(e,t){let s={page:0,size:e.size,sort:e.sort,order:e.order};return t&&(s=y(f({},s),{searchString:t})),s}formatDataInit(e,t,s,i,a){let n=y(f(f({},e.meta),t),{sizeOptions:a.sizeOptions});return this.format(e,n,s,i)}formatData(e,t,s,i){let a=f(f({},t),e.meta);return this.format(e,a,s,i)}format(e,t,s,i){let a,n;switch(t.key){case $e:n=e.data.map((b,M)=>this.formatGroup(b,s,i,M)),a={data:n,meta:t};break;case ce:n=e.data.map((b,M)=>this.formatCampaign(b,s,i,M));let u=[{id:"name",name:"Name",template:"report",disabled:!0},{id:"clientName",name:"Client",disabled:!0,template:"link2"},{id:"progress",name:"Progress",template:"progress"},{id:"owner",name:"Created By"},{id:"createdAtSince",name:"Created At"},{id:"assignedToName",name:"Assigned To"},{id:"startDate",name:"Start Date"},{id:"endDate",name:"End Date"},{id:"progressStatus",name:"Progress Status"},{id:"status",name:"Status",template:"chip"},{id:"modifiedAt",name:"Modified At"}],g=[...t.columns],v;u.map(b=>{v=t.columns.filter(M=>M.id===b.id),v.length===0&&g.push(b)}),a={data:n,meta:y(f({},t),{columnOptions:g})};break;case xe:n=e.data.map(b=>this.formatUser(b)),a={data:n,meta:t};break;default:n=e.data,a={data:n,meta:t}}return a}addParam(e,t,s,i,a){let n;return n={page:e.page,size:e.size,sort:e.sort,order:e.order},n=this.addDateParam(n,t),n=this.addSearchParam(n,s),n=this.addFilterParam(n,i),n=this.addInfoParam(n,a,e),n}getEndpoint(e,t){return e}addIdsParam(e,t,s){return t?s===xe?y(f({},e),{ids:t.map(i=>btoa(i.id).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")).join(",")}):y(f({},e),{ids:t.map(i=>i.id).join(",")}):e}addInfoParam(e,t,s){return t?s.key==="shared-media-creator"?y(f({},e),{creatorWorkspaceId:t}):y(f({},e),{hostWorkspaceId:t}):e}addFilterParam(e,t){if(t&&t.chips&&t.chips.length!==0)for(let s of t.chips){let i=s.selected.map(a=>a.id).join(", ");e=y(f({},e),{[s.info.id]:s.info.operator+"|"+i})}return e}addDateParam(e,t){return t&&t.length!==0&&(e=y(f({},e),{fromDate:t[0].fromDate,toDate:t[0].toDate})),e}addSearchParam(e,t){return t&&(e=y(f({},e),{searchString:t})),e}formatGroup(e,t,s,i){return Yl(e,t,s)}formatCampaign(e,t,s,i){return Ql(e,t,s||"")}addMediaParam(e,t){if(t){let s=[];for(let i in t)t.hasOwnProperty(i)&&t[i].map(a=>{s.push(a.id)});e=y(f({},e),{mediaIds:s.join()})}return e}formatCreators(e){return e.hasOwnProperty("pending")?{id:e.id,name:"-",email:e.email,createdAt:e.invited_at,status:"Pending",networks:[]}:{id:e.id,email:e.email,createdAt:e.add_at,status:"Active",networks:e.networks.map(t=>y(f({},t),{expanded:!0}))}}formatUser(e){return y(f({},e),{status:e.status==="active"?"Active":"pending",name:e.name||"-----"})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var KI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(OA),S(this.store.select(zA)),A(([e,t])=>t.length===0?this.appService.get("timezones").pipe(m(s=>jA({data:s})),h(s=>d(xA({message:s.message})))):d(K()))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Xl=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.uploadService=l(qA),this.uploadStart$=p(()=>this.actions$.pipe(c(KA),V(e=>d(e).pipe(S(this.store.select(em({key:e.meta}))))),m(([e,t])=>ra({data:t[0],meta:e.meta})))),this.uploadRequest$=p(()=>this.actions$.pipe(c(ra),A(e=>this.uploadService.uploadRequest(e.data).pipe(m(t=>Jp({data:t,meta:e.meta})),h(()=>d(Yr({message:"upload failed"}))))))),this.upload$=p(()=>this.actions$.pipe(c(Jp),A(e=>this.uploadService.upload(e.data).pipe(m(t=>{switch(t.type){case ws.Sent:return K();case ws.UploadProgress:{let s=t.total??1,i=t.total?Math.round(100*t.loaded/t.total):0;return t.loaded===0&&t.total===void 0?K():BA({data:i,meta:e.meta})}case ws.DownloadProgress:return K();case ws.ResponseHeader:return K();case ws.Response:return t.status===204?Yp({data:e.data,meta:e.meta}):Yr({message:t.statusText||"Unknown error"});default:return Yr({message:`Unknown Event: ${JSON.stringify(t)}`})}}),h(t=>d(Yr({message:"upload failed"}))))))),this.uploadSuccess$=p(()=>this.actions$.pipe(c(Yp),V(e=>d(e).pipe(S(this.store.select(em({key:e.meta}))))),m(([e,t])=>t.length!==0?ra({data:t[0],meta:e.meta}):K())))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var ed=(()=>
1{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(oo()),this.actions$.pipe(c(yt,pt),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var BI=$.localStorage.invite,td=(()=>{class r{constructor(){this.platformId=l(ks)}canActivate(e,t){if(Mt(this.platformId)){if(e.queryParams.hasOwnProperty("code"))return!0;if(e.queryParams.hasOwnProperty("inviteToken")&&!localStorage.getItem(BI)){let i=e.queryParams.inviteToken.replace(/-/g,"+").replace(/_/g,"/").replace(/\./g,"=");localStorage.setItem(BI,atob(i))}return!0}else return!0}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var qI=(()=>{class r{constructor(){this.platformId=l(ks)}getAccessToken(){if(Mt(this.platformId)){let e=localStorage.getItem("accessToken");return d(e)}return d("")}getRefreshToken(){if(Mt(this.platformId)){let e=localStorage.getItem("refreshToken");return d(e)}return d("")}setAccessToken(e){return Mt(this.platformId)&&localStorage.setItem("accessToken",e),this}setRefreshToken(e){return Mt(this.platformId)&&localStorage.setItem("refreshToken",e),this}clear(){Mt(this.platformId)&&(localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken"))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var WI=$.endpoints.groups,HI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Ps),S(this.store.select(L)),A(([e,t])=>{let s=this.setParam(e.data,t.id);return this.appService.get(`${WI}`,s).pipe(m(i=>e.data.total===0?$g(this.formatData(i)):Ig(this.formatData(i))),h(i=>d(T({message:i.message}))))}))),this.search$=p(()=>this.actions$.pipe(c(Eg),S(this.store.select(L)),A(([e,t])=>{if(!e.data)return d(Ps({data:{total:0}}));let s=this.setParam({total:0},t.id,e.data);return this.appService.search(WI,s).pipe(m(i=>Mg(this.formatData(i))),h(()=>d(T({message:"could not search!"}))))}))),this.restoreSearch$=p(()=>this.actions$.pipe(c(Dg),m(e=>Ps({data:{total:0}}))))}setParam(e,t,s){let n={page:Math.floor(e.total/200),size:200,sort:"createdAtSince",order:"desc",workspaceId:t};return e.searchString&&(n=y(f({},n),{searchString:e.searchString})),s&&(n=y(f({},n),{searchString:s})),n}formatData(e){return{data:e.data,meta:{total:e.meta.total}}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var VI=$.endpoints.users,QI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(cp),S(this.store.select(L)),A(([e,t])=>{let s=this.setParam(e.data,t.id);return this.appService.get(`${VI}`,s).pipe(m(i=>e.data.total===0?vg(this.formatData(i)):bg(this.formatData(i))),h(i=>d(T({message:i.message}))))}))),this.search$=p(()=>this.actions$.pipe(c(kg),S(this.store.select(L)),A(([e,t])=>{if(!e.data)return d(cp({data:{total:0}}));let s=this.setParam({total:0},t.id,e.data.trim());return this.appService.search(VI,s).pipe(m(i=>wg(this.formatData(i))),h(()=>d(T({message:"could not search!"}))))})))}setParam(e,t,s){let n={page:Math.floor(e.total/10),size:10,sort:"createdAtSince",order:"desc",status:"is|active",workspaceId:t};return e.searchString&&(n=y(f({},n),{searchString:e.searchString})),s&&(n=y(f({},n),{searchString:s})),n}formatData(e){return{data:e.data,meta:{total:e.meta.total}}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var sd=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(Po()),this.actions$.pipe(c(Gr,tg,x),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var JI=$.endpoints.clients,YI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(WA),A(e=>this.appService.get(`${JI}/${e.data}
1`).pipe(m(t=>HA(this.formatData(t))),h(t=>d(tm({message:t.message}))))))),this.updateClient$=p(()=>this.actions$.pipe(c(VA),S(this.store.select(Qs)),_(([e,t])=>this.appService.update(JI,this.formatDataForServer(t)).pipe(m(s=>ia(this.formatData(s))),h(s=>d(tm({message:s.message})))))))}formatData(e){return{data:{id:e.id,name:e.name,logo:e.meta?.logo??null,accountIds:e.meta?.accountIds??{}}}}formatDataForServer(e){return{id:e.id,name:e.name,meta:{logo:e.logo,accountIds:e.accountIds??{}}}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var id=$.endpoints.clients,ZI=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.add$=p(()=>this.actions$.pipe(c(JA),S(this.store.select(Qs)),_(([e,t])=>this.appService.add(id,this.formatDataForServer(t)).pipe(m(s=>et({data:s,meta:{key:rt}})),h(s=>d(x({message:s.message,meta:{key:rt}}))))))),this.updateClient$=p(()=>this.actions$.pipe(c(ZA),S(this.store.select(Qs)),_(([e,t])=>this.appService.update(id,this.formatDataForServer(t)).pipe(m(s=>Ne(this.formatData({data:s}))),h(s=>d(x({message:s.message,meta:{key:rt}}))))))),this.remove$=p(()=>this.actions$.pipe(c(YA),S(this.store.select(Qs)),A(([e,t])=>this.appService.remove(id,t).pipe(m(()=>ue({data:t,meta:{key:rt}})),h(s=>d(x({message:s.message,meta:{key:rt}})))))))}formatData(e,t){return{data:e.data,meta:y(f(f({},t),e.meta),{key:rt})}}formatDataForServer(e){return{id:e.id,name:e.name,meta:{logo:e.logo,accountIds:e.accountIds??{}}}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var od=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(ie({meta:{key:rt}})),this.actions$.pipe(c(se,Se,x),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var FD="shared-media-creator",ND=$.endpoints.creators,XI=$.endpoints[FD],OD=10,eT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(XA),A(e=>this.appService.get(`${ND}/${e.data}`).pipe(m(t=>sm({data:t})),h(t=>d(oa({message:t.message}))))))),this.fetchSuccess$=p(()=>this.actions$.pipe(c(sm),N(e=>[rm(),ev()]))),this.fetchReqMedia$=p(()=>this.actions$.pipe(c(rm),S(this.store.select(os)),A(([e,t])=>{let s={creatorWorkspaceId:t.creatorWorkspaceId,status:"is|pending",page:0,size:OD};return this.appService.get(`${XI}`,s).pipe(m(i=>tv({data:i.data,meta:i.meta})),h(i=>d(oa({message:i.message}))))}))),this.updateMedia$=p(()=>this.actions$.pipe(c(sv),S(this.store.select(ht),this.store.select(os)),A(([e,t,s])=>{let i=[];for(let n of Object.keys(t))for(let u of t[n])i.push(u.id);let a={creatorId:s.id,mediaIds:i};return this.appService.add(`${XI}/request`,a).pipe(m(()=>im()),h(n=>d(oa({message:n.message}))))}))),this.updateMediaSuccess$=p(()=>this.actions$.pipe(c(im),N(()=>[aa({data:1}),Ls()])))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var jD=$.endpoints.creators,tT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetchSuccess$=p(()=>this.actions$.pipe(c(se),m(e=>e.meta.key===Ot?mv():K()))),this.remove$=p(()=>this.actions$.pipe(c(lv),S(this.store.select(os)),A(([e,t])=>this.appService.remove2(jD,{ids:t.id}).pipe(m(()=>ue({data:t,meta:{key:Ot}})),h(s=>d(x({message:s.message,meta:{key:Ot}})))))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var ad=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(ie({meta:{key:Ot}})),this.actions$.pipe(c(se,Se,x),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var UD=$.endpoints.creators,nd=(()=>{class r{constructor(){this.actions$=l(w),this.appService=l(E),this.add$=p(()=>this.actions$.pipe(c(dv),_(e=>this.appService.add(`${UD}/invites`,e.data).pipe(m(t=>t.alreadyInvited?x({message:"This user has already been invited to Momently.",meta:{key:Js}}):nm()),h(t=>d(x({message:t.message,meta:{key:Js}}))))))),this.addSuccess$=p(()=>this.actions$.pipe(c(nm),m(e=>ie({meta:{key:Js}}))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var cd=(()=>
1{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(ie({meta:{key:Js}})),this.actions$.pipe(c(se,Se,x),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var GD=$.endpoints["shared-media"],pd=40,zD=["is|approved","is|pending"],sT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Zr),S(this.store.select(os),this.store.select(cv),this.store.select(pv)),A(([e,t,s,i])=>this.appService.get(`${GD}`,this.setParams(t,s,e.data.total,i)).pipe(m(a=>rv(this.formatData(a,e.data.total))),h(a=>d(av({message:a.message}))))))),this.changeTab$=p(()=>this.actions$.pipe(c(aa),m(()=>am()))),this.changeTabSuccess$=p(()=>this.actions$.pipe(c(am),m(()=>Zr({data:{total:0}})))),this.search$=p(()=>this.actions$.pipe(c(iv),m(()=>Zr({data:{total:0}})))),this.restoreSearch$=p(()=>this.actions$.pipe(c(ov),m(()=>om()))),this.restoreSearchSuccess$=p(()=>this.actions$.pipe(c(om),m(()=>Zr({data:{total:0}}))))}formatData(e,t){let s=t/pd;return{data:e.data,meta:y(f({},e.meta),{page:s})}}setParams(e,t,s,i){let a={status:zD[t],page:s/pd,size:pd};return a=this.addCreatorId(a,e),i&&(a=y(f({},a),{searchString:i})),a}addCreatorId(e,t){return t&&(e=y(f({},e),{creatorWorkspaceId:t.creatorWorkspaceId})),e}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();function BD(r,o,e,t,s,i,a){let n=JSON.stringify(o,null,2),u=JSON.stringify(e,null,2),g=JSON.stringify(t,null,2),v=JSON.stringify(s,null,2),b=JSON.stringify(i);return` 2 You are an assistant that helps users customize their data card. 3 4 **User Query:** 5 "${r}" 6 7 **Current Configuration:** 8 \`\`\`json 9 ${n} 10 \`\`\` 11 12 **Available integrations:** 13 ${u} 14 15 **Selected Integrations:** 16 ${g} 17 18 **Selected Metrics:** 19 ${v} 20 21 **Selected Dimensions:** 22 ${b} 23 --- 24 25 **Instructions:** 26 27 1. **Objective**: 28 Respond directly and help the user achieve what they're asking for. 29 Provide a brief response to their request, then determine which functions to call and any configuration changes needed. 30 31 2. **Available Functions**: 32 - **updateIntegrations**: Updates the list of data integrations. 33 - **updateMetrics**: Updates metrics for the selected integrations. 34 - **updateDimensions**: Updates dimensions for the selected metrics. Date is also a dimension. 35 36 3. **Highest Priority Rule**: 37 - Do not include any comments or extra explanatory text inside the JSON object. Every element in the JSON must be a valid JSON value. 38 - Only include "metrics" in the JSON output if at least one of the selected metrics has its chart type changed. If no chart type is changed, do not include "metrics" in the JSON. 39 40 4. **Additional Conditions**: 41 - If multiple integrations are selected and additional dimensions are requested, respond with "Multiple integrations selected. Only the 'date' dimension is allowed." 42 - If there are no metrics selected, do not call "updateDimensions" since dimensions require at least one metric. 43 - If the user mentions a platform name that could refer to multiple integrations (e.g., "facebook"), and does not specify additional qualifiers (like "ads"), assume they mean the base integration (e.g., "fb") rather than the more specialized one (e.g., "fbAd"). 44 - If the user does not explicitly request removing an integration, retain all currently selected integrations and only add new ones if requested. 45 - Colors inside config are associated to metrics by index. 46 47 5. **Configuration Format**: 48 \`\`\`json 49 "config": { 50 "ugName": boolean, // true if the user explicitly named the card, false otherwise 51 "scoreboard": boolean, // false if hiding the scoreboard 52 "chart": boolean, // false if hiding the chart 53 "list": boolean, // false if hiding the list 54 "xAxisDimensionId": string, // 'date' if time series, or the dimension id for x-axis 55 "chartType": string, // 'line-chart', 'bar-chart', 'combo-chart', 'area-chart', or 'pie-chart' 56 "chartLimit": number, // number of items on the chart when x-axis is not date 57 "colors": [ 58 ${a} 59 ] 60 } 61 \`\`\` 62 63 6. **Chart Type Rule**: 64 - If you detect multiple chart types requested simultaneously (e.g., line and bar charts together, or a mention of a combo/combination chart), set "chartType" to "combo-chart". 65 - If the user asks to change a single selected metric's chart type to something different from the current overall chart type, update the overall "chartType" to "combo-chart". 66 67 7. **Response Format**: 68 - Provide a JSON object (enclosed in triple backticks with \`json\`) that shows the functions to be called and any config changes.
69 - Do not include any extra text before or after the JSON object. 70 - Do not output multiple JSON objects. 71 - Config object cannot have any other keys than the ones mentioned above. 72 - The "metrics" array, if included, must strictly follow this format for each metric object: 73 { 74 "uid": "string|null", 75 "metricId": "string", 76 "integrationId": "string", 77 "chartType": "line-chart|bar-chart|combo-chart|area-chart|pie-chart" 78 } 79 - Do not include any additional fields or different naming conventions in these objects. 80 - Ensure all metric objects match this schema exactly. 81 82 8. **Example**: 83 - Example 1: If the user asks to add another integration, show a brief response like "I've added that integration for you," followed by the JSON object: 84 \`\`\`json 85 { 86 "functions": ["updateIntegrations"] 87 } 88 \`\`\` 89 90 - Example 2: When the user asks to see just the "facebook impressions" in a bar chart: 91 *Text Response:* 92 "Alright, I'll show you just the impressions as a bar chart." 93 *JSON Object:* 94 \`\`\`json 95 { 96 "functions":["updateMetrics"], 97 "config":{ 98 "chartType": "combo-chart" 99 }, 100 "metrics": [{ 101 "uid": "abc123", 102 "metricId": "fb/impressions", 103 "integrationId": "fb", 104 "chartType": "bar-chart" 105 }] 106 } 107 \`\`\` 108 109 - Example 2: When the user asks to see instagram performance in past 7 days: 110 *Text Response:* 111 "Here's the performance of your instagram posts in last 7 days." 112 *JSON Object:* 113 \`\`\`json 114 { 115 "functions":["updateIntegrations", "updateMetrics", "updateDimensions"], 116 "integrations": ["inst"] 117 } 118 \`\`\` 119 120 9. **Important**: 121 - Ensure the JSON object is valid and properly formatted. 122 - At least one of \`scoreboard\`, \`chart\`, or \`list\` must be \`true\`. 123 - **Enclose the JSON object within triple backticks with \`json\` specified (\`\`\`json... \`\`\`).** 124 `}function qD(r,o,e){let t=o.length,s=8-t,i=JSON.stringify(o,null,2),a=JSON.stringify(e,null,2);return` 125 You are an assistant that helps manage selected metrics for a data card. 126 127 **User Query:** 128 "${r}" 129 130 **Currently Selected Metrics (${t}/8):** 131 ${i} 132 133 **Available Metrics:** 134 ${a} 135 136 **Remaining Slots:** 137 ${s} 138 139 --- 140 141 **Instructions:** 142 1. **Objective**: Based on the user's request, update the list of selected metrics. 143 2. **Rules**: 144 - Under no circumstances return more than 8 metrics in the final JSON object. If the user's request would result in more than 8 metrics, respond by telling them to remove some metrics or specify fewer metrics. Do not exceed the 8-metric limit. 145 - Only add metrics if they are listed under "Available Metrics". 146 - If the user indicates they want to only have a certain set of metrics and no others (e.g., "just keep X" or "only include Y"), interpret this as an instruction to remove all other previously selected metrics and retain only the specified ones.
147 - Do not remove or override already selected metrics unless the user explicitly says to remove or replace. 148 - If the user wants to add more metrics but there are no remaining slots, inform them that they must remove some first. 149 - If the user explicitly asks to replace a metric, remove the specified one and add the requested new one, if available. 150 - If the user requests adding metrics from a platform without specifying which ones, do not automatically add every metric from that platform. 151 - Instead, either: 152 - Add only a reasonable subset of metrics that fit within the limit, or 153 - Inform the user that they need to specify which metrics they want. 154 3. **Response Format**: 155 - **Text Response**: Provide a brief message describing what changes you made (or what the user needs to do). 156 - **JSON Object**: Provide the final list of selected metrics enclosed in triple backticks with \`json\` specified, like so: 157 \`\`\`json 158 { 159 "metrics": [ 160 { 161 "uid": "string|null", 162 "metricId": "metric_id_from_available_metrics", 163 "integrationId": "integrationId_corresponding_to_the_metric", 164 "chartType": "line-chart_or_bar-chart" 165 } 166 // ... up to 8 metrics total 167 ] 168 } 169 \`\`\` 170 171 **Examples**: 172 - **If the user adds a metric when there are remaining slots:** 173 *Text Response:* "I've added that metric for you." 174 *JSON Object:* 175 \`\`\`json 176 { 177 "metrics": [ 178 { 179 "uid": "abc123", 180 "metricId": "ga4_pageviews", 181 "integrationId": "ga4", 182 "chartType": "line-chart" 183 }, 184 { 185 "uid": null, 186 "metricId": "fb_clicks", 187 "integrationId": "fb", 188 "chartType": "bar-chart" 189 } 190 ] 191 } 192 \`\`\` 193 194 - **If the user asks to replace a metric:** 195 *Text Response:* "I\u2019ve replaced 'ga4_pageviews' with 'ga4_sessions' for you." 196 *JSON Object:* 197 \`\`\`json 198 { 199 "metrics": [ 200 { 201 "uid": "xyz789", 202 "metricId": "ga4_sessions", 203 "integrationId": "ga4", 204 "chartType": "line-chart" 205 }, 206 { 207 "uid": "abc123", 208 "metricId": "fb/clicks", 209 "integrationId": "fb", 210 "chartType": "line-chart" 211 } 212 ] 213 } 214 \`\`\` 215 216 **Important**: 217 - Ensure the JSON object is properly formatted and enclosed in triple backticks with \`json\` specified. 218 - Do not include multiple JSON objects. 219 - Do not include extra text before or after the JSON object. 220 `}function WD(r,o,e,t){let s=JSON.stringify(e[0],null,2),i=JSON.stringify(o,null,2),a=JSON.stringify(e.slice(1),null,2),n=JSON.stringify(t,null,2);return` 221 You are an assistant that helps manage selected date and dimensions for a data card. 222 223 **User Query:** 224 "${r}" 225 226 **Date:** 227 ${s} 228 229 **Selected Integrations:** 230 ${i} 231 232 **Currently Selected Dimensions:** 233 ${a} 234 235 **Available Dimensions:** 236 ${n} 237 238 --- 239 240 **Instructions:** 241 1. **Objective**: Based on the user's request, update date and the list of selected dimensions. 242 2. **Dimension Rules**: 243 - Maximum of 8 dimensions allowed in total. 244 - Only add dimensions if they are listed under "Available Dimensions". 245 - If the user requests a dimension not found in "Available Dimensions", ignore the request.
246 - Do not remove or override already selected dimensions unless the user explicitly says to remove or replace. 247 - If the user wants to add more dimensions but there are no remaining slots, inform them that they must remove some first. 248 - If the user explicitly asks to replace a dimensions, remove the specified one and add the requested new one, if available. 249 3. **Date Rules**: 250 - Valid "dateRange" options: "today", "yesterday", "7d", "14d", "30d", "1m", "3m", "6m", "12m". 251 - If user specifies an invalid dateRange, use "custom" and include datePicker. 252 - When "dateRange" is "custom", you **must include** "datePicker" with "begin" and "end" dates in the format: 253 \`\`\`json 254 { 255 "begin": { "year": 2024, "month": 11, "day": 3 }, 256 "end": { "year": 2024, "month": 11, "day": 9 } 257 } 258 \`\`\` 259 - Valid "dateUnit" options: "day", "week", "month", "quarter", "year". 260 - Default dateRange is "7d" and dateUnit is "day". 261 3. **Response Format**: 262 - **Text Response**: Provide a brief message describing what changes you made (or what the user needs to do). 263 - **JSON Object**: Provide the date and the final list of selected dimensions enclosed in triple backticks with \`json\` specified, like so: 264 \`\`\`json 265 { 266 "date":{ 267 "id": "date", 268 "type": "date", 269 "name": "Date", 270 "dimensionMeta": { 271 "dateRange": "dateRange_option", 272 "dateUnit": "dateUnit_option", 273 // Include "datePicker" if "dateRange" is "custom". 274 } 275 }, 276 "dimensions": [ 277 { 278 "uid": "string|null", 279 "dimensionId": "dimension_id_from_available_dimensions", 280 "integrationId": "integrationId_corresponding_to_the_dimension" 281 } 282 // ... up to 8 dimensions total 283 ] 284 } 285 \`\`\` 286 287 **Examples**: 288 - **When the user specifies to see facebook tags for a dateRange not in the list (e.g., "last fiscal quarter"):** 289 *JSON Object:* 290 \`\`\`json 291 { 292 "date": { 293 "id": "date", 294 "type": "date", 295 "name": "Date", 296 "dimensionMeta": { 297 "dateRange": "custom", 298 "dateUnit": "quarter", 299 "datePicker": { 300 "begin": { "year": 2024, "month": 7, "day": 1 }, 301 "end": { "year": 2024, "month": 9, "day": 30 } 302 } 303 } 304 }, 305 "dimensions": [ 306 { 307 "uid": "abc123" 308 "dimensionId": "fb/tags", 309 "integrationId": "fb" 310 } 311 ] 312 } 313 \`\`\` 314 315 **Important**: 316 - Ensure the JSON object is properly formatted and enclosed in triple backticks with \`json\` specified. 317 - Do not include multiple JSON objects. 318 - Do not include extra text before or after the JSON object. 319 `}function HD(r){return r.reduce((o,e)=>o.filter(t=>e.includes(t)))}var VD={updateIntegrations:Av(),updateMetrics:ei(),updateDimensions:ca()},rT=(()=>{class r{processAIResponse(e){let t=e.match(/```json\s*([\s\S]*?)\s*```/);if(t){let s=t[1],i=e.replace(t[0],"").trim();try{let a=JSON.parse(s);return{plainText:i,parsedJson:a}}catch(a){throw console.error("Error parsing JSON:",a),console.error("Original JSON string:",s),a}}else return{plainText:e}}constructor(){this.aiModelMap={gpt:{call:this.callGpt,getResponse:(e,t)=>e.choices[0].message.content},claude:{call:this.callClaude,getResponse:(e,t)=>e.content[0].text},cerebras:{call:this.callCerebras,getResponse:(e,t)=>e.choices[0].message.content},groq:{call:this.callGroq,getResponse:(e,t)=>e.choices[0].message.content}},this.store=l(I),this.actions$=l(w),this.appService=l(E),this.chat$=p(()=>this.actions$.pipe(c(Sv),m(e=>cm({data:e.data})))),this.getTasks$=p(()=>this.actions$.pipe(c(cm),S(this.store.select(pa),this.store.select(jt),this.store.select(ma),this.store.select(la),this.store.select(ti),this.store.select(dm),this.store.select(da),this.store.select(L)),A(([e,t,s,i,a,n,u,g,v])=>{let b=e.data,M=s.config;M=y(f({},M),{xAxisDimensionId:M.isTimeSeries}),delete M.isTimeSeries;let P=[];v.sources.map(F=>{F!=="mc"&&P.push({id:F,title:v.sourcesObj[F].title,note:v.sourcesObj[F].subtitle})});let D=n.map(F=>({uid:F.uid,metricId:F.id,integrationId:F.mediaType,chartType:F.chartType})),C=BD(b,M,P,i,D,g.map(F=>F.id),s.config.colors||[]);return ge(this.callAI(C,t)).pipe(N(F=>{let j=this.getResponse(e.type,F,t);try{let q=this.processAIResponse(j),J=q.plainText,O=q.parsedJson,re=(O.functions??[]).map(ee=>ee),Y=!!O.config?.chartType,Z=[];if(O.metrics&&Y&&(Z=[gv({data:O.metrics})]),O.config&&!Ko(O.config)){let ee=O.config;ee.xAxisDimensionId&&(ee=y(f({},ee),{isTimeSeries:ee.xAxisDimensionId}),delete ee.xAxisDimensionId),Z=[...Z,uv({data:ee})]}return O.integrations&&(Z=[na({data:O.integrations.map(ee=>({id:ee}))}),pm({data:O.integrations.map(ee=>ee),meta:{data:j,meta:F.role}})]),re.length>0?Z=[...Z,VD[re[0]]]:(J=J||"I couldn't find any specific actions to take. Could you clarify what you'd like to do next?",Z=[...Z,Ys()]),[Xr({data:{role:"assistant",content:J}}),...Z]}catch(q){return[T({message:String(q)})]}}),h(F=>d(T({message:F.message}))))}))),this.getAllMetrics$=p(()=>this.actions$.pipe(c(pm),S(this.store.select(L),this.store.select(la)),A(([e,t,s])=>{let i=e.data.filter(n=>!s?.[n]);if(i.length===0)return d(ei());let a=i.map(n=>this.appService.get("metrics-catalog?shape=flat&surface=dashboard&withFilterMap=1",be({mediaType:n},t)).pipe(m(u=>({[n]:u.data.map(g=>y(f({},g),{metrics:g.metrics.map(v=>({id:v.id,name:v.name,note:v.note,unit:v.unit,type:v.type,mediaType:v.mediaType,dimensions:v.dimensions}))}))})),h(()=>d({[n]:null}))));return Wi(a).pipe(N(n=>[...n.map(u=>vv({data:u})),ei()]),h(n=>d(T({message:n.message}))))}))),this.getMetrics$=p(()=>this.actions$.pipe(c(ei),S(this.store.select(mm),this.store.select(ma),this.store.select(ti),this.store.select(la),this.store.select(pa),this.store.select(lm),this.store.select(jt),this.store.select(L)),A(([e,t,s,i,a,n,u,g,v])=>{let b=t.filter(j=>j.role==="user").slice(-1)[0]?.content,M=[];v.sources.map(j=>{j!=="mc"&&M.push({id:j,title:v.sourcesObj[j].title,note:v.sourcesObj[j].subtitle})});let P,D=s.reduce((j,q)=>(P=q.id,j[P]=a[P].map(J=>({name:J.name,metrics:J.metrics.map(O=>({id:O.id,name:O.name}))})),j),{}),C=i.map(j=>({uid:j.uid,metricId:j.id,integrationId:j.mediaType,chartType:j.chartType}));C=C.filter(j=>s.find(q=>q.id===j.integrationId));let F=qD(b,C,D);return ge(this.callAI(F,n)).pipe(N(j=>{let q=this.getResponse(e.type,j,n);try{let{plainText:J,parsedJson:O}=this.processAIResponse(q);if(O?.metrics){let re=[],Y=[],Z={};O.metrics.forEach(le=>{a[le.integrationId]?.forEach(Ki=>{Ki.metrics.forEach(Xe=>{Xe.id===le.metricId&&(Z[le.integrationId]=Z[le.integrationId]||[],Z[le.integrationId].push(Xe.dimensions),Y.push(y(f({},Xe),{uid:le.uid||kp(4),subAggType:1,subAgg:"total",chartType:le.chartType})),bp(re,{id:le.integrationId},"id"))})})});let ee=Object.keys(Z).reduce((le,Be)=>
319(le[Be]=HD(Z[Be]),le),{});return[Xr({data:{role:"assistant",content:J}}),bv({data:Y.sort((le,Be)=>le.mediaType.localeCompare(Be.mediaType)),meta:ee}),na({data:re}),ca()]}else return[Xr({data:{role:"assistant",content:J}}),Ys()]}catch(J){return[T({message:String(J)})]}}),h(j=>d(T({message:j.message}))))}))),this.getDimensions$=p(()=>this.actions$.pipe(c(ca),S(this.store.select(mm),this.store.select(ma),this.store.select(da),this.store.select(dm),this.store.select(pa)),A(([e,t,s,i,a,n])=>{let u=t.filter(b=>b.role==="user").slice(-1)[0]?.content,g=[];a&&Object.keys(a).length===1?g=a[Object.keys(a)[0]]:g=[];let v=WD(u,s,i,g);return ge(this.callAI(v,n)).pipe(N(b=>{let M=this.getResponse(e.type,b,n);try{let{plainText:P,parsedJson:D}=this.processAIResponse(M);if(D?.dimensions||D?.date){let C=[];C.push(D.date);let F=["ma","ga4","smartocto","fathom"],j;return D.dimensions?.forEach(q=>{if(j=q.integrationId,q.integrationId==="mc"){for(let O of Object.keys(a))if(F.includes(O)){j=O;break}}a[j].find(O=>O===q.dimensionId)&&!q.dimensionId.includes("date")&&C.push({uid:q.uid||kp(4),id:q.dimensionId,name:q.dimensionId,mediaType:j})}),[Xr({data:{role:"assistant",content:P}}),kv({data:C,meta:{}}),Ys()]}else return[Ys()]}catch(P){return[T({message:String(P)})]}}),h(b=>d(T({message:b.message}))))}))),this.removeMetric$=p(()=>this.actions$.pipe(c(yv),S(this.store.select(ti)),m(([e,t])=>{if(e.meta==="dimensions")return K();let s=[];return t.map(i=>{bp(s,{id:i.mediaType},"id")}),na({data:s})}))),this.chatSuccess$=p(()=>this.actions$.pipe(c(Ys),S(this.store.select(jt),this.store.select(lm),this.store.select(ti),this.store.select(da)),m(([e,t,s,i,a])=>{let n=y(f({},t),{metrics:i,dimensions:a});return hv({data:n})})))}callClaude(e,t){return d({})}callGpt(e,t){return d({})}callCerebras(e,t){return d({})}callGroq(e,t){return d({})}callAI(e,t){let s=t.split("-")[0];return this.aiModelMap[s].call(t,e)}getResponse(e,t,s){let i=s.split("-")[0];return this.aiModelMap[i].getResponse(t,e)}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var oT=(()=>{class r{constructor(){this.actions$=l(w),this.store=l(I),this.set$=p(()=>this.actions$.pipe(c(Mv),m(e=>Dv()))),this.update$=p(()=>this.actions$.pipe(c(fa),V(e=>d(e).pipe(S(this.store.select(ga({key:e.meta.key}))))),m(([e,t])=>{let s=!1,i=[],a=t?.chips||[];return i=a.map(n=>n.info.id===e.data.info.id?(s=!0,e.data):n),s||(i=[...a,e.data]),i=i.filter(n=>n.selected.length!==0),ha({data:i,meta:e.meta})}))),this.chip$=p(()=>this.actions$.pipe(c(Rv,Cv),V(e=>d(e).pipe(S(this.store.select(ga({key:e.meta.key}))))),m(([e,t])=>ha({data:t.chips,meta:e.meta})))),this.updateFilter$=p(()=>this.actions$.pipe(c(ha),V(e=>d(e).pipe(S(this.store.select(ga({key:e.meta.key})),this.store.select(jt)))),A(([e,t,s])=>{let i,a;return e.meta.key===Gv?(a="filters",i=t.chips):(a="metrics",i=s.metrics.map(n=>n.uid===e.meta.key?y(f({},n),{filterChips:t.chips}):n)),d(fv({data:i,props:a}))})))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var aT=$.endpoints.dashboards,nT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Kv),S(this.store.select(jt),this.store.select(_e),this.store.select(L)),A(([e,t,s,i])=>{if(e.data.items)return d(ym({data:e.data.items}));{let a={id:e.data.info.id,mediaType:e.data.mediaType,meta:t,dashboardId:s.id,timezone:s.meta.timezone,search:"",page:0};return this.appService.post(`${aT}/facets`,be(a,i)).pipe(m(n=>ym({data:n.data,params:a})),h(n=>d(Am({message:n.message}))))}}))),this.save$=p(()=>this.actions$.pipe(c(Bv),S(this.store.select(Sa)),A(([,e])=>{let t={info:e.info,selected:e.selected};return d(fa({data:t,meta:{key:e.key}}))}))),this.query$=p(()=>this.actions$.pipe(c(qv),ys(500),m(({data:e})=>(e??"").trim().toLowerCase()),wf(),S(this.store.select(Sa)),m(([e,t])=>ua({data:y(f({},t?.params??{}),{search:e,page:0})})))),this.load$=p(()=>this.actions$.pipe(c(ua),S(this.store.select(L)),A(([{data:e},t])=>{let s=e;return this.appService.post(`${aT}/facets`,be(s,t)).pipe(m(i=>Hv({data:{items:i.data??[],page:e.page,nextPage:i.meta.done?void 0:e.page+1}})),h(i=>d(Vv({error:i}),Am({message:"Failed to load results."}))))}))),this.next$=p(()=>this.actions$.pipe(c(Wv),S(this.store.select(Sa)),m(([,e])=>ua({data:y(f({},e.params),{search:e.search??"",page:e.nextPage})}))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var JD=$.endpoints.dashboards,cT=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Yy),S(this.store.select(L),this.store.select(_e),this.store.select(U)),A(([e,t,s,i])=>{let a=f(f({dashboardId:s.id,workspaceSlug:i.params.workspaceId},i.queryParams),e.data);return this.appService.add(`${JD}/card-preview`,be(a,t)).pipe(m(n=>Zy({data:Iv(n)})),h(()=>d(T({message:"could not update!"}))))})))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var ld=$.endpoints.dashboards,pT=(()=>{class r{createFetchEffect(e,t){return p(()=>this.actions$.pipe(c(e),S(this.store.select(_e),this.store.select(L),this.store.select(U)),N(([s,i,a,n])=>{let u=f({dashboardId:i.id,workspaceSlug:n?.params.workspaceId,timezone:i.meta.timezone},s.data),g=n?.params.dashboardId===i.id,v=t&&g?f(f({},u),n?.queryParams):u,b=s.data?.meta;if(b?.type==="goal"){let{start:M,end:P}=Ev(b);M&&P&&(v=y(f({},v),{begin:M.replace(/-/g,""),end:P.replace(/-/g,""),rollingEnd:void 0}))}return this.appService.add(`${ld}/card-preview`,be(v,a)).pipe(N(M=>[xp(this.format(M,s.meta)),sA({meta:s.meta})]),h(()=>d(rA({message:"could not fetch!",meta:s.meta}))))})))}constructor(){this.actions$=l(w),this.appService=l(E),this.store=l(I),this.fetch$=this.createFetchEffect(eA,!0),this.fetchOnDateChange$=this.createFetchEffect(tA,!1),this.zoom$=p(()=>this.actions$.pipe(c(Xy),V(e=>d(e).pipe(S(this.store.select(LA({key:e.meta.key})),this.store.select(_e),this.store.select(L),this.store.select(U)))),N(([e,t,s,i,a])=>{let n=f({dashboardId:s.id,workspaceSlug:a?.params.workspaceId,timezone:s.meta.timezone},e.data);return this.appService.add(`${ld}/card-preview`,be(n,i)).pipe(m(u=>xp(this.formatZoom(u,t,e.meta))),h(()=>d(T({message:"could not fetch!"}))))}))),this.download$=p(()=>this.actions$.pipe(c(iA),S(this.store.select(_e),this.store.select(U)),A(([e,t,s])=>{let i={responseType:"blob",headers:{Accept:"application/zip"}},a=s?.params.dashboardId===t.id,n=f({meta:e.data.meta,timezone:t.meta.timezone},a?s.queryParams:{});return this.appService.post(`${ld}/download-csv`,n,i).pipe(m(u=>Up({data:u,meta:e.meta})),h(()=>d(T({message:"download error"}))))}))),this.downloadSuccess$=p(()=>this.actions$.pipe(c(Up),S(this.store.select(_e)),m(([e,t])=>{let s=t.name,i=new Blob([e.data],{type:"application/zip"}),a=document.createElement("a"),n=URL.createObjectURL(i);a.href=n,a.download=`${s}.zip`,a.click(),URL.revokeObjectURL(n)})),{dispatch:!1})}format(e,t){return{data:Qp(e),meta:t}}formatZoom(e,t,s){let i=Tv(e,t);return Qp(i),{data:i,meta:s}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var dd=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(yA({data:e.params.dashboardId})),this.actions$.pipe(c(AA,T),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Nn=$.endpoints.dashboards,mT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.router=l(me),this.init$=p(()=>this.actions$.pipe(c(oA),S(this.store.select(ye),this.store.select(L)),m(([e,t,s])=>{let i=y(f({},t),{permission:"owner"}),a=s,n={isPublic:!1,generalAccess:"restricted",users:[is(i)],colors:Array.isArray(a?.dashboardColors)&&a.dashboardColors.length?a.dashboardColors:ya,timezone:a?.dashboardTimezone||a?.timezone};return aA({data:n})}))),this.fetch$=p(()=>this.actions$.pipe(c(pA),m(e=>Vr({data:this.formatDataFromServer(e.data)})))),this.fetchDuplicate$=p(()=>this.actions$.pipe(c(nA),V(e=>d(e).pipe(S(this.store.select(mt({key:Ie})),this.store.select(ye)))),m(([e,t,s])=>t.length===0?K():Vr({data:this.getDuplicateData(s,t[0])})))),this.fetchDuplicate2$=p(()=>this.actions$.pipe(c(cA),V(e=>d(e).pipe(S(this.store.select(Jt({key:Ie})),this.store.select(ye)))),m(([e,t,s])=>{let i=t.find(a=>a.id===e.data.id);return i?Vr({data:this.getDuplicateData(s,i)}):K()}))),this.fetch2$=p(()=>this.actions$.pipe(c(mA),V(e=>d(e).pipe(S(this.store.select(Jt({key:Ie}))))),m(([e,t])=>{let s=t.find(i=>i.id===e.data.id);return Vr({data:this.formatDataFromServer(s)})}))),this.save$=p(()=>this.actions$.pipe(c(lA),S(this.store.select(Vp),this.store.select(L)),_(([e,t,s])=>{let i=Nn;return t.duplicateId&&(i=`${Nn}/${t.duplicateId}`),this.appService.add(i,be(this.formatDataToServer(t),s)).pipe(m(a=>Gp({data:this.formatDataFromServer(a)})),h(a=>d(T({message:a.message}))))}))),this.saveSuccess$=p(()=>this.actions$.pipe(c(Gp),S(this.store.select(L)),m(([e,t])=>(this.router.navigate([`/${t.slug}/explore/${e.data.id}`]),et({data:e.data,meta:{key:Ie}}))))),this.update$=p(()=>this.actions$.pipe(c(dA),S(this.store.select(Vp),this.store.select(L)),_(([e,t,s])=>this.appService.update2(`${Nn}/${t.id}`,be(this.formatDataToServer(t),s)).pipe(m(i=>zp({data:this.formatDataFromServer(i)})),h(i=>d(T({message:i.message}))))))),this.updateSuccess$=p(()=>this.actions$.pipe(c(zp),S(this.store.select(U)),N(([e,t])=>{let s=[Ne({data:e.data,meta:{key:Ie}})];return t.params.dashboardId===e.data.id&&(s=[...s,ta({data:e.data.id})]),s}))),this.remove$=p(()=>this.actions$.pipe(c(fA),S(this.store.select(L),this.store.select(U)),_(([e,t,s])=>this.appService.remove(Nn,be(e.data,t)).pipe(m(i=>(s?.params.dashboardId===e.data.id&&this.router.navigate([`/${t.slug}/explore`]),ue({data:e.data,meta:{key:Ie}}))),h(i=>d(T({message:i.message})))))))}getDuplicateData(e,t){let s=y(f({},e),{permission:"owner"}),i,a=t.meta.users.map(n=>n.permission==="owner"?(i=n,is(s)):is(n));return i.id!==s.id&&(a=[...a.slice(0,1),y(f({},is(i)),{permission:"editor"}),...a.slice(1)]),y(f({},t.meta),{users:a,colors:t.meta.colors||ya,duplicateId:t.id})}formatUsers(e){return e.map(t=>is(t))}formatDataToServer(e){return this.formatData(e)}formatDataFromServer(e){let t=y(f({},e.meta),{users:e.meta?.users.map(s=>
319is(s)),colors:e.meta?.colors||ya,folder:e.meta?.folder,inheritFromFolder:e.meta?.inheritFromFolder!==void 0?!!e.meta.inheritFromFolder:!!e.meta?.folder});return f(f({},e),t)}formatData(e){return{name:e?.name,slug:cS(e?.name),meta:{isPublic:e.isPublic,generalAccess:e.generalAccess,users:e.users,colors:e.colors,timezone:e.timezone,folder:e.folder,accountIds:e.accountIds||{},inheritFromFolder:!!e.inheritFromFolder}}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var YD=He({source:"Dashboard List API",events:{Fetch:Pe(),"Fetch Success":de(),Update:de(),Add:de(),"Remove Success":de(),"Dialog Status":de(),Reset:Pe(),Move:de()}}),{fetch:Hj,fetchSuccess:Vj,update:Qj,add:Jj,removeSuccess:Yj,dialogStatus:Zj,reset:Xj,move:On}=YD;var ZD=$.endpoints.folders,dT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.defaultStorage=l(Vs),this.move$=p(()=>this.actions$.pipe(c(On),V(e=>d(e).pipe(S(this.store.select(mt({key:Ie}))))),A(([e,t])=>{let s={folderId:e.data.id,dashboardIds:t.map(i=>i.id)};return this.appService.update2(`${ZD}`,s).pipe(V(()=>[Ct({meta:{key:Ie}}),Hs({data:e.data})]),h(i=>d(x({message:i.message,meta:{key:Ie}}))))})))}formatData(e,t){return this.defaultStorage.getDefaultDashboard(t.slug)||this.setDefault(e,t),e}setDefault(e,t){e.length!==0&&this.defaultStorage.setDefaultDashboard(e[0].id,t.slug)}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var jn=$.endpoints.dashboardTemplates;function fd(r){return!r||r.scope?r:y(f({},r),{scope:r.workspaceId===db?"platform":"workspace"})}var fT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.load$=p(()=>this.actions$.pipe(c(Yv),S(this.store.select(lb),this.store.select(mb),this.store.select(L)),_(([,e,t,s])=>e?d(vm({data:t})):this.appService.get(jn,be({},s)).pipe(m(i=>vm({data:(i?.data||[]).map(fd)})),h(i=>d(Zv({error:i?.message||"could not load templates"}))))))),this.save$=p(()=>this.actions$.pipe(c(Xv),S(this.store.select(L)),_(([e,t])=>this.appService.add(jn,be(e.data,t)).pipe(m(s=>eb({data:fd(s?.data)})),h(s=>{let i=s?.message||"could not save template";return d(T({message:i}),tb({error:i}))}))))),this.update$=p(()=>this.actions$.pipe(c(sb),S(this.store.select(L)),_(([e,t])=>this.appService.update2(`${jn}/${e.data.id}`,be(e.data,t)).pipe(m(s=>rb({data:fd(s?.data)})),h(s=>{let i=s?.message||"could not update template";return d(T({message:i}),ib({error:i}))}))))),this.delete$=p(()=>this.actions$.pipe(c(ob),S(this.store.select(L)),_(([e,t])=>this.appService.remove2(`${jn}/${e.data.id}`,be({},t)).pipe(m(()=>ab({data:{id:e.data.id}})),h(s=>{let i=s?.message||"could not delete template";return d(T({message:i}),nb({error:i}))})))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Ci=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(ta({data:e.params.dashboardId})),this.store.dispatch(Ws()),this.actions$.pipe(c(bA,T),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var e0=$.endpoints.dashboards,hd=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e,t){let s={type:"default",id:e.params.dashboardId,endpoint:`${e0}/${e.params.dashboardId}`};return this.store.dispatch(kA()),this.actions$.pipe(c(wA),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var ud=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.select(Oe).pipe(z(),A(t=>t.isAuthenticated?(this.store.dispatch(Ws()),this.store.dispatch(ie({meta:{key:Ie}})),this.actions$.pipe(c(se,Se,x),z())):d(K())))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var xn=$.endpoints.folders,hT=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Ws),A(e=>this.appService.get(`${xn}`).pipe(m(t=>Xo(t)),h(t=>d(T({message:t.message}))))))),this.save$=p(()=>this.actions$.pipe(c(hA),S(this.store.select(FA)),m(([e,t])=>e.data?On({data:t}):Hs({data:t})),h(e=>d(T({message:e.message}))))),this.add$=p(()=>this.actions$.pipe(c(uA),_(e=>{let t=typeof e.data=="string"?{name:e.data}:e.data;return this.appService.add(`${xn}`,t).pipe(m(s=>ea({data:s})),h(s=>d(T({message:s.message}))))}))),this.remove$=p(()=>this.actions$.pipe(c(SA),_(e=>this.appService.remove(`${xn}`,e.data).pipe(m(()=>Jr({id:e.data?.id})),h(t=>d(T({message:t.message}))))))),this.edit$=p(()=>this.actions$.pipe(c(gA),_(e=>this.appService.update(`${xn}`,e.data).pipe(m(()=>Qr({data:e.data})),h(t=>d(T({message:t.message}))))))),this.update$=p(()=>this.actions$.pipe(c(Qr,Jr),m(e=>ie({meta:{key:Ie}})),h(e=>d(T({message:e.message})))))}formatData(e){return{data:e,meta:{}}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Un=$.endpoints.dashboards,uT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.snackBar=l(we),this.fetch$=p(()=>this.actions$.pipe(c(IA),S(this.store.select(_e)),A(([e,t])=>{let s={data:{link:window.location.href,digests:t.meta.digests?t.meta.digests:[],timezone:t.meta.timezone}};return d(Bp(s))}))),this.fetchSuccess$=p(()=>this.actions$.pipe(c(Bp),m(e=>Kp()))),this.fetchUsers$=p(()=>this.actions$.pipe(c(Kp),A(e=>{let t={page:0,size:50,sort:"createdAtSince",order:"desc"},s=$.endpoints.users;return this.appService.get(`${s}`,t).pipe(m(i=>$A({data:i.data})),h(i=>d(T({message:i.message}))))}))),this.add$=p(()=>this.actions$.pipe(c(TA),S(this.store.select(sa),this.store.select(_e)),_(([e,t,s])=>{let i=y(f({},e.data),{status:"active",timezone:t.timezone,dashboardId:s.id});return this.appService.add(`${Un}/digest/create`,i).pipe(m(a=>qp({data:a})),h(a=>d(T({message:a.message}))))}))),this.update$=p(()=>this.actions$.pipe(c(EA),S(this.store.select(sa),this.store.select(_e)),_(([e,t,s])=>{let i=y(f({},e.data),{timezone:t.timezone,dashboardId:s.id});return this.appService.update(`${Un}/digest`,i).pipe(m(a=>Wp({data:i})),h(a=>d(T({message:a.message}))))}))),this.remove$=p(()=>this.actions$.pipe(c(MA),S(this.store.select(_e)),_(([e,t])=>{let s={dashboardId:t.id};return this.appService.remove2(`${Un}/digest/${e.data}`,s).pipe(m(i=>Hp({data:e.data})),h(i=>d(T({message:i.message}))))}))),this.updateDashboard$=p(()=>this.actions$.pipe(c(qp,Wp,Hp),S(this.store.select(sa)),m(([e,t])=>{let s=t.digests.map(n=>{var u=n,{dashboardId:i}=u,a=qi(u,["dashboardId"]);return a});return vA({data:s})}))),this.sendTest$=p(()=>this.actions$.pipe(c(DA),S(this.store.select(_e)),_(([e,t])=>{setTimeout(()=>this.snackBar.open("Your test email will be sent shortly","",{duration:2500}),0);let s=y(f({},e.data),{dashboardId:t.id});return this.appService.add(`${Un}/digest/send`,s).pipe(m(i=>RA()),h(i=>d(T({message:i.message}))))})))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var gT=$.endpoints.goal,ST=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(fb),A(e=>this.appService.get(`${gT}/templates`).pipe(m(t=>hb({data:t})),h(t=>d(T({message:t.message}))))))),this.save$=p(()=>this.actions$.pipe(c(va),S(this.store.select(L)),_(([e,t])=>this.appService.add(`${gT}/templates`,e.data).pipe(m(s=>ub({data:s})),h(s=>d(T({message:s.message})))))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var AT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(gb),S(this.store.select(Zs)),A(([e,t])=>this.appService.get("metrics-catalog?shape=grouped&surface=report",{all:!0}).pipe(m(s=>Sb({data:this.formatData(s,t)})),h(s=>d(T({message:s.message}))))))),this.add$=p(()=>this.actions$.pipe(c(yb),m(()=>bm()))),this.save$=p(()=>this.actions$.pipe(c(bm),S(this.store.select(Pb)),N(([e,t])=>[ka({data:t}),Ab()])))}formatData(e,t){let s={state:e,selected:[]},i,a=[];return t.map(n=>{e.map(u=>{i=u.metrics.filter(g=>g.id===n.id),i.length!==0&&a.push(y(f({},n),{itemMap:i[0].itemMap}))})}),s=y(f({},s),{selected:a}),s}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var F2=$.endpoints.goal,vT=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(bb),S(this.store.select(Zs),this.store.select(je)),A(([e,t,s])=>this.appService.get("metrics-catalog?shape=grouped&surface=report").pipe(m(i=>kb({data:this.formatData(i,t)})),h(i=>d(T({message:i.message}))))))),this.set$=p(()=>this.actions$.pipe(c(vb),m(e=>ba({data:e.data.goals})))),this.updateState$=p(()=>this.actions$.pipe(c(Ib,Eb,Tb,ba,$m),m(e=>wb()))),this.updateSelected$=p(()=>this.actions$.pipe(c(ba),m(e=>$b({data:e.data})))),this.updateSelectedFromMore$=p(()=>this.actions$.pipe(c(ka),S(this.store.select(Zs)),m(([e,t])=>{let s=t;return e.data&&(s=e.data),$m({data:s})}))),this.save$=p(()=>this.actions$.pipe(c(Mb),m(e=>km({data:{goalSetIndex:e.data.goalSetIndex,isNew:e.data.isNew,isTemplate:e.data.isTemplate}})))),this.saveSuccess$=p(()=>this.actions$.pipe(c(km),S(this.store.select(Cb),this.store.select(Zs)),N(([e,t,s])=>{let i={type:"goalSet",prop:{data:{name:t,goals:s},index:e.data.goalSetIndex}};if(e.data.isNew){let a=[Hu({data:i}),wm()];return e.data.isTemplate&&(a=[...a,va({data:{name:t,goals:s}})]),a}else return[Do({data:i}),wm()]})))}formatData(e,t){return{state:e.map(i=>i.id==="overview"?y(f({},i),{metrics:i.metrics.map(a=>f({},a))}):y(f({},i),{metrics:i.metrics.map(a=>f({sourceName:i.name},a))})),selected:t}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var bT=$.endpoints.campaigns,r0=$.endpoints.groups,kT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(zs),S(this.store.select(L)),A(([e,t])=>{let s=this.setParam(e.data,t.id);return this.appService.get(`${bT}`,s).pipe(m(i=>e.data.total===0?Fy(this.formatData(i)):Ny(this.formatData(i))),h(i=>d(T({message:i.message}))))}))),this.search$=p(()=>this.actions$.pipe(c(Uy),S(this.store.select(L)),A(([e,t])=>{if(!e.data)return d(zs({data:{total:0}}));let s=this.setParam({total:0},t.id,e.data);return this.appService.search(bT,s).pipe(m(i=>Gy(this.formatData(i))),h(()=>d(T({message:"could not search!"}))))}))),this.restoreSearch$=p(()=>this.actions$.pipe(c(zy),m(e=>zs({data:{total:0}})))),this.save$=p(()=>this.actions$.pipe(c(xy),S(this.store.select(Ye),this.store.select(jp)),A(([e,t,s])=>{let i={campaignIds:s.map(a=>a.id),overwrite:!0};return t&&t.id?this.appService.update2(`${r0}/${t.id}`,i).pipe(m(a=>Hr()),h(a=>d(Ky({message:a.message})))):d(qy({data:s}))}))),this.saveSuccess$=p(()=>this.actions$.pipe(c(Hr),S(this.store.select(Ye),this.store.select(jp)),N(([e,t,s])=>[Ks({data:t}),qs()]),h(e=>d(Bs({message:e.message}))))),this.updateCampaign$=p(()=>this.actions$.pipe(c(Oy),S(this.store.select(Ye)),m(([e,t])=>xr({data:[t]}))))}setParam(e,t,s){let n={page:Math.floor(e.total/200),size:200,sort:"createdAtSince",order:"desc",isArchived:"is|0",workspaceId:t};return e.searchString&&(n=y(f({},n),{searchString:e.searchString})),s&&(n=y(f({},n),{searchString:s})),n}formatData(e){return{data:e.data,meta:{total:e.meta.total}}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var i0=$.endpoints.groups,wT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.snackBar=l(we),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Ks),S(this.store.select(L)),A(([e,t])=>this.appService.get(`${i0}/${e.data.id}`).pipe(m(s=>By(this.formatData(s,t))),h(s=>d(Bs({message:s.message}))))))),this.success$=p(()=>this.actions$.pipe(c(qs),X(e=>{setTimeout(()=>this.snackBar.open("Campaign group is updated successfully","Ok",{duration:1500,horizontalPosition:"right",panelClass:["success-snackbar"]}),0)})),{dispatch:!1})}formatData(e,t){let s=e;return e.campaigns&&e.campaigns.length!==0?s=y(f({},s),{campaigns:e.campaigns.map(i=>Mi(i,t)),reports:e.meta&&e.meta.reports&&e.meta.reports.length!==0?e.meta.reports:null}):s=y(f({},s),{campaigns:[]}),{data:s}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var gd=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(ie({meta:{key:$e}})),this.actions$.pipe(c(se,Se,x),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var o0=$.endpoints.users,a0=$.endpoints.creators,Gn=$.localStorage.invite,$T=(()=>{class r{constructor(){this.actions$=l(w),this.appService=l(E),this.router=l(me),this.add$=p(()=>this.actions$.pipe(c(Lb),A(e=>this.appService.add(o0,e.data).pipe(m(t=>Im({data:t.data})),h(t=>d(Em({message:t.message}))))))),this.addCreator$=p(()=>this.actions$.pipe(c(_b),A(e=>this.appService.update2(`${a0}/invites/${e.data.inviteId}`,e.data).pipe(m(t=>{let s=localStorage.getItem(Gn),i=JSON.parse(s),a=y(f({},i),{hostWorkspaceIcon:t.hostWorkspaceIcon});return localStorage.setItem(Gn,JSON.stringify(a)),Tm()}),h(t=>d(Em({message:t.message}))))))),this.redirect$=p(()=>this.actions$.pipe(c(Tm),X(e=>{this.router.navigate(["/welcome"])})),{dispatch:!1}),this.redirect2$=p(()=>this.actions$.pipe(c(Im),m(e=>{let t=localStorage.getItem(Gn),s=JSON.parse(t),i={};e.data.redirect.indexOf("subscribe")!==-1&&(i={queryParams:{wsId:s.workspaceId}}),localStorage.removeItem(Gn),this.router.navigate([e.data.redirect],i)})),{dispatch:!1})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var n0=$.localStorage.invite,Sd=(()=>{class r{constructor(){this.router=l(me)}canActivate(e,t){return localStorage.getItem(n0)?!0:this.router.createUrlTree(["/"])}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var c0=He({source:"Optimize List API",events:{"Pre Fetch":Pe(),"Fetch Success":Pe(),Bypass:Pe()}}),{preFetch:$t,fetchSuccess:IT,bypass:TT}=c0;var m0=[{id:"name",name:"Page",template:"link",disabled:!0},{id:"platform",name:"Platform"},{id:"lastPostAt",name:"Last post"}],ET=(()=>{class r{constructor(){this.actions$=l(w),this.store=l(I),this.mockService=l(Ia),this.appService=l(E),this.groupStorage=l(Ta),this.preFetch$=p(()=>this.actions$.pipe(c($t),S(this.store.select(L)),A(([,e])=>this.appService.get("sources",{workspaceId:e?.id,size:500}).pipe(m(t=>t?.data??[]),h(()=>d([])),N(t=>{let s=e?.slug??"",i=this.groupStorage.load(s),a=this.buildTabsFromSources(t,i),n=this.buildRowsFromSources(t);return[xt({workspaceSlug:s,groups:i}),br({data:a}),uh({data:!0}),se({data:n,meta:{key:er,columns:m0,ctas:void 0,total:n.length,page:0,size:50,sizeOptions:[10,20,50,100],sort:"lastPostAt",order:"desc"}}),IT()]}))))),this.PLATFORM_SECTIONS=[{label:"Facebook",platformKey:"facebook",resolve:e=>this.matchByNetworkId(e,/facebook|^fb$/i)},{label:"Instagram",platformKey:"instagram",resolve:e=>this.matchByNetworkId(e,/instagram|^ig$/i)},{label:"Articles",platformKey:"article",resolve:e=>this.matchArticles(e)}],this.ARTICLE_NOISE_RX=/momently content crawler|content crawler|advance crawlers?|google analytics|analytics|momently|crawler|ga4/gi}isActive(e){return!(!e||e.active===!1||typeof e.status=="string"&&e.status.toLowerCase()!=="active")}matchByNetworkId(e,t){return(e??[]).filter(s=>this.isActive(s)&&t.test(String(s.networkId??s.network??s.type??s.platform??""))).map(s=>({id:s.id??s._id??s.name,name:s.name}))}cleanArticleName(e){return String(e??"").replace(this.ARTICLE_NOISE_RX," ").replace(/[-|:·_/]+/g," ").replace(/\s+/g," ").trim()}cleanArticleKey(e){return this.cleanArticleName(e).toLowerCase()}matchArticles(e){return(e??[]).filter(t=>this.isActive(t)&&/^ga4$/i.test(String(t.networkId??t.network??t.type??t.platform??""))).map(t=>{let s=this.cleanArticleName(t.name)||t.name;return{id:t.id??t._id??t.name,name:s}}).sort((t,s)=>t.name.localeCompare(s.name))}buildTabsFromSources(e,t){let s=[{display:"Overview",path:"optimize"}];for(let i of this.PLATFORM_SECTIONS){let a=i.resolve(e);if(!a.length)continue;let n=a.map(v=>({display:v.name,path:`optimize/${v.id}`,id:v.id,isEditable:!1})),u=t.filter(v=>v.platform===i.platformKey).map(v=>({display:v.name,path:`optimize/${v.id}`,id:v.id,isGroup:!0,isEditable:!0})),g=[...n,...u].sort((v,b)=>
319String(v.display).localeCompare(String(b.display)));a.length>=2&&g.push({display:"Add group",path:"",id:`add-group:${i.platformKey}`,isAddGroup:!0,platform:i.platformKey,isEditable:!1}),s.push({display:{name:i.label},tabs:g})}return s}buildRowsFromSources(e){let t=[],s=new Map;for(let i of e??[]){let a=i.id??i._id??i.name;a&&s.set(String(a),i)}for(let i of this.PLATFORM_SECTIONS)for(let a of i.resolve(e)){let n=s.get(String(a.id));t.push({id:a.id,name:a.name,platform:i.label,platformKey:i.platformKey,lastPostAt:n?.lastPostAt??n?.updatedAtSince??"\u2014"})}return t}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var zn=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(){return this.store.dispatch($t()),kf(this.actions$.pipe(c(se),We(e=>e.meta.key===er),z()),this.actions$.pipe(c(TT),z()))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();function MT(r){if(!r?.begin||!r?.end)return 30;let o=new Date(r.end).getTime()-new Date(r.begin).getTime(),e=Math.round(o/864e5);return e>0?e:30}function DT(r){return r?.begin&&r?.end?{begin:r.begin,end:r.end}:null}var RT=(()=>{class r{constructor(){this.actions$=l(w),this.store=l(I),this.mockService=l(Ia),this.loadPage$=p(()=>this.actions$.pipe(c(xb),S(this.store.select($a)),A(([e,t])=>this.mockService.analyzeWall({pageId:e.data.pageId,window:MT(t.dateRange),dateRange:DT(t.dateRange),goal:"engagement_rate"},e.data.platformKey).pipe(m(s=>Mm({data:s})),h(s=>d(Xs({message:s?.message??"Failed to load wall"}))))))),this.refetchWall$=p(()=>this.actions$.pipe(c(Ub,Gb,zb,Kb),S(this.store.select($a)),A(([,e])=>e.pageId?this.mockService.analyzeWall({pageId:e.pageId,window:MT(e.dateRange),dateRange:DT(e.dateRange),topicFilter:e.topicFilter,goal:e.goal},e.platformKey??void 0).pipe(m(t=>Mm({data:t})),h(t=>d(Xs({message:t?.message??"Failed to load wall"})))):d(Xs({message:"No page selected"}))))),this.analyzeDraft$=p(()=>this.actions$.pipe(c(Bb),A(e=>this.mockService.analyzeDraft(e.data).pipe(m(t=>qb({data:t})),h(t=>d(Xs({message:t?.message??"Analyze failed"}))))))),this.sendChat$=p(()=>this.actions$.pipe(c(Wb),S(this.store.select($a)),A(([e,t])=>{let s=t.chatMessages.filter(i=>i.role==="user").length;return this.mockService.sendChatMessage(e.data.content,s).pipe(m(i=>Hb({data:i})),h(i=>d(Xs({message:i?.message??"Chat failed"}))))})))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var CT=(()=>{class r{constructor(){this.actions$=l(w),this.store=l(I),this.storage=l(ak),this.loadFromStorage$=p(()=>this.actions$.pipe(c(Vb),m(e=>Qb({pageId:e.pageId,entries:this.storage.load(e.pageId)})))),this.persist$=p(()=>this.actions$.pipe(c(Jb,Yb,Zb),S(this.store.select(ok)),X(([e,t])=>{let s="entry"in e?e.entry.pageId:e.pageId,i=t.entriesByPage[s]??[];this.storage.save(s,i)})),{dispatch:!1})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var PT=(()=>{class r{constructor(){this.actions$=l(w),this.store=l(I),this.storage=l(Ta),this.loadGroups$=p(()=>this.actions$.pipe(c(Xb),m(({workspaceSlug:e})=>{let t=this.storage.load(e);return xt({workspaceSlug:e,groups:t})}))),this.createGroup$=p(()=>this.actions$.pipe(c(ek),S(this.store.select(si)),A(([{workspaceSlug:e,input:t},s])=>{let i=s?.byWorkspace?.[e]??[],a=i.reduce((g,v)=>Math.max(g,v.sortIndex),-1),n={id:t.id??`grp_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`,name:t.name,platform:t.platform,accountIds:t.accountIds,sortIndex:a+1,createdAt:new Date().toISOString()},u=[...i,n];return this.storage.save(e,u),d(xt({workspaceSlug:e,groups:u}),$t())}))),this.updateGroup$=p(()=>this.actions$.pipe(c(tk),S(this.store.select(si)),A(([{workspaceSlug:e,input:t},s])=>{let a=(s?.byWorkspace?.[e]??[]).map(n=>n.id===t.id?f(f(f(f({},n),t.name!==void 0?{name:t.name}:{}),t.accountIds!==void 0?{accountIds:t.accountIds}:{}),t.sortIndex!==void 0?{sortIndex:t.sortIndex}:{}):n);return this.storage.save(e,a),d(xt({workspaceSlug:e,groups:a}
319),$t())}))),this.deleteGroup$=p(()=>this.actions$.pipe(c(sk),S(this.store.select(si)),A(([{workspaceSlug:e,id:t},s])=>{let a=(s?.byWorkspace?.[e]??[]).filter(n=>n.id!==t);return this.storage.save(e,a),d(xt({workspaceSlug:e,groups:a}),$t())}))),this.reorderGroups$=p(()=>this.actions$.pipe(c(rk),S(this.store.select(si)),A(([{workspaceSlug:e,orderedIds:t},s])=>{let a=(s?.byWorkspace?.[e]??[]).map(n=>{let u=t.indexOf(n.id);return y(f({},n),{sortIndex:u>=0?u:n.sortIndex})});return this.storage.save(e,a),d(xt({workspaceSlug:e,groups:a}),$t())})))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var kU=$.endpoints.links,wU=$.api,LT=(()=>{class r{constructor(){this.actions$=l(w),this.fetch$=p(()=>this.actions$.pipe(c(Fb),m(()=>{let e={title:"link title",labels:["tag","another tag"],url:"https://www.cnn.com/2022/06/30/politics/florida-abortion-law/index.html?utm_source=newsletter&utm_medium=email&utm_campaign=sprint_sale"};return Nb(this.formatData(e))}),h(e=>d(Ob({message:e.message})))))}formatData(e){return{data:e}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Ad=(()=>{class r{constructor(){this.store=l(I)}resolve(e){return this.store.dispatch(ie({meta:{key:wa}})),d(!0)}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var d0=$.baseUrl,_T=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(nk),S(this.store.select(U)),m(([e,t])=>t.queryParams.hasOwnProperty("error")?Cm({message:"Something went wrong!"}):Dm()))),this.pollSuccess$=p(()=>this.actions$.pipe(c(Rm),X(e=>{window.location.replace(`${d0}${e.data}`)})),{dispatch:!1}),this.maxPollingMs=6e4,this.pollingIntervalMs=1500,this.poll$=p(()=>this.actions$.pipe(c(Dm),S(this.store.select(U)),A(([e,t])=>Wt(0,this.pollingIntervalMs).pipe(As(Wt(this.maxPollingMs)),m(()=>e),V(s=>this.appService.get(`${t.params.channelId}/auth/status`).pipe(m(a=>{if(a.done){let n=a.redirectTo?a.redirectTo:"";return Rm({data:n})}return ck({data:a})}),h(a=>d(Cm({message:"poll error"})))))))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var FT=$.endpoints.media,vd=(()=>{class r{constructor(){this.actions$=l(w),this.appService=l(E),this.http=l(Gf),this.add$=p(()=>this.actions$.pipe(c(Cg),A(e=>{let t={url:e.data.url,type:e.data.type};return this.appService.post(`${FT}/trigger-crawl`,t).pipe(m(s=>mp({data:e.data.url})),h(s=>d(T({message:s.message}))))}))),this.poll$=p(()=>this.actions$.pipe(c(mp),A(e=>{let t=new hf(""),s=this.http.post(`${$.api}${FT}/check-crawl-status`,{url:e.data}),i=d("").pipe(hc(1500),X(n=>t.next("")),Vi(1)),a=bf(s,i);return t.pipe(V(n=>a),m(n=>n.done?(t.complete(),xo()):Lg({data:n.status})),h(n=>(t.complete(),d(lp({message:n.message})))))}))),this.pollSuccess$=p(()=>this.actions$.pipe(c(xo),hc(1e3),m(()=>Pg()))),this.stop$=p(()=>this.actions$.pipe(c(_g),N(()=>[xo(),lp({message:"crawling process is terminated!"})])))}formatData(e){return e}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Li=$.endpoints.media,bd=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.beforeFetch$=p(()=>this.actions$.pipe(c(Fg),N(e=>{let t={filterType:e.data.type},s={type:e.data.type,total:0},i;return e.data.type==="gam"&&(i={chips:[{info:{id:"isArchived",name:"Is Archived",type:Io.Radio,operator:"is"},selected:[{id:0,name:"False"}]}],params:{isArchived:"is|0"}}),e.data.filter&&(i=e.data.filter),(e.data.type==="gam"||e.data.filter)&&(t=y(f({},t),{chips:i.chips}),s=y(f({},s),{filter:i})),[Ds({data:y(f({},t),{data:[]}),meta:{key:Le}}),dp({data:s})]}))),this.fetch$=p(()=>this.actions$.pipe(c(dp),S(this.store.select(Fs),this.store.select(js),this.store.select(ht),this.store.select(xs),this.store.select(zo),this.store.select(Re({key:Le})),this.store.select(_t),this.store.select(Ns),this.store.select(Ft),this.store.select(Os)),A(([e,t,s,i,a,n,u,g,v,b,M])=>{let C={size:200,page:Math.floor(e.data.total/200)},F=e.data.type,j="createdAt",q=localStorage.getItem(pS(e.data.type));q&&(j=q);let J=f({mediaType:F,sort:j},C);return e.data.total===0&&(u=null,e.data.filter&&(J=f(f({},J),e.data.filter.params))),this.appService.get(Li,this.addAllowedConnectionIds(this.addParam(J,s,i,a,n,u,g,v,b),M)).pipe(N(O=>{let re=[];Object.keys(O.meta.filter).map(Z=>{re.push({id:Z,name:O.meta.filter[Z].info.name})});let Y;return Y={filterType:e.data.type,data:re,chips:u&&u.chips?u.chips:[]},e.data.filter&&e.data.total===0&&(Y=y(f({},Y),{chips:e.data.filter.chips})),[Og(this.formatMedia(t,O,C,j,F,s,a)),Ms({data:Y,meta:{key:Le}}),io({data:O.meta,meta:{key:Le}})]}),h(O=>d(_s({message:O.message}))))}))),this.update$=p(()=>this.actions$.pipe(c(jg,xg),S(this.store.select(Fs),this.store.select(js),this.store.select(ht),this.store.select(xs),this.store.select(zo),this.store.select(Re({key:Le})),this.store.select(_t),this.store.select(Ns),this.store.select(Ft),this.store.select(Os)),A(([e,t,s,i,a,n,u,g,v,b,M])=>{let P=t.sort,D=u.filterType,C={page:0,mediaType:D,sort:P};return this.appService.get(Li,this.addAllowedConnectionIds(this.addParam2(C,s,i,a,n,u,g,v,b),M)).pipe(m(F=>fp(this.formatMedia(t,F,hr,P,D))),h(F=>d(_s({message:F.message}))))}))),this.filter$=p(()=>this.actions$.pipe(c(Uo),S(this.store.select(Fs),this.store.select(js),this.store.select(ht),this.store.select(xs),this.store.select(zo),this.store.select(Re({key:Le})),this.store.select(_t),this.store.select(Ns),this.store.select(Ft),this.store.select(Os)),A(([e,t,s,i,a,n,u,g,v,b,M])=>{let P=t.sort,D=u.filterType,C={page:0,mediaType:D,sort:P};return this.appService.get(Li,this.addAllowedConnectionIds(this.addParam2(C,s,i,a,n,u,g,v,b),M)).pipe(m(F=>fp(this.formatMedia(t,F,hr,P,D))),h(F=>d(_s({message:F.message}))))}))),this.search$=p(()=>this.actions$.pipe(c(qg),S(this.store.select(Fs),this.store.select(js),this.store.select(ht),this.store.select(xs),this.store.select(Re({key:Le})),this.store.select(_t),this.store.select(Ns),this.store.select(Ft),this.store.select(Os)),A(([e,t,s,i,a,n,u,g,v,b])=>{let M=t.sort,P=e.data.type,D=e.data.queryString.trim();if(!D)return d(hp({data:e.data.type}));let C={page:0,sort:M};return this.appService.search(Li,this.addAllowedConnectionIds(this.addParam2(C,s,i,a,D,n,u,g,v),b),e.data.type,!0).pipe(m(F=>Wg(this.formatMedia(t,F,hr,M,P))),h(()=>
319d(_s({message:"could not search!"}))))}))),this.restoreSearch$=p(()=>this.actions$.pipe(c(hp),S(this.store.select(Fs),this.store.select(js),this.store.select(ht),this.store.select(xs),this.store.select(Re({key:Le})),this.store.select(_t),this.store.select(Ns),this.store.select(Ft),this.store.select(Os)),A(([e,t,s,i,a,n,u,g,v,b])=>{let M=t.sort,P=e.data,D={page:0,sort:M},C=this.addParam2(D,s,i,a,null,n,u,g,v);return C=this.addAllowedConnectionIds(y(f({},C),{mediaType:P}),b),this.appService.get(Li,C).pipe(m(F=>Hg(this.formatMedia(t,F,hr,M,P))),h(F=>d(_s({message:F.message}))))}))),this.updateMedia$=p(()=>this.actions$.pipe(c(Kg,Bg),S(this.store.select(Go)),m(([e,t])=>Ug({data:{type:"media",prop:{[e.group]:t[e.group]}}}))))}addParam(e,t,s,i,a,n,u,g,v){return t&&t.length!==0&&(e=y(f({},e),{fromDate:t[0].fromDate,toDate:t[0].toDate})),n&&n.chips.length!==0&&(e=this.addFilterParam(e,n)),i&&(e=this.addMediaParam(e,s)),u&&u.length!==0&&(e=this.addCreatorsParam(e,u)),g&&g.length!==0&&(e=this.addSourcesParam(e,g)),v&&v.sources&&v.sources.length!==0&&(e=this.addSourcesParam(e,v.sources)),v&&v.state&&v.state.id&&(e=this.addCreatorsParam(e,[v.state])),e=this.addSearchParam(e,a),e}addParam2(e,t,s,i,a,n,u,g,v){let b=f({},e);return this.addParam(b,t,s,i,a,n,u,g,v)}addSourcesParam(e,t){return y(f({},e),{connectionId:t.map(s=>s.networkId+"_"+s.connectionId).join(", ")})}addAllowedConnectionIds(e,t){if(!t||t.length===0)return e;let s=typeof e.connectionId=="string"?e.connectionId.split(",").map(a=>a.trim()).filter(Boolean):null,i=s?s.filter(a=>t.includes(a)):t;return y(f({},e),{connectionId:i.join(", ")})}addCreatorsParam(e,t){return y(f({},e),{creators:t.map(s=>s.creatorWorkspaceId).join(",")})}addFilterParam(e,t){for(let s of t.chips){let i=s.selected.map(a=>a.id?a.id:a.name).join(",");e=y(f({},e),{[s.info.id]:s.info.operator+"|"+i})}return e}addSearchParam(e,t){return t&&(e=y(f({},e),{searchString:t})),e}addMediaParam(e,t){if(t){let s=[];for(let i in t)t.hasOwnProperty(i)&&t[i].map(a=>{s.push(a.id)});e=y(f({},e),{mediaIds:s.join()})}return e}formatMedia(e,t,s,i,a,n,u){return{data:t.data,meta:y(f({},s),{filter:t.meta.filter,total:t.meta.total,date:n||(t.meta.date?t.meta.date:null),minDate:t.meta.minDate,isRelated:u||!1,sort:i,sortOptions:t.meta.sortOptions})}}getSortOptions(e){let t=[{id:"createdAt",display:"Created at"},{id:"modifiedAt",display:"Modified at"}];return e==="gam"?[...t,{id:"startDate",display:"Start date"}]:t}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var f0=$.endpoints.media,h0={inst:"instagram",fb:"facebook"},u0={fb:{link:"posts",photo:"posts",album:"posts",reels:"posts",video:"videos"},inst:{image:"photos",carousel_album:"photos",story:"stories",video:"videos"}},kd=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetchTypes$=p(()=>this.actions$.pipe(c(sS),S(this.store.select(L)),A(([e,t])=>this.appService.get(`${f0}/facets`,{type:"type",mediaType:e.data,workspaceId:t.id}).pipe(N(s=>{let i=s.data.map(a=>a.name);return[rS({data:i}),Ap({data:{type:i[0],mediaType:e.data}})]}),h(s=>d(T({message:s.message}))))))),this.fetchMetrics$=p(()=>this.actions$.pipe(c(Ap),S(this.store.select(L)),A(([e,t])=>this.appService.get("metrics-catalog?shape=sections&surface=report",{type:`${h0[e.data.mediaType]||e.data.mediaType}_${u0[e.data.mediaType][e.data.type]||e.data.type}`,entity:"metrics",workspaceId:t.id}).pipe(m(s=>iS({data:s})),h(s=>d(T({message:s.message})))))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var g0=$.endpoints.media,wd=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(oS),S(this.store.select(_t),this.store.select(Ft)),A(([e,t,s])=>{let i={};return t&&t.length!==0&&(i=this.addCreatorsParam(i,t)),s&&(i=this.addCreatorsParam(i,[s])),this.appService.post(`${g0}/related`,{mediaIds:e.data},i).pipe(m(a=>aS(a)),h(a=>d(nS({message:a.message}))))})))}addCreatorsParam(e,t){return y(f({},e),{creators:t.map(s=>s.creatorWorkspaceId).join(", ")})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var $d=$.endpoints["custom-metrics"],OT=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.set$=p(()=>this.actions$.pipe(c(Pv),m(e=>Lv({data:e.data})),h(e=>d(T({message:e.message}))))),this.fetch$=p(()=>this.actions$.pipe(c(_v),A(e=>e.data.metric.id?this.appService.post(`${$d}/get-value`,{metricId:e.data.metric.id,dimensionId:e.data.dimension.id}).pipe(m(t=>hm({data:t})),h(t=>d(T({message:t.message})))):d(fm({data:e.data}))))),this.save$=p(()=>this.actions$.pipe(c(Nv),S(this.store.select(sr)),A(([e,t])=>this.appService.post(`${$d}/add-value`,this.getSavePayload(e.data)).pipe(m(s=>{let i=e.data.payload.dimension,a=[...t],n=t.findIndex(u=>u.id===i.id);return n!==-1?a[n]=i:a.push(i),gm({data:a})}),h(s=>d(T({message:s.message}))))))),this.remove$=p(()=>this.actions$.pipe(c(Ov),A(e=>this.appService.post(`${$d}/remove-value`,this.getRemovePayload(e.data)).pipe(m(t=>Sm({data:e.data.payload})),h(t=>d(T({message:t.message}))))))),this.fetchTemp$=p(()=>this.actions$.pipe(c(fm),S(this.store.select(Ea)),m(([e,t])=>{let s=t.data[e.data.dimension.id];return hm({data:s})}))),this.saveTemp$=p(()=>this.actions$.pipe(c(jv),S(this.store.select(sr)),N(([e,t])=>{let s=e.data.payload.dimension,i=[...t],a=t.findIndex(u=>u.id===s.id);a!==-1?i[a]=s:i.push(s);let n=this.getSavePayload(e.data);return[gm({data:i}),xv({data:{dimensionId:n.dimension.id,items:n.items}})]}))),this.removeTemp$=p(()=>this.actions$.pipe(c(Uv),m(e=>Sm({data:e.data.payload}))))}formatData(e){return e}getSavePayload(e){return f({metricId:e.metric.id,metricType:e.metric.type},e.payload)}getRemovePayload(e){return{metricId:e.metric.id,metricType:e.metric.type,dimensionId:e.payload.id}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Kn=$.endpoints["custom-metrics"],jT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.save$=p(()=>this.actions$.pipe(c(dk),S(this.store.select(sr),this.store.select(L)),A(([e,t,s])=>this.appService.update2("metrics-catalog/overrides",f({},e.data),{workspaceSlug:s.slug}).pipe(m(i=>tr()),h(i=>d(ri({message:i.message}))))))),this.addCustom$=p(()=>this.actions$.pipe(c(pk),S(this.store.select(sr)),A(([e,t])=>this.appService.add(`${Kn}`,f({},e.data)).pipe(m(s=>t&&t.length!==0?um({data:s,meta:t}):tr()),h(s=>d(ri({message:s.message}))))))),this.saveItems$=p(()=>this.actions$.pipe(c(um),S(this.store.select(Ea)),V(([e,t])=>ge(e.meta).pipe(V((s,i)=>this.appService.post(`${Kn}/add-value`,{metricId:e.data.metricId,metricType:e.data.metricType,dimension:s,items:t.data[s.id]}).pipe(N(a=>{let n=[Fv({data:s})];return i===e.meta.length-1&&n.push(tr()),n}),h(a=>d(T({message:a.message}))))))))),this.saveCustom$=p(()=>this.actions$.pipe(c(mk),S(this.store.select(L)),A(([e,t])=>this.appService.update2(`${Kn}/${e.data.id}`,f({},e.data.payload),{workspaceSlug:t.slug}).pipe(m(s=>tr()),h(s=>d(ri({message:s.message}))))))),this.deleteCustom$=p(()=>this.actions$.pipe(c(lk),A(e=>this.appService.remove2(`${Kn}/${e.data}`).pipe(m(t=>tr()),h(t=>d(ri({message:t.message})))))))}formatData(e){return e}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var xT=(()=>{class r{constructor(){this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(fk),A(e=>this.appService.get("metrics-catalog?shape=grouped&surface=all",{all:!0,calculated:!0}).pipe(m(t=>{let{sources:s,mediaTypes:i}=Us(t);return hk({data:{sources:s,mediaTypes:i}})}),h(t=>d(T({message:t.message})))))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var zT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.save$=p(()=>this.actions$.pipe(c(Ik),S(this.store.select(Da),this.store.select(Gm)),A(([e,t,s])=>{let a=s.connections.filter(n=>n.id===t[0].id).length===0;return d(Om({data:{connections:t,isUpdated:a}}))}))),this.saveSuccess$=p(()=>this.actions$.pipe(c(Om),m(()=>jm()))),this.addGA$=p(()=>this.actions$.pipe(c(jm),S(this.store.select(Gm)),_(([e,t])=>{let s={GASourceId:t.connections[0].id};return this.appService.post("sources/ceros-script",s).pipe(m(i=>Tk({data:i.script})),h(i=>d(xm({message:i.message}))))}))),this.fetchGdToken$=p(()=>this.actions$.pipe(c($k),A(e=>this.appService.get(e.data).pipe(m(t=>wk({data:t})),h(t=>d(xm({message:t.message})))))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var A0="shared-media",KT=$.endpoints.partners,Bn=$.endpoints[A0],v0=10,BT=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Vg),A(e=>this.appService.get(`${KT}/${e.data}`).pipe(m(t=>up({data:this.formatData2(t)})),h(t=>d(ts({message:t.message}))))))),this.fetchSuccess$=p(()=>this.actions$.pipe(c(up),N(e=>[gp(),Qg()]))),this.fetchReqMedia$=p(()=>this.actions$.pipe(c(gp),S(this.store.select(Fe)),A(([e,t])=>{let s={hostWorkspaceId:t.hostWorkspaceId,status:"is|pending",page:0,size:v0};return this.appService.get(`${Bn}`,s).pipe(m(i=>Jg({data:i.data,meta:i.meta})),h(i=>d(ts({message:i.message}))))}))),this.acceptReq$=p(()=>this.actions$.pipe(c(Yg),S(this.store.select(Fe)),_(([e,t])=>{let s={hostWorkspaceId:t.hostWorkspaceId,approvedIds:e.data.map(i=>i.id)};return this.appService.update2(`${Bn}/access`,s).pipe(m(i=>Sp({data:e.data})),h(i=>d(ts({message:i.message}))))}))),this.rejectReq$=p(()=>this.actions$.pipe(c(Zg),S(this.store.select(Fe)),_(([e,t])=>{let s={hostWorkspaceId:t.hostWorkspaceId,rejectedIds:e.data.map(i=>i.id)};return this.appService.update2(`${Bn}/access`,s).pipe(m(i=>Sp({data:e.data})),h(i=>d(ts({message:i.message}))))}))),this.updateMedia$=p(()=>this.actions$.pipe(c(tS),S(this.store.select(ht),this.store.select(Fe)),_(([e,t,s])=>{let i=[];for(let n of Object.keys(t))for(let u of t[n])i.push(u.id);let a={partnerId:s.id,mediaIds:i};return this.appService.add(`${Bn}`,a).pipe(m(()=>yp()),h(n=>d(ts({message:n.message}))))}))),this.updateMediaSuccess$=p(()=>this.actions$.pipe(c(yp),N(()=>[Pa({data:0}),Ls()]))),this.update$=p(()=>this.actions$.pipe(c(Xg),S(this.store.select(Fe),this.store.select(Fa),this.store.select(_a)),_(([e,t,s,i])=>{let a={access:s,connectionIds:i.map(n=>n.connectionId)};return this.appService.update2(`${KT}/${t.id}`,a).pipe(m(n=>eS()),h(n=>d(ts({message:n.message}))))})))}formatData(e){return e}formatData2(e){return e.meta?e:y(f({},e),{meta:{sources:[]}})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var b0=$.endpoints.sources,k0=$.endpoints.partners,qT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Yk),S(this.store.select(_a)),A(([e,t])=>this.appService.get(b0).pipe(m(s=>Zk({data:this.formatData(s.data,t)})),h(s=>d(Jm({message:s.message}))))))),this.update$=p(()=>this.actions$.pipe(c(Xk),S(this.store.select(Fe),this.store.select(Fa),this.store.select(ow)),A(([e,t,s,i])=>{let a={access:s,connectionIds:i.map(n=>n.connectionId)};return this.appService.update2(`${k0}/${t.id}`,a).pipe(m(n=>Qm({data:i})),h(n=>d(Jm({message:n.message}))))}))),this.updateSuccess$=p(()=>this.actions$.pipe(c(Qm),m(()=>ew())))}formatData(e,t){return{sources:e,selectedSources:t}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var w0=$.endpoints.partners,WT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetchSuccess$=p(()=>this.actions$.pipe(c(se),m(e=>e.meta.key===Gt?aw():K()))),this.remove$=p(()=>this.actions$.pipe(c(nw),S(this.store.select(Fe)),A(([e,t])=>this.appService.remove2(w0,{ids:t.id}).pipe(m(()=>ue({data:t,meta:{key:Gt}})),h(s=>d(x({message:s.message,meta:{key:Gt}})))))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Id=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(ie({meta:{key:Gt}})),this.actions$.pipe(c(se,Se,x),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var qn=$.endpoints["shared-media"],Td=40,$0=["is|approved","is|pending"],HT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(ni),S(this.store.select(Fe),this.store.select(rw),this.store.select(iw)),A(([e,t,s,i])=>this.appService.get(`${qn}`,this.setParams(t,s,e.data.total,i)).pipe(m(a=>qk(this.formatData(a,e.data.total))),h(a=>d(ci({message:a.message}))))))),this.acceptReq$=p(()=>this.actions$.pipe(c(Vk),S(this.store.select(Fe)),_(([e,t])=>{let s={approvedIds:e.data.map(i=>i.id)};return s=this.addPartnerId(s,t),this.appService.update2(`${qn}/access`,s).pipe(m(i=>La({data:e.data})),h(i=>d(ci({message:i.message}))))}))),this.rejectReq$=p(()=>this.actions$.pipe(c(Qk),S(this.store.select(Fe)),_(([e,t])=>{let s={rejectedIds:e.data.map(i=>i.id)};return s=this.addPartnerId(s,t),this.appService.update2(`${qn}/access`,s).pipe(m(i=>La({data:e.data})),h(i=>d(ci({message:i.message}))))}))),this.removeMedia$=p(()=>this.actions$.pipe(c(Jk),S(this.store.select(Fe),this.store.select(sw)),_(([e,t,s])=>{let i={ids:s.map(a=>a.id).join(" ,")};return i=this.addPartnerId(i,t),this.appService.remove2(`${qn}`,i).pipe(m(a=>La({data:s})),h(a=>d(ci({message:a.message}))))}))),this.changeTab$=p(()=>this.actions$.pipe(c(Pa),m(()=>Vm()))),this.changeTabSuccess$=p(()=>this.actions$.pipe(c(Vm),m(()=>ni({data:{total:0}})))),this.search$=p(()=>this.actions$.pipe(c(Wk),m(()=>ni({data:{total:0}})))),this.restoreSearch$=p(()=>this.actions$.pipe(c(Hk),m(()=>Hm()))),this.restoreSearchSuccess$=p(()=>this.actions$.pipe(c(Hm),m(()=>ni({data:{total:0}}))))}formatData(e,t){let s=t/Td;return{data:e.data,meta:y(f({},e.meta),{page:s})}}setParams(e,t,s,i){let a={status:$0[t],page:s/Td,size:Td};return e&&(a=y(f({}
319,a),{hostWorkspaceId:e.hostWorkspaceId})),i&&(a=y(f({},a),{searchString:i})),a}addPartnerId(e,t){return t&&(e=y(f({},e),{hostWorkspaceId:t.hostWorkspaceId})),e}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var I0=He({source:"Payment API",events:{Fetch:Pe(),"Fetch Success":de(),"Error Snackbar":de()}}),{fetch:Wn,fetchSuccess:Ed,errorSnackbar:VT}=I0;var Md=(()=>{class r{constructor(){this.store=l(I)}resolve(e){return this.store.dispatch(Wn()),d(!0)}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var T0=$.endpoints.goal,JT=(()=>{class r{constructor(){this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Lo),A(e=>{let t=e.data.goalSetIndex;return this.appService.get(`${T0}/${e.data.campaignId}`,{goalSetIndex:t}).pipe(m(s=>sg(this.formatData(s,t))),h(s=>d(ig({message:s.message}))))})))}formatData(e,t){return{data:{goalSetIndex:t,startDate:e.data.startDate,endDate:e.data.endDate,goals:e.data.goals,expected:e.data.expected},meta:e.meta}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var C0=$.endpoints.reports,P0=$.prdUrl,YT=$.endpoints.pdf,ZT=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.router=l(me),this.fetch$=p(()=>this.actions$.pipe(c(Ve),m(()=>lo({data:{}})))),this.notAuthenticated$=p(()=>this.actions$.pipe(c(fo),m(()=>Nc()))),this.fetch2$=p(()=>this.actions$.pipe(c(Nc),m(()=>lo({data:{preview:!0}})))),this.fetchCall$=p(()=>this.actions$.pipe(c(lo),S(this.store.select(st),this.store.select(U)),A(([e,t,s])=>this.appService.get(t.endpoint,this.getParams(s,e.data)).pipe(m(i=>mo({data:i})),h(()=>d(Qe())))))),this.unavailable$=p(()=>this.actions$.pipe(c(Qe),X(()=>{this.router.navigate(["/404"],{skipLocationChange:!0})})),{dispatch:!1}),this.updateDate$=p(()=>this.actions$.pipe(c(Uh),S(this.store.select(st),this.store.select(U)),A(([e,t,s])=>{let i=f({workspaceSlug:s?.params.workspaceId},e.data);return this.appService.get(t.endpoint,i).pipe(m(a=>mo({data:a})),h(a=>d(T({message:a.message}))))}))),this.fetchSuccessForward$=p(()=>this.actions$.pipe(c(mo),S(this.store.select(st)),m(([e,t])=>t.type==="group"?Na({data:e.data}):_o({data:e.data})))),this.updateSharedState$=p(()=>this.actions$.pipe(c(dt,bt),S(this.store.select(st)),m(([e,t])=>{let s=e.data,i={isEditable:s.isAuthenticated,workspace:s.workspace,client:s.client,date:s.date,cover:s.cover};return t.type==="group"?i=y(f({},i),{pdfCSVName:s.cover.heading}):i=y(f({},i),{pdfCSVName:s.campaign.name.toLowerCase().trim().replace(/&/g,"and").replace(/ /g,"-")}),xh({data:i})}))),this.updateSuccess$=p(()=>this.actions$.pipe(c(No,Ae,ft,Pt,Wo,Lt,Br,Zo,Jo,qr,Yo,Bo,pi,mi,li,ia,Er),S(this.store.select(st)),m(([e,t])=>t?Ve():K()))),this.hideLink$=p(()=>this.actions$.pipe(c(Kh),S(this.store.select(st),this.store.select(U)),A(([e,t,s])=>this.appService.update2(`reports/${t.id}/list-visibility`,{name:e.data.name,type:e.data.type}).pipe(m(i=>Er({data:e.data})),h(i=>d(T({message:"update error"}))))))),this.filter$=p(()=>this.actions$.pipe(c(ho),S(this.store.select(Re({key:vt}))),m(([e,t])=>{let s=t.chips;return s.length!==0&&s[0].selected.length!==0?Qo({data:t}):Vo({data:t})}))),this.fetchPdf$=p(()=>this.actions$.pipe(c(uo),S(this.store.select(st),this.store.select(U)),A(([e,t,s])=>this.appService.post(`${YT}`,this.getPayload(s,t)).pipe(m(i=>go({data:i.statusUrl})),h(i=>d(T({message:"download error"}))))))),this.pollSuccess$=p(()=>this.actions$.pipe(c(Oc),S(this.store.select($p)),m(([e,t])=>{window.location.replace(`${P0}${e.data.redirect}`)})),{dispatch:!1}),this.download$=p(()=>this.actions$.pipe(c(zh),S(this.store.select(st),this.store.select(U)),A(([e,t,s])=>{let i={responseType:"blob",headers:{Accept:"application/zip"}};return this.appService.post(`${C0}/csv`,this.getPayload(s,t),i).pipe(m(a=>jc({data:a})),h(()=>d(T({message:"download error"}))))}))),this.downloadSuccess$=p(()=>this.actions$.pipe(c(jc),S(this.store.select(vS)),m(([e,t])=>{let s=t.pdfCSVName,i=new Blob([e.data],{type:"application/zip"}),a=document.createElement("a"),n=URL.createObjectURL(i);a.href=n,a.download=`${s}
319.zip`,a.click(),URL.revokeObjectURL(n)})),{dispatch:!1}),this.pollingIntervalMs=1500,this.poll$=p(()=>this.actions$.pipe(c(Gh),S(this.store.select($p)),A(([e,t])=>Wt(0,this.pollingIntervalMs).pipe(m(()=>e),A(s=>this.appService.get(`${YT}/${t}`).pipe(m(i=>i.created?Oc({data:i}):K()),h(i=>d(T({message:"poll error"})))))))))}getParams(e,t){return e.queryParams&&(t=f(f({},t),e.queryParams)),y(f({},t),{workspaceSlug:e.params.workspaceId})}getPayload(e,t){let s={reportId:t.id,workspaceSlug:e.params.workspaceId};if(!Ko(e.queryParams)){let i=e.queryParams;s=y(f({},s),{dateRange:{begin:i.begin,end:i.end}})}return t.type==="group"&&(s=y(f({},s),{isGroup:!0})),s}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var L0=$.endpoints.media,XT=(()=>{class r{constructor(){this.actions$=l(w),this.appService=l(E),this.save$=p(()=>this.actions$.pipe(c(dS),A(e=>{let t=`${L0}/custom-metrics`;return this.appService.post(t,{metrics:e.data}).pipe(m(()=>Bo()),h(s=>d(fS({message:s.message}))))})))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var eE=$.endpoints.media,tE=(()=>{class r{constructor(){this.actions$=l(w),this.appService=l(E),this.snackBar=l(we),this.save$=p(()=>this.actions$.pipe(c(dw),A(e=>this.appService.post("images-cache",{items:[e.sourceUrl]}).pipe(A(t=>{let s=t?.urls?.[0];return s?this.appService.post(`${eE}/thumbnail`,{mediaId:e.mediaId,picture:s}).pipe(m(()=>fw({mediaId:e.mediaId,picture:s})),h(i=>d(rr({message:i.message})))):d(rr({message:"Could not process the image. Please try another file."}))}),h(t=>d(rr({message:t.message}))))))),this.remove$=p(()=>this.actions$.pipe(c(hw),A(e=>this.appService.post(`${eE}/thumbnail`,{mediaId:e.mediaId,restore:!0}).pipe(m(t=>uw({mediaId:e.mediaId,picture:t?.picture||""})),h(t=>d(rr({message:t.message}))))))),this.showError$=p(()=>this.actions$.pipe(c(rr),X(e=>this.snackBar.open(e.message,"Error",{duration:2500}))),{dispatch:!1})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Rd=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(no()),this.actions$.pipe(c(Ir,pt),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var m4=$.endpoints.reports,sE=(()=>{class r{constructor(){this.actions$=l(w),this.fetch$=p(()=>this.actions$.pipe(c(Na),m(e=>bt(this.formatData(e.data))))),this.loadingOff$=p(()=>this.actions$.pipe(c(bt,cw),m(()=>po({data:!1}))))}formatData(e){let t={data:{id:"m41p3oEBrnEmnBRz3Yw5",report:[{id:"overview",title:"Overview",date:"lifetime",items:[{type:"summary",items:[{type:"metrics",items:[{id:"overview/reads",name:"Engagement",value:"8,213",description:"Total number of page views that lasted more than 30 seconds"},{id:"ga/ga_avg_time_on_page",name:" Avg. Time on Page",value:"1m 48s",description:"The average time users spent viewing the page"},{id:"overview/impressions",name:"Impressions",value:"2,493,114",description:"The number of people in the targeted audience set who were served the native ad unit via O&O and syndication"}]},{type:"horizontalBars",items:[{type:"horizontalBar",title:"Device",items:[{name:"Mobile",value:41},{name:"Desktop",value:52},{name:"Tablet",value:3},{name:"Unknown",value:3}]},{type:"horizontalBar",title:"Gender",items:[{name:"Male",value:52},{name:"Female",value:48}]},{type:"pie-chart",title:"Age Demographic",items:[{name:"Below 18",value:4},{name:"18-24",value:8},{name:"25-34",value:20},{name:"35-44",value:21},{name:"45-54",value:16},{name:"55-64",value:13},{name:"65+",value:11},{name:"Unknown",value:8}]},{type:"list",title:"Top locations",items:[{name:"Connecticut",value:"462,729"},{name:"New York",value:"348,728"},{name:"Massachusetts",value:"340,234"},{name:"Delaware",value:"330,804"},{name:"Pennsylvania",value:"321,376"},{name:"New Jersey",value:"301,594"},{name:"(unknown)",value:"231,510"}]}]}]}]},{link:"sdfg.com",id:"campaign_1",title:"Campaign 1",date:"Sep 01, 2022 - Oct 01, 2022",media:{"crawler_Qd1HJ726R_KIH-4UUqEjsg_MYSANANTONIO":{id:"crawler_Qd1HJ726R_KIH-4UUqEjsg_MYSANANTONIO",title:"IT Sales Engineer Explains Blackout Backup for Local Businesses",message:"The energy grid is something most of us don\u2019t think about and few of us understand. However, terms like \u201Crolling blackou...",createdAt:"Aug 10, 1:56 pm",creatorName:"MYSANANTONIO",picture:"https://app.momently.com/image-cache/cr-crawler_kKCBV3OUBvaFT0IulccS4/Qd1HJ726R_KIH-4UUqEjsg",type:"interactive",metric:{Engagements:"0","Outbound Link Clicks":"3","Interactive
319Clicks":"0","Total Clicks":"3","Video Views":"0","Complete Video View":"0","Video Minutes Viewed":"0","Average Video View Time":"0s","Form Submits":"0",Impressions:"744,567",Clicks:"2,212","CTR (Click Through Rate)":"0.3%","Google Users":"2,165",Engagement:"2,244","Link Clicks":"3","Click-Through Rate":"0.13%","Google Unique Pageviews":"2,222","Avg. Time on Page":"3m 34s","Google Avg. Scroll":"50.5%","Google Entrances":"2,202","Google Entrances / Pageviews":"98.1%","Google Pages / Session":"1.02","Google Total Time":"8,774s","Google Exits":"2,203","Google % Exit":"98.2%","Google New Users":"222","Google Sessions":"2,205","Google Bounces":"2,164","Moat Page Views (unfiltered)":"2,269","Moat Page Views (filtered for GIVT)":"2,257","Moat Page Views":"2,235","Moat Valid Impressions":"2,235","Moat Valid Rate":"98.5%","Moat Total Session Time":"7631m 32s","Moat Avg Session Time":"3m 25s","Moat Avg Page Dwell Time":"52s","Moat Median Page Dwell Time":"52s","Moat Total Active Page Dwell Time":"1933m 36s","Moat Time Until Scroll":"1m 57s","Moat Scroll Velocity":"158","Moat Scroll Down Velocity":"130","Moat Scroll Up Velocity":"405","Moat Average Scroll Depth":"40.4%","Moat Median Scroll Depth":"41.8%","IVT Measurable Impressions":"2,269","Moat IVT Measurable Rate":"100%","Moat IVT Rate":"1.5%","Moat GIVT Rate":"0.53%","Moat SIVT Rate":"0.97%","Moat IVT Impressions":"34","Moat Automated Browser Rate":"0.44%","Moat Incongruous Browser Rate":"0%","Moat Data Center Traffic Rate":"0.57%","Moat Spider Rate":"0.04%","Moat Excessive Activity Rate":"0%","Moat Invalid Source Rate":"0%","Moat Invalid Proxy Rate":"0.84%","Moat Non-US Traffic Rate":"0.09%","Moat Outdated Browser Rate":"13.2%","Moat Late Night Rate":"11.6%","Moat Top of the Hour Rate":"27.6%"},noData:!1,link:"https://storystudio.mysanantonio.com/2022/08/it-sales-engineer-explains-blackout-backup-for-local-businesses"}},items:[{type:"summary",items:[{type:"metrics",items:[{id:"overview/reads",name:"Engagement",value:"8,213",description:"Total number of page views that lasted more than 30 seconds"},{id:"ga/ga_avg_time_on_page",name:" Avg. Time on Page",value:"1m 48s",description:"The average time users spent viewing the page"},{id:"overview/impressions",name:"Impressions",value:"2,493,114",description:"The number of people in the targeted audience set who were served the native ad unit via O&O and syndication"}]},{type:"goals",items:[{id:"impressions",name:"Impressions",progress:.55,value:1e6,target:1e6},{id:"engagement",name:"Engagement",progress:1.5,value:10300,target:1e6}]}]},{type:"detail",sort:1660157763e3,items:[{type:"media",mediaType:"Stories",metrics:["Engagement","Avg. Time on Page","Promotional Impressions","Impressions"],items:[{id:"crawler_Qd1HJ726R_KIH-4UUqEjsg_MYSANANTONIO",eyebrow:"SFG",title:"IT Sales Engineer Explains Blackout Backup for Local Businesses",subtitle:"The energy grid is something most of us don\u2019t think about and few of us understa...",pictures:["https://app.momently.com/image-cache/cr-crawler_kKCBV3OUBvaFT0IulccS4/Qd1HJ726R_KIH-4UUqEjsg"],items:[{type:"metrics2",items:[{id:"ga_pageview",name:"Engagement",value:"2,244"},{id:"ga_avg_time_on_page",name:"Avg. Time on Page",value:"3m 34s"},{id:"ga/promotions",name:"Impressions",value:"744,567"},{id:"adMedia/promotions",name:"Promotional Impressions",value:"744,567"}]}]},{id:"crawler_Qd1HJ726R_KIH-4UUqEjsg_MYSANANTONIO",eyebrow:"SFG",title:"IT Sales Engineer Explains Blackout Backup for Local Businesses",subtitle:"The energy grid is something most of us don\u2019t think about and few of us understa...",pictures:["https://app.momently.com/image-cache/cr-crawler_kKCBV3OUBvaFT0IulccS4/Qd1HJ726R_KIH-4UUqEjsg"],items:[{type:"metrics2",items:[{id:"ga_pageview",name:"Engagement",value:"2,244"},{id:"ga_avg_time_on_page",name:"Avg. Time on Page",value:"3m 34s"},{id:"ga/promotions",name:"Impressions",value:"744,567"},{id:"adMedia/promotions",name:"Promotional Impressions",value:"744,567"}]}]},{id:"crawler_Qd1HJ726R_KIH-4UUqEjsg_MYSANANTONIO",eyebrow:"SFG",title:"IT Sales Engineer Explains Blackout Backup for Local Businesses",subtitle:"The energy grid is something most of us don\u2019t think about and few of us understa...",pictures:["https://app.momently.com/image-cache/cr-crawler_kKCBV3OUBvaFT0IulccS4/Qd1HJ726R_KIH-4UUqEjsg"],items:[{type:"metrics2",items:[{id:"ga_pageview",name:"Engagement",value:"2,244"},{id:"ga_avg_time_on_page",name:"Avg. Time on Page",value:"3m 34s"},{id:"ga/promotions",name:"Impressions",value:"744,567"},{id:"adMedia/promotions",name:"Promotional Impressions",value:"744,567"}]}]},{id:"crawler_Qd1HJ726R_KIH-4UUqEjsg_MYSANANTONIO",eyebrow:"SFG",title:"IT Sales Engineer Explains Blackout Backup for Local Businesses",subtitle:"The energy grid is something most of us don\u2019t think about and few of us understa...",pictures:["https://app.momently.com/image-cache/cr-crawler_kKCBV3OUBvaFT0IulccS4/Qd1HJ726R_KIH-4UUqEjsg"],items:[{type:"metrics2",items:[{id:"ga_pageview",name:"Engagement",value:"2,244"},{id:"ga_avg_time_on_page",name:"Avg. Time on Page",value:"3m 34s"},{id:"ga/promotions",name:"Impressions",value:"744,567"},{id:"adMedia/promotions",name:"Promotional Impressions",value:"744,567"}]}]},{title:"Total (4 items)",items:[{type:"metrics2",items:[{id:"ga_pageview",name:"Engagement",value:"2,244"},{id:"ga_avg_time_on_page",name:"Avg. Time on Page",value:"3m 34s"},{id:"ga/promotions",name:"Impressions",value:"744,567"},{id:"adMedia/promotions",name:"Promotional Impressions",value:"744,567"}]}]}]},{type:"media",mediaType:"Facebook Posts",metrics:["Engagements","Comments","Reactions","Clicks","Shares","Reach","Paid Impressions 5","Impressions 2"],items:[{id:"fb_2161587157404924_3424650524431908",eyebrow:"Dished Seattle",title:"7 disc golf courses near Seattle for professionals and beginners alike",subtitle:"Let's frolf \u{1F94F}",pictures:["https://app.momently.com/image-cache/fb_2161587157404924/fb_2161587157404924_3424650524431908"],items:[{type:"metrics2",items:[{id:"engagements",name:"Engagements",value:"
3190"},{id:"comments",name:"Comments",value:"0"},{id:"reactions",name:"Reactions",value:"0"},{id:"clicks",name:"Clicks",value:"0"},{id:"shares",name:"Shares",value:"0"},{id:"impressionsUnique",name:"Reach",value:"5"},{id:"impressionsPaid",name:"Paid Impressions 5",value:"0"},{id:"impressions",name:"Impressions 2",value:"5"}]}]},{id:"fb_2161587157404924_3424649121098715",eyebrow:"Dished Seattle",title:"8 incredible food festivals are coming to Washington this August",subtitle:"Including an all-you-can-eat ice cream fest \u{1F366}",pictures:["https://app.momently.com/image-cache/fb_2161587157404924/fb_2161587157404924_3424649121098715"],items:[{type:"metrics2",items:[{id:"engagements",name:"Engagements",value:"1"},{id:"comments",name:"Comments",value:"0"},{id:"reactions",name:"Reactions",value:"0"},{id:"clicks",name:"Clicks",value:"1"},{id:"shares",name:"Shares",value:"0"},{id:"impressionsUnique",name:"Reach",value:"14"},{id:"impressionsPaid",name:"Paid Impressions 5",value:"0"},{id:"impressions",name:"Impressions 2",value:"14"}]}]},{id:"fb_2161587157404924_3424647327765561",eyebrow:"Dished Seattle",title:"7 places to mountain bike in and around Seattle this weekend",subtitle:"All you need is a bike, helmet, and a great attitude \u{1F6B5}\u200D\u2640\uFE0F",pictures:["https://app.momently.com/image-cache/fb_2161587157404924/fb_2161587157404924_3424647327765561"],items:[{type:"metrics2",items:[{id:"engagements",name:"Engagements",value:"0"},{id:"comments",name:"Comments",value:"0"},{id:"reactions",name:"Reactions",value:"0"},{id:"clicks",name:"Clicks",value:"0"},{id:"shares",name:"Shares",value:"0"},{id:"impressionsUnique",name:"Reach",value:"4"},{id:"impressionsPaid",name:"Paid Impressions 5",value:"0"},{id:"impressions",name:"Impressions 2",value:"4"}]}]},{title:"Total (3 items)",items:[{type:"metrics2",items:[{id:"engagements",name:"Engagements",value:"0"},{id:"comments",name:"Comments",value:"0"},{id:"reactions",name:"Reactions",value:"0"},{id:"clicks",name:"Clicks",value:"0"},{id:"shares",name:"Shares",value:"0"},{id:"impressionsUnique",name:"Reach",value:"4"},{id:"impressionsPaid",name:"Paid Impressions 5",value:"0"},{id:"impressions",name:"Impressions 2",value:"4"}]}]}]}]}],isHidden:!1,isSummaryHidden:!1},{link:"dsfg.com",id:"campaign_2",title:"Campaign 2",date:"Oct 01, 2022 - Nov 01, 2022",media:{"crawler_I-Z8rsRo6dUYBlDRz5VZdQ_MICHAEL-DOWLING":{id:"crawler_I-Z8rsRo6dUYBlDRz5VZdQ_MICHAEL-DOWLING",title:"Northwell Promo #8b",message:"Quality of Life Is at the Center of Northwell\u2019s First-of-Its-Kind Cancer Survivorship Program - michael-dowling.com. CANCER SURVIVORSHIP PROGRAMQuality of Life Is at the Center of Northwell\u2019s First-of-Its-Kind Cancer Survivorship Program...",createdAt:"May 31, 3:34 pm",creatorName:"MICHAEL-DOWLING",picture:"https://app.momently.com/image-cache/cr-crawler_kKCBV3OUBvaFT0IulccS4/I-Z8rsRo6dUYBlDRz5VZdQ",type:"interactive",metric:{Engagements:"33","Outbound Link Clicks":"34","Interactive Clicks":"33","Total Clicks":"67","Video Views":"0","Complete Video View":"0","Video Minutes Viewed":"0","Average Video View Time":"0s","Form Submits":"0",Impressions:"2,493,114",Clicks:"7,742","CTR (Click Through Rate)":"0.31%","Google Users":"7,502",Engagement:"8,212","Link Clicks":"34","Click-Through Rate":"0.41%","Google Unique Pageviews":"7,725","Avg. Time on Page":"1m 48s","Google Avg. Scroll":"73.1%","Google Entrances":"7,671","Google Entrances / Pageviews":"93.4%","Google Pages / Session":"1.07","Google Total Time":"58,115s","Google Exits":"7,672","Google % Exit":"93.4%","Google New Users":"3,982","Google Sessions":"7,671","Google Bounces":"7,328","Moat Page Views (unfiltered)":"7,981","Moat Page Views (filtered for GIVT)":"7,841","Moat Page Views":"7,774","Moat Valid Impressions":"7,774","Moat Valid Rate":"97.4%","Moat Total Session Time":"18393m 44s","Moat Avg Session Time":"2m 22s","Moat Avg Page Dwell Time":"31s","Moat Median Page Dwell Time":"31s","Moat Total Active Page Dwell Time":"3986m 54s","Moat Time Until Scroll":"1m 04s","Moat Scroll Velocity":"231","Moat Scroll Down Velocity":"195","Moat Scroll Up Velocity":"481","Moat Average Scroll Depth":"33.7%","Moat Median Scroll Depth":"30.7%","IVT Measurable Impressions":"7,981","Moat IVT Measurable Rate":"100%","Moat IVT Rate":"2.59%","Moat GIVT Rate":"1.75%","Moat SIVT Rate":"0.84%","Moat IVT Impressions":"207","Moat Automated Browser Rate":"0.68%","Moat Incongruous Browser Rate":"0.29%","Moat Data Center Traffic Rate":"1.74%","Moat Spider Rate":"0.04%","Moat Excessive Activity Rate":"0%","Moat Invalid Source Rate":"0.01%","Moat Invalid Proxy Rate":"0.68%","Moat Non-US Traffic Rate":"1.23%","Moat Outdated Browser Rate":"8.14%","Moat Late Night Rate":"86.5%","Moat Top of the Hour Rate":"21.4%"},hasScreenshot:!0,noData:!1,link:"https://www.michael-dowling.com/quality-of-life-is-at-the-center-of-northwells-first-of-its-kind-cancer-survivorship-program"}},items:[{type:"summary",items:[{type:"metrics",items:[{id:"overview/reads",name:"Engagement",value:"8,213",description:"Total number of page views that lasted more than 30 seconds"},{id:"ga/ga_avg_time_on_page",name:" Avg. Time on Page",value:"1m 48s",description:"The average time users spent viewing the page"},{id:"overview/impressions",name:"Impressions",value:"2,493,114",description:"The number of people in the targeted audience set who were served the native ad unit via O&O and syndication"}]},{type:"goals",items:[{id:"impressions",name:"Impressions",progress:.25,value:1e6,target:1e6},{id:"engagement",name:"Engagement",progress:1.5,value:10300,target:1e6}]}]},{type:"detail",sort:1654029268e3,items:[{type:"media",metrics:["Pageview","Avg. Time on Page","Impressions"],items:[{eyebrow:"NHC",title:"Northwell Promo #8b",pictures:["https://app.momently.com/image-cache/cr-crawler_kKCBV3OUBvaFT0IulccS4/I-Z8rsRo6dUYBlDRz5VZdQ"],subtitle:"Quality of Life Is at the Center of Northwell\u2019s First-of-Its-Kind Cancer Survivo...",items:[{type:"metrics2",items:[{id:"ga_pageview",name:"Engagement",value:"8,212"},{id:"ga_avg_time_on_page",name:"Avg. Time on Page",value:"1m 48s"},{id:"ga/promotions",name:"Impressions",value:"2,493,114"}]}]},{title:"Total (1 item)",items:[{type:"metrics2",items:[{id:"ga_pageview",name:"Engagement",value:"8,212"},{id:"ga_avg_time_on_page",name:"Avg. Time on Page",value:"1m 48s"},{id:"ga/promotions",name:"Impressions",value:"2,493,114"}]}]}]}]}],isHidden:!1,isSummaryHidden:!0}],cover:{heading:"Northwell Health Promo",tableOfContent:[{id:"campaign_1",title:"Campaign 1",subtitle:"2 media"},{id:"campaign_2",title:"Campaign 2",subtitle:"3 media"}],hideTableOfContent:!0,clientLogo:"https://s3.us-west-2.amazonaws.com/momently-m2/users/google_100654333543519017394/ayXYY2TkuSxLsLOuKSvxd7jWO40-toppng.com-orthwell-health-northwell-health-logo-850x459.png"},hasHighlight:!0,"campaign-group":{id:"oKpp3oEBCAp-Nj3I1g4q",name:"Northwell Health Campaigns"},date:{selectedRange:!1,datePicker:{begin:{year:"2022",month:"05",day:"31"},end:{year:"2022",month:"09",day:"22"}},minDate:{year:"2022",month:"05",day:"31"}},isAuthenticated:!0,workspace:{slug:"hearst-story",icon:"https://s3.us-west-2.amazonaws.com/momently-m2/users/google_100654333543519017394/1D0Xb4JVxtg3iY9E-epy8wiz2apvjbxkp-hearst-icon.png",logo:"https://s3.us-west-2.amazonaws.com/momently-m2/users/google_100654333543519017394/bASY1Kho8ImRJ0Jg--w86oa4moy1blnui-hearst-cover.png",logo2:"https://s3.us-west-2.amazonaws.com/momently-m2/users/google_100654333543519017394/kCuJya1QcL21RDkYm5Z9mIFNdHk-asset-1.png",primaryColor:"#2b374f",secondaryColor:"#53bed0",company:{name:"StoryStudio",website:"https://www.hearststorystudio.com/",email:"[email protected]",location:"San Francisco, CA",phone:"+1.415.777.7845",social:{facebook:"https://www.facebook.com/hearststorystudio/",linkedin:"https://www.linkedin.com/company/hearst-storystudio/",twitter:"",instagram:"",pinterest:""}},hasHighlight:!0,banner:{url:"https://s3.us-west-2.amazonaws.com/momently-m2/users/google_100654333543519017394/N___sZcgTsw4lFf0UQHtDcAYRU8-hearst.mp4",type:"video/mp4"}}},meta:{timezone:"America/Chicago",mediaType:{overview:{breakdowns:["adMedia/adMedia_devices_impressions","adMedia/adMedia_gender_impressions","adMedia/adMedia_age_impressions","adMedia/adMedia_location"],groups:[],metrics:["overview/reads","ga/ga_avg_time_on_page","overview/impressions"],goals:[]},campaign_1:{breakdowns:[],groups:[],metrics:[],goals:[]},campaign_2:{breakdowns:[],groups:[],metrics:[],goals:[]}},hideHighlight:!1,coverImage:"https://s3.us-west-2.amazonaws.com/momently-m2/users/google_100654333543519017394/bASY1Kho8ImRJ0Jg--w86oa4moy1blnui-hearst-cover.png",sort:[{display:"Cover",name:"Cover",id:"c
319over",isHidden:!1},{display:"Overview",name:"overview",id:"overview",isHidden:!1},{display:"Campaign 1",name:"Campaign 1",id:"campaign_1",isHidden:!1},{display:"Campaign 2",name:"Campaign 2",id:"campaign_2",isHidden:!1}],link:"https://app.momently.com/hearst-story/northwell-health/hnp-northwell-health-promo-7-2022-16222/m41p3oEBrnEmnBRz3Yw5"}},s={data:{id:e.data.id,date:e.data.date,cover:f({},e.data.cover),hasHighlight:!1,report:e.data.report.map(i=>y(f({},i),{filter:{}})),settings:{coverImage:e.meta.coverImage,link:e.meta.link,mediaType:e.meta.mediaType,sort:e.meta.sort.map(i=>{let a=e.data.cover.tableOfContent.filter(u=>u.id===i.id)[0],n=i;return!a&&!this.isCoverOrOverview(i.id)&&(n=y(f({},i),{isDynamic:!0})),n})},workspace:e.data.workspace,isAuthenticated:e.data.isAuthenticated}};return y(f({},s),{meta:e.meta})}isCoverOrOverview(e){return e==="cover"||e==="overview"}getParams(e,t){return t.queryParams&&(e=f(f({},e),t.queryParams)),e}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var _0=$.endpoints.reports,Ni=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(Ts({data:{type:"group",id:e.params.groupId,endpoint:`${_0}/${e.params.groupId}/group`}})),this.store.select(Oe).pipe(z(),A(t=>t.isAuthenticated?d(!0):(this.store.dispatch(Ve()),this.actions$.pipe(c(bt,T,Qe),z()))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var rE=$.endpoints.reports,oE=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetchDefault$=p(()=>this.actions$.pipe(c(yw),A(e=>this.appService.get("workspaces/template/highlight").pipe(m(t=>di({data:t.data})),h(()=>d(lt({message:"Fetch error!"}))))))),this.updateSuccessDefault$=p(()=>this.actions$.pipe(c(Ga),A(e=>{let t={sort:e.data};return this.appService.update2("workspaces/template/highlight",t).pipe(m(s=>Ym()),h(()=>d(lt({message:"Auto save error!"}))))}))),this.add$=p(()=>this.actions$.pipe(c(ja),S(this.store.select(ut)),m(([e,t])=>{let s=e.data;s.metric.id||(s=this.getDetailWithNewDisplay(s));let i=[...t.sort,s];return fi({data:{sort:i}})}),h(()=>d(lt({message:"Add error!"}))))),this.update$=p(()=>this.actions$.pipe(c(Ua),S(this.store.select(ut)),m(([e,t])=>{let s=this.getNewSort(t.sort,e.data);return fi({data:{sort:s}})}),h(()=>d(lt({message:"Update error!"}))))),this.remove$=p(()=>this.actions$.pipe(c(xa),S(this.store.select(ut)),m(([e,t])=>{let s=t.sort.filter(i=>i.id!==e.data.id);return fi({data:{sort:s}})}),h(()=>d(lt({message:"Remove error!"}))))),this.updateSuccess$=p(()=>this.actions$.pipe(c(fi),S(this.store.select(U),this.store.select(Je),this.store.select(ut),this.store.select(ir)),A(([e,t,s,i,a])=>{if(s){let n={sort:i.sort,layout:s.layout,campaignId:s.campaign.id},u=`${rE}/${t?.params.reportId}/highlight`;return a?this.appService.update2(u,n).pipe(N(g=>[Ym(),Es()]),h(()=>d(lt({message:"Auto save error!"})))):d(Pr({data:{id:"sort",sort:i.sort}}))}else return d(Ga({data:i.sort}))}))),this.sort$=p(()=>this.actions$.pipe(c(Aw),S(this.store.select(U),this.store.select(Je),this.store.select(ut)),A(([e,t,s,i])=>{if(s){let n={sort:e.data,layout:s.layout,campaignId:s.campaign.id},u=`${rE}/${t?.params.reportId}/highlight`;return this.appService.update2(u,n).pipe(m(()=>Es()),h(()=>d(lt({message:"Auto save error!"}))))}else return d(Ga({data:e.data}))})))}getNewSort(e,t){return e.map(s=>{if(s.id===t.id){let i=t;return s.editor&&s.editor.id&&(i=y(f({},i),{editor:y(f({},i.editor),{id:s.editor.id})})),i.metric&&i.metric.id?i:this.getDetailWithNewDisplay(i)}else return s})}getDetailWithNewDisplay(e){let t=e.editor.data.blocks,s,i="";for(let a=0;a<t.length;a++)if(s=t[a],s.type==="header"){i="custom: "+s.data.text.split(" ")[0];break}return i===""&&(t.length===0?i="custom: N/A":i="custom: "+t[0].data.text.split(" ")[0]),y(f({},e),{display:i})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var U4=$.endpoints.reports,aE=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(vw),S(this.store.select(ut)),m(([e,t])=>{let s={metric:{},editor:{id:"new",type:"editor",data:{blocks:[]}}};return e.data&&(s=t.sort.filter(i=>i.id===e.data)[0]),bw({data:s})}))),this.fetchMetrics$=p(()=>this.actions$.pipe(c(Iw),S(this.store.select(U),this.store.select(L)),A(([e,t,s])=>{let i=f({all:!0,calculated:!0,workspaceId:s.id},t.queryParams);return this.appService.get("metrics-catalog?shape=grouped&surface=all",i).pipe(m(a=>Kr({data:this.formatMetricsData(a,e.data.selected)})),h(()=>d(T({message:"Fetch error!"}))))}))),this.fetchMetricsOnSave$=p(()=>this.actions$.pipe(c(Tw),S(this.store.select(U),this.store.select(L),this.store.select(kS)),A(([e,t,s,i])=>{let a=f({all:!0,calculated:!0,workspaceId:s.id},t.queryParams);return this.appService.get("metrics-catalog?shape=grouped&surface=all",a).pipe(m(n=>Kr({data:this.formatMetricsData(n,i)})),h(()=>d(T({message:"Fetch error!"}))))}))),this.saveMetrics$=p(()=>this.actions$.pipe(c(Ew),S(this.store.select(Gs)),m(([e,t])=>{let s={},i=t.selected[0],a,n;for(let u=0;u<t.state.length;u++){a=t.state[u];for(let g=0;g<a.metrics.length;g++)if(n=a.metrics[g],n.id===i){s=n;break}if(Object.keys(s).length!==0)break}return Zm({data:s})}))),this.saveMetricsSuccess$=p(()=>this.actions$.pipe(c(Zm),m(e=>qo({data:e.data})))),this.add$=p(()=>this.actions$.pipe(c(kw),S(this.store.select(ir)),m(([e,t])=>ja({data:t})))),this.update$=p(()=>this.actions$.pipe(c(ww),S(this.store.select(ir)),m(([e,t])=>Ua({data:t})))),this.remove$=p(()=>this.actions$.pipe(c($w),S(this.store.select(ir)),m(([e,t])=>xa({data:t}))))}formatMetricsData(e,t){let{sources:s,mediaTypes:i}=Us(e);return{items:this.addSearchName(s),selected:t,mediaTypes:{metrics:i}}}addSearchName(e){return e.map(t=>y(f({},t),{metrics:t.metrics?.map(s=>y(f({},s),{searchName:s.searchName?s.searchName:t.name+" "+s.name})),breakdowns:t.breakdowns?.map(s=>y(f({},s),{searchName:s.searchName?s.searchName:t.name+" "+s.name}))}))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Oi=$.endpoints.reports,nE=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.updateDate$=p(()=>this.actions$.pipe(c(pu),S(this.store.select(U)),A(([e,t])=>{let s={workspaceSlug:t.params.workspaceId},i=t.params.reportId;return t.queryParams&&(s=f(f({},s),e.data)),this.appService.get(`${Oi}/${i}/highlight`,s).pipe(m(a=>ko({data:this.formatData(a.data,i)})),h(a=>d(T({message:a.message}))))}))),this.fetch$=p(()=>this.actions$.pipe(c(Xt),S(this.store.select(U)),A(([e,t])=>{let s=f({workspaceSlug:t.params.workspaceId},t.queryParams),i=t.params.reportId;return this.appService.get(`${Oi}/${i}/highlight`,s).pipe(N(a=>[Cr({data:this.formatData(a.data,i)}),di({data:{sort:a.data.sort}})]),h(()=>d(T({message:"Fetch error!"}))))}))),this.fetch2$=p(()=>this.actions$.pipe(c(Es),S(this.store.select(U)),A(([e,t])=>{let s=t.params.reportId,i={workspaceSlug:t.params.workspaceId};return this.appService.get(`${Oi}/${s}/highlight`,i).pipe(N(a=>[ko({data:this.formatData(a.data,s)}),di({data:{sort:a.data.sort}})]),h(()=>d(T({message:"Fetch error!"}))))}))),this.autoSave$=p(()=>this.actions$.pipe(c(Pr),ys(200),S(this.store.select(U),this.store.select(Je),this.store.select(ut)),_(([e,t,s,i])=>{let a=this.getNewLayout(s,e.data),n={layout:a,campaignId:s.campaign.id,sort:i.sort};return this.appService.update2(`${Oi}/${t?.params.reportId}/highlight`,n).pipe(m(()=>cu({data:{layout:a}})),h(()=>d(lt({message:"Auto save error!"}))))}))),this.save$=p(()=>this.actions$.pipe(c(nu),m(e=>Pr({data:e.data})))),this.preview$=p(()=>this.actions$.pipe(c(au),S(this.store.select(U),this.store.select(Je)),m(([e,t,s])=>e.data?Es():ko({data:this.formatData(s,s.reportId)})))),this.download$=p(()=>this.actions$.pipe(c(mu),S(this.store.select(U)),_(([e,t])=>{let s={reportId:t.params.reportId,workspaceSlug:t.params.workspaceId};if(t.queryParams){let a=t.queryParams;s=y(f({},s),{dateRange:{begin:a.begin,end:a.end}})}let i={responseType:"blob",headers:{Accept:"application/zip"}};return this.appService.post(`${Oi}/csv`,s,i).pipe(m(a=>zc({data:a})),h(a=>d(T({message:"download error"}))))}))),this.downloadSuccess$=p(()=>this.actions$.pipe(c(zc),S(this.store.select(Je)),m(([e,t])=>{let s=new Blob([e.data],{type:"application/zip"}),i=document.createElement("a"),a=URL.createObjectURL(s);i.href=a,i.download=`${t.campaign.name.toLowerCase().trim().replace(/&/g,"and").replace(/ /g,"-")}.zip`,i.click(),URL.revokeObjectURL(a)})),{dispatch:!1})}formatData(e,t){return{reportId:t,isAuthenticated:e.isAuthenticated,date:e.date,link:e.link,layout:this.reArrange(e.layout),campaign:e.campaign,workspace:e.workspace}}reArrange(e){return(e||[]).map(t=>{if(t.type==="body"){let i=[...(t.screenshots||[]).map((a,n)=>({group:a,originalIndex:n}))].sort((a,n)=>{let u=Array.isArray(a.group)&&a.group.some(v=>v.mediaType==="mc"),g=Array.isArray(n.group)&&n.group.some(v=>v.mediaType==="mc");return u===g?0:u?1:-1});return y(f({},t),{screenshots:i.map(a=>a.group),sections:(t.sections||[]).map(a=>Array.isArray(a?.metric?.value)?y(f({},a),{metric:y(f({},a.metric),{value:i.map(n=>a.metric.value[n.originalIndex])})}):a)})}return t})}getNewLayout(e,t){if(t.id==="sort"){let s=t.sort,i;return e.layout.map(a=>a.type==="body"?y(f({},a),{sections:a.sections.map(n=>(i=s.filter(u=>u.id===n.id)[0],y(f({},i),{editor:y(f({},i.editor),{id:n.editor.id})})))}):a)}else return e.layout.map(s=>s.id===t.id?t:s)}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var ji=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.select(Oe).pipe(z(),A(t=>t.isAuthenticated?this.actions$.pipe(c(Cr,T,Qe),z()):(this.store.dispatch(Xt()),this.actions$.pipe(c(Cr,T,Qe),z()))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Pd=$.endpoints.reports,cE=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.save$=p(()=>this.actions$.pipe(c(pw),S(this.store.select(U),this.store.select(ss)),A(([e,t,s])=>{let i={section:f({},e.data),sort:s.settings.sort};return this.appService.post(`${Pd}/${t?.params.reportId}/sections`,i,{workspaceSlug:t?.params.workspaceId}).pipe(m(a=>pi()),h(a=>d(Oa({message:a.message}))))}))),this.update$=p(()=>this.actions$.pipe(c(mw),S(this.store.select(U)),A(([e,t])=>{let s=f({},e.data);return delete s.id,this.appService.update2(`${Pd}/${t.params.reportId}/sections/${e.data.id}`,s,{workspaceSlug:t.params.workspaceId}).pipe(m(i=>mi()),h(i=>d(Oa({message:i.message}))))}))),this.remove$=p(()=>this.actions$.pipe(c(lw),S(this.store.select(U)),A(([e,t])=>this.appService.remove2(`${Pd}/${t.params.reportId}/sections/${e.data}`,{workspaceSlug:t.params.workspaceId}).pipe(m(s=>li()),h(s=>d(Oa({message:s.message}))))))),this.success$=p(()=>this.actions$.pipe(c(pi,mi,li),m(()=>ag({data:"close"}))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var wB=$.endpoints.links,pE=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(uS),m(e=>gS({data:this.formatData(e.data)})))),this.save$=p(()=>this.actions$.pipe(c(SS),S(this.store.select(U),this.store.select(st),this.store.select(bS)),A(([e,t,s,i])=>{let a=i.backup.filter(n=>!e.data.selected.includes(n));return this.appService.update2(`reports/${s.id}/list-visibility`,{hidden:a.map(n=>n.name),selected:e.data.selected.map(n=>n.name),type:e.data.type}).pipe(m(n=>Er({data:e.data})),h(n=>d(T({message:"update error"}))))})))}formatData(e){let t=[];return e.map(s=>{this.isHidden(s)||t.push(s)}),{items:e,selected:t}}isHidden(e){return"isHidden"in e?e.isHidden:!1}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var O0=$.endpoints.campaigns,mE=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(_o),m(e=>dt(this.formatData(e.data))))),this.fetchSuccess$=p(()=>this.actions$.pipe(c(dt),S(this.store.select(U),this.store.select(Oe),this.store.select(ss)),m(([e,t,s,i])=>s.isAuthenticated?Eo({data:i.campaign.id}):K()))),this.update2$=p(()=>this.actions$.pipe(c(Fo),S(this.store.select(je)),_(([e,t])=>this.appService.update(O0,Rn(t)).pipe(m(s=>No()),h(s=>d(T({message:s.message}))))))),this.loadingOff$=p(()=>this.actions$.pipe(c(dt,ng),m(()=>po({data:!1})))),this.fetchFilter$=p(()=>this.actions$.pipe(c(cg),S(this.store.select(Ke({key:vt})),this.store.select(ss),this.store.select(Ip),this.store.select(L)),A(([e,t,s,i,a])=>{let n=e.data.filterDetail,g=t?.filter?.[n.info.id],v={type:n.info.id,field:e.data.filter.filterType,mediaType:i,campaignId:s.campaign.id,workspaceId:a.id};return this.appService.get(`${$.endpoints[e.meta.key]}/facets`,v).pipe(m(b=>Fu(this.formatFilterData(b,g,e.meta))),h(b=>d(Vc({message:b.message,meta:e.meta}))))}))),this.searchFilter$=p(()=>this.actions$.pipe(c(pg),S(this.store.select(Ip),this.store.select(L)),A(([e,t,s])=>{let a={type:e.data.filterDetail.info.id,field:e.data.filter.filterType,mediaType:t,searchString:e.data.term,workspaceId:s.id};return this.appService.get(`${$.endpoints[e.meta.key]}/facets`,a).pipe(m(n=>Nu({data:n.data,meta:e.meta})),h(()=>d(Vc({message:"could not search!",meta:e.meta}))))})))}formatFilterData(e,t,s){return{data:y(f({},t),{items:e.data}),meta:f(f({},e.meta),s)}}getParams(e,t){return t.queryParams&&(e=f(f({},e),t.queryParams)),e}formatData(e){let t=y(f({},e.meta),{sort:[...e.meta.sort]}),s=[...e.data.report],i={};s.map(g=>{g.type==="custom"&&(i[g.id]={id:g.id,pages:g.items,cards:g.cards,title:g.title,date:g.date})}),t=y(f({},t),{customMedia:i,deletedCustomIds:t.deletedCustomIds?t.deletedCustomIds:[]});let a,n;return s.map(g=>{if(g.media){n={};for(let v in g.media)n[v]=y(f({},g.media[v]),{parentId:g.parentId,subparentId:g.id});a=f(f({},a),n)}}),{data:y(f({},e.data),{media:a,report:[...s.map(g=>g.id==="mc"?y(f({},g),{items:[...g.items]}):g.id==="overview"?y(f({},g),{items:g.items.map(v=>y(f({},v),{items:v.items.map(b=>b.type==="metrics"?f({},b):b)}))}):f({},g))],filter:e.data.filter,client:{id:e.data.campaign.clientId,name:e.data.campaign.client},campaign:e.data.campaign,settings:f({},t),workspace:e.data.workspace,isAuthenticated:e.data.isAuthenticated})}}isCoverOrOverview(e){return e==="cover"||e==="overview"}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var lE=$.endpoints.reports,It=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){let t;return e.params.reportId?t={type:"default",id:e.params.reportId,endpoint:`${lE}/${e.params.reportId}`}:t={type:"group",id:e.params.groupId,endpoint:`${lE}/${e.params.groupId}/group`},this.store.dispatch(Ts({data:t})),this.store.dispatch(uo()),this.actions$.pipe(c(go,T,Qe),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var j0=$.endpoints.reports,Tt=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(Ts({data:{type:"default",id:e.params.reportId,endpoint:`${j0}/${e.params.reportId}`}})),this.store.select(Oe).pipe(z(),A(t=>t.isAuthenticated?d(!0):(this.store.dispatch(Ve()),this.actions$.pipe(c(dt,T,Qe),z()))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var x0=$.endpoints.reports,dE=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(IS),S(this.store.select(ve),this.store.select(Ce)),m(([e,t,s])=>{let i;s.layout.map(g=>{g.id===e.data.id&&(i=g)});let a=[],n={},u=t.mediaType[e.data.id].groups;return n.group=u.map(g=>y(f({},g),{items:g.items.map(v=>{let b=i.groups.filter(M=>M.id===v)[0];return a.push(b),b})})),n.media=i.groups.filter(g=>a.indexOf(g)===-1),n.media2=i.media,TS({data:n})}))),this.save$=p(()=>this.actions$.pipe(c(ES),S(this.store.select(ve),this.store.select(Sy),this.store.select(Ce)),A(([e,t,s,i])=>{let a=`${x0}/${i.id}`;return this.appService.update2(a,this.formatSettings(t,s,e.data)).pipe(m(n=>Wo({data:n.meta.settings})),h(n=>d(es({message:n.message}))))})))}formatSettings(e,t,s){let i=e;return i=y(f({},i),{mediaType:y(f({},i.mediaType),{[s]:y(f({},i.mediaType[s]),{groups:t.map(a=>y(f({},a),{items:a.items.map(n=>n.id)}))})})}),{timezone:i.timezone,sort:i.sort,mediaType:i.mediaType}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var U0=$.endpoints.reports,fE=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.updateAllSort$=p(()=>this.actions$.pipe(c(Ae),S(this.store.select(ve)),m(([e,t])=>mg({data:{allSort:t.sort}})))),this.updateMediaTypeGroup$=p(()=>this.actions$.pipe(c(lg),S(this.store.select(rs)),m(([e,t])=>{let{cards:s,allSort:i,sort:a}=this.getCards(e.data,t.cards,t.state.allSort,t.state.sort,su),n={cards:s,settings:y(f({},t.state),{allSort:i,sort:a})};return dg({data:n})}))),this.updateGroupCampaignMedia$=p(()=>this.actions$.pipe(c(fg),S(this.store.select(rs)),m(([e,t])=>{let s=t.campaignMedia[e.meta],{cards:i,allSort:a,sort:n}=this.getCards(e.data,s.cards,s.allSort,s.sort,ru),u=y(f({},t.campaignMedia),{[e.meta]:{cards:i,allSort:a,sort:n}});return hg({data:u})}))),this.preFetchMetrics$=p(()=>this.actions$.pipe(c(ap),m(()=>hS()))),this.saveMetricsSuccess$=p(()=>this.actions$.pipe(c(Pt),m(e=>qo({data:e.data})))),this.snackBar=l(we),this.sortSuccess$=p(()=>this.actions$.pipe(c(Oo),X(e=>{setTimeout(()=>this.snackBar.open("Report sort is updated successfully","Ok",{duration:1500,panelClass:["success-snackbar"]}),0)})),{dispatch:!1}),this.saveAck$=p(()=>this.actions$.pipe(c(Ae,Lt,ft),m(()=>np({message:"Settings updated"})))),this.success$=p(()=>this.actions$.pipe(c(np),X(e=>{setTimeout(()=>this.snackBar.open(e.message,"Success",{duration:2500}),0)})),{dispatch:!1}),this.appService=l(E),this.upload$=p(()=>this.actions$.pipe(c(Sg),S(this.store.select(ve),this.store.select(Ce)),_(([e,t,s])=>this.appService.update2(`${U0}/${s.id}`,this.formatCoverImage(t,e.data.url)).pipe(m(()=>yg({data:{id:e.data.id,url:e.data.url}})),h(i=>d(T({message:Kt(i).message}))))))),this.fetchMetrics$=p(()=>this.actions$.pipe(c(ap,Ag),S(this.store.select(ve)),A(([e,t])=>{let s=e.data.id,i;return s.includes("combo")?(i=t.comboMedia[e.data.id][e.data.entity],s="overview"):i=t.mediaType[e.data.id][e.data.entity],this.appService.get("metrics-catalog?shape=sections&surface=report",{type:s,entity:e.data.entity}).pipe(m(a=>Kr({data:this.formatMetricsFromServer(a,i)})),h(a=>d(T({message:a.message}))))})))}getCards(e,t,s,i,a){let n,u,g=[];return e.isGrouped?u=t.map(v=>{if(v.id===e.id){let b={id:v.id,name:v.display,display:v.display};n=[...s,b];let M=!0;return i.map(P=>{v.items.filter(D=>D.id===P.id).length===0?g.push(P):M&&(M=!1,g.push(b))}),y(f({},v),{items:[{id:v.id,name:v.display,cards:wp(mS(a,v.id)),expanded:!1},...v.items],isGrouped:e.isGrouped})}else return v}):u=t.map(v=>v.id===e.id?(n=s.filter(b=>b.id!==v.id),i.map(b=>{b.id===v.id?v.items.map(M=>{M.id!==v.id&&g.push({id:M.id,name:M.name,display:M.display,cards:wp(Rr),expanded:!1})}):g.push(b)}),y(f({},v),{items:v.items.filter(b=>b.id!==v.id),isGrouped:e.isGrouped})):v),{cards:u,allSort:n,sort:g}}formatCoverImage(e,t){return y(f({},it(e)),{coverImage:t,timezone:e.timezone})}formatMetricsFromServer(e,t){let{sources:s,mediaTypes:i}=Us(e);return{items:this.addSearchName(s),selected:t,mediaTypes:{metrics:i,breakdowns:lS(e)}}}addSearchName(e){return e.map(t=>y(f({},t),{metrics:t.metrics?.map(s=>y(f({},s),{searchName:s.searchName?s.searchName:t.name+" "+s.name})),breakdowns:t.breakdowns?.map(s=>y(f({},s),{searchName:s.searchName?s.searchName:t.name+" "+s.name}))}))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Hn=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E)}settingsUpdate$(e,t,s){return p(()=>this.actions$.pipe(c(e),S(this.store.select(ve),this.store.select(Ce)),A(([i,a,n])=>{let u=this.getUrl(a,n),g=t({settingsState:a,report:n,action:i,getBase:this.settingsGetter});return this.appService.update2(u,g).pipe(N(v=>{let b=s(v,i,a);return Array.isArray(b)?b:[b]}),h(v=>d(es({message:v.message}))))})))}settingsUpdateFull$(e,t,s){return p(()=>this.actions$.pipe(c(e),S(this.store.select(rs),this.store.select(Ce)),A(([i,a,n])=>{let u=this.getUrl(a.state,n),g=t({fullState:a,report:n,action:i,getBase:this.settingsGetter});return this.appService.update2(u,g).pipe(N(v=>{let b=s(v,i);return Array.isArray(b)?b:[b]}),h(v=>d(es({message:v.message}))))})))}formatRemove(e,t){let s=this.settingsGetter(e),i=y(f({},s),{sort:(s.sort||[]).filter(a=>a.id!==t)});if(e.customMedia?.[t]){let a=f({},e.customMedia);delete a[t],i.customMedia=a,i.deletedCustomIds=[...e.deletedCustomIds||[],t]}if(e.comboMedia?.[t]){let a=f({},e.comboMedia);delete a[t],i.comboMedia=a,i.deletedComboIds=[...e.deletedComboIds||[],t]}return i}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();function gr(r,o){return o(r)}function Vn(r,o,e){let t=r.state;return y(f({},e(t)),{campaignMedia:y(f({},r.campaignMedia),{[o.meta]:Xm(r.campaignMedia[o.meta])})})}function Qn(r,o,e){return y(f({},e(r)),{cover:f(f({},r.cover),o.data)})}function Ui(r,o,e){let t=e(r);return y(f({},t),{sort:el(t.sort,o)})}function Jn(r,o,e){let t=e(r);return y(f({},t),{sort:t.sort.map(s=>s.id===o.data.type?y(f({},s),{subTitle:o.data.subTitle}):s)})}function Yn(r,o,e){let t=e(r);return y(f({},t),{sort:t.sort.map(s=>s.id===o.data.type?y(f({},s),{postLimit:o.data.postLimit}):s)})}function Zn(r,o,e){let t=e(r);return y(f({},t),{sort:t.sort.map(s=>s.id===o.data.type?y(f({},s),{postSort:o.data.postSort}):s)})}function Xn(r,o,e){return o.data.type.includes("combo")?y(f({},it(r)),{comboMedia:y(f({},r.comboMedia),{[o.data.type]:y(f({},r.comboMedia[o.data.type]),{note:o.data.note})})}):y(f({},e(r)),{mediaType:y(f({},r.mediaType),{[o.data.type]:y(f({},r.mediaType[o.data.type]),{note:o.data.note})})})}function ec(r,o,e){let t=r.state,s=Xm(r.campaignMedia[o.meta]);return y(f({},Ui(t,o,e)),{campaignMedia:y(f({},r.campaignMedia),{[o.meta]:el(s,o)})})}function tc(r,o,e,t,s){return f(f({},s(o)),Lw(r,o,e,t))}function us(r,o,e,t,s){let i;switch(e){case"add":i=Rw(r,o,t);break;case"update":i=Cw(r,o,t);break}return f(f({},s(r)),i)}function sc(r,o,e){return f(f({},e(r)),Pw(r,o))}var gs=$.endpoints.reports,uE=(()=>{class r extends Hn{constructor(){super(...arguments),this.settingsGetter=it,this.fetchReportSuccess$=p(()=>this.actions$.pipe(c(dt),m(e=>Ho({data:this.format(e.data,iu,tu)})))),this.fetchGroupSuccess$=p(()=>this.actions$.pipe(c(bt),m(e=>{let t={},s=Object.keys(e.meta.mediaType);for(let a=0;a<s.length;a++)s[a]!=="overview"&&(t[s[a]]=[{id:"mc",name:"Native Content",display:"Articles"},{id:"mc_interactive",name:"Interactive Content",display:"Interactive Stories"},{id:"nativo_display",name:"Nativo Display Ads",display:"On-Site Display Ads"},{id:"adMedia",name:"AdMedia Campaigns",display:"Third-Party Promotion"}]);let i=y(f({},e.data),{campaignMedia:t});return Ho({data:this.formatCampaignGroup(i,ou,vo)})}))),this.fetchSuccess$=p(()=>this.actions$.pipe(c(Ho),m(e=>zr({data:e.data})))),this.sort$=this.settingsUpdate$(MS,({settingsState:e,getBase:t})=>gr(e,t),()=>Ve()),this.updateSort$=this.settingsUpdate$(RS,({settingsState:e,getBase:t})=>gr(e,t),()=>ft()),this.updateSortCampaignMedia$=this.settingsUpdateFull$(DS,({fullState:e,action:t,getBase:s})=>Vn(e,t,s),()=>ft()),this.updateTitle$=this.settingsUpdate$(CS,({settingsState:e,action:t,getBase:s})=>Qn(e,t,s),e=>Ae({data:e.meta.settings})),this.updateDisplay$=this.settingsUpdate$(PS,({settingsState:e,action:t,getBase:s})=>Ui(e,t,s),e=>Ae({data:e.meta.settings})),this.updateSubTitle$=this.settingsUpdate$(LS,({settingsState:e,action:t,getBase:s})=>Jn(e,t,s),e=>Ae({data:e.meta.settings})),this.updatePostLimit$=this.settingsUpdate$(qS,({settingsState:e,action:t,getBase:s})=>Yn(e,t,s),e=>Ae({data:e.meta.settings})),this.updatePostSort$=this.settingsUpdate$(WS,({settingsState:e,action:t,getBase:s})=>Zn(e,t,s),e=>Ae({data:e.meta.settings})),this.updateNote$=this.settingsUpdate$(_S,({settingsState:e,action:t,getBase:s})=>Xn(e,t,s),e=>Ae({data:e.meta.settings})),this.updateDisplayCampaignMedia$=this.settingsUpdateFull$(FS,({fullState:e,action:t,getBase:s})=>ec(e,t,s),(e,t)=>ug({data:{},meta:t.meta})),this.addCombo$=this.settingsUpdate$(jS,({settingsState:e,action:t,getBase:s})=>sc(e,t.data.payload,s),()=>xS()),this.addCustom$=this.settingsUpdate$(GS,({settingsState:e,action:t,getBase:s})=>us(e,t.data.payload,"add",t.data.isHidden,s),()=>Zo()),this.updateCustom$=this.settingsUpdate$(KS,({settingsState:e,action:t,getBase:s})=>us(e,t.data.payload,"update",t.data.isHidden,s),(e,t)=>qr({data:t.data.payload})),this.removeSection$=this.settingsUpdate$(US,({settingsState:e,action:t})=>this.formatRemove(e,t.data),()=>Yo()),this.updateHide$=p(()=>this.actions$.pipe(c(BS),S(this.store.select(ve),this.store.select(Ce)),A(([e,t,s])=>{let i=y(f({},t),{[e.data.type]:e.data.status});return this.appService.update2(`${gs}/${s.id}`,i).pipe(m(()=>Lt({data:e.data})),h(a=>d(T({message:Kt(a).message}))))}))),this.saveMetrics$=p(()=>this.actions$.pipe(c(NS),S(this.store.select(Gs),this.store.select(ve),this.store.select(Ce)),A(([e,t,s,i])=>this.appService.update2(`${gs}/${i.id}`,tc(t.selected,s,e.data.type,e.data.entity,it)).pipe(m(a=>Pt({data:a.meta.settings})),h(a=>d(T({message:a.message}))))))),this.addFilter$=p(()=>this.actions$.pipe(c(Qo),S(this.store.select(ve),this.store.select(Ce)),A(([e,t,s])=>this.appService.update2(`${gs}/${s.id}`,this.formatAddFilter(e.data,t)).pipe(m(i=>Br()),h(i=>d(T({message:i.message}))))))),this.removeFilter$=p(()=>this.actions$.pipe(c(Vo),S(this.store.select(ve),this.store.select(Ce)),A(([e,t,s])=>this.appService.update2(`${gs}/${s.id}`,this.formatRemoveFilter(e.data,t)).pipe(m(i=>Br()),h(i=>d(T({message:i.message}))))))),this.updateComboMedia$=p(()=>this.actions$.pipe(c(OS),S(this.store.select(ve),this.store.select(Ce)),A(([e,t,s])=>this.appService.update2(`${gs}/${s.id}`,this.formatComboMedia(t,e.data)).pipe(m(()=>Jo()),h(i=>d(T({message:i.message}))))))),this.updateCustomFromReport$=p(()=>this.actions$.pipe(c(zS),S(this.store.select(ve),this.store.select(ss)),A(([e,t,s])=>this.appService.update2(`${gs}/${s.id}`,us(t,e.data.payload,"update",e.data.isHidden,it)).pipe(N(()=>{let a=s.report.map(n=>n.id===e.data.payload.id?y(f({},n),{cards:e.data.payload.cards}
319):n);return[og({data:a}),gg({data:e.data.payload})]}),h(i=>d(T({message:i.message}))))))),this.updateCustomSuccess$=p(()=>this.actions$.pipe(c(qr),m(e=>HS({data:e.data}))))}getUrl(e,t){return`${gs}/${t.id}`}format(e,t,s){let i=e.settings.sort,a={report:{id:e.id,layout:e.report}},{settingsMediaCards:n,settingsGenericCards:u,settingsCustomCards:g,sort:v}=za(i,t,s);return a=y(f({},a),{settings:y(f({},e.settings),{sort:v,allSort:i,cover:e.cover,type:"default"}),settingsMediaCards:n,settingsGenericCards:u,settingsCustomCards:g,campaignMedia:{}}),a}formatCampaignGroup(e,t,s){let i=[...e.settings.sort],a={report:{id:e.id,layout:e.report}},{settingsMediaCards:n,settingsGenericCards:u,sort:g}=Ka(i,t,s),v={};return i.map(b=>{if(!t[b.id]){let M=e.campaignMedia[b.id],P=[];M.map(C=>{Ao.map(F=>{F.id===C.id&&P.push(C)})});let D=Ba(M,bo,P);v[b.id]={cards:qa(D.settingsMediaCards),allSort:M,sort:D.sort}}}),a=y(f({},a),{settings:y(f({},e.settings),{sort:g,allSort:i,cover:e.cover,type:"group"}),settingsMediaCards:n,settingsGenericCards:u,campaignMedia:v}),a}formatAddFilter(e,t){return y(f({},it(t)),{filterChips:y(f({},t.filterChips),{[e.filterType]:e.chips})})}formatRemoveFilter(e,t){return y(f({},it(t)),{filterChips:y(f({},t.filterChips),{[e.filterType]:[]})})}formatComboMedia(e,t){let s=it(e),i=t.comboSection.id,a=t.comboSection.media.map(g=>({id:g.id,mediaId:g.mediaId,sectionId:g.sectionId})),n=y(f({},s.comboMedia),{[i]:y(f({},s.comboMedia?.[i]),{mediaIds:a})}),u;return y(f({},s),{sort:s.sort.map(g=>(u=t.sections.find(v=>g.id===v.id),u?.media.length===0?y(f({},g),{hasMedia:!1}):g.id===i?y(f({},g),{hasMedia:t.comboSection.media.length!==0}):g)),comboMedia:n})}static{this.\u0275fac=(()=>{let e;return function(s){return(e||(e=bs(r)))(s||r)}})()}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Ss=$.endpoints.workspaces+"/template",gE=[{id:"mc",name:"Native Content",display:"Articles"},{id:"mc_interactive",name:"Interactive Content",display:"Interactive Stories"},{id:"nativo_display",name:"Nativo Display Ads",display:"On-Site Display Ads"},{id:"nativo_video",name:"Nativo Video Ads",display:"On-Site Video Ads"},{id:"nativo_article",name:"Nativo Native Content",display:"On-Site Native Content"},{id:"adMedia",name:"AdMedia Campaigns",display:"Third-Party Promotion"},{id:"stackAdapt",name:"StackAdapt Campaigns",display:"StackAdapt Campaigns"},{id:"facebook_posts",display:"Facebook Posts",name:"Facebook Posts"},{id:"facebook_videos",display:"Facebook Videos",name:"Facebook Videos"},{id:"instagram_photos",display:"Instagram Photos",name:"Instagram Photos"},{id:"instagram_reels",display:"Instagram Reels",name:"Instagram Reels"},{id:"instagram_stories",display:"Instagram Stories",name:"Instagram Stories"},{id:"instagram_videos",display:"Instagram Videos",name:"Instagram Videos"},{id:"facebook_ads",display:"Facebook Ads",name:"Facebook Ads"}],SE=(()=>{class r extends Hn{constructor(){super(...arguments),this.settingsGetter=hi,this.fetch$=p(()=>this.actions$.pipe(c(Tp),A(()=>this.appService.get(`${Ss}/default`).pipe(m(e=>Wr({data:this.format(e.data,Uc,Rr,"default")})),h(e=>d(T({message:e.message}))))))),this.fetchByName$=p(()=>this.actions$.pipe(c(Ep),A(({templateName:e})=>this.appService.get(`${Ss}/${e}`).pipe(m(t=>Wr({data:this.format(t.data,Uc,Rr,e)})),h(t=>d(T({message:t.message}))))))),this.fetchCampaignGroup$=p(()=>this.actions$.pipe(c(Mp),A(()=>this.appService.get(`${Ss}/group`).pipe(m(e=>{let t=y(f({},e.data),{campaignMedia:{campaign:gE}});return Wr({data:this.formatCampaignGroup(t,Gc,vo)})}),h(e=>d(T({message:e.message}))))))),this.fetchSuccess$=p(()=>this.actions$.pipe(c(Wr),m(e=>zr({data:e.data})))),this.sort$=this.settingsUpdate$(VS,({settingsState:e,getBase:t})=>gr(e,t),()=>Oo()),this.updateSort$=this.settingsUpdate$(JS,({settingsState:e,getBase:t})=>gr(e,t),()=>ft()),this.updateSortCampaignMedia$=this.settingsUpdateFull$(QS,({fullState:e,action:t,getBase:s})=>Vn(e,t,s),()=>ft()),this.updateTitle$=this.settingsUpdate$(YS,({settingsState:e,action:t,getBase:s})=>Qn(e,t,s),e=>Ae({data:e.data})),this.updateDisplay$=this.settingsUpdate$(ZS,({settingsState:e,action:t,getBase:s})=>Ui(e,t,s),e=>Ae({data:e.data})),this.updateSubTitle$=this.settingsUpdate$(XS,({settingsState:e,action:t,getBase:s})=>Jn(e,t,s),e=>Ae({data:e.data})),this.updatePostLimit$=this.settingsUpdate$(fy,({settingsState:e,action:t,getBase:s})=>Yn(e,t,s),e=>Ae({data:e.data})),this.updatePostSort$=this.settingsUpdate$(hy,({settingsState:e,action:t,getBase:s})=>Zn(e,t,s),e=>Ae({data:e.data})),this.updateNote$=this.settingsUpdate$(ly,({settingsState:e,action:t,getBase:s})=>Xn(e,t,s),e=>Ae({data:e.data})),this.updateHide$=this.settingsUpdate$(my,({settingsState:e,action:t,getBase:s})=>y(f({},s(e)),{[t.data.type]:t.data.status}),(e,t)=>Lt({data:t.data})),this.addCombo$=this.settingsUpdate$(sy,({settingsState:e,action:t,getBase:s})=>
319sc(e,t.data,s),(e,t,s)=>[ry(),this.refetchFor(s?.type)]),this.addCustom$=this.settingsUpdate$(ay,({settingsState:e,action:t,getBase:s})=>us(e,t.data.payload,"add",t.data.isHidden,s),(e,t,s)=>[ny(),this.refetchFor(s?.type)]),this.updateCustom$=this.settingsUpdate$(cy,({settingsState:e,action:t,getBase:s})=>us(e,t.data.payload,"update",t.data.isHidden,s),(e,t,s)=>[py(),this.refetchFor(s?.type)]),this.removeSection$=this.settingsUpdate$(iy,({settingsState:e,action:t})=>this.formatRemove(e,t.data),(e,t,s)=>[oy(),this.refetchFor(s?.type)]),this.applyToOtherSections$=p(()=>this.actions$.pipe(c(dy),S(this.store.select(ve)),A(([e,t])=>{let s=e.data.sectionId,a=(t?.allSort||t?.sort||[]).find(b=>b.id===s);if(!a)return d(T({message:"Could not find the source section"}));let n={};for(let b of r.PROPAGATED_PROPS)Object.prototype.hasOwnProperty.call(a,b)&&(n[b]=a[b]);let u=b=>b?.id&&b.id!=="cover"&&b.id!=="overview"&&!b.id.startsWith("c_")&&!b.id.startsWith("combo_"),g=(t?.sort||[]).map(b=>{if(b.id===s||!u(b))return b;let M=f({},b);for(let P of r.PROPAGATED_PROPS)Object.prototype.hasOwnProperty.call(n,P)?M[P]=n[P]:delete M[P];return M}),v=f({},hi(y(f({},t),{sort:g})));return this.appService.update2(`${Ss}/${t.type}`,v).pipe(N(()=>[Vt({message:"Applied to all sections"}),this.refetchFor(t.type)]),h(b=>d(T({message:b.message}))))}))),this.updateDisplayCampaignMedia$=p(()=>this.actions$.pipe(c(ey),S(this.store.select(rs),this.store.select(Ce)),A(([e,t,s])=>{let i=ec(t,e,hi);return this.appService.update2(`${Ss}/${t.state.type}`,i).pipe(m(a=>{let n=y(f({},a.data),{campaignMedia:{campaign:gE}}),u=this.format(n,Gc,eu);return zr({data:u})}),h(a=>d(es({message:a.message}))))}))),this.saveMetrics$=p(()=>this.actions$.pipe(c(ty),S(this.store.select(Gs),this.store.select(ve)),A(([e,t,s])=>this.appService.update2(`${Ss}/${s.type}`,tc(t.selected,s,e.data.type,e.data.entity,hi)).pipe(N(()=>[Pt({data:{}}),this.refetchFor(s.type)]),h(i=>d(T({message:i.message})))))))}getUrl(e,t){return`${Ss}/${e.type}`}refetchFor(e){return e==="group"?Mp():!e||e==="default"?Tp():Ep({templateName:e})}static{this.PROPAGATED_PROPS=["isHidden","isDetailHidden","isMediaDetailHidden","isBreakdownDetailHidden","isSummaryHidden","tabularMedia","postLimitEnabled","postLimit"]}format(e,t,s,i="default"){let a=e.sort.map(b=>b.id==="gam"?y(f({},b),{subTitle:{text:"line item",plural:"line items"}}):b),{settingsMediaCards:n,settingsGenericCards:u,settingsCustomCards:g,sort:v}=za(a,t,s,!0);return{settings:{mediaType:e.mediaType,comboMedia:e.comboMedia,customMedia:e.customMedia,sort:v,allSort:a,cover:e.cover,type:i,hidePDFDetails:e.hidePDFDetails,hideHighlight:e.hideHighlight,ignoreGrouping:e.ignoreGrouping},settingsMediaCards:n,settingsGenericCards:u,settingsCustomCards:g,campaignMedia:{}}}formatCampaignGroup(e,t,s){let i=e.sort,{settingsMediaCards:a,settingsGenericCards:n,sort:u}=Ka(i,t,s),g={};return i.map(v=>{if(!t[v.id]||v.id==="campaign"){let b=e.campaignMedia[v.id],M=[];b.map(D=>{Ao.map(C=>{C.id===D.id&&M.push(D)})});let P=Ba(b,bo,M);g[v.id]={cards:qa(P.settingsMediaCards),allSort:b,sort:P.sort}}}),{settings:{mediaType:e.mediaType,sort:u,allSort:i,cover:e.cover,type:"group"},settingsMediaCards:a,settingsGenericCards:n,campaignMedia:g}}static{this.\u0275fac=(()=>{let e;return function(s){return(e||(e=bs(r)))(s||r)}})()}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var z0=$.endpoints.workspaces,yE=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.router=l(me),this.setContact$=p(()=>this.actions$.pipe(c(Wa),S(this.store.select(L)),m(([e,t])=>Iu({data:t.contacts})))),this.remove$=p(()=>this.actions$.pipe(c(_w),A(e=>this.appService.remove(z0,e.data).pipe(m(()=>tl({data:e.data})),h(t=>d(Fw({message:t.message}))))))),this.removeSuccess$=p(()=>this.actions$.pipe(c(tl),X(e=>{this.router.navigate(["/workspaces"])})),{dispatch:!1})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var B0=$.endpoints.sources,AE=(()=>{class r{constructor(){this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Rk),A(e=>{let t=y(f({},Ha),{type:`is|${e.data.toLowerCase()}`});return this.appService.get(B0,t).pipe(m(s=>zm(this.formatData(s,t))),h(s=>d(as({message:s.message}))))}))),this.fetchSuccess$=p(()=>this.actions$.pipe(c(zm),N(e=>[ai({data:e.data,meta:e.meta}),Fk({data:{connections:[e.data[0]],hasScript:!0},meta:e.meta})])))}setParam(e,t){return t&&(e=y(f({},e),{searchString:t})),e}formatData(e,t){return{data:e.data.filter(n=>!!n.meta.settings?.script),meta:t}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var _d=(()=>
319{class r{constructor(){this.store=l(I)}resolve(e){return this.store.dispatch(Wa()),d(!0)}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Fd=$.endpoints.sources,vE=[{id:"pageview",title:"Track Pageview",description:"Track/send pageview event to GA",active:!1},{id:"click",title:"Track Clicks",description:"Track/send all clicks events to GA",active:!0},{id:"scroll",title:"Track Scroll Depth",description:"Track/send scroll events to GA",active:!0,dits:{items:"25, 50, 75, 100",extra:{identifiers:[],avgScroll:{active:!0,value:"10"}},unit:"percentage"}},{id:"time",title:"Track Attention Time",description:"Track/send engagement events to GA",active:!0,dits:{items:"10, 30",unit:"seconds"}}],bE=(()=>{class r{constructor(){this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Km),A(e=>this.appService.get(`${Fd}/${e.data.id}`).pipe(m(t=>Ck({data:this.format2(t)})),h(t=>d(T({message:t.message}))))))),this.remove$=p(()=>this.actions$.pipe(c(Pk),_(e=>this.appService.remove(Fd,e.data).pipe(m(()=>Bm()),h(t=>d(x({message:t.message,meta:{key:gt}}))))))),this.close$=p(()=>this.actions$.pipe(c(Bm),N(()=>[Lk({data:"close"}),ie({meta:{key:gt}})]))),this.save$=p(()=>this.actions$.pipe(c(_k),m(e=>{let t=f({},e.data.meta.settings);return t.script&&!t.script.code?qm({data:e.data,meta:e.meta}):Ma({data:e.data,meta:e.meta})}))),this.saveNoScript$=p(()=>this.actions$.pipe(c(qm),m(e=>{let t=f({},e.data.meta.settings);delete t.script;let s=y(f({},e.data),{meta:y(f({},e.data.meta),{settings:t})}),i=e.meta;return Ma({data:s,meta:i})}))),this.save2$=p(()=>this.actions$.pipe(c(Ma),_(e=>{let t={settings:e.data.meta.settings,applyToAll:e.meta};return this.appService.update2(`${Fd}/${e.data.id}`,t).pipe(m(()=>oi({data:e.data})),h(s=>d(T({message:s.message}))))}))),this.saveSuccess$=p(()=>this.actions$.pipe(c(oi),N(e=>[Km({data:e.data}),ie({meta:{key:gt}})])))}format2(e){let t=y(f({},e),{meta:y(f({},e.meta),{settings:f({},e.meta.settings)})});if(t.type==="analytics"){if(!(t.meta.settings&&t.meta.settings.breakdown))t=this.addDefaultBreakdown(t);else if(t.meta.settings.breakdown.scroll){if(!t.meta.settings.breakdown.clicks){let s=y(f({},t.meta.settings.breakdown),{clicks:this.addDefaultClicks()});t=this.updateBreakdown(t,s)}}else{let s=y(f({},t.meta.settings.breakdown),{scroll:this.addDefaultScroll()});t=this.updateBreakdown(t,s)}if(!(t.meta.settings&&t.meta.settings.contentGrouping)){let s=y(f({},t.meta.settings),{contentGrouping:{}});t=this.updateSettings(t,s)}if(t.meta.settings&&t.meta.settings.script){let s=y(f({},t.meta.settings),{script:y(f({},t.meta.settings.script),{events:vE.map(i=>{let a=t.meta.settings.script.events.filter(n=>n.id===i.id);if(a.length!==0){let n=a[0],u=y(f({},i),{active:n.active});return n.items&&(u=y(f({},u),{dits:y(f({},u.dits),{items:n.items})})),n.extra&&(u=y(f({},u),{dits:y(f({},u.dits),{extra:y(f({},n.extra),{identifiers:n.extra.identifiers.split(",")})})})),u}else return i})})});t=this.updateSettings(t,s)}else{let s=y(f({},t.meta.settings),{script:{events:vE}});t=this.updateSettings(t,s)}}return t}updateSettings(e,t){return y(f({},e),{meta:y(f({},e.meta),{settings:t})})}updateBreakdown(e,t){let s=y(f({},e.meta.settings),{breakdown:t});return this.updateSettings(e,s)}addDefaultBreakdown(e){let t={scroll:this.addDefaultScroll(),clicks:this.addDefaultClicks(),time:this.addDefaultTime()};return this.updateBreakdown(e,t)}addDefaultScroll(){return{valueMap:{"0%":"zero","25%":"twentyFive","50%":"fifty","75%":"seventyFive","100%":"exactly100"},filters:[{name:"ga:eventCategory",expressions:""},{name:"ga:eventAction",expressions:""}],value:"ga:eventLabel"}}addDefaultTime(){return{valueMap:{"10s":"b1","30s":"b2","60s":"b3","120s":"b4","240s":"b5"},filters:[{name:"ga:eventCategory",expressions:""},{name:"ga:eventAction",expressions:""}],value:"ga:eventLabel"}}addDefaultClicks(){return{filters:[{name:"ga:eventCategory",expressions:""},{name:"ga:eventAction",expressions:""}],value:"ga:eventLabel"}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var rc=$.endpoints.sources,kE=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Nk,Wm),S(this.store.select(Ra),this.store.select(Ca)),A(([e,t,s])=>{let i=f({},t);return this.appService.get(rc,i).pipe(m(a=>ai(this.formatData(a,i,s))),h(a=>d(as({message:a.message}))))}))),this.fetchMore$=p(()=>this.actions$.pipe(c(Ok),S(this.store.select(Ra),this.store.select(Kk),this.store.select(Ca)),A(([e,t,s,i])=>{let a=y(f({},t),{page:e.data/Ha.size});return this.appService.get(rc,this.setParam(a,s)).pipe(m(n=>jk(this.formatData(n,a,i))),h(n=>d(as({message:n.message}))))}))),this.search$=p(()=>this.actions$.pipe(c(xk),S(this.store.select(Ra),this.store.select(Ca)),A(([e,t,s])=>{if(!e.data)return d(Wm());let i=f({},t);return this.appService.search(rc,this.setParam(i,e.data)).pipe(m(a=>ai(this.formatData(a,i,s))),h(()=>d(as({message:"could not search!"}))))}))),this.save$=p(()=>this.actions$.pipe(c(Uk),S(this.store.select(Da),this.store.select(Bk)),A(([e,t,s])=>{let i={items:t.map(a=>a.connectionId)};return this.appService.update2(`${rc}/${s.id}/connections`,i).pipe(m(()=>oi({data:s})),h(()=>d(as({message:"could not search!"}))))})))}setParam(e,t){return t&&(e=y(f({},e),{searchString:t})),e}formatData(e,t,s){let i=e.data;return s&&(i=e.data.filter(n=>!!n.meta.settings?.script)),{data:i,meta:t}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Od=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(ie({meta:{key:gt}})),this.actions$.pipe(c(se,Se,x),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var jd=$.endpoints.users,wE=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.add$=p(()=>this.actions$.pipe(c(jw),_(e=>this.appService.add(`${jd}/invite`,e.data).pipe(m(t=>t.alreadyInvited?x({message:"This user has already been invited to Momently.",meta:{key:xe}}):sl()),h(t=>d(x({message:t.message,meta:{key:xe}}))))))),this.addSuccess$=p(()=>this.actions$.pipe(c(sl),m(e=>ie({meta:{key:xe}})))),this.update2$=p(()=>this.actions$.pipe(c(Uw),_(e=>this.appService.update(jd,e.data).pipe(m(()=>Ne({data:{id:e.data.orgId,type:e.data.access},meta:{key:xe}})),h(t=>d(x({message:t.message,meta:{key:xe}}))))))),this.remove$=p(()=>this.actions$.pipe(c(xw),S(this.store.select(ye)),_(([e,t])=>{let s={ids:btoa(e.data.orgId).replace(/\+/,"-").replace(/\//g,"_").replace(/=+$/,"")};return this.appService.remove2(jd,s).pipe(m(()=>t.email===e.data.email?ue({data:e.data,redirect:!0,meta:{key:xe}}):ue({data:e.data,meta:{key:xe}})),h(i=>d(x({message:i.message,meta:{key:xe}}))))})))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var xd=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(ie({meta:{key:xe}})),this.actions$.pipe(c(se,Se,x),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Ud=$.endpoints.sub,$E=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Va),A(e=>{let t=`${Ud}/${e.data}`;return this.appService.get(t).pipe(m(s=>Qa(this.formatData(s))),h(s=>d(or({message:s.message}))))}))),this.trial$=p(()=>this.actions$.pipe(c(Gw),S(this.store.select(al),this.store.select(ol),this.store.select(U)),A(([e,t,s,i])=>{let a=`${Ud}/trial`;return this.appService.post(a,this.getParam(t,s,i)).pipe(m(n=>rl({data:n.url})),h(n=>d(or({message:n.message}))))}))),this.sub$=p(()=>this.actions$.pipe(c(zw),S(this.store.select(al),this.store.select(ol),this.store.select(U)),A(([e,t,s,i])=>{let a=`${Ud}`;return this.appService.post(a,this.getParam(t,s,i)).pipe(m(n=>il({data:n.url})),h(n=>d(or({message:n.message}))))}))),this.subSuccess$=p(()=>this.actions$.pipe(c(il,rl),X(e=>{window.location.replace(e.data)})),{dispatch:!1})}formatData(e){return{data:{products:e||[],selectedPriceId:e&&e[0]&&e[0].prices[0].id,selectedProductId:e&&e[0]&&e[0].id},meta:null}}getParam(e,t,s){let i={productId:e,priceId:t};return s.queryParams?.wsId&&(i=y(f({},i),{workspaceId:s.queryParams.wsId})),i}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Gd=(()=>
319{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(Va({data:"products"})),this.actions$.pipe(c(Qa,or),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var V0=$.baseUrl,IE=$.endpoints.workspaces,Q0=$.endpoints.sources,J0=$.endpoints.creators,Y0=$.endpoints.partners,TE=$.localStorage.workspace,EE=$.localStorage.invite,ic=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.router=l(me),this.fetch$=p(()=>this.actions$.pipe(c(so),A(()=>this.appService.get(IE).pipe(m(e=>{let t=localStorage.getItem(TE),s=JSON.parse(t);!s&&e.data.length!==0&&(s=e.data[0]);let i=localStorage.getItem(EE);return kr({data:{workspaces:e.data,workspace:s,token:JSON.parse(i)},group:"workspaces"})}),h(e=>d(Rt({message:e.message}))))))),this.updateSources$=p(()=>this.actions$.pipe(c(kr,Sh),m(()=>$r()))),this.fetchSources$=p(()=>this.actions$.pipe(c($r),S(this.store.select(ar)),A(([e,t])=>{if(t.workspace&&t.workspace.id){let s={workspaceId:t.workspace.id};return this.appService.get(Q0,s).pipe(m(i=>Ec(i)),h(i=>d(Rt({message:i.message}))))}else return d(K())}))),this.updateLocalstorage$=p(()=>this.actions$.pipe(c(Ec,wr),S(this.store.select(ar)),m(([e,t])=>(localStorage.setItem(TE,JSON.stringify(t.workspace)),gh({data:t}))))),this.save$=p(()=>this.actions$.pipe(c(yh),S(this.store.select(Za)),_(([e,t])=>{if(t.state.workspaces.length===0){let s=f({hostWorkspaceId:t.token.hostWorkspaceId,inviteId:t.token.inviteId},t.state.workspace);return this.appService.post(IE,s).pipe(m(i=>wr({data:{workspaces:[i.data],workspace:i.data},group:"workspace",redirect:"/welcome/connect"})),h(i=>d(Rt({message:i.message}))))}else return d(wr({data:{workspaces:t.state.workspaces,workspace:t.state.workspace},group:"workspace",redirect:"/welcome/connect"}))}))),this.saveSuccess$=p(()=>this.actions$.pipe(c(wr),m(e=>e.redirect?Tc({data:e.redirect}):K()))),this.redirect$=p(()=>this.actions$.pipe(c(Tc),X(e=>{this.router.navigate([e.data])})),{dispatch:!1}),this.fetchSocialLink$=p(()=>this.actions$.pipe(c(Ah),S(this.store.select(ar)),A(([e,t])=>{let s={workspaceId:t.workspace.id};return this.appService.get(e.data,s).pipe(m(i=>{window.location.replace(i.member)}),h(i=>d(x({message:i.message,meta:{key:gt}}))))})),{dispatch:!1}),this.connect$=p(()=>this.actions$.pipe(c(vh),S(this.store.select(Za)),_(([e,t])=>{let s={workspaceId:t.state.workspace.id};if(t.token){let i=this.appService.post(`${J0}`,this.formatPayload(t),s),a=this.appService.post(`${Y0}`,this.formatPayload(t),s);return Wi([i,a]).pipe(m(([n,u])=>Mc()),h(n=>d(Rt({message:n.message}))))}else return d(Rt({message:"No Invite Token!"}))}))),this.connectSuccess$=p(()=>this.actions$.pipe(c(Mc),S(this.store.select(Za)),m(([e,t])=>{localStorage.removeItem(EE),window.location.replace(`${V0}${t.state.workspace.slug}/partners`)})),{dispatch:!1})}formatPayload(e){return{dataSourceIds:e.selected.map(s=>s.id),hostWorkspaceId:e.token.hostWorkspaceId,inviteId:e.token.inviteId,access:e.access}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Kd=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(so()),this.actions$.pipe(c(kr,Rt),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Bd=$.endpoints.workspaces,qd=(()=>{class r{constructor(){this.actions$=l(w),this.appService=l(E),this.loadingOn$=p(()=>this.actions$.pipe(c(ui),m(e=>Ht({data:!0})))),this.loadingOff$=p(()=>this.actions$.pipe(c(gi,kt),m(e=>Ht({data:!1})))),this.fetch$=p(()=>this.actions$.pipe(c(ui),A(e=>{let t=e.includeDeleted?{includeDeleted:!0}:void 0;return this.appService.get(Bd,t).pipe(m(s=>gi(s)),h(s=>d(kt({message:s.message}))))}))),this.restore$=p(()=>this.actions$.pipe(c(Qw),_(e=>{let{id:t}=e.data;return this.appService.post(`${Bd}/${t}/restore`,{},{params:{workspaceId:t}}).pipe(m(()=>Jw({data:{id:t}})),h(s=>d(kt({message:s.message}))))}
319))),this.getSession$=p(()=>this.actions$.pipe(c(Hw),A(()=>this.appService.get("stripe").pipe(m(t=>Vw(t)),h(t=>d(kt({message:"error!"}))))))),this.add$=p(()=>this.actions$.pipe(c(qw),_(e=>this.appService.add(Bd,e.data).pipe(m(t=>t.exists?kt({message:"This workspace name exists. Please choose a different one."}):Ww(t)),h(t=>d(kt({message:t.message})))))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var Wd=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w)}resolve(e){return this.store.dispatch(ui({})),this.actions$.pipe(c(gi,kt),z())}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();function DE(r){return[Q(yS,AS),Q(wS,$S),Q(gw,Sw),Q(uy,gy),Q(Lu,_u),Q(hI,uI),Q($I,II),Q(Mw,Dw),...r?.states??[],he([ZT,mE,cE,fE,SE,dE,sE,uE,nE,SI,MI,oE,aE,...r?.effects??[]])]}var RE=[{path:"404",loadComponent:()=>import("./chunk-KMAGRW7B.js")},{path:"unavailable",loadComponent:()=>import("./chunk-DWOV2GC7.js")},{path:"design-preview",loadComponent:()=>import("./chunk-OJDNG4SJ.js")},{path:"agent/:slug",title:"Momently Agent",loadComponent:()=>import("./chunk-ZBOAU5FD.js")},{path:"review/:reviewId",loadComponent:()=>import("./chunk-X6WP5GB3.js")},{path:"auth",loadComponent:()=>import("./chunk-5EGFNFXW.js"),resolve:[ed],children:[{path:"",redirectTo:"signup",pathMatch:"full"},{path:"signup",loadComponent:()=>import("./chunk-YETTP6UO.js"),canActivate:[td],data:{animation:1}},{path:"login",loadComponent:()=>import("./chunk-E2Y5KAQC.js"),data:{animation:2}},{path:"forgot",loadComponent:()=>import("./chunk-R4YP3AJC.js"),data:{animation:3}},{path:"verify",loadComponent:()=>import("./chunk-K34V2LXW.js"),data:{animation:4}},{path:"reset",loadComponent:()=>import("./chunk-RO3HRJKV.js"),data:{animation:5}}],providers:[qI,cI,td,ed]},{path:"connecting/:workspaceId/:channelId",loadComponent:()=>import("./chunk-AP6FKMUT.js"),providers:[he([_T])]},{path:"invite",loadComponent:()=>import("./chunk-OEU6MQM7.js"),resolve:[fs],canActivate:[Sd],providers:[Sd,he([$T])]},{path:"portal",loadComponent:()=>import("./chunk-23RYLQPQ.js"),resolve:[Md],providers:[Md]},{path:"subscribe",loadComponent:()=>import("./chunk-JEUSFYWB.js"),resolve:[fs],providers:[Q(Kw,Bw),he([$E])],children:[{path:"",loadComponent:()=>import("./chunk-OYZ4SWSW.js"),resolve:[Gd],providers:[Gd],data:{animation:1}},{path:"contact",loadComponent:()=>import("./chunk-WEN6TXJX.js"),data:{animation:2}},{path:"workspace",loadComponent:()=>import("./chunk-LQYD4DIT.js"),data:{animation:3}}]},{path:"welcome",resolve:[fs],children:[{path:"",loadComponent:()=>import("./chunk-GQXHOWSS.js"),resolve:[Kd],providers:[Kd,Q(Ja,Ya),Q(nl,cl),he([ic,qd])],children:[{path:"",redirectTo:"workspaces",pathMatch:"full"},{path:"workspaces",loadComponent:()=>import("./chunk-UWBJYFRD.js")},{path:"connect",loadComponent:()=>import("./chunk-52M6TIEU.js")},{path:"sources",loadComponent:()=>import("./chunk-E4BCULQE.js")}]}]},{path:"reports",redirectTo:""},{path:"",loadComponent:()=>import("./chunk-CXFAQ2G3.js"),resolve:[fs],providers:[Q(Uu,Gu),Q(UA,GA),Q(Cy,Py),Q(Zp,Xp),Q(nl,cl),Q(Rp,Cp),he([nI,zI,AI,yy,KI,RI,Xl,qd,Wl])],children:[{path:"",pathMatch:"full",redirectTo:"workspaces"},{path:"workspaces",loadComponent:()=>import("./chunk-HPUE47ZT.js"),resolve:[Wd],providers:[Wd]},{path:":workspaceId",loadComponent:()=>import("./chunk-UUUR6EDI.js"),resolve:[zl],providers:[zl,Q(ce,pp),Q(rt,QA),Q(Gt,tw),Q(Ot,nv),Q($y,Iy),Q(Le,vp),Q(Ly),Q($e,Jy),Q(Db,Rb),Q(Mu,Du),Q(uk,gk),he([DI,pI,OT,jT,xT])],children:[{path:"campaigns",providers:[he([NI,Vl,xI,wT,HI,kT,bd,kd,vd,wd,QI,ZI,YI,JT,ST,vT,AT,nd])],children:[{path:"",loadComponent:()=>import("./chunk-M4Y64IEY.js"),resolve:[sd],providers:[sd]},{path:"groups",loadComponent:()=>import("./chunk-NT53LYAX.js"),resolve:[gd],providers:[gd]},{path:"clients",loadComponent:()=>import("./chunk-ODKUIDXK.js"),resolve:[od],providers:[od]}]},{path:"optimize",providers:[Q(er,ik),he([ET,RT,CT,PT]),zn],children:[{path:"",loadComponent:()=>import("./chunk-XY2B3SJ4.js"),resolve:[zn]},{path:":pageId",loadComponent:()=>import("./chunk-QBM6NYHV.js"),resolve:[zn]}]},{path:"creators",providers:[he([tT,eT,sT,nd])],children:[{path:"",loadComponent:()=>import("./chunk-IDXEMI6Z.js"),resolve:[ad],providers:[ad]},{path:"invites",loadComponent:()=>
319import("./chunk-PK7SK5WF.js"),resolve:[cd],providers:[cd]}]},{path:"partners",loadComponent:()=>import("./chunk-ESTZDRHF.js"),resolve:[Id],providers:[Id,he([WT,BT,HT,qT])]},{path:"settings",providers:[Q(Gk,zk),Q(Nw),he([yE,kE,zT,AE,bE,wE,Ow]),...DE()],children:[{path:"",redirectTo:"workspace",pathMatch:"full"},{path:"workspace",loadComponent:()=>import("./chunk-PRAD3NZI.js"),resolve:[_d],providers:[_d]},{path:"sources",loadComponent:()=>import("./chunk-GQXD7YPM.js"),resolve:[Od],providers:[Od]},{path:"users",loadComponent:()=>import("./chunk-QSNNOLWV.js"),resolve:[xd],providers:[xd]},{path:"reports",loadComponent:()=>import("./chunk-BMVKD6XO.js")}]},{path:"links",loadComponent:()=>import("./chunk-AD7ZETOK.js"),resolve:[Ad],providers:[Ad,Q(wa,jb),he([LT])]},{path:"explore",resolve:[ud],providers:[ud,Vs,Q(CA,PA),Q(Qv,Jv),Q(wv,$v),Q(cb,pb),he([jI,mT,dT,oT,nT,zv,pT,cT,uT,hT,rT,fT])],children:[{path:"",loadComponent:()=>import("./chunk-FLZGDP6D.js")},{path:":dashboardId/pdf",loadComponent:()=>import("./chunk-AMS3OAO3.js"),resolve:[hd],providers:[hd,he([Aa])]},{path:":dashboardName/:dashboardId",loadComponent:()=>import("./chunk-KESTXCCW.js"),resolve:[Ci],providers:[Ci,he([Aa])]},{path:":dashboardId",loadComponent:()=>import("./chunk-KESTXCCW.js"),resolve:[Ci],providers:[Ci,he([Aa])]},{path:"card/:dashboardId/:cardId",loadComponent:()=>import("./chunk-ZAP2WZAX.js"),resolve:[dd],providers:[dd]}]}]}]},{path:":workspaceId",resolve:[Rd],providers:[Rd,Q(ce,pp),Q(Le,vp),he([Vl,bd,kd,vd,wd]),...DE({states:[Q(Rp,Cp),Q(Zp,Xp)],effects:[pE,XT,Wl,Xl,tE]})],children:[{path:":groupName/:groupId/group",resolve:[Ni],providers:[Ni],loadComponent:()=>import("./chunk-3D5IFRWL.js")},{path:":groupName/:groupId/group/pdf",loadComponent:()=>import("./chunk-I3BTDVCN.js"),resolve:[It],providers:[It]},{path:":groupId/group",resolve:[Ni],providers:[Ni],loadComponent:()=>import("./chunk-3D5IFRWL.js")},{path:":groupId/pdf",loadComponent:()=>import("./chunk-I3BTDVCN.js"),resolve:[It],providers:[It]},{path:":advertiserName/:campaignName/:reportId",loadComponent:()=>import("./chunk-MXVEIP5U.js"),resolve:[Tt],providers:[Tt]},{path:":advertiserName/:campaignName/:reportId/pdf",loadComponent:()=>import("./chunk-I3BTDVCN.js"),resolve:[It],providers:[It]},{path:":advertiserName/:campaignName/:reportId/highlight",loadComponent:()=>import("./chunk-W23BE2EB.js"),resolve:[ji],providers:[ji]},{path:":advertiserName/:campaignName/:reportId/print",loadComponent:()=>import("./chunk-F47J7A5Q.js"),resolve:[Tt],providers:[Tt]},{path:":reportId",loadComponent:()=>import("./chunk-MXVEIP5U.js"),resolve:[Tt],providers:[Tt]},{path:":reportId/pdf",loadComponent:()=>import("./chunk-I3BTDVCN.js"),resolve:[It],providers:[It]},{path:":reportId/highlight",loadComponent:()=>import("./chunk-W23BE2EB.js"),resolve:[ji],providers:[ji]},{path:":reportId/print",loadComponent:()=>import("./chunk-F47J7A5Q.js"),resolve:[Tt],providers:[Tt]}]},{path:"**",redirectTo:"/404"}];var CE=(()=>{class r{constructor(){this.router=l(me)}getData(e){let s=e.tokens.idToken.payload;return{user:{id:s["cognito:username"],name:s.name,email:s.email,picture:s.picture,isAdmin:s["custom:isAdmin"]?s["custom:isAdmin"]:!1}
319}}autoSignIn(){return ge(Lr()).pipe(m(e=>this.getData(e)),h(e=>Me(()=>e)))}signIn(e){return ge(hu(e)).pipe(A(t=>t.isSignedIn?ge(Lr()):Me(()=>new Error("User not validated"))),h(t=>Me(()=>t)))}federatedSignIn(e){return Bc({provider:e})}signUp(e){return ge(uu(e)).pipe(m(t=>e.username),h(t=>Me(()=>t)))}resendSignUp(e){return ge(yu({username:e})).pipe(m(t=>t),h(t=>Me(()=>t)))}verify(e){return ge(Kc({username:e.username,confirmationCode:e.code})).pipe(m(t=>t),h(t=>Me(()=>t)))}signOut(){return ge(Au()).pipe(m(e=>e),h(e=>Me(()=>e)))}check(e){return ge(Kc({username:e,confirmationCode:"000000",options:{forceAliasCreation:!1}})).pipe(m(()=>!0),h(s=>{switch(console.error("Error during confirmation:",s),s.name){case"UserNotFoundException":return console.warn("User not found. Returning true."),d(!0);case"NotAuthorizedException":return console.warn("User not authorized. Redirecting to sign-up."),d(this.router.createUrlTree(["/auth/signup"]));case"AliasExistsException":case"CodeMismatchException":case"ExpiredCodeException":return console.warn("Code issue or alias exists. Redirecting to login."),d(this.router.createUrlTree(["/auth/login"]));default:return console.error("Unexpected error:",s),d(this.router.createUrlTree(["/auth/login"]))}}))}forgot(e){return ge(gu({username:e.username})).pipe(m(t=>e),h(t=>Me(()=>t)))}reset(e){return ge(Su({username:e.username,confirmationCode:e.code,newPassword:e.newPassword})).pipe(m(t=>t),h(t=>Me(()=>t)))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var LE=$.localStorage.invite;function PE(r){let o={user:r.user,token:r.token,redirect:"/"};return localStorage.getItem(LE)&&(o.redirect="/invite"),o}var _E=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.router=l(me),this.authService=l(CE),this.snackBar=l(we),this.ngZone=l(vs),this.init$=p(()=>this.actions$.pipe(c(oo),S(this.store.select(U)),m(([e,t])=>Cc()))),this.initSuccess$=p(()=>this.actions$.pipe(c(Cc),S(this.store.select(U)),A(([e,t])=>this.authService.autoSignIn().pipe(m(s=>yt(PE(s))),h(s=>d(pt())))))),this.signUp$=p(()=>this.actions$.pipe(c(Dh),_(e=>this.authService.signUp(e.data).pipe(m(t=>Pc({data:t})),h(t=>d(Qt({message:t.message}))))))),this.signUpSuccess$=p(()=>this.actions$.pipe(c(Pc),X(e=>{this.router.navigate(["/auth/verify"],{queryParams:{u:e.data}})})),{dispatch:!1}),this.verify$=p(()=>this.actions$.pipe(c(Rh),_(e=>this.authService.verify(e.data).pipe(m(()=>Ch()),h(t=>d(Qt({message:t.message}))))))),this.resendSignUp$=p(()=>this.actions$.pipe(c(Ph),_(e=>this.authService.resendSignUp(e.data).pipe(m(()=>(this.snackBar.open("code resent successfully","Dismiss",{duration:1e4}),K())),h(t=>d(Qt({message:t.message}))))))),this.signIn$=p(()=>this.actions$.pipe(c(Lh),_(e=>this.authService.signIn(e.data).pipe(m(t=>yt(PE(t))),h(t=>d(Qt({message:t.message}))))))),this.signInSuccess$=p(()=>this.actions$.pipe(c(yt),X(e=>{e.redirect&&this.router.navigate([e.redirect])})),{dispatch:!1}),this.federatedSignIn$=p(()=>this.actions$.pipe(c(_h),X(e=>{this.authService.federatedSignIn(e.data)})),{dispatch:!1}),this.autoSignIn$=p(()=>this.actions$.pipe(c(ao),S(this.store.select(U)),A(([e,t])=>this.authService.autoSignIn().pipe(m(s=>yt({user:s.user,token:s.token})),h(()=>{let s="/auth";return t.url.includes("/explore")?d(pt()):d(Tr({data:s}))}))))),this.autoSignIn2$=p(()=>this.actions$.pipe(c(no),A(()=>this.authService.autoSignIn().pipe(m(e=>Ir({user:e.user,token:e.token})),h(()=>d(pt())))))),this.signInSuccessReport$=p(()=>this.actions$.pipe(c(Ir),S(this.store.select(So)),m(([e,t])=>{let s=t.state.url.split("?")[0].split("/");return s[s.length-1]==="highlight"?eo():Xi()}))),this.signOut$=p(()=>this.actions$.pipe(c(co),_(e=>this.authService.signOut().pipe(m(()=>Lc()),h(t=>d(Qt({message:t.message}))))))),this.forgot$=p(()=>this.actions$.pipe(c(Fh),_(e=>this.authService.forgot(e.data).pipe(m(t=>_c({data:t})),h(t=>d(Qt({message:t.message}))))))),this.forgotSuccess$=p(()=>this.actions$.pipe(c(_c),X(e=>{setTimeout(()=>{e.data.resend?this.snackBar.open("code resent successfully","Dismiss",{duration:1e4}):this.router.navigate(["/auth/reset"],{queryParams:{u:e.data.username}})},0)})),{dispatch:!1}),this.reset$=p(()=>this.actions$.pipe(c(Nh),_(e=>this.authService.reset(e.data).pipe(m(()=>Oh()),h(t=>d(Fc({message:t.message}))))))),this.resetError$=p(()=>this.actions$.pipe(c(Fc),X(e=>{setTimeout(()=>this.snackBar.openFromComponent(Yw,{data:e.message}),0)})),{dispatch:!1}),this.redirect$=p(()=>this.actions$.pipe(c(Tr),X(e=>{this.router.navigate([e.data])})),{dispatch:!1}),this.signOutSuccess$=p(()=>this.actions$.pipe(c(Lc),X(e=>{localStorage.clear(),this.router.navigate(["/auth/login"])})),{dispatch:!1}),lu.listen("auth",({payload:{event:e,data:t}})=>
319{e==="signIn"&&(localStorage.getItem(LE)?this.ngZone.run(()=>this.router.navigate(["/invite"])).then():this.ngZone.run(()=>this.router.navigate(["/"])).then())})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var FE=(()=>{class r{constructor(){this.store=l(I),this.actions$=l(w),this.appService=l(E),this.router=l(me),this.fetch$=p(()=>this.actions$.pipe(c(yk),A(e=>this.appService.get(e.data.endpoint).pipe(m(t=>Pm({data:t,group:e.data.id})),h(t=>d(Ut({message:t.message}))))))),this.fetch2$=p(()=>this.actions$.pipe(c(Sk),S(this.store.select(Um),this.store.select(ar)),A(([e,t,s])=>{if(t&&t[e.data.id])return d(K());{let i={};return s&&(i={workspaceId:s.workspace.id}),this.appService.get(e.data.endpoint,i).pipe(m(a=>Pm({data:a,group:e.data.id})),h(a=>d(Ut({message:a.message}))))}}))),this.add$=p(()=>this.actions$.pipe(c(Ak),S(this.store.select(Um)),A(([e,t])=>{let s=[],i=e.data.id;return t[i].map(a=>{a.selected&&s.push(a.id)}),this.appService.post(e.data.endpoint,{ids:s}).pipe(m(a=>ii()),h(a=>d(Ut({message:a.message}))))}))),this.add2$=p(()=>this.actions$.pipe(c(vk),S(this.store.select(Dk)),A(([e,t])=>{let s=t;return this.appService.post(e.data.endpoint,{ids:s}).pipe(m(i=>Fm({data:"ga"})),h(i=>d(Ut({message:i.message}))))}))),this.add3$=p(()=>this.actions$.pipe(c(_m),A(e=>this.appService.post(e.data.endpoint,e.data.payload).pipe(m(()=>ii()),h(t=>d(Ut({message:t.message}))))))),this.addAuth$=p(()=>this.actions$.pipe(c(bk),A(e=>this.appService.postExternal(e.data.api,e.data.payload).pipe(m(t=>_m({data:{endpoint:e.data.endpoint,payload:t}})),h(t=>d(Ut({message:t.message}))))))),this.addSuccess$=p(()=>this.actions$.pipe(c(ii),m(()=>Lm()))),this.addSuccessAfter$=p(()=>this.actions$.pipe(c(Lm),S(this.store.select(U)),N(([e,t])=>t.params.workspaceId?(this.router.navigate([`/${t.params.workspaceId}/settings/sources`]),[ie({meta:{key:gt}}),$s()]):(this.router.navigate(["/welcome/connect"]),[$r()])))),this.pollingIntervalMs=1500,this.isPollingActive=!1,this.poll$=p(()=>this.actions$.pipe(c(Fm),A(e=>(this.isPollingActive=!0,Wt(0,this.pollingIntervalMs).pipe(Tf(()=>this.isPollingActive),m(()=>e),A(t=>this.appService.get(`sources/${t.data}/status`).pipe(m(s=>s.done?Nm():kk({data:s.status})),h(s=>d(Ut({message:"poll error"})))))))))),this.pollSuccess$=p(()=>this.actions$.pipe(c(Nm),m(()=>(this.isPollingActive=!1,ii()))))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var X0=$.endpoints.payment,NE=(()=>{class r{constructor(){this.actions$=l(w),this.appService=l(E),this.fetch$=p(()=>this.actions$.pipe(c(Wn),A(e=>{let t={};return this.appService.get(`${X0}`,t).pipe(m(s=>Ed({data:s.url})),h(s=>d(VT({message:s.message}))))}))),this.fetchSuccess$=p(()=>this.actions$.pipe(c(Ed),X(e=>{window.location.replace(e.data)})),{dispatch:!1})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();var zi="PERFORM_ACTION",eR="REFRESH",zE="RESET",KE="ROLLBACK",BE="COMMIT",qE="SWEEP",WE="TOGGLE_ACTION",tR="SET_ACTIONS_ACTIVE",HE="JUMP_TO_STATE",VE="JUMP_TO_ACTION",af="IMPORT_STATE",QE="LOCK_CHANGES",JE="PAUSE_RECORDING",Sr=class{constructor(o,e){if(this.action=o,this.timestamp=e,this.type=zi,typeof o.type>"u")throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?')}},Hd=class{constructor(){this.type=eR}},Vd=class{constructor(o){this.timestamp=o,this.type=zE}},Qd=class{constructor(o){this.timestamp=o,this.type=KE}},Jd=class{constructor(o){this.timestamp=o,this.type=BE}},Yd=class{constructor(){this.type=qE}},Zd=class{constructor(o){this.id=o,this.type=WE}};var Xd=class{constructor(o){this.index=o,this.type=HE}},ef=class{constructor(o){this.actionId=o,this.type=VE}},tf=class{constructor(o){this.nextLiftedState=o,this.type=af}},sf=class{constructor(o){this.status=o,this.type=QE}},rf=class{constructor(o){this.status=o,this.type=JE}};var cc=new yr("@ngrx/store-devtools Options"),OE=new yr("@ngrx/store-devtools Initial Config");function YE(){return null}var sR="NgRx Store DevTools";function rR(r){let o={maxAge:!1,monitor:YE,actionSanitizer:void 0,stateSanitizer:void 0,name:sR,serialize:!1,logOnly:!1,autoPause:!1,trace:!1,traceLimit:75,features:{pause:!0,lock:!0,persist:!0,export:!0,import:"custom",jump:!0,skip:!0,reorder:!0,dispatch:!0,test:!0},connectInZone:!1},e=typeof r=="function"?r():r,t=e.logOnly?{pause:!0,export:!0,test:!0}:!1,s=e.features||t||o.features;s.import===!0&&(s.import="custom");let i=Object.assign({},o,{features:s},e);if(i.maxAge&&i.maxAge<2)throw new Error(`Devtools 'maxAge' cannot be less than 2, got ${i.maxAge}`);return i}function jE(r,o){return r.filter(e=>o.indexOf(e)<0)}function ZE(r){let{computedStates:o,currentStateIndex:e}=r;if(e>=o.length){let{state:s}=o[o.length-1];return s}let{state:t}=o[e];return t}function Gi(r){return new Sr(r,+Date.now())}function iR(r,o){return Object.keys(o).reduce((e,t)=>
319{let s=Number(t);return e[s]=XE(r,o[s],s),e},{})}function XE(r,o,e){return y(f({},o),{action:r(o.action,e)})}function oR(r,o){return o.map((e,t)=>({state:eM(r,e.state,t),error:e.error}))}function eM(r,o,e){return r(o,e)}function tM(r){return r.predicate||r.actionsSafelist||r.actionsBlocklist}function aR(r,o,e,t){let s=[],i={},a=[];return r.stagedActionIds.forEach((n,u)=>{let g=r.actionsById[n];g&&(u&&nf(r.computedStates[u],g,o,e,t)||(i[n]=g,s.push(n),a.push(r.computedStates[u])))}),y(f({},r),{stagedActionIds:s,actionsById:i,computedStates:a})}function nf(r,o,e,t,s){let i=e&&!e(r,o.action),a=t&&!o.action.type.match(t.map(u=>xE(u)).join("|")),n=s&&o.action.type.match(s.map(u=>xE(u)).join("|"));return i||a||n}function xE(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sM(r){return{ngZone:r?l(vs):null,connectInZone:r}}var pc=(()=>{class r extends Ji{static{this.\u0275fac=(()=>{let e;return function(s){return(e||(e=bs(r)))(s||r)}})()}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})(),oc={START:"START",DISPATCH:"DISPATCH",STOP:"STOP",ACTION:"ACTION"},of=new yr("@ngrx/store-devtools Redux Devtools Extension"),rM=(()=>{class r{constructor(e,t,s){this.config=t,this.dispatcher=s,this.zoneConfig=sM(this.config.connectInZone),this.devtoolsExtension=e,this.createActionStreams()}notify(e,t){if(this.devtoolsExtension)if(e.type===zi){if(t.isLocked||t.isPaused)return;let s=ZE(t);if(tM(this.config)&&nf(s,e,this.config.predicate,this.config.actionsSafelist,this.config.actionsBlocklist))return;let i=this.config.stateSanitizer?eM(this.config.stateSanitizer,s,t.currentStateIndex):s,a=this.config.actionSanitizer?XE(this.config.actionSanitizer,e,t.nextActionId):e;this.sendToReduxDevtools(()=>this.extensionConnection.send(a,i))}else{let s=y(f({},t),{stagedActionIds:t.stagedActionIds,actionsById:this.config.actionSanitizer?iR(this.config.actionSanitizer,t.actionsById):t.actionsById,computedStates:this.config.stateSanitizer?oR(this.config.stateSanitizer,t.computedStates):t.computedStates});this.sendToReduxDevtools(()=>this.devtoolsExtension.send(null,s,this.getExtensionConfig(this.config)))}}createChangesObservable(){return this.devtoolsExtension?new dc(e=>{let t=this.zoneConfig.connectInZone?this.zoneConfig.ngZone.runOutsideAngular(()=>this.devtoolsExtension.connect(this.getExtensionConfig(this.config))):this.devtoolsExtension.connect(this.getExtensionConfig(this.config));return this.extensionConnection=t,t.init(),t.subscribe(s=>e.next(s)),t.unsubscribe}):Sf}createActionStreams(){let e=this.createChangesObservable().pipe(If()),t=e.pipe(We(g=>g.type===oc.START)),s=e.pipe(We(g=>g.type===oc.STOP)),i=e.pipe(We(g=>g.type===oc.DISPATCH),m(g=>this.unwrapAction(g.payload)),V(g=>g.type===af?this.dispatcher.pipe(We(v=>v.type===yc),Af(1e3),ys(1e3),m(()=>g),h(()=>d(g)),Hi(1)):d(g))),n=e.pipe(We(g=>g.type===oc.ACTION),m(g=>this.unwrapAction(g.payload))).pipe(As(s)),u=i.pipe(As(s));this.start$=t.pipe(As(s)),this.actions$=this.start$.pipe(A(()=>n)),this.liftedActions$=this.start$.pipe(A(()=>u))}unwrapAction(e){return typeof e=="string"?(0,eval)(`(${e})`):e}getExtensionConfig(e){let t={name:e.name,features:e.features,serialize:e.serialize,autoPause:e.autoPause??!1,trace:e.trace??!1,traceLimit:e.traceLimit??75};return e.maxAge!==!1&&(t.maxAge=e.maxAge),t}sendToReduxDevtools(e){try{e()}catch(t){console.warn("@ngrx/store-devtools: something went wrong inside the redux devtools",t)}}static{this.\u0275fac=function(t){return new(t||r)(De(of),De(cc),De(pc))}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})(),nc={type:Sc}
319,nR="@ngrx/store-devtools/recompute",cR={type:nR};function iM(r,o,e,t,s){if(t)return{state:e,error:"Interrupted by an error up the chain"};let i=e,a;try{i=r(e,o)}catch(n){a=n.toString(),s.handleError(n)}return{state:i,error:a}}function ac(r,o,e,t,s,i,a,n,u){if(o>=r.length&&r.length===i.length)return r;let g=r.slice(0,o),v=i.length-(u?1:0);for(let b=o;b<v;b++){let M=i[b],P=s[M].action,D=g[b-1],C=D?D.state:t,F=D?D.error:void 0,q=a.indexOf(M)>-1?D:iM(e,P,C,F,n);g.push(q)}return u&&g.push(r[r.length-1]),g}function pR(r,o){return{monitorState:o(void 0,{}),nextActionId:1,actionsById:{0:Gi(nc)},stagedActionIds:[0],skippedActionIds:[],committedState:r,currentStateIndex:0,computedStates:[],isLocked:!1,isPaused:!1}}function mR(r,o,e,t,s={}){return i=>(a,n)=>{let{monitorState:u,actionsById:g,nextActionId:v,stagedActionIds:b,skippedActionIds:M,committedState:P,currentStateIndex:D,computedStates:C,isLocked:F,isPaused:j}=a||o;a||(g=Object.create(g));function q(re){let Y=re,Z=b.slice(1,Y+1);for(let ee=0;ee<Z.length;ee++)if(C[ee+1].error){Y=ee,Z=b.slice(1,Y+1);break}else delete g[Z[ee]];M=M.filter(ee=>Z.indexOf(ee)===-1),b=[0,...b.slice(Y+1)],P=C[Y].state,C=C.slice(Y),D=D>Y?D-Y:0}function J(){g={0:Gi(nc)},v=1,b=[0],M=[],P=C[D].state,D=0,C=[]}let O=0;switch(n.type){case QE:{F=n.status,O=1/0;break}case JE:{j=n.status,j?(b=[...b,v],g[v]=new Sr({type:"@ngrx/devtools/pause"},+Date.now()),v++,O=b.length-1,C=C.concat(C[C.length-1]),D===b.length-2&&D++,O=1/0):J();break}case zE:{g={0:Gi(nc)},v=1,b=[0],M=[],P=r,D=0,C=[];break}case BE:{J();break}case KE:{g={0:Gi(nc)},v=1,b=[0],M=[],D=0,C=[];break}case WE:{let{id:re}=n;M.indexOf(re)===-1?M=[re,...M]:M=M.filter(Z=>Z!==re),O=b.indexOf(re);break}case tR:{let{start:re,end:Y,active:Z}=n,ee=[];for(let le=re;le<Y;le++)ee.push(le);Z?M=jE(M,ee):M=[...M,...ee],O=b.indexOf(re);break}case HE:{D=n.index,O=1/0;break}case VE:{let re=b.indexOf(n.actionId);re!==-1&&(D=re),O=1/0;break}case qE:{b=jE(b,M),M=[],D=Math.min(D,b.length-1);break}case zi:{if(F)return a||o;if(j||a&&nf(a.computedStates[D],n,s.predicate,s.actionsSafelist,s.actionsBlocklist)){let Y=C[C.length-1];C=[...C.slice(0,-1),iM(i,n.action,Y.state,Y.error,e)],O=1/0;break}s.maxAge&&b.length===s.maxAge&&q(1),D===b.length-1&&D++;let re=v++;g[re]=n,b=[...b,re],O=b.length-1;break}case af:{({monitorState:u,actionsById:g,nextActionId:v,stagedActionIds:b,skippedActionIds:M,committedState:P,currentStateIndex:D,computedStates:C,isLocked:F,isPaused:j}=n.nextLiftedState);break}case Sc:{O=0,s.maxAge&&b.length>s.maxAge&&(C=ac(C,O,i,P,g,b,M,e,j),q(b.length-s.maxAge),O=1/0);break}case yc:{if(C.filter(Y=>Y.error).length>0)O=0,s.maxAge&&b.length>s.maxAge&&(C=ac(C,O,i,P,g,b,M,e,j),q(b.length-s.maxAge),O=1/0);else{if(!j&&!F){D===b.length-1&&D++;let Y=v++;g[Y]=new Sr(n,+Date.now()),b=[...b,Y],O=b.length-1,C=ac(C,O,i,P,g,b,M,e,j)}C=C.map(Y=>y(f({},Y),{state:i(Y.state,cR)})),D=b.length-1,s.maxAge&&b.length>s.maxAge&&q(b.length-s.maxAge),O=1/0}break}default:{O=1/0;break}}return C=ac(C,O,i,P,g,b,M,e,j),u=t(u,n),{monitorState:u,actionsById:g,nextActionId:v,stagedActionIds:b,skippedActionIds:M,committedState:P,currentStateIndex:D,computedStates:C,isLocked:F,isPaused:j}}}var UE=(()=>{class r{constructor(e,t,s,i,a,n,u,g){let v=pR(u,g.monitor),b=mR(u,v,n,g.monitor,g),M=fc(fc(t.asObservable().pipe(Vi(1)),i.actions$).pipe(m(Gi)),e,i.liftedActions$).pipe(yf(gf)),P=s.pipe(m(b)),D=sM(g.connectInZone),C=new uf(1);this.liftedStateSubscription=M.pipe(S(P),GE(D),$f(({state:q},[J,O])=>{let re=O(q,J);return J.type!==zi&&tM(g)&&(re=aR(re,g.predicate,g.actionsSafelist,g.actionsBlocklist)),i.notify(J,re),{state:re,action:J}},{state:v,action:null})).subscribe(({state:q,action:J})=>{if(C.next(q),J.type===zi){let O=J.action;a.next(O)}}),this.extensionStartSubscription=i.start$.pipe(GE(D)).subscribe(()=>{this.refresh()});let F=C.asObservable(),j=F.pipe(m(ZE));Object.defineProperty(j,"state",{value:Hf(j,{manualCleanup:!0,requireSync:!0})}),this.dispatcher=e,this.liftedState=F,this.state=j}ngOnDestroy(){this.liftedStateSubscription.unsubscribe(),this.extensionStartSubscription.unsubscribe()}dispatch(e){this.dispatcher.next(e)}next(e){this.dispatcher.next(e)}error(e){}complete(){}performAction(e){this.dispatch(new Sr(e,+Date.now()))}refresh(){this.dispatch(new Hd)}reset(){this.dispatch(new Vd(+Date.now()))}rollback(){this.dispatch(new Qd(+Date.now()))}commit(){this.dispatch(new Jd(+Date.now()))}sweep(){this.dispatch(new Yd)}toggleAction(e){this.dispatch(new Zd(e))}jumpToAction(e){this.dispatch(new ef(e))}jumpToState(e){this.dispatch(new Xd(e))}importState(e){this.dispatch(new tf(e))}lockChanges(e){this.dispatch(new sf(e))}pauseRecording(e){this.dispatch(new rf(e))}static{this.\u0275fac=function(t){return new(t||r)(De(pc),De(Ji),De(Qf),De(rM),De(Yf),De(Df),De(Vf),De(cc))}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();function GE({ngZone:r,connectInZone:o}){return e=>o?new dc(t=>e.subscribe({next:s=>r.run(()=>t.next(s)),error:s=>r.run(()=>t.error(s)),complete:()=>r.run(()=>t.complete())})):e}var lR=new yr("@ngrx/store-devtools Is Devtools Extension or Monitor Present");function dR(r,o){return!!r||o.monitor!==YE}function fR(){let r="__REDUX_DEVTOOLS_EXTENSION__";return typeof window=="object"&&typeof window[r]<"u"?window[r]:null}function hR(r){return r.state}function oM(r={}){return Ef([rM,pc,UE,{provide:OE,useValue:r},{provide:lR,deps:[of,cc],useFactory:dR},{provide:of,useFactory:fR},{provide:cc,deps:[OE],useFactory:rR},{provide:Zf,deps:[UE],useFactory:hR},{provide:Jf,useExisting:pc}])}var aM={providers:[Ff(),Q$(),{provide:Rf,useValue:"m2"},fs,qf(RE),Xf(Wh,{metaReducers:Hh}),qh(),...Nf()?[oM()]:[],Q(Ja,Ya),Q(Ek,Mk),he([_E,X$,ic,FE,NE]),{provide:Bh,useClass:oI},zf(Kf([eI,iI,rI,tI])),Mf(Jh),{provide:Qh,useValue:{horizontalPosition:"left",verticalPosition:"bottom",duration:2500}}]};var cf=new Nr(new Fr($o));var pf={configure(r,o){let e=du(r),t=new fu({sameSite:"lax"}),s=o?.ssr?t:$o,i=o?.ssr?new Nr(new Fr(t)):cf;if(!e.Auth||o?.Auth){wo.configure(e,o);return}_r.setAuthConfig(e.Auth),_r.setKeyValueStorage(s),wo.configure(e,y(f({},o),{Auth:{tokenProvider:_r,credentialsProvider:i}}))},getConfig(){return wo.getConfig()}};var uR={Auth:{Cognito:{userPoolId:"us-west-2_0fH7QMDy0",userPoolClientId:"5o1l7d7b7c00qiqkkf4n6flgih",loginWith:{oauth:{domain:"auth.momently.com",scopes:["profile","email","openid"],redirectSignIn:[`${$.baseUrl}auth`],redirectSignOut:[`${$.baseUrl}auth/login`],responseType:"code",providers:["Google"]}}}}};pf.configure(uR);$.production&&void 0;document.addEventListener("DOMContentLoaded",()=>{jf(Zw,aM).catch(r=>console.error(r))});
319export{uR as awsConfig};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.