1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["static/index-CvtoAcCz.js","static/vendor-react-nj2ukvvY.js","static/vendor-apollo-AvuNUkOJ.js","static/vendor-moment-CqZOA61p.js","static/vendor-lodash-CuICpPff.js","static/index-B8ehvCgR.css","static/index-C0GDqtfM.js","static/index-82yg2zCz.css","static/CustomTicketPurchaseComplete-Be04LVjT.js","static/index-djhbbte-.js","static/index-BnzTMWts.css","static/index-DjKuzjq_.js","static/index-ClcHAeBK.css","static/BeeFreePageLanding-DHFjGweO.js","static/utils-DMbaYCZ6.js","static/NewAgenda-Gp-ErWHK.js","static/InfiniteScroll-C22j3N3u.js","static/nestedSessions-B2yjKenJ.js","static/index-BCIB7Xac.js","static/index-B0AVCvHU.css","static/index-DmpHu0W6.js","static/index-CRNo39xO.js","static/SessionSurveyForm-C7UXIWgR.js","static/SurveyForm-BKsTYiDz.js","static/index-47vxASz7.js","static/matrixHelper-XRm2DHD4.js","static/SurveyForm-DPErcQVP.css","static/VenueMapLocationPopup-CP2-1W0T.js","static/HotspotViewer-BlOQFFIo.js","static/LocationDetailsPopover-BRFA49iB.js","static/index-DEYBu8AT.js","static/index-CKbzl7aQ.js","static/NewMeetWeb-CbbXKb0D.js","static/Table-BR2g5P5G.js","static/index-CVeC7eCs.js","static/index-BA7oAXT3.js","static/Table-Cwp_Z1lK.css","static/SessionFormatLabel-rdCqw4HW.js","static/index-B7e6qRZj.js","static/keen-slider.min-DBmVTzQB.js","static/keen-slider-DST-qPa6.css","static/index-DTn9PCPV.css","static/slick-CzP6NKCb.css","static/index-DHOoZwIS.css","static/index-DgBnKPwZ.js","static/DocumentLink-CFqwI41g.js","static/SpeakerItemView-CnSouGtW.js","static/index-BHCDSO-Z.css","static/froala_editor.pkgd-DKbzPJM3.css","static/index.m-DIl8CZg0.js","static/react-urx.esm-Dk0S5Uhj.js","static/use-isomorphic-layout-effect.browser.esm-DWyPgxyo.js","static/index-CgzHCybu.js","static/index-BPfbqQ73.js","static/NewAgenda-DH4iyKfG.css","static/index-PsgMSbwK.css","static/Expo-kX6hJfaf.js","static/ExpoCard-CzUO9w65.js","static/exhibitorAttributeVisibility-DVxv5UFp.js","static/exhibitorPropertyRules-Bk6J-dXi.js","static/ExpoCard-C7_0ZsOP.css","static/eventStreamGqlClient-B6meeomQ.js","static/VideoPlayer-D1JXwo5E.js","static/mux-D6z-_C4j.js","static/index-BQMd8I3b.js","static/Slider-0KrFl9YR.js","static/objectSpread2-BDG0PPbD.js","static/playerOverlay-BKV2PZEC.js","static/Expo-BoQrCEDz.css","static/SponsersTab-CbMPq9to.js","static/Countdown-Bw-3f4L2.js","static/AEPoweredBy-CO6XSJnX.js","static/index-LJEQq_sW.js","static/index-BwTJJKWO.css","static/index-Be2ti5-S.js","static/housing-BitG70M8.js","static/index-de3dDloI.js","static/index-BO3_LDXQ.css","static/infoBanner-Be35HBVs.js","static/infoBanner-FNhHOexq.css","static/BeeFreePageLanding-3UE6OfWB.css","static/_beefree-page-landing-Bsej_x6I.css"])))=>i.map(i=>d[i]); 2import{qG as ut,aA as ja,em as be,T as hs,L as ee,G as pe,K as _e,I as ce,J as ls,aF as Ka,bY as ye,$ as ps,H0 as Xa,c as qt,dn as Ja,hZ as Za,ds as Pt,fH as wt,a1 as it,a3 as et,dy as ei,aB as Ut,a0 as ti,E as Ee,au as xt,aY as mt,aG as Tt,H1 as Qa,H2 as si,hS as ai,hT as ii,hU as ni,hR as ht,H3 as oi,H4 as ri,H5 as li,tn as ci,cR as ct,cy as Ke,D as nt,cL as ba,X as Va,dw as Ue,tm as di,hN as ui,H6 as hi,C$ as pi,jU as fi,gH as mi,gG as Ti,jL as yi,D1 as gi,D2 as ki,eg as bi,fV as Ei,fY as Ci,Db as Ai,H7 as Si,H8 as vi,D6 as Ni,H9 as Ii,D5 as Di,uw as Ri,fZ as Fi,jO as Pi,f as wi,Dp as xi,Ha as Li,uZ as Oi,jN as Bi,Hb as Mi,Ds as _i,uY as Ui,Gc as Hi,e1 as Qi,W as Vi,dG as qi,dF as $i,uy as Gi,uz as Wi,hM as zi,fO as Yi,Dq as ji,Hc as Ki,e as Xi,dk as Ji,cJ as Kt,at as Xt,bI as Zi,bJ as en,yf as tn,az as sn,Hd as an,bZ as Ea,m9 as Ca,jF as Jt,Dy as Aa,aX as nn,pA as on,c1 as rn,C as ln,yd as cn,ye as dn,h9 as un,eS as hn}from"./index-CvtoAcCz.js";/* empty css */import{c as pt,l as dt,m as Be,p as pn,f as fn,P as mn,b as Me,s as $e,g as Lt,Q as Tn,i as Ht,h as yn,r as vt,R as lt,u as Zt,x as Sa,S as gn,N as kn,O as bn}from"./vendor-lodash-CuICpPff.js";import{m as w,h as Le}from"./vendor-moment-CqZOA61p.js";import{r as oe,R as i,f as va}from"./vendor-react-nj2ukvvY.js";import{C as En,m as Cn}from"./react-big-calendar-Dds5PT_S.js";import{C as An}from"./Collapse-CyrX3MJt.js";import{R as Sn}from"./recaptcha-wrapper-C0R95zUD.js";import{r as vn}from"./index-ndMr_co6.js";import{b1 as Nn,aZ as In}from"./index-BCaUNY5L.js";import{q as Na,t as Ia,u as Dn,v as Rn,R as Fn,T as Pn}from"./index-DF6gZRU4.js";import wn from"./index-CYwpjIqO.js";import{F as xn}from"./index-C-XYC46g.js";import{f as Ln}from"./index-BfLnaHXV.js";import{U as On}from"./UserBasicInformation-BMoqCDio.js";import{S as Bn}from"./index-B2Oz1Efq.js";import"./Embeddable-_Uj3tBKS.js";import{S as Mn}from"./SeatsioSeatingChart-Bt9bvHGy.js";import{M as _n}from"./Expo-kX6hJfaf.js";import{e as Un,b as Hn,c as Qn}from"./index-DEaJz4YA.js";import{g as Da,r as Ct,e as Ra,a as Ot}from"./floorPlanCache-DSDwFbWZ.js";import{S as Vn}from"./index-BCIB7Xac.js";import{U as qn,g as $n,s as Gn}from"./index-CKOaUnVX.js";import Wn from"./index-Bqsys2cg.js";import{T as zn}from"./index-djhbbte-.js";const tt=ut.PERCENTAGE,Qt=ut.APPLY_DISCOUNT_TIERED,Vt=ut.FIXED_DISCOUNT_AMOUNT,Fa=f=>f===tt||f===Qt,ft=()=>({SHOW:[],HIDE:[],Set_Quantity:[],Max_Quantity:[],LIMIT_QUANTITY:[],"Apply Discount":[],[tt]:[],"Set Price":[],[Vt]:[]}),ir=f=>{var d,c,m,g,k,S,u,E,h,y;const p={},e={},t={},s=[];let n=!1,a=!1,r=!1,o=!1;for(const b of f){const D=b==null?void 0:b.ruleId;e[D]={operator:b==null?void 0:b.ruleConditionOperator,conditions:((d=b==null?void 0:b.registrationRulesConditions)==null?void 0:d.map(A=>({trigger:A==null?void 0:A.trigger,operator:A==null?void 0:A.operator,value:A==null?void 0:A.value,targetEntityId:A==null?void 0:A.targetEntityId})))||[],actions:((c=b==null?void 0:b.registrationRulesActions)==null?void 0:c.map(A=>
2{const x=(A==null?void 0:A.action)===Qt,H=Array.isArray(A==null?void 0:A.tiers)&&A.tiers.length>0||x,q=x?tt:A==null?void 0:A.action,N=Array.isArray(A==null?void 0:A.tiers)&&A.tiers.length>0?A.tiers.reduce((J,W)=>Math.max(J,Number(W==null?void 0:W.discountPercent)||0),0):null;let V=null;return q===tt?V=H?N:(A==null?void 0:A.quantity)??null:V=(A==null?void 0:A.quantity)||null,{action:q,targets:A==null?void 0:A.target,tiers:A==null?void 0:A.tiers,hasTiers:H,quantity:V}}))||[]};const P=(m=b==null?void 0:b.registrationRulesActions)==null?void 0:m.some(A=>Fa(A==null?void 0:A.action)),C=(g=b==null?void 0:b.registrationRulesActions)==null?void 0:g.some(A=>(A==null?void 0:A.action)===Qt),F=(k=b==null?void 0:b.registrationRulesConditions)==null?void 0:k.some(A=>(A==null?void 0:A.trigger)==="SELECTED_EXPO_INDIVIDUAL"||(A==null?void 0:A.trigger)==="SELECTED_EXPO_TIER"),_=(S=b==null?void 0:b.registrationRulesActions)==null?void 0:S.some(A=>(A==null?void 0:A.action)==="Set Price"),$=(u=b==null?void 0:b.registrationRulesActions)==null?void 0:u.some(A=>(A==null?void 0:A.action)===Vt);P&&(n=!0),(C||F)&&(a=!0),_&&(r=!0),$&&(o=!0);for(const A of(b==null?void 0:b.registrationRulesConditions)||[]){const x=A==null?void 0:A.trigger,H=A==null?void 0:A.value;p[x]||(p[x]={}),p[x][H]||(p[x][H]=[]),p[x][H].push(D)}const U=(E=b==null?void 0:b.registrationRulesConditions)==null?void 0:E.some(A=>(A==null?void 0:A.trigger)==="SELECTED_EXPO_INDIVIDUAL"||(A==null?void 0:A.trigger)==="SELECTED_EXPO_TIER");for(const A of(b==null?void 0:b.registrationRulesActions)||[]){const x=A==null?void 0:A.action,H=(A==null?void 0:A.target)||[],q=x===Qt;if(Fa(x))if(Array.isArray(A==null?void 0:A.tiers)&&A.tiers.length>0||q||U){const V=H==null?void 0:H[0];V?(t[V]||(t[V]=ft()),t[V][tt].push(D)):s.push(D)}else if(H.length>0)for(const V of H)t[V]||(t[V]=ft()),t[V][tt].push(D);else s.push(D);else for(const N of H)t[N]||(t[N]=ft()),(y=(h=t[N])==null?void 0:h[x])==null||y.push(D),t[N].isDiscountCode=(A==null?void 0:A.action)==="Apply Discount"}}return{conditionsMap:p,rulesMap:e,actionMap:t,globalPercentageDiscounts:s,hasPercentageDiscountAction:n,hasTieredOrCrossTicketRule:a,hasSetPriceAction:r,hasFlatDiscountAction:o}},cs=f=>{var n;const p=(f==null?void 0:f.split("/"))||[];let e,t,s;return Number(p[0])>12?[e,t,s]=p:((n=p[2])==null?void 0:n.length)===4?[t,e,s]=p:[t,e,s]=p,{day:Number(e),month:Number(t),year:Number(s)}},Pa=f=>{if(!f)return null;const{day:p,month:e,year:t}=cs(f);return new Date(t,e-1,p)},wa=(f,p)=>{const e=cs(f),t=cs(p);return e.day===t.day&&e.month===t.month&&e.year===t.year},xa=(f,p,e,t=[])=>{var d;const{trigger:s,operator:n,value:a,targetEntityId:r}=f;let o;if(s==="SELECTED_EXPO_TIER"||s==="SELECTED_EXPO_INDIVIDUAL")return!0;if(s==="AVAILABLE_INVENTORY"){const c=(p.ticketTypeRemainingCounts||[]).find(u=>Number(u==null?void 0:u.ticketTypeId)===Number(r));if(!c)return!1;const m=c.remainingCount,g=m==null?1/0:Math.max(0,Number(m)),k=Number(a??0);let S;switch((n||"").toUpperCase()){case"IS":S=g===k;break;case"ISNOT":S=g!==k;break;case"GREATER_THAN":case"GRATERTHAN":case"GREATERTHAN":S=g>k;break;case"LESS_THAN":case"LESSTHAN":S=g<k;break;case"GREATER_THAN_EQUALS":case"GTE":case"GRATERTHANEQUALS":case"GREATERTHANEQUALS":S=g>=k;break;case"LESS_THAN_EQUALS":case"LTE":case"LESSTHANEQUALS":S=g<=k;break;default:S=!1}return S}if(s==="SALES_START_DATE"||s==="SALES_END_DATE"){const c=(p.allTickets||[]).find(E=>Number((E==null?void 0:E.typeId)??(E==null?void 0:E.ticketTypeId))===Number(r));if(!c)return!1;const m=s==="SALES_START_DATE"?c.startDate:c.endDate;if(!m)return!1;const g=p.eventTimezone,k=g?w.tz(m,g):w(m),S=g?w.tz(g):w();if(!k.isValid())return!1;let u;switch((n||"").toUpperCase()){case"BEFORE":u=k.isSameOrBefore(S);break;case"AFTER":u=k.isAfter(S);break;default:u=!1}return u}switch(s){case"SELECTED_TICKETS_ADDON":case"SELECTED_TICKET":{const c=p.totalTickets||[],m=Array.isArray(c)?c:Object.values(c),g=m.some(k=>Number((k==null?void 0:k.tickettypeid)??(k==null?void 0:k.ticketTypeId)??(k==null?void 0:k.typeId))===Number(a)&&Number(k.numberofticket||k.ticketQuantity)>0);switch(n.toUpperCase()){case"IS":return g;case"ISNOT":{if(p.isAutoAddEvaluation){const k=p.autoAddedTicketIds;if(!m.some(u=>{const E=Number((u==null?void 0:u.tickettypeid)??(u==null?void 0:u.ticketTypeId)??(u==null?void 0:u.typeId));return Number(u.numberofticket||u.ticketQuantity)>0&&!(k!=null&&k.has(E))}))return!1}return!g}default:return!1}}case"INVENTORY_QUANTITY":o=((d=p==null?void 0:p.exhibitorPurchaseCounts)==null?void 0:d.find(c=>Number(c.ticketTypeId)===Number(p.ticketTypeId)))||{};break;case"DATE":o=p.currentDate;break;case"ORDER_ITEM_QUANTITY":o=p.totalTickets||[];break;case"ACCESS_CODE_ENTERED":o=e?p.accessCode??"":"";break;default:return!1}if(s==="ORDER_ITEM_QUANTITY"){const m=(Array.isArray(o)?o:Object.values(o||{})).filter(h=>h!=null&&h!==""),g=p.autoAddedTicketIds,u=(p.excludeAutoAddedFromQuantity&&(g==null?void 0:g.size)>0?m.filter(h=>!g.has(Number((h==null?void 0:h.tickettypeid)??(h==null?void 0:h.ticketTypeId)??(h==null?void 0:h.typeId)
2))):m).reduce((h,y)=>h+Number((y==null?void 0:y.numberofticket)||0),0),E=Number(a??0);switch(n.toUpperCase()){case"IS":return u===E;case"ISNOT":return u!==E;case"GREATER_THAN":case"GRATERTHAN":case"GREATERTHAN":return u>E;case"LESS_THAN":case"LESSTHAN":return u<E;case"GREATER_THAN_EQUALS":case"GTE":case"GRATERTHANEQUALS":case"GREATERTHANEQUALS":return u>=E;case"LESS_THAN_EQUALS":case"LTE":case"LESSTHANEQUALS":return u<=E;default:return!1}}if(s==="INVENTORY_QUANTITY"){const c=Number(a??0),m=p.ticketTypeId,g=t.find(S=>(S==null?void 0:S.trigger)==="SELECTED_TICKETS_ADDON");if(g){const S=Number(g.value),u=(g.operator||"").toUpperCase(),E=Number(m)===S;if(!(u==="IS"?E:u==="ISNOT"?!E:!1))return!1}const k=(o==null?void 0:o.purchasedCount)||0;switch(n.toUpperCase()){case"LESS_THAN":case"LESSTHAN":return k<c;case"LESS_THAN_EQUALS":case"LESSTHANEQUAL":case"LESSTHANEQUALS":case"LTE":return k<=c;default:return!1}}if(s==="DATE"){const c=Pa(o),m=Pa(a);switch(n.toUpperCase()){case"IS":return wa(o,a);case"ISNOT":return!wa(o,a);case"AFTER":return c>m;case"BEFORE":return c<m;case"GREATER_THAN_EQUALS":case"GTE":case"GRATERTHANEQUALS":case"GREATERTHANEQUALS":return c>=m;case"LESS_THAN_EQUALS":case"LTE":case"LESSTHANEQUALS":return c<=m;default:return!1}}if(Array.isArray(o)||typeof o=="object"){let c;switch(Array.isArray(o)?c=!!o[a]||!!o[Number(a)]:c=!!(o[a]||o[Number(a)]),n.toUpperCase()){case"IS":return c;case"ISNOT":return!c;default:return!1}}switch(n.toUpperCase()){case"IS":return o===a;case"ISNOT":return o!==a;case"GREATER_THAN":case"GRATERTHAN":case"GREATERTHAN":return Number(o)>Number(a);case"LESS_THAN":case"LESSTHAN":return Number(o)<Number(a);case"GREATER_THAN_EQUALS":case"GTE":case"GRATERTHANEQUALS":case"GREATERTHANEQUALS":return Number(o)>=Number(a);case"LESS_THAN_EQUALS":case"LTE":case"LESSTHANEQUAL":case"LESSTHANEQUALS":return Number(o)<=Number(a);case"IN":return Array.isArray(a)&&a.includes(o);default:return!1}},ot=(f,p,e)=>f!=null&&f.conditions?(f.operator||"AND").toUpperCase()==="OR"?f.conditions.some(n=>xa(n,p,e,f.conditions)):f.conditions.every(n=>xa(n,p,e,f.conditions)):!1,Yn=f=>{var p;return(p=f==null?void 0:f.conditions)==null?void 0:p.some(e=>{var t;return(e.trigger==="SELECTED_TICKET"||e.trigger==="SELECTED_TICKETS_ADDON")&&((t=e.operator)==null?void 0:t.toUpperCase())==="ISNOT"})},At=(f,p,e,t,s,n=!1)=>{var r;let a=!1;return(r=f==null?void 0:f[p])==null||r.forEach(o=>{var E,h,y,b;const d=e==null?void 0:e[o];if(!d||p==="Set_Quantity"&&!t.hasUserInteracted&&Yn(d))return;const c=p==="LIMIT_QUANTITY"&&((E=d.conditions)==null?void 0:E.some(D=>(D.trigger==="SELECTED_TICKETS_ADDON"||D.trigger==="SELECTED_TICKET")&&Number(D.value)===Number(t.ticketTypeId))),g=n&&(p!=="LIMIT_QUANTITY"||c)?{...t,isOrderItemQuantityCondition:(h=d.conditions)==null?void 0:h.some(D=>D.trigger==="ORDER_ITEM_QUANTITY")}:t;if(!ot(d,g,s))return;a=!0;const S=Number(t.ticketTypeId),u=(y=d.actions)==null?void 0:y.find(D=>{var P;return D.action===p&&Array.isArray(D==null?void 0:D.targets)&&((P=D==null?void 0:D.targets)==null?void 0:P.some(C=>Number(C)===S))});if((u==null?void 0:u.quantity)!=null){if(p==="Set_Quantity"&&(t.autoAddQuantity=u.quantity),p==="Max_Quantity"&&(t.maxTicketQuantity=u.quantity),p==="LIMIT_QUANTITY"){t.matchedLimitQuantityRuleId=o;const D=(b=t.exhibitorPurchaseCounts)==null?void 0:b.find(F=>Number(F.ticketTypeId)===Number(t.ticketTypeId)),P=Number((D==null?void 0:D.purchasedCount)||0),C=Math.max(0,u.quantity-P);(t.maxTicketQuantity==null||C<t.maxTicketQuantity)&&(t.maxTicketQuantity=C),t.minTicketQuantity!=null&&t.minTicketQuantity>t.maxTicketQuantity&&(t.minTicketQuantity=t.maxTicketQuantity)}(p==="LIMIT_QUANTITY"||p==="Max_Quantity"||p==="Set_Quantity")&&(t.appliedQuantityRules||(t.appliedQuantityRules=[]),t.appliedQuantityRules.push({ruleId:o,action:p,quantity:u.quantity,ruleConditions:d.conditions||[]}))}}),a},jn=(f,p,e,t,s)=>{var o,d;const n={discountPercentage:0,ruleId:null,hasTieredDiscount:!1,isDisplayDiscountPercentage:!1},a=(f==null?void 0:f[tt])||[];if(a.length===0)return n;const r=[];for(const c of a){const m=p==null?void 0:p[c];if(m){const g=(o=e.totalTickets)==null?void 0:o.filter(u=>!(u!=null&&u.registrationApprovalRequired)),k=(d=m.actions)==null?void 0:d.find(u=>u.action===tt&&Array.isArray(u.targets)&&u.targets.length>0&&u.targets.some(E=>Number(E)===Number(s)));if(k&&ot(m,{...e,totalTickets:g,hasTieredAction:!!k.hasTiers},t)&&!pt(k)){const u=Number(k.quantity);Number.isFinite(u)&&u>=0&&r.push({ruleId:c,discountPercentage:u,hasTieredDiscount:!!k.hasTiers})}}}if(r.length>0){r.sort((m,g)=>g.discountPercentage-m.discountPercentage);const c=r[0];n.discountPercentage=c.discountPercentage,n.ruleId=c.ruleId,n.hasTieredDiscount=c.hasTieredDiscount,n.isDisplayDiscountPercentage=!0}return n},Kn=(f,p,e,t,s)=>{var o,d;const n={setPrice:null,ruleId:null},a=(f==null?void 0:f["Set Price"])||[];
2if(a.length===0)return n;const r=[];for(const c of a){const m=p==null?void 0:p[c];if(m){const g=(o=e.totalTickets)==null?void 0:o.filter(u=>!(u!=null&&u.registrationApprovalRequired)),S=ot(m,{...e,totalTickets:g},t)?(d=m.actions)==null?void 0:d.find(u=>u.action==="Set Price"&&Array.isArray(u.targets)&&u.targets.length>0&&u.targets.some(E=>Number(E)===Number(s))):null;if(!pt(S)){const u=Number(S.quantity);Number.isFinite(u)&&u>=0&&r.push({ruleId:c,setPrice:u})}}}if(r.length>0){r.sort((m,g)=>m.setPrice-g.setPrice);const c=r[0];n.setPrice=c.setPrice,n.ruleId=c.ruleId}return n},Xn=(f,p,e,t,s)=>{var o,d;const n={flatDiscount:null,ruleId:null},a=(f==null?void 0:f[Vt])||[];if(a.length===0)return n;const r=[];for(const c of a){const m=p==null?void 0:p[c];if(m){const g=(o=e.totalTickets)==null?void 0:o.filter(u=>!(u!=null&&u.registrationApprovalRequired)),S=ot(m,{...e,totalTickets:g},t)?(d=m.actions)==null?void 0:d.find(u=>u.action===Vt&&Array.isArray(u.targets)&&u.targets.length>0&&u.targets.some(E=>Number(E)===Number(s))):null;if(!pt(S)){const u=Number(S.quantity);Number.isFinite(u)&&u>=0&&r.push({ruleId:c,flatDiscount:u})}}}if(r.length>0){r.sort((m,g)=>g.flatDiscount-m.flatDiscount);const c=r[0];n.flatDiscount=c.flatDiscount,n.ruleId=c.ruleId}return n},Jn=(f,p,e,t,s)=>{var o,d;const n=p==null?void 0:p[f];return n?!!(((o=n.HIDE)==null?void 0:o.some(c=>{const m=e==null?void 0:e[c];return m?ot(m,t,s):!1}))||((d=n.SHOW)==null?void 0:d.length)>0&&!n.SHOW.some(m=>{const g=e==null?void 0:e[m];return g?ot(g,t,s):!1})):!1},st=(f,p,e,t,s,n,a,r,o=!1,d=[],c=null)=>{var S;const m=new Date,g=`${String(m.getMonth()+1).padStart(2,"0")}/${String(m.getDate()).padStart(2,"0")}/${m.getFullYear()}`,k=new Set;return(S=f==null?void 0:f.map(u=>{var v,M,de,ke,fe,Te;const E=((v=p==null?void 0:p.actionMap)==null?void 0:v[u==null?void 0:u.typeId])||null,h=(p==null?void 0:p.globalPercentageDiscounts)||null;if(!E&&!h)return u;const y={totalTickets:e,currentDate:g,accessCode:t,autoAddedTicketIds:r,hasUserInteracted:o,minTicketQuantity:u==null?void 0:u.minTickerPerBuyer,maxTicketQuantity:u==null?void 0:u.maxTickerPerBuyer,exhibitorPurchaseCounts:n,ticketTypeId:u==null?void 0:u.typeId,allTickets:f,ticketTypeRemainingCounts:d,eventTimezone:c},b=E?At(E,"SHOW",p==null?void 0:p.rulesMap,y,s):!1,D=E?At(E,"HIDE",p==null?void 0:p.rulesMap,y,s):!1,P=E?At(E,"Set_Quantity",p==null?void 0:p.rulesMap,y,s):!1,C=E?At(E,"Max_Quantity",p==null?void 0:p.rulesMap,y,s):!1;if(E&&(u==null?void 0:u.ticketType)!=="DONATION"){const G=Number((u==null?void 0:u.minTickerPerBuyer)||0);G>0&&(E.LIMIT_QUANTITY||[]).some(Z=>{var l,O,B,I;const K=(l=p==null?void 0:p.rulesMap)==null?void 0:l[Z],R=(O=K==null?void 0:K.conditions)==null?void 0:O.some(Q=>(Q==null?void 0:Q.trigger)==="SELECTED_EXPO_INDIVIDUAL"||(Q==null?void 0:Q.trigger)==="SELECTED_EXPO_TIER"),T=Number((I=(B=K==null?void 0:K.actions)==null?void 0:B.find(Q=>Q.action==="LIMIT_QUANTITY"))==null?void 0:I.quantity);return R&&Number.isFinite(T)&&T<G})?y.maxTicketQuantity=0:At(E,"LIMIT_QUANTITY",p==null?void 0:p.rulesMap,y,s,!0)}const F=D||((M=E==null?void 0:E.SHOW)==null?void 0:M.length)>0&&!b,_=P&&!F,$=u==null?void 0:u.registrationApprovalRequired,U=(u==null?void 0:u.ticketType)==="DONATION",x=Number((u==null?void 0:u.price)||0)===0||$||U,q=!!((de=d==null?void 0:d.find(G=>(G==null?void 0:G.ticketTypeId)===(u==null?void 0:u.typeId)))==null?void 0:de.waitList),N=x||q?{setPrice:null,ruleId:null}:Kn(E||ft(),p==null?void 0:p.rulesMap,y,s,u==null?void 0:u.typeId),V=x||q||N.ruleId!=null?{flatDiscount:null,ruleId:null}:Xn(E||ft(),p==null?void 0:p.rulesMap,y,s,u==null?void 0:u.typeId),J=x||N.ruleId!=null||V.ruleId!=null?{discountPercentage:0,discountedQuantity:0,ruleId:null,hasTieredDiscount:!1}:jn(E||ft(),p==null?void 0:p.rulesMap,y,s,u==null?void 0:u.typeId),W=N.ruleId??V.ruleId??J.ruleId,te=(ke=p==null?void 0:p.globalPercentageDiscounts)==null?void 0:ke.includes(W);if(J.ruleId){const G=(fe=p==null?void 0:p.rulesMap)==null?void 0:fe[W],L=(Te=G==null?void 0:G.conditions)==null?void 0:Te.some(Z=>(Z==null?void 0:Z.trigger)==="SELECTED_EXPO_INDIVIDUAL"||(Z==null?void 0:Z.trigger)==="SELECTED_EXPO_TIER");W!==null&&!te&&!L&&k.add(W)}let j=N.setPrice;if(j===null&&V.ruleId!==null){const G=Number((u==null?void 0:u.price)||0),L=Number(V.flatDiscount||0);j=Math.max(0,G-L)}if(j===null&&J.ruleId!==null&&!J.hasTieredDiscount&&Number(J.discountPercentage)>0){const G=Number((u==null?void 0:u.price)||0),L=Number(J.discountPercentage||0);j=Math.max(0,G-G*L/100)}
2return{...u,ticketRuleActions:E,shouldShow:b,shouldHide:D,shouldAutoAdd:_,setMinQuantity:F?!1:P,setMaxQuantity:C,autoAddQuantity:F?0:y.autoAddQuantity||0,minTickerPerBuyer:y.minTicketQuantity,maxTickerPerBuyer:y.maxTicketQuantity,percentageDiscount:J.discountPercentage,discountedQuantity:J.discountedQuantity,discountRuleId:W,setPrice:j,flatDiscount:V.flatDiscount,flatDiscountRuleId:V.ruleId,limitQuantityRuleId:y.matchedLimitQuantityRuleId||null,appliedQuantityRules:y.appliedQuantityRules||[],hasTieredDiscount:!!J.hasTieredDiscount}}))==null?void 0:S.filter(u=>{var b;const{shouldShow:E,shouldHide:h,ticketRuleActions:y}=u;return y?!(h||(b=y.SHOW)!=null&&b.length&&!E):!0})},La=250,Zn=({defaultValue:f,label:p,onNoteChange:e})=>{const[t,s]=oe.useState(f||""),n=a=>{var o;const r=((o=a==null?void 0:a.target)==null?void 0:o.value)??"";s(r),e(r)};return i.createElement(ja,{maxLength:`${La}`,placeholder:"Enter note here...",id:"purchasecardnote",onChange:n,message:p,isFeedBackShow:!0,feedBackText:`${be.t("common:Characters Remaining")}: ${La-t.length}`,value:t})},eo=oe.memo(Zn),to=({description:f})=>{const p=oe.useRef(null),[e,t]=oe.useState(!1),[s,n]=oe.useState(!1);oe.useEffect(()=>{const r=p.current;if(!r)return;const o=()=>{r.classList.remove("collapsed");const c=r.scrollHeight,m=parseFloat(getComputedStyle(r).lineHeight||"20"),g=Math.round(m*2);n(c>g),e||r.classList.add("collapsed")};o(),window.addEventListener("resize",o);const d=new ResizeObserver(o);return d.observe(r),()=>{window.removeEventListener("resize",o),d.disconnect()}},[f,e]);const a=()=>{t(r=>!r)};return i.createElement("div",{className:"description-wrapper"},i.createElement("div",{ref:p,className:`description-content ${e?"expanded":"collapsed"}`},i.createElement("div",{className:"description-html",dangerouslySetInnerHTML:{__html:f}})),s&&i.createElement("a",{onClick:a,className:"show-text pointer"},e?"View Less":"View More"))},Oa=oe.memo(to),fs=({appliedRules:f=[],inlineMessage:p,fallbackMessage:e,popoverTitle:t="Why this changed",attached:s="top",popoverPlacement:n="top",className:a="",role:r="status",visible:o=!0,bannerId:d})=>{var S;const c=oe.useContext(hs);if(!o||!(f!=null&&f.length))return null;const m=f.length>1,g=i.createElement("div",{className:"rule-feedback-popover"},t&&i.createElement(ee,{variant:"captions1",labelClass:"rule-feedback-popover__header"},t),i.createElement("ul",null,f.map(u=>i.createElement("li",{key:u.id},u.message)))),k=d?`${d}-details`:void 0;return i.createElement("div",{role:r,id:d,className:pe("rule-feedback-banner","rule-feedback-banner--warning",`rule-feedback-banner--attached-${s}`,a)},i.createElement("span",{className:"rule-feedback-banner__icon","aria-hidden":"false","aria-label":"Rule applied"},i.createElement(_e,{svgIcon:"lounges-pending-info",size:"exSmall"})),i.createElement(ee,{variant:"footer1",labelClass:"rule-feedback-banner__text m-b-0",color:(S=ce[c==null?void 0:c.theme])==null?void 0:S.neutral1000},m?e:p,m&&i.createElement(i.Fragment,null,i.createElement(ls,{tooltip:g,tooltipProps:{className:"rule-feedback-popover__overlay"},overlayProps:{placement:n,trigger:["click","hover","focus"],rootClose:!0}},i.createElement(Ka,{id:k,className:"rule-feedback-banner__details-link",role:"button",tabIndex:0,"aria-haspopup":"dialog"},"View details")))))};fs.propTypes={appliedRules:ye.arrayOf(ye.shape({id:ye.oneOfType([ye.string,ye.number]).isRequired,message:ye.node.isRequired})),inlineMessage:ye.node,fallbackMessage:ye.node,popoverTitle:ye.node,attached:ye.oneOf(["top","bottom","standalone"]),popoverPlacement:ye.oneOf(["top","bottom","left","right"]),className:ye.string,role:ye.string,visible:ye.bool,bannerId:ye.string};fs.defaultProps={appliedRules:[],inlineMessage:"",fallbackMessage:"",popoverTitle:"Why this changed",attached:"top",popoverPlacement:"top",className:"",role:"status",visible:!0,bannerId:""};const so=oe.memo(fs),ms=({item:f,theme:p,borders:e,secondaryTextColor:t,isIcon:s,isFromWaitlist:n,isExhibitorFlow:a,isHost:r,isFromStaff:o,isOnBording:d,eventCapacityReach:c,equivalentTimezone:m,t:g,isCardDisabled:k,showRuleBanner:S,ruleBannerData:u,isUnlockedByAccessCode:E,unlockedCodeL
2abel:h,renderPrice:y,renderRemaining:b,renderSelection:D})=>{var C,F,_,$,U,A;const P=i.createElement("div",{style:{border:e&&`1px solid ${e}`},className:pe("tickets-details ae_widget_tickets_details",n&&"waitlist-tickets-details",{"disable-tickets-details":k,"tickets-details--has-rule-banner":S})},S&&i.createElement(so,{bannerId:`ticket-rule-banner-${f.typeId}`,appliedRules:u.appliedRulesForBanner,inlineMessage:u.inlineMessage,fallbackMessage:u.fallbackMessage,popoverTitle:g("registrationRules:ruleFeedback.popoverWhyQuantity",{defaultValue:"Why this quantity changed"}),attached:"top"}),i.createElement("div",{key:f.typeId.toString(),className:"d-flex justify-content-between",role:"link",tabIndex:"0"},s&&i.createElement(ps,{xs:12,md:1,className:"col-md-0-5",style:{width:"80px"}},i.createElement("div",{className:"circle-ticket"},i.createElement("i",{className:"ac-icon-ticket"}))),i.createElement("div",{className:"d-flex flex-direction-column justify-space-between gap-8"},i.createElement("div",null,i.createElement(ee,{variant:"heading4",color:t||((C=ce[p])==null?void 0:C.neutral1000),labelClass:"ticket-header line-break-word"},f.name),y(f,"visible-xs"),f.ticketsPerTable&&f.ticketsPerTable>0?i.createElement(ee,{variant:"body2",color:(F=ce[p])==null?void 0:F.neutral850,labelClass:"m-b-4"},` ${g("common:Each")} ${f.bundleType.toString().toLowerCase()} ${g("common:has")} ${f.ticketsPerTable} ${g("common:tickets")} `):"",i.createElement("div",{className:"end-date-design"},(f.minTickerPerBuyer>0?f.remaniningTickets>=f.minTickerPerBuyer:f.remaniningTickets>0)&&!(c&&(f==null?void 0:f.dataType)!=="ADDON")&&!(w(f&&f.endDate).tz(m).diff(w())<=0||w(f&&f.startDate).tz(m).diff(w())>=0)&&i.createElement(ee,{variant:"body2",color:(_=ce[p])==null?void 0:_.neutral700,className:"availabel-date",labelClass:"m-b-0"},`${g("common:Available until")}:`,i.createElement("span",{className:pe(n&&"m-l-4")},w(f.endDate).tz(m).month()===5||w(f.endDate).tz(m).month()===6?w(f.endDate).tz(m).format("dddd, MMMM Do"):w(f.endDate).tz(m).format("dddd, MMM Do")))),i.createElement("div",{className:"view-more-ticket fr-view break-word"},i.createElement(Oa,{description:f==null?void 0:f.ticketTypeDescription}))),f!=null&&f.registrationApprovalRequired&&d&&!(r||o)&&!a?i.createElement(ee,{variant:"body2",labelClass:"m-b-0",color:($=ce[p])==null?void 0:$.danger800,header:"Approval Required"}):null),i.createElement("div",{className:"",id:"free_add_ticket"},f.ticketType!=="DONATION"&&i.createElement("div",{className:"price-ticket-qty-container d-flex justify-content-end"},y(f,"hidden-xs"),i.createElement("div",{className:"mob-with-100 l-h-noraml p-l-r-0"},i.createElement("div",null,D()),b(f,`label remaining-label float-right ${n&&"waitlist-badge"}`))))),f.ticketType!=="DONATION"&&i.createElement("div",{className:"view-less-ticket"},i.createElement(Oa,{description:f==null?void 0:f.ticketTypeDescription})));return E?i.createElement("div",{className:"ticket-access-unlocked-wrapper"},i.createElement("div",{className:"ticket-access-unlocked-banner"},i.createElement(_e,{svgIcon:"access-code-chip-icon",width:"16",height:"16",color:(U=ce[p])==null?void 0:U.primary1000}),i.createElement(ee,{variant:"caption2",labelClass:"m-b-0 access-label overflow-ellipsis",color:(A=ce[p])==null?void 0:A.primary1000},`${g("common:Unlocked with")} ${h}`)),P):P};ms.propTypes={item:ye.object.isRequired,theme:ye.string,borders:ye.string,secondaryTextColor:ye.string,isIcon:ye.bool,isFromWaitlist:ye.bool,isExhibitorFlow:ye.bool,isHost:ye.bool,isFromStaff:ye.bool,isOnBording:ye.bool,eventCapacityReach:ye.bool,equivalentTimezone:ye.string,t:ye.func.isRequired,isCardDisabled:ye.bool,showRuleBanner:ye.bool,ruleBannerData:ye.object,isUnlockedByAccessCode:ye.bool,unlockedCodeL
2abel:ye.string,renderPrice:ye.func.isRequired,renderRemaining:ye.func.isRequired,renderSelection:ye.func.isRequired};ms.defaultProps={theme:"",borders:"",secondaryTextColor:"",isIcon:!1,isFromWaitlist:!1,isExhibitorFlow:!1,isHost:!1,isFromStaff:!1,isOnBording:!1,eventCapacityReach:!1,equivalentTimezone:"",isCardDisabled:!1,showRuleBanner:!1,ruleBannerData:null,isUnlockedByAccessCode:!1,unlockedCodeLabel:""};const ao=(f,p)=>f.sig===p.sig,io=oe.memo(ms,ao),Ba=(f,p)=>{if(!(f!=null&&f.length))return!1;const e=f==null?void 0:f.filter(s=>s.dataType==="ADDON"),t=f==null?void 0:f.filter(s=>s.dataType==="TICKET");if(e.length&&!t.length)return!1;if(t.length){const s=f==null?void 0:f.some(a=>String(a==null?void 0:a.tickettypeid)===String(p==null?void 0:p.typeId)),n=p.dataType==="ADDON";return!s&&!n}return!1},Ma=(f,p)=>{const{maxTickerPerBuyer:e=0}=f||{};return dt.size(p)?(p==null?void 0:p[f.typeId])>=e:!1},no=(f,p)=>{if(!f||!Array.isArray(p))return"";const e=p.find(t=>Number((t==null?void 0:t.typeId)??(t==null?void 0:t.ticketTypeId)??(t==null?void 0:t.tickettypeid))===Number(f));return(e==null?void 0:e.name)||(e==null?void 0:e.label)||""},Ts=(f,p)=>{const e=(f||[]).find(t=>Xa.includes(t==null?void 0:t.trigger)&&((t==null?void 0:t.operator)||"").toUpperCase()==="IS");return e?no(e.value,p):""},qa=(f,p)=>{if(!Array.isArray(f))return"";const e=f.filter(n=>((n==null?void 0:n.trigger)||"").toUpperCase()==="DATE"&&(n==null?void 0:n.value));if(e.length===0)return"";const t=e.map(n=>{const a=(n.operator||"").toUpperCase(),r=n.value;switch(a){case"BEFORE":return p("registrationRules:ruleFeedback.datePhraseBefore",{defaultValue:"before {{date}}",date:r});case"AFTER":return p("registrationRules:ruleFeedback.datePhraseAfter",{defaultValue:"after {{date}}",date:r});case"ISNOT":return p("registrationRules:ruleFeedback.datePhraseNotOn",{defaultValue:"not on {{date}}",date:r});case"IS":default:return p("registrationRules:ruleFeedback.datePhraseOn",{defaultValue:"on {{date}}",date:r})}}),s=p("registrationRules:ruleFeedback.datePhraseJoin",{defaultValue:" and "});return` ${t.join(s)}`},oo=(f,p,e)=>{const t=Ts(f.ruleConditions,p),s=qa(f.ruleConditions,e);return f.action==="Set_Quantity"?e("registrationRules:ruleFeedback.reasonMinRequired",{defaultValue:"At least {{count}} of this ticket is required{{datePhrase}}.",count:f.quantity,datePhrase:s}):t?e("registrationRules:ruleFeedback.reasonReducedBecauseOf",{defaultValue:"Reduced because {{ticketName}} is in your order{{datePhrase}}.",ticketName:t,datePhrase:s}):e("registrationRules:ruleFeedback.reasonLimitedToPerOrder",{defaultValue:"Limited to {{count}} per order for this ticket{{datePhrase}}.",count:f.quantity,datePhrase:s})},ro=(f,p,e,t,s)=>{const n=Ts(f.ruleConditions,t),a=qa(f.ruleConditions,s);return f.action==="Set_Quantity"?s("registrationRules:ruleFeedback.bannerInlineMin",{defaultValue:"Quantity adjusted from {{orig}} to {{adj}} because at least {{count}} of this ticket is required{{datePhrase}}.",orig:p,adj:e,count:f.quantity,datePhrase:a}):n?s("registrationRules:ruleFeedback.bannerInlineTriggered",{defaultValue:"Quantity adjusted from {{orig}} to {{adj}} because {{ticketName}} is in your order{{datePhrase}}.",orig:p,adj:e,ticketName:n,datePhrase:a}):s("registrationRules:ruleFeedback.bannerInlineLimit",{defaultValue:"Quantity adjusted from {{orig}} to {{adj}} because this ticket is limited to {{count}} per order{{datePhrase}}.",orig:p,adj:e,count:f.quantity,datePhrase:a})},lo=(f,p,e)=>e("registrationRules:ruleFeedback.bannerFallback",{defaultValue:"Quantity adjusted from {{orig}} to {{adj}} because of event rules.",orig:f,adj:p}),co=({appliedQuantityRules:f,originalQty:p,adjustedQty:e,ticketTypes:t,t:s}={})=>{if(!Array.isArray(f)||f.length===0||p==null||e==null||Number(p)===Number(e))return null;const n=new Set;let a=f.filter(c=>n.has(c.ruleId)?!1:(n.add(c.ruleId),!0));{if(a=a.filter(c=>!!Ts(c.ruleConditions,t)),a.length===0)return null;a=a.slice(0,1)}const r=a.map(c=>({id:c.ruleId,message:oo(c,t,s)})),o=a.length===1?ro(a[0],p,e,t,s):"",d=lo(p,e,s);return{inlineMessage:o,fallbackMessage:d,appliedRulesForBanner:r}},uo=mt(()=>Tt(()=>import("./index-CvtoAcCz.js").then(f=>f.Pk),__vite__mapDeps([0,1,2,3,4,5]))),_a=255,es={id:null,firstName:null,lastName:null,email:null,phoneNumber:null,countryPhone:null,firstNameValue:null,lastNameValue:null,emailValue:null,ccEmailValue:"",ccEmailFeedBack:!1,company:"",companyFocused:!1,companyTouched:!1,phone:null,firstNameFeedBack:!1,lastNameFeedBack:!1,emailFeedBack:!1,phoneNumberFeedBack:!1,errorMsgPhoneNumber:null,errorMsgEmail:null,loading:!1,status:null,infoMessage:null,errorMessage:null,numberOfTicketValue:0,waitlistSuccessPopup:!1,dialCode:null};class ho extends i.Component{constructor(p){super(p),this.addToWailist=async()=>{const{email:e,firstName:t,lastName:s,numberOfTicket:n,phone:a,firstNameValue:r,lastNameValue:o,emailValue:d,countryPhone:c,numberOfTicketValue:m,dialCode:g,ccEmailValue:k,company:S}=this.state,{waitListSettings:u}=this.props;this.setState({infoMessage:"",loading:!0,ccEmailFeedBack:!0}),this.validateField();const E=this.getCcEmailError(k),h=e&&t&&s&&n&&!E;let y=!(u!=null&&u.phoneNumberRequired);a&&a!==""?await this.props.doValidateMobileNumber(`+${g}${a}
2`).then(P=>{var C,F;y=(F=(C=this.props)==null?void 0:C.waitListSettings)!=null&&F.phoneNumberRequired?!P:!a||!P,this.setState({errorMsgPhoneNumber:"Invalid phone number",phoneNumber:!P})}):u!=null&&u.phoneNumberRequired&&!a&&this.setState({errorMsgPhoneNumber:"Phone Number is Require",phoneNumber:!1});const b=(S||"").trim(),D=!(u!=null&&u.companyRequired)||b.length>0;if(h&&y&&D){const P={firstName:r,lastName:o,email:d,phoneNumber:a,countryCode:c&&c.toUpperCase(),numberOfTickets:parseInt(m,10),ticketingTypeId:this.props.ticketingTypeIdValue,company:b||null,ccEmail:(k==null?void 0:k.trim())||null};y?this.props.addToWaitlist(this.props.eventUrl,P,this.props.recurringEventID).then(C=>{if(C&&C.data&&C.data.message){this.setState({loading:!1,infoMessage:C.data.message,phone:"",phoneNumber:null,firstNameFeedBack:!1,lastNameFeedBack:!1,emailFeedBack:!1,phoneNumberFeedBack:!1,numberOfTicketValue:0,waitlistSuccessPopup:!0,dialCode:null,ccEmailValue:"",ccEmailFeedBack:!1,company:"",companyFocused:!1,companyTouched:!1}),this.firstName.value="",this.lastName.value="",this.email.value="";const F=document.getElementsByClassName("intl-tel");F&&F[0]&&(F[0].value=""),this.props.getWaitListSettings(),this.props.onCloseFunc()}else this.setErrorMessage((C==null?void 0:C.errorMessage)||"Something went wrong")}):this.setErrorMessage("Please provide valid details")}else this.setState({loading:!1})},this.getCcEmailError=e=>{const{waitListSettings:t}=this.props;return t!=null&&t.ccEmailRequired&&!(e!=null&&e.trim())?"CC Email is required.":Za(e)},this.emailValidateHandler=()=>{this.setState({emailFeedBack:!0,emailValue:this.email&&this.email.value&&this.email.value.trim()});const e=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;this.email.value&&this.email.value.trim()===""?this.setState({email:!1,errorMsgEmail:"Email can't be empty."}):this.setState({email:e.test(this.email.value.trim()),errorMsgEmail:"Invalid Email address."})},this.companyValidateHandler=e=>{var s;const t=(s=e==null?void 0:e.target)==null?void 0:s.value;this.setState(n=>({company:t!==void 0?t:n.company}))},this.companyBlurHandler=e=>{var s;const t=(s=e==null?void 0:e.target)==null?void 0:s.value;this.setState(n=>({company:t!==void 0?t:n.company,companyFocused:!1,companyTouched:!0}))},this.firstNameValidateHandler=()=>{this.setState({firstNameFeedBack:!0,firstNameValue:Pt(this.firstName.value,!0,"@"),firstName:!0}),Pt(this.firstName.value,!0,"@")===""&&this.setState({firstName:!1,errorMsgFirstName:"First name can't be empty."})},this.hideSuccessAlertPopup=()=>{this.setState(es)},this.lastNameValidateHandler=()=>{this.setState({lastNameFeedBack:!0,lastNameValue:Pt(this.lastName.value,!0,"@"),lastName:!0}),Pt(this.lastName.value,!0,"@")===""&&this.setState({lastName:!1,errorMsgLastName:"Last name can't be empty."})},this.handleWaitlistOption=(e,t)=>{const s=[];e&&s.push({label:0,key:e+Math.random(),value:0});for(let n=e;n<=t;n++)s.push({label:n,key:e+Math.random(),value:n});return s},this.isMaxWaitListSizeReached=()=>{var n;const{waitListSettings:e,ticketingTypeIdValue:t}=this.props;if(!e)return!1;const s=(n=e.waitlistRemainingByTicketType)==null?void 0:n[t];return s!=null?s<=0:!!e.maxWaitListSizeReached},this.getMaxWaitlistOptionValue=()=>{var o;const{waitListSettings:e,ticketingTypeIdValue:t}=this.props;if(!e||this.isMaxWaitListSizeReached())return 0;const s=Number(e.maxWaitListSize)||0,n=(o=e.waitlistRemainingByTicketType)==null?void 0:o[t],a=n!=null?Number(n):Number(e.remainingTickets)||0;let r;return s===0?r=a>0?a:10:r=a>0?Math.min(s,a):s,Math.min(r,10)},this.reset=()=>{this.setState(es),this.props.onCloseFunc()},this.selectHandle=e=>{this.setState({numberOfTicketValue:e==null?void 0:e.value,numberOfTicket:!0})},this.setErrorMessage=e=>{this.setState({errorMessage:e,loading:!1},()=>{setTimeout(()=>{this.setState({errorMessage:""})},4e3)})},this.validateField=()=>{this.setState({firstNameFeedBack:!0,lastNameFeedBack:!0,emailFeedBack:!0,phoneNumberFeedBack:!0,companyTouched:!0})},this.state=es,this.changePhone=this.phoneNumberValidateHandler.bind(this,"phone")}phoneNumberValidateHandler(p,e,t,s){const{waitListSettings:n}=this.props;this.setState({phone:t,countryPhone:s&&s.iso2,phoneNumberFeedBack:!0,errorMsgPhoneNumber:"",dialCode:s==null?void 0:s.dialCode}),t===""?this.setState({phoneNumber:!(n!=null&&n.phoneNumberRequired),errorMsgPhoneNumber:(n==null?void 0:n.phoneNumberRequired)&&"Phone Number is Require"||""}):this.props.doValidateMobileNumber(`+${s==null?void 0:s.dialCode}${t}`).then(a=>{this.setState({phoneNumber:!a,errorMsgPhoneNumber:"Invalid phone number"})})}render(){var h;const{waitListSettings:p}=this.props||{},{phoneNumberRequired:e,companyRequired:t,waitListButtonText:s,ccEmailRequired:n}=p||{},a=this.state.company||"",r=a.length,o=!!t&&a.trim().length===0,d=this.state.companyTouched&&!this.state.companyFocused&&o;let c=`${r}/${_a}`;d&&(c="Company Name is required.");const m=this.getCcEmailError(this.state.ccEmailValue),g=this.props.eventDetails,k=g&&g.eventDesignDetails&&g.eventDesignDetails.whiteLabelHostBaseUrl,S=g&&g.eventURL||g.eventUrl,u=(h=g==null?void 0:g.eventDesignDetails)==null?void 0:h.socialSharingEnabled,E=[{title:"facebook",link:`${k||xt}/e/${S||S}`,icon:"ac-icon-facebook"},{title:"twitter",link:`${k||xt}/e/${S||S}`,icon:"ac-icon-twitter"},{title:"email",link:`mailto:?subject=${`You're invited to ${name}`}&body=I'd like to share this event with you! ${k||xt}/e/${S||S}`,icon:"ac-icon-email"},{title:"linkedIn",link:`${k||xt}/e/${S||S}`,icon:"fa fa-linkedin"}];return i.createElement("div",null,i.createElement(wt,{show:!!this.props.showModal,onHide:this.reset},i.createElement(wt.Header,{closeButton:!0},s||"Join Waitlist"),i.createElement(wt.Body,null,i.createElement("div",{id:"waitListForm"},this.state.errorMessage&&i.createElement("div",{className:"alert alert-danger"},this.state.errorMessage),this.props.waitListSettings&&this.isMaxWaitListSizeReached()&&i.createElement("div",{className:"alert alert-danger"},"Waitlist queue full"),i.createElement(it,null,i.createElement(et,{type:"text",name:"firstname",id:"firstname",placeHolder:"First Name",inputRef:y=>{this.firstName=y},defaultValue:this.state.firstNameValue,onChange:this.firstNameValidateHandler,onBlur:this.firstNameValidateHandler,message:"First Name",size:"normal",required:!0,valid:this.state.firstNameFeedBack&&this.state.firstName,feedBackText:this.state.errorMsgFirstName||"First name can't be empty.",isFeedBackShow:this.state.firstNameFeedBack&&!this.state.firstName})),i.createElement(it,null,i.createElement(et,{type:"text",name:"lastname",id:"lastname",placeHolder:"Last Name",inputRef:y=>{this.lastName=y},defaultValue:this.state.lastNameValue,onChange:this.lastNameValidateHandler,onBlur:this.lastNameValidateHandler,message:"Last Name",size:"normal",required:!0,valid:this.state.lastNameFeedBack&&this.state.lastName,feedBackText:this.state.errorMsgLastName||"Last name can't be empty.",isFeedBackShow:this.state.lastNameFeedBack&&!this.state.lastName})),i.createElement(it,null,i.createElement(et,{type:"email",name:"email",id:"email",placeHolder:"Email",inputRef:y=>{this.email=y},onChange:this.emailValidateHandler,onBlur:this.emailValidateHandler,defaultValue:this.state.emailValue,message:"Email",size:"normal",required:!0,valid:this.state.emailFeedBack&&this.state.email,feedBackText:this.state.errorMsgEmail||"Email is required.",isFeedBackShow:this.state.emailFeedBack&&!this.state.email})),i.createElement(it,null,i.createElement(On,{id:"waitlist-cc-email",value:this.state.ccEmailValue,mandatory:n,error:this.state.ccEmailFeedBack?m:"",className:"waitlist-cc-email-field",labelClass:"font-s16",onChange:y=>this.setState({ccEmailValue:y,ccEmailFeedBack:!0})})),i.createElement(ee,{variant:"captions",className:"font-s16"},"Phone Number",e&&i.createElement("span",{className:"red font-s16"},"*")),i.createElement(it,null,i.createElement(ei,{allowBlankValue:!0,css:["intl-tel-input","form-control intl-tel"],utilsScript:"./libphonenumber.js",separateDialCode:!0,autoPlaceholder:!1,placeholder:"Cell Phone Number",defaultCountry:this.state.countryPhone?this.state.countryPhone.toString().toLowerCase():"",value:this.state.phone?this.state.phone.toString():"",onPhoneNumberBlur:this.changePhone,onPhoneNumberChange:(y,b)=>{this.setState({phone:b})},isFeedBackShow:this.state.phoneNumberFeedBack&&!this.state.phoneNumber,valid:this.state.phoneNumberFeedBack&&this.state.phoneNumber,feedBackText:this.state.errorMsgPhoneNumber})),i.createElement(ee,{variant:"captions",className:"font-s16"},"Company Name",t&&i.createElement("span",{className:"red font-s16"},"*")),i.createElement(it,null,i.createElement(et,{type:"text",name:"company",id:"waitlist-company",placeHolder:"Company Name",value:a,onChange:this.companyValidateHandler,onFocus:()=>this.setState({companyFocused:!0}),onBlur:this.companyBlurHandler,size:"normal",required:!!t,maxLength:_a,isCounter:!0,valid:!d,feedBackText:c,isFeedBackShow:this.state.companyFocused||d})),i.createElement(ee,{variant:"captions",className:"font-s16"},"Number Of Registrations",i.createElement("span",{className:"red font-s16"},"*")),i.createElement(Ut,{name:"selectTicket",id:"selectWaitListOption",onChange:this.selectHandle,value:this.state.numberOfTicketValue,options:this.handleWaitlistOption(0,this.getMaxWaitlistOptionValue())}))),i.createElement(wt.Footer,null,i.createElement(ti,{className:"m-t-10 text-center"},i.createElement(ps,{md:12},i.createElement(Ee,{loading:this.state.loading,className:"m-r-5",disabled:Number(this.state.numberOfTicketValue)===0,onClick:this.addToWailist},"Submit"),i.createElement(Ee,{variant:"danger",onClick:this.reset},"Close"))))),i.createElement(uo,{id:"waitlistSuccessPopup",showModal:this.state.waitlistSuccessPopup,modelBody:"Events are better with your friends - share below to encourage them to join!",onCloseFunc:this.hideSuccessAlertPopup},i.createElement("div",{className:"row popup-ticket"},i.createElement("div",{className:"text-center"},i.createElement("span",{className:"circle-check"},i.createElement("i",{className:"ac-icon-check"}))),i.createElement("div",{className:"checkout-completed-design"},"Success"),i.createElement("div",{className:"success-description text-center"},this.state.infoMessage),i.createElement("div",{className:"text-center p-20"},i.createElement(Ee,{variant:"success",onClick:this.hideSuccessAlertPopup},"Close")),u&&i.createElement("div",{className:"m-t-10 checkout-popup"},i.createElement("div",{className:"social-left div-left-50"},i.createElement("span",null,"Share on"),i.createElement(Bn,{placement:"top",list:E,id:"socialShareWaitList",eventName:g.name}))))))}}const po={doValidateMobileNumber:f=>Ja(f),addToWaitlist:(f,p,e,t)=>Ln(f,p,e)},fo=f=>{var p,e;return{country:((e=(p=f==null?void 0:f.event)==null?void 0:p.data)==null?void 0:e.countryCode)&&f.event.data.countryCode.toLowerCase(),eventDetails:f.host&&f.host.eventDetails||f.event&&f.event.data}},mo=qt(fo,po)(ho);let je,Bt;window.selectedSeats=[];function To(f){const{ticketingSettings:p,settings:e,recurring:t,eventDetails:s,seatDetails:n,ticketTypeFeesAndDesc:a}=f,[r,o]=oe.useState({}),[d,c]=oe.useState(!0),[m,g]=oe.useState([]),[k,S]=oe.useState(!1),[u,E]=oe.useState(!1),[h,y]=oe.useState(!1),[b,D]=oe.useState(!1),[P,C]=oe.useState(""),[F,_]=oe.useState(""),$=oe.useRef({}),[U,A]=oe.useState([]),[x,H]=oe.useState({width:-1,height:-1,position:{top:0,left:0,right:0,bottom:0}}),q=G=>{const{waitListCheckout:L,waitListSettings:Z}=f,K=[];let R=[];Be(G,T=>{const l={category:T.category,ticketTypes:[]};Be(T.ticketTypes,B=>{B.ticketType=B.ticketType.toString(),l.ticketTypes.push(pn(B,["ticketType","label","price"]));const I=fn(e.ticketTypes,{typeId:parseInt(B.ticketType,10)});(ht(parseInt(B.ticketType,10),Z)&&((I==null?void 0:I.remaniningTickets)<(I==null?void 0:I.minTickerPerBuyer)||(I==null?void 0:I.remaniningTickets)===0)&&!(Le(I==null?void 0:I.endDate).diff(Le())<=0||Le(I==null?void 0:I.startDate).diff(Le())>=0)||L&&!mn(e.ticketTypes,{typeId:parseInt(B.ticketType,10)}))&&R.push(T.category),I&&I.startDate&&(Le(I.startDate).diff(Le())>=0||Le(I.endDate).diff(Le())<=0)&&R.push(T.category),(f==null?void 0:f.paymentGateway)==="TOUCHNET"&&I&&(I!=null&&I.payLater||I!=null&&I.registrationApprovalRequired)&&R.push(T==null?void 0:T.category)}),K.push(l);const O=Me(T.ticketTypes,{hidden:!0});O&&$e(O)===$e(T.ticketTypes)&&!Lt(O,"[0].accessCodeAssociated")&&R.push(T.category)}),R=Tn(R,Ht),A(R),g(K),E(!0),S(!0)},N=(G,L,Z=!1)=>{let K="";const{ticketType:R}=L||{},{selectedTicketType:T,parent:l,objectType:O,category:B}=G||{};R?K=R:T&&(K=T);const I=O==="GeneralAdmissionArea";if(I){vt(window.selectedSeats,ie=>ie.id===G.id);const Q=(G==null?void 0:G.numSelected)||0;for(let ie=0;ie<Q;ie++)window.selectedSeats.push(G)}else if(!Z)window.selectedSeats.push(G);else if(l||O==="Table")vt(window.selectedSeats,Q=>Q.id===G.id);else if(G&&L){const Q=Me(window.selectedSeats,{selectedTicketType:K}),ie=Q&&Q.length?Q[Q.length-1]:[];vt(window.selectedSeats,se=>se.selectedTicketType===ie.selectedTicketType&&se.numSelected===ie.numSelected)}if(B||I){const Q=Me(e.ticketTypes,{typeId:parseInt(K,10)}),ie=Me(window.selectedSeats,ae=>(ae&&ae.objectType==="GeneralAdmissionArea",ae.selectedTicketType===K)),se=Q&&Q[0],ue=[];
2if(Q.length){let ae=[];const Y=[];O!=="Table"&&(ae=Be(ie,"seatId")),Be(ie,me=>{let re=me.id;re=re?re.split("-"):"";let Se=me.objectType;if(Se=Se.charAt(0).toUpperCase()+Se.slice(1),me&&me.parent){let he=me.parent.type;he=he.charAt(0).toUpperCase()+he.slice(1);const Ne=`${he} ${me.labels.parent} ${Se} ${me.labels.own}`;Y.push(Ne)}else re&&re[0]&&(me.objectType==="GeneralAdmissionArea"||me.objectType==="Booth")&&Y.push(re[0]);O==="Table"&&(me.id&&ue.push(me.id),me.seats&&Be(me.seats,he=>{he&&he.id&&ae.push(he.id)}))}),f.addDonation(se,ie.length,ae,Y,ue,window.selectedSeats)}}},V=G=>{const{waitListSettings:L,settings:Z,waitListCheckout:K}=f,{ticketTypes:R}=Z||{},T=Me(R,{typeId:parseInt(G,10)})[0],{remaniningTickets:l,minTickerPerBuyer:O,endDate:B,startDate:I,typeId:Q}=T||{};let ie=!1;return T&&!K&&(l<O||l===0)&&!(Le(B).diff(Le())<=0||Le(I).diff(Le())>=0)&&ht(Q,L)&&(ie=!0),ie},J=G=>{const{paymentGateway:L,settings:Z}=f,{ticketTypes:K}=Z||{},R=Me(K,{typeId:parseInt(G,10)})[0],{payLater:T,registrationApprovalRequired:l}=R||{};return L==="TOUCHNET"&&(T||l)},W=G=>{var l,O;const{waitListSettings:L}=f,Z=(O=(l=G==null?void 0:G.category)==null?void 0:l.pricing)==null?void 0:O.ticketTypes,K=Z==null?void 0:Z.find(B=>ht(parseInt(B.ticketType,10),L)),R=(K==null?void 0:K.ticketType)||"";(R?V(R):!1)&&(C(""),y(!0),D(!0))},te=(G,L,Z=!1)=>{var T,l,O,B;_("");const{host:K,ticketCategory:R}=f;if(!Z&&!K){const I=Lt(G,"category.key",""),Q=L&&L.ticketType||G&&G.selectedTicketType||"",ie=Lt(Me(R,{category:I}),"[0].ticketTypes",""),se=Lt(Me(ie,{ticketType:Q,hidden:!0}),"[0]",""),{hidden:ue,accessCodeAssociated:ae}=se||{},Y=V(Q),me=J(Q);if(ue&&ae&&!K)$.current[Q]?N(G,L):(C(""),y(!0));else if(Y)C(""),y(!0),D(!0);else if(me){const{id:re,pricing:Se}=G||{};Bt&&re&&Bt.deselectObjects([{id:re,ticketType:((l=(T=Se==null?void 0:Se.ticketTypes)==null?void 0:T[0])==null?void 0:l.ticketType)&&Se.ticketTypes[0].ticketType.toString(),amount:(B=(O=Se==null?void 0:Se.ticketTypes)==null?void 0:O[0])==null?void 0:B.price}]);return}else N(G,L,Z)}else N(G,L,Z);o(L),je=G},j=async G=>{const{eventDetails:L}=f;try{const Z=await f.validateCodeType(L==null?void 0:L.eventURL,G);return(Z==null?void 0:Z.data)===!0?(C("This is a discount code, use it at checkout."),!1):!0}catch{return!0}},v=async G=>{const{settings:L,eventUrl:Z}=f,{seatingChartKey:K,eventKey:R}=L||{};m.length>0&&G.changeConfig({availableCategories:m.map(l=>String(l.category))}),f.getIsSeatsioChartDrawn(Z,K).then(l=>{c(l)}),Bt=G;const T=yn(window.selectedSeats);if(T&&T.length){const l=[],O=[];f.storeBuyTicketList(null),f.addDonation("","","",!1,"","","","","",[]),await Be(T,B=>{var se,ue,ae,Y;const{id:I,objectType:Q,pricing:ie}=B||{};Q!=="GeneralAdmissionArea"&&l.push(I),Q!=="GeneralAdmissionArea"?O.push({id:I,ticketType:(ue=(se=ie==null?void 0:ie.ticketTypes)==null?void 0:se[0])!=null&&ue.ticketType?ie.ticketTypes[0].ticketType.toString():""}):O.push({id:I,ticketType:(Y=(ae=ie==null?void 0:ie.ticketTypes)==null?void 0:ae[0])!=null&&Y.ticketType?ie.ticketTypes[0].ticketType.toString():"",amount:1})}),$e(l)>0&&(await f.eventsRelease(R,l),setTimeout(()=>{G.selectObjects(O),window.selectedSeats=[]},1e3))}},M=()=>{setTimeout(()=>{var Z,K,R,T;const{id:G,pricing:L}=je||{};Bt.deselectObjects([{id:G,ticketType:((K=(Z=L==null?void 0:L.ticketTypes)==null?void 0:Z[0])==null?void 0:K.ticketType)&&L.ticketTypes[0].ticketType.toString(),amount:(T=(R=L==null?void 0:L.ticketTypes)==null?void 0:R[0])==null?void 0:T.price}])},1e3)},de=()=>{y(!1),M()},ke=async()=>{var T,l,O;if(!await j(F))return;const L=(O=(l=(T=je==null?void 0:je.pricing)==null?void 0:T.ticketTypes)==null?void 0:l[0])==null?void 0:O.ticketType,{eventUrl:Z,recurring:K,recurringEventID:R}=f;f.applyAccessCode(Z,F,L,K&&R).then(B=>{if(B&&B.errorMessage&&B.errorCode==="4040019")C(B.errorMessage);else if(B&&B.message||!(B&&B.data))C("Invalid Access code");else{const I=(r==null?void 0:r.ticketType)||(je==null?void 0:je.selectedTicketType)||"";I&&($.current[I]=!0),N(je,r),y(!1)}})},fe=G=>{_(G.target.value),P&&C("")},Te=()=>{f.openWaitListForm(),y(!1),M()};return oe.useEffect(()=>{q(f.ticketCategory)},[f.ticketCategory,f.selectedSeats]),i.createElement(i.Fragment,null,Le(p.endDate).diff(Le())>=0?d&&k&&u?i.createElement(i.Fragment,null,i.createElement(_n,{bounds:!0,onResize:G=>{H({width:G.bounds.width,height:G.bounds.height,position:{left:G.boun
2ds.left,bottom:G.bounds.bottom,top:G.bounds.top,right:G.bounds.right}})}},({measureRef:G})=>i.createElement("div",{ref:G},i.createElement(ai,{waitBeforeShow:500},i.createElement(Mn,{workspaceKey:ni,region:ii,event:t?e.eventKey.toString():s.eventId.toString(),onObjectSelected:(L,Z)=>te(L,Z),onObjectDeselected:(L,Z)=>N(L,Z,!0),onObjectClicked:L=>W(L),onChartRendered:L=>{v(L)},multiSelectEnabled:!0,id:"myIdDivChart",pricing:m,priceFormatter:L=>`${s&&s.currencySymbol||"$"}${L}`,unavailableCategories:U,cursorTooltip:{showActionHint:!0,showAvailability:!0,showCategory:!0,showLabel:!0,showPricing:!0,showUnavailableNotice:!0,stylizedLabel:!0},popoverInfo:L=>{var l,O,B;const Z=((l=L==null?void 0:L.objectType)==null?void 0:l.toLowerCase())==="generaladmissionarea"&&(L==null?void 0:L.bookAsAWhole)===!1;let K=null;const R=((O=L==null?void 0:L.pricing)==null?void 0:O.ticketTypes)||[],T=L==null?void 0:L.label;if(!Z&&R.length>0&&T&&n)for(const I of R){const Q=I==null?void 0:I.ticketType;if(Q&&n[Q]){const ie=n[Q].find(se=>(se==null?void 0:se.key)===T);if(ie&&ie.value){K=ie.value;break}}}if(!K&&(a!=null&&a.length)&&R.length>0){const I=(B=R[0])==null?void 0:B.ticketType,Q=a.find(ie=>String(ie==null?void 0:ie.ticketTypeId)===String(I));Q!=null&&Q.description&&(K=(new DOMParser().parseFromString(Q.description,"text/html").body.textContent||"").replace(/\u00A0/g," ").trim())}return K||""}})))),i.createElement("div",{className:"seating-joinwaitlist-modal-wrapper",style:{display:h?"flex":"none",opacity:h?"1":"0",height:t?x.height+20:x.height+12,width:x.width}},b?i.createElement(i.Fragment,null,i.createElement("div",{className:"modal-header-access"},i.createElement("h4",null,"Join Wait List")),i.createElement("div",{className:"modal-footer-access"},i.createElement(Ee,{className:"ml-3",onClick:()=>{Te()}},"Apply"),i.createElement(Ee,{variant:"danger",className:"ml-3",onClick:()=>de()},"Cancel"))):i.createElement(i.Fragment,null,i.createElement("div",{className:"modal-body"},i.createElement("div",{className:"text-center"},i.createElement(et,{type:"text",value:F,onChange:G=>fe(G),placeholder:"Enter access code",message:"Access code",size:"normal",feedBackText:P,isFeedBackShow:!0}))),i.createElement("div",{className:"modal-footer-access"},i.createElement(Ee,{className:"ml-3",onClick:()=>{ke()},id:"accesscode"},"Apply"),i.createElement(Ee,{className:"ml-3",variant:"danger",onClick:()=>de(),id:"accesscoderemove"},"Cancel"))))):i.createElement("div",{className:"text-center"},i.createElement("h4",null,"A venue diagram has not been created"),i.createElement("a",{href:`/host/${f.eventUrl}/event-ticketing/create`,className:"btn btn-md btn-prime btn-default"},"Click here to design your venue")):i.createElement("h4",null,"Event Ended"),i.createElement("div",{className:"poweredBy"}))}const yo={applyAccessCode:si,validateCodeType:Qa,chartReportsByLabel:Qn,getIsSeatsioChartDrawn:Hn,eventsRelease:Un},go=f=>{var p,e,t,s,n;return{eventDetails:f.event&&f.event.data||f.host&&f.host.eventDetails,hostDesign:(e=(p=f==null?void 0:f.host)==null?void 0:p.eventDetails)==null?void 0:e.eventDesignDetailDto,stripeKey:(s=(t=f==null?void 0:f.event)==null?void 0:t.data)==null?void 0:s.stripeKey,ticketingSettings:(n=f==null?void 0:f.event)==null?void 0:n.ticket_data}},ko=qt(go,yo)(To),bo=mt(()=>Tt(()=>import("./index-CvtoAcCz.js").then(f=>f.Ph),__vite__mapDeps([0,1,2,3,4,5]))),ts=new Map,Eo=(f,p,e)=>`${f||""}|${p||""}|${e||""}`;function Co({eventUrl:f,onBoothSelected:p,onBoothRemoved:e,boothSelected:t,fetchExpoFpBoothPrice:s,releaseExpoFpBooth:n,expoFpConfig:a,selectedBooth:r,currencySymbol:o,availableTicketTypes:d}){var Te,G,L,Z,K;const[c,m]=oe.useState(null),[g,k]=oe.useState(!1),[S,u]=oe.useState(!1),[E,h]=oe.useState(!1),[y,b]=oe.useState(null),[D,P]=oe.useState(!1),C=oe.useRef(null),F=oe.useRef(null),_=oe.useRef(!0),$=oe.useRef(window.location.href),U=oe.useRef(p),A=oe.useRef(t),x=oe.useRef(s),H=oe.useRef(n),q=oe.useRef(null);U.current=p,A.current=t,x.current=s,H.current=n;const N=a==null?void 0:a.eventSlug,V=oe.useMemo(()=>new Set((d||[]).map(R=>{var T;return(T=R==null?void 0:R.typeId)==null?void 0:T.toString()}
2).filter(Boolean)),[d]),J=!(y!=null&&y.ticketTypeId)||V.has(y.ticketTypeId.toString()),W=!!y&&!y.exhibitor&&!y.priceLoading&&!J;oe.useEffect(()=>()=>{_.current=!1},[]),oe.useEffect(()=>{const R=window.location.search;if(!R)return;const T=window.history.pushState,l=window.history.replaceState,O=B=>function(Q,ie,se){if(se&&typeof se=="string")try{const ue=new URL(se,window.location.origin);if(ue.search!==R&&ue.pathname===window.location.pathname)return B.call(this,Q,ie,window.location.pathname+R+ue.hash)}catch{}return B.call(this,Q,ie,se)};return window.history.pushState=O(T),window.history.replaceState=O(l),()=>{window.history.pushState=T,window.history.replaceState=l}},[]),oe.useEffect(()=>{if(!N)return;const R=Da(N),T=g?F.current:C.current;return T&&!T.contains(R.element)&&T.appendChild(R.element),()=>{T&&T.contains(R.element)&&T.removeChild(R.element)}},[g,N]),oe.useEffect(()=>{ci().then(()=>{_.current&&u(!0)}).catch(()=>{_.current&&m("Failed to load floor plan SDK")})},[]);const te=oe.useCallback(async R=>{var ie;if(!R||!f)return;const T=ct((ie=window==null?void 0:window.location)==null?void 0:ie.search),O=await Ke("DISCOUNT_FROM_URL")||await Ke("DISCOUNT_FROM_INTEGRATION")||await Ke("DISCOUNT_FROM_WIDGET")||(T==null?void 0:T.discountCode)||(T==null?void 0:T.couponCode)||null,B=Eo(f,R,O);if(ts.has(B)){const se=ts.get(B);b(ue=>ue&&ue.boothName===R?{...ue,...se,priceLoading:!1}:ue);return}const I=await x.current(f,R,O);if(!_.current)return;if(I!=null&&I.errorMessage){m(I.errorMessage),b(se=>se&&se.boothName===R?{...se,priceLoading:!1}:se);return}const Q={price:I==null?void 0:I.price,discountAmount:I==null?void 0:I.discountAmount,priceAfterDiscount:(I==null?void 0:I.price)==null?null:Number(I.price)>0?Number(I.price)-Number(I.discountAmount||0):Number(I.price),couponApplied:I==null?void 0:I.couponApplied,couponMessage:I==null?void 0:I.couponMessage,ticketTypeId:I==null?void 0:I.ticketTypeId};ts.set(B,Q),b(se=>se&&se.boothName===R?{...se,...Q,priceLoading:!1}:se)},[f]);q.current=te,oe.useEffect(()=>{if(!S||!N||E||!window.ExpoFP)return;const R=Da(N);if(R.instance){h(!0);return}try{R.boothClickCb=T=>{var B;const l=window.location.href;if(!(T!=null&&T.target))return Ct(l),!1;m(null);const O=Ra(T.target);return b({...O,priceLoading:!O.exhibitor}),Ct(l),!O.exhibitor&&O.boothName&&((B=q.current)==null||B.call(q,O.boothName)),!1},R.instance=new window.ExpoFP.FloorPlan({element:R.element,eventId:N,allowConsent:!1,noOverlay:!0,onBoothClick:T=>R.boothClickCb(T)}),h(!0)}catch{_.current&&m("Failed to initialize floor plan")}},[S,N,E]),oe.useEffect(()=>{if(!N)return;const R=Ot(N);R&&(R.boothClickCb=T=>{var B;const l=window.location.href;if(!(T!=null&&T.target))return Ct(l),!1;m(null);const O=Ra(T.target);return b({...O,priceLoading:!O.exhibitor}),Ct(l),!O.exhibitor&&O.boothName&&((B=q.current)==null||B.call(q,O.boothName)),!1})});const j=oe.useCallback(()=>{var R;if(m(null),b(null),k(!0),r!=null&&r.boothName){const T=Ot(N);(R=T==null?void 0:T.instance)!=null&&R.selectBooth&&setTimeout(()=>{T.instance.selectBooth(r.boothName)},300)}},[N,r]),v=oe.useCallback(()=>{var l;const R=window.location.href,T=Ot(N);(l=T==null?void 0:T.instance)!=null&&l.selectBooth&&T.instance.selectBooth(""),Ct(R)},[N]),M=oe.useCallback(()=>{k(!1),b(null),v()},[v]),de=oe.useCallback(()=>{y&&(D||(P(!0),A.current(f,y.boothName,y.ticketTypeId??null).then(R=>{var T;if(_.current)if(P(!1),R&&!(R!=null&&R.errorMessage)){const l=Number(y.discountAmount||0),O=Number(y.price),B=y.priceAfterDiscount!=null?Number(y.priceAfterDiscount):O>0?O-l:O;(T=U.current)==null||T.call(U,{...R,boothName:y.boothName,boothSize:y.size,ticketTypeId:y.ticketTypeId??(R==null?void 0:R.ticketTypeId)??null,price:y.price!=null?y.price:R==null?void 0:R.price,priceAfterDiscount:B,discountAmount:y.discountAmount}),b(null),k(!1),v()}else m((R==null?void 0:R.errorMessage)||"Failed to process booth selection")})))},[y,f,v,D]),ke=oe.useCallback(()=>{b(null),v()},[v]),fe=oe.useCallback(()=>{var l,O,B,I;const R=$.current,T=Ot(N);T!=null&&T.instance&&((O=(l=T.instance).selectBooth)==null||O.call(l,""),(I=(B=T.instance).reset)==null||I.call(B)),setTimeout(()=>{window.history.replaceState(null,"",R)},100),r!=null&&r.boothName&&H.current(f,r.boothName),e==null||e()},[N,e,f,r]);return oe.useEffect(()=>{if(!y||!g)return;const R=T=>{T.target.closest(".expofp-booth-detail")||ke()};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[y,g,ke]),i.createElement("div",{className:"expofp-booth-selector"},r?i.createElement("div",{className:"expofp-booth-selected-card"},i.createElement("div",{ref:C,className:"expofp-booth-selected-card__map"}),i.createElement("div",{className:"expofp-booth-selected-card__map-block"}),i.createElement("div",{className:"expofp-booth-selected-card__gradient"}),i.createElement("div",{className:"expofp-booth-selected-card__bottom"},i.createElement("div",{className:"expofp-booth-selected-card__info"},i.createElement(ee,{header:r.boothName,variant:"heading4"}),i.createElement("div",{className:"expofp-booth-selected-card__details"},i.createElement("span",null,r.boothName),r.boothSize&&i.createElement(i.Fragment,null,i.createElement("span",{className:"expofp-booth-selected-card__dot"}),i.createElement("span",null,r.boothSize)),(r.priceAfterDiscount!=null||r.price!=null)&&i.createElement(i.Fragment,null,i.createElement("span",{className:"expofp-booth-selected-card__dot"}),i.createElement("span",null,`${o||"$"}${(()=>{const R=Number(r.price);return R>0?(R-Number(r.discountAmount||0)).toFixed(2):R.toFixed(2)})()}`)))),i.createElement("div",{className:"expofp-booth-selected-card__actions"},i.createElement(Ee,{id:"expofp-change-booth-btn",label:"Change Booth",variant:"primary",onClick:j}),i.createElement(Ee,{id:"expofp-remove-booth-btn",label:"Remove",variant:"secondary",onClick:fe})))):i.createElement("div",{className:"expofp-booth-inline-map"},i.createElement("div",{ref:C,className:"expofp-booth-inline-map__canvas"}),!E&&i.createElement("div",{className:"expofp-booth-map-loading"},i.createElement(nt,{type:"SpinnerSmall"})),i.createElement("div",{className:"expofp-booth-inline-map__overlay"},i.createElement("div",{className:"expofp-booth-inline-map__overlay-text"},i.createElement("div",{className:"expofp-booth-inline-map__overlay-icon"},i.createElement(_e,{size:"XXLarge",svgIcon:"expofp-booth-pin-icon",width:"40",height:"40",viewBox:"0 0 40 40"})),i.createElement(ee,{header:"Select your booth from the floor plan",variant:"heading3"}),i.createElement(ee,{header:"View available booths, compare sizes and locations, and select your booth.",variant:"caption2",color:"var(--ae-color-neutral-700)"})),i.createElement(Ee,{id:"expofp-select-booth-btn",label:"Select Booth",variant:"primary",size:"medium",className:"expofp-select-booth-cta",onClick:j,loading:!S,disabled:!S}))),i.createElement(bo,{id:"expofp-booth-modal",showModal:g,isCustomHeader:!0,headerText:i.createElement("div",{className:"expofp-booth-modal-header"},i.createElement("h2",{className:"ae-subtitle justify-content-center m-0"},"Select your booth"),c&&i.createElement("div",{className:"expofp-booth-modal-error"},i.createElement(ee,{header:c,variant:"caption2",color:"var(--ae-color-danger-800)"}))),onCloseFunc:M,custClassName:"expofp-booth-modal-dialog",type:"style2"},i.createElement("div",{className:"expofp-booth-modal-body"},i.createElement("div",{ref:F,className:"expofp-booth-modal-map"}),!E&&i.createElement("div",{className:"expofp-booth-map-loading"},i.createElement(nt,{type:"SpinnerSmall"})),y&&i.createElement("div",{className:"expofp-booth-detail"},i.createElement("div",{className:"expofp-booth-detail__header"},i.createElement("div",{className:"expofp-booth-detail__header-title"},i.createElement(ee,{header:((Te=y.exhibitor)==null?void 0:Te.name)||y.name,variant:"heading4"}),y.exhibitor&&y.type&&i.createElement("span",{className:"expofp-booth-detail__type-badge"},y.type)),i.createElement("button",{type:"button",id:"expofp-reserve-close-btn",className:"expofp-booth-detail__close",onClick:ke},i.createElement(_e,{svgIcon:"ac-icon-close",viewBox:"0 0 512 512",width:"16",height:"16"}
2))),i.createElement("div",{className:"expofp-booth-detail__content"},y.exhibitor?i.createElement(i.Fragment,null,(y.name||((G=y.categories)==null?void 0:G.length)>0)&&i.createElement("div",{className:"expofp-booth-detail__tags"},y.name&&i.createElement("span",{className:"expofp-booth-detail__location-tag"},i.createElement(_e,{svgIcon:"expofp-location-icon",width:"14",size:"ex-small",height:"14",viewBox:"0 0 16 16"}),y.name),(L=y.categories)==null?void 0:L.map(R=>i.createElement("span",{key:R,className:"expofp-booth-detail__category-tag"},R))),y.exhibitor.leadingImageUrl&&i.createElement("img",{src:y.exhibitor.leadingImageUrl,alt:"",className:"expofp-booth-detail__exhibitor-banner"}),y.exhibitor.description&&i.createElement("div",{className:"expofp-booth-detail__exhibitor-desc",dangerouslySetInnerHTML:{__html:ba.sanitize(y.exhibitor.description)}}),(y.exhibitor.email||y.exhibitor.phone)&&i.createElement("div",{className:"expofp-booth-detail__contact"},y.exhibitor.email&&i.createElement("div",{className:"expofp-booth-detail__contact-row"},i.createElement("div",{className:"expofp-booth-detail__contact-icon"},i.createElement(_e,{svgIcon:"expofp-mail-icon",width:"16",height:"16",viewBox:"0 0 16 16"})),i.createElement("a",{href:`mailto:${y.exhibitor.email}`},y.exhibitor.email)),y.exhibitor.phone&&i.createElement("div",{className:"expofp-booth-detail__contact-row"},i.createElement("div",{className:"expofp-booth-detail__contact-icon"},i.createElement(_e,{svgIcon:"expofp-phone-icon",width:"16",height:"16",viewBox:"0 0 16 16"})),i.createElement("a",{href:`tel:${y.exhibitor.phone}`},y.exhibitor.phone))),(()=>{const R=y.exhibitor,T=[R.facebook&&{title:"facebook",url:R.facebook,message:"Facebook"},R.twitter&&{title:"twitter",url:R.twitter,message:"Twitter"},R.linkedin&&{title:"linkedIn",url:R.linkedin,message:"LinkedIn"},R.instagram&&{title:"instagram",url:R.instagram,message:"Instagram"}].filter(Boolean);return T.length>0?i.createElement(Vn,{data:T,isUserSocialLink:!0,newThemeDesign:!0,rootClassName:"expofp-booth-detail__exhibitor-social"}):null})()):i.createElement(i.Fragment,null,(y.type||y.size||y.price!=null||y.priceLoading)&&i.createElement("div",{className:"expofp-booth-detail__info-card"},y.type&&i.createElement("div",{className:"expofp-booth-detail__info-row"},i.createElement(ee,{header:"Booth type",variant:"caption2",color:"var(--ae-color-neutral-700)"}),i.createElement(ee,{header:y.type,variant:"subtitle2"})),y.size&&i.createElement("div",{className:"expofp-booth-detail__info-row"},i.createElement(ee,{header:"Size",variant:"caption2",color:"var(--ae-color-neutral-700)"}),i.createElement(ee,{header:y.size,variant:"subtitle2"})),(y.priceAfterDiscount!=null||y.priceLoading)&&i.createElement("div",{className:"expofp-booth-detail__info-row"},i.createElement(ee,{header:"Price",variant:"caption2",color:"var(--ae-color-neutral-700)"}),y.priceLoading?i.createElement(nt,{type:"SpinnerExtraSmall"}):i.createElement(ee,{header:`${o||"$"}${(()=>{const R=Number(y.price);return R>0?R-Number(y.discountAmount||0):R})()}`,variant:"subtitle2"}))),y.description&&i.createElement("div",{className:"expofp-booth-detail__description",dangerouslySetInnerHTML:{__html:ba.sanitize(y.description)}}),W&&i.createElement("div",{className:"expofp-booth-detail__unavailable-msg m-t-12"},i.createElement(ee,{header:be.t("common:ExpoFp.boothUnavailable"),variant:"caption2",color:"var(--ae-color-danger-800)"})))),i.createElement("div",{className:"expofp-booth-detail__actions"},y.exhibitor||W?i.createElement(Ee,{id:"expofp-not-available-btn",label:"Not Available",variant:"secondary",size:"medium",className:"expofp-booth-detail__reserve-btn expofp-booth-detail__not-available-btn",disabled:!0}):i.createElement(Ee,{id:"expofp-reserve-select-btn",label:y.onHold&&((Z=a==null?void 0:a.heldBooths)!=null&&Z.includes(y.name))?"On Hold":"Select",variant:"primary",size:"medium",className:"expofp-booth-detail__reserve-btn",onClick:de,loading:y.priceLoading||D,disabled:y.onHold&&((K=a==null?void 0:a.heldBooths)==null?void 0:K.includes(y.name))||y.priceLoading||D}))))))}const Ao={boothSelected:li,fetchExpoFpBoothPrice:ri,releaseExpoFpBooth:oi},So=qt(null,Ao)(Co),ys=class ys extends i.Component{render(){var g,k,S,u,E,h,y,b,D,P;const{item:p,key:e,donationAmounts:t,totalTickets:s,eventDetails:n,donationInputValue:a,handleDonationAmount:r,isHost:o,isFromStaff:d,widget:c,borders:m}=this.props;return i.createElement(i.Fragment,null,i.createElement("div",{className:`donation-amount ${(o||d)&&"p-l-15"}`,key:e},i.createElement("div",{key:p.typeId.toString(),className:"m-b-25 tickets-details donation",style:{border:m&&`1px solid ${m}`}},i.createElement("div",{className:"d-flex justify-space-between m-b-12 mw-100"},i.createElement(ee,{variant:"heading4",color:(k=ce[(g=this.context)==null?void 0:g.theme])==null?void 0:k.neutral1000,labelClass:"m-b-0"},p.name),w(p.startDate).diff(w())>=0&&i.createElement(Ee,{className:"ticket-available-on",id:"donationTicketAvailable"},be.t("checkoutDetails:Available"),i.createElement("br",null)," ",`${w(p.startDate).format("ddd, D MMM")}`,i.createElement("br",null)," ",w(p.startDate).format("h:mm a")),w(p.endDate).diff(w())<=0&&i.createElement(Ee,{className:"sold-out-end-btn cursor-default",size:"normal",id:"donationTicketEnded"},be.t("common:Ended"))),i.createElement(ee,{labelClass:"line-break-word m-b-24",variant:"body2",color:(u=ce[(S=this.context)==null?void 0:S.theme])==null?void 0:u.neutral700,className:"",header:i.createElement("div",{dangerouslySetInnerHTML:{__html:p==null?void 0:p.ticketTypeDescription}})}),i.createElement("div",{className:"donation-ticket"},i.createElement("div",{className:pe("d-flex",c||d?"flex-column":"flex-lg-column flex-column flex-xl-row flex-md-row ")},i.createElement("div",null,i.createElement(ee,{labelClass:pe("m-b-0",w(p.endDate).diff(w())<=0&&"label-disabled"),variant:"body2",color:(h=ce[(E=this.context)==null?void 0:E.theme])==null?void 0:h.neutral850,className:"donation-label"},be.t("checkoutDetails:Choose amount")),i.createElement("div",{className:pe("d-flex amount-block mb-0 mb-lg-3 mb-xl-0 mb-md-0 mb-3",(c||d)&&"m-b-16")},t?t.map((C,F)=>i.createElement("div",{className:"amount-div",key:F},i.createElement(Ee,{id:"donationPrice",variant:pe(s&&s[p.typeId]&&s[p.typeId].price&&parseInt(s[p.typeId].price,10)===C?"primary":"secondary"),onClick:()=>r(C,p),disabled:w(p.endDate).diff(w())<=0||w(p.startDate).diff(w())>=0},i.createElement("span",{className:pe(s&&s[p.typeId]&&s[p.typeId].price&&parseInt(s[p.typeId].price,10)===C?"mr-1":"color-prime mr-1")},n.currencySymbol),Ue(C)))):"")),i.createElement("div",{className:pe("input-group donation-amount-placeholder",(w(p.endDate).diff(w())<=0||w(p.startDate).diff(w())>=0)&&"disable-currencySymbol")},i.createElement(ee,{labelClass:pe("m-b-0",w(p.endDate).diff(w())<=0&&"label-disabled"),variant:"body2",color:(b=ce[(y=this.context)==null?void 0:y.theme])==null?void 0:b.neutral850,disabled:!0,className:pe("donation-label")},be.t("checkoutDetails:Or donate different amount")),i.createElement(et,{type:"number",id:"donationAmount",name:p.typeId,className:"enter-donation-amount",min:"0","data-fee":p.fee,"data-name":p.name,"data-
2passFeesToBuyer":p.passFeesToBuyer,value:a[p.typeId]||!(a!=null&&a.length)&&(s==null?void 0:s.length)!==0&&((D=s[p.typeId])==null?void 0:D.numberofticket)&&((P=s[p.typeId])==null?void 0:P.individualPrice),disabled:w(p.endDate).diff(w())<=0||w(p.startDate).diff(w())>=0,placeholder:be.t("common:Enter amount"),onChange:C=>r(C.target.value,p),withIcon:!0,symbol:n.currencySymbol})))))))}};ys.contextType=hs;let ds=ys;const vo=Va(["common","checkoutDetails"])(ds),Ua=()=>{const f=navigator.userAgent||navigator.vendor||window.opera;return f.indexOf("Instagram")>-1||f.indexOf("FBAN")>-1||f.indexOf("FBAV")>-1},ss=mt(()=>Tt(()=>import("./index-CvtoAcCz.js").then(f=>f.Pk),__vite__mapDeps([0,1,2,3,4,5]))),No=mt(()=>Tt(()=>import("./index-C0GDqtfM.js"),__vite__mapDeps([6,0,1,2,3,4,5,7]))),Ha=mt(()=>Tt(()=>import("./index-CvtoAcCz.js").then(f=>f.Ph),__vite__mapDeps([0,1,2,3,4,5]))),Io=mt(()=>Tt(()=>import("./CustomTicketPurchaseComplete-Be04LVjT.js"),__vite__mapDeps([8,1,0,2,3,4,5,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81])));let as=null;const Do={},is=[{label:be.t("common:Cash or Check"),value:"CASH",icon:"ac-icon-cash",width:"21",height:"14",viewBox:"0 0 21 14"},{label:be.t("common:Credit Card"),value:"CC",icon:"ac-creditCard-icon",width:"20",height:"16",viewBox:"0 0 20 16"},{label:be.t("common:Complimentary"),value:"COMPLIMENTARY",icon:"ac-icon-complimentary",width:"20",height:"20",viewBox:"0 0 20 20"},{label:be.t("common:Unpaid"),value:"UNPAID",icon:"ac-icon-unpaid",width:"20",height:"18",viewBox:"0 0 20 18"},{label:be.t("common:Invoice"),value:"INVOICE",icon:"ac-icon-unpaid",width:"20",height:"18",viewBox:"0 0 20 18"},{label:be.t("common:Pay Minimum"),value:"DEPOSIT",icon:"ac-icon-unpaid",width:"20",height:"18",viewBox:"0 0 20 18"}];let ns=0,os=0,at=null,St=[],xe=[],Mt=[],_t=!1,rs=!1;Le.locale("en");const Ro=Cn(Le),gs=class gs extends i.Component{constructor(p){super(p),this.handleTicketSelectRef=e=>{if(!e)return;this.scheduleMenuPlacementUpdate();const t=e.select&&e.select.controlRef||e.controlRef;t&&!t.__aeMenuPlacementBound&&(t.__aeMenuPlacementBound=!0,t.addEventListener("mousedown",this.updateMenuPlacements,!0))},this.scheduleMenuPlacementUpdate=()=>{this.menuPlacementRaf||typeof window>"u"||(this.menuPlacementRaf=window.requestAnimationFrame(()=>{this.menuPlacementRaf=null,this.updateMenuPlacements()}))},this.updateMenuPlacements=()=>{if(typeof document>"u")return;const e=document.querySelector(".bottom-footer"),t=e?e.getBoundingClientRect():null,n=!!t&&t.height>0&&t.bottom>0?t.top:window.innerHeight,a=300,r={};document.querySelectorAll(".tickets-select-box").forEach(g=>{var y;const k=(y=g.querySelector("input[id]"))==null?void 0:y.id,S=g.querySelector(".ae_select__control")||g;if(!k)return;const u=S.getBoundingClientRect(),E=n-u.bottom,h=u.top;E<a&&h>E&&(r[k]=!0)});const o=this.state.menuPlaceTopMap||{},d=Object.keys(o),c=Object.keys(r);(d.length!==c.length||c.some(g=>!o[g]))&&this.setState({menuPlaceTopMap:r})},this.applyCalculateFee=(e,{notifyParent:t=!1,useStoredDiscountCode:s=!0}={})=>{var N,V;const{totalTickets:n,totalDonationSalesTaxFee:a,totalDonationVatTaxFee:r,allTicketForPayLater:o,isDepositEnabled:d,paymentType:c,selectedSeats:m}=this.state,{doCalculateTicketFees:g,eventDetails:k,isHost:S,isFromStaff:u,waitListIds:E}=this.props,{eventUrl:h,eventURL:y}=k||{};let b=0,D=0,P=0,C=0,F=0,_=0;const $={...this.props.ticketSavings};let U,A=0,x=0,H=0;this.calcFeeReqId=(this.calcFeeReqId||0)+1;const q=this.calcFeeReqId;g(h||y,e,this.props.exhibitorId,s?(N=this.state.appliedDiscountCode)==null?void 0:N.code:null,(V=this.props.existingOrderDetails)==null?void 0:V.existingOrderId).then(J=>{if(q!==this.calcFeeReqId)return;J&&J.data&&(U=Na(J.data));const W=n.filter(te=>te).map(te=>parseInt(te==null?void 0:te.numberofticket,10)).reduce((te,j)=>te+j,0);n.map((te,j)=>{const v=Me(U,{ticketingTypeId:parseInt(te==null?void 0:te.tickettypeid,10)})||[],{vatTaxFee:M=0,aeFees:de=0,salesTaxFee:ke=0,totalTicketsPrice:fe=0,ccFees:Te=0,wlBFee:G=0,wlAFee:L=0,totalDepositAmount:Z=0,ticketQuantity:K=0,totalPayable:R=0,discountedPrice:T=0,discountedQuantity:l=0,discountAmount:O=0,couponDiscountAmount:B=0}=v[0]||{};O?$[te==null?void 0:te.tickettypeid]=O:delete $[te==null?void 0:te.tickettypeid],n[j].vatTax=M,n[j].discountedPrice=T,n[j].discountedQuantity=l,n[j].discountAmount=O,n[j].ticketQuantity=K,n[j].totalTicketsPrice=fe;const I=R,Q=(te==null?void 0:te.payLater)&&c==="INVOICE";n[j].totalPayable=Q?R-M-ke:R,d||Q?b=K*(de+ke+L+G+Te)+M:b=I-fe+B;const se=b&&parseFloat(b)>0?b:0;A+=Z,Z>0?x+=Z:x+=fe,x+=se,H+=Z>0?Math.max(0,fe-Number(B||0)-Z):0,n[j].totalDepositAmount=Z,n[j].totalTicketsPrice=fe,D+=fe,C+=se,P+=parseInt(te==null?void 0:te.numberofticket,10),n[j].fee=se,n[j].totalPayable=Q?R-M-ke:R,_+=ke,F+=M;const ue=(U||[]).reduce((ae,Y)=>ae+Number((Y==null?void 0:Y.couponDiscountAmount)||0),0);clearTimeout(this.feeCommitTimeout),this.feeCommitTimeout=setTimeout(()=>{var ae,Y;q===this.calcFeeReqId&&(Ia(U,this.state.selectedExpoBooth),this.setState({totalTickets:n,totalTicketQty:P,totalTicketPrice:D,totalTicketFee:C,totalNumberOfTickets:W,totalSalesTaxFee:_,totalDonationSalesTaxFee:a,totalDonationVatTaxFee:r,ticketingFeeData:U,allTicketForPayLater:o,totalVatFee:F,totalDepositAmount:A,finalAmountWithDeposit:x,couponSavings:ue,PostDepositBalance:H}
2),(Y=(ae=this.props).onUpdateTicketSavings)==null||Y.call(ae,$),t&&!S&&!u&&!E&&(this.props.onHandelChangeCallBack(n,P,D,C,m,W,parseFloat(F).toFixed(2),parseFloat(_).toFixed(2),parseFloat(a).toFixed(2),parseFloat(r).toFixed(2),U),this.props.storeBuyTicketList(n)))},100)})})},this.setCalculationFee=e=>{const{totalTickets:t,isDepositEnabled:s,paymentType:n,selectedExpoBooth:a}=this.state,r=[];this.refreshDiscountRuleIdMap(t);const o=t.map(d=>{var k,S;if(!d)return d;const c={...d},m=(k=this.discountRuleIdMap)==null?void 0:k[c.tickettypeid];m?c.ruleId=m:delete c.ruleId;const g=(S=this.limitQuantityRuleIdMap)==null?void 0:S[c.tickettypeid];return g?c.limitQuantityRuleId=g:delete c.limitQuantityRuleId,c});o.map(d=>{const c=(a==null?void 0:a.ticketTypeId)&&Number(d==null?void 0:d.tickettypeid)===Number(a.ticketTypeId),m=c?Number(a.price):0,g=c?m>0?m-Number(a.discountAmount||0):m:Number(d==null?void 0:d.price),k={ticketQuantity:Number(d==null?void 0:d.numberofticket),ticketingTypeId:Number(d==null?void 0:d.tickettypeid),ticketPrice:g,payLater:n==="INVOICE"?d.payLater:!1,depositPayment:s,ruleId:d==null?void 0:d.ruleId,limitQuantityRuleId:d.limitQuantityRuleId};r.push(k)}),this.setState({totalTickets:o},()=>{this.applyCalculateFee(r,e)})},this.isTicketAvailabelOnTicketTypeList=e=>{const{settings:t,addonTicketData:s}=this.state;return[...(t==null?void 0:t.ticketTypes)||[],...s||[]].findIndex(a=>{var r,o;return((r=a==null?void 0:a.typeId)==null?void 0:r.toString())===((o=e==null?void 0:e.tickettypeid)==null?void 0:o.toString())})===-1},this.isAssosiatedTicketisAvailableForAddon=(e,t,s,n=[])=>{var c,m,g;if((e==null?void 0:e.tickettypeid)===t)return!1;const r=[...((c=this.state.settings)==null?void 0:c.ticketTypes)||[],...this.state.addonTicketData||[]].find(k=>{var S;return(k==null?void 0:k.dataType)==="ADDON"&&((S=k==null?void 0:k.typeId)==null?void 0:S.toString())===e.tickettypeid}),o=(m=r==null?void 0:r.listOfTicketTypesForAddOn)==null?void 0:m.includes(parseInt(t,10)),d=(g=n==null?void 0:n.filter(k=>(k==null?void 0:k.tickettypeid)!==t&&(k==null?void 0:k.tickettypeid)!==(e==null?void 0:e.tickettypeid)))==null?void 0:g.some(k=>{var S;return(S=r==null?void 0:r.listOfTicketTypesForAddOn)==null?void 0:S.includes(parseInt(k.tickettypeid,10))});return o&&s<1&&!d},this.addSelectedRegistrationTicket=(e,t,s,n,a,r,o=[],d=[],c=[],m=0,g=0,k,S=!1)=>{this.ticketCallGenerations[e]=(this.ticketCallGenerations[e]||0)+1;const u=this.ticketCallGenerations[e];let E=this.state.totalRegRequestTickets?this.state.totalRegRequestTickets.slice():[];const{isHost:h,isFromStaff:y,waitListIds:b,ticketingSettings:D}=this.props,{settings:P}=this.state,{ticketTypes:C,categories:F}=P||D||{},_=C==null?void 0:C.find(v=>{var M;return((M=v==null?void 0:v.typeId)==null?void 0:M.toString())===(e==null?void 0:e.toString())}),$=(_==null?void 0:_.dataType)==="ADDON"?F==null?void 0:F.find(v=>(v==null?void 0:v.id)===(_==null?void 0:_.categoryId)):{},U=(_==null?void 0:_.dataType)==="ADDON"&&!($!=null&&$.havingVariations)?$==null?void 0:$.position:_==null?void 0:_.position,A=this,x=a,H=s*x;E[e]={price:s,individualPrice:H,tickettypeid:e,numberofticket:x,seatNumbers:o,seatNumbersDisplay:d,name:t,isDonation:n,tableNumber:c,salesTax:m,vatTax:g,passFeesToBuyer:k,payLater:S,position:U,dataType:_==null?void 0:_.dataType,ticketType:_==null?void 0:_.ticketType,minTickerPerBuyer:_==null?void 0:_.minTickerPerBuyer,registrationApprovalRequired:_==null?void 0:_.registrationApprovalRequired},c&&c.length&&(E[e].tableNumber=[],E[e].tableNumber=c);let q=0,N=0;const V={...this.props.ticketSavings};vt(E,v=>v&&(v.numberofticket<1||this.isTicketAvailabelOnTicketTypeList(v)));const J=[];Be(E,v=>{v&&(J[v.tickettypeid]=v)}),E=J;const te=E.filter(v=>(v==null?void 0:v.price)!=="0").every(v=>v==null?void 0:v.payLater);E.map((v,M)=>{const de=parseFloat(v.price)*parseInt(v.numberofticket,10);n&&v.isDonation?N+=v.numberofticket?parseInt(v.numberofticket,10):0:N+=parseInt(v.numberofticket,10),q+=de,E[M].fee=0,E[M].vatTax=0,E[M].discountedPrice=0,E[M].discountedQuantity=0,E[M].discountAmount=0,E[M].ticketQuantity=parseInt(v.numberofticket,10),E[M].totalTicketsPrice=de});const j=E.map(v=>parseInt(v.numberofticket,10)).reduce((v,M)=>v+M,0);this.TempTimeout=setTimeout(()=>{var v,M;this.ticketCallGenerations[e]===u&&(A.setState({totalRegRequestTickets:E,totalRegRequestTicketQty:N,totalRegRequestTicketPrice:q,totalNumberOfRegRequestTickets:j,allTicketForPayLater:te}),!h&&!y&&!b&&(A.props.onHandleRequestChangeCallBack(E,N,q,0,j),(M=(v=A.props).onUp
2dateTicketSavings)==null||M.call(v,V)),A.props.storeRegRequestTicketList(E),A.recalculateNormalTicketsIfDiscountChanged(E))},100)},this.addDonation=(e,t,s,n,a,r,o=[],d=[],c=[],m=0,g=0,k,S=!1,u=!1,E=void 0,h=void 0)=>{var he,Ne,Ie,Oe,He;this.ticketCallGenerations[e]=(this.ticketCallGenerations[e]||0)+1;const y=this.ticketCallGenerations[e],{selectedSeats:b,addonTicketData:D,paymentType:P}=this.state;let C=this.state.totalTickets?this.state.totalTickets.slice():[];const{isHost:F,isFromStaff:_,eventDetails:$,waitListIds:U,t:A,isRegApproval:x,isFromWaitlist:H,ticketingSettings:q,isOnBording:N,eventData:V}=this.props,{settings:J}=this.state,{ticketTypes:W,categories:te}=J||q||{},{eventUrl:j,eventURL:v}=$||{},M=[...W||[],...D||[]].find(z=>{var Ce;return((Ce=z==null?void 0:z.typeId)==null?void 0:Ce.toString())===(e==null?void 0:e.toString())});if(M!=null&&M.registrationApprovalRequired&&N&&!(this.props.isHost||this.props.isFromStaff))return this.addSelectedRegistrationTicket(e,t,s,n,a,r,o,d,c,m,g,k,S),this.pendingAddDonationPromise=Promise.resolve(),this.pendingAddDonationPromise;const de=(M==null?void 0:M.dataType)==="ADDON"?te==null?void 0:te.find(z=>(z==null?void 0:z.id)===(M==null?void 0:M.categoryId)):{},ke=(M==null?void 0:M.dataType)==="ADDON"&&!(de!=null&&de.havingVariations)?de==null?void 0:de.position:M==null?void 0:M.position,fe=this,Te=a,G=s*Te;C[e]={price:s,individualPrice:G,tickettypeid:e,numberofticket:Te,seatNumbers:o,seatNumbersDisplay:d,name:t,isDonation:n,tableNumber:c,salesTax:m,vatTax:g,passFeesToBuyer:k,payLater:S,position:ke,dataType:M==null?void 0:M.dataType,ticketType:M==null?void 0:M.ticketType,requireDepositAmount:M==null?void 0:M.requireDepositAmount,isAddonSelectedAsDefault:u,minTickerPerBuyer:E!==void 0?E:M==null?void 0:M.minTickerPerBuyer,maxTickerPerBuyer:h!==void 0?h:M==null?void 0:M.maxTickerPerBuyer,addonType:M==null?void 0:M.addonType,ticketsPerTable:(M==null?void 0:M.ticketsPerTable)||1},c&&c.length&&(C[e].tableNumber=[],C[e].tableNumber=c);let L=0,Z=0,K=0,R=0,T=0;const l={...this.props.ticketSavings};let O=0,B=0,I=0;vt(C,z=>z&&!this.autoAddedTicketIds.has(Number(z.tickettypeid??z.ticketTypeId??z.typeId))&&(z.numberofticket<1||this.isTicketAvailabelOnTicketTypeList(z)||this.isAssosiatedTicketisAvailableForAddon(z,e,a,C)));const Q=[];if(Be(C,z=>{z&&(Q[z.tickettypeid]=z)}),C=Q,this.refreshDiscountRuleIdMap(C),C.forEach(z=>{var ne,ge;if(!z)return;const Ce=(ne=this.discountRuleIdMap)==null?void 0:ne[z.tickettypeid];Ce?z.ruleId=Ce:z!=null&&z.ruleId&&delete z.ruleId;const le=(ge=this.limitQuantityRuleIdMap)==null?void 0:ge[z.tickettypeid];le?z.limitQuantityRuleId=le:z!=null&&z.limitQuantityRuleId&&delete z.limitQuantityRuleId}),(M==null?void 0:M.dataType)!=="ADDON"&&(M==null?void 0:M.dataType)!=="Donation"&&Te>0){const z=(Ne=(he=J||q)==null?void 0:he.ticketTypes)==null?void 0:Ne.filter(le=>(le==null?void 0:le.dataType)==="ADDON"),Ce=(Ie=z==null?void 0:z.filter(le=>{var ne;return(ne=le==null?void 0:le.listOfTicketTypesForAddOn)==null?void 0:ne.includes(M==null?void 0:M.typeId)}))==null?void 0:Ie.filter(le=>
2{const ne=w(le.startDate).diff(w())<0&&w(le.endDate).diff(w())>=0;return(le==null?void 0:le.minTickerPerBuyer)>0&&(le==null?void 0:le.minTickerPerBuyer)<=(le==null?void 0:le.remaniningTickets)&&ne});Ce!=null&&Ce.length&&Ce.forEach(le=>{var ve;const ne=(ve=le==null?void 0:le.typeId)==null?void 0:ve.toString();if(!(C==null?void 0:C.some(Pe=>(Pe==null?void 0:Pe.tickettypeid)===ne))){const Pe=le.minTickerPerBuyer;C[ne]={price:le.price,individualPrice:le.price*Pe,tickettypeid:ne,numberofticket:Pe,seatNumbers:[],seatNumbersDisplay:[],name:le.name,isDonation:!1,tableNumber:[],salesTax:le.salesTax||0,vatTax:le.vatTax||0,passFeesToBuyer:le.passFeesToBuyer,payLater:le.payLater||!1,position:le.position,dataType:le.dataType,ticketType:le.ticketType,requireDepositAmount:le.requireDepositAmount,isAddonSelectedAsDefault:!0,minTickerPerBuyer:le.minTickerPerBuyer,maxTickerPerBuyer:le.maxTickerPerBuyer}}})}const ie=new Set(C.filter(Boolean).map(z=>String(z.tickettypeid)));Object.keys(l).forEach(z=>{ie.has(String(z))||delete l[z]});const se=[],ae=C.filter(z=>(z==null?void 0:z.price)!=="0").every(z=>z==null?void 0:z.payLater),Y=C==null?void 0:C.some(z=>(z==null?void 0:z.payLater)&&!(z!=null&&z.requireDepositAmount)),me=(x||H)&&(V==null?void 0:V.paymentGateway)!=="PAYFLOW"?C==null?void 0:C.some(z=>z==null?void 0:z.requireDepositAmount):!1;C.forEach(z=>{if(!z)return;const Ce={ticketQuantity:Number(z.numberofticket),ticketingTypeId:Number(z.tickettypeid),ticketPrice:Number(z.price),payLater:P==="INVOICE"?z.payLater:!1,depositPayment:me,ruleId:z.ruleId,limitQuantityRuleId:z.limitQuantityRuleId};se.push(Ce)});let re;this.setDisableContinue(!0);const Se=((Oe=this.state.appliedDiscountCode)==null?void 0:Oe.code)||null;return this.pendingAddDonationPromise=this.props.doCalculateTicketFees(j||v,se,this.props.exhibitorId,Se,(He=this.props.existingOrderDetails)==null?void 0:He.existingOrderId).then(z=>{var ne;z&&z.data&&(re=Na(z.data));const Ce=!!Se&&Se!==((ne=this.state.appliedDiscountCode)==null?void 0:ne.code);C.forEach((ge,ve)=>{if(!ge)return;const Pe=Me(re,{ticketingTypeId:parseInt(ge==null?void 0:ge.tickettypeid,10)}),{vatTaxFee:Xe=0,aeFees:Ae=0,salesTaxFee:De=0,totalTicketsPrice:we=0,ccFees:Ge=0,wlBFee:Nt=0,wlAFee:We=0,totalDepositAmount:Re=0,ticketQuantity:It=0,totalPayable:yt=0,discountedPrice:Dt=0,discountAmount:rt=0,discountedQuantity:$t=0,setPriceRuleApplied:gt=!1,setPrice:Gt=0,couponDiscountAmount:kt=0}=Pe[0]||{};rt?l[ge.tickettypeid]=rt:delete l[ge.tickettypeid];const Rt=(ge==null?void 0:ge.payLater)&&P==="INVOICE";me||Rt?L=It*(Ae+De+We+Nt+Ge)+Xe:L=yt-we+kt;const bt=L&&parseFloat(L)>0?L:0;O+=Re,Re>0?B+=Re:B+=we,B+=bt,I+=Re>0?Math.max(0,we-Number(kt||0)-Re):0,C[ve].totalDepositAmount=Re,C[ve].totalPayable=Rt?yt-Xe-De:yt,C[ve].discountedPrice=Dt,C[ve].discountedQuantity=$t,C[ve].discountAmount=rt,C[ve].ticketQuantity=It,C[ve].totalTicketsPrice=we,gt&&(C[ve].setPriceRuleApplied=gt,C[ve].setPrice=Gt),Z+=we,K+=bt,n&&ge.isDonation&&(Pe==null||Pe.map(Fe=>{(Fe==null?void 0:Fe.salesTaxFee)>0?ns=Fe==null?void 0:Fe.salesTaxFee:os=Fe==null?void 0:Fe.vatTaxFee})),C[ve].fee=bt,C[ve].vatTax=Xe}),re==null||re.map(ge=>T+=ge==null?void 0:ge.salesTaxFee),re==null||re.map(ge=>R+=ge==null?void 0:ge.vatTaxFee),Ce&&(re=(re||[]).map(ge=>ge!=null&&ge.couponDiscountAmount?{...ge,couponDiscountAmount:0}:ge));const le=(re||[]).reduce((ge,ve)=>ge+Number((ve==null?void 0:ve.couponDiscountAmount)||0),0);return Ia(re,this.state.selectedExpoBooth),new Promise(ge=>{if(this.ticketCallGenerations[e]!==y){this.setDisableContinue(!1),ge();return}const ve=fe.state.totalTickets||[];ve.forEach((Ae,De)=>{var we,Ge;if(String(De)!==String(e)){if(Ae&&Number(Ae.numberofticket||0)>0&&Number(Te)<1&&Ae.dataType==="ADDON"){const We=[...((we=fe.state.settings)==null?void 0:we.ticketTypes)||[],...fe.state.addonTicketData||[]].find(Re=>(Re==null?void 0:Re.dataType)==="ADDON"&&String(Re==null?void 0:Re.typeId)===String(Ae.tickettypeid));if((Ge=We==null?void 0:We.listOfTicketTypesForAddOn)!=null&&Ge.some(Re=>String(Re)===String(e)))return}Ae&&Number(Ae.numberofticket||0)>0&&(C[De]=Ae)}}
2),C.forEach((Ae,De)=>{if(!Ae||String(De)===String(e))return;const we=ve[De];(!we||Number(we.numberofticket||0)<=0)&&delete C[De]});const Pe=C.filter(Ae=>Ae).reduce((Ae,De)=>Ae+(parseInt(De.numberofticket,10)||0),0),Xe=C.filter(Ae=>Ae).map(Ae=>parseInt(Ae.numberofticket,10)).reduce((Ae,De)=>Ae+De,0);Z=0,K=0,C.filter(Boolean).forEach(Ae=>{Z+=Number(Ae.totalTicketsPrice||0),K+=Number(Ae.fee||0)}),va.unstable_batchedUpdates(()=>{var Ae,De,we,Ge;fe.setState({totalTickets:C,totalTicketQty:Pe,totalTicketPrice:Z,totalTicketFee:K,totalNumberOfTickets:Xe,totalSalesTaxFee:T,totalDonationSalesTaxFee:ns,totalDonationVatTaxFee:os,ticketingFeeData:re,allTicketForPayLater:ae,isDepositEnabled:me,hasSomePayLaterTickets:Y,totalDepositAmount:O,finalAmountWithDeposit:B,totalVatFee:R,couponSavings:le,paymentType:!ae&&((Ae=this.state)==null?void 0:Ae.paymentType)==="INVOICE"?x||H?"CC":"CASH":(De=this.state)==null?void 0:De.paymentType,PostDepositBalance:I},()=>{ge(),Ce&&this.setCalculationFee({notifyParent:!0})}),!F&&!_&&!U&&(fe.props.onHandelChangeCallBack(C,Pe,Z,K,b,Xe,parseFloat(R).toFixed(2),parseFloat(T).toFixed(2),parseFloat(ns).toFixed(2),parseFloat(os).toFixed(2),re),(Ge=(we=fe.props).onUpdateTicketSavings)==null||Ge.call(we,l)),fe.props.storeBuyTicketList(C),this.setDisableContinue(!1)})})}).catch(z=>{this.setDisableContinue(!1),this.setState({popupAlertHeader:A("toasterMsg:Error"),showMapPopup:!0,errorMsg:z.errorMessage})}),this.pendingAddDonationPromise},this.addDefaultAddonTicket=(e,t)=>{var a,r;const{totalTickets:s,settings:n}=this.state;if((e==null?void 0:e.dataType)!=="ADDON"&&(e==null?void 0:e.dataType)!=="Donation"&&t>0){const o=(a=n==null?void 0:n.ticketTypes)==null?void 0:a.filter(c=>(c==null?void 0:c.dataType)==="ADDON"),d=(r=o==null?void 0:o.filter(c=>{var m;return(m=c==null?void 0:c.listOfTicketTypesForAddOn)==null?void 0:m.includes(e==null?void 0:e.typeId)}))==null?void 0:r.filter(c=>{const m=w(c.startDate).diff(w())<0&&w(c.endDate).diff(w())>=0;return(c==null?void 0:c.minTickerPerBuyer)>0&&(c==null?void 0:c.minTickerPerBuyer)<=(c==null?void 0:c.remaniningTickets)&&m});$e(d)&&(d==null||d.map(c=>{(s==null?void 0:s.some(g=>{var k;return(g==null?void 0:g.tickettypeid)===((k=c==null?void 0:c.typeId)==null?void 0:k.toString())}))||this.selectHandle({value:c==null?void 0:c.minTickerPerBuyer},c,!0)}))}},this.applyAccessCodeFromUrl=()=>{var s;if(this.accessCodeUrlApplied||this.state.isValidAccessCode)return;const e=ct((s=window==null?void 0:window.location)==null?void 0:s.search),t=Ke("access")||(e==null?void 0:e.access);t&&(this.accessCodeUrlApplied=!0,this.setState({accessCode:t,openAccessCode:!0,codeFieldExpanded:!0},()=>{this.checkAccessCode()}))},this.applyDiscountCodeFromUrl=async()=>{var s;if(this.props.isHost||this.props.isFromStaff||this.props.urlDiscountDismissed||this.discountCodeUrlApplied||this.state.appliedDiscountCode)return;const e=ct((s=window==null?void 0:window.location)==null?void 0:s.search),t=await Ke("DISCOUNT_FROM_URL")||await Ke("DISCOUNT_FROM_INTEGRATION")||await Ke("DISCOUNT_FROM_WIDGET")||(e==null?void 0:e.discountCode)||(e==null?void 0:e.couponCode);t&&(this.discountCodeUrlApplied=!0,this.pendingUrlDiscountCode=t,this.setState({unifiedCodeValue:t,codeFieldExpanded:!0,isApplyingUnifiedCode:!1},()=>{this.applyUnifiedCode()}))},this.restoreAccessCodeFromRedux=()=>{const e=this.props.appliedAccessCode;!e||this.accessCodeRestoredFromRedux||this.state.isValidAccessCode||(this.accessCodeRestoredFromRedux=!0,this.setState({accessCode:e,openAccessCode:!0},()=>{this.checkAccessCode()}))},this.checkAccessCode=e=>{if(e&&e.preventDefault(),at&&(clearInterval(at),at=null),this.props.isApplicationOrder)return;const{accessCode:t}=this.state,s=t==null?void 0:t.trim();this.doGetHiddenSettings(encodeURIComponent(s))},this.checkIfIsStaff=()=>{const{user:e,isHost:t}=this.props,{admin:s,hasStaffAccess:n}=e;let a;s||t?a={admin:!0,staff:!1}:a={staff:n||!1,admin:s||!1},this.props.storeIsStaff(a)},this.closeWaitListForm=()=>{this.setState({openWaitListPopup:!1})},this.setDisableContinue=e=>{const t=this.pendingFeeCalcs>0;this.pendingFeeCalcs=Math.max(0,this.pendingFeeCalcs+(e?1:-1));const s=this.pendingFeeCalcs>0;t!==s&&(this.props.onDisableContinue?this.props.onDisableContinue(s):this.setState({disableContinue:s}))},this.getAccessCodeDetails=async()=>{const{accessCode:e}=this.state,{eventUrl:t,recurringEventId:s}=this.props,n=await this.props.getAccessCodeDetails(t,e,s);localStorage.setItem("accessCodeDetails",n),this.setState({accessCodeDetails:atob(n)})},this.validateDiscountCode=async e=>{try{const t=await this.props.validateCodeType(this.props.eventUrl,e);return(t==null?void 0:t.data)===!0?(this.setState({accessCodeError:!0,accessCodeFailMessage:!0,errorMsg:"This is a discount code, use it at checkout.",unifiedCodeError:"This is a discount code, use it at checkout."}),!1):!0}catch{return!0}},this.toggleCodeField=()=>{this.setState(e=>({codeFieldExpanded:!e.codeFieldExpanded}))},this.onUnifiedCodeChange=e=>{this.setState({unifiedCodeValue:e,unifiedCodeError:null,accessCodeFailMessage:!1,accessCodeError:!1})}
2,this.applyUnifiedCode=async()=>{var m,g,k,S,u,E,h,y,b,D,P,C,F,_,$;const e=(this.state.unifiedCodeValue||"").trim();if(!e||this.state.isApplyingUnifiedCode)return;const t=e.toLowerCase(),s=((m=this.props.existingOrderDetails)==null?void 0:m.existingOrderId)&&((g=this.props.existingOrderDetails)==null?void 0:g.couponCode)||"",n=((k=this.state.appliedDiscountCode)==null?void 0:k.code)||s;if(n&&n.trim().toLowerCase()===t){this.setState({unifiedCodeError:be.t("This code has already been applied.")});return}const{isHost:a,eventDetails:r,eventUrl:o,recurringEventId:d}=this.props,c=a?r&&(r.eventUrl||r.eventURL):o;this.setState({isApplyingUnifiedCode:!0,unifiedCodeError:null});try{if(this.props.isApplicationOrder){const q=this.props.onApplyClaimCoupon?await this.props.onApplyClaimCoupon(e):null;if(!q||q.errorMessage){this.setState({unifiedCodeError:(q==null?void 0:q.errorMessage)||be.t("This code isn't applicable to the selected ticket(s).")});return}const N={code:e,codeType:"DISCOUNT",applicableTo:"PER_TICKET"};(u=(S=this.props).storeAppliedDiscountCode)==null||u.call(S,N),this.setState({appliedDiscountCode:N,unifiedCodeValue:"",accessCodeFailMessage:!1,accessCodeError:!1},()=>this.setCalculationFee({notifyParent:!0}));return}const U=!!(this.props.isHost||this.props.isFromStaff);let A="";U?A=e:this.state.isValidAccessCode&&(A=this.state.accessCode);const x=await this.props.validateUnifiedCode(c,e,d,"",A);if(!x||x.valid===!1||x.codeType==="NONE"||x.errorCode||x.errorMessage||x!=null&&x.message){this.setState({unifiedCodeError:(x==null?void 0:x.errorMessage)||(x==null?void 0:x.message)||be.t("This code isn't valid for this event.")});return}if(x.codeType==="ACCESS"){if(this.props.isHost||this.props.isFromStaff||this.props.isApplicationOrder){this.setState({unifiedCodeError:this.props.isApplicationOrder?be.t("Access codes cannot be applied to this registration."):be.t("Please enter a discount code.")});return}const q=this.state.isValidAccessCode&&!!this.state.accessCode&&this.state.accessCode.trim().toLowerCase()!==t&&!a&&!this.props.isFromStaff;q&&((E=this.manuallyRemovedAutoAddTickets)==null||E.clear(),(h=this.manuallyAdjustedAutoAddTickets)==null||h.clear(),(y=this.autoAddedTicketIds)==null||y.clear(),(b=this.pendingAutoAddTickets)==null||b.clear(),this.hasUserInteracted=!1,this.originalMinTickerPerBuyer={},this.props.onHandelChangeCallBack([],0,0,0,0)),this.pendingUrlDiscountCode&&this.pendingUrlDiscountCode.trim().toLowerCase()===t&&this.urlDiscountSecondPassCode!==t&&(this.urlDiscountSecondPassCode=t,this.discountCodeUrlApplied=!1),this.pendingUnifiedAccessApply=!0,this.setState({accessCode:e,...q?{totalTickets:[]}:{}},()=>{this.accessCode&&(this.accessCode.value=e),this.checkAccessCode()});return}if((D=this.props.existingOrderDetails)!=null&&D.existingOrderId&&!this.props.isApplicationOrder){this.setState({unifiedCodeError:be.t("Discount codes can't be applied when adding to an existing order.")});return}if(this.state.appliedDiscountCode){const q=(this.state.totalTickets||[]).filter(N=>N&&Number(N==null?void 0:N.numberofticket)>0).map(N=>{var te;const V=((te=this.state.selectedExpoBooth)==null?void 0:te.ticketTypeId)&&Number(N==null?void 0:N.tickettypeid)===Number(this.state.selectedExpoBooth.ticketTypeId),J=V?Number(this.state.selectedExpoBooth.price):0,W=V?J>0?J-Number(this.state.selectedExpoBooth.discountAmount||0):J:Number(N==null?void 0:N.price);return{ticketQuantity:Number(N==null?void 0:N.numberofticket),ticketingTypeId:Number(N==null?void 0:N.tickettypeid),ticketPrice:W,payLater:this.state.paymentType==="INVOICE"?N.payLater:!1,depositPayment:this.state.isDepositEnabled,ruleId:N.ruleId,limitQuantityRuleId:N.limitQuantityRuleId}});if(q.length>0){const N=await this.props.doCalculateTicketFees(c,q,this.props.exhibitorId,e,(P=this.props.existingOrderDetails)==null?void 0:P.existingOrderId),V=Array.isArray(N==null?void 0:N.data)?N.data:null;if(V&&!V.some(J=>Number((J==null?void 0:J.couponDiscountAmount)||0)>0)){this.setState({unifiedCodeError:be.t("This code isn't applicable to the selected ticket(s).")});return}}}const H={code:e,codeType:"DISCOUNT",discountType:x.discountType,amount:x.amount,applicableTo:x.applicableTo,message:x.message};(F=(C=this.props).storeAppliedDiscountCode)==null||F.call(C,H),this.setState({appliedDiscountCode:H,unifiedCodeValue:"",accessCodeFailMessage:!1,accessCodeError:!1},()=>{this.setCalculationFee({notifyParent:!0})})}catch(U){this.setState({unifiedCodeError:(($=(_=U==null?void 0:U.response)==null?void 0:_.data)==null?void 0:$.message)||be.t("Something went wrong. Please try again.")})}finally{this.pendingUnifiedAccessApply||this.setState({isApplyingUnifiedCode:!1})}},this.removeUnifiedCode=e=>{var t,s;if((e==null?void 0:e.codeType)==="ACCESS"){this.setState({unifiedCodeError:null}),this.removeAccessCode();return}(s=(t=this.props).onUrlDiscountDismissed)==null||s.call(t),this.removeAppliedDiscountCode()},this.removeAppliedDiscountCode=()=>{var c;const e=()=>{const{isHost:m,isFromStaff:g,waitListIds:k}=this.props,S=(this.state.ticketingFeeData||[]).map(u=>u!=null&&u.couponDiscountAmount?{...u,couponDiscountAmount:0}:u);va.unstable_batchedUpdates(()=>{var u,E,h,y;!m&&!g&&!k&&((E=(u=this.props).onHandelChangeCallBack)==null||E.call(u,this.state.totalTickets,this.state.totalTicketQty,this.state.totalTicketPrice,this.state.totalTicketFee,this.state.selectedSeats||[],this.state.totalNumberOfTickets,parseFloat(this.state.totalVatFee||0).toFixed(2),parseFloat(this.state.totalSalesTaxFee||0).toFixed(2),parseFloat(this.state.totalDonationSalesTaxFee||0).toFixed(2),parseFloat(this.state.totalDonationVatTaxFee||0).toFixed(2),S)),(y=(h=this.props).storeAppliedDiscountCode)==null||y.call(h,null),this.setState({appliedDiscountCode:null,unifiedCodeError:null,ticketingFeeData:S,couponSavings:0},()=>{this.setCalculationFee({notifyParent:!0})})})},{isHost:t,isFromStaff:s,isStaff:n,eventDetails:a,eventUrl:r}=this.props,o=this.state.orderId||((c=this.props.orderData)==null?void 0:c.orderId)||this.props.orderIdfromTicketStep,d=t?a&&(a.eventUrl||a.eventURL):r;if(o&&d){Promise.resolve(this.props.removeCouponCode(d,o,!!(n||s))).catch(()=>{}).finally(e);return}e()},this.clearStoredDiscountCode=()=>{var e,t;!this.state.appliedDiscountCode&&!this.props.appliedDiscountCode||((t=(e=this.props).storeAppliedDiscountCode)==null||t.call(e,null),this.setState({appliedDiscountCode:null,couponSavings:0}))}
2,this.getDisplayCode=async()=>{const{widget:e,widgetConfig:t,widgetType:s,widgetId:n,widgetSettings:a}=this.props,{embedType:r}=t||{},o=ct(window.location.search);let d=(o==null?void 0:o.displayCode)||"";if(e&&(r==="tickets"||r==="buyticketbutton")&&(d=a!=null&&a.enableLimitedDisplayCode&&(a==null?void 0:a.displayCode)||""),s&&!d)if(a)d=a!=null&&a.enableLimitedDisplayCode&&(a==null?void 0:a.displayCode)||"";else try{const c=await this.props.doGetWidgetSettings(s,n),m=c!=null&&c.configurationData?JSON.parse(c.configurationData):null;d=m!=null&&m.enableLimitedDisplayCode&&(m==null?void 0:m.displayCode)||""}catch(c){console.error("Failed to fetch widget settings:",c)}return encodeURIComponent(d)||""},this.removeUrlParamsAndLocalStorage=()=>{var e;try{const t=new URL(window.location.href),s=t.searchParams;["payment_intent","payment_intent_client_secret","redirect_status"].forEach(r=>s.delete(r));const a=t.origin+t.pathname+(s.toString()?`?${s.toString()}`:"");(e=window.history)!=null&&e.pushState?window.history.pushState(null,"",a):console.warn("History API not supported, cannot clean URL without reload."),Kt("idealCheckoutRequest")}catch(t){console.error("Failed to clean URL:",t)}},this.isCheckResizeOrNot=()=>{const{isresize:e}=this.state;this.setState(()=>({isresize:!e}))},this.storeBuyTicketList=e=>{this.props.storeBuyTicketList(e),this.setState({selectedSeats:[],totalTickets:[]},()=>{this.addDonation("","",0,!1,0,0,[],[],[],[])})},this.emptyTicketsState=()=>{var e,t,s,n,a,r,o,d,c,m;this.props.storeBuyTicketList(null),(t=(e=this.props).storeRegRequestTicketList)==null||t.call(e,null),this.setState({totalTickets:[],totalRegRequestTickets:[],selectedSeats:[],orderId:null,selectedExpoBooth:null}),(s=this.manuallyRemovedAutoAddTickets)==null||s.clear(),(n=this.manuallyAdjustedAutoAddTickets)==null||n.clear(),(a=this.autoAddedTicketIds)==null||a.clear(),(r=this.pendingAutoAddTickets)==null||r.clear(),this.hasUserInteracted=!1,(d=(o=this.props).onHandelChangeCallBack)==null||d.call(o,[],0,0,0,[],0,0,0,0,0),(m=(c=this.props).onHandleRequestChangeCallBack)==null||m.call(c,[],0,0,0,0)},this.getBlockedDomainTickets=async e=>{const{user:t,isFromStaff:s,isHost:n,isFromHost:a}=this.props;if(!pt(t)&&!s&&!n&&!a){const r=e==null?void 0:e.map(d=>d==null?void 0:d.typeId);await this.getUnallowedTickets(r,e);const o=St==null?void 0:St.map(d=>d==null?void 0:d.id);xe=rs?e==null?void 0:e.filter(d=>!(o!=null&&o.includes(d==null?void 0:d.typeId))):[]}},this.hasSeatedBoothAddon=(e=null)=>{var s;return(e||[...((s=this.state.settings)==null?void 0:s.ticketTypes)||[],...this.state.addonTicketData||[]]||[]).some(n=>(n==null?void 0:n.addonType)==="EXHIBITOR_BOOTH"&&(n==null?void 0:n.allowAssignedSeating))}
2,this.getSeatDetails=async(e,t,s)=>{if((t==null?void 0:t.some(a=>a==null?void 0:a.allowAssignedSeating))||this.hasSeatedBoothAddon(s))try{const a=await this.props.doGetSeatDetails(e);this.setState({seatDetails:a})}catch(a){console.error("Error fetching seat details:",a)}},this.doGetHiddenSettings=async e=>{if(this.isApplyingAccessCode){this.pendingUnifiedAccessApply&&(this.pendingUnifiedAccessApply=!1,this.setState({isApplyingUnifiedCode:!1}));return}this.isApplyingAccessCode=!0;const{recurringEventID:t,isCartAdbandonment:s,t:n,isHost:a,ticketingTypes:r,isFromStaff:o,isStaff:d}=this.props,{selectedRecurringEvent:c,eventUrl:m,settings:g,limitRegistrationEmails:k}=this.state;xe=[];const S=t||c;this.setState({isTicketTypeLoaded:!1});const u=await this.getDisplayCode();if(!await this.validateDiscountCode(e)){this.isApplyingAccessCode=!1,this.setState({isTicketTypeLoaded:!0,isValidAccessCode:!1});const h=this.pendingUnifiedAccessApply?{isApplyingUnifiedCode:!1}:{};this.pendingUnifiedAccessApply=!1,this.setState({isTicketTypeLoaded:!0,isValidAccessCode:!1,...h});return}this.getEventTicketTypesRemainingCounts(m,S),this.props.doGetEventTicketTypesForDisplayFromCache(m,S,e,u).then(async h=>{var y,b,D,P,C,F,_,$,U,A,x,H,q;if(!(h!=null&&h.errorMessage)&&((b=(y=h==null?void 0:h.data)==null?void 0:y.ticketTypes)==null?void 0:b.length)>0){const N=new Set((((D=h==null?void 0:h.data)==null?void 0:D.ticketTypes)||[]).map(L=>L.typeId)),V=this.state.unlockedTicketTypeIds||new Set,J=((g==null?void 0:g.ticketTypes)||[]).filter(L=>
2!V.has(L.typeId)),W={...g,ticketTypes:[...J]};this.rawTicketTypesForPrune=lt(this.rawTicketTypesForPrune||[],(P=h==null?void 0:h.data)==null?void 0:P.ticketTypes,"typeId");const te=o||a?this.getAvailableTicketsForRegistration((C=h==null?void 0:h.data)==null?void 0:C.ticketTypes):this.getTicketDataTypeList((F=h==null?void 0:h.data)==null?void 0:F.ticketTypes);W.ticketTypes=s?te:lt(W.ticketTypes,te,"typeId"),W.ticketTypes=Zt(W.ticketTypes,["position"],["desc"]);const j=W==null?void 0:W.ticketTypes.filter(L=>L.dataType==="TICKET");xe=j,k&&await this.getBlockedDomainTickets(j);const v=(_=h==null?void 0:h.data)==null?void 0:_.ticketTypes.filter(L=>L.dataType==="ADDON"),M=(this.state.addonTicketData||[]).filter(L=>!V.has(L.typeId)),de=lt(M,v,"typeId");let ke=this.state.addOnCategory;if(v.length){const L=a||o||d,Z=L?Sa([...W.ticketTypes||[],...v],"typeId"):W.ticketTypes||[];let K=this.state.addOnCategory||[];if(L)try{const R=await this.props.doGetEventTicketSeatingCategoriesForDisplayFromCache(m),T=((($=R==null?void 0:R.data)==null?void 0:$.categories)||[]).filter(l=>(l==null?void 0:l.dataType)==="ADDON");T.length&&(K=lt(T,this.state.addOnCategory||[],"id"))}catch{}K.length&&W.ticketTypes&&(ke=K.map(R=>({...R,variations:Z.filter(T=>T.categoryId===R.id)})))}const fe=Sa([...r==null?void 0:r.ticketTypes,...(U=h==null?void 0:h.data)==null?void 0:U.ticketTypes],"typeId"),Te={...r,ticketTypes:fe};this.props.storeEventTicketType(Te),await this.getAccessCodeDetails(),await this.get
2SeatDetails(m,xe,W.ticketTypes);let G=e||"";try{G=decodeURIComponent(G)}catch{}if(G.trim().toLowerCase()!==(this.state.accessCode||"").trim().toLowerCase()){this.setState({isTicketTypeLoaded:!0});return}this.setState({errorMsg:n("toasterMsg:Access code applied"),accessCodeFailMessage:!1,unifiedCodeError:null,unifiedCodeValue:"",accessCodeSuccessMessage:!0,settings:W,ticketTypeList:xe,addonTicketData:de,addOnCategory:ke,isLoaded:!0,isTicketTypeLoaded:!0,isValidAccessCode:!0,unlockedTicketTypeIds:N},()=>{this.applyTicketQuantitiesFromQueryParams(W.ticketTypes),this.setCalculationFee({notifyParent:!0}),this.applyDiscountCodeFromUrl()}),this.props.storeEventTicketData(W),Kt("access"),this.cartAdbandonment(),this.props.storeAccessCode(e)}else{const N={...g,ticketTypes:[...(g==null?void 0:g.ticketTypes)||[]]};N.ticketTypes=gn(N.ticketTypes,as);const V=N==null?void 0:N.ticketTypes.filter(W=>W.dataType==="TICKET");xe=V;const J=((x=(A=h==null?void 0:h.data)==null?void 0:A.ticketTypes)==null?void 0:x.length)===0?n("checkoutDetails:Couldn't find this code"):n("toasterMsg:Access code not valid");
2k&&await this.getBlockedDomainTickets(V),await this.getSeatDetails(m,xe,N.ticketTypes),this.setState({accessCodeFailMessage:!0,errorMsg:((H=h==null?void 0:h.data)==null?void 0:H.errorMessage)||(h==null?void 0:h.errorMessage)||J,unifiedCodeError:((q=h==null?void 0:h.data)==null?void 0:q.errorMessage)||(h==null?void 0:h.errorMessage)||J,settings:N,ticketTypeList:xe,isLoaded:!0,isTicketTypeLoaded:!0,isValidAccessCode:!1})}}).catch(h=>{this.setState({isLoaded:!0,isTicketTypeLoaded:!0,isValidAccessCode:!1}),h&&h.response&&h.response.data.errorCode==="4010101"?this.props.history.push("/u/login/"):h&&h.response&&h.response.data.errorCode==="4030101"&&(this.TempTimeout=setTimeout(()=>{const{eventDetails:y}=this.props,b=(y==null?void 0:y.eventUrl)||"";this.props.history.push(`/host/${b}/manage-attendees/add-attendees`)},4e3))}).finally(()=>{this.isApplyingAccessCode=!1,this.pendingUnifiedAccessApply&&(this.pendingUnifiedAccessApply=!1,this.setState({isApplyingUnifiedCode:!1}))})},this.doGetSeatingCategories=async(e="",t)=>{const s=this,n=await this.getDisplayCode();s.props.doGetSeatingCategories(e,t,n).then(a=>{s.setState({ticketCategory:a})}).catch(()=>{})},this.cartAdbandonment=()=>{try{const{isCartAdbandonment:e}=this.props;e&&setTimeout(()=>{const{cartAdbandonmentData:t}=this.props,{ticketslist:s}=t,{totalTickets:n}=this.state||[];Be(s,async a=>{n[a.tickettypeid]={price:a.price,individualPrice:a.individualPrice,tickettypeid:a.tickettypeid,numberofticket:a.numberofticket,seatNumbers:a.seatNumbers,seatNumbersDisplay:a.seatNumbersDisplay,name:a.name,isDonation:a==null?void 0:a.isDonation,fee:a.fee,tableNumber:a.tableNumber},await this.addDonation(a.name,a.name,a.price,a==null?void 0:a.isDonation,a.numberofticket,a.fee,[],[],[],void 0,void 0,void 0,!1,!1,a==null?void 0:a.minTickerPerBuyer,a==null?void 0:a.maxTickerPerBuyer)}),this.setState({totalTickets:n})},100)}catch(e){console.error("Error in cart adbandonment",e)}},this.checkTicketIsSelected=(e,t)=>{const s=e==null?void 0:e.map(a=>a==null?void 0:a.tickettypeid),n=s==null?void 0:s.filter(a=>{var r;return(r=t==null?void 0:t.listOfTicketTypesForAddOn)==null?void 0:r.includes(parseInt(a,10))});return(e==null?void 0:e.findIndex(a=>(t==null?void 0:t.typeId)===((a==null?void 0:a.tickettypeid)||(a==null?void 0:a.typeId))))>-1||(n==null?void 0:n.length)}
2,this.getSelectedTicketTypesIds=e=>{const t=e==null?void 0:e.filter(n=>(n==null?void 0:n.dataType)==="TICKET");return(t==null?void 0:t.map(n=>(n==null?void 0:n.tickettypeid)||(n==null?void 0:n.typeId)))||[]},this.getPurchasedTicketsIds=(e="")=>new Promise((t,s)=>{const{eventDetails:n,eventUrl:a,isHost:r}=this.props,o=r?n&&(n.eventUrl||n.eventURL):a;this.props.getPurchasedTicketsIdList(o,e).then(d=>d!=null&&d.errorMessage?s(d.errorMessage):(this.setState({purchasedTicketTypes:d==null?void 0:d.data}),t(d)))}),this.checkWaitListLinkValidity=()=>{const{isHost:e,eventDetails:t,eventUrl:s,waitListIds:n}=this.props,a=e?t&&(t.eventUrl||t.eventURL):s;n&&this.props.checkWaitListLinkValidity(a,n).then(r=>{r!=null&&r.errorMessage||this.setState({showLinkExpired:r==null?void 0:r.data})}).catch(()=>{})},this.checkClaimLinkExpiry=()=>{const{isApplicationOrder:e,eventUrl:t,eventDetails:s,t:n}=this.props;if(!e)return;const a=new URLSearchParams(window.location.search),r=a.get("orderId");if(!r)return;const o=a.get("recurringEventId")||0,d=(s==null?void 0:s.eventUrl)||(s==null?void 0:s.eventURL)||t;this.props.getClaimCheckoutSettings(d,r,o).then(c=>{if((c==null?void 0:c.errorCode)==="4060336")this.setState({claimLinkExpired:!0,claimLinkExpiredMsg:(c==null?void 0:c.errorMessage)||n("common:Your checkout link has expired. Please contact the event organizer.")});else if(c!=null&&c.errorCode){const m=(c==null?void 0:c.errorCode)==="4060337";this.setState({claimLinkExpired:!0,hideClaimResendLink:m,claimLinkExpiredMsg:(c==null?void 0:c.errorMessage)||n("common:Unable to load checkout. Please contact the event organizer.")})}}).catch(()=>{this.setState({claimLinkExpired:!0,claimLinkExpiredMsg:n("common:Unable to verify checkout link. Please try again later.")})})},this.handleResendClaimLink=()=>{const{eventUrl:e,eventDetails:t,t:s}=this.props,a=new URLSearchParams(window.location.search).get("orderId");if(!a)return;const r=(t==null?void 0:t.eventUrl)||(t==null?void 0:t.eventURL)||e;this.setState({resendingClaimLink:!0}),this.props.buyerResendClaimLink(r,a).then(o=>{(o==null?void 0:o.type)==="Success"&&this.setState({claimLinkExpiredMsg:s("common:A new checkout link has been sent to your email.")})}).catch(()=>{this.setState({claimLinkExpiredMsg:s("common:Failed to send. Please try again or contact the event organizer.")})}).finally(()=>{this.setState({resendingClaimLink:!1})})},this.getUnallowedTickets=async e=>{const{selectedRecurringEvent:t}=this.state,{user:s,eventDetails:n}=this.props,a=(n==null?void 0:n.eventUrl)||(n==null?void 0:n.eventURL);St=[];const r={email:s==null?void 0:s.email,ticketTypeIds:e,recurringEventId:t||0};try{const o=await this.props.validateEmailOnRegistration(a,r);(o==null?void 0:o.errorCode)==="4060180"?rs=!1:(St=o,rs=!0)}catch(o){console.log("error",o)}},this.toggleLinkPopup=()=>{const{showLinkExpired:e}=this.state;this.setState({showLinkExpired:!e})},this.applyTicketQuantitiesFromQueryParams=e=>{const t=Dn();if(!e||!e.length||Object.keys(t).length===0)return;const{isHost:s,isFromStaff:n}=this.props,a=n||s,r=[];e==null||e.forEach(o=>{var g,k,S;if((o==null?void 0:o.dataType)!=="TICKET"||(o==null?void 0:o.ticketType)==="DONATION"||(o==null?void 0:o.dataType)==="ADDON"||o!=null&&o.soldOut||o!=null&&o.endDate&&w(o.endDate).diff(w())<=0&&!a||o!=null&&o.startDate&&w(o.startDate).diff(w())>=0||!(o!=null&&o.soldOut)&&(o!=null&&o.waitList)&&o.dataType!=="ADDON")return;const d=(g=o.name)==null?void 0:g.toLowerCase(),c=Rn(o==null?void 0:o.name),m=t[d]||t[c]||t[(k=o.typeId)==null?void 0:k.toString()]||t[(S=o.id)==null?void 0:S.toString()];if(m){const u=parseInt(m,10),E=Math.max(Number(o.remaniningTickets)||0,Number(o.remainingCount)||0,Number(o.totalQuantity)||0)||1/0,h=!o.minTickerPerBuyer||u>=o.minTickerPerBuyer,y=!o.maxTickerPerBuyer||u<=o.maxTickerPerBuyer,b=u<=E;!isNaN(u)&&u>0&&b&&h&&y&&r.push({ticket:o,quantity:u})}}),(r==null?void 0:r.length)!==0&&(r==null||r.forEach(({ticket:o,quantity:d})=>{setTimeout(()=>{this.handleTicketSelection({value:d,label:d},o,!0),this.addRemoveAddonTicket(o,d)},300)}))},this.setTicketSettings=async(e,t,s)=>{var n;if(e){const a=[],r=e.categories;r&&e.ticketTypes&&r.forEach(m=>{m.dataType==="ADDON"&&a.push({...m,variations:e.ticketTypes.filter(g=>g.categoryId===m.id)})});const o=e.ticketTypes.filter(m=>m.dataType==="TICKET"),d=e.ticketTypes.filter(m=>m.dataType!=="DONATION");xe=o,e!=null&&e.limitRegistrationEmails&&await this.getBlockedDomainTickets(o),((n=e==null?void 0:e.ticketTypes)==null?void 0:n.some(m=>{var g;return((g=m==null?void 0:m.ticketType)==null?void 0:g.toLowerCase())==="donation"}
2))&&this.getDonationSettings(s),await this.getSeatDetails(s,xe,e.ticketTypes),this.setState({ticketAndAddOnsList:d,ticketTypeList:xe,addOnCategory:a,settings:e,isLoaded:!0,isTicketTypeLoaded:!0,addonTicketData:t,limitRegistrationEmails:e==null?void 0:e.limitRegistrationEmails},()=>{e.ticketTypes&&e.ticketTypes.length>0&&e.ticketTypes.filter(k=>k.remaniningTickets>0&&!(w(k.endDate).diff(w())<=0||w(k.startDate).diff(w())>=0)).length>0&&this.cartAdbandonment(),e.accessCodeAvailable&&this.applyAccessCodeFromUrl(),e.accessCodeAvailable&&this.restoreAccessCodeFromRedux(),this.applyDiscountCodeFromUrl(),this.setDefaultNumberOfTicketForFreeTicket(xe),this.applyTicketQuantitiesFromQueryParams(e.ticketTypes)}),as=e.ticketTypes}return e},this.getEventTicketTypesFeesAndDiscriptionFromCache=(e,t)=>{this.props.doGetEventTicketTypesFeesAndDiscriptionFromCache(e,t).then(s=>{var n;s!=null&&s.errorMessage||this.setState({ticketTypeFeesAndDesc:(n=s==null?void 0:s.data)==null?void 0:n.ticketTypesDescriptionAndFees})}).catch(()=>{})},this.getEventTicketTypesRemainingCounts=async(e,t)=>{const{waitListIds:s,isHost:n,isFromStaff:a}=this.props,r=n||a;await this.props.doGetEventTicketTypesRemainingCounts(e,t,s,r).then(o=>{var d,c;o!=null&&o.errorMessage||(this.setState({ticketTypeRemainingCounts:o==null?void 0:o.data}),(c=(d=this.props).onUpdateRemainingCounts)==null||c.call(d,o==null?void 0:o.data))}).catch(()=>{})},this.getTicketingCacheData=async(e,t,s,n)=>{var S,u;let a=[];const{isHost:r,isFromStaff:o,isStaff:d,ticketingSettings:c}=this.props,m={data:{...c||{}}},g=await this.getDisplayCode();await this.getEventTicketTypesFeesAndDiscriptionFromCache(e,t),this.getEventTicketTypesRemainingCounts(e,t);const k=[this.props.doGetEventTicketTypesForDisplayFromCache(e,t,"",g),this.props.doGetEventTicketSeatingCategoriesForDisplayFromCache(e),this.props.doGetCodesAndCapacityReachStatusForDisplayFromCache(e,t)];try{const[E,h,y]=await Promise.all(k);if(!(E!=null&&E.errorMessage)){const b=Zt(((S=E==null?void 0:E.data)==null?void 0:S.ticketTypes)||[],["position"],["desc"]);a=b.filter(D=>D.dataType==="ADDON"),m.data.ticketTypes=r||o||d?this.getAvailableTicketsForRegistration(b):this.getTicketDataTypeList(b)}return h!=null&&h.errorMessage||(m.data.categories=(u=h==null?void 0:h.data)==null?void 0:u.categories),y!=null&&y.errorMessage||(m.data={...m.data,...y==null?void 0:y.data},this.props.storeCapacityInfo(y==null?void 0:y.data)),m.data=this.setTicketSettings(m.data,a,e),s(m)}catch(E){return console.error("Error fetching ticketing data:",E),this.setState({isLoaded:!0,isTicketTypeLoaded:!0,errorMsg:E.message||"Something went wrong while fetching ticketing data."}),n({errorMessage:E.message||"An error occurred"})}},this.doGetSettings=async(e="")=>new Promise((t,s)=>{const{isHost:n,eventDetails:a,eventUrl:r,isFromStaff:o,isStaff:d,waitListCheckout:c,waitListIds:m,t:g,isRegApproval:k,isApplicationOrder:S}=this.props,u=n?a&&(a.eventUrl||a.eventURL):r;if(u){if(this.setState({eventUrl:u,isTicketTypeLoaded:!1}),S){const y=new URLSearchParams(window.location.search).get("orderId");if(y){this.props.getClaimCheckoutSettings(u,y,e||0).then(async b=>{var _,$;if(b&&b.errorCode){this.setState({claimLinkExpired:!0,hideClaimResendLink:(b==null?void 0:b.errorCode)==="4060337",claimLinkExpiredMsg:(b==null?void 0:b.errorMessage)||"Unable to load checkout.",isTicketTypeLoaded:!0}),s(b.errorMessage);return}let D=[];const P=((_=b==null?void 0:b.data)==null?void 0:_.ticketTypes)||(b==null?void 0:b.ticketTypes),C=(b==null?void 0:b.data)||b;P&&(delete C.ticketTypes,D=P==null?void 0:P.filter(U=>U.dataType==="ADDON"),C.ticketTypes=this.getTicketDataTypeList(P)),this.props.storeEventTicketType({ticketTypes:P}),C.ticketTypes=C.ticketTypes||[],this.props.onClaimableTicketsLoaded&&C.claimableTickets&&this.props.onClaimableTicketsLoaded(C.claimableTickets),this.setState({orderId:y}),this.getEventTicketTypesFeesAndDiscriptionFromCache(u,e),await this.getEventTicketTypesRemainingCounts(u,e);try{const U=await this.props.doGetCodesAndCapacityReachStatusForDisplayFromCache(u,e);($=U==null?void 0:U.data)!=null&&$.discountCodeAvailable&&(C.discountCodeAvailable=!0)}catch(U){console.error(U)}const F={data:this.setTicketSettings(C,D,u)};t(F)}).catch(b=>{this.setState({isLoaded:!0,isTicketTypeLoaded:!0}),s(b)});return}}const E=k?"regApproval":n||o?"staff":c?"waitlist":"";E===""&&$e(this.props.ticketingSettings)&&!(a!=null&&a.recurring)?this.getTicketingCacheData(u,e,t,s):this.props.doGetSettings(u,"ticketing",E,m,e).then(async h=>{var D,P;let y=[];if(h&&h.errorMessage)return this.setState({popupAlertHeader:g("toasterMsg:Error"),showMapPopup:!0,errorMsg:h.errorMessage||g("common:Something went wrong.")}),(h==null?void 0:h.errorCode)==="4060174"&&this.setState({isCheckoutLinkExpired:!0,checkoutErrorMsg:h.errorMessage}),s(h.errorMessage);if(E==="")return this.getTicketingCacheData(u,e,t,s);const b=(D=h==null?void 0:h.data)==null?void 0:D.ticketTypes;return(P=h==null?void 0:h.data)==null||delete P.ticketTypes,y=b==null?void 0:b.filter(C=>C.dataType==="ADDON"),h.data.ticketTypes=n||o||d?this.getAvailableTicketsForRegistration(b):this.getTicketDataTypeList(b),await this.getEventTicketTypesRemainingCounts(u,e),this.props.storeEventTicketType({ticketTypes:b}),h.data=this.setTicketSettings(h.data,y,u),t(h)}).catch(h=>(this.setState({isLoaded:!0,isTicketTypeLoaded:!0}),h&&h.response&&h.response.data.errorCode==="4010101"?this.props.history.push("/u/login/"):h&&h.response&&h.response.data.errorCode==="4030101"&&(this.TempTimeout=setTimeout(()=>{const{eventDetails:y}=this.props,b=(y==null?void 0:y.eventUrl)||"";this.props.history.push(`/host/${b}/manage-attendees/add-attendees`)},4e3)),s(h)))}}),this.hasExhibitorPurchasedLinkedTicket=(e=[])=>{if(!this.props.isExhibitorFlow||!this.props.authenticated||!(e!=null&&e.length))return!1;const t=this.props.exhibitorPurchaseCounts||[];return e.some(s=>t.some(n=>Number(n==null?void 0:n.ticketTypeId)===Number(s)&&Number((n==null?void 0:n.purchasedCount)||0)>0))},this.checkTicketIsPurchasedForAddon=e=>{var a;const{purchasedTicketTypes:t}=this.state;if((e==null?void 0:e.dataType)!=="ADDON")return!1;const s=(e==null?void 0:e.listOfTicketTypesForAddOn)||[];return!!((a=this.props)!=null&&a.authenticated&&s.some(r=>t==null?void 0:t.includes(parseInt(r,10))))||this.hasExhibitorPurchasedLinkedTicket(s)},this.isAddonEligibleForCurrentSelection=(e,t=[])=>{if(!e||(e==null?void 0:e.addonType)==="EXHIBITOR_BOOTH")return!0;const s=(e==null?void 0:e.listOfTicketTypesForAddOn)||[];return s.length===0?!0:s.some(a=>t.some(r=>Number((r==null?void 0:r.tickettypeid)??(r==null?void 0:r.ticketTypeId)??(r==null?void 0:r.typeId))===Number(a)&&Number((r==null?void 0:r.numberofticket)??(r==null?void 0:r.ticketQuantity)??0)>0))||this.checkTicketIsPurchasedForAddon(e)},this.isExistingOrder=()=>{var t;const{existingOrderId:e=null}=((t=this.props)==null?void 0:t.existingOrderDetails)||{};return!!e},this.isCapacityReachedInExistingOrder=e=>{const{existingOrderDetails:t}=this.props,{purchasedTicketsCount:s}=t||{};return this.isExistingOrder()&&Ma(e,s)},this.shouldNotAllowTouchNetPayment=e=>{const{eventData:t}=this.props,{paymentGateway:s}=t||{},{payLater:n,registrationApprovalRequired:a}=e||{};return s==="TOUCHNET"&&(n||a)},this.getAvailableTicketsForRegistration=e=>this.isExistingOrder()?e.filter(t=>!t.registrationApprovalRequired):e,this.getTicketDataTypeList=e=>{const t=e==null?void 0:e.filter(s=>s.dataType==="TICKET"||!this.state.expoFpConfig&&s.addonType==="EXHIBITOR_BOOTH"||this.checkTicketIsSelected(this.state.totalTickets,s)||this.checkTicketIsSelected(this.state.totalRegRequestTickets,s)||this.checkTicketIsPurchasedForAddon(s));return this.getAvailableTicketsForRegistration(t)},this.restoreEntitledAddons=()=>{const e=this.rawTicketTypesForPrune,{isHost:t,isFromStaff:s,isStaff:n}=this.props;!(e!=null&&e.length)||t||s||n||this.setState(a=>{var m;const r=((m=a.settings)==null?void 0:m.ticketTypes)||[],o=new Set(r.map(g=>g.typeId)),d=this.getAvailableTicketsForRegistration(e.filter(g=>!o.has(g.typeId)&&this.checkTicketIsPurchasedForAddon(g)));if(!d.length)return null;const c=Zt([...r,...d],["position"],["desc"]);return{settings:{...a.settings,ticketTypes:c},addOnCategory:(a.addOnCategory||[]).map(g=>({...g,variations:c.filter(k=>k.categoryId===g.id)}))}})},this.getTicketTypeAndCategory=async(e="")=>{const{isHost:t,eventDetails:s,eventUrl:n,isFromStaff:a,isStaff:r}=this.props,o=t?s&&(s.eventUrl||s.eventURL):n,{settings:d}=this.state,c={data:{...d||{}}};let m=[];this.setState({isTicketTypeLoaded:!1});const g=await this.getDisplayCode();this.getEventTicketTypesRemainingCounts(o,e),this.props.doGetEventTicketTypesForDisplayFromCac
2he(o,e,"",g).then(async k=>{var S,u,E,h,y,b;if(k&&k.data){m=(S=k==null?void 0:k.data)==null?void 0:S.ticketTypes.filter(P=>P.dataType==="ADDON"),this.rawTicketTypesForPrune=lt(this.rawTicketTypesForPrune||[],(u=k==null?void 0:k.data)==null?void 0:u.ticketTypes,"typeId"),c.data.ticketTypes=t||a||r?this.getAvailableTicketsForRegistration((E=k==null?void 0:k.data)==null?void 0:E.ticketTypes):this.getTicketDataTypeList((h=k==null?void 0:k.data)==null?void 0:h.ticketTypes);const D=await this.props.doGetEventTicketSeatingCategoriesForDisplayFromCache(o);D!=null&&D.errorMessage||(c.data.categories=(y=D==null?void 0:D.data)==null?void 0:y.categories)}if(c&&c.data){const D=[],P=c.data.categories;P&&c.data.ticketTypes&&P.forEach(F=>{F.dataType==="ADDON"&&D.push({...F,variations:c.data.ticketTypes.filter(_=>_.categoryId===F.id)})});const C=c.data.ticketTypes.filter(F=>F.dataType==="TICKET");xe=C,(b=c==null?void 0:c.data)!=null&&b.limitRegistrationEmails&&await this.getBlockedDomainTickets(C),await this.getSeatDetails(o,xe,c.data.ticketTypes),this.setState({addonTicketData:m,ticketTypeList:xe,addOnCategory:D,settings:c.data,isLoaded:!0,isTicketTypeLoaded:!0},()=>{c.data.ticketTypes&&c.data.ticketTypes.length>0&&c.data.ticketTypes.filter($=>$.remaniningTickets>0&&!(w($.endDate).diff(w())<=0||w($.startDate).diff(w())>=0)).length>0&&this.cartAdbandonment(),this.setDefaultNumberOfTicketForFreeTicket(C)}),as=c.data.ticketTypes}}).catch(()=>{this.setState({isTicketTypeLoaded:!0})})},this.doOrderTicket=()=>{var y,b,D,P,C;if(this.isApplyingRuleActions)return;const{settings:e,paymentType:t,ticketAndAddOnsList:s,isDepositEnabled:n}=this.state,{t:a,isFromWaitlist:r,recurringEventID:o}=this.props,d={},c=t==="INVOICE";d.clientDate=w().local().format("DD/MM/YYYY HH:mm:ss");let m=this.state.totalTickets;const g=[];m==null||m.map(F=>{const _=s==null?void 0:s.find($=>{var U,A;return((U=$==null?void 0:$.typeId)==null?void 0:U.toString())===((A=F==null?void 0:F.tickettypeid)==null?void 0:A.toString())});_&&g.push(_)});const k=g==null?void 0:g.filter(F=>(F==null?void 0:F.ticketType)!=="DONATION");this.setState({ticketWithoutDonationAndAddon:(k==null?void 0:k.length)>0}),m=m.filter(F=>F!==null),m=m.map(F=>({numberOfTicket:parseInt(F.numberofticket,10),ticketTypeId:parseInt(F.tickettypeid,10),price:parseFloat(F.price),seatNumbers:F.seatNumbers,seatNumbersDisplay:F.seatNumbersDisplay,tableNumber:F.tableNumber||[]}));let S=!1,u,E=!0,h=!0;if(m&&m.map(F=>{var _,$,U;if(!S){const A=this.state.totalTickets[F.ticketTypeId];u=A?[A]:e&&e.ticketTypes?e.ticketTypes.filter(x=>x.typeId===F.ticketTypeId):[],u&&u[0]&&u[0].minTickerPerBuyer>F.numberOfTicket&&(S=!0)}E&&u&&(((_=u[0])==null?void 0:_.ticketType)==="PAID"||(($=u[0])==null?void 0:$.ticketType)==="DONATION")&&(E=!1),h&&u&&((U=u[0])==null?void 0:U.ticketType)==="PAID"&&r&&(h=!1),r&&this.setState({isSelectedFreeWaitList:h})}),u&&u[0]&&S)this.setState({popupAlertHeader:a("toasterMsg:Error"),showMapPopup:!0,errorMsg:a("common:A minimum of {{minTicket}} tickets must be selected for11 {{name}}.",{minTicket:u[0].minTickerPerBuyer,name:u[0].name})});else{this.setState({isLoaded:!1,disableRecurring:!0}),E?d.paymentType="CC":!n&&t!=="DEPOSIT"&&(d.paymentType=c?"UNPAID":t),d.ticketings=m,d.note=this.noteValue;const F=this.props.isFromStaff||this.props.embed?this.props.eventUrl:((y=this.props.eventDetails)==null?void 0:y.eventUrl)||((b=this.props.eventDetails)==null?void 0:b.eventURL),_=A=>{var x;(x=A==null?void 0:A.data)!=null&&x.orderId?this.setState({orderId:A.data.orderId,eventUrl:F,showCheckout:!0,isLoaded:!0},()=>{this.props.isFromStaff&&this.props.setEventTicketBackView(this.state.showCheckout)}):(this.setState({message:A&&(A==null?void 0:A.errorMessage)||"Error while Ordering Tickets",isError:!0,isLoaded:!0}),setTimeout(()=>{this.setState({message:"",isError:!1})},3e3))},$=[];if(this.state.ticketTypeList.forEach(A=>{d.ticketings.some(x=>{A.typeId===x.ticketTypeId&&$.push(x)})}),d.ticketings=$,m.forEach(A=>{var H;((H=d.ticketings)==null?void 0:H.find(q=>q.ticketTypeId===A.ticketTypeId))||$.push(A)}),d.ticketings=$,this.state.expoFpConfig&&this.state.selectedExpoBooth&&this.state.orderId){const{addonTicketData:A}=this.state,x=(A||[]).filter(N=>(N==null?void 0:N.addonType)==="EXHIBITOR_BOOTH").map(N=>{var V;return(V=N==null?void 0:N.typeId)==null?void 0:V.toString()}),H=((P=(D=this.props.orderData)==null?void 0:D.ticketAttribute)==null?void 0:P.orderData)||[],q=d.ticketings.map(N=>{var V;return(V=N.ticketTypeId)==null?void 0:V.toString()});console.log("[ExpoFP-debug] booth replace check:",{boothTicketTypeIds:x,existingOrderItems:H.map(N=>({id:N.ticketTypeId,name:N.ticketTypeName,dataType:N.dataType})),currentTicketTypeIds:q,hasOrderData:!!this.props.orderData,addonCount:(A||[]).length}),H.forEach(N=>{var V,J;x.includes((V=N.ticketTypeId)==null?void 0:V.toString())&&!q.includes((J=N.ticketTypeId)==null?void 0:J.toString())&&d.ticketings.push({numberOfTicket:0,ticketTypeId:parseInt(N.ticketTypeId,10),price:0})})}const U=(C=this.state.appliedDiscountCode)==null?void 0:C.code;if(this.state.orderId)this.props.doUpdateOrderTicket(F,d,this.state.orderId,"",o,"",!this.props.embed,null,U).then(A=>{_(A)}).catch(()=>{this.setState({isLoaded:!0})});else{const A=Ke("utmTrackSource");A&&(d.utmTrackSourceDto={...A}),this.props.doOrderTicket(F,d,"",o,"",!this.props.embed,!1,null,!1,U).then(x=>{_(x)}).catch(()=>{this.setState({isLoaded:!0})})}}},this.getDonationSettings=e=>{this.props.doGetSettings(e,"donation").then(t=>{this.setState({donationAmounts:t&&t.data&&t.data.donationAmounts||[200,500,800,1200]})}).catch(()=>{this.setState({donationAmounts:[200,500,800,1200]})})},this.getEventDate=e=>{let t="";if(this.state.ticketCategory&&e&&e!==""){const s=Me(this.state.settings.ticketTypes,{typeId:e});if(s&&s[0]&&s[0].startDate&&s[0].endDate&&s[0].remaniningTickets){const n=s[0].startDate,a=s[0].endDate;w(n).diff(w())>0&&(t=`Available on ${w(n).tz(this.props.eventDetails.equivalentTimezone).format("MM/DD/YYYY")}`),w(a).diff(w())<=0&&(s[0].remaniningTickets&&s[0].remaniningTickets)>0&&(t="Sales Ended")}}return t},this.getInitialSettings=()=>{this.checkIfIsStaff();const{eventDetails:e,recurringEventID:t}=this.props,{eventUrl:s,eventURL:n,recurring:a}=e||{};this.props.doGetEventPlanConfig(s||n).then(o=>{o&&this.setState({chargebeePlanName:o.chargebeePlanName,allowToImportAttendees:o.allowToImportAttendees,attendeeImportLimit:o.attendeeImportLimit})}),this.getWaitListSettings();let r="";if(a)this.props.doGetRecurringEvent(s||n).then(o=>{if(o&&o.length){const d=t||o[0].id;
2this.setState({recurringEventList:o,selectedRecurringEvent:d},()=>{d&&this.doGetSettings(d).then(()=>{this.TempTimeout=setTimeout(()=>{const{ticketingSettings:c}=this.props;r=c==null?void 0:c.seatingChartKey,r&&this.doGetSeatingCategories(s||n,d)},200)}).catch(()=>{})})}this.setState({isLoaded:!0})});else{this.doGetSettings().then().catch(()=>{});const o=setInterval(()=>{var d;r=(d=this.props.ticketingSettings)==null?void 0:d.seatingChartKey,this.props.ticketingSettings&&this.props.ticketingSettings.seatingChartKey&&(clearInterval(o),this.doGetSeatingCategories(s||n,"")),this.TempTimeout=setTimeout(()=>{clearInterval(o)},1e4)},200)}},this.getRecurringEvent=e=>{const{eventDetails:t,recurringEventID:s}=this.props;t!=null&&t.recurring&&this.props.doGetRecurringEvent(e).then(n=>{if(!(n!=null&&n.length))return;const a=s||n[0].id;this.setState({recurringEventList:n,selectedRecurringEvent:a},async()=>{if(a)try{this.props.authenticated&&await this.getPurchasedTicketsIds(a),await this.doGetSettings(a),this.TempTimeout=setTimeout(()=>{var r;(r=this.props.ticketingSettings)!=null&&r.seatingChartKey&&this.doGetSeatingCategories(e,a)},200)}catch{}})})},this.getWaitListSettings=(e="")=>{this.props.isHost?this.props.eventDetails&&(this.props.eventDetails.eventUrl||this.props.eventDetails.eventURL)&&this.props.getWaitlistSettings(this.props.eventDetails.eventUrl||this.props.eventDetails.eventURL,e||this.props.recurringEventID).then(t=>{this.setState({waitListSettings:t&&t.data},()=>{const{ticketTypeList:s}=this.state;this.setDefaultNumberOfTicketForFreeTicket(s)})}).catch(()=>{}):this.props.getWaitlistSettings(this.props.eventUrl,e||this.props.recurringEventID).then(t=>{this.setState({waitListSettings:t&&t.data},()=>{const{ticketTypeList:s}=this.state;this.setDefaultNumberOfTicketForFreeTicket(s)})}).catch(()=>{})},this.getDefaultNumberOfTickets=(e,t)=>{var a,r;const{settings:s}=this.state,{eventCapacityReach:n}=s||{};return(e[0].remaniningTickets<e[0].minTickerPerBuyer||e[0].remaniningTickets===0||n||(a=e[0])!=null&&a.allowAssignedSeating)&&t&&(!ht(e[0].typeId,t)||n&&((r=e[0])==null?void 0:r.remaniningTickets)>0||e[0].remaniningTickets===0)?0:1},this.handleDonationAmount=(e,t)=>{const{donationInputValue:s}=this.state;if(e===""||/^[0-9\b]+$/.test(e)){const{settings:a,addOnCategory:r}=this.addRemoveAddonTicket(t,e>0?1:0);s[t.typeId]=e;const o=e>0,d=e>0?1:0;this.props.onDisableContinue&&this.props.onDisableContinue(!0),this.setState({donationInputValue:s,settings:a,addOnCategory:r,...this.props.onDisableContinue?{}:{disableContinue:!0}},()=>{this.addDonation(t.typeId,t.name,e,o,d)})}},this.onClick=(e,t)=>{const{donationInputValue:s}=this.state;(e===""||/^[0-9\b]+$/.test(e))&&(s[t.typeId]=e,this.setState({donationInputValue:s}))},this.handleNoteChange=e=>{this.noteValue=e},this.hideMapPopup=()=>{this.setState({showMapPopup:!1})},this.onAccessCodeChange=()=>{var e,t;this.setState({accessCodeFailMessage:!1,accessCode:this.accessCode.value,isValidAccessCode:!1,unicodePresent:Xt(this.accessCode.value),accessCodeError:((t=(e=this.accessCode)==null?void 0:e.value)==null?void 0:t.trim())==="",errorMsg:""}),Xt(!this.accessCode.value)&&this.props.storeAccessCode(this.accessCode.value)},this.removeFocusFromAccessCode=()=>{this.setState({accessCodeFailMessage:!1})},this.validateCaptcha=e=>{var t,s;e===null&&((s=(t=this._reCaptchaRef)==null?void 0:t.current)==null||s.reset())},this.openWaitListForm=e=>{var o,d;const{isFromStaff:t,widget:s,embed:n,eventData:a}=this.props,{eventDesignDetails:r}=a||{};if(!(r!=null&&r.enableCaptcha)||this.props.isHost||t||s||n)this.setState({openWaitListPopup:!0,ticketingTypeIdValue:e});else try{this._reCaptchaRef.current.executeAsync().then(c=>{var m,g;c&&((g=(m=this._reCaptchaRef)==null?void 0:m.current)==null||g.reset(),this.setState({openWaitListPopup:!0,ticketingTypeIdValue:e}))})}catch(c){console.log("Captcha error",c),(d=(o=this._reCaptchaRef)==null?void 0:o.current)==null||d.reset(),this.setState({openWaitListPopup:!0,ticketingTypeIdValue:e})}},this.paymentTypeHandler=(e,t)=>{const{allTicketForPayLater:s,isDepositEnabled:n}=this.state;e&&this.setState({paymentType:e,paymentLabel:t},()=>{if(e==="COMPLIMENTARY"&&this.state.appliedDiscountCode){this.removeAppliedDiscountCode();return}(s&&e==="CC"||n&&e==="DEPOSIT"||e==="INVOICE"&&s)&&this.setCalculationFee()})},this.openCollapse=e=>{const{addOnCategory:t}=this.state,s=t.map(n=>n.id===e.id?{...n,open:!n.open}:n);this.setState({addOnCategory:s})},this.recurringEventRadioButton=()=>{const{recurringEventList:e,selectedRecurringEvent:t,disableRecurring:s}=this.state,{t:n}=this.props;return i.createElement("div",null,i.createElement("div",{className:"widget-recurring-selection-content date-header"},i.createElement("span",{className:"tickets-name-design"},n("common:Select Date"))),i.createElement("div",{className:"widget-recurring-selection-content"},Be(Me(e,a=>w(a==null?void 0:a.occursFrom,"DD/MM/YYYY").diff(w(),"day")>=0),(a,r)=>i.createElement(i.Fragment,null,r<2?i.createElement("div",{className:pe("recurring-event-checkbox",t.toString()===a.id.toString()&&"active")},i.createElement("label",{className:pe("btn text-center")},i.createElement("input",{type:"radio",autoComplete:"off",name:a.id,id:a.id,className:pe("default-amount"),defaultValue:a.id,onClick:this.selectRecurringEvent}),i.createElement("span",{className:"event-info text-center"},i.createElement("span",{className:"day"},i.createElement("i",{className:"ac-icon-time"}),i.createElement("span",{className:"day-month"},i.createElement("span",null,`${w(a==null?void 0:a.occursFrom,"DD/MM/YYYY").format("ddd,")}`),i.createElement("span",null,`${w(a==null?void 0:a.occursFrom,"DD/MM/YYYY").format("MMMM DD")}`))),i.createElement("span",{className:"time"},`${w(a.startTime,"HH:mm").format("h:mma")} - ${w(a.endTime,"HH:mm").format("h:mma")}
2`)))):null)),e.length>=3?i.createElement("div",{className:pe("recurring-event-checkbox")},i.createElement("div",{className:"more-recurring-event"},i.createElement(Zi,{className:"icon-theme btn-theme more-recurring-event-dropdown",title:i.createElement("span",null,n("common:More Dates")),id:"dropdown-basic",disabled:s},Be(Me(e,a=>w(a==null?void 0:a.occursFrom,"DD/MM/YYYY").diff(w(),"day")>=0),(a,r)=>i.createElement(en,{eventKey:r,onClick:()=>{this.selectRecurringEvent(a.id,!0)}},i.createElement("span",null,`${w(a==null?void 0:a.occursFrom,"DD/MM/YYYY").format("ddd, MMMM DD")} (${w(a.startTime,"HH:mm").format("h:mma")} - ${w(a.endTime,"HH:mm").format("h:mma")})`)))))):null,i.createElement("div",{className:"view-calendar-content"},i.createElement("a",{onClick:this.handleRecuringCalander,className:"color-prime"},i.createElement("div",{className:"color-prime"},n("common:View Calendar"))))))},this.handleDateJson=e=>Be(Me(e,t=>w(t==null?void 0:t.occursFrom,"DD/MM/YYYY").diff(w(),"day")>=0),t=>({value:t&&t.id,label:`${w(t==null?void 0:t.occursFrom,"DD/MM/YYYY").format("ddd, MMM DD")} (${w(t.startTime,"HH:mm").format("h:mm A")})`})),this.recurringEventDropDown=()=>{const{recurringEventList:e,selectedRecurringEvent:t,disableRecurring:s}=this.state;return i.createElement(Ut,{id:"dropDownRecurringEvent",name:"dropDownRecurringEvent",onChange:n=>{this.selectRecurringEvent(n)},value:t,options:this.handleDateJson(e),disabled:s})},this.removeAccessCode=()=>{var s,n,a;const{recurringEventID:e,selectedRecurringEvent:t}=this.props;this.getTicketTypeAndCategory(e||t),(s=this.manuallyRemovedAutoAddTickets)==null||s.clear(),(n=this.manuallyAdjustedAutoAddTickets)==null||n.clear(),this.autoAddedTicketIds.clear(),(a=this.pendingAutoAddTickets)==null||a.clear(),this.hasUserInteracted=!1,this.originalMinTickerPerBuyer={},this.setState({isValidAccessCode:!1,accessCode:null,unlockedTicketTypeIds:new Set,totalTickets:[],accessCodeSuccessMessage:!1,accessCodeFailMessage:!1}),this.props.onHandelChangeCallBack([],0,0,0,0),this.accessCodeRestoredFromRedux=!1,this.props.storeAccessCode(null),this.accessCode&&(this.accessCode.value="")},this.handleRecuringCalander=()=>{const{showRecurringCal:e}=this.state;this.setState({showRecurringCal:!e})},this.handleEvent=e=>{const{eventDetails:t}=this.props,{eventUrl:s,eventURL:n,recurring:a}=t||{};let r=`/e/${s||n}/newEmbed`;a&&(r=`/e/${s||n}/newEmbed/${e.id}`),this.props.history.push(r),this.handleRecuringCalander()},this.getPriceRange=e=>{const{eventDetails:t}=this.props,s=kn(e.variations,"price"),n=bn(e.variations,"price");let a="";return s&&n&&s.price!==n.price?a=`${t.currencySymbol}${Ue(n.price)} - ${t.currencySymbol}${Ue(s.price)}`:a=`${t.currencySymbol}${n&&Ue(n.price)}`,i.createElement(i.Fragment,null,a)},this.addonSelectionConainer=()=>{var E,h,y;const{addOnCategory:e,totalTickets:t,totalRegRequestTickets:s,accessCodeDetails:n,isValidAccessCode:a}=this.state,{isHost:r,widgetSettings:o,isFromStaff:d,ticketRulesActions:c}=this.props,{borders:m}=o||{},g=d||r,k=g?[]:Object.values(this.mergeTicketList(t,s)||{}),u=(((E=e==null?void 0:e.map(b=>{var C,F,_,$,U,A;const D=this.props.isExhibitorFlow||this.state.expoFpConfig?[...(C=b.variations)==null?void 0:C.filter(x=>(x==null?void 0:x.addonType)!=="EXHIBITOR_BOOTH")]:[...b.variations];let P=D;if(!g&&c){const x=this.mergeTicketList(t,s);P=st(D,c,x,n,a,this.props.exhibitorPurchaseCounts,!0,this.autoAddedTicketIds,this.hasUserInteracted,this.state.ticketTypeRemainingCounts,(F=this.props.eventDetails)==null?void 0:F.equivalentTimezone)}return g||(P=(P||[]).filter(x=>this.isAddonEligibleForCurrentSelection(x,k))),P==null||P.forEach(x=>{x!=null&&x.discountRuleId&&(this.discountRuleIdMap[x.typeId]=x.discountRuleId),this.props.isExhibitorFlow&&(x!=null&&x.limitQuantityRuleId?this.limitQuantityRuleIdMap[x.typeId]=x.limitQuantityRuleId:delete this.limitQuantityRuleIdMap[x.typeId])}),($=(_=this.props).onUpdateDiscountRuleIdMap)==null||$.call(_,this.discountRuleIdMap),(A=(U=this.props).onUpdateLimitQuantityRuleIdMap)==null||A.call(U,this.limitQuantityRuleIdMap),{...b,variations:P}}))==null?void 0:E.filter(b=>{var D;return((D=b.variations)==null?void 0:D.length)>0}))||[]).filter((b,D,P)=>P.findIndex(C=>C.id===b.id)===D);return u.length>0?i.createElement("div",{className:"m-t-20"},i.createElement(ee,{variant:"heading3",color:(y=ce[(h=this.context)==null?void 0:h.theme])==null?void 0:y.neutral1000,className:"m-b-16"},be.t("common:Add-ons")),u.map(b=>$e(b.variations)?b.havingVariations?i.createElement("div",{key:b.id,className:pe("add-attendee-row-border",r&&"bg-white"),style:{border:m&&`1px solid ${m}`}},i.createElement("h4",null,b.name," "),i.createElement("div",null,i.createElement("a",{onClick:()=>this.openCollapse(b),className:"cursor addon-category font-w500"},i.createElement("div",{className:"ticket-price-block"},this.getPriceRange(b)),i.createElement("div",{className:"ticket-price-block"},i.createElement("i",{className:pe("font-s18",b.open?"fa fa-angle-up":"fa fa-angle-down")})))),i.createElement(An,{in:b.open},i.createElement("div",null,this.ticketSelectionContainer(b.variations,!0)))):i.createElement(i.Fragment,{key:b.id},this.ticketSelectionContainer(b.variations,!0)):null)):""},this.handleCollapse=(e,t,s)=>{const{ticketTypeList:n,addOnCategory:a}=this.state;s?Be(a,r=>{r.variations[t]===e&&(e.open=!e.open,r.variations[t]=e)}):e.open=!e.open,this.setState({ticketTypeList:n,addOnCategory:a})},this.checkItemDesc=(e,t)=>{const s=document.getElementById(`desc-${t}-${e}`);return(s==null?void 0:s.offsetHeight)>41},this.renderCheckoutText=e=>{let t="fees";return e!=null&&e.salesTax?(t="tax and fees",e!=null&&e.passFeesToBuyer||(t="tax")):e!=null&&e.vatTax&&(t="VAT and fees",e!=null&&e.passFeesToBuyer||(t="VAT")),t},this.handleTicketSelection=(e,t,s=!1)=>{const{totalTickets:n}=this.state,{ticketRulesActions:a}=this.props;if(s&&n[t.typeId])return;const{settings:r,addOnCategory:o}=this.addRemoveAddonTicket(t,e==null?void 0:e.value);this.selectHandle(e,t),this.setState({addOnCategory:o,settings:r},()=>{var c,m;if(!a)return;const d=n.slice();(e==null?void 0:e.value)>0?d[t.typeId]={...t,numberofticket:e.value}:delete d[t.typeId],(m=(c=a==null?void 0:a.conditionsMap)==null?void 0:c.SELECTED_TICKETS_ADDON)!=null&&m[t.typeId]&&this.evaluateAndApplyRules("SELECTED_TICKETS_ADDON",d,t==null?void 0:t.typeId)})},this.evaluateAndApplyRules=(e,t=[],s)=>{var b,D;const{ticketTypeList:n,addonTicketData:a,ticketTypeRemainingCounts:r,totalRegRequestTickets:o}=this.state,{ticketRulesActions:d}=this.props,c=[];if(!d)return;const m=this.mergeTicketList(t,o),{conditionsMap:g,rulesMap:k}=d,S=(g==null?void 0:g[e])||{};if(((b=Object.keys(S))==null?void 0:b.length)===0)return;const u=new Date,E=`${String(u.getMonth()+1).padStart(2,"0")}/${String(u.getDate()).padStart(2,"0")}/${u.getFullYear()}`,h=[...n||[],...a||[]].map(P=>{const C=dt.find(r,F=>(F==null?void 0:F.ticketTypeId)===(P==null?void 0:P.typeId));return{...P,remaniningTickets:(C==null?void 0:C.remainingCount)??null,soldOut:(C==null?void 0:C.soldOut)||!1}}),y=[];(D=S[s])==null||D.forEach(P=>{var $,U,A,x,H,q,N,V,J;const C=k==null?void 0:k[P];if(!C)return;const F=($=C==null?void 0:C.actions)==null?void 0:$.some(W=>W.action==="Set_Quantity");if(!ot(C,{totalTickets:m,currentDate:E,accessCode:(U=this.state)==null?void 0:U.accessCodeDetails,autoAddedTicketIds:this.autoAddedTicketIds,excludeAutoAddedFromQuantity:F},(A=this.state)==null?void 0:A.isValidAccessCode)){(H=(x=C==null?void 0:C.actions)==null?void 0:x.filter(W=>W.action==="Set_Quantity"))==null||H.forEach(W=>{var te;(te=W==null?void 0:W.targets)==null||te.forEach(j=>{var v,M,de;delete this.originalMinTickerPerBuyer[j],(v=this.manuallyAdjustedAutoAddTickets)==null||v.delete(Number(j)),this.autoAddedTicketIds.delete(Number(j)),(M=this.manuallyRemovedAutoAddTickets)==null||M.delete(Number(j)),(de=this.manuallyRemovedAutoAddTickets)==null||de.delete(String(j))})});return}(N=(q=C==null?void 0:C.actions)==null?void 0:q.filter(W=>
2W.action==="Set_Quantity"))==null||N.forEach(W=>{var te;(te=W==null?void 0:W.targets)==null||te.forEach(j=>{var K,R,T,l,O,B;const v=h.find(I=>Number(I==null?void 0:I.typeId)===Number(j));if(!v||w(v==null?void 0:v.endDate).diff(w())<=0)return;const M={totalTickets:m,currentDate:E,accessCode:(K=this.state)==null?void 0:K.accessCodeDetails};if(Jn(j,d==null?void 0:d.actionMap,k,M,(R=this.state)==null?void 0:R.isValidAccessCode)){const I=t[j]||(o==null?void 0:o[j]);I&&Number(I==null?void 0:I.numberofticket)>0&&this.autoAddedTicketIds.has(Number(j))&&y.push({type:"REMOVE",ticketData:v,quantity:0}),this.autoAddedTicketIds.delete(Number(j)),(T=this.manuallyAdjustedAutoAddTickets)==null||T.delete(Number(j)),delete this.originalMinTickerPerBuyer[j];return}const de=(v==null?void 0:v.dataType)==="ADDON",ke=(v==null?void 0:v.addonType)==="EXHIBITOR_BOOTH";if(de&&!ke){const I=(v==null?void 0:v.listOfTicketTypesForAddOn)||[];if(I.length>0){const Q=I.some(se=>{const ue=t[se]||(o==null?void 0:o[se]);return ue&&Number(ue.numberofticket)>0}),ie=I.some(se=>{var ue;return(ue=this.state.purchasedTicketTypes)==null?void 0:ue.includes(parseInt(se,10))});if(!Q&&!ie)return}}const fe=(v==null?void 0:v.remaniningTickets)!=null&&(v==null?void 0:v.remaniningTickets)>0&&(v==null?void 0:v.remaniningTickets)<W.quantity?v.remaniningTickets:W.quantity||(v==null?void 0:v.minTickerPerBuyer)||0,Te=o==null?void 0:o[j],L=t[j]||Te;if(L&&Number(L==null?void 0:L.numberofticket)>0){const I=Number((L==null?void 0:L.numberofticket)||0),Q=(l=this.manuallyAdjustedAutoAddTickets)==null?void 0:l.get(Number(j));I<fe&&(Q==null||fe>Q)&&(Q!=null&&((O=this.manuallyAdjustedAutoAddTickets)==null||O.delete(Number(j))),this.originalMinTickerPerBuyer[j]==null&&(this.originalMinTickerPerBuyer[j]=(L==null?void 0:L.minTickerPerBuyer)||(v==null?void 0:v.minTickerPerBuyer)||0),y.push({type:"SET",ticketData:v,quantity:fe})),t[j]={...t[j],minTickerPerBuyer:this.originalMinTickerPerBuyer[j]??((B=t[j])==null?void 0:B.minTickerPerBuyer)??0}}else{if(w(v==null?void 0:v.startDate).diff(w())>=0||v!=null&&v.waitList)return;if(!v||v!=null&&v.soldOut||(v==null?void 0:v.remaniningTickets)!=null&&(v==null?void 0:v.remaniningTickets)<=0){c.push(v==null?void 0:v.name);return}this.originalMinTickerPerBuyer[j]==null&&(this.originalMinTickerPerBuyer[j]=(v==null?void 0:v.minTickerPerBuyer)||0),y.push({type:"ADD",ticketData:v,quantity:fe}),t[j]={...v,tickettypeid:v.typeId,numberofticket:fe,minTickerPerBuyer:this.originalMinTickerPerBuyer[j]??(v==null?void 0:v.minTickerPerBuyer)??0}}})}),(J=(V=C==null?void 0:C.actions)==null?void 0:V.filter(W=>W.action==="HIDE"))==null||J.forEach(W=>{var te;(te=W==null?void 0:W.targets)==null||te.forEach(j=>{var M;const v=t[j]||(o==null?void 0:o[j]);if(v&&Number(v==null?void 0:v.numberofticket)>0){const de=h.find(ke=>Number(ke==null?void 0:ke.typeId)===Number(j));de&&y.push({type:"REMOVE",ticketData:de,quantity:0})}this.autoAddedTicketIds.delete(Number(j)),(M=this.manuallyAdjustedAutoAddTickets)==null||M.delete(Number(j)),delete this.originalMinTickerPerBuyer[j]})})}),c.length>0&&(this._soldOutTicketsCollection||(this._soldOutTicketsCollection=[]),this._soldOutTicketsCollection.push(...c),this._soldOutPopupTimeout&&clearTimeout(this._soldOutPopupTimeout),this._soldOutPopupTimeout=setTimeout(()=>{if(this._soldOutTicketsCollection.length>0&&!this.state.showRuleValidationPopup){const P=[...new Set(this._soldOutTicketsCollection)];this.setState({validationMessage:`The add-on/ticket ${P.join(", ")} included with this ticket is sold out and couldn't be added to the order. Please reach out to event staff for assistance.`}),this._soldOutTicketsCollection=[]}},500)),y.length>0&&this.applyRuleActions(y)},this.applyRuleActions=e=>{const t=this.pendingAddDonationPromise||Promise.resolve(),{settings:s,addOnCategory:n,totalTickets:a,totalRegRequestTickets:r,ticketTypeList:o,addonTicketData:d}=this.state;let c=s,m=n,g=o,k=d;const S=a.slice(),u=r?r.slice():[];e.forEach(({type:E,ticketData:h,quantity:y})=>{var _,$,U,A;const b=h.typeId,D=h.registrationApprovalRequired,P=D?u:S,C=P[b],F=this.addRemoveAddonTicket(h,y,c);if(c=F==null?void 0:F.settings,m=F==null?void 0:F.addOnCategory,E==="REMOVE")S[b]&&delete S[b],u[b]&&delete u[b],this.autoAddedTicketIds.delete(Number(b)),(_=this.manuallyAdjustedAutoAddTickets)==null||_.delete(Number(b));else if(E==="SET"){const x=y,H=((U=($=h==null?void 0:h.ticketRuleActions)==null?void 0:$.Max_Quantity)==null?void 0:U.length)>0&&h.setMaxQuantity,q=((A=this.originalMinTickerPerBuyer)==null?void 0:A[b])??(h==null?void 0:h.minTickerPerBuyer)??0,N=V=>{if(String(V.typeId)!==String(b))return V;const J={...V};return H?J.maxTickerPerBuyer=x:J.minTickerPerBuyer=q,J};if(c!=null&&c.ticketTypes&&(c={...c,ticketTypes:c.ticketTypes.map(N)}),g&&(g=g.map(N)),k&&(k=k.map(N)),C&&Number(C.numberofticket)>0){const V=Number(C.numberofticket),J=V!==x?x:V,W={...C,numberofticket:J,individualPrice:h.price*J};H?W.maxTickerPerBuyer=x:W.minTickerPerBuyer=q,P[b]=W}}else if(E==="ADD"){this.pendingAutoAddTickets||(this.pendingAutoAddTickets=new Set),this.pendingAutoAddTickets.add(b),this.autoAddedTicketIds.add(Number(b));const x=y||(C==null?void 0:C.numberofticket)||h.minTickerPerBuyer||1,H={...h,numberofticket:x,tickettypeid:b,price:h.price,individualPrice:h.price*x};P[b]=H;const q=D?S:u;q[b]&&delete q[b]}}),this.isApplyingRuleActions=!0,this.setState({settings:c,addOnCategory:m,totalTickets:S,totalRegRequestTickets:u,ticketTypeList:g,addonTicketData:k,isEnforcingRules:!0},()=>{if(c&&this.props.storeEventTicketData(c),c!=null&&c.ticketTypes){const{ticketingTypes:C}=this.props;this.props.storeEventTicketType({...C,ticketTypes:c.ticketTypes})}const E=[],h=[];e.forEach(({type:C,ticketData:F,quantity:_})=>{C==="REMOVE"?E.push(this.selectHandle({value:0,label:0},F)):C==="SET"?E.push(this.selectHandle({value:_,label:_},F)):C==="ADD"&&(F.registrationApprovalRequired?E.push(this.selectHandle({value:_,label:_},{...F,minTickerPerBuyer:0})):h.push({ticketData:F,quantity:_}))});const y=3e3;let b=!1,D;const P=()=>
2{b||(b=!0,clearTimeout(D),this.isApplyingRuleActions=!1,this.processAddonAutoAdd(),this.removeHiddenTicketsFromCart(),this.enforceLimitQuantityRules(),this.isApplyingRuleActions||this.setState({isEnforcingRules:!1}))};D=setTimeout(P,y),Promise.all([t,...E]).then(()=>h.length?Promise.all(h.map(({ticketData:C,quantity:F})=>this.selectHandle({value:F,label:F},{...C,minTickerPerBuyer:0}))):null).then(P,P)})},this.processAddonAutoAdd=()=>{var E;const{ticketRulesActions:e,isHost:t,isFromStaff:s}=this.props;if(!e||t||s)return;const{totalTickets:n,totalRegRequestTickets:a,addonTicketData:r,ticketTypeList:o,accessCodeDetails:d,isValidAccessCode:c}=this.state;if(!(r!=null&&r.length))return;const m=this.mergeTicketList(n,a),g=[...o||[],...r||[]],k=st(g,e,m,d,c,this.props.exhibitorPurchaseCounts,!0,this.autoAddedTicketIds,this.hasUserInteracted,this.state.ticketTypeRemainingCounts,(E=this.props.eventDetails)==null?void 0:E.equivalentTimezone),{purchasedTicketTypes:S}=this.state,u=[];k==null||k.forEach(h=>{var C,F,_,$,U,A,x,H;if((h==null?void 0:h.dataType)!=="ADDON")return;const y=m[h==null?void 0:h.typeId]&&Number((C=m[h==null?void 0:h.typeId])==null?void 0:C.numberofticket)>0,b=(h==null?void 0:h.addonType)==="EXHIBITOR_BOOTH",D=(h==null?void 0:h.listOfTicketTypesForAddOn)||[],P=b||D.length===0?!0:D.some(q=>{const N=n[q]||(a==null?void 0:a[q]);return N&&Number(N.numberofticket)>0})||D.some(q=>S==null?void 0:S.includes(parseInt(q,10)));if(h!=null&&h.shouldAutoAdd&&P&&!(h!=null&&h.soldOut)&&!y&&!((F=this.pendingAutoAddTickets)!=null&&F.has(h==null?void 0:h.typeId))&&!((_=this.manuallyRemovedAutoAddTickets)!=null&&_.has(h==null?void 0:h.typeId))&&!(($=this.manuallyRemovedAutoAddTickets)!=null&&$.has(Number(h==null?void 0:h.typeId)))&&w(h==null?void 0:h.endDate).diff(w())>=0&&w(h==null?void 0:h.startDate).diff(w())<0&&!(h!=null&&h.waitList))u.push({type:"ADD",ticketData:h,quantity:h.autoAddQuantity||h.minTickerPerBuyer||1});else if(h!=null&&h.setMinQuantity&&y&&!(h!=null&&h.shouldHide)){const q=h.autoAddQuantity||h.minTickerPerBuyer,N=Number(((U=m[h==null?void 0:h.typeId])==null?void 0:U.numberofticket)||0),V=(A=this.manuallyAdjustedAutoAddTickets)==null?void 0:A.get(Number(h==null?void 0:h.typeId)),J=V!=null&&q<=V;q&&N>0&&N<q&&!J&&(V!=null&&((x=this.manuallyAdjustedAutoAddTickets)==null||x.delete(Number(h==null?void 0:h.typeId))),this.originalMinTickerPerBuyer[h.typeId]==null&&(this.originalMinTickerPerBuyer[h.typeId]=Number(((H=m[h==null?void 0:h.typeId])==null?void 0:H.minTickerPerBuyer)||h.minTickerPerBuyer||0)),u.push({type:"SET",ticketData:h,quantity:q}))}}),u.length>0&&this.applyRuleActions(u)},this.removeHiddenTicketsFromCart=()=>{var u;const{ticketRulesActions:e,isHost:t,isFromStaff:s}=this.props;if(!e||t||s||this.isApplyingRuleActions)return;const{totalTickets:n,totalRegRequestTickets:a,addonTicketData:r,ticketTypeList:o,accessCodeDetails:d,isValidAccessCode:c}=this.state,m=this.mergeTicketList(n,a),g=[...o||[],...r||[]];if(!g.length)return;const k=st(g,e,m,d,c,this.props.exhibitorPurchaseCounts,!0,this.autoAddedTicketIds,this.hasUserInteracted,this.state.ticketTypeRemainingCounts,(u=this.props.eventDetails)==null?void 0:u.equivalentTimezone),S=[];m.forEach(E=>{if(!E||Number(E.numberofticket)===0)return;const h=(E==null?void 0:E.typeId)||(E==null?void 0:E.tickettypeid),y=k==null?void 0:k.some(D=>Number(D==null?void 0:D.typeId)===Number(h)),b=g.find(D=>Number(D==null?void 0:D.typeId)===Number(h));b&&!y&&S.push({type:"REMOVE",ticketData:b,quantity:0})}),S.length>0&&this.applyRuleActions(S)},this.enforceLimitQuantityRules=()=>{var u;if(!this.props.isExhibitorFlow||this.isApplyingRuleActions)return;const{ticketRulesActions:e,isHost:t,isFromStaff:s}=this.props;if(!e||t||s)return;const{totalTickets:n,totalRegRequestTickets:a,addonTicketData:r,ticketTypeList:o,accessCodeDetails:d,isValidAccessCode:c}=this.state,m=this.mergeTicketList(n,a),g=[...o||[],...r||[]];if(!g.length)return;const k=st(g,e,m,d,c,this.props.exhibitorPurchaseCounts,!0,this.autoAddedTicketIds,this.hasUserInteracted,this.state.ticketTypeRemainingCounts,(u=this.props.eventDetails)==null?void 0:u.equivalentTimezone),S=[];
2k.forEach(E=>{const h=m[E.typeId];if(!h||Number(h.numberofticket)===0)return;const y=Number(h.numberofticket);E.limitQuantityRuleId&&!E.setMaxQuantity&&y>E.maxTickerPerBuyer&&S.push({type:"SET",ticketData:{...E,minTickerPerBuyer:0},quantity:E.maxTickerPerBuyer})}),S.length>0&&this.applyRuleActions(S)},this.renderRegistrationUnavailable=(e,t)=>{var o,d;const{limitRegistrationEmails:s,settings:n,accessCodeSuccessMessage:a,addonTicketData:r}=this.state;return pt(e)&&s?n!=null&&n.accessCodeAvailable&&((o=n==null?void 0:n.ticketTypes)==null?void 0:o.length)===0||t?null:n!=null&&n.accessCodeAvailable&&((d=n==null?void 0:n.ticketTypes)==null?void 0:d.length)>0&&!a?this.renderAccesCode():$e(r)>0?null:i.createElement(Fn,{isUserLoggedIn:!0}):null},this.mergeTicketList=(e,t)=>{const s=e?e.slice():[];return t&&Object.values(t).forEach(n=>{if(n&&(n.tickettypeid||n.typeId)){const a=n.tickettypeid||n.typeId;s[a]=n}}),s},this.refreshDiscountRuleIdMap=e=>{var P,C,F,_,$;const{ticketRulesActions:t,isHost:s,isFromStaff:n}=this.props;if(!t||s||n)return;const{hasPercentageDiscountAction:a,hasTieredOrCrossTicketRule:r,hasSetPriceAction:o,hasFlatDiscountAction:d}=t||{};if(!(o||d||r||a))return;const{totalRegRequestTickets:m,settings:g,addonTicketData:k,accessCodeDetails:S,isValidAccessCode:u}=this.state,{ticketingSettings:E}=this.props,{ticketTypes:h}=g||E||{},y=this.mergeTicketList(e,m),b=[...h||[],...k||[]],D=st(b,t,y,S,u,this.props.exhibitorPurchaseCounts,!0,this.autoAddedTicketIds,this.hasUserInteracted,this.state.ticketTypeRemainingCounts,(P=this.props.eventDetails)==null?void 0:P.equivalentTimezone);D==null||D.forEach(U=>{U!=null&&U.discountRuleId?(this.discountRuleIdMap[U.typeId]=U.discountRuleId,this.refreshSetDiscountKeys.add(U.typeId)):this.refreshSetDiscountKeys.has(U.typeId)&&(delete this.discountRuleIdMap[U.typeId],this.refreshSetDiscountKeys.delete(U.typeId)),this.props.isExhibitorFlow&&(U!=null&&U.limitQuantityRuleId?this.limitQuantityRuleIdMap[U.typeId]=U.limitQuantityRuleId:delete this.limitQuantityRuleIdMap[U.typeId]),this.props.isExhibitorFlow&&(U!=null&&U.limitQuantityRuleId?this.limitQuantityRuleIdMap[U.typeId]=U.limitQuantityRuleId:delete this.limitQuantityRuleIdMap[U.typeId])}),(F=(C=this.props).onUpdateDiscountRuleIdMap)==null||F.call(C,this.discountRuleIdMap),($=(_=this.props).onUpdateLimitQuantityRuleIdMap)==null||$.call(_,this.limitQuantityRuleIdMap)},this.recalculateNormalTicketsIfDiscountChanged=e=>{const{ticketRulesActions:t,isHost:s,isFromStaff:n}=this.props;if(!t||s||n)return;const{hasPercentageDiscountAction:a,hasTieredOrCrossTicketRule:r,hasSetPriceAction:o,hasFlatDiscountAction:d}=t||{},c=o||d;if(!a&&!c||!r&&!c)return;const{totalTickets:m}=this.state;if(!(m!=null&&m.length))return;const g=this.mergeTicketList(m,e);this.refreshDiscountRuleIdMap(g),m.forEach(k=>{var E;if(!k)return;const S=this.discountRuleIdMap[k.tickettypeid];S?k.ruleId=S:delete k.ruleId;const u=(E=this.limitQuantityRuleIdMap)==null?void 0:E[k.tickettypeid];u?k.limitQuantityRuleId=u:delete k.limitQuantityRuleId}),this.setCalculationFee({notifyParent:!0})},this.ticketSelectionContainer=(e,t=!0)=>{var L,Z,K,R,T;const{widgetSettings:s,eventDetails:n,isFromStaff:a,isHost:r,isIcon:o,t:d,isFromWaitlist:c,ticketingSettings:m,ticketRulesActions:g,isExhibitorFlow:k}=this.props,{settings:S,totalTickets:u,totalRegRequestTickets:E,ticketTypeFeesAndDesc:h,ticketTypeRemainingCounts:y,addonTicketData:b,accessCode:D,isValidAccessCode:P,unlockedTicketTypeIds:C}=this.state,F=(D||"").trim().toUpperCase(),_=a||r,{borders:$,secondaryTextColor:U,ticketPriceColor:A}=s||{},{eventCapacityReach:x}=S||{},{eventFormat:H,equivalentTimezone:q}=n||{},N=t?e:tn(e),V=((N==null?void 0:N.some(l=>l==null?void 0:l.allowAssignedSeating))||this.hasSeatedBoothAddon())&&H!=="VIRTUAL",J=this.mergeTicketList(u,E),W=_?N:st(N,g,J,this.state.accessCodeDetails,this.state.isValidAccessCode,this.props.exhibitorPurchaseCounts,!0,this.autoAddedTicketIds,this.hasUserInteracted,this.state.ticketTypeRemainingCounts,(L=this.props.eventDetails)==null?void 0:L.equivalentTimezone);W.forEach(l=>{l!=null&&l.discountRuleId?this.discountRuleIdMap[l.typeId]=l.discountRuleId:delete this.discountRuleIdMap[l.typeId],this.props.isExhibitorFlow&&(l!=null&&l.limitQuantityRuleId?this.limitQuantityRuleIdMap[l.typeId]=l.limitQuantityRuleId:delete this.limitQuantityRuleIdMap[l.typeId]),this.props.isExhibitorFlow&&(l!=null&&l.limitQuantityRuleId?this.limitQuantityRuleIdMap[l.typeId]=l.limitQuantityRuleId:delete this.limitQuantityRuleIdMap[l.typeId])}
2),(K=(Z=this.props).onUpdateDiscountRuleIdMap)==null||K.call(Z,this.discountRuleIdMap),(T=(R=this.props).onUpdateLimitQuantityRuleIdMap)==null||T.call(R,this.limitQuantityRuleIdMap);const te=W.map(l=>{const O=dt.find(h,I=>(I==null?void 0:I.ticketTypeId)===(l==null?void 0:l.typeId)),B=dt.find(y,I=>(I==null?void 0:I.ticketTypeId)===(l==null?void 0:l.typeId));return l.ticketTypeDescription=O==null?void 0:O.description,l.fee=(O==null?void 0:O.fee)||0,l.salesTax=(O==null?void 0:O.salesTax)||0,l.vatTax=(O==null?void 0:O.vatTax)||0,l.remaniningTickets=(B==null?void 0:B.remainingCount)||0,l.waitList=(B==null?void 0:B.waitList)||!1,l.soldOut=(B==null?void 0:B.soldOut)||!1,l}),j=this.props.isExhibitorFlow?te.filter(l=>!(l!=null&&l.registrationApprovalRequired)):te;Mt=V?j.filter(l=>!(l!=null&&l.allowAssignedSeating)):j;const v=(l,O,B)=>{var ue;const I=[],Q=(ue=S.ticketTypes)==null?void 0:ue.find(ae=>(ae==null?void 0:ae.typeId)===B&&(ae==null?void 0:ae.dataType)==="ADDON"&&(ae==null?void 0:ae.addonType)!=="EXHIBITOR_BOOTH"),se=(u==null?void 0:u.some(ae=>{var Y;return((Y=Q==null?void 0:Q.listOfTicketTypesForAddOn)==null?void 0:Y.includes(parseInt(ae==null?void 0:ae.tickettypeid,10)))&&(ae==null?void 0:ae.tickettypeid)!==(B==null?void 0:B.toString())}))&&(Q==null?void 0:Q.minTickerPerBuyer)>0;l&&!se&&I.push({value:0,key:l,label:0});for(let ae=l;ae<=O;ae++)I.push({value:ae,key:l,label:ae});return I},M=(l,O)=>{var Ne,Ie,Oe,He,z,Ce,le;const B=(l==null?void 0:l.setPrice)!==null&&(l==null?void 0:l.setPrice)!==void 0,I=B&&Number(l.setPrice)<Number((l==null?void 0:l.price)||0),Q=u==null?void 0:u.find(ne=>String(ne==null?void 0:ne.tickettypeid)===String(l==null?void 0:l.typeId)),ie=!!Q&&Number(Q==null?void 0:Q.numberofticket)>0,se=!B&&!(l!=null&&l.hasTieredDiscount)&&(l==null?void 0:l.discountedQuantity)>0&&(l==null?void 0:l.percentageDiscount)>0&&ie,ue=I||se,ae=B?Number(l.setPrice):0,Y=Number(l==null?void 0:l.percentageDiscount)/100,me=(l==null?void 0:l.price)*(1-Y),re=B?ae:me,Se=me%1===0?me:me.toFixed(2),he=ae%1===0?ae:ae.toFixed(2);return i.createElement("div",{className:pe("p-0 price-decor",O)},i.createElement("div",{className:"pr-4 d-flex justify-content-md-start mt-md-12 align-items-end justify-content-start flex-md-column flex-row"},l!=null&&l.price&&l.price!==0?i.createElement(i.Fragment,null,B&&ae===0?i.createElement(ee,{variant:"subtitle",color:A||((Ie=ce[(Ne=this.context)==null?void 0:Ne.theme])==null?void 0:Ie.neutral1000),labelClass:"ticket-cost",className:"mr-2 mr-md-0"},d("common:Free")):i.createElement(ee,{variant:"subtitle",color:A||((He=ce[(Oe=this.context)==null?void 0:Oe.theme])==null?void 0:He.neutral1000),labelClass:"ticket-cost",className:"mr-2 mr-md-0"},n.currencySymbol,B?Ue(he):se?Ue(Se):l.price%1===0?Ue(l.price):Ue((z=l==null?void 0:l.price)==null?void 0:z.toFixed(2))),ue&&i.createElement(ee,{variant:"footer1",className:"mr-2 mr-md-0",labelClass:"ticket-original-price"},n.currencySymbol,l.price%1===0?Ue(l.price):Ue(l.price.toFixed(2)))):i.createElement(ee,{variant:"subtitle",color:A||((le=ce[(Ce=this.context)==null?void 0:Ce.theme])==null?void 0:le.neutral1000),labelClass:"ticket-cost"},d("common:Free")),l&&l.price!==0&&!(ue&&re===0)&&i.createElement(ee,{variant:"footer1",color:A,labelClass:"tickets-fees"},(l==null?void 0:l.passFeesVatToBuyer)===!1&&(l==null?void 0:l.passFeesToBuyer)===!1?"VAT Included":Ue(l.fee)===0?null:i.createElement("span",null,i.createElement("span",null,`+${n.currencySymbol}${Ue(l.fee.toFixed(2))} ${this.renderCheckoutText(l)}`)))))},de=(l,O)=>{const B=l.limitQuantityRuleId?l.maxTickerPerBuyer:l.remaniningTickets;return S.showRemainingTickets&&(l.minTickerPerBuyer>0?B>=l.minTickerPerBuyer:B>0)&&!(x&&(l==null?void 0:l.dataType)!=="ADDON")&&(!(w(l&&l.endDate).tz(q).diff(w())<=0)||_)&&w(l&&l.startDate).tz(q).diff(w())<=0&&i.createElement(i.Fragment,null,i.createElement(hn,{size:"normal",className:O},`${Ue(B)} ${d("common:Remaining")}`))},{totalTickets:ke}=this.state,fe=(ke||[]).filter(l=>l),Te=new Map;fe.forEach(l=>{const O=Number(l==null?void 0:l.tickettypeid);Number.isNaN(O)||Te.set(O,l)});const G=[...(S==null?void 0:S.ticketTypes)||[],...b||[]];return i.createElement(i.Fragment,null,this.renderRegistrationUnavailable(Mt,V),Mt&&(Mt||[]).filter(l=>l.ticketType!=="DONATION").map((l,O,B)=>{var he,Ne,Ie,Oe,He,z;const I=O===B.length-1,Q=Te.get(Number(l==null?void 0:l.typeId)),ie=Q?Number(Q==null?void 0:Q.numberofticket):null,se=k?co({appliedQuantityRules:l==null?void 0:l.appliedQuantityRules,originalQty:(he=this.preAdjustmentQuantityMap)==null?void 0:he[l.typeId],adjustedQty:ie,ticketTypes:G,t:
2d}):null,ue=!(m!=null&&m.holderAttributeRequired)&&(m==null?void 0:m.uniqueTicketHolderEmail)&&Ba(J,l)||this.isCapacityReachedInExistingOrder(l)||this.shouldNotAllowTouchNetPayment(l)||this.props.isExhibitorFlow&&!!l.limitQuantityRuleId&&l.maxTickerPerBuyer===0||this.isMinExceedsAllotmentLimit(l),ae=!!se&&!ue,Y=!this.props.isHost&&!this.props.isFromStaff&&P&&!!C&&C.has(l.typeId),me=l!=null&&l.registrationApprovalRequired?Number(((Ie=E==null?void 0:E[l==null?void 0:l.typeId])==null?void 0:Ie.numberofticket)||0):Number(((Ne=Te.get(Number(l==null?void 0:l.typeId)))==null?void 0:Ne.numberofticket)||0);let re="";if((l==null?void 0:l.dataType)==="ADDON"){const Ce=(Oe=S.ticketTypes)==null?void 0:Oe.find(ne=>(ne==null?void 0:ne.typeId)===(l==null?void 0:l.typeId)&&(ne==null?void 0:ne.dataType)==="ADDON"&&(ne==null?void 0:ne.addonType)!=="EXHIBITOR_BOOTH"),le=(Ce==null?void 0:Ce.listOfTicketTypesForAddOn)||[];re=fe.filter(ne=>le.includes(parseInt(ne==null?void 0:ne.tickettypeid,10))).map(ne=>`${ne==null?void 0:ne.tickettypeid}:${ne==null?void 0:ne.numberofticket}`).join(",")}const Se=[l==null?void 0:l.typeId,l==null?void 0:l.name,l==null?void 0:l.position,l==null?void 0:l.price,l==null?void 0:l.setPrice,l==null?void 0:l.fee,l==null?void 0:l.percentageDiscount,l==null?void 0:l.discountedQuantity,l==null?void 0:l.hasTieredDiscount,l==null?void 0:l.remaniningTickets,l==null?void 0:l.maxTickerPerBuyer,l==null?void 0:l.minTickerPerBuyer,l==null?void 0:l.soldOut,l==null?void 0:l.waitList,l==null?void 0:l.dataType,l==null?void 0:l.ticketType,l==null?void 0:l.registrationApprovalRequired,l==null?void 0:l.limitQuantityRuleId,l==null?void 0:l.discountRuleId,l==null?void 0:l.ticketTypeDescription,l==null?void 0:l.ticketsPerTable,l==null?void 0:l.bundleType,l==null?void 0:l.endDate,l==null?void 0:l.startDate,l==null?void 0:l.passFeesToBuyer,l==null?void 0:l.passFeesVatToBuyer,me,ue,this.getRemaingTicketCount(l),re,!!this.state.menuPlaceTopMap[String(l==null?void 0:l.typeId)],ae,se?JSON.stringify(se):"",Y,F,(He=this.context)==null?void 0:He.theme,x,q].map(Ce=>Ce&&typeof Ce=="object"?JSON.stringify(Ce):String(Ce??"")).join("|");return i.createElement(io,{key:l.typeId,sig:Se,item:l,theme:(z=this.context)==null?void 0:z.theme,borders:$,secondaryTextColor:U,isIcon:o,isFromWaitlist:c,isExhibitorFlow:this.props.isExhibitorFlow,isHost:this.props.isHost,isFromStaff:this.props.isFromStaff,isOnBording:this.props.isOnBording,eventCapacityReach:x,equivalentTimezone:q,t:d,isCardDisabled:ue,showRuleBanner:ae,ruleBannerData:se,isUnlockedByAccessCode:Y,unlockedCodeL
2abel:F,renderPrice:M,renderRemaining:de,renderSelection:()=>this.renderTicketSelectionElement(l,u,E,_,m,v,Ba,I)})}))},this.handleBackBtn=()=>{var e,t;this.setState({showCheckout:!1}),(t=(e=this.props).onCheckoutBack)==null||t.call(e)},this.toggleSeatsioFullScreen=()=>{const{isSeatsioFullScreen:e}=this.state;this.setState({isSeatsioFullScreen:!e},()=>{this.props.handleSeatIoFullScreen()})},this.handleImportAttendees=()=>{this.setState({showImportAttendeesModal:!0}),this.fetchAttendeeProperties()},this.handleCloseImportAttendeesModal=()=>{this.setState({showImportAttendeesModal:!1})},this.handleConfirmAttendeeImport=async e=>{var d,c;const{selectedFile:t,selectedTicket:s,selectedAddon:n,eventUrl:a,columnMappings:r}=e,{uploadAttendeeCSVItems:o}=this.props;try{const m=await o(a,t,null,"File",[s==null?void 0:s.value,n==null?void 0:n.value].join(","),r),g=(m==null?void 0:m.data)||m;return{success:!0,results:{file:t,entityType:"Attendee",fileName:t.name,fileSize:t.size,selectedTicket:s,selectedAddon:n,response:g,apiResponse:g,statistics:{newCount:((d=g==null?void 0:g.validAttendeeList)==null?void 0:d.length)||0,updatedCount:0,invalidCount:((c=g==null?void 0:g.invali
2dAttendeeList)==null?void 0:c.length)||0},customMessage:(g==null?void 0:g.successMessage)||(g==null?void 0:g.errorMessage),isError:!!(g!=null&&g.errorMessage)}}}catch(m){throw this.showMessage(m.message||"An error occurred while uploading the CSV file. Please try again.",!0),m}},this.fetchAttendeeProperties=()=>{const{eventData:e,eventDetails:t,getAttendeeCSVDefaultFields:s}=this.props,n=(e==null?void 0:e.eventUrl)||(e==null?void 0:e.eventURL)||(t==null?void 0:t.eventUrl)||(t==null?void 0:t.eventURL);n&&s(n).then(a=>{a&&a.data&&Array.isArray(a.data)&&this.setState({attendeeProperties:a.data})}).catch(a=>{console.error("Failed to fetch attendee properties:",a)})},this.handleAccessCode=()=>{this.setState({openAccessCode:!0})},this.displayPaymentOptionBtn=(e,t)=>{var m,g;const{paymentType:s,isDepositEnabled:n,allTicketForPayLater:a,hasSomePayLaterTickets:r}=this.state,{isFromStaff:o,isHost:d}=this.props,c=()=>(e==null?void 0:e.value)==="CC"&&!d&&!o&&(n||a||r)?be.t("common:Pay now"):(e==null?void 0:e.value)==="INVOICE"&&!d&&!o&&r&&!a?be.t("common:Pay Minimum"):!d&&!o&&(e==null?void 0:e.value)==="INVOICE"?be.t("common:Pay Later"):e==null?void 0:e.label;return i.createElement("div",{className:pe("payment-container-btn",s===(e==null?void 0:e.value)&&"selected-payment-type",o&&"staff-payment-btn"),onClick:()=>this.paymentTypeHandler(e==null?void 0:e.value,e==null?void 0:e.label)},i.createElement(ps,{className:pe("d-flex w-100p justify-space-between")},i.createElement("div",{className:"d-flex"},i.createElement(_e,{svgIcon:e.icon,width:e.width,height:e.height,viewBox:e.viewBox,color:"none",className:"m-t-2"}),i.createElement(ee,{variant:"body2",labelClass:pe("m-b-0 m-l-12 payment-btn-label",s===(e==null?void 0:e.value)&&"payment-active-label"),color:(g=ce[(m=this.context)==null?void 0:m.theme])==null?void 0:g.neutral850},c())),i.createElement("div",{className:"payment-radio-btn"},i.createElement(sn,{value:e.value,name:`${e}-paymentOption?.label`,id:`${e==null?void 0:e.value}-${t}`,checked:s===(e==null?void 0:e.value)}))))}
2,this.loadDisplayCode=async()=>{const e=await this.getDisplayCode();this.setState({displayCode:e})},this.checkOtherTicketTypeSelected=(e,t)=>{var o;const{totalTickets:s,totalRegRequestTickets:n}=this.state,a=(o=e==null?void 0:e.listOfTicketTypesForAddOn)==null?void 0:o.filter(d=>d!==(t==null?void 0:t.typeId));return[...s||[],...n||[]].filter(Boolean).findIndex(d=>a==null?void 0:a.includes(parseInt(d==null?void 0:d.tickettypeid,10)))===-1},this.addRemoveAddonTicket=(e,t)=>{var m,g,k,S;const{addonTicketData:s,settings:n}=this.state,{isHost:a,isFromStaff:r,isStaff:o}=this.props,d={data:{...n,ticketTypes:[...(n==null?void 0:n.ticketTypes)||[]]}},c=[];if(a||r||o)(this.state.addOnCategory||[]).forEach(u=>{(u==null?void 0:u.dataType)==="ADDON"&&c.push({...u})});else{if(t>0){const E=s==null?void 0:s.filter(y=>{var b;return(y==null?void 0:y.addonType)==="EXHIBITOR_BOOTH"||((b=y==null?void 0:y.listOfTicketTypesForAddOn)==null?void 0:b.includes(e.typeId))}),h=lt((m=d==null?void 0:d.data)==null?void 0:m.ticketTypes,E,"typeId");d.data.ticketTypes=h}else{const E=(k=(g=d.data)==null?void 0:g.ticketTypes)==null?void 0:k.filter(h=>{var y;return(h==null?void 0:h.addonType)==="EXHIBITOR_BOOTH"||!((y=h==null?void 0:h.listOfTicketTypesForAddOn)!=null&&y.includes(e==null?void 0:e.typeId)&&this.checkOtherTicketTypeSelected(h,e)&&!this.checkTicketIsPurchasedForAddon(h))});d.data.ticketTypes=E}const u=this.state.addOnCategory||[];u.length&&((S=d.data)!=null&&S.ticketTypes)&&u.map(h=>{var y;return{...h,variations:(y=d.data)==null?void 0:y.ticketTypes.filter(b=>(b==null?void 0:b.categoryId)===(h==null?void 0:h.id))}}).forEach(h=>{(h==null?void 0:h.dataType)==="ADDON"&&c.push(h)})}return{settings:d.data,addOnCategory:c}},this.showMessage=(e,t=!1)=>{this.setState({message:e,isError:t},()=>{this.clearMessage()})},this.clearMessage=()=>{setTimeout(()=>{this.setState({isError:!1,message:""})},2e3)},this.selectSeatTicket=(e,t,s,n,a,r)=>{const{settings:o,addOnCategory:d}=this.addRemoveAddonTicket(e,t);this.setState({addOnCategory:d,settings:o},()=>{this.addDonation(e.typeId,e.name,e.price,!1,t,e.fee,s,n,a,r,"",!1,e.payLater,!1,e.minTickerPerBuyer,e.maxTickerPerBuyer)})},this.renderPaymentOption=(e,t)=>{const{isDepositEnabled:s,allTicketForPayLater:n,paymentType:a}=this.state,{isFromStaff:r,isRegApproval:o,isFromWaitlist:d,eventDetails:c}=this.props,{paymentGateway:m}=c||{},g=m==="TOUCHNET"?["UNPAID","INVOICE","DEPOSIT","CC"]:[],k=m==="TOUCHNET"?!(g!=null&&g.includes(e==null?void 0:e.value)):!0;if(r){if((e==null?void 0:e.value)!=="COMPLIMENTARY"&&(e==null?void 0:e.value)!=="UNPAID"&&(e==null?void 0:e.value)!=="INVOICE"&&(e==null?void 0:e.value)!=="DEPOSIT"&&k)return this.displayPaymentOptionBtn(e,t,a);if(n&&(e==null?void 0:e.value)==="INVOICE"&&k)return this.displayPaymentOptionBtn(e,t,a)}else if(o||d){if((e==null?void 0:e.value)==="INVOICE"&&!s||(e==null?void 0:e.value)==="CC")return this.displayPaymentOptionBtn(e,t,a);if((e==null?void 0:e.value)==="DEPOSIT"&&s)return this.displayPaymentOptionBtn(e,t,a)}else{if(e.value!=="INVOICE"&&e.value!=="DEPOSIT"&&k)return this.displayPaymentOptionBtn(e,t,a);if(n&&(e==null?void 0:e.value)==="INVOICE"&&k)return this.displayPaymentOptionBtn(e,t,a)}return null},this.renderAccessCodePrompt=()=>{var n,a,r,o;const{isTicketTypeLoaded:e}=this.state,{t,isFromStaff:s}=this.props;return e?(_t=!0,i.createElement("div",{className:!s&&"d-flex justify-c-c access-code-box"},i.createElement("div",{id:"no-ticket-key",className:"no-ticket-key"},i.createElement("span",{className:"no-ticket-accessKey"},i.createElement(_e,{svgIcon:"ac-icon-key",width:"53px",height:"53px"})),i.createElement("div",{className:"_display-flex align-center flex-direction-column"},i.createElement(ee,{variant:"heading3",className:"m-t-20",labelClass:"m-b-0",color:(a=ce[(n=this.context)==null?void 0:n.theme])==null?void 0:a.neutral1000},t("common:Please enter access code")),i.createElement(ee,{variant:"body2",className:"m-t-12",labelClass:"m-b-0",color:(o=ce[(r=this.context)==null?void 0:r.theme])==null?void 0:o.neutral700},t("checkoutDetails:Access code is needed to show the tickets")))))):null},this.renderAccesCode=()=>{var m,g,k,S,u,E,h,y;const{accessCode:e,isValidAccessCode:t,accessCodeFailMessage:s,errorMsg:n,accessCodeError:a,unicodePresent:r,isTicketTypeLoaded:o}=this.state,{t:d,isFromStaff:c}=this.props;return _t=!0,i.createElement(i.Fragment,null,o?i.createElement("div",{className:!c&&"d-flex justify-c-c access-code-box"},i.createElement("div",{id:"no-ticket-key",className:"no-ticket-key"},i.createElement("span",{className:"no-ticket-accessKey"},i.createElement(_e,{svgIcon:"ac-icon-key",width:"53px",height:"53px"})),i.createElement("div",{className:"_display-flex align-center flex-direction-column"},i.createElement(ee,{variant:"heading3",className:"m-t-20",labelClass:"m-b-0",color:(g=ce[(m=this.context)==null?void 0:m.theme])==null?void 0:g.neutral1000},d("common:Please enter access code")),i.createElement(ee,{variant:"body2",className:"m-t-12",labelClass:"m-b-0",color:(S=ce[(k=this.context)==null?void 0:k.theme])==null?void 0:S.neutral700},d("checkoutDetails:Access code is needed to show the tickets"))),i.createElement("div",{className:pe("p-t-32",{"have-discount":e&&t})},i.createElement(it,{className:"d-flex m-b-0",controlId:"formInlineName"},i.createElement(et,{id:"purchaseTicketEnterAccessCode",type:"text",className:pe("no-ticket-accessCode",s&&"access-code-error"),placeholder:d("checkoutDetails:Enter code here"),inputRef:b=>{this.accessCode=b},onChange:this.onAccessCodeChange,size:"normal",value:e,feedBackText:r&&d("common:Unicode characters are not allowed"),isFeedBackShow:r,valid:!r,autoComplete:"off"}),t?null:i.createElement(Ee,{id:"accesscode",className:"m-l-8 check-access-code",onClick:e&&this.checkAccessCode,label:d("common:Apply"),disabled:r||!e||a}),t?i.createElement(Ee,{id:"accesscoderemove",className:"m-l-8 check-access-code",onClick:this.removeAccessCode,label:d("common:Remove"),variant:"danger"}):null),s?i.createElement("div",{className:"error-block"},i.createElement(_e,{className:"fa fa-info-circle",size:"exSmall"}),i.createElement(ee,{variant:"caption2",color:(E=ce[(u=this.context)==null?void 0:u.theme])==null?void 0:E.danger800,labelClass:"m-t-0 m-b-0"},n||d("checkoutDetails:Couldn't find this code"))):a&&i.createElement("div",{className:"error-block"},i.createElement(_e,{className:"fa fa-info-circle",size:"exSmall"}),i.createElement(ee,{variant:"caption2",color:(y=ce[(h=this.context)==null?void 0:h.theme])==null?void 0:y.danger800,labelClass:"m-t-0 m-b-0"},n||d("checkoutDetails:Access code cannot be empty")))))):null)},this.renderUnifiedCodeField=(e="both",t=!1)=>{var u,E,h,y,b,D,P;if(this.state.paymentType==="COMPLIMENTARY")return null;const s=this.state.isValidAccessCode&&this.state.accessCode?[{code:this.state.accessCode,codeType:"ACCESS"}]:[],n=this.state.appliedDiscountCode?[this.state.appliedDiscountCode]:[],a=!!(this.props.isHost||this.props.isFromStaff),r=this.isExistingOrder()&&!this.props.isApplicationOrder,o=!!(((u=this.props.existingOrderDetails)==null?void 0:u.couponCode)||"").trim(),d=r?o:!!((E=this.state.settings)!=null&&E.discountCodeAvailable||(h=this.props.capacityInfo)!=null&&h.discountCodeAvailable),c=!a&&
2!!((y=this.state.settings)!=null&&y.accessCodeAvailable),m=s.length>0||n.length>0;if(!d&&!c&&!m)return null;const g=(((D=ct((b=window==null?void 0:window.location)==null?void 0:b.search))==null?void 0:D.couponCode)||"").trim().toLowerCase(),k=(((P=this.state.appliedDiscountCode)==null?void 0:P.code)||"").trim().toLowerCase(),S=!!this.props.isApplicationOrder&&!!g&&!!k&&k===g;return i.createElement(qn,{part:e,locked:S,expanded:this.state.codeFieldExpanded||t,onToggle:this.toggleCodeField,value:this.state.unifiedCodeValue,onChange:this.onUnifiedCodeChange,onApply:this.applyUnifiedCode,isApplying:this.state.isApplyingUnifiedCode,errorMsg:this.state.unifiedCodeError,appliedCodes:a?n:[...s,...n],onRemove:this.removeUnifiedCode,savings:this.state.couponSavings,currencySymbol:this.props.currencySymbol,discountOnly:a})},this.renderHaveAnAccessCode=()=>{var E,h,y,b,D;const{accessCode:e,isValidAccessCode:t,unicodePresent:s,accessCodeFailMessage:n,accessCodeError:a,errorMsg:r,accessCodeSuccessMessage:o,settings:d,openAccessCode:c}=this.state,{isFromStaff:m,isHost:g,t:k}=this.props,{accessCodeAvailable:S,ticketTypes:u}=d;return t&&(_t=!1),!g&&S&&((u==null?void 0:u.length)!==0||this.state.expoFpConfig&&((E=this.state.addonTicketData)!=null&&E.some(P=>(P==null?void 0:P.addonType)==="EXHIBITOR_BOOTH")))&&!m&&!_t?!c&&!e?i.createElement("a",{onClick:this.handleAccessCode,className:"cursor t-d-none have-a-access-code"},k("checkoutDetails:Have an access code?")):i.createElement("div",{className:pe("",{"have-discount":e&&t})},i.createElement("div",{className:"ticket-access-code d-flex align-items-center justify-content-end"},i.createElement(an,null,i.createElement("span",{className:pe("addon-key",e&&e.trim()!==""&&"access-key",(n||a)&&"access-fail-key")},i.createElement(_e,{svgIcon:o?"ac-icon-round-check":"ac-icon-key",viewBox:"0 0 18 18",id:"keyIcon"})),i.createElement(et,{id:"enterAccessCode",bsStyle:"lg",type:"text",placeholder:k("checkoutDetails:Enter access code"),inputRef:P=>{this.accessCode=P},value:o?"Access code Applied":e,onChange:this.onAccessCodeChange,disabled:t,size:"normal","aria-label":"Enter access code",className:pe("access-code-input",o&&"access-code-applied",n&&"access-code-failed"),spellcheck:"false",onFocus:this.removeFocusFromAccessCode,feedBackText:s&&k("common:Unicode characters are not allowed"),isFeedBackShow:s,valid:!s,autoComplete:"off"}),n?i.createElement(ee,{variant:"caption2",color:(y=ce[(h=this.context)==null?void 0:h.theme])==null?void 0:y.danger800,labelClass:"m-t-4 m-b-0"},r||k("checkoutDetails:Couldn't find this code")):a&&i.createElement(ee,{variant:"caption2",color:(D=ce[(b=this.context)==null?void 0:b.theme])==null?void 0:D.danger800,labelClass:"m-t-4 m-b-0"},r||k("checkoutDetails:Access code cannot be empty")),!t&&i.createElement(ee,{variant:"custom-captions",onClick:e&&(e==null?void 0:e.trim())!==""&&this.checkAccessCode,disabled:s,className:pe("apply-access-code",e&&(e==null?void 0:e.trim())!==""&&"apply",n&&"apply-failed"),labelClass:e!=null&&e.trim()?"pointer":""},k("common:Apply")),t&&i.createElement(ee,{variant:"custom-captions",onClick:this.removeAccessCode,className:"apply-access-code remove",id:"accesscoderemove"},k("common:Remove"))))):null},this.formatTicketOptions=()=>{const{settings:e}=this.state,{waitListSettings:t}=this.props;if(!(e!=null&&e.ticketTypes))return[{value:"",label:"Select Ticket",key:""}];const n=e.ticketTypes.filter(a=>(a==null?void 0:a.ticketType)!=="DONATION"&&(a==null?void 0:a.dataType)!=="ADDON"&&((a==null?void 0:a.remaniningTickets)!==0&&w(a==null?void 0:a.endDate).diff(w())>0||ht(a==null?void 0:a.typeId,t))).map((a,r)=>({value:a==null?void 0:a.typeId,label:a==null?void 0:a.name,key:`ticket-option-${r}`}));return[{value:"",label:"Select Ticket",key:""},...n]},this.formatAddonOptions=()=>{const{settings:e}=this.state,{waitListSettings:t}=this.props;if(!(e!=null&&e.ticketTypes))return[{value:"",label:"Select Add-on",key:""}];const n=e.ticketTypes.filter(a=>(a==null?void 0:a.ticketType)!=="DONATION"&&(a==null?void 0:a.dataType)!=="TICKET"&&((a==null?void 0:a.remaniningTickets)!==0&&w(a==null?void 0:a.endDate).diff(w())>0||ht(a==null?void 0:a.typeId,t))).map((a,r)=>
2({value:a==null?void 0:a.typeId,label:a==null?void 0:a.name,key:`addon-option-${r}`}));return[{value:"",label:"Select Add-on",key:""},...n]},this.showPaymentBreakdownBox=()=>{const{isDepositEnabled:e,paymentType:t,totalTicketQty:s,hasSomePayLaterTickets:n}=this.state,{isHost:a,isFromStaff:r,isApplicationOrder:o}=this.props;if(o)return!1;const d=a||r;return s>0&&!d&&(e&&t==="DEPOSIT"||n&&t==="INVOICE"||t==="CC"&&(e||n))},this.showPaymentOptions=()=>{const{totalTicketQty:e,isDepositEnabled:t,totalTicketPrice:s,hasSomePayLaterTickets:n}=this.state,{isHost:a,isFromStaff:r,isFromWaitlist:o,isRegApproval:d,isApplicationOrder:c}=this.props;return c?!1:e>0&&(a||r||(n||t)&&(d||o))&&s&&s>0},this.showNoteArea=()=>{const{totalTicketQty:e}=this.state,{isHost:t,isFromStaff:s}=this.props;return e>0&&(t||s)},this.showContinueButton=()=>{const{totalTicketQty:e}=this.state,{isHost:t,isFromStaff:s,waitListIds:n}=this.props;return e>0&&(t||s||n)},this.showTicketPurchaseSuccessPopup=()=>{const{setTicketSuccess:e,isHost:t,isFromStaff:s,embed:n,widget:a,isCustomBeeFreeAddon:r}=this.props;this.setState({ticketPurchaseSuccessPopup:!0,isLoaded:!1}),e(!0),!t&&!s&&!n&&!a&&!r&&this.sendToConfirmationPage()},this.sendToConfirmationPage=async()=>{var r;const{eventDetails:e,eventData:t,orderId:s}=this.props,n=(e==null?void 0:e.eventUrl)||(e==null?void 0:e.eventURL)||(t==null?void 0:t.eventURL);let a;try{n&&s&&(a=await this.props.getOrderConfirmationPageByOrderId(n,s))}catch{}$n(this.props.history,{pageId:a==null?void 0:a.id,state:{...((r=this.props.location)==null?void 0:r.state)||{},orderId:s,confirmationResponse:a}})},this.hideRuleValidationPopup=()=>{this.setState({showRuleValidationPopup:!1,validationMessage:""})},this.isTieredDiscountAppliedToCart=()=>{const{totalTickets:e}=this.state,{ticketRulesActions:t}=this.props;return!(e!=null&&e.length)||!(t!=null&&t.rulesMap)?!1:e.some(s=>{var r,o;if(!s||Number(s.discountAmount||0)<=0)return!1;const n=s.ruleId??((r=this.discountRuleIdMap)==null?void 0:r[s.tickettypeid]);if(!n)return!1;const a=t.rulesMap[n];return(o=a==null?void 0:a.actions)==null?void 0:o.some(d=>d.action===ut.APPLY_DISCOUNT_TIERED)})},this.isSetPriceAppliedToCart=()=>{const{totalTickets:e}=this.state,{ticketRulesActions:t}=this.props;return!(e!=null&&e.length)||!(t!=null&&t.rulesMap)?!1:e.some(s=>{var r,o;if(!s||!s.setPriceRuleApplied||Number(s.setPrice)>=Number(s.price||0))return!1;const n=s.ruleId??((r=this.discountRuleIdMap)==null?void 0:r[s.tickettypeid]);if(!n)return!1;const a=t.rulesMap[n];return(o=a==null?void 0:a.actions)==null?void 0:o.some(d=>d.action==="Set Price")})},this.hasPercentageDiscountInCart=()=>{const{totalTickets:e}=this.state,{ticketRulesActions:t}=this.props;return!(e!=null&&e.length)||!(t!=null&&t.rulesMap)?!1:e.some(s=>{var o,d;if(!s||!(Number(s.discountAmount||0)>0||Number(s.discountedQuantity||0)>0))return!1;const a=s.ruleId??((o=this.discountRuleIdMap)==null?void 0:o[s.tickettypeid]);if(!a)return!1;const r=t.rulesMap[a];return(d=r==null?void 0:r.actions)==null?void 0:d.some(c=>c.action===ut.PERCENTAGE)})},this.isFlatDiscountAppliedToCart=()=>{const{totalTickets:e}=this.state,{ticketRulesActions:t}=this.props;return!(e!=null&&e.length)||!(t!=null&&t.rulesMap)?!1:e.some(s=>{var r,o;if(!s||Number(s.discountAmount||0)<=0)return!1;const n=s.ruleId??((r=this.discountRuleIdMap)==null?void 0:r[s.tickettypeid]);if(!n)return!1;const a=t.rulesMap[n];return(o=a==null?void 0:a.actions)==null?void 0:o.some(d=>d.action===ut.FIXED_DISCOUNT_AMOUNT)})},this.renderDiscountRuleBannerMsg=()=>{var a,r,o,d,c,m,g,k,S,u;const e=this.isTieredDiscountAppliedToCart(),t=this.isSetPriceAppliedToCart(),s=this.isFlatDiscountAppliedToCart(),n=this.hasPercentageDiscountInCart()||s;return t&&!n&&!s?i.createElement(ee,{labelClass:"m-b-0 lh-17",variant:"custom-captions",color:(r=ce[(a=this.context)==null?void 0:a.theme])==null?void 0:r.neutral1000},i.createElement("span",null,"Special pricing applied!"),i.createElement("span",{className:"m-l-4 font-w500"},"Selected tickets have been updated with the new prices on the checkout page.")):t&&(n||s)?i.createElement(ee,{labelClass:"m-b-0 lh-17",variant:"custom-captions",color:(d=ce[(o=this.context)==null?void 0:o.theme])==null?void 0:d.neutral1000},i.createElement("span",null,"Discounts applied!"),i.createElement("span",{className:"m-l-4 font-w500"},"Your order includes special pricing and a promotional discount.")):s||n?i.createElement(ee,{labelClass:"m-b-0 lh-17",variant:"custom-captions",color:(m=ce[(c=this.context)==null?void 0:c.theme])==null?void 0:m.neutral1000},i.createElement("span",null,"Discount Applied!"),i.createElement("span",{className:"m-l-4 font-w500"},"Selected tickets have been updated with the new prices on the checkout page.")):e?i.createElement(ee,{labelClass:"m-b-0 lh-17",variant:"custom-captions",color:(k=ce[(g=this.context)==null?void 0:g.theme])==null?void 0:k.neutral1000},i.createElement("span",null,"Discounts applied!"),i.createElement("span",{className:"m-l-4 font-w500"},"Your order includes a promotional discount and a quantity-based discount.")):i.createElement(ee,{labelClass:"m-b-0 lh-17",variant:"custom-captions",color:(u=ce[(S=this.context)==null?void 0:S.theme])==null?void 0:u.neutral1000},i.createElement("span",null,"Discount Captured!"),i.createElement("span",{className:"m-l-4 font-w500"},"Tickets have been updated with the discounted prices on the checkout page."))},this.renderRuleDiscountDetectedBanner=()=>{var k,S;const{eventData:e,autoDiscountCodeId:t,autoDiscountCodeError:s,failedAutoDiscountCodeId:n,onDismissAutoDiscountError:a}=this.props,{totalTickets:r,totalRegRequestTickets:o}=this.state;if(!((r==null?void 0:r.some(u=>(u==null?void 0:u.price)!=="0"))||(o==null?void 0:o.some(u=>(u==null?void 0:u.price)!=="0"))))return null;const c=!this.isSetPriceAppliedToCart()&&!this.isFlatDiscountAppliedToCart()&&!this.hasPercentageDiscountInCart()&&!this.isTieredDiscountAppliedToCart();if(!!t&&c&&String(n)===String(t)){const u=s&&String(s.ruleCodeId)===String(t)?s:null;return u?i.createElement("div",{className:"discount-captured-info-banner-container-checkout-ticket"},i.createElement("div",{className:pe("discount-captured-info-banner-container d-flex align-center gap-8 error",e!=null&&e.recurring?"m-b-20":"m-b-15")},i.createElement("div",{className:"d-flex align-center gap-8"},i.createElement("span",{className:"discount-captured-error-icon"},Ea("alert-triangle")),i.createElement(ee,{labelClass:"m-b-0 lh-17",variant:"custom-captions",color:(S=ce[(k=this.context)==null?void 0:k.theme])==null?void 0:S.neutral1000},u.code&&i.createElement("span",{className:"font-w600"},`${u.code}: `),i.createElement("span",{className:"font-w500"},u.message))),a&&i.createElement("button",{type:"button",className:"discount-captured-error-close","aria-label":this.props.t?this.props.t("common:Dismiss"):"Dismiss",onClick:a},i.createElement("i",{className:"ac-icon-close"})))):null}const g=this.props.appliedDiscountCode||this.state.appliedDiscountCode;return t&&c&&!(g!=null&&g.code)?null:i.createElement("div",{className:"discount-captured-info-banner-container-checkout-ticket"},i.createElement("div",{className:pe("discount-captured-info-banner-container d-flex align-center gap-8 success",e!=null&&e.recurring?"m-b-20":"m-b-15")},i.createElement("div",{className:"d-flex align-center gap-8"},i.createElement("span",{className:"discount-captured-success-icon"},Ea("connected-check-circle")),this.renderDiscountRuleBannerMsg())))},this.addBoothTicketToOrder=(e,t)=>{var d;const{ticketTypeId:s}=e||{};if(!s)return;const{settings:n,addonTicketData:a}=this.state,r=[...(n==null?void 0:n.ticketTypes)||[],...a||[]],o=r.find(c=>{var m;return((m=c==null?void 0:c.typeId)==null?void 0:m.toString())===(s==null?void 0:s.toString())});if(t!=null&&t.ticketTypeId&&((d=t.ticketTypeId)==null?void 0:d.toString())!==(s==null?void 0:s.toString())){const c=r.find(m=>{var g,k;return((g=m==null?void 0:m.typeId)==null?void 0:g.toString())===((k=t.ticketTypeId)==null?void 0:k.toString())});if(c)this.handleTicketSelection({value:0,label:0},c);else{const m=this.state.totalTickets?this.state.totalTickets.slice():[];delete m[t.ticketTypeId],this.setState({totalTickets:m})}}if(o){const c=e.price==null?null:Number(e.price)>0?Number(e.price)-Number(e.discountAmount||0):Number(e.price),m=c!=null?{...o,price:c}:o;this.handleTicketSelection({value:1,label:1},m)}},this.selectRecurringEvent=(e,t)=>
2{const s=t?e:e==null?void 0:e.value,{widget:n,embed:a,isHost:r,isFromStaff:o,eventUrl:d,eventDetails:c}=this.props,m=c&&(c==null?void 0:c.recurring),g=this;this.setState({selectedRecurringEvent:s,totalTickets:[],totalTicketQty:0},()=>{this.TempTimeout=setTimeout(()=>{if(g.doGetSettings(s).then().catch(()=>{}),g.getWaitListSettings(s),(r||n&&a||o)&&m&&s){const k=o?d:c.eventUrl||c.eventURL;this.props.ticketingSettings.seatingChartKey&&this.doGetSeatingCategories(k,s)}this.setState({selectedSeats:[]})},200)})},this.getPricePerTicket=(e,t)=>{const s=parseFloat(t.aeFeeFlat)+parseFloat(t.aeFeePercentage)*e/100,n=parseFloat(t.wlFeeFlat)+parseFloat(t.wlFeePercentage)*e/100;return parseFloat(e)+parseFloat(s)+parseFloat(n)},this.getAeFeeAdjustmentPerTicket=(e,t)=>{const s=parseFloat(e)/(1-parseFloat(t.creditCardProcessingPercentage/100)),n=Math.ceil(parseFloat(s)*100)/100;return parseFloat(n)*(1-parseFloat(t.creditCardProcessingPercentage/100))-parseFloat(e)},this.getPerTicketPriceWithFees=(e,t)=>{const s=this.getAeFeeAdjustmentPerTicket(e,t);
2return parseFloat(e+s)/(1-parseFloat(t.creditCardProcessingPercentage/100))},this.settotalTickets=e=>{const{donationInputValue:t}=this.state;e==null||e.forEach((s,n)=>{s!=null&&s.isDonation&&(t[n]=s.individualPrice)}),this.setState({totalTickets:e,donationInputValue:t})},this.getRemaingTicketCount=e=>{const{existingOrderDetails:t}=this.props,{purchasedTicketsCount:s}=t||{};let n=e.maxTickerPerBuyer;return this.isExistingOrder()&&(s!=null&&s[e==null?void 0:e.typeId])&&!Ma(e,s)&&(n=e.maxTickerPerBuyer-(s==null?void 0:s[e==null?void 0:e.typeId])),e.remaniningTickets>n?n:e.remaniningTickets},this.isMinExceedsAllotmentLimit=e=>{var n,a;if(!this.props.isExhibitorFlow)return!1;const t=Number(e==null?void 0:e.minTickerPerBuyer)||0,s=Number(e==null?void 0:e.maxTickerPerBuyer)||0;return!(t>0)||t<=s?!1:(((a=(n=e==null?void 0:e.ticketRuleActions)==null?void 0:n.LIMIT_QUANTITY)==null?void 0:a.length)||0)>0},this.renderTicketSelectionElement=(e,t,s,n,a,r,o)=>{var A,x;const{widgetSettings:d,t:c}=this.props,{waitListSettings:m}=this.state||{},{waitListButtonText:g}=m||{},{buttonBackgroundColor:k,buttontextColor:S}=d||{},u=`${e==null?void 0:e.name}-${e==null?void 0:e.position}`,E=(e==null?void 0:e.percentageDiscount)>0&&!(e!=null&&e.hasTieredDiscount),h=H=>{if(!E||!Array.isArray(H))return H;const q=e.percentageDiscount,N=c("common:percentEachSuffix",{defaultValue:"({{pct}}% off each)",pct:q});return H.map(V=>V.value>0?{...V,menuLabel:`${V.label} ${N}`}:V)};if((e==null?void 0:e.dataType)==="ADDON"){if(w(e.endDate).diff(w())<=0&&!n)return i.createElement(Ee,{className:"sold-out-end-btn cursor-default",size:"normal",id:"purchaseTicketEnded"},be.t("common:Ended"));if(w(e.startDate).diff(w())>=0)return i.createElement(Ee,{className:"ticket-available-on cursor-default",id:"purchaseTicketAvailable"},be.t("checkoutDetails:Available"),i.createElement("br",null),w(e.startDate).format("ddd, D MMM"),i.createElement("br",null),w(e.startDate).format("h:mm a"));if(e.remaniningTickets<=0||e.minTickerPerBuyer>0&&e.remaniningTickets<e.minTickerPerBuyer)return i.createElement(Ee,{className:"sold-out-end-btn cursor-default",size:"normal",id:"purchaseTicketSoldOut"},be.t("checkoutDetails:Sold out"));const H=h(r(e.remaniningTickets>=e.minTickerPerBuyer?e.minTickerPerBuyer:0,this.getRemaingTicketCount(e),e.typeId)),q=e!=null&&e.registrationApprovalRequired?(x=s==null?void 0:s[e==null?void 0:e.typeId])!=null&&x.numberofticket?parseInt(s[e==null?void 0:e.typeId].numberofticket,10):0:(A=t==null?void 0:t.find(v=>Number(v==null?void 0:v.tickettypeid)===Number(e==null?void 0:e.typeId)))!=null&&A.numberofticket?parseInt(t.find(v=>Number(v==null?void 0:v.tickettypeid)===Number(e==null?void 0:e.typeId)).numberofticket,10):0,N=this.props.isExhibitorFlow&&!!e.limitQuantityRuleId&&e.maxTickerPerBuyer===0,V=this.isMinExceedsAllotmentLimit(e),J=!(a!=null&&a.holderAttributeRequired)&&(a==null?void 0:a.uniqueTicketHolderEmail)&&o(this.mergeTicketList(this.state.totalTickets,s),e)||this.isCapacityReachedInExistingOrder(e)||N||V;if(Ua())return i.createElement("select",{id:e.typeId.toString(),value:q,onChange:v=>{const M=parseInt(v.target.value,10);this.handleTicketSelection({value:M,label:M},e)},disabled:J,className:pe("instagram-native-select","ticket-qty-decor","tickets-select-box",this.props.isFromWaitlist&&"wailist-tickets-select-box"),"aria-label":e.name},H.map(v=>i.createElement("option",{key:v.value,value:v.value},v.menuLabel||v.label)));const te=this.isCapacityReachedInExistingOrder(e)||N||V,j=c(V?"Minimum order quantity exceeds the allotment limit.":N?"This ticket has reached its allotment limit and is no longer available for purchase.":"Ticket is reached its capacity limit");return i.createElement(Ca,{condition:te,wrapper:v=>i.createElement(ls,{tooltip:j,overlayProps:{placement:"top"},tooltipProps:{id:"disable-ticket-selection"}},v)},i.createElement(Ut,{key:e.typeId,id:e.typeId.toString(),className:pe("ticket-qty-decor tickets-select-box pointer",this.props.isFromWaitlist&&"wailist-tickets-select-box"),isDisabled:J,onChange:v=>{this.handleTicketSelection(v,e)},value:q,"aria-label":e.name,options:H,formatOptionLabel:(v,{context:M})=>M==="menu"&&v.menuLabel||v.label,showSelectIcon:!0,selectRef:this.handleTicketSelectRef,isMenuPlaceTop:!!this.state.menuPlaceTopMap[String(e.typeId)]}))}if(e!=null&&e.soldOut)return i.createElement(Ee,{className:"sold-out-end-btn cursor-default",size:"normal",id:"purchaseTicketSoldOut"},be.t("checkoutDetails:Sold out"));if(w(e.endDate).diff(w())<=0&&!n)return i.createElement(Ee,{className:"sold-out-end-btn cursor-default",size:"normal",id:"purchaseTicketEnded"},be.t("common:Ended"));if(w(e.startDate).diff(w())>=0)return i.createElement(Ee,{className:"ticket-available-on cursor-default",id:"purchaseTicketAvailable"},be.t("checkoutDetails:Available"),i.createElement("br",null),w(e.startDate).format("ddd, D MMM"),i.createElement("br",null),w(e.startDate).format("h:mm a"));if(!(e!=null&&e.soldOut)&&(e!=null&&e.waitList)&&e.dataType!=="ADDON")return i.createElement(Ee,{id:"commonJoinWaitList",size:"normal",className:"wait-list-btn",onClick:()=>{this.openWaitListForm(e.typeId)},style:{color:S,backgroundColor:k,borderColor:k},label:g||c("common:Join Wait List")});const y=e!=null&&e.registrationApprovalRequired?s==null?void 0:s[e==null?void 0:e.typeId]:t==null?void 0:t.find(H=>Number(H==null?void 0:H.tickettypeid)===Number(e==null?void 0:e.typeId)),b=y!=null&&y.numberofticket?parseInt(y.numberofticket,10):0,D=h(r(e.remaniningTickets>=(y?y.minTickerPerBuyer:e.minTickerPerBuyer)?y?y.minTickerPerBuyer:e.minTickerPerBuyer:0,this.getRemaingTicketCount(e),e.typeId)),P=this.props.isExhibitorFlow&&!!e.limitQuantityRuleId&&e.maxTickerPerBuyer===0,C=this.isMinExceedsAllotmentLimit(e),F=!(a!=null&&a.holderAttributeRequired)&&(a==null?void 0:a.uniqueTicketHolderEmail)&&o(this.mergeTicketList(this.state.totalTickets,s),e)||this.isCapacityReachedInExistingOrder(e)||this.shouldNotAllowTouchNetPayment(e)||P||C;if(Ua())return i.createElement("select",{id:e.typeId.toString(),value:b,onChange:H=>{const q=parseInt(H.target.value,10);this.handleTicketSelection({value:q,label:q},e)},disabled:F,className:pe("instagram-native-select","ticket-qty-decor","tickets-select-box",this.props.isFromWaitlist&&"wailist-tickets-select-box"),"aria-label":e.name},D.map(H=>i.createElement("option",{key:H.value,value:H.value},H.menuLabel||H.label)));const $=()=>C?c("Minimum order quantity exceeds the allotment limit."):P?c("This ticket has reached its allotment limit and is no longer available for purchase."):this.isCapacityReachedInExistingOrder(e)?c("This ticket is already included in your order, and it's no longer available due to ticket capacity."):this.shouldNotAllowTouchNetPayment(e)?c("This ticket is not available for TouchNet payment."):"",U=this.isCapacityReachedInExistingOrder(e)||this.shouldNotAllowTouchNetPayment(e)||P||C;return i.createElement(Ca,{condition:U,wrapper:H=>i.createElement(ls,{tooltip:c($()),overlayProps:{placement:"top"}},H)},i.createElement(Ut,{key:`${e.typeId}-${u}`,id:e.typeId.toString(),className:pe("ticket-qty-decor tickets-select-box pointer",this.props.isFromWaitlist&&"wailist-tickets-select-box"),isDisabled:F,onChange:H=>{this.handleTicketSelection(H,e)},value:b,"aria-label":e.name,options:D,formatOptionLabel:(H,{context:q})=>q==="menu"&&H.menuLabel||H.label,showSelectIcon:!0,selectRef:this.handleTicketSelectRef,isMenuPlaceTop:!!this.state.menuPlaceTopMap[String(e.typeId)]}))},this.showMapPopup=e=>{e.preventDefault(),this.setState({showMapPopup:!0})},this.selectRef=i.createRef(),this.isApplyingAccessCode=!1,this.autoAddedTicketIds=new Set,this.manuallyAdjustedAutoAddTickets=new Map,this.hasUserInteracted=!1,this.originalMinTickerPerBuyer={},this.discountRuleIdMap={},this.refreshSetDiscountKeys=new Set,this.limitQuantityRuleIdMap={},this.preAdjustmentQuantityMap=Do,this.ticketCallGenerations={},this.pendingFeeCalcs=0,this.pendingAddDonationPromise=Promise.resolve(),this.menuPlacementRaf=null,this.noteValue="",this.state={isLoaded:!1,totalTickets:[],showMapPopup:!1,showCheckout:this.props.showCheckout||!1,paymentType:this.props.embed?"CC":"CASH",paymentLabel:null,popupAlertHeader:null,errorMsg:null,message:"",isError:!1,accessCode:"",unlockedTicketTypeIds:new Set,donationInputValue:[],isValidAccessCode:!1,donationAmounts:[200,500,800,1200],waitListSettings:null,openWaitListPopup:!1,selectedSeats:this.props.selectedSeats||[],recurringEventList:[],selectedRecurringEvent:"",ticketCategory:null,settings:null,showRecurringCal:!1,disableRecurring:!1,isSeatsioFullScreen:!1,showImportAttendeesModal:!1,attendeeProperties:[],unicodePresent:!1,openAccessCode:!1,accessCodeSuccessMessage:!1,selectedExpoBooth:this.props.selectedExpoBooth||null,accessCodeFailMessage:!1,accessCodeError:!1,codeFieldExpanded:!this.props.isHost&&(!!this.props.appliedDiscountCode||!!this.props.appliedAccessCode),unifiedCodeValue:"",unifiedCodeError:null,isApplyingUnifiedCode:!1,appliedDiscountCode:this.props.isHost?null:this.props.appliedDiscountCode||null,couponSavings:0,isSelectedFreeWaitList:"",ticketWithoutDonationAndAddon:!1,invisibleCaptchaSiteKey:null,isTicketTypeLoaded:!0,addonTicketData:[],purchasedTicketTypes:[],showLinkExpired:!1,claimLinkExpired:!1,claimLinkExpiredMsg:"",hideClaimResendLink:!1,resendingClaimLink:!1,totalRegRequestTickets:[],limitRegistrationEmails:!1,totalDepositAmount:0,finalAmountWithDeposit:0,PostDepositBalance:0,displayCode:null,ticketPurchaseSuccessPopup:!1,isStripePaymentProcessing:!1,disableContinue:!1,isEnforcingRules:!1,seatDetails:null,menuPlaceTopMap:{}},this.doGetSettings=this.doGetSettings.bind(this),this.doOrderTicket=this.doOrderTicket.bind(this),this.selectHandle=this.selectHandle.bind(this),this._reCaptchaRef=i.createRef()}componentDidMount(){var C,F,_;if(Gn(this.props.history),Kt("accessCodeDetails"),window.addEventListener("scroll",this.scheduleMenuPlacementUpdate,!0),window.addEventListener("resize",this.scheduleMenuPlacementUpdate),typeof Jt.ResizeObserver<"u"){this.menuPlacementObserver=new Jt.ResizeObserver(this.scheduleMenuPlacementUpdate);const $=document.querySelector(".ticket-steps-div")||document.body;$&&this.menuPlacementObserver.observe($)}const{isHost:p,isFromStaff:e,eventDetails:t,eventUrl:s,widget:n,embed:a,virtualEventSettings:r,doGetIsVatTaxEnabledFromCac
2he:o,eventData:d,ticketDetails:c,regRequestTicketDetails:m,whiteLabelInformation:g,customAccessCode:k,recurringEventID:S,authenticated:u,ticketRulesActions:E,isExhibitorFlow:h}=this.props;this.loadDisplayCode(),o((d==null?void 0:d.eventURL)||(d==null?void 0:d.eventUrl)||(t==null?void 0:t.eventUrl));const y=Aa((C=window==null?void 0:window.location)==null?void 0:C.search);if((y==null?void 0:y.redirect_status)==="succeeded"&&(y!=null&&y.payment_intent)){const $=y==null?void 0:y.payment_intent,U=Aa((F=window==null?void 0:window.location)==null?void 0:F.search),A=this.props.match.params.waitListIds,x=(U==null?void 0:U.id)||(U==null?void 0:U.orderId);if($&&(this.eventUrl||d!=null&&d.eventURL||d!=null&&d.eventUrl))try{let H=Ke("idealCheckoutRequest");const q=(H==null?void 0:H.orderId)||x;if(H){if(typeof H=="string")try{H=JSON.parse(H)}catch(V){console.error("Failed to parse persisted Stripe request:",V),H=null}H&&typeof H=="object"&&(H={...H,tokenOrIntentId:$,clientDate:w().format("DD/MM/YYYY hh:mm:ss")})}this.setState({isStripePaymentProcessing:!0}),this.props.orderTicket(s,q,H,"?isInternationalPayment=false",!1,`&waitListIds=${A}`,!0,!0,S).then(()=>{this.setState({orderId:q},()=>{this.showTicketPurchaseSuccessPopup()})}).catch(()=>{console.error("Failed to confirm Stripe iDeal checkout payment")}).finally(()=>{this.setState({isStripePaymentProcessing:!1}),this.removeUrlParamsAndLocalStorage()})}catch{console.error("Failed to confirm Stripe iDeal checkout payment"),this.removeUrlParamsAndLocalStorage()}else console.error("No payment_intent found in URL"),this.removeUrlParamsAndLocalStorage()}else(y==null?void 0:y.redirect_status)==="failed"&&(console.error("Authorized payment failed"),this.removeUrlParamsAndLocalStorage());const b=ct(window.location.search);this.checkWaitListLinkValidity(),(b!=null&&b.access||k)&&this.setState({openAccessCode:!0,accessCode:(b==null?void 0:b.access)||k,accessCodeFailMessage:!1,isValidAccessCode:!1,unicodePresent:Xt((b==null?void 0:b.access)||k),accessCodeError:((_=(b==null?void 0:b.access)||k)==null?void 0:_.trim())===""},()=>{at=setInterval(()=>{var $;($=this.accessCode)!=null&&$.value&&(this.checkAccessCode(),this.props.storeAccessCode((b==null?void 0:b.access)||k))},1e3)}),c&&c.length>0&&this.setState({totalTickets:c}),m&&m.length>0&&this.setState({totalRegRequestTickets:m}),p||e?t&&(t!=null&&t.eventUrl)?(this.getInitialSettings(),this.getRecurringEvent(t==null?void 0:t.eventUrl)):this.props.getStoreDesignData(t==null?void 0:t.eventUrl,!1).then($=>{$&&this.getInitialSettings()}):(t!=null&&t.recurring?this.getRecurringEvent(s):u?this.getPurchasedTicketsIds().then(()=>this.doGetSettings()):this.doGetSettings(),(e||n&&a)&&s&&this.getRecurringEvent(s),this.getWaitListSettings()),p&&this.setState({totalTickets:[]});const D=nn("user");D&&D.languageCode?w.locale(`${D.languageCode.toLowerCase()}`):r&&r.labelLanguageCode&&w.locale(`${r.labelLanguageCode.toLowerCase()}`),g!=null&&g.invisibleCaptchaSiteKey?this.setState({invisibleCaptchaSiteKey:g.invisibleCaptchaSiteKey}):this.setState({invisibleCaptchaSiteKey:on}),h&&E&&(this.shouldEvaluateExpoRulesOnLoad=!0);const P=s||(d==null?void 0:d.eventURL)||(d==null?void 0:d.eventUrl)||(t==null?void 0:t.eventUrl);P&&this.props.fetchPublicExpoFpConfig(P).then($=>{$&&!($!=null&&$.errorMessage)&&this.setState({expoFpConfig:$})})}UNSAFE_componentWillMount(){var a,r;const{isHost:p,totalTickets:e,totalRegRequestTicketsList:t,eventDetails:s}=this.props,n=s.eventUrl||s.eventURL;if(p){this.props.getStoreDesignData(n,!1);const o=document.getElementsByTagName("BODY")[0];(a=o==null?void 0:o.classList)==null||a.add("host-checkout-addattendee"),(r=o==null?void 0:o.classList)==null||r.remove("hostSide")}e&&this.settotalTickets(e),t&&this.setState({totalRegRequestTickets:t}),this.handleLayoutResize=rn(250,()=>{this.isCheckResizeOrNot()}),this.layoutResizeObserverTimeout=setTimeout(()=>{const o=document.querySelector(".add-attendees-management");o&&(this.layoutResizeObserver=new Jt.ResizeObserver(this.handleLayoutResize),this.layoutResizeObserver.observe(o))},3e3)}UNSAFE_componentWillReceiveProps(p){const{showCheckout:e}=this.state,{isFromStaff:t,ticketingSettings:s,getSelectedRecurringEventID:n,isHost:a,eventDetails:r,recurringEventID:o,ticketDetails:d}=this.props;!(a||t)&&(!Ht(r,p.eventDetails)||o!==p.recurringEventID)&&(this.TempTimeout=setTimeout(()=>{var c;if(o!==p.recurringEventID&&this.doGetSettings(p.recurringEventID).then().catch(()=>{}),this.getWaitListSettings(p.recurringEventID),(c=p==null?void 0:p.eventDetails)!=null&&c.recurring){n(p.recurringEventID);const m=r.eventUrl||r.eventURL;s.seatingChartKey&&this.doGetSeatingCategories(m,p.recurringEventID)}this.setState({selectedSeats:[]})},200)),t&&e&&this.setState({showCheckout:p.showCheckout}),Ht(d,p.ticketDetails)||this.setState({totalTickets:p.ticketDetails}),Ht(this.props.regRequestTicketDetails,p.regRequestTicketDetails)||this.setState({totalRegRequestTickets:p.regRequestTicketDetails})}componentWillUnmount(){var e,t,s,n,a,r,o;const{isHost:p}=this.props;if(window.removeEventListener("scroll",this.scheduleMenuPlacementUpdate,!0),window.removeEventListener("resize",this.scheduleMenuPlacementUpdate),this.menuPlacementObserver&&(this.menuPlacementObserver.disconnect(),this.menuPlacementObserver=null),this.layoutRe
2sizeObserverTimeout&&(clearTimeout(this.layoutResizeObserverTimeout),this.layoutResizeObserverTimeout=null),this.layoutResizeObserver&&(this.layoutResizeObserver.disconnect(),this.layoutResizeObserver=null),(e=this.handleLayoutResize)==null||e.cancel(),this.menuPlacementRaf&&(window.cancelAnimationFrame(this.menuPlacementRaf),this.menuPlacementRaf=null),this.TempTimeout&&(clearTimeout(this.TempTimeout),this.TempTimeout=null),this.feeCommitTimeout&&(clearTimeout(this.feeCommitTimeout),this.feeCommitTimeout=null),at&&(clearInterval(at),at=null),p){const d=document.getElementsByTagName("BODY")[0];(t=d==null?void 0:d.classList)==null||t.remove("host-checkout-addattendee"),(s=d==null?void 0:d.classList)==null||s.add("hostSide"),(a=(n=this.props).storeAppliedDiscountCode)==null||a.call(n,null),(o=(r=this.props).storeAccessCode)==null||o.call(r,null)}}setDefaultNumberOfTicketForFreeTicket(p){const{settings:e}=this.state;if(p&&p.length===1&&!(e!=null&&e.accessCodeAvailable)&&p[0].ticketType==="FREE"&&w().diff(w(p[0].startDate))>=0&&w().diff(w(p[0].endDate))<=0){const t=p[0],{waitListSettings:s}=this.state,{settings:n,addOnCategory:a}=this.addRemoveAddonTicket(t,this.getDefaultNumberOfTickets(p,s));this.setState({settings:n,addOnCategory:a},()=>{this.addDonation(t.typeId,t.name,t.price,!1,this.getDefaultNumberOfTickets(p,s),t.fee,[],[],[],void 0,void 0,void 0,!1,!1,t.minTickerPerBuyer,t.maxTickerPerBuyer)})}}componentDidUpdate(p,e){var h,y,b,D,P,C,F,_,$,U,A,x,H,q;const t=((h=p.appliedDiscountCode)==null?void 0:h.code)||null,s=((y=this.props.appliedDiscountCode)==null?void 0:y.code)||null;if(t!==s&&s!==(((b=this.state.appliedDiscountCode)==null?void 0:b.code)||null)){this.setState({appliedDiscountCode:this.props.appliedDiscountCode||null,...s?{codeFieldExpanded:!0}:{}},()=>{this.setCalculationFee({notifyParent:!0})});return}if(this.state.totalTickets!==e.totalTickets&&(D=this.selectRef)!=null&&D.current){const N=this.state.totalTickets,V=this.state.selectedItem,J=N.filter(W=>W).find(W=>Number(W==null?void 0:W.tickettypeid)===Number(V==null?void 0:V.typeId));this.selectRef.current.value=J&&J.numberofticket?parseInt(J.numberofticket,10):0}const n=(P=p.eventData)==null?void 0:P.eventId,a=(C=this.props.eventData)==null?void 0:C.eventId,r=(F=p.widgetConfig)==null?void 0:F.embedType,o=(_=this.props.widgetConfig)==null?void 0:_.embedType;(n!==a||r!==o)&&this.loadDisplayCode(),p.authenticated!==this.props.authenticated&&this.props.authenticated&&!this.props.isHost&&!this.props.isFromStaff&&!(($=this.props.eventDetails)!=null&&$.recurring)?this.getPurchasedTicketsIds().catch(()=>{}).then(()=>this.restoreEntitledAddons()):p.exhibitorPurchaseCounts!==this.props.exhibitorPurchaseCounts&&this.restoreEntitledAddons();const{isHost:d,isFromStaff:c,ticketRulesActions:m}=this.props,g=e.totalTickets!==this.state.totalTickets||e.totalRegRequestTickets!==this.state.totalRegRequestTickets;let k=null,S=!1;if(g){k=this.mergeTicketList(e.totalTickets,e.totalRegRequestTickets);const N=this.mergeTicketList(this.state.totalTickets,this.state.totalRegRequestTickets),V=(k==null?void 0:k.filter(W=>W).reduce((W,te)=>W+parseInt(te.numberofticket||0,10),0))||0,J=(N==null?void 0:N.filter(W=>W).reduce((W,te)=>W+parseInt(te.numberofticket||0,10),0))||0;S=V!==J}const u=e.ticketTypeList!==this.state.ticketTypeList||e.addonTicketData!==this.state.addonTicketData||e.accessCodeDetails!==this.state.accessCodeDetails||e.isValidAccessCode!==this.state.isValidAccessCode||S||p.ticketRulesActions!==m||p.exhibitorPurchaseCounts!==this.props.exhibitorPurchaseCounts,E=(!e.ticketTypeList||e.ticketTypeList.length===0)&&this.state.ticketTypeList&&this.state.ticketTypeList.length>0;if(this.shouldEvaluateExpoRulesOnLoad&&m&&E){this.shouldEvaluateExpoRulesOnLoad=!1,this.evaluateAndApplyRules("SELECTED_EXPO_TIER",[],79145);return}if(!d&&!c&&m&&u&&!this.isApplyingRuleActions){const{totalTickets:N,ticketTypeList:V,addonTicketData:J,accessCodeDetails:W,isValidAccessCode:te,ticketTypeRemainingCounts:j,ticketTypeFeesAndDesc:v,totalRegRequestTickets:M}=this.state;this.pendingAutoAddTickets||(this.pendingAutoAddTickets=new Set);const de=this.mergeTicketList(N,M),ke=k||de;de.length>0&&de.forEach(Te=>{var G,L;this.pendingAutoAddTickets.has(Number(Te.tickettypeid))&&this.pendingAutoAddTickets.delete(Number(Te.tickettypeid)),this.pendingAutoAddTickets.has(String(Te.tickettypeid))&&this.pendingAutoAddTickets.delete(String(Te.tickettypeid)),(G=this.manuallyRemovedAutoAddTickets)!=null&&G.has(Number(Te.tickettypeid))&&this.manuallyRemovedAutoAddTickets.delete(Number(Te.tickettypeid)),(L=this.manuallyRemovedAutoAddTickets)!=null&&L.has(String(Te.tickettypeid))&&this.manuallyRemovedAutoAddTickets.delete(String(Te.tickettypeid))});const fe=[...V||[],...J||[]];if(fe.length>0){const Te=st(fe,m,de,W,te,this.props.exhibitorPurchaseCounts,!0,this.autoAddedTicketIds,this.hasUserInteracted,this.state.ticketTypeRemainingCounts,(U=this.props.eventDetails)==null?void 0:U.equivalentTimezone);Te.forEach(T=>{T!=null&&T.discountRuleId&&(this.discountRuleIdMap[T.typeId]=T.discountRuleId),this.props.isExhibitorFlow&&(T!=null&&T.limitQuantityRuleId?this.limitQuantityRuleIdMap[T.typeId]=T.limitQuantityRuleId:delete this.limitQuantityRuleIdMap[T.typeId])}
2),(x=(A=this.props).onUpdateDiscountRuleIdMap)==null||x.call(A,this.discountRuleIdMap),(q=(H=this.props).onUpdateLimitQuantityRuleIdMap)==null||q.call(H,this.limitQuantityRuleIdMap);const G=Te.map(T=>{const l=dt.find(v,B=>(B==null?void 0:B.ticketTypeId)===(T==null?void 0:T.typeId)),O=dt.find(j,B=>(B==null?void 0:B.ticketTypeId)===(T==null?void 0:T.typeId));return{...T,ticketTypeDescription:l==null?void 0:l.description,fee:(l==null?void 0:l.fee)||0,salesTax:(l==null?void 0:l.salesTax)||0,vatTax:(l==null?void 0:l.vatTax)||0,remaniningTickets:(O==null?void 0:O.remainingCount)||0,waitList:(O==null?void 0:O.waitList)||!1,soldOut:(O==null?void 0:O.soldOut)||!1}}),L=[],Z=N.some(T=>!(!T||(T==null?void 0:T.dataType)==="ADDON"||(T==null?void 0:T.dataType)==="Donation"||Number(T==null?void 0:T.numberofticket)<=0))||(M==null?void 0:M.some(T=>T&&Number(T==null?void 0:T.numberofticket)>0)),{purchasedTicketTypes:K}=this.state,R=(K==null?void 0:K.length)>0;G.forEach(T=>{var ue,ae,Y,me,re,Se;const l=de[T==null?void 0:T.typeId]&&((ue=de[T==null?void 0:T.typeId])==null?void 0:ue.numberofticket)>0,O=(T==null?void 0:T.dataType)==="ADDON",B=(T==null?void 0:T.addonType)==="EXHIBITOR_BOOTH",I=(T==null?void 0:T.listOfTicketTypesForAddOn)||[],Q=B?!0:O&&I.length>0?I.some(he=>{const Ne=N[he]||(M==null?void 0:M[he]);return Ne&&Number(Ne.numberofticket)>0}):Z,ie=B?!0:O&&I.length>0?I.some(he=>K==null?void 0:K.includes(parseInt(he,10))):R,se=O?Q||ie:!0;if(T!=null&&T.shouldAutoAdd&&se&&!(T!=null&&T.soldOut)&&!l&&!T.shouldHide&&!this.pendingAutoAddTickets.has(T==null?void 0:T.typeId)&&!((ae=this.manuallyRemovedAutoAddTickets)!=null&&ae.has(T==null?void 0:T.typeId))&&w(T==null?void 0:T.endDate).diff(w())>=0&&w(T==null?void 0:T.startDate).diff(w())<0&&!(T!=null&&T.waitList))L.push({type:"ADD",ticketData:T,quantity:T.autoAddQuantity||T.minTickerPerBuyer||1});else if(T!=null&&T.setMinQuantity&&l&&!T.shouldHide){const he=T.autoAddQuantity||T.minTickerPerBuyer,Ne=Number(((Y=de[T==null?void 0:T.typeId])==null?void 0:Y.numberofticket)||0),Ie=(me=this.manuallyAdjustedAutoAddTickets)==null?void 0:me.get(Number(T==null?void 0:T.typeId)),Oe=Ie!=null&&he<=Ie;Ne>0&&Ne<he&&!Oe&&(Ie!=null&&((re=this.manuallyAdjustedAutoAddTickets)==null||re.delete(Number(T==null?void 0:T.typeId))),this.originalMinTickerPerBuyer[T.typeId]==null&&(this.originalMinTickerPerBuyer[T.typeId]=Number(((Se=de[T==null?void 0:T.typeId])==null?void 0:Se.minTickerPerBuyer)||T.minTickerPerBuyer||0)),L.push({type:"SET",ticketData:T,quantity:he}))}}),de.forEach(T=>{const l=(T==null?void 0:T.typeId)||(T==null?void 0:T.tickettypeid),O=G.find(Q=>Number(Q==null?void 0:Q.typeId)===Number(l)),B=fe.find(Q=>Number(Q==null?void 0:Q.typeId)===Number(l));if(B&&!O){L.push({type:"REMOVE",ticketData:B,quantity:0});return}const I=O||B;if((I==null?void 0:I.dataType)==="ADDON"&&(I==null?void 0:I.addonType)!=="EXHIBITOR_BOOTH"&&Number(T==null?void 0:T.numberofticket)>0){const Q=(I==null?void 0:I.listOfTicketTypesForAddOn)||[],ie=Q.some(Y=>{const me=N[Y]||(M==null?void 0:M[Y]);return me&&Number(me.numberofticket)>0}),se=Q.some(Y=>K==null?void 0:K.includes(parseInt(Y,10))),ue=this.hasExhibitorPurchasedLinkedTicket(Q),ae=ke==null?void 0:ke.some(Y=>Y&&(Y==null?void 0:Y.dataType)!=="ADDON"&&(Y==null?void 0:Y.dataType)!=="Donation"&&Number(Y==null?void 0:Y.numberofticket)>0);!ie&&!se&&!ue&&!Z&&ae&&L.push({type:"REMOVE",ticketData:I,quantity:0})}}),G.forEach(T=>{var Q,ie,se,ue;const l=de[T.typeId];if(!l||Number(l.numberofticket)===0)return;const O=Number(l.numberofticket),B=((ie=(Q=T==null?void 0:T.ticketRuleActions)==null?void 0:Q.Set_Quantity)==null?void 0:ie.length)>0,I=((ue=(se=T==null?void 0:T.ticketRuleActions)==null?void 0:se.Max_Quantity)==null?void 0:ue.length)>0;if(O<T.minTickerPerBuyer)B&&this.originalMinTickerPerBuyer[T.typeId]==null&&(this.originalMinTickerPerBuyer[T.typeId]=Number(l.minTickerPerBuyer)||0),this.preAdjustmentQuantityMap[T.typeId]==null&&(this.preAdjustmentQuantityMap[T.typeId]=O),L.push({type:"SET",ticketData:T,quantity:T.minTickerPerBuyer});else if(B&&!T.setMinQuantity&&this.originalMinTickerPerBuyer[T.typeId]!=null&&O>this.originalMinTickerPerBuyer[T.typeId]){const ae=this.originalMinTickerPerBuyer[T.typeId];L.push({type:"SET",ticketData:T,quantity:ae}),delete this.originalMinTickerPerBuyer[T.typeId],delete this.preAdjustmentQuantityMap[T.typeId]}I&&T.setMaxQuantity&&O>T.maxTickerPerBuyer&&(this.preAdjustmentQuantityMap[T.typeId]==null&&(this.preAdjustmentQuantityMap[T.typeId]=O),L.push({type:"SET",ticketData:T,quantity:T.maxTickerPerBuyer})),this.props.isExhibitorFlow&&T.limitQuantityRuleId&&!T.setMaxQuantity&&O>T.maxTickerPerBuyer&&(this.preAdjustmentQuantityMap[T.typeId]==null&&(this.preAdjustmentQuantityMap[T.typeId]=O),L.push({type:"SET",ticketData:{...T,minTickerPerBuyer:0},quantity:T.maxTickerPerBuyer}))}),L.length>0&&this.applyRuleActions(L)}}}render(){var As,Ss,vs,Ns,Is,Ds,Rs,Fs,Ps,ws,xs,Ls,Os,Bs,Ms,_s,Us,Hs,Qs,Vs,qs,$s,Gs,Ws,zs,Ys,js,Ks,Xs,Js,Zs,ea,ta,sa,aa,ia,na,oa,ra,la,ca,da,ua,ha,pa,fa,ma;const{settings:p,isLoaded:e,showCheckout:t,paymentType:s,orderId:n,totalTickets:a,waitListSettings:r,totalTicketQty:o,donationAmounts:d,openWaitListPopup:c,showMapPopup:m,popupAlertHeader:g,message:k,isError:S,recurringEventList:u,selectedRecurringEvent:E,showRecurringCal:h,ticketCategory:y,selectedSeats:b,totalTicketPrice:D,ticketTypeList:P,isSeatsioFullScreen:C,showImportAttendeesModal:F,attendeeProperties:_,donationInputValue:$,chargebeePlanName:U,attendeeImportLimit:A,allowToImportAttendees:x,accessCodeSuccessMessage:H,totalTicketFee:q,totalVatFee:N,totalNumberOfTickets:V,isSelectedFreeWaitList:J,ticketWithoutDonationAndAddon:W,totalSalesTaxFee:te,totalDonationSalesTaxFee:j,totalDonationVatTaxFee:v,ticketingFeeData:M,checkoutErrorMsg:de,isCheckoutLinkExpired:ke,allTicketForPayLater:fe,ticketingTypeIdValue:Te,invisibleCaptchaSiteKey:G,isTicketTypeLoaded:L,showLinkExpired:Z,note:K,limitRegistrationEmails:R,isDepositEnabled:T,totalDepositAmount:l,finalAmountWithDeposit:O,paymentLabel:B,hasSomePayLaterTickets:I,PostDepositBalance:Q,ticketPurchaseSuccessPopup:ie,isStripePaymentProcessing:se,showRuleValidationPopup:ue,seatDetails:ae}=this.state,{eventDetails:Y,eventData:me,isFromStaff:re,ticketingSettings:Se,isHost:he,widgetSettings:Ne,widget:Ie,embed:Oe,recurringEventID:He,eventUrl:z,ticketCategory:Ce,waitListCheckout:le,t:ne,breadcrumbText:ge,layoutProps:ve,eventUrlfromTicketStep:Pe,setOrderExpierd:Xe,getRecurringEvent:Ae,recurringEventKey:De,isDisableRecurring:we,removeTotalTickets:Ge,preEventAccessData:Nt,is
2FromWaitlist:We,currencySymbol:Re,isFromHost:It,isVatEnabled:yt,isRegApproval:Dt,isCustomBeeFreeAddon:rt,history:$t,type:gt,autoDiscountCodeId:Gt}=this.props,{displayCode:kt}=this.state,{hostClass:Rt}=ve||{},{generalBackgroundColor:ks,borders:bt}=Ne||{},{recurring:Fe,eventFormat:$a,eventDesignDetails:Wt}=Y||{},Ga=((P==null?void 0:P.some(X=>X==null?void 0:X.allowAssignedSeating))||this.hasSeatedBoothAddon())&&$a!=="VIRTUAL";if(e&&Fe&&!$e(u))return i.createElement("div",{className:"text-center fullWidth",style:{marginTop:re?"":"25%"}},i.createElement("h4",{className:"text-center fullWidth"},ne("common:No future events available.")));if(ke&&de)return i.createElement(ee,{header:de,variant:"body2",labelClass:"m-b-0",className:"justify-content-center"});if(this.state.claimLinkExpired)return this.state.hideClaimResendLink?i.createElement(ee,{header:this.state.claimLinkExpiredMsg||ne("common:No approved tickets found for this action."),variant:"body2",labelClass:"m-b-0",className:"justify-content-center"}):i.createElement(Ha,{showCloseIcon:!1,id:"claim_link_expired_inline",modalClassName:"delete-poll-question waitlist-link-expired p-b-24",showModal:!0,bsSize:"md"},i.createElement("div",{className:"waitlist-link-expired-content"},i.createElement(ee,{variant:"heading3",className:"text-center",color:(Ss=ce[(As=this.context)==null?void 0:As.theme])==null?void 0:Ss.neutral1000},this.state.claimLinkExpiredMsg||ne("common:Your checkout link has expired.")),i.createElement(ee,{variant:"body2",className:"text-center m-t-20",color:(Ns=ce[(vs=this.context)==null?void 0:vs.theme])==null?void 0:Ns.neutral850},ne("common:Please contact the event organizer or request a new link below."))),i.createElement("div",{className:"m-t-20 display-flex justify-c-c gap-16"},i.createElement(Ee,{variant:"primary",id:"claim-resend-link-btn",className:"btn preview-button",onClick:this.handleResendClaimLink,disabled:this.state.resendingClaimLink,label:this.state.resendingClaimLink?ne("common:Sending..."):ne("common:Resend Checkout Link")})));if(se)return i.createElement("div",{className:"text-align-center"},i.createElement(nt,{type:"SpinnerExtraSmall"}));if(!Y||!Se)return null;const ze=p==null?void 0:p.ticketTypes,bs=(ze==null?void 0:ze.length)>0||this.state.expoFpConfig&&((Is=this.state.addonTicketData)==null?void 0:Is.some(X=>(X==null?void 0:X.addonType)==="EXHIBITOR_BOOTH")),zt=(ze==null?void 0:ze.some(X=>(X==null?void 0:X.dataType)==="TICKET"||(X==null?void 0:X.addonType)==="EXHIBITOR_BOOTH"))||this.state.expoFpConfig&&((Ds=this.state.addonTicketData)==null?void 0:Ds.some(X=>(X==null?void 0:X.addonType)==="EXHIBITOR_BOOTH")),Wa=(ze||[]).some(X=>(X==null?void 0:X.dataType)==="ADDON"&&this.checkTicketIsPurchasedForAddon(X));if(!p||!ze)return L?null:i.createElement("div",{className:"text-align-center"},i.createElement(nt,{type:"SpinnerExtraSmall"}));const{accessCodeAvailable:Et}=p,Es=He||E,Ye=R?xe:ze,za=Ye==null?void 0:Ye.some(X=>(X==null?void 0:X.ticketType)==="DONATION"),Ya=Fe&&$e(u)>0?new Date(w(`${u&&((Rs=u[0])==null?void 0:Rs.occursFrom)} ${u&&((Fs=u[0])==null?void 0:Fs.startTime)}`,"DD/MM/YYYY HH:mm:ss")):w(Y.startDate)._d,Cs=[];return Be(u,(X,Qe)=>Cs.push({title:`${w(X.startTime,"HH:mm").format("h:mm A [To]")} ${w(X.endTime,"HH:mm").format("h:mm A")}`,start:new Date(w(`${X==null?void 0:X.occursFrom} ${X.startTime}`,"DD/MM/YYYY HH:mm:ss").toString()),end:new Date(w(`${X==null?void 0:X.occursFrom} ${X.endTime}`,"DD/MM/YYYY HH:mm:ss").toString()),id:X.id,key:Qe})),i.createElement("div",null,ie?he||re?i.createElement(zn,{goBack:()=>this.setState({ticketPurchaseSuccessPopup:!1}),eventData:me||Y,isFromStaff:re,isHost:he}):i.createElement(Io,{eventData:me||Y,orderId:n}):i.createElement(i.Fragment,null,Ie&&Oe&&(Y!=null&&Y.recurring)&&u.length!==0?i.createElement(i.Fragment,null,this.recurringEventRadioButton()):null,i.createElement("div",{className:"clearfix m-t-0"},i.createElement("div",{className:"pull-left checkout-tickets-alert-message"},i.createElement(ln,{message:k,isError:S}))),i.createElement("div",{className:"admin-content-wrapper add-attendees-management"},i.createElement(xn,{eventUrl:(Ps=this.props)!=null&&Ps.embed?(ws=this.props)==null?void 0:ws.eventUrl:(xs=this.state)==null?void 0:xs.eventUrl,eventData:Y,status:"TICKETING_ACTIVATED_TRIGGERED"}),(he||re)&&i.createElement("div",{className:"m-l-r-15 m-b-20 d-flex justify-content-between"},he&&i.createElement(Wn,{currentPage:ge,priviousPages:[{name:"Attendees"}]}),i.createElement(wn,{svgIcon:"ac-icon-staff",text:ne("common:Add Attendees"),fixed:!0,fixedOnMobile:!1,showSaveButton:!1,btnDisabled:!1,saveButtonText:"",showNotifications:!0,viewBox:"2 0 20 20",ticketClassName:"attendee-ticket-order"}),he&&i.createElement(i.Fragment,null,i.createElement(Ee,{id:"purchaseTicketImportCSVNew",className:" m-t-10",variant:"secondary",icon:"ac-icon-upload",isPrevIcon:!0,onClick:this.handleImportAttendees},`${ne("common:Import Attendees")}`))),(this.props.isHost||re)&&Fe&&i.createElement("div",{className:"p-1
25 row"},i.createElement("div",{className:pe("text-left col-xs-8 col-sm-4",re?"col-md-6":"col-md-3")},u.length!==0&&this.recurringEventDropDown())),e?t?i.createElement("div",null,i.createElement("div",{className:"m-l-r-15 clearfix"},i.createElement("div",{className:""},i.createElement(Pn,{eventUrl:this.props.embed?this.props.eventUrl:this.state.eventUrl,embed:this.props.embed,widget:Ie,widgetSettings:Ne,isFromHost:It,orderId:n,paymentType:T?"CC":s,paymentLabel:B,isHostPage:!this.props.embed,isHost:this.props.isHost,isStaff:!0,isRegApproval:Dt,isApplicationOrder:this.props.isApplicationOrder,waitListIds:this.props.waitListIds,recurringEventID:Es,handleBackBtn:this.handleBackBtn,eventUrlfromTicketStep:Pe,setOrderExpierd:Xe,getRecurringEvent:Ae,recurringEventKey:De,isDisableRecurring:we,removeTotalTickets:Ge,ticketPurchaseSuccessPopup:ie,preEventAccessData:Nt,totalTicketQty:o,ticketingSettings:Se,isFromStaff:re,isFromWaitlist:We,totalTicketFee:q,totalVatFee:N,totalSalesTaxFee:te,totalDonationSalesTaxFee:j,totalDonationVatTaxFee:v,totalTicketPrice:D,totalNumberOfTickets:V,totalTickets:a,currencySymbol:Re,isSelectedFreeWaitList:J,ticketWithoutDonationAndAddon:W,isVatEnabled:yt,calculateTicketingFeeData:M,setActiveView:this.props.setActiveView,emptyTicketsState:this.emptyTicketsState,applyCalculateTicketFee:X=>this.applyCalculateFee(X,{useStoredDiscountCode:!1}),onDiscountRemoved:this.clearStoredDiscountCode,isCustomBeeFreeAddon:rt,showMessage:this.showMessage,note:K,isDepositEnabled:s==="DEPOSIT"&&T,isPayLater:s==="INVOICE",depositAmount:l,finalAmountWithDeposit:O,getEventTicketTypesRemainingCounts:this.getEventTicketTypesRemainingCounts,PostDepositBalance:Q,expoFpAddonId:(Ls=this.state.selectedExpoBooth)==null?void 0:Ls.ticketTypeId,expoFpBoothName:(Os=this.state.selectedExpoBooth)==null?void 0:Os.boothName,expoFpBoothPrice:((Bs=this.state.selectedExpoBooth)==null?void 0:Bs.price)!=null?this.state.selectedExpoBooth.price:null,expoFpBoothDiscount:((Ms=this.state.selectedExpoBooth)==null?void 0:Ms.discountAmount)!=null?this.state.selectedExpoBooth.discountAmount:null,onResetBoothDiscount:()=>{var Je,qe;const X=this.state.selectedExpoBooth;if(!X||!X.discountAmount)return;const Qe={...X,discountAmount:0};this.setState({selectedExpoBooth:Qe}),(qe=(Je=this.props).onExpoBoothSelected)==null||qe.call(Je,Qe)}})))):i.createElement("div",{className:pe(Rt,re&&"new-checkout-staff")},i.createElement("div",{style:{backgroundColor:ks},className:(Ie||rt)&&"widget-main-div"},!he&&Et&&!zt&&this.renderAccessCodePrompt(),!Et&&!bs?i.createElement("div",{className:!this.props.isFromStaff&&"d-flex justify-c-c noTicketAvailable-box"},i.createElement("div",{className:pe("noTicketAvailable",this.props.isFromStaff&&"text-center"),id:"noTicketAvailable"},i.createElement(_e,{svgIcon:"virtual-icon-ticket",viewBox:"0 0 120 80",width:"120",height:"80",color:"none",className:"no-ticket"}),kt?i.createElement(ee,{variant:"heading3",color:(Us=ce[(_s=this.context)==null?void 0:_s.theme])==null?void 0:Us.neutral1000,labelClass:"p-t-32 m-b-0",className:this.props.isFromStaff&&"justify-c-c"},"No filter code was used for this event"):i.createElement(ee,{variant:"heading3",color:(Qs=ce[(Hs=this.context)==null?void 0:Hs.theme])==null?void 0:Qs.neutral1000,labelClass:"p-t-32 m-b-0",className:this.props.isFromStaff&&"justify-c-c"},ne("common:No tickets available for this event")),i.createElement(ee,{variant:"body2",color:(qs=ce[(Vs=this.context)==null?void 0:Vs.theme])==null?void 0:qs.neutral700,labelClass:"m-t-12",className:"justify-c-c"},ne("checkoutDetails:Please check back or contact the organizer")),he&&this.props.authenticated&&i.createElement("a",{href:`/host/${this.props.eventUrl}/event-ticketing/create`,role:"button",className:"btn btn-warning btn-lg"},ne("common:Click Here to Get Started")))):i.createElement("div",{className:pe(re?null:"","widget-ticket-list",C?"seatsio-fullscreen-on":"seatsio-fullscreen-off",he||re?"host-side-ticket":"")},i.createElement("div",null,i.createElement("div",{className:pe("have-a-code d-flex justify-content-between align-items-center",(this.state.openAccessCode||H)&&"have-access-code",We&&"m-b-32")}
2,(!pt(P)||bs)&&i.createElement(ee,{variant:"heading3",color:(Gs=ce[($s=this.context)==null?void 0:$s.theme])==null?void 0:Gs.neutral1000,className:"mt-0 mb-0",labelClass:"m-b-0 select-label"},ne("checkoutDetails:Select your tickets")),this.renderUnifiedCodeField("toggle",!he&&Et&&!zt)),this.renderUnifiedCodeField("panel",!he&&Et&&!zt),(Gt||this.isSetPriceAppliedToCart()||this.isFlatDiscountAppliedToCart()||this.hasPercentageDiscountInCart()&&!this.isTieredDiscountAppliedToCart())&&this.renderRuleDiscountDetectedBanner(),Ga?i.createElement("div",{className:"seat-io-section-container m-b-32"},!(he||re)&&p&&p.seatingChartKey&&i.createElement("div",{className:"full-screen-section-anchor"},i.createElement("div",{className:"full-screen-section",onClick:this.toggleSeatsioFullScreen},i.createElement("i",{className:"ac-icon-expand"}))),(he&&Fe&&E&&p.eventKey||Fe&&Es&&p.eventKey||!Fe&&Y.eventId)&&p.seatingChartKey&&p.seatingChartKey!==""&&(Ce||y)?i.createElement(i.Fragment,null,i.createElement(ko,{selectedSeats:b,addDonation:this.selectSeatTicket,settings:p,host:he||re,ticketCategory:Ce||y,eventUrl:re||Oe?z:Y&&Y.eventUrl||Y&&Y.eventURL,recurring:Fe,recurringEventID:He,storeBuyTicketList:this.storeBuyTicketList,waitListCheckout:le,waitListSettings:r,openWaitListForm:this.openWaitListForm,paymentGateway:me==null?void 0:me.paymentGateway,seatDetails:ae,ticketTypeFeesAndDesc:this.state.ticketTypeFeesAndDesc})):null):null,this.state.expoFpConfig&&((Ws=this.state.addonTicketData)==null?void 0:Ws.some(X=>(X==null?void 0:X.addonType)==="EXHIBITOR_BOOTH"))&&i.createElement("div",{className:"expofp-booth-selector-container m-b-32"},i.createElement(So,{expoFpConfig:this.state.expoFpConfig,eventUrl:re||Oe?z:Y&&Y.eventUrl||Y&&Y.eventURL,selectedBooth:this.state.selectedExpoBooth,currencySymbol:(zs=this.props.eventDetails)==null?void 0:zs.currencySymbol,availableTicketTypes:[...((Ys=this.state.settings)==null?void 0:Ys.ticketTypes)||[],...this.state.addonTicketData||[]],onBoothSelected:X=>{var Je,qe;const Qe=this.state.selectedExpoBooth;this.setState({selectedExpoBooth:X}),(qe=(Je=this.props).onExpoBoothSelected)==null||qe.call(Je,X),this.addBoothTicketToOrder(X,Qe)},onBoothRemoved:()=>{var Ta,ya,ga;const X=this.state.selectedExpoBooth;if(this.setState({selectedExpoBooth:null}),(ya=(Ta=this.props).onExpoBoothSelected)==null||ya.call(Ta,null),!(X!=null&&X.ticketTypeId))return;const Je=[...((ga=this.state.settings)==null?void 0:ga.ticketTypes)||[],...this.state.addonTicketData||[]].find(Ve=>{var Ze,ka;return((Ze=Ve==null?void 0:Ve.typeId)==null?void 0:Ze.toString())===((ka=X.ticketTypeId)==null?void 0:ka.toString())});if(Je){this.handleTicketSelection({value:0,label:0},Je);return}const qe=this.state.totalTickets?this.state.totalTickets.slice():[];delete qe[X.ticketTypeId];let Yt=0,jt=0,Ft=0;qe.forEach(Ve=>{if(!Ve)return;const Ze=parseInt(Ve.numberofticket||0,10);Yt+=parseFloat(Ve.price||0)*Ze,jt+=parseFloat(Ve.fee||0),Ft+=Ze}),this.setState({totalTickets:qe,totalTicketPrice:Yt,totalTicketFee:jt,totalTicketQty:Ft},()=>{var Ve,Ze;(Ze=(Ve=this.props).onHandelChangeCallBack)==null||Ze.call(Ve,qe,Ft,Yt,jt,this.state.selectedSeats||[],Ft,parseFloat(this.state.totalVatFee||0).toFixed(2),parseFloat(this.state.totalSalesTaxFee||0).toFixed(2),parseFloat(this.state.totalDonationSalesTaxFee||0).toFixed(2),parseFloat(this.state.totalDonationVatTaxFee||0).toFixed(2),this.state.ticketingFeeData||[])})}})),L?i.createElement(i.Fragment,null,this.ticketSelectionContainer(P,!1),($e(P)>0||((js=this.state.addonTicketData)==null?void 0:js.some(X=>(X==null?void 0:X.addonType)==="EXHIBITOR_BOOTH"))||Wa||kt&&(!Et||this.state.accessCodeSuccessMessage||he||re))&&this.addonSelectionConainer()):i.createElement("div",{className:"text-align-center"},i.createElement(nt,{type:"SpinnerExtraSmall"})))),za&&!this.isExistingOrder()?i.createElement("div",{className:`m-b-24 m-t-40 ${(he||re)&&"p-l-15"}`},i.createElement(ee,{variant:"heading3",color:(Xs=ce[(Ks=this.context)==null?void 0:Ks.theme])==null?void 0:Xs.neutral1000,labelClass:"m-b-0"},ne("checkoutDetails:Donation"))):null,(Ye==null?void 0:Ye.length)!==0&&!this.isExistingOrder()?Ye==null?void 0:Ye.map((X,Qe)=>X.ticketType==="DONATION"&&i.createElement(i.Fragment,null,i.createElement(vo,{item:X,key:Qe,donationAmounts:d,totalTickets:a,handleDonationAmount:this.handleDonationAmount,eventDetails:Y,donationInputValue:$,
2isFromStaff:this.props.isFromStaff,isHost:this.props.isHost,widget:Ie,borders:bt}))):null,i.createElement(mo,{showModal:c,eventUrl:this.props.isFromStaff||this.props.embed?this.props.eventUrl:Y&&Y.eventUrl||Y&&Y.eventURL,onCloseFunc:this.closeWaitListForm,waitListSettings:r,recurringEventID:He,getWaitListSettings:this.getWaitListSettings,ticketingTypeIdValue:Te})),this.showPaymentOptions()?i.createElement("div",{className:"payment-container m-t-15 p-l-15 m-b-24"},i.createElement("div",{className:"form-group"},i.createElement(ee,{variant:"heading4",className:"payment-label",header:ne("common:Payment Type"),color:(Zs=ce[(Js=this.context)==null?void 0:Js.theme])==null?void 0:Zs.neutral1000,labelClass:"m-b-0"}),i.createElement("div",null,i.createElement("div",{className:pe("payment-container-inner",{"five-payment-container":fe||T},{"staff-payment-container":re||Dt||We})},is==null?void 0:is.map((X,Qe)=>i.createElement(i.Fragment,null,this.renderPaymentOption(X,Qe))))))):null,this.showPaymentBreakdownBox()?i.createElement("div",{className:"select-payment-method deposit-payment-options m-b-24"},i.createElement("div",{className:pe("payment-info-box",{"debit-info-box-regapproval":["DEPOSIT","INVOICE"].includes(s),"debit-info-box-cc":s==="CC"})},i.createElement(ee,{variant:"captions2",className:"heading-deposit-amount m-b-5",labelClass:"m-b-0",color:(ta=ce[(ea=this.context)==null?void 0:ea.theme])==null?void 0:ta.neutral700,header:s==="CC"?"Total":"Due Today"}),i.createElement(ee,{variant:"heading4",className:"total-deposit-amount",labelClass:"m-b-0",color:(aa=ce[(sa=this.context)==null?void 0:sa.theme])==null?void 0:aa.neutral1000,header:`${Y==null?void 0:Y.currencySymbol}${cn((s==null?void 0:s.toLowerCase())||"",a,I,D+q)}`}),i.createElement("div",{className:"d-flex align-items-baseline"},["DEPOSIT","INVOICE"].includes(s)?i.createElement(i.Fragment,null,i.createElement(ee,{variant:"custom-captions",labelClass:"m-b-0",className:"heading-remaining-amount",color:(na=ce[(ia=this.context)==null?void 0:ia.theme])==null?void 0:na.neutral1000,header:"Due Later:"}),i.createElement(ee,{variant:"custom-captions",labelClass:"m-b-0",className:"remaining-amount m-t-2 m-l-5",color:(ra=ce[(oa=this.context)==null?void 0:oa.theme])==null?void 0:ra.neutral1000,header:`${Y==null?void 0:Y.currencySymbol}${dn((s==null?void 0:s.toLowerCase())||"",a,I,D+q,Q)}`})):null),i.createElement(ee,{variant:"caption3",className:"heading-remaining-amount",color:(ca=ce[(la=this.context)==null?void 0:la.theme])==null?void 0:ca.neutral700,header:"See the Order Summary for a full breakdown."}))):null,this.showNoteArea()?i.createElement("div",{className:"row mt-3"},i.createElement("div",{className:"col-md-12"},i.createElement("div",{className:"p-l-15 add-note-area"},i.createElement(eo,{defaultValue:this.noteValue,label:ne("common:Add a note (optional)"),onNoteChange:this.handleNoteChange}
2)))):"",this.showContinueButton()?i.createElement("div",{className:"status-bar clearfix mrg-t-lg m-l-15"},i.createElement(Ee,{block:!0,id:"checkout-tickets",onClick:this.doOrderTicket,disabled:this.state.disableContinue||this.state.isEnforcingRules,label:D&&D>0?ne("common:Continue"):ne("common:Register")})):null):i.createElement("div",{className:"text-align-center"},i.createElement(nt,{type:"SpinnerExtraSmall"}))),(Wt==null?void 0:Wt.enableCaptcha)&&!this.props.isHost&&!re&&!Ie&&!Oe&&G&&i.createElement("div",{className:"d-none"},i.createElement(Sn,{style:{display:"inline-block"},ref:this._reCaptchaRef,size:"invisible",sitekey:G,onChange:this.validateCaptcha,onErrored:X=>console.log(X),asyncScriptOnLoad:()=>console.log("script loaded")})),i.createElement(ss,{id:"alertPopup",showModal:m,key:"alertPopup",headerText:i.createElement("p",null,g),modelBody:"",onCloseFunc:this.hideMapPopup},i.createElement("div",{className:"ticket-type-container"},this.state&&this.state.errorMsg,i.createElement("div",{className:"modal-footer"},i.createElement(Ee,{className:"preview-button",onClick:this.hideMapPopup,label:"Close",variant:"danger",id:"purchaseTicketClose"})))),i.createElement(ss,{id:"alertPopup",showModal:ue,key:"alertPopup",headerText:i.createElement("p",null,g),modelBody:"",onCloseFunc:this.hideRuleValidationPopup},i.createElement("div",{className:"ticket-type-container"},this.state&&this.state.validationMessage,i.createElement("div",{className:"modal-footer"},i.createElement(Ee,{className:"preview-button",onClick:this.hideRuleValidationPopup,label:"Close",variant:"danger",id:"purchaseTicketClose"})))),i.createElement(Ha,{showCloseIcon:!1,id:"waitlist_link_expired",modalClassName:"delete-poll-question waitlist-link-expired p-b-24",showModal:!o&>!=="RA"&>!=="AO"&&Z,bsSize:"md",onCloseFunc:()=>this.toggleLinkPopup()},i.createElement("div",{className:"waitlist-link-expired-content"},i.createElement(ee,{variant:"heading3",className:"text-center",color:(ua=ce[(da=this.context)==null?void 0:da.theme])==null?void 0:ua.neutral1000},"Your link to register has expired."),i.createElement(ee,{variant:"body2",className:"text-center m-t-20",color:(pa=ce[(ha=this.context)==null?void 0:ha.theme])==null?void 0:pa.neutral850},"Please rejoin the waitlist for the opprortunity to register."),i.createElement(ee,{variant:"body2",className:"text-center",color:(ma=ce[(fa=this.context)==null?void 0:fa.theme])==null?void 0:ma.neutral850},"If you have any questions, please contact the organizer.")),i.createElement("div",{className:"m-t-20 float-right"},i.createElement(Ee,{className:"btn preview-button",onClick:()=>this.toggleLinkPopup(),variant:"secondary",label:"Cancel"}),i.createElement(Ee,{variant:"primary",className:"btn preview-button m-l-16",onClick:()=>$t.push(`/e/u/checkout/${z}/tickets/order`,{fromWaitlist:!0}),label:(r==null?void 0:r.waitListButtonText)||"Join Wait List"}))),i.createElement(ss,{id:"showRecurringCal",key:"showRecurringCal",showModal:h,headerText:i.createElement("p",null,ne("common:Recurring Event Calendar")),onCloseFunc:this.handleRecuringCalander},i.createElement("div",null,i.createElement(En,{localizer:Ro,style:{height:600},toolbar:!0,events:Cs,defaultDate:Ya,step:60,defaultView:"month",views:["month","week","day"],onView:()=>{},selectable:!0,onSelectEvent:this.handleEvent}))),i.createElement(No,{showModal:F,onClose:this.handleCloseImportAttendeesModal,onConfirmImport:this.handleConfirmAttendeeImport,customOptionSection:!0,ticketOptions:this.formatTicketOptions(),addonOptions:this.formatAddonOptions(),entityType:"Attendee",entityTypePlural:"Attendees",templateLink:"NewAttendeeUploadCSVTemplate.csv",learnMoreLink:un,entityProperties:_,completionDisplayType:"simple",allowedOptions:["addAndUpdate","addOnly","updateOnly"],maxFileSize:250*1024*1024,uploadURL:`events/${Y&&(Y==null?void 0:Y.eventUrl)}/staff/checkAttendeeCSV/ticketType`,eventUrl:Y&&(Y==null?void 0:Y.eventUrl),chargebeePlanName:U,attendeeImportLimit:A,allowToImportAttendees:x})))}selectHandle(p,e,t=!1){var a,r,o,d,c,m,g,k,S,u;this.hasUserInteracted=!0;const s=parseInt(p.value,10);!this.isApplyingRuleActions&&((a=this.preAdjustmentQuantityMap)==null?void 0:a[e.typeId])!=null&&delete this.preAdjustmentQuantityMap[e.typeId];const n=((r=this.autoAddedTicketIds)==null?void 0:r.has(Number(e.typeId)))||((o=this.originalMinTickerPerBuyer)==null?void 0:o[e.typeId])!=null;return!this.isApplyingRuleActions&&n&&((c=(d=e==null?void 0:e.ticketRuleActions)==null?void 0:d.Set_Quantity)==null?void 0:c.length)>0&&this.manuallyAdjustedAutoAddTickets.set(Number(e.typeId),Number(e.autoAddQuantity||0)),s===0&&((g=(m=e==null?void 0:e.ticketRuleActions)==null?void 0:m.Set_Quantity)==null?void 0:g.length)>0?(this.manuallyRemovedAutoAddTickets||(this.manuallyRemovedAutoAddTickets=new Set),this.manuallyRemovedAutoAddTickets.add(e.typeId),this.autoAddedTicketIds.delete(Number(e.typeId))):s>0&&((k=this.manuallyRemovedAutoAddTickets)!=null&&k.has(e.typeId))&&this.manuallyRemovedAutoAddTickets.delete(e.typeId),this.addDonation(e.typeId.toString(),e.name,e.price.toString(),!1,p.value.toString().trim(),e.fee.toString(),[],[],[],(S=e.salesTax)==null?void 0:S.toString(),(u=e.vatTax)==null?void 0:u.toString(),e.passFeesToBuyer,e.payLater,t,e.minTickerPerBuyer,e.maxTickerPerBuyer)}};gs.contextType=hs;let us=gs;const Fo={getOrderConfirmationPageByOrderId:Qi,storeIsStaff:Hi,doOrderTicket:Ui,doUpdateOrderTicket:_i,doGetSettings:(f,p,e,t,s)=>Ji(f,p,e,t,s),doGetHiddenSettings:Mi,getStoreDesignData:(f,p)=>Xi(f,p),getWaitlistSettings:(f,p)=>Ki(f,p),storeBuyTicketList:f=>ji(f),doGetRecurringEvent:f=>Yi(f),doGetSeatingCategories:(f,p,e)=>zi(f,p,e),doCalculateTicketFees:Bi,storeEventTicketData:Oi,storeCapacityInfo:Li,storeAccessCode:xi,doGetEventPlanConfig:wi,doGetIsVatTaxEnabledFromCac
2he:Pi,doGetEventTicketTypesForDisplayFromCache:Fi,validateEmailOnRegistration:Ri,doGetEventTicketSeatingCategoriesForDisplayFromCache:Di,doGetCodesAndCapacityReachStatusForDisplayFromCache:Ii,storeEventTicketType:Ni,getPurchasedTicketsIdList:vi,checkWaitListLinkValidity:Si,storeRegRequestTicketList:Ai,doGetEventTicketTypesFeesAndDiscriptionFromCache:Ci,doGetEventTicketTypesRemainingCounts:Ei,doGetWidgetSettings:bi,validateCodeType:Qa,validateUnifiedCode:ki,storeAppliedDiscountCode:gi,removeCouponCode:yi,uploadAttendeeCSVItems:Ti,getAttendeeCSVDefaultFields:mi,orderTicket:vn,setTicketSuccess:fi,getTicketRulesDisplay:pi,getAccessCodeDetails:hi,doGetSeatDetails:ui,fetchPublicExpoFpConfig:di,getClaimCheckoutSettings:In,buyerResendClaimLink:Nn},Po=(f,p)=>{var e,t,s,n,a,r,o;return{user:(p==null?void 0:p.user)||f.session.user,eventDetails:((e=f==null?void 0:f.host)==null?void 0:e.eventDetails)||((t=f==null?void 0:f.event)==null?void 0:t.data),authenticated:f.session.authenticated,ticketingTypes:f.event&&f.event.ticket_types_data,stripeKey:f.event&&f.event.data&&f.event.data.stripeKey,isStaff:f.event&&f.event.is_volunteer,totalTickets:f.event&&f.event.buyTicketList,totalRegRequestTicketsList:f.event&&f.event.regRequestTicketList,currencySymbol:f.host&&f.host.eventDetails&&f.host.eventDetails.currencySymbol||"$",ticketingSettings:f.event&&f.event.ticket_data,cartAdbandonmentData:Wi(f),isCartAdbandonment:Gi(f),virtualEventSettings:$i(f),eventData:qi(f),isVatEnabled:(s=f==null?void 0:f.host)==null?void 0:s.isVatEnabled,whiteLabelInformation:(n=f==null?void 0:f.whiteLablesetting)==null?void 0:n.whiteLabelInformation,orderData:f.event&&f.event.order_data,capacityInfo:(a=f.event)==null?void 0:a.capacity_info,appliedDiscountCode:((r=f==null?void 0:f.checkout)==null?void 0:r.appliedDiscountCode)||null,appliedAccessCode:((o=f==null?void 0:f.checkout)==null?void 0:o.accessCode)||null}},wo=qt(Po,Fo)(Vi(Va(["common","toasterMsg"])(us))),nr=Object.freeze(Object.defineProperty({__proto__:null,default:wo},Symbol.toStringTag,{value:"Module"}));export{wo as P,ir as b,xa as e,nr as i};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.