1import{u as e,N as t,v as a,x as s,m as c,T as n,s as o,S as i,t as r,q as m,l as h,C as l,w as d}from"./2c1ab0fe.GMbxnz74.js";import{I as u,cC as p,cD as v,cE as g,cF as f,c as b,B as I,bt as x,o as y,cG as S,P as j,S as N,cH as k,cI as C,cJ as M,i as P,cK as L,cL as q,cM as V,cN as w,a as z,cO as T}from"./164ad2e3.BbIvMjRY.js";import{S as R,W as A,T as _,cu as E}from"./4c290a1e.C6TDJ9Fn.js";import{u as F}from"./9f047e05.CCJUgz_L.js";import{u as H,b as O,S as U}from"./ca5e9c49.BT49yYQL.js";import{g as Y}from"./app.CepNJbvh.js";import{u as B}from"./91319467.CaV5Q69j.js";import"./0a7dffce.DfUtZWCu.js";import"./5fda1420.KYpufQ--.js";import"./60a453ce.CkhHeRBc.js";import"./21cc90a2.DAzJmttM.js";import"./bb728e1c.iawBHR84.js";const K=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:74,height:74,...t,children:e("g",{children:e("path",{fill:"none",stroke:"#000",strokeLinecap:"round",d:"M2.68 16.1q.29-2.2 1.12-4.16m73.95.13a16.3 16.3 0 0 1 9.07-8.93m67.03 5.28a16.2 16.2 0 0 1 12.9-6.4h6.85m57.2 3.43a16 16 0 0 1 9.95-3.42h19.72m47.95 1.28a16 16 0 0 1 6.33-1.28h32.58m39.1.17a16 16 0 0 1 2.32-.17h36.5c3.14 0 6.08.9 8.56 2.44m30.87-2.44h34.57c7.74 0 14.21 5.42 15.83 12.67m27.79-12.67h30.38c8.95 0 16.22 7.26 16.22 16.22v9.36m31.59-25.58h26.19c8.95 0 16.22 7.26 16.22 16.22v22.23m35.78-38.45h22c8.95 0 16.22 7.26 16.22 16.22v35.1m39.97-51.32h17.8c8.96 0 16.23 7.26 16.23 16.22v36.49a16.2 16.2 0 0 1-3.94 10.6m48.1-63.31h13.62c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.62-6.72 15.66-15.2 16.19m63.55-68.9h9.43c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.96-7.27 16.22-16.22 16.22h-11.89M1012 2.03h5.25c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.96-7.27 16.22-16.22 16.22H992.5m97.7-68.93h1.05c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.96-7.27 16.22-16.22 16.22h-36.5q-.58 0-1.16-.04m114.85-68.58a16.2 16.2 0 0 1 13.03 15.9v36.5c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-12.37-5.73m130-61.55a16.2 16.2 0 0 1 9.09 14.57v36.49c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22V53.2M1323.89 6a16.2 16.2 0 0 1 5.58 12.25v36.49c0 8.96-7.26 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.22-16.22v-14.4m140.14-31.21a16 16 0 0 1 2.8 9.12v36.49c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22V27.47m142.02-14.59q.9 2.53.9 5.37v36.49c0 8.96-7.26 16.22-16.21 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22v-36.5q0-1.9.42-3.67m142.46 2.42q.04.62.05 1.26v36.49c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22v-36.5c0-5.86 3.1-11 7.77-13.84m135.16 16.82v33.52c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22v-36.5c0-8.94 7.26-16.2 16.22-16.2h4.05m122.66 23.36v29.34c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22v-36.5c0-8.94 7.26-16.2 16.22-16.2h16.91m109.8 27.56v25.14c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22v-36.5c0-8.94 7.26-16.2 16.22-16.2h29.78m96.93 31.75v20.95c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22v-36.5c0-8.94 7.26-16.2 16.22-16.2h36.49q3.23.02 6.05 1.17m84.17 34.77v16.76c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22v-36.5c0-8.94 7.26-16.2 16.22-16.2h36.49c6.77 0 12.57 4.15 15 10.04m75.22 30.09v12.57c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22v-36.5c0-8.94 7.26-16.2 16.22-16.2h36.49c8.96 0 16.22 7.26 16.22 16.22v6.57m74 21.53v8.38c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22v-36.5c0-8.94 7.26-16.2 16.22-16.2h36.49c8.96 0 16.22 7.26 16.22 16.22V37.7m74 12.85v4.19c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-16.21-16.22v-36.5c0-8.94 7.26-16.2 16.22-16.2h36.49c8.96 0 16.22 7.26 16.22 16.22v32.3m71.98 12.01c-2.76 5-8.09 8.39-14.2 8.39h-36.5a16.2 16.2 0 0 1-16.22-16.22v-36.5c0-8.94 7.27-16.2 16.22-16.2h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49m62.68 15.45a16 16 0 0 1-4.9.76h-36.5a16.2 16.2 0 0 1-16.22-16.22v-36.5c0-8.94 7.27-16.2 16.22-16.2h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49q-.01 2.2-.56 4.21m50.95 12h-29.1a16.2 16.2 0 0 1-16.24-16.22v-36.5a16.23 16.23 0 0 1 16.23-16.2h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49c0 2.94-.78 5.7-2.15 8.07m40.25 8.14h-16.82a16.2 16.2 0 0 1-16.22-16.22v-36.5c0-8.94 7.27-16.2 16.22-16.2h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49c0 4.45-1.8 8.48-4.7 11.4m30.5 4.81h-4.52a16.2 16.2 0 0 1-16.22-16.22v-36.5c0-8.94 7.27-16.2 16.22-16.2h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49a16.2 16.2 0 0 1-8 13.98m21.74.37a16.2 16.2 0 0 1-8.68-14.36v-36.5c0-8.94 7.27-16.2 16.22-16.2h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49c0 7.44-5.01 13.71-11.84 15.62m17.76-10.42a16 16 0 0 1-.86-5.21v-36.5c0-8.94 7.27-16.2 16.22-16.2h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.9-7.17 16.12-16.04 16.22m21.1-23.29V18.25c0-8.96 7.27-16.22 16.22-16.22h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.96-7.27 16.22-16.22 16.22h-4.02m25.3-35.57V18.25c0-8.96 7.27-16.22 16.22-16.22h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.96-7.27 16.22-16.22 16.22h-8.21m29.49-47.87v-4.84c0-8.96 7.27-16.22 16.22-16.22h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.96-7.27 16.22-16.22 16.22h-12.4M2890.24 11a16.2 16.2 0 0 1 14.51-8.97h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.96-7.27 16.22-16.22 16.22h-16.6m48.59-67.97a16 16 0 0 1 5.51-.96h36.5c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.96-7.27 16.22-16.22 16.22h-20.78m65.01-68.93h29.77c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.96-7.27 16.22-16.22 16.22h-24.97m81.5-68.93h17.47c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.96-7.27 16.22-16.22 16.22h-29.16m97.99-68.93h5.17c8.95 0 16.22 7.26 16.22 16.22v36.49c0 8.96-7.27 16.22-16.22 16.22h-33.35m114.3-67.37a16.2 16.2 0 0 1 9.26 14.66v36.49a16.2 16.2 0 0 1-16.21 16.22h-36.5q-.54 0-1.08-.04m126.73-58.49a16 16 0 0 1 1.07 5.82v36.49c0 8.96-7.27 16.22-16.22 16.22h-36.5q-2.74-.01-5.2-.85m131.92-45.46v30.09c0 8.96-7.27 16.22-16.22 16.22h-36.5c-3.31 0-6.4-1-8.96-2.7m135.68-31.31v17.79c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-12.12-5.46m138.84-16.26v5.5c0 8.96-7.27 16.22-16.22 16.22h-36.5a16.2 16.2 0 0 1-14.49-8.93m139.79-.64a16.2 16.2 0 0 1-14.8 9.57h-36.5c-7.8 0-14.32-5.51-15.87-12.86m132.48 11.67a16 16 0 0 1-6.11 1.19h-36.5a16.2 16.2 0 0 1-16.22-16.22v-.87m120.64 17.09h-30.42a16.2 16.2 0 0 1-16.22-16.22v-5.06m108.34 21.28h-18.12a16.2 16.2 0 0 1-16.22-16.22v-9.25m96.05 25.47h-5.83a16.2 16.2 0 0 1-16.22-16.22V41.3m83.87 28.37a16.2 16.2 0 0 1-9.87-14.93V37.1m75.32 24.05a16 16 0 0 1-1.32-6.41V32.91m74 16.08V28.72m74 7.98V24.52m74-.12v-4.06"})})}),G="_53CNx",W="OkK7Y",D="uh0AI",J="CoBFV",Q=t(function({index:t=0,logoUrl:a,shopName:s,loadingIndex:c=0,status:n}){const o=a?e(p,{src:a,alt:s,objectFit:"cover",borderRadius:"base",aspectRatio:"auto",className:"k7a1H"}):e(u,{type:"store",size:"large-100",tone:"monochrome"});return e(Z,"loading"===n&&c===t?{index:t,isLoading:c===t,children:o}:"submitted"===n?{index:t,isLoading:c===t,isSubmitted:!0,children:e(u,{type:"check",size:"large"})}:"failed"===n?{index:t,isLoading:c===t,isSubmitted:!0,children:e(u,{type:"alert-circle",size:"large"})}:"external"===n?{index:t,isSubmitted:!0,isExternal:!0,children:e(u,{type:"external",size:"large"})}:{index:t,children:void 0!==c&&t===c+2?null:o})});function Z({index:t,children:s,isLoading:c,isSubmitted:n,isExternal:o}){return e("div",{className:a("figGm",{[W]:c&&!o,[D]:!c,[G]:n,[J]:o}),style:{"--animation-index":t,inlineSize:66,blockSize:66}
1,children:[c&&e(K,{className:"YzKSW",role:"status","aria-label":"Loading"}),s]})}function $({remoteCheckouts:t}){const{i18n:r,shop:{id:m,name:h,remoteShopsConfigMap:l,brandSettings:d}}=R(),u=function(){const{shop:{id:e}}=R(),[t,a]=s("processing"),o=B();return c(()=>{const e=setTimeout(()=>{a("processed")},v);return()=>clearTimeout(e)},[]),n(()=>o.value?"processed"===t?{shopId:e,status:"submitted",remoteReceipt:{status:"processed"}}:{shopId:e,status:"submitting"}:null,[e,t,o.value])}(),p=function(e){const[t,a]=s(0),o=n(()=>e.slice(1).some(e=>"submitted"===e.status||"failed"===e.status),[e]);return c(()=>{if(t>=e.length)return;if(1===t&&!o)return;const s=setTimeout(()=>{a(e=>e+1)},v);return()=>clearTimeout(s)},[t,e.length,o]),n(()=>e.map((e,a)=>a===t?{shopId:e.shopId,status:"loading"}:a<t?"failed"===e.status?{shopId:e.shopId,status:"failed"}:"submitted"===e.status?{shopId:e.shopId,status:"submitted"}:{shopId:e.shopId,status:"loading"}:{shopId:e.shopId,status:"pending"}),[e,t])}(n(()=>[u,...t].filter(e=>null!==e),[u,t])),j=n(()=>p.findIndex(({status:e})=>"loading"===e),[p]),[N,k]=s(j),[C,M]=s("loading");c(()=>{m&&setTimeout(()=>{M("submitted")},v)},[m]),c(()=>{-1!==j&&"submitted"===C&&setTimeout(()=>{k(j)},g)},[j,C]);const P=n(()=>-1===N?0:`calc(50% - ${N*(f+S)+f/1.75}px)`,[N]),L=o(e=>{const t=l?.get(e);return t?.name},[l]);return e(i,{children:[e("div",{className:a("PjFjd"),style:{"--translate-offset":P},children:e(b,{direction:"inline",gap:"base",alignItems:"start",justifyContent:"center",className:a("u3j3z"),children:p.map(({shopId:t,status:a},s)=>{if(t===m)return e(Q,{index:s,loadingIndex:N,shopName:h,status:C,logoUrl:d?.squareLogo?.url},t);const c=l?.get(t);return e(Q,c?{index:s,loadingIndex:N,logoUrl:c.brandSettings?.squareLogo?.url,shopName:c.name,status:a}:{index:s,loadingIndex:N,status:a},t)})})}),e(I,{className:"Lam8Z",children:[e(x,{children:e(y,{type:"generic",children:function(){if(-1===N)return null;const e=p[N]?.shopId;return e===m?h:L(e??"")}()})}),e(y,{type:"small",color:"subdued",children:r.translate("general.autocomplete_selection",{number:N+1,total:p.length})})]})]})}function X({receipt:t,message:a}){return e(b,"processing_remote_checkouts"===t?.status?{alignItems:"center",gap:"large-500",children:[e(j,{textAlign:"center",children:a}),e($,{remoteCheckouts:t.remoteCheckouts})]}:"processed"===t?.status&&t?.completedRemoteCheckouts?.length?{alignItems:"center",gap:"large-500",children:[e(j,{textAlign:"center",children:a}),e($,{remoteCheckouts:t.completedRemoteCheckouts})]}:{alignItems:"center",gap:"large-200",children:[e(I,{maxInlineSize:"64px",children:e(N,{size:"fill"})}),e(j,{textAlign:"center",children:a})]})}function ee(){const{paymentLines:t}=A(),{paymentMethods:a}=_(),{checkout:s,observability:n,shopPay:o}=R(),i=s.latestReceipt.value,u=r(()=>w(a.value,t.value)),p=m(!1),v=k(),g=C({isModalRendered:p,modalPaymentMethodConfig:u}),f=i?.id,b=Y(o),I=h(new Set);c(()=>{v()},[f]);const x=M();c(()=>{i&&"processed"===i.status&&!I.current.has(i.id)&&function(e,t,a){const s=e.purchaseOrder?.paymentLines;if(!s||0===s.length||"SHOPIFY_INSTALLMENTS"!==t)return!1;for(const c of s){const e=c?.method;if(!e||"wallet"!==e.type||"SHOP_PAY"!==e.name)continue;a.leaveErrorBreadcrumb("Installments selected but receipt used Shop Pay",{selectedPaymentMethodName:t,receiptPaymentMethodName:e.name});const n=new T("User selected Installments but Shop Pay is used");return a.error(n,{metadata:{checkout:{paymentLineCount:s.length,selectedPaymentMethodName:t,receiptPaymentMethodName:e.name}}}),!0}return!1}(i,b,n)&&I.current.add(i.id)},[n,i,b]);const{progress:y}=P();return H({stage:U.Complete,id:"Processing"}),O("Processing"),F("processing"),c(()=>{y("processing-page-auto-progress")},[y,n]),l(()=>z({content:g.value,role:"alert"})),e(E,{children:[e(d,{when:x,fallback:e(q,{}),children:e(L,{})}),e(V,{modalPaymentMethodConfig:u,onModalRender:()=>{p.value=!0}}),e(X,{receipt:i,message:g})]})}export{ee 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.