PageSourceSearch

https://endurancepics.ai/assets/editor-complete-DP1TWfi_.js

js endurancepics.ai collected 2026-10-05 11:59:10 UTC 3,248 bytes, 1 lines download raw bytes

1import{j as e}from"./motion-YM8fB_5Z.js";import{r as d}from"./sentry-otjh_W8X.js";import{d as P,u as I}from"./react-OFElpF2u.js";import{e5 as E}from"./index-BoOYcZhe.js";import{d as S}from"./cart-store-D0hPWnJY.js";import{t as k}from"./ui-BM2pkkqU.js";import{M as N}from"./material-icon-4IKyhXPg.js";import"./pdf-BEE2WjVn.js";import"./supabase-BTsOnGLq.js";import"./charts-DnWBDTZK.js";import"./i18n-BRS0AnGA.js";function W(){const[i]=P(),l=I(),[n,a]=d.useState("loading"),[v,c]=d.useState(""),s=i.get("editorId")??"",o=i.get("eventId")??"",m=i.get("productName")??"Custom Product";return d.useEffect(()=>{if(!s||!o){a("error"),c("Missing editor or event ID");return}(async()=>{var u,x,p,g,h,f,b,j;try{const t=await E([{editorId:s,quantity:1}]);if(!t||!((u=t.items)!=null&&u.length)){a("error"),c("Could not retrieve pricing from the editor session.");return}const r=t.items[0],y=((p=(x=t.pricing)==null?void 0:x.markedUp)==null?void 0:p.amount)??((g=r.totalPrice)==null?void 0:g.amount)??0,w=((f=(h=t.pricing)==null?void 0:h.base)==null?void 0:f.amount)??0;S(o,{photoId:s,photoUrl:((b=r.previews)==null?void 0:b[0])??"",thumbnailUrl:((j=r.previews)==null?void 0:j[0])??"",eventId:o,type:"print",productName:r.label||m,productUid:r.productId,quantity:r.quantity||1,unitPrice:y,wholesalePrice:w,templateId:s,requiresTemplate:!1,templateVariables:{editorId:s,orderPayload:JSON.stringify(t.order)}}),k.success(`${r.label||m} added to cart — $${y.toFixed(2)}`),a("success"),setTimeout(()=>{l(`/events/${o}/checkout`)},1500)}catch(t){console.error("Editor export failed:",t),a("error"),c("Failed to process your design. Please try again.")}})()},[s,o]),e.jsx("div",{className:"min-h-screen bg-[var(--m3-surface,#fafafa)] flex items-center justify-center p-4",children:e.jsxs("div",{className:"max-w-md w-full bg-white rounded-2xl shadow-lg p-8 text-center",children:[n==="loading"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto mb-4 h-12 w-12 animate-spin rounded-full border-4 border-blue-200 border-t-blue-600"}),e.jsx("h2",{className:"text-lg font-bold text-gray-900",children:"Processing Your Design"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Getting pricing and preparing your order..."})]}),n==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-green-100",children:e.jsx(N,{name:"check_circle",size:40,className:"text-green-600"})}),e.jsx("h2",{className:"text-lg font-bold text-gray-900",children:"Design Complete!"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Your custom product has been added to your cart. Redirecting to checkout..."})]}),n==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-red-100",children:e.jsx(N,{name:"error",size:40,className:"text-red-600"})}),e.jsx("h2",{className:"text-lg font-bold text-gray-900",children:"Something Went Wrong"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:v}),e.jsx("button",{onClick:()=>l(-1),className:"mt-4 rounded-xl bg-blue-600 px-6 py-2.5 text-sm font-bold text-white hover:bg-blue-700",children:"Go Back"})]})]})})}export{W as EditorCompletePage};

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.