PageSourceSearch

https://app.superfuel.io/assets/select-brand--Vei8K8-.js

js superfuel.io collected 2026-10-04 14:38:21 UTC 5,242 bytes, 1 lines download raw bytes

1import{w as v,j as e,N as j,r as m}from"./components-CVD5VjrI.js";import{M as C}from"./marketplace-picker-C3pE868y.js";import{B as E}from"./brand-splash-O_NH_Q6c.js";import{F as A,a as w,b as y}from"./funnel-screen-DHIDch4F.js";import{A as M}from"./alert-DUdGLjrQ.js";import{B as P}from"./button-WC2Sd3Es.js";import{S as R}from"./select-CCyV6XAs.js";import{T as F}from"./text-input-CkKDjRGh.js";import{u as I}from"./me-queries-D7mlri_S.js";import{u as T,a as $}from"./onboarding-queries-BrY298AG.js";import{f as z}from"./phone-entry-Coz9UKM-.js";import{t as c}from"./analytics-CwdYbx1N.js";import{a as N,B as L,c as D}from"./brand-w1ChzSi2.js";import{g as O}from"./auth-token-BwIyVttl.js";import"./icon-DCS0ur00.js";import"./createLucideIcon-C3p9ePf8.js";import"./amazon-DpK5_Ckd.js";import"./chevrons-up-down-CXZUTROJ.js";import"./check-DCF6lf8o.js";import"./SelectItemText-B4Y8Wicc.js";import"./useValueChanged-B6WVjUNz.js";import"./useScrollLock-1gfQEikk.js";import"./useOpenChangeComplete-C2Hx1BNH.js";import"./index-6c14LIAd.js";import"./isElementDisabled-CwHw_lZC.js";import"./useControlled-Dq0AJwtz.js";import"./useAriaLabelledBy-D-6QKz77.js";import"./useLabelableId-DQ_MAEYi.js";import"./getPseudoElementBounds-CP1NQ8CC.js";import"./serializeValue-B8e3iXO-.js";import"./useAnchoredPopupScrollLock-rnbKWaGK.js";import"./DirectionContext-BTEcNGon.js";import"./useCompositeListItem-ntB5c-vM.js";import"./PopoverClose-Cr2g3BwI.js";import"./composite-gJWcRZF9.js";import"./theme-toggle-BViJMw3v.js";import"./theme-CZ2lX7II.js";import"./badge-CvZ_FbAd.js";import"./index-Bb4qSo10.js";import"./typography-CKYfygSC.js";import"./user-BmagxPLn.js";import"./chevron-down-DwKBbdoc.js";import"./plus-Ebfj5UPL.js";import"./lock-BhfElVJC.js";import"./search-CGv6N04x.js";import"./credit-card-s0RAMK_e.js";import"./mail-CX7FXp9y.js";import"./api-fetch-ot4R0tc3.js";import"./QueryClientProvider-CXNcDz-R.js";import"./constants-BsbqFlr4.js";import"./useMutation-CpkM4K-D.js";import"./mutation-DBqORgb4.js";import"./toast-D4MpRVlj.js";import"./ComboboxEmpty-CBbMX07W.js";import"./stringifyLocale-BMPUsiav.js";import"./module-UELy-YiK.js";import"./newrelic-ref-CRjx7Ux3.js";function Yt(){return[{title:"Superfuel · Pick your brand"},{name:"description",content:"Choose which brand to set up."}]}const b="__new_brand__",qt=v(function(){var o,i;const n=I(),t=T();return O()?t.isLoading||n.isLoading?e.jsx(E,{}):t.isError||n.isError?e.jsx(A,{message:"Couldn't load your setup step.",onRetry:()=>{t.isError&&t.refetch(),n.isError&&n.refetch()}}):((o=t.data)==null?void 0:o.position)!=="brand_selection"||!t.data.session_id?e.jsx(j,{to:"/",replace:!0}):e.jsx(Q,{brands:((i=n.data)==null?void 0:i.brands)??[],sessionId:t.data.session_id}):e.jsx(j,{to:"/sign-in",replace:!0})});function Q({brands:r,sessionId:n}){const t=$(),[o,i]=m.useState(r.length===0?b:null),[l,u]=m.useState(""),[s,d]=m.useState(null),f=a=>h=>{t.reset(),a(h)},p=o===b,x=p?N(l)&&s!==null:o!==null,g=p?"fresh":"existing",_=r.length,B=r.filter(a=>a.can_set_up).length;m.useEffect(()=>{c("onboarding:brand_pick_view",{brand_count:_,pickable_count:B})},[]);const S=async()=>{if(!x||t.isPending)return;const a=p?{name:l.trim(),marketplace:s}:{brandId:o};c("onboarding:brand_pick_submit",{choice:g,brand_count:_});try{await t.mutateAsync({sessionId:n,...a})}catch(h){c("onboarding:brand_pick_fail",{choice:g,reason:z(h)});return}c("onboarding:brand_pick_end",{choice:g})},k=t.error instanceof Error?t.error.message:null;return e.jsxs(w,{children:[r.length===0?e.jsx(y,{title:"Set up your brand"}):e.jsx(y,{title:"Which brand are you setting up?",subtitle:"Pick the one you want to connect first."}),e.jsxs("div",{className:"flex w-full flex-col gap-4",children:[r.length>0?e.jsx(R,{label:"Brand",placeholder:"Pick a brand",value:o,disabled:t.isPending,onValueChange:f(i),options:[...r.map(a=>({value:a.id,label:W(a),disabled:!a.can_set_up})),{value:b,label:"Set up a new brand"}]}):null,p?e.jsx(V,{name:l,marketplace:s,disabled:t.isPending,onNameChange:f(u),onMarketplaceChange:f(d)}):null,k?e.jsx(M,{state:"error",style:"lighter",size:"sm",title:k}):null,e.jsx(P,{type:"button",size:"md",text:t.isPending?"Saving…":"Continue",disabled:!x||t.isPending,onClick:()=>{S()}})]})]})}function V({name:r,marketplace:n,disabled:t,onNameChange:o,onMarketplaceChange:i}){const[l,u]=m.useState(!1),s=l&&!N(r);return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(F,{label:"Brand name",inputType:"basic",autoComplete:"organization",placeholder:"Your brand on Amazon",sublabel:null,showLabelInfoIcon:!1,disabled:t,value:r,onChange:d=>o(d.target.value),onBlur:()=>u(!0),error:s,hint:s?`Use ${L} to ${D} characters.`:void 0,className:"max-w-none"}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium tracking-tight text-strong",children:"Marketplace"}),e.jsx(C,{value:n,onChange:i,disabled:t}),e.jsx("p",{className:"text-xs text-sub",children:"The Amazon country your brand sells in."})]})]})}function W(r){const n=`${r.name} (${r.marketplace})`,t=r.set_up_blocked_reason;return r.can_set_up||!t?n:`${n}, ${H[t]}`}const H={running:"already set up",paused:"paused",claimed:"someone else is setting this up"};export{qt as default,Yt as meta};

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.