PageSourceSearch

https://shop.rvappstudios.com/cdn/shopifycloud/checkout-web/assets/c1/page-StockProblems.C2yEQo7e.js

js rvappstudios.com collected 2026-09-24 09:37:22 UTC 7,551 bytes, 1 lines download raw bytes

1import{T,k as ue,q as v,h as W,u as e}from"./esnext-vendor.D7ldIee_.js";import{N as de,bp as pe,bo as he,br as me,i as G,j as be,k as P,I as V,l as g,m as ge,bs as _e,D as fe,C as ye,n as ke,P as ve,o as Pe,R as Le,$ as Ie,as as Ue,ap as Me,aq as w,ai as a,ar as Se,am as Ce,aj as x,an as Te,ao as we,L as xe,p as Ae,O as Oe,ab as qe,G as Be}from"./hydrate.ByRIsqvd.js";import{T as Re}from"./stopwatch.wWgdKLTI.js";import{N as X,$ as J,bb as Ee,a0 as De,O as Ne,aQ as Fe,ad as He,cJ as Qe,cK as $e,bx as ze,aR as je,by as We}from"./addresses-is-address-empty.-MuOhIyI.js";import{U as Ge}from"./embed-deferred.9gwgYB2W.js";import{u as Je,S as K}from"./components-RedirectionNotice.module.CqgkZHXB.js";import{u as Ke,N as Ve}from"./stock-problems-useStockProblemsState.CP-sNfHY.js";import"./app.A60-IfPs.js";import"./constants.DowbVE6J.js";import"./hooks-useReplaceShopPayInHistory.Cz4PqGkk.js";function ut(){const{i18n:t,observability:c,shop:A,url:O,source:Y,router:L,embed:I}=X(),{value:q}=J().allViolations,{value:B}=J().merchandiseLines,R=Ee("merchandiseLines").value,{progress:U}=De(),{previousPage:Z}=de(),p=Ne().merchandiseLines,E=pe(),i=Ke(),u=i.type,{value:D}=Fe();He("stock_problems");const M=T(()=>B?.lines??[],[B]),[_]=ue(p.peek()),h=Qe(_,q),d=$e(_,M,q),ee=Y.type==="draftOrder",f=ze(I?.embedder),{hasStorefront:S}=A,{isAppLayout:N}=he(),m=i.cartEmpty,te=m||!_?0:_.length,ae=S||te>1,F=T(()=>M.reduce((o,n)=>({...o,[n.stableId]:n}),{}),[M]),y=v(({removeUnavailableMerchandise:o=!1}={})=>{const n=p.value,r=n.flatMap(s=>{const l=F[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)},[F,p,h]),ne=v(()=>{We(I,Ge)},[I]),re=v(()=>{y({removeUnavailableMerchandise:!0}),U("stock-problems-submit")},[U,y]),H=me(),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),U("stock-problems-remove-item")};W(()=>{E.notify({checkout_in_progress:!1})},[E]),Je({stage:R?K.Loading:K.Complete,id:"StockProblems"}),W(()=>{let o=L.currentUrl.value;return L.currentUrl.subscribe(n=>{o!==n&&(o=n,y())})},[L,y]);const Q=T(()=>u===a.Unfulfillable?je([...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()}},$=S&&!(N&&m)||f?e(be,{children:e(G,{variant:"primary",size:"large",inlineSize:"fill",onClick:m&&f?ne:re,loading:R,children:ee||m&&!f?t.translate("stock.return_to_store_label"):t.translate("general.continue_button_label")})}):null,z=S&&Z.route&&!N&&!m&&!f?e(ge,{children:e(G,{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(Oe,{section:"stock-problems",children:[e(Re,{children:C()}),e(_e,{message:j(),errorType:fe.InventoryError,children:e(P,{gap:"large-500",children:[e(ye,{status:"warning",children:[e(ke,{children:ie()}),e(ve,{color:"subdued",children:j()})]}),e(Pe,{children:[d.length>0&&i.showLineItems?e(Le,{children:e(Ie,{children:e(Ue,{titleHidden:!0,border:"outer",spacing:"none",title:oe(),children:[e(Me,{blockPadding:"base",children:[e(w,{hidden:!0,children:t.translate("order_summary.product_image_label")}),e(w,{primary:!0,children:e(g,{type:"strong",children:t.translate("order_summary.description_label")})}),e(w,{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(Se,{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(Ce,{spacing:"base",blockPadding:"base",children:[e(x,{children:e(Te,{src:b?.one,srcSet:b?`${b.one} 1x, ${b.two} 2x, ${b.four} 4x`:void 0,alt:b?.altText})}),e(x,{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(x,{noWrap:!0,children:l!=null&&l>0&&!h.has(k)?e(P,{alignItems:"end",gap:"small-400",children:[e(Ye,{quantity:l,previousQuantity:s??0}),ae?e(xe,{id:`remove-${k}`,onClick:()=>le(k),children:t.translate("stock.remove")}):null]}):e(Xe,{merchandiseIssueType:u})})]},k)})})]})})}):null,$||z?e(Ae,{children:[$,z]}):null]})]})})]})}function Xe({merchandiseIssueType:t}){const{i18n:c}=X();return e(Be,{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(qe,{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 Ye({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{ut 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.