@getmicdrop/venue-calendar 3.7.5 → 3.7.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-D5woxGvc.js → CarouselView.legacy-BerW2BIf.js} +2 -2
- package/dist/{CarouselView.legacy-D5woxGvc.js.map → CarouselView.legacy-BerW2BIf.js.map} +1 -1
- package/dist/{Checkout.legacy-COqVbbvZ.js → Checkout.legacy-BUTDyZEl.js} +2 -2
- package/dist/{Checkout.legacy-COqVbbvZ.js.map → Checkout.legacy-BUTDyZEl.js.map} +1 -1
- package/dist/{CollectionView.legacy-By94GSut.js → CollectionView.legacy-CpbK7GfV.js} +2 -2
- package/dist/{CollectionView.legacy-By94GSut.js.map → CollectionView.legacy-CpbK7GfV.js.map} +1 -1
- package/dist/{FeaturedView.legacy-B8KkxEQY.js → FeaturedView.legacy-D3yl9J0Z.js} +2 -2
- package/dist/{FeaturedView.legacy-B8KkxEQY.js.map → FeaturedView.legacy-D3yl9J0Z.js.map} +1 -1
- package/dist/{GalleryView.legacy-C3dOgBD6.js → GalleryView.legacy-DMKXaHB-.js} +2 -2
- package/dist/{GalleryView.legacy-C3dOgBD6.js.map → GalleryView.legacy-DMKXaHB-.js.map} +1 -1
- package/dist/{GroupedListView.legacy-DTOqtS9B.js → GroupedListView.legacy-407NxwnE.js} +2 -2
- package/dist/{GroupedListView.legacy-DTOqtS9B.js.map → GroupedListView.legacy-407NxwnE.js.map} +1 -1
- package/dist/{SeriesPage.legacy-CQM0apyA.js → SeriesPage.legacy-BaoXX6o6.js} +2 -2
- package/dist/{SeriesPage.legacy-CQM0apyA.js.map → SeriesPage.legacy-BaoXX6o6.js.map} +1 -1
- package/dist/{Success.legacy-D3PYCfHW.js → Success.legacy-zgBL-BU6.js} +2 -2
- package/dist/{Success.legacy-D3PYCfHW.js.map → Success.legacy-zgBL-BU6.js.map} +1 -1
- package/dist/{VenueCalendar-XWZRPtLP.js → VenueCalendar-B901yBqy.js} +14 -14
- package/dist/{VenueCalendar-XWZRPtLP.js.map → VenueCalendar-B901yBqy.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
|
@@ -70,7 +70,7 @@ END:VEVENT
|
|
|
70
70
|
END:VCALENDAR`,k=new Blob([Z],{type:"text/calendar;charset=utf-8"}),E=URL.createObjectURL(k),L=document.createElement("a");L.href=E;const x=(e.event.title||"event").replace(/[^a-zA-Z0-9\s-]/g,"").replace(/\s+/g,"-");L.download=`${x}.ics`,document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(E),t.set(s,!1)}function n(){t.set(s,!1)}async function c(){const _={url:e.eventUrl};if(navigator.share)try{await navigator.share(_)}catch(u){u instanceof Error&&u.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.
|
|
71
71
|
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.
|
|
72
72
|
In production, this would create a Google Wallet pass via the Google Pay API.`)}let m=t.derived(()=>(()=>{const _=[e.event.venue.name,e.event.venue.address].filter(Boolean);return`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(_.join(", "))}`})());function g(){window.location.href=e.eventUrl}var p=fV();let H;var f=t.child(p);Bt(f,{border:!0,padding:!1,class:"rounded-xl shadow-lg overflow-hidden bg-surface-secondary",children:(_,u)=>{var A=pV(),y=t.first_child(A),b=t.child(y);t.reset(y);var M=t.sibling(y,2),w=t.child(M),V=t.child(w);h2(V,{size:"sm",class:"font-semibold block leading-tight",children:(F,a1)=>{t.next();var i1=t.text();t.template_effect(()=>t.set_text(i1,e.event.title)),t.append(F,i1)},$$slots:{default:!0}});var Z=t.sibling(V,2),k=t.child(Z);Ne(k,{size:16,class:"shrink-0 icon-muted"});var E=t.sibling(k,2);h2(E,{size:"xs",color:"muted",children:(F,a1)=>{t.next();var i1=cV(),B=t.first_child(i1),J=t.sibling(B);{var V1=t1=>{var r1=t.text();t.template_effect(Q=>t.set_text(r1,`· ${Q??""}`),[()=>w2(e.event.startDateTime,e.event.timezone)]),t.append(t1,r1)};t.if(J,t1=>{e.event.displayStartTime!==!1&&t1(V1)})}t.template_effect(t1=>t.set_text(B,`${t1??""} `),[()=>$0(e.event.startDateTime,e.event.timezone)]),t.append(F,i1)},$$slots:{default:!0}}),t.reset(Z);var L=t.sibling(Z,2);h2(L,{size:"xs",color:"muted",class:"block mt-0.5",children:(F,a1)=>{t.next();var i1=t.text();t.template_effect(()=>t.set_text(i1,e.event.venue.name)),t.append(F,i1)},$$slots:{default:!0}}),t.reset(w);var x=t.sibling(w,2),z=t.child(x),I=t.child(z);t.reset(z);var C=t.sibling(z,2),T=t.child(C),S=t.sibling(T,2);t.reset(C),t.reset(x);var P=t.sibling(x,4),D=t.child(P);r2(D,{variant:"default",size:"md",class:"w-full",onclick:i,children:(F,a1)=>{var i1=vV(),B=t.first_child(i1);Ne(B,{size:16});var J=t.sibling(B),V1=t.sibling(J);{let t1=t.derived(()=>t.get(s)?"rotate-180":"");N3(V1,{size:16,get class(){return`ml-auto transition-transform ${t.get(t1)??""}`}})}t.template_effect(()=>t.set_text(J,` ${(r().addToCalendar||"Add to Calendar")??""} `)),t.append(F,i1)},$$slots:{default:!0}});var R=t.sibling(D,2);{var q=F=>{var a1=dV(),i1=t.child(a1),B=t.sibling(t.child(i1));t.reset(i1);var J=t.sibling(i1,2),V1=t.child(J);Sp(V1,{size:16,class:"shrink-0"});var t1=t.sibling(V1);t.reset(J),t.reset(a1),t.template_effect(()=>{t.set_attribute(i1,"href",t.get(l)),t.set_text(B,` ${(r().googleCalendar||"Google Calendar")??""}`),t.set_text(t1,` ${(r().appleCalendar||"Apple Calendar (.ics)")??""}`)}),t.delegated("click",i1,n),t.delegated("click",J,o),t.append(F,a1)};t.if(R,F=>{t.get(s)&&F(q)})}t.reset(P);var U=t.sibling(P,2),G=t.child(U);r2(G,{variant:"default",size:"md",class:"flex-1",onclick:c,children:(F,a1)=>{var i1=hV(),B=t.first_child(i1);H6(B,{size:16});var J=t.sibling(B);t.template_effect(()=>t.set_text(J,` ${(r().share||"Share")??""}`)),t.append(F,i1)},$$slots:{default:!0}});var n1=t.sibling(G,2);{var W=F=>{r2(F,{variant:"default",size:"md",class:"flex-1",get href(){return t.get(m)},target:"_blank",children:(a1,i1)=>{var B=gV(),J=t.first_child(B);Vf(J,{size:16});var V1=t.sibling(J);t.template_effect(()=>t.set_text(V1,` ${(r().map||"Map")??""}`)),t.append(a1,B)},$$slots:{default:!0}})};t.if(n1,F=>{e.event.venue.address&&F(W)})}t.reset(U);var v1=t.sibling(U,2),m1=t.child(v1),$=t.child(m1);O3($,{size:16,class:"shrink-0"});var d1=t.sibling($);t.reset(m1);var N=t.sibling(m1,2);{var O=F=>{var a1=mV(),i1=t.sibling(t.first_child(a1),2),B=t.child(i1);hf(B,{size:16,class:"shrink-0"});var J=t.sibling(B);t.reset(i1),t.template_effect(()=>{t.set_attribute(i1,"href",`mailto:${e.event.venue.contactEmail??""}?subject=Help with Order ${e.orderId??""}`),t.set_text(J,` ${(r().needHelp||"Need help?")??""}`)}),t.append(F,a1)};t.if(N,F=>{e.event.venue.contactEmail&&F(O)})}t.reset(v1),t.reset(M),t.template_effect(()=>{t.set_attribute(b,"src",e.event.imageUrl),t.set_attribute(b,"alt",e.event.title),t.set_attribute(I,"alt",r().addToAppleWallet||"Add to Apple Wallet"),t.set_attribute(T,"alt",r().saveToGoogleWallet||"Save to Google Wallet"),t.set_attribute(S,"alt",r().saveToGoogleWallet||"Save to Google Wallet"),t.set_text(d1,` ${(r().backToEvent||"Back to event")??""}`)}),t.delegated("click",z,h),t.delegated("click",C,d),t.delegated("click",m1,g),t.append(_,A)},$$slots:{default:!0}}),t.reset(p),t.template_effect(()=>H=t.set_class(p,1,"actions-wrapper svelte-zqubiq",null,H,{visible:e.showContent})),t.append(a,p),t.pop()}t.delegate(["click"]);var uV=t.from_html('<button type="button"><span></span> </button>'),_V=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>'),HV=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 MV(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(()=>l5(o()));let c=t.derived(()=>!i());const v={default:{event:Y2,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:$3,orderId:"12848",lines:[{ticketId:201,ticketName:"Free Entry",quantity:2,unitPrice:0,fee:0,subtotal:0}],customerEmail:"comedy.fan@gmail.com"},registration:{event:t5,orderId:"12849",lines:[{ticketId:301,ticketName:"Workshop Seat",quantity:1,unitPrice:75,fee:7.5,subtotal:75}],customerEmail:"learner@example.com"},donation:{event:e5,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 L=t.get(h).lines,x=L.reduce((C,T)=>C+T.subtotal,0),z=L.reduce((C,T)=>C+T.fee*T.quantity,0),I=i5(x+z,t.get(h).event.venue.taxPercentage);return{lines:L,subtotal:x,fees:z,taxes:I,total:x+z+I,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),H=t.state(!1);function f(){if(t.get(H)){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),f())}),G1.onMount(()=>{t.set(H,window.matchMedia("(prefers-reduced-motion: reduce)").matches,!0),f()});var _=HV(),u=t.child(_);{var A=L=>{var x=_V(),z=t.sibling(t.child(x),2);t.each(z,17,()=>s,t.index,(I,C)=>{const T=t.derived(()=>t.get(r)===t.get(C).value);var S=uV(),P=t.child(S),D=t.sibling(P);t.reset(S),t.template_effect(()=>{t.set_class(S,1,`toggle-btn ${t.get(T)?"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(C).color??""} shrink-0`,"svelte-1cyfs2"),t.set_text(D,` ${t.get(C).label??""}`)}),t.delegated("click",S,()=>{t.set(r,t.get(C).value,!0)}),t.append(I,S)}),t.reset(x),t.append(L,x)};t.if(u,L=>{t.get(c)&&L(A)})}var y=t.sibling(u,2),b=t.child(y),M=t.child(b);W6(M,{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 w=t.sibling(M,2),V=t.child(w);X6(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(w),t.reset(b);var Z=t.sibling(b,2),k=t.child(Z);W6(k,{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 E=t.sibling(k,2);X6(E,{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(y),t.reset(_),t.append(a,_),t.pop()}t.delegate(["click"]);var VV=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>'),AV=t.from_html('<div class="flex items-center justify-center py-24 text-center loading-container svelte-1mm1psu"><p> </p></div>');function We(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(()=>bx).then(_=>{t.set(s,_.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);G1.onMount(async()=>{const{id:_,slug:u,event:A,orderId:y,orderUuid:b,customerEmail:M,ticketCount:w}=i()||{};t.set(c,`${window.location.origin}/e/${_}-${u}`);let V;try{V=iV(A)}catch(L){console.warn("Success: transformApiEvent failed:",L),t.set(v,o().failedToLoadEventData||"Failed to load event data.",!0),t.set(h,!1);return}let Z=y||"",k=M||"",E=[];if(Z)try{const L=await R3(Z);if(L){k=L.customerEmail||k;const x=L.purchasedTickets||L.tickets||[],z=new Map;for(const I of x){const C=`${I.ticketTypeId||I.ticketId||0}-${I.ticketName||I.name||""}`,T=z.get(C);T?(T.quantity+=1,T.subtotal+=I.purchasePrice||I.price||0):z.set(C,{ticketId:I.ticketTypeId||I.ticketId||0,ticketName:I.ticketName||I.name||o().ticketFallbackName||"Ticket",quantity:1,unitPrice:I.purchasePrice||I.price||0,fee:0,subtotal:I.purchasePrice||I.price||0})}E=Array.from(z.values())}}catch(L){console.warn("Success: getOrder failed, using route params:",L)}E.length===0&&w>0&&(E=[{ticketId:0,ticketName:o().ticketFallbackName||"Ticket",quantity:w,unitPrice:0,fee:0,subtotal:0}]),t.set(n,{event:V,orderId:String(Z),lines:E,customerEmail:k},!0),I3(String(_)),Pe("checkout-cartid"),t.set(h,!1)});var d=t.comment(),m=t.first_child(d);{var g=_=>{var u=t.comment(),A=t.first_child(u);t.component(A,()=>t.get(s),(y,b)=>{b(y,{get data(){return i()},get browseUrl(){return l()}})}),t.append(_,u)},p=_=>{var u=VV(),A=t.child(u),y=t.child(A,!0);t.reset(A),t.reset(u),t.template_effect(()=>t.set_text(y,t.get(v))),t.append(_,u)},H=_=>{var u=AV(),A=t.child(u),y=t.child(A,!0);t.reset(A),t.reset(u),t.template_effect(()=>t.set_text(y,o().loadingYourOrder||"Loading your order")),t.append(_,u)},f=_=>{MV(_,{get data(){return t.get(n)},get eventUrl(){return t.get(c)}})};t.if(m,_=>{t.get(r)&&t.get(s)?_(g):t.get(v)?_(p,1):t.get(h)||!t.get(n)?_(H,2):_(f,!1)})}t.append(a,d),t.pop()}const Q0={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"},la={blue:"#4285f4",green:"#34a853",yellow:"#fbbc05",red:"#ea4335"};var zV=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>'),bV=t.from_html('<span class="sales-start-badge text-xs text-secondary whitespace-nowrap svelte-12zmutv" role="status"> </span>'),yV=t.from_html('<span class="sr-only" role="alert"> </span>'),xV=t.from_html('<div class="donation-input-wrapper svelte-12zmutv"><!> <!></div>'),ZV=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),wV=t.from_html('<span class="price-lg text-primary svelte-12zmutv"> </span>'),LV=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),TV=t.from_html('<span class="badge badge-discount"> </span>'),CV=t.from_html('<span class="badge badge-unlocked"> </span>'),EV=t.from_html('<div class="flex-row-2 mb-2 flex-wrap" role="status" aria-live="polite"><!> <!></div>'),kV=t.from_html('<p class="text-sm text-secondary mb-3 svelte-12zmutv"> </p>'),SV=t.from_html("<span> </span>"),IV=t.from_html('<p class="sales-end-text text-xs svelte-12zmutv" role="status"> </p>'),DV=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 PV(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),H=t.prop(e,"donationAmount",3,""),f=t.prop(e,"labels",19,()=>({}));const _=t.derived(()=>p()===2),u=t.derived(()=>parseFloat(H())||0),A=t.derived(()=>t.get(_)&&H()!==""&&t.get(u)<1?f().minimumDonation||"Minimum $1.00":""),y=t.derived(()=>!t.get(_)||H()!==""&&t.get(u)>=1),b=t.derived(()=>parseFloat(e.price)||0),M=t.derived(()=>t.get(b)===0?0:parseFloat(r())||0),w=t.derived(()=>(t.get(b)+t.get(M)).toFixed(2)),V=t.derived(()=>t.get(M).toFixed(2)),Z=t.derived(()=>d()?parseFloat(d()):null),k=t.derived(()=>t.get(Z)===null||t.get(Z)===0?0:parseFloat(r())||0),E=t.derived(()=>t.get(Z)!==null?(t.get(Z)+t.get(k)).toFixed(2):null),L=t.derived(()=>v()??c()??0),x=10,z=15,I=30,C=5,T=20;function S(l1,g1){if(g1===0)return 0;const b1=I/g1*100,T1=C/g1*100;return Math.max(Math.min(l1,b1),T1)}t.derived(()=>{const l1=c()??0,g1=t.get(L);if(g1===0||l()==="scheduled"||l()==="sales_ended")return null;if(l1<=0)return{text:"Sold out",type:"sold-out"};if(t.get(b)===0)return null;const b1=l1/g1*100,T1=S(x,g1),P1=S(z,g1);return b1<=T1&&l1<=T?{text:`Only ${l1} left`,type:"scarcity",showFlame:!0}:b1<=P1?{text:"Few tickets left",type:"scarcity",showFlame:!0}:null});function P(l1){return l1?yr(l1,{year:void 0,timeZone:"UTC"}):""}function D(l1){const g1=new Date,b1=new Date(g1);return b1.setDate(b1.getDate()+1),l1.toDateString()===b1.toDateString()}function R(l1){const g1=new Date,T1=(l1.getTime()-g1.getTime())/(1e3*60*60*24);return T1>0&&T1<=7}function q(l1){if(!l1)return{text:"",preposition:""};const g1=new Date(l1),b1=new Date,T1=g1.getTime()-b1.getTime(),P1=Math.round(T1/(1e3*60)),O1=T1/(1e3*60*60),k1=f().locale||"en-US";if(P1>0&&P1<60){const q1=Math.max(1,P1);return{text:(q1===1?f().inNMinute||"in {n} minute":f().inNMinutes||"in {n} minutes").replace("{n}",String(q1)),preposition:""}}if(O1>0&&O1<24){const q1=Math.max(1,Math.round(O1));return{text:(q1===1?f().inNHour||"in {n} hour":f().inNHours||"in {n} hours").replace("{n}",String(q1)),preposition:""}}if(D(g1)){const q1=La(l1,{timeZone:"UTC"});return{text:(f().tomorrowAtTime||"tomorrow at {time}").replace("{time}",q1),preposition:""}}if(R(g1)){const q1=new Intl.DateTimeFormat(k1,{weekday:"long"}).format(g1),D1=La(l1,{timeZone:"UTC"});return{text:(f().onDayAtTime||"on {day} at {time}").replace("{day}",q1).replace("{time}",D1),preposition:""}}const R1=new Intl.DateTimeFormat(k1,{month:"short",day:"numeric"}).format(g1);return{text:(f().onDate||"on {date}").replace("{date}",R1),preposition:""}}function U(l1){const{text:g1}=q(l1);return g1}function G(l1){return q(l1)}const n1=t.derived(()=>(()=>{if(!l())return null;switch(l()){case"scheduled":return{showAsMessage:!0,message:(f().salesStart||"Sales start {salesStart}").replace("{salesStart}",U(o()))};case"on_sale":return null;case"sales_ended":return{badge:f().statusSalesEnded||"Sales ended",badgeClass:"badge-ended",label:"Ended",date:P(n())};default:return null}})());var W=DV();let v1;var m1=t.child(W),$=t.child(m1),d1=t.child($),N=t.child(d1),O=t.child(N,!0);t.reset(N),t.reset(d1);var F=t.sibling(d1,2);{var a1=l1=>{var g1=zV();let b1;var T1=t.child(g1);{let D1=t.derived(()=>s()===0),E1=t.derived(()=>(f().decreaseQuantity||"Decrease quantity for {title}").replace("{title}",e.title));r2(T1,{iconbtn:!0,strokebtn:!0,onclick:()=>e.ondecrement?.(),get disabled(){return t.get(D1)},get"aria-label"(){return t.get(E1)},class:"qty-btn",children:(L1,J1)=>{M6(L1,{size:20,"aria-hidden":"true"})},$$slots:{default:!0}})}var P1=t.sibling(T1,2),O1=t.child(P1),k1=t.child(O1,!0);t.reset(O1);var R1=t.sibling(O1);t.reset(P1);var q1=t.sibling(P1,2);{let D1=t.derived(()=>h()!==null&&s()>=h()||c()!==null&&s()>=c()||!t.get(y)),E1=t.derived(()=>(f().increaseQuantity||"Increase quantity for {title}").replace("{title}",e.title));r2(q1,{iconbtn:!0,onclick:()=>e.onincrement?.(),get disabled(){return t.get(D1)},get"aria-label"(){return t.get(E1)},class:"qty-btn",children:(L1,J1)=>{f6(L1,{size:20,"aria-hidden":"true"})},$$slots:{default:!0}})}t.reset(g1),t.template_effect(D1=>{b1=t.set_class(g1,1,"flex items-center quantity-selector svelte-12zmutv",null,b1,{active:s()>0}),t.set_attribute(g1,"aria-label",D1),t.set_text(k1,f().quantity||"Quantity:"),t.set_text(R1,` ${s()??""}`)},[()=>(f().quantitySelector||"Quantity selector for {title}").replace("{title}",e.title)]),t.append(l1,g1)},i1=l1=>{var g1=bV(),b1=t.child(g1,!0);t.reset(g1),t.template_effect(()=>t.set_text(b1,t.get(n1).message)),t.append(l1,g1)};t.if(F,l1=>{!i()&&l()!=="scheduled"&&l()!=="sales_ended"?l1(a1):l()==="scheduled"&&t.get(n1)?.message&&l1(i1,1)})}t.reset($),t.reset(m1);var B=t.sibling(m1,4),J=t.child(B),V1=t.child(J);{var t1=l1=>{var g1=xV(),b1=t.child(g1);{let O1=t.derived(()=>f().donationAmountLabel||"Donation amount in dollars"),k1=t.derived(()=>i()||l()==="scheduled"||l()==="sales_ended"),R1=t.derived(()=>H()!==""),q1=t.derived(()=>t.get(A)?"donation-error-"+e.title?.replace(/\s+/g,"-").toLowerCase():void 0);P2(b1,{get label(){return t.get(O1)},size:"full",type:"text",inputmode:"decimal",placeholder:"0.00",get value(){return H()},oninput:D1=>e.ondonationchange?.(D1.target.value),get disabled(){return t.get(k1)},get displayErrorText(){return t.get(A)},get touched(){return t.get(R1)},get"aria-describedby"(){return t.get(q1)}})}var T1=t.sibling(b1,2);{var P1=O1=>{var k1=yV(),R1=t.child(k1,!0);t.reset(k1),t.template_effect(q1=>{t.set_attribute(k1,"id",`donation-error-${q1??""}`),t.set_text(R1,t.get(A))},[()=>e.title?.replace(/\s+/g,"-").toLowerCase()]),t.append(O1,k1)};t.if(T1,O1=>{t.get(A)&&O1(P1)})}t.reset(g1),t.append(l1,g1)},r1=l1=>{var g1=ZV(),b1=t.first_child(g1),T1=t.child(b1);t.reset(b1);var P1=t.sibling(b1,2),O1=t.child(P1),k1=t.child(O1,!0);t.reset(O1);var R1=t.sibling(O1);t.reset(P1);var q1=t.sibling(P1,2),D1=t.child(q1,!0);t.reset(q1);var E1=t.sibling(q1,2),L1=t.child(E1,!0);t.reset(E1),t.template_effect((J1,F1)=>{t.set_attribute(b1,"aria-label",`Discounted price $${t.get(E)??""}`),t.set_text(T1,`$${t.get(E)??""}`),t.set_attribute(P1,"aria-label",`Original price $${t.get(w)??""}`),t.set_text(k1,f().originalPrice||"Original price:"),t.set_text(R1,`$${t.get(w)??""}`),t.set_text(D1,J1),t.set_text(L1,F1)},[()=>(f().inclFee||"incl. ${fee} fee").replace("{fee}",t.get(V)),()=>(f().includingFee||"including ${fee} service fee").replace("{fee}",t.get(V))]),t.append(l1,g1)},Q=l1=>{var g1=wV(),b1=t.child(g1,!0);t.reset(g1),t.template_effect(()=>t.set_text(b1,f().free||"Free")),t.append(l1,g1)},j=l1=>{var g1=LV(),b1=t.first_child(g1),T1=t.child(b1);t.reset(b1);var P1=t.sibling(b1,2),O1=t.child(P1,!0);t.reset(P1);var k1=t.sibling(P1,2),R1=t.child(k1,!0);t.reset(k1),t.template_effect((q1,D1)=>{t.set_attribute(b1,"aria-label",`Price $${t.get(w)??""}`),t.set_text(T1,`$${t.get(w)??""}`),t.set_text(O1,q1),t.set_text(R1,D1)},[()=>(f().inclFee||"incl. ${fee} fee").replace("{fee}",t.get(V)),()=>(f().includingFee||"including ${fee} service fee").replace("{fee}",t.get(V))]),t.append(l1,g1)};t.if(V1,l1=>{t.get(_)?l1(t1):t.get(E)!==null?l1(r1,1):t.get(b)===0?l1(Q,2):l1(j,!1)})}t.reset(J);var M1=t.sibling(J,2);{var y1=l1=>{var g1=EV(),b1=t.child(g1);{var T1=k1=>{var R1=TV(),q1=t.child(R1,!0);t.reset(R1),t.template_effect(()=>t.set_text(q1,f().discountApplied||"Discount applied")),t.append(k1,R1)};t.if(b1,k1=>{g()&&k1(T1)})}var P1=t.sibling(b1,2);{var O1=k1=>{var R1=CV(),q1=t.child(R1,!0);t.reset(R1),t.template_effect(()=>t.set_text(q1,f().unlocked||"Unlocked")),t.append(k1,R1)};t.if(P1,k1=>{m()&&k1(O1)})}t.reset(g1),t.append(l1,g1)};t.if(M1,l1=>{(g()||m())&&l1(y1)})}var e1=t.sibling(M1,2);{var _1=l1=>{var g1=kV(),b1=t.child(g1,!0);t.reset(g1),t.template_effect(T1=>{t.set_attribute(g1,"id",`ticket-desc-${T1??""}`),t.set_text(b1,e.description)},[()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket"]),t.append(l1,g1)};t.if(e1,l1=>{e.description&&l1(_1)})}var h1=t.sibling(e1,2),s1=t.child(h1);{var K=l1=>{var g1=SV(),b1=t.child(g1,!0);t.reset(g1),t.template_effect(()=>{t.set_class(g1,1,`badge ${t.get(n1).badgeClass??""}`,"svelte-12zmutv"),t.set_attribute(g1,"aria-label",`${(f().statusLabel||"Status:")??""} ${t.get(n1).badge??""}`),t.set_text(b1,t.get(n1).badge)}),t.append(l1,g1)};t.if(s1,l1=>{t.get(n1)&&t.get(n1).badge&&l1(K)})}var Z1=t.sibling(s1,2);{var H1=l1=>{{let g1=t.derived(()=>c()??0);ScarcityBadge(l1,{get remaining(){return t.get(g1)},get total(){return t.get(L)},context:"ticket",get labels(){return f()}})}};t.if(Z1,l1=>{showScarcityBadge&&l1(H1)})}t.reset(h1);var X=t.sibling(h1,2);{var p1=l1=>{const g1=t.derived(()=>G(n()));var b1=IV(),T1=t.child(b1);t.reset(b1),t.template_effect(()=>t.set_text(T1,`${(f().salesEndPrefix||"Sales end")??""}
|
|
73
|
-
${t.get(g1).text??""}`)),t.append(l1,b1)};t.if(X,l1=>{n()&&l()!=="sales_ended"&&l()!=="scheduled"&&l1(p1)})}t.reset(B),t.reset(W),t.template_effect((l1,g1,b1)=>{v1=t.set_class(W,1,`ticket-block rounded-lg border transition-all ${s()>0?"shadow-sm":""}`,"svelte-12zmutv",v1,{selected:s()>0,"disabled-ticket":i()||l()==="scheduled"||l()==="sales_ended"}),t.set_attribute(W,"aria-label",`${l1??""}${(i()?f().ticketSoldOutSuffix||", sold out":"")??""}${(l()==="scheduled"?f().ticketSalesNotStartedSuffix||", sales not yet started":"")??""}${(l()==="sales_ended"?f().ticketSalesEndedSuffix||", sales ended":"")??""}`),t.set_attribute(N,"id",`ticket-title-${g1??""}`),t.set_text(O,e.title),t.set_attribute(J,"id",`ticket-price-${b1??""}`)},[()=>(f().ticketAriaLabel||"{title} ticket").replace("{title}",e.title),()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket",()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket"]),t.append(a,W),t.pop()}var RV=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 OV(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=RV();t.template_effect(()=>t.set_attribute(s,"aria-label",r().loadingTicketInfo||"Loading ticket information")),t.append(a,s),t.pop()}var NV=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>'),FV=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>'),BV=t.from_html("<section></section>");function UV(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(M){const w=new Date,V=M.salesBegin||M.salesStart||M.saleBegin||M.saleStart||M.onSaleStart,Z=M.salesEnd||M.saleEnd||M.onSaleEnd;return V&&new Date(V)>w?"scheduled":Z&&new Date(Z)<w?"sales_ended":"on_sale"}function d(M){return M.salesBegin||M.salesStart||M.saleBegin||M.saleStart||M.onSaleStart||null}const m=t.derived(()=>s().filter(M=>M.visibility===0||M.visibility===1||o()?!0:n()?.includes(M.ID)));function g(M){const w=[],V=[];for(const Z of M){const k=h(Z),E=Z.minQuantity??1,L=Z.remainingCapacity,x=Z.soldOut||L!=null&&E>L;k==="on_sale"&&!x?w.push(Z):V.push(Z)}return[...w,...V]}function p(M){const w={};for(const V of M){const Z=V.TicketSection?.name||v().other||"Other";w[Z]||(w[Z]=[]),w[Z].push(V)}for(const V of Object.keys(w))w[V]=g(w[V]);return w}const H=t.derived(()=>p(t.get(m))),f=t.derived(()=>v().other||"Other"),_=t.derived(()=>Object.keys(t.get(H)).filter(M=>M!==t.get(f)).length>0);var u=t.comment(),A=t.first_child(u);{var y=M=>{var w=NV(),V=t.sibling(t.child(w),2),Z=t.child(V,!0);t.reset(V);var k=t.sibling(V,2),E=t.child(k,!0);t.reset(k),t.reset(w),t.template_effect(()=>{t.set_attribute(w,"aria-label",v().noTicketsAvailable||"No tickets available"),t.set_text(Z,v().noTicketsAvailable||"No tickets available"),t.set_text(E,v().noTicketsAvailableDescription||"There are currently no tickets available for this event.")}),t.append(M,w)},b=M=>{var w=BV();t.each(w,21,()=>Object.entries(t.get(H)),t.index,(V,Z)=>{var k=t.derived(()=>t.to_array(t.get(Z),2));let E=()=>t.get(k)[0],L=()=>t.get(k)[1];var x=qV(),z=t.child(x);{var I=D=>{var R=FV(),q=t.child(R),U=t.child(q,!0);t.reset(q),t.reset(R),t.template_effect(G=>{t.set_attribute(q,"id",`section-${G??""}`),t.set_text(U,E())},[()=>E().replace(/\s+/g,"-").toLowerCase()]),t.append(D,R)};t.if(z,D=>{t.get(_)&&E()!==t.get(f)&&D(I)})}var C=t.sibling(z,2),T=t.child(C);{var S=D=>{var R=t.comment(),q=t.first_child(R);t.each(q,17,L,t.index,(U,G)=>{const n1=t.derived(()=>t.get(G).visibility>=2&&o()||n().includes(t.get(G).ID)),W=t.derived(()=>c()?.discountTicketIds||[]),v1=t.derived(()=>t.get(W).length===0||t.get(W).includes(t.get(G).ID)),m1=t.derived(()=>c()?.provideDiscount&&t.get(v1)&&(c()?.discountType==="%"||c()?.discountType==="$")),$=t.derived(()=>(()=>{if(!t.get(m1))return null;const B=parseFloat(t.get(G).price)||0,J=parseFloat(c()?.amount||"0")||0;return c().discountType==="%"?(B*(1-J/100)).toFixed(2):c().discountType==="$"?Math.max(0,B-J).toFixed(2):null})()),d1=t.derived(()=>h(t.get(G))),N=t.derived(()=>d(t.get(G))),O=t.derived(()=>t.get(G).minQuantity??1),F=t.derived(()=>t.get(G).remainingCapacity),a1=t.derived(()=>t.get(G).soldOut||t.get(F)!==null&&t.get(F)!==void 0&&t.get(O)>t.get(F)),i1=t.derived(()=>t.get(G).type??0);t.derived(()=>t.get(i1)===2);{let B=t.derived(()=>i()[t.get(G).ID]??0),J=t.derived(()=>t.get(G).totalCapacity??t.get(G).quantity??t.get(G).remainingCapacity),V1=t.derived(()=>t.get(G).minQuantity??1),t1=t.derived(()=>t.get(G).maxQuantity??null),r1=t.derived(()=>l()[t.get(G).ID]??"");PV(U,{get labels(){return v()},get title(){return t.get(G).name},get description(){return t.get(G).description},get price(){return t.get(G).price},get discountedPrice(){return t.get($)},get quantity(){return t.get(B)},get soldOut(){return t.get(a1)},get status(){return t.get(d1)},get salesBegin(){return t.get(N)},get salesEnd(){return t.get(G).salesEnd},get remainingCapacity(){return t.get(G).remainingCapacity},get totalCapacity(){return t.get(J)},get minQuantity(){return t.get(V1)},get maxQuantity(){return t.get(t1)},get isRevealed(){return t.get(n1)},get isDiscounted(){return t.get(m1)},get ticketType(){return t.get(i1)},get donationAmount(){return t.get(r1)},onincrement:()=>e.handleQuantityChange(t.get(G).ID,1),ondecrement:()=>e.handleQuantityChange(t.get(G).ID,-1),ondonationchange:Q=>e.handleDonationChange?.(t.get(G).ID,Q)})}}),t.append(D,R)},P=D=>{var R=t.comment(),q=t.first_child(R);t.each(q,16,()=>Array(2),t.index,(U,G)=>{OV(U,{})}),t.append(D,R)};t.if(T,D=>{r()?D(S):D(P,!1)})}t.reset(C),t.reset(x),t.template_effect((D,R)=>{t.set_class(x,1,t.clsx(t.get(_)&&E()!==t.get(f)?"ticket-section-group border border-border rounded-lg overflow-hidden":"")),t.set_attribute(x,"aria-labelledby",D),t.set_class(C,1,`space-y-4 ${t.get(_)&&E()!==t.get(f)?"p-4":""}`),t.set_attribute(C,"aria-label",R)},[()=>t.get(_)&&E()!==t.get(f)?`section-${E().replace(/\s+/g,"-").toLowerCase()}`:void 0,()=>(v().ticketsInSection||"Tickets in {section}").replace("{section}",E())]),t.append(V,x)}),t.reset(w),t.template_effect(()=>t.set_attribute(w,"aria-label",v().availableTickets||"Available tickets")),t.append(M,w)};t.if(A,M=>{r()&&t.get(m).length===0?M(y):M(b,!1)})}t.append(a,u),t.pop()}var GV=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>'),jV=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 Q6(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=jV(),i=t.sibling(t.child(s),4);t.each(i,16,()=>Array(2),t.index,(l,o)=>{var n=GV();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 YV=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>'),WV=t.from_html("<p> </p>"),XV=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>'),QV=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 KV(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=QV(),g=t.child(m),p=t.child(g);O3(p,{size:20,"aria-hidden":"true"}),t.reset(g);var H=t.sibling(g,2);{var f=z=>{var I=YV(),C=t.child(I);t.reset(I),t.template_effect(()=>t.set_attribute(C,"src",e.event.image)),t.append(z,I)};t.if(H,z=>{e.event.image&&z(f)})}var _=t.sibling(H,2),u=t.child(_),A=t.child(u,!0);t.reset(u);var y=t.sibling(u,2),b=t.child(y),M=t.child(b),w=t.child(M,!0);t.reset(M),t.reset(b);var V=t.sibling(b,2),Z=t.child(V,!0);t.reset(V);var k=t.sibling(V,2);{var E=z=>{var I=WV(),C=t.child(I,!0);t.reset(I),t.template_effect(T=>t.set_text(C,T),[()=>(o().doorsOpen||"Doors open {time}").replace("{time}",Va(e.event.doorsOpenTime,t.get(n)))]),t.append(z,I)};t.if(k,z=>{t.get(v)&&e.event.doorsOpenTime&&z(E)})}t.reset(y),t.reset(_);var L=t.sibling(_,2);{var x=z=>{var I=XV(),C=t.child(I),T=t.child(C,!0);t.reset(C);var S=t.sibling(C,2),P=t.child(S);pf(P,{size:18,"aria-hidden":"true"}),t.reset(S),t.reset(I),t.template_effect(D=>{t.set_attribute(C,"aria-label",D),t.set_text(T,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,I)};t.if(L,z=>{t.get(h)&&z(x)})}t.reset(m),t.template_effect((z,I)=>{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(y,"aria-label",o().ariaEventDateTime||"Event date and time"),t.set_attribute(M,"datetime",e.event.startDateTime),t.set_text(w,z),t.set_text(Z,I)},[()=>m0(e.event.startDateTime,t.get(n)),()=>t.get(c)&&e.event.endDateTime?Ma(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 JV=t.from_html('<div class="flex items-center justify-center py-12" role="status" aria-live="polite"><p class="text-text-secondary"> </p></div>'),$V=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>'),tA=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>'),eA=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>'),aA=t.from_html('<div class="hidden md:block w-80 h-[calc(100vh-40px)]"></div>'),rA=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>'),sA=t.from_html('<h3 id="error-modal-title" class="heading-lg"><!></h3>'),iA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),lA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),oA=t.from_html('<div id="error-modal-description"><!></div>'),nA=t.from_html("<!> <!>",1),cA=t.from_html('<div role="group" aria-label="Error modal actions"><!></div>'),vA=t.from_html('<h3 id="availability-modal-title" class="heading-lg"> </h3>'),dA=t.from_html('<li class="text-text-secondary text-sm"><span class="font-medium"> </span> <!></li>'),hA=t.from_html('<p class="text-text-secondary mt-4"> </p>'),gA=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>'),pA=t.from_html('<div role="group" aria-label="Availability modal actions"><!> <!></div>'),fA=t.from_html('<div class="px-5 md:px-10 py-12 bg-card"><!></div> <!> <!>',1);function oa(a,e){t.push(e,!0);let r=t.prop(e,"organizationId",3,""),s=t.prop(e,"venueId",3,""),i=t.prop(e,"labels",19,()=>({})),l=t.state(!1),o=t.state(null),n=t.state(null),c=t.state(t.proxy([])),v=t.state(!1),h=t.state(!0),d=t.state(null),m=t.state(!1),g=t.state(!1),p=t.state(!1),H=t.state(0),f=t.state(void 0),_=t.state(void 0),u=t.state(t.proxy({})),A=t.state(""),y=t.state(""),b=t.state(0),M=t.state(!1),w=t.state("cart_failed"),V=t.state(!1),Z=t.state(!1),k=t.state(t.proxy([])),E=t.state(0),L=t.state(0),x=t.derived(()=>t.get(V1)?0:a0(Object.entries(t.get(u)).reduce((X,[p1,l1])=>{const g1=t.get(o)?.availableTickets?.find(b1=>b1.ID==p1);return g1?X+a0(l1*g1.price):X},0))),z=t.state(0),I=0,C=t.state(0),T=t.state(!1),S=t.state(null),P=t.derived(()=>a0(t.get(x)+t.get(z)+I));function D(X,p1){t.set(u,{...t.get(u),[X]:Math.max(0,(t.get(u)[X]??0)+p1)},!0),t.get(o)&&D3({eventID:t.get(o).eventID,quantities:t.get(u),promocode:t.get(A),tickets:t.get(o).availableTickets})}function R(){if(!t.get(o)?.availableTickets)return;const p1=t.get(o).availableTickets.filter(l1=>l1.visibility===0).map(l1=>parseFloat(l1.price)||0);if(p1.length===0){t.set(E,t.set(L,0),!0);return}t.set(E,Math.min(...p1).toFixed(2),!0),t.set(L,Math.max(...p1).toFixed(2),!0)}async function q(){const X=[];for(const[p1,l1]of Object.entries(t.get(u))){if(l1<=0)continue;const g1=t.get(o)?.availableTickets?.find(b1=>b1.ID==p1);!g1||g1.price===0||X.push({amountCents:Math.round(g1.price*100)*l1,reference:`ticket-${p1}`,quantity:l1})}if(X.length===0){t.set(C,0),t.set(T,!1);return}t.get(S)&&t.get(S).abort(),t.set(S,new AbortController,!0),t.set(T,!0);try{const p1=await fetch("https://get-micdrop.com/api/v2/public/tax-preview",{method:"POST",headers:{"Content-Type":"application/json"},signal:t.get(S).signal,body:JSON.stringify({venueId:Number(t.get(o).venueID),lineItems:X})});if(!p1.ok){console.error("Tax preview failed:",p1.status),t.set(C,0),t.set(T,!1);return}const l1=await p1.json();t.set(C,(l1.taxTotal??0)/100)}catch(p1){if(p1.name==="AbortError")return;console.error("Tax preview error:",p1),t.set(C,0)}finally{t.get(S)?.signal?.aborted||t.set(T,!1)}}function U(){if(!t.get(o))return;t.set(A,k0(`checkout-promocode-${t.get(o).eventID}`)||"",!0);const X=parseFloat(k0("checkout-promo-discount")||0);t.set(y,t.get(A)?`${t.get(A)} applied.`:"",!0),t.set(b,X,!0)}async function G(){try{const X=await Z6(e.eventId),p1=[];for(const[l1,g1]of Object.entries(t.get(u))){if(g1<=0)continue;const b1=X.find(P1=>String(P1.ID)===String(l1));if(!b1)continue;const T1=b1.remainingCapacity??b1.quantity??1/0;if(T1<g1){const P1=t.get(o)?.availableTickets?.find(O1=>String(O1.ID)===String(l1));p1.push({ticketId:l1,ticketName:P1?.name||b1?.name||"Ticket",requestedQty:g1,availableQty:Math.max(0,T1)})}}return p1}catch(X){return console.error("Error checking ticket availability:",X),[]}}async function n1(){if(!t.get(o))return;t.set(v,!0),t.set(V,!1);const X=await G();if(X.length>0){t.set(v,!1),t.set(k,X,!0),t.set(Z,!0);return}await W()}async function W(){t.set(v,!0),D3({eventID:t.get(o).eventID,quantities:t.get(u),promocode:t.get(A),promoDiscountAmount:t.get(b),tickets:t.get(o).availableTickets});try{const X=await zp({eventID:t.get(o).eventID,quantities:t.get(u),promoCode:t.get(A)||void 0});if(!X||!X.success){t.set(v,!1),t.set(w,"cart_failed"),t.set(M,!0);return}t.set(z,X.serviceFee??0,!0),t.set(V,!0)}catch(X){console.error("Order initiation failed:",X),t.set(v,!1),t.set(w,"cart_failed"),t.set(M,!0);return}try{if(e.onNavigateToCheckout){e.onNavigateToCheckout(e.eventId,t.get(o)),t.set(v,!1);return}const X=new URLSearchParams;r()&&X.set("orgId",r()),s()&&X.set("venueId",s()),X.set("event_id",e.eventId),X.set("subroute","checkout");const p1=`/?${X.toString()}`;mt(p1,{noScroll:!1}),t.set(v,!1)}catch(X){console.error("Navigation failed after cart creation:",X),t.set(v,!1),t.set(w,"cart_success_network_error"),t.set(M,!0)}}function v1(){for(const p1 of t.get(k))p1.availableQty>0?t.get(u)[p1.ticketId]=p1.availableQty:delete t.get(u)[p1.ticketId];t.set(u,{...t.get(u)},!0),t.set(Z,!1),t.set(k,[],!0),Object.values(t.get(u)).reduce((p1,l1)=>p1+l1,0)>0?W():i1()}function m1(){t.set(Z,!1),t.set(k,[],!0),i1()}function $(){t.set(M,!1),t.get(w)==="cart_failed"&&i1()}function d1(){t.set(M,!1),window.location.reload()}function N(){t.set(g,window.innerWidth<767)}let O=!1;function F(){O||(window.requestAnimationFrame(()=>{a1(),O=!1}),O=!0)}function a1(){if(t.get(g)||!t.get(_)||!t.get(f)){t.set(p,!1);return}const X=t.get(_).getBoundingClientRect();if(t.set(p,X.top<=20),t.get(p)){const p1=t.get(f).getBoundingClientRect();t.set(H,p1.left+p1.width-340-40)}}function i1(){if(t.get(o)&&I3(t.get(o).eventID),e.onNavigateBack)e.onNavigateBack();else{const X=new URLSearchParams(window.location.search);X.set("subroute","details");const p1=`/?${X.toString()}`;mt(p1,{})}}let B=t.derived(()=>t.get(o)?k0(`checkout-promo-reveal-${t.get(o).eventID}`)==="1":!1),J=t.derived(()=>{if(!t.get(o))return[];try{const X=k0(`checkout-promo-reveal-ids-${t.get(o).eventID}`);return X?JSON.parse(X):[]}catch{return[]}}),V1=t.derived(()=>t.get(o)?.availableTickets?.filter(X=>X.visibility===0)?.every(X=>X.price===0)),t1=t.derived(()=>{if(!t.get(o))return!1;const X=t.get(o).endDateTime||t.get(o).startDateTime;return X?new Date(X)<new Date:!1});function r1(X){if(X){const p1=new Date,l1=new Date(p1);return l1.setDate(p1.getDate()+7),{id:String(X),ID:String(X),eventID:String(X),title:"Test Comedy Show",name:"Test Comedy Show",description:"This is a test event for development and testing purposes.",coverImage:"https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=1200&h=800&fit=crop",startDateTime:l1.toISOString(),endDateTime:new Date(l1.getTime()+7200*1e3).toISOString(),venueID:"test-venue-1",eventTicketingType:0,ticketType:0,availableTickets:[{ID:"ticket-1",name:"General Admission",price:25,remainingCapacity:50,visibility:0},{ID:"ticket-2",name:"VIP",price:50,remainingCapacity:10,visibility:0}]}}return null}async function Q(){if(t.get(m)){if(!e.eventId){t.set(d,i().noEventIdProvided||"No event ID provided",!0),t.set(h,!1);return}t.set(h,!0),t.set(d,null);try{try{if(t.set(n,await x6(e.eventId),!0),!t.get(m))return;t.set(o,Dt(t.get(n)),!0)}catch{if(!t.get(m))return;t.set(n,r1(e.eventId),!0),t.set(o,Dt(t.get(n)),!0),t.set(c,t.get(o).availableTickets||[],!0)}try{if(t.set(c,await Z6(e.eventId),!0),!t.get(m))return;t.get(c).length>0&&(t.get(o).availableTickets=t.get(c))}catch(p1){if(!t.get(m))return;console.error("Error fetching tickets:",p1),t.set(c,t.get(o).availableTickets||[],!0)}t.get(o).availableTickets&&t.get(o).availableTickets.forEach(p1=>t.get(u)[p1.ID]=0);const X=S3(t.get(o).eventID);if(t.set(u,X.quantities||{},!0),t.set(A,X.promocode||"",!0),t.set(b,X.promoDiscountAmount||0,!0),t.get(o).eventID&&(await xp(t.get(o).eventID),!t.get(m)))return;t.set(l,!0),R(),U(),await Vp({eventID:t.get(o).eventID})}catch(X){t.get(m)&&(console.error("Error loading event:",X),t.set(d,X.message||i().failedToLoadEvent||"Failed to load event",!0))}finally{t.get(m)&&t.set(h,!1)}}}G1.onMount(async()=>(t.set(m,!0),N(),window.addEventListener("resize",N),window.addEventListener("scroll",F),await Q(),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",F)})),G1.onDestroy(()=>{t.set(m,!1),t.get(S)&&t.get(S).abort()}),t.user_effect(()=>{t.get(m)&&e.eventId&&Q()}),t.user_effect(()=>{const X=Object.values(t.get(u)).reduce((p1,l1)=>p1+l1,0);t.get(l)&&t.get(o)&&X>0?q():X===0&&(t.set(C,0),t.set(T,!1))});var j=fA(),M1=t.first_child(j),y1=t.child(M1);{var e1=X=>{var p1=JV(),l1=t.child(p1),g1=t.child(l1,!0);t.reset(l1),t.reset(p1),t.template_effect(()=>t.set_text(g1,i().loadingEvent||"Loading event...")),t.append(X,p1)},_1=X=>{var p1=$V(),l1=t.child(p1),g1=t.child(l1);t.reset(l1);var b1=t.sibling(l1,2),T1=t.child(b1,!0);t.reset(b1),t.reset(p1),t.template_effect(()=>{t.set_text(g1,`${(i().errorPrefix||"Error:")??""}
|
|
73
|
+
${t.get(g1).text??""}`)),t.append(l1,b1)};t.if(X,l1=>{n()&&l()!=="sales_ended"&&l()!=="scheduled"&&l1(p1)})}t.reset(B),t.reset(W),t.template_effect((l1,g1,b1)=>{v1=t.set_class(W,1,`ticket-block rounded-lg border transition-all ${s()>0?"shadow-sm":""}`,"svelte-12zmutv",v1,{selected:s()>0,"disabled-ticket":i()||l()==="scheduled"||l()==="sales_ended"}),t.set_attribute(W,"aria-label",`${l1??""}${(i()?f().ticketSoldOutSuffix||", sold out":"")??""}${(l()==="scheduled"?f().ticketSalesNotStartedSuffix||", sales not yet started":"")??""}${(l()==="sales_ended"?f().ticketSalesEndedSuffix||", sales ended":"")??""}`),t.set_attribute(N,"id",`ticket-title-${g1??""}`),t.set_text(O,e.title),t.set_attribute(J,"id",`ticket-price-${b1??""}`)},[()=>(f().ticketAriaLabel||"{title} ticket").replace("{title}",e.title),()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket",()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket"]),t.append(a,W),t.pop()}var RV=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 OV(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=RV();t.template_effect(()=>t.set_attribute(s,"aria-label",r().loadingTicketInfo||"Loading ticket information")),t.append(a,s),t.pop()}var NV=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>'),FV=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>'),BV=t.from_html("<section></section>");function UV(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(M){const w=new Date,V=M.salesBegin||M.salesStart||M.saleBegin||M.saleStart||M.onSaleStart,Z=M.salesEnd||M.saleEnd||M.onSaleEnd;return V&&new Date(V)>w?"scheduled":Z&&new Date(Z)<w?"sales_ended":"on_sale"}function d(M){return M.salesBegin||M.salesStart||M.saleBegin||M.saleStart||M.onSaleStart||null}const m=t.derived(()=>s().filter(M=>M.visibility===0||M.visibility===1||o()?!0:n()?.includes(M.ID)));function g(M){const w=[],V=[];for(const Z of M){const k=h(Z),E=Z.minQuantity??1,L=Z.remainingCapacity,x=Z.soldOut||L!=null&&E>L;k==="on_sale"&&!x?w.push(Z):V.push(Z)}return[...w,...V]}function p(M){const w={};for(const V of M){const Z=V.TicketSection?.name||v().other||"Other";w[Z]||(w[Z]=[]),w[Z].push(V)}for(const V of Object.keys(w))w[V]=g(w[V]);return w}const H=t.derived(()=>p(t.get(m))),f=t.derived(()=>v().other||"Other"),_=t.derived(()=>Object.keys(t.get(H)).filter(M=>M!==t.get(f)).length>0);var u=t.comment(),A=t.first_child(u);{var y=M=>{var w=NV(),V=t.sibling(t.child(w),2),Z=t.child(V,!0);t.reset(V);var k=t.sibling(V,2),E=t.child(k,!0);t.reset(k),t.reset(w),t.template_effect(()=>{t.set_attribute(w,"aria-label",v().noTicketsAvailable||"No tickets available"),t.set_text(Z,v().noTicketsAvailable||"No tickets available"),t.set_text(E,v().noTicketsAvailableDescription||"There are currently no tickets available for this event.")}),t.append(M,w)},b=M=>{var w=BV();t.each(w,21,()=>Object.entries(t.get(H)),t.index,(V,Z)=>{var k=t.derived(()=>t.to_array(t.get(Z),2));let E=()=>t.get(k)[0],L=()=>t.get(k)[1];var x=qV(),z=t.child(x);{var I=D=>{var R=FV(),q=t.child(R),U=t.child(q,!0);t.reset(q),t.reset(R),t.template_effect(G=>{t.set_attribute(q,"id",`section-${G??""}`),t.set_text(U,E())},[()=>E().replace(/\s+/g,"-").toLowerCase()]),t.append(D,R)};t.if(z,D=>{t.get(_)&&E()!==t.get(f)&&D(I)})}var C=t.sibling(z,2),T=t.child(C);{var S=D=>{var R=t.comment(),q=t.first_child(R);t.each(q,17,L,t.index,(U,G)=>{const n1=t.derived(()=>t.get(G).visibility>=2&&o()||n().includes(t.get(G).ID)),W=t.derived(()=>c()?.discountTicketIds||[]),v1=t.derived(()=>t.get(W).length===0||t.get(W).includes(t.get(G).ID)),m1=t.derived(()=>c()?.provideDiscount&&t.get(v1)&&(c()?.discountType==="%"||c()?.discountType==="$")),$=t.derived(()=>(()=>{if(!t.get(m1))return null;const B=parseFloat(t.get(G).price)||0,J=parseFloat(c()?.amount||"0")||0;return c().discountType==="%"?(B*(1-J/100)).toFixed(2):c().discountType==="$"?Math.max(0,B-J).toFixed(2):null})()),d1=t.derived(()=>h(t.get(G))),N=t.derived(()=>d(t.get(G))),O=t.derived(()=>t.get(G).minQuantity??1),F=t.derived(()=>t.get(G).remainingCapacity),a1=t.derived(()=>t.get(G).soldOut||t.get(F)!==null&&t.get(F)!==void 0&&t.get(O)>t.get(F)),i1=t.derived(()=>t.get(G).type??0);t.derived(()=>t.get(i1)===2);{let B=t.derived(()=>i()[t.get(G).ID]??0),J=t.derived(()=>t.get(G).totalCapacity??t.get(G).quantity??t.get(G).remainingCapacity),V1=t.derived(()=>t.get(G).minQuantity??1),t1=t.derived(()=>t.get(G).maxQuantity??null),r1=t.derived(()=>l()[t.get(G).ID]??"");PV(U,{get labels(){return v()},get title(){return t.get(G).name},get description(){return t.get(G).description},get price(){return t.get(G).price},get discountedPrice(){return t.get($)},get quantity(){return t.get(B)},get soldOut(){return t.get(a1)},get status(){return t.get(d1)},get salesBegin(){return t.get(N)},get salesEnd(){return t.get(G).salesEnd},get remainingCapacity(){return t.get(G).remainingCapacity},get totalCapacity(){return t.get(J)},get minQuantity(){return t.get(V1)},get maxQuantity(){return t.get(t1)},get isRevealed(){return t.get(n1)},get isDiscounted(){return t.get(m1)},get ticketType(){return t.get(i1)},get donationAmount(){return t.get(r1)},onincrement:()=>e.handleQuantityChange(t.get(G).ID,1),ondecrement:()=>e.handleQuantityChange(t.get(G).ID,-1),ondonationchange:Q=>e.handleDonationChange?.(t.get(G).ID,Q)})}}),t.append(D,R)},P=D=>{var R=t.comment(),q=t.first_child(R);t.each(q,16,()=>Array(2),t.index,(U,G)=>{OV(U,{})}),t.append(D,R)};t.if(T,D=>{r()?D(S):D(P,!1)})}t.reset(C),t.reset(x),t.template_effect((D,R)=>{t.set_class(x,1,t.clsx(t.get(_)&&E()!==t.get(f)?"ticket-section-group border border-border rounded-lg overflow-hidden":"")),t.set_attribute(x,"aria-labelledby",D),t.set_class(C,1,`space-y-4 ${t.get(_)&&E()!==t.get(f)?"p-4":""}`),t.set_attribute(C,"aria-label",R)},[()=>t.get(_)&&E()!==t.get(f)?`section-${E().replace(/\s+/g,"-").toLowerCase()}`:void 0,()=>(v().ticketsInSection||"Tickets in {section}").replace("{section}",E())]),t.append(V,x)}),t.reset(w),t.template_effect(()=>t.set_attribute(w,"aria-label",v().availableTickets||"Available tickets")),t.append(M,w)};t.if(A,M=>{r()&&t.get(m).length===0?M(y):M(b,!1)})}t.append(a,u),t.pop()}var GV=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>'),jV=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 Q6(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=jV(),i=t.sibling(t.child(s),4);t.each(i,16,()=>Array(2),t.index,(l,o)=>{var n=GV();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 YV=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>'),WV=t.from_html("<p> </p>"),XV=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>'),QV=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 KV(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=QV(),g=t.child(m),p=t.child(g);O3(p,{size:20,"aria-hidden":"true"}),t.reset(g);var H=t.sibling(g,2);{var f=z=>{var I=YV(),C=t.child(I);t.reset(I),t.template_effect(()=>t.set_attribute(C,"src",e.event.image)),t.append(z,I)};t.if(H,z=>{e.event.image&&z(f)})}var _=t.sibling(H,2),u=t.child(_),A=t.child(u,!0);t.reset(u);var y=t.sibling(u,2),b=t.child(y),M=t.child(b),w=t.child(M,!0);t.reset(M),t.reset(b);var V=t.sibling(b,2),Z=t.child(V,!0);t.reset(V);var k=t.sibling(V,2);{var E=z=>{var I=WV(),C=t.child(I,!0);t.reset(I),t.template_effect(T=>t.set_text(C,T),[()=>(o().doorsOpen||"Doors open {time}").replace("{time}",Va(e.event.doorsOpenTime,t.get(n)))]),t.append(z,I)};t.if(k,z=>{t.get(v)&&e.event.doorsOpenTime&&z(E)})}t.reset(y),t.reset(_);var L=t.sibling(_,2);{var x=z=>{var I=XV(),C=t.child(I),T=t.child(C,!0);t.reset(C);var S=t.sibling(C,2),P=t.child(S);pf(P,{size:18,"aria-hidden":"true"}),t.reset(S),t.reset(I),t.template_effect(D=>{t.set_attribute(C,"aria-label",D),t.set_text(T,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,I)};t.if(L,z=>{t.get(h)&&z(x)})}t.reset(m),t.template_effect((z,I)=>{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(y,"aria-label",o().ariaEventDateTime||"Event date and time"),t.set_attribute(M,"datetime",e.event.startDateTime),t.set_text(w,z),t.set_text(Z,I)},[()=>m0(e.event.startDateTime,t.get(n)),()=>t.get(c)&&e.event.endDateTime?Ma(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 JV=t.from_html('<div class="flex items-center justify-center py-12" role="status" aria-live="polite"><p class="text-text-secondary"> </p></div>'),$V=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>'),tA=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>'),eA=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>'),aA=t.from_html('<div class="hidden md:block w-80 h-[calc(100vh-40px)]"></div>'),rA=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>'),sA=t.from_html('<h3 id="error-modal-title" class="heading-lg"><!></h3>'),iA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),lA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),oA=t.from_html('<div id="error-modal-description"><!></div>'),nA=t.from_html("<!> <!>",1),cA=t.from_html('<div role="group" aria-label="Error modal actions"><!></div>'),vA=t.from_html('<h3 id="availability-modal-title" class="heading-lg"> </h3>'),dA=t.from_html('<li class="text-text-secondary text-sm"><span class="font-medium"> </span> <!></li>'),hA=t.from_html('<p class="text-text-secondary mt-4"> </p>'),gA=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>'),pA=t.from_html('<div role="group" aria-label="Availability modal actions"><!> <!></div>'),fA=t.from_html('<div class="px-5 md:px-10 py-12 bg-card"><!></div> <!> <!>',1);function oa(a,e){t.push(e,!0);let r=t.prop(e,"organizationId",3,""),s=t.prop(e,"venueId",3,""),i=t.prop(e,"labels",19,()=>({})),l=t.state(!1),o=t.state(null),n=t.state(null),c=t.state(t.proxy([])),v=t.state(!1),h=t.state(!0),d=t.state(null),m=t.state(!1),g=t.state(!1),p=t.state(!1),H=t.state(0),f=t.state(void 0),_=t.state(void 0),u=t.state(t.proxy({})),A=t.state(""),y=t.state(""),b=t.state(0),M=t.state(!1),w=t.state("cart_failed"),V=t.state(!1),Z=t.state(!1),k=t.state(t.proxy([])),E=t.state(0),L=t.state(0),x=t.derived(()=>t.get(V1)?0:a0(Object.entries(t.get(u)).reduce((X,[p1,l1])=>{const g1=t.get(o)?.availableTickets?.find(b1=>b1.ID==p1);return g1?X+a0(l1*g1.price):X},0))),z=t.state(0),I=0,C=t.state(0),T=t.state(!1),S=null,P=t.derived(()=>a0(t.get(x)+t.get(z)+I));function D(X,p1){t.set(u,{...t.get(u),[X]:Math.max(0,(t.get(u)[X]??0)+p1)},!0),t.get(o)&&D3({eventID:t.get(o).eventID,quantities:t.get(u),promocode:t.get(A),tickets:t.get(o).availableTickets})}function R(){if(!t.get(o)?.availableTickets)return;const p1=t.get(o).availableTickets.filter(l1=>l1.visibility===0).map(l1=>parseFloat(l1.price)||0);if(p1.length===0){t.set(E,t.set(L,0),!0);return}t.set(E,Math.min(...p1).toFixed(2),!0),t.set(L,Math.max(...p1).toFixed(2),!0)}async function q(){const X=[];for(const[p1,l1]of Object.entries(t.get(u))){if(l1<=0)continue;const g1=t.get(o)?.availableTickets?.find(b1=>b1.ID==p1);!g1||g1.price===0||X.push({amountCents:Math.round(g1.price*100)*l1,reference:`ticket-${p1}`,quantity:l1})}if(X.length===0){t.set(C,0),t.set(T,!1);return}S&&S.abort(),S=new AbortController,t.set(T,!0);try{const p1=await fetch("https://get-micdrop.com/api/v2/public/tax-preview",{method:"POST",headers:{"Content-Type":"application/json"},signal:S.signal,body:JSON.stringify({venueId:Number(t.get(o).venueID),lineItems:X})});if(!p1.ok){console.error("Tax preview failed:",p1.status),t.set(C,0),t.set(T,!1);return}const l1=await p1.json();t.set(C,(l1.taxTotal??0)/100)}catch(p1){if(p1.name==="AbortError")return;console.error("Tax preview error:",p1),t.set(C,0)}finally{S?.signal?.aborted||t.set(T,!1)}}function U(){if(!t.get(o))return;t.set(A,k0(`checkout-promocode-${t.get(o).eventID}`)||"",!0);const X=parseFloat(k0("checkout-promo-discount")||0);t.set(y,t.get(A)?`${t.get(A)} applied.`:"",!0),t.set(b,X,!0)}async function G(){try{const X=await Z6(e.eventId),p1=[];for(const[l1,g1]of Object.entries(t.get(u))){if(g1<=0)continue;const b1=X.find(P1=>String(P1.ID)===String(l1));if(!b1)continue;const T1=b1.remainingCapacity??b1.quantity??1/0;if(T1<g1){const P1=t.get(o)?.availableTickets?.find(O1=>String(O1.ID)===String(l1));p1.push({ticketId:l1,ticketName:P1?.name||b1?.name||"Ticket",requestedQty:g1,availableQty:Math.max(0,T1)})}}return p1}catch(X){return console.error("Error checking ticket availability:",X),[]}}async function n1(){if(!t.get(o))return;t.set(v,!0),t.set(V,!1);const X=await G();if(X.length>0){t.set(v,!1),t.set(k,X,!0),t.set(Z,!0);return}await W()}async function W(){t.set(v,!0),D3({eventID:t.get(o).eventID,quantities:t.get(u),promocode:t.get(A),promoDiscountAmount:t.get(b),tickets:t.get(o).availableTickets});try{const X=await zp({eventID:t.get(o).eventID,quantities:t.get(u),promoCode:t.get(A)||void 0});if(!X||!X.success){t.set(v,!1),t.set(w,"cart_failed"),t.set(M,!0);return}t.set(z,X.serviceFee??0,!0),t.set(V,!0)}catch(X){console.error("Order initiation failed:",X),t.set(v,!1),t.set(w,"cart_failed"),t.set(M,!0);return}try{if(e.onNavigateToCheckout){e.onNavigateToCheckout(e.eventId,t.get(o)),t.set(v,!1);return}const X=new URLSearchParams;r()&&X.set("orgId",r()),s()&&X.set("venueId",s()),X.set("event_id",e.eventId),X.set("subroute","checkout");const p1=`/?${X.toString()}`;mt(p1,{noScroll:!1}),t.set(v,!1)}catch(X){console.error("Navigation failed after cart creation:",X),t.set(v,!1),t.set(w,"cart_success_network_error"),t.set(M,!0)}}function v1(){for(const p1 of t.get(k))p1.availableQty>0?t.get(u)[p1.ticketId]=p1.availableQty:delete t.get(u)[p1.ticketId];t.set(u,{...t.get(u)},!0),t.set(Z,!1),t.set(k,[],!0),Object.values(t.get(u)).reduce((p1,l1)=>p1+l1,0)>0?W():i1()}function m1(){t.set(Z,!1),t.set(k,[],!0),i1()}function $(){t.set(M,!1),t.get(w)==="cart_failed"&&i1()}function d1(){t.set(M,!1),window.location.reload()}function N(){t.set(g,window.innerWidth<767)}let O=!1;function F(){O||(window.requestAnimationFrame(()=>{a1(),O=!1}),O=!0)}function a1(){if(t.get(g)||!t.get(_)||!t.get(f)){t.set(p,!1);return}const X=t.get(_).getBoundingClientRect();if(t.set(p,X.top<=20),t.get(p)){const p1=t.get(f).getBoundingClientRect();t.set(H,p1.left+p1.width-340-40)}}function i1(){if(t.get(o)&&I3(t.get(o).eventID),e.onNavigateBack)e.onNavigateBack();else{const X=new URLSearchParams(window.location.search);X.set("subroute","details");const p1=`/?${X.toString()}`;mt(p1,{})}}let B=t.derived(()=>t.get(o)?k0(`checkout-promo-reveal-${t.get(o).eventID}`)==="1":!1),J=t.derived(()=>{if(!t.get(o))return[];try{const X=k0(`checkout-promo-reveal-ids-${t.get(o).eventID}`);return X?JSON.parse(X):[]}catch{return[]}}),V1=t.derived(()=>t.get(o)?.availableTickets?.filter(X=>X.visibility===0)?.every(X=>X.price===0)),t1=t.derived(()=>{if(!t.get(o))return!1;const X=t.get(o).endDateTime||t.get(o).startDateTime;return X?new Date(X)<new Date:!1});function r1(X){if(X){const p1=new Date,l1=new Date(p1);return l1.setDate(p1.getDate()+7),{id:String(X),ID:String(X),eventID:String(X),title:"Test Comedy Show",name:"Test Comedy Show",description:"This is a test event for development and testing purposes.",coverImage:"https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=1200&h=800&fit=crop",startDateTime:l1.toISOString(),endDateTime:new Date(l1.getTime()+7200*1e3).toISOString(),venueID:"test-venue-1",eventTicketingType:0,ticketType:0,availableTickets:[{ID:"ticket-1",name:"General Admission",price:25,remainingCapacity:50,visibility:0},{ID:"ticket-2",name:"VIP",price:50,remainingCapacity:10,visibility:0}]}}return null}async function Q(){if(t.get(m)){if(!e.eventId){t.set(d,i().noEventIdProvided||"No event ID provided",!0),t.set(h,!1);return}t.set(h,!0),t.set(d,null);try{try{if(t.set(n,await x6(e.eventId),!0),!t.get(m))return;t.set(o,Dt(t.get(n)),!0)}catch{if(!t.get(m))return;t.set(n,r1(e.eventId),!0),t.set(o,Dt(t.get(n)),!0),t.set(c,t.get(o).availableTickets||[],!0)}try{if(t.set(c,await Z6(e.eventId),!0),!t.get(m))return;t.get(c).length>0&&(t.get(o).availableTickets=t.get(c))}catch(p1){if(!t.get(m))return;console.error("Error fetching tickets:",p1),t.set(c,t.get(o).availableTickets||[],!0)}t.get(o).availableTickets&&t.get(o).availableTickets.forEach(p1=>t.get(u)[p1.ID]=0);const X=S3(t.get(o).eventID);if(t.set(u,X.quantities||{},!0),t.set(A,X.promocode||"",!0),t.set(b,X.promoDiscountAmount||0,!0),t.get(o).eventID&&(await xp(t.get(o).eventID),!t.get(m)))return;t.set(l,!0),R(),U(),await Vp({eventID:t.get(o).eventID})}catch(X){t.get(m)&&(console.error("Error loading event:",X),t.set(d,X.message||i().failedToLoadEvent||"Failed to load event",!0))}finally{t.get(m)&&t.set(h,!1)}}}G1.onMount(async()=>(t.set(m,!0),N(),window.addEventListener("resize",N),window.addEventListener("scroll",F),await Q(),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",F)})),G1.onDestroy(()=>{t.set(m,!1),S&&S.abort()}),t.user_effect(()=>{t.get(m)&&e.eventId&&Q()}),t.user_effect(()=>{const X=Object.values(t.get(u)).reduce((p1,l1)=>p1+l1,0);t.get(l)&&t.get(o)&&X>0?q():X===0&&(t.set(C,0),t.set(T,!1))});var j=fA(),M1=t.first_child(j),y1=t.child(M1);{var e1=X=>{var p1=JV(),l1=t.child(p1),g1=t.child(l1,!0);t.reset(l1),t.reset(p1),t.template_effect(()=>t.set_text(g1,i().loadingEvent||"Loading event...")),t.append(X,p1)},_1=X=>{var p1=$V(),l1=t.child(p1),g1=t.child(l1);t.reset(l1);var b1=t.sibling(l1,2),T1=t.child(b1,!0);t.reset(b1),t.reset(p1),t.template_effect(()=>{t.set_text(g1,`${(i().errorPrefix||"Error:")??""}
|
|
74
74
|
${t.get(d)??""}`),t.set_attribute(b1,"aria-label",i().goBackToEventDetails||"Go back to event details"),t.set_text(T1,i().goBack||"Go back")}),t.delegated("click",b1,i1),t.append(X,p1)},h1=X=>{var p1=tA(),l1=t.child(p1),g1=t.child(l1,!0);t.reset(l1);var b1=t.sibling(l1,2),T1=t.child(b1,!0);t.reset(b1);var P1=t.sibling(b1,2),O1=t.child(P1,!0);t.reset(P1),t.reset(p1),t.template_effect(()=>{t.set_text(g1,i().thisEventHasEnded||"This event has ended"),t.set_text(T1,i().ticketsNoLongerAvailable||"Tickets are no longer available for this event."),t.set_attribute(P1,"aria-label",i().goBackToEventDetails||"Go back to event details"),t.set_text(O1,i().goBack||"Go back")}),t.delegated("click",P1,i1),t.append(X,p1)},s1=X=>{var p1=eA(),l1=t.sibling(t.child(p1),4);t.reset(p1),t.delegated("click",l1,i1),t.append(X,p1)},K=X=>{var p1=rA(),l1=t.child(p1),g1=t.child(l1),b1=t.child(g1);KV(b1,{get event(){return t.get(o)},get lowestPrice(){return t.get(E)},get highestPrice(){return t.get(L)},onCancel:i1,get venueFeesReady(){return t.get(l)},get labels(){return i()}});var T1=t.sibling(b1,2),P1=t.child(T1);UV(P1,{get tickets(){return t.get(o).availableTickets},get quantities(){return t.get(u)},handleQuantityChange:D,get revealHiddenTickets(){return t.get(B)},get revealTicketIds(){return t.get(J)},get venueFeesReady(){return t.get(l)},get labels(){return i()}}),t.reset(T1),t.reset(g1),t.reset(l1);var O1=t.sibling(l1,2);{var k1=F1=>{var n2=aA();t.append(F1,n2)};t.if(O1,F1=>{t.get(p)&&!t.get(g)&&F1(k1)})}var R1=t.sibling(O1,2);let q1,D1;var E1=t.child(R1);{var L1=F1=>{Q6(F1,{})},J1=F1=>{{let n2=t.derived(()=>i().checkout||"Checkout"),o1=t.derived(()=>!!t.get(y));v6(F1,{get btnText(){return t.get(n2)},get loading(){return t.get(v)},checkoutTicket:n1,get quantities(){return t.get(u)},get eventTickets(){return t.get(o).availableTickets},get promoApplied(){return t.get(o1)},get promoDiscount(){return t.get(b)},get subtotal(){return t.get(x)},get fees(){return t.get(z)},taxes:I,get total(){return t.get(P)}})}};t.if(E1,F1=>{t.get(l)?t.get(o)&&t.get(o).availableTickets?.length&&F1(J1,1):F1(L1)})}t.reset(R1),t.reset(p1),t.bind_this(p1,F1=>t.set(_,F1),()=>t.get(_)),t.template_effect(()=>{q1=t.set_class(R1,1,"w-full md:w-80 flex flex-col transition-all will-change-[left] svelte-19g9ni4",null,q1,{"is-sticky":t.get(p)}),D1=t.set_style(R1,"",D1,{left:t.get(p)?`${t.get(H)}px`:"auto"})}),t.append(X,p1)};t.if(y1,X=>{t.get(h)?X(e1):t.get(d)?X(_1,1):t.get(o)&&t.get(t1)?X(h1,2):t.get(o)&&t.get(t1)?X(s1,3):t.get(o)&&X(K,4)})}t.reset(M1),t.bind_this(M1,X=>t.set(f,X),()=>t.get(f));var Z1=t.sibling(M1,2);Mt(Z1,{size:"sm",oncancel:$,role:"alertdialog","aria-labelledby":"error-modal-title","aria-describedby":"error-modal-description",get open(){return t.get(M)},set open(g1){t.set(M,g1,!0)},header:g1=>{var b1=sA(),T1=t.child(b1);{var P1=k1=>{var R1=t.text();t.template_effect(()=>t.set_text(R1,i().unableToReserveTickets||"Unable to Reserve Tickets")),t.append(k1,R1)},O1=k1=>{var R1=t.text();t.template_effect(()=>t.set_text(R1,i().connectionIssue||"Connection Issue")),t.append(k1,R1)};t.if(T1,k1=>{t.get(w)==="cart_failed"?k1(P1):k1(O1,!1)})}t.reset(b1),t.append(g1,b1)},body:g1=>{var b1=oA(),T1=t.child(b1);{var P1=k1=>{var R1=iA(),q1=t.first_child(R1),D1=t.child(q1,!0);t.reset(q1);var E1=t.sibling(q1,2),L1=t.child(E1,!0);t.reset(E1),t.template_effect(()=>{t.set_text(D1,i().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(L1,i().pleaseGoBackAndTryAgain||"Please go back and try again.")}),t.append(k1,R1)},O1=k1=>{var R1=lA(),q1=t.first_child(R1),D1=t.child(q1,!0);t.reset(q1);var E1=t.sibling(q1,2),L1=t.child(E1,!0);t.reset(E1),t.template_effect(()=>{t.set_text(D1,i().cartSuccessMessage||"Good news! Your tickets have been reserved and are being held for you."),t.set_text(L1,i().cartSuccessNetworkError||"However, we encountered a connection issue. Please refresh the page to continue to checkout.")}),t.append(k1,R1)};t.if(T1,k1=>{t.get(w)==="cart_failed"?k1(P1):k1(O1,!1)})}t.reset(b1),t.append(g1,b1)},footer:g1=>{var b1=cA(),T1=t.child(b1);{var P1=k1=>{{let R1=t.derived(()=>i().goBack||"Go back");r2(k1,{variant:"default",onclick:$,get"aria-label"(){return t.get(R1)},children:(q1,D1)=>{t.next();var E1=t.text();t.template_effect(()=>t.set_text(E1,i().goBack||"Go back")),t.append(q1,E1)},$$slots:{default:!0}})}},O1=k1=>{var R1=nA(),q1=t.first_child(R1);{let E1=t.derived(()=>i().cancel||"Cancel");r2(q1,{variant:"alternative",onclick:$,get"aria-label"(){return t.get(E1)},children:(L1,J1)=>{t.next();var F1=t.text();t.template_effect(()=>t.set_text(F1,i().cancel||"Cancel")),t.append(L1,F1)},$$slots:{default:!0}})}var D1=t.sibling(q1,2);{let E1=t.derived(()=>i().refreshPage||"Refresh Page");r2(D1,{variant:"default",onclick:d1,get"aria-label"(){return t.get(E1)},children:(L1,J1)=>{t.next();var F1=t.text();t.template_effect(()=>t.set_text(F1,i().refreshPage||"Refresh Page")),t.append(L1,F1)},$$slots:{default:!0}})}t.append(k1,R1)};t.if(T1,k1=>{t.get(w)==="cart_failed"?k1(P1):k1(O1,!1)})}t.reset(b1),t.append(g1,b1)},$$slots:{header:!0,body:!0,footer:!0}});var H1=t.sibling(Z1,2);Mt(H1,{size:"sm",oncancel:m1,role:"alertdialog","aria-labelledby":"availability-modal-title","aria-describedby":"availability-modal-description",get open(){return t.get(Z)},set open(g1){t.set(Z,g1,!0)},header:g1=>{var b1=vA(),T1=t.child(b1,!0);t.reset(b1),t.template_effect(()=>t.set_text(T1,i().limitedAvailability||"Limited Availability")),t.append(g1,b1)},body:g1=>{var b1=mA(),T1=t.child(b1),P1=t.child(T1,!0);t.reset(T1);var O1=t.sibling(T1,2);t.each(O1,21,()=>t.get(k),t.index,(E1,L1)=>{var J1=dA(),F1=t.child(J1),n2=t.child(F1);t.reset(F1);var o1=t.sibling(F1,2);{var f1=u1=>{var Y=t.text();t.template_effect(c1=>t.set_text(Y,c1),[()=>(i().onlyNAvailable||"Only {available} available (you selected {requested})").replace("{available}",String(t.get(L1).availableQty)).replace("{requested}",String(t.get(L1).requestedQty))]),t.append(u1,Y)},w1=u1=>{var Y=t.text();t.template_effect(c1=>t.set_text(Y,c1),[()=>(i().soldOutYouSelected||"Sold out (you selected {requested})").replace("{requested}",String(t.get(L1).requestedQty))]),t.append(u1,Y)};t.if(o1,u1=>{t.get(L1).availableQty>0?u1(f1):u1(w1,!1)})}t.reset(J1),t.template_effect(()=>t.set_text(n2,`${t.get(L1).ticketName??""}:`)),t.append(E1,J1)}),t.reset(O1);var k1=t.sibling(O1,2);{var R1=E1=>{var L1=hA(),J1=t.child(L1,!0);t.reset(L1),t.template_effect(()=>t.set_text(J1,i().partialAvailabilityContinue||"Would you like to continue with the available tickets?")),t.append(E1,L1)},q1=t.derived(()=>t.get(k).some(E1=>E1.availableQty>0)),D1=E1=>{var L1=gA(),J1=t.child(L1,!0);t.reset(L1),t.template_effect(()=>t.set_text(J1,i().allTicketsSoldOut||"Unfortunately, all the tickets you selected have sold out.")),t.append(E1,L1)};t.if(k1,E1=>{t.get(q1)?E1(R1):E1(D1,!1)})}t.reset(b1),t.template_effect(()=>{t.set_text(P1,i().ticketsNoLongerAvailableMessage||"Some tickets you selected are no longer available in the requested quantities:"),t.set_attribute(O1,"aria-label",i().ticketAvailabilityChanges||"Ticket availability changes")}),t.append(g1,b1)},footer:g1=>{var b1=pA(),T1=t.child(b1);{let R1=t.derived(()=>i().goBack||"Go back");r2(T1,{variant:"alternative",onclick:m1,get"aria-label"(){return t.get(R1)},children:(q1,D1)=>{t.next();var E1=t.text();t.template_effect(()=>t.set_text(E1,i().goBack||"Go back")),t.append(q1,E1)},$$slots:{default:!0}})}var P1=t.sibling(T1,2);{var O1=R1=>{{let q1=t.derived(()=>i().continueWithAvailable||"Continue with available");r2(R1,{variant:"default",onclick:v1,get"aria-label"(){return t.get(q1)},children:(D1,E1)=>{t.next();var L1=t.text();t.template_effect(()=>t.set_text(L1,i().continueWithAvailable||"Continue with available")),t.append(D1,L1)},$$slots:{default:!0}})}},k1=t.derived(()=>t.get(k).some(R1=>R1.availableQty>0));t.if(P1,R1=>{t.get(k1)&&R1(O1)})}t.reset(b1),t.append(g1,b1)},$$slots:{header:!0,body:!0,footer:!0}}),t.append(a,j),t.pop()}t.delegate(["click"]);const le={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}};({...le,tickets:le.tickets[0]},{...le,event:{...le.event}});const uA=G3("VC");let _A={...{baseUrl:"https://get-micdrop.com",timeout:3e4,onError:a=>uA.error("API Error:",a)}};function oe(){return`${_A.baseUrl}/api/v2/public`}function HA(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var ne={},n5,K6;function MA(){return K6||(K6=1,n5=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),n5}var c5={},pt={},J6;function Rt(){if(J6)return pt;J6=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 pt.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},pt.getSymbolTotalCodewords=function(s){return e[s]},pt.getBCHDigit=function(r){let s=0;for(;r!==0;)s++,r>>>=1;return s},pt.setToSJISFunction=function(s){if(typeof s!="function")throw new Error('"toSJISFunc" is not a valid function.');a=s},pt.isKanjiModeEnabled=function(){return typeof a<"u"},pt.toSJIS=function(s){return a(s)},pt}var v5={},$6;function d5(){return $6||($6=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}}})(v5)),v5}var h5,t9;function VA(){if(t9)return h5;t9=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++}},h5=a,h5}var g5,e9;function AA(){if(e9)return g5;e9=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]},g5=a,g5}var m5={},a9;function zA(){return a9||(a9=1,(function(a){const e=Rt().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}})(m5)),m5}var p5={},r9;function bA(){if(r9)return p5;r9=1;const a=Rt().getSymbolSize,e=7;return p5.getPositions=function(s){const i=a(s);return[[0,0],[i-e,0],[0,i-e]]},p5}var f5={},s9;function yA(){return s9||(s9=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}})(f5)),f5}var na={},i9;function l9(){if(i9)return na;i9=1;const a=d5(),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 na.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}},na.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}},na}var u5={},Xe={},o9;function xA(){if(o9)return Xe;o9=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]})(),Xe.log=function(s){if(s<1)throw new Error("log("+s+")");return e[s]},Xe.exp=function(s){return a[s]},Xe.mul=function(s,i){return s===0||i===0?0:a[e[s]+e[i]]},Xe}var n9;function ZA(){return n9||(n9=1,(function(a){const e=xA();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}})(u5)),u5}var _5,c9;function wA(){if(c9)return _5;c9=1;const a=ZA();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},_5=e,_5}var H5={},M5={},V5={},v9;function d9(){return v9||(v9=1,V5.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),V5}var F0={},h9;function g9(){if(h9)return F0;h9=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
|
|
75
75
|
]))+`;F0.KANJI=new RegExp(r,"g"),F0.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),F0.BYTE=new RegExp(s,"g"),F0.NUMERIC=new RegExp(a,"g"),F0.ALPHANUMERIC=new RegExp(e,"g");const i=new RegExp("^"+r+"$"),l=new RegExp("^"+a+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return F0.testKanji=function(c){return i.test(c)},F0.testNumeric=function(c){return l.test(c)},F0.testAlphanumeric=function(c){return o.test(c)},F0}var m9;function Ot(){return m9||(m9=1,(function(a){const e=d9(),r=g9();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}}})(M5)),M5}var p9;function LA(){return p9||(p9=1,(function(a){const e=Rt(),r=l9(),s=d5(),i=Ot(),l=d9(),o=7973,n=e.getBCHDigit(o);function c(m,g,p){for(let H=1;H<=40;H++)if(g<=a.getCapacity(H,p,m))return H}function v(m,g){return i.getCharCountIndicator(m,g)+4}function h(m,g){let p=0;return m.forEach(function(H){const f=v(H.mode,g);p+=f+H.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,H){if(!l.isValid(g))throw new Error("Invalid QR Code version");typeof H>"u"&&(H=i.BYTE);const f=e.getSymbolTotalCodewords(g),_=r.getTotalCodewordsCount(g,p),u=(f-_)*8;if(H===i.MIXED)return u;const A=u-v(H,g);switch(H){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 H;const f=s.from(p,s.M);if(Array.isArray(g)){if(g.length>1)return d(g,f);if(g.length===0)return 1;H=g[0]}else H=g;return c(H.mode,H.getLength(),f)},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}})(H5)),H5}var A5={},f9;function TA(){if(f9)return A5;f9=1;const a=Rt(),e=1335,r=21522,s=a.getBCHDigit(e);return A5.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},A5}var z5={},b5,u9;function CA(){if(u9)return b5;u9=1;const a=Ot();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))},b5=e,b5}var y5,_9;function EA(){if(_9)return y5;_9=1;const a=Ot(),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)},y5=r,y5}var x5,H9;function kA(){if(H9)return x5;H9=1;const a=Ot();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)},x5=e,x5}var Z5,M9;function SA(){if(M9)return Z5;M9=1;const a=Ot(),e=Rt();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]+`
|
|
76
76
|
Make sure your charset is UTF-8`);l=(l>>>8&255)*192+(l&255),s.put(l,13)}},Z5=r,Z5}var w5={exports:{}},V9;function IA(){return V9||(V9=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,H,f;!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,H=o[h],f=typeof o[h]>"u",(f||H>p)&&(o[h]=p,n.push(h,p),l[h]=v))}if(typeof i<"u"&&typeof o[i]>"u"){var _=["Could not find a path from ",s," to ",i,"."].join("");throw new Error(_)}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})(w5)),w5.exports}var A9;function DA(){return A9||(A9=1,(function(a){const e=Ot(),r=CA(),s=EA(),i=kA(),l=SA(),o=g9(),n=Rt(),c=IA();function v(_){return unescape(encodeURIComponent(_)).length}function h(_,u,A){const y=[];let b;for(;(b=_.exec(A))!==null;)y.push({data:b[0],index:b.index,mode:u,length:b[0].length});return y}function d(_){const u=h(o.NUMERIC,e.NUMERIC,_),A=h(o.ALPHANUMERIC,e.ALPHANUMERIC,_);let y,b;return n.isKanjiModeEnabled()?(y=h(o.BYTE,e.BYTE,_),b=h(o.KANJI,e.KANJI,_)):(y=h(o.BYTE_KANJI,e.BYTE,_),b=[]),u.concat(A,y,b).sort(function(w,V){return w.index-V.index}).map(function(w){return{data:w.data,mode:w.mode,length:w.length}})}function m(_,u){switch(u){case e.NUMERIC:return r.getBitsLength(_);case e.ALPHANUMERIC:return s.getBitsLength(_);case e.KANJI:return l.getBitsLength(_);case e.BYTE:return i.getBitsLength(_)}}function g(_){return _.reduce(function(u,A){const y=u.length-1>=0?u[u.length-1]:null;return y&&y.mode===A.mode?(u[u.length-1].data+=A.data,u):(u.push(A),u)},[])}function p(_){const u=[];for(let A=0;A<_.length;A++){const y=_[A];switch(y.mode){case e.NUMERIC:u.push([y,{data:y.data,mode:e.ALPHANUMERIC,length:y.length},{data:y.data,mode:e.BYTE,length:y.length}]);break;case e.ALPHANUMERIC:u.push([y,{data:y.data,mode:e.BYTE,length:y.length}]);break;case e.KANJI:u.push([y,{data:y.data,mode:e.BYTE,length:v(y.data)}]);break;case e.BYTE:u.push([{data:y.data,mode:e.BYTE,length:v(y.data)}])}}return u}function H(_,u){const A={},y={start:{}};let b=["start"];for(let M=0;M<_.length;M++){const w=_[M],V=[];for(let Z=0;Z<w.length;Z++){const k=w[Z],E=""+M+Z;V.push(E),A[E]={node:k,lastCount:0},y[E]={};for(let L=0;L<b.length;L++){const x=b[L];A[x]&&A[x].node.mode===k.mode?(y[x][E]=m(A[x].lastCount+k.length,k.mode)-m(A[x].lastCount,k.mode),A[x].lastCount+=k.length):(A[x]&&(A[x].lastCount=k.length),y[x][E]=m(k.length,k.mode)+4+e.getCharCountIndicator(k.mode,u))}}b=V}for(let M=0;M<b.length;M++)y[b[M]].end=0;return{map:y,table:A}}function f(_,u){let A;const y=e.getBestModeForData(_);if(A=e.from(u,y),A!==e.BYTE&&A.bit<y.bit)throw new Error('"'+_+'" cannot be encoded with mode '+e.toString(A)+`.
|