PageSourceSearch

https://app.waitwhile.com/chunk-O6AFMBTI.js

js waitwhile.com collected 2026-09-24 08:48:41 UTC 417,204 bytes, 54 lines download raw bytes

1import{$a as mt,$b as up,$c as Ia,A as zi,Aa as Hc,Ad as Pp,B as Bi,Bc as _p,Bd as Dp,C as ht,Cd as Gp,Dd as kp,E as Ze,G as Ao,H as pi,I as pt,Ic as Sp,J as Pc,Jc as Tp,K as yr,Kc as ya,La as qc,Lc as xo,Ma as jc,Na as Kc,Oa as Yc,Pa as Qc,Pb as sp,Q as Dc,Qa as Jc,Qb as lp,Ra as Zc,Rc as gp,Sa as fa,Sb as un,Sc as Vi,Sd as Wp,Ta as Or,Tb as mn,Td as mi,Ua as Ca,Ub as dn,Ud as zp,Va as ha,Vb as cp,Vd as Bp,W as Ui,Wb as _n,Wc as Ep,Wd as Po,Xc as fp,Ya as ep,Yc as Sn,Zb as pp,Zc as Cp,_a as $o,_c as hp,a as el,aa as Gc,ab as dt,ad as wp,ba as kc,bb as tp,c as tl,ca as Wc,cb as Lo,ce as Ar,d as Cr,da as Ir,db as vo,ea as ui,fa as zc,fb as Fo,g as Rc,ga as Bc,gb as ip,ge as Up,h as Ac,ha as Mr,hb as op,he as Vp,ia as br,ib as np,ie as $r,ja as Nr,jd as yp,je as Do,kd as Ip,ke as Lr,la as ga,ld as Mp,mb as ap,mc as wa,md as bp,n as hr,nb as rp,nc as mp,nd as Np,o as wr,od as Op,oe as Xp,p as $c,pa as Uc,pd as Rp,pe as Hp,q as Lc,qa as Vc,qd as Ap,r as vc,ra as Xc,rd as $p,sd as Ma,t as Ta,td as Lp,u as Bt,ud as Ci,vc as dp,vd as vp,w as Oo,wd as Fp,x as Fc,xa as Ea,xd as Rr,xe as qp,y as Ro,ye as H,z as xc,zd as xp}from"./chunk-6QDVQ5WV.js";import{$a as w,$c as Yo,$d as Pn,$e as It,$l as Fl,$o as Kl,$u as yc,A as bi,Aa as Ns,Ac as Dt,Ah as Zi,An as Yn,Ay as _a,B as De,Ba as O,Bb as Oi,Bc as Yi,Bg as nl,Bn as He,Bp as si,Bq as _r,Bu as Cc,By as Sa,Ca as $,Cc as ne,Cl as go,Cn as Ae,Cp as zt,Cu as hc,D as Tt,Db as At,De as To,Dl as Li,Dm as Wt,Eb as Ki,Ec as $n,Ed as Q,Em as Ct,Eo as ql,Fc as Ln,Fl as ve,Fn as nn,Fo as jl,Fu as wc,Gc as As,Gd as Bs,Ge as qs,Gm as Gl,Gu as Te,H as Es,Ha as E,Hc as X,Hd as Ri,Hl as Et,Hn as an,Ia as Rt,Ib as S,Ic as Va,Ih as Lt,Is as ia,Ja as f,Jb as T,Jc as $s,Jh as zn,Jk as Ml,Jn as fo,Js as to,Jw as Vm,K as fs,Ka as xt,Kd as Qi,Ke as js,Kk as ar,Kl as vi,Kn as Co,Ko as Qn,Ks as oa,Kw as ua,L as Cs,La as je,Lc as Ls,Ll as Eo,Lm as kl,Lp as ec,M as Re,Ma as ce,Mb as me,Mc as mo,Ml as Rl,Mp as tc,Mq as Sr,Ms as na,Mv as Mc,N as U,Na as pe,Nc as vs,Nn as ho,Np as rn,Nq as Tr,Nv as ca,Nw as Mo,O as z,Oa as m,On as wo,Oq as lc,Os as mc,Ov as Bm,Ow as bo,P as hs,Pa as l,Pc as Ve,Pj as ul,Po as xi,Pq as cc,Pv as bc,Qa as r,Qc as _o,Qj as ml,Qo as Pi,Qp as zm,Qv as Nc,Ra as g,Rd as ja,Re as Ks,Rj as dl,Ro as Di,Rv as Oc,S as Ko,Sb as Pt,Sc as ni,Sd as Us,Se as Ji,Si as Jo,Sj as _l,Sl as Se,Sn as we,Ss as aa,Sv as Um,Ti as Zo,Tn as Xl,To as rr,Ts as ra,Ue as Ys,Ul as Al,Un as Hl,Uo as sr,Up as xe,Uv as pa,V as Ge,Va as co,Vb as Os,Vf as Gn,Vl as $l,Vo as lr,Vp as yo,Vt as Ue,W as ws,Wa as po,Wb as L,Wd as Vs,We as Ka,Wm as Xn,Wo as cr,Ws as ln,Wv as cn,X as ys,Xa as te,Xd as xn,Xl as Ll,Xo as pr,Xt as Ec,Ya as V,Yj as Sl,Yk as bl,Yl as vl,Ym as Wl,Yo as ur,Ys as gr,Yt as Gi,Yw as ma,Z as c,Za as tt,Zc as Fs,Zo as Mt,Zt as v,_a as it,_c as $t,_l as ft,_s as Er,aa as ji,ac as Le,ad as xs,ag as Zs,am as kt,ap as Yl,aq as ic,b as Ts,bb as Ht,bd as vn,bk as Tl,bp as Ql,bq as dr,bt as sa,bv as Wi,c as Ot,ca as D,cb as qt,cd as Xa,ck as gl,cm as ke,cn as at,cq as Zn,ct as Ft,cu as Ei,d as Rn,da as G,dd as Ps,df as Qs,dk as El,dm as We,dq as ea,dt as li,dv as Me,e as An,ea as Ni,eb as N,ed as Ds,ei as Ai,ek as fl,eq as oc,et as dc,ev as le,fb as d,fj as rl,fk as ir,fl as Nl,fm as Xe,fq as nc,ga as ei,gj as Bn,gk as or,gl as q,gn as Hn,gq as ac,gv as ct,hd as Gs,he as nt,hf as Js,hi as Za,hk as nr,hl as Ie,hu as la,i as Y,ii as er,ik as Cl,in as ri,is as pc,it as _c,ja as Is,jb as ti,jk as hl,jm as Un,jn as zl,jw as pn,jx as da,k as b,ka as Ms,kb as ii,kj as sl,km as xl,kq as M,l as p,la as j,lb as oi,lk as wl,ln as qn,ls as uc,lt as fr,m as A,md as Fn,me as So,mk as en,mm as Pl,mn as Bl,nd as se,ng as il,nj as tr,nl as _,nm as Dl,np as Jl,nr as sn,nu as fc,o as gs,oa as lo,ob as ie,oc as Rs,od as Ha,oj as ll,on as Fi,ot as Sc,pe as Xs,pg as Ya,pm as Je,pr as eo,qb as gi,qd as Gt,qh as al,qj as cl,qp as Jn,qt as Tc,rc as re,rd as ks,rh as Qa,rm as ze,rq as rc,rt as gc,sa as s,se as Qo,sh as Ja,sl as ai,sm as on,st as jt,t as Zt,tb as k,tc as oe,td as qa,tg as kn,tj as pl,tk as yl,tl as $i,tm as Vn,tu as ki,ty as No,ub as fe,uc as yt,ud as Ws,uk as Il,ul as Ol,um as Fe,uu as ci,uy as $e,v as Ee,vb as Ke,vc as F,vk as vt,vl as lt,vu as Io,vy as fi,wd as Be,wg as ol,wk as tn,wn as Ul,xb as Ye,xc as uo,xd as zs,xg as gt,xh as Wn,xn as Vl,xp as Zl,ya as I,yb as ot,yc as C,yn as jn,yp as bt,yv as Ic,za as bs,zb as _e,ze as Hs,zf as Dn,zl as ut,zn as Kn,zp as mr,zq as sc,zs as ta}from"./chunk-6VDOBKBI.js";import"./chunk-UNNH6OJB.js";import{a as y,b as W,c as Xt,f as so,h as R}from"./chunk-HE2D45TV.js";var jp=[0,1800,2700,3600,7200,10800,14400,18e3,21600,25200,28800,43200,86400],Kp={0:$localize`Dynamically based on wait time`,1800:$localize`30 min before booking`,2700:$localize`45 min before booking`,3600:$localize`1 hour before booking`,7200:$localize`2 hours before booking`,10800:$localize`3 hours before booking`,14400:$localize`4 hours before booking`,18e3:$localize`5 hours before booking`,21600:$localize`6 hours before booking`,25200:$localize`7 hours before booking`,28800:$localize`8 hours before booking`,43200:$localize`12 hours before booking`,86400:$localize`1 day before booking`},Yp="automationId";var ba=(()=>{class t extends pi{constructor(){super(...arguments),this.coreLocationRx=c($e),this.updateLocationWrite=c(Te)}createActions(e){return{activate:{api:()=>R(this,null,function*(){yield this.setActive(e,!0)}),label:$localize`Activate`,icon:"bx-show",enabledConfig:{permissions:["locations.update"]}},deactivate:{api:()=>R(this,null,function*(){yield this.setActive(e,!1)}),label:$localize`Deactivate`,icon:"bx-hide",enabledConfig:{permissions:["locations.update"]}},delete:{api:()=>R(this,null,function*(){yield this.delete(e)}
1),label:$localize`Delete`,icon:"bx-trash",color:"warning",enabledConfig:{permissions:["locations.update"]}}}}setActive(e,i){return R(this,null,function*(){let o=yield b(this.coreLocationRx.currentLocationSnapshot$);if(!o)return;let n=(o.visitRules??[]).map(u=>u.id===e?W(y({},u),{isActive:i}):u);yield this.updateLocationWrite.call({locationId:o.id,updates:{visitRules:n}})})}delete(e){return R(this,null,function*(){let i=yield b(this.coreLocationRx.currentLocationSnapshot$);if(!i)return;let o=(i.visitRules??[]).filter(n=>n.id!==e);yield this.updateLocationWrite.call({locationId:i.id,updates:{visitRules:o}})})}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Xm=ai(Ie),Qp=(()=>{class t extends Xm{constructor(){super(...arguments),this.locationRx=c(v),this.settingsVisitAutomationsActions=c(ba),this._entityApi=e=>this.locationRx.getCurrentLocationProperty("visitRules").pipe(p(i=>i?.find(o=>o.id===e)??null)),this.actions$=this._entity$.pipe(U(e=>e?this.settingsVisitAutomationsActions.getActions(e.id,{omit:e.isActive?["activate"]:["deactivate"]}):Y([])))}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-visit-automations-actions"]],hostAttrs:[1,"ww-settings-visit-automations-actions"],inputs:{disableEntityUpdates:"disableEntityUpdates",entity:"entity",entityId:"entityId"},features:[O],decls:2,vars:4,consts:[[3,"actions","label"]],template:function(i,o){i&1&&(g(0,"ww-model-action-menu",0),S(1,"async")),i&2&&m("actions",T(1,2,o.actions$))("label",o._latestEntity==null?null:o._latestEntity.name)},dependencies:[Ao,Ze,M,L],encapsulation:2,changeDetection:0})}}return t})();var Jp={AFTER:$localize`Perform the action after the trigger`,BEFORE:$localize`Perform the action before the trigger`,NONE:$localize`Perform the action when the automation triggers`},Zp={BOOKING_DAY_END:$localize`Visit booking day ends`,BOOKING_DAY_START:$localize`Visit booking day starts`,BOOKING_END:$localize`Visit booking ends`,BOOKING_START:$localize`Visit booking starts`,CUSTOM:$localize`Custom`,VISIT_ALERTED:$localize`Visit alerted`,VISIT_CANCELLED:$localize`Visit cancelled`,VISIT_COMPLETED:$localize`Visit completed`,VISIT_NO_SHOWED:$localize`Visit no-showed`,VISIT_SERVED:$localize`Visit served`},vr=Be()(["NONE","AFTER","BEFORE"]);var eu=Be()(["BOOKING_DAY_END","BOOKING_DAY_START","BOOKING_END","BOOKING_START","VISIT_ALERTED","VISIT_CANCELLED","VISIT_COMPLETED","VISIT_NO_SHOWED","VISIT_SERVED","CUSTOM"]),Fr={BOOKING_DAY_END:"BOOKING_DAY_END",BOOKING_DAY_START:"BOOKING_DAY_START",BOOKING_END:"BOOKING_END",BOOKING_START:"BOOKING_START",CUSTOM:"NONE",VISIT_ALERTED:"NONE",VISIT_CANCELLED:"NONE",VISIT_COMPLETED:"NONE",VISIT_NO_SHOWED:"NONE",VISIT_SERVED:"NONE"},tu=10,Na={BOOKING_DAY_END:null,BOOKING_DAY_START:null,BOOKING_END:null,BOOKING_START:null,CUSTOM:null,VISIT_ALERTED:{before:[{type:"ATTRIBUTE",attribute:"tags",operator:"NOT_CONTAINS",value:[eo.ALERTED]}],after:[{type:"ATTRIBUTE",attribute:"tags",operator:"NOT_CONTAINS",value:[eo.ALERTED]}]},VISIT_CANCELLED:{before:[{type:"ATTRIBUTE",attribute:"tags",operator:"NOT_CONTAINS",value:[eo.CANCELLED]}],after:[{type:"ATTRIBUTE",attribute:"tags",operator:"NOT_CONTAINS",value:[eo.CANCELLED]}]},VISIT_COMPLETED:{before:[{type:"ATTRIBUTE",attribute:"state",operator:"==",value:[sn.COMPLETE]}],after:[{type:"ATTRIBUTE",attribute:"state",operator:"!=",value:[sn.COMPLETE]}]},VISIT_NO_SHOWED:{before:[{type:"ATTRIBUTE",attribute:"tags",operator:"NOT_CONTAINS",value:[eo["NO-SHOW"]]}],after:[{type:"ATTRIBUTE",attribute:"tags",operator:"NOT_CONTAINS",value:[eo["NO-SHOW"]]}]},VISIT_SERVED:{before:[{type:"ATTRIBUTE",attribute:"state",operator:"==",value:[sn.SERVING]}],after:[{type:"ATTRIBUTE",attribute:"state",operator:"!=",value:[sn.SERVING]}]}};function qm(t,a){if(t&1&&(co(0),g(1,"ww-settings-visit-automations-actions",18),S(2,"async"),po()),t&2){let e=d();s(),m("entityId",T(2,1,e.id$))}}function jm(t,a){t&1&&g(0,"ww-visit-condition-group-form",19)(1,"ww-visit-condition-group-form",20),t&2&&(m("formControlName","whenBefore")("layout","vertical"),s(),m("formControlName","whenAfter")("layout","vertical"))}function Km(t,a){t&1&&g(0,"ww-duration-picker",17),t&2&&m("layout","vertical")("formControlName","timeOffset")}var ou=(()=>{class t extends q{constructor(){super(),this.actions=c(ba),this.updateLocationWrite=c(Te),this.coreLocationRx=c($e),this.layout=c(le),this.pendingChangesStore=c(ct),this.router=c(Ve),this.formId="settings-visit-automations-editor-form",this.formGroup=new F({actionData:new C(null,{validators:[re.required]}),description:new C(null,{validators:[re.maxLength(500),re.required]}),name:new C(null,{validators:[re.maxLength(100),re.required]}),timeOffsetType:new C("NONE",{nonNullable:!0}),trigger:new C("VISIT_SERVED",{nonNullable:!0,validators:[re.required]}),timeOffset:new C(0,{nonNullable:!0}),whenAfter:new C(null),whenBefore:new C(null),where:new C(null)}),this.triggers=eu,this.actionRequired=this.formGroup.controls.actionData.hasValidator(re.required),this.triggerRequired=this.formGroup.controls.trigger.hasValidator(re.required),this.pluckOffsetTimeLabel=e=>Jp[e],this.pluckTriggerLabel=e=>Zp[e],this.timeOffsetTypes$=Q(this.formGroup.controls.trigger).pipe(p(e=>this.getAnchor(e)==="NONE"?vr.filter(o=>o!=="BEFORE"):vr)),this.id$=Ri().pipe(p(e=>e[Yp]||null),De(1)),this.rule$=this.id$.pipe(U(e=>e?this.coreLocationRx.currentLocationSnapshot$.pipe(p(i=>i?.visitRules?.find(o=>o.id===e)??null)):Y(null)),this.shareReplay()),this.ruleDeleted$=this.id$.pipe(U(e=>e?this.coreLocationRx.getCurrentNullableLocation(["visitRules"]).pipe(p(i=>i?.visitRules?.find(o=>o.id===e)??null)):Y(null)),Re(null),Es(),Ee(([e,i])=>!!e&&!i)),this.layout.setFeatureContext({name:$localize`New custom automation`,parentPath:"/settings/automation",pendingChanges:{enabledConfig:{permissions:["locations.update"]},formId:this.formId,reset:()=>R(this,null,function*(){let e=yield b(this.rule$);this.reset(e)}),save:()=>this.save(),store:this.pendingChangesStore}}),this.subscribe()}reset(e){this.formGroup.reset({actionData:e?.action?.data??null,description:e?.description??null,name:e?.name??null,timeOffset:e?.action.timeOffset,timeOffsetType:this.getTimeOffsetType(e?.action?.timeOffset),trigger:this.getTrigger(e??void 0),whenAfter:e?.when?.after??null,whenBefore:e?.when?.before??null,where:e?.where??null},{emitEvent:!1}
1),this.formGroup.markAsPristine(),this.formGroup.updateValueAndValidity()}save(){return R(this,null,function*(){if(this.formGroup.invalid)return;let e=yield b(this.coreLocationRx.currentLocationSnapshot$);if(!e)return;let i=yield b(this.id$),o=this.formGroup.getRawValue(),n=e.visitRules??[],u=o.actionData??{},h=this.getAnchor(o.trigger),x={id:i??crypto.randomUUID(),name:o.name??"",description:o.description??"",isActive:!0,when:{before:this.getBefore(o.whenBefore,o.trigger),after:this.getAfter(o.whenAfter,o.trigger)},where:o.where??{},action:{type:"VISIT_UPDATE",anchor:h,data:u,timeOffset:this.getTimeOffset(h,o.timeOffset,u.state)}},P=i?n.map(K=>K.id===i?x:K):[...n,x];yield this.updateLocationWrite.call({locationId:e.id,updates:{visitRules:P}}),this.router.navigate(["/settings/automation"])})}getTimeOffset(e,i,o){return e==="NONE"?o?tu:0:i??0}getTimeOffsetType(e){return e?e>0?"AFTER":"BEFORE":"NONE"}getTrigger(e){if(e?.action.anchor&&e.action.anchor!=="NONE"){for(let[i,o]of Object.entries(Fr))if(o===e.action.anchor)return i}if(e?.when){for(let[i,o]of Ys(Na))if(o&&Qi(o.before,e.when.before)&&Qi(o.after,e.when.after))return i;if(e.when.before||e.when.after)return"CUSTOM"}return"VISIT_SERVED"}getAnchor(e){return Fr[e]??"NONE"}getAfter(e,i){let o={};if(i==="CUSTOM")return e??o;let n=Na;return i&&n[i]?n[i].after??o:o}getBefore(e,i){let o={};if(i==="CUSTOM")return e??o;let n=Na;return i&&n[i]?n[i].before??o:o}subscribe(){this.rule$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{this.reset(e),this.layout.updateFeatureContext({name:e?.name?$localize`Edit automation ${e.name}`:$localize`New automation`})}),this.ruleDeleted$.pipe(z(this.ngOnDestroy$)).subscribe(()=>{this.router.navigate(["/settings/automation"])})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-visit-automations-editor"]],hostAttrs:[1,"ww-settings-visit-automations-editor"],features:[O],decls:31,vars:24,consts:()=>{let e;e=$localize`Name`;let i;i=$localize`Add a name for this automation.`;let o;o=$localize`Description`;let n;n=$localize`Add a description for this automation.`;let u;u=$localize`Select when`;let h;h=$localize`Time offset`;let x;x=$localize`Trigger`;let P;P=$localize` Define when the automation should trigger. `;let K;K=$localize`Conditions`;let de;de=$localize` Conditions that must be met for the automation to trigger and for its action to happen. `;let Ce;Ce=$localize`Action`;let ue;ue=$localize` Select how the visit should update when this automation triggers. The action can happen directly, or at a specified time offset. `;let ge;ge=$localize`Before`;let rt;rt=$localize`Conditions that must be met before the visit has been updated.`;let st;st=$localize`After`;let et;return et=$localize`Conditions that must be met after the visit has been updated.`,[x,P,K,de,Ce,ue,[4,"wwLayoutPrimaryAction"],[3,"wwForm","formGroup","wwTrackPendingChanges","wwTrackPendingChangesUntil"],["label",e,"sublabel",i,3,"formControlName"],["label",o,"sublabel",n,3,"formControlName"],[3,"required"],[1,"flex","flex-col","gap-4","w-full"],["placeholder",u,1,"min-w-0","flex-1",3,"layout","data","pluckLabel","formControlName"],[3,"formControlName","layout"],[1,"flex","flex-col","gap-4"],[3,"layout","formControlName"],["label",h,3,"layout","data","pluckLabel","formControlName"],["label","Time offset duration",3,"layout","formControlName"],[3,"entityId"],["label",ge,"sublabel",rt,3,"formControlName","layout"],["label",st,"sublabel",et,3,"formControlName","layout"]]},template:function(i,o){i&1&&($(0,qm,3,3,"ng-container",6),l(1,"form",7),g(2,"ww-input",8)(3,"ww-textarea",9),l(4,"ww-label-layout")(5,"ww-label",10)(6,"span"),w(7,0),r(),l(8,"ww-sublabel"),w(9,1),r()(),l(10,"div",11),g(11,"ww-select",12),E(12,jm,2,4),r()(),l(13,"ww-label-layout")(14,"ww-label")(15,"span"),w(16,2),r(),l(17,"ww-sublabel"),w(18,3),r()(),g(19,"ww-visit-condition-group-form",13),r(),l(20,"ww-label-layout")(21,"ww-label",10)(22,"span"),w(23,4),r(),l(24,"ww-sublabel"),w(25,5),r()(),l(26,"div",14),g(27,"ww-visit-action-data-form",15)(28,"ww-select",16),S(29,"async"),E(30,Km,1,2,"ww-duration-picker",17),r()()()),i&2&&(s(),m("wwForm",o.formId)("formGroup",o.formGroup)("wwTrackPendingChanges",o.formGroup)("wwTrackPendingChangesUntil",o.updateLocationWrite.response$),s(),m("formControlName","name"),s(),m("formControlName","description"),s(2),m("required",o.triggerRequired),s(6),m("layout","vertical")("data",o.triggers)("pluckLabel",o.pluckTriggerLabel)("formControlName","trigger"),s(),f(o.formGroup.controls.trigger.value==="CUSTOM"?12:-1),s(7),m("formControlName","where")("layout","vertical"),s(2),m("required",o.actionRequired),s(6),m("layout","vertical")("formControlName","actionData"),s(),m("layout","vertical")("data",T(29,22,o.timeOffsetTypes$))("pluckLabel",o.pluckOffsetTimeLabel)("formControlName","timeOffsetType"),s(2),f(o.formGroup.controls.timeOffsetType.value!=="NONE"?30:-1))},dependencies:[Le,X,Dt,oe,yt,Ln,$n,H,Vc,pt,ap,Qp,M,Mt,kt,We,ke,Xe,Fe,we,qn,Tp,L],encapsulation:2,changeDetection:0})}}return t})();var Ym=t=>({automationId:t}),Qm=(t,a)=>a.visitRule.id;
1function Jm(t,a){if(t&1&&(l(0,"ww-setting-card-subtitle"),k(1),r()),t&2){let e=d().$implicit;s(),Ke(" ",e.visitRule.description," ")}}function Zm(t,a){t&1&&(l(0,"span"),w(1,2),r())}function ed(t,a){t&1&&(l(0,"span",11),w(1,3),r()),t&2&&m("wwColor","darkerGrey")}function td(t,a){if(t&1&&(l(0,"a",9)(1,"ww-setting-card")(2,"ww-setting-card-header")(3,"ww-setting-card-title"),k(4),r(),E(5,Jm,2,1,"ww-setting-card-subtitle"),l(6,"ww-setting-card-suffix",10),N("click",function(i){return i.stopPropagation()}),E(7,Zm,2,0,"span")(8,ed,2,1,"span",11),g(9,"ww-icon",12),r()()()()),t&2){let e=a.$implicit;m("routerLink","/settings/automation/editor")("queryParams",Ki(6,Ym,e.visitRule.id)),s(4),fe(e.visitRule.name),s(),f(e.visitRule.description?5:-1),s(2),f(e.visitRule.isActive?7:8),s(2),m("icon","bx-chevron-right")}}function id(t,a){if(t&1&&(l(0,"ww-setting-card",4)(1,"ww-setting-card-header",5)(2,"ww-setting-card-prefix"),g(3,"ww-icon",6),r(),l(4,"ww-setting-card-title",7),w(5,0),r(),l(6,"ww-setting-card-subtitle",8),w(7,1),r()(),l(8,"ww-setting-card-content"),ce(9,td,10,8,"a",9,Qm),r()()),t&2){let e=d();s(3),m("icon","bx-chip")("size","x-large"),s(6),pe(e)}}function od(t,a){t&1&&E(0,id,11,2,"ww-setting-card",4),t&2&&f(a.length?0:-1)}var nu=(()=>{class t extends q{constructor(){super(...arguments),this.coreLocationRx=c($e),this.commonDisplay=c(ht),this.items$=this.coreLocationRx.getCurrentNullableLocation(["visitRules"]).pipe(p(e=>e?.visitRules?e.visitRules.map(i=>({visitRule:i,badge:this.commonDisplay.displayActiveBadge(i.isActive,"")})):[]))}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-visit-automations"]],hostAttrs:[1,"ww-settings-visit-automations"],features:[O],decls:2,vars:3,consts:()=>{let e;e=$localize` Custom Automations `;let i;i=$localize` Create custom automation rules for visits. `;let o;o=$localize`On`;let n;return n=$localize`Off`,[e,i,o,n,[1,"!p-0"],[1,"!p-6"],[3,"icon","size"],["wwTypography","h4"],["wwTypography","body1"],[1,"text-start",3,"routerLink","queryParams"],["wwTypography","body2",3,"click"],[3,"wwColor"],[3,"icon"]]},template:function(i,o){if(i&1&&(E(0,od,1,1),S(1,"async")),i&2){let n;f((n=T(1,1,o.items$))?0:-1,n)}},dependencies:[_o,H,Rp,Ip,yp,Mp,bp,Np,Op,M,Je,ze,Wt,L],encapsulation:2,changeDetection:0})}}return t})();var Oa=Be()(["==",">",">=","<","<=","!=","exists","notExists"]),Ra={"==":$localize`Equals`,">":$localize`Greater than`,">=":$localize`Greater than or equal to`,"<":$localize`Less than`,"<=":$localize`Less than or equal to`,"!=":$localize`Other than`,exists:$localize`Exists`,notExists:$localize`Does not exist`},io=["==","!=",">",">=","<","<=","exists","notExists"],au=["==","!=","exists","notExists"],xr="fields.",En=[{key:"name",locationKey:"showName",label:$localize`Name`,operators:["==","!=","exists","notExists"]},{key:"customerId",locationKey:"showCustomerId",label:$localize`Customer ID`,operators:io},{key:"phone",locationKey:"showPhone",label:$localize`Phone`,operators:io},{key:"email",locationKey:"showEmail",label:$localize`Email`,operators:["==","!=","exists","notExists"]},{key:"partySize",locationKey:"showPartySize",label:$localize`Party size`,operators:io},{key:"quotedWaitDuration",locationKey:"showQuote",label:$localize`Quoted wait`,operators:io},{key:"notes",locationKey:"showNotes",label:$localize`Notes`,operators:["==","!=","exists","notExists"]},{key:"resourceIds",locationKey:"showResources",label:$localize`Resource`,operators:["==","!="]},{key:"serviceIds",locationKey:"showServices",label:$localize`Service`,operators:["==","!="]}];function ad(t,a){if(t&1&&(g(0,"ww-resource-select",3),S(1,"async")),t&2){let e=d();m("wwFormFieldSize",T(1,3,e.formFieldSize$))("layout","vertical")("formControl",e.valueFormControl)}}function rd(t,a){if(t&1&&(g(0,"ww-service-select",4),S(1,"async")),t&2){let e=d();m("wwFormFieldSize",T(1,3,e.formFieldSize$))("layout","vertical")("formControl",e.valueFormControl)}}function sd(t,a){if(t&1&&(g(0,"ww-input",5),S(1,"async")),t&2){let e=d();m("wwFormFieldSize",T(1,3,e.formFieldSize$))("layout","vertical")("formControl",e.valueFormControl)}}var ld=lt(Ie),su=(()=>{class t extends ld{constructor(){super(...arguments),this.changeDetectorRef=c(Pt),this.dataFieldRx=c(la),this.locationRx=c(v),this.formFieldGroupSize=null,this.formFieldGroupSize$=this.observe("formFieldGroupSize"),this.formFieldSize=null,this.formFieldSize$=this.observe("formFieldSize"),this.attributeFormControl=new C(null),this.operatorFormControl=new C(null),this.valueFormControl=new C(null),this.baseFields$=this.locationRx.getCurrentLocation([]).pipe(p(e=>{let i=e,o=[];for(let n of En)i[n.locationKey]===!0&&o.push(n);return o}
1)),this.dataFields$=this.dataFieldRx.dataFields$.pipe(De(1)).pipe(p(e=>e.filter(ta).filter(i=>i.isActive&&i.isActiveWaitlist).map(i=>W(y({},i),{key:`${xr}${i.id}`,label:i.name})))),this.attributes$=A([this.baseFields$,this.dataFields$]).pipe(p(([e,i])=>[...e,...i])),this.keys$=this.attributes$.pipe(p(e=>e.map(i=>i.key))),this.pluckAttributeLabel$=this.attributes$.pipe(p(e=>i=>{let o=e.find(n=>n.key===i);return o?o.label:i})),this.attribute$=Q(this.attributeFormControl),this.operators$=A([this.baseFields$,this.dataFields$,this.attribute$]).pipe(p(([e,i,o])=>{let n=e.find(h=>h.key===o);if(n)return n.operators;let u=i.find(h=>`${xr}${h.id}`===o);return u?u.inputType==="CHECKBOX"?au:io:io})),this.pluckOperatorLabel=e=>Ra[e],this.operator$=Q(this.operatorFormControl),this.value$=Q(this.valueFormControl),this.showResourcePicker$=this.attribute$.pipe(p(e=>!!e&&e==="resourceIds")),this.showServicePicker$=this.attribute$.pipe(p(e=>!!e&&e==="serviceIds")),this.showValue$=this.operator$.pipe(p(e=>e!=="exists"&&e!=="notExists")),this.viewValue$=A([this.attribute$,this.operator$,this.value$]).pipe(bi(0),p(([e,i,o])=>{if(!e||!i)return null;let n=i;return i==="exists"?n="!=":i==="notExists"&&(n="=="),{tag:Zi,attribute:e,operator:n,value:i==="exists"||i==="notExists"?null:o}}))}parseRule(e){return R(this,null,function*(){if(!e||e.tag!==Zi||!e.attribute||e.attribute.length===0||!e.operator||e.operator.length===0){this.attributeFormControl.setValue(null),this.operatorFormControl.setValue(null),this.valueFormControl.setValue(null);return}let i=e.attribute,o=e.operator,n=e.value;if(o==="!="&&n===null?this.operatorFormControl.setValue("exists"):o==="=="&&n===null?this.operatorFormControl.setValue("notExists"):this.operatorFormControl.setValue(o),(yield b(this.baseFields$)).find(K=>K.key===i)){this.attributeFormControl.setValue(i),this.valueFormControl.setValue(n);return}(yield b(this.dataFields$)).find(K=>K.key===i)&&(this.attributeFormControl.setValue(i),this.valueFormControl.setValue(n))})}writeValue(e){return R(this,null,function*(){yield this.parseRule(e),this.changeDetectorRef.markForCheck()})}registerOnChange(e){this.viewValue$.pipe(Ee(se),z(this.ngOnDestroy$)).subscribe(e)}registerOnTouched(){}setDisabledState(e){e?(this.attributeFormControl.disable({emitEvent:!1}),this.operatorFormControl.disable({emitEvent:!1}),this.valueFormControl.disable({emitEvent:!1})):(this.attributeFormControl.enable({emitEvent:!1}),this.operatorFormControl.enable({emitEvent:!1}),this.valueFormControl.enable({emitEvent:!1}))}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-visit-tag-rule"]],hostAttrs:[1,"ww-settings-visit-tag-rule","flex","flex-col","gap-4","min-w-0","max-w-full"],inputs:{hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoFocus:"autoFocus",formFieldGroupSize:"formFieldGroupSize",formFieldSize:"formFieldSize"},features:[Oi([{provide:Rs,useExisting:t,multi:!0}]),O],decls:15,vars:30,consts:()=>{let e;e=$localize`Field name`;let i;i=$localize`Filter type`;let o;return o=$localize`Filter value`,[[3,"wwFormFieldSize"],["selection","single","placeholder",e,3,"wwFormFieldSize","layout","formControl","data","pluckLabel"],["placeholder",i,3,"wwFormFieldSize","layout","data","formControl","pluckLabel"],["selection","single",3,"wwFormFieldSize","layout","formControl"],["selection","single","type","children",3,"wwFormFieldSize","layout","formControl"],["type","text","placeholder",o,3,"wwFormFieldSize","layout","formControl"]]},template:function(i,o){i&1&&(l(0,"ww-form-field-group",0),S(1,"async"),g(2,"ww-select",1),S(3,"async"),S(4,"async"),S(5,"async"),g(6,"ww-select",2),S(7,"async"),S(8,"async"),E(9,ad,2,5,"ww-resource-select",3),S(10,"async"),S(11,"async"),S(12,"async"),Rt(13,rd,2,5,"ww-service-select",4)(14,sd,2,5,"ww-input",5),r()),i&2&&(m("wwFormFieldSize",T(1,12,o.formFieldGroupSize$)),s(2),m("wwFormFieldSize",T(3,14,o.formFieldSize$))("layout","vertical")("formControl",o.attributeFormControl)("data",T(4,16,o.keys$))("pluckLabel",T(5,18,o.pluckAttributeLabel$)),s(4),m("wwFormFieldSize",T(7,20,o.formFieldSize$))("layout","vertical")("data",T(8,22,o.operators$))("formControl",o.operatorFormControl)("pluckLabel",o.pluckOperatorLabel),s(3),f(T(10,24,o.showResourcePicker$)?9:T(11,26,o.showServicePicker$)?13:T(12,28,o.showValue$)?14:-1))},dependencies:[M,Ll,ft,Fe,we,X,oe,ne,mp,wa,ip,Fo,L],encapsulation:2,changeDetection:0})}}return t})();function _C(t){return Oa.includes(t)}function cd(t,a){t&1&&te(0)}function pd(t,a){if(t&1&&(l(0,"ww-label",2),S(1,"async"),$(2,cd,1,0,"ng-container",6),r()),t&2){let e=d();m("required",T(1,2,e._hasRequiredValidator$)),s(2),m("wwOutlet",e.label)}}function ud(t,a){t&1&&(l(0,"div"),k(1,"OR"),r())}function md(t,a){if(t&1){let e=V();l(0,"div",7),g(1,"ww-settings-visit-tag-rule",8),S(2,"async"),S(3,"async"),l(4,"button",9),N("click",function(){let o=D(e).$implicit,n=d();return G(n.removeFormControl(o))}),g(5,"ww-icon",10),r()(),E(6,ud,2,0,"div")}if(t&2){let e=a.$implicit,i=a.$index,o=a.$count,n=d();s(),m("formFieldGroupSize",T(2,4,n.formFieldGroupSize$))("formFieldSize",T(3,6,n.formFieldSize$))("formControl",e),s(5),f(i!==o-1?6:-1)}}var dd=vi(lt(Ie)),lu=(()=>{class t extends dd{constructor(){super(...arguments),this.breakpoints=c($i),this.changeDetectorRef=c(Pt),this.dataFieldRx=c(la),this.locationRx=c(v),this.baseFields$=this.locationRx.getCurrentLocation(En.map(e=>e.locationKey)).pipe(p(e=>En.filter(i=>e[i.locationKey]===!0))),this.baseFieldKeys$=this.baseFields$.pipe(p(e=>e.map(i=>i.key))),this.dataFields$=this.dataFieldRx.dataFields$.pipe(De(1)).pipe(p(e=>e.filter(ta).filter(i=>i.isActive&&i.isActiveWaitlist))),this.dataFieldKeys$=this.dataFields$.pipe(p(e=>e.map(i=>`field.${i.id}`))),this.fields$=A([this.baseFieldKeys$,this.dataFieldKeys$]).pipe(p(([e,i])=>[...e,...i])),this.pluckFieldLabel$=A([this.baseFields$,this.dataFields$]).pipe(p(([e,i])=>o=>{let n=e.find(h=>h.key===o);if(n)return n.label;let u=i.find(h=>`field.${h.id}`===o);return u?u.name:o})),this.operators=Oa,this.pluckOperatorLabel=e=>Ra[e],this.formArray=new Yi([]),this.viewValue$=this.formArray.valueChanges.pipe(Ee(()=>this.formArray.dirty),p(e=>nt(e).map(({attribute:i,operator:o,value:n})=>({tag:Zi,attribute:i,operator:o,value:n})))),this.formFieldSize$=this.breakpoints.isBelowLarge$.pipe(p(e=>e?"full":"medium")),this.formFieldGroupSize$=this.breakpoints.isBelowLarge$.pipe(p(e=>e?"large":"auto")),this.disableAddButton$=this.formArray.valueChanges.pipe(p(e=>e.length>=3)),this.addButtonTooltip$=this.disableAddButton$.pipe(p(e=>e?$localize`You can only add 3 rules`:$localize`Add a rule`))}writeValue(e){return R(this,null,function*(){this.formArray.clear();for(let i of nt(e))i.tag===Zi&&this.formArray.push(new C(i,{nonNullable:!0}));this.changeDetectorRef.markForCheck()})}registerOnChange(e){this.viewValue$.pipe(z(this.ngOnDestroy$)).subscribe(e)}registerOnTouched(){}setDisabledState(e){e?this.formArray.disable():this.formArray.enable()}removeFormControl(e){let i=this.formArray.controls.findIndex(o=>o===e);i>=0&&(this.formArray.removeAt(i),this.formArray.markAsDirty()),this.formArray.updateV
1alueAndValidity()}addFormControl(e){e.preventDefault(),this.formArray.push(new C({tag:Zi,attribute:"",operator:"==",value:""},{nonNullable:!0})),this.formArray.updateValueAndValidity()}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-visit-tag-rules"]],hostAttrs:[1,"ww-settings-visit-tag-rules","flex","flex-col","gap-4"],inputs:{hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoFocus:"autoFocus"},features:[O],decls:12,vars:7,consts:()=>{let e;e=$localize`Add rule`;let i;return i=$localize`Add rule`,[i,[1,"flex","flex-col","gap-2"],[3,"required"],[1,"flex","flex-col","items-start","gap-4","min-w-0","max-w-full"],["wwButton","tertiary","aria-label",e,3,"click","wwTooltip","disabled"],["icon","bx-plus"],[4,"wwOutlet"],[1,"flex","flex-row","large:items-center","items-start","min-w-0","max-w-full"],[3,"formFieldGroupSize","formFieldSize","formControl"],["wwButton","tertiary",3,"click"],["icon","bx-x"]]},template:function(i,o){i&1&&(l(0,"div",1)(1,"ww-label-layout"),E(2,pd,3,4,"ww-label",2),l(3,"div",3),ce(4,md,7,8,null,null,je),l(6,"button",4),S(7,"async"),S(8,"async"),N("click",function(u){return o.addFormControl(u)}),g(9,"ww-icon",5),l(10,"span"),w(11,0),r()()()()()),i&2&&(s(2),f(o.label?2:-1),s(2),pe(o.formArray.controls),s(2),m("wwTooltip",T(7,3,o.addButtonTooltip$))("disabled",T(8,5,o.disableAddButton$)))},dependencies:[M,Se,We,ke,ze,ve,Ct,X,oe,ne,su,L],encapsulation:2,changeDetection:0})}}return t})();function _d(t,a){t&1&&(tt(0,0,2),te(1),it())}function Sd(t,a){if(t&1&&(tt(0,0,1),$(1,_d,2,0,"ng-container",3),it()),t&2){let e=d(2);s(),m("wwOutlet",e.label)}}function Td(t,a){if(t&1){let e=V();l(0,"button",2),N("click",function(){let o=D(e);return G(o())}),tt(1,0),E(2,Sd,2,1,"ng-container"),it(),r()}if(t&2){let e=d();s(2),f(e.label?2:-1)}}var qC=(()=>{class t extends q{constructor(){super(...arguments),this.api$=this.observe("api"),this.label=null}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-api-button"]],hostAttrs:[1,"ww-settings-api-button"],inputs:{api:"api",label:"label"},features:[O],decls:2,vars:3,consts:()=>{let e;return e=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD*1:2\uFFFD\uFFFD#1:2\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:2\uFFFD\uFFFD/*1:2\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:`,[e,["wwButton","secondary","type","button"],["wwButton","secondary","type","button",3,"click"],[4,"wwOutlet"]]},template:function(i,o){if(i&1&&(E(0,Td,3,1,"button",1),S(1,"async")),i&2){let n;f((n=T(1,1,o.api$))?0:-1,n)}},dependencies:[M,Se,ve,L],encapsulation:2,changeDetection:0})}}return t})();var Aa=(()=>{class t{constructor(){this.intercom=c(Wi)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-contact-button"]],hostAttrs:[1,"ww-settings-contact-button"],decls:2,vars:0,consts:()=>{let e;return e=$localize` Contact us
2`,[e,["wwButton","secondary","type","button",3,"click"]]},template:function(i,o){i&1&&(l(0,"button",1),N("click",function(){return o.intercom.show()}),w(1,0),r())},dependencies:[M,Se],encapsulation:2,changeDetection:0})}}return t})();var cu=$localize`Coordinates for your location are shared between the public pages location directory and geofencing features for the waitlist and bookings.`;function gd(t,a){t&1&&te(0)}function Ed(t,a){t&1&&te(0)}function fd(t,a){if(t&1&&(l(0,"ww-sublabel"),$(1,Ed,1,0,"ng-container",6),r()),t&2){let e=d(2);s(),m("wwOutlet",e.sublabel)}}function Cd(t,a){if(t&1&&(l(0,"ww-label",1),S(1,"async"),$(2,gd,1,0,"ng-container",6),E(3,fd,2,1,"ww-sublabel"),r()),t&2){let e=d();m("required",T(1,3,e._hasRequiredValidator$)),s(2),m("wwOutlet",e.label),s(),f(e.sublabel?3:-1)}}function hd(t,a){t&1&&te(0)}function wd(t,a){t&1&&(l(0,"ww-form-field-suffix"),$(1,hd,1,0,"ng-container",6),r()),t&2&&(s(),m("wwOutlet",a))}var yd=vi(lt(Ie)),pu=(()=>{class t extends yd{constructor(){super(...arguments),this.appearance=Al,this.suffixComponent=null,this.suffixComponent$=this.observe("suffixComponent"),this.formGroup=new F({lat:new C(null),lng:new C(null)}),this.viewValue$=A([Q(this.formGroup.controls.lat),Q(this.formGroup.controls.lng)]).pipe(Ee(()=>this.formGroup.dirty),p(([e,i])=>!e&&e!==0||!i&&i!==0?null:{lat:e,lng:i}))}writeValue(e){return R(this,null,function*(){this.formGroup.controls.lat.setValue(e?.lat??null),this.formGroup.controls.lng.setValue(e?.lng??null)})}registerOnChange(e){this.viewValue$.pipe(z(this.ngOnDestroy$)).subscribe(e)}registerOnTouched(){}setDisabledState(e){e?this.formGroup.disable():this.formGroup.enable()}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-coordinates"]],hostAttrs:[1,"ww-settings-coordinates"],inputs:{hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoF
2ocus:"autoFocus",size:"size",appearance:"appearance",readonly:"readonly",layout:"layout",suffixComponent:"suffixComponent"},features:[O],decls:8,vars:10,consts:()=>{let e;e=$localize`Latitude`;let i;return i=$localize`Longitude`,[[3,"layout"],[3,"required"],[1,"flex","flex-col","gap-3",3,"wwFormFieldSize"],[1,"flex","flex-row","gap-2","max-w-full"],["type","number","label",e,3,"layout","formControl"],["type","number","label",i,3,"layout","formControl"],[4,"wwOutlet"]]},template:function(i,o){if(i&1&&(l(0,"ww-label-layout",0),E(1,Cd,4,5,"ww-label",1),l(2,"div",2)(3,"div",3),g(4,"ww-input",4)(5,"ww-input",5),r(),E(6,wd,2,1,"ww-form-field-suffix"),S(7,"async"),r()()),i&2){let n;m("layout",o.layout),s(),f(o.label?1:-1),s(),m("wwFormFieldSize",o.size),s(2),m("layout","vertical")("formControl",o.formGroup.controls.lat),s(),m("layout","vertical")("formControl",o.formGroup.controls.lng),s(),f((n=T(7,8,o.suffixComponent$))?6:-1,n)}},dependencies:[As,oe,X,ne,H,M,Fl,ft,We,ke,Xe,Fe,ve,L],styles:[`.ww-joi-form-group .ww-settings-coordinates>.ww-label-layout>.ww-label{display:none}.ww-settings-coordinates .ww-form-field-suffix{max-width:100%;height:auto}
3/*noopsettings-coordinates.component-BWK5EDOC.css.map */
4`],encapsulation:2,changeDetection:0})}}return t})();var fn=(()=>{class t{constructor(){this.link=null}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-copy-link-button"]],hostAttrs:[1,"ww-settings-copy-link-button"],inputs:{link:"link"},decls:1,vars:7,consts:[[3,"click","snackbarMessage","buttonSize","icon","iconSize","buttonType","buttonText","content"]],template:function(i,o){i&1&&(l(0,"ww-copy-to-clipboard-button",0),N("click",function(u){return u.stopPropagation(),u.preventDefault()}),r()),i&2&&m("snackbarMessage","Copied to clipboard")("buttonSize","small")("icon","bx-link")("iconSize","small")("buttonType","secondary")("buttonText","Copy link")("content",o.link)},dependencies:[M,up,pp],styles:[`.ww-settings-copy-link-button .ww-copy-to-clipboard-button .ww-button-small{font-family:var(--ww-typography-caption1-font-family);font-size:var(--ww-typography-caption1-font-size);font-weight:var(--ww-typography-caption1-font-weight);line-height:var(--ww-typography-caption1-line-height);letter-spacing:var(--ww-typography-caption1-letter-spacing);height:24px;min-height:24px;border-radius:4px}.ww-settings-copy-link-button .ww-copy-to-clipboard-button .ww-button-small .ww-icon{--ww-icon-size: 16px}
5/*noopsettings-copy-link-button.component-YLFGRZCH.css.map */
6`],encapsulation:2,changeDetection:0})}}return t})();var uu=[0,600,900,1200,1500,1800,2400,3e3,3600,7200,10800,14400,18e3,21600,25200,28800,32400,36e3,86400,172800,259200,345600,432e3,518400,604800,2592e3,5184e3,7776e3,15552e3],mu={0:$localize`Never`,600:$localize`10 minutes`,900:$localize`15 minutes`,1200:$localize`20 minutes`,1500:$localize`25 minutes`,1800:$localize`30 minutes`,2400:$localize`40 minutes`,3e3:$localize`50 minutes`,3600:$localize`1 hour`,7200:$localize`2 hours`,10800:$localize`3 hours`,14400:$localize`4 hours`,18e3:$localize`5 hours`,21600:$localize`6 hours`,25200:$localize`7 hours`,28800:$localize`8 hours`,32400:$localize`9 hours`,36e3:$localize`10 hours`,86400:$localize`1 day`,172800:$localize`2 days`,259200:$localize`3 days`,345600:$localize`4 days`,432e3:$localize`5 days`,518400:$localize`6 days`,604800:$localize`7 days`,2592e3:$localize`1 month`,5184e3:$localize`2 months`,7776e3:$localize`3 months`,15552e3:$localize`6 months`},du=["cancelled","completed","noShowed"],_u="completed",Su={cancelled:$localize`Cancelled`,completed:$localize`Completed`,noShowed:$localize`No-Showed`},Tu=!0;var Md=lt(Ie),$a=(()=>{class t extends Md{constructor(){super(...arguments),this.changeDetectorRef=c(Pt),this.readonly=!1,this.type=null,this.type$=this.observe("type"),this.durationFormControl=new C(604800),this.stateFormControl=new C(_u),this.suppressFormControl=new C(Tu),this.durations=uu,this.states=du,this.pluckDurationLabel=e=>mu[e],this.pluckStateLabel=e=>Su[e],this.rulesSub=new Ot(null),this.ruleValue$=A([Q(this.durationFormControl),Q(this.stateFormControl),Q(this.suppressFormControl)]).pipe(p(([e,i,o])=>{let n=[];return i==="completed"&&n.push(Wn),i==="cancelled"&&n.push(Ja,Wn),i==="noShowed"&&n.push(Qa,Wn),{duration:e??0,suppressMessages:o??!1,state:al,tags:n}})),this.viewValue$=A([this.type$,this.ruleValue$]).pipe(Ee(()=>this.durationFormControl.dirty||this.stateFormControl.dirty||this.suppressFormControl.dirty),p(([e,i])=>e?W(y({},this.rulesSub.value),{[e]:i}):this.rulesSub.value??{}))}writeValue(e){return R(this,null,function*(){if(this.rulesSub.next(e),this.type&&e){let i=e[this.type];i&&(this.durationFormControl.setValue(i.duration),i.tags?.includes(Ja)?this.stateFormControl.setValue("cancelled"):i.tags?.includes(Qa)?this.stateFormControl.setValue("noShowed"):this.stateFormControl.setValue("completed"),this.suppressFormControl.setValue(i.suppressMessages??!1),this.changeDetectorRef.markForCheck())}})}registerOnChange(e){this.viewValue$.pipe(z(this.ngOnDestroy$)).subscribe(e)}registerOnTouched(){}setDisabledState(e){e?(this.durationFormControl.disable(),this.stateFormControl.disable(),this.suppressFormControl.disable()):(this.durationFormControl.enable(),this.stateFormControl.enable(),this.suppressFormControl.enable())}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-expiry-rules"]],hostAttrs:[1,"ww-settings-expiry-rules"],inputs:{hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoF
6ocus:"autoFocus",readonly:"readonly",layout:"layout",type:"type"},features:[O],decls:10,vars:8,consts:()=>{let e;e=$localize`Remove visits after`;let i;i=$localize`Set the time period after which visits are automatically removed.`;let o;o=$localize`Set removed visits as`;let n;n=$localize`Choose how visits are categorized once they are removed.`;let u;u=$localize`Suppress alerts`;let h;h=$localize`Suppress alerts when auto-removing visits`;let x;return x=$localize` This won't send any messages to the customer when they are auto removed. `,[h,x,[1,"flex","flex-col","gap-4"],["label",e,"sublabel",i,3,"data","pluckLabel","formControl"],["label",o,"sublabel",n,3,"data","pluckLabel","formControl"],["label",u,3,"formControl","layout"]]},template:function(i,o){i&1&&(l(0,"div",2),g(1,"ww-select",3)(2,"ww-select",4),l(3,"ww-label-layout")(4,"ww-label")(5,"span"),w(6,0),r(),l(7,"ww-sublabel"),w(8,1),r()(),g(9,"ww-checkbox",5),r()()),i&2&&(s(),m("data",o.durations)("pluckLabel",o.pluckDurationLabel)("formControl",o.durationFormControl),s(),m("data",o.states)("pluckLabel",o.pluckStateLabel)("formControl",o.stateFormControl),s(7),m("formControl",o.suppressFormControl)("layout","vertical"))},dependencies:[X,oe,ne,M,at,We,ke,Xe,we],encapsulation:2,changeDetection:0})}}return t})();var bd=()=>["/settings/localization/languages"];function Nd(t,a){if(t&1&&(l(0,"button",4),g(1,"ww-icon",5),l(2,"span"),k(3),S(4,"async"),r(),g(5,"ww-icon",6),r()),t&2){let e=d();s(3),fe(T(4,1,e.localeName$))}}function Od(t,a){t&1&&(l(0,"a",7),g(1,"ww-icon",8),l(2,"span",9),w(3,2),r()()),t&2&&m("routerLink",At(1,bd))}var Rd=Eo(Ie),r0=(()=>{class t extends Rd{constructor(){super(...arguments),this.locationRx=c(v),this.locales$=this.locationRx.getCurrentLocation(["publicLocales"]).pipe(p(e=>So(e.publicLocales.map(i=>$t(i)?.code).filter(se)))),this.localeName$=this._value$.pipe(p(e=>Gt(e)?this.pluckLocaleLabel(e):"")),this.pluckLocaleLabel=e=>{let i=$t(e);return i?`${i.languageName} (${i.code})`:`${Fs.languageName}`},this.pluckLocaleSearchLabel=e=>{let i=$t(e);return i?`${i.code} ${i.languageName} ${i.countryName} ${i.languageNativeName} ${i.countryNativeName}`:""}}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-locale-selector"]],hostAttrs:[1,"ww-settings-locale-selector"],features:[O],decls:6,vars:8,consts:()=>{let e;return e=$localize`Add language...`,[["publicLocaleTrigger",""],["addLocaleTmpl",""],e,[3,"formControl","data","pluckLabel","pluckSearchLabel","triggerComponent","listSuffixComponent"],["type","button","wwButton","secondary"],["icon","bx-globe"],["icon","bx-chevron-down"],["wwButton","tertiary",3,"routerLink"],["icon","bx-plus"],["wwTypography","body1"]]},template:function(i,o){if(i&1&&($(0,Nd,6,3,"ng-template",null,0,me)(2,Od,4,2,"ng-template",null,1,me),g(4,"ww-select",3),S(5,"async")),i&2){let n=ie(1),u=ie(3);s(4),m("formControl",o._formControl)("data",T(5,6,o.locales$))("pluckLabel",o.pluckLocaleLabel)("pluckSearchLabel",o.pluckLocaleSearchLabel)("triggerComponent",n)("listSuffixComponent",u)}},dependencies:[Le,X,oe,ne,ni,_o,H,M,Se,ze,we,Wt,L],encapsulation:2,changeDetection:0})}}return t})();function Ad(t,a){if(t&1){let e=V();l(0,"button",6),N("click",function(){D(e);let o=d(2);return G(o.save())}),l(1,"div"),w(2,1),r()()}if(t&2){let e=d(2);m("disabled",e.cssFormControl.invalid)}}function $d(t,a){t&1&&(l(0,"ww-account-feature-button"),k(1,"Save"),r())}function Ld(t,a){if(t&1&&(l(0,"div"),$(1,Ad,3,1,"button",5)(2,$d,2,0,"ng-template",null,0,me),r()),t&2){let e=ie(3);s(),m("wwAccountFeature","enableCustomStyle")("wwAccountFeatureElse",e)}}var fu=(()=>{class t extends q{constructor(){super(),this.fileRx=c(fc),this.locationRx=c(v),this.removeLocationFileWrite=c(cn),this.updateLocationWrite=c(Te),this.uploadLocationFileWrite=c(pn),this.cssFormControl=new C(null),this.subscribe()}subscribe(){this.fileRx.currentLocationSnapshotPublicStyleCss$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{this.cssFormControl.setValue(e,{emitEvent:!1})})}save(){return R(this,null,function*(){if(!this.cssFormControl.valid)return;let e=yield b(this.locationRx.locationId$);if(!e)return;if(!this.cssFormControl.value){this.removeLocationFileWrite.payload.next({locationId:e,fileType:"public-style"}),this.updateLocationWrite.payload.next({locationId:e,updates:{publicStyleUrl:null}}),yield Promise.all([b(this.removeLocationFileWrite.response$),b(this.updateLocationWrite.response$)]);return}let o=`text/css,${btoa(unescape(encodeURIComponent(this.cssFormControl.value??"")))}`;this.uploadLocationFileWrite.payload.next({locationId:e,fileType:"public-style",dataUrl:o});let u=(yield b(this.uploadLocationFileWrite.response$))?.url;u&&(this.updateLocationWrite.payload.next({locationId:e,updates:{publicStyleUrl:u}}),yield b(this.updateLocationWrite.response$))})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-custom-css"]],hostAttrs:[1,"ww-settings-custom-css"],inputs:{layout:"layout"},features:[O],decls:3,vars:3,consts:()=>{let e;e=$localize`Custom CSS`;let i;i=$localize`Customize the public pages with your own CSS stylesheet.`;let o;return o=$localize`Save`,[["featureMissingTmpl",""],o,[1,"flex","flex-col","gap-6"],["label",e,"sublabel",i,3,"formControl","minRows"],[4,"wwPermission"],["wwButton","",3,"disabled","click",4,"wwAccountFeature","wwAccountFeatureElse"],["wwButton","",3,"click","disabled"]]},template:function(i,o){i&1&&(l(0,"div",2),g(1,"ww-code",3),$(2,Ld,4,2,"div",4),r()),i&2&&(s(),m("formControl",o.cssFormControl)("minRows",10),s(),m("wwPermission","locations.update"))},dependencies:[X,oe,ne,H,$c,vc,Oo,Lo,Ro,M,Se,Bl],encapsulation:2,changeDetection:0})}}return t})();
6var Cu=(()=>{class t extends pi{constructor(){super(...arguments),this.batchDeleteDataFieldsWrite=c(Mc),this.batchUpdateDataFieldsWrite=c(ca)}createActions(e){return e.length===0?{}:{activate:{icon:"bx-show",label:$localize`Activate`,type:"secondary",api:()=>this.batchUpdateDataFieldsWrite.payload.next({ids:e,item:{isActive:!0}}),enabledConfig:{permissions:["data-fields.update"]}},deactivate:{icon:"bx-hide",label:$localize`Deactivate`,type:"secondary",api:()=>this.batchUpdateDataFieldsWrite.payload.next({ids:e,item:{isActive:!1}}),enabledConfig:{permissions:["data-fields.update"]}},delete:{icon:"bx-trash",label:$localize`Delete`,color:"warning",type:"warning",api:()=>this.batchDeleteDataFieldsWrite.payload.next(e),enabledConfig:{permissions:["data-fields.delete"]}}}}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Cn=so(Bm()),St=so(Um());function hu(t){return typeof t=="object"&&t!==null&&"minValue"in t&&"maxValue"in t}var wu=()=>[!1,!0];function Fd(t,a){t&1&&te(0)}function xd(t,a){t&1&&te(0)}function Pd(t,a){if(t&1&&(l(0,"ww-sublabel"),$(1,xd,1,0,"ng-container",5),r()),t&2){let e=d(2);s(),m("wwOutlet",e.sublabel)}}function Dd(t,a){if(t&1&&(l(0,"ww-label"),$(1,Fd,1,0,"ng-container",5),E(2,Pd,2,1,"ww-sublabel"),r()),t&2){let e=d();s(),m("wwOutlet",e.label),s(),f(e.sublabel?2:-1)}}function Gd(t,a){if(t&1&&(l(0,"div",4),g(1,"ww-datepicker",6)(2,"ww-datepicker",7),r()),t&2){let e=d();s(),m("formControl",e.dateFromFormControl),s(),m("formControl",e.dateToFormControl)}}function kd(t,a){if(t&1&&(l(0,"div",4)(1,"div",8)(2,"ww-label"),w(3,0),r(),l(4,"div",9),g(5,"ww-input",10)(6,"ww-select",11)(7,"ww-select",12),r()(),l(8,"div",8)(9,"ww-label"),w(10,1),r(),l(11,"div",9),g(12,"ww-input",10)(13,"ww-select",11)(14,"ww-select",12),r()()()),t&2){let e=d();s(),m("formGroup",e.periodFromFormGroup),s(5),m("data",e.periodUnits)("pluckLabel",e.pluckPeriodUnitLabel),s(),m("data",At(10,wu))("pluckLabel",e.pluckIsFutureLabel),s(),m("formGroup",e.periodToFormGroup),s(5),m("data",e.periodUnits)("pluckLabel",e.pluckPeriodUnitLabel),s(),m("data",At(11,wu))("pluckLabel",e.pluckIsFutureLabel)}}var Wd=lt(Eo(Ie)),yu=(()=>{class t extends Wd{constructor(){super(),this.selectedOptionFormControl=new C("dates",{nonNullable:!0}),this.dateFromFormControl=new C(null),this.dateToFormControl=new C(null),this.periodFromFormGroup=new F({value:new C(null),unit:new C("days",{nonNullable:!0}),isFuture:new C(!1,{nonNullable:!0})}),this.periodToFormGroup=new F({value:new C(null),unit:new C("days",{nonNullable:!0}),isFuture:new C(!1,{nonNullable:!0})}),this.selectedOption$=Q(this.selectedOptionFormControl),this.options=["dates","relative"],this.pluckLabel=e=>({dates:$localize`Specific dates`,relative:$localize`Relative dates`})[e],this.periodUnits=Be()(["days","weeks","months","years"]),this.pluckPeriodUnitLabel=e=>({days:$localize`Days`,weeks:$localize`Weeks`,months:$localize`Months`,years:$localize`Years`})[e],this.pluckIsFutureLabel=e=>e?$localize`From now`:$localize`Ago`,this.subscribeToInitialValue(),this.subscribeToSetValue()}subscribeToInitialValue(){this._value$.pipe(De(1),z(this.ngOnDestroy$)).subscribe(e=>{if(hu(e)){let i=this.parseRelative(e);if(i)this.selectedOptionFormControl.setValue("relative"),this.periodFromFormGroup.setValue(i.from),this.periodToFormGroup.setValue(i.to);else{this.selectedOptionFormControl.setValue("dates");let{from:o,to:n}=this.parseDates(e);this.dateFromFormControl.setValue(o),this.dateToFormControl.setValue(n)}}})}subscribeToSetValue(){A([Q(this.selectedOptionFormControl),this.periodFromFormGroup.valueChanges.pipe(Re(null),p(()=>this.periodFromFormGroup.getRawValue())),this.periodToFormGroup.valueChanges.pipe(Re(null),p(()=>this.periodToFormGroup.getRawValue()))]).pipe(Ee(()=>this.selectedOptionFormControl.dirty||this.periodFromFormGroup.dirty||this.periodToFormGroup.dirty),z(this.ngOnDestroy$)).subscribe(([e,i,o])=>{e==="relative"&&this._formControl.setValue({minValue:this.toStringPeriod(i),maxValue:this.toStringPeriod(o)})}),A([Q(this.selectedOptionFormControl),Q(this.dateFromFormControl),Q(this.dateToFormControl)]).pipe(Ee(()=>this.selectedOptionFormControl.dirty||this.dateFromFormControl.dirty||this.dateToFormControl.dirty),z(this.ngOnDestroy$)).subscribe(([e,i,o])=>{e==="dates"&&this._formControl.setValue({minValue:i?To(i):null,maxValue:o?To(o):null})})}parseRelative(e){return[e.minValue,e.maxValue].some(o=>
6typeof o=="string"&&(o.startsWith("P")||o.startsWith("-P")))?{from:this.parsePeriod(e.minValue),to:this.parsePeriod(e.maxValue)}:null}parseDates(e){let i=new Date(e.minValue??""),o=new Date(e.maxValue??"");return{from:qa(i)?i:null,to:qa(o)?o:null}}parsePeriod(e){if(!e)return{value:null,unit:"days",isFuture:!1};let i=!e.startsWith("-"),o=qs(e.replace("-","")),n=null,u="days";return o&&(o.years?(n=o.years,u="years"):o.months?(n=o.months,u="months"):o.weeks?(n=o.weeks,u="weeks"):o.days&&(n=o.days,u="days")),{value:n,unit:u,isFuture:i}}toStringPeriod(e){let{value:i,unit:o,isFuture:n}=e;return Fn(i)||typeof i=="string"&&isNaN(parseInt(i))?null:`${n?"":"-"}P${i}${o[0].toUpperCase()}`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-data-field-date"]],hostAttrs:[1,"ww-settings-data-field-date"],inputs:{hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoFocus:"autoFocus"},features:[O],decls:6,vars:5,consts:()=>{let e;e=$localize`Earliest allowed`;let i;return i=$localize`Latest allowed`,[e,i,[1,"flex","flex-col","gap-1"],["layout","vertical",3,"data","pluckLabel","formControl"],[1,"flex","flex-col","gap-2"],[4,"wwOutlet"],["label","Earliest allowed date","layout","vertical",3,"formControl"],["label","Latest allowed date","layout","vertical",3,"formControl"],["wwFormFieldSize","auto",1,"flex","flex-col",3,"formGroup"],[1,"flex","flex-wrap","gap-2"],["formControlName","value","type","number","size","small"],["formControlName","unit","size","small",3,"data","pluckLabel"],["formControlName","isFuture","size","small",3,"data","pluckLabel"]]},template:function(i,o){i&1&&(l(0,"ww-label-layout"),E(1,Dd,3,2,"ww-label"),l(2,"div",2),g(3,"ww-radio",3),E(4,Gd,3,2,"div",4)(5,kd,15,12,"div",4),r()()),i&2&&(s(),f(o.label?1:-1),s(2),m("data",o.options)("pluckLabel",o.pluckLabel)("formControl",o.selectedOptionFormControl),s(),f(o.selectedOptionFormControl.value==="dates"?4:5))},dependencies:[X,oe,yt,ne,Ln,$n,H,M,Qn,ft,We,ke,Xe,Fe,ve,xe,we],encapsulation:2,changeDetection:0})}}return t})();var Gr=["DATE","CHECKBOX","POLICY"];function qi(t){return!!t&&t!=="LEAD-TIME-ANCHOR-DATE"&&t!=="COLOR"}function zd(t,a){t&1&&te(0)}function Bd(t,a){t&1&&te(0)}function Ud(t,a){if(t&1&&(l(0,"ww-sublabel"),$(1,Bd,1,0,"ng-container",4),r()),t&2){let e=d(2);s(),m("wwOutlet",e.sublabel)}}function Vd(t,a){if(t&1&&(l(0,"ww-label"),$(1,zd,1,0,"ng-container",4),E(2,Ud,2,1,"ww-sublabel"),r()),t&2){let e=d();s(),m("wwOutlet",e.label),s(),f(e.sublabel?2:-1)}}function Xd(t,a){if(t&1&&g(0,"ww-markdown-editor",2),t&2){let e=d();m("formControl",e._formControl)}}function Hd(t,a){if(t&1&&g(0,"ww-input",3),t&2){let e=d();m("formControl",e._formControl)}}var qd=lt(Eo(Ie)),Iu=(()=>{class t extends qd{constructor(){super(),this.selectedOptionFormControl=new C("markdown",{nonNullable:!0}),this.selectedOption$=Q(this.selectedOptionFormControl),this.options=["markdown","url"],this.pluckLabel=e=>({markdown:$localize`Text field`,url:$localize`URL`})[e],this.subscribeToInitialValue()}validate(e){return this.selectedOptionFormControl.value!=="url"?null:gt.url()(e)}subscribeToInitialValue(){this.selectedOption$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{let i="https://";!this._formControl.value&&e==="url"&&this._formControl.setValue(i),this._formControl.value===i&&e==="markdown"&&this._formControl.setValue(""),this._formControl.updateValueAndValidity()}),this._value$.pipe(De(1),z(this.ngOnDestroy$)).subscribe(e=>{typeof e=="string"&&e.startsWith("http")&&this.selectedOptionFormControl.setValue("url")})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-data-field-policy"]],hostAttrs:[1,"ww-settings-data-field-policy"],inputs:{hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoFocus:"autoFocus"},features:[O],decls:6,vars:5,consts:[[1,"flex","flex-col","gap-1"],["layout","vertical",3,"data","pluckLabel","formControl"],["layout","vertical","size","large",2,"width","500px",3,"formControl"],[3,"formControl"],[4,"wwOutlet"]],template:function(i,o){i&1&&(l(0,"ww-label-layout"),E(1,Vd,3,2,"ww-label"),l(2,"div",0),g(3,"ww-radio",1),E(4,Xd,1,1,"ww-markdown-editor",2)(5,Hd,1,1,"ww-input",3),r()()),i&2&&(s(),f(o.label?1:-1),s(2),m("data",o.options)("pluckLabel",o.pluckLabel)("formControl",o.selectedOptionFormControl),s(),f(o.selectedOptionFormControl.value==="markdown"?4:5))},dependencies:[X,oe,ne,H,M,We,ke,Xe,Fe,zt,ve,xe],encapsulation:2,changeDetection:0})}}return t})();
6function jd(t,a){if(t&1&&g(0,"ww-joi-form",1),t&2){let e=d();m("form",e.primaryJoiFormUpdate)("formId",e.formId)("wwTrackPendingChanges",e.primaryJoiFormUpdate.options.formGroup)("wwTrackPendingChangesOnce",!0)("wwTrackPendingChangesUntil",e.update)}}function Kd(t,a){if(t&1&&g(0,"ww-joi-form",1),t&2){let e=d();m("form",e.primaryJoiFormCreate)("formId",e.formId)("wwTrackPendingChanges",e.primaryJoiFormCreate.options.formGroup)("wwTrackPendingChangesOnce",!0)("wwTrackPendingChangesUntil",e.create)}}function Yd(t,a){if(t&1&&g(0,"ww-joi-form",1),t&2){let e=a,i=d(2);m("form",e.joiForm)("formId",i.formId)("wwTrackPendingChanges",e.formGroup)("wwTrackPendingChangesOnce",!0)("wwTrackPendingChangesUntil",i.update)}}function Qd(t,a){if(t&1&&(E(0,Yd,1,5,"ww-joi-form",1),S(1,"async")),t&2){let e,i=d();f((e=T(1,1,i.updateInputTypeSpecific$))?0:-1,e)}}function Jd(t,a){if(t&1&&g(0,"ww-joi-form",1),t&2){let e=a,i=d(2);m("form",e.joiForm)("formId",i.formId)("wwTrackPendingChanges",e.formGroup)("wwTrackPendingChangesOnce",!0)("wwTrackPendingChangesUntil",i.create)}}function Zd(t,a){if(t&1&&(E(0,Jd,1,5,"ww-joi-form",1),S(1,"async")),t&2){let e,i=d();f((e=T(1,1,i.createInputTypeSpecific$))?0:-1,e)}}function e_(t,a){if(t&1&&g(0,"ww-joi-form",1),t&2){let e=d();m("form",e.secondaryJoiFormUpdate)("formId",e.formId)("wwTrackPendingChanges",e.secondaryUpdateFormGroup)("wwTrackPendingChangesOnce",!0)("wwTrackPendingChangesUntil",e.update)}}function t_(t,a){if(t&1&&g(0,"ww-joi-form",1),t&2){let e=d();m("form",e.secondaryJoiFormCreate)("formId",e.formId)("wwTrackPendingChanges",e.secondaryCreateFormGroup)("wwTrackPendingChangesOnce",!0)("wwTrackPendingChangesUntil",e.create)}}function i_(t,a){if(t&1){let e=V();l(0,"button",5),N("click",function(){D(e);let o=d(2);return G(o.onCreate())}),w(1,0),r()}if(t&2){let e=d(2);m("form",e.formId)}}function o_(t,a){t&1&&$(0,i_,2,1,"button",4),t&2&&m("wwPermission","data-fields.create")}var n_=0,bu=(()=>{class t extends q{constructor(){super(),this.accountRx=c(Ue),this.coreLocationRx=c($e),this.coreUserRx=c(No),this.layout=c(le),this.pendingChangesStore=c(ct),this.queryParams=c(It),this.dataField=null,this.dataField$=this.observe("dataField"),this.locales=null,this.locales$=this.observe("locales").pipe(p(e=>e??[])),this.update=new ei,this.create=new ei,this.formId=`ww-settings-data-field-form-${++n_}`,this.autoFocusKey=this.queryParams.get("key",void 0,Gt),this.canUpdate$=this.dataField$.pipe(U(e=>this.coreUserRx.canUserAccessLocationIds(e?.locationIds??[]))),this.hasDataField$=this.dataField$.pipe(p(e=>!!e),Tt()),this.createDefaults$=A([this.coreLocationRx.getCurrentNullableLocation(["id"]),this.coreUserRx.getCurrentUser(["locationIds"])]).pipe(p(([e,i])=>e?{locationIds:[e.id]}:i?{locationIds:i.locationIds}:null)),this.policyFormGroup=mt(St.PAYLOAD_SCHEMA,new F(W(y({publicAcceptanceMode:new C(Ai.EXPLICIT)},ut()({description:[]})),{defaultValue:new C(!1)}))),this.policyFormAcceptanceMode$=Q(this.policyFormGroup.controls.publicAcceptanceMode),this.policyForm=dt({formGroup:this.policyFormGroup,description:St.PAYLOAD_SCHEMA,autoFocusKey:this.autoFocusKey,labels:{publicAcceptanceMode:$localize`Policy acceptance`,description:$localize`Policy content`,defaultValue:$localize`Default value`},sublabels:{publicAcceptanceMode:$localize`Choose how customers should accept your policy: by checking a box or by completing their registration.`,description:$localize`Provide the policy content as text or link to a policy URL.`,defaultValue:$localize`Pre-fill a value for this input field.`},components:{publicAcceptanceMode:_(xe,{data:Be()([Ai.EXPLICIT,Ai.IMPLICIT]),pluckLabel:e=>ml[e]}),defaultValue:_(at,{suffixComponent:$localize`Accepted`}),description:_(Iu)},dependencies:()=>({defaultValue:this.policyFormAcceptanceMode$.pipe(p(e=>({hidden:e===Ai.IMPLICIT})))})}),this.policyFormTransformer={toView:({description:e,defaultValue:i,publicAcceptanceMode:o})=>({description:e,defaultValue:i==="true",publicAcceptanceMode:o??Ai.EXPLICIT}),toPayload:({description:e,defaultValue:i,publicAcceptanceMode:o})=>({description:e,defaultValue:i?"true":null,publicAcceptanceMode:o})},this.primaryJoiFormOptions={autoFocusKey:this.autoFocusKey,labels:{name:$localize`Name`,displayName:$localize`Display name`,description:$localize`Description`,inputType:$localize`Type`},sublabels:{name:$localize`Enter the field name for this customer detail field.`,displayName:$localize`Display a different field name for your customers on your public pages.`,description:$localize`Provide a brief description of the field and what it includes.`,inputType:$localize`Select the type of input for this customer detail field.`},placeholders:{name:$localize`e.g. Age`,displayName:$localize`Optional`,description:$localize`Optional`,inputType:$localize`Select`},components:{name:_(Sn,{$rx:{locales:this.locales$}}),displayName:_(Sn,{$rx:{locales:this.locales$}}),description:_(Sn,{mode:"textarea",$rx:{locales:this.locales$}}),inputType:_(we,{data:Be()(["TEXT","TEXTAREA","NUMBER","CHOICE","DATE","CHECKBOX","URL","POLICY"]),pluckLabel:e=>ul[e]})}},this.secondaryJoiFormOptions={autoFocusKey:this.autoFocusKey,labels:{placeholder:$localize`Placeholder`,isRequired:$localize`For staff`,isRequiredPublic:$localize`For customer`,registrationTypes:$localize`Registration types`,access:$localize`Access`,supportedServiceIds:$localize`Supported services`,locationIds:$localize`Locations`,order:$localize`Ordering`,isSensitive:$localize`This field contains sensitive information`,metadata:$localize`Metadata`},sublabels:{placeholder:$localize`This text is displayed inside the input field and will be overwritten when the customer adds input.`,registrationTypes:$localize`Specify whether this field is visible when making bookings, joining the waitlist or both.`,access:$localize`Manage how this input field is displayed and used.`,supportedServiceIds:$localize`Select which services this field applies to.`,locationIds:$localize`Choose the locations where this field will be used.`,order:$localize`This controls the order of field in relation to the other input fields. The lowest number shows first and the highest number shows last.`,metadata:$localize`Any additional data you want to add for this input field. Only used by the API.`},placeholders:{placeholder:$localize`e.g. Enter`,order:$localize`e.g. 1`}
6,groups:{isSensitive:{children:["isSensitive"],label:$localize`Sensitive information`,sublabel:$localize`A sensitive input field will not be included in reports or analytics. If you've enabled anonymization it will also be anonymized.`},requireResponse:{children:["isRequired","isRequiredPublic"],label:$localize`Require response`,sublabel:$localize`Choose if this field is required by staff or customers`}},components:{placeholder:_(Sn,{$rx:{locales:this.locales$}}),access:_(xe,{data:Be()(["PUBLIC","PUBLIC-DISPLAY","PRIVATE","HIDDEN"]),pluckLabel:e=>dl[e],pluckSublabel:e=>_l[e]}),registrationTypes:_(mi),supportedServiceIds:_(lp,{pluckLabel:e=>({allServices:$localize`Show for all services`,selectedServices:$localize`Show for selected services`})[e]}),locationIds:_(sp),isSensitive:_(at),metadata:_(yo,{maxEntries:20,keyValidators:[gt.metadataKey,re.maxLength(40)],valueValidators:[re.maxLength(500)]})}},this.primaryUpdateFormGroup=mt(St.PAYLOAD_SCHEMA,new F(y({name:new C({value:null,i18n:{}},{validators:[yr.i18nRequired]}),displayName:new C({value:null,i18n:{}}),description:new C({value:null,i18n:{}})},ut()({inputType:[]})))),this.primaryCreateFormGroup=mt(Cn.PAYLOAD_SCHEMA,new F(y({name:new C({value:null,i18n:{}},{validators:[yr.i18nRequired]}),displayName:new C({value:null,i18n:{}}),description:new C({value:null,i18n:{}})},ut()({inputType:["TEXT",{validators:[re.required]}]})))),this.primaryJoiFormCreate=dt(W(y({formGroup:this.primaryCreateFormGroup,description:Cn.PAYLOAD_SCHEMA},this.primaryJoiFormOptions),{dependencies:e=>({description:e.pipe(p(i=>({hidden:i.inputType==="POLICY"})))})})),this.primaryJoiFormUpdate=dt(W(y({formGroup:this.primaryUpdateFormGroup,description:St.PAYLOAD_SCHEMA},this.primaryJoiFormOptions),{dependencies:e=>({description:e.pipe(p(i=>({hidden:i.inputType==="POLICY"})))})})),this.secondaryCreateFormGroup=mt(Cn.PAYLOAD_SCHEMA,new F(y({registrationTypes:new C(jt(this.coreLocationRx.nullableLocation?.isBookingActive,this.coreLocationRx.nullableLocation?.isWaitlistActive)),placeholder:new C({value:null,i18n:{}})},ut()({isRequired:[],isRequiredPublic:[],access:["PUBLIC"],supportedServiceIds:[null],locationIds:[[],{validators:[re.required,re.minLength(1)]}],order:[],isSensitive:[]})))),this.secondaryUpdateFormGroup=mt(St.PAYLOAD_SCHEMA,new F(y({registrationTypes:new C(jt(this.coreLocationRx.nullableLocation?.isBookingActive,this.coreLocationRx.nullableLocation?.isWaitlistActive)),placeholder:new C({value:null,i18n:{}})},ut()({isRequired:[],isRequiredPublic:[],access:[],supportedServiceIds:[null],locationIds:[[],{validators:[re.required,re.minLength(1)]}],order:[],isSensitive:[],metadata:[null]})))),this.primaryCreateFormInputType$=Q(this.primaryCreateFormGroup.controls.inputType),this.primaryUpdateFormInputType$=Q(this.primaryUpdateFormGroup.controls.inputType),this.secondaryJoiFormCreate=dt(W(y({formGroup:this.secondaryCreateFormGroup,description:Cn.PAYLOAD_SCHEMA},this.secondaryJoiFormOptions),{dependencies:()=>({placeholder:this.primaryCreateFormInputType$.pipe(p(e=>({hidden:qi(e)&&Gr.includes(e)}))),isRequired:this.policyFormAcceptanceMode$.pipe(p(e=>({hidden:e===Ai.IMPLICIT}))),isRequiredPublic:this.policyFormAcceptanceMode$.pipe(p(e=>({hidden:e===Ai.IMPLICIT}
6))),metadata:this.accountRx.hasAccountFeature("enableApiKeys").pipe(p(e=>({hidden:!e})))})})),this.secondaryJoiFormUpdate=dt(W(y({formGroup:this.secondaryUpdateFormGroup,description:St.PAYLOAD_SCHEMA},this.secondaryJoiFormOptions),{dependencies:()=>({placeholder:this.primaryUpdateFormInputType$.pipe(p(e=>({hidden:qi(e)&&Gr.includes(e)}))),isRequired:this.policyFormAcceptanceMode$.pipe(p(e=>({hidden:e==="IMPLICIT"}))),isRequiredPublic:this.policyFormAcceptanceMode$.pipe(p(e=>({hidden:e==="IMPLICIT"}))),metadata:this.accountRx.hasAccountFeature("enableApiKeys").pipe(p(e=>({hidden:!e})))}),componentModifiers:{access:(e,i)=>_(e,{$rx:{pluckDisabled:i.pipe(p(({isRequired:o,isRequiredPublic:n})=>u=>!!(u==="PRIVATE"&&n||u==="HIDDEN"&&(o||n))))}})}})),this.updateInputTypeSpecific$=Q(this.primaryUpdateFormGroup.controls.inputType).pipe(p(e=>this.getInputTypeSpecific(e)),this.shareReplay()),this.createInputTypeSpecific$=Q(this.primaryCreateFormGroup.controls.inputType).pipe(p(e=>this.getInputTypeSpecific(e)),this.shareReplay()),this.textFormGroup=mt(St.PAYLOAD_SCHEMA,new F(y({},ut()({validation:[null,gt.isRegExp],defaultValue:[]})))),this.textForm=dt({formGroup:this.textFormGroup,description:St.PAYLOAD_SCHEMA,autoFocusKey:this.autoFocusKey,labels:{validation:$localize`Validation`,defaultValue:$localize`Default value`},sublabels:{validation:$localize`Require a certain text input. Can be most regular expressions. Note that the validation term is case sensitive.`,defaultValue:$localize`Pre-fill a value for this input field.`},placeholders:{validation:$localize`e.g. \\d{5}`,defaultValue:$localize`e.g. 25`}}),this.textFormTransformer={toView:e=>e,toPayload:e=>e},this.textareaFormGroup=mt(St.PAYLOAD_SCHEMA,new F(y({},ut()({validation:[null,gt.isRegExp],defaultValue:[]})))),this.textareaForm=dt({formGroup:this.textareaFormGroup,description:St.PAYLOAD_SCHEMA,autoFocusKey:this.autoFocusKey,labels:{validation:$localize`Validation`,defaultValue:$localize`Default value`},sublabels:{validation:$localize`Require a certain text input. Can be most regular expressions. Note that the validation term is case sensitive.`,defaultValue:$localize`Pre-fill a value for this input field.`},placeholders:{validation:$localize`e.g. \\d{5}`,defaultValue:$localize`e.g. 25`}}),this.textareaFormTransformer={toView:e=>e,toPayload:e=>e},this.numberFormGroup=mt(St.PAYLOAD_SCHEMA,new F({defaultValue:new C(null),minValue:new C(null),maxValue:new C(null)})),this.numberForm=dt({formGroup:this.numberFormGroup,autoFocusKey:this.autoFocusKey,labels:{defaultValue:$localize`Default value`,minValue:$localize`Minimum allowed value`,maxValue:$localize`Maximum allowed value`},sublabels:{defaultValue:$localize`Pre-fill a value for this input field.`},placeholders:{defaultValue:$localize`e.g. 25`},components:{defaultValue:_(Fe,{type:"number"}),minValue:_(Fe,{type:"number"}),maxValue:_(Fe,{type:"number"})}}),this.numberFormTransformer={toView:({defaultValue:e,minValue:i,maxValue:o})=>({defaultValue:e?parseInt(e):null,minValue:i?parseInt(i):null,maxValue:o?parseInt(o):null}),toPayload:({defaultValue:e,minValue:i,maxValue:o})=>({defaultValue:e?.toString()??null,minValue:i?.toString()??null,maxValue:o?.toString()??null})},this.choiceFormGroup=mt(St.PAYLOAD_SCHEMA,new F(y({inputOptions:new C({value:[],i18n:{}},{validators:[re.required]})},ut()({defaultValue:[],isMultiple:[],showOtherOption:[],staffSelectionComponent:["BUTTON"]})))),this.choiceFormTransformer={toView:e=>W(y({},e),{inputOptions:pc(e,"inputOptions"),isMultiple:e.isMultiple??!1}),toPayload:e=>{let n=e,{inputOptions:i}=n,o=Xt(n,["inputOptions"]);return y(y({},o),gr({inputOptions:i}))}},this.dateFormGroup=mt(St.PAYLOAD_SCHEMA,new F({value:new C({minValue:null,maxValue:null})})),this.dateForm=dt({formGroup:this.dateFormGroup,autoFocusKey:this.autoFocusKey,labels:{value:$localize`Date selection`},components:{value:_(yu)}}),this.dateFormTransformer={toView:({minValue:e,maxValue:i})=>({value:{minValue:e??null,maxValue:i??null}}),toPayload:({value:e})=>({minValue:e?.minValue??null,maxValue:e?.maxValue??null})},this.checkboxFormGroup=mt(St.PAYLOAD_SCHEMA,new F({defaultValue:new C(!1)})),this.checkboxForm=dt({formGroup:this.checkboxFormGroup,autoFocusKey:this.autoFocusKey,labels:{defaultValue:$localize`Default value`},sublabels:{defaultValue:$localize`Pre-fill a value for this input field.`},components:{defaultValue:_(at,{suffixComponent:$localize`Enabled`})}}),this.checkboxFormTransformer={toView:({defaultValue:e})=>({defaultValue:e==="true"}),toPayload:({defaultValue:e})=>({defaultValue:e?"true":null})},this.urlFormGroup=mt(St.PAYLOAD_SCHEMA,new F({})),this.urlForm=dt({formGroup:this.urlFormGroup,autoFocusKey:this.autoFocusKey}),this.urlFormTransformer={toView:e=>e,toPayload:e=>e},this.inputTypeSpecific={TEXT:{formGroup:this.textFormGroup,joiForm:this.textForm,transformer:this.textFormTransformer},TEXTAREA:{formGroup:this.textareaFormGroup,joiForm:this.textareaForm,transformer:this.textareaFormTransformer},NUMBER:{formGroup:this.numberFormGroup,joiForm:this.numberForm,transformer:this.numberFormTransformer},CHOICE:{formGroup:this.choiceFormGroup,joiForm:dt({formGroup:this.choiceFormGroup,description:St.PAYLOAD_SCHEMA,autoFocusKey:this.autoFocusKey,labels:{inputOptions:$localize`Options`,defaultValue:$localize`Default value`,isMultiple:$localize`Allow multiple selection`,showOtherOption:$localize`Add "Other" option`,staffSelectionComponent:$localize`Staff selection component`},sublabels:{defaultValue:$localize`Pre-fill a value for this input field.`,staffSelectionComponent:$localize`Specify the component used by staff to select options in this input field.`},placeholders:{defaultValue:$localize`e.g. 25`},components:{inputOptions:_(fp,{$rx:{locales:this.locales$}}),staffSelectionComponent:_(xe,{data:rc,pluckLabel:e=>Sl[e]})},componentModifiers:{defaultValue:(e,i)=>_(we,{placeholder:$localize`Select default value`,$rx:{data:i.pipe(p(({inputOptions:o,defaultValue:n})=>{let u=(o?.value??[]).filter(Gt);return se(n)&&!u.includes(n)&&this.choiceFormGroup.patchValue({defaultValue:null}),u}))}})}}),transformer:this.choiceFormTransformer},DATE:{formGroup:this.dateFormGroup,joiForm:this.dateForm,transformer:this.dateFormTransformer},CHECKBOX:{formGroup:this.checkboxFormGroup,joiForm:this.checkboxForm,transformer:this.checkboxFormTransformer},URL:{formGroup:this.urlFormGroup,joiForm:this.urlForm,transformer:this.urlFormTransformer},POLICY:{formGroup:this.policyFormGroup,joiForm:this.policyForm,transformer:this.policyFormTransformer}},this.formTransformerCreate={toView:()=>({}),toPayload:e=>{let i=this.toPayload(e);return W(y({},i),{locationIds:i.locationIds??[],name:i.name??null})}},this.formTransformerUpdate={toView:e=>W(y({},e),{name:ln(e,"name"),displayName:ln(e,"displayName"),description:ln(e,"description"),placeholder:ln(e,"placeholder"),order:e.order??void 0,registrationTypes:Tc(e),access:e.access??"PUBLIC",metadata:e.metadata??null}),toPayload:e=>{if(!this.dataField)throw new Error("dataField is required when updating");return{id:this.dataField.id,updates:this.toPayload(e)}}},this.subscribe()}onActivate(){return R(this,null,function*(){let e=yield b(this.dataField$);if(!e)return;let i={id:e.id,updates:{isActive:!0}};this.update.emit(i)})}onDeactivate(){return R(this,null,function*(){let e=yield b(this.dataField$);if(!e)return;let i={id:e.id,updates:{isActive:!1}};this.update.emit(i)})}onUpdate(){if(!this.primaryUpdateFormGroup.valid||!this.secondaryUpdateFormGroup.valid)return;let e=this.formTransformerUpdate.toPayload(y(y({},this.primaryUpdateFormGroup.value),this.secondaryUpdateFormGroup.value)),i=this.inputSpecificToPayload(this.primaryUpdateFormGroup.value.inputType);if(i){let o=ja((n,u)=>y(y({},n),u),e.updates.i18n??{},i.i18n??{});e.updates=W(y(y({},e.updates),i),{i18n:o})}this.update.emit(e)}onCreate(){if(!this.primaryCreateFormGroup.valid||!this.secondaryCreateFormGroup.valid)return;let e=this.formTransformerCreate.toPayload(y(y({},this.primaryCreateFormGroup.value),this.secondaryCreateFormGroup.value)),i=this.inputSpecificToPayload(this.primaryCreateFormGroup.value.inputType);if(i){let o=ja((n,u)=>y(y({},n),u),e.i18n??{},i.i18n??{});e=W(y(y({},e),i),{i18n:o})}this.create.emit(e)}getInputTypeSpecific(e){return qi(e)?this.inputTypeSpecific[e]:null}toPayload(e){let de=e,{registrationTypes:i,supportedServiceIds:o,name:n,displayName:u,description:h,placeholder:x}
6=de,P=Xt(de,["registrationTypes","supportedServiceIds","name","displayName","description","placeholder"]),K=y(y({},P),gr({name:n,displayName:u,description:h,placeholder:x}));if(i&&(K=y(y({},K),gc(e.registrationTypes))),o){let Ce=this.dataField?.supportedServiceIds;Ce?(K.addSupportedServiceIds=e.supportedServiceIds?.filter(ue=>!Ce.includes(ue)),K.removeSupportedServiceIds=Ce.filter(ue=>!e.supportedServiceIds?.includes(ue))):K.supportedServiceIds=o}else o===null&&(K.supportedServiceIds=null);return K=W(y({},K),{order:js(e.order)}),K}inputSpecificToPayload(e){if(!qi(e))return null;switch(e){case"TEXT":return this.textFormTransformer.toPayload(this.textFormGroup.value);case"TEXTAREA":return this.textareaFormTransformer.toPayload(this.textareaFormGroup.value);case"NUMBER":return this.numberFormTransformer.toPayload(this.numberFormGroup.value);case"CHOICE":return this.choiceFormTransformer.toPayload(this.choiceFormGroup.value);case"DATE":return this.dateFormTransformer.toPayload(this.dateFormGroup.value);case"CHECKBOX":return this.checkboxFormTransformer.toPayload(this.checkboxFormGroup.value);case"URL":return this.urlFormTransformer.toPayload(this.urlFormGroup.value);case"POLICY":return this.policyFormTransformer.toPayload(this.policyFormGroup.value)}}setInitialValue(e){if(this.primaryUpdateFormGroup.patchValue(this.formTransformerUpdate.toView(e)),this.secondaryUpdateFormGroup.patchValue(this.formTransformerUpdate.toView(e)),qi(e.inputType)){let{formGroup:i,transformer:o}=this.inputTypeSpecific[e.inputType];i.patchValue(o.toView(e)),this.pendingChangesStore.resetInitialValue(i)}this.pendingChangesStore.resetInitialValue(this.primaryUpdateFormGroup,this.secondaryUpdateFormGroup)}reset(){return R(this,null,function*(){let e=yield b(this.dataField$);if(e){if(qi(this.primaryUpdateFormGroup.value.inputType)){let{formGroup:i}=this.inputTypeSpecific[this.primaryUpdateFormGroup.value.inputType];i.markAsPristine(),i.updateValueAndValidity()}if(this.setInitialValue(e),this.primaryUpdateFormGroup.markAsPristine(),this.secondaryUpdateFormGroup.markAsPristine(),qi(e.inputType)){let{formGroup:i}=this.inputTypeSpecific[e.inputType];i.markAsPristine(),i.updateValueAndValidity()}this.primaryUpdateFormGroup.updateValueAndValidity(),this.secondaryUpdateFormGroup.updateValueAndValidity()}})}subscribe(){A([this.hasDataField$,this.canUpdate$]).pipe(z(this.ngOnDestroy$)).subscribe(([e,i])=>{if(!e||!i){this.layout.updateFeatureContext({pendingChanges:null});return}this.layout.updateFeatureContext({pendingChanges:{formId:this.formId,reset:()=>this.reset(),save:()=>this.onUpdate(),store:this.pendingChangesStore,enabledConfig:{permissions:["data-fields.update"]}}})}),this.createDefaults$.pipe(Ee(se),De(1),z(this.ngOnDestroy$)).subscribe(e=>{this.secondaryCreateFormGroup.patchValue(e)})}ngOnInit(){this.reset()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-data-field-form"]],hostAttrs:[1,"ww-settings-data-field-form"],inputs:{dataField:"dataField",locales:"locales"},outputs:{update:"update",create:"create"},features:[O],decls:8,vars:4,consts:()=>{let e;return e=$localize` Create `,[e,[3,"form","formId","wwTrackPendingChanges","wwTrackPendingChangesOnce","wwTrackPendingChangesUntil"],[1,"mt-4"],["wwButton","","type","submit",3,"form"],["wwButton","","type","submit",3,"form","click",4,"wwPermission"],["wwButton","","type","submit",3,"click","form"]]},template:function(i,o){i&1&&(E(0,jd,1,5,"ww-joi-form",1)(1,Kd,1,5,"ww-joi-form",1),E(2,Qd,2,3)(3,Zd,2,3),E(4,e_,1,5,"ww-joi-form",1)(5,t_,1,5,"ww-joi-form",1),l(6,"div",2),E(7,o_,1,1,"button",3),r()),i&2&&(f(o.dataField?0:1),s(2),f(o.dataField?2:3),s(2),f(o.dataField?4:5),s(3),f(o.dataField?-1:7))},dependencies:[vo,$o,H,Oo,pt,M,Se,X,L],styles:[`.ww-settings-data-field-form{display:flex;flex-direction:column;align-items:flex-start;gap:var(--ww-form-gap)}
7/*noopsettings-data-field-form.component-4FSRUC33.css.map */
8`],encapsulation:2,changeDetection:0})}}return t})();var yi={name:$localize`Location settings`,routerLink:"/settings"};function a_(t,a){if(t&1){let e=V();l(0,"ww-settings-data-field-form",2),S(1,"async"),N("update",function(o){D(e);let n=d();return G(n.onUpdate(o))}),r()}if(t&2){let e=d();m("dataField",a)("locales",T(1,2,e.locales$))}}function r_(t,a){if(t&1){let e=V();l(0,"ww-settings-data-field-form",3),S(1,"async"),N("create",function(o){D(e);let n=d();return G(n.onCreate(o))}),r()}if(t&2){let e=d();m("locales",T(1,1,e.locales$))}}var Br=(()=>{class t extends q{onCreate(e){return R(this,null,function*(){if(e.locationIds.length>1&&!(yield b(this.dialog.openConfirm({title:$localize`You are creating a shared input field`,message:$localize`Your input field will be available on ${e.locationIds.length} other locations.`,confirmLabel:$localize`Create`,confirmType:"primary",cancelLabel:$localize`Cancel`}).afterClosed$)))return;this.createDataFieldWrite.payload.next(e),(yield b(this.createDataFieldWrite.response$))&&this.navigateToParent()})}onUpdate(e){return R(this,null,function*(){let i=yield b(this.dataField$);if(i&&i.locationIds.length>1&&!(yield b(this.dialog.openConfirm({title:$localize`You are updating a shared input field`,message:$localize`Your changes will affect ${i.locationIds.length} locations.`,confirmLabel:$localize`Save`,confirmType:"primary",cancelLabel:$localize`Cancel`}).afterClosed$)))return;this.updateDataFieldWrite.payload.next(e),(yield b(this.updateDataFieldWrite.response$))&&this.navigateToParent()})}navigateToParent(){this.router.navigate([this.breadcrumbs[this.breadcrumbs.length-1].routerLink])}constructor(){super(),this.dialog=c(Ae),this.layout=c(le),this.locationRx=c(v),this.router=c(Ve),this.coreDataFieldRx=c(fi),this.createDataFieldWrite=c(Nc),this.updateDataFieldWrite=c(pa),this.breadcrumbs=[yi,{name:$localize`Customer details`,routerLink:"/settings/customer-details"}],this.queryParams$=Ri().pipe(p(e=>({dataFieldId:e.dataFieldId}))),this.dataField$=this.queryParams$.pipe(U(e=>e.dataFieldId?this.coreDataFieldRx.doc(e.dataFieldId,{disableLocalization:!0}):Y(null))),this.locales$=this.locationRx.getCurrentLocation(["publicLocales"]).pipe(p(e=>So(e.publicLocales.map(i=>$t(i)?.code).filter(se)))),this.layout.setFeatureContext({name:"",breadcrumbs:this.breadcrumbs}),this.subscribe()}subscribe(){this.locationRx.locationChanged$.pipe(z(this.ngOnDestroy$)).subscribe(()=>{this.navigateToParent()}),this.dataField$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{e?this.layout.updateFeatureContext({name:e.name}):this.layout.updateFeatureContext({name:$localize`New input field`})})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-data-fields-editor"]],hostAttrs:[1,"ww-settings-data-fields-editor"],features:[O],decls:3,vars:3,consts:[[3,"dataField","locales"],[3,"locales"],[3,"update","dataField","locales"],[3,"create","locales"]],template:function(i,o){if(i&1&&(E(0,a_,2,4,"ww-settings-data-field-form",0),S(1,"async"),Rt(2,r_,2,3,"ww-settings-data-field-form",1)),i&2){let n;f((n=T(1,1,o.dataField$))?0:2,n)}},dependencies:[X,H,bu,M,L],encapsulation:2,changeDetection:0})}}return t})();function Nu(t,a){let e=a.get(kn),i=o=>e.transform(o);return _(we,{data:t,pluckLabel:i,pluckSearchLabel:i,pluckTrigger:i})}function ko(t){if(Qs()&&t.length!==1)throw new Error("Cannot create a default transformer for multiple properties. Specify a transformer manually.")}var La=(()=>{class t extends q{constructor(){super(),this.disabled=null,this.disabled$=this.observe("disabled"),this.properties$=this.observe("properties"),this.confirmation=null,this.transformer$=this.observe("transformer"),this.dialog=c(Ae),this.injector=c(Ni),this.locationRx=c(v),this.updateLocationWrite=c(Te),this.settingItem=c(Pp,{optional:!0}),this.formControl=new C(null),this.disabledReason$=this.disabled$.pipe(p(e=>e?.reason??"")),this.location$=this.properties$.pipe(U(e=>this.locationRx.getCurrentLocation(e))),this.view$=A([this.location$,this.transformer$]).pipe(p(([e,i])=>{let o=i?.toView;return o?ji(this.injector,()=>o(e)):null})),this.payload$=A([this.formControl.valueChanges,this.transformer$]).pipe(p(([e,i])=>!i||e===null?null:i.toPayload(e))),this.view$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{this.formControl.setValue(e,{emitEvent:!1})}),this.payload$.pipe(Ko(this.view$),z(this.ngOnDestroy$)).subscribe(([e,i])=>this.updateLocation(e,i))}updateLocation(e,i){return R(this,null,function*(){if(!(!e||!this.locationRx.nullableLocation)){if
8(this.confirmation){let o=this.confirmation(e,this.locationRx.nullableLocation);if(o&&!(yield b(this.dialog.openConfirm(o).afterClosed$))){this.formControl.setValue(i,{emitEvent:!1});return}}this.updateLocationWrite.payload.next({locationId:this.locationRx.nullableLocation.id,updates:e})}})}ngOnChanges(e){super.ngOnChanges(e),this.settingItem&&this.settingItem.disabledReason$.pipe(z(this.ngOnDestroy$)).subscribe(i=>{i?this.formControl.disable({emitEvent:!1}):this.formControl.enable({emitEvent:!1})}),"disabled"in e&&(this.disabled?.value?this.formControl.disable({emitEvent:!1}):this.formControl.enable({emitEvent:!1}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=Ns({type:t,inputs:{disabled:"disabled",properties:"properties",confirmation:"confirmation",transformer:"transformer"},features:[O,Ms]})}}return t})();function l_(t,a){if(t&1&&(l(0,"span",1),S(1,"async"),g(2,"ww-select",2),S(3,"async"),S(4,"async"),r()),t&2){let e=d();m("wwTooltip",T(1,4,e.disabledReason$)??""),s(2),m("data",T(3,6,e.optionValues$))("pluckLabel",T(4,8,e.pluckLabel$))("formControl",e.formControl)}}var Ou=(()=>{class t extends La{constructor(){super(...arguments),this.options=[],this.options$=this.observe("options"),this.optionValues$=this.options$.pipe(p(e=>e.map(i=>i.value))),this.pluckLabel$=this.options$.pipe(p(e=>i=>e.find(o=>o.value===i)?.label))}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-location-select"]],hostAttrs:[1,"ww-settings-location-select"],inputs:{options:"options",featureEnabledConfig:"featureEnabledConfig"},features:[O],decls:1,vars:1,consts:[[3,"wwTooltip",4,"wwFeatureEnabledConfig"],[3,"wwTooltip"],["size","auto","layout","vertical",3,"data","pluckLabel","formControl"]],template:function(i,o){i&1&&$(0,l_,5,10,"span",0),i&2&&m("wwFeatureEnabledConfig",o.featureEnabledConfig)},dependencies:[X,oe,ne,H,Ta,M,we,Ct,L],encapsulation:2,changeDetection:0})}}return t})();function Wo(t,a){t=Array.isArray(t)?t:[t];let e=a?.transformer??c_(t);return _(Ou,y({properties:t,transformer:e,featureEnabledConfig:{permissions:["locations.update"]}},a))}function c_(t){ko(t);let a=t[0];return{toPayload:e=>({[a]:e}),toView:e=>e[a]}}function ao(t){return _(Lp,t)}function _i(t,a=p_(nt(t))){return ao({$rx:{enabled:gs(()=>c(v).getCurrentLocation(nt(t)).pipe(p(e=>a(e))))}})}function p_(t){ko(t);let a=t[0];return e=>!!e[a]}function u_(t,a){if(t&1&&(l(0,"span",1),S(1,"async"),g(2,"ww-toggle",2),r()),t&2){let e=d();m("wwTooltip",T(1,3,e.disabledReason$)??""),s(2),m("label",e.label)("formControl",e.formControl)}}var hn=(()=>{class t extends La{constructor(){super(...arguments),this.label=null}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-toggle"]],hostAttrs:[1,"ww-settings-toggle"],inputs:{label:"label",featureEnabledConfig:"featureEnabledConfig"},features:[O],decls:1,vars:1,consts:[[3,"wwTooltip",4,"wwFeatureEnabledConfig"],[3,"wwTooltip"],[3,"label","formControl"]],template:function(i,o){i&1&&$(0,u_,3,5,"span",0),i&2&&m("wwFeatureEnabledConfig",o.featureEnabledConfig)},dependencies:[Le,H,Ta,M,ac,Ct,X,oe,ne,L],encapsulation:2,changeDetection:0})}}return t})();function ae(t,a){t=Array.isArray(t)?t:[t];let e=a?.transformer??m_(t);return _(hn,y({properties:t,transformer:e,featureEnabledConfig:{permissions:["locations.update"]}},a))}function m_(t){ko(t);let a=t[0];return{toPayload:e=>({[a]:e}),toView:e=>e[a]}}function Pe(t){return W(y({},t),{rx:a=>{let e=t.isSessionSupported?A([a.get(Ue).getAccount([]).pipe(De(1)),a.get($e).currentLocationSnapshot$,a.get(Gi).getCurrentUser([]).pipe(De(1))]).pipe(p(([o,n,u])=>t.isSessionSupported?t.isSessionSupported({account:o,location:n,user:u}):!0)):Y(!0),i=t.rx?t.rx(a):Y(!0);return A([e,i]).pipe(p(([o,n])=>!o||!n?!1:Ha(o)||Ha(n)?o??n:!0),Tt())}})}var cy=new ys("LOCATION_SETTING_FORM_OPTIONS");var Ur=so(wc());function d_(t,a){t&1&&te(0)}function __(t,a){if(t&1&&$(0,d_,1,0,"ng-container",2),t&2){let e=a.$implicit;m("wwOutlet",e)}}function S_(t,a){if(t&1&&(g(0,"ww-joi-form",0),l(1,"div",1),ce(2,__,1,1,"ng-container",null,je),S(4,"async"),r()),t&2){let e=a,i=d();m("form",e)("formId",i.formId)("wwTrackPendingChanges",e.options.formGroup)("wwTrackPendingChangesDisabled",i.type==="inline")("wwTrackPendingChangesUntil",i.pendingChangesUntil$),s(2),pe(T(4,5,i.actions$))}}var T_=0,zo=(()=>{class t extends q{constructor(){super(),this.type="standalone",this.type$=this.observe("type"),this.createOptions$=this.observe("createOptions"),this.coreLocationRx=c($e),this.dialog=c(Ae),this.injector=c(Ni),this.layout=c(le),this.locationRx=c(v),this.pendingChangesStore=c(ct),this.updateLocationWrite=c(Te),this.subscriptions=[],this.formId=`ww-settings-form-${++T_}`,this.options$=this.createOptions$.pipe(p(e=>ji(this.injector,()=>e())),this.shareReplay()),this.actions$=this.options$.pipe(p(e=>e.actions??[])),this.formInitializedSub=new Ts,this.form$=this.formInitializedSub.pipe(U(()=>this.options$.pipe(p(e=>dt(W(y({},e.joi),{description:Ur.PAYLOAD_SCHEMA}))))),this.shareReplay()),this.valueChanges$=this.form$.pipe(U(e=>e.options.formGroup.valueChanges)),this.showSaveButton$=A([this.form$,this.type$]).pipe(p(([e,i])=>i==="standalone"&&e.items.some(o=>!o.component.inputs||!o.component.inputs.readonly))),this.pendingChangesUntil$=Zt(this.formInitializedSub,this.updateLocationWrite.response$),this.subscribe()}save(e){return R(this,null,function*(){let i=tp(e.options.formGroup,e.options.description);if(!this.coreLocationRx.nullableLocationId||!this.locationRx.nullableLocation)return;let o=yield b(this.options$),n=o.transformer?.toPayload,u=n?ji(this.injector,()=>n(i)??i):i;
8if(o.confirmation){let K=o.confirmation(u,this.locationRx.nullableLocation);if(K&&!(yield b(this.dialog.openConfirm(K).afterClosed$)))return}let h=y({},this.locationRx.nullableLocation);this.updateLocationWrite.payload.next({locationId:this.coreLocationRx.nullableLocationId,updates:u});let x=yield b(this.updateLocationWrite.response$),P=o.updateSideEffect;P&&ji(this.injector,()=>{let K=P(u,h,x);K&&this.subscriptions.push(K)})})}saveCurrentForm(){return R(this,null,function*(){let e=yield b(this.form$);yield this.save(e)})}resetCurrentForm(){return R(this,null,function*(){let e=yield b(this.options$),i=yield b(this.form$),o=this.locationRx.nullableLocation;o&&(this.setInitialValue(e,o),i.options.formGroup.markAsPristine(),i.options.formGroup.updateValueAndValidity())})}setInitialValue(e,i){let o=e.transformer?.toView,n=o?ji(this.injector,()=>o(i)):i;e.joi.formGroup.reset({emitEvent:!1}),e.joi.formGroup.patchValue(n,{emitEvent:!1})}subscribe(){this.valueChanges$.pipe(Ko(this.form$,this.type$),z(this.ngOnDestroy$)).subscribe(([e,i,o])=>{i.options.formGroup.dirty&&o==="inline"&&(i.options.formGroup.markAsPristine(),this.save(i))}),this.form$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{mt(Ur.PAYLOAD_SCHEMA,e.options.formGroup)}),this.showSaveButton$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{e?this.layout.updateFeatureContext({pendingChanges:{formId:this.formId,store:this.pendingChangesStore,save:()=>this.saveCurrentForm(),reset:()=>this.resetCurrentForm(),enabledConfig:{permissions:["locations.update"]}}}):this.layout.updateFeatureContext({pendingChanges:null})}),A([this.options$.pipe(De(1)),this.coreLocationRx.currentLocationSnapshot$]).pipe(z(this.ngOnDestroy$)).subscribe(([e,i])=>{i&&(this.setInitialValue(e,i),this.formInitializedSub.next())}),this.updateLocationWrite.response$.pipe(Ko(this.options$),z(this.ngOnDestroy$)).subscribe(([e,i])=>{e&&this.setInitialValue(i,e)})}ngOnDestroy(){for(let e of this.subscriptions)e.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-form"]],hostAttrs:[1,"ww-settings-form","flex","flex-col","gap-4","items-start"],inputs:{createOptions:"createOptions",type:"type"},standalone:!1,features:[O],decls:2,vars:3,consts:[[3,"form","formId","wwTrackPendingChanges","wwTrackPendingChangesDisabled","wwTrackPendingChangesUntil"],[1,"flex","gap-3"],[4,"wwOutlet"]],template:function(i,o){if(i&1&&(E(0,S_,5,7),S(1,"async")),i&2){let n;f((n=T(1,1,o.form$))?0:-1,n)}},dependencies:[pt,$o,ve,L],encapsulation:2,changeDetection:0})}}return t})();function J(t){return _(zo,{createOptions:t})}function Vr(t){return _(zo,{type:"inline",createOptions:()=>{let a=t(),e=Object.keys(a.joi.formGroup.controls).reduce((i,o)=>W(y({},i),{[o]:n=>{let u=a.joi.componentModifiers?.[o];return u&&(n=u(n,a.joi.formGroup.valueChanges.pipe(Re(null),p(()=>a.joi.formGroup.value)))),_(n,{size:"auto",appearance:"fill"})}}),{});return W(y({},a),{joi:W(y({},a.joi),{componentModifiers:e})})}})}function Z(t){return ut()(t)}var Ru=(()=>{class t extends q{constructor(){super(),this.properties$=this.observe("properties"),this.display$=this.observe("display"),this.locationRx=c(v),this.location$=this.properties$.pipe(U(e=>this.locationRx.getCurrentLocation(e).pipe(p(i=>e.reduce((o,n)=>(o[n]=i[n],o),{}))))),this.value$=A([this.location$,this.display$]).pipe(p(([e,i])=>{let o=i(e);return Gt(o)?{text:o,disabled:!1}:ks(o)?{text:$localize`Enabled`,disabled:!o}:o}),this.shareReplay()),this.disabled$=this.value$.pipe(p(e=>e.disabled)),this.text$=this.value$.pipe(p(e=>e.disabled?$localize`Off`:e.text)),this.addClassBinding("ww-settings-location-text-disabled",this.disabled$)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-location-text"]],hostAttrs:[1,"ww-settings-location-text","whitespace-nowrap"],inputs:{properties:"properties",display:"display"},features:[O],decls:2,vars:3,template:function(i,o){i&1&&(k(0),S(1,"async")),i&2&&fe(T(1,1,o.text$))},dependencies:[M,L],styles:[`.ww-settings-location-text{text-overflow:ellipsis;overflow:hidden}.ww-settings-location-text.ww-settings-location-text-disabled{color:var(--ww-color-darkerGrey)}
9/*noopsettings-text.component-DWZF4UEK.css.map */
10`],encapsulation:2,changeDetection:0})}}return t})();
10function qe(t,a,e){return _(Ru,y({properties:t,display:a,$element:{typography:"body1"}},e))}function g_(t,a){if(t&1&&(l(0,"ww-info-bubble"),g(1,"ww-paragraph",1),r()),t&2){let e=d();s(),m("content",e.content)}}function E_(t,a){t&1&&te(0)}var Au=(()=>{class t extends q{constructor(){super(),this.activatedRoute=c(mo),this.coreLocationRx=c($e),this.layout=c(le),this.standardDataFields=c(xo),this.queryParams=c(It),this.autoFocusKey=this.queryParams.get("key",void 0,Gt),this.breadcrumbs=[yi,{name:$localize`Customer details`,routerLink:"/settings/customer-details"}],this.content=[$localize`This field can be localized in `,{type:"router-link",link:"/settings/localization/registration",queryParams:{tab:"customer-info"},content:$localize`Localization > Customer journey terms > Customer info`}],this.standardDataField$=this.activatedRoute.params.pipe(p(e=>e.key),U(e=>e?this.standardDataFields.getField(e):Y(null))),this.formComponent$=this.standardDataField$.pipe(p(e=>e?this.forms[e.key]:null)),this.isActive$=this.standardDataField$.pipe(p(e=>!!e?.isActive)),this.isInactive$=this.isActive$.pipe(p(e=>!e)),this.showLocalizationBubble$=this.standardDataField$.pipe(p(e=>e?.key!=="notes")),this.forms={name:J(()=>({joi:{formGroup:new F(y(W(y({},Z({isNamePublic:[]})),{registrationTypes:new C(this.getRegistrationType())}),Z({showFirstLastName:[],requireName:[],requireNamePublic:[]}))),autoFocusKey:this.autoFocusKey,components:{isNamePublic:_(xe,{data:[!0,!1],pluckLabel:e=>e?$localize`Public`:$localize`Private`}),registrationTypes:_(mi)},groups:{showFirstLastName:{children:["showFirstLastName"],label:$localize`Separate first and last name`},required:{children:["requireName","requireNamePublic"],label:$localize`Require response`}},labels:{isNamePublic:$localize`Access`,showFirstLastName:$localize`Separate`,requireName:$localize`For staff`,requireNamePublic:$localize`For customers`,registrationTypes:$localize`Registration types`}},transformer:{toView:e=>({isNamePublic:e.isNamePublic,showFirstLastName:e.showFirstLastName,requireName:e.requireName,requireNamePublic:e.requireNamePublic,registrationTypes:jt(e.showNameBooking,e.showNameWaitlist)}),toPayload:e=>{let u=e,{registrationTypes:i}=u,o=Xt(u,["registrationTypes"]);return W(y({},o),{showNameBooking:i==="both"||i==="bookings",showNameWaitlist:i==="both"||i==="waitlist"})}}})),phone:J(()=>({joi:{formGroup:new F(y(W(y({},Z({isPhonePublic:[]})),{registrationTypes:new C(this.getRegistrationType())}),Z({requirePhone:[],requirePhonePublic:[]}))),autoFocusKey:this.autoFocusKey,components:{isPhonePublic:_(xe,{data:[!0,!1],pluckLabel:e=>e?$localize`Public`:$localize`Private`}),registrationTypes:_(mi)},groups:{required:{children:["requirePhone","requirePhonePublic"],label:$localize`Require response`}},labels:{isPhonePublic:$localize`Access`,requirePhone:$localize`For staff`,requirePhonePublic:$localize`For customers`,registrationTypes:$localize`Registration types`}},transformer:{toView:e=>({isPhonePublic:e.isPhonePublic,requirePhone:e.requirePhone,requirePhonePublic:e.requirePhonePublic,registrationTypes:jt(e.showPhoneBooking,e.showPhoneWaitlist)}),toPayload:e=>{let u=e,{registrationTypes:i}=u,o=Xt(u,["registrationTypes"]);return W(y({},o),{showPhoneBooking:i==="both"||i==="bookings",showPhoneWaitlist:i==="both"||i==="waitlist"})}}})),email:J(()=>({joi:{formGroup:new F(y(W(y({},Z({isEmailPublic:[]})),{registrationTypes:new C(this.getRegistrationType())}),Z({requireEmail:[],requireEmailPublic:[]}))),autoFocusKey:this.autoFocusKey,components:{isEmailPublic:_(xe,{data:[!0,!1],pluckLabel:e=>e?$localize`Public`:$localize`Private`}),registrationTypes:_(mi)},groups:{required:{children:["requireEmail","requireEmailPublic"],label:$localize`Require response`}},labels:{isEmailPublic:$localize`Access`,requireEmail:$localize`For staff`,requireEmailPublic:$localize`For customers`,registrationTypes:$localize`Registration types`}},transformer:{toView:e=>({isEmailPublic:e.isEmailPublic,requireEmail:e.requireEmail,requireEmailPublic:e.requireEmailPublic,registrationTypes:jt(e.showEmailBooking,e.showEmailWaitlist)}),toPayload:e=>{let u=e,{registrationTypes:i}=u,o=Xt(u,["registrationTypes"]);return W(y({},o),{showEmailBooking:i==="both"||i==="bookings",showEmailWaitlist:i==="both"||i==="waitlist"})}}})),partySize:J(()=>({joi:{formGroup:new F(y(W(y({},Z({isPartySizePublic:[],requirePartySize:[],requirePartySizePublic:[]})),{registrationTypes:new C(this.getRegistrationType())}),Z({maxPartySize:[],maxPartySizeBookings:[]}))),autoFocusKey:this.autoFocusKey,components:{isPartySizePublic:_(xe,{data:[!0,!1],pluckLabel:e=>e?$localize`Public`:$localize`Private`}),registrationTypes:_(mi)},labels:{isPartySizePublic:$localize`Access`,requirePartySize:$localize`For staff`,requirePartySizePublic:$localize`For customer`,maxPartySize:$localize`Max party size for waitlist`,maxPartySizeBookings:$localize`Max party size for bookings`,registrationTypes:$localize`Registration types`},groups:{required:{children:["requirePartySize","requirePartySizePublic"],label:$localize`Require response`}}},transformer:{toView:e=>({isPartySizePublic:e.isPartySizePublic,requirePartySize:e.requirePartySize,requirePartySizePublic:e.requirePartySizePublic,maxPartySize:e.maxPartySize,maxPartySizeBookings:e.maxPartySizeBookings,registrationTypes:jt(e.showPartySizeBooking,e.showPartySizeWaitlist)}),toPayload:e=>{let u=e,{registrationTypes:i}=u,o=Xt(u,["registrationTypes"]);return W(y({},o),{showPartySizeBooking:i==="both"||i==="bookings",showPartySizeWaitlist:i==="both"||i==="waitlist"})}}})),customerId:J(()=>({joi:{formGroup:new F(y(W(y({},Z({isCustomerIdPublic:[]})),{registrationTypes:new C(this.getRegistrationType())}),Z({requireCustomerId:[],requireCustomerIdPublic:[],externalCustomerIdValidation:[null,gt.isRegExp]}))),autoFocusKey:this.autoFocusKey,components:{isCustomerIdPublic:_(xe,{data:[!0,!1],pluckLabel:e=>e?$localize`Public`:$localize`Private`}),registrationTypes:_(mi)},groups:{required:{children:["requireCustomerId","requireCustomerIdPublic"],label:$localize`Require response`}},labels:{isCustomerIdPublic:$localize`Access`,requireCustomerId:$localize`For staff`,requireCustomerIdPublic:$localize`For customer`,registrationTypes:$localize`Registration types`,externalCustomerIdValidation:$localize`Validation pattern`},sublabels:{externalCustomerIdValidation:$localize`Regular expression pattern for Customer ID validation.`},placeholders:{externalCustomerIdValidation:$localize`e.g. \\d{5}`}}
10,transformer:{toView:e=>({isCustomerIdPublic:e.isCustomerIdPublic,requireCustomerId:e.requireCustomerId,requireCustomerIdPublic:e.requireCustomerIdPublic,registrationTypes:jt(e.showCustomerIdBooking,e.showCustomerIdWaitlist),externalCustomerIdValidation:e.externalCustomerIdValidation}),toPayload:e=>{let u=e,{registrationTypes:i}=u,o=Xt(u,["registrationTypes"]);return W(y({},o),{showCustomerIdBooking:i==="both"||i==="bookings",showCustomerIdWaitlist:i==="both"||i==="waitlist"})}}})),quote:J(()=>({joi:{formGroup:new F(y(W(y({},Z({quotedWaitIncrement:[],isQuotePublic:[]})),{registrationTypes:new C(this.getRegistrationType())}),Z({requireQuote:[]}))),autoFocusKey:this.autoFocusKey,components:{quotedWaitIncrement:_(we,{searchable:!1,data:[300,600,900,1200,1500,1800,2100,2400,2700,3e3,3300,3600],pluckLabel:e=>$localize`${e/60} minutes`}),isQuotePublic:_(xe,{data:[!0,!1],pluckLabel:e=>e?$localize`Public`:$localize`Private`,pluckDisabled:e=>e===!0}),registrationTypes:_(mi,{enabledOptions:["waitlist"]})},labels:{quotedWaitIncrement:$localize`Steps`,isQuotePublic:$localize`Access`,requireQuote:$localize`Required for staff`,registrationTypes:$localize`Registration types`}},transformer:{toView:e=>({quotedWaitIncrement:e.quotedWaitIncrement,isQuotePublic:!1,requireQuote:e.requireQuote,registrationTypes:"waitlist"}),toPayload:e=>{let u=e,{registrationTypes:i}=u,o=Xt(u,["registrationTypes"]);return y({},o)}}})),notes:J(()=>({joi:{formGroup:new F(y({registrationTypes:new C(this.getRegistrationType())},Z({requireNotes:[]}))),autoFocusKey:this.autoFocusKey,components:{registrationTypes:_(mi)},labels:{requireNotes:$localize`Required for staff`,registrationTypes:$localize`Registration types`}},transformer:{toView:e=>({requireNotes:e.requireNotes,registrationTypes:jt(e.showNotesBooking,e.showNotesWaitlist)}),toPayload:e=>{let u=e,{registrationTypes:i}=u,o=Xt(u,["registrationTypes"]);return W(y({},o),{showNotesBooking:i==="both"||i==="bookings",showNotesWaitlist:i==="both"||i==="waitlist"})}}}))},this.layout.setFeatureContext({name:"",breadcrumbs:this.breadcrumbs}),this.subscribe()}onActivate(){return R(this,null,function*(){let e=yield b(this.standardDataField$);e&&e.actions.activate.api()})}onDeactivate(){return R(this,null,function*(){let e=yield b(this.standardDataField$);e&&e.actions.deactivate.api()})}subscribe(){this.standardDataField$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{e&&this.layout.updateFeatureContext({name:e.name})})}getRegistrationType(){return jt(this.coreLocationRx.nullableLocation?.isBookingActive,this.coreLocationRx.nullableLocation?.isWaitlistActive)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-standard-data-fields-editor"]],hostAttrs:[1,"ww-settings-standard-data-fields-editor","flex","flex-col","gap-6"],features:[Oi([{provide:xp,useValue:{parentPath:"/settings/customer-details"}}]),O],decls:4,vars:6,consts:[[4,"wwOutlet"],[3,"content"]],template:function(i,o){i&1&&(E(0,g_,2,1,"ww-info-bubble"),S(1,"async"),$(2,E_,1,0,"ng-container",0),S(3,"async")),i&2&&(f(T(1,2,o.showLocalizationBubble$)?0:-1),s(2),m("wwOutlet",T(3,4,o.formComponent$)))},dependencies:[X,H,M,He,ve,tc,L],encapsulation:2,changeDetection:0})}}return t})();function f_(t,a){t&1&&te(0)}function C_(t,a){if(t&1){let e=V();l(0,"ww-display-object-key"),k(1),r(),l(2,"ww-display-object-value",0),N("edit",function(){let o=D(e).$implicit,n=d();return G(n.onEdit(o.formKey??o.key))}),$(3,f_,1,0,"ng-container",1),r()}if(t&2){let e=a.$implicit;s(),fe(e.label),s(),m("editable",!!e.editable),s(),m("wwOutlet",e.component)}}var h_=ai(Ie),$u=(()=>{class t extends h_{constructor(){super(...arguments),this.title=null,this.edit=new ei,this.settingsDataFieldsProperties=c(ya),this.properties$=this._entity$.pipe(U(e=>this.settingsDataFieldsProperties.getInputTypePermittedProperties(e?.inputType??"TEXT"))),this.items$=A([this._entity$,this.properties$]).pipe(p(([e,i])=>{if(!e)return[];let o=Object.keys(i);return[...xc(e,Object.values(i),o)]}))}onEdit(e){this.edit.emit(e)}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-data-fields-detail
10s"]],hostAttrs:[1,"ww-settings-data-fields-details"],inputs:{entity:"entity",entityId:"entityId",disableEntityUpdates:"disableEntityUpdates",title:"title"},outputs:{edit:"edit"},features:[O],decls:4,vars:2,consts:[["wwLayoutClose","",3,"edit","editable"],[4,"wwOutlet"]],template:function(i,o){i&1&&(l(0,"ww-display-object"),ce(1,C_,4,3,null,null,xt),S(3,"async"),r()),i&2&&(s(),pe(T(3,0,o.items$)))},dependencies:[X,H,Ui,M,Di,xi,Pi,ve,L],encapsulation:2,changeDetection:0})}}return t})();function w_(t,a){if(t&1){let e=V();l(0,"ww-settings-data-fields-details",8),N("edit",function(o){let n=D(e),u=d();return G(u.onEdit(n,o))}),r()}t&2&&m("entity",a)}function y_(t,a){if(t&1){let e=V();l(0,"button",10),N("click",function(){D(e);let o=d();return G(o.editAction.api())}),k(1),r()}if(t&2){let e=d();s(),Ke(" ",e.editAction.label," ")}}function I_(t,a){t&1&&(l(0,"ww-section-actions"),E(1,y_,2,1,"button",9),r()),t&2&&(s(),f(a.editAction?1:-1))}var M_=ai(Ie),Du=(()=>{class t extends M_{constructor(){super(...arguments),this.coreDataFields=c(fi),this.settingsDataFieldsActions=c(va),this.settingsDataFieldsService=c(Si),this._entityApi=e=>this.coreDataFields.doc(e),this.title$=this._entity$.pipe(p(e=>e?.name??"")),this.editAction$=this._entity$.pipe(U(e=>e?this.settingsDataFieldsActions.getAction(e,"edit"):Y(null))),this.menuActions$=this._entity$.pipe(U(e=>e?this.settingsDataFieldsActions.getActions(e,{omit:[e.isActive?"activate":"deactivate","edit"]}):Y([]))),this.footerActions$=this.editAction$.pipe(p(e=>e?{editAction:e}:null))}onEdit(e,i){this.settingsDataFieldsService.openEditor(e,i)}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-data-fields-viewer"]],hostAttrs:[1,"ww-settings-data-fields-viewer"],inputs:{entity:"entity",entityId:"entityId",disableEntityUpdates:"disableEntityUpdates"},features:[O],decls:15,vars:13,consts:[[3,"truncate","content"],[1,"flex","items-center"],[3,"actions"],["wwButton","tertiary","wwLayoutClose",""],["icon","bx-x"],["padding","large"],[3,"entity"],["ngProjectAs","ww-section-actions",5,["ww-section-actions"]],[3,"edit","entity"],["wwButton","primary","wwLayoutClose",""],["wwButton","primary","wwLayoutClose","",3,"click"]],template:function(i,o){if(i&1&&(l(0,"ww-section")(1,"ww-section-title"),g(2,"ww-text",0),S(3,"async"),l(4,"div",1),g(5,"ww-model-action-menu",2),S(6,"async"),l(7,"button",3),g(8,"ww-icon",4),r()()(),l(9,"ww-section-content",5),E(10,w_,1,1,"ww-settings-data-fields-details",6),S(11,"async"),r(),co(12,7),E(13,I_,2,1,"ww-section-actions"),S(14,"async"),po(),r()),i&2){let n,u;s(2),m("truncate",!0)("content",T(3,5,o.title$)),s(3),m("actions",T(6,7,o.menuActions$)),s(5),f((n=T(11,9,o._entity$))?10:-1,n),s(3),f((u=T(14,11,o.footerActions$))?13:-1,u)}},dependencies:[X,$u,H,Ui,Ze,M,Se,ze,fo,wo,Co,ho,go,L],encapsulation:2,changeDetection:0})}}return t})();function b_(t,a){t&1&&te(0)}function N_(t,a){if(t&1){let e=V();l(0,"ww-display-object-key"),k(1),r(),l(2,"ww-display-object-value",8),N("edit",function(){let o=D(e).$implicit,n=d(),u=d();return G(u.onEdit(n.key,o.key))}),$(3,b_,1,0,"ng-container",9),r()}if(t&2){let e=a.$implicit;s(),fe(e.label),s(),m("editable",!0),s(),m("wwOutlet",e.value)}}function O_(t,a){if(t&1&&(l(0,"ww-display-object"),ce(1,N_,4,3,null,null,xt),S(3,"async"),r()),t&2){let e=d();s(),pe(T(3,0,e.properties$))}}function R_(t,a){if(t&1){let e=V();l(0,"button",11),N("click",function(){D(e);let o=d();return G(o.editAction.api())}),w(1,0),r()}if(t&2){let e=d();s(),Ht(e.editAction.label),qt(1)}}function A_(t,a){t&1&&(l(0,"ww-section-actions"),E(1,R_,2,1,"button",10),r()),t&2&&(s(),f(a.editAction?1:-1))}var IM=ai(Ie),Gu=(()=>{class t extends q{constructor(){super(...arguments),this.key=null,this.key$=this.observe("key"),this.standardDataFields=c(xo),this.settingsDataFieldsService=c(Si),this.commonDisplay=c(ht),this.locationRx=c(v),this.queryParams=c(It),this.standardDataField$=this.key$.pipe(U(e=>e?this.standardDataFields.getField(e):Y(null))),this.properties$=this.standardDataField$.pipe(U(e=>{if(!e)return Y([]);let i=Li({content:$localize`Add`,$element:{color:"darkerGrey"}}),o=[{label:$localize`Name`,key:"name",value:e.name},{label:$localize`Registration type`,key:"registrationTypes",value:e.registrationTypes||i},{label:$localize`Required for`,key:"isRequired",value:e.requiredFor||i},{label:$localize`Access`,key:"access",value:e.access},{label:$localize`Status`,key:"isActive",value:this.commonDisplay.displayActiveBadge(e.isActive,$localize`To use this input field, activate it.`)}];return this.getFieldSpecificProperties(e).pipe(p(n=>[...o,...n]))})),this.title$=this.standardDataField$.pipe(p(e=>e?.name??"")),this.editAction$=this.standardDataField$.pipe(p(e=>e?{api:()=>{this.settingsDataFieldsService.openStandardEditor(e.key)},key:"edit",label:$localize`Edit`,icon:"bx-edit-alt"}:null)),this.menuActions$=this.standardDataField$.pipe(p(e=>e?[e.isActive?e.actions.deactivate:e.actions.activate]:[])),this.footerActions$=this.editAction$.pipe(p(e=>e?{editAction:e}:null))}getFieldSpecificProperties(e){return this.locationRx.getCurrentLocation(["showFirstLastName","maxPartySize","maxPartySizeBookings","quotedWaitIncrement"]).pipe(p(i=>e.key==="name"?[{label:$localize`Separate first and last name`,key:"showFirstLastName",value:this.commonDisplay.displayBoolean(i.showFirstLastName)}]:e.key==="partySize"?[{label:$localize`Max party size for waitlist`,key:"maxPartySize",value:i.maxPartySize},{label:$localize`Max party size for bookings`,key:"maxPartySizeBookings",value:i.maxPartySizeBookings}]:e.key==="quote"?[{label:$localize`Steps`,key:"quotedWaitIncrement",value:this.commonDisplay.displayDuration(i.quotedWaitIncrement)}]:[]))}onEdit(e,i){this.settingsDataFieldsService.openStandardEditor(e,i)}ngOnDestroy(){this.queryParams.update({remove:["viewDataFieldId"],disableEmitEvent:!0})}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-standard-data-fields-viewer"]],hostAttrs:[1,"ww-settings-standard-data-fields-viewer"],inputs:{entity:"entity",entityId:"entityId",disableEntityUpdates:"disableEntityUpdates",key:"key"},features:[O],decls:15,vars:13,consts:()=>{let e;return e=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `,[e,[3,"truncate","content"],[1,"flex","items-center"],[3,"actions"],["wwButton","tert
10iary","wwLayoutClose",""],["icon","bx-x"],["padding","large"],["ngProjectAs","ww-section-actions",5,["ww-section-actions"]],["wwLayoutClose","",3,"edit","editable"],[4,"wwOutlet"],["wwButton","primary","wwLayoutClose",""],["wwButton","primary","wwLayoutClose","",3,"click"]]},template:function(i,o){if(i&1&&(l(0,"ww-section")(1,"ww-section-title"),g(2,"ww-text",1),S(3,"async"),l(4,"div",2),g(5,"ww-model-action-menu",3),S(6,"async"),l(7,"button",4),g(8,"ww-icon",5),r()()(),l(9,"ww-section-content",6),E(10,O_,4,2,"ww-display-object"),S(11,"async"),r(),co(12,7),E(13,A_,2,1,"ww-section-actions"),S(14,"async"),po(),r()),i&2){let n,u;s(2),m("truncate",!0)("content",T(3,5,o.title$)),s(3),m("actions",T(6,7,o.menuActions$)),s(5),f((n=T(11,9,o.standardDataField$))?10:-1,n),s(3),f((u=T(14,11,o.footerActions$))?13:-1,u)}},dependencies:[X,H,Ui,Ze,M,Se,Di,xi,Pi,ze,ve,fo,wo,Co,ho,go,L],encapsulation:2,changeDetection:0})}}return t})();var Si=(()=>{class t{constructor(){this.layout=c(le),this.router=c(Ve),this.searchSub=new Ot(null),this.search$=this.searchSub.asObservable()}search(e){this.searchSub.next(e)}openViewer(e){this.layout.open({component:_(Du,e)})}openStandardViewer(e){this.layout.open({component:_(Gu,{key:e})})}openEditor(e,i=null){this.router.navigate(["/settings/input-fields/edit"],{queryParams:{dataFieldId:e.id,key:i}})}openStandardEditor(e,i=null){this.router.navigate([`/settings/standard-fields/${e}`],{queryParams:{key:i}})}openCreateEditor(){this.router.navigate(["/settings/input-fields/create"])}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var va=(()=>{class t extends pi{constructor(){super(...arguments),this.copyDataFieldWrite=c(bc),this.coreLocationRx=c($e),this.coreUserRx=c(No),this.deleteDataFieldWrite=c(Oc),this.dialog=c(Ae),this.settingsDataFieldsService=c(Si),this.updateDataFieldWrite=c(pa)}createActions(e){let i=e.locationIds.length>1,o=this.coreUserRx.getMissingLocationIds(e.locationIds).pipe(fs({refCount:!0,bufferSize:1}));return{edit:o.pipe(p(n=>({api:()=>{n.length>0?this.notifyMissingLocationIds($localize`Cannot edit input field`,n):this.settingsDataFieldsService.openEditor(e)},label:$localize`Edit`,icon:"bx-edit-alt",eventLoggerName:"edit_data_field_opened",disabled:!1,enabledConfig:{permissions:["data-fields.update"]}}))),duplicate:Y(e).pipe(p(n=>i?null:{api:()=>{this.copyDataFieldWrite.payload.next({dataField:n,type:"copy"})},label:$localize`Duplicate`,icon:"bx-copy",disabled:n.locationIds.length>1,enabledConfig:{permissions:["data-fields.create"]}})),makeLocalCopy:Y(e).pipe(p(n=>i?{api:()=>{this.copyDataFieldWrite.payload.next({dataField:n,type:"local-copy"})},label:$localize`Make local copy`,icon:"bx-copy",disabled:n.locationIds.length===1,enabledConfig:{permissions:["data-fields.create"]}}:null)),activate:o.pipe(p(n=>({api:()=>{n.length>0?this.notifyMissingLocationIds($localize`Cannot activate input field`,n):this.updateDataFieldWrite.payload.next({id:e.id,updates:{isActive:!0}})},label:$localize`Activate`,icon:"bx-show",enabledConfig:{permissions:["data-fields.update"]},disabled:!1}))),deactivate:o.pipe(p(n=>({api:()=>{n.length>0?this.notifyMissingLocationIds($localize`Cannot deactivate input field`,n):this.updateDataFieldWrite.payload.next({id:e.id,updates:{isActive:!1}})},label:$localize`Deactivate`,icon:"bx-hide",enabledConfig:{permissions:["data-fields.update"]},disabled:!1}))),removeFromCurrentLocation:this.coreLocationRx.nullableLocationId$.pipe(p(n=>!i||!n?null:{api:()=>{this.updateDataFieldWrite.payload.next({id:e.id,updates:{removeLocationIds:[n]}})},label:$localize`Remove from location`,disabled:e.locationIds.length===1,icon:"bx-minus-circle",enabledConfig:{permissions:["data-fields.update"]}})),delete:o.pipe(p(n=>({api:()=>{n.length>0?this.notifyMissingLocationIds($localize`Cannot delete input field`,n):this.deleteDataFieldWrite.payload.next(e.id)},label:$localize`Delete`,icon:"bx-trash",color:"warning",type:"warning",enabledConfig:{permissions:["data-fields.delete"]},disabled:!1})))}}notifyMissingLocationIds(e,i){this.dialog.open(_(vp,{title:e,missingLocationIds:i,entityName:$localize`input field`}))}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $_=ai(Ie),ku=(()=>{class t extends $_{constructor(){super(...arguments),this.settingsDataFieldsActions=c(va),this.actions$=this._entity$.pipe(U(e=>e?this.settingsDataFieldsActions.getActions(e,{omit:e.isActive?["activate"]:["deactivate"]}
10):Y([])))}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-data-fields-actions"]],hostAttrs:[1,"ww-settings-data-fields-actions"],inputs:{disableEntityUpdates:"disableEntityUpdates",entity:"entity",entityId:"entityId"},features:[O],decls:2,vars:4,consts:[[3,"actions","label"]],template:function(i,o){i&1&&(g(0,"ww-model-action-menu",0),S(1,"async")),i&2&&m("actions",T(1,2,o.actions$))("label",o._latestEntity==null?null:o._latestEntity.name)},dependencies:[Le,Ao,Ze,M,L],encapsulation:2,changeDetection:0})}}return t})();var Wu={pageIndex:0,pageSize:20,length:20},zu=200,Bu=50;var L_=["actionsMenuTmpl"];function v_(t,a){if(t&1){let e=V();l(0,"div",2)(1,"h4"),w(2,1),r(),l(3,"ww-table",3),S(4,"async"),N("rowClicked",function(o){D(e);let n=d();return G(n.onRowClicked(o))}),r()()}if(t&2){let e=d();s(3),m("flex",!0)("data",T(4,5,e.items$))("columns",e.columns)("pluckCellLabel",e.pluckCellLabel)("pluckActions",e.pluckActions)}}function F_(t,a){if(t&1&&g(0,"ww-model-action-menu",4),t&2){let e=a.$implicit;m("actions",e.actions)("label",e.dataField.name)}}var Uu=(()=>{class t extends q{constructor(){super(...arguments),this.commonDisplay=c(ht),this.settingsDataFieldsService=c(Si),this.standardDataFields=c(xo),this.pluckActions=()=>this.actionsMenuTmpl,this.items$=A([this.standardDataFields.fields$,this.settingsDataFieldsService.search$]).pipe(p(([e,i])=>Qo(e,o=>o.name,i??"").map(o=>{let n={api:()=>{this.settingsDataFieldsService.openStandardEditor(o.key)},key:"edit",label:$localize`Edit`,icon:"bx-edit-alt"};return{dataField:o,actions:[n,o.isActive?o.actions.deactivate:o.actions.activate]}})),this.shareReplay()),this.hasItems$=this.items$.pipe(p(e=>e.length>0)),this.columns=[{key:"name",label:$localize`Name`},{key:"registrationTypes",label:$localize`Registration type`},{key:"requiredFor",label:$localize`Required for`},{key:"access",label:$localize`Access`},{key:"locations",label:$localize`Locations`},{key:"isActive",label:$localize`Status`}],this.pluckCellLabel=e=>({name:this.commonDisplay.displayDataFieldName(e.dataField.name,{icon:e.dataField.icon}),registrationTypes:e.dataField.registrationTypes,requiredFor:e.dataField.requiredFor,access:e.dataField.access,locations:this.commonDisplay.displayLocationSharingBadge(1),isActive:this.commonDisplay.displayActiveBadge(e.dataField.isActive,$localize`To use this input field, activate it.`)})}onRowClicked(e){this.settingsDataFieldsService.openStandardViewer(e.dataField.key)}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-standard-data-fields-table"]],viewQuery:function(i,o){if(i&1&&ti(L_,7),i&2){let n;ii(n=oi())&&(o.actionsMenuTmpl=n.first)}},features:[O],decls:4,vars:3,consts:()=>{let e;return e=$localize`Default input fields`,[["actionsMenuTmpl",""],e,[1,"flex","flex-col","gap-2"],[3,"rowClicked","flex","data","columns","pluckCellLabel","pluckActions"],[3,"actions","label"]]},template:function(i,o){i&1&&(E(0,v_,5,7,"div",2),S(1,"async"),$(2,F_,1,2,"ng-template",null,0,me)),i&2&&f(T(1,1,o.hasItems$)?0:-1)},dependencies:[M,si,H,Ze,L],encapsulation:2,changeDetection:0})}}return t})();var D_=()=>["id"];function G_(t,a){if(t&1){let e=V();l(0,"ww-paginator",8),S(1,"async"),N("page",function(o){D(e);let n=d(2);return G(n.pageEventSub.next(o))}),r()}if(t&2){let e=d(2);m("pageIndex",e.pageEventSub.value.pageIndex)("pageSize",e.pageEventSub.value.pageSize)("length",T(1,3,e.pageLength$))}}function k_(t,a){if(t&1){let e=V();l(0,"div",5)(1,"h4"),w(2,2),r(),l(3,"ww-table",6),S(4,"async"),S(5,"async"),S(6,"async"),S(7,"async"),S(8,"async"),N("rowClicked",function(o){D(e);let n=d();return G(n.onRowClicked(o))}),r(),E(9,G_,2,5,"ww-paginator",7),S(10,"async"),r()}if(t&2){let e=d(),i=ie(7);s(3),m("flex",!0)("selection",T(4,10,e.selection$))("data",T(5,12,e.dataFieldIds$))("columns",T(6,14,e.columns$))("trackByProperty",At(22,D_))("formControl",e.formControl)("pluckCellLabel",T(7,16,e.pluckCellLabel$))("pluckActions",T(8,18,e.pluckActions$))("placeholder",i),s(6),f(T(10,20,e.canPaginate$)?9:-1)}}function W_(t,a){t&1&&g(0,"ww-empty-state",9)}function z_(t,a){if(t&1&&(E(0,W_,1,0,"ww-empty-state",9),S(1,"async")),t&2){let e=d();f(T(1,1,e.isLoaded$)?0:-1)}}function B_(t,a){if(t&1&&(g(0,"ww-model-action-menu",10),S(1,"async")),t&2){let e=a.$implicit;m("actions",T(1,1,e.actions$))}}var Vu=(()=>{class t extends q{constructor(){super(),this.layout=c(le),this.batchUpdateDataFieldWrite=c(ca),this.coreDataFieldsRx=c(fi),this.dataFieldProperties=c(ya),this.commonDisplay=c(ht),this.settingsDataFieldsService=c(Si),this.batchSett
10ingsDataFieldsActions=c(Cu),this.pageEventSub=new Ot(Wu),this.listQuery$=Y({}),this.searchQuery$=this.settingsDataFieldsService.search$.pipe(bi(zu),Re(null),Tt(),p(e=>e?{q:e,limit:Bu}:null),this.shareReplay()),this.canPaginate$=this.searchQuery$.pipe(p(e=>!e)),this.dataFieldsPage$=this.listQuery$.pipe(U(e=>cl(this.pageEventSub,i=>this.coreDataFieldsRx.listForCurrentLocation(y(y({},i),e)))),p(e=>e.results??[]),this.shareReplay()),this.searchedDataFields$=this.searchQuery$.pipe(U(e=>e?this.coreDataFieldsRx.searchForCurrentLocation(e):Y([])),p(e=>e??[]),this.shareReplay()),this.pageLength$=pl(this.dataFieldsPage$,this.pageEventSub),this.dataFields$=this.searchQuery$.pipe(U(e=>e?this.searchedDataFields$:this.dataFieldsPage$),this.shareReplay()),this.dataFieldRecord$=this.dataFields$.pipe(p(e=>Xs(e,i=>i.id)),this.shareReplay()),this.dataFieldIds$=this.dataFields$.pipe(p(e=>e.map(i=>i.id)),this.shareReplay()),this.pluckActions$=this.dataFieldRecord$.pipe(p(e=>i=>_(ku,{entity:e[i]}))),this.hasCustomDataFields$=this.dataFields$.pipe(p(e=>e.length>0)),this.properties$=this.dataFieldProperties.getCurrentPermittedProperties({pick:["name","registrationTypes","requiredFor","access","locationIds","isActive"]}),this.isLoaded$=this.dataFields$.pipe(De(1),p(()=>!0),Re(!1)),this.columns$=this.properties$.pipe(p(e=>Bi(e))),this.pluckCellLabel$=A([this.dataFieldRecord$,this.properties$]).pipe(p(([e,i])=>o=>{let n=e[o],u=Sc(i,{name:{display:()=>this.commonDisplay.displayDataFieldName(n.name,{icon:Nl[n.inputType]})}});return zi(n,u)})),this.getBatchActions=e=>this.dataFieldRecord$.pipe(U(i=>{let o=e.map(u=>i[u]),n=["activate","deactivate","delete"];return o.every(u=>u)&&(o.some(u=>u.isActive)||n.splice(n.indexOf("deactivate"),1),o.some(u=>!u.isActive)||n.splice(n.indexOf("activate"),1)),this.batchSettingsDataFieldsActions.getActions(e,{pick:n})})),this.formControl=new C([],{nonNullable:!0}),this.batchActions$=this.dataFieldIds$.pipe(U(e=>this.getBatchActions(e))),this.selection$=this.batchActions$.pipe(p(e=>e.length>0?"multiple":"single")),this.layout.updateFeatureContext({addActions:[{label:$localize`Create input field`,api:()=>this.settingsDataFieldsService.openCreateEditor(),enabled:{permissions:["data-fields.create"]},eventLoggerName:"opened_create_data_field"}],batchActions:{data$:this.dataFieldIds$,formControl:this.formControl,pageEvent$:this.pageEventSub,getActions:e=>this.getBatchActions(e),getAll:()=>R(this,null,function*(){let e=yield b(this.searchQuery$);if(e)return b(this.coreDataFieldsRx.searchIdsForCurrentLocation(e));let i=yield b(this.listQuery$);return b(this.coreDataFieldsRx.listIdsForCurrentLocation(i))})}}),this.subscribeToBatchEvents(),this.subscribeToQueryParams()}onRowClicked(e){this.settingsDataFieldsService.openViewer({entityId:e})}subscribeToBatchEvents(){this.batchUpdateDataFieldWrite.response$.pipe(z(this.ngOnDestroy$)).subscribe(()=>this.formControl.setValue([]))}subscribeToQueryParams(){Ri().pipe(z(this.ngOnDestroy$)).subscribe(e=>{e.viewDataFieldId&&this.settingsDataFieldsService.openViewer({entityId:e.viewDataFieldId})})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-data-fields"]],hostAttrs:[1,"ww-settings-data-fields"],features:[O],decls:10,vars:4,consts:()=>{let e;e=$localize`Custom input fields`;let i;return i=$localize`No input fields found`,[["emptyStateTmpl",""],["actionsMenuTmpl",""],e,[1,"flex","flex-col","gap-8"],[3,"searchChanged","defaultState"],[1,"flex","flex-col","gap-2"],[3,"rowClicked","flex","selection","data","columns","trackByProperty","formControl","pluckCellLabel","pluckActions","placeholder"],[1,"mt-4",3,"pageIndex","pageSize","length"],[1,"mt-4",3,"page","pageIndex","pageSize","length"],["message",i,"icon","ww-empty-state"],[3,"actions"]]},template:function(i,o){i&1&&(l(0,"div",3)(1,"ww-page-toolbar")(2,"ww-page-search",4),N("searchChanged",function(u){return o.settingsDataFieldsService.search(u)}),r()(),g(3,"ww-settings-standard-data-fields-table"),E(4,k_,11,23,"div",5),S(5,"async"),r(),$(6,z_,2,3,"ng-template",null,0,me)(8,B_,2,3,"ng-template",null,1,me)),i&2&&(s(2),m("defaultState","expanded"),s(2),f(T(5,2,o.hasCustomDataFields$)?4:-1))},dependencies:[X,oe,ne,H,Vi,Ze,ga,Ia,Uu,M,ec,si,L],encapsulation:2,changeDetection:0})}}return t})();var Xu=(()=>{class t{constructor(){this.internalLinks=c(Me)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-integrations-facebook"]],hostAttrs:[1,"ww-settings-integrations-facebook","h-full"],decls:21,vars:4,consts:()=>{let e;e=$localize`Facebook integrations`;let i;i=$localize`Add a Book Now Button to Facebook`;let o;o=$localize` Sign into Facebook. On your Facebook business page, click the "Add a Button" button. `;let n;n=$localize` A dialog box will appear asking "What would you like people to do from your Page?" From the "Get in touch" menu, choose Sign-up`;let u;u=$localize` Paste ${"\uFFFD#14\uFFFD"}:START_TAG_PRE:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_PRE: in the field. `;let h;h=$localize`Click the "Add Button" at the bottom and you're done!`;let x;return x=$localize`Close`,[i,o,n,u,h,x,[1,"p-6","pl-10"],[1,"list-decimal","list-outside"],[1,"mb-4"],["src","/assets/images/sett
10ings-integrations-facebook-instructions.png","alt",e],["wwBackgroundColor","mediumGrey",1,"inline","p-1","rounded","text-sm"],[3,"hideCancel"],["wwButton","","type","button","matDialogClose",""]]},template:function(i,o){i&1&&(l(0,"ww-dialog-layout")(1,"ww-dialog-layout-title"),w(2,0),r(),l(3,"ww-dialog-layout-content")(4,"div",6)(5,"ol",7)(6,"li",8),w(7,1),r(),l(8,"li",8)(9,"span"),w(10,2),r(),g(11,"img",9),r(),l(12,"li",8),tt(13,3),g(14,"pre",10),S(15,"async"),it(),r(),l(16,"li"),w(17,4),r()()()(),l(18,"ww-dialog-layout-actions",11)(19,"button",12),w(20,5),r()()()),i&2&&(s(15),Ht(T(15,2,o.internalLinks.publicRegistrationUrl$)),qt(13),s(3),m("hideCancel",!0))},dependencies:[Le,H,M,Ul,Se,Je,Vl,jn,Kn,Yn,L],encapsulation:2,changeDetection:0})}}return t})();function H_(t,a){if(t&1&&(l(0,"ww-card",2)(1,"div",4),g(2,"zapier-workflow",5),S(3,"async"),S(4,"async"),S(5,"async"),r()()),t&2){let e=d();s(2),m("signUpEmail",T(3,6,e.userEmail$))("signUpFirstName",T(4,8,e.userFirstName$))("signUpLastName",T(5,10,e.userLastName$))("clientId",e.environment.zapierId)("theme","light")("introCopyDisplay","show")}}function q_(t,a){if(t&1){let e=V();l(0,"ww-card",3)(1,"div",6)(2,"div",7),g(3,"img",8),r(),l(4,"div",9)(5,"p"),tt(6,0),g(7,"a",10),it(),r(),l(8,"div")(9,"button",11),N("click",function(){D(e);let o=d();return G(o.internalLinks.navigateToUpgrade())}),g(10,"ww-icon",12),l(11,"span"),w(12,1),r()()()()()()}t&2&&(s(9),m("wwEventLogger","opened_change_plan"))}var Hu=(()=>{class t extends q{constructor(){super(...arguments),this.accountRx=c(Ue),this.scriptManager=c(Rl),this.styleManager=c(Ol),this.userRx=c(Gi),this.environment=c(Zo),this.internalLinks=c(Me),this.allowZapier$=this.accountRx.getAccount(["planSegment"]).pipe(p(({planSegment:e})=>this.environment.zapierId&&e!=="FREE")),this.user$=this.userRx.getCurrentUser(["email","name"]),this.userEmail$=this.user$.pipe(p(e=>e.email)),this.userFirstName$=this.user$.pipe(p(e=>e.name.split(" ")[0]??"")),this.userLastName$=this.user$.pipe(p(e=>e.name.split(" ")[1]??""))}ngOnInit(){this.scriptManager.attachScript("https://cdn.zapier.com/packages/partner-sdk/v0/zapier-elements/zapier-elements.esm.js","module"),this.styleManager.setStyle("https://cdn.zapier.com/packages/partner-sdk/v0/zapier-elements/zapier-elements.css")}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-integrations-zapier"]],hostAttrs:[1,"ww-settings-integrations-zapier","flex"],features:[O],decls:3,vars:3,consts:()=>{let e;e=$localize`Zapier integrations builder`;let i;i=$localize` You can now connect Waitwhile to more than 5,000 other apps using Zapier! ${"\uFFFD#7\uFFFD"}:START_LINK:See all apps${"\uFFFD/#7\uFFFD"}:CLOSE_LINK:. `;let o;return o=$localize`Upgrade to business`,[i,o,[1,"p-6","w-full"],[1,"p-6"],[1,"w-full","max-w-full"],[3,"signUpEmail","signUpFirstName","signUpLastName","clientId","theme","introCopyDisplay"],[1,"flex","gap-6"],[1,"pt-6"],["src","/assets/images/settings-integrations-zapier.png","alt",e],[1,"flex","flex-col","justify-center","gap-6"],["href","https://zapier.com/apps/waitwhile/integrations","target","_blank"],["wwButton","",3,"click","wwEventLogger"],["icon","bx-bolt-circle"]]},template:function(i,o){i&1&&(E(0,H_,6,12,"ww-card",2),S(1,"async"),Rt(2,q_,13,1,"ww-card",3)),i&2&&f(T(1,1,o.allowZapier$)?0:2)},dependencies:[Le,X,H,Fc,M,Se,Wl,ze,L],encapsulation:2,changeDetection:0})}}return t})();function j_(t,a){t&1&&te(0)}function K_(t,a){t&1&&te(0)}function Y_(t,a){if(t&1&&(l(0,"ww-sublabel"),$(1,K_,1,0,"ng-container",11),r()),t&2){let e=d(2);s(),m("wwOutlet",e.sublabel)}}function Q_(t,a){if(t&1&&(l(0,"ww-label"),$(1,j_,1,0,"ng-container",11),E(2,Y_,2,1,"ww-sublabel"),r()),t&2){let e=d();s(),m("wwOutlet",e.label),s(),f(e.sublabel?2:-1)}}function J_(t,a){t&1&&(l(0,"div",12)(1,"span"),w(2,1),r(),g(3,"ww-icon",13),r())}function Z_(t,a){t&1&&(l(0,"ww-form-field-error",10),k(1),S(2,"error"),r()),t&2&&(s(),Ke(" ",T(2,1,a)," "))}var eS=vi(lt(Ie)),qu=(()=>{class t extends eS{constructor(){super(...arguments),this.formGroup=new F({zero:new C(null),one:new C(null),two:new C(null),few:new C(null),many:new C(null),other:new C(null)}),this.zero$=Q(this.formGroup.controls.zero),this.one$=Q(this.formGroup.controls.one),this.two$=Q(this.formGroup.controls.two),this.few$=Q(this.formGroup.controls.few),this.many$=Q(this.formGroup.controls.many),this.other$=Q(this.formGroup.controls.other),this.value$=A([this.zero$,this.one$,this.two$,this.few$,this.many$,this.other$]).pipe(p(([e,i,o,n,u,h])=>{let x=["count, plural,"];return e&&x.push(`zero {${e}}`),i&&x.push(`one {${i}}`),o&&x.push(`two {${o}}`),n&&x.push(`few {${n}}`),u&&x.push(`many {${u}}`),h&&x.push(`other {${h}}`),x.length<2?null:`{${x.join(" ")} }`}))}writeValue(e){return R(this,null,function*(){let i=zs(e),o=Fn(i)&&e&&e.length>0?e:null;this.formGroup.controls.zero.setValue(i?.zero??o,{emitEvent:!1}),this.formGroup.controls.one.setValue(i?.one??o,{emitEvent:!1}),this.formGroup.controls.two.setValue(i?.two??o,{emitEvent:!1}),this.formGroup.controls.few.setValue(i?.few??o,{emitEvent:!1}),this.formGroup.controls.many.setValue(i?.many??o,{emitEvent:!1}),this.formGroup.controls.other.setValue(i?.other??o,{emitEvent:!1})})}registerOnChange(e){this.value$.pipe(Ee(()=>this.formGroup.dirty),z(this.ngOnDestroy$)).subscribe(e)}registerOnTouched(){}setDisabledState(e){e?this.formGroup.disable():this.formGroup.enable()}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-icu-plural-editor"]],hostAttrs:[1,"ww-icu-plural-editor"],inputs:{hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoF
10ocus:"autoFocus"},features:[O],decls:13,vars:30,consts:()=>{let e;e=$localize`Enter zero form`;let i;i=$localize`Enter singular form`;let o;o=$localize`Enter pluralized form`;let n;n=$localize`Enter pluralized form`;let u;u=$localize`Enter pluralized form`;let h;h=$localize`Enter fallback form`;let x;return x=$localize`other`,[["otherLabel",""],x,[3,"layout"],[3,"wwFormFieldSize"],["type","text","layout","vertical","placeholder",e,3,"appearance","size","prefixComponent","formControl"],["type","text","layout","vertical","placeholder",i,3,"appearance","size","prefixComponent","formControl"],["type","text","layout","vertical","placeholder",o,3,"appearance","size","prefixComponent","formControl"],["type","text","layout","vertical","placeholder",n,3,"appearance","size","prefixComponent","formControl"],["type","text","layout","vertical","placeholder",u,3,"appearance","size","prefixComponent","formControl"],["type","text","layout","vertical","placeholder",h,3,"appearance","size","prefixComponent","formControl"],[1,"py-1","px-3","whitespace-nowrap"],[4,"wwOutlet"],[1,"flex","flex-row","items-center","gap-1"],["icon","bx-help-circle","size","x-small","color","darkerGrey","wwTooltip","If the language does not have a specific rule for the plural form, or no matching translations has been entered, this value will be used."]]},template:function(i,o){if(i&1&&(l(0,"ww-label-layout",2),E(1,Q_,3,2,"ww-label"),l(2,"div",3),g(3,"ww-input",4)(4,"ww-input",5)(5,"ww-input",6)(6,"ww-input",7)(7,"ww-input",8)(8,"ww-input",9),$(9,J_,4,0,"ng-template",null,0,me),E(11,Z_,3,3,"ww-form-field-error",10),S(12,"async"),r()()),i&2){let n,u=ie(10);m("layout","vertical"),s(),f(o.label?1:-1),s(),m("wwFormFieldSize","large"),s(),m("appearance","tertiary")("size","full")("prefixComponent","zero")("formControl",o.formGroup.controls.zero),s(),m("appearance","tertiary")("size","full")("prefixComponent","one")("formControl",o.formGroup.controls.one),s(),m("appearance","tertiary")("size","full")("prefixComponent","two")("formControl",o.formGroup.controls.two),s(),m("appearance","tertiary")("size","full")("prefixComponent","few")("formControl",o.formGroup.controls.few),s(),m("appearance","tertiary")("size","full")("prefixComponent","many")("formControl",o.formGroup.controls.many),s(),m("appearance","tertiary")("size","full")("prefixComponent",u)("formControl",o.formGroup.controls.other),s(3),f((n=T(12,28,o._errors$))?11:-1,n)}},dependencies:[M,$l,ft,We,ke,Xe,ze,Fe,ve,Ct,X,oe,ne,nl,L],styles:[`.ww-icu-plural-editor .ww-input{display:block}.ww-icu-plural-editor .ww-input+.ww-input{border-top:1px solid var(--ww-color-darkGrey)}.ww-icu-plural-editor .ww-form-field-prefix{border-right:1px solid var(--ww-color-darkGrey)}.ww-icu-plural-editor .ww-form-field-prefix{width:72px}.ww-icu-plural-editor .ww-form-field-control{padding:2px 9px 2px 12px}.ww-icu-plural-editor .ww-label-layout.ww-label-layout-horizontal{padding-bottom:0}
11/*noopicu-plural-editor.component-7NMBT55U.css.map */
12`],encapsulation:2,changeDetection:0})}}return t})();function iS(t,a){t&1&&te(0)}function oS(t,a){t&1&&te(0)}function nS(t,a){if(t&1&&(l(0,"ww-sublabel"),$(1,oS,1,0,"ng-container",2),r()),t&2){let e=d(2);s(),m("wwOutlet",e.sublabel)}}function aS(t,a){if(t&1&&(l(0,"ww-label"),$(1,iS,1,0,"ng-container",2),E(2,nS,2,1,"ww-sublabel"),r()),t&2){let e=d();s(),m("wwOutlet",e.label),s(),f(e.sublabel?2:-1)}}function rS(t,a){if(t&1&&g(0,"ww-flag",4),t&2){let e,i=d().$implicit,o=_e(0),n=d();m("country",o)("wwTooltip",(e=n.pluckCountry(i))==null?null:e.name)}}
12function sS(t,a){if(t&1&&(l(0,"span"),k(1),r()),t&2){let e=d().$implicit;s(),fe(e)}}function lS(t,a){if(t&1&&(Ye(0),l(1,"div",1)(2,"div",3),E(3,rS,1,2,"ww-flag",4)(4,sS,2,1,"span"),r(),g(5,"ww-icu-plural-editor",5),r()),t&2){let e,i=a.$implicit,o=d(),n=ot((e=o.pluckCountry(i))==null?null:e.cca2);s(3),f(n?3:4),s(2),m("formControl",o.formRecord.controls[i])}}var cS=vi(lt(Ie)),ju=(()=>{class t extends cS{constructor(){super(...arguments),this.formRecord=new uo({}),this.pluckCountry=e=>vn(e),this.writeValueSub=new Rn(1)}validate(){return this.formRecord.invalid?{invalid:!0}:null}writeValue(e){this.writeValueSub.next(e)}registerOnChange(e){this.formRecord.valueChanges.pipe(Ee(()=>this.formRecord.dirty),p(()=>this.formRecord.getRawValue()),z(this.ngOnDestroy$)).subscribe(e)}registerOnTouched(){}setDisabledState(e){e?this.formRecord.disable():this.formRecord.enable()}addFormRecordControls(e){for(let i of e)this.formRecord.controls[i]||this.formRecord.addControl(i,new C("",{nonNullable:!0,validators:[gt.i18nTerm]}),{emitEvent:!1})}ngOnInit(){let e=this.locales??[];this.addFormRecordControls(e),this.writeValueSub.pipe(z(this.ngOnDestroy$)).subscribe(i=>{for(let o of e)this.formRecord.controls[o]?.setValue(i?.[o]??"",{emitEvent:!1})})}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-business-term-editor"]],hostAttrs:[1,"ww-business-term-editor"],inputs:{hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoFocus:"autoFocus",locales:"locales"},features:[O],decls:5,vars:1,consts:[[1,"flex","flex-row","gap-3","flex-wrap","max-w-full"],[1,"ww-business-term-editor-entry"],[4,"wwOutlet"],[1,"ww-business-term-editor-locale"],[3,"country","wwTooltip"],[1,"ww-business-term-editor-editor",3,"formControl"]],template:function(i,o){i&1&&(l(0,"ww-label-layout"),E(1,aS,3,2,"ww-label"),l(2,"div",0),ce(3,lS,6,3,"div",1,je),r()()),i&2&&(s(),f(o.label?1:-1),s(2),pe(o.locales))},dependencies:[X,oe,ne,vo,M,Un,We,ke,Xe,ve,Ct,qu],styles:[`.ww-business-term-editor .ww-business-term-editor-entry{display:flex;width:100%;min-width:0;max-width:400px}.ww-business-term-editor .ww-business-term-editor-entry .ww-business-term-editor-locale{font-family:var(--ww-typography-body2-font-family);font-size:var(--ww-typography-body2-font-size);font-weight:var(--ww-typography-body2-font-weight);line-height:var(--ww-typography-body2-line-height);letter-spacing:var(--ww-typography-body2-letter-spacing);display:flex;flex-direction:column;align-items:center;padding:10px 0;background-color:var(--ww-color-lighterGrey);border:1px solid var(--ww-color-darkGrey);border-radius:8px 0 0 8px;min-width:60px;width:60px}.ww-business-term-editor .ww-business-term-editor-entry .ww-business-term-editor-editor{display:flex;min-width:0;max-width:100%;width:100%;border:1px solid var(--ww-color-darkGrey);border-left:0;border-radius:0 8px 8px 0}.ww-business-term-editor .ww-business-term-editor-entry .ww-business-term-editor-editor>.ww-label-layout.ww-label-layout-horizontal{border-bottom:0}
13/*noopbusiness-term-editor.component-VXWNLYJ7.css.map */
14`],encapsulation:2,changeDetection:0})}}return t})();var Ku={customerTerm:$localize`Customer`,visitTerm:$localize`Visit`,partyTerm:$localize`Party`,draftStateTerm:$localize`Needs approval`,bookedStateTerm:$localize`Booking`,waitingStateTerm:$localize`Waiting`,servingStateTerm:$localize`Serving`,completeStateTerm:$localize`Complete`},Yu={customerTerm:$localize`Set if you refer to a customer as "client", "patient", "guest”, or something else.`,visitTerm:$localize`Set if you refer to a visit as something else.`,partyTerm:$localize`Set if you refer to a party (of customers) as something else.`,draftStateTerm:$localize`Set if you refer to needs approval as "unconfirmed", "needs consent", or something else.`,bookedStateTerm:$localize`Set if you refer to a booking as "appointment", "reservation", or something else.`,waitingStateTerm:$localize`Set if you refer to the waitlist as "queue", "line", or something else.`,servingStateTerm:$localize`Set if you refer to the serving as "handled", "seated" or something else.`,completeStateTerm:$localize`Set if you refer to the completed as "done", "finished" or something else.`},Qu=10;function pS(t,a){t&1&&k(0),t&2&&Ke(" ",a,". ")}function uS(t,a){if(t&1&&(l(0,"ww-info-bubble",1)(1,"span")(2,"span"),w(3,0),r(),l(4,"span"),E(5,pS,1,1),S(6,"async"),r(),g(7,"ww-link",4),r()()),t&2){let e,i=d(),o=_e(2);s(3),Ht(o.languageName)(o.countryCode),qt(3),s(2),f((e=T(6,5,i.publicLocalesLabel$))?5:-1,e),s(2),m("inline",!0)("href","/user")}}function mS(t,a){if(t&1&&(g(0,"ww-business-term-editor",3),S(1,"async")),t&2){let e=a.$implicit,i=d();m("label",i.pluckTermLabel(e))("sublabel",i.pluckTermSublabel(e))("locales",T(1,4,i.publicLocales$))("formControl",i.form.controls[e])}}var Zu=(()=>{class t extends q{constructor(){super(),this.coreLocationRx=c($e),this.layout=c(le),this.pendingChangesStore=c(ct),this.userRx=c(Gi),this.updateLocationWrite=c(Te),this.formId="settings-localization-business-terms",this.breadcrumbs=[yi,{name:$localize`Localization`,routerLink:"/settings/localization"}],this.publicLocales$=this.coreLocationRx.currentLocationSnapshot$.pipe(p(e=>e?e.publicLocales??[]:[])),this.publicLocalesLabel$=this.publicLocales$.pipe(p(e=>e.length>Qu?null:`The location languages are ${xn(e.map(i=>$t(i)).filter(se).map(i=>`${i.languageName}
14 (${i.countryCode})`),$localize`and`)}`)),this.userLocaleCode$=this.userRx.getCurrentUser(["locale"]).pipe(p(e=>e.locale)),this.userLocale$=this.userLocaleCode$.pipe(p(e=>$t(e))),this.userHaveUnsupportedLocale$=A([this.publicLocales$,this.userLocaleCode$]).pipe(p(([e,i])=>Gt(i)&&Ws(Gt)(e)?!e.includes(i):!1)),this.terms=["customerTerm","visitTerm","partyTerm","draftStateTerm","bookedStateTerm","waitingStateTerm","servingStateTerm","completeStateTerm"],this.form=new uo({}),this.pluckTermLabel=e=>Ku[e],this.pluckTermSublabel=e=>Yu[e],this.layout.setFeatureContext({name:$localize`Business terms`,breadcrumbs:this.breadcrumbs,pendingChanges:{formId:this.formId,reset:()=>R(this,null,function*(){let e=yield b(this.coreLocationRx.currentLocationSnapshot$);if(e)return this.reset(e)}),save:()=>this.save(),store:this.pendingChangesStore,enabledConfig:{permissions:["locations.update"]}}}),this.subscribe()}save(){return R(this,null,function*(){let e=yield b(this.coreLocationRx.nullableLocationId$);if(!e)return;let i={};for(let[o,n]of Object.entries(this.form.getRawValue()))for(let[u,h]of Object.entries(n))h&&(i[u]=i[u]??{},i[u][o]=h);this.updateLocationWrite.payload.next({locationId:e,updates:{i18n:i}})})}reset(e){return R(this,null,function*(){this.form.reset();for(let i of this.terms){let o=this.form.get(i);o&&o.setValue(this.createTermValue(i,e),{emitEvent:!1})}this.form.markAsPristine(),this.form.updateValueAndValidity()})}subscribe(){this.coreLocationRx.currentLocationSnapshot$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{for(let i of Object.keys(this.form.controls))this.form.removeControl(i);if(e){for(let i of this.terms)this.form.addControl(i,new C(this.createTermValue(i,e),{nonNullable:!0}));this.reset(e)}})}createTermValue(e,i){let o={};for(let n of i.publicLocales??[])o[n]=i.i18n?.[n]?.[e]??"";return o}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-localization-business-terms"]],hostAttrs:[1,"ww-settings-localization-business-terms","flex","flex-col","gap-6"],features:[O],decls:10,vars:11,consts:()=>{let e;e=$localize`Change your locale here.`;let i;return i=$localize` Your selected language ${"\uFFFD0\uFFFD"}:INTERPOLATION: (${"\uFFFD1\uFFFD"}:INTERPOLATION_1:) is not supported by the current location. `,[i,[1,"w-full","max-w-full"],[1,"flex","flex-col","gap-6",3,"wwForm","wwTrackPendingChanges","wwTrackPendingChangesUntil"],[3,"label","sublabel","locales","formControl"],["content",e,"type","router-link",3,"inline","href"]]},template:function(i,o){if(i&1&&(Ye(0),S(1,"async"),Ye(2),S(3,"async"),Ye(4),S(5,"async"),E(6,uS,8,7,"ww-info-bubble",1),l(7,"form",2),ce(8,mS,2,6,"ww-business-term-editor",3,je),r()),i&2){let n=T(1,4,o.publicLocales$);s(2);let u=ot(T(3,6,o.userLocale$)),h=T(5,9,o.userHaveUnsupportedLocale$);s(4),f(n&&u&&h?6:-1),s(),m("wwForm",o.formId)("wwTrackPendingChanges",o.form)("wwTrackPendingChangesUntil",o.updateLocationWrite.response$),s(),pe(o.terms)}},dependencies:[X,Dt,oe,yt,ne,ni,H,pt,vo,M,kt,He,bt,ju,L],encapsulation:2,changeDetection:0})}}return t})();var em=(t,a)=>a.id;function dS(t,a){if(t&1&&(l(0,"ww-sublabel"),k(1),r()),t&2){let e=d().$implicit;s(),fe(e.sublabel)}}function _S(t,a){if(t&1&&g(0,"ww-flag",5),t&2){d();let e=_e(0),i=d().$implicit;m("country",e)("wwTooltip",i.country==null?null:i.country.name)}}function SS(t,a){if(t&1&&g(0,"ww-language-code",6),t&2){let e=d(2).$implicit,i=d().$implicit,o=d();m("languageCode",e.id)("translated",!!o[e.id].controls[i.id].value)}}function TS(t,a){if(t&1&&(Ye(0),E(1,_S,1,2,"ww-flag",5)(2,SS,1,2,"ww-language-code",6)),t&2){let e=d().$implicit,i=ot(e.country==null?null:e.country.cca2);s(),f(i?1:2)}}function gS(t,a){if(t&1&&(g(0,"ww-textarea",4),$(1,TS,3,2,"ng-template",null,0,me)),t&2){let e=a.$implicit,i=ie(2),o=d().$implicit,n=d();m("minRows",2)("layout","vertical")("suffixComponent",i)("formControl",n[e.id].controls[o.id])("placeholder",o.placeholder)}}function ES(t,a){if(t&1&&(l(0,"ww-label-layout")(1,"ww-label"),k(2),E(3,dS,2,1,"ww-sublabel"),r(),l(4,"div",3),ce(5,gS,3,5,null,null,em),S(7,"async"),r()()),t&2){let e=a.$implicit,i=d(2);s(2),Ke(" ",e.label," "),s(),f(e.sublabel?3:-1),s(2),pe(T(7,2,i.publicLocaleItems$))}}
14function fS(t,a){if(t&1&&(l(0,"div",2),ce(1,ES,8,4,"ww-label-layout",null,em),r()),t&2){let e=d();s(),pe(e.customerEmailTerms)}}var tm=(()=>{class t extends q{constructor(){super(),this.layout=c(le),this.pendingChangesStore=c(ct),this.updateLocationWrite=c(Te),this.locationRx=c(v),this.formId="email-localization-form",this.customerEmails=$localize`Customer emails`,this.customerEmailTerms=[{id:"customerEmailViewWaitlistStatusLabel",label:$localize`View status`,sublabel:$localize`This label is displayed in the email sent to the customer when they join the waitlist.`,placeholder:"View status"},{id:"customerEmailViewBookingStatusLabel",label:$localize`Manage booking`,sublabel:$localize`This label is displayed in the booking confirmation email sent to the customer.`,placeholder:"Manage booking"},{id:"customerEmailAddToCalendarLabel",label:$localize`Add to calendar`,sublabel:$localize`This label is displayed in the booking confirmation email sent to the customer.`,placeholder:"Add to calendar"}],this.response$=this.updateLocationWrite.response$.pipe(p(()=>!0)),this.publicLocales$=this.locationRx.getCurrentLocation(["publicLocales"]).pipe(p(e=>e.publicLocales??[]),De(1),this.shareReplay()),this.publicLocaleItems$=this.publicLocales$.pipe(p(e=>e.map(i=>({id:i,locale:$t(i),country:vn(i)}))),this.shareReplay()),this.initialI18n$=this.locationRx.getCurrentLocation(["i18n"]).pipe(p(e=>e.i18n??{}),De(1)),this.customerEmailTermFormGroups$=A([this.publicLocales$,this.initialI18n$]).pipe(p(([e,i])=>{let o=this.customerEmailTerms.map(n=>n.id);return e.reduce((n,u)=>(n[u]=this.createFormGroup(o,i[u]??{}),n),{})}),this.shareReplay()),this.trackPendingChangesFormArray$=this.customerEmailTermFormGroups$.pipe(p(e=>new Yi(Object.values(e)))),this.layout.updateFeatureContext({pendingChanges:{formId:"email-localization-form",store:this.pendingChangesStore,enabledConfig:{permissions:["locations.update"]},reset:()=>R(this,null,function*(){let e=yield b(this.publicLocales$),i=yield b(this.initialI18n$);yield this.reset(e,i)}),save:()=>R(this,null,function*(){return this.save()})}})}reset(e,i){return R(this,null,function*(){let o=yield b(this.customerEmailTermFormGroups$);for(let n of e){let u=o[n],h=i[n]??{},x=this.customerEmailTerms.map(P=>P.id);u.patchValue(Object.fromEntries(x.map(P=>[P,h[P]??""])),{emitEvent:!1}),u.markAsPristine(),u.updateValueAndValidity()}})}save(){return R(this,null,function*(){let e=yield b(this.locationRx.locationId$),i=yield b(this.customerEmailTermFormGroups$),o=yield b(this.initialI18n$),n={};for(let[u,h]of Object.entries(i)){let x=u,P=Object.entries(h.value??{}).reduce((de,[Ce,ue])=>(!ue||ue.length===0?de[Ce]=null:de[Ce]=ue,de),{}),K=o[x]??{};Object.keys(P).length===0&&Object.keys(K).length===0||(n[x]=P)}Object.keys(n).length>0&&this.updateLocationWrite.payload.next({locationId:e,updates:{i18n:n}})})}createFormGroup(e,i){let o=new F({});for(let n of e)o.addControl(n,new C(i[n]??""));return o}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-email-localization"]],hostAttrs:[1,"ww-email-localization"],features:[O],decls:4,vars:8,consts:[["suffixTmpl",""],[3,"wwForm","wwTrackPendingChanges","wwTrackPendingChangesUntil"],[1,"flex","flex-col","items-start","gap-6","py-6"],[1,"grid","small:grid-cols-2","grid-cols-1","gap-4"],[3,"minRows","layout","suffixComponent","formControl","placeholder"],[1,"ml-2","mr-1",3,"country","wwTooltip"],[3,"languageCode","translated"]],template:function(i,o){if(i&1&&(l(0,"form",1),S(1,"async"),E(2,fS,3,0,"div",2),S(3,"async"),r()),i&2){let n;m("wwForm",o.formId)("wwTrackPendingChanges",T(1,4,o.trackPendingChangesFormArray$))("wwTrackPendingChangesUntil",o.response$),s(2),f((n=T(3,6,o.customerEmailTermFormGroups$))?2:-1,n)}},dependencies:[Le,X,Dt,oe,yt,ne,hp,H,pt,M,Un,kt,We,ke,Xe,qn,Ct,L],encapsulation:2,changeDetection:0})}}return t})();function CS(t,a){if(t&1&&(l(0,"ww-display-object-key"),k(1),r(),l(2,"ww-display-object-value"),k(3),r()),t&2){let e=a.$implicit;s(),fe(e.label),s(2),fe(e.value)}}var im=(()=>{class t{constructor(){this.locationRx=c(v),this.infoItems$=this.locationRx.getCurrentLocation(["address"]).pipe(p(({address:e})=>[{label:$localize`Street`,value:e?.street},{label:$localize`Zip`,value:e?.zip},{label:$localize`City`,value:e?.city},{label:$localize`Country`,value:e?.country?.name}]))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-location-address"]],decls:6,vars:2,consts:[[1,"mt-3"]],template:function(i,o){i&1&&(l(0,"h5"),k(1,"Location address"),r(),l(2,"ww-display-object",0),ce(3,CS,4,2,null,null,je),S(5,"async"),r()),i&2&&(s(3),pe(T(5,0,o.infoItems$)))},dependencies:[H,M,Di,xi,Pi,L],encapsulation:2,changeDetection:0})}}return t})();function hS(t,a){t&1&&(l(0,"p",2),k(1,"Set hours for specific dates"),r())}function wS(t,a){if(t&1&&g(0,"ww-display-hours-by-date",3),t&2){let e=d();m("hoursByDate",e.hoursByDate)}}var xa=(()=>{class t extends q{constructor(){super(...arguments),this.initialState="general",this.hoursByDate=null,this.hoursByDate$=this.observe("hoursByDate"),this.dialog=c(Ae),this.locationRx=c(v),this.updateLocationWrite=c(Te),this.isEmpty$=this.hoursByDate$.pipe(p(e=>!e||Ji(e)))}openHoursByDateEditorDialog(){return R(this,null,function*(){if(!this.locationRx.nullableLocationId)return;let e=this.dialog.open(_(Ca,{title:$localize`Edit location hours by date`,name:$localize`Location`,entityName:$localize`Location`,initialState:this.initialState,hoursByDate:this.locationRx.nullableLocation?.hoursByDate,bookingHoursByDate:this.locationRx.nullableLocation?.bookingHoursByDate,waitlistHoursByDate:this.locationRx.nullableLocation?.waitlistHoursByDate}),{size:"x-large"}),i=yield b(e.afterClosed$);i&&this.updateLocationWrite.payload.next({locationId:this.locationRx.nullableLocationId,updates:i})})}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-location-hours-dates"]],hostAttrs:[1,"ww-settings-location-hours-dates","!flex","flex-col","gap-4","items-start"],inputs:{initialState:"initialState",hoursByDate:"hoursByDate"},features:[O],decls:7,vars:3,consts:()=>{let e;e=$localize`Hours by date`;let i;return i=$localize` Edit hours by date
15`,[e,i,["wwColor","darkerGrey"],[3,"hoursByDate"],["wwButton","secondary",3,"click"]]},template:function(i,o){i&1&&(l(0,"h5"),w(1,0),r(),E(2,hS,2,0,"p",2),S(3,"async"),Rt(4,wS,1,1,"ww-display-hours-by-date",3),l(5,"button",4),N("click",function(){return o.openHoursByDateEditorDialog()}),w(6,1),r()),i&2&&(s(2),f(T(3,1,o.isEmpty$)?2:4))},dependencies:[Jc,M,Se,Je,L],styles:[`.ww-settings-location-hours-dates .ww-display-object-key{width:max-content}
16/*noopsettings-location-hours-dates.component-CWQXT76R.css.map */
17`],encapsulation:2,changeDetection:0})}}return t})();var Pa=(()=>{class t extends q{constructor(){super(...arguments),this.initialState="general",this.hiddenStates=[],this.hoursByWeekday=null,this.dialog=c(Ae),this.locationRx=c(v),this.updateLocationWrite=c(Te)}openHoursByWeekdayEditorDialog(){return R(this,null,function*(){if(!this.locationRx.nullableLocationId)return;let e=this.dialog.open(_(ha,{title:$localize`Edit location weekly hours`,name:$localize`Location`,initialState:this.initialState,hiddenStates:this.hiddenStates,inheritsFromLocation:!1,hours:this.locationRx.nullableLocation?.hours,bookingHours:this.locationRx.nullableLocation?.bookingHours,waitlistHours:this.locationRx.nullableLocation?.waitlistHours}),{size:"x-large"}),i=yield b(e.afterClosed$);i&&this.updateLocationWrite.payload.next({locationId:this.locationRx.nullableLocationId,updates:i})})}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-location-hours-weekdays"]],hostAttrs:[1,"!flex","flex-col","gap-4","items-start"],inputs:{initialState:"initialState",hiddenStates:"hiddenStates",hoursByWeekday:"hoursByWeekday"},features:[O],decls:5,vars:1,consts:()=>{let e;e=$localize`Weekly hours`;let i;return i=$localize` Edit weekly hours
18`,[e,i,[3,"hoursByWeekday"],["wwButton","secondary","type","button",3,"click"]]},template:function(i,o){i&1&&(l(0,"h5"),w(1,0),r(),g(2,"ww-display-hours-by-weekday",2),l(3,"button",3),N("click",function(){return o.openHoursByWeekdayEditorDialog()}),w(4,1),r()),i&2&&(s(2),m("hoursByWeekday",o.hoursByWeekday))},dependencies:[H,Zc,M,Se],encapsulation:2,changeDetection:0})}}return t})();function yS(t,a){if(t&1&&(l(0,"ww-display-object-key"),k(1),r(),l(2,"ww-display-object-value"),k(3),r()),t&2){let e=a.$implicit;s(),fe(e.label),s(2),fe(e.value)}}var om=(()=>{class t{constructor(){this.locationRx=c(v),this.infoItems$=this.locationRx.getCurrentLocation(["email","phone","website"]).pipe(p(({email:e,ph
18one:i,website:o})=>[{label:$localize`Email`,value:e},{label:$localize`Phone`,value:i},{label:$localize`Website`,value:o}]))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-location-info"]],decls:6,vars:2,consts:[[1,"mt-3"]],template:function(i,o){i&1&&(l(0,"h5"),k(1,"Location info"),r(),l(2,"ww-display-object",0),ce(3,yS,4,2,null,null,je),S(5,"async"),r()),i&2&&(s(3),pe(T(5,0,o.infoItems$)))},dependencies:[M,Di,xi,Pi,L],encapsulation:2,changeDetection:0})}}return t})();var RR=(()=>{class t{constructor(){this.locationRx=c(v),this.name$=this.locationRx.getCurrentLocation(["name"]).pipe(p(e=>e?.name))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-location-name"]],decls:2,vars:3,template:function(i,o){i&1&&(k(0),S(1,"async")),i&2&&fe(T(1,1,o.name$))},dependencies:[L],encapsulation:2,changeDetection:0})}}return t})();var Yr=so(wc());function IS(t,a){t&1&&(l(0,"div",17),w(1,6),r())}function MS(t,a){if(t&1&&(g(0,"ww-input",16),E(1,IS,2,0,"div",17),S(2,"async")),t&2){let e=d();m("value",a.join(", "))("readonly",!0),s(),f(T(2,3,e.isAccountSmsSendingNumbers$)?1:-1)}}function bS(t,a){if(t&1){let e=V();l(0,"div")(1,"button",15),N("click",function(){D(e);let o=d();return G(o.intercomService.show())}),w(2,7),r()()}}function NS(t,a){t&1&&(g(0,"ww-input",18),l(1,"div",17),w(2,8),r()),t&2&&m("layout","vertical")("value",a)("readonly",!0)}function OS(t,a){if(t&1){let e=V();l(0,"ww-info-bubble",19),w(1,9),r(),l(2,"div")(3,"button",15),N("click",function(){D(e);let o=d();return G(o.intercomService.show())}),w(4,10),r()()}}var nm=(()=>{class t extends q{constructor(){super(),this.accountRx=c(Ue),this.coreLocationRx=c($e),this.dialog=c(Ae),this.layoutService=c(le),this.pendingChangesStore=c(ct),this.router=c(Ve),this.intercomService=c(Wi),this.updateLocationWrite=c(Te),this.formId="customer-messages-options-form",this.locationSmsNumbers$=this.coreLocationRx.currentLocationSnapshot$.pipe(p(e=>{let i=nt(e?.smsProviderNumbers);return i.length>0?i:null}),this.shareReplay()),this.accountSmsNumbers$=this.accountRx.getAccount(["messaging"]).pipe(p(e=>{let i=nt(e.messaging?.sms?.numbers);return i.length>0?i:null}),this.shareReplay()),this.smsSendingNumbers$=A([this.locationSmsNumbers$,this.accountSmsNumbers$]).pipe(p(([e,i])=>e||i||null)),this.isAccountSmsSendingNumbers$=A([this.locationSmsNumbers$,this.accountSmsNumbers$]).pipe(p(([e,i])=>!e&&!!i)),this.alphaSenderId$=this.coreLocationRx.currentLocationSnapshot$.pipe(p(e=>e?.smsProviderAlphaSenderId??null),this.shareReplay()),this.joiFormOptions={labels:{allowIncomingMessages:$localize`Allow customers to respond to messages`,showEmailQrCode:$localize`Show QR code`,showEmailConfirmationLink:$localize`Show confirmation link`},infos:{showEmailQrCode:$localize`Emails to customers will include a QR code that your staff can scan to identify and serve them faster.`,showEmailConfirmationLink:$localize`Emails to customers will include a link to their status page where they can track live updates about their place in line or booking status.`},groups:{customerResponses:{children:["allowIncomingMessages"],label:$localize`Customer responses`,sublabel:$localize`Allow customers to respond to any outgoing SMS, email or chat message.`},emailCustomization:{children:["showEmailQrCode","showEmailConfirmationLink"],label:$localize`Email customization`}}},this.formGroup=mt(Yr.PAYLOAD_SCHEMA,new F(ut()({allowIncomingMessages:[],showEmailQrCode:[],showEmailConfirmationLink:[]}))),this.joiForm=dt(y({formGroup:this.formGroup,description:Yr.PAYLOAD_SCHEMA},this.joiFormOptions)),this.subscribe(),this.layoutService.updateFeatureContext({pendingChanges:{formId:this.formId,store:this.pendingChangesStore,enabledConfig:{permissions:["locations.update"]},reset:()=>this.reset(this.coreLocationRx.nullableLocation),save:()=>this.save()}})}openSavedReplies(){this.dialog.open(_(cp,{}))}reset(e){e&&(this.formGroup.patchValue(e,{emitEvent:!1}),this.formGroup.markAsPristine(),this.formGroup.updateValueAndValidity())}save(){return R(this,null,function*(){if(!this.formGroup.valid)return;let e=this.formGroup.getRawValue(),i=this.coreLocationRx.nullableLocation?.id;if(!i||!e)return;yield this.updateLocationWrite.payload.next({locationId:i,updates:e}),(yield b(this.updateLocationWrite.response$))&&this.router.navigate(["/settings/customer-messages"])})}subscribe(){this.coreLocationRx.currentLocationSnapshot$.pipe(z(this.ngOnDestroy$)).subscribe(e=>this.reset(e))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-customer-messages-options"]],hostAttrs:[1,"ww-settings-customer-messages-options","flex","flex-col","gap-4"],inputs:{layout:"layout"},features:[O],decls:28,vars:13,consts:()=>{let e;e=$localize`SMS sending number`;let i;i=$localize` Dedicated phone number for all incoming and outgoing messages for this location This can only be set up by a supp
18ort agent. `;let o;o=$localize`Alphanumeric sender ID`;let n;n=$localize` Set a custom sender name for your SMS. This can only be set up by a support agent. `;let u;u=$localize`Saved replies`;let h;h=$localize` Manage `;let x;x=$localize` Used for all SMS messages on this account `;let P;P=$localize` Contact support to activate `;let K;K=$localize` Used for all SMS messages on this account `;let de;de=$localize` Enabling alphanumeric sender ID will disable two-way SMS messaging. `;let Ce;return Ce=$localize` Contact support to activate `,[e,i,o,n,u,h,x,P,K,de,Ce,[1,"flex","flex-col","gap-6",3,"wwTrackPendingChanges","wwTrackPendingChangesUntil"],[1,"flex","flex-col","gap-2","max-w-full"],[3,"form","formId","wwTrackPendingChanges","wwTrackPendingChangesUntil"],[3,"layout"],["wwButton","secondary",3,"click"],[3,"value","readonly"],["wwColor","darkerGrey","wwTypography","body2"],[3,"layout","value","readonly"],["color","alert",3,"wwFormFieldSize"]]},template:function(i,o){if(i&1&&(l(0,"div",11)(1,"ww-label-layout")(2,"ww-label")(3,"span"),w(4,0),r(),l(5,"ww-sublabel"),w(6,1),r()(),l(7,"div",12),E(8,MS,3,5),S(9,"async"),Rt(10,bS,3,0,"div"),r()(),l(11,"ww-label-layout")(12,"ww-label")(13,"span"),w(14,2),r(),l(15,"ww-sublabel"),w(16,3),r()(),l(17,"div",12),E(18,NS,3,3),S(19,"async"),Rt(20,OS,5,0),r()()(),g(21,"ww-joi-form",13),l(22,"ww-label-layout",14)(23,"ww-label"),w(24,4),r(),l(25,"div")(26,"button",15),N("click",function(){return o.openSavedReplies()}),w(27,5),r()()()),i&2){let n,u;m("wwTrackPendingChanges",o.formGroup)("wwTrackPendingChangesUntil",o.updateLocationWrite.response$),s(8),f((n=T(9,9,o.smsSendingNumbers$))?8:10,n),s(10),f((u=T(19,11,o.alphaSenderId$))?18:20,u),s(3),m("form",o.joiForm)("formId",o.formId)("wwTrackPendingChanges",o.joiForm.options.formGroup)("wwTrackPendingChangesUntil",o.updateLocationWrite.response$),s(),m("layout",o.layout)}},dependencies:[X,H,pt,Lo,$o,Ro,M,Se,Je,ft,We,ke,Xe,He,Fe,Wt,L],encapsulation:2,changeDetection:0})}}return t})();var Da={pageIndex:0,pageSize:100,length:100},am={WAITLIST:$localize`Waitlist`,BOOKING:$localize`Booking`};function Ga(t){return t==="WAITLIST"||t==="BOOKING"}var rm="USER";var ka=(()=>{class t{constructor(){this.commonDisplay=c(ht),this.customerMessagesProperties={title:{key:"title",label:$localize`Message title`,display:e=>this.displayTitle(e)},description:{key:"description",label:$localize`Description`,display:e=>Li({content:tn[e.messageType],truncate:!1})},registrationType:{key:"registrationType",label:$localize`Registration type`,display:e=>this.displayRegistrationType(e)},channels:{key:"channels",label:$localize`Active channels`,display:e=>this.displayChannels(e)},status:{key:"status",label:$localize`Status`,display:e=>this.commonDisplay.displayActiveBadge(e.channels.length>0,$localize`To activate, enable at least one channel`)}},this.teamNotificationsProperties={title:{key:"title",label:$localize`Message title`,display:e=>vt[e.messageType]},description:{key:"description",label:$localize`Description`,display:e=>Li({content:tn[e.messageType],truncate:!1})},registrationType:{key:"registrationType",label:$localize`Registration type`,display:e=>this.displayRegistrationType(e)}}}getProperties(e){return Ft(e)?this.customerMessagesProperties:li(e)?this.teamNotificationsProperties:{}}displayTitle(e){return vt[e.messageType]}displayRegistrationType(e){return e.messageType.startsWith("BOOKING")||e.messageType.startsWith("USER-BOOKING")?$localize`Bookings`:e.messageType.startsWith("WAITLIST")||e.messageType.startsWith("USER-WAITLIST")?$localize`Waitlist`:$localize`Any`}displayChannels(e){return Et({$element:{classList:["flex","flex-row","gap-2"]},components:[this.getChannelComponent($localize`Email`,"bx-mail-send",e.channels.includes("EMAIL")),this.getChannelComponent($localize`SMS`,"bx-mobile",e.channels.includes("SMS")),this.getChannelComponent($localize`Push notification`,"bx-bell",e.channels.includes("APP"))].filter(se)})}getChannelComponent(e,i,o){return Gl({content:o?$localize`${e} active`:$localize`${e} inactive`,$element:{classList:["block","p-1","rounded-lg","w-7","h-7"],color:o?void 0:"darkGrey",backgroundColor:"lightGrey"},component:on({icon:i,size:"small"})})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function RS(t,a){t&1&&(l(0,"span"),w(1,4),r())}function AS(t,a){if(t&1&&(l(0,"div",14),g(1,"ww-html",16),S(2,"async"),r(),l(3,"div",14),g(4,"ww-html",16),S(5,"async"),r()),t&2){let e=d(2);s(),m("innerHTML",T(2,2,e.subjectPreview$),lo),s(3),m("innerHTML",T(5,4,e.bodyPreview$),lo)}}function $S(t,a){t&1&&(l(0,"p",13),k(1,"Not enabled for this message type"),r())}function LS(t,a){if(t&1&&(l(0,"div",14),g(1,"ww-html",16),S(2,"async"),r()),t&2){let e=d(2);s(),m("innerHTML",T(2,1,e.shortPreview$),lo)}}function vS(t,a){t&1&&(l(0,"p",13),k(1,"Not enabled for this message type"),r())}function FS(t,a){if(t&1&&(l(0,"div",14),g(1,"ww-html",16),S(2,"async"),r()),t&2){let e=d(3);
18s(),m("innerHTML",T(2,1,e.pushTitlePreview$),lo)}}function xS(t,a){if(t&1&&(E(0,FS,3,3,"div",14),l(1,"div",14),g(2,"ww-html",16),S(3,"async"),r()),t&2){d();let e=_e(10),i=d();f(e?0:-1),s(2),m("innerHTML",T(3,2,i.pushPreview$),lo)}}function PS(t,a){t&1&&(l(0,"p",13),k(1,"Not enabled for this message type"),r())}function DS(t,a){if(t&1){let e=V();l(0,"ww-section")(1,"ww-section-title"),g(2,"ww-text",5),S(3,"async"),l(4,"div",6),g(5,"ww-model-action-menu",7),S(6,"async"),l(7,"button",8),g(8,"ww-icon",9),r()()(),l(9,"ww-section-content",10),Ye(10),S(11,"async"),Ye(12),S(13,"async"),l(14,"div",11)(15,"h5",12)(16,"span"),w(17,0),r(),E(18,RS,2,0,"span"),r(),E(19,AS,6,6)(20,$S,2,0,"p",13),r(),l(21,"div",11)(22,"h5"),w(23,1),r(),E(24,LS,3,3,"div",14)(25,vS,2,0,"p",13),r(),l(26,"div",11)(27,"h5"),w(28,2),r(),E(29,xS,4,4)(30,PS,2,0,"p",13),r()(),l(31,"ww-section-actions")(32,"button",15),N("click",function(){D(e);let o=d();return G(o.edit())}),w(33,3),r()()()}if(t&2){let e=d(),i=_e(0);s(2),m("truncate",!0)("content",T(3,7,e.title$)),s(3),m("actions",T(6,9,e.actions$)),s(5),ot(T(11,11,e.isCustomerMessage$));let o=T(13,14,e.isTeamNotification$);s(8),f(i.whiteLabel?18:-1),s(),f(i.channels.includes("EMAIL")||o?19:20),s(5),f(i.channels.includes("SMS")||o?24:25),s(5),f(i.channels.includes("APP")||o?29:30)}}var sm=(()=>{class t extends q{constructor(){super(...arguments),this.messageType$=this.observe("messageType"),this.locationRx=c(v),this.messageRx=c(Io),this.messageTemplateActions=c(Bo),this.messageTemplateService=c(Ti),this.messageTemplateRx=c(ci),this.defaultLanguage$=this.locationRx.getCurrentLocation(["publicLocales"]).pipe(p(e=>e?.publicLocales?.[0]?.split("-")[0]??"en"),Ee(rl)),this.isCustomerMessage$=this.messageType$.pipe(p(e=>Ft(e))),this.isTeamNotification$=this.messageType$.pipe(p(e=>li(e))),this.clientMessageTemplate$=A([this.messageType$,this.defaultLanguage$]).pipe(U(([e,i])=>this.messageTemplateService.getClientMessageTemplate(e,i))),this.serverMessageTemplates$=this.messageTemplateRx.serverMessageTemplates$.pipe(p(e=>lc.map(i=>{let o=e?.[i];return o?{type:i,template:o}:null}).filter(se)),this.shareReplay()),this.serverMessageTemplate$=A([this.messageType$,this.serverMessageTemplates$]).pipe(p(([e,i])=>i.find(o=>o.type===e)??null),this.shareReplay()),this.title$=this.messageType$.pipe(p(e=>vt[e])),this.actions$=this.clientMessageTemplate$.pipe(Ee(se),U(e=>this.messageTemplateActions.getActions(e,{pick:["edit"]}))),this.subjectPreview$=A([this.clientMessageTemplate$,this.serverMessageTemplate$]).pipe(U(([e,i])=>{let o=e.subject??i?.template.subject??null;return o?this.messageRx.getMessagePreview(o,"EMAIL"):Y(o)})),this.bodyPreview$=A([this.clientMessageTemplate$,this.serverMessageTemplate$]).pipe(U(([e,i])=>{let o=e.body??i?.template.body??null;return o?this.messageRx.getMessagePreview(o,"EMAIL"):Y(o)})),this.shortPreview$=A([this.clientMessageTemplate$,this.serverMessageTemplate$]).pipe(U(([e,i])=>{let o=e.short??i?.template.short??null;return o?this.messageRx.getMessagePreview(o,"SMS"):Y(o)})),this.pushTitlePreview$=A([this.clientMessageTemplate$,this.serverMessageTemplate$]).pipe(U(([e,i])=>{let o=e.pushTitle??i?.template.pushTitle??null;return o?this.messageRx.getMessagePreview(o,"APP"):Y(o)})),this.pushPreview$=A([this.clientMessageTemplate$,this.serverMessageTemplate$]).pipe(U(([e,i])=>{let o=e.push??i?.template.push??null;return o?this.messageRx.getMessagePreview(o,"APP"):Y(o)}))}edit(){return R(this,null,function*(){let e=yield b(this.clientMessageTemplate$);this.messageTemplateService.editClientMessageTemplate(e)})}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-message-template-viewer"]],hostAttrs:[1,"ww-settings-message-template-viewer"],inputs:{messageType:"messageType"},features:[O],decls:5,vars:6,consts:()=>{let e;e=$localize`Email`;let i;i=$localize`SMS`;let o;o=$localize`Push`;let n;n=$localize`Edit`;let u;return u=$localize`(Custom HTML)`,[e,i,o,n,u,[3,"truncate","content"],[1,"flex","items-center"],[3,"actions"],["wwButton","tert
18iary","wwLayoutClose",""],["icon","bx-x"],[1,"gap-6"],[1,"flex","flex-col","gap-2"],[1,"flex","gap-2"],["wwColor","darkerGrey"],[1,"ww-settings-message-template-viewer-preview"],["wwButton","primary",3,"click"],[3,"innerHTML"]]},template:function(i,o){if(i&1&&(Ye(0),S(1,"async"),Ye(2),S(3,"async"),E(4,DS,34,16,"ww-section")),i&2){let n=ot(T(1,1,o.clientMessageTemplate$)),u=T(3,4,o.serverMessageTemplate$);s(4),f(n&&u?4:-1)}},dependencies:[Ao,Ze,Ea,Ui,M,Se,Je,Jl,ze,fo,wo,Co,ho,go,L],styles:[`.ww-settings-message-template-viewer .ww-settings-message-template-viewer-preview{background-color:var(--ww-color-lightGrey);border-radius:4px;border:1px solid var(--ww-color-mediumGrey);padding:8px}
19/*noopmessage-template-viewer.component-3E5RTPXO.css.map */
20`],encapsulation:2,changeDetection:0})}}return t})();var Ti=(()=>{class t{constructor(){this.accountRx=c(Ue),this.layout=c(le),this.locationRx=c(v),this.messageConfigRx=c(ki),this.messageTemplateRx=c(ci),this.resourceRx=c(Ei),this.router=c(Ve),this.updateLocationWrite=c(Te),this.updateMessageConfigWrite=c(ua),this.updateMessageTemplateWrite=c(Mo),this.updateTranslatedMessageTemplateWrite=c(bo)}arrayEquals(e,i){return Qi(new Set(e),new Set(i))}getMessageConfig(e){return this.messageConfigRx.getMessageConfig(e).pipe(p(i=>i?{channels:i.channels??[],scheduleTimes:i.scheduleTimes??[],smsCondition:i.smsCondition,trigger:i.trigger}:null))}getNextInLineValuesForMessageType(e){return e!=="WAITLIST-NEXT"?Y(null):this.locationRx.getCurrentLocation(["emailNextTriggerPosition","smsNextTriggerPosition","appNextTriggerPosition","nextTextPositionRelativeToResource","nextTextConfirm"]).pipe(p(i=>({emailNextTriggerPosition:i.emailNextTriggerPosition??1,smsNextTriggerPosition:i.smsNextTriggerPosition??1,appNextTriggerPosition:i.appNextTriggerPosition??1,nextTextPositionRelativeToResource:i.nextTextPositionRelativeToResource??!1,nextTextConfirm:i.nextTextConfirm??!1})))}getServerMessageTemplate(e){return this.messageTemplateRx.serverMessageTemplates$.pipe(p(i=>i?i[e]:null))}getClientMessageTemplate(e,i){return A([this.getMessageConfig(e),this.getNextInLineValuesForMessageType(e),this.messageTemplateRx.getMessageTemplate(e,i)]).pipe(p(([o,n,u])=>W(y(W(y({},u),{messageType:e,language:i??void 0,channels:o?.channels??[]}),n??{}),{scheduleTimes:o?.scheduleTimes??[],smsCondition:o?.smsCondition,trigger:o?.trigger})))}saveLocation(e){return Ft(e.messageType)?A([this.locationRx.getCurrentLocation(["id","emailNextTriggerPosition","smsNextTriggerPosition","appNextTriggerPosition","nextTextConfirm","nextTextPositionRelativeToResource"]),this.resourceRx.hasSelectableResources$]).pipe(p(([i,o])=>{if(!i)return!1;let n={locationId:i.id,updates:{}};return e.messageType==="WAITLIST-NEXT"&&e.emailNextTriggerPosition!==i.emailNextTriggerPosition&&(n.updates.emailNextTriggerPosition=e.emailNextTriggerPosition),e.messageType==="WAITLIST-NEXT"&&e.smsNextTriggerPosition!==i.smsNextTriggerPosition&&(n.updates.smsNextTriggerPosition=e.smsNextTriggerPosition),e.messageType==="WAITLIST-NEXT"&&e.appNextTriggerPosition!==i.appNextTriggerPosition&&(n.updates.appNextTriggerPosition=e.appNextTriggerPosition),e.messageType==="WAITLIST-NEXT"&&o&&e.nextTextPositionRelativeToResource!==i.nextTextPositionRelativeToResource&&(n.updates.nextTextPositionRelativeToResource=e.nextTextPositionRelativeToResource),e.messageType==="WAITLIST-NEXT"&&e.nextTextConfirm!==i.nextTextConfirm&&(n.updates.nextTextConfirm=e.nextTextConfirm),Ji(n.updates)||this.updateLocationWrite.payload.next(n),!0})):Y(!0)}saveMessageConfig(e){return A([this.locationRx.getCurrentLocation(["id","emailNextTriggerPosition","smsNextTriggerPosition","appNextTriggerPosition","nextTextConfirm","nextTextPositionRelativeToResource"]),this.getMessageConfig(e.messageType)]).pipe(p(([i,o])=>{if(!i)return!1;let n={locationId:i.id,messageType:e.messageType,updates:{}};return Ft(e.messageType)&&(this.arrayEquals(e.channels,o?.channels??[])||(n.updates.channels=e.channels),(e.messageType==="BOOKING-REMINDER"||e.messageType==="BOOKING-FOLLOW-UP"||e.messageType==="WAITLIST-FOLLOW-UP")&&(this.arrayEquals(e.scheduleTimes??[],o?.scheduleTimes??[])||(n.updates.scheduleTimes=e.sc
20heduleTimes)),e.smsCondition!==o?.smsCondition&&(n.updates.smsCondition=e.smsCondition)),e.trigger!==void 0&&(n.updates.trigger=e.trigger),Ji(n.updates)||this.updateMessageConfigWrite.payload.next(n),!0}))}saveMessageTemplate(e){return this.accountRx.hasAccountFeature("enableCustomAlertTexts").pipe(U(i=>i?A([this.accountRx.hasAccountFeature("enableWhiteLabeling"),this.locationRx.locationId$,this.messageTemplateRx.getMessageTemplate(e.messageType,e.language??null)]).pipe(p(([o,n,u])=>{if(!n)return!1;let h={subject:e.subject,body:e.body,short:e.short,push:e.push,pushTitle:e.pushTitle,whiteLabel:o?e.whiteLabel:!1,pushTapDestination:e.pushTapDestination,pushTapCustomUrl:e.pushTapCustomUrl},x={subject:u?.subject,body:u?.body,short:u?.short,push:u?.push,pushTitle:u?.pushTitle,whiteLabel:u?.whiteLabel??!1,pushTapDestination:u?.pushTapDestination,pushTapCustomUrl:u?.pushTapCustomUrl};if(e.language){let P={locationId:n,messageType:e.messageType,language:e.language,updates:{}};Qi(h,x)||(P.updates=h),Ji(P.updates)||this.updateTranslatedMessageTemplateWrite.payload.next(P)}else{let P={locationId:n,messageType:e.messageType,updates:{}};Qi(h,x)||(P.updates=h),Ji(P.updates)||this.updateMessageTemplateWrite.payload.next(P)}return!0})):Y(!0)))}saveClientMessageTemplate(e){return A([this.saveLocation(e),this.saveMessageConfig(e),this.saveMessageTemplate(e)]).pipe(p(i=>i.every(o=>o)))}editClientMessageTemplate(e){Ft(e.messageType)&&(this.layout.close(),this.router.navigate(["/settings/customer-messages/edit"],{queryParams:{type:e.messageType}})),li(e.messageType)&&(this.layout.close(),this.router.navigate(["/settings/team-notifications/edit"],{queryParams:{type:e.messageType}}))}viewMessageTemplate(e){this.layout.open({component:_(sm,{messageType:e})})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Bo=(()=>{class t extends pi{constructor(){super(...arguments),this.service=c(Ti)}createActions(e){return{edit:{api:()=>{this.service.editClientMessageTemplate(e)},label:$localize`Edit`,icon:"bx-edit-alt",eventLoggerName:"edit_message_template_opened",disabled:!1,enabledConfig:{permissions:["locations.update"]}},view:{api:()=>{this.service.viewMessageTemplate(e.messageType)},label:$localize`View`,icon:"bx-show",disabled:!1}}}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function WS(t,a){if(t&1){let e=V();l(0,"a",1),N("click",function(){let o=D(e).$implicit,n=d();return G(n.setRegistrationType(o))}),k(1),r()}if(t&2){let e=a.$implicit,i=d();m("active",i.selectedType===e),s(),fe(i.pluckRegistrationTypeLabel(e))}}var Wa=(()=>{class t{constructor(){this.locationRx=c(v),this.selectedType=null,this.typeChanged=new ei,this.registrationTypes$=this.locationRx.getCurrentLocation(["isBookingActive","isWaitlistActive"]).pipe(p(e=>{let i=[];return e?.isWaitlistActive&&i.push("WAITLIST"),e?.isBookingActive&&i.push("BOOKING"),i})),this.pluckRegistrationTypeLabel=e=>am[e]}setRegistrationType(e){this.typeChanged.emit(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-registration-type-tabs"]],hostAttrs:[1,"ww-settings-registration-type-tabs","flex"],inputs:{selectedType:"selectedType"},outputs:{typeChanged:"typeChanged"},decls:6,vars:4,consts:[[3,"type"],["wwTabBarItem","",3,"click","active"],["wwTabBarItem","",3,"active"]],template:function(i,o){i&1&&(l(0,"ww-tab-bar",0)(1,"a",1),N("click",function(){return o.setRegistrationType(null)}),k(2," All "),r(),ce(3,WS,2,2,"a",2,je),S(5,"async"),r()),i&2&&(m("type","fill"),s(),m("active",o.selectedType===null),s(2),pe(T(5,2,o.registrationTypes$)))},dependencies:[Le,M,ea,Zn,L],encapsulation:2,changeDetection:0})}}return t})();var zS=["actionsMenuTmpl"];function BS(t,a){t&1&&(l(0,"ww-info-bubble",4),w(1,2),r()),t&2&&m("color","alert")}function US(t,a){t&1&&g(0,"ww-empty-state",7)}function VS(t,a){t&1&&g(0,"ww-icon",9),t&2&&m("icon","bx-error")("color","alert")}function XS(t,a){if(t&1&&(l(0,"div",8),E(1,VS,1,2,"ww-icon",9),g(2,"ww-model-action-menu",10),S(3,"async"),r()),t&2){let e=a.$implicit;s(),f(e.isTranslated?-1:1),s(),m("actions",T(3,3,e.actions$))("label",e.name)}}var lm=(()=>{class t extends q{constructor(){super(...arguments),this.pageEventSub=new Ot(Da),this.messageTemplateActions=c(Bo),this.messageTemplateProperties=c(ka),this.layout=c(le),this.locationRx=c(v),this.messageConfigRx=c(ki),this.messageTemplateRx=c(ci),this.router=c(Ve),this.updateLocationWrite=c(Te),this.updateMessageConfigWrite=c(ua),this.updateMessageTemplateWrite=c(Mo),this.updateTranslatedMessageTemplateWrite=c(bo),this.messageTemplateService=c(Ti),this.queryParams=c(It),this.route=c(mo),this.registrationType$=this.route.queryParamMap.pipe(p(e=>{let i=e.get("type");return Ga(i)?i:null})),this.refetch$=Zt(this.updateLocationWrite.response$,this.updateMessageConfigWrite.response$,this.updateMessageTemplateWrite.response$,this.updateTranslatedMessageTemplateWrite.response$).pipe(Re(null)),this.availableMessageTypes$=this.locationRx.getCurrentLocation(["isBookingActive","
20isWaitlistActive","bookingManualConfirmation"]).pipe(p(e=>Sr.filter(i=>!(i.startsWith("BOOKING-")&&!e?.isBookingActive||(i==="BOOKING-REJECTED"||i==="BOOKING-REQUESTED")&&!e?.bookingManualConfirmation||i.startsWith("WAITLIST-")&&!e?.isWaitlistActive))),this.shareReplay()),this.messageConfigs$=this.refetch$.pipe(U(()=>this.messageConfigRx.getMessageConfigs(!0)),this.shareReplay()),this.activeEmailMessageTypes$=this.messageConfigs$.pipe(p(e=>e.filter(i=>i.channels.includes("EMAIL")).map(i=>i.type))),this.activeSmsMessageTypes$=this.messageConfigs$.pipe(p(e=>e.filter(i=>i.channels.includes("SMS")).map(i=>i.type))),this.activePushNotificationMessageTypes$=this.messageConfigs$.pipe(p(e=>e.filter(i=>i.channels.includes("APP")).map(i=>i.type))),this.pluckActions=()=>this.actionsMenuTmpl,this.defaultCustomerMessages$=this.messageTemplateRx.serverMessageTemplates$.pipe(p(e=>Sr.map(i=>{let o=e?.[i];return o?{type:i,template:o}:null}).filter(se)),this.shareReplay()),this.items$=A([this.defaultCustomerMessages$,this.activeEmailMessageTypes$,this.activeSmsMessageTypes$,this.activePushNotificationMessageTypes$,this.availableMessageTypes$,this.messageConfigs$,this.locationRx.languages$,this.locationRx.defaultLanguage$,this.registrationType$]).pipe(bi(0,An),p(([e,i,o,n,u,h,x,P,K])=>e.map(de=>{if(!u.includes(de.type)||K&&!de.type.startsWith(K))return null;let Ce=W(y({},de),{messageType:de.type,channels:[i.includes(de.type)?"EMAIL":null,o.includes(de.type)?"SMS":null,n.includes(de.type)?"APP":null].filter(se)}),ue=h.find(ge=>ge.type===Ce.type);return W(y({name:vt[Ce.type]},Ce),{actions$:this.messageTemplateActions.getActions(Ce),isTranslated:this.isMessageTypeTranslated(x,P,ue),messageConfig:ue})}).filter(se)),this.shareReplay()),this.isMissingTranslations$=this.items$.pipe(p(e=>e.some(i=>!i.isTranslated))),this.isLoading$=this.items$.pipe(p(e=>e===null),Re(!0)),this.columns=Bi(this.messageTemplateProperties.getProperties("BOOKING-CONFIRM")),this.pluckCellLabel=e=>zi(e,this.messageTemplateProperties.getProperties(e.messageType))}setRegistrationType(e){e?this.queryParams.set("type",e):this.queryParams.update({remove:["type"]})}onRowClicked(e){this.messageTemplateService.editClientMessageTemplate(e)}isMessageTypeTranslated(e,i,o){if(o&&o.languages){let n=o.channels?.includes("EMAIL"),u=o.channels?.includes("SMS"),h=o.channels?.includes("APP");for(let x of e)if(x!==i&&(n&&(!o.languages.body?.includes(x)||!o.languages.subject?.includes(x))||h&&!o.languages.push?.includes(x)||u&&!o.languages.short?.includes(x)))return!1}return!0}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-customer-messages"]],viewQuery:function(i,o){if(i&1&&ti(zS,7),i&2){let n;ii(n=oi())&&(o.actionsMenuTmpl=n.first)}},hostAttrs:[1,"ww-settings-customer-messages"],features:[O],decls:12,vars:16,consts:()=>{let e;e=$localize` Some customer messages are missing translations. `;let i;i=$localize`No customer messages found`;let o;return o=$localize`Missing translations`,[["emptyStateTmpl",""],["actionsMenuTmpl",""],e,[1,"flex","flex-col","gap-6"],[3,"color"],[3,"typeChanged","selectedType"],[3,"rowClicked","loading","data","columns","pluckCellLabel","pluckActions","placeholder"],["icon","ww-empty-state-services","message",i],[1,"flex","items-center","justify-end"],["wwTooltip",o,3,"icon","color"],[3,"actions","label"]]},template:function(i,o){if(i&1&&(l(0,"div",3),E(1,BS,2,1,"ww-info-bubble",4),S(2,"async"),l(3,"ww-settings-registration-type-tabs",5),S(4,"async"),N("typeChanged",function(u){return o.setRegistrationType(u)}),r(),l(5,"ww-table",6),S(6,"async"),S(7,"async"),N("rowClicked",function(u){return o.onRowClicked(u)}),r()(),$(8,US,1,0,"ng-template",null,0,me)(10,XS,4,5,"ng-template",null,1,me)),i&2){let n=ie(9);s(),f(T(2,8,o.isMissingTranslations$)?1:-1),s(2),m("selectedType",T(4,10,o.registrationType$)),s(2),m("loading",T(6,12,o.isLoading$))("data",T(7,14,o.items$))("columns",o.columns)("pluckCellLabel",o.pluckCellLabel)("pluckActions",o.pluckActions)("placeholder",n)}},dependencies:[Le,H,Vi,Ze,M,ze,He,si,Ct,Wa,L],styles:[`.ww-settings-customer-messages .ww-settings-customer-messages-registration-types .ww-select-trigger-placeholder{color:var(--ww-color-black)}
21/*noopcustomer-messages.component-S76GLNTN.css.map */
22`],encapsulation:2,changeDetection:0})}}return t})();
22var mm=so(Vm());var Uo={subject:$localize`Restore subject line`,body:$localize`Restore body`,short:$localize`Restore message`,pushTitle:$localize`Restore push title`,push:$localize`Restore push message`},Vo={subject:{type:"markdown",content:$localize`This will restore the subject line to the default template.<br>Are you sure?`},body:{type:"markdown",content:$localize`This will restore the body to the default template.<br>Are you sure?`},short:{type:"markdown",content:$localize`This will restore the message to the default template.<br>Are you sure?`},push:{type:"markdown",content:$localize`This will restore the push message to the default template.<br>Are you sure?`},pushTitle:{type:"markdown",content:$localize`This will restore the push title to the default template.<br>Are you sure?`}},cm=Be()(["ALWAYS","PUSH_NOT_DELIVERED","PUSH_NOT_OPENED"]),pm={ALWAYS:$localize`Always send SMS`,PUSH_NOT_DELIVERED:$localize`Send SMS only if push is not delivered`,PUSH_NOT_OPENED:$localize`Send SMS only if push is not tapped within 1 minute`},um=["PUSH_NOT_DELIVERED","PUSH_NOT_OPENED"],Qr=Be()(["STATUS_PAGE","REGISTRATION_PAGE","SURVEY","CUSTOM_URL","NONE"]),Jr={STATUS_PAGE:$localize`Status page`,REGISTRATION_PAGE:$localize`First page in registration flow`,SURVEY:$localize`CSAT Survey`,CUSTOM_URL:$localize`Custom URL`,NONE:$localize`None`};var HS=()=>[!1,!0];function qS(t,a){if(t&1&&(l(0,"div",45)(1,"div"),tt(2,12),g(3,"strong"),it(),r(),l(4,"div",46),g(5,"ww-input",47)(6,"ww-select",48),S(7,"async"),r()()),t&2){let e=d(3);s(5),m("formControl",e.smsPositionFormControl),s(),m("formControl",e.relationFormControl)("data",T(7,4,e.relationOptions$))("pluckLabel",e.pluckRelationLabel)}}function jS(t,a){if(t&1&&(l(0,"div",45)(1,"div"),tt(2,13),g(3,"strong"),it(),r(),l(4,"div",46),g(5,"ww-input",47)(6,"ww-select",49),S(7,"async"),r()()),t&2){d(2);let e=_e(9),i=d();s(5),m("formControl",i.emailPositionFormControl),s(),m("formControl",i.relationFormControl)("data",T(7,5,i.relationOptions$))("pluckLabel",i.pluckRelationLabel)("readonly",i.smsActiveFormControl.value&&!!e)}}function KS(t,a){if(t&1&&(l(0,"div",45)(1,"div"),tt(2,14),g(3,"strong"),it(),r(),l(4,"div",46),g(5,"ww-input",47)(6,"ww-select",49),S(7,"async"),r()()),t&2){d(2);let e=_e(8),i=_e(9),o=d();s(5),m("formControl",o.pushPositionFormControl),s(),m("formControl",o.relationFormControl)("data",T(7,5,o.relationOptions$))("pluckLabel",o.pluckRelationLabel)("readonly",o.smsActiveFormControl.value&&!!i||o.emailActiveFormControl.value&&!!e)}}function YS(t,a){t&1&&(l(0,"div",45)(1,"div"),w(2,15),r(),l(3,"div",51),w(4,16),r()())}function QS(t,a){if(t&1&&(g(0,"ww-checkbox",50),$(1,YS,5,0,"ng-template",null,0,me)),t&2){let e=ie(2),i=d(3);m("layout","vertical")("formControl",i.confirmFormControl)("label",e)}}function JS(t,a){if(t&1&&(l(0,"ww-label-layout")(1,"ww-label")(2,"span"),k(3,"Trigger position"),r(),l(4,"ww-sublabel"),w(5,11),S(6,"async"),r()(),l(7,"div",44),E(8,qS,8,6,"div",45),E(9,jS,8,7,"div",45),E(10,KS,8,7,"div",45),E(11,QS,3,3),r()()),t&2){d();let e=_e(7),i=_e(8),o=_e(9),n=_e(10),u=_e(11),h=d();s(6),Ht(T(6,6,h.messageTypeName$)),qt(5),s(),m("wwFormFieldSize","large"),s(),f(h.smsActiveFormControl.value&&o?8:-1),s(),f(h.emailActiveFormControl.value&&i?9:-1),s(),f(h.pushActiveFormControl.value&&n?10:-1),s(),f(e&&u?11:-1)}}function ZS(t,a){if(t&1){let e=V();l(0,"div",53),g(1,"ww-duration-picker",54),l(2,"button",55),N("click",function(){let o=D(e).$index,n=d(3);return G(n.removeBookingReminder(n.bookingReminderFormControl,o))}),g(3,"ww-icon",56),r()()}if(t&2){let e=a.$implicit;d(3);let i=_e(2);s(),m("size",i)("formControl",e)}}function eT(t,a){if(t&1){let e=V();l(0,"div")(1,"button",55),N("click",function(){D(e);let o=d(3);return G(o.addBookingReminder(o.bookingReminderFormControl))}),g(2,"ww-icon",57),l(3,"span"),w(4,18),r()()()}}function tT(t,a){if(t&1&&(l(0,"ww-form-field-hint"),w(1,19),r()),t&2){let e=d(3);s(),Ht(e.maxBookingReminders),qt(1)}}function iT(t,a){if(t&1&&(l(0,"ww-label-layout")(1,"ww-label"),w(2,17),r(),l(3,"div",52),ce(4,ZS,4,2,"div",53,je),E(6,eT,5,0,"div")(7,tT,2,1,"ww-form-field-hint"),r()()),t&2){let e=d(2);s(4),pe(e.bookingReminderFormControl.controls),s(2),f(e.bookingReminderFormControl.controls.length<e.maxBookingReminders?6:7)}}function oT(t,a){if(t&1&&g(0,"ww-duration-picker",41),t&2){let e=d(2);m("formControl",e.followUpFormControl)}}function nT(t,a){if(t&1&&g(0,"ww-select",42),t&2){let e=d(2);m("withSelectAllOption",!0)("formControl",e.changedPropertiesFormControl)("data",e.visitTriggerProperties)("pluckLabel",e.pluckVisitTriggerPropertyLabel)("selection","multiple")("layout","vertical")}}function aT(t,a){t&1&&te(0)}function rT(t,a){if(t&1&&$(0,aT,1,0,"ng-container",67),t&2){let e=d(4);m("wwOutlet",e.activeComponent)}}function sT(t,a){t&1&&te(0)}
22function lT(t,a){if(t&1&&$(0,sT,1,0,"ng-container",67),t&2){let e=d(4);m("wwOutlet",e.inactiveComponent)}}function cT(t,a){if(t&1&&E(0,rT,1,1,"ng-container")(1,lT,1,1,"ng-container"),t&2){let e=d(3);f(e.isEmailActive?0:1)}}function pT(t,a){if(t&1&&(l(0,"ww-label-layout",69)(1,"ww-label")(2,"span"),w(3,24),r(),l(4,"ww-sublabel"),w(5,25),r()(),g(6,"ww-checkbox",74),r()),t&2){let e=d(4),i=_e(0);m("layout",i),s(6),m("formControl",e.emailActiveFormControl)}}function uT(t,a){if(t&1){let e=V();l(0,"ww-translation-switcher",75),S(1,"async"),N("languageCodeSelected",function(o){D(e);let n=d(4);return G(n.languageChanged.emit(o))}),r()}if(t&2){let e=d(4);m("selectedCode",e.language)("translationSwitcherItems",T(1,2,e.subjectTranslationSwitcherItems$))}}function mT(t,a){if(t&1){let e=V();l(0,"ww-translation-switcher",75),S(1,"async"),N("languageCodeSelected",function(o){D(e);let n=d(4);return G(n.languageChanged.emit(o))}),r()}if(t&2){let e=d(4);m("selectedCode",e.language)("translationSwitcherItems",T(1,2,e.bodyTranslationSwitcherItems$))}}function dT(t,a){if(t&1){let e=V();l(0,"div",68),E(1,pT,7,2,"ww-label-layout",69),l(2,"ww-label-layout",70),N("click",function(o){D(e);let n=d(3);return G(n.handleEmailTemplateEvent(o))}),l(3,"ww-label")(4,"span"),w(5,22),r(),l(6,"ww-sublabel"),w(7,23),r()(),g(8,"ww-radio",71),S(9,"async"),r(),g(10,"ww-liquid-editor",72,1),S(12,"async"),S(13,"async"),S(14,"async"),S(15,"async"),S(16,"async"),S(17,"async"),S(18,"async"),$(19,uT,2,4,"ng-template",null,2,me),g(21,"ww-liquid-editor",73,3),S(23,"async"),S(24,"async"),S(25,"async"),S(26,"async"),S(27,"async"),S(28,"async"),S(29,"async"),$(30,mT,2,4,"ng-template",null,4,me),r()}if(t&2){let e=ie(20),i=ie(31);d(2);let o=_e(0),n=d(),u=_e(0),h=_e(4);s(),f(o?1:-1),s(),m("layout",u),s(6),m("layout","vertical")("formControl",n.whiteLabelFormControl)("data",At(67,HS))("pluckLabel",T(9,37,n.pluckEmailTemplateLabel$))("pluckSublabel",n.pluckEmailTemplateSublabel),s(2),m("layout",u)("rows",2)("editor",n.editor)("placeholder",T(12,39,n.defaultSubject$))("formControl",h.controls.subject)("suffixComponent",e)("readonly",T(13,41,n.readonly$))("fetchPreview",n.fetchEmailPreview)("refiner",T(14,43,n.messageTemplateMenuService.variableEditorMatchRefiner$))("stringify",T(15,45,n.messageTemplateMenuService.stringifyLiquidCode$))("defaultValue",T(16,47,n.defaultSubject$))("restoreDefaultConfirmMessage",n.restoreSubjectMessage)("restoreDefaultConfirmTitle",n.restoreSubjectTitle)("variableMenuItems",T(17,49,n.messageTemplateMenuService.createNewVariableItems$))("completion",T(18,51,n.messageTemplateMenuService.liquidCompletion$)),s(11),m("layout",u)("rows",4)("editor",n.editor)("placeholder",T(23,53,n.defaultBody$))("formControl",h.controls.body)("suffixComponent",i)("readonly",T(24,55,n.readonly$))("fetchPreview",n.fetchEmailPreview)("refiner",T(25,57,n.messageTemplateMenuService.variableEditorMatchRefiner$))("stringify",T(26,59,n.messageTemplateMenuService.stringifyLiquidCode$))("defaultValue",T(27,61,n.defaultBody$))("restoreDefaultConfirmMessage",n.restoreBodyMessage)("restoreDefaultConfirmTitle",n.restoreBodyTitle)("variableMenuItems",T(28,63,n.messageTemplateMenuService.createNewVariableItems$))("completion",T(29,65,n.messageTemplateMenuService.liquidCompletion$))}}function _T(t,a){if(t&1&&(l(0,"ww-expansion")(1,"ww-expansion-header",58)(2,"div",59)(3,"div",60),g(4,"ww-icon",61),r(),l(5,"div",62)(6,"div",63)(7,"span",64),w(8,20),r(),E(9,cT,2,1),r(),l(10,"div",65),w(11,21),r()()()(),$(12,dT,32,68,"div",66),r()),t&2){d();let e=_e(0);s(9),f(e?9:-1)}}function ST(t,a){t&1&&te(0)}
22function TT(t,a){if(t&1&&$(0,ST,1,0,"ng-container",67),t&2){let e=d(4);m("wwOutlet",e.activeComponent)}}function gT(t,a){t&1&&te(0)}function ET(t,a){if(t&1&&$(0,gT,1,0,"ng-container",67),t&2){let e=d(4);m("wwOutlet",e.inactiveComponent)}}function fT(t,a){if(t&1&&E(0,TT,1,1,"ng-container")(1,ET,1,1,"ng-container"),t&2){let e=d(3);f(e.isSmsActive?0:1)}}function CT(t,a){if(t&1){let e=V();l(0,"ww-label-layout",69)(1,"ww-label")(2,"span"),w(3,28),r(),l(4,"ww-sublabel"),w(5,29),r()(),g(6,"ww-checkbox",78),r(),l(7,"ww-label-layout",70),N("click",function(o){D(e);let n=d(4);return G(n.handleSmsConditionsEvent(o))}),l(8,"ww-label")(9,"span"),w(10,30),r(),l(11,"ww-sublabel"),w(12,31),r()(),g(13,"ww-radio",79),S(14,"async"),r()}if(t&2){let e=d(4),i=_e(0);m("layout",i),s(6),m("formControl",e.smsActiveFormControl),s(),m("layout",i),s(6),m("formControl",e.smsConditionsFormControl)("data",e.smsConditionsOptions)("pluckLabel",T(14,6,e.pluckSmsConditionsLabel$))}}function hT(t,a){if(t&1){let e=V();l(0,"ww-translation-switcher",75),S(1,"async"),N("languageCodeSelected",function(o){D(e);let n=d(4);return G(n.languageChanged.emit(o))}),r()}if(t&2){let e=d(4);m("selectedCode",e.language)("translationSwitcherItems",T(1,2,e.shortTranslationSwitcherItems$))}}function wT(t,a){if(t&1&&(l(0,"div",68),E(1,CT,15,8),g(2,"ww-liquid-editor",77,5),S(4,"async"),S(5,"async"),S(6,"async"),S(7,"async"),S(8,"async"),S(9,"async"),S(10,"async"),$(11,hT,2,4,"ng-template",null,6,me),r()),t&2){let e=ie(12);d(2);let i=_e(0),o=d(),n=_e(0),u=_e(4);s(),f(i?1:-1),s(),m("layout",n)("rows",2)("editor",o.editor)("placeholder",T(4,17,o.defaultShort$))("formControl",u.controls.short)("withSmsCharacterCounter",!0)("suffixComponent",e)("readonly",T(5,19,o.readonly$))("fetchPreview",o.fetchSmsPreview)("refiner",T(6,21,o.messageTemplateMenuService.variableEditorMatchRefiner$))("stringify",T(7,23,o.messageTemplateMenuService.stringifyLiquidCode$))("defaultValue",T(8,25,o.defaultShort$))("restoreDefaultConfirmMessage",o.restoreShortMessage)("restoreDefaultConfirmTitle",o.restoreShortTitle)("variableMenuItems",T(9,27,o.messageTemplateMenuService.createNewVariableItems$))("completion",T(10,29,o.messageTemplateMenuService.liquidCompletion$))}}function yT(t,a){if(t&1&&(l(0,"ww-expansion")(1,"ww-expansion-header",58)(2,"div",59)(3,"div",60),g(4,"ww-icon",76),r(),l(5,"div",62)(6,"div",63)(7,"span",64),w(8,26),r(),E(9,fT,2,1),r(),l(10,"div",65),w(11,27),r()()()(),$(12,wT,13,31,"div",66),r()),t&2){d();let e=_e(0);s(9),f(e?9:-1)}}function IT(t,a){t&1&&te(0)}function MT(t,a){if(t&1&&$(0,IT,1,0,"ng-container",67),t&2){let e=d(4);m("wwOutlet",e.activeComponent)}}function bT(t,a){t&1&&te(0)}function NT(t,a){if(t&1&&$(0,bT,1,0,"ng-container",67),t&2){let e=d(4);m("wwOutlet",e.inactiveComponent)}}function OT(t,a){if(t&1&&E(0,MT,1,1,"ng-container")(1,NT,1,1,"ng-container"),t&2){let e=d(3);f(e.isPushActive?0:1)}}function RT(t,a){if(t&1&&g(0,"ww-input",85),t&2){let e=d(5);m("formControl",e.pushTapDestinationUrlFormControl)}}
22function AT(t,a){if(t&1){let e=V();l(0,"ww-translation-switcher",75),S(1,"async"),N("languageCodeSelected",function(o){D(e);let n=d(5);return G(n.languageChanged.emit(o))}),r()}if(t&2){let e=d(5);m("selectedCode",e.language)("translationSwitcherItems",T(1,2,e.pushTitleTranslationSwitcherItems$))}}function $T(t,a){if(t&1&&(l(0,"ww-label-layout",69)(1,"ww-label")(2,"span"),w(3,34),r(),l(4,"ww-sublabel"),w(5,35),r()(),g(6,"ww-checkbox",82),r(),l(7,"ww-label-layout",69)(8,"ww-label")(9,"span"),w(10,36),r(),l(11,"ww-sublabel"),w(12,37),r()(),l(13,"div",83),g(14,"ww-select",84),S(15,"async"),E(16,RT,1,1,"ww-input",85),r()(),g(17,"ww-liquid-editor",86,9),S(19,"async"),S(20,"async"),S(21,"async"),S(22,"async"),S(23,"async"),S(24,"async"),S(25,"async"),$(26,AT,2,4,"ng-template",null,10,me)),t&2){let e=ie(27),i=d(4),o=_e(0),n=_e(2),u=_e(4);m("layout",o),s(6),m("formControl",i.pushActiveFormControl),s(),m("layout",o),s(6),m("wwFormFieldSize",n),s(),m("formControl",i.pushTapDestinationFormControl)("pluckLabel",i.pluckTapDestinationLabel)("data",T(15,23,i.tapDestinations$)),s(2),f(i.pushTapDestinationFormControl.value==="CUSTOM_URL"?16:-1),s(),m("layout",o)("rows",2)("editor",i.editor)("placeholder",T(19,25,i.defaultPushTitle$))("formControl",u.controls.pushTitle)("suffixComponent",e)("readonly",T(20,27,i.readonly$))("fetchPreview",i.fetchPushPreview)("refiner",T(21,29,i.messageTemplateMenuService.variableEditorMatchRefiner$))("stringify",T(22,31,i.messageTemplateMenuService.stringifyLiquidCode$))("defaultValue",T(23,33,i.defaultPushTitle$))("restoreDefaultConfirmMessage",i.restorePushTitleMessage)("restoreDefaultConfirmTitle",i.restorePushTitleTitle)("variableMenuItems",T(24,35,i.messageTemplateMenuService.createNewVariableItems$))("completion",T(25,37,i.messageTemplateMenuService.liquidCompletion$))}}function LT(t,a){if(t&1){let e=V();l(0,"ww-translation-switcher",75),S(1,"async"),N("languageCodeSelected",function(o){D(e);let n=d(4);return G(n.languageChanged.emit(o))}),r()}if(t&2){let e=d(4);m("selectedCode",e.language)("translationSwitcherItems",T(1,2,e.pushTranslationSwitcherItems$))}}function vT(t,a){if(t&1&&(l(0,"div",68),E(1,$T,28,39),g(2,"ww-liquid-editor",81,7),S(4,"async"),S(5,"async"),S(6,"async"),S(7,"async"),S(8,"async"),S(9,"async"),S(10,"async"),$(11,LT,2,4,"ng-template",null,8,me),r()),t&2){let e=ie(12);d(2);let i=_e(0),o=d(),n=_e(0),u=_e(4);s(),f(i?1:-1),s(),m("layout",n)("rows",2)("editor",o.editor)("placeholder",T(4,16,o.defaultPush$))("formControl",u.controls.push)("suffixComponent",e)("readonly",T(5,18,o.readonly$))("fetchPreview",o.fetchPushPreview)("refiner",T(6,20,o.messageTemplateMenuService.variableEditorMatchRefiner$))("stringify",T(7,22,o.messageTemplateMenuService.stringifyLiquidCode$))("defaultValue",T(8,24,o.defaultPush$))("restoreDefaultConfirmMessage",o.restorePushMessage)("restoreDefaultConfirmTitle",o.restorePushTitle)("variableMenuItems",T(9,26,o.messageTemplateMenuService.createNewVariableItems$))("completion",T(10,28,o.messageTemplateMenuService.liquidCompletion$))}}function FT(t,a){if(t&1&&(l(0,"ww-expansion")(1,"ww-expansion-header",58)(2,"div",59)(3,"div",60),g(4,"ww-icon",80),r(),l(5,"div",62)(6,"div",63)(7,"span",64),w(8,32),r(),E(9,OT,2,1),r(),l(10,"div",65),w(11,33),r()()()(),$(12,vT,13,30,"div",66),r()),t&2){d();let e=_e(0);s(9),f(e?9:-1)}}function xT(t,a){t&1&&(l(0,"ww-info-bubble"),w(1,38),r())}function PT(t,a){if(t&1&&(Ye(0),S(1,"async"),l(2,"form",39)(3,"div"),k(4),S(5,"async"),r(),l(6,"div",40),Ye(7)(8)(9)(10)(11),E(12,JS,12,8,"ww-label-layout"),E(13,iT,8,1,"ww-label-layout"),E(14,oT,1,1,"ww-duration-picker",41),E(15,nT,1,6,"ww-select",42),r(),E(16,_T,13,1,"ww-expansion"),S(17,"async"),E(18,yT,13,1,"ww-expansion"),S(19,"async"),E(20,FT,13,1,"ww-expansion"),S(21,"async"),r(),l(22,"div",43),E(23,xT,2,0,"ww-info-bubble"),S(24,"async"),r()),t&2){let e=d();ot(T(1,12,e.isCustomerMessageType$)),s(2),m("wwForm",e.formId)("wwTrackPendingChanges",e.trackPendingChangesFormArray)("wwTrackPendingChangesUntil",e.saved),s(2),fe(T(5,15,e.messageTypeDescription$)),s(3);let i=ot(e.smsActiveFormControl.value||e.emailActiveFormControl.value||e.pushActiveFormControl.value);s();let o=ot(e.showEmailPositionByMessageType[e.messageType]);s();let n=ot(e.showSmsPositionByMessageType[e.messageType]);s(),ot(e.showPushPositionByMessageType[e.messageType]),s();let u=ot(e.showConfirmByMessageType[e.messageType]);s(),f(i&&(o||n||u)?12:-1),s(),f(e.showBookingRemindersByMessageType[e.messageType]?13:-1),s(),f(e.showFollowUpByMessageType[e.messageType]?14:-1),s(),f(e.showVisitPropertiesByMessageType[e.messageType]?15:-1),s(),f(T(17,22,e.showEmailEditor$)?16:-1),s(2),f(T(19,24,e.showSmsEditor$)?18:-1),s(2),f(T(21,26,e.showPushEditor$)?20:-1),s(3),f(T(24,28,e.readonly$)?23:-1)}}var dm=(()=>{class t extends q{constructor(){super(),this.defaultLanguage=null,this.defaultLanguage$=this.observe("defaultLanguage"),this.language=null,this.language$=this.observe("language"),this.messageType=null,this.messageType$=this.observe("messageType"),this.initialMessageTemplates$=this.observe("initialMessageTemplates"),this.serverDefaultMessageTemplate$=this.observe("serverDefaultMessageTemplate"),this.userDefaultMessageTemplate$=this.observe("userDefaultMessageTemplate"),this.saved=new ei,this.languageChanged=new ei,this.accountFeatureService=c(Lc),this.accountRx=c(Ue),this.breakpoints=c($i),this.changeDetectorRef=c(Pt),this.commonDisplay=c(ht),this.layout=c(le),this.dialog=c(Ae),this.locationRx=c(v),this.messageRx=c(Io),this.pendingChangesStore=c(ct),this.resourceRx=c(Ei),this.messageTemplateMenuService=c(u
22n),this.formId="settings-message-template-form",this.formRecord=new uo({}),this.smsActiveFormControl=new C(!1,{nonNullable:!0}),this.emailActiveFormControl=new C(!1,{nonNullable:!0}),this.pushActiveFormControl=new C(!1,{nonNullable:!0}),this.smsConditionsFormControl=new C("ALWAYS",{nonNullable:!0}),this.pushTapDestinationFormControl=new C("STATUS_PAGE",{nonNullable:!0}),this.pushTapDestinationUrlFormControl=new C(null,{validators:[gt.url({optionalProtocol:!1,protocols:["https"]})]}),this.whiteLabelFormControl=new C(!1,{nonNullable:!0}),this.emailPositionFormControl=new C(1,{nonNullable:!0}),this.smsPositionFormControl=new C(1,{nonNullable:!0}),this.pushPositionFormControl=new C(1,{nonNullable:!0}),this.relationFormControl=new C(!1,{nonNullable:!0}),this.confirmFormControl=new C(!1,{nonNullable:!0}),this.followUpFormControl=new C(3600,{nonNullable:!0}),this.bookingReminderFormControl=new Yi([]),this.bookingReminderSnapshotFormControl=new C("",{nonNullable:!0}),this.changedPropertiesFormControl=new C([],{nonNullable:!0}),this.trackPendingChangesFormArray=new Yi([this.formRecord,this.bookingReminderFormControl,this.bookingReminderSnapshotFormControl,this.confirmFormControl,this.emailActiveFormControl,this.emailPositionFormControl,this.followUpFormControl,this.pushActiveFormControl,this.pushPositionFormControl,this.pushTapDestinationFormControl,this.pushTapDestinationUrlFormControl,this.relationFormControl,this.smsActiveFormControl,this.smsConditionsFormControl,this.smsPositionFormControl,this.whiteLabelFormControl,this.changedPropertiesFormControl]),this.formInitSub=new Rn(1),this.editor=mn,this.restoreSubjectTitle=Uo.subject,this.restoreBodyTitle=Uo.body,this.restoreShortTitle=Uo.short,this.restorePushTitle=Uo.push,this.restorePushTitleTitle=Uo.pushTitle,this.restoreSubjectMessage=Vo.subject,this.restoreBodyMessage=Vo.body,this.restoreShortMessage=Vo.short,this.restorePushMessage=Vo.push,this.restorePushTitleMessage=Vo.pushTitle,this.isEmailActive=!1,this.isSmsActive=!1,this.isPushActive=!1,this.smsConditionsOptions=cm,this.pluckVisitTriggerPropertyLabel=e=>Il[e],this.smsConditionsDisabled$=this.accountRx.lacksAccountFeatures(["enableSmsConditions"]),this.pluckSmsConditionsLabel$=this.smsConditionsDisabled$.pipe(p(e=>i=>{let o=pm[i];return e&&um.includes(i)?Et({components:[o,_(wr)],$element:{classList:"flex items-center gap-2"}}):o}
22)),this.tapDestinations$=this.accountRx.hasAccountFeature("enableSurveys").pipe(p(e=>e?Qr:Qr.filter(i=>i!=="SURVEY"))),this.enabledChannels$=this.accountRx.account$.pipe(p(e=>e.features),Us(["enableUserNotifications","enableSMS","enableEmail"]),p(({enableUserNotifications:e,enableSMS:i,enableEmail:o})=>{let n=[];return e.includes("SMS")&&i&&n.push("SMS"),e.includes("EMAIL")&&o&&n.push("EMAIL"),e.includes("APP")&&n.push("APP"),n})),this.activeComponent=this.commonDisplay.displayActiveBadge(!0,"",{size:"xx-small"}),this.inactiveComponent=this.commonDisplay.displayActiveBadge(!1,"",{size:"xx-small"}),this.visitTriggerProperties=cc,this.labelLayout$=this.breakpoints.isAboveSmall$.pipe(p(e=>e?"horizontal":"vertical")),this.formFieldSize$=this.breakpoints.isAboveSmall$.pipe(p(e=>e?"large":"auto")),this.relation$=Q(this.relationFormControl),this.formRecordInvalid$=this.formInitSub.pipe(U(()=>this.formRecord.statusChanges.pipe(Re(null),p(()=>this.formRecord.invalid),Tt()))),this.maxBookingReminders=ep(mm.PAYLOAD_SCHEMA.keys.scheduleTimes,"max")?.args.limit??0,this.isCustomerMessageType$=this.messageType$.pipe(p(e=>Ft(e)),Tt()),this.messageTypeName$=this.messageType$.pipe(p(e=>e?vt[e]:null),Tt()),this.messageTypeDescription$=this.messageType$.pipe(p(e=>e?tn[e]:null),Tt()),this.showEmailEditor$=this.isCustomerMessageType$.pipe(U(e=>e?Y(!0):this.enabledChannels$.pipe(p(i=>i.includes("EMAIL"))))),this.showSmsEditor$=this.isCustomerMessageType$.pipe(U(e=>e?Y(!0):this.enabledChannels$.pipe(p(i=>i.includes("SMS"))))),this.showPushEditor$=this.isCustomerMessageType$.pipe(U(e=>e?Y(!0):this.enabledChannels$.pipe(p(i=>i.includes("APP"))))),this.hasResources$=this.resourceRx.hasSelectableResources$,this.enableCustomAlertTexts$=this.accountRx.hasAccountFeature
22("enableCustomAlertTexts"),this.enableCustomPushTapUrl$=this.accountRx.hasAccountFeature("enableCustomPushTapUrl"),this.enableSmsConditions$=this.accountRx.hasAccountFeature("enableSmsConditions"),this.enableWhiteLabeling$=this.accountRx.hasAccountFeature("enableWhiteLabeling"),this.relationOptions$=this.hasResources$.pipe(p(e=>e?[!1,!0]:[!1])),this.activeFormGroup$=this.formInitSub.pipe(U(()=>A([this.language$,this.locationRx.defaultLanguage$]).pipe(p(([e,i])=>(e=e??i,e?this.formRecord.controls[e]:null)),Tt(),this.shareReplay()))),this.formRecordValue$=Zt(Bs(this.formRecord),this.formInitSub).pipe(p(()=>Object.values(this.formRecord.getRawValue()))),this.restoreToDefaultTemplate$=A([this.serverDefaultMessageTemplate$,this.userDefaultMessageTemplate$,this.language$,this.defaultLanguage$]).pipe(p(([e,i,o,n])=>o===n?e:e?this.mergeDefaultMessageTemplates(e??{},i??{}):i),this.shareReplay()),this.defaultPushTitle$=this.restoreToDefaultTemplate$.pipe(p(e=>e?.pushTitle??"")),this.defaultPush$=this.restoreToDefaultTemplate$.pipe(p(e=>e?.push??"")),this.defaultShort$=this.restoreToDefaultTemplate$.pipe(p(e=>e?.short??"")),this.defaultSubject$=this.restoreToDefaultTemplate$.pipe(p(e=>e?.subject??"")),this.defaultBody$=this.restoreToDefaultTemplate$.pipe(p(e=>e?.body??"")),this.bodyTranslationSwitcherItems$=this.createTranslationSwitcherItems(this.formRecordValue$,e=>e.body??""),this.subjectTranslationSwitcherItems$=this.createTranslationSwitcherItems(this.formRecordValue$,e=>e.subject??""),this.shortTranslationSwitcherItems$=this.createTranslationSwitcherItems(this.formRecordValue$,e=>e.short??""),this.pushTitleTranslationSwitcherItems$=this.createTranslationSwitcherItems(this.formRecordValue$,e=>e.pushTitle??""),this.pushTranslationSwitcherItems$=this.createTranslationSwitcherItems(this.formRecordValue$,e=>e.push??""),this.pluckRelationLabel=e=>e?$localize`in relation to resource`:$localize`in relation to everyone`,this.pluckChannelLabel=e=>yl[e],this.pluckTapDestinationLabel=e=>{if(e&&e!=="CUSTOM_URL")return Jr[e];let i=n=>Jr[n??"NONE"];return this.accountFeatureService.createAccountFeaturePluckLabel("enableCustomPushTapUrl",i)(e)},this.pluckEmailTemplateLabel$=this.enableWhiteLabeling$.pipe(p(e=>i=>{if(i){let o=$localize`Custom template`;return e?o:Et({components:[o,_(wr)],$element:{classList:"flex items-center gap-2"}})}return $localize`Waitwhile template`})),this.pluckEmailTemplateSublabel=e=>e?$localize`Send email body a standalone email`:$localize`Put email body inside the Waitwhile email template`,this.readonly$=this.enableCustomAlertTexts$.pipe(p(e=>!e)),this.fetchEmailPreview=e=>this.messageRx.getMessagePreview(e,"EMAIL"),this.fetchPushPreview=e=>this.messageRx.getMessagePreview(e,"APP"),this.fetchSmsPreview=e=>this.messageRx.getMessagePreview(e,"SMS"),this.showEmailPositionByMessageType={"WAITLIST-NEXT":!0},this.showSmsPositionByMessageType={"WAITLIST-NEXT":!0},this.showPushPositionByMessageType={"WAITLIST-NEXT":!0},this.showConfirmByMessageType={"WAITLIST-NEXT":!0},this.showBookingRemindersByMessageType={"BOOKING-REMINDER":!0},this.showFollowUpByMessageType={"BOOKING-FOLLOW-UP":!0,"WAITLIST-FOLLOW-UP":!0},this.showVisitPropertiesByMessageType={"BOOKING-RESCHEDULED":!0,"WAITLIST-RESCHEDULED":!0,"USER-BOOKING-RESCHEDULED":!0,"USER-WAITLIST-RESCHEDULED":!0},this.subscribeToSetInitialValue(),this.layout.updateFeatureContext({pendingChanges:{formId:this.formId,save:()=>this.save(),reset:()=>this.reset(),store:this.pendingChangesStore,enabledConfig:{permissions:["locations.update"]}}}),this.subscribeToRelationChanges()}subscribeToRelationChanges(){this.relation$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{this.relationFormControl.setValue(e,{emitEvent:!1})})}subscribeToSetInitialValue(){A([this.initialMessageTemplates$.pipe(Ee(se),Ee(e=>e.length>0)),this.defaultLanguage$.pipe(Ee(se)),this.serverDefaultMessageTemplate$,this.userDefaultMessageTemplate$,this.enableCustomPushTapUrl$,this.enableSmsConditions$,this.enabledChannels$]).pipe(hs(()=>this.smsActiveFormControl.pristine&&this.emailActiveFormControl.pristine&&this.pushActiveFormControl.pristine&&this.whiteLabelFormControl.pristine&&this.emailPositionFormControl.pristine&&this.smsPositionFormControl.pristine&&this.pushPositionFormControl.pristine&&this.relationFormControl.pristine&&this.confirmFormControl.pristine&&this.followUpFormControl.pristine&&this.bookingReminderFormControl.pristine&&this.formRecord.pristine&&this.changedPropertiesFormControl.pristine),z(this.ngOnDestroy$)).subscribe(([e,i,o,n,u,h,x])=>{for(let P of Object.keys(this.formRecord.controls))this.formRecord.removeControl(P);this.setInitialFormControlValues(e,x,h);for(let P of e){if(!P.language)continue;let K=this.createFormGroup(P.messageType);this.formRecord.addControl(P.language,K);let de=this.getMessageTemplateForLanguage(P,o,n,i);this.setInitialFormGroupValue(K,de,P.language)}u||this.pushTapDestinationUrlFormControl.disable({emitEvent:!1}),this.formInitSub.next(),this.pendingChangesStore.resetInitialValue(this.trackPendingChangesFormArray),this.pendingChangesStore.resetInitialValue(this.trackPendingChangesFormArray),this.changeDetectorRef.markForCheck()})}removeBookingReminder(e,i){e.removeAt(i),this.bookingReminderSnapshotFormControl.markAsDirty(),this.bookingReminderSnapshotFormControl.setValue(JSON.stringify(e.getRawValue()))}addBookingReminder(e){e.push(new C(3600,{nonNullable:!0})),this.bookingReminderSnapshotFormControl.markAsDirty(),this.bookingReminderSnapshotFormControl.setValue(JSON.stringify(e.getRawValue()))}handleEmailTemplateEvent(e){return R(this,null,function*(){(yield b(this.enableWhiteLabeling$))||(e.preventDefault(),e.stopPropagation(),yield b(this.dialog.open(_(hr,{missingAccountFeatures:["enableWhiteLabeling"]}),{size:this.breakpoints.isBelowSmall?"bottom-sheet":"auto"}).afterClosed$))})}handleSmsConditionsEvent(e){return R(this,null,function*(){(yield b(this.smsConditionsDisabled$))&&(e.preventDefault(),e.stopPropagation(),yield b(this.dialog.open(_(hr,{missingAccountFeatures:["enableSmsConditions"]}),{size:this.breakpoints.isBelowSmall?"bottom-sheet":"auto"}).afterClosed$))})}save(){return R(this,null,function*(){if(!this.messageType||this.pushTapDestinationFormControl.invalid||this.pushTapDestinationUrlFormControl.invalid)return;let e={};for(let[i,o]of Object.entries(this.formRecord.controls))e[i]=this.formGroupToClientMessageTemplate(o,this.messageType,i);this.saved.emit(e)})}reset(){return R(this,null,function*(){let e=yield b(this.enabledChannels$),i=yield b(this.enableSmsConditions$);this.formRecord.reset(),this.setInitialFormControlValues(this.initialMessageTemplates??[],e,i);for(let o of this.initialMessageTemplates??[]){if(!o.language)continue;let n=this.formRecord.controls[o.language];if(n){let u=this.getMessageTemplateForLanguage(o,this.serverDefaultMessageTemplate,this.userDefaultMessageTemplate,this.defaultLanguage);this.setInitialFormGroupValue(n,u,o.language)}}this.trackPendingChangesFormArray.markAsPristine(),this.trackPendingChangesFormArray.updateV
22alueAndValidity(),this.formRecord.updateValueAndValidity(),this.changeDetectorRef.markForCheck()})}formGroupToClientMessageTemplate(e,i,o){let n=[];this.emailActiveFormControl.value&&n.push("EMAIL"),this.smsActiveFormControl.value&&n.push("SMS"),this.pushActiveFormControl.value&&n.push("APP");let u=[];i==="BOOKING-REMINDER"?u=this.bookingReminderFormControl.controls.map(K=>K.value*-1):(i==="BOOKING-FOLLOW-UP"||i==="WAITLIST-FOLLOW-UP")&&(u=[this.followUpFormControl.value]);let h=this.smsConditionsFormControl.value==="ALWAYS"?null:this.smsConditionsFormControl.value,x=this.pushTapDestinationFormControl.value,P=x==="CUSTOM_URL"?this.pushTapDestinationUrlFormControl.value??"":"";return{appNextTriggerPosition:this.toPayloadTriggerPosition(this.pushPositionFormControl.value),body:e.controls.body.value,channels:n,emailNextTriggerPosition:this.toPayloadTriggerPosition(this.emailPositionFormControl.value),language:o,messageType:i,nextTextConfirm:this.confirmFormControl.value,nextTextPositionRelativeToResource:this.relationFormControl.value,pushTitle:e.controls.pushTitle.value,push:e.controls.push.value,pushTapDestination:x,pushTapCustomUrl:P,scheduleTimes:u,short:e.controls.short.value,smsCondition:h,smsNextTriggerPosition:this.toPayloadTriggerPosition(this.smsPositionFormControl.value),subject:e.controls.subject.value,whiteLabel:this.whiteLabelFormControl.value,trigger:this.toPayloadTrigger(this.changedPropertiesFormControl.value)}}getMessageTemplateForLanguage(e,i,o,n){return e.language===n?this.mergeDefaultMessageTemplates(i??{},o??{},e):e}setInitialFormControlValues(e,i,o){let n=e[0];if(!n)return;Ft(n.messageType)&&(this.isEmailActive=n.channels.includes("EMAIL"),this.emailActiveFormControl.setValue(n.channels.includes("EMAIL"),{emitEvent:!1}),this.isSmsActive=n.channels.includes("SMS"),this.smsActiveFormControl.setValue(n.channels.includes("SMS"),{emitEvent:!1}),this.isPushActive=n.channels.includes("APP"),this.pushActiveFormControl.setValue(n.channels.includes("APP"),{emitEvent:!1})),li(n.messageType)&&(this.isEmailActive=i.includes("EMAIL"),this.isSmsActive=i.includes("SMS"),this.isPushActive=i.includes("APP"),this.emailActiveFormControl.setValue(i.includes("EMAIL"),{emitEvent:!1}),this.smsActiveFormControl.setValue(i.includes("SMS"),{emitEvent:!1}),this.pushActiveFormControl.setValue(i.includes("APP"),{emitEvent:!1})),this.whiteLabelFormControl.setValue(n.whiteLabel??!1,{emitEvent:!1}),this.emailPositionFormControl.setValue(this.toViewTriggerPosition(n.emailNextTriggerPosition),{emitEvent:!1}),this.smsPositionFormControl.setValue(this.toViewTriggerPosition(n.smsNextTriggerPosition),{emitEvent:!1}),this.pushPositionFormControl.setValue(this.toViewTriggerPosition(n.appNextTriggerPosition),{emitEvent:!1}),this.relationFormControl.setValue(n.nextTextPositionRelativeToResource??!1,{emitEvent:!1}),this.confirmFormControl.setValue(n.nextTextConfirm??!1,{emitEvent:!1}),n.messageType==="BOOKING-REMINDER"&&(this.bookingReminderFormControl.clear(),nt(n.scheduleTimes).map(h=>{this.bookingReminderFormControl.push(new C(h*-1,{nonNullable:!0}))}),this.bookingReminderSnapshotFormControl.setValue(JSON.stringify(this.bookingReminderFormControl.getRawValue()),{emitEvent:!1})),(n.messageType==="BOOKING-FOLLOW-UP"||n.messageType==="WAITLIST-FOLLOW-UP")&&this.followUpFormControl.setValue(n.scheduleTimes?.[0]??3600,{emitEvent:!1}),this.pushTapDestinationFormControl.setValue(n.pushTapDestination??"STATUS_PAGE",{emitEvent:!1}),n.pushTapDestination==="CUSTOM_URL"&&this.pushTapDestinationUrlFormControl.setValue(n.pushTapCustomUrl??null,{emitEvent:!1});let u=n.smsCondition??"ALWAYS";this.smsConditionsFormControl.setValue(o?u:"ALWAYS",{emitEvent:!1}),n.trigger?.type==="CHANGED_ANY"&&this.changedPropertiesFormControl.setValue(n.trigger.value.filter(_c),{emitEvent:!1})}setInitialFormGroupValue(e,i,o){e.controls.subject.value||e.controls.subject.setValue(i.subject??"",{emitEvent:!1}),e.controls.body.value||e.controls.body.setValue(i.body??"",{emitEvent:!1}),e.controls.short.value||e.controls.short.setValue(i.short??"",{emitEvent:!1}),e.controls.pushTitle.value||e.controls.pushTitle.setValue(i.pushTitle??"",{emitEvent:!1}),e.controls.push.value||e.controls.push.setValue(i.push??"",{emitEvent:!1}),e.controls.language.value||e.controls.language.setValue(o,{emitEvent:!1})}createTranslationSwitcherItems(e,i){return e.pipe(bi(0,An),p(o=>o?o.filter(n=>n.language!==null).map(n=>{let u=i(n);return{code:n.language,content:u,locale:Yo(n.language??void 0),translated:!!u}}).sort((n,u)=>!n.locale?.languageName||!u.locale?.languageName?0:n.locale.languageName.localeCompare(u.locale.languageName)):[]))}toPayloadTriggerPosition(e){return Math.max(e-1,0)}toPayloadTrigger(e){if(!(!this.messageType||!this.showVisitPropertiesByMessageType[this.messageType]))return{type:"CHANGED_ANY",value:e}}toViewTriggerPosition(e){return(e??0)+1}mergeDefaultMessageTemplates(...e){let i={};for(let o of e)for(let[n,u]of Object.entries(o))u&&(i[n]=u);return i}createFormGroup(e){return new F({messageType:new C(e,{nonNullable:!0,validators:[re.required]}
22),subject:new C("",{nonNullable:!0,validators:[re.maxLength(1e4)]}),body:new C("",{nonNullable:!0,validators:[re.maxLength(1e5)]}),short:new C("",{nonNullable:!0,validators:[re.maxLength(5e3)]}),pushTitle:new C("",{nonNullable:!0,validators:[re.maxLength(1e3)]}),push:new C("",{nonNullable:!0,validators:[re.maxLength(1e3)]}),language:new C(null,{nonNullable:!0,validators:[re.required]})})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-message-template-form"]],hostAttrs:[1,"ww-settings-message-template-form","flex","flex-col","gap-4"],inputs:{defaultLanguage:"defaultLanguage",language:"language",messageType:"messageType",initialMessageTemplates:"initialMessageTemplates",serverDefaultMessageTemplate:"serverDefaultMessageTemplate",userDefaultMessageTemplate:"userDefaultMessageTemplate"},outputs:{saved:"saved",languageChanged:"languageChanged"},features:[Oi([...Pc({requiresAccountFeatures:{provide:ol,multi:!0,useValue:e=>e.requiresAccountFeatures?e.requiresAccountFeatures:null}})]),O],decls:7,vars:10,consts:()=>{let e;e=$localize`How long after the visit should the message be sent?`;let i;i=$localize`Notify only when`;let o;o=$localize`Send the message when any of these visit properties change.`;let n;n=$localize` Specify when to send the ${"\uFFFD0\uFFFD"}:INTERPOLATION: message. `;let u;u=$localize` Send ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:SMS${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG: when the customer position in line is `;let h;h=$localize` Send ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:Email${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG: when the customer position in line is `;let x;x=$localize` Send ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:push${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG: when the customer position in line is `;let P;P=$localize` Send also to customers joining before the trigger position `;let K;K=$localize` This message will be sent instead of the Confirmation message to those customers. `;let de;de=$localize` How long before the visit should the message be sent? `;let Ce;Ce=$localize`Add reminder`;let ue;ue=$localize`Maximum ${"\uFFFD0\uFFFD"}:INTERPOLATION: reminders allowed`;let ge;ge=$localize`Email`;let rt;rt=$localize`Customize outgoing email.`;let st;st=$localize`Subject line`;let et;et=$localize`Customize the email subject line.`;let ye;ye=$localize`Body`;let wt;wt=$localize`Customize the email body using HTML, Liquid or Markdown.`;let he;he=$localize`Email template`;let Vt;Vt=$localize`Select the email template you want to use.`;let Ne;Ne=$localize`Activate email`;let Jt;Jt=$localize`Email status`;let Ii;Ii=$localize`Turn this email on or off.`;let Mi;Mi=$localize`SMS`;let Oe;Oe=$localize`Customize outgoing SMS.`;let jo;jo=$localize`Message`;let yn;yn=$localize`Customize the SMS`;let In;In=$localize`Activate SMS`;let Mn;Mn=$localize`SMS status`;let bn;bn=$localize`Turn this SMS on or off.`;let Nn;Nn=$localize`SMS Conditions`;let On;On=$localize`Send this SMS under the following condition.`;let os;os=$localize`Push`;let ns;ns=$localize` Customize outgoing push notifications. `;let as;as=$localize`Message`;let rs;rs=$localize`Customize the push notification message.`;let ss;ss=$localize`Activate push`;let ls;ls=$localize`e.g. https://example.org`;let cs;cs=$localize`Title`;let ps;ps=$localize`Customize the push notification title.`;let us;us=$localize`Push status`;let ms;ms=$localize`Turn this push on or off.`;let ds;ds=$localize`Push tap destination`;let _s;_s=$localize`Choose where the customer is sent when they tap the push notification.`;let Ss;return Ss=$localize` To update the message templates, please upgrade your plan. `,[["confirmLabel",""],["subject",""],["subjectTranslationSwitcherTmpl",""],["body",""],["bodyTranslationSwitcherTmpl",""],["short",""],["shortTranslationSwitcherTmpl",""],["push",""],["pushTranslationSwitcherTmpl",""],["pushTitle",""],["pushTitleTranslationSwitcherTmpl",""],n,u,h,x,P,K,de,Ce,ue,ge,rt,he,Vt,Jt,Ii,Mi,Oe,Mn,bn,Nn,On,os,ns,us,ms,ds,_s,Ss,[1,"flex","flex-col","gap-4","max-w-5xl",3,"wwForm","wwTrackPendingChanges","wwTrackPendingChangesUntil"],[1,"ww-settings-message-template-form-common","flex","flex-col","gap-4"],["label",e,3,"formControl"],["label",i,"sublabel",o,3,"withSelectAllOption","formControl","data","pluckLabel","selection","layout"],[1,"flex","flex-col","gap-6"],[1,"!flex","flex-col","gap-4",3,"wwFormFieldSize"],[1,"flex","flex-col","gap-1"],[1,"flex","justify-center","gap-1"],["size","auto",1,"w-16",3,"formControl"],["size","full",1,"w-full",3,"formControl","data","pluckLabel"],["size","full",1,"w-full",3,"formControl","data","pluckLabel","readonly"],[3,"layout","formControl","label"],["wwTypography","caption1","wwColor","darkerGrey"],[1,"flex","flex-col","gap-2"],[1,"flex","flex-row","large:items-center","items-start","min-w-0","max-w-full","gap-2"],["layout","vertical",3,"size","formControl"],["wwButton","tert
22iary",3,"click"],["icon","bx-x"],["icon","bx-plus"],["openIcon","bx-chevron-up","closedIcon","bx-chevron-down"],[1,"flex","gap-4","justify-between"],[1,"flex","gap-4"],["size","x-large","icon","ww-message-type-email"],[1,"flex","flex-col","gap-0.5"],[1,"flex","items-center","gap-1"],["wwTypography","h5","wwColor","black"],["wwColor","darkerGrey"],["class","ww-settings-message-template-form-expansion-content",4,"wwExpansionContent"],[4,"wwOutlet"],[1,"ww-settings-message-template-form-expansion-content"],[3,"layout"],[3,"click","layout"],[3,"layout","formControl","data","pluckLabel","pluckSublabel"],["id","subject","label",st,"sublabel",et,3,"layout","rows","editor","placeholder","formControl","suffixComponent","readonly","fetchPreview","refiner","stringify","defaultValue","restoreDefaultConfirmMessage","restoreDefaultConfirmTitle","variableMenuItems","completion"],["id","body","label",ye,"sublabel",wt,3,"layout","rows","editor","placeholder","formControl","suffixComponent","readonly","fetchPreview","refiner","stringify","defaultValue","restoreDefaultConfirmMessage","restoreDefaultConfirmTitle","variableMenuItems","completion"],["layout","vertical","label",Ne,3,"formControl"],[1,"mr-1",3,"languageCodeSelected","selectedCode","translationSwitcherItems"],["size","x-large","icon","ww-message-type-sms"],["id","short","label",jo,"sublabel",yn,3,"layout","rows","editor","placeholder","formControl","withSmsCharacterCounter","suffixComponent","readonly","fetchPreview","refiner","stringify","defaultValue","restoreDefaultConfirmMessage","restoreDefaultConfirmTitle","variableMenuItems","completion"],["layout","vertical","label",In,3,"formControl"],["layout","vertical",1,"max-w-lg",3,"formControl","data","pluckLabel"],["size","x-large","icon","ww-message-type-push"],["id","push","label",as,"sublabel",rs,3,"layout","rows","editor","placeholder","formControl","suffixComponent","readonly","fetchPreview","refiner","stringify","defaultValue","restoreDefaultConfirmMessage","restoreDefaultConfirmTitle","variableMenuItems","completion"],["layout","vertical","label",ss,3,"formControl"],[1,"grid","grid-cols-2","items-start","gap-3",3,"wwFormFieldSize"],["layout","vertical",1,"below-small:col-span-2",3,"formControl","pluckLabel","data"],["layout","vertical","placeholder",ls,1,"below-small:col-span-2",3,"formControl"],["id","push-subject","label",cs,"sublabel",ps,3,"layout","rows","editor","placeholder","formControl","suffixComponent","readonly","fetchPreview","refiner","stringify","defaultValue","restoreDefaultConfirmMessage","restoreDefaultConfirmTitle","variableMenuItems","completion"]]},template:function(i,o){if(i&1&&(Ye(0),S(1,"async"),Ye(2),S(3,"async"),Ye(4),S(5,"async"),E(6,PT,25,30)),i&2){let n=ot(T(1,1,o.labelLayout$));s(2);let u=ot(T(3,4,o.formFieldSize$));s(2);let h=ot(T(5,7,o.activeFormGroup$));s(2),f(h&&o.messageType&&n&&u?6:-1)}},dependencies:[X,Dt,oe,yt,ne,H,dn,pt,Ep,Ro,M,Se,at,Je,Mt,Yl,Kl,Ql,kt,vl,ft,We,ke,Xe,ze,He,Fe,ve,xe,we,Wt,L],styles:[`.ww-settings-message-template-form .ww-settings-message-template-form-common:empty{display:none}.ww-settings-message-template-form .ww-settings-message-template-form-common .ww-label-layout.ww-label-layout-horizontal:last-of-type{border-bottom:none;padding-bottom:0}.ww-settings-message-template-form .ww-settings-message-template-form-upgrade-info-bubble{background:radial-gradient(circle at 0 10%,var(--ww-background-color),var(--ww-color-lighterGrey) 50%);max-width:100%}.ww-settings-message-template-form .ww-expansion-content .ww-settings-message-template-form-expansion-content{display:flex;flex-direction:column;padding:16px;gap:24px;border-top:1px solid var(--ww-color-mediumGrey)}.ww-settings-message-template-form .ww-expansion-content .ww-label-layout.ww-label-layout-horizontal{border-bottom:none}
23/*noopmessage-template-form.component-PLO4UAEQ.css.map */
24`],encapsulation:2,changeDetection:0})}}return t})();function DT(t,a){t&1&&(l(0,"ww-info-bubble",1),w(1,0),r()),t&2&&(m("color","alert"),s(),Ht(a),qt(1))}function GT(t,a){if(t&1){let e=V();E(0,DT,2,2,"ww-info-bubble",1),S(1,"async"),l(2,"ww-settings-message-template-form",2),S(3,"async"),S(4,"async"),S(5,"async"),S(6,"async"),S(7,"async"),S(8,"async"),N("saved",function(o){D(e);let n=d();return G(n.onSave(o))})("languageChanged",function(o){D(e);let n=d();return G(n.onLanguageChanged(o))}),r()}if(t&2){let e,i=d();f((e=T(1,7,i.missingLanguageLabel$))?0:-1,e),s(2),m("language",T(3,9,i.language$))("defaultLanguage",T(4,11,i.locationRx.defaultLanguage$))("messageType",T(5,13,i.messageType$))("initialMessageTemplates",T(6,15,i.clientMessageTemplates$))("serverDefaultMessageTemplate",T(7,17,i.serverDefaultMessageTemplate$))("userDefaultMessageTemplate",T(8,19,i.userDefaultMessageTemplate$))}}var Zr=(()=>{class t extends q{constructor(){super(),this.locationRx=c(v),this.layout=c(le),this.messageConfigRx=c(ki),this.messageTemplateService=c(Ti),this.messageTemplateRx=c(ci),this.queryParams=c(It),this.router=c(Ve),this.customerMessageBreadcrumbs=[yi,{name:$localize`Customer messages`,routerLink:"/settings/customer-messages"}],this.teamNotificationBreadcrumbs=[yi,{name:$localize`Team notifications`,routerLink:"/settings/team-notifications"}],this.breadcrumbs=this.customerMessageBreadcrumbs,this.queryParams$=Ri().pipe(p(e=>({type:e.type??null,language:e.language??null}))),this.messageType$=this.queryParams$.pipe(p(e=>dc(e.type)?e.type:null),Ee(se)),this.language$=this.queryParams$.pipe(p(e=>e.language??null)),this.messageTemplates$=this.messageType$.pipe(U(e=>e?this.messageTemplateRx.getMessageTemplates({messageType:e}):Y(null)),p(e=>e?.results),this.shareReplay()),this.messageConfig$=this.messageType$.pipe(U(e=>e?this.messageConfigRx.getMessageConfig(e):Y(null)),this.shareReplay()),this.languages$=this.locationRx.getCurrentLocation(["publicLocales"]).pipe(p(e=>So(e.publicLocales.map(i=>$t(i)?.languageCode).filter(se))),this.shareReplay()),this.clientMessageTemplates$=A([this.languages$,this.messageType$]).pipe(U(([e,i])=>i?A(e.filter(se).map(o=>this.messageTemplateService.getClientMessageTemplate(i,o))):Y([])),p(e=>e.filter(se))),this.serverDefaultMessageTemplate$=this.messageType$.pipe(U(e=>this.messageTemplateService.getServerMessageTemplate(e)),this.shareReplay()),this.userDefaultMessageTemplate$=this.messageType$.pipe(U(e=>this.messageTemplateRx.getMessageTemplate(e,null)),this.shareReplay()),this.missingLanguages$=A([this.languages$,this.messageConfig$,this.messageTemplates$]).pipe(p(([e,i,o])=>!o||!i?[]:e.filter(n=>{let u=o.find(h=>h.language===n);return u?!!(i.channels.includes("EMAIL")&&(!u.subject||!u.body)||i.channels.includes("SMS")&&!u.short||i.channels.includes("APP")&&!u.pu
24sh):i?i.channels.length>0:!1})),this.shareReplay()),this.defaultLanguageLabel$=this.locationRx.defaultLanguage$.pipe(p(e=>{let i=Yo(e??sl);return i?i.languageName:$localize`Default language`})),this.missingLanguageLabel$=A([this.missingLanguages$,this.locationRx.defaultLanguage$]).pipe(p(([e,i])=>{let o=e.map(n=>{if(!n||n===i)return null;let u=Yo(n);return u?u.languageName:null}).filter(se);return o.length===0?null:o.length===1?$localize`${o[0]} is missing translations.`:$localize`${xn(o,$localize`and`)} are missing translations.`})),this.isLoading$=this.clientMessageTemplates$.pipe(p(e=>e===null),Re(!0)),this.isLoaded$=this.isLoading$.pipe(p(e=>!e)),this.layout.setFeatureContext({name:"",breadcrumbs:this.breadcrumbs}),this.subscribeToFeatureContext(),this.subscribeToLanguageChange(),this.subscribeToLocationChange()}onLanguageChanged(e){this.queryParams.set("language",e)}navigateToParent(){this.router.navigate([this.breadcrumbs[this.breadcrumbs.length-1].routerLink])}subscribeToLocationChange(){this.locationRx.locationChanged$.pipe(z(this.ngOnDestroy$)).subscribe(()=>{this.navigateToParent()})}subscribeToFeatureContext(){this.messageType$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{Ft(e)?this.breadcrumbs=this.customerMessageBreadcrumbs:li(e)&&(this.breadcrumbs=this.teamNotificationBreadcrumbs),this.layout.updateFeatureContext({name:vt[e],breadcrumbs:this.breadcrumbs})})}subscribeToLanguageChange(){this.locationRx.defaultLanguage$.pipe(z(this.ngOnDestroy$)).subscribe(e=>this.onLanguageChanged(e))}onSave(e){return R(this,null,function*(){yield Promise.all([this.saveDefaultMessageTemplate(e),...Object.values(e).map(i=>b(this.messageTemplateService.saveClientMessageTemplate(i)))]),this.navigateToParent()})}saveDefaultMessageTemplate(e){return R(this,null,function*(){let i=yield b(this.locationRx.defaultLanguage$);if(!i)return;let o=e[i];if(o)return b(this.messageTemplateService.saveClientMessageTemplate(Ks(o,["language"])))})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-message-template-editor"]],hostAttrs:[1,"ww-settings-message-template-editor","flex","flex-col","gap-6"],features:[O],decls:2,vars:3,consts:()=>{let e;return e=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `,[e,[3,"color"],[3,"saved","languageChanged","language","defaultLanguage","messageType","initialMessageTemplates","serverDefaultMessageTemplate","userDefaultMessageTemplate"]]},template:function(i,o){i&1&&(E(0,GT,9,21),S(1,"async")),i&2&&f(T(1,1,o.isLoaded$)?0:-1)},dependencies:[X,Ea,M,He,dm,L],encapsulation:2,changeDetection:0})}}return t})();var _m=(()=>{class t extends pi{constructor(){super(...arguments),this.dialog=c(Ae),this.locationRx=c(v),this.snackBar=c(zl),this.updateLocationRx=c(Te)}createActions(e){return{edit:this.locationRx.getCurrentLocation(["savedReplies"]).pipe(p(i=>({api:()=>{let o=nt(i.savedReplies).findIndex(n=>n.name===e.name&&n.body===e.body);o!==-1&&this.dialog.open(_(_n,{index:o}),{size:"medium"})},label:$localize`Edit`,icon:"bx-edit-alt",eventLoggerName:"edit_saved_reply_opened",disabled:!1}))),delete:this.locationRx.getCurrentLocation(["id","savedReplies"]).pipe(p(i=>({api:()=>R(this,null,function*(){if(yield b(this.dialog.openConfirm({title:$localize`Delete saved reply`,message:$localize`Are you sure you want to delete this saved reply?`,confirmLabel:$localize`Delete`,confirmColor:"warning"}).afterClosed$)){let n=nt(i.savedReplies),u=n.findIndex(x=>x.name===e.name&&x.body===e.body);if(u===-1){this.snackBar.open({message:$localize`Saved reply could not be deleted`});return}let h={savedReplies:n.filter((x,P)=>P!==u)};this.updateLocationRx.payload.next({locationId:i.id,updates:h})}}),label:$localize`Delete`,icon:"bx-trash",color:"warning",type:"warning",eventLoggerName:"deleted_saved_reply",disabled:!1,enabledConfig:{permissions:["locations.update"]}})))}}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Sm=(()=>{class t{constructor(){this.properties={name:{key:"name",label:$localize`Name`,display:e=>e.name}
24,body:{key:"body",label:$localize`Body`,display:e=>Vs(e.body,40)}}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var kT=["actionsMenuTmpl"];function WT(t,a){t&1&&g(0,"ww-empty-state",3)}function zT(t,a){if(t&1&&(g(0,"ww-model-action-menu",4),S(1,"async")),t&2){let e=a.$implicit;m("actions",T(1,1,e.actions$))}}var Tm=(()=>{class t extends q{constructor(){super(),this.dialog=c(Ae),this.locationRx=c(v),this.router=c(Ve),this.savedRepliesActions=c(_m),this.savedRepliesDisplay=c(Sm),this.updateLocationWrite=c(Te),this.breakpoints=c($i),this.layout=c(le),this.refetch$=Zt(this.updateLocationWrite.response$).pipe(Re(null)),this.items$=this.refetch$.pipe(U(()=>this.locationRx.getCurrentLocation(["savedReplies"]).pipe(p(e=>nt(e.savedReplies).map(i=>W(y({},i),{actions$:this.savedRepliesActions.getActions(i)}))))),this.shareReplay()),this.pluckActions=()=>this.actionsMenuTmpl,this.isLoading$=this.items$.pipe(p(e=>e===null),Re(!0)),this.columns=Bi(this.savedRepliesDisplay.properties),this.pluckCellLabel=e=>zi(e,this.savedRepliesDisplay.properties),this.layout.updateFeatureContext({addActions:[{label:$localize`Create saved reply`,eventLoggerName:"opened_create_saved_reply",api:()=>this.create()}]})}onRowClicked(e){return R(this,null,function*(){let o=(yield b(this.items$)).findIndex(u=>u.name===e.name&&u.body===e.body);if(o===-1)return;let n=yield b(this.breakpoints.isBelowMobile$);this.dialog.open(_(_n,{index:o}),{size:n?"fullscreen":"medium"})})}create(){return R(this,null,function*(){let e=yield b(this.breakpoints.isBelowMobile$);this.dialog.open(_(_n),{size:e?"fullscreen":"medium"})})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-saved-replies"]],viewQuery:function(i,o){if(i&1&&ti(kT,7),i&2){let n;ii(n=oi())&&(o.actionsMenuTmpl=n.first)}},hostAttrs:[1,"ww-settings-saved-replies","flex","flex-col","gap-6"],features:[O],decls:7,vars:10,consts:()=>{let e;return e=$localize`No saved found`,[["emptyStateTmpl",""],["actionsMenuTmpl",""],[3,"rowClicked","loading","data","columns","pluckCellLabel","pluckActions","placeholder"],["icon","ww-empty-state","message",e],[3,"actions"]]},template:function(i,o){if(i&1&&(l(0,"ww-table",2),S(1,"async"),S(2,"async"),N("rowClicked",function(u){return o.onRowClicked(u)}),r(),$(3,WT,1,0,"ng-template",null,0,me)(5,zT,2,3,"ng-template",null,1,me)),i&2){let n=ie(4);m("loading",T(1,6,o.isLoading$))("data",T(2,8,o.items$))("columns",o.columns)("pluckCellLabel",o.pluckCellLabel)("pluckActions",o.pluckActions)("placeholder",n)}},dependencies:[Le,ni,X,H,Vi,Ze,M,si,L],encapsulation:2,changeDetection:0})}}return t})();var BT=["actionsMenuTmpl"],UT=()=>({tab:"notifications"}),VT=t=>({params:t});function XT(t,a){t&1&&g(0,"ww-empty-state",7)}function HT(t,a){if(t&1&&(g(0,"ww-model-action-menu",8),S(1,"async")),t&2){let e=a.$implicit;m("actions",T(1,2,e.actions$))("label",e.name)}}var gm=(()=>{class t extends q{constructor(){super(...arguments),this.pageEventSub=new Ot(Da),this.messageTemplateActions=c(Bo),this.messageTemplateProperties=c(ka),this.layout=c(le),this.locationRx=c(v),this.accountRx=c(Ue),this.messageTemplateRx=c(ci),this.router=c(Ve),this.updateMessageTemplateWrite=c(Mo),this.updateTranslatedMessageTemplateWrite=c(bo),this.messageTemplateService=c(Ti),this.queryParams=c(It),this.route=c(mo),this.registrationType$=this.route.queryParamMap.pipe(p(e=>{let i=e.get("type");return Ga(i)?i:null})),this.pluckActions=()=>this.actionsMenuTmpl,this.availableMessageTypes$=A([this.locationRx.getCurrentLocation(["isBookingActive","isWaitlistActive","bookingManualConfirmation","bookingSyncWaitingEnabled","bookingCheckinToWaitlist"]),this.accountRx.hasAccountFeature
24("enableSurveys")]).pipe(p(([e,i])=>Tr.filter(o=>o.startsWith("USER-BOOKING-")&&!e?.isBookingActive||o==="USER-BOOKING-REQUESTED"&&!e?.bookingManualConfirmation||o==="USER-BOOKING-WAITING"&&!(e?.bookingCheckinToWaitlist||e?.bookingSyncWaitingEnabled)||o.startsWith("USER-WAITLIST-")&&!e?.isWaitlistActive?!1:o==="USER-SURVEY-ANSWERED"?i:!0)),this.shareReplay()),this.defaultTeamNotifications$=this.messageTemplateRx.serverMessageTemplates$.pipe(p(e=>Tr.map(i=>{let o=e?.[i];return o?{type:i,template:o}:null}).filter(se)),this.shareReplay()),this.items$=A([this.defaultTeamNotifications$,this.registrationType$,this.availableMessageTypes$]).pipe(p(([e,i,o])=>e.map(n=>{if(!o.includes(n.type)||i&&!(n.type.startsWith(`${rm}-${i}`)||n.type==="USER-INCOMING-MESSAGE"||n.type==="USER-SURVEY-ANSWERED"))return null;let u=W(y({},n),{messageType:n.type,channels:[]});return W(y({name:vt[u.type]},u),{actions$:this.messageTemplateActions.getActions(u),isTranslated:!0})}).filter(se)),this.shareReplay()),this.isLoading$=this.items$.pipe(p(e=>e===null),Re(!0)),this.columns=Bi(this.messageTemplateProperties.getProperties("USER-BOOKING-CONFIRM")),this.pluckCellLabel=e=>zi(e,this.messageTemplateProperties.getProperties(e.messageType))}setRegistrationType(e){e?this.queryParams.set("type",e):this.queryParams.update({remove:["type"]})}onRowClicked(e){this.messageTemplateService.editClientMessageTemplate(e)}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-team-notifications"]],viewQuery:function(i,o){if(i&1&&ti(BT,7),i&2){let n;ii(n=oi())&&(o.actionsMenuTmpl=n.first)}},hostAttrs:[1,"ww-settings-team-notifications","flex","flex-col","gap-6"],features:[O],decls:14,vars:18,consts:()=>{let e;e=$localize`Notifications page`;let i;i=$localize` Each user manages which notifications to receive via their ${"\uFFFD#3\uFFFD"}:START_TAG_WW_LINK:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_WW_LINK:`;let o;return o=$localize`No team notifications found`,[["emptyStateTmpl",""],["actionsMenuTmpl",""],i,["href","/user","content",e,"type","router-link",3,"queryParams","inline"],[1,"flex","flex-col","gap-6"],[3,"typeChanged","selectedType"],[3,"rowClicked","loading","data","columns","pluckCellLabel","pluckActions","placeholder"],["icon","ww-empty-state-services","message",o],[3,"actions","label"]]},template:function(i,o){if(i&1&&(l(0,"ww-info-bubble")(1,"div"),tt(2,2),g(3,"ww-link",3),it(),r()(),l(4,"div",4)(5,"ww-settings-registration-type-tabs",5),S(6,"async"),N("typeChanged",function(u){return o.setRegistrationType(u)}),r(),l(7,"ww-table",6),S(8,"async"),S(9,"async"),N("rowClicked",function(u){return o.onRowClicked(u)}),r()(),$(10,XT,1,0,"ng-template",null,0,me)(12,HT,2,4,"ng-template",null,1,me)),i&2){let n=ie(11);s(3),m("queryParams",Ki(16,VT,At(15,UT)))("inline",!0),s(2),m("selectedType",T(6,9,o.registrationType$)),s(2),m("loading",T(8,11,o.isLoading$))("data",T(9,13,o.items$))("columns",o.columns)("pluckCellLabel",o.pluckCellLabel)("pluckActions",o.pluckActions)("placeholder",n)}},dependencies:[Le,H,Vi,Ze,M,He,bt,si,Wa,L],styles:[`.ww-settings-team-notifications .ww-settings-team-notifications-registration-types .ww-select-trigger-placeholder{color:var(--ww-color-black)}
25/*noopteam-notifications.component-HH4CCDZ5.css.map */
26`],encapsulation:2,changeDetection:0})}}return t})();var wn={CANCELLED:"CANCELLED",CONFIRMED:"CONFIRMED",ARRIVED:"ARRIVED",DELAYED:"DELAYED",BLOCK:"BLOCK",UNBLOCK:"UNBLOCK",JOIN:"JOIN"},be={JOIN:{action:$localize`Join`,words:["add","join","signup","+"],description:$localize`This will add the guest to the waitlist/send the guest a link to the online registration.`},CANCELLED:{action:$localize`Cancel`,words:["cancel","remove","take off","take me off"],description:$localize`This will cancel the visit for the guest and remove them from the waitlist. It will add the Cancelled tag to the visit.`},CONFIRMED:{action:$localize`Confirm`,words:["confirm","confirmed"],description:$localize`This will confirm the visit for the guest and add the Confirmed tag to the visit.`,notes:$localize`This does not work if the visit is cancelled, completed or in the past.`},ARRIVED:{action:$localize`Arrived`,words:["arrive","arrived","here","ready","i\xB4m here"],description:$localize`This will mark the guest as arrived by adding the Arrived tag to the visit.`,notes:$localize`This does not work if the visit is cancelled, completed or in the past.`},DELAYED:{action:$localize`Delayed`,words:["delay","delayed","late","i\xB4m running late"],description:$localize`This will mark the guest as delayed by adding the Delayed tag to the visit.`,notes:$localize`This does not work if the visit is cancelled, completed or in the past.`},BLOCK:{action:$localize`Block`,words:["stop","unsubscribe","block","end","quit","stopall"],description:$localize`This adds the guest’s phone number to a list that will no longer receive SMS messages from Waitwhile.`},UNBLOCK:{action:$localize`Unblock`,words:["start","unstop","unblock","subscribe"],description:$localize`This allows the guest to continue to receive messages from Waitwhile again if they were previously blocked.`}};
26function jT(t,a){if(t&1&&(l(0,"ww-chip",10),k(1),r()),t&2){let e=a.$implicit;s(),fe(e)}}function KT(t,a){if(t&1&&(l(0,"p",11)(1,"strong"),w(2,4),r(),l(3,"span",12),k(4),r()()),t&2){let e=d().$implicit;s(4),fe(e.notes)}}function YT(t,a){if(t&1&&(l(0,"tr")(1,"td"),k(2),r(),l(3,"td")(4,"div",9),ce(5,jT,2,1,"ww-chip",10,je),r()(),l(7,"td")(8,"p"),k(9),r(),E(10,KT,5,1,"p",11),r()()),t&2){let e=a.$implicit;s(2),fe(e.action),s(3),pe(e.words),s(4),Ke(" ",e.description," "),s(),f(e.notes?10:-1)}}var Em=(()=>{class t{constructor(){this.triggerWords=Object.values(be)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-registration-default-triggers"]],hostAttrs:[1,"ww-settings-registration-default-triggers"],decls:14,vars:0,consts:()=>{let e;e=$localize`Default trigger words`;let i;i=$localize`Action`;let o;o=$localize`Trigger words`;let n;n=$localize`What happens?`;let u;return u=$localize`Note: `,[e,i,o,n,u,[1,"ww-settings-registration-default-triggers-table"],[1,"w-28"],[1,"w-52"],[1,"w-96"],[1,"flex","flex-wrap","gap-2"],["size","x-small",1,"!inline-flex","uppercase"],[1,"pt-3"],[1,"italic"]]},template:function(i,o){i&1&&(l(0,"ww-dialog-layout")(1,"ww-dialog-layout-title"),w(2,0),r(),l(3,"ww-dialog-layout-content")(4,"table",5)(5,"tr")(6,"th",6),w(7,1),r(),l(8,"th",7),w(9,2),r(),l(10,"th",8),w(11,3),r()(),ce(12,YT,11,3,"tr",null,je),r()()()),i&2&&(s(12),pe(o.triggerWords))},dependencies:[M,Hn,jn,Kn,Yn],styles:[`.ww-settings-registration-default-triggers .ww-settings-registration-default-triggers-table{border-collapse:collapse;border:1px solid var(--ww-color-darkGrey)}.ww-settings-registration-default-triggers .ww-settings-registration-default-triggers-table tr{border-bottom:1px solid var(--ww-color-darkGrey)}.ww-settings-registration-default-triggers .ww-settings-registration-default-triggers-table tr:last-child{border-bottom:none}.ww-settings-registration-default-triggers .ww-settings-registration-default-triggers-table tr th,.ww-settings-registration-default-triggers .ww-settings-registration-default-triggers-table tr td{font-family:var(--ww-typography-body2-font-family);font-size:var(--ww-typography-body2-font-size);font-weight:var(--ww-typography-body2-font-weight);line-height:var(--ww-typography-body2-line-height);letter-spacing:var(--ww-typography-body2-letter-spacing);padding:8px 16px;text-align:left;vertical-align:top;border-left:1px solid var(--ww-color-darkGrey)}.ww-settings-registration-default-triggers .ww-settings-registration-default-triggers-table tr th:first-child,.ww-settings-registration-default-triggers .ww-settings-registration-default-triggers-table tr td:first-child{border-left:none}.ww-settings-registration-default-triggers .ww-settings-registration-default-triggers-table tr th{background-color:var(--ww-color-mediumGrey);color:var(--ww-color-darkerGrey);text-transform:uppercase}.ww-settings-registration-default-triggers .ww-settings-registration-default-triggers-table tr td:first-child{background-color:var(--ww-color-lightGrey);font-weight:500}
27/*noopdefault-triggers.component-EM5NJIRK.css.map */
28`],encapsulation:2,changeDetection:0})}}return t})();function QT(t,a){if(t&1&&(l(0,"div",5),tt(1,1),g(2,"a",6),it(),r(),g(3,"ww-embed-snippet",7),S(4,"async"),g(5,"ww-embed-snippet",8),S(6,"async"),g(7,"ww-embed-snippet",9),S(8,"async")),t&2){let e=d();s(3),m("value",T(4,3,e.scriptSnippet$)),s(2),m("value",T(6,5,e.inlineEmbedSnippet$)),s(2),m("value",T(8,7,e.modalEmbedSnippet$))}}function JT(t,a){if(t&1&&(l(0,"div",5),w(1,2),r(),g(2,"ww-embed-snippet",10),S(3,"async"),g(4,"ww-embed-snippet",11),S(5,"async")),t&2){let e=d();s(2),m("value",T(3,2,e.legacyEmbedSnippet$)),s(2),m("value",T(5,4,e.legacyButtonSnippet$))}}function ZT(t,a){t&1&&(l(0,"div",12)(1,"span"),k(2,"Embed script"),r(),l(3,"ww-chip",13),k(4,"New"),r()())}var fm=(()=>{class t extends q{constructor(){super(...arguments),this.internalLinks=c(Me),this.locationRx=c(v),this.userRx=c(Gi),this.signUpText=$localize`Sign-up to our Waitlist`,this.joinWaitlistText=$localize`Join Waitlist`,this.scriptSnippet$=Y(this.createScriptSnippet()),this.inlineEmbedSnippet$=this.locationRx.getCurrentLocation(["shortName"]).pipe(p(e=>this.createInlineEmbedSnippet(e.shortName))),this.modalEmbedSnippet$=this.locationRx.getCurrentLocation(["shortName"]).pipe(p(e=>this.createModalEmbedSnippet(e.shortName))),this.legacyButtonSnippet$=this.internalLinks.publicRegistrationUrl$.pipe(p(e=>this.createLegacyButtonSnippet(e))),this.legacyEmbedSnippet$=this.internalLinks.publicRegistrationUrl$.pipe(p(e=>this.createLegacyIframeSnippet(e)))}createScriptSnippet(){return'<script src="https://cdn.jsdelivr.net/npm/@waitwhile/waitwhile-embed/dist/waitwhile-embed.min.js"><\/script>'}createInlineEmbedSnippet(e){return`<div id="waitwhile"></div>
29<script>
30  const waitwhile = Waitwhile.Embed({
31    locationId: '${e}',
32  });
33
34  waitwhile.render('#waitwhile');
35<\/script>`}createModalEmbedSnippet(e){return`<button id="btn">${this.joinWaitlistText}</button>
36<script>
37  const { dialog } = Waitwhile.Modal({
38    locationId: '${e}',
39  });
40
41  const btn = document.getElementById('btn');
42  btn.addEventListener('click', () => {
43    dialog.show();
44  });
45<\/script>`}createLegacyButtonSnippet(e){return`<a href="${e}?registration=waitlist" target="_blank"><img alt="${this.signUpText}" src="https://firebasestorage.googleapis.com/v0/b/waitwhile-app.appspot.com/o/images%2Fapp%2Fwaitwhile-join-waitlist-embed.png?alt=media&token=fc5471d9-8721-42a4-8ecc-441dc5535555" title="${this.signUpText}"></a>`}createLegacyIframeSnippet(e){return`<iframe src="${e}?registration=waitlist" allowtransparency="true" frameborder="0" scrolling="no" width="100%" height="900px"></iframe>`}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-registration-embed-code"]],hostAttrs:[1,"ww-settings-registration-embed-code","flex","flex-col","gap-4","items-start"],features:[O],decls:5,vars:1,consts:()=>{let e;e=$localize`Iframe`;let i;i=$localize`Add the script`;let o;o=$localize`Place this script just before the closing </head> tag.`;let n;n=$localize`Snippet copied!`;let u;u=$localize`Inline embed`;let h;h=$localize`Use this snippet to render your registration flow directly into your webpage.`;let x;x=$localize`Snippet copied!`;let P;P=$localize`Modal embed`;let K;K=$localize`Use this snippet to present your registration flow in a modal on top of your existing webpage content.`;let de;de=$localize`Snippet copied!`;let Ce;Ce=$localize` Integrate your registration flow into your website with full responsiveness. Read our ${"\uFFFD#2\uFFFD"}:START_LINK:documentation${"\uFFFD/#2\uFFFD"}:CLOSE_LINK: to get started. `;let ue;ue=$localize`Embed widget`;let ge;ge=$localize`Copy this code snippet to your HTML page to display an iframe with the registration flow`;let rt;rt=$localize`Embed widget copied!`;let st;st=$localize`Embed button`;let et;et=$localize`Copy this code snippet to your HTML page to generate a button to 
45join the registration flow`;let ye;ye=$localize`Embed button copied!`;let wt;return wt=$localize` Integrate your registration flow into your website. Note that iframes have limited responsiveness. `,[["embedCodeTmpl",""],Ce,wt,["wwTab","",3,"label"],["wwTab","","label",e],[1,"max-w-3xl"],["href","https://developers.waitwhile.com/docs/javascript-embed-widgets","target","_blank",1,"underline"],["label",i,"sublabel",o,"copyMessage",n,1,"max-w-full",3,"value"],["label",u,"sublabel",h,"copyMessage",x,1,"max-w-full",3,"value"],["label",P,"sublabel",K,"copyMessage",de,1,"max-w-full",3,"value"],["label",ue,"sublabel",ge,"copyMessage",rt,1,"max-w-full",3,"value"],["label",st,"sublabel",et,"copyMessage",ye,1,"max-w-full",3,"value"],[1,"flex","flex-row","gap-1","items-center"],["size","x-small","wwBackgroundColor","success-alpha-10","wwColor","success"]]},template:function(i,o){if(i&1&&(l(0,"ww-tab-group"),$(1,QT,9,9,"ng-template",3)(2,JT,6,6,"ng-template",4),r(),$(3,ZT,5,0,"ng-template",null,0,me)),i&2){let n=ie(4);s(),m("label",n)}},dependencies:[gp,M,Hn,Je,nc,oc,L],styles:[`.ww-settings-registration-embed-code .ww-settings-registration-embed-code-textarea{font-family:var(--ww-typography-body2-font-family);font-size:var(--ww-typography-body2-font-size);font-weight:var(--ww-typography-body2-font-weight);line-height:var(--ww-typography-body2-line-height);letter-spacing:var(--ww-typography-body2-letter-spacing);border-radius:8px;background-color:var(--ww-color-black);color:var(--ww-color-white);padding:10px 12px}.ww-settings-registration-embed-code .ww-tab-group-content{padding:24px 0;display:flex;flex-direction:column;gap:24px}
46/*noopembed-code.component-JAXS4WYF.css.map */
47`],encapsulation:2,changeDetection:0})}}return t})();var Cm={SERVICES:$localize`Service`,RESOURCES:$localize`Resource`},hm={SERVICES:nn({content:Et({$element:{classList:["!inline"]},components:[an({content:$localize`Service triggers let customers join the waitlist for a specific service by texting a short code. For example, if your service prefix is “S” and the alias is “1”, texting “join S1” will add the customer to the waitlist for that service. `}),mr({type:"router-link",href:"/settings/services",content:$localize`Edit the aliases here`,inline:!0})]})}),RESOURCES:nn({content:Et({$element:{classList:["!inline"]},components:[an({content:$localize`Resource triggers let customers join the waitlist for a specific resource by texting a short code. For example, if your resource prefix is “R” and the alias is “1”, texting “join R1” will add the customer to the waitlist for that resource.`}),mr({type:"router-link",href:"/settings/resources",content:$localize`Edit the aliases here`,inline:!0})]})})},wm={SERVICES:$localize`Service prefix`,RESOURCES:$localize`Resource prefix`},ym={SERVICES:$localize`Set the prefix that appears before all service aliases in SMS registration.`,RESOURCES:$localize`Set the prefix that appears before all resource aliases in SMS registration.`},Im={SERVICES:$localize`Service alias`,RESOURCES:$localize`Resource alias`},Mm={SERVICES:$localize`Assign a unique alias that customers can text to join this service`,RESOURCES:$localize`Assign a unique alias that customers can text to join this resource`},es={SERVICES:["service"],RESOURCES:["resource"]};function eg(t,a){t&1&&te(0)}function tg(t,a){if(t&1&&(l(0,"div",0),$(1,eg,1,0,"ng-container",1),S(2,"async"),l(3,"form",2),g(4,"ww-chip-input",3),S(5,"async"),S(6,"async"),r()()),t&2){let e=d();m("wwTrackPendingChanges",e.prefixesFormControl)("wwTrackPendingChangesUntil",e.updateLocationWrite.response$),s(),m("wwOutlet",T(2,8,e.infoComponent$)),s(2),m("wwForm",e.formId),s(),m("label",T(5,10,e.prefixLabel$))("sublabel",T(6,12,e.prefixSublabel$))("uppercase",!0)("formControl",e.prefixesFormControl)}}var ts=(()=>{class t extends q{constructor(){super(),this.updateLocationWrite=c(Te),this.changeDetectorRef=c(Pt),this.coreLocationRx=c($e),this.layout=c(le),this.pendingChangesStore=c(ct),this.triggerType$=this.observe("triggerType"),this.formId="settings-registration-field-triggers-form",this.formInit=Is(!1),this.prefixesFormControl=new C([],{nonNullable:!0,validators:[re.maxLength(10)]}),this.currentLocation$=this.coreLocationRx.getCurrentNullableLocation(["id","signUpTriggers"]),this.fieldType$=this.triggerType$.pipe(p(e=>Cm[e])),this.infoComponent$=this.triggerType$.pipe(p(e=>hm[e])),this.prefixLabel$=this.triggerType$.pipe(p(e=>wm[e])),this.prefixSublabel$=this.triggerType$.pipe(p(e=>ym[e])),this.aliasLabel$=this.triggerType$.pipe(p(e=>Im[e])),this.aliasSublabel$=this.triggerType$.pipe(p(e=>
47Mm[e])),this.subscribe(),this.layout.updateFeatureContext({pendingChanges:{formId:this.formId,store:this.pendingChangesStore,enabledConfig:{permissions:["locations.update"]},reset:()=>this.reset(this.coreLocationRx.nullableLocation),save:()=>this.save()}})}reset(e){return R(this,null,function*(){if(!e)return;let i=yield b(this.triggerType$),o=[];switch(i){case"RESOURCES":o=e?.signUpTriggers?.[0]?.resourceWords??es.RESOURCES;break;case"SERVICES":o=e?.signUpTriggers?.[0]?.serviceWords??es.SERVICES;break;default:return}this.prefixesFormControl.setValue(o,{emitEvent:!1}),this.changeDetectorRef.markForCheck(),this.prefixesFormControl.dirty&&(this.prefixesFormControl.markAsPristine(),this.prefixesFormControl.updateValueAndValidity()),this.formInit.set(!0)})}save(){return R(this,null,function*(){if(this.prefixesFormControl.invalid)return;let e=yield b(this.currentLocation$);if(!e)return;let i=yield b(this.triggerType$);if(!i)return;let o=e.signUpTriggers?.[0],n={locationId:e.id,updates:{}};switch(i){case"RESOURCES":n.updates={signUpTriggers:[W(y({},o),{resourceWords:this.prefixesFormControl.value})]};break;case"SERVICES":n.updates={signUpTriggers:[W(y({},o),{serviceWords:this.prefixesFormControl.value})]};break;default:return}this.updateLocationWrite.payload.next(n)})}subscribe(){this.coreLocationRx.currentLocationSnapshot$.pipe(z(this.ngOnDestroy$)).subscribe(e=>this.reset(e))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-registration-field-triggers-form"]],hostAttrs:[1,"ww-settings-registration-field-triggers-form"],inputs:{triggerType:"triggerType"},features:[O],decls:1,vars:1,consts:()=>{let e;return e=$localize`Add keywords`,[[1,"flex","flex-col","gap-6",3,"wwTrackPendingChanges","wwTrackPendingChangesUntil"],[4,"wwOutlet"],[3,"wwForm"],["placeholder",e,3,"label","sublabel","uppercase","formControl"]]},template:function(i,o){i&1&&E(0,tg,7,14,"div",0),i&2&&f(o.formInit()?0:-1)},dependencies:[X,Dt,oe,yt,ne,H,pt,M,ri,kt,ve,L],encapsulation:2,changeDetection:0})}}return t})();var bm=so(zm());var Nm=(()=>{class t{constructor(){this.dialog=c(Ae),this.internalLinks=c(Me),this.locationRx=c(v),this.location$=this.locationRx.getCurrentLocation(["shortName","enableAppClipsRegistration"])}downloadQrCode(){return R(this,null,function*(){let e=yield b(this.location$);if(!e)return;let i=e.enableAppClipsRegistration?yield b(this.internalLinks.locationAppClipUrl$):yield b(this.internalLinks.publicRegistrationUrl$),o=yield bm.default.toDataURL(i,{errorCorrectionLevel:"H",scale:24});Gs(o,`waitwhile-registration-${e.shortName}.png`)})}openPublicLinks(){return R(this,null,function*(){this.dialog.open({type:kp,inputs:{area:"location"}},{size:"medium"})})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-registration-qr-code-info"]],hostAttrs:[1,"ww-settings-registration-qr-code-info","flex","flex-col","gap-4","items-start"],decls:22,vars:0,consts:()=>{let e;e=$localize`QR Code Templates`;let i;i=$localize`Templates`;let o;return o=$localize`Download QR Code`,[i,o,[1,"grid","small:grid-cols-2","grid-cols-1","gap-4"],[1,"flex","flex-col","gap-4","max-w-lg"],[1,"flex","flex-col","gap-2","list-decimal","list-inside"],[1,"flex","flex-row","gap-2"],["wwButton","secondary","href","https://docs.google.com/presentation/d/1qKx8sqDZaPcC0ZbUywma0vP5XvugUhk0tFFWJBkDCf4/edit#slide=id.g2572d4a0d10_0_0","target","_blank"],["icon","bx-file-blank"],["wwButton","secondary",3,"click"],["icon","bx-qr"],[1,"max-w-lg"],["src","/assets/images/settings-registration-qr-code-templates.png","alt",e]]},template:function(i,o){i&1&&(l(0,"div",2)(1,"div",3)(2,"ol",4)(3,"li"),k(4,"Download one of our print templates"),r(),l(5,"li"),k(6,"Download your QR code"),r(),l(7,"li"),k(8,"Insert the QR code and your logo into the template"),r(),l(9,"li"),k(10,"Print the page and let customers join by scanning"),r()(),l(11,"div",5)(12,"a",6),g(13,"ww-icon",7),l(14,"span"),w(15,0),r()(),l(16,"button",8),N("click",function(){return o.openPublicLinks()}),g(17,"ww-icon",9),l(18,"span"),w(19,1),r()()()(),l(20,"div",10),g(21,"img",11),r()())},dependencies:[M,Se,ze],encapsulation:2,changeDetection:0})}}return t})();var og=lt(Ie),GF=(()=>{class t extends og{constructor(){super(...arguments),this.orderInLineFormControl=new C(!1,{nonNullable:!0}),this.estimatedWaitFormControl=new C(!1,{nonNullable:!0}),this.viewValue$=A([Q(this.orderInLineFormControl),Q(this.estimatedWaitFormControl)]).pipe(Cs(1),p(([e,i])=>e&&i?"BOTH":e?"ORDER":i?"EST_WAIT":"HIDE"))}writeValue(e){return R(this,null,function*(){e==="BOTH"?(this.orderInLineFormControl.setValue(!0,{emitEvent:!1}),this.estimatedWaitFormControl.setValue(!0,{emitEvent:!1})):e==="ORDER"?(this.orderInLineFormControl.setValue(!0,{emitEvent:!1}),this.estimatedWaitFormControl.setValue(!1,{emitEvent:!1}
47)):e==="EST_WAIT"?(this.orderInLineFormControl.setValue(!1,{emitEvent:!1}),this.estimatedWaitFormControl.setValue(!0,{emitEvent:!1})):(this.orderInLineFormControl.setValue(!1,{emitEvent:!1}),this.estimatedWaitFormControl.setValue(!1,{emitEvent:!1}))})}registerOnChange(e){this.viewValue$.pipe(z(this.ngOnDestroy$)).subscribe(e)}registerOnTouched(){}setDisabledState(e){e?(this.orderInLineFormControl.disable({emitEvent:!1}),this.estimatedWaitFormControl.disable({emitEvent:!1})):(this.orderInLineFormControl.enable({emitEvent:!1}),this.estimatedWaitFormControl.enable({emitEvent:!1}))}static{this.\u0275fac=(()=>{let e;return function(o){return(e||(e=j(t)))(o||t)}})()}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-registration-waiting-indicator"]],hostAttrs:[1,"ww-settings-registration-waiting-indicator"],inputs:{hint:"hint",label:"label",sublabel:"sublabel",placeholder:"placeholder",ariaLabel:"ariaLabel",ariaLabelledby:"ariaLabelledby",autoFocus:"autoFocus"},features:[O],decls:2,vars:2,consts:()=>{let e;e=$localize`Show order in line`;let i;return i=$localize`Show estimated wait`,[["label",e,3,"formControl"],["label",i,3,"formControl"]]},template:function(i,o){i&1&&g(0,"ww-checkbox",0)(1,"ww-checkbox",1),i&2&&(m("formControl",o.orderInLineFormControl),s(),m("formControl",o.estimatedWaitFormControl))},dependencies:[X,oe,ne,M,at],encapsulation:2,changeDetection:0})}}return t})();var Om=(()=>{class t{selectionFinished(e){return this._createWeekRange(e)}createPreview(e){return this._createWeekRange(e)}_createWeekRange(e){if(e){let i=Dn(e),o=Gn(e);return new Va(i,o)}return new Va(null,null)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac})}}return t})();var Rm=(()=>{class t{constructor(){this.dialog=c(Ae),this.locationRx=c(v),this.updateLocationWrite=c(Te),this.updateResourceWrite=c(ma),this.updateServiceWrite=c(da)}editSessions(e){return R(this,null,function*(){let i=e.service??null;if(!i||!Jo(i)||!i.duration)return;let o=yield b(this.dialog.open(_(np,{serviceName:i.name,serviceId:i.id,serviceDuration:i.duration,sessions:i.sessions??[]}),{size:"medium"}).afterClosed$);o&&this.updateServiceWrite.payload.next({id:e.id,updates:{sessions:o}})})}editHoursByWeekday(e,i){return R(this,null,function*(){let o=e.resource??e.service??this.locationRx.nullableLocation,n=o?$localize`Edit weekly hours for ${o.name}`:$localize`Edit weekly hours`,u=yield b(this.dialog.open(_(ha,{title:n,name:o?.name??$localize`Schedule`,initialState:i,inheritsFromLocation:!!e.resource||!!e.service,defaultHours:e.defaultHours,openingHours:e.openingHours,defaultSpotsPerSlot:e.defaultSpotsPerSlot,hours:o?.hours,bookingHours:o?.bookingHours,waitlistHours:o?.waitlistHours,withSpots:e.withSpots,hiddenStates:this.getLocationHiddenStates()}),{size:"medium",disableClose:!0}).afterClosed$);!u||!(yield this.confirmSharedFieldUpdate(e))||(e.resource?this.updateResourceWrite.payload.next({id:e.id,updates:u}):e.service?this.updateServiceWrite.payload.next({id:e.id,updates:u}):this.updateLocationWrite.payload.next({locationId:e.id,updates:u}))})}getLocationHiddenStates(){let e=[];return this.locationRx.nullableLocation?.isBookingActive||e.push("bookings"),this.locationRx.nullableLocation?.isWaitlistActive||e.push("waitlist"),e}confirmSharedFieldUpdate(e){return R(this,null,function*(){if(e.locationIds&&e.locationIds.length>1){let i=$localize`Your changes will affect ${e.locationIds.length} locations.`;if(e.resource)return b(this.dialog.openConfirm({title:$localize`You are updating a shared resource`,message:i}).afterClosed$);if(e.service)return b(this.dialog.openConfirm({title:$localize`You are updating a shared service`,message:i}).afterClosed$)}return!0})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ag=()=>[],rg=t=>({resourceId:t}),sg=t=>({serviceId:t}),lg=(t,a)=>a.id,cg=(t,a)=>a.key;function pg(t,a){if(t&1){let e=V();l(0,"a",30),S(1,"async"),N("click",function(){let o=D(e).$implicit,n=d();return G(n.setActiveType(o))}),k(2),r()}if(t&2){let e=a.$implicit,i=d();m("active",T(1,2,i.activeTypeSub)===e),s(2),Ke(" ",i.labels[e]," ")}}function ug(t,a){if(t&1&&g(0,"ww-datepicker",28),t&2){let e=d();m("formControl",e.dateFormControl)("withStepper",!0)}}function mg(t,a){if(t&1&&g(0,"ww-resource-select",33),t&2){let e=d(2);m("formControl",e.resourceCategoryIdFormControl)("searchable",!1)("type","categories")}}
47function dg(t,a){if(t&1&&g(0,"ww-service-select",34),t&2){let e=d(2);m("formControl",e.serviceCategoryIdFormControl)("searchable",!1)("type","categories")}}function _g(t,a){if(t&1){let e=V();l(0,"ww-page-search",31),N("searchChanged",function(o){D(e);let n=d();return G(n.searchSub.next(o??""))}),r(),g(1,"ww-date-range-picker",32),E(2,mg,1,3,"ww-resource-select",33),E(3,dg,1,3,"ww-service-select",34)}if(t&2){let e=d();m("defaultState","expanded"),s(),m("formControl",e.dateRangeFormControl)("filters",At(6,ag))("withStepper",!0),s(),f(e.activeTypeSub.value==="resource"?2:-1),s(),f(e.activeTypeSub.value==="service"?3:-1)}}function Sg(t,a){if(t&1&&g(0,"ww-legend",29),t&2){let e=d();m("shape","square")("legends",e.legends)}}function Tg(t,a){t&1&&g(0,"ww-spinner-overlay")}function gg(t,a){if(t&1&&(l(0,"th",37),k(1),r()),t&2){let e=a.$implicit;s(),Ke(" ",e.label," ")}}function Eg(t,a){if(t&1&&(l(0,"tr"),ce(1,gg,2,1,"th",37,cg),S(3,"async"),r()),t&2){let e=d(2);s(),pe(T(3,0,e.columns$))}}function fg(t,a){if(t&1&&(l(0,"button",43),g(1,"ww-icon",47),r()),t&2){d();let e=ie(11);m("matMenuTriggerFor",e)}}function Cg(t,a){t&1&&g(0,"div")}function hg(t,a){if(t&1&&g(0,"ww-display-hours",49),t&2){let e=d().$implicit;m("hours",e.general)}}function wg(t,a){t&1&&te(0)}function yg(t,a){if(t&1&&$(0,wg,1,0,"ng-container",50),t&2){d(3);let e=ie(10);m("ngTemplateOutlet",e)}}function Ig(t,a){if(t&1){let e=V();l(0,"td",46)(1,"button",48),N("click",function(){let o=D(e).$implicit,n=d(),u=d(2);return G(u.editHoursByDate(n,"general",o))}),E(2,Cg,1,0,"div")(3,hg,1,1,"ww-display-hours",49),E(4,yg,1,1,"ng-container"),r()()}if(t&2){let e=a.$implicit,i=d();s(),gi("ww-settings-schedules-hour-closed",e.generalState==="closed"),m("disabled",!i.hasUpdatePermission),s(),f(e.generalState==="closed"?2:e.general?3:-1),s(2),f(e.hasGeneralDateHour?4:-1)}}function Mg(t,a){if(t&1&&(l(0,"button",43),g(1,"ww-icon",47),r()),t&2){d();let e=ie(10);m("matMenuTriggerFor",e)}}function bg(t,a){t&1&&g(0,"div")}function Ng(t,a){if(t&1&&g(0,"ww-display-hours",49),t&2){let e=d().$implicit;m("hours",e.bookings)}}function Og(t,a){t&1&&te(0)}
47function Rg(t,a){if(t&1&&$(0,Og,1,0,"ng-container",50),t&2){d(4);let e=ie(10);m("ngTemplateOutlet",e)}}function Ag(t,a){if(t&1){let e=V();l(0,"td",46)(1,"button",48),N("click",function(){let o=D(e).$implicit,n=d(2),u=d(2);return G(u.editHoursByDate(n,"bookings",o))}),E(2,bg,1,0,"div")(3,Ng,1,1,"ww-display-hours",49),E(4,Rg,1,1,"ng-container"),r()()}if(t&2){let e=a.$implicit,i=d(2);s(),gi("ww-settings-schedules-hour-closed",e.bookingsState==="closed"),m("disabled",!i.hasUpdatePermission),s(),f(e.bookingsState==="closed"?2:e.bookings?3:-1),s(2),f(e.hasBookingsDateHour?4:-1)}}function $g(t,a){if(t&1){let e=V();l(0,"tr")(1,"td",38)(2,"div",39)(3,"div",40)(4,"div"),w(5,4),r(),l(6,"div",42),k(7),r()(),E(8,Mg,2,1,"button",43),r(),l(9,"mat-menu",null,1)(11,"button",44),N("click",function(){D(e);let o=d(),n=d(2);return G(n.editHoursByWeekday(o,"bookings"))}),w(12,5),r(),l(13,"button",45),N("click",function(){D(e);let o=d(),n=d(2);return G(n.editHoursByDate(o,"bookings",null))}),w(14,6),r()()(),ce(15,Ag,5,5,"td",46,xt),r()}if(t&2){let e=d();s(7),Ke(" ",e.bookingsDuration," "),s(),f(e.hasUpdatePermission?8:-1),s(5),m("disabled",!e.hasUpdatePermission),s(2),pe(e.hours)}}function Lg(t,a){if(t&1&&(l(0,"button",43),g(1,"ww-icon",47),r()),t&2){d();let e=ie(10);m("matMenuTriggerFor",e)}}function vg(t,a){t&1&&g(0,"div")}function Fg(t,a){if(t&1&&g(0,"ww-display-hours",49),t&2){let e=d().$implicit;m("hours",e.waitlist)}}function xg(t,a){t&1&&te(0)}function Pg(t,a){if(t&1&&$(0,xg,1,0,"ng-container",50),t&2){d(4);let e=ie(10);m("ngTemplateOutlet",e)}}function Dg(t,a){if(t&1){let e=V();l(0,"td",46)(1,"button",48),N("click",function(){let o=D(e).$implicit,n=d(2),u=d(2);return G(u.editHoursByDate(n,"waitlist",o))}),E(2,vg,1,0,"div")(3,Fg,1,1,"ww-display-hours",49),E(4,Pg,1,1,"ng-container"),r()()}if(t&2){let e=a.$implicit,i=d(2);s(),gi("ww-settings-schedules-hour-closed",e.waitlistState==="closed"),m("disabled",!i.hasUpdatePermission),s(),f(e.waitlistState==="closed"?2:e.waitlist?3:-1),s(2),f(e.hasWaitlistDateHour?4:-1)}}function Gg(t,a){if(t&1){let e=V();l(0,"tr")(1,"td",38)(2,"div",39)(3,"div",40)(4,"div"),w(5,7),r(),l(6,"div",42),k(7),r()(),E(8,Lg,2,1,"button",43),r(),l(9,"mat-menu",null,1)(11,"button",44),N("click",function(){D(e);let o=d(),n=d(2);return G(n.editHoursByWeekday(o,"waitlist"))}),w(12,8),r(),l(13,"button",45),N("click",function(){D(e);let o=d(),n=d(2);return G(n.editHoursByDate(o,"waitlist",null))}),w(14,9),r()()(),ce(15,Dg,5,5,"td",46,xt),r()}if(t&2){let e=d();s(7),Ke(" ",e.waitlistDuration," "),s(),f(e.hasUpdatePermission?8:-1),s(5),m("disabled",!e.hasUpdatePermission),s(2),pe(e.hours)}}function kg(t,a){if(t&1){let e=V();l(0,"tr")(1,"td",38)(2,"div",39)(3,"div",40)(4,"div",41),k(5),S(6,"async"),r(),l(7,"div",42),k(8),r()(),E(9,fg,2,1,"button",43),r(),l(10,"mat-menu",null,1)(12,"button",44),N("click",function(){let o=D(e),n=d(2);return G(n.editHoursByWeekday(o,"general"))}),w(13,2),r(),l(14,"button",45),N("click",function(){let o=D(e),n=d(2);return G(n.editHoursByDate(o,"general",null))}),w(15,3),r()()(),ce(16,Ig,5,5,"td",46,xt),r(),E(18,$g,17,3,"tr"),E(19,Gg,17,3,"tr")}if(t&2){let e=a,i=d(2);s(5),Ke(" ",T(6,6,i.locationName$)," "),s(3),Ke(" ",e.generalDuration," "),s(),f(e.hasUpdatePermission?9:-1),s(5),m("disabled",!e.hasUpdatePermission),s(2),pe(e.hours),s(2),f(e.hasBookingHours?18:-1),s(),f(e.hasWaitlistHours?19:-1)}}function Wg(t,a){if(t&1&&(l(0,"button",43),g(1,"ww-icon",47),r()),t&2){d();let e=ie(5);m("matMenuTriggerFor",e)}}function zg(t,a){if(t&1){let e=V();l(0,"div",39),g(1,"ww-display-resource",52),S(2,"async"),E(3,Wg,2,1,"button",43),r(),l(4,"mat-menu",null,1)(6,"button",44),N("click",function(){D(e);let o=d().$implicit,n=d(2);return G(n.editHoursByWeekday(o,"general"))}),w(7,10),r(),l(8,"button",45),N("click",function(){D(e);let o=d().$implicit,n=d(2);return G(n.editHoursByDate(o,"general",null))}),w(9,11),r(),l(10,"a",53),w(11,12),r()()}if(t&2){let e=d().$implicit,i=d(2);s(),m("entity",e.resource)("badgeSize","small")("hideBadge",T(2,9,i.breakpoints.isBelowMobile$))("truncate",!1)("nameSubscriptComponent",e.generalDuration),s(2),f(e.hasUpdatePermission?3:-1),s(5),m("disabled",!e.hasUpdatePermission),s(2),m("routerLink","/settings/resources/edit")("queryParams",Ki(11,rg,e.resource.id))}}
47function Bg(t,a){if(t&1&&(l(0,"button",43),g(1,"ww-icon",47),r()),t&2){d();let e=ie(5);m("matMenuTriggerFor",e)}}function Ug(t,a){if(t&1){let e=V();l(0,"button",44),N("click",function(){D(e);let o=d(2).$implicit,n=d(2);return G(n.editSessionScheduleByDate(o))}),w(1,14),r()}}function Vg(t,a){if(t&1){let e=V();l(0,"button",44),N("click",function(){D(e);let o=d(2).$implicit,n=d(2);return G(n.editHoursByWeekday(o,"general"))}),w(1,15),r(),l(2,"button",45),N("click",function(){D(e);let o=d(2).$implicit,n=d(2);return G(n.editHoursByDate(o,"general",null))}),w(3,16),r()}if(t&2){let e=d(2).$implicit;s(2),m("disabled",!e.hasUpdatePermission)}}function Xg(t,a){if(t&1&&(l(0,"div",39),g(1,"ww-display-service",54),S(2,"async"),E(3,Bg,2,1,"button",43),r(),l(4,"mat-menu",null,1),E(6,Ug,2,0,"button",55)(7,Vg,4,1),l(8,"a",53),w(9,13),r()()),t&2){let e=d().$implicit,i=d(2);s(),m("entity",e.service)("badgeSize","small")("hideBadge",T(2,10,i.breakpoints.isBelowMobile$))("truncate",!1)("nameSubscriptComponent",e.generalDuration)("withServiceTypeIcon",!0),s(2),f(e.hasUpdatePermission?3:-1),s(3),f(e.sessions?6:7),s(2),m("routerLink","/settings/services/edit")("queryParams",Ki(12,sg,e.service.id))}}function Hg(t,a){t&1&&g(0,"div")}function qg(t,a){if(t&1&&g(0,"ww-display-hours",49),t&2){let e=d().$implicit;m("hours",e.resultingGeneral)}}function jg(t,a){t&1&&te(0)}function Kg(t,a){if(t&1&&$(0,jg,1,0,"ng-container",50),t&2){d(3);let e=ie(10);m("ngTemplateOutlet",e)}}function Yg(t,a){if(t&1){let e=V();l(0,"td",46)(1,"button",48),N("click",function(){let o=D(e).$implicit,n=d().$implicit,u=d(2);return G(u.editHoursByDate(n,"general",o))}),E(2,Hg,1,0,"div")(3,qg,1,1,"ww-display-hours",49),E(4,Kg,1,1,"ng-container"),r()()}if(t&2){let e=a.$implicit,i=d().$implicit;s(),gi("ww-settings-schedules-hour-closed",e.generalState==="closed")("ww-settings-schedules-hour-custom",!e.isGeneralDefault)("ww-settings-schedules-hour-outside",e.isGeneralDefaultOutsideHours),m("disabled",!i.hasUpdatePermission),s(),f(e.generalState==="closed"?2:e.resultingGeneral?3:-1),s(2),f(e.hasGeneralDateHour?4:-1)}}function Qg(t,a){t&1&&g(0,"div")}function Jg(t,a){if(t&1&&(l(0,"div"),k(1),r()),t&2){let e=d().$implicit,i=d(3);s(),fe(i.pluckSessionsLabel(e.count))}}function Zg(t,a){if(t&1){let e=V();l(0,"td",46)(1,"button",48),N("click",function(){D(e);let o=d().$implicit,n=d(2);return G(n.editSessionScheduleByDate(o))}),E(2,Qg,1,0,"div")(3,Jg,2,1,"div"),r()()}if(t&2){let e=a.$implicit,i=d().$implicit;s(),gi("ww-settings-schedules-hour-closed",e.count===0),m("disabled",!i.hasUpdatePermission),s(),f(e.count===0?2:3)}}function eE(t,a){if(t&1&&(l(0,"button",43),g(1,"ww-icon",47),r()),t&2){d();let e=ie(11);m("matMenuTriggerFor",e)}}function tE(t,a){t&1&&g(0,"div")}function iE(t,a){if(t&1&&g(0,"ww-display-hours",49),t&2){let e=d().$implicit;m("hours",e.resultingBookings)}}function oE(t,a){t&1&&te(0)}function nE(t,a){if(t&1&&$(0,oE,1,0,"ng-container",50),t&2){d(4);let e=ie(10);m("ngTemplateOutlet",e)}}function aE(t,a){if(t&1){let e=V();l(0,"td",46)(1,"button",48),N("click",function(){let o=D(e).$implicit,n=d(2).$implicit,u=d(2);return G(u.editHoursByDate(n,"bookings",o))}),E(2,tE,1,0,"div")(3,iE,1,1,"ww-display-hours",49),E(4,nE,1,1,"ng-container"),r()()}if(t&2){let e=a.$implicit,i=d(2).$implicit;s(),gi("ww-settings-schedules-hour-closed",e.bookingsState==="closed")("ww-settings-schedules-hour-custom",!e.isBookingsDefault)("ww-settings-schedules-hour-outside",e.isBookingsDefaultOutsideHours),m("disabled",!i.hasUpdatePermission),s(),f(e.bookingsState==="closed"?2:e.resultingBookings?3:-1),s(2),f(e.hasBookingsDateHour?4:-1)}}function rE(t,a){if(t&1){let e=V();l(0,"tr")(1,"td")(2,"div",56)(3,"div",39)(4,"div",40)(5,"div"),w(6,17),r(),l(7,"div",42),k(8),r()(),E(9,eE,2,1,"button",43),r(),l(10,"mat-menu",null,1)(12,"button",44),N("click",function(){D(e);let o=d().$implicit,n=d(2);return G(n.editHoursByWeekday(o,"bookings"))}),w(13,18),r(),l(14,"button",45),N("click",function(){D(e);let o=d().$implicit,n=d(2);return G(n.editHoursByDate(o,"bookings",null))}),w(15,19),r()()()(),ce(16,aE,5,9,"td",46,xt),r()}if(t&2){let e=d().$implicit;s(8),Ke(" ",e.bookingsDuration," "),s(),f(e.hasUpdatePermission?9:-1),s(5),m("disabled",!e.hasUpdatePermission),s(2),pe(e.hours)}}function sE(t,a){if(t&1&&(l(0,"button",43),g(1,"ww-icon",47),r()
47),t&2){d();let e=ie(11);m("matMenuTriggerFor",e)}}function lE(t,a){t&1&&g(0,"div")}function cE(t,a){if(t&1&&g(0,"ww-display-hours",49),t&2){let e=d().$implicit;m("hours",e.resultingWaitlist)}}function pE(t,a){t&1&&te(0)}function uE(t,a){if(t&1&&$(0,pE,1,0,"ng-container",50),t&2){d(4);let e=ie(10);m("ngTemplateOutlet",e)}}function mE(t,a){if(t&1){let e=V();l(0,"td",46)(1,"button",48),N("click",function(){let o=D(e).$implicit,n=d(2).$implicit,u=d(2);return G(u.editHoursByDate(n,"waitlist",o))}),E(2,lE,1,0,"div")(3,cE,1,1,"ww-display-hours",49),E(4,uE,1,1,"ng-container"),r()()}if(t&2){let e=a.$implicit,i=d(2).$implicit;s(),gi("ww-settings-schedules-hour-closed",e.waitlistState==="closed")("ww-settings-schedules-hour-custom",!e.isWaitlistDefault)("ww-settings-schedules-hour-outside",e.isWaitlistDefaultOutsideHours),m("disabled",!i.hasUpdatePermission),s(),f(e.waitlistState==="closed"?2:e.resultingWaitlist?3:-1),s(2),f(e.hasWaitlistDateHour?4:-1)}}function dE(t,a){if(t&1){let e=V();l(0,"tr")(1,"td")(2,"div",56)(3,"div",39)(4,"div",40)(5,"div"),w(6,20),r(),l(7,"div",42),k(8),r()(),E(9,sE,2,1,"button",43),r(),l(10,"mat-menu",null,1)(12,"button",44),N("click",function(){D(e);let o=d().$implicit,n=d(2);return G(n.editHoursByWeekday(o,"waitlist"))}),w(13,21),r(),l(14,"button",45),N("click",function(){D(e);let o=d().$implicit,n=d(2);return G(n.editHoursByDate(o,"waitlist",null))}),w(15,22),r()()()(),ce(16,mE,5,9,"td",46,xt),r()}if(t&2){let e=d().$implicit;s(8),Ke(" ",e.waitlistDuration," "),s(),f(e.hasUpdatePermission?9:-1),s(5),m("disabled",!e.hasUpdatePermission),s(2),pe(e.hours)}}function _E(t,a){if(t&1&&(l(0,"tr")(1,"td",51),E(2,zg,12,13),E(3,Xg,10,14),r(),ce(4,Yg,5,9,"td",46,xt),ce(6,Zg,4,4,"td",46,xt),r(),E(8,rE,18,3,"tr"),E(9,dE,18,3,"tr")),t&2){let e=a.$implicit;s(2),f(e.resource?2:-1),s(),f(e.service?3:-1),s(),pe(e.hours),s(2),pe(e.sessions),s(2),f(e.hasBookingHours?8:-1),s(),f(e.hasWaitlistHours?9:-1)}}function SE(t,a){t&1&&g(0,"ww-icon",57)}function TE(t,a){if(t&1&&(l(0,"div",35)(1,"table",36),E(2,Eg,4,2,"tr"),S(3,"async"),E(4,kg,20,8),S(5,"async"),ce(6,_E,10,4,null,null,lg),S(8,"async"),r()(),$(9,SE,1,0,"ng-template",null,0,me)),t&2){let e,i=d();s(2),f(T(3,2,i.layout.isDesktop$)?2:-1),s(2),f((e=T(5,4,i.locationItem$))?4:-1,e),s(2),pe(T(8,6,i.items$))}}var Am=(()=>{class t extends q{constructor(){super(),this.layout=c(le),this.breakpoints=c($i),this.dateService=c(il),this.coreResourceRx=c(_a),this.coreServiceRx=c(Sa),this.dialog=c(Ae),this.durationService=c(kn),this.locationRx=c(v),this.permissionRx=c(Ec),this.queryParams=c(It),this.schedulesService=c(Rm),this.sessionAvailabilityRx=c(hc),this.updateLocationWrite=c(Te),this.updateResourceWrite=c(ma),this.updateServiceWrite=c(da),this.writeContext=c(Ic),this.searchSub=new Ot(""),this.types=["resource","service"],this.labels=qc,this.legends=jc,this.activeTypeSub=new Ot(this.queryParams.get("type",this.types[0],Yc)),this.resourceCategoryIdFormControl=new C(null),this.resourceCategoryId$=Q(this.resourceCategoryIdFormControl),this.serviceCategoryIdFormControl=new C(null),this.serviceCategoryId$=Q(this.serviceCategoryIdFormControl),this.dateRangeFormControl=new C({start:Dn(new Date),end:Gn(new Date)},{nonNullable:!0}),this.dateRange$=Q(this.dateRangeFormControl),this.dateFormControl=new C(new Date,{nonNullable:!0}),this.date$=Q(this.dateFormControl),this.locationName$=this.locationRx.getCurrentLocation(["name"]).pipe(p(e=>e.name)),this.dates$=this.layout.isMobile$.pipe(U(e=>e?this.date$.pipe(p(i=>[i])):this.dateRange$.pipe(p(i=>{let o=[],n=new Date(i.start);for(;n<=i.end;)o.push(new Date(n)),n.setDate(n.getDate()+1);return o}
47)))),this.dateColumns$=this.dates$.pipe(p(e=>e.map(i=>{let o=el(i)?$localize`Today`:this.dateService.transform(i,{withWeekday:!0,absolute:!0,hideTime:!0});return{key:Hs(i),label:o}}))),this.columns$=this.dateColumns$.pipe(p(e=>[{key:"entity",label:""},...e])),this.resources$=A([this.searchSub,this.resourceCategoryId$,this.coreResourceRx.currentLocationResources$]).pipe(p(([e,i,o])=>Qo(o.filter(n=>n.isActive&&!n.isCategory).filter(n=>i?n.parentId===i:!0).sort(Ka("name")).sort(fr),n=>n.name,e))),this.resourceIds$=this.resources$.pipe(p(e=>e.map(i=>i.id))),this.services$=A([this.searchSub,this.serviceCategoryId$,this.coreServiceRx.currentLocationServices$]).pipe(p(([e,i,o])=>Qo(o.filter(n=>n.isActive&&!n.isCategory).filter(n=>i?n.parentId===i:!0).sort(Ka("name")).sort(fr),n=>n.name,e))),this.serviceIds$=this.services$.pipe(p(e=>e.map(i=>i.id))),this.location$=this.locationRx.getCurrentLocation(["id","bookingHours","bookingHoursByDate","bookingSpotsPerSlot","bookingUseResourceSpots","hours","hoursByDate","isActive","isBookingActive","isWaitlistActive","waitlistHours","waitlistHoursByDate"]).pipe(p(e=>W(y({},e),{hours:y(y({},Kc),e.hours)})),this.shareReplay()),this.resourceItems$=A([this.dates$,this.resources$,this.writeContext.writer$,this.permissionRx.hasSomePermission("resources.update","resources.update-hours"),this.location$]).pipe(p(([e,i,o,n,u])=>i.map(h=>W(y({},this.createHours(e,h,!!h.isActiveBooking,!!h.isActiveWaitlist,u)),{id:h.id,dates:e,resource:h,locationIds:h.locationIds,hasUpdatePermission:n||o.resource?.id===h.id,defaultHours:Or(h,u),defaultSpotsPerSlot:h.maxServed??u.bookingSpotsPerSlot??1,openingHours:fa(u),withSpots:u.bookingUseResourceSpots??!1}))),this.shareReplay()),this.sessionServices$=this.services$.pipe(p(e=>e.filter(Jo)),this.shareReplay()),this.sessionSlots$=A([this.dates$,this.sessionServices$]).pipe(U(([e,i])=>e.length===0||i.length===0?Y([]):this.sessionAvailabilityRx.getSessionSlots(e[0],e[e.length-1],{serviceIds:i.map(o=>o.id)})),this.shareReplay()),this.serviceItems$=A([this.dates$,this.services$,this.permissionRx.hasSomePermission("services.update","services.update-hours"),this.location$,this.sessionSlots$]).pipe(p(([e,i,o,n,u])=>i.map(h=>{if(Jo(h)){let x=u.filter(P=>P.serviceId===h.id);return{id:h.id,dates:e,service:h,hasUpdatePermission:o,locationIds:h.locationIds,sessions:this.findSessionSlotsForDates(e,x),hours:[],hasBookingHours:!1,hasWaitlistHours:!1,generalDuration:"",bookingsDuration:"",waitlistDuration:""}}return W(y({},this.createHours(e,h,!!h.isActiveBooking,!!h.isActiveWaitlist,n)),{id:h.id,dates:e,service:h,hasUpdatePermission:o,locationIds:h.locationIds,defaultHours:Or(h,n),openingHours:fa(n)})})),this.shareReplay()),this.locationItem$=A([this.dates$,this.permissionRx.hasSomePermission("locations.update-hours","locations.update"),this.location$]).pipe(p(([e,i,o])=>W(y({},this.createHours(e,o,!!o.isBookingActive,!!o.isWaitlistActive)),{id:o.id,dates:e,location:o,hasUpdatePermission:i,locationIds:[o.id],defaultHours:fa(o)})),this.shareReplay()),this.items$=this.activeTypeSub.pipe(U(e=>e==="resource"?this.resourceItems$:this.serviceItems$)),this.loading$=Zt(this.activeTypeSub.pipe(p(()=>!0)),this.items$.pipe(p(()=>!1))),this.pluckSessionsLabel=e=>Pn($localize`${e} session`,e,$localize`${e} sessions`),this.layout.updateFeatureContext({name:$localize`Schedules`}),this.subscribe()}setActiveType(e){this.activeTypeSub.next(e),this.queryParams.set("type",e)}editHoursByDate(e,i,o){return R(this,null,function*(){if(!e.hasUpdatePermission)return;let n=e.resource??e.service??this.locationRx.nullableLocation,u=n?$localize`Edit hours by date for ${n.name}`:$localize`Edit hours by date`,h=yield b(this.dialog.open(_(Ca,{title:u,name:n?.name??$localize`Schedule`,initialState:i,date:o?.date,defaultHours:e.defaultHours,defaultSpotsPerSlot:e.defaultSpotsPerSlot,openingHours:e.openingHours,hoursByDate:n?.hoursByDate,bookingHoursByDate:n?.bookingHoursByDate,waitlistHoursByDate:n?.waitlistHoursByDate,entityName:this.getEntityName(e),withSpots:e.withSpots,hiddenStates:this.schedulesService.getLocationHiddenStates()}),{size:"medium",disableClose:!0}).afterClosed$);
47!h||!(yield this.confirmSharedFieldUpdate(e))||(e.resource?this.updateResourceWrite.payload.next({id:e.id,updates:h}):e.service?this.updateServiceWrite.payload.next({id:e.id,updates:h}):this.updateLocationWrite.payload.next({locationId:e.id,updates:h}))})}editHoursByWeekday(e,i){return R(this,null,function*(){this.schedulesService.editHoursByWeekday(e,i)})}editSessionScheduleByDate(e){return R(this,null,function*(){this.schedulesService.editSessions(e)})}confirmSharedFieldUpdate(e){return R(this,null,function*(){if(e.locationIds&&e.locationIds.length>1){let i=$localize`Your changes will affect ${e.locationIds.length} locations.`;if(e.resource)return b(this.dialog.openConfirm({title:$localize`You are updating a shared resource`,message:i}).afterClosed$);if(e.service)return b(this.dialog.openConfirm({title:$localize`You are updating a shared service`,message:i}).afterClosed$)}return!0})}mergeHours(e,i){return{hours:y(y({},i?.hours),e?.hours),bookingHours:y(y({},i?.bookingHours),e?.bookingHours),waitlistHours:y(y({},i?.waitlistHours),e?.waitlistHours),hoursByDate:y(y({},na(e?.hours)?i?.hoursByDate:{}),e?.hoursByDate),bookingHoursByDate:y(y({},na(e?.bookingHours)?i?.bookingHoursByDate:{}),e?.bookingHoursByDate),waitlistHoursByDate:y(y({},na(e?.waitlistHours)?i?.waitlistHoursByDate:{}),e?.waitlistHoursByDate)}}createHours(e,i,o,n,u){let h=u?this.mergeHours(i,u):i,x=e.map(ge=>{let rt=To(ge,""),st=to(ge,u?.hours,u?.hoursByDate)??null,et=to(ge,h.hours,h.hoursByDate)??null,ye=aa(st,et),wt=to(ge,u?.bookingHours,u?.bookingHoursByDate)??null,he=to(ge,h.bookingHours,h.bookingHoursByDate)??null,Vt=aa(wt,he),Ne=to(ge,u?.waitlistHours,u?.waitlistHoursByDate)??null,Jt=to(ge,h.waitlistHours,h.waitlistHoursByDate)??null,Ii=aa(Ne,Jt),Mi=et===st,Oe=he===wt,jo=Jt===Ne,yn=!Mi&&ra(et,st),In=!Oe&&ra(he,wt),Mn=!jo&&ra(Jt,Ne),bn=oa(i.hoursByDate,rt),Nn=oa(i.bookingHoursByDate,rt),On=oa(i.waitlistHoursByDate,rt);return{date:ge,general:et,bookings:he,waitlist:Jt,resultingGeneral:ye,resultingBookings:Vt,resultingWaitlist:Ii,generalState:ia(ye),bookingsState:ia(Vt),waitlistState:ia(Ii),isGeneralDefault:Mi,isBookingsDefault:Oe,isWaitlistDefault:jo,isGeneralDefaultOutsideHours:yn,isBookingsDefaultOutsideHours:In,isWaitlistDefaultOutsideHours:Mn,hasGeneralDateHour:bn,hasBookingsDateHour:Nn,hasWaitlistDateHour:On}}),P=o&&x.some(ge=>!!ge.bookings),K=n&&x.some(ge=>!!ge.waitlist),de=this.getHoursDuration(x.map(ge=>ge.general).filter(se)),Ce=this.getHoursDuration(x.map(ge=>ge.bookings).filter(se)),ue=this.getHoursDuration(x.map(ge=>ge.waitlist).filter(se));return{hours:x,generalDuration:de,bookingsDuration:Ce,waitlistDuration:ue,hasBookingHours:P,hasWaitlistHours:K}}getHoursDuration(e){let i=mc(e),o=i%3600,n=[this.durationService.transform(i,{unit:"hour",format:"short"})];return o>0&&n.push(this.durationService.transform(o,{unit:"minute",format:"short"})),n.join(" ")}getEntityName(e){return e.resource?$localize`resource`:e.service?$localize`service`:$localize`location`}findSessionSlotsForDates(e,i){return e.map(o=>{if(i.length===0)return{date:o,count:0};let n=i.filter(u=>u.date?.startsWith(To(o)));return{date:o,count:n.length}})}subscribe(){this.layout.isMobile$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{e?this.layout.updateFeatureContext({fullHeight:!1,search:{api:i=>{this.searchSub.next(i??"")}}}):this.layout.updateFeatureContext({fullHeight:!0,search:null})})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-schedules"]],hostAttrs:[1,"ww-settings-schedules"],hostVars:2,hostBindings:function(i,o){i&2&&gi("ww-settings-schedules-is-am-pm",o.dateService.isAmPm)},features:[Oi([{provide:$s,useClass:Om}]),O],decls:16,vars:13,consts:()=>{let e;e=$localize`All categories`;let i;i=$localize`All categories`;let o;o=$localize` Edit weekly hours `;let n;n=$localize` Edit hours by date `;let u;u=$localize`Booking hours`;let h;h=$localize` Edit weekly booking hours `;let x;x=$localize` Edit booking hours by date `;let P;P=$localize`Waitlist hours`;let K;K=$localize` Edit weekly waitlist hours `;let de;de=$localize` Edit waitlist hours by date `;let Ce;Ce=$localize` Edit weekly hours `;let ue;ue=$localize` Edit hours by date `;let ge;ge=$localize` Edit resource `;let rt;rt=$localize` Edit service `;let st;st=$localize` Edit sessions `;let et;et=$localize` Edit weekly hours `;let ye;ye=$localize` Edit hours by date `;let wt;wt=$localize`Booking hours`;let he;he=$localize` Edit weekly booking hours `;let Vt;Vt=$localize` Edit booking hours by date `;let Ne;Ne=$localize`Waitlist hours`;let Jt;Jt=$localize` Edit weekly waitlist hours `;let Ii;Ii=$localize` Edit waitlist hours by date `;let Mi;return Mi=$localize`Hours scheduled by date`,[["hoursByDateIconTmpl",""],["menu","matMenu"],o,n,u,h,x,P,K,de,Ce,ue,ge,rt,st,et,ye,wt,he,Vt,Ne,Jt,Ii,[1,"flex","flex-col","gap-6"],[3,"type"],["wwTabBarItem","",3,"active"],[1,"flex","items-center","justify-between","gap-2","w-full"],[1,"flex","items-center","gap-2"],[1,"ww-settings-schedules-datepicker",3,"formControl","withStepper"],[3,"shape","legends"],["wwTabBarItem","",3,"click","active"],[3,"searchChanged","defaultState"],[1,"ww-settings-schedules-date-range-picker",3,"formControl","filters","withStepper"],["emptySelectionTrigger",e,3,"formControl","searchable","type"],["emptySelectionTrigger",i,3,"formControl","searchable","type"],[1,"ww-settings-schedules-overflow"],[1,"ww-settings-schedules-table"],[1,"ww-settings-schedules-header-cell","
47whitespace-nowrap"],[1,"p-2"],[1,"ww-settings-schedules-label-container"],[1,"ww-settings-schedules-label"],["wwTypography","h5"],["wwColor","darkerGrey","wwTypography","body2"],["wwButton","tertiary",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"click","disabled"],[1,"!p-0"],["icon","bx-dots-horizontal-rounded"],[1,"ww-settings-schedules-hour",3,"click","disabled"],[3,"hours"],[4,"ngTemplateOutlet"],[1,"p-2","font-bold"],[1,"ww-settings-schedules-label",3,"entity","badgeSize","hideBadge","truncate","nameSubscriptComponent"],["mat-menu-item","",3,"routerLink","queryParams"],[1,"ww-settings-schedules-label",3,"entity","badgeSize","hideBadge","truncate","nameSubscriptComponent","withServiceTypeIcon"],["mat-menu-item",""],[1,"ww-settings-schedules-sub-hour"],["wwTooltip",Mi,"icon","bx-calendar","size","x-small","wwColor","black",1,"ww-settings-schedules-hour-date-indicator"]]},template:function(i,o){i&1&&(l(0,"div",23)(1,"ww-tab-bar",24),ce(2,pg,3,4,"a",25,je),r(),l(4,"ww-page-toolbar")(5,"div",26)(6,"div",27),E(7,ug,1,2,"ww-datepicker",28),S(8,"async"),E(9,_g,4,7),S(10,"async"),r(),E(11,Sg,1,2,"ww-legend",29),S(12,"async"),r()(),E(13,Tg,1,0,"ww-spinner-overlay"),S(14,"async"),Rt(15,TE,11,8),r()),i&2&&(s(),m("type","fill"),s(),pe(o.types),s(5),f(T(8,5,o.layout.isMobile$)?7:-1),s(2),f(T(10,7,o.layout.isDesktop$)?9:-1),s(2),f(T(12,9,o.layout.isDesktop$)?11:-1),s(2),f(T(14,11,o.loading$)?13:15))},dependencies:[Le,Os,X,oe,ne,ni,_o,H,Qc,Rc,Ac,ga,Ia,Fo,wa,M,Pl,xl,Dl,ql,Se,Je,Qn,jl,ze,Zl,ic,ea,Zn,Ct,Wt,L],styles:[`.ww-settings-schedules{--sub-hour-indent: 52px}.ww-breakpoints-below-mobile .ww-settings-schedules{--sub-hour-indent: 12px}.ww-settings-schedules-date-range-picker .ww-form-field-content{width:320px}.ww-settings-schedules-datepicker .ww-form-field-content{width:240px}.ww-breakpoints-above-small .ww-settings-schedules-overflow{overflow:auto;height:100%;width:100%}.ww-settings-schedules-table{border:none;border-collapse:collapse;height:100%}.ww-breakpoints-below-small .ww-settings-schedules-table{width:100%}.ww-settings-schedules-table .ww-settings-schedules-hour{position:relative;height:100%;width:100%;outline:none;padding:8px 12px;display:flex;align-items:center;justify-content:center;white-space:pre;min-height:62px}.ww-settings-schedules-table .ww-settings-schedules-hour-date-indicator{position:absolute;top:6px;right:6px;z-index:2}.ww-settings-schedules-table .ww-settings-schedules-label-container{display:flex;align-items:center;justify-content:space-between}.ww-settings-schedules-table .ww-settings-schedules-label{width:max-content;max-width:200px}.ww-settings-schedules-table .ww-settings-schedules-label .ww-display-resource-name{display:-webkit-box;line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.ts-breakpoints-below-small .ww-settings-schedules-table .ww-settings-schedules-label{width:auto;max-width:180px}.ww-settings-schedules-table .ww-settings-schedules-header-cell{position:sticky;top:0;z-index:10!important;white-space:nowrap;padding:8px;background:var(--ww-color-white)}.ww-settings-schedules-table .ww-settings-schedules-header-cell:first-child{z-index:15!important}.ww-settings-schedules-table .ww-settings-schedules-hour-custom{background:var(--ww-color-primary-alpha-10)}.ww-settings-schedules-table .ww-settings-schedules-hour-outside{background:var(--ww-color-alert-alpha-20)}.ww-settings-schedules-table .ww-settings-schedules-hour-closed{position:absolute;inset:1px;background:repeating-linear-gradient(-45deg,var(--ww-color-white),var(--ww-color-white) 8px,var(--ww-color-lightGrey) 8px,var(--ww-color-lightGrey) 16px)}.ww-settings-schedules-table .ww-settings-schedules-hour-closed.ww-settings-schedules-hour-custom{background:repeating-linear-gradient(-45deg,var(--ww-color-white),var(--ww-color-white) 8px,var(--ww-color-primary-bright) 8px,var(--ww-color-primary-bright) 16px)}.ww-settings-schedules-table .ww-settings-schedules-hour-closed.ww-settings-schedules-hour-outside{background:repeating-linear-gradient(-45deg,var(--ww-color-white),var(--ww-color-white) 8px,var(--ww-color-alert-alpha-20) 8px,var(--ww-color-alert-alpha-20) 16px)}.ww-settings-schedules-table .ww-settings-schedules-sub-hour{padding:8px 8px 8px var(--sub-hour-indent)}.ww-settings-schedules-table .ww-settings-schedules-sub-hour:before{content:"";position:absolute;top:-1px;left:0;width:var(--sub-hour-indent);height:1px;background:var(--ww-color-white)}.ww-settings-schedules-table tr{height:62px}.ww-settings-schedules-table td{min-width:158px}.ww-settings-schedules-is-am-pm .ww-settings-schedules-table td{min-width:182px}.ww-breakpoints-below-small .ww-settings-schedules-table td{min-width:160px;max-width:180px}.ww-settings-schedules-table td,.ww-settings-schedules-table th{background:var(--ww-color-white);position:relative}.ww-settings-schedules-table td:first-child,.ww-settings-schedules-table th:first-child{border-left:none;position:sticky;left:0;z-index:5}.ww-settings-schedules-table td:after,.ww-settings-schedules-table th:after{content:"";position:absolute;bottom:0;right:0;left:0;height:1px;background:var(--ww-color-mediumGrey)}.ww-settings-schedules-table td:before,.ww-settings-schedules-table th:before{content:"";position:absolute;top:0;right:0;bottom:0;width:1px;z-index:1;background:var(--ww-color-mediumGrey)}
48/*noopsettings-schedules.component-PXLY62SK.css.map */
49`],encapsulation:2,changeDetection:0})}}return t})();var $m={CLASSIC:null,INTELLIGENT:_(rp)},Lm={CLASSIC:$localize`Use your own visit history and service durations to estimate wait durations. Choose whether to base estimates on past visits or on the set duration of each service.`,INTELLIGENT:$localize`This model learns wait duration patterns using hundreds of locations similar to yours, without any configuration required by you.`},vm={HISTORICAL:$localize`Historical duration`,MANUAL:$localize`Service duration`},Fm={HISTORICAL:$localize`Estimate the current wait duration based on visit history. This works best when you have 50 completed visits or more.`,MANUAL:$localize`Estimate wait times using the set duration of each service. For services without a duration, use a fallback value.`};var gE=["intelligentModelSuffix"];function EE(t,a){t&1&&g(0,"ww-wait-duration-chart",14),t&2&&m("source","location")}function fE(t,a){t&1&&$(0,EE,1,1,"ww-wait-duration-chart",21),t&2&&m("wwPermission","analytics.show")}function CE(t,a){if(t&1&&(l(0,"div",18),g(1,"ww-duration-picker",22),r()),t&2){let e=d(2);s(),m("layout","vertical")("formControl",e.formGroup.controls.estimationDurationFallback)}}function hE(t,a){if(t&1&&(l(0,"div",18),g(1,"ww-radio",17),E(2,CE,2,2,"div",18),S(3,"async"),r()),t&2){let e=d();s(),m("layout","vertical")("formControl",e.formGroup.controls.estimationDuration)("data",e.durations)("pluckLabel",e.pluckDurationLabel)("pluckSublabel",e.pluckDurationSublabel),s(),f(T(3,6,e.isManualDuration$)?2:-1)}}function wE(t,a){if(t&1&&(l(0,"ww-label-layout")(1,"ww-label")(2,"span"),w(3,5),r(),l(4,"ww-sublabel"),w(5,6),r()(),l(6,"div",16),g(7,"ww-resource-select",23),l(8,"
49ww-info-bubble",24)(9,"div"),tt(10,7),g(11,"ww-link",25),it(),r()()()(),l(12,"ww-label-layout")(13,"ww-label")(14,"span"),w(15,8),r(),l(16,"ww-sublabel"),w(17,9),r()(),l(18,"ww-info-bubble",24)(19,"div"),tt(20,10),g(21,"ww-link",26),it(),r()()()),t&2){let e=d();s(7),m("layout","vertical")("selection","multiple")("type","categories")("formControl",e.resourceCategoriesFormControl),s(4),m("type","router-link")("inline",!0),s(10),m("type","router-link")("inline",!0)}}function yE(t,a){t&1&&(l(0,"span"),w(1,13),r())}function IE(t,a){if(t&1&&(l(0,"ww-label-layout")(1,"ww-label")(2,"span"),w(3,11),r(),l(4,"ww-sublabel"),w(5,12),r()(),g(6,"ww-input",27),$(7,yE,2,0,"ng-template",null,0,me),r()),t&2){let e=ie(8),i=d();s(6),m("formControl",i.formGroup.controls.numberOfServers)("suffixComponent",e)}}var xm=(()=>{class t extends q{constructor(){super(),this.accountRx=c(Ue),this.coreLocationRx=c($e),this.locationRx=c(v),this.resourcesRx=c(Ei),this.layout=c(le),this.pendingChangesStore=c(ct),this.updateLocationWrite=c(Te),this.formId="settings-waitlist-wait-time-estimation",this.resourceCategoriesFormControl=new C([]),this.models=Be()(["INTELLIGENT","CLASSIC"]),this.durations=Be()(["HISTORICAL","MANUAL"]),this.pluckModelLabel=e=>{let i=en[e],o=$m[e];return o?Et({components:[i,o],$element:{classList:["flex","items-center","gap-2"]}}):i},this.pluckModelSublabel=e=>Lm[e],this.pluckDurationLabel=e=>vm[e],this.pluckDurationSublabel=e=>Fm[e],this.formGroup=new F({displayAsRange:new C(!1,{nonNullable:!0}),estimationModel:new C("CLASSIC",{nonNullable:!0}),estimationDuration:new C("HISTORICAL",{nonNullable:!0}),estimationDurationFallback:new C(null),waitEstimationBufferDuration:new C(null),numberOfServers:new C(1,{nonNullable:!0})}),this.isClassicModel$=Q(this.formGroup.controls.estimationModel).pipe(p(e=>e==="CLASSIC")),this.isIntelligentModel$=this.isClassicModel$.pipe(p(e=>!e)),this.isManualDuration$=Q(this.formGroup.controls.estimationDuration).pipe(p(e=>e==="MANUAL")),this.hasResources$=A([this.coreLocationRx.currentLocationSnapshot$,this.resourcesRx.hasSelectableResources$]).pipe(p(([e,i])=>e&&e.showResources&&i)),this.showWaitDurationChart$=this.accountRx.getAccountProperty("planSegment").pipe(p(e=>e==="DEMO"||e==="ENTERPRISE"),Tt()),this.layout.updateFeatureContext({pendingChanges:{formId:this.formId,reset:()=>this.reset(this.coreLocationRx.nullableLocation),save:()=>this.save(),store:this.pendingChangesStore,enabledConfig:{permissions:["locations.update"]}}}),this.subscribe()}reset(e){e&&(this.formGroup.controls.displayAsRange.setValue(e.showEstWaitAsRange??!1,{emitEvent:!1}),sa(e)?this.formGroup.controls.estimationModel.setValue("INTELLIGENT",{emitEvent:!0}):this.formGroup.controls.estimationModel.setValue("CLASSIC",{emitEvent:!0}),this.formGroup.controls.estimationDuration.setValue(e.estimateServiceDuration?"HISTORICAL":"MANUAL",{emitEvent:!0}),this.formGroup.controls.estimationDurationFallback.setValue(e.defaultServeDuration??null,{emitEvent:!0}),this.formGroup.controls.waitEstimationBufferDuration.setValue(e.waitEstimationBufferDuration??null,{emitEvent:!0}),this.formGroup.controls.numberOfServers.setValue(e.defaultNumServers??1,{emitEvent:!0}),this.formGroup.markAsPristine(),this.formGroup.updateValueAndValidity(),this.pendingChangesStore.resetInitialValue(this.formGroup))}save(){let e=this.locationRx.nullableLocation;if(!e)return;let i={defaultNumServers:this.formGroup.controls.numberOfServers.value,defaultServeDuration:this.formGroup.controls.estimationDurationFallback.value||null,estimateServiceDuration:this.formGroup.controls.estimationDuration.value==="HISTORICAL",showEstWaitAsRange:this.formGroup.controls.displayAsRange.value,waitEstimationBufferDuration:this.formGroup.controls.waitEstimationBufferDuration.value||null,waitEstimationMethod:wl[this.formGroup.controls.estimationModel.value]};this.updateLocationWrite.payload.next({locationId:e.id,updates:i})}subscribe(){this.coreLocationRx.currentLocationSnapshot$.pipe(z(this.ngOnDestroy$)).subscribe(e=>this.reset(e)),this.resourcesRx.resourceCategories$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{let i=e.map(o=>o.id);this.resourceCategoriesFormControl.setValue(i),this.resourceCategoriesFormControl.disable()})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-waitlist-wait-time-estimation"]],viewQuery:function(i,o){if(i&1&&ti(gE,5),i&2){let n;ii(n=oi())&&(o.intelligentModelSuffix=n.first)}},hostAttrs:[1,"ww-settings-waitlist-wait-time-estimation"],features:[O],decls:25,vars:20,consts:()=>{let e;e=$localize`Enabled`;let i;i=$localize`Buffer time`;let o;o=$localize`Add extra time to the calculated wait estimate to help manage customer expectations.`;let n;n=$localize`Estimation model`;let u;u=$localize` Select which model to activate on this location `;let h;h=$localize`Display as range`;let x;x=$localize` For instance "10-15 min wait" rather than "12 min wait" `;let P;P=$localize`Fallback duration`;let K;K=$localize`Used only for services without a duration set`;let de;de=$localize`Manage categories`;let Ce;Ce=$localize`Resource Settings`;let ue;ue=$localize`Included resource categories`;let ge;ge=$localize`Lists all active resource categories for this location included in the selected estimation model.`;let rt;rt=$localize` This setting is managed per resource category. To select which categories are included in the estimation model, go to ${"\uFFFD#11\uFFFD"}:START_TAG_WW_LINK:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_WW_LINK: to update each category. `;let st;st=$localize`Max simultaneous served visits`;let et;et=$localize`How many customers or served visits that each resource can handle at the same time.`;let ye;ye=$localize` Increasing the number of visits a resource can handle at the same time decreases the estimated wait duration for that resource. Configure this for each resource under ${"\uFFFD#21\uFFFD"}:START_TAG_WW_LINK:${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_WW_LINK:. `;let wt;wt=$localize`Serve capacity`;let he;he=$localize`The wait time estimate depends on your serve capacity (the number of people that can be served simultaneously). Please enter how many you on average serve at the same time.`;let Vt;return Vt=$localize`customer(s) at a time`,[["numServersSuffixTmpl",""],n,u,h,x,ue,ge,rt,st,et,ye,wt,he,Vt,[3,"source"],[3,"wwForm","wwTrackPendingChanges","wwTrackPendingChangesUntil"],[1,"flex","flex-col","gap-4","w-full"],[3,"layout","formControl","data","pluckLabel","pluckSublabel"],[1,"ww-settings-waitlist-wait-time-estimation-indent","flex","flex-col","gap-4","w-full"],["label",e,3,"layout","formControl"],["label",i,"sublabel",o,"placeholder","5",3,"formControl"],[3,"source",4,"wwPermission"],["label",P,"sublabel",K,"placeholder","10",1,"ww-settings-waitlist-wait-time-estimation-fallback-duration",3,"layout","formControl"],[1,"ww-settings-waitlist-wait-time-estimation-resource-categories",3,"layout","selection","type","formControl"],["wwFormFieldSize","large"],["content",de,"href","/settings/resource-categories","wwColor","primary",3,"type","inline"],["content",Ce,"href","/settings/resources","wwColor","primary",3,"type","inline"],["type","number",1,"max-w-full",3,"formControl","suffixComponent"]]},template:function(i,o){if(i&1&&(E(0,fE,1,1,"ww-wait-duration-chart",14),S(1,"async"),l(2,"form",15)(3,"ww-label-layout")(4,"ww-label")(5,"span"),w(6,1),r(),l(7,"ww-sublabel"),w(8,2),r()(),l(9,"div",16),g(10,"ww-radio",17),E(11,hE,4,8,"div",18),S(12,"async"),r()(),l(13,"ww-label-layout")(14,"ww-label")(15,"span"),w(16,3),r(),l(17,"ww-sublabel"),w(18,4),r()(),g(19,"ww-checkbox",19),r(),g(20,"ww-duration-picker",20),Ye(21),S(22,"async"),E(23,wE,22,8)(24,IE,9,2,"ww-label-layout"),r()),i&2){f(T(1,14,o.showWaitDurationChart$)?0:-1),s(2),m("wwForm",o.formId)("wwTrackPendingChanges",o.formGroup)("wwTrackPendingChangesUntil",o.updateLocationWrite.response$),s(8),m("layout","vertical")("formControl",o.formGroup.controls.estimationModel)("data",o.models)("pluckLabel",o.pluckModelLabel)("pluckSublabel",o.pluckModelSublabel),s(),f(T(12,16,o.isClassicModel$)?11:-1),s(8),m("layout","vertical")("formControl",o.formGroup.controls.displayAsRange),s(),m("formControl",o.formGroup.controls.waitEstimationBufferDuration);let n=T(22,18,o.hasResources$);s(3),f(n?23:24)}},dependencies:[X,Dt,oe,yt,ne,H,Oo,Fo,pt,M,at,Je,Mt,kt,ft,We,ke,Xe,He,Fe,bt,xe,qp,L],styles:[`.ww-settings-waitlist-wait-time-estimation{dis
49play:flex;flex-direction:column;gap:24px}.ww-settings-waitlist-wait-time-estimation .ww-settings-waitlist-wait-time-estimation-indent{padding-left:32px;max-width:500px}.ww-settings-waitlist-wait-time-estimation .ww-settings-waitlist-wait-time-estimation-indent>.ww-settings-waitlist-wait-time-estimation-indent{max-width:468px}.ww-settings-waitlist-wait-time-estimation .ww-settings-waitlist-wait-time-estimation-resource-categories .ww-display-resource{color:var(--ww-color-black)}.ww-settings-waitlist-wait-time-estimation .ww-settings-waitlist-wait-time-estimation-fallback-duration label{font-weight:400}
50/*noopsettings-waitlist-wait-time-estimation.component-JL6FD35S.css.map */
51`],encapsulation:2,changeDetection:0})}}return t})();var Pm={FIRST_NAME:$localize`First name`,LAST_INITIALS:$localize`First name & last name initial`,FIRST_INITIALS:$localize`First name initial & last name`,SHORT_LASTNAME_FIRST_INITIAL:$localize`Short last name & first name initial`,INITIALS:$localize`Initials`,FULL_NAME:$localize`Full name`,EXTERNAL_ID:$localize`External ID`,TICKET:$localize`Ticket`,TICKET_FIRSTNAME:$localize`Ticket & first name`,EMAIL:$localize`Email`,REDACTED_PHONE:$localize`Redacted Phone`,REDACTED_EXTERNAL_ID:$localize`Redacted External ID`,HIDDEN:$localize`Hidden`};var za={id:"",layout:"grid",title:$localize`Location settings`,categories:[{item:{type:"title",id:"location",title:$localize`Location`,icon:"ww-location"},items:[{type:"link",description:$localize`Manage contact details, address, open hours and more.`,enabledConfig:{somePermissions:["locations.update","locations.update-hours"]},page:{id:"details",title:$localize`Location details`,categories:[{item:{type:"link",icon:"ww-map",page:{title:$localize`Edit details`,id:"edit",component:J(()=>{let t=c(Ue),a=c(ht),e=c(v),i=c(cn),o=c(pn);return{joi:{formGroup:new F(y(W(y({},Z({logoUrl:[],publicLogoUrl:[],name:[],displayName:[],shortName:["",[gt.patternWithMessage(bl,$localize`Invalid location short name`)]],email:[],phone:[],website:[],businessName:[]})),{address:new F(W(y({},ut()({street:[],street2:[],city:[],zip:[]})),{state:new C(null),country:new C(null)}))}),Z({useAddressCoordinates:[],coordinates:[void 0],metadata:[null]}))),labels:{logoUrl:$localize`Location icon`,publicLogoUrl:$localize`Location logo`,name:$localize`Location name`,displayName:$localize`Location display name`,shortName:$localize`Location short name`,email:$localize`Email`,phone:$localize`Phone`,website:$localize`Website`,businessName:$localize`Business name`,address:$localize`Address`,useAddressCoordinates:$localize`Manually set coordinates`,coordinates:$localize`Coordinates`,metadata:$localize`Metadata`},sublabels:{logoUrl:$localize`A small logo displayed as a favicon, in chat messages, and other places with limited space. Use a square format for best visibility.`,publicLogoUrl:$localize`The main logo displayed in headers and prominent areas. Use a rectangular format for best visibility.`,name:$localize`Your location name is displayed across many areas, including your public pages and customer messages.`,displayName:$localize`Display a different location name on your public pages.`,shortName:$localize`Your business name as used in URLs.`,email:$localize`Enter the email address used for communications related to this location.`,phone:$localize`Enter the phone number for this location's contact.`,website:$localize`Enter the website URL for this location.`,metadata:$localize`Any additional data you want to add for this location. Only used by the API.`},hints:{shortName:$localize`Only lowercase letters, hyphens or digits. Maximum 20 lowercase letters or hyphens and 10 digits.`,logoUrl:a.displayImageUploadHint(),publicLogoUrl:a.displayImageUploadHint()},placeholders:{displayName:$localize`Optional`,email:$localize`e.g. [email protected]`,phone:$localize`1234 567 890`,businessName:$localize`e.g. Waitwhile`,website:$localize`e.g. https://business.com`},groups:{address:{children:["businessName","address"],label:$localize`Address`,sublabel:$localize`Enter the physical address for this location.`},coordinatesGroup:{children:["useAddressCoordinates","coordinates"],label:$localize`Coordinates`,sublabel:$localize`You can manually set coordinates instead of address if you want a more granular location pin in your location directory.`}},componentModifiers:{phone:(n,u)=>_(n,{$rx:{countryCode:u.pipe(De(1),p(h=>h.address?.country),p(h=>h??c(Js).countryId))}})},components:{logoUrl:_(Jn,{uploader:n=>R(null,null,function*(){let u=yield b(e.getCurrentLocation(["id"]));return o.payload.next({locationId:u.id,fileType:"internal-logo",dataUrl:n}),(yield b(o.response$))?.url})}),publicLogoUrl:_(Jn,{uploader:n=>R(null,null,function*(){let u=yield b(e.getCurrentLocation(["id"]));return o.payload.next({locationId:u.id,fileType:"public-logo",dataUrl:n}),(yield b(o.response$))?.url})}),coordinates:_(pu,{suffixComponent:_(He,{content:cu})}),metadata:_(yo,{maxEntries:20,keyValidators:[gt.metadataKey,re.maxLength(40)],valueValidators:[re.maxLength(500)]})},dependencies:n=>({coordinates:n.pipe(p(u=>({disabled:!u.useAddressCoordinates}
51))),metadata:t.hasAccountFeature("enableApiKeys").pipe(p(u=>({hidden:!u})))}),children:{address:{labels:{street:$localize`Street`,street2:$localize`Street 2`,city:$localize`City`,zip:$localize`Zip`,country:$localize`Country`,state:$localize`State`},placeholders:{city:$localize`e.g. San Francisco`,zip:$localize`e.g. 94104`,street:$localize`e.g. Market Street`,street2:$localize`Optional`},components:{country:_(Xl),state:_(dr)},dependencies:n=>({state:n.pipe(p(({address:u})=>{if(!u?.country)return{};let h=Ps(u.country);return{hidden:!h||h.length===0}}))}),componentModifiers:{state:(n,u)=>_(dr,{$rx:{stateCountryCode:u.pipe(p(h=>h?.address.country?h.address.country:null),Tt())}})}}}},transformer:{toView:n=>({logoUrl:n.logoUrl,publicLogoUrl:n.publicLogoUrl,name:n.name,displayName:n.displayName??void 0,shortName:n.shortName,email:n.email,phone:n.phone,website:n.website,businessName:n.businessName??void 0,address:{street:n.address?.street??null,street2:n.address?.street2??null,city:n.address?.city??null,zip:n.address?.zip??null,country:n.address?.country?.code??null,state:n.address?.state?.code??null},useAddressCoordinates:!n.useAddressCoordinates,coordinates:n.coordinates?{lat:n.coordinates.lat,lng:n.coordinates.lng}:void 0,metadata:n.metadata??null}),toPayload:n=>{let u=!n.useAddressCoordinates,h=u?void 0:n.coordinates;return W(y({},n),{useAddressCoordinates:u,coordinates:h,address:W(y({},n.address),{country:{code:n.address?.country??void 0,name:xs(n.address?.country)?.name},state:Ds(n.address?.country??void 0,n.address?.state??void 0)??null})})}},updateSideEffect:(n,u)=>{(!n.logoUrl||n.logoUrl.length===0)&&u.logoUrl&&u.logoUrl.length>0&&i.payload.next({locationId:u.id,fileType:"internal-logo"}),(!n.publicLogoUrl||n.publicLogoUrl.length===0)&&u.publicLogoUrl&&u.publicLogoUrl.length>0&&i.payload.next({locationId:u.id,fileType:"public-logo"})}}})}},items:[{type:"component",id:"info",title:$localize`Info`,grid:!0,component:_(om)},{type:"component",id:"address",title:$localize`Address`,grid:!0,component:_(im)}]},{item:{type:"title",id:"location-hours",title:$localize`Location opening hours`,icon:"ww-line-sync",enabledConfig:{somePermissions:["locations.update","locations.update-hours"]}},items:[{type:"component",title:$localize`Weekly hours`,enabledConfig:{somePermissions:["locations.update","locations.update-hours"]},id:"weekdays",grid:!0,component:()=>_(Pa,{$rx:{hoursByWeekday:c(v).getCurrentLocation(["hours"]).pipe(p(t=>t.hours??null))}})},{type:"component",title:$localize`Hours by date`,enabledConfig:{somePermissions:["locations.update","locations.update-hours"]},id:"dates",grid:!0,component:()=>_(xa,{$rx:{hoursByDate:c(v).getCurrentLocation(["hoursByDate"]).pipe(p(t=>t.hoursByDate??null))}})}]}]}},{type:"link",description:$localize`Create and manage your services.`,enabledConfig:Do,titleSuffix:()=>{let t=c(v),a=c(Cc);return[ao({$rx:{enabled:A([t.getCurrentLocation(["showServices"]),a.hasSelectableServices$]).pipe(p(([e,i])=>e.showServices&&i),Re(!0))}})]},page:{id:"services",title:$localize`Services`,component:_(Hp),options:{page:{id:"service-options",title:$localize`Service options`,component:J(()=>{let t=[Lt.OPEN_ALL,Lt.OPEN_FIRST,Lt.OPEN_NONE],a={[Lt.OPEN_ALL]:$localize`Categories are expanded by default`,[Lt.OPEN_FIRST]:$localize`First category is expanded by default`,[Lt.OPEN_NONE]:$localize`Categories are collapsed by default`},e=c(v);return{joi:{formGroup:new F(Z({showServices:[],serviceCategoryDisplay:[],serviceCategoryOpenState:[],allowMultipleServices:[],customerSessionOverlapMode:[],requireService:[],requireServicePublic:[],requiredServiceCategoryIds:[],serviceItemLayout:[],showPublicServiceEstWait:[],showPublicServiceDuration:[],showPublicServicePrice:[],defaultVisitOrderValue:[]})),groups:{allowMultipleServices:{children:["allowMultipleServices"],label:$localize`Multiple selection`,sublabel:$localize`Allow customers to select multiple services in a single visit.`},enableServices:{children:["showServices"],label:$localize`Enable services`,sublabel:$localize`Toggle to enable or disable services for this location.`},requireServiceSelection:{children:["requireService","requireServicePublic"],label:$localize`Require service selection`,sublabel:$localize`This would require a selection of at least one service in order to register.`},waitlistServiceDisplay:{children:["showPublicServiceEstWait","showPublicServiceDuration","showPublicServicePrice"],label:$localize`Registration service display`,sublabel:$localize`Choose how services are displayed to customers.`}},labels:{showServices:$localize`Enable services`,serviceCategoryDisplay:$localize`Service category display`,serviceCategoryOpenState:$localize`Category default view`,requiredServiceCategoryIds:$localize`Required service categories`,allowMultipleServices:$localize`Allow selecting multiple services`,customerSessionOverlapM
51ode:$localize`Selecting overlapping sessions`,requireService:$localize`For staff`,requireServicePublic:$localize`For customers`,serviceItemLayout:$localize`Service item layout`,showPublicServiceEstWait:$localize`Show service wait time`,showPublicServiceDuration:$localize`Show service duration`,showPublicServicePrice:$localize`Show service price`,defaultVisitOrderValue:$localize`Fallback revenue per visit`},sublabels:{customerSessionOverlapMode:$localize`Choose to allow, warn, or disallow customers who select sessions that overlap.`,serviceCategoryDisplay:$localize`How your services will be displayed for customer when registering, and for staff when creating visits.`,requiredServiceCategoryIds:$localize`Select which categories you require a service selection from.`,serviceItemLayout:$localize`Display services as large clickable cards or in a compact list.`,defaultVisitOrderValue:$localize`The fallback revenue is used for internal reporting when visits don't contain any selected services with defined prices.`},placeholders:{requiredServiceCategoryIds:$localize`Select`,defaultVisitOrderValue:$localize`e.g. 50`},components:{showServices:_(at),serviceCategoryOpenState:_(xe,{data:t,pluckLabel:i=>a[i]}),customerSessionOverlapMode:_(we,{data:Cl,pluckLabel:i=>hl[i]}),serviceItemLayout:_(Xn,{withPadding:!1,data:ir,pluckLabel:i=>_(Vn,{icon:or[i],$element:{classList:["block","w-20","h-20"]}}),pluckHint:i=>nr[i]}),defaultVisitOrderValue:_(Fe,{type:"number",$rx:{suffixComponent:e.getCurrentLocation(["currency"]).pipe(p(i=>i.currency??"USD"))}})},dependencies:i=>({serviceCategoryOpenState:i.pipe(p(o=>{let{serviceCategoryDisplay:n}=o;return{hidden:n!=="GROUPED",disabled:n!=="GROUPED"}})),requiredServiceCategoryIds:i.pipe(p(o=>{let{serviceCategoryDisplay:n,allowMultipleServices:u,requireService:h,requireServicePublic:x}=o;return(n==="GROUPED"||n==="SEPARATED")&&!u?{disabled:!0}:n==="LIST"||n==="CATEGORY-FIRST"?{disabled:!0}:{disabled:!h&&!x}}))}),componentModifiers:{allowMultipleServices:i=>_(i,{suffixComponent:_(He,{content:$localize`Regular services and session services cannot be mixed when multi selecting.`})}),requiredServiceCategoryIds:(i,o)=>_($r,{selection:"multiple",$rx:{hint:o.pipe(p(n=>{let{serviceCategoryDisplay:u,allowMultipleServices:h,requireService:x,requireServicePublic:P}=n;return(u==="GROUPED"||u==="SEPARATED")&&(!h||!x&&!P)?$localize`Enable Multiple selection and Require service selection to make service categories required`:u==="LIST"?$localize`Service categories cannot be required when categories are not displayed`:u==="CATEGORY-FIRST"?$localize`Service categories cannot be required when selecting categories first`:null}))}}),serviceCategoryDisplay:(i,o)=>_(we,{data:Be()(["GROUPED","SEPARATED","LIST","CATEGORY-FIRST"]),pluckLabel:n=>El[n],$rx:{hint:o.pipe(p(n=>n.serviceCategoryDisplay),Ee(se),p(n=>fl[n]))}})}}}})}}}},{type:"link",description:$localize`Create and manage your resources.`,enabledConfig:Po,titleSuffix:()=>{let t=c(v),a=c(Ei);return[ao({$rx:{enabled:A([t.getCurrentLocation(["showResources"]),a.hasSelectableResources$,a.containsOnlyHiddenResources$]).pipe(p(([e,i,o])=>e.showResources&&i&&!o),Re(!0)),label:a.containsOnlyHiddenResources$.pipe(p(e=>e?$localize`API`:"OFF")),color:a.containsOnlyHiddenResources$.pipe(p(e=>e?"success":"warning"))}})]},page:{id:"resources",title:$localize`Resources`,component:_(Vp),keywords:["team","staff","employee"],options:{page:{id:"resources-options",title:$localize`Resource options`,component:[Rr([$localize`Control which visits logged-in resources are eligible to serve under `,{type:"router-link",content:$localize`Account settings > Roles & permissions`,link:"/account/settings/permissions"}]),J(()=>{let t=[Lt.OPEN_ALL,Lt.OPEN_FIRST,Lt.OPEN_NONE],a={[Lt.OPEN_ALL]:$localize`Categories are expanded by default`,[Lt.OPEN_FIRST]:$localize`First category is expanded by default`,[Lt.OPEN_NONE]:$localize`Categories are collapsed by default`},e=c(Ue),i=c(Ei);return{joi:{formGroup:new F(Z({showResources:[],showPublicResourcesAsSeparateSteps:[],resourceCategoryDisplay:[],resourceCategoryOpenState:[],enableResourceAutoAway:[],enableResourceAwayAtLogout:[],resourceIsAwayReasonPresets:[],resourceItemLayout:[],showPublicCheckInResourceEstWait:[],appAwayTimeout:[]})),labels:{showResources:$localize`Enable resources`,showPublicRes
51ourcesAsSeparateSteps:$localize`Enable`,resourceCategoryDisplay:$localize`Resource category display`,resourceCategoryOpenState:$localize`Category default view`,enableResourceAutoAway:$localize`Set resources as away at the end of the day`,enableResourceAwayAtLogout:$localize`Set resources as away when they manually log out`,resourceIsAwayReasonPresets:$localize`Away status presets`,resourceItemLayout:$localize`Resource item layout`,showPublicCheckInResourceEstWait:$localize`Show resource wait time`,appAwayTimeout:""},sublabels:{resourceCategoryDisplay:$localize`How your resources will be displayed for customers when registering and for staff when creating visits.`,resourceIsAwayReasonPresets:$localize`Provide status message presets when setting a resource as Away.`,resourceItemLayout:$localize`Display resources as large clickable cards or in a compact list.`},groups:{enableResources:{children:["showResources"],label:$localize`Enable resources`,sublabel:$localize`Toggle to enable or disable resources for the location.`},separateSteps:{children:["showPublicResourcesAsSeparateSteps"],label:$localize`Show resources as a separate step`,sublabel:$localize`Choose whether resources should appear as a separate step in this location's registration flow.`},resourceStatus:{children:["enableResourceAutoAway","enableResourceAwayAtLogout","appAwayTimeout"],label:$localize`Resource away status`,sublabel:$localize`Enable to automatically manage resource away statuses.`},waitlistResourceDisplay:{children:["showPublicCheckInResourceEstWait"],label:$localize`Waitlist resource display`,sublabel:$localize`Choose how the resource is displayed to customers on the waitlist.`}},components:{resourceCategoryOpenState:_(xe,{data:t,pluckLabel:o=>a[o]}),resourceIsAwayReasonPresets:_(zp),resourceItemLayout:_(Xn,{withPadding:!1,data:ir,pluckLabel:o=>_(Vn,{icon:or[o],$element:{classList:["block","w-20","h-20"]}}),pluckHint:o=>nr[o]}),appAwayTimeout:_(op,{hasValueLabel:$localize`Prompt staff to clear away status after inactivity and log in`,defaultValue:tl(10),component:_(Mt,{label:$localize`Prompt after being inactive for`,layout:"vertical",timeUnits:["minute","hour","day","week"]})})},componentModifiers:{resourceCategoryDisplay:(o,n)=>_(we,{data:Be()(["GROUPED","SEPARATED","LIST","CATEGORY-FIRST"]),pluckLabel:u=>Tl[u],$rx:{pluckDisabled:i.resourceCategories$.pipe(p(u=>u.some(h=>h.isRequired)?h=>h==="LIST":()=>!1)),hint:n.pipe(p(u=>u.resourceCategoryDisplay),Ee(se),p(u=>_(He,{$element:{classList:["mt-2"],color:"black"},color:"black",content:gl[u]})))}})},dependencies:o=>({resourceCategoryOpenState:o.pipe(p(n=>{let{resourceCategoryDisplay:u}=n;return{hidden:u!=="GROUPED",disabled:u!=="GROUPED"}})),resourceIsAwayReasonPresets:e.lacksAccountFeatures(["enableCustomAwayReasons"]).pipe(p(n=>({hidden:n})))})}}})]}}}},{type:"link",description:$localize`Manage your schedules.`,enabledConfig:{somePermissions:["resources.show","resources.update","services.update","services.show"]},page:{id:"schedules",title:$localize`Schedules`,keywords:[$localize`Availability`,$localize`Closed hours`,$localize`Open hours`],component:_(Am)}},{type:"link",description:$localize`Localize language, time zone, currency and more.`,page:{id:"localization",title:$localize`Localization`,keywords:[$localize`Languages`,$localize`Translations`,$localize`Translate`],categories:[{item:{type:"title",id:"region",title:$localize`Region`,icon:"ww-position"},items:[{type:"link",description:$localize`Select the languages available for your customers.`,page:{id:"languages",title:$localize`Languages`,component:()=>[Rr([{type:"markdown",content:$localize`Note that you need to provide translations for [Customer messages](/settings/customer-messages) and [Customer journey terms](/settings/localization/registration) for each added language.`}]),J(()=>({joi:{formGroup:new F({publicLocales:new C([],{nonNullable:!0,validators:re.required}),defaultLocale:new C(null,{validators:re.required})}),labels:{publicLocales:$localize`Languages`,defaultLocale:$localize`Default language`},sublabels:{publicLocales:$localize`Select the languages available for your customers.`,defaultLocale:$localize`Select the default language used when customers have not selected a language, or when there are no translations available for their selected language.`},components:{publicLocales:_(Sp),defaultLocale:_(we,{selection:"radio"})},componentModifiers:{defaultLocale:(t,a)=>_(t,{pluckLabel:Bn,pluckTrigger:Bn,$rx:{data:a.pipe(p(e=>e.publicLocales))}})},dependencies:t=>({defaultLocale:t.pipe(p(a=>({hidden:a.publicLocales.length<=1})))})},transformer:{toView:t=>({publicLocales:t.publicLocales??[],defaultLocale:t.publicLocales[0]}),toPayload:t=>({publicLocales:t.publicLocales.sort((a,e)=>a===t.defaultLocale?-1:e===t.defaultLocale?1:0)})},updateSideEffect:(t,a)=>{if(!t.publicLocales||t.publicLocales.every(i=>a.publicLocales?.includes(i)))return;c(Ae).openConfirm({title:$localize`New languages added`,message:{type:"component",content:rn([$localize`Note that you need to provide translations for each added language in `,{type:"router-link",content:$localize`Customer messages`,link:"/settings/customer-messages"},$localize` and `,{type:"router-link",content:$localize`Customer journey terms`,link:"/settings/localization/registration"},"."])},confirmLabel:$localize`Got it`,cancelLabel:null})}}))]},suffix:()=>[qe(["publicLocales"],({publicLocales:t})=>{let a=t?.length??0;if(a===0)return!1;let e=t.map(Bn).slice(0,2),i=a-e.length;return`${e.join(", ")}${i>0?` +${i}`:""}`})]},{type:"title",id:"time-zone",description:$localize`Align your schedule and operations with your local time zone.`,title:$localize`Time zone`,suffix:()=>[Vr(()=>({joi:{formGroup:new F(Z({timezone:[]}))}}))]},{type:"title",id:"currency",title:$localize`Currency`,description:$localize`Set the currency used for your services.`,suffix:()=>[Vr(()=>({joi:{formGroup:new F(Z({currency:[]})),components:{currency:_(Hl)}}}))]}]},{item:{type:"title",id:"terms",title:$localize`Terms`,icon:"ww-terms"},items:[{type:"link",description:$localize`Customize business terms across your application.`,page:{
51id:"business",title:$localize`Business terms`,component:_(Zu)}},{type:"link",description:$localize`Customize and translate your customer journey terms.`,page:{id:"registration",title:$localize`Customer journey terms`,component:_(wp)}},{type:"link",description:$localize`Customize and translate your email terms.`,page:{id:"email-terms",title:$localize`Email terms`,component:_(tm)}}]}]}},{type:"link",description:$localize`Connect Waitwhile to your other apps.`,page:{id:"integrations",title:$localize`Integrations`,tabs:[{id:"native",title:$localize`Native`,categories:[{items:[{type:"link",icon:"ww-logo-outlook",description:$localize`Automatically synchronize resources' Waitwhile bookings and their Outlook calendar events.`,suffix:()=>qe(["externalCalendars"],t=>t?.externalCalendars?.OUTLOOK?.enableIncoming||t?.externalCalendars?.OUTLOOK?.enableOutgoing?$localize`On`:$localize`Off`),enabledConfig:{accountFeatures:["enableExternalCalendarSync"]},page:{id:"outlook-calendar",title:$localize`Outlook calendar`,description:()=>{let e=c(Ue).nullableAccount?.settings?.externalCalendars?.OUTLOOK?.enabled?$localize`To turn this integration off and to modify allowed domains, visit  `:$localize`To use this integration, it must first be enabled under `;return Fp({permissions:["accounts.update"]},rn([e,{type:"router-link",content:$localize`Account settings > Calendar > Outlook`,link:"/account/settings/calendar/outlook-calendar"},"."]))},component:()=>[J(()=>{let t=c(Io),a=c(un),e=_(dn,{fetchPreview:i=>t.getMessagePreview(i,"SMS"),editor:mn,$rx:{completion:a.liquidCompletion$,stringify:a.stringifyLiquidCode$,variableMenuItems:a.createNewVariableItems$}});return{joi:{formGroup:new F({externalCalendars:new F({OUTLOOK:new F({configuration:new C(null),eventTitleTemplate:new C("",{nonNullable:!0}),eventDescriptionTemplate:new C("",{nonNullable:!0})})})}),children:{externalCalendars:{children:{OUTLOOK:{labels:{configuration:$localize`Integration configuration`,eventTitleTemplate:$localize`Event title`,eventDescriptionTemplate:$localize`Event description`},sublabels:{configuration:$localize`Choose whether to export Waitwhile bookings to Outlook, import events from Outlook to Waitwhile, or both.`,eventTitleTemplate:$localize`Specify the title of bookings exported from Waitwhile to Outlook.`,eventDescriptionTemplate:$localize`Specify the description of bookings exported from Waitwhile to Outlook.`},components:{configuration:_(xe,{data:Be()(["IMPORT","EXPORT","BOTH","NONE"]),pluckLabel:i=>({IMPORT:$localize`Import Outlook events into Waitwhile`,EXPORT:$localize`Export Waitwhile events to Outlook`,BOTH:$localize`Both`,NONE:$localize`None`})[i]}),eventTitleTemplate:_(e,{defaultValue:Za}),eventDescriptionTemplate:_(e,{defaultValue:er})}}}}}},transformer:{toView:i=>{let o;return i.externalCalendars?.OUTLOOK?.enableIncoming&&i.externalCalendars?.OUTLOOK?.enableOutgoing?o="BOTH":i.externalCalendars?.OUTLOOK?.enableIncoming?o="IMPORT":i.externalCalendars?.OUTLOOK?.enableOutgoing?o="EXPORT":o="NONE",{externalCalendars:{OUTLOOK:{configuration:o,eventDescriptionTemplate:i.externalCalendars?.OUTLOOK?.eventDescriptionTemplate||er,eventTitleTemplate:i.externalCalendars?.OUTLOOK?.eventTitleTemplate||Za}}}},toPayload:i=>{let o=i.externalCalendars?.OUTLOOK;return{externalCalendars:{OUTLOOK:{enableIncoming:o.configuration==="IMPORT"||o.configuration==="BOTH",enableOutgoing:o.configuration==="EXPORT"||o.configuration==="BOTH",eventDescriptionTemplate:o.eventDescriptionTemplate,eventTitleTemplate:o.eventTitleTemplate}}}}}}})]}},{type:"title",icon:"ww-logo-salesforce",title:$localize`Salesforce`,id:"salesforce",description:$localize`Sync Salesforce contacts with your Waitwhile customers.`,suffix:()=>[_(Aa)]},{type:"link",icon:"ww-logo-google-tag-manager",description:$localize`Manage and deploy marketing tags.`,suffix:()=>qe(["googleTagManager"],t=>t?.googleTagManager?.enabled?$localize`On`:$localize`Off`),page:{id:"google-tag-manager",title:$localize`Google tag manager`,component:J(()=>({joi:{formGroup:new F({googleTagManager:new F({enabled:new C(!1,{nonNullable:!0}),id:new C("",{nonNullable:!0,validators:[re.required,re.minLength(1)]})})}),children:{googleTagManager:{labels:{enabled:$localize`Enable Google tag manager`,id:$localize`ID`},sublabels:{id:$localize`Insert your tag manager ID here.`},components:{enabled:_(at,{suffixComponent:$localize`Enabled`})},dependencies:t=>({id:t.pipe(p(a=>({disabled:!a.googleTagManager.enabled})))})}}},transformer:{toView:t=>({googleTagManager:{enabled:!!t.googleTagManager?.enabled,id:t.googleTagManager?.id??""}}),toPayload:t=>{let a=t.googleTagManager;return{googleTagManager:a.enabled?a:null}}}}))}},{type:"title",icon:"ww-logo-retail-next",title:$localize`RetailNext`,id:"retail-next",description:$localize`Enable automatic capacity counting with video sensor.`,suffix:()=>[_(Aa)]}
51,{type:"dialog",id:"facebook",title:$localize`Facebook`,description:$localize`Embed your waitlist or bookings on your Facebook page.`,label:$localize`Learn how`,component:_(Xu),icon:"ww-logo-facebook",dialogOptions:{size:"x-large"}},{type:"title",icon:"bxs-user-account",title:$localize`Custom CRM`,id:"custom-crm",description:$localize`Connect any CRM system to Waitwhile. Sync valuable customer data.`,enabledConfig:{accountFeatures:["enableCustomCrm"]},suffix:()=>[_(Aa)]}]}]},{id:"custom",title:$localize`Custom`,categories:[],component:_(Hu),keywords:["Zapier"],enabledConfig:{rx:t=>Y(se(t.get(Zo).zapierId))}}]}},{type:"link",description:$localize`Set default display settings for this location.`,enabledConfig:{permissions:["assets.update","locations.update"]},page:{id:"display-settings",title:$localize`Display settings`,tabs:[{id:"calendar",title:$localize`Calendar`,component:_(_p,{assetScope:"location"})},{id:"visits",title:$localize`Visits`,component:_(dp,{assetScope:"location"})}]}}]},{item:{type:"title",id:"messages",title:$localize`Messages`,icon:"ww-message-center"},items:[{type:"link",titleSuffix:()=>{let t=c(ki);return[ao({$rx:{enabled:t.hasActiveCustomerMessages$.pipe(Re(!0))}})]},description:$localize`Manage your automated customer messages.`,page:{id:"customer-messages",title:$localize`Customer messages`,component:_(lm),options:{page:{id:"customer-messages-options",title:$localize`Customer message options`,component:_(nm),keywords:[$localize`SMS sending number`,$localize`Alphanumeric sender ID`,$localize`Allow customers to respond to messages`,$localize`Show QR code in customer messages`,$localize`Show confirmation link in customer messages`]}}}},{type:"link",description:$localize`Manage your automated team notifications.`,page:{id:"team-notifications",title:$localize`Team notifications`,component:_(gm),options:{page:{id:"team-notifications-options",title:$localize`Product sounds`,component:J(()=>({joi:{formGroup:new F(Z({playSoundAddGuest:[],playSoundServeGuest:[]})),groups:{playSounds:{children:["playSoundAddGuest","playSoundServeGuest"],label:$localize`Play product sound`,sublabel:$localize`Toggle to play a notification sound for product-related events.`}},labels:{playSoundAddGuest:$localize`When a customer is added`,playSoundServeGuest:$localize`When a customer is served`}}}))}}}},{type:"link",description:$localize`Manage your saved replies.`,page:{id:"saved-replies",title:$localize`Saved replies`,component:_(Tm)}}]},{item:{type:"title",id:"customer-journey",title:$localize`Customer journey`,icon:"ww-direction"},items:[{type:"link",titleSuffix:_i("isBookingActive"),description:$localize`Configure functionality and visibility related to your bookings.`,enabledConfig:{somePermissions:["locations.update","locations.update-hours"]},page:{id:"bookings",title:$localize`Bookings`,component:_(ae("isBookingActive",{transformer:{toView:({isBookingActive:t})=>!!t,toPayload:t=>t?{isBookingActive:t}:{isBookingActive:!1}}}),{label:$localize`Enabled`}),categories:[{item:{type:"title",id:"booking-hours",title:$localize`Booking hours`,icon:"ww-line-sync",description:$localize`Set custom hours for your booking availability.`},items:[{type:"component",id:"weekdays",title:$localize`Weekly hours`,grid:!0,component:()=>_(Pa,{initialState:"bookings",hiddenStates:["general","waitlist"],$rx:{hoursByWeekday:c(v).getCurrentLocation(["hours","bookingHours"]).pipe(p(t=>y(y({},t.hours),t.bookingHours)))}})},{type:"component",id:"dates",title:$localize`Hours by date`,grid:!0,component:()=>_(xa,{initialState:"bookings",$rx:{hoursByDate:c(v).getCurrentLocation(["hoursByDate","bookingHoursByDate"]).pipe(p(t=>y(y({},t.hoursByDate),t.bookingHoursByDate)))}})}]},{item:{type:"title",id:"bookings-general",title:$localize`General`,icon:"ww-general",description:$localize`Configure basic functionality around your bookings.`},items:[{type:"link",description:$localize`Manage how many bookings can be made at the same time.`,page:{id:"availability",title:$localize`Availability`,keywords:[$localize`Overbook`,$localize`Slots`,$localize`Spots`,$localize`Timeslots`,$localize`Separate calendar`],component:J(()=>{let t=c(Ni);return{joi:{formGroup:new F(Z({bookingTimeSlotIncr:[],bookingSpotsPerSlot:[],bookingAllowOverbooking:[],bookingAllowManualDuration:[],bookingAllowManualStartTime:[],bookingCountPartiesAsMultipleSpots:[],bookingUseResourceSpots:[],maxServingIncludeUpcoming:[]})),groups:{availabilityOptions:{children:["bookingAllowOverbooking","bookingAllowManualDuration","bookingAllowManualStartTime","bookingCountPartiesAsMultipleSpots","bookingUseResourceSpots","maxServingIncludeUpcoming"],label:$localize`Options`,sublabel:$localize`Other availability, slot and spot options.`}},labels:{bookingTimeSlotIncr:$localize`Slot size`,bookingSpotsPerSlot:$localize`Spots per slot`,bookingAllowOverbooking:$localize`Allow staff to override availability`,bookingAllowManualDuration:$localize`Allow staff to set a manual booking duration`,bookingAllowManualStartTime:$localize`Enable flexible booking start times`,bookingCountPartiesAsMultipleSpots:$localize`Count every customer in a party as one spot each`,bookingUseResourceSpots:$localize`Resources have individual spots per time slot`,maxServingIncludeUpcoming:$localize`Resource serving capacity counts bookings and sessions`},sublabels:{bookingTimeSlotIncr:$localize`e.g. 15 min slots will show open slots at 8:00, 8:15, 8:30 etc.`,bookingSpotsPerSlot:$localize`How many customers can book each slot.`},infos:{bookingAllowOverbooking:$localize`No availability restrictions will apply to staff when creating/updating bookings.`,bookingAllowManualDuration:$localize`Whether staff can set a booking duration that overrides the default service-based duration.`,bookingAllowManualStartTime:$localize`Allow staff to ignore slot sizes and specify booking start times down to every 5 minutes.`,bookingCountPartiesAsMultipleSpots:$localize`e.g. if a party of 5 books, they will occupy 5 spots.`,bookingUseResourceSpots:$localize`Multiplies your spots per slot by the number of available resources. Also takes into account if a resource has its own number of spots per slot.`,maxServingIncludeUpcoming:$localize`If enabled, users will be notified of upcoming resource bookings and resource sessions when they serve a visit.`},components:{bookingTimeSlotIncr:Nu([300,600,900,1200,1500,1800,2100,2400,2700,3e3,3300,3600,5400,7200,10800,14400,18e3,21600,25200,28800],t)}},confirmation:(a,e)=>a.bookingAllowManualStartTime&&!e.bookingAllowManualStartTime?{title:$localize`Enable flexible booking start times?`,message:[$localize`Please note that this will allow staff to create bookings that partly occupy multiple slots, which can lower overall location booking availability.`,$localize`For example: a location has slots at 10:00-11:00 and 11:00-12:00. If a staff member creates a booking at 10:30-11:30, it will occupy both slots.`],confirmLabel:$localize`Enable`,cancelLabel:$localize`Cancel`}:null}})}},{type:"link",description:$localize`Manage how far in advance customers can make a booking.`,suffix:()=>[qe(["bookingMinNotice","bookingMaxNotice"],t=>{let a=pr(t.bookingMinNotice??0),e=ur(t.bookingMinNotice??0,a),i=pr(t.bookingMaxNotice??0),o=ur(t.bookingMaxNotice??0,i);if(o===0)return"";let n=`${e} ${e===1?lr[a]:cr[a]}`,u=`${o} ${o===1?lr[i]:cr[i]}`;return`${n} - ${u}`})],page:{id:"scheduling-window",title:$localize`Scheduling window`,component:J(()=>({joi:{formGroup:new F(Z({bookingMinNotice:[],bookingMaxNotice:[]})),labels:{bookingMinNotice:$localize`Min notice`,bookingMaxNotice:$localize`Max notice`},sublabels:{bookingMinNotice:$localize`How much advance notice you require before customers book an appointment.`,bookingMaxNotice:$localize`How far in the future customers is allowed to book an appointment.`},components:{bookingMinNotice:_(Mt),bookingMaxNotice:_(Mt)}},transformer:{toPayload:t=>({bookingShowOnlyToday:(t.bookingMinNotice??0)>=3600*24?!1:void 0,bookingMinNotice:t.bookingMinNotice,bookingMaxNotice:t.bookingMaxNotice}),toView:t=>({bookingMinNotice:t.bookingMinNotice,bookingMaxNotice:t.bookingMaxNotice})},confirmation:(t,a)=>a.bookingShowOnlyToday===!0&&((t.bookingMinNotice??0)>=3600*24||(t.bookingMaxNotice??Number.MAX_VALUE)<3600*24)?{title:$localize`Scheduling window outside of todays date`,message:$localize`The scheduling window is in conflict with the enabled setting "Display only today's date". If you choose to continue, this setting will be disabled for this location. Are you sure you want to continue?`}:null}))}}
51,{type:"link",description:$localize`Allow registration only if the customer is within a certain radius from your location.`,page:{id:"geofence",title:$localize`Geofence`,component:()=>{let t=c(v);return[_(He,{$rx:{content:t.getCurrentLocation(["useAddressCoordinates","address"]).pipe(p(({useAddressCoordinates:a,address:e})=>{let i="";a?i=Er(e)?$localize`Your location is set to use geofence coordinates from your location address, which is ${e?.street}, ${e?.city}, ${e?.zip}, ${e?.country?.name}. Manage your location address under `:$localize`Your location is set to use geofence coordinates from your location address, which is empty. Manage your location address under `:i=$localize`Your location is set to use coordinates instead of an address. Manage your location coordinates under `;let o=_(bt,{content:$localize`Location details > Edit details`,href:"/settings/details/edit",inline:!0,type:"router-link",$element:{color:"blue2"}});return Et({$element:{classList:["!inline"]},components:[i,o]})}))}}),J(()=>({joi:{formGroup:new F(Z({enableBookingGeofence:[],geofenceMaxDistance:[]})),labels:{enableBookingGeofence:$localize`Show geofence`,geofenceMaxDistance:$localize`Max distance from location`},sublabels:{enableBookingGeofence:$localize`Allow registration only if customer is within a certain distance of the location.`,geofenceMaxDistance:$localize`The allowed distance from your location or coordinates.`},components:{geofenceMaxDistance:_(sr,{hint:$localize`Accuracy may vary depending on device, signal strength, and environmental conditions.`})},dependencies:a=>({geofenceMaxDistance:a.pipe(p(e=>({hidden:!e.enableBookingGeofence})))})}}))]}},suffix:()=>{let t=c(tr).getCountryId(),a=Xa(t),e=c(Ya);return qe(["geofenceMaxDistance","enableBookingGeofence"],({geofenceMaxDistance:i,enableBookingGeofence:o})=>({text:`${e.transform(i??0,{from:"meter",to:a})} ${rr[a]}`,disabled:!o}))}},{type:"title",id:"hold-booking-times",title:$localize`Booking time hold`,description:$localize`Reserve the customer's selected time slot for 10 min while they are completing their registration.`,suffix:()=>[ae("enablePendingVisitsBooking")]},{type:"link",description:$localize`Limit the number of bookings a customer can make per time period.`,page:{id:"max-booked-customer-visits",title:$localize`Max bookings per customer`,component:J(()=>({joi:{formGroup:new F(Z({maxBookedCustomerVisits:[],maxBookedCustomerVisitsPeriod:[]})),labels:{maxBookedCustomerVisits:$localize`Booking limit`,maxBookedCustomerVisitsPeriod:$localize`Time period`},sublabels:{maxBookedCustomerVisits:$localize`How many simultaneous bookings your customer can have in a given time period.`},components:{maxBookedCustomerVisitsPeriod:_(we,{data:["DAY","WEEK","MONTH"],selection:"single",pluckLabel:t=>t==="DAY"?$localize`Day`:t==="WEEK"?$localize`Week`:t==="MONTH"?$localize`Month`:""})}}}))},suffix:()=>[qe(["maxBookedCustomerVisits","maxBookedCustomerVisitsPeriod"],({maxBookedCustomerVisits:t,maxBookedCustomerVisitsPeriod:a})=>!!t&&t>0&&!!a?$localize`${t} per ${a.toLowerCase()}`:!1)]},{type:"title",id:"allow-flagged-customers-to-book",description:$localize`Flagged customers will be able to book normally.`,title:$localize`Allow flagged customers to book`,suffix:()=>[ae("rejectFlaggedCustomers",{transformer:{toPayload:t=>({rejectFlaggedCustomers:!t}),toView:t=>!t.rejectFlaggedCustomers}})]}
51,{type:"title",id:"allow-only-invited-customers-to-join",description:$localize`Only customers that are available under your Customers page will be able to book.`,title:$localize`Allow only existing customers to register`,suffix:()=>[ae("bookingRejectUnknownCustomers")]},{type:"title",id:"booking-approval",title:$localize`Booking approval`,description:$localize`Customers make booking requests that must be approved by staff.`,suffix:()=>[ae("bookingManualConfirmation")]},{type:"title",id:"week-start-day",description:$localize`Set the day that the staff calendar week starts on.`,title:$localize`Week start day`,suffix:()=>Wo("bookingCalendarStartDay",{options:[{value:"monday",label:$localize`Monday`},{value:"sunday",label:$localize`Sunday`},{value:"today",label:$localize`Today`}]})}]},{item:{type:"title",id:"customer-actions-booking",title:$localize`Customer actions`,icon:"ww-actions",description:$localize`Manage what registered customers can do from their status page.`},items:[{type:"title",id:"show-public-booking-status-arrived",description:$localize`Customers can let staff know that they have arrived. The “Arrived” label will be added to the visit.`,title:$localize`Allow customer to mark themselves as Arrived`,suffix:()=>[ae("showPublicBookingStatusArrived")]},{type:"title",id:"show-public-booking-status-delayed",description:$localize`Customers can let staff know that they are running late. The “Delayed” label will be added to the visit.`,title:$localize`Allow customer to mark themselves as Delayed`,suffix:()=>[ae("showPublicBookingStatusDelayed")]},{type:"title",id:"booking-allow-reschedule",description:$localize`Customers are allowed to reschedule their booking.`,title:$localize`Allow customers to reschedule booking`,suffix:()=>[ae("bookingAllowReschedule")]},{type:"title",id:"booking-allow-cancel",description:$localize`Customers are allowed to cancel their booking.`,title:$localize`Allow customers to cancel their booking`,suffix:()=>[ae("bookingAllowCancel")]},{type:"title",id:"booking-allow-confirm",description:$localize`Customers can confirm their booking 24 hours before the start time.`,title:$localize`Allow customers to confirm their booking`,suffix:()=>[ae("bookingAllowConfirm")]},{type:"title",id:"show-status-page-edit-details-booking",description:$localize`Customers are allowed edit their details on their booking confirmation page.`,title:$localize`Allow customers to edit their details`,suffix:()=>[ae("showStatusPageEditDetailsBooking")]},{type:"title",id:"show-add-to-wallet",description:$localize`Customers are able to store their booking details in their digital wallet.`,title:$localize`Allow customers to add booking to ${Ml}`,suffix:()=>[ae("showAddToWallet")],enabledConfig:Pe({accountFeatures:["enableWalletPass"],permissions:["locations.update"]})}]},{item:{type:"title",title:$localize`Display settings`,id:"display-settings",icon:"ww-display-settings",description:$localize`Manage what information to display for your customers.`},items:[{type:"title",id:"show-ticket-style",description:rn([$localize`Show a modern, ticket-style view on the guest status page. Requires `,{type:"router-link",content:$localize`QR serve`,link:"/settings/arrival/qr-serve-booking"},$localize` to be enabled.`]),title:$localize`Show Ticket-style confirmation on mobile`,suffix:()=>{let t=c(v);return[_(hn,{properties:["showStatusPageTicketBooking"],featureEnabledConfig:{permissions:["locations.update"]},transformer:{toPayload:a=>({showStatusPageTicketBooking:a}),toView:a=>!!a.showStatusPageTicketBooking},$rx:{disabled:t.getCurrentLocation(["showPublicBookingStatusQR"]).pipe(p(a=>a.showPublicBookingStatusQR?null:{value:!0,reason:$localize`QR serve must be enabled for bookings in order to enable the Ticket-style confirmation.`}))}})]}},{type:"title",id:"use-local-timezone",description:$localize`The booking page will display times in the customer's time zone.`,title:$localize`Display time in customer's time zone`,suffix:()=>[ae("publicBookingUseLocalTimezone")]},{type:"title",id:"show-only-todays-date",description:$localize`Only display and allow bookings for the current day.`,title:$localize`Display only today's date`,suffix:()=>[ae("bookingShowOnlyToday",{transformer:{toPayload:t=>({bookingShowOnlyToday:t,bookingMinNotice:t?null:void 0,bookingMaxNotice:t?null:void 0}),toView:t=>!!t.bookingShowOnlyToday},confirmation:(t,a)=>t.bookingShowOnlyToday===!0&&((a.bookingMinNotice??0)>=3600*24||(a.bookingMaxNotice??Number.MAX_VALUE)<3600*24)?{title:$localize`Scheduling window outside of valid range`,message:$localize`The current scheduling window is in conflict with this setting. If you only allow bookings for today date, the scheduling window will be removed for this location. Are you sure you want to continue?`}:null})]}
51,{type:"title",id:"jump-to-first-available-date",description:$localize`Pre-select the first available date where there are available time slots.`,title:$localize`Jump to first available date`,suffix:()=>[ae("bookingShowFirstAvailableDate")]},{type:"title",id:"show-available-spots",description:$localize`Show the amount of available spots per time slot.`,title:$localize`Show available spots`,suffix:()=>[ae("publicBookingShowNumSpots")]},{type:"title",id:"show-notice-if-no-times",description:$localize`Help guide customers by notifying them when no times are available within 30 days.`,title:$localize`Show notice if no times are available within 30 days`,suffix:()=>[ae("showPublicBookingUnavailableNotice")]},{type:"title",id:"show-booking-end-time",description:$localize`Show the start and end time of the booking as opposed to only showing the start time.`,title:$localize`Show booking start and end time in confirmation`,suffix:()=>[ae("showPublicBookingEndTime")]}]}]}},{type:"link",titleSuffix:_i("isWaitlistActive"),description:$localize`Configure functionality and visibility related to your waitlist.`,enabledConfig:{somePermissions:["locations.update","locations.update-hours"]},page:{id:"waitlist",title:$localize`Waitlist`,component:ae("isWaitlistActive",{label:$localize`Enabled`,transformer:{toView:({isWaitlistActive:t})=>!!t,toPayload:t=>t?{isWaitlistActive:t}:{isWaitlistActive:!1}}}),categories:[{item:{type:"title",id:"waitlist-hours",icon:"ww-line-sync",title:$localize`Waitlist hours`,description:$localize`Set custom hours for your waitlist.`},items:[{type:"component",id:"weekdays",title:$localize`Weekly hours`,grid:!0,component:()=>_(Pa,{initialState:"waitlist",hiddenStates:["general","bookings"],$rx:{hoursByWeekday:c(v).getCurrentLocation(["hours","waitlistHours"]).pipe(p(t=>y(y({},t.hours),t.waitlistHours)))}})},{type:"component",id:"dates",title:$localize`Hours by date`,grid:!0,component:()=>_(xa,{initialState:"waitlist",$rx:{hoursByDate:c(v).getCurrentLocation(["hoursByDate","waitlistHoursByDate"]).pipe(p(t=>y(y({},t.hoursByDate),t.waitlistHoursByDate)))}})}]},{item:{type:"title",id:"waitlist-general",icon:"ww-general",title:$localize`General`,description:$localize`Configure basic functionality around your waitlist.`},items:[{type:"title",id:"allow-customers-to-register-multiple-times",title:$localize`Allow customers to register multiple times`,description:$localize`Customers will be able to register for the waitlist multiple times.`,suffix:()=>[ae("maxWaitingCustomerVisits",{transformer:{toPayload:t=>({maxWaitingCustomerVisits:t?null:1}),toView:({maxWaitingCustomerVisits:t})=>t!==1}})]},{type:"title",id:"allow-flagged-customers",title:$localize`Allow flagged customers to join`,description:$localize`Flagged customers will be able to register normally.`,suffix:()=>[ae("rejectFlaggedCustomers",{transformer:{toPayload:t=>({rejectFlaggedCustomers:!t}),toView:t=>!t.rejectFlaggedCustomers}})]},{type:"title",id:"allow-only-invited-customers",title:$localize`Allow only existing customers to join`,description:$localize`Only customers that are available under your Customers page will be able to register.`,suffix:()=>[ae("waitlistRejectUnknownCustomers")]},{type:"link",description:$localize`Disable the waitlist for new registrations when a certain number of visits has been reached.`,page:{id:"limit-waitlist",title:$localize`Limit max number of visits on the waitlist`,component:J(()=>({joi:{formGroup:new F(Z({maxWaitingActive:[],maxWaiting:[]})),labels:{maxWaitingActive:$localize`Enable limit`,maxWaiting:$localize`Limit`},sublabels:{maxWaiting:$localize`The maximum number of visits allowed on the waitlist at once.`},placeholders:{maxWaiting:$localize`e.g. 100`},components:{maxWaitingActive:_(at,{suffixComponent:$localize`Enable`})},dependencies:t=>({maxWaiting:t.pipe(p(a=>({disabled:!a.maxWaitingActive})))})}}))},suffix:()=>[qe(["maxWaitingActive","maxWaiting"],({maxWaitingActive:t,maxWaiting:a})=>t?a?Pn($localize`${a} visit`,a,$localize`${a} visits`):"":!1)]},{type:"link",description:$localize`Allow registration only if the customer is within a certain radius from your location.`,page:{
51id:"geofence",title:$localize`Geofence`,component:()=>{let t=c(v);return[_(He,{$rx:{content:t.getCurrentLocation(["useAddressCoordinates","address"]).pipe(p(({useAddressCoordinates:a,address:e})=>{let i="";a?i=Er(e)?$localize`Your location is set to use geofence coordinates from your location address, which is ${e?.street}, ${e?.city}, ${e?.zip}, ${e?.country?.name}. Manage your location address under `:$localize`Your location is set to use geofence coordinates from your location address, which is empty. Manage your location address under `:i=$localize`Your location is set to use coordinates instead of an address. Manage your location coordinates under `;let o=_(bt,{content:$localize`Location details > Edit details`,href:"/settings/details/edit",inline:!0,type:"router-link",$element:{color:"blue2"}});return Et({$element:{classList:["!inline"]},components:[i,o]})}))}}),J(()=>({joi:{formGroup:new F(Z({enableWaitlistGeofence:[],geofenceMaxDistance:[]})),labels:{enableWaitlistGeofence:$localize`Show geofence`,geofenceMaxDistance:$localize`Max distance from location`},sublabels:{enableWaitlistGeofence:$localize`Allow registration only if customer is within a certain distance of the location.`,geofenceMaxDistance:$localize`The allowed distance from your location or coordinates.`},components:{geofenceMaxDistance:_(sr,{hint:$localize`Accuracy may vary depending on device, signal strength, and environmental conditions.`})},dependencies:a=>({geofenceMaxDistance:a.pipe(p(e=>({hidden:!e.enableWaitlistGeofence})))})}}))]}},suffix:()=>{let t=c(tr).getCountryId(),a=Xa(t),e=c(Ya);return qe(["geofenceMaxDistance","enableWaitlistGeofence"],({geofenceMaxDistance:i,enableWaitlistGeofence:o})=>({text:`${e.transform(i??0,{from:"meter",to:a})} ${rr[a]}`,disabled:!o}))}},{type:"link",description:$localize`Manage how your wait times are calculated.`,page:{id:"wait-time-estimation",title:$localize`Wait time estimation`,component:_(xm)},suffix:()=>[qe(["waitEstimationMethod"],t=>sa(t)?en.INTELLIGENT:en.CLASSIC)]}]},{item:{type:"title",id:"customer-actions",title:$localize`Customer actions`,icon:"ww-actions",description:$localize`Manage what registered customers can do from their status page.`},items:[{type:"title",id:"show-public-status-arrived",description:$localize`Customers can let staff know that they have arrived. The “Arrived” label will be added to the visit.`,title:$localize`Allow customer to mark themselves as Arrived`,suffix:()=>[ae("showPublicStatusArrived")]},{type:"title",id:"show-public-status-delayed",description:$localize`Customers can let staff know that they are running late. The “Delayed” label will be added to the visit.`,title:$localize`Allow customer to mark themselves as Delayed`,suffix:()=>[ae("showPublicStatusDelayed")]},{type:"title",id:"waitlist-allow-confirm",description:$localize`Customers that have been notified can confirm their visit. The “Confirmed” label will be added to the visit.`,title:$localize`Allow alerted customer to confirm their visit`,suffix:()=>[ae("waitlistAllowConfirm")]},{type:"title",id:"allow-customers-to-leave-line",description:$localize`Customers are allowed to leave the waitlist.`,title:$localize`Allow customer to leave the line`,suffix:()=>[ae("hideCancelGuestPage",{transformer:{toPayload:t=>({hideCancelGuestPage:!t}),toView:({hideCancelGuestPage:t})=>!t}})]},{type:"title",id:"waitlist-convert-to-booking",description:$localize`Customers can convert their visit into a booking from the status page.`,title:$localize`Allow customer to convert their visit to a booking`,suffix:()=>[ae("showPublicConvertBooking")]},{type:"title",id:"show-status-page-edit-details-waitlist",description:$localize`Customers are allowed edit their details on their waitlist status page.`,title:$localize`Allow customers to edit their details`,suffix:()=>[ae("showStatusPageEditDetailsWaitlist")]}]},{item:{type:"title",id:"waitlist-display-settings",title:$localize`Display settings`,icon:"ww-display-settings-waitlist",description:$localize`Manage what information to display for your customers.`},items:[{type:"title",id:"show-ticket-style",description:rn([$localize`Show a modern, ticket-style view on the guest status page. Requires `,{type:"router-link",content:$localize`QR serve`,link:"/settings/arrival/qr-serve-booking"},$localize` to be enabled.`]),title:$localize`Show Ticket-style confirmation on mobile`,suffix:()=>{let t=c(v);return[_(hn,{properties:["showStatusPageTicketWaitlist"],featureEnabledConfig:{permissions:["locations.update"]},transformer:{toPayload:a=>({showStatusPageTicketWaitlist:a}),toView:a=>!!a.showStatusPageTicketWaitlist},$rx:{disabled:t.getCurrentLocation(["showPublicWaitlistStatusQR"]).pipe(p(a=>a.showPublicWaitlistStatusQR?null:{value:!0,reason:$localize`QR serve must be enabled for waitlist in order to enable the Ticket-style confirmation.`}))}})]}},{type:"title",id:"show-number-of-waiting-customers",description:$localize`Show the number of people waiting during registration.`,title:$localize`Show number of waiting customers`,suffix:()=>[ae("hideCheckinNumWaiting",{transformer:{toPayload:t=>({hideCheckinNumWaiting:!t}),toView:t=>!t.hideCheckinNumWaiting}})]},{type:"title",id:"show-estimated-wait",description:$localize`Show the current estimated wait time during registration.`,title:$localize`Show estimated wait`,suffix:()=>[ae("hideEstWaitCheckin",{transformer:{toPayload:t=>({hideEstWaitCheckin:!t}),toView:t=>!t.hideEstWaitCheckin}})]},{type:"title",id:"status-indicator-while-waiting",description:$localize`Select the type of status indicator to show customers while they are waiting.`,title:$localize`Status indicator while waiting`,suffix:()=>[Wo("guestPageProgressIndicatorType",{options:[{value:"BOTH",label:$localize`Estimated wait and order in line`},{value:"ORDER",label:$localize`Only order in line`},{value:"EST_WAIT",label:$localize`Only estimated wait`},{value:"HIDE",label:$localize`Hide both`}],transformer:{toPayload:t=>({guestPageProgressIndicatorType:t}),toView:t=>{let a=t.guestPageProgressIndicatorType;return a&&a.length>0?a:"BOTH"}}})]}]}]}},{type:"link",description:$localize`Create and manage which details to collect from your customers.`,enabledConfig:{somePermissions:["data-fields.create","data-fields.delete","data-fields.update"]},titleSuffix:()=>{let t=c(v),a=c(fi);return[ao({$rx:{enabled:A([t.getCurrentLocation(["showName","showPhone","showEmail","showPartySize","showCustomerId","showQuote","showNotes"]),a.collectionCountCurrentLocation(uc)]).pipe(p(([e,i])=>e.showName||e.showPhone||e.showEmail||e.showPartySize||e.showCustomerId||e.showQuote||e.showNotes||i>0),Re(!0))}})]},page:{id:"customer-details",title:$localize`Customer details`,options:{enabledConfig:{accountFeatures:["enableVisitE
51xternalValidation"]},page:{id:"customer-details-options",title:$localize`Customer details options`,component:J(()=>{let t="**************************";return{joi:{formGroup:new F({visitExternalValidation:new F({enabled:new C(!1,{nonNullable:!0}),url:new C("",{nonNullable:!0,validators:[re.required]}),dataFieldIds:new C([],{nonNullable:!0,validators:[re.required]}),auth:new F({tokenUrl:new C("",{nonNullable:!0}),clientId:new C("",{nonNullable:!0,validators:[re.required]}),clientSecret:new C("",{nonNullable:!0,validators:[re.required]}),customHeaders:new C(null),customParameters:new C(null)})})}),children:{visitExternalValidation:{labels:{enabled:$localize`External validation`,url:$localize`Endpoint URL`,dataFieldIds:$localize`Input fields`,auth:$localize`Authentication`},sublabels:{enabled:$localize`Validate input with an API, e.g., checking discount codes.`,url:$localize`Enter the API endpoint to validate against.`,dataFieldIds:$localize`Select which fields to validate. Only custom text fields and textareas are supported.`},placeholders:{url:"https://api.example.com/validate",dataFieldIds:$localize`Select input fields`},components:{enabled:_(Ap,{data:[!1,!0],pluckLabel:a=>a?$localize`Enable external validation`:$localize`No external validation`}),url:_(Fe,{prefixComponent:on({icon:"bx-link"})}),dataFieldIds:_(Cr,{selection:"multiple"})},children:{auth:{labels:{tokenUrl:$localize`Token URL`,clientId:$localize`Client ID`,clientSecret:$localize`Client secret`,customHeaders:$localize`Custom headers`,customParameters:$localize`Custom parameters`},sublabels:{tokenUrl:$localize`Enter the URL used to obtain the authentication token.`,clientId:$localize`Enter the Client ID used in the OAuth client credentials flow.`,clientSecret:$localize`Enter the Client secret used in the OAuth client credentials flow.`,customHeaders:$localize`Add up to 5 custom request headers to the authentication token request.`,customParameters:$localize`Add up to 5 custom query parameters to the authentication token request.`},placeholders:{tokenUrl:"https://api.example.com/token-url",clientId:"e.g. 12345-abcde-67890-fgh",clientSecret:"e.g. s3cr3tK3yXyz"},components:{tokenUrl:_(Fe,{prefixComponent:on({icon:"bx-link"})}),customHeaders:_(yo,{maxEntries:5}),customParameters:_(yo,{maxEntries:5})}}},dependencies:a=>{let e=a.pipe(p(i=>({hidden:!i.visitExternalValidation.enabled})));return{url:e,dataFieldIds:e,auth:e}}}}},transformer:{toView:a=>W(y({},a),{visitExternalValidation:W(y({},a.visitExternalValidation),{enabled:!!a.visitExternalValidation?.enabled,url:a.visitExternalValidation?.url??"",dataFieldIds:a.visitExternalValidation?.dataFieldIds??[],auth:W(y({},a.visitExternalValidation?.auth),{tokenUrl:a.visitExternalValidation?.auth?.tokenUrl??"",clientId:a.visitExternalValidation?.auth?.clientId??"",clientSecret:a.visitExternalValidation?.auth?.clientSecret?t:"",customHeaders:Object.entries(a.visitExternalValidation?.auth?.customHeaders??{}).reduce((e,[i,o])=>(e[i]=`${o}`,e),{}),customParameters:Object.entries(a.visitExternalValidation?.auth?.customParameters??{}).reduce((e,[i,o])=>(e[i]=`${o}`,e),{})})})}),toPayload:a=>{let e=a.visitExternalValidation,i=e?.auth;return{visitExternalValidation:W(y({},e),{auth:W(y({},i),{clientSecret:i.clientSecret===t?void 0:i.clientSecret,customHeaders:i.customHeaders??{},customParameters:i.customParameters??{}})})}}}}})}},keywords:[$localize`Input fields`,$localize`Name`,$localize`First name`,$localize`Last name`,$localize`Phone`,$localize`Email`,$localize`Party size`,$localize`Customer ID`,$localize`Quote wait`,$localize`Notes`],component:_(Vu)}},{type:"link",titleSuffix:_i(["isBookingActive","isPublicBooking","isWaitlistActive","isPublicCheckIn","allowSMSSignup","isGoogleWaitlist"],t=>!!t.isBookingActive&&!!t.isPublicBooking||!!t.isWaitlistActive&&!!t.isPublicCheckIn||!!t.allowSMSSignup||!!t.isGoogleWaitlist),description:$localize`Manage how your customers register.`,page:{
51id:"registration",title:$localize`Registration`,categories:[{item:{type:"link",icon:{name:"ww-settings-registration-app-clips",type:"illustration"},description:$localize`Give guests a smooth, native mobile experience when registering on an iOS device.`,enabledConfig:Pe({accountFeatures:["enableAppClips"],permissions:["locations.update"]}),page:{id:"app-clips-registration",title:ar,description:$localize`Let iOS users register via an ${ar} by scanning a QR code or tapping an NFC.`,component:_(Wp),keywords:["NFC"]}}},{item:{type:"link",icon:{name:"bx-walk",type:"icon"},description:$localize`Allow staff to instantly serve walk-in customers.`,enabledConfig:Pe({experiments:["quickServe"],permissions:["locations.update"]}),page:{id:"quick-serve",title:$localize`Quick Serve`,description:$localize`Allow staff to instantly serve walk-in customers. Staff will only be prompted for any information required specifically for Quick Serve.`,component:J(()=>{let t=c(fi),a=c($e),e=c(_a),i=c(Sa);return{joi:{formGroup:new F({quickVisitEnabled:new C(!1,{nonNullable:!0}),quickVisitRules:new F(ut()({requiredResourceCategoryIds:[[]],requireService:[!1],requiredServiceCategoryIds:[[]],requireCustomerId:[!1],requireEmail:[!1],requireName:[!1],requireNotes:[!1],requirePartySize:[!1],requirePhone:[!1],requireQuote:[!1],requiredDataFieldIds:[[]]}))}),labels:{quickVisitEnabled:$localize`Enabled`,quickVisitRules:$localize`Required fields`},components:{quickVisitEnabled:_(at,{label:$localize`Enabled`})},dependencies:o=>({quickVisitRules:o.pipe(p(n=>({hidden:!n.quickVisitEnabled})))}),groups:{quickVisitEnabled:{label:$localize`Quick Serve`,sublabel:$localize`Enables Quick Serve for staff.`,children:["quickVisitEnabled"]}},children:{quickVisitRules:{labels:{requireCustomerId:$localize`Customer ID`,requiredDataFieldIds:$localize`Required custom input fields`,requiredResourceCategoryIds:$localize`Required resource categories`,requiredServiceCategoryIds:$localize`Required service categories`,requireEmail:$localize`Email`,requireName:$localize`Name`,requireNotes:$localize`Notes`,requirePartySize:$localize`Party size`,requirePhone:$localize`Phone`,requireQuote:$localize`Quote`,requireService:$localize`Required`},sublabels:{requiredDataFieldIds:$localize`Select which custom input fields to require when quick serving a visit.`,requiredResourceCategoryIds:$localize`Select which resource categories to require when quick serving a visit.`,requiredServiceCategoryIds:$localize`Select which service categories to require when quick serving a visit.`},placeholders:{requiredDataFieldIds:$localize`Select custom input fields`,requiredResourceCategoryIds:$localize`Select resource categories`,requiredServiceCategoryIds:$localize`Select service categories`},groups:{requireService:{label:$localize`Require service`,sublabel:$localize`Select whether services are required when quick serving a visit.`,children:["requireService","requiredServiceCategoryIds"]},quickVisitRules:{label:$localize`Required default input fields`,sublabel:$localize`Select which default input fields to require when quick serving a visit.`,children:["requireCustomerId","requireEmail","requireName","requireNotes","requirePartySize","requirePhone","requireQuote"]}},components:{requiredDataFieldIds:_(Cr,{selection:"multiple"}),requiredResourceCategoryIds:_(Bp,{selection:"multiple"}),requiredServiceCategoryIds:_($r,{selection:"multiple"})},dependencies:o=>({requireCustomerId:a.currentLocationSnapshot$.pipe(p(n=>({hidden:!n?.showCustomerId}))),requireEmail:a.currentLocationSnapshot$.pipe(p(n=>({hidden:!n?.showEmail}))),requireName:a.currentLocationSnapshot$.pipe(p(n=>({hidden:!n?.showName}))),requireNotes:a.currentLocationSnapshot$.pipe(p(n=>({hidden:!n?.showNotes}))),requirePartySize:a.currentLocationSnapshot$.pipe(p(n=>({hidden:!n?.showPartySize}))),requirePhone:a.currentLocationSnapshot$.pipe(p(n=>({hidden:!n?.showPhone}))),requireQuote:a.currentLocationSnapshot$.pipe(p(n=>({hidden:!n?.showQuote}))),requireService:i.currentLocationHasServices$.pipe(p(n=>({hidden:!n}))),requiredDataFieldIds:t.currentLocationHasDataFields$.pipe(p(n=>({hidden:!n}))),requiredResourceCategoryIds:e.currentLocationHasResources$.pipe(p(n=>({hidden:!n}))),requiredServiceCategoryIds:A([o,i.currentLocationHasServices$]).pipe(p(([n,u])=>({hidden:!n?.quickVisitRules?.requireService||!u})))})}}},transformer:{toView:o=>({quickVisitEnabled:!!o.quickVisitRules?.enabled,quickVisitRules:{enabled:!!o.quickVisitRules?.enabled,requireCustomerId:!!o.quickVisitRules?.requireCustomerId,requiredDataFieldIds:o.quickVisitRules?.requiredDataFieldIds??[],requireEmail:!!o.quickVisitRules?.requireEmail,requireName:!!o.quickVisitRules?.requireName,requireNotes:!!o.quickVisitRules?.requireNotes,requirePartySize:!!o.quickVisitRules?.requirePartySize,requirePhone:!!o.quickVisitRules?.requirePhone,requireQuote:!!o.quickVisitRules?.requireQuote,requiredResourceCategoryIds:o.quickVisitRules?.requiredResourceCategoryIds??[],requiredServiceCategoryIds:o.quickVisitRules?.requiredServiceCategoryIds??[],requireService:!!o.quickVisitRules?.requireService}}),toPayload:o=>({quickVisitRules:y({enabled:o.quickVisitEnabled},o.quickVisitRules)})}}})}}},{item:{type:"title",id:"public-registration",title:$localize`Public registration`,titleSuffix:_i(["isBookingActive","
51isPublicBooking","isWaitlistActive","isPublicCheckIn"],t=>!!t.isBookingActive&&!!t.isPublicBooking||!!t.isWaitlistActive&&!!t.isPublicCheckIn),icon:"ww-public-pages",description:$localize`Let customers register in multiple ways using our public registration pages.`},items:[{type:"link",titleSuffix:()=>_(fn,{$rx:{link:c(Me).publicRegistrationUrl$}}),description:$localize`Let customers register through a URL on their own device.`,grid:!0,icon:{name:"ww-settings-registration-web",type:"illustration"},page:{id:"web",title:$localize`Web`,description:$localize`Let customers register through a URL on their own device.`,component:()=>[_($p,{label:$localize`Registration URL`,sublabel:$localize`Your location's primary registration URL where your customers make bookings and/or join your waitlist.`,components:[_(Ci,{label:$localize`General registration`,withQrCode:!0,$rx:{value:c(Me).publicRegistrationUrl$,qrCodeValue:c(Me).publicRegistrationQrUrl$}}),_(Ci,{label:$localize`Waitlist only registration`,withQrCode:!0,$rx:{value:c(Me).publicRegistrationUrlWaitlist$,qrCodeValue:c(Me).publicRegistrationQrUrlWaitlist$}}),_(Ci,{label:$localize`Booking only registration`,withQrCode:!0,$rx:{value:c(Me).publicRegistrationUrlBooking$,qrCodeValue:c(Me).publicRegistrationQrUrlBooking$}})]}),J(()=>{let t=c(Ue),a=c(ht);return{joi:{formGroup:new F(Z({publicBookingRedirectLink:[],publicWaitlistRedirectLink:[],isPublicSearch:[],isPublicIndexed:[]})),labels:{publicBookingRedirectLink:$localize`Booking redirect link`,publicWaitlistRedirectLink:$localize`Waitlist redirect link`,isPublicSearch:$localize`Discoverable on waitwhile.com`,isPublicIndexed:$localize`Discoverable for search engines`},sublabels:{publicBookingRedirectLink:$localize`If you want to redirect your customer to another page upon completing a booking.`,publicWaitlistRedirectLink:$localize`If you want to redirect your customer to another page upon registering for the waitlist. Note that they then won't be taken to the status page where they can follow a live update of their position in line.`},placeholders:{publicBookingRedirectLink:$localize`e.g. https://business.com/booking-redirect-link`,publicWaitlistRedirectLink:$localize`e.g. https://business.com/waitlist-redirect-link`},groups:{discoverability:{children:["isPublicSearch","isPublicIndexed"],label:$localize`Discoverability`,sublabel:$localize`Choose if your registration link should be publicly discoverable on Waitwhile.com and/or in search engines.`}},components:{isPublicIndexed:a.displayAccountFeatureLabel(_(at,{label:$localize`Discoverable for search engines`}),["enablePublicIndexed"]),isPublicSearch:a.displayAccountFeatureLabel(_(at,{label:$localize`Discoverable on waitwhile.com`}),["enablePublicSearch"])},dependencies:()=>
51({isPublicIndexed:t.hasAccountFeature("enablePublicIndexed").pipe(p(e=>({disabled:!e}))),isPublicSearch:t.hasAccountFeature("enablePublicSearch").pipe(p(e=>({disabled:!e})))})},transformer:{toView:e=>({publicBookingRedirectLink:e.publicBookingRedirectLink??null,publicWaitlistRedirectLink:e.publicWaitlistRedirectLink??null,isPublicIndexed:e.isPublicIndexed??!1,isPublicSearch:e.isPublicSearch??!1}),toPayload:e=>({publicBookingRedirectLink:e.publicBookingRedirectLink,publicWaitlistRedirectLink:e.publicWaitlistRedirectLink,isPublicIndexed:e.isPublicIndexed,isPublicSearch:e.isPublicSearch})}}})]}},{type:"link",titleSuffix:()=>_(fn,{$rx:{link:c(Me).publicRegistrationKioskUrl$}}),description:$localize`Let customers register from your in-store kiosk.`,grid:!0,icon:{name:"ww-settings-registration-kiosk",type:"illustration"},page:{id:"kiosk",title:$localize`Kiosk`,description:$localize`Let customers register from your in-store kiosk.`,component:()=>[_(Ma,{label:$localize`Learn more`,content:_(bt,{content:$localize`Learn how to create a check-in kiosk.`,href:"https://help.waitwhile.com/en/articles/10067604-how-to-configure-waitwhile-on-a-kiosk"})}),_(Ci,{label:$localize`Registration URL`,sublabel:$localize`The registration URL used for your kiosk.`,$rx:{value:c(Me).publicRegistrationKioskUrl$}}),J(()=>({joi:{formGroup:new F(Z({showPublicKioskRegistrationQR:[],publicPageResetTime:[],publicConfirmationResetTime:[]})),labels:{showPublicKioskRegistrationQR:$localize`Show QR code`,publicPageResetTime:$localize`Idle refresh time`,publicConfirmationResetTime:$localize`Confirmation refresh time`},sublabels:{publicPageResetTime:$localize`The time it takes before the kiosk automatically refreshes when no one has used it.`,publicConfirmationResetTime:$localize`The time it takes before the kiosk redirects to the start page after displaying the confirmation page.`},groups:{showQrCode:{children:["showPublicKioskRegistrationQR"],label:$localize`QR code`,sublabel:$localize`Display a QR code so that customers can continue on their phone.`}},components:{publicPageResetTime:_(Mt),publicConfirmationResetTime:_(Mt)}},transformer:{toView:t=>({publicPageResetTime:t.publicPageResetTime,publicConfirmationResetTime:t.publicConfirmationResetTime,showPublicKioskRegistrationQR:t.showPublicKioskRegistrationQR??!1}),toPayload:t=>({publicPageResetTime:t.publicPageResetTime,publicConfirmationResetTime:t.publicConfirmationResetTime,showPublicKioskRegistrationQR:t.showPublicKioskRegistrationQR??!1})}}))]}},{type:"link",description:$localize`Print one of our QR code templates and let customers scan to register.`,grid:!0,icon:{name:"ww-settings-registration-qr-code",type:"illustration"},page:{id:"qr-code",title:$localize`QR code`,description:$localize`Print one of our QR code templates and let customers scan to register.`,component:_(Nm)}},{type:"link",description:$localize`Use embed to let customers join directly from your website.`,grid:!0,icon:{name:"ww-settings-registration-embed",type:"illustration"},page:{id:"embed",title:$localize`Embed`,component:_(fm)}},{type:"title",id:"registration-types-allowed",title:$localize`Registration types allowed`,description:$localize`Choose what type of registration is publicly allowed.`,suffix:()=>{let t=c(v);return[Wo(["isBookingActive","isWaitlistActive","isPublicBooking","isPublicCheckIn"],{$rx:{options:t.getCurrentLocation(["isBookingActive","isWaitlistActive","isPublicBooking","isPublicCheckIn"]).pipe(p(({isBookingActive:a,isWaitlistActive:e})=>{let i=[];return a&&i.push({value:"BOOKING",label:$localize`Only bookings`}),e&&i.push({value:"WAITLIST",label:$localize`Only waitlist`}),e&&a&&i.push({value:"BOTH",label:$localize`Bookings and waitlist`}),i.push({value:"NONE",label:$localize`None`}),i}))},transformer:{toPayload:a=>({isPublicBooking:a==="BOTH"||a==="BOOKING",isPublicCheckIn:a==="BOTH"||a==="WAITLIST"}),toView:({isBookingActive:a,isPublicBooking:e,isWaitlistActive:i,isPublicCheckIn:o})=>a&&e&&i&&o?"BOTH":a&&e?"BOOKING":i&&o?"WAITLIST":"NONE"}})]}},{type:"link",description:$localize`Assign ticket IDs to customer visits.`,page:{
51id:"customer-ticket-id",title:$localize`Customer ticket ID`,keywords:[],component:J(()=>{let t=c(v),a={OFF:$localize`Disabled`,STATIC:$localize`Default ticket ID`,SERVICE:$localize`Ticket ID by service`},e={OFF:null,STATIC:$localize`A general ticket ID will be generated. i.e. A001`,SERVICE:$localize`The first letter of the service name will be used as the ticket prefix. i.e. "Tailoring" will have T001. "Repair" will have R001`};return{joi:{formGroup:new F({ticketPrefixMode:new C("OFF",{nonNullable:!0}),ticketPrefix:new C(null,{validators:[gt.alphanumeric,re.maxLength(3)]})}),labels:{ticketPrefixMode:$localize`Configuration`,ticketPrefix:$localize`Ticket prefix`},sublabels:{ticketPrefixMode:$localize`Choose between a generic ticket ID and a specific one per service. Separating by service will give your customers the impression that they are in different lines.`,ticketPrefix:$localize`The prefix used for the ticket ID. i.e. ABC.`},components:{ticketPrefixMode:_(xe,{align:"top",data:ll,pluckLabel:i=>a[i],pluckSublabel:i=>e[i]})},dependencies:i=>({ticketPrefix:i.pipe(p(o=>({hidden:o.ticketPrefixMode!=="STATIC"})))})},transformer:{toView:({showWaitlistTicket:i,ticketPrefixMode:o,ticketPrefix:n})=>i?{ticketPrefixMode:o==="SERVICE"?"SERVICE":"STATIC",ticketPrefix:n??null}:{ticketPrefixMode:"OFF",ticketPrefix:n??null},toPayload:i=>{let o=t.nullableLocation;switch(i.ticketPrefixMode){case"SERVICE":return{showWaitlistTicket:!0,ticketPrefix:i.ticketPrefix??void 0,ticketPrefixMode:"SERVICE"};case"STATIC":return{showWaitlistTicket:!0,ticketPrefix:i.ticketPrefix??void 0,ticketPrefixMode:"STATIC"};default:return{showWaitlistTicket:!1,ticketPrefix:i.ticketPrefix??void 0,ticketPrefixMode:"STATIC",showStatusPageTicketWaitlist:o?.showPublicWaitlistStatusQR}}}}}})},suffix:()=>qe(["showWaitlistTicket","ticketPrefixMode"],({showWaitlistTicket:t,ticketPrefixMode:a})=>({text:t?a==="SERVICE"?$localize`By service`:$localize`Default`:$localize`Disabled`,disabled:!1}))},{type:"title",id:"public-registration-header-content",title:$localize`Header content`,description:$localize`Choose what you want to display in the header of your registration pages.`,suffix:()=>{let t=c(v);return[Wo("publicRegistrationHeaderContent",{$rx:{options:t.getCurrentLocation(["logoUrl"]).pipe(p(({logoUrl:a})=>{let e=[{value:"NONE",label:$localize`None`},{value:"ACCOUNT_NAME",label:$localize`Account display name`},{value:"LOCATION_NAME",label:$localize`Location display name`}];return a&&e.push({value:"LOCATION_LOGO",label:$localize`Location icon`}),e}))}})]}},{type:"title",id:"show-welcome-page",title:$localize`Show Welcome page`,description:$localize`Let customers land on a welcome page before registering.`,suffix:()=>[ae(["showCheckInWelcome","showPublicRegistrationModeSelector"],{transformer:{toPayload:t=>({showCheckInWelcome:t,isPublicSignin:t?void 0:!1,showPublicRegistrationModeSelector:t?void 0:!1}),toView:t=>!!t.showCheckInWelcome||!!t.showPublicRegistrationModeSelector},confirmation:(t,a)=>t.showCheckInWelcome===!1&&a.isPublicSignin===!0&&t.isPublicSignin===!1?{title:$localize`Arrival from the registration flow will also be disabled`,message:$localize`Customers will not be able register their arrival from the registration flow if you disable the Welcome page. Are you sure you want to continue?`}:null})]},{type:"title",id:"show-public-registration-mode-selector",title:$localize`Show waitlist and bookings separated`,description:$localize`Display a separate "Join waitlist" and "Schedule booking" option on your Welcome page instead of a combined registration flow. When this is enabled, "Show Welcome page" will also be enabled.`,suffix:()=>[ae("showPublicRegistrationModeSelector")]},{type:"title",id:"allow-public-account-signup",title:$localize`Show in Location directory`,keywords:[$localize`All locations`],description:$localize`Let customers see this location in the Location directory.`,suffix:()=>[ae("allowPublicAccountSignup")]},{type:"title",id:"show-branding",title:$localize`Hide Waitwhile branding`,description:$localize`Hide Waitwhile branding on your public registration pages and in your customer messages.`,suffix:()=>[ae("showBranding",{transformer:{toPayload:t=>({showBranding:!t}),toView:t=>!t.showBranding}}
51)],enabledConfig:Pe({accountFeatures:["enableWhiteLabeling"],permissions:["locations.update"]})},{type:"title",id:"captcha-bot-protection",title:$localize`Captcha bot protection`,description:$localize`Protect yourself from bots using a Captcha test with a select sensitivity.`,suffix:()=>{let t=[{value:-1,label:$localize`Disabled`},{value:.1,label:$localize`Very low sensitivity (default)`},{value:.3,label:$localize`Low sensitivity`},{value:.5,label:$localize`Medium sensitivity`},{value:.7,label:$localize`High sensitivity`},{value:.9,label:$localize`Very high sensitivity`}];return[Wo(["recaptchaMinScore"],{options:t,transformer:{toPayload:a=>({recaptchaMinScore:a}),toView:({recaptchaMinScore:a})=>a==null?_r:t.find(i=>i.value===a)?a:_r}})]}}]},{item:{type:"link",icon:{name:"ww-settings-registration-sms",type:"illustration"},description:$localize`Let customers register instantly by sending an SMS.`,enabledConfig:Pe({accountFeatures:["enableProvisionMessaging","enableSmsSignup"],permissions:["locations.update"],isSessionSupported:({location:t})=>t?.smsProviderActive&&nt(t?.smsProviderNumbers).length>0?!0:{type:"requires-config",message:$localize`SMS registration requires a dedicated phone number.`,link:{label:$localize`Contact support`,api:e=>e.get(Wi).show()}}}),page:{id:"sms-registration",title:$localize`SMS registration`,keywords:["allowSMSSignup"],tabs:[{id:"general",title:$localize`General`,enabledConfig:Pe({accountFeatures:["enableProvisionMessaging","enableSmsSignup"],permissions:["locations.update"]}),component:J(()=>{let t=c(v),a=c(un),e=c(Ae);return{joi:{formGroup:new F(y({allowSMSSignup:new C(!1,{nonNullable:!0}),triggerWords:new C([],{nonNullable:!0})},Z({smsSignupAction:[],smsSignupText:[]}))),labels:{allowSMSSignup:$localize`Allow SMS registration`,triggerWords:$localize`Keywords to join waitlist`,smsSignupAction:$localize`Action`,smsSignupText:$localize`Message text`},sublabels:{triggerWords:$localize`Define which trigger words customers can text to join the waitlist. Any word following the trigger will be used as their name for the visit.`,smsSignupAction:$localize`Control whether customers are added right away or asked to complete their registration online.`,smsSignupText:$localize`Configure the reply message customers will receive with the registration link.`},placeholders:{triggerWords:$localize`Add keywords`},groups:{enable:{children:["allowSMSSignup"],label:$localize`Enable SMS registration`,sublabel:$localize`Customers can send a text message to join your waitlist instantly.`}},hints:{allowSMSSignup:nn({$rx:{content:t.getCurrentLocation(["smsProviderNumbers"]).pipe(p(i=>Et({$element:{classList:["flex","flex-col","gap-1"]},components:[an({content:$localize`The dedicated number for this location is: **${i.smsProviderNumbers?.[0]??"Unknown"}**`}),Et({components:[$localize`Read more about`,_(Cp,{articleId:12674270,href:sc,content:$localize`SMS registration here`})]})]})))}})},components:{triggerWords:_(ri,{uppercase:!0,separatorKeyCodes:[188,13,32],hint:_(bt,{type:"button",content:$localize`View default triggers`,$element:{eventListeners:{click:i=>{i.preventDefault(),e.open(_(Em),{size:"auto"})}}}})}),smsSignupAction:_(xe,{data:Be()(["ADD_TO_WAITLIST","SEND_MESSAGE"]),pluckLabel:i=>i==="ADD_TO_WAITLIST"?$localize`Add customer directly to waitlist`:$localize`Send message with link to online registration`}),smsSignupText:_(dn,{editor:mn,defaultValue:$localize`Welcome to {{ location.displayName }}! To register, please visit {{ welcomeLink }}`,$rx:{completion:a.liquidCompletion$,stringify:a.stringifyLiquidCode$,variableMenuItems:a.createNewVariableItems$}})},dependencies:i=>({smsSignupText:i.pipe(p(o=>({disabled:o.smsSignupAction!=="SEND_MESSAGE"})))})},transformer:{toView:i=>{let o=i.signUpTriggers?.[0];return{allowSMSSignup:i.allowSMSSignup??!1,triggerWords:o?.words??be.JOIN.words,smsSignupAction:i.smsSignupAction??"ADD_TO_WAITLIST",smsSignupText:i.smsSignupText}},toPayload:i=>{let n=c($e).nullableLocation?.signUpTriggers?.[0];return{allowSMSSignup:i.allowSMSSignup,signUpTriggers:[W(y({},n),{words:i.triggerWords})],smsSignupAction:i.smsSignupAction,smsSignupText:i.smsSignupText}}}}})},{id:"custom-triggers",title:$localize`Custom triggers`,enabledConfig:Pe({accountFeatures:["enableCustomReplyTriggers","enableProvisionMessaging","enableSmsSignup"],permissions:["locations.update"]}),component:[Li({content:$localize`These are our default SMS triggers. Customers can send a chat or SMS message with a trigger word to automatically update their visit.`,$element:{classList:["flex","max-w-2xl","pb-12"],backgroundColor:"white"}}),J(()=>
51({joi:{formGroup:new F({cancel:new C([],{nonNullable:!0}),confirm:new C([],{nonNullable:!0}),arrived:new C([],{nonNullable:!0}),delayed:new C([],{nonNullable:!0}),block:new C([],{nonNullable:!0}),unblock:new C([],{nonNullable:!0})}),labels:{cancel:be.CANCELLED.action,confirm:be.CONFIRMED.action,arrived:be.ARRIVED.action,delayed:be.DELAYED.action,block:be.BLOCK.action,unblock:be.UNBLOCK.action},sublabels:{cancel:be.CANCELLED.description,confirm:be.CONFIRMED.description,arrived:be.ARRIVED.description,delayed:be.DELAYED.description,block:be.BLOCK.description,unblock:be.UNBLOCK.description},placeholders:{cancel:$localize`Add keywords`,confirm:$localize`Add keywords`,arrived:$localize`Add keywords`,delayed:$localize`Add keywords`},components:{cancel:_(ri,{uppercase:!0,separatorKeyCodes:[188,13,32],pluckReadonly:t=>be.CANCELLED.words.includes(t)}),confirm:_(ri,{uppercase:!0,separatorKeyCodes:[188,13,32],pluckReadonly:t=>be.CONFIRMED.words.includes(t)}),arrived:_(ri,{uppercase:!0,separatorKeyCodes:[188,13,32],pluckReadonly:t=>be.ARRIVED.words.includes(t)}),delayed:_(ri,{uppercase:!0,separatorKeyCodes:[188,13,32],pluckReadonly:t=>be.DELAYED.words.includes(t)}
51),block:_(ri,{uppercase:!0,separatorKeyCodes:[188,13,32],pluckReadonly:()=>!0,readonly:!0}),unblock:_(ri,{uppercase:!0,separatorKeyCodes:[188,13,32],pluckReadonly:()=>!0,readonly:!0})}},transformer:{toView:t=>{let a=(e,i)=>{let o=t.replyTriggers?.find(n=>n.type===e)?.words??[];return[...i.words,...o]};return{cancel:a(wn.CANCELLED,be.CANCELLED),confirm:a(wn.CONFIRMED,be.CONFIRMED),arrived:a(wn.ARRIVED,be.ARRIVED),delayed:a(wn.DELAYED,be.DELAYED),block:be.BLOCK.words,unblock:be.UNBLOCK.words}},toPayload:t=>{let a=(i,o,n)=>({type:i,words:n.filter(u=>!o.words.includes(u))});return{replyTriggers:[a("CANCELLED",be.CANCELLED,t.cancel),a("CONFIRMED",be.CONFIRMED,t.confirm),a("ARRIVED",be.ARRIVED,t.confirm),a("DELAYED",be.DELAYED,t.confirm)]}}}}))]},{id:"service-triggers",title:$localize`Service triggers`,enabledConfig:Pe({accountFeatures:["enableCustomReplyTriggers","enableProvisionMessaging","enableSmsSignup"],permissions:["locations.update"]}),component:_(ts,{triggerType:"SERVICES"})},{id:"resource-triggers",title:$localize`Resource triggers`,enabledConfig:Pe({accountFeatures:["enableCustomReplyTriggers","enableProvisionMessaging","enableSmsSignup"],permissions:["locations.update"]}),component:_(ts,{triggerType:"RESOURCES"})}]},suffix:()=>[qe(["address","allowSMSSignup","smsProviderActive","smsProviderNumbers"],({address:t,allowSMSSignup:a,smsProviderActive:e,smsProviderNumbers:i})=>{let o=(t?.country?.code==="US"||t?.country?.code==="CA")&&e&&nt(i).length>0,n=a&&o;return{text:n?$localize`On`:$localize`Off`,disabled:!n}})]}},{item:{type:"title",id:"google-maps",icon:{name:"ww-settings-registration-google-maps",type:"illustration"},title:$localize`Google Maps`,titleSuffix:_i("isGoogleWaitlist"),description:$localize`Allow customers to register on Google Search and Google Maps.`,tooltip:Et({$element:{classList:["!inline"]},components:[Li({$element:{classList:["inline","mr-1"]},content:$localize`This is only available for restaurants and cafes.`}),_(bt,{href:"https://help.waitwhile.com/en/articles/6310878-how-to-add-your-waitlist-to-google-maps",content:$localize`Learn more`,inline:!0,type:"internal-in-new-tab",$element:{color:"white"}})]}),suffix:()=>[ae("isGoogleWaitlist")],enabledConfig:Pe({permissions:["locations.update"],isSessionSupported:({account:t})=>t?.businessType==="RESTAURANT"||t?.businessType==="CAFE"?!0:{type:"requires-config",link:{label:$localize`Update business type`,routerLink:"/account/settings/business-info"},message:$localize`This feature is only available for restaurant or cafe business types.`}})}}]}},{type:"link",titleSuffix:_i("isPublicArrival"),description:$localize`Manage your customers once they have arrived.`,page:{id:"arrival",title:$localize`Arrival`,keywords:[$localize`Check-in`,$localize`Checkin`],categories:[{item:{type:"title",id:"is-public-arrival",icon:"ww-arrivals",title:$localize`Customer arrival`,titleSuffix:_i("isPublicArrival"),description:$localize`Let customers check themselves in. They will automatically receive the Arrived tag.`,suffix:ae("isPublicArrival")},items:[{type:"link",titleSuffix:()=>_(fn,{$rx:{link:c(Me).checkInWebUrl$}}),grid:!0,icon:{name:"ww-settings-checkin-web",type:"illustration"},description:$localize`Let customers register their arrival through a URL on their own device.`,page:{
51id:"web",title:$localize`Web`,component:()=>[_(Ci,{label:$localize`Check in URL`,withQrCode:!0,$rx:{value:c(Me).checkInWebUrl$,qrCodeValue:c(Me).checkInQrUrl$}})]}},{type:"link",titleSuffix:()=>_(fn,{$rx:{link:c(Me).checkInKioskUrl$}}),grid:!0,icon:{name:"ww-settings-checkin-kiosk",type:"illustration"},description:$localize`Let customers register their arrival from your in-store kiosk.`,page:{id:"kiosk",title:$localize`Kiosk`,component:()=>[_(Ma,{label:$localize`Learn more`,content:_(bt,{content:$localize`Learn how to Display your Waitlist on a TV monitor.`,href:"https://help.waitwhile.com/en/articles/833088-how-to-display-your-waitlist-on-a-tv-monitor"})}),_(Ci,{label:$localize`Check in kiosk URL`,withQrCode:!0,$rx:{value:c(Me).checkInKioskUrl$,qrCodeValue:c(Me).checkInKioskQrUrl$}})]}},{type:"title",id:"is-public-signin",title:$localize`Allow arrivals from your registration flow`,description:$localize`Include a check-in button on the first page of your public registration flow.`,suffix:()=>[ae("isPublicSignin")],enabledConfig:Pe({isSessionSupported:({location:t})=>t?.showCheckInWelcome?!0:{type:"requires-config",message:$localize`Welcome page must be enabled to allow arrivals from your registration flow.`,link:{label:$localize`Enable the Welcome page here`,routerLink:"/settings/registration"}}})}]},{item:{type:"link",grid:!0,icon:{name:"ww-settings-checkin-qr-serve",type:"illustration"},titleSuffix:_i(["showPublicBookingStatusQR","showPublicWaitlistStatusQR"],t=>!!t.showPublicBookingStatusQR||!!t.showPublicWaitlistStatusQR),description:$localize`Let staff add customers to the Serving state by scanning a QR code on their status page.`,page:{id:"qr-serve-booking",title:$localize`QR Serve`,component:J(()=>({joi:{formGroup:new F(Z({showPublicBookingStatusQR:[],showPublicWaitlistStatusQR:[],visitQrCodeAction:[],qrServeWaitlistMaxPosition:[],qrServeBookingPreDurationLimit:[],qrServeBookingPostDurationLimit:[]})),labels:{showPublicBookingStatusQR:$localize`Enabled for bookings`,showPublicWaitlistStatusQR:$localize`Enabled for waitlist`,visitQrCodeAction:$localize`Action when scanning`,qrServeWaitlistMaxPosition:$localize`Max allowed position in line to be served`,qrServeBookingPreDurationLimit:$localize`Max time before booking has started`,qrServeBookingPostDurationLimit:$localize`Max time after booking has started`},sublabels:{visitQrCodeAction:$localize`Choose what action should be taken when scanning the customers' QR code.`,qrServeWaitlistMaxPosition:$localize`If a customer has a higher position in line, they won't be able to be served.`,qrServeBookingPreDurationLimit:$localize`A customer can't be served earlier than this.`,qrServeBookingPostDurationLimit:$localize`A customer can't be served later than this.`},groups:{enable:{children:["showPublicBookingStatusQR","showPublicWaitlistStatusQR"],label:$localize`Enable QR serve`,sublabel:$localize`Toggle to enable or disable serving the customer when staff scans their status page QR code.`}},placeholders:{qrServeWaitlistMaxPosition:$localize`e.g. 5`},components:{qrServeBookingPreDurationLimit:_(Mt),qrServeBookingPostDurationLimit:_(Mt)},componentModifiers:{visitQrCodeAction:t=>_(t,{data:["SHOW-APP","SERVE-APP"]})},locale:{"SHOW-APP":$localize`Open in staff experience`,"SERVE-APP":$localize`Serve in staff experience`},dependencies:t=>{let a=t.pipe(p(e=>e.visitQrCodeAction==="SERVE-APP"));return{qrServeWaitlistMaxPosition:a.pipe(p(e=>({disabled:!e}))),qrServeBookingPreDurationLimit:a.pipe(p(e=>({disabled:!e}))),qrServeBookingPostDurationLimit:a.pipe(p(e=>({disabled:!e})))}}},transformer:{toView:({showPublicBookingStatusQR:t,showPublicWaitlistStatusQR:a,visitQrCodeAction:e,qrServeWaitlistMaxPosition:i,qrServeBookingPreDurationLimit:o,qrServeBookingPostDurationLimit:n})=>({showPublicBookingStatusQR:t,showPublicWaitlistStatusQR:a,visitQrCodeAction:e,qrServeWaitlistMaxPosition:i,qrServeBookingPreDurationLimit:o,qrServeBookingPostDurationLimit:n}),toPayload:t=>{let a=y({},t);return t.showPublicBookingStatusQR===!1&&(a.showStatusPageTicketBooking=!1),t.showPublicWaitlistStatusQR===!1&&(a.showStatusPageTicketWaitlist=!1),a}},confirmation:(t,a)=>{let e=t.showPublicBookingStatusQR===!1&&a.showPublicBookingStatusQR&&a.showStatusPageTicketBooking,i=t.showPublicWaitlistStatusQR===!1&&a.showPublicWaitlistStatusQR&&a.showStatusPageTicketWaitlist,o;if(e&&i)o=$localize`Disabling QR serve for bookings and waitlist will also disable the Ticket-style confirmation on mobile for both. Are you sure you want to proceed?`;else if(e||i){let n=e?$localize`bookings`:$localize`waitlist`;o=$localize`Disabling QR serve for ${n} will also disable the Ticket-style confirmation on mobile for ${n}. Are you sure you want to proceed?`}
51return o?{title:$localize`Disable QR serve?`,message:o,confirmLabel:$localize`Disable`,cancelLabel:$localize`Cancel`}:null}}))}}},{item:{type:"link",icon:{name:"ww-settings-capacity-management",type:"illustration"},description:$localize`Track your occupancy and restrict how many customers can be served at once.`,titleSuffix:()=>{let t=c(v);return ao({$rx:{enabled:t.getCurrentLocation(["maxServingActive","isMaxCapacityActive"]).pipe(p(a=>a.maxServingActive||a.isMaxCapacityActive))}})},enabledConfig:{accountFeatures:["enableCapacityManagement"],permissions:["locations.update"]},page:{id:"capacity-management",title:$localize`Capacity management`,component:J(()=>{let t=c(v);return{joi:{formGroup:new F({isMaxCapacityActive:new C(null),maxServing:new C(null),openWaitlistOnlyAtMaxCapacity:new C(null)}),labels:{isMaxCapacityActive:$localize`Show`,maxServing:$localize`Capacity limit`,openWaitlistOnlyAtMaxCapacity:$localize`Enable waitlist only when serve capacity is full`},sublabels:{maxServing:$localize`Maximum number of people allowed to be served.`,openWaitlistOnlyAtMaxCapacity:$localize`Only enable the waitlist when Capacity management is enabled and max capacity has been reached.`},groups:{isMaxCapacityActive:{children:["isMaxCapacityActive"],label:$localize`Capacity tracker`,sublabel:$localize`Allows you to instantly add and remove serving visits by pressing plus and minus. A virtual capacity tracker.`}},placeholders:{maxServing:$localize`e.g. 100`},dependencies:a=>({openWaitlistOnlyAtMaxCapacity:A([a,t.getCurrentLocation(["isWaitlistActive"])]).pipe(p(([e,i])=>({hidden:!i.isWaitlistActive||!e.maxServing})))})},transformer:{toView:({isMaxCapacityActive:a,maxServingActive:e,maxServing:i,openWaitlistOnlyAtMaxCapacity:o})=>({isMaxCapacityActive:a??null,maxServing:e?i:null,openWaitlistOnlyAtMaxCapacity:o??null}),toPayload:({isMaxCapacityActive:a,maxServing:e,openWaitlistOnlyAtMaxCapacity:i})=>({isMaxCapacityActive:a??!1,maxServing:e||0,maxServingActive:!!e,openWaitlistOnlyAtMaxCapacity:i??!1})}}})}}}]}},{type:"link",titleSuffix:_i("isPublicWaitlist"),description:$localize`Let customers see the current waitlist on a monitor or in their browser.`,page:{id:"public-displays",title:$localize`Public displays`,keywords:[$localize`TV screen`,$localize`Monitor`],component:()=>[_(Ma,{label:$localize`Learn more`,content:_(bt,{content:$localize`Learn how to display your lists on a TV monitor`,href:"https://help.waitwhile.com/en/articles/9970194-how-to-display-your-waitlist-on-a-tv-monitor"})}),_(Ci,{label:$localize`Waitlist display URL`,sublabel:$localize`The public URL where customers can view and join the waitlist.`,withQrCode:!0,$rx:{value:c(Me).waitlistOverviewUrl$,qrCodeValue:c(Me).waitlistOverviewQrUrl$}}),_(Ci,{label:$localize`Serving display URL`,sublabel:$localize`The public URL where customers can view who is being served.`,withQrCode:!0,$rx:{value:c(Me).servingOverviewUrl$,qrCodeValue:c(Me).servingOverviewQrUrl$}}),J(()=>{let t=c(v);return{joi:{formGroup:new F(Z({isPublicWaitlist:[],showPublicNameAs:[],showPublicWaitlistResources:[],showPublicWaitlistServices:[],showPublicWaitlistPartySize:[],showGuestFieldsPublic:[],hideWaitTimePublic:[],showPublicGuestEstWaitTime:[],hidePartiesPublic:[],hideEstWaitCheckin:[],showPublicWaitlistJoinButton:[],allowPublicAccountView:[],playSoundPublicWaitlistGuestAlerted:[]})),labels:{isPublicWaitlist:$localize`Enable`,showPublicNameAs:$localize`Customer identifier`,showPublicWaitlistResources:$localize`Show selected resources`,showPublicWaitlistServices:$localize`Show selected services`,showPublicWaitlistPartySize:$localize`Show party size`,showGuestFieldsPublic:$localize`Show custom input field values`,hideWaitTimePublic:$localize`Show time waited`,showPublicGuestEstWaitTime:$localize`Show estimated wait time`,hidePartiesPublic:$localize`Show total number of people waiting`,hideEstWaitCheckin:$localize`Show current estimated wait time`,showPublicWaitlistJoinButton:$localize`Show "Join waitlist" button`,allowPublicAccountView:$localize`Include in Waitlist overview`,playSoundPublicWaitlistGuestAlerted:$localize`Play sound when alerted`},sublabels:{showPublicNameAs:$localize`Select how customers will be identified on the public displays.`},groups:{enabled:{children:["isPublicWaitlist"],label:$localize`Enable public displays`,sublabel:$localize`Toggle to enable or disable the public displays.`},additionalCustomerDetails:{children:["showPublicWaitlistResources","showPublicWaitlistServices","showPublicWaitlistPartySize","showGuestFieldsPublic","showPublicGuestEstWaitTime","hideWaitTimePublic"],label:$localize`Additional customer details`,sublabel:$localize`Choose additional details to display on the public displays.`},pageOptions:{children:["hidePartiesPublic","hideEstWaitCheckin","showPublicWaitlistJoinButton","allowPublicAccountView","playSoundPublicWaitlistGuestAlerted"],label:$localize`Page options`,sublabel:$localize`Other options for the public displays.`}},components:{showPublicNameAs:_(we,{searchable:!1,selection:"single",data:Object.values(zn),plu
51ckLabel:a=>Pm[a]})},dependencies:()=>({showPublicWaitlistPartySize:t.getCurrentLocation(["showPartySize","showPartySizeWaitlist"]).pipe(p(a=>({hidden:a?.showPartySize!==!0||a?.showPartySizeWaitlist!==!0}))),showPublicWaitlistResources:t.getCurrentLocation(["showResources"]).pipe(p(a=>({hidden:a?.showResources!==!0}))),showPublicWaitlistServices:t.getCurrentLocation(["showServices"]).pipe(p(a=>({hidden:a?.showServices!==!0})))})},transformer:{toView:a=>({isPublicWaitlist:a.isPublicWaitlist,allowPublicAccountView:a.allowPublicAccountView,showPublicNameAs:a.showPublicNameAs??zn.FIRST_NAME,showGuestFieldsPublic:a.showGuestFieldsPublic,showPublicGuestEstWaitTime:a.showPublicGuestEstWaitTime,showPublicWaitlistJoinButton:a.showPublicWaitlistJoinButton,showPublicWaitlistPartySize:a.showPublicWaitlistPartySize,showPublicWaitlistResources:a.showPublicWaitlistResources,showPublicWaitlistServices:a.showPublicWaitlistServices,playSoundPublicWaitlistGuestAlerted:a.playSoundPublicWaitlistGuestAlerted,hideWaitTimePublic:!a.hideWaitTimePublic,hidePartiesPublic:!a.hidePartiesPublic,hideEstWaitCheckin:!a.hideEstWaitCheckin}),toPayload:a=>W(y({},a),{showPublicNameAs:a.showPublicNameAs?a.showPublicNameAs:zn.FIRST_NAME,hideWaitTimePublic:!a.hideWaitTimePublic,hidePartiesPublic:!a.hidePartiesPublic,hideEstWaitCheckin:!a.hideEstWaitCheckin})}}})]}},{type:"link",description:$localize`Customize buttons, fonts, backgrounds and more.`,page:{id:"custom-design",title:$localize`Custom design`,tabs:[{id:"theming",title:$localize`Theming`,component:J(()=>{let t=c(ht),a=c(v),e=c(cn),i=c(pn);return{joi:{formGroup:new F({theme:new C(null),publicTheme:new F(y({},ut()({layout:[],bgColor:[],bgImageUrl:[],contentBgColor:[],headingFont:[],textFont:[],textColor:[],btnBorderRadius:[],btnBgColor:[],btnTextColor:[],secondaryBtnBgColor:[],secondaryBtnTextColor:[]})))}),labels:{theme:$localize`Theme`,publicTheme:$localize``},sublabels:{theme:$localize`Choose between our default themes or create your own custom theme.`},components:{theme:_(Bc,{themeTypes:Gc})},dependencies:o=>({publicTheme:o.pipe(p(n=>({hidden:n.theme!=="custom"})))}),children:{publicTheme:{labels:{layout:$localize`Layout`,bgColor:$localize`Background color`,bgImageUrl:$localize`Background image`,contentBgColor:$localize`Content card`,headingFont:$localize`Heading font`,textFont:$localize`Body font`,textColor:$localize`Text color`,btnBorderRadius:$localize`Button radius`,btnBgColor:$localize`Primary button color`,btnTextColor:$localize`Primary button text color`,secondaryBtnBgColor:$localize`Secondary button color`,secondaryBtnTextColor:$localize`Secondary button text color`},sublabels:{layout:$localize`Choose the layout for the customer registration page.`,bgColor:$localize`Set the background color for the registration page.`,bgImageUrl:$localize`Add an image to your registration page.`,contentBgColor:$localize`Set the color for the content card where the sign-up form is displayed.`,headingFont:$localize`Choose the font for the headings and titles displayed on the content card.`,textFont:$localize`Select the font used for the main body text.`,textColor:$localize`Choose the color for the text displayed throughout the registration flow.`,btnBorderRadius:$localize`Set the roundness of the buttons.`,btnBgColor:$localize`Select the color for the primary action buttons.`,btnTextColor:$localize`Choose the color for the text inside the primary action buttons.`,secondaryBtnBgColor:$localize`Select the color for secondary action buttons.`,secondaryBtnTextColor:$localize`Choose the color for the text inside the secondary action buttons.`},components:{layout:_(Xn,{withPadding:!1,data:Be()(["CENTERED","TWO_COLUMNS_CONTENT_LEFT","TWO_COLUMNS_CONTENT_RIGHT"]),pluckLabel:o=>_(Vn,{icon:kc[o],$element:{classList:["block","w-20","h-20"]}}),pluckHint:o=>Wc[o]}),bgColor:_(Fi,{withCustomColorPicker:!0}),bgImageUrl:_(Jn,{hint:t.displayImageUploadHint(),uploader:o=>R(null,null,function*(){let n=yield b(a.getCurrentLocation(["id"]));return i.payload.next({locationId:n.id,fileType:"public-theme-backgroundimage",dataUrl:o}),(yield b(i.response$))?.url})}),contentBgColor:_(Fi,{withCustomColorPicker:!0}),headingFont:_(we,{data:Ir.flatMap(o=>o.fonts),groupBy:Mr}),textFont:_(we,{data:Ir.flatMap(o=>o.fonts),groupBy:Mr}),textColor:_(Fi,{withCustomColorPicker:!0}),btnBorderRadius:_(zc),btnBgColor:_(Fi,{withCustomColorPicker:!0}),btnTextColor:_(Fi,{withCustomColorPicker:!0}),secondaryBtnBgColor:_(Fi,{withCustomColorPicker:!0}),secondaryBtnTextColor:_(Fi,{withCustomColorPicker:!0})}}}},transformer:{toView:o=>({theme:o.useAccountTheme?"account":o.theme,publicTheme:{layout:o.publicTheme?.layout??null,bgColor:o.publicTheme?.bgColor??ui.backgroundColor,bgImageUrl:o.publicTheme?.bgImageUrl??null,contentBgColor:o.publicTheme?.contentBgColor??ui.contentBgColor,headingFont:br(o.publicTheme?.headingFont??ui.headingFont),textFont:br(o.publicTheme?.textFont??ui.textFont),textColor:o.publicTheme?.textColor??ui.textColor,btnBorderRadius:o.publicTheme?.btnBorderRadius,btnBgColor:o.publicTheme?.btnBgColor??ui.btnBgColor,btnTextColor:o.publicTheme?.btnTextColor??ui.btnTextColor,secondaryBtnBgColor:o.publicTheme?.secondaryBtnBgColor??ui.secondaryBtnBgColor,secondaryBtnTextColor:o.publicTheme?.secondaryBtnTextColor??ui.secondaryBtnTextColor}}),toPayload:o=>{let n=o.theme,u=n==="account";return{useAccountTheme:u,theme:u?null:n,publicTheme:n!=="custom"?null:{layout:o.publicTheme.layout,bgColor:o.publicTheme.bgColor,bgImageUrl:o.publicTheme.bgImageUrl,contentBgColor:o.publicTheme.contentBgColor,headingFont:Nr(o.publicTheme.headingFont),textFont:Nr(o.publicTheme.textFont),textColor:o.publicTheme.textColor,btnBorderRadius:o.publicTheme.btnBorderRadius,btnBgColor:o.publicTheme.btnBgColor,btnTextColor:o.publicTheme.btnTextColor,secondaryBtnBgColor:o.publicTheme.secondaryBtnBgColor,secondaryBtnTextColor:o.publicTheme.secondaryBtnTextColor}}}},updateSideEffect:(o,n)=>{let u=n.publicTheme?.bgImageUrl;!o.publicTheme?.bgImageUrl&&u&&u.length>0&&e.payload.next({locationId:n.id,fileType:"public-theme-backgroundimage"})}}}),actions:[{label:"Preview",api:t=>R(null,null,function*(){let a=t.get(Zo),e=t.get(v),i=yield b(e.getCurrentLocation(["shortName"]));window.open(`${a.publicPagesUrl}/locations/${i.shortName}`)})}]},{id:"content",title:$localize`Content`,categories:[{items:[{type:"link",description:$localize`Customize the public registration pages using markdown, HTML and CSS.`,page:{
51id:"registration-pages",title:$localize`Public registration pages`,tabs:[{id:"registration-pages-general",title:$localize`General`,component:J(()=>({joi:{formGroup:new F(Z({messagesWelcomePage:[],messagesCheckinWelcome:[]})),labels:{messagesWelcomePage:$localize`First page in the registration flow`,messagesCheckinWelcome:$localize`General pages in registration flow`},sublabels:{messagesWelcomePage:$localize`Customize the styling of your first page using Markdown formatting.`,messagesCheckinWelcome:$localize`Customize the styling of your general registration pages using Markdown formatting.`},components:{messagesWelcomePage:_(zt),messagesCheckinWelcome:_(zt)}}}))},{id:"registration-pages-bookings",title:$localize`Bookings`,component:J(()=>({joi:{formGroup:new F(Z({messagesBookingPageConfirmation:[],messagesBookingConfirmationInfo:[]})),labels:{messagesBookingPageConfirmation:$localize`Kiosk redirect`,messagesBookingConfirmationInfo:$localize`Status page`},sublabels:{messagesBookingPageConfirmation:$localize`Customize the styling of your kiosk redirect page using Markdown formatting.`,messagesBookingConfirmationInfo:$localize`Customize the styling of your booking status page using Markdown formatting.`},components:{messagesBookingPageConfirmation:_(zt),messagesBookingConfirmationInfo:_(zt)}}})),enabledConfig:Pe({permissions:["locations.update"],isSessionSupported:({location:t})=>!!t?.isBookingActive})},{id:"registration-pages-waitlist",title:$localize`Waitlist`,component:J(()=>({joi:{formGroup:new F(Z({messagesGuestPageInfo:[],messagesCheckinConfirmation:[]})),labels:{messagesGuestPageInfo:$localize`Status page`,messagesCheckinConfirmation:$localize`Kiosk redirect`},sublabels:{messagesGuestPageInfo:$localize`Customize the styling of your waitlist status page using Markdown formatting.`,messagesCheckinConfirmation:$localize`Customize the styling of the kiosk redirect page using Markdown formatting.`},components:{messagesGuestPageInfo:_(zt),messagesCheckinConfirmation:_(zt)}}})),enabledConfig:Pe({permissions:["locations.update"],isSessionSupported:({location:t})=>!!t?.isWaitlistActive})}]},suffix:()=>[qe(["messagesWelcomePage","messagesCheckinWelcome","messagesBookingPageConfirmation","messagesBookingConfirmationInfo","messagesGuestPageInfo"],t=>[t.messagesWelcomePage,t.messagesCheckinWelcome,t.messagesBookingPageConfirmation,t.messagesBookingConfirmationInfo,t.messagesGuestPageInfo].some(e=>e&&e.length>0)?$localize`Customized`:$localize`Default`,{})]},{type:"link",description:$localize`Customize the arrival pages using markdown, HTML and CSS.`,page:{id:"arrival-pages",keywords:[$localize`Check-in`,$localize`Checkin`],title:$localize`Customer arrival pages`,component:J(()=>({joi:{formGroup:new F(Z({messagesArrivalPage:[]})),labels:{messagesArrivalPage:$localize`Web arrival page`},sublabels:{messagesArrivalPage:$localize`Customize the styling of your arrival page using Markdown formatting.`},components:{messagesArrivalPage:_(zt)}}}))},suffix:()=>[qe(["messagesArrivalPage"],t=>t.messagesArrivalPage&&t.messagesArrivalPage.length>0?$localize`Customized`:$localize`Default`)]},{type:"link",description:$localize`Customize the waitlist display using markdown, HTML and CSS.`,page:{id:"display-waitlist-page",title:$localize`Display waitlist page`,component:J(()=>({joi:{formGroup:new F(Z({messagesWaitlistWelcome:[]})),labels:{messagesWaitlistWelcome:$localize`Welcome message`},sublabels:{messagesWaitlistWelcome:$localize`Customize the styling of your welcome message using Markdown formatting.`},components:{messagesWaitlistWelcome:_(zt)}}}))},suffix:()=>[qe(["messagesWaitlistWelcome"],t=>t.messagesWaitlistWelcome&&t.messagesWaitlistWelcome.length>0?$localize`Customized`:$localize`Default`)]},{type:"link",description:$localize`Show custom content for this location in the Location directory.`,page:{id:"location-directory",title:$localize`Location directory`,component:J(()=>({joi:{formGroup:new F(Z({publicAccountSignupContent:[]})),labels:{publicAccountSignupContent:$localize`Custom content`},sublabels:{publicAccountSignupContent:$localize`Show custom content for this location in the Location directory.`},components:{publicAccountSignupContent:_(zt)}}}))},suffix:()=>[qe(["publicAccountSignupContent"],t=>t.publicAccountSignupContent&&t.publicAccountSignupContent.length>0?$localize`Customized`:$localize`Default`)]}]}]},{id:"custom-css",title:$localize`CSS`,component:_(fu),enabledConfig:{accountFeatures:["enableCustomStyle"],permissions:["locations.update"]}}]}},{type:"link",description:$localize`Automate your repetitive tasks using smart rules.`,page:{
51id:"automation",title:$localize`Automation`,addActions:[{label:$localize`Add automation`,link:"/settings/automation/editor",enabled:{permissions:["locations.update"],isWaitwhileUser:!0},eventLoggerName:"opened_create_visit_automation"}],categories:[{item:{type:"component",id:"visit-automations",title:$localize`Visit Automations`,component:_(nu),enabledConfig:Pe({isWaitwhileUser:!0,rx:t=>t.get($e).getCurrentNullableLocation(["visitRules"]).pipe(p(a=>!!a?.visitRules?.length))})}},{item:{type:"title",id:"prebuilt-automations",title:$localize`Prebuilt automations`,description:$localize`Automate your workflow through our prebuilt automation rules.`,icon:"bx-library"},items:[{type:"link",description:$localize`Customers with a booking will be moved to the waitlist before their start time.`,page:{id:"sync-bookings-to-waitlist",title:$localize`Add bookings to waitlist before their start time`,keywords:[$localize`Sync with waitlist`,$localize`Sync bookings`],component:J(()=>({joi:{formGroup:new F(Z({bookingSyncWaitingEnabled:[],bookingSyncWaiting:[],bookingWaitlistOrder:[]})),labels:{bookingSyncWaitingEnabled:$localize`Enabled`,bookingSyncWaiting:$localize`When to move booking`,bookingWaitlistOrder:$localize`Move to position`},locale:{FIRST:$localize`First`,LAST:$localize`Last`},components:{bookingSyncWaiting:_(we,{data:jp,pluckLabel:t=>Kp[t]})}}}))},suffix:()=>[qe(["bookingSyncWaitingEnabled"],({bookingSyncWaitingEnabled:t})=>!!t)],enabledConfig:Pe({accountFeatures:["enableBookingSyncWaiting"],permissions:["locations.update"],isSessionSupported:({location:t})=>t?.isWaitlistActive===!0&&t?.isBookingActive===!0})},{type:"title",id:"booking-checkin-to-waitlist",title:$localize`Add bookings to waitlist when tagged as Arrived`,description:$localize`Customers with a booking will be moved to the waitlist when they receive the Arrived tag and the waitlist is open.`,suffix:()=>[ae("bookingCheckinToWaitlist")],enabledConfig:Pe({permissions:["locations.update"],isSessionSupported:({location:t})=>t?.isWaitlistActive===!0&&t?.isBookingActive===!0&&t?.isPublicArrival===!0&&t?.isPublicSignin===!0})},{type:"title",id:"close-waitlist-early",title:$localize`Close the waitlist early`,description:$localize`Prohibit new customers to join the waitlist if the wait time is estimated to exceed the open hours.`,suffix:()=>[ae("closeWaitlistOnceFull")],enabledConfig:Pe({permissions:["locations.update"],isSessionSupported:({location:t})=>t?.isWaitlistActive===!0})},{type:"title",id:"resource-assign-on-alert",title:$localize`Assign visit on alert`,description:$localize`Alerting a customer will auto-assign the user to the customer if they are linked to a resource.`,suffix:()=>[ae("resourceAssignOnAlert")],enabledConfig:Pe({permissions:["locations.update"],isSessionSupported:({location:t})=>t?.showResources===!0})},{type:"title",id:"complete-visit-on-serve",title:$localize`Complete visit when serving a new customer`,description:$localize`Serving a customer will auto-complete the previously served customer if the user is linked to a resource.`,suffix:()=>[ae("autoCompleteServing")],enabledConfig:Pe({permissions:["locations.update"],isSessionSupported:({location:t})=>(t?.isBookingActive===!0||t?.isWaitlistActive===!0)&&t?.showResources===!0})},{type:"link",description:$localize`Move customers to the head of your waitlist based on your prioritization rules.`,page:{id:"waitlist-prioritization",title:$localize`Waitlist prioritization`,component:J(()=>({joi:{formGroup:new F(Z({visitTagRules:[]})),labels:{visitTagRules:$localize`Prioritize customers where`},components:{visitTagRules:_(lu)}}}))},suffix:()=>[qe(["visitTagRules"],({visitTagRules:t})=>!!t&&t.length>0)],enabledConfig:Pe({accountFeatures:["enableVisitTagRules"],permissions:["locations.update"],isSessionSupported:({location:t})=>t?.isWaitlistActive===!0})},{type:"link",description:$localize`Remove waitlisted customers automatically after a set time.`,page:{id:"remove-from-waitlist",title:$localize`Remove from waitlist`,keywords:[$localize`Expire`],component:J(()=>({joi:{formGroup:new F(Z({expiryRules:[]})),labels:{expiryRules:$localize`Expiration rules`},components:{expiryRules:_($a,{type:"WAITING"})}}}))},suffix:()=>[qe(["expiryRules"],({expiryRules:t})=>(t?.WAITING?.duration??0)>0)],enabledConfig:Pe({permissions:["locations.update"],isSessionSupported:({location:t})=>t?.isWaitlistActive===!0})},{type:"link",description:$localize`Remove customers with a booking automatically after a set time.`,page:{
51id:"remove-bookings",title:$localize`Remove bookings`,keywords:[$localize`Expire`],component:J(()=>({joi:{formGroup:new F(Z({expiryRules:[]})),labels:{expiryRules:$localize`Expiration rules`},components:{expiryRules:_($a,{type:"BOOKED"})}}}))},suffix:()=>[qe(["expiryRules"],({expiryRules:t})=>(t?.BOOKED?.duration??0)>0)],enabledConfig:Pe({permissions:["locations.update"],isSessionSupported:({location:t})=>t?.isBookingActive===!0})},{type:"link",description:$localize`Remove customers from serving automatically after a set time.`,page:{id:"remove-from-serving",title:$localize`Remove from serving`,keywords:[$localize`Expire`],component:J(()=>({joi:{formGroup:new F(Z({expiryRules:[]})),labels:{expiryRules:$localize`Expiration rules`},components:{expiryRules:_($a,{type:"SERVING"})}}}))},suffix:()=>[qe(["expiryRules"],({expiryRules:t})=>(t?.SERVING?.duration??0)>0)],enabledConfig:Pe({permissions:["locations.update"],isSessionSupported:({location:t})=>t?.isWaitlistActive===!0||t?.isBookingActive===!0})},{type:"link",description:$localize`Move customers to another location in your account once they are completed.`,page:{id:"move-completed-to-other-location",title:$localize`Move completed visits to other location`,component:J(()=>({joi:{formGroup:new F(Z({nextLocations:[]})),labels:{nextLocations:$localize`Locations`},sublabels:{nextLocations:$localize`Select which location(s) to move visits to when they are completed.`},components:{nextLocations:_(Hc,{placeholder:$localize`Select location(s)`,hideCurrentLocation:!0,$rx:{hint:c(No).getCurrentUser(["locationIds"]).pipe(p(t=>t?.locationIds??[]),p(t=>t.length===1?$localize`You don't have access to any other locations.`:null))}})}}}))},suffix:()=>[qe(["nextLocations"],({nextLocations:t})=>!!t&&t.length>0)],enabledConfig:Pe({permissions:["locations.update"],isSessionSupported:({user:t})=>(t?.locationIds??[]).length>1})}]}]}}]}]};var Ba={somePermissions:["data-fields.create","data-fields.delete","data-fields.update"]};var Dm=Dp(za,"settings",t=>Bt(t,{trackPendingChanges:!0})),Ua=[Bt({path:"customer-messages/edit",component:Zr},{trackPendingChanges:!0}),Bt({path:"team-notifications/edit",component:Zr},{trackPendingChanges:!0}),{path:"resource-categories",component:Up,enabledConfig:Po,searchTarget:{segments:[$localize`Resources`,$localize`Resource categories`],type:"page"}},Bt({path:"resources/edit",enabledConfig:Po,component:Ar},{trackPendingChanges:!0}),Bt({path:"resources/create",component:Ar,enabledConfig:Po,searchTarget:{segments:[$localize`Resources`,$localize`Create resource`],type:"create"}},{trackPendingChanges:!0}),{path:"service-categories",component:Xp,enabledConfig:Do,searchTarget:{segments:[$localize`Services`,$localize`Service categories`],type:"page"}},Bt({path:"services/edit",component:Lr,enabledConfig:Do},{trackPendingChanges:!0}),Bt({path:"services/create",component:Lr,enabledConfig:Do,searchTarget:{segments:[$localize`Services`,$localize`Create service`],type:"create"}},{trackPendingChanges:!0}),Bt({path:"standard-fields/:key",component:Au,enabledConfig:Ba},{trackPendingChanges:!0}),Bt({path:"input-fields/edit",component:Br,enabledConfig:Ba},{trackPendingChanges:!0}),Bt({path:"input-fields/create",component:Br,enabledConfig:Ba,searchTarget:{segments:[$localize`Input fields`,$localize`Create input field`],type:"create"}},{trackPendingChanges:!0}),Bt({path:"automation/editor",component:ou},{trackPendingChanges:!0})];var Gm="location-settings-search-history";var km=(()=>{class t extends Gp{constructor(){let e=c(Ni);super(e),this.routes=Ua,this.page=za,this.localStorageKey=Gm,this.formComponent=zo,this.injector=e}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function bE(t,a){if(t&1){let e=V();l(0,"div",5)(1,"div"),w(2,1),r(),l(3,"button",6),N("click",function(){D(e);let o=d(2);return G(o.settingSearch.clearHistory())}),w(4,2),r()()}t&2&&m("wwTypography","caption1")("wwColor","darkerGrey")}function NE(t,a){if(t&1&&(E(0,bE,5,2,"div",5),S(1,"async")),t&2){let e=d();f(T(1,1,e.hasSearchHistory$)?0:-1)}}var is=(()=>{class t extends q{constructor(){super(),this.changeDetectorRef=c(Pt),this.router=c(Ve),this.eventLogger=c(yc),this.settingSearch=c(km),this.formControl=new C("",{nonNullable:!0}),this.search$=Q(this.formControl),this.open=!1,this.items$=this.search$.pipe(U(e=>e.length===0?this.settingSearch.history$:this.settingSearch.search(e)),this.shareReplay()),this.hasItems$=this.items$.pipe(p(e=>e.length>0)),this.hasSearchHistory$=A([this.items$,this.search$]).pipe(p(([e,i])=>e.length>0&&i.length===0)),this.subscribe()}onSearchRemoved(e){this.eventLogger.log("location_setting_search_cancelled",{params:{search_query:e}})}onSelected(e){this.eventLogger.log("location_setting_searched",{params:{search_query:this.formControl.value}}),this.formControl.setValue("",{emitEvent:!1}),this.settingSearch.addToHistory(e),this.open=!1,this.router.navigate([`/settings/${e.routerLink}`],{queryParams:e.queryParams})}subscribe(){this.formControl.valueChanges.pipe(z(this.ngOnDestroy$)).subscribe(()=>{this.open=!0,this.changeDetectorRef.markForCheck()})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ww-settings-search"]],hostAttrs:[1,"ww-settings-search"],standalone:!1,features:[O],decls:5,vars:10,consts:()=>{let e;e=$localize`Search history`;let i;return i=$localize` Clear `,[["headerTmpl",""],e,i,[3,"focusin","shouldClose","selected","wwFormFieldSize","open","data","headerComponent","pluckLabel"],[3,"searchRemoved","appearance","formControl","size"],[1,"flex","justify-between","p-4","pb-1",3,"wwTypography","wwColor"],["
51wwButton","link",3,"click"]]},template:function(i,o){if(i&1&&(l(0,"ww-autocomplete",3),S(1,"async"),N("focusin",function(){return o.open=!0})("shouldClose",function(){return o.open=!1})("selected",function(u){return o.onSelected(u)}),l(2,"ww-search-input",4),N("searchRemoved",function(u){return o.onSearchRemoved(u)}),r()(),$(3,NE,2,3,"ng-template",null,0,me)),i&2){let n=ie(4);m("wwFormFieldSize","full")("open",o.open&&T(1,8,o.hasItems$))("data",o.items$)("headerComponent",n)("pluckLabel",o.settingSearch.pluckLabel),s(2),m("appearance","outline")("formControl",o.formControl)("size","full")}},dependencies:[Dc,kl,Se,Je,ft,Wt,oe,ne,L],encapsulation:2,changeDetection:0})}}return t})();function RE(t,a){t&1&&g(0,"ww-settings-search")}var Wm=(()=>{class t extends q{constructor(){super(),this.accountRx=c(Ue),this.router=c(Ve),this.intercom=c(Wi),this.internalLinks=c(Me),this.layout=c(le),this.isHome$=this.router.events.pipe(Ee(e=>e instanceof Ls),Re(this.router),p(()=>this.router.url),p(e=>e.split("/").pop()==="settings")),this.hasAccountUsedOldSettings$=this.accountRx.getAccount(["created"]).pipe(p(e=>Zs(new Date(e.created),new Date("2024-10-16")))),this.bulletPoints=[$localize`Redesigned interface`,$localize`Global setting search`,$localize`Powerful message editor`,$localize`Enhanced permission functionality`,$localize`And much more...`],this.subscribe(),this.layout.enableRestoreScrollPosition(this.ngOnDestroy$)}subscribe(){this.isHome$.pipe(z(this.ngOnDestroy$)).subscribe(e=>{e&&this.layout.setFeatureContext({name:$localize`Location settings`})})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=I({type:t,selectors:[["ng-component"]],hostAttrs:[1,"ww-settings"],standalone:!1,features:[O],decls:4,vars:3,consts:[["wwLayoutPadding","",1,"ww-settings-container"]],template:function(i,o){i&1&&(l(0,"div",0),E(1,RE,1,0,"ww-settings-search"),S(2,"async"),g(3,"router-outlet"),r()),i&2&&(s(),f(T(2,1,o.isHome$)?1:-1))},dependencies:[Uc,vs,is,L],styles:[`.ww-settings{--ww-setting-column-width: 500px;--ww-setting-gap: 16px;display:block}.ww-breakpoints-above-small .ww-settings{--ww-setting-gap: 24px}.ww-settings .ww-settings-search,.ww-settings .ww-call-out{max-width:100%;width:calc(2 * var(--ww-setting-column-width) + var(--ww-setting-gap))}.ww-breakpoints-above-small .ww-settings{--ww-setting-parent-card-padding: 24px;--ww-setting-child-card-padding: 16px 24px;--ww-setting-gap: 24px}.ww-settings .ww-settings-container{display:flex;flex-direction:column;gap:var(--ww-setting-gap)}.ww-settings .ww-settings-container .ww-tab-bar{margin:0 calc(-1 * var(--ww-setting-gap))}.ww-breakpoints-below-small .ww-settings .ww-settings-container .ww-call-out .ww-call-out-close{position:absolute;top:4px;right:4px;width:auto}
52/*noopsettings.component-2H5GWGND.css.map */
53`],encapsulation:2,changeDetection:0})}}return t})();var k2=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=bs({type:t})}static{this.\u0275inj=ws({providers:[Xc],imports:[Le,H,Lo,M,X,ni.forChild([{path:"",component:Wm,children:[...Dm,...Ua]}])]})}}return t})();export{Cu as BatchSettingsDataFieldsActions,Pm as DISPLAY_WAITLIST_PUBLIC_NAME_AS_LABELS,Kp as LOCATION_SETTINGS_BOOKING_SYNC_WAITING_LABELS,jp as LOCATION_SETTINGS_BOOKING_SYNC_WAITING_VALUES,cy as LOCATION_SETTING_FORM_OPTIONS,am as MESSAGES_REGISTRATION_TYPES,Da as MESSAGE_TEMPLATES_DEFAULT_PAGE_EVENT,Wa as RegistrationTypeTabsComponent,cu as SETTINGS_COORDINATES_INFO_CONTENT,be as SMS_TRIGGER_CONFIGS,wn as SMS_TRIGGER_TYPES,km as SettingSearchService,ba as SettingsVisitAutomationsActions,rm as TEAM_NOTIFICATIONS_PREFIX,Yp as VISIT_AUTOMATION_ID_QUERY_PARAM,vm as WAIT_TIME_ESTIMATION_DURATION_LABELS,Fm as WAIT_TIME_ESTIMATION_DURATION_TOOLTIPS,$m as WAIT_TIME_ESTIMATION_MODEL_LABEL_SUFFIX,Lm as WAIT_TIME_ESTIMATION_MODEL_TOOLTIPS,qC as WwSettingsApiButtonComponent,Wm as WwSettingsComponent,Aa as WwSettingsContactButtonComponent,pu as WwSettingsCoordinatesComponent,fn as WwSettingsCopyLinkButtonComponent,fu as WwSettingsCustomCssComponent,lm as WwSettingsCustomerMessagesComponent,nm as WwSettingsCustomerMessagesOptionsComponent,bu as WwSettingsDataFieldFormComponent,ku as WwSettingsDataFieldsActionComponent,Vu as WwSettingsDataFieldsComponent,Br as WwSettingsDataFieldsEditorComponent,Du as WwSettingsDataFieldsViewerComponent,tm as WwSettingsEmailLocalizationComponent,$a as WwSettingsExpiryRulesComponent,zo as WwSettingsFormComponent,Xu as WwSettingsIntegrationsFacebookComponent,Hu as WwSettingsIntegrationsZapierComponent,r0 as WwSettingsLocaleSelectorComponent,Zu as WwSettingsLocalizationBusinessTermsComponent,im as WwSettingsLocationAddressComponent,xa as WwSettingsLocationHoursDatesComponent,Pa as WwSettingsLocationHoursWeekdaysComponent,om as WwSettingsLocationInfoComponent,RR as WwSettingsLocationNameComponent,Zr as WwSettingsMessageTemplateEditorComponent,sm as WwSettingsMessageTemplateViewerComponent,k2 as WwSettingsModule,Em as WwSettingsRegistrationDefaultTr
53iggersComponent,fm as WwSettingsRegistrationEmbedCodeComponent,ts as WwSettingsRegistrationFieldTriggersFormComponent,Nm as WwSettingsRegistrationQrCodeInfoComponent,GF as WwSettingsRegistrationWaitingIndicatorComponent,Tm as WwSettingsSavedRepliesComponent,Am as WwSettingsSchedulesComponent,is as WwSettingsSearchComponent,Ou as WwSettingsSelectComponent,Au as WwSettingsStandardDataFieldsEditorComponent,gm as WwSettingsTeamNotificationsComponent,Ru as WwSettingsTextComponent,hn as WwSettingsToggleComponent,Qp as WwSettingsVisitAutomationsActionsComponent,nu as WwSettingsVisitAutomationsComponent,ou as WwSettingsVisitAutomationsEditorComponent,su as WwSettingsVisitTagRuleComponent,lu as WwSettingsVisitTagRulesComponent,xm as WwSettingsWaitlistWaitTimeEstimationComponent,Nu as createDurationSelect,Pe as enabled,J as form,Vr as inlineForm,Ga as isMessagesRegistrationType,_C as isVisitTagRuleOperator,Z as locationFormControls,qe as locationText,Wo as select,_i as simpleStatus,ao as status,ae as toggle};
54//noopchunk-O6AFMBTI.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.