@getmicdrop/venue-calendar 3.6.5 → 3.6.6
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/{CarouselView.legacy-CMbD4HXz.js → CarouselView.legacy-DhNGf9hY.js} +2 -2
- package/dist/{CarouselView.legacy-CMbD4HXz.js.map → CarouselView.legacy-DhNGf9hY.js.map} +1 -1
- package/dist/{Checkout.legacy-C0kBGgkO.js → Checkout.legacy-BhuirGZi.js} +2 -2
- package/dist/{Checkout.legacy-C0kBGgkO.js.map → Checkout.legacy-BhuirGZi.js.map} +1 -1
- package/dist/{CollectionView.legacy-BtgvoMrE.js → CollectionView.legacy-D4WfasLf.js} +2 -2
- package/dist/{CollectionView.legacy-BtgvoMrE.js.map → CollectionView.legacy-D4WfasLf.js.map} +1 -1
- package/dist/{FeaturedView.legacy-BP9UVZbw.js → FeaturedView.legacy-mnxm1tXS.js} +2 -2
- package/dist/{FeaturedView.legacy-BP9UVZbw.js.map → FeaturedView.legacy-mnxm1tXS.js.map} +1 -1
- package/dist/{GalleryView.legacy-4X0kT0e8.js → GalleryView.legacy-CCO4KvxL.js} +2 -2
- package/dist/{GalleryView.legacy-4X0kT0e8.js.map → GalleryView.legacy-CCO4KvxL.js.map} +1 -1
- package/dist/{GroupedListView.legacy-rg8OMiyS.js → GroupedListView.legacy-CbpiiTfQ.js} +2 -2
- package/dist/{GroupedListView.legacy-rg8OMiyS.js.map → GroupedListView.legacy-CbpiiTfQ.js.map} +1 -1
- package/dist/{SeriesPage.legacy-Btp396wV.js → SeriesPage.legacy-Bmi5H-th.js} +2 -2
- package/dist/{SeriesPage.legacy-Btp396wV.js.map → SeriesPage.legacy-Bmi5H-th.js.map} +1 -1
- package/dist/{Success.legacy-Ckm1S8fd.js → Success.legacy-DMVsilYY.js} +2 -2
- package/dist/{Success.legacy-Ckm1S8fd.js.map → Success.legacy-DMVsilYY.js.map} +1 -1
- package/dist/{VenueCalendar-CnLV5ozz.js → VenueCalendar-D-lL_ajJ.js} +633 -633
- package/dist/{VenueCalendar-CnLV5ozz.js.map → VenueCalendar-D-lL_ajJ.js.map} +1 -1
- package/dist/venue-calendar.es.js +1 -1
- package/dist/venue-calendar.iife.js +1 -1
- package/dist/venue-calendar.iife.js.map +1 -1
- package/dist/venue-calendar.umd.js +1 -1
- package/dist/venue-calendar.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
})();
|
|
13
|
-
import { H as t, J as n, K as h, L as o, M as r, N as c, Q as u, T as C, V, U as m, X as l, Y as w, Z as T, _ as k, $ as S, a0 as d, a1 as p, a2 as g, a3 as E, a4 as M, a5 as f, a6 as v, a7 as D, a8 as b, a9 as x } from "./VenueCalendar-
|
|
13
|
+
import { H as t, J as n, K as h, L as o, M as r, N as c, Q as u, T as C, V, U as m, X as l, Y as w, Z as T, _ as k, $ as S, a0 as d, a1 as p, a2 as g, a3 as E, a4 as M, a5 as f, a6 as v, a7 as D, a8 as b, a9 as x } from "./VenueCalendar-D-lL_ajJ.js";
|
|
14
14
|
import "svelte";
|
|
15
15
|
import "svelte/store";
|
|
16
16
|
export {
|
|
@@ -71,7 +71,7 @@ END:VEVENT
|
|
|
71
71
|
END:VCALENDAR`,I=new Blob([Z],{type:"text/calendar;charset=utf-8"}),T=URL.createObjectURL(I),x=document.createElement("a");x.href=T;const y=(e.event.title||"event").replace(/[^a-zA-Z0-9\s-]/g,"").replace(/\s+/g,"-");x.download=`${y}.ics`,document.body.appendChild(x),x.click(),document.body.removeChild(x),URL.revokeObjectURL(T),t.set(s,!1)}function n(){t.set(s,!1)}async function c(){const f={url:e.eventUrl};if(navigator.share)try{await navigator.share(f)}catch(_){_ instanceof Error&&_.name!=="AbortError"&&v()}else v()}function v(){navigator.clipboard.writeText(e.eventUrl).then(()=>{alert(r().linkCopied||"Link copied to clipboard!")}).catch(()=>{prompt(r().copyLink||"Copy this link:",e.eventUrl)})}function h(){alert(`Apple Wallet integration requires backend signing infrastructure.
|
|
72
72
|
In production, this would generate a .pkpass file and add it to your Apple Wallet.`)}function d(){alert(`Google Wallet integration requires backend signing infrastructure.
|
|
73
73
|
In production, this would create a Google Wallet pass via the Google Pay API.`)}let m=t.derived(()=>(()=>{const f=[e.event.venue.name,e.event.venue.address].filter(Boolean);return`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(f.join(", "))}`})());function g(){window.location.href=e.eventUrl}var p=uV();let M;var u=t.child(p);Gt(u,{border:!0,padding:!1,class:"rounded-xl shadow-lg overflow-hidden bg-surface-secondary",children:(f,_)=>{var A=fV(),w=t.first_child(A),b=t.child(w);t.reset(w);var H=t.sibling(w,2),L=t.child(H),V=t.child(L);m2(V,{size:"sm",class:"font-semibold block leading-tight",children:(J,j)=>{t.next();var Q=t.text();t.template_effect(()=>t.set_text(Q,e.event.title)),t.append(J,Q)},$$slots:{default:!0}});var Z=t.sibling(V,2),I=t.child(Z);qe(I,{size:16,class:"shrink-0 icon-muted"});var T=t.sibling(I,2);m2(T,{size:"xs",color:"muted",children:(J,j)=>{t.next();var Q=vV(),N=t.first_child(Q),a1=t.sibling(N);{var H1=W=>{var l1=t.text();t.template_effect(U=>t.set_text(l1,`· ${U??""}`),[()=>w2(e.event.startDateTime,e.event.timezone)]),t.append(W,l1)};t.if(a1,W=>{e.event.displayStartTime!==!1&&W(H1)})}t.template_effect(W=>t.set_text(N,`${W??""} `),[()=>at(e.event.startDateTime,e.event.timezone)]),t.append(J,Q)},$$slots:{default:!0}}),t.reset(Z);var x=t.sibling(Z,2);m2(x,{size:"xs",color:"muted",class:"block mt-0.5",children:(J,j)=>{t.next();var Q=t.text();t.template_effect(()=>t.set_text(Q,e.event.venue.name)),t.append(J,Q)},$$slots:{default:!0}}),t.reset(L);var y=t.sibling(L,2),z=t.child(y),k=t.child(z);t.reset(z);var E=t.sibling(z,2),C=t.child(E),S=t.sibling(C,2);t.reset(E),t.reset(y);var P=t.sibling(y,4),D=t.child(P);s2(D,{variant:"default",size:"md",class:"w-full",onclick:i,children:(J,j)=>{var Q=dV(),N=t.first_child(Q);qe(N,{size:16});var a1=t.sibling(N),H1=t.sibling(a1);{let W=t.derived(()=>t.get(s)?"rotate-180":"");B3(H1,{size:16,get class(){return`ml-auto transition-transform ${t.get(W)??""}`}})}t.template_effect(()=>t.set_text(a1,` ${(r().addToCalendar||"Add to Calendar")??""} `)),t.append(J,Q)},$$slots:{default:!0}});var R=t.sibling(D,2);{var F=J=>{var j=hV(),Q=t.child(j),N=t.sibling(t.child(Q));t.reset(Q);var a1=t.sibling(Q,2),H1=t.child(a1);Tp(H1,{size:16,class:"shrink-0"});var W=t.sibling(H1);t.reset(a1),t.reset(j),t.template_effect(()=>{t.set_attribute(Q,"href",t.get(l)),t.set_text(N,` ${(r().googleCalendar||"Google Calendar")??""}`),t.set_text(W,` ${(r().appleCalendar||"Apple Calendar (.ics)")??""}`)}),t.delegated("click",Q,n),t.delegated("click",a1,o),t.append(J,j)};t.if(R,J=>{t.get(s)&&J(F)})}t.reset(P);var B=t.sibling(P,2),q=t.child(B);s2(q,{variant:"default",size:"md",class:"flex-1",onclick:c,children:(J,j)=>{var Q=gV(),N=t.first_child(Q);M6(N,{size:16});var a1=t.sibling(N);t.template_effect(()=>t.set_text(a1,` ${(r().share||"Share")??""}`)),t.append(J,Q)},$$slots:{default:!0}});var v1=t.sibling(q,2);{var K=J=>{s2(J,{variant:"default",size:"md",class:"flex-1",get href(){return t.get(m)},target:"_blank",children:(j,Q)=>{var N=mV(),a1=t.first_child(N);uf(a1,{size:16});var H1=t.sibling(a1);t.template_effect(()=>t.set_text(H1,` ${(r().map||"Map")??""}`)),t.append(j,N)},$$slots:{default:!0}})};t.if(v1,J=>{e.event.venue.address&&J(K)})}t.reset(B);var c1=t.sibling(B,2),f1=t.child(c1),i1=t.child(f1);F3(i1,{size:16,class:"shrink-0"});var n1=t.sibling(i1);t.reset(f1);var O=t.sibling(f1,2);{var X=J=>{var j=pV(),Q=t.sibling(t.first_child(j),2),N=t.child(Q);nf(N,{size:16,class:"shrink-0"});var a1=t.sibling(N);t.reset(Q),t.template_effect(()=>{t.set_attribute(Q,"href",`mailto:${e.event.venue.contactEmail??""}?subject=Help with Order ${e.orderId??""}`),t.set_text(a1,` ${(r().needHelp||"Need help?")??""}`)}),t.append(J,j)};t.if(O,J=>{e.event.venue.contactEmail&&J(X)})}t.reset(c1),t.reset(H),t.template_effect(()=>{t.set_attribute(b,"src",e.event.imageUrl),t.set_attribute(b,"alt",e.event.title),t.set_attribute(k,"alt",r().addToAppleWallet||"Add to Apple Wallet"),t.set_attribute(C,"alt",r().saveToGoogleWallet||"Save to Google Wallet"),t.set_attribute(S,"alt",r().saveToGoogleWallet||"Save to Google Wallet"),t.set_text(n1,` ${(r().backToEvent||"Back to event")??""}`)}),t.delegated("click",z,h),t.delegated("click",E,d),t.delegated("click",f1,g),t.append(f,A)},$$slots:{default:!0}}),t.reset(p),t.template_effect(()=>M=t.set_class(p,1,"actions-wrapper svelte-zqubiq",null,M,{visible:e.showContent})),t.append(a,p),t.pop()}t.delegate(["click"]);var _V=t.from_html('<button type="button"><span></span> </button>'),HV=t.from_html('<div class="toggle-bar bg-surface-primary border-default svelte-1cyfs2"><span class="toggle-label text-color-muted svelte-1cyfs2">Success</span> <!></div>'),MV=t.from_html('<div class="w-full min-h-screen bg-surface-primary text-color-primary"><!> <div class="max-w-6xl mx-auto px-4 py-6 md:px-6 md:py-8"><div class="hidden md:grid gap-8 items-start" style="grid-template-columns: 1fr 360px;"><!> <div class="sticky top-6"><!></div></div> <div class="md:hidden space-y-6"><!> <!></div></div></div>');function VV(a,e){t.push(e,!0);let r=t.state("default");const s=[{value:"default",label:"Standard",color:"bg-accent-success"},{value:"free",label:"Free",color:"bg-sky-500"},{value:"registration",label:"Registration",color:"bg-brand-primary"},{value:"donation",label:"Donation",color:"bg-accent-danger"}];let i=t.prop(e,"data",3,void 0),l=t.prop(e,"eventUrl",3,void 0),o=t.prop(e,"labels",19,()=>({}));const n=t.derived(()=>n5(o()));let c=t.derived(()=>!i());const v={default:{event:W2,orderId:"12847",lines:[{ticketId:101,ticketName:"General Admission",quantity:2,unitPrice:25,fee:2.5,subtotal:50},{ticketId:102,ticketName:"VIP Front Row",quantity:1,unitPrice:55,fee:5.5,subtotal:55}],customerEmail:"customer@example.com"},free:{event:e5,orderId:"12848",lines:[{ticketId:201,ticketName:"Free Entry",quantity:2,unitPrice:0,fee:0,subtotal:0}],customerEmail:"comedy.fan@gmail.com"},registration:{event:a5,orderId:"12849",lines:[{ticketId:301,ticketName:"Workshop Seat",quantity:1,unitPrice:75,fee:7.5,subtotal:75}],customerEmail:"learner@example.com"},donation:{event:r5,orderId:"12850",lines:[{ticketId:401,ticketName:"Donation",quantity:1,unitPrice:25,fee:0,subtotal:25},{ticketId:402,ticketName:"Standard Admission",quantity:1,unitPrice:30,fee:3,subtotal:30}],customerEmail:"generous@example.com"}};let h=t.derived(()=>t.get(c)?v[t.get(r)]:i()),d=t.derived(()=>(()=>{const x=t.get(h).lines,y=x.reduce((E,C)=>E+C.subtotal,0),z=x.reduce((E,C)=>E+C.fee*C.quantity,0),k=o5(y+z,t.get(h).event.venue.taxPercentage);return{lines:x,subtotal:y,fees:z,taxes:k,total:y+z+k,promoDiscount:0,giftCardAmount:0}})()),m=t.derived(()=>t.get(c)?typeof window>"u"?"#":`${window.location.origin}/e/${t.get(h).event.id}-${t.get(h).event.slug}`:l()||"#"),g=t.state(!1),p=t.state(!1),M=t.state(!1);function u(){if(t.get(M)){t.set(g,!0),t.set(p,!0);return}t.set(g,!1),t.set(p,!1),setTimeout(()=>{t.set(g,!0)},800),setTimeout(()=>{t.set(p,!0)},1600)}t.user_effect(()=>{t.get(c)&&(t.get(r),u())}),l2.onMount(()=>{t.set(M,window.matchMedia("(prefers-reduced-motion: reduce)").matches,!0),u()});var f=MV(),_=t.child(f);{var A=x=>{var y=HV(),z=t.sibling(t.child(y),2);t.each(z,17,()=>s,t.index,(k,E)=>{const C=t.derived(()=>t.get(r)===t.get(E).value);var S=_V(),P=t.child(S),D=t.sibling(P);t.reset(S),t.template_effect(()=>{t.set_class(S,1,`toggle-btn ${t.get(C)?"active bg-surface-secondary text-color-primary font-medium":"text-color-tertiary hover:bg-surface-secondary hover:text-color-secondary"}`,"svelte-1cyfs2"),t.set_class(P,1,`w-1.5 h-1.5 rounded-full ${t.get(E).color??""} shrink-0`,"svelte-1cyfs2"),t.set_text(D,` ${t.get(E).label??""}`)}),t.delegated("click",S,()=>{t.set(r,t.get(E).value,!0)}),t.append(k,S)}),t.reset(y),t.append(x,y)};t.if(_,x=>{t.get(c)&&x(A)})}var w=t.sibling(_,2),b=t.child(w),H=t.child(b);Y6(H,{get event(){return t.get(h).event},get orderId(){return t.get(h).orderId},get orderTotals(){return t.get(d)},get customerEmail(){return t.get(h).customerEmail},get showCheckmark(){return t.get(g)},get showContent(){return t.get(p)},get labels(){return t.get(n)}});var L=t.sibling(H,2),V=t.child(L);W6(V,{get event(){return t.get(h).event},get orderId(){return t.get(h).orderId},get eventUrl(){return t.get(m)},get showContent(){return t.get(p)},get labels(){return t.get(n)}}),t.reset(L),t.reset(b);var Z=t.sibling(b,2),I=t.child(Z);Y6(I,{get event(){return t.get(h).event},get orderId(){return t.get(h).orderId},get orderTotals(){return t.get(d)},get customerEmail(){return t.get(h).customerEmail},get showCheckmark(){return t.get(g)},get showContent(){return t.get(p)},get labels(){return t.get(n)}});var T=t.sibling(I,2);W6(T,{get event(){return t.get(h).event},get orderId(){return t.get(h).orderId},get eventUrl(){return t.get(m)},get showContent(){return t.get(p)},get labels(){return t.get(n)}}),t.reset(Z),t.reset(w),t.reset(f),t.append(a,f),t.pop()}t.delegate(["click"]);var AV=t.from_html('<div class="flex flex-col items-center justify-center py-24 text-center gap-4 error-container svelte-1mm1psu"><p class="svelte-1mm1psu"> </p></div>'),zV=t.from_html('<div class="flex items-center justify-center py-24 text-center loading-container svelte-1mm1psu"><p> </p></div>');function Ke(a,e){t.push(e,!0);let r=t.state(!1),s=t.state(null);typeof window<"u"&&new URLSearchParams(window.location.search).get("legacy")==="1"&&t.set(r,!0),t.user_effect(()=>{t.get(r)&&!t.get(s)&&Promise.resolve().then(()=>ix).then(f=>{t.set(s,f.default,!0)}).catch(()=>{t.set(r,!1)})});let i=t.prop(e,"data",19,()=>({})),l=t.prop(e,"browseUrl",3,"/"),o=t.prop(e,"labels",19,()=>({})),n=t.state(null),c=t.state(""),v=t.state(null),h=t.state(!0);l2.onMount(async()=>{const{id:f,slug:_,event:A,orderId:w,orderUuid:b,customerEmail:H,ticketCount:L}=i()||{};t.set(c,`${window.location.origin}/e/${f}-${_}`);let V;try{V=lV(A)}catch(x){console.warn("Success: transformApiEvent failed:",x),t.set(v,o().failedToLoadEventData||"Failed to load event data.",!0),t.set(h,!1);return}let Z=w||"",I=H||"",T=[];if(Z)try{const x=await N3(Z);if(x){I=x.customerEmail||I;const y=x.purchasedTickets||x.tickets||[],z=new Map;for(const k of y){const E=`${k.ticketTypeId||k.ticketId||0}-${k.ticketName||k.name||""}`,C=z.get(E);C?(C.quantity+=1,C.subtotal+=k.purchasePrice||k.price||0):z.set(E,{ticketId:k.ticketTypeId||k.ticketId||0,ticketName:k.ticketName||k.name||o().ticketFallbackName||"Ticket",quantity:1,unitPrice:k.purchasePrice||k.price||0,fee:0,subtotal:k.purchasePrice||k.price||0})}T=Array.from(z.values())}}catch(x){console.warn("Success: getOrder failed, using route params:",x)}T.length===0&&L>0&&(T=[{ticketId:0,ticketName:o().ticketFallbackName||"Ticket",quantity:L,unitPrice:0,fee:0,subtotal:0}]),t.set(n,{event:V,orderId:String(Z),lines:T,customerEmail:I},!0),P3(String(f)),Ne("checkout-cartid"),t.set(h,!1)});var d=t.comment(),m=t.first_child(d);{var g=f=>{var _=t.comment(),A=t.first_child(_);t.component(A,()=>t.get(s),(w,b)=>{b(w,{get data(){return i()},get browseUrl(){return l()}})}),t.append(f,_)},p=f=>{var _=AV(),A=t.child(_),w=t.child(A,!0);t.reset(A),t.reset(_),t.template_effect(()=>t.set_text(w,t.get(v))),t.append(f,_)},M=f=>{var _=zV(),A=t.child(_),w=t.child(A,!0);t.reset(A),t.reset(_),t.template_effect(()=>t.set_text(w,o().loadingYourOrder||"Loading your order")),t.append(f,_)},u=f=>{VV(f,{get data(){return t.get(n)},get eventUrl(){return t.get(c)}})};t.if(m,f=>{t.get(r)&&t.get(s)?f(g):t.get(v)?f(p,1):t.get(h)||!t.get(n)?f(M,2):f(u,!1)})}t.append(a,d),t.pop()}const $0={blue:{200:"#bfdbfe",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8"},red:{500:"#ef4444",600:"#dc2626"},green:{500:"#22c55e",600:"#16a34a",emerald:"#10b981",emeraldDark:"#059669"},amber:{500:"#f59e0b"},orange:{500:"#f97316"},violet:{500:"#8b5cf6"},cyan:{400:"#22d3ee",500:"#06b6d4",600:"#0891b2"},teal:{400:"#2dd4bf",500:"#14b8a6"},sky:{400:"#45b7d1",light:"#4ecdc4"},mint:{500:"#98d8c8",600:"#96ceb4"},plum:"#dda0dd",yellow:{500:"#f7dc6f",300:"#ffeaa7"},coral:"#ff6b6b"},na={blue:"#4285f4",green:"#34a853",yellow:"#fbbc05",red:"#ea4335"};var bV=t.from_html('<div role="group"><!> <span class="qty-display svelte-12zmutv" aria-live="polite" aria-atomic="true" role="status"><span class="sr-only"> </span> </span> <!></div>'),yV=t.from_html('<span class="sales-start-badge text-xs text-secondary whitespace-nowrap svelte-12zmutv" role="status"> </span>'),xV=t.from_html('<span class="sr-only" role="alert"> </span>'),ZV=t.from_html('<div class="donation-input-wrapper svelte-12zmutv"><!> <!></div>'),wV=t.from_html('<span class="price-lg text-primary svelte-12zmutv"> </span> <span class="price-strikethrough"><span class="sr-only"> </span> </span> <span class="price-fee" aria-hidden="true"> </span> <span class="sr-only"> </span>',1),LV=t.from_html('<span class="price-lg text-primary svelte-12zmutv"> </span>'),TV=t.from_html('<span class="price-lg text-primary svelte-12zmutv"> </span> <span class="price-fee" aria-hidden="true"> </span> <span class="sr-only"> </span>',1),CV=t.from_html('<span class="badge badge-discount"> </span>'),EV=t.from_html('<span class="badge badge-unlocked"> </span>'),kV=t.from_html('<div class="flex-row-2 mb-2 flex-wrap" role="status" aria-live="polite"><!> <!></div>'),SV=t.from_html('<p class="text-sm text-secondary mb-3 svelte-12zmutv"> </p>'),IV=t.from_html("<span> </span>"),DV=t.from_html('<p class="sales-end-text text-xs svelte-12zmutv" role="status"> </p>'),PV=t.from_html('<article><div class="p-4 pb-0"><div class="flex-between-start gap-4"><div class="flex-1 min-w-0"><h3 class="font-medium text-primary svelte-12zmutv"> </h3></div> <!></div></div> <hr class="divider-line my-3 svelte-12zmutv" aria-hidden="true"/> <div class="p-4 pt-0"><div class="flex-row-2 mb-2"><!></div> <!> <!> <div class="flex-row-2 mb-2 flex-wrap" role="status"><!> <!></div> <!></div></article>');function RV(a,e){t.push(e,!0);let r=t.prop(e,"fee",3,"0.00"),s=t.prop(e,"quantity",3,0),i=t.prop(e,"soldOut",3,!1),l=t.prop(e,"status",3,null),o=t.prop(e,"salesBegin",3,null),n=t.prop(e,"salesEnd",3,null),c=t.prop(e,"remainingCapacity",3,null),v=t.prop(e,"totalCapacity",3,null);t.prop(e,"minQuantity",3,1);let h=t.prop(e,"maxQuantity",3,null),d=t.prop(e,"discountedPrice",3,null),m=t.prop(e,"isRevealed",3,!1),g=t.prop(e,"isDiscounted",3,!1),p=t.prop(e,"ticketType",3,0),M=t.prop(e,"donationAmount",3,""),u=t.prop(e,"labels",19,()=>({}));const f=t.derived(()=>p()===2),_=t.derived(()=>parseFloat(M())||0),A=t.derived(()=>t.get(f)&&M()!==""&&t.get(_)<1?u().minimumDonation||"Minimum $1.00":""),w=t.derived(()=>!t.get(f)||M()!==""&&t.get(_)>=1),b=t.derived(()=>parseFloat(e.price)||0),H=t.derived(()=>t.get(b)===0?0:parseFloat(r())||0),L=t.derived(()=>(t.get(b)+t.get(H)).toFixed(2)),V=t.derived(()=>t.get(H).toFixed(2)),Z=t.derived(()=>d()?parseFloat(d()):null),I=t.derived(()=>t.get(Z)===null||t.get(Z)===0?0:parseFloat(r())||0),T=t.derived(()=>t.get(Z)!==null?(t.get(Z)+t.get(I)).toFixed(2):null),x=t.derived(()=>v()??c()??0),y=10,z=15,k=30,E=5,C=20;function S(o1,g1){if(g1===0)return 0;const z1=k/g1*100,L1=E/g1*100;return Math.max(Math.min(o1,z1),L1)}const P=t.derived(()=>{const o1=c()??0,g1=t.get(x);if(g1===0||l()==="scheduled"||l()==="sales_ended")return null;if(o1<=0)return{text:"Sold out",type:"sold-out"};if(t.get(b)===0)return null;const z1=o1/g1*100,L1=S(y,g1),R1=S(z,g1);return z1<=L1&&o1<=C?{text:`Only ${o1} left`,type:"scarcity",showFlame:!0}:z1<=R1?{text:"Few tickets left",type:"scarcity",showFlame:!0}:null}),D=t.derived(()=>t.get(P)!=null&&t.get(P).type==="scarcity");function R(o1){return o1?Zr(o1,{year:void 0,timeZone:"UTC"}):""}function F(o1){const g1=new Date,z1=new Date(g1);return z1.setDate(z1.getDate()+1),o1.toDateString()===z1.toDateString()}function B(o1){const g1=new Date,L1=(o1.getTime()-g1.getTime())/(1e3*60*60*24);return L1>0&&L1<=7}function q(o1){if(!o1)return{text:"",preposition:""};const g1=new Date(o1),z1=new Date,L1=g1.getTime()-z1.getTime(),R1=Math.round(L1/(1e3*60)),G1=L1/(1e3*60*60),q1=u().locale||"en-US";if(R1>0&&R1<60){const y1=Math.max(1,R1);return{text:(y1===1?u().inNMinute||"in {n} minute":u().inNMinutes||"in {n} minutes").replace("{n}",String(y1)),preposition:""}}if(G1>0&&G1<24){const y1=Math.max(1,Math.round(G1));return{text:(y1===1?u().inNHour||"in {n} hour":u().inNHours||"in {n} hours").replace("{n}",String(y1)),preposition:""}}if(F(g1)){const y1=Ca(o1,{timeZone:"UTC"});return{text:(u().tomorrowAtTime||"tomorrow at {time}").replace("{time}",y1),preposition:""}}if(B(g1)){const y1=new Intl.DateTimeFormat(q1,{weekday:"long"}).format(g1),T1=Ca(o1,{timeZone:"UTC"});return{text:(u().onDayAtTime||"on {day} at {time}").replace("{day}",y1).replace("{time}",T1),preposition:""}}const E1=new Intl.DateTimeFormat(q1,{month:"short",day:"numeric"}).format(g1);return{text:(u().onDate||"on {date}").replace("{date}",E1),preposition:""}}function v1(o1){const{text:g1}=q(o1);return g1}function K(o1){return q(o1)}const c1=t.derived(()=>(()=>{if(!l())return null;switch(l()){case"scheduled":return{showAsMessage:!0,message:(u().salesStart||"Sales start {salesStart}").replace("{salesStart}",v1(o()))};case"on_sale":return null;case"sales_ended":return{badge:u().statusSalesEnded||"Sales ended",badgeClass:"badge-ended",label:"Ended",date:R(n())};default:return null}})());var f1=PV();let i1;var n1=t.child(f1),O=t.child(n1),X=t.child(O),J=t.child(X),j=t.child(J,!0);t.reset(J),t.reset(X);var Q=t.sibling(X,2);{var N=o1=>{var g1=bV();let z1;var L1=t.child(g1);{let T1=t.derived(()=>s()===0),K1=t.derived(()=>(u().decreaseQuantity||"Decrease quantity for {title}").replace("{title}",e.title));s2(L1,{iconbtn:!0,strokebtn:!0,onclick:()=>e.ondecrement?.(),get disabled(){return t.get(T1)},get"aria-label"(){return t.get(K1)},class:"qty-btn",children:(O1,J1)=>{V6(O1,{size:20,"aria-hidden":"true"})},$$slots:{default:!0}})}var R1=t.sibling(L1,2),G1=t.child(R1),q1=t.child(G1,!0);t.reset(G1);var E1=t.sibling(G1);t.reset(R1);var y1=t.sibling(R1,2);{let T1=t.derived(()=>h()!==null&&s()>=h()||c()!==null&&s()>=c()||!t.get(w)),K1=t.derived(()=>(u().increaseQuantity||"Increase quantity for {title}").replace("{title}",e.title));s2(y1,{iconbtn:!0,onclick:()=>e.onincrement?.(),get disabled(){return t.get(T1)},get"aria-label"(){return t.get(K1)},class:"qty-btn",children:(O1,J1)=>{u6(O1,{size:20,"aria-hidden":"true"})},$$slots:{default:!0}})}t.reset(g1),t.template_effect(T1=>{z1=t.set_class(g1,1,"flex items-center quantity-selector svelte-12zmutv",null,z1,{active:s()>0}),t.set_attribute(g1,"aria-label",T1),t.set_text(q1,u().quantity||"Quantity:"),t.set_text(E1,` ${s()??""}`)},[()=>(u().quantitySelector||"Quantity selector for {title}").replace("{title}",e.title)]),t.append(o1,g1)},a1=o1=>{var g1=yV(),z1=t.child(g1,!0);t.reset(g1),t.template_effect(()=>t.set_text(z1,t.get(c1).message)),t.append(o1,g1)};t.if(Q,o1=>{!i()&&l()!=="scheduled"&&l()!=="sales_ended"?o1(N):l()==="scheduled"&&t.get(c1)?.message&&o1(a1,1)})}t.reset(O),t.reset(n1);var H1=t.sibling(n1,4),W=t.child(H1),l1=t.child(W);{var U=o1=>{var g1=ZV(),z1=t.child(g1);{let G1=t.derived(()=>u().donationAmountLabel||"Donation amount in dollars"),q1=t.derived(()=>i()||l()==="scheduled"||l()==="sales_ended"),E1=t.derived(()=>M()!==""),y1=t.derived(()=>t.get(A)?"donation-error-"+e.title?.replace(/\s+/g,"-").toLowerCase():void 0);D2(z1,{get label(){return t.get(G1)},size:"full",type:"text",inputmode:"decimal",placeholder:"0.00",get value(){return M()},oninput:T1=>e.ondonationchange?.(T1.target.value),get disabled(){return t.get(q1)},get displayErrorText(){return t.get(A)},get touched(){return t.get(E1)},get"aria-describedby"(){return t.get(y1)}})}var L1=t.sibling(z1,2);{var R1=G1=>{var q1=xV(),E1=t.child(q1,!0);t.reset(q1),t.template_effect(y1=>{t.set_attribute(q1,"id",`donation-error-${y1??""}`),t.set_text(E1,t.get(A))},[()=>e.title?.replace(/\s+/g,"-").toLowerCase()]),t.append(G1,q1)};t.if(L1,G1=>{t.get(A)&&G1(R1)})}t.reset(g1),t.append(o1,g1)},e1=o1=>{var g1=wV(),z1=t.first_child(g1),L1=t.child(z1);t.reset(z1);var R1=t.sibling(z1,2),G1=t.child(R1),q1=t.child(G1,!0);t.reset(G1);var E1=t.sibling(G1);t.reset(R1);var y1=t.sibling(R1,2),T1=t.child(y1,!0);t.reset(y1);var K1=t.sibling(y1,2),O1=t.child(K1,!0);t.reset(K1),t.template_effect((J1,t1)=>{t.set_attribute(z1,"aria-label",`Discounted price $${t.get(T)??""}`),t.set_text(L1,`$${t.get(T)??""}`),t.set_attribute(R1,"aria-label",`Original price $${t.get(L)??""}`),t.set_text(q1,u().originalPrice||"Original price:"),t.set_text(E1,`$${t.get(L)??""}`),t.set_text(T1,J1),t.set_text(O1,t1)},[()=>(u().inclFee||"incl. ${fee} fee").replace("{fee}",t.get(V)),()=>(u().includingFee||"including ${fee} service fee").replace("{fee}",t.get(V))]),t.append(o1,g1)},m1=o1=>{var g1=LV(),z1=t.child(g1,!0);t.reset(g1),t.template_effect(()=>t.set_text(z1,u().free||"Free")),t.append(o1,g1)},A1=o1=>{var g1=TV(),z1=t.first_child(g1),L1=t.child(z1);t.reset(z1);var R1=t.sibling(z1,2),G1=t.child(R1,!0);t.reset(R1);var q1=t.sibling(R1,2),E1=t.child(q1,!0);t.reset(q1),t.template_effect((y1,T1)=>{t.set_attribute(z1,"aria-label",`Price $${t.get(L)??""}`),t.set_text(L1,`$${t.get(L)??""}`),t.set_text(G1,y1),t.set_text(E1,T1)},[()=>(u().inclFee||"incl. ${fee} fee").replace("{fee}",t.get(V)),()=>(u().includingFee||"including ${fee} service fee").replace("{fee}",t.get(V))]),t.append(o1,g1)};t.if(l1,o1=>{t.get(f)?o1(U):t.get(T)!==null?o1(e1,1):t.get(b)===0?o1(m1,2):o1(A1,!1)})}t.reset(W);var b1=t.sibling(W,2);{var D1=o1=>{var g1=kV(),z1=t.child(g1);{var L1=q1=>{var E1=CV(),y1=t.child(E1,!0);t.reset(E1),t.template_effect(()=>t.set_text(y1,u().discountApplied||"Discount applied")),t.append(q1,E1)};t.if(z1,q1=>{g()&&q1(L1)})}var R1=t.sibling(z1,2);{var G1=q1=>{var E1=EV(),y1=t.child(E1,!0);t.reset(E1),t.template_effect(()=>t.set_text(y1,u().unlocked||"Unlocked")),t.append(q1,E1)};t.if(R1,q1=>{m()&&q1(G1)})}t.reset(g1),t.append(o1,g1)};t.if(b1,o1=>{(g()||m())&&o1(D1)})}var Y=t.sibling(b1,2);{var G=o1=>{var g1=SV(),z1=t.child(g1,!0);t.reset(g1),t.template_effect(L1=>{t.set_attribute(g1,"id",`ticket-desc-${L1??""}`),t.set_text(z1,e.description)},[()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket"]),t.append(o1,g1)};t.if(Y,o1=>{e.description&&o1(G)})}var r1=t.sibling(Y,2),C1=t.child(r1);{var p1=o1=>{var g1=IV(),z1=t.child(g1,!0);t.reset(g1),t.template_effect(()=>{t.set_class(g1,1,`badge ${t.get(c1).badgeClass??""}`,"svelte-12zmutv"),t.set_attribute(g1,"aria-label",`${(u().statusLabel||"Status:")??""} ${t.get(c1).badge??""}`),t.set_text(z1,t.get(c1).badge)}),t.append(o1,g1)};t.if(C1,o1=>{t.get(c1)&&t.get(c1).badge&&o1(p1)})}var w1=t.sibling(C1,2);{var S1=o1=>{{let g1=t.derived(()=>c()??0);J0(o1,{get remaining(){return t.get(g1)},get total(){return t.get(x)},context:"ticket",get labels(){return u()}})}};t.if(w1,o1=>{t.get(D)&&o1(S1)})}t.reset(r1);var j1=t.sibling(r1,2);{var _1=o1=>{const g1=t.derived(()=>K(n()));var z1=DV(),L1=t.child(z1);t.reset(z1),t.template_effect(()=>t.set_text(L1,`${(u().salesEndPrefix||"Sales end")??""}
|
|
74
|
-
${t.get(g1).text??""}`)),t.append(o1,z1)};t.if(j1,o1=>{n()&&l()!=="sales_ended"&&l()!=="scheduled"&&o1(_1)})}t.reset(H1),t.reset(f1),t.template_effect((o1,g1,z1)=>{i1=t.set_class(f1,1,`ticket-block rounded-lg border transition-all ${s()>0?"shadow-sm":""}`,"svelte-12zmutv",i1,{selected:s()>0,"disabled-ticket":i()||l()==="scheduled"||l()==="sales_ended"}),t.set_attribute(f1,"aria-label",`${o1??""}${(i()?u().ticketSoldOutSuffix||", sold out":"")??""}${(l()==="scheduled"?u().ticketSalesNotStartedSuffix||", sales not yet started":"")??""}${(l()==="sales_ended"?u().ticketSalesEndedSuffix||", sales ended":"")??""}`),t.set_attribute(J,"id",`ticket-title-${g1??""}`),t.set_text(j,e.title),t.set_attribute(W,"id",`ticket-price-${z1??""}`)},[()=>(u().ticketAriaLabel||"{title} ticket").replace("{title}",e.title),()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket",()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket"]),t.append(a,f1),t.pop()}var OV=t.from_html('<div class="rounded-lg overflow-hidden animate-pulse bg-surface-primary border-default" role="status" aria-busy="true"><span class="sr-only svelte-1hpsukj">Loading ticket...</span> <div class="px-3 py-2.5 rounded-t-lg border-t border-l border-r border-border" aria-hidden="true"><div class="skeleton h-4 w-2/3 mb-2"></div> <div class="skeleton h-3 w-1/2"></div></div> <div class="flex items-center gap-2" aria-hidden="true"><div class="border w-6 rounded-full h-6 -ml-3 -mt-0.5 bg-card border-border"></div> <hr class="skeleton-divider w-full my-3 svelte-1hpsukj"/> <div class="border w-6 rounded-full h-6 -mr-3 -mt-0.5 bg-card border-border"></div></div> <div class="flex justify-between items-center px-3 py-2.5 rounded-b-lg -mt-0.5 border-b border-l border-r border-border" aria-hidden="true"><div class="space-y-1"><div class="h-4 rounded w-16 bg-bg-tertiary"></div> <div class="h-3 rounded w-20 bg-muted"></div></div> <div class="flex items-center gap-2"><div class="w-10 h-10 rounded-md bg-bg-tertiary"></div> <div class="w-10 h-10 rounded-md bg-muted"></div> <div class="w-10 h-10 rounded-md bg-bg-tertiary"></div></div></div></div>');function NV(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=OV();t.template_effect(()=>t.set_attribute(s,"aria-label",r().loadingTicketInfo||"Loading ticket information")),t.append(a,s),t.pop()}var FV=t.from_html('<div class="empty-state flex flex-col items-center justify-center py-12 px-6 text-center" role="status"><div class="empty-state-icon text-muted-foreground mb-4" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"></path><path d="M13 5v2"></path><path d="M13 17v2"></path><path d="M13 11v2"></path></svg></div> <h3 class="text-lg font-semibold text-text-primary mb-2"> </h3> <p class="text-sm text-text-secondary max-w-72"> </p></div>'),BV=t.from_html('<div class="section-header bg-bg-secondary px-5 py-3"><h2 class="text-text-primary text-md font-semibold"> </h2></div>'),qV=t.from_html('<div role="group"><!> <div role="list"><!></div></div>'),UV=t.from_html("<section></section>");function GV(a,e){t.push(e,!0);let r=t.prop(e,"venueFeesReady",3,!1),s=t.prop(e,"tickets",19,()=>[]),i=t.prop(e,"quantities",19,()=>({})),l=t.prop(e,"donationAmounts",19,()=>({})),o=t.prop(e,"revealHiddenTickets",3,!1),n=t.prop(e,"revealTicketIds",19,()=>[]),c=t.prop(e,"currentPromoRule",3,null),v=t.prop(e,"labels",19,()=>({}));function h(H){const L=new Date,V=H.salesBegin||H.salesStart||H.saleBegin||H.saleStart||H.onSaleStart,Z=H.salesEnd||H.saleEnd||H.onSaleEnd;return V&&new Date(V)>L?"scheduled":Z&&new Date(Z)<L?"sales_ended":"on_sale"}function d(H){return H.salesBegin||H.salesStart||H.saleBegin||H.saleStart||H.onSaleStart||null}const m=t.derived(()=>s().filter(H=>H.visibility===0||o()?!0:n()?.includes(H.ID)));function g(H){const L=[],V=[];for(const Z of H){const I=h(Z),T=Z.minQuantity??1,x=Z.remainingCapacity,y=Z.soldOut||x!=null&&T>x;I==="on_sale"&&!y?L.push(Z):V.push(Z)}return[...L,...V]}function p(H){const L={};for(const V of H){const Z=V.TicketSection?.name||v().other||"Other";L[Z]||(L[Z]=[]),L[Z].push(V)}for(const V of Object.keys(L))L[V]=g(L[V]);return L}const M=t.derived(()=>p(t.get(m))),u=t.derived(()=>v().other||"Other"),f=t.derived(()=>Object.keys(t.get(M)).filter(H=>H!==t.get(u)).length>0);var _=t.comment(),A=t.first_child(_);{var w=H=>{var L=FV(),V=t.sibling(t.child(L),2),Z=t.child(V,!0);t.reset(V);var I=t.sibling(V,2),T=t.child(I,!0);t.reset(I),t.reset(L),t.template_effect(()=>{t.set_attribute(L,"aria-label",v().noTicketsAvailable||"No tickets available"),t.set_text(Z,v().noTicketsAvailable||"No tickets available"),t.set_text(T,v().noTicketsAvailableDescription||"There are currently no tickets available for this event.")}),t.append(H,L)},b=H=>{var L=UV();t.each(L,21,()=>Object.entries(t.get(M)),t.index,(V,Z)=>{var I=t.derived(()=>t.to_array(t.get(Z),2));let T=()=>t.get(I)[0],x=()=>t.get(I)[1];var y=qV(),z=t.child(y);{var k=D=>{var R=BV(),F=t.child(R),B=t.child(F,!0);t.reset(F),t.reset(R),t.template_effect(q=>{t.set_attribute(F,"id",`section-${q??""}`),t.set_text(B,T())},[()=>T().replace(/\s+/g,"-").toLowerCase()]),t.append(D,R)};t.if(z,D=>{t.get(f)&&T()!==t.get(u)&&D(k)})}var E=t.sibling(z,2),C=t.child(E);{var S=D=>{var R=t.comment(),F=t.first_child(R);t.each(F,17,x,t.index,(B,q)=>{const v1=t.derived(()=>t.get(q).visibility>=2&&o()||n().includes(t.get(q).ID)),K=t.derived(()=>c()?.discountTicketIds||[]),c1=t.derived(()=>t.get(K).length===0||t.get(K).includes(t.get(q).ID)),f1=t.derived(()=>c()?.provideDiscount&&t.get(c1)&&(c()?.discountType==="%"||c()?.discountType==="$")),i1=t.derived(()=>(()=>{if(!t.get(f1))return null;const N=parseFloat(t.get(q).price)||0,a1=parseFloat(c()?.amount||"0")||0;return c().discountType==="%"?(N*(1-a1/100)).toFixed(2):c().discountType==="$"?Math.max(0,N-a1).toFixed(2):null})()),n1=t.derived(()=>h(t.get(q))),O=t.derived(()=>d(t.get(q))),X=t.derived(()=>t.get(q).minQuantity??1),J=t.derived(()=>t.get(q).remainingCapacity),j=t.derived(()=>t.get(q).soldOut||t.get(J)!==null&&t.get(J)!==void 0&&t.get(X)>t.get(J)),Q=t.derived(()=>t.get(q).type??0);t.derived(()=>t.get(Q)===2);{let N=t.derived(()=>i()[t.get(q).ID]??0),a1=t.derived(()=>t.get(q).totalCapacity??t.get(q).quantity??t.get(q).remainingCapacity),H1=t.derived(()=>t.get(q).minQuantity??1),W=t.derived(()=>t.get(q).maxQuantity??null),l1=t.derived(()=>l()[t.get(q).ID]??"");RV(B,{get labels(){return v()},get title(){return t.get(q).name},get description(){return t.get(q).description},get price(){return t.get(q).price},get discountedPrice(){return t.get(i1)},get quantity(){return t.get(N)},get soldOut(){return t.get(j)},get status(){return t.get(n1)},get salesBegin(){return t.get(O)},get salesEnd(){return t.get(q).salesEnd},get remainingCapacity(){return t.get(q).remainingCapacity},get totalCapacity(){return t.get(a1)},get minQuantity(){return t.get(H1)},get maxQuantity(){return t.get(W)},get isRevealed(){return t.get(v1)},get isDiscounted(){return t.get(f1)},get ticketType(){return t.get(Q)},get donationAmount(){return t.get(l1)},onincrement:()=>e.handleQuantityChange(t.get(q).ID,1),ondecrement:()=>e.handleQuantityChange(t.get(q).ID,-1),ondonationchange:U=>e.handleDonationChange?.(t.get(q).ID,U)})}}),t.append(D,R)},P=D=>{var R=t.comment(),F=t.first_child(R);t.each(F,16,()=>Array(2),t.index,(B,q)=>{NV(B,{})}),t.append(D,R)};t.if(C,D=>{r()?D(S):D(P,!1)})}t.reset(E),t.reset(y),t.template_effect((D,R)=>{t.set_class(y,1,t.clsx(t.get(f)&&T()!==t.get(u)?"ticket-section-group border border-border rounded-lg overflow-hidden":"")),t.set_attribute(y,"aria-labelledby",D),t.set_class(E,1,`space-y-4 ${t.get(f)&&T()!==t.get(u)?"p-4":""}`),t.set_attribute(E,"aria-label",R)},[()=>t.get(f)&&T()!==t.get(u)?`section-${T().replace(/\s+/g,"-").toLowerCase()}`:void 0,()=>(v().ticketsInSection||"Tickets in {section}").replace("{section}",T())]),t.append(V,y)}),t.reset(L),t.template_effect(()=>t.set_attribute(L,"aria-label",v().availableTickets||"Available tickets")),t.append(H,L)};t.if(A,H=>{r()&&t.get(m).length===0?H(w):H(b,!1)})}t.append(a,_),t.pop()}var jV=t.from_html('<p id="promo-hint" class="promo-message success mt-2 body-sm text-accent-success" role="status" aria-live="polite"> </p>'),YV=t.from_html('<p id="promo-error" class="sr-only svelte-ztoygy" role="alert"> </p>'),WV=t.from_html('<div class="promo-section p-4 md:p-5" role="group" aria-labelledby="promo-label"><span id="promo-label" class="sr-only svelte-ztoygy"> </span> <div class="promo-input-wrapper flex gap-2 items-start"><div class="flex-1"><!></div> <!></div> <!> <!></div>');function XV(a,e){t.push(e,!0);let r=t.prop(e,"eventID",3,""),s=t.prop(e,"labels",19,()=>({})),i=t.state(""),l=t.state(!1),o=t.state(""),n=t.state(""),c=t.state(!1),v=t.state(!1);const h=async()=>{const T=t.get(i).trim().toUpperCase();if(t.set(o,""),t.set(n,""),t.set(c,!1),!T){t.set(o,s().pleaseEnterPromoCode||"Please enter a promo code.",!0),t.set(l,!0);return}t.set(v,!0);try{const x=await M_(r(),T);if(x.valid){t.set(c,!0);let y=0;const z=[];if(x.revealHiddenTickets&&z.push(s().hiddenTicketsVisible||"Hidden tickets are now visible."),x.provideDiscount){const k=parseFloat(x.amount||"0")||0;y=k,x.discountType==="$"?z.push((s().dollarDiscountAvailable||"A ${amount} discount is available.").replace("{amount}",k.toFixed(2))):x.discountType==="%"&&z.push((s().percentDiscountAvailable||"A {amount}% discount is available.").replace("{amount}",String(k)))}t.set(n,z.length>0?`${(s().promoApplied||"{code} applied.").replace("{code}",T)} ${z.join(" ")}`:(s().promoApplied||"{code} applied.").replace("{code}",T),!0),Rt(`checkout-promocode-${r()}`,T,1),Rt("checkout-promo-discount",y.toString(),1),Rt(`checkout-promo-reveal-${r()}`,x.revealHiddenTickets?"1":"0",1),Rt(`checkout-promo-reveal-ids-${r()}`,JSON.stringify(x.revealTicketIds||[]),1),Rt(`checkout-promo-discount-type-${r()}`,x.discountType||"",1),e.onpromoChange?.({code:T,error:"",hint:t.get(n),discount:y,provideDiscount:x.provideDiscount||!1,discountType:x.discountType||"",discountTicketIds:x.discountTicketIds||[],revealHiddenTickets:x.revealHiddenTickets||!1,revealTicketIds:x.revealTicketIds||[],isApplied:!0})}else t.set(o,s().invalidOrExpiredPromoCode||"Invalid or expired promo code.",!0),t.set(l,!0),e.onpromoChange?.({code:T,error:t.get(o),hint:"",discount:0,provideDiscount:!1,discountType:"",discountTicketIds:[],revealHiddenTickets:!1,revealTicketIds:[],isApplied:!1})}catch(x){console.error("Error validating promo code:",x),t.set(o,s().unableToValidatePromoCode||"Unable to validate promo code. Please try again.",!0),t.set(l,!0)}finally{t.set(v,!1)}},d=()=>{t.set(i,""),t.set(o,""),t.set(n,""),t.set(c,!1),t.set(l,!1),document.cookie=`checkout-promocode-${r()}=; Max-Age=0; path=/`,document.cookie="checkout-promo-discount=; Max-Age=0; path=/",document.cookie=`checkout-promo-reveal-${r()}=; Max-Age=0; path=/`,document.cookie=`checkout-promo-reveal-ids-${r()}=; Max-Age=0; path=/`,document.cookie=`checkout-promo-discount-type-${r()}=; Max-Age=0; path=/`,e.onpromoChange?.({code:"",error:"",hint:"",discount:0,provideDiscount:!1,discountType:"",discountTicketIds:[],revealHiddenTickets:!1,revealTicketIds:[],isApplied:!1})},m=T=>{t.set(i,T.target.value,!0),t.get(o)&&t.set(o,"")},g=T=>{T.key==="Enter"&&(T.preventDefault(),h())};l2.onMount(()=>{const T=Z0(`checkout-promocode-${r()}`);T&&(t.set(i,T,!0),h())});var p=WV(),M=t.child(p),u=t.child(M,!0);t.reset(M);var f=t.sibling(M,2),_=t.child(f),A=t.child(_);{let T=t.derived(()=>s().promoCode||"Promo code"),x=t.derived(()=>t.get(c)||t.get(v)),y=t.derived(()=>t.get(l)?t.get(o):""),z=t.derived(()=>t.get(n)?"promo-hint":t.get(o)?"promo-error":void 0);D2(A,{get label(){return t.get(T)},size:"full",type:"text",oninput:m,onkeydown:g,onblur:()=>t.set(l,!0),get disabled(){return t.get(x)},get displayErrorText(){return t.get(y)},get touched(){return t.get(l)},get"aria-describedby"(){return t.get(z)},get value(){return t.get(i)},set value(k){t.set(i,k,!0)}})}t.reset(_);var w=t.sibling(_,2);{var b=T=>{{let x=t.derived(()=>s().removePromoCode||"Remove promo code"),y=t.derived(()=>t.get(i));s2(T,{strokebtn:!0,onclick:d,class:"h-10 self-start mt-5",get"aria-label"(){return`${t.get(x)??""} ${t.get(y)??""}`},children:(z,k)=>{t.next();var E=t.text();t.template_effect(()=>t.set_text(E,s().remove||"Remove")),t.append(z,E)},$$slots:{default:!0}})}},H=T=>{{let x=t.derived(()=>t.get(v)?s().checkingPromoCode||"Checking promo code":s().applyPromoCode||"Apply promo code");s2(T,{onclick:h,get disabled(){return t.get(v)},class:"h-10 self-start mt-5",get"aria-label"(){return t.get(x)},children:(y,z)=>{t.next();var k=t.text();t.template_effect(()=>t.set_text(k,t.get(v)?s().checking||"Checking...":s().apply||"Apply")),t.append(y,k)},$$slots:{default:!0}})}};t.if(w,T=>{t.get(c)?T(b):T(H,!1)})}t.reset(f);var L=t.sibling(f,2);{var V=T=>{var x=jV(),y=t.child(x,!0);t.reset(x),t.template_effect(()=>t.set_text(y,t.get(n))),t.append(T,x)};t.if(L,T=>{t.get(n)&&T(V)})}var Z=t.sibling(L,2);{var I=T=>{var x=YV(),y=t.child(x,!0);t.reset(x),t.template_effect(()=>t.set_text(y,t.get(o))),t.append(T,x)};t.if(Z,T=>{t.get(o)&&t.get(l)&&T(I)})}t.reset(p),t.template_effect(()=>t.set_text(u,s().promoCodeEntry||"Promo code entry")),t.append(a,p),t.pop()}var QV=t.from_html('<div class="flex justify-between items-center pb-4 border-b border-border" aria-hidden="true"><div><div class="h-4 rounded w-24 mb-2 bg-bg-tertiary"></div> <div class="h-3 rounded w-16 bg-bg-tertiary"></div></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div>'),KV=t.from_html('<div class="hidden md:block h-fit rounded-lg p-5 space-y-5 animate-pulse bg-card border border-border" role="status" aria-busy="true"><span class="sr-only svelte-19v1kvb">Loading order summary...</span> <div class="h-6 rounded w-2/3 bg-bg-tertiary" aria-hidden="true"></div> <!> <div class="space-y-3 pt-4" aria-hidden="true"><div class="flex justify-between"><div class="h-4 rounded w-20 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div> <div class="flex justify-between"><div class="h-4 rounded w-16 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div> <div class="flex justify-between"><div class="h-4 rounded w-12 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div></div> <div class="h-10 rounded mt-5 bg-muted" aria-hidden="true"></div></div>');function X6(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=KV(),i=t.sibling(t.child(s),4);t.each(i,16,()=>Array(2),t.index,(l,o)=>{var n=QV();t.append(l,n)}),t.next(4),t.reset(s),t.template_effect(()=>t.set_attribute(s,"aria-label",r().loadingOrderSummary||"Loading order summary")),t.append(a,s),t.pop()}var JV=t.from_html('<div class="w-14 h-14 shrink-0 rounded-md overflow-hidden bg-bg-secondary" aria-hidden="true"><img alt="" class="w-full h-full object-contain"/></div>'),$V=t.from_html("<p> </p>"),tA=t.from_html('<div class="flex-row-2 shrink-0"><span class="price-md"> </span> <button type="button" class="btn-icon btn-icon-ghost w-7 h-7"><!></button></div>'),eA=t.from_html('<header class="flex items-center gap-3 px-4 md:px-5 py-4 border-b border-border"><button type="button" class="p-2 -ml-2 rounded-full transition-colors shrink-0 text-text-secondary hover:bg-bg-secondary"><!></button> <!> <div class="flex-1 min-w-0"><h1 class="heading-lg break-words"> </h1> <div class="body-sm text-text-secondary"><p><time> </time></p> <p> </p> <!></div></div> <!></header>');function aA(a,e){t.push(e,!0);let r=t.prop(e,"variant",3,"tickets"),s=t.prop(e,"total",3,0),i=t.prop(e,"onCancel",3,()=>{}),l=t.prop(e,"onInfoClick",3,()=>{}),o=t.prop(e,"labels",19,()=>({})),n=t.derived(()=>e.event.timeZone||"America/Los_Angeles"),c=t.derived(()=>e.event.displayEndTime===!0),v=t.derived(()=>e.event.displayDoorsTime===!0),h=t.derived(()=>r()==="checkout"),d=t.derived(()=>s()>0?`$${s().toFixed(2)}`:o().free||"Free");var m=eA(),g=t.child(m),p=t.child(g);F3(p,{size:20,"aria-hidden":"true"}),t.reset(g);var M=t.sibling(g,2);{var u=z=>{var k=JV(),E=t.child(k);t.reset(k),t.template_effect(()=>t.set_attribute(E,"src",e.event.image)),t.append(z,k)};t.if(M,z=>{e.event.image&&z(u)})}var f=t.sibling(M,2),_=t.child(f),A=t.child(_,!0);t.reset(_);var w=t.sibling(_,2),b=t.child(w),H=t.child(b),L=t.child(H,!0);t.reset(H),t.reset(b);var V=t.sibling(b,2),Z=t.child(V,!0);t.reset(V);var I=t.sibling(V,2);{var T=z=>{var k=$V(),E=t.child(k,!0);t.reset(k),t.template_effect(C=>t.set_text(E,C),[()=>(o().doorsOpen||"Doors open {time}").replace("{time}",za(e.event.doorsOpenTime,t.get(n)))]),t.append(z,k)};t.if(I,z=>{t.get(v)&&e.event.doorsOpenTime&&z(T)})}t.reset(w),t.reset(f);var x=t.sibling(f,2);{var y=z=>{var k=tA(),E=t.child(k),C=t.child(E,!0);t.reset(E);var S=t.sibling(E,2),P=t.child(S);df(P,{size:18,"aria-hidden":"true"}),t.reset(S),t.reset(k),t.template_effect(D=>{t.set_attribute(E,"aria-label",D),t.set_text(C,t.get(d)),t.set_attribute(S,"aria-label",o().viewOrderDetails||"View order details")},[()=>(o().ariaOrderTotal||"Order total: {total}").replace("{total}",t.get(d))]),t.delegated("click",S,function(...D){l()?.apply(this,D)}),t.append(z,k)};t.if(x,z=>{t.get(h)&&z(y)})}t.reset(m),t.template_effect((z,k)=>{t.set_attribute(g,"aria-label",t.get(h)?o().goBackToTicketSelection||"Go back to ticket selection":o().goBackToEventDetails||"Go back to event details"),t.set_text(A,e.event.name),t.set_attribute(w,"aria-label",o().ariaEventDateTime||"Event date and time"),t.set_attribute(H,"datetime",e.event.startDateTime),t.set_text(L,z),t.set_text(Z,k)},[()=>p0(e.event.startDateTime,t.get(n)),()=>t.get(c)&&e.event.endDateTime?Aa(e.event.startDateTime,e.event.endDateTime,t.get(n)):w2(e.event.startDateTime,t.get(n))]),t.delegated("click",g,function(...z){i()?.apply(this,z)}),t.append(a,m),t.pop()}t.delegate(["click"]);var rA=t.from_html('<div class="flex items-center justify-center py-12" role="status" aria-live="polite"><p class="text-text-secondary"> </p></div>'),sA=t.from_html('<div class="text-center py-8" role="alert"><p class="text-accent-danger mb-2"> </p> <button class="go-back-btn text-white mt-4 px-4 py-2 rounded-lg svelte-19g9ni4"> </button></div>'),iA=t.from_html('<div class="text-center py-12" role="alert"><p class="text-xl font-semibold text-text-primary mb-2"> </p> <p class="text-text-secondary mb-6"> </p> <button class="go-back-btn text-white px-4 py-2 rounded-lg svelte-19g9ni4"> </button></div>'),lA=t.from_html('<div class="text-center py-12" role="alert"><p class="text-xl font-semibold text-text-primary mb-2">This event has ended</p> <p class="text-text-secondary mb-6">Tickets are no longer available for this event.</p> <button class="go-back-btn px-4 py-2 rounded-lg svelte-19g9ni4" aria-label="Go back to event details">Go back</button></div>'),oA=t.from_html('<div class="px-4 md:px-5 pt-3"><!></div>'),nA=t.from_html('<div class="hidden md:block w-80 h-[calc(100vh-40px)]"></div>'),cA=t.from_html('<div class="w-full flex md:gap-5 flex-wrap"><div class="flex-1 pb-16 md:pb-0"><div class="bg-card border-border rounded-lg md:shadow md:border py-3"><!> <!> <div class="space-y-4 md:px-5"><!></div></div></div> <!> <div><!></div></div>'),vA=t.from_html('<h3 id="error-modal-title" class="heading-lg"><!></h3>'),dA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),hA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),gA=t.from_html('<div id="error-modal-description"><!></div>'),mA=t.from_html("<!> <!>",1),pA=t.from_html('<div role="group" aria-label="Error modal actions"><!></div>'),fA=t.from_html('<h3 id="availability-modal-title" class="heading-lg"> </h3>'),uA=t.from_html('<li class="text-text-secondary text-sm"><span class="font-medium"> </span> <!></li>'),_A=t.from_html('<p class="text-text-secondary mt-4"> </p>'),HA=t.from_html('<p class="text-text-secondary mt-4"> </p>'),MA=t.from_html('<div id="availability-modal-description"><p class="text-text-secondary mb-4"> </p> <ul class="space-y-2"></ul> <!></div>'),VA=t.from_html('<div role="group" aria-label="Availability modal actions"><!> <!></div>'),AA=t.from_html('<div class="px-5 md:px-10 py-12 bg-card"><!></div> <!> <!>',1);function ca(a,e){t.push(e,!0);let r=t.prop(e,"organizationId",3,""),s=t.prop(e,"venueId",3,""),i=t.prop(e,"initialEventData",3,null),l=t.prop(e,"labels",19,()=>({})),o=t.state(!1),n=t.state(null),c=t.state(null),v=t.state(t.proxy([])),h=t.state(!1),d=t.state(!0),m=t.state(null),g=t.state(!1),p=t.state(!1),M=t.state(!1),u=t.state(0),f=t.state(void 0),_=t.state(void 0),A=t.state(t.proxy({})),w=t.state(""),b=t.state(""),H=t.state(0),L=t.state(!1),V=t.state(!1),Z=t.state("cart_failed"),I=t.state(!1),T=t.state(!1),x=t.state(t.proxy([])),y=t.state(0),z=t.state(0),k=t.derived(()=>t.get(U)?0:r0(Object.entries(t.get(A)).reduce((_1,[o1,g1])=>{const z1=t.get(n)?.availableTickets?.find(L1=>L1.ID==o1);return z1?_1+r0(g1*z1.price):_1},0))),E=t.state(0),C=0,S=t.state(0),P=t.state(!1),D=null,R=t.derived(()=>r0(t.get(k)+t.get(E)+C));function F(_1,o1){t.set(A,{...t.get(A),[_1]:Math.max(0,(t.get(A)[_1]??0)+o1)},!0),t.get(n)&&R3({eventID:t.get(n).eventID,quantities:t.get(A),promocode:t.get(w),tickets:t.get(n).availableTickets})}function B(){if(!t.get(n)?.availableTickets)return;const o1=t.get(n).availableTickets.filter(g1=>g1.visibility===0).map(g1=>parseFloat(g1.price)||0);if(o1.length===0){t.set(y,t.set(z,0),!0);return}t.set(y,Math.min(...o1).toFixed(2),!0),t.set(z,Math.max(...o1).toFixed(2),!0)}async function q(){const _1=[];for(const[o1,g1]of Object.entries(t.get(A))){if(g1<=0)continue;const z1=t.get(n)?.availableTickets?.find(L1=>L1.ID==o1);!z1||z1.price===0||_1.push({amountCents:Math.round(z1.price*100)*g1,reference:`ticket-${o1}`,quantity:g1})}if(_1.length===0){t.set(S,0),t.set(P,!1);return}D&&D.abort(),D=new AbortController,t.set(P,!0);try{const o1=await fetch("https://get-micdrop.com/api/v2/public/tax-preview",{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({venueId:Number(t.get(n).venueID),lineItems:_1})});if(!o1.ok){console.error("Tax preview failed:",o1.status),t.set(S,0),t.set(P,!1);return}const g1=await o1.json();t.set(S,(g1.taxTotal??0)/100)}catch(o1){if(o1.name==="AbortError")return;console.error("Tax preview error:",o1),t.set(S,0)}finally{D?.signal?.aborted||t.set(P,!1)}}function v1(){if(!t.get(n))return;t.set(w,Z0(`checkout-promocode-${t.get(n).eventID}`)||"",!0);const _1=parseFloat(Z0("checkout-promo-discount")||0);t.set(b,t.get(w)?`${t.get(w)} applied.`:"",!0),t.set(H,_1,!0)}async function K(){try{const _1=await w6(e.eventId),o1=[];for(const[g1,z1]of Object.entries(t.get(A))){if(z1<=0)continue;const L1=_1.find(G1=>String(G1.ID)===String(g1));if(!L1)continue;const R1=L1.remainingCapacity??L1.quantity??1/0;if(R1<z1){const G1=t.get(n)?.availableTickets?.find(q1=>String(q1.ID)===String(g1));o1.push({ticketId:g1,ticketName:G1?.name||L1?.name||"Ticket",requestedQty:z1,availableQty:Math.max(0,R1)})}}return o1}catch(_1){return console.error("Error checking ticket availability:",_1),[]}}async function c1(){if(!t.get(n))return;t.set(h,!0),t.set(I,!1);const _1=await K();if(_1.length>0){t.set(h,!1),t.set(x,_1,!0),t.set(T,!0);return}await f1()}async function f1(){t.set(h,!0),R3({eventID:t.get(n).eventID,quantities:t.get(A),promocode:t.get(w),promoDiscountAmount:t.get(H),tickets:t.get(n).availableTickets});try{const _1=await Hp({eventID:t.get(n).eventID,quantities:t.get(A),promoCode:t.get(w)||void 0});if(!_1||!_1.success){t.set(h,!1),t.set(Z,"cart_failed"),t.set(V,!0);return}t.set(E,_1.serviceFee??0,!0),t.set(I,!0)}catch(_1){console.error("Order initiation failed:",_1),t.set(h,!1),t.set(Z,"cart_failed"),t.set(V,!0);return}try{if(e.onNavigateToCheckout){e.onNavigateToCheckout(e.eventId,t.get(n)),t.set(h,!1);return}const _1=new URLSearchParams;r()&&_1.set("orgId",r()),s()&&_1.set("venueId",s()),_1.set("event_id",e.eventId),_1.set("subroute","checkout");const o1=`/?${_1.toString()}`;pt(o1,{noScroll:!1}),t.set(h,!1)}catch(_1){console.error("Navigation failed after cart creation:",_1),t.set(h,!1),t.set(Z,"cart_success_network_error"),t.set(V,!0)}}function i1(){for(const o1 of t.get(x))o1.availableQty>0?t.get(A)[o1.ticketId]=o1.availableQty:delete t.get(A)[o1.ticketId];t.set(A,{...t.get(A)},!0),t.set(T,!1),t.set(x,[],!0),Object.values(t.get(A)).reduce((o1,g1)=>o1+g1,0)>0?f1():a1()}function n1(){t.set(T,!1),t.set(x,[],!0),a1()}function O(){t.set(V,!1),t.get(Z)==="cart_failed"&&a1()}function X(){t.set(V,!1),window.location.reload()}function J(){t.set(p,window.innerWidth<767)}let j=!1;function Q(){j||(window.requestAnimationFrame(()=>{N(),j=!1}),j=!0)}function N(){if(t.get(p)||!t.get(_)||!t.get(f)){t.set(M,!1);return}const _1=t.get(_).getBoundingClientRect();if(t.set(M,_1.top<=20),t.get(M)){const o1=t.get(f).getBoundingClientRect();t.set(u,o1.left+o1.width-340-40)}}function a1(){if(t.get(n)&&P3(t.get(n).eventID),e.onNavigateBack)e.onNavigateBack();else{const _1=new URLSearchParams(window.location.search);_1.set("subroute","details");const o1=`/?${_1.toString()}`;pt(o1,{})}}function H1(_1){const{code:o1,discount:g1}=_1.detail;t.set(w,o1||"",!0),t.set(H,g1||0,!0),t.set(b,o1?`${o1} applied.`:"",!0),_1.detail.revealHiddenTickets!==void 0&&t.get(n)&&(document.cookie=`checkout-promo-reveal-${t.get(n).eventID}=${_1.detail.revealHiddenTickets?"1":"0"}; path=/`,_1.detail.revealTicketIds?.length&&(document.cookie=`checkout-promo-reveal-ids-${t.get(n).eventID}=${JSON.stringify(_1.detail.revealTicketIds)}; path=/`))}let W=t.derived(()=>t.get(n)?Z0(`checkout-promo-reveal-${t.get(n).eventID}`)==="1":!1),l1=t.derived(()=>{if(!t.get(n))return[];try{const _1=Z0(`checkout-promo-reveal-ids-${t.get(n).eventID}`);return _1?JSON.parse(_1):[]}catch{return[]}}),U=t.derived(()=>t.get(n)?.availableTickets?.filter(_1=>_1.visibility===0)?.every(_1=>_1.price===0)),e1=t.derived(()=>{if(!t.get(n))return!1;const _1=t.get(n).endDateTime||t.get(n).startDateTime;return _1?new Date(_1)<new Date:!1});async function m1(){if(t.get(g)){if(!e.eventId){t.set(m,l().noEventIdProvided||"No event ID provided",!0),t.set(d,!1);return}t.set(d,!0),t.set(m,null);try{if(i()){if(t.set(c,i()),!t.get(g))return;t.set(n,Pt(t.get(c)),!0),t.set(v,t.get(n).availableTickets||[],!0)}else{try{if(t.set(c,await Z6(e.eventId),!0),!t.get(g))return;t.set(n,Pt(t.get(c)),!0)}catch(o1){console.error("Event fetch failed:",o1),t.set(m,l().failedToLoadEvent||"Failed to load event",!0),t.set(d,!1);return}try{if(t.set(v,await w6(e.eventId),!0),!t.get(g))return;t.get(v).length>0&&(t.get(n).availableTickets=t.get(v))}catch(o1){if(!t.get(g))return;console.error("Error fetching tickets:",o1),t.set(v,t.get(n).availableTickets||[],!0)}}t.get(n).availableTickets&&t.get(n).availableTickets.forEach(o1=>t.get(A)[o1.ID]=0);const _1=D3(t.get(n).eventID);if(t.set(A,_1.quantities||{},!0),t.set(w,_1.promocode||"",!0),t.set(H,_1.promoDiscountAmount||0,!0),t.get(n).eventID&&(await Ap(t.get(n).eventID),!t.get(g)))return;t.set(o,!0),B(),v1(),await up({eventID:t.get(n).eventID})}catch(_1){t.get(g)&&(console.error("Error loading event:",_1),t.set(m,_1.message||l().failedToLoadEvent||"Failed to load event",!0))}finally{t.get(g)&&t.set(d,!1)}}}l2.onMount(async()=>(t.set(g,!0),J(),window.addEventListener("resize",J),window.addEventListener("scroll",Q),await m1(),V_(e.eventId).then(_1=>{t.set(L,_1,!0)}).catch(()=>{t.set(L,!0)}),()=>{window.removeEventListener("resize",J),window.removeEventListener("scroll",Q)})),l2.onDestroy(()=>{t.set(g,!1),D&&D.abort()});let A1=null;t.user_effect(()=>{t.get(g)&&e.eventId&&e.eventId!==A1&&(A1=e.eventId,m1())}),t.user_effect(()=>{const _1=Object.values(t.get(A)).reduce((o1,g1)=>o1+g1,0);t.get(o)&&t.get(n)&&_1>0?q():_1===0&&(t.set(S,0),t.set(P,!1))});var b1=AA(),D1=t.first_child(b1),Y=t.child(D1);{var G=_1=>{var o1=rA(),g1=t.child(o1),z1=t.child(g1,!0);t.reset(g1),t.reset(o1),t.template_effect(()=>t.set_text(z1,l().loadingEvent||"Loading event...")),t.append(_1,o1)},r1=_1=>{var o1=sA(),g1=t.child(o1),z1=t.child(g1);t.reset(g1);var L1=t.sibling(g1,2),R1=t.child(L1,!0);t.reset(L1),t.reset(o1),t.template_effect(()=>{t.set_text(z1,`${(l().errorPrefix||"Error:")??""}
|
|
74
|
+
${t.get(g1).text??""}`)),t.append(o1,z1)};t.if(j1,o1=>{n()&&l()!=="sales_ended"&&l()!=="scheduled"&&o1(_1)})}t.reset(H1),t.reset(f1),t.template_effect((o1,g1,z1)=>{i1=t.set_class(f1,1,`ticket-block rounded-lg border transition-all ${s()>0?"shadow-sm":""}`,"svelte-12zmutv",i1,{selected:s()>0,"disabled-ticket":i()||l()==="scheduled"||l()==="sales_ended"}),t.set_attribute(f1,"aria-label",`${o1??""}${(i()?u().ticketSoldOutSuffix||", sold out":"")??""}${(l()==="scheduled"?u().ticketSalesNotStartedSuffix||", sales not yet started":"")??""}${(l()==="sales_ended"?u().ticketSalesEndedSuffix||", sales ended":"")??""}`),t.set_attribute(J,"id",`ticket-title-${g1??""}`),t.set_text(j,e.title),t.set_attribute(W,"id",`ticket-price-${z1??""}`)},[()=>(u().ticketAriaLabel||"{title} ticket").replace("{title}",e.title),()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket",()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket"]),t.append(a,f1),t.pop()}var OV=t.from_html('<div class="rounded-lg overflow-hidden animate-pulse bg-surface-primary border-default" role="status" aria-busy="true"><span class="sr-only svelte-1hpsukj">Loading ticket...</span> <div class="px-3 py-2.5 rounded-t-lg border-t border-l border-r border-border" aria-hidden="true"><div class="skeleton h-4 w-2/3 mb-2"></div> <div class="skeleton h-3 w-1/2"></div></div> <div class="flex items-center gap-2" aria-hidden="true"><div class="border w-6 rounded-full h-6 -ml-3 -mt-0.5 bg-card border-border"></div> <hr class="skeleton-divider w-full my-3 svelte-1hpsukj"/> <div class="border w-6 rounded-full h-6 -mr-3 -mt-0.5 bg-card border-border"></div></div> <div class="flex justify-between items-center px-3 py-2.5 rounded-b-lg -mt-0.5 border-b border-l border-r border-border" aria-hidden="true"><div class="space-y-1"><div class="h-4 rounded w-16 bg-bg-tertiary"></div> <div class="h-3 rounded w-20 bg-muted"></div></div> <div class="flex items-center gap-2"><div class="w-10 h-10 rounded-md bg-bg-tertiary"></div> <div class="w-10 h-10 rounded-md bg-muted"></div> <div class="w-10 h-10 rounded-md bg-bg-tertiary"></div></div></div></div>');function NV(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=OV();t.template_effect(()=>t.set_attribute(s,"aria-label",r().loadingTicketInfo||"Loading ticket information")),t.append(a,s),t.pop()}var FV=t.from_html('<div class="empty-state flex flex-col items-center justify-center py-12 px-6 text-center" role="status"><div class="empty-state-icon text-muted-foreground mb-4" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"></path><path d="M13 5v2"></path><path d="M13 17v2"></path><path d="M13 11v2"></path></svg></div> <h3 class="text-lg font-semibold text-text-primary mb-2"> </h3> <p class="text-sm text-text-secondary max-w-72"> </p></div>'),BV=t.from_html('<div class="section-header bg-bg-secondary px-5 py-3"><h2 class="text-text-primary text-md font-semibold"> </h2></div>'),qV=t.from_html('<div role="group"><!> <div role="list"><!></div></div>'),UV=t.from_html("<section></section>");function GV(a,e){t.push(e,!0);let r=t.prop(e,"venueFeesReady",3,!1),s=t.prop(e,"tickets",19,()=>[]),i=t.prop(e,"quantities",19,()=>({})),l=t.prop(e,"donationAmounts",19,()=>({})),o=t.prop(e,"revealHiddenTickets",3,!1),n=t.prop(e,"revealTicketIds",19,()=>[]),c=t.prop(e,"currentPromoRule",3,null),v=t.prop(e,"labels",19,()=>({}));function h(H){const L=new Date,V=H.salesBegin||H.salesStart||H.saleBegin||H.saleStart||H.onSaleStart,Z=H.salesEnd||H.saleEnd||H.onSaleEnd;return V&&new Date(V)>L?"scheduled":Z&&new Date(Z)<L?"sales_ended":"on_sale"}function d(H){return H.salesBegin||H.salesStart||H.saleBegin||H.saleStart||H.onSaleStart||null}const m=t.derived(()=>s().filter(H=>H.visibility===0||o()?!0:n()?.includes(H.ID)));function g(H){const L=[],V=[];for(const Z of H){const I=h(Z),T=Z.minQuantity??1,x=Z.remainingCapacity,y=Z.soldOut||x!=null&&T>x;I==="on_sale"&&!y?L.push(Z):V.push(Z)}return[...L,...V]}function p(H){const L={};for(const V of H){const Z=V.TicketSection?.name||v().other||"Other";L[Z]||(L[Z]=[]),L[Z].push(V)}for(const V of Object.keys(L))L[V]=g(L[V]);return L}const M=t.derived(()=>p(t.get(m))),u=t.derived(()=>v().other||"Other"),f=t.derived(()=>Object.keys(t.get(M)).filter(H=>H!==t.get(u)).length>0);var _=t.comment(),A=t.first_child(_);{var w=H=>{var L=FV(),V=t.sibling(t.child(L),2),Z=t.child(V,!0);t.reset(V);var I=t.sibling(V,2),T=t.child(I,!0);t.reset(I),t.reset(L),t.template_effect(()=>{t.set_attribute(L,"aria-label",v().noTicketsAvailable||"No tickets available"),t.set_text(Z,v().noTicketsAvailable||"No tickets available"),t.set_text(T,v().noTicketsAvailableDescription||"There are currently no tickets available for this event.")}),t.append(H,L)},b=H=>{var L=UV();t.each(L,21,()=>Object.entries(t.get(M)),t.index,(V,Z)=>{var I=t.derived(()=>t.to_array(t.get(Z),2));let T=()=>t.get(I)[0],x=()=>t.get(I)[1];var y=qV(),z=t.child(y);{var k=D=>{var R=BV(),F=t.child(R),B=t.child(F,!0);t.reset(F),t.reset(R),t.template_effect(q=>{t.set_attribute(F,"id",`section-${q??""}`),t.set_text(B,T())},[()=>T().replace(/\s+/g,"-").toLowerCase()]),t.append(D,R)};t.if(z,D=>{t.get(f)&&T()!==t.get(u)&&D(k)})}var E=t.sibling(z,2),C=t.child(E);{var S=D=>{var R=t.comment(),F=t.first_child(R);t.each(F,17,x,t.index,(B,q)=>{const v1=t.derived(()=>t.get(q).visibility>=2&&o()||n().includes(t.get(q).ID)),K=t.derived(()=>c()?.discountTicketIds||[]),c1=t.derived(()=>t.get(K).length===0||t.get(K).includes(t.get(q).ID)),f1=t.derived(()=>c()?.provideDiscount&&t.get(c1)&&(c()?.discountType==="%"||c()?.discountType==="$")),i1=t.derived(()=>(()=>{if(!t.get(f1))return null;const N=parseFloat(t.get(q).price)||0,a1=parseFloat(c()?.amount||"0")||0;return c().discountType==="%"?(N*(1-a1/100)).toFixed(2):c().discountType==="$"?Math.max(0,N-a1).toFixed(2):null})()),n1=t.derived(()=>h(t.get(q))),O=t.derived(()=>d(t.get(q))),X=t.derived(()=>t.get(q).minQuantity??1),J=t.derived(()=>t.get(q).remainingCapacity),j=t.derived(()=>t.get(q).soldOut||t.get(J)!==null&&t.get(J)!==void 0&&t.get(X)>t.get(J)),Q=t.derived(()=>t.get(q).type??0);t.derived(()=>t.get(Q)===2);{let N=t.derived(()=>i()[t.get(q).ID]??0),a1=t.derived(()=>t.get(q).totalCapacity??t.get(q).quantity??t.get(q).remainingCapacity),H1=t.derived(()=>t.get(q).minQuantity??1),W=t.derived(()=>t.get(q).maxQuantity??null),l1=t.derived(()=>l()[t.get(q).ID]??"");RV(B,{get labels(){return v()},get title(){return t.get(q).name},get description(){return t.get(q).description},get price(){return t.get(q).price},get discountedPrice(){return t.get(i1)},get quantity(){return t.get(N)},get soldOut(){return t.get(j)},get status(){return t.get(n1)},get salesBegin(){return t.get(O)},get salesEnd(){return t.get(q).salesEnd},get remainingCapacity(){return t.get(q).remainingCapacity},get totalCapacity(){return t.get(a1)},get minQuantity(){return t.get(H1)},get maxQuantity(){return t.get(W)},get isRevealed(){return t.get(v1)},get isDiscounted(){return t.get(f1)},get ticketType(){return t.get(Q)},get donationAmount(){return t.get(l1)},onincrement:()=>e.handleQuantityChange(t.get(q).ID,1),ondecrement:()=>e.handleQuantityChange(t.get(q).ID,-1),ondonationchange:U=>e.handleDonationChange?.(t.get(q).ID,U)})}}),t.append(D,R)},P=D=>{var R=t.comment(),F=t.first_child(R);t.each(F,16,()=>Array(2),t.index,(B,q)=>{NV(B,{})}),t.append(D,R)};t.if(C,D=>{r()?D(S):D(P,!1)})}t.reset(E),t.reset(y),t.template_effect((D,R)=>{t.set_class(y,1,t.clsx(t.get(f)&&T()!==t.get(u)?"ticket-section-group border border-border rounded-lg overflow-hidden":"")),t.set_attribute(y,"aria-labelledby",D),t.set_class(E,1,`space-y-4 ${t.get(f)&&T()!==t.get(u)?"p-4":""}`),t.set_attribute(E,"aria-label",R)},[()=>t.get(f)&&T()!==t.get(u)?`section-${T().replace(/\s+/g,"-").toLowerCase()}`:void 0,()=>(v().ticketsInSection||"Tickets in {section}").replace("{section}",T())]),t.append(V,y)}),t.reset(L),t.template_effect(()=>t.set_attribute(L,"aria-label",v().availableTickets||"Available tickets")),t.append(H,L)};t.if(A,H=>{r()&&t.get(m).length===0?H(w):H(b,!1)})}t.append(a,_),t.pop()}var jV=t.from_html('<p id="promo-hint" class="promo-message success mt-2 body-sm text-accent-success" role="status" aria-live="polite"> </p>'),YV=t.from_html('<p id="promo-error" class="sr-only svelte-ztoygy" role="alert"> </p>'),WV=t.from_html('<div class="promo-section p-4 md:p-5" role="group" aria-labelledby="promo-label"><span id="promo-label" class="sr-only svelte-ztoygy"> </span> <div class="promo-input-wrapper flex gap-2 items-start"><div class="flex-1"><!></div> <!></div> <!> <!></div>');function XV(a,e){t.push(e,!0);let r=t.prop(e,"eventID",3,""),s=t.prop(e,"labels",19,()=>({})),i=t.state(""),l=t.state(!1),o=t.state(""),n=t.state(""),c=t.state(!1),v=t.state(!1);const h=async()=>{const T=t.get(i).trim().toUpperCase();if(t.set(o,""),t.set(n,""),t.set(c,!1),!T){t.set(o,s().pleaseEnterPromoCode||"Please enter a promo code.",!0),t.set(l,!0);return}t.set(v,!0);try{const x=await M_(r(),T);if(x.valid){t.set(c,!0);let y=0;const z=[];if(x.revealHiddenTickets&&z.push(s().hiddenTicketsVisible||"Hidden tickets are now visible."),x.provideDiscount){const k=parseFloat(x.amount||"0")||0;y=k,x.discountType==="$"?z.push((s().dollarDiscountAvailable||"A ${amount} discount is available.").replace("{amount}",k.toFixed(2))):x.discountType==="%"&&z.push((s().percentDiscountAvailable||"A {amount}% discount is available.").replace("{amount}",String(k)))}t.set(n,z.length>0?`${(s().promoApplied||"{code} applied.").replace("{code}",T)} ${z.join(" ")}`:(s().promoApplied||"{code} applied.").replace("{code}",T),!0),Rt(`checkout-promocode-${r()}`,T,1),Rt("checkout-promo-discount",y.toString(),1),Rt(`checkout-promo-reveal-${r()}`,x.revealHiddenTickets?"1":"0",1),Rt(`checkout-promo-reveal-ids-${r()}`,JSON.stringify(x.revealTicketIds||[]),1),Rt(`checkout-promo-discount-type-${r()}`,x.discountType||"",1),e.onpromoChange?.({code:T,error:"",hint:t.get(n),discount:y,provideDiscount:x.provideDiscount||!1,discountType:x.discountType||"",discountTicketIds:x.discountTicketIds||[],revealHiddenTickets:x.revealHiddenTickets||!1,revealTicketIds:x.revealTicketIds||[],isApplied:!0})}else t.set(o,s().invalidOrExpiredPromoCode||"Invalid or expired promo code.",!0),t.set(l,!0),e.onpromoChange?.({code:T,error:t.get(o),hint:"",discount:0,provideDiscount:!1,discountType:"",discountTicketIds:[],revealHiddenTickets:!1,revealTicketIds:[],isApplied:!1})}catch(x){console.error("Error validating promo code:",x),t.set(o,s().unableToValidatePromoCode||"Unable to validate promo code. Please try again.",!0),t.set(l,!0)}finally{t.set(v,!1)}},d=()=>{t.set(i,""),t.set(o,""),t.set(n,""),t.set(c,!1),t.set(l,!1),document.cookie=`checkout-promocode-${r()}=; Max-Age=0; path=/`,document.cookie="checkout-promo-discount=; Max-Age=0; path=/",document.cookie=`checkout-promo-reveal-${r()}=; Max-Age=0; path=/`,document.cookie=`checkout-promo-reveal-ids-${r()}=; Max-Age=0; path=/`,document.cookie=`checkout-promo-discount-type-${r()}=; Max-Age=0; path=/`,e.onpromoChange?.({code:"",error:"",hint:"",discount:0,provideDiscount:!1,discountType:"",discountTicketIds:[],revealHiddenTickets:!1,revealTicketIds:[],isApplied:!1})},m=T=>{t.set(i,T.target.value,!0),t.get(o)&&t.set(o,"")},g=T=>{T.key==="Enter"&&(T.preventDefault(),h())};l2.onMount(()=>{const T=Z0(`checkout-promocode-${r()}`);T&&(t.set(i,T,!0),h())});var p=WV(),M=t.child(p),u=t.child(M,!0);t.reset(M);var f=t.sibling(M,2),_=t.child(f),A=t.child(_);{let T=t.derived(()=>s().promoCode||"Promo code"),x=t.derived(()=>t.get(c)||t.get(v)),y=t.derived(()=>t.get(l)?t.get(o):""),z=t.derived(()=>t.get(n)?"promo-hint":t.get(o)?"promo-error":void 0);D2(A,{get label(){return t.get(T)},size:"full",type:"text",oninput:m,onkeydown:g,onblur:()=>t.set(l,!0),get disabled(){return t.get(x)},get displayErrorText(){return t.get(y)},get touched(){return t.get(l)},get"aria-describedby"(){return t.get(z)},get value(){return t.get(i)},set value(k){t.set(i,k,!0)}})}t.reset(_);var w=t.sibling(_,2);{var b=T=>{{let x=t.derived(()=>s().removePromoCode||"Remove promo code"),y=t.derived(()=>t.get(i));s2(T,{strokebtn:!0,onclick:d,class:"h-10 self-start mt-5",get"aria-label"(){return`${t.get(x)??""} ${t.get(y)??""}`},children:(z,k)=>{t.next();var E=t.text();t.template_effect(()=>t.set_text(E,s().remove||"Remove")),t.append(z,E)},$$slots:{default:!0}})}},H=T=>{{let x=t.derived(()=>t.get(v)?s().checkingPromoCode||"Checking promo code":s().applyPromoCode||"Apply promo code");s2(T,{onclick:h,get disabled(){return t.get(v)},class:"h-10 self-start mt-5",get"aria-label"(){return t.get(x)},children:(y,z)=>{t.next();var k=t.text();t.template_effect(()=>t.set_text(k,t.get(v)?s().checking||"Checking...":s().apply||"Apply")),t.append(y,k)},$$slots:{default:!0}})}};t.if(w,T=>{t.get(c)?T(b):T(H,!1)})}t.reset(f);var L=t.sibling(f,2);{var V=T=>{var x=jV(),y=t.child(x,!0);t.reset(x),t.template_effect(()=>t.set_text(y,t.get(n))),t.append(T,x)};t.if(L,T=>{t.get(n)&&T(V)})}var Z=t.sibling(L,2);{var I=T=>{var x=YV(),y=t.child(x,!0);t.reset(x),t.template_effect(()=>t.set_text(y,t.get(o))),t.append(T,x)};t.if(Z,T=>{t.get(o)&&t.get(l)&&T(I)})}t.reset(p),t.template_effect(()=>t.set_text(u,s().promoCodeEntry||"Promo code entry")),t.append(a,p),t.pop()}var QV=t.from_html('<div class="flex justify-between items-center pb-4 border-b border-border" aria-hidden="true"><div><div class="h-4 rounded w-24 mb-2 bg-bg-tertiary"></div> <div class="h-3 rounded w-16 bg-bg-tertiary"></div></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div>'),KV=t.from_html('<div class="hidden md:block h-fit rounded-lg p-5 space-y-5 animate-pulse bg-card border border-border" role="status" aria-busy="true"><span class="sr-only svelte-19v1kvb">Loading order summary...</span> <div class="h-6 rounded w-2/3 bg-bg-tertiary" aria-hidden="true"></div> <!> <div class="space-y-3 pt-4" aria-hidden="true"><div class="flex justify-between"><div class="h-4 rounded w-20 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div> <div class="flex justify-between"><div class="h-4 rounded w-16 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div> <div class="flex justify-between"><div class="h-4 rounded w-12 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div></div> <div class="h-10 rounded mt-5 bg-muted" aria-hidden="true"></div></div>');function X6(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=KV(),i=t.sibling(t.child(s),4);t.each(i,16,()=>Array(2),t.index,(l,o)=>{var n=QV();t.append(l,n)}),t.next(4),t.reset(s),t.template_effect(()=>t.set_attribute(s,"aria-label",r().loadingOrderSummary||"Loading order summary")),t.append(a,s),t.pop()}var JV=t.from_html('<div class="w-14 h-14 shrink-0 rounded-md overflow-hidden bg-bg-secondary" aria-hidden="true"><img alt="" class="w-full h-full object-contain"/></div>'),$V=t.from_html("<p> </p>"),tA=t.from_html('<div class="flex-row-2 shrink-0"><span class="price-md"> </span> <button type="button" class="btn-icon btn-icon-ghost w-7 h-7"><!></button></div>'),eA=t.from_html('<header class="flex items-center gap-3 px-4 md:px-5 py-4 border-b border-border"><button type="button" class="p-2 -ml-2 rounded-full transition-colors shrink-0 text-text-secondary hover:bg-bg-secondary"><!></button> <!> <div class="flex-1 min-w-0"><h1 class="heading-lg break-words"> </h1> <div class="body-sm text-text-secondary"><p><time> </time></p> <p> </p> <!></div></div> <!></header>');function aA(a,e){t.push(e,!0);let r=t.prop(e,"variant",3,"tickets"),s=t.prop(e,"total",3,0),i=t.prop(e,"onCancel",3,()=>{}),l=t.prop(e,"onInfoClick",3,()=>{}),o=t.prop(e,"labels",19,()=>({})),n=t.derived(()=>e.event.timeZone||"America/Los_Angeles"),c=t.derived(()=>e.event.displayEndTime===!0),v=t.derived(()=>e.event.displayDoorsTime===!0),h=t.derived(()=>r()==="checkout"),d=t.derived(()=>s()>0?`$${s().toFixed(2)}`:o().free||"Free");var m=eA(),g=t.child(m),p=t.child(g);F3(p,{size:20,"aria-hidden":"true"}),t.reset(g);var M=t.sibling(g,2);{var u=z=>{var k=JV(),E=t.child(k);t.reset(k),t.template_effect(()=>t.set_attribute(E,"src",e.event.image)),t.append(z,k)};t.if(M,z=>{e.event.image&&z(u)})}var f=t.sibling(M,2),_=t.child(f),A=t.child(_,!0);t.reset(_);var w=t.sibling(_,2),b=t.child(w),H=t.child(b),L=t.child(H,!0);t.reset(H),t.reset(b);var V=t.sibling(b,2),Z=t.child(V,!0);t.reset(V);var I=t.sibling(V,2);{var T=z=>{var k=$V(),E=t.child(k,!0);t.reset(k),t.template_effect(C=>t.set_text(E,C),[()=>(o().doorsOpen||"Doors open {time}").replace("{time}",za(e.event.doorsOpenTime,t.get(n)))]),t.append(z,k)};t.if(I,z=>{t.get(v)&&e.event.doorsOpenTime&&z(T)})}t.reset(w),t.reset(f);var x=t.sibling(f,2);{var y=z=>{var k=tA(),E=t.child(k),C=t.child(E,!0);t.reset(E);var S=t.sibling(E,2),P=t.child(S);df(P,{size:18,"aria-hidden":"true"}),t.reset(S),t.reset(k),t.template_effect(D=>{t.set_attribute(E,"aria-label",D),t.set_text(C,t.get(d)),t.set_attribute(S,"aria-label",o().viewOrderDetails||"View order details")},[()=>(o().ariaOrderTotal||"Order total: {total}").replace("{total}",t.get(d))]),t.delegated("click",S,function(...D){l()?.apply(this,D)}),t.append(z,k)};t.if(x,z=>{t.get(h)&&z(y)})}t.reset(m),t.template_effect((z,k)=>{t.set_attribute(g,"aria-label",t.get(h)?o().goBackToTicketSelection||"Go back to ticket selection":o().goBackToEventDetails||"Go back to event details"),t.set_text(A,e.event.name),t.set_attribute(w,"aria-label",o().ariaEventDateTime||"Event date and time"),t.set_attribute(H,"datetime",e.event.startDateTime),t.set_text(L,z),t.set_text(Z,k)},[()=>p0(e.event.startDateTime,t.get(n)),()=>t.get(c)&&e.event.endDateTime?Aa(e.event.startDateTime,e.event.endDateTime,t.get(n)):w2(e.event.startDateTime,t.get(n))]),t.delegated("click",g,function(...z){i()?.apply(this,z)}),t.append(a,m),t.pop()}t.delegate(["click"]);var rA=t.from_html('<div class="flex items-center justify-center py-12" role="status" aria-live="polite"><p class="text-text-secondary"> </p></div>'),sA=t.from_html('<div class="text-center py-8" role="alert"><p class="text-accent-danger mb-2"> </p> <button class="go-back-btn text-white mt-4 px-4 py-2 rounded-lg svelte-19g9ni4"> </button></div>'),iA=t.from_html('<div class="text-center py-12" role="alert"><p class="text-xl font-semibold text-text-primary mb-2"> </p> <p class="text-text-secondary mb-6"> </p> <button class="go-back-btn text-white px-4 py-2 rounded-lg svelte-19g9ni4"> </button></div>'),lA=t.from_html('<div class="text-center py-12" role="alert"><p class="text-xl font-semibold text-text-primary mb-2">This event has ended</p> <p class="text-text-secondary mb-6">Tickets are no longer available for this event.</p> <button class="go-back-btn px-4 py-2 rounded-lg svelte-19g9ni4" aria-label="Go back to event details">Go back</button></div>'),oA=t.from_html('<div class="px-4 md:px-5 pt-3"><!></div>'),nA=t.from_html('<div class="hidden md:block w-80 h-[calc(100vh-40px)]"></div>'),cA=t.from_html('<div class="w-full flex md:gap-5 flex-wrap"><div class="flex-1 pb-16 md:pb-0"><div class="bg-card border-border rounded-lg md:shadow md:border py-3"><!> <!> <div class="space-y-4 md:px-5"><!></div></div></div> <!> <div><!></div></div>'),vA=t.from_html('<h3 id="error-modal-title" class="heading-lg"><!></h3>'),dA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),hA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),gA=t.from_html('<div id="error-modal-description"><!></div>'),mA=t.from_html("<!> <!>",1),pA=t.from_html('<div role="group" aria-label="Error modal actions"><!></div>'),fA=t.from_html('<h3 id="availability-modal-title" class="heading-lg"> </h3>'),uA=t.from_html('<li class="text-text-secondary text-sm"><span class="font-medium"> </span> <!></li>'),_A=t.from_html('<p class="text-text-secondary mt-4"> </p>'),HA=t.from_html('<p class="text-text-secondary mt-4"> </p>'),MA=t.from_html('<div id="availability-modal-description"><p class="text-text-secondary mb-4"> </p> <ul class="space-y-2"></ul> <!></div>'),VA=t.from_html('<div role="group" aria-label="Availability modal actions"><!> <!></div>'),AA=t.from_html('<div class="px-5 md:px-10 py-12 bg-card"><!></div> <!> <!>',1);function ca(a,e){t.push(e,!0);let r=t.prop(e,"organizationId",3,""),s=t.prop(e,"venueId",3,""),i=t.prop(e,"initialEventData",3,null),l=t.prop(e,"labels",19,()=>({})),o=t.state(!1),n=t.state(null),c=t.state(null),v=t.state(t.proxy([])),h=t.state(!1),d=t.state(!0),m=t.state(null),g=t.state(!1),p=t.state(!1),M=t.state(!1),u=t.state(0),f=t.state(void 0),_=t.state(void 0),A=t.state(t.proxy({})),w=t.state(""),b=t.state(""),H=t.state(0),L=t.state(!1),V=t.state(!1),Z=t.state("cart_failed"),I=t.state(!1),T=t.state(!1),x=t.state(t.proxy([])),y=t.state(0),z=t.state(0),k=t.derived(()=>t.get(U)?0:r0(Object.entries(t.get(A)).reduce((_1,[o1,g1])=>{const z1=t.get(n)?.availableTickets?.find(L1=>L1.ID==o1);return z1?_1+r0(g1*z1.price):_1},0))),E=t.state(0),C=0,S=t.state(0),P=t.state(!1),D=null,R=t.derived(()=>r0(t.get(k)+t.get(E)+C));function F(_1,o1){t.set(A,{...t.get(A),[_1]:Math.max(0,(t.get(A)[_1]??0)+o1)},!0),t.get(n)&&R3({eventID:t.get(n).eventID,quantities:t.get(A),promocode:t.get(w),tickets:t.get(n).availableTickets})}function B(){if(!t.get(n)?.availableTickets)return;const o1=t.get(n).availableTickets.filter(g1=>g1.visibility===0).map(g1=>parseFloat(g1.price)||0);if(o1.length===0){t.set(y,t.set(z,0),!0);return}t.set(y,Math.min(...o1).toFixed(2),!0),t.set(z,Math.max(...o1).toFixed(2),!0)}async function q(){const _1=[];for(const[o1,g1]of Object.entries(t.get(A))){if(g1<=0)continue;const z1=t.get(n)?.availableTickets?.find(L1=>L1.ID==o1);!z1||z1.price===0||_1.push({amountCents:Math.round(z1.price*100)*g1,reference:`ticket-${o1}`,quantity:g1})}if(_1.length===0){t.set(S,0),t.set(P,!1);return}D&&D.abort(),D=new AbortController,t.set(P,!0);try{const o1=await fetch("https://get-micdrop.com/api/v2/public/tax-preview",{method:"POST",headers:{"Content-Type":"application/json"},signal:D.signal,body:JSON.stringify({venueId:Number(t.get(n).venueID),lineItems:_1})});if(!o1.ok){console.error("Tax preview failed:",o1.status),t.set(S,0),t.set(P,!1);return}const g1=await o1.json();t.set(S,(g1.taxTotal??0)/100)}catch(o1){if(o1.name==="AbortError")return;console.error("Tax preview error:",o1),t.set(S,0)}finally{D?.signal?.aborted||t.set(P,!1)}}function v1(){if(!t.get(n))return;t.set(w,Z0(`checkout-promocode-${t.get(n).eventID}`)||"",!0);const _1=parseFloat(Z0("checkout-promo-discount")||0);t.set(b,t.get(w)?`${t.get(w)} applied.`:"",!0),t.set(H,_1,!0)}async function K(){try{const _1=await w6(e.eventId),o1=[];for(const[g1,z1]of Object.entries(t.get(A))){if(z1<=0)continue;const L1=_1.find(G1=>String(G1.ID)===String(g1));if(!L1)continue;const R1=L1.remainingCapacity??L1.quantity??1/0;if(R1<z1){const G1=t.get(n)?.availableTickets?.find(q1=>String(q1.ID)===String(g1));o1.push({ticketId:g1,ticketName:G1?.name||L1?.name||"Ticket",requestedQty:z1,availableQty:Math.max(0,R1)})}}return o1}catch(_1){return console.error("Error checking ticket availability:",_1),[]}}async function c1(){if(!t.get(n))return;t.set(h,!0),t.set(I,!1);const _1=await K();if(_1.length>0){t.set(h,!1),t.set(x,_1,!0),t.set(T,!0);return}await f1()}async function f1(){t.set(h,!0),R3({eventID:t.get(n).eventID,quantities:t.get(A),promocode:t.get(w),promoDiscountAmount:t.get(H),tickets:t.get(n).availableTickets});try{const _1=await Hp({eventID:t.get(n).eventID,quantities:t.get(A),promoCode:t.get(w)||void 0});if(!_1||!_1.success){t.set(h,!1),t.set(Z,"cart_failed"),t.set(V,!0);return}t.set(E,_1.serviceFee??0,!0),t.set(I,!0)}catch(_1){console.error("Order initiation failed:",_1),t.set(h,!1),t.set(Z,"cart_failed"),t.set(V,!0);return}try{if(e.onNavigateToCheckout){e.onNavigateToCheckout(e.eventId,t.get(n)),t.set(h,!1);return}const _1=new URLSearchParams;r()&&_1.set("orgId",r()),s()&&_1.set("venueId",s()),_1.set("event_id",e.eventId),_1.set("subroute","checkout");const o1=`/?${_1.toString()}`;pt(o1,{noScroll:!1}),t.set(h,!1)}catch(_1){console.error("Navigation failed after cart creation:",_1),t.set(h,!1),t.set(Z,"cart_success_network_error"),t.set(V,!0)}}function i1(){for(const o1 of t.get(x))o1.availableQty>0?t.get(A)[o1.ticketId]=o1.availableQty:delete t.get(A)[o1.ticketId];t.set(A,{...t.get(A)},!0),t.set(T,!1),t.set(x,[],!0),Object.values(t.get(A)).reduce((o1,g1)=>o1+g1,0)>0?f1():a1()}function n1(){t.set(T,!1),t.set(x,[],!0),a1()}function O(){t.set(V,!1),t.get(Z)==="cart_failed"&&a1()}function X(){t.set(V,!1),window.location.reload()}function J(){t.set(p,window.innerWidth<767)}let j=!1;function Q(){j||(window.requestAnimationFrame(()=>{N(),j=!1}),j=!0)}function N(){if(t.get(p)||!t.get(_)||!t.get(f)){t.set(M,!1);return}const _1=t.get(_).getBoundingClientRect();if(t.set(M,_1.top<=20),t.get(M)){const o1=t.get(f).getBoundingClientRect();t.set(u,o1.left+o1.width-340-40)}}function a1(){if(t.get(n)&&P3(t.get(n).eventID),e.onNavigateBack)e.onNavigateBack();else{const _1=new URLSearchParams(window.location.search);_1.set("subroute","details");const o1=`/?${_1.toString()}`;pt(o1,{})}}function H1(_1){const o1=_1?.detail??_1,{code:g1,discount:z1}=o1;t.set(w,g1||"",!0),t.set(H,z1||0,!0),t.set(b,g1?`${g1} applied.`:"",!0),o1.revealHiddenTickets!==void 0&&t.get(n)&&(document.cookie=`checkout-promo-reveal-${t.get(n).eventID}=${o1.revealHiddenTickets?"1":"0"}; path=/`,o1.revealTicketIds?.length&&(document.cookie=`checkout-promo-reveal-ids-${t.get(n).eventID}=${JSON.stringify(o1.revealTicketIds)}; path=/`))}let W=t.derived(()=>t.get(n)?Z0(`checkout-promo-reveal-${t.get(n).eventID}`)==="1":!1),l1=t.derived(()=>{if(!t.get(n))return[];try{const _1=Z0(`checkout-promo-reveal-ids-${t.get(n).eventID}`);return _1?JSON.parse(_1):[]}catch{return[]}}),U=t.derived(()=>t.get(n)?.availableTickets?.filter(_1=>_1.visibility===0)?.every(_1=>_1.price===0)),e1=t.derived(()=>{if(!t.get(n))return!1;const _1=t.get(n).endDateTime||t.get(n).startDateTime;return _1?new Date(_1)<new Date:!1});async function m1(){if(t.get(g)){if(!e.eventId){t.set(m,l().noEventIdProvided||"No event ID provided",!0),t.set(d,!1);return}t.set(d,!0),t.set(m,null);try{if(i()){if(t.set(c,i()),!t.get(g))return;t.set(n,Pt(t.get(c)),!0),t.set(v,t.get(n).availableTickets||[],!0)}else{try{if(t.set(c,await Z6(e.eventId),!0),!t.get(g))return;t.set(n,Pt(t.get(c)),!0)}catch(o1){console.error("Event fetch failed:",o1),t.set(m,l().failedToLoadEvent||"Failed to load event",!0),t.set(d,!1);return}try{if(t.set(v,await w6(e.eventId),!0),!t.get(g))return;t.get(v).length>0&&(t.get(n).availableTickets=t.get(v))}catch(o1){if(!t.get(g))return;console.error("Error fetching tickets:",o1),t.set(v,t.get(n).availableTickets||[],!0)}}t.get(n).availableTickets&&t.get(n).availableTickets.forEach(o1=>t.get(A)[o1.ID]=0);const _1=D3(t.get(n).eventID);if(t.set(A,_1.quantities||{},!0),t.set(w,_1.promocode||"",!0),t.set(H,_1.promoDiscountAmount||0,!0),t.get(n).eventID&&(await Ap(t.get(n).eventID),!t.get(g)))return;t.set(o,!0),B(),v1(),await up({eventID:t.get(n).eventID})}catch(_1){t.get(g)&&(console.error("Error loading event:",_1),t.set(m,_1.message||l().failedToLoadEvent||"Failed to load event",!0))}finally{t.get(g)&&t.set(d,!1)}}}l2.onMount(async()=>(t.set(g,!0),J(),window.addEventListener("resize",J),window.addEventListener("scroll",Q),await m1(),V_(e.eventId).then(_1=>{t.set(L,_1,!0)}).catch(()=>{t.set(L,!0)}),()=>{window.removeEventListener("resize",J),window.removeEventListener("scroll",Q)})),l2.onDestroy(()=>{t.set(g,!1),D&&D.abort()});let A1=null;t.user_effect(()=>{t.get(g)&&e.eventId&&e.eventId!==A1&&(A1=e.eventId,m1())}),t.user_effect(()=>{const _1=Object.values(t.get(A)).reduce((o1,g1)=>o1+g1,0);t.get(o)&&t.get(n)&&_1>0?q():_1===0&&(t.set(S,0),t.set(P,!1))});var b1=AA(),D1=t.first_child(b1),Y=t.child(D1);{var G=_1=>{var o1=rA(),g1=t.child(o1),z1=t.child(g1,!0);t.reset(g1),t.reset(o1),t.template_effect(()=>t.set_text(z1,l().loadingEvent||"Loading event...")),t.append(_1,o1)},r1=_1=>{var o1=sA(),g1=t.child(o1),z1=t.child(g1);t.reset(g1);var L1=t.sibling(g1,2),R1=t.child(L1,!0);t.reset(L1),t.reset(o1),t.template_effect(()=>{t.set_text(z1,`${(l().errorPrefix||"Error:")??""}
|
|
75
75
|
${t.get(m)??""}`),t.set_attribute(L1,"aria-label",l().goBackToEventDetails||"Go back to event details"),t.set_text(R1,l().goBack||"Go back")}),t.delegated("click",L1,a1),t.append(_1,o1)},C1=_1=>{var o1=iA(),g1=t.child(o1),z1=t.child(g1,!0);t.reset(g1);var L1=t.sibling(g1,2),R1=t.child(L1,!0);t.reset(L1);var G1=t.sibling(L1,2),q1=t.child(G1,!0);t.reset(G1),t.reset(o1),t.template_effect(()=>{t.set_text(z1,l().thisEventHasEnded||"This event has ended"),t.set_text(R1,l().ticketsNoLongerAvailable||"Tickets are no longer available for this event."),t.set_attribute(G1,"aria-label",l().goBackToEventDetails||"Go back to event details"),t.set_text(q1,l().goBack||"Go back")}),t.delegated("click",G1,a1),t.append(_1,o1)},p1=_1=>{var o1=lA(),g1=t.sibling(t.child(o1),4);t.reset(o1),t.delegated("click",g1,a1),t.append(_1,o1)},w1=_1=>{var o1=cA(),g1=t.child(o1),z1=t.child(g1),L1=t.child(z1);aA(L1,{get event(){return t.get(n)},get lowestPrice(){return t.get(y)},get highestPrice(){return t.get(z)},onCancel:a1,get venueFeesReady(){return t.get(o)},get labels(){return l()}});var R1=t.sibling(L1,2);{var G1=d1=>{var s1=oA(),u1=t.child(s1);XV(u1,{get eventID(){return e.eventId},onpromoChange:H1,get labels(){return l()}}),t.reset(s1),t.append(d1,s1)};t.if(R1,d1=>{t.get(L)&&d1(G1)})}var q1=t.sibling(R1,2),E1=t.child(q1);GV(E1,{get tickets(){return t.get(n).availableTickets},get quantities(){return t.get(A)},handleQuantityChange:F,get revealHiddenTickets(){return t.get(W)},get revealTicketIds(){return t.get(l1)},get venueFeesReady(){return t.get(o)},get labels(){return l()}}),t.reset(q1),t.reset(z1),t.reset(g1);var y1=t.sibling(g1,2);{var T1=d1=>{var s1=nA();t.append(d1,s1)};t.if(y1,d1=>{t.get(M)&&!t.get(p)&&d1(T1)})}var K1=t.sibling(y1,2);let O1,J1;var t1=t.child(K1);{var h1=d1=>{X6(d1,{})},x1=d1=>{{let s1=t.derived(()=>l().checkout||"Checkout"),u1=t.derived(()=>!!t.get(b));h6(d1,{get btnText(){return t.get(s1)},get loading(){return t.get(h)},checkoutTicket:c1,get quantities(){return t.get(A)},get eventTickets(){return t.get(n).availableTickets},get promoApplied(){return t.get(u1)},get promoDiscount(){return t.get(H)},get subtotal(){return t.get(k)},get fees(){return t.get(E)},taxes:C,get total(){return t.get(R)}})}};t.if(t1,d1=>{t.get(o)?t.get(n)&&t.get(n).availableTickets?.length&&d1(x1,1):d1(h1)})}t.reset(K1),t.reset(o1),t.bind_this(o1,d1=>t.set(_,d1),()=>t.get(_)),t.template_effect(()=>{O1=t.set_class(K1,1,"w-full md:w-80 flex flex-col transition-all will-change-[left] svelte-19g9ni4",null,O1,{"is-sticky":t.get(M)}),J1=t.set_style(K1,"",J1,{left:t.get(M)?`${t.get(u)}px`:"auto"})}),t.append(_1,o1)};t.if(Y,_1=>{t.get(d)?_1(G):t.get(m)?_1(r1,1):t.get(n)&&t.get(e1)?_1(C1,2):t.get(n)&&t.get(e1)?_1(p1,3):t.get(n)&&_1(w1,4)})}t.reset(D1),t.bind_this(D1,_1=>t.set(f,_1),()=>t.get(f));var S1=t.sibling(D1,2);Vt(S1,{size:"sm",oncancel:O,role:"alertdialog","aria-labelledby":"error-modal-title","aria-describedby":"error-modal-description",get open(){return t.get(V)},set open(z1){t.set(V,z1,!0)},header:z1=>{var L1=vA(),R1=t.child(L1);{var G1=E1=>{var y1=t.text();t.template_effect(()=>t.set_text(y1,l().unableToReserveTickets||"Unable to Reserve Tickets")),t.append(E1,y1)},q1=E1=>{var y1=t.text();t.template_effect(()=>t.set_text(y1,l().connectionIssue||"Connection Issue")),t.append(E1,y1)};t.if(R1,E1=>{t.get(Z)==="cart_failed"?E1(G1):E1(q1,!1)})}t.reset(L1),t.append(z1,L1)},body:z1=>{var L1=gA(),R1=t.child(L1);{var G1=E1=>{var y1=dA(),T1=t.first_child(y1),K1=t.child(T1,!0);t.reset(T1);var O1=t.sibling(T1,2),J1=t.child(O1,!0);t.reset(O1),t.template_effect(()=>{t.set_text(K1,l().cartFailedMessage||"We couldn't reserve your tickets. This may be due to a network issue or the tickets may no longer be available."),t.set_text(J1,l().pleaseGoBackAndTryAgain||"Please go back and try again.")}),t.append(E1,y1)},q1=E1=>{var y1=hA(),T1=t.first_child(y1),K1=t.child(T1,!0);t.reset(T1);var O1=t.sibling(T1,2),J1=t.child(O1,!0);t.reset(O1),t.template_effect(()=>{t.set_text(K1,l().cartSuccessMessage||"Good news! Your tickets have been reserved and are being held for you."),t.set_text(J1,l().cartSuccessNetworkError||"However, we encountered a connection issue. Please refresh the page to continue to checkout.")}),t.append(E1,y1)};t.if(R1,E1=>{t.get(Z)==="cart_failed"?E1(G1):E1(q1,!1)})}t.reset(L1),t.append(z1,L1)},footer:z1=>{var L1=pA(),R1=t.child(L1);{var G1=E1=>{{let y1=t.derived(()=>l().goBack||"Go back");s2(E1,{variant:"default",onclick:O,get"aria-label"(){return t.get(y1)},children:(T1,K1)=>{t.next();var O1=t.text();t.template_effect(()=>t.set_text(O1,l().goBack||"Go back")),t.append(T1,O1)},$$slots:{default:!0}})}},q1=E1=>{var y1=mA(),T1=t.first_child(y1);{let O1=t.derived(()=>l().cancel||"Cancel");s2(T1,{variant:"alternative",onclick:O,get"aria-label"(){return t.get(O1)},children:(J1,t1)=>{t.next();var h1=t.text();t.template_effect(()=>t.set_text(h1,l().cancel||"Cancel")),t.append(J1,h1)},$$slots:{default:!0}})}var K1=t.sibling(T1,2);{let O1=t.derived(()=>l().refreshPage||"Refresh Page");s2(K1,{variant:"default",onclick:X,get"aria-label"(){return t.get(O1)},children:(J1,t1)=>{t.next();var h1=t.text();t.template_effect(()=>t.set_text(h1,l().refreshPage||"Refresh Page")),t.append(J1,h1)},$$slots:{default:!0}})}t.append(E1,y1)};t.if(R1,E1=>{t.get(Z)==="cart_failed"?E1(G1):E1(q1,!1)})}t.reset(L1),t.append(z1,L1)},$$slots:{header:!0,body:!0,footer:!0}});var j1=t.sibling(S1,2);Vt(j1,{size:"sm",oncancel:n1,role:"alertdialog","aria-labelledby":"availability-modal-title","aria-describedby":"availability-modal-description",get open(){return t.get(T)},set open(z1){t.set(T,z1,!0)},header:z1=>{var L1=fA(),R1=t.child(L1,!0);t.reset(L1),t.template_effect(()=>t.set_text(R1,l().limitedAvailability||"Limited Availability")),t.append(z1,L1)},body:z1=>{var L1=MA(),R1=t.child(L1),G1=t.child(R1,!0);t.reset(R1);var q1=t.sibling(R1,2);t.each(q1,21,()=>t.get(x),t.index,(O1,J1)=>{var t1=uA(),h1=t.child(t1),x1=t.child(h1);t.reset(h1);var d1=t.sibling(h1,2);{var s1=k1=>{var F1=t.text();t.template_effect(W1=>t.set_text(F1,W1),[()=>(l().onlyNAvailable||"Only {available} available (you selected {requested})").replace("{available}",String(t.get(J1).availableQty)).replace("{requested}",String(t.get(J1).requestedQty))]),t.append(k1,F1)},u1=k1=>{var F1=t.text();t.template_effect(W1=>t.set_text(F1,W1),[()=>(l().soldOutYouSelected||"Sold out (you selected {requested})").replace("{requested}",String(t.get(J1).requestedQty))]),t.append(k1,F1)};t.if(d1,k1=>{t.get(J1).availableQty>0?k1(s1):k1(u1,!1)})}t.reset(t1),t.template_effect(()=>t.set_text(x1,`${t.get(J1).ticketName??""}:`)),t.append(O1,t1)}),t.reset(q1);var E1=t.sibling(q1,2);{var y1=O1=>{var J1=_A(),t1=t.child(J1,!0);t.reset(J1),t.template_effect(()=>t.set_text(t1,l().partialAvailabilityContinue||"Would you like to continue with the available tickets?")),t.append(O1,J1)},T1=t.derived(()=>t.get(x).some(O1=>O1.availableQty>0)),K1=O1=>{var J1=HA(),t1=t.child(J1,!0);t.reset(J1),t.template_effect(()=>t.set_text(t1,l().allTicketsSoldOut||"Unfortunately, all the tickets you selected have sold out.")),t.append(O1,J1)};t.if(E1,O1=>{t.get(T1)?O1(y1):O1(K1,!1)})}t.reset(L1),t.template_effect(()=>{t.set_text(G1,l().ticketsNoLongerAvailableMessage||"Some tickets you selected are no longer available in the requested quantities:"),t.set_attribute(q1,"aria-label",l().ticketAvailabilityChanges||"Ticket availability changes")}),t.append(z1,L1)},footer:z1=>{var L1=VA(),R1=t.child(L1);{let y1=t.derived(()=>l().goBack||"Go back");s2(R1,{variant:"alternative",onclick:n1,get"aria-label"(){return t.get(y1)},children:(T1,K1)=>{t.next();var O1=t.text();t.template_effect(()=>t.set_text(O1,l().goBack||"Go back")),t.append(T1,O1)},$$slots:{default:!0}})}var G1=t.sibling(R1,2);{var q1=y1=>{{let T1=t.derived(()=>l().continueWithAvailable||"Continue with available");s2(y1,{variant:"default",onclick:i1,get"aria-label"(){return t.get(T1)},children:(K1,O1)=>{t.next();var J1=t.text();t.template_effect(()=>t.set_text(J1,l().continueWithAvailable||"Continue with available")),t.append(K1,J1)},$$slots:{default:!0}})}},E1=t.derived(()=>t.get(x).some(y1=>y1.availableQty>0));t.if(G1,y1=>{t.get(E1)&&y1(q1)})}t.reset(L1),t.append(z1,L1)},$$slots:{header:!0,body:!0,footer:!0}}),t.append(a,b1),t.pop()}t.delegate(["click"]);const ce={event:{id:123,title:"Friday Night Comedy",startDateTime:"2026-03-20T20:00:00-07:00",endDateTime:"2026-03-20T22:00:00-07:00",timezone:"America/Los_Angeles",imageUrl:"/mock/view-tickets/event-poster.webp",doorsOpenTime:"7:30 PM"},tickets:[{id:1001,ticketNumber:"TKT-A8F3K2",attendeeName:"Alex Johnson",ticketType:"General Admission",qrCodeData:"MICDROP:TKT:1001:a8f3k2m9x7"},{id:1002,ticketNumber:"TKT-B7G4L3",attendeeName:"Alex Johnson",ticketType:"General Admission",qrCodeData:"MICDROP:TKT:1002:b7g4l3n8y6"},{id:1003,ticketNumber:"TKT-C6H5M4",attendeeName:"Sam Rivera",ticketType:"VIP",qrCodeData:"MICDROP:TKT:1003:c6h5m4p9z5"}],order:{orderNumber:"#12847",orderUUID:"a8f3k2m9-x7p4-q2w5-e6r8-t1y3u0i9o7",purchaseDate:"2026-03-10T14:30:00-07:00"},venue:{name:"The Comedy Store",address:"8433 Sunset Blvd, Los Angeles, CA 90069",contactEmail:"info@thecomedystore.com",logoUrl:null}};({...ce,tickets:ce.tickets[0]},{...ce,event:{...ce.event}});const zA=Y3("VC");let bA={...{baseUrl:"https://get-micdrop.com",timeout:3e4,onError:a=>zA.error("API Error:",a)}};function ve(){return`${bA.baseUrl}/api/v2/public`}function yA(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var de={},v5,Q6;function xA(){return Q6||(Q6=1,v5=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),v5}var d5={},ft={},K6;function Nt(){if(K6)return ft;K6=1;let a;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return ft.getSymbolSize=function(s){if(!s)throw new Error('"version" cannot be null or undefined');if(s<1||s>40)throw new Error('"version" should be in range from 1 to 40');return s*4+17},ft.getSymbolTotalCodewords=function(s){return e[s]},ft.getBCHDigit=function(r){let s=0;for(;r!==0;)s++,r>>>=1;return s},ft.setToSJISFunction=function(s){if(typeof s!="function")throw new Error('"toSJISFunc" is not a valid function.');a=s},ft.isKanjiModeEnabled=function(){return typeof a<"u"},ft.toSJIS=function(s){return a(s)},ft}var h5={},J6;function g5(){return J6||(J6=1,(function(a){a.L={bit:1},a.M={bit:0},a.Q={bit:3},a.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return a.L;case"m":case"medium":return a.M;case"q":case"quartile":return a.Q;case"h":case"high":return a.H;default:throw new Error("Unknown EC Level: "+r)}}a.isValid=function(s){return s&&typeof s.bit<"u"&&s.bit>=0&&s.bit<4},a.from=function(s,i){if(a.isValid(s))return s;try{return e(s)}catch{return i}}})(h5)),h5}var m5,$6;function ZA(){if($6)return m5;$6=1;function a(){this.buffer=[],this.length=0}return a.prototype={get:function(e){const r=Math.floor(e/8);return(this.buffer[r]>>>7-e%8&1)===1},put:function(e,r){for(let s=0;s<r;s++)this.putBit((e>>>r-s-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),e&&(this.buffer[r]|=128>>>this.length%8),this.length++}},m5=a,m5}var p5,t9;function wA(){if(t9)return p5;t9=1;function a(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return a.prototype.set=function(e,r,s,i){const l=e*this.size+r;this.data[l]=s,i&&(this.reservedBit[l]=!0)},a.prototype.get=function(e,r){return this.data[e*this.size+r]},a.prototype.xor=function(e,r,s){this.data[e*this.size+r]^=s},a.prototype.isReserved=function(e,r){return this.reservedBit[e*this.size+r]},p5=a,p5}var f5={},e9;function LA(){return e9||(e9=1,(function(a){const e=Nt().getSymbolSize;a.getRowColCoords=function(s){if(s===1)return[];const i=Math.floor(s/7)+2,l=e(s),o=l===145?26:Math.ceil((l-13)/(2*i-2))*2,n=[l-7];for(let c=1;c<i-1;c++)n[c]=n[c-1]-o;return n.push(6),n.reverse()},a.getPositions=function(s){const i=[],l=a.getRowColCoords(s),o=l.length;for(let n=0;n<o;n++)for(let c=0;c<o;c++)n===0&&c===0||n===0&&c===o-1||n===o-1&&c===0||i.push([l[n],l[c]]);return i}})(f5)),f5}var u5={},a9;function TA(){if(a9)return u5;a9=1;const a=Nt().getSymbolSize,e=7;return u5.getPositions=function(s){const i=a(s);return[[0,0],[i-e,0],[0,i-e]]},u5}var _5={},r9;function CA(){return r9||(r9=1,(function(a){a.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};a.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},a.from=function(i){return a.isValid(i)?parseInt(i,10):void 0},a.getPenaltyN1=function(i){const l=i.size;let o=0,n=0,c=0,v=null,h=null;for(let d=0;d<l;d++){n=c=0,v=h=null;for(let m=0;m<l;m++){let g=i.get(d,m);g===v?n++:(n>=5&&(o+=e.N1+(n-5)),v=g,n=1),g=i.get(m,d),g===h?c++:(c>=5&&(o+=e.N1+(c-5)),h=g,c=1)}n>=5&&(o+=e.N1+(n-5)),c>=5&&(o+=e.N1+(c-5))}return o},a.getPenaltyN2=function(i){const l=i.size;let o=0;for(let n=0;n<l-1;n++)for(let c=0;c<l-1;c++){const v=i.get(n,c)+i.get(n,c+1)+i.get(n+1,c)+i.get(n+1,c+1);(v===4||v===0)&&o++}return o*e.N2},a.getPenaltyN3=function(i){const l=i.size;let o=0,n=0,c=0;for(let v=0;v<l;v++){n=c=0;for(let h=0;h<l;h++)n=n<<1&2047|i.get(v,h),h>=10&&(n===1488||n===93)&&o++,c=c<<1&2047|i.get(h,v),h>=10&&(c===1488||c===93)&&o++}return o*e.N3},a.getPenaltyN4=function(i){let l=0;const o=i.data.length;for(let c=0;c<o;c++)l+=i.data[c];return Math.abs(Math.ceil(l*100/o/5)-10)*e.N4};function r(s,i,l){switch(s){case a.Patterns.PATTERN000:return(i+l)%2===0;case a.Patterns.PATTERN001:return i%2===0;case a.Patterns.PATTERN010:return l%3===0;case a.Patterns.PATTERN011:return(i+l)%3===0;case a.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(l/3))%2===0;case a.Patterns.PATTERN101:return i*l%2+i*l%3===0;case a.Patterns.PATTERN110:return(i*l%2+i*l%3)%2===0;case a.Patterns.PATTERN111:return(i*l%3+(i+l)%2)%2===0;default:throw new Error("bad maskPattern:"+s)}}a.applyMask=function(i,l){const o=l.size;for(let n=0;n<o;n++)for(let c=0;c<o;c++)l.isReserved(c,n)||l.xor(c,n,r(i,c,n))},a.getBestMask=function(i,l){const o=Object.keys(a.Patterns).length;let n=0,c=1/0;for(let v=0;v<o;v++){l(v),a.applyMask(v,i);const h=a.getPenaltyN1(i)+a.getPenaltyN2(i)+a.getPenaltyN3(i)+a.getPenaltyN4(i);a.applyMask(v,i),h<c&&(c=h,n=v)}return n}})(_5)),_5}var va={},s9;function i9(){if(s9)return va;s9=1;const a=g5(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return va.getBlocksCount=function(i,l){switch(l){case a.L:return e[(i-1)*4+0];case a.M:return e[(i-1)*4+1];case a.Q:return e[(i-1)*4+2];case a.H:return e[(i-1)*4+3];default:return}},va.getTotalCodewordsCount=function(i,l){switch(l){case a.L:return r[(i-1)*4+0];case a.M:return r[(i-1)*4+1];case a.Q:return r[(i-1)*4+2];case a.H:return r[(i-1)*4+3];default:return}},va}var H5={},Je={},l9;function EA(){if(l9)return Je;l9=1;const a=new Uint8Array(512),e=new Uint8Array(256);return(function(){let s=1;for(let i=0;i<255;i++)a[i]=s,e[s]=i,s<<=1,s&256&&(s^=285);for(let i=255;i<512;i++)a[i]=a[i-255]})(),Je.log=function(s){if(s<1)throw new Error("log("+s+")");return e[s]},Je.exp=function(s){return a[s]},Je.mul=function(s,i){return s===0||i===0?0:a[e[s]+e[i]]},Je}var o9;function kA(){return o9||(o9=1,(function(a){const e=EA();a.mul=function(s,i){const l=new Uint8Array(s.length+i.length-1);for(let o=0;o<s.length;o++)for(let n=0;n<i.length;n++)l[o+n]^=e.mul(s[o],i[n]);return l},a.mod=function(s,i){let l=new Uint8Array(s);for(;l.length-i.length>=0;){const o=l[0];for(let c=0;c<i.length;c++)l[c]^=e.mul(i[c],o);let n=0;for(;n<l.length&&l[n]===0;)n++;l=l.slice(n)}return l},a.generateECPolynomial=function(s){let i=new Uint8Array([1]);for(let l=0;l<s;l++)i=a.mul(i,new Uint8Array([1,e.exp(l)]));return i}})(H5)),H5}var M5,n9;function SA(){if(n9)return M5;n9=1;const a=kA();function e(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(s){this.degree=s,this.genPoly=a.generateECPolynomial(this.degree)},e.prototype.encode=function(s){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(s.length+this.degree);i.set(s);const l=a.mod(i,this.genPoly),o=this.degree-l.length;if(o>0){const n=new Uint8Array(this.degree);return n.set(l,o),n}return l},M5=e,M5}var V5={},A5={},z5={},c9;function v9(){return c9||(c9=1,z5.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),z5}var q0={},d9;function h9(){if(d9)return q0;d9=1;const a="[0-9]+",e="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const s="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
|
|
76
76
|
]))+`;q0.KANJI=new RegExp(r,"g"),q0.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),q0.BYTE=new RegExp(s,"g"),q0.NUMERIC=new RegExp(a,"g"),q0.ALPHANUMERIC=new RegExp(e,"g");const i=new RegExp("^"+r+"$"),l=new RegExp("^"+a+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return q0.testKanji=function(c){return i.test(c)},q0.testNumeric=function(c){return l.test(c)},q0.testAlphanumeric=function(c){return o.test(c)},q0}var g9;function Ft(){return g9||(g9=1,(function(a){const e=v9(),r=h9();a.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},a.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},a.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},a.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},a.MIXED={bit:-1},a.getCharCountIndicator=function(l,o){if(!l.ccBits)throw new Error("Invalid mode: "+l);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?l.ccBits[0]:o<27?l.ccBits[1]:l.ccBits[2]},a.getBestModeForData=function(l){return r.testNumeric(l)?a.NUMERIC:r.testAlphanumeric(l)?a.ALPHANUMERIC:r.testKanji(l)?a.KANJI:a.BYTE},a.toString=function(l){if(l&&l.id)return l.id;throw new Error("Invalid mode")},a.isValid=function(l){return l&&l.bit&&l.ccBits};function s(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return a.NUMERIC;case"alphanumeric":return a.ALPHANUMERIC;case"kanji":return a.KANJI;case"byte":return a.BYTE;default:throw new Error("Unknown mode: "+i)}}a.from=function(l,o){if(a.isValid(l))return l;try{return s(l)}catch{return o}}})(A5)),A5}var m9;function IA(){return m9||(m9=1,(function(a){const e=Nt(),r=i9(),s=g5(),i=Ft(),l=v9(),o=7973,n=e.getBCHDigit(o);function c(m,g,p){for(let M=1;M<=40;M++)if(g<=a.getCapacity(M,p,m))return M}function v(m,g){return i.getCharCountIndicator(m,g)+4}function h(m,g){let p=0;return m.forEach(function(M){const u=v(M.mode,g);p+=u+M.getBitsLength()}),p}function d(m,g){for(let p=1;p<=40;p++)if(h(m,p)<=a.getCapacity(p,g,i.MIXED))return p}a.from=function(g,p){return l.isValid(g)?parseInt(g,10):p},a.getCapacity=function(g,p,M){if(!l.isValid(g))throw new Error("Invalid QR Code version");typeof M>"u"&&(M=i.BYTE);const u=e.getSymbolTotalCodewords(g),f=r.getTotalCodewordsCount(g,p),_=(u-f)*8;if(M===i.MIXED)return _;const A=_-v(M,g);switch(M){case i.NUMERIC:return Math.floor(A/10*3);case i.ALPHANUMERIC:return Math.floor(A/11*2);case i.KANJI:return Math.floor(A/13);case i.BYTE:default:return Math.floor(A/8)}},a.getBestVersionForData=function(g,p){let M;const u=s.from(p,s.M);if(Array.isArray(g)){if(g.length>1)return d(g,u);if(g.length===0)return 1;M=g[0]}else M=g;return c(M.mode,M.getLength(),u)},a.getEncodedBits=function(g){if(!l.isValid(g)||g<7)throw new Error("Invalid QR Code version");let p=g<<12;for(;e.getBCHDigit(p)-n>=0;)p^=o<<e.getBCHDigit(p)-n;return g<<12|p}})(V5)),V5}var b5={},p9;function DA(){if(p9)return b5;p9=1;const a=Nt(),e=1335,r=21522,s=a.getBCHDigit(e);return b5.getEncodedBits=function(l,o){const n=l.bit<<3|o;let c=n<<10;for(;a.getBCHDigit(c)-s>=0;)c^=e<<a.getBCHDigit(c)-s;return(n<<10|c)^r},b5}var y5={},x5,f9;function PA(){if(f9)return x5;f9=1;const a=Ft();function e(r){this.mode=a.NUMERIC,this.data=r.toString()}return e.getBitsLength=function(s){return 10*Math.floor(s/3)+(s%3?s%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(s){let i,l,o;for(i=0;i+3<=this.data.length;i+=3)l=this.data.substr(i,3),o=parseInt(l,10),s.put(o,10);const n=this.data.length-i;n>0&&(l=this.data.substr(i),o=parseInt(l,10),s.put(o,n*3+1))},x5=e,x5}var Z5,u9;function RA(){if(u9)return Z5;u9=1;const a=Ft(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(s){this.mode=a.ALPHANUMERIC,this.data=s}return r.getBitsLength=function(i){return 11*Math.floor(i/2)+6*(i%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(i){let l;for(l=0;l+2<=this.data.length;l+=2){let o=e.indexOf(this.data[l])*45;o+=e.indexOf(this.data[l+1]),i.put(o,11)}this.data.length%2&&i.put(e.indexOf(this.data[l]),6)},Z5=r,Z5}var w5,_9;function OA(){if(_9)return w5;_9=1;const a=Ft();function e(r){this.mode=a.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return e.getBitsLength=function(s){return s*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(r){for(let s=0,i=this.data.length;s<i;s++)r.put(this.data[s],8)},w5=e,w5}var L5,H9;function NA(){if(H9)return L5;H9=1;const a=Ft(),e=Nt();function r(s){this.mode=a.KANJI,this.data=s}return r.getBitsLength=function(i){return i*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(s){let i;for(i=0;i<this.data.length;i++){let l=e.toSJIS(this.data[i]);if(l>=33088&&l<=40956)l-=33088;else if(l>=57408&&l<=60351)l-=49472;else throw new Error("Invalid SJIS character: "+this.data[i]+`
|
|
77
77
|
Make sure your charset is UTF-8`);l=(l>>>8&255)*192+(l&255),s.put(l,13)}},L5=r,L5}var T5={exports:{}},M9;function FA(){return M9||(M9=1,(function(a){var e={single_source_shortest_paths:function(r,s,i){var l={},o={};o[s]=0;var n=e.PriorityQueue.make();n.push(s,0);for(var c,v,h,d,m,g,p,M,u;!n.empty();){c=n.pop(),v=c.value,d=c.cost,m=r[v]||{};for(h in m)m.hasOwnProperty(h)&&(g=m[h],p=d+g,M=o[h],u=typeof o[h]>"u",(u||M>p)&&(o[h]=p,n.push(h,p),l[h]=v))}if(typeof i<"u"&&typeof o[i]>"u"){var f=["Could not find a path from ",s," to ",i,"."].join("");throw new Error(f)}return l},extract_shortest_path_from_predecessor_list:function(r,s){for(var i=[],l=s;l;)i.push(l),r[l],l=r[l];return i.reverse(),i},find_path:function(r,s,i){var l=e.single_source_shortest_paths(r,s,i);return e.extract_shortest_path_from_predecessor_list(l,i)},PriorityQueue:{make:function(r){var s=e.PriorityQueue,i={},l;r=r||{};for(l in s)s.hasOwnProperty(l)&&(i[l]=s[l]);return i.queue=[],i.sorter=r.sorter||s.default_sorter,i},default_sorter:function(r,s){return r.cost-s.cost},push:function(r,s){var i={value:r,cost:s};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};a.exports=e})(T5)),T5.exports}var V9;function BA(){return V9||(V9=1,(function(a){const e=Ft(),r=PA(),s=RA(),i=OA(),l=NA(),o=h9(),n=Nt(),c=FA();function v(f){return unescape(encodeURIComponent(f)).length}function h(f,_,A){const w=[];let b;for(;(b=f.exec(A))!==null;)w.push({data:b[0],index:b.index,mode:_,length:b[0].length});return w}function d(f){const _=h(o.NUMERIC,e.NUMERIC,f),A=h(o.ALPHANUMERIC,e.ALPHANUMERIC,f);let w,b;return n.isKanjiModeEnabled()?(w=h(o.BYTE,e.BYTE,f),b=h(o.KANJI,e.KANJI,f)):(w=h(o.BYTE_KANJI,e.BYTE,f),b=[]),_.concat(A,w,b).sort(function(L,V){return L.index-V.index}).map(function(L){return{data:L.data,mode:L.mode,length:L.length}})}function m(f,_){switch(_){case e.NUMERIC:return r.getBitsLength(f);case e.ALPHANUMERIC:return s.getBitsLength(f);case e.KANJI:return l.getBitsLength(f);case e.BYTE:return i.getBitsLength(f)}}function g(f){return f.reduce(function(_,A){const w=_.length-1>=0?_[_.length-1]:null;return w&&w.mode===A.mode?(_[_.length-1].data+=A.data,_):(_.push(A),_)},[])}function p(f){const _=[];for(let A=0;A<f.length;A++){const w=f[A];switch(w.mode){case e.NUMERIC:_.push([w,{data:w.data,mode:e.ALPHANUMERIC,length:w.length},{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.ALPHANUMERIC:_.push([w,{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.KANJI:_.push([w,{data:w.data,mode:e.BYTE,length:v(w.data)}]);break;case e.BYTE:_.push([{data:w.data,mode:e.BYTE,length:v(w.data)}])}}return _}function M(f,_){const A={},w={start:{}};let b=["start"];for(let H=0;H<f.length;H++){const L=f[H],V=[];for(let Z=0;Z<L.length;Z++){const I=L[Z],T=""+H+Z;V.push(T),A[T]={node:I,lastCount:0},w[T]={};for(let x=0;x<b.length;x++){const y=b[x];A[y]&&A[y].node.mode===I.mode?(w[y][T]=m(A[y].lastCount+I.length,I.mode)-m(A[y].lastCount,I.mode),A[y].lastCount+=I.length):(A[y]&&(A[y].lastCount=I.length),w[y][T]=m(I.length,I.mode)+4+e.getCharCountIndicator(I.mode,_))}}b=V}for(let H=0;H<b.length;H++)w[b[H]].end=0;return{map:w,table:A}}function u(f,_){let A;const w=e.getBestModeForData(f);if(A=e.from(_,w),A!==e.BYTE&&A.bit<w.bit)throw new Error('"'+f+'" cannot be encoded with mode '+e.toString(A)+`.
|