PageSourceSearch

https://cloud.mysteryscience.com/raw/upload/assets/controllers/hom…0c89bb5e3a418575b0dd63a4c063df1b2103109b.js

js mysteryscience.com collected 2026-09-24 09:23:06 UTC 2,787 bytes, 1 lines download raw bytes

1import{Controller}from"@hotwired/stimulus";const PRODUCT_OPTIONS_MODAL_ID="product-options-modal",PAYMENT_OPTIONS_MODAL_ID="payment-options-modal",CREDIT_CARD="credit_card",QUOTE="quote",HOMESCHOOL_MODAL_ID={bundle:"new-bundle-homeschool-modal",science:"new-science-homeschool-modal",writing:"new-writing-homeschool-modal"};export default class extends Controller{static values={bundleActiveOrderUrl:String,scienceActiveOrderUrl:String,writingActiveOrderUrl:String};connect(){this.selectedProduct=null,this.productDialog=this.element.querySelector(`#${PRODUCT_OPTIONS_MODAL_ID}`),this.paymentDialog=this.element.querySelector(`#${PAYMENT_OPTIONS_MODAL_ID}`),this.productContinueButton=this.productDialog?.querySelector(`[data-log-action="clicked-${PRODUCT_OPTIONS_MODAL_ID}"]`),this.paymentContinueButton=this.paymentDialog?.querySelector(`[data-log-action="clicked-${PAYMENT_OPTIONS_MODAL_ID}"]`),this.boundHandleProductContinue=this.handleProductContinue.bind(this),this.boundHandlePaymentContinue=this.handlePaymentContinue.bind(this),this.productContinueButton?.addEventListener("click",this.boundHandleProductContinue),this.paymentContinueButton?.addEventListener("click",this.boundHandlePaymentContinue)}disconnect(){this.productContinueButton?.removeEventListener("click",this.boundHandleProductContinue),this.paymentContinueButton?.removeEventListener("click",this.boundHandlePaymentContinue)}handleProductContinue(e){e.preventDefault();const t=this.productDialog.querySelector('input[type="radio"]:checked');if(!t)return;this.selectedProduct=t.value;const n=this.activeOrderUrlForProduct(this.selectedProduct);n?window.location.assign(n):(this.closeModal(PRODUCT_OPTIONS_MODAL_ID),this.openModal(PAYMENT_OPTIONS_MODAL_ID))}activeOrderUrlForProduct(e){switch(e){case"bundle":return this.bundleActiveOrderUrlValue;case"science":return this.scienceActiveOrderUrlValue;case"writing":return this.writingActiveOrderUrlValue;default:return""}}handlePaymentContinue(e){e.preventDefault();const t=this.paymentDialog.querySelector('input[type="radio"]:checked');if(!t||!this.selectedProduct)return;const n=this.intentForPaymentMethod(t.value);if(!n)return;const o=HOMESCHOOL_MODAL_ID[this.selectedProduct];o&&(this.closeModal(PAYMENT_OPTIONS_MODAL_ID),this.openHomeschoolModalWithIntent(o,n))}intentForPaymentMethod(e){switch(e){case CREDIT_CARD:return"payment";case QUOTE:return"quote";default:return null}}openModal(e){window.ComponentModalRegistry?.[e]?.open()}closeModal(e){window.ComponentModalRegistry?.[e]?.close()}openHomeschoolModalWithIntent(e,t){const n=window.Modal?.instances?.[e];if(!n)return;const o=n.container?.[0],i=o?.querySelector('input[name="user[intent]"]');i&&(i.value=t),n.open(null,0,{});const r=n.overlay?.[0];r&&(r.style.backgroundColor="rgba(0, 0, 0, 0.5)")}}

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.