PageSourceSearch

https://propel.earth/assets/StripeSetupPrompt-D3-wGbJb.js

js propel.earth collected 2026-10-05 08:54:12 UTC 3,296 bytes, 1 lines download raw bytes

1var j=Object.defineProperty;var n=(r,c)=>j(r,"name",{value:c,configurable:!0});import{u as k,d as N,r as u,j as e}from"./react-vendor-2YofpKMw.js";import{u as w,bQ as P,a as o,bR as A,P as x,bS as E,bT as C}from"./index-DIDR4tgv.js";function _(){const r=k(),{user:c}=w(),[g]=N(),[b,m]=u.useState(!0),[d,l]=u.useState(!1),[p,h]=u.useState(null),f=g.get("from")==="agreement-accepted";u.useEffect(()=>{if(!c){r("/login");return}S()},[c,r]);const S=n(async()=>{var t,a;m(!0);try{const i=await P();if(!i){o.error("Please create a service provider profile first"),r("/service-provider-form");return}h(i);try{const s=await A();if((t=s==null?void 0:s.accountStatus)!=null&&t.chargesEnabled&&((a=s==null?void 0:s.accountStatus)!=null&&a.payoutsEnabled)){r("/marketplace/listings/create");return}}catch{}}catch(i){console.error("Error checking status:",i),o.error(i.message||"Failed to load status")}finally{m(!1)}},"checkStatus"),y=n(async()=>{l(!0);try{const t=await E();if(!(t!=null&&t.success)){o.error("Failed to create Stripe account"),l(!1);return}const a=await C();a!=null&&a.url?window.location.href=a.url:(o.error("Failed to get Stripe onboarding link"),l(!1))}catch(t){console.error("Error setting up Stripe:",t),o.error(t.message||"Failed to set up Stripe"),l(!1)}},"handleSetupStripe"),v=n(()=>{r("/marketplace/seller/dashboard",{state:{showWelcomeOnboarding:!0}})},"handleSkip");return b?e.jsx(x,{children:e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsx("div",{className:"w-4 h-4 border-2 border-blue-600 border-t-transparent rounded-full animate-spin"})})}):e.jsx(x,{children:e.jsxs("div",{className:"max-w-md mx-auto py-16 px-4",children:[f&&e.jsx("p",{className:"text-xs text-blue-600 mb-6",children:"Agreement accepted. Set up payments to receive payouts."}),e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx("h1",{className:"text-lg font-medium text-gray-900",children:"Payment Setup"}),e.jsx("span",{className:"text-gray-300",children:"|"}),e.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/b/ba/Stripe_Logo%2C_revised_2016.svg",alt:"Stripe",className:"h-6"})]}),e.jsx("p",{className:"text-xs text-gray-500 mb-6",children:"Connect your bank account through Stripe to receive payments when you make sales. This can be completed later, but is required before your first payout."}),e.jsx("div",{className:"border-t border-gray-100 pt-6 mb-6",children:e.jsx("p",{className:"text-xs text-gray-400 mb-4",children:"Secure payment processing. Setup takes approximately 5 minutes and requires basic business information and bank details."})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:y,disabled:d,className:"px-4 py-2 text-xs font-medium text-white bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 rounded transition-colors",children:d?"Loading...":"Set up Stripe"}),e.jsx("button",{onClick:v,disabled:d,className:"px-4 py-2 text-xs font-medium text-gray-600 hover:text-gray-900 transition-colors",children:"Setup later"})]}),p&&p.marketplaceApplicationStatus!=="approved"&&e.jsxs("p",{className:"text-xs text-gray-400 mt-8",children:["Account status: ",p.marketplaceApplicationStatus==="pending"?"Under review":"Pending submission"]})]})})}n(_,"StripeSetupPrompt");export{_ 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.