import{$ as K,$a as In,$c as Fs,$d as tl,$e as lt,$g as U,$i as br,Aa as Ut,Ac as W,Ad as Js,Ae as pl,Af as Xt,Ag as mr,Aj as fi,B as Lo,Ba as a,Bc as Rs,Be as dl,Bg as Ce,Bi as ri,C as Ke,Ca as l,Cc as ee,Cd as Jo,Ci as vr,Cj as Vl,D as J,Da as x,Db as va,Dc as ht,Dd as xa,Df as Bi,Dh as wl,Di as Tl,E as it,Ea as M,Ed as Zs,Ee as ml,Ef as sr,Ei as tt,F as ke,Fa as S,Fb as ce,Fd as ya,Fg as ur,G as di,Ga as tn,Gb as j,Gc as Ii,Gd as Zo,Gh as gr,H as qo,Ha as k,Hb as R,Hc as Oe,Hd as ka,He as rr,Hf as be,Hg as mt,I as Wo,Ia as xs,Ic as ue,Id as er,If as Ai,J as P,Ja as ha,Jc as gt,Jd as tr,Je as ul,Jf as lr,Jg as _r,Ji as Dl,K as Z,Ka as b,Kc as ft,Ke as ve,Kf as cr,Kg as ut,L as Fe,La as ga,Lb as _o,Lc as Go,Le as Je,Lf as Wn,M as fs,Ma as m,Mb as ws,Mc as Be,Md as _i,Mf as pr,Mg as an,Mh as sn,Na as Qo,Nb as kt,Nc as Ei,Nd as vt,Nf as Un,Ni as Ol,Nj as Rl,O as wn,Oa as mi,Oi as gi,P as f,Pa as we,Pb as Ss,Pc as ui,Pd as qe,Pf as dr,Pi as Bl,Pj as Cr,Q as v,Qa as fa,Qd as wt,Qe as _l,Qf as vl,Qj as Nl,R as He,Ra as Mn,Rb as Ms,Rc as Ko,Rd as wa,Rf as zn,Rj as Fl,S as ki,Sa as nn,Sb as Xe,Sc as zt,Sd as bt,Sf as Jt,Si as Al,T as uo,Ta as A,Tb as Is,Tf as jn,Tg as Sa,Th as Sl,U as wi,Ua as D,Ub as de,Uc as ho,V as L,Va as O,Vc as Ns,Vf as Vi,Vh as fr,W as Sn,Wa as V,Wd as rt,Wf as Zt,Wg as Ma,Wh as Ml,X as Bt,Xa as p,Xc as Dn,Xd as St,Xf as Qn,Xh as Il,Ya as w,Yc as Ye,Yd as el,Z as ua,Za as g,Zc as Ge,Zd as Pi,Ze as ar,_ as Uo,_a as Q,_c as ba,_d as Ti,_e as hl,a as xn,aa as vs,ab as En,ad as Ls,bb as Ie,bd as qs,be as ae,bf as Nn,bh as bl,c as xt,ca as o,cb as Ee,cd as Ws,ce as at,cf as jt,da as y,db as Pe,dd as Us,de as ir,df as ct,dh as F,dk as Ll,ea as bs,eb as Ho,ee as rn,ef as pt,eh as ni,fa as zo,fb as Pn,fe as nr,ff as Mt,fh as N,fk as ql,g as ms,gd as zs,ge as il,gf as Fn,h as Ji,hb as X,hc as Es,hd as $o,hf as dt,hh as H,hi as oi,ia as Cs,ib as re,ic as Si,id as on,ie as nl,if as Qt,ii as Ni,j as us,jb as Tn,jc as Ps,jd as js,je as Di,jf as Ht,jg as Ue,jh as Cl,ji as Fi,k as Zi,kb as ys,kd as Qs,ke as nt,kf as Yt,kj as Ae,la as Lt,lb as Yo,ld as Hs,le as ol,lf as gl,lg as Et,li as Li,mc as Mi,md as Ys,me as rl,mf as fl,mg as Ri,mi as qi,na as h,nb as ks,nc as Ts,ne as or,nf as Ln,o as pi,od as Gs,oe as On,oi as Wi,pa as yt,pb as d,pd as Ks,pf as $,pi as Gn,q as yn,qa as c,qb as u,qd as Ca,qe as Bn,qf as Ze,r as _s,ra as _a,rb as T,rc as Ds,re as al,rf as Gt,rg as ei,ri as Ui,sa as E,sb as te,sc as Os,sd as $s,se as An,sg as Hn,sh as xl,si as Kn,td as Xs,tf as Kt,tg as ti,th as yl,ua as jo,ub as ne,ue as Vn,uf as It,ug as ii,uh as kl,ui as zi,v as en,vc as Bs,vd as Le,ve as st,vf as qn,vi as $n,w as kn,wa as $e,wd as Xo,we as Rn,wf as We,wg as Yn,wh as _e,wk as Ia,x as hs,xa as qt,xc as As,xd as go,xe as sl,xf as Oi,xi as Xn,xj as Re,y as gs,yc as fe,ye as ll,yf as $t,yg as Pt,yh as hr,yi as El,yj as ji,za as Wt,zb as Se,zc as Vs,ze as cl,zf as Te,zg as Tt,zh as et,zi as Pl,zj as ai}from"./chunk-NW24GUC3.js";import{a as hi}from"./chunk-FMLBBWJJ.js";import{a as ot,b as Cn,e as le,g as Me,h as z}from"./chunk-WWX6BADO.js";var Zl=le((Nw,Jl)=>{Jl.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Hi=le(cn=>{var Da,l0=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];cn.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17};cn.getSymbolTotalCodewords=function(r){return l0[r]};cn.getBCHDigit=function(i){let r=0;for(;i!==0;)r++,i>>>=1;return r};cn.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');Da=r};cn.isKanjiModeEnabled=function(){return typeof Da<"u"};cn.toSJIS=function(r){return Da(r)}});var Dr=le(Ot=>{Ot.L={bit:1};Ot.M={bit:0};Ot.Q={bit:3};Ot.H={bit:2};function c0(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return Ot.L;case"m":case"medium":return Ot.M;case"q":case"quartile":return Ot.Q;case"h":case"high":return Ot.H;default:throw new Error("Unknown EC Level: "+i)}}Ot.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4};Ot.from=function(r,e){if(Ot.isValid(r))return r;try{return c0(r)}catch{return e}}});var ic=le((qw,tc)=>{function ec(){this.buffer=[],this.length=0}ec.prototype={get:function(i){let r=Math.floor(i/8);return(this.buffer[r]>>>7-i%8&1)===1},put:function(i,r){for(let e=0;e<r;e++)this.putBit((i>>>r-e-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(i){let r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),i&&(this.buffer[r]|=128>>>this.length%8),this.length++}};tc.exports=ec});var oc=le((Ww,nc)=>{function Co(i){if(!i||i<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=i,this.data=new Uint8Array(i*i),this.reservedBit=new Uint8Array(i*i)}Co.prototype.set=function(i,r,e,n){let t=i*this.size+r;this.data[t]=e,n&&(this.reservedBit[t]=!0)};Co.prototype.get=function(i,r){return this.data[i*this.size+r]};Co.prototype.xor=function(i,r,e){this.data[i*this.size+r]^=e};Co.prototype.isReserved=function(i,r){return this.reservedBit[i*this.size+r]};nc.exports=Co});var rc=le(Or=>{var p0=Hi().getSymbolSize;Or.getRowColCoords=function(r){if(r===1)return[];let e=Math.floor(r/7)+2,n=p0(r),t=n===145?26:Math.ceil((n-13)/(2*e-2))*2,s=[n-7];for(let _=1;_<e-1;_++)s[_]=s[_-1]-t;return s.push(6),s.reverse()};Or.getPositions=function(r){let e=[],n=Or.getRowColCoords(r),t=n.length;for(let s=0;s<t;s++)for(let _=0;_<t;_++)s===0&&_===0||s===0&&_===t-1||s===t-1&&_===0||e.push([n[s],n[_]]);return e}});var lc=le(sc=>{var d0=Hi().getSymbolSize,ac=7;sc.getPositions=function(r){let e=d0(r);return[[0,0],[e-ac,0],[0,e-ac]]}});var cc=le(he=>{he.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var pn={N1:3,N2:3,N3:40,N4:10};he.isValid=function(r){return r!=null&&r!==""&&!isNaN(r)&&r>=0&&r<=7};he.from=function(r){return he.isValid(r)?parseInt(r,10):void 0};he.getPenaltyN1=function(r){let e=r.size,n=0,t=0,s=0,_=null,C=null;for(let I=0;I<e;I++){t=s=0,_=C=null;for(let B=0;B<e;B++){let Y=r.get(I,B);Y===_?t++:(t>=5&&(n+=pn.N1+(t-5)),_=Y,t=1),Y=r.get(B,I),Y===C?s++:(s>=5&&(n+=pn.N1+(s-5)),C=Y,s=1)}t>=5&&(n+=pn.N1+(t-5)),s>=5&&(n+=pn.N1+(s-5))}return n};he.getPenaltyN2=function(r){let e=r.size,n=0;for(let t=0;t<e-1;t++)for(let s=0;s<e-1;s++){let _=r.get(t,s)+r.get(t,s+1)+r.get(t+1,s)+r.get(t+1,s+1);(_===4||_===0)&&n++}return n*pn.N2};he.getPenaltyN3=function(r){let e=r.size,n=0,t=0,s=0;for(let _=0;_<e;_++){t=s=0;for(let C=0;C<e;C++)t=t<<1&2047|r.get(_,C),C>=10&&(t===1488||t===93)&&n++,s=s<<1&2047|r.get(C,_),C>=10&&(s===1488||s===93)&&n++}return n*pn.N3};he.getPenaltyN4=function(r){let e=0,n=r.data.length;for(let s=0;s<n;s++)e+=r.data[s];return Math.abs(Math.ceil(e*100/n/5)-10)*pn.N4};function m0(i,r,e){switch(i){case he.Patterns.PATTERN000:return(r+e)%2===0;case he.Patterns.PATTERN001:return r%2===0;case he.Patterns.PATTERN010:return e%3===0;case he.Patterns.PATTERN011:return(r+e)%3===0;case he.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(e/3))%2===0;case he.Patterns.PATTERN101:return r*e%2+r*e%3===0;case he.Patterns.PATTERN110:return(r*e%2+r*e%3)%2===0;case he.Patterns.PATTERN111:return(r*e%3+(r+e)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}he.applyMask=function(r,e){let n=e.size;for(let t=0;t<n;t++)for(let s=0;s<n;s++)e.isReserved(s,t)||e.xor(s,t,m0(r,s,t))};he.getBestMask=function(r,e){let n=Object.keys(he.Patterns).length,t=0,s=1/0;for(let _=0;_<n;_++){e(_),he.applyMask(_,r);let C=he.getPenaltyN1(r)+he.getPenaltyN2(r)+he.getPenaltyN3(r)+he.getPenaltyN4(r);he.applyMask(_,r),C<s&&(s=C,t=_)}return t}});var Ba=le(Oa=>{var Yi=Dr(),Br=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Ar=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Oa.getBlocksCount=function(r,e){switch(e){case Yi.L:return Br[(r-1)*4+0];case Yi.M:return Br[(r-1)*4+1];case Yi.Q:return Br[(r-1)*4+2];case Yi.H:return Br[(r-1)*4+3];default:return}};Oa.getTotalCodewordsCount=function(r,e){switch(e){case Yi.L:return Ar[(r-1)*4+0];case Yi.M:return Ar[(r-1)*4+1];case Yi.Q:return Ar[(r-1)*4+2];case Yi.H:return Ar[(r-1)*4+3];default:return}}});var pc=le(Rr=>{var xo=new Uint8Array(512),Vr=new Uint8Array(256);(function(){let r=1;for(let e=0;e<255;e++)xo[e]=r,Vr[r]=e,r<<=1,r&256&&(r^=285);for(let e=255;e<512;e++)xo[e]=xo[e-255]})();Rr.log=function(r){if(r<1)throw new Error("log("+r+")");return Vr[r]};Rr.exp=function(r){return xo[r]};Rr.mul=function(r,e){return r===0||e===0?0:xo[Vr[r]+Vr[e]]}});var dc=le(yo=>{var Aa=pc();yo.mul=function(r,e){let n=new Uint8Array(r.length+e.length-1);for(let t=0;t<r.length;t++)for(let s=0;s<e.length;s++)n[t+s]^=Aa.mul(r[t],e[s]);return n};yo.mod=function(r,e){let n=new Uint8Array(r);for(;n.length-e.length>=0;){let t=n[0];for(let _=0;_<e.length;_++)n[_]^=Aa.mul(e[_],t);let s=0;for(;s<n.length&&n[s]===0;)s++;n=n.slice(s)}return n};yo.generateECPolynomial=function(r){let e=new Uint8Array([1]);for(let n=0;n<r;n++)e=yo.mul(e,new Uint8Array([1,Aa.exp(n)]));return e}});var _c=le((Gw,uc)=>{var mc=dc();function Va(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}Va.prototype.initialize=function(r){this.degree=r,this.genPoly=mc.generateECPolynomial(this.degree)};Va.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");let e=new Uint8Array(r.length+this.degree);e.set(r);let n=mc.mod(e,this.genPoly),t=this.degree-n.length;if(t>0){let s=new Uint8Array(this.degree);return s.set(n,t),s}return n};uc.exports=Va});var Ra=le(hc=>{hc.isValid=function(r){return!isNaN(r)&&r>=1&&r<=40}});var Na=le(vi=>{var gc="[0-9]+",u0="[A-Z $%*+\\-./:]+",ko="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ko=ko.replace(/u/g,"\\u");var _0="(?:(?![A-Z0-9 $%*+\\-./:]|"+ko+`)(?:.|[\r
]))+`;vi.KANJI=new RegExp(ko,"g");vi.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");vi.BYTE=new RegExp(_0,"g");vi.NUMERIC=new RegExp(gc,"g");vi.ALPHANUMERIC=new RegExp(u0,"g");var h0=new RegExp("^"+ko+"$"),g0=new RegExp("^"+gc+"$"),f0=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");vi.testKanji=function(r){return h0.test(r)};vi.testNumeric=function(r){return g0.test(r)};vi.testAlphanumeric=function(r){return f0.test(r)}});var Gi=le(Ve=>{var v0=Ra(),Fa=Na();Ve.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};Ve.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};Ve.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};Ve.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};Ve.MIXED={bit:-1};Ve.getCharCountIndicator=function(r,e){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!v0.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?r.ccBits[0]:e<27?r.ccBits[1]:r.ccBits[2]};Ve.getBestModeForData=function(r){return Fa.testNumeric(r)?Ve.NUMERIC:Fa.testAlphanumeric(r)?Ve.ALPHANUMERIC:Fa.testKanji(r)?Ve.KANJI:Ve.BYTE};Ve.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")};Ve.isValid=function(r){return r&&r.bit&&r.ccBits};function b0(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return Ve.NUMERIC;case"alphanumeric":return Ve.ALPHANUMERIC;case"kanji":return Ve.KANJI;case"byte":return Ve.BYTE;default:throw new Error("Unknown mode: "+i)}}Ve.from=function(r,e){if(Ve.isValid(r))return r;try{return b0(r)}catch{return e}}});var xc=le(dn=>{var Nr=Hi(),C0=Ba(),fc=Dr(),Ki=Gi(),La=Ra(),bc=7973,vc=Nr.getBCHDigit(bc);function x0(i,r,e){for(let n=1;n<=40;n++)if(r<=dn.getCapacity(n,e,i))return n}function Cc(i,r){return Ki.getCharCountIndicator(i,r)+4}function y0(i,r){let e=0;return i.forEach(function(n){let t=Cc(n.mode,r);e+=t+n.getBitsLength()}),e}function k0(i,r){for(let e=1;e<=40;e++)if(y0(i,e)<=dn.getCapacity(e,r,Ki.MIXED))return e}dn.from=function(r,e){return La.isValid(r)?parseInt(r,10):e};dn.getCapacity=function(r,e,n){if(!La.isValid(r))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=Ki.BYTE);let t=Nr.getSymbolTotalCodewords(r),s=C0.getTotalCodewordsCount(r,e),_=(t-s)*8;if(n===Ki.MIXED)return _;let C=_-Cc(n,r);switch(n){case Ki.NUMERIC:return Math.floor(C/10*3);case Ki.ALPHANUMERIC:return Math.floor(C/11*2);case Ki.KANJI:return Math.floor(C/13);case Ki.BYTE:default:return Math.floor(C/8)}};dn.getBestVersionForData=function(r,e){let n,t=fc.from(e,fc.M);if(Array.isArray(r)){if(r.length>1)return k0(r,t);if(r.length===0)return 1;n=r[0]}else n=r;return x0(n.mode,n.getLength(),t)};dn.getEncodedBits=function(r){if(!La.isValid(r)||r<7)throw new Error("Invalid QR Code version");let e=r<<12;for(;Nr.getBCHDigit(e)-vc>=0;)e^=bc<<Nr.getBCHDigit(e)-vc;return r<<12|e}});var Sc=le(wc=>{var qa=Hi(),kc=1335,w0=21522,yc=qa.getBCHDigit(kc);wc.getEncodedBits=function(r,e){let n=r.bit<<3|e,t=n<<10;for(;qa.getBCHDigit(t)-yc>=0;)t^=kc<<qa.getBCHDigit(t)-yc;return(n<<10|t)^w0}});var Ic=le((eS,Mc)=>{var S0=Gi();function eo(i){this.mode=S0.NUMERIC,this.data=i.toString()}eo.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)};eo.prototype.getLength=function(){return this.data.length};eo.prototype.getBitsLength=function(){return eo.getBitsLength(this.data.length)};eo.prototype.write=function(r){let e,n,t;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),t=parseInt(n,10),r.put(t,10);let s=this.data.length-e;s>0&&(n=this.data.substr(e),t=parseInt(n,10),r.put(t,s*3+1))};Mc.exports=eo});var Pc=le((tS,Ec)=>{var M0=Gi(),Wa=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function to(i){this.mode=M0.ALPHANUMERIC,this.data=i}to.getBitsLength=function(r){return 11*Math.floor(r/2)+6*(r%2)};to.prototype.getLength=function(){return this.data.length};to.prototype.getBitsLength=function(){return to.getBitsLength(this.data.length)};to.prototype.write=function(r){let e;for(e=0;e+2<=this.data.length;e+=2){let n=Wa.indexOf(this.data[e])*45;n+=Wa.indexOf(this.data[e+1]),r.put(n,11)}this.data.length%2&&r.put(Wa.indexOf(this.data[e]),6)};Ec.exports=to});var Dc=le((iS,Tc)=>{"use strict";Tc.exports=function(r){for(var e=[],n=r.length,t=0;t<n;t++){var s=r.charCodeAt(t);if(s>=55296&&s<=56319&&n>t+1){var _=r.charCodeAt(t+1);_>=56320&&_<=57343&&(s=(s-55296)*1024+_-56320+65536,t+=1)}if(s<128){e.push(s);continue}if(s<2048){e.push(s>>6|192),e.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){e.push(s>>12|224),e.push(s>>6&63|128),e.push(s&63|128);continue}if(s>=65536&&s<=1114111){e.push(s>>18|240),e.push(s>>12&63|128),e.push(s>>6&63|128),e.push(s&63|128);continue}e.push(239,191,189)}return new Uint8Array(e).buffer}});var Bc=le((nS,Oc)=>{var I0=Dc(),E0=Gi();function io(i){this.mode=E0.BYTE,typeof i=="string"&&(i=I0(i)),this.data=new Uint8Array(i)}io.getBitsLength=function(r){return r*8};io.prototype.getLength=function(){return this.data.length};io.prototype.getBitsLength=function(){return io.getBitsLength(this.data.length)};io.prototype.write=function(i){for(let r=0,e=this.data.length;r<e;r++)i.put(this.data[r],8)};Oc.exports=io});var Vc=le((oS,Ac)=>{var P0=Gi(),T0=Hi();function no(i){this.mode=P0.KANJI,this.data=i}no.getBitsLength=function(r){return r*13};no.prototype.getLength=function(){return this.data.length};no.prototype.getBitsLength=function(){return no.getBitsLength(this.data.length)};no.prototype.write=function(i){let r;for(r=0;r<this.data.length;r++){let e=T0.toSJIS(this.data[r]);if(e>=33088&&e<=40956)e-=33088;else if(e>=57408&&e<=60351)e-=49472;else throw new Error("Invalid SJIS character: "+this.data[r]+`
Make sure your charset is UTF-8`);e=(e>>>8&255)*192+(e&255),i.put(e,13)}};Ac.exports=no});var Rc=le((rS,Ua)=>{"use strict";var wo={single_source_shortest_paths:function(i,r,e){var n={},t={};t[r]=0;var s=wo.PriorityQueue.make();s.push(r,0);for(var _,C,I,B,Y,ye,ge,Ft,xi;!s.empty();){_=s.pop(),C=_.value,B=_.cost,Y=i[C]||{};for(I in Y)Y.hasOwnProperty(I)&&(ye=Y[I],ge=B+ye,Ft=t[I],xi=typeof t[I]>"u",(xi||Ft>ge)&&(t[I]=ge,s.push(I,ge),n[I]=C))}if(typeof e<"u"&&typeof t[e]>"u"){var yi=["Could not find a path from ",r," to ",e,"."].join("");throw new Error(yi)}return n},extract_shortest_path_from_predecessor_list:function(i,r){for(var e=[],n=r,t;n;)e.push(n),t=i[n],n=i[n];return e.reverse(),e},find_path:function(i,r,e){var n=wo.single_source_shortest_paths(i,r,e);return wo.extract_shortest_path_from_predecessor_list(n,e)},PriorityQueue:{make:function(i){var r=wo.PriorityQueue,e={},n;i=i||{};for(n in r)r.hasOwnProperty(n)&&(e[n]=r[n]);return e.queue=[],e.sorter=i.sorter||r.default_sorter,e},default_sorter:function(i,r){return i.cost-r.cost},push:function(i,r){var e={value:i,cost:r};this.queue.push(e),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof Ua<"u"&&(Ua.exports=wo)});var jc=le(oo=>{var se=Gi(),Lc=Ic(),qc=Pc(),Wc=Bc(),Uc=Vc(),So=Na(),Fr=Hi(),D0=Rc();function Nc(i){return unescape(encodeURIComponent(i)).length}function Mo(i,r,e){let n=[],t;for(;(t=i.exec(e))!==null;)n.push({data:t[0],index:t.index,mode:r,length:t[0].length});return n}function zc(i){let r=Mo(So.NUMERIC,se.NUMERIC,i),e=Mo(So.ALPHANUMERIC,se.ALPHANUMERIC,i),n,t;return Fr.isKanjiModeEnabled()?(n=Mo(So.BYTE,se.BYTE,i),t=Mo(So.KANJI,se.KANJI,i)):(n=Mo(So.BYTE_KANJI,se.BYTE,i),t=[]),r.concat(e,n,t).sort(function(_,C){return _.index-C.index}).map(function(_){return{data:_.data,mode:_.mode,length:_.length}})}function za(i,r){switch(r){case se.NUMERIC:return Lc.getBitsLength(i);case se.ALPHANUMERIC:return qc.getBitsLength(i);case se.KANJI:return Uc.getBitsLength(i);case se.BYTE:return Wc.getBitsLength(i)}}function O0(i){return i.reduce(function(r,e){let n=r.length-1>=0?r[r.length-1]:null;return n&&n.mode===e.mode?(r[r.length-1].data+=e.data,r):(r.push(e),r)},[])}function B0(i){let r=[];for(let e=0;e<i.length;e++){let n=i[e];switch(n.mode){case se.NUMERIC:r.push([n,{data:n.data,mode:se.ALPHANUMERIC,length:n.length},{data:n.data,mode:se.BYTE,length:n.length}]);break;case se.ALPHANUMERIC:r.push([n,{data:n.data,mode:se.BYTE,length:n.length}]);break;case se.KANJI:r.push([n,{data:n.data,mode:se.BYTE,length:Nc(n.data)}]);break;case se.BYTE:r.push([{data:n.data,mode:se.BYTE,length:Nc(n.data)}])}}return r}function A0(i,r){let e={},n={start:{}},t=["start"];for(let s=0;s<i.length;s++){let _=i[s],C=[];for(let I=0;I<_.length;I++){let B=_[I],Y=""+s+I;C.push(Y),e[Y]={node:B,lastCount:0},n[Y]={};for(let ye=0;ye<t.length;ye++){let ge=t[ye];e[ge]&&e[ge].node.mode===B.mode?(n[ge][Y]=za(e[ge].lastCount+B.length,B.mode)-za(e[ge].lastCount,B.mode),e[ge].lastCount+=B.length):(e[ge]&&(e[ge].lastCount=B.length),n[ge][Y]=za(B.length,B.mode)+4+se.getCharCountIndicator(B.mode,r))}}t=C}for(let s=0;s<t.length;s++)n[t[s]].end=0;return{map:n,table:e}}function Fc(i,r){let e,n=se.getBestModeForData(i);if(e=se.from(r,n),e!==se.BYTE&&e.bit<n.bit)throw new Error('"'+i+'" cannot be encoded with mode '+se.toString(e)+`.
 Suggested mode is: `+se.toString(n));switch(e===se.KANJI&&!Fr.isKanjiModeEnabled()&&(e=se.BYTE),e){case se.NUMERIC:return new Lc(i);case se.ALPHANUMERIC:return new qc(i);case se.KANJI:return new Uc(i);case se.BYTE:return new Wc(i)}}oo.fromArray=function(r){return r.reduce(function(e,n){return typeof n=="string"?e.push(Fc(n,null)):n.data&&e.push(Fc(n.data,n.mode)),e},[])};oo.fromString=function(r,e){let n=zc(r,Fr.isKanjiModeEnabled()),t=B0(n),s=A0(t,e),_=D0.find_path(s.map,"start","end"),C=[];for(let I=1;I<_.length-1;I++)C.push(s.table[_[I]].node);return oo.fromArray(O0(C))};oo.rawSplit=function(r){return oo.fromArray(zc(r,Fr.isKanjiModeEnabled()))}});var Hc=le(Qc=>{var qr=Hi(),ja=Dr(),V0=ic(),R0=oc(),N0=rc(),F0=lc(),Ya=cc(),Ga=Ba(),L0=_c(),Lr=xc(),q0=Sc(),W0=Gi(),Qa=jc();function U0(i,r){let e=i.size,n=F0.getPositions(r);for(let t=0;t<n.length;t++){let s=n[t][0],_=n[t][1];for(let C=-1;C<=7;C++)if(!(s+C<=-1||e<=s+C))for(let I=-1;I<=7;I++)_+I<=-1||e<=_+I||(C>=0&&C<=6&&(I===0||I===6)||I>=0&&I<=6&&(C===0||C===6)||C>=2&&C<=4&&I>=2&&I<=4?i.set(s+C,_+I,!0,!0):i.set(s+C,_+I,!1,!0))}}function z0(i){let r=i.size;for(let e=8;e<r-8;e++){let n=e%2===0;i.set(e,6,n,!0),i.set(6,e,n,!0)}}function j0(i,r){let e=N0.getPositions(r);for(let n=0;n<e.length;n++){let t=e[n][0],s=e[n][1];for(let _=-2;_<=2;_++)for(let C=-2;C<=2;C++)_===-2||_===2||C===-2||C===2||_===0&&C===0?i.set(t+_,s+C,!0,!0):i.set(t+_,s+C,!1,!0)}}function Q0(i,r){let e=i.size,n=Lr.getEncodedBits(r),t,s,_;for(let C=0;C<18;C++)t=Math.floor(C/3),s=C%3+e-8-3,_=(n>>C&1)===1,i.set(t,s,_,!0),i.set(s,t,_,!0)}function Ha(i,r,e){let n=i.size,t=q0.getEncodedBits(r,e),s,_;for(s=0;s<15;s++)_=(t>>s&1)===1,s<6?i.set(s,8,_,!0):s<8?i.set(s+1,8,_,!0):i.set(n-15+s,8,_,!0),s<8?i.set(8,n-s-1,_,!0):s<9?i.set(8,15-s-1+1,_,!0):i.set(8,15-s-1,_,!0);i.set(n-8,8,1,!0)}function H0(i,r){let e=i.size,n=-1,t=e-1,s=7,_=0;for(let C=e-1;C>0;C-=2)for(C===6&&C--;;){for(let I=0;I<2;I++)if(!i.isReserved(t,C-I)){let B=!1;_<r.length&&(B=(r[_]>>>s&1)===1),i.set(t,C-I,B),s--,s===-1&&(_++,s=7)}if(t+=n,t<0||e<=t){t-=n,n=-n;break}}}function Y0(i,r,e){let n=new V0;e.forEach(function(I){n.put(I.mode.bit,4),n.put(I.getLength(),W0.getCharCountIndicator(I.mode,i)),I.write(n)});let t=qr.getSymbolTotalCodewords(i),s=Ga.getTotalCodewordsCount(i,r),_=(t-s)*8;for(n.getLengthInBits()+4<=_&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);let C=(_-n.getLengthInBits())/8;for(let I=0;I<C;I++)n.put(I%2?17:236,8);return G0(n,i,r)}function G0(i,r,e){let n=qr.getSymbolTotalCodewords(r),t=Ga.getTotalCodewordsCount(r,e),s=n-t,_=Ga.getBlocksCount(r,e),C=n%_,I=_-C,B=Math.floor(n/_),Y=Math.floor(s/_),ye=Y+1,ge=B-Y,Ft=new L0(ge),xi=0,yi=new Array(_),ps=new Array(_),pa=0,cd=new Uint8Array(i.buffer);for(let bn=0;bn<_;bn++){let ma=bn<I?Y:ye;yi[bn]=cd.slice(xi,xi+ma),ps[bn]=Ft.encode(yi[bn]),xi+=ma,pa=Math.max(pa,ma)}let da=new Uint8Array(n),ds=0,li,ci;for(li=0;li<pa;li++)for(ci=0;ci<_;ci++)li<yi[ci].length&&(da[ds++]=yi[ci][li]);for(li=0;li<ge;li++)for(ci=0;ci<_;ci++)da[ds++]=ps[ci][li];return da}function K0(i,r,e,n){let t;if(Array.isArray(i))t=Qa.fromArray(i);else if(typeof i=="string"){let B=r;if(!B){let Y=Qa.rawSplit(i);B=Lr.getBestVersionForData(Y,e)}t=Qa.fromString(i,B||40)}else throw new Error("Invalid data");let s=Lr.getBestVersionForData(t,e);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(!r)r=s;else if(r<s)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+s+`.
`);let _=Y0(r,e,t),C=qr.getSymbolSize(r),I=new R0(C);return U0(I,r),z0(I),j0(I,r),Ha(I,e,0),r>=7&&Q0(I,r),H0(I,_),isNaN(n)&&(n=Ya.getBestMask(I,Ha.bind(null,I,e))),Ya.applyMask(n,I),Ha(I,e,n),{modules:I,version:r,errorCorrectionLevel:e,maskPattern:n,segments:t}}Qc.create=function(r,e){if(typeof r>"u"||r==="")throw new Error("No input text");let n=ja.M,t,s;return typeof e<"u"&&(n=ja.from(e.errorCorrectionLevel,ja.M),t=Lr.from(e.version),s=Ya.from(e.maskPattern),e.toSJISFunc&&qr.setToSJISFunction(e.toSJISFunc)),K0(r,t,n,s)}});var Ka=le(mn=>{function Yc(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let r=i.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+i);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(n){return[n,n]}))),r.length===6&&r.push("F","F");let e=parseInt(r.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:e&255,hex:"#"+r.slice(0,6).join("")}}mn.getOptions=function(r){r||(r={}),r.color||(r.color={});let e=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,n=r.width&&r.width>=21?r.width:void 0,t=r.scale||4;return{width:n,scale:n?4:t,margin:e,color:{dark:Yc(r.color.dark||"#000000ff"),light:Yc(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}};mn.getScale=function(r,e){return e.width&&e.width>=r+e.margin*2?e.width/(r+e.margin*2):e.scale};mn.getImageWidth=function(r,e){let n=mn.getScale(r,e);return Math.floor((r+e.margin*2)*n)};mn.qrToImageData=function(r,e,n){let t=e.modules.size,s=e.modules.data,_=mn.getScale(t,n),C=Math.floor((t+n.margin*2)*_),I=n.margin*_,B=[n.color.light,n.color.dark];for(let Y=0;Y<C;Y++)for(let ye=0;ye<C;ye++){let ge=(Y*C+ye)*4,Ft=n.color.light;if(Y>=I&&ye>=I&&Y<C-I&&ye<C-I){let xi=Math.floor((Y-I)/_),yi=Math.floor((ye-I)/_);Ft=B[s[xi*t+yi]?1:0]}r[ge++]=Ft.r,r[ge++]=Ft.g,r[ge++]=Ft.b,r[ge]=Ft.a}}});var Gc=le(Wr=>{var $a=Ka();function $0(i,r,e){i.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=e,r.width=e,r.style.height=e+"px",r.style.width=e+"px"}function X0(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}Wr.render=function(r,e,n){let t=n,s=e;typeof t>"u"&&(!e||!e.getContext)&&(t=e,e=void 0),e||(s=X0()),t=$a.getOptions(t);let _=$a.getImageWidth(r.modules.size,t),C=s.getContext("2d"),I=C.createImageData(_,_);return $a.qrToImageData(I.data,r,t),$0(C,s,_),C.putImageData(I,0,0),s};Wr.renderToDataURL=function(r,e,n){let t=n;typeof t>"u"&&(!e||!e.getContext)&&(t=e,e=void 0),t||(t={});let s=Wr.render(r,e,t),_=t.type||"image/png",C=t.rendererOpts||{};return s.toDataURL(_,C.quality)}});var Xc=le($c=>{var J0=Ka();function Kc(i,r){let e=i.a/255,n=r+'="'+i.hex+'"';return e<1?n+" "+r+'-opacity="'+e.toFixed(2).slice(1)+'"':n}function Xa(i,r,e){let n=i+r;return typeof e<"u"&&(n+=" "+e),n}function Z0(i,r,e){let n="",t=0,s=!1,_=0;for(let C=0;C<i.length;C++){let I=Math.floor(C%r),B=Math.floor(C/r);!I&&!s&&(s=!0),i[C]?(_++,C>0&&I>0&&i[C-1]||(n+=s?Xa("M",I+e,.5+B+e):Xa("m",t,0),t=0,s=!1),I+1<r&&i[C+1]||(n+=Xa("h",_),_=0)):t++}return n}$c.render=function(r,e,n){let t=J0.getOptions(e),s=r.modules.size,_=r.modules.data,C=s+t.margin*2,I=t.color.light.a?"<path "+Kc(t.color.light,"fill")+' d="M0 0h'+C+"v"+C+'H0z"/>':"",B="<path "+Kc(t.color.dark,"stroke")+' d="'+Z0(_,s,t.margin)+'"/>',Y='viewBox="0 0 '+C+" "+C+'"',ge='<svg xmlns="http://www.w3.org/2000/svg" '+(t.width?'width="'+t.width+'" height="'+t.width+'" ':"")+Y+' shape-rendering="crispEdges">'+I+B+`</svg>
`;return typeof n=="function"&&n(null,ge),ge}});var Zc=le(Io=>{var e_=Zl(),Ja=Hc(),Jc=Gc(),t_=Xc();function Za(i,r,e,n,t){let s=[].slice.call(arguments,1),_=s.length,C=typeof s[_-1]=="function";if(!C&&!e_())throw new Error("Callback required as last argument");if(C){if(_<2)throw new Error("Too few arguments provided");_===2?(t=e,e=r,r=n=void 0):_===3&&(r.getContext&&typeof t>"u"?(t=n,n=void 0):(t=n,n=e,e=r,r=void 0))}else{if(_<1)throw new Error("Too few arguments provided");return _===1?(e=r,r=n=void 0):_===2&&!r.getContext&&(n=e,e=r,r=void 0),new Promise(function(I,B){try{let Y=Ja.create(e,n);I(i(Y,r,n))}catch(Y){B(Y)}})}try{let I=Ja.create(e,n);t(null,i(I,r,n))}catch(I){t(I)}}Io.create=Ja.create;Io.toCanvas=Za.bind(null,Jc.render);Io.toDataURL=Za.bind(null,Jc.renderToDataURL);Io.toString=Za.bind(null,function(i,r,e){return t_.render(i,e)})});var Ea=new it("@sweetalert2/ngx-sweetalert2#swalProvider"),Wl=new it("@sweetalert2/ngx-sweetalert2#fireOnInit"),Ul=new it("@sweetalert2/ngx-sweetalert2#dismissOnDestroy"),zl=(()=>{class i{swalProvider;swalPromiseCache;constructor(e){this.swalProvider=e}get swal(){return this.swalPromiseCache||this.preloadSweetAlertLibrary(),this.swalPromiseCache}preloadSweetAlertLibrary(){if(this.swalPromiseCache)return;let e=n(this.swalProvider)?this.swalProvider():Promise.resolve(this.swalProvider);this.swalPromiseCache=e.then(s=>t(s)?s:s.default);function n(s){return typeof s=="function"&&s.version===void 0}function t(s){return typeof s=="function"}}static \u0275fac=function(n){return new(n||i)(ke(Ea))};static \u0275prov=Ke({token:i,factory:i.\u0275fac})}return i})();var jl=(()=>{class i{closeButton={element:e=>e.getCloseButton(),options:{showCloseButton:!0}};title={element:e=>e.getTitle(),options:{title:" "}};content={element:e=>e.getHtmlContainer(),options:{text:" "}};actions={element:e=>e.getActions(),options:{showConfirmButton:!0}};confirmButton={element:e=>e.getConfirmButton(),options:{showConfirmButton:!0}};denyButton={element:e=>e.getDenyButton(),options:{showDenyButton:!0}};cancelButton={element:e=>e.getCancelButton(),options:{showCancelButton:!0}};footer={element:e=>e.getFooter(),options:{footer:" "}};static \u0275fac=function(n){return new(n||i)};static \u0275prov=Ke({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function dd(){return import("./chunk-V3NGZ4GC.js")}var xr=(()=>{class i{static forRoot(e={}){return{ngModule:i,providers:[zl,{provide:Ea,useValue:e.provideSwal||dd},{provide:Wl,useValue:e.fireOnInit||!1},{provide:Ul,useValue:e.dismissOnDestroy||!0}]}}static forChild(e={}){return{ngModule:i,providers:[...e.provideSwal?[zl,{provide:Ea,useValue:e.provideSwal}]:[],...e.fireOnInit!==void 0?[{provide:Wl,useValue:e.fireOnInit}]:[],...e.dismissOnDestroy!==void 0?[{provide:Ul,useValue:e.dismissOnDestroy}]:[]]}}static \u0275fac=function(n){return new(n||i)};static \u0275mod=Z({type:i});static \u0275inj=J({imports:[de]})}return i})();var xe=Me(go());var ud=["informationsModal"],_d=(i,r,e,n,t,s)=>({status_tag__yellow:i,status_tag__red:r,status_tag__grey:e,status_tag__blue:n,status_tag__orange:t,status_tag__green:s});function hd(i,r){i&1&&x(0,"mat-spinner",39),i&2&&c("diameter",25)}function gd(i,r){if(i&1&&(a(0,"p",40),p(1),l()),i&2){let e=m();o(),g(" ",e.ref==null?null:e.ref.title," ")}}function fd(i,r){if(i&1&&(a(0,"a",41),p(1),d(2,"translate"),l()),i&2){let e=m();c("href",e.env.api+"/"+e.getURLType()+"/"+(e.ref==null?null:e.ref.id)+"/pdf?locale="+e.translate.getLang(),K),o(),g(" ",u(2,2,"components.dashboard.quotations.details.pdf")," ")}}function vd(i,r){if(i&1&&(a(0,"p",11),p(1),d(2,"translate"),d(3,"translate"),l()),i&2){let e=m();o(),g(" ",u(2,1,"dashboard.credit_invoice_manage.on_invoice")+" "+u(3,3,"components.dashboard.quotations.headers.number")+(e.ref==null||e.ref.parent==null?null:e.ref.parent.reference)," ")}}function bd(i,r){if(i&1&&(a(0,"p",11),p(1),d(2,"translate"),l()),i&2){let e=m();o(),g(" ",u(2,1,"pages.dashboard.manage_quotation.form.product_order.purchase_order")+" : "+(e.ref==null?null:e.ref.purchaseOrder)," ")}}function Cd(i,r){if(i&1&&(a(0,"div",42)(1,"span",43),p(2),d(3,"translate"),d(4,"translate"),l()()),i&2){let e=m();o(),c("ngClass",ks(6,_d,(e.ref==null?null:e.ref.status)=="CREATED"&&e.type!=="credit",(e.ref==null?null:e.ref.status)=="CANCELLED",(e.ref==null?null:e.ref.status)=="EXPIRED",(e.ref==null?null:e.ref.status)=="VALIDATED"||e.type==="credit",(e.ref==null?null:e.ref.status)=="WAITING_PAYMENT",(e.ref==null?null:e.ref.status)=="PAID")),o(),g(" ",e.type==="credit"?u(3,2,"components.dashboard.quotations.status.credit"):u(4,4,"quotation.status."+(e.ref==null?null:e.ref.status.toLowerCase()))," ")}}function xd(i,r){if(i&1&&(M(0),p(1),x(2,"br"),S()),i&2){let e=m();o(),g("",e.ref==null||e.ref.source==null?null:e.ref.source.label," ")}}function yd(i,r){if(i&1&&(M(0),p(1),x(2,"br"),S()),i&2){let e=m();o(),g("",e.ref==null||e.ref.source==null||e.ref.source.address==null?null:e.ref.source.address.address1," ")}}function kd(i,r){if(i&1&&(M(0),p(1),S()),i&2){let e=m();o(),g("",e.ref==null||e.ref.source==null||e.ref.source.address==null?null:e.ref.source.address.addressPostalCode," ")}}function wd(i,r){if(i&1&&(M(0),p(1),x(2,"br"),S()),i&2){let e=m();o(),g("",e.ref==null||e.ref.source==null||e.ref.source.address==null?null:e.ref.source.address.addressCity," ")}}function Sd(i,r){if(i&1&&(M(0),p(1),d(2,"translate"),S()),i&2){let e=m();o(),w(u(2,1,"components.dashboard.quotations.details.author.siren")+" : "+(e.ref==null||e.ref.source==null?null:e.ref.source.siren))}}function Md(i,r){if(i&1&&(M(0),p(1),x(2,"br"),S()),i&2){let e=m();o(),w(e.ref==null||e.ref.recipient==null?null:e.ref.recipient.label)}}function Id(i,r){if(i&1&&(M(0),p(1),x(2,"br"),S()),i&2){let e=m();o(),w(e.ref==null||e.ref.recipient==null||e.ref.recipient.address==null?null:e.ref.recipient.address.address1)}}function Ed(i,r){if(i&1&&(M(0),p(1),S()),i&2){let e=m();o(),g("",e.ref==null||e.ref.recipient==null||e.ref.recipient.address==null?null:e.ref.recipient.address.addressPostalCode," ")}}function Pd(i,r){if(i&1&&(M(0),p(1),S()),i&2){let e=m();o(),w(e.ref==null||e.ref.recipient==null||e.ref.recipient.address==null?null:e.ref.recipient.address.addressCity)}}function Td(i,r){if(i&1&&(M(0),x(1,"br"),p(2),d(3,"translate"),S()),i&2){let e=m();o(2),w(u(3,1,"components.dashboard.quotations.details.author.siren")+" : "+(e.ref==null||e.ref.recipient==null?null:e.ref.recipient.siren))}}function Dd(i,r){if(i&1&&(M(0),x(1,"br"),p(2),d(3,"translate"),x(4,"br"),p(5),S()),i&2){let e=m();o(2),g(" ",u(3,2,"components.dashboard.quotations.details.recipient.billing_email")+" :"," "),o(3),g(" ",e.ref==null||e.ref.recipient==null?null:e.ref.recipient.billingEmail," ")}}function Od(i,r){if(i&1){let e=k();a(0,"div",44)(1,"app-button",45),b("clicked",function(){f(e);let t=m();return v(t.modalCompleteInformations())}),l()()}if(i&2){let e=m();o(),c("iconName",e.informationsCompleted()?"edit":"warning")("textKey",e.informationsCompleted()?"pages.user.book.steps.edit_informations_button":"pages.user.book.steps.complete_informations_button")("noActiveBorders",!0)("paddingX",!1)("dangerMode",!e.informationsCompleted())}}function Bd(i,r){if(i&1){let e=k();a(0,"a",49),b("click",function(){f(e);let t=m().$implicit,s=m();return v(s.goToWorkspace(t.booking.workspace.url))}),p(1),l()}if(i&2){let e=m().$implicit;o(),g(" ",e.description," ")}}function Ad(i,r){if(i&1&&(a(0,"p"),p(1),l()),i&2){let e=m().$implicit;o(),g(" ",e.description," ")}}function Vd(i,r){if(i&1&&(a(0,"p",50),p(1),d(2,"translate"),l()),i&2){let e=m().$implicit,n=m();o(),g(" ",u(2,1,"components.dashboard.quotations.details.ref")+" "+n.getWorkspaceReference(e.booking.workspace==null?null:e.booking.workspace.url)," ")}}function Rd(i,r){if(i&1&&(a(0,"p",50),p(1),l()),i&2){let e=m().$implicit,n=m();o(),g(" ",n.getDates(e)," ")}}function Nd(i,r){if(i&1&&(M(0),p(1),d(2,"currency"),S()),i&2){let e=m(2).$implicit;o(),g(" ",T(2,1,(e==null||e.coupon==null?null:e.coupon.value)/100,"EUR")," ")}}function Fd(i,r){if(i&1&&(M(0)(1,51),p(2),d(3,"number"),S(),h(4,Nd,3,4,"ng-container",19),S()),i&2){let e=m().$implicit;o(2),g(" ",T(3,2,(e==null||e.coupon==null?null:e.coupon.value)/100,"1.0-2"),"\xA0% "),o(2),c("ngIf",!(!(e==null||e.coupon==null)&&e.coupon.isPercent))}}function Ld(i,r){i&1&&(M(0),p(1," - "),S())}function qd(i,r){if(i&1&&(a(0,"tr")(1,"td",46),h(2,Bd,2,1,"a",47)(3,Ad,2,1,"p",19)(4,Vd,3,3,"p",48)(5,Rd,2,1,"p",48),l(),a(6,"td"),p(7),l(),a(8,"td"),p(9),d(10,"currency"),l(),a(11,"td"),h(12,Fd,5,5,"ng-container",19)(13,Ld,2,0,"ng-container",19),l(),a(14,"td"),p(15),l(),a(16,"td",36),p(17),d(18,"currency"),l()()),i&2){let e=r.$implicit;o(2),c("ngIf",e.booking==null?null:e.booking.workspace),o(),c("ngIf",!(e.booking!=null&&e.booking.workspace)),o(),c("ngIf",e.booking==null?null:e.booking.workspace),o(),c("ngIf",e.endDate||e.startDate),o(2),w(e.quantity),o(2),w(T(10,10,e.price/100,"EUR")),o(3),c("ngIf",(e==null?null:e.coupon)&&(e==null||e.coupon==null?null:e.coupon.value)>0),o(),c("ngIf",!(e!=null&&e.coupon)||(e==null||e.coupon==null?null:e.coupon.value)<=0),o(2),g("",e.tva/100," %"),o(2),w(T(18,13,e.totalWithoutTaxes/100,"EUR"))}}function Wd(i,r){if(i&1&&(a(0,"tr")(1,"th",35),p(2),d(3,"translate"),l(),a(4,"td",36),p(5),d(6,"currency"),l()()),i&2){let e=m();o(2),w(u(3,2,"pages.dashboard.manage_quotation.form.taxes.subtotal_ht")),o(3),w(T(6,4,(e.ref==null?null:e.ref.subTotalWithoutTaxes)/100,"EUR"))}}function Ud(i,r){if(i&1&&(a(0,"tr")(1,"th",35),p(2),d(3,"translate"),l(),a(4,"td",36),p(5),d(6,"currency"),l()()),i&2){let e=m();o(2),w(u(3,2,"pages.dashboard.manage_quotation.form.taxes.discount_ht")),o(3),w(T(6,4,(e.ref==null?null:e.ref.reduction)/100,"EUR"))}}function zd(i,r){if(i&1&&(a(0,"tr")(1,"th",35),p(2),d(3,"translate"),d(4,"number"),l(),a(5,"td",36),p(6),d(7,"currency"),l()()),i&2){let e=r.$implicit,n=m();o(2),Q(" ",u(3,3,"pages.dashboard.manage_quotation.form.taxes.total_tax")," ",T(4,5,n.toFloat(e)/100,"1.0-2")," % "),o(4),w(T(7,8,(n.ref==null?null:n.ref.taxes[e])/100,"EUR"))}}function jd(i,r){if(i&1&&(M(0),a(1,"th",35),p(2),d(3,"translate"),l(),a(4,"td",36),p(5),d(6,"currency"),l(),S()),i&2){let e=m().$implicit;o(2),Q("",u(3,3,"global.credit_invoice")," ",e.reference,""),o(3),w(T(6,5,e.total/100,"EUR"))}}function Qd(i,r){if(i&1&&(a(0,"tr"),h(1,jd,7,8,"ng-container",19),l()),i&2){let e=r.$implicit,n=r.index;E("b-top",n===0),o(),c("ngIf",e.type==="CREDIT")}}function Hd(i,r){if(i&1&&(M(0),h(1,Qd,2,3,"tr",52),a(2,"tr",37)(3,"th",35),p(4),d(5,"translate"),l(),a(6,"td",36),p(7),d(8,"currency"),l()(),S()),i&2){let e=m();o(),c("ngForOf",e.ref==null?null:e.ref.children),o(3),g(" ",u(5,3,"pages.dashboard.manage_quotation.form.taxes.total_after_credits_ttc")," "),o(3),w(T(8,5,e.getRefTotal()/100,"EUR"))}}function Yd(i,r){if(i&1&&(M(0),a(1,"span",54),p(2),d(3,"translate"),l(),p(4),d(5,"amParse"),d(6,"amLocal"),d(7,"amFromUtc"),d(8,"amTz"),d(9,"amDateFormat"),S()),i&2){let e=m(2);o(2),g("",u(3,2,"components.dashboard.quotations.details.payment_delay_date"),"\xA0:"),o(2),g(" ",T(9,13,T(8,10,u(7,8,u(6,6,u(5,4,e.ref==null?null:e.ref.paymentDelayDate))),e.ref==null?null:e.ref.timezone),"DD MMM YYYY")," ")}}function Gd(i,r){if(i&1&&(M(0),p(1),x(2,"br"),S()),i&2){let e=r.$implicit,n=m(2);o(),g(" ",n.getPaymentInformations(e)," ")}}function Kd(i,r){i&1&&(M(0),a(1,"span",54),p(2),d(3,"translate"),l(),S()),i&2&&(o(2),w(u(3,1,"pages.app.quotation.paid")))}function $d(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.manage_quotation.form.product_order.error")," "))}function Xd(i,r){if(i&1&&(a(0,"div",58)(1,"div",59),p(2),d(3,"translate"),l(),a(4,"mat-form-field",60)(5,"mat-label"),p(6),d(7,"translate"),l(),x(8,"input",61),d(9,"translate"),h(10,$d,3,3,"mat-error",19),l()()),i&2){let e=m(2);o(2),g(" ",u(3,5,"pages.dashboard.manage_quotation.form.product_order.title_PO_required")," "),o(4),w(u(7,7,"pages.dashboard.manage_quotation.form.product_order.label_required")),o(2),c("formControl",e.purchase_order_number)("placeholder",u(9,9,"pages.dashboard.manage_quotation.form.product_order.placeholder")),o(2),c("ngIf",e.purchase_order_number==null?null:e.purchase_order_number.hasError("required"))}}function Jd(i,r){i&1&&(a(0,"div",58)(1,"p",62),p(2),d(3,"translate"),l()()),i&2&&(o(2),g(" ",u(3,1,"pages.dashboard.manage_quotation.form.product_order.title_PO_required")," "))}function Zd(i,r){if(i&1&&(a(0,"div",63)(1,"p",64),p(2),d(3,"translate"),l(),a(4,"p"),p(5),l()()),i&2){let e=m(2);o(2),g(" ",u(3,2,"components.dashboard.invoices.details.conditions")," "),o(3),g(" ",e.ref==null?null:e.ref.conditions," ")}}function em(i,r){if(i&1&&(a(0,"div",63)(1,"p",64),p(2),d(3,"translate"),l(),a(4,"p"),p(5),l()()),i&2){let e=m(2);o(2),g(" ",u(3,2,"components.dashboard.quotations.details.indications")," "),o(3),g(" ",e.ref==null?null:e.ref.indications," ")}}function tm(i,r){if(i&1&&(a(0,"div",53)(1,"div",15)(2,"p")(3,"span",54),p(4),d(5,"translate"),l(),p(6),d(7,"amParse"),d(8,"amLocal"),d(9,"amFromUtc"),d(10,"amTz"),d(11,"amDateFormat"),l()(),a(12,"div",55)(13,"p"),h(14,Yd,10,16,"ng-container",19)(15,Gd,3,1,"ng-container",33)(16,Kd,4,3,"ng-container",19),l()(),h(17,Xd,11,11,"div",56)(18,Jd,4,3,"div",56)(19,Zd,6,4,"div",57)(20,em,6,4,"div",57),l()),i&2){let e=m();o(4),g("",u(5,9,"components.dashboard.quotations.details.validity"),"\xA0:"),o(2),g(" ",T(11,20,T(10,17,u(9,15,u(8,13,u(7,11,e.ref==null?null:e.ref.validationDate))),e.ref==null?null:e.ref.timezone),"DD MMM YYYY")," "),o(8),c("ngIf",(e.ref==null?null:e.ref.status)!=="PAID"),o(),c("ngForOf",e.getTransactionsPayment()),o(),c("ngIf",(e.ref==null?null:e.ref.status)==="PAID"),o(),c("ngIf",e.enterPO&&!e.preview),o(),c("ngIf",e.enterPO&&!(e.ref!=null&&e.ref.purchaseOrder)&&e.preview),o(),c("ngIf",e.ref==null?null:e.ref.conditions),o(),c("ngIf",e.ref==null?null:e.ref.indications)}}function im(i,r){if(i&1&&(a(0,"p")(1,"strong"),p(2),d(3,"translate"),l(),p(4),d(5,"translate"),d(6,"amFromUtc"),d(7,"amLocal"),d(8,"amDateFormat"),d(9,"translate"),d(10,"currency"),l()),i&2){let e=m().$implicit;o(2),Q("",u(3,6,"global.credit_invoice")," ",e.reference,""),o(2),En(" ",u(5,8,"components.dashboard.invoices.details.credits.date")," ",T(8,14,u(7,12,u(6,10,e.createdAt)),"LL")," ",u(9,17,"components.dashboard.invoices.details.credits.amount")," ",T(10,19,e.total/100,"EUR"),". ")}}function nm(i,r){if(i&1&&(M(0),h(1,im,11,22,"p",19),S()),i&2){let e=r.$implicit;o(),c("ngIf",e.type==="CREDIT")}}function om(i,r){if(i&1&&(a(0,"div",66),h(1,nm,2,1,"ng-container",33),l()),i&2){let e=m(2);o(),c("ngForOf",e.ref==null?null:e.ref.children)}}function rm(i,r){if(i&1&&(M(0),p(1),x(2,"br"),S()),i&2){let e=r.$implicit,n=m(3);o(),g(" ",n.getPaymentInformations(e)," ")}}function am(i,r){if(i&1&&(M(0),p(1),x(2,"br"),S()),i&2){let e=r.$implicit,n=m(3);o(),g(" ",n.getRefundInformations(e)," ")}}function sm(i,r){i&1&&(M(0),p(1),d(2,"translate"),S()),i&2&&(o(),g(" ",u(2,1,"components.dashboard.invoices.details.paid")," "))}function lm(i,r){if(i&1&&(M(0),a(1,"span",54),p(2),d(3,"translate"),l(),p(4),d(5,"amParse"),d(6,"amLocal"),d(7,"amFromUtc"),d(8,"amTz"),d(9,"amDateFormat"),S()),i&2){let e=m(3);o(2),g("",u(3,2,"components.dashboard.quotations.details.payment_delay_date"),"\xA0:"),o(2),g(" ",T(9,13,T(8,10,u(7,8,u(6,6,u(5,4,e.ref==null?null:e.ref.paymentDelayDate))),e.ref==null?null:e.ref.timezone),"DD MMM YYYY")," ")}}function cm(i,r){if(i&1&&(a(0,"div",66)(1,"p"),h(2,rm,3,1,"ng-container",33)(3,am,3,1,"ng-container",33),a(4,"span",54),h(5,sm,3,3,"ng-container",19)(6,lm,10,16,"ng-container",19),l()()()),i&2){let e=m(2);o(2),c("ngForOf",e.getTransactionsPayment()),o(),c("ngForOf",e.getTransactionsRefunds()),o(2),c("ngIf",(e.ref==null?null:e.ref.status)==="PAID"),o(),c("ngIf",(e.ref==null?null:e.ref.status)!=="PAID"&&(e.ref==null?null:e.ref.status)!=="CANCELLED")}}function pm(i,r){if(i&1&&(a(0,"div",63)(1,"p",64),p(2),d(3,"translate"),l(),a(4,"p"),p(5),l()()),i&2){let e=m(2);o(2),g(" ",u(3,2,"components.dashboard.invoices.details.conditions")," "),o(3),g(" ",e.ref==null?null:e.ref.conditions," ")}}function dm(i,r){if(i&1&&(a(0,"div",63)(1,"p"),p(2),l()()),i&2){let e=m(2);o(2),g(" ",e.ref==null?null:e.ref.footer," ")}}function mm(i,r){if(i&1&&(a(0,"div",53),h(1,om,2,1,"div",65)(2,cm,7,4,"div",65)(3,pm,6,4,"div",57)(4,dm,3,1,"div",57),l()),i&2){let e=m();o(),c("ngIf",(e.ref==null||e.ref.children==null?null:e.ref.children.length)>0),o(),c("ngIf",e.type==="invoice"),o(),c("ngIf",(e.ref==null?null:e.ref.conditions)&&e.type!=="credit"),o(),c("ngIf",(e.ref==null?null:e.ref.footer)&&e.type!=="credit")}}function um(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.manage_quotation.form.errors.email.unvalid")," "))}function _m(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.manage_quotation.form.errors.siren")," "))}function hm(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.manage_quotation.form.errors.social_reason_pro")," "))}function gm(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.manage_quotation.form.errors.lastname_part")," "))}function fm(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.manage_quotation.form.errors.firstname_part")," "))}function vm(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.manage_quotation.form.errors.address")," "))}function bm(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.manage_quotation.form.errors.postal_code")," "))}function Cm(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.manage_quotation.form.errors.city")," "))}function xm(i,r){if(i&1){let e=k();a(0,"div",67)(1,"h5",68),p(2),d(3,"translate"),d(4,"translate"),l(),a(5,"button",69),b("click",function(){let t=f(e).$implicit;return v(t.dismiss("Cross click"))}),a(6,"span",70),p(7,"\xD7"),l()()(),a(8,"div",71)(9,"form",72)(10,"div",73)(11,"div",74)(12,"mat-tab-group",75),b("selectedIndexChange",function(t){f(e);let s=m();return v(s.switchPartPro(t))}),x(13,"mat-tab",76),d(14,"translate"),x(15,"mat-tab",76),d(16,"translate"),l()(),a(17,"div",15)(18,"mat-form-field",77)(19,"mat-label"),p(20),d(21,"translate"),l(),x(22,"input",78),d(23,"translate"),h(24,um,3,3,"mat-error",19),l()(),a(25,"div",15)(26,"mat-form-field",77)(27,"mat-label"),p(28),d(29,"translate"),l(),x(30,"input",79),d(31,"translate"),l()(),a(32,"div",15)(33,"mat-form-field",77)(34,"mat-label"),p(35),d(36,"translate"),l(),x(37,"input",80),d(38,"translate"),h(39,_m,3,3,"mat-error",19),l()(),a(40,"div",15)(41,"mat-form-field",77)(42,"mat-label"),p(43),d(44,"translate"),l(),x(45,"input",81),d(46,"translate"),h(47,hm,3,3,"mat-error",19),l()(),a(48,"div",15)(49,"mat-form-field",77)(50,"mat-label"),p(51),d(52,"translate"),l(),x(53,"input",82),d(54,"translate"),h(55,gm,3,3,"mat-error",19),l()(),a(56,"div",15)(57,"mat-form-field",77)(58,"mat-label"),p(59),d(60,"translate"),l(),x(61,"input",83),d(62,"translate"),h(63,fm,3,3,"mat-error",19),l()(),a(64,"div",66)(65,"mat-form-field",77)(66,"mat-label"),p(67),d(68,"translate"),l(),x(69,"input",84),d(70,"translate"),h(71,vm,3,3,"mat-error",19),l()(),a(72,"div",15)(73,"mat-form-field",77)(74,"mat-label"),p(75),d(76,"translate"),l(),x(77,"input",85),d(78,"translate"),h(79,bm,3,3,"mat-error",19),l()(),a(80,"div",15)(81,"mat-form-field",77)(82,"mat-label"),p(83),d(84,"translate"),l(),x(85,"input",86),d(86,"translate"),h(87,Cm,3,3,"mat-error",19),l()(),a(88,"div",87)(89,"div",88),b("mouseenter",function(){f(e);let t=m();return v(t.showInputsErrors())}),a(90,"app-button",89,3),b("clicked",function(){f(e);let t=m();return v(t.updateQuotation())}),l()()()()()()}if(i&2){let e=m(),n=V(97),t=V(99);o(2),g(" ",e.informationsCompleted()?u(3,50,"pages.user.book.steps.edit_informations_modal_title"):u(4,52,"pages.user.book.steps.complete_informations_modal_title")," "),o(7),c("formGroup",e.formGroup),o(3),c("selectedIndex",e.isPro?1:0)("disableRipple",!0),o(),c("label",u(14,54,"components.dashboard.quotations.create.part")),o(2),c("label",u(16,56,"components.dashboard.quotations.create.pro")),o(5),w(u(21,58,"pages.dashboard.manage_quotation.form.facturation_email.label")),o(2),c("placeholder",u(23,60,"pages.dashboard.manage_quotation.form.facturation_email.placeholder")),o(2),c("ngIf",e.formGroup.get("billingEmail").hasError("email")),o(4),w(u(29,62,"pages.dashboard.manage_quotation.form.phone.label")),o(2),c("placeholder",u(31,64,"pages.dashboard.manage_quotation.form.phone.placeholder")),o(2),E("d-none",!e.isPro),o(3),w(u(36,66,"pages.dashboard.manage_quotation.form.siren.label")),o(2),c("placeholder",u(38,68,"pages.dashboard.manage_quotation.form.siren.placeholder")),o(2),c("ngIf",e.formGroup.get("siren").hasError("required")),o(),E("d-none",!e.isPro),o(3),w(u(44,70,"pages.dashboard.manage_quotation.form.social_reason.label")),o(2),c("required",e.isPro)("placeholder",u(46,72,"pages.dashboard.manage_quotation.form.social_reason.placeholder"))("required",e.isPro),o(2),c("ngIf",e.formGroup.get("social_reason").hasError("required")),o(),E("d-none",e.isPro),o(3),w(u(52,74,"pages.dashboard.manage_quotation.form.lastname.label")),o(2),c("required",!e.isPro)("placeholder",u(54,76,"pages.dashboard.manage_quotation.form.lastname.placeholder"))("required",!e.isPro),o(2),c("ngIf",e.formGroup.get("lastname").hasError("required")),o(),E("d-none",e.isPro),o(3),w(u(60,78,"pages.dashboard.manage_quotation.form.firstname.label")),o(2),c("required",!e.isPro)("placeholder",u(62,80,"pages.dashboard.manage_quotation.form.firstname.placeholder"))("required",!e.isPro),o(2),c("ngIf",e.formGroup.get("firstname").hasError("required")),o(4),w(u(68,82,"pages.dashboard.manage_quotation.form.address.label")),o(2),c("placeholder",u(70,84,"pages.dashboard.manage_quotation.form.address.placeholder")),o(2),c("ngIf",e.formGroup.get("address").hasError("required")),o(4),w(u(76,86,"pages.dashboard.manage_quotation.form.postal_code.label")),o(2),c("placeholder",u(78,88,"pages.dashboard.manage_quotation.form.postal_code.placeholder")),o(2),c("ngIf",e.formGroup.get("postalCode").hasError("required")),o(4),w(u(84,90,"pages.dashboard.manage_quotation.form.city.label")),o(2),c("placeholder",u(86,92,"pages.dashboard.manage_quotation.form.city.placeholder")),o(2),c("ngIf",e.formGroup.get("city").hasError("required")),o(2),c("ngbPopover",t)("popoverTitle",n)("disablePopover",e.formGroup.valid),o(),c("isDisabled",!e.formGroup.valid)}}function ym(i,r){i&1&&(a(0,"div",90)(1,"mat-icon"),p(2,"error"),l(),p(3),d(4,"translate"),l()),i&2&&(o(3),g(" ",u(4,1,"components.environments.configuration.layout.errors")," "))}function km(i,r){i&1&&(a(0,"div",91),M(1,92),p(2),d(3,"translate"),x(4,"br"),S(),l()),i&2&&(o(2),g(" - ",u(3,1,"pages.app.quotation.formGroup_invalid")," "))}var Ql=(()=>{class i{set updateType(e){this.type=e}set updatePreview(e){this.preview=e}set updateEnterPo(e){this.ref=e,this.ref&&(this.isLoading=!1),e?.requiresPurchaseOrder&&(e?.purchaseOrder===""||!e?.purchaseOrder)&&!this.preview&&(this.enterPO=!0),this.isPro=this.ref?.recipient?.isPro,this.formGroup&&this.initFromQuotation()}set updateShowInputErrors(e){e&&this.showInputErrors()}constructor(e,n,t,s,_,C){this.api=e,this.translate=n,this.formBuilder=t,this.toastr=s,this.modalService=_,this.utils=C,this.preview=!1,this.isLoading=!0,this.enterPO=!1,this.purchase_order_number=new ue(null,[I=>this.ref?.requiresPurchaseOrder&&!I?.value?{required:!0}:null]),this.env=ut,this.keys=I=>I===null?[]:Object.keys(I),this.toFloat=I=>parseFloat(I),this.productOrderChange=new L(!0),this.showErrors=!1}ngOnInit(){this.formGroup=this.formBuilder.group({billingEmail:["",[W.email]],siren:[""],social_reason:["",[e=>e&&this.isPro&&(e.value===null||e?.value&&e.value.trim().length===0)?{required:!0}:""]],lastname:["",[e=>e&&!this.isPro&&(e?.value===null||e?.value&&e?.value.trim().length===0)?{required:!0}:""]],firstname:["",[e=>e&&!this.isPro&&(e?.value===null||e?.value&&e?.value.trim().length===0)?{required:!0}:""]],address:["",[W.required]],postalCode:["",[W.required]],city:["",[W.required]],phone:[""]}),this.purchase_order_number.valueChanges.subscribe(()=>{this.productOrderChange.emit(this.purchase_order_number)}),setTimeout(()=>{this.initFromQuotation(),this.ref&&(this.type==="quotation"?this.api.quotationService.get(this.ref?.id):this.api.invoiceService.get(this.ref?.id)).then(n=>{this.ref=n})})}getDates(e){let n=e.startDate?(0,xe.default)(e.startDate).format("DD MMM YYYY"):null,t=e.endDate?(0,xe.default)(e.endDate).format("DD MMM YYYY"):null;return n?t?n===t?(0,xe.default)(e.startDate).format("DD MMM YYYY")+" - "+(0,xe.default)(e.startDate).format("HH:mm")+" "+this.translate.get("components.workspace.schedules.to")+" "+(0,xe.default)(e.endDate).format("HH:mm"):(0,xe.default)(e.startDate).format("YYYY")===(0,xe.default)(e.endDate).format("YYYY")?(0,xe.default)(e.startDate).format("DD MMM")+" "+this.translate.get("components.order-detail.booking.to")+" "+(0,xe.default)(e.endDate).format("DD MMM YYYY")+" - "+(0,xe.default)(e.startDate).format("HH:mm")+" "+this.translate.get("components.workspace.schedules.to")+" "+(0,xe.default)(e.endDate).format("HH:mm"):(0,xe.default)(e.startDate).format("DD MMM YYYY")+" "+this.translate.get("components.order-detail.booking.to")+" "+(0,xe.default)(e.endDate).format("DD MMM YYYY")+" - "+(0,xe.default)(e.startDate).format("HH:mm")+" "+this.translate.get("components.workspace.schedules.to")+" "+(0,xe.default)(e.endDate).format("HH:mm"):this.translate.get("components.dashboard.quotations.headers.start_date")+" : "+(0,xe.default)(e.startDate).format("DD MMM YYYY")+" "+this.translate.get("components.workspace.schedules.to")+" "+(0,xe.default)(e.startDate).format("HH:mm"):this.translate.get("components.dashboard.quotations.headers.end_date")+" : "+(0,xe.default)(e.endDate).format("DD MMM YYYY")+" "+this.translate.get("components.workspace.schedules.to")+" "+(0,xe.default)(e.endDate).format("HH:mm")}getTransactionsPayment(){return this.ref?.order?.transactions.filter(e=>e.type==="PAYMENT"&&e.status==="SUCCEEDED")}getTransactionsRefunds(){let e=this.ref?.order?.transactions?.concat(this.ref?.transactions);return e=e?.filter(n=>n.type==="REFUND"&&n.status==="SUCCEEDED"),e=e?.reduce(function(n,t){return n.find(s=>s.id===t.id)||n.push(t),n},[]),e}getPaymentInformations(e){if(this.ref?.status==="PAID")return this.translate.get("components.dashboard.invoices.details.payment_informations").replace(":sum",e?.amount/100).replace(":date",(0,xe.default)(e?.capturedAt??e?.createdAt).format("DD MMM YYYY")).replace(":hour",(0,xe.default)(e?.capturedAt??e?.createdAt).format("HH:mm")).replace(":type",this.translate.get("components.user.infopop."+e?.method.toLowerCase()).toLowerCase())}getRefundInformations(e){return this.translate.get("components.dashboard.invoices.details.refund_informations").replace(":sum",e?.amount/100).replace(":date",(0,xe.default)(e?.createdAt).format("DD MMM YYYY")).replace(":hour",(0,xe.default)(e?.createdAt).format("HH:mm")).replace(":type",this.translate.get("components.user.infopop."+e?.method.toLowerCase()).toLowerCase())}getWorkspaceReference(e){return e?e.split("/")[1].split("-")[0]:""}goToWorkspace(e){let n=this.translate.get("pages.app.workspace.metadata.url").replace(":url",e);window.open(ut.front+n,"_blank")}getURLType(){return(this.ref?.entity_id??"invoice")+"s"}getRefTotal(){if(this.ref){let e=this.ref.total;return this.ref.children!=null&&this.ref.children.filter(n=>n.type==="CREDIT").forEach(n=>{e-=n.total}),e}return 0}informationsCompleted(){if(this.ref){let e=this.ref.recipient;return e.isPro?!this.utils.isBlank(e.socialReason)&&!this.utils.isBlank(e.address?.address1)&&!this.utils.isBlank(e.address?.addressCity)&&!this.utils.isBlank(e.address?.addressPostalCode):!this.utils.isBlank(e.firstname)&&!this.utils.isBlank(e.lastname)&&!this.utils.isBlank(e.address?.address1)&&!this.utils.isBlank(e.address?.addressCity)&&!this.utils.isBlank(e.address?.addressPostalCode)}return!1}modalCompleteInformations(){let e=JSON.parse(localStorage.getItem("user"));this.modalService.open(this.informationsModal,{size:"lg",centered:!0}),this.ref.recipient.phone||this.formGroup.get("phone").setValue(e.phoneNumber),this.ref.recipient.address.address1||this.formGroup.get("address").setValue(e.socialAddress.address1),this.ref.recipient.address.addressPostalCode||this.formGroup.get("postalCode").setValue(e.socialAddress.addressPostalCode),this.ref.recipient.address.addressCity||this.formGroup.get("city").setValue(e.socialAddress.addressCity)}switchPartPro(e){this.isPro=e===1}initFromQuotation(){this.formGroup&&(this.formGroup.get("social_reason").setValue(this.ref?.recipient?.socialReason),this.formGroup.get("siren").setValue(this.ref?.recipient?.siren),this.formGroup.get("firstname").setValue(this.ref?.recipient?.firstname),this.formGroup.get("lastname").setValue(this.ref?.recipient?.lastname),this.formGroup.get("address").setValue(this.ref?.recipient?.address?.address1),this.formGroup.get("city").setValue(this.ref?.recipient?.address?.addressCity),this.formGroup.get("postalCode").setValue(this.ref?.recipient?.address?.addressPostalCode),this.formGroup.get("billingEmail").setValue(this.ref?.recipient?.billingEmail),this.formGroup.get("phone").setValue(this.ref?.recipient?.phone))}updateQuotation(){let e=this.ref.recipient;if(this.isPro?(e.socialReason=this.formGroup.get("social_reason").value,e.siren=this.formGroup.get("siren").value,e.label=this.formGroup.get("social_reason").value,e.firstname=null,e.lastname=null):(e.firstname=this.formGroup.get("firstname").value,e.lastname=this.formGroup.get("lastname").value,e.label=this.formGroup.get("firstname").value+" "+this.formGroup.get("lastname").value,e.socialReason=null,e.siren=null),this.ref.recipient=Object.assign({},this.ref.recipient,{address:{address1:this.formGroup.get("address").value,addressCity:this.formGroup.get("city").value,addressPostalCode:this.formGroup.get("postalCode").value},billingEmail:this.formGroup.get("billingEmail").value,isPro:this.isPro,phone:this.formGroup.get("phone").value}),this.informationsCompleted()){let n=null,t=null,s=null,_=null;this.formGroup&&(n=this.formGroup.get("address").value,t=this.formGroup.get("city").value,s=this.formGroup.get("postalCode").value,_=this.formGroup.get("phone").value),this.ref.entity_id==="quotation"?this.api.quotationService.save(this.ref.id,n,t,s,_).then(()=>{this.modalService.dismissAll()}):this.ref.entity_id==="invoice"&&this.api.invoiceService.save(this.ref.id,n,t,s,_).then(()=>{this.modalService.dismissAll()})}else this.toastr.error(this.translate.get("pages.dashboard.manage_quotation.toartr_error"))}showInputErrors(){this.purchase_order_number.markAsTouched()}showInputsErrors(){this.formGroup.markAllAsTouched()}openUrl(e){let n;this.type==="quotation"?n=this.translate.get("pages.app.quotation.metadata.url").replace(":quotationId",e):n=this.translate.get("pages.app.invoice.metadata.url").replace(":invoiceId",e),window.open(n,"_blank")}statusAllowsUpdate(e){return e?e.status!=="EXPIRED"&&e.status!=="PAID"&&e.status!=="CANCELLED"&&e.status!=="VALIDATED":!1}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(U),y(Dn),y(Ce),y(Ue),y(_e))}}static{this.\u0275cmp=P({type:i,selectors:[["app-quotation-invoice"]],viewQuery:function(n,t){if(n&1&&A(ud,7),n&2){let s;D(s=O())&&(t.informationsModal=s.first)}},inputs:{updateType:[0,"type","updateType"],updatePreview:[0,"preview","updatePreview"],updateEnterPo:[0,"ref","updateEnterPo"],updateShowInputErrors:[0,"showErrors","updateShowInputErrors"]},outputs:{productOrderChange:"productOrderChange"},decls:100,vars:79,consts:[["informationsModal",""],["popErrorTitle",""],["popError",""],["informationsBtn",""],["class","my-3 mx-auto",3,"diameter",4,"ngIf"],[1,"mb-0"],[1,"row"],[1,"col-12","col-md"],["class","title-modal mb-0",4,"ngIf"],["class","open-pdf","target","_blank","rel","noopener",3,"href",4,"ngIf"],[1,"col-12","col-md","mt-4","mt-md-0"],[1,"mb-1","text-md-end"],["class","mb-1 text-md-end",4,"ngIf"],["class","d-flex justify-content-md-end mt-2",4,"ngIf"],[1,"row","mt-4"],[1,"col-12","col-md-6"],[1,"subtitle-modal","mb-1"],[1,"email",3,"href"],[1,"my-4"],[4,"ngIf"],[1,"col-12","col-md-6","my-4","mt-md-0"],[1,"subtitle-modal","mb-1","text-md-end"],[1,"d-flex","justify-content-md-end"],[1,"mb-0","text-md-end"],[1,"mt-4"],[1,"text-md-end"],["class","mt-1 d-flex justify-content-md-end",4,"ngIf"],[1,"row","justify-content-end"],[1,"col-12","overflow-auto"],[1,"table"],["scope","col",1,"ps-0"],["scope","col"],["scope","col",1,"text-end","pe-0"],[4,"ngFor","ngForOf"],[1,"table","table-bordered"],[1,"w-50"],[1,"text-end","pe-0"],[1,"border-top"],["class","row mt-3",4,"ngIf"],[1,"my-3","mx-auto",3,"diameter"],[1,"title-modal","mb-0"],["target","_blank","rel","noopener",1,"open-pdf",3,"href"],[1,"d-flex","justify-content-md-end","mt-2"],[1,"status_tag",3,"ngClass"],[1,"mt-1","d-flex","justify-content-md-end"],["type","TERTIARY",1,"mx-2",3,"clicked","iconName","textKey","noActiveBorders","paddingX","dangerMode"],[1,"ps-0","max-w-250"],["href","javascript:void(0)","class","link-workspace",3,"click",4,"ngIf"],["class","dates mb-0",4,"ngIf"],["href","javascript:void(0)",1,"link-workspace",3,"click"],[1,"dates","mb-0"],["line?.coupon?.isPercent",""],[3,"b-top",4,"ngFor","ngForOf"],[1,"row","mt-3"],[1,"fw-semi-bold"],[1,"col-12","col-md-6","mt-3","mt-md-0"],["class","col-12 my-3",4,"ngIf"],["class","col-12 my-2",4,"ngIf"],[1,"col-12","my-3"],[1,"subtitle-modal"],[1,"w-100","max-w-250"],["matInput","","type","text","name","purchase_order_number","required","",3,"formControl","placeholder"],[1,"subtitle-modal","mb-0"],[1,"col-12","my-2"],[1,"fw-semi-bold","mb-0"],["class","col-12",4,"ngIf"],[1,"col-12"],[1,"modal-header"],[1,"modal-title","w-100"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[3,"formGroup"],[1,"row","justify-content-center"],[1,"col-12","mb-3"],["animationDuration","0ms","mat-align-tabs","center",3,"selectedIndexChange","selectedIndex","disableRipple"],[3,"label"],[1,"w-100"],["matInput","","type","email","name","billingEmail","formControlName","billingEmail",3,"placeholder"],["matInput","","type","tel","name","phone","formControlName","phone",3,"placeholder"],["matInput","","type","text","name","siren","formControlName","siren",3,"placeholder"],["matInput","","type","text","name","social_reason","formControlName","social_reason",3,"required","placeholder"],["matInput","","type","text","name","lastname","formControlName","lastname",3,"required","placeholder"],["matInput","","type","text","name","firstname","formControlName","firstname",3,"required","placeholder"],["matInput","","type","text","name","address","formControlName","address","required","",3,"placeholder"],["matInput","","type","text","name","postalCode","formControlName","postalCode","required","",3,"placeholder"],["matInput","","type","text","name","city","formControlName","city","required","",3,"placeholder"],[1,"col-12","justify-content-center","d-flex","py-3"],["placement","top","container","body","popoverClass","error-informations","triggers","mouseenter:mouseleave",3,"mouseenter","ngbPopover","popoverTitle","disablePopover"],["textKey","pages.dashboard.manage_quotation.save","type","PRIMARY",1,"mx-2",3,"clicked","isDisabled"],[1,"errors-title"],[1,"text-start"],[1,"my-1"]],template:function(n,t){n&1&&(h(0,hd,1,1,"mat-spinner",4),a(1,"section",5)(2,"div",6)(3,"div",7),h(4,gd,2,1,"p",8)(5,fd,3,4,"a",9),l(),a(6,"div",10)(7,"p",11),p(8),d(9,"translate"),d(10,"translate"),l(),h(11,vd,4,5,"p",12)(12,bd,3,3,"p",12)(13,Cd,5,13,"div",13),l()(),a(14,"div",14)(15,"div",15)(16,"p",16),p(17),d(18,"translate"),l(),a(19,"a",17),p(20),l(),a(21,"div",18)(22,"p"),h(23,xd,3,1,"ng-container",19)(24,yd,3,1,"ng-container",19)(25,kd,2,1,"ng-container",19)(26,wd,3,1,"ng-container",19)(27,Sd,3,3,"ng-container",19),l()()(),a(28,"div",20)(29,"p",21),p(30),d(31,"translate"),l(),a(32,"div",22)(33,"a",17),p(34),l()(),a(35,"p",23),p(36),l(),a(37,"div",24)(38,"p",25),h(39,Md,3,1,"ng-container",19)(40,Id,3,1,"ng-container",19)(41,Ed,2,1,"ng-container",19)(42,Pd,2,1,"ng-container",19)(43,Td,4,3,"ng-container",19)(44,Dd,6,4,"ng-container",19),l()(),h(45,Od,2,5,"div",26),l()(),a(46,"div",27)(47,"div",28)(48,"table",29)(49,"thead")(50,"tr")(51,"th",30),p(52),d(53,"translate"),l(),a(54,"th",31),p(55),d(56,"translate"),l(),a(57,"th",31),p(58),d(59,"translate"),l(),a(60,"th",31),p(61),d(62,"translate"),l(),a(63,"th",31),p(64),d(65,"translate"),l(),a(66,"th",32),p(67),d(68,"translate"),l()()(),a(69,"tbody"),h(70,qd,19,16,"tr",33),l()()(),a(71,"div",15)(72,"table",34)(73,"thead"),h(74,Wd,7,7,"tr",19)(75,Ud,7,7,"tr",19),a(76,"tr")(77,"th",35),p(78),d(79,"translate"),l(),a(80,"td",36),p(81),d(82,"currency"),l()(),h(83,zd,8,11,"tr",33),a(84,"tr",37)(85,"th",35),p(86),d(87,"translate"),l(),a(88,"td",36),p(89),d(90,"currency"),l()(),h(91,Hd,9,8,"ng-container",19),l()()()(),h(92,tm,21,23,"div",38)(93,mm,5,4,"div",38),l(),h(94,xm,92,94,"ng-template",null,0,ne)(96,ym,5,3,"ng-template",null,1,ne)(98,km,5,3,"ng-template",null,2,ne)),n&2&&(c("ngIf",t.isLoading),o(),E("d-none",t.isLoading),o(3),c("ngIf",t.type==="quotation"),o(),c("ngIf",!t.preview),o(3),g(" ",u(9,49,"global."+t.type)+" "+u(10,51,"components.dashboard.quotations.headers.number")+(t.ref==null?null:t.ref.reference)," "),o(3),c("ngIf",t.type==="credit"),o(),c("ngIf",t.ref==null?null:t.ref.purchaseOrder),o(),c("ngIf",t.ref==null?null:t.ref.status),o(4),g(" ",u(18,53,"global.sender")," "),o(2),fa("href","mailto:",t.ref==null||t.ref.source==null?null:t.ref.source.email,"",K),o(),g(" ",t.ref==null||t.ref.source==null?null:t.ref.source.email," "),o(3),c("ngIf",t.ref==null||t.ref.source==null?null:t.ref.source.label),o(),c("ngIf",t.ref==null||t.ref.source==null||t.ref.source.address==null?null:t.ref.source.address.address1),o(),c("ngIf",t.ref==null||t.ref.source==null||t.ref.source.address==null?null:t.ref.source.address.addressPostalCode),o(),c("ngIf",t.ref==null||t.ref.source==null||t.ref.source.address==null?null:t.ref.source.address.addressCity),o(),c("ngIf",t.ref==null||t.ref.source==null?null:t.ref.source.siren),o(3),g(" ",u(31,55,"components.dashboard.quotations.details.recipient.for")," "),o(3),fa("href","mailto:",t.ref==null||t.ref.recipient==null?null:t.ref.recipient.email,"",K),o(),g(" ",t.ref==null||t.ref.recipient==null?null:t.ref.recipient.email," "),o(2),g(" ",t.ref==null||t.ref.recipient==null?null:t.ref.recipient.phone," "),o(3),c("ngIf",t.ref==null||t.ref.recipient==null?null:t.ref.recipient.label),o(),c("ngIf",t.ref==null||t.ref.recipient==null||t.ref.recipient.address==null?null:t.ref.recipient.address.address1),o(),c("ngIf",t.ref==null||t.ref.recipient==null||t.ref.recipient.address==null?null:t.ref.recipient.address.addressPostalCode),o(),c("ngIf",t.ref==null||t.ref.recipient==null||t.ref.recipient.address==null?null:t.ref.recipient.address.addressCity),o(),c("ngIf",t.ref==null||t.ref.recipient==null?null:t.ref.recipient.siren),o(),c("ngIf",t.ref==null||t.ref.recipient==null?null:t.ref.recipient.billingEmail),o(),c("ngIf",!t.preview&&t.statusAllowsUpdate(t.ref)),o(7),g(" ",u(53,57,"components.dashboard.quotations.details.lines.description")," "),o(3),w(u(56,59,"components.dashboard.quotations.details.lines.quantity")),o(3),w(u(59,61,"components.dashboard.quotations.details.lines.price")),o(3),w(u(62,63,"components.dashboard.quotations.details.lines.discount")),o(3),w(u(65,65,"components.dashboard.quotations.details.lines.tva")),o(3),g(" ",u(68,67,"components.dashboard.quotations.details.lines.total")," "),o(3),c("ngForOf",t.ref==null?null:t.ref.lines),o(4),c("ngIf",(t.ref==null?null:t.ref.reduction)>0),o(),c("ngIf",(t.ref==null?null:t.ref.reduction)>0),o(),E("b-top",(t.ref==null?null:t.ref.reduction)>0),o(2),w(u(79,69,"pages.dashboard.manage_quotation.form.taxes.total_ht")),o(3),w(T(82,71,(t.ref==null?null:t.ref.totalWithoutTaxes)/100,"EUR")),o(2),c("ngForOf",t.keys(t.ref==null?null:t.ref.taxes)),o(3),w(u(87,74,"pages.dashboard.manage_quotation.form.taxes.total_ttc")),o(3),w(T(90,76,(t.ref==null?null:t.ref.total)/100,"EUR")),o(2),c("ngIf",(t.ref==null||t.ref.children==null?null:t.ref.children.length)>0),o(),c("ngIf",t.type==="quotation"),o(),c("ngIf",t.type==="invoice"||t.type==="credit"))},dependencies:[ft,fe,ee,ht,zt,Be,Ei,ui,ce,j,R,ae,rt,St,ve,Vi,Zt,be,$,Et,H,Ms,Xe,N,gi,ei,Hn,ti,ii],styles:[".title-modal[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.subtitle-modal[_ngcontent-%COMP%]{font-size:16px;font-weight:600}.open-pdf[_ngcontent-%COMP%]{font-size:14px;color:var(--primary-color, var(--primary-color-600));text-decoration:underline}.email[_ngcontent-%COMP%]{color:var(--primary-color, var(--primary-color-600));text-decoration:underline}.float-end[_ngcontent-%COMP%]{float:right}.table[_ngcontent-%COMP%]{border-bottom:1px solid #e9e6e6;color:#55585e}.table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{padding:5px;vertical-align:top;border-top:none}.table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;font-weight:600}.table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:10px 5px}.table-bordered[_ngcontent-%COMP%]{line-height:1;border:none}.table-bordered[_ngcontent-%COMP%]   .border-top[_ngcontent-%COMP%]{border-top:solid 1px #e9e6e6!important;font-size:18px}.table-bordered[_ngcontent-%COMP%]   .b-top[_ngcontent-%COMP%]{border-top:solid 1px #e9e6e6!important}.table-bordered[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{border:none;padding:10px 5px 0 0}.table-bordered[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border:none}.fw-semi-bold[_ngcontent-%COMP%]{font-weight:600}.dates[_ngcontent-%COMP%]{color:var(--primary-color-500);font-size:14px}.link-workspace[_ngcontent-%COMP%]{color:#55585e}.max-w-250[_ngcontent-%COMP%]{max-width:250px}p[_ngcontent-%COMP%]{margin-bottom:0!important}  .mat-mdc-checkbox-layout{white-space:normal!important}  .mat-mdc-checkbox-layout .mat-mdc-checkbox-inner-container{margin-top:5px}.open-modal-informations[_ngcontent-%COMP%]{border:none;background:none;color:var(--primary-color-600)}.open-modal-informations[_ngcontent-%COMP%]:hover{text-decoration:underline}.open-modal-informations[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{fill:var(--primary-color-600);width:16px;height:16px;margin-right:.2rem}.open-modal-informations.complete[_ngcontent-%COMP%]{color:#d3153b}.open-modal-informations.complete[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{fill:#d3153b}  .mat-mdc-tab-group.mat-mdc-primary .mat-mdc-ink-bar{background-color:var(--primary-color-600)}  .mat-mdc-tab-header{border-bottom:none}  .mat-mdc-tab-label{border-bottom:1px solid #ebebeb;font-size:16px}  .mat-mdc-tab-label-active{opacity:1!important}"]})}}return i})();var Er=Me(hi());var wr=class{};var fo=class{constructor(){this.address=new wr}};var Hl=class{constructor(){this.getSuperType=()=>this.type?this.type==="CREDIT"?"INVOICE":this.type:"INVOICE",this.source=new fo,this.recipient=new fo}},vo=function(i){return i.CANCELLED="CANCELLED",i.CREATED="CREATED",i.CREDIT="CREDIT",i.EXPIRED="EXPIRED",i.PAID="PAID",i.VALIDATED="VALIDATED",i.WAITING_PAYMENT="WAITING_PAYMENT",i}(vo||{});var bo=Me(hi());var Ta=Me(hi());var Sm=()=>["c_mfit","f_png","w_100","h_100"],Mm=i=>({sepa:i});function Im(i,r){if(i&1&&x(0,"img",8),i&2){let e=m(2);c("src","/assets/images/icons/brands/"+(e.source==null?null:e.source.brand.toLowerCase().replace(" ","_"))+".svg",K)}}function Em(i,r){i&1&&x(0,"img",8),i&2&&c("src","/assets/images/icons/brands/sepa_direct_debit.svg",K)}function Pm(i,r){if(i&1&&(a(0,"div",3),h(1,Im,1,1,"img",7)(2,Em,1,1,"img",7),l()),i&2){let e=m();o(),c("ngIf",(e.source==null?null:e.source.brand)!=null&&(e.source==null?null:e.source.brand)!="Unknown"),o(),c("ngIf",(e.source==null?null:e.source.type)=="sepa")}}function Tm(i,r){if(i&1&&(x(0,"img",12),d(1,"imageTransform")),i&2){let e=m(2);c("src",T(1,1,e.source==null||e.source.company==null?null:e.source.company.logo,X(4,Sm)),K)}}function Dm(i,r){i&1&&x(0,"img",13)}function Om(i,r){if(i&1&&(a(0,"div",14),p(1),l()),i&2){let e=r.$implicit,n=r.index;_a("background-color",e.color),we("id","group_"+n.toString()),o(),g(" ",e.initials," ")}}function Bm(i,r){if(i&1&&(a(0,"div",3),h(1,Tm,2,5,"img",9)(2,Dm,1,0,"img",10)(3,Om,2,4,"div",11),l()),i&2){let e=m();o(),c("ngIf",(e.source==null||e.source.company==null?null:e.source.company.logo)!=null),o(),c("ngIf",(e.source==null||e.source.company==null?null:e.source.company.logo)==null),o(),c("ngForOf",e.source==null?null:e.source.groups)}}function Am(i,r){if(i&1&&(a(0,"h5")(1,"strong"),p(2),l()()),i&2){let e=m();o(2),Q("",e.source==null?null:e.source.label," (",e.source==null||e.source.company==null?null:e.source.company.socialReason,")")}}function Vm(i,r){if(i&1&&(a(0,"h5")(1,"strong"),p(2),d(3,"currency"),l(),a(4,"span",15),p(5),d(6,"currency"),d(7,"translate"),d(8,"translate"),d(9,"replace"),l()()),i&2){let e=m();o(2),w(T(3,3,(e.source==null?null:e.source.remaining)/100,"EUR")),o(3),Q(" / ",T(6,6,(e.source==null?null:e.source.initial)/100,"EUR")," ",te(9,13,u(7,9,"components.source.credit.title"),"{{FREQUENCY}}",u(8,11,"components.source.frequencies."+e.frequency()))," ")}}function Rm(i,r){if(i&1&&(M(0),p(1),d(2,"translate"),d(3,"translate"),d(4,"replace"),S()),i&2){let e=m(2);o(),g(" ",te(4,5,u(2,1,"components.source.quota_frequency"),"{{FREQUENCY}}",u(3,3,"components.source.frequencies."+e.frequency()))," ")}}function Nm(i,r){if(i&1&&(a(0,"p"),p(1),h(2,Rm,5,9,"ng-container",4),l()),i&2){let e=m();o(),g(" ",e.remainingQuotas()," "),o(),c("ngIf",e.frequency()!=="none")}}function Fm(i,r){if(i&1&&(a(0,"h5",16)(1,"strong"),p(2),l()()),i&2){let e=m();c("ngClass",re(2,Mm,(e.source==null?null:e.source.type)=="sepa")),o(2),w(e.source==null?null:e.source.number)}}function Lm(i,r){if(i&1&&(a(0,"p"),p(1),d(2,"translate"),l()),i&2){let e=m();o(),Q(" ",u(2,2,"components.source.expiration_date")," ",e.source==null?null:e.source.expirationDate," ")}}function qm(i,r){i&1&&x(0,"app-button",22),i&2&&c("isDisabled",!0)}function Wm(i,r){if(i&1){let e=k();a(0,"app-button",23),b("clicked",function(t){f(e);let s=m(2);return v(s.default(s.source,t))}),l()}if(i&2){let e=m(2);c("textKey","components.source.set_default_"+e.source.type)}}function Um(i,r){if(i&1){let e=k();a(0,"div",17)(1,"div",18),h(2,qm,1,1,"app-button",19)(3,Wm,1,1,"app-button",20),a(4,"app-button",21),b("clicked",function(t){f(e);let s=m();return v(s.tryToRemove(s.source,t))}),l()()()}if(i&2){let e=m();o(2),c("ngIf",e.source==null?null:e.source.isDefault),o(),c("ngIf",!(e.source!=null&&e.source.isDefault))}}var Yl=(()=>{class i{constructor(e,n,t){this.api=e,this.translate=n,this.utils=t,this.selected=!1,this.selection=!1}ngOnInit(){}frequency(){return this.source.type==="quota"||this.source.type==="credit"?this.source.frequency.toLowerCase():""}remainingQuotas(){return this.utils.minutesToString(this.source.remaining)+" / "+this.utils.minutesToString(this.source.initial)}tryToRemove(e,n){return z(this,null,function*(){(yield this.api.userService.sourcesService.checkInUse(e,n?.button))?Ta.default.fire({icon:"error",text:this.translate.get("components.source.swal.in_use.text"),showCancelButton:!1,confirmButtonText:this.translate.get("global.close")}):this.remove(e,n)})}remove(e,n){return z(this,null,function*(){Ta.default.fire({icon:"warning",text:this.translate.get("components.source.delete_swal"),showCancelButton:!0,confirmButtonText:this.translate.get("global.confirm"),cancelButtonText:this.translate.get("global.cancel"),focusCancel:!0,reverseButtons:!0}).then(t=>{t&&t.value&&this.api.userService.sourcesService.delete(e.id,n.button)})})}default(e,n){this.api.userService.sourcesService.default(e.id,n.button)}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(U),y(_e))}}static{this.\u0275cmp=P({type:i,selectors:[["app-source"]],inputs:{source:"source",selected:"selected",selection:"selection"},decls:11,vars:8,consts:[[1,"card-body"],[1,"row","align-items-center"],["class","col-auto",4,"ngIf"],[1,"col-auto"],[4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","card-footer",4,"ngIf"],["class","align-self-center me-3","alt","Card brand",3,"src",4,"ngIf"],["alt","Card brand",1,"align-self-center","me-3",3,"src"],["alt","company logo","class","align-self-start img-contain img-credit",3,"src",4,"ngIf"],["alt","profile image","class","align-self-start img-fluid m-auto","src","/assets/images/empty_company_logo.png",4,"ngIf"],["class","group",3,"id","backgroundColor",4,"ngFor","ngForOf"],["alt","company logo",1,"align-self-start","img-contain","img-credit",3,"src"],["alt","profile image","src","/assets/images/empty_company_logo.png",1,"align-self-start","img-fluid","m-auto"],[1,"group",3,"id"],[1,"remaining"],[3,"ngClass"],[1,"card-footer"],[1,"d-flex","justify-content-between"],["iconName","check","textKey","components.source.is_default.generic","type","SECONDARY",3,"isDisabled",4,"ngIf"],["type","SECONDARY",3,"textKey","clicked",4,"ngIf"],["iconName","delete","type","SECONDARY",3,"clicked"],["iconName","check","textKey","components.source.is_default.generic","type","SECONDARY",3,"isDisabled"],["type","SECONDARY",3,"clicked","textKey"]],template:function(n,t){n&1&&(a(0,"div",0)(1,"div",1),h(2,Pm,3,2,"div",2)(3,Bm,4,3,"div",2),a(4,"div",3),h(5,Am,3,2,"h5",4)(6,Vm,10,17,"h5",4)(7,Nm,3,2,"p",4)(8,Fm,3,4,"h5",5)(9,Lm,3,4,"p",4),l()()(),h(10,Um,5,2,"div",6)),n&2&&(o(2),c("ngIf",(t.source==null?null:t.source.type)=="sepa"||(t.source==null?null:t.source.brand)),o(),c("ngIf",(t.source==null?null:t.source.type)=="credit"||(t.source==null?null:t.source.type)=="quota"),o(2),c("ngIf",(t.source==null?null:t.source.type)=="quota"),o(),c("ngIf",(t.source==null?null:t.source.type)=="credit"),o(),c("ngIf",(t.source==null?null:t.source.type)=="quota"),o(),c("ngIf",(t.source==null?null:t.source.type)=="sepa"||(t.source==null?null:t.source.type)=="card"),o(),c("ngIf",(t.source==null?null:t.source.type)=="card"),o(),c("ngIf",!t.selection&&(t.source==null?null:t.source.type)!="quota"&&(t.source==null?null:t.source.type)!="credit"))},dependencies:[ce,j,R,H,Xe,N,et,ri],styles:[".group[_ngcontent-%COMP%]{color:#fff;text-align:center;height:30px;width:30px;line-height:30px;border-radius:100%;position:absolute;top:-3px;right:-3px}#group_1[_ngcontent-%COMP%]{top:27px;right:-17px}#group_2[_ngcontent-%COMP%]{top:60px;right:-12px}#group_3[_ngcontent-%COMP%]{top:86px;right:10px}#group_4[_ngcontent-%COMP%]{top:87px;right:44px}strong[_ngcontent-%COMP%]{font-weight:600;font-size:20px}.remaining[_ngcontent-%COMP%]{font-size:16px}h4[_ngcontent-%COMP%]{color:var(--primary-color-1000)}.source-left[_ngcontent-%COMP%]{width:100px;height:100px;border-radius:100px}.source-left[_ngcontent-%COMP%]   .img-credit[_ngcontent-%COMP%]{border-radius:100px;height:100px;width:100px;object-fit:contain}.source-left[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%]{line-height:95px}p[_ngcontent-%COMP%]{color:var(--primary-color-500)}.sepa[_ngcontent-%COMP%]{margin-bottom:revert}.card-footer[_ngcontent-%COMP%]{background:#fff;border:none;padding-top:0}"]})}}return i})();var jm=["addCardModal"],Qm=["addIbanModal"],Hm=i=>({"environment-page":i});function Ym(i,r){if(i&1){let e=k();a(0,"div",13)(1,"app-source",14),b("click",function(){let t=f(e).$implicit,s=m(2);return v(s.select(t))}),l()()}if(i&2){let e=r.$implicit,n=m(2);o(),E("selected",(n.selected==null?null:n.selected.id)==e.id)("disabled",e.disabled),c("source",e)("selected",(n.selected==null?null:n.selected.id)==e.id)("selection",n.selection)}}function Gm(i,r){if(i&1){let e=k();a(0,"mat-expansion-panel",7),b("opened",function(){f(e);let t=m();return v(t.panelOpenStateQuota=!0)})("closed",function(){f(e);let t=m();return v(t.panelOpenStateQuota=!1)}),a(1,"mat-expansion-panel-header")(2,"div",8)(3,"div",9)(4,"h5",10),p(5),d(6,"translate"),l()()()(),a(7,"div",11),h(8,Ym,2,7,"div",12),l()()}if(i&2){let e=m();c("expanded",e.panelOpenStateQuota),o(5),g(" ",u(6,3,"components.sources.quotas.title")," "),o(3),c("ngForOf",e.sources==null?null:e.sources.quotas)}}function Km(i,r){if(i&1){let e=k();a(0,"div",13)(1,"app-source",14),b("click",function(){let t=f(e).$implicit,s=m(2);return v(s.select(t))}),l()()}if(i&2){let e=r.$implicit,n=m(2);o(),E("selected",(n.selected==null?null:n.selected.id)==e.id)("disabled",e.disabled||n.unselectableInsufficientlyCredit&&n.amountDue>(e==null?null:e.remaining)),c("source",e)("selected",(n.selected==null?null:n.selected.id)==e.id)("selection",n.selection)}}function $m(i,r){if(i&1){let e=k();a(0,"mat-expansion-panel",7),b("opened",function(){f(e);let t=m();return v(t.panelOpenStateCredits=!0)})("closed",function(){f(e);let t=m();return v(t.panelOpenStateCredits=!1)}),a(1,"mat-expansion-panel-header")(2,"div",8)(3,"div",9)(4,"h5",10),p(5),d(6,"translate"),l()()()(),a(7,"div",11),h(8,Km,2,7,"div",12),l()()}if(i&2){let e=m();c("expanded",e.panelOpenStateCredits),o(5),g(" ",u(6,3,"components.sources.credits.title")," "),o(3),c("ngForOf",e.sources==null?null:e.sources.credits)}}function Xm(i,r){i&1&&(M(0),x(1,"mat-spinner",20),S()),i&2&&(o(),c("diameter",25))}function Jm(i,r){i&1&&(a(0,"p",21),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.sources.ibans.no_iban")," "))}function Zm(i,r){if(i&1){let e=k();a(0,"div",13)(1,"app-source",14),b("click",function(){let t=f(e).$implicit,s=m(3);return v(s.select(t))}),l()()}if(i&2){let e=r.$implicit,n=m(3);o(),E("selected",(n.selected==null?null:n.selected.id)==e.id),c("source",e)("selected",(n.selected==null?null:n.selected.id)==e.id)("selection",n.selection)}}function eu(i,r){if(i&1&&(a(0,"div",11),h(1,Zm,2,5,"div",12),l()),i&2){let e=m(2);o(),c("ngForOf",e.sources==null?null:e.sources.cards)}}function tu(i,r){if(i&1){let e=k();a(0,"mat-expansion-panel",7),b("opened",function(){f(e);let t=m();return v(t.panelOpenStateCards=!0)})("closed",function(){f(e);let t=m();return v(t.panelOpenStateCards=!1)}),a(1,"mat-expansion-panel-header")(2,"div",8)(3,"div",9)(4,"h5",10),p(5),d(6,"translate"),l()(),a(7,"div",15)(8,"app-button",16),b("clicked",function(t){return f(e),m().addCard(),v(t.event==null?null:t.event.stopPropagation())}),l()()()(),h(9,Xm,2,1,"ng-container",17)(10,Jm,3,3,"p",18)(11,eu,2,1,"div",19),l()}if(i&2){let e=m();c("expanded",e.panelOpenStateCards),o(5),g(" ",u(6,6,"components.sources.cards.title")," "),o(3),c("isDisabled",e.cardLoading),o(),c("ngIf",e.isLoading),o(),c("ngIf",!e.isLoading&&(e.sources==null||e.sources.cards==null?null:e.sources.cards.length)===0),o(),c("ngIf",!e.isLoading&&(e.sources==null||e.sources.cards==null?null:e.sources.cards.length)>0)}}function iu(i,r){i&1&&(M(0),x(1,"mat-spinner",20),S()),i&2&&(o(),c("diameter",25))}function nu(i,r){i&1&&(a(0,"p",21),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.sources.ibans.no_iban")," "))}function ou(i,r){if(i&1){let e=k();a(0,"div",13)(1,"app-source",14),b("click",function(){let t=f(e).$implicit,s=m(3);return v(s.select(t))}),l()()}if(i&2){let e=r.$implicit,n=m(3);o(),E("selected",(n.selected==null?null:n.selected.id)==e.id),c("source",e)("selected",(n.selected==null?null:n.selected.id)==e.id)("selection",n.selection)}}function ru(i,r){if(i&1&&(a(0,"div",11),h(1,ou,2,5,"div",12),l()),i&2){let e=m(2);o(),c("ngForOf",e.sources==null?null:e.sources.sepas)}}function au(i,r){if(i&1){let e=k();a(0,"mat-expansion-panel",7),b("opened",function(){f(e);let t=m();return v(t.panelOpenStateIban=!0)})("closed",function(){f(e);let t=m();return v(t.panelOpenStateIban=!1)}),a(1,"mat-expansion-panel-header")(2,"div",8)(3,"div",9)(4,"h5",10),p(5),d(6,"translate"),l()(),a(7,"div",15)(8,"app-button",22),b("clicked",function(t){return f(e),m().addIban(),v(t.event==null?null:t.event.stopPropagation())}),l()()()(),h(9,iu,2,1,"ng-container",17)(10,nu,3,3,"p",18)(11,ru,2,1,"div",19),l()}if(i&2){let e=m();c("expanded",e.panelOpenStateIban),o(5),g(" ",u(6,6,"components.sources.ibans.title")," "),o(3),c("isDisabled",e.ibanLoading),o(),c("ngIf",e.isLoading),o(),c("ngIf",!e.isLoading&&(e.sources==null||e.sources.sepas==null?null:e.sources.sepas.length)===0),o(),c("ngIf",!e.isLoading&&(e.sources==null||e.sources.sepas==null?null:e.sources.sepas.length)>0)}}function su(i,r){if(i&1){let e=k();a(0,"app-source",14),b("click",function(){let t=f(e).$implicit,s=m(2);return v(s.select(t))}),l()}if(i&2){let e=r.$implicit,n=m(2);E("selected",(n.selected==null?null:n.selected.id)==e.id),c("source",e)("selected",(n.selected==null?null:n.selected.id)==e.id)("selection",n.selection)}}function lu(i,r){if(i&1){let e=k();a(0,"mat-expansion-panel",7),b("opened",function(){f(e);let t=m();return v(t.panelOpenStateOthers=!0)})("closed",function(){f(e);let t=m();return v(t.panelOpenStateOthers=!1)}),a(1,"mat-expansion-panel-header")(2,"div",8)(3,"div",9)(4,"h5",10),p(5),d(6,"translate"),l()()()(),a(7,"section",23)(8,"div",24)(9,"div",25)(10,"div",13)(11,"div",26),h(12,su,1,5,"app-source",27),l()()()()()()}if(i&2){let e=m();c("expanded",e.panelOpenStateOthers),o(5),g(" ",u(6,3,"components.sources.others.title")," "),o(7),c("ngForOf",e.sources==null?null:e.sources.others)}}function cu(i,r){i&1&&(a(0,"div",46)(1,"div",47)(2,"div",13),x(3,"mat-progress-spinner",48),l()()())}function pu(i,r){if(i&1&&(a(0,"div",49)(1,"div",37)(2,"mat-error"),p(3),l()()()),i&2){let e=m(2);o(3),w(e.invalidCardError==null?null:e.invalidCardError.message)}}function du(i,r){if(i&1){let e=k();h(0,cu,4,0,"div",28),a(1,"div",29)(2,"div",30)(3,"h5",31),p(4),d(5,"translate"),l(),a(6,"button",32),b("click",function(){let t=f(e).$implicit;return v(t.dismiss("Cross click"))}),a(7,"span",33),p(8,"\xD7"),l()()(),a(9,"div",34)(10,"div",35)(11,"div",36)(12,"div",37)(13,"ngx-stripe-card",38,2),b("change",function(t){f(e);let s=V(14),_=m();return v(_.cardUpdated(t,s))}),l()()(),h(15,pu,4,1,"div",39),l()(),a(16,"div",40)(17,"div",41)(18,"div",13),x(19,"img",42),l(),a(20,"div",43)(21,"app-button",44),b("clicked",function(){let t=f(e).$implicit;return v(t.close("Cancel click"))}),l(),a(22,"app-button",45,3),b("clicked",function(t){let s=f(e).$implicit,_=m();return v(_.getCardToken(s,t))}),l()()()()()}if(i&2){let e=V(14),n=m();c("ngIf",n.cardLoading),o(),c("ngClass",re(11,Hm,n.api.companyEnvironment)),o(3),w(u(5,9,"components.sources.modals.add_card.title")),o(9),c("stripe",n.Stripe)("options",n.stripeCardOptions)("elementsOptions",n.elementsOptions),o(2),c("ngIf",n.invalidCardError),o(6),c("isDisabled",n.cardLoading),o(),c("isDisabled",n.cardLoading||e==null||!n.cardHasBeenUpdated||n.invalidCardError!=null)}}function mu(i,r){i&1&&(a(0,"div",46)(1,"div",47)(2,"div",13),x(3,"mat-progress-spinner",48),l()()())}function uu(i,r){if(i&1&&(a(0,"div",49)(1,"div",37),p(2),l()()),i&2){let e=m(2);o(2),g(" ",e.invalidIbanError==null?null:e.invalidIbanError.message," ")}}function _u(i,r){if(i&1){let e=k();h(0,mu,4,0,"div",28),a(1,"div")(2,"div",30)(3,"h5",31),p(4),d(5,"translate"),l(),a(6,"button",32),b("click",function(){let t=f(e).$implicit;return v(t.dismiss("Cross click"))}),a(7,"span",33),p(8,"\xD7"),l()()(),a(9,"div",34)(10,"div",35)(11,"div",36)(12,"div",50)(13,"mat-form-field",51),x(14,"input",52),d(15,"translate"),l()(),a(16,"div",53)(17,"mat-form-field",51),x(18,"input",54),d(19,"translate"),l()()(),a(20,"div",36)(21,"div",37)(22,"div",55)(23,"ngx-stripe-iban",56,4),b("change",function(t){f(e);let s=V(24),_=m();return v(_.ibanUpdated(t,s))}),l()()()(),h(25,uu,3,1,"div",39),a(26,"div",57)(27,"div",13),x(28,"hr"),l()(),a(29,"div",58)(30,"div",37),p(31),d(32,"translate"),l()()()(),a(33,"div",40)(34,"app-button",59),b("clicked",function(){let t=f(e).$implicit;return v(t.close("Cancel click"))}),l(),a(35,"app-button",60,5),b("clicked",function(){let t=f(e).$implicit,s=m();return v(s.getIbanSource(t))}),l()()()}if(i&2){let e=m();c("ngIf",e.ibanLoading),o(),E("environment-page",e.api.companyEnvironment),o(3),w(u(5,13,"components.sources.modals.add_iban.title")),o(10),c("placeholder",u(15,15,"forms.name.long_name"))("formControl",e.ibanName),o(4),c("placeholder",u(19,17,"forms.email.long_name"))("formControl",e.ibanEmail),o(5),c("stripe",e.Stripe)("options",e.stripeIbanOptions),o(2),c("ngIf",e.invalidIbanError),o(6),g(" ",u(32,19,"components.sources.modals.add_iban.disclaimer")," "),o(4),c("isDisabled",e.ibanElement==null||!e.ibanElementCompleted||!e.ibanName.valid||!e.ibanEmail.valid)}}var Qi=(()=>{class i{constructor(e,n,t,s){this.api=e,this.modalService=n,this.translate=t,this.utils=s,this.types=["card","sepa","quota","credit","other"],this.selection=!1,this.initialSource=null,this.sources={quotas:[],cards:[],sepas:[],others:[]},this.unselectableInsufficientlyCredit=!1,this.amountDue=null,this.selected=null,this.selectedSource=new L(!0),this.update=new L(!0),this.panelOpenStateQuota=!0,this.panelOpenStateCredits=!0,this.panelOpenStateCards=!0,this.panelOpenStateIban=!0,this.panelOpenStateOthers=!0,this.cardHasBeenUpdated=!1,this.invalidCardError=null,this.cardElement=null,this.ibanElementCompleted=!1,this.invalidIbanError=null,this.cardLoading=!1,this.ibanLoading=!1,this.isLoading=!1,this.ibanName=new ue("",[W.required]),this.ibanEmail=new ue("",[W.required,W.email]),this.stripeCardOptions={style:{base:{color:"#32325d",lineHeight:"18px",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},hidePostalCode:!0},this.stripeIbanOptions={style:{base:{color:"#32325d",lineHeight:"18px",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},supportedCountries:["SEPA"],placeholderCountry:"FR"},this.elementsOptions={locale:"auto"},this.Stripe=null}ngOnInit(){this.Stripe=this.utils.getStripeInstance(),setTimeout(()=>z(this,null,function*(){this.Stripe=this.utils.getStripeInstance(),this.sources||(this.sources={cards:[],quotas:[],sepas:[],others:[]},this.selection&&(this.isLoading=!0,this.sources=yield this.api.userService.sourcesService.get(),this.isLoading=!1)),this.sources&&this.selection&&(this.initialSource?this.selected=this.initialSource:this.sources.cards.concat(this.sources.sepas).concat(this.sources.others).forEach(e=>{e.isDefault&&this.types.indexOf(e.type)!==-1&&(this.selected=e,this.selectedSource.emit(e))}))}))}select(e){if(this.selection&&!e.disabled){if(this.unselectableInsufficientlyCredit&&this.amountDue>e.remaining)return;this.selected=e,this.selectedSource.emit(e)}}cardUpdated(e,n){n&&(this.card=n),this.cardHasBeenUpdated=!0,e.error?this.invalidCardError=e.error:this.invalidCardError=null}ibanUpdated(e,n){this.ibanElement=n,this.invalidIbanError=null,n&&(this.ibanElement=n),e.error?this.invalidIbanError=e.error:this.ibanElementCompleted=e.complete}getCardToken(e,n){this.cardLoading=!0;let t=this;n?.button&&n.button?.switchIsWorking(!0),this.Stripe=this.utils.getStripeInstance(),this.Stripe.createPaymentMethod({type:"card",card:t.card.element}).toPromise().then(s=>{s.paymentMethod?t.api.userService.sourcesService.setup().then(_=>{t.Stripe.confirmCardSetup(_.seti_secret,{payment_method:s.paymentMethod.id}).toPromise().then(C=>{}),t.api.userService.sourcesService.add({token:s.paymentMethod.id,type:"card"},n?.button).then(C=>{t.update.emit(C),t.cardLoading=!1,e.close()}).catch(C=>{t.cardLoading=!1,bo.default.fire({icon:"error",text:t.translate.get("components.sources.error.text")})})}):s.error&&(t.cardLoading=!1,bo.default.fire({icon:"error",text:t.translate.get("components.sources.error.text")}))})}getIbanSource(e){if(this.ibanElement==null||!this.ibanElementCompleted||!this.ibanName.valid||!this.ibanEmail.valid)return;let n=this;this.ibanLoading=!0,this.Stripe=this.utils.getStripeInstance(),this.Stripe.createPaymentMethod({type:"sepa_debit",sepa_debit:this.ibanElement.element,billing_details:{name:this.ibanName.value,email:this.ibanEmail.value}}).toPromise().then(function(t){t.paymentMethod?n.api.userService.sourcesService.setup().then(s=>{n.Stripe.confirmSepaDebitSetup(s.seti_secret,{payment_method:t.paymentMethod.id,mandate_data:{customer_acceptance:{type:"online"}}}).toPromise().then(_=>{}),n.api.userService.sourcesService.add({token:t.paymentMethod.id,type:"sepa"}).then(_=>{n.update.emit(_),n.ibanLoading=!1,e.close()}).catch(_=>{n.ibanLoading=!1,bo.default.fire({icon:"error",text:n.translate.get("components.sources.error.text")})})}):t.error&&(n.ibanLoading=!1,bo.default.fire({icon:"error",text:n.translate.get("components.sources.error.text")}))})}addCard(){this.open(this.addCardModal)}addIban(){this.open(this.addIbanModal)}open(e){let n={backdropClass:"modalBackdropClass",windowClass:"modalClass",size:"lg"};return this.modalService.open(e,n).result}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(Ue),y(U),y(_e))}}static{this.\u0275cmp=P({type:i,selectors:[["app-sources"]],viewQuery:function(n,t){if(n&1&&(A(jm,7),A(Pt,5),A(Tt,5),A(Qm,7)),n&2){let s;D(s=O())&&(t.addCardModal=s.first),D(s=O())&&(t.card=s.first),D(s=O())&&(t.ibanElement=s.first),D(s=O())&&(t.addIbanModal=s.first)}},inputs:{types:"types",selection:"selection",initialSource:"initialSource",sources:"sources",unselectableInsufficientlyCredit:"unselectableInsufficientlyCredit",amountDue:"amountDue"},outputs:{selected:"selected",selectedSource:"selectedSource",update:"update"},decls:10,vars:7,consts:[["addCardModal",""],["addIbanModal",""],["card",""],["addCardBtn",""],["iban",""],["addIbanBtn",""],["class","mt-3",3,"expanded","opened","closed",4,"ngIf"],[1,"mt-3",3,"opened","closed","expanded"],[1,"d-flex","justify-content-between","w-100","me-3"],[1,"d-flex","align-items-center"],[1,"mat-title-large"],[1,"row","row-cols-2"],["class","col",4,"ngFor","ngForOf"],[1,"col"],[1,"card","border-card","shadow-none",3,"click","source","selected","selection"],[1,"d-flex","justify-content-end","flex-wrap"],["textKey","components.sources.cards.add","iconName","add","type","FILLED_TONAL",3,"clicked","isDisabled"],[4,"ngIf"],["class","m-0 text-center",4,"ngIf"],["class","row row-cols-2",4,"ngIf"],[1,"my-3","mx-auto",3,"diameter"],[1,"m-0","text-center"],["textKey","components.sources.ibans.add","iconName","add","type","FILLED_TONAL",3,"clicked","isDisabled"],[1,"container-fluid"],[1,"mt-3"],[1,"row","mb-4"],[1,"card-columns"],["class","card border-card shadow-none",3,"selected","source","selection","click",4,"ngFor","ngForOf"],["class","loading_wrapper",4,"ngIf"],[3,"ngClass"],[1,"modal-header"],["id","",1,"modal-title","w-100"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"container"],[1,"row","justify-content-center"],[1,"col-10"],["id","card",3,"change","stripe","options","elementsOptions"],["class","row mt-1 justify-content-center",4,"ngIf"],[1,"modal-footer"],[1,"row","justify-content-between","w-100","align-items-center"],["src","/assets/images/powered_by_stripe.png","alt","powered by stripe"],[1,"col","d-flex","justify-content-end"],["textKey","global.cancel","type","SECONDARY",3,"clicked","isDisabled"],["textKey","global.confirm","type","FILLED_TONAL",1,"ms-2",3,"clicked","isDisabled"],[1,"loading_wrapper"],[1,"row","h-100","align-items-center","justify-content-center"],["mode","indeterminate","color","FILLED_TONAL",1,"m-auto"],[1,"row","mt-1","justify-content-center"],[1,"col-5","col-offset-2"],[1,"w-100"],["matInput","","type","text","required","",3,"placeholder","formControl"],[1,"col-5"],["matInput","","type","email","required","",3,"placeholder","formControl"],["id","ibanElement",1,"w-100"],[3,"change","stripe","options"],[1,"row"],[1,"row","mt-4","justify-content-center"],["textKey","global.cancel","type","SECONDARY",1,"mx-2",3,"clicked"],["textKey","global.confirm","type","FILLED_TONAL",1,"mx-2",3,"clicked","isDisabled"]],template:function(n,t){n&1&&(a(0,"article"),h(1,Gm,9,5,"mat-expansion-panel",6)(2,$m,9,5,"mat-expansion-panel",6)(3,tu,12,8,"mat-expansion-panel",6)(4,au,12,8,"mat-expansion-panel",6)(5,lu,13,5,"mat-expansion-panel",6),l(),h(6,du,24,13,"ng-template",null,0,ne)(8,_u,37,21,"ng-template",null,1,ne)),n&2&&(E("isSelection",t.selection),o(),c("ngIf",t.types.indexOf("quota")!==-1&&(t.sources==null||t.sources.quotas==null?null:t.sources.quotas.length)>0),o(),c("ngIf",t.types.indexOf("credit")!==-1&&(t.sources==null||t.sources.credits==null?null:t.sources.credits.length)>0),o(),c("ngIf",t.types.indexOf("card")!==-1),o(),c("ngIf",t.types.indexOf("sepa")!==-1),o(),c("ngIf",t.types.indexOf("other")!==-1&&(t.sources==null?null:t.sources.others)!=null&&(t.sources==null?null:t.sources.others.length)>0))},dependencies:[ce,j,R,fe,ee,zt,Be,Pt,Tt,be,ae,St,ve,H,Ht,Yt,Yl,N],styles:['.isSelection[_ngcontent-%COMP%]   app-source[_ngcontent-%COMP%]{cursor:pointer}.selected[_ngcontent-%COMP%]{box-shadow:0 4px 20px 1px #242961a0;position:relative}.selected[_ngcontent-%COMP%]:before{background-image:url(/assets/images/check_selection_espace.svg);background-size:30px;display:inline-block;width:30px;height:30px;content:"";position:absolute;top:-15px;right:-15px}.disabled[_ngcontent-%COMP%]{background:#f8f9f9;filter:grayscale(1);opacity:.6;cursor:not-allowed!important}.card[_ngcontent-%COMP%]{border-radius:8px;margin-bottom:25px}.card-columns[_ngcontent-%COMP%]{column-count:1}@media screen and (min-width: 992px){.card-columns[_ngcontent-%COMP%]{column-count:2}}.loading_wrapper[_ngcontent-%COMP%]{position:absolute;z-index:99999;width:100%;height:100%;background:#6464644d}app-source[_ngcontent-%COMP%]{min-width:320px}.border-card[_ngcontent-%COMP%]{border:1px solid #ebebeb}.card-body[_ngcontent-%COMP%]{padding:0}section[_ngcontent-%COMP%]{margin:0}']})}}return i})();var hu=["sourcesModal"],gu=["unloggedModal"],fu=["payBtn"],vu=["informationsBtn"],bu=()=>["card","sepa","credit"];function Cu(i,r){i&1&&x(0,"mat-spinner",18),i&2&&c("diameter",25)}function xu(i,r){if(i&1&&(a(0,"div",11)(1,"div",12)(2,"div",13),p(3),d(4,"translate"),d(5,"replace"),d(6,"translate"),d(7,"replace"),l(),a(8,"div",14),h(9,Cu,1,1,"mat-spinner",17),l()()()),i&2){let e=m();o(3),g(" ",e.type==="quotation"?te(5,4,u(4,2,"pages.app.quotation.title"),":quotationNumber"," "):te(7,10,u(6,8,"pages.app.invoice.title"),":quotationNumber"," ")," "),o(6),c("ngIf",e.isLoading)}}function yu(i,r){if(i&1){let e=k();a(0,"div",24)(1,"mat-checkbox",25),Pe("ngModelChange",function(t){f(e);let s=m(2);return Ee(s.isEngaged,t)||(s.isEngaged=t),v(t)}),p(2),d(3,"translate"),d(4,"translate"),l()()}if(i&2){let e=m(2);o(),Ie("ngModel",e.isEngaged),c("disabled",e.isEngagedDisabled),o(),g(" ",e.type==="quotation"?u(3,3,"pages.app.quotation.commitment"):u(4,5,"pages.app.invoice.commitment")," ")}}function ku(i,r){if(i&1){let e=k();a(0,"div",26),b("mouseenter",function(){f(e);let t=m(2);return v(t.showInputErrors())}),a(1,"app-button",27),b("clicked",function(t){f(e);let s=m(2);return v(s.validate(t))}),l()()}if(i&2){let e=m(2),n=V(18),t=V(20);c("ngbPopover",t)("popoverTitle",n)("disablePopover",e.type==="quotation"&&e.informationsCompleted()&&(e.isEngaged||e.isEngagedDisabled)&&e.productOrderValid||(e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="CANCELLED"||(e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="PAID"||(e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="EXPIRED"),o(),c("textKey",e.isEngagedDisabled?e.invoiceQuotation.status==="EXPIRED"?"pages.app.quotation.expired":e.invoiceQuotation.status==="CANCELLED"?"pages.app.quotation.cancelled":"pages.app.quotation.validated":"pages.app.quotation.validate")("isDisabled",!e.isEngaged||e.isEngagedDisabled||!e.isEngagedDisabled&&e.type==="quotation"&&!e.productOrderValid||e.type==="quotation"&&!e.informationsCompleted())}}function wu(i,r){if(i&1){let e=k();a(0,"div",26),b("mouseenter",function(){f(e);let t=m(2);return v(t.showInputErrors())}),a(1,"app-button",27,4),d(3,"translate"),d(4,"translate"),d(5,"currency"),b("clicked",function(t){f(e);let s=m(2);return v(s.pay(t))}),l()()}if(i&2){let e=m(2),n=V(18),t=V(20);c("ngbPopover",t)("popoverTitle",n)("disablePopover",e.type==="quotation"&&e.informationsCompleted()&&(e.isEngaged||e.isEngagedDisabled)&&e.productOrderValid||e.type==="invoice"||(e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="CANCELLED"||(e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="PAID"||(e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="EXPIRED"),o(),c("textKey",(e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="PAID"?"pages.app.quotation.paid":(e.type==="quotation"&&!e.isEngagedDisabled?u(3,5,"pages.app.quotation.validate_and_pay"):u(4,7,"pages.app.invoice.pay"))+" "+T(5,9,e.getRefTotal()/100,"EUR"))("isDisabled",!e.isEngaged||(e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="PAID"||e.type==="quotation"&&!e.productOrderValid||e.type==="quotation"&&!e.informationsCompleted())}}function Su(i,r){if(i&1&&(a(0,"div",28)(1,"p",29),p(2),d(3,"translate"),d(4,"translate"),a(5,"a",30),p(6),d(7,"translate"),l(),p(8),d(9,"translate"),d(10,"replace"),l()()),i&2){let e=m(2);o(2),g(" ",e.type==="quotation"&&!((e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="PAID"||(e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="VALIDATED")?u(3,4,"pages.app.quotation.cgu_quotation"):u(4,6,"pages.app.quotation.cgu_invoice")," "),o(3),c("href",e.getTermsUrl(e.invoiceQuotation==null||e.invoiceQuotation.company==null?null:e.invoiceQuotation.company.id),K),o(),g(" ",u(7,8,"pages.app.quotation.cgu_2")," "),o(2),g(" ",te(10,12,u(9,10,"pages.app.quotation.cgu_3"),":companyName",e.invoiceQuotation==null||e.invoiceQuotation.company==null?null:e.invoiceQuotation.company.socialReason)," ")}}function Mu(i,r){if(i&1&&(a(0,"div",28)(1,"p",29),p(2),d(3,"translate"),a(4,"a",30),p(5),d(6,"translate"),l(),p(7),d(8,"translate"),d(9,"replace"),l()()),i&2){let e=m(2);o(2),g(" ",u(3,4,"pages.app.quotation.cgu_accepted")," "),o(2),c("href",e.getTermsUrl(e.invoiceQuotation==null||e.invoiceQuotation.company==null?null:e.invoiceQuotation.company.id),K),o(),g(" ",u(6,6,"pages.app.quotation.cgu_2")," "),o(2),g(" ",te(9,10,u(8,8,"pages.app.quotation.cgu_3"),":companyName",e.invoiceQuotation==null||e.invoiceQuotation.company==null?null:e.invoiceQuotation.company.socialReason)," ")}}function Iu(i,r){if(i&1&&(a(0,"div",19),h(1,yu,5,7,"div",20),a(2,"div",21),h(3,ku,2,5,"div",22)(4,wu,6,12,"div",22),l(),h(5,Su,11,16,"div",23)(6,Mu,10,14,"div",23),l()),i&2){let e=m();o(),c("ngIf",e.type==="quotation"),o(2),c("ngIf",e.type==="quotation"),o(),c("ngIf",(e.type==="quotation"||e.type==="invoice")&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="PAID"&&!(e.invoiceQuotation!=null&&e.invoiceQuotation.requiresPurchaseOrder)),o(),c("ngIf",(e.invoiceQuotation==null||e.invoiceQuotation.company==null?null:e.invoiceQuotation.company.hasTerms)&&(e.type==="quotation"&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="PAID"||e.type==="invoice"&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="PAID")),o(),c("ngIf",(e.invoiceQuotation==null||e.invoiceQuotation.company==null?null:e.invoiceQuotation.company.hasTerms)&&(e.type==="quotation"&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="PAID"||e.type==="invoice"&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)==="PAID"))}}function Eu(i,r){if(i&1){let e=k();a(0,"app-sources",40,5),b("selectedSource",function(t){f(e);let s=m(2);return v(s.selectedSource(t))}),l()}if(i&2){let e=m(2);c("sources",e.api==null||e.api.user==null?null:e.api.user.sources)("types",X(4,bu))("unselectableInsufficientlyCredit",!0)("amountDue",e.invoiceQuotation==null?null:e.invoiceQuotation.total)}}function Pu(i,r){if(i&1){let e=k();a(0,"div",31)(1,"h5",32),p(2),d(3,"translate"),d(4,"translate"),l(),a(5,"button",33),b("click",function(){let t=f(e).$implicit;return v(t.dismiss(""))}),a(6,"span",34),p(7,"\xD7"),l()()(),a(8,"div",35),h(9,Eu,2,5,"app-sources",36),l(),a(10,"div",37)(11,"app-button",38),b("clicked",function(){let t=f(e).$implicit;return v(t.dismiss(""))}),l(),a(12,"app-button",39),b("clicked",function(t){f(e);let s=m();return v(s.payLogged(t))}),l()()}if(i&2){let e=m();o(2),g(" ",e.type==="quotation"?u(3,3,"pages.app.quotation.modal.title"):u(4,5,"pages.app.invoice.modal.title")," "),o(7),c("ngIf",e.api.user!=null),o(3),c("isDisabled",e.source==null)}}function Tu(i,r){i&1&&(a(0,"div",69)(1,"div",70)(2,"div",66),x(3,"mat-progress-spinner",71),l()()())}function Du(i,r){if(i&1&&(a(0,"div",72)(1,"div",52)(2,"mat-error"),p(3),l()()()),i&2){let e=m(2);o(3),w(e.invalidCardError==null?null:e.invalidCardError.message)}}function Ou(i,r){if(i&1&&(a(0,"div",72)(1,"div",52),p(2),l()()),i&2){let e=m(2);o(2),g(" ",e.invalidIbanError==null?null:e.invalidIbanError.message," ")}}function Bu(i,r){if(i&1){let e=k();h(0,Tu,4,0,"div",41),a(1,"div",31)(2,"h5",42),p(3),d(4,"translate"),d(5,"translate"),l(),a(6,"button",43),b("click",function(){let t=f(e).$implicit;return v(t.dismiss("Cross click"))}),a(7,"span",34),p(8,"\xD7"),l()()(),a(9,"div",35)(10,"ul",44)(11,"li",45)(12,"a",46),p(13),d(14,"translate"),l()(),a(15,"li",45)(16,"a",47),p(17),d(18,"translate"),l()()(),a(19,"div",48)(20,"div",49)(21,"div",50)(22,"div",51)(23,"div",52)(24,"ngx-stripe-card",53,6),b("change",function(t){f(e);let s=V(25),_=m();return v(_.cardUpdated(t,s))}),l()()(),h(26,Du,4,1,"div",54),l(),a(27,"div",37)(28,"app-button",55),b("clicked",function(){let t=f(e).$implicit;return v(t.close("Cancel click"))}),l(),a(29,"app-button",56,7),b("clicked",function(t){f(e);let s=m();return v(s.getCardToken(t))}),l()()(),a(31,"div",57)(32,"div",58)(33,"div",51)(34,"div",59)(35,"mat-form-field",60),x(36,"input",61),d(37,"translate"),l()(),a(38,"div",62)(39,"mat-form-field",60),x(40,"input",63),d(41,"translate"),l()()(),a(42,"div",51)(43,"div",52)(44,"ngx-stripe-iban",64,8),b("change",function(t){f(e);let s=V(45),_=m();return v(_.ibanUpdated(t,s))}),l()()(),h(46,Ou,3,1,"div",54),a(47,"div",65)(48,"div",66),x(49,"hr"),l()(),a(50,"div",67)(51,"div",52),p(52),d(53,"translate"),l()()(),a(54,"div",37)(55,"app-button",55),b("clicked",function(){let t=f(e).$implicit;return v(t.close("Cancel click"))}),l(),a(56,"app-button",68,9),b("clicked",function(t){f(e);let s=m();return v(s.getIbanSource(t))}),l()()()()()}if(i&2){let e=V(25),n=m();c("ngIf",n.unloggedLoading),o(3),g(" ",n.type==="quotation"?u(4,18,"pages.app.quotation.modal.title"):u(5,20,"pages.app.invoice.modal.title")," "),o(10),g(" ",u(14,22,"components.order_summary.sources.type.card")," "),o(4),g(" ",u(18,24,"components.order_summary.sources.type.sepa")," "),o(7),c("stripe",n.Stripe)("options",n.stripeCardOptions)("elementsOptions",n.elementsOptions),o(2),c("ngIf",n.invalidCardError),o(3),c("isDisabled",e==null||n.invalidCardError!=null),o(7),c("placeholder",u(37,26,"forms.name.long_name"))("formControl",n.ibanName),o(4),c("placeholder",u(41,28,"forms.email.long_name"))("formControl",n.ibanEmail),o(4),c("stripe",n.Stripe)("options",n.stripeIbanOptions)("elementsOptions",n.elementsOptions),o(2),c("ngIf",n.invalidIbanError),o(6),g(" ",u(53,30,"components.sources.modals.add_iban.disclaimer")," ")}}function Au(i,r){i&1&&(a(0,"div",73)(1,"mat-icon"),p(2,"error"),l(),p(3),d(4,"translate"),l()),i&2&&(o(3),g(" ",u(4,1,"components.environments.configuration.layout.errors")," "))}function Vu(i,r){i&1&&(M(0,76),p(1),d(2,"translate"),x(3,"br"),S()),i&2&&(o(),g(" - ",u(2,1,"pages.app.quotation.informations_error")," "))}function Ru(i,r){i&1&&(M(0,76),p(1),d(2,"translate"),x(3,"br"),S()),i&2&&(o(),g(" - ",u(2,1,"pages.app.quotation.engaged_error")," "))}function Nu(i,r){i&1&&(M(0,76),p(1),d(2,"translate"),S()),i&2&&(o(),g(" - ",u(2,1,"pages.app.quotation.po_error")," "))}function Fu(i,r){if(i&1&&(a(0,"div",74),h(1,Vu,4,3,"ng-container",75)(2,Ru,4,3,"ng-container",75)(3,Nu,3,3,"ng-container",75),l()),i&2){let e=m();o(),c("ngIf",!e.informationsCompleted()&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="PAID"&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="EXPIRED"&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="CANCELLED"),o(),c("ngIf",e.type==="quotation"&&(!e.isEngaged||e.isEngagedDisabled)&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="PAID"&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="EXPIRED"&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="CANCELLED"),o(),c("ngIf",!e.productOrderValid&&e.type==="quotation"&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="PAID"&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="EXPIRED"&&(e.invoiceQuotation==null?null:e.invoiceQuotation.status)!=="CANCELLED")}}var Zk=(()=>{class i{constructor(e,n,t,s,_,C){this.api=e,this.route=n,this.utils=t,this.router=s,this.translate=_,this.modalService=C,this.isLoading=!0,this.invoiceQuotation=null,this.isEngaged=!1,this.isEngagedDisabled=!1,this.source=null,this.type=null,this.invalidCardError=null,this.cardElement=null,this.invalidIbanError=null,this.ibanElementCompleted=!1,this.unloggedLoading=!1,this.ibanName=new ue("",[W.required]),this.ibanEmail=new ue("",[W.required,W.email]),this.stripeCardOptions={style:{base:{color:"#32325d",lineHeight:"18px",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},hidePostalCode:!0},this.stripeIbanOptions={style:{base:{color:"#32325d",lineHeight:"18px",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},supportedCountries:["SEPA"],placeholderCountry:"FR"},this.elementsOptions={locale:"auto"},this.showErrors=!1}ngOnInit(){this.Stripe=this.utils.getStripeInstance(),this.route.params.subscribe(e=>{let n=null;e.quotationId?(this.type="quotation",n=e.quotationId):e.invoiceId&&(this.type="invoice",n=e.invoiceId),this.type?(this.type==="quotation"?this.api.quotationService.get(n):this.api.invoiceService.get(n)).then(s=>{this.invoiceQuotation=s,this.isLoading=!1,this.invoiceQuotation?.requiresPurchaseOrder&&this.type==="quotation"&&!this.invoiceQuotation?.purchaseOrder?this.productOrderValid=!1:this.productOrderValid=!0,this.isLoading=!1,this.isEngaged=this.invoiceQuotation.status==="VALIDATED"||this.invoiceQuotation.status==="PAID"||this.invoiceQuotation.status==="WAITING_PAYMENT"||this.type==="invoice",this.isEngagedDisabled=this.isEngaged||this.invoiceQuotation.status==="CANCELLED"||this.invoiceQuotation.status==="EXPIRED"||this.invoiceQuotation.status==="PAID",this.invoiceQuotation.status==="CANCELLED"&&this.type==="quotation"&&Er.default.fire({icon:"error",text:this.translate.get("pages.app.quotation.swal.cancelled.text")}),this.api.isAuthenticated()&&!this.api.user.sources&&this.api.userService.sourcesService.get()}).catch(()=>this.returnToHome()):this.returnToHome()}),setTimeout(()=>{this.Stripe=this.utils.getStripeInstance()})}productOrderChanged(e){this.productOrderValid=e.valid,this.invoiceQuotation.purchaseOrder=e.value}validate(e){this.api.quotationService.validate(this.invoiceQuotation.id,this.invoiceQuotation.recipient,this.invoiceQuotation.purchaseOrder,e?.button).then(n=>{this.swal("validate",n.success),n.success&&(this.invoiceQuotation.status=vo.VALIDATED,this.isEngagedDisabled=!0)}).catch(()=>{this.swal("validate",!1)})}swal(e,n){Er.default.fire({icon:n?"success":"error",text:this.translate.get("pages.app."+this.type+".swal."+e+"."+(n?"success":"error"))})}getRefTotal(){if(this.invoiceQuotation){let e=this.invoiceQuotation.total;return this.invoiceQuotation.children!=null&&this.invoiceQuotation.children.filter(n=>n.type==="CREDIT").forEach(n=>{e-=n.total}),e}return 0}pay(){this.api.isAuthenticated()?this.open(this.sourcesModal):this.open(this.unloggedModal)}payLogged(e){if(this.source==null)return;let n={id:this.invoiceQuotation.id,method:this.source.type.toUpperCase(),isLinkedToUser:!0,methodId:this.source.id,customer:{id:this.api.user.id},recipient:this.invoiceQuotation.recipient},t;this.type==="quotation"?t=this.api.quotationService.pay(this.invoiceQuotation.id,n,this.invoiceQuotation.purchaseOrder,e?.button):t=this.api.invoiceService.pay(this.invoiceQuotation.id,n,this.invoiceQuotation.purchaseOrder,e?.button),t.then(s=>{this.handlePaymentResponse(s)}).catch(s=>{this.handlePaymentError(s)}).finally(()=>this.modalService.dismissAll())}handlePaymentResponse(e){let n=this.utils.getStripeInstance();e.method==="CARD"?n.confirmCardPayment(e.clientSecret).toPromise().then(t=>{this.handleConfirmResp(t,e)}):e.method==="SEPA"?n.confirmSepaDebitPayment(e.clientSecret).toPromise().then(t=>{this.handleConfirmResp(t,e)}):(this.isEngagedDisabled=!0,this.invoiceQuotation.status=vo.PAID,this.swal("pay",!0),this.modalService.dismissAll())}handlePaymentError(e){let n=this.translate.get("global.errors.payment.title"),t="",s="";if(e.error&&e.error.declineCode){let _=this.translate.get("stripe."+e.error.declineCode+".description"),C=this.translate.get("stripe."+e.error.declineCode+".customer_instructions");t=C,_!=="stripe."+e.error.declineCode+".description"&&!this.utils.isBlank(_)&&(n=_,t=C),e.error.requestId&&(s=this.translate.get("pages.user.book.swal.error.footer").replace("{{req}}",e.error.requestId))}else if(e.error&&typeof e.error.message=="string")t=e.error.message;else if(e.error&&typeof e.error=="string"){let _=JSON.parse(e.error);t=this.translate.get("global.errors.payment."+_?.error?.toLowerCase())}Er.default.fire({icon:"error",title:n,html:t,footer:s})}handleConfirmResp(e,n,t=!1){e.paymentIntent?(e.paymentIntent.status==="requires_capture"||e.paymentIntent.status==="succeeded"||e.paymentIntent.status==="processing")&&(this.isEngagedDisabled=!0,this.invoiceQuotation.status=vo.PAID,this.swal("pay",!0)):e.error&&(t?this.handlePaymentError(e):this.api.orderService.confirmPayment(this.invoiceQuotation.order?.id,n.id,this.payBtn?.nativeElement).then(s=>this.handleConfirmResp({paymentIntent:s},n)).catch(()=>this.handleConfirmResp(e,n,!0))),this.modalService.dismissAll()}selectedSource(e){this.source=e}returnToHome(){this.router.navigate(["/"])}cardUpdated(e,n){this.card=n,e&&e.error?this.invalidCardError=e.error:this.invalidCardError=null}ibanUpdated(e,n){this.iban=n,e&&e.error?this.invalidCardError=e.error:this.invalidCardError=null,this.ibanElementCompleted=e.complete}getCardToken(e){this.unloggedLoading=!0,this.utils.getStripeInstance().createToken(this.card.element,{}).toPromise().then(t=>{if(t.token){let s=t.token.id;this.payUnlogged("CARD",s,e)}this.unloggedLoading=!1})}getIbanSource(e){if(this.iban==null||!this.ibanElementCompleted||!this.ibanName.valid||!this.ibanEmail.valid)return;this.unloggedLoading=!0,this.utils.getStripeInstance().createPaymentMethod({type:"sepa_debit",sepa_debit:this.iban.element,billing_details:{name:this.ibanName.value,email:this.ibanEmail.value}}).toPromise().then(t=>{if(t.paymentMethod){let s=t.paymentMethod.id;this.payUnlogged("SEPA",s,e)}this.unloggedLoading=!1})}payUnlogged(e,n,t){let s={id:this.invoiceQuotation.id,method:e,isLinkedToUser:!1,methodId:n,recipient:this.invoiceQuotation.recipient},_;this.type==="quotation"?_=this.api.quotationService.pay(this.invoiceQuotation.id,s,this.invoiceQuotation.purchaseOrder,t?.button):_=this.api.invoiceService.pay(this.invoiceQuotation.id,s,this.invoiceQuotation.purchaseOrder,t?.button),_.then(C=>{this.handlePaymentResponse(C)}).catch(C=>{this.handlePaymentError(C),this.modalService.dismissAll()})}open(e){let n={size:"lg"};return this.modalService.open(e,n).result}getTermsUrl(e){return ut.api+"/companies/"+e+"/terms"}informationsCompleted(){if(this.invoiceQuotation){let e=this.invoiceQuotation.recipient;return e.isPro?!this.utils.isBlank(e.socialReason)&&!this.utils.isBlank(e.address?.address1)&&!this.utils.isBlank(e.address?.addressCity)&&!this.utils.isBlank(e.address?.addressPostalCode):!this.utils.isBlank(e.firstname)&&!this.utils.isBlank(e.lastname)&&!this.utils.isBlank(e.address?.address1)&&!this.utils.isBlank(e.address?.addressCity)&&!this.utils.isBlank(e.address?.addressPostalCode)}return!1}showInputErrors(){this.productOrderValid?this.showErrors=!1:this.showErrors=!0}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(ur),y(_e),y(mt),y(U),y(Ue))}}static{this.\u0275cmp=P({type:i,selectors:[["app-order-payment"]],viewQuery:function(n,t){if(n&1&&(A(hu,7),A(gu,7),A(fu,7),A(vu,7),A(Pt,5),A(Tt,5)),n&2){let s;D(s=O())&&(t.sourcesModal=s.first),D(s=O())&&(t.unloggedModal=s.first),D(s=O())&&(t.payBtn=s.first),D(s=O())&&(t.informationsBtn=s.first),D(s=O())&&(t.card=s.first),D(s=O())&&(t.iban=s.first)}},decls:21,vars:21,consts:[["sourcesModal",""],["unloggedModal",""],["popErrorTitle",""],["popError",""],["payBtn",""],["sources",""],["card",""],["addCardBtn",""],["iban",""],["addIbanBtn",""],["class","container mt-3 mb-2",4,"ngIf"],[1,"container","mt-3","mb-2"],[1,"card"],[1,""],[1,"card-body"],[3,"productOrderChange","ref","type","preview","showErrors"],["class","row text-center align-items-center justify-content-center",4,"ngIf"],["class","my-3 mx-auto",3,"diameter",4,"ngIf"],[1,"my-3","mx-auto",3,"diameter"],[1,"row","text-center","align-items-center","justify-content-center"],["class","col-xs-12 col-12 mt-4",4,"ngIf"],[1,"col-12","mt-3","d-flex","justify-content-center"],["class","mx-2","placement","top","container","body","popoverClass","error-informations","triggers","mouseenter:mouseleave",3,"ngbPopover","popoverTitle","disablePopover","mouseenter",4,"ngIf"],["class","col-12 col-sm-6 col-lg-4 mt-3",4,"ngIf"],[1,"col-xs-12","col-12","mt-4"],[3,"ngModelChange","ngModel","disabled"],["placement","top","container","body","popoverClass","error-informations","triggers","mouseenter:mouseleave",1,"mx-2",3,"mouseenter","ngbPopover","popoverTitle","disablePopover"],["type","PRIMARY",3,"clicked","textKey","isDisabled"],[1,"col-12","col-sm-6","col-lg-4","mt-3"],[1,"text-center","cgu"],["target","_blank","rel","noopener",3,"href"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],["selection","true",3,"sources","types","unselectableInsufficientlyCredit","amountDue","selectedSource",4,"ngIf"],[1,"modal-footer"],["textKey","global.back","type","SECONDARY",1,"mx-2",3,"clicked"],["textKey","global.confirm","type","PRIMARY",1,"mx-2",3,"clicked","isDisabled"],["selection","true",3,"selectedSource","sources","types","unselectableInsufficientlyCredit","amountDue"],["class","loading_wrapper",4,"ngIf"],[1,"modal-title","w-100"],["type","button","aria-label","Close",1,"close",3,"click"],["id","tabs","role","tablist",1,"nav","nav-tabs"],[1,"nav-item"],["id","card-tab","data-bs-toggle","tab","href","#card","role","tab","aria-controls","card","aria-selected","true",1,"nav-link","active"],["id","sepa-tab","data-bs-toggle","tab","href","#sepa","role","tab","aria-controls","sepa","aria-selected","false",1,"nav-link"],["id","myTabContent",1,"tab-content"],["id","card","role","tabpanel","aria-labelledby","card-tab",1,"tab-pane","fade","show","active"],[1,"container","h-100","p-4"],[1,"row","justify-content-center"],[1,"col-10"],["id","card",3,"change","stripe","options","elementsOptions"],["class","row mt-1 justify-content-center",4,"ngIf"],["textKey","global.cancel","type","SECONDARY",1,"mx-2",3,"clicked"],["id","addCardBtn","textKey","global.confirm","type","PRIMARY",1,"mx-2",3,"clicked","isDisabled"],["id","sepa","role","tabpanel","aria-labelledby","sepa-tab",1,"tab-pane","fade"],[1,"container","p-4"],[1,"col-5","col-offset-2"],[1,"w-100"],["matInput","","type","text","required","",3,"placeholder","formControl"],[1,"col-5"],["matInput","","type","email","required","",3,"placeholder","formControl"],["id","iban",3,"change","stripe","options","elementsOptions"],[1,"row"],[1,"col"],[1,"row","mt-4","justify-content-center"],["id","addIbanBtn","textKey","global.confirm","type","PRIMARY",1,"mx-2",3,"clicked"],[1,"loading_wrapper"],[1,"row","h-100","align-items-center","justify-content-center"],["mode","indeterminate","color","primary",1,"m-auto"],[1,"row","mt-1","justify-content-center"],[1,"errors-title"],[1,"text-start"],["class","my-1",4,"ngIf"],[1,"my-1"]],template:function(n,t){if(n&1){let s=k();a(0,"section"),h(1,xu,10,14,"div",10),a(2,"div",11)(3,"div",12)(4,"div",13),p(5),d(6,"translate"),d(7,"replace"),d(8,"translate"),d(9,"replace"),l(),a(10,"div",14)(11,"app-quotation-invoice",15),b("productOrderChange",function(C){return f(s),v(t.productOrderChanged(C))}),l(),h(12,Iu,7,5,"div",16),l()()()(),h(13,Pu,13,7,"ng-template",null,0,ne)(15,Bu,58,32,"ng-template",null,1,ne)(17,Au,5,3,"ng-template",null,2,ne)(19,Fu,4,3,"ng-template",null,3,ne)}n&2&&(o(),c("ngIf",t.isLoading),o(),E("d-none",t.isLoading),o(3),g(" ",t.type==="quotation"?te(7,11,u(6,9,"pages.app.quotation.title"),":quotationNumber",t.invoiceQuotation==null?null:t.invoiceQuotation.reference):te(9,17,u(8,15,"pages.app.invoice.title"),":quotationNumber",t.invoiceQuotation==null?null:t.invoiceQuotation.reference)," "),o(6),c("ref",t.invoiceQuotation)("type",t.type)("preview",!1)("showErrors",t.showErrors),o(),c("ngIf",(t.invoiceQuotation==null?null:t.invoiceQuotation.status)!=="CANCELLED"))},dependencies:[R,H,fe,ee,zt,gt,Be,ae,St,$,ve,be,Qi,st,Ql,Pt,Tt,Et,Xe,N,et],styles:[".cgu[_ngcontent-%COMP%]{font-size:14px}"]})}}return i})();var Kl=Me(an());var $l=(()=>{class i{constructor(){}transform(e,n){return!e||!n?"":(0,Kl.default)(e).tz(n).format("DD MMM YYYY \\- HH:mm").toUpperCase()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=fs({name:"formatBookingDate",type:i,pure:!0})}}return i})();var Pr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[ai]})}}return i})();var qu=i=>({"environment-page":i}),Wu=i=>({"spacing-top":i});function Uu(i,r){if(i&1){let e=k();a(0,"app-sources",5),b("update",function(){f(e);let t=m();return v(t.sourcesUpdated())}),l()}if(i&2){let e=m();c("sources",e.api.user==null?null:e.api.user.sources)}}var rw=(()=>{class i{constructor(e){this.api=e}ngOnInit(){this.api.userService.sourcesService.get()}sourcesUpdated(){this.api.userService.getMenuInfos()}static{this.\u0275fac=function(n){return new(n||i)(y(F))}}static{this.\u0275cmp=P({type:i,selectors:[["app-user-sources"]],decls:5,vars:7,consts:[[3,"ngClass"],[1,"container",3,"ngClass"],[1,"row"],[1,"col","p-2"],[3,"sources","update",4,"ngIf"],[3,"update","sources"]],template:function(n,t){n&1&&(a(0,"div",0)(1,"section",1)(2,"div",2)(3,"div",3),h(4,Uu,1,1,"app-sources",4),l()()()()),n&2&&(c("ngClass",re(3,qu,t.api.companyEnvironment)),o(),c("ngClass",re(5,Wu,t.api==null?null:t.api.currentWidget)),o(3),c("ngIf",(t.api.user==null?null:t.api.user.sources)!=null))},dependencies:[ce,R,Qi],styles:[".spacing-top[_ngcontent-%COMP%]{padding-top:50px}"]})}}return i})();function ju(i,r){i&1&&(a(0,"p",10),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.sources.quota_warning")," "))}function Qu(i,r){if(i&1&&(a(0,"mat-radio-button",6),d(1,"translate"),a(2,"span",7)(3,"mat-icon",8),p(4,"pie_chart"),l(),p(5),d(6,"translate"),d(7,"replace"),d(8,"translate"),h(9,ju,3,3,"p",9),l()()),i&2){let e=r.$implicit,n=m(2);E("disabled",e.disabled)("checked",n.selectedSource==e),we("matTooltip",u(1,13,"components.order_summary.sources.disabled_quota")),c("value",e)("matTooltipDisabled",e.disabled!=!0)("disabled",e.disabled),o(5),En(" ",te(7,17,u(6,15,"components.order_summary.sources.type."+e.type),":name",e.label)," ",n.utils.minutesToString(e==null?null:e.remaining)," / ",n.utils.minutesToString(e==null?null:e.initial)," ",u(8,21,"components.order_summary.sources.frequencies."+(e.frequency==null?null:e.frequency.toLowerCase()))," "),o(4),c("ngIf",n.selectedSource==e&&n.shouldWarnQuotaCredit)}}function Hu(i,r){if(i&1&&(M(0),h(1,Qu,10,23,"mat-radio-button",5),S()),i&2){let e=m();o(),c("ngForOf",e.sources.quotas)}}function Yu(i,r){i&1&&(a(0,"span"),p(1),d(2,"translate"),l()),i&2&&(o(),w(u(2,1,"components.order_summary.sources.is_default")))}function Gu(i,r){if(i&1&&(a(0,"mat-radio-button",14)(1,"mat-icon",8),p(2,"credit_card"),l(),p(3),d(4,"translate"),h(5,Yu,3,3,"span",4),l()),i&2){let e=r.$implicit,n=m(2);E("disabled",e.disabled)("checked",n.selectedSource==e),c("value",e)("disabled",e.disabled),o(3),Q("",u(4,9,"components.order_summary.sources.type."+e.type)," ",e.number," "),o(2),c("ngIf",e.isDefault)}}function Ku(i,r){if(i&1){let e=k();a(0,"app-button",19),b("clicked",function(){f(e);let t=m(3);return v(t.getCardToken())}),l()}i&2&&c("littleButton",!0)("littleFont",!0)}function $u(i,r){i&1&&x(0,"mat-spinner",20),i&2&&c("diameter",25)}function Xu(i,r){if(i&1){let e=k();a(0,"div",15)(1,"ngx-stripe-card",16,0),b("change",function(t){f(e);let s=V(2),_=m(2);return v(_.cardUpdated(t,s))}),l(),h(3,Ku,1,2,"app-button",17)(4,$u,1,1,"mat-spinner",18),l()}if(i&2){let e=m(2);o(),c("stripe",e.Stripe)("options",e.stripeCardOptions)("elementsOptions",e.elementsOptions),o(2),c("ngIf",!e.cardLoading),o(),c("ngIf",e.cardLoading)}}function Ju(i,r){if(i&1&&(M(0),h(1,Gu,6,11,"mat-radio-button",11),a(2,"mat-radio-button",12)(3,"mat-icon",8),p(4,"add"),l(),p(5),d(6,"translate"),h(7,Xu,5,5,"div",13),l(),S()),i&2){let e=m();o(),c("ngForOf",e.sources.cards),o(),E("checked",e.selectedSource=="add_card"),c("value","add_card"),o(3),g("",u(6,6,"components.order_summary.sources.add_card")," "),o(2),c("ngIf",e.selectedSource==="add_card")}}function Zu(i,r){i&1&&(a(0,"span"),p(1),d(2,"translate"),l()),i&2&&(o(),w(u(2,1,"components.order_summary.sources.is_default")))}function e0(i,r){if(i&1&&(a(0,"mat-radio-button",14)(1,"mat-icon",8),p(2,"double_arrow"),l(),p(3),d(4,"translate"),h(5,Zu,3,3,"span",4),l()),i&2){let e=r.$implicit,n=m(2);E("disabled",e.disabled)("checked",n.selectedSource==e),c("value",e)("disabled",e.disabled),o(3),Q("",u(4,9,"components.order_summary.sources.type."+e.type)," ",e.number," "),o(2),c("ngIf",e.isDefault)}}function t0(i,r){if(i&1){let e=k();a(0,"app-button",24),b("clicked",function(){f(e);let t=m(2);return v(t.getSepaToken())}),l()}i&2&&c("littleButton",!0)("littleFont",!0)}function i0(i,r){i&1&&x(0,"mat-spinner",20),i&2&&c("diameter",25)}function n0(i,r){if(i&1){let e=k();M(0),h(1,e0,6,11,"mat-radio-button",11),a(2,"mat-radio-button",12)(3,"mat-icon",8),p(4,"add"),l(),p(5),d(6,"translate"),a(7,"div",21)(8,"ngx-stripe-iban",22,1),b("change",function(t){f(e);let s=V(9),_=m();return v(_.ibanUpdated(t,s))}),l(),h(10,t0,1,2,"app-button",23)(11,i0,1,1,"mat-spinner",18),l()(),S()}if(i&2){let e=m();o(),c("ngForOf",e.sources.sepas),o(),E("checked",e.selectedSource=="add_sepa"),c("value","add_sepa"),o(3),g("",u(6,12,"components.order_summary.sources.add_sepa")," "),o(2),E("d-none",e.selectedSource!=="add_sepa"),o(),c("stripe",e.Stripe)("options",e.stripeIbanOptions)("elementsOptions",e.elementsOptions),o(2),c("ngIf",!e.sepaLoading),o(),c("ngIf",e.sepaLoading)}}function o0(i,r){i&1&&(a(0,"p",10),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.sources.credit_warning")," "))}function r0(i,r){if(i&1&&(a(0,"mat-radio-button",14)(1,"mat-icon",8),p(2,"euro_symbol"),l(),a(3,"span"),p(4),d(5,"translate"),d(6,"replace"),l(),a(7,"span"),p(8),d(9,"currency"),d(10,"currency"),d(11,"translate"),l(),h(12,o0,3,3,"p",9),l()),i&2){let e=r.$implicit,n=m(2);E("disabled",e.disabled)("checked",n.selectedSource==e),c("value",e)("disabled",e.disabled),o(4),g("",te(6,13,u(5,11,"components.order_summary.sources.type."+e.type),":name",(e==null||e.company==null?null:e.company.socialReason)||(e==null||e.accessRight==null||e.accessRight.company==null?null:e.accessRight.company.socialReason))," "),o(4),In("",T(9,17,(e==null?null:e.remaining)/100,"EUR")," / ",T(10,20,(e==null?null:e.initial)/100,"EUR")," ",u(11,23,"components.order_summary.sources.frequencies."+(e.frequency==null?null:e.frequency.toLowerCase())),""),o(4),c("ngIf",n.selectedSource==e&&n.shouldWarnQuotaCredit)}}function a0(i,r){if(i&1&&(M(0),h(1,r0,13,25,"mat-radio-button",11),S()),i&2){let e=m();o(),c("ngForOf",e.sources.credits)}}var Xl=(()=>{class i{set content(e){this.sources=e,this.updateDefault()}constructor(e,n,t,s){this.api=e,this.utils=n,this.toastr=t,this.translate=s,this.selectedSource=null,this.sources={cards:[],sepas:[],quotas:[],credits:[]},this.types=["card","sepa","quota","credit"],this.shouldWarnQuotaCredit=!1,this.selectedSourceChanged=new L(!0),this.Stripe=null,this.cardLoading=!1,this.invalidCardError=null,this.sepaLoading=!1,this.invalidIbanError=null,this.stripeCardOptions={style:{base:{color:"#32325d",lineHeight:"16px",fontFamily:"Satoshi, sans-serif",fontSmoothing:"antialiased",fontSize:"14px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},hidePostalCode:!0},this.stripeIbanOptions={style:{base:{color:"#32325d",lineHeight:"18px",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"}},invalid:{color:"#fa755a",iconColor:"#fa755a"}},supportedCountries:["SEPA"],placeholderCountry:"FR",hideIcon:!0},this.elementsOptions={locale:"auto"}}ngOnInit(){this.Stripe=this.utils.getStripeInstance(),setTimeout(()=>{this.Stripe=this.utils.getStripeInstance(),this.updateDefault()})}updateDefault(){this.selectedSource===null&&this.sources.cards.concat(this.sources.sepas).forEach(e=>{e.isDefault&&this.types.indexOf(e.type)!==-1&&(this.selectedSource=e,this.selectedSourceChanged.emit(e))})}sourceChanged(e){e!=="add_card"&&e!=="add_sepa"?this.selectedSourceChanged.emit(e):this.selectedSourceChanged.emit(null)}cardUpdated(e,n){n&&(this.card=n),e.event&&e.event.error?this.invalidCardError=e.event.error:this.invalidCardError=null}ibanUpdated(e,n){n&&(this.iban=n),this.invalidIbanError=null,this.ibanElementCompleted=e.complete,e.error&&(this.invalidIbanError=e.error)}getCardToken(){this.cardLoading=!0;let e=this;this.Stripe=this.utils.getStripeInstance(),this.Stripe.createPaymentMethod({type:"card",card:this.card.element}).toPromise().then(n=>{n.paymentMethod?e.api.userService.sourcesService.setup().then(t=>{e.Stripe.confirmCardSetup(t.seti_secret,{payment_method:n.paymentMethod.id}).toPromise().then(s=>{}),e.api.userService.sourcesService.add({token:n.paymentMethod.id,type:"card"}).then(s=>{let _=s.cards.find(C=>C.id===n.paymentMethod.id);_&&(e.sources.cards.push(_),e.sources.cards.forEach(C=>{C.id===_.id&&(e.selectedSource=C,e.sourceChanged(C))})),e.card.element.clear(),e.cardLoading=!1}).catch(()=>{e.card.getCard().clear(),e.cardLoading=!1,e.toastr.error(e.translate.get("components.sources.error.text"))})}):n.error&&(e.cardLoading=!1)})}getSepaToken(){this.sepaLoading=!0;let e=this;this.Stripe=this.utils.getStripeInstance(),this.Stripe.createPaymentMethod({type:"sepa_debit",sepa_debit:this.iban.element,billing_details:{name:this.api.user.firstname+" "+this.api.user.lastname,email:this.api.user.email}}).toPromise().then(function(n){n.paymentMethod?e.api.userService.sourcesService.setup().then(t=>{e.Stripe.confirmSepaDebitSetup(t.seti_secret,{payment_method:n.paymentMethod.id,mandate_data:{customer_acceptance:{type:"online"}}}).toPromise().then(s=>{}),e.api.userService.sourcesService.add({token:n.paymentMethod.id,type:"sepa"}).then(s=>{let _=s.sepas.find(C=>C.id===n.paymentMethod.id);_&&(e.sources.sepas.push(_),e.sources.sepas.forEach(C=>{C.id===_.id&&(e.selectedSource=C,e.sourceChanged(C))})),e.sepaLoading=!1})}):n.error&&(e.sepaLoading=!1)})}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(_e),y(Ce),y(U))}}static{this.\u0275cmp=P({type:i,selectors:[["app-sources-min"]],viewQuery:function(n,t){if(n&1&&(A(Pt,5),A(Tt,5)),n&2){let s;D(s=O())&&(t.card=s.first),D(s=O())&&(t.iban=s.first)}},inputs:{selectedSource:"selectedSource",content:[0,"sources","content"],types:"types",shouldWarnQuotaCredit:"shouldWarnQuotaCredit"},outputs:{selectedSourceChanged:"selectedSourceChanged"},decls:6,vars:5,consts:[["card",""],["iban",""],[1,"px-3"],[1,"sources",3,"ngModelChange","ngModel"],[4,"ngIf"],["class","my-1",3,"value","matTooltipDisabled","matTooltip","disabled","checked",4,"ngFor","ngForOf"],[1,"my-1",3,"value","matTooltipDisabled","matTooltip","disabled"],[1,"text-wrap"],[1,"mx-1"],["class","quotaCreditWarning text-wrap",4,"ngIf"],[1,"quotaCreditWarning","text-wrap"],["class","my-1",3,"value","disabled","checked",4,"ngFor","ngForOf"],[1,"my-1",3,"value"],["class","ms-5 mt-2",4,"ngIf"],[1,"my-1",3,"value","disabled"],[1,"ms-5","mt-2"],["id","card",1,"w-100",3,"change","stripe","options","elementsOptions"],["class","mt-2","iconName","lock","textKey","components.order_summary.sources.add_card_button","type","PRIMARY",3,"littleButton","littleFont","clicked",4,"ngIf"],[3,"diameter",4,"ngIf"],["iconName","lock","textKey","components.order_summary.sources.add_card_button","type","PRIMARY",1,"mt-2",3,"clicked","littleButton","littleFont"],[3,"diameter"],[1,"ms-5","mt-2","w-100"],["id","iban",1,"w-100",3,"change","stripe","options","elementsOptions"],["class","mt-2","iconName","lock","textKey","components.order_summary.sources.add_sepa_button","type","PRIMARY",3,"littleButton","littleFont","clicked",4,"ngIf"],["iconName","lock","textKey","components.order_summary.sources.add_sepa_button","type","PRIMARY",1,"mt-2",3,"clicked","littleButton","littleFont"]],template:function(n,t){n&1&&(a(0,"div",2)(1,"mat-radio-group",3),Pe("ngModelChange",function(_){return Ee(t.selectedSource,_)||(t.selectedSource=_),_}),b("ngModelChange",function(_){return t.sourceChanged(_)}),h(2,Hu,2,1,"ng-container",4)(3,Ju,8,8,"ng-container",4)(4,n0,12,14,"ng-container",4)(5,a0,2,1,"ng-container",4),l()()),n&2&&(o(),Ie("ngModel",t.selectedSource),o(),c("ngIf",t.types.indexOf("quota")>-1),o(),c("ngIf",t.types.indexOf("card")>-1),o(),c("ngIf",t.types.indexOf("sepa")>-1),o(),c("ngIf",t.types.indexOf("credit")>-1))},dependencies:[j,R,ee,gt,Pt,Tt,be,lr,cr,$,Te,H,Xe,N,et],styles:[".sources[_ngcontent-%COMP%]{font-size:14px;list-style:none}.sources[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{height:15px!important;width:15px!important;font-size:15px;vertical-align:middle;margin-bottom:2px}.sources[_ngcontent-%COMP%]   .checked[_ngcontent-%COMP%]{color:var(--primary-color-600);font-size:14px!important}.sources[_ngcontent-%COMP%]  .mat-mdc-radio-label{align-items:start!important}.addCard[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{color:#fff}.mat-mdc-radio-button[_ngcontent-%COMP%]{display:block!important}.quotaCreditWarning[_ngcontent-%COMP%]{font-size:12px;color:#55585e;margin-bottom:0}[_nghost-%COMP%]     .mat-mdc-radio-button.mat-mdc-radio-disabled .mat-mdc-radio-outer-circle, [_nghost-%COMP%]     .mat-mdc-radio-button.mat-mdc-radio-disabled.mat-mdc-radio-checked .mat-mdc-radio-outer-circle{border-color:#d6d6d7!important}[_nghost-%COMP%]     .mat-mdc-radio-button.mat-mdc-accent.mat-mdc-radio-checked .mat-mdc-radio-outer-circle{border-color:var(--primary-color-600)!important}[_nghost-%COMP%]     .mat-mdc-radio-button.mat-mdc-accent .mat-mdc-radio-inner-circle{background-color:var(--primary-color-600)!important}"]})}}return i})();var Tr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[de,Ye,Ge,Ae,mr,xr,Ai,at,Je,fi,ji,Wn,Ze,Xt,Re,Ln,Re]})}}return i})();var ro=Me(Zc(),1);var i_=["qrcElement"],ep=(()=>{class i{constructor(e,n){this.renderer=e,this.sanitizer=n,this.allowEmptyString=!1,this.colorDark="#000000ff",this.colorLight="#ffffffff",this.cssClass="qrcode",this.elementType="canvas",this.errorCorrectionLevel="M",this.margin=4,this.qrdata="",this.scale=4,this.width=10,this.qrCodeURL=new L,this.context=null}ngOnChanges(){return z(this,null,function*(){yield this.createQRCode()})}isValidQrCodeText(e){return this.allowEmptyString===!1?!(typeof e>"u"||e===""||e==="null"||e===null):!(typeof e>"u")}toDataURL(e){return new Promise((n,t)=>{(0,ro.toDataURL)(this.qrdata,e,(s,_)=>{s?t(s):n(_)})})}toCanvas(e,n){return new Promise((t,s)=>{(0,ro.toCanvas)(e,this.qrdata,n,_=>{_?s(_):t("success")})})}toSVG(e){return new Promise((n,t)=>{(0,ro.toString)(this.qrdata,e,(s,_)=>{s?t(s):n(_)})})}renderElement(e){for(let n of this.qrcElement.nativeElement.childNodes)this.renderer.removeChild(this.qrcElement.nativeElement,n);this.renderer.appendChild(this.qrcElement.nativeElement,e)}createQRCode(){return z(this,null,function*(){this.version&&this.version>40?(console.warn("[angularx-qrcode] max value for `version` is 40"),this.version=40):this.version&&this.version<1?(console.warn("[angularx-qrcode]`min value for `version` is 1"),this.version=1):this.version!==void 0&&isNaN(this.version)&&(console.warn("[angularx-qrcode] version should be a number, defaulting to auto."),this.version=void 0);try{if(!this.isValidQrCodeText(this.qrdata))throw new Error("[angularx-qrcode] Field `qrdata` is empty, set 'allowEmptyString=\"true\"' to overwrite this behaviour.");this.isValidQrCodeText(this.qrdata)&&this.qrdata===""&&(this.qrdata=" ");let e={color:{dark:this.colorDark,light:this.colorLight},errorCorrectionLevel:this.errorCorrectionLevel,margin:this.margin,scale:this.scale,version:this.version,width:this.width},n=this.imageSrc,t=this.imageHeight||40,s=this.imageWidth||40;switch(this.elementType){case"canvas":{let _=this.renderer.createElement("canvas");this.context=_.getContext("2d"),this.toCanvas(_,e).then(()=>{if(this.ariaLabel&&this.renderer.setAttribute(_,"aria-label",`${this.ariaLabel}`),this.title&&this.renderer.setAttribute(_,"title",`${this.title}`),n&&this.context){this.centerImage=new Image(s,t),n!==this.centerImage.src&&(this.centerImage.src=n),t!==this.centerImage.height&&(this.centerImage.height=t),s!==this.centerImage.width&&(this.centerImage.width=s);let C=this.centerImage;C&&(C.onload=()=>{this.context?.drawImage(C,_.width/2-s/2,_.height/2-t/2,s,t)})}this.renderElement(_),this.emitQRCodeURL(_)}).catch(C=>{console.error("[angularx-qrcode] canvas error:",C)});break}case"svg":{let _=this.renderer.createElement("div");this.toSVG(e).then(C=>{this.renderer.setProperty(_,"innerHTML",C);let I=_.firstChild;this.renderer.setAttribute(I,"height",`${this.width}`),this.renderer.setAttribute(I,"width",`${this.width}`),this.renderElement(I),this.emitQRCodeURL(I)}).catch(C=>{console.error("[angularx-qrcode] svg error:",C)});break}case"url":case"img":default:{let _=this.renderer.createElement("img");this.toDataURL(e).then(C=>{this.alt&&_.setAttribute("alt",this.alt),this.ariaLabel&&_.setAttribute("aria-label",this.ariaLabel),_.setAttribute("src",C),this.title&&_.setAttribute("title",this.title),this.renderElement(_),this.emitQRCodeURL(_)}).catch(C=>{console.error("[angularx-qrcode] img/url error:",C)})}}}catch(e){console.error("[angularx-qrcode] Error generating QR Code:",e.message)}})}convertBase64ImageUrlToBlob(e){let n=e.split(";base64,"),t=n[0].split(":")[1],s=atob(n[1]),_=new Uint8Array(s.length);for(let C=0;C<s.length;++C)_[C]=s.charCodeAt(C);return new Blob([_],{type:t})}emitQRCodeURL(e){let n=e.constructor.name;if(n===SVGSVGElement.name){let I=e.outerHTML,B=new Blob([I],{type:"image/svg+xml"}),Y=URL.createObjectURL(B),ye=this.sanitizer.bypassSecurityTrustUrl(Y);this.qrCodeURL.emit(ye);return}let t="";n===HTMLCanvasElement.name&&(t=e.toDataURL("image/png")),n===HTMLImageElement.name&&(t=e.src);let s=this.convertBase64ImageUrlToBlob(t),_=URL.createObjectURL(s),C=this.sanitizer.bypassSecurityTrustUrl(_);this.qrCodeURL.emit(C)}static{this.\u0275fac=function(n){return new(n||i)(y(Cs),y(Es))}}static{this.\u0275cmp=P({type:i,selectors:[["qrcode"]],viewQuery:function(n,t){if(n&1&&A(i_,7),n&2){let s;D(s=O())&&(t.qrcElement=s.first)}},inputs:{allowEmptyString:"allowEmptyString",colorDark:"colorDark",colorLight:"colorLight",cssClass:"cssClass",elementType:"elementType",errorCorrectionLevel:"errorCorrectionLevel",imageSrc:"imageSrc",imageHeight:"imageHeight",imageWidth:"imageWidth",margin:"margin",qrdata:"qrdata",scale:"scale",version:"version",width:"width",alt:"alt",ariaLabel:"ariaLabel",title:"title"},outputs:{qrCodeURL:"qrCodeURL"},features:[wn],decls:2,vars:2,consts:[["qrcElement",""]],template:function(n,t){n&1&&x(0,"div",null,0),n&2&&jo(t.cssClass)},encapsulation:2,changeDetection:0})}}return i})(),tp=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({})}}return i})();function o_(i,r){i&1&&x(0,"mat-spinner",6),i&2&&c("diameter",25)}function r_(i,r){if(i&1&&(a(0,"div",7),x(1,"qrcode",8),l()),i&2){let e=m();E("d-none",e.loading),o(),c("qrdata",e.environment.front+"/qr/"+e.qrCodeInformation.code)("colorDark","#ffffff")("colorLight","#343b3f")("elementType","img")("margin",0)("width",200)}}var ip=(()=>{class i{constructor(e){this.data=e,this.environment=ut,this.loading=!0,this.qrCodeInformation=e.qrCodeInformation,this.loading=!1}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||i)(y(lt))}}static{this.\u0275cmp=P({type:i,selectors:[["app-booking-qr-code"]],decls:10,vars:5,consts:[["mat-dialog-title",""],["class","m-auto",3,"diameter",4,"ngIf"],["class","d-flex justify-content-center",3,"d-none",4,"ngIf"],[1,"row","w-100","justify-content-center"],[1,"col-auto"],["textKey","global.back","type","SECONDARY","mat-dialog-close",""],[1,"m-auto",3,"diameter"],[1,"d-flex","justify-content-center"],[3,"qrdata","colorDark","colorLight","elementType","margin","width"]],template:function(n,t){n&1&&(a(0,"h5",0),p(1),d(2,"translate"),l(),a(3,"mat-dialog-content"),h(4,o_,1,1,"mat-spinner",1)(5,r_,2,8,"div",2),l(),a(6,"mat-dialog-actions")(7,"div",3)(8,"div",4),x(9,"app-button",5),l()()()),n&2&&(o(),g(" ",u(2,3,"components.booking_qr_code.title"),`
`),o(3),c("ngIf",t.loading),o(),c("ngIf",t.qrCodeInformation))},dependencies:[R,H,ep,jt,ct,Mt,pt,N],styles:["[_nghost-%COMP%]     .qrcode{background-color:#343b3f;padding:16px}"]})}}return i})();var np=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[de,Ae,Re,tp,Fn]})}}return i})();function a_(i,r){i&1&&x(0,"mat-spinner",8),i&2&&c("diameter",25)}function s_(i,r){if(i&1&&(M(0),p(1),d(2,"amParse"),d(3,"amLocal"),d(4,"amFromUtc"),d(5,"amTz"),d(6,"amDateFormat"),S()),i&2){let e=m().$implicit,n=m();o(),g(" ",T(6,10,T(5,7,u(4,5,u(3,3,u(2,1,e.createdAt))),n.booking==null||n.booking.workspace==null?null:n.booking.workspace.timezone),"L")," ")}}function l_(i,r){if(i&1&&(M(0),p(1),d(2,"amParse"),d(3,"amLocal"),d(4,"amFromUtc"),d(5,"amTz"),d(6,"amDateFormat"),S()),i&2){let e=m().$implicit,n=m();o(),g(" ",T(6,10,T(5,7,u(4,5,u(3,3,u(2,1,e.createdAt))),n.booking==null||n.booking.building==null?null:n.booking.building.timezone),"L")," ")}}function c_(i,r){if(i&1&&(a(0,"li")(1,"a",9),p(2),d(3,"translate"),h(4,s_,7,13,"ng-container",4)(5,l_,7,13,"ng-container",4),l()()),i&2){let e=r.$implicit,n=m();o(),c("href",e.url+"?locale="+n.translate.getLang(),K),o(),g(" ",u(3,4,"components.bookings.bookings_table.swal.invoice")," "),o(2),c("ngIf",n.booking==null||n.booking.workspace==null?null:n.booking.workspace.timezone),o(),c("ngIf",!(!(n.booking==null||n.booking.workspace==null)&&n.booking.workspace.timezone)&&(n.booking==null||n.booking.building==null?null:n.booking.building.timezone))}}function p_(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.bookings.bookings_table.invoices.empty")," "))}var op=(()=>{class i{constructor(e,n,t){this.api=e,this.translate=n,this.data=t,this.loading=!1,t&&(this.booking=t.booking,this.invoices=t.invoices,this.onClose=t.onClose)}ngOnInit(){this.invoices||(this.loading=!0,this.api.invoiceService.getBookingInvoices(this.booking.id).then(e=>{this.invoices=e,this.loading=!1}))}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(U),y(lt,8))}}static{this.\u0275cmp=P({type:i,selectors:[["app-invoices-list-modal"]],inputs:{invoices:"invoices",booking:"booking"},decls:13,vars:9,consts:[["mat-dialog-title",""],["class","m-auto",3,"diameter",4,"ngIf"],[1,"invoices-list"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"row","w-100","justify-content-center"],[1,"col-auto"],["textKey","global.back","type","SECONDARY","mat-dialog-close",""],[1,"m-auto",3,"diameter"],["target","_blank","rel","noopener",3,"href"]],template:function(n,t){n&1&&(a(0,"h5",0),p(1),d(2,"translate"),l(),a(3,"mat-dialog-content"),h(4,a_,1,1,"mat-spinner",1),a(5,"div")(6,"ul",2),h(7,c_,6,6,"li",3),l()(),h(8,p_,3,3,"div",4),l(),a(9,"mat-dialog-actions")(10,"div",5)(11,"div",6),x(12,"app-button",7),l()()()),n&2&&(o(),Q(" ",u(2,7,"components.bookings.bookings_table.invoices.title"),"\xA0: ",t.booking==null||t.booking.workspace==null?null:t.booking.workspace.title,`
`),o(3),c("ngIf",!t.invoices||t.loading),o(),E("d-none",!t.invoices),o(2),c("ngForOf",t.invoices),o(),c("ngIf",(t.invoices==null?null:t.invoices.length)===0))},dependencies:[j,R,be,H,jt,ct,Mt,pt,N,ei,Hn,ti,ii,gi],styles:["a[_ngcontent-%COMP%]{color:var(--primary-color-600)}"]})}}return i})();var _n=Me(go());var es=Me(go());var u_=["participantsElement"],rp=i=>({participant:i});function __(i,r){if(i&1&&(p(0),d(1,"translate")),i&2){let e,n=m();Q(" ",u(1,2,"components.book-next-to.title.author")," ",(e=n.readableDate)!==null&&e!==void 0?e:""," ")}}function h_(i,r){i&1&&(p(0),d(1,"translate")),i&2&&g(" ",u(1,1,"components.book-next-to.title.invited")," ")}function g_(i,r){i&1&&(a(0,"div",7)(1,"button",21),He(),a(2,"svg",17),x(3,"path",18)(4,"path",19),l()()())}function f_(i,r){i&1&&tn(0)}function v_(i,r){if(i&1&&(a(0,"div",25),h(1,f_,1,0,"ng-container",26),l()),i&2){let e=m(),n=e.$implicit,t=e.index,s=m(3),_=V(12);E("no-border",(s.participants==null?null:s.participants.length)===t+1),o(),c("ngTemplateOutlet",_)("ngTemplateOutletContext",re(4,rp,n))}}function b_(i,r){i&1&&tn(0)}function C_(i,r){i&1&&(a(0,"th",38),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.book-next-to.slot")," "))}function x_(i,r){if(i&1&&(a(0,"div",45),p(1),l()),i&2){let e=m().$implicit;o(),g(" ",e.period," ")}}function y_(i,r){if(i&1&&(a(0,"td",39)(1,"div",40)(2,"div",41)(3,"span",42)(4,"mat-icon",43),p(5,"schedule"),l()()(),h(6,x_,2,1,"div",44),l()()),i&2){let e=r.$implicit;o(6),c("ngIf",e!=null)}}function k_(i,r){i&1&&(a(0,"th",38),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.book-next-to.declarations")," "))}function w_(i,r){if(i&1&&(a(0,"div",54),p(1),l()),i&2){let e=r.$implicit;o(),g(" ",e.seat.fullname," ")}}function S_(i,r){if(i&1&&(a(0,"div",48)(1,"div",40)(2,"div",49)(3,"mat-icon",43),p(4),l()(),a(5,"div",50),h(6,w_,2,1,"div",51),a(7,"div",52),p(8),l(),a(9,"div",53),p(10),l()()()()),i&2){let e=m().$implicit;o(4),w(e.decla.icon),o(2),c("ngForOf",e.decla.seats),o(2),g(" ",e.decla.workspaceName," "),o(2),g(" ",e.decla.buildingName," ")}}function M_(i,r){if(i&1&&(a(0,"div",48)(1,"div",40)(2,"div",49)(3,"mat-icon",43),p(4),l()(),a(5,"div",55)(6,"div",56),p(7),l()()()()),i&2){let e=m().$implicit;o(4),w(e.decla.icon),o(3),g(" ",e.decla.label," ")}}function I_(i,r){if(i&1&&(a(0,"td",46),h(1,S_,11,4,"div",47)(2,M_,8,2,"div",47),l()),i&2){let e=r.$implicit,n=m(5);o(),c("ngIf",n.isBookingType(e.decla)),o(),c("ngIf",!n.isBookingType(e.decla))}}function E_(i,r){i&1&&x(0,"tr",57)}function P_(i,r){if(i&1&&(a(0,"tr",58),p(1),l()),i&2){let e=r.$implicit;o(),g(" ",e," ")}}function T_(i,r){if(i&1&&(M(0),a(1,"mat-expansion-panel",27)(2,"mat-expansion-panel-header")(3,"div",28),h(4,b_,1,0,"ng-container",26),l()(),a(5,"div",29)(6,"table",30),M(7,31),h(8,C_,3,3,"th",32)(9,y_,7,1,"td",33),S(),M(10,34),h(11,k_,3,3,"th",32)(12,I_,3,2,"td",35),S(),h(13,E_,1,0,"tr",36)(14,P_,2,1,"tr",37),l()()(),S()),i&2){let e=m(),n=e.$implicit,t=e.index,s=m(3),_=V(12);o(),E("no-border",(s.participants==null?null:s.participants.length)===t+1),o(3),c("ngTemplateOutlet",_)("ngTemplateOutletContext",re(7,rp,n)),o(2),c("dataSource",n.activitiesDatasource),o(7),c("matHeaderRowDef",s.displayedColumns),o(),c("matRowDefColumns",s.displayedColumns)}}function D_(i,r){if(i&1&&(M(0),h(1,v_,2,6,"div",24)(2,T_,15,9,"ng-container",4),S()),i&2){let e=r.$implicit;o(),c("ngIf",(e==null?null:e.activitiesCount)<=1&&!e.activitiesPanel),o(),c("ngIf",e.activitiesPanel)}}function O_(i,r){if(i&1&&(a(0,"div",22,1),h(2,D_,3,2,"ng-container",23),l()),i&2){let e=m(2);o(2),c("ngForOf",e.participants)}}function B_(i,r){if(i&1){let e=k();a(0,"form")(1,"div")(2,"div",10)(3,"div",11)(4,"app-members-autocomplete",12),b("userAdded",function(t){f(e);let s=m();return v(s.addParticipant(t))}),l()(),h(5,g_,5,0,"div",9),l(),a(6,"div",13)(7,"div",14)(8,"div",15)(9,"button",16),He(),a(10,"svg",17),x(11,"path",18)(12,"path",19),l()()(),ki(),a(13,"div"),p(14),d(15,"translate"),l()()()(),h(16,O_,3,1,"div",20),l()}if(i&2){let e=m();o(),E("d-none",!e.isAuthor()),o(3),c("placeholder","components.book-next-to.invite_coworkers")("openAuto",!1)("canAddEmail",!0)("excludedMembers",e.getExcludedMembers()),o(),c("ngIf",e.showTooltip),o(9),g(" ",u(15,9,"components.book-next-to.infos")," "),o(2),c("ngIf",(e.participants==null?null:e.participants.length)>0)}}function A_(i,r){i&1&&(a(0,"div",59),x(1,"mat-spinner",60),l()),i&2&&(o(),c("diameter",25))}function V_(i,r){if(i&1){let e=k();a(0,"div",7)(1,"app-button",61,2),b("clicked",function(t){f(e);let s=m();return v(s.sendInvitation(t))}),l()()}if(i&2){let e=m();o(),c("isDisabled",!e.hasBeenUpdated)("textKey",e.updateButtonText)}}function R_(i,r){i&1&&(a(0,"div",72),d(1,"translate"),He(),a(2,"svg",73),x(3,"path",18)(4,"path",74),l()()),i&2&&c("matTooltip",u(1,1,"components.book-next-to.no_workspace_access"))}function N_(i,r){if(i&1&&(a(0,"span",75),p(1),l()),i&2){let e=m().participant;o(),g(" ",e==null?null:e.icon," ")}}function F_(i,r){if(i&1){let e=k();a(0,"app-button-action",76),b("clicked",function(){f(e);let t=m().participant,s=m();return v(s.deleteParticipant(t==null?null:t.id,t))})("click",function(t){return f(e),v(t.stopPropagation())}),l()}}function L_(i,r){if(i&1&&(a(0,"div",62)(1,"div",63),x(2,"app-member-view",64),h(3,R_,5,3,"div",65),l(),a(4,"div",66)(5,"div",40)(6,"div",67),h(7,N_,2,1,"span",68),l(),a(8,"div")(9,"p",69),p(10),l()()()(),a(11,"div",70),h(12,F_,1,0,"app-button-action",71),l()()),i&2){let e=r.participant,n=m();o(),E("disabled-participant",!e.hasWorkspaceAccess),o(),c("member",e==null?null:e.user),o(),c("ngIf",!e.hasWorkspaceAccess),o(),E("disabled-participant",!e.hasWorkspaceAccess),o(3),c("ngIf",(e==null?null:e.activitiesCount)>0),o(3),g(" ",e==null?null:e.label," "),o(2),c("ngIf",n.isAuthor()&&e)}}var ap=(()=>{class i{set updateParticipantsElement(e){this.participantsElement=e}constructor(e,n,t,s,_,C){this.api=e,this.translate=n,this.toastr=t,this.changeDetector=s,this.data=_,this.dialogRef=C,this.bookNextToInfo=null,this.participants=[],this.isLoaded=!1,this.periods=[null,"MORNING","AFTERNOON","DAY"],this.displayedColumns=["period","declaration"],this.closed=new L(!0),this.participantsLength=new L(!0),this.inputValue="",this.hasBeenUpdated=!1,this.updateButtonText="",this.onClose=()=>{this.close()},this.booking=_.booking}ngOnInit(){if(this.booking){if(this.booking.bookNextToInfo)this.bookNextToInfo=this.booking.bookNextToInfo;else{let e={startDate:this.booking.start,endDate:this.booking.end,author:this.booking.author,participants:[]};this.bookNextToInfo=e}this.participants=(this.booking?.bookNextToInfo?.participants?.filter(e=>e.user?.id!==this.api?.user.id)??[]).map(e=>(e.user||(e.user={firstname:"",lastname:"",avatar:null,email:e.email}),e)),this.participants?.length>0?this.updateButtonText=this.translate.get("components.book-next-to.button_update"):this.updateButtonText=this.translate.get("components.book-next-to.button_send"),this.changeDetector.detectChanges(),this.bookNextToInfo?.id&&this.api.bookingService.getParticipantActivities(this.booking?.id,this.bookNextToInfo?.id).then(e=>{this.participants.forEach(n=>{this.updateParticipantData(n,e.participants[n.id]??[])})}),this.setReadableDate(),setTimeout(()=>{this.isLoaded=!0},600)}}isAuthor(){return this.bookNextToInfo?.author?.id===this.api?.user?.id}close(){this.dialogRef.close()}addParticipant(e){let n={id:null,email:e.email,user:Object.assign({firstname:"",lastname:"",avatar:null},e)};this.hasBeenUpdated=!0,this.participants.push(n),this.bookNextToInfo.participants=this.participants,this.changeDetector.detectChanges(),setTimeout(()=>{this.participantsElement?.nativeElement?.scrollTo({top:this.participantsElement?.nativeElement?.scrollHeight,left:0,behavior:"smooth"})},150),e?.id?this.api.unavailableMomentsService.getUserActivities(e.id,this.booking.start,this.booking.end).then(t=>{this.updateParticipantData(n,t??[])}):this.updateParticipantData(n,[])}updateParticipantData(e,n=[]){e.activities=n??[],e.activitiesCount=n?.length??0,this.updateParticipantMainData(e),this.updateParticipantActivity(e),this.updateParticipantDatasource(e),e.activitiesPanel=e.activitiesCount>1||e.activitiesCount==1&&this.isBookingType(e.mainActivity),this.changeDetector.detectChanges(),e.hasWorkspaceAccess=this.booking.workspace.access==="PUBLIC",!e.hasWorkspaceAccess&&e.user?.id&&this.api.workspaceService.userHasAccess(this.booking.workspace?.id,e.user.id).then(t=>{e.hasWorkspaceAccess=t.success,this.changeDetector.detectChanges()})}getExcludedMembers(){(this.participants?.map(n=>n.user)??[]).push({id:this.api.user.id,email:this.api.user.email})}sendInvitation(e){this.participantsLength.emit(this.participants?.length+1);let n=Object.assign({},this.bookNextToInfo);n.participants=n.participants.filter(t=>t.hasWorkspaceAccess).map(t=>({id:t.id,email:t.email,user:t.user})),this.api.bookingService.createOrUpdateBookNextToInfo(this.booking.id,n,e?.button).then(()=>{this.toastr.success(this.translate.get("components.book-next-to.toastr.success."+(this.bookNextToInfo?.id?"update":"send"))),this.close()})}deleteParticipant(e,n){let t=this.participants.findIndex(s=>s?.email===n?.email);this.participants.splice(t,1),this.bookNextToInfo.participants=this.participants,this.hasBeenUpdated=!0,this.changeDetector.detectChanges()}setReadableDate(){let e=(0,es.default)(this.booking.start),n=(0,es.default)(this.booking.end),t=e.format("DD"),s=e.format("MMMM"),_=n.format("DD"),C=n.format("MMMM");e.isSame(n,"day")?this.readableDate=t+" "+s:e.isSame(n,"month")?this.readableDate=t+" - "+_+" "+s:this.readableDate=t+" "+s+" - "+_+" "+C}updateParticipantMainData(e){let n=null,t=null,s=null;if((e?.activities?.length??0)>0){for(let _ of e.activities)s||(s=_),_.entity_type==="booking"&&(s=_),s?.entity_type!=="booking"&&_.entity_type!=="absence"&&(s=_);switch(s?.entity_type){case"home_office":n="maps_home_work",t=this.translate.get("components.book-next-to.status_home_office");break;case"absence":case"absence_misc":n="event_busy",t=this.translate.get("components.book-next-to.status_absence");break;case"booking":case"monthly_booking":n="room",t=this.translate.get("components.book-next-to.status_booked_seat");break}e?.activities?.length>1&&(t=this.translate.get("components.book-next-to.status_multiple").replace(":declarations",e?.activities.length))}e.icon=n,e.label=t,e.mainActivity=s}updateParticipantActivity(e){let n="";if(e?.activities.length>0)if(e?.activities.length==1)switch((e?.activities[0]).entity_type){case"home_office":n=this.translate.get("components.book-next-to.status_home_office");break;case"absence":case"absence_misc":n=this.translate.get("components.book-next-to.status_absence");break;case"booking":case"monthly_booking":n=this.translate.get("components.book-next-to.status_booked_seat");break}else n=this.translate.get("components.book-next-to.status_multiple").replace(":declarations",e?.activities.length);e.activity=n}updateParticipantDatasource(e){let n=[];this.periods.forEach(t=>{e.activities?.filter(s=>s.period===t)?.forEach(s=>{n.push({period:this.getPeriod(s,t),decla:this.transformDeclaration(s)})})}),e.activitiesDatasource=n}transformDeclaration(e){let n={icon:"",label:"",seats:[],workspaceName:"",buildingName:"",entity_type:""};switch(e.entity_type){case"home_office":n.icon="maps_home_work",n.entity_type="home_office",n.label=this.translate.get("components.book-next-to.status_home_office");break;case"absence":case"absence_misc":n.icon="event_busy",n.entity_type="absence",n.label=this.translate.get("components.book-next-to.status_absence");break;case"booking":case"monthly_booking":n.entity_type="booking",n.icon="room",n.label=this.translate.get("components.book-next-to.status_booked_seat");let t=e.bookedSeats;t&&t.length>0&&(n.seats=t),e.workspace?.title&&(n.workspaceName=e.workspace.title),e.workspace?.building?.name&&(n.buildingName=e.workspace.building.name);break}return n}isBookingType(e){return e.entity_type=="booking"||e.entity_type=="monthly_booking"}getPeriod(e,n){return n===null?e.formattedStartDate+" - "+(e.formattedEndDate??this.translate.get("bookings.in_progress")):this.translate.get("global.period."+n.toLowerCase())}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(U),y(Ce),y(Se),y(lt),y(hl))}}static{this.\u0275cmp=P({type:i,selectors:[["app-book-next-to"]],viewQuery:function(n,t){if(n&1&&A(u_,5),n&2){let s;D(s=O())&&(t.updateParticipantsElement=s.first)}},inputs:{booking:"booking"},outputs:{closed:"closed",participantsLength:"participantsLength"},decls:13,vars:4,consts:[["participantSummary",""],["participantsElement",""],["saveButton",""],["mat-dialog-title",""],[4,"ngIf"],["class","participants_loader",4,"ngIf"],[1,"row","w-100","justify-content-center"],[1,"col-auto"],["textKey","global.back","type","SECONDARY",3,"clicked"],["class","col-auto",4,"ngIf"],[1,"row","align-items-center","justify-content-between","my-2"],[1,"col"],[3,"userAdded","placeholder","openAuto","canAddEmail","excludedMembers"],[1,"col-12","p-0"],[1,"d-flex","align-items-baseline","mt-2","mb-4"],[1,"pe-2"],["type","button",1,"button-info","ms-0"],["xmlns","http://www.w3.org/2000/svg","height","24","viewBox","0 0 24 24","width","24"],["d","M0 0h24v24H0z","fill","none"],["d","M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"],["class","scrollable-participants mt-2",4,"ngIf"],["type","button",1,"button-info"],[1,"scrollable-participants","mt-2"],[4,"ngFor","ngForOf"],["class","col-12 border-panel px-responsive-0",3,"no-border",4,"ngIf"],[1,"col-12","border-panel","px-responsive-0"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"panel-activities"],[1,"col-12","px-responsive-0"],[1,"mx-3"],["mat-table","","matSort","","matSortActive","name","matSortDirection","asc","matSortDisableClear","","multiTemplateDataRows","","aria-label","declarations",1,"m-0","activities-table",3,"dataSource"],["matColumnDef","period"],["class","table-header","mat-header-cell","",4,"matHeaderCellDef"],["class","declaration_period","mat-cell","",4,"matCellDef"],["matColumnDef","declaration"],["mat-cell","",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["class","table-row","mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","",1,"table-header"],["mat-cell","",1,"declaration_period"],[1,"d-flex","align-items-start"],[1,"declaration_icon_table","ps-0","pe-1"],[1,"declaration_icon_table-cell","vertical-align"],[1,"declaration_icon"],["class","declaration_period_time",4,"ngIf"],[1,"declaration_period_time"],["mat-cell",""],["class","declaration_block",4,"ngIf"],[1,"declaration_block"],[1,"pe-1"],[1,"w-100"],["class","seat-name",4,"ngFor","ngForOf"],[1,"workspace-name"],[1,"building-name"],[1,"seat-name"],[1,"declaration_label"],[1,"w-100","text-truncate"],["mat-header-row",""],["mat-row","",1,"table-row"],[1,"participants_loader"],[1,"m-auto",3,"diameter"],["type","PRIMARY",3,"clicked","isDisabled","textKey"],[1,"row","flex-nowrap","align-items-center","participant-block"],[1,"col-6","pe-2","position-relative"],[3,"member"],["class","workspaceWarning",3,"matTooltip",4,"ngIf"],[1,"col-5","px-0"],[1,"activity","pe-1"],["class","material-icons activity-icon",4,"ngIf"],[1,"mb-0","p-nowrap"],[1,"col-1","d-flex","justify-content-end","ps-0"],["class","trash-icon float-end","iconName","delete",3,"clicked","click",4,"ngIf"],[1,"workspaceWarning",3,"matTooltip"],["xmlns","http://www.w3.org/2000/svg","height","24","viewBox","0 0 24 24","width","24",1,"warning-icon"],["d","M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"],[1,"material-icons","activity-icon"],["iconName","delete",1,"trash-icon","float-end",3,"clicked","click"]],template:function(n,t){if(n&1){let s=k();a(0,"h5",3),h(1,__,2,4)(2,h_,2,3),l(),a(3,"mat-dialog-content"),h(4,B_,17,11,"form",4)(5,A_,2,1,"div",5),l(),a(6,"mat-dialog-actions")(7,"div",6)(8,"div",7)(9,"app-button",8),b("clicked",function(){return f(s),v(t.onClose())}),l()(),h(10,V_,3,2,"div",9),l()(),h(11,L_,13,9,"ng-template",null,0,ne)}n&2&&(o(),$e(t.isAuthor()?1:2),o(3),c("ngIf",t.isLoaded),o(),c("ngIf",!t.isLoaded),o(5),c("ngIf",t.isAuthor()))},dependencies:[j,R,_o,be,oi,Fi,Gn,Li,Ni,Ui,qi,Wi,Kn,zi,Xn,$,Ht,Yt,vr,ft,ht,Ii,Te,Tl,H,tt,ct,Mt,pt,N],styles:[".mat-mdc-mini-fab[_ngcontent-%COMP%]{width:28px;height:28px;line-height:18px;font-size:18px;box-shadow:none}.mat-mdc-mini-fab[_ngcontent-%COMP%]  .mat-mdc-button-wrapper{line-height:18px;padding:0}.mat-mdc-mini-fab[_ngcontent-%COMP%]  .mat-mdc-button-wrapper .mat-icon{font-size:18px;padding-right:0;padding-top:3px;color:#fff}[_nghost-%COMP%]     .mat-mdc-content{display:block}.button-info[_ngcontent-%COMP%]{cursor:default}.participant-block[_ngcontent-%COMP%]{padding:5px 0;border-radius:0}.participant-block[_ngcontent-%COMP%]   .trash-icon[_ngcontent-%COMP%]{visibility:hidden}.participant-block[_ngcontent-%COMP%]:hover{background-color:#ebebeb33;border-radius:5px!important;transition:all ease .3s}.participant-block[_ngcontent-%COMP%]:hover   .user-name[_ngcontent-%COMP%]{text-overflow:ellipsis;overflow:hidden}.participant-block[_ngcontent-%COMP%]:hover   .trash-icon[_ngcontent-%COMP%]{visibility:visible}.participant-block[_ngcontent-%COMP%]:active{background-color:#ebebeb4d;transition:all ease .3s}.scrollable-participants[_ngcontent-%COMP%]{max-height:calc(100vh - 340px);overflow:auto;overflow-x:hidden}.info-icon[_ngcontent-%COMP%]{font-size:16px;margin-bottom:21px;color:var(--primary-color-600)}.infos-paragraph[_ngcontent-%COMP%]{font-size:.9rem}.member-informations[_ngcontent-%COMP%]{max-width:calc(100% - 40px - .5rem)}.member-informations[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{line-height:initial;font-size:16px;overflow:hidden;text-overflow:ellipsis}.member-informations[_ngcontent-%COMP%]   .email[_ngcontent-%COMP%]{font-size:10px!important;color:var(--primary-color-500);line-height:initial;overflow:hidden;text-overflow:ellipsis}.avatar[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:50%;overflow:hidden}.avatar[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{display:block}.mat-icon[_ngcontent-%COMP%]{font-size:28px;padding-right:0;color:#fff}.status[_ngcontent-%COMP%]{font-size:1.2rem}.waiting[_ngcontent-%COMP%]{color:#fabf20}.confirmed[_ngcontent-%COMP%]{color:var(--primary-color-600)}.declined[_ngcontent-%COMP%]{color:#fc5172}.visio[_ngcontent-%COMP%]{color:var(--primary-color-600)}.trash[_ngcontent-%COMP%]{cursor:pointer;color:#6d6d6d}.warning[_ngcontent-%COMP%]{fill:orange;font-size:20px}.workspaceWarning[_ngcontent-%COMP%]{position:absolute;right:-10px;top:5px}.warning-icon[_ngcontent-%COMP%]{fill:orange;width:16px;height:16px}.warning-link[_ngcontent-%COMP%]{cursor:pointer;float:left;margin:4px 0 0 10px}.warning-link.disabled[_ngcontent-%COMP%]{cursor:default}.disabled-participant[_ngcontent-%COMP%]{opacity:.5}[_nghost-%COMP%]     .mat-mdc-tab-header-pagination-controls-enabled .mat-mdc-tab-header-pagination{display:none!important}[_nghost-%COMP%]     .mat-mdc-tab-label{min-width:100px!important;width:calc(100% / 3 - 5px)!important}[_nghost-%COMP%]     .mat-mdc-ink-bar{width:calc(100% / 3 - 5px)!important}[_nghost-%COMP%]     .mat-mdc-tab-group.mat-mdc-primary .mat-mdc-ink-bar{background-color:var(--primary-color-600)}[_nghost-%COMP%]     .mat-mdc-tab-header{border-bottom:none}[_nghost-%COMP%]     .mat-mdc-checkbox{font-size:14px}[_nghost-%COMP%]     .mat-mdc-expanded{margin-top:0;margin-bottom:0}[_nghost-%COMP%]     .mat-mdc-checkbox-inner-container{width:13px!important;height:13px!important}[_nghost-%COMP%]     .mat-mdc-checkbox-layout{margin-top:1rem}mat-checkbox[_ngcontent-%COMP%]     .mat-mdc-checkbox-label{margin-left:11px}.participants_loader[_ngcontent-%COMP%]{text-align:center;margin-top:50px;margin-bottom:50px}.mat-mdc-table[_ngcontent-%COMP%]{margin:1rem 0;border:none}.mat-mdc-table[_ngcontent-%COMP%]   tr.mat-mdc-row[_ngcontent-%COMP%]{background-color:#fff;transition:all ease .3s;vertical-align:baseline}.mat-mdc-table[_ngcontent-%COMP%]   tr.mat-mdc-row[_ngcontent-%COMP%]:hover{background-color:#ebebeb33;transition:all ease .3s}.mat-mdc-table[_ngcontent-%COMP%]   tr.mat-mdc-row[_ngcontent-%COMP%]:hover   .icon-delete[_ngcontent-%COMP%]{opacity:1}.mat-mdc-table[_ngcontent-%COMP%]   tr.mat-mdc-row[_ngcontent-%COMP%]:active{background-color:#ebebeb4d;transition:all ease .3s}.mat-mdc-table[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]{border:none;margin:3px 0 0 10px}.mat-mdc-table[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]   .organisateur[_ngcontent-%COMP%]{font-size:12px;color:var(--primary-color-500);font-style:italic}.mat-mdc-table[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]   .user-email[_ngcontent-%COMP%]{color:var(--primary-color-500);font-size:12px}.mat-mdc-table[_ngcontent-%COMP%]   .img-width[_ngcontent-%COMP%]{width:41px;height:41px;border:solid 1px var(--primary-color-600);border-radius:50px;overflow:hidden;display:flex;align-items:center}.mat-mdc-table[_ngcontent-%COMP%]   .img-width[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:43px;height:43px;object-fit:cover;object-position:center;margin:0;padding:0}.mat-mdc-table[_ngcontent-%COMP%]   .icons-circle[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:50px;display:flex;align-items:center;justify-content:center}.mat-mdc-table[_ngcontent-%COMP%]   .icons-circle.confirmed[_ngcontent-%COMP%]{background-color:var(--primary-color-600)}.mat-mdc-table[_ngcontent-%COMP%]   .icons-circle.declined[_ngcontent-%COMP%]{background-color:#fc5172}.mat-mdc-table[_ngcontent-%COMP%]   .icons-circle[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:1rem;color:#fff;margin-left:1px}.mat-mdc-table[_ngcontent-%COMP%]   .icon-delete[_ngcontent-%COMP%]{transition:all ease .3s;font-size:21px;color:#6d6d6d;opacity:0}.mat-mdc-table[_ngcontent-%COMP%]   .icon-delete[_ngcontent-%COMP%]:hover{color:#55585e}.mat-mdc-table[_ngcontent-%COMP%]   .mat-mdc-cell-icons[_ngcontent-%COMP%]{width:22%}.add-button[_ngcontent-%COMP%]{font-size:16px;color:var(--primary-color-600);font-weight:600;line-height:19px;margin:0;padding:0;outline:none;background:none;border:none}.activity[_ngcontent-%COMP%]{padding-left:0}.activity[_ngcontent-%COMP%]   .activity-icon[_ngcontent-%COMP%]{margin-top:4px;font-size:16px;width:16px;height:16px}.modal-footer[_ngcontent-%COMP%]{justify-content:center}.modal-footer[_ngcontent-%COMP%]   .button-gray[_ngcontent-%COMP%]{background-color:transparent;color:#55585e;border:none;box-shadow:none;text-decoration:underline;font-weight:600}.modal-footer[_ngcontent-%COMP%]   .button-purple[_ngcontent-%COMP%]{background-color:purple;border:none;padding-left:2rem;padding-right:2rem;box-shadow:0 2px 8px gray;transition:all ease .3s}.modal-footer[_ngcontent-%COMP%]   .button-purple[_ngcontent-%COMP%]:hover{background-color:var(--primary-color-700);transition:all ease .3s}.book-next-to-activities__title[_ngcontent-%COMP%]{font-weight:600}.schedule-block[_ngcontent-%COMP%]{display:inline-flex;margin-top:10px}.schedule-block[_ngcontent-%COMP%]   .schedule-block__period[_ngcontent-%COMP%]{margin-left:5px}  div.swal2-container.swal-remove div.swal2-actions button.remove-guest{background-color:#d3153b!important}  div.swal2-container.swal-remove div.swal2-actions button.remove-guest:hover{background-color:#ff325b!important}.multiple-declaration-block[_ngcontent-%COMP%]{display:inline-flex;margin-top:10px}.activities-table[_ngcontent-%COMP%]{width:100%;font-size:16px}.activities-table[_ngcontent-%COMP%]   tr.mat-mdc-header-row[_ngcontent-%COMP%]{height:auto}.activities-table[_ngcontent-%COMP%]   .table-row[_ngcontent-%COMP%]:hover{background-color:#fff!important;transition:none!important;cursor:default!important}.activities-table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{text-align:left}.activities-table[_ngcontent-%COMP%]   .table-header[_ngcontent-%COMP%]{text-align:left;font-size:14px;color:#55585e;font-weight:600;padding:10px 0 3px;border:none}.activities-table[_ngcontent-%COMP%]   .declaration_icon[_ngcontent-%COMP%]{font-size:16px;color:#55585e;margin-top:2px;height:16px;width:16px}.activities-table[_ngcontent-%COMP%]   .declaration_label[_ngcontent-%COMP%], .activities-table[_ngcontent-%COMP%]   .declaration_period[_ngcontent-%COMP%]{font-size:16px}.activities-table[_ngcontent-%COMP%]   .mat-column-period[_ngcontent-%COMP%]{padding-right:15px!important;width:35%;min-width:35%}.activities-table[_ngcontent-%COMP%]   th.mat-mdc-header-cell[_ngcontent-%COMP%], .activities-table[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]{padding-left:0}.activities-table[_ngcontent-%COMP%]   .mat-column-declaration[_ngcontent-%COMP%]{width:65%;min-width:65%}.activities-table[_ngcontent-%COMP%]   .declaration_period_time[_ngcontent-%COMP%]{padding:0}.activities-table[_ngcontent-%COMP%]   .declaration_block[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:10px;margin-left:-2px}.activities-table[_ngcontent-%COMP%]   .seat-name[_ngcontent-%COMP%]{font-size:16px;font-weight:400;margin-bottom:3px;color:#55585e}.activities-table[_ngcontent-%COMP%]   .workspace-name[_ngcontent-%COMP%]{color:#55585e;font-size:16px;font-weight:400;margin-bottom:3px}.activities-table[_ngcontent-%COMP%]   .building-name[_ngcontent-%COMP%]{font-size:16px;color:var(--primary-color-500);font-weight:400}.periodIcon[_ngcontent-%COMP%]{color:#000;font-size:18px}[_nghost-%COMP%]     .mat-expansion-panel .mat-expansion-panel-body{padding:0}[_nghost-%COMP%]     .mat-expansion-panel-header{height:fit-content}.mat-expansion-panel[_ngcontent-%COMP%]{box-shadow:none!important;border-bottom:1px solid #ebebeb;border-radius:0!important}.mat-expansion-panel.no-border[_ngcontent-%COMP%]{border-bottom:none}.p-nowrap[_ngcontent-%COMP%]{white-space:nowrap}.border-panel[_ngcontent-%COMP%]{border-bottom:1px solid #ebebeb}.border-panel.no-border[_ngcontent-%COMP%]{border-bottom:none}[_nghost-%COMP%]     .p-left-members-autocomplete{padding-left:5px}[_nghost-%COMP%]     .mat-expansion-panel:not(.mat-mdc-expanded) .mat-expansion-panel-header:hover:not([aria-disabled=true]){background:transparent}[_nghost-%COMP%]     .mat-expansion-panel .mat-expansion-panel-header.mat-mdc-expanded:hover{background:transparent}@media screen and (max-width: 576px){[_nghost-%COMP%]     .mat-mdc-tab-labels{flex-direction:column}[_nghost-%COMP%]     .mat-mdc-tab-label{width:100%!important}[_nghost-%COMP%]     .mat-mdc-tab-label.mat-mdc-tab-label-active{border-bottom:2px solid var(--primary-color-600)}[_nghost-%COMP%]     .mat-mdc-ink-bar{display:none}td.mat-mdc-cell[_ngcontent-%COMP%]:last-of-type, td.mat-mdc-cell[_ngcontent-%COMP%]:first-of-type{padding:0}}@media screen and (max-width: 400px){.px-responsive-0[_ngcontent-%COMP%]{padding:0 5px}}"]})}}return i})();var hn=Me(hi());var q_=["saveButton"],W_=()=>({standalone:!0}),U_=()=>["c_mfit","f_png","w_40","h_40"];function z_(i,r){i&1&&(p(0),d(1,"translate")),i&2&&g(" ",u(1,1,"components.meeting.participants")," ")}function j_(i,r){i&1&&(p(0),d(1,"translate")),i&2&&g(" ",u(1,1,"components.meeting.participants_invite")," ")}function Q_(i,r){i&1&&(a(0,"div",5)(1,"em")(2,"mat-icon",14),d(3,"translate"),p(4," warning "),l()()()),i&2&&(o(2),we("matTooltip",u(3,1,"components.meeting.warning.booking_places")))}function H_(i,r){i&1&&(a(0,"div",5)(1,"em")(2,"mat-icon",14),d(3,"translate"),p(4," warning "),l()()()),i&2&&(o(2),we("matTooltip",u(3,1,"components.meeting.warning.workspace_places")))}function Y_(i,r){if(i&1){let e=k();M(0),a(1,"app-members-autocomplete",15),b("userAdded",function(t){f(e);let s=m();return v(s.addParticipant(t))}),l(),a(2,"mat-checkbox",16),Pe("ngModelChange",function(t){f(e);let s=m();return Ee(s.visioChecked,t)||(s.visioChecked=t),v(t)}),p(3),d(4,"translate"),l(),S()}if(i&2){let e=m();o(),c("excludedMembers",e.getExcludedMembers())("canAddEmail",!0)("showTooltip",!0)("withMargin",!1),o(),Ie("ngModel",e.visioChecked),c("ngModelOptions",X(9,W_)),o(),w(u(4,7,"components.meeting.auth_visio"))}}function G_(i,r){i&1&&(a(0,"th",24),p(1),d(2,"translate"),l()),i&2&&(o(),w(u(2,1,"components.meeting.popin.name")))}function K_(i,r){if(i&1&&(x(0,"img",35),d(1,"imageTransform"),d(2,"translate")),i&2){let e=m().$implicit;we("src",T(1,2,e==null||e.user==null?null:e.user.avatar,X(7,U_)),K),c("alt",u(2,5,"pages.user.profile.avatar.alt-perso"))}}function $_(i,r){i&1&&(x(0,"img",36),d(1,"translate")),i&2&&c("alt",u(1,1,"pages.user.profile.avatar.alt-perso"))}function X_(i,r){i&1&&(a(0,"span",37),p(1,"(Organisateur)"),l())}function J_(i,r){if(i&1&&(a(0,"td",25)(1,"div",26)(2,"div",27)(3,"div",28),h(4,K_,3,8,"img",29)(5,$_,2,3,"img",30),l()(),a(6,"div",31)(7,"div",32),p(8),h(9,X_,2,0,"span",33),l(),a(10,"div",34),p(11),l()()()()),i&2){let e=r.$implicit,n=m(2);o(4),c("ngIf",e==null||e.user==null?null:e.user.avatar),o(),c("ngIf",!(!(e==null||e.user==null)&&e.user.avatar)),o(3),Q(" ",e==null||e.user==null?null:e.user.firstname," ",e==null||e.user==null?null:e.user.lastname," "),o(),c("ngIf",(e==null||e.user==null?null:e.user.id)===(n.booking==null||n.booking.author==null?null:n.booking.author.id)),o(2),w(e==null?null:e.email)}}function Z_(i,r){i&1&&x(0,"th",24)}function eh(i,r){if(i&1){let e=k();a(0,"app-button-action",41),b("clicked",function(){f(e);let t=m().$implicit,s=m(2);return v(s.deleteParticipant(t))}),l()}}function th(i,r){if(i&1&&(a(0,"div",42),d(1,"translate"),a(2,"span",43),d(3,"translate"),p(4," videocam "),l()()),i&2){let e=m().$implicit;we("matTooltip",u(1,2,"components.meeting.popin.status."+e.status)),o(2),we("matTooltip",u(3,4,"components.meeting.popin.status."+e.status))}}function ih(i,r){if(i&1&&(a(0,"td",38),h(1,eh,1,0,"app-button-action",39)(2,th,5,6,"div",40),l()),i&2){let e=r.$implicit,n=m(2);o(),c("ngIf",n.isAuthor),o(),c("ngIf",(e==null?null:e.status)==="CONFIRMED_IN_VISIO")}}function nh(i,r){if(i&1&&x(0,"tr",44),i&2){let e=r.index,n=m(2);E("no-border",e===(n.participants==null?null:n.participants.length)-1)}}function oh(i,r){if(i&1&&(a(0,"table",17),M(1,18),h(2,G_,3,3,"th",19)(3,J_,12,6,"td",20),S(),M(4,21),h(5,Z_,1,0,"th",19)(6,ih,3,2,"td",22),S(),h(7,nh,1,2,"tr",23),l()),i&2){let e=m();c("dataSource",e.participants),o(7),c("matRowDefColumns",e.displayedColumns)}}function rh(i,r){if(i&1){let e=k();a(0,"app-button",45,0),b("clicked",function(t){f(e);let s=m();return v(s.sendInvitation(t))}),l()}}var sp=(()=>{class i{constructor(e,n,t,s,_){this.api=e,this.toastr=n,this.translate=t,this.changeDetector=s,this.data=_,this.subjectCtrl=new ue("",[W.required]),this.allParticipants=[],this.participants=[],this.visioChecked=!1,this.displayedColumns=["name","actions"],this.isAuthor=!1,this.invitationSent=!1,this.booking=_.booking,this.onSuccess=_.onSuccess}ngOnInit(){this.booking.meetingInfo&&(this.subjectCtrl.setValue(this.booking.meetingInfo.subject),this.allParticipants=this.booking.meetingInfo.participants,this.participants=this.allParticipants,this.tabChanged(0),this.visioChecked=this.booking.meetingInfo.authorizeVisio,this.sortParticipants()),this.isAuthor=this.booking.author.id===this.api.user?.id}sortParticipants(){this.participants.sort((e,n)=>e.user?.id===this.booking.author.id?-1:n.user?.id===this.booking.author.id?1:!e.user&&!n.user?e.email>n.email?1:-1:e.user?n.user?e.user.lastname.toLowerCase()===n.user.lastname.toLowerCase()?e.user.firstname.toLowerCase()>n.user.firstname.toLowerCase()?1:-1:e.user.lastname.toLowerCase()>n.user.lastname.toLowerCase()?1:-1:1:-1),this.participants=[...this.participants]}applyFilter(e){let n=e.toLowerCase().trim();this.participants=this.allParticipants.filter(t=>t.user!=null?t.user.firstname.toLowerCase().indexOf(n)>-1||t.user.lastname.toLowerCase().indexOf(n)>-1||t.user.email.toLowerCase().indexOf(n)>-1:t.email.toLowerCase().indexOf(n)>-1)}addParticipant(e){let n={status:"WAITING",user:e,email:e.email};this.participants.filter(s=>s.email===n.email).length>0||(this.allParticipants.push(n),this.matTabGroup.selectedIndex===1&&this.tabChanged(1),this.matTabGroup.selectedIndex=1),this.changeDetector.detectChanges()}deleteParticipant(e){this.participants.splice(this.participants.indexOf(e),1),this.participants=[...this.participants],this.allParticipants.splice(this.allParticipants.indexOf(e),1),this.allParticipants=[...this.allParticipants],this.changeDetector.detectChanges()}sendInvitation(e){let n={subject:this.subjectCtrl.value,participants:this.allParticipants,authorizeVisio:this.visioChecked};this.api.bookingService.invite(this.booking.id,n,e?.button).then(t=>{this.toastr.success(this.translate.get("components.meeting.toast.success")),this.onSuccess(t)})}participantsUser(){return this.allParticipants.map(e=>e.user)}getExcludedMembers(){return this.participantsUser()}allowVisio(){this.visioChecked=!this.visioChecked}participantsLength(){let e=0;return this.allParticipants.forEach(n=>{(n.status==="CONFIRMED"||n.status==="CONFIRMED_IN_VISIO")&&e++}),e}waitingLength(){let e=0;return this.allParticipants.forEach(n=>{n.status==="WAITING"&&e++}),e}declinedLength(){let e=0;return this.allParticipants.forEach(n=>{n.status==="DECLINED"&&e++}),e}tabChanged(e){let n=["CONFIRMED","CONFIRMED_IN_VISIO"];switch(e){case 0:n=["CONFIRMED","CONFIRMED_IN_VISIO"];break;case 1:n=["WAITING"];break;case 2:n=["DECLINED"];break}this.participants=this.allParticipants.filter(t=>n.includes(t.status))}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(Ce),y(U),y(Se),y(lt))}}static{this.\u0275cmp=P({type:i,selectors:[["app-meeting-participants"]],viewQuery:function(n,t){if(n&1&&(A(q_,5),A(Zt,5)),n&2){let s;D(s=O())&&(t.saveButton=s.first),D(s=O())&&(t.matTabGroup=s.first)}},inputs:{booking:"booking"},decls:26,vars:23,consts:[["saveButton",""],["mat-dialog-title",""],[1,"row","g-0","w-100","d-inline-flex"],[1,"col-auto"],[1,"mat-title-large"],[1,"warning-link"],[3,"submit"],[4,"ngIf"],["mat-align-tabs","center",3,"selectedIndexChange","disableRipple"],[3,"label"],["mat-table","","class","mat-elevation-z8 w-100","aria-describedby","participants list",3,"dataSource",4,"ngIf"],[1,"row","w-100","justify-content-center"],["textKey","global.back","type","SECONDARY","mat-dialog-close",""],["textKey","components.meeting.popin.send_invitation","type","PRIMARY",3,"clicked",4,"ngIf"],[1,"warning",3,"matTooltip"],["type","onlyMembers",3,"userAdded","excludedMembers","canAddEmail","showTooltip","withMargin"],[1,"mt-3","ms-1","pb-3",3,"ngModelChange","ngModel","ngModelOptions"],["mat-table","","aria-describedby","participants list",1,"mat-elevation-z8","w-100",3,"dataSource"],["matColumnDef","name"],["mat-header-cell","","scope","col",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-cell","","class","mat-cell-icons",4,"matCellDef"],["mat-row","",3,"no-border",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","scope","col"],["mat-cell",""],[1,"d-flex","w-100"],[1,"me-2","d-flex","align-items-center"],[1,"img-width"],[3,"alt","src",4,"ngIf"],["src","assets/images/avatar_none.png",3,"alt",4,"ngIf"],[1,"member-informations"],[1,"text-start"],["class","organisateur",4,"ngIf"],[1,"text-start","user-email"],[3,"alt","src"],["src","assets/images/avatar_none.png",3,"alt"],[1,"organisateur"],["mat-cell","",1,"mat-cell-icons"],["class","icon-delete float-end","iconName","delete",3,"clicked",4,"ngIf"],["class","icons-circle confirmed",3,"matTooltip",4,"ngIf"],["iconName","delete",1,"icon-delete","float-end",3,"clicked"],[1,"icons-circle","confirmed",3,"matTooltip"],[1,"material-icons-round",3,"matTooltip"],["mat-row",""],["textKey","components.meeting.popin.send_invitation","type","PRIMARY",3,"clicked"]],template:function(n,t){n&1&&(a(0,"div",1)(1,"div",2)(2,"div",3)(3,"h5",4),h(4,z_,2,3)(5,j_,2,3),l()(),a(6,"div",3),h(7,Q_,5,3,"div",5)(8,H_,5,3,"div",5),l()()(),a(9,"mat-dialog-content")(10,"form",6),b("submit",function(){return t.sendInvitation()}),h(11,Y_,5,10,"ng-container",7),a(12,"mat-tab-group",8),b("selectedIndexChange",function(_){return t.tabChanged(_)}),x(13,"mat-tab",9),d(14,"translate"),x(15,"mat-tab",9),d(16,"translate"),x(17,"mat-tab",9),d(18,"translate"),l(),h(19,oh,8,2,"table",10),l()(),a(20,"mat-dialog-actions")(21,"div",11)(22,"div",3),x(23,"app-button",12),l(),a(24,"div",3),h(25,rh,2,0,"app-button",13),l()()()),n&2&&(o(4),$e((t.allParticipants==null?null:t.allParticipants.length)>1?4:5),o(3),$e((t.allParticipants==null?null:t.allParticipants.length)>(t.booking==null?null:t.booking.places)&&(t.allParticipants==null?null:t.allParticipants.length)<=(t.booking==null||t.booking.workspace==null?null:t.booking.workspace.place)?7:(t.allParticipants==null?null:t.allParticipants.length)>(t.booking==null||t.booking.workspace==null?null:t.booking.workspace.place)?8:-1),o(4),c("ngIf",t.isAuthor),o(),E("d-none",(t.allParticipants==null?null:t.allParticipants.length)<=0),c("disableRipple",!0),o(),Mn("label","",u(14,17,"components.meeting.status.participate")," ","("+t.participantsLength()+")",""),o(2),Mn("label","",u(16,19,"components.meeting.status.guest")," ","("+t.waitingLength()+")",""),o(2),Mn("label","",u(18,21,"components.meeting.status.not_participate")," ","("+t.declinedLength()+")",""),o(2),c("ngIf",t.allParticipants.length>0),o(6),c("ngIf",!t.invitationSent&&t.isAuthor))},dependencies:[R,ft,ee,ht,gt,Ii,oi,Fi,Li,Ni,Ui,qi,Wi,zi,$,Vi,Zt,Te,H,tt,vr,st,jt,ct,Mt,pt,N,ri],styles:[".mat-mdc-mini-fab[_ngcontent-%COMP%]{width:28px;height:28px;line-height:18px;font-size:18px;box-shadow:none}.mat-mdc-mini-fab[_ngcontent-%COMP%]  .mat-mdc-button-wrapper{line-height:18px;padding:0}.mat-mdc-mini-fab[_ngcontent-%COMP%]  .mat-mdc-button-wrapper .mat-icon{font-size:18px;padding-right:0;padding-top:3px;color:#fff}.mat-icon[_ngcontent-%COMP%]{font-size:28px;padding-right:0;color:#fff}.status[_ngcontent-%COMP%]{font-size:1.2rem}.waiting[_ngcontent-%COMP%]{color:#fabf20}.confirmed[_ngcontent-%COMP%]{color:var(--primary-color-600)}.declined[_ngcontent-%COMP%]{color:#fc5172}.visio[_ngcontent-%COMP%]{color:var(--primary-color-600)}.trash[_ngcontent-%COMP%]{cursor:pointer;color:#6d6d6d}.warning[_ngcontent-%COMP%]{color:orange;font-size:20px}.warning-link[_ngcontent-%COMP%]{cursor:pointer;float:left;margin:4px 0 0 10px}.warning-link.disabled[_ngcontent-%COMP%]{cursor:default}[_nghost-%COMP%]     .p-left-members-autocomplete{padding-left:5px}[_nghost-%COMP%]     .mat-mdc-tab-header-pagination-controls-enabled .mat-mdc-tab-header-pagination{display:none!important}[_nghost-%COMP%]     .mat-mdc-tab-label{min-width:100px!important;width:calc(100% / 3 - 5px)!important}[_nghost-%COMP%]     .mat-mdc-ink-bar{width:calc(100% / 3 - 5px)!important}[_nghost-%COMP%]     .mat-mdc-tab-group.mat-mdc-primary .mat-mdc-ink-bar{background-color:var(--primary-color-600)}[_nghost-%COMP%]     .mat-mdc-tab-header{border-bottom:none}[_nghost-%COMP%]     .mat-mdc-checkbox{font-size:16px}[_nghost-%COMP%]     .mat-mdc-checkbox-inner-container{width:13px!important;height:13px!important}[_nghost-%COMP%]     .mat-mdc-checkbox-layout{margin-top:1rem}.mat-mdc-table[_ngcontent-%COMP%]{font-size:16px;margin:1rem 0;border:none}.mat-mdc-table[_ngcontent-%COMP%]   tr.mat-mdc-row[_ngcontent-%COMP%]{background-color:#fff;transition:all ease .3s}.mat-mdc-table[_ngcontent-%COMP%]   tr.mat-mdc-row[_ngcontent-%COMP%]   .icon-delete[_ngcontent-%COMP%]{transition:all ease .3s;opacity:0}.mat-mdc-table[_ngcontent-%COMP%]   tr.mat-mdc-row[_ngcontent-%COMP%]   .icon-delete[_ngcontent-%COMP%]:hover{transition:all ease .3s}.mat-mdc-table[_ngcontent-%COMP%]   tr.mat-mdc-row.no-border[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]{border-bottom:none}.mat-mdc-table[_ngcontent-%COMP%]   tr.mat-mdc-row[_ngcontent-%COMP%]:hover{background-color:#ebebeb33;transition:all ease .3s}.mat-mdc-table[_ngcontent-%COMP%]   tr.mat-mdc-row[_ngcontent-%COMP%]:hover   .icon-delete[_ngcontent-%COMP%]{opacity:1}.mat-mdc-table[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]{border-bottom:1px solid #ebebeb;cursor:pointer;padding:5px 0}.mat-mdc-table[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]   .member-informations[_ngcontent-%COMP%]{font-size:16px}.mat-mdc-table[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]   .member-informations[_ngcontent-%COMP%]   .organisateur[_ngcontent-%COMP%]{font-size:14px;color:var(--primary-color-500);font-style:italic}.mat-mdc-table[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]   .user-email[_ngcontent-%COMP%]{font-size:13px;color:var(--primary-color-500)}.mat-mdc-table[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]:last-of-type{padding-right:15px}.mat-mdc-table[_ngcontent-%COMP%]   td.mat-mdc-cell[_ngcontent-%COMP%]:first-of-type{padding-left:15px}.mat-mdc-table[_ngcontent-%COMP%]   .img-width[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:50px;overflow:hidden;display:flex;align-items:center}.mat-mdc-table[_ngcontent-%COMP%]   .img-width[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;object-position:center;margin:0;padding:0}.mat-mdc-table[_ngcontent-%COMP%]   .icons-circle[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:50px;display:flex;align-items:center;justify-content:center}.mat-mdc-table[_ngcontent-%COMP%]   .icons-circle.confirmed[_ngcontent-%COMP%]{background-color:var(--primary-color-600)}.mat-mdc-table[_ngcontent-%COMP%]   .icons-circle.declined[_ngcontent-%COMP%]{background-color:#fc5172}.mat-mdc-table[_ngcontent-%COMP%]   .icons-circle[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:1rem;color:#fff;margin-left:1px}.mat-mdc-table[_ngcontent-%COMP%]   .mat-mdc-cell-icons[_ngcontent-%COMP%]{width:22%}@media screen and (max-width: 576px){[_nghost-%COMP%]     .mat-mdc-tab-labels{flex-direction:column}[_nghost-%COMP%]     .mat-mdc-tab-label{width:100%!important}[_nghost-%COMP%]     .mat-mdc-tab-label.mat-mdc-tab-label-active{border-bottom:2px solid var(--primary-color-600)}[_nghost-%COMP%]     .mat-mdc-ink-bar{display:none}td.mat-mdc-cell[_ngcontent-%COMP%]:last-of-type{padding-right:5px}td.mat-mdc-cell[_ngcontent-%COMP%]:first-of-type{padding-left:5px}}"]})}}return i})();function ah(i,r){if(i&1&&(M(0),a(1,"h5",11),p(2),d(3,"translate"),l(),x(4,"img",12),S()),i&2){let e=m();o(2),w(u(3,2,"components.order-preview.spartime.access_popin.qrcode.label")),o(2),c("src",e.qrCode,K)}}function sh(i,r){if(i&1&&(a(0,"div",9)(1,"div",14),p(2),l(),a(3,"div",14),p(4),l()()),i&2){let e=r.$implicit;o(2),g(" ",e.description," "),o(2),g(" ",e.code," ")}}function lh(i,r){if(i&1&&(M(0),a(1,"h5",11),p(2),d(3,"translate"),l(),h(4,sh,5,2,"div",13),S()),i&2){let e=m();o(2),w(u(3,2,"components.order-preview.spartime.access_popin.pincode.label")),o(2),c("ngForOf",e.codes)}}var lp=(()=>{class i{constructor(){this.hasQrCode=!1,this.hasCode=!1,this.codes=[]}ngOnInit(){this.booking=this.order.bookings[0],this.hasQrCode=this.booking.spartimeEvents.filter(e=>e.qrCodeLink!=null).length>0,this.hasCode=this.booking.spartimeEvents.filter(e=>e.code!=null).length>0,this.hasQrCode&&(this.qrCode=this.booking.spartimeEvents.filter(e=>e.qrCodeLink!=null)[0].qrCodeLink),this.hasCode&&this.booking.spartimeEvents.filter(e=>e.code!=null).forEach(e=>{this.codes.push({code:e.code,description:e.place})})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-spartime-access"]],decls:20,vars:12,consts:[[1,"card"],[1,""],[1,"row","align-items-center"],[1,"col"],[1,"mb-0"],[1,"col-auto"],["type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"card-body"],[1,"row"],[4,"ngIf"],[1,"mat-title-large"],["alt","",1,"mb-4",3,"src"],["class","row",4,"ngFor","ngForOf"],[1,"col-6"]],template:function(n,t){n&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h5",4),p(5),d(6,"translate"),d(7,"replace"),l()(),a(8,"div",5)(9,"button",6),b("click",function(){return t.onClose()}),a(10,"span",7),p(11,"\xD7"),l()()()()(),a(12,"div",8)(13,"div",9)(14,"div",3)(15,"p"),p(16),d(17,"translate"),l()()(),h(18,ah,5,4,"ng-container",10)(19,lh,5,4,"ng-container",10),l()()),n&2&&(o(5),g(" ",te(7,6,u(6,4,"components.order-preview.spartime.access_popin.title"),":reference",t.order==null?null:t.order.reference)," "),o(11),w(u(17,10,"components.order-preview.spartime.access_popin.baseline")),o(2),c("ngIf",t.hasQrCode),o(),c("ngIf",t.hasCode))},dependencies:[j,R,N,et]})}}return i})();var Eo=Me(go());function ch(i,r){i&1&&(M(0),a(1,"div",5),x(2,"mat-spinner",6),l(),S()),i&2&&(o(2),c("diameter",25))}function ph(i,r){i&1&&(M(0),x(1,"mat-spinner",6),S()),i&2&&(o(),c("diameter",25))}function dh(i,r){if(i&1){let e=k();M(0),a(1,"app-button",15),b("clicked",function(t){f(e);let s=m(2).$implicit,_=m(3);return v(_.generateToken(s,t))}),l(),S()}}function mh(i,r){if(i&1){let e=k();M(0),a(1,"app-button",15),b("clicked",function(){f(e);let t=m(2).$implicit,s=m(3);return v(s.openWelcomrAccess(t))}),l(),S()}}function uh(i,r){if(i&1&&(M(0),h(1,dh,2,0,"ng-container",4)(2,mh,2,0,"ng-container",4),S()),i&2){let e=m().$implicit;o(),c("ngIf",!e.token),o(),c("ngIf",e.token)}}function _h(i,r){if(i&1){let e=k();M(0),a(1,"div",13)(2,"div",16)(3,"mat-icon",17),p(4,"cached"),l()(),a(5,"div",18)(6,"app-button",19),b("clicked",function(){f(e);let t=m().$implicit,s=m(3);return v(s.generateToken(t))}),l()()(),S()}i&2&&(o(3),c("inline",!0))}function hh(i,r){if(i&1&&(a(0,"div",20)(1,"div",3)(2,"div",13)(3,"div",3)(4,"label"),p(5),d(6,"translate"),l()()(),a(7,"div",2)(8,"div",3)(9,"div",21)(10,"div",22)(11,"span",23)(12,"mat-icon",17),p(13,"lock_open"),l()()(),x(14,"input",24),l()()()()()),i&2){let e=m().$implicit;o(5),w(u(6,3,"components.order-preview.welcomr.access_popin.pincode.label")),o(7),c("inline",!0),o(2),we("value",e.pinCode)}}function gh(i,r){if(i&1&&(a(0,"div",20)(1,"div",3)(2,"div",13)(3,"div",3)(4,"label"),p(5),d(6,"translate"),l()()(),a(7,"div",2)(8,"div",3),x(9,"img",25),l()()()()),i&2){let e=m().$implicit;o(5),w(u(6,2,"components.order-preview.welcomr.access_popin.qrcode.label")),o(4),c("src","https://api.qrserver.com/v1/create-qr-code/?data="+e.pinCode+"&size=150x150&format=png",K)}}function fh(i,r){if(i&1&&(M(0),a(1,"mat-expansion-panel",10)(2,"mat-expansion-panel-header")(3,"mat-panel-title")(4,"h6",11),p(5),d(6,"amFromUtc"),d(7,"amTz"),d(8,"amLocal"),d(9,"amDateFormat"),l()()(),a(10,"div",12)(11,"div",2)(12,"div",3)(13,"label"),p(14),d(15,"translate"),l()()(),a(16,"div",13)(17,"div",3),h(18,ph,2,1,"ng-container",4)(19,uh,3,2,"ng-container",4),l(),a(20,"div",3),h(21,_h,7,1,"ng-container",4),l()(),h(22,hh,15,5,"div",14)(23,gh,10,4,"div",14),l()(),S()),i&2){let e=r.$implicit,n=m(3);o(),c("disabled",n.isPast(e))("expanded",n.isTodayOrFirst(e)&&!n.isPast(e)),o(4),g(" ",T(9,16,u(8,14,T(7,11,u(6,9,e.startDate),n.booking==null||n.booking.workspace==null?null:n.booking.workspace.timezone)),"dddd ll")," "),o(9),w(u(15,19,"components.order-preview.welcomr.access_popin.welcomr_app.label")),o(4),c("ngIf",n.isDayLoading(e)),o(),c("ngIf",!n.isDayLoading(e)),o(2),c("ngIf",!n.isDayLoading(e)&&e.token),o(),c("ngIf",e.pinCode),o(),c("ngIf",e.pinCode)}}function vh(i,r){if(i&1&&(a(0,"div",8)(1,"mat-accordion"),h(2,fh,24,21,"ng-container",9),l()()),i&2){let e=m(2);o(2),c("ngForOf",e.access==null?null:e.access.days)}}function bh(i,r){if(i&1){let e=k();a(0,"div")(1,"em"),p(2),d(3,"translate"),l(),a(4,"div",26)(5,"app-button",27),b("clicked",function(){f(e);let t=m(2);return v(t.refresh())}),l()()()}i&2&&(o(2),w(u(3,1,"components.order-preview.welcomr.access_popin.no_access")))}function Ch(i,r){if(i&1&&(M(0),h(1,vh,3,1,"div",7)(2,bh,6,3,"ng-template",null,0,ne),S()),i&2){let e=V(3),n=m();o(),c("ngIf",(n.access==null||n.access.days==null?null:n.access.days.length)>0)("ngIfElse",e)}}var cp=(()=>{class i{constructor(e,n,t,s){this.api=e,this.translate=n,this.toastr=t,this.loading=!0,this.dayLoading={},this.order=s.order,this.email=s.email}ngOnInit(){this.booking=this.order.bookings[0],this.refresh()}refresh(){this.loading=!0,this.api.welcomrService.access(this.booking.id,this.email).then(e=>{this.access=e,this.loading=!1;for(let n of e.days)this.dayLoading[n.startDate]=!1}).catch(e=>{e.error=="USER_OR_EMAIL_REQUIRED"&&this.toastr.error(this.translate.get("components.workspace.welcomr.toastr.email_or_user_required"))})}isPast(e){return Eo.default.tz(e.endDate,"UTC").isBefore((0,Eo.default)())}isTodayOrFirst(e){return Eo.default.tz(e.endDate,"UTC").format("YYYY-MM-DD")===(0,Eo.default)().format("YYYY-MM-DD")?!0:e===this.firstEnabledDay()}firstEnabledDay(){for(let e of this.access.days)if(!this.isPast(e))return e;return null}isDayLoading(e){return this.dayLoading[e.startDate]}generateToken(e,n){this.dayLoading[e.startDate]=!0,this.api.welcomrService.generateToken(this.booking.id,e.startDate,this.email,n?.button).then(t=>{this.access=t,e=this.access.days.find(s=>s.welcomrEventId===e.welcomrEventId),this.openWelcomrAccess(e)}).catch(t=>{t.error=="USER_OR_EMAIL_REQUIRED"?this.toastr.error(this.translate.get("components.workspace.welcomr.toastr.email_or_user_required")):t.error=="WELCOMR_DAY_REQUIRED"&&this.toastr.error(this.translate.get("components.workspace.welcomr.toastr.day_required"))}).finally(()=>{this.dayLoading[e.startDate]=!1})}getLink(e){return"https://w.kzk.fr/?t="+e.token}openWelcomrAccess(e){window.open(this.getLink(e),"_blank")}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(U),y(Ce),y(lt))}}static{this.\u0275cmp=P({type:i,selectors:[["app-welcomr-access"]],decls:12,vars:12,consts:[["noAccess",""],["mat-dialog-title",""],[1,"row"],[1,"col"],[4,"ngIf"],[1,"p-5"],[1,"m-auto",3,"diameter"],["class","p-2",4,"ngIf","ngIfElse"],[1,"p-2"],[4,"ngFor","ngForOf"],[3,"disabled","expanded"],[1,"day"],[1,"mt-3"],[1,"row","align-items-center"],["class","row mt-3",4,"ngIf"],["textKey","components.order-preview.welcomr.access_popin.welcomr_app.cta","type","PRIMARY",3,"clicked"],[1,"col-auto","pe-0"],[3,"inline"],[1,"col","ps-0"],["textKey","components.order-preview.welcomr.access_popin.welcomr_app.regen","type","TERTIARY",3,"clicked"],[1,"row","mt-3"],[1,"input-group","mb-3","digicode"],[1,"input-group-prepend"],["id","basic-addon1",1,"input-group-text"],["type","text","readonly","",1,"form-control",3,"value"],["alt","QRCode",1,"mb-4",3,"src"],[1,"pt-3","d-flex","justify-content-center"],["textKey","components.order-preview.welcomr.access_popin.no_access_refresh","type","PRIMARY",3,"clicked"]],template:function(n,t){n&1&&(a(0,"h5",1),p(1),d(2,"translate"),d(3,"replace"),l(),a(4,"mat-dialog-content")(5,"div",2)(6,"div",3)(7,"p"),p(8),d(9,"translate"),l()()(),h(10,ch,3,1,"ng-container",4)(11,Ch,4,2,"ng-container",4),l()),n&2&&(o(),g(" ",te(3,6,u(2,4,"components.order-preview.welcomr.access_popin.title"),":reference",t.order==null?null:t.order.reference),`
`),o(7),w(u(9,10,"components.order-preview.welcomr.access_popin.baseline")),o(2),c("ngIf",t.loading),o(),c("ngIf",!t.loading))},dependencies:[j,R,be,$,fl,Ht,Yt,gl,H,ct,pt,N,et,ei,ti,ii,gi],styles:[".day[_ngcontent-%COMP%]{padding-top:10px;padding-bottom:10px}.day[_ngcontent-%COMP%]:first-letter{text-transform:uppercase}label[_ngcontent-%COMP%]{font-weight:600}.button[_ngcontent-%COMP%]{font-size:16px}.digicode[_ngcontent-%COMP%]{width:150px!important}"]})}}return i})();var is=Me(go());function xh(i,r){i&1&&(a(0,"div",4)(1,"div",5),x(2,"div",6),l()(),a(3,"div",7)(4,"div",5),x(5,"div",8),l()(),a(6,"div",7)(7,"div",5),x(8,"div",9),l()(),a(9,"div",10)(10,"div",5),x(11,"div",11),l()())}function yh(i,r){if(i&1&&(a(0,"div",17)(1,"div",18),p(2),l()(),a(3,"div",19)(4,"div",20),p(5),l()()),i&2){let e=r.$implicit;o(2),w(e.deviceName),o(3),w(e.formattedPin)}}function kh(i,r){if(i&1&&(x(0,"p",12),d(1,"translate"),d(2,"replace"),a(3,"div",13)(4,"div",14)(5,"mat-icon",15),p(6,"error"),l()(),a(7,"div",16),p(8),d(9,"translate"),d(10,"replace"),d(11,"replace"),l()(),Wt(12,yh,6,2,null,null,qt)),i&2){let e=m();c("innerHTML",te(2,4,u(1,2,e.translatePrefix+"description"),":workspaceTitle",e.bookingOverview.workspaceName),Uo),o(8),g(" ",te(11,14,te(10,10,u(9,8,e.translatePrefix+"time"),":start",e.startTime),":end",e.endTime)," "),o(4),Ut(e.igloohomeAlgoPins)}}var pp=(()=>{class i{constructor(){this.api=di(F),this.data=di(lt),this.translatePrefix="components.integrations.page.igloohome.access.",this.igloohomeAlgoPins=[],this.loading=!0}ngAfterViewInit(){return z(this,null,function*(){this.bookingOverview=this.data.bookingOverview,this.igloohomeAlgoPins=yield this.api.integrationService.igloohome.getAccess(this.bookingOverview.bookingId),this.loading=!1})}get startTime(){return is.default.tz(this.bookingOverview.bookingStart,"UTC").tz(this.bookingOverview.timezone).format("HH:mm")}get endTime(){return is.default.tz(this.bookingOverview.bookingEnd,"UTC").tz(this.bookingOverview.timezone).format("HH:mm")}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-igloohome-access"]],decls:10,vars:4,consts:[["mat-dialog-title",""],[1,"row","w-100","justify-content-center"],[1,"col-auto"],["textKey","global.close","type","SECONDARY","mat-dialog-close",""],[1,"row"],[1,"col"],[1,"placeholder-description","animated"],[1,"row","mt-3"],[1,"placeholder-access-time","animated"],[1,"placeholder-access-name","animated"],[1,"row","mt-1"],[1,"placeholder-access-code","animated"],[1,"mb-0",3,"innerHTML"],[1,"row","mt-3","g-0","justify-content-center"],[1,"col-auto","me-2"],[1,"time-warning"],[1,"col-auto","mat-body-medium"],[1,"row","mt-3","justify-content-center"],[1,"col-auto","mat-title-medium"],[1,"row","mt-2","justify-content-center"],[1,"col-auto","mat-display-small"]],template:function(n,t){n&1&&(a(0,"h5",0),p(1),d(2,"translate"),l(),a(3,"mat-dialog-content"),h(4,xh,12,0)(5,kh,14,18),l(),a(6,"mat-dialog-actions")(7,"div",1)(8,"div",2),x(9,"app-button",3),l()()()),n&2&&(o(),w(u(2,2,t.translatePrefix+"title")),o(3),$e(t.loading?4:5))},dependencies:[$,H,jt,ct,Mt,pt,N,et],styles:[".time-warning[_ngcontent-%COMP%]{color:var(--secondary-colors-orange-dark)}.mat-body-medium[_ngcontent-%COMP%]{color:var(--primary-color-500)}.placeholder-description[_ngcontent-%COMP%]{width:100%;height:1lh}.placeholder-access-time[_ngcontent-%COMP%]{margin:auto;width:100px;height:1lh}.placeholder-access-name[_ngcontent-%COMP%]{margin:auto;width:150px;height:1lh}.placeholder-access-code[_ngcontent-%COMP%]{margin:auto;width:200px;height:2lh}"]})}}return i})();var Mh=["sourceModal"],Ih=()=>["c_mfit","w_240","h_240"],Po=()=>["CREATED","VALIDATED","CONFIRMED","PAID"],Eh=()=>["card","sepa"];function Ph(i,r){if(i&1&&x(0,"app-button-action",45),i&2){m();let e=V(41);c("matMenuTriggerFor",e)}}function Th(i,r){if(i&1){let e=k();a(0,"div")(1,"mat-form-field",46)(2,"mat-label"),p(3),d(4,"translate"),l(),a(5,"input",47,5),d(7,"translate"),b("keyup.enter",function(){f(e);let t=m();return v(t.onEnterTitle())})("blur",function(){f(e);let t=m();return v(t.onEnterTitle())}),l()()()}if(i&2){let e=m();o(3),w(u(4,6,"components.order-preview.meeting.placeholder")),o(2),we("placeholder",u(7,8,"components.order-preview.meeting.placeholder")),c("formControl",e.titleWorkspace)("readonly",!e.hasEditRights)("cdkTrapFocus",e.shouldNotifyInvitations)("cdkTrapFocusAutoCapture",e.shouldNotifyInvitations)}}function Dh(i,r){if(i&1&&(a(0,"div")(1,"h5",48),p(2),l()()),i&2){let e=m();o(2),w(e.titleWorkspace.value)}}function Oh(i,r){if(i&1&&x(0,"app-indoor-map-btn",56),i&2){let e=m(2);c("start",e.booking==null?null:e.booking.start)("end",e.booking==null?null:e.booking.end)("period",e.booking==null?null:e.booking.period)("workspace",e.booking==null?null:e.booking.workspace)("building",e.booking==null||e.booking.workspace==null?null:e.booking.workspace.building)("placeId",e.booking==null||e.booking.workspace==null||e.booking.workspace.mapInformation==null?null:e.booking.workspace.mapInformation.placeId)}}function Bh(i,r){if(i&1&&(a(0,"li"),p(1),l()),i&2){let e=r.$implicit;o(),g(" ",e.seat.fullname," ")}}function Ah(i,r){if(i&1){let e=k();a(0,"app-button",60),b("clicked",function(){f(e);let t=m(4);return v(t.showDetail())}),l()}}function Vh(i,r){if(i&1&&(M(0),a(1,"ul",57),h(2,Bh,2,1,"li",58),d(3,"slice"),l(),h(4,Ah,1,0,"app-button",59),S()),i&2){let e=m(3);o(2),c("ngForOf",te(3,2,e.booking==null?null:e.booking.bookedSeats,0,2)),o(2),c("ngIf",(e.booking==null||e.booking.bookedSeats==null?null:e.booking.bookedSeats.length)>2)}}function Rh(i,r){if(i&1&&(M(0),a(1,"span",61),p(2),l(),S()),i&2){let e=m(3);o(2),g(" ",e.booking==null?null:e.booking.bookedSeats[0].seat.fullname," ")}}function Nh(i,r){if(i&1&&(M(0),h(1,Vh,5,6,"ng-container",15)(2,Rh,3,1,"ng-container",15),S()),i&2){let e=m(2);o(),c("ngIf",(e.booking==null||e.booking.bookedSeats==null?null:e.booking.bookedSeats.length)>1),o(),c("ngIf",(e.booking==null||e.booking.bookedSeats==null?null:e.booking.bookedSeats.length)==1)}}function Fh(i,r){if(i&1){let e=k();a(0,"app-button",62),b("clicked",function(){f(e);let t=m(2);return v(t.showQrCode())}),l()}i&2&&c("noActiveBorders",!0)("paddingX",!1)("paddingY",!1)}function Lh(i,r){if(i&1){let e=k();a(0,"div",49),x(1,"app-icon",50),a(2,"div",51)(3,"div",52)(4,"a",53),b("click",function(){f(e);let t=m();return v(t.goToWorkspace(t.booking==null?null:t.booking.workspace))}),p(5),l(),h(6,Oh,1,6,"app-indoor-map-btn",54),l(),h(7,Nh,3,2,"ng-container",15)(8,Fh,1,3,"app-button",55),l()()}if(i&2){let e=m();o(4),c("matTooltip",e.booking==null||e.booking.workspace==null?null:e.booking.workspace.title),o(),g(" ",e.booking==null||e.booking.workspace==null?null:e.booking.workspace.title," "),o(),c("ngIf",(e.booking==null||e.booking.workspace==null||e.booking.workspace.mapInformation==null?null:e.booking.workspace.mapInformation.placeId)!==null),o(),c("ngIf",(e.booking==null||e.booking.bookedSeats==null?null:e.booking.bookedSeats.length)>0),o(),c("ngIf",e.booking.qrCode&&(e.booking.workspace.type==="cafeteria"&&(e.api.company==null||e.api.company.parameters==null?null:e.api.company.parameters.enableCafeteriaQrCode)||e.booking.workspace.type==="parking"&&(e.api.company==null||e.api.company.parameters==null?null:e.api.company.parameters.enableParkingQrCode)))}}function qh(i,r){if(i&1&&(a(0,"div",63),x(1,"app-icon",50),a(2,"div",64)(3,"p"),p(4),l()()()),i&2){let e=m();o(4),g(" ",e.order==null||e.order.building==null?null:e.order.building.name," ")}}function Wh(i,r){if(i&1&&(M(0),a(1,"p"),p(2),d(3,"translate"),l(),x(4,"app-button-action",67,6),S()),i&2){let e=m(2),n=V(52);o(2),Q(" ",u(3,4,"components.order-preview.services.title")," \xA0:\xA0 ",e.order==null||e.order.services==null?null:e.order.services.length," "),o(2),c("autoClose","outside")("ngbPopover",n)}}function Uh(i,r){i&1&&(a(0,"p"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order-preview.services.no_service")," "))}function zh(i,r){if(i&1&&(a(0,"div",65),x(1,"app-icon",66),a(2,"div",19),h(3,Wh,6,6,"ng-container",15)(4,Uh,3,3,"p",15),l()()),i&2){let e=m();o(3),c("ngIf",(e.order==null||e.order.services==null?null:e.order.services.length)>0),o(),c("ngIf",(e.order==null||e.order.services==null?null:e.order.services.length)<=0)}}function jh(i,r){if(i&1){let e=k();a(0,"app-button",76),b("clicked",function(){f(e);let t=m(2);return v(t.showMeeting())}),l()}i&2&&c("noActiveBorders",!0)("paddingX",!1)("paddingY",!1)}function Qh(i,r){if(i&1){let e=k();a(0,"app-button",77,7),d(2,"translate"),b("clicked",function(){f(e);let t=m(2);return v(t.showMeeting())}),l()}i&2&&c("noActiveBorders",!0)("paddingX",!1)("paddingY",!1)("ngbPopover",u(2,4,"pages.user.book.steps.confirmation.popover"))}function Hh(i,r){if(i&1){let e=k();a(0,"app-button",78),b("clicked",function(){f(e);let t=m(2);return v(t.showMeeting())}),l()}i&2&&c("paddingX",!1)("paddingY",!1)("noActiveBorders",!0)}function Yh(i,r){if(i&1&&(a(0,"div",68)(1,"div",69),x(2,"app-icon",70),a(3,"p",71),p(4),d(5,"translate"),l()(),a(6,"div",72),h(7,jh,1,3,"app-button",73)(8,Qh,3,6,"app-button",74)(9,Hh,1,3,"app-button",75),l()()),i&2){let e=m();o(4),En(" ",e.meetingInfo==null?null:e.meetingInfo.nb_participants,"\xA0/\xA0",e.meetingInfo==null?null:e.meetingInfo.nb_invited,"\xA0",u(5,7,"components.meeting.participant"),"",(e.meetingInfo==null?null:e.meetingInfo.nb_invited)>1?"s":""," "),o(3),c("ngIf",(e.order==null||e.order.author==null?null:e.order.author.id)!==(e.api.user==null?null:e.api.user.id)||(e.order==null||e.order.author==null?null:e.order.author.id)===(e.api.user==null?null:e.api.user.id)&&(e.order==null?null:e.order.step)==="IN_PROGRESS"),o(),c("ngIf",(e.order==null||e.order.author==null?null:e.order.author.id)===(e.api.user==null?null:e.api.user.id)&&(e.order==null||e.order.meetingInfo==null||e.order.meetingInfo.participants==null?null:e.order.meetingInfo.participants.length)<=1&&(e.order==null?null:e.order.step)==="WAITING"&&(e.order==null||e.order.bookings==null?null:e.order.bookings.length)>0),o(),c("ngIf",(e.order==null||e.order.author==null?null:e.order.author.id)===(e.api.user==null?null:e.api.user.id)&&(e.order==null||e.order.meetingInfo==null||e.order.meetingInfo.participants==null?null:e.order.meetingInfo.participants.length)>1&&(e.order==null?null:e.order.step)==="WAITING")}}function Gh(i,r){i&1&&(a(0,"mat-icon",83),p(1,"check"),l())}function Kh(i,r){i&1&&(a(0,"mat-icon",83),p(1,"videocam"),l())}function $h(i,r){i&1&&(a(0,"mat-icon",83),p(1,"close"),l())}function Xh(i,r){if(i&1&&(a(0,"mat-chip-option",80),h(1,Gh,2,0,"mat-icon",81)(2,Kh,2,0,"mat-icon",81)(3,$h,2,0,"mat-icon",81),a(4,"span"),p(5),d(6,"translate"),l(),a(7,"mat-icon",82),p(8,"arrow_drop_down"),l()()),i&2){let e=m(2),n=V(56);c("matMenuTriggerFor",n)("selectable",!1)("disabled",e.meetingInfo==null?null:e.meetingInfo.loading),o(),c("ngIf",(e.meetingInfo==null?null:e.meetingInfo.userParticipation)=="CONFIRMED"),o(),c("ngIf",(e.meetingInfo==null?null:e.meetingInfo.userParticipation)=="CONFIRMED_IN_VISIO"),o(),c("ngIf",(e.meetingInfo==null?null:e.meetingInfo.userParticipation)=="DECLINED"),o(2),w(u(6,7,"components.booking-preview.meeting.status."+(e.meetingInfo==null||e.meetingInfo.userParticipation==null?null:e.meetingInfo.userParticipation.toLowerCase())))}}function Jh(i,r){if(i&1&&(a(0,"div",68),h(1,Xh,9,9,"mat-chip-option",79),l()),i&2){let e=m();o(),c("ngIf",(e.invitedEmail||(e.api==null?null:e.api.user))&&(e.meetingInfo==null?null:e.meetingInfo.userParticipation)!=null)}}function Zh(i,r){if(i&1){let e=k();a(0,"div",51)(1,"app-button",84),b("clicked",function(t){f(e);let s=m();return v(s.confirmBooking(t))}),l(),a(2,"app-button",85),b("clicked",function(t){f(e);let s=m();return v(s.refuseBooking(t))}),l()()}i&2&&(o(),c("isGreen",!0)("littleButton",!0)("littleFont",!0),o(),c("dangerMode",!0)("littleButton",!0)("littleFont",!0))}function eg(i,r){if(i&1){let e=k();a(0,"div",51)(1,"app-button",88),b("clicked",function(){f(e);let t=m(2);return v(t.inviteBookNextTo())}),l()()}i&2&&(o(),c("noActiveBorders",!0)("paddingX",!1)("paddingY",!1))}function tg(i,r){if(i&1){let e=k();a(0,"app-button",91),b("clicked",function(){f(e);let t=m(3);return v(t.inviteBookNextTo())}),l()}if(i&2){let e=m(3);c("textKey",(e.booking==null||e.booking.bookNextToInfo==null||e.booking.bookNextToInfo.author==null?null:e.booking.bookNextToInfo.author.id)===(e.booking==null||e.booking.author==null?null:e.booking.author.id)?"components.book-next-to.manage_participants":"components.book-next-to.see_invited")("noActiveBorders",!0)("paddingX",!1)("paddingY",!1)}}function ig(i,r){if(i&1&&(a(0,"div",89)(1,"div",19),x(2,"app-icon",70),a(3,"p",71),p(4),d(5,"translate"),d(6,"lowercase"),l()(),h(7,tg,1,4,"app-button",90),l()),i&2){let e,n=m(2);o(4),In(" ",((e=n.guestLength)!==null&&e!==void 0?e:1)-1,"\xA0",u(6,6,u(5,4,"components.meeting.status.guest")),"",((e=n.guestLength)!==null&&e!==void 0?e:1)-1>1?"s":""," "),o(3),c("ngIf",n.order==null?null:n.order.workspace)}}function ng(i,r){if(i&1&&(a(0,"div",86),h(1,eg,2,3,"div",27)(2,ig,8,8,"div",87),l()),i&2){let e=m();c("@detailExpand",e.showMore?"expanded":"collapsed"),o(),c("ngIf",(e.order==null?null:e.order.workspace)&&(!(e.booking!=null&&e.booking.bookNextToInfo)||e.guestLength<=0)),o(),c("ngIf",e.guestLength>0)}}function og(i,r){i&1&&(M(0),p(1),d(2,"translate"),a(3,"mat-icon",94),p(4,"expand_more"),l(),S()),i&2&&(o(),g("",u(2,2,"components.order-preview.meeting.show_more")," "),o(2),c("inline",!0))}function rg(i,r){i&1&&(M(0),p(1),d(2,"translate"),a(3,"mat-icon",94),p(4,"expand_less"),l(),S()),i&2&&(o(),g("",u(2,2,"components.order-preview.meeting.show_less")," "),o(2),c("inline",!0))}function ag(i,r){if(i&1){let e=k();a(0,"div",92)(1,"button",93),b("click",function(){f(e);let t=m();return v(t.toggleShowMore())}),h(2,og,5,4,"ng-container",15)(3,rg,5,4,"ng-container",15),l()()}if(i&2){let e=m();o(2),c("ngIf",!e.showMore),o(),c("ngIf",e.showMore)}}function sg(i,r){if(i&1){let e=k();a(0,"app-button-action",95),b("clicked",function(){f(e);let t=m();return v(t.checkin())}),l()}}function lg(i,r){if(i&1){let e=k();a(0,"app-button-action",96),b("clicked",function(){f(e);let t=m();return v(t.checkout())}),l()}}function cg(i,r){if(i&1){let e=k();a(0,"app-button-action",97),b("clicked",function(){f(e);let t=m();return v(t.showRruleOccurences())}),l()}}function pg(i,r){if(i&1){let e=k();a(0,"app-button-action",98),b("clicked",function(){f(e);let t=m();return v(t.showWelcomrAccess())}),l()}}function dg(i,r){if(i&1){let e=k();a(0,"app-button-action",99),b("clicked",function(){f(e);let t=m();return v(t.showIgloohomeAccess())}),l()}}function mg(i,r){if(i&1){let e=k();a(0,"app-button-action",100),b("clicked",function(){f(e);let t=m();return v(t.showSpartimeAccess())}),l()}}function ug(i,r){if(i&1){let e=k();a(0,"app-button-action",101),b("clicked",function(){f(e);let t=m();return v(t.showInvoice())}),l()}if(i&2){let e=m();c("customIcon",!0)("tooltipText",(e.order==null||e.order.bookings==null?null:e.order.bookings.length)>0&&(!(e.order==null||e.order.bookings[0]==null)&&e.order.bookings[0].isMonthlyBooking)?"components.order-preview.menu.invoices.tooltip":"components.order-preview.menu.invoice.tooltip")}}function _g(i,r){if(i&1){let e=k();a(0,"app-button-action",102),b("clicked",function(){f(e);let t=m();return v(t.showSources())}),l()}}function hg(i,r){if(i&1){let e=k();a(0,"app-button-action",103),b("clicked",function(){f(e);let t=m();return v(t.cancel())}),l()}}function gg(i,r){if(i&1){let e=k();a(0,"app-button-action",104),b("clicked",function(){f(e);let t=m();return v(t.stopSubscription())}),l()}}function fg(i,r){if(i&1){let e=k();a(0,"button",44),b("click",function(){f(e);let t=m();return v(t.checkin())}),a(1,"mat-icon"),p(2,"check"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"components.order-preview.menu.checkin")))}function vg(i,r){if(i&1){let e=k();a(0,"button",44),b("click",function(){f(e);let t=m();return v(t.checkout())}),a(1,"mat-icon"),p(2,"timer_off"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"components.order-preview.menu.checkout")))}function bg(i,r){if(i&1){let e=k();a(0,"button",44),b("click",function(){f(e);let t=m();return v(t.showDetail())}),a(1,"mat-icon"),p(2,"find_in_page"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"components.order-preview.menu.detail.tooltip")))}function Cg(i,r){if(i&1){let e=k();a(0,"button",44),b("click",function(){f(e);let t=m();return v(t.showRruleOccurences())}),a(1,"mat-icon"),p(2,"update"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"recurring.see_occurrences")))}function xg(i,r){if(i&1){let e=k();a(0,"button",44),b("click",function(){f(e);let t=m();return v(t.showWelcomrAccess())}),a(1,"mat-icon"),p(2,"room_preferences"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"components.order-preview.welcomr.tooltip")))}function yg(i,r){if(i&1){let e=k();a(0,"button",44),b("click",function(){f(e);let t=m();return v(t.showSpartimeAccess())}),a(1,"mat-icon"),p(2,"room_preferences"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"components.order-preview.spartime.tooltip")))}function kg(i,r){if(i&1){let e=k();a(0,"button",44),b("click",function(){f(e);let t=m();return v(t.showInvoice())}),a(1,"mat-icon"),p(2,"picture_as_pdf"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}if(i&2){let e=m();o(4),w(u(5,1,(e.order==null||e.order.bookings==null?null:e.order.bookings.length)>0&&(!(e.order==null||e.order.bookings[0]==null)&&e.order.bookings[0].isMonthlyBooking)?"components.order-preview.menu.invoices.tooltip":"components.order-preview.menu.invoice.tooltip"))}}function wg(i,r){if(i&1){let e=k();a(0,"button",44),b("click",function(){f(e);let t=m();return v(t.cancel())}),a(1,"mat-icon"),p(2,"delete"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"components.order-preview.menu.cancel")))}function Sg(i,r){if(i&1){let e=k();a(0,"button",44),b("click",function(){f(e);let t=m();return v(t.stopSubscription())}),a(1,"mat-icon"),p(2,"delete"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"components.order-preview.menu.cancel")))}function Mg(i,r){if(i&1&&(a(0,"li"),x(1,"div",106),a(2,"div",107),p(3),l()()),i&2){let e=r.$implicit;o(),E("in-progress",e.status==="IN_PROGRESS")("ready",e.status==="READY"||e.status==="FINISHED"),o(2),Q("",e.service==null?null:e.service.title," (",e.quantity,")")}}function Ig(i,r){if(i&1&&(a(0,"ul",105),h(1,Mg,4,6,"li",58),l()),i&2){let e=m();o(),c("ngForOf",e.getServices())}}function Eg(i,r){if(i&1&&(a(0,"div")(1,"mat-icon"),p(2,"stay_primary_portrait"),l(),a(3,"a",109),p(4),l()()),i&2){let e=m(2);o(3),we("href","tel:"+(e.booking==null||e.booking.author==null?null:e.booking.author.phoneNumber),K),o(),w(e.booking==null||e.booking.author==null?null:e.booking.author.phoneNumber)}}function Pg(i,r){if(i&1&&(a(0,"div",108)(1,"div"),p(2),l(),h(3,Eg,5,2,"div",15),a(4,"div")(5,"mat-icon"),p(6,"email"),l(),a(7,"a",109),p(8),l()()()),i&2){let e=m();o(2),Q("",e.booking==null||e.booking.author==null?null:e.booking.author.firstname," ",e.booking==null||e.booking.author==null?null:e.booking.author.lastname,""),o(),c("ngIf",(e.booking==null||e.booking.author==null?null:e.booking.author.phoneNumber)!=null&&(e.booking==null||e.booking.author==null?null:e.booking.author.phoneNumber)!=""),o(4),we("href","mailto:"+(e.booking==null||e.booking.author==null?null:e.booking.author.email),K),o(),w(e.booking==null||e.booking.author==null?null:e.booking.author.email)}}function Tg(i,r){if(i&1){let e=k();a(0,"button",44),b("click",function(){f(e);let t=m();return v(t.acceptMeeting(!0))}),a(1,"mat-icon"),p(2,"videocam"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"components.booking-preview.meeting.status.confirmed_in_visio")))}function Dg(i,r){if(i&1){let e=k();a(0,"div",110)(1,"h5",111),p(2),d(3,"translate"),l()(),a(4,"app-sources",112),b("selectedSource",function(t){f(e);let s=m();return v(s.selectedSource(t))}),l(),a(5,"div",113)(6,"app-button",114),b("clicked",function(){let t=f(e).$implicit;return v(t.dismiss("dismiss"))}),l(),a(7,"app-button",115),b("clicked",function(t){let s=f(e).$implicit,_=m();return v(_.updateSource(s,t))}),l()()}if(i&2){let e=m();o(2),w(u(3,7,"pages.dashboard.orders_error.modal.title")),o(2),c("sources",e.api.user==null?null:e.api.user.sources)("types",X(9,Eh))("initialSource",e.initialSource)("selection",!0),o(2),c("dangerMode",!0),o(),c("isDisabled",!e.initialSource)}}var so=(()=>{class i{set orderContent(e){e&&(!this.order||e.updatedAt>=this.order.updatedAt)&&(this.order=e,this.initView())}constructor(e,n,t,s,_,C,I,B){this.api=e,this.utils=n,this.dialogService=t,this.modalService=s,this.router=_,this.toastr=C,this.translate=I,this.swalTargets=B,this.moment=_n.default,this.RRule=Il,this.UTCFormat="YYYY-MM-DD[T]HH:mm:ss.SSS[Z]",this.invitedEmail=null,this.shouldNotifyInvitations=!1,this.viewAsAdmin=!1,this.popoverShown=!1,this.servicesStatus="NOT_READY",this.hasEditRights=!1,this.hasCompanyRights=!1,this.guestLength=0,this.meetingInfo={display:!1,loading:!1,participants:[],userParticipation:null,nb_participants:0,nb_invited:0},this.showMore=!0,this.invoices=[],this.orderCancelled=new L,this.hasChanged=new L,this.titleWorkspace=new ue("",[W.maxLength(100)]),this.titleUpdated=!1,this.matMenuResponsive=!1}onResize(e){this.showMore=e.target.innerWidth>=768,this.matMenuResponsive=e.target.innerWidth<=768}ngOnInit(){this.showMore=window.innerWidth>=768,this.matMenuResponsive=window.innerWidth<=768,this.initView()}goToWorkspace(e){let n;this.api.companyEnvironment?n=this.translate.get("pages.company_environment.workspace.metadata.url").replace(":environmentId",this.api.companyEnvironment.url?this.api.companyEnvironment.url:this.api.companyEnvironment.id).replace(":url",e.url):n=this.translate.get("pages.app.workspace.metadata.url").replace(":url",e.url),this.router.navigate([n])}goToBuilding(e){let n;this.api.companyEnvironment?n=this.translate.get("pages.company_environment.building.metadata.url").replace(":environmentId",this.api.companyEnvironment.url?this.api.companyEnvironment.url:this.api.companyEnvironment.id).replace(":buildingId",e.id):n=this.translate.get("pages.user.environment.building.metadata.url").replace(":buildingId",e.id),this.router.navigate([n])}initView(){if(this.order!=null)if(this.api.user!=null&&(this.hasEditRights=(this.order.type==="BASKET"||this.order.type==="BOOKING")&&this.order.recipient?.user?.id===this.api.user?.id),this.api.company!=null&&(this.hasCompanyRights=this.order.company.id===this.api.company.id),this.order.bookings&&this.order.bookings.length>0){if(this.booking=this.order.bookings[0],!this.order.meetingInfo?.subject){let e=this.translate.get("components.order-preview.meeting.title")+this.booking.workspace.title;this.booking?.bookedSeats?.length>0&&(e+=" - "+this.booking?.bookedSeats[0].seat.fullname),this.titleWorkspace.setValue(e)}}else(this.order.services?.length??0)>0&&this.titleWorkspace.setValue(this.order.services.map(e=>e.service.title).join(", ")??"");this.refreshMeetingInfo(),this.guestLength=this.booking?.bookNextToInfo?.participants?.length??0,this.order&&this.order.building&&this.order.building.photo&&this.order.building.photo!==""&&(this.orderPhoto=this.order.building.photo),this.booking?.workspace?.photos?.length>0&&(this.orderPhoto=this.booking.workspace.photos[0]),this.order.services&&this.order.services.length>0&&(this.order.services.filter(e=>e.status!=="READY"&&e.status!=="FINISHED").length===0?this.servicesStatus="READY":this.order.services.filter(e=>e.status==="READY"||e.status==="FINISHED").length>0&&(this.servicesStatus="PART_READY"))}toggleShowMore(){this.showMore=!this.showMore}getPopover(e){return this.shouldNotifyInvitations&&!this.order?.workspace?.isShared&&!this.popoverShown&&(setTimeout(n=>{n.open()},500,e),setTimeout(n=>{n.close()},5500,e),this.popoverShown=!0),!1}showDetail(){let e=this.dialogService.open(Ol,{data:{viewAsAdmin:this.viewAsAdmin,unavailableMoment:(this.order.bookings?.length??0)>0?this.order.bookings[0]:null,order:this.order,hideOccurrencesDeletion:!0,onClose:()=>{e.close()},onSuccess:()=>{let n=(this.order.bookings?.length??0)>0,t=n?this.order.bookings[0].start:null;this.api.orderService.get(this.order.id,null,t).then(s=>{s.updatedAt=(0,_n.default)().format(this.api.format.UTC),this.order=s,n&&(this.booking=this.order.bookings[0]),this.initView()}),e.close()},cancelDeclaration:()=>{this.orderCancelled.emit(this.order),e.close()}}})}showQrCode(){this.dialogService.open(ip,{data:{qrCodeInformation:this.booking.qrCode}})}showInvoice(e=null){let n=!1;if(this.order.bookings.length>0){let t=this.order.bookings.filter(s=>s.isMonthlyBooking);if(t.length>0){this.dialogService.open(op,{data:{booking:t[0]}}),n=!0;return}}this.order.invoice&&!n&&window.open(ut.api+"/invoices/"+this.order.invoice.id+"/pdf?locale="+this.translate.getLang(),"_blank")}showSources(){let e=this.order.bookings.find(t=>t.isMonthlyBooking),n=(this.api?.user?.sources?.cards??[]).concat(this?.api.user.sources?.sepas??[]);this.initialSource=n.find(t=>t.id===e.paymentMethodId),this.modalService.open(this.sourceModal,{size:"lg",centered:!0})}selectedSource(e){this.initialSource=e}updateSource(e,n){return z(this,null,function*(){yield this.api.bookingService.updatePaymentMethod(this.order.bookings[0].id,this.initialSource,n?.button),this.booking&&(this.booking.paymentMethod=this.initialSource.type?.toUpperCase(),this.booking.paymentMethodId=this.initialSource.id),this.order.bookings?.length>0&&(this.order.bookings[0].paymentMethod=this.initialSource.type?.toUpperCase(),this.order.bookings[0].paymentMethodId=this.initialSource.id),e?.close(),this.toastr.success(this.translate.get("components.order-preview.toastr.update-source.success"))})}showMeeting(){let e=this.dialogService.open(sp,{data:{booking:this.booking,environment:this.api.companyEnvironment,onSuccess:()=>{e.close()}}});e.afterClosed().subscribe(()=>{this.api.orderService.getMeetingInfo(this.order.id,this.invitedEmail).then(n=>{this.order.meetingInfo=n,this.booking&&(this.booking.meetingInfo=n),this.refreshMeetingInfo()}).catch(n=>{n.error=="ORDER_UNAUTHORIZED"&&this.toastr.error(this.translate.get("pages.user.profile.notifications.categories.order.list.toastr.order_unauthorized"))})})}refreshMeetingInfo(){this.meetingInfo.nb_invited=0,this.meetingInfo.nb_participants=0,this.meetingInfo.userParticipation=null,this.order!=null&&this.order.meetingInfo&&(this.meetingInfo=Object.assign(this.meetingInfo,this.order.meetingInfo),this.meetingInfo?.subject&&this.titleWorkspace.setValue(this.meetingInfo?.subject),this.meetingInfo.participants.forEach(e=>{(e.email===this.api.user?.email||e.email===this.invitedEmail)&&(this.meetingInfo.display=!0,this.meetingInfo.userParticipation=e.status),(e.status==="CONFIRMED"||e.status==="CONFIRMED_IN_VISIO")&&this.meetingInfo.nb_participants++,this.meetingInfo.nb_invited++}),!this.meetingInfo.display&&this.api.user&&this.api.user.id===this.booking.author.id&&(this.meetingInfo.display=!0),this.hasCompanyRights&&!this.meetingInfo?.subject&&(this.titleWorkspace.setValue(this.order?.recipient?.firstname+" "+this.order?.recipient?.lastname),this.meetingInfo.subject=this.titleWorkspace.value,this.meetingInfo.display=this.meetingInfo.nb_invited>0),this.meetingInfo.display&&(this.meetingInfo.display=this.meetingInfo.display&&!this.order.workspace.isShared))}acceptMeeting(e=!1){this.meetingInfo.loading=!0,this.api.bookingService.acceptInvite(this.booking.id,e,this.invitedEmail).then(n=>{this.booking=n,this.order.meetingInfo=n.meetingInfo,this.refreshMeetingInfo(),this.meetingInfo.loading=!1})}checkin(){this.api.bookingService.checkin(this.booking.id,Ml.WEB).then(e=>{this.booking=e,this.toastr.success(this.translate.get("components.order-preview.toastr.checkin"))})}checkout(){hn.default.fire({icon:"warning",title:this.translate.get("components.order-preview.swal.checkout.title"),text:this.translate.get("components.order-preview.swal.checkout.text"),confirmButtonText:this.translate.get("components.order-preview.swal.checkout.confirm"),cancelButtonText:this.translate.get("global.back"),showCancelButton:!0,showCloseButton:!0,focusCancel:!0}).then(e=>{e.value&&this.api.bookingService.checkout(this.booking.id).then(()=>{this.toastr.success(this.translate.get("components.order-preview.toastr.checkout")),this.orderCancelled.emit(this.order)})})}declineMeeting(){this.meetingInfo.loading=!0,this.api.bookingService.declineInvite(this.booking.id,this.invitedEmail).then(e=>{this.booking=e,this.order.meetingInfo=e.meetingInfo,this.refreshMeetingInfo(),this.meetingInfo.loading=!1})}getServices(){let e=[];return this.order?.services&&this.order.services.forEach(n=>{let t=e.findIndex(s=>s.service.id===n.service.id&&s.status===n.status);t>-1?e[t].quantity+=n.quantity:e.push(Object.assign({},n))}),e}confirmBooking(e){hn.default.fire({icon:"question",title:this.translate.get("bookings.confirm.title_accept"),text:this.translate.get("bookings.confirm.text_accept"),confirmButtonText:this.translate.get("global.confirm_validation"),cancelButtonText:this.translate.get("global.back"),showCancelButton:!0,showCloseButton:!0,focusCancel:!0}).then(n=>{n.value&&this.api.bookingService.confirm(this.booking.id,e?.button).then(t=>{this.toastr.success(this.translate.get("components.booking-preview.toastr.confirm.ok")),this.booking=t,this.order.bookings[this.order.bookings.findIndex(s=>t.id==s.id)]=t,this.hasChanged.emit()}).catch(()=>{this.toastr.error(this.translate.get("components.booking-preview.toastr.confirm.ko"))})})}refuseBooking(e){hn.default.fire({icon:"question",title:this.translate.get("bookings.confirm.title_refuse"),html:"<p>"+this.translate.get("bookings.confirm.text_refuse")+'</p><input id="reason" class="swal2-input reason" type="text" placeholder="'+this.translate.get("bookings.confirm.reason")+'"/>',confirmButtonText:this.translate.get("global.confirm_rejection"),cancelButtonText:this.translate.get("global.back"),showCancelButton:!0,showCloseButton:!0,focusCancel:!0,reverseButtons:!0}).then(n=>{if(n.value){let t=document.getElementById("reason").value;this.api.bookingService.refuse(this.booking.id,t,e?.button).then(()=>{this.toastr.success(this.translate.get("components.booking-preview.toastr.refuse.ok")),this.hasChanged.emit()}).catch(()=>{this.toastr.error(this.translate.get("components.booking-preview.toastr.refuse.ko"))})}})}bookServices(e){this.order&&this.order.building&&(localStorage.setItem("bookForBuilding",JSON.stringify(!0)),localStorage.setItem("building",JSON.stringify(this.order.building)));let n;this.api.companyEnvironment?n=this.translate.get("pages.company_environment.building.metadata.url").replace(":environmentId",this.api.companyEnvironment.url?this.api.companyEnvironment.url:this.api.companyEnvironment.id).replace(":buildingId",e.id):n=this.translate.get("pages.user.environment.building.metadata.url").replace(":buildingId",e.id),this.router.navigate([n])}editMeeting(){this.showMeeting()}cancel(e){this.api.orderService.estimateCancel(this.order.id).then(n=>{let t=n.price,s="";this.order?.bookings[0]?.rrule?s+=this.translate.get("components.order-preview.swal.cancel.text_recurrence"):s+=this.translate.get("components.order-preview.swal.cancel.text"),t!==null&&t>0&&(s+=this.translate.get("components.order-preview.swal.cancel.text_price").replace(":cost",(t/100).toFixed(2))),this.order?.transactions[0]?.method=="QUOTA"?this.api.orderService.quotaExists(this.order?.transactions[0]?.paymentMethodId).then(_=>{_?this.cancelNext(s,e?.button):this.cancelNext(this.translate.get("dashboard.bookings.delete_message_text_quota"),e?.button)}):this.cancelNext(s,e?.button)}).catch(n=>{n.error=="ORDER_IS_ALREADY_CANCELLED"&&this.toastr.error(this.translate.get("components.order-preview.toastr.cancel.ko_already_cancelled"))})}cancelNext(e,n){hn.default.fire({icon:"warning",title:this.translate.get("components.order-preview.swal.cancel.title"),text:e,confirmButtonText:this.translate.get("components.order-preview.swal.cancel.confirm"),cancelButtonText:this.translate.get("global.back"),showCancelButton:!0,showCloseButton:!0,focusCancel:!0}).then(t=>{t.value&&this.api.orderService.cancel(this.order.id,n).then(()=>{this.order?.bookings[0]?.rrule?this.toastr.success(this.translate.get("components.order-preview.toastr.cancel.ok_recurrence")):this.toastr.success(this.translate.get("components.order-preview.toastr.cancel.ok")),this.orderCancelled.emit(this.order)}).catch(s=>{s.error=="ORDER_IS_ALREADY_CANCELLED"?this.toastr.error(this.translate.get("components.order-preview.toastr.cancel.ko_already_cancelled")):this.toastr.error(this.translate.get("components.order-preview.toastr.cancel.ko"))})})}stopSubscription(e){this.api.orderService.estimateCancel(this.order.id,e?.button).then(n=>{let t=this.translate.get("bookings.stop_sub.text"),s=(0,_n.default)();n.endDate!==null&&(s=(0,_n.default)(n.endDate)),t=t.replace(":date",s.format("L")),hn.default.fire({icon:"warning",title:this.translate.get("bookings.stop_sub.title"),text:t,confirmButtonText:this.translate.get("global.confirm"),cancelButtonText:this.translate.get("global.back"),showCancelButton:!0,focusCancel:!0}).then(_=>{_&&_.value&&this.api.bookingService.cancel(this.order.bookings[0].id,e?.button).then(()=>{this.toastr.success(this.translate.get("components.booking-preview.toastr.cancel.ok")),this.order.bookings[0].end=s.format(this.UTCFormat),this.order.endDate=s.format(this.UTCFormat)}).catch(()=>{this.toastr.error(this.translate.get("components.booking-preview.toastr.cancel.ko"))})})}).catch(n=>{n.error=="ORDER_IS_ALREADY_CANCELLED"?this.toastr.error(this.translate.get("components.booking-preview.toastr.cancel.ko_order_already_cancelled")):this.toastr.error(this.translate.get("components.booking-preview.toastr.cancel.ko"))})}showWelcomrAccess(){this.dialogService.open(cp,{data:{order:this.order,email:this.invitedEmail}})}showIgloohomeAccess(e){return z(this,null,function*(){this.dialogService.open(pp,{data:{bookingOverview:{bookingId:this.order.bookings[0].id,bookingStart:this.order.bookings[0].start,bookingEnd:this.order.bookings[0].end,timezone:this.order.bookings[0].timezone,workspaceName:this.order.bookings[0].workspace.title}}})})}showSpartimeAccess(){let e=this.modalService.open(lp,{size:"md"});e.componentInstance.order=this.order,e.componentInstance.onClose=()=>{e.close()}}onEnterTitle(){if(this.hasEditRights&&this.titleWorkspace.value){let e="";this.booking.workspace.type==="meeting_room"?e=this.translate.get("components.order-preview.meeting.title.untitled"):e=this.translate.get("components.order-preview.meeting.title"+this.booking.workspace.title),this.meetingInfo.subject!==this.titleWorkspace.value.trim()&&this.titleWorkspace.value.trim()!==e&&(this.meetingInfo.subject=this.titleWorkspace.value.trim(),this.api.bookingService.invite(this.booking.id,this.meetingInfo).then(n=>{this.booking.meetingInfo=n,this.order.meetingInfo=n,this.refreshMeetingInfo(),this.toastr.success(this.translate.get("components.booking-preview.toastr.title.ok"))}).catch(()=>{this.toastr.error(this.translate.get("components.booking-preview.toastr.title.ko"))}))}}isSeveralDays(){return this.order?.endDate?(0,_n.default)(this.order?.startDate).format("YYYY-MM-DD")!==(0,_n.default)(this.order?.endDate).add(-1,"minutes").format("YYYY-MM-DD"):!1}inviteBookNextTo(){let e=this.dialogService.open(ap,{data:{booking:this.booking,order:this.order}});e.componentInstance.participantsLength.subscribe(n=>{this.guestLength=n}),e.afterClosed().subscribe(()=>{this.api.bookingService.getById(this.booking.id).then(n=>{this.booking=n,this.order.bookings[0]=this.booking,this.guestLength=this.booking?.bookNextToInfo?.participants?.length})})}showRruleOccurences(){let e=this.modalService.open(Bl,{size:"md",centered:!0,scrollable:!0});e.componentInstance.booking=this.booking,e.componentInstance.onClose=()=>{e.close()},e.componentInstance.onSuccess=()=>{e.close()},e.componentInstance.updateBookings=()=>{this.orderCancelled.emit(this.order),e.close()}}canCancelBooking(){let e=this.userIsAuthorizedToEditBooking(),n=this.canCancelOrder();return e&&(this.order?.bookings.length>0&&n||this.canCancelOrderWhenOnlyBookedServices())}userIsAuthorizedToEditBooking(){return this.hasCompanyRights||this.hasEditRights||this.order?.author.id===this.api.user?.id}canCancelOrder(){let e=this.order.amount==0&&(!this.order?.bookings[0]?.isMonthlyBooking||this.order?.bookings[0]?.isMonthlyBooking&&this.order?.step==="WAITING"),n=this.order.amount>0&&this.order?.step==="WAITING";return e||n}canCancelOrderWhenOnlyBookedServices(){let e=["CANCELLED","IN_PROGRESS","READY","FINISHED"];return this.order?.bookings.length==0&&this.order?.services.length>0&&!this.order?.services.some(n=>n?.service?.requiresPreparation===!0&&e.includes(n.status))}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(_e),y(Nn),y(Ue),y(mt),y(Ce),y(U),y(jl))}}static{this.\u0275cmp=P({type:i,selectors:[["app-order-preview"]],viewQuery:function(n,t){if(n&1&&A(Mh,5),n&2){let s;D(s=O())&&(t.sourceModal=s.first)}},hostBindings:function(n,t){n&1&&b("resize",function(_){return t.onResize(_)},!1,vs)},inputs:{orderContent:[0,"order","orderContent"],invitedEmail:"invitedEmail",shouldNotifyInvitations:"shouldNotifyInvitations",viewAsAdmin:"viewAsAdmin"},outputs:{orderCancelled:"orderCancelled",hasChanged:"hasChanged"},decls:73,vars:59,consts:[["menu","matMenu"],["popServices",""],["popContactInfo",""],["menuMeeting","matMenu"],["sourceModal",""],["inputTitle",""],["pops","ngbPopover"],["p1","ngbPopover"],[1,"booking-resume"],[1,"workspace-photo"],[1,"container-img-workspace","position-relative"],[1,"img-container"],["alt","workspace photo template",1,"img-cover",3,"src"],["iconName","more_vert","tooltipText","components.order-preview.menu.edit.tooltip","class","more-options-button",3,"matMenuTriggerFor",4,"ngIf"],[1,"booking-middle"],[4,"ngIf"],[1,"booking-informations"],[1,"grid-row"],[1,"dates"],[1,"d-flex","align-items-start"],["iconName","schedule",1,"margin-top-icon"],[3,"start","end","timezone","withPeriods","days","period","withRecurringInfo","recurrence"],["class","booking-workspace",4,"ngIf"],["class","d-flex align-items-start workspace-informations",4,"ngIf"],[1,"expandable-booking-extras"],["class","services",4,"ngIf"],["class","meeting max-width-100",4,"ngIf"],["class","max-width-100",4,"ngIf"],["class","expandable-booking-extras book-next-to-container",4,"ngIf"],["class","d-md-none",4,"ngIf"],[1,"booking-actions"],["iconName","check","tooltipText","components.order-preview.menu.checkin","tooltipPosition","right",3,"clicked",4,"ngIf"],["iconName","timer_off","tooltipText","components.order-preview.menu.checkout","tooltipPosition","right",3,"clicked",4,"ngIf"],["iconName","find_in_page","tooltipText","components.order-preview.menu.detail.tooltip","tooltipPosition","right",3,"clicked"],["iconName","update","tooltipText","recurring.see_occurrences","tooltipPosition","right",3,"clicked",4,"ngIf"],["iconName","room_preferences","tooltipText","components.order-preview.welcomr.tooltip","tooltipPosition","right",3,"clicked",4,"ngIf"],["iconName","key_vertical","tooltipText","components.order-preview.igloohome.tooltip","tooltipPosition","right",3,"clicked",4,"ngIf"],["iconName","room_preferences","tooltipText","components.order-preview.spartime.tooltip","tooltipPosition","right",3,"clicked",4,"ngIf"],["iconName","pdf","tooltipPosition","right",3,"customIcon","tooltipText","clicked",4,"ngIf"],["iconName","payment","tooltipText","components.order-preview.menu.update_payment.tooltip","tooltipPosition","right",3,"clicked",4,"ngIf"],["iconName","delete","tooltipText","components.order-preview.menu.cancel","tooltipPosition","right",3,"clicked",4,"ngIf"],["iconName","delete","tooltipText","components.order-preview.menu.stop_subscription","tooltipPosition","right",3,"clicked",4,"ngIf"],[1,"reference"],["type","button","mat-menu-item","",3,"click",4,"ngIf"],["type","button","mat-menu-item","",3,"click"],["iconName","more_vert","tooltipText","components.order-preview.menu.edit.tooltip",1,"more-options-button",3,"matMenuTriggerFor"],[1,"w-100","mb-2"],["matInput","","type","text","maxlength","100",1,"input-title-primary",3,"keyup.enter","blur","placeholder","formControl","readonly","cdkTrapFocus","cdkTrapFocusAutoCapture"],[1,"text-truncate"],[1,"booking-workspace"],["iconName","place",1,"margin-top-icon"],[1,"max-width-100"],[1,"workspace-text"],[1,"link-workspace","text-nowrap","text-ellipsis",3,"click","matTooltip"],[3,"start","end","period","workspace","building","placeId",4,"ngIf"],["textKey","Afficher le QR code","type","TERTIARY",3,"noActiveBorders","paddingX","paddingY","clicked",4,"ngIf"],[3,"start","end","period","workspace","building","placeId"],[1,"seats"],[4,"ngFor","ngForOf"],["class","d-inline-block","type","TERTIARY","textKey","components.order-preview.seats_show_more",3,"clicked",4,"ngIf"],["type","TERTIARY","textKey","components.order-preview.seats_show_more",1,"d-inline-block",3,"clicked"],[1,"seat","d-flex"],["textKey","Afficher le QR code","type","TERTIARY",3,"clicked","noActiveBorders","paddingX","paddingY"],[1,"d-flex","align-items-start","workspace-informations"],[1,"booking-infos","ml-8"],[1,"services"],["iconName","services",1,"margin-top-icon"],["iconName","eye","placement","bottom","container","body",1,"ml-8",3,"autoClose","ngbPopover"],[1,"meeting","max-width-100"],[1,"participants"],["iconName","groups",1,"margin-top-icon"],[1,"ml-8"],[1,"contact","max-width-100"],["textKey","components.order-preview.meeting.show_participants","type","TERTIARY",3,"noActiveBorders","paddingX","paddingY","clicked",4,"ngIf"],["textKey","components.order-preview.menu.edit_meeting","type","TERTIARY","container","body","placement","bottom","triggers","manual","popoverClass","popover-shadow",3,"noActiveBorders","paddingX","paddingY","ngbPopover","clicked",4,"ngIf"],["textKey","components.order-preview.meeting.manage_participants","type","TERTIARY",3,"paddingX","paddingY","noActiveBorders","clicked",4,"ngIf"],["textKey","components.order-preview.meeting.show_participants","type","TERTIARY",3,"clicked","noActiveBorders","paddingX","paddingY"],["textKey","components.order-preview.menu.edit_meeting","type","TERTIARY","container","body","placement","bottom","triggers","manual","popoverClass","popover-shadow",3,"clicked","noActiveBorders","paddingX","paddingY","ngbPopover"],["textKey","components.order-preview.meeting.manage_participants","type","TERTIARY",3,"clicked","paddingX","paddingY","noActiveBorders"],[3,"matMenuTriggerFor","selectable","disabled",4,"ngIf"],[3,"matMenuTriggerFor","selectable","disabled"],["matChipAvatar","",4,"ngIf"],["matChipTrailingIcon","",1,"c-pointer"],["matChipAvatar",""],["iconName","check","textKey","components.user.infopop.reservationValidation","type","SECONDARY",1,"mb-2",3,"clicked","isGreen","littleButton","littleFont"],["iconName","close","textKey","components.user.infopop.reservationCancel","type","SECONDARY",1,"mb-2",3,"clicked","dangerMode","littleButton","littleFont"],[1,"expandable-booking-extras","book-next-to-container"],["class","book-next-to-invitations max-width-100",4,"ngIf"],["textKey","components.order-preview.book-next-to.invite","type","TERTIARY",3,"clicked","noActiveBorders","paddingX","paddingY"],[1,"book-next-to-invitations","max-width-100"],["type","TERTIARY",3,"textKey","noActiveBorders","paddingX","paddingY","clicked",4,"ngIf"],["type","TERTIARY",3,"clicked","textKey","noActiveBorders","paddingX","paddingY"],[1,"d-md-none"],["type","button",1,"show",3,"click"],[3,"inline"],["iconName","check","tooltipText","components.order-preview.menu.checkin","tooltipPosition","right",3,"clicked"],["iconName","timer_off","tooltipText","components.order-preview.menu.checkout","tooltipPosition","right",3,"clicked"],["iconName","update","tooltipText","recurring.see_occurrences","tooltipPosition","right",3,"clicked"],["iconName","room_preferences","tooltipText","components.order-preview.welcomr.tooltip","tooltipPosition","right",3,"clicked"],["iconName","key_vertical","tooltipText","components.order-preview.igloohome.tooltip","tooltipPosition","right",3,"clicked"],["iconName","room_preferences","tooltipText","components.order-preview.spartime.tooltip","tooltipPosition","right",3,"clicked"],["iconName","pdf","tooltipPosition","right",3,"clicked","customIcon","tooltipText"],["iconName","payment","tooltipText","components.order-preview.menu.update_payment.tooltip","tooltipPosition","right",3,"clicked"],["iconName","delete","tooltipText","components.order-preview.menu.cancel","tooltipPosition","right",3,"clicked"],["iconName","delete","tooltipText","components.order-preview.menu.stop_subscription","tooltipPosition","right",3,"clicked"],[1,"list-unstyled","mb-0"],[1,"pin","d-inline-block","me-2"],[1,"d-inline-block"],[1,"contact"],["target","_blank","rel","noopener",3,"href"],[1,"modal-header"],[1,"modal-title"],[3,"selectedSource","sources","types","initialSource","selection"],[1,"modal-footer"],["textKey","global.back","type","SECONDARY",1,"mx-2",3,"clicked","dangerMode"],["textKey","global.confirm","type","PRIMARY",1,"mx-2",3,"clicked","isDisabled"]],template:function(n,t){if(n&1){let s=k();a(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11),x(4,"img",12),d(5,"imageTransform"),l(),h(6,Ph,1,1,"app-button-action",13),l()(),a(7,"div",14),h(8,Th,8,10,"div",15)(9,Dh,3,1,"div",15),a(10,"div",16)(11,"div",17)(12,"div",18)(13,"div",19),x(14,"app-icon",20)(15,"app-booking-dates",21),l()(),h(16,Lh,9,5,"div",22)(17,qh,5,1,"div",23),l(),a(18,"div",17)(19,"div",24),h(20,zh,5,2,"div",25)(21,Yh,10,9,"div",26),l(),h(22,Jh,2,1,"div",26)(23,Zh,3,6,"div",27)(24,ng,3,3,"div",28),l()(),h(25,ag,4,2,"div",29),l(),a(26,"div",30),h(27,sg,1,0,"app-button-action",31)(28,lg,1,0,"app-button-action",32),a(29,"app-button-action",33),b("clicked",function(){return f(s),v(t.showDetail())}),l(),h(30,cg,1,0,"app-button-action",34)(31,pg,1,0,"app-button-action",35)(32,dg,1,0,"app-button-action",36)(33,mg,1,0,"app-button-action",37)(34,ug,1,2,"app-button-action",38)(35,_g,1,0,"app-button-action",39)(36,hg,1,0,"app-button-action",40)(37,gg,1,0,"app-button-action",41),a(38,"p",42),p(39),l()()(),a(40,"mat-menu",null,0),h(42,fg,6,3,"button",43)(43,vg,6,3,"button",43)(44,bg,6,3,"button",43)(45,Cg,6,3,"button",43)(46,xg,6,3,"button",43)(47,yg,6,3,"button",43)(48,kg,6,3,"button",43)(49,wg,6,3,"button",43)(50,Sg,6,3,"button",43),l(),h(51,Ig,2,1,"ng-template",null,1,ne)(53,Pg,9,5,"ng-template",null,2,ne),a(55,"mat-menu",null,3)(57,"button",44),b("click",function(){return f(s),v(t.acceptMeeting(!1))}),a(58,"mat-icon"),p(59,"check"),l(),a(60,"span"),p(61),d(62,"translate"),l()(),h(63,Tg,6,3,"button",43),x(64,"mat-divider"),a(65,"button",44),b("click",function(){return f(s),v(t.declineMeeting())}),a(66,"mat-icon"),p(67,"close"),l(),a(68,"span"),p(69),d(70,"translate"),l()()(),h(71,Dg,8,10,"ng-template",null,4,ne)}if(n&2){let s;o(4),c("src",T(5,46,t.orderPhoto||"/assets/images/booking-workspace.png",X(53,Ih)),K),o(2),c("ngIf",t.matMenuResponsive&&(t.hasEditRights||t.hasCompanyRights&&(t.order==null?null:t.order.step)=="WAITING")),o(2),c("ngIf",t.booking==null?null:t.booking.workspace),o(),c("ngIf",!(t.booking!=null&&t.booking.workspace)),o(6),c("start",!(t.order==null||t.order.bookings[0]==null)&&t.order.bookings[0].start?t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].start:t.order==null?null:t.order.startDate)("end",!(t.order==null||t.order.bookings[0]==null)&&t.order.bookings[0].end?t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].end:t.order==null?null:t.order.endDate)("timezone",!(t.order==null||t.order.bookings[0]==null||t.order.bookings[0].workspace==null)&&t.order.bookings[0].workspace.timezone?t.order==null||t.order.bookings[0]==null||t.order.bookings[0].workspace==null?null:t.order.bookings[0].workspace.timezone:t.order==null?null:t.order.timezone)("withPeriods",(t.order==null||t.order.bookings[0]==null||t.order.bookings[0].days==null?null:t.order.bookings[0].days.length)>0||(t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].period))("days",t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].days)("period",t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].period)("withRecurringInfo",(t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].rrule)!==null)("recurrence",t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].rrule),o(),c("ngIf",t.order==null?null:t.order.workspace),o(),c("ngIf",!(t.order!=null&&t.order.workspace)),o(),E("grid-no-gap",!t.showMore),o(),c("@detailExpand",t.showMore?"expanded":"collapsed"),o(),c("ngIf",(t.order==null||t.order.author==null?null:t.order.author.id)===(t.api.user==null?null:t.api.user.id)),o(),c("ngIf",(t.meetingInfo==null?null:t.meetingInfo.display)&&(t.order==null||t.order.author==null?null:t.order.author.id)===(t.api.user==null?null:t.api.user.id)&&t.booking.workspace.type!=="desktop"),o(),c("ngIf",(t.meetingInfo==null?null:t.meetingInfo.display)&&t.booking.workspace.type!=="desktop"),o(),c("ngIf",t.hasCompanyRights&&(t.booking==null?null:t.booking.status)==="WAITING"&&(t.utils.isAdmin(t.booking==null?null:t.booking.company)||t.utils.isWorkspaceManager(t.booking==null?null:t.booking.workspace)||t.utils.isOfficeManager(t.booking==null||t.booking.workspace==null?null:t.booking.workspace.building))),o(),c("ngIf",(t.api==null||t.api.user==null?null:t.api.user.id)===(t.booking==null||t.booking.author==null?null:t.booking.author.id)&&(t.order==null||t.order.workspace==null?null:t.order.workspace.isShared)&&!(t.booking!=null&&t.booking.isMonthlyBooking)),o(),c("ngIf",(t.api==null||t.api.user==null?null:t.api.user.id)===(t.booking==null||t.booking.author==null?null:t.booking.author.id)),o(2),c("ngIf",t.booking&&(t.booking==null||t.booking.workspace==null||t.booking.workspace.company==null||t.booking.workspace.company.parameters==null?null:t.booking.workspace.company.parameters.activateCheckin)&&!(t.booking!=null&&t.booking.checkInDone)&&!(t.booking!=null&&t.booking.rrule)&&t.moment.tz(t.moment(t.booking==null?null:t.booking.start),t.booking==null||t.booking.workspace==null?null:t.booking.workspace.timezone).diff(t.moment.tz(t.moment(),t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone),"minutes")<=30&&t.moment.tz(t.moment(),t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone)<t.moment.tz(t.moment(t.booking==null?null:t.booking.end),t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone)),o(),c("ngIf",(t.order==null?null:t.order.step)==="IN_PROGRESS"&&(t.hasEditRights||t.hasCompanyRights)&&!(!(t.order==null||t.order.bookings[0]==null)&&t.order.bookings[0].isMonthlyBooking)&&!(t.booking!=null&&t.booking.rrule)&&(t.order==null||t.order.bookings==null?null:t.order.bookings.length)>0),o(2),c("ngIf",t.booking==null?null:t.booking.rrule),o(),c("ngIf",(t.meetingInfo==null?null:t.meetingInfo.userParticipation)==="CONFIRMED"&&(t.order==null?null:t.order.step)!=="FINISHED"&&X(54,Po).includes(t.order==null?null:t.order.status)&&(t.booking==null||t.booking.workspace==null?null:t.booking.workspace.hasWelcomr)&&t.moment.tz(t.moment(t.booking==null?null:t.booking.start),t.booking==null||t.booking.workspace==null?null:t.booking.workspace.timezone).diff(t.moment.tz(t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone),"minutes")<=60&&t.moment.tz(t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone)<t.moment.tz(t.moment(t.booking==null?null:t.booking.end),t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone)),o(),c("ngIf",(t.meetingInfo==null?null:t.meetingInfo.userParticipation)==="CONFIRMED"&&(t.order==null?null:t.order.step)!=="FINISHED"&&X(55,Po).includes(t.order==null?null:t.order.status)&&(t.booking==null||t.booking.workspace==null?null:t.booking.workspace.hasIgloohome)&&((s=t.booking==null?null:t.booking.hasIgloohomeAccess)!==null&&s!==void 0?s:!1)&&t.moment.tz(t.moment(t.booking==null?null:t.booking.start),t.booking==null||t.booking.workspace==null?null:t.booking.workspace.timezone).diff(t.moment.tz(t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone),"minutes")<=60&&t.moment.tz(t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone)<t.moment.tz(t.moment(t.booking==null?null:t.booking.end),t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone)),o(),c("ngIf",(t.hasEditRights||t.invitedEmail)&&(t.meetingInfo==null?null:t.meetingInfo.userParticipation)==="CONFIRMED"&&(t.order==null?null:t.order.step)!=="FINISHED"&&X(56,Po).includes(t.order==null?null:t.order.status)&&(t.booking==null||t.booking.workspace==null?null:t.booking.workspace.hasSpartime)&&(t.booking==null||t.booking.spartimeEvents==null?null:t.booking.spartimeEvents.length)>0),o(),c("ngIf",(t.hasEditRights||t.hasCompanyRights)&&((t.order==null?null:t.order.invoice)!=null||(t.order==null||t.order.bookings==null?null:t.order.bookings.length)>0&&(t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].isMonthlyBooking))),o(),c("ngIf",(t.hasEditRights||t.hasCompanyRights)&&(t.order==null||t.order.bookings==null?null:t.order.bookings.length)>0&&(t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].isMonthlyBooking)),o(),c("ngIf",t.canCancelBooking()),o(),c("ngIf",(t.hasEditRights||t.hasCompanyRights)&&(t.order==null?null:t.order.step)==="IN_PROGRESS"&&(t.order==null||t.order.bookings==null?null:t.order.bookings.length)>0&&(t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].isMonthlyBooking)&&!(t.order!=null&&t.order.bookings[0].end)),o(2),g(" ",t.order==null?null:t.order.reference," "),o(3),c("ngIf",t.booking&&(t.booking==null||t.booking.workspace==null||t.booking.workspace.company==null||t.booking.workspace.company.parameters==null?null:t.booking.workspace.company.parameters.activateCheckin)&&!(t.booking!=null&&t.booking.checkInDone)&&!(t.booking!=null&&t.booking.rrule)&&t.moment.tz(t.moment(t.booking==null?null:t.booking.start),t.booking==null||t.booking.workspace==null?null:t.booking.workspace.timezone).diff(t.moment.tz(t.moment(),t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone),"minutes")<=30&&t.moment.tz(t.moment(),t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone)<t.moment.tz(t.moment(t.booking==null?null:t.booking.end),t.booking==null||t.booking.workpace==null?null:t.booking.workpace.timezone)),o(),c("ngIf",(t.order==null?null:t.order.step)==="IN_PROGRESS"&&(t.hasEditRights||t.hasCompanyRights)&&!(!(t.order==null||t.order.bookings[0]==null)&&t.order.bookings[0].isMonthlyBooking)&&!(t.booking!=null&&t.booking.rrule)),o(),c("ngIf",t.matMenuResponsive),o(),c("ngIf",t.booking==null?null:t.booking.rrule),o(),c("ngIf",t.matMenuResponsive&&(t.hasEditRights||t.invitedEmail)&&(t.meetingInfo==null?null:t.meetingInfo.userParticipation)==="CONFIRMED"&&(t.order==null?null:t.order.step)!=="FINISHED"&&X(57,Po).includes(t.order==null?null:t.order.status)&&(t.booking==null||t.booking.workspace==null?null:t.booking.workspace.hasWelcomr)),o(),c("ngIf",(t.hasEditRights||t.invitedEmail)&&(t.meetingInfo==null?null:t.meetingInfo.userParticipation)==="CONFIRMED"&&(t.order==null?null:t.order.step)!=="FINISHED"&&X(58,Po).includes(t.order==null?null:t.order.status)&&(t.booking==null||t.booking.workspace==null?null:t.booking.workspace.hasSpartime)&&(t.booking==null||t.booking.spartimeEvents==null?null:t.booking.spartimeEvents.length)>0),o(),c("ngIf",t.matMenuResponsive&&(t.hasEditRights||t.hasCompanyRights)&&((t.order==null?null:t.order.invoice)!=null||(t.order==null||t.order.bookings==null?null:t.order.bookings.length)>0&&(t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].isMonthlyBooking))),o(),c("ngIf",t.canCancelBooking()),o(),c("ngIf",(t.hasEditRights||t.hasCompanyRights)&&(t.order==null?null:t.order.step)==="IN_PROGRESS"&&(t.order==null||t.order.bookings==null?null:t.order.bookings.length)>0&&(t.order==null||t.order.bookings[0]==null?null:t.order.bookings[0].isMonthlyBooking)&&!(t.order!=null&&t.order.bookings[0].end)),o(11),w(u(62,49,"components.booking-preview.meeting.status.confirmed")),o(2),c("ngIf",t.booking==null||t.booking.meetingInfo==null?null:t.booking.meetingInfo.authorizeVisio),o(6),w(u(70,51,"components.booking-preview.meeting.status.declined"))}},dependencies:[j,R,Qi,Kt,Gt,It,Te,$,dt,ae,rt,ve,Et,fe,ee,ho,Be,Us,Al,Dl,H,ni,tt,sl,dl,ll,kt,Is,N,ri],styles:["p[_ngcontent-%COMP%]{margin:0}h5[_ngcontent-%COMP%]{font-size:18px;color:var(--primary-color-600);font-weight:400}h5.c-pointer[_ngcontent-%COMP%]{cursor:pointer}h5[_ngcontent-%COMP%]:hover{text-decoration:none}.pin[_ngcontent-%COMP%]{position:relative;top:-2px;width:5px;height:5px;border-radius:50%;background-color:var(--primary-color-500)}.pin.in-progress[_ngcontent-%COMP%]{background-color:#ffaf79}.pin.ready[_ngcontent-%COMP%]{background-color:var(--primary-color-600)}[_nghost-%COMP%]     .booking-resume{padding:16px 0;display:grid;grid-template-columns:150px 1fr 55px;gap:24px}[_nghost-%COMP%]     .booking-resume .ml-8{margin-left:8px}[_nghost-%COMP%]     .booking-resume .container-img-workspace .img-container{border-radius:8px;overflow:hidden;width:150px;height:150px}[_nghost-%COMP%]     .booking-resume .container-img-workspace .more-options-button{display:none;position:absolute;top:10px;right:10px;z-index:2}[_nghost-%COMP%]     .booking-resume .container-img-workspace .more-options-button .button-action.circle{border:none}[_nghost-%COMP%]     .booking-resume .booking-middle{display:grid}[_nghost-%COMP%]     .booking-resume .booking-middle div:first-child{max-width:400px}[_nghost-%COMP%]     .booking-resume .booking-middle div:first-child .input-title-primary{font-size:18px!important}[_nghost-%COMP%]     .booking-resume .booking-middle div:first-child .mat-mdc-form-field-appearance-legacy.mat-mdc-form-field-can-float.mat-mdc-form-field-should-float .mat-mdc-form-field-label{display:none}[_nghost-%COMP%]     .booking-resume .booking-middle div:first-child .mat-mdc-form-field-infix{border-top:0}[_nghost-%COMP%]     .booking-resume .booking-middle div:first-child .mat-mdc-form-field-appearance-legacy .mat-mdc-form-field-underline{background-color:var(--primary-color-600);height:0;margin-bottom:-18px}[_nghost-%COMP%]     .booking-resume .booking-middle div:first-child .mat-mdc-form-field-appearance-legacy .mat-mdc-form-field-wrapper{padding-bottom:0}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations{display:grid;grid-template-columns:50% 50%}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .margin-top-icon svg{position:relative;top:3px}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .grid-row{display:grid;overflow:hidden;grid-template-rows:auto 1fr;align-items:start}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .grid-row:first-child{margin-right:12px;gap:16px}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .grid-row:last-child{margin-left:12px;gap:8px}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .grid-row:last-child.grid-no-gap{gap:0}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .dates{margin:0}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .dates app-icon svg{margin-right:8px}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .dates app-booking-dates .hint{font-size:14px;color:var(--primary-color-500)}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .booking-workspace .workspace-text{min-height:42px;display:grid;grid-template-columns:auto 42px;gap:8px;align-items:start;justify-content:start}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .booking-workspace .workspace-text .link-workspace{font-size:16px;display:block;cursor:pointer;color:var(--primary-color-600)}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .booking-workspace .workspace-text .link-workspace:hover{text-decoration:underline}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .booking-workspace app-indoor-map-btn{height:22px;margin-top:2px}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .booking-workspace ul.seats li, [_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .booking-workspace .seat{font-size:16px}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .booking-workspace .seats{margin-bottom:8px;line-height:24px;padding-inline-start:18px}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .booking-workspace .seats li{list-style:circle}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .show-map-icon{margin-top:3px}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .booking-workspace, [_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .services{width:100%;display:grid;grid-template-columns:26px 1fr;align-items:start}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .booking-workspace mat-icon, [_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .services mat-icon{color:var(--primary-color-400)}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .expandable-booking-extras{overflow:hidden;display:grid;gap:16px}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .grid-no-gap .expandable-booking-extras{gap:0;margin-top:0}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .meeting .participants{display:flex;align-items:flex-start;flex-wrap:wrap;margin-bottom:16px}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .meeting .contact app-button button{font-weight:400}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .book-next-to-container app-button button{font-weight:400}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .book-next-to-container .book-next-to-invitations{display:grid;gap:8px;grid-template-rows:auto 1fr;align-items:start}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .max-width-100{width:100%;max-width:100%;overflow:hidden}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .max-width-100 app-button button{max-width:100%}[_nghost-%COMP%]     .booking-resume .booking-middle .booking-informations .max-width-100 app-button button span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}[_nghost-%COMP%]     .booking-resume .booking-middle .show{background:none;border:none;font-size:16px;padding:0;transition:all ease-in-out .4s}[_nghost-%COMP%]     .booking-resume .booking-middle .show .mat-icon{position:relative;top:5px}[_nghost-%COMP%]     .booking-resume .booking-actions{display:flex;flex-direction:column;gap:4px;justify-content:start;align-items:center;border-left:solid 1px #ddd;padding-top:4px;position:relative}[_nghost-%COMP%]     .booking-resume .booking-actions .reference{font-size:10px;line-break:auto;max-width:40px;text-align:center;position:absolute;bottom:0}  .popover-custom .popover-body{padding:.3rem 0!important}  .popover-custom .popover-option{cursor:pointer;padding:.3rem 1.5rem .3rem .75rem;display:flex;align-items:center}  .popover-custom .popover-option:hover{background:#cacaca80}  .popover-custom .popover-option svg{fill:var(--primary-color-500);width:16px;height:16px;margin-right:.3rem}@media screen and (max-width: 768px){.booking-resume[_ngcontent-%COMP%]{grid-template-columns:1fr;gap:15px}.booking-resume[_ngcontent-%COMP%]   .container-img-workspace[_ngcontent-%COMP%]   .img-container[_ngcontent-%COMP%]{width:100%}.booking-resume[_ngcontent-%COMP%]   .container-img-workspace[_ngcontent-%COMP%]   .more-options-button[_ngcontent-%COMP%]{display:block}.booking-resume[_ngcontent-%COMP%]   .booking-middle[_ngcontent-%COMP%]{gap:10px}.booking-resume[_ngcontent-%COMP%]   .booking-middle[_ngcontent-%COMP%]   .booking-informations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:8px}.booking-resume[_ngcontent-%COMP%]   .booking-middle[_ngcontent-%COMP%]   .booking-informations[_ngcontent-%COMP%]   .grid-row[_ngcontent-%COMP%]:first-child, .booking-resume[_ngcontent-%COMP%]   .booking-middle[_ngcontent-%COMP%]   .booking-informations[_ngcontent-%COMP%]   .grid-row[_ngcontent-%COMP%]:last-child{margin:0}.booking-resume[_ngcontent-%COMP%]   .booking-actions[_ngcontent-%COMP%]{display:none}}"],data:{animation:[_i("detailExpand",[wt("collapsed",qe({height:"0px",minHeight:"0"})),wt("expanded",qe({height:"*"})),bt("expanded <=> collapsed",vt("225ms cubic-bezier(0.4, 0.0, 0.2, 1)"))])]}})}}return i})();var jr=Me(hi());var Og=["sourceModal"],Bg=()=>["card","sepa"];function Ag(i,r){i&1&&x(0,"mat-spinner",19),i&2&&c("diameter",25)}function Vg(i,r){i&1&&(a(0,"p",20),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.orders_error.no_error")," "))}function Rg(i,r){i&1&&(a(0,"th",21),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.orders_error.reference")," "))}function Ng(i,r){if(i&1&&(a(0,"td",22),p(1),l()),i&2){let e=r.$implicit;o(),w(e.order==null||e.order.invoice==null?null:e.order.invoice.reference)}}function Fg(i,r){i&1&&(a(0,"th",21),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.orders_error.created_at")," "))}function Lg(i,r){if(i&1&&(a(0,"td",22),p(1),d(2,"amFromUtc"),d(3,"amLocal"),d(4,"amDateFormat"),l()),i&2){let e=r.$implicit;o(),g(" ",T(4,5,u(3,3,u(2,1,e.createdAt)),"L LT")," ")}}function qg(i,r){i&1&&(a(0,"th",21),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.orders_error.error")," "))}function Wg(i,r){if(i&1&&(a(0,"td",23)(1,"div",24),p(2),l()()),i&2){let e=r.$implicit,n=m();o(),c("matTooltip",e.error)("matTooltipDisabled",(e==null||e.error==null?null:e.error.length)<75),o(),g(" ",n.displayError(e)," ")}}function Ug(i,r){i&1&&(a(0,"th",25),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.orders_error.total")," "))}function zg(i,r){if(i&1&&(a(0,"td",22),p(1),d(2,"currency"),l()),i&2){let e=r.$implicit;o(),w(T(2,1,(e==null?null:e.amount)/100,"EUR"))}}function jg(i,r){i&1&&(a(0,"th",26),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.dashboard.orders_error.actions.label")," "))}function Qg(i,r){if(i&1){let e=k();a(0,"button",29),b("click",function(){f(e);let t=m().$implicit,s=m();return v(s.downloadPDF(t.order==null||t.order.invoice==null?null:t.order.invoice.id))}),a(1,"mat-icon"),p(2,"picture_as_pdf"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"pages.dashboard.orders_error.actions.download_pdf")))}function Hg(i,r){if(i&1){let e=k();a(0,"td",22),x(1,"app-button-action",27),a(2,"mat-menu",null,1),h(4,Qg,6,3,"button",28),a(5,"button",29),b("click",function(){let t=f(e).$implicit,s=m();return v(s.retryPayment(t))}),a(6,"mat-icon"),p(7,"payments"),l(),a(8,"span"),p(9),d(10,"translate"),l()()()()}if(i&2){let e=r.$implicit,n=V(3);o(),c("matMenuTriggerFor",n),o(3),c("ngIf",(e.order==null?null:e.order.invoice)!=null),o(5),w(u(10,3,"pages.dashboard.orders_error.actions.retry_payment"))}}function Yg(i,r){i&1&&x(0,"tr",30)}function Gg(i,r){i&1&&x(0,"tr",31)}function Kg(i,r){if(i&1){let e=k();a(0,"div",32)(1,"h5",33),p(2),d(3,"translate"),l()(),a(4,"app-sources",34),b("selectedSource",function(t){f(e);let s=m();return v(s.selectedSource(t))}),l(),a(5,"div",35)(6,"app-button",36),b("clicked",function(){let t=f(e).$implicit;return v(t.dismiss("dismiss"))}),l(),a(7,"app-button",37),b("clicked",function(t){f(e);let s=m();return v(s.retryWithSource(t))}),l()()}if(i&2){let e=m();o(2),w(u(3,5,"pages.dashboard.orders_error.modal.title")),o(2),c("sources",e.api.user==null?null:e.api.user.sources)("types",X(7,Bg))("selection",!0),o(2),c("dangerMode",!0)}}var M3=(()=>{class i{constructor(e,n,t,s){this.api=e,this.translate=n,this.modal=t,this.utils=s,this.env=ut,this.type="company",this.isLoading=!0,this.displayedColumns=["reference","created_at","error","total","actions"],this.transactions=[],this.source=null}ngOnInit(){this.refreshData()}refreshData(){return z(this,null,function*(){this.isLoading=!0,this.type==="company"?this.transactions=yield this.api.companyService.errorOrders():this.transactions=yield this.api.userService.errorOrders(),this.isLoading=!1})}selectedSource(e){this.source=e}downloadPDF(e){window.open(this.env.api+"/invoices/"+e+"/pdf?locale="+this.translate.getLang(),"_blank").focus()}displayError(e){let n,t,s;try{s=JSON.parse(e.error).error.toLowerCase()}catch{s=e.error}return n="stripe."+s+".description",t=this.translate.get(n),(n===t||t==="")&&(n="pages.dashboard.orders_error.errors."+s,t=this.translate.get(n)),(n===t||t==="")&&(t=s),t?.includes("_")?(e.error=this.translate.get("stripe.default.description"),this.translate.get("stripe.default.description")):t}retryPayment(e){this.transaction=e,this.type==="company"?jr.default.fire({icon:"warning",title:this.translate.get("pages.dashboard.orders_error.swal.warning.title"),text:this.translate.get("pages.dashboard.orders_error.swal.warning.text"),showCancelButton:!0,focusCancel:!0,showConfirmButton:!0,cancelButtonText:this.translate.get("global.cancel")}).then(n=>{n&&n.value&&this.doRetry()}):this.openedSourceModal=this.modal.open(this.sourceModal,{size:"lg"})}retryWithSource(e){this.doRetry({method:this.source.type.toUpperCase(),methodId:this.source.id},e)}doRetry(e={},n){let t=Object.assign({order:{id:this.transaction.order.id},transaction:{id:this.transaction.id},customer:{id:this.transaction.source.id},method:this.transaction.method,methodId:this.transaction.paymentMethodId,amount:this.transaction.amount},e);this.api.orderService.retryPayment(t,n?.button).then(()=>this.completePayment()).catch(s=>this.handlePayError(s)).finally(()=>this.openedSourceModal.close())}handlePayError(e){let n=this.translate.get("pages.user.book.swal.error.title"),t="",s="";if(e.error&&e.error.declineCode){let _=this.translate.get("stripe."+e.error.declineCode+".description"),C=this.translate.get("stripe."+e.error.declineCode+".customer_instructions");t=C,_!=="stripe."+e.error.declineCode+".description"&&!this.utils.isBlank(_)&&(n=_,t=C),e.error.requestId&&(s=this.translate.get("pages.user.book.swal.error.footer").replace("{{req}}",e.error.requestId))}else if(e.error&&typeof e.error=="string")try{let _=JSON.parse(e.error);t=this.translate.get("global.errors.payment."+_.error?.toLowerCase())}catch{t=this.translate.get("global.errors.payment."+e?.error?.toLowerCase())}jr.default.fire({icon:"error",title:n,html:t,footer:s})}completePayment(){jr.default.fire({icon:"success",text:this.translate.get("pages.dashboard.orders_error.swal.success.text")}),this.refreshData()}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(U),y(Ue),y(_e))}}static{this.\u0275cmp=P({type:i,selectors:[["app-orders-error"]],viewQuery:function(n,t){if(n&1&&A(Og,7),n&2){let s;D(s=O())&&(t.sourceModal=s.first)}},inputs:{type:"type"},decls:29,vars:15,consts:[["sourceModal",""],["appMenu","matMenu"],[1,"my-3"],[1,"mat-title-large"],["class","m-auto",3,"diameter",4,"ngIf"],["class","text-center",4,"ngIf"],["mat-table","","matSort","","matSortActive","created_at","matSortDirection","desc",1,"w-100","m-0",3,"dataSource"],["matColumnDef","reference"],["mat-header-cell","","mat-sort-header","","scope","col",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","created_at"],["matColumnDef","error"],["mat-cell","","style","max-width: 150px",4,"matCellDef"],["matColumnDef","total"],["mat-header-cell","","mat-sort-header","amount","scope","col",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","","scope","col","class","text-end",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"m-auto",3,"diameter"],[1,"text-center"],["mat-header-cell","","mat-sort-header","","scope","col"],["mat-cell",""],["mat-cell","",2,"max-width","150px"],[1,"me-2",3,"matTooltip","matTooltipDisabled"],["mat-header-cell","","mat-sort-header","amount","scope","col"],["mat-header-cell","","scope","col",1,"text-end"],["iconName","more_vert",1,"float-end",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click",4,"ngIf"],["mat-menu-item","",3,"click"],["mat-header-row",""],["mat-row",""],[1,"modal-header"],[1,"modal-title"],[3,"selectedSource","sources","types","selection"],[1,"modal-footer"],["textKey","global.back","type","SECONDARY",1,"mx-2",3,"clicked","dangerMode"],["textKey","global.confirm","type","PRIMARY",1,"mx-2",3,"clicked"]],template:function(n,t){n&1&&(a(0,"mat-card",2)(1,"mat-card-header")(2,"h5",3),p(3),d(4,"translate"),l()(),a(5,"mat-card-content"),h(6,Ag,1,1,"mat-spinner",4)(7,Vg,3,3,"p",5),a(8,"table",6),d(9,"translate"),M(10,7),h(11,Rg,3,3,"th",8)(12,Ng,2,1,"td",9),S(),M(13,10),h(14,Fg,3,3,"th",8)(15,Lg,5,8,"td",9),S(),M(16,11),h(17,qg,3,3,"th",8)(18,Wg,3,3,"td",12),S(),M(19,13),h(20,Ug,3,3,"th",14)(21,zg,3,4,"td",9),S(),M(22,15),h(23,jg,3,3,"th",16)(24,Hg,11,5,"td",9),S(),h(25,Yg,1,0,"tr",17)(26,Gg,1,0,"tr",18),l()()(),h(27,Kg,8,8,"ng-template",null,0,ne)),n&2&&(E("d-none",t.type==="user"&&(t.isLoading||(t.transactions==null?null:t.transactions.length)===0)),o(3),g(" ",u(4,11,"pages.dashboard.orders_error.title")," "),o(3),c("ngIf",t.isLoading),o(),c("ngIf",!t.isLoading&&t.transactions.length==0),o(),E("d-none",t.isLoading||t.transactions.length==0),c("dataSource",t.transactions),yt("aria-label",u(9,13,"pages.dashboard.orders_error.title")),o(17),c("matHeaderRowDef",t.displayedColumns),o(),c("matRowDefColumns",t.displayedColumns))},dependencies:[R,Qi,Kt,Gt,It,be,oi,Fi,Gn,Li,Ni,Ui,qi,Wi,Kn,zi,Te,$,H,tt,On,Bn,An,Xe,N,ei,ti,ii]})}}return i})();var $g=i=>({"environment-page":i});function Xg(i,r){if(i&1){let e=k();a(0,"div")(1,"app-order-preview",12),b("orderCancelled",function(t){f(e);let s=m();return v(s.onOrderCancelled(t))}),l()()}if(i&2){let e=r.$implicit,n=r.first;o(),c("order",e)("shouldNotifyInvitations",n)}}var P3=(()=>{class i{constructor(e,n,t){this.api=e,this.translate=n,this.router=t,this.createdOrders=null}ngOnInit(){this.cleanGlobals()}onOrderCancelled(e){this.createdOrders.success=this.createdOrders.success.filter(n=>n.id!==e.id)}cleanGlobals(){this.createdOrders=JSON.parse(JSON.stringify(this.api.orders)),this.api.orders=null,this.api.order=null}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(U),y(mt))}}static{this.\u0275cmp=P({type:i,selectors:[["app-orders-summary"]],decls:14,vars:7,consts:[[1,"container","d-block",3,"ngClass"],[1,"card"],[1,"row","confirmation-container"],[1,"col","text-center"],["src","/assets/images/confirmation-check.gif","alt","Check",1,"confirm-icon-multiple-booking","mx-auto","my-2"],[1,"text-center","confirmation-message"],[1,"row"],[1,"col"],[4,"ngFor","ngForOf"],[1,"row","my-4"],[1,"col","d-flex","justify-content-center"],["textKey","pages.user.book.back_home","type","PRIMARY",3,"clicked"],[3,"orderCancelled","order","shouldNotifyInvitations"]],template:function(n,t){n&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),x(4,"img",4),a(5,"p",5),p(6),d(7,"translate"),l()()(),a(8,"div",6)(9,"div",7),h(10,Xg,2,2,"div",8),l()(),a(11,"div",9)(12,"div",10)(13,"app-button",11),b("clicked",function(){return t.api.goToEnvironment()}),l()()()()()),n&2&&(c("ngClass",re(5,$g,t.api.companyEnvironment)),o(6),g(" ",u(7,3,"pages.user.book.steps.confirmation.text_multiple_1")," "),o(4),c("ngForOf",t.createdOrders.success))},dependencies:[ce,j,H,so,N],styles:[".container[_ngcontent-%COMP%]{padding-top:100px;padding-bottom:70px}.card[_ngcontent-%COMP%]{box-shadow:0 4px 24px #0000001a;border-radius:12px;padding:32px}.confirmation-container[_ngcontent-%COMP%]{margin-bottom:56px}.confirm-icon-multiple-booking[_ngcontent-%COMP%]{width:134px;height:120px;object-fit:contain}.confirmation-message[_ngcontent-%COMP%]{font-weight:600;font-size:20px;color:#55585e}"]})}}return i})();var ef=i=>({"environment-page":i}),tf=()=>[5,10,20,50];function nf(i,r){i&1&&(a(0,"section",11),x(1,"mat-spinner",12),l()),i&2&&(o(),c("diameter",25))}function of(i,r){i&1&&(a(0,"div",13),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"bookings.empty")," "))}function rf(i,r){if(i&1){let e=k();a(0,"div",14)(1,"app-button",15),b("clicked",function(){f(e);let t=m();return v(t.api.goToEnvironment())}),l()()}}function af(i,r){i&1&&x(0,"div",18)}function sf(i,r){if(i&1){let e=k();a(0,"div")(1,"app-order-preview",16),b("orderCancelled",function(t){f(e);let s=m();return v(s.orderCancelled(t))}),l(),h(2,af,1,0,"div",17),l()}if(i&2){let e=r.$implicit,n=r.index,t=m();o(),c("viewAsAdmin",t.type!=="user")("order",e),o(),c("ngIf",n<t.orders.length-1)}}var L3=(()=>{class i{set updateBuildings(e){this.selectedBuildings=e,this.buildingsChange.emit()}constructor(e,n,t,s,_){this.api=e,this.changeDetectorRef=n,this.data=t,this.translate=s,this.router=_,this.isLoading=!0,this.panelOpenState=!0,this.type="user",this.status=["CREATED","VALIDATED","CONFIRMED","PAID"],this.step=[],this.kind=[],this.onlyServices=!1,this.selectedBuildings=[],this.buildingsChange=new L(!0),this.loaded=new L(!0),this.declarationsChanged=new L(!0),this.showMonthly=!0,this.showMonthlyEmitter=new L(!0),this.orders=null,this.resultsLength=0}ngOnInit(){pi(this.paginator.page,this.showMonthlyEmitter,this.buildingsChange,this.declarationsChanged).pipe(en({}),kn(()=>{this.isLoading=!0;let e={};e.status=this.status,e.step=this.step,e.kind=this.kind,this.selectedBuildings?.length>0&&(e.buildings=this.selectedBuildings);let n={page:this.paginator.pageIndex,size:this.paginator.pageSize||10,sort:"start_date,asc"};switch(!this.showMonthly&&e.step.includes("IN_PROGRESS")&&(e.hideMonthlyBooking=!0),this.type){case"host":return this.api.orderService.getForCompany(e,n);case"collaborators":return this.api.orderService.getForCompanyCollaborators(Object.assign({},e,n));case"user":default:return this.onlyServices?this.api.orderService.getOnlyServiceOrders(Object.assign({},e,n)):this.api.orderService.getForUser(Object.assign({},e,n))}}),Zi(e=>(this.isLoading=!1,this.resultsLength=e.totalElements,e.content)),yn(()=>(this.isLoading=!1,Ji([])))).subscribe(e=>{this.orders=e,this.changeDetectorRef.detectChanges(),this.loaded.emit(this.orders)})}showMonthlyChange(e){this.showMonthly=e.checked,this.showMonthlyEmitter.emit(this.showMonthly)}orderCancelled(e){let n=0;this.orders.forEach(t=>{if(t.id===e.id){this.orders.splice(n,1);return}n++}),this.declarationsChanged.emit()}getOrders(){return this.orders}goToBuilding(){this.api.isAuthenticated()&&this.api.user?.favoriteBuilding&&(this.data.storage.building=this.api.user?.favoriteBuilding,this.router.navigate([this.translate.get("pages.company_environment.building.metadata.url").replace(":environmentId",this.api?.companyEnvironment.urlOrId).replace(":buildingId",this.api.user?.favoriteBuilding.id)]))}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(Se),y(br),y(U),y(mt))}}static{this.\u0275cmp=P({type:i,selectors:[["app-orders"]],viewQuery:function(n,t){if(n&1&&A(Bi,7),n&2){let s;D(s=O())&&(t.paginator=s.first)}},inputs:{title:"title",type:"type",status:"status",step:"step",kind:"kind",onlyServices:"onlyServices",updateBuildings:[0,"selectedBuildings","updateBuildings"]},outputs:{loaded:"loaded",declarationsChanged:"declarationsChanged"},decls:17,vars:20,consts:[["paging",""],[1,"mb-4",3,"opened","closed","expanded","ngClass"],[1,"d-flex","justify-content-between","w-100","me-3"],[1,"d-flex","align-items-center"],[1,"mat-title-large"],[1,"badge","badge-moffi","mx-2"],["class","p-3 m-0",4,"ngIf"],["class","text-center",4,"ngIf"],["class","d-flex justify-content-center mt-3",4,"ngIf"],[4,"ngFor","ngForOf"],["showFirstLastButtons","",3,"length","pageSize","pageSizeOptions"],[1,"p-3","m-0"],[1,"m-auto",3,"diameter"],[1,"text-center"],[1,"d-flex","justify-content-center","mt-3"],["textKey","components.bookings.book_workspace","type","PRIMARY",1,"mx-2",3,"clicked"],[3,"orderCancelled","viewAsAdmin","order"],["class","bordure-orders",4,"ngIf"],[1,"bordure-orders"]],template:function(n,t){if(n&1){let s=k();a(0,"mat-expansion-panel",1),b("opened",function(){return f(s),v(t.panelOpenState=!0)})("closed",function(){return f(s),v(t.panelOpenState=!1)}),a(1,"mat-expansion-panel-header")(2,"div",2)(3,"div",3)(4,"h5",4),p(5),d(6,"translate"),a(7,"span",5),p(8),l()()()()(),a(9,"div"),h(10,nf,2,1,"section",6),a(11,"section"),h(12,of,3,3,"div",7)(13,rf,2,0,"div",8)(14,sf,3,3,"div",9),x(15,"mat-paginator",10,0),l()()()}if(n&2){let s=V(16);c("expanded",t.panelOpenState)("ngClass",re(17,ef,t.api.companyEnvironment)),o(5),g(" ",u(6,15,t.title)," "),o(3),w(t.resultsLength),o(2),c("ngIf",t.isLoading),o(),E("d-none",t.isLoading),o(),c("ngIf",t.type==="host"&&(t.orders==null?null:t.orders.length)===0),o(),c("ngIf",t.type!=="host"&&t.step.includes("WAITING")&&(t.orders==null?null:t.orders.length)===0),o(),c("ngForOf",t.getOrders()),o(),E("d-none",t.resultsLength<=s.pageSize),c("length",t.resultsLength)("pageSize",10)("pageSizeOptions",X(19,tf))}},dependencies:[ce,j,R,be,Bi,Ht,Yt,H,so,N],styles:[".bordure-orders[_ngcontent-%COMP%]{height:1px;width:100%;background-color:#ddd}.card-body[_ngcontent-%COMP%]{padding:0 1.25rem}"]})}}return i})();var mp=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[de,_r,Tr,qn,Ai,$n,Xt,Ze,nt,sr,Un,Qt,at,Je,Ri,Ae,ji,fi,Yn,Js,ai,xr,Ge,Ye,$o,Ln,Nl,Ll,Fl,Pr,Re,Cr,np,Rl,ql,Vn,rr,Fn]})}}return i})();var lf=["*"],cf='.mdc-list{margin:0;padding:8px 0;list-style-type:none}.mdc-list:focus{outline:none}.mdc-list-item{display:flex;position:relative;justify-content:flex-start;overflow:hidden;padding:0;align-items:stretch;cursor:pointer;padding-left:16px;padding-right:16px;background-color:var(--mdc-list-list-item-container-color);border-radius:var(--mdc-list-list-item-container-shape, var(--mat-app-corner-none))}.mdc-list-item.mdc-list-item--selected{background-color:var(--mdc-list-list-item-selected-container-color)}.mdc-list-item:focus{outline:0}.mdc-list-item.mdc-list-item--disabled{cursor:auto}.mdc-list-item.mdc-list-item--with-one-line{height:var(--mdc-list-list-item-one-line-container-height)}.mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__start{align-self:center;margin-top:0}.mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__end{align-self:center;margin-top:0}.mdc-list-item.mdc-list-item--with-two-lines{height:var(--mdc-list-list-item-two-line-container-height)}.mdc-list-item.mdc-list-item--with-two-lines .mdc-list-item__start{align-self:flex-start;margin-top:16px}.mdc-list-item.mdc-list-item--with-two-lines .mdc-list-item__end{align-self:center;margin-top:0}.mdc-list-item.mdc-list-item--with-three-lines{height:var(--mdc-list-list-item-three-line-container-height)}.mdc-list-item.mdc-list-item--with-three-lines .mdc-list-item__start{align-self:flex-start;margin-top:16px}.mdc-list-item.mdc-list-item--with-three-lines .mdc-list-item__end{align-self:flex-start;margin-top:16px}.mdc-list-item.mdc-list-item--selected::before,.mdc-list-item.mdc-list-item--selected:focus::before,.mdc-list-item:not(.mdc-list-item--selected):focus::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.cdk-high-contrast-active .mdc-list-item.mdc-list-item--selected::before,.cdk-high-contrast-active .mdc-list-item.mdc-list-item--selected:focus::before,.cdk-high-contrast-active .mdc-list-item:not(.mdc-list-item--selected):focus::before{border-color:CanvasText}.mdc-list-item.mdc-list-item--selected:focus::before,.mdc-list-item.mdc-list-item--selected::before{border-width:3px;border-style:double}a.mdc-list-item{color:inherit;text-decoration:none}.mdc-list-item__start{fill:currentColor;flex-shrink:0;pointer-events:none}.mdc-list-item--with-leading-icon .mdc-list-item__start{color:var(--mdc-list-list-item-leading-icon-color, var(--mat-app-on-surface-variant));width:var(--mdc-list-list-item-leading-icon-size);height:var(--mdc-list-list-item-leading-icon-size);margin-left:16px;margin-right:32px}[dir=rtl] .mdc-list-item--with-leading-icon .mdc-list-item__start{margin-left:32px;margin-right:16px}.mdc-list-item--with-leading-icon:hover .mdc-list-item__start{color:var(--mdc-list-list-item-hover-leading-icon-color)}.mdc-list-item--with-leading-avatar .mdc-list-item__start{width:var(--mdc-list-list-item-leading-avatar-size);height:var(--mdc-list-list-item-leading-avatar-size);margin-left:16px;margin-right:16px;border-radius:50%}.mdc-list-item--with-leading-avatar .mdc-list-item__start,[dir=rtl] .mdc-list-item--with-leading-avatar .mdc-list-item__start{margin-left:16px;margin-right:16px;border-radius:50%}.mdc-list-item__end{flex-shrink:0;pointer-events:none}.mdc-list-item--with-trailing-meta .mdc-list-item__end{font-family:var(--mdc-list-list-item-trailing-supporting-text-font, var(--mat-app-label-small-font));line-height:var(--mdc-list-list-item-trailing-supporting-text-line-height, var(--mat-app-label-small-line-height));font-size:var(--mdc-list-list-item-trailing-supporting-text-size, var(--mat-app-label-small-size));font-weight:var(--mdc-list-list-item-trailing-supporting-text-weight, var(--mat-app-label-small-weight));letter-spacing:var(--mdc-list-list-item-trailing-supporting-text-tracking, var(--mat-app-label-small-tracking))}.mdc-list-item--with-trailing-icon .mdc-list-item__end{color:var(--mdc-list-list-item-trailing-icon-color, var(--mat-app-on-surface-variant));width:var(--mdc-list-list-item-trailing-icon-size);height:var(--mdc-list-list-item-trailing-icon-size)}.mdc-list-item--with-trailing-icon:hover .mdc-list-item__end{color:var(--mdc-list-list-item-hover-trailing-icon-color)}.mdc-list-item.mdc-list-item--with-trailing-meta .mdc-list-item__end{color:var(--mdc-list-list-item-trailing-supporting-text-color, var(--mat-app-on-surface-variant))}.mdc-list-item--selected.mdc-list-item--with-trailing-icon .mdc-list-item__end{color:var(--mdc-list-list-item-selected-trailing-icon-color, var(--mat-app-primary))}.mdc-list-item__content{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;align-self:center;flex:1;pointer-events:none}.mdc-list-item--with-two-lines .mdc-list-item__content,.mdc-list-item--with-three-lines .mdc-list-item__content{align-self:stretch}.mdc-list-item__primary-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:var(--mdc-list-list-item-label-text-color, var(--mat-app-on-surface));font-family:var(--mdc-list-list-item-label-text-font, var(--mat-app-body-large-font));line-height:var(--mdc-list-list-item-label-text-line-height, var(--mat-app-body-large-line-height));font-size:var(--mdc-list-list-item-label-text-size, var(--mat-app-body-large-size));font-weight:var(--mdc-list-list-item-label-text-weight, var(--mat-app-body-large-weight));letter-spacing:var(--mdc-list-list-item-label-text-tracking, var(--mat-app-body-large-tracking))}.mdc-list-item:hover .mdc-list-item__primary-text{color:var(--mdc-list-list-item-hover-label-text-color, var(--mat-app-on-surface))}.mdc-list-item:focus .mdc-list-item__primary-text{color:var(--mdc-list-list-item-focus-label-text-color, var(--mat-app-on-surface))}.mdc-list-item--with-two-lines .mdc-list-item__primary-text,.mdc-list-item--with-three-lines .mdc-list-item__primary-text{display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before,.mdc-list-item--with-three-lines .mdc-list-item__primary-text::before{display:inline-block;width:0;height:28px;content:"";vertical-align:0}.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after,.mdc-list-item--with-three-lines .mdc-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-list-item__secondary-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;color:var(--mdc-list-list-item-supporting-text-color, var(--mat-app-on-surface-variant));font-family:var(--mdc-list-list-item-supporting-text-font, var(--mat-app-body-medium-font));line-height:var(--mdc-list-list-item-supporting-text-line-height, var(--mat-app-body-medium-line-height));font-size:var(--mdc-list-list-item-supporting-text-size, var(--mat-app-body-medium-size));font-weight:var(--mdc-list-list-item-supporting-text-weight, var(--mat-app-body-medium-weight));letter-spacing:var(--mdc-list-list-item-supporting-text-tracking, var(--mat-app-body-medium-tracking))}.mdc-list-item__secondary-text::before{display:inline-block;width:0;height:20px;content:"";vertical-align:0}.mdc-list-item--with-three-lines .mdc-list-item__secondary-text{white-space:normal;line-height:20px}.mdc-list-item--with-overline .mdc-list-item__secondary-text{white-space:nowrap;line-height:auto}.mdc-list-item--with-leading-radio.mdc-list-item,.mdc-list-item--with-leading-checkbox.mdc-list-item,.mdc-list-item--with-leading-icon.mdc-list-item,.mdc-list-item--with-leading-avatar.mdc-list-item{padding-left:0;padding-right:16px}[dir=rtl] .mdc-list-item--with-leading-radio.mdc-list-item,[dir=rtl] .mdc-list-item--with-leading-checkbox.mdc-list-item,[dir=rtl] .mdc-list-item--with-leading-icon.mdc-list-item,[dir=rtl] .mdc-list-item--with-leading-avatar.mdc-list-item{padding-left:16px;padding-right:0}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines .mdc-list-item__primary-text,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines .mdc-list-item__primary-text,.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines .mdc-list-item__primary-text,.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines .mdc-list-item__primary-text{display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before,.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before,.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before{display:inline-block;width:0;height:32px;content:"";vertical-align:0}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after,.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after,.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end,.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end,.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end{display:block;margin-top:0;line-height:normal}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end::before,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end::before,.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end::before,.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end::before{display:inline-block;width:0;height:32px;content:"";vertical-align:0}.mdc-list-item--with-trailing-icon.mdc-list-item,[dir=rtl] .mdc-list-item--with-trailing-icon.mdc-list-item{padding-left:0;padding-right:0}.mdc-list-item--with-trailing-icon .mdc-list-item__end{margin-left:16px;margin-right:16px}.mdc-list-item--with-trailing-meta.mdc-list-item{padding-left:16px;padding-right:0}[dir=rtl] .mdc-list-item--with-trailing-meta.mdc-list-item{padding-left:0;padding-right:16px}.mdc-list-item--with-trailing-meta .mdc-list-item__end{-webkit-user-select:none;user-select:none;margin-left:28px;margin-right:16px}[dir=rtl] .mdc-list-item--with-trailing-meta .mdc-list-item__end{margin-left:16px;margin-right:28px}.mdc-list-item--with-trailing-meta.mdc-list-item--with-three-lines .mdc-list-item__end,.mdc-list-item--with-trailing-meta.mdc-list-item--with-two-lines .mdc-list-item__end{display:block;line-height:normal;align-self:flex-start;margin-top:0}.mdc-list-item--with-trailing-meta.mdc-list-item--with-three-lines .mdc-list-item__end::before,.mdc-list-item--with-trailing-meta.mdc-list-item--with-two-lines .mdc-list-item__end::before{display:inline-block;width:0;height:28px;content:"";vertical-align:0}.mdc-list-item--with-leading-radio .mdc-list-item__start,.mdc-list-item--with-leading-checkbox .mdc-list-item__start{margin-left:8px;margin-right:24px}[dir=rtl] .mdc-list-item--with-leading-radio .mdc-list-item__start,[dir=rtl] .mdc-list-item--with-leading-checkbox .mdc-list-item__start{margin-left:24px;margin-right:8px}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines .mdc-list-item__start,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines .mdc-list-item__start{align-self:flex-start;margin-top:8px}.mdc-list-item--with-trailing-radio.mdc-list-item,.mdc-list-item--with-trailing-checkbox.mdc-list-item{padding-left:16px;padding-right:0}[dir=rtl] .mdc-list-item--with-trailing-radio.mdc-list-item,[dir=rtl] .mdc-list-item--with-trailing-checkbox.mdc-list-item{padding-left:0;padding-right:16px}.mdc-list-item--with-trailing-radio.mdc-list-item--with-leading-icon,.mdc-list-item--with-trailing-radio.mdc-list-item--with-leading-avatar,.mdc-list-item--with-trailing-checkbox.mdc-list-item--with-leading-icon,.mdc-list-item--with-trailing-checkbox.mdc-list-item--with-leading-avatar{padding-left:0}[dir=rtl] .mdc-list-item--with-trailing-radio.mdc-list-item--with-leading-icon,[dir=rtl] .mdc-list-item--with-trailing-radio.mdc-list-item--with-leading-avatar,[dir=rtl] .mdc-list-item--with-trailing-checkbox.mdc-list-item--with-leading-icon,[dir=rtl] .mdc-list-item--with-trailing-checkbox.mdc-list-item--with-leading-avatar{padding-right:0}.mdc-list-item--with-trailing-radio .mdc-list-item__end,.mdc-list-item--with-trailing-checkbox .mdc-list-item__end{margin-left:24px;margin-right:8px}[dir=rtl] .mdc-list-item--with-trailing-radio .mdc-list-item__end,[dir=rtl] .mdc-list-item--with-trailing-checkbox .mdc-list-item__end{margin-left:8px;margin-right:24px}.mdc-list-item--with-trailing-radio.mdc-list-item--with-three-lines .mdc-list-item__end,.mdc-list-item--with-trailing-checkbox.mdc-list-item--with-three-lines .mdc-list-item__end{align-self:flex-start;margin-top:8px}.mdc-list-group__subheader{margin:.75rem 16px}.mdc-list-item--disabled .mdc-list-item__start,.mdc-list-item--disabled .mdc-list-item__content,.mdc-list-item--disabled .mdc-list-item__end{opacity:1}.mdc-list-item--disabled .mdc-list-item__primary-text,.mdc-list-item--disabled .mdc-list-item__secondary-text{opacity:var(--mdc-list-list-item-disabled-label-text-opacity)}.mdc-list-item--disabled.mdc-list-item--with-leading-icon .mdc-list-item__start{color:var(--mdc-list-list-item-disabled-leading-icon-color, var(--mat-app-on-surface));opacity:var(--mdc-list-list-item-disabled-leading-icon-opacity)}.mdc-list-item--disabled.mdc-list-item--with-trailing-icon .mdc-list-item__end{color:var(--mdc-list-list-item-disabled-trailing-icon-color, var(--mat-app-on-surface));opacity:var(--mdc-list-list-item-disabled-trailing-icon-opacity)}.mat-mdc-list-item.mat-mdc-list-item-both-leading-and-trailing,[dir=rtl] .mat-mdc-list-item.mat-mdc-list-item-both-leading-and-trailing{padding-left:0;padding-right:0}.mdc-list-item.mdc-list-item--disabled .mdc-list-item__primary-text{color:var(--mdc-list-list-item-disabled-label-text-color, var(--mat-app-on-surface))}.mdc-list-item:hover::before{background-color:var(--mdc-list-list-item-hover-state-layer-color, var(--mat-app-on-surface));opacity:var(--mdc-list-list-item-hover-state-layer-opacity, var(--mat-app-hover-state-layer-opacity))}.mdc-list-item.mdc-list-item--disabled::before{background-color:var(--mdc-list-list-item-disabled-state-layer-color, var(--mat-app-on-surface));opacity:var(--mdc-list-list-item-disabled-state-layer-opacity, var(--mat-app-focus-state-layer-opacity))}.mdc-list-item:focus::before{background-color:var(--mdc-list-list-item-focus-state-layer-color, var(--mat-app-on-surface));opacity:var(--mdc-list-list-item-focus-state-layer-opacity, var(--mat-app-focus-state-layer-opacity))}.mdc-list-item--disabled .mdc-radio,.mdc-list-item--disabled .mdc-checkbox{opacity:var(--mdc-list-list-item-disabled-label-text-opacity)}.mdc-list-item--with-leading-avatar .mat-mdc-list-item-avatar{border-radius:var(--mdc-list-list-item-leading-avatar-shape, var(--mat-app-corner-full));background-color:var(--mdc-list-list-item-leading-avatar-color, var(--mat-app-primary-container))}.mat-mdc-list-item-icon{font-size:var(--mdc-list-list-item-leading-icon-size)}.cdk-high-contrast-active a.mdc-list-item--activated::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}.cdk-high-contrast-active a.mdc-list-item--activated [dir=rtl]::after{right:auto;left:16px}.mat-mdc-list-base{display:block}.mat-mdc-list-base .mdc-list-item__start,.mat-mdc-list-base .mdc-list-item__end,.mat-mdc-list-base .mdc-list-item__content{pointer-events:auto}.mat-mdc-list-item,.mat-mdc-list-option{width:100%;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-list-item:not(.mat-mdc-list-item-interactive),.mat-mdc-list-option:not(.mat-mdc-list-item-interactive){cursor:default}.mat-mdc-list-item .mat-divider-inset,.mat-mdc-list-option .mat-divider-inset{position:absolute;left:0;right:0;bottom:0}.mat-mdc-list-item .mat-mdc-list-item-avatar~.mat-divider-inset,.mat-mdc-list-option .mat-mdc-list-item-avatar~.mat-divider-inset{margin-left:72px}[dir=rtl] .mat-mdc-list-item .mat-mdc-list-item-avatar~.mat-divider-inset,[dir=rtl] .mat-mdc-list-option .mat-mdc-list-item-avatar~.mat-divider-inset{margin-right:72px}.mat-mdc-list-item-interactive::before{top:0;left:0;right:0;bottom:0;position:absolute;content:"";opacity:0;pointer-events:none}.mat-mdc-list-item>.mat-mdc-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-list-item:focus>.mat-mdc-focus-indicator::before{content:""}.mat-mdc-list-item.mdc-list-item--with-three-lines .mat-mdc-list-item-line.mdc-list-item__secondary-text{white-space:nowrap;line-height:normal}.mat-mdc-list-item.mdc-list-item--with-three-lines .mat-mdc-list-item-unscoped-content.mdc-list-item__secondary-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}mat-action-list button{background:none;color:inherit;border:none;font:inherit;outline:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0);text-align:start}mat-action-list button::-moz-focus-inner{border:0}.mdc-list-item--with-leading-icon .mdc-list-item__start{margin-inline-start:var(--mat-list-list-item-leading-icon-start-space);margin-inline-end:var(--mat-list-list-item-leading-icon-end-space)}.mat-mdc-nav-list .mat-mdc-list-item{border-radius:var(--mat-list-active-indicator-shape, var(--mat-app-corner-full));--mat-mdc-focus-indicator-border-radius:var(--mat-list-active-indicator-shape, var(--mat-app-corner-full))}.mat-mdc-nav-list .mat-mdc-list-item.mdc-list-item--activated{background-color:var(--mat-list-active-indicator-color, var(--mat-app-secondary-container))}',pf=["unscopedContent"],df=["text"],mf=[[["","matListItemAvatar",""],["","matListItemIcon",""]],[["","matListItemTitle",""]],[["","matListItemLine",""]],"*",[["","matListItemMeta",""]],[["mat-divider"]]],uf=["[matListItemAvatar],[matListItemIcon]","[matListItemTitle]","[matListItemLine]","*","[matListItemMeta]","mat-divider"];var _f=new it("ListOption"),hf=(()=>{class i{constructor(e){this._elementRef=e}static{this.\u0275fac=function(n){return new(n||i)(y(Bt))}}static{this.\u0275dir=Fe({type:i,selectors:[["","matListItemTitle",""]],hostAttrs:[1,"mat-mdc-list-item-title","mdc-list-item__primary-text"],standalone:!0})}}return i})(),gf=(()=>{class i{constructor(e){this._elementRef=e}static{this.\u0275fac=function(n){return new(n||i)(y(Bt))}}static{this.\u0275dir=Fe({type:i,selectors:[["","matListItemLine",""]],hostAttrs:[1,"mat-mdc-list-item-line","mdc-list-item__secondary-text"],standalone:!0})}}return i})(),ff=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275dir=Fe({type:i,selectors:[["","matListItemMeta",""]],hostAttrs:[1,"mat-mdc-list-item-meta","mdc-list-item__end"],standalone:!0})}}return i})(),_p=(()=>{class i{constructor(e){this._listOption=e}_isAlignedAtStart(){return!this._listOption||this._listOption?._getTogglePosition()==="after"}static{this.\u0275fac=function(n){return new(n||i)(y(_f,8))}}static{this.\u0275dir=Fe({type:i,hostVars:4,hostBindings:function(n,t){n&2&&E("mdc-list-item__start",t._isAlignedAtStart())("mdc-list-item__end",!t._isAlignedAtStart())},standalone:!0})}}return i})(),vf=(()=>{class i extends _p{static{this.\u0275fac=(()=>{let e;return function(t){return(e||(e=uo(i)))(t||i)}})()}static{this.\u0275dir=Fe({type:i,selectors:[["","matListItemAvatar",""]],hostAttrs:[1,"mat-mdc-list-item-avatar"],standalone:!0,features:[Lt]})}}return i})(),bf=(()=>{class i extends _p{static{this.\u0275fac=(()=>{let e;return function(t){return(e||(e=uo(i)))(t||i)}})()}static{this.\u0275dir=Fe({type:i,selectors:[["","matListItemIcon",""]],hostAttrs:[1,"mat-mdc-list-item-icon"],standalone:!0,features:[Lt]})}}return i})(),Cf=new it("MAT_LIST_CONFIG"),Qr=(()=>{class i{constructor(){this._isNonInteractive=!0,this._disableRipple=!1,this._disabled=!1,this._defaultOptions=di(Cf,{optional:!0})}get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=Si(e)}get disabled(){return this._disabled}set disabled(e){this._disabled=Si(e)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275dir=Fe({type:i,hostVars:1,hostBindings:function(n,t){n&2&&yt("aria-disabled",t.disabled)},inputs:{disableRipple:"disableRipple",disabled:"disabled"},standalone:!0})}}return i})(),xf=(()=>{class i{set lines(e){this._explicitLines=Ps(e,null),this._updateItemLines(!1)}get disableRipple(){return this.disabled||this._disableRipple||this._noopAnimations||!!this._listBase?.disableRipple}set disableRipple(e){this._disableRipple=Si(e)}get disabled(){return this._disabled||!!this._listBase?.disabled}set disabled(e){this._disabled=Si(e)}get rippleDisabled(){return this.disableRipple||!!this.rippleConfig.disabled}constructor(e,n,t,s,_,C){this._elementRef=e,this._ngZone=n,this._listBase=t,this._platform=s,this._explicitLines=null,this._disableRipple=!1,this._disabled=!1,this._subscriptions=new xn,this._rippleRenderer=null,this._hasUnscopedTextContent=!1,this.rippleConfig=_||{},this._hostElement=this._elementRef.nativeElement,this._isButtonElement=this._hostElement.nodeName.toLowerCase()==="button",this._noopAnimations=C==="NoopAnimations",t&&!t._isNonInteractive&&this._initInteractiveListItem(),this._isButtonElement&&!this._hostElement.hasAttribute("type")&&this._hostElement.setAttribute("type","button")}ngAfterViewInit(){this._monitorProjectedLinesAndTitle(),this._updateItemLines(!0)}ngOnDestroy(){this._subscriptions.unsubscribe(),this._rippleRenderer!==null&&this._rippleRenderer._removeTriggerEvents()}_hasIconOrAvatar(){return!!(this._avatars.length||this._icons.length)}_initInteractiveListItem(){this._hostElement.classList.add("mat-mdc-list-item-interactive"),this._rippleRenderer=new Ks(this,this._ngZone,this._hostElement,this._platform),this._rippleRenderer.setupTriggerEvents(this._hostElement)}_monitorProjectedLinesAndTitle(){this._ngZone.runOutsideAngular(()=>{this._subscriptions.add(pi(this._lines.changes,this._titles.changes).subscribe(()=>this._updateItemLines(!1)))})}_updateItemLines(e){if(!this._lines||!this._titles||!this._unscopedContent)return;e&&this._checkDomForUnscopedTextContent();let n=this._explicitLines??this._inferLinesFromContent(),t=this._unscopedContent.nativeElement;if(this._hostElement.classList.toggle("mat-mdc-list-item-single-line",n<=1),this._hostElement.classList.toggle("mdc-list-item--with-one-line",n<=1),this._hostElement.classList.toggle("mdc-list-item--with-two-lines",n===2),this._hostElement.classList.toggle("mdc-list-item--with-three-lines",n===3),this._hasUnscopedTextContent){let s=this._titles.length===0&&n===1;t.classList.toggle("mdc-list-item__primary-text",s),t.classList.toggle("mdc-list-item__secondary-text",!s)}else t.classList.remove("mdc-list-item__primary-text"),t.classList.remove("mdc-list-item__secondary-text")}_inferLinesFromContent(){let e=this._titles.length+this._lines.length;return this._hasUnscopedTextContent&&(e+=1),e}_checkDomForUnscopedTextContent(){this._hasUnscopedTextContent=Array.from(this._unscopedContent.nativeElement.childNodes).filter(e=>e.nodeType!==e.COMMENT_NODE).some(e=>!!(e.textContent&&e.textContent.trim()))}static{this.\u0275fac=function(n){return new(n||i)(y(Bt),y(Sn),y(Qr,8),y(Mi),y(Ca,8),y(ua,8))}}static{this.\u0275dir=Fe({type:i,contentQueries:function(n,t,s){if(n&1&&(nn(s,vf,4),nn(s,bf,4)),n&2){let _;D(_=O())&&(t._avatars=_),D(_=O())&&(t._icons=_)}},hostVars:4,hostBindings:function(n,t){n&2&&(yt("aria-disabled",t.disabled)("disabled",t._isButtonElement&&t.disabled||null),E("mdc-list-item--disabled",t.disabled))},inputs:{lines:"lines",disableRipple:"disableRipple",disabled:"disabled"},standalone:!0})}}return i})();var hp=(()=>{class i extends Qr{static{this.\u0275fac=(()=>{let e;return function(t){return(e||(e=uo(i)))(t||i)}})()}static{this.\u0275cmp=P({type:i,selectors:[["mat-list"]],hostAttrs:[1,"mat-mdc-list","mat-mdc-list-base","mdc-list"],exportAs:["matList"],standalone:!0,features:[Ho([{provide:Qr,useExisting:i}]),Lt,Pn],ngContentSelectors:lf,decls:1,vars:0,template:function(n,t){n&1&&(Qo(),mi(0))},styles:[cf],encapsulation:2,changeDetection:0})}}return i})(),gp=(()=>{class i extends xf{get activated(){return this._activated}set activated(e){this._activated=Si(e)}constructor(e,n,t,s,_,C){super(e,n,t,s,_,C),this._activated=!1}_getAriaCurrent(){return this._hostElement.nodeName==="A"&&this._activated?"page":null}_hasBothLeadingAndTrailing(){return this._meta.length!==0&&(this._avatars.length!==0||this._icons.length!==0)}static{this.\u0275fac=function(n){return new(n||i)(y(Bt),y(Sn),y(Qr,8),y(Mi),y(Ca,8),y(ua,8))}}static{this.\u0275cmp=P({type:i,selectors:[["mat-list-item"],["a","mat-list-item",""],["button","mat-list-item",""]],contentQueries:function(n,t,s){if(n&1&&(nn(s,gf,5),nn(s,hf,5),nn(s,ff,5)),n&2){let _;D(_=O())&&(t._lines=_),D(_=O())&&(t._titles=_),D(_=O())&&(t._meta=_)}},viewQuery:function(n,t){if(n&1&&(A(pf,5),A(df,5)),n&2){let s;D(s=O())&&(t._unscopedContent=s.first),D(s=O())&&(t._itemText=s.first)}},hostAttrs:[1,"mat-mdc-list-item","mdc-list-item"],hostVars:13,hostBindings:function(n,t){n&2&&(yt("aria-current",t._getAriaCurrent()),E("mdc-list-item--activated",t.activated)("mdc-list-item--with-leading-avatar",t._avatars.length!==0)("mdc-list-item--with-leading-icon",t._icons.length!==0)("mdc-list-item--with-trailing-meta",t._meta.length!==0)("mat-mdc-list-item-both-leading-and-trailing",t._hasBothLeadingAndTrailing())("_mat-animation-noopable",t._noopAnimations))},inputs:{activated:"activated"},exportAs:["matListItem"],standalone:!0,features:[Lt,Pn],ngContentSelectors:uf,decls:10,vars:0,consts:[["unscopedContent",""],[1,"mdc-list-item__content"],[1,"mat-mdc-list-item-unscoped-content",3,"cdkObserveContent"],[1,"mat-mdc-focus-indicator"]],template:function(n,t){if(n&1){let s=k();Qo(mf),mi(0),a(1,"span",1),mi(2,1),mi(3,2),a(4,"span",2,0),b("cdkObserveContent",function(){return f(s),v(t._updateItemLines(!0))}),mi(6,3),l()(),mi(7,4),mi(8,5),x(9,"div",3)}},dependencies:[Fs],encapsulation:2,changeDetection:0})}}return i})();var fp=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[Ls,de,on,$s,Xs,Qt]})}}return i})();var vp=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-stripe-resource-placeholder"]],decls:7,vars:1,consts:[[1,"row","align-items-center","resource","stripe-placeholder"],[1,"col-auto"],[3,"disabled"],[1,"col-auto","px-0"],[1,"picture","animated"],[1,"text","animated"]],template:function(n,t){n&1&&(a(0,"div",0)(1,"div",1),x(2,"mat-checkbox",2),l(),a(3,"div",3),x(4,"div",4),l(),a(5,"div",1),x(6,"div",5),l()()),n&2&&(o(2),c("disabled",!0))},dependencies:[st],styles:[".stripe-placeholder[_ngcontent-%COMP%]{padding:12px 0}.stripe-placeholder[_ngcontent-%COMP%]   .picture[_ngcontent-%COMP%]{height:58px;width:76px;border-radius:8px}.stripe-placeholder[_ngcontent-%COMP%]   .text[_ngcontent-%COMP%]{width:150px;height:20px;border-radius:4px}"]})}}return i})();var je=function(i){return i.WORKSPACE="WORKSPACE",i.SERVICE="SERVICE",i}(je||{});var G=function(i){return i.UNIT="UNIT",i.HOUR="HOUR",i.HALF_DAY="HALF_DAY",i.DAY="DAY",i.MONTH="MONTH",i}(G||{});var bp=Me(hi());var wf=i=>["c_mfit","f_png","w_152","h_116",i];function Sf(i,r){if(i&1){let e=k();a(0,"div",24)(1,"mat-checkbox",25),b("click",function(t){return f(e),v(t.stopPropagation())}),l()()}if(i&2){let e=m();o(),c("formControl",e.selectionControl)}}function Mf(i,r){if(i&1&&(a(0,"div",26)(1,"div",27),x(2,"img",28),d(3,"imageTransform"),l()()),i&2){let e,n=m();o(2),c("src",T(3,1,(e=n.resource.image)!==null&&e!==void 0?e:n.defaultImage,re(4,wf,n.resource.type==="WORKSPACE"?"fo-auto":"")),K)}}function If(i,r){if(i&1&&(M(0),p(1),S()),i&2){let e=m(2);o(),w(e.resource.name)}}function Ef(i,r){if(i&1&&(M(0),p(1),S()),i&2){let e=m(2);o(),w(e.stripeProductName)}}function Pf(i,r){if(i&1&&(a(0,"div",31),p(1),d(2,"translate"),l()),i&2){let e,n=m(2);o(),g(" ",T(2,1,n.translatePrefix+"product_prices",(e=n.resource.product==null||n.resource.product.prices==null?null:n.resource.product.prices.length)!==null&&e!==void 0?e:0)," ")}}function Tf(i,r){if(i&1&&(a(0,"div",24)(1,"div",29),h(2,If,2,1,"ng-container",17)(3,Ef,2,1,"ng-container",17),l(),h(4,Pf,3,4,"div",30),l()),i&2){let e=m();o(2),c("ngIf",!e.fromResourcePage),o(),c("ngIf",e.fromResourcePage),o(),c("ngIf",e.resource.product)}}function Df(i,r){if(i&1&&(a(0,"button",32)(1,"span"),p(2),d(3,"translate"),l()()),i&2){let e=m();o(2),w(u(3,1,e.translatePrefix+"search.no-result"))}}function Of(i,r){if(i&1){let e=k();a(0,"button",16),b("click",function(){let t=f(e).$implicit,s=m(),_=V(10);return v(s.linkProduct(t,_))}),p(1),l()}if(i&2){let e=r.$implicit;o(),g(" ",e.name," ")}}function Bf(i,r){if(i&1){let e=k();a(0,"div",24)(1,"app-button",36),d(2,"translate"),b("click",function(t){return f(e),v(t.stopPropagation())})("clicked",function(t){f(e);let s=m(2);return v(s.refresh(t==null?null:t.button))}),l()()}if(i&2){let e=m(2);o(),c("textKey",u(2,1,e.translatePrefix+"actions.refresh"))}}function Af(i,r){if(i&1&&(a(0,"div",24),p(1),l()),i&2){let e=m(2);o(),g(" ",e.stripeProductName," ")}}function Vf(i,r){if(i&1){let e=k();M(0),a(1,"div",33)(2,"div",34)(3,"app-button",35),d(4,"translate"),b("click",function(t){return f(e),v(t.stopPropagation())})("clicked",function(t){f(e);let s=m();return v(s.detachProduct(t==null?null:t.button))}),l()(),h(5,Bf,3,3,"div",5)(6,Af,2,1,"div",5),l(),S()}if(i&2){let e=m();o(),E("justify-content-end",!e.fromResourcePage)("justify-content-between",e.fromResourcePage),o(2),c("rounded",!0)("matTooltip",u(4,8,e.translatePrefix+"actions.detach")),o(2),c("ngIf",e.fromResourcePage),o(),c("ngIf",!e.fromResourcePage)}}function Rf(i,r){if(i&1&&(a(0,"div",37)(1,"div",20),p(2),d(3,"translate"),a(4,"strong"),p(5),d(6,"translate"),l(),p(7),d(8,"translate"),l()()),i&2){let e=m();o(2),g(" ",u(3,3,e.translatePrefix+"prices.service.info.text1")," "),o(3),w(u(6,5,e.translatePrefix+"prices.service.info.text2")),o(2),g(" ",u(8,7,e.translatePrefix+"prices.service.info.text3")," ")}}function Nf(i,r){if(i&1&&(M(0),p(1),d(2,"currency"),S()),i&2){let e,n=m().$implicit,t=m();o(),g(" ",T(2,1,((e=t.getPrice(t.pricesControls[n]==null?null:t.pricesControls[n].value))==null?null:e.unitAmount)/100,((e=(e=t.getPrice(t.pricesControls[n]==null?null:t.pricesControls[n].value))==null?null:e.currency)!==null&&e!==void 0?e:"EUR").toUpperCase())," ")}}function Ff(i,r){if(i&1&&(a(0,"mat-option",45),p(1),d(2,"currency"),x(3,"br"),a(4,"small"),p(5),l()()),i&2){let e,n=r.$implicit;c("value",n.id),o(),g(" ",T(2,3,n.unitAmount/100,((e=n.currency)!==null&&e!==void 0?e:"EUR").toUpperCase())," "),o(4),w(n.name)}}function Lf(i,r){i&1&&(a(0,"div",46)(1,"div",47),x(2,"mat-divider",48),l()())}function qf(i,r){if(i&1){let e=k();M(0),a(1,"div",38)(2,"div",39),p(3),d(4,"translate"),a(5,"strong"),p(6),d(7,"lowercase"),d(8,"translate"),l()(),a(9,"div",39)(10,"mat-form-field",40)(11,"mat-select",41),d(12,"translate"),b("openedChange",function(t){f(e);let s=m();return v(s.pricesOpenedChange(t))})("click",function(){f(e);let t=m();return v(t.pricesOpened=!0)}),a(13,"mat-select-trigger"),h(14,Nf,3,4,"ng-container",17),l(),a(15,"mat-option"),p(16),d(17,"translate"),l(),h(18,Ff,6,6,"mat-option",42),x(19,"mat-divider"),a(20,"mat-option",43),b("click",function(){f(e);let t=m();return v(t.createPrice())}),a(21,"mat-icon"),p(22,"open_in_new"),l(),a(23,"span"),p(24),d(25,"translate"),l()()()()()(),h(26,Lf,3,0,"div",44),S()}if(i&2){let e=r.$implicit,n=m();o(),E("disabled",n.pricesControls[e].disabled),o(2),g(" ",u(4,11,n.translatePrefix+"prices.price.label")," "),o(3),w(u(8,15,u(7,13,n.translatePrefix+"prices.price.unit."+e))),o(5),c("placeholder",u(12,17,n.translatePrefix+"prices.price.placeholder"))("formControl",n.pricesControls[e]),o(3),c("ngIf",n.getPrice(n.pricesControls[e]==null?null:n.pricesControls[e].value)),o(2),w(u(17,19,n.translatePrefix+"prices.price.none")),o(2),c("ngForOf",n.prices),o(6),w(u(25,21,n.translatePrefix+"prices.price.add")),o(2),c("ngIf",e===n.StripePriceUnit.UNIT)}}function Wf(i,r){i&1&&x(0,"mat-divider",49)}var Hr=(()=>{class i{set resourceSetter(e){this.resource=e,this.resource?.product||(this.opened=!1)}set selectionSetter(e){this.selectionControl.setValue(e)}get defaultImage(){return this.resource.type===je.WORKSPACE?"/assets/images/moffi-workspace.png":""}get stripeProductName(){return this.isAttached?this.api.integrationService.stripe.products?.find(e=>e.id===this.resource.product.productId)?.name:""}get isAttached(){return!!this.resource?.product}constructor(e,n){this.api=e,this.translate=n,this.StripeResourceType=je,this.StripePriceUnit=G,this.translatePrefix="components.integrations.page.stripe.resource.",this.fromResourcePage=!1,this.selectionChange=new L,this.change=new L,this.searchControl=new Oe(""),this.active=!1,this.opened=!1,this.pricesOpened=!1,this.selectionControl=new Oe(!1),this.products=[],this.prices=[],this.units=[G.HOUR,G.HALF_DAY,G.DAY,G.MONTH],this.pricesControls={[G.UNIT]:new Oe(null),[G.HOUR]:new Oe(null),[G.HALF_DAY]:new Oe(null),[G.DAY]:new Oe(null),[G.MONTH]:new Oe(null)}}ngOnInit(){return z(this,null,function*(){this.selectionControl.valueChanges.subscribe(e=>{this.selectionChange.emit(e)}),this.searchControl.valueChanges.subscribe(e=>{this.searchProducts(e)}),yield this.api.integrationService.stripe.init(),this.products=this.api.integrationService.stripe.products,this.resource.type===je.SERVICE&&(this.units=[G.UNIT,...this.units]);for(let e of this.units)this.pricesControls[e].valueChanges.subscribe(n=>this.priceChange(e,n));yield this.initProduct()})}initProduct(e){return z(this,null,function*(){if(this.resource.product){if(yield this.fetchPrices(e),this.resource.product?.prices)for(let n of this.units){let t=this.resource.product.prices.find(s=>s.unit===n);t?.priceId&&this.pricesControls[n].setValue(t?.priceId)}this.fromResourcePage&&(this.opened=!0),this.change.emit(this.resource)}})}menuOpened(){this.active=!0,this.searchControl.setValue("")}menuClosed(){this.active=!1}searchProducts(e){return z(this,null,function*(){this.products=this.api.integrationService.stripe.products,(e?.trim()?.length??0)>0&&(this.products=this.products.filter(n=>n.name.toLowerCase().includes(e.trim().toLowerCase())))})}createProduct(e){return z(this,null,function*(){let n={type:this.resource.type,resourceId:this.resource.id},t=yield this.api.integrationService.stripe.createProduct(n,e);this.resource.product=t,yield this.initProduct(e),this.opened=!0})}linkProduct(e,n){return z(this,null,function*(){this.resource.product={id:null,productId:e.id,prices:[]},yield this.fetchPrices(n),this.opened=!0,this.change.emit(this.resource)})}pricesOpenedChange(e){this.pricesOpened=e,e&&this.fetchPrices()}fetchPrices(e){return z(this,null,function*(){this.resource.product.stripeParametersId=this.api.company.parameters.stripeParameters.id;let n=yield this.api.integrationService.stripe.getProductPrices(this.resource.product,e);this.api.deepEqual(this.prices,n)||(this.prices=n)})}getPrice(e){return this.prices.find(n=>n.id===e)}detachProduct(e){return z(this,null,function*(){if(!this.resource.product||(this.resource.product?.prices?.length??0)>0&&!(yield bp.default.fire({title:this.translate.get("components.integrations.page.stripe.toast.detach.title"),html:this.translate.get("components.integrations.page.stripe.toast.detach.text."+this.resource.type.toLowerCase(),1),confirmButtonText:this.translate.get("components.integrations.page.stripe.toast.detach.actions.delete"),cancelButtonText:this.translate.get("components.integrations.page.stripe.toast.detach.actions.cancel"),confirmButtonColor:"#D3153B",showCancelButton:!0,reverseButtons:!0,focusCancel:!0,customClass:{popup:"swal-moffi"}})).isConfirmed)return;this.resource.product.id&&(yield this.api.integrationService.stripe.detach(this.resource.product.id,e)),this.resource.product=null;for(let t of this.units)this.pricesControls[t].setValue(null);let n={emitEvent:!1};this.pricesControls[G.UNIT].setValue(null,n),this.pricesControls[G.HOUR].setValue(null,n),this.pricesControls[G.HALF_DAY].setValue(null,n),this.pricesControls[G.DAY].setValue(null,n),this.pricesControls[G.MONTH].setValue(null,n),this.pricesControls[G.UNIT].enable(n),this.pricesControls[G.HOUR].enable(n),this.pricesControls[G.HALF_DAY].enable(n),this.pricesControls[G.DAY].enable(n),this.pricesControls[G.MONTH].enable(n),this.opened=!1,this.change.emit(this.resource)})}toggleOpened(){this.fromResourcePage||(this.isAttached?this.opened=!this.opened:this.opened=!1)}createPrice(){if(this.isAttached){let e=this.api.company.parameters.stripeParameters.live?"live":"test";window.open("https://dashboard.stripe.com/"+e+"/products/"+this.resource.product.productId,"_blank","noopener")}}priceChange(e,n){if(!this.resource.product)return;this.resource.product.prices=this.resource.product?.prices?.filter(_=>_.unit!==e)??[];let t=this.getPrice(n);t&&this.resource.product.prices.push({id:null,unit:e,priceId:t.id});let s={emitEvent:!1};e===G.UNIT?t?(this.pricesControls[G.HOUR].setValue(null,s),this.pricesControls[G.HALF_DAY].setValue(null,s),this.pricesControls[G.DAY].setValue(null,s),this.pricesControls[G.MONTH].setValue(null,s),this.pricesControls[G.HOUR].disable(s),this.pricesControls[G.HALF_DAY].disable(s),this.pricesControls[G.DAY].disable(s),this.pricesControls[G.MONTH].disable(s)):(this.pricesControls[G.HOUR].enable(s),this.pricesControls[G.HALF_DAY].enable(s),this.pricesControls[G.DAY].enable(s),this.pricesControls[G.MONTH].enable(s)):t?(this.pricesControls[G.UNIT].setValue(null,s),this.pricesControls[G.UNIT].disable(s)):!this.pricesControls[G.HOUR].value&&!this.pricesControls[G.HALF_DAY].value&&!this.pricesControls[G.DAY].value&&!this.pricesControls[G.MONTH].value&&this.pricesControls[G.UNIT].enable(),this.change.emit(this.resource)}refresh(e){return z(this,null,function*(){yield this.api.integrationService.stripe.getProducts(e),yield this.initProduct(e)})}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(U))}}static{this.\u0275cmp=P({type:i,selectors:[["app-stripe-resource"]],inputs:{resourceSetter:[0,"resource","resourceSetter"],fromResourcePage:"fromResourcePage",selectionSetter:[0,"selection","selectionSetter"]},outputs:{selectionChange:"selectionChange",change:"change"},decls:39,vars:42,consts:[["linkButton",""],["linkMenu","matMenu"],["searchInput",""],[1,"stripe-resource",3,"ngClass"],[1,"row","align-items-center","resource",3,"click","ngClass"],["class","col-auto",4,"ngIf"],["class","col-auto px-0",4,"ngIf"],["id","action",1,"col","text-end"],["iconName","link","type","FILLED_TONAL",3,"menuOpened","menuClosed","textKey","matMenuTriggerFor"],[1,"stripe-products-menu"],["appearance","fill",1,"w-100","stripe-product-search","mat-form-field-no-label",3,"click"],["matPrefix",""],["matInput","","type","search",3,"keydown","placeholder","formControl"],["id","stripe-products"],["disabled","","mat-menu-item","",4,"ngIf"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["mat-menu-item","",3,"click"],[4,"ngIf"],[1,"prices"],[1,"row","align-items-center"],[1,"col"],["class","row mt-3 price service-prices-info",4,"ngIf"],[4,"ngFor","ngForOf"],["class","resource-divider",4,"ngIf"],[1,"col-auto"],[3,"click","formControl"],[1,"col-auto","px-0"],[1,"resource-picture","d-flex"],["alt","Resource picture",1,"m-auto",3,"src"],[1,"resource-name"],["class","resource-prices",4,"ngIf"],[1,"resource-prices"],["disabled","","mat-menu-item",""],[1,"row","align-items-center","g-0"],[1,"col-auto",2,"padding-right","4px"],["iconName","link_off","type","FILLED_TONAL",1,"show-hover",3,"click","clicked","rounded","matTooltip"],["iconName","sync","type","FILLED_TONAL",3,"click","clicked","textKey"],[1,"row","mt-3","price","service-prices-info"],[1,"row","mt-3","align-items-center","price"],[1,"col-4"],["floatLabel","auto",1,"w-100"],["panelClass","stripe-resource-prices",3,"openedChange","click","placeholder","formControl"],[3,"value",4,"ngFor","ngForOf"],[3,"click"],["class","row mt-3 price",4,"ngIf"],[3,"value"],[1,"row","mt-3","price"],[1,"col-6"],[1,"divider-dashed"],[1,"resource-divider"]],template:function(n,t){if(n&1){let s=k();a(0,"div",3),d(1,"lowercase"),a(2,"div",4),d(3,"lowercase"),b("click",function(){return f(s),v(t.toggleOpened())}),h(4,Sf,2,1,"div",5)(5,Mf,4,6,"div",6)(6,Tf,5,3,"div",5),a(7,"div",7)(8,"div")(9,"app-button",8,0),d(11,"translate"),b("menuOpened",function(){return f(s),v(t.menuOpened())})("menuClosed",function(){return f(s),v(t.menuClosed())}),l(),a(12,"mat-menu",9,1)(14,"mat-form-field",10),b("click",function(C){return f(s),v(C.stopPropagation())}),a(15,"mat-icon",11),p(16,"search"),l(),a(17,"input",12,2),d(19,"translate"),b("keydown",function(C){return f(s),v(C.stopPropagation())}),l()(),x(20,"mat-divider"),a(21,"div",13),h(22,Df,4,3,"button",14)(23,Of,2,1,"button",15),l(),x(24,"mat-divider"),a(25,"button",16),b("click",function(){f(s);let C=V(10);return v(t.createProduct(C))}),a(26,"mat-icon"),p(27,"add"),l(),a(28,"span"),p(29),d(30,"translate"),l()()()(),h(31,Vf,7,10,"ng-container",17),l()(),a(32,"div",18)(33,"div",19)(34,"div",20),x(35,"mat-divider"),l()(),h(36,Rf,9,9,"div",21)(37,qf,27,23,"ng-container",22),l(),h(38,Wf,1,0,"mat-divider",23),l()}if(n&2){let s,_=V(13);E("active",t.active)("selected",t.selectionControl.value)("opened",t.opened)("from-resource-page",t.fromResourcePage)("prices-opened",t.pricesOpened),c("ngClass",u(1,32,t.resource.type)),o(2),E("c-pointer",t.isAttached&&!t.fromResourcePage),c("ngClass",u(3,34,t.resource.type)),o(2),c("ngIf",!t.fromResourcePage),o(),c("ngIf",!t.fromResourcePage),o(),c("ngIf",t.isAttached||!t.fromResourcePage),o(2),E("d-none",t.isAttached),o(),E("show-hover",!t.fromResourcePage),c("textKey",u(11,36,t.translatePrefix+"actions.link"))("matMenuTriggerFor",_),o(8),c("placeholder",u(19,38,t.translatePrefix+"search.placeholder"))("formControl",t.searchControl),o(5),c("ngIf",((s=t.products==null?null:t.products.length)!==null&&s!==void 0?s:0)===0),o(),c("ngForOf",t.products),o(6),w(u(30,40,t.translatePrefix+"actions.create")),o(2),c("ngIf",t.isAttached),o(5),c("ngIf",t.resource.type===t.StripeResourceType.SERVICE),o(),c("ngForOf",t.units),o(),c("ngIf",!t.opened&&!t.fromResourcePage)}},dependencies:[ce,j,R,fe,ee,Be,dt,$,st,ae,Pi,ve,Kt,Gt,It,We,Oi,Le,Te,H,kt,Xe,ri,N],styles:[".stripe-resource[_ngcontent-%COMP%]{margin:0 -15px;padding:0 15px}.stripe-resource[_ngcontent-%COMP%]   .resource[_ngcontent-%COMP%]{padding:12px 0}.stripe-resource[_ngcontent-%COMP%]   .resource[_ngcontent-%COMP%]   .resource-picture[_ngcontent-%COMP%]{border-radius:8px;width:76px;height:58px}.stripe-resource[_ngcontent-%COMP%]   .resource[_ngcontent-%COMP%]   .resource-picture[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{max-width:76px;max-height:58px;border-radius:8px}.stripe-resource[_ngcontent-%COMP%]   .resource[_ngcontent-%COMP%]   .resource-prices[_ngcontent-%COMP%]{color:var(--primary-color-500)}.stripe-resource[_ngcontent-%COMP%]   .resource.service[_ngcontent-%COMP%]   .resource-picture[_ngcontent-%COMP%]{background:#f8f9f9}.stripe-resource[_ngcontent-%COMP%]   .resource.service[_ngcontent-%COMP%]   .resource-picture[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{max-width:40px;max-height:40px;opacity:.5;border-radius:0}.stripe-resource[_ngcontent-%COMP%]   .show-hover[_ngcontent-%COMP%]{display:none!important}.stripe-resource[_ngcontent-%COMP%]   .prices[_ngcontent-%COMP%]{transition:height .25s linear;height:0;padding:0;overflow:hidden}.stripe-resource[_ngcontent-%COMP%]   .prices[_ngcontent-%COMP%]  .mat-mdc-form-field-wrapper{padding-bottom:0}.stripe-resource[_ngcontent-%COMP%]   .price[_ngcontent-%COMP%]{padding-left:36px}.stripe-resource[_ngcontent-%COMP%]   .price.disabled[_ngcontent-%COMP%]{color:var(--neutral-color-500)}.stripe-resource[_ngcontent-%COMP%]   .service-prices-info[_ngcontent-%COMP%]{font-size:16px;font-weight:400}.stripe-resource[_ngcontent-%COMP%]   .service-prices-info[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{font-weight:700}.stripe-resource[_ngcontent-%COMP%]   .divider-dashed[_ngcontent-%COMP%]{border-top-style:dashed;border-color:#c5cbec}.stripe-resource[_ngcontent-%COMP%]:hover   .resource[_ngcontent-%COMP%], .stripe-resource.active[_ngcontent-%COMP%]   .resource[_ngcontent-%COMP%], .stripe-resource.prices-opened[_ngcontent-%COMP%]   .resource[_ngcontent-%COMP%]{box-shadow:0 2px 12px 0 var(--primary-color-600-10)}.stripe-resource[_ngcontent-%COMP%]:hover   .show-hover[_ngcontent-%COMP%], .stripe-resource.active[_ngcontent-%COMP%]   .show-hover[_ngcontent-%COMP%], .stripe-resource.prices-opened[_ngcontent-%COMP%]   .show-hover[_ngcontent-%COMP%]{display:inline-block!important}.stripe-resource.selected[_ngcontent-%COMP%], .stripe-resource.opened[_ngcontent-%COMP%]{background-color:var(--primary-color-600-05)}.stripe-resource.opened[_ngcontent-%COMP%]{border:2px solid #074dce}.stripe-resource.opened[_ngcontent-%COMP%]   .prices[_ngcontent-%COMP%]{height:310px}.stripe-resource.opened.service[_ngcontent-%COMP%]   .prices[_ngcontent-%COMP%]{height:360px}.stripe-resource.from-resource-page[_ngcontent-%COMP%]{border:none!important;background:transparent!important}.stripe-resource.from-resource-page[_ngcontent-%COMP%]   .resource[_ngcontent-%COMP%]{box-shadow:none!important}.stripe-resource.from-resource-page[_ngcontent-%COMP%]   .price[_ngcontent-%COMP%]{padding-left:0!important}.stripe-resource[_ngcontent-%COMP%]   .resource-divider[_ngcontent-%COMP%]{margin-left:-15px;margin-right:-15px}  .stripe-resource-prices{color:var(--primary-color-1000);font-size:16px;font-weight:400}  .stripe-resource-prices .mat-mdc-option-text{line-height:18px}  .stripe-resource-prices small{color:var(--primary-color-500);font-size:14px;font-weight:400}  .stripe-resource-prices mat-icon{font-size:20px!important;height:20px;width:20px}  .stripe-products-menu{overflow-x:hidden!important}  .stripe-products-menu .stripe-product-search .mdc-line-ripple{display:none}  .stripe-products-menu #stripe-products{max-height:250px;overflow:auto}  .stripe-products-menu .mat-divider{margin:8px 0}  .stripe-products-menu mat-icon{font-size:20px!important;height:20px;width:20px}"]})}}return i})();var Yr=class{};var os=function(i){return i.STRIPE_ALREADY_LINKED="STRIPE_ALREADY_LINKED",i.STRIPE_INVALID_API_KEY="STRIPE_INVALID_API_KEY",i}(os||{});var Gr=class{constructor(){this.first=!0,this.last=!0,this.number=0,this.numberOfElements=0,this.size=10,this.totalElements=0,this.totalPages=0,this.content=[]}};var To=Me(hi());var zf=()=>[1,2,3,4,5];function jf(i,r){i&1&&x(0,"app-tag",38),i&2&&c("marginBottom",!1)}function Qf(i,r){i&1&&x(0,"app-tag",39),i&2&&c("marginBottom",!1)}function Hf(i,r){if(i&1&&(a(0,"div",3),h(1,jf,1,1,"app-tag",36)(2,Qf,1,1,"app-tag",37),l()),i&2){let e=m();o(),c("ngIf",e.api.company.parameters==null||e.api.company.parameters.stripeParameters==null?null:e.api.company.parameters.stripeParameters.enabled),o(),c("ngIf",!(!(e.api.company.parameters==null||e.api.company.parameters.stripeParameters==null)&&e.api.company.parameters.stripeParameters.enabled))}}function Yf(i,r){if(i&1){let e=k();a(0,"app-button",40),b("clicked",function(t){f(e);let s=m();return v(s.disable(t))}),l()}}function Gf(i,r){if(i&1){let e=k();a(0,"app-button",41),b("clicked",function(t){f(e);let s=m();return v(s.enable(t))}),l()}}function Kf(i,r){if(i&1&&(p(0),d(1,"translate")),i&2){let e=m();w(u(1,1,e.translatePrefix+"credentials.title"))}}function $f(i,r){if(i&1){let e=k();a(0,"button",42),b("click",function(){f(e);let t=m();return v(t.clearKey(t.publishableKeyControl))}),x(1,"app-icon",43),l()}}function Xf(i,r){if(i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2){let e=m();o(),g(" ",u(2,1,e.translatePrefix+"credentials.errors.pattern.title")," ")}}function Jf(i,r){if(i&1){let e=k();a(0,"button",42),b("click",function(){f(e);let t=m();return v(t.clearKey(t.secretKeyControl))}),x(1,"app-icon",43),l()}}function Zf(i,r){if(i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2){let e=m();o(),g(" ",u(2,1,e.translatePrefix+"credentials.errors.invalid.title")," ")}}function e1(i,r){if(i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2){let e=m();o(),g(" ",u(2,1,e.translatePrefix+"credentials.errors.pattern.title")," ")}}function t1(i,r){if(i&1){let e=k();a(0,"div",44)(1,"div",3)(2,"div",45),d(3,"translate"),d(4,"translate"),a(5,"app-button",46),d(6,"translate"),b("clicked",function(t){f(e);let s=m();return v(s.link(t))}),l()()(),a(7,"div",3)(8,"app-button",47),d(9,"translate"),b("clicked",function(){f(e);let t=m();return v(t.register())}),l()()()}if(i&2){let e,n,t=m();o(2),c("popoverTitle",u(3,11,t.translatePrefix+"credentials.errors.required.title"))("ngbPopover",u(4,13,t.translatePrefix+"credentials.errors.required.description"))("disablePopover",((e=t.secretKeyControl.value==null?null:t.secretKeyControl.value.length)!==null&&e!==void 0?e:0)>0),o(3),c("textKey",u(6,15,t.translatePrefix+"credentials.actions.link"))("inputHeight",!0)("isDisabled",((n=t.secretKeyControl.value==null?null:t.secretKeyControl.value.length)!==null&&n!==void 0?n:0)===0||!t.secretKeyControl.valid),o(3),c("textKey",u(9,17,t.translatePrefix+"credentials.actions.register"))("inputHeight",!0)("noBold",!0)("noActiveBorders",!0)("paddingX",!1)}}function i1(i,r){if(i&1&&(a(0,"div",48)(1,"div",3),x(2,"app-icon",49),l(),a(3,"div",3),p(4),d(5,"translate"),l()()),i&2){let e=m();o(4),g(" ",u(5,1,e.translatePrefix+"credentials.linked")," ")}}function n1(i,r){if(i&1&&(p(0),d(1,"translate")),i&2){let e=m();g(" ",u(1,1,e.translatePrefix+"association.title")," ")}}function o1(i,r){if(i&1&&(a(0,"mat-option",66),d(1,"lowercase"),p(2),d(3,"lowercase"),d(4,"translate"),l()),i&2){let e=r.$implicit,n=m(2);c("value",u(1,2,e.value)),o(2),w(u(4,6,u(3,4,n.translatePrefix+"association.actions.filter."+n.resourceType+".options."+e.label)))}}function r1(i,r){if(i&1){let e=k();M(0),a(1,"div",50)(2,"div",3)(3,"mat-checkbox",51),b("change",function(t){f(e);let s=m();return v(s.selectionChange(t))}),l()(),a(4,"div",3)(5,"app-button",52),d(6,"translate"),b("clicked",function(t){f(e);let s=m();return v(s.multipleLink(t))}),l()(),a(7,"div",3)(8,"app-button",53),d(9,"translate"),b("clicked",function(t){f(e);let s=m();return v(s.multipleUnlink(t))}),l()(),a(10,"div",3),x(11,"mat-divider",54),l(),a(12,"div",3)(13,"app-button",55),d(14,"translate"),b("clicked",function(t){f(e);let s=m();return v(s.refresh(t))}),l()(),a(15,"div",56)(16,"mat-form-field",57)(17,"mat-label"),p(18),d(19,"lowercase"),d(20,"translate"),l(),a(21,"mat-select",58)(22,"mat-option",59),p(23),d(24,"lowercase"),d(25,"translate"),l(),h(26,o1,5,8,"mat-option",60),l()()()(),a(27,"div",61)(28,"div",62),x(29,"img",63),l(),a(30,"div",3),x(31,"img",64),l()(),x(32,"mat-divider",65),S()}if(i&2){let e=m();o(3),c("indeterminate",e.isIndeterminateState)("checked",e.isCheckedState),o(2),c("textKey",u(6,13,e.translatePrefix+"association.actions.multiple_link"))("isDisabled",e.resourceSelection.isEmpty()),o(3),c("textKey",u(9,15,e.translatePrefix+"association.actions.multiple_unlink"))("isDisabled",e.resourceSelection.isEmpty()),o(3),c("vertical",!0),o(2),c("textKey",u(14,17,e.translatePrefix+"association.actions.refresh"))("isDisabled",e.loading),o(5),g(" ",u(20,21,u(19,19,e.translatePrefix+"association.actions.filter."+e.resourceType+".label"))," "),o(3),c("formControl",e.resourceTypeControl),o(2),g(" ",u(25,25,u(24,23,e.translatePrefix+"association.actions.filter."+e.resourceType+".options.all"))," "),o(3),c("ngForOf",e.resourceTypeOptions)}}function a1(i,r){i&1&&x(0,"app-stripe-resource-placeholder")(1,"mat-divider",67)}function s1(i,r){i&1&&Wt(0,a1,2,0,null,null,qt),i&2&&Ut(X(0,zf))}function l1(i,r){if(i&1){let e=k();M(0),a(1,"app-stripe-resource",74),b("selectionChange",function(t){let s=f(e).$implicit,_=m(3);return v(_.selectChange(s,t))}),l(),S()}if(i&2){let e=r.$implicit,n=m(3);o(),c("resource",e)("selection",n.resourceSelection.isSelected(e.id))}}function c1(i,r){if(i&1&&(a(0,"div",70)(1,"div",71)(2,"div",72),h(3,l1,2,2,"ng-container",73),l()()()),i&2){let e=m(2);o(3),c("ngForOf",e.resources)}}function p1(i,r){if(i&1){let e=k();a(0,"div",75)(1,"div",76)(2,"div",12),p(3),d(4,"lowercase"),d(5,"translate"),l()(),a(6,"div",33)(7,"div",3)(8,"app-button",77),d(9,"lowercase"),d(10,"translate"),b("clicked",function(){f(e);let t=m(2);return v(t.createResource())}),l()()()()}if(i&2){let e=m(2);o(3),g(" ",u(5,7,u(4,5,e.translatePrefix+"association.empty."+e.resourceType+".text"))," "),o(5),c("textKey",u(10,11,u(9,9,e.translatePrefix+"association.empty."+e.resourceType+".action")))("noBold",!0)("noActiveBorders",!0)("paddingX",!1)}}function d1(i,r){if(i&1&&h(0,c1,4,1,"div",68)(1,p1,11,13,"div",69),i&2){let e=m();c("ngIf",(e.resources==null?null:e.resources.length)>0),o(),c("ngIf",(e.resources==null?null:e.resources.length)===0)}}var EI=(()=>{class i{constructor(e,n,t){this.api=e,this.router=n,this.translate=t,this.translatePrefix="components.integrations.page.stripe.",this.publishableKeyControl=new Oe("",{validators:[W.required,W.pattern("^(pk_(live|test)_.+)$")]}),this.secretKeyControl=new Oe("",{validators:[W.required,W.pattern("^(STRIPE_API_KEY_ALREADY_SET|sk_(live|test)_.+)$")]}),this.resourceTypeControl=new Oe("",{}),this.resourceTypesOptions={[je.WORKSPACE]:[],[je.SERVICE]:[]},this.resourceTypeOptions=this.resourceTypesOptions[je.WORKSPACE],this.loading=!0,this.refreshEmitter=new L,this.resourceType=je.WORKSPACE,this.allResources=[],this.resources=[],this.resourceSelection=new Os(!0)}ngOnInit(){return z(this,null,function*(){this.api.integrationService.stripe.init(!0);let e=yield this.api.integrationService.stripe.getResourceTypes(),n=yield this.api.servicesService.getServicesTree();this.resourceTypesOptions[je.WORKSPACE]=e.workspaceTypes.filter(t=>t!=="cafeteria").map(t=>({label:t,value:t,localeLabel:this.translate.get(this.translatePrefix+"association.actions.filter.workspace.options."+t)})).sort((t,s)=>t.localeLabel.localeCompare(s.localeLabel)),this.resourceTypesOptions[je.SERVICE]=e.serviceTypes.map(t=>{let s=n.find(_=>_.id===t);return{label:s.name,value:s.id,localeLabel:this.translate.get(this.translatePrefix+"association.actions.filter.service.options."+s.name.toLowerCase())}}).sort((t,s)=>t.localeLabel.localeCompare(s.localeLabel)),this.resourceTypeOptions=this.resourceTypesOptions[je.WORKSPACE]})}ngAfterViewInit(){this.initResourceSearch();let e=this.stripeParameters;e&&(this.publishableKeyControl.setValue(e.publishableKey),this.secretKeyControl.setValue(e.secretKey),e.publishableKey&&e.secretKey&&(this.stepper.next(),this.refresh())),this.resourceTypeControl.valueChanges.subscribe(()=>{this.resourceSelection.clear()})}get stripeParameters(){return this.api.company?.parameters?.stripeParameters}doc(){window.open(this.translate.get(this.translatePrefix+"documentation.url"),"_blank")}remove(e){return z(this,null,function*(){(yield To.default.fire({title:this.translate.get(this.translatePrefix+"toast.unlink.title"),html:this.translate.get(this.translatePrefix+"toast.unlink.text"),confirmButtonText:this.translate.get(this.translatePrefix+"toast.unlink.actions.disable"),cancelButtonText:this.translate.get(this.translatePrefix+"toast.unlink.actions.cancel"),confirmButtonColor:"#D3153B",showCancelButton:!0,reverseButtons:!0,focusCancel:!0,customClass:{popup:"swal-moffi"}})).isConfirmed&&(yield this.api.integrationService.stripe.unlink(e?.button),this.api.company.parameters.stripeParameters=null,this.back())})}disable(e){return z(this,null,function*(){(yield To.default.fire({title:this.translate.get(this.translatePrefix+"toast.disable.title"),html:this.translate.get(this.translatePrefix+"toast.disable.text"),confirmButtonText:this.translate.get(this.translatePrefix+"toast.disable.actions.disable"),cancelButtonText:this.translate.get(this.translatePrefix+"toast.disable.actions.cancel"),confirmButtonColor:"#D3153B",showCancelButton:!0,reverseButtons:!0,focusCancel:!0,customClass:{popup:"swal-moffi"}})).isConfirmed&&(yield this.api.integrationService.stripe.disable(e?.button))})}enable(e){return z(this,null,function*(){yield this.api.integrationService.stripe.enable(e?.button)})}get keysDefined(){return(this.publishableKeyControl?.value?.length??0)>0&&this.secretKeyControl?.value==="STRIPE_API_KEY_ALREADY_SET"}clearKey(e){e.setValue("")}link(e){return z(this,null,function*(){let n={publishableKey:this.publishableKeyControl.value,secretKey:this.secretKeyControl.value,companyId:this.api.company.id};try{let t=yield this.api.integrationService.stripe.link(n,e?.button);this.api.company.parameters.stripeParameters=t,this.refresh(),setTimeout(()=>{this.stepper.next()},1e3)}catch(t){t.error===os.STRIPE_INVALID_API_KEY&&this.secretKeyControl.setErrors({invalid:!0})}})}register(){window.open("https://dashboard.stripe.com/register","_blank","noopener")}selectedTabChange(e){this.loading=!0,this.resourceType=e.index===0?je.WORKSPACE:je.SERVICE,this.refresh()}selectionChange(e){e.checked?this.resourceSelection.select(...this.resources.map(n=>n.id)):this.resourceSelection.clear()}get isIndeterminateState(){return!this.resourceSelection.isEmpty()&&this.resourceSelection.selected.length<this.resources.length}get isCheckedState(){return!this.resourceSelection.isEmpty()&&this.resourceSelection.selected.length>=this.resources.length}selectChange(e,n){n?this.resourceSelection.select(e.id):this.resourceSelection.deselect(e.id)}multipleLink(e){return z(this,null,function*(){let t=this.resources.filter(s=>this.resourceSelection.isSelected(s.id)&&!s.product).map(s=>({type:s.type,resourceId:s.id}));yield this.api.integrationService.stripe.patchProducts({link:t},e?.button),this.resourceSelection.clear(),this.refresh(!1)})}multipleUnlink(e){return z(this,null,function*(){let n=this.resources.filter(t=>this.resourceSelection.isSelected(t.id)&&t.product);if(n.length>0){if(n.filter(_=>(_.product?.prices?.length??0)>0).length>0&&!(yield To.default.fire({title:this.translate.get(this.translatePrefix+"toast.detach.title"),html:this.translate.get(this.translatePrefix+"toast.detach.text."+this.resourceType.toLowerCase(),n.length),confirmButtonText:this.translate.get(this.translatePrefix+"toast.detach.actions.delete"),cancelButtonText:this.translate.get(this.translatePrefix+"toast.detach.actions.cancel"),confirmButtonColor:"#D3153B",showCancelButton:!0,reverseButtons:!0,focusCancel:!0,customClass:{popup:"swal-moffi"}})).isConfirmed)return;let s=n.filter(_=>_.product?.id).map(_=>_.product);yield this.api.integrationService.stripe.patchProducts({unlink:s},e?.button)}this.resourceSelection.clear(),this.resources=this.resources.map(t=>n.find(s=>s.id===t.id)?Cn(ot({},t),{product:null}):t),this.allResources=this.allResources.map(t=>n.find(s=>s.id===t.id)?Cn(ot({},t),{product:null}):t)})}clearFilters(){this.resourceTypeControl.setValue(""),this.resourceTypeOptions=this.resourceTypesOptions[this.resourceType],this.resourceSelection.clear()}refresh(e=!0){this.loading=!0,e&&this.clearFilters(),this.api.integrationService.stripe.getProducts(),this.refreshEmitter.emit()}createResource(){let e="pages.user.workspaces.submit.metadata.url";this.resourceType===je.SERVICE&&(e="pages.dashboard.services.index.metadata.url"),this.router.navigate([this.translate.get(e)])}initResourceSearch(){pi(this.refreshEmitter,this.resourceTypeControl.valueChanges).pipe(gs(()=>{this.loading=!0}),_s(250),kn(()=>{this.loading=!0;let e={companyId:this.api.company.id,type:this.resourceType,resourceType:this.resourceTypeControl.value},n={page:0,size:5e3};return this.api.integrationService.stripe.searchResources(e,n)}),yn(e=>{console.error(e);let n=new Yr;return n.resources=new Gr,Ji(n)})).subscribe(e=>{this.page=e.resources,this.resources=e.resources.content,this.resources.forEach(n=>{let t=this.allResources.find(s=>s.id===n.id);t?.product?n.product=t.product:t||this.allResources.push(n)}),this.loading=!1})}back(){this.router.navigate([this.translate.get("pages.dashboard.company.parameters.metadata.url")])}get saveBtnDisabled(){return!this.api.company?.parameters?.stripeParameters}save(e){return z(this,null,function*(){let n=this.allResources.filter(s=>s.product);n.filter(s=>(s.product?.prices?.length??0)===0).length>0&&!(yield To.default.fire({title:this.translate.get(this.translatePrefix+"toast.missing-price.title"),html:this.translate.get(this.translatePrefix+"toast.missing-price.text"),confirmButtonText:this.translate.get(this.translatePrefix+"toast.missing-price.actions.save"),cancelButtonText:this.translate.get(this.translatePrefix+"toast.missing-price.actions.cancel"),confirmButtonColor:"#D3153B",showCancelButton:!0,reverseButtons:!0,focusCancel:!0,customClass:{popup:"swal-moffi"}})).isConfirmed||(yield this.api.integrationService.stripe.save(n,e?.button),this.back())})}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(mt),y(U))}}static{this.\u0275cmp=P({type:i,selectors:[["app-stripe"]],viewQuery:function(n,t){if(n&1&&A(Jt,5),n&2){let s;D(s=O())&&(t.stepper=s.first)}},decls:79,vars:54,consts:[["stepper",""],[1,"my-3"],[1,"row","w-100","g-0","align-items-center","justify-content-between"],[1,"col-auto"],[1,"row","align-items-center"],[3,"src","alt"],[1,"mat-title-large"],["class","col-auto",4,"ngIf"],["iconName","block","textKey","components.integrations.page.disable","type","SECONDARY",3,"clicked",4,"ngIf"],["iconName","enable","textKey","components.integrations.page.enable","type","SECONDARY",3,"clicked",4,"ngIf"],["iconName","delete","textKey","components.integrations.page.delete","type","SECONDARY",3,"clicked"],[1,"row","mt-3"],[1,"col"],[1,"row","my-3"],["iconName","open_in_new","type","FILLED_TONAL",3,"clicked","textKey"],["id","content",1,"row"],[3,"linear"],[3,"completed"],["matStepLabel",""],[1,"row","mt-3","align-items-center"],[1,"row","mt-4","align-items-center"],[1,"col-4"],[1,"w-100"],["matInput","","type","text",3,"formControl","readonly","placeholder"],["mat-icon-button","","matSuffix","",3,"click",4,"ngIf"],[4,"ngIf"],["matInput","",3,"formControl","type","readonly","placeholder"],["class","row mb-3",4,"ngIf"],["class","row mb-3 align-items-center linked g-0",4,"ngIf"],["id","association",1,"container-fluid"],["mat-stretch-tabs","false",1,"mb-3",3,"selectedTabChange"],[3,"label"],[1,"container"],[1,"row","align-items-center","justify-content-center"],["id","stripe-back-btn","textKey","global.back","type","SECONDARY",3,"clicked","inputHeight"],["id","stripe-save-btn","textKey","global.save","type","PRIMARY",3,"clicked","inputHeight","isDisabled"],["key","components.integrations.card.enable","color","#1277C7",3,"marginBottom",4,"ngIf"],["key","components.integrations.card.disable","color","#6D7278",3,"marginBottom",4,"ngIf"],["key","components.integrations.card.enable","color","#1277C7",3,"marginBottom"],["key","components.integrations.card.disable","color","#6D7278",3,"marginBottom"],["iconName","block","textKey","components.integrations.page.disable","type","SECONDARY",3,"clicked"],["iconName","enable","textKey","components.integrations.page.enable","type","SECONDARY",3,"clicked"],["mat-icon-button","","matSuffix","",3,"click"],["iconName","cancel"],[1,"row","mb-3"],["placement","top","container","body","triggers","mouseenter:mouseleave",3,"popoverTitle","ngbPopover","disablePopover"],["id","stripe-credentials-btn","type","PRIMARY",3,"clicked","textKey","inputHeight","isDisabled"],["id","stripe-save-btn","type","TERTIARY",3,"clicked","textKey","inputHeight","noBold","noActiveBorders","paddingX"],[1,"row","mb-3","align-items-center","linked","g-0"],["iconName","check","iconColor","var(--primary-color-500)"],["id","association-bar",1,"row","align-items-center","g-0"],[3,"change","indeterminate","checked"],["iconName","add","type","FILLED_TONAL",3,"clicked","textKey","isDisabled"],["iconName","link_off","type","FILLED_TONAL",3,"clicked","textKey","isDisabled"],[3,"vertical"],["iconName","sync","type","FILLED_TONAL",3,"clicked","textKey","isDisabled"],[1,"col","text-end","me-0"],[1,"stripe-resource-type-filter"],[3,"formControl"],["value",""],[3,"value",4,"ngFor","ngForOf"],["id","header-bar",1,"row","align-items-center","justify-content-between"],[1,"col-auto","ps-0"],["src","/assets/images/integrations/stripe/moffi.svg","alt","MOFFI"],["src","/assets/images/integrations/stripe/stripe.svg","alt","Stripe"],[1,"resource-divider","me-0"],[3,"value"],[1,"resource-divider"],["class","row",4,"ngIf"],["id","empty-resources",4,"ngIf"],[1,"row"],[1,"col","ps-0"],["id","resources",1,"container-fluid"],[4,"ngFor","ngForOf"],[3,"selectionChange","resource","selection"],["id","empty-resources"],[1,"row","align-items-center","text-center"],["type","TERTIARY",3,"clicked","textKey","noBold","noActiveBorders","paddingX"]],template:function(n,t){if(n&1){let s=k();a(0,"mat-card",1)(1,"mat-card-header")(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",3),x(6,"img",5),d(7,"translate"),l(),a(8,"div",3)(9,"h5",6),p(10),d(11,"translate"),l()(),h(12,Hf,3,2,"div",7),l()(),a(13,"div",3)(14,"div",4)(15,"div",3),h(16,Yf,1,0,"app-button",8)(17,Gf,1,0,"app-button",9),l(),a(18,"div",3)(19,"app-button",10),b("clicked",function(C){return f(s),v(t.remove(C))}),l()()()()()(),a(20,"mat-card-content")(21,"div",11)(22,"div",12),p(23),d(24,"translate"),l()(),a(25,"div",13)(26,"div",12)(27,"app-button",14),b("clicked",function(){return f(s),v(t.doc())}),l()()(),a(28,"div",15)(29,"div",12)(30,"mat-vertical-stepper",16,0)(32,"mat-step",17),h(33,Kf,2,3,"ng-template",18),a(34,"div",19)(35,"div",3),p(36),d(37,"translate"),l()(),a(38,"div",20)(39,"div",21)(40,"mat-form-field",22)(41,"mat-label"),p(42),d(43,"translate"),l(),x(44,"input",23),d(45,"translate"),h(46,$f,2,0,"button",24)(47,Xf,3,3,"mat-error",25),l()()(),a(48,"div",19)(49,"div",21)(50,"mat-form-field",22)(51,"mat-label"),p(52),d(53,"translate"),l(),x(54,"input",26),d(55,"translate"),h(56,Jf,2,0,"button",24)(57,Zf,3,3,"mat-error",25)(58,e1,3,3,"mat-error",25),l()()(),h(59,t1,10,19,"div",27)(60,i1,6,3,"div",28),l(),a(61,"mat-step")(62,"section",29),h(63,n1,2,3,"ng-template",18),a(64,"mat-tab-group",30),b("selectedTabChange",function(C){return f(s),v(t.selectedTabChange(C))}),x(65,"mat-tab",31),d(66,"translate"),x(67,"mat-tab",31),d(68,"translate"),l(),h(69,r1,33,27,"ng-container",25)(70,s1,2,1)(71,d1,2,2),l()()()()()(),a(72,"mat-card-actions")(73,"div",32)(74,"div",33)(75,"div",3)(76,"app-button",34),b("clicked",function(){return f(s),v(t.back())}),l()(),a(77,"div",3)(78,"app-button",35),b("clicked",function(C){return f(s),v(t.save(C))}),l()()()()()()}if(n&2){let s,_;o(6),c("src","/assets/images/icons/integrations/stripe.svg",K)("alt",u(7,34,t.translatePrefix+"title")),o(4),w(u(11,36,t.translatePrefix+"title")),o(2),c("ngIf",t.api.company.parameters==null?null:t.api.company.parameters.stripeParameters),o(4),c("ngIf",t.api.company.parameters==null||t.api.company.parameters.stripeParameters==null?null:t.api.company.parameters.stripeParameters.enabled),o(),c("ngIf",!(!(t.api.company.parameters==null||t.api.company.parameters.stripeParameters==null)&&t.api.company.parameters.stripeParameters.enabled)),o(6),w(u(24,38,t.translatePrefix+"description")),o(4),c("textKey",t.translatePrefix+"documentation.title"),o(3),c("linear",!0),o(2),c("completed",t.stripeParameters==null?null:t.stripeParameters.secretKey),o(4),g(" ",u(37,40,t.translatePrefix+"credentials.info")," "),o(6),w(u(43,42,t.translatePrefix+"credentials.publishable_key.label")),o(2),c("formControl",t.publishableKeyControl)("readonly",t.keysDefined)("placeholder",u(45,44,t.translatePrefix+"credentials.publishable_key.placeholder")),o(2),c("ngIf",((s=t.publishableKeyControl==null||t.publishableKeyControl.value==null?null:t.publishableKeyControl.value.length)!==null&&s!==void 0?s:0)>0&&!t.keysDefined),o(),c("ngIf",t.publishableKeyControl.hasError("pattern")),o(5),w(u(53,46,t.translatePrefix+"credentials.secret_key.label")),o(2),c("formControl",t.secretKeyControl)("type",t.keysDefined?"password":"text")("readonly",t.keysDefined)("placeholder",u(55,48,t.translatePrefix+"credentials.secret_key.placeholder")),o(2),c("ngIf",((_=t.secretKeyControl==null||t.secretKeyControl.value==null?null:t.secretKeyControl.value.length)!==null&&_!==void 0?_:0)>0&&!t.keysDefined),o(),c("ngIf",t.secretKeyControl.hasError("invalid")),o(),c("ngIf",t.secretKeyControl.hasError("pattern")),o(),c("ngIf",!t.stripeParameters),o(),c("ngIf",t.stripeParameters==null?null:t.stripeParameters.secretKey),o(5),c("label",u(66,50,t.translatePrefix+"association.tabs.workspace")),o(2),c("label",u(68,52,t.translatePrefix+"association.tabs.service")),o(2),c("ngIf",t.loading||t.resources.length>0),o(),$e(t.loading?70:71),o(6),c("inputHeight",!0),o(2),c("inputHeight",!0)("isDisabled",t.saveBtnDisabled)}},dependencies:[j,R,fe,ee,Be,dt,Di,On,al,Bn,An,st,ae,rt,St,Ti,ve,We,Le,Vi,Zt,zn,dr,Jt,H,ni,fr,Hr,vp,kt,N],styles:["mat-card[_ngcontent-%COMP%]{box-shadow:0 2px 8px #0000001a!important}h2[_ngcontent-%COMP%]{padding:0 8px}.h2-18[_ngcontent-%COMP%]{font-size:18px}b[_ngcontent-%COMP%]{font-weight:600}#content[_ngcontent-%COMP%]   .linked[_ngcontent-%COMP%]{font-size:14px;color:var(--primary-color-500)}#content[_ngcontent-%COMP%]   .linked[_ngcontent-%COMP%]   .col-auto[_ngcontent-%COMP%]:first-child{margin-right:4px}#content[_ngcontent-%COMP%]   .stripe-company-name[_ngcontent-%COMP%]{font-weight:600;border-radius:50px;border:1px solid var(--primary-color-200);padding:4px 8px}#content[_ngcontent-%COMP%]   #association[_ngcontent-%COMP%]{margin-bottom:0}#content[_ngcontent-%COMP%]   #association[_ngcontent-%COMP%]   #association-bar[_ngcontent-%COMP%]{margin-bottom:8px}#content[_ngcontent-%COMP%]   #association[_ngcontent-%COMP%]   #association-bar[_ngcontent-%COMP%]   .col-auto[_ngcontent-%COMP%]{margin-right:16px}#content[_ngcontent-%COMP%]   #association[_ngcontent-%COMP%]   #association-bar[_ngcontent-%COMP%]   mat-divider[_ngcontent-%COMP%]{height:16px;margin:0 8px}#content[_ngcontent-%COMP%]   #association[_ngcontent-%COMP%]   #header-bar[_ngcontent-%COMP%]{padding:12px 0 8px 40px}#content[_ngcontent-%COMP%]   #association[_ngcontent-%COMP%]   #empty-resources[_ngcontent-%COMP%]{margin:16px 0;color:var(--primary-color-500)}#content[_ngcontent-%COMP%]   #association[_ngcontent-%COMP%]   #resources[_ngcontent-%COMP%]{max-height:500px;overflow:auto}#content[_ngcontent-%COMP%]   #association[_ngcontent-%COMP%]   .resource-divider[_ngcontent-%COMP%]{margin-left:-15px;margin-right:-15px}.info[_ngcontent-%COMP%]{color:#dfa512;position:relative;top:-8px}"]})}}return i})();var yp=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[de,Ye,Ge,Qt,Ze,nt,Vn,Rn,at,Je,qn,$t,Qn,Xt,jn,Re,ji,Ae]})}}return i})();var Xr=new it("ngx-mat-date-formats"),Ct=class extends Ys{isSameTime(r,e){return r==null||e==null?!0:this.getHour(r)===this.getHour(e)&&this.getMinute(r)===this.getMinute(e)&&this.getSecond(r)===this.getSecond(e)}copyTime(r,e){this.setHour(r,this.getHour(e)),this.setMinute(r,this.getMinute(e)),this.setSecond(r,this.getSecond(e))}compareDateWithTime(r,e,n){let t=super.compareDate(r,e)||this.getHour(r)-this.getHour(e)||this.getMinute(r)-this.getMinute(e);return n&&(t=t||this.getSecond(r)-this.getSecond(e)),t}setTimeByDefaultValues(r,e){if(!Array.isArray(e))throw Error("@Input DefaultTime should be an array");this.setHour(r,e[0]||0),this.setMinute(r,e[1]||0),this.setSecond(r,e[2]||0)}},fn=class{constructor(r,e){this.start=r,this.end=e}},co=(()=>{class i{constructor(e,n){this.selection=e,this._adapter=n,this._selectionChanged=new xt,this.selectionChanged=this._selectionChanged,this.selection=e}updateSelection(e,n){let t=this.selection;this.selection=e,this._selectionChanged.next({selection:e,source:n,oldValue:t})}ngOnDestroy(){this._selectionChanged.complete()}_isValidDateInstance(e){return this._adapter.isDateInstance(e)&&this._adapter.isValid(e)}}return i.\u0275fac=function(e){bs()},i.\u0275prov=Ke({token:i,factory:i.\u0275fac}),i})(),u1=(()=>{class i extends co{constructor(e){super(null,e)}add(e){super.updateSelection(e,this)}isValid(){return this.selection!=null&&this._isValidDateInstance(this.selection)}isComplete(){return this.selection!=null}clone(){let e=new i(this._adapter);return e.updateSelection(this.selection,this),e}}return i.\u0275fac=function(e){return new(e||i)(ke(Ct))},i.\u0275prov=Ke({token:i,factory:i.\u0275fac}),i})(),_1=(()=>{class i extends co{constructor(e){super(new fn(null,null),e)}add(e){let{start:n,end:t}=this.selection;n==null?n=e:t==null?t=e:(n=e,t=null),super.updateSelection(new fn(n,t),this)}isValid(){let{start:e,end:n}=this.selection;return e==null&&n==null?!0:e!=null&&n!=null?this._isValidDateInstance(e)&&this._isValidDateInstance(n)&&this._adapter.compareDate(e,n)<=0:(e==null||this._isValidDateInstance(e))&&(n==null||this._isValidDateInstance(n))}isComplete(){return this.selection.start!=null&&this.selection.end!=null}clone(){let e=new i(this._adapter);return e.updateSelection(this.selection,this),e}}return i.\u0275fac=function(e){return new(e||i)(ke(Ct))},i.\u0275prov=Ke({token:i,factory:i.\u0275fac}),i})();function h1(i,r){return i||new u1(r)}var $E={provide:co,deps:[[new qo,new Wo,co],Ct],useFactory:h1};function g1(i,r){return i||new _1(r)}var XE={provide:co,deps:[[new qo,new Wo,co],Ct],useFactory:g1};function kp(i){return Error(`NgxMatDatetimePicker: No provider found for ${i}. You must import one of the following modules at your application root: NgxMatNativeDateModule, NgxMatMomentDateModule, or provide a custom implementation.`)}var wp=new it("NGX_MAT_DATE_RANGE_SELECTION_STRATEGY"),f1=(()=>{class i{constructor(e){this._dateAdapter=e}selectionFinished(e,n){let{start:t,end:s}=n;return t==null?t=e:s==null&&e&&this._dateAdapter.compareDate(e,t)>=0?s=e:(t=e,s=null),new fn(t,s)}createPreview(e,n){let t=null,s=null;return n.start&&!n.end&&e&&(t=n.start,s=e),new fn(t,s)}createDrag(e,n,t){let s=n.start,_=n.end;if(!s||!_)return null;let C=this._dateAdapter,I=C.compareDate(s,_)!==0,B=C.getYear(t)-C.getYear(e),Y=C.getMonth(t)-C.getMonth(e),ye=C.getDate(t)-C.getDate(e);return I&&C.sameDate(e,n.start)?(s=t,C.compareDate(t,_)>0&&(_=C.addCalendarYears(_,B),_=C.addCalendarMonths(_,Y),_=C.addCalendarDays(_,ye))):I&&C.sameDate(e,n.end)?(_=t,C.compareDate(t,s)<0&&(s=C.addCalendarYears(s,B),s=C.addCalendarMonths(s,Y),s=C.addCalendarDays(s,ye))):(s=C.addCalendarYears(s,B),s=C.addCalendarMonths(s,Y),s=C.addCalendarDays(s,ye),_=C.addCalendarYears(_,B),_=C.addCalendarMonths(_,Y),_=C.addCalendarDays(_,ye)),new fn(s,_)}}return i.\u0275fac=function(e){return new(e||i)(ke(Ct))},i.\u0275prov=Ke({token:i,factory:i.\u0275fac}),i})();function v1(i,r){return i||new f1(r)}var JE={provide:wp,deps:[[new qo,new Wo,wp],Ct],useFactory:v1};var b1=(()=>{class i{constructor(){this.changes=new xt,this.calendarLabel="Calendar",this.openCalendarLabel="Open calendar",this.closeCalendarLabel="Close calendar",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 24 years",this.nextMultiYearLabel="Next 24 years",this.switchToMonthViewLabel="Choose date",this.switchToMultiYearViewLabel="Choose month and year",this.startDateLabel="Start date",this.endDateLabel="End date"}formatYearRange(e,n){return`${e} \u2013 ${n}`}formatYearRangeLabel(e,n){return`${e} to ${n}`}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275prov=Ke({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();var gn;try{gn=typeof Intl<"u"}catch{gn=!1}var C1={long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],narrow:["J","F","M","A","M","J","J","A","S","O","N","D"]},x1=$r(31,i=>String(i+1)),y1={long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],narrow:["S","M","T","W","T","F","S"]},k1=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;function $r(i,r){let e=Array(i);for(let n=0;n<i;n++)e[n]=r(n);return e}var w1=(()=>{class i extends Ct{constructor(e,n){super(),this.useUtcForDisplay=!0,super.setLocale(e),this.useUtcForDisplay=!n.TRIDENT,this._clampDate=n.TRIDENT||n.EDGE}getYear(e){return e.getFullYear()}getMonth(e){return e.getMonth()}getDate(e){return e.getDate()}getDayOfWeek(e){return e.getDay()}getMonthNames(e){if(gn){let n=new Intl.DateTimeFormat(this.locale,{month:e,timeZone:"utc"});return $r(12,t=>this._stripDirectionalityCharacters(this._format(n,new Date(2017,t,1))))}return C1[e]}getDateNames(){if(gn){let e=new Intl.DateTimeFormat(this.locale,{day:"numeric",timeZone:"utc"});return $r(31,n=>this._stripDirectionalityCharacters(this._format(e,new Date(2017,0,n+1))))}return x1}getDayOfWeekNames(e){if(gn){let n=new Intl.DateTimeFormat(this.locale,{weekday:e,timeZone:"utc"});return $r(7,t=>this._stripDirectionalityCharacters(this._format(n,new Date(2017,0,t+1))))}return y1[e]}getYearName(e){if(gn){let n=new Intl.DateTimeFormat(this.locale,{year:"numeric",timeZone:"utc"});return this._stripDirectionalityCharacters(this._format(n,e))}return String(this.getYear(e))}getFirstDayOfWeek(){return 0}getNumDaysInMonth(e){return this.getDate(this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+1,0))}clone(e){return new Date(e.getTime())}createDate(e,n,t){if(n<0||n>11)throw Error(`Invalid month index "${n}". Month index has to be between 0 and 11.`);if(t<1)throw Error(`Invalid date "${t}". Date has to be greater than 0.`);let s=this._createDateWithOverflow(e,n,t);if(s.getMonth()!=n)throw Error(`Invalid date "${t}" for month with index "${n}".`);return s}today(){return new Date}parse(e){return typeof e=="number"?new Date(e):e?new Date(Date.parse(e)):null}format(e,n){if(!this.isValid(e))throw Error("NativeDateAdapter: Cannot format invalid date.");if(gn){this._clampDate&&(e.getFullYear()<1||e.getFullYear()>9999)&&(e=this.clone(e),e.setFullYear(Math.max(1,Math.min(9999,e.getFullYear())))),n=Cn(ot({},n),{timeZone:"utc"});let t=new Intl.DateTimeFormat(this.locale,n);return this._stripDirectionalityCharacters(this._format(t,e))}return this._stripDirectionalityCharacters(e.toDateString())}addCalendarYears(e,n){return this.addCalendarMonths(e,n*12)}addCalendarMonths(e,n){let t=this._createDateWithOverflow(this.getYear(e),this.getMonth(e)+n,this.getDate(e));return this.getMonth(t)!=((this.getMonth(e)+n)%12+12)%12&&(t=this._createDateWithOverflow(this.getYear(t),this.getMonth(t),0)),t}addCalendarDays(e,n){return this._createDateWithOverflow(this.getYear(e),this.getMonth(e),this.getDate(e)+n)}toIso8601(e){return[e.getUTCFullYear(),this._2digit(e.getUTCMonth()+1),this._2digit(e.getUTCDate())].join("-")}deserialize(e){if(typeof e=="string"){if(!e)return null;if(k1.test(e)){let n=new Date(e);if(this.isValid(n))return n}}return super.deserialize(e)}isDateInstance(e){return e instanceof Date}isValid(e){return!isNaN(e.getTime())}invalid(){return new Date(NaN)}getHour(e){return e.getHours()}getMinute(e){return e.getMinutes()}getSecond(e){return e.getSeconds()}setHour(e,n){e.setHours(n)}setMinute(e,n){e.setMinutes(n)}setSecond(e,n){e.setSeconds(n)}_createDateWithOverflow(e,n,t){let s=new Date(e,n,t);return e>=0&&e<100&&s.setFullYear(this.getYear(s)-1900),s}_2digit(e){return("00"+e).slice(-2)}_stripDirectionalityCharacters(e){return e.replace(/[\u200e\u200f]/g,"")}_format(e,n){let t=new Date;return t.setUTCFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t.setUTCHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e.format(t)}}return i.\u0275fac=function(e){return new(e||i)(ke(Hs,8),ke(Mi))},i.\u0275prov=Ke({token:i,factory:i.\u0275fac}),i})(),Sp={year:"numeric",month:"numeric",day:"numeric",hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"},S1={parse:{dateInput:Sp},display:{dateInput:Sp,monthYearLabel:{year:"numeric",month:"short"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}}},M1=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=Z({type:i}),i.\u0275inj=J({providers:[{provide:Ct,useClass:w1}],imports:[Ts]}),i})(),Ip=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=Z({type:i}),i.\u0275inj=J({providers:[{provide:Xr,useValue:S1}],imports:[M1]}),i})();function I1(i){return rs(i,!0)}function Mp(i){return i.nodeType===Node.ELEMENT_NODE}function E1(i){return i.nodeName==="INPUT"}function P1(i){return i.nodeName==="TEXTAREA"}function rs(i,r){if(Mp(i)&&r){let n=(i.getAttribute?.("aria-labelledby")?.split(/\s+/g)||[]).reduce((t,s)=>{let _=document.getElementById(s);return _&&t.push(_),t},[]);if(n.length)return n.map(t=>rs(t,!1)).join(" ")}if(Mp(i)){let e=i.getAttribute("aria-label")?.trim();if(e)return e}if(E1(i)||P1(i)){if(i.labels?.length)return Array.from(i.labels).map(t=>rs(t,!1)).join(" ");let e=i.getAttribute("placeholder")?.trim();if(e)return e;let n=i.getAttribute("title")?.trim();if(n)return n}return(i.textContent||"").replace(/\s+/g," ").trim()}var lo=class{constructor(r,e){this.target=r,this.targetElement=e,this.value=this.target.value}},Ep=(()=>{class i{constructor(e,n,t){if(this._elementRef=e,this._dateAdapter=n,this._dateFormats=t,this.dateChange=new L,this.dateInput=new L,this.stateChanges=new xt,this._onTouched=()=>{},this._validatorOnChange=()=>{},this._cvaOnChange=()=>{},this._valueChangesSubscription=xn.EMPTY,this._localeSubscription=xn.EMPTY,this._parseValidator=()=>this._lastValueValid?null:{matDatepickerParse:{text:this._elementRef.nativeElement.value}},this._filterValidator=s=>{let _=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(s.value));return!_||this._matchesFilter(_)?null:{matDatepickerFilter:!0}},this._minValidator=s=>{let _=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(s.value)),C=this._getMinDate();return!C||!_||this._dateAdapter.compareDateWithTime(C,_)<=0?null:{matDatetimePickerMin:{min:C,actual:_}}},this._maxValidator=s=>{let _=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(s.value)),C=this._getMaxDate();return!C||!_||this._dateAdapter.compareDateWithTime(C,_)>=0?null:{matDatetimePickerMax:{max:C,actual:_}}},this._lastValueValid=!1,!this._dateAdapter)throw kp("NgxMatDateAdapter");if(!this._dateFormats)throw kp("NGX_MAT_DATE_FORMATS");this._localeSubscription=n.localeChanges.subscribe(()=>{this._assignValueProgrammatically(this.value)})}get value(){return this._model?this._getValueFromModel(this._model.selection):this._pendingValue}set value(e){this._assignValueProgrammatically(e)}get disabled(){return!!this._disabled||this._parentDisabled()}set disabled(e){let n=Si(e),t=this._elementRef.nativeElement;this._disabled!==n&&(this._disabled=n,this.stateChanges.next(void 0)),n&&this._isInitialized&&t.blur&&t.blur()}_getValidators(){return[this._parseValidator,this._minValidator,this._maxValidator,this._filterValidator]}_registerModel(e){this._model=e,this._valueChangesSubscription.unsubscribe(),this._pendingValue&&this._assignValue(this._pendingValue),this._valueChangesSubscription=this._model.selectionChanged.subscribe(n=>{if(this._shouldHandleChangeEvent(n)){let t=this._getValueFromModel(n.selection);this._lastValueValid=this._isValidValue(t),this._cvaOnChange(t),this._onTouched(),this._formatValue(t),this.dateInput.emit(new lo(this,this._elementRef.nativeElement)),this.dateChange.emit(new lo(this,this._elementRef.nativeElement))}})}ngAfterViewInit(){this._isInitialized=!0}ngOnChanges(e){T1(e,this._dateAdapter)&&this.stateChanges.next(void 0)}ngOnDestroy(){this._valueChangesSubscription.unsubscribe(),this._localeSubscription.unsubscribe(),this.stateChanges.complete()}registerOnValidatorChange(e){this._validatorOnChange=e}validate(e){return this._validator?this._validator(e):null}writeValue(e){this._assignValueProgrammatically(e)}registerOnChange(e){this._cvaOnChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_onKeydown(e){let n=["ctrlKey","shiftKey","metaKey"];ba(e,"altKey")&&e.keyCode===40&&n.every(s=>!ba(e,s))&&!this._elementRef.nativeElement.readOnly&&(this._openPopup(),e.preventDefault())}_onInput(e){let n=this._lastValueValid,t=this._dateAdapter.parse(e,this._dateFormats.parse.dateInput);this._lastValueValid=this._isValidValue(t),t=this._dateAdapter.getValidDateOrNull(t);let s=this._dateAdapter.isSameTime(t,this.value),I=!(this._dateAdapter.sameDate(t,this.value)&&s);!t||I?this._cvaOnChange(t):(e&&!this.value&&this._cvaOnChange(t),n!==this._lastValueValid&&this._validatorOnChange()),I&&(this._assignValue(t),this.dateInput.emit(new lo(this,this._elementRef.nativeElement)))}_onChange(){this.dateChange.emit(new lo(this,this._elementRef.nativeElement))}_onBlur(){this.value&&this._formatValue(this.value),this._onTouched()}_formatValue(e){this._elementRef.nativeElement.value=e!=null?this._dateAdapter.format(e,this._dateFormats.display.dateInput):""}_assignValue(e){this._model?(this._assignValueToModel(e),this._pendingValue=null):this._pendingValue=e}_isValidValue(e){return!e||this._dateAdapter.isValid(e)}_parentDisabled(){return!1}_assignValueProgrammatically(e){e=this._dateAdapter.deserialize(e),this._lastValueValid=this._isValidValue(e),e=this._dateAdapter.getValidDateOrNull(e),this._assignValue(e),this._formatValue(e)}_matchesFilter(e){let n=this._getDateFilter();return!n||n(e)}}return i.\u0275fac=function(e){return new(e||i)(y(Bt),y(Ct,8),y(Xr,8))},i.\u0275dir=Fe({type:i,inputs:{value:"value",disabled:"disabled"},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[wn]}),i})();function T1(i,r){let e=Object.keys(i);for(let n of e){let{previousValue:t,currentValue:s}=i[n];if(r.isDateInstance(t)&&r.isDateInstance(s)){if(!r.sameDate(t,s))return!0}else return!0}return!1}var D1=new it("NGX_MAT_DATE_RANGE_INPUT_PARENT"),O1=(()=>{class i extends Ep{constructor(e,n,t,s,_,C,I,B){super(n,I,B),this._rangeInput=e,this._elementRef=n,this._defaultErrorStateMatcher=t,this._injector=s,this._parentForm=_,this._parentFormGroup=C,this._dir=di(Ds,{optional:!0})}ngOnInit(){let e=this._injector.get(Rs,null,{optional:!0,self:!0});e&&(this.ngControl=e)}ngDoCheck(){this.ngControl&&this.updateErrorState()}isEmpty(){return this._elementRef.nativeElement.value.length===0}_getPlaceholder(){return this._elementRef.nativeElement.placeholder}focus(){this._elementRef.nativeElement.focus()}getMirrorValue(){let e=this._elementRef.nativeElement,n=e.value;return n.length>0?n:e.placeholder}_onInput(e){super._onInput(e),this._rangeInput._handleChildValueChange()}_openPopup(){this._rangeInput._openDatepicker()}_getMinDate(){return this._rangeInput.min}_getMaxDate(){return this._rangeInput.max}_getDateFilter(){return this._rangeInput.dateFilter}_parentDisabled(){return this._rangeInput._groupDisabled}_shouldHandleChangeEvent({source:e}){return e!==this._rangeInput._startInput&&e!==this._rangeInput._endInput}_assignValueProgrammatically(e){super._assignValueProgrammatically(e),(this===this._rangeInput._startInput?this._rangeInput._endInput:this._rangeInput._startInput)?._validatorOnChange()}_getAccessibleName(){return I1(this._elementRef.nativeElement)}}return i.\u0275fac=function(e){return new(e||i)(y(D1),y(Bt),y(Gs),y(wi),y(Ii,8),y(Ei,8),y(Ct,8),y(Xr,8))},i.\u0275dir=Fe({type:i,features:[Lt]}),i})(),ZE=Qs(O1);var e4={transformPanel:_i("transformPanel",[bt("void => enter-dropdown",vt("120ms cubic-bezier(0, 0, 0.2, 1)",wa([qe({opacity:0,transform:"scale(1, 0.8)"}),qe({opacity:1,transform:"scale(1, 1)"})]))),bt("void => enter-dialog",vt("150ms cubic-bezier(0, 0, 0.2, 1)",wa([qe({opacity:0,transform:"scale(0.7)"}),qe({transform:"none",opacity:1})]))),bt("* => void",vt("100ms linear",qe({opacity:0})))]),fadeInCalendar:_i("fadeInCalendar",[wt("void",qe({opacity:0})),wt("enter",qe({opacity:1})),bt("void => *",vt("120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"))])};var B1=new it("ngx-mat-datepicker-scroll-strategy");function A1(i){return()=>i.scrollStrategies.reposition()}var V1={provide:B1,deps:[er],useFactory:A1},t4=js(class{constructor(i){this._elementRef=i}});var R1={provide:As,useExisting:Lo(()=>Pp),multi:!0},N1={provide:Vs,useExisting:Lo(()=>Pp),multi:!0},Pp=(()=>{class i extends Ep{constructor(e,n,t,s){super(e,n,t),this._formField=s,this._closedSubscription=xn.EMPTY,this._validator=W.compose(super._getValidators())}set ngxMatDatetimePicker(e){e&&(this._datepicker=e,this._closedSubscription=e.closedStream.subscribe(()=>this._onTouched()),this._registerModel(e.registerInput(this)))}get min(){return this._min}set min(e){let n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(n,this._min)||(this._min=n,this._validatorOnChange())}get max(){return this._max}set max(e){let n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(n,this._max)||(this._max=n,this._validatorOnChange())}get dateFilter(){return this._dateFilter}set dateFilter(e){let n=this._matchesFilter(this.value);this._dateFilter=e,this._matchesFilter(this.value)!==n&&this._validatorOnChange()}getConnectedOverlayOrigin(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef}getOverlayLabelId(){return this._formField?this._formField.getLabelId():this._elementRef.nativeElement.getAttribute("aria-labelledby")}getThemePalette(){return this._formField?this._formField.color:void 0}getStartValue(){return this.value}ngOnDestroy(){super.ngOnDestroy(),this._closedSubscription.unsubscribe()}_openPopup(){this._datepicker&&this._datepicker.open()}_getValueFromModel(e){return e}_assignValueToModel(e){this._model&&this._model.updateSelection(e,this)}_getMinDate(){return this._min}_getMaxDate(){return this._max}_getDateFilter(){return this._dateFilter}_shouldHandleChangeEvent(e){return e.source!==this}}return i.\u0275fac=function(e){return new(e||i)(y(Bt),y(Ct,8),y(Xr,8),y(tl,8))},i.\u0275dir=Fe({type:i,selectors:[["input","ngxMatDatetimePicker",""]],hostAttrs:[1,"mat-datepicker-input"],hostVars:6,hostBindings:function(e,n){e&1&&b("input",function(s){return n._onInput(s.target.value)})("change",function(){return n._onChange()})("blur",function(){return n._onBlur()})("keydown",function(s){return n._onKeydown(s)}),e&2&&(xs("disabled",n.disabled),yt("aria-haspopup",n._datepicker?"dialog":null)("aria-owns",(n._datepicker==null?null:n._datepicker.opened)&&n._datepicker.id||null)("min",n.min?n._dateAdapter.toIso8601(n.min):null)("max",n.max?n._dateAdapter.toIso8601(n.max):null)("data-mat-calendar",n._datepicker?n._datepicker.id:null))},inputs:{ngxMatDatetimePicker:"ngxMatDatetimePicker",min:"min",max:"max",dateFilter:[0,"matDatepickerFilter","dateFilter"]},exportAs:["ngxMatDatepickerInput"],features:[Ho([R1,N1,{provide:ul,useExisting:i}]),Lt]}),i})();var as=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=Z({type:i}),i.\u0275inj=J({imports:[de,Je,Ge,Ye,Ze,nt]}),i})(),Tp=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=Z({type:i}),i.\u0275inj=J({providers:[b1,V1],imports:[de,nt,tr,$o,Zo,on,as,Ye,Ge,Bs]}),i})();var F1=["calendar"],L1=["calendarButton"];function q1(i,r){if(i&1){let e=k();a(0,"mat-calendar",6,1),b("selectedChange",function(t){f(e);let s=m();return v(s.onDateChange(t))}),l()}if(i&2){let e=m();c("minDate",e.minDate)("maxDate",e.maxDate)("selected",e.selectedDate)}}var Dp=(()=>{class i{constructor(e){this.translate=e,this.selectedDate=null,this.minDate=null,this.maxDate=null,this.dateChange=new L(!0),this.calendarButton=null}ngOnInit(){}onDateChange(e){this.selectedDate=e,this.dateChange.emit(e)}dateText(){return this.translate.get("pages.user.book.steps.services.date")}static{this.\u0275fac=function(n){return new(n||i)(y(U))}}static{this.\u0275cmp=P({type:i,selectors:[["app-moffi-date-picker"]],viewQuery:function(n,t){if(n&1&&(A(F1,5),A(L1,5)),n&2){let s;D(s=O())&&(t.calendar=s.first),D(s=O())&&(t.calendarButton=s.first)}},inputs:{selectedDate:"selectedDate",minDate:"minDate",maxDate:"maxDate"},outputs:{dateChange:"dateChange"},decls:7,vars:8,consts:[["calendarPopover",""],["calendar",""],["popoverClass","date-picker-popover","container","body",1,"moffi-date-picker","c-pointer","w-100",3,"ngbPopover","autoClose"],["matInput","","formControlName","date","readonly","",3,"dateChange","min","max","value"],["matPrefix",""],[1,"date-picker-view"],[3,"selectedChange","minDate","maxDate","selected"]],template:function(n,t){if(n&1){let s=k();a(0,"mat-form-field",2)(1,"input",3),d(2,"date"),b("dateChange",function(C){return f(s),v(t.onDateChange(C))}),l(),a(3,"mat-icon",4),p(4,"today"),l()(),h(5,q1,2,3,"ng-template",5,0,ne)}if(n&2){let s=V(6);c("ngbPopover",s)("autoClose","outside"),o(),c("min",t.minDate)("max",t.maxDate)("value",t.selectedDate?T(2,5,t.selectedDate,"dd MMM"):t.dateText())}},dependencies:[_l,Et,ae,Pi,fe,ee,ui,$,ve,Ss],styles:[".date-picker-popover{width:330px}"]})}}return i})();var Do=class{constructor(r,e){this.hour=r,this.available=e}};var Jr=Me(an());function U1(i,r){if(i&1&&(a(0,"mat-option",5),p(1),l()),i&2){let e=r.$implicit;c("value",e)("disabled",!e.available),o(),g(" ",e.hour," ")}}var Op=(()=>{class i{set selectedHour(e){this.selected=e,this.form.get("hours").setValue(this.selected)}set hoursList(e){this.availabilities=e}constructor(e){this.fb=e,this.form=this.fb.group({hours:[null,[W.required]]}),this.selected=null,this.availabilities=[],this.disabled=!1,this.timeChange=new L(!0)}ngOnInit(){}onHourChange(e){this.selected=e.value,this.form.get("hours").setValue(this.selected),this.timeChange.emit(this.selected)}static{this.\u0275fac=function(n){return new(n||i)(y(Dn))}}static{this.\u0275cmp=P({type:i,selectors:[["app-moffi-time-picker"]],inputs:{selectedHour:"selectedHour",hoursList:"hoursList",disabled:"disabled"},outputs:{timeChange:"timeChange"},decls:7,vars:6,consts:[[1,"moffi-time-picker","w-100",3,"formGroup"],["floatLabel","never",1,"mat-form-field-no-label","c-pointer","w-100"],["matPrefix",""],["formControlName","hours",3,"selectionChange","placeholder","disabled"],[3,"value","disabled",4,"ngFor","ngForOf"],[3,"value","disabled"]],template:function(n,t){n&1&&(a(0,"form",0)(1,"mat-form-field",1)(2,"mat-icon",2),p(3,"schedule"),l(),a(4,"mat-select",3),d(5,"translate"),b("selectionChange",function(_){return t.onHourChange(_)}),h(6,U1,2,3,"mat-option",4),l()()()),n&2&&(c("formGroup",t.form),o(4),c("placeholder",u(5,4,"global.time.hour"))("disabled",t.disabled),o(2),c("ngForOf",t.availabilities))},dependencies:[j,ae,Pi,We,Le,ft,ee,ht,Ei,ui,$,N]})}}return i})();var j1=["datePicker"],Q1=["timePicker"],Bp=(()=>{class i{constructor(){this._date=(0,Jr.default)(),this._interval=15,this._minDate=(0,Jr.default)(),this._maxDate=(0,Jr.default)().add(1,"year"),this._minHour="00:00",this._maxHour="23:59",this.onDateChange=new L(!0)}set date(e){this._date=e}set interval(e){this._interval=e}set minDate(e){this._minDate=e}set maxDate(e){this._maxDate=e}set minHour(e){this._minHour=e}set maxHour(e){this._maxHour=e}ngOnInit(){setTimeout(()=>{this.initializeSubscriptions()})}update(){this.configurePickers()}configurePickers(){this.datePicker.selectedDate=this._date,this.datePicker.minDate=this._minDate,this.datePicker.maxDate=this._maxDate,this.timePicker.hoursList=this.generateTimeList();let e=this._date?this.setDefaultHour():null;this.timePicker.selectedHour=e,this._date=this._date?.set({year:this._date.year(),month:this._date.month(),date:this._date.date(),hour:parseInt(e.hour.split(":")[0]),minute:parseInt(e.hour.split(":")[1]),second:0,millisecond:0})??null,this.datePicker.dateChange.emit(this._date)}initializeSubscriptions(){this.datePicker.dateChange.subscribe(e=>{e&&(this._date=this._date?.set({year:e.year(),month:e.month(),date:e.date()})??e,this.onDateChange.emit(this._date))}),this.timePicker.timeChange.subscribe(e=>{this._date=this._date.set({year:this._date.year(),month:this._date.month(),date:this._date.date(),hour:parseInt(e.hour.split(":")[0]),minute:parseInt(e.hour.split(":")[1]),second:0,millisecond:0}),this.onDateChange.emit(this._date)})}updateValideHours(){this.timePicker.availabilities?.forEach(e=>{e.available=e.hour>=this._minHour&&e.hour<=this._maxHour}),this.timePicker.selected&&!this.timePicker.selected.available&&(this.timePicker.selectedHour=this.setDefaultHour())}generateTimeList(){let e=[];for(let n=0;n<24;n++)for(let t=0;t<60;t+=this._interval){let s=n.toString().padStart(2,"0")+":"+t.toString().padStart(2,"0"),_=s>=this._minHour&&s<=this._maxHour;e.push(new Do(s,_))}return e.push(new Do("23:59","23:59">=this._minHour&&"23:59"<=this._maxHour)),e}setDefaultHour(){let e=null,n=new Date,t=n.getHours().toString().padStart(2,"0")+":"+n.getMinutes().toString().padStart(2,"0");for(let s=0;s<this.timePicker.availabilities.length;s++){let _=this.timePicker.availabilities[s];if(_.available&&_.hour>=t){e=_;break}}return e}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-moffi-date-time-picker"]],viewQuery:function(n,t){if(n&1&&(A(j1,5),A(Q1,5)),n&2){let s;D(s=O())&&(t.datePicker=s.first),D(s=O())&&(t.timePicker=s.first)}},inputs:{date:"date",interval:"interval",minDate:"minDate",maxDate:"maxDate",minHour:"minHour",maxHour:"maxHour"},outputs:{onDateChange:"onDateChange"},decls:8,vars:1,consts:[["datePicker",""],["timePicker",""],[1,"container","g-0"],[1,"row"],[1,"col-12","col-md-6"],[3,"disabled"]],template:function(n,t){n&1&&(a(0,"div",2)(1,"div",3)(2,"div",4),x(3,"app-moffi-date-picker",null,0),l(),a(5,"div",4),x(6,"app-moffi-time-picker",5,1),l()()()),n&2&&(o(6),c("disabled",!t._date))},dependencies:[Dp,Op],styles:[".container[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]{align-items:center;justify-content:center}"]})}}return i})();var Ap=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[de,Re,ar,Ri,at,$t,Xo,Ye,Ge,Ze,Je,Ae]})}}return i})();var Y1=function(i){return i.ENABLED="ENABLED",i.DISABLED="DISABLED",i.DELETED="DELETED",i}(Y1||{}),Zr=function(i){return i.NONE="NONE",i.USER="USER",i}(Zr||{});var Vp=(()=>{class i{constructor(e){this.translate=e,this.serviceType=null,this.selected=!1}ngOnInit(){}getIcon(e=this.serviceType){return e.icon?e.icon:e.parent?this.getIcon(e.parent):e.icon}static{this.\u0275fac=function(n){return new(n||i)(y(U))}}static{this.\u0275cmp=P({type:i,selectors:[["app-service-type-preview"]],inputs:{serviceType:"serviceType",selected:"selected"},decls:9,vars:4,consts:[[1,"service","p-1"],[1,"row","align-items-center"],[1,"col"],[1,"row","align-items-center","mt-2","mb-1"],[1,"col-12","text-center"],[1,"img-fluid",3,"src"],[1,"row","align-items-center","my-2"]],template:function(n,t){n&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),x(5,"img",5),l()(),a(6,"div",6)(7,"div",4),p(8),l()()()()()),n&2&&(E("selected",t.selected),o(5),c("src",t.getIcon(),K),o(3),g(" ",t.serviceType==null?null:t.serviceType.locales[t.translate.lang]," "))},styles:[".service[_ngcontent-%COMP%]{border:1px solid var(--primary-color-200);border-radius:5px;background-color:#fff;cursor:pointer;width:150px;min-height:80px;line-height:17px}.service[_ngcontent-%COMP%] > .row[_ngcontent-%COMP%]{min-height:80px}.service[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{max-width:20px;max-height:25px}.service.selected[_ngcontent-%COMP%]{border-color:var(--primary-color-600);border-width:2px}"]})}}return i})();var X1=["stepper"],po=()=>({standalone:!0}),J1=()=>[5,10,15,20,25,30,35,40,45,50,55,60];function Z1(i,r){i&1&&(a(0,"h5",44),p(1),d(2,"translate"),l()),i&2&&(o(),w(u(2,1,"components.service-preview.popin.title")))}function ev(i,r){i&1&&(a(0,"h5",44),p(1),d(2,"translate"),l()),i&2&&(o(),w(u(2,1,"components.service-preview.popin.edit_title")))}function tv(i,r){i&1&&(a(0,"div"),x(1,"mat-spinner",45),l()),i&2&&(o(),c("diameter",25))}function iv(i,r){if(i&1&&(a(0,"mat-button-toggle",14),p(1),d(2,"translate"),l()),i&2){let e=r.$implicit,n=m();c("value",e),o(),g(" ",u(2,2,e.locales[n.translate.lang])," ")}}function nv(i,r){if(i&1){let e=k();M(0),a(1,"div",47)(2,"app-service-type-preview",48),b("click",function(){let t=f(e).$implicit,s=m(2);return v(s.selectTypeService(t))}),l()(),S()}if(i&2){let e=r.$implicit,n=r.index,t=m(2);o(),E("d-none",t.subTypeServices.length>8&&n>=7&&!t.expendedTypes),o(),c("serviceType",e)("selected",t.selectedTypeService===e)}}function ov(i,r){if(i&1){let e=k();M(0),a(1,"div",49),b("click",function(){f(e);let t=m(2);return v(t.expendedTypes=!0)}),a(2,"div",50)(3,"div",51)(4,"div",52)(5,"div"),p(6),l()()()()(),S()}if(i&2){let e=m(2);o(6),g("+ ",e.subTypeServices.length-7,"")}}function rv(i,r){if(i&1&&(a(0,"section",46)(1,"div",34),h(2,nv,3,4,"ng-container",38)(3,ov,7,1,"ng-container",11),l()()),i&2){let e=m();o(2),c("ngForOf",e.subTypeServices),o(),c("ngIf",!e.expendedTypes&&e.subTypeServices.length>8)}}function av(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.service-preview.popin.step2.name.errors.maxlength")," "))}function sv(i,r){i&1&&(M(0),p(1),d(2,"translate"),S()),i&2&&(o(),g(" ",u(2,1,"components.service-preview.popin.step2.bookable.label.active")," "))}function lv(i,r){i&1&&(M(0),p(1),d(2,"translate"),S()),i&2&&(o(),g(" ",u(2,1,"components.service-preview.popin.step2.bookable.label.inactive")," "))}function cv(i,r){if(i&1&&(a(0,"div",58)(1,"div",52),x(2,"app-stripe-resource",60),l()()),i&2){let e=m(3);o(2),c("resource",e.stripeResource)("fromResourcePage",!0)}}function pv(i,r){if(i&1){let e=k();M(0),a(1,"div",34)(2,"div",52),p(3),d(4,"translate"),l()(),a(5,"div",34)(6,"div",52)(7,"app-button",56),b("clicked",function(){f(e);let t=m(2);return v(t.openStripeDocumentation())}),l()()(),h(8,cv,3,2,"div",57),a(9,"div",58)(10,"div",52)(11,"app-button",59),b("clicked",function(){f(e);let t=m(2);return t.next(),v(t.endStep3())}),l()()(),S()}if(i&2){let e=m(2);o(3),g(" ",u(4,4,"pages.user.workspaces.submit.steps.three.price.stripe.info")," "),o(4),c("paddingX",!1)("textKey","pages.user.workspaces.submit.steps.three.price.stripe.documentation.title"),o(),c("ngIf",e.stripeResource)}}function dv(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.service-preview.popin.step3.prices.amount.error")," "))}function mv(i,r){if(i&1&&(a(0,"mat-option",81),p(1),d(2,"lowercase"),d(3,"translate"),l()),i&2){let e=r.$implicit;c("value",e),o(),g(" ",u(3,4,u(2,2,"components.service-preview.popin.step3.prices.unit."+e))," ")}}function uv(i,r){if(i&1){let e=k();a(0,"div",41)(1,"div",82)(2,"app-button-action",83),b("clicked",function(){f(e);let t=m().index,s=m(3);return v(s.removeServicePrice(t))}),l()()()}if(i&2){let e=m(4);o(2),c("isDisabled",e.step3Group.get("free").value)}}function _v(i,r){if(i&1){let e=k();a(0,"div",73)(1,"div",34)(2,"div",74)(3,"mat-form-field",22)(4,"mat-label"),p(5),d(6,"translate"),l(),a(7,"input",75,5),d(9,"translate"),Pe("ngModelChange",function(t){let s=f(e).$implicit;return Ee(s.price,t)||(s.price=t),v(t)}),b("ngModelChange",function(){f(e);let t=m(3);return v(t.updatePrices())}),l(),a(10,"mat-icon",76),p(11,"euro"),l(),h(12,dv,3,3,"mat-error",11),l()(),a(13,"div",77)(14,"mat-form-field",22)(15,"mat-label"),p(16),d(17,"translate"),l(),a(18,"mat-select",78),Pe("ngModelChange",function(t){let s=f(e).$implicit;return Ee(s.frequency,t)||(s.frequency=t),v(t)}),b("ngModelChange",function(){f(e);let t=m(3);return v(t.updatePrices())}),h(19,mv,4,6,"mat-option",79),l()()(),h(20,uv,3,1,"div",80),l()()}if(i&2){let e=r.$implicit,n=r.index,t=V(8),s=m(3);o(5),g(" ",u(6,12,"components.service-preview.popin.step3.prices.amount.label")," "),o(2),c("disabled",s.step3Group.get("free").value),Ie("ngModel",e.price),c("ngModelOptions",X(18,po))("placeholder",u(9,14,"components.service-preview.popin.step3.prices.amount.placeholder")),o(5),c("ngIf",!(t!=null&&t.valid)),o(4),g(" ",u(17,16,"components.service-preview.popin.step3.prices.unit.label")," "),o(2),Ie("ngModel",e.frequency),c("ngModelOptions",X(19,po))("disabled",s.step3Group.get("free").value),o(),c("ngForOf",s.filterUnits(e.frequency)),o(),c("ngIf",n>0||s.service.prices.length>1)}}function hv(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.service-preview.popin.step3.tva.error")," "))}function gv(i,r){if(i&1){let e=k();M(0),a(1,"div",61)(2,"div",24),h(3,_v,21,20,"div",62),l(),a(4,"div",63)(5,"app-button",64),b("clicked",function(){f(e);let t=m(2);return v(!t.step3Group.get("free").value&&!t.isUnit()&&t.addServicePrice())}),l()(),a(6,"div",65)(7,"mat-form-field",66)(8,"mat-label"),p(9),d(10,"translate"),l(),x(11,"input",67),d(12,"translate"),h(13,hv,3,3,"mat-error",11),a(14,"span",68),p(15,"%"),l()(),a(16,"mat-autocomplete",null,4)(18,"mat-option",69),p(19,"5,5 %"),l(),a(20,"mat-option",70),p(21,"10 %"),l(),a(22,"mat-option",71),p(23,"20 %"),l()()(),a(24,"div",29)(25,"app-button",72),b("clicked",function(){f(e);let t=m(2);return t.next(),v(t.endStep3())}),l()()(),S()}if(i&2){let e=V(17),n=m(2);o(2),E("grayText",n.step3Group.get("free").value),o(),c("ngForOf",n.service.prices),o(),E("grayText",n.step3Group.get("free").value||n.isUnit()),o(),c("isDisabled",n.step3Group.get("free").value||n.isUnit()||!n.hasRemainingUnits())("tooltipText",n.step3Group.get("free").value||n.isUnit()?"components.service-preview.popin.step3.prices.add_disabled":null),o(),E("grayText",n.step3Group.get("free").value),o(3),g(" ",u(10,14,"components.service-preview.popin.step3.tva.label")," "),o(2),c("matAutocomplete",e)("placeholder",u(12,16,"components.service-preview.popin.step3.tva.placeholder")),o(2),c("ngIf",n.step3Group.get("tva").invalid),o(12),c("isDisabled",!(n.step3Group!=null&&n.step3Group.valid))}}function fv(i,r){if(i&1&&(a(0,"mat-step",9),d(1,"translate"),a(2,"form",10)(3,"div",53)(4,"div",54),p(5),d(6,"translate"),l()(),a(7,"div",53)(8,"div",52)(9,"mat-button-toggle-group",55)(10,"mat-button-toggle",14),p(11),d(12,"translate"),l(),a(13,"mat-button-toggle",14),p(14),d(15,"translate"),l()()()(),h(16,pv,12,6,"ng-container",11)(17,gv,26,18,"ng-container",11),l()()),i&2){let e=m();we("label",u(1,10,"components.service-preview.popin.step3.title")),c("stepControl",e.step3Group),o(2),c("formGroup",e.step3Group),o(3),w(u(6,12,"components.service-preview.popin.step3.free.title")),o(5),c("value",!1),o(),g(" ",u(12,14,"global.yes")," "),o(2),c("value",!0),o(),g(" ",u(15,16,"global.no")," "),o(2),c("ngIf",e.hasStripeEnabled&&!e.step3Group.get("free").value),o(),c("ngIf",!e.hasStripeEnabled)}}function vv(i,r){i&1&&(a(0,"div",24),x(1,"mat-spinner",45),l()),i&2&&(o(),c("diameter",25))}function bv(i,r){i&1&&(a(0,"span"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.service-preview.popin.step4.select_all")," "))}function Cv(i,r){i&1&&(a(0,"span"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.service-preview.popin.step4.unselect_all")," "))}function xv(i,r){if(i&1){let e=k();a(0,"app-button",89),b("clicked",function(t){f(e);let s=m().$implicit;return m().checkBuildingWorkspaces(s,!0),v(t==null?null:t.stopPropagation())}),l()}}function yv(i,r){if(i&1){let e=k();a(0,"app-button",90),b("clicked",function(t){f(e);let s=m().$implicit;return m().checkBuildingWorkspaces(s,!1),v(t==null?null:t.stopPropagation())}),l()}}function kv(i,r){if(i&1){let e=k();a(0,"app-button",95),b("clicked",function(t){f(e);let s=m(2).$implicit;return m(2).checkSeats(s,!0),v(t.stopPropagation())}),l()}}function wv(i,r){if(i&1){let e=k();a(0,"app-button",96),b("clicked",function(t){f(e);let s=m(2).$implicit;return m(2).checkSeats(s,!1),v(t.stopPropagation())}),l()}}function Sv(i,r){if(i&1){let e=k();M(0),a(1,"div",24)(2,"div",97)(3,"mat-checkbox",98),Pe("ngModelChange",function(t){let s=f(e).$implicit;return Ee(s.checked,t)||(s.checked=t),v(t)}),b("click",function(){f(e);let t=m(2).$implicit,s=m(2);return v(s.updateNbSeatsSelected(t))}),p(4),l()()(),S()}if(i&2){let e=r.$implicit,n=m(3).$implicit,t=m();o(3),Ie("ngModel",e.checked),c("ngModelOptions",X(4,po))("disabled",t.api.userRole!=="ADMIN"&&!t.isManagerBuilding(n.id)),o(),g(" ",e.fullname," ")}}function Mv(i,r){if(i&1){let e=k();M(0),a(1,"mat-expansion-panel")(2,"mat-expansion-panel-header")(3,"div",51)(4,"div",41)(5,"mat-checkbox",91,6),b("click",function(){f(e);let t=m(2).$implicit,s=m();return v(s.updateNbWorkspacesSelected(t))}),Pe("ngModelChange",function(t){f(e);let s=m().$implicit;return Ee(s.checked,t)||(s.checked=t),v(t)}),p(7),l()(),a(8,"div",41),h(9,kv,1,0,"app-button",92)(10,wv,1,0,"app-button",93),l(),a(11,"div",41)(12,"p",94),p(13),d(14,"translate"),l()()()(),a(15,"div",34),h(16,Sv,5,5,"ng-container",38),l()(),S()}if(i&2){let e=m().$implicit,n=m().$implicit,t=m();o(5),Ie("ngModel",e.checked),c("ngModelOptions",X(11,po))("disabled",t.api.userRole!=="ADMIN"&&!t.isManagerBuilding(n.id)),o(2),g(" ",e.title," "),o(2),c("ngIf",!t.allSeatsAreChecked(e)),o(),c("ngIf",t.allSeatsAreChecked(e)),o(3),Q(" (",e==null?null:e.nbSeatsSelected," ",u(14,9,(e==null?null:e.nbSeatsSelected)>1?"dashboard.parameters.home_office.popin.many_selected":"dashboard.parameters.home_office.popin.one_selected"),") "),o(3),c("ngForOf",e.seats)}}function Iv(i,r){if(i&1){let e=k();M(0),a(1,"div",36)(2,"mat-checkbox",98),Pe("ngModelChange",function(t){f(e);let s=m().$implicit;return Ee(s.checked,t)||(s.checked=t),v(t)}),b("click",function(){f(e);let t=m(2).$implicit,s=m();return v(s.updateNbWorkspacesSelected(t))}),p(3),l()(),S()}if(i&2){let e=m().$implicit,n=m().$implicit,t=m();o(2),Ie("ngModel",e.checked),c("ngModelOptions",X(4,po))("disabled",t.api.userRole!=="ADMIN"&&!t.isManagerBuilding(n.id)),o(),g(" ",e.title," ")}}function Ev(i,r){if(i&1&&(M(0),a(1,"div",24),h(2,Mv,17,12,"ng-container",11)(3,Iv,4,5,"ng-container",11),l(),S()),i&2){let e=r.$implicit;o(2),c("ngIf",(e==null||e.seats==null?null:e.seats.length)>0),o(),c("ngIf",!(e!=null&&e.seats)||(e==null||e.seats==null?null:e.seats.length)===0)}}function Pv(i,r){if(i&1){let e=k();M(0),a(1,"div",24)(2,"mat-expansion-panel")(3,"mat-expansion-panel-header")(4,"div",51)(5,"div",41)(6,"mat-checkbox",84),Pe("ngModelChange",function(t){let s=f(e).$implicit;return Ee(s.checked,t)||(s.checked=t),v(t)}),a(7,"strong",85),p(8),l()()(),a(9,"div",41),h(10,xv,1,0,"app-button",86)(11,yv,1,0,"app-button",87),l(),a(12,"div",41)(13,"p",88),p(14),d(15,"translate"),l()()()(),a(16,"div",34),h(17,Ev,4,2,"ng-container",38),l()()(),S()}if(i&2){let e=r.$implicit,n=m();o(6),Ie("ngModel",e.checked),c("ngModelOptions",X(11,po))("disabled",n.api.userRole!=="ADMIN"&&!n.isManagerBuilding(e.id)),o(2),g(" ",e.name," "),o(2),c("ngIf",!n.allWorkspacesAreChecked(e)),o(),c("ngIf",n.allWorkspacesAreChecked(e)),o(3),Q(" (",e==null?null:e.nbWorkspacesSelected," ",u(15,9,(e==null?null:e.nbWorkspacesSelected)>1?"dashboard.parameters.home_office.popin.many_selected":"dashboard.parameters.home_office.popin.one_selected"),") "),o(3),c("ngForOf",e==null?null:e.workspaces)}}function Tv(i,r){if(i&1){let e=k();a(0,"div",16)(1,"div",52)(2,"app-button",30),b("clicked",function(){f(e);let t=m();return t.utils.scrollToError(),v(t.next())}),l()()()}}function Dv(i,r){if(i&1&&(a(0,"mat-option",123),p(1),l()),i&2){let e=r.$implicit;c("value",e),o(),g(" ",e," ")}}function Ov(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.service-preview.popin.step5.min_time.quantity.error")," "))}function Bv(i,r){i&1&&(a(0,"span",124),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.service-preview.popin.step5.delivery_type.help_disabled")," "))}function Av(i,r){i&1&&(M(0),p(1),d(2,"translate"),S()),i&2&&(o(),g(" ",u(2,1,"global.alts.yes")," "))}function Vv(i,r){i&1&&(M(0),a(1,"span",125),p(2),d(3,"translate"),l(),S()),i&2&&(o(2),g(" ",u(3,1,"global.alts.no")," "))}function Rv(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.service-preview.popin.step5.available_quantity.error")," "))}function Nv(i,r){if(i&1&&(a(0,"mat-step",9),d(1,"translate"),a(2,"form",10)(3,"div",34)(4,"div",24)(5,"p"),p(6),d(7,"translate"),l()(),a(8,"div",24)(9,"mat-radio-group",99)(10,"div")(11,"mat-radio-button",14),p(12),d(13,"translate"),l()(),a(14,"div")(15,"mat-radio-button",14),p(16),d(17,"translate"),l()(),a(18,"div",100)(19,"div",41)(20,"p",101),p(21),d(22,"translate"),l()(),a(23,"div",102)(24,"mat-icon",103),d(25,"translate"),p(26," help "),l()()(),a(27,"div",104)(28,"div",74)(29,"mat-form-field")(30,"mat-label"),p(31),d(32,"translate"),l(),a(33,"mat-select",105)(34,"mat-option"),p(35),d(36,"translate"),l(),h(37,Dv,2,2,"mat-option",106),l()()(),a(38,"div",74)(39,"mat-form-field")(40,"mat-label"),p(41),d(42,"translate"),l(),a(43,"mat-select",107)(44,"mat-option"),p(45),d(46,"translate"),l(),a(47,"mat-option",108),p(48),d(49,"translate"),l()()()()(),a(50,"div",109)(51,"mat-radio-button",14),p(52),d(53,"translate"),l()(),a(54,"div",110)(55,"div",41)(56,"p",101),p(57),d(58,"translate"),l()(),a(59,"div",102)(60,"mat-icon",103),d(61,"translate"),p(62," help "),l()()(),a(63,"div",104)(64,"div",74)(65,"mat-form-field",66)(66,"mat-label"),p(67),d(68,"translate"),l(),x(69,"input",111),d(70,"translate"),h(71,Ov,3,3,"mat-error",11),l()(),a(72,"div",74)(73,"mat-form-field")(74,"mat-label"),p(75),d(76,"translate"),l(),a(77,"mat-select",112)(78,"mat-option"),p(79),d(80,"translate"),l(),a(81,"mat-option",113),p(82),d(83,"translate"),l(),a(84,"mat-option",114),p(85),d(86,"translate"),l(),a(87,"mat-option",115),p(88),d(89,"translate"),l()()()()()(),h(90,Bv,3,3,"span",116),l(),a(91,"div",117)(92,"div",51)(93,"div",41)(94,"p",101),p(95),d(96,"translate"),l()(),a(97,"div",102)(98,"mat-icon",103),d(99,"translate"),p(100," help "),l()()(),a(101,"div",118)(102,"mat-slide-toggle",119),h(103,Av,3,3,"ng-container",11)(104,Vv,4,3,"ng-container",11),l()()(),a(105,"div",120)(106,"mat-form-field",66)(107,"mat-label"),p(108),d(109,"translate"),l(),x(110,"input",121),d(111,"translate"),h(112,Rv,3,3,"mat-error",11),l()(),a(113,"div",24)(114,"mat-form-field",22)(115,"mat-label"),p(116),d(117,"translate"),l(),x(118,"input",122),d(119,"translate"),l()()()()()),i&2){let e=m();c("label",u(1,48,"components.service-preview.popin.step5.title"))("stepControl",e.step5Group),o(2),c("formGroup",e.step5Group),o(4),g(" ",u(7,50,"components.service-preview.popin.step5.delivery_type.text")," "),o(5),c("value","DEACTIVATED"),o(),g(" ",u(13,52,"components.service-preview.popin.step5.delivery_type.deactivated")," "),o(3),c("value","DATE"),o(),g(" ",u(17,54,"components.service-preview.popin.step5.delivery_type.date")," "),o(2),E("d-none",e.step5Group.get("deliveryType").value!=="DATE"),o(3),g(" ",u(22,56,"components.service-preview.popin.step5.duration.text")," "),o(3),c("matTooltip",u(25,58,"components.service-preview.popin.step5.duration.help")),o(3),E("d-none",e.step5Group.get("deliveryType").value!=="DATE"),o(4),g(" ",u(32,60,"components.service-preview.popin.step5.duration.quantity.label")," "),o(2),c("required",e.step5Group.get("deliveryType").value==="DATE"),o(2),g(" ",u(36,62,"components.service-preview.popin.step5.duration.quantity.none")," "),o(2),c("ngForOf",X(102,J1)),o(4),g(" ",u(42,64,"components.service-preview.popin.step5.duration.frequency.label")," "),o(2),c("required",e.step5Group.get("deliveryType").value==="DATE"),o(2),g(" ",u(46,66,"components.service-preview.popin.step5.duration.frequency.none")," "),o(3),g(" ",u(49,68,"components.service-preview.popin.step5.duration.frequency.minutes")," "),o(3),c("value","RANGE"),o(),g(" ",u(53,70,"components.service-preview.popin.step5.delivery_type.range")," "),o(2),E("d-none",e.step5Group.get("deliveryType").value!=="RANGE"),o(3),g(" ",u(58,72,"components.service-preview.popin.step5.min_time.text")," "),o(3),c("matTooltip",u(61,74,"components.service-preview.popin.step5.min_time.help")),o(3),E("d-none",e.step5Group.get("deliveryType").value!=="RANGE"),o(4),g(" ",u(68,76,"components.service-preview.popin.step5.min_time.quantity.label")," "),o(2),c("placeholder",u(70,78,"components.service-preview.popin.step5.min_time.quantity.placeholder")),o(2),c("ngIf",e.step5Group.get("minTimeQuantity").invalid),o(4),g(" ",u(76,80,"components.service-preview.popin.step5.min_time.frequency.label")," "),o(4),g(" ",u(80,82,"components.service-preview.popin.step5.min_time.frequency.none")," "),o(3),g(" ",u(83,84,"components.service-preview.popin.step5.min_time.frequency.hours")," "),o(3),g(" ",u(86,86,"components.service-preview.popin.step5.min_time.frequency.days")," "),o(3),g(" ",u(89,88,"components.service-preview.popin.step5.min_time.frequency.weeks")," "),o(2),c("ngIf",e.step5Group.get("deliveryType").disabled),o(5),g(" ",u(96,90,"components.service-preview.popin.step5.requires_preparation.text")," "),o(3),c("matTooltip",u(99,92,"components.service-preview.popin.step5.requires_preparation.help")),o(5),c("ngIf",e.step5Group.get("requiresPreparation").value),o(),c("ngIf",!e.step5Group.get("requiresPreparation").value),o(4),g(" ",u(109,94,"components.service-preview.popin.step5.available_quantity.text")," "),o(2),c("placeholder",u(111,96,"components.service-preview.popin.step5.available_quantity.placeholder")),o(2),c("ngIf",e.step5Group.get("availableQuantity").invalid),o(4),g(" ",u(117,98,"components.service-preview.popin.step5.delivery_location.text")," "),o(2),c("placeholder",u(119,100,"components.service-preview.popin.step5.delivery_location.placeholder"))}}var Rp=(()=>{class i{get in(){return this.service}set in(e){this.service=e,this.updateControls()}get hasStripeEnabled(){return!!this.api.company?.parameters?.stripeParameters}get showPricesStep(){return this.hasStripeEnabled||this.hadPrices}constructor(e,n,t,s,_,C,I){this.api=e,this.utils=n,this.toastr=t,this.translate=s,this.formBuilder=_,this.changeDetector=C,this.data=I,this.managerBuildingsId=null,this.service={bookable:!0,prices:[]},this.workspaces=[],this.seats=[],this.serviceUpdated=new L(!0),this.typeServicesLoading=!0,this.typeServices=[],this.selectedRootTypeService=null,this.subTypeServices=[],this.selectedTypeService=null,this.expendedTypes=!1,this.buildings=[],this.workspaceLoading=!0,this.isEdit=!1,this.goToResourceLinkingStep=!1,this.hadPrices=!1,this.units=["UNIT","HOUR","DAY","WEEK","MONTH"],this.onClose=(B=null)=>{},I.service&&(this.service=I.service),I.workspaces&&(this.workspaces=I.workspaces),this.isEdit=I.isEdit??!1,this.goToResourceLinkingStep=I.goToResourceLinkingStep??!1,this.onClose=I.onClose,this.step1Group=this.formBuilder.group({rootType:[null,[W.required]],type:[null,[W.required]]}),this.step1Group.get("rootType").valueChanges.subscribe(B=>{this.selectRootTypeService(B)}),this.step2Group=this.formBuilder.group({title:["",[W.required,W.maxLength(255)]],description:["",[]],reference:["",[W.required]]}),this.step3Group=this.formBuilder.group({free:[!0,[]],prices:[!0,B=>{if(!this.hasStripeEnabled&&!B.value)return{required:!0}}],tva:["",[W.min(0),W.pattern(/^\d+([\.\,]{1}\d{1,2})?$/i),B=>{if(!this.hasStripeEnabled&&!this.step3Group?.get("free")?.value&&!B.value)return{required:!0}}]]}),this.step3Group.get("tva").disable(),this.step3Group.get("free").valueChanges.subscribe(B=>{B?this.step3Group.get("tva").disable():this.step3Group.get("tva").enable(),this.updatePrices(),this.save(null,!1)}),this.step4Group=this.formBuilder.group({}),this.step5Group=this.formBuilder.group({deliveryType:["DEACTIVATED",[W.required,B=>B.value==="DEACTIVATED"||B.value==="DATE"||B.value==="RANGE"?null:{required:!0}]],requiresPreparation:[!1,[W.required]],minTimeQuantity:[0,[]],minTimeFrequency:["HOURS",[]],durationQuantity:[5,[B=>this.step5Group&&this.step5Group.get("deliveryType")&&this.step5Group.get("deliveryType").value==="DATE"&&!B.value?{required:!0}:null]],durationFrequency:["MINUTES",[B=>this.step5Group&&this.step5Group.get("deliveryType")&&this.step5Group.get("deliveryType").value==="DATE"&&!B.value?{required:!0}:null]],availableQuantity:["",[]],deliveryLocation:[""]})}ngOnInit(){this.api.userRole!=="ADMIN"&&(this.managerBuildingsId=this.api?.user?.roles?.filter(e=>e.roleType===Cl.BUILDING_MANAGER&&e.company.id===this.api.company.id).map(e=>e.building.id)),this.stripeResource={id:null,type:je.SERVICE,image:null,name:"",product:null},this.api.servicesService.getServicesTree().then(e=>{this.typeServices=e,this.typeServicesLoading=!1,this.isEdit&&this.service?this.api.servicesService.get(this.service.id).then(n=>{this.service=n,this.stripeResource.id=this.service.id,this.stripeResource.name=this.service.title,this.stripeResource.product=this.service.stripeProduct,this.updateControls(),this.getBuildingWorkspacesAndSeats()}):this.getBuildingWorkspacesAndSeats()}),this.api.servicesService.getServiceReference().then(e=>{(this.service===null||!this.service.reference)&&this.step2Group.get("reference").setValue(e.reference)})}next(){this.stepper.next()}getBuildingWorkspacesAndSeats(){this.api.buildingService.getBuildingsForAgendaEvent().then(e=>{this.buildings=e,this.sortBuildingsByAlphabeticalOrder(),this.updateCheckedElements()})}updateCheckedElements(){let e=this.isEdit&&typeof this.service<"u";this.buildings.forEach(n=>{this.updateBuildingCheckedElements(n,e),this.updateNbWorkspacesSelected(n)})}updateBuildingCheckedElements(e,n){e.checked=!1,n&&(e.checked=this.service.buildings.filter(t=>t.id===e.id).length>0),e.workspaces.forEach(t=>{this.updateWorkspaceAndSeatsCheckedElements(t,n)})}updateWorkspaceAndSeatsCheckedElements(e,n){e.checked=!1,n&&(e.checked=this.service.workspaces.filter(t=>t.id===e.id).length>0),this.workspaces&&this.workspaces.filter(t=>t.id===e.id).length>0&&(e.checked=!0),e.seats?.length>0&&e.seats.forEach(t=>{t.checked=!1,n&&(t.checked=this.service.seats.filter(s=>s.id===t.id).length>0),this.seats&&this.seats.filter(s=>s.id===t.id).length>0&&(e.checked=!0)}),this.updateNbSeatsSelected(e)}isManagerBuilding(e){return this.managerBuildingsId.findIndex(n=>n===e)>-1}findRootServiceType(e){return e.parent?this.findRootServiceType(e.parent):e}updateControls(){if(this.typeServices&&this.typeServices.length>0){let e=this.findRootServiceType(this.service.type);e=this.typeServices.find(t=>t.id===e.id),this.selectRootTypeService(e);let n=this.subTypeServices.find(t=>t.id===this.service.type.id);this.selectTypeService(n)}this.buildings&&this.buildings.length>0&&this.buildings.forEach(e=>{e.checked=!1,this.isEdit&&this.service&&(e.checked=this.service.buildings.filter(n=>n.id===e.id).length>0),e.workspaces&&e.workspaces.length>0&&e.workspaces.forEach(n=>{n.checked=!1,this.isEdit&&this.service&&(n.checked=this.service.workspaces.filter(t=>t.id===n.id).length>0),this.workspaces&&this.workspaces.filter(t=>t.id===n.id).length>0&&(n.checked=!0)})}),this.step2Group.get("title").setValue(this.service.title),this.step2Group.get("reference").setValue(this.service.reference),this.step2Group.get("reference").disable(),this.step2Group.get("description").setValue(this.service.description),this.step3Group.get("free").setValue((this.service.prices===null||this.service.prices.length===0)&&!this.service.stripeProduct,{emitEvent:!1,onlySelf:!0}),this.step3Group.get("free").value?this.step3Group.get("tva").disable():this.step3Group.get("tva").enable(),this.service.prices=this.service.prices.map(e=>({price:e.price/=100,frequency:e.frequency})),this.updatePrices(),this.hasStripeEnabled||(this.service.prices.length===0?this.service.prices.push({price:null,frequency:null}):this.hadPrices=!0,this.step3Group.get("tva").setValue(this.service.tva==null?null:this.service.tva/100)),this.endStep3(),this.step5Group.get("deliveryType").setValue(this.service.deliveryType?this.service.deliveryType:"DEACTIVATED"),this.step5Group.get("requiresPreparation").setValue(this.service.requiresPreparation===!0),this.service.minTime!=null&&(this.step5Group.get("minTimeQuantity").setValue(this.service.minTime.nb),this.step5Group.get("minTimeFrequency").setValue(this.service.minTime.type)),this.service.duration!=null&&(this.step5Group.get("durationQuantity").setValue(this.service.duration.nb),this.step5Group.get("durationFrequency").setValue(this.service.duration.type)),this.step5Group.get("availableQuantity").setValue(this.service.availableQuantity),this.step5Group.get("deliveryLocation").setValue(this.service.deliveryLocation),this.changeDetector.detectChanges(),this.goToResourceLinkingStep&&(this.service.bookable?this.stepper.selectedIndex=3:this.stepper.selectedIndex=2)}addServicePrice(){this.service.prices.push({price:null,frequency:null}),this.updatePrices()}isUnit(){return this.service.prices.filter(e=>e.frequency==="UNIT").length>0}isHours(){return this.service.prices.filter(e=>e.frequency&&e.frequency!=="UNIT"&&e.frequency).length>0}filterUnits(e){let n=this.isUnit(),t=this.isHours(),s=this.units;return this.service.prices.length>1&&(s=t?this.units.filter(_=>_!=="UNIT"):this.units,s=n?[]:s),s.filter(_=>_===e||this.service.prices.filter(C=>C.frequency===_).length===0)}hasRemainingUnits(){return this.units.filter(e=>e!=="UNIT"&&this.service.prices.filter(n=>n.frequency===e).length===0).length>0}removeServicePrice(e){this.service.prices.splice(e,1)}updatePrices(){let e=this.service.prices.filter(n=>!n.price||isNaN(n.price)||!n.frequency||this.units.indexOf(n.frequency)===-1||n.price<0||!n.price.toString().match(/^\d+([\.\,]{1}\d{1,2})?$/i)).length>0;this.step3Group.get("prices").setValue(this.hasStripeEnabled||this.step3Group.get("free").value||!e)}endStep3(){this.isHours()?(this.step5Group.get("deliveryType").setValue("RANGE"),this.step5Group.get("deliveryType").disable()):this.step5Group.get("deliveryType").enable(),this.updatePrices(),this.utils.scrollToError()}selectAllBuildingsWorkspacesAndSeats(e){this.buildings.forEach(n=>{(this.api.userRole==="ADMIN"||this.api.userRole!=="ADMIN"&&this.managerBuildingsId.findIndex(t=>t===n.id)>-1)&&this.checkBuilding(n,e.checked)})}checkBuilding(e,n){e.checked=n,e.workspaces.forEach(t=>{this.checkWorkspaces(t,n)})}checkBuildingWorkspaces(e,n){e.workspaces.forEach(t=>{t.checked=n}),this.updateNbWorkspacesSelected(e)}checkWorkspaces(e,n){e.checked=n,this.checkSeats(e,n)}checkSeats(e,n){e.seats?.length>0&&e.seats.forEach(t=>{t.checked=n}),this.updateNbSeatsSelected(e)}allWorkspacesAreChecked(e){return e.workspaces.filter(n=>n.checked===!1)?.length===0}allSeatsAreChecked(e){return e.seats.filter(n=>n.checked===!1)?.length===0}selectRootTypeService(e){this.step1Group.get("rootType").setValue(e,{emitEvent:!1}),this.selectedRootTypeService=e,this.selectedTypeService=null,this.expendedTypes=!1,this.step1Group.get("type").setValue(null),this.subTypeServices=[],this.selectedRootTypeService.children.forEach(n=>{this.subTypeServices=this.subTypeServices.concat(this.getChildren(n))}),this.translate.getLang()!=="fr-FR"?this.subTypeServices.sort((n,t)=>n.locales.en.localeCompare(t.locales.en)):this.subTypeServices.sort((n,t)=>n.locales.fr.localeCompare(t.locales.fr))}getChildren(e){let n=[e];return e.children.forEach(t=>{n=n.concat(this.getChildren(t))}),n}selectTypeService(e){this.selectedTypeService=e,this.step1Group.get("type").setValue(e),this.step2Group.get("title").setValue(e.locales[this.translate.getLang()]),this.stepper.next()}getData(){let e={};return this.service&&this.service.id&&(e.id=this.service.id),e.type=this.step1Group.get("type").value,e.title=this.step2Group.get("title").value,e.description=this.step2Group.get("description").value,e.reference=this.step2Group.get("reference").value,e.bookable=this.service.bookable,this.step3Group.get("free").value?e.prices=[]:(e.prices=this.service.prices.map(n=>({price:Math.round(n.price*100),frequency:n.frequency})),e.tva=Math.round(this.step3Group.get("tva").value*100)),e.buildings=this.buildings.filter(n=>n.checked).map(n=>({id:n.id})),e.workspaces=this.buildings.flatMap(n=>n.workspaces).filter(n=>n.checked).map(n=>({id:n.id})),e.seats=this.buildings.flatMap(n=>n.workspaces).filter(n=>n.seats?.length>0).flatMap(n=>n.seats).filter(n=>n.checked).map(n=>({id:n.id})),e.deliveryType=this.step5Group.get("deliveryType").value==="DEACTIVATED"?null:this.step5Group.get("deliveryType").value,e.requiresPreparation=this.step5Group.get("requiresPreparation").value,this.step5Group.get("minTimeQuantity").value&&this.step5Group.get("minTimeFrequency").value&&(e.minTime={nb:this.step5Group.get("minTimeQuantity").value,type:this.step5Group.get("minTimeFrequency").value}),this.step5Group.get("durationQuantity").value&&this.step5Group.get("durationFrequency").value&&(e.duration={nb:this.step5Group.get("durationQuantity").value,type:this.step5Group.get("durationFrequency").value}),e.availableQuantity=this.step5Group.get("availableQuantity").value,e.deliveryLocation=this.step5Group.get("deliveryLocation").value,e}save(e,n=!0){if(this.step1Group.valid&&this.step2Group.valid&&this.step4Group.valid&&(!this.service.bookable||(this.hasStripeEnabled||this.step3Group.valid)&&this.step5Group.valid)){let t=this.getData();this.api.servicesService.createOrUpdate(t,e?.button).then(s=>z(this,null,function*(){this.service=s,this.stripeResource.id=this.service.id,this.stripeResource?.product&&(this.step3Group.get("free").value?(yield this.api.integrationService.stripe.detach(this.stripeResource.product.id),this.stripeResource.product=null):yield this.api.integrationService.stripe.save([this.stripeResource]),this.service=yield this.api.servicesService.get(this.service.id)),this.serviceUpdated.emit(this.service),n&&(this.toastr.success(this.translate.get("components.service-preview.popin.toast.success."+(this.isEdit?"edit":"add"))),this.onClose(this.service))})).catch(()=>{this.toastr.error(this.translate.get("components.service-preview.popin.toast.error"))})}else this.utils.scrollToError()}sortBuildingsByAlphabeticalOrder(){this.buildings.sort((e,n)=>e.name<n.name?-1:e.name>n.name?1:0),this.sortWorkspacesByAlphabeticalOrder()}sortWorkspacesByAlphabeticalOrder(){this.buildings.forEach(e=>{e.workspaces.sort((n,t)=>n.title<t.title?-1:n.title>t.title?1:0)}),this.sortSeatsByAlphabeticalOrder()}sortSeatsByAlphabeticalOrder(){let e=this.buildings.filter(n=>n.workspaces.filter(t=>t.bookingSeatAttribution===Zr.USER)?.length>0);e?.length>0&&e.forEach(n=>{n.workspaces.forEach(t=>{t.bookingSeatAttribution===Zr.USER&&t.seats.sort((s,_)=>s.position-_.position)})}),this.workspaceLoading=!1}updateNbWorkspacesSelected(e){setTimeout(()=>{this.workspacesCheckedNumber(e)})}workspacesCheckedNumber(e){e.nbWorkspacesSelected=e.workspaces.filter(n=>n.checked===!0)?.length}updateNbSeatsSelected(e){setTimeout(()=>{this.seatsCheckedNumber(e)})}seatsCheckedNumber(e){e.nbSeatsSelected=e.seats.filter(n=>n.checked===!0)?.length}openStripeDocumentation(){window.open(this.translate.get("components.integrations.page.stripe.documentation.url"),"_blank")}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(_e),y(Ce),y(U),y(Dn),y(Se),y(lt))}}static{this.\u0275cmp=P({type:i,selectors:[["app-add-service"]],viewQuery:function(n,t){if(n&1&&A(X1,5),n&2){let s;D(s=O())&&(t.stepper=s.first)}},inputs:{in:[0,"service","in"],workspaces:"workspaces",seats:"seats"},outputs:{serviceUpdated:"serviceUpdated"},decls:76,vars:59,consts:[["stepper",""],["inputTitle",""],["selectAll",""],["saveButton",""],["tvaAutocomplete","matAutocomplete"],["inputPrice","ngModel"],["checkBoxCowork",""],["mat-dialog-title","",4,"ngIf"],[3,"linear"],[3,"label","stepControl"],[3,"formGroup"],[4,"ngIf"],[1,"d-flex","mt-1","mb-2"],["formControlName","rootType",1,"w-75"],[3,"value"],["class","mt-2 serviceTypes",4,"ngIf"],[1,"row","mt-2"],[1,"col-12","pb-4"],["floatLabel","always",1,"w-100",3,"hintLabel"],["matInput","","type","text","name","title","maxlength","255","formControlName","title","required","",3,"placeholder"],["align","end"],[1,"col-12","pb-3"],["floatLabel","always",1,"w-100"],["matInput","","type","text","name","description","formControlName","description",3,"placeholder"],[1,"col-12"],["floatLabel","always",1,"w-25"],["matInput","","type","text","name","reference","formControlName","reference","required","",3,"placeholder"],[1,"col-12","my-3"],[3,"change","checked"],[1,"col-12","mt-2"],["textKey","global.next","type","PRIMARY",1,"py-2",3,"clicked"],[3,"label","stepControl",4,"ngIf"],[3,"label"],[1,"ms-2","serviceBuildingWorkspace"],[1,"row"],["class","col-12",4,"ngIf"],[1,"withoutExpansion"],[3,"change"],[4,"ngFor","ngForOf"],["class","row mt-2",4,"ngIf"],[1,"row","w-100","justify-content-center"],[1,"col-auto"],["textKey","global.back","type","SECONDARY","mat-dialog-close","",3,"clicked"],["textKey","global.save","type","PRIMARY",3,"clicked","isDisabled"],["mat-dialog-title",""],[1,"m-auto",3,"diameter"],[1,"mt-2","serviceTypes"],[1,"col-auto","my-2"],[3,"click","serviceType","selected"],["id","expandBtn",1,"col-auto","my-2",3,"click"],[1,"expander","p-1"],[1,"row","align-items-center"],[1,"col"],[1,"row","mb-3"],[1,"col","price-subtitle"],["id","free-toggle-group","formControlName","free"],["type","TERTIARY",3,"clicked","paddingX","textKey"],["class","row mt-3",4,"ngIf"],[1,"row","mt-3"],["textKey","global.next","type","PRIMARY",3,"clicked"],[3,"resource","fromResourcePage"],[1,"row","pt-4"],["class","price",4,"ngFor","ngForOf"],[1,"col-12","mb-3"],["type","SECONDARY","iconName","add","textKey","components.service-preview.popin.step3.prices.add",3,"clicked","isDisabled","tooltipText"],[1,"col-12","mt-4"],["floatLabel","always"],["matInput","","type","number","step","1","min","0","name","tva","formControlName","tva","required","",1,"justify-suffix",3,"matAutocomplete","placeholder"],["matTextSuffix",""],["value","5.5"],["value","10"],["value","20"],["textKey","global.next","type","PRIMARY",1,"py-2",3,"clicked","isDisabled"],[1,"price"],[1,"col-4"],["matInput","","type","number","step","1","min","0","pattern","^\\d+([\\.\\,]{1}\\d{1,2})?$","name","price_amount","required","",3,"ngModelChange","disabled","ngModel","ngModelOptions","placeholder"],["matSuffix","",1,"euroSymbol"],[1,"col-3"],["required","",3,"ngModelChange","ngModel","ngModelOptions","disabled"],["class","priceOption",3,"value",4,"ngFor","ngForOf"],["class","col-auto",4,"ngIf"],[1,"priceOption",3,"value"],[1,"delete-icon"],["iconName","delete",3,"clicked","isDisabled"],[3,"ngModelChange","ngModel","ngModelOptions","disabled"],[1,"building"],["type","TERTIARY","textKey","components.service-preview.popin.step4.select_all_workspaces",3,"clicked",4,"ngIf"],["type","TERTIARY","textKey","components.service-preview.popin.step4.deselect_all_workspaces",3,"clicked",4,"ngIf"],[1,"hint","workspace-nb"],["type","TERTIARY","textKey","components.service-preview.popin.step4.select_all_workspaces",3,"clicked"],["type","TERTIARY","textKey","components.service-preview.popin.step4.deselect_all_workspaces",3,"clicked"],[3,"click","ngModelChange","ngModel","ngModelOptions","disabled"],["type","TERTIARY","textKey","components.service-preview.popin.step4.select_all_seats",3,"clicked",4,"ngIf"],["type","TERTIARY","textKey","components.service-preview.popin.step4.deselect_all_seats",3,"clicked",4,"ngIf"],[1,"hint"],["type","TERTIARY","textKey","components.service-preview.popin.step4.select_all_seats",3,"clicked"],["type","TERTIARY","textKey","components.service-preview.popin.step4.deselect_all_seats",3,"clicked"],[1,"withoutExpansionSeat"],[3,"ngModelChange","click","ngModel","ngModelOptions","disabled"],["formControlName","deliveryType"],[1,"row","align-items-center","ms-4","pt-2","pb-4"],[1,"mb-0"],[1,"col-auto","help"],[3,"matTooltip"],[1,"row","ms-4"],["formControlName","durationQuantity",3,"required"],["class","smallOption",3,"value",4,"ngFor","ngForOf"],["formControlName","durationFrequency",3,"required"],["value","MINUTES"],[1,"p-relative"],[1,"row","align-items-center","ms-4","mt-2","mb-3"],["matInput","","type","number","step","1","pattern","^\\d*$","min","0","name","minTimeQuantity","formControlName","minTimeQuantity",3,"placeholder"],["formControlName","minTimeFrequency"],["value","HOURS"],["value","DAYS"],["value","WEEKS"],["class","info",4,"ngIf"],[1,"col-12","mt-3","mb-4"],[1,"mt-3"],["formControlName","requiresPreparation"],[1,"col-4","mb-3"],["matInput","","type","number","step","1","pattern","^\\d*$","min","0","name","availableQuantity","formControlName","availableQuantity",3,"placeholder"],["matInput","","type","text","name","deliveryLocation","formControlName","deliveryLocation",3,"placeholder"],[1,"smallOption",3,"value"],[1,"info"],[1,""]],template:function(n,t){if(n&1){let s=k();h(0,Z1,3,3,"h5",7)(1,ev,3,3,"h5",7),a(2,"mat-dialog-content")(3,"mat-vertical-stepper",8,0)(5,"mat-step",9),d(6,"translate"),a(7,"form",10),h(8,tv,2,1,"div",11),a(9,"div",12)(10,"mat-button-toggle-group",13),Wt(11,iv,3,4,"mat-button-toggle",14,qt),l()(),h(13,rv,4,2,"section",15),l()(),a(14,"mat-step",9),d(15,"translate"),a(16,"form",10)(17,"div",16)(18,"div",17)(19,"mat-form-field",18),d(20,"translate"),a(21,"mat-label"),p(22),d(23,"translate"),l(),x(24,"input",19,1),d(26,"translate"),a(27,"mat-hint",20),p(28),l(),h(29,av,3,3,"mat-error",11),l()(),a(30,"div",21)(31,"mat-form-field",22)(32,"mat-label"),p(33),d(34,"translate"),l(),x(35,"input",23),d(36,"translate"),l()(),a(37,"div",24)(38,"mat-form-field",25)(39,"mat-label"),p(40),d(41,"translate"),l(),x(42,"input",26),d(43,"translate"),l()(),a(44,"div",27)(45,"mat-slide-toggle",28),b("change",function(C){return f(s),v(t.service.bookable=C.checked)}),h(46,sv,3,3,"ng-container",11)(47,lv,3,3,"ng-container",11),l()(),a(48,"div",29)(49,"app-button",30),b("clicked",function(){return f(s),t.utils.scrollToError(),v(t.next())}),l()()()()(),h(50,fv,18,18,"mat-step",31),a(51,"mat-step",32),d(52,"translate"),a(53,"p"),p(54),d(55,"translate"),l(),a(56,"section",33)(57,"div",34),h(58,vv,2,1,"div",35),a(59,"div",24)(60,"div",36)(61,"mat-checkbox",37,2),b("change",function(C){return f(s),v(t.selectAllBuildingsWorkspacesAndSeats(C))}),h(63,bv,3,3,"span",11)(64,Cv,3,3,"span",11),l()()()(),a(65,"div",34),h(66,Pv,18,12,"ng-container",38),l()(),h(67,Tv,3,0,"div",39),l(),h(68,Nv,120,103,"mat-step",31),l()(),a(69,"mat-dialog-actions")(70,"div",40)(71,"div",41)(72,"app-button",42),b("clicked",function(){return f(s),v(t.onClose())}),l()(),a(73,"div",41)(74,"app-button",43,3),b("clicked",function(C){return f(s),v(t.save(C))}),l()()()()}if(n&2){let s=V(25),_=V(62);c("ngIf",!t.isEdit),o(),c("ngIf",t.isEdit),o(2),c("linear",!t.isEdit),o(2),c("label",u(6,37,"components.service-preview.popin.step1.title")+(t.selectedRootTypeService?" : "+t.selectedRootTypeService.locales[t.translate.getLang()].toLowerCase():""))("stepControl",t.step1Group),o(2),c("formGroup",t.step1Group),o(),c("ngIf",t.typeServicesLoading),o(3),Ut(t.typeServices),o(2),c("ngIf",t.selectedRootTypeService),o(),c("label",u(15,39,"components.service-preview.popin.step2.title")+(t.step2Group.get("title").value?" : "+t.step2Group.get("title").value:""))("stepControl",t.step2Group),o(2),c("formGroup",t.step2Group),o(3),c("hintLabel",u(20,41,"components.service-preview.popin.step2.name.hint")),o(3),g(" ",u(23,43,"components.service-preview.popin.step2.name.label")," "),o(2),c("placeholder",u(26,45,"components.service-preview.popin.step2.name.placeholder")),o(4),g(" ",(s.value==null?null:s.value.length)||0," / 255 "),o(),c("ngIf",t.step2Group.get("title").hasError("maxlength")),o(4),g(" ",u(34,47,"components.service-preview.popin.step2.description.label")," "),o(2),c("placeholder",u(36,49,"components.service-preview.popin.step2.description.placeholder")),o(5),g(" ",u(41,51,"components.service-preview.popin.step2.reference.label")," "),o(2),c("placeholder",u(43,53,"components.service-preview.popin.step2.reference.placeholder")),o(3),c("checked",t.service.bookable),o(),c("ngIf",t.service.bookable),o(),c("ngIf",!t.service.bookable),o(3),c("ngIf",(t.service==null?null:t.service.bookable)&&t.showPricesStep),o(),c("label",u(52,55,"components.service-preview.popin.step4.title")),o(3),g(" ",u(55,57,"components.service-preview.popin.step4.text")," "),o(4),c("ngIf",(t.buildings==null?null:t.buildings.length)==0||t.workspaceLoading),o(),E("d-none",t.workspaceLoading),o(4),c("ngIf",!_.checked),o(),c("ngIf",_.checked),o(),E("d-none",t.workspaceLoading),o(),c("ngForOf",t.buildings),o(),c("ngIf",t.service.bookable),o(),c("ngIf",t.service==null?null:t.service.bookable),o(6),c("isDisabled",!(t.step1Group.valid&&t.step2Group.valid&&t.step4Group.valid&&(!t.service.bookable||(t.hasStripeEnabled||t.step3Group.valid)&&t.step5Group.valid)))}},dependencies:[j,R,ft,fe,Go,ee,ht,zt,ho,Ns,Ko,gt,Ei,ui,ae,rt,el,St,Ti,ve,$,lr,cr,We,Le,pr,ir,rn,st,Te,zn,Jt,be,Ht,Yt,H,tt,ol,rl,Hr,jt,ct,Mt,pt,Vp,kt,N],styles:['.suggestType[_ngcontent-%COMP%]{font-size:.9rem}.suggestType[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-color-600)!important}p.hint[_ngcontent-%COMP%]{margin:4px 0 0;padding-left:.3rem;font-size:12px}p.hint.workspace-nb[_ngcontent-%COMP%]{margin-top:6px}.p-relative[_ngcontent-%COMP%]{position:relative}.serviceTypes[_ngcontent-%COMP%]{width:85%}.serviceTypes[_ngcontent-%COMP%]   .col-3[_ngcontent-%COMP%]{flex:0 0 20%;max-width:20%;margin-right:1%;margin-left:1%;padding:0}[_nghost-%COMP%]     .mat-mdc-vertical-content{padding:0 24px 10px!important}#expandBtn[_ngcontent-%COMP%]{cursor:pointer;width:150px}#expandBtn[_ngcontent-%COMP%]   .expander[_ngcontent-%COMP%]{width:150px;min-height:80px;border:1px solid var(--primary-color-200);border-radius:5px;font-size:1.5rem;text-align:center}#expandBtn[_ngcontent-%COMP%]   .expander[_ngcontent-%COMP%]   .row[_ngcontent-%COMP%]{min-height:80px}#addPriceBtnIcon[_ngcontent-%COMP%]{background:var(--primary-color-600);color:#fff;width:20px;height:20px;line-height:10px}#addPriceBtn[_ngcontent-%COMP%]{cursor:pointer;display:inline-block;color:var(--primary-color-600)}.grayText[_ngcontent-%COMP%]{color:#d6d6d7!important}.grayText[_ngcontent-%COMP%]   #addPriceBtnIcon[_ngcontent-%COMP%]{background:#d6d6d7!important}.grayText[_ngcontent-%COMP%]   #addPriceBtn[_ngcontent-%COMP%]{color:#d6d6d7!important}.euroSymbol[_ngcontent-%COMP%]{font-size:100%!important}.price[_ngcontent-%COMP%]   .removePriceBtn[_ngcontent-%COMP%]{background:#d6d6d7;color:#fff;width:20px;height:20px;line-height:10px}.building[_ngcontent-%COMP%]{font-weight:600!important}.col-12[_ngcontent-%COMP%]{position:relative}.help[_ngcontent-%COMP%]{color:var(--primary-color-500)}.help[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{display:flex}.info[_ngcontent-%COMP%]{color:#a8a8a8;font-size:14px;position:relative;top:-6px}  mat-option.priceOption{height:2em!important;line-height:2em!important}[_nghost-%COMP%]     .mat-mdc-form-field-type-mat-native-select.mat-mdc-form-field-disabled .mat-mdc-form-field-infix:after, .mat-mdc-input-element[_ngcontent-%COMP%]:disabled, [_nghost-%COMP%]     .mat-mdc-form-field-disabled .mat-mdc-form-field-label{color:#d6d6d7!important}.mat-mdc-option.smallOption[_ngcontent-%COMP%]{line-height:1.7em;height:1.7em}.withoutExpansion[_ngcontent-%COMP%]{height:48px;display:flex;align-items:center;background-color:#fff;transition:all ease .2s}.withoutExpansion[_ngcontent-%COMP%]:after{content:"";bottom:0;width:100%;background-color:#d6d6d7;height:1px;position:absolute;left:0}.withoutExpansion[_ngcontent-%COMP%]:hover{transition:all ease .2s;background-color:#d6d6d720}[_nghost-%COMP%]     .mat-expansion-panel{box-shadow:none!important;margin:0 -15px;border-radius:0!important}[_nghost-%COMP%]     .mat-expansion-panel .mat-expansion-panel-header{padding:0 15px;border-radius:0!important;height:auto;min-height:var(--mat-expansion-header-collapsed-state-height)}[_nghost-%COMP%]     .mat-expansion-panel .mat-mdc-checkbox-layout{margin:0}[_nghost-%COMP%]     .mat-expansion-panel .mat-expansion-panel-body{padding:0}[_nghost-%COMP%]     .mat-expansion-panel .mat-expansion-panel-body .row{padding-left:15px}[_nghost-%COMP%]     .mat-expansion-panel .mat-expansion-panel-body .row .mat-mdc-content{padding-left:25px}[_nghost-%COMP%]     .mat-expansion-panel .mat-expansion-panel-body .mat-expansion-panel-header{padding-right:30px}[_nghost-%COMP%]     .mat-expansion-panel .withoutExpansion{padding-left:40px;margin:0 -15px}[_nghost-%COMP%]     .mat-expansion-panel .withoutExpansionSeat{padding-left:65px;margin:0 -15px;height:48px;display:flex;align-items:center;background-color:#fff;transition:all ease .2s}[_nghost-%COMP%]     .mat-expansion-panel .withoutExpansionSeat:after{content:"";bottom:0;width:100%;background-color:#d6d6d7;height:1px;position:absolute;left:0}[_nghost-%COMP%]     .mat-expansion-panel .withoutExpansionSeat:hover{transition:all ease .2s;background-color:#d6d6d720}[_nghost-%COMP%]     .mat-expansion-panel .mat-expansion-panel-header.mat-mdc-expanded{height:48px}[_nghost-%COMP%]     .mat-expansion-panel:after{content:"";width:100%;background-color:#d6d6d7;height:1px;position:absolute;left:0;bottom:0}[_nghost-%COMP%]     .mat-expansion-panel.mat-mdc-expanded .mat-expansion-panel-header:after{content:"";bottom:0;width:100%;background-color:#d6d6d7;height:1px;position:absolute;left:0}.justify-suffix[_ngcontent-%COMP%]{width:fit-content}.delete-icon[_ngcontent-%COMP%]{padding-top:10px}#free-toggle-group[_ngcontent-%COMP%]{min-width:180px}.price-subtitle[_ngcontent-%COMP%]{font-size:16px;font-weight:600}']})}}return i})();var Qe=Me(an());var Fv=["arrivalPicker"],Lv=["departurePicker"];function qv(i,r){if(i&1&&(a(0,"div",16),p(1),l()),i&2){let e=m();o(),g(" ",e.service.title," ")}}function Wv(i,r){i&1&&(a(0,"div",22),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.begin_date")," "))}function Uv(i,r){if(i&1){let e=k();M(0),x(1,"mat-divider",23),a(2,"div",22),p(3),d(4,"translate"),l(),a(5,"div",6)(6,"div",19)(7,"app-moffi-date-time-picker",20,1),b("onDateChange",function(t){f(e);let s=m(2);return v(s.onEndDateChange(t))}),l()()(),S()}i&2&&(o(3),g(" ",u(4,1,"components.order_summary.end_date")," "))}function zv(i,r){if(i&1){let e=k();a(0,"div",17),h(1,Wv,3,3,"div",18),a(2,"div",6)(3,"div",19)(4,"app-moffi-date-time-picker",20,0),b("onDateChange",function(t){f(e);let s=m();return v(s.onStartDateChange(t))}),l()()(),h(6,Uv,9,3,"ng-container",21),l()}if(i&2){let e=m();o(),c("ngIf",e.service.deliveryType==="RANGE"),o(5),c("ngIf",e.service.deliveryType==="RANGE")}}var Np=(()=>{class i{set bs(e){this.bookedService=e,this.quantity=e.quantity,this.startDate=e.startDate,this.arrival=(0,Qe.default)(this.startDate),this.endDate=e.endDate,this.departure=(0,Qe.default)(this.endDate),this.building=e.building,this.workspace=e.workspace,this.service=e.service,this.configArrival(),this.configDeparture()}set sd(e){this.startDate=e,this.arrival=(0,Qe.default)(this.startDate),e&&(this.departure=this.arrival.clone().add(1,"hour"),this.endDate=this.departure.toString()),this.configArrival()}set ed(e){this.endDate=e,this.departure=(0,Qe.default)(this.endDate),this.configDeparture()}constructor(e,n,t,s){this.api=e,this.translate=n,this.toastr=t,this.modalService=s,this.moment=Qe.default,this.quantity=1,this.arrival=(0,Qe.default)(Date.now()),this.departure=(0,Qe.default)(Date.now()),this.bookedService={id:null,quantity:1},this.bookedServiceChange=new L(!0),this.startDate=null,this.endDate=null,this.service=null,this.workspace=null,this.building=null}ngOnInit(){this.startDate||(this.startDate=Date.now()),this.endDate||(this.endDate=Date.now())}ngAfterViewInit(){this.configArrival(),this.configDeparture()}onStartDateChange(e){this.arrival=e;let n=this.computeHoursRange(this.arrival);this.arrivalPicker.minHour=n.minTime,this.arrivalPicker.maxHour=n.maxTime,this.arrivalPicker.updateValideHours(),this.checkDepartureValidity()}checkDepartureValidity(){this.departurePicker&&(this.departurePicker.minDate=this.arrival,this.arrival.isAfter(this.departure)?(this.departure=null,this.departurePicker.date=null,this.departurePicker.update()):this.onEndDateChange(this.departure))}onEndDateChange(e){if(this.departure=e,this.departure?.isSame(this.arrival,"day"))this.departurePicker.minHour=this.arrival.format("HH:mm"),this.departurePicker.updateValideHours();else if(this.departure?.isAfter(this.arrival)){let n=this.computeHoursRange(this.departure);this.departurePicker.minHour=n.minTime,this.departurePicker.updateValideHours()}}configArrival(){if(this.arrivalPicker&&this.arrival){this.arrivalPicker.date=this.arrival,this.arrivalPicker.minDate=(0,Qe.default)(this.startDate),this.arrivalPicker.maxDate=this.endDate;let e=this.computeHoursRange(this.arrival);this.arrivalPicker.minHour=e.minTime,this.arrivalPicker.maxHour=e.maxTime,this.arrivalPicker.update(),this.configDeparture()}}configDeparture(){if(this.departurePicker&&this.departure){this.departurePicker.date=this.departure,this.departurePicker.minDate=this.arrival,this.departurePicker.maxDate=this.endDate;let e=this.computeHoursRange(this.departure);this.departurePicker.minHour=e.minTime,this.departurePicker.maxHour=e.maxTime,this.departurePicker.update()}}computeHoursRange(e){let n={minTime:"00:00",maxTime:"23:59"};if(this.workspace)n.minTime=(0,Qe.default)(this.startDate).format("HH:mm"),n.maxTime=(0,Qe.default)(this.endDate).format("HH:mm");else if(this.schedule){let t=this.getDaySchedule(this.schedule,e.toDate());t?.beginningMorning&&(n.minTime=t.beginningMorning,n.maxTime=t.endingAfternoon),e.isSame((0,Qe.default)(),"day")&&(n.minTime=(0,Qe.default)().format("HH:mm"))}return n}get schedule(){return this.service?.schedule??this.workspace?.schedule??this.building?.schedule}getDaySchedule(e,n){let t=null;if(e)switch(n.getDay()){case 0:t=e.sunday;break;case 1:t=e.monday;break;case 2:t=e.tuesday;break;case 3:t=e.wednesday;break;case 4:t=e.thursday;break;case 5:t=e.friday;break;case 6:t=e.saturday;break}return t}addQuantity(){this.quantity++}removeQuantity(){this.quantity--}addOrEditBookedService(e=null,n){let t;if(this.api.order)t=Object.assign({},this.api.order);else{let C=this.building?.company??this.workspace?.company;t={services:[],bookings:[],company:C,timezone:Qe.default.tz.guess()}}let s=t,_={id:e,startDate:Qe.default.tz(this.arrival,Qe.default.tz.guess()).utc().format(),endDate:this.departure?Qe.default.tz(this.departure,Qe.default.tz.guess()).utc().format():null,quantity:this.quantity?this.quantity:1,service:this.service,workspace:this.workspace,building:this.building};(!this.service.deliveryType||this.service.deliveryType!=="RANGE")&&(_.endDate=null),this.estimate(_,s,e,n)}openAuthenticatedModal(e=null,n){let t=this.modalService.open(hr,{size:"lg",scrollable:!0,centered:!0});t.componentInstance.onSuccess=()=>{t.close(),this.addOrEditBookedService(e,n)},t.componentInstance.onClose=()=>{t.close()}}estimate(e,n,t=null,s){this.api.servicesService.estimate(e,s?.button).then(_=>{if(_.canBeBooked){if(e.id){let C=n.services.findIndex(I=>I.id===e.id);C>-1?n.services[C]=e:n.services.push(e)}else n.services.push(e);this.api.orderService.add(n,s?.button)}else this.toastr.error(this.translate.get("components.book-service.errors."+_.errorCode.toLowerCase()))}).catch(()=>{this.api.isAuthenticated()||this.openAuthenticatedModal(t,s)})}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(U),y(Ce),y(Ue))}}static{this.\u0275cmp=P({type:i,selectors:[["app-book-service"]],viewQuery:function(n,t){if(n&1&&(A(Fv,5),A(Lv,5)),n&2){let s;D(s=O())&&(t.arrivalPicker=s.first),D(s=O())&&(t.departurePicker=s.first)}},inputs:{bs:[0,"bookedService","bs"],sd:[0,"startDate","sd"],ed:[0,"endDate","ed"],service:"service",workspace:"workspace",building:"building"},outputs:{bookedServiceChange:"bookedServiceChange"},decls:19,vars:9,consts:[["arrivalPicker",""],["departurePicker",""],[1,"container","p-0"],[1,"row","mb-2"],[1,"col"],["class","mat-label-large",4,"ngIf"],[1,"row","align-items-center"],[1,"justify-content-center","text-center","col-5","pe-0"],[1,"row","align-items-center","justify-content-center"],[1,"col-3","p-0"],["id","tag-book-service-remove-button-clicked","mat-mini-fab","",1,"quantity-button",3,"click","disabled"],[1,"col-auto","px-1"],["type","text","min","1",1,"quantity","px-1","py-1","text-center",3,"ngModelChange","ngModel"],["id","tag-book-service-add-button-clicked","mat-mini-fab","",1,"quantity-button",3,"click","disabled"],["class","pt-2 pb-2",4,"ngIf"],["id","tag-book-service-add-or-edit-button-clicked","type","SECONDARY",1,"py-2",3,"clicked","textKey","widthFull"],[1,"mat-label-large"],[1,"pt-2","pb-2"],["class","mat-title-small pb-2",4,"ngIf"],[1,"col-12"],[3,"onDateChange"],[4,"ngIf"],[1,"mat-title-small","pb-2"],[1,"my-3"]],template:function(n,t){n&1&&(a(0,"div",2)(1,"div",3)(2,"div",4),h(3,qv,2,1,"div",5),l()(),a(4,"div",6)(5,"div",7)(6,"div",8)(7,"div",9)(8,"button",10),b("click",function(){return t.removeQuantity()}),a(9,"mat-icon"),p(10,"remove"),l()()(),a(11,"div",11)(12,"input",12),Pe("ngModelChange",function(_){return Ee(t.quantity,_)||(t.quantity=_),_}),l()(),a(13,"div",9)(14,"button",13),b("click",function(){return t.addQuantity()}),a(15,"mat-icon"),p(16,"add"),l()()()()()(),h(17,zv,7,2,"div",14),l(),a(18,"app-button",15),b("clicked",function(_){return t.addOrEditBookedService(t.bookedService==null?null:t.bookedService.id,_)}),l()),n&2&&(o(3),c("ngIf",(t.service==null?null:t.service.deliveryType)!==null),o(5),c("disabled",t.quantity===1),o(3),E("my-2",t.service.deliveryType!==null),o(),Ie("ngModel",t.quantity),o(2),c("disabled",t.service.availableQuantity!==null&&t.quantity>=t.service.availableQuantity),o(3),c("ngIf",t.service.deliveryType!=null),o(),c("textKey",(t.bookedService==null?null:t.bookedService.id)===null?"components.service-preview.add_service":"components.service-preview.edit_service")("widthFull",!0))},dependencies:[R,fe,ee,gt,$,dt,nl,H,Bp,N],styles:[".quantity[_ngcontent-%COMP%]{border:1px solid var(--primary-color-600);width:35px;text-align:right;border-radius:3px}.quantity[_ngcontent-%COMP%]:focus-visible{outline:1px solid var(--primary-color-600);border:none;border-radius:3px;width:35px}.quantity-button[_ngcontent-%COMP%]{background-color:var(--primary-color-600);color:#fff;width:20px;height:20px;line-height:14px;font-size:14px;box-shadow:none}.quantity-button[_ngcontent-%COMP%]  .mat-mdc-button-wrapper{line-height:14px;padding:0}.quantity-button[_ngcontent-%COMP%]  .mat-mdc-button-wrapper .mat-icon{font-size:12px;padding-right:4px;padding-top:4px;color:#fff}"]})}}return i})();var Fp=Me(an());var Qv=i=>[i],Lp=()=>["f_png","c_mfit","w_30","h_30"];function Hv(i,r){if(i&1&&(M(0),p(1),S()),i&2){let e=m();o(),g(" (",e.service==null?null:e.service.quantity,") ")}}function Yv(i,r){i&1&&(He(),a(0,"svg",13),x(1,"path",14)(2,"path",15),l())}function Gv(i,r){if(i&1&&(M(0),h(1,Yv,3,0,"svg",12),S()),i&2){let e=m();o(),c("ngIf",e.utils.isAdmin(e.service.company)||e.utils.isCompanyWorkspaceManager(e.service.company)||e.utils.isCompanyGroupManager(e.service.company)||e.utils.isCompanyOfficeManager())}}function Kv(i,r){if(i&1){let e=k();a(0,"app-button-action",16,3),b("click",function(){f(e);let t=V(1),s=m();return v(s.openedPopover=t)}),l()}if(i&2){m();let e=V(13);c("ngbPopover",e)("autoClose","outside")("popoverClass","popover-comment")}}function $v(i,r){i&1&&p(0," radio_button_checked ")}function Xv(i,r){i&1&&p(0," radio_button_unchecked ")}function Jv(i,r){if(i&1){let e=k();a(0,"button",17),b("click",function(){let t=f(e).$implicit,s=m();return v(s.changeServiceStatus(t))}),a(1,"mat-icon"),h(2,$v,1,0)(3,Xv,1,0),l(),a(4,"span"),p(5),d(6,"translate"),l()()}if(i&2){let e=r.$implicit,n=m();o(2),$e((n.service==null?null:n.service.status)===e?2:3),o(3),w(u(6,2,"components.bookings.bookings_table.services.status."+e))}}function Zv(i,r){if(i&1&&(x(0,"img",41),d(1,"imageTransform"),d(2,"translate")),i&2){let e=m().$implicit;we("src",T(1,2,e.author.avatar,X(7,Lp)),K),c("alt",u(2,5,"global.alts.avatar-custom"))}}function eb(i,r){i&1&&(x(0,"img",42),d(1,"translate")),i&2&&c("alt",u(1,1,"global.alts.avatar-default"))}function tb(i,r){if(i&1){let e=k();a(0,"div",43)(1,"button",44),b("click",function(){f(e);let t=m().$implicit,s=m(2);return v(s.setEditedComment(t))}),a(2,"mat-icon"),p(3,"edit"),l()(),a(4,"button",44),b("click",function(){f(e);let t=m().$implicit,s=m(2);return v(s.removeComment(t))}),a(5,"mat-icon"),p(6,"delete"),l()()()}}function ib(i,r){if(i&1&&(a(0,"span"),p(1),l()),i&2){let e=m().$implicit;o(),w(e.text)}}function nb(i,r){if(i&1&&(a(0,"span"),p(1),d(2,"translate"),a(3,"em"),p(4),d(5,"translate"),l()()),i&2){let e=m().$implicit,n=m(2);o(),g("",u(2,2,"components.bookings.bookings_table.comments.status_changed")," "),o(3),w(u(5,4,"components.bookings.bookings_table.services.status."+n.JSON.parse(e.data).status))}}function ob(i,r){if(i&1){let e=k();a(0,"div",45)(1,"div",46)(2,"mat-form-field",47)(3,"mat-label"),p(4),d(5,"translate"),l(),a(6,"input",48,4),d(8,"translate"),b("keyup",function(t){f(e);let s=V(7),_=m().$implicit,C=m(2);return v(C.keyupEditComment(_,s.value,t.which))}),l()()(),a(9,"div",22)(10,"button",49),b("click",function(){f(e);let t=V(7),s=m().$implicit;return m(2).editComment(s,t.value),v(t.value="")}),p(11),d(12,"translate"),l()()()}if(i&2){let e=m().$implicit;o(4),w(u(5,4,"components.user.infopop.comment")),o(2),c("placeholder",u(8,6,"components.user.infopop.comment"))("value",e.text),o(5),g(" ",u(12,8,"components.user.infopop.comment_send")," ")}}function rb(i,r){if(i&1&&(a(0,"div",30)(1,"div",31)(2,"div",23),h(3,Zv,3,8,"img",24)(4,eb,2,3,"img",25),l()(),a(5,"div",32)(6,"div",33)(7,"div",34)(8,"span",35),p(9),l()(),a(10,"div",36)(11,"span",37),p(12),l()(),h(13,tb,7,0,"div",38),l(),a(14,"div",39),h(15,ib,2,1,"span",9)(16,nb,6,6,"span",9)(17,ob,13,10,"div",40),l()()()),i&2){let e=r.$implicit,n=m(2);o(3),c("ngIf",e.author.avatar),o(),c("ngIf",!e.author.avatar),o(4),Mn("matTooltip","",e==null||e.author==null?null:e.author.firstname," ",e==null||e.author==null?null:e.author.lastname,""),o(),Q(" ",e==null||e.author==null?null:e.author.firstname," ",e==null||e.author==null?null:e.author.lastname," "),o(3),w(n.moment(e==null?null:e.updatedAt).format("DD MMM - HH:mm")),o(),c("ngIf",n.api.user.id===e.author.id&&e.editable),o(2),c("ngIf",(n.editedComment==null?null:n.editedComment.id)!==(e==null?null:e.id)&&!e.data),o(),c("ngIf",e.data),o(),c("ngIf",(n.editedComment==null?null:n.editedComment.id)===(e==null?null:e.id))}}function ab(i,r){if(i&1&&(x(0,"img",41),d(1,"imageTransform"),d(2,"translate")),i&2){let e=m(2);we("src",T(1,2,e.api.user.avatar,X(7,Lp)),K),c("alt",u(2,5,"global.alts.avatar-custom"))}}function sb(i,r){i&1&&(x(0,"img",42),d(1,"translate")),i&2&&c("alt",u(1,1,"global.alts.avatar-default"))}function lb(i,r){if(i&1){let e=k();a(0,"div",18),h(1,rb,18,12,"div",19),l(),a(2,"div",20)(3,"div",21)(4,"div",22)(5,"div",23),h(6,ab,3,8,"img",24)(7,sb,2,3,"img",25),l()(),a(8,"div",26)(9,"mat-form-field",27)(10,"input",28,4),d(12,"translate"),b("keyup",function(t){f(e);let s=m();return v(s.keyupComment(t))}),l()()(),a(13,"div",22)(14,"button",29),b("click",function(){f(e);let t=V(11);return m().sendComment(t.value,t),v(t.value="")}),p(15),d(16,"translate"),l()()()()}if(i&2){let e=V(11),n=m();o(),c("ngForOf",n.service==null?null:n.service.comments),o(2),E("commentSeparator",(n.service==null||n.service.comments==null?null:n.service.comments.length)>0),o(3),c("ngIf",n.api.user.avatar),o(),c("ngIf",!n.api.user.avatar),o(3),c("placeholder",u(12,8,"components.user.infopop.comment")),o(4),c("disabled",!e.value||e.value.trim().length===0),o(),g(" ",u(16,10,"components.user.infopop.comment_send")," ")}}function cb(i,r){if(i&1){let e=k();a(0,"mat-list",50)(1,"mat-list-item",51),b("click",function(){f(e);let t=m();return v(t.changeServiceStatus("TO_BE_PREPARED"))}),p(2),d(3,"translate"),l(),x(4,"mat-divider"),a(5,"mat-list-item",51),b("click",function(){f(e);let t=m();return v(t.changeServiceStatus("IN_PROGRESS"))}),p(6),d(7,"translate"),l(),x(8,"mat-divider"),a(9,"mat-list-item",51),b("click",function(){f(e);let t=m();return v(t.changeServiceStatus("READY"))}),p(10),d(11,"translate"),l(),x(12,"mat-divider"),a(13,"mat-list-item",51),b("click",function(){f(e);let t=m();return v(t.changeServiceStatus("FINISHED"))}),p(14),d(15,"translate"),l()()}if(i&2){let e=m();o(),E("active",(e.service==null?null:e.service.status)==="TO_BE_PREPARED"),o(),w(u(3,12,"components.bookings.bookings_table.services.status.TO_BE_PREPARED")),o(3),E("active",(e.service==null?null:e.service.status)==="IN_PROGRESS"),o(),w(u(7,14,"components.bookings.bookings_table.services.status.IN_PROGRESS")),o(3),E("active",(e.service==null?null:e.service.status)==="READY"),o(),w(u(11,16,"components.bookings.bookings_table.services.status.READY")),o(3),E("active",(e.service==null?null:e.service.status)==="FINISHED"),o(),w(u(15,18,"components.bookings.bookings_table.services.status.FINISHED"))}}var ea=(()=>{class i{constructor(e,n,t,s,_){this.api=e,this.utils=n,this.changeDetector=t,this.toastr=s,this.translate=_,this.moment=Fp.default,this.JSON=JSON,this.service=null,this.openedPopover=null,this.serviceStatuses=["TO_BE_PREPARED","IN_PROGRESS","READY","FINISHED"],this.hasChanged=new L(!0)}ngOnInit(){}keyupComment(e){e.which===13&&this.sendComment(e.target.value,e.target)}sendComment(e,n){e&&e!==""&&(n.disabled=!0,this.api.servicesService.addComment(this.service.id,{text:e,type:"TEXT"}).then(t=>{this.service=t,this.hasChanged.emit(this.service),this.changeDetector.destroyed||this.changeDetector.detectChanges(),n.value="",n.disabled=!1,document.getElementById("commentsListPop").scrollTo({top:0,left:0,behavior:"smooth"})}))}setEditedComment(e){this.editedComment=e}keyupEditComment(e,n,t){t===13&&this.editComment(e,n)}editComment(e,n){this.editedComment=null,e.text=n,this.api.commentService.update(e.id,e).then(()=>{for(let t=0;t<this.service.comments.length;t++)this.service.comments[t].id===e.id&&(this.service.comments[t].text=n);this.hasChanged.emit(this.service)}).catch(t=>{t.error=="COMMENT_IS_NOT_EDITABLE"&&this.toastr.error(this.translate.get("components.bookings.bookings_table.comments.error_not_editable"))})}removeComment(e){this.api.commentService.delete(e.id).then(()=>{let n=-1;for(let t=0;t<this.service.comments.length;t++)this.service.comments[t].id===e.id&&(n=t);this.service.comments.splice(n,1),this.hasChanged.emit(this.service)})}changeServiceStatus(e){let n=this.service.status;this.api.servicesService.updateBookedServiceStatus(this.service.id,{status:e}).then(t=>{this.service=t}).catch(t=>{this.service.status=n,this.hasChanged.emit(this.service),t.error=="SERVICE_USER_UNAUTHORIZED"&&this.toastr.error(this.translate.get("components.bookings.bookings_table.services.toastr.update_unauthorized"))}),this.openedPopover&&this.openedPopover.close(),this.hasChanged.emit(this.service),this.changeDetector.destroyed||this.changeDetector.detectChanges()}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(_e),y(Se),y(Ce),y(U))}}static{this.\u0275cmp=P({type:i,selectors:[["app-service-min"]],inputs:{service:"service"},outputs:{hasChanged:"hasChanged"},decls:16,vars:13,consts:[["serviceStatusMenu","matMenu"],["serviceComment",""],["serviceStatus",""],["p2","ngbPopover"],["commentValue",""],[1,"service"],[1,"service-title",3,"ngClass","matMenuTriggerFor"],[1,"status-pin"],[1,"service-overflow"],[4,"ngIf"],["class","","iconName","comment","placement","bottom","container","body",3,"ngbPopover","autoClose","popoverClass","click",4,"ngIf"],["mat-menu-item",""],["class","arrow","xmlns","http://www.w3.org/2000/svg","height","24","viewBox","0 0 24 24","width","24",4,"ngIf"],["xmlns","http://www.w3.org/2000/svg","height","24","viewBox","0 0 24 24","width","24",1,"arrow"],["d","M10 17l5-5-5-5v10z"],["d","M0 24V0h24v24H0z","fill","none"],["iconName","comment","placement","bottom","container","body",1,"",3,"click","ngbPopover","autoClose","popoverClass"],["mat-menu-item","",3,"click"],["id","commentsListPop",1,"commentsListPop","container"],["class","row mt-1 mb-2",4,"ngFor","ngForOf"],[1,"container"],[1,"row","align-items-center","pt-2"],[1,"col-auto"],[1,"avatar"],["class","m-auto",3,"src","alt",4,"ngIf"],["src","/assets/images/avatar_none.png","class","m-auto",3,"alt",4,"ngIf"],[1,"col","px-0"],["id","commentInput",1,"w-100"],["matInput","",1,"w-100",3,"keyup","placeholder"],[1,"button","button_tertiary","purple","noUnderline",3,"click","disabled"],[1,"row","mt-1","mb-2"],[1,"col-auto","me-0","pe-0"],[1,"col"],[1,"row"],[1,"col","comment-author-name"],[1,"text-truncate",3,"matTooltip"],[1,"col","text-end"],[1,"comment-date"],["class","col-auto ms-0 ps-0",4,"ngIf"],[1,"comment-text"],["class","row align-items-center",4,"ngIf"],[1,"m-auto",3,"src","alt"],["src","/assets/images/avatar_none.png",1,"m-auto",3,"alt"],[1,"col-auto","ms-0","ps-0"],["mat-icon-button","",1,"actionBtn",3,"click"],[1,"row","align-items-center"],[1,"col","pe-0"],[1,"w-100"],["matInput","",3,"keyup","placeholder","value"],[1,"button","button_tertiary","purple","noUnderline",3,"click"],[1,"serviceStatusList"],[3,"click"]],template:function(n,t){if(n&1&&(a(0,"div",5)(1,"span",6),x(2,"div",7),a(3,"span",8),p(4),h(5,Hv,2,1,"ng-container",9),l(),h(6,Gv,2,1,"ng-container",9),l(),h(7,Kv,2,3,"app-button-action",10),l(),a(8,"mat-menu",null,0),Wt(10,Jv,7,4,"button",11,qt),l(),h(12,lb,17,12,"ng-template",null,1,ne)(14,cb,16,20,"ng-template",null,2,ne)),n&2){let s=V(9);E("disabled",!(t.utils.isAdmin(t.service.company)||t.utils.isCompanyWorkspaceManager(t.service.company)||t.utils.isCompanyGroupManager(t.service.company)||t.utils.isCompanyOfficeManager()))("cancelled",(t.service==null?null:t.service.status)==="CANCELLED"),o(),c("ngClass",re(11,Qv,t.service==null?null:t.service.status.toLowerCase()))("matMenuTriggerFor",s),o(3),Q(" ",t.service==null||t.service.service==null?null:t.service.service.reference," - ",t.service==null||t.service.service==null?null:t.service.service.title," "),o(),c("ngIf",(t.service==null?null:t.service.quantity)>1),o(),c("ngIf",(t.service==null?null:t.service.status)!=="CANCELLED"),o(),c("ngIf",t.utils.isAdmin(t.service.company)||t.utils.isCompanyWorkspaceManager(t.service.company)||t.utils.isCompanyGroupManager(t.service.company)||t.utils.isCompanyOfficeManager()),o(3),Ut(t.serviceStatuses)}},dependencies:[ce,j,R,ae,rt,ve,$,dt,Kt,Gt,It,Di,Te,hp,gp,Et,tt,N,ri],styles:[".service[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-color-600);font-size:16px}.service.disabled[_ngcontent-%COMP%]{cursor:initial!important}.service.disabled[_ngcontent-%COMP%]   .service-title[_ngcontent-%COMP%]{pointer-events:none}.service.cancelled[_ngcontent-%COMP%]{cursor:default;color:var(--primary-color-500)}.service.cancelled[_ngcontent-%COMP%]   .service-title[_ngcontent-%COMP%]{pointer-events:none}.service[_ngcontent-%COMP%]   .status-pin[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:50%;float:left;margin-top:8px;margin-right:5px}.service[_ngcontent-%COMP%]   .ready[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{background-color:var(--primary-color-600) 50}.service[_ngcontent-%COMP%]   .toBePrepared[_ngcontent-%COMP%]   div[_ngcontent-%COMP%], .service[_ngcontent-%COMP%]   .to_be_prepared[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{background-color:#d3153b50}.service[_ngcontent-%COMP%]   .inProgress[_ngcontent-%COMP%]   div[_ngcontent-%COMP%], .service[_ngcontent-%COMP%]   .in_progress[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{background-color:#ffaf7950}.service[_ngcontent-%COMP%]   .cancelled[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{background-color:var(--primary-color-500)}.service[_ngcontent-%COMP%]   .finished[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{background-color:#55585e50}.service[_ngcontent-%COMP%]:not(.disabled)   .service-title[_ngcontent-%COMP%]:hover{text-decoration:underline}.service[_ngcontent-%COMP%]:not(.disabled)   .service-title[_ngcontent-%COMP%]:hover.cancelled{text-decoration:none}.service[_ngcontent-%COMP%]:not(.disabled)   .service-title[_ngcontent-%COMP%]:hover.ready   div[_ngcontent-%COMP%]{background-color:var(--primary-color-600)}.service[_ngcontent-%COMP%]:not(.disabled)   .service-title[_ngcontent-%COMP%]:hover.toBePrepared   div[_ngcontent-%COMP%], .service[_ngcontent-%COMP%]:not(.disabled)   .service-title[_ngcontent-%COMP%]:hover.to_be_prepared   div[_ngcontent-%COMP%]{background-color:#d3153b}.service[_ngcontent-%COMP%]:not(.disabled)   .service-title[_ngcontent-%COMP%]:hover.inProgress   div[_ngcontent-%COMP%], .service[_ngcontent-%COMP%]:not(.disabled)   .service-title[_ngcontent-%COMP%]:hover.in_progress   div[_ngcontent-%COMP%]{background-color:#ffaf79}.service[_ngcontent-%COMP%]:not(.disabled)   .service-title[_ngcontent-%COMP%]:hover.cancelled   div[_ngcontent-%COMP%]{background-color:var(--primary-color-500)}.service[_ngcontent-%COMP%]:not(.disabled)   .service-title[_ngcontent-%COMP%]:hover.finished   div[_ngcontent-%COMP%]{background-color:#55585e}.service-overflow[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:300px;display:inline-flex}.service-status[_ngcontent-%COMP%]{color:#303438;font-size:16px}.arrow[_ngcontent-%COMP%]{fill:var(--primary-color-600);width:20px;height:20px;transform:rotate(90deg);margin:0 3px}.status[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{cursor:initial;pointer-events:none}.sendComment[_ngcontent-%COMP%]{color:var(--primary-color-600);font-size:13px;width:13px;height:13px;cursor:pointer}#comments[_ngcontent-%COMP%]{max-height:200px;overflow:scroll}.comment[_ngcontent-%COMP%]{color:#d6d6d7}.comment[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{width:15px;height:15px;font-size:15px;vertical-align:middle}.comment[_ngcontent-%COMP%]:hover{color:var(--primary-color-600)}.avatar[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:50%;border:solid 1px var(--primary-color-600);overflow:hidden}.avatar[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:30px;height:30px}.comment-author-name[_ngcontent-%COMP%]{color:var(--primary-color-600);font-size:14px}.comment-date[_ngcontent-%COMP%]{color:var(--primary-color-500);font-size:12px}.actionBtn[_ngcontent-%COMP%]{--mdc-icon-button-state-layer-size: 24px;--mdc-icon-button-icon-size: 16px;--mat-icon-button-touch-target-display: content}.actionBtn[_ngcontent-%COMP%]     .mat-mdc-icon-button .mat-mdc-button-touch-target{width:auto}.comment-text[_ngcontent-%COMP%]{color:#55585e;font-size:14px}.comment-about[_ngcontent-%COMP%]{font-size:10px;color:var(--primary-color-500);margin-top:5px}mat-list-item[_ngcontent-%COMP%]{font-size:14px;cursor:pointer}mat-list-item.active[_ngcontent-%COMP%]{color:var(--primary-color-600)}.mat-mdc-mini-fab[_ngcontent-%COMP%]{width:20px;height:20px;line-height:14px;font-size:14px;box-shadow:none}.mat-mdc-mini-fab[_ngcontent-%COMP%]  .mat-mdc-button-wrapper{line-height:14px;padding:0}.mat-mdc-mini-fab[_ngcontent-%COMP%]  .mat-mdc-button-wrapper .mat-icon{font-size:12px;padding-right:4px;padding-top:4px;color:#fff}.commentsListPop[_ngcontent-%COMP%]{max-height:150px;overflow:auto}.commentSeparator[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.2);width:498px;position:relative;left:0}#commentInput[_ngcontent-%COMP%]  .mat-mdc-form-field-wrapper{margin-bottom:-1.25em!important}#commentInput[_ngcontent-%COMP%]  .mat-mdc-form-field-flex{padding-top:0!important}#commentInput[_ngcontent-%COMP%]  .mat-mdc-form-field-infix{border-top-width:0px}.serviceStatusList[_ngcontent-%COMP%]{padding-top:0!important}.serviceStatusList[_ngcontent-%COMP%]     *{font-size:16px}.serviceStatusList[_ngcontent-%COMP%]     .mat-mdc-list-item, .serviceStatusList[_ngcontent-%COMP%]     .mat-mdc-list-option{height:38px!important}.serviceStatusList[_ngcontent-%COMP%]     .mat-mdc-list-item .mat-mdc-list-item-content, .serviceStatusList[_ngcontent-%COMP%]     .mat-mdc-list-option .mat-mdc-list-item-content{padding:0 8px}[_nghost-%COMP%]     app-button-action{position:relative;top:6px}"]})}}return i})();var pb=()=>[5,10,20,50];function db(i,r){if(i&1&&(x(0,"mat-tab",36),d(1,"translate")),i&2){let e=r.$implicit;c("label",u(1,1,"components.booked_services.status."+e.toLowerCase()))}}function mb(i,r){i&1&&(a(0,"th",37),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.booked_services.table.headers.reference")," "))}function ub(i,r){if(i&1&&(a(0,"td",38),p(1),l()),i&2){let e=r.$implicit;o(),g(" ",!(e==null||e.order==null)&&e.order.reference?e==null||e.order==null?null:e.order.reference:"-"," ")}}function _b(i,r){i&1&&(a(0,"th",39),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.booked_services.table.headers.type")," "))}function hb(i,r){if(i&1&&(a(0,"td",38),x(1,"img",40),l()),i&2){let e=r.$implicit,n=m();o(),c("alt",e==null||e.service==null||e.service.type==null?null:e.service.type.locales[n.translate.getLang()])("matTooltip",e==null||e.service==null||e.service.type==null?null:e.service.type.locales[n.translate.getLang()])("src",n.getServiceTypeIcon(e==null||e.service==null?null:e.service.type),K)}}function gb(i,r){i&1&&(a(0,"th",41),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.booked_services.table.headers.status")," "))}function fb(i,r){if(i&1&&(a(0,"td",38),p(1),d(2,"lowercase"),d(3,"translate"),l()),i&2){let e=r.$implicit;o(),g(" ",u(3,3,u(2,1,"components.booked_services.status."+(e==null?null:e.status)))," ")}}function vb(i,r){i&1&&(a(0,"th",42),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.booked_services.table.headers.title")," "))}function bb(i,r){if(i&1){let e=k();a(0,"td",38)(1,"app-service-min",43),b("hasChanged",function(t){f(e);let s=m();return v(s.serviceHasChanged(t))}),l()()}if(i&2){let e=r.$implicit;o(),c("service",e)}}function Cb(i,r){i&1&&(a(0,"th",44),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.booked_services.table.headers.author")," "))}function xb(i,r){if(i&1&&(a(0,"td",38)(1,"span",45),p(2),l()()),i&2){let e=r.$implicit;o(),c("matTooltip",e==null||e.order==null||e.order.recipient==null?null:e.order.recipient.label),o(),g(" ",e==null||e.order==null||e.order.recipient==null?null:e.order.recipient.label," ")}}function yb(i,r){i&1&&(a(0,"th",46),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.booked_services.table.headers.start")," "))}function kb(i,r){if(i&1&&(M(0),p(1),d(2,"amParse"),d(3,"amLocal"),d(4,"amFromUtc"),d(5,"amTz"),d(6,"amDateFormat"),S()),i&2){let e=m().$implicit;o(),g(" ",T(6,10,T(5,7,u(4,5,u(3,3,u(2,1,e==null?null:e.startDate))),(e==null?null:e.timezone)||"UTC"),"DD MMM LT")," ")}}function wb(i,r){i&1&&(M(0),p(1," - "),S())}function Sb(i,r){if(i&1&&(a(0,"td",38),h(1,kb,7,13,"ng-container",47)(2,wb,2,0,"ng-container",47),l()),i&2){let e=r.$implicit;o(),c("ngIf",e==null?null:e.startDate),o(),c("ngIf",!(e!=null&&e.startDate))}}function Mb(i,r){i&1&&(a(0,"th",48),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.booked_services.table.headers.end")," "))}function Ib(i,r){if(i&1&&(M(0),p(1),d(2,"amParse"),d(3,"amLocal"),d(4,"amFromUtc"),d(5,"amTz"),d(6,"amDateFormat"),S()),i&2){let e=m().$implicit;o(),g(" ",T(6,10,T(5,7,u(4,5,u(3,3,u(2,1,e==null?null:e.endDate))),(e==null?null:e.timezone)||"UTC"),"DD MMM LT")," ")}}function Eb(i,r){i&1&&(M(0),p(1," - "),S())}function Pb(i,r){if(i&1&&(a(0,"td",38),h(1,Ib,7,13,"ng-container",47)(2,Eb,2,0,"ng-container",47),l()),i&2){let e=r.$implicit;o(),c("ngIf",e==null?null:e.endDate),o(),c("ngIf",!(e!=null&&e.endDate))}}function Tb(i,r){i&1&&(a(0,"th",49),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.booked_services.table.headers.total")," "))}function Db(i,r){if(i&1&&(M(0),p(1),d(2,"currency"),S()),i&2){let e=m().$implicit;o(),w(T(2,1,(e==null?null:e.price)/100,"EUR"))}}function Ob(i,r){i&1&&(M(0),p(1,"-"),S())}function Bb(i,r){if(i&1&&(a(0,"td",50),h(1,Db,3,4,"ng-container",47)(2,Ob,2,0,"ng-container",47),l()),i&2){let e=r.$implicit;o(),c("ngIf",(e==null?null:e.price)!=null&&(e==null?null:e.price)>0),o(),c("ngIf",(e==null?null:e.price)==null||(e==null?null:e.price)<=0)}}function Ab(i,r){i&1&&(a(0,"th",51),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.booked_services.table.headers.receipt")," "))}function Vb(i,r){if(i&1){let e=k();a(0,"app-button-action",54),b("clicked",function(t){f(e);let s=m().$implicit,_=m();return v(_.openStripeReceipt(s.order.id,t))}),l()}i&2&&c("customIcon",!0)}function Rb(i,r){if(i&1&&(a(0,"td",52),h(1,Vb,1,1,"app-button-action",53),l()),i&2){let e,n=r.$implicit,t=m();o(),c("ngIf",((e=t.getFirstTransaction(n.order))==null?null:e.method)==="CHECKOUT")}}function Nb(i,r){i&1&&x(0,"tr",55)}function Fb(i,r){i&1&&x(0,"tr",56)}function Lb(i,r){i&1&&x(0,"mat-spinner",57),i&2&&c("diameter",25)}var CP=(()=>{class i{constructor(e,n,t){this.api=e,this.changeDetector=n,this.translate=t,this.statusList=["TO_BE_PREPARED","IN_PROGRESS","READY","FINISHED","CANCELLED","ALL"],this.isLoading=!0,this.page=null,this.dataSource=[],this.displayedColumns=["reference","type","status","title","author","start","end"],this.currentStatus="TO_BE_PREPARED",this.statusChanged=new L(!0)}ngOnInit(){this.sort.active="startDate",this.api.company.parameters.stripeParameters?this.displayedColumns.push("receipt"):this.displayedColumns.push("total"),pi(this.sort.sortChange,this.paginator.page,this.statusChanged).pipe(en({}),kn(()=>{this.isLoading=!0;let e={page:this.paginator.pageIndex,size:this.paginator.pageSize||20};return this.currentStatus!=="ALL"&&(e.status=this.currentStatus),this.sort.active&&(e.sort=this.sort.active+","+this.sort.direction,this.sort.active=="created_at"&&(this.sort.active="reference")),this.api.bookedServicesService.company.get(e)}),Zi(e=>(this.isLoading=!1,this.page=e,e.content)),yn(()=>(this.isLoading=!1,Ji([])))).subscribe(e=>this.dataSource=e)}getServiceTypeIcon(e){return e.icon?e.icon:e.parent?this.getServiceTypeIcon(e.parent):e.icon}serviceHasChanged(e){if(this.currentStatus!=="ALL"&&e.status!==this.currentStatus){let n=this.dataSource.findIndex(t=>t.id===e.id);n>-1&&(this.dataSource.splice(n,1),this.page.totalElements=this.page.totalElements-1,this.table.renderRows())}}onTabChanged(e){this.selectStatus(this.statusList[e.index])}selectStatus(e){this.currentStatus=e||"ALL",this.paginator.pageIndex=0,this.statusChanged.emit()}getTabIndex(){return this.statusList.indexOf(this.currentStatus)}getFirstTransaction(e){return e?.transactions?.find(n=>n.type==="PAYMENT")}openStripeReceipt(e,n){return z(this,null,function*(){let t=yield this.api.integrationService.stripe.checkout.receipt(e,n?.button);window.open(t.value,"_blank")})}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(Se),y(U))}}static{this.\u0275cmp=P({type:i,selectors:[["app-booked-services"]],viewQuery:function(n,t){if(n&1&&(A(oi,7),A(Bi,7),A(Xn,7)),n&2){let s;D(s=O())&&(t.table=s.first),D(s=O())&&(t.paginator=s.first),D(s=O())&&(t.sort=s.first)}},decls:53,vars:33,consts:[[1,"my-3"],[1,"mat-title-large"],[1,"row","justify-content-center","mb-2","text-center"],[1,"max-w-100"],["mat-align-tabs","center","mat-stretch-tabs","false",1,"mx-auto",3,"selectedTabChange","selectedIndex","disableRipple"],[3,"label",4,"ngFor","ngForOf"],[1,"row","my-3"],[1,"col","text-center"],[1,"row","pb-4"],[1,"col","overflow-auto"],["mat-table","","matSort","","matSortActive","startDate","matSortDirection","desc",1,"w-100","m-0",3,"dataSource"],["matColumnDef","reference"],["mat-header-cell","","mat-sort-header","reference","scope","col",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","type"],["mat-header-cell","","scope","col",4,"matHeaderCellDef"],["matColumnDef","status"],["mat-header-cell","","mat-sort-header","status","scope","col",4,"matHeaderCellDef"],["matColumnDef","title"],["mat-header-cell","","mat-sort-header","title","scope","col",4,"matHeaderCellDef"],["matColumnDef","author"],["mat-header-cell","","mat-sort-header","author","scope","col",4,"matHeaderCellDef"],["matColumnDef","start"],["mat-header-cell","","mat-sort-header","startDate","scope","col",4,"matHeaderCellDef"],["matColumnDef","end"],["mat-header-cell","","mat-sort-header","endDate","scope","col",4,"matHeaderCellDef"],["matColumnDef","total"],["mat-header-cell","","mat-sort-header","price","class","text-end","scope","col",4,"matHeaderCellDef"],["mat-cell","","class","text-end",4,"matCellDef"],["matColumnDef","receipt"],["mat-header-cell","","class","text-center","scope","col",4,"matHeaderCellDef"],["mat-cell","","class","text-center",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["class","mt-3 mx-auto",3,"diameter",4,"ngIf"],["showFirstLastButtons","",1,"w-100",3,"hidden","length","pageSize","pageSizeOptions"],[3,"label"],["mat-header-cell","","mat-sort-header","reference","scope","col"],["mat-cell",""],["mat-header-cell","","scope","col"],[1,"serviceType",3,"alt","matTooltip","src"],["mat-header-cell","","mat-sort-header","status","scope","col"],["mat-header-cell","","mat-sort-header","title","scope","col"],[3,"hasChanged","service"],["mat-header-cell","","mat-sort-header","author","scope","col"],[3,"matTooltip"],["mat-header-cell","","mat-sort-header","startDate","scope","col"],[4,"ngIf"],["mat-header-cell","","mat-sort-header","endDate","scope","col"],["mat-header-cell","","mat-sort-header","price","scope","col",1,"text-end"],["mat-cell","",1,"text-end"],["mat-header-cell","","scope","col",1,"text-center"],["mat-cell","",1,"text-center"],["iconName","pdf","tooltipText","components.order-preview.menu.invoice.tooltip",3,"customIcon","clicked",4,"ngIf"],["iconName","pdf","tooltipText","components.order-preview.menu.invoice.tooltip",3,"clicked","customIcon"],["mat-header-row",""],["mat-row",""],[1,"mt-3","mx-auto",3,"diameter"]],template:function(n,t){n&1&&(a(0,"mat-card",0)(1,"mat-card-header")(2,"h5",1),p(3),d(4,"translate"),l()(),a(5,"mat-card-content")(6,"div",2)(7,"div",3)(8,"mat-tab-group",4),b("selectedTabChange",function(_){return t.onTabChanged(_)}),h(9,db,2,3,"mat-tab",5),l()()(),a(10,"div",6)(11,"div",7),p(12),d(13,"translate"),d(14,"lowercase"),d(15,"translate"),d(16,"lowercase"),d(17,"translate"),l()(),a(18,"div",8)(19,"div",9)(20,"table",10),d(21,"translate"),M(22,11),h(23,mb,3,3,"th",12)(24,ub,2,1,"td",13),S(),M(25,14),h(26,_b,3,3,"th",15)(27,hb,2,3,"td",13),S(),M(28,16),h(29,gb,3,3,"th",17)(30,fb,4,5,"td",13),S(),M(31,18),h(32,vb,3,3,"th",19)(33,bb,2,1,"td",13),S(),M(34,20),h(35,Cb,3,3,"th",21)(36,xb,3,2,"td",13),S(),M(37,22),h(38,yb,3,3,"th",23)(39,Sb,3,2,"td",13),S(),M(40,24),h(41,Mb,3,3,"th",25)(42,Pb,3,2,"td",13),S(),M(43,26),h(44,Tb,3,3,"th",27)(45,Bb,3,2,"td",28),S(),M(46,29),h(47,Ab,3,3,"th",30)(48,Rb,2,1,"td",31),S(),h(49,Nb,1,0,"tr",32)(50,Fb,1,0,"tr",33),l(),h(51,Lb,1,1,"mat-spinner",34),x(52,"mat-paginator",35),l()()()()),n&2&&(o(3),g(" ",u(4,18,"pages.dashboard.services.bookings.title")," "),o(5),c("selectedIndex",t.getTabIndex())("disableRipple",!0),o(),c("ngForOf",t.statusList),o(),E("d-none",t.isLoading||(t.page==null?null:t.page.totalElements)>0),o(2),g(" ",t.currentStatus!=="ALL"?u(13,20,"components.booked_services.no_result")+" "+u(16,26,u(15,24,u(14,22,"components.booked_services.status."+t.currentStatus))):u(17,28,"components.booked_services.empty")," "),o(8),E("d-none",t.isLoading||(t.page==null?null:t.page.totalElements)===0),c("dataSource",t.dataSource),yt("aria-label",u(21,30,"pages.dashboard.services.bookings.title")),o(29),c("matHeaderRowDef",t.displayedColumns),o(),c("matRowDefColumns",t.displayedColumns),o(),c("ngIf",t.isLoading),o(),c("hidden",t.isLoading||(t.dataSource==null?null:t.dataSource.length)===0||(t.page==null?null:t.page.totalElements)<6)("length",(t.page==null?null:t.page.totalElements)||0)("pageSize",10)("pageSizeOptions",X(32,pb)))},dependencies:[j,R,oi,Fi,Gn,Li,Ni,Ui,qi,Wi,Kn,zi,Bi,Xn,El,Te,be,Vi,Zt,tt,On,Bn,An,ea,kt,Xe,gi,ei,Hn,ti,ii,N],styles:["td[_ngcontent-%COMP%]{vertical-align:baseline}.serviceType[_ngcontent-%COMP%]{max-width:20px;max-height:20px}.mat-column-type[_ngcontent-%COMP%]{text-align:center}.list-inline-item[_ngcontent-%COMP%]{margin:0 15px;color:var(--primary-color-500)}.serviceStatusFilter[_ngcontent-%COMP%]{cursor:pointer;display:block;padding-bottom:10px;border-bottom:solid 2px transparent}.serviceStatusFilter[_ngcontent-%COMP%]:hover, .serviceStatusFilter[_ngcontent-%COMP%]:focus, .serviceStatusFilter.active[_ngcontent-%COMP%]{border-bottom:solid 2px var(--primary-color-600)}"]})}}return i})();var Wp=Me(an());var Up=Me(hi());var ss=function(i){return i.ENABLED="ENABLED",i.DISABLED="DISABLED",i.DELETED="DELETED",i}(ss||{});var qb=(i,r,e)=>({bookedService:i,index:r,length:e});function Wb(i,r){i&1&&(a(0,"mat-icon",27),d(1,"translate"),p(2,"warning"),l()),i&2&&c("inline",!0)("matTooltip",u(1,2,"components.service-preview.unlinked"))}function Ub(i,r){if(i&1&&(M(0),p(1),d(2,"translate"),S()),i&2){let e=m(2);o(),g(" ",u(2,1,(e.seatsAndWorkspaceCtrl==null||e.seatsAndWorkspaceCtrl.value==null?null:e.seatsAndWorkspaceCtrl.value.indexOf(e.workspace.id))>-1?"components.service-preview.workspace_linked":"components.service-preview.workspace_not_linked")," ")}}function zb(i,r){if(i&1&&(M(0),p(1),d(2,"translate"),S()),i&2){let e=m(2);o(),g(" ",u(2,1,e.possiblyLimitedWorkspaces.includes(e.workspace==null?null:e.workspace.type)?"components.service-preview.select_all_places":"components.service-preview.select_all_seats")," ")}}function jb(i,r){if(i&1&&(M(0),p(1),d(2,"translate"),d(3,"replace"),S()),i&2){let e=m(2);o(),g(" ",te(3,3,u(2,1,e.possiblyLimitedWorkspaces.includes(e.workspace==null?null:e.workspace.type)?"components.service-preview.places_linked":"components.service-preview.seats_linked"),":nb",e.getSeatsSelectedNumber())," ")}}function Qb(i,r){if(i&1&&(a(0,"mat-option",33),p(1),l()),i&2){let e=r.$implicit;c("value",e==null?null:e.id),o(),g(" ",e==null?null:e.fullname," ")}}function Hb(i,r){if(i&1){let e=k();a(0,"p",39),b("click",function(){f(e),m();let t=V(4);return v(t.open())}),p(1),d(2,"translate"),l()}i&2&&(o(),g(" ",u(2,1,"components.service-preview.link_required")," "))}function Yb(i,r){if(i&1){let e=k();M(0),a(1,"div",28),b("click",function(t){return f(e),v(t.stopPropagation())}),a(2,"mat-form-field",29)(3,"mat-select",30,2),b("click",function(t){return f(e),v(t.stopPropagation())}),a(5,"mat-select-trigger")(6,"p",31),h(7,Ub,3,3,"ng-container",13),l(),a(8,"p",32),h(9,zb,3,3,"ng-container",13)(10,jb,4,7,"ng-container",13),l()(),a(11,"mat-option",33),p(12),d(13,"translate"),l(),x(14,"mat-divider",34),a(15,"mat-option",35),b("click",function(){f(e);let t=m();return v(t.selectAllSeats())}),p(16),d(17,"translate"),l(),x(18,"mat-divider",34),a(19,"mat-option",36),b("click",function(){f(e);let t=m();return v(t.deselectAllSeats())}),p(20),d(21,"translate"),l(),x(22,"mat-divider",34),h(23,Qb,2,2,"mat-option",37),l()(),h(24,Hb,3,3,"p",38),l(),S()}if(i&2){let e=m();o(3),c("formControl",e.seatsAndWorkspaceCtrl),o(4),c("ngIf",(e.seatsAndWorkspaceCtrl==null||e.seatsAndWorkspaceCtrl.value==null?null:e.seatsAndWorkspaceCtrl.value.length)>0),o(2),c("ngIf",e.getSeatsSelectedNumber()==(e.workspace==null||e.workspace.seats==null?null:e.workspace.seats.length)),o(),c("ngIf",e.getSeatsSelectedNumber()!=(e.workspace==null||e.workspace.seats==null?null:e.workspace.seats.length)),o(),c("value",e.workspace.id),o(),g(" ",u(13,10,"components.service-preview.select_workspace")," "),o(4),g(" ",u(17,12,e.possiblyLimitedWorkspaces.includes(e.workspace==null?null:e.workspace.type)?"components.service-preview.select_all_places":"components.service-preview.select_all_seats")," "),o(4),g(" ",u(21,14,e.possiblyLimitedWorkspaces.includes(e.workspace==null?null:e.workspace.type)?"components.service-preview.deselect_all_places":"components.service-preview.deselect_all_seats")," "),o(3),c("ngForOf",e.workspace==null?null:e.workspace.seats),o(),c("ngIf",!(e.seatsAndWorkspaceCtrl!=null&&e.seatsAndWorkspaceCtrl.value)||(e.seatsAndWorkspaceCtrl==null||e.seatsAndWorkspaceCtrl.value==null?null:e.seatsAndWorkspaceCtrl.value.length)==0)}}function Gb(i,r){i&1&&tn(0)}function Kb(i,r){if(i&1){let e=k();a(0,"button",40),b("click",function(){f(e);let t=m();return v(t.changeServiceStatus())}),a(1,"mat-icon"),p(2,"power_settings_new"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"components.service-preview.menu.enable")))}function $b(i,r){if(i&1){let e=k();a(0,"button",41),b("click",function(){f(e);let t=m();return v(t.changeServiceStatus())}),a(1,"mat-icon"),p(2,"block"),l(),a(3,"span"),p(4),d(5,"translate"),l()()}i&2&&(o(4),w(u(5,1,"components.service-preview.menu.disable")))}function Xb(i,r){if(i&1){let e=k();a(0,"span",46),p(1),a(2,"a",47),b("click",function(){f(e);let t=m(2);return v(t.expandedDescription=!0)}),p(3),d(4,"translate"),l()()}if(i&2){let e=m(2);o(),g(" ",e.service==null?null:e.service.description.substring(0,30)," "),o(2),w(u(4,2,"components.service-preview.see_more"))}}function Jb(i,r){if(i&1&&(a(0,"span",46),p(1),l()),i&2){let e=m(2);o(),w(e.service==null?null:e.service.description)}}function Zb(i,r){if(i&1&&(a(0,"span",46),p(1),l()),i&2){let e=m(2);o(),w(e.service==null?null:e.service.description)}}function eC(i,r){i&1&&tn(0)}function tC(i,r){if(i&1&&(M(0),h(1,eC,1,0,"ng-container",49),S()),i&2){let e=m(),n=e.$implicit,t=e.index,s=m(3),_=V(49);o(),c("ngTemplateOutlet",_)("ngTemplateOutletContext",ys(2,qb,n,t,s.bookedServices==null?null:s.bookedServices.length))}}function iC(i,r){if(i&1&&(M(0),x(1,"app-book-service",50),S()),i&2){let e=m().$implicit,n=m(3);o(),c("bookedService",e)("service",e.service)("building",n.building)("workspace",n.workspace)("startDate",e.startDate)("endDate",e.endDate)}}function nC(i,r){if(i&1&&(M(0),h(1,tC,2,6,"ng-container",13)(2,iC,2,6,"ng-container",13),S()),i&2){let e=r.$implicit,n=m(3);o(),c("ngIf",e.id!==n.currentlyEditedBookedServiceId),o(),c("ngIf",e.id===n.currentlyEditedBookedServiceId)}}function oC(i,r){if(i&1&&(a(0,"section"),h(1,nC,3,2,"ng-container",48),l()),i&2){let e=m(2);o(),c("ngForOf",e.bookedServices)}}function rC(i,r){if(i&1&&(a(0,"div",51),x(1,"app-book-service",52),l()),i&2){let e=m(2);o(),c("service",e.service)("building",e.building)("workspace",e.workspace)("startDate",e.startDate)("endDate",e.endDate)}}function aC(i,r){if(i&1){let e=k();a(0,"div")(1,"span",42),b("click",function(t){f(e);let s=m();return v(s.reduceService(t))}),p(2),d(3,"translate"),a(4,"mat-icon"),p(5,"keyboard_arrow_up"),l()(),a(6,"p",43)(7,"span"),p(8),d(9,"translate"),l(),h(10,Xb,5,4,"span",44)(11,Jb,2,1,"span",44)(12,Zb,2,1,"span",44),l(),a(13,"div"),x(14,"mat-divider",29),h(15,oC,2,1,"section",13)(16,rC,2,5,"div",45),l()()}if(i&2){let e=m();c("@openCloseDetails",e.expanded?"opened":"closed"),o(2),g(" ",u(3,12,"components.service-preview.reduce")," "),o(4),E("d-none",(e.service==null?null:e.service.description)==null||(e.service==null?null:e.service.description.length)===0),o(2),w(u(9,14,"components.service-preview.description")),o(2),c("ngIf",(e.service==null||e.service.description==null?null:e.service.description.length)>30&&!e.expandedDescription),o(),c("ngIf",(e.service==null||e.service.description==null?null:e.service.description.length)>30&&e.expandedDescription),o(),c("ngIf",(e.service==null||e.service.description==null?null:e.service.description.length)<=30),o(),E("d-none",e.type!=="book"||!e.service.bookable),o(2),c("ngIf",e.type==="book"),o(),c("ngIf",e.type==="book"&&(e.service.deliveryType!==null||(e.bookedServices==null?null:e.bookedServices.length)<=0)&&e.currentlyEditedBookedServiceId===null)}}function sC(i,r){if(i&1&&(a(0,"div",53),p(1),l()),i&2){let e=m();o(),g(" ",e.totalQuantity," ")}}function lC(i,r){if(i&1&&(a(0,"span"),p(1),l()),i&2){let e=m().bookedService;o(),g("(x",e.quantity,")")}}function cC(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2){let e=m().bookedService,n=m();o(),Q(" ",u(2,2,(n.service==null?null:n.service.deliveryType)==="RANGE"?"components.service-preview.from":"components.service-preview.at")," ",n.moment(e.startDate).format("LL LT")," ")}}function pC(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2){let e=m().bookedService,n=m();o(),Q(" ",u(2,2,"components.service-preview.to")," ",n.moment(e.endDate).format("LL LT")," ")}}function dC(i,r){if(i&1){let e=k();a(0,"div",54)(1,"div",55),p(2),h(3,lC,2,1,"span",13),l(),a(4,"div",56)(5,"app-button-action",57),b("clicked",function(){let t=f(e).bookedService,s=m();return v(s.editBookedService(t))}),l(),a(6,"app-button-action",58),b("clicked",function(){let t=f(e).bookedService,s=m();return v(s.deleteBookedService(t))}),l()()(),a(7,"div",59)(8,"div",60),h(9,cC,3,4,"div",13)(10,pC,3,4,"div",13),l()()}if(i&2){let e=r.bookedService,n=r.index,t=r.length,s=m();o(2),Q(" ",s.service.title," ",s.service.deliveryType===null||n===0&&t>1?"":n+1," "),o(),c("ngIf",e.quantity>1),o(6),c("ngIf",(s.service==null?null:s.service.deliveryType)!==null),o(),c("ngIf",(s.service==null?null:s.service.deliveryType)==="RANGE")}}var zp=(()=>{class i{set updateWorkspace(e){this.workspace=e,setTimeout(()=>{this.type==="selection"&&this.updateServicesChecked()})}set sd(e){e==null?this.building&&this.api.servicesService.getFirstHourAvailable(this.service.id,this.building.id).then(n=>{this.startDate=n.value}):this.startDate=e}set ed(e){this.endDate=e}get stripePrices(){return this._stripePrices?this._stripePrices:this.api.company?this.api.integrationService.stripe.prices:[]}updateDisplayPrice(){let e="";if(this.service)if(!this.service.bookable)e=this.translate.get("components.service-preview.prices.included");else if(this.service.stripeProduct){if((this.service.stripeProduct.prices?.length??0)===0)e=this.translate.get("components.service-preview.prices.free");else if(this.stripePrices?.length>0){let n=this.service.stripeProduct.prices[0],t=this.stripePrices.find(s=>s.id===n.priceId);t&&(e=t.unitAmount/100+" \u20AC / "+this.translate.get("components.service-preview.prices.frequency."+n.unit))}}else if(this.service.prices.length===0)e=this.translate.get("components.service-preview.prices.free");else{let n=this.service.prices[0];e=n.price/100+" \u20AC "+this.translate.get("global.ht")+" / "+this.translate.get("components.service-preview.prices.frequency."+n.frequency)}this.displayedPrice=e}constructor(e,n,t,s,_){this.api=e,this.translate=n,this.toastr=t,this.dialogService=s,this.changeDetector=_,this.moment=Wp.default,this.possiblyLimitedWorkspaces=Sl,this.isMini=!1,this.selected=!1,this.displayedPrice="",this.expanded=!1,this.expandedDescription=!1,this.totalQuantity=0,this.seatsAndWorkspaceChanged=new L,this.DHFormat="YYYY-MM-DD HH:mm:ss",this.bookedServices=[],this.bookedServicesChange=new L(!0),this.currentlyEditedBookedServiceId=null,this.seatsAndWorkspaceCtrl=new ue([],[W.required])}ngOnInit(){this.bookedServices=[],this.api.orderChanged.subscribe(()=>{this.updateOrder()}),this.updateOrder(),setTimeout(()=>{this.seatsAndWorkspaceCtrl.valueChanges.subscribe(e=>{this.seatsAndWorkspaceChanged.emit({selected:this.selected,ids:e})})}),this.updateDisplayPrice(),this.api.companyEnvironment&&this.service.stripeProduct?.productId&&this.api.integrationService.stripe.getProductPrices(this.service?.stripeProduct).then(e=>{this._stripePrices=e,this.updateDisplayPrice()}),this.pricesSub=this.api.integrationService.stripe.pricesChange.subscribe(()=>{this.updateDisplayPrice()})}ngOnDestroy(){this.pricesSub.unsubscribe()}updateServicesChecked(){let e=[];this.workspace?.services?.find(n=>n.id===this.service.id)&&e.push(this.workspace.id),this.workspace?.seats?.length>0&&this.workspace?.seats.forEach(n=>{n?.services?.find(t=>t.id===this.service.id)&&e.push(n.id)}),this.seatsAndWorkspaceCtrl.setValue(e)}updateOrder(){this.bookedServices=[],this.totalQuantity=0,this.currentlyEditedBookedServiceId=null,this.api.order!=null&&this.api.order.services.length>0&&this.api.order.services.forEach(e=>{e.service.id===this.service.id&&(this.bookedServices.push(e),this.bookedServicesChange.emit(this.bookedServices),this.totalQuantity+=e.quantity)})}getIcon(e){if(e?.icon)return e.icon;if(e?.type){if(e?.type?.icon)return e?.type?.icon;if(e?.type?.parent)return this.getIcon(e?.type?.parent)}else return""}selectAllSeats(){let e=this.seatsAndWorkspaceCtrl.value?.indexOf(this.workspace.id)>-1,n=[];this.workspace.seats.forEach(t=>{n.push(t.id)}),e&&n.push(this.workspace.id),this.seatsAndWorkspaceCtrl.setValue(n)}deselectAllSeats(){let e=this.seatsAndWorkspaceCtrl.value?.indexOf(this.workspace.id)>-1,n=[];e&&n.push(this.workspace.id),this.seatsAndWorkspaceCtrl.setValue(n)}getSeatsSelectedNumber(){if(this.seatsAndWorkspaceCtrl?.value?.length>0){if(this.seatsAndWorkspaceCtrl?.value?.indexOf(this.workspace.id)>-1){let e=this.seatsAndWorkspaceCtrl?.value?.length-1;return e<0?"0":e.toString()}return this.seatsAndWorkspaceCtrl?.value?.length?.toString()}return"0"}clickService(){this.type==="selection"?(this.selected=!this.selected,this.selected?this.seatsAndWorkspaceCtrl.setValue([this.workspace.id]):this.seatsAndWorkspaceCtrl.setValue([]),this.seatsAndWorkspaceChanged.emit({selected:this.selected,ids:this.seatsAndWorkspaceCtrl.value})):this.type==="host"?this.trigger.openMenu():this.type==="book"&&!this.expanded&&(this.expanded=!this.expanded),this.changeDetector.detectChanges()}reduceService(e){this.expanded&&(this.expanded=!1,this.changeDetector.detectChanges(),e.stopPropagation())}editService(e=!1){let n=this.dialogService.open(Rp,{width:"800px",data:{service:this.service,isEdit:!0,goToResourceLinkingStep:e,onClose:t=>{t&&(this.service=t,this.updateDisplayPrice()),n.close()}}})}changeServiceStatus(){this.api.servicesService.updateStatus({id:this.service.id,status:this.service.status==="ENABLED"?"DISABLED":"ENABLED"}).then(e=>{this.service=e,this.toastr.success(this.translate.get("components.service-preview.toast.status."+this.service.status.toLowerCase()))})}deleteService(){this.api.servicesService.get(this.service.id).then(e=>{Up.default.fire({icon:"warning",title:this.translate.get("components.service-preview.swal.delete.title"),html:this.translate.get("components.service-preview.swal.delete.text").replace(":nbWorkspaces",e.workspaces?.length||0).replace(":nbBuildings",e.buildings?.length||0),confirmButtonText:this.translate.get("components.service-preview.swal.delete.confirm"),cancelButtonText:this.translate.get("global.back"),focusCancel:!0,showCancelButton:!0,reverseButtons:!0}).then(n=>{n&&n.value===!0&&this.api.servicesService.delete({id:this.service.id}).then(()=>{this.service.status=ss.DELETED,this.toastr.success(this.translate.get("components.service-preview.toast.delete"))}).catch(t=>{t.error=="SERVICE_USER_UNAUTHORIZED"&&this.toastr.error(this.translate.get("components.bookings.bookings_table.services.toastr.delete_unauthorized"))})})})}editBookedService(e){this.currentlyEditedBookedServiceId=e.id}deleteBookedService(e,n=null){let t=this.api.order.services.findIndex(s=>s.id===e.id);t>-1&&(this.api.order.services.splice(t,1),this.api.orderService.add(this.api.order,n))}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(U),y(Ce),y(Nn),y(Se))}}static{this.\u0275cmp=P({type:i,selectors:[["app-service-preview"]],viewQuery:function(n,t){if(n&1&&A(It,7),n&2){let s;D(s=O())&&(t.trigger=s.first)}},inputs:{type:"type",isMini:"isMini",service:"service",selected:"selected",company:"company",updateWorkspace:[0,"workspace","updateWorkspace"],building:"building",sd:[0,"startDate","sd"],ed:[0,"endDate","ed"],bookedServices:"bookedServices"},outputs:{seatsAndWorkspaceChanged:"seatsAndWorkspaceChanged",bookedServicesChange:"bookedServicesChange"},decls:50,vars:44,consts:[["menu","matMenu"],["bookedService",""],["select",""],["id","tag-service-preview-clicked",1,"service","py-2","px-3",3,"click"],[1,"row","c-pointer",3,"click"],[1,"col-3","text-center","align-self-center"],["alt","icon for service",1,"img-fluid",3,"src"],[1,"col-6","text-center","px-1"],[1,"name",3,"matTooltip"],["class","isUnlinked",3,"inline","matTooltip",4,"ngIf"],[1,"price"],[1,"col-12","select-workspace-and-seats"],[1,"mat-divider-grey"],[4,"ngIf"],[1,"col-3","px-1"],[1,"row","align-items-start","h-75"],[1,"col","text-end","align-self-start"],["id","tag-service-preview-edit-service-clicked","iconName","edit",1,"float-end",3,"matMenuTriggerFor","matMenuTriggerData"],["type","button","id","tag-service-preview-edit-service-edit-clicked","mat-menu-item","",3,"click"],["type","button","id","tag-service-preview-edit-service-link-resources-clicked","mat-menu-item","",3,"click"],["type","button","id","tag-service-preview-edit-service-delete-clicked","mat-menu-item","",3,"click"],[1,"mx-auto","w-85"],["type","button","id","tag-service-preview-edit-service-activate-clicked","mat-menu-item","",3,"click",4,"ngIf"],["type","button","id","tag-service-preview-edit-service-desactivate-clicked","mat-menu-item","",3,"click",4,"ngIf"],[1,"row","align-items-end","h-25"],[1,"col","text-end","align-self-end","reference"],["class","selectedQuantity",4,"ngIf"],[1,"isUnlinked",3,"inline","matTooltip"],["id","tag-service-preview-select-form-overview-clicked",1,"position-relative","pb-3",3,"click"],[1,"w-100"],["id","tag-service-preview-select-form-clicked","multiple","",3,"click","formControl"],[1,"mb-2"],[1,"m-0"],[3,"value"],[1,"mx-2"],["id","tag-service-preview-select-form-select-all-clicked",1,"hide-checkbox",3,"click"],["id","tag-service-preview-select-form-deselect-all-clicked",1,"hide-checkbox",3,"click"],[3,"value",4,"ngFor","ngForOf"],["class","error","id","tag-service-preview-select-form-error-clicked",3,"click",4,"ngIf"],["id","tag-service-preview-select-form-error-clicked",1,"error",3,"click"],["type","button","id","tag-service-preview-edit-service-activate-clicked","mat-menu-item","",3,"click"],["type","button","id","tag-service-preview-edit-service-desactivate-clicked","mat-menu-item","",3,"click"],["id","tag-service-preview-reduce-clicked",1,"reduce",3,"click"],[1,"description"],["class","text",4,"ngIf"],["class","mt-2",4,"ngIf"],[1,"text"],["id","tag-service-preview-expand-description-clicked",1,"see_more",3,"click"],[4,"ngFor","ngForOf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"bookedService","service","building","workspace","startDate","endDate"],[1,"mt-2"],[3,"service","building","workspace","startDate","endDate"],[1,"selectedQuantity"],[1,"row","mt-2"],[1,"col-7","col-md-8","place"],[1,"col","d-flex","justify-content-end"],["iconName","edit",3,"clicked"],["iconName","delete",3,"clicked"],[1,"row"],[1,"col","placeContent"]],template:function(n,t){if(n&1){let s=k();a(0,"div",3),b("click",function(){return f(s),v(t.clickService())}),a(1,"div",4),b("click",function(C){return f(s),v(t.reduceService(C))}),a(2,"div",5),x(3,"img",6),l(),a(4,"div",7)(5,"div",8)(6,"p"),p(7),l(),h(8,Wb,3,4,"mat-icon",9),l(),a(9,"div",10),p(10),l()(),a(11,"div",11),x(12,"mat-divider",12),h(13,Yb,25,16,"ng-container",13)(14,Gb,1,0,"ng-container",13),l(),a(15,"div",14)(16,"div",15)(17,"div",16),x(18,"app-button-action",17),a(19,"mat-menu",null,0)(21,"button",18),b("click",function(){return f(s),v(t.editService())}),a(22,"mat-icon"),p(23,"edit"),l(),a(24,"span"),p(25),d(26,"translate"),l()(),a(27,"button",19),b("click",function(){return f(s),v(t.editService(!0))}),a(28,"mat-icon"),p(29,"location_on"),l(),a(30,"span"),p(31),d(32,"translate"),l()(),a(33,"button",20),b("click",function(){return f(s),v(t.deleteService())}),a(34,"mat-icon"),p(35,"delete"),l(),a(36,"span"),p(37),d(38,"translate"),l()(),x(39,"mat-divider",21),h(40,Kb,6,3,"button",22)(41,$b,6,3,"button",23),l()()(),a(42,"div",24)(43,"div",25),p(44),d(45,"translate"),l()()()(),h(46,aC,17,16,"div",13)(47,sC,2,1,"div",26),l(),h(48,dC,11,5,"ng-template",null,1,ne)}if(n&2){let s=V(20);E("selected",t.selected)("disabled",t.service.status==="DISABLED"),o(2),E("col-12",t.isMini),o(),c("src",t.getIcon(t.service),K),o(),E("col-12",t.isMini)("col-9",t.type!=="host"),o(),E("mt-3",t.isMini),c("matTooltip",t.service.title),o(2),g(" ",t.service.title," "),o(),c("ngIf",t.type==="host"&&!(t.service!=null&&t.service.isLinked)),o(),E("d-none",t.isMini),o(),g(" ",t.displayedPrice," "),o(),E("d-none",!t.selected||!(t.workspace!=null&&t.workspace.isShared)||(t.workspace==null||t.workspace.seats==null?null:t.workspace.seats.length)===0),o(2),c("ngIf",(t.workspace==null?null:t.workspace.isShared)&&(t.workspace==null||t.workspace.seats==null?null:t.workspace.seats.length)>0),o(),c("ngIf",!(t.workspace!=null&&t.workspace.seats)||(t.workspace==null||t.workspace.seats==null?null:t.workspace.seats.length)===0),o(),E("d-none",t.type!=="host"||t.isMini),o(3),c("matMenuTriggerFor",s)("matMenuTriggerData",t.service),o(7),w(u(26,36,"components.service-preview.menu.edit")),o(6),w(u(32,38,"components.service-preview.menu.link_resources")),o(6),w(u(38,40,"components.service-preview.menu.delete")),o(3),c("ngIf",(t.service==null?null:t.service.status)==="DISABLED"),o(),c("ngIf",(t.service==null?null:t.service.status)==="ENABLED"),o(3),Q(" ",u(45,42,"components.service-preview.reference")," ",t.service.reference," "),o(2),c("ngIf",t.type!=="selection"),o(),c("ngIf",t.totalQuantity>0&&t.type==="book")}},dependencies:[j,R,_o,ee,Be,ae,$,dt,Kt,Gt,It,We,Oi,Le,Te,tt,Np,et,N],styles:['.service[_ngcontent-%COMP%]{border:1px solid var(--primary-color-200);border-radius:5px;background-color:#fff;overflow:hidden}.service[_ngcontent-%COMP%]   .c-pointer[_ngcontent-%COMP%]{cursor:pointer}.service[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:25px;height:25px;max-width:25px;max-height:25px;object-fit:contain}.service.selected[_ngcontent-%COMP%]{position:relative;overflow:visible;padding:.44rem .94rem!important;background-color:var(--primary-color-600)}.service.selected[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{filter:invert(1)}.service.selected[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%], .service.selected[_ngcontent-%COMP%]   .price[_ngcontent-%COMP%]{color:#fff}.service.disabled[_ngcontent-%COMP%]{background-color:transparent;opacity:.5}.service[_ngcontent-%COMP%]   .edition[_ngcontent-%COMP%]{font-size:18px;cursor:pointer}.service[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%], .service[_ngcontent-%COMP%]   .price[_ngcontent-%COMP%]{font-size:14px;line-height:1.2;word-break:break-word;hyphens:auto;overflow:hidden;text-overflow:ellipsis;display:flex;justify-content:center;-webkit-line-clamp:2;-webkit-box-orient:vertical}.service[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{width:fit-content;position:relative}.service[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]:after{content:"";width:100%;height:1px;background-color:var(--primary-color, var(--primary-color-500));bottom:calc(-.5rem - 1px);left:0;position:absolute}.service[_ngcontent-%COMP%]   .isUnlinked[_ngcontent-%COMP%]{position:relative;top:4px;left:3px;font-size:20px;color:orange}.service[_ngcontent-%COMP%]   .reference[_ngcontent-%COMP%]{font-size:9px}.service[_ngcontent-%COMP%]   .reduce[_ngcontent-%COMP%]{font-size:10px;text-decoration:underline;cursor:pointer}.service[_ngcontent-%COMP%]   .reduce[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{height:10px!important;width:10px!important;font-size:10px;vertical-align:middle}.service[_ngcontent-%COMP%]   .description[_ngcontent-%COMP%]{font-size:13px;font-weight:500}.service[_ngcontent-%COMP%]   .see_more[_ngcontent-%COMP%]{text-decoration:underline;color:#9babf7}.green-separation[_ngcontent-%COMP%]{border-color:var(--primary-color-600)}.selectedQuantity[_ngcontent-%COMP%]{position:absolute;right:5px;top:-11px;background-color:#e95579;border-radius:50%;width:22px;height:22px;color:#fff;text-align:center;font-size:12px;font-weight:500;padding-top:2px}.place[_ngcontent-%COMP%]{font-size:13px;font-weight:600}.placeText[_ngcontent-%COMP%]{font-size:13px}.bsButton[_ngcontent-%COMP%]{width:20px;height:20px}.bsButton[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{position:absolute;top:-2px;left:3px}.mat-divider-grey[_ngcontent-%COMP%]{background-color:#e9e8e8;margin-top:15px;margin-bottom:10px}.error[_ngcontent-%COMP%]{color:#d3153b;font-size:12px;margin-bottom:0;width:calc(100% - 15px);position:absolute;top:-4px;left:0}'],data:{animation:[_i("openCloseDetails",[wt("closed",qe({maxHeight:0})),wt("opened",qe({maxHeight:"1000px"})),bt("closed => opened",[vt("1s ease-in")]),bt("opened => closed",[vt("1s cubic-bezier(0, 1, 0, 1)")])])]}})}}return i})();var uC=()=>["CANCELLED","TO_BE_PREPARED","IN_PROGRESS","READY","FINISHED"];function _C(i,r){i&1&&(He(),a(0,"svg",10),x(1,"path",11)(2,"path",12),l())}function hC(i,r){i&1&&(He(),a(0,"svg",10),x(1,"path",11)(2,"path",13),l())}function gC(i,r){i&1&&(He(),a(0,"svg",10),x(1,"path",11)(2,"path",14),l())}function fC(i,r){i&1&&(He(),a(0,"svg",10),x(1,"path",11)(2,"path",15),l())}function vC(i,r){if(i&1){let e=k();a(0,"li")(1,"app-service-min",16),b("hasChanged",function(t){f(e);let s=m(3);return v(s.hasChangedService(t))}),l()()}if(i&2){let e=r.$implicit;o(),c("service",e)}}function bC(i,r){if(i&1&&(M(0),a(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5),h(5,_C,3,0,"svg",6)(6,hC,3,0,"svg",6)(7,gC,3,0,"svg",6)(8,fC,3,0,"svg",6),l(),a(9,"p",7),p(10),d(11,"lowercase"),d(12,"translate"),l()()()(),a(13,"div",8)(14,"div",3)(15,"ul",9),h(16,vC,2,1,"li",0),l()()(),S()),i&2){let e=m().$implicit,n=m();o(5),c("ngIf",e==="TO_BE_PREPARED"),o(),c("ngIf",e==="IN_PROGRESS"),o(),c("ngIf",e==="READY"),o(),c("ngIf",e==="FINISHED"),o(2),g(" ",u(12,8,u(11,6,"global.services.service_status."+e))," "),o(6),c("ngForOf",n.getServicesWithStatus(e))}}function CC(i,r){if(i&1&&(M(0),h(1,bC,17,10,"ng-container",1),S()),i&2){let e=r.$implicit,n=m();o(),c("ngIf",n.getServicesWithStatus(e).length>0)}}var qP=(()=>{class i{constructor(e,n){this.api=e,this.changeDetector=n,this.order=null,this.hasChanged=new L(!0)}ngOnInit(){this.order.services.forEach(e=>e.company=this.order.company)}getServicesWithStatus(e){return this.order.services.filter(n=>n.status===e)}hasChangedService(e){let n=this.order.services.findIndex(t=>t.id===e.id);this.order.services[n]=e,this.hasChanged.emit(this.order),this.changeDetector.detectChanges()}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(Se))}}static{this.\u0275cmp=P({type:i,selectors:[["app-services-min"]],inputs:{order:"order"},outputs:{hasChanged:"hasChanged"},decls:1,vars:2,consts:[[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"row","mt-3"],[1,"col"],[1,"d-flex","align-items-center"],[1,"svg-icon"],["xmlns","http://www.w3.org/2000/svg","height","24","viewBox","0 0 24 24","width","24",4,"ngIf"],[1,"service-status"],[1,"row","mb-3"],[1,"service"],["xmlns","http://www.w3.org/2000/svg","height","24","viewBox","0 0 24 24","width","24"],["d","M0 0h24v24H0z","fill","none"],["d","M7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7zm1-11h-2v3H8v2h3v3h2v-3h3v-2h-3V9z"],["d","M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"],["d","M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7zm-1.46-5.47L8.41 12.4l-1.06 1.06 3.18 3.18 6-6-1.06-1.06-4.93 4.95z"],["d","M12 6c3.87 0 7 3.13 7 7 0 .84-.16 1.65-.43 2.4l1.52 1.52c.58-1.19.91-2.51.91-3.92 0-4.97-4.03-9-9-9-1.41 0-2.73.33-3.92.91L9.6 6.43C10.35 6.16 11.16 6 12 6zm10-.28l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM2.92 2.29L1.65 3.57 2.98 4.9l-1.11.93 1.42 1.42 1.11-.94.8.8C3.83 8.69 3 10.75 3 13c0 4.97 4.02 9 9 9 2.25 0 4.31-.83 5.89-2.2l2.2 2.2 1.27-1.27L3.89 3.27l-.97-.98zm13.55 16.1C15.26 19.39 13.7 20 12 20c-3.87 0-7-3.13-7-7 0-1.7.61-3.26 1.61-4.47l9.86 9.86zM8.02 3.28L6.6 1.86l-.86.71 1.42 1.42.86-.71z"],[3,"hasChanged","service"]],template:function(n,t){n&1&&h(0,CC,2,1,"ng-container",0),n&2&&c("ngForOf",X(1,uC))},dependencies:[j,R,ea,kt,N],styles:[".service[_ngcontent-%COMP%]{margin:0;padding:0;list-style:none}.service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-color-600);font-size:14px}.service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .status-pin[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;float:left;margin-top:8px;margin-right:3px}.service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .ready[_ngcontent-%COMP%]   div[_ngcontent-%COMP%], .service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .finished[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{background-color:var(--primary-color-600) 50}.service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .toBePrepared[_ngcontent-%COMP%]   div[_ngcontent-%COMP%], .service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .to_be_prepared[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{background-color:#d3153b50}.service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .inProgress[_ngcontent-%COMP%]   div[_ngcontent-%COMP%], .service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .in_progress[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{background-color:#ffaf7950}.service[_ngcontent-%COMP%]   li.cancelled[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{background-color:#55585e50}.service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .service-title[_ngcontent-%COMP%]:hover{text-decoration:underline}.service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .service-title[_ngcontent-%COMP%]:hover.ready   div[_ngcontent-%COMP%], .service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .service-title[_ngcontent-%COMP%]:hover.finished   div[_ngcontent-%COMP%]{background-color:var(--primary-color-600)}.service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .service-title[_ngcontent-%COMP%]:hover.toBePrepared   div[_ngcontent-%COMP%], .service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .service-title[_ngcontent-%COMP%]:hover.to_be_prepared   div[_ngcontent-%COMP%]{background-color:#d3153b}.service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .service-title[_ngcontent-%COMP%]:hover.inProgress   div[_ngcontent-%COMP%], .service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .service-title[_ngcontent-%COMP%]:hover.in_progress   div[_ngcontent-%COMP%]{background-color:#ffaf79}.service[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .service-title[_ngcontent-%COMP%]:hover.cancelled   div[_ngcontent-%COMP%]{background-color:#55585e}.svg-icon[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:18px;height:18px;fill:#303438;margin-right:.4rem}.service-status[_ngcontent-%COMP%]{color:#303438;font-size:16px;margin-bottom:0}.status[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{cursor:initial;pointer-events:none}.sendComment[_ngcontent-%COMP%]{color:var(--primary-color-600);font-size:13px;width:13px;height:13px;cursor:pointer}#comments[_ngcontent-%COMP%]{max-height:200px;overflow:scroll}.comment[_ngcontent-%COMP%]{color:var(--primary-color-600) 50}.comment[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{width:15px;height:15px;font-size:15px;vertical-align:middle}.comment[_ngcontent-%COMP%]:hover{color:var(--primary-color-600)}.avatar[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:50%;border:solid 1px var(--primary-color-600);overflow:hidden}.avatar[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:30px;height:30px}.comment-author-name[_ngcontent-%COMP%]{color:var(--primary-color-600);font-size:14px}.comment-date[_ngcontent-%COMP%]{color:var(--primary-color-500);font-size:12px}.edit-comment[_ngcontent-%COMP%]{width:15px;height:15px;font-size:15px;color:var(--primary-color-500);cursor:pointer}.comment-text[_ngcontent-%COMP%]{color:#55585e;font-size:14px}.comment-about[_ngcontent-%COMP%]{font-size:10px;color:var(--primary-color-500);margin-top:5px}mat-list-item[_ngcontent-%COMP%]{font-size:14px;cursor:pointer}mat-list-item.active[_ngcontent-%COMP%]{color:var(--primary-color-600)}.mat-mdc-mini-fab[_ngcontent-%COMP%]{width:20px;height:20px;line-height:14px;font-size:14px;box-shadow:none}.mat-mdc-mini-fab[_ngcontent-%COMP%]  .mat-mdc-button-wrapper{line-height:14px;padding:0}.mat-mdc-mini-fab[_ngcontent-%COMP%]  .mat-mdc-button-wrapper .mat-icon{font-size:12px;padding-right:4px;padding-top:4px;color:#fff}.commentsListPop[_ngcontent-%COMP%]{max-height:150px;overflow:auto}.commentSeparator[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.2);width:500px;position:relative;left:2px}"]})}}return i})();var xC=(i,r)=>({"col-12 col-sm-6":i,"col-6 col-sm-4":r});function yC(i,r){if(i&1&&(M(0),a(1,"div",13),x(2,"app-service-preview",14),l(),S()),i&2){let e=r.$implicit,n=m(3);o(),c("ngClass",Tn(10,xC,n.type==="book",n.type!=="book")),o(),c("type",n.type)("isMini",n.isMini)("service",e)("bookedServices",e==null?null:e.bookedServices)("company",n.company)("building",n.building)("workspace",n.workspace)("startDate",n.startDate)("endDate",n.endDate)}}function kC(i,r){if(i&1){let e=k();M(0,2),a(1,"div",3)(2,"div",4)(3,"div",5),p(4),a(5,"span",6),p(6),l()()(),a(7,"div",7)(8,"div",8),b("click",function(){f(e);let t=m().$implicit,s=m();return v(s.toogleCollapsed(t==null?null:t.name))}),He(),a(9,"svg",9),x(10,"path",10)(11,"path",11),l()()()(),ki(),a(12,"div",12),h(13,yC,3,13,"ng-container",0),l(),S()}if(i&2){let e=m().$implicit,n=m();o(4),g(" ",e==null?null:e.locales[n.translate.lang]," "),o(2),w(e==null||e.services==null?null:e.services.length),o(2),E("collapsed",n.collapsed[e==null?null:e.name]),o(4),E("one",(e==null||e.services==null?null:e.services.length)<=2)("three",(e==null||e.services==null?null:e.services.length)>2)("five",(e==null||e.services==null?null:e.services.length)>4)("seven",(e==null||e.services==null?null:e.services.length)>6)("nine",(e==null||e.services==null?null:e.services.length)>8)("eleven",(e==null||e.services==null?null:e.services.length)>10)("big-height",(e==null||e.services==null?null:e.services.length)>20)("h-collapsed",n.collapsed[e==null?null:e.name]),o(),c("ngForOf",e==null?null:e.services)}}function wC(i,r){if(i&1&&(M(0),h(1,kC,14,21,"ng-container",1),S()),i&2){let e=r.$implicit;o(),c("ngIf",(e==null||e.services==null?null:e.services.length)>0)}}var jp=(()=>{class i{set updateServices(e){e?.length>0&&(this.services=e,this.updateFilterServices())}constructor(e,n){this.api=e,this.translate=n,this.services=null,this.onlyBookable=!1,this.isMini=!1,this.collapsed={catering:!1,wellness:!1,equipment:!1,service:!1},this.servicesFiltered=[]}ngOnInit(){this.api.integrationService.stripe.init()}updateFilterServices(){this.servicesFiltered=this.services,this.servicesFiltered.forEach(e=>{let n=e.services;n=n.filter(t=>t.status!=="DELETED"),this.type==="book"&&(n=n.filter(t=>t.status==="ENABLED")),this.onlyBookable&&(n=n.filter(t=>t.bookable));for(let t of n)t.bookedServices||(t.bookedServices=[]);e.services=n.sort((t,s)=>t.title.localeCompare(s.title))})}toogleCollapsed(e){this.collapsed[e]=!this.collapsed[e]}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(U))}}static{this.\u0275cmp=P({type:i,selectors:[["app-services"]],inputs:{updateServices:[0,"services","updateServices"],type:"type",onlyBookable:"onlyBookable",isMini:"isMini",company:"company",workspace:"workspace",building:"building",startDate:"startDate",endDate:"endDate"},decls:1,vars:1,consts:[[4,"ngFor","ngForOf"],["class","mb-3",4,"ngIf"],[1,"mb-3"],[1,"row"],[1,"col"],[1,"parentTitle","mt-4","mb-0"],[1,"badge","badge-moffi","mx-2"],[1,"col-auto","align-self-center","mt-4","mb-0"],["id","tag-services-arrow-clicked",1,"toogle",3,"click"],["xmlns","http://www.w3.org/2000/svg","height","24","viewBox","0 0 24 24","width","24",1,"arrow"],["d","M0 0h24v24H0V0z","fill","none"],["d","M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0 .39-.39.39-1.02 0-1.41l-6.59-6.59c-.39-.39-1.02-.39-1.41 0l-6.6 6.58c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1z"],[1,"row","height-collapse"],[1,"mt-3","mb-0",3,"ngClass"],[3,"type","isMini","service","bookedServices","company","building","workspace","startDate","endDate"]],template:function(n,t){n&1&&h(0,wC,2,1,"ng-container",0),n&2&&c("ngForOf",t.servicesFiltered)},dependencies:[ce,j,R,zp],styles:[".parentTitle[_ngcontent-%COMP%]{font-weight:500}[_nghost-%COMP%]     .mat-mdc-form-field-suffix .mat-icon{font-size:14px;width:14px;height:14px}[_nghost-%COMP%]     .toogle{cursor:pointer;width:20px;height:20px;border-radius:30px;border:1px solid var(--primary-color-600);background-color:#fff;display:flex;align-items:center;justify-content:center;transition:all ease .4s}[_nghost-%COMP%]     .toogle svg{transition:all ease .4s;fill:var(--primary-color-600);width:16px;height:16px}[_nghost-%COMP%]     .toogle.collapsed{transition:all ease .4s;background-color:var(--primary-color-600);transform:rotate(180deg)}[_nghost-%COMP%]     .toogle.collapsed svg{transition:all ease .4s;fill:#fff}.badge.badge-moffi[_ngcontent-%COMP%]{font-size:90%}.height-collapse[_ngcontent-%COMP%]{overflow:hidden;transition:all ease-in .4s;max-height:5000px}.height-collapse.one[_ngcontent-%COMP%]{max-height:1200px}.height-collapse.three[_ngcontent-%COMP%]{max-height:1500px}.height-collapse.five[_ngcontent-%COMP%]{max-height:1800px}.height-collapse.seven[_ngcontent-%COMP%]{max-height:2100px}.height-collapse.nine[_ngcontent-%COMP%]{max-height:2400px}.height-collapse.eleven[_ngcontent-%COMP%]{max-height:2700px}.height-collapse.big-height[_ngcontent-%COMP%]{max-height:10000px}.height-collapse.h-collapsed[_ngcontent-%COMP%]{transition:all ease-out .4s;max-height:0}"]})}}return i})();var Qp=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[de,Ye,fi,Ge,ai,Yn,at,Je,$n,sr,Pl,Ze,Qt,qn,nt,Wn,$t,Un,nr,Rn,Xt,fp,jn,Ai,Ri,Ae,ji,Qn,Ln,Re,ar,Tp,as,Ip,Ap,or,yp,Vn,Fn]})}}return i})();function MC(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"forms.firstname.required")," "))}function IC(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"forms.lastname.required")," "))}function EC(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"forms.phone.required")," "))}function PC(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"forms.address.required")," "))}function TC(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"forms.postal_code.required")," "))}function DC(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"forms.city.required")," "))}function OC(i,r){if(i&1&&(a(0,"mat-option",29),p(1),d(2,"translate"),l()),i&2){let e=r.$implicit;c("value",e),o(),g(" ",u(2,2,"countries."+e)," ")}}function BC(i,r){i&1&&(a(0,"mat-error"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"forms.country.required")," "))}var Hp=(()=>{class i{constructor(e,n,t,s,_){this.api=e,this.toastr=n,this.translate=t,this.modalService=s,this.utils=_,this.onSuccess=()=>{}}ngOnInit(){this.firstnameCtrl=new ue(this.api.user!=null?this.api.user.firstname:"",[W.required]),this.lastnameCtrl=new ue(this.api.user!=null?this.api.user.lastname:"",[W.required]),this.phoneCtrl=new ue(this.api.user.phoneNumber!=null?this.api.user.phoneNumber:"",[W.pattern("[0-9 ]{10}"),W.required]),this.addressCtrl=new ue(this.api.user.socialAddress.address1!=null?this.api.user.socialAddress.address1:"",[W.required]),this.address_complementCtrl=new ue(this.api.user.socialAddress.address2!=null?this.api.user.socialAddress.address2:"",[]),this.postal_codeCtrl=new ue(this.api.user.socialAddress.addressPostalCode!=null?this.api.user.socialAddress.addressPostalCode:"",[W.required]),this.cityCtrl=new ue(this.api.user.socialAddress.addressCity!=null?this.api.user.socialAddress.addressCity:"",[W.required]),this.countryCtrl=new ue(this.api.user.socialAddress.addressCountry!=null?this.api.user.socialAddress.addressCountry:"",[W.required]),this.companyNameCtrl=new ue(this.api.user.companyName!=null?this.api.user.companyName:"",[])}updateUser(e){if([this.firstnameCtrl.valid,this.lastnameCtrl.valid,this.phoneCtrl.valid,this.addressCtrl.valid,this.postal_codeCtrl.valid,this.cityCtrl.valid,this.countryCtrl.valid].every(s=>s)){let s=Object.assign({},this.api.user);s.firstname=this.firstnameCtrl.value,s.lastname=this.lastnameCtrl.value,s.phoneNumber=this.phoneCtrl.value,s.socialAddress={address1:this.addressCtrl.value,address2:this.address_complementCtrl.value,addressPostalCode:this.postal_codeCtrl.value,addressCity:this.cityCtrl.value,addressCountry:this.countryCtrl.value},s.companyName=this.companyNameCtrl.value,this.api.userService.update(s,e?.button).then(()=>{this.toastr.success(this.translate.get("pages.user.profile.toastr.success")),this.onSuccess()}).catch(()=>{this.toastr.error(this.translate.get("pages.user.profile.toastr.error"))})}else this.toastr.error(this.translate.get("pages.user.profile.toastr.invalid"))}onClose(){this.modalService.dismissAll()}static{this.\u0275fac=function(n){return new(n||i)(y(F),y(Ce),y(U),y(Ue),y(_e))}}static{this.\u0275cmp=P({type:i,selectors:[["app-user-facturation-informations"]],inputs:{user:"user"},decls:86,vars:56,consts:[["profileForm",""],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"row"],[1,"col"],[1,"card","mt-3"],[1,""],[1,"card-body"],[1,"w-100"],["matInput","","type","text","name","firstname","required","",3,"placeholder","formControl"],[4,"ngIf"],["matInput","","type","text","name","lastname","required","",3,"placeholder","formControl"],["matInput","","type","tel","name","phone","required","",3,"placeholder","formControl"],["matInput","","type","text","name","address","required","",3,"placeholder","formControl"],["matInput","","type","text","name","address_complement",3,"placeholder","formControl"],["matInput","","type","text","name","postal_code","required","",3,"placeholder","formControl"],["matInput","","type","text","name","city","required","",3,"placeholder","formControl"],["required","",3,"placeholder","formControl"],[3,"value",4,"ngFor","ngForOf"],["matInput","","type","text","name","companyName",3,"placeholder","formControl"],[1,"row","mt-3","mb-2"],[1,"col-12"],[1,"d-flex","justify-content-center"],["textKey","global.back","type","SECONDARY",1,"mx-2",3,"clicked"],["textKey","pages.user.profile.update","type","PRIMARY",3,"clicked"],[3,"value"]],template:function(n,t){if(n&1){let s=k();a(0,"div",1)(1,"div",2)(2,"h5",3),p(3),d(4,"translate"),l(),a(5,"button",4),b("click",function(){return f(s),v(t.onClose())}),a(6,"span",5),p(7,"\xD7"),l()()(),a(8,"div",6)(9,"div",7)(10,"div",8)(11,"form",null,0)(13,"div",9)(14,"h5",10),p(15),d(16,"translate"),l(),a(17,"div",11)(18,"div",7)(19,"div",8)(20,"mat-form-field",12),x(21,"input",13),d(22,"translate"),h(23,MC,3,3,"mat-error",14),l()()(),a(24,"div",7)(25,"div",8)(26,"mat-form-field",12),x(27,"input",15),d(28,"translate"),h(29,IC,3,3,"mat-error",14),l()()(),a(30,"div",7)(31,"div",8)(32,"mat-form-field",12),x(33,"input",16),d(34,"translate"),h(35,EC,3,3,"mat-error",14),l()()()()(),a(36,"div",9)(37,"h5",10),p(38),d(39,"translate"),l(),a(40,"div",11)(41,"div",7)(42,"div",8)(43,"mat-form-field",12),x(44,"input",17),d(45,"translate"),h(46,PC,3,3,"mat-error",14),l()()(),a(47,"div",7)(48,"div",8)(49,"mat-form-field",12),x(50,"input",18),d(51,"translate"),l()()(),a(52,"div",7)(53,"div",8)(54,"mat-form-field",12),x(55,"input",19),d(56,"translate"),h(57,TC,3,3,"mat-error",14),l()()(),a(58,"div",7)(59,"div",8)(60,"mat-form-field",12),x(61,"input",20),d(62,"translate"),h(63,DC,3,3,"mat-error",14),l()()(),a(64,"div",7)(65,"div",8)(66,"mat-form-field",12)(67,"mat-select",21),d(68,"translate"),h(69,OC,3,4,"mat-option",22),l(),h(70,BC,3,3,"mat-error",14),l()()()()(),a(71,"div",9)(72,"h5",10),p(73),d(74,"translate"),l(),a(75,"div",11)(76,"div",7)(77,"div",8)(78,"mat-form-field",12),x(79,"input",23),d(80,"translate"),l()()()()(),a(81,"div",24)(82,"div",25)(83,"div",26)(84,"app-button",27),b("clicked",function(){return f(s),v(t.onClose())}),l(),a(85,"app-button",28),b("clicked",function(C){return f(s),v(t.updateUser(C))}),l()()()()()()()()()}n&2&&(o(3),w(u(4,30,"pages.user.book.steps.complete_informations_modal_title")),o(12),w(u(16,32,"pages.user.profile.general")),o(6),c("placeholder",u(22,34,"forms.firstname.long_name"))("formControl",t.firstnameCtrl),o(2),c("ngIf",t.firstnameCtrl.hasError("required")),o(4),c("placeholder",u(28,36,"forms.lastname.long_name"))("formControl",t.lastnameCtrl),o(2),c("ngIf",t.lastnameCtrl.hasError("required")),o(4),c("placeholder",u(34,38,"forms.phone.long_name"))("formControl",t.phoneCtrl),o(2),c("ngIf",t.phoneCtrl.hasError("required")),o(3),w(u(39,40,"pages.user.profile.payment_address")),o(6),c("placeholder",u(45,42,"forms.address.long_name"))("formControl",t.addressCtrl),o(2),c("ngIf",t.addressCtrl.hasError("required")),o(4),c("placeholder",u(51,44,"forms.address2.long_name"))("formControl",t.address_complementCtrl),o(5),c("placeholder",u(56,46,"forms.postal_code.long_name"))("formControl",t.postal_codeCtrl),o(2),c("ngIf",t.postal_codeCtrl.hasError("required")),o(4),c("placeholder",u(62,48,"forms.city.long_name"))("formControl",t.cityCtrl),o(2),c("ngIf",t.cityCtrl.hasError("required")),o(4),c("placeholder",u(68,50,"forms.country.long_name"))("formControl",t.countryCtrl),o(2),c("ngForOf",t.api.countries),o(),c("ngIf",t.countryCtrl.hasError("required")),o(3),w(u(74,52,"pages.user.profile.company")),o(6),c("placeholder",u(80,54,"forms.company.social_reason.long_name"))("formControl",t.companyNameCtrl))},dependencies:[j,R,ft,fe,ee,ht,zt,Ii,Be,ve,ae,St,We,Le,H,N],styles:[".modal-content[_ngcontent-%COMP%]   .card[_ngcontent-%COMP%]{box-shadow:0 2px 8px #f8f9f9!important}.button_tertiary[_ngcontent-%COMP%]{background-color:transparent!important;box-shadow:none!important}.button_tertiary[_ngcontent-%COMP%]:hover{color:#55585e!important;background-color:transparent!important}"]})}}return i})();var Kp="https://js.stripe.com/v3",AC=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Yp="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",VC=function(){for(var r=document.querySelectorAll('script[src^="'.concat(Kp,'"]')),e=0;e<r.length;e++){var n=r[e];if(AC.test(n.src))return n}return null},Gp=function(r){var e=r&&!r.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(Kp).concat(e);var t=document.head||document.body;if(!t)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return t.appendChild(n),n},RC=function(r,e){!r||!r._registerWrapper||r._registerWrapper({name:"stripe-js",version:"2.4.0",startTime:e})},Oo=null,ta=null,ia=null,NC=function(r){return function(){r(new Error("Failed to load Stripe.js"))}},FC=function(r,e){return function(){window.Stripe?r(window.Stripe):e(new Error("Stripe.js not available"))}},LC=function(r){return Oo!==null?Oo:(Oo=new Promise(function(e,n){if(typeof window>"u"||typeof document>"u"){e(null);return}if(window.Stripe&&r&&console.warn(Yp),window.Stripe){e(window.Stripe);return}try{var t=VC();if(t&&r)console.warn(Yp);else if(!t)t=Gp(r);else if(t&&ia!==null&&ta!==null){var s;t.removeEventListener("load",ia),t.removeEventListener("error",ta),(s=t.parentNode)===null||s===void 0||s.removeChild(t),t=Gp(r)}ia=FC(e,n),ta=NC(n),t.addEventListener("load",ia),t.addEventListener("error",ta)}catch(_){n(_);return}}),Oo.catch(function(e){return Oo=null,Promise.reject(e)}))},qC=function(r,e,n){if(r===null)return null;var t=r.apply(void 0,e);return RC(t,n),t},Bo,$p=!1,Xp=function(){return Bo||(Bo=LC(null).catch(function(r){return Bo=null,Promise.reject(r)}),Bo)};Promise.resolve().then(function(){return Xp()}).catch(function(i){$p||console.warn(i)});var Jp=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];$p=!0;var t=Date.now();return Xp().then(function(s){return qC(s,e,t)})};var vn=Me(an());var na=class{constructor(){this.canBeBooked=!1,this.isRestricted=!1,this.availableQuota=!1,this.availableQuotas=[],this.usableQuota=!1,this.quotaOnly=!1,this.hasCoupon=!1,this.isFree=!1,this.useStripe=!1}};var oa=Me(hi());var WC=i=>({"environment-page":i});function UC(i,r){i&1&&(p(0),d(1,"translate")),i&2&&g("",u(1,1,"pages.user.book.steps.workspace")," ")}function zC(i,r){i&1&&h(0,UC,2,3,"ng-template",15)}function jC(i,r){i&1&&(p(0),d(1,"translate")),i&2&&g("",u(1,1,"pages.user.book.steps.building")," ")}function QC(i,r){i&1&&h(0,jC,2,3,"ng-template",15)}function HC(i,r){i&1&&(p(0),d(1,"translate")),i&2&&w(u(1,1,"pages.user.book.steps.services.title"))}function YC(i,r){if(i&1&&(M(0),p(1),S()),i&2){let e=m(2);o(),g(" ",e.booking==null||e.booking.workspace==null?null:e.booking.workspace.title," ")}}function GC(i,r){if(i&1&&(M(0),p(1),S()),i&2){let e=m(2);o(),g(" ",e.building==null?null:e.building.name,"")}}function KC(i,r){if(i&1&&(a(0,"div",44)(1,"div",45)(2,"span",46),p(3),d(4,"translate"),l()(),a(5,"div",47)(6,"span",48)(7,"mat-icon",49),p(8,"perm_identity"),l(),p(9),d(10,"translate"),d(11,"replace"),l()()()),i&2){let e=m(2);o(3),w(u(4,3,"pages.user.book.steps.services.dates")),o(4),c("inline",!0),o(2),g(" ",te(11,7,u(10,5,"pages.user.book.steps.services.people"),":number",e.booking==null?null:e.booking.places)," ")}}function $C(i,r){if(i&1){let e=k();a(0,"div",52)(1,"div",8)(2,"div",53)(3,"span",54),p(4),d(5,"translate"),l()(),a(6,"div",55)(7,"mat-form-field",30)(8,"input",56),d(9,"translate"),Pe("ngModelChange",function(t){f(e);let s=m(3);return Ee(s.arrivalValue,t)||(s.arrivalValue=t),v(t)}),l(),a(10,"mat-icon",57),p(11,"calendar_today"),l()()()()()}if(i&2){let e=m(3);o(4),g("",u(5,3,"pages.user.book.steps.services.date")," : "),o(4),Ie("ngModel",e.arrivalValue),c("placeholder",u(9,5,"pages.user.book.steps.services.choose_date"))}}function XC(i,r){if(i&1){let e=k();a(0,"div",52)(1,"div",8)(2,"div",58)(3,"span",54),p(4),d(5,"translate"),l()(),a(6,"div",59)(7,"mat-form-field",30)(8,"input",60),Pe("ngModelChange",function(t){f(e);let s=m(3);return Ee(s.arrivalValue,t)||(s.arrivalValue=t),v(t)}),l(),a(9,"mat-icon",57),p(10,"calendar_today"),l()()()()()}if(i&2){let e=m(3);o(4),g("",u(5,2,"pages.user.book.steps.services.start")," "),o(4),Ie("ngModel",e.arrivalValue)}}function JC(i,r){if(i&1){let e=k();a(0,"div",52)(1,"div",8)(2,"div",58)(3,"span",54),p(4),d(5,"translate"),l()(),a(6,"div",59)(7,"mat-form-field",30)(8,"input",60),Pe("ngModelChange",function(t){f(e);let s=m(3);return Ee(s.departureValue,t)||(s.departureValue=t),v(t)}),l(),a(9,"mat-icon",57),p(10,"calendar_today"),l()()()()()}if(i&2){let e=m(3);o(4),g("",u(5,2,"pages.user.book.steps.services.end")," "),o(4),Ie("ngModel",e.departureValue)}}function ZC(i,r){if(i&1&&(a(0,"div",50),h(1,$C,12,7,"div",51)(2,XC,11,4,"div",51)(3,JC,11,4,"div",51),l()),i&2){let e=m(2);o(),c("ngIf",e.nonCustomizableBookingDurationTypes.includes(e.workspace==null?null:e.workspace.bookingDurationType)),o(),c("ngIf",e.customizableBookingDurationTypes.includes(e.workspace==null?null:e.workspace.bookingDurationType)),o(),c("ngIf",e.customizableBookingDurationTypes.includes(e.workspace==null?null:e.workspace.bookingDurationType))}}function ex(i,r){i&1&&(a(0,"div",61),x(1,"mat-spinner",62),l()),i&2&&(o(),c("diameter",25))}function tx(i,r){if(i&1&&x(0,"app-services",63),i&2){let e=m(2);c("type","book")("onlyBookable",!0)("services",e.services)("company",e.building==null?null:e.building.company)("workspace",e.workspace)("building",e.building)("startDate",e.arrival)("endDate",e.departure)}}function ix(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2){let e=m(5);o(),Q(" ",e.utils.minutesToString(e.estimation==null?null:e.estimation.minutes)," ",u(2,2,"components.order_summary.prices.quota")," ")}}function nx(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"currency"),l()),i&2){let e=m(6);o(),g(" ",T(2,1,(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].priceHT)/100,"EUR")," ")}}function ox(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.free")," "))}function rx(i,r){if(i&1&&(a(0,"div"),h(1,nx,3,4,"div",11)(2,ox,3,3,"div",11),l()),i&2){let e=m(5);o(),c("ngIf",(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].price)>0),o(),c("ngIf",(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].price)<=0)}}function ax(i,r){if(i&1&&(M(0),h(1,ix,3,4,"div",11)(2,rx,3,2,"div",11),S()),i&2){let e=m(4);o(),c("ngIf",e.estimation==null?null:e.estimation.selectedQuota),o(),c("ngIf",!(e.estimation!=null&&e.estimation.selectedQuota))}}function sx(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"currency"),l()),i&2){let e=m(6);o(),g(" ",T(2,1,(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].priceHT)/100,"EUR")," ")}}function lx(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.free")," "))}function cx(i,r){if(i&1&&(M(0),h(1,sx,3,4,"div",11)(2,lx,3,3,"div",11),S()),i&2){let e=m(5);o(),c("ngIf",(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].price)>0),o(),c("ngIf",(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].price)<=0)}}function px(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.or")," "))}function dx(i,r){if(i&1&&(M(0),h(1,px,3,3,"div",11),a(2,"div"),p(3),d(4,"translate"),l(),S()),i&2){let e=m(5);o(),c("ngIf",!(e.estimation!=null&&e.estimation.quotaOnly)),o(2),Q(" ",e.utils.minutesToString(e.estimation==null?null:e.estimation.minutes)," ",u(4,3,"components.order_summary.prices.quota")," ")}}function mx(i,r){if(i&1&&(M(0),h(1,cx,3,2,"ng-container",11)(2,dx,5,5,"ng-container",11),S()),i&2){let e,n=m(4);o(),c("ngIf",!(n.estimation!=null&&n.estimation.quotaOnly)),o(),c("ngIf",(n.estimation==null?null:n.estimation.availableQuota)&&(((e=n.estimation==null?null:n.estimation.price)!==null&&e!==void 0?e:0)>0||(n.estimation==null?null:n.estimation.quotaOnly)))}}function ux(i,r){if(i&1&&(a(0,"div",69),h(1,ax,3,2,"ng-container",11)(2,mx,3,2,"ng-container",11),l()),i&2){let e=m(3);o(),c("ngIf",e.useStripeCheckout),o(),c("ngIf",!e.useStripeCheckout)}}function _x(i,r){if(i&1&&(a(0,"div",64)(1,"div",65)(2,"div",66),p(3),d(4,"translate"),l()(),a(5,"div",67)(6,"div",6),p(7),l(),h(8,ux,3,2,"div",68),l()()),i&2){let e=m(2);o(3),g(" ",u(4,3,"components.order_summary.workspace.title")," "),o(4),g(" ",e.api.order==null||e.api.order.bookings[0]==null||e.api.order.bookings[0].workspace==null?null:e.api.order.bookings[0].workspace.title," "),o(),c("ngIf",e.estimation)}}function hx(i,r){i&1&&(M(0),a(1,"div",72)(2,"div",73),p(3),d(4,"translate"),l()(),S()),i&2&&(o(3),g(" ",u(4,1,"components.order_summary.services.empty")," "))}function gx(i,r){if(i&1&&(a(0,"div",75),p(1),d(2,"currency"),l()),i&2){let e=m().$implicit;o(),g(" ",T(2,1,e.priceWithoutTaxes/100,"EUR")," ")}}function fx(i,r){i&1&&(a(0,"div",75),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.free")," "))}function vx(i,r){if(i&1&&(M(0),a(1,"div",72)(2,"div",6),p(3),l(),a(4,"div",69),h(5,gx,3,4,"div",74)(6,fx,3,3,"div",74),l()(),S()),i&2){let e=r.$implicit;o(3),g(" ",e==null||e.service==null?null:e.service.title," "),o(2),c("ngIf",e.priceWithoutTaxes>0),o(),c("ngIf",e.priceWithoutTaxes<=0)}}function bx(i,r){if(i&1&&(M(0),a(1,"div",70)(2,"div",65)(3,"div",66),p(4),d(5,"translate"),l()(),h(6,hx,5,3,"ng-container",11)(7,vx,7,3,"ng-container",71),l(),S()),i&2){let e,n=m(2);o(4),g(" ",u(5,3,"components.order_summary.services.title")," "),o(2),c("ngIf",((e=n.bookedServices==null?null:n.bookedServices.length)!==null&&e!==void 0?e:0)==0),o(),c("ngForOf",n.bookedServices)}}function Cx(i,r){i&1&&(M(0),a(1,"div",82),p(2),d(3,"translate"),l(),S()),i&2&&(o(2),g(" ",u(3,1,"components.order_summary.workspace.total")," "))}function xx(i,r){i&1&&(a(0,"div",82),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.or")," "))}function yx(i,r){if(i&1&&(M(0),h(1,xx,3,3,"div",83),a(2,"div",82),p(3),d(4,"translate"),l(),S()),i&2){let e=m(5);o(),c("ngIf",!(e.estimation!=null&&e.estimation.quotaOnly)),o(2),g(" ",u(4,2,"components.order_summary.workspace.total_quota")," ")}}function kx(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"currency"),l()),i&2){let e=m(6);o(),g(" ",T(2,1,(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].priceHT)/100,"EUR")," ")}}function wx(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.free")," "))}function Sx(i,r){if(i&1&&(M(0),h(1,kx,3,4,"div",11)(2,wx,3,3,"div",11),S()),i&2){let e=m(5);o(),c("ngIf",(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].price)>0),o(),c("ngIf",(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].price)<=0)}}function Mx(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.or")," "))}function Ix(i,r){if(i&1&&(M(0),h(1,Mx,3,3,"div",11),a(2,"div"),p(3),d(4,"translate"),l(),S()),i&2){let e=m(5);o(),c("ngIf",!(e.estimation!=null&&e.estimation.quotaOnly)),o(2),Q(" ",e.utils.minutesToString(e.estimation==null?null:e.estimation.minutes)," ",u(4,3,"components.order_summary.prices.quota")," ")}}function Ex(i,r){if(i&1&&(a(0,"div",8)(1,"div",6),h(2,Cx,4,3,"ng-container",11)(3,yx,5,4,"ng-container",11),l(),a(4,"div",47),h(5,Sx,3,2,"ng-container",11)(6,Ix,5,5,"ng-container",11),l()()),i&2){let e,n,t=m(4);o(2),c("ngIf",!(t.estimation!=null&&t.estimation.quotaOnly)),o(),c("ngIf",(t.estimation==null?null:t.estimation.availableQuota)&&(((e=t.estimation==null?null:t.estimation.price)!==null&&e!==void 0?e:0)>0||(t.estimation==null?null:t.estimation.quotaOnly))),o(2),c("ngIf",!(t.estimation!=null&&t.estimation.quotaOnly)),o(),c("ngIf",(t.estimation==null?null:t.estimation.availableQuota)&&(((n=t.estimation==null?null:t.estimation.price)!==null&&n!==void 0?n:0)>0||(t.estimation==null?null:t.estimation.quotaOnly)))}}function Px(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"currency"),l()),i&2){let e=m(5);o(),g(" ",T(2,1,(e.api.order==null?null:e.api.order.totalServicesWithoutTaxes)/100,"EUR")," ")}}function Tx(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.free")," "))}function Dx(i,r){if(i&1&&(a(0,"div",72)(1,"div",6)(2,"div",82),p(3),d(4,"translate"),l()(),a(5,"div",47),h(6,Px,3,4,"div",11)(7,Tx,3,3,"div",11),l()()),i&2){let e=m(4);o(3),g(" ",u(4,3,"components.order_summary.services.total")," "),o(3),c("ngIf",(e.api.order==null?null:e.api.order.totalServicesWithoutTaxes)>0),o(),c("ngIf",(e.api.order==null?null:e.api.order.totalServicesWithoutTaxes)<=0)}}function Ox(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"currency"),l()),i&2){let e=m(4);o(),g(" ",T(2,1,(e.api.order==null?null:e.api.order.totalWithoutTaxes)/100,"EUR")," ")}}function Bx(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.free")," "))}function Ax(i,r){if(i&1&&(a(0,"div",77),h(1,Ex,7,4,"div",78)(2,Dx,8,5,"div",79),a(3,"div",80)(4,"div",81),p(5),d(6,"translate"),l(),a(7,"div",47),h(8,Ox,3,4,"div",11)(9,Bx,3,3,"div",11),l()()()),i&2){let e=m(3);o(),c("ngIf",!e.bookForBuilding),o(),c("ngIf",!e.bookForBuilding),o(3),g(" ",u(6,5,"components.order_summary.prices.total")," "),o(3),c("ngIf",(e.api.order==null?null:e.api.order.totalWithoutTaxes)>0),o(),c("ngIf",(e.api.order==null?null:e.api.order.totalWithoutTaxes)<=0)}}function Vx(i,r){if(i&1&&(M(0),h(1,Ax,10,7,"div",76),S()),i&2){let e,n=m(2);o(),c("ngIf",(n.api.order==null?null:n.api.order.total)>0||n.bookForBuilding||((e=n.estimation==null?null:n.estimation.minutes)!==null&&e!==void 0?e:0)>0)}}function Rx(i,r){if(i&1&&(M(0),a(1,"strong"),p(2),l(),S()),i&2){let e,n=m(5);o(2),g(" ",(e=n.estimation==null||n.estimation.selectedQuota==null?null:n.estimation.selectedQuota.label)!==null&&e!==void 0?e:n.estimation==null||n.estimation.selectedQuota==null||n.estimation.selectedQuota.parent==null?null:n.estimation.selectedQuota.parent.label," ")}}function Nx(i,r){if(i&1&&(M(0),p(1),S()),i&2){let e,n=m(6);o(),g(" ",(e=n.estimation.selectedQuota==null?null:n.estimation.selectedQuota.label)!==null&&e!==void 0?e:n.estimation.selectedQuota==null||n.estimation.selectedQuota.parent==null?null:n.estimation.selectedQuota.parent.label," ")}}function Fx(i,r){if(i&1&&(a(0,"mat-option",88),p(1),x(2,"br"),a(3,"span",89),p(4),d(5,"translate"),d(6,"replace"),l()()),i&2){let e,n=r.$implicit,t=m(6);c("value",n.id)("disabled",n.remaining<t.estimation.minutes),o(),g(" ",(e=n==null?null:n.label)!==null&&e!==void 0?e:n==null||n.parent==null?null:n.parent.label,""),o(3),g(" ",te(6,6,u(5,4,"components.workspace.datepicker.steps.quota.remaining."+(n==null?null:n.frequency.toLowerCase())),":count",""+(n==null?null:n.remaining))," ")}}function Lx(i,r){if(i&1){let e=k();M(0),a(1,"mat-form-field",85)(2,"mat-select",86),b("selectionChange",function(t){f(e);let s=m(5);return v(s.quotaSelected(t))}),a(3,"mat-select-trigger"),h(4,Nx,2,1,"ng-container",11),l(),h(5,Fx,7,10,"mat-option",87),l()(),S()}if(i&2){let e=m(5);o(2),c("ngModel",e.estimation.selectedQuota==null?null:e.estimation.selectedQuota.id),o(2),c("ngIf",e.estimation.selectedQuota),o(),c("ngForOf",e.estimation.availableQuotas)}}function qx(i,r){if(i&1&&(M(0),a(1,"li"),p(2),d(3,"translate"),a(4,"strong"),p(5),l(),p(6),d(7,"translate"),h(8,Rx,3,1,"ng-container",11),l(),h(9,Lx,6,3,"ng-container",11),S()),i&2){let e=m(4);o(2),g(" ",u(3,5,"components.workspace.datepicker.steps.quota.label")," "),o(3),w(e.utils.minutesToString(e.estimation==null?null:e.estimation.minutes)),o(),g(" ",u(7,7,"components.workspace.datepicker.steps.quota.on")," "),o(2),c("ngIf",(e.estimation==null||e.estimation.availableQuotas==null?null:e.estimation.availableQuotas.length)===1),o(),c("ngIf",(e.estimation==null||e.estimation.availableQuotas==null?null:e.estimation.availableQuotas.length)>1)}}function Wx(i,r){if(i&1&&(a(0,"li"),p(1),d(2,"translate"),a(3,"strong"),p(4),d(5,"currency"),l()()),i&2){let e=m(4);o(),g(" ",u(2,2,"components.order_summary.sources.pay")," "),o(3),w(T(5,4,(e.estimation==null?null:e.estimation.price)/100,"EUR"))}}function Ux(i,r){if(i&1&&(M(0),h(1,qx,10,9,"ng-container",11)(2,Wx,6,7,"li",11),S()),i&2){let e=m(3);o(),c("ngIf",e.estimation==null?null:e.estimation.selectedQuota),o(),c("ngIf",!(e.estimation!=null&&e.estimation.selectedQuota)&&(e.estimation==null?null:e.estimation.price)>0)}}function zx(i,r){if(i&1&&(a(0,"li"),p(1),d(2,"translate"),a(3,"strong"),p(4),d(5,"currency"),l()()),i&2){let e=m(3);o(),g(" ",u(2,2,"components.order_summary.sources.pay")," "),o(3),w(T(5,4,(e.api.order==null?null:e.api.order.totalServicesWithoutTaxes)/100,"EUR"))}}function jx(i,r){if(i&1&&(M(0),a(1,"div",8)(2,"div",6)(3,"ul",84),h(4,Ux,3,2,"ng-container",11)(5,zx,6,7,"li",11),l()()(),S()),i&2){let e=m(2);o(4),c("ngIf",e.estimation),o(),c("ngIf",(e.api.order==null?null:e.api.order.totalServicesWithoutTaxes)>0)}}function Qx(i,r){if(i&1&&(a(0,"div",90),d(1,"translate"),p(2),d(3,"translate"),a(4,"strong",91),p(5),l()()),i&2){let e=m(2);E("disabled",!e.remainingTime),c("matTooltip",u(1,5,"components.order_summary.expire.help")),o(2),g(" ",u(3,7,"components.order_summary.expire.label")," "),o(3),w(e.remainingTime?e.remainingTime:"05:00")}}function Hx(i,r){if(i&1){let e=k();a(0,"app-button",92),b("clicked",function(t){f(e);let s=m(2);return v(s.pay(t))}),l()}if(i&2){let e=m(2);c("textKey","components.order_summary.actions."+e.actionType)("widthFull",!0)("isDisabled",e.addInProgress||e.paymentInProgress||e.paymentCompleted||e.disablePayBtn)}}function Yx(i,r){if(i&1){let e=k();a(0,"app-button",93),b("clicked",function(){f(e);let t=m(2);return v(t.nextStep())}),l()}if(i&2){let e=m(2);c("isDisabled",e.bookForBuilding&&(e.api.order==null||(e.api.order==null?null:e.api.order.services)==null||(e.api.order==null||e.api.order.services==null?null:e.api.order.services.length)===0))}}function Gx(i,r){if(i&1&&(a(0,"div",94),p(1),d(2,"translate"),d(3,"translate"),d(4,"replace"),a(5,"a",95),d(6,"translate"),p(7),d(8,"translate"),l(),p(9),d(10,"translate"),d(11,"replace"),l()),i&2){let e=m(2);o(),g(" ",te(4,8,u(2,4,"components.order_summary.cgu.prefix"),":action",u(3,6,"components.order_summary.actions."+e.actionType))," "),o(4),c("href",!(e.booking==null||e.booking.workspace==null||e.booking.workspace.company==null)&&e.booking.workspace.company.hasTerms?e.getTermsUrl(e.booking==null?null:e.booking.workspace.company.id):u(6,12,"docs.cgu.url"),K),o(2),g(" ",u(8,14,"components.order_summary.cgu.middle")," "),o(2),g(" ",te(11,18,u(10,16,"components.order_summary.cgu.suffix"),":companyName",!(e.booking==null||e.booking.workspace==null||e.booking.workspace.company==null)&&e.booking.workspace.company.hasTerms?e.booking==null||e.booking.workspace==null||e.booking.workspace.company==null?null:e.booking.workspace.company.socialReason:"MOFFI")," ")}}function Kx(i,r){if(i&1&&(a(0,"mat-step",23),h(1,HC,2,3,"ng-template",15),a(2,"div",24)(3,"div",8)(4,"div",25)(5,"div",26)(6,"h2",27),h(7,YC,2,1,"ng-container",11)(8,GC,2,1,"ng-container",11),l(),h(9,KC,12,11,"div",28)(10,ZC,4,3,"div",29),x(11,"mat-divider",30),a(12,"div",31),p(13),d(14,"translate"),l(),a(15,"p",32),p(16),d(17,"translate"),l(),h(18,ex,2,1,"div",33)(19,tx,1,8,"app-services",34),l()(),a(20,"div",35)(21,"div",26)(22,"div",36),p(23),d(24,"translate"),l(),h(25,_x,9,5,"div",37)(26,bx,8,5,"ng-container",11),x(27,"mat-divider",38),h(28,Vx,2,1,"ng-container",11)(29,jx,6,2,"ng-container",11)(30,Qx,6,9,"div",39),a(31,"div",40),h(32,Hx,1,3,"app-button",41)(33,Yx,1,1,"app-button",42)(34,Gx,12,22,"div",43),l()()()()()()),i&2){let e=m();c("hidden",!e.bookServices)("editable",e.bookServices&&!e.paymentCompleted),o(7),c("ngIf",e.booking),o(),c("ngIf",e.building&&e.bookForBuilding),o(),c("ngIf",!e.bookForBuilding),o(),c("ngIf",!e.bookForBuilding),o(3),g(" ",u(14,19,"pages.user.book.steps.services.which_services")," "),o(3),g(" ",u(17,21,"pages.user.book.steps.services.description")," "),o(2),c("ngIf",!e.services),o(),c("ngIf",e.services),o(4),g(" ",u(24,23,"components.order_summary.title")," "),o(2),c("ngIf",!e.bookForBuilding),o(),c("ngIf",(e.api.order==null||e.api.order.services==null?null:e.api.order.services.length)>0||e.bookForBuilding),o(2),c("ngIf",!e.useStripeCheckout),o(),c("ngIf",e.useStripeCheckout),o(),c("ngIf",e.api.order||e.bookForBuilding),o(2),c("ngIf",(e.api.order==null?null:e.api.order.total)<=0&&!(e.estimation!=null&&e.estimation.quotaOnly)&&(!e.bookForBuilding||(e.api.order==null||e.api.order.services==null?null:e.api.order.services.length)>0)||e.useStripeCheckout),o(),c("ngIf",e.showNextStep),o(),c("ngIf",!(((e.api.order==null?null:e.api.order.total)>0||(e.api.order==null?null:e.api.order.totalQuota)>0)&&!e.useStripeCheckout)&&!e.bookForBuilding)}}function $x(i,r){i&1&&(p(0),d(1,"translate")),i&2&&w(u(1,1,"pages.user.book.steps.payment.title"))}function Xx(i,r){if(i&1&&(a(0,"div",80)(1,"div",122),p(2),d(3,"translate"),l(),a(4,"div",47),p(5),l()()),i&2){let e=m(3);o(2),g("",u(3,2,"pages.user.book.steps.services.date"),"\xA0:"),o(3),g(" ",e.arrivalValue," ")}}function Jx(i,r){if(i&1&&(a(0,"div",80)(1,"div",122),p(2),d(3,"translate"),l(),a(4,"div",47),p(5),d(6,"formatBookingDate"),l()()),i&2){let e=m(3);o(2),g(" ",u(3,2,"components.order_summary.begin_date")," "),o(3),g(" ",T(6,4,e.api.order==null?null:e.api.order.bookings[0].start,e.api.order==null?null:e.api.order.timezone)," ")}}function Zx(i,r){if(i&1&&(a(0,"div",8)(1,"div",122),p(2),d(3,"translate"),l(),a(4,"div",47),p(5),d(6,"formatBookingDate"),l()()),i&2){let e=m(3);o(2),g(" ",u(3,2,"components.order_summary.end_date")," "),o(3),g(" ",T(6,4,e.api.order==null?null:e.api.order.bookings[0].end,e.api.order==null?null:e.api.order.timezone)," ")}}function ey(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"currency"),d(3,"translate"),l()),i&2){let e=m(5);o(),Q(" ",T(2,2,(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].priceHT)/100,"EUR")," ",u(3,5,"bookings.ht")," ")}}function ty(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.free")," "))}function iy(i,r){if(i&1&&(M(0),h(1,ey,4,7,"div",11)(2,ty,3,3,"div",11),S()),i&2){let e=m(4);o(),c("ngIf",(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].price)>0),o(),c("ngIf",(e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].price)<=0)}}function ny(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.or")," "))}function oy(i,r){if(i&1&&(M(0),h(1,ny,3,3,"div",11),a(2,"div"),p(3),d(4,"translate"),l(),S()),i&2){let e=m(4);o(),c("ngIf",!(e.estimation!=null&&e.estimation.quotaOnly)),o(2),Q(" ",e.utils.minutesToString(e.estimation==null?null:e.estimation.minutes)," ",u(4,3,"components.order_summary.prices.quota")," ")}}function ry(i,r){if(i&1){let e=k();a(0,"div",100)(1,"div",104),p(2),d(3,"translate"),l(),a(4,"div",105),h(5,iy,3,2,"ng-container",11)(6,oy,5,5,"ng-container",11),a(7,"span",123),b("click",function(){f(e);let t=m(3);return v(t.expandBooking=!t.expandBooking)}),a(8,"span",124),p(9),d(10,"translate"),l(),a(11,"mat-icon"),p(12,"keyboard_arrow_down"),l()(),a(13,"span",123),b("click",function(){f(e);let t=m(3);return v(t.expandBooking=!t.expandBooking)}),a(14,"span",124),p(15),d(16,"translate"),l(),a(17,"mat-icon"),p(18,"keyboard_arrow_up"),l()()()()}if(i&2){let e,n=m(3);o(2),g(" ",u(3,9,"components.order_summary.workspace.title")," "),o(3),c("ngIf",!(n.estimation!=null&&n.estimation.quotaOnly)),o(),c("ngIf",(n.estimation==null?null:n.estimation.availableQuota)&&(((e=n.estimation==null?null:n.estimation.price)!==null&&e!==void 0?e:0)>0||(n.estimation==null?null:n.estimation.quotaOnly))),o(),E("d-none",n.expandBooking),o(2),w(u(10,11,"components.order_summary.see_detail")),o(4),E("d-none",!n.expandBooking),o(2),w(u(16,13,"components.order_summary.less_detail"))}}function ay(i,r){if(i&1&&(a(0,"div",128),p(1),d(2,"translate"),d(3,"replace"),l()),i&2){let e=m(4);o(),g(" ",te(3,3,u(2,1,"components.order_summary.workspace.places"),":number",e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].places)," ")}}function sy(i,r){if(i&1&&(M(0),a(1,"div",129)(2,"div",6)(3,"p",130),p(4),l()()(),S()),i&2){let e=r.$implicit;o(4),g(" ",e.seat.fullname," ")}}function ly(i,r){if(i&1&&(M(0),a(1,"div",125),p(2),l(),h(3,ay,4,7,"div",126),a(4,"div",127),h(5,sy,5,1,"ng-container",71),l(),S()),i&2){let e=m(3);o(2),g(" ",e.api.order==null||e.api.order.bookings[0]==null||e.api.order.bookings[0].workspace==null?null:e.api.order.bookings[0].workspace.title," "),o(),c("ngIf",!(!(e.api.order==null||e.api.order.bookings[0]==null)&&e.api.order.bookings[0].bookedSeats)),o(2),c("ngForOf",e.api.order==null||e.api.order.bookings[0]==null?null:e.api.order.bookings[0].bookedSeats)}}function cy(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"currency"),d(3,"translate"),l()),i&2){let e=m(4);o(),Q(" ",T(2,2,(e.api.order==null?null:e.api.order.subTotalServicesWithoutTaxes)/100,"EUR")," ",u(3,5,"bookings.ht")," ")}}function py(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.free")," "))}function dy(i,r){if(i&1){let e=k();a(0,"div",100)(1,"div",104),p(2),d(3,"translate"),l(),a(4,"div",105),h(5,cy,4,7,"div",11)(6,py,3,3,"div",11),a(7,"span",123),b("click",function(){f(e);let t=m(3);return v(t.expandServices=!t.expandServices)}),a(8,"span",124),p(9),d(10,"translate"),l(),a(11,"mat-icon"),p(12,"keyboard_arrow_down"),l()(),a(13,"span",123),b("click",function(){f(e);let t=m(3);return v(t.expandServices=!t.expandServices)}),a(14,"span",124),p(15),d(16,"translate"),l(),a(17,"mat-icon"),p(18,"keyboard_arrow_up"),l()()()()}if(i&2){let e=m(3);o(2),g(" ",u(3,9,"components.order_summary.services.title")," "),o(3),c("ngIf",(e.api.order==null?null:e.api.order.subTotalServicesWithoutTaxes)>0),o(),c("ngIf",(e.api.order==null?null:e.api.order.subTotalServicesWithoutTaxes)<=0),o(),E("d-none",e.expandServices),o(2),w(u(10,11,"components.order_summary.see_detail")),o(4),E("d-none",!e.expandServices),o(2),w(u(16,13,"components.order_summary.less_detail"))}}function my(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"currency"),d(3,"translate"),l()),i&2){let e=m().$implicit;o(),Q(" ",T(2,2,e.priceWithoutTaxes/100,"EUR")," ",u(3,5,"bookings.ht")," ")}}function uy(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.free")," "))}function _y(i,r){if(i&1&&(M(0),a(1,"div",72)(2,"div",6)(3,"div"),p(4),l(),a(5,"div",131),p(6),d(7,"translate"),d(8,"replace"),l()(),a(9,"div",47),h(10,my,4,7,"div",11)(11,uy,3,3,"div",11),l()(),S()),i&2){let e=r.$implicit;o(4),w(e==null||e.service==null?null:e.service.title),o(2),g(" ",te(8,6,u(7,4,"components.order_summary.services.quantity"),":number",e.quantity)," "),o(4),c("ngIf",e.priceWithoutTaxes>0),o(),c("ngIf",e.priceWithoutTaxes<=0)}}function hy(i,r){if(i&1&&(M(0),h(1,_y,12,10,"ng-container",71),S()),i&2){let e=m(3);o(),c("ngForOf",e.api.order==null?null:e.api.order.services)}}function gy(i,r){if(i&1&&(a(0,"div",80)(1,"div",6),p(2),d(3,"translate"),l(),a(4,"div",47),p(5),d(6,"currency"),l()()),i&2){let e=m(3);o(2),Q(" ",u(3,3,"components.order_summary.coupon.text")," \xAB\xA0",e.api.order==null||e.api.order.coupon==null?null:e.api.order.coupon.code,"\xA0\xBB "),o(3),g(" - ",T(6,5,((e.api.order==null?null:e.api.order.subTotalWithoutTaxes)-(e.api.order==null?null:e.api.order.totalWithoutTaxes))/100,"EUR")," ")}}function fy(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"currency"),d(3,"translate"),l()),i&2){let e=m(3);o(),Q(" ",T(2,2,(e.api.order==null?null:e.api.order.totalWithoutTaxes)/100,"EUR")," ",u(3,5,"bookings.ht")," ")}}function vy(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.free")," "))}function by(i,r){if(i&1&&(a(0,"div"),p(1),d(2,"currency"),l()),i&2){let e=m(4);o(),g(" ",T(2,1,(e.api.order==null?null:e.api.order.total)/100,"EUR")," ")}}function Cy(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.free")," "))}function xy(i,r){if(i&1&&(M(0),h(1,by,3,4,"div",11)(2,Cy,3,3,"div",11),S()),i&2){let e=m(3);o(),c("ngIf",(e.api.order==null?null:e.api.order.total)>0),o(),c("ngIf",(e.api.order==null?null:e.api.order.total)<=0)}}function yy(i,r){i&1&&(a(0,"div"),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.order_summary.prices.or")," "))}function ky(i,r){if(i&1&&(a(0,"span"),p(1),d(2,"currency"),l()),i&2){let e=m(4);o(),g("+ ",T(2,1,(e.api.order==null?null:e.api.order.totalServices)/100,"EUR"),"")}}function wy(i,r){if(i&1&&(M(0),h(1,yy,3,3,"div",11),a(2,"div"),p(3),d(4,"translate"),h(5,ky,3,4,"span",11),l(),S()),i&2){let e=m(3);o(),c("ngIf",!(e.estimation!=null&&e.estimation.quotaOnly)),o(2),Q(" ",e.utils.minutesToString(e.estimation==null?null:e.estimation.minutes)," ",u(4,4,"components.order_summary.prices.quota")," "),o(2),c("ngIf",(e.api.order==null?null:e.api.order.totalServices)>0)}}function Sy(i,r){if(i&1){let e=k();a(0,"div",132)(1,"div",6)(2,"mat-form-field",30)(3,"mat-label"),p(4),d(5,"translate"),l(),a(6,"input",133),b("keyup",function(t){f(e);let s=V(9),_=m(3);return v(_.onKeyUpCoupon(t,s))}),Pe("ngModelChange",function(t){f(e);let s=m(3);return Ee(s.coupon,t)||(s.coupon=t),v(t)}),l()()(),a(7,"div",134)(8,"app-button",135,2),b("clicked",function(t){f(e);let s=m(3);return v(s.addCoupon(t))}),l()()()}if(i&2){let e=m(3);o(4),w(u(5,2,"components.order_summary.coupon.placeholder")),o(2),Ie("ngModel",e.coupon)}}function My(i,r){i&1&&(x(0,"span",136),d(1,"translate")),i&2&&c("innerHTML",u(1,1,"components.order_summary.sources.description"),Uo)}function Iy(i,r){if(i&1){let e=k();M(0),a(1,"app-sources-min",137),b("selectedSourceChanged",function(t){f(e);let s=m(3);return v(s.mainSourceUpdated(t))}),l(),S()}if(i&2){let e=m(3);o(),c("shouldWarnQuotaCredit",e.bookServices&&((e.api.order==null?null:e.api.order.totalBookings)>0||(e.estimation==null?null:e.estimation.minutes)!=null&&(e.estimation==null?null:e.estimation.minutes)>0)&&(e.api.order==null?null:e.api.order.totalServices)>0)("types",e.availableTypes)("sources",e.payServicesWithOtherSource?e.bookingSources:e.allSources)}}function Ey(i,r){if(i&1){let e=k();a(0,"mat-slide-toggle",140),Pe("ngModelChange",function(t){f(e);let s=m(4);return Ee(s.payServicesWithOtherSource,t)||(s.payServicesWithOtherSource=t),v(t)}),b("ngModelChange",function(t){f(e);let s=m(4);return v(s.togglePayServices(t))}),p(1),d(2,"translate"),l()}if(i&2){let e=m(4);c("disabled",(e.selectedSource==null?null:e.selectedSource.type)==="credit"),Ie("ngModel",e.payServicesWithOtherSource),o(),g(" ",u(2,3,"components.order_summary.sources.pay_services"),"")}}function Py(i,r){if(i&1){let e=k();M(0),a(1,"app-sources-min",141),b("selectedSourceChanged",function(t){f(e);let s=m(4);return v(s.serviceSourceUpdated(t))}),l(),S()}if(i&2){let e=m(4);o(),c("types",e.availableServicesTypes())("sources",e.serviceSources)}}function Ty(i,r){if(i&1&&(a(0,"div",138),h(1,Ey,3,5,"mat-slide-toggle",139)(2,Py,2,2,"ng-container",11),l()),i&2){let e=m(3);o(),c("ngIf",!e.bookForBuilding),o(),c("ngIf",e.sources&&(e.payServicesWithOtherSource||e.bookForBuilding))}}function Dy(i,r){i&1&&(a(0,"p",142),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"pages.user.book.steps.onValidation.text")," "))}function Oy(i,r){if(i&1){let e=k();a(0,"div",143)(1,"p",144)(2,"span",145),p(3,"error"),l(),p(4),d(5,"translate"),l(),a(6,"app-button",146),b("clicked",function(){f(e);let t=m(3);return v(t.completeInformations())}),l()()}i&2&&(o(4),g(" ",u(5,1,"pages.user.book.steps.incomplete_informations")," "))}function By(i,r){if(i&1){let e=k();a(0,"div",100)(1,"div",17)(2,"div",26)(3,"div",8)(4,"div",52)(5,"div",101),p(6),d(7,"translate"),l(),h(8,Xx,6,4,"div",102)(9,Jx,7,7,"div",102)(10,Zx,7,7,"div",78)(11,ry,19,15,"div",97)(12,ly,6,3,"ng-container",11)(13,dy,19,15,"div",97)(14,hy,2,1,"ng-container",11)(15,gy,7,8,"div",102),x(16,"mat-divider",103),a(17,"div",72)(18,"div",6),p(19),d(20,"translate"),l(),a(21,"div",47),h(22,fy,4,7,"div",11)(23,vy,3,3,"div",11),l()(),a(24,"div",100)(25,"div",104),p(26),d(27,"translate"),l(),a(28,"div",105),h(29,xy,3,2,"ng-container",11)(30,wy,6,6,"ng-container",11),l()(),h(31,Sy,10,4,"div",106),l(),a(32,"div",107)(33,"div",108),p(34),d(35,"translate"),l(),a(36,"p",109),h(37,My,2,3,"span",110),l(),h(38,Iy,2,3,"ng-container",11)(39,Ty,3,2,"div",111),a(40,"div",112),d(41,"translate"),p(42),d(43,"translate"),a(44,"span",91),p(45),l()(),h(46,Dy,3,3,"p",113)(47,Oy,7,3,"div",114),a(48,"div",115)(49,"div",116)(50,"div",117)(51,"mat-icon"),p(52,"lock"),l(),p(53),d(54,"translate"),l(),a(55,"app-button",118,1),b("clicked",function(t){f(e);let s=m(2);return v(s.pay(t))}),l()()(),a(57,"div",119)(58,"div",120)(59,"p",121),p(60),d(61,"translate"),d(62,"translate"),d(63,"replace"),a(64,"a",95),d(65,"translate"),p(66),d(67,"translate"),l(),p(68),d(69,"translate"),d(70,"replace"),l()()()()()()()()}if(i&2){let e,n,t=m(2);o(6),g(" ",u(7,32,"components.order_summary.summary_title")," "),o(2),c("ngIf",!t.bookForBuilding&&t.nonCustomizableBookingDurationTypes.includes(t.workspace==null?null:t.workspace.bookingDurationType)),o(),c("ngIf",!t.bookForBuilding&&t.customizableBookingDurationTypes.includes(t.workspace==null?null:t.workspace.bookingDurationType)),o(),c("ngIf",!t.bookForBuilding&&t.customizableBookingDurationTypes.includes(t.workspace==null?null:t.workspace.bookingDurationType)),o(),c("ngIf",!t.bookForBuilding),o(),c("ngIf",t.expandBooking&&!t.bookForBuilding),o(),c("ngIf",(t.api.order==null||t.api.order.services==null?null:t.api.order.services.length)>0),o(),c("ngIf",t.expandServices),o(),c("ngIf",t.api.order==null?null:t.api.order.coupon),o(4),g(" ",u(20,34,"components.order_summary.prices.total_without_taxes")," "),o(3),c("ngIf",(t.api.order==null?null:t.api.order.totalWithoutTaxes)>0),o(),c("ngIf",(t.api.order==null?null:t.api.order.totalWithoutTaxes)<=0),o(3),g(" ",u(27,36,"components.order_summary.prices.total_with_taxes")," "),o(3),c("ngIf",!(t.estimation!=null&&t.estimation.quotaOnly)),o(),c("ngIf",(t.estimation==null?null:t.estimation.availableQuota)&&(((e=t.estimation==null?null:t.estimation.price)!==null&&e!==void 0?e:0)>0||(t.estimation==null?null:t.estimation.quotaOnly))),o(),c("ngIf",(t.api.order==null?null:t.api.order.coupon)==null),o(3),g(" ",u(35,38,"components.order_summary.sources.title")," "),o(3),c("ngIf",!t.bookForBuilding&&t.bookServices&&((t.api.order==null?null:t.api.order.totalBookings)>0||(t.estimation==null?null:t.estimation.minutes)!=null&&(t.estimation==null?null:t.estimation.minutes)>0)),o(),c("ngIf",t.sources&&!t.bookForBuilding),o(),c("ngIf",t.bookServices&&(t.bookForBuilding||(t.api.order==null?null:t.api.order.totalBookings)>0||(t.estimation==null?null:t.estimation.minutes)!=null&&(t.estimation==null?null:t.estimation.minutes)>0)),o(),c("matTooltip",u(41,40,"components.order_summary.expire.help")),o(2),g(" ",u(43,42,"components.order_summary.expire.label")," "),o(3),w(t.remainingTime),o(),c("ngIf",t.booking==null||t.booking.workspace==null?null:t.booking.workspace.restricted),o(),c("ngIf",!t.paymentInfosAreOk&&(t.selectedSource==null?null:t.selectedSource.type)!=="quota"&&!((n=t.estimation==null?null:t.estimation.quotaOnly)!==null&&n!==void 0&&n)),o(6),g(" ",u(54,44,"components.order_summary.sources.secured_payment")," "),o(2),c("textKey",(t.selectedSource==null?null:t.selectedSource.type)==="quota"?"components.order_summary.sources.pay_quota":"components.order_summary.actions."+t.actionType)("isDisabled",t.paymentInProgress||t.paymentCompleted||t.selectedSource===null&&((t.api.order==null?null:t.api.order.totalBookings)>0||(t.estimation==null?null:t.estimation.minutes)>0&&(t.estimation==null?null:t.estimation.quotaOnly))||(t.selectedSource==null?null:t.selectedSource.type)==="quota"&&(t.api.order==null?null:t.api.order.services.length)>0&&(t.api.order==null?null:t.api.order.totalServices)>0&&(!t.payServicesWithOtherSource||t.selectedSourceService==null)||!t.paymentInfosAreOk&&(t.selectedSource==null?null:t.selectedSource.type)!=="quota"),o(5),g(" ",te(63,50,u(61,46,"components.order_summary.cgu.prefix"),":action",u(62,48,"components.order_summary.actions."+t.actionType))," "),o(4),we("href",!(t.booking==null||t.booking.workspace==null||t.booking.workspace.company==null)&&t.booking.workspace.company.hasTerms?t.getTermsUrl(t.booking==null?null:t.booking.workspace.company.id):u(65,54,"docs.cgu.url"),K),o(2),w(u(67,56,"components.order_summary.cgu.middle")),o(2),g(" ",te(70,60,u(69,58,"components.order_summary.cgu.suffix"),":companyName",!(t.booking==null||t.booking.workspace==null||t.booking.workspace.company==null)&&t.booking.workspace.company.hasTerms?t.booking==null||t.booking.workspace==null||t.booking.workspace.company==null?null:t.booking.workspace.company.socialReason:"MOFFI")," ")}}function Ay(i,r){if(i&1&&(a(0,"mat-step",96),h(1,$x,2,3,"ng-template",15)(2,By,71,64,"div",97),a(3,"div",98)(4,"div",6),x(5,"div",99),l()()()),i&2){let e,n=m();c("hidden",((e=n.estimation==null?null:n.estimation.isFree)!==null&&e!==void 0?e:!0)&&((e=n.api.order==null?null:n.api.order.total)!==null&&e!==void 0?e:0)<=0)("completed",n.paymentCompleted)("editable",!n.paymentCompleted&&n.bookedServices.length>0),o(2),c("ngIf",!n.useStripeCheckout),o(),E("d-none",!n.useStripeCheckout)}}function Vy(i,r){i&1&&(p(0),d(1,"translate")),i&2&&w(u(1,1,"pages.user.book.steps.confirmation.title"))}function Ry(i,r){i&1&&(a(0,"div")(1,"div",147),x(2,"mat-spinner",62),l()()),i&2&&(o(2),c("diameter",25))}function Ny(i,r){i&1&&(a(0,"p",158),p(1),d(2,"translate"),l()),i&2&&(o(),g(" ",u(2,1,"components.user_book.waiting_subtitle")," "))}function Fy(i,r){if(i&1&&(a(0,"div",159),x(1,"app-order-preview",160),l()),i&2){let e=m(2);o(),c("order",e.finalizedOrder)("shouldNotifyInvitations",!0)}}function Ly(i,r){i&1&&x(0,"mat-spinner",62),i&2&&c("diameter",25)}function qy(i,r){if(i&1){let e=k();a(0,"div",162)(1,"app-button",163),b("clicked",function(){f(e);let t=m(3);return v(t.book("WORKSPACE"))}),l()()}i&2&&(o(),c("widthFull",!0))}function Wy(i,r){if(i&1){let e=k();a(0,"div",162)(1,"app-button",164),b("clicked",function(){f(e);let t=m(3);return v(t.book(t.workspaceType.PARKING))}),l()()}i&2&&(o(),c("widthFull",!0))}function Uy(i,r){if(i&1){let e=k();a(0,"div",162)(1,"app-button",165),b("clicked",function(){f(e);let t=m(3);return v(t.book(t.workspaceType.CAFETERIA))}),l()()}i&2&&(o(),c("widthFull",!0))}function zy(i,r){if(i&1&&(M(0),h(1,qy,2,1,"div",161)(2,Wy,2,1,"div",161)(3,Uy,2,1,"div",161),S()),i&2){let e=m(2);o(),c("ngIf",(e.availableActions==null||e.availableActions.bookable==null?null:e.availableActions.bookable.workspaces)&&(e.booking==null||e.booking.workspace==null?null:e.booking.workspace.type)!=="coworking"&&(e.booking==null||e.booking.workspace==null?null:e.booking.workspace.type)!=="desktop"),o(),c("ngIf",(e.availableActions==null||e.availableActions.bookable==null?null:e.availableActions.bookable.parkings)&&(e.booking==null||e.booking.workspace==null?null:e.booking.workspace.type)!=="parking"),o(),c("ngIf",(e.availableActions==null||e.availableActions.bookable==null?null:e.availableActions.bookable.cafeterias)&&(e.booking==null||e.booking.workspace==null?null:e.booking.workspace.type)!=="cafeteria")}}function jy(i,r){if(i&1){let e=k();a(0,"div")(1,"div",8)(2,"div",148)(3,"div",149),x(4,"img",150),l(),a(5,"p",151),p(6),d(7,"translate"),l(),h(8,Ny,3,3,"p",152),l(),h(9,Fy,2,2,"div",153),l(),a(10,"div",154)(11,"div",155)(12,"div",8),h(13,Ly,1,1,"mat-spinner",156)(14,zy,4,3,"ng-container",11),a(15,"div")(16,"app-button",157),b("clicked",function(){f(e);let t=m();return v(t.goHome())}),l()()()()()()}if(i&2){let e=m();o(4),c("src",(e.finalizedOrder==null||e.finalizedOrder.bookings[0]==null?null:e.finalizedOrder.bookings[0].status)=="WAITING"?"/assets/images/icons/waiting.gif":"/assets/images/icons/confirmation-check.gif",K),o(2),g(" ",u(7,15,(e.finalizedOrder==null||e.finalizedOrder.bookings[0]==null?null:e.finalizedOrder.bookings[0].status)=="WAITING"?"components.user_book.waiting_title":(e.finalizedOrder==null||e.finalizedOrder.bookings[0]==null?null:e.finalizedOrder.bookings[0].length)>1?"components.user_book.confirmation_title_multiple":"components.user_book.confirmation_title")," "),o(2),c("ngIf",(e.finalizedOrder==null||e.finalizedOrder.bookings[0]==null?null:e.finalizedOrder.bookings[0].status)=="WAITING"),o(),c("ngIf",e.finalizedOrder),o(4),c("ngIf",e.loadingUserDeclarations),o(),c("ngIf",!e.loadingUserDeclarations&&e.availableActionsNumber>0),o(),E("pt-2",e.loadingUserDeclarations)("col-12",!e.availableActionsNumber||e.loadingUserDeclarations||e.availableActionsNumber>1)("col",e.availableActionsNumber<2)("mt-0",e.availableActionsNumber<2),o(),c("widthFull",!0)}}function Qy(i,r){}function Hy(i,r){}function Yy(i,r){}function Gy(i,r){if(i&1&&(a(0,"div",166),d(1,"translate"),p(2),d(3,"translate"),a(4,"strong",91),p(5),l(),p(6),d(7,"translate"),l()),i&2){let e=m();E("disabled",!e.remainingTime),c("matTooltip",u(1,6,"components.order_summary.expire.help")),o(2),g(" ",u(3,8,"components.order_summary.expire.label")," "),o(3),w(e.remainingTime?e.remainingTime:"05:00"),o(),g(" ",u(7,10,"components.order_summary.expire.minutes"),`
`)}}var ls=class i{set updateAllowedServices(r){this.allowedServices=r}set updateBuilding(r){r&&r.id!==this.building?.id&&(this.building=r,this.getServicesByBuilding())}constructor(r,e,n,t,s,_,C,I,B){this.api=r,this.utils=e,this.changeDetector=n,this.router=t,this.route=s,this.translate=_,this.toastr=C,this.modal=I,this.dataProvider=B,this.customizableBookingDurationTypes=xl,this.nonCustomizableBookingDurationTypes=yl,this.workspaceType=sn,this.loadingUserDeclarations=!1,this.sources={cards:[],quotas:[],sepas:[],credits:[]},this.allSources={cards:[],quotas:[],sepas:[],credits:[]},this.bookingSources={cards:[],quotas:[],sepas:[],credits:[]},this.serviceSources={cards:[],quotas:[],sepas:[],credits:[]},this.participants=[],this.authorizeVisio=!0,this.displayedColumns=["position","firstname","lastname","email","actions"],this.invitationSent=!1,this.booking={},this.paymentCompleted=!1,this.paymentInfosAreOk=!1,this.availableTypes=["card","quota","credit"],this.availableSources=null,this.titleCtrl=new ue("",W.required),this.paymentMethod=null,this.bookServices=!1,this.bookingTimeMode=null,this.bookForBuilding=!1,this.sumWithoutTaxesServices=0,this.sumWithTaxesServices=0,this.expandBooking=!1,this.expandServices=!1,this.allServices=[],this.services=[],this.seatsServices=[],this.bookedServices=[],this.selectedSource=null,this.payServicesWithOtherSource=!1,this.selectedSourceService=null,this.coupon=null,this.arrival=null,this.arrivalValue=null,this.departure=null,this.departureValue=null,this.remainingTimeInterval=null,this.addInProgress=!1,this.paymentInProgress=!1,this.useStripeCheckout=!1,this.initDone=!1,this.payOnInitDone=!0}ngOnInit(){}ngAfterViewInit(){return z(this,null,function*(){if(this.bookForBuilding=this.bookForBuilding||JSON.parse(localStorage?.getItem("bookForBuilding"))===!0,!this.bookForBuilding&&!this.api.order){let t="/";this.api.companyEnvironment&&(t=this.translate.get("pages.company_environment.index.metadata.url").replace(":environmentId",this.api.companyEnvironment.urlOrId)),this.router.navigate([t]);return}this.api.orderChanged.subscribe(()=>{this.calculatePrice(),this.getServicesSummary(),this.api.order||(this.stepper.selectedIndex=0)}),this.api.orderLoading.subscribe(t=>{this.addInProgress=t}),this.remainingTimeInterval=setInterval(()=>{this.getRemainingTime()},1e3);let r=!1,e=!1;if(this.dataProvider.storage.userBookData?.estimation?(this.workspace=this.dataProvider.storage.userBookData.workspace,this.estimation=this.dataProvider.storage.userBookData.estimation,e=!0):sessionStorage.getItem("estimation")!=null?(this.estimation=JSON.parse(sessionStorage.getItem("estimation")),e=!0):r=!0,this.bookServices=this.bookForBuilding||JSON.parse(localStorage?.getItem("bookServices")??"false"),(!this.api.companyEnvironment||this.bookForBuilding&&!this.building)&&(this.building=JSON.parse(localStorage.getItem("building"))),this.stepper.next(),this.bookForBuilding)this.building&&this.getServicesByBuilding();else if(this.booking=(this.api.order??this.finalizedOrder).bookings[0],this.bookServices&&(this.seatsServices=this.booking.bookedSeats.map(t=>t.seat.services??[]).flat()),this.workspace=this.booking.workspace,this.estimation=Object.assign(this.estimation??new na,{total:(this.api.order??this.finalizedOrder).totalWithoutTaxes,totalWithTaxes:(this.api.order??this.finalizedOrder).total,price:(this.api.order??this.finalizedOrder).totalWithoutTaxes,priceWithTax:(this.api.order??this.finalizedOrder).total,availableQuota:(this.estimation?.availableQuota??!1)&&!this.booking.isMonthlyBooking}),this.arrival=(0,vn.default)(this.booking.start),this.workspace.bookingDurationType==="HOUR"||this.booking.isMonthlyBooking?this.arrivalValue=this.arrival.format("LL LT"):this.booking.period?this.arrivalValue=this.arrival.format("LL - ")+this.translate.get("components.workspace.datepicker.steps.time."+this.booking.period.toLowerCase()):this.arrivalValue=this.arrival.format("LL"),this.departure=(0,vn.default)(this.booking.end),this.departureValue=this.departure.format("LL LT"),this.services=yield this.api.workspaceService.getServices(this.booking.workspace.id,this.booking.bookedSeats.map(t=>t.seat.id)),this.seatsServices?.length>0?this.updateServicesWithSeatsServices():this.allServices=this.services,r){let t={workspaceId:this.booking.workspace.id,start:this.booking.start,end:this.booking.end,places:this.booking.places,isMonthlyBooking:this.booking.isMonthlyBooking,days:this.booking.days};this.estimation=yield this.api.bookingService.estimate(t),this.updateEstimateData()}e&&this.updateEstimateData();let n=this.booking?.company??this.workspace?.company??this.building?.company??this.api.companyEnvironment?.company;try{this.useStripeCheckout=(yield this.api.integrationService.stripe.checkStatus(n.id)).value===!0}catch{this.useStripeCheckout=!1}this.useStripeCheckout?(!this.bookServices||this.route.snapshot.queryParams.step==="payment")&&(this.payOnInitDone=!1,this.initStripeCheckout()):this.estimation?.minutes>0&&this.estimation?.availableQuota&&this.estimation?.selectedQuota&&!this.bookServices?(this.payOnInitDone=!1,this.pay()):this.estimation?.total<=0?!this.bookServices&&!this.estimation.quotaOnly?(this.payOnInitDone=!1,this.pay()):this.bookServices||this.stepper.next():this.route.snapshot.queryParams.step==="payment"&&(this.bookForBuilding&&(this.api.order?.total??0)<=0?(this.payOnInitDone=!1,this.pay()):this.nextStep()),this.loadSources(),this.api.user&&this.paiementInfosOk(),this.participants.push({email:this.api.user.email,firstname:this.api.user.firstname,lastname:this.api.user.lastname}),this.participants=[...this.participants],this.calculatePrice(),this.getServicesSummary(),this.initDone=!0,!this.bookServices&&(!(this.estimation?.isFree??!0)||(this.api.order?.total??0)>0)&&this.checkUserDayDeclarations()})}ngOnDestroy(){this.stripeCheckout&&(this.stripeCheckout.unmount(),this.stripeCheckout.destroy())}getServicesByBuilding(){return z(this,null,function*(){this.building&&(this.services=yield this.api.buildingService.getServices(this.building.id),this.seatsServices?.length>0?this.updateServicesWithSeatsServices():this.allServices=this.services,this.filtersAllowedServices())})}updateEstimateData(){let r=1+(this.workspace.company.tvaRatio??(this.workspace.company.hasTva?2e3:0))/1e4,e=vn.default.tz(this.booking.start,"UTC");if(this.estimation.total=this.estimation.price,this.estimation.totalWithTaxes=this.estimation.total*r,this.api.order.coupon){this.booking.coupon=this.api.order.coupon;let t=this.estimation.price;this.booking.coupon.isPercent?t*=this.booking.coupon.value/100/100:t=this.booking.coupon.value,this.estimation.total=this.estimation.total-t,this.estimation.totalWithTaxes=this.estimation.total*r}let n=Math.abs((0,vn.default)().diff(e,"month",!0));this.booking.isMonthlyBooking&&(this.availableTypes=["card","sepa"]),n>=1&&this.availableTypes.push("sepa"),this.estimation.quotaOnly&&(this.availableTypes=["quota"]),this.estimation.selectedQuota&&(this.selectedSource=this.estimation.selectedQuota)}updateServicesWithSeatsServices(){let r=new Set,e=this.dataProvider.storage.userBookData.seatsServicesTree;e&&(this.services.forEach(n=>{n?.services?.length>0&&n.services.forEach(t=>{r.add(t.id)})}),this.seatsServices.forEach(n=>{if(!r.has(n.id)){r.add(n.id);let t=null;e.forEach(s=>{if(s?.services?.length>0&&(t=s.services.find(_=>_.id===n.id),t)){let _=this.findServiceType(t),C=this.services.find(I=>I.name===_);C&&C.services.push(t)}})}}),this.allServices=this.services)}findServiceType(r){return r.type?.parent?r.type?.parent?.parent?r.type?.parent?.parent?.parent?r.type?.parent?.parent?.parent?.parent?r.type?.parent?.parent?.parent?.parent.name:r.type?.parent?.parent?.parent.name:r.type?.parent?.parent.name:r.type?.parent.name:r.type.name}filtersAllowedServices(){this.services=this.allServices.map(r=>r),this.allowedServices&&(this.services=this.services.map(r=>{let e=Object.assign({},r);return e.services=e.services.filter(n=>{for(let t of this.allowedServices)if(t.id===n.id)return!0;return!1}),e}))}loadSources(){Promise.all([this.api.userService.sourcesService.get(),this.api.order&&this.api.order.coupon==null&&!this.bookForBuilding?this.api.bookingService.getAvailableQuota(this.booking.workspace.id):[]]).then(r=>{let e=r[0];e.quotas=r[1],this.sources=e,this.bookForBuilding||(this.allSources=this.getSources("all"),this.bookingSources=this.getSources("booking")),this.serviceSources=this.getSources("services"),this.changeDetector.detectChanges()})}onKeyUpCoupon(r,e=null){r.which===13&&this.addCoupon(e)}addCoupon(r){if(this.coupon!=null&&this.coupon.trim().length>0){let e=null,n=null;this.booking&&this.booking.workspace&&(e=this.booking.workspace.id,n=this.booking.workspace.company.id),this.building&&(n=this.building.company.id),this.api.couponService.find({workspace:e,company:n,code:this.coupon.trim().toUpperCase()},r?.button).then(t=>{this.api.orderService.addCoupon(t,r?.button)}).catch(t=>{this.toastr.error(this.translate.get("coupons.errors."+t.error.toLowerCase()))})}}pay(r){let e=r?.button;if(!r&&this.payBtn&&(e=this.payBtn),e&&(this.payBtn=e),!this.tryToRedirectToPaymentPage()){if(this.selectedSource==null&&!this.useStripeCheckout&&this.estimation&&(this.api.order?.total>0||this.estimation?.minutes>0&&this.estimation?.availableQuota&&this.estimation?.quotaOnly)){oa.default.fire({icon:"error",title:this.translate.get("pages.user.book.swal.error.source"),confirmButtonText:this.translate.get("global.confirm"),cancelButtonText:this.translate.get("global.back"),showCancelButton:!1}),this.payOnInitDone=!0;return}if(this.paymentInProgress=!0,this.bookForBuilding){let n={kind:"SERVICES",services:this.api.order.services,order:this.api.order};this.paymentMethod===null&&this.api.order.totalServices>0&&(this.paymentMethod=this.selectedSourceService),this.useStripeCheckout&&(this.paymentMethod={id:"",type:"CHECKOUT"}),this.api.orderService.pay({customer:{id:this.api.user.id},method:this.api.order.totalServices>0?this.paymentMethod?.type?.toUpperCase():"FREE",methodId:this.api.order.totalServices>0?this.paymentMethod?.id:null,target:n},e).then(t=>this.handlePaySuccess(t,!0)).catch(t=>{this.handlePayError(t)}).finally(()=>{this.payOnInitDone=!0,this.paymentInProgress=!1})}else{this.useStripeCheckout&&this.estimation.selectedQuota&&this.bookedServices?.length>0&&(this.payServicesWithOtherSource=!0),this.paymentMethod=this.estimation?.total<=0&&!this.estimation?.quotaOnly?null:this.selectedSource,this.paymentMethod===null&&!this.payServicesWithOtherSource&&this.api.order.total>0&&(this.paymentMethod=this.selectedSource);let n=this.api.order.id,t={kind:this.payServicesWithOtherSource?"BOOKINGS":"ORDER",bookings:[],services:[]};t.bookings=this.api.order.bookings.map(_=>({id:_.id})),this.payServicesWithOtherSource||(t.services=this.api.order.services.map(_=>({id:_.id})));let s=this.api.order.total>0;this.useStripeCheckout&&!this.estimation.selectedQuota&&s&&(this.paymentMethod={id:"",type:"CHECKOUT"}),this.useStripeCheckout&&this.estimation.selectedQuota&&this.api.order?.totalServices>0&&(this.payServicesWithOtherSource=!0),this.estimation.isFree&&!this.selectedSource&&!this.payServicesWithOtherSource&&!s&&this.completePayment(),this.api.orderService.pay({orderId:n,customer:{id:this.api.user.id},method:this.paymentMethod==null?"FREE":this.paymentMethod.type.toUpperCase(),methodId:this.paymentMethod==null?null:this.paymentMethod?.id,target:t},e).then(_=>{if(this.handlePaySuccess(_),this.payServicesWithOtherSource){let C={kind:"SERVICES",services:this.api.order.services.map(I=>({id:I.id}))};this.useStripeCheckout&&(this.selectedSourceService={id:"",type:"CHECKOUT"}),this.api.orderService.pay({customer:{id:this.api.user.id},method:this.selectedSourceService.type.toUpperCase(),methodId:this.selectedSourceService.id,target:C},e).then(I=>this.handlePaySuccess(I)).catch(I=>{this.handlePayError(I)})}}).catch(_=>{_?.error&&this.handlePayError(_)}).finally(()=>{this.payOnInitDone=!0,this.paymentInProgress=!1})}}}handlePaySuccess(r,e=!1){return z(this,null,function*(){if(this.useStripeCheckout&&r.paymentIntent?.method==="CHECKOUT"){this.handleStripeCheckout(r);return}this.checkUserDayDeclarations(),r.paymentIntent?.method==="CARD"?yield this.utils.getStripeInstance().confirmCardPayment(r.paymentIntent.clientSecret).toPromise().then(t=>{this.handleConfirmResp(t)}):r.paymentIntent?.method==="SEPA"?yield this.utils.getStripeInstance().confirmSepaDebitPayment(r.paymentIntent.clientSecret).toPromise().then(t=>{this.handleConfirmResp(t)}):(!this.payServicesWithOtherSource||e)&&this.completePayment(r)})}handlePayError(r){this.payOnInitDone=!0;let e=this.translate.get("pages.user.book.swal.error.title"),n="",t="";if(r.error&&r.error.declineCode){let s=this.translate.get("stripe."+r.error.declineCode+".description"),_=this.translate.get("stripe."+r.error.declineCode+".customer_instructions");n=_,s!=="stripe."+r.error.declineCode+".description"&&!this.utils.isBlank(s)&&(e=s,n=_),r.error.requestId&&(t=this.translate.get("pages.user.book.swal.error.footer").replace("{{req}}",r.error.requestId))}else if(r.error&&typeof r.error=="string")try{let s=JSON.parse(r.error);n=this.translate.get("global.errors.payment."+s.error?.toLowerCase())}catch{n=this.translate.get("global.errors.payment."+r?.error?.toLowerCase())}oa.default.fire({icon:"error",title:e,html:n,footer:t})}handleConfirmResp(r){r.paymentIntent?(r.paymentIntent.status==="requires_capture"||r.paymentIntent.status==="succeeded"||r.paymentIntent.status==="processing")&&this.completePayment():r.error&&oa.default.fire({icon:"error",text:r.error.message})}togglePayServices(r){this.payServicesWithOtherSource=r,this.allSources=this.getSources("all"),this.bookingSources=this.getSources("booking"),this.serviceSources=this.getSources("services")}completePayment(r={}){this.payOnInitDone=!0,this.paymentCompleted=!0,this.changeDetector.detectChanges(),this.stepper.selectedIndex=this.stepper.steps.length-1,clearInterval(this.remainingTimeInterval),this.remainingTimeInterval=null,sessionStorage.clear(),this.booking=this.api.order.bookings.length>0?this.api.order.bookings[0]:null,localStorage.removeItem("bookServices"),localStorage.removeItem("seatsServicesTree"),localStorage.removeItem("bookForBuilding"),localStorage.removeItem("building"),localStorage.removeItem("order"),delete this.dataProvider.storage.userBookData,this.finalizedOrder=Object.assign({},r),this.api.order&&(this.finalizedOrder=Object.assign({},this.api.order,r),this.api.order=null),this.refreshFinalizedOrder()}refreshFinalizedOrder(){this.finalizedOrder&&(this.finalizedOrder.bookings&&(this.finalizedOrder.bookings.forEach(r=>r.status=this.estimation?.isRestricted?"WAITING":"CREATED"),this.selectedSource==null?(this.finalizedOrder.total=0,this.finalizedOrder.totalQuota=null):this.selectedSource.type==="quota"?this.finalizedOrder.total=0:this.finalizedOrder.totalQuota=null),this.finalizedOrder.services&&this.finalizedOrder.services.forEach(r=>{r.status=r.service.requiresPreparation?"TO_BE_PREPARED":"READY"}))}tryToRedirectToPaymentPage(){let r=this.translate.get("pages.user.book.metadata.url");return this.api?.companyEnvironment&&(r=this.translate.get("pages.company_environment.book.metadata.url").replace(":environmentId",this.api?.companyEnvironment?.urlOrId)),["user.book","company_environment.book"].includes(this.route.snapshot.data?.route_id)?!1:(this.router.navigate([r],{queryParams:{step:"payment"},queryParamsHandling:"merge"}),!0)}mainSourceUpdated(r){this.selectedSource=r,this.selectedSource&&this.selectedSource.type==="credit"&&(this.payServicesWithOtherSource=!1)}serviceSourceUpdated(r){this.selectedSourceService=r}availableServicesTypes(){let r=["card"];return this.availableTypes.indexOf("sepa")>-1&&r.push("sepa"),this.bookForBuilding&&r.push("credit"),r}sourceUpdate(r){r.quotas=this.availableSources.quotas,this.availableSources=r}addParticipant(r){this.participants.filter(n=>n.email===r.email).length>0||(this.participants.push(r),this.participants=[...this.participants])}deleteLine(r){this.participants.splice(this.participants.indexOf(r),1),this.participants=[...this.participants]}onStepChanged(){this.api.companyEnvironment||window.scrollTo({top:0,behavior:"smooth"})}get showNextStep(){return this.api.order?.total>0&&!this.useStripeCheckout}nextStep(){this.tryToRedirectToPaymentPage()||(this.useStripeCheckout&&this.initStripeCheckout(),this.stepper.next())}calculatePrice(){this.sumWithTaxesServices=0,this.sumWithoutTaxesServices=0,this.api.order?.services?.length>0&&(this.sumWithTaxesServices=this.api.order.totalServices,this.sumWithoutTaxesServices=this.api.order.totalServicesWithoutTaxes)}getRemainingTime(){if(!this.api.order)return;let r=(0,vn.default)(),e=vn.default.tz(this.api.order.expireAt,"UTC");r.isAfter(e)||(this.remainingTime=("0"+e.diff(r,"minutes")).slice(-2)+":"+("0"+e.diff(r,"seconds")%60).slice(-2))}getSources(r){return{cards:this.sources.cards,quotas:this.sources.quotas.filter(e=>!this.estimation.availableQuota||r==="services"?!1:(e.disabled=e.remaining<this.booking.minutes,!0)),credits:this.sources.credits.filter(e=>(r==="all"&&(e.disabled=(this.api.order?.total??0)>e.remaining),r==="booking"&&(e.disabled=this.booking.price>e.remaining),r==="services"&&(e.disabled=this.sumWithTaxesServices>e.remaining),!0)),sepas:this.sources.sepas}}removeService(r){let e=this.api.order.services.indexOf(this.api.order.services.find(n=>n.id===r.id));this.api.order.services.splice(e,1),this.api.orderService.add(this.api.order).then(n=>{this.api.order=n,localStorage.setItem("order",JSON.stringify(this.api.order))}).catch(n=>{n.error=="USER_NOT_FOUND"?this.toastr.error(this.translate.get("pages.user.profile.notifications.categories.order.list.toastr.user_not_found")):n.error=="ORDER_UNAUTHORIZED"?this.toastr.error(this.translate.get("pages.user.profile.notifications.categories.order.list.toastr.order_unauthorized")):n.error=="ORDER_CANNOT_BE_MODIFIED"&&this.toastr.error(this.translate.get("pages.user.profile.notifications.categories.order.list.toastr.order_cannot_be_modified"))})}getServicesSummary(){return this.bookedServices=[],this.api.order?(this.api.order.services.forEach(r=>{let e=!1,n=Object.assign({},r);this.bookedServices.forEach(t=>{t.service.id===n.service.id&&(e=!0,t.priceWithoutTaxes+=r.priceWithoutTaxes,t.priceTaxes+=r.priceTaxes,t.quantity+=r.quantity,t.hours+=Math.ceil(r.minutes/60))}),e||this.bookedServices.push(n)}),this.bookedServices):this.bookedServices}sourcesUpdated(){this.api.userService.getMenuInfos()}getTermsUrl(r){return ut.api+"/companies/"+r+"/terms"}getBookingsUrl(){let r;this.api?.companyEnvironment?r=this.translate.get("pages.company_environment.bookings.metadata.url").replace(":environmentId",this.api?.companyEnvironment?.urlOrId):r=this.translate.get("pages.user.bookings.metadata.url"),this.router.navigate([r])}goHome(){let r;this.api?.companyEnvironment?r=this.translate.get("pages.company_environment.index.metadata.url").replace(":environmentId",this.api?.companyEnvironment?.urlOrId):r=this.translate.get("pages.app.index.metadata.url"),this.router.navigate([r])}paiementInfosOk(){this.paymentInfosAreOk=this.api.user.firstname?.length>0&&this.api.user.lastname?.length>0&&this.api.user.phoneNumber?.length>0&&this.api.user.socialAddress?.address1?.length>0&&this.api.user.socialAddress?.addressPostalCode?.length>0&&this.api.user.socialAddress?.addressCity?.length>0&&this.api.user.socialAddress?.addressCountry?.length>0}completeInformations(){let r=this.modal.open(Hp,{size:"lg",centered:!0,scrollable:!0});r.componentInstance.user=this.api.user,r.componentInstance.onSuccess=()=>{r.close(),this.paiementInfosOk()},r.componentInstance.onClose=()=>{r.close()}}checkUserDayDeclarations(){if(this.api?.currentCompany){this.loadingUserDeclarations=!0;let r={start:this.booking.start,end:this.booking.end,workspaceTypes:[],workspaceBookedType:this.booking?.workspace?.type},e=this.booking?.workspace?.building?.id||this.building?.id;if(!this.booking||!r.start||!r.end||!e){this.loadingUserDeclarations=!1;return}this.api.unavailableMomentsService.getUserAvailableActions(this.api.currentCompany.id,this.booking?.workspace?.building?.id||this.building?.id,r).then(n=>{this.availableActions=n,this.loadingUserDeclarations=!1,this.availableActionsNumber=this.getAvailableActionsNumber()}).catch(()=>{this.loadingUserDeclarations=!1,this.availableActionsNumber=0})}}getAvailableActionsNumber(){let r=this.availableActions.bookable,e=0;return["workspaces","cafeterias","parkings"].forEach(t=>{r[t]&&(t!=="workspaces"&&this.booking?.workspace?.type!==t||this.booking?.workspace?.type!=="coworking"&&this.booking?.workspace?.type!=="desktop")&&e++}),e}book(r){let e=r.toLowerCase()+"s";if(this.availableActions.workspaces[e]?.length>1)this.navigateToBuildingWorkspaces(r);else{let n={startTime:this.booking.start,endTime:this.booking.end,period:this.booking?.period};sessionStorage.setItem("search_filters",JSON.stringify(n)),this.navigateToWorkspace(this.availableActions.workspaces[e][0])}}navigateToBuildingWorkspaces(r){let e;this.api?.companyEnvironment?e=this.translate.get("pages.company_environment.building.metadata.url").replace(":environmentId",this.api?.companyEnvironment?.urlOrId).replace(":buildingId",this.booking.workspace.building.id):e=this.translate.get("pages.user.environment.building.metadata.url").replace(":buildingId",this.booking.workspace.building.id),this.router.navigate([e],{queryParams:{startDate:this.booking.start,endDate:this.booking.end,period:r!==sn.CAFETERIA?this.booking?.period:null,types:r==="WORKSPACE"?"desktop,coworking":r.toLowerCase(),floors:this.getActionsFloors(r)}})}getActionsFloors(r){return r=="WORKSPACE"?this.availableActions?.floors?.workspaces.join(","):r=="CAFETERIA"?this.availableActions?.floors?.cafeterias.join(","):r=="PARKING"?this.availableActions?.floors?.parkings.join(","):""}navigateToWorkspace(r){this.api.workspaceService.get(r).then(e=>{let n,t=e.url;this.api?.companyEnvironment?n=this.translate.get("pages.company_environment.workspace.metadata.url").replace(":url",t).replace(":environmentId",this.api?.companyEnvironment?.urlOrId):n=this.translate.get("pages.app.workspace.metadata.url").replace(":url",t),this.router.navigate([n])})}initStripeCheckout(){if(this.route.snapshot.queryParamMap.get("session_id")){this.finalizeStripeCheckout();return}this.pay()}handleStripeCheckout(r){return z(this,null,function*(){let e=r.paymentIntent,n=this.bookServices?2:1;this.stepper.selectedIndex!==n&&(this.stepper.selectedIndex=n),this.stripe=yield Jp(e.publishableKey),this.stripeCheckout=yield this.stripe.initEmbeddedCheckout({clientSecret:e.clientSecret,onComplete:()=>{this.stripeCheckout.unmount(),this.stripeCheckout.destroy(),this.stripeCheckout=null,this.finalizeStripeCheckout()}}),this.stripeCheckout.mount("#stripeCheckoutElement")})}finalizeStripeCheckout(){return z(this,null,function*(){let r=this.route.snapshot.paramMap.get("id"),e=yield this.api.orderService.get(this.api?.order?.id??r);this.completePayment(e)})}get disablePayBtn(){return!(this.api.order?.total>=0||this.api.order?.totalServices>=0)||this.bookForBuilding&&(!this.api.order||this.api.order?.services==null||this.api.order?.services?.length===0)}quotaSelected(r){let e=this.estimation.availableQuotas?.find(n=>n.id===r.value);this.estimation.selectedQuota=e,sessionStorage.setItem("estimation",JSON.stringify(this.estimation))}get actionType(){return this.estimation?.selectedQuota||!(this.estimation?.isFree??!0)||(this.api.order?.totalServices??0)>0?"pay":"validate"}static{this.\u0275fac=function(e){return new(e||i)(y(F),y(_e),y(Se),y(mt),y(ur),y(U),y(Ce),y(Ue),y(br))}}static{this.\u0275cmp=P({type:i,selectors:[["app-user-book"]],viewQuery:function(e,n){if(e&1&&A(Jt,7),e&2){let t;D(t=O())&&(n.stepper=t.first)}},inputs:{updateAllowedServices:[0,"allowedServices","updateAllowedServices"],updateBuilding:[0,"buildingEnvironment","updateBuilding"],bookForBuilding:"bookForBuilding"},decls:25,vars:20,consts:[["stepper",""],["payBtn",""],["couponBtn",""],[1,"content","d-block",3,"ngClass"],[1,"container"],[1,"row","pt-5"],[1,"col"],[1,"m-auto",3,"diameter","mode"],[1,"row"],[3,"selectionChange","labelPosition","linear"],[3,"completed","editable"],[4,"ngIf"],[3,"hidden","editable",4,"ngIf"],[3,"hidden","completed","editable",4,"ngIf"],["editable","false"],["matStepLabel",""],[1,"row","confirmation-row"],[1,"col-xs-12","col-sm-12","col-md"],[1,"pane","p-32"],["matStepperIcon","number"],["matStepperIcon","done"],["matStepperIcon","edit"],["class","expire expire-popin",3,"disabled","matTooltip",4,"ngIf"],[3,"hidden","editable"],[1,"main_container"],[1,"col-12","col-lg-7"],[1,"pane","p-4"],[1,"mat-title-large","mb-4"],["class","row mb-3",4,"ngIf"],["class","row align-items-center mb-3",4,"ngIf"],[1,"w-100"],[1,"available_services","mat-title-medium","mt-4","mb-2"],[1,"servicesDescription"],["class","mb-4 p-3",4,"ngIf"],["class","mb-4",3,"type","onlyBookable","services","company","workspace","building","startDate","endDate",4,"ngIf"],[1,"col-12","col-lg-5","mt-4","mt-lg-0"],[1,"mat-title-large"],["class","workspace mt-4",4,"ngIf"],[1,"my-4"],["class","expire my-4",3,"disabled","matTooltip",4,"ngIf"],[1,"nextButton","d-flex","justify-content-center","flex-wrap"],["id","tag-book-pay-clicked","class","w-100","type","PRIMARY","rightIconName","arrow_forward","iconColor","white",3,"textKey","widthFull","isDisabled","clicked",4,"ngIf"],["textKey","components.order_summary.next","type","PRIMARY",3,"isDisabled","clicked",4,"ngIf"],["class","textNext mt-3 text-center w-100",4,"ngIf"],[1,"row","mb-3"],[1,"col","text-start"],[1,"date","mat-title-medium"],[1,"col","text-end"],[1,"people","mat-title-medium"],[3,"inline"],[1,"row","align-items-center","mb-3"],["class","col-12 col-md-6",4,"ngIf"],[1,"col-12","col-md-6"],[1,"col-auto","align-self-center"],[1,"dateSelectionText"],[1,"col","dateSelection"],["matInput","","readonly","",3,"ngModelChange","ngModel","placeholder"],["matSuffix",""],[1,"col","align-self-center"],[1,"col-auto","dateSelection"],["matInput","","readonly","",3,"ngModelChange","ngModel"],[1,"mb-4","p-3"],[1,"m-auto",3,"diameter"],[1,"mb-4",3,"type","onlyBookable","services","company","workspace","building","startDate","endDate"],[1,"workspace","mt-4"],[1,"row","align-items-center"],[1,"col-auto","subtitle"],[1,"row","mt-2","align-items-center"],["class","col-auto text-end prices",4,"ngIf"],[1,"col-auto","text-end","prices"],[1,"service","mt-4"],[4,"ngFor","ngForOf"],[1,"row","mt-2"],[1,"col","no-booked-services"],["class","servicePrice",4,"ngIf"],[1,"servicePrice"],["class","total",4,"ngIf"],[1,"total"],["class","row",4,"ngIf"],["class","row mt-2",4,"ngIf"],[1,"row","mt-4"],[1,"col","text-uppercase","totalWithoutTaxes"],[1,"text-uppercase"],["class","text-uppercase",4,"ngIf"],[1,"ps-4","stripe-payment-methods-list","mb-0"],[1,"w-100","mt-2"],[3,"selectionChange","ngModel"],["class","book-process-quota-option",3,"value","disabled",4,"ngFor","ngForOf"],[1,"book-process-quota-option",3,"value","disabled"],[1,"book-process-quota-remaining"],[1,"expire","my-4",3,"matTooltip"],[1,"time"],["id","tag-book-pay-clicked","type","PRIMARY","rightIconName","arrow_forward","iconColor","white",1,"w-100",3,"clicked","textKey","widthFull","isDisabled"],["textKey","components.order_summary.next","type","PRIMARY",3,"clicked","isDisabled"],[1,"textNext","mt-3","text-center","w-100"],["target","_blank","rel","noopener",3,"href"],[3,"hidden","completed","editable"],["class","row mt-3",4,"ngIf"],["id","stripe-checkout-row",1,"row","py-4"],["id","stripeCheckoutElement"],[1,"row","mt-3"],[1,"title"],["class","row mt-4",4,"ngIf"],[1,"w-100","mt-4"],[1,"col","purple"],[1,"col","text-end","purple"],["class","row mt-3 align-items-center",4,"ngIf"],[1,"col-12","col-md-6","mt-4","mt-md-0"],[1,"title","px-3"],[1,"mt-4","px-3","sourcesDescription"],[3,"innerHTML",4,"ngIf"],["class","payServices p-3",4,"ngIf"],[1,"expire","px-3","mt-4",3,"matTooltip"],["class","mt-2 px-3 restricted text-start",4,"ngIf"],["class","px-3 d-flex justify-content-center flex-wrap",4,"ngIf"],[1,"row","mt-3","px-3"],[1,"col","m-1","d-flex","justify-content-center","flex-wrap"],[1,"w-100","secured","text-center"],["id","payBtn","type","PRIMARY",1,"mt-3",3,"clicked","textKey","isDisabled"],[1,"row","mt-2","w-sm-75","mx-auto"],[1,"col","mx-lg-5","text-center"],[1,"cgu","m-0"],[1,"col-auto"],[1,"reduce",3,"click"],[1,"text-underline"],[1,""],["class","places",4,"ngIf"],[1,"seats"],[1,"places"],[1,"row","justify-content-between"],[1,"mb-0"],[1,"quantity"],[1,"row","mt-3","align-items-center"],["matInput","","type","text","name","coupon","id","btn",1,"coupon",3,"keyup","ngModelChange","ngModel"],[1,"col-auto","text-end"],["textKey","global.apply","type","SECONDARY",3,"clicked"],[3,"innerHTML"],[3,"selectedSourceChanged","shouldWarnQuotaCredit","types","sources"],[1,"payServices","p-3"],["class","purple mb-2",3,"disabled","ngModel","ngModelChange",4,"ngIf"],[1,"purple","mb-2",3,"ngModelChange","disabled","ngModel"],[3,"selectedSourceChanged","types","sources"],[1,"mt-2","px-3","restricted","text-start"],[1,"px-3","d-flex","justify-content-center","flex-wrap"],[1,"mt-4","complete_informations"],[1,"material-icons"],["textKey","pages.user.book.steps.complete_informations_modal_title","type","SECONDARY",3,"clicked"],[1,"p-5"],[1,"col-12","confirmation-container"],[1,"w-100","d-flex","justify-content-center","mb-3"],["alt","waiting",1,"confirm-icon",3,"src"],[1,"confirmation-message"],["class","confirmation-message-hint",4,"ngIf"],["class","col-12 mt-0",4,"ngIf"],[1,"row","justify-content-center","mt-3"],[1,"col-12","col-md-10","col-lg-8"],["class","m-auto",3,"diameter",4,"ngIf"],["textKey","pages.user.book.back_home","type","PRIMARY",1,"w-100",3,"clicked","widthFull"],[1,"confirmation-message-hint"],[1,"col-12","mt-0"],[3,"order","shouldNotifyInvitations"],["class","col mb-3",4,"ngIf"],[1,"col","mb-3"],["textKey","pages.user.book.book_workspace","type","SECONDARY","iconName","seat",3,"clicked","widthFull"],["textKey","pages.user.book.book_parking","type","SECONDARY","iconName","local_parking",3,"clicked","widthFull"],["textKey","pages.user.book.book_cafeteria","type","SECONDARY","iconName","restaurant",3,"clicked","widthFull"],[1,"expire","expire-popin",3,"matTooltip"]],template:function(e,n){if(e&1){let t=k();a(0,"div",3)(1,"section",4)(2,"div",5)(3,"div",6),x(4,"mat-progress-spinner",7),l()(),a(5,"div",8)(6,"div",6)(7,"mat-horizontal-stepper",9,0),b("selectionChange",function(){return f(t),v(n.onStepChanged())}),a(9,"mat-step",10),h(10,zC,1,0,null,11)(11,QC,1,0,null,11),l(),h(12,Kx,35,25,"mat-step",12)(13,Ay,6,6,"mat-step",13),a(14,"mat-step",14),h(15,Vy,2,3,"ng-template",15),a(16,"div",16)(17,"div",17)(18,"div",18),h(19,Ry,3,1,"div",11)(20,jy,17,17,"div",11),l()()()(),h(21,Qy,0,0,"ng-template",19)(22,Hy,0,0,"ng-template",20)(23,Yy,0,0,"ng-template",21),l()()()()(),h(24,Gy,8,12,"div",22)}if(e&2){let t,s=V(8);c("ngClass",re(18,WC,n.api.companyEnvironment)),o(2),E("d-none",n.initDone&&n.payOnInitDone),o(2),c("diameter",25)("mode","indeterminate"),o(),E("d-none",!(n.initDone&&n.payOnInitDone)),o(2),c("labelPosition","bottom")("linear",!0),o(2),c("completed",!0)("editable",!1),o(),c("ngIf",!n.bookForBuilding),o(),c("ngIf",n.bookForBuilding),o(),c("ngIf",n.bookServices),o(),c("ngIf",!(!((t=n.estimation==null?null:n.estimation.isFree)!==null&&t!==void 0)||t)||((t=n.api.order==null?null:n.api.order.total)!==null&&t!==void 0?t:0)>0),o(6),c("ngIf",!n.finalizedOrder),o(),c("ngIf",n.finalizedOrder),o(4),c("ngIf",n.api.order&&s.selectedIndex>0&&s.selectedIndex<s.steps.length-1&&n.useStripeCheckout)}},dependencies:[ce,j,R,fe,ee,gt,$,zn,dr,Jt,vl,be,Xl,ve,ae,rt,Ti,pr,Te,so,dt,jp,We,Oi,Le,H,Xe,N,et,$l],styles:[".mat-mdc-slide-toggle.mat-mdc-checked[_ngcontent-%COMP%]   .mat-mdc-slide-toggle-thumb[_ngcontent-%COMP%]{background-color:var(--primary-color-600)!important}.mat-mdc-slide-toggle.mat-mdc-checked[_ngcontent-%COMP%]   .mat-mdc-slide-toggle-bar[_ngcontent-%COMP%]{background-color:var(--primary-transparent-color)!important}.main_container[_ngcontent-%COMP%]{margin-top:40px}.restricted[_ngcontent-%COMP%]{color:#d3153b;font-size:14px;margin:0}.complete_informations[_ngcontent-%COMP%]{font-weight:600;display:flex;justify-content:center;align-items:flex-start}.complete_informations[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:20px;margin-right:.5rem;margin-top:3px}h2.title[_ngcontent-%COMP%]{font-size:31px;line-height:42px}.purple[_ngcontent-%COMP%]{color:var(--primary-color-600);font-size:16px}.pane[_ngcontent-%COMP%]{background-color:#fff;border-radius:12px;box-shadow:0 4px 16px #0000000d}.pane.p-32[_ngcontent-%COMP%]{padding:32px}.remove[_ngcontent-%COMP%]{width:40px}.warning[_ngcontent-%COMP%]{color:orange;font-size:20px}.warning-link[_ngcontent-%COMP%]{cursor:pointer;float:left;margin:6px 0 0 10px}.warning-link.disabled[_ngcontent-%COMP%]{cursor:default}[_nghost-%COMP%]     .mat-stepper-label-position-bottom .mat-horizontal-stepper-header{padding:20px}[_nghost-%COMP%]     .mat-horizontal-stepper-header:before, [_nghost-%COMP%]     .mat-horizontal-stepper-header:after{top:28px!important;border-top-color:#fff}[_nghost-%COMP%]     .mat-stepper-horizontal-line{top:28px!important;border-top-color:#fff}[_nghost-%COMP%]     .mat-step-icon{background-color:#bcc4f2!important;width:16px!important;height:16px!important}[_nghost-%COMP%]     .mat-step-icon-selected{background-color:#ffdf69!important}[_nghost-%COMP%]     .mat-step-icon-state-done{background-color:var(--primary-color-600)!important}[_nghost-%COMP%]     .mat-step-label{text-transform:uppercase;font-weight:400;font-size:15px;color:#bcc4f2!important}[_nghost-%COMP%]     .mat-step-label-active{color:#f9fafe!important}.content[_ngcontent-%COMP%]{padding-bottom:70px}.icon[_ngcontent-%COMP%]{width:28px;height:28px;border-radius:50%;background-color:var(--primary-color-600)}.title[_ngcontent-%COMP%]{font-size:22px;color:var(--primary-color-600)}.subtitle[_ngcontent-%COMP%]{font-weight:500;font-size:16px}.no-booked-services[_ngcontent-%COMP%]{color:var(--primary-color-500)}.name[_ngcontent-%COMP%]{font-weight:500;font-size:12px;color:var(--primary-color, var(--primary-color-600));text-transform:uppercase}.time[_ngcontent-%COMP%]{font-weight:500;color:var(--primary-color, var(--primary-color-600))}.places[_ngcontent-%COMP%], .quantity[_ngcontent-%COMP%]{font-size:12px}.seats[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-size:14px}.servicePrice[_ngcontent-%COMP%]{margin-right:0}.prices[_ngcontent-%COMP%], .total[_ngcontent-%COMP%]{font-size:14px}.totalWithoutTaxes[_ngcontent-%COMP%]{color:var(--primary-color-600);font-weight:600;font-size:14px}.expire.disabled[_ngcontent-%COMP%]{opacity:.5}.expire-popin[_ngcontent-%COMP%]{position:fixed;left:40px;bottom:40px;padding:12px 16px;border-radius:8px;box-shadow:0 2px 16px #0000001a;background:#fff}.textNext[_ngcontent-%COMP%]{font-size:14px;color:#55585e}.removeService[_ngcontent-%COMP%]{position:absolute;right:-10px;top:-1px}.reduce[_ngcontent-%COMP%]{font-size:10px;cursor:pointer;color:#1b1917}.reduce[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{height:10px!important;width:10px!important;font-size:10px;vertical-align:middle}.sourcesDescription[_ngcontent-%COMP%]{font-size:13px}.sources[_ngcontent-%COMP%]{font-size:14px;list-style:none}.sources[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{height:15px!important;width:15px!important;font-size:15px;vertical-align:middle;margin-bottom:2px}.sources[_ngcontent-%COMP%]   .checked[_ngcontent-%COMP%]{color:var(--primary-color-600);font-weight:600}.sources[_ngcontent-%COMP%]  .mat-mdc-radio-label{align-items:start!important}.addCard[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{color:#fff}.payServices[_ngcontent-%COMP%]{background-color:#f9fafe}.secured[_ngcontent-%COMP%]{color:var(--primary-color-600);font-size:14px}.secured[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{height:15px!important;width:15px!important;font-size:15px;vertical-align:middle;margin-bottom:2px}.cgu[_ngcontent-%COMP%], .cgu[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{font-size:12px;color:var(--primary-color-500)}.quotaWarning[_ngcontent-%COMP%]{font-size:10px;color:#55585e}.servicesDescription[_ngcontent-%COMP%]{font-size:14px}.dateSelection[_ngcontent-%COMP%]{font-size:13px!important}.dateSelection[_ngcontent-%COMP%]  .mat-mdc-form-field-can-float.mat-mdc-form-field-should-float .mat-mdc-form-field-label{transform:translateY(-1em) scale(.75)}.dateSelection[_ngcontent-%COMP%]     .mat-mdc-form-field-suffix .mat-icon{font-size:1rem;line-height:2.125}.dateSelectionText[_ngcontent-%COMP%]{font-size:14px}.confirmation-row[_ngcontent-%COMP%]{margin-top:100px}.confirmation-container[_ngcontent-%COMP%]{margin-bottom:56px;border-radius:12px}.confirmation-container[_ngcontent-%COMP%]   .confirmation-message[_ngcontent-%COMP%], .confirmation-container[_ngcontent-%COMP%]   .confirmation-message-hint[_ngcontent-%COMP%]{text-align:center;margin:0}.confirmation-container[_ngcontent-%COMP%]   .confirmation-message[_ngcontent-%COMP%]{color:var(--primary-color-1000);font-size:20px;font-weight:600}.confirmation-container[_ngcontent-%COMP%]   .confirmation-message-hint[_ngcontent-%COMP%]{color:var(--primary-color-500);font-size:16px;font-weight:400}.confirmation-container[_ngcontent-%COMP%]   .confirm-icon[_ngcontent-%COMP%]{width:134px;height:120px;object-fit:contain}[_nghost-%COMP%]     .mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{display:none}[_nghost-%COMP%]     .dateSelection .mat-mdc-form-field{color:var(--primary-color-500)}[_nghost-%COMP%]     .dateSelection .mat-mdc-form-field input.mat-mdc-input-element{color:var(--primary-color-500)}[_nghost-%COMP%]     .dateSelection .mat-mdc-form-field-appearance-standard .mat-mdc-form-field-underline{background-color:var(--primary-color-500)}.stripe-payment-methods-list[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]::marker{color:#d6d6d7}  .book-process-quota-option{height:56px!important;line-height:1!important;font-size:16px!important}  .book-process-quota-option .book-process-quota-remaining{font-size:14px!important;color:var(--primary-color-500)!important}  .book-process-quota-option.mat-mdc-option-disabled .book-process-quota-remaining{color:#00000061!important}#stripe-checkout-row[_ngcontent-%COMP%]{background:#fff;border-bottom-left-radius:12px;border-bottom-right-radius:12px}"]})}};ms([wl(500)],ls.prototype,"getServicesByBuilding",null);var VD=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[de,Ye,Ge,_r,Ze,jn,Ai,Ae,Tr,Vl,$n,Je,Un,Xt,nt,mp,fi,Qt,Qp,Pr,Wn,$t,mr,ai,fi,Re,Qn,at]})}}return i})();var Zp=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-google-calendar-extension-filters-placeholder"]],decls:9,vars:0,consts:[[1,"row","flex-md-nowrap","align-items-center"],[1,"col","max-width-filters"],[1,"d-flex","flex-nowrap"],[1,"animated","input","search-bar","start"],[1,"animated","input","capacity","middle"],[1,"animated","input","equipment","middle"],[1,"animated","input","floor","end"],[1,"col-auto","button-search-container"],[1,"animated","search-button"]],template:function(n,t){n&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),x(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6),l()(),a(7,"div",7),x(8,"div",8),l()())},styles:[".animated[_ngcontent-%COMP%]{animation:placeHolderShimmer 2s linear infinite alternate;border-radius:3px}.input[_ngcontent-%COMP%]{height:41px;border-radius:8px}.search-bar[_ngcontent-%COMP%]{width:100%;width:fill-available;width:-webkit-fill-available;width:-moz-available;min-width:158px}.capacity[_ngcontent-%COMP%]{width:80px;min-width:80px;max-width:80px}.equipment[_ngcontent-%COMP%]{width:190px;min-width:190px;max-width:190px}.floor[_ngcontent-%COMP%]{width:150px;min-width:150px;max-width:150px}.search-button[_ngcontent-%COMP%]{width:112px;height:36px;border-radius:8px}.start[_ngcontent-%COMP%], .middle[_ngcontent-%COMP%]{margin-right:1px}.start[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}.middle[_ngcontent-%COMP%]{border-radius:0}.end[_ngcontent-%COMP%]{border-top-left-radius:0;border-bottom-left-radius:0}@media screen and (min-width: 956px){.equipment[_ngcontent-%COMP%]{width:250px;min-width:250px;max-width:250px}.floor[_ngcontent-%COMP%]{width:250px;min-width:200px;max-width:250px}}@media screen and (min-width: 751px){.button-search-container[_ngcontent-%COMP%]{padding-left:0}.max-width-filters[_ngcontent-%COMP%]{max-width:calc(100% - 127px)}}@media screen and (max-width: 750px){.button-search-container[_ngcontent-%COMP%]{padding-top:15px}}@media screen and (max-width: 623px){.search-bar[_ngcontent-%COMP%]{min-width:100px}.equipment[_ngcontent-%COMP%]{min-width:120px}.floor[_ngcontent-%COMP%]{min-width:100px}}"]})}}return i})();var Ao=(()=>{class i{constructor(e){this.api=e,this.buildings=[],this.buildingWorkspacesByDeclarationType={desktop:[],meeting_room:[],cafeteria:[],parking:[]},this.buildingServicesTree=new Map,this.googleExtensionService={initData:()=>z(this,null,function*(){yield this.googleExtensionService.initBuildings(),yield this.googleExtensionService.initServices()}),initBuildings:()=>z(this,null,function*(){this.buildings=yield this.api.userService.getBuildings(),yield this.googleExtensionService.initWorkspaces()}),initWorkspaces:()=>z(this,null,function*(){let n=this.buildings?.map(s=>s.id),t=yield this.api.userService.getWorkspacesByCompanyIdAndBuildingIds(this.api?.user?.mainCompany?.id,{buildingIds:n,onlyFreeWorkspaces:!1,withExternalCompany:!0});this.addWorkspacesInBuildings(t)}),initServices:()=>z(this,null,function*(){let n=[];this.buildingWorkspacesByDeclarationType.meeting_room.forEach(t=>{n.push(Promise.resolve(this.api.servicesService.getBuildingServiceTree(t.id,!0)).then(s=>Object.assign({buildingId:t.id},{servicesTree:s})).catch(s=>console.error(s)))}),yield Promise.all(n).then(t=>{t.forEach(s=>{let _=this.getServicesList(s.servicesTree);this.buildingServicesTree.set(s.buildingId,_)})}),this.getAvailableWorkspacesIncludedServices()})}}addWorkspacesInBuildings(e){this.buildings.forEach(n=>{let t=e.filter(s=>s.building.id===n.id);n.workspaces=t}),this.createBuildingWorkspacesByDeclarationType()}createBuildingWorkspacesByDeclarationType(){Ma.forEach(e=>{this.buildingWorkspacesByDeclarationType[e]=[],this.buildings.forEach(n=>{if(n?.workspaces?.some(t=>e===Sa.DESKTOP?t.type===e||t.type==="coworking":t.type===e)){let t=n.workspaces.filter(_=>e===Sa.DESKTOP?_.type===e||_.type==="coworking":_.type===e),s=ot({},n);s.workspaces=t,this.buildingWorkspacesByDeclarationType[e].push(s)}})})}getServicesList(e){let n=[];return e.forEach(t=>{n=n.concat(t?.services)}),n=n.sort((t,s)=>t.title.localeCompare(s.title)),n}getAvailableWorkspacesIncludedServices(){Ma.forEach(e=>{this.buildingWorkspacesByDeclarationType[e]?.forEach(n=>{this.updateBuildingWorkspacesAvailableServices(n)})})}updateBuildingWorkspacesAvailableServices(e){let n=e?.workspaces?.map(_=>_.id),t=this.buildingServicesTree.get(e.id),s=[];t?.forEach(_=>{_?.workspaceIds?.some(I=>n?.includes(I))&&s.push(_)}),e.services=s}static{this.\u0275fac=function(n){return new(n||i)(ke(F))}}static{this.\u0275prov=Ke({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var $y=["searchWorkspacesInput"],td=["searchServicesInput"];function Xy(i,r){if(i&1){let e=k();a(0,"button",29),b("click",function(){f(e);let t=m();return v(t.resetSearch())}),a(1,"mat-icon"),p(2,"cancel"),l()()}}function Jy(i,r){if(i&1){let e=k();a(0,"mat-option",12),b("click",function(){f(e);let t=m();return v(t.searchWorkspace(!0))}),p(1),l()}if(i&2){let e=r.$implicit;c("value",e==null?null:e.title),o(),g(" ",e==null?null:e.title," ")}}function Zy(i,r){if(i&1){let e=k();a(0,"mat-chip",30),b("removed",function(){let t=f(e).$implicit,s=m();return v(s.removeService(t))}),p(1),x(2,"app-icon",31),l()}if(i&2){let e=r.$implicit;c("selectable",!1)("editable",!1),o(),g(" ",e==null?null:e.title," ")}}function e2(i,r){if(i&1){let e=k();a(0,"mat-option",32)(1,"mat-checkbox",33),b("click",function(t){return f(e),v(t.preventDefault())}),p(2),l()()}if(i&2){let e=r.$implicit,n=m();c("value",e==null?null:e.id),o(),c("disableRipple",!0)("checked",n.serviceIsSelected(e)),o(),g(" ",e==null?null:e.title," ")}}function t2(i,r){if(i&1&&(a(0,"mat-option",32),p(1),l()),i&2){let e=r.$implicit;c("value",e==null?null:e.id),o(),g(" ",e==null?null:e.name," ")}}function i2(i,r){if(i&1&&(a(0,"mat-form-field",34)(1,"mat-label"),p(2),d(3,"translate"),l(),a(4,"mat-select",35),d(5,"translate"),h(6,t2,2,2,"mat-option",25),a(7,"mat-select-trigger"),p(8),l()()()),i&2){let e=m();E("d-none",(e.floors==null?null:e.floors.length)<2),o(2),w(u(3,7,"components.google_calendar.add_room.floor.label")),o(2),c("placeholder",u(5,9,"components.google_calendar.add_room.floor.label"))("formControl",e.multiplefloorsCtrl),o(2),c("ngForOf",e.floors),o(2),g(" ",e.getSelectedFloorsLabel()," ")}}function n2(i,r){if(i&1&&(a(0,"mat-option",32),p(1),l()),i&2){let e=r.$implicit;c("value",e==null?null:e.id),o(),g(" ",e==null?null:e.name," ")}}function o2(i,r){if(i&1&&(a(0,"mat-form-field",34)(1,"mat-label"),p(2),d(3,"translate"),l(),a(4,"mat-select",36),d(5,"translate"),h(6,n2,2,2,"mat-option",25),a(7,"mat-select-trigger"),p(8),l()()()),i&2){let e=m();E("d-none",(e.floors==null?null:e.floors.length)<2),o(2),w(u(3,7,"components.google_calendar.add_room.floor.label")),o(2),c("placeholder",u(5,9,"components.google_calendar.add_room.floor.label"))("formControl",e.floorCtrl),o(2),c("ngForOf",e.floors),o(2),g(" ",e.getSelectedFloorsLabel()," ")}}var id=(()=>{class i{set updateWorkspaces(e){e&&(this.workspaces=e.sort((n,t)=>this.utils.normalize(n.title)?.localeCompare(this.utils.normalize(t?.title))),this.selectedServices=[],this.initWorkspaceFilter())}set updateServices(e){e&&(this.services=e,this.initServiceFilter())}set updateFloors(e){e&&(this.floors=e)}set updateCapacity(e){this.capacity=e,this.capacityCtrl.setValue(e)}set updateIsMapView(e){this.isMapView=e,this.updateFloorFilter()}set updateSelectedWorkspace(e){this.selectedWorkspace=e}constructor(e,n){this.googleExtensionService=e,this.utils=n,this.workspaces=[],this.services=[],this.floors=[],this.capacity=1,this.isMapView=!1,this.isLoading=!0,this.workspacesPanelOpened=!1,this.servicesPanelOpened=!1,this.selectedServices=[],this.searchCtrl=new Oe(""),this.capacityCtrl=new Oe(1,[W.required,W.min(1)]),this.servicesCtrl=new Oe(""),this.multiplefloorsCtrl=new Oe([]),this.floorCtrl=new Oe(""),this.searchButtonEnabled=!1,this.oldCapacityValue=1,this.filterChanged=new L(!0)}ngOnInit(){this.initControllers()}initControllers(){this.capacityCtrl.valueChanges.subscribe(e=>{(!e||e===0)&&this.capacityCtrl.setValue(1,{emitEvent:!1}),this.capacityCtrl.value!==this.oldCapacityValue&&(this.searchButtonEnabled=!0),this.oldCapacityValue=this.capacityCtrl.value}),this.floorCtrl.valueChanges.subscribe(()=>this.searchButtonEnabled=!0),this.multiplefloorsCtrl.valueChanges.subscribe(()=>this.searchButtonEnabled=!0),this.searchCtrl.valueChanges.subscribe(()=>this.searchButtonEnabled=!0)}workspacesOpenPanel(e=null){this.workspacesPanelOpened=!this.workspacesPanelOpened,this.workspacesPanelOpened?(this.workspacesTriggerAutocomplete.openPanel(),e?.focus()):setTimeout(()=>{this.workspacesTriggerAutocomplete.closePanel()})}workspacesClosePanel(){this.workspacesPanelOpened=!1}initWorkspaceFilter(){this.filteredWorkspaces=this.searchCtrl.valueChanges.pipe(en(null),Zi(e=>e?.trim()?.length>0?this.filterWorkspaces(e):this.workspaces.slice()))}filterWorkspaces(e){let n=this.utils.normalize(e),t=this.workspaces.filter(_=>this.utils.normalize(_?.title)?.includes(n)).sort((_,C)=>this.utils.normalize(_.title).localeCompare(this.utils.normalize(C.title))),s=t.filter(_=>this.utils.normalize(_?.title)?.startsWith(n));return t=s.concat(t.filter(_=>!s.includes(_))),t}searchWorkspace(e){if(this.searchButtonEnabled){let n=this.getFilters();n.showUnbookable=e,this.filterChanged.emit(n),this.searchButtonEnabled=!1}}resetSearch(){this.searchCtrl.setValue(""),setTimeout(()=>{this.workspacesTriggerAutocomplete.closePanel(),this.searchButtonEnabled=!0})}servicesOpenPanel(e=null){this.servicesPanelOpened=!this.servicesPanelOpened,this.servicesPanelOpened?this.servicesTriggerAutocomplete.openPanel():setTimeout(()=>{this.servicesTriggerAutocomplete.closePanel()}),setTimeout(()=>{e?.focus()})}servicesClosePanel(){this.servicesPanelOpened=!1}initServiceFilter(){this.filteredServices=this.servicesCtrl.valueChanges.pipe(en(null),Zi(e=>e?.trim()?.length>0?this.filterServices(e):this.services.slice()))}filterServices(e){let n=this.utils.normalize(e);return this.services.filter(s=>this.utils.normalize(s?.title)?.includes(n)).sort((s,_)=>{let C=s.title.toLowerCase().indexOf(n),I=_.title.toLowerCase().indexOf(n);return C-I})}addService(e){this.selectedServices.push(e),this.searchButtonEnabled=!0}removeService(e){this.selectedServices=this.selectedServices.filter(n=>n.id!==e.id),this.searchButtonEnabled=!0}toggleService(e){let n=this.services.find(t=>t.id===e?.option?.value);this.serviceIsSelected(n)?this.removeService(n):this.addService(n),this.serviceInput.nativeElement.value="",this.servicesCtrl.setValue("")}serviceIsSelected(e){return this.selectedServices?.some(n=>n.id===e?.id)}getSelectedFloorsLabel(){if(this.isMapView){if(this.floorCtrl?.value)return this.floors?.find(e=>e.id===this.floorCtrl.value)?.name}else if(this.multiplefloorsCtrl?.value?.length>0){let e=[];return this.multiplefloorsCtrl?.value?.forEach(n=>{let t=this.floors?.find(s=>s.id===n);e.push(t?.name)}),e.join(", ")}return null}updateFloorFilter(){let e=this.floorCtrl.value,n=this.multiplefloorsCtrl.value;if(this.floorCtrl.reset(),this.multiplefloorsCtrl.reset(),this.floors?.length>1)if(this.isMapView)if(this.selectedWorkspace)this.floorCtrl.setValue(this.selectedWorkspace.workspace.floor?.id),this.searchWorkspace(!1);else if(n&&n?.length>0){let t=this.floors.filter(s=>n.includes(s.id));t=t.sort((s,_)=>s.level-_.level),this.floorCtrl.setValue(t[0].id)}else{let t=this.floors?.find(s=>s.level>=0);this.floorCtrl.setValue(t.id),this.searchWorkspace(!1)}else e&&this.multiplefloorsCtrl.setValue([e])}getFilters(){let e;return this.isMapView?e=[this.floorCtrl?.value]:e=this.multiplefloorsCtrl?.value??[],{places:this.capacityCtrl.value??1,services:this.selectedServices.map(t=>t.id),floors:e,search:this.searchCtrl.value,showUnbookable:!1}}resetFilters(){this.selectedServices=[],this.floorCtrl.reset(),this.multiplefloorsCtrl.reset(),this.capacityCtrl.reset(),this.searchCtrl.reset()}getCapacityClass(){let e="middle";return this.floors?.length<2&&(!this.services||this.services?.length<=0)&&(e="end"),e}getServicesClass(){let e="middle";return this.floors?.length<2&&(e="end"),e}static{this.\u0275fac=function(n){return new(n||i)(y(Ao),y(_e))}}static{this.\u0275cmp=P({type:i,selectors:[["app-google-calendar-extension-filters"]],viewQuery:function(n,t){if(n&1&&(A($y,5,rn),A(td,5,rn),A(td,5)),n&2){let s;D(s=O())&&(t.workspacesTriggerAutocomplete=s.first),D(s=O())&&(t.servicesTriggerAutocomplete=s.first),D(s=O())&&(t.serviceInput=s.first)}},inputs:{updateWorkspaces:[0,"workspaces","updateWorkspaces"],updateServices:[0,"services","updateServices"],updateFloors:[0,"floors","updateFloors"],updateCapacity:[0,"capacity","updateCapacity"],updateIsMapView:[0,"isMapView","updateIsMapView"],updateSelectedWorkspace:[0,"selectedWorkspace","updateSelectedWorkspace"],isLoading:"isLoading"},outputs:{filterChanged:"filterChanged"},decls:45,vars:41,consts:[["searchWorkspacesInput",""],["workspacesAutocomplete","matAutocomplete"],["serviceChips",""],["searchServicesInput",""],["servicesAutocomplete","matAutocomplete"],[1,"row","align-items-center"],[1,"col"],["floatLabel","never",1,"start","search-bar"],["matInput","",3,"click","keyup.enter","placeholder","formControl","matAutocomplete"],["matPrefix",""],["matSuffix","","mat-icon-button",""],["autoActiveFirstOption","true","autoSelectActiveOption","true",3,"closed"],[3,"click","value"],[1,"d-flex","align-items-center"],["iconName","search"],[1,"pl-1"],[3,"value","click",4,"ngFor","ngForOf"],[1,"col-auto"],["floatLabel","always",1,"capacity",3,"ngClass"],["matInput","","type","number","placeholder","1","min","1",3,"formControl"],[1,"equipment","input-chip-list",3,"click","ngClass"],["aria-label","Services selection"],[3,"selectable","editable","removed",4,"ngFor","ngForOf"],["matInput","",3,"placeholder","formControl","matAutocomplete"],[3,"optionSelected","closed"],[3,"value",4,"ngFor","ngForOf"],["class","end floor",3,"d-none",4,"ngIf"],[1,"col-auto","button-search-container"],["type","PRIMARY","textKey","components.google_calendar.add_room.button.search",3,"clicked","isDisabled"],["matSuffix","","mat-icon-button","",3,"click"],[3,"removed","selectable","editable"],["matChipRemove","","iconName","clear",1,"icon-chip"],[3,"value"],[3,"click","disableRipple","checked"],[1,"end","floor"],["multiple","",3,"placeholder","formControl"],[3,"placeholder","formControl"]],template:function(n,t){if(n&1){let s=k();a(0,"div",5)(1,"div",6)(2,"mat-form-field",7)(3,"input",8,0),d(5,"translate"),b("click",function(){f(s);let C=V(4);return v(t.workspacesOpenPanel(C))})("keyup.enter",function(){return f(s),v(t.searchWorkspace(!1))}),l(),a(6,"mat-icon",9),p(7,"search"),l(),h(8,Xy,3,0,"button",10),a(9,"mat-autocomplete",11,1),b("closed",function(){return f(s),v(t.workspacesClosePanel())}),a(11,"mat-option",12),b("click",function(){return f(s),v(t.searchWorkspace(!1))}),a(12,"div",13),x(13,"app-icon",14),a(14,"span",15),p(15),d(16,"translate"),l()()(),h(17,Jy,2,2,"mat-option",16),d(18,"async"),l()()(),a(19,"div",17)(20,"mat-form-field",18)(21,"mat-label"),p(22),d(23,"translate"),l(),x(24,"input",19),l()(),a(25,"div",17)(26,"mat-form-field",20),b("click",function(){f(s);let C=V(34);return v(t.servicesOpenPanel(C))}),a(27,"mat-label"),p(28),d(29,"translate"),l(),a(30,"mat-chip-listbox",21,2),h(32,Zy,3,3,"mat-chip",22),l(),x(33,"input",23,3),d(35,"translate"),a(36,"mat-autocomplete",24,4),b("optionSelected",function(C){return f(s),v(t.toggleService(C))})("closed",function(){return f(s),v(t.servicesClosePanel())}),h(38,e2,3,4,"mat-option",25),d(39,"async"),l()()(),a(40,"div",17),h(41,i2,9,11,"mat-form-field",26)(42,o2,9,11,"mat-form-field",26),l(),a(43,"div",27)(44,"app-button",28),b("clicked",function(){return f(s),v(t.searchWorkspace(!1))}),l()()()}if(n&2){let s,_=V(4),C=V(10),I=V(37);E("d-none",t.isLoading),o(3),c("placeholder",u(5,27,"components.google_calendar.add_room.search.placeholder"))("formControl",t.searchCtrl)("matAutocomplete",C),o(5),$e((t.searchCtrl==null||t.searchCtrl.value==null?null:t.searchCtrl.value.length)>0?8:-1),o(3),c("value",t.searchCtrl==null?null:t.searchCtrl.value),o(4),Q(" ",u(16,29,"components.google_calendar.add_room.search.menu.see_results ")," ",_==null?null:_.value," "),o(2),c("ngForOf",u(18,31,t.filteredWorkspaces)),o(3),c("ngClass",t.getCapacityClass()),o(2),w(u(23,33,"components.google_calendar.add_room.capacity.label")),o(2),c("formControl",t.capacityCtrl),o(2),E("d-none",!t.services||(t.services==null?null:t.services.length)<=0)("writting",(t.servicesCtrl==null||t.servicesCtrl.value==null?null:t.servicesCtrl.value.length)>0),c("ngClass",t.getServicesClass()),o(2),w(u(29,35,"components.google_calendar.add_room.equipment.label")),o(4),c("ngForOf",t.selectedServices),o(),c("placeholder",((s=t.selectedServices.length)!==null&&s!==void 0?s:0)===0?u(35,37,"components.google_calendar.add_room.equipment.label"):"")("formControl",t.servicesCtrl)("matAutocomplete",I),o(5),c("ngForOf",u(39,39,t.filteredServices)),o(3),c("ngIf",!t.isMapView),o(),c("ngIf",t.isMapView),o(2),c("isDisabled",!t.searchButtonEnabled)}},dependencies:[ce,j,R,H,ni,ae,rt,Pi,Ti,ve,We,Oi,Le,Di,fe,Go,ee,Ko,Be,ir,rn,st,pl,ml,cl,$,ws,N],styles:['.row[_ngcontent-%COMP%]{row-gap:var(--bs-gutter-x)}[_nghost-%COMP%]     .mat-form-field-appearance-outline.start .mat-form-field-outline .mat-form-field-outline-end{border-radius:0!important}[_nghost-%COMP%]     .mat-form-field-appearance-outline.middle{margin-left:-1px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.middle .mat-form-field-outline .mat-form-field-outline-start, [_nghost-%COMP%]     .mat-form-field-appearance-outline.middle .mat-form-field-outline .mat-form-field-outline-end{border-radius:0!important}[_nghost-%COMP%]     .mat-form-field-appearance-outline.end{margin-left:-1px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.end .mat-form-field-outline .mat-form-field-outline-start{border-radius:0!important}[_nghost-%COMP%]     .mat-form-field-appearance-outline .mat-form-field-suffix{top:-1em}[_nghost-%COMP%]     .mat-form-field-appearance-outline:hover, [_nghost-%COMP%]     .mat-form-field-appearance-outline.mat-focused, [_nghost-%COMP%]     .mat-form-field-appearance-outline.mat-form-field-invalid{z-index:2}[_nghost-%COMP%]     .mat-form-field-appearance-outline.search-bar{width:100%;width:fill-available;width:-webkit-fill-available;width:-moz-available;min-width:158px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.search-bar .mat-form-field-flex .mat-form-field-infix{width:auto;margin-right:20px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.capacity{width:80px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.capacity .mat-form-field-flex .mat-form-field-infix{min-width:50px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.equipment{width:190px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.equipment .mat-form-field-flex .mat-form-field-infix{min-width:166px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.equipment .mat-form-field-flex .mat-form-field-infix:after{content:"";position:absolute;right:0;top:6px;min-height:8px;width:8px;min-width:8px;background:transparent;transform:rotate(45deg);border-radius:1px;border:2px solid var(--primary-color-500);border-top:none;border-left:none}[_nghost-%COMP%]     .mat-form-field-appearance-outline.floor{width:150px}[_nghost-%COMP%]     .input-chip-list .mat-form-field-prefix{top:0}[_nghost-%COMP%]     .input-chip-list .mat-form-field-prefix app-icon{top:4px;position:relative;display:flex}[_nghost-%COMP%]     .input-chip-list .mat-form-field-prefix app-icon.selection-empty{top:-3px}[_nghost-%COMP%]     .input-chip-list .mat-standard-chip.mat-chip-with-trailing-icon{max-width:none}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix{padding:1px 0 8px;border-top:.84375em solid transparent;display:flex;width:100%;max-width:100%;min-height:45px;max-height:45px}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix .mat-chip-list-box{display:flex;max-width:calc(100% - 60px);position:relative;top:0}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix .mat-chip-list-box .mat-chip-list-box-wrapper{width:100%;align-items:flex-start;flex-wrap:nowrap;overflow:auto;max-width:100%;display:flex;flex-direction:row;margin:0 5px 0 -4px}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix .mat-chip-list-box .mat-chip-list-box-wrapper:hover::-webkit-scrollbar{height:3px}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix .mat-chip-list-box .mat-chip-list-box-wrapper::-webkit-scrollbar{-webkit-appearance:none;height:0;width:0}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix .mat-chip-list-box .mat-chip-list-box-wrapper::-webkit-scrollbar-thumb{border-radius:3px;background-color:#0006;-webkit-box-shadow:0 0 1px rgba(255,255,255,.4)}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix .mat-chip-list-box .mat-chip-list-box-wrapper .mat-chip{padding-right:4px;padding-left:8px;white-space:nowrap;color:var(--primary-color-1000);border:solid 1px var(--primary-color-500);min-height:22px;background-color:transparent;margin:0 4px}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix .mat-input-element{text-overflow:ellipsis;margin-right:12px;max-width:calc(100% - 12px)}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix .button-action{height:24px;width:24px}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix .button-action svg{width:20px;height:20px;fill:var(--primary-color-1000)}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix app-button-action{top:1px}[_nghost-%COMP%]     .input-chip-list .mat-form-field-infix .mat-chip-input{width:100%;margin:0 17px 0 0;flex:1 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;top:-1px;position:relative}@media screen and (min-width: 956px){[_nghost-%COMP%]     .mat-form-field-appearance-outline.equipment{width:250px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.equipment .mat-form-field-flex .mat-form-field-infix{min-width:226px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.floor{width:250px}}@media screen and (max-width: 623px){[_nghost-%COMP%]     .mat-form-field-appearance-outline.search-bar{min-width:100px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.equipment{min-width:120px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.equipment .mat-form-field-flex .mat-form-field-infix{min-width:none}[_nghost-%COMP%]     .mat-form-field-appearance-outline.floor{min-width:100px}}']})}}return i})();var Xi=Me(an());var Vo=function(i){return i.GOOGLE="GOOGLE",i.AZURE="AZURE",i}(Vo||{});var ra=class{constructor(r,e){this.id=r,this.name=e}};var aa=class{constructor(r,e){this.workspace=r,this.quota=e}};var sa=class{constructor(r,e,n,t,s){this.id=r,this.title=e,this.type=n,this.calendarInformation=t,this.building=s}};var Ro=class{constructor(){this.places=1,this.services=[],this.floors=[],this.search="",this.showUnbookable=!1}};var a2=function(i){return i.booking="booking",i.monthly_booking="monthly_booking",i.agenda="agenda",i.modular="modular",i.calendar="calendar",i.unbooked_presence="unbooked_presence",i}(a2||{});var cs=function(i){return i.GOOGLE="GOOGLE",i.MICROSOFT="MICROSOFT",i.EXCHANGE="EXCHANGE",i}(cs||{});var No=class{constructor(r,e){this.workspace=r,this.estimate=e}};var la=class{constructor(){this.withPaid=!1,this.withQuota=!1,this.days=[]}};function s2(i,r){i&1&&x(0,"div",3)}function l2(i,r){i&1&&(a(0,"div")(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7),x(5,"div",8),l(),a(6,"div",9),x(7,"div",10)(8,"div",11)(9,"div",12),l()()()()())}function c2(i,r){i&1&&(a(0,"div",13),x(1,"div",14),l())}var nd=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-google-calendar-extension-workspace-list-placeholder"]],inputs:{type:"type"},decls:3,vars:3,consts:[["class","animated results",4,"ngIf"],[4,"ngIf"],["class","map-container",4,"ngIf"],[1,"animated","results"],[1,"col-12","d-flex","justify-content-center","animated","card","mx-3"],[1,"row","mx-0"],[1,"col-12","d-flex","align-items-center","px-0"],[1,"col-auto","px-2"],[1,"picture"],[1,"col","ps-0"],[1,"col-12","info"],[1,"col-2","info"],[1,"col-1","info","mb-0"],[1,"map-container"],[1,"animated","map","h-100"]],template:function(n,t){n&1&&h(0,s2,1,0,"div",0)(1,l2,10,0,"div",1)(2,c2,2,0,"div",2),n&2&&(c("ngIf",t.type==="result"),o(),c("ngIf",t.type==="card"),o(),c("ngIf",t.type==="map"))},dependencies:[R],styles:[".animated[_ngcontent-%COMP%]{animation:placeHolderShimmer 2s linear infinite alternate;border-radius:3px}.results[_ngcontent-%COMP%]{width:150px;height:23px;border-radius:8px}.card[_ngcontent-%COMP%]{width:auto;height:77px;border-radius:8px}.picture[_ngcontent-%COMP%]{width:80px;height:60px;border-radius:4px;background-color:#d6d6d7}.info[_ngcontent-%COMP%]{width:auto;height:16px;border-radius:8px;margin-bottom:6px;background-color:#d6d6d7}.map-container[_ngcontent-%COMP%]{bottom:61px;width:100vw;height:78vh;left:9px}.map[_ngcontent-%COMP%]{border-radius:0}"]})}}return i})();var d2=(i,r,e,n)=>({"activated-card":i,"hover-card":r,"is-unclickable":e,"on-error":n}),m2=i=>({unbookable:i});function u2(i,r){i&1&&(a(0,"div",14),x(1,"app-tag",15),l())}function _2(i,r){i&1&&(a(0,"div",14),x(1,"app-tag",16),l())}function h2(i,r){i&1&&(a(0,"div",14),x(1,"app-tag",17),l())}function g2(i,r){i&1&&(a(0,"div",14),x(1,"app-tag",18),l())}function f2(i,r){i&1&&(a(0,"div",19),p(1,"Cette salle n'est plus disponible"),l())}var od=(()=>{class i{set updateWorkspace(e){this.workspace=e}set updateEstimate(e){this.estimate=e}set updateIsHovered(e){this.isHovered=e}set updateIsSelected(e){this.isSelected=e}set updateIsUnbookable(e){this.isUnbookable=e}constructor(e){this.api=e,this.workspace=null,this.estimate=null,this.isHovered=!1,this.isSelected=!1,this.isUnbookable=!1,this.selectedWorkspace=new L,this.hoveredWorkspace=new L,this.previewMouseLeave=new L,this.nombre=0,this.isOnError=!1}ngOnInit(){}onMouseEnter(){this.isHovered=!0,this.hoveredWorkspace.emit(this.isHovered)}onMouseLeave(){this.isHovered=!1,this.previewMouseLeave.emit(this.isHovered)}selectWorkspace(){this.isUnbookable||(this.isSelected=!this.isSelected,this.selectedWorkspace.emit(this.isSelected))}getPhoto(){return this.workspace?.photos?.length>0?this.workspace?.photos[0]:"/assets/images/moffi-workspace.png"}static{this.\u0275fac=function(n){return new(n||i)(y(F))}}static{this.\u0275cmp=P({type:i,selectors:[["app-google-calendar-extension-workspace-preview"]],inputs:{updateWorkspace:[0,"workspace","updateWorkspace"],updateEstimate:[0,"estimate","updateEstimate"],updateIsHovered:[0,"isHovered","updateIsHovered"],updateIsSelected:[0,"isSelected","updateIsSelected"],updateIsUnbookable:[0,"isUnbookable","updateIsUnbookable"]},outputs:{selectedWorkspace:"selectedWorkspace",hoveredWorkspace:"hoveredWorkspace",previewMouseLeave:"previewMouseLeave"},decls:22,vars:19,consts:[[1,"card","p-2",3,"mouseenter","mouseleave","click","id","ngClass"],[1,"card-body","p-0"],[1,"row","m-0",3,"ngClass"],[1,"w-100","p-0","d-flex","justify-content-between"],[1,"w-100","d-flex"],[1,"col-auto","px-0","me-2","workspace-image"],["alt","workspace image",1,"rounded","workspace-image-with-height",3,"src"],[1,"col","limit"],[1,"title","mat-label-large","text-nowrap","text-ellipsis"],[1,"d-flex","align-items-center"],[1,"places"],[1,"floor","text-nowrap","text-ellipsis"],["class","col-auto px-0",4,"ngIf"],["class","error-message",4,"ngIf"],[1,"col-auto","px-0"],["key","components.google_calendar.add_room.workspace.occupied","color","#dfa512"],["key","components.google_calendar.add_room.workspace.quota.badge","color","#074DCE"],["key","components.google_calendar.add_room.workspace.quota.insufficient","color","#D3153B"],["key","components.google_calendar.add_room.workspace.unavailable","color","#6d7278"],[1,"error-message"]],template:function(n,t){n&1&&(a(0,"div",0),b("mouseenter",function(){return t.onMouseEnter()})("mouseleave",function(){return t.onMouseLeave()})("click",function(){return t.selectWorkspace()}),a(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),x(6,"img",6),l(),a(7,"div",7)(8,"div",8),p(9),l(),a(10,"div",9)(11,"mat-icon"),p(12,"person"),l(),a(13,"div",10),p(14),l()(),a(15,"div",11),p(16),l()(),h(17,u2,2,0,"div",12)(18,_2,2,0,"div",12)(19,h2,2,0,"div",12)(20,g2,2,0,"div",12),l()()()()(),h(21,f2,2,0,"div",13)),n&2&&(c("id","workspace-"+(t.workspace==null?null:t.workspace.id))("ngClass",Yo(12,d2,t.isSelected&&!t.isUnbookable,t.isHovered&&!t.isUnbookable,t.isUnbookable,t.isOnError)),o(2),c("ngClass",re(17,m2,t.isUnbookable)),o(4),c("src",t.getPhoto(),K),o(3),w(t.workspace==null?null:t.workspace.title),o(5),w(t.workspace==null?null:t.workspace.place),o(2),w(t.workspace==null||t.workspace.floor==null?null:t.workspace.floor.name),o(),c("ngIf",!t.estimate.canBeBooked&&t.estimate.errorCodes.includes("OCCUPIED")),o(),c("ngIf",(t.estimate==null?null:t.estimate.quotaOnly)&&t.estimate.usableQuota),o(),c("ngIf",(t.estimate==null?null:t.estimate.quotaOnly)&&!t.estimate.usableQuota),o(),c("ngIf",!t.estimate.canBeBooked&&t.estimate.errorCodes.includes("MAX_CAPACITY")),o(),c("ngIf",t.isOnError))},dependencies:[ce,R,fr,$],styles:[".card[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.125);box-shadow:none;cursor:pointer}.hover-card[_ngcontent-%COMP%]{border:1px solid #074dce;background-color:#fff}.activated-card[_ngcontent-%COMP%]{border:2px solid #074dce;background-color:#f1f3fa;margin-bottom:-2px}.is-unclickable[_ngcontent-%COMP%]{cursor:auto}.unbookable[_ngcontent-%COMP%]{opacity:.5}.on-error[_ngcontent-%COMP%]{border-color:#d3153b}.error-message[_ngcontent-%COMP%]{color:#d3153b;font-size:12px}.title[_ngcontent-%COMP%]{margin-right:4px;max-width:100%}.limit[_ngcontent-%COMP%]{min-width:80px}.places[_ngcontent-%COMP%]{color:var(--primary-color-500);font-size:14px}.floor[_ngcontent-%COMP%]{color:var(--primary-color-1000);max-width:100%;font-size:14px;line-height:normal}.mat-icon[_ngcontent-%COMP%]{color:var(--primary-color-500);width:18px;height:18px;font-size:18px;vertical-align:middle}.toggle[_ngcontent-%COMP%]{display:flex;justify-content:end}.workspace-image[_ngcontent-%COMP%]{min-height:60px;min-width:80px;max-height:60px;max-width:80px}.workspace-image-with-height[_ngcontent-%COMP%]{height:100%;width:100%;object-fit:cover}"]})}}return i})();var rd=i=>({"is-selected":i}),b2=i=>({"row px-0 col-12":i}),C2=i=>({"col-12 col-md-6 pe-2":i}),x2=i=>({"row justify-content-between col-12 px-0":i}),y2=(i,r)=>({"col-12 col-sm-6 pe-0":i,"pe-sm-3":r}),ad=i=>[i],k2=(i,r,e,n)=>({showPopup:!1,showFloors:!1,showLegend:!1,showOutdoorLayer:!0,floors:i,floor:r,selectedPlaces:e,hoveredPlaces:n}),w2=i=>({"d-flex px-0 col-12":i}),S2=(i,r)=>({"col-6 ps-0":i,"row justify-content-between col-12 px-0":r}),M2=()=>[0,1,2,3,4,5],I2=(i,r)=>({"ps-0":i,"col-12 col-sm-6 pe-0":r});function E2(i,r){if(i&1&&(a(0,"div",7)(1,"span"),p(2),d(3,"translate"),d(4,"translate"),l()()),i&2){let e=m();o(2),Q(" ",e.bookableWorkspaces.length," ",e.bookableWorkspaces.length>1?u(3,2,"components.google_calendar.add_room.result.multiple"):u(4,4,"components.google_calendar.add_room.result.single")," ")}}function P2(i,r){i&1&&(a(0,"div",7),x(1,"app-google-calendar-extension-workspace-list-placeholder",8),l()),i&2&&(o(),c("type","result"))}function T2(i,r){if(i&1){let e=k();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"div",12),b("click",function(){f(e);let t=m();return v(t.switch("list"))}),x(4,"app-icon",13),l(),a(5,"div",14),b("click",function(){f(e);let t=m();return v(t.switch("map"))}),x(6,"app-icon",15),l()()()()}if(i&2){let e=m();o(3),c("ngClass",re(2,rd,!e.mapView)),o(2),c("ngClass",re(4,rd,e.mapView))}}function D2(i,r){i&1&&(a(0,"div",23)(1,"div",24)(2,"div",25),x(3,"img",26),a(4,"div",27),p(5),d(6,"translate"),l()()()()),i&2&&(o(5),g(" ",u(6,1,"screen.find.no_result")," "))}function O2(i,r){if(i&1&&(a(0,"div",28)(1,"div",29),x(2,"app-icon",30),a(3,"span",31),p(4),d(5,"translate"),l()()()),i&2){let e=m(2);E("mr-3",!e.mapView),o(4),w(u(5,3,"components.google_calendar.add_room.warning_banner.filters"))}}function B2(i,r){if(i&1){let e=k();a(0,"div",21)(1,"app-google-calendar-extension-workspace-preview",32),b("selectedWorkspace",function(t){let s=f(e).$implicit,_=m(2);return v(_.updateSelectedWorkspace(t,s))})("hoveredWorkspace",function(t){let s=f(e).$implicit,_=m(2);return v(_.updateHoveredWorkspace(t,s.workspace))})("previewMouseLeave",function(t){let s=f(e).$implicit,_=m(2);return v(_.updateHoveredWorkspace(t,s.workspace))}),l()()}if(i&2){let e=r.$implicit,n=r.$index,t=m(2);c("ngClass",Tn(6,y2,!t.mapView,n%2===0&&!t.mapView)),o(),c("workspace",e.workspace)("estimate",e.estimate)("isSelected",(t.selectedWorkspace==null?null:t.selectedWorkspace.workspace.id)===(e==null?null:e.workspace.id))("isHovered",(t.hoveredWorkspace==null?null:t.hoveredWorkspace.id)===(e==null?null:e.workspace.id))("isUnbookable",t.unbookableWorkspaces.includes(e))}}function A2(i,r){if(i&1){let e=k();a(0,"div",33)(1,"app-moffi-maps-view",34,0),b("markerClick",function(t){f(e);let s=m(2);return v(s.markerClick(t))})("markerHover",function(t){f(e);let s=m(2);return v(s.markerHover(t))})("markerMouseLeave",function(){f(e);let t=m(2);return v(t.markerMouseLeave())}),l()()}if(i&2){let e=m(2);o(),c("building",e.building)("options",Yo(10,k2,e.floors,e.floor,re(6,ad,e.selectedWorkspace==null||e.selectedWorkspace.workspace==null?null:e.selectedWorkspace.workspace.id),re(8,ad,e.hoveredWorkspace==null||e.hoveredWorkspace.workspace==null?null:e.hoveredWorkspace.workspace.id)))("externalLoading",e.isLoading)("availabilities",e.mapAvailabilities)("showOnlySyncedWith",e.showOnlySyncedWith)("workspaceTypes",e.workspaceTypes)}}function V2(i,r){if(i&1&&(a(0,"div",16)(1,"div",17),h(2,D2,7,3,"div",18),a(3,"div",17),h(4,O2,6,5,"div",19),a(5,"div",20),Wt(6,B2,2,9,"div",21,qt),l()(),h(8,A2,3,15,"div",22),l()()),i&2){let e=m();o(),c("ngClass",re(8,b2,e.mapView)),o(),c("ngIf",e.showNoResult()),o(),E("d-none",e.showNoResult()),c("ngClass",re(10,C2,e.mapView)),o(),c("ngIf",e.showWarningBanner),o(),c("ngClass",re(12,x2,!e.mapView)),o(),Ut(e.showUnbookable?e.allWorkspaces:e.bookableWorkspaces),o(2),c("ngIf",e.mapView)}}function R2(i,r){if(i&1&&(a(0,"div",21),x(1,"app-google-calendar-extension-workspace-list-placeholder",8),l()),i&2){let e=m(2);c("ngClass",Tn(2,I2,e.mapView,!e.mapView)),o(),c("type","card")}}function N2(i,r){i&1&&(a(0,"div",37),x(1,"app-google-calendar-extension-workspace-list-placeholder",8),l()),i&2&&(o(),c("type","map"))}function F2(i,r){if(i&1&&(a(0,"div",16)(1,"div",17)(2,"div",20),h(3,R2,2,5,"div",35),l(),h(4,N2,2,1,"div",36),l()()),i&2){let e=m();o(),c("ngClass",re(4,w2,e.mapView)),o(),c("ngClass",Tn(6,S2,e.mapView,!e.mapView)),o(),c("ngForOf",X(9,M2)),o(),c("ngIf",e.mapView)}}var ca=(()=>{class i{set bookableWorkspacesContent(e){e&&(this.bookableWorkspaces=e)}set unbookableWorkspacesContent(e){e&&(this.unbookableWorkspaces=e)}set allWorkspacesContent(e){e&&(this.allWorkspaces=e)}set mapAvailabilitiesContent(e){e&&(this.mapAvailabilities=e)}set updateFloors(e){e&&(this.floors=e)}set updateFloor(e){this.floor=e}set updateBuilding(e){e&&(this.building=e)}set moffiMapContent(e){this.map=e}constructor(){this.showUnbookable=!1,this.isLoading=!0,this.showWarningBanner=!1,this.floors=[],this.isSelected=!1,this.isUnbookable=!1,this.mapView=!1,this.availabilities=[],this.params=null,this.selectedWorkspace=null,this.hoveredWorkspace=null,this.floorAvailabilities=new L(!0),this.isMapView=new L(!0),this.selectedWorkspaceChanged=new L(!0),this.map=null,this.workspaceTypes=[sn.MEETING_ROOM],this.showOnlySyncedWith=[Vo.GOOGLE]}ngOnInit(){}updateSelectedWorkspace(e,n){if(!e){this.selectedWorkspace=null,this.selectedWorkspaceChanged.emit(null);return}this.selectWorkspace(n),this.map&&(this.floor=this.selectedWorkspace?.workspace?.floor,this.floorAvailabilities.emit(this.floor),this.map.centerOnPlace(n?.workspace?.mapInformation?.placeId,22))}updateHoveredWorkspace(e,n){this.hoveredWorkspace=e?n:null}markerClick(e){let n=this.bookableWorkspaces?.find(t=>t.workspace.id===e?.workspace?.id);this.selectWorkspace(n),document.getElementById("workspace-"+n?.workspace?.id)?.scrollIntoView({block:"center",behavior:"smooth"})}markerHover(e){let n=this.bookableWorkspaces?.find(t=>t.workspace.id===e?.workspace?.id).workspace;this.hoveredWorkspace=n}markerMouseLeave(){this.hoveredWorkspace=null}switch(e){this.mapView&&e==="map"||!this.mapView&&e==="list"||(this.mapView=!this.mapView,this.isMapView.emit(this.mapView))}showNoResult(){return this.bookableWorkspaces.length==0&&!this.showUnbookable||this.showUnbookable&&this.allWorkspaces.length==0}selectWorkspace(e){this.selectedWorkspace=e,this.selectedWorkspaceChanged.emit(e)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-google-calendar-extension-workspace-list"]],viewQuery:function(n,t){if(n&1&&A(gr,5),n&2){let s;D(s=O())&&(t.moffiMapContent=s.first)}},inputs:{bookableWorkspacesContent:[0,"bookableWorkspaces","bookableWorkspacesContent"],unbookableWorkspacesContent:[0,"unbookableWorkspaces","unbookableWorkspacesContent"],allWorkspacesContent:[0,"allWorkspaces","allWorkspacesContent"],showUnbookable:"showUnbookable",isLoading:"isLoading",showWarningBanner:"showWarningBanner",mapAvailabilitiesContent:[0,"mapAvailabilities","mapAvailabilitiesContent"],updateFloors:[0,"floors","updateFloors"],updateFloor:[0,"floor","updateFloor"],updateBuilding:[0,"building","updateBuilding"],selectedWorkspace:"selectedWorkspace"},outputs:{floorAvailabilities:"floorAvailabilities",isMapView:"isMapView",selectedWorkspaceChanged:"selectedWorkspaceChanged"},decls:8,vars:5,consts:[["map",""],[1,"row"],[1,"col-12","mb-2"],[1,"row","justify-content-between","align-items-center"],["class","col",4,"ngIf"],["class","col-auto mr-3 toggle-container",4,"ngIf"],["class","col-12 pe-0",4,"ngIf"],[1,"col"],[3,"type"],[1,"col-auto","mr-3","toggle-container"],[1,"row","justify-content-end"],["value","map",1,"d-flex"],[1,"toggle-button","list",3,"click","ngClass"],["iconName","format_list_bulleted"],[1,"toggle-button","map",3,"click","ngClass"],["iconName","map",1,"icon-map"],[1,"col-12","pe-0"],[3,"ngClass"],["class","w-100 position-relative container-no-result result",4,"ngIf"],["class","warning-banner mb-3",3,"mr-3",4,"ngIf"],[1,"scroll-workspaces",3,"ngClass"],[1,"mb-3",3,"ngClass"],["class","total-screen col-12 col-md-6 mt-4 mt-md-0 ps-3 pe-2",4,"ngIf"],[1,"w-100","position-relative","container-no-result","result"],[1,"d-flex","subcontainer-no-result"],[1,"text-center"],["src","/assets/images/no_result.svg","alt","no_result",1,"mb-2"],[1,"text-no-result","mt-2"],[1,"warning-banner","mb-3"],[1,"px-2","py-3","d-flex","justify-content-start","align-items-center","icon-div"],["iconName","info","iconColor","#043082"],[1,"ms-2"],[3,"selectedWorkspace","hoveredWorkspace","previewMouseLeave","workspace","estimate","isSelected","isHovered","isUnbookable"],[1,"total-screen","col-12","col-md-6","mt-4","mt-md-0","ps-3","pe-2"],[3,"markerClick","markerHover","markerMouseLeave","building","options","externalLoading","availabilities","showOnlySyncedWith","workspaceTypes"],["class","mb-3",3,"ngClass",4,"ngFor","ngForOf"],["class","total-screen col-md-6 mt-4 mt-md-0 px-md-0",4,"ngIf"],[1,"total-screen","col-md-6","mt-4","mt-md-0","px-md-0"]],template:function(n,t){n&1&&(a(0,"div",1)(1,"div",2)(2,"div",3),h(3,E2,5,6,"div",4)(4,P2,2,1,"div",4)(5,T2,7,6,"div",5),l()(),h(6,V2,9,14,"div",6)(7,F2,5,10,"div",6),l()),n&2&&(o(3),c("ngIf",!t.isLoading),o(),c("ngIf",t.isLoading),o(),c("ngIf",t.building==null?null:t.building.mapInformation),o(),c("ngIf",!t.isLoading),o(),c("ngIf",t.isLoading))},dependencies:[ce,j,R,ni,gr,nd,od,N],styles:[".text-no-result[_ngcontent-%COMP%]{color:var(--primary-color-500);font-size:18px}.container-no-result[_ngcontent-%COMP%]{height:calc(100vh - 286px)}.subcontainer-no-result[_ngcontent-%COMP%]{justify-content:center;align-items:center;width:100%;height:100%}.scroll-workspaces[_ngcontent-%COMP%]{max-height:calc(100vh - 271px);overflow:auto}.total-screen[_ngcontent-%COMP%]{bottom:59px;height:calc(100vh - 285px);left:9px}@media screen and (max-width: 750px){.scroll-workspaces[_ngcontent-%COMP%]{max-height:calc(100vh - 296px)}}.toggle-container[_ngcontent-%COMP%]{z-index:99999}.toggle[_ngcontent-%COMP%]{box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;border-radius:9px}[_nghost-%COMP%]     .toggle-button{display:flex;justify-content:center;align-items:center;background-color:#fff;border:solid 1px #c5cbec;height:36px;width:44px}[_nghost-%COMP%]     .toggle-button svg{fill:#7285d8;width:20px;height:20px}[_nghost-%COMP%]     .toggle-button.list{border-radius:9px 0 0 9px}[_nghost-%COMP%]     .toggle-button.map{border-radius:0 9px 9px 0}[_nghost-%COMP%]     .toggle-button.is-selected{background-color:#074dce;border:none}[_nghost-%COMP%]     .toggle-button.is-selected svg{fill:#fff}.warning-banner[_ngcontent-%COMP%]{background-color:#f1f3fa;color:#043082;font-size:14px;font-weight:400;border-radius:8px}"]})}}return i})();var q2=["filterComponent"];function W2(i,r){if(i&1&&(a(0,"mat-option",34),p(1),l()),i&2){let e=r.$implicit;c("value",e==null?null:e.id),o(),g(" ",e==null?null:e.name," ")}}function U2(i,r){i&1&&x(0,"app-google-calendar-extension-filters-placeholder")}function z2(i,r){if(i&1&&(a(0,"mat-option",34),p(1),l()),i&2){let e=r.$implicit;c("value",e==null?null:e.id),o(),g(" ",e==null?null:e.label," ")}}function j2(i,r){if(i&1&&(a(0,"div",35)(1,"div",36)(2,"p",37),p(3),d(4,"translate"),d(5,"translate"),l(),a(6,"mat-form-field",38)(7,"mat-select",16),d(8,"translate"),h(9,z2,2,2,"mat-option",17),l()()()()),i&2){let e=m();o(3),In(" ",u(4,6,"components.google_calendar.add_room.quota.debit")," ",e.utils.minutesToString(e.selectedWorkspace.estimate.minutes)," ",u(5,8,"components.google_calendar.add_room.quota.from")," "),o(4),c("formControl",e.quotaCtrl)("placeholder",u(8,10,"components.google_calendar.add_room.quota.name.placeholder")),o(2),c("ngForOf",e.selectedWorkspace==null||e.selectedWorkspace.estimate==null?null:e.selectedWorkspace.estimate.availableQuotas)}}function Q2(i,r){i&1&&(a(0,"span"),p(1),d(2,"translate"),l()),i&2&&(o(),w(u(2,1,"components.google_calendar.add_room.error.room.title")))}function H2(i,r){i&1&&(a(0,"span"),p(1),d(2,"translate"),l()),i&2&&(o(),w(u(2,1,"components.google_calendar.add_room.error.quota.title")))}function Y2(i,r){if(i&1&&(a(0,"div",39)(1,"mat-icon"),p(2,"error"),l(),h(3,Q2,3,3,"span",24)(4,H2,3,3,"span",24),l()),i&2){let e=m();o(3),c("ngIf",e.selectedWorkspace==null),o(),c("ngIf",e.isWithQuota()&&!e.quotaCtrl.valid)}}function G2(i,r){i&1&&(a(0,"span"),p(1),d(2,"translate"),l()),i&2&&(o(),w(u(2,1,"components.google_calendar.add_room.error.room.text")))}function K2(i,r){i&1&&(a(0,"span"),p(1),d(2,"translate"),l()),i&2&&(o(),w(u(2,1,"components.google_calendar.add_room.error.quota.text")))}function $2(i,r){if(i&1&&(a(0,"div",40),M(1,41),h(2,G2,3,3,"span",24)(3,K2,3,3,"span",24),S(),l()),i&2){let e=m();o(2),c("ngIf",e.selectedWorkspace==null),o(),c("ngIf",e.isWithQuota()&&!e.quotaCtrl.valid)}}var EO=(()=>{class i{set setGCWL(e){this.googleCalendarWorkspaceList=e}constructor(e,n,t,s,_){this.googleService=e,this.api=n,this.utils=t,this.configService=s,this.googleExtensionService=_,this.buildingCtrl=new Oe("",W.required),this.selectedWorkspace=null,this.workspaceFloorChanged=null,this.isMapView=!1,this.filterValues=new Ro,this.isLoadingFilters=!0,this.isLoadingWorkspaces=!0,this.isFirstBuildingChange=!0,this.availabilities=[],this.bookableWorkspaces=[],this.mapAvailabilities=[],this.unbookableWorkspaces=[],this.allWorkspaces=[],this.showWarningBanner=!1,this.routeFilters={start:null,end:null,allDay:!1,rrule:null},this.buildingWorkspacesByDeclarationType={desktop:[],meeting_room:[],cafeteria:[],parking:[]},this.withQuota=!0,this.quotaCtrl=new Oe("",[C=>this.withQuota&&!C.value?{required:!0}:null])}ngOnInit(){return z(this,null,function*(){this.api.initAuthDone||(yield us(this.api.initAuthChange).then(()=>{try{chrome.runtime.sendMessage(this.configService.config.googleCalendarExtensionId,{type:"initialised"})}catch(e){console.error(e)}})),this.buildingCtrl.valueChanges.subscribe(e=>{this.updateSelectedBuilding(e),this.updateBuildingData(),this.isMapView&&this.googleCalendarWorkspaceList?.switch("list"),this.filterValues&&(this.filterValues.floors=null),this.getWorkspaceFloor(),this.search(),!this.isFirstBuildingChange&&this.isMapView&&this.getAvailabilitiesForMap(this.workspaceFloor),this.isFirstBuildingChange=!1}),window.addEventListener("message",e=>{e.data.type==="gceData"?(this.routeFilters.start=(0,Xi.default)(e.data.start),this.routeFilters.end=(0,Xi.default)(e.data.end),this.routeFilters.allDay=e.data.allDay,this.routeFilters.rrule=e.data.rrule,this.filterValues.places=e.data.capacity,this.search()):e.data.type==="resetSelection"&&(this.selectedWorkspace=null,this.googleCalendarWorkspaceList?.switch("list"),this.filterComponent.resetFilters(),this.filterValues=new Ro,this.search())}),this.initData()})}initData(){this.googleService.googleExtensionService.initData().then(()=>{this.buildings=this.googleService.buildings,this.buildingWorkspacesByDeclarationType=this.googleService.buildingWorkspacesByDeclarationType,this.initBuildings()}).finally(()=>this.isLoadingFilters=!1)}closePopIn(){try{chrome.runtime.sendMessage(this.configService.config.googleCalendarExtensionId,{type:"close-iframe"})}catch(e){console.error(e)}}initBuildings(){if(!this.buildings||this.buildings?.length<=0){console.error("ERREUR");return}this.buildings?.length===1?this.buildingCtrl.setValue(this.buildings[0]?.id):this.api?.user?.favoriteBuilding&&this.buildings?.some(e=>e.id===this.api?.user?.favoriteBuilding?.id)?this.buildingCtrl.setValue(this.api?.user?.favoriteBuilding?.id):this.buildingCtrl.setValue(this.buildings[0]?.id),this.updateSelectedBuilding(this.buildingCtrl.value)}updateSelectedBuilding(e){this.selectedBuilding=this.buildings.find(n=>n.id===e)}updateBuildingData(){this.updateBuildingWorkspaces(),this.updateWorkspacesServices(),this.updateWorkspacesFloors()}updateBuildingWorkspaces(){let e=this.buildingWorkspacesByDeclarationType.meeting_room.find(n=>n.id===this.selectedBuilding.id);this.buildingWorkspaces=e?.workspaces.filter(n=>!n.isUnbookable)??[]}updateSelectedWorkspace(e){this.selectedWorkspace=e,e?.workspace&&(e.estimate.availableQuotas?this.quotaCtrl.setValue(e.estimate.availableQuotas[0]?.id):this.quotaCtrl.setValue(null))}updateWorkspacesServices(){let e=this.buildingWorkspacesByDeclarationType.meeting_room?.find(n=>n.id===this.selectedBuilding.id)?.services??[];this.workspacesServices=e}updateWorkspacesFloors(){let e=[],n=[];this.buildingWorkspaces.forEach(t=>{e.includes(t.floor.id)||(e.push(t.floor.id),n.push(t.floor))}),this.workspacesFloors=n.sort((t,s)=>t.level-s.level)}getWorkspaceFloor(){let e=this.filterValues?.floors;!e||e.length===0?this.workspaceFloor=this.workspacesFloors.find(n=>n.level==0)||this.workspacesFloors[0]:this.workspaceFloor=this.workspacesFloors.find(n=>e.includes(n.id))}updateWorkspaceFloor(e){e&&this.getAvailabilitiesForMap(e)}updateFilters(e){this.filterValues=e,this.search()}getFilters(){let e=new la,n=(0,Xi.default)().utc(),t=n,s=n.clone().add(1,"minute");return this.routeFilters?.start&&this.routeFilters?.end&&(t=Xi.default.tz(this.routeFilters.start,"UTC"),s=Xi.default.tz(this.routeFilters.end,"UTC")),this.routeFilters?.allDay&&(e.period="DAY"),e.start=t.format(this.utils.UTCFormat),e.end=s.format(this.utils.UTCFormat),e.days=[{startDate:e.start,endDate:e.end,date:e.start,day:t.format("YYYY-MM-DD"),period:kl[e.period]??null}],this.filterValues?.showUnbookable?(e.serviceIds=[],e.places=1,e.floorIds=[]):(e.serviceIds=this.filterValues?.services??[],e.places=this.filterValues?.places??1,e.floorIds=this.filterValues?.floors??[]),e.companyId=this.selectedBuilding.company?.id??this.api.company.id,e.buildingId=this.selectedBuilding.id,e.bookingDeclarationType="MEETING_ROOM",e.search=this.filterValues?.search,e.rrule=this.routeFilters.rrule??null,e.withPaid=!1,e.withQuota=!0,e.syncWithProviders=[cs.GOOGLE],e}getFiltersMap(e){let n=this.getFilters();this.filtersMap={buildingId:this.selectedBuilding?.id,days:n.days,endHour:Xi.default.tz(n.end,"UTC").format(this.utils.hourOnlyFormat),floor:e?.level,floorId:e?.id,isNow:!1,place:n.places,showAllStatus:!0,startHour:Xi.default.tz(n.start,"UTC").format(this.utils.hourOnlyFormat),types:["meeting_room"],workspaceTypes:[sn.MEETING_ROOM],showOnlySyncedWith:[Vo.GOOGLE]}}search(){let e=this.getFilters();this.isLoadingWorkspaces=!0,this.getWorkspaceFloor(),e.floorIds.length==1&&e.floorIds[0]!=this.selectedWorkspace?.workspace.floor.id&&(this.selectedWorkspace=null),this.api.bookingService.getPlanningBuildingBookingEstimation(e,!0).then(n=>z(this,null,function*(){if(this.estimationResults=n.workspacesEstimation,this.bookableWorkspaces=yield Promise.all(n.bookable.sort((t,s)=>t.title.localeCompare(s.title)).map(t=>z(this,null,function*(){return new No(t,this.estimationResults[t.id])}))),this.unbookableWorkspaces=n.unbookable.map(t=>new No(t,this.estimationResults[t.id])),e.places>1&&!e.search)this.bookableWorkspaces.sort((t,s)=>t.workspace.place===s.workspace.place?this.utils.normalize(t.workspace.title)?.localeCompare(this.utils.normalize(s?.workspace.title)):t.workspace.place-s.workspace.place);else{this.bookableWorkspaces.sort((s,_)=>this.utils.normalize(s.workspace.title)?.localeCompare(this.utils.normalize(_?.workspace.title)));let t=this.bookableWorkspaces.filter(s=>this.utils.normalize(s?.workspace.title)?.startsWith(this.utils.normalize(e.search)));this.bookableWorkspaces=t.concat(this.bookableWorkspaces.filter(s=>!t.includes(s)))}this.allWorkspaces=this.bookableWorkspaces.concat(this.unbookableWorkspaces),this.filtersMap=this.bookableWorkspaces,this.getAvailabilitiesForMap(this.workspaceFloor)})).finally(()=>{this.isLoadingWorkspaces=!1,this.filterValues?.showUnbookable?this.checkSuspicousWorkspaces():this.showWarningBanner=!1})}checkSuspicousWorkspaces(){this.showWarningBanner=this.allWorkspaces.some(e=>this.invalidFilters(e))}invalidFilters(e){return e.place<this.filterValues.places||(this.filterValues.floors.length>0?!this.filterValues.floors?.includes(e.floor.id):!1)||this.workspaceIdhasServices(e.id,this.filterValues.services)}workspaceIdhasServices(e,n){return!this.workspacesServices.filter(t=>n.includes(t.id)).every(t=>t.workspaceIds.includes(e))}getAvailabilitiesForMap(e){e==null||e==null||(this.getFiltersMap(e),this.api.workspaceService.getWorkspacesAvailabilitiesMap(this.filtersMap).then(n=>{this.mapAvailabilities=n}).finally(()=>{window.dispatchEvent(new Event("resize"))}))}isWithQuota(){return this.selectedWorkspace?.estimate?.quotaOnly??!1}canDeclareQuota(){return!this.isWithQuota()||this.isWithQuota()&&this.quotaCtrl?.valid}canDeclare(){return this.canDeclareQuota()&&this.buildingCtrl?.valid&&this.selectedWorkspace!=null&&this.selectedWorkspace?.estimate?.canBeBooked}saveEvent(){let e=new ra(this.selectedWorkspace?.workspace?.building?.id,this.selectedWorkspace?.workspace?.building?.name),n=new sa(this.selectedWorkspace?.workspace?.id,this.selectedWorkspace?.workspace?.title,this.selectedWorkspace?.workspace?.type,this.selectedWorkspace?.workspace?.calendarInformation,e),t=null;this.withQuota&&(t=this.selectedWorkspace.estimate.availableQuotas?.find(_=>_.id===this.quotaCtrl.value));let s=new aa(n,t);localStorage.setItem("google_user_selection",JSON.stringify(s));try{chrome.runtime.sendMessage(this.configService.config.googleCalendarExtensionId,{type:"add-room",selection:s})}catch(_){console.error(_)}}updateIsMapView(e){this.isMapView=e}getFooterButtonsClass(){return this.withQuota?"col-auto pl-0":"col"}hasError(){return this.selectedWorkspace==null||this.isWithQuota()&&!this.quotaCtrl.valid}showErrors(){this.quotaCtrl.markAsTouched()}static{this.\u0275fac=function(n){return new(n||i)(y(Ao),y(F),y(_e),y(bl),y(Ao))}}static{this.\u0275cmp=P({type:i,selectors:[["ng-component"]],viewQuery:function(n,t){if(n&1&&(A(q2,7),A(ca,5)),n&2){let s;D(s=O())&&(t.filterComponent=s.first),D(s=O())&&(t.setGCWL=s.first)}},decls:47,vars:38,consts:[["filterComponent",""],["popErrorTitle",""],["popError",""],[1,"calendar-extention-google-page"],[1,"integration-header"],[1,"row","align-items-center","justify-content-between"],[1,"col-auto"],[1,"row","align-items-center"],["width","20","height","12","viewBox","0 0 20 12","fill","none","xmlns","http://www.w3.org/2000/svg"],["id","Logo","clip-path","url(#clip0_1888_4583)"],["id","Fill-11","d","M11.2732 11.7105L11.0662 11.804C10.0548 12.2715 8.82049 11.8741 8.32677 10.9159L4.146 2.87595C3.65227 1.9177 4.07433 0.756899 5.08568 0.289461L5.29272 0.195973C6.30407 -0.271465 7.53839 0.125858 8.03212 1.08411L12.2129 9.13184C12.7146 10.0823 12.2925 11.2431 11.2732 11.7105Z","fill","#2A2E36"],["id","Fill-14","d","M18.8476 11.7107L18.6406 11.8041C17.6294 12.2714 16.3953 11.8742 15.9017 10.9163L11.7216 2.87972C11.228 1.92186 11.65 0.761537 12.6612 0.294292L12.8682 0.200842C13.8793 -0.27419 15.1134 0.122968 15.615 1.08082L19.795 9.12523C20.2887 10.0831 19.8587 11.2434 18.8476 11.7107Z","fill","#2A2E36"],["id","Fill-17","d","M3.68078 11.695L3.46995 11.7935C2.44017 12.286 1.18334 11.8674 0.680607 10.8577L0.210311 9.93019C-0.292421 8.92055 0.137333 7.69749 1.16712 7.20498L1.37794 7.10648C2.40773 6.61397 3.66456 7.0326 4.16729 8.04224L4.62948 8.9698C5.14843 9.97944 4.71057 11.2025 3.68078 11.695Z","fill","#2A2E36"],["id","clip0_1888_4583"],["width","20","height","12","fill","white"],["floatLabel","never"],[3,"formControl","placeholder"],[3,"value",4,"ngFor","ngForOf"],["type","button","mat-icon-button","",1,"d-flex",3,"click"],[1,"integration-filters","d-flex","align-items-center"],[1,"container-fluid","p-0"],[1,"row"],[1,"col-12"],[3,"filterChanged","workspaces","selectedWorkspace","services","floors","isMapView","capacity","isLoading"],[4,"ngIf"],[1,"integration-body"],[3,"isMapView","flooravailabilities","selectedWorkspaceChanged","bookableWorkspaces","unbookableWorkspaces","allWorkspaces","selectedWorkspace","mapAvailabilities","floors","floor","building","isLoading","showWarningBanner","showUnbookable"],[1,"integration-footer","d-flex","align-items-center"],["class","col-auto modal-footer-quota",4,"ngIf"],[1,"modal-footer-buttons",3,"ngClass"],[1,"w-100","d-flex","align-items-center","justify-content-end"],["textKey","global.cancel","type","TERTIARY",1,"me-2",3,"click"],["placement","top","container","modal-content","popoverClass","error-informations","triggers","mouseenter:mouseleave",1,"w-100",3,"mouseenter","ngbPopover","popoverTitle","disablePopover"],["textKey","components.google_calendar.add_room.button.main","type","PRIMARY",3,"clicked","isDisabled"],[3,"value"],[1,"col-auto","modal-footer-quota"],[1,"d-flex","align-items-center"],[1,"mb-0","me-2","text-nowrap"],["floatLabel","never",1,"quota-field"],[1,"errors-title"],[1,"text-start"],[1,"my-1"]],template:function(n,t){if(n&1){let s=k();a(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"div",6),He(),a(6,"svg",8)(7,"g",9),x(8,"path",10)(9,"path",11)(10,"path",12),l(),a(11,"defs")(12,"clipPath",13),x(13,"rect",14),l()()()(),ki(),a(14,"div",6)(15,"mat-form-field",15)(16,"mat-select",16),d(17,"translate"),h(18,W2,2,2,"mat-option",17),l()()()()(),a(19,"div",6)(20,"button",18),b("click",function(){return f(s),v(t.closePopIn())}),a(21,"mat-icon"),p(22,"close"),l()()()()(),a(23,"div",19)(24,"div",20)(25,"div",21)(26,"div",22)(27,"app-google-calendar-extension-filters",23,0),b("filterChanged",function(C){return f(s),v(t.updateFilters(C))}),l(),h(29,U2,1,0,"app-google-calendar-extension-filters-placeholder",24),l()()()(),a(30,"div",25)(31,"div",21)(32,"div",22)(33,"app-google-calendar-extension-workspace-list",26),b("isMapView",function(C){return f(s),v(t.updateIsMapView(C))})("flooravailabilities",function(C){return f(s),v(t.updateWorkspaceFloor(C))})("selectedWorkspaceChanged",function(C){return f(s),v(t.updateSelectedWorkspace(C))}),l()()()(),a(34,"div",27)(35,"div",20)(36,"div",7),h(37,j2,10,12,"div",28),a(38,"div",29)(39,"div",30)(40,"app-button",31),b("click",function(){return f(s),v(t.closePopIn())}),l(),a(41,"div",32),b("mouseenter",function(){return f(s),v(t.showErrors())}),a(42,"app-button",33),b("clicked",function(){return f(s),v(t.saveEvent())}),l()()()()()()()(),h(43,Y2,5,2,"ng-template",null,1,ne)(45,$2,4,2,"ng-template",null,2,ne)}if(n&2){let s,_=V(44),C=V(46);E("with-quota",t.withQuota),o(14),E("d-none",(t.buildings==null?null:t.buildings.length)<2),o(2),c("formControl",t.buildingCtrl)("placeholder",u(17,36,"components.google_calendar.add_room.quota.name.placeholder")),o(2),c("ngForOf",t.buildings),o(9),c("workspaces",t.buildingWorkspaces)("selectedWorkspace",t.selectedWorkspace)("services",t.workspacesServices)("floors",t.workspacesFloors)("isMapView",t.isMapView)("capacity",t.filterValues.places)("isLoading",t.isLoadingFilters),o(2),c("ngIf",t.isLoadingFilters),o(4),c("bookableWorkspaces",t.bookableWorkspaces)("unbookableWorkspaces",t.unbookableWorkspaces)("allWorkspaces",t.allWorkspaces)("selectedWorkspace",t.selectedWorkspace)("mapAvailabilities",t.mapAvailabilities)("floors",t.workspacesFloors)("floor",t.workspaceFloor)("building",t.selectedBuilding)("isLoading",t.isLoadingWorkspaces)("showWarningBanner",t.showWarningBanner)("showUnbookable",(s=t.filterValues==null?null:t.filterValues.showUnbookable)!==null&&s!==void 0?s:!1),o(3),E("justify-content-between",t.isWithQuota())("justify-content-end",!t.isWithQuota()),o(),c("ngIf",t.isWithQuota()),o(),c("ngClass",t.getFooterButtonsClass()),o(3),c("ngbPopover",C)("popoverTitle",_)("disablePopover",!t.hasError()),o(),c("isDisabled",!t.canDeclare())}},dependencies:[ce,j,R,H,ae,We,Le,Di,ee,Be,$,Et,id,Zp,ca,N],styles:['.calendar-extention-google-page[_ngcontent-%COMP%]{min-height:100vh;width:100%}.calendar-extention-google-page[_ngcontent-%COMP%]   .integration-header[_ngcontent-%COMP%]{background-color:#f1f3f4;padding:8px 16px}.calendar-extention-google-page[_ngcontent-%COMP%]   .integration-filters[_ngcontent-%COMP%]{background-color:#fff;padding:15px 24px;min-height:98px;border-bottom:1px solid #ebebeb}.calendar-extention-google-page[_ngcontent-%COMP%]   .integration-body[_ngcontent-%COMP%]{padding:15px 24px;height:calc(100vh - 210px);max-height:calc(100vh - 210px);background-color:#f8f9f9}.calendar-extention-google-page[_ngcontent-%COMP%]   .integration-footer[_ngcontent-%COMP%]{background-color:#fff;height:56px;padding:8px 16px;position:fixed;bottom:0;left:0;width:100%;border-top:1px solid #ebebeb}.calendar-extention-google-page[_ngcontent-%COMP%]   .integration-footer[_ngcontent-%COMP%]   .modal-footer-quota[_ngcontent-%COMP%]   .quota-field[_ngcontent-%COMP%]{width:100%;max-width:200px}[_nghost-%COMP%]     .mat-form-field-appearance-outline .mat-form-field-wrapper{padding-bottom:0}[_nghost-%COMP%]     .mat-form-field-appearance-outline.writting:not(.mat-form-field-should-float) .mat-form-field-label-wrapper{overflow:visible}[_nghost-%COMP%]     .mat-form-field-appearance-outline.writting:not(.mat-form-field-should-float) .mat-form-field-label-wrapper .mat-form-field-label{transform:translate(0) translateY(-29px) scale(.75)!important}[_nghost-%COMP%]     .mat-form-field-appearance-outline.writting:not(.mat-form-field-should-float) .mat-form-field-label-wrapper .mat-form-field-label.mat-form-field-empty{top:1.84375em}[_nghost-%COMP%]     .mat-form-field-appearance-outline.writting:not(.mat-form-field-should-float) .mat-form-field-label-wrapper .mat-form-field-label mat-label{background-color:#fff;padding:0 5px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.mat-form-field-should-float .mat-form-field-label-wrapper .mat-form-field-label{transform:translate(0) translateY(-29px) scale(.75)!important}[_nghost-%COMP%]     .mat-form-field-appearance-outline.mat-form-field-should-float .mat-form-field-label-wrapper .mat-form-field-label mat-label{background-color:#fff;padding:0 5px}[_nghost-%COMP%]     .mat-form-field-appearance-outline.mat-focused .mat-form-field-label-wrapper .mat-form-field-label{transform:translate(0) translateY(-29px) scale(.75)!important}[_nghost-%COMP%]     .mat-form-field-appearance-outline.mat-focused .mat-form-field-label-wrapper .mat-form-field-label mat-label{background-color:#fff;padding:0 5px}[_nghost-%COMP%]     .mat-form-field-appearance-outline .mat-form-field-label-wrapper .mat-form-field-label:not(.mat-form-field-empty){transform:translate(0) translateY(-29px) scale(.75)!important}[_nghost-%COMP%]     .mat-form-field-appearance-outline .mat-form-field-label-wrapper .mat-form-field-label:not(.mat-form-field-empty) mat-label{background-color:#fff;padding:0 5px}[_nghost-%COMP%]     .mat-form-field-appearance-outline .mat-form-field-flex .mat-form-field-infix{min-width:80px;min-height:45px;max-height:45px}[_nghost-%COMP%]     .mat-form-field-appearance-outline .mat-form-field-flex .mat-form-field-infix .mat-form-field-label-wrapper .mat-form-field-label mat-label{color:var(--primary-color-500)!important}[_nghost-%COMP%]     .mat-form-field-appearance-outline .mat-form-field-flex .mat-form-field-infix .mat-select-value .mat-select-value-text, [_nghost-%COMP%]     .mat-form-field-appearance-outline .mat-form-field-flex .mat-form-field-infix .mat-select-value .mat-select-placeholder{position:relative;top:-1px}[_nghost-%COMP%]     .mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translate(-1px,-2px)}[_nghost-%COMP%]     .mat-form-field-appearance-outline .mat-select-arrow-wrapper:after{content:"";position:absolute;right:0;top:6px;min-height:8px;width:8px;min-width:8px;background:transparent;transform:rotate(45deg);border-radius:1px;border:2px solid var(--primary-color-500);border-top:none;border-left:none}[_nghost-%COMP%]     .mat-form-field-appearance-outline .mat-select-arrow-wrapper .mat-select-arrow{display:none}@media screen and (max-width: 750px){.calendar-extention-google-page[_ngcontent-%COMP%]   .integration-body[_ngcontent-%COMP%]{height:calc(100vh - 235px)}}@media screen and (max-width: 652px){.calendar-extention-google-page.with-quota[_ngcontent-%COMP%]   .integration-body[_ngcontent-%COMP%]{height:calc(100vh - 285px)}.calendar-extention-google-page.with-quota[_ngcontent-%COMP%]   .integration-footer[_ngcontent-%COMP%]{height:106px}.calendar-extention-google-page.with-quota[_ngcontent-%COMP%]   .integration-footer[_ngcontent-%COMP%]   .col-auto.modal-footer-buttons[_ngcontent-%COMP%]{padding-top:8px;width:100%}.calendar-extention-google-page.with-quota[_ngcontent-%COMP%]   .integration-footer[_ngcontent-%COMP%]   .modal-footer-quota[_ngcontent-%COMP%]{width:100%}.calendar-extention-google-page.with-quota[_ngcontent-%COMP%]   .integration-footer[_ngcontent-%COMP%]   .modal-footer-quota[_ngcontent-%COMP%]   .quota-field[_ngcontent-%COMP%]{max-width:100%}}']})}}return i})();var r5=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[de,Ae,Re,at,Je,$t,nt,Ge,Ye,nr,Xo,Rn,rr,Ze,or,Cr,Ri]})}}return i})();var h5=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[de,Ae,Yn,ai]})}}return i})();function X2(i,r){if(i&1&&(M(0),p(1),d(2,"translate"),S()),i&2){let e=m(2);o(),g(" ",u(2,1,"components.user_declaration_process.overlapping_declaration_save"+(e.declareFor?"_declare_for":""))," ")}}function J2(i,r){if(i&1&&(M(0),p(1),d(2,"translate"),S()),i&2){let e=m(2);o(),g(" ",u(2,1,"components.user_declaration_process.overlapping_declarations_save"+(e.declareFor?"_declare_for":""))," ")}}function Z2(i,r){if(i&1&&(M(0),a(1,"div")(2,"div",1)(3,"div",2)(4,"div",3),x(5,"app-icon",4),l(),a(6,"div",5)(7,"p",6),h(8,X2,3,3,"ng-container",0)(9,J2,3,3,"ng-container",0),l()()()()(),S()),i&2){let e=m();o(),jo(e.wrapperClass),o(7),c("ngIf",(e.declarations==null?null:e.declarations.length)<=1),o(),c("ngIf",(e.declarations==null?null:e.declarations.length)>1)}}var f5=(()=>{class i{constructor(){this.wrapperClass="",this.declareFor=!1}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-warning-information"]],inputs:{wrapperClass:"wrapperClass",declarations:"declarations",declareFor:"declareFor"},decls:1,vars:1,consts:[[4,"ngIf"],[1,"container","w-100","warning-body"],[1,"row","py-2"],[1,"col-auto","d-flex","mt-icon"],["iconName","info"],[1,"col","ps-0"],[1,"m-0"]],template:function(n,t){if(n&1&&h(0,Z2,10,4,"ng-container",0),n&2){let s;c("ngIf",((s=t.declarations==null?null:t.declarations.length)!==null&&s!==void 0?s:0)>0)}},dependencies:[R,ni,N],styles:["[_nghost-%COMP%]     .warning-body{width:100%;background-color:#55585e;border-radius:5px;color:#fff}[_nghost-%COMP%]     .warning-body app-icon svg{fill:#dfa512}[_nghost-%COMP%]     .warning-body p{font-size:14px}[_nghost-%COMP%]     .warning-body .mt-icon{margin-top:2px}"]})}}return i})();var w5=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({imports:[de,Re,Ae]})}}return i})();function ek(i,r){if(i&1){let e=k();a(0,"div",1)(1,"button",2),b("click",function(){f(e);let t=m();return v(t.action())}),p(2),l()()}if(i&2){let e=m();o(2),g(" ",e.data.action," ")}}var tk=["label"];function ik(i,r){}var nk=Math.pow(2,31)-1,Fo=class{constructor(r,e){this._overlayRef=e,this._afterDismissed=new xt,this._afterOpened=new xt,this._onAction=new xt,this._dismissedByAction=!1,this.containerInstance=r,r._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(r){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(r,nk))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},sd=new it("MatSnackBarData"),mo=class{constructor(){this.politeness="assertive",this.announcementMessage="",this.duration=0,this.data=null,this.horizontalPosition="center",this.verticalPosition="bottom"}},ok=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275dir=Fe({type:i,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"],standalone:!0})}}return i})(),rk=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275dir=Fe({type:i,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"],standalone:!0})}}return i})(),ak=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275dir=Fe({type:i,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"],standalone:!0})}}return i})(),ld=(()=>{class i{constructor(e,n){this.snackBarRef=e,this.data=n}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static{this.\u0275fac=function(n){return new(n||i)(y(Fo),y(sd))}}static{this.\u0275cmp=P({type:i,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],standalone:!0,features:[Pn],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["mat-button","","matSnackBarAction","",3,"click"]],template:function(n,t){n&1&&(a(0,"div",0),p(1),l(),h(2,ek,3,1,"div",1)),n&2&&(o(),g(" ",t.data.message,`
`),o(),$e(t.hasAction?2:-1))},dependencies:[il,ok,rk,ak],styles:[".mat-mdc-simple-snack-bar{display:flex}"],encapsulation:2,changeDetection:0})}}return i})(),sk={snackBarState:_i("state",[wt("void, hidden",qe({transform:"scale(0.8)",opacity:0})),wt("visible",qe({transform:"scale(1)",opacity:1})),bt("* => visible",vt("150ms cubic-bezier(0, 0, 0.2, 1)")),bt("* => void, * => hidden",vt("75ms cubic-bezier(0.4, 0.0, 1, 1)",qe({opacity:0})))])},lk=0,ck=(()=>{class i extends Zs{constructor(e,n,t,s,_){super(),this._ngZone=e,this._elementRef=n,this._changeDetectorRef=t,this._platform=s,this.snackBarConfig=_,this._document=di(va),this._trackedModals=new Set,this._announceDelay=150,this._destroyed=!1,this._onAnnounce=new xt,this._onExit=new xt,this._onEnter=new xt,this._animationState="void",this._liveElementId=`mat-snack-bar-container-live-${lk++}`,this.attachDomPortal=C=>{this._assertNotAttached();let I=this._portalOutlet.attachDomPortal(C);return this._afterPortalAttached(),I},_.politeness==="assertive"&&!_.announcementMessage?this._live="assertive":_.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(e){this._assertNotAttached();let n=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),n}attachTemplatePortal(e){this._assertNotAttached();let n=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),n}onAnimationEnd(e){let{fromState:n,toState:t}=e;if((t==="void"&&n!=="void"||t==="hidden")&&this._completeExit(),t==="visible"){let s=this._onEnter;this._ngZone.run(()=>{s.next(),s.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId)}),this._onExit}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let e=this._elementRef.nativeElement,n=this.snackBarConfig.panelClass;n&&(Array.isArray(n)?n.forEach(_=>e.classList.add(_)):e.classList.add(n)),this._exposeToModals();let t=this._label.nativeElement,s="mdc-snackbar__label";t.classList.toggle(s,!t.querySelector(`.${s}`))}_exposeToModals(){let e=this._liveElementId,n=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let t=0;t<n.length;t++){let s=n[t],_=s.getAttribute("aria-owns");this._trackedModals.add(s),_?_.indexOf(e)===-1&&s.setAttribute("aria-owns",_+" "+e):s.setAttribute("aria-owns",e)}}_clearFromModals(){this._trackedModals.forEach(e=>{let n=e.getAttribute("aria-owns");if(n){let t=n.replace(this._liveElementId,"").trim();t.length>0?e.setAttribute("aria-owns",t):e.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{let e=this._elementRef.nativeElement.querySelector("[aria-hidden]"),n=this._elementRef.nativeElement.querySelector("[aria-live]");if(e&&n){let t=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&e.contains(document.activeElement)&&(t=document.activeElement),e.removeAttribute("aria-hidden"),n.appendChild(e),t?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static{this.\u0275fac=function(n){return new(n||i)(y(Sn),y(Bt),y(Se),y(Mi),y(mo))}}static{this.\u0275cmp=P({type:i,selectors:[["mat-snack-bar-container"]],viewQuery:function(n,t){if(n&1&&(A(ya,7),A(tk,7)),n&2){let s;D(s=O())&&(t._portalOutlet=s.first),D(s=O())&&(t._label=s.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:1,hostBindings:function(n,t){n&1&&ga("@state.done",function(_){return t.onAnimationEnd(_)}),n&2&&ha("@state",t._animationState)},standalone:!0,features:[Lt,Pn],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(n,t){n&1&&(a(0,"div",1)(1,"div",2,0)(3,"div",3),h(4,ik,0,0,"ng-template",4),l(),x(5,"div"),l()()),n&2&&(o(5),yt("aria-live",t._live)("role",t._role)("id",t._liveElementId))},dependencies:[ya],styles:[".mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}.cdk-high-contrast-active .mat-mdc-snackbar-surface{outline:solid 1px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mdc-snackbar-supporting-text-color, var(--mat-app-inverse-on-surface));border-radius:var(--mdc-snackbar-container-shape, var(--mat-app-corner-extra-small));background-color:var(--mdc-snackbar-container-color, var(--mat-app-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mdc-snackbar-supporting-text-font, var(--mat-app-body-medium-font));font-size:var(--mdc-snackbar-supporting-text-size, var(--mat-app-body-medium-size));font-weight:var(--mdc-snackbar-supporting-text-weight, var(--mat-app-body-medium-weight));line-height:var(--mdc-snackbar-supporting-text-line-height, var(--mat-app-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){color:var(--mat-snack-bar-button-color, var(--mat-app-inverse-primary));--mat-text-button-state-layer-color:currentColor;--mat-text-button-ripple-color:currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}"],encapsulation:2,data:{animation:[sk.snackBarState]}})}}return i})();function pk(){return new mo}var dk=new it("mat-snack-bar-default-options",{providedIn:"root",factory:pk}),mk=(()=>{class i{get _openedSnackBarRef(){let e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(e,n,t,s,_,C){this._overlay=e,this._live=n,this._injector=t,this._breakpointObserver=s,this._parentSnackBar=_,this._defaultConfig=C,this._snackBarRefAtThisLevel=null,this.simpleSnackBarComponent=ld,this.snackBarContainerComponent=ck,this.handsetCssClass="mat-mdc-snack-bar-handset"}openFromComponent(e,n){return this._attach(e,n)}openFromTemplate(e,n){return this._attach(e,n)}open(e,n="",t){let s=ot(ot({},this._defaultConfig),t);return s.data={message:e,action:n},s.announcementMessage===e&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,n){let t=n&&n.viewContainerRef&&n.viewContainerRef.injector,s=wi.create({parent:t||this._injector,providers:[{provide:mo,useValue:n}]}),_=new Jo(this.snackBarContainerComponent,n.viewContainerRef,s),C=e.attach(_);return C.instance.snackBarConfig=n,C.instance}_attach(e,n){let t=ot(ot(ot({},new mo),this._defaultConfig),n),s=this._createOverlay(t),_=this._attachSnackBarContainer(s,t),C=new Fo(_,s);if(e instanceof zo){let I=new xa(e,null,{$implicit:t.data,snackBarRef:C});C.instance=_.attachTemplatePortal(I)}else{let I=this._createInjector(t,C),B=new Jo(e,void 0,I),Y=_.attachComponentPortal(B);C.instance=Y.instance}return this._breakpointObserver.observe(Ws.HandsetPortrait).pipe(hs(s.detachments())).subscribe(I=>{s.overlayElement.classList.toggle(this.handsetCssClass,I.matches)}),t.announcementMessage&&_._onAnnounce.subscribe(()=>{this._live.announce(t.announcementMessage,t.politeness)}),this._animateSnackBar(C,t),this._openedSnackBarRef=C,this._openedSnackBarRef}_animateSnackBar(e,n){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),n.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter(),n.duration&&n.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(n.duration))}_createOverlay(e){let n=new ka;n.direction=e.direction;let t=this._overlay.position().global(),s=e.direction==="rtl",_=e.horizontalPosition==="left"||e.horizontalPosition==="start"&&!s||e.horizontalPosition==="end"&&s,C=!_&&e.horizontalPosition!=="center";return _?t.left("0"):C?t.right("0"):t.centerHorizontally(),e.verticalPosition==="top"?t.top("0"):t.bottom("0"),n.positionStrategy=t,this._overlay.create(n)}_createInjector(e,n){let t=e&&e.viewContainerRef&&e.viewContainerRef.injector;return wi.create({parent:t||this._injector,providers:[{provide:Fo,useValue:n},{provide:sd,useValue:e.data}]})}static{this.\u0275fac=function(n){return new(n||i)(ke(er),ke(zs),ke(wi),ke(qs),ke(i,12),ke(dk))}}static{this.\u0275prov=Ke({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var G5=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Z({type:i})}static{this.\u0275inj=J({providers:[mk],imports:[tr,Zo,nt,on,ld,on]})}}return i})();var Z5=(()=>{class i{constructor(e,n,t,s,_){this.api=e,this.modalService=n,this.router=t,this.translate=s,this.dialogService=_}canActivate(e,n){if(this.api.isAuthenticated())return this.api.company?this.api.buildingService.getBuildings().then(t=>{if(t==null||t.length===0){let s=this.dialogService.open(Ia,{width:"800px",data:{close:()=>{s.close()}}});return!1}return!0}):(this.router.navigate([this.translate.get("pages.user.company.metadata.url")]),Promise.reject(!1));{let t=this.modalService.open(hr,{size:"lg",scrollable:!0,centered:!0});return t.componentInstance.isLogin=!1,t.componentInstance.onSuccess=()=>{t.close()},t.componentInstance.onClose=()=>{t.close()},t.result.then(()=>{if(!this.api.company)return this.router.navigate([this.translate.get("pages.user.company.metadata.url")]),!1;this.api.buildingService.getBuildings().then(s=>{if(s==null||s.length===0){let _=this.dialogService.open(Ia,{width:"800px",data:{close:()=>{_.close()}}});return!1}return!0})})}}static{this.\u0275fac=function(n){return new(n||i)(ke(F),ke(Ue),ke(mt),ke(U),ke(Nn))}}static{this.\u0275prov=Ke({token:i,factory:i.\u0275fac})}}return i})();export{mk as a,G5 as b,jl as c,xr as d,Vo as e,a2 as f,la as g,EO as h,ap as i,ip as j,sp as k,op as l,lp as m,cp as n,pp as o,Yl as p,so as q,fo as r,Hl as s,Ql as t,Zk as u,Y1 as v,Zr as w,Pr as x,rw as y,Tr as z,M3 as A,P3 as B,L3 as C,mp as D,fp as E,je as F,Hr as G,EI as H,yp as I,Rp as J,CP as K,zp as L,qP as M,jp as N,Qp as O,ls as P,VD as Q,Z5 as R,r5 as S,h5 as T,f5 as U,w5 as V};
