1import{a as Ye}from"./chunk-N7LXPUNV.js";import{e as pi}from"./chunk-WQIYR2AT.js";import{a as fi,b as hi}from"./chunk-PSOULVZL.js";import"./chunk-XAXLMUF6.js";import"./chunk-6ORYOOUQ.js";import"./chunk-ZB44PIZA.js";import{c as ai,f as oi}from"./chunk-YBFQQSLW.js";import"./chunk-BT6MT7GL.js";import{a as Ge,b as ri,c as li,d as si,e as ci,f as di,g as ve,j as mi,k as ui}from"./chunk-THWUHUL4.js";import{a as te}from"./chunk-4CVZBQNN.js";import"./chunk-VFXJ4ZBD.js";import{a as Yt,b as Jt,c as ni}from"./chunk-2ZFY6MCW.js";import{a as rt,d as ei,e as ti}from"./chunk-KVMIYEBS.js";import{a as ot,c as Kt,d as Xt,e as ii}from"./chunk-DLHY2JKF.js";import"./chunk-WLMRFXCZ.js";import{a as Ze}from"./chunk-Z3AXU4EF.js";import"./chunk-TP3A6IN2.js";import"./chunk-ZB64W4XA.js";import{a as Gt}from"./chunk-SVABVB5X.js";import"./chunk-CMY6WAF3.js";import"./chunk-JTYXZXFU.js";import{a as Mt}from"./chunk-JKMNVQUA.js";import"./chunk-4D5SN44G.js";import"./chunk-HYGNXZJR.js";import"./chunk-B6XXRKU5.js";import"./chunk-6Q5DDO7R.js";import{a as At}from"./chunk-NXTJBJRP.js";import"./chunk-U22BTVEZ.js";import{$b as ie,$g as Ht,Be as jt,Ce as zt,Ec as fe,Ed as $t,Gb as z,Gc as Ue,Gd as ze,Hc as je,Hd as ne,Jc as Bt,Kb as Rt,Mb as ee,Ob as Y,Rc as Ot,Sc as ye,Ug as qt,Vc as Qt,Wc as Ee,Yd as qe,a as Et,b as Be,cc as Lt,d as Se,id as Wt,k as ke,kd as he,kh as Zt,le as Ut,mb as $e,sc as Nt,ve as _e,xb as Vt,ye as He}from"./chunk-X5J6QTCG.js";import{$ as Ae,$a as f,$b as Re,Aa as gt,Ac as yt,Ad as at,Bf as Oe,Db as vt,Eb as St,Fa as s,Fb as we,Gb as kt,H as ht,Ib as e,Jb as y,Jf as Qe,Ka as S,Kb as b,Lb as K,Lc as Le,Ma as R,Na as Ve,Ni as re,Pf as Dt,Qb as T,Rb as w,Sa as E,Sb as D,T as _t,Th as It,U as B,Wc as me,Xa as xe,_ as Ct,_c as ue,b as ut,ba as xt,bb as h,be as X,bg as We,cc as ce,d as se,db as H,dc as Me,di as Pt,e as pt,eb as Z,ec as bt,fa as _,fb as G,fi as Ft,ga as C,gb as u,hb as o,hd as Ne,ib as r,ij as Fi,jb as v,k as ft,lc as I,ma as it,mc as $,nb as P,nc as U,ob as F,pb as ge,pj as M,qb as k,qc as de,rf as De,sb as x,tb as d,u as j,ua as nt,vd as O,wd as Tt,xb as J,xd as pe,yb as Q,yd as be,zb as W,zd as wt}from"./chunk-SMW7PHYX.js";import{a as L,h as Pi}from"./chunk-BMIYOSOG.js";var V=(()=>{let c=class c{constructor(t){this.webAPI=t,this.configurationSubject=ne
1w pt(null),this.configuration$=this.configurationSubject.asObservable(),this.adminBaseURL="admin/ticket",this.columns=[{field:"eventName",header:"Event Name"},{field:"eventStart",header:"Event Start"},{field:"eventEnd",header:"Event End"}],this.purchaseColumns=[{field:"lastName",header:"Last Name"},{field:"firstName",header:"First Name"},{field:"email",header:"Email"},{field:"verifiedTicketCount",header:"Status"},{field:"totalPurchaseCost",header:"Total"},{field:"purchaseConfirmationNumber",header:"Sale Ref #"},{field:"purchasedDate",header:"Purchase Date"}]}getTicketEventInfoMetaData(){return this.webAPI.getData(`${this.adminBaseURL}/metadata`)}removeTicketConfiguration(t){return this.webAPI.putData(`${this.adminBaseURL}/${t}/remove`,{})}restoreTicketConfiguration(t){return this.webAPI.putData(`${this.adminBaseURL}/${t}/restore`,{})}getParams(){let t=new Ne;return t=t.append("page",this.filters.page.toString()),t=t.append("rows",this.filters.rows.toString()),t=t.append("includeCount",this.filters.includeCount.toString()),this.filters.orderBy&&(console.log("orderBy",this.filters.orderBy),t=t.append("orderBy",this.filters.orderBy)),this.filters.eventName&&(t=t.append("eventName",this.filters.eventName)),this.filters.email&&(t=t.append("email",this.filters.email)),this.filters.firstName&&(t=t.append("firstName",this.filters.firstName)),this.filters.lastName&&(t=t.append("lastName",this.filters.lastName)),this.filters.includeDraftTicketEvents&&(t=t.append("includeDraftTicketEvents",this.filters.includeDraftTicketEvents.toString())),this.filters.hasFutureEventsOnly&&(t=t.append("hasFutureEventsOnly",this.filters.hasFutureEventsOnly.toString())),this.filters.showRemoved&&(t=t.append("showRemoved",this.filters.showRemoved.toString())),console.log("params",t),t}searchTickets(){return this.webAPI.getData(`${this.adminBaseURL}`,this.getParams())}saveTicketConfiguration(t,a,l){return console.log("Saving ticket configuration with timeZoneID:",t.ticketClubCalendarEvent?.timeZoneID),t.ticketClubCalendarEvent.startDate&&(t.ticketClubCalendarEvent.startDate=De(t.ticketClubCalendarEvent.startDate)),t.ticketClubCalendarEvent.endDate&&(t.ticketClubCalendarEvent.endDate=De(t.ticketClubCalendarEvent.endDate)),console.log("Final ticket configuration being sent:",t),a&&l?this.webAPI.postFileAndBody(`${this.adminBaseURL}/form-content`,a,l,t):this.webAPI.postData(`${this.adminBaseURL}/ticket-configuration`,t)}saveTicketPage(t,a,l,m){return l&&m?this.webAPI.postFileAndBody(`${this.adminBaseURL}/${t}/page-content`,l,m,a):this.webAPI.putData(`${this.adminBaseURL}/${t}/ticket-page`,a)}getTicketSaleConfiguration(t){return this.webAPI.getData(`${this.adminBaseURL}/${t}`)}validateTicket(t){return this.webAPI.postData(`${this.adminBaseURL}/validate/${t}`,{})}validateTicketSale(t){return this.webAPI.postData(`${this.adminBaseURL}/validate-sale/${t}`,{})}unvalidateTicket(t){return this.webAPI.postData(`${this.adminBaseURL}/unvalidate/${t}`,{})}getTicketSaleConfigurationPurchases(t){return this.webAPI.getData(`${this.adminBaseURL}/${t}/purchases`,this.getParams())}exportTickets(t){return this.webAPI.getContentData(`${this.adminBaseURL}/${t}/export`)}cancelTicketPurchase(t,a,l){let m=new Ne;return m=m.append("issueRefund",l.toString()),this.webAPI.putData(`${this.adminBaseURL}/${t}/purchases/${a}/cancel`,{},m)}refundTicketPurchase(t,a){return this.webAPI.putData(`${this.adminBaseURL}/${t}/purchases/${a}/refund`,{})}canRefundTicketPurchase(t,a){return this.webAPI.getData(`${this.adminBaseURL}/${t}/purchases/${a}/can-refund`)}getDashboardSummary(t){return this.webAPI.getData(`${this.adminBaseURL}/${t}/dashboard-summary`)}updateEventInfo(t,a,l){a.startDate&&(a.startDate=De(a.startDate)),a.endDate&&(a.endDate=De(a.endDate));let m=new Ne;return l&&(m=m.set("notifyPurchasers","true")),this.webAPI.patchData(`${this.adminBaseURL}/${t}/event-info`,a,m)}addPriceCategory(t,a){return this.webAPI.postData(`${this.adminBaseURL}/${t}/add-price-category`,a)}addQuestion(t,a){return this.webAPI.postData(`${this.adminBaseURL}/${t}/add-question`,a)}deletePriceCategory(t,a){return this.webAPI.deleteData(`${this.adminBaseURL}/${t}/price-category/${a}`)}deleteQuestion(t,a){return this.webAPI.deleteData(`${this.adminBaseURL}/${t}/question/${a}`)}editPriceCategory(t,a){return this.webAPI.putData(`${this.adminBaseURL}/${t}/edit-price-category`,a)}updatePricingAdvancedOptions(t,a){return this.webAPI.putData(`${this.adminBaseURL}/${t}/update-pricing-advanced-options`,a)}isEventViewOnly(t){return!1}hasPurchases(t){return this.webAPI.getData(`${this.adminBaseURL}/${t}/has-purchases`)}getPriceCategoriesWithPurchaseCounts(t){return this.webAPI.getData(`${this.adminBaseURL}/${t}/price-categories-with-purchases`)}refreshConfiguration(t){return new ut(a=>{this.getTicketSaleConfiguration(t).subscribe({next:l=>{this.configuration=l,this.configurationSubject.next(l),a.next(l),a.complete()},error:l=>{a.error(l)}})})}updateConfiguration(t){this.configuration=t,this.configurationSubject.next(t)}};c.\u0275fac=function(a){return new(a||c)(xt(Ft))},c.\u0275prov=Ct({token:c,factory:c.\u0275fac});let n=c;return n})();var Vi=n=>["manage",n];function Ri(n,c){if(n&1&&(e(0,` 2 `),o(1,"th",19),e(2),v(3,"p-sortIcon",20),e(4,` 3 `),r(),e(5,` 4 `)),n&2){let i=c.$implicit,t=d(3);s(),u("pSortableColumn",i.field),xe("aria-label",t.AriaLabels.ACTIVATE_SORT),s(),b(` 5 `,i.header,` 6 `),s(),u("field",i.field)}}function Mi(n,c){if(n&1&&(e(0,` 7 `),o(1,"tr"),e(2,` 8 `),Z(3,Ri,6,4,null,null,H),o(5,"th"),e(6,"Location"),r(),e(7,` 9 `),o(8,"th"),e(9,"Status"),r(),e(10,` 10 `),o(11,"th"),e(12,"Available on Calendar"),r(),e(13,` 11 `),o(14,"th"),e(15,"Sold/Total"),r(),e(16,` 12 `),r(),e(17,` 13 `)),n&2){let i=d(2);s(3),G(i.ticketSaleService.columns)}}function Li(n,c){if(n&1&&(e(0,` 14 `),o(1,"span"),e(2),r(),e(3,` 15 `)),n&2){let i=d().$implicit;s(2),b(", ",i.eventFieldName)}}function Ni(n,c){if(n&1){let i=k();e(0,` 16 `),o(1,"button",24),x("click",function(){_(i);let a=d().$implicit,l=d(2);return C(l.openDeleteModal(a.ticketSaleConfigurationID))}),v(2,"i",25),r(),e(3,` 17 `)}}function Bi(n,c){if(n&1){let i=k();e(0,` 18 `),o(1,"button",24),x("click",function(){_(i);let a=d().$implicit,l=d(2);return C(l.openRestoreModal(a.ticketSaleConfigurationID))}),v(2,"i",26),r(),e(3,` 19 `)}}function Oi(n,c){if(n&1&&(e(0,` 20 `),o(1,"tr"),e(2,` 21 `),o(3,"td"),e(4,` 22 `),o(5,"a",21),e(6),r(),e(7,` 23 `),r(),e(8,` 24 `),o(9,"td"),e(10),I(11,"date"),I(12,"date"),r(),e(13,` 25 `),o(14,"td"),e(15),I(16,"date"),I(17,"date"),r(),e(18,` 26 `),o(19,"td"),e(20),f(21,Li,4,1),r(),e(22,` 27 `),o(23,"td"),e(24,` 28 `),v(25,"app-status-indicator",22),e(26,` 29 `),r(),e(27,` 30 `),o(28,"td"),e(29,` 31 `),v(30,"app-status-indicator",22),e(31,` 32 `),r(),e(32,` 33 `),o(33,"td"),e(34),r(),e(35,` 34 `),o(36,"td",23),e(37,` 35 `),f(38,Ni,4,0),f(39,Bi,4,0),r(),e(40,` 36 `),r(),e(41,` 37 `)),n&2){let i=c.$implicit;s(),St("opacity",i.isRemoved?"0.5":"1"),s(4),u("routerLink",Me(32,Vi,i.ticketSaleConfigurationID)),s(),y(i.eventName),s(4),y(i.isAllDayEvent?U(11,20,i.eventStart,"shortDate"):U(12,23,i.eventStart,"short")),s(5),y(i.isAllDayEvent?U(16,26,i.eventEnd,"shortDate"):U(17,29,i.eventEnd,"short")),s(5),b(` 38 `,i.eventLocationName,` 39 `),s(),h(i.eventFieldName?21:-1),s(4),u("status",i.isDraft?"warning":"success")("text",i.isDraft?"Draft":"Live")("dots",!0)("tooltipText",i.isDraft?"This event is a draft. Draft events are not live and cannot be viewed.":"This event is live and available for purchase."),s(5),u("status",i.isHiddenFromCalendar?"warning":"success")("text",i.isHiddenFromCalendar?"Hidden":"Available")("dots",!0)("tooltipText",i.isHiddenFromCalendar?"This event is hidden from calendar views, and only accessible to through the ticket search page.":"This event is visible in calendar views."),s(4),K("",i.sold,"/",i.maxAvailable),s(4),h(!i.isRemoved&&i.sold===0?38:-1),s(),h(i.isRemoved?39:-1)}}function Qi(n,c){if(n&1){let i=k();e(0,` 40 `),o(1,"p-table",16),x("onLazyLoad",function(a){_(i);let l=d();return C(l.search(a))}),e(2,` 41 `),E(3,Mi,18,0,"ng-template",17),e(4,` 42 `),E(5,Oi,42,34,"ng-template",18),e(6,` 43 `),r(),e(7,` 44 `)}if(n&2){let i=d();s(),u("columns",i.ticketSaleService.columns)("value",i.searchResults)("lazy",!0)("paginator",!0)("alwaysShowPaginator",!1)("totalRecords",i.totalRecords)("rows",25)("loading",i.loading)}}function Wi(n,c){n&1&&(e(0,` 45 `),v(1,"span",31),e(2,` 46 Delete 47 `))}function $i(n,c){n&1&&e(0,` 48 Yes, Delete 49 `)}function Ui(n,c){if(n&1){let i=k();e(0,` 50 `),o(1,"app-dialog-footer"),e(2,` 51 `),P(3,27),e(4,` 52 `),o(5,"button",28),x("click",function(){_(i);let a=d();return C(a.showDeleteModal=!1)}),e(6,"No"),r(),e(7,` 53 `),F(),e(8,` 54 `),P(9,29),e(10,` 55 `),o(11,"button",30),x("click",function(){_(i);let a=d();return C(a.confirmDelete())}),e(12,` 56 `),f(13,Wi,3,0)(14,$i,1,0),r(),e(15,` 57 `),F(),e(16,` 58 `),r(),e(17,` 59 `)}if(n&2){let i=d();
59s(5),u("disabled",i.deleting),s(6),u("disabled",i.deleting),s(2),h(i.deleting?13:14)}}function ji(n,c){n&1&&(e(0,` 60 `),v(1,"span",31),e(2,` 61 Restoring 62 `))}function zi(n,c){n&1&&e(0,` 63 Yes, Restore 64 `)}function qi(n,c){if(n&1){let i=k();e(0,` 65 `),o(1,"app-dialog-footer"),e(2,` 66 `),P(3,27),e(4,` 67 `),o(5,"button",28),x("click",function(){_(i);let a=d();return C(a.showRestoreModal=!1)}),e(6,"No"),r(),e(7,` 68 `),F(),e(8,` 69 `),P(9,29),e(10,` 70 `),o(11,"button",30),x("click",function(){_(i);let a=d();return C(a.confirmRestore())}),e(12,` 71 `),f(13,ji,3,0)(14,zi,1,0),r(),e(15,` 72 `),F(),e(16,` 73 `),r(),e(17,` 74 `)}if(n&2){let i=d();s(5),u("disabled",i.restoring),s(6),u("disabled",i.restoring),s(2),h(i.restoring?13:14)}}var xi=(()=>{let c=class c{constructor(t,a,l,m){this.ticketSaleService=t,this.siteDataService=a,this.router=l,this.route=m,this.AriaLabels=We,this.totalRecords=0,this.loading=!0,this.showTable=!1,this.showDeleteModal=!1,this.showRestoreModal=!1,this.deleteTargetId=null,this.restoreTargetId=null,this.deleteMessage="Are you sure you want to delete this event? This action can be undone.",this.restoreMessage="Restore this removed event?",this.deleting=!1,this.restoring=!1}ngOnInit(){this.resetFilters(),this.siteDataService.hideSiteLoader(),this.run()}run(){this.ticketSaleService.filters.page=1,this.totalRecords=0,this.showTable?this.search():this.showTable=!0}search(t=null){let a=this.ticketSaleService.filters;t&&(t.sortField&&(a.orderBy=t.sortField+" "+(t.sortOrder===1?"ASC":"DESC")),t.rows&&(a.rows=t.rows),t.first!==void 0&&t.first!==null&&(a.page=Math.floor(t.first/a.rows)+1)),a.includeCount=this.totalRecords===0,this.loading=!0,this.ticketSaleService.searchTickets().subscribe({next:l=>{this.searchResults=l.results,a.includeCount&&(this.totalRecords=l.total),this.loading=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}resetFilters(){this.ticketSaleService.filters=new Ge("eventStart ASC"),this.ticketSaleService.filters.hasFutureEventsOnly=!0,this.ticketSaleService.filters.includeDraftTicketEvents=!0,this.ticketSaleService.filters.includeCount=!0}goToTicketCreation(){this.router.navigate(["./create"],{relativeTo:this.route})}openDeleteModal(t){this.deleteTargetId=t,this.showDeleteModal=!0}confirmDelete(){this.deleteTargetId&&(this.deleting=!0,this.ticketSaleService.removeTicketConfiguration(this.deleteTargetId).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Event removed successfully"),this.showDeleteModal=!1,this.deleteTargetId=null,this.deleting=!1,this.run()},error:()=>{this.deleting=!1,this.showDeleteModal=!1,this.deleteTargetId=null,this.siteDataService.showSiteErrorAlert("There was a problem removing the event.")}}))}openRestoreModal(t){this.restoreTargetId=t,this.showRestoreModal=!0}confirmRestore(){this.restoreTargetId&&(this.restoring=!0,this.ticketSaleService.restoreTicketConfiguration(this.restoreTargetId).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Event restored successfully"),this.showRestoreModal=!1,this.restoreTargetId=null,this.restoring=!1,this.run()},error:()=>{this.restoring=!1,this.showRestoreModal=!1,this.restoreTargetId=null,this.siteDataService.showSiteErrorAlert("There was a problem restoring the event.")}}))}};c.\u0275fac=function(a){return new(a||c)(S(V),S(M),S(pe),S(O))},c.\u0275cmp=R({type:c,selectors:[["ng-component"]],standalone:!1,decls:59,vars:13,consts:[["role","main",3,"keydown.enter"],["pageTitle","Tickets","primaryBtnText","New Ticketed Event",3,"primaryBtnAction"],[3,"adminFilterReset","adminFilterSearch","showLabels"],["primary",""],[1,"col"],["for","search"],[1,"input-icon-wrapper","input-icon-wrapper--icon-left","full-width"],[1,"far","fa-magnifying-glass"],["type","text","id","search","placeholder","Search",1,"full-width",3,"ngModelChange","ngModel"],[1,"col-auto","d-flex","align-items-center","mt-2"],["type","checkbox","id","futureEventsOnly",3,"ngModelChange","ngModel"],["for","futureEventsOnly",1,"mb-0","ml-2"],["advanced",""],[1,"table-responsive"],[3,"visibleChange","header","visible","modal"],["pTemplate","footer"],["sortField","eventStart",1,"table","table-striped","table-sm",3,"onLazyLoad","columns","value","lazy","paginator","alwaysShowPaginator","totalRecords","rows","loading"],["pTemplate","header"],["pTemplate","body"],[3,"pSortableColumn"],[3,"field"],[1,"text-decoration-none",3,"routerLink"],[3,"status","text","dots","tooltipText"],[1,"text-right"],[1,"btn","btn-sm",3,"click"],[1,"fa","fa-tras
74h"],[1,"fa","fa-undo"],["slot","secondary"],[1,"btn","btn-secondary",3,"click","disabled"],["slot","primary"],[1,"btn","btn-primary",3,"click","disabled"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"]],template:function(a,l){a&1&&(o(0,"main",0),x("keydown.enter",function(){return l.run()}),e(1,` 75 `),o(2,"app-admin-header",1),x("primaryBtnAction",function(){return l.goToTicketCreation()}),r(),e(3,` 76 `),o(4,"app-admin-filter",2),x("adminFilterReset",function(){return l.resetFilters()})("adminFilterSearch",function(){return l.run()}),e(5,` 77 `),P(6,3),e(7,` 78 `),o(8,"div",4),e(9,` 79 `),o(10,"label",5),e(11,"Event Name"),r(),e(12,` 80 `),o(13,"span",6),e(14,` 81 `),v(15,"i",7),e(16,` 82 `),o(17,"input",8),D("ngModelChange",function(p){return w(l.ticketSaleService.filters.eventName,p)||(l.ticketSaleService.filters.eventName=p),p}),r(),e(18,` 83 `),r(),e(19,` 84 `),r(),e(20,` 85 `),o(21,"div",9),e(22,` 86 `),o(23,"input",10),D("ngModelChange",function(p){return w(l.ticketSaleService.filters.hasFutureEventsOnly,p)||(l.ticketSaleService.filters.hasFutureEventsOnly=p),p}),r(),e(24,` 87 `),o(25,"label",11),e(26,"Show Only Future Events"),r(),e(27,` 88 `),r(),e(28,` 89 `),o(29,"div",9),e(30,` 90 `),o(31,"input",10),D("ngModelChange",function(p){return w(l.ticketSaleService.filters.showRemoved,p)||(l.ticketSaleService.filters.showRemoved=p),p}),r(),e(32,` 91 `),o(33,"label",11),e(34,"Show Removed Events"),r(),e(35,` 92 `),r(),e(36,` 93 `),F(),e(37,` 94 `),ge(38,12),e(39,` 95 `),r(),e(40,` 96 97 `),o(41,"section"),e(42,` 98 `),o(43,"div",13),e(44,` 99 `),f(45,Qi,8,8),r(),e(46,` 100 `),r(),e(47,` 101 102 `),o(48,"p-dialog",14),D("visibleChange",function(p){return w(l.showDeleteModal,p)||(l.showDeleteModal=p),p}),e(49),E(50,Ui,18,3,"ng-template",15),e(51,` 103 `),r(),e(52,` 104 105 `),o(53,"p-dialog",14),D("visibleChange",function(p){return w(l.showRestoreModal,p)||(l.showRestoreModal=p),p}),e(54),E(55,qi,18,3,"ng-template",15),e(56,` 106 `),r(),e(57,` 107`),r(),e(58,` 108`)),a&2&&(s(4),u("showLabels",!0),s(13),T("ngModel",l.ticketSaleService.filters.eventName),s(6),T("ngModel",l.ticketSaleService.filters.hasFutureEventsOnly),s(8),T("ngModel",l.ticketSaleService.filters.showRemoved),s(14),h(l.showTable?45:-1),s(3),u("header","Confirm Delete"),T("visible",l.showDeleteModal),u("modal",!0),s(),b(` 109 `,l.deleteMessage,` 110 `),s(4),u("header","Confirm Restore"),T("visible",l.showRestoreModal),u("modal",!0),s(),b(` 111 `,l.restoreMessage,` 112 `))},dependencies:[Be,Et,Se,ke,be,Ot,X,_e,He,ye,fe,Ue,je,z,me],encapsulation:2});let n=c;return n})();var dt=Pi(Fi());var Zi=["eventInfoForm"];function Gi(n,c){n&1&&(e(0,` 113 `),o(1,"div",4),e(2,` 114 `),o(3,"div",5),e(4,` 115 `),o(5,"span",6),e(6,"Loading..."),r(),e(7,` 116 `),r(),e(8,` 117 `),o(9,"p",7),e(10,"Updating event details\u2026 This may take a moment as we send email notifications to all ticket purchasers and generate updated PDF tickets."),r(),e(11,` 118 `),r(),e(12,` 119 `))}function Yi(n,c){n&1&&(e(0,` 120 `),o(1,"span"),e(2,"HT"),r(),e(3,` 121 `))}function Ji(n,c){n&1&&(e(0,` 122 `),o(1,"span"),e(2,"AT"),r(),e(3,` 123 `))}function Ki(n,c){n&1&&(e(0,` 124 `),o(1,"span"),e(2,"PT"),r(),e(3,` 125 `))}function Xi(n,c){n&1&&(e(0,` 126 `),o(1,"span"),e(2,"MT"),r(),e(3,` 127 `))}function en(n,c){n&1&&(e(0,` 128 `),o(1,"span"),e(2,"MT"),r(),e(3,` 129 `))}function tn(n,c){n&1&&(e(0,` 130 `),o(1,"span"),e(2,"CT"),r(),e(3,` 131 `))}function nn(n,c){n&1&&(e(0,` 132 `),o(1,"span"),e(2,"ET"),r(),e(3,` 133 `))}function an(n,c){n&1&&(e(0,` 134 `),o(1,"span"),e(2,"CT"),r(),e(3,` 135 `))}function on(n,c){if(n&1){let i=k();e(0,` 136 `),o(1,"div",27),e(2,` 137 `),o(3,"div",28),e(4,` 138 `),o(5,"div",29),e(6,"Add Location"),r(),e(7,` 139 `),o(8,"div",30),e(9,` 140 `),o(10,"app-practice-facility-form",31),x("saveComplete",function(a){_(i);let l=d(2);return C(l.addedNewPracticeFacility(a))})("cancelEvent",function(){_(i);let a=d(2);return C(a.showAddFacilityModal=!1)}),r(),e(11,` 141 `),r(),e(12,` 142 `),r(),e(13,` 143 `),r(),e(14,` 144 `)}if(n&2){let i=d(2);s(10),u("practiceFacilityEntity",i.practiceFacility)}}function rn(n,c){if(n&1&&(e(0,` 145 `),o(1,"div",32),e(2,` 146 `),o(3,"app-inline-alert",33),e(4,` 147 `),o(5,"p"),e(6),r(),e(7,` 148 `),r(),e(8,` 149 `),r(),e(9,` 150 `)),n&2){let i=d(2);s(6),b("There is an availability conflict at this ",i.locationType==null?null:i.locationType.toLowerCase()," for this date and time.")}}function ln(n,c){if(n&1){let i=k();e(0,` 151 `),o(1,"div",27),e(2,` 152 `),o(3,"div",28),e(4,` 153 `),o(5,"div",29),e(6),r(),e(7,` 154 `),o(8,"div",30),e(9,` 155 `),o(10,"app-facility-field-form",34),x("saveComplete",function(a){_(i);let l=d(2);return C(l.addedNewFacilityField(a))})("cancelEvent",function(){_(i);let a=d(2);return C(a.showAddFieldModal=!1)}),r(),e(11,` 156 `),r(),e(12,` 157 `),r(),e(13,` 158 `),r(),e(14,` 159 `)}if(n&2){let i=d(2);s(6),b("Add ",i.locationType),s(4),u("facilityFieldEntity",i.facilityField)}}function sn(n,c){if(n&1){let i=k();e(0,` 160 `),o(1,"app-dynamic-form",8,1),x("onSubmit",function(a){_(i);let l=d();return C(l.saveEventInfo(a))}),e(3,` 161 `),v(4,"app-dynamic-form-field",9),e(5,` 162 `),o(6,"div",10),e(7,` 163 `),o(8,"label"),e(9,"Starts"),r(),e(10,` 164 `),o(11,"div"),e(12,` 165 `),v(13,"app-dynamic-form-field",11),e(14,` 166 `),r(),e(15,` 167 `),o(16,"div",12),e(17,` 168 `),o(18,"app-dynamic-form-field",13),x("onChange",function(a){_(i);let l=d();return C(l.handleAllDayToggle(a))}),r(),e(19,` 169 `),r(),e(20,` 170 `),o(21,"div",14),e(22,` 171 `),o(23,"button",15),x("click",function(a){_(i);let l=vt(38);return C(l.toggle(a))}),e(24,` 172 `),v(25,"i",16),e(26,` 173 `),f(27,Yi,4,0)(28,Ji,4,0)(29,Ki,4,0)(30,Xi,4,0)(31,en,4,0)(32,tn,4,0)(33,nn,4,0)(34,an,4,0),e(35,` 174 `),r(),e(36,` 175 `),v(37,"p-menu",17,2),e(39,` 176 `),r(),e(40,` 177 `),r(),e(41,` 178 `),o(42,"div",18),e(43,` 179 `),o(44,"label"),e(45,"Ends"),r(),e(46,` 180 `),o(47,"div"),e(48,` 181 `),v(49,"app-dynamic-form-field",19),e(50,` 182 `),r(),e(51,` 183 `),o(52,"div",20),e(53,"\xA0"),r(),e(54,` 184 `),o(55,"div",21),e(56,"\xA0"),r(),e(57,` 185 `),r(),e(58,`
186 `),o(59,"app-dynamic-form-field",22),x("onChange",function(a){_(i);let l=d();return C(l.onFacilityChange(a))})("onAddOption",function(){_(i);let a=d();return C(a.showAddFacilityModal=!0)}),e(60,` 187 `),P(61,23),e(62,` 188 `),f(63,on,15,1),F(),e(64,` 189 `),r(),e(65,` 190 `),o(66,"app-dynamic-form-field",24),x("onChange",function(a){_(i);let l=d();return C(l.onFieldChange(a))})("onAddOption",function(){_(i);let a=d();return C(a.showAddFieldModal=!0)}),e(67,` 191 `),P(68,23),e(69,` 192 `),f(70,rn,10,1),f(71,ln,15,2),F(),e(72,` 193 `),r(),e(73,` 194 `),v(74,"app-dynamic-form-field",25),e(75,` 195 `),v(76,"app-dynamic-form-field",26),e(77,` 196 `),r(),e(78,` 197 `)}if(n&2){let i,t=d();s(),u("fields",t.fields)("entity",t.entity)("horizontalForm",!0)("contentFieldsMode",!0)("showSaveAndAddButton",!1)("showSubmitButton",t.mode==="edit"&&!t.saving)("showCancelButton",!1)("viewOnly",t.viewOnly||t.saving),s(12),u("showTime",!t.allDayEvent)("hideLabel",!0),s(10),u("disabled",t.viewOnly||t.saving),s(4),h((i=t.entity==null?null:t.entity.timeZoneID)===1?27:i===2?28:i===3?29:i===4?30:i===5?31:i===6?32:i===7?33:34),s(10),u("model",t.timeZones)("popup",!0),s(12),u("showTime",!t.allDayEvent)("hideLabel",!0),s(10),u("enableFilter",!0),s(4),h(t.showAddFacilityModal?63:-1),s(3),u("enableFilter",!0),s(4),h(t.showConflict?70:-1),s(),h(t.showAddFieldModal?71:-1)}}function cn(n,c){n&1&&(e(0,` 198 `),v(1,"app-skeleton-template",35),e(2,` 199 `))}var Te=(()=>{let c=class c{validateDateRange(){if(!this.eventInfoForm?.form)return!0;let t=this.eventInfoForm.form.get("startDate"),a=this.eventInfoForm.form.get("endDate");if(!t?.value||!a?.value)return!0;let l=new Date(t.value),m=new Date(a.value);return this.dateRangeValid=m>=l,this.dateRangeValid}get isFormValid(){return this.eventInfoForm?this.eventInfoForm.isValid&&this.validateDateRange():!1}constructor(t,a,l,m,p,g,A){this.formService=t,this.ticketService=a,this.sharedClubService=l,this.clubService=m,this.practiceFacilityService=p,this.clubCalendarService=g,this.siteDataService=A,this.loading=!1,this.saving=!1,this.mode="edit",this.save=new it,this.next=new it,this.showAddFacilityModal=!1,this.showAddFieldModal=!1,this.showConflict=!1,this.practiceFacility=new ot,this.facilityField=new rt,this.timeZones=[{label:"(UTC-10:00) Hawaii",command:()=>this.onTimezoneSelect(1)},{label:"(UTC-09:00) Alaska",command:()=>this.onTimezoneSelect(2)},{label:"(UTC-08:00) Pacific Time (US & Canada)",command:()=>this.onTimezoneSelect(3)},{label:"(UTC-07:00) Arizona",command:()=>this.onTimezoneSelect(4)},{label:"(UTC-07:00) Mountain Time (US & Canada)",command:()=>this.onTimezoneSelect(5)},{label:"(UTC-06:00) Central Time (US & Canada)",command:()=>this.onTimezoneSelect(6)},{label:"(UTC-05:00) Eastern Time (US & Canada)",command:()=>this.onTimezoneSelect(7)}],this.viewOnly=!1,this.dateRangeValid=!0}ngOnInit(){this.loading=!0,j({metaData:this.ticketService.getTicketEventInfoMetaData(),sport:this.sharedClubService.getFieldName(),club:this.clubService.getClub()}).subscribe(({metaData:t,sport:a,club:l})=>{let m={label:"Add Location",value:-1,icon:"fa fa-plus",isAddOption:!0};if(t.eventInfoMetaData.fields.find(p=>p.controlName==="locationID").options.unshift(m),t.eventInfoMetaData.fields.find(p=>p.controlName==="startDate").minDate=new Date,t.eventInfoMetaData.fields.find(p=>p.controlName==="endDate").minDate=new Date,this.fields=t.eventInfoMetaData.fields,this.locationType=a.fieldName,this.mode==="create"){let p=new Date;this.entity=new di,this.entity.timeZoneID=l.timeZoneID,this.entity.startDate=p,this.entity.endDate=new Date(p.getTime()+3600*1e3)}else this.entity&&(this.handleAllDayToggle(this.entity.isAllDayEvent),this.entity.timeZoneID||(this.entity.timeZoneID=l.timeZoneID),this.onFacilityChange(this.entity.locationID),this.entity=L({},this.entity));this.viewOnly=!1,setTimeout(()=>{if(this.eventInfoForm&&this.eventInfoForm.form){let p=this.entity.startDate instanceof Date?this.entity.startDate:new Date(this.entity.startDate),g=this.entity.endDate instanceof Date?this.entity.endDate:new Date(this.entity.endDate);this.eventInfoForm.form.patchValue({startDate:p,endDate:g,timeZoneID:this.entity.timeZoneID}),this.ensureTimeZoneInForm();let A=this.eventInfoForm.form.get("startDate"),N=this.eventInfoForm.form.get("endDate");A&&A.valueChanges.subscribe(oe=>{if(oe){let tt=oe instanceof Date?oe:new Date(oe);
199if(!this.entity.endDate||this.entity.endDate&&this.entity.endDate<=tt){let mt=new Date(tt.getTime()+36e5);this.eventInfoForm.form.patchValue({endDate:mt}),this.entity.endDate=mt}this.entity.startDate=tt}this.validateDateRange(),this.dateRangeValid?this.formService.clearFormErrorMessage():this.formService.showFormErrorMessage("End date must be after start date")}),N&&N.valueChanges.subscribe(oe=>{oe&&(this.entity.endDate=oe instanceof Date?oe:new Date(oe)),this.validateDateRange(),this.dateRangeValid?this.formService.clearFormErrorMessage():this.formService.showFormErrorMessage("End date must be after start date")})}},0),this.loading=!1,this.siteDataService.hideSiteLoader()})}triggerNext(){this.onNext()}saveEventInfo(t){this.save.emit(t)}handleAllDayToggle(t){if(this.allDayEvent=t,t)this.fields.forEach(a=>{(a.controlName==="endDate"||a.controlName==="startDate")&&(a.showTime=!1),(a.controlName==="showTime"||a.controlName==="showTimeTBD"||a.controlName==="timeZoneID")&&(a.hidden=!0,a.required=!1,a.validators=a.validators.filter(l=>l.validatorType!==Y.REQUIRED))}),this.eventInfoForm?.form&&this.entity?.timeZoneID&&this.ensureTimeZoneInForm();else{let a=this.fields.find(N=>N.controlName==="endDate");a.showTime=!0;let l=this.fields.find(N=>N.controlName==="startDate");l.showTime=!0;let m=this.fields.find(N=>N.controlName==="showTime");m&&(m.hidden=!1);let p=this.fields.find(N=>N.controlName==="showTimeTBD");p&&(p.hidden=!1);let g=this.fields.find(N=>N.controlName==="timeZoneID");g&&(g.required=!0,g.hidden=!1,g.validators.push({validatorType:Y.REQUIRED}));let A=this.fields.find(N=>N.controlName==="arrival");A&&(A.showTime=!0),this.eventInfoForm?.form&&this.entity?.timeZoneID&&this.ensureTimeZoneInForm()}}onNext(){console.log("this.eventInfoForm",this.eventInfoForm),this.formService.clearFormErrorMessage(),this.ensureTimeZoneInForm(),this.eventInfoForm&&this.isFormValid?this.next.emit(this.eventInfoForm.validFieldsValue):this.dateRangeValid?this.formService.showFormErrorMessage("Complete the form before proceeding"):this.formService.showFormErrorMessage("End date must be after start date")}onTimezoneSelect(t){if(this.entity&&(this.entity.timeZoneID=t),this.eventInfoForm?.form){this.eventInfoForm.form.patchValue({timeZoneID:t});let a=this.eventInfoForm.form.get("timeZoneID");a&&(a.markAsDirty(),a.updateValueAndValidity())}}onFacilityChange(t){if(t)this.facilityField.practiceFacilityID=t,this.setFacilityFields(t);else{let a=this.fields.find(l=>l.controlName==="facilityFieldIDs");a&&(a.options=null,a.disabled=!0),this.entity&&(this.entity.facilityFieldIDs=[],this.entity.facilityFieldID=null,this.entity.locationID=null),this.showConflict=!1}}setFacilityFields(t){this.practiceFacilityService.getPracticeFacilityMember(t).subscribe({next:a=>{this.facilityField.practiceFacilityID=t;let l=this.fields.find(m=>m.controlName==="facilityFieldIDs");if(l){l.options=a.facilityFields.map(p=>({label:p.fieldName,value:p.facilityFieldID}));let m={label:"Add "+this.locationType,value:-1,icon:"fa fa-plus",isAddOption:!0};l.options.unshift(m),l.disabled=!1}},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem fetching the facilities")}})}onFieldChange(t){this.entity&&this.entity.startDate&&this.entity.endDate&&t?.length>0?this.clubCalendarService.checkForFieldConflict(this.entity.startDate,this.entity.endDate,t).subscribe(a=>{this.showConflict=a}):this.showConflict=!1}addedNewPracticeFacility(t){if(!t.choseExistingFacility){let a=this.fields.find(l=>l.controlName==="locationID");a&&a.options.push({label:t.practiceFacility.name,value:t.practiceFacility.id})}if(this.entity&&(this.entity.locationID=t.practiceFacility.id),this.eventInfoForm?.form){this.eventInfoForm.form.patchValue({locationID:t.practiceFacility.id});let a=this.eventInfoForm.form.get("locationID");a&&(a.markAsDirty(),a.markAsTouched())}this.practiceFacility=new ot,this.onFacilityChange(t.practiceFacility.id),this.showAddFacilityModal=!1}addedNewFacilityField(t){if(!t.choseExistingField){let a=this.fields.find(l=>l.controlName==="facilityFieldIDs");a&&a.options.push({label:t.facilityField.fieldName,value:t.facilityField.facilityFieldID})}if(this.entity){let a=this.entity.facilityFieldIDs||[];this.entity.facilityFieldIDs=[...a,t.facilityField.facilityFieldID],this.entity.facilityFieldID=this.entity.facilityFieldIDs[0]}if(this.eventInfoForm?.form){this.eventInfoForm.form.patchValue({facilityFieldIDs:this.entity.facilityFieldIDs});let a=this.eventInfoForm.form.get("facilityFieldIDs");a&&(a.markAsDirty(),a.markAsTouched())}this.facilityField=new rt,this.facilityField.practiceFacilityID=this.entity.locationID,this.showAddFieldModal=!1}ensureTimeZoneInForm(){if(this.eventInfoForm?.form&&this.entity?.timeZoneID&&this.eventInfoForm.form.get("timeZoneID")?.value!==this.entity.timeZoneID){this.eventInfoForm.form.patchValue({timeZoneID:this.entity.timeZoneID});let a=this.eventInfoForm.form.get("timeZoneID");a&&(a.markAsDirty(),a.markAsTouched())}}};c.\u0275fac=function(a){return new(a||c)(S(ie),S(V),S(At),S(Gt),S(Kt),S(Ut),S(M))},c.\u0275cmp=R({type:c,selectors:[["app-event-info-form"]],viewQuery:function(a,l){if(a&1&&J(Zi,5),a&2){let m;Q(m=W())&&(l.eventInfoForm=m.first)}},inputs:{entity:"entity",loading:"loading",saving:"saving",mode:"mode",fields:"fields"},outputs:{save:"save",next:"next"},standalone:!1,decls:10,vars:2,consts:[["skeleton",""],["eventInfoForm",""],["t
199imeZoneMenu",""],[1,"event-info-wrapper","calendar-form-icon-wrapper"],[1,"text-center","mb-4"],["role","status",1,"spinner-border","text-primary","mb-2"],[1,"sr-only"],[1,"text-muted"],[3,"onSubmit","fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton","showSubmitButton","showCancelButton","viewOnly"],["fieldName","title"],[1,"d-flex","align-items-center","start-time-wrapper"],["fieldName","startDate",3,"showTime","hideLabel"],[1,"px-2","start-time-wrapper--all-day-button"],["fieldName","isAllDayEvent",3,"onChange"],[1,"pt-2","start-time-wrapper--zone-button"],["type","button","role","button",1,"btn","btn-naked",3,"click","disabled"],[1,"fa","fa-globe"],["appendTo","body",3,"model","popup"],[1,"end-time-wrapper","d-flex","align-items-center"],["fieldName","endDate",3,"showTime","hideLabel"],[1,"start-time-wrapper--all-day-button"],[1,"start-time-wrapper--zone-button"],["fieldName","locationID",3,"onChange","onAddOption","enableFilter"],["afterInputContent",""],["fieldName","facilityFieldIDs",3,"onChange","onAddOption","enableFilter"],["fieldName","isDraft"],["fieldName","isHidden"],[1,"sprocket-dialog"],[1,"sprocket-dialog-inner"],[1,"sprocket-dialog-header"],[1,"sprocket-dialog-content"],[3,"saveComplete","cancelEvent","practiceFacilityEntity"],[1,"pt-3"],["alertType","warning"],[3,"saveComplete","cancelEvent","facilityFieldEntity"],["skeletonType","form"]],template:function(a,l){a&1&&(o(0,"div",3),e(1,` 200 `),e(2,` 201 `),f(3,Gi,13,0),f(4,sn,79,21),E(5,cn,3,0,"ng-template",null,0,de),e(7,` 202 `),e(8,` 203`),r(),e(9,` 204`)),a&2&&(s(3),h(l.saving?3:-1),s(),h(!l.loading&&l.fields?4:-1))},dependencies:[ne,he,Ee,ee,$e,Xt,ei],encapsulation:2});let n=c;return n})();var pn=["eventPageForm"],fn=["advancedOptionsForm"],hn=["fileUploadField"],_n=["ticketPriceForms"],Cn=["ticketQuestionForms"],xn=(n,c)=>i=>!i.hidden;function gn(n,c){n&1&&(e(0,` 205 `),v(1,"app-skeleton-template",32),e(2,` 206 `))}function vn(n,c){if(n&1){let i=k();e(0,` 207 `),o(1,"button",47),x("click",function(){_(i);let a=d(2).$index,l=d();return C(l.removeTicketLine(a))}),e(2,` 208 `),v(3,"i",48),e(4,` 209 `),r(),e(5,` 210 `)}}function Sn(n,c){if(n&1&&(e(0,` 211 `),o(1,"app-dynamic-form",39,2),e(3,` 212 `),o(4,"div",40),e(5,` 213 `),o(6,"div",41),e(7,` 214 `),v(8,"app-dynamic-form-field",42),e(9,` 215 `),r(),e(10,` 216 `),o(11,"div",36),e(12,` 217 `),v(13,"app-dynamic-form-field",43),e(14,` 218 `),r(),e(15,` 219 `),o(16,"div",37),e(17,` 220 `),v(18,"app-dynamic-form-field",44),e(19,` 221 `),r(),e(20,` 222 `),o(21,"div",37),e(22,` 223 `),v(23,"app-dynamic-form-field",45),e(24,` 224 `),r(),e(25,` 225 `),o(26,"div",46),e(27,` 226 `),f(28,vn,6,0),r(),e(29,` 227 `),r(),e(30,` 228 `),r(),e(31,` 229 `)),n&2){let i=d().$index,t=d();s(),u("formID","item-form-"+i)("entity",t.ticketSaleConfiguration.ticketPriceCategories[i])("fields",t.ticketOptions[i])("showSubmitButton",!1)("showCancelButton",!1)("horizontalForm",!1)("contentFieldsMode",!0)("enableSavingOverlay",!1),s(7),u("hideLabel",!0)("formID","item-form-"+i),s(5),u("formID","item-form-"+i)("hideLabel",!0),s(5),u("formID","item-form-"+i)("hideLabel",!0),s(5),u("formID","item-form-"+i)("hideLabel",!0),s(5),h((t.ticketSaleConfiguration.ticketPriceCategories==null?null:t.ticketSaleConfiguration.ticketPriceCategories.length)>1?28:-1)}}function kn(n,c){if(n&1&&(e(0,` 230 `),o(1,"div",33),e(2,` 231 `),o(3,"div",34),e(4,` 232 `),o(5,"div",35),e(6,"Ticket Label / Pricing Category"),r(),e(7,` 233 `),o(8,"div",36),e(9,"Price"),r(),e(10,` 234 `),o(11,"div",37),e(12,"Purchase Limit"),r(),e(13,` 235 `),o(14,"div",37),e(15,"Available Tickets"),r(),e(16,` 236 `),v(17,"div",38),e(18,` 237 `),r(),e(19,` 238 `),f(20,Sn,32,17),r(),e(21,` 239 `)),n&2){let i=c.$implicit;s(20),h(i?20:-1)}}function bn(n,c){if(n&1){let i=k();e(0,` 240 `),o(1,"app-dynamic-form",52,3),e(3,`
241 `),o(4,"div",40),e(5,` 242 `),o(6,"div",53),e(7,` 243 `),v(8,"app-dynamic-form-field",54),e(9,` 244 `),r(),e(10,` 245 `),o(11,"div",46),e(12,` 246 `),o(13,"button",47),x("click",function(){_(i);let a=d().$index,l=d();return C(l.removeQuestionLine(a))}),e(14,` 247 `),v(15,"i",48),e(16,` 248 `),r(),e(17,` 249 `),r(),e(18,` 250 `),r(),e(19,` 251 `),r(),e(20,` 252 `)}if(n&2){let i=d().$index,t=d();s(),u("formID","question-form-"+i)("fields",t.questionOptions[i])("showSubmitButton",!1)("showCancelButton",!1)("entity",t.ticketSaleConfiguration.ticketSaleConfigurationQuestions[i])("contentFieldsMode",!0)("horizontalForm",!1)("enableSavingOverlay",!1),s(7),u("hideLabel",!0)("formID","question-form-"+i)}}function yn(n,c){if(n&1&&(e(0,` 253 `),o(1,"div",49),e(2,` 254 `),o(3,"div",50),e(4,` 255 `),o(5,"div",51),e(6,"Form Label"),r(),e(7,` 256 `),v(8,"div",38),e(9,` 257 `),r(),e(10,` 258 `),f(11,bn,21,10),r(),e(12,` 259 `)),n&2){let i=c.$implicit;s(11),h(i?11:-1)}}function En(n,c){if(n&1){let i=k();e(0,` 260 `),o(1,"section",15),e(2,` 261 `),v(3,"hr",55),e(4,` 262 `),o(5,"h4"),e(6,"Advanced Options"),r(),e(7,` 263 `),o(8,"app-dynamic-form",56,4),e(10,` 264 `),o(11,"app-dynamic-form-field",57),x("onChange",function(a){_(i);let l=d();return C(l.onChangeClubAccountingClass(a))}),r(),e(12,` 265 `),v(13,"app-dynamic-form-field",58),e(14,` 266 `),r(),e(15,` 267 `),r(),e(16,` 268 `)}if(n&2){let i=d();s(8),u("fields",i.ticketPricingAdvancedConfigurationMetaData)("entity",i.ticketSaleConfiguration.ticketPricingAdvancedOptions)("horizontalForm",!0)("showSubmitButton",!1)("showCancelButton",!1)("enableSavingOverlay",!1)("contentFieldsMode",!0)}}function Tn(n,c){if(n&1){let i=k();e(0,` 269 `),o(1,"app-dynamic-form",59,5),e(3,` 270 `),o(4,"div",60),e(5,` 271 `),o(6,"app-dynamic-form-field",61,6),x("onChange",function(a){_(i);let l=d();return C(l.bannerFile=a?a.target.files[0]:void 0)}),e(8,` 272 `),r(),e(9,` 273 `),r(),e(10,` 274 `),o(11,"h1",62),e(12),r(),e(13,` 275 `),v(14,"app-dynamic-form-field",63),e(15,` 276 `),r(),e(16,` 277 `)}if(n&2){let i=d();s(),u("fields",i.ticketSalePageMetaData)("entity",i.ticketSalePage)("horizontalForm",!1)("contentFieldsMode",!0)("showSaveAndAddButton",!1)("showSubmitButton",!1)("showCancelButton",!1),s(5),u("acceptType",i.acceptedTypes)("acceptedFileExtensions",i.acceptedFileExtensions)("hideLabel",!0)("showFileUploadImagePreview",!0),s(6),b(` 278 `,i.ticketSaleConfiguration==null||i.ticketSaleConfiguration.ticketClubCalendarEvent==null?null:i.ticketSaleConfiguration.ticketClubCalendarEvent.title,` 279 `),s(2),u("hideLabel",!0)}}function wn(n,c){if(n&1&&(e(0),I(1,"date")),n&2){let i=d(2);b(` 280 `,U(1,1,i.ticketSaleConfiguration==null||i.ticketSaleConfiguration.ticketClubCalendarEvent==null?null:i.ticketSaleConfiguration.ticketClubCalendarEvent.startDate,"fullDate"),` 281 `)}}function Dn(n,c){if(n&1&&(e(0,` 282 `),o(1,"span"),e(2),I(3,"date"),r(),e(4,` 283 `)),n&2){let i=d(3);s(2),b("- ",$(3,1,i.ticketSaleConfiguration==null||i.ticketSaleConfiguration.ticketClubCalendarEvent==null?null:i.ticketSaleConfiguration.ticketClubCalendarEvent.endDate))}}function In(n,c){if(n&1&&(e(0),I(1,"date"),f(2,Dn,5,3)),n&2){let i=d(2);b(` 284 `,$(1,2,i.ticketSaleConfiguration==null||i.ticketSaleConfiguration.ticketClubCalendarEvent==null?null:i.ticketSaleConfiguration.ticketClubCalendarEvent.startDate),` 285 `),s(2),h(!(i.ticketSaleConfiguration==null||i.ticketSaleConfiguration.ticketClubCalendarEvent==null)&&i.ticketSaleConfiguration.ticketClubCalendarEvent.endD
285ate?2:-1)}}function Pn(n,c){if(n&1&&(e(0,` 286 `),o(1,"div",21),e(2,` 287 `),o(3,"div",22),e(4,` 288 `),o(5,"span",23),e(6,"When"),r(),e(7,` 289 `),r(),e(8,` 290 `),o(9,"div",64),e(10,` 291 `),f(11,wn,2,4)(12,In,3,4),r(),e(13,` 292 `),r(),e(14,` 293 `)),n&2){let i=d();s(11),h(!(i.ticketSaleConfiguration==null||i.ticketSaleConfiguration.ticketClubCalendarEvent==null)&&i.ticketSaleConfiguration.ticketClubCalendarEvent.isAllDayEvent?11:12)}}function Fn(n,c){if(n&1&&(e(0,` 294 `),o(1,"span"),e(2),r(),e(3,` 295 `)),n&2){let i=d();s(2),b(", ",i)}}function An(n,c){n&1&&(e(0,` 296 `),o(1,"span"),e(2,` 297 `),f(3,Fn,4,1),r(),e(4,` 298 `)),n&2&&(s(3),h(c?3:-1))}function Vn(n,c){if(n&1&&(e(0,` 299 `),o(1,"div",21),e(2,` 300 `),o(3,"div",22),e(4,` 301 `),o(5,"span",23),e(6,"Where"),r(),e(7,` 302 `),r(),e(8,` 303 `),o(9,"div",64),e(10),f(11,An,5,1),I(12,"facilityFieldNames"),r(),e(13,` 304 `),r(),e(14,` 305 `)),n&2){let i,t=d();s(10),b(` 306 `,t.ticketSaleConfiguration==null||t.ticketSaleConfiguration.ticketClubCalendarEvent==null||t.ticketSaleConfiguration.ticketClubCalendarEvent.location==null?null:t.ticketSaleConfiguration.ticketClubCalendarEvent.location.name,` 307 `),s(),h((i=U(12,2,t.ticketSaleConfiguration==null||t.ticketSaleConfiguration.ticketClubCalendarEvent==null?null:t.ticketSaleConfiguration.ticketClubCalendarEvent.facilityFields,t.ticketSaleConfiguration==null||t.ticketSaleConfiguration.ticketClubCalendarEvent==null?null:t.ticketSaleConfiguration.ticketClubCalendarEvent.facilityField))?11:-1,i)}}function Rn(n,c){n&1&&(e(0,` 308 `),o(1,"span",65),e(2,";"),r(),e(3,` 309 `))}function Mn(n,c){if(n&1&&(e(0),I(1,"currency"),f(2,Rn,4,0)),n&2){let i=c.$implicit,t=c.$index,a=c.$count;K(` 310 `,i.categoryName,": ",$(1,3,i.basePrice),` 311 `),s(2),h(t!==a-1?2:-1)}}function Ln(n,c){if(n&1){let i=k();e(0,` 312 `),o(1,"button",66),x("click",function(){_(i);let a=d();return C(a.previous())}),e(2,` 313 Previous 314 `),r(),e(3,` 315 `)}if(n&2){let i=d();s(),we("btn-disabled",i.submitting||i.loading),u("disabled",i.submitting||i.loading)}}function Nn(n,c){n&1&&(e(0,` 316 `),v(1,"app-button-loader"),e(2,` 317 Saving... 318 `))}function Bn(n,c){n&1&&e(0,` 319 Save 320 `)}function On(n,c){if(n&1){let i=k();e(0,` 321 `),o(1,"button",67),x("click",function(){_(i);let a=d();return C(a.save())}),e(2,` 322 `),f(3,Nn,3,0),f(4,Bn,1,0),r(),e(5,` 323 `)}if(n&2){let i=d();s(),we("btn-disabled",i.submitting||i.loading),u("disabled",i.submitting||i.loading),s(2),h(i.submitting?3:-1),s(),h(i.submitting?-1:4)}}function Qn(n,c){if(n&1){let i=k();e(0,` 324 `),o(1,"button",68),x("click",function(){_(i);let a=d();return C(a.next())}),e(2,` 325 `),P(3),e(4,"Next"),F(),e(5,` 326 `),r(),e(6,` 327 `)}if(n&2){let i=d();s(),we("btn-disabled",i.isNextButtonDisabled),u("disabled",i.isNextButtonDisabled)}}function Wn(n,c){if(n&1){let i=k();e(0,` 328`),o(1,"app-yes-no-modal",69),x("onYesSelect",function(){_(i);let a=d();return C(a.handleDeactivateResponse(!0))})("onNoSelect",function(){_(i);let a=d();return C(a.handleDeactivateResponse(!1))}),e(2,` 329 `),o(3,"div",70),e(4,` 330 `),o(5,"app-inline-alert",71),e(6,` 331 This Ticket Event has not been created yet. By leaving this page, all your changes will be lost. Are you 332 sure you want to proceed? 333 `),r(),e(7,` 334 `),r(),e(8,` 335`),r(),e(9,` 336`)}n&2&&(s(),u("showModalText",!1),s(4),u("isInline",!0))}var Si=(()=>{let c=class c{constructor(t,a,l,m,p,g,A,N){this.siteDataService=t,this.formService=a,this.authorizeService=l,this.router=m,this.route=p,this.cd=g,this.ticketService=A,this.programService=N,this.Permission=pi,this.ticketPriceForms=new nt,this.ticketQuestionForms=new nt,this.steps=[{id:Ye.BASIC_INFO.toString(),label:"Event Info"},{id:Ye.DATES.toString(),label:"Ticket Options"},{id:Ye.RECIPIENTS.toString(),label:"Event Page"}],this.Steps=ve,this.onLastStep=!1,this.activeIndex=0,this.currentStep=ve.EVENT_INFO,this.loading=!0,this.ticketSaleConfiguration=new ri,this.questionOptions=[],this.ticketOptions=[],this.submitting=!1,this.endTimeOptions=[],this.acceptedFileExtensions=Oe,this.acceptedTypes=Qe,this.showCanDeactivate=!1,this.surchargesOptionEnabled=!1,this.pendingNavigation=null,this.unsubscribe$=new se}ngOnInit(){this.authorizeService.getUser().pipe(ht(1)).subscribe(t=>{this.user=t}),j({metaData:this.ticketService.getTicketEventInfoMetaData(),accountingClasses:this.programService.getClubAccountingClasses(),clubOptions:this.siteDataService.getClubOptions([re.ENABLE_SURCHARGES])}).pipe(B(this.unsubscribe$)).subscribe({next:({metaData:t,accountingClasses:a,clubOptions:l})=>{this.eventInfoMetaData=t.eventInfoMetaData.fields,this.configurationMetaData=t.ticketSaleConfigurationMetaData.fields,this.questionMetaData=t.questionMetaData.fields,this.ticketOptionMetaData=t.ticketOptionMetaData.fields,this.ticketSalePageMetaData=t.ticketSalePageConfiguration.fields,this.ticketPricingAdvancedConfigurationMetaData=t.ticketPricingAdvancedConfiguration.fields,this.clubAccountingClasses=a,this.surchargesOptionEnabled=l.find(m=>m.optionID===re.ENABLE_SURCHARGES)?.boolValue===!0,this.ticketSaleConfiguration.ticketPricingAdvancedOptions=new ci,this.updateSurchargeFieldValidation(this.ticketSaleConfiguration.ticketPricingAdvancedOptions.clubAccountingClassID),this.addTicketLine(),this.loading=!1,this.siteDataService.hide
336SiteLoader()}})}addTicketLine(){this.ticketOptions.push((0,dt.cloneDeep)(this.ticketOptionMetaData)),this.ticketSaleConfiguration.ticketPriceCategories.push(new si)}removeTicketLine(t){this.ticketSaleConfiguration.ticketPriceCategories.splice(t,1)}addQuestionLine(){this.questionOptions.push((0,dt.cloneDeep)(this.questionMetaData)),this.ticketSaleConfiguration.ticketSaleConfigurationQuestions.push(new li)}removeQuestionLine(t){this.ticketSaleConfiguration.ticketSaleConfigurationQuestions.splice(t,1)}previous(){console.log("going back,",this.activeIndex),this.activeIndex--,this.currentStep=+this.steps[this.activeIndex].id}next(){this.formService.clearFormErrorMessage(),this.validateCurrentStep()&&(this.activeIndex++,this.currentStep=+this.steps[this.activeIndex].id)}save(){this.submitting=!0,this.formService.clearFormErrorMessage(),this.validateCurrentStep()?this.fileUploadField.hasFileChanged&&this.bannerFile?this.ticketService.saveTicketConfiguration(this.ticketSaleConfiguration,this.bannerFile,this.bannerFile.name).pipe(B(this.unsubscribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Ticket Sale Configuration saved successfully"),this.router.navigate(["../"],{relativeTo:this.route}),this.submitting=!1},error:()=>{this.submitting=!1,this.siteDataService.showSiteErrorAlert("There was a problem saving the ticket sale configuration")}}):this.ticketService.saveTicketConfiguration(this.ticketSaleConfiguration).pipe(B(this.unsubscribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Ticket Sale Configuration saved successfully"),this.router.navigate(["../"],{relativeTo:this.route}),this.submitting=!1},error:()=>{this.submitting=!1,this.siteDataService.showSiteErrorAlert("There was a problem saving the ticket sale configuration")}}):(this.submitting=!1,this.formService.showFormErrorMessage("Complete missing fields before proceeding"))}validateCurrentStep(){switch(console.log("this.currentStep",this.currentStep),this.currentStep){case ve.EVENT_INFO:if(this.eventInfoForm&&this.eventInfoForm.eventInfoForm)if(this.eventInfoForm.isFormValid){let t=this.eventInfoForm.eventInfoForm.validFieldsValue,a=this.eventInfoForm.entity?.timeZoneID;return this.ticketSaleConfiguration.ticketClubCalendarEvent=L(L({},this.ticketSaleConfiguration.ticketClubCalendarEvent),t),a&&!t.timeZoneID&&(this.ticketSaleConfiguration.ticketClubCalendarEvent.timeZoneID=a),console.log("Final event data:",this.ticketSaleConfiguration.ticketClubCalendarEvent),!0}else return this.eventInfoForm.eventInfoForm.submitForm(),!1;else return!1;break;case ve.TICKET_OPTIONS:if(console.log("Ticket options step"),this.ticketPriceForms.some(t=>!t.isValid))return console.log("invalid ticket price form",this.ticketPriceForms.filter(t=>!t.isValid)),this.ticketPriceForms.filter(t=>!t.isValid).forEach(t=>t.submitForm()),!1;if(this.ticketPriceForms.forEach((t,a)=>{this.ticketSaleConfiguration.ticketPriceCategories[a]=L(L({},this.ticketSaleConfiguration.ticketPriceCategories[a]),t.validFieldsValue)}),this.ticketQuestionForms.some(t=>!t.isValid))return console.log("invalid ticket question form",this.ticketQuestionForms.filter(t=>!t.isValid)),this.ticketQuestionForms.filter(t=>!t.isValid).forEach(t=>t.submitForm()),!1;if(this.ticketQuestionForms.forEach((t,a)=>{this.ticketSaleConfiguration.ticketSaleConfigurationQuestions[a]=L(L({},this.ticketSaleConfiguration.ticketSaleConfigurationQuestions[a]),t.validFieldsValue)}),this.advancedOptionsForm){if(!this.advancedOptionsForm.isValid)return this.advancedOptionsForm.submitForm(),!1;this.ticketSaleConfiguration.ticketPricingAdvancedOptions=L(L({},this.ticketSaleConfiguration.ticketPricingAdvancedOptions),this.advancedOptionsForm.validFieldsValue)}return!0;case ve.EVENT_PAGE:return this.eventPageForm.isValid?(this.ticketSaleConfiguration=L(L({},this.ticketSaleConfiguration),this.eventPageForm.validFieldsValue),!0):(this.formService.showFormErrorMessage("Complete the form before proceeding"),!1);default:return!0}}get isNextButtonDisabled(){return this.submitting||this.loading?!0:this.currentStep===ve.EVENT_INFO?!this.eventInfoForm?.isFormValid:!1}hasUnsavedChanges(){return this.currentStep!==this.Steps.EVENT_PAGE||this.submitting}canDeactivate(){return this.hasUnsavedChanges()?(this.showCanDeactivate=!0,!1):!0}handleDeactivateResponse(t){t?(this.showCanDeactivate=!1,this.pendingNavigation&&(this.pendingNavigation(),this.pendingNavigation=null)):this.showCanDeactivate=!1}onEventInfoNext(t){this.ticketSaleConfiguration.ticketClubCalendarEvent=L(L({},this.ticketSaleConfiguration.ticketClubCalendarEvent),t),this.next()}onChangeClubAccountingClass(t){this.updateSurchargeFieldValidation(t)}updateSurchargeFieldValidation(t){let a=this.ticketPricingAdvancedConfigurationMetaData?.find(p=>p.controlName==="clubSurchargeID");if(!a)return;let l=!!t&&this.clubAccountingClasses?.some(p=>p.clubAccountingClassID===t&&p.assignments.some(g=>g.isSurchargeRequired)),m=this.surchargesOptionEnabled||l;if(a.hidden=!m,l){if(a.validators.some(p=>p.validatorType===Y.REQUIRED)===!1&&a.validators.push({validatorType:Y.REQUIRED}),a.required=!0,a.options?.length===1){let p=a.options[0].value;this.ticketSaleConfiguration.ticketPricingAdvancedOptions.clubSurchargeID=p,this.advancedOptionsForm?.form.patchValue({clubSurchargeID:p})}}else a.required=!1,a.validators=a.validators.filter(p=>p.validatorType!==Y.REQUIRED);m||(this.ticketSaleConfiguration.ticketPricingAdvancedOptions.clubSurchargeID=null,this.advancedOptionsForm?.form.patchValue({clubSurchargeID:null})),this.ticketPricingAdvancedConfigurationMetaData=[...this.ticketPricingAdvancedConfigurationMetaData]}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};c.\u0275fac=function(a){return new(a||c)(S(M),S(ie),S(Pt),S(pe),S(O),S(yt),S(V),S(Ze))},c.\u0275cmp=R({type:c,selectors:[["app-ticket-event-create"]],viewQuery:function(a,l){if(a&1&&J(Te,5)(pn,5)(fn,5)(hn,5)(_n,5)(Cn,5),a&2){let m;Q(m=W())&&(l.eventInfoForm=m.first),Q(m=W())&&(l.eventPageForm=m.first),Q(m=W())&&(l.advancedOptionsForm=m.first),Q(m=W())&&(l.fileUploadField=m.f
336irst),Q(m=W())&&(l.ticketPriceForms=m),Q(m=W())&&(l.ticketQuestionForms=m)}},standalone:!1,decls:114,vars:24,consts:[["eventInfoForm",""],["skeleton",""],["ticketPriceForms",""],["ticketQuestionForms",""],["advancedOptionsForm",""],["eventPageForm",""],["fileUploadField",""],["role","main"],[3,"pageTitle","parentLinkUrl","parentLinkText","showBackButton"],[1,"row","mb-5","mt-5"],[1,"col-md-12"],[3,"model","readonly","activeIndex"],[1,"program-content","mb-3"],[3,"hidden"],["mode","create",3,"fields","entity","loading"],[1,"mb-3","col-md-9","px-0"],["type","button",1,"btn-a11y","btn-icon-plus","text-primary-link","text-medium","mb-2",3,"click"],[1,"full-height","full-width","bg-secondary","p-4"],[1,"container"],[1,"card","full-width"],[1,"mt-4"],[1,"row","my-2"],[1,"col-md-3"],[1,"small-label"],[1,"col-md-9"],[1,"d-flex","fw-600"],[1,"mt-5"],["disabled","",1,"btn","btn-primary","btn-icon-ticket"],["appStickyFormButtons","",1,"row","border-top","no-gutters","d-flex","align-items-center"],[1,"col-md-3","d-flex","justify-content-start"],["type","button","routerLink","../",1,"btn","btn-lg","btn-naked",3,"click"],[1,"col-md-9","d-flex","justify-content-end"],["skeletonType","form"],[1,"items-section","bg-secondary","p-2","mb-2"],[1,"row","fw-800","text-small","my-2"],[1,"col-4"],[1,"col-3"],[1,"col-2"],[1,"col-1"],[3,"formID","entity","fields","showSubmitButton","showCancelButton","horizontalForm","contentFieldsMode","enableSavingOverlay"],[1,"row","item-row"],[1,"col-4","no-wrap"],["fieldName","categoryName",3,"hideLabel","formID"],["fieldName","basePrice","styleClass","mb-0",3,"formID","hideLabel"],["fieldName","purchaseLimit","styleClass","mb-0",3,"formID","hideLabel"],["fieldName","maxAvailableTickets","styleClass","mb-0",3,"formID","hideLabel"],[1,"col-1","right"],["type","button",1,"btn","btn-tertiary","pull-right",3,"click"],[1,"fa","fal","fa-trash-alt"],[1,"items-section","bg-secondary","p-2","my-2"],[1,"row","fw-800","text-small","mb-2"],[1,"col-11"],[3,"formID","fields","showSubmitButton","showCancelButton","entity","contentFieldsMode","horizontalForm","enableSavingOverlay"],[1,"col-11","no-wrap"],["fieldName","label",3,"hideLabel","formID"],[1,"my-4"],[3,"fields","entity","horizontalForm","showSubmitButton","showCancelButton","enableSavingOverlay","contentFieldsMode"],["fieldName","clubAccountingClassID",3,"onChange"],["fieldName","clubSurchargeID"],[3,"fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton","showSubmitButton","showCancelButton"],[1,"border-blue","border-all","border-dashed","d-flex","justify-content-center","align-items-center","mb-3","border-radius-xl","p-3","event-pg-banner-preview"],["fieldName","bannerImage",3,"onChange","acceptType","acceptedFileExtensions","hideLabel","showFileUploadImagePreview"],[1,"text-h2","mb-4"],["fieldName","details",3,"hideLabel"],[1,"col-md-9","fw-600"],[1,"mr-2"],["type","button",1,"btn","btn-lg","btn-icon-chevron-left",3,"click","disabled"],["type","button",1,"btn","btn-lg",3,"click","disabled"],["type","button",1,"btn","btn-lg","btn-primary","btn-icon-chevron-right-after",3,"click","disabled"],["headerText","Are you sure you want to leave this page?","dialogClass","standardWidthDialog","yesButtonText","Yes","noButtonText","No, Cancel",3,"onYesSelect","onNoSelect","showModalText"],[1,"text-medium","fw-600"],["alertType","warning",3,"isInline"]],template:function(a,l){a&1&&(o(0,"main",7),e(1,` 337 `),v(2,"app-admin-header",8),e(3,` 338 339 `),o(4,"div",9),e(5,` 340 `),o(6,"div",10),e(7,` 341 `),v(8,"p-steps",11),e(9,` 342 `),r(),e(10,` 343 `),r(),e(11,` 344 `),o(12,"div",12),e(13,` 345 `),e(14,` 346 `),o(15,"div",13),e(16,` 347 `),v(17,"app-event-info-form",14,0),e(19,` 348 `),E(20,gn,3,0,"ng-template",null,1,de),e(22,` 349 `),r(),e(23,` 350 351 `),e(24,` 352 `),o(25,"div",13),e(26,` 353 `),o(27,"section",15),e(28,` 354 `),o(29,"h4"),e(30,"Ticket Pricing"),r(),e(31,` 355 `),Z(32,kn,22,1,null,null,H),o(34,"button",16),x("click",function(){return l.addTicketLine()}),e(35,"Add Ticket Pricing Option"),r(),e(36,` 356 `),r(),e(37,` 357 `),o(38,"section",15),e(39,` 358 `),o(40,"h4"),e(41,"Purchase Options"),r(),e(42,` 359 `),Z(43,yn,13,1,null,null,H),o(45,"button",16),x("click",function(){return l.addQuestionLine()}),e(46,"Add Purchase Question/Option"),r(),e(47,` 360 `),r(),e(48,` 361 362 `),f(49,En,17,7),r(),e(50,` 363 364 `),e(51,` 365 `),o(52,"div",13),e(53,` 366 `),o(54,"div",17),e(55,` 367 `),o(56,"div",18),e(57,` 368 `),o(58,"div",19),e(59,` 369 `),f(60,Tn,17,13),o(61,"div",20),e(62,` 370 `),f(63,Pn,15,1),f(64,Vn,15,5),o(65,"div",21),e(66,` 371 `),o(67,"div",22),e(68,` 372 `),o(69,"span",23),e(70,"Cost"),r(),e(71,` 373 `),r(),e(72,` 374 `),o(73,"div",24),e(74,` 375 `),o(75,"div",25),e(76,`
376 `),Z(77,Mn,3,5,null,null,H),r(),e(79,` 377 `),r(),e(80,` 378 `),r(),e(81,` 379 `),o(82,"div",26),e(83,` 380 `),o(84,"button",27),e(85,` 381 `),o(86,"span"),e(87,"Purchase Tickets"),r(),e(88,` 382 `),r(),e(89,` 383 `),r(),e(90,` 384 `),r(),e(91,` 385 `),r(),e(92,` 386 `),r(),e(93,` 387 `),r(),e(94,` 388 `),r(),e(95,` 389 `),r(),e(96,` 390 391 `),o(97,"div",28),e(98,` 392 `),o(99,"div",29),e(100,` 393 `),o(101,"a",30),x("click",function(p){return l.submitting||l.loading?p.preventDefault():""}),e(102,"Cancel"),r(),e(103,` 394 `),r(),e(104,` 395 `),o(105,"div",31),e(106,` 396 `),f(107,Ln,4,3),f(108,On,6,5),f(109,Qn,7,3),r(),e(110,` 397 `),r(),e(111,` 398`),r(),e(112,` 399 400`),f(113,Wn,10,2)),a&2&&(s(2),u("pageTitle","New Ticketed Event")("parentLinkUrl","../")("parentLinkText","Tickets")("showBackButton",!0),s(6),u("model",l.steps)("readonly",!0)("activeIndex",l.activeIndex),s(7),u("hidden",l.currentStep!==l.Steps.EVENT_INFO),s(2),u("fields",l.eventInfoMetaData)("entity",l.ticketSaleConfiguration.ticketClubCalendarEvent)("loading",l.loading),s(8),u("hidden",l.currentStep!==l.Steps.TICKET_OPTIONS),s(7),G(l.ticketSaleConfiguration.ticketPriceCategories),s(11),G(l.ticketSaleConfiguration.ticketSaleConfigurationQuestions),s(6),h(l.ticketPricingAdvancedConfigurationMetaData!=null&&l.ticketPricingAdvancedConfigurationMetaData.some(Re(23,xn,l))?49:-1),s(3),u("hidden",l.currentStep!==l.Steps.EVENT_PAGE),s(8),h(l.ticketSalePageMetaData?60:-1),s(3),h(!(l.ticketSaleConfiguration==null||l.ticketSaleConfiguration.ticketClubCalendarEvent==null)&&l.ticketSaleConfiguration.ticketClubCalendarEvent.startDate?63:-1),s(),h(!(l.ticketSaleConfiguration==null||l.ticketSaleConfiguration.ticketClubCalendarEvent==null)&&l.ticketSaleConfiguration.ticketClubCalendarEvent.location?64:-1),s(13),G(l.ticketSaleConfiguration.ticketPriceCategories),s(24),we("btn-disabled",l.submitting||l.loading),s(6),h(l.currentStep!==l.Steps.EVENT_INFO?107:-1),s(),h(l.currentStep===l.Steps.EVENT_PAGE?108:-1),s(),h(l.currentStep!==l.Steps.EVENT_PAGE?109:-1),s(4),h(l.showCanDeactivate?113:-1))},dependencies:[ne,he,be,Ee,ee,_e,ze,zt,$t,qt,Te,ue,me,qe],styles:[`.event-pg-banner-preview .file-upload-layout>.align-left{display:none}.event-pg-banner-preview .file-preview-image-wrapper{width:100%;text-align:center}.event-pg-banner-preview .file-preview-image-wrapper .file-preview-image{max-width:unset} 401`],encapsulation:2});let n=c;return n})();var $n=(n,c)=>({success:n,error:c});function Un(n,c){n&1&&(e(0,` 402 `),o(1,"div",3),e(2,` 403 Validating ticket, please wait... 404 `),r(),e(3,` 405 `))}function jn(n,c){if(n&1&&(e(0,` 406 `),o(1,"div",4),e(2,` 407 `),o(3,"p"),e(4),r(),e(5,` 408 `),r(),e(6,` 409 `)),n&2){let i=d();s(),u("ngClass",bt(2,$n,i.isSuccess,!i.isSuccess)),s(3),y(i.validationMessage)}}var ki=(()=>{let c=class c{constructor(t,a,l){this.route=t,this.ticketService=a,this.siteDataService=l,this.validationMessage="",this.isSuccess=null,this.isLoading=!1}ngOnInit(){let t=this.route.snapshot.paramMap.get("ticketId");t?this.validateTicket(t):(this.validationMessage="Invalid ticket ID.",this.isSuccess=!1,this.siteDataService.hideSiteLoader())}validateTicket(t){this.isLoading=!0,this.ticketService.validateTicket(t).subscribe({next:a=>{this.validationMessage=a.message,this.isSuccess=!0,this.isLoading=!1,this.siteDataService.hideSiteLoader()},error:a=>{this.validationMessage=a.error?.message||"An error occurred while validating the ticket.",this.isSuccess=!1,this.isLoading=!1,this.siteDataService.hideSiteLoader()}})}};c.\u0275fac=function(a){return new(a||c)(S(O),S(V),S(M))},c.\u0275cmp=R({type:c,selectors:[["app-ticket-validation"]],standalone:!1,decls:9,vars:3,consts:[["role","main"],["pageTitle","Ticket Validation","parentLinkUrl","../","parentLinkText","Tickets",3,"showBackButton"],[1,"ticket-validation"],[1,"loading"],[3,"ngClass"]],template:function(a,l){a&1&&(o(0,"main",0),e(1,` 410 `),v(2,"app-admin-header",1),e(3,` 411 `),o(4,"div",2),e(5,` 412 `),f(6,Un,4,0),f(7,jn,7,5),r(),e(8,` 413`),r()),a&2&&(s(2),u("showBackButton",!0),s(4),h(l.isLoading?6:-1),s(),h(!l.isLoading&&l.
413isSuccess!==null?7:-1))},dependencies:[Le,_e],encapsulation:2});let n=c;return n})();var Fe=()=>({exact:!0});function zn(n,c){if(n&1){let i=k();e(0,` 414 `),o(1,"button",16),x("click",function(){_(i);let a=d(2);return C(a.showAIContentCreator=!0)}),e(2,` 415 `),v(3,"i",17),e(4,` AI Post 416 `),r(),e(5,` 417 `)}}function qn(n,c){if(n&1){let i=k();e(0,` 418 `),o(1,"button",13),x("click",function(){_(i);let a=d();return C(a.copyLink())}),e(2,` 419 Copy Link 420 `),r(),e(3,` 421 `),o(4,"button",14),x("click",function(){_(i);let a=d();return C(a.openPreviewModal())}),e(5,` 422 Preview 423 `),r(),e(6,` 424 `),o(7,"button",15),x("click",function(){_(i);let a=d();return C(a.export())}),e(8,"Download"),r(),e(9,` 425 `),f(10,zn,6,0)}if(n&2){let i=d();s(),u("disabled",!(i.ticketService.configuration==null||i.ticketService.configuration.ticketClubCalendarEvent==null)&&i.ticketService.configuration.ticketClubCalendarEvent.isDraft?!0:null),s(6),u("disabled",i.exporting),s(3),h(i.aiContentCreatorEnabled?10:-1)}}function Hn(n,c){n&1&&(e(0,` 426 `),o(1,"app-inline-alert",18),e(2,` 427 This event has already occured. This event is in view-only mode. You cannot make any changes to the event information. 428 `),r(),e(3,` 429 `))}function Zn(n,c){if(n&1&&(e(0,` 430 `),o(1,"app-ticket-sale-event-details",19),e(2,` 431 `),r(),e(3,` 432 `)),n&2){let i=d();s(),u("previewMode",!0)("ticketSaleConfiguration",i.ticketService.configuration)}}var bi=(()=>{let c=class c{constructor(t,a,l){this.route=t,this.ticketService=a,this.siteDataService=l,this.unsubscribe$=new se,this.isLoading=!1,this.showModal=!1,this.exporting=!1,this.viewOnly=!1,this.showAIContentCreator=!1,this.aiContentCreatorEnabled=!1,this.AIContentContextType=Yt}ngOnInit(){this.ticketSaleConfigurationId=+this.route.snapshot.paramMap.get("ticketSaleConfigurationId"),this.siteDataService.getClubOptions([re.ENABLE_AI_CONTENT_CREATOR]).pipe(B(this.unsubscribe$)).subscribe(t=>this.aiContentCreatorEnabled=t?.find(a=>a.optionID===re.ENABLE_AI_CONTENT_CREATOR)?.boolValue===!0),this.ticketService.getTicketSaleConfiguration(this.ticketSaleConfigurationId).subscribe({next:t=>{this.ticketService.updateConfiguration(t),this.viewOnly=this.ticketService.isEventViewOnly(t),this.isLoading=!1}}),this.ticketService.configuration$.pipe(B(this.unsubscribe$)).subscribe({next:t=>{t&&(this.viewOnly=this.ticketService.isEventViewOnly(t))}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}openPreviewModal(){this.showModal=!0}copyLink(){let t=`${window.location.origin}/tickets/${this.ticketSaleConfigurationId}`;navigator.clipboard.writeText(t).then(()=>{console.log("Link copied to clipboard")}).catch(a=>{console.error("Could not copy link: ",a)})}export(){this.exporting=!0,this.ticketService.exportTickets(this.ticketSaleConfigurationId).subscribe({next:t=>{Dt(t),this.exporting=!1},error:()=>{this.exporting=!1,this.siteDataService.showSiteErrorAlert("There was a problem exporting.")}})}};c.\u0275fac=function(a){return new(a||c)(S(O),S(V),S(M))},c.\u0275cmp=R({type:c,selectors:[["app-manage-ticket-sale"]],standalone:!1,decls:54,vars:23,consts:[["customButtonContent",""],["role","main"],["parentLinkText","Tickets",3,"parentLinkUrl","pageTitle","showBackButton"],[1,"tabs"],["role","tablist",1,"tab-nav","no-bullets","inline-list"],["routerLinkActive","active",1,"nav-item",3,"routerLinkActiveOptions"],["routerLink",".","role","tab","aria-controls","home","aria-selected","true",1,"nav-link"],["routerLink","settings","role","tab","aria-controls","settings","aria-selected","true",1,"nav-link"],["routerLink","event-pricing","role","tab","aria-controls","event-pricing","aria-selected","true",1,"nav-link"],["routerLink","event-questions","role","tab","aria-controls","event-questions","aria-selected","true",1,"nav-link"],["routerLink","event-page","role","tab","aria-controls","event-page","aria-selected","true",1,"nav-link"],["header","Sale Preview","styleClass","standardWidthDialog",3,"visibleChange","visible","showHeader","closable","modal","draggable"],[3,"visibleChange","visible","contextType","contextID"],[1,"btn","btn-secondary","mb-3","mr-3",3,"click","disabled"],[1,"btn","btn-primary","mb-3",3,"click"],[1,"btn","btn-primary","mb-3",3,"click","disabled"],["type","button",1,"btn","btn-primary","mb-3","ml-2",3,"click"],[1,"fa-duotone","fa-sparkles"],["alertType","warning"],[3,"previewMode","ticketSaleConfiguration"]],template:function(a,l){if(a&1){let m=k();o(0,"main",1),e(1,` 433 `),o(2,"app-admin-header",2),e(3,` 434 `),E(4,qn,11,3,"ng-template",null,0,de),e(6,` 435 `),r(),e(7,` 436 `),o(8,"div",3),e(9,` 437 `),o(10,"ul",4),e(11,` 438 `),o(12,"li",5),e(13,` 439 `),o(14,"a",6),e(15,` 440 Purchases 441 `),r(),e(16,` 442 `),r(),e(17,` 443 `),o(18,"li",5),e(19,` 444 `),o(20,"a",7),e(21,` 445 Settings 446 `),r(),e(22,` 447 `),r(),e(23,` 448 `),o(24,"li",5),e(25,` 449 `),o(26,"a",8),e(27,` 450 Event Pricing 451 `),r(),e(28,` 452 `),r(),e(29,` 453 `),o(30,"li",5),e(31,` 454 `),o(32,"a",9),e(33,` 455 Event Questions 456 `),r(),e(34,` 457 `),r(),e(35,` 458 `),o(36,"li",5),e(37,` 459 `),o(38,"a",10),e(39,` 460 Event Page 461 `),r(),e(40,` 462 `),r(),e(41,` 463 `),r(),e(42,` 464 `),r(),e(43,` 465 `),f(44,Hn,4,0),v(45,"router-outlet"),e(46,` 466 467 468`),r(),e(47,` 469 470`),o(48,"p-dialog",11),D("visibleChange",function(g){return _(m),w(l.showModal,g)||(l.showModal=g),C(g)}),e(49,` 471 `),f(50,Zn,4,2),r(),e(51,` 472 473`),o(52,"app-ai-content-creator-dialog",12),D("visibleChange",function(g){return _(m),w(l.showAIContentCreator,g)||(l.showAIContentCreator=g),C(g)}),e(53,` 474`),r()}a&2&&(s(2),u("parentLinkUrl","/admin/tickets")("pageTitle",(l.ticketService.configuration==null||l.ticketService.configuration.ticketClubCalendarEvent==null?null:l.ticketService.configuration.ticketClubCalendarEvent.title)||"Manage")("showBackButton",!0),s(10),u("routerLinkActiveOptions",ce(18,Fe)),s(6),u("routerLinkActiveOptions",ce(19,Fe)),s(6),u("routerLinkActiveOptions",ce(20,Fe)),s(6),u("routerLinkActiveOptions",ce(21,Fe)),s(6),u("routerLinkActiveOptions",ce(22,Fe)),s(8),h(l.viewOnly?44:-1),s(4),T("visible",l.showModal),u("showHeader",!0)("closable",!0)("modal",!0)("draggable",!1),s(2),h(l.isLoading?-1:50),s(2),T("visible",l.showAIContentCreator),u("contextType",l.AIContentContextType.Ticket)("contextID",l.ticketSaleConfigurationId))},dependencies:[Tt,be,wt,ee,_e,z,mi,Jt],encapsulation:2});let n=c;return n})();var Gn=["optionsMenu"],Yn=()=>({width:"auto"}),Jn=n=>({"mb-2":n});function Kn(n,c){n&1&&(e(0,` 475 `),o(1,"span"),e(2,"Tickets Sold"),r(),e(3,` 476 `))}function Xn(n,c){n&1&&(e(0,` 477 `),o(1,"span"),e(2,"Sold Out!"),r(),e(3,` 478 `))}function ea(n,c){if(n&1&&(e(0,` 479 `),o(1,"div",32),e(2),r(),e(3,` 480 `)),n&2){let i=d(2);s(2),y(i.dashboardSummary.daysUntil)}}function ta(n,c){n&1&&(e(0,` 481 `),o(1,"div",33),e(2,"Event Ended"),r(),e(3,` 482 `))}function ia(n,c){if(n&1&&(e(0,` 483 `),o(1,"section"),e(2,` 484 `),o(3,"div",21),e(4,` 485 `),o(5,"div",22),e(6,` 486 `),o(7,"div",23),e(8,` 487 `),o(9,"div",24),e(10,` 488 `),o(11,"label",25),e(12,` 489 `),o(13,"strong"),e(14),r(),e(15,` 490 `),f(16,Kn,4,0),f(17,Xn,4,0),r(),e(18,`
491 `),v(19,"p-progressBar",26),e(20,` 492 `),r(),e(21,` 493 `),r(),e(22,` 494 `),o(23,"div",27),e(24,` 495 `),o(25,"div",28),e(26,` 496 `),f(27,ea,4,1),o(28,"label",29),e(29,"Days Until Event"),r(),e(30,` 497 `),f(31,ta,4,0),r(),e(32,` 498 `),r(),e(33,` 499 `),o(34,"div",5),e(35,` 500 `),o(36,"div",30),e(37,` 501 `),o(38,"div",31),e(39),I(40,"currency"),r(),e(41,` 502 `),o(42,"label",25),e(43,"Total Revenue"),r(),e(44,` 503 `),r(),e(45,` 504 `),r(),e(46,` 505 `),r(),e(47,` 506 `),r(),e(48,` 507 `),r(),e(49,` 508 `)),n&2){let i=d();s(14),K("",i.dashboardSummary.sold," / ",i.dashboardSummary.maxAvailable),s(2),h(i.dashboardSummary.remaining>0?16:-1),s(),h(i.dashboardSummary.remaining===0?17:-1),s(2),u("value",i.dashboardSummary.maxAvailable?i.dashboardSummary.sold/i.dashboardSummary.maxAvailable*100:0)("showValue",!1),s(8),h(i.dashboardSummary.eventPassed?-1:27),s(4),h(i.dashboardSummary.eventPassed?31:-1),s(8),y($(40,9,i.dashboardSummary.revenue))}}function na(n,c){if(n&1&&(e(0,` 509 `),o(1,"th",39),e(2),v(3,"p-sortIcon",40),e(4,` 510 `),r(),e(5,` 511 `)),n&2){let i=c.$implicit,t=d(3);s(),u("pSortableColumn",i.field),xe("aria-label",t.AriaLabels.ACTIVATE_SORT),s(),b(` 512 `,i.header,` 513 `),s(),u("field",i.field)}}function aa(n,c){if(n&1){let i=k();e(0,` 514 `),o(1,"tr"),e(2,` 515 `),o(3,"th",37),e(4,` 516 `),o(5,"input",38),x("change",function(){_(i);let a=d(2);return C(a.toggleSelectAll())}),r(),e(6,` 517 `),r(),e(7,` 518 `),Z(8,na,6,4,null,null,H),v(10,"th"),e(11,` 519 `),v(12,"th"),e(13,` 520 `),r(),e(14,` 521 `)}if(n&2){let i=d(2);s(5),u("checked",i.allSelected),xe("aria-label","Select all purchases"),s(3),G(i.ticketSaleService.purchaseColumns)}}function oa(n,c){if(n&1&&e(0),n&2){let i=d(2).$implicit;b(` 522 by `,i.cancelledBy,` 523 `)}}function ra(n,c){if(n&1&&(e(0),I(1,"utcDate")),n&2){let i=d(2).$implicit;b(` 524 on `,U(1,1,i.cancelledOn,"MM/dd/y"),` 525 `)}}function la(n,c){if(n&1&&(e(0,` 526 `),o(1,"div",45),e(2,` 527 `),o(3,"div",46),e(4,` 528 `),o(5,"strong"),e(6,"Cancelled"),r(),e(7,` 529 `),f(8,oa,1,1),f(9,ra,2,4),r(),e(10,` 530 `),r(),e(11,` 531 `)),n&2){let i=d().$implicit;s(),u("ngClass",Me(3,Jn,i.refundTransaction)),s(7),h(i.cancelledBy?8:-1),s(),h(i.cancelledOn?9:-1)}}function sa(n,c){if(n&1&&e(0),n&2){let i=d(2).$implicit;b(` 532 by `,i.refundTransaction.refundedBy,` 533 `)}}function ca(n,c){if(n&1&&(e(0),I(1,"utcDate")),n&2){let i=d(2).$implicit;b(` 534 on `,U(1,1,i.refundTransaction.refundedOn,"MM/dd/y"),` 535 `)}}function da(n,c){if(n&1&&(e(0,` 536 `),o(1,"div",47),e(2,` 537 `),o(3,"div",46),e(4,` 538 `),o(5,"strong"),e(6,"Refunded"),r(),e(7,` 539 `),f(8,sa,1,1),f(9,ca,2,4),r(),e(10,` 540 `),r(),e(11,` 541 `)),n&2){let i=d().$implicit;s(8),h(i.refundTransaction.refundedBy?8:-1),s(),h(i.refundTransaction.refundedOn?9:-1)}}function ma(n,c){if(n&1){let i=k();e(0,` 542 `),o(1,"button",48),x("click",function(a){_(i);let l=d().$implicit,m=d(2);return C(m.toggleOptionsMenu(l,a))}),e(2,` 543 `),v(3,"i",49),e(4,` 544 `),o(5,"span",44),e(6,"Options"),r(),e(7,` 545 `),r(),e(8,` 546 `)}}function ua(n,c){if(n&1){let i=k();e(0,` 547 `),o(1,"tr"),e(2,` 548 `),o(3,"td"),e(4,` 549 `),o(5,"input",38),x("change",function(){let a=_(i).$implicit,l=d(2);return C(l.togglePurchaseSelection(a.ticketSaleID))}),r(),e(6,` 550 `),r(),e(7,` 551 `),o(8,"td"),e(9),r(),e(10,` 552 `),o(11,"td"),e(12),r(),e(13,` 553 `),o(14,"td"),e(15,` 554 `),o(16,"a",41),e(17),r(),e(18,` 555 `),r(),e(19,` 556 `),o(20,"td"),e(21),r(),e(22,` 557 `),o(23,"td"),e(24),I(25,"currency"),r(),e(26,` 558 `),o(27,"td"),e(28),r(),e(29,` 559 `),o(30,"td"),e(31),I(32,"date"),r(),e(33,` 560 `),o(34,"td"),e(35,` 561 `),f(36,la,12,5),f(37,da,12,2),r(),e(38,` 562 `),o(39,"td"),e(40,` 563 `),f(41,ma,9,0),o(42,"button",42),e(43,` 564 `),v(44,"i",43),e(45,` 565 `),o(46,"span",44),e(47,"Expand"),r(),e(48,` 566 `),r(),e(49,` 567 `),r(),e(50,` 568 `),r(),e(51,` 569 `)}if(n&2){let i=c.$implicit,t=c.expanded,a=d(2);s(5),u("checked",a.isPurchaseSelected(i.ticketSaleID)),xe("aria-label","Select purchase for "+i.firstName+" "+i.lastName),s(4),y(i.lastName),s(3),y(i.firstName),s(4),u("href","mailto:"+i.email,gt),s(),y(i.email),s(4),K("",i.verifiedTicketCount,"/",i.ticketCount," Checked In"),s(3),y($(25,16,i.totalPurchaseCost)),s(4),y(i.purchaseConfirmationNumber),s(3),y($(32,18,i.purchasedDate)),s(5),h(i.isCancelled?36:-1),s(),h(i.refundTransaction?37:-1),s(4),h(!i.isCancelled||!i.refundTransaction&&i.totalPurchaseCost>0?41:-1),s(),u("pRowToggler",i),s(2),u("ngClass",t?"fa-rotate-180":"")}}function pa(n,c){n&1&&(e(0,` 570 `),o(1,"tr"),e(2,` 571 `),o(3,"th"),e(4,"Ticket Ref #"),r(),e(5,` 572 `),o(6,"th"),e(7,"Category"),r(),e(8,` 573 `),o(9,"th"),e(10,"Price"),r(),e(11,` 574 `),o(12,"th"),e(13,"Status"),r(),e(14,` 575 `),o(15,"th"),e(16,"Checked-In By"),r(),e(17,` 576 `),o(18,"th"),e(19,"Checked-In On"),r(),e(20,` 577 `),r(),e(21,` 578 `))}function fa(n,c){n&1&&(e(0,` 579 `),v(1,"span",54),e(2,` 580 `))}function ha(n,c){if(n&1){let i=k();e(0,` 581 `),v(1,"app-pill",52),e(2,` 582 `),o(3,"button",53),x("click",function(){_(i);let a=d().$implicit,l=d().$implicit,m=d(2);return C(m.unvalidateTicket(a.ticketID,l))}),e(4,` 583 `),f(5,fa,3,0),e(6),r(),e(7,` 584 `)}if(n&2){let i=d().$implicit,t=d(3);s(),u("text",i.isValidated?"Checked In":"Active")("status",i.isValidated?"success":"default"),s(2),u("disabled",t.unvalidatingTicketId||!t.isRedemptionEnabled()),s(2),h(t.unvalidatingTicketId===i.ticketID?5:-1),s(),b(` 585 `,t.unvalidatingTicketId===i.ticketID?"":"Undo Check-In",` 586 `)}}function _a(n,c){n&1&&(e(0,` 587 `),v(1,"span",54),e(2,` 588 `))}function Ca(n,c){if(n&1){let i=k();e(0,` 589 `),o(1,"button",55),x("click",function(){_(i);let a=d().$implicit,l=d().$implicit,m=d(2);return C(m.validateTicket(a.ticketID,l))}),e(2,` 590 `),f(3,_a,3,0),e(4),r(),e(5,` 591 `)}if(n&2){let i=d().$implicit,t=d().$implicit,a=d(2);s(),u("disabled",t.isCancelled||i.isValidated||a.validatingTicketId||!a.isRedemptionEnabled()),s(2),h(a.validatingTicketId===i.ticketID?3:-1),s(),b(` 592 `,t.isCancelled?"Cancelled":"Check-In",` 593 `)}}function xa(n,c){if(n&1&&(e(0,` 594 `),o(1,"tr"),e(2,` 595 `),o(3,"td"),e(4),r(),e(5,` 596 `),o(6,"td"),e(7),r(),e(8,` 597 `),o(9,"td"),e(10),I(11,"currency"),r(),e(12,` 598 `),o(13,"td"),e(14,` 599 `),f(15,ha,8,5)(16,Ca,6,3),r(),e(17,` 600 `),o(18,"td"),e(19),r(),e(20,` 601 `),o(21,"td"),e(22),I(23,"date"),r(),e(24,` 602 `),r(),e(25,` 603 `)),n&2){let i=c.$implicit;s(4),y(i.ticketID),s(3),y(i.categoryName),s(3),y($(11,7,i.basePrice)),s(5),h(i.isValidated?15:16),s(4),K("",i.validatedByFirstName," ",i.validatedByLastName),s(3),y($(23,9,i.validationDate))}}function ga(n,c){if(n&1&&(e(0,` 604 `),o(1,"tr"),e(2,` 605 `),e(3,`
606 `),o(4,"td",50),e(5,` 607 `),e(6,` 608 `),o(7,"p-table",51),e(8,` 609 `),E(9,pa,22,0,"ng-template",35),e(10,` 610 `),E(11,xa,26,11,"ng-template",36),e(12,` 611 `),r(),e(13,` 612 `),r(),e(14,` 613 `),r(),e(15,` 614 `)),n&2){let i=c.$implicit,t=d(2);s(4),xe("colspan",t.ticketSaleService.purchaseColumns.length+3),s(3),u("value",i.ticketExpansion)}}function va(n,c){if(n&1){let i=k();e(0,` 615 `),o(1,"p-table",34),x("onLazyLoad",function(a){_(i);let l=d();return C(l.search(a))}),e(2,` 616 `),E(3,aa,15,2,"ng-template",35),e(4,` 617 `),E(5,ua,52,20,"ng-template",36),e(6,` 618 `),E(7,ga,16,2,"ng-template",null,1,de),e(9,` 619 `),r(),e(10,` 620 `)}if(n&2){let i=d();s(),u("columns",i.ticketSaleService.purchaseColumns)("value",i.searchResults)("lazy",!0)("paginator",!0)("alwaysShowPaginator",!1)("totalRecords",i.totalRecords)("rows",i.ticketSaleService.filters.rows)("loading",i.loading)("dataKey","purchaseConfirmationNumber")("expandedRowKeys",i.expandedRows)}}function Sa(n,c){if(n&1&&(e(0,` 621 `),o(1,"app-inline-alert",59),e(2,` 622 `),o(3,"span",60),e(4),r(),e(5,` 623 `),r(),e(6,` 624 `)),n&2){let i=d(4);s(),u("alertType","note")("isInline",!0)("showIcon",!0),s(3),b(` 625 Cancellation will result in the cancellation of all tickets in this purchase. Should you choose 626 to issue a refund, the refund will apply to the entire amount 627 `,i.selectedPurchase.firstName+" "+i.selectedPurchase.lastName,` paid, including any fees. 628 `)}}function ka(n,c){n&1&&e(0,` 629 The order total was $0.00, so no refund can be issued. 630 `)}function ba(n,c){if(n&1&&(e(0),v(1,"br"),e(2,` 631 Please try again later. 632 `)),n&2){let i=d(5);b(` 633 This purchase cannot be refunded at this time: 634 `,i.refundMessage||"The payment is not in a refundable state (ie still processing, etc).",` 635 `)}}function ya(n,c){if(n&1&&(e(0,` 636 `),o(1,"app-inline-alert",59),e(2,` 637 `),o(3,"span",60),e(4,` 638 `),f(5,ka,1,0)(6,ba,3,1),r(),e(7,` 639 `),r(),e(8,` 640 `)),n&2){let i=d(4);s(),u("alertType","warning")("isInline",!0)("showIcon",!0),s(4),h(i.selectedPurchase.totalPurchaseCost===0?5:6)}}function Ea(n,c){if(n&1&&(e(0,` 641 `),o(1,"div",58),e(2,` 642 `),f(3,Sa,7,4),f(4,ya,9,4),r(),e(5,` 643 `)),n&2){let i=d(3);s(3),h(i.canRefund?3:-1),s(),h(i.canRefund?-1:4)}}function Ta(n,c){if(n&1&&e(0),n&2){let i=d(6);b(` 644 `,i.cancellationResult.refundErrorText,` 645 `)}}function wa(n,c){n&1&&e(0,` 646 The payment is not in a refundable state (ie still processing, etc). 647 `)}function Da(n,c){if(n&1&&(e(0,` 648 `),o(1,"app-inline-alert",59),e(2,` 649 `),o(3,"span",60),e(4,` 650 This purchase cannot be refunded at this time: 651 `),f(5,Ta,1,1),f(6,wa,1,0),e(7,` 652 Please try again later. 653 `),r(),e(8,` 654 `),r(),e(9,` 655 `)),n&2){let i=d(5);s(),u("alertType","error")("isInline",!0)("showIcon",!0),s(4),h(i.cancellationResult.refundErrorText?5:-1),s(),h(i.cancellationResult.refundErrorText?-1:6)}}function Ia(n,c){if(n&1&&(e(0,` 656 `),f(1,Da,10,5)),n&2){let i=d(4);s(),h(i.issueRefund&&!i.cancellationResult.refundSuccess?1:-1)}}function Pa(n,c){n&1&&(e(0,` 657 `),o(1,"app-inline-alert",59),e(2,` 658 `),o(3,"span",60),e(4,"Cannot cancel at this time"),r(),e(5,` 659 `),r(),e(6,` 660 `)),n&2&&(s(),u("alertType","error")("isInline",!0)("showIcon",!0))}function Fa(n,c){if(n&1&&(e(0,` 661 `),o(1,"div",58),e(2,` 662 `),f(3,Ia,2,1),f(4,Pa,7,3),r(),e(5,` 663 `)),n&2){let i=d(3);s(3),h(i.cancellationResult!=null&&i.cancellationResult.cancellationSuccess?3:-1),s(),h(i.
663cancellationResult.cancellationSuccess?-1:4)}}function Aa(n,c){if(n&1){let i=k();e(0,` 664 `),o(1,"div",57),e(2,` 665 `),o(3,"div",61),e(4,"Do you want to issue a refund?"),r(),e(5,` 666 `),r(),e(6,` 667 `),o(7,"app-checkbox-row",62),D("ngModelChange",function(a){_(i);let l=d(3);return w(l.issueRefund,a)||(l.issueRefund=a),C(a)}),e(8,` 668 `),r(),e(9,` 669 `),o(10,"app-checkbox-row",63),D("ngModelChange",function(a){_(i);let l=d(3);return w(l.issueRefund,a)||(l.issueRefund=a),C(a)}),e(11,` 670 `),r(),e(12,` 671 `)}if(n&2){let i=d(3);s(7),u("optionValue",!0),T("ngModel",i.issueRefund),u("disabled",!i.canRefund),s(3),u("optionValue",!1),T("ngModel",i.issueRefund)}}function Va(n,c){if(n&1&&(e(0,` 672 `),o(1,"div",56),e(2,` 673 `),o(3,"div",57),e(4,` 674 `),f(5,Ea,6,2),f(6,Fa,6,2),r(),e(7,` 675 `),f(8,Aa,13,5),r(),e(9,` 676 `)),n&2){let i=d(2);s(5),h(i.cancellationResult?-1:5),s(),h(i.cancellationResult?6:-1),s(2),h(i.cancellationResult?-1:8)}}function Ra(n,c){n&1&&(e(0,` 677 `),o(1,"div",56),e(2,` 678 `),o(3,"div"),e(4,"There are no purchases to cancel."),r(),e(5,` 679 `),r(),e(6,` 680 `))}function Ma(n,c){if(n&1&&(e(0,` 681 `),f(1,Va,10,3),f(2,Ra,7,0)),n&2){let i=d();s(),h(i.selectedPurchase?1:-1),s(),h(i.selectedPurchase?-1:2)}}function La(n,c){n&1&&(e(0,` 682 `),o(1,"div",47),e(2,` 683 `),o(3,"div",61),e(4,` 684 `),v(5,"app-skeleton-template"),e(6,` 685 `),r(),e(7,` 686 `),r(),e(8,` 687 `))}function Na(n,c){n&1&&(e(0,` 688 `),v(1,"app-button-loader"),e(2,` 689 `))}function Ba(n,c){if(n&1){let i=k();e(0,` 690 `),o(1,"app-dialog-footer"),e(2,` 691 `),P(3,64),e(4,` 692 693 `),o(5,"button",65),x("click",function(){_(i);let a=d(3);return C(a.cancelDialogVisible=!1)}),e(6,"Don't Cancel"),r(),e(7,` 694 695 `),F(),e(8,` 696 `),P(9,66),e(10,` 697 698 `),o(11,"button",67),x("click",function(){_(i);let a=d(3);return C(a.confirmCancelPurchase())}),e(12,` 699 `),f(13,Na,3,0),e(14),r(),e(15,` 700 701 `),F(),e(16,` 702 `),r(),e(17,` 703 `)}if(n&2){let i=d(3);s(5),u("disabled",i.loadingCancelDialog||i.cancelling),s(6),u("disabled",i.loadingCancelDialog||i.cancelling||i.cancellationResult&&(!i.cancellationResult.cancellationSuccess||i.issueRefund&&!i.cancellationResult.refundSuccess)),s(2),h(i.cancelling?13:-1),s(),b(` 704 `,i.cancelling?"Cancelling...":"Cancel Purchase",` 705 `)}}function Oa(n,c){if(n&1){let i=k();e(0,` 706 `),o(1,"app-dialog-footer"),e(2,` 707 `),P(3,64),e(4,` 708 709 `),o(5,"button",65),x("click",function(){_(i);let a=d(3);return C(a.cancelDialogVisible=!1)}),e(6,"Close"),r(),e(7,` 710 711 `),F(),e(8,` 712 `),ge(9,66),e(10,` 713 `),r(),e(11,` 714 `)}if(n&2){let i=d(3);s(5),u("disabled",i.loadingCancelDialog||i.cancelling)}}function Qa(n,c){if(n&1&&(e(0,` 715 `),f(1,Ba,18,4)(2,Oa,12,1)),n&2){let i=d(2);s(),h(!i.cancellationResult||!i.cancellationResult.cancellationSuccess?1:2)}}function Wa(n,c){if(n&1){let i=k();e(0,` 716 `),o(1,"app-dialog-footer"),e(2,` 717 `),P(3,64),e(4,` 718 `),o(5,"button",68),x("click",function(){_(i);let a=d(2);return C(a.cancelDialogVisible=!1)}),e(6,"Close"),r(),e(7,` 719 `),F(),e(8,` 720 `),ge(9,66),e(10,` 721 `),r(),e(11,` 722 `)}}function $a(n,c){if(n&1&&(e(0,` 723 `),f(1,Qa,3,1),f(2,Wa,12,0)),n&2){let i=d();s(),h(i.selectedPurchase?1:-1),s(),h(i.selectedPurchase?-1:2)}}function Ua(n,c){if(n&1&&(e(0,` 724 `),o(1,"app-inline-alert",59),e(2,` 725 `),o(3,"span",60),e(4),r(),e(5,` 726 `),r(),e(6,` 727 `)),n&2){let i=d(4);s(),u("alertType","note")("isInline",!0)("showIcon",!0),s(3),b(` 728 Should you choose to issue a refund, the refund will apply to the entire amount 729 `,i.selectedPurchase.firstName+" "+i.selectedPurchase.lastName,` paid, including any fees. 730 `)}}function ja(n,c){n&1&&e(0,` 731 The order total was $0.00, so no refund can be issued. 732 `)}function za(n,c){if(n&1&&(e(0),v(1,"br"),e(2,` 733 Please try again later. 734 `)),n&2){let i=d(5);b(` 735 This purchase cannot be refunded at this time: 736 `,i.refundMessage||"The payment is not in a refundable state (ie still processing, etc).",` 737 `)}}function qa(n,c){if(n&1&&(e(0,` 738 `),o(1,"app-inline-alert",59),e(2,` 739 `),o(3,"span",60),e(4,` 740 `),f(5,ja,1,0)(6,za,3,1),r(),e(7,` 741 `),r(),e(8,` 742 `)),n&2){let i=d(4);s(),u("alertType","warning")("isInline",!0)("showIcon",!0),s(4),h(i.selectedPurchase.totalPurchaseCost===0?5:6)}}function Ha(n,c){if(n&1&&(e(0,` 743 `),o(1,"div",58),e(2,` 744 `),f(3,Ua,7,4),f(4,qa,9,4),r(),e(5,` 745 `)),n&2){let i=d(3);
745s(3),h(i.canRefund?3:-1),s(),h(i.canRefund?-1:4)}}function Za(n,c){if(n&1&&e(0),n&2){let i=d(4);b(` 746 `,i.refundResult.refundErrorText,` 747 `)}}function Ga(n,c){n&1&&e(0,` 748 The payment is not in a refundable state (ie still processing, etc). 749 `)}function Ya(n,c){if(n&1&&(e(0,` 750 `),o(1,"div",58),e(2,` 751 `),o(3,"app-inline-alert",59),e(4,` 752 `),o(5,"span",60),e(6,` 753 This purchase cannot be refunded at this time: 754 `),f(7,Za,1,1),f(8,Ga,1,0),v(9,"br"),e(10,` 755 Please try again later. 756 `),r(),e(11,` 757 `),r(),e(12,` 758 `),r(),e(13,` 759 `)),n&2){let i=d(3);s(3),u("alertType","error")("isInline",!0)("showIcon",!0),s(4),h(i.refundResult.refundErrorText?7:-1),s(),h(i.refundResult.refundErrorText?-1:8)}}function Ja(n,c){if(n&1&&(e(0,` 760 `),o(1,"div",56),e(2,` 761 `),o(3,"div",57),e(4,` 762 `),f(5,Ha,6,2),f(6,Ya,14,5),r(),e(7,` 763 `),r(),e(8,` 764 `)),n&2){let i=d(2);s(5),h(!i.refundResult||i.refundResult!=null&&i.refundResult.refundSuccess?5:-1),s(),h(i.refundResult&&!i.refundResult.refundSuccess?6:-1)}}function Ka(n,c){n&1&&(e(0,` 765 `),o(1,"div",56),e(2,` 766 `),o(3,"div"),e(4,"There are no purchases to refund."),r(),e(5,` 767 `),r(),e(6,` 768 `))}function Xa(n,c){if(n&1&&(e(0,` 769 `),f(1,Ja,9,2),f(2,Ka,7,0)),n&2){let i=d();s(),h(i.selectedPurchase?1:-1),s(),h(i.selectedPurchase?-1:2)}}function eo(n,c){n&1&&(e(0,` 770 `),o(1,"div",47),e(2,` 771 `),o(3,"div",61),e(4,` 772 `),v(5,"app-skeleton-template"),e(6,` 773 `),r(),e(7,` 774 `),r(),e(8,` 775 `))}function to(n,c){n&1&&(e(0,` 776 `),v(1,"app-button-loader"),e(2,` 777 `))}function io(n,c){if(n&1){let i=k();e(0,` 778 `),o(1,"app-dialog-footer"),e(2,` 779 `),P(3,64),e(4,` 780 `),o(5,"button",65),x("click",function(){_(i);let a=d(2);return C(a.refundDialogVisible=!1)}),e(6,"Don't Refund"),r(),e(7,` 781 `),F(),e(8,` 782 `),P(9,66),e(10,` 783 784 `),o(11,"button",67),x("click",function(){_(i);let a=d(2);return C(a.confirmRefundPurchase())}),e(12,` 785 `),f(13,to,3,0),e(14),r(),e(15,` 786 787 `),F(),e(16,` 788 `),r(),e(17,` 789 `)}if(n&2){let i=d(2);s(5),u("disabled",i.loadingRefundDialog||i.refunding),s(6),u("disabled",i.loadingRefundDialog||i.refunding||!i.canRefund||i.refundResult&&!i.refundResult.refundSuccess),s(2),h(i.refunding?13:-1),s(),b(` 790 `,i.refunding?"Refunding...":"Refund Purchase",` 791 `)}}function no(n,c){if(n&1){let i=k();e(0,` 792 `),o(1,"app-dialog-footer"),e(2,` 793 `),P(3,64),e(4,` 794 `),o(5,"button",68),x("click",function(){_(i);let a=d(2);return C(a.refundDialogVisible=!1)}),e(6,"Close"),r(),e(7,` 795 `),F(),e(8,` 796 `),ge(9,66),e(10,` 797 `),r(),e(11,` 798 `)}}function ao(n,c){if(n&1&&(e(0,` 799 `),f(1,io,18,4),f(2,no,12,0)),n&2){let i=d();s(),h(i.selectedPurchase?1:-1),s(),h(i.selectedPurchase?-1:2)}}function oo(n,c){if(n&1&&(e(0,` 800 `),o(1,"div",57),e(2,` 801 `),o(3,"div",61),e(4,` 802 `),o(5,"div",6),e(6,` 803 `),o(7,"label",69),e(8),r(),e(9,` 804 `),o(10,"div",70),e(11),r(),e(12,` 805 `),r(),e(13,` 806 `),r(),e(14,` 807 `),r(),e(15,` 808 `)),n&2){let i=c.$implicit;s(8),y(i.label),s(3),y(i.answer||"No answer provided")}}function ro(n,c){if(n&1&&(e(0,` 809 `),o(1,"div"),e(2,` 810 `),Z(3,oo,16,2,null,null,H),r(),e(5,` 811 `)),n&2){let i=d();s(3),G(i.selectedPurchaseAnswers)}}function lo(n,c){n&1&&(e(0,` 812 `),o(1,"div",71),e(2,` 813 `),o(3,"p"),e(4,"No additional information available for this purchase."),r(),e(5,` 814 `),r(),e(6,` 815 `))}function so(n,c){if(n&1){let i=k();e(0,` 816 `),o(1,"app-dialog-footer"),e(2,` 817 `),ge(3,64),e(4,` 818 `),P(5,66),e(6,` 819 `),o(7,"button",68),x("click",function(){_(i);let a=d();return C(a.additionalInfoDialogVisible=!1)}),e(8,"Close"),r(),e(9,` 820 `),F(),e(10,` 821 `),r(),e(11,` 822 `)}}function co(n,c){if(n&1){let i=k();e(0,` 823 `),o(1,"app-email-compose",72),x("send",function(){_(i);let a=d();return C(a.onEmailSent())})("cancel",function(){_(i);let a=d();return C(a.onEmailCancel())}),r(),e(2,` 824 `)}if(n&2){let i=d();s(),u("recipients",i.emailRecipients)("emailTemplateType",i.EmailTemplateType.GENERAL)("emailCategoryID",i.EmailCategoryLV.CLUB_COMMUNICATIONS)("defaultEmailSubject","Message regarding your ticket purchase")("showHeader",!1)("hideSearch",!0)("showSteps",!1)}}var yi=(()=>{let c=class c{constructor(t,a,l,m){this.ticketSaleService=t,this.siteDataService=a,this.router=l,this.route=m,this.AriaLabels=We,this.totalRecords=0,this.loading=!0,this.showTable=!1,this.issueRefund=!1,this.selectedPurchase=null,this.cancelDialogVisible=!1,this.loadingCancelDialog=!0,this.cancelling=!1,this.refundDialogVisible=!1,this.loadingRefundDialog=!0,this.refunding=!1,this.canRefund=!1,this.refundMessage="",this.validatingTicketId=null,this.unvalidatingTicketId=null,this.additionalInfoDialogVisible=!1,this.selectedPurchaseAnswers=[],this.menuItems=[],this.dashboardLoading=!1,this.ticketSaleConfiguration=null,this.configurationLoading=!1,this.unsubscribe$=new se,this.selectedPurchases=new Set,this.selectionMap={},this.allSelected=!1,this.bulkActionsVisible=!1,this.selectedBulkAction=null,this.showBulkEmailDialog=!1,this.emailRecipients=[],this.EmailTemplateType=oi,this.EmailCategoryLV=ai,this.bulkActionOptions=[{label:"Send Email",value:"email"}],this.expandedRows={}}ngOnInit(){this.ticketSaleConfigurationId=+this.route.parent.snapshot.paramMap.get("ticketSaleConfigurationId"),this.resetFilters(),this.loadTicketSaleConfiguration(),this.loadDashboardSummary(),this.siteDataService.hide
824SiteLoader(),this.run()}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}loadTicketSaleConfiguration(){this.configurationLoading=!0,this.ticketSaleService.getTicketSaleConfiguration(this.ticketSaleConfigurationId).pipe(B(this.unsubscribe$)).subscribe({next:t=>{this.ticketSaleConfiguration=t,this.configurationLoading=!1},error:()=>{this.ticketSaleConfiguration=null,this.configurationLoading=!1}})}loadDashboardSummary(){this.dashboardLoading=!0,this.ticketSaleService.getDashboardSummary(this.ticketSaleConfigurationId).pipe(B(this.unsubscribe$)).subscribe({next:t=>{this.dashboardSummary=t,this.dashboardLoading=!1},error:()=>{this.dashboardSummary=null,this.dashboardLoading=!1}})}isRedemptionEnabled(){if(!this.ticketSaleConfiguration?.ticketClubCalendarEvent?.startDate)return!1;let t=new Date,a=new Date(this.ticketSaleConfiguration.ticketClubCalendarEvent.startDate);return t.setHours(0,0,0,0),a.setHours(0,0,0,0),t>=a}run(){this.ticketSaleService.filters.page=1,this.totalRecords=0,this.showTable?this.search():this.showTable=!0}search(t=null){this.lastSearch=t;let a=this.ticketSaleService.filters;t&&t.sortField&&(a.orderBy=t.sortField+" "+(t.sortOrder===1?"ASC":"DESC"),a.page=t.first/a.rows+1),a.includeCount=this.totalRecords===0,this.loading=!0,this.ticketSaleService.getTicketSaleConfigurationPurchases(this.ticketSaleConfigurationId).pipe(B(this.unsubscribe$)).subscribe({next:l=>{this.searchResults=l.results,a.includeCount&&(this.totalRecords=l.total),this.loading=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data.")}})}resetFilters(){this.ticketSaleService.filters=new Ge("purchasedDate DESC")}goToTicketCreation(){this.router.navigate(["./create"],{relativeTo:this.route})}toggleOptionsMenu(t,a){this.selectedPurchase=t;let l=[],m=t.ticketExpansion&&t.ticketExpansion.some(A=>A.isValidated),p=t.ticketExpansion&&t.ticketExpansion.some(A=>!A.isValidated),g=this.isRedemptionEnabled();if(t.answers&&t.answers.length>0&&l.push({label:"View Additional Info",command:()=>{this.viewAdditionalInfo()}}),!t.isCancelled&&p){let A={label:"Redeem All Tickets",command:()=>{this.redeemAllTickets(t)},disabled:this.validatingTicketId==="ALL-"+t.ticketSaleID||!g};g||(A.tooltip="Ticket check in is not available until the event date."),l.push(A)}!t.isCancelled&&!m?l.push({label:"Cancel Ticket Purchase",command:()=>{this.cancelPurchase()}}):t.isCancelled&&t.totalPurchaseCost>0?l.push({label:"Refund Ticket Purchase",command:()=>{this.refundPurchase()}}):m&&l.push({label:"Cancel Ticket Purchase",command:()=>{this.siteDataService.showSiteErrorAlert("Cancellation and refunds are not permitted because one or more tickets in this purchase have already been checked in.")},disabled:!0,tooltip:"Cancellation and refunds are not permitted because one or more tickets in this purchase have already been checked in."}),this.menuItems=l,this.optionsMenu.toggle(a)}cancelPurchase(){if(this.selectedPurchase&&this.selectedPurchase.ticketExpansion&&this.selectedPurchase.ticketExpansion.some(t=>t.isValidated)){this.siteDataService.showSiteErrorAlert("Cancellation and refunds are not permitted because one or more tickets in this purchase have already been checked in."),this.cancelDialogVisible=!1;return}this.cancellationResult=null,this.loadingCancelDialog=!0,this.cancelDialogVisible=!0,this.issueRefund=!1,this.ticketSaleService.canRefundTicketPurchase(this.ticketSaleConfigurationId,this.selectedPurchase.ticketSaleID).pipe(B(this.unsubscribe$)).subscribe({next:t=>{this.canRefund=t.canRefund,this.refundMessage=t.reason,this.loadingCancelDialog=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data."),this.cancelDialogVisible=!1}})}confirmCancelPurchase(){this.cancelling=!0,this.cancellationResult=null,this.ticketSaleService.cancelTicketPurchase(this.ticketSaleConfigurationId,this.selectedPurchase.ticketSaleID,this.issueRefund).pipe(B(this.unsubscribe$)).subscribe({next:t=>{this.cancellationResult=t,this.cancellationResult.cancellationSuccess&&(this.search(this.lastSearch),this.loadDashboardSummary(),this.siteDataService.showSiteSuccessAlert("Ticket purchase cancelled successfully."),(!this.issueRefund||this.cancellationResult.refundSuccess)&&(this.cancelDialogVisible=!1)),this.cancelling=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem cancelling the purchase."),this.cancelling=!1}})}refundPurchase(){this.refundResult=null,this.loadingRefundDialog=!0,this.refundDialogVisible=!0,this.ticketSaleService.canRefundTicketPurchase(this.ticketSaleConfigurationId,this.selectedPurchase.ticketSaleID).pipe(B(this.unsubscribe$)).subscribe({next:t=>{this.canRefund=t.canRefund,this.refundMessage=t.reason,this.loadingRefundDialog=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem getting data."),this.refundDialogVisible=!1}})}confirmRefundPurchase(){this.refunding=!0,this.refundResult=null,this.ticketSaleService.refundTicketPurchase(this.ticketSaleConfigurationId,this.selectedPurchase.ticketSaleID).pipe(B(this.unsubscribe$)).subscribe({next:t=>{this.refundResult=t,this.refundResult.refundSuccess&&(this.refundDialogVisible=!1,this.search(this.lastSearch),this.loadDashboardSummary(),this.siteDataService.showSiteSuccessAlert("Ticket purchase refunded successfully.")),this.refunding=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem refunding the purchase."),this.refunding=!1}})}validateTicket(t,a){this.validatingTicketId=t,this.ticketSaleService.validateTicket(t).pipe(B(this.unsubscribe$)).subscribe({next:l=>{let m=a.ticketExpansion.find(p=>p.ticketID===t);m&&(m.isValidated=!0,m.validationDate=new Date().toISOString(),l&&l.validatedByFirstName?m.validatedByFirstName=l.validatedByFirstName:m.validatedByFirstName="You",l&&l.validatedByLastName&&(m.validatedByLastName=l.validatedByLastName)),typeof a.verifiedTicketCount=="number"&&(a.verifiedTicketCount=a.ticketExpansion.filter(p=>p.isValidated).length),this.validatingTicketId=null,this.siteDataService.showSiteSuccessAlert("Ticket validated successfully.")},error:l=>{this.siteDataService.showSiteErrorAlert(l?.error?.message||"An error occurred while validating the ticket."),this.validatingTicketId=null}})}unvalidateTicket(t,a){this.unvalidatingTicketId=t,this.ticketSaleService.unvalidateTicket(t).pipe(B(this.unsubscribe$)).subscribe({next:()=>{let l=a.ticketExpansion.find(m=>m.ticketID===t);l&&(l.isValidated=!1,l.validationDate=null,l.validatedByFirstName=null,l.validatedByLastName=null),typeof a.verifiedTicketCount=="number"&&(a.verifiedTicketCount=a.ticketExpansion.filter(m=>m.isValidated).length),this.unvalidatingTicketId=null,this.siteDataService.showSiteSuccessAlert("Ticket check-in has been undone.")},error:l=>{this.siteDataService.showSiteErrorAlert(l?.error?.message||"An error occurred while un-redeeming the ticket."),this.unvalidatingTicketId=null}})}redeemAllTickets(t){if(t.isCancelled)return;if(!this.isRedemptionEnabled()){this.siteDataService.showSiteErrorAlert("Ticket cehck in is not available until the event date.");return}t.ticketExpansion.filter(l=>!l.isValidated).length&&(this.validatingTicketId="ALL-"+t.ticketSaleID,this.ticketSaleService.validateTicketSale(t.ticketSaleID).pipe(B(this.unsubscribe$)).subscribe({next:l=>{let m=0,p=0;l.forEach(g=>{let A=t.ticketExpansion.find(N=>
824N.ticketID===g.ticketID);A&&(g.isValid?(A.isValidated=!0,A.validationDate=new Date().toISOString(),A.validatedByFirstName=g.validatedByFirstName||"You",A.validatedByLastName=g.validatedByLastName||"",m++):(p++,console.warn(`Ticket ${g.ticketID} validation failed: ${g.message}`)))}),t.verifiedTicketCount=t.ticketExpansion.filter(g=>g.isValidated).length,this.validatingTicketId=null,p===0?this.siteDataService.showSiteSuccessAlert("All tickets checked in successfully."):m>0?this.siteDataService.showSiteErrorAlert(`${m} tickets checked in successfully, but ${p} could not be checked in.`):this.siteDataService.showSiteErrorAlert("No tickets could be checked in.")},error:l=>{this.validatingTicketId=null,this.siteDataService.showSiteErrorAlert(l?.error?.message||"An error occurred while checking in tickets.")}}))}viewAdditionalInfo(){this.selectedPurchase&&this.selectedPurchase.answers&&(this.selectedPurchaseAnswers=this.selectedPurchase.answers,this.additionalInfoDialogVisible=!0)}togglePurchaseSelection(t){this.selectedPurchases.has(t)?(this.selectedPurchases.delete(t),this.selectionMap[t]=!1):(this.selectedPurchases.add(t),this.selectionMap[t]=!0),this.updateBulkSelectionState()}toggleSelectAll(){this.allSelected?(this.selectedPurchases.clear(),this.searchResults.forEach(t=>{this.selectionMap[t.ticketSaleID]=!1})):this.searchResults.forEach(t=>{this.selectedPurchases.add(t.ticketSaleID),this.selectionMap[t.ticketSaleID]=!0}),this.updateBulkSelectionState()}updateBulkSelectionState(){let t=this.selectedPurchases.size,a=this.searchResults?.length||0;this.allSelected=t>0&&t===a,this.bulkActionsVisible=t>0}isPurchaseSelected(t){return this.selectionMap[t]||!1}getSelectedCount(){return this.selectedPurchases.size}onBulkAction(t){if(!t||this.selectedPurchases.size===0){this.selectedBulkAction=null;return}t==="email"?this.prepareBulkEmail():this.selectedBulkAction=null}prepareBulkEmail(){this.selectedPurchases.size!==0&&(this.emailRecipients=this.searchResults.filter(t=>this.selectedPurchases.has(t.ticketSaleID)).map(t=>({emailAddress:t.email,firstName:t.firstName,lastName:t.lastName,playerID:void 0,player:void 0,clubUser:void 0,isCC:!1})),this.showBulkEmailDialog=!0)}onEmailSent(){this.showBulkEmailDialog=!1,this.emailRecipients=[],this.selectedPurchases.clear(),this.selectionMap={},this.updateBulkSelectionState(),this.selectedBulkAction=null}onEmailCancel(){this.showBulkEmailDialog=!1,this.emailRecipients=[],this.selectedBulkAction=null}};c.\u0275fac=function(a){return new(a||c)(S(V),S(M),S(pe),S(O))},c.\u0275cmp=R({type:c,selectors:[["ng-component"]],viewQuery:function(a,l){if(a&1&&J(Gn,5),a&2){let m;Q(m=W())&&(l.optionsMenu=m.first)}},standalone:!1,decls:90,vars:38,consts:[["optionsMenu",""],["expandedrow",""],["role","main",3,"keydown.enter"],[3,"adminFilterReset","adminFilterSearch","showLabels"],["primary",""],[1,"col"],[1,"form-group"],["type","text","id","lastName",1,"full-width",3,"ngModelChange","ngModel"],["type","text","id","firstName",1,"full-width",3,"ngModelChange","ngModel"],["for","search"],["type","text","id","search",1,"full-width",3,"ngModelChange","ngModel"],[1,"row","d-flex","align-items-center","mb-3"],[1,"col-auto","d-flex","align-items-center"],[1,"mr-2","text-muted"],["placeholder","Actions","optionLabel","label","optionValue","value","styleClass","mr-3",3,"ngModelChange","onChange","options","ngModel","disabled"],[1,"table-responsive"],[3,"popup","model"],["appendTo","body","styleClass","standardWidthDialog",3,"visibleChange","onHide","modal","visible","closable","draggable","header"],["pTemplate","footer"],[1,"additional-info-dialog-content","ml-3","mr-3"],["header","Send Email to Selected Purchasers","styleClass","largeWidthDialog",3,"visibleChange","onHide","visible","modal","resizable","closable"],[1,"mb-3"],[1,"row","align-items-center","no-gutters"],[1,"col-auto"],[1,"card"],[1,"mb-1"],["styleClass","mb-1 custom-progress-bar",3,"value","showValue"],[1,"col","px-3"],[1,"card","text-center"],[1,""],[1,"card","text-center","bg-green-lt","border"],[1,"bold","text-large","text-green"],[1,"bold","text-large"],[1,"text-danger","font-weight-bold"],["sortField","purchasedDate",1,"table","table-striped","table-sm",3,"onLazyLoad","columns","value","lazy","paginator","alwaysShowPaginator","totalRecords","rows","loading","dataKey","expandedRowKeys"],["pTemplate","header"],["pTemplate","body"],[2,"width","40px"],["type","checkbox",3,"change","checked"],[3,"pSortableColumn"],[3,"field"],[3,"href"],["type","button",1,"btn","btn-tertiary","btn-sm",3,"pRowToggler"],[1,"fa-solid","fa-chevron-down",3,"ngClass"],[1,"sr-only"],[1,"row",3,"ngClass"],[1,"col-12"],[1,"row"],["type","button",1,"btn","btn-sm","btn-tertiary","mr-2",3,"click"],[1,"fa-solid","fa-ellipsis"],[1,"p-0"],[1,"table","table-sm","mb-0",3,"value"],[3,"text","status"],["type","button",1,"btn","btn-outline-secondary","btn-sm","ms-2",3,"click","disabled"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"],["type","button",1,"btn","btn-primary","btn-sm",3,"click","disabled"],[1,"cancel-registration-dialog-content","ml-3","mr-3"],[1,"row","mb-3"],[1,"col-md-12","text-medium"],[3,"alertType","isInline","showIcon"],[1,"text-medium"],[1,"col-md-12"],["styleClass","mb-3","controlGroupName","issueRefund","inputId","yes","label","Yes, issue a refund",3,"ngModelChange","optionValue","ngModel","disabled"],["styleClass","mb-3","controlGroupName","issueRefund","inputId","no","label","No, do not issue a refund",3,"ngModelChange","optionValue","ngModel"],["slot","secondary"],["type","button",1,"btn","btn-lg","btn-naked",3,"click","disabled"],["slot","primary"],["type","button",1,"btn","btn-lg","btn-primary",3,"click","disabled"],["type","button",1,"btn","btn-lg","btn-primary",3,"click"],[1,"font-weight-bold"],[1,"answer-text"],[1,"text-center","text-muted"],[3,"send","cancel","recipients","emailTemplateType","emailCategoryID","defaultEmailSubject","showHeader","hideSearch","showSteps"]],template:function(a,l){if(a&1){let m=k();o(0,"main",2),x("keydown.enter",function(){return l.run()}),e(1,`
825 `),f(2,ia,50,11),o(3,"app-admin-filter",3),x("adminFilterReset",function(){return l.resetFilters()})("adminFilterSearch",function(){return l.run()}),e(4,` 826 `),P(5,4),e(6,` 827 `),o(7,"div",5),e(8,` 828 `),o(9,"div",6),e(10,` 829 `),o(11,"label"),e(12,"Last Name"),r(),e(13,` 830 `),o(14,"input",7),D("ngModelChange",function(g){return _(m),w(l.ticketSaleService.filters.lastName,g)||(l.ticketSaleService.filters.lastName=g),C(g)}),r(),e(15,` 831 `),r(),e(16,` 832 `),r(),e(17,` 833 `),o(18,"div",5),e(19,` 834 `),o(20,"div",6),e(21,` 835 `),o(22,"label"),e(23,"First Name"),r(),e(24,` 836 `),o(25,"input",8),D("ngModelChange",function(g){return _(m),w(l.ticketSaleService.filters.firstName,g)||(l.ticketSaleService.filters.firstName=g),C(g)}),r(),e(26,` 837 `),r(),e(27,` 838 `),r(),e(28,` 839 `),o(29,"div",5),e(30,` 840 `),o(31,"label",9),e(32,"Email"),r(),e(33,` 841 `),o(34,"input",10),D("ngModelChange",function(g){return _(m),w(l.ticketSaleService.filters.email,g)||(l.ticketSaleService.filters.email=g),C(g)}),r(),e(35,` 842 `),r(),e(36,` 843 `),F(),e(37,` 844 `),r(),e(38,` 845 846 `),o(39,"section"),e(40,` 847 `),e(41,` 848 `),o(42,"div",11),e(43,` 849 `),o(44,"div",12),e(45,` 850 `),o(46,"span",13),e(47),r(),e(48,` 851 `),o(49,"p-select",14),D("ngModelChange",function(g){return _(m),w(l.selectedBulkAction,g)||(l.selectedBulkAction=g),C(g)}),x("onChange",function(g){return l.onBulkAction(g.value)}),r(),e(50,` 852 `),r(),e(51,` 853 `),r(),e(52,` 854 855 `),o(53,"div",15),e(54,` 856 `),f(55,va,11,10),r(),e(56,` 857 `),r(),e(57,` 858`),r(),e(58,` 859 860`),v(59,"p-menu",16,0),e(61,` 861 862`),o(62,"p-dialog",17),D("visibleChange",function(g){return _(m),w(l.cancelDialogVisible,g)||(l.cancelDialogVisible=g),C(g)}),x("onHide",function(){return l.cancelDialogVisible=!1}),e(63,` 863 `),f(64,Ma,3,2)(65,La,9,0),E(66,$a,3,2,"ng-template",18),e(67,` 864`),r(),e(68,` 865 866`),o(69,"p-dialog",17),D("visibleChange",function(g){return _(m),w(l.refundDialogVisible,g)||(l.refundDialogVisible=g),C(g)}),x("onHide",function(){return l.refundDialogVisible=!1}),e(70,` 867 `),f(71,Xa,3,2)(72,eo,9,0),E(73,ao,3,2,"ng-template",18),e(74,` 868`),r(),e(75,` 869 870`),o(76,"p-dialog",17),D("visibleChange",function(g){return _(m),w(l.additionalInfoDialogVisible,g)||(l.additionalInfoDialogVisible=g),C(g)}),x("onHide",function(){return l.additionalInfoDialogVisible=!1}),e(77,` 871 `),o(78,"div",19),e(79,` 872 `),f(80,ro,6,0)(81,lo,7,0),r(),e(82,` 873 `),E(83,so,12,0,"ng-template",18),e(84,` 874`),r(),e(85,` 875 876`),e(86,` 877`),o(87,"p-dialog",20),D("visibleChange",function(g){return _(m),w(l.showBulkEmailDialog,g)||(l.showBulkEmailDialog=g),C(g)}),x("onHide",function(){return l.onEmailCancel()}),e(88,` 878 `),f(89,co,3,7),r()}a&2&&(s(2),h(l.dashboardSummary&&!l.dashboardLoading?2:-1),s(),u("showLabels",!0),s(11),T("ngModel",l.ticketSaleService.filters.lastName),s(11),T("ngModel",l.ticketSaleService.filters.firstName),s(9),T("ngModel",l.ticketSaleService.filters.email),s(13),b("",l.getSelectedCount()," selected"),s(2),u("options",l.bulkActionOptions),T("ngModel",l.selectedBulkAction),u("disabled",l.getSelectedCount()===0),s(6),h(l.showTable?55:-1),s(4),kt(ce(37,Yn)),u("popup",!0)("model",l.menuItems),s(3),u("modal",!0),T("visible",l.cancelDialogVisible),u("closable",!1)("draggable",!0)("header","Cancel Purchase"+(l.selectedPurchase?" for "+l.selectedPurchase.firstName+" "+l.selectedPurchase.lastName:"")),s(2),h(l.loadingCancelDialog?65:64),s(5),u("modal",!0),T("visible",l.refundDialogVisible),u("closable",!1)("draggable",!0)("header","Refund Purchase"+(l.selectedPurchase?" for "+l.selectedPurchase.firstName+" "+l.selectedPurchase.lastName:"")),s(2),h(l.loadingRefundDialog?72:71),s(5),u("modal",!0),T("visible",l.additionalInfoDialogVisible),u("closable",!0)("draggable",!0)("header","Additional Information"+(l.selectedPurchase?" for "+l.selectedPurchase.f
878irstName+" "+l.selectedPurchase.lastName:"")),s(4),h(l.selectedPurchaseAnswers&&l.selectedPurchaseAnswers.length>0?80:81),s(7),T("visible",l.showBulkEmailDialog),u("modal",!0)("resizable",!0)("closable",!0),s(2),h(l.emailRecipients&&l.emailRecipients.length>0&&l.showBulkEmailDialog?89:-1))},dependencies:[Le,Be,Se,ke,X,Rt,Ee,ee,He,ze,jt,ye,fe,Ue,Bt,je,z,Vt,$e,Nt,fi,ue,me,Wt],styles:[".custom-progress-bar{height:28px;width:400px} .custom-progress-bar .p-progressbar-value{background-color:var(--green-700)}"]});let n=c;return n})();var mo=["eventPageForm"],uo=["fileUploadField"];function po(n,c){if(n&1){let i=k();e(0,` 879 `),o(1,"app-dynamic-form",13,0),x("onSubmit",function(a){_(i);let l=d();return C(l.savePage(a))}),e(3,` 880 `),o(4,"div",14),e(5,` 881 `),o(6,"app-dynamic-form-field",15,1),x("onChange",function(a){_(i);let l=d();return C(l.onBannerImageChange(a))}),e(8,` 882 `),r(),e(9,` 883 `),r(),e(10,` 884 `),o(11,"h1",16),e(12),r(),e(13,` 885 `),v(14,"app-dynamic-form-field",17),e(15,` 886 `),r(),e(16,` 887 `)}if(n&2){let i=d();s(),u("fields",i.ticketSalePageMetaData)("entity",i.configuration)("horizontalForm",!1)("contentFieldsMode",!0)("showSaveAndAddButton",!1)("showSubmitButton",!0)("showCancelButton",!1),s(5),u("acceptType",i.acceptedTypes)("acceptedFileExtensions",i.acceptedFileExtensions)("hideLabel",!0)("canRemoveFile",!0)("inlineFileUploadButtons",!0)("selectedFileName",i.configuration.bannerImage?i.configuration.bannerImage:null)("showFileUploadImagePreview",!0),s(6),b(` 888 `,i.configuration==null||i.configuration.ticketClubCalendarEvent==null?null:i.configuration.ticketClubCalendarEvent.title,` 889 `),s(2),u("hideLabel",!0)}}function fo(n,c){if(n&1&&(e(0),I(1,"date")),n&2){let i=d(2);b(` 890 `,U(1,1,i.configuration==null||i.configuration.ticketClubCalendarEvent==null?null:i.configuration.ticketClubCalendarEvent.startDate,"fullDate"),` 891 `)}}function ho(n,c){if(n&1&&(e(0,` 892 `),o(1,"span"),e(2),I(3,"date"),r(),e(4,` 893 `)),n&2){let i=d(3);s(2),b(` 894 - `,$(3,1,i.configuration==null||i.configuration.ticketClubCalendarEvent==null?null:i.configuration.ticketClubCalendarEvent.endDate))}}function _o(n,c){if(n&1&&(e(0),I(1,"date"),f(2,ho,5,3)),n&2){let i=d(2);b(` 895 `,$(1,2,i.configuration==null||i.configuration.ticketClubCalendarEvent==null?null:i.configuration.ticketClubCalendarEvent.startDate),` 896 `),s(2),h(!(i.configuration==null||i.configuration.ticketClubCalendarEvent==null)&&i.configuration.ticketClubCalendarEvent.endDate?2:-1)}}function Co(n,c){if(n&1&&(e(0,` 897 `),o(1,"div",6),e(2,` 898 `),o(3,"div",7),e(4,` 899 `),o(5,"span",8),e(6,"When"),r(),e(7,` 900 `),r(),e(8,` 901 `),o(9,"div",18),e(10,` 902 `),f(11,fo,2,4)(12,_o,3,4),r(),e(13,` 903 `),r(),e(14,` 904 `)),n&2){let i=d();s(11),h(!(i.configuration==null||i.configuration.ticketClubCalendarEvent==null)&&i.configuration.ticketClubCalendarEvent.isAllDayEvent?11:12)}}function xo(n,c){if(n&1&&(e(0,` 905 `),o(1,"span"),e(2),r(),e(3,` 906 `)),n&2){let i=d();s(2),b(", ",i)}}function go(n,c){n&1&&(e(0,` 907 `),o(1,"span"),e(2,` 908 `),f(3,xo,4,1),r(),e(4,` 909 `)),n&2&&(s(3),h(c?3:-1))}function vo(n,c){if(n&1&&(e(0,` 910 `),o(1,"div",6),e(2,` 911 `),o(3,"div",7),e(4,` 912 `),o(5,"span",8),e(6,"Where"),r(),e(7,` 913 `),r(),e(8,` 914 `),o(9,"div",18),e(10),f(11,go,5,1),I(12,"facilityFieldNames"),r(),e(13,` 915 `),r(),e(14,` 916 `)),n&2){let i,t=d();s(10),b(` 917 `,t.configuration==null||t.configuration.ticketClubCalendarEvent==null||t.configuration.ticketClubCalendarEvent.location==null?null:t.configuration.ticketClubCalendarEvent.location.name,` 918 `),s(),h((i=U(12,2,t.configuration==null||t.configuration.ticketClubCalendarEvent==null?null:t.configuration.ticketClubCalendarEvent.facilityFields,t.configuration==null||t.configuration.ticketClubCalendarEvent==null?null:t.configuration.ticketClubCalendarEvent.facilityField))?11:-1,i)}}function So(n,c){n&1&&(e(0,` 919 `),o(1,"span",19),e(2,"; "),r(),e(3,` 920 `))}function ko(n,c){if(n&1&&(e(0),I(1,"currency"),f(2,So,4,0)),n&2){let i=c.$implicit,t=c.$index,a=c.$count;K(` 921 `,i.categoryName,": ",$(1,3,i.basePrice),` 922 `),s(2),h(t!==a-1?2:-1)}}var Ei=(()=>{let c=class c{constructor(t,a,l,m,p){this.formService=t,this.router=a,this.route=l,this.ticketService=m,this.siteDataService=p,this.unsubscribe$=new se,this.isLoading=!1,this.viewOnly=!1,this.acceptedFileExtensions=Oe,this.acceptedTypes=Qe}ngOnInit(){this.ticketSaleConfigurationId=+this.route.parent.snapshot.paramMap.get("ticketSaleConfigurationId"),this.getData(!0)}getData(t=!1){let a=t?this.ticketService.refreshConfiguration(this.ticketSaleConfigurationId):this.ticketService.getTicketSaleConfiguration(this.ticketSaleConfigurationId);j({metaData:t?this.ticketService.getTicketEventInfoMetaData():ft(void 0),configuration:a}).subscribe({next:l=>{this.configuration=l.configuration,this.viewOnly=this.ticketService.isEventViewOnly(this.configuration),t&&(this.ticketSalePageMetaData=l.metaData.ticketSalePageConfiguration.fields),this.isLoading=!1,this.siteDataService.hide
922SiteLoader()}})}onBannerImageChange(t){t&&t.target&&t.target.files&&t.target.files[0]?this.bannerFile=t.target.files[0]:(this.bannerFile=void 0,this.configuration&&(this.configuration.bannerImage=null))}savePage(t){this.fileUploadField.hasFileChanged?this.bannerFile?(t.bannerImage=this.configuration.bannerImage,this.ticketService.saveTicketPage(this.ticketSaleConfigurationId,t,this.bannerFile,this.bannerFile.name).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Ticket Sale Configuration saved successfully"),this.ticketService.refreshConfiguration(this.ticketSaleConfigurationId).subscribe({next:()=>{this.formService.hideFormLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem refreshing the ticket sale configuration"),this.formService.hideFormLoader()}})},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving the ticket sale configuration"),this.formService.hideFormLoader()}})):(t.bannerImage=null,this.ticketService.saveTicketPage(this.ticketSaleConfigurationId,t).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Ticket Sale Configuration saved successfully"),this.ticketService.refreshConfiguration(this.ticketSaleConfigurationId).subscribe({next:()=>{this.formService.hideFormLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem refreshing the ticket sale configuration"),this.formService.hideFormLoader()}}),this.formService.hideFormLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving the ticket sale configuration"),this.formService.hideFormLoader()}})):(t.bannerImage=this.configuration.bannerImage,this.ticketService.saveTicketPage(this.ticketSaleConfigurationId,t).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Ticket Sale Configuration saved successfully"),this.ticketService.refreshConfiguration(this.ticketSaleConfigurationId).subscribe({next:()=>{this.formService.hideFormLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem refreshing the ticket sale configuration"),this.formService.hideFormLoader()}}),this.formService.hideFormLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving the ticket sale configuration"),this.formService.hideFormLoader()}}))}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}};c.\u0275fac=function(a){return new(a||c)(S(ie),S(pe),S(O),S(V),S(M))},c.\u0275cmp=R({type:c,selectors:[["app-ticket-sale-event-page"]],viewQuery:function(a,l){if(a&1&&J(mo,5)(uo,5),a&2){let m;Q(m=W())&&(l.eventPageForm=m.first),Q(m=W())&&(l.fileUploadField=m.f
922irst)}},standalone:!1,decls:40,vars:3,consts:[["eventPageForm",""],["fileUploadField",""],[1,"full-height","full-width","bg-secondary","p-4"],[1,"container"],[1,"card","full-width"],[1,"mt-4"],[1,"row","my-2"],[1,"col-md-3"],[1,"small-label"],[1,"col-md-9"],[1,"d-flex","fw-600"],[1,"mt-5"],["disabled","",1,"btn","btn-primary","btn-icon-ticket"],[3,"onSubmit","fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton","showSubmitButton","showCancelButton"],[1,"border-blue","border-all","border-dashed","d-flex","justify-content-center","align-items-center","mb-3","border-radius-xl","p-3","event-pg-banner-preview"],["fieldName","bannerImage",3,"onChange","acceptType","acceptedFileExtensions","hideLabel","canRemoveFile","inlineFileUploadButtons","selectedFileName","showFileUploadImagePreview"],[1,"text-h2","my-4"],["fieldName","details",3,"hideLabel"],[1,"col-md-9","fw-600"],[1,"mr-2"]],template:function(a,l){a&1&&(o(0,"div",2),e(1,` 923 `),o(2,"div",3),e(3,` 924 `),o(4,"div",4),e(5,` 925 `),f(6,po,17,16),o(7,"div",5),e(8,` 926 `),f(9,Co,15,1),f(10,vo,15,5),o(11,"div",6),e(12,` 927 `),o(13,"div",7),e(14,` 928 `),o(15,"span",8),e(16,"Cost"),r(),e(17,` 929 `),r(),e(18,` 930 `),o(19,"div",9),e(20,` 931 `),o(21,"div",10),e(22,` 932 `),Z(23,ko,3,5,null,null,H),r(),e(25,` 933 `),r(),e(26,` 934 `),r(),e(27,` 935 `),o(28,"div",11),e(29,` 936 `),o(30,"button",12),e(31,` 937 `),o(32,"span"),e(33,"Purchase Tickets"),r(),e(34,` 938 `),r(),e(35,` 939 `),r(),e(36,` 940 `),r(),e(37,` 941 `),r(),e(38,` 942 943 `),r(),e(39,` 944`),r()),a&2&&(s(6),h(l.ticketSalePageMetaData?6:-1),s(3),h(!(l.configuration==null||l.configuration.ticketClubCalendarEvent==null)&&l.configuration.ticketClubCalendarEvent.startDate?9:-1),s(),h(!(l.configuration==null||l.configuration.ticketClubCalendarEvent==null)&&l.configuration.ticketClubCalendarEvent.location?10:-1),s(13),G(l.configuration==null?null:l.configuration.ticketPriceCategories))},dependencies:[ne,he,ue,me,qe],encapsulation:2});let n=c;return n})();function bo(n,c){if(n&1){let i=k();e(0,` 945 `),o(1,"app-event-info-form",11,0),x("save",function(a){_(i);let l=d();return C(l.saveEventInfo(a))}),e(3," "),r(),e(4,` 946`)}if(n&2){let i=d();s(),u("fields",i.eventInfoMetaData)("entity",i.ticketSaleConfiguration.ticketClubCalendarEvent)("loading",i.loading)("saving",i.savingEventInfoWithNotify)}}function yo(n,c){if(n&1&&(e(0,` 947 `),v(1,"span",16),e(2)),n&2){let i=d(2);s(2),b(` 948 `,i.submitButtonTextDisplay,` 949 `)}}function Eo(n,c){if(n&1&&e(0),n&2){let i=d(2);b(` 950 Yes, `,i.submitButtonText,` 951 `)}}function To(n,c){if(n&1){let i=k();e(0,` 952 `),o(1,"app-dialog-footer"),e(2,` 953 `),P(3,12),e(4,` 954 `),o(5,"button",13),x("click",function(){_(i);let a=d();
954return C(a.onCancelConfirmSave())}),e(6,"No"),r(),e(7,` 955 `),F(),e(8,` 956 `),P(9,14),e(10,` 957 `),o(11,"button",15),x("click",function(){_(i);let a=d();return C(a.submitForm())}),e(12,` 958 `),f(13,yo,3,1)(14,Eo,1,1),r(),e(15,` 959 `),F(),e(16,` 960 `),r(),e(17,` 961`)}if(n&2){let i=d();s(5),u("disabled",i.saving),s(6),u("disabled",i.saving),s(2),h(i.loading&&i.saving?13:14)}}var Ti=(()=>{let c=class c{constructor(t,a,l,m){this.formService=t,this.siteDataService=a,this.route=l,this.ticketService=m,this.loading=!0,this.showConfirmSave=!1,this.confirmSaveMessage="",this.notifyPurchasersChecked=!1,this.saving=!1,this.savingEventInfoWithNotify=!1,this.submitButtonText="Save",this.submitButtonTextDisplay="Saving...",this.pendingEventToSave=null}ngOnInit(){this.ticketSaleConfigurationID=+this.route.parent.snapshot.paramMap.get("ticketSaleConfigurationId"),this.loading=!0,j({meta:this.ticketService.getTicketEventInfoMetaData(),config:this.ticketService.getTicketSaleConfiguration(this.ticketSaleConfigurationID)}).subscribe({next:({meta:t,config:a})=>{this.eventInfoMetaData=t.eventInfoMetaData.fields,this.ticketSaleConfiguration=a,this.loading=!1,this.siteDataService.hideSiteLoader()},error:t=>{console.error("Error fetching initial data:",t),this.loading=!1,this.siteDataService.hideSiteLoader(),this.siteDataService.showSiteErrorAlert("Failed to load event information.")}})}saveEventInfo(t){if(console.log("Submitting form with event:",this.pendingEventToSave),new Date(t.startDate)>new Date(t.endDate)){this.siteDataService.showSiteErrorAlert("The start date cannot be after the end date."),this.formService.hideFormLoader();return}this.saving=!1,this.ticketService.hasPurchases(this.ticketSaleConfigurationID).subscribe({next:a=>{a?.hasPurchases?(this.confirmSaveMessage="There are already purchases for this event. Would you still like to save changes to the event?",this.showConfirmSave=!0,this.pendingEventToSave=t,this.notifyPurchasersChecked=!1):this.saveEventInfoWithNotify(t,!1)},error:a=>{console.error("Error checking for purchases:",a),this.saveEventInfoWithNotify(t,!1)}})}submitForm(){this.saving=!0,this.showConfirmSave=!1,this.pendingEventToSave&&(this.saveEventInfoWithNotify(this.pendingEventToSave,this.notifyPurchasersChecked),this.pendingEventToSave=null)}onCancelConfirmSave(){this.showConfirmSave=!1,this.saving=!1,this.formService.hideFormLoader()}saveEventInfoWithNotify(t,a){this.savingEventInfoWithNotify=!0,this.ticketService.updateEventInfo(this.ticketSaleConfigurationID,t,a).pipe(_t(()=>this.ticketService.refreshConfiguration(this.ticketSaleConfigurationID))).subscribe({next:l=>{this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Event info updated successfully."),this.ticketSaleConfiguration=l,this.savingEventInfoWithNotify=!1},error:l=>{console.error("Error saving event info:",l),this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert("Failed to update event information."),this.savingEventInfoWithNotify=!1}})}};c.\u0275fac=function(a){return new(a||c)(S(ie),S(M),S(O),S(V))},c.\u0275cmp=R({type:c,selectors:[["app-event-info-settings"]],standalone:!1,decls:30,vars:6,consts:[["eventInfoForm",""],[1,"mb-4"],["header","Confirm Save",3,"visibleChange","visible","modal","closable"],[1,"form-group","mt-3"],[1,"d-flex","align-items-center"],["inputId","notifyPurchasersCheckbox","binary","true",3,"ngModelChange","ngModel"],["for","notifyPurchasersCheckbox",1,"ml-2","mb-0"],[1,"mt-2"],[1,"text-warning"],[1,"fa","fa-exclamation-triangle","mr-1"],["pTemplate","footer"],["mode","edit",3,"save","fields","entity","loading","saving"],["slot","secondary"],[1,"btn","btn-secondary",3,"click","disabled"],["slot","primary"],[1,"btn","btn-primary",3,"click","disabled"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm"]],template:function(a,l){a&1&&(o(0,"div",1),e(1," "),f(2,bo,5,4),r(),e(3,` 962 963`),o(4,"p-dialog",2),D("visibleChange",function(p){return w(l.showConfirmSave,p)||(l.showConfirmSave=p),p}),e(5,` 964 `),o(6,"div"),e(7),r(),e(8," "),o(9,"div",3),e(10,` 965 `),o(11,"div",4),e(12,` 966 `),o(13,"p-checkbox",5),D("ngModelChange",function(p){return w(l.notifyPurchasersChecked,p)||(l.notifyPurchasersChecked=p),p}),r(),e(14,` 967 `),o(15,"label",6),e(16,"Notify purchasers of event changes"),r(),e(17,` 968 `),r(),e(18,` 969 `),o(19,"div",7),e(20,` 970 `),o(21,"small",8),e(22,` 971 `),v(23,"i",9),e(24,` 972 Note: People who purchased tickets as guests will automatically receive updated tickets regardless of this setting. 973 `),r(),e(25,` 974 `),r(),e(26,` 975`),r(),e(27,` 976`),E(28,To,18,3,"ng-template",10),e(29,` 977`),r()),a&2&&(s(2),h(l.ticketSaleConfiguration!=null&&l.ticketSaleConfiguration.ticketClubCalendarEvent?2:-1),s(2),T("visible",l.showConfirmSave),u("modal",!0)("closable",!1),s(3),y(l.confirmSaveMessage),s(6),T("ngModel",l.notifyPurchasersChecked))},dependencies:[Se,ke,X,ye,z,Lt,Te],encapsulation:2});let n=c;return n})();var wo=["advancedOptionsForm"],Do=(n,c)=>i=>!i.hidden;function Io(n,c){n&1&&(e(0,` 978 `),o(1,"tr"),e(2,` 979 `),o(3,"th"),e(4,"Category Name"),r(),e(5,` 980 `),o(6,"th"),e(7,"Base Price"),r(),e(8,` 981 `),o(9,"th"),e(10,"Purchase Limit"),r(),e(11,` 982 `),o(12,"th"),e(13,"Max Available"),r(),e(14,` 983 `),o(15,"th"),e(16,"Tickets Sold"),r(),e(17,` 984 `),v(18,"th"),e(19,` 985 `),r(),e(20,` 986 `))}function Po(n,c){if(n&1){let i=k();e(0,` 987 `),o(1,"tr"),e(2,` 988 `),o(3,"td"),e(4),r(),e(5,` 989 `),o(6,"td"),e(7),I(8,"currency"),r(),e(9,` 990 `),o(10,"td"),e(11),r(),e(12,` 991 `),o(13,"td"),e(14),r(),e(15,` 992 `),o(16,"td"),e(17),r(),e(18,` 993 `),o(19,"td"),e(20,` 994 `),o(21,"button",7),x("click",function(){let a=_(i).$implicit,l=d();
994return C(l.openEditCategory(a))}),r(),e(22,` 995 `),o(23,"button",8),x("click",function(){let a=_(i).$implicit,l=d();return C(l.deleteCategory(a))}),r(),e(24,` 996 `),r(),e(25,` 997 `),r(),e(26,` 998 `)}if(n&2){let i=c.$implicit,t=d();s(4),y(i.categoryName),s(3),y($(8,7,i.basePrice)),s(4),y(i.purchaseLimit),s(3),y(i.maxAvailableTickets),s(3),y(t.getPurchaseCount(i.ticketPriceCategoryID)),s(4),u("disabled",t.viewOnly),s(2),u("disabled",t.viewOnly)}}function Fo(n,c){if(n&1){let i=k();e(0,` 999 `),o(1,"app-dynamic-form",9),x("onSubmit",function(a){_(i);let l=d();return C(l.saveNewPriceCategory(a))})("onCancel",function(){_(i);let a=d();return C(a.showAddPriceCategoryDialog=!1)}),r(),e(2,` 1000 `)}if(n&2){let i=d();s(),u("fields",i.ticketOptionMetaDataAdd)}}function Ao(n,c){n&1&&(e(0,` 1001 `),o(1,"app-inline-alert",10),e(2,` 1002 This category has existing purchases. You may only edit the Purchase Limit and Available Tickets fields. To disable this category, set Available Tickets to 0. 1003 `),r(),e(3,` 1004 `))}function Vo(n,c){if(n&1){let i=k();e(0,` 1005 `),o(1,"app-dynamic-form",11),x("onSubmit",function(a){_(i);let l=d();return C(l.saveEditPriceCategory(a))})("onCancel",function(){_(i);let a=d();return C(a.showEditPriceCategoryDialog=!1)}),r(),e(2,` 1006 `)}if(n&2){let i=d();s(),u("fields",i.ticketOptionMetaDataEdit)("entity",i.editCategoryEntity)}}function Ro(n,c){if(n&1){let i=k();e(0,` 1007 `),v(1,"hr",12),e(2,` 1008 1009 `),o(3,"div"),e(4,` 1010 `),o(5,"strong",13),e(6,"Advanced Options"),r(),e(7,` 1011 `),o(8,"app-dynamic-form",14,0),x("onSubmit",function(a){_(i);let l=d();return C(l.savePricingAdvancedOptions(a))}),e(10,` 1012 `),o(11,"app-dynamic-form-field",15),x("onChange",function(a){_(i);let l=d();return C(l.onChangeClubAccountingClass(a))}),r(),e(12,` 1013 `),v(13,"app-dynamic-form-field",16),e(14,` 1014 `),r(),e(15,` 1015 `),r(),e(16,` 1016`)}if(n&2){let i=d();s(8),u("fields",i.ticketPricingAdvancedConfigurationMetaData)("entity",i.ticketPricingAdvancedOptions)("horizontalForm",!0)("showSubmitButton",!0)("showCancelButton",!1)("viewOnly",i.viewOnly)("contentFieldsMode",!0)("enableSavingOverlay",!1)}}var wi=(()=>{let c=class c{constructor(t,a,l,m,p){this.siteDataService=t,this.route=a,this.ticketService=l,this.formService=m,this.programService=p,this.readonlyPriceCategories=[],this.showAddPriceCategoryDialog=!1,this.showEditPriceCategoryDialog=!1,this.viewOnly=!1,this.editCategoryEntity=null,this.priceCategoriesWithCounts=[],this.surchargesOptionEnabled=!1}ngOnInit(){this.ticketSaleConfigurationID=+this.route.parent.snapshot.paramMap.get("ticketSaleConfigurationId"),j({meta:this.ticketService.getTicketEventInfoMetaData(),cfg:this.ticketService.getTicketSaleConfiguration(this.ticketSaleConfigurationID),categories:this.ticketService.getPriceCategoriesWithPurchaseCounts(this.ticketSaleConfigurationID),accountingClasses:this.programService.getClubAccountingClasses(),clubOptions:this.siteDataService.getClubOptions([re.ENABLE_SURCHARGES])}).subscribe(({meta:t,cfg:a,categories:l,accountingClasses:m,clubOptions:p})=>{this.ticketOptionsFields=t.ticketOptionMetaData.fields,this.ticketOptionMetaDataAdd=this.ticketOptionsFields.map(g=>L({},g)),this.ticketOptionMetaDataEdit=this.ticketOptionsFields.map(g=>L({},g)),this.ticketOptionMetaDataEdit.find(g=>g.controlName==="categoryName").viewOnly=!0,this.ticketOptionMetaDataEdit.find(g=>g.controlName==="basePrice").viewOnly=!0,this.ticketPricingAdvancedConfigurationMetaData=t.ticketPricingAdvancedConfiguration.fields,this.priceCategoriesWithCounts=l,this.readonlyPriceCategories=a.ticketPriceCategories||[],this.ticketPricingAdvancedOptions=a.ticketPricingAdvancedOptions||{},this.clubAccountingClasses=m,this.surchargesOptionEnabled=p.find(g=>g.optionID===re.ENABLE_SURCHARGES)?.boolValue===!0,this.updateSurchargeFieldValidation(this.ticketPricingAdvancedOptions?.clubAccountingClassID),this.viewOnly=this.ticketService.isEventViewOnly(a),this.siteDataService.hideSiteLoader()})}saveNewPriceCategory(t){this.ticketService.addPriceCategory(this.ticketSaleConfigurationID,t).subscribe({next:()=>{this.formService.hideFormLoader(),this.showAddPriceCategoryDialog=!1,this.ticketService.refreshConfiguration(this.ticketSaleConfigurationID).subscribe({next:a=>{this.readonlyPriceCategories=a.ticketPriceCategories||[]},error:a=>{this.siteDataService.showSiteErrorAlert(a.error?.message||"Could not refresh categories.")}})},error:a=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert(a.error?.message||"Could not add new category.")}})}deleteCategory(t){confirm("Are you sure you want to delete this price category?")&&this.ticketService.deletePriceCategory(this.ticketSaleConfigurationID,t.ticketPriceCategoryID).subscribe({next:()=>this.reloadCategories(),error:a=>{this.siteDataService.showSiteErrorAlert(a.error?.message||"Could not delete category.")}})}reloadCategories(){this.ticketService.refreshConfiguration(this.ticketSaleConfigurationID).subscribe(t=>{this.readonlyPriceCategories=t.ticketPriceCategories||[]})}openEditCategory(t){this.editCategoryEntity=L({},t);let a=this.priceCategoriesWithCounts.find(m=>m.item1.ticketPriceCategoryID===t.ticketPriceCategoryID),l=a?a.item2:0;this.showEditPriceCategoryDialog=!0,this.ticketOptionMetaDataEdit&&this.ticketOptionMetaDataEdit.forEach(m=>{["categoryName","basePrice"].includes(m.controlName)&&(m.viewOnly=l>0)})}openAddCategoryDialog(){this.showAddPriceCategoryDialog=!0}saveEditPriceCategory(t){t.ticketPriceCategoryID=this.editCategoryEntity.ticketPriceCategoryID,t.categoryName||(t.categoryName=this.editCategoryEntity.categoryName),(t.basePrice===null||t.basePrice===void 0)&&(t.basePrice=this.editCategoryEntity.basePrice),this.ticketService.editPriceCategory(this.ticketSaleConfigurationID,t).subscribe({next:()=>{this.formService.hideFormLoader(),this.showEditPriceCategoryDialog=!1,this.editCategoryEntity=null,this.ticketService.refreshConfiguration(this.ticketSaleConfigurationID).subscribe({next:a=>{this.readonlyPriceCategories=a.ticketPriceCategories||[]},error:a=>{this.siteDataService.showSiteErrorAlert(a.error?.message||"Could not refresh categories.")}})},error:a=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert(a.error?.message||"Could not save changes to category.")}})}isEditCategoryLocked(){if(!this.editCategoryEntity||!this.priceCategoriesWithCounts.length)return!1;let t=this.priceCategoriesWithCounts.find(a=>a.item1.ticketPriceCategoryID===this.editCategoryEntity.ticketPriceCategoryID);return t?t.item2>0:!1}getPurchaseCount(t){let a=this.priceCategoriesWithCounts.find(l=>l.item1.ticketPriceCategoryID===t);return a?a.item2:0}onChangeClubAccountingClass(t){this.updateSurchargeFieldValidation(t)}updateSurchargeFieldValidation(t){let a=this.ticketPricingAdvancedConfigurationMetaData?.find(p=>p.controlName==="clubSurchargeID");if(!a)return;let l=!!t&&this.clubAccountingClasses?.some(p=>p.clubAccountingClassID===t&&p.assignments.some(g=>g.isSurchargeRequired)),m=this.surchargesOptionEnabled||l;if(a.hidden=!m,l){if(a.validators.some(p=>p.validatorType===Y.REQUIRED)===!1&&a.validators.push({validatorType:Y.REQUIRED}),a.required=!0,a.options?.length===1){let p=a.options[0].value;this.ticketPricingAdvancedOptions.clubSurchargeID=p,this.form?.form.patchValue({clubSurchargeID:p})}}else a.required=!1,a.validators=a.validators.filter(p=>p.validatorType!==Y.REQUIRED);m||(this.ticketPricingAdvancedOptions.clubSurchargeID=null,this.form?.form.patchValue({clubSurchargeID:null})),this.ticketPricingAdvancedConfigurationMetaData=[...this.ticketPricingAdvancedConfigurationMetaData]}savePricingAdvancedOptions(t){this.ticketService.updatePricingAdvancedOptions(this.ticketSaleConfigurationID,t).subscribe({next:()=>{this.formService.hideFormLoader(),this.siteDataService.showSiteSuccessAlert("Advanced options updated successfully.")},error:a=>{this.formService.hideFormLoader(),this.siteDataService.showSiteErrorAlert(a.error?.message||"Could not save changes to advanced options.")}})}};c.\u0275fac=function(a){return new(a||c)(S(M),S(O),S(V),S(ie),S(Ze))},c.\u0275cmp=R({type:c,selectors:[["app-event-pricing-settings"]],viewQuery:function(a,l){if(a&1&&J(wo,5),a&2){let m;Q(m=W())&&(l.form=m.first)}},standalone:!1,decls:20,vars:13,consts:[["advancedOptionsForm",""],[3,"value"],["pTemplate","header"],["pTemplate","body"],[1,"btn","btn-outline-primary","mt-3",3,"click","disabled"],["header","Add Price Category","styleClass","standardWidthDialog",3,"visibleChange","onHide","visible","modal","closable"],["header","Edit Price Category","styleClass","standardWidthDialog",3,"visibleChange","onHide","visible","modal","closable"],["title","Edit",1,"btn","btn-naked","btn-icon-pencil","mr-2",3,"click","disabled"],["title","Delete",1,"btn","btn-naked","btn-icon-trash",3,"click","disabled"],[3,"onSubmit","onCancel","fields"],["alertType","info"],[3,"onSubmit","onCancel","fields","entity"],[1,"my-4"],[1,"d-block","mb-3"],["submitButtonText","Save Advanced Options",3,"onSubmit","fields","entity","horizontalForm","showSubmitButton","showCancelButton","viewOnly","contentFieldsMode","enableSavingOverlay"],["fieldName","clubAccountingClassID",3,"onChange"],["fieldName","clubSurchargeID"]],template:function(a,l){a&1&&(o(0,"p-table",1),e(1,` 1017 `),E(2,Io,21,0,"ng-template",2),e(3,` 1018 `),E(4,Po,27,9,"ng-template",3),e(5,` 1019`),r(),e(6,` 1020`),o(7,"button",4),x("click",function(){return l.openAddCategoryDialog()}),e(8,`Add Price 1021Category`),r(),e(9,` 1022 1023`),o(10,"p-dialog",5),D("visibleChange",function(p){return w(l.showAddPriceCategoryDialog,p)||(l.showAddPriceCategoryDialog=p),p}),x("onHide",function(){return l.showAddPriceCategoryDialog=!1}),e(11,` 1024 `),f(12,Fo,3,1),r(),e(13,` 1025 1026`),o(14,"p-dialog",6),D("visibleChange",function(p){return w(l.showEditPriceCategoryDialog,p)||(l.showEditPriceCategoryDialog=p),p}),x("onHide",function(){return l.showEditPriceCategoryDialog=!1}),e(15,` 1027 `),f(16,Ao,4,0),f(17,Vo,3,2),r(),e(18,` 1028 1029`),f(19,Ro,17,8)),a&2&&(u("value",l.readonlyPriceCategories),s(7),u("disabled",l.viewOnly),s(3),T("visible",l.showAddPriceCategoryDialog),u("modal",!0)("closable",!0),s(2),h(l.ticketOptionMetaDataAdd&&l.showAddPriceCategoryDialog?12:-1),s(2),T("visible",l.showEditPriceCategoryDialog),u("modal",!0)("closable",!0),s(2),h(l.editCategoryEntity&&l.priceCategoriesWithCounts.length&&l.isEditCategoryLocked()?16:-1),s(),h(l.ticketOptionMetaDataEdit&&l.showEditPriceCategoryDialog?17:-1),s(2),h(l.ticketPricingAdvancedConfigurationMetaData!=null&&l.ticketPricingAdvancedConfigurationMetaData.some(Re(12,Do,l))?19:-1))},dependencies:[ne,he,X,ee,fe,z,ue],encapsulation:2});let n=c;return n})();function Mo(n,c){n&1&&(e(0,` 1030 `),o(1,"tr"),e(2,` 1031 `),o(3,"th"),e(4,"Question"),r(),e(5,` 1032 `),v(6,"th"),e(7,` 1033 `),r(),e(8,` 1034 `))}function Lo(n,c){if(n&1){let i=k();e(0,` 1035 `),o(1,"tr"),e(2,` 1036 `),o(3,"td"),e(4),r(),e(5,` 1037 `),o(6,"td"),e(7,` 1038 `),o(8,"button",5),x("click",function(){let a=_(i).$implicit,l=d();return C(l.deleteQuestion(a))}),r(),e(9,` 1039 `),r(),e(10,` 1040 `),r(),e(11,` 1041 `)}if(n&2){let i=c.$implicit,t=d();s(4),y(i.label),s(4),u("disabled",t.viewOnly)}}function No(n,c){if(n&1){let i=k();e(0,` 1042 `),o(1,"app-dynamic-form",6),x("onSubmit",function(a){_(i);let l=d();return C(l.saveNewQuestion(a))})("onCancel",function(){_(i);let a=d();return C(a.showAddQuestionDialog=!1)}),r(),e(2,` 1043 `)}if(n&2){let i=d();s(),u("fields",i.questionMetaData)("modalContent",!0)}}var Di=(()=>{let c=class c{constructor(t,a,l){this.siteDataService=t,this.route=a,this.ticketService=l,this.readonlyQuestions=[],this.showAddQuestionDialog=!1,this.viewOnly=!1}ngOnInit(){this.ticketSaleConfigurationID=+this.route.parent.snapshot.paramMap.get("ticketSaleConfigurationId"),j({meta:this.ticketService.getTicketEventInfoMetaData(),cfg:this.ticketService.getTicketSaleConfiguration(this.ticketSaleConfigurationID)}).subscribe(({meta:t,cfg:a})=>{this.questionMetaData=t.questionMetaData.fields,this.readonlyQuestions=a.ticketSaleConfigurationQuestions||[],this.viewOnly=this.ticketService.isEventViewOnly(a),this.siteDataService.hide
1043SiteLoader()})}saveNewQuestion(t){this.ticketService.addQuestion(this.ticketSaleConfigurationID,t).subscribe(()=>{this.showAddQuestionDialog=!1,this.ticketService.refreshConfiguration(this.ticketSaleConfigurationID).subscribe(a=>{this.readonlyQuestions=a.ticketSaleConfigurationQuestions||[]})})}deleteQuestion(t){confirm("Are you sure you want to delete this question?")&&this.ticketService.deleteQuestion(this.ticketSaleConfigurationID,t.ticketSaleConfigurationQuestionID).subscribe({next:()=>this.reloadQuestions(),error:a=>{this.siteDataService.showSiteErrorAlert(a.error?.message||"Could not delete question.")}})}reloadQuestions(){this.ticketService.refreshConfiguration(this.ticketSaleConfigurationID).subscribe(t=>{this.readonlyQuestions=t.ticketSaleConfigurationQuestions||[]})}};c.\u0275fac=function(a){return new(a||c)(S(M),S(O),S(V))},c.\u0275cmp=R({type:c,selectors:[["app-event-questions-settings"]],standalone:!1,decls:14,vars:6,consts:[[3,"value"],["pTemplate","header"],["pTemplate","body"],[1,"btn","btn-outline-primary","mt-3",3,"click","disabled"],["header","Add Question","styleClass","shortWidthDialog",3,"visibleChange","onHide","visible","modal","closable"],["title","Delete",1,"btn","btn-naked","btn-icon-trash",3,"click","disabled"],[3,"onSubmit","onCancel","fields","modalContent"]],template:function(a,l){a&1&&(o(0,"p-table",0),e(1,` 1044 `),E(2,Mo,9,0,"ng-template",1),e(3,` 1045 `),E(4,Lo,12,2,"ng-template",2),e(5,` 1046`),r(),e(6,` 1047`),o(7,"button",3),x("click",function(){return l.showAddQuestionDialog=!0}),e(8,"Add Question"),r(),e(9,` 1048`),o(10,"p-dialog",4),D("visibleChange",function(p){return w(l.showAddQuestionDialog,p)||(l.showAddQuestionDialog=p),p}),x("onHide",function(){return l.showAddQuestionDialog=!1}),e(11,` 1049 `),f(12,No,3,2),r(),e(13,` 1050`)),a&2&&(u("value",l.readonlyQuestions),s(7),u("disabled",l.viewOnly),s(3),T("visible",l.showAddQuestionDialog),u("modal",!0)("closable",!0),s(2),h(l.questionMetaData&&l.showAddQuestionDialog?12:-1))},dependencies:[ne,X,fe,z],encapsulation:2});let n=c;return n})();var Ii=(()=>{let c=class c{};c.\u0275fac=function(a){return new(a||c)},c.\u0275mod=Ve({type:c}),c.\u0275inj=Ae({imports:[at.forChild([{path:"",component:xi,canActivateChild:[te],data:{metaTitle:"Tickets"}},{path:"create",component:Si,canActivateChild:[te],data:{metaTitle:"Create Ticket Event"}},{path:"validate/:ticketId",component:ki,canActivateChild:[te,Mt],data:{permissions:[It.TicketRedemption],metaTitle:"Ticket Validation"}},{path:"manage/:ticketSaleConfigurationId",component:bi,canActivateChild:[te],data:{metaTitle:"Manage Ticket Event"},children:[{path:"",component:yi,canActivateChild:[te],data:{hideViewOnly:!0,metaTitle:"Purchases"}},{path:"settings",component:Ti,canActivateChild:[te],data:{metaTitle:"Settings"}},{path:"event-page",component:Ei,canActivateChild:[te],data:{metaTitle:"Ticket Sale Event Page"}},{path:"event-pricing",component:wi,canActivateChild:[te],data:{metaTitle:"Event Pricing"}},{path:"event-questions",component:Di,canActivateChild:[te],data:{metaTitle:"Event Questions"}}]}]),at]});let n=c;return n})();var bc=(()=>{let c=class c{};c.\u0275fac=function(a){return new(a||c)},c.\u0275mod=Ve({type:c}),c.\u0275inj=Ae({providers:[V],imports:[Zt,Ht,Ii,Qt,ii,ti,ui,hi,ni]});let n=c;return n})();export{bc as TicketSaleAdminModule};
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.