1import{a as F}from"./chunk-IPINZA7D.js";import{a as at}from"./chunk-LSPRO44Y.js";import"./chunk-QOZ4BDD3.js";import{b as st}from"./chunk-TEOJU564.js";import{c as j}from"./chunk-QDWNG7EU.js";import{a as ne}from"./chunk-HTAQM2JG.js";import{a as rt}from"./chunk-RRTQZZUB.js";import{a as nt}from"./chunk-25VDCOO7.js";import"./chunk-UNHFDEAW.js";import"./chunk-RYNJ2ZID.js";import"./chunk-Z2AEYF7J.js";import"./chunk-ARRYUDMY.js";import{n as ze,r as Qe,t as He}from"./chunk-IAVP4RXJ.js";import{a as ot}from"./chunk-WVAHAKOR.js";import{a as it}from"./chunk-7M6VZNAY.js";import{a as tt}from"./chunk-F255GW2T.js";import{a as Ze,b as et}from"./chunk-N73BGN4H.js";import{c as oe}from"./chunk-GVDOXYUI.js";import"./chunk-6OYEC3VN.js";import"./chunk-WX5IEK4X.js";import"./chunk-IKELL5US.js";import"./chunk-GFFPIZE2.js";import{b as Je}from"./chunk-VYZSFR3D.js";import"./chunk-OSTPGULE.js";import"./chunk-KIOUS7YV.js";import{a as Xe}from"./chunk-JXMTAIBB.js";import{b as $}from"./chunk-LWUUEIQO.js";import{a as We,b as ie}from"./chunk-ZFUIHNPN.js";import"./chunk-KJIUKXJ4.js";import{d as me,g as Ke}from"./chunk-BCT6AZ4D.js";import"./chunk-GBA5HQ3D.js";import"./chunk-L2XAKF7E.js";import"./chunk-ARHQJIEW.js";import"./chunk-J4G6UZTT.js";import{a as L}from"./chunk-SCJMMS4R.js";import"./chunk-N2OMGYSR.js";import"./chunk-GLB6FXVW.js";import"./chunk-7YDYSXNF.js";import"./chunk-PLWO6N5B.js";import{a as je}from"./chunk-NYVODJB2.js";import{$j as Ge,Ha as G,Xb as qe,Ya as Ne,md as Ue}from"./chunk-JWTTV2TH.js";import"./chunk-HKNOB5YZ.js";import{A as $e,z as Le}from"./chunk-NGZBGJL5.js";import{I as Ye,J as Ae,d as ee,f as Fe,g as Re,j as te,m as ke,v as Be}from"./chunk-UBDARBLF.js";import{Aa as Oe,Pa as V,Qa as De,Za as Ie,bd as Z,d as Ee,ec as we,fa as Me,l as Pe,vd as I,wd as Ve}from"./chunk-DM3NC7AB.js";import{$b as M,Ac as J,Bc as T,Cc as s,Db as ge,Dc as a,Ea as ue,Ec as _,Ee as D,Fa as he,Hd as l,Ia as K,Ic as be,Id as c,Ja as C,Jb as r,Jc as Se,Mc as w,N as H,Oe as xe,Pc as x,Qa as b,Ra as S,Rc as p,Vb as fe,Vc as X,Wa as ye,Wb as y,Wc as k,X as v,Xc as B,a as Q,ac as ve,be as _e,e as P,ed as d,fd as O,gd as E,hd as A,sd as Te,ta as R,tc as Ce,uc as g,wc as f,zc as W}from"./chunk-WVBH4ZDA.js";import{a as de}from"./chunk-YDOXD4O3.js";var N=class o{constructor(t,e,i){this.signetHttp=t;this.signetOccService=e;this.authService=i;this.captchaValue$=new P(null);this.translationInitialValues={nameRequiredErrorMsg:"",emailRequiredErrorMsg:"",limitedToFiveEmailErrorMsg:"",sendCtaErrorMsg:"",clipBoardMsgText:"",copyViaLinkText:"",copyViaEmailText:"",modalTitle:""};this.captchaRelatedData={siteKey:"",isCaptchaEnabled:!1,baseStoreSiteData:null};this.emailFormValues={yourName:"",recipientEmail:"",message:""};this.commonToggles={isUKSite:!1,isEmailConfirmed:!1,showIconStraight:!0,showCaptchaErrorMessage:!1};this.initialValues$=new P({translationValues:this.translationInitialValues,captchaRelatedData:this.captchaRelatedData,emailFormValues:this.emailFormValues,commonToggles:this.commonToggles,recaptchaResponse:""});this.isEmailConfirmed$=new P(!1)}generateLinkURL(t){return this.authService.isUserLoggedIn().pipe(R(i=>{let n=i?G.ACTIVE_USER:G.ANONYMOUS_USER,m=`${this.signetOccService.getBaseUrl()}/users/${n}/${He}`;return this.signetHttp.post(m,t)}))}generateEmailURL(t,e){let i={headers:new Ee(de({},t?{"sap-commerce-cloud-captcha-token":t}:{}))};return this.authService.isUserLoggedIn().pipe(R(m=>{let u=m?G.ACTIVE_USER:G.ANONYMOUS_USER,h=`${this.signetOccService.getBaseUrl()}/users/${u}/${Qe}`;return this.signetHttp.post(h,e,i)}))}static{this.\u0275fac=function(e){return new(e||o)(K(Pe),K(De),K(we))}}static{this.\u0275prov=ue({token:o,factory:o.\u0275fac,providedIn:"root"})}};var ht=["recaptcharef"];function yt(o,t){o&1&&(s(0,"div",8),d(1),l(2,"cxTranslate"),a()),o&2&&(r(),E(" ",c(2,1,"storePDP.captchaErrorMsg")," "))}function gt(o,t){if(o&1){let e=w();s(0,"div")(1,"form",1)(2,"div",2)(3,"app-amor-form-input",3),l(4,"cxTranslate"),d(5),l(6,"cxTranslate"),a()(),s(7,"div",2)(8,"app-amor-form-input",4),l(9,"cxTranslate"),d(10),l(11,"cxTranslate"),a()(),s(12,"div",2),_(13,"app-amor-text-area",5),l(14,"cxTranslate"),a(),s(15,"div",6)(16,"app-recaptcha",7,0),x("captchaResponseEvent",function(n){b(e);let m=p(2);return S(m.getResponseFromCaptcha(n))}),a()(),g(18,yt,3,3,"div",8),a(),s(19,"div",9)(20,"app-amor-button",10),x("buttonClick",function(){b(e);let n=p(2);return S(n.onSubmit())}
1),d(21),l(22,"cxTranslate"),a()(),s(23,"div",11)(24,"p"),d(25),l(26,"cxTranslate"),a(),s(27,"p"),d(28),l(29,"cxTranslate"),a()()()}if(o&2){let e=p(),i=p();r(),T("formGroup",i.signetEmailYourTrayForm),r(2),T("type","text")("formInputid","yourName")("required",!0)("errorContainerText",i.hasError("yourName")?c(4,27,"storePDP.nameRequiredErrorMsg"):"")("hasError",i.hasError("yourName"))("control",i.signetEmailYourTrayForm.controls.yourName),r(2),E(" ",c(6,29,"storePDP.yourNamePlaceholder")," "),r(3),T("type","text")("formInputid","recipientsEmail")("required",!0)("errorContainerText",i.hasError("recipientsEmail")?i.getRecipientsErrorMessage:"")("hasError",i.hasError("recipientsEmail"))("control",i.signetEmailYourTrayForm.controls.recipientsEmail)("helperText",i.emailErrorMsgHide?c(9,31,"storePDP.emailHintText"):""),r(2),E(" ",c(11,33,"storePDP.recipientEmailPlaceholder")," "),r(3),T("ariaRequired",!0)("textAreaid","messageField")("control",i.signetEmailYourTrayForm.controls.messageField)("placeholder",c(14,35,"storePDP.addMessagePlaceholder")),r(3),T("isCaptchaEnabled",e.captchaRelatedData.isCaptchaEnabled)("siteKey",e.captchaRelatedData.siteKey),r(2),f(e.commonToggles.showCaptchaErrorMessage?18:-1),r(2),T("disabled",i.isEmailSuccess),r(),E(" ",c(22,37,"storePDP.sendBtnLabel")," "),r(4),E(" ",c(26,39,"storePDP.privacyMessage1")," "),r(3),E(" ",c(29,41,"storePDP.privacyMessage2")," ")}}function ft(o,t){if(o&1&&(s(0,"span",15),d(1),a(),_(2,"br")),o&2){let e=t.$implicit;r(),O(e)}}function vt(o,t){if(o&1){let e=w();s(0,"div",12)(1,"h4")(2,"strong"),d(3),l(4,"cxTranslate"),a()(),s(5,"span")(6,"strong"),d(7),l(8,"cxTranslate"),a(),_(9,"br"),W(10,ft,3,1,null,null,Ce().trackByEmail,!0),a()(),s(12,"div",13)(13,"app-amor-button",14),x("buttonClick",function(){b(e);let n=p(2);return S(n.onDone())}),d(14),l(15,"cxTranslate"),a()()}if(o&2){let e=p(),i=p();r(3),O(c(4,3,"storePDP.swooshText")),r(4),O(c(8,5,"storePDP.emailConfirmationMsg")),r(3),J(i.splitEmails(e.emailFormValues.recipientEmail)),r(4),E(" ",c(15,7,"storePDP.doneBtnLabel")," ")}}function Ct(o,t){o&1&&g(0,gt,30,43,"div")(1,vt,16,9),o&2&&f(t.commonToggles.isEmailConfirmed?1:0)}var U=class o{constructor(t,e,i,n,m,u){this.baseSiteService=t;this.shareYourTrayService=e;this.translation=i;this.localStorage=n;this.renderer=m;this.errorAlertService=u;this.FITTING_TRAY="fittingAddedTray";this.signetEmailYourTrayForm=new Re({yourName:new te("",[ee.required,ee.pattern(Ue)]),recipientsEmail:new te("",[ee.required,this.emailValidator()]),messageField:new te("")});this.isInvalidEmailPattern=!1;this.bannerType=ie;this.initialValues$=this.shareYourTrayService.initialValues$;this.closeOpenModal=new ye;this.isEmailSuccess=!1;this.emailErrorMsgHide=!0;this.subscriptions$=new Q}get getRecipientsErrorMessage(){let t=this.initialValues$.value;return this.isInvalidEmailPattern||this.signetEmailYourTrayForm?.controls.recipientsEmail?.value.length==0?t.translationValues.emailRequiredErrorMsg:t.translationValues.limitedToFiveEmailErrorMsg}ngOnInit(){let t=this.translation.translate("storePDP.nameRequiredErrorMsg"),e=this.translation.translate("storePDP.emailRequiredErrorMsg"),i=this.translation.translate("storePDP.limitedToFiveEmailErrorMsg"),n=this.translation.translate("storePDP.sendCtaErrorMsg");H(t,e,i,n).pipe(v(1)).subscribe(u=>{let h=this.initialValues$.value;h.translationValues.nameRequiredErrorMsg=u[0],h.translationValues.emailRequiredErrorMsg=u[1],h.translationValues.limitedToFiveEmailErrorMsg=u[2],h.translationValues.sendCtaErrorMsg=u[3],this.shareYourTrayService.initialValues$.next(h)}),this.subscriptions$.add(this.shareYourTrayService.captchaValue$.subscribe(u=>{u&&this.reCaptchaScriptCall()})),this.showCaptcha()}focusErrorField(t){t.get("yourName")?.invalid?this.renderer.selectRootElement("#yourName").focus():t.get("recipientsEmail")?.invalid&&this.renderer.selectRootElement("#recipientsEmail").focus()}showCaptcha(){this.baseSiteService.getActive().pipe(v(1),R(t=>this.baseSiteService.get(t))).pipe(v(1)).subscribe(t=>{let e=this.initialValues$.value;e.captchaRelatedData.baseStoreSiteData=t,e.captchaRelatedData.isCaptchaEnabled=e.captchaRelatedData.baseStoreSiteData.baseStore.isCaptchaEnabled,e.captchaRelatedData.siteKey=e.captchaRelatedData.baseStoreSiteData?.baseStore?.reCaptchaPublicKey,this.shareYourTrayService.initialValues$.
1next(e)})}reCaptchaScriptCall(){this.recaptcharef?.first.captchaReCall()}getResponseFromCaptcha(t){let e=this.initialValues$.value;e.recaptchaResponse=t,e.commonToggles.showCaptchaErrorMessage=!1,this.shareYourTrayService.initialValues$.next(e)}hasError(t){let e=!1;return!this.signetEmailYourTrayForm.controls[t].valid&&(this.signetEmailYourTrayForm.controls[t].errors?.required||this.signetEmailYourTrayForm.controls[t].errors?.pattern||this.signetEmailYourTrayForm.controls[t].errors?.emailValidator)&&this.signetEmailYourTrayForm.controls[t].touched&&(this.signetEmailYourTrayForm.controls[t].dirty||this.signetEmailYourTrayForm.controls[t].touched)&&(e=!0),e}onSubmit(){let t=this.initialValues$.value,e=this.localStorage.getItem(this.FITTING_TRAY),i=e.trayId?e.trayId:"";if(this.signetEmailYourTrayForm.invalid||t.recaptchaResponse===""&&t.captchaRelatedData.isCaptchaEnabled)t.commonToggles.isEmailConfirmed=!1,t.commonToggles.showCaptchaErrorMessage=!!t.captchaRelatedData.isCaptchaEnabled,this.signetEmailYourTrayForm.markAllAsTouched(),this.focusErrorField(this.signetEmailYourTrayForm);else{this.signetEmailYourTrayForm.markAsPristine(),t.emailFormValues.yourName=this.signetEmailYourTrayForm.controls.yourName.value,t.emailFormValues.recipientEmail=this.signetEmailYourTrayForm.controls.recipientsEmail.value,t.emailFormValues.message=this.signetEmailYourTrayForm.controls.messageField.value,t.commonToggles.showCaptchaErrorMessage=!1;let m=this.signetEmailYourTrayForm.controls.recipientsEmail.value.split(",").map(h=>String(h).trim()),u={customerName:this.signetEmailYourTrayForm.controls.yourName.value,emailRecipients:m,message:this.signetEmailYourTrayForm.controls.messageField.value,wid:i};this.isEmailSuccess=!0,this.shareYourTrayService.generateEmailURL(t.recaptchaResponse,u).pipe(v(1)).subscribe({next:h=>{h.success&&(this.isEmailSuccess=!1,t.commonToggles.isEmailConfirmed=!0,t.recaptchaResponse=""),this.shareYourTrayService.initialValues$.next(t)},error:()=>{this.isEmailSuccess=!1,t.commonToggles.isEmailConfirmed=!1,this.closeOpenModal.emit(!0),this.errorAlertService.setTriggeredErrorAlert(!0),this.errorAlertService.setCustomErrorMessage(!0),this.errorAlertService.setErrorMessageName("storePDP.sendCtaErrorMsg")}})}this.shareYourTrayService.initialValues$.next(t)}emailValidator(){return t=>{let e=t.value,i=!1;if(!e)return null;let n=e.split(",").map(m=>String(m).trim());if(n.length<=5){n.length===5?this.emailErrorMsgHide=!1:this.emailErrorMsgHide=!0;for(let m=0;m<n.length;m++)if(Ne.test(n[m].trim()))i=!1,this.isInvalidEmailPattern=!1;else{i=!0,this.isInvalidEmailPattern=!0;break}}else i=!0,this.isInvalidEmailPattern=!1;return i?{emailValidator:!0}:null}}onDone(){this.signetEmailYourTrayForm.reset(),this.initialValues$.value.commonToggles.showCaptchaErrorMessage=!1,this.closeOpenModal.emit(!0)}ngOnDestroy(){this.subscriptions$.unsubscribe()}splitEmails(t){return t?t.split(",").map(e=>e.trim()):[]}trackByEmail(t,e){return e}static{this.\u0275fac=function(e){return new(e||o)(y(V),y(N),y(Z),y(L),y(fe),y(ne))}}static{this.\u0275cmp=M({type:o,selectors:[["app-share-your-tray-form"]],viewQuery:function(e,i){if(e&1&&X(ht,5),e&2){let n;k(n=B())&&(i.recaptcharef=n)}},outputs:{closeOpenModal:"closeOpenModal"},standalone:!1,decls:2,vars:3,consts:[["recaptcharef",""],[1,"form-container",3,"formGroup"],[1,"form-group"],[3,"type","formInputid","required","errorContainerText","hasError","control"],[3,"type","formInputid","required","errorContainerText","hasError","control","helperText"],[3,"ariaRequired","textAreaid","control","placeholder"],[1,"re-captcha"],[3,"captchaResponseEvent","isCaptchaEnabled","siteKey"],["role","alert","aria-atomic","true",1,"captchaError"],[1,"email-checked-btn"],[3,"buttonClick","disabled"],[1,"privacy-message"],[1,"body-one","email-confirmation-form-content"],[1,"confirmation-checked-btn"],[3,"buttonClick"],[1,"email-style"]],template:function(e,i){if(e&1&&(g(0,Ct,2,1),l(1,"async")),e&2){let n;f((n=c(1,1,i.initialValues$))?0:-1,n)}},dependencies:[$,ke,Fe,Be,Ze,it,oe,D,I],styles:[".form-container[_ngcontent-%COMP%]{position:relative;top:4px;width:285px}.form-container[_ngcontent-%COMP%] input#yourName, .form-container[_ngcontent-%COMP%] input#recipientsEmail{padding:0 16px;width:318px;max-width:145vw}.form-container[_ngcontent-%COMP%] textarea#messageField{width:318px;max-width:145vw}.privacy-message[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;position:relative;text-align:center;width:318px;font-size:12px}.privacy-message[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.email-checked-btn[_ngcontent-%COMP%]{width:318px}.email-checked-btn[_ngcontent-%COMP%] app-amor-button[_ngcontent-%COMP%]{display:flex;justify-content:center;width:100%;background-color:#fff;color:#000;margin-top:13px}.email-checked-btn[_ngcontent-%COMP%] app-amor-button[_ngcontent-%COMP%] .btn-amor.btn-primary-amor, .email-checked-btn[_ngcontent-%COMP%] app-amor-button[_ngcontent-%COMP%] button.btn-amor.btn-primary-amor[_ngcontent-%COMP%]{min-width:100%}@media(max-width:767px){.email-checked-btn[_ngcontent-%COMP%] app-amor-button[_ngcontent-%COMP%] .btn-amor.btn-primary-amor, .email-checked-btn[_ngcontent-%COMP%] app-amor-button[_ngcontent-%COMP%] button.btn-amor.btn-primary-amor[_ngcontent-%COMP%]{width:100%!important}}.email-confirmation-form-content[_ngcontent-%COMP%]{text-align:center;font-family:Open Sans Bold,Arial Bold,sans-serif;padding-bottom:20px}.email-style[_ngcontent-%COMP%]{font-weight:400;font-family:Open Sans;font-size:14px;line-height:21px;color:#000}.confirmation-close-button[_ngcontent-%COMP%] app-amor-button[_ngcontent-%COMP%]{display:flex;justify-content:center;width:100%}
1@media(max-width:1024px),(max-width:1366px)and (orientation:landscape){ #g-recaptcha_widget, .g-recaptcha, iframe[src*=recaptcha]{position:relative;z-index:9999;pointer-events:auto;width:304px;max-width:100%} .modal-content:has(#g-recaptcha_widget), .modal-content:has(.g-recaptcha_widget), .modal-content:has(.g-recaptcha), .modal-content:has(iframe[src*=recaptcha]), .amor-container.modal.modal-amor .modal-dialog{overflow:visible}}.confirmation-checked-btn[_ngcontent-%COMP%] app-amor-button[_ngcontent-%COMP%]{display:flex;justify-content:center;width:100%;background-color:#fff;color:#000;margin-top:13px}.confirmation-checked-btn[_ngcontent-%COMP%] app-amor-button[_ngcontent-%COMP%] .btn-amor.btn-primary-amor, .confirmation-checked-btn[_ngcontent-%COMP%] app-amor-button[_ngcontent-%COMP%] button.btn-amor.btn-primary-amor[_ngcontent-%COMP%]{min-width:100%}@media(max-width:767px){.confirmation-checked-btn[_ngcontent-%COMP%] app-amor-button[_ngcontent-%COMP%] .btn-amor.btn-primary-amor, .confirmation-checked-btn[_ngcontent-%COMP%] app-amor-button[_ngcontent-%COMP%] button.btn-amor.btn-primary-amor[_ngcontent-%COMP%]{width:100%!important}}"]})}};var St=["popOver"],Tt=["recaptcharef"],_t=["triggerModal"];function xt(o,t){if(o&1){let e=w();s(0,"app-amor-popover-enhanced",6,1),l(2,"cxTranslate"),l(3,"cxTranslate"),x("emitTriggerButtonClick",function(){b(e);let n=p(2);return S(n.resetSharePopOver())})("selectedPopoverValue",function(n){b(e);let m=p(2);return S(m.onPopOverIconClick(n))}),a()}if(o&2){let e=p(),i=p();T("buttonId","popover-share-cart")("label",c(2,12,"storePDP.shareBtnLabel"))("icon","fa-Share")("ariaLabel",c(3,14,"storePDP.shareAriaLabel"))("popContentList",t)("popoverPlacement",i.popOverPosition)("position","popover-sideRight")("showIconStraight",e.commonToggles.showIconStraight)("animation",!0)("pdpShareIconClicked",!0)("iconTextClickable",!0)("message",e.translationValues.clipBoardMsgText)}}function Et(o,t){if(o&1){let e=w();s(0,"div",2),g(1,xt,4,16,"app-amor-popover-enhanced",3),l(2,"async"),s(3,"amor-modal",4,0),x("modalClose",function(){b(e);let n=p();return S(n.closeModal())}),be(5),s(6,"app-share-your-tray-form",5),x("closeOpenModal",function(n){b(e);let m=p();return S(m.closeOpenModal(n))}),a(),Se(),a()()}if(o&2){let e,i=t,n=p();r(),f((e=c(2,3,n.popovericonVariantContent$))?1:-1,e),r(2),T("modalTitle",i.commonToggles.isEmailConfirmed?"":i.translationValues.modalTitle)("backdropValue",!0)}}var ae=class o{constructor(t,e,i,n){this.translation=t;this.baseSiteService=e;this.shareYourTrayService=i;this.errorAlertService=n;this.subscriptions$=new Q;this.FITTING_TRAY="fittingAddedTray";this.SITEID=qe;this.bannerType=ie;this.popovericonVariantContent$=new P([]);this.initialValues$=this.shareYourTrayService.initialValues$;this.eventService=C(Ie);this.taggingEventRegistration=C(Ke);this.clipboardService=C(ot);this.changeDetectorRef=C(_e);this.localStorage=C(L);this.windowRef=C(Oe);this.loggerService=C(je)}ngOnInit(){let t=this.translation.translate("storePDP.clipBoardMsgText"),e=this.translation.translate("storePDP.copyViaLinkText"),i=this.translation.translate("storePDP.copyViaEmailText"),n=this.translation.translate("storePDP.shareBagFormTitle"),m=this.baseSiteService.getActive();H(t,e,i,m,n).pipe(v(1)).subscribe(u=>{let h=this.shareYourTrayService.initialValues$.value;h.translationValues.clipBoardMsgText=u[0],h.translationValues.copyViaLinkText=u[1],h.translationValues.copyViaEmailText=u[2],h.translationValues.modalTitle=u[4],h.commonToggles.isUKSite=u[3]===this.SITEID.HS||u[3]===this.SITEID.EJ,this.shareYourTrayService.initialValues$.next(h),this.popovericonVariantContent()}),this.popOverPosition="top-right auto",this.clipboardService.sharedLinkCopied$.pipe(v(1)).subscribe(u=>{if(u===!0){let h=this.initialValues$.value;this.setShowIconStraight(!1),this.popovericonVariantContent$.next([{ariaLabel:h.translationValues.copyViaLinkText,icon:"fa-Checkmark",message:h.translationValues.clipBoardMsgText}]),this.changeDetectorRef.markForCheck()}})}openShareForm(){let t=this.shareYourTrayService.initialValues$.value;t.commonToggles.isEmailConfirmed=!1,this.shareYourTrayService.initialValues$.
1next(t),setTimeout(()=>{this.triggerModal.first?.triggerModalClick()},0)}showCaptcha(){this.baseSiteService.getActive().pipe(v(1),R(t=>this.baseSiteService.get(t))).pipe(v(1)).subscribe(t=>{let e=this.shareYourTrayService.initialValues$.value;e.captchaRelatedData.baseStoreSiteData=t,e.captchaRelatedData.isCaptchaEnabled=e.captchaRelatedData.baseStoreSiteData.baseStore.isCaptchaEnabled,e.captchaRelatedData.siteKey=e.captchaRelatedData.baseStoreSiteData?.baseStore?.reCaptchaPublicKey,this.shareYourTrayService.initialValues$.next(e)})}reCaptchaScriptCall(){this.recaptcharef?.first.captchaReCall()}resetSharePopOver(){this.setShowIconStraight(!0),this.popovericonVariantContent()}setShowIconStraight(t){let e=this.shareYourTrayService.initialValues$.value;e.commonToggles.showIconStraight=t,this.shareYourTrayService.initialValues$.next(e)}popovericonVariantContent(){let t=this.initialValues$.value,e=[{ariaLabel:t.translationValues.copyViaLinkText,icon:"fa-Link",message:""},{ariaLabel:t.translationValues.copyViaEmailText,icon:"fa-Email",message:""}];this.popovericonVariantContent$.next(e)}closeModal(){this.ShareYourTrayFormComponent.signetEmailYourTrayForm.reset({yourName:"",recipientsEmail:"",messageField:""}),this.initialValues$.value.commonToggles.showCaptchaErrorMessage=!1,this.initialValues$.value.recaptchaResponse=""}closeOpenModal(t){if(t){let e=this.shareYourTrayService.initialValues$.value;e.commonToggles.isEmailConfirmed=!1,e.emailFormValues.yourName="",e.emailFormValues.recipientEmail="",e.emailFormValues.message="",this.shareYourTrayService.initialValues$.next(e),this.triggerModal.first?.triggerCloseModal()}}onPopOverIconClick(t){let e=this.shareYourTrayService.initialValues$.value;if(e.commonToggles.isEmailConfirmed=!1,t==="fa-Link"){let i=this.localStorage.getItem(this.FITTING_TRAY),n={trayId:i?.trayId||"",storeId:i?.storeId||""};this.subscriptions$.add(this.shareYourTrayService.generateLinkURL(n).subscribe({next:m=>{if(m.shareLink){let u=m.shareLink;this.windowRef.nativeWindow?.navigator.userAgent.match(/Version\/\d+(?:\.\d+)*.*Safari/)&&this.copyTextToClipboard(u),this.clipboardService.copyMessage(u)}else{let h=`${this.windowRef?.location?.hostname}/${ze}?wid=${i.trayId}`;this.windowRef.nativeWindow?.navigator.userAgent.match(/Version\/\d+(?:\.\d+)*.*Safari/)&&this.copyTextToClipboard(h),this.clipboardService.copyMessage(h)}this.setShowIconStraight(!1)},error:()=>{this.errorAlertService.setTriggeredErrorAlert(!0),this.errorAlertService.setCustomErrorMessage(!0),this.errorAlertService.setErrorMessageName("storePDP.sendCtaErrorMsg")}})),this.popOver.first.enableScreenReader(),e.commonToggles.isUKSite||this.eventService.dispatch(this.taggingEventRegistration.ctaEvent(e.translationValues.copyViaEmailText,"","other"),me)}else if(t==="fa-Email"){this.shareYourTrayService.captchaValue$.next(!0);let i=this.translation.translate("adobeStrings.shareEmail").pipe(v(1)).subscribe(n=>{this.shareEmailText=n});this.subscriptions$.add(i),this.eventService.dispatch(this.taggingEventRegistration.ctaEvent(this.shareEmailText,"","other"),me),this.popOver.last.onCloseButtonClick(),this.triggerModal.first.triggerModalClick()}else this.resetSharePopOver()}copyTextToClipboard(t){let e=this.windowRef.document.createElement("textarea");if(e.value=t,e.style.position="fixed",this.windowRef.document.body.appendChild(e),e.focus(),e.select(),this.windowRef.isBrowser())setTimeout(()=>{try{this.windowRef.document.execCommand("copy"),this.loggerService.log("[shopping-cart-share] Link copied to clipboard successfully")}catch(i){this.loggerService.error("[shopping-cart-share] Failed to copy to clipboard:",i)}finally{this.windowRef.document.body.removeChild(e)}},500);else try{this.windowRef.document.execCommand("copy"),this.loggerService.log("[shopping-cart-share] Link copied to clipboard successfully")}catch(i){this.loggerService.error("[shopping-cart-share] Failed to copy to clipboard:",i)}finally{this.windowRef.document.body.removeChild(e)}}ngOnDestroy(){this.subscriptions$.unsubscribe()}static{this.\u0275fac=function(e){return new(e||o)(y(Z),y(V),y(N),y(ne))}}static{this.\u0275cmp=M({type:o,selectors:[["app-share-your-tray"]],viewQuery:function(e,i){if(e&1&&X(U,5)(St,5)(Tt,5)(_t,5),e&2){let n;k(n=B())&&(i.ShareYourTrayFormComponent=n.first),k(n=B())&&(i.popOver=n),k(n=B())&&(i.recaptcharef=n),k(n=B())&&(i.triggerModal=n)}},standalone:!1,decls:2,vars:3,consts:[["triggerModal",""],["popOver",""],[1,"amor-container"],[3,"buttonId","label","icon","ariaLabel","popContentList","popoverPlacement","position","showIconStraight","animation","pdpShareIconClicked","iconTextClickable","message"],["modalId","emailYourTrayFormModel",1,"hidden",3,"modalClose","modalTitle","backdropValue"],[3,"closeOpenModal"],[3,"emitTriggerButtonClick","selectedPopoverValue","buttonId","label","icon","ariaLabel","popContentList","popoverPlacement","position","showIconStraight","animation","pdpShareIconClicked","iconTextClickable","message"]],template:function(e,i){if(e&1&&(g(0,Et,7,5,"div",2),l(1,"async")),e&2){let n;f((n=c(1,1,i.initialValues$))?0:-1,n)}},dependencies:[Je,nt,U,D,I],styles:["@media(orientation:landscape){ ngb-modal-window[aria-labelledby=emailYourTrayFormModel] .modal-content{position:fixed;left:50%;
1top:50%;transform:translate(-50%,-50%);width:400px;max-width:95vw;background:#fff;z-index:1100;height:100%!important}}"]})}};function Mt(o,t){if(o&1&&(d(0),l(1,"cxTranslate")),o&2){let e=p(2);A("( ",e.trayCount," ",c(1,2,"storePDP.itemsLabel")," )")}}function Ot(o,t){if(o&1&&(d(0),l(1,"cxTranslate")),o&2){let e=p(2);A("( ",e.trayCount," ",c(1,2,"storePDP.itemLabel")," )")}}function Dt(o,t){if(o&1&&(s(0,"p",3),d(1),l(2,"cxTranslate"),a()),o&2){let e=p(2);r(),A(" ",c(2,2,"storePDP.trayLabel"),": ",e.trayNumber," ")}}function It(o,t){if(o&1&&(s(0,"div",0)(1,"p",1),d(2),l(3,"cxTranslate"),g(4,Mt,2,4)(5,Ot,2,4),a(),s(6,"div",2),_(7,"app-share-your-tray"),a(),g(8,Dt,3,4,"p",3),a(),_(9,"hr")),o&2){let e=p();r(2),E(" ",c(3,3,"storePDP.yourTrayLabel")," "),r(2),f(e.trayCount>1?4:5),r(4),f(e.trayNumber?8:-1)}}var se=class o{constructor(){this.trayFillService=C(F);this.trayDataFetched$=new P(!1);this.trayNumber="";this.trayCount=0}ngOnInit(){this.getTrayData()}getTrayData(){this.trayFillService.yourTraySubject$.subscribe(t=>{this.trayDataFetched$.next(!0),this.trayNumber=t?.trayNumber,this.trayCount=t?.trayCount})}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=M({type:o,selectors:[["app-your-tray"]],standalone:!1,decls:2,vars:3,consts:[[1,"tray-container"],[1,"item"],[1,"share-component"],[1,"id"]],template:function(e,i){e&1&&(g(0,It,10,5),l(1,"async")),e&2&&f(c(1,1,i.trayDataFetched$)?0:-1)},dependencies:[ae,D,I],styles:[".tray-container[_ngcontent-%COMP%]{margin-left:15px;margin-top:24px}.tray-container[_ngcontent-%COMP%] p.item[_ngcontent-%COMP%]{margin-bottom:8px;display:inline-block}.tray-container[_ngcontent-%COMP%] p.id[_ngcontent-%COMP%]{margin-bottom:23px}.tray-container[_ngcontent-%COMP%] .share-component[_ngcontent-%COMP%]{position:absolute;display:inline-block;right:25px}"]})}};var wt=(o,t)=>t.sku;function Vt(o,t){o&1&&_(0,"div",1)}function Ft(o,t){if(o&1){let e=w();s(0,"div",7)(1,"div",17)(2,"h2"),d(3),l(4,"cxTranslate"),a(),s(5,"div",18)(6,"button",19),x("click",function(){b(e);let n=p(4);return S(n.closeDeleteModal())}),d(7),l(8,"cxTranslate"),a(),s(9,"button",20),x("click",function(){b(e);let n=p().$implicit,m=p(3);return S(m.confirmDelete(n))}),d(10),l(11,"cxTranslate"),a()()()()}o&2&&(r(3),O(c(4,3,"storePDP.removeItemFromTrayLabel")),r(4),O(c(8,5,"storePDP.noLabel")),r(3),O(c(11,7,"storePDP.yesLabel")))}function Rt(o,t){if(o&1&&(s(0,"span",15),d(1),a()),o&2){let e=p().$implicit;r(),E("",e.origPrice," ")}}function kt(o,t){o&1&&(s(0,"div",16)(1,"span",21),d(2),l(3,"cxTranslate"),a()()),o&2&&(r(2),O(c(3,1,"storePDP.inOutOfStockLabel")))}function Bt(o,t){if(o&1){let e=w();s(0,"div",2)(1,"div",3)(2,"div",4),d(3),l(4,"cxTranslate"),a(),s(5,"div",5)(6,"div",6),x("click",function(){let n=b(e).$implicit,m=p(3);return S(m.openDeleteModal(n.sku))})("keydown.enter",function(){let n=b(e).$implicit,m=p(3);return S(m.openDeleteModal(n.sku))}),a()()(),g(7,Ft,12,9,"div",7),s(8,"div",8)(9,"div",9),_(10,"img",10),a(),s(11,"div",11)(12,"span",12),d(13),a(),s(14,"div",13)(15,"span",14),d(16),a(),g(17,Rt,2,1,"span",15),a()()(),g(18,kt,4,3,"div",16),_(19,"hr"),a()}if(o&2){let e=t.$implicit,i=p(3);r(3),A(" ",c(4,10,"storePDP.itemLabel")," ",e.sku," "),r(4),f(i.selectedSkuToDelete===e.sku&&i.openDeleteModalFlag?7:-1),r(3),T("alt",Te(e.name))("src",e.imageUrl,ge),r(3),O(e.name),r(3),O(e.price),r(),f(e!=null&&e.origPrice&&(e==null?null:e.origPrice)!==(e==null?null:e.price)?17:-1),r(),f(e!=null&&e.outOfStock?18:-1)}}function Yt(o,t){if(o&1&&W(0,Bt,20,12,"div",2,wt),o&2){let e=p(2);J(e.productCardData)}}function At(o,t){if(o&1&&g(0,Yt,2,0),o&2){let e=p();f(e.productCardData.length>0?0:-1)}}var le=class o{constructor(t,e){this.storeRouteService=t;this.baseSiteService=e;this.productCardFetched$=new P(!1);this.productCardData=[];this.selectedSkuToDelete=null;this.trayFillService=C(F);this.openDeleteModalFlag=!1;this.VARIANT_AVAILABILITY="variantAvailability";this.localStorage=C(L)}ngOnInit(){this.baseSiteService.get().pipe(v(1)).subscribe({next:t=>{t?.signetSiteProperties?.isSotfMagicLoupeEnabled?this.getTrayListData():this.storeRouteService.goToUnAvailableServicePage()},error:()=>{this.storeRouteService.goToUnAvailableServicePage()}}),this.getTrayListData(),this.trayFillService.dispatchTrayEvent(Ge)}trackByIndex(t){return t}getTrayListData(){this.trayFillService.trayListSubject$.subscribe(t=>{this.productCardFetched$.next(!0);let e=this.localStorage.getItem(this.VARIANT_AVAILABILITY);e&&t.forEach(i=>
1{let n=e.find(m=>m.sku===i.sku);n&&(i.outOfStock=n.outOfStock)}),this.productCardData=t,this.trayFillService.addProductsInTrayToLocalStorage(t)})}openDeleteModal(t){this.openDeleteModalFlag||(this.trayFillService.startTrayonExpereince$.next(!1),this.openDeleteModalFlag=!0,this.selectedSkuToDelete=t)}closeDeleteModal(){this.trayFillService.startTrayonExpereince$.next(!0),this.openDeleteModalFlag=!1,this.selectedSkuToDelete=null}confirmDelete(t){this.trayFillService.removeFromTray(t),this.closeDeleteModal()}ngOnDestroy(){this.closeDeleteModal()}static{this.\u0275fac=function(e){return new(e||o)(y(j),y(V))}}static{this.\u0275cmp=M({type:o,selectors:[["app-tray-details"]],standalone:!1,decls:4,vars:4,consts:[[1,"tray-container"],[1,"overlay"],[1,"item-container"],[1,"item-id-container"],[1,"item-id"],[1,"delete-icon-wrapper"],["tabindex","0",1,"delete-icon",3,"click","keydown.enter"],[1,"delete-modal-backdrop"],[1,"item-details"],[1,"item-image"],["width","80","height","80",3,"src","alt"],[1,"item-title"],[1,"item-label"],[1,"price-details"],[1,"actual-price"],[1,"price-now"],[1,"not-in-stock"],[1,"modal-content"],[1,"modal-actions"],[1,"n
1o-btn",3,"click"],[1,"yes-btn",3,"click"],[1,"text"]],template:function(e,i){e&1&&(s(0,"div",0),g(1,Vt,1,0,"div",1),g(2,At,1,1),l(3,"async"),a()),e&2&&(r(),f(i.selectedSkuToDelete!==null?1:-1),r(),f(c(3,2,i.productCardFetched$)?2:-1))},dependencies:[D,I],styles:['.item-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:20px 15px 0;position:relative}.item-id-container[_ngcontent-%COMP%]{font-weight:400;line-height:17px;letter-spacing:0px;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.delete-icon[_ngcontent-%COMP%]{width:24px;height:24px;background-image:url("/scripts/media/delete-icon-6EUXMLSG.svg");background-size:contain;background-repeat:no-repeat;background-position:center;position:relative;pointer-events:auto;z-index:10}.delete-buttons[_ngcontent-%COMP%]{width:24;height:24;opacity:1;top:20px;left:336px}.item-details[_ngcontent-%COMP%]{opacity:1;display:flex;flex-direction:row;gap:16px}.item-image[_ngcontent-%COMP%]{flex-shrink:0}.item-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{aspect-ratio:1/1;max-width:80px;max-height:80px}.item-title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.item-label[_ngcontent-%COMP%]{font-weight:400;font-style:normal;line-height:21px;letter-spacing:0}.price-details[_ngcontent-%COMP%]{width:118px;height:24px;gap:8px;display:flex;align-items:center}.actual-price[_ngcontent-%COMP%]{font-weight:400;font-style:normal;line-height:24px}.price-now[_ngcontent-%COMP%]{font-style:normal;font-weight:400;line-height:16px;text-decoration:line-through}.delete-modal-backdrop[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;background:#fff;display:flex;align-items:center;justify-content:center;z-index:1000;opacity:.9;top:0;left:0}.modal-content[_ngcontent-%COMP%]{background:#fff;padding:24px;border-radius:8px;text-align:center}.modal-content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:16px;margin-bottom:20px}.modal-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;gap:16px;font-size:12px;font-weight:700;line-height:18px}.no-btn[_ngcontent-%COMP%]{border:1px solid #000;background:transparent;color:#000;padding:12px 24px;cursor:pointer}.yes-btn[_ngcontent-%COMP%]{background:#000;color:#fff;padding:12px 24px;cursor:pointer;border:none}.overlay[_ngcontent-%COMP%]{position:absolute;height:100vh;width:100vw;background:transparent;top:0;left:0;z-index:190}.not-in-stock[_ngcontent-%COMP%]{display:flex;justify-content:center;background-color:#f8f8f8}.not-in-stock[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{padding:16px 18px;color:#323232;font-weight:400;font-style:normal;font-size:14px;line-height:21px;letter-spacing:0}']})}};var ce=class o{constructor(t){this.storeRouteService=t;this.buttonSize=We;this.trayFillService=C(F);this.isDeleteModalOpen=!1}ngOnInit(){this.subscription=this.trayFillService.startTrayonExpereince$.subscribe(t=>{this.isDeleteModalOpen=!t})}onStartTryOnClick(){this.storeRouteService.goTrayConfirmationPage()}ngOnDestroy(){this.subscription?.unsubscribe()}static{this.\u0275fac=function(e){return new(e||o)(y(j))}}static{this.\u0275cmp=M({type:o,selectors:[["app-start-try-on-exp"]],standalone:!1,decls:5,vars:7,consts:[[1,"start-tryon-btn-container"],[1,"btn-container"],[3,"buttonClick","buttonSize","buttonPrimary","buttonType","disabled"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"app-amor-button",2),x("buttonClick",function(){return i.onStartTryOnClick()}),d(3),l(4,"cxTranslate"),a()()()),e&2&&(r(2),T("buttonSize",i.buttonSize.fullWidth)("buttonPrimary",!0)("buttonType","primary")("disabled",i.isDeleteModalOpen),r(),E(" ",c(4,5,"storePDP.startTryOnLabel")))},dependencies:[$,I],styles:[".start-tryon-btn-container[_ngcontent-%COMP%]{z-index:100;display:flex;padding:16px 15px;justify-content:center;align-items:center;flex-shrink:0;position:fixed;bottom:0;left:0;right:0}.start-tryon-btn-container[_ngcontent-%COMP%] .btn-container[_ngcontent-%COMP%]{width:100%}"]})}};function Lt(o,t){o&1&&_(0,"cx-page-slot",0)(1,"cx-page-slot",1)}function $t(o,t){o&1&&_(0,"cx-page-slot",2)(1,"cx-page-slot",1)}function jt(o,t){if(o&1&&g(0,Lt,2,0)(1,$t,2,0),o&2){let e=p();f(e.showTray?0:1)}}var pe=class o{constructor(t,e,i){this.trayFillService=t;this.storeRouteService=e;this.baseSiteService=i;this.trayDataFetched$=new P(!1);this.showTray=!1}ngOnInit(){this.baseSiteService.get().pipe(v(1)).subscribe({next:t=>{t?.signetSiteProperties?.isSotfMagicLoupeEnabled?this.fetchTrayData():this.storeRouteService.goToUnAvailableServicePage()},error:()=>{this.storeRouteService.goToUnAvailableServicePage()}})}fetchTrayData(){this.trayFillService.getTrayItems(),this.trayFillService.trayListSubject$.subscribe(t=>{t&&(t.length>0?this.showTray=!0:this.showTray=!1,this.trayDataFetched$.next(!0))})}static{this.\u0275fac=function(e){return new(e||o)(y(F),y(j),y(V))}}static{this.\u0275cmp=M({type:o,selectors:[["app-tray-body"]],standalone:!1,decls:2,vars:3,consts:[["position","TrayFillSlot"],["position","PrivacyPolicySlotTrayPage"],["position","TrayEmptySlot"]],template:function(e,i){e&1&&(g(0,jt,2,1),l(1,"async")),e&2&&f(c(1,1,i.trayDataFetched$)?0:-1)},dependencies:[Le,D],encapsulation:2})}};var mt=class o{static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275mod=ve({type:o})}static{this.\u0275inj=he({providers:[Me({cmsComponents:{TrayBodyFlexComponent:{component:pe},TrayBottomScannerImageCMSFlexComponent:{component:at},YourTrayFlexComponent:{component:se},TrayDetailsCMSFlexComponent:{component:le},TrayStartOnExperienceComponent:{component:ce}}})],imports:[xe,$,Ve,$e,st,Xe,Ae,Ye,et,tt,rt,oe]})}};export{mt as TrayFillModule};
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.