@lockerverse/react 0.2.157 → 0.2.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auction-image.js +1 -1
- package/dist/auction-image.js.map +1 -1
- package/dist/auction-item-layout.css +4 -3
- package/dist/auction-item.d.ts +4 -0
- package/dist/auction-item.d.ts.map +1 -1
- package/dist/auction-item.js +1 -1
- package/dist/auction-item.js.map +1 -1
- package/dist/auctions.d.ts.map +1 -1
- package/dist/auctions.js +1 -1
- package/dist/auctions.js.map +1 -1
- package/dist/lockerverse-auction-item-card.d.ts.map +1 -1
- package/dist/lockerverse-auction.js +1 -1
- package/dist/lockerverse-auction.js.map +1 -1
- package/guides/auctions.md +7 -1
- package/guides/events.md +1 -1
- package/guides/integration.md +1 -1
- package/guides/payment-widgets.md +1 -1
- package/guides/signup.md +1 -1
- package/package.json +2 -2
package/dist/auction-image.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState as
|
|
1
|
+
import{createContext as e,useContext as t,useState as n}from"react";import{jsx as r}from"react/jsx-runtime";const i=e(void 0),a=[96,192,320,480,640,960,1280,1920],o=/\.(jpe?g|png|webp|avif)$/i,s=/\/+$/,c=new Set([`media.lockerverse.com`,`dev-media.lockerverse.com`]);function l(e,t){if(c.has(e.hostname)&&!e.port)return e.pathname;if(!t)return;let n=new URL(t),r=`${n.pathname.replace(s,``)}/`;if(!(n.username||n.password||n.search||n.hash||e.origin!==n.origin||!e.pathname.startsWith(r)))return`/${e.pathname.slice(r.length)}`}function u(e,t){if(e)try{let n=new URL(e),r=l(n,t);return n.protocol!==`https:`||!r||n.username||n.password||n.search||n.hash||r.startsWith(`/__image/`)||r.includes(`/chat-media/`)||!o.test(r)?void 0:n}catch{}}function d(e,t){return e.searchParams.set(`w`,String(t)),e.searchParams.set(`f`,`webp`),e.href}function f({alt:e,width:o,height:s,src:c,maxWidth:l,onError:f,decoding:p=`async`,...m}){let[h,g]=n(),_=t(i),v=h===c?void 0:u(c,_),y=a.filter(e=>e<=l),b=y.at(-1)??96;return r(`img`,{...m,alt:e,decoding:p,height:s,onError:e=>{v?g(c):f?.(e)},src:v?d(v,b):c,srcSet:v?y.map(e=>`${d(v,e)} ${e}w`).join(`, `):void 0,width:o})}export{i as n,f as t};
|
|
2
2
|
//# sourceMappingURL=auction-image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auction-image.js","names":[],"sources":["../src/auction-image.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"auction-image.js","names":[],"sources":["../src/auction-image.tsx"],"sourcesContent":["import {\n createContext,\n type ImgHTMLAttributes,\n useContext,\n useState,\n} from \"react\";\n\nexport const AuctionImageMediaBase = createContext<string | undefined>(\n undefined\n);\n\nconst imageWidths = [96, 192, 320, 480, 640, 960, 1280, 1920];\nconst publicImageExtension = /\\.(jpe?g|png|webp|avif)$/i;\nconst trailingSlashes = /\\/+$/;\nconst mediaHosts = new Set([\n \"media.lockerverse.com\",\n \"dev-media.lockerverse.com\",\n]);\n\nfunction publicImagePath(url: URL, mediaBaseUrl: string | undefined) {\n if (mediaHosts.has(url.hostname) && !url.port) {\n return url.pathname;\n }\n if (!mediaBaseUrl) {\n return;\n }\n const base = new URL(mediaBaseUrl);\n const prefix = `${base.pathname.replace(trailingSlashes, \"\")}/`;\n if (\n base.username ||\n base.password ||\n base.search ||\n base.hash ||\n url.origin !== base.origin ||\n !url.pathname.startsWith(prefix)\n ) {\n return;\n }\n return `/${url.pathname.slice(prefix.length)}`;\n}\n\nfunction publicImageUrl(\n src: string | undefined,\n mediaBaseUrl: string | undefined\n): URL | undefined {\n if (!src) {\n return;\n }\n try {\n const url = new URL(src);\n const path = publicImagePath(url, mediaBaseUrl);\n if (\n url.protocol !== \"https:\" ||\n !path ||\n url.username ||\n url.password ||\n url.search ||\n url.hash ||\n path.startsWith(\"/__image/\") ||\n path.includes(\"/chat-media/\") ||\n !publicImageExtension.test(path)\n ) {\n return;\n }\n return url;\n } catch {\n // Relative, local, and malformed sources keep their original URL.\n }\n}\n\nfunction resizedUrl(url: URL, width: number): string {\n url.searchParams.set(\"w\", String(width));\n url.searchParams.set(\"f\", \"webp\");\n return url.href;\n}\n\n/** Keep source identities in the auction data; resize only displayed photos. */\nexport function AuctionImage({\n alt,\n width,\n height,\n src,\n maxWidth,\n onError,\n decoding = \"async\",\n ...props\n}: Omit<\n ImgHTMLAttributes<HTMLImageElement>,\n \"src\" | \"srcSet\" | \"alt\" | \"width\" | \"height\"\n> & {\n alt: string;\n width: number;\n height: number;\n src: string | undefined;\n maxWidth: number;\n}) {\n const [failedSource, setFailedSource] = useState<string>();\n const mediaBaseUrl = useContext(AuctionImageMediaBase);\n const url =\n failedSource === src ? undefined : publicImageUrl(src, mediaBaseUrl);\n const widths = imageWidths.filter((profileWidth) => profileWidth <= maxWidth);\n const largestWidth = widths.at(-1) ?? 96;\n return (\n // biome-ignore lint/a11y/noNoninteractiveElementInteractions: A load error retries the original image; it is not a user interaction.\n <img\n {...props}\n alt={alt}\n decoding={decoding}\n height={height}\n onError={(event) => {\n if (url) {\n setFailedSource(src);\n } else {\n onError?.(event);\n }\n }}\n src={url ? resizedUrl(url, largestWidth) : src}\n srcSet={\n url\n ? widths\n .map(\n (profileWidth) =>\n `${resizedUrl(url, profileWidth)} ${profileWidth}w`\n )\n .join(\", \")\n : undefined\n }\n width={width}\n />\n );\n}\n"],"mappings":"4GAOA,MAAa,EAAwB,EACnC,IAAA,EACF,EAEM,EAAc,CAAC,GAAI,IAAK,IAAK,IAAK,IAAK,IAAK,KAAM,IAAI,EACtD,EAAuB,4BACvB,EAAkB,OAClB,EAAa,IAAI,IAAI,CACzB,wBACA,2BACF,CAAC,EAED,SAAS,EAAgB,EAAU,EAAkC,CACnE,GAAI,EAAW,IAAI,EAAI,QAAQ,GAAK,CAAC,EAAI,KACvC,OAAO,EAAI,SAEb,GAAI,CAAC,EACH,OAEF,IAAM,EAAO,IAAI,IAAI,CAAY,EAC3B,EAAS,GAAG,EAAK,SAAS,QAAQ,EAAiB,EAAE,EAAE,GAE3D,OAAK,UACL,EAAK,UACL,EAAK,QACL,EAAK,MACL,EAAI,SAAW,EAAK,QACpB,CAAC,EAAI,SAAS,WAAW,CAAM,GAIjC,MAAO,IAAI,EAAI,SAAS,MAAM,EAAO,MAAM,GAC7C,CAEA,SAAS,EACP,EACA,EACiB,CACZ,KAGL,GAAI,CACF,IAAM,EAAM,IAAI,IAAI,CAAG,EACjB,EAAO,EAAgB,EAAK,CAAY,EAc9C,OAZE,EAAI,WAAa,UACjB,CAAC,GACD,EAAI,UACJ,EAAI,UACJ,EAAI,QACJ,EAAI,MACJ,EAAK,WAAW,WAAW,GAC3B,EAAK,SAAS,cAAc,GAC5B,CAAC,EAAqB,KAAK,CAAI,EAE/B,OAEK,CACT,MAAQ,CAER,CACF,CAEA,SAAS,EAAW,EAAU,EAAuB,CAGnD,OAFA,EAAI,aAAa,IAAI,IAAK,OAAO,CAAK,CAAC,EACvC,EAAI,aAAa,IAAI,IAAK,MAAM,EACzB,EAAI,IACb,CAGA,SAAgB,EAAa,CAC3B,MACA,QACA,SACA,MACA,WACA,UACA,WAAW,QACX,GAAG,GAUF,CACD,GAAM,CAAC,EAAc,GAAmB,EAAiB,EACnD,EAAe,EAAW,CAAqB,EAC/C,EACJ,IAAiB,EAAM,IAAA,GAAY,EAAe,EAAK,CAAY,EAC/D,EAAS,EAAY,OAAQ,GAAiB,GAAgB,CAAQ,EACtE,EAAe,EAAO,GAAG,EAAE,GAAK,GACtC,OAEE,EAAC,MAAD,CACE,GAAI,EACC,MACK,WACF,SACR,QAAU,GAAU,CACd,EACF,EAAgB,CAAG,EAEnB,IAAU,CAAK,CAEnB,EACA,IAAK,EAAM,EAAW,EAAK,CAAY,EAAI,EAC3C,OACE,EACI,EACG,IACE,GACC,GAAG,EAAW,EAAK,CAAY,EAAE,GAAG,EAAa,EACrD,CAAC,CACA,KAAK,IAAI,EACZ,IAAA,GAEC,OACR,CAAA,CAEL"}
|
|
@@ -40,11 +40,12 @@
|
|
|
40
40
|
padding: 20px 24px;
|
|
41
41
|
border-top: 1px solid var(--lockerverse-border);
|
|
42
42
|
}
|
|
43
|
-
.lockerverse-auctions__item-copy h2 {
|
|
44
|
-
margin
|
|
43
|
+
.lockerverse-auctions__item-copy :is(h1, h2) {
|
|
44
|
+
margin: 0;
|
|
45
45
|
font-size: var(--lockerverse-auction-item-title-size, 36px);
|
|
46
46
|
font-weight: 600;
|
|
47
47
|
line-height: 1.12;
|
|
48
|
+
text-wrap: balance;
|
|
48
49
|
}
|
|
49
50
|
.lockerverse-auctions .lockerverse-auctions__eyebrow {
|
|
50
51
|
margin: 0;
|
|
@@ -267,7 +268,7 @@
|
|
|
267
268
|
.lockerverse-auctions__item-copy {
|
|
268
269
|
padding: 20px;
|
|
269
270
|
}
|
|
270
|
-
.lockerverse-auctions__item-copy h2 {
|
|
271
|
+
.lockerverse-auctions__item-copy :is(h1, h2) {
|
|
271
272
|
font-size: var(--lockerverse-auction-item-title-size, 30px);
|
|
272
273
|
}
|
|
273
274
|
.lockerverse-auctions__selection-header,
|
package/dist/auction-item.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ type LockerverseAuctionItemProps = {
|
|
|
15
15
|
auction: LockerverseAuction;
|
|
16
16
|
client: LockerverseAuctionClient;
|
|
17
17
|
itemId: string;
|
|
18
|
+
/** Use level 1 when this item is the main content of its own page. Defaults to 2. */
|
|
19
|
+
itemHeadingLevel?: 1 | 2;
|
|
20
|
+
/** Image sizes for the inline gallery, matched to the host page layout. */
|
|
21
|
+
galleryImageSizes?: string;
|
|
18
22
|
/** Host navigation; the SDK does not depend on a router. */
|
|
19
23
|
onBack?: (() => void) | undefined;
|
|
20
24
|
/** Native URL for returning to the auction, including direct item visits. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auction-item.d.ts","names":[],"sources":["../src/auction-item-types.ts","../src/lockerverse-auction-item.tsx"],"mappings":";;;;;KAaY;EACV;EACA;EACA,MAAM;EACN,SAAS,YAAY;EACrB,SAAS;EACT,YAAY;;KAGF;EACV,SAAS;EACT,QAAQ;EACR;;EAEA;;EAEA;;EAEA;;;EAGA,2BAA2B;EAC3B;EACA;EACA,QAAQ;EACR,QAAQ;EACR,eAAe;;EAEf,kBAAkB,QAAQ;;EAE1B,sBAAsB,QAAQ;EAC9B,4BACE,UAAU;EAEZ,eAAe;;EAEf,iBAAiB;;;;
|
|
1
|
+
{"version":3,"file":"auction-item.d.ts","names":[],"sources":["../src/auction-item-types.ts","../src/lockerverse-auction-item.tsx"],"mappings":";;;;;KAaY;EACV;EACA;EACA,MAAM;EACN,SAAS,YAAY;EACrB,SAAS;EACT,YAAY;;KAGF;EACV,SAAS;EACT,QAAQ;EACR;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;EAGA,2BAA2B;EAC3B;EACA;EACA,QAAQ;EACR,QAAQ;EACR,eAAe;;EAEf,kBAAkB,QAAQ;;EAE1B,sBAAsB,QAAQ;EAC9B,4BACE,UAAU;EAEZ,eAAe;;EAEf,iBAAiB;;;;iBCgYH,uBAAuB,OAAO,8CAA2B,IAAA"}
|
package/dist/auction-item.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,l as r,n as i,r as a,s as o,t as s}from"./use-auction-boundary.js";import{t as c}from"./auction-image.js";import{d as l,n as u,p as d,r as f,t as p,u as m}from"./phone-field.js";import{t as h}from"./host-callback.js";import{i as g,n as _,t as v}from"./stripe-loader.js";import{t as y}from"./auction-result2.js";import{ArrowRight as b,ChevronDown as x,ChevronLeft as S,ChevronRight as C,Clock3 as w,Gavel as T,Pause as E,Play as ee,ShieldCheck as D,TimerReset as O,X as k}from"lucide-react";import{useCallback as A,useEffect as j,useId as M,useMemo as N,useRef as P,useState as F}from"react";import{Fragment as I,jsx as L,jsxs as R}from"react/jsx-runtime";import{LockerverseSdkError as z,calculateLockerverseAuctionPricing as B,getLockerverseAuctionMinimumBid as V}from"@lockerverse/sdk/auctions";import{AddressElement as H,Elements as U,PaymentElement as W,useElements as G,useStripe as te}from"@stripe/react-stripe-js";import{Dialog as K}from"@base-ui/react/dialog";import q from"embla-carousel-autoplay";import J from"embla-carousel-react";function Y(e){return{business:{name:`Lockerverse`},fields:{billingDetails:{address:`never`,email:`never`,name:`never`,phone:`never`}},terms:{applePay:e?`auto`:`never`,auBecsDebit:`never`,bancontact:`never`,card:`always`,cashapp:`never`,googlePay:`never`,ideal:`never`,paypal:e?`auto`:`never`,sepaDebit:`never`,sofort:`never`,usBankAccount:`never`},wallets:{applePay:e?`auto`:`never`,googlePay:`never`}}}function ne(e){let{isPurchase:t,item:r,pricing:i,id:a}=e;return R(`form`,{className:`lockerverse-auctions__checkout`,noValidate:!0,onSubmit:e.onSubmit,children:[R(`div`,{className:`lockerverse-auctions__checkout-header`,children:[R(`div`,{className:`lockerverse-auctions__checkout-navigation`,children:[L(`button`,{"aria-label":`Back`,className:`lockerverse-auctions__checkout-back`,disabled:!e.onBack,onClick:e.onBack,type:`button`,children:L(S,{"aria-hidden":`true`,size:20})}),R(`div`,{children:[L(`p`,{className:`lockerverse-auctions__checkout-eyebrow`,children:`Step 2 of 2`}),L(`p`,{children:t?`Secure checkout`:`Secure payment method`})]})]}),L(`p`,{className:`lockerverse-auctions__checkout-eyebrow`,children:e.communityName}),L(`h2`,{children:t?`Finalize your purchase.`:`Finalize your bid authorization.`}),L(`p`,{className:`lockerverse-auctions__checkout-summary`,children:t?R(I,{children:[`Pay `,L(`strong`,{children:n(i.totalCents)}),` for`,` `,e.quantity,` `,e.quantity===1?`item`:`items`,` of`,` `,L(`strong`,{children:r.name}),`. Your card is charged immediately once checkout succeeds.`]}):R(I,{children:[`Authorize a payment method for your bid of`,` `,L(`strong`,{children:n(i.subtotalCents)}),` on`,` `,L(`strong`,{children:r.name}),`. Your card is only charged if this bid wins the item.`]})}),r.collectShippingAddress&&R(`div`,{className:`lockerverse-auctions__checkout-physical`,children:[L(`p`,{className:`lockerverse-auctions__checkout-eyebrow`,children:`Physical item`}),L(`p`,{children:`This item requires a delivery address. Billing details are used by default, and you can switch to a separate delivery address below if needed.`})]})]}),R(`div`,{className:`lockerverse-auctions__checkout-body`,children:[e.showFields&&R(`fieldset`,{disabled:e.locked,children:[R(`div`,{className:`lockerverse-auctions__checkout-contact`,children:[L(l,{error:e.contactErrors.email,id:`${a}-email`,label:`Email`,name:`email`,onChange:t=>e.onEmailChange(t.target.value),required:!0,value:e.email}),L(d,{error:e.contactErrors.phone,id:`${a}-phone`,label:`Phone`,children:L(p,{country:e.phoneCountry,error:e.contactErrors.phone,errorId:`${a}-phone-error`,id:`${a}-phone`,name:`phone`,onChange:e.onPhoneChange,required:!0,value:e.phone})})]}),R(`section`,{"aria-label":`Payment Information`,className:`lockerverse-auctions__checkout-section`,children:[R(`div`,{className:`lockerverse-auctions__checkout-section-heading`,children:[L(`h3`,{children:`Payment Information`}),L(`p`,{children:t?`Processed securely and charged immediately for this purchase.`:`Stored securely and charged only if your bid finishes on top.`})]}),L(W,{onLoadError:e.onPaymentLoadError,options:Y(t)})]}),R(`section`,{"aria-label":`Billing Details`,className:`lockerverse-auctions__checkout-section`,children:[L(`h3`,{children:`Billing Details`}),L(H,{onChange:e.onBillingChange,options:{mode:`billing`}}),L(`p`,{children:t?`Use your full name here. We use the email and phone above for purchase confirmation and fulfillment updates.`:`Use the bidder's full name here. We use the email and phone above to contact you if this bid is outbid or wins.`})]}),r.collectShippingAddress&&R(`section`,{"aria-label":`Delivery Details`,className:`lockerverse-auctions__checkout-section`,children:[R(`label`,{className:`lockerverse-auctions__checkout-checkbox lockerverse-auctions__checkout-delivery`,htmlFor:`${a}-delivery-same-as-billing`,children:[L(m,{checked:e.sameAsBilling,id:`${a}-delivery-same-as-billing`,onChange:t=>e.onSameAsBillingChange(t.target.checked)}),R(`span`,{children:[L(`strong`,{children:`Delivery address is the same as billing`}),L(`span`,{children:`Leave this on for the fastest flow. Turn it off only if the delivery address should differ from the billing details above.`})]})]}),!e.sameAsBilling&&R(I,{children:[L(`h3`,{children:`Delivery Address`}),L(H,{onChange:e.onShippingChange,options:{mode:`shipping`}})]})]}),e.serviceFeeEnabled&&L(X,{...e})]}),e.message&&L(`p`,{"aria-live":`polite`,className:`lockerverse-auctions__notice`,role:`status`,children:e.message}),!e.isTerminal&&R(`div`,{className:`lockerverse-auctions__checkout-footer`,children:[R(`p`,{children:[t?`By continuing, you agree to be charged for this purchase.`:`By continuing, you agree to have this payment method stored for item settlement if your bid is the winning offer.`,r.collectShippingAddress?` Your delivery details are stored with the ${t?`order`:`bid`} so the seller can fulfill the item after payment.`:``]}),R(`button`,{className:`lockerverse-auctions__button lockerverse-auctions__checkout-submit`,disabled:e.submitDisabled,type:`submit`,children:[e.buttonText,L(b,{"aria-hidden":`true`,size:16})]})]})]})]})}function X(e){let{isPurchase:t,pricing:r}=e;return L(`section`,{"aria-label":`Processing fees`,className:`lockerverse-auctions__checkout-section`,children:e.onIncludeServiceFeeChange?R(`label`,{className:`lockerverse-auctions__checkout-checkbox`,htmlFor:`${e.id}-service-fee`,children:[L(m,{checked:e.includeServiceFee,id:`${e.id}-service-fee`,onChange:t=>e.onIncludeServiceFeeChange?.(t.target.checked)}),R(`span`,{children:[R(`strong`,{children:[t?`Add`:`If I win, add`,` `,n(e.serviceFeeCents),` to help cover processing fees`]}),R(`span`,{children:[t?`Total`:`Total if I win`,`:`,` `,n(r.totalCents)]})]})]}):R(`p`,{children:[t?`Total`:`Total if I win`,`:`,` `,n(r.totalCents)]})})}function Z(e,t,n){return B(e,t.saleMode===`buy_now`?(t.buyNowPriceAmount??0)*n.quantity:n.amount,n.includeServiceFee)}function re(t,n,r){if(e(t,n)!==`active`)return`This item is not accepting bids or purchases.`;if(n.saleMode===`hybrid`)return`This item type is not supported for checkout.`;if(n.saleMode===`buy_now`){if(n.isSoldOut||n.availableQuantity===0)return`This item is sold out.`;if(!(n.buyNowPriceAmount&&Number.isSafeInteger(r.quantity))||r.quantity<1||n.availableQuantity!==null&&r.quantity>n.availableQuantity)return`Select an available quantity.`}else if(!Number.isSafeInteger(r.amount)||r.amount%100!=0||r.amount<V(n))return`Enter a whole-dollar bid at or above the minimum bid.`;return null}function ie(e,t,n,r,i){return e.payment?.publishableKey!==t.payment?.publishableKey||e.payment?.connectedAccountId!==t.payment?.connectedAccountId||e.serviceFeeEnabled!==t.serviceFeeEnabled||n.saleMode!==r.saleMode||n.collectShippingAddress!==r.collectShippingAddress||JSON.stringify(Z(e,n,i))!==JSON.stringify(Z(t,r,i))}function ae(e){return{expectedServiceFeeCents:e.serviceFeeCents,expectedSubtotalCents:e.subtotalCents,expectedTotalCents:e.totalCents}}async function oe({stripe:e,elements:t,email:n,phone:r,billing:i,shipping:a,collectShippingAddress:o}){if(!(i?.complete&&i.value.name.trim()))throw Error(`Complete your billing name and address.`);if(o&&!(a?.complete&&a.value.name.trim()))throw Error(`Complete your shipping name and address.`);let s=await t.submit();if(s.error)throw Error(s.error.message??`Check your payment details.`);let c=await e.createConfirmationToken({elements:t,params:{payment_method_data:{allow_redisplay:`always`,billing_details:{address:i.value.address,email:n,name:i.value.name,phone:r}},return_url:window.location.href,...o&&a?{shipping:{address:a.value.address,name:a.value.name,phone:r}}:void 0}});if(c.error||!c.confirmationToken)throw Error(c.error?.message??`Unable to prepare payment details.`);return c.confirmationToken.id}async function se(e,t){if(!t.requiresAction)return;if(!t.clientSecret)throw Error(`Payment confirmation is incomplete. Check its status before trying again.`);let n=await e.handleNextAction({clientSecret:t.clientSecret});if(n.error)throw Error(n.error.message??`Payment confirmation is incomplete.`)}function ce(e,t,n){return e===`busy`?n?`Processing...`:`Authorizing...`:e===`retry`?`Retry original purchase`:t?`Check purchase status`:n?`Buy Now`:`Authorize Bid`}function le(e){let{auction:t,item:n,selection:r,client:i,onReview:a,onBack:o}=e,s=te(),c=G(),l=M(),[d,p]=F(e.contact?.email??``),[m,_]=F(e.contact?.phone??``),[v,y]=F(()=>f(e.contact?.phone??``)),[b,x]=F({}),[S,C]=F(!0),[w,T]=F(null),[E,ee]=F(null),[D,O]=F(e.resumePurchase??null),[k,A]=F(e.resumePurchase?`pending`:`ready`),[N,I]=F(null),R=P(e.resumePurchase?.submission.clientRequestId??null),B=k===`complete`||k===`uncertain`,V=P(!1),H=P(!0),U=P(e);U.current=e;let W=P(!1);function K(e){H.current&&A(e),h(U.current.onInteractionLockChange,e!==`ready`&&e!==`complete`)}function q(e){H.current&&I(e)}function J(e){K(e===`bid`?`uncertain`:`pending`),q(e===`bid`?`We could not confirm your bid. Do not submit another bid until you check your email or contact the auction organizer.`:`We could not confirm the purchase result. Check its status using the same purchase request.`),W.current||(W.current=!0,h(U.current.onUncertain,e))}j(()=>(H.current=!0,()=>{H.current=!1}),[]);let Y=!!(D??e.resumePurchase)||n.saleMode===`buy_now`,X=D?.pricing??e.resumePurchase?.pricing??Z(t,n,r),le=D?.payment??e.resumePurchase?.payment??t.payment;function Q(e){H.current&&O(e),h(U.current.onPurchaseRecoveryChange,e)}function ue(e){e.status===`paid`?(R.current=null,Q(null),K(`complete`),h(U.current.onResult,{kind:`purchase`,purchaseId:e.purchaseId,quantity:e.quantity,serviceFeeCents:e.serviceFeeCents,status:`paid`,subtotalCents:e.subtotalCents,totalCents:e.totalCents,unitAmountCents:e.subtotalCents/e.quantity}),W.current||(W.current=!0,h(U.current.onPurchaseComplete,e))):e.status===`pending_payment`?(K(`pending`),q(`Your purchase is pending. Check its status before making another payment.`)):(R.current=null,Q(null),K(`ready`),q(`This purchase is ${e.status.replaceAll(`_`,` `)}. You can start a new purchase.`))}function de(){let e=u(m,v),t=g({email:d,phone:e},!0);return x(t.errors),t.value?{email:t.value.email,phone:e}:(document.getElementById(`${l}-${t.errors.email?`email`:`phone`}`)?.focus(),null)}async function fe(e){if(!e)throw Error(`Check the contact fields below.`);if(!(s&&c&&t.payment))throw Error(`Payment details are still loading.`);let o=await i.load(t.slug);if(!H.current)return null;let l=o.items.find(e=>e.id===n.id);if(!l)return a(o,`This item is no longer available.`),null;let u=re(o,l,r);if(u||ie(t,o,n,l,r))return a(o,u??`The checkout details changed. Review them before continuing.`),null;let d=await oe({billing:w,collectShippingAddress:n.collectShippingAddress,elements:c,email:e.email,phone:e.phone,shipping:S?w:E,stripe:s});return H.current?{confirmationToken:d,email:e.email,includeServiceFee:r.includeServiceFee,phone:e.phone,...ae(X)}:null}async function pe(e){let a=await i.createBid(t.slug,n.id,{...e,amount:r.amount});if(a.requiresAction){if(!(H.current&&s)){J(`bid`);return}await se(s,a)}K(`complete`),h(U.current.onResult,{amountCents:a.subtotalCents,kind:`bid`}),W.current||(W.current=!0,h(U.current.onBidSubmitted,a))}async function $(e,r){if(e.requiresAction){if(!(H.current&&s)){J(`purchase`);return}await se(s,e);let a=await i.getPurchaseStatus(t.slug,n.id,r.submission.clientRequestId);a?ue(a):(K(`pending`),q(`Payment status is not available yet. Check again shortly.`));return}ue(e),!H.current&&e.status===`pending_payment`&&J(`purchase`)}async function me(e){let r=await i.getPurchaseStatus(t.slug,n.id,e.submission.clientRequestId);if(r)await $(r,e);else{if(!H.current){J(`purchase`);return}K(`retry`),q(`No purchase is recorded yet. You can retry the original purchase with the same request ID.`)}}async function he(e,r){let a=await i.getPurchaseStatus(t.slug,n.id,r.submission.clientRequestId);if(a){await $(a,r);return}Q(null),K(`ready`),q(`The purchase was rejected. Review the item and payment details before trying again. (${e.status??`validation`})`)}async function ge(e,t,n,r){let i=t&&(!(e instanceof z)||e.recoveryRecommended);if(q(e instanceof Error?e.message:`Unable to complete this request.`),Y&&n){if(!r&&e instanceof z&&!e.recoveryRecommended)try{await he(e,n);return}catch{}J(`purchase`)}else i?J(`bid`):K(`ready`)}function _e(){return R.current??=globalThis.crypto.randomUUID(),R.current}function ve(){return H.current?!0:(D||(Q(null),K(`ready`)),!1)}async function ye(e,r){if(r){await me(e);return}ve()&&await $(await i.createPurchase(t.slug,n.id,e.submission),e)}let be=s&&c&≤function xe(){if(V.current||B)return null;if(!be)return q(`Payment details are still loading.`),null;let e=D?null:de();return D||e?{checkoutPayment:be,contact:e,retryOriginal:k===`retry`}:null}async function Se(e){e.preventDefault();let i=xe();if(!i)return;let{contact:a,checkoutPayment:o,retryOriginal:s}=i;V.current=!0,W.current=!1,K(`busy`),q(null);let c=!1,l=D;try{if(!l){let e=await fe(a);if(!(e&&H.current)){K(`ready`);return}if(!Y){c=!0,await pe(e);return}l=Object.freeze({auctionId:t.id,item:n,itemId:n.id,payment:Object.freeze({...o}),pricing:X,submission:Object.freeze({...e,clientRequestId:_e(),paymentMethodTypes:Object.freeze([`card`]),quantity:r.quantity})}),Q(l)}c=!0,await ye(l,!!D&&!s)}catch(e){await ge(e,c,l,D!==null&&!s)}finally{V.current=!1}}let Ce=ce(k,D!==null,Y),we=k!==`ready`;return L(ne,{buttonText:Ce,communityName:e.communityName??t.name,contactErrors:b,email:d,id:l,includeServiceFee:r.includeServiceFee,isPurchase:Y,isTerminal:B,item:n,locked:we,message:N,onBack:k===`ready`?o:void 0,onBillingChange:T,onEmailChange:t=>{p(t),e.onContactChange?.({email:t,phone:u(m,v)})},onIncludeServiceFeeChange:e.onIncludeServiceFeeChange,onPaymentLoadError:()=>q(`Unable to load payment form.`),onPhoneChange:({value:t,country:n})=>{_(t),y(n),e.onContactChange?.({email:d,phone:u(t,n)})},onSameAsBillingChange:C,onShippingChange:ee,onSubmit:Se,phone:m,phoneCountry:v,pricing:X,quantity:r.quantity,sameAsBilling:S,serviceFeeCents:D?X.serviceFeeCents:Z(t,n,{...r,includeServiceFee:t.serviceFeeEnabled}).serviceFeeCents,serviceFeeEnabled:t.serviceFeeEnabled,showFields:!(D||B),submitDisabled:k===`busy`||!s||!c})}const Q=6e3;function ue(e,t){let n=P(Q),r=P(null),[i,a]=F(Q),o=N(()=>q({delay:i,playOnInit:!1,stopOnFocusIn:!1,stopOnInteraction:!0,stopOnMouseEnter:!1}),[i]),[s,c]=J({duration:t?0:25,loop:!0},[o]),l=A(()=>{r.current&&(r.current.style.transform=`scaleX(${1-n.current/Q})`)},[]),u=A(()=>{let e=o.timeUntilNext();e!==null&&(n.current=Math.max(1,Math.min(Q,e))),o.stop(),l()},[o,l]),d=A(()=>{n.current=Q,a(Q),o.reset(),l()},[o,l]);return j(()=>{c&&(e?i===n.current?o.play():a(n.current):u())},[c,e,o,i,a,n,u]),j(()=>{if(!c)return;let t=0,r=()=>{let i=o.timeUntilNext();!e||i===null||(n.current=Math.max(0,Math.min(Q,i)),l(),t=requestAnimationFrame(r))},i=()=>{cancelAnimationFrame(t),e&&(t=requestAnimationFrame(r))},a=()=>cancelAnimationFrame(t),s=()=>{e&&o.play()};return c.on(`select`,d).on(`reInit`,s).on(`autoplay:timerset`,i).on(`autoplay:timerstopped`,a),l(),i(),()=>{a(),c.off(`select`,d).off(`reInit`,s).off(`autoplay:timerset`,i).off(`autoplay:timerstopped`,a)}},[c,o,e,n,d,l]),{embla:c,freeze:u,progressRef:r,reset:d,viewportRef:s}}function de({photos:e,name:t,selected:n,paused:r=!1,photoButtonRef:a,onSelect:o,onExpand:s}){let l=P(null),u=P(null),d=P([]),[f,p]=F(!0),[m,h]=F(!1),[g,_]=F(!1),[v,y]=F(!1),[b,x]=F(!1),{ref:w,visible:T}=i(),[D,O]=F(!1),[k,A]=F(!0),M=P(null),N=`lockerverse-auction-gallery__control ${k||D||g?`is-visible`:``}`,z=()=>{M.current&&clearTimeout(M.current),M.current=setTimeout(()=>O(!1),2e3)},B=e=>{if(e.pointerType!==`mouse`){A(!0);return}O(!0),M.current&&clearTimeout(M.current),e.target instanceof Element&&e.target.closest(`[data-gallery-control]`)||z()};j(()=>{let e=window.matchMedia(`(hover: none), (pointer: coarse)`),t=()=>A(e.matches);return t(),e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t),clearTimeout(M.current??void 0)}},[]);let V=!(r||f||m||g||v||b)&&T,H=e.length,U=H?(n%H+H)%H:0,{viewportRef:W,embla:G,progressRef:te,freeze:K,reset:q}=ue(V&&H>1,f);j(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>p(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),j(()=>{if(!G)return;let e=()=>o(G.selectedScrollSnap());return G.on(`select`,e).on(`reInit`,e),()=>{G.off(`select`,e).off(`reInit`,e)}},[G,o]),j(()=>{G&&G.selectedScrollSnap()!==U&&G.scrollTo(U,!0)},[G,U]),j(()=>{let e=()=>{document.hidden&&K()},t=()=>x(!1);return e(),document.addEventListener(`visibilitychange`,e,!0),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{document.removeEventListener(`visibilitychange`,e,!0),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[K]);let J=e=>{G?.scrollTo((e+H)%H,f),q()};return j(()=>{let e=u.current;u.current=null,e&&document.activeElement===e&&w.current?.querySelector(`.lockerverse-auction-gallery__photo[tabindex="0"]`)?.focus({preventScroll:!0})},[U,w]),j(()=>{let e=l.current,t=d.current[U];if(!(e&&t))return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.left<n.left?e.scrollLeft-=n.left-r.left:r.right>n.right&&(e.scrollLeft+=r.right-n.right)},[U,H]),R(`section`,{"aria-label":`${t} photos`,className:`lockerverse-auction-gallery`,onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||_(!1)},onFocusCapture:e=>_(e.target.matches(`:focus-visible`)),onKeyDown:e=>{H<2||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),e.target instanceof HTMLButtonElement&&e.target.classList.contains(`lockerverse-auction-gallery__photo`)&&(u.current=e.target),J(U+(e.key===`ArrowRight`?1:-1)))},onPointerEnter:e=>{e.pointerType===`mouse`&&h(!0)},onPointerLeave:e=>{e.pointerType===`mouse`&&h(!1)},ref:w,children:[H?R(`div`,{className:`lockerverse-auction-gallery__stage`,onPointerEnter:B,onPointerLeave:z,onPointerMove:B,children:[L(`div`,{className:`lockerverse-auction-gallery__viewport`,onPointerDownCapture:()=>{K(),x(!0)},ref:W,children:L(`div`,{className:`lockerverse-auction-gallery__track`,children:e.map((e,n)=>L(`div`,{"aria-hidden":n!==U,className:`lockerverse-auction-gallery__slide`,children:L(`button`,{"aria-label":`View photo ${n+1} of ${t} at full size`,className:`lockerverse-auction-gallery__photo`,onClick:()=>{s(n)},ref:n===U?a:void 0,tabIndex:n===U?0:-1,type:`button`,children:L(c,{alt:`${t}, ${n+1} of ${H}`,className:`lockerverse-auction-gallery__image`,draggable:!1,height:900,loading:n===0||n===U||n===(U+1)%H?`eager`:`lazy`,maxWidth:1280,sizes:`(max-width: 1280px) 100vw, 45vw`,src:e,width:1200})})},`${e}-${n}`))})}),H>1&&!f&&R(`div`,{className:`lockerverse-auction-gallery__rotation`,children:[L(`div`,{"aria-hidden":`true`,className:`lockerverse-auction-gallery__progress-track`,children:L(`div`,{className:`lockerverse-auction-gallery__progress`,ref:te,style:{transform:`scaleX(0)`}})}),L(`button`,{"aria-label":v?`Play photo rotation`:`Pause photo rotation`,className:`lockerverse-auction-gallery__play ${N}`,"data-gallery-control":!0,onClick:()=>y(e=>!e),title:v?`Play photo rotation`:`Pause photo rotation`,type:`button`,children:L(v?ee:E,{"aria-hidden":`true`,size:13})})]}),H>1&&R(I,{children:[L(`button`,{"aria-label":`Previous photo`,className:`lockerverse-auction-gallery__previous ${N}`,"data-gallery-control":!0,onClick:()=>J(U-1),type:`button`,children:L(S,{"aria-hidden":`true`,className:`lockerverse-auction-gallery__chevron`})}),L(`button`,{"aria-label":`Next photo`,className:`lockerverse-auction-gallery__next ${N}`,"data-gallery-control":!0,onClick:()=>J(U+1),type:`button`,children:L(C,{"aria-hidden":`true`,className:`lockerverse-auction-gallery__chevron`})})]})]}):L(`div`,{className:`lockerverse-auction-gallery__empty`,children:`No photo available`}),H>1&&L(`section`,{"aria-label":`Choose a photo`,className:`lockerverse-auction-gallery__strip`,ref:l,children:L(`div`,{className:`lockerverse-auction-gallery__thumbnails`,children:e.map((e,t)=>L(`button`,{"aria-label":`Show photo ${t+1} of ${H}`,"aria-pressed":U===t,className:`lockerverse-auction-gallery__thumbnail ${U===t?`is-selected`:``}`,onClick:()=>J(t),ref:e=>{d.current[t]=e},type:`button`,children:L(c,{alt:``,className:`lockerverse-auction-gallery__thumbnail-image`,height:66,loading:`lazy`,maxWidth:192,sizes:`88px`,src:e,width:88})},`${e}-${t}`))})})]})}function fe({images:e,fallbackImage:t,name:n}){let r=[...new Set(e.filter(Boolean))];!r.length&&t&&r.push(t);let[i,a]=F(0),[o,s]=F(!1),l=P(null),u=P(null),d=r.length,f=d?(i%d+d)%d:0;return R(I,{children:[L(de,{name:n,onExpand:e=>{a(e),s(!0)},onSelect:a,paused:o,photoButtonRef:l,photos:r,selected:f}),d>0&&L(K.Root,{onOpenChange:s,open:o,children:R(K.Portal,{children:[L(K.Backdrop,{className:`lockerverse-auction-gallery__backdrop`}),R(K.Popup,{"aria-describedby":void 0,className:`lockerverse-auction-gallery__viewer`,finalFocus:l,onKeyDown:e=>{d<2||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),a((f+(e.key===`ArrowRight`?1:-1)+d)%d))},children:[R(K.Title,{className:`lockerverse-auction-gallery__sr-only`,children:[n,` · Photo `,f+1,` of `,d]}),R(`div`,{className:`lockerverse-auction-gallery__full-image`,onTouchCancel:()=>{u.current=null},onTouchEnd:e=>{let t=u.current;u.current=null;let n=e.changedTouches.item(0);if(!(t&&n)||d<2)return;let r=n.clientX-t.x,i=n.clientY-t.y;Math.abs(r)>=45&&Math.abs(r)>Math.abs(i)*1.3&&a((f+(r<0?1:-1)+d)%d)},onTouchMove:e=>{e.touches.length!==1&&(u.current=null)},onTouchStart:e=>{let t=e.touches.item(0);u.current=e.touches.length===1&&t?{x:t.clientX,y:t.clientY}:null},children:[L(c,{alt:`${n}, ${f+1} of ${d}`,height:900,maxWidth:1920,sizes:`100vw`,src:r[f],width:1200}),o&&d>1&&L(c,{alt:``,"aria-hidden":`true`,className:`lockerverse-auction-gallery__preload`,height:900,loading:`eager`,maxWidth:1920,sizes:`100vw`,src:r[(f+1)%d],width:1200})]}),L(K.Close,{"aria-label":`Close photo viewer`,className:`lockerverse-auction-gallery__viewer-close`,children:L(k,{"aria-hidden":`true`,size:22})}),d>1&&R(I,{children:[L(`button`,{"aria-label":`Previous photo`,className:`lockerverse-auction-gallery__viewer-previous`,onClick:()=>a((f-1+d)%d),type:`button`,children:L(S,{"aria-hidden":`true`,size:28})}),L(`button`,{"aria-label":`Next photo`,className:`lockerverse-auction-gallery__viewer-next`,onClick:()=>a((f+1)%d),type:`button`,children:L(C,{"aria-hidden":`true`,size:28})})]})]})]})})]})}function pe(e){return L(e===`Buy Now`?D:e===`Available`||e===`Increment`?O:T,{"aria-hidden":`true`,size:16})}function $(e,t){return e.saleMode===`buy_now`?[[`Buy Now`,n(e.buyNowPriceAmount??0)],[`Available`,e.availableQuantity===null?`Available`:String(e.availableQuantity)]]:t===`finished`?[[`Final bid`,e.maxBidAmount?n(e.maxBidAmount):`No bids`]]:[[`Current bid`,n(e.maxBidAmount??0)],[`Floor`,n(e.minBidAmount??0)],[`Increment`,n(e.bidIncrementAmount??100)]]}function me({auction:r,item:i}){s(i.startAt??r.startAt,i.endAt??r.endAt);let[o,c]=F(!1),l=M(),u=e(r,i),d={active:`Closes`,draft:`Opens`,finished:`Closed`}[u],f=a(r,u,i),p=i.saleMode===`buy_now`,m=(i.description??``).trim().length>240,h=$(i,u);return R(`section`,{className:`lockerverse-auctions__item-summary`,children:[L(fe,{fallbackImage:i.image??r.configuration.image??r.community?.banner??r.community?.thumbnail??null,images:i.images,name:i.name}),R(`div`,{className:`lockerverse-auctions__item-copy`,children:[L(`h2`,{children:i.name}),i.description?R(`div`,{className:`lockerverse-auctions__item-description`,children:[L(t,{className:!o&&m?`lockerverse-auctions__description-clamped`:void 0,description:i.description,id:l}),m?R(`button`,{"aria-controls":l,"aria-expanded":o,className:`lockerverse-auctions__description-toggle`,onClick:()=>c(!o),type:`button`,children:[o?`Hide description`:`Read full description`,` `,L(x,{"aria-hidden":`true`,size:16,style:{transform:o?`rotate(180deg)`:void 0}})]}):null]}):null,R(`dl`,{className:`lockerverse-auctions__stat-panel`,children:[h.map(([e,t])=>R(`div`,{className:`lockerverse-auctions__stat-row`,children:[R(`dt`,{children:[pe(e),e]}),L(`dd`,{children:t})]},e)),R(`div`,{className:`lockerverse-auctions__stat-row`,children:[R(`dt`,{children:[L(w,{"aria-hidden":`true`,size:16}),d]}),L(`dd`,{className:`lockerverse-auctions__stat-date`,children:f})]}),!p&&u===`finished`?R(`div`,{className:`lockerverse-auctions__stat-footer`,children:[R(`div`,{children:[L(`dt`,{children:`Floor`}),L(`dd`,{children:n(i.minBidAmount??0)})]}),R(`div`,{children:[L(`dt`,{children:`Bid increment`}),L(`dd`,{children:n(i.bidIncrementAmount??100)})]})]}):null]})]})]})}const he=/^\d+$/;function ge(e,t){return he.test(e)&&Number.isSafeInteger(Number(e)*t)?`Total: ${n(Number(e)*t)}`:`Enter a whole-number quantity.`}function _e(e,t,n){return String(e?t?t.quantity:1:t?t.amount/100:n)}function ve(e,t){return o(e)?`This item is sold out.`:t===`draft`?`This item is not open yet.`:t===`finished`?e.saleMode===`buy_now`?`Purchases are closed for this item.`:`Bidding is closed for this item.`:`This item is not available.`}function ye(e,t,n){return o(t)?`All available quantities have been purchased.`:n===`draft`?`This item opens ${a(e,`draft`,t)}.`:t.saleMode===`buy_now`?`This item is no longer available to purchase.`:`Bidding has closed for this item.`}function be(e,t,n,r){return{amount:t?0:Number(r)*100,includeServiceFee:n?n.includeServiceFee:e.serviceFeeEnabled&&e.serviceFeeDefaultChecked,quantity:t?Number(r):1}}function xe({auction:t,item:i,initialSelection:a,onContinue:c,onError:l,onBack:u,backHref:d}){let f=i.saleMode===`buy_now`,p=Math.ceil(V(i)/100),[m,h]=F(_e(f,a,p)),[g,_]=F(null),v=M();s(i.startAt??t.startAt,i.endAt??t.endAt);let y=e(t,i),x=y===`active`&&!o(i)&&i.saleMode!==`hybrid`;function S(e){if(e.preventDefault(),!he.test(m)){_(f?`Enter a whole-number quantity.`:`Enter a whole-dollar bid amount.`);return}let n=be(t,f,a,m),r=re(t,i,n);if(r){_(r),l(r);return}try{Z(t,i,n)}catch{_(`Enter a valid amount or quantity.`);return}c(n)}return x?R(`form`,{className:`lockerverse-auctions__selection`,onSubmit:S,children:[L(Se,{buyNow:f,item:i,minimum:p}),R(`div`,{className:`lockerverse-auctions__selection-body`,children:[R(`label`,{className:`lockerverse-auctions__field`,htmlFor:v,children:[f?`Quantity`:`Your bid amount`,R(`span`,{className:`lockerverse-auctions__amount-control`,children:[f?null:L(`span`,{"aria-hidden":`true`,children:`$`}),L(`input`,{"aria-describedby":`${v}-help`,"aria-invalid":!!g,autoComplete:`off`,id:v,inputMode:`numeric`,onChange:e=>{h(e.target.value),_(null)},placeholder:f?`1`:String(p),required:!0,value:m})]})]}),g?L(`p`,{role:`alert`,children:g}):null,L(`p`,{id:`${v}-help`,children:f?ge(m,i.buyNowPriceAmount??0):`Enter a whole-dollar bid of at least ${n(p*100)}. Bid increment: ${n(i.bidIncrementAmount??100)}.`}),R(`div`,{className:`lockerverse-auctions__selection-footer`,children:[L(`p`,{children:f?`Continuing moves you into secure checkout where your payment is processed immediately.`:`Continuing moves you into the secure payment step where your card is stored for settlement only if your bid wins.`}),R(`button`,{className:`lockerverse-auctions__button`,disabled:!t.payment,type:`submit`,children:[f?`Continue to Checkout`:`Continue to Payment`,` `,L(b,{"aria-hidden":`true`,size:16})]})]}),t.payment?null:L(`p`,{role:`alert`,children:`Payments are not configured for this auction.`})]})]}):R(`div`,{className:`lockerverse-auctions__selection lockerverse-auctions__read-only`,children:[L(`p`,{className:`lockerverse-auctions__eyebrow`,children:`Item status`}),L(`h3`,{children:ve(i,y)}),L(`p`,{children:ye(t,i,y)}),R(r,{className:`lockerverse-auctions__button`,href:d,onBack:u,children:[`Browse auction items `,L(b,{"aria-hidden":`true`,size:16})]})]})}function Se({item:e,buyNow:t,minimum:r}){return R(`div`,{className:`lockerverse-auctions__selection-header`,children:[L(`p`,{className:`lockerverse-auctions__eyebrow`,children:`Step 1 of 2`}),L(`h3`,{children:t?`Buy this item now.`:`Place your bid.`}),L(`p`,{children:t?`Choose how many you want, then complete the secure checkout.`:`Enter the bid amount you want to place for this item. You are only charged if this bid wins after bidding closes.`}),R(`p`,{children:[t?`Price: `:`Minimum qualifying bid: `,L(`strong`,{children:n(t?e.buyNowPriceAmount??0:r*100)})]}),t&&e.availableQuantity!==null?R(`p`,{children:[e.availableQuantity,` available`]}):null,e.collectShippingAddress?L(`p`,{children:`The next step will also collect a delivery address for seller fulfillment.`}):null]})}function Ce(e){let{auction:t,item:n,selection:r,theme:i=`dark`,stripeLoader:a=v,style:o,onBack:s,resumePurchase:c}=e,[l,u]=F(null),[d,f]=F(!1),[p,m]=F(0),h=_(e.appearanceRoot,i,o,e.interactionLocked),g=c?.payment??t.payment;if(j(()=>{let e=!0;if(!g){f(!0);return}return Promise.resolve().then(()=>a(g.publishableKey,g.connectedAccountId?{stripeAccount:g.connectedAccountId}:void 0)).then(t=>{e&&(u(t),f(!t))},()=>{e&&f(!0)}),()=>{e=!1}},[g,a,p]),d)return R(`div`,{children:[L(`p`,{role:`alert`,children:`Payment details could not load.`}),c?null:L(`button`,{onClick:s,type:`button`,children:`Back to item`}),L(`button`,{onClick:()=>{f(!1),u(null),m(e=>e+1)},type:`button`,children:`Try again`})]});if(!(l&&h))return R(`div`,{children:[L(`p`,{role:`status`,children:`Loading secure payment details…`}),c?null:L(`button`,{onClick:s,type:`button`,children:`Back to item`})]});let y={mode:`setup`,setupFutureUsage:`off_session`};c?y={amount:c.pricing.totalCents,currency:`usd`,mode:`payment`}:n.saleMode===`buy_now`&&(y={amount:Z(t,n,r).totalCents,currency:`usd`,mode:`payment`});let b={...y,appearance:h,currency:`usd`,paymentMethodTypes:[`card`],syncAddressCheckbox:`none`};return L(U,{options:b,stripe:l,children:L(le,{...e})})}function we({buyNow:e}){return R(`div`,{className:`lockerverse-auctions__progress`,children:[R(`span`,{children:[L(e?D:T,{"aria-hidden":`true`,size:16}),e?`Choose quantity`:`Place bid`]}),R(`span`,{children:[L(D,{"aria-hidden":`true`,size:16}),e?`Pay securely`:`Secure card`]}),R(`span`,{children:[L(O,{"aria-hidden":`true`,size:16}),e?`Get confirmation`:`Wait for close`]})]})}function Te(e){let{auction:t,item:n,outcome:r}=e,i;return e.backHref?i={href:e.backHref,label:`View auction items`}:e.onBack&&(i={label:`View auction items`,onClick:e.onBack}),L(y,{auctionName:t.name,className:e.className,closesAtLabel:a(t,`active`,n),communityName:e.communityName??t.community?.name,focusHeading:!0,imageUrl:n.image??n.images[0]??t.configuration.image??void 0,itemName:n.name,outcome:r,primaryAction:e.returnToItemHref?{href:e.returnToItemHref,label:`Return to item`}:i,secondaryAction:e.returnToItemHref?i:void 0,style:{"--lockerverse-accent":t.community?.color??`#6f8f6d`,...e.style},theme:e.theme})}function Ee(t){let{auction:n,itemId:i,resumePurchase:a,className:o,theme:c=`dark`,style:l}=t,u=P(null),[d,f]=F(n),p=P(n),m=d.items.find(e=>e.id===i)??a?.item;s(m?.startAt??d.startAt,m?.endAt??d.endAt);let[g,_]=F(()=>a?{amount:0,includeServiceFee:a.submission.includeServiceFee??!1,quantity:a.submission.quantity}:null),[v,y]=F(!!a),x=P(!0),C=P(t);C.current=t;let w=P(null),T=A(e=>{x.current&&y(e),w.current!==e&&(w.current=e,h(C.current.onInteractionLockChange,e))},[]),E=!!a;j(()=>(x.current=!0,T(E),()=>{x.current=!1}),[E,T]);let[ee,D]=F({email:``,phone:``}),[O,k]=F(!!a),[M,N]=F(null),[I,z]=F(null);j(()=>{!(O||v||a)&&p.current!==n&&(p.current=n,f(n))},[n,O,v,a]);function B(e,t){T(!1),p.current=C.current.auction,f(e),_(null),k(!1),N(t)}function V(e){N(null),_(e),k(!0)}return m?I?L(Te,{...t,auction:d,item:m,outcome:I}):R(`section`,{className:[`lockerverse-auctions`,o].filter(Boolean).join(` `),"data-lockerverse-theme":c,ref:u,style:{"--lockerverse-accent":d.community?.color??`#6f8f6d`,...l},children:[v?null:R(r,{className:`lockerverse-auctions__back`,href:t.backHref,onBack:t.onBack,children:[L(S,{"aria-hidden":`true`,size:16}),` All items`]}),R(`div`,{className:`lockerverse-auctions__detail`,children:[L(me,{auction:d,item:m}),R(`div`,{className:`lockerverse-auctions__transaction`,children:[e(d,m)===`active`?L(we,{buyNow:m.saleMode===`buy_now`}):null,M?L(`p`,{className:`lockerverse-auctions__notice`,role:`alert`,children:M}):null,O&&g?L(Ce,{...t,appearanceRoot:u,auction:d,communityName:t.communityName??d.community?.name,contact:ee,interactionLocked:v,item:m,onBack:()=>k(!1),onContactChange:D,onIncludeServiceFeeChange:e=>_(t=>t&&{...t,includeServiceFee:d.serviceFeeEnabled&&e}),onInteractionLockChange:T,onResult:z,onReview:B,selection:g}):L(xe,{auction:d,backHref:t.backHref,initialSelection:g,item:m,onBack:t.onBack,onContinue:V,onError:N}),v?null:R(r,{className:`lockerverse-auctions__footer-back`,href:t.backHref,onBack:t.onBack,children:[`Back to auction items `,L(b,{"aria-hidden":`true`,size:16})]})]})]})]}):R(`div`,{children:[L(`p`,{role:`alert`,children:`This auction item is no longer available.`}),L(r,{href:t.backHref,onBack:t.onBack,children:`Back to auction items`})]})}function De(e){let t=P({auctionId:e.auction.id,client:e.client,itemId:e.itemId});if(t.current.client!==e.client||t.current.auctionId!==e.auction.id||t.current.itemId!==e.itemId)throw TypeError(`Auction item identity cannot change. Remount with a new React key.`);if(e.resumePurchase&&(e.resumePurchase.auctionId!==e.auction.id||e.resumePurchase.itemId!==e.itemId||e.resumePurchase.item.id!==e.itemId||e.resumePurchase.item.auctionId!==e.auction.id))throw TypeError(`The purchase recovery record belongs to a different auction item.`);return L(Ee,{...e})}export{De as LockerverseAuctionItem};
|
|
1
|
+
import{a as e,c as t,i as n,l as r,n as i,r as a,s as o,t as s}from"./use-auction-boundary.js";import{n as c,t as l}from"./auction-image.js";import{d as u,n as d,p as f,r as p,t as m,u as h}from"./phone-field.js";import{t as g}from"./host-callback.js";import{i as _,n as v,t as y}from"./stripe-loader.js";import{t as b}from"./auction-result2.js";import{ArrowRight as x,ChevronDown as S,ChevronLeft as C,ChevronRight as w,Clock3 as T,Gavel as E,Pause as ee,Play as D,ShieldCheck as O,TimerReset as k,X as A}from"lucide-react";import{useCallback as j,useEffect as M,useId as N,useMemo as P,useRef as F,useState as I}from"react";import{Fragment as L,jsx as R,jsxs as z}from"react/jsx-runtime";import{LockerverseSdkError as B,calculateLockerverseAuctionPricing as V,getLockerverseAuctionMinimumBid as H}from"@lockerverse/sdk/auctions";import{AddressElement as U,Elements as W,PaymentElement as G,useElements as K,useStripe as te}from"@stripe/react-stripe-js";import{Dialog as q}from"@base-ui/react/dialog";import J from"embla-carousel-autoplay";import Y from"embla-carousel-react";function X(e){return{business:{name:`Lockerverse`},fields:{billingDetails:{address:`never`,email:`never`,name:`never`,phone:`never`}},terms:{applePay:e?`auto`:`never`,auBecsDebit:`never`,bancontact:`never`,card:`always`,cashapp:`never`,googlePay:`never`,ideal:`never`,paypal:e?`auto`:`never`,sepaDebit:`never`,sofort:`never`,usBankAccount:`never`},wallets:{applePay:e?`auto`:`never`,googlePay:`never`}}}function ne(e){let{isPurchase:t,item:r,pricing:i,id:a}=e;return z(`form`,{className:`lockerverse-auctions__checkout`,noValidate:!0,onSubmit:e.onSubmit,children:[z(`div`,{className:`lockerverse-auctions__checkout-header`,children:[z(`div`,{className:`lockerverse-auctions__checkout-navigation`,children:[R(`button`,{"aria-label":`Back`,className:`lockerverse-auctions__checkout-back`,disabled:!e.onBack,onClick:e.onBack,type:`button`,children:R(C,{"aria-hidden":`true`,size:20})}),z(`div`,{children:[R(`p`,{className:`lockerverse-auctions__checkout-eyebrow`,children:`Step 2 of 2`}),R(`p`,{children:t?`Secure checkout`:`Secure payment method`})]})]}),R(`p`,{className:`lockerverse-auctions__checkout-eyebrow`,children:e.communityName}),R(`h2`,{children:t?`Finalize your purchase.`:`Finalize your bid authorization.`}),R(`p`,{className:`lockerverse-auctions__checkout-summary`,children:t?z(L,{children:[`Pay `,R(`strong`,{children:n(i.totalCents)}),` for`,` `,e.quantity,` `,e.quantity===1?`item`:`items`,` of`,` `,R(`strong`,{children:r.name}),`. Your card is charged immediately once checkout succeeds.`]}):z(L,{children:[`Authorize a payment method for your bid of`,` `,R(`strong`,{children:n(i.subtotalCents)}),` on`,` `,R(`strong`,{children:r.name}),`. Your card is only charged if this bid wins the item.`]})}),r.collectShippingAddress&&z(`div`,{className:`lockerverse-auctions__checkout-physical`,children:[R(`p`,{className:`lockerverse-auctions__checkout-eyebrow`,children:`Physical item`}),R(`p`,{children:`This item requires a delivery address. Billing details are used by default, and you can switch to a separate delivery address below if needed.`})]})]}),z(`div`,{className:`lockerverse-auctions__checkout-body`,children:[e.showFields&&z(`fieldset`,{disabled:e.locked,children:[z(`div`,{className:`lockerverse-auctions__checkout-contact`,children:[R(u,{error:e.contactErrors.email,id:`${a}-email`,label:`Email`,name:`email`,onChange:t=>e.onEmailChange(t.target.value),required:!0,value:e.email}),R(f,{error:e.contactErrors.phone,id:`${a}-phone`,label:`Phone`,children:R(m,{country:e.phoneCountry,error:e.contactErrors.phone,errorId:`${a}-phone-error`,id:`${a}-phone`,name:`phone`,onChange:e.onPhoneChange,required:!0,value:e.phone})})]}),z(`section`,{"aria-label":`Payment Information`,className:`lockerverse-auctions__checkout-section`,children:[z(`div`,{className:`lockerverse-auctions__checkout-section-heading`,children:[R(`h3`,{children:`Payment Information`}),R(`p`,{children:t?`Processed securely and charged immediately for this purchase.`:`Stored securely and charged only if your bid finishes on top.`})]}),R(G,{onLoadError:e.onPaymentLoadError,options:X(t)})]}),z(`section`,{"aria-label":`Billing Details`,className:`lockerverse-auctions__checkout-section`,children:[R(`h3`,{children:`Billing Details`}),R(U,{onChange:e.onBillingChange,options:{mode:`billing`}}),R(`p`,{children:t?`Use your full name here. We use the email and phone above for purchase confirmation and fulfillment updates.`:`Use the bidder's full name here. We use the email and phone above to contact you if this bid is outbid or wins.`})]}),r.collectShippingAddress&&z(`section`,{"aria-label":`Delivery Details`,className:`lockerverse-auctions__checkout-section`,children:[z(`label`,{className:`lockerverse-auctions__checkout-checkbox lockerverse-auctions__checkout-delivery`,htmlFor:`${a}-delivery-same-as-billing`,children:[R(h,{checked:e.sameAsBilling,id:`${a}-delivery-same-as-billing`,onChange:t=>e.onSameAsBillingChange(t.target.checked)}),z(`span`,{children:[R(`strong`,{children:`Delivery address is the same as billing`}),R(`span`,{children:`Leave this on for the fastest flow. Turn it off only if the delivery address should differ from the billing details above.`})]})]}),!e.sameAsBilling&&z(L,{children:[R(`h3`,{children:`Delivery Address`}),R(U,{onChange:e.onShippingChange,options:{mode:`shipping`}})]})]}),e.serviceFeeEnabled&&R(re,{...e})]}),e.message&&R(`p`,{"aria-live":`polite`,className:`lockerverse-auctions__notice`,role:`status`,children:e.message}),!e.isTerminal&&z(`div`,{className:`lockerverse-auctions__checkout-footer`,children:[z(`p`,{children:[t?`By continuing, you agree to be charged for this purchase.`:`By continuing, you agree to have this payment method stored for item settlement if your bid is the winning offer.`,r.collectShippingAddress?` Your delivery details are stored with the ${t?`order`:`bid`} so the seller can fulfill the item after payment.`:``]}),z(`button`,{className:`lockerverse-auctions__button lockerverse-auctions__checkout-submit`,disabled:e.submitDisabled,type:`submit`,children:[e.buttonText,R(x,{"aria-hidden":`true`,size:16})]})]})]})]})}function re(e){let{isPurchase:t,pricing:r}=e;return R(`section`,{"aria-label":`Processing fees`,className:`lockerverse-auctions__checkout-section`,children:e.onIncludeServiceFeeChange?z(`label`,{className:`lockerverse-auctions__checkout-checkbox`,htmlFor:`${e.id}-service-fee`,children:[R(h,{checked:e.includeServiceFee,id:`${e.id}-service-fee`,onChange:t=>e.onIncludeServiceFeeChange?.(t.target.checked)}),z(`span`,{children:[z(`strong`,{children:[t?`Add`:`If I win, add`,` `,n(e.serviceFeeCents),` to help cover processing fees`]}),z(`span`,{children:[t?`Total`:`Total if I win`,`:`,` `,n(r.totalCents)]})]})]}):z(`p`,{children:[t?`Total`:`Total if I win`,`:`,` `,n(r.totalCents)]})})}function Z(e,t,n){return V(e,t.saleMode===`buy_now`?(t.buyNowPriceAmount??0)*n.quantity:n.amount,n.includeServiceFee)}function ie(t,n,r){if(e(t,n)!==`active`)return`This item is not accepting bids or purchases.`;if(n.saleMode===`hybrid`)return`This item type is not supported for checkout.`;if(n.saleMode===`buy_now`){if(n.isSoldOut||n.availableQuantity===0)return`This item is sold out.`;if(!(n.buyNowPriceAmount&&Number.isSafeInteger(r.quantity))||r.quantity<1||n.availableQuantity!==null&&r.quantity>n.availableQuantity)return`Select an available quantity.`}else if(!Number.isSafeInteger(r.amount)||r.amount%100!=0||r.amount<H(n))return`Enter a whole-dollar bid at or above the minimum bid.`;return null}function ae(e,t,n,r,i){return e.payment?.publishableKey!==t.payment?.publishableKey||e.payment?.connectedAccountId!==t.payment?.connectedAccountId||e.serviceFeeEnabled!==t.serviceFeeEnabled||n.saleMode!==r.saleMode||n.collectShippingAddress!==r.collectShippingAddress||JSON.stringify(Z(e,n,i))!==JSON.stringify(Z(t,r,i))}function oe(e){return{expectedServiceFeeCents:e.serviceFeeCents,expectedSubtotalCents:e.subtotalCents,expectedTotalCents:e.totalCents}}async function se({stripe:e,elements:t,email:n,phone:r,billing:i,shipping:a,collectShippingAddress:o}){if(!(i?.complete&&i.value.name.trim()))throw Error(`Complete your billing name and address.`);if(o&&!(a?.complete&&a.value.name.trim()))throw Error(`Complete your shipping name and address.`);let s=await t.submit();if(s.error)throw Error(s.error.message??`Check your payment details.`);let c=await e.createConfirmationToken({elements:t,params:{payment_method_data:{allow_redisplay:`always`,billing_details:{address:i.value.address,email:n,name:i.value.name,phone:r}},return_url:window.location.href,...o&&a?{shipping:{address:a.value.address,name:a.value.name,phone:r}}:void 0}});if(c.error||!c.confirmationToken)throw Error(c.error?.message??`Unable to prepare payment details.`);return c.confirmationToken.id}async function ce(e,t){if(!t.requiresAction)return;if(!t.clientSecret)throw Error(`Payment confirmation is incomplete. Check its status before trying again.`);let n=await e.handleNextAction({clientSecret:t.clientSecret});if(n.error)throw Error(n.error.message??`Payment confirmation is incomplete.`)}function le(e,t,n){return e===`busy`?n?`Processing...`:`Authorizing...`:e===`retry`?`Retry original purchase`:t?`Check purchase status`:n?`Buy Now`:`Authorize Bid`}function Q(e){let{auction:t,item:n,selection:r,client:i,onReview:a,onBack:o}=e,s=te(),c=K(),l=N(),[u,f]=I(e.contact?.email??``),[m,h]=I(e.contact?.phone??``),[v,y]=I(()=>p(e.contact?.phone??``)),[b,x]=I({}),[S,C]=I(!0),[w,T]=I(null),[E,ee]=I(null),[D,O]=I(e.resumePurchase??null),[k,A]=I(e.resumePurchase?`pending`:`ready`),[j,P]=I(null),L=F(e.resumePurchase?.submission.clientRequestId??null),z=k===`complete`||k===`uncertain`,V=F(!1),H=F(!0),U=F(e);U.current=e;let W=F(!1);function G(e){H.current&&A(e),g(U.current.onInteractionLockChange,e!==`ready`&&e!==`complete`)}function q(e){H.current&&P(e)}function J(e){G(e===`bid`?`uncertain`:`pending`),q(e===`bid`?`We could not confirm your bid. Do not submit another bid until you check your email or contact the auction organizer.`:`We could not confirm the purchase result. Check its status using the same purchase request.`),W.current||(W.current=!0,g(U.current.onUncertain,e))}M(()=>(H.current=!0,()=>{H.current=!1}),[]);let Y=!!(D??e.resumePurchase)||n.saleMode===`buy_now`,X=D?.pricing??e.resumePurchase?.pricing??Z(t,n,r),re=D?.payment??e.resumePurchase?.payment??t.payment;function Q(e){H.current&&O(e),g(U.current.onPurchaseRecoveryChange,e)}function $(e){e.status===`paid`?(L.current=null,Q(null),G(`complete`),g(U.current.onResult,{kind:`purchase`,purchaseId:e.purchaseId,quantity:e.quantity,serviceFeeCents:e.serviceFeeCents,status:`paid`,subtotalCents:e.subtotalCents,totalCents:e.totalCents,unitAmountCents:e.subtotalCents/e.quantity}),W.current||(W.current=!0,g(U.current.onPurchaseComplete,e))):e.status===`pending_payment`?(G(`pending`),q(`Your purchase is pending. Check its status before making another payment.`)):(L.current=null,Q(null),G(`ready`),q(`This purchase is ${e.status.replaceAll(`_`,` `)}. You can start a new purchase.`))}function ue(){let e=d(m,v),t=_({email:u,phone:e},!0);return x(t.errors),t.value?{email:t.value.email,phone:e}:(document.getElementById(`${l}-${t.errors.email?`email`:`phone`}`)?.focus(),null)}async function de(e){if(!e)throw Error(`Check the contact fields below.`);if(!(s&&c&&t.payment))throw Error(`Payment details are still loading.`);let o=await i.load(t.slug);if(!H.current)return null;let l=o.items.find(e=>e.id===n.id);if(!l)return a(o,`This item is no longer available.`),null;let u=ie(o,l,r);if(u||ae(t,o,n,l,r))return a(o,u??`The checkout details changed. Review them before continuing.`),null;let d=await se({billing:w,collectShippingAddress:n.collectShippingAddress,elements:c,email:e.email,phone:e.phone,shipping:S?w:E,stripe:s});return H.current?{confirmationToken:d,email:e.email,includeServiceFee:r.includeServiceFee,phone:e.phone,...oe(X)}:null}async function fe(e){let a=await i.createBid(t.slug,n.id,{...e,amount:r.amount});if(a.requiresAction){if(!(H.current&&s)){J(`bid`);return}await ce(s,a)}G(`complete`),g(U.current.onResult,{amountCents:a.subtotalCents,kind:`bid`}),W.current||(W.current=!0,g(U.current.onBidSubmitted,a))}async function pe(e,r){if(e.requiresAction){if(!(H.current&&s)){J(`purchase`);return}await ce(s,e);let a=await i.getPurchaseStatus(t.slug,n.id,r.submission.clientRequestId);a?$(a):(G(`pending`),q(`Payment status is not available yet. Check again shortly.`));return}$(e),!H.current&&e.status===`pending_payment`&&J(`purchase`)}async function me(e){let r=await i.getPurchaseStatus(t.slug,n.id,e.submission.clientRequestId);if(r)await pe(r,e);else{if(!H.current){J(`purchase`);return}G(`retry`),q(`No purchase is recorded yet. You can retry the original purchase with the same request ID.`)}}async function he(e,r){let a=await i.getPurchaseStatus(t.slug,n.id,r.submission.clientRequestId);if(a){await pe(a,r);return}Q(null),G(`ready`),q(`The purchase was rejected. Review the item and payment details before trying again. (${e.status??`validation`})`)}async function ge(e,t,n,r){let i=t&&(!(e instanceof B)||e.recoveryRecommended);if(q(e instanceof Error?e.message:`Unable to complete this request.`),Y&&n){if(!r&&e instanceof B&&!e.recoveryRecommended)try{await he(e,n);return}catch{}J(`purchase`)}else i?J(`bid`):G(`ready`)}function _e(){return L.current??=globalThis.crypto.randomUUID(),L.current}function ve(){return H.current?!0:(D||(Q(null),G(`ready`)),!1)}async function ye(e,r){if(r){await me(e);return}ve()&&await pe(await i.createPurchase(t.slug,n.id,e.submission),e)}let be=s&&c&&re;function xe(){if(V.current||z)return null;if(!be)return q(`Payment details are still loading.`),null;let e=D?null:ue();return D||e?{checkoutPayment:be,contact:e,retryOriginal:k===`retry`}:null}async function Se(e){e.preventDefault();let i=xe();if(!i)return;let{contact:a,checkoutPayment:o,retryOriginal:s}=i;V.current=!0,W.current=!1,G(`busy`),q(null);let c=!1,l=D;try{if(!l){let e=await de(a);if(!(e&&H.current)){G(`ready`);return}if(!Y){c=!0,await fe(e);return}l=Object.freeze({auctionId:t.id,item:n,itemId:n.id,payment:Object.freeze({...o}),pricing:X,submission:Object.freeze({...e,clientRequestId:_e(),paymentMethodTypes:Object.freeze([`card`]),quantity:r.quantity})}),Q(l)}c=!0,await ye(l,!!D&&!s)}catch(e){await ge(e,c,l,D!==null&&!s)}finally{V.current=!1}}let Ce=le(k,D!==null,Y),we=k!==`ready`;return R(ne,{buttonText:Ce,communityName:e.communityName??t.name,contactErrors:b,email:u,id:l,includeServiceFee:r.includeServiceFee,isPurchase:Y,isTerminal:z,item:n,locked:we,message:j,onBack:k===`ready`?o:void 0,onBillingChange:T,onEmailChange:t=>{f(t),e.onContactChange?.({email:t,phone:d(m,v)})},onIncludeServiceFeeChange:e.onIncludeServiceFeeChange,onPaymentLoadError:()=>q(`Unable to load payment form.`),onPhoneChange:({value:t,country:n})=>{h(t),y(n),e.onContactChange?.({email:u,phone:d(t,n)})},onSameAsBillingChange:C,onShippingChange:ee,onSubmit:Se,phone:m,phoneCountry:v,pricing:X,quantity:r.quantity,sameAsBilling:S,serviceFeeCents:D?X.serviceFeeCents:Z(t,n,{...r,includeServiceFee:t.serviceFeeEnabled}).serviceFeeCents,serviceFeeEnabled:t.serviceFeeEnabled,showFields:!(D||z),submitDisabled:k===`busy`||!s||!c})}const $=6e3;function ue(e,t){let n=F($),r=F(null),[i,a]=I($),o=P(()=>J({delay:i,playOnInit:!1,stopOnFocusIn:!1,stopOnInteraction:!0,stopOnMouseEnter:!1}),[i]),[s,c]=Y({duration:t?0:25,loop:!0},[o]),l=j(()=>{r.current&&(r.current.style.transform=`scaleX(${1-n.current/$})`)},[]),u=j(()=>{let e=o.timeUntilNext();e!==null&&(n.current=Math.max(1,Math.min($,e))),o.stop(),l()},[o,l]),d=j(()=>{n.current=$,a($),o.reset(),l()},[o,l]);return M(()=>{c&&(e?i===n.current?o.play():a(n.current):u())},[c,e,o,i,a,n,u]),M(()=>{if(!c)return;let t=0,r=()=>{let i=o.timeUntilNext();!e||i===null||(n.current=Math.max(0,Math.min($,i)),l(),t=requestAnimationFrame(r))},i=()=>{cancelAnimationFrame(t),e&&(t=requestAnimationFrame(r))},a=()=>cancelAnimationFrame(t),s=()=>{e&&o.play()};return c.on(`select`,d).on(`reInit`,s).on(`autoplay:timerset`,i).on(`autoplay:timerstopped`,a),l(),i(),()=>{a(),c.off(`select`,d).off(`reInit`,s).off(`autoplay:timerset`,i).off(`autoplay:timerstopped`,a)}},[c,o,e,n,d,l]),{embla:c,freeze:u,progressRef:r,reset:d,viewportRef:s}}function de({photos:e,name:t,imageSizes:n=`(max-width: 1279px) 100vw, 45vw`,selected:r,paused:a=!1,photoButtonRef:o,onSelect:s,onExpand:c}){let u=F(null),d=F(null),f=F([]),[p,m]=I(!0),[h,g]=I(!1),[_,v]=I(!1),[y,b]=I(!1),[x,S]=I(!1),{ref:T,visible:E}=i(),[O,k]=I(!1),[A,j]=I(!0),N=F(null),P=`lockerverse-auction-gallery__control ${A||O||_?`is-visible`:``}`,B=()=>{N.current&&clearTimeout(N.current),N.current=setTimeout(()=>k(!1),2e3)},V=e=>{if(e.pointerType!==`mouse`){j(!0);return}k(!0),N.current&&clearTimeout(N.current),e.target instanceof Element&&e.target.closest(`[data-gallery-control]`)||B()};M(()=>{let e=window.matchMedia(`(hover: none), (pointer: coarse)`),t=()=>j(e.matches);return t(),e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t),clearTimeout(N.current??void 0)}},[]);let H=!(a||p||h||_||y||x)&&E,U=e.length,W=U?(r%U+U)%U:0,{viewportRef:G,embla:K,progressRef:te,freeze:q,reset:J}=ue(H&&U>1,p);M(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>m(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),M(()=>{if(!K)return;let e=()=>s(K.selectedScrollSnap());return K.on(`select`,e).on(`reInit`,e),()=>{K.off(`select`,e).off(`reInit`,e)}},[K,s]),M(()=>{K&&K.selectedScrollSnap()!==W&&K.scrollTo(W,!0)},[K,W]),M(()=>{let e=()=>{document.hidden&&q()},t=()=>S(!1);return e(),document.addEventListener(`visibilitychange`,e,!0),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{document.removeEventListener(`visibilitychange`,e,!0),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[q]);let Y=e=>{K?.scrollTo((e+U)%U,p),J()};return M(()=>{let e=d.current;d.current=null,e&&document.activeElement===e&&T.current?.querySelector(`.lockerverse-auction-gallery__photo[tabindex="0"]`)?.focus({preventScroll:!0})},[W,T]),M(()=>{let e=u.current,t=f.current[W];if(!(e&&t))return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.left<n.left?e.scrollLeft-=n.left-r.left:r.right>n.right&&(e.scrollLeft+=r.right-n.right)},[W,U]),z(`section`,{"aria-label":`${t} photos`,className:`lockerverse-auction-gallery`,onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||v(!1)},onFocusCapture:e=>v(e.target.matches(`:focus-visible`)),onKeyDown:e=>{U<2||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),e.target instanceof HTMLButtonElement&&e.target.classList.contains(`lockerverse-auction-gallery__photo`)&&(d.current=e.target),Y(W+(e.key===`ArrowRight`?1:-1)))},onPointerEnter:e=>{e.pointerType===`mouse`&&g(!0)},onPointerLeave:e=>{e.pointerType===`mouse`&&g(!1)},ref:T,children:[U?z(`div`,{className:`lockerverse-auction-gallery__stage`,onPointerEnter:V,onPointerLeave:B,onPointerMove:V,children:[R(`div`,{className:`lockerverse-auction-gallery__viewport`,onPointerDownCapture:()=>{q(),S(!0)},ref:G,children:R(`div`,{className:`lockerverse-auction-gallery__track`,children:e.map((e,r)=>R(`div`,{"aria-hidden":r!==W,className:`lockerverse-auction-gallery__slide`,children:R(`button`,{"aria-label":`View photo ${r+1} of ${t} at full size`,className:`lockerverse-auction-gallery__photo`,onClick:()=>{c(r)},ref:r===W?o:void 0,tabIndex:r===W?0:-1,type:`button`,children:R(l,{alt:`${t}, ${r+1} of ${U}`,className:`lockerverse-auction-gallery__image`,draggable:!1,fetchPriority:r===0?`high`:`auto`,height:900,loading:r===W?`eager`:`lazy`,maxWidth:1280,sizes:r===W?n:`auto, ${n}`,src:e,width:1200})})},`${e}-${r}`))})}),U>1&&!p&&z(`div`,{className:`lockerverse-auction-gallery__rotation`,children:[R(`div`,{"aria-hidden":`true`,className:`lockerverse-auction-gallery__progress-track`,children:R(`div`,{className:`lockerverse-auction-gallery__progress`,ref:te,style:{transform:`scaleX(0)`}})}),R(`button`,{"aria-label":y?`Play photo rotation`:`Pause photo rotation`,className:`lockerverse-auction-gallery__play ${P}`,"data-gallery-control":!0,onClick:()=>b(e=>!e),title:y?`Play photo rotation`:`Pause photo rotation`,type:`button`,children:R(y?D:ee,{"aria-hidden":`true`,size:13})})]}),U>1&&z(L,{children:[R(`button`,{"aria-label":`Previous photo`,className:`lockerverse-auction-gallery__previous ${P}`,"data-gallery-control":!0,onClick:()=>Y(W-1),type:`button`,children:R(C,{"aria-hidden":`true`,className:`lockerverse-auction-gallery__chevron`})}),R(`button`,{"aria-label":`Next photo`,className:`lockerverse-auction-gallery__next ${P}`,"data-gallery-control":!0,onClick:()=>Y(W+1),type:`button`,children:R(w,{"aria-hidden":`true`,className:`lockerverse-auction-gallery__chevron`})})]})]}):R(`div`,{className:`lockerverse-auction-gallery__empty`,children:`No photo available`}),U>1&&R(`section`,{"aria-label":`Choose a photo`,className:`lockerverse-auction-gallery__strip`,ref:u,children:R(`div`,{className:`lockerverse-auction-gallery__thumbnails`,children:e.map((e,t)=>R(`button`,{"aria-label":`Show photo ${t+1} of ${U}`,"aria-pressed":W===t,className:`lockerverse-auction-gallery__thumbnail ${W===t?`is-selected`:``}`,onClick:()=>Y(t),ref:e=>{f.current[t]=e},type:`button`,children:R(l,{alt:``,className:`lockerverse-auction-gallery__thumbnail-image`,height:66,loading:`lazy`,maxWidth:192,sizes:`88px`,src:e,width:88})},`${e}-${t}`))})})]})}function fe({images:e,fallbackImage:t,name:n,imageSizes:r}){let i=[...new Set(e.filter(Boolean))];!i.length&&t&&i.push(t);let[a,o]=I(0),[s,c]=I(!1),u=F(null),d=F(null),f=i.length,p=f?(a%f+f)%f:0;return z(L,{children:[R(de,{imageSizes:r,name:n,onExpand:e=>{o(e),c(!0)},onSelect:o,paused:s,photoButtonRef:u,photos:i,selected:p}),f>0&&R(q.Root,{onOpenChange:c,open:s,children:z(q.Portal,{children:[R(q.Backdrop,{className:`lockerverse-auction-gallery__backdrop`}),z(q.Popup,{"aria-describedby":void 0,className:`lockerverse-auction-gallery__viewer`,finalFocus:u,onKeyDown:e=>{f<2||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),o((p+(e.key===`ArrowRight`?1:-1)+f)%f))},children:[z(q.Title,{className:`lockerverse-auction-gallery__sr-only`,children:[n,` · Photo `,p+1,` of `,f]}),z(`div`,{className:`lockerverse-auction-gallery__full-image`,onTouchCancel:()=>{d.current=null},onTouchEnd:e=>{let t=d.current;d.current=null;let n=e.changedTouches.item(0);if(!(t&&n)||f<2)return;let r=n.clientX-t.x,i=n.clientY-t.y;Math.abs(r)>=45&&Math.abs(r)>Math.abs(i)*1.3&&o((p+(r<0?1:-1)+f)%f)},onTouchMove:e=>{e.touches.length!==1&&(d.current=null)},onTouchStart:e=>{let t=e.touches.item(0);d.current=e.touches.length===1&&t?{x:t.clientX,y:t.clientY}:null},children:[R(l,{alt:`${n}, ${p+1} of ${f}`,height:900,maxWidth:1920,sizes:`100vw`,src:i[p],width:1200}),s&&f>1&&R(l,{alt:``,"aria-hidden":`true`,className:`lockerverse-auction-gallery__preload`,height:900,loading:`eager`,maxWidth:1920,sizes:`100vw`,src:i[(p+1)%f],width:1200})]}),R(q.Close,{"aria-label":`Close photo viewer`,className:`lockerverse-auction-gallery__viewer-close`,children:R(A,{"aria-hidden":`true`,size:22})}),f>1&&z(L,{children:[R(`button`,{"aria-label":`Previous photo`,className:`lockerverse-auction-gallery__viewer-previous`,onClick:()=>o((p-1+f)%f),type:`button`,children:R(C,{"aria-hidden":`true`,size:28})}),R(`button`,{"aria-label":`Next photo`,className:`lockerverse-auction-gallery__viewer-next`,onClick:()=>o((p+1)%f),type:`button`,children:R(w,{"aria-hidden":`true`,size:28})})]})]})]})})]})}const pe={1:`h1`,2:`h2`};function me(e){return R(e===`Buy Now`?O:e===`Available`||e===`Increment`?k:E,{"aria-hidden":`true`,size:16})}function he(e,t){return e.saleMode===`buy_now`?[[`Buy Now`,n(e.buyNowPriceAmount??0)],[`Available`,e.availableQuantity===null?`Available`:String(e.availableQuantity)]]:t===`finished`?[[`Final bid`,e.maxBidAmount?n(e.maxBidAmount):`No bids`]]:[[`Current bid`,n(e.maxBidAmount??0)],[`Floor`,n(e.minBidAmount??0)],[`Increment`,n(e.bidIncrementAmount??100)]]}function ge({auction:r,item:i,itemHeadingLevel:o=2,galleryImageSizes:c}){s(i.startAt??r.startAt,i.endAt??r.endAt);let[l,u]=I(!1),d=N(),f=e(r,i),p={active:`Closes`,draft:`Opens`,finished:`Closed`}[f],m=a(r,f,i),h=i.saleMode===`buy_now`,g=(i.description??``).trim().length>240,_=he(i,f),v=pe[o];return z(`section`,{className:`lockerverse-auctions__item-summary`,children:[R(fe,{fallbackImage:i.image??r.configuration.image??r.community?.banner??r.community?.thumbnail??null,imageSizes:c,images:i.images,name:i.name}),z(`div`,{className:`lockerverse-auctions__item-copy`,children:[R(v,{children:i.name}),i.description?z(`div`,{className:`lockerverse-auctions__item-description`,children:[R(t,{className:!l&&g?`lockerverse-auctions__description-clamped`:void 0,description:i.description,id:d}),g?z(`button`,{"aria-controls":d,"aria-expanded":l,className:`lockerverse-auctions__description-toggle`,onClick:()=>u(!l),type:`button`,children:[l?`Hide description`:`Read full description`,` `,R(S,{"aria-hidden":`true`,size:16,style:{transform:l?`rotate(180deg)`:void 0}})]}):null]}):null,z(`dl`,{className:`lockerverse-auctions__stat-panel`,children:[_.map(([e,t])=>z(`div`,{className:`lockerverse-auctions__stat-row`,children:[z(`dt`,{children:[me(e),e]}),R(`dd`,{children:t})]},e)),z(`div`,{className:`lockerverse-auctions__stat-row`,children:[z(`dt`,{children:[R(T,{"aria-hidden":`true`,size:16}),p]}),R(`dd`,{className:`lockerverse-auctions__stat-date`,children:m})]}),!h&&f===`finished`?z(`div`,{className:`lockerverse-auctions__stat-footer`,children:[z(`div`,{children:[R(`dt`,{children:`Floor`}),R(`dd`,{children:n(i.minBidAmount??0)})]}),z(`div`,{children:[R(`dt`,{children:`Bid increment`}),R(`dd`,{children:n(i.bidIncrementAmount??100)})]})]}):null]})]})]})}const _e=/^\d+$/;function ve(e,t){return _e.test(e)&&Number.isSafeInteger(Number(e)*t)?`Total: ${n(Number(e)*t)}`:`Enter a whole-number quantity.`}function ye(e,t,n){return String(e?t?t.quantity:1:t?t.amount/100:n)}function be(e,t){return o(e)?`This item is sold out.`:t===`draft`?`This item is not open yet.`:t===`finished`?e.saleMode===`buy_now`?`Purchases are closed for this item.`:`Bidding is closed for this item.`:`This item is not available.`}function xe(e,t,n){return o(t)?`All available quantities have been purchased.`:n===`draft`?`This item opens ${a(e,`draft`,t)}.`:t.saleMode===`buy_now`?`This item is no longer available to purchase.`:`Bidding has closed for this item.`}function Se(e,t,n,r){return{amount:t?0:Number(r)*100,includeServiceFee:n?n.includeServiceFee:e.serviceFeeEnabled&&e.serviceFeeDefaultChecked,quantity:t?Number(r):1}}function Ce({auction:t,item:i,initialSelection:a,onContinue:c,onError:l,onBack:u,backHref:d}){let f=i.saleMode===`buy_now`,p=Math.ceil(H(i)/100),[m,h]=I(ye(f,a,p)),[g,_]=I(null),v=N();s(i.startAt??t.startAt,i.endAt??t.endAt);let y=e(t,i),b=y===`active`&&!o(i)&&i.saleMode!==`hybrid`;function S(e){if(e.preventDefault(),!_e.test(m)){_(f?`Enter a whole-number quantity.`:`Enter a whole-dollar bid amount.`);return}let n=Se(t,f,a,m),r=ie(t,i,n);if(r){_(r),l(r);return}try{Z(t,i,n)}catch{_(`Enter a valid amount or quantity.`);return}c(n)}return b?z(`form`,{className:`lockerverse-auctions__selection`,onSubmit:S,children:[R(we,{buyNow:f,item:i,minimum:p}),z(`div`,{className:`lockerverse-auctions__selection-body`,children:[z(`label`,{className:`lockerverse-auctions__field`,htmlFor:v,children:[f?`Quantity`:`Your bid amount`,z(`span`,{className:`lockerverse-auctions__amount-control`,children:[f?null:R(`span`,{"aria-hidden":`true`,children:`$`}),R(`input`,{"aria-describedby":`${v}-help`,"aria-invalid":!!g,autoComplete:`off`,id:v,inputMode:`numeric`,onChange:e=>{h(e.target.value),_(null)},placeholder:f?`1`:String(p),required:!0,value:m})]})]}),g?R(`p`,{role:`alert`,children:g}):null,R(`p`,{id:`${v}-help`,children:f?ve(m,i.buyNowPriceAmount??0):`Enter a whole-dollar bid of at least ${n(p*100)}. Bid increment: ${n(i.bidIncrementAmount??100)}.`}),z(`div`,{className:`lockerverse-auctions__selection-footer`,children:[R(`p`,{children:f?`Continuing moves you into secure checkout where your payment is processed immediately.`:`Continuing moves you into the secure payment step where your card is stored for settlement only if your bid wins.`}),z(`button`,{className:`lockerverse-auctions__button`,disabled:!t.payment,type:`submit`,children:[f?`Continue to Checkout`:`Continue to Payment`,` `,R(x,{"aria-hidden":`true`,size:16})]})]}),t.payment?null:R(`p`,{role:`alert`,children:`Payments are not configured for this auction.`})]})]}):z(`div`,{className:`lockerverse-auctions__selection lockerverse-auctions__read-only`,children:[R(`p`,{className:`lockerverse-auctions__eyebrow`,children:`Item status`}),R(`h3`,{children:be(i,y)}),R(`p`,{children:xe(t,i,y)}),z(r,{className:`lockerverse-auctions__button`,href:d,onBack:u,children:[`Browse auction items `,R(x,{"aria-hidden":`true`,size:16})]})]})}function we({item:e,buyNow:t,minimum:r}){return z(`div`,{className:`lockerverse-auctions__selection-header`,children:[R(`p`,{className:`lockerverse-auctions__eyebrow`,children:`Step 1 of 2`}),R(`h3`,{children:t?`Buy this item now.`:`Place your bid.`}),R(`p`,{children:t?`Choose how many you want, then complete the secure checkout.`:`Enter the bid amount you want to place for this item. You are only charged if this bid wins after bidding closes.`}),z(`p`,{children:[t?`Price: `:`Minimum qualifying bid: `,R(`strong`,{children:n(t?e.buyNowPriceAmount??0:r*100)})]}),t&&e.availableQuantity!==null?z(`p`,{children:[e.availableQuantity,` available`]}):null,e.collectShippingAddress?R(`p`,{children:`The next step will also collect a delivery address for seller fulfillment.`}):null]})}function Te(e){let{auction:t,item:n,selection:r,theme:i=`dark`,stripeLoader:a=y,style:o,onBack:s,resumePurchase:c}=e,[l,u]=I(null),[d,f]=I(!1),[p,m]=I(0),h=v(e.appearanceRoot,i,o,e.interactionLocked),g=c?.payment??t.payment;if(M(()=>{let e=!0;if(!g){f(!0);return}return Promise.resolve().then(()=>a(g.publishableKey,g.connectedAccountId?{stripeAccount:g.connectedAccountId}:void 0)).then(t=>{e&&(u(t),f(!t))},()=>{e&&f(!0)}),()=>{e=!1}},[g,a,p]),d)return z(`div`,{children:[R(`p`,{role:`alert`,children:`Payment details could not load.`}),c?null:R(`button`,{onClick:s,type:`button`,children:`Back to item`}),R(`button`,{onClick:()=>{f(!1),u(null),m(e=>e+1)},type:`button`,children:`Try again`})]});if(!(l&&h))return z(`div`,{children:[R(`p`,{role:`status`,children:`Loading secure payment details…`}),c?null:R(`button`,{onClick:s,type:`button`,children:`Back to item`})]});let _={mode:`setup`,setupFutureUsage:`off_session`};c?_={amount:c.pricing.totalCents,currency:`usd`,mode:`payment`}:n.saleMode===`buy_now`&&(_={amount:Z(t,n,r).totalCents,currency:`usd`,mode:`payment`});let b={..._,appearance:h,currency:`usd`,paymentMethodTypes:[`card`],syncAddressCheckbox:`none`};return R(W,{options:b,stripe:l,children:R(Q,{...e})})}function Ee({buyNow:e}){return z(`div`,{className:`lockerverse-auctions__progress`,children:[z(`span`,{children:[R(e?O:E,{"aria-hidden":`true`,size:16}),e?`Choose quantity`:`Place bid`]}),z(`span`,{children:[R(O,{"aria-hidden":`true`,size:16}),e?`Pay securely`:`Secure card`]}),z(`span`,{children:[R(k,{"aria-hidden":`true`,size:16}),e?`Get confirmation`:`Wait for close`]})]})}function De(e){let{auction:t,item:n,outcome:r}=e,i;return e.backHref?i={href:e.backHref,label:`View auction items`}:e.onBack&&(i={label:`View auction items`,onClick:e.onBack}),R(b,{auctionName:t.name,className:e.className,closesAtLabel:a(t,`active`,n),communityName:e.communityName??t.community?.name,focusHeading:!0,imageUrl:n.image??n.images[0]??t.configuration.image??void 0,itemName:n.name,outcome:r,primaryAction:e.returnToItemHref?{href:e.returnToItemHref,label:`Return to item`}:i,secondaryAction:e.returnToItemHref?i:void 0,style:{"--lockerverse-accent":t.community?.color??`#6f8f6d`,...e.style},theme:e.theme})}function Oe(t){let{auction:n,itemId:i,resumePurchase:a,className:o,theme:c=`dark`,style:l}=t,u=F(null),[d,f]=I(n),p=F(n),m=d.items.find(e=>e.id===i)??a?.item;s(m?.startAt??d.startAt,m?.endAt??d.endAt);let[h,_]=I(()=>a?{amount:0,includeServiceFee:a.submission.includeServiceFee??!1,quantity:a.submission.quantity}:null),[v,y]=I(!!a),b=F(!0),S=F(t);S.current=t;let w=F(null),T=j(e=>{b.current&&y(e),w.current!==e&&(w.current=e,g(S.current.onInteractionLockChange,e))},[]),E=!!a;M(()=>(b.current=!0,T(E),()=>{b.current=!1}),[E,T]);let[ee,D]=I({email:``,phone:``}),[O,k]=I(!!a),[A,N]=I(null),[P,L]=I(null);M(()=>{!(O||v||a)&&p.current!==n&&(p.current=n,f(n))},[n,O,v,a]);function B(e,t){T(!1),p.current=S.current.auction,f(e),_(null),k(!1),N(t)}function V(e){N(null),_(e),k(!0)}return m?P?R(De,{...t,auction:d,item:m,outcome:P}):z(`section`,{className:[`lockerverse-auctions`,o].filter(Boolean).join(` `),"data-lockerverse-theme":c,ref:u,style:{"--lockerverse-accent":d.community?.color??`#6f8f6d`,...l},children:[v?null:z(r,{className:`lockerverse-auctions__back`,href:t.backHref,onBack:t.onBack,children:[R(C,{"aria-hidden":`true`,size:16}),` All items`]}),z(`div`,{className:`lockerverse-auctions__detail`,children:[R(ge,{auction:d,galleryImageSizes:t.galleryImageSizes,item:m,itemHeadingLevel:t.itemHeadingLevel}),z(`div`,{className:`lockerverse-auctions__transaction`,children:[e(d,m)===`active`?R(Ee,{buyNow:m.saleMode===`buy_now`}):null,A?R(`p`,{className:`lockerverse-auctions__notice`,role:`alert`,children:A}):null,O&&h?R(Te,{...t,appearanceRoot:u,auction:d,communityName:t.communityName??d.community?.name,contact:ee,interactionLocked:v,item:m,onBack:()=>k(!1),onContactChange:D,onIncludeServiceFeeChange:e=>_(t=>t&&{...t,includeServiceFee:d.serviceFeeEnabled&&e}),onInteractionLockChange:T,onResult:L,onReview:B,selection:h}):R(Ce,{auction:d,backHref:t.backHref,initialSelection:h,item:m,onBack:t.onBack,onContinue:V,onError:N}),v?null:z(r,{className:`lockerverse-auctions__footer-back`,href:t.backHref,onBack:t.onBack,children:[`Back to auction items `,R(x,{"aria-hidden":`true`,size:16})]})]})]})]}):z(`div`,{children:[R(`p`,{role:`alert`,children:`This auction item is no longer available.`}),R(r,{href:t.backHref,onBack:t.onBack,children:`Back to auction items`})]})}function ke(e){let t=F({auctionId:e.auction.id,client:e.client,itemId:e.itemId});if(t.current.client!==e.client||t.current.auctionId!==e.auction.id||t.current.itemId!==e.itemId)throw TypeError(`Auction item identity cannot change. Remount with a new React key.`);if(e.resumePurchase&&(e.resumePurchase.auctionId!==e.auction.id||e.resumePurchase.itemId!==e.itemId||e.resumePurchase.item.id!==e.itemId||e.resumePurchase.item.auctionId!==e.auction.id))throw TypeError(`The purchase recovery record belongs to a different auction item.`);return R(c.Provider,{value:e.auction.mediaBaseUrl,children:R(Oe,{...e})})}export{ke as LockerverseAuctionItem};
|
|
2
2
|
//# sourceMappingURL=auction-item.js.map
|