1import{a as Q}from"./chunk-NZVCVNOA.js";import{a as X}from"./chunk-IJLIAJ5L.js";import{a as K}from"./chunk-IU55SDP3.js";import{d as $}from"./chunk-HL7BJZV6.js";import{b as z}from"./chunk-BUAPEGGQ.js";import{c as R,d as F,e as U,n as W,o as H,p as G,q as J}from"./chunk-4RIR7WXT.js";import{e as q}from"./chunk-A6TC6UF3.js";import{k as j}from"./chunk-U7C2VJFE.js";import{j as N,t as B}from"./chunk-REJHG727.js";import{$b as u,Mc as l,Nc as A,Oc as b,Pc as _,ac as p,bc as O,cb as w,dc as P,ec as E,fc as m,gc as i,ha as h,hb as n,hc as o,hd as x,ic as s,id as C,jd as L,mb as y,na as f,oa as g,pc as S,vc as v,xc as a,zb as D}from"./chunk-DQAZAY3R.js";function it(e,r){if(e&1&&(i(0,"p",6)(1,"span",15),l(2),o()()),e&2){let t=r.$implicit;n(2),_(" ",t==null||t.option==null?null:t.option.name,": ",t==null||t.values[0]==null?null:t.values[0].name," ")}}function ot(e,r){if(e&1&&P(0,it,3,2,"p",6,O),e&2){let t=a(2);E(t.variantOptions)}}function at(e,r){if(e&1&&(i(0,"p",6)(1,"span",15),l(2),x(3,"translate"),o()()),e&2){let t=a(2);n(2),_(" ",C(3,2,"productDetails.brand"),": ",t.lang()=="en"?t.product==null||t.product.brand==null?null:t.product.brand.name:t.product==null||t.product.brand==null?null:t.product.brand.name_ar," ")}}function rt(e,r){if(e&1&&l(0),e&2){let t=a(3);_(" ",t.embryoService.getStepDisplayValue(t.product)," ",t.embryoService.getStepLabel(t.product)," ")}}function lt(e,r){if(e&1&&l(0),e&2){let t=a(3);b(" ",t.product==null?null:t.product.amount," ")}}function ct(e,r){if(e&1&&(i(0,"p",6)(1,"span",15),l(2),x(3,"translate"),u(4,rt,1,2)(5,lt,1,1),o()()),e&2){let t=a(2);n(2),b(" ",C(3,2,"productDetails.quantity"),": "),n(2),p(t.product!=null&&t.product.enable_step_package?4:5)}}function ut(e,r){if(e&1&&(i(0,"p",9)(1,"span",16),l(2),x(3,"translate"),x(4,"number"),s(5,"app-currency"),o()()),e&2){let t=a(2);m("hidden",(t.product==null?null:t.product.commission_amount)==0||(t.product==null?null:t.product.commission_amount)==null),n(),m("ngClass",t.lang()=="ar"?"arabic-currency":""),n(),_(" ",C(3,4,"orders.commission")," : ",L(4,6,t.product==null?null:t.product.commission_amount,"1.2-2")," ")}}function pt(e,r){if(e&1){let t=S();i(0,"button",17),v("click",function(){f(t);let c=a(2);return g(c.onRemove())}),i(1,"mat-icon",13),l(2,"delete"),o()()}}function dt(e,r){if(e&1){let t=S();i(0,"div",0)(1,"div",2),v("click",function(){f(t);let c=a();return g(c.onImageClick())}),i(2,"a",3),v("click",function(){f(t);let c=a();return g(c.fireSelectItem())}),s(3,"img",4),o()(),i(4,"div",5)(5,"h6",6)(6,"a",7),v("click",function(){f(t);let c=a();return g(c.fireSelectItem())}),l(7),o()(),s(8,"app-product-price",8),u(9,ot,2,0),u(10,at,4,4,"p",6),u(11,ct,6,4,"p",6),u(12,ut,6,9,"p",9),s(13,"app-cart-stock-validation-errors",10),o(),i(14,"div",11)(15,"button",12),v("click",function(){f(t);let c=a();return g(c.onEdit())}),i(16,"mat-icon",13),l(17,"edit"),o()(),u(18,pt,3,0,"button",14),o()()}if(e&2){let t=a();m("dir",t.lang()==="en"?"ltr":"rtl"),n(2),m("routerLink",t.productLink),n(),m("src",t.product==null?null:t.product.image,w)("alt",t.imageAlt),n(3),m("routerLink",t.productLink),n(),b(" ",t.localizedName," "),n(),m("price",t.product==null?null:t.product.price)("discountPrice",t.product==null?null:t.product.discount_price)("inStock",!0)("showVat",!0)("showPaymentTooltip",!1),n(),p(t.environmentVariables!=null&&t.environmentVariables.SHOW_PRODUCT_VARIANTS_OPTIONS&&t.variantOptions.length>0?9:-1),n(),p(t.product!=null&&t.product.brand&&(t.environmentVariables!=null&&t.environmentVariables.SHOW_BRAND_ON_PRODUCT)?10:-1),n(),p(t.product!=null&&t.product.amount?11:-1),n(),p(t.isAffiliate?12:-1),n(),m("product",t.product),n(2),m("routerLink",t.cartLink),n(3),p(t.showDeleteButton?18:-1)}}function mt(e,r){if(e&1&&(i(0,"span"),l(1),x(2,"translate"),o()),e&2){let t=a(3);n(),_("",C(2,2,"productDetails.quantity"),": ",t.product==null?null:t.product.amount)}}function st(e,r){if(e&1&&u(0,mt,3,4,"span"),e&2){let t=a(2);p(t.product!=null&&t.product.amount?0:-1)}}function _t(e,r){if(e&1&&(i(0,"span"),l(1),o()),e&2){let t=a(2);n(),_(" ",t.embryoService.getStepDisplayValue(t.product)," ",t.embryoService.getStepLabel(t.product)," ")}}function xt(e,r){if(e&1&&(i(0,"span"),s(1,"br"),l(2),o()),e&2){let t=r.$implicit;n(2),_(" ",t==null||t.option==null?null:t.option.name,": ",t==null||t.values[0]==null?null:t.values[0].name," ")}}function Ct(e,r){if(e&1&&P(0,xt,3,2,"span",null,O),e&2){let t=a(2);E(t.product==null?null:t.product.product_variants_options)}}function ft(e,r){if(e&1&&(s(0,"br"),i(1,"span"),l(2),x(3,"translate"),o()),e&2){let t=a(2);n(2),_(" ",C(3,2,"productDetails.brand"),": ",t.lang()=="en"?t.product==null||t.product.brand==null?null:t.product.brand.name:t.product==null||t.product.brand==null?null:t.product.brand.name_ar," ")}}function gt(e,r){e&1&&(i(0,"p",23),l(1),x(2,"translate"),o()),e&2&&(n(),b(" ",C(2,1,"orders.outOfStock")," "))}function vt(e,r){e&1&&(i(0,"p",23),l(1),x(2,"translate"),o()),e&2&&(n(),b(" ",C(2,1,"orders.notAvailable")," "))}function ht(e,r){if(e&1){let t=S();i(0,"a",3),v("click",function(){f(t);let c=a(2);return g(c.onEdit())}),i(1,"mat-icon",13),l(2,"edit"),o()()}if(e&2){let t=a(2);m("routerLink",t.cartLink)}}function bt(e,r){if(e&1&&(i(0,"div",1)(1,"div",18),s(2,"img",19),o(),i(3,"div",20)(4,"h6",21),l(5),o(),i(6,"p",6),u(7,st,1,1),u(8,_t,2,2,"span"),u(9,Ct,2,0),u(10,ft,4,4),s(11,"br")(12,"app-product-price",22),o(),u(13,gt,3,3,"p",23),u(14,vt,3,3,"p",23),o(),i(15,"div",24),u(16,ht,3,1,"a",25),o()()),e&2){let t=a();n(2),m("src",t.product==null?null:t.product.image,w)("alt",t.imageAlt),n(3),A(t.localizedName),n(2),p(t.product!=null&&t.product.enable_step_package?-1:7),n(),p(t.product!=null&&t.product.enable_step_package?8:-1),n(),p(t.environmentVariables!=null&&t.environmentVariables.SHOW_PRODUCT_VARIANTS_OPTIONS&&(t.product==null||t.product.product_variants_options==null?null:t.product.product_variants_options.length)>0?9:-1),n(),p(!(t.product==null||t.product.brand==null)&&t.product.brand.name&&(t.environmentVariables!=null&&t.environmentVariables.SHOW_BRAND_ON_PRODUCT)?10:-1),n(2),m("price",t.product==null?null:t.product.price)("discountPrice",t.product==null?null:t.product.discount_price)("exclusivePrice",t.product==null?null:t.product.exclusive_price)("isExclusive",t.isExclusive)("forceStrikethrough",t.forceStrikethrough)("inStock",!0)("paymentDiscountNameEn",t.product==null?null:t.product.payment_methods_discount_name_en)("paymentDiscountNameAr",t.product==null?null:t.product.payment_methods_discount_name_ar)("showLabels",!0)("showCommission",t.isAffiliate)("commissionAmount",t.product==null?null:t.product.commission_amount),n(),p(t.isOutOfStock?13:-1),n(),p(t.isNotAvailable?14:-1),n(2),p(t.product!=null&&t.product.in_stock&&(t.product!=null&&t.product.active)?16:-1)}}var Ft=(()=>{class e{product;index=0;variant="header";isAffiliate=!1;showDeleteButton=!0;isExclusive=!1;forceStrikethrough=!1;
1remove=new y;editClick=new y;imageClick=new y;lang=h(J).currentLanguage;embryoService=h(G);marketingService=h(H);windowService=h(W);environmentVariables;constructor(){h(q).getenvConfig().subscribe(t=>{this.environmentVariables=t})}get productLink(){let t=this.lang()==="en"?this.product?.slug:this.product?.slug_ar||this.product?.slug;return["/"+this.lang()+"/"+t]}get localizedName(){return this.product?.name_en||this.product?.name_ar?this.lang()==="en"?this.product?.name_en:this.product?.name_ar:this.product?.name||""}get imageAlt(){return this.lang()==="en"?this.product?.alt||"cart image":this.product?.alt_ar||this.product?.alt||"cart image"}get variantOptions(){return this.product?.product_variants_options||this.product?.options||[]}get cartLink(){return["/"+this.lang()+"/cart"]}get priceSize(){return this.variant==="checkout"?"checkout":"xs"}get isOutOfStock(){return(!this.product?.in_stock||this.product?.stock===0||this.product?.amount>this.product?.stock)&&this.product?.active&&this.product?.stock!==null}get isNotAvailable(){return!this.product?.active||this.product?.stock===null}onEdit(){this.editClick.emit()}onRemove(){this.remove.emit({product:this.product,index:this.index})}onImageClick(){this.imageClick.emit()}fireSelectItem(){if(!this.product)return;let t=this.product,d=this.lang(),c=d==="en"?this.environmentVariables?.localization?.currency_code_en:this.environmentVariables?.localization?.currency_code_ar,Y=this.windowService.getWindow()?.location?.origin||"",T=d==="en"?t.slug:t.slug_ar||t.slug,I=t.price||0,V=t.discount_price?t.discount_price:I,Z=t.discount_price?Number((I-V).toFixed(2)):0,tt={item_id:t.sku||null,item_name:(d==="en"?t.name_en:t.name_ar)||t.name||null,item_brand:t.brand?.name||t.details?.brand?.name||null,price:Number(V.toFixed(2)),shelf_price:Number(I.toFixed(2)),discount:Z,quantity:t.amount||null,currency:c||null,item_availability:t.in_stock?"available":"unavailable",is_rx_medication:t.need_prescription===1,item_image_link:t.image||null,item_link:T?Y+"/"+d+"/"+T:null,coupon:this.marketingService.resolveProductCoupon(t,d)},et=Object.fromEntries(Object.entries(tt).filter(([nt,k])=>k!=null)),M=Object.fromEntries(Object.entries({currency:c||null}).filter(([nt,k])=>k!=null));M.items=[et],this.marketingService.dataLayerDynamicEvent("select_item",{ecommerce:M})}static \u0275fac=function(d){return new(d||e)};static \u0275cmp=D({type:e,selectors:[["app-cart-item"]],inputs:{product:"product",index:"index",variant:"variant",isAffiliate:"isAffiliate",showDeleteButton:"showDeleteButton",isExclusive:"isExclusive",forceStrikethrough:"forceStrikethrough"},outputs:{remove:"remove",editClick:"editClick",imageClick:"imageClick"},decls:2,vars:2,consts:[[1,"cart-item-row","fx-layout-row","align-items-center",3,"dir"],[1,"cart-item-row","d-flex","align-items-center"],[1,"fx-flex-25",3,"click"],[3,"click","routerLink"],["loading","lazy","onError","this.src='./assets/images/placeholder200.jpg';","default","./assets/images/placeholder200.jpg","width","60","title","cart-image",2,"outline","none","max-height","150px",3,"src","alt"],[1,"fx-flex-75","px-2"],[1,"mb-0"],[1,"no-outline","product-name",3,"click","routerLink"],["size","xs",3,"price","discountPrice","inStock","showVat","showPaymentTooltip"],[1,"mb-0",3,"hidden"],[3,"product"],[1,"fx-flex-35","cart-menu-action"],["mat-mini-fab","","color","primary",1,"bg-secondary",3,"click","routerLink"],[1,"material-icons"],["mat-mini-fab","","color","primary",1,"bg-danger"],[1,"quantity"],[1,"commission-amount",3,"ngClass"],["mat-mini-fab","","color","primary",1,"bg-danger",3,"click"],[1,"fx-flex-25"],["loading","lazy","onError","this.src='./assets/images/placeholder200.jpg';","default","./assets/images/placeholder200.jpg","width","80","title","cart img",2,"max-height","150px",3,"src","alt"],[1,"fx-flex-55","px-3"],[1,"mb-1"],["numberFormat","1.2-2","size","checkout",3,"price","discountPrice","exclusivePrice","isExclusive","forceStrikethrough","inStock","paymentDiscountNameEn","paymentDiscountNameAr","showLabels","showCommission","commissionAmount"],["translate","",1,"mat-cell","text-primary"],[1,"side-cart-actions","fx-flex-20","d-flex","justify-content-end","px-2"],[3,"routerLink"]],template:function(d,c){d&1&&(u(0,dt,19,18,"div",0),u(1,bt,17,21,"div",1)),d&2&&(p(c.variant==="header"?0:-1),n(),p(c.variant==="checkout"?1:-1))},dependencies:[N,j,$,z,U,R,K,Q,X,B,F],styles:[".fx-flex-25[_ngcontent-%COMP%]{flex:0 0 25%;max-width:25%}.fx-flex-35[_ngcontent-%COMP%]{flex:0 0 35%;max-width:35%}.fx-flex-55[_ngcontent-%COMP%]{flex:0 0 55%;max-width:55%}.fx-flex-75[_ngcontent-%COMP%]{flex:0 0 75%;max-width:75%}.fx-flex-20[_ngcontent-%COMP%]{flex:0 0 20%;max-width:20%}.fx-layout-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.quantity[_ngcontent-%COMP%]{font-size:15px;font-weight:400}.bg-secondary[_ngcontent-%COMP%]{background-color:#43505b!important}.bg-danger[_ngcontent-%COMP%]{background-color:#d41313!important}.cart-menu-action[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:4px}.cart-menu-action[_ngcontent-%COMP%] button[mat-mini-fab][_ngcontent-%COMP%]{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;border-radius:50%!important;padding:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;box-shadow:none}.cart-menu-action[_ngcontent-%COMP%] button[mat-mini-fab][_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin:0;font-size:18px;line-height:1}
1#ar[_nghost-%COMP%] .cart-menu-action[_ngcontent-%COMP%], #ar [_nghost-%COMP%] .cart-menu-action[_ngcontent-%COMP%]{left:15px;right:auto}.side-cart-actions[_ngcontent-%COMP%]{margin-inline-start:auto;display:flex;align-items:center;justify-content:flex-end}.text-primary[_ngcontent-%COMP%]{color:var(--brand-color)}"]})}return e})();export{Ft as a};
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.