1import{a as ye,b as Ce,c as ze}from"./chunk-CK4RVFZV.js";import{a as fe,b as Ae}from"./chunk-MORVN6IY.js";import{b as we,h as $e}from"./chunk-VQJSFETT.js";import"./chunk-SSQN7X25.js";import{j as me,k as ue,l as Be}from"./chunk-IOQQ35UR.js";import"./chunk-2DBWLJHR.js";import"./chunk-NNKJJ345.js";import"./chunk-CCCVMNJV.js";import{c as ge,d as Ee}from"./chunk-BKL7IMG4.js";import"./chunk-2EUUB2FF.js";import{a as _e,b as Ie}from"./chunk-CCGI34LC.js";import"./chunk-M5U7TBQY.js";import"./chunk-M66LVL6E.js";import{a as pe,b as Ve}from"./chunk-4NDG7WK3.js";import"./chunk-SB4CDZTG.js";import{d as he,e as Re}from"./chunk-FEYL67FN.js";import"./chunk-Z4XCU2XN.js";import"./chunk-6LQTWPDY.js";import"./chunk-EVRQQVR6.js";import"./chunk-2NIEON7C.js";import"./chunk-KIWZNSJB.js";import"./chunk-DL3NROUC.js";import"./chunk-AO4EK6W4.js";import"./chunk-THNDJZ6M.js";import"./chunk-PJNLFALK.js";import"./chunk-T4BY2JUZ.js";import"./chunk-TIAHH4QK.js";import"./chunk-TMFOOMSR.js";import"./chunk-HPXH3VTL.js";import"./chunk-EBQ7LKUY.js";import"./chunk-C3OY5QKM.js";import"./chunk-SD646YB5.js";import"./chunk-3BWZVUJL.js";import"./chunk-BYMC3CJA.js";import"./chunk-32ESLIOW.js";import"./chunk-GYVHN6GP.js";import{a as T,b as Te}from"./chunk-LVYCKPBI.js";import"./chunk-6ED7CXXN.js";import"./chunk-XEXWZOGE.js";import{R as Oe,e as ce}from"./chunk-4U7ZBIWP.js";import{y as ie,z as Fe}from"./chunk-O574CAJ5.js";import"./chunk-TXBWSX4X.js";import"./chunk-5GNZDNP3.js";import"./chunk-PSWZDX6M.js";import{ma as Ne,z as de}from"./chunk-7V56JTTI.js";import"./chunk-PR3URSUW.js";import"./chunk-FZJDKUXZ.js";import{P as le}from"./chunk-MQHMSR6Q.js";import"./chunk-PMOKQO75.js";import"./chunk-7XZPU7YX.js";import{C as K,D as Pe,e as Y,j as J}from"./chunk-FEAIF55A.js";import{R as We,y as oe}from"./chunk-II62XKAX.js";import"./chunk-TMHGIC5Q.js";import"./chunk-3C6JQTNE.js";import{a as se,b as ke}from"./chunk-QHF2UVGV.js";import{a as ne,c as re,d as ae}from"./chunk-NOQEJP5D.js";import"./chunk-WCKPNZ6H.js";import{j as Z,p as ee,x as Se}from"./chunk-YXM3HUUI.js";import{Ka as Me,ba as X}from"./chunk-Q2U6QXMH.js";import{a as M,b as te,e as De}from"./chunk-QWXB4XKK.js";import"./chunk-BJ66ETYV.js";import"./chunk-7H4434VP.js";import"./chunk-4CCXKGS7.js";import"./chunk-TTGNNQTV.js";import{Aa as u,Ba as g,Ec as w,Ed as Q,Ga as E,Gc as d,I as B,Jb as I,Kd as N,Ma as v,Ob as R,Oc as U,Pc as q,Sd as G,Uc as x,Vc as y,Wc as W,Wd as j,Xc as L,ba as F,de as H,ec as $,gc as _,i as P,ia as Le,ic as h,lc as A,mc as z,n as S,nc as m,oc as r,pc as l,pd as k,qc as f,sa as C,tb as n,xc as b,yd as a,z as D,zd as s}from"./chunk-AAE36BVF.js";import{a as O,b as V,d as xe}from"./chunk-YZFYTRZT.js";function je(i,c){if(i&1){let e=b();r(0,"div",10),a(1,"pwrbreakpoint"),r(2,"div",11),f(3,"pwr-my-power-wishlist-name-input",12),l(),r(4,"div",13),a(5,"pwrbreakpoint"),r(6,"div",14)(7,"pwr-lib-loader-overlay",15)(8,"pwr-lib-button",16),a(9,"transloco"),w("buttonClick",function(){u(e);let o=d(2);
1return g(o.createList())}),l()()()()()}if(i&2){let e=d(2);x(k(18,qe,s(1,12,"gt-xs"))),n(3),m("listName",e.newListNameField)("submitted",e.newListSubmitted()),n(),x(k(20,Qe,s(5,14,"lt-sm"))),n(3),m("loading",e.createListLoading())("diameter",24),n(),m("fullWidth",!0)("text",s(9,16,"MyPower.Wishlist.CreateList"))("color","primary-light")("disabled",e.newListSubmitted()&&e.newListNameField.invalid)}}function He(i,c){i&1&&f(0,"pwr-lib-loader-spinner",15),i&2&&m("loading",!0)("diameter",48)}function Xe(i,c){if(i&1){let e=b();r(0,"div",18),w("click",function(o){u(e);let p=d(4);return g(p.toggleDefaultList(o))}),r(1,"div",19),f(2,"pwr-lib-input",20),a(3,"transloco"),l(),r(4,"div",21),y(5," 0 "),l()()}if(i&2){let e=d(4);n(2),m("type","checkbox")("inputLabel",s(3,3,"MyPower.Wishlist.MyWishlist"))("checked",e.defaultListCreated())}}function Ye(i,c){if(i&1){let e=b();r(0,"div",23),w("click",function(o){let p=u(e).$implicit,ve=d(),be=d(4);return g(be.toggleList(o,p.favoriteListId,ve[p.favoriteListId]))}),r(1,"div",19),f(2,"pwr-lib-input",24),a(3,"wishlistTitle"),a(4,"async"),l(),r(5,"div",21),y(6),l()()}if(i&2){let e=c.$implicit,t=d();x(t[e.favoriteListId]?"power-secondary-500-border border":"power-primary-100-border"),n(2),m("type","checkbox")("inputLabel",s(4,8,s(3,6,e.title))??void 0)("checked",t[e.favoriteListId]),n(4),L(" ",e.products.length," ")}}function Je(i,c){if(i&1&&A(0,Ye,7,10,"div",22,Ge),i&2){let e=d();z(e)}}function Ke(i,c){if(i&1&&(r(0,"h5",2),y(1),a(2,"transloco"),l(),_(3,Xe,6,5,"div",17),_(4,Je,2,0),a(5,"async")),i&2){let e,t=d(3);n(),W(s(2,3,"MyPower.Wishlist.YourLists")),n(2),h(c.length===0?3:-1),n(),h((e=s(5,5,t.selectedDict$))?4:-1,e)}}function Ze(i,c){if(i&1&&(_(0,He,1,2,"pwr-lib-loader-spinner",15),_(1,Ke,6,7)),i&2){let e,t=c;h(t.loading?0:-1),n(),h((e=t.value)?1:-1,e)}}function et(i,c){if(i&1){let e=b();r(0,"pwr-logo-dialog-header",1),w("closeOverlay",function(){u(e);let o=d();return g(o.close())}),l(),r(1,"h5",2),y(2),a(3,"transloco"),l(),r(4,"div",3)(5,"div",4),f(6,"pwr-product-image",5),l(),y(7),l(),r(8,"div",6)(9,"button",7),w("click",function(){u(e);let o=d();return g(o.toggleCreateNewList())}),f(10,"pwr-lib-icon",8),y(11),a(12,"transloco"),l(),_(13,je,10,22,"div",9),l(),_(14,Ze,2,2),a(15,"withLoading"),a(16,"async")}if(i&2){let e,t=c,o=d();n(2),W(s(3,11,o.titleDictItem())),n(4),m("productImageNew",t.product.productImage)("productTitle",t.product.title)("renderEmptyImage",!0),n(),L(" ",t.product.title," "),n(2),$("aria-expanded",o.createNewListOpen()),n(),m("size","s-36")("icon",o.createNewListOpen()?"pwr-icon-delete":"pwr-icon-add"),n(),L(" ",s(12,13,"MyPower.Wishlist.CreateNewLists")," "),n(2),h(o.createNewListOpen()?13:-1),n(),h((e=s(16,17,s(15,15,o.wishlists$)))?14:-1,e)}}function tt(i,c){if(i&1){let e=b();r(0,"div",25)(1,"div",26)(2,"pwr-lib-button",27),a(3,"pwrbreakpoint"),a(4,"transloco"),w("buttonClick",function(){u(e);let o=d();return g(o.saveButtonClick())}),l()(),r(5,"div",28)(6,"pwr-lib-button",29),a(7,"pwrbreakpoint"),a(8,"transloco"),w("buttonClick",function(){u(e);let o=d();return g(o.navigateToWishlists())}),l()()()}i&2&&(n(2),m("fullWidth",!0)("size",s(3,8,"lt-sm")?"mini":"normal")("color","secondary")("text",s(4,10,"General.Ready")),n(4),m("fullWidth",!0)("size",s(7,12,"lt-sm")?"mini":"normal")("color","primary-light")("text",s(8,14,"MyPower.Wishlist.GoToWishlist")))}var Ue,qe,Qe,Ge,Pt,it=xe(()=>{Me();H();De();Pe();Se();We();Ne();ke();Le();Re();Te();$e();Fe();Ee();Ve();Ae();ze();Be();Ie();Oe();H();Ue=["dialogFooter"],qe=i=>({"g-spacer-mini":i}),Qe=i=>({"mb-spacer-basic":i}),Ge=(i,c)=>c.favoriteListId;Pt=(()=>{class i{constructor(){this.mediaMatchService=C(ge),this.router=C(ee),this.myPowerFavoritesService=C(pe),this.configuration=C(ie),this.destroyRef=C(E),this.dialogState=j.required(),this.dialogFooterRef=G("dialogFooter"),this.category=ce.Favorite,this.wishlists$=this.myPowerFavoritesService.favoriteLists$.pipe(S(e=>e.filter(t=>t.category===this.category)),T(1)),this.selectedDict$=te(N(()=>this.dialogState().data?.product.productId)).pipe(D(e=>e!=null),F(e=>this.myPowerFavoritesService.getSelectedDict$(e)),T(1)),this.isMobile$=this.mediaMatchService.isActive$("lt-sm"),this.newListNameField=new J("",{nonNullable:!0,validators:[Y.required],asyncValidators:[ye(this.wishlists$,void 0,this.configuration.SearchDebounceRate)]}),this.titleDictItem=N(()=>this.dialogState().data?.openedFromMyPower?"MyPower.Wishlist.MoveOrAddToWishlist":"MyPower.Wishlist.AddToWishlist"),this.createNewListOpen=v(!1),this.loading=v(!1),this.createListLoading=v(!1),this.newListSubmitted=v(!1),this.defaultListCreated=v(!1),this.toggleList=(e,t,o)=>{e.stopPropagation(),e.preventDefault();let p=this.dialogState().data;p&&(o?this.myPowerFavoritesService.removeProductFromFavoritesCache(this.category,t,p.product.productId):this.myPowerFavoritesService.addProductToFavoritesCache(this.category,t,p.product,p.details))},this.toggleDefaultList=e=>{e.stopPropagation(),e.preventDefault();let t=this.dialogState().data;!t||this.defaultListCreated()||this.loading()||(this.defaultListCreated.set(!0),this.loading.set(!0),this.myPowerFavoritesService.saveFavoriteList$(this.category).pipe(B(1),F(o=>o?(this.myPowerFavoritesService.addProductToFavoritesCache(this.category,o,t.product,t.details),this.wishlists$):P([])),M(this.destroyRef)).subscribe(()=>{this.loading.set(!1)}))},this.router.events.pipe(D(e=>e instanceof Z),M(this.destroyRef)).subscribe(()=>{this.dialogState().open&&this.close("navigation")})}close(e="closeButton"){this.dialogState.update(t=>V(O({},t),{open:!1,reason:e}))}toggleCreateNewList(){this.createNewListOpen.set(!this.createNewListOpen())}
1createList(){if(this.newListSubmitted.set(!0),this.createListLoading()||!this.newListNameField.valid&&this.newListNameField.errors)return;let e=this.dialogState().data;if(!e)return;this.createListLoading.set(!0);let t=this.newListNameField.value;this.myPowerFavoritesService.saveFavoriteList$(this.category,t).pipe(S(o=>o?(this.myPowerFavoritesService.addProductToFavoritesCache(this.category,o,e.product,e.details),o):P(void 0)),M(this.destroyRef)).subscribe(o=>{this.createListLoading.set(!1),o&&(this.newListNameField.reset(),this.newListSubmitted.set(!1),this.toggleCreateNewList())})}saveButtonClick(){this.close("Update")}navigateToWishlists(){this.router.navigate([he.MyPower,we.Wishlist])}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=I({type:i,selectors:[["pwr-my-power-wishlist-dialog"]],viewQuery:function(t,o){t&1&&U(o.dialogFooterRef,Ue,5),t&2&&q()},inputs:{dialogState:[1,"dialogState"]},outputs:{dialogState:"dialogStateChange"},decls:3,vars:1,consts:[["dialogFooter",""],[3,"closeOverlay"],[1,"bold","mb-spacer-basic"],["fxLayoutAlign","start center",1,"w-100-p","p-spacer-xmini","mb-spacer-large","border-radius-6","power-primary-50","power-primary-500-fg","strong"],[1,"h-60","w-60","border-radius-6","mr-spacer-xmini"],["sizes","(min-width: 768px) 60px, 45px",3,"productImageNew","productTitle","renderEmptyImage"],[1,"mb-spacer-basic"],["type","button","fxLayout","row","fxLayoutAlign","start center",1,"create-list-toggle","no-style","h5","strong","cursor-pointer","mb-spacer-basic","power-secondary-500-fg",3,"click"],[1,"mr-spacer-xmini",3,"size","icon"],["fxLayout","row","fxLayoutAlign","start center","fxLayout-lt-sm","column",1,"w-100-p",3,"class"],["fxLayout","row","fxLayoutAlign","start center","fxLayout-lt-sm","column",1,"w-100-p"],["fxFlex","","fxFlex-lt-sm","100"],[1,"w-100-p",3,"listName","submitted"],["fxFlex-lt-sm","100"],[1,"w-100-p"],[3,"loading","diameter"],["data-testid","add-to-new-list-button",3,"buttonClick","fullWidth","text","color","disabled"],["fxLayout","row","fxLayoutAlign","space-between stretch",1,"list-item","border","border-radius-6","text-body-1","mb-spacer-xmini","cursor-pointer","power-primary-100-border"],["fxLayout","row","fxLayoutAlign","space-between stretch",1,"list-item","border","border-radius-6","text-body-1","mb-spacer-xmini","cursor-pointer","power-primary-100-border",3,"click"],[1,"list-item-title"],[3,"type","inputLabel","checked"],[1,"list-items-count","min-w-24","h-24","subtitle-2","power-primary-300-bg","power-white-500-fg","mx-spacer-xmini","px-spacer-solo","border-radius-16"],["fxLayout","row","fxLayoutAlign","space-between stretch",1,"list-item","border","border-radius-6","text-body-1","mb-spacer-xmini","cursor-pointer",3,"class"],["fxLayout","row","fxLayoutAlign","space-between stretch",1,"list-item","border","border-radius-6","text-body-1","mb-spacer-xmini","cursor-pointer",3,"click"],["data-testid","add-to-list-checkbox",3,"type","inputLabel","checked"],["fxLayout","column","fxLayout-gt-xs","row","fxLayoutAlign","space-between center",1,"w-100-p","g-spacer-mini"],[1,"footer-button-save"],["data-testid","save-changes-button",3,"buttonClick","fullWidth","size","color","text"],[1,"footer-button-navigate"],[3,"buttonClick","fullWidth","size","color","text"]],template:function(t,o){if(t&1&&(_(0,et,17,19),R(1,tt,9,16,"ng-template",null,0,Q)),t&2){let p;h((p=o.dialogState().data)?0:-1,p)}},dependencies:[_e,ne,K,ae,re,se,de,fe,Ce,X,oe,ue,le,me],styles:[`@media screen and (max-width:599px){.footer-button-save[_ngcontent-%COMP%]{width:100%}}@media screen and (min-width:600px){.footer-button-save[_ngcontent-%COMP%]{width:50%}}@media screen and (max-width:599px){.footer-button-navigate[_ngcontent-%COMP%]{width:100%}}@media screen and (min-width:600px){.footer-button-navigate[_ngcontent-%COMP%]{min-width:50%}}.list-item[_ngcontent-%COMP%]{padding:12px 16px}.list-item[_ngcontent-%COMP%] pwr-lib-input[_ngcontent-%COMP%] label{padding-left:42px!important}.list-items-count[_ngcontent-%COMP%]{display:grid;text-align:center;align-items:center}.list-item-title[_ngcontent-%COMP%]{overflow-wrap:anywhere}.create-list-toggle[_ngcontent-%COMP%]:hover{text-decoration:underline}.create-list-toggle[_ngcontent-%COMP%]:hover .pwr-icon, .create-list-toggle[_ngcontent-%COMP%]:hover .pwr-icon:before{display:inline-block!important;text-decoration:none!important}
2/*# sourceMappingURL=my-power-wishlist-dialog.component-77M5DXUF.css.map */`],changeDetection:0})}}return i})()});it();export{Pt as MyPowerWishlistDialogComponent}; 3//# sourceMappingURL=chunk-ECIUIBMP.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.