PageSourceSearch

https://www.youngla.com/cdn/shopifycloud/checkout-web/assets/c1/ShippingMethodSelector.DcVyvGiN.js

js youngla.com collected 2026-09-25 18:55:22 UTC 7,287 bytes, 1 lines download raw bytes

1import{u as e,S as H,q as D,e as ne,k as Q,h as b,T as F,g as ke,W as xe}from"./esnext-vendor.B9Da21W6.js";import{b as te,P as v,L as Ae,cf as Fe,bd as ie,cg as He,bI as Ue,f as we,ch as ze,p as Z,ci as Ve,cj as Be,ck as Ge,cl as qe,u as We,cm as Ye,bi as $e,k as oe,G as Je,B as k,S as je,cn as Xe,U as Ke,co as Qe}from"./hydrate.DZ4YTm7p.js";import{C as Ze}from"./Choice.DSKmQsTS.js";import{T as en}from"./TextArea.C1mMoZ65.js";import{F as nn}from"./localization-index.1YNaS8kx.js";import{C as tn}from"./IncentiveBadge.DborNHa8.js";import{S as on}from"./ShippingMethodRateLabel.DAtbOh1H.js";import{u as sn,S as rn,E as an,d as ln}from"./EstimatedDeliveryContent.BuJLi-Ww.js";import{S as C,cw as se,bj as cn,bk as dn,cx as un,bl as re,T as pn,cy as hn,H as vn,a6 as gn}from"./addresses-is-address-empty.Bn2lNY_L.js";import{P as mn}from"./PhoneField.C0TeiZrn.js";function yn(){const{i18n:t,checkout:o}=C();return o.configuration.layout.isOnePage.value?null:e(H,{children:[e(te,{blockSize:"small-400"}),e(v,{children:t.translate("shipping.shipping_line_delivery_instructions")})]})}function En({displayAddInstructionsButton:t,onPress:o}){const{i18n:i,checkout:r}=C();return r.configuration.layout.isOnePage.value?t?e(Ae,{onClick:o,children:i.translate("shipping.add_delivery_instructions")}):null:e(v,{children:i.translate("shipping.shipping_line_delivery_phone")})}const fn=new Set(["DELIVERY_OPTIONS_PHONE_NUMBER_REQUIRED","DELIVERY_OPTIONS_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"]),_n=new Set(["DELIVERY_OPTIONS_INSTRUCTIONS_INVALID"]),ae=(t,o)=>{if(t.type==="error"){for(const i of t.violations)if(!(i.__typename!=="UnprocessableTermViolation"||!o.has(i.code)))return i.localizedMessage??i.nonLocalizedMessage}};function Sn(t,o="ONE_TIME_PURCHASE",i){const r=se(),s=Fe(o,i),{i18n:d,checkout:{wallets:c}}=C();ie(D(u=>{const p=ae(u,fn);p&&(r.value=p)},[r]));const T=ne(void 0),g=c.activeSession.value?T:r;return cn(s,g,u=>{if(c.activeSession.value)return;const p=un(u);if(!(!t||!t.phoneRequired)&&!p)return d.translate("field_errors.shipping_line_phone_invalid")},dn.InvalidDeliveryMethodPhoneNumber),{value:s,error:r,validated:re(s,r,void 0)}}function Pn(t="ONE_TIME_PURCHASE",o){const i=se(),r=He(t,o);return ie(D(s=>{const d=ae(s,_n);d&&(i.value=d)},[i])),{value:r,error:i,validated:re(r,i,void 0)}}const Dn="sqcDF",Cn="z2IIo",Tn="qi1py",On="pcf8k",x={OnTop:Dn,LoadingOption:Cn,LoadingOptionBorderNone:Tn,LoadingOptionBorderFull:On},Ln=255,In={textSize:"small",freeTextLetterCase:"uppercase"},Nn={};function Vn({id:t,type:o="ONE_TIME_PURCHASE",methods:i,loadingAdditionalShippingRates:r=!1,isInSplitCartModal:s=!1}){const d=Ue(),{i18n:c,checkout:T}=C(),g="base",{negotiate:u}=we(),{geolocation:p}=ze(),[le,ce]=Q(p.country.code),{shippingAddress:O}=pn(),U=hn(),{deliveryExpectationLines:w,deliveryExpectationLinesLoading:de,status:ue}=sn(),z=Z("Checkout::ShippingMethodDetails::RenderAfter"),L=Z("Checkout::ShippingMethodDetails::RenderExpanded"),[pe]=Ve(o,t),he=Be(),[h,_]=Ge({type:o,id:t,deliveryMethodType:he.value?"SHIPPING":void 0}),m=ne(),{setInverseGroupDeliveryMethodHandle:V,getInverseGroupDeliveryMethodHandle:B}=qe(i,o),I=i.find(n=>n.handle===h),{validated:y,value:G,error:q}=Sn(I,o,t),{validated:S,value:W,error:Y}=Pn(o,t),ve=T.configuration.layout.isOnePage.value,[$,ge]=Q(!ve||S?.value!==void 0);let E=i;pe.includes("PICKUP_POINT")&&(E=E.filter(n=>n.pickupLocation?.type==="PickupPointLocation"&&I?.pickupLocation?.type==="PickupPointLocation"&&n.pickupLocation?.handle===I?.pickupLocation?.handle));const me=E.map(n=>!!n?.deliveryPredictionEligible);b(()=>{const{phone:n}=O.fields,a=n.value;!y.value&&a&&y.onChange(a)},[]),b(()=>{const{countryCode:n}=O.fields,a=n.value;a&&ce(a)},[O]);const ye=F(()=>({state:{phone:G,instructions:W},errors:{phone:q,instructions:Y}}),[G,q,W,Y]),J=D(()=>{y.clearError(),S.clearError()},[y,S]),{optionList:{border:Ee="full"}}=We(),fe=D(([n=""])=>{if(J(),_(n),U.value&&t==null){const a=B(n);V(a)}if(s){m.value=n;return}u({include:["deliveryNext"]}),d("shippingMethodSelected",{timestamp:new Date})},[m,J,_,U,t,s,u,B,V,d]);b(()=>{if(!s){m.value=void 0;return}const n=m.value;!n||n===h||!i.some(a=>a.handle===n)||_(n)},[s,i,h,_,m]);const _e=(n,a,l)=>{const N=a||l,P=L.length>0&&!s;return N?e(ee,{children:[e(nn,{children:[a&&e(k,{children:[e(mn,{label:c.translate("shipping.shipping_line_delivery_phone_label"),countryCode:le,prefillCountryCode:!0,...y}),e(te,{blockSize:"small-400"}),e(En,{displayAddInstructionsButton:l&&!$,onPress:()=>ge(!0)})]}),l&&$&&e(k,{children:[e(en,{autoFocus:!0,maxLength:Ln,label:c.translate("shipping.optional_shipping_line_delivery_instructions_label"),rows:1,...S}),e(yn,{})]})]}),P&&e(A,{customizations:L,isInModal:!1,handle:n})]}):P?e(A,{customizations:L,handle:n,isInModal:!1,render:M=>e(ee,{children:M})}):null},j=`${t?`_${vn(t)}`:""}`,Se=o==="ONE_TIME_PURCHASE"?`shipping_methods${j}`:`${o.toLowerCase()}_shipping_methods${j}`,Pe=z.length>0,De=E.length===1,Ce=F(()=>h?[h]:[],[h]),Te=s?In:Nn;return e(Xe,{...ye,children:e("div",{className:x.OnTop,children:e(tn,{name:Se,title:c.translate("general.choose_shipping_method"),titleHidden:!0,values:Ce,onChange:fe,hideRadioControl:De,children:[E.map((n,a)=>{const l=me[a]||n.brandedPromise?.handle===gn.BuyWithPrime,{showEstimatedDeliveryLabel:N}=Ye(n,!!l,w,de,ue),{acceptsInstructions:P,cost:M,costAfterDiscounts:Oe,description:X,estimatedTimeInTransit:Le,handle:f,hideDiscountedTotalOnShippingSelector:Ie,included:Ne,pickupLocation:K,phoneRequired:Me}
1=n,Re=w?.find(R=>R.deliveryStrategyHandle===f),be=$e({deliveryMethod:n,localDelivery:n.methodType==="LOCAL"?c.translate("shipping.local_delivery"):void 0});return e(Ze,{value:f,renderSelectedContentWhenCollapsed:!0,selectedContent:_e(f,Me,P)??void 0,details:e(H,{children:[l&&e(an,{deliveryMethod:n,deliveryExpectationLine:Re,paragraphColor:g}),!l&&N&&e(ln,{timeInTransit:Le,minDeliveryDateTime:n?.minDeliveryDateTime,maxDeliveryDateTime:n?.maxDeliveryDateTime,title:n?.deliveryPromisePresentmentTitle?.short,paragraphColor:g}),X&&!l&&e(v,{color:g,children:X}),K?.type==="PickupInStoreLocation"&&e(Mn,{pickupLocation:K})]}),secondaryContent:e(rn,{cost:M,costAfterDiscounts:Oe,included:Ne,styleOverrides:Te,preDiscountCost:Ie}),tertiaryContent:Pe&&e(A,{customizations:z,handle:f,isInModal:s,render:R=>e(oe,{padding:"small-100 none none none",gap:"small-100",children:R})}),children:e(on,{methodTitle:be})},f)}),r?e("div",{className:ke([x.LoadingOption,x[xe("LoadingOptionBorder",Ee)]]),children:e(Je,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"base",alignItems:"center",alignContent:"center",children:[e(k,{children:e(je,{})}),e(v,{color:"subdued",type:"small",children:c.translate("shipping.loading_progressive_rates")}
1)]})}):null]})})})}function A({customizations:t,handle:o,isInModal:i,render:r}){const s=F(()=>({handle:o,isInModal:i}),[o,i]);return e(Ke,{customizations:t,options:s,render:r})}function Mn({pickupLocation:t}){const o=Qe(t.address,{hiddenFields:["firstName","lastName","phone","company","countryCode","postalCode"]});return e(H,{children:[e(v,{type:"small",children:o}),e(v,{type:"small",children:t.instructions})]})}function ee({children:t}){return e(oe,{gap:"large-200",children:t})}export{Vn as S};

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.