PageSourceSearch

https://www.itsmyseat.com/Scripts_58/js/AddExtras.js?v=20260914a

js itsmyseat.com collected 2026-09-26 01:26:05 UTC 10,331 bytes, 1 lines download raw bytes

1var AddExtras=function(){"use strict";var e=null,a={eventID:0,reservationID:0,options:[],provider:"",handler:null,busy:!1};function n(e){return document.getElementById(e)}function t(e){var a=document.createElement("div");return a.textContent=null==e?"":String(e),a.innerHTML}function o(e){return"$"+(Number(e)||0).toFixed(2)}function i(e){if(Array.isArray(e))return e.map(i);if(e&&"object"==typeof e){var a={};return Object.keys(e).forEach(function(n){a[n.toLowerCase()]=i(e[n])}),a}return e}function r(e,a){var n=new URLSearchParams;return n.append("method",e),n.append("returnformat","JSON"),Object.keys(a).forEach(function(e){n.append(e,a[e])}),fetch("./server/AddExtrasService.cfc",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()}).then(function(e){if(!e.ok)throw new Error("HTTP "+e.status);return e.json()}).then(i)}function d(e,a){return window[a]?Promise.resolve():new Promise(function(a,n){var t=document.createElement("script");t.src=e,t.onload=a,t.onerror=n,document.head.appendChild(t)})}function s(e,a){var t=n("axAlert");t.className="alert alert-"+e,t.textContent=a}function l(){n("axAlert").className="alert d-none"}function c(){try{a.handler&&a.handler.destroy&&a.handler.destroy()}catch(e){}a.handler=null;var e=n("axCardContainer");e&&(e.innerHTML="")}function m(){var e=function(){var e=0;return a.options.forEach(function(a){var t=n("axQty_"+a.optionid);t&&(e+=(parseInt(t.value,10)||0)*Number(a.price))}),Math.round(100*e)/100}();n("axTotal").textContent=o(e),n("axPayText").textContent=e>0?"Pay "+o(e):"Pay",n("axPayBtn").disabled=a.busy||!(e>0)||("Square"===a.provider||"Stripe"===a.provider)&&!a.handler,n("axPay").classList.toggle("d-none",!(e>0))}function u(){if(!a.busy){l();var e=[];if(a.options.forEach(function(a){var t=parseInt((n("axQty_"+a.optionid)||{}).value,10)||0;t>0&&e.push({optionID:a.optionid,quantity:t})}),e.length){var t,o={};if("Square"===a.provider||"Stripe"===a.provider){if(!a.handler)return void s("warning","The card form is still loading.");t=Promise.resolve(a.handler.tokenize()).then(function(e){o.token=e.token})}else{if((o={cardNumber:n("axCcNumber").value.replace(/\D/g,""),expMonth:n("axCcMonth").value.trim(),expYear:n("axCcYear").value.trim(),cvv:n("axCcCvv").value.trim(),address:n("axAddress").value.trim(),city:n("axCity").value.trim(),state:n("axState").value.trim(),zip:n("axZip").value.trim()}).cardNumber.length<13||!o.expMonth||!o.expYear||!o.zip)return void s("warning","Please enter your card number, expiration month and year, and billing ZIP code.");2===o.expYear.length&&(o.expYear="20"+o.expYear),t=Promise.resolve()}a.busy=!0,n("axSpin").classList.remove("d-none"),m(),t.then(function(){return r("purchaseAddons",{eventID:a.eventID,reservationID:a.reservationID,itemsJSON:JSON.stringify(e),paymentJSON:JSON.stringify(o)})}).then(function(e){a.busy=!1,n("axSpin").classList.add("d-none"),e.success?(c(),n("axContent").classList.add("d-none"),n("axPayBtn").classList.add("d-none"),n("axDoneText").textContent=e.message||"Thank you!",n("axDone").classList.remove("d-none")):(m(),s("danger",e.message||"Your purchase could not be completed."))}).catch(function(e){a.busy=!1,n("axSpin").classList.add("d-none"),m(),s("danger",e&&e.message?e.message:"Your payment could not be sent. Please try again.")})}else s("warning","Please choose at least one add-on.")}}return{open:function(i,v){!function(){n("addExtrasModal")||(document.body.insertAdjacentHTML("beforeend",'<div class="modal fade" id="addExtrasModal" tabindex="-1" aria-labelledby="addExtrasTitle" aria-hidden="true"><div class="modal-dialog modal-lg modal-dialog-scrollable"><div class="modal-content"><div class="modal-header bg-primary text-white"><h5 class="modal-title" id="addExtrasTitle"><i class="bi bi-bag-plus me-2"></i>Add extras to your order</h5><button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body"><div id="axLoading" class="text-center py-4"><div class="spinner-border text-primary" role="status"></div><p class="mt-2 mb-0">Loading add-ons…</p></div><div id="axAlert" class="alert d-none" role="alert"></div>
1<div id="axContent" class="d-none"><div id="axEvent" class="mb-3"></div><div id="axOwned" class="mb-3"></div><div id="axOptions"></div><div class="d-flex justify-content-between align-items-center border-top pt-3 mt-2"><strong>Total</strong><strong class="fs-5" id="axTotal">$0.00</strong></div><div id="axPay" class="mt-3 d-none"><div id="axSecure" class="d-none"><label class="form-label">Card</label><div id="axCardContainer" style="min-height:90px;"></div></div><div id="axPlain" class="d-none"><div class="mb-2"><label class="form-label" for="axCcNumber">Card number</label><input type="text" class="form-control" id="axCcNumber" inputmode="numeric" autocomplete="cc-number"></div><div class="row g-2 mb-2"><div class="col-4"><label class="form-label" for="axCcMonth">Month</label><input type="text" class="form-control" id="axCcMonth" placeholder="MM" maxlength="2" inputmode="numeric"></div><div class="col-4"><label class="form-label" for="axCcYear">Year</label><input type="text" class="form-control" id="axCcYear" placeholder="YYYY" maxlength="4" inputmode="numeric"></div><div class="col-4"><label class="form-label" for="axCcCvv">CVV</label><input type="text" class="form-control" id="axCcCvv" maxlength="4" inputmode="numeric"></div></div><div class="mb-2"><label class="form-label" for="axAddress">Billing address</label><input type="text" class="form-control" id="axAddress"></div><div class="row g-2 mb-2"><div class="col-12 col-sm-5"><label class="form-label" for="axCity">City</label><input type="text" class="form-control" id="axCity"></div><div class="col-6 col-sm-3"><label class="form-label" for="axState">State</label><input type="text" class="form-control" id="axState"></div><div class="col-6 col-sm-4"><label class="form-label" for="axZip">ZIP</label><input type="text" class="form-control" id="axZip"></div></div></div></div></div><div id="axDone" class="text-center py-4 d-none"><div class="display-6 text-success mb-2">&#10003;</div><h5>Add-ons confirmed</h5><p class="mb-0" id="axDoneText"></p></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal" id="axCloseBtn">Close</button><button type="button" class="btn btn-primary d-none" id="axPayBtn" disabled><span class="spinner-border spinner-border-sm d-none me-2" id="axSpin"></span><span id="axPayText">Pay</span></button></div></div></div></div>'),n("axPayBtn").addEventListener("click",u),n("addExtrasModal").addEventListener("hidden.bs.modal",c));e||(e=new bootstrap.Modal(n("addExtrasModal")))}(),a.eventID=i,a.reservationID=v,a.options=[],a.busy=!1,l(),n("axLoading").classList.remove("d-none"),n("axContent").classList.add("d-none"),n("axDone").classList.add("d-none"),n("axPayBtn").classList.add("d-none"),e.show(),r("getAddonOffer",{eventID:i,reservationID:v}).then(function(e){if(n("axLoading").classList.add("d-none"),e.success){var i=e.event||{};n("axEvent").innerHTML='<div class="fw-semibold">'+t(i.title)+'</div><div class="small text-muted">'+t(i.date)+" · Reservation #"+t(i.reservationid)+"</div>";var r,l,u,v=e.owned||[];n("axOwned").innerHTML=v.length?'<div class="small p-2 bg-light rounded">Already on your order: '+v.map(function(e){return t(e.quantity+" x "+e.itemname+(e.optionname&&e.optionname!==e.itemname?" - "+e.optionname:""))}).join("; ")+"</div>":"",a.options=e.options||[],r=n("axOptions"),l="",a.options.forEach(function(e){var a=0===e.available,n=e.max>0?e.max:10;e.available>0&&(n=Math.min(n,e.available));for(var i='<option value="0">0</option>',r=Math.max(1,e.min||1);r<=n;r++)i+='<option value="'+r+'">'+r+"</option>";l+='<div class="d-flex align-items-center gap-3 border rounded p-2 mb-2">'+(e.thumbnail?'<img src="'+t(e.thumbnail)+'" alt="" style="width:56px;height:56px;object-fit:cover;border-radius:6px;">':"")+'<div class="flex-grow-1"><div class="fw-semibold">'+t(e.itemname)+(e.optionname&&e.optionname!==e.itemname?' <span class="text-muted fw-normal">- '+t(e.optionname)+"</span>":"")+"</div>"+(e.description?'<div class="small text-muted">'+t(e.description)+"</div>":"")+'<div class="small">'+o(e.price)+" each"+(a?' · <span class="text-danger">Sold out</span>':e.available>0&&e.available<=10?" · "+e.available+" left":"")+'</div></div><select class="form-select form-select-sm" style="width:auto;" id="axQty_'+e.optionid+'" aria-label="Quantity for '+t(e.itemname)+'"'+(a?" disabled":"")+">"+i+"</select></div>"}),r.innerHTML=l,a.options.forEach(function(e){var a=n("axQty_"+e.optionid);a&&a.addEventListener("change",m)}),n("axContent").classList.remove("d-none"),n("axPayBtn").classList.remove("d-none"),u=e.payment||{},a.provider=u.provider||"",c(),n("axSecure").classList.add("d-none"),n("axPlain").classList.add("d-none"),"Square"===a.provider?(n("axSecure").classList.remove("d-none"),d("./Scripts_58/js/checkout/SecurePaymentHandler.js?v=20260914","SecurePaymentHandler").then(function(){SecurePaymentHandler.init({applicationId:u.appid,locationId:u.locationid,environment:u.environment,containerId:"axCardContainer",label:"Add-ons",amount:"0.00",onReady:function(){a.handler=SecurePaymentHandler,m()},onTokenError:function(e){a.handler||s("danger",e&&e.message||"The secure card form could not load.")}})}).catch(function(){s("danger","The secure card form could not load. Please try again.")})):"Stripe"===a.provider?(n("axSecure").classList.remove("d-none"),d("./Scripts_58/js/checkout/StripePaymentHandler.js?v=20260914","StripePaymentHandler").then(function(){StripePaymentHandler.init({publishableKey:u.publishablekey,environment:u.environment,containerId:"axCardContainer",onReady:function(){a.handler=StripePaymentHandler,m()},onTokenError:function(e){a.handler||s("danger",e&&e.message||"The secure card form could not load.")}})}).catch(function(){s("danger","The secure card form could not load. Please try again.")})):"Card"===a.provider&&n("axPlain").classList.remove("d-none"),m()}else s(e.options&&e.options.length?"warning":"info",e.message||"No add-ons are available.")}).catch(function(){n("axLoading").classList.add("d-none"),s("danger","We could not load the add-ons. Please try again.")})}}}();

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.