PageSourceSearch

https://londoncoliseum.org/wp-content/cache/min/1/stable/spektrix-component-loader.js?ver=1788252668

js londoncoliseum.org collected 2026-10-02 11:35:57 UTC 33,840 bytes, 1 lines download raw bytes

1function $b04e92688974728d$var$submitRequest(t,e,i,a){let s={credentials:"include",headers:{"Content-type":"application/json; charset=UTF-8"},method:e.toUpperCase()};return i&&(s.body=JSON.stringify(i)),fetch(`${$b04e92688974728d$var$http.protocol()}${t}/api/v3/${a}`,s)}async function $b04e92688974728d$var$fetchJsonFromApi(t,e,i){function clientSystemUrlBuilder(t,e){return`${t||"system.spektrix.com"}/${e}`}let a=await $b04e92688974728d$var$submitRequest(clientSystemUrlBuilder(t,e),"get",null,i);return a?await a.json():null}let $b04e92688974728d$var$http={submitRequest:$b04e92688974728d$var$submitRequest,protocol:function $b04e92688974728d$var$protocol(){return"https://"},fetchJsonFromApi:$b04e92688974728d$var$fetchJsonFromApi};let $d30e2434767de841$var$SpektrixElementClass=class $d30e2434767de841$var$SpektrixElementClass extends HTMLElement{constructor(){super(),new MutationObserver(t=>{for(let e of t)"attributes"===e.type&&"disabled"===e.attributeName&&this._handleDisabledAttributeChange(e.target)}).observe(this,{attributes:!0,childList:!1,subtree:!0})}_handleDisabledAttributeChange(t){this.customInputsMapping&&Object.keys(this.customInputsMapping).forEach(e=>{let i=this.customInputsMapping[e].attribute;t.hasAttribute(i)&&(t.disabled?this["_"+e]=this.customInputsMapping[e].initialValue:this[e]=this._getElementValue(t))})}_getElementValue(t){return"checkbox"===t.type?t.checked:t.value}_setPropertyIfChanged(t,e,i){let a="_"+t;return this[a]!==e&&typeof e===i&&(this[a]=e,!0)}set customDomain(t){this._setPropertyIfChanged("customDomain",t,"string")}get customDomain(){return this._customDomain||null}clientSystemUrlBuilder(t=this.customDomain){return`${t||"system.spektrix.com"}/${this.clientName}`}set clientName(t){this._setPropertyIfChanged("clientName",t,"string")}get clientName(){return this._clientName||null}_customInputHandler(t,e){let i=-1!=navigator.userAgent.indexOf("Safari")&&-1==navigator.userAgent.indexOf("Chrome");this.querySelector(`[${t}][type="checkbox"]`)&&i?this.addEventListener("change",i=>{this._handleEventTarget(i,t,e)}):this.addEventListener("input",i=>{this._handleEventTarget(i,t,e)})}_handleEventTarget(t,e,i){let a=t.target.closest(`[${e}]`);a&&i(a)}sync(){this.customInputsMapping&&this._syncInputValuesToProps(this.customInputsMapping)}_syncInputValuesToProps(t){Object.keys(t).forEach(e=>{let i=t[e].attribute,a=this.querySelectorAll("["+i+"]"),s=this._returnFirstNonDisabledIntendedElementValue(a);void 0!==s&&(this[e]=s)})}_returnFirstNonDisabledIntendedElementValue(t){for(let e of t)if(!e.disabled)return this._getElementValue(e)}_setUpBasketUpdate(){this._registerNewWebComponentsSuccessHandler()}_registerNewWebComponentsSuccessHandler(){this.addEventListener("success",function(){document.querySelectorAll("spektrix-basket-summary").forEach(async t=>await t._updateDisplay(!0))})}_showElement(t){t.style.display="block"}_hideElement(t){t.style.display="none"}_showLoadingState(){let t=this.querySelectorAll("[data-loading-container]"),e=this.querySelectorAll("[data-loaded-container]");for(let e of t)this._showElement(e),e.setAttribute("aria-busy","true"),e.setAttribute("role","status");for(let t of e)this._hideElement(t)}_showLoadedState(){let t=this.querySelectorAll("[data-loading-container]"),e=this.querySelectorAll("[data-loaded-container]");for(let e of t)this._hideElement(e),e.setAttribute("aria-busy","false");for(let t of e)this._showElement(t)}_updateTextContent(t,e){this.querySelectorAll(`[${t}]`).forEach(t=>{t.textContent=e})}_toggleElementsDisplay(t,e,i){let a=this.querySelectorAll(t),s=this.querySelectorAll(e);if(i){for(let t of a)this._showElement(t);for(let t of s)this._hideElement(t)}else{for(let t of a)this._hideElement(t);for(let t of s)this._showElement(t)}}_handleSuccessResponse(t){let e=new CustomEvent("success",{detail:t});this.dispatchEvent(e),this.forwardTo&&(globalThis.location.href=this.forwardTo),this.querySelectorAll("[data-success-container]").forEach(t=>this._showElement(t))}_handleFailureResponse(t){let e=new CustomEvent("fail",{detail:t});this.dispatchEvent(e);let i=this.querySelectorAll("[data-fail-container]");
1if(t instanceof Error){console.error(t),i.forEach(t=>this._showElement(t));return}let a=Object.prototype.hasOwnProperty.call(t,"message")?t.message:"",s=document.createDocumentFragment(),r=document.createElement("span");if(r.textContent=a,s.appendChild(r),t.problems)if(t.problems.length>1)s.appendChild(document.createElement("br")),t.problems.forEach(t=>{let e=document.createElement("span");e.textContent=t,s.appendChild(e),s.appendChild(document.createElement("br"))});else{let e=document.createElement("span");e.textContent=" "+t.problems.toString(),s.appendChild(e)}if(i.length>0)for(let t of i){let e=t.querySelector("[data-fail-message]");for(e||((e=document.createElement("div")).setAttribute("data-fail-message",""),t.appendChild(e));e.firstChild;)e.removeChild(e.firstChild);e.appendChild(s.cloneNode(!0)),this._showElement(t)}}async _makeApiRequest(t,e,i){try{let a=await $b04e92688974728d$var$http.submitRequest(this.clientSystemUrlBuilder(),e.toLowerCase(),i,t);if(a.ok){let t=await a.json();return this._handleSuccessResponse(t),t}{let t=await a.json();this._handleFailureResponse(t)}}catch(t){this._handleFailureResponse(t)}}attributeChangedCallback(t,e,i){let a=t.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()});if(""===i){this[a]=!0;return}e!==i&&(this[a]=i)}_createClickHandler(t){return e=>{for(let[i,a]of Object.entries(t)){let t=e.target.closest(`[${i}]`);if(t){let e=t.getAttribute(i);null!==e&&""!==e?a.call(this,e):a.call(this);return}}}}_createPropertyDescriptor(t,e,i,a){let s="_"+t;return{get:function(){return void 0!==this[s]?this[s]:i},set:function(t){if(this[s]===t)return;let i=t;if("number"===e)i=Number(t);else if("boolean"===e)i="false"!==String(t).toLowerCase()&&!!t;else if("string"===e&&"string"!=typeof t)return;this[s]=i,a&&"function"==typeof a&&a.call(this,i)},enumerable:!0,configurable:!0}}_registerCustomInputHandlers(t){t&&Object.entries(t).forEach(([t,e])=>{let i=e.attribute;this._customInputHandler(i,e=>{if("checkbox"===e.type){this[t]=e.checked;return}this[t]=e.value})})}_initializeComponent(t={}){globalThis.requestAnimationFrame(()=>{this.isConnected&&this._performInitialization(t)})}async _performInitialization(t){this._setUpBasketUpdate(),this.customInputsMapping&&this._registerCustomInputHandlers(this.customInputsMapping),t.clickHandlerMap&&this.addEventListener("click",this._createClickHandler(t.clickHandlerMap)),t.displayFunction&&await t.displayFunction.call(this),this.customInputsMapping&&this._syncInputValuesToProps(this.customInputsMapping)}_logError(t,e){console.error(`[${this.constructor.name}] Error in ${e}:`,t)}};var $d30e2434767de841$export$2e2bcd8739ae039=$d30e2434767de841$var$SpektrixElementClass,t=function $0af6a38c0b6f5363$var$get(t,e=3e4){function isExpired(t,e=3e4){return!t||t.timestamp+e<=new Date().getTime()}let i=JSON.parse(localStorage.getItem(t));return isExpired(i,e)?(localStorage.removeItem(t),null):i.data},e=function $0af6a38c0b6f5363$var$upsert(t,e){let i={data:e,timestamp:new Date().getTime()};localStorage.setItem(t,JSON.stringify(i))},i=function $0af6a38c0b6f5363$var$remove(t){localStorage.removeItem(t)};let $efb01c8f2309df1f$var$endpoints=Object.freeze({basket:{key:"spektrixBasket",path:"basket?$expand=customer,ticketSubscriptions,merchandiseItems/stockItem,donations/fund,tickets/band,tickets/event,tickets/instance,tickets/offer,tickets/type,membershipSubscriptions/membership,giftVouchers",expiryInMilliseconds:3e4},customer:{key:"spektrixCustomer",path:"customer",expiryInMilliseconds:3e4},clientConstants:{key:"spektrixClientConstants",path:"webcomponents/json",expiryInMilliseconds:432e5},clientConfig:{key:"spektrixClientConfig",path:"system/config",expiryInMilliseconds:432e5},memberships:{key:"spektrixMemberships",path:"memberships",expiryInMilliseconds:3e5}}),$efb01c8f2309df1f$var$pendingRequests=new Map;async function $efb01c8f2309df1f$var$getData(i,a,s){let r=t(s.key,s.expiryInMilliseconds);if(r)return r;let n=$efb01c8f2309df1f$var$pendingRequests.get(s.key);if(n)return n;let o=(async()=>{try{let t=await $b04e92688974728d$var$http.fetchJsonFromApi(i,a,s.path);return t&&e(s.key,t),t}finally{$efb01c8f2309df1f$var$pendingRequests.delete(s.key)}})();return $efb01c8f2309df1f$var$pendingRequests.set(s.key,o),o}var a=$efb01c8f2309df1f$var$getData,s=function $efb01c8f2309df1f$var$clearCache(t){i(t.key)};let $33b432bda61bd7bb$var$STORAGE_KEY="spektrixDDCartCycleId",$33b432bda61bd7bb$var$inMemoryFallback=null;function $33b432bda61bd7bb$var$generateId(){return void 0!==globalThis.crypto&&"function"==typeof globalThis.crypto.randomUUID?globalThis.crypto.randomUUID():Date.now().toString(36)+Math.random().toString(36).slice(2)}function $33b432bda61bd7bb$var$readFromStorage(){try{let t=localStorage.getItem($33b432bda61bd7bb$var$STORAGE_KEY);return t?JSON.parse(t):null}catch{return null}}function $33b432bda61bd7bb$var$writeToStorage(t){try{localStorage.setItem($33b432bda61bd7bb$var$STORAGE_KEY,JSON.stringify(t))}catch{}}function $33b432bda61bd7bb$var$removeFromStorage(){try{localStorage.removeItem($33b432bda61bd7bb$var$STORAGE_KEY)}catch{}}function $33b432bda61bd7bb$var$isExpired(t,e=2592e5){return!t||Date.now()-t.timestamp>=e}var r=function $33b432bda61bd7bb$var$getOrCreateId(t){let e=$33b432bda61bd7bb$var$readFromStorage()||$33b432bda61bd7bb$var$inMemoryFallback;return $33b432bda61bd7bb$var$inMemoryFallback=e=$33b432bda61bd7bb$var$isExpired(e,t)?{id:$33b432bda61bd7bb$var$generateId(),timestamp:Date.now()}:{...e,timestamp:Date.now()},$33b432bda61bd7bb$var$writeToStorage(e),e.id},n=function $33b432bda61bd7bb$var$getId(t){let e=$33b432bda61bd7bb$var$readFromStorage()||$33b432bda61bd7bb$var$inMemoryFallback;
1return $33b432bda61bd7bb$var$isExpired(e,t)?null:e.id},o=function $33b432bda61bd7bb$var$completeCycle(){$33b432bda61bd7bb$var$inMemoryFallback=null,$33b432bda61bd7bb$var$removeFromStorage()};let $f8988dfa5d0e49b9$var$spektrixbasketSummary=class $f8988dfa5d0e49b9$var$spektrixbasketSummary extends $d30e2434767de841$export$2e2bcd8739ae039{constructor(){super(),Object.defineProperties(this,{analyticsActive:this._createPropertyDescriptor("analyticsActive","boolean",!1),ddBasketInsightsActive:this._createPropertyDescriptor("ddBasketInsightsActive","boolean",!1),ddBasketInsightsCartUrl:this._createPropertyDescriptor("ddBasketInsightsCartUrl","string",""),ddBasketInsightsMaxAge:this._createPropertyDescriptor("ddBasketInsightsMaxAge","number",2592e5)}),this._lastPushedUserId=void 0,this._lastDDBasketHash=void 0,this._lastDDIdentifyEmail=void 0,this._lastDDCartPayload=null}static get observedAttributes(){return["client-name","custom-domain","analytics-active","dd-basket-insights-active","dd-basket-insights-cart-url","dd-basket-insights-max-age"]}async connectedCallback(){window.addEventListener("message",this._handleIframeMessage.bind(this)),await this._updateDisplay()}async _updateDisplay(e=!1){this._showLoadingState();let i=this.analyticsActive?t($efb01c8f2309df1f$var$endpoints.basket.key,$efb01c8f2309df1f$var$endpoints.basket.expiryInMilliseconds):null;e&&s($efb01c8f2309df1f$var$endpoints.basket);let r=await a(this.customDomain,this.clientName,$efb01c8f2309df1f$var$endpoints.basket),n=await a(this.customDomain,this.clientName,$efb01c8f2309df1f$var$endpoints.clientConstants);await this._processAnalytics(i,r);let o=this._getCount(r);this._updateTextContent("data-basket-item-count",o),this.setAttribute("count",o),this._updateTextContent("data-basket-summary-currency",n.currencyChar);let d=this._getTotal(r,o).toFixed(n.currencyDecimalPlaces);this._updateTextContent("data-basket-summary-basket-total",d),this.setAttribute("total",d);let l=this._getTotalDiscount(r,o).toFixed(n.currencyDecimalPlaces);this._updateTextContent("data-basket-summary-discount-total",l),this.setAttribute("discount",l),this._showLoadedState()}async _processAnalytics(t,e){if(!this.analyticsActive&&!this.ddBasketInsightsActive)return;let i=this._buildItemTypeAnalytics();try{let s=await a(this.customDomain,this.clientName,$efb01c8f2309df1f$var$endpoints.clientConfig);this.analyticsActive&&(this._pushCustomerId(e.customer),this._parseBasketDiff(t,e,s,i)),this.ddBasketInsightsActive&&(this._pushDDIdentify(e.customer),this._processDotDigitalBasketInsights(t,e,s,i))}catch(t){this._logError("Error processing analytics data for basket summary",{error:t})}}_pushDDIdentify(t){let e=t?.email||null;e===this._lastDDIdentifyEmail||void 0===this._lastDDIdentifyEmail&&!e||(this._lastDDIdentifyEmail=e,e&&this._pushToDataLayer({event:"spektrix.ddIdentify",spektrixDD:{email:t.email,firstName:t?.firstName,lastName:t?.lastName,mobileNumber:t.mobile||""}}))}_processDotDigitalBasketInsights(t,e,i,a){let s=this._getCount(e);if(0===s)return;let n=this._hashBasket(e);if(n===this._lastDDBasketHash)return;this._lastDDBasketHash=n;let o=this._mapBasketItemsForDotDigital(e,a),d=this._condenseItems(o,"sku","unitPrice","totalPrice"),l={cartId:r(this.ddBasketInsightsMaxAge),currency:i.currency,subtotal:this._getTotal(e,s),grandTotal:this._getTotal(e,s)-this._getTotalDiscount(e,s),cartUrl:this.ddBasketInsightsCartUrl,products:d};
1this._pushToDataLayer({event:"spektrix.ddCartUpdate",spektrixDD:l}),this._lastDDCartPayload=l}_getCount(t){return t?this._getItems(t,"tickets").length+this._getItems(t,"donations").length+this._getItems(t,"giftVouchers").length+this._getItems(t,"merchandiseItems").length+this._getItems(t,"membershipSubscriptions").filter(t=>!t.relatedDonationId).length:0}_getItems(t,e){if(!t)return[];let i=t[e];return i||[]}_getTotal(t,e){if(!t||0===e)return 0;let i=t.total;return i||0}_getTotalDiscount(t,e){if(!t||0===e)return 0;let i=t.totalDiscount;return i||0}_parseBasketDiff(t,e,i,a){if(!e||!t||this._hashBasket(t)===this._hashBasket(e))return;let{added:s,removed:r}=this._diffBasketItems(t,e,a);s=this._condenseItems(s),r=this._condenseItems(r),s.length>0&&this._pushToDataLayer({event:"add_to_cart",ecommerce:{currency:i.currency,value:s.reduce((t,e)=>t+e.price*e.quantity,0),items:s}}),r.length>0&&this._pushToDataLayer({event:"remove_from_cart",ecommerce:{currency:i.currency,value:r.reduce((t,e)=>t+e.price*e.quantity,0),items:r}})}_pushCustomerId(t){let e=t?.id||null;e===this._lastPushedUserId||(void 0!==this._lastPushedUserId||e)&&(this._lastPushedUserId=e,this._pushToDataLayer({user_id:e}))}_hashBasket(t){let e=[...this._buildItemTypeAnalytics().map(t=>t.key)].flatMap(e=>(t?.[e]??[]).map(t=>t.id)).join("|");return`${t?.customer?.id??""}:${e}:${t?.total??0}`}_buildItemTypeAnalytics(){return[{key:"merchandiseItems",buildAnalyticsData:t=>t.map(t=>({item_id:`M${this._getAnalyticsItemId(t.stockItem.id)}-P${this._getAnalyticsItemPrice(t.price)}`,item_name:t.stockItem.name,item_category:"Merchandise",price:t.price,quantity:1,discount:t.discount})),buildDotDigitalBasketInsightData:t=>t.filter(t=>t.stockItem?.attribute_IncludeInAbandonedEmail).map(t=>({sku:`${this._getAnalyticsItemId(t.stockItem.id)}_merchandise`,productId:t.stockItem.name,name:t.stockItem.name,description:t.stockItem.description,categories:["Merchandise"],unitPrice:t.price,quantity:1,imageUrl:t.stockItem.imageUrl,productUrl:"null"}))},{key:"donations",buildAnalyticsData:t=>t.map(t=>({item_id:`D${this._getAnalyticsItemId(t.fund.id)}`,item_name:`Donation to ${t.fund.name}`,item_category:"Donations",price:t.amount,quantity:1,discount:0}))},{key:"tickets",buildAnalyticsData:t=>t.map(t=>{let e=this._getAnalyticsItemId(t.event.id),i=this._getAnalyticsItemId(t.instance.id),a=this._getAnalyticsItemId(t.type.id),s=this._getAnalyticsItemPrice(t.price),r=t.offer?this._getAnalyticsItemId(t.offer.id):"";return{item_id:`T${e}I${i}-${a}P${s}${r?`-O${r}`:""}`,item_name:t.event.name,item_category:"Tickets",item_category2:t.band.name,item_category3:t.type.name,item_variant:new Date(t.instance.start).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),price:t.price,quantity:1,coupon:t.offer?t.offer.name:void 0,discount:t.discount}}),buildDotDigitalBasketInsightData:t=>t.filter(t=>t.event?.attribute_IncludeInAbandonedEmail).map(t=>{let e=`${this._getAnalyticsItemId(t.event.id)}_event`;return{sku:e,productId:e,name:t.event.name,description:t.event.description,categories:["Ticket"],unitPrice:t.total,quantity:1,imageUrl:t.event.imageUrl,productUrl:"null"}})},{key:"membershipSubscriptions",buildAnalyticsData:t=>t.map(t=>{let e=t.isRenewal?"Renewal":"New";return{item_id:`S${this._getAnalyticsItemId(t.membership.id)}-${e}`,item_name:t.membership.name,item_category:`Memberships (${e})`,price:t.price,quantity:1,discount:t.discount}})},{key:"giftVouchers",buildAnalyticsData:t=>t.map(t=>({item_id:"G",item_name:"Gift Vouchers",item_category:"Gift Vouchers",price:t.amount,quantity:1,discount:0}))}]}_diffBasketItems(t,e,i){let a=[],s=[];for(let r of i){let i=t?.[r.key]??[],n=e?.[r.key]??[],o=new Set(i.map(t=>t.id)),d=new Set(n.map(t=>t.id)),l=n.filter(t=>!o.has(t.id)),u=i.filter(t=>!d.has(t.id));l.length&&a.push(...r.buildAnalyticsData(l)),u.length&&s.push(...r.buildAnalyticsData(u))}return{added:a,removed:s}}_mapBasketItemsForDotDigital(t,e){let i=[];for(let a of e)if(a.buildDotDigitalBasketInsightData){let e=t?.[a.key]??[];i.push(...a.buildDotDigitalBasketInsightData(e))}return i}_condenseItems(t,e="item_id",i="price",a){let s=new Map;for(let r of t){let t=`${r[e]}|${r[i]}`,n=s.get(t);if(n)n.quantity+=r.quantity,a&&(n[a]+=r[i]);else{let e={...r};a&&(e[a]=r[i]),s.set(t,e)}}return[...s.values()]}_getAnalyticsItemId(t){return t?.match(/^\d+/)?.[0]??""}_getAnalyticsItemPrice(t){return String(Math.round(100*t))}_pushToDataLayer(t){globalThis.dataLayer=globalThis.dataLayer||[];let e=globalThis.dataLayer;e.push({ecommerce:null,spektrixDD:null}),e.push(t)}async _handleIframeMessage(t){let i=t.origin||t.originalEvent.origin,a=this.customDomain?this.customDomain:"system.spektrix.com";if(i===`https://${a}`&&("string"!=typeof t.data||0!==t.data.indexOf("basketHash:"))){if(t.data?.orderConfirmed&&this.ddBasketInsightsActive&&(n(this.ddBasketInsightsMaxAge)&&this._lastDDCartPayload&&this._pushToDataLayer({event:"spektrix.ddPurchaseComplete",spektr
1ixDD:{...this._lastDDCartPayload,orderId:t.data.transactionId||null}}),o(),this._lastDDCartPayload=null),this.analyticsActive||this.ddBasketInsightsActive||"string"==typeof t.data&&"basketUpdated"===t.data)return void await this._updateDisplay(!0);if("string"==typeof t.data&&0===t.data.indexOf("basketContents:")){let i=t.data.substring(15);e($efb01c8f2309df1f$var$endpoints.basket.key,JSON.parse(i))}await this._updateDisplay()}}};window.customElements.define("spektrix-basket-summary",$f8988dfa5d0e49b9$var$spektrixbasketSummary);let $8afdebd39323dd56$var$spektrixDonate=class $8afdebd39323dd56$var$spektrixDonate extends $d30e2434767de841$export$2e2bcd8739ae039{constructor(){super(),this.customInputsMapping={donationAmount:{attribute:"data-custom-donation-input",initialValue:0},recognitionName:{attribute:"data-recognition-name",initialValue:void 0},isAnonymous:{attribute:"data-is-anonymous",initialValue:!1},tributeTypeId:{attribute:"data-tribute-type",initialValue:void 0},tributeName:{attribute:"data-tribute-name",initialValue:void 0}},this._syncInputValuesToProps(this.customInputsMapping),Object.defineProperties(this,{forwardTo:this._createPropertyDescriptor("forwardTo","string",null),fundId:this._createPropertyDescriptor("fundId","string",null),cumulativeMode:this._createPropertyDescriptor("cumulativeMode","boolean",!1),donationAmount:this._createPropertyDescriptor("donationAmount","number",0,function(t){this._donationAmountChanged(t)}),recognitionName:this._createPropertyDescriptor("recognitionName","string",void 0),isAnonymous:this._createPropertyDescriptor("isAnonymous","boolean",!1),tributeTypeId:this._createPropertyDescriptor("tributeTypeId","string",void 0),tributeName:this._createPropertyDescriptor("tributeName","string",void 0)})}connectedCallback(){this._initializeComponent({displayFunction:this._displayDonationAmount,clickHandlerMap:{"data-donate-amount":t=>this.updateDonationTotal(t),"data-submit-donation":()=>this.postDonation(this.donationAmount),"data-clear-donation":()=>this.clearDonationTotal()}})}async postDonation(t){if(t>0){let e={amount:t,fundId:this.fundId,isAnonymous:this.isAnonymous};return this.recognitionName&&!this.isAnonymous&&(e.recognitionName=this.recognitionName),this.tributeName&&(e.tributeTypeId=this.tributeTypeId,e.tributeName=this.tributeName),await this._makeApiRequest("basket/donations","post",[e])}}updateDonationTotal(t){this.cumulativeMode?this.donationAmount+=Number(t):this.donationAmount=Number(t)}clearDonationTotal(){this.donationAmount=0}_donationAmountChanged(t){this._displayDonationAmount(t)}_displayDonationAmount(){this._updateTextContent("data-display-donation-amount",this.donationAmount||0)}static get observedAttributes(){return["client-name","fund-id","forward-to","cumulative-mode","donation-amount","custom-domain"]}};window.customElements.define("spektrix-donate",$8afdebd39323dd56$var$spektrixDonate);let $954b45a199eb2b19$var$spektrixGiftVouchers=class $954b45a199eb2b19$var$spektrixGiftVouchers extends $d30e2434767de841$export$2e2bcd8739ae039{constructor(){super(),this.customInputsMapping={giftVoucherAmount:{attribute:"data-amount",initialValue:0},toName:{attribute:"data-to-name",initialValue:null},fromName:{attribute:"data-from-name",initialValue:null},message:{attribute:"data-message",initialValue:null},sendDate:{attribute:"data-send-date",initialValue:new Date},sendDateDay:{attribute:"data-send-date-day",initialValue:null},sendDateMonth:{attribute:"data-send-date-month",initialValue:null},sendDateYear:{attribute:"data-send-date-year",initialValue:null},deliveryType:{attribute:"data-delivery-type",initialValue:null},deliveryEmailAddress:{attribute:"data-delivery-email-address",initialValue:null}},this._sendDate=new Date,this._syncInputValuesToProps(this.customInputsMapping),Object.defineProperties(this,{giftVoucherAmount:this._createPropertyDescriptor("giftVoucherAmount","number",0,function(){this._displayAmount()}),toName:this._createPropertyDescriptor("toName","string",null),fromName:this._createPropertyDescriptor("fromName","string",null),message:this._createPropertyDescriptor("message","string",""),deliveryType:this._createPropertyDescriptor("deliveryType","string",null),deliveryEmailAddress:this._createPropertyDescriptor("deliveryEmailAddress","string",void 0),forwardTo:this._createPropertyDescriptor("forwardTo","string",null)})}connectedCallback(){this._initializeComponent({displayFunction:this._displayAmount,clickHandlerMap:{"data-submit-gift-voucher":()=>this.postGiftVoucher(),"data-set-voucher-amount":t=>
1{if(null==t||""===t)return;let e=Number(t);Number.isFinite(e)&&(this.giftVoucherAmount=e)}}}),this._customInputHandler("data-send-date",t=>{let e=new Date(t.value);this.sendDate=e}),this._customInputHandler("data-send-date-day",t=>{this.sendDateDay=t.value}),this._customInputHandler("data-send-date-month",t=>{this.sendDateMonth=t.value}),this._customInputHandler("data-send-date-year",t=>{this.sendDateYear=t.value})}set sendDate(t){this._sendDate!==t&&t instanceof Date&&(this._sendDate=t)}get sendDate(){return this._sendDate?this._sendDate:new Date}set sendDateDay(t){this._sendDate.getDate()!==t&&"string"==typeof t&&this._sendDate.setDate(t)}get sendDateDay(){return this._sendDate?this._sendDate.getDate():new Date().getDate()}set sendDateMonth(t){this._sendDate.getMonth()!==t&&"string"==typeof t&&this._sendDate.setMonth(t)}get sendDateMonth(){return this._sendDate?this._sendDate.getMonth():new Date().getMonth()}set sendDateYear(t){this._sendDate.getFullYear()!==t&&"string"==typeof t&&this._sendDate.setFullYear(t)}get sendDateYear(){return this._sendDate?this._sendDate.getFullYear():new Date().getFullYear()}async postGiftVoucher(){if(this.giftVoucherAmount<=0)return;let t=[{amount:this.giftVoucherAmount,toName:this.toName,fromName:this.fromName,message:this.message,sendDate:this.sendDate.toISOString().split("T")[0],deliveryType:this.deliveryType,deliveryEmailAddress:this.deliveryEmailAddress}];return await this._makeApiRequest("basket/gift-vouchers","post",t)}_displayAmount(){this._updateTextContent("data-display-amount",this.giftVoucherAmount||0)}static get observedAttributes(){return["client-name","forward-to","gift-voucher-amount","custom-domain"]}};window.customElements.define("spektrix-gift-vouchers",$954b45a199eb2b19$var$spektrixGiftVouchers);let $8e4e77e7dac280da$var$spektrixLoginStatus=class $8e4e77e7dac280da$var$spektrixLoginStatus extends $d30e2434767de841$export$2e2bcd8739ae039{constructor(){super()}async connectedCallback(){window.addEventListener("message",this._handleIframeMessage.bind(this)),this._updateDisplay()}static get observedAttributes(){return["client-name","custom-domain"]}async isLoggedIn(){var t=await a(this.customDomain,this.clientName,$efb01c8f2309df1f$var$endpoints.customer);if(t)return!!t&&!!t.firstName}async _updateDisplay(){this._showLoadingState();let t=await this.isLoggedIn();this._toggleElementsDisplay("[data-logged-in-container]","[data-logged-out-container]",t),t&&await this.populateCustomerInfo(),this._showLoadedState()}async populateCustomerInfo(){if(!await this.isLoggedIn())return;let t=await a(this.customDomain,this.clientName,$efb01c8f2309df1f$var$endpoints.customer);this._updateTextContent("data-logged-in-status-customer-first-name",t.firstName),this._updateTextContent("data-logged-in-status-customer-last-name",t.lastName),this._updateTextContent("data-logged-in-status-customer-email-address",t.email)}async _handleIframeMessage(t){let i=t.origin||t.originalEvent.origin,a=this.customDomain?this.customDomain:"system.spektrix.com";if(i===`https://${a}`){if("string"==typeof t.data&&0===t.data.indexOf("basketContents:")){let i=JSON.parse(t.data.substring(15));if(!i)return;e($efb01c8f2309df1f$var$endpoints.customer.key,i.customer||{})}await this._updateDisplay()}}};window.customElements.define("spektrix-login-status",$8e4e77e7dac280da$var$spektrixLoginStatus);let $d58e7e553f879429$var$spektrixMemberships=class $d58e7e553f879429$var$spektrixMemberships extends $d30e2434767de841$export$2e2bcd8739ae039{constructor(){super(),this.customInputsMapping={autoRenew:{attribute:"data-set-autorenew",initialValue:!1}},this._syncInputValuesToProps(this.customInputsMapping),Object.defineProperties(this,{forwardTo:this._createPropertyDescriptor("forwardTo","string",null),membershipId:this._createPropertyDescriptor("membershipId","string",null),autoRenew:this._createPropertyDescriptor("autoRenew","boolean",!1)}),this._membershipData=null}connectedCallback(){this._initializeComponent({displayFunction:this._updateDisplay,clickHandlerMap:{"data-submit-membership":()=>this.postMembership()}})}async _updateDisplay(){this._showLoadingState(),this._needsMembershipData()&&await this._populateMembershipData(),this._needsCustomerData()&&await this._updateCustomerOwnershipDisplay(),this._setAutoRenewCheckboxState(),this._showLoadedState()}_needsMembershipData(){return["data-name","data-description","data-
1price","data-renewal-price","data-html-description","data-image-url","data-thumbnail-url","data-alt-text","data-max-price","data-can-auto-renew","data-cannot-auto-renew","data-is-giftable","data-is-not-giftable","data-variable-price-input","data-membership-period","data-is-variable-membership","data-is-not-variable-membership"].some(t=>null!==this.querySelector(`[${t}]`))}_needsCustomerData(){return null!==this.querySelector("[data-customer-holds-membership]")||null!==this.querySelector("[data-customer-does-not-hold-membership]")}async _populateMembershipData(){if(this.membershipId)try{let t=await a(this.customDomain,this.clientName,$efb01c8f2309df1f$var$endpoints.memberships);if(!t)return;let e=t.find(t=>t.id===this.membershipId);if(!e)return;this._membershipData=e,this._updateTextContent("data-name",e.name||""),this._updateTextContent("data-description",e.description||""),this._updateTextContent("data-price",e.price||""),this._updateTextContent("data-renewal-price",e.renewalPrice||""),this._updateTextContent("data-max-price",e.maxPrice||""),this._updateHtmlContent("data-html-description",e.htmlDescription),this._updateImageSources("data-image-url",e.imageUrl,e.altText),this._updateImageSources("data-thumbnail-url",e.thumbnailUrl,e.altText),this._updateImageAltText("data-alt-text",e.altText),this._toggleElementsDisplay("[data-is-variable-membership]","[data-is-not-variable-membership]",e.isVariable),this._toggleElementsDisplay("[data-can-auto-renew]","[data-cannot-auto-renew]",e.canAutoRenew),this._toggleElementsDisplay("[data-is-giftable]","[data-is-not-giftable]",e.isGiftable),this._updateMembershipPeriodDisplay(e.membershipPeriod),e.maxPrice&&void 0!==e.price&&this._updateInputValidation(e.price,e.maxPrice)}catch(t){this._logError(t,"_populateMembershipData")}}_updateHtmlContent(t,e){e&&this.querySelectorAll(`[${t}]`).forEach(t=>{t.innerHTML=e})}_updateImageSources(t,e,i){e&&this.querySelectorAll(`[${t}]`).forEach(t=>{"IMG"===t.tagName&&(t.src=e,i&&(t.alt=i))})}_updateImageAltText(t,e){e&&this.querySelectorAll(`[${t}]`).forEach(t=>{"IMG"===t.tagName&&(t.alt=e)})}_updateInputValidation(t,e){this.querySelectorAll("input[data-variable-price-input]").forEach(i=>{("number"===i.type||"range"===i.type)&&(i.min=t,i.max=e)})}_updateMembershipPeriodDisplay(t){t&&this.querySelectorAll("[data-membership-period]").forEach(e=>{let i=this._formatMembershipPeriod(e,t);i&&(e.textContent=i)})}_formatMembershipPeriod(t,e){if(!e||!e.expiryType)return null;let i=this._getMembershipPeriodFormat(t,e.expiryType);return i?i.replace(/{(years|months|weeks|days)}/gi,(t,i)=>e[i]||0):null}_getMembershipPeriodFormat(t,e){let i=e.toLowerCase(),a=this._getCurrentCulture();if(a){let e=t.getAttribute(`data-period-format-${i}-${a.toLowerCase()}`);if(e)return e}let s=t.getAttribute(`data-period-format-${i}`);return s||null}_getCurrentCulture(){let t=this.getAttribute("culture");if(t)return t;let e=document.documentElement.lang;return e||null}async _updateCustomerOwnershipDisplay(){if(!this.membershipId)return;let t=await this._checkCustomerOwnsMembership();this._toggleElementsDisplay("[data-customer-holds-membership]","[data-customer-does-not-hold-membership]",t)}async _checkCustomerOwnsMembership(){if(!this.membershipId)return!1;try{let t=await a(this.customDomain,this.clientName,$efb01c8f2309df1f$var$endpoints.customer);if(!t?.subscriptions)return!1;return t.subscriptions.some(t=>t.membership&&t.membership.id===this.membershipId)}catch{return!1}}async postMembership(){let t=[{membership:this.membershipId,autoRenew:this._getAutoRenewValue()}];if(this._membershipData?.isVariable){let e=this._getVariablePrice();null!==e&&(t[0].overriddenPrice=e)}return await this._makeApiRequest("basket/membership-subscriptions","post",t)}_setAutoRenewCheckboxState(){let t=this.querySelector('input[data-set-autorenew][type="checkbox"]');t&&this.hasAttribute("auto-renew")&&(t.checked=this.autoRenew)}_getAutoRenewValue(){let t=this.querySelector('input[data-set-autorenew][type="checkbox"]');return t?t.checked:!!this._membershipData?.canAutoRenew||this.autoRenew}_getVariablePrice(){let t=this.querySelector("input[data-variable-price-input]");if(!t)return null;let e=parseFloat(t.value);if(isNaN(e))return this._membershipData?.price??null;if(this._membershipData){let t=this._membershipData.price,i=this._membershipData.maxPrice;if(void 0!==t&&e<t)return t;if(void 0!==i&&e>i)return i}return e}static get observedAttributes(){return["client-name","membership-id","forward-to","auto-renew","custom-domain","culture"]}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),"culture"===t&&e!==i&&this.isConnected&&this._updateDisplay()}};window.customElements.define("spektrix-memberships",$d58e7e553f879429$var$spektr
1ixMemberships);let $b6bb515903c74148$var$spektrixMerchandise=class $b6bb515903c74148$var$spektrixMerchandise extends $d30e2434767de841$export$2e2bcd8739ae039{constructor(){super(),this.customInputsMapping={merchandiseQuantity:{attribute:"data-custom-quantity-input",initialValue:0}},this._syncInputValuesToProps(this.customInputsMapping),Object.defineProperties(this,{merchandiseItemId:this._createPropertyDescriptor("merchandiseItemId","string",null,function(t){-1===t.indexOf(",")?this._merchandiseItemId=[t]:this._merchandiseItemId=t.split(",")}),merchandiseQuantity:this._createPropertyDescriptor("merchandiseQuantity","number",0,function(){this._quantityChanged()}),forwardTo:this._createPropertyDescriptor("forwardTo","string",null)})}connectedCallback(){this._initializeComponent({displayFunction:this._displayQuantity,clickHandlerMap:{"data-submit-merchandise":()=>this.postMerchandiseItem(),"data-increment-quantity":()=>this.incrementMerchandiseQuantity(),"data-decrement-quantity":()=>this.decrementMerchandiseQuantity()}})}async postMerchandiseItem(){if(this.merchandiseQuantity<=0)return;let t=[];if(Array.isArray(this.merchandiseItemId)&&this.merchandiseItemId.length>=1){let e=[];for(let t of this.merchandiseItemId){let i={stockItem:t};e.push(i)}for(let i=0;i<this.merchandiseQuantity;i++)t.push(e);t=[].concat(...t)}return await this._makeApiRequest("basket/merchandise","post",t)}updateMerchandiseQuantity(t){t>=0&&(this.merchandiseQuantity=Number(t))}incrementMerchandiseQuantity(){this.merchandiseQuantity++}decrementMerchandiseQuantity(){this.merchandiseQuantity>0&&this.merchandiseQuantity--}_quantityChanged(){this._displayQuantity()}_displayQuantity(){this._updateTextContent("data-display-quantity",this.merchandiseQuantity||0)}static get observedAttributes(){return["client-name","forward-to","merchandise-item-id","merchandise-quantity","custom-domain"]}};window.customElements.define("spektrix-merchandise",$b6bb515903c74148$var$spektrixMerchandise)

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.