PageSourceSearch

https://montaleparfums.us/cdn/shopifycloud/checkout-web/assets/c1/page-StockProblems.CzS0HUCC.js

js montaleparfums.us collected 2026-09-29 23:32:11 UTC 7,597 bytes, 1 lines download raw bytes

1import{T as w,k as ue,q as v,h as W,u as e}from"./esnext-vendor.7EcvH7tF.js";import{f as de,K as pe,bt as he,M as me,c8 as be,c9 as ge,bs as fe,bv as _e,j as K,k as P,I as V,l as g,bw as ye,A as ke,m as ve,P as Pe,$ as Le,ao as Ie,al as Me,am as A,ae as a,an as Ue,ai as Se,af as T,aj as Ce,ak as we,L as Ae,N as Te,as as xe,a8 as Oe,y as qe}from"./hydrate.DbBIWEk-.js";import{C as Be}from"./OffsitePaymentFailed.DzjWrdFl.js";import{u as Re,P as Ee,a as De,b as Fe,d as Ne,c as He,S as G}from"./Page.Coo-tm2O.js";import{Q as Z,a2 as J,bi as Qe,S as ze,aZ as $e,bC as je,ab as We,bD as Ke}from"./utilities-previous.C42MP_Mw.js";import{U as Ge}from"./embed-deferred.DJppVBW7.js";import{u as Je,N as Ve}from"./stock-problems-useStockProblemsState.BX8fKOOI.js";import"./app.DklQzmA_.js";import"./shared-negotiation-input-redeemable.Bd3YWCwY.js";import"./shared-permissions.DaHnWepz.js";import"./hooks-useShopPayExternalAppContext.CJygX3OQ.js";function dt(){const{i18n:t,observability:c,shop:x,url:O,source:X,router:L,embed:I}=Z(),{value:q}=J().allViolations,{value:B}=J().merchandiseLines,R=Qe("merchandiseLines").value,{progress:M}=de(),{previousPage:Y}=pe(),p=ze().merchandiseLines,E=he(),i=Je(),u=i.type,{value:D}=$e();me("stock_problems");const U=w(()=>B?.lines??[],[B]),[f]=ue(p.peek()),h=be(f,q),d=ge(f,U,q),ee=X.type==="draftOrder",_=je(I?.embedder),{hasStorefront:S}=x,{isAppLayout:F}=fe(),m=i.cartEmpty,te=m||!f?0:f.length,ae=S||te>1,N=w(()=>U.reduce((o,n)=>({...o,[n.stableId]:n}),{}),[U]),y=v(({removeUnavailableMerchandise:o=!1}={})=>{const n=p.value,r=n.flatMap(s=>{const l=N[s.stableId];return o&&(!l||l.quantity===0||h.has(s.stableId))?[]:!l||l.quantity===0||h.has(s.stableId)?[s]:s.quantity===l.quantity&&s.totalPrice===l.totalPrice?[s]:[{...s,quantity:l.quantity,totalPrice:l.totalPrice}]});r.length===n.length&&r.every((s,l)=>s===n[l])||(p.value=r)},[N,p,h]),ne=v(()=>{Ke(I,Ge)},[I]),re=v(()=>{y({removeUnavailableMerchandise:!0}),M("stock-problems-submit")},[M,y]),H=_e(),se=v(async()=>{await H(i.lineItems),window.location.replace(O.cart())},[H,i.lineItems,O]),le=o=>{const n=p.peek();p.value=n.filter(({stableId:r,quantity:s})=>r!==o&&s>0),M("stock-problems-remove-item")};W(()=>{E.notify({checkout_in_progress:!1})},[E]),Re({stage:R?G.Loading:G.Complete,id:"StockProblems"}),W(()=>{let o=L.currentUrl.value;return L.currentUrl.subscribe(n=>{o!==n&&(o=n,y())})},[L,y]);const Q=w(()=>u===a.Unfulfillable?xe([...h],D):null,[D,u,h]),C=()=>{if(!i.showLineItems)return i.title;switch(u){case a.Unavailable:return t.translate("contextual_availability.title",{count:d.length});case a.UnpurchasableB2B:return t.translate("stock.unpurchasable_product.title");case a.Unpurchasable:return t.translate("stock.unpurchasable_product_generic.title");case a.QuantityChange:return t.translate("stock.quantity_update.title");case a.Unshippable:return t.translate("stock.unshippable_product.title");case a.Unfulfillable:return t.translate("stock.unfulfillable_product.title");default:return t.translate("stock.title")}},ie=()=>{if(!i.showLineItems)return i.title;switch(u){case a.UnpurchasableB2B:return t.translate("stock.unpurchasable_product.header");case a.Unpurchasable:return t.translate("stock.unpurchasable_product_generic.header");case a.Unshippable:return t.translate("stock.unshippable_product.header",{count:d.length});case a.Unfulfillable:return t.translate("stock.unfulfillable_product.title");default:return C()}},z=S&&!(F&&m)||_?e(Ee,{children:e(K,{variant:"primary",size:"large",inlineSize:"fill",onClick:m&&_?ne:re,loading:R,children:ee||m&&!_?t.translate("stock.return_to_store_label"):t.translate("general.continue_button_label")})}):null,$=S&&Y.route&&!F&&!m&&!_?e(De,{children:e(K,{onClick:async()=>{await se()},variant:"plain",inlineSize:"fill",textDecoration:"none",children:e(P,{direction:"inline",gap:"small-200",alignItems:"center",children:[e(V,{type:"chevron-left",size:"small"}),e(g,{children:t.translate("general.back_to_cart")})]})})}):null,j=()=>{if(!i.showLineItems)return i.subtitle;switch(u){case a.Unavailable:return m?t.translate("contextual_availability.all_products_in_cart_unavailable",{count:d.length}):t.translate("contextual_availability.products_not_available",{count:d.length});case a.UnpurchasableB2B:return t.translate("stock.unpurchasable_product.message");case a.Unpurchasable:return t.translate("stock.unpurchasable_product_generic.message");case a.QuantityChange:return t.translate("stock.quantity_update.description");case a.Unshippable:return t.translate("stock.unshippable_product.message",{count:d.length});case a.Unfulfillable:return Q?t.translate("stock.unfulfillable_product.message",{delivery_method:Q,count:d.length}):(c.error(new Ve),t.translate("stock.unfulfillable_product.default_message",{count:d.length}));default:return t.translate("stock.items_unavailable_notice")}},oe=()=>u===a.QuantityChange?t.translate("stock.quantity_update.page_title"):C();return e(Te,{section:"stock-problems",children:[e(We,{children:C()}),e(ye,{message:j(),errorType:ke.InventoryError,children:e(P,{gap:"large-500",children:[e(Be,{status:"warning",children:[e(ve,{children:ie()}),e(Pe,{color:"subdued",children:j()})]}),e(Fe,{children:[d.length>0&&i.showLineItems?e(Ne,{children:e(Le,{children:e(Ie,{titleHidden:!0,border:"outer",spacing:"none",title:oe(),children:[e(Me,{blockPadding:"base",children:[e(A,{hidden:!0,children:t.translate("order_summary.product_image_label")}),e(A,{primary:!0,children:e(g,{type:"strong",children:t.translate("order_summary.description_label")})}),e(A,{hidden:u!==a.OutOfStock,children:e(g,{type:"strong",children:u===a.OutOfStock?t.translate("order_summary.quantity_label"):t.translate("order_summary.description_label")})})]}),e(Ue,{children:d.map(({proposed:o,negotiated:n})=>{const r=n??o,s=o?.quantity,l=n?.quantity,{stableId:k,image:b,title:ce}=r;return e(Se,{spacing:"base",blockPadding:"base",children:[e(T,{children:e(Ce,{src:b?.one,srcSet:b?`${b.one} 1x, ${b.two} 2x, ${b.four} 4x`:void 0,alt:b?.altText})}),e(T,{primary:!0,children:e(we,{id:null,deferredAmount:r.deferredAmount,options:r.options,properties:r.properties,recurringTotal:r.recurringTotal,sellingPlan:r.sellingPlan,subtitle:r.subtitle,title:ce,totalPrice:r.totalPrice})}),e(T,{noWrap:!0,children:l!=null&&l>0&&!h.has(k)?e(P,{alignItems:"end",gap:"small-400",children:[e(Xe,{quantity:l,previousQuantity:s??0}),ae?e(Ae,{id:`remove-${k}`,onClick:()=>le(k),children:t.translate("stock.remove")}):null]}):e(Ze,{merchandiseIssueType:u})})]},k)})})]})})}):null,z||$?e(He,{children:[z,$]}):null]})]})})]})}function Ze({merchandiseIssueType:t}){const{i18n:c}=Z();return e(qe,{gridAutoFlow:"column",gridAutoColumns:"minmax(auto, max-content)",gridTemplateColumns:"minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-400",alignItems:"center",alignContent:"center",children:[e(V,{type:"disabled",tone:"critical",size:"small"}),e(Oe,{children:(()=>{switch(t){case a.Unfulfillable:case a.Unavailable:return c.translate("contextual_availability.unavailable_label");case a.UnpurchasableB2B:return c.translate("stock.unpurchasable_product.status_column_header");case a.Unpurchasable:return c.translate("stock.unpurchasable_product_generic.status_column_header");case a.Unshippable:return c.translate("stock.unshippable_product.status_column_header");default:return c.translate("stock.sold_out_label")}})()})]})}function Xe({quantity:t,previousQuantity:c}){return e(P,{direction:"inline",gap:"small-200",children:[e(g,{color:"subdued",children:c}),e(g,{color:"subdued",children:"→"}),e(g,{type:"strong",children:t})]})}
1export{dt as default};

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.