PageSourceSearch

https://buttonify.net/assets/js/submit-CnDoaGHk.js

js buttonify.net collected 2026-10-01 10:16:34 UTC 9,055 bytes, 1 lines download raw bytes

1import{a as d,j as e}from"./[email protected]";import{u as $,f as N,s as S,k as Z}from"./index-CvtKBvcS.js";import{r as Q}from"./returnNavigation-CuSzJAdN.js";import{U as T,p as _}from"./UserCenterFlowShell-5A_nFwrG.js";import{N as h,O as l,B as P,F as U,I as ee,b as se,M as re,Z as te,J as g,X as E,Y as p,e as z,aA as ie,l as A,aB as I,a3 as ne}from"./@[email protected]_@[email protected]_@[email protected][email protected]__@emotion_s_873e60787661dc90ada907c57a275437-BoBB59DV.js";import{u as D,a as oe}from"./[email protected][email protected][email protected][email protected]_SYxC1a.js";import"./[email protected][email protected]";import"./[email protected]";import"./[email protected]_@[email protected][email protected][email protected]";import"./[email protected][email protected]";import"./[email protected][email protected]_mWMRlas.js";import"./[email protected]";import"./[email protected]";import"./[email protected]";import"./@[email protected][email protected]_@[email protected][email protected][email protected][email protected]";import"./[email protected]";import"./[email protected]";import"./[email protected][email protected]";import"./[email protected]";import"./[email protected]";import"./@[email protected]_@[email protected]_@[email protected]_@[email protected]._4f45627fdfc0611a55124f5eb568ad63-DUADUPLL.js";import"./[email protected]";import"./[email protected]";import"./@[email protected]_@[email protected]_@[email protected][email protected]__@emotion_sty_561e494e28183fb974eac872630b6966-DWWc_btx.js";import"./[email protected]";import"./@[email protected]_@[email protected]_@[email protected][email protected]__@emot_15753e10a382f005970c1ce71eecc2d3-DNNHzrjF.js";import"./@[email protected]_@[email protected][email protected]";import"./[email protected]";import"./[email protected]";import"./@[email protected]_.js";import"./@[email protected]";import"./[email protected]";import"./@[email protected]";import"./@[email protected]";import"./@[email protected]";import"./@[email protected]";import"./@[email protected]_6p140.js";import"./@[email protected][email protected]";import"./@[email protected]_@[email protected]_@[email protected][email protected]__@[email protected][email protected]";import"./@[email protected]";import"./@[email protected]";import"./@[email protected]_@[email protected][email protected]";import"./[email protected]";import"./@[email protected]_@[email protected][email protected]";import"./[email protected][email protected][email protected][email protected]";import"./@[email protected]";import"./UserCenterLayout-DEhfM0td.js";function ae(t){const c=[t.country,t.province,t.city,t.addressLine].filter(Boolean).join(" ");return`${t.recipient} · ${c}`}function le({value:t,onChange:c}){const{t:s}=$(),u=D(),{addresses:n,syncAddressBook:m}=N();d.useEffect(()=>{m()},[m]);const f=d.useMemo(()=>{const a=S(t),i=n.findIndex(v=>S(v)===a);return i>=0?i:""},[n,t]);return d.useEffect(()=>{!t.recipient.trim()&&!t.addressLine.trim()&&n.length>0&&c(n[0])},[n,c,t.addressLine,t.recipient]),n.length===0?e.jsxs(h,{sx:{mb:2},children:[e.jsx(l,{variant:"body2",color:"text.secondary",sx:{mb:1},children:s("userCenter.flow.noSavedAddress")}),e.jsx(P,{size:"small",variant:"outlined",onClick:()=>u("/user-center/settings"),sx:{textTransform:"none"},children:s("userCenter.flow.manageAddresses")})]}):e.jsxs(h,{sx:{mb:2},children:[e.jsxs(U,{fullWidth:!0,size:"small",sx:{mb:1},children:[e.jsx(ee,{id:"shipping-address-select-label",children:s("userCenter.flow.selectSavedAddress")}),e.jsx(se,{labelId:"shipping-address-select-label",label:s("userCenter.flow.selectSavedAddress"),value:f===""?"":String(f),onChange:a=>{const i=Number(a.target.value);!Number.isNaN(i)&&n[i]&&c(n[i])},children:n.map((a,i)=>e.jsxs(re,{value:String(i),children:[ae(a),i===0&&a.settingsAddressId?` (${s("userCenter.settingsPage.defaultTag")})`:""]},`${a.settingsAddressId??i}-${S(a)}`))})]}),e.jsx(P,{size:"small",onClick:()=>u("/user-center/settings"),sx:{textTransform:"none",px:0,minWidth:0},children:s("userCenter.flow.manageAddresses")})]})}function ts({layout:t="fullPage",flowStep:c=_("submitParcel")}){const{t:s}=$(),u=D(),n=oe(),{mode:m,systemMode:f}=te(),a=(m==="system"?f:m)==="dark",{warehouseItems:i,addresses:v,saveAddress:H,createParcel:q,syncAddressBook:W}=N(),w=n.state?.warehouseItemIds??[],K=Q(t==="userCenter"?"/user-center/warehouse":"/purchasing-proxy/warehouse",n.state),j=t==="userCenter",y=d.useMemo(()=>i.filter(r=>w.includes(r.id)),[i,w]),[o,b]=d.useState(()=>Z(v)??{recipient:"",phone:"",country:"US",province:"",city:"",addressLine:"",zipCode:""});d.useEffect(()=>{W()},[W]);
1const[k,O]=d.useState("standard"),[L,C]=d.useState(""),R=y.reduce((r,x)=>r+x.weightKg*x.quantity,0),F=Math.max(30,R*45),B=e.jsxs(g,{sx:{p:3,borderRadius:2,textAlign:"center"},children:[e.jsx(l,{sx:{mb:2},children:s("purchasingProxy.flow.warehouseEmptyDesc")}),e.jsx(P,{variant:"contained",onClick:()=>u(K),sx:{textTransform:"none"},children:s("purchasingProxy.flow.warehouse")})]});if(y.length===0)return j?e.jsx(T,{activeStep:c,children:B}):e.jsx(h,{sx:{bgcolor:a?"grey.900":"#f7f7f7",minHeight:"100vh",py:2},children:e.jsx(E,{maxWidth:"lg",children:B})});const G=()=>{if(!o.recipient.trim()||!o.addressLine.trim()){C(s("purchasingProxy.fillBuy.form.validateFailed"));return}H(o);const r=Math.max(10,y.reduce((X,Y)=>X+Y.quantity*8,0)),x=q({warehouseItemIds:w,country:o.country,shippingMethod:k,freightCost:F,declaredValue:r,address:o});C(s("purchasingProxy.flow.submitOrderHint"));const J=j?"/user-center/parcel":"/purchasing-proxy/parcel",V=j?`/user-center/parcel/${x.id}/pay`:`/purchasing-proxy/parcel/${x.id}/pay`;setTimeout(()=>u(V,{state:{from:J}}),800)},M=e.jsxs(e.Fragment,{children:[e.jsx(l,{variant:"h5",sx:{fontWeight:700,mb:2},children:s("purchasingProxy.flow.submitParcel")}),e.jsxs(p,{container:!0,spacing:3,children:[e.jsxs(p,{size:{xs:12,md:7},children:[e.jsxs(g,{sx:{p:2.5,borderRadius:2,mb:2},children:[e.jsx(l,{sx:{fontWeight:600,mb:1.5},children:s("purchasingProxy.flow.selectItems")}),y.map(r=>e.jsxs(h,{sx:{display:"flex",gap:1.5,mb:1.5},children:[e.jsx(h,{component:"img",src:r.imageUrl,alt:"",sx:{width:56,height:56,borderRadius:1,objectFit:"cover"}}),e.jsxs(h,{children:[e.jsx(l,{sx:{fontSize:13},children:r.title}),e.jsxs(l,{sx:{fontSize:11,color:"text.secondary"},children:[r.weightKg,"kg × ",r.quantity]})]})]},r.id))]}),e.jsxs(g,{sx:{p:2.5,borderRadius:2,mb:2},children:[e.jsx(l,{sx:{fontWeight:600,mb:2},children:s("purchasingProxy.flow.address.title")}),e.jsx(le,{value:o,onChange:b}),e.jsxs(p,{container:!0,spacing:2,children:[e.jsx(p,{size:{xs:12,sm:6},children:e.jsx(z,{fullWidth:!0,size:"small",label:s("purchasingProxy.flow.address.recipient"),value:o.recipient,onChange:r=>b({...o,recipient:r.target.value})})}),e.jsx(p,{size:{xs:12,sm:6},children:e.jsx(z,{fullWidth:!0,size:"small",label:s("purchasingProxy.flow.address.phone"),value:o.phone,onChange:r=>b({...o,phone:r.target.value})})}),e.jsx(p,{size:{xs:12},children:e.jsx(z,{fullWidth:!0,size:"small",multiline:!0,minRows:2,label:s("purchasingProxy.flow.address.addressLine"),value:o.addressLine,onChange:r=>b({...o,addressLine:r.target.value})})})]})]}),e.jsxs(g,{sx:{p:2.5,borderRadius:2},children:[e.jsx(l,{sx:{fontWeight:600,mb:1},children:s("purchasingProxy.flow.shippingMethod")}),e.jsx(U,{children:e.jsxs(ie,{value:k,onChange:r=>O(r.target.value),children:[e.jsx(A,{value:"economy",control:e.jsx(I,{size:"small"}),label:s("purchasingProxy.shippingPage.methods.economy.title")}),e.jsx(A,{value:"standard",control:e.jsx(I,{size:"small"}),label:s("purchasingProxy.shippingPage.methods.standard.title")}),e.jsx(A,{value:"express",control:e.jsx(I,{size:"small"}),label:s("purchasingProxy.shippingPage.methods.express.title")})]})})]})]}),e.jsx(p,{size:{xs:12,md:5},children:e.jsxs(g,{sx:{p:2.5,borderRadius:2},children:[e.jsx(l,{sx:{fontWeight:600,mb:1},children:s("purchasingProxy.flow.freight")}),e.jsxs(l,{variant:"body2",color:"text.secondary",sx:{mb:1},children:[s("purchasingProxy.calculator.weight"),": ",R.toFixed(2)," kg"]}),e.jsxs(l,{sx:{fontSize:22,fontWeight:800,color:"error.main",mb:2},children:["¥ ",F.toFixed(2)]}),e.jsx(P,{fullWidth:!0,variant:"contained",size:"large",onClick:G,sx:{textTransform:"none"},children:s("purchasingProxy.flow.submitParcel")})]})})]}),e.jsx(ne,{open:!!L,autoHideDuration:3e3,onClose:()=>C(""),message:L})]});return j?e.jsx(T,{activeStep:c,children:M}):e.jsx(h,{sx:{bgcolor:a?"grey.900":"#f7f7f7",minHeight:"100vh",py:2},children:e.jsx(E,{maxWidth:"lg",children:M})})}export{ts 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.