/** WaveOrtho (c) 2025 | WaveOrtho Inquiry Form & Exam Scheduler [version: 7.5.8] */ "use strict"; function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } window.$wave_CONSTANTS = function () { return { APP_FORM_ID: 'waveInquiryForm', TEXT: { HEADER: { english: 'Request Your Consultation', spanish: 'Solicita tu consulta', french: 'Demandez votre consultation' }, FIELD_IS_REQUIRED: { english: 'this field is required', spanish: 'este campo es requerido', french: 'Ce champ est requis' }, IN: { english: 'in', spanish: 'en', french: 'dans' }, AT: { english: 'at', spanish: 'a', french: 'à' }, WITH: { english: 'with', spanish: 'con', french: 'avec' }, SELECT_THIS_LOCATION: { english: 'Select This Location', spanish: 'Seleccione esta ubicación', french: 'Sélectionnez cet emplacement' }, APPOINTMENT_CALL_ME_SUCCESS_MESSAGE: { english: 'Our office will call you to schedule an appointment', spanish: 'Nuestra oficina lo llamará para programar una cita.', french: 'Notre bureau vous appellera pour fixer un rendez-vous' }, EMAIL_IS_REQUIRED: { english: 'Email is required', spanish: 'Correo electronico es requerido', french: 'L\'email est requis' }, EMAIL_IS_INVALID: { english: 'Email is invalid', spanish: 'Correo electrónico es invalido', french: 'Le courriel est invalide' }, PHONE_IS_REQUIRED: { english: 'Phone is required', spanish: 'Se requiere número de teléfono', french: 'Le téléphone est requis' }, PHONE_IS_INVALID: { english: 'Phone Number is invalid. Please limit it to 10 numbers only.', spanish: 'El número de teléfono no es válido. Limítelo solo a 10 números.', french: 'Le numéro de téléphone n\'est pas valide. Veuillez le limiter à 10 chiffres seulement.' }, PLEASE_SELECT_APPOINTMENT: { english: 'Please select a day and time that works best for you', spanish: 'Por favor elige un dia y tiempo que trabaja mejor para usted', french: 'Veuillez sélectionner un jour et une heure qui vous conviennent le mieux' }, RESET_ALERT: { english: 'All information entered will be lost', spanish: 'Toda la información ingresada se perderá', french: 'Toutes les informations saisies seront perdues' }, YOU_HAVE: { english: 'You have', spanish: 'Tienes', french: 'Vous avez' }, ERRORS: { english: 'errors', spanish: 'errores', french: 'les erreurs' }, ERROR: { english: 'error', spanish: 'error', french: 'Erreur' }, TO_ADDRESS: { english: 'to address', spanish: 'cambiar', french: 'changer' }, SUBMISSION_ERROR_MESSAGE: { english: 'An unknown error occurred while submitting your information, please try again later.', spanish: 'Se produjo un error desconocido al enviar su información. Vuelva a intentarlo más tarde.', french: 'Une erreur inconnue s\'est produite lors de la soumission de vos informations, veuillez réessayer plus tard.' }, APPOINTMENT_SCHEDULER_TITLE_TEXT: { english: 'Schedule Your Exam Appointment', spanish: 'Programe su cita de examen', french: 'Planifiez votre rendez-vous d\'examen' }, APPOINTMENT_SCHEDULER_CHANGE_APPOINTMENT_TEXT: { english: 'Change', spanish: 'Cambiar', french: 'Changer' }, APPOINTMENT_SCHEDULER_SUCCESS_MESSAGE: { english: 'Please complete the form below to reserve your appointment time and we will send you a confirmation message.', spanish: 'Complete el siguiente formulario para reservar la hora de su cita y le enviaremos un mensaje de confirmación.', french: 'Veuillez remplir le formulaire ci-dessous pour réserver votre rendez-vous et nous vous enverrons un message de confirmation.' }, APPOINTMENT_SCHEDULER_CALL_ME_SUCCESS_MESSAGE: { english: 'Please complete the form below and we will call you to schedule your appointment.', spanish: 'Por favor complete la forma que sigue para reservar su consulta y les enviaremos un texto de confirmación.', french: 'Veuillez remplir le formulaire ci-dessous et nous vous appellerons pour planifier votre rendez-vous.' }, APPOINTMENT_SCHEDULER_DESCRIPTION_TEXT: { english: 'Select a day and time that works for you, and we\'ll contact you to confirm your appointment.', spanish: 'Seleccione un día y tiempo que trabaja para usted. Nuestra oficina les contactará para confirmar su consulta.', french: 'Sélectionnez un jour et une heure qui vous conviennent et nous vous contacterons pour confirmer votre rendez-vous.' }, APPOINTMENT_SCHEDULER_UNAVAILABLE_APPOINTMENT_TEXT: { english: 'unavailable', spanish: 'indisponible', french: 'indisponible' }, WARNING_MESSAGE: { english: 'Please do not submit any Protected Health Information (PHI). This is not a secure or encrypted means of communicating with our orthodontics office.', spanish: 'Por favor, no envíe información de Salud Protegida. Este no es un medio seguro o encriptado para comunicación con nuestra oficina.', french: 'Veuillez ne soumettre aucune information de santé protégée. Ce n\'est pas un moyen sécurisé ou crypté de communiquer avec notre cabinet d\'orthodontie.' }, SUBMISSION_SUCCESS_MESSAGE: { english: 'Thank you for requesting an appointment! We will follow up shortly and we look forward to speaking with you!', spanish: '¡Gracias por solicitar una cita! ¡Haremos un seguimiento en breve y esperamos hablar con usted!', french: 'Merci d\'avoir demandé un rendez-vous! Nous ferons un suivi sous peu et nous avons hâte de vous parler!' }, SUBMISSION_SUCCESS_TITLE: { english: 'Submission Successful!', spanish: 'Envío exitoso!', french: 'Soumission réussie!' }, DESCRIPTION: { english: '', spanish: '', french: '' }, SAVE_BUTTON_TEXT: { english: 'Submit', spanish: 'Enviar', french: 'Soumettre' }, PROVIDE_MORE_DETAILS: { english: 'Please provide additional information', spanish: 'Por favor proporcione información adicional', french: 'Veuillez fournir des informations supplémentaires' }, RESET_BUTTON_TEXT: { english: 'Reset Form', spanish: 'Restablecer formulario', french: 'Formulaire de réinitialisation' }, WORD_OF_MOUTH_OTHER: { english: 'Please let us know how you heard about us.', spanish: 'Dínos cómo descubriste nuestra clínica.', french: 'Bouche à oreille, docteur, etc.' /* english: 'Word of Mouth, Doctor, etc.', spanish: 'De boca en boca, doctor, etc.', french: 'Bouche à oreille, docteur, etc.' */ }, APPOINTMENT_SCHEDULER_HELP_TEXT: { english: 'Click the arrows on the sides to change dates', spanish: 'Haga clic a las flechas al lado para cambiar las fechas.', french: 'Cliquez sur les flèches sur les côtés pour modifier les dates' }, PLEASE_CALL_ME_TEXT: { english: 'Please call me instead', spanish: 'Por favor llámame en su lugar', french: 'Veuillez m\'appeler à la place' }, YOU_HAVE_SELECTED: { english: 'You have selected an appointment for', spanish: 'Usted ha seleccionado la consulta para', french: 'Vous avez sélectionné un rendez-vous pour' }, CLICK_THE_ARROWS_TO_CHANGE_DATES: { english: 'Click the arrows on the sides to change dates', spanish: 'Haz clic en las flechas a los lados para cambiar las fechas.', french: 'Cliquez sur les flèches sur les côtés pour modifier les dates' }, OUR_OFFICE_WILL_CALL_YOU_TO_SCHEDULE_APPOINTMENT: { english: 'Our office will call you to schedule an appointment', spanish: 'Nuestra oficina lo llamará para programar una cita.', french: 'Notre bureau vous appellera pour fixer un rendez-vous' } }, CSS_LIBRARIES: { 'bootstrap': { FORM: '', FORM_GROUP: 'form-group', FORM_INPUT: 'form-control', FORM_CHECK: 'form-check', ERROR_MESSAGE: 'text-danger', INPUT_LABEL: '', INPUT_LABEL_REQUIRED: 'text-danger', BUTTON_SUBMIT: 'btn btn-primary', BUTTON_RESET: 'btn btn-warning ml-1', TITLE: '', DESCRIPTION: '', ALERT: 'alert alert-info', DISCLAIMER: 'text-muted mt-1', WARNING: 'text-muted mt-1', SUCCESS_MESSAGE_TITLE: '', SUCCESS_MESSAGE_BOX: '', SUCCESS_MESSAGE_TEXT: 'alert alert-success', APPOINTMENT_SCHEDULER: '', APPOINTMENT_SCHEDULER_TITLE: 'text-center', APPOINTMENT_SCHEDULER_DESCRIPTION: 'text-center text-muted', APPOINTMENT_SCHEDULER_HELP_TEXT: 'text-center text-muted', APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_DETAILS: 'text-muted', APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_HEADER: 'h5', APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_CHANGE_BUTTON: 'btn btn-info', APPOINTMENT_SCHEDULER_TABLE: 'table-striped table table-bordered table-sm align-middle', APPOINTMENT_SCHEDULER_BODY_ROW: 'align-middle', APPOINTMENT_SCHEDULER_TIME_DATE_CELL: 'text-center align-middle', APPOINTMENT_SCHEDULER_HEADER: 'text-center align-middle', APPOINTMENT_SCHEDULER_HEADER_DAY_OF_WEEK: '', APPOINTMENT_SCHEDULER_HEADER_MONTH: 'text-muted', APPOINTMENT_SCHEDULER_HEADER_ROW: 'align-middle', APPOINTMENT_SCHEDULER_HEADER_ARROWS: 'text-center align-middle h3' }, 'bootstrap-3': { FORM: '', FORM_GROUP: 'form-group', FORM_INPUT: 'form-control', FORM_CHECK: 'form-check', ERROR_MESSAGE: 'text-danger', INPUT_LABEL: '', INPUT_LABEL_REQUIRED: 'text-danger', BUTTON_SUBMIT: 'btn btn-primary', BUTTON_RESET: 'btn btn-warning', TITLE: '', DESCRIPTION: '', ALERT: 'alert alert-info', DISCLAIMER: 'text-muted', WARNING: 'text-muted', SUCCESS_MESSAGE_TITLE: '', SUCCESS_MESSAGE_BOX: '', SUCCESS_MESSAGE_TEXT: 'alert alert-success', APPOINTMENT_SCHEDULER: '', APPOINTMENT_SCHEDULER_TITLE: 'text-center', APPOINTMENT_SCHEDULER_DESCRIPTION: 'text-center help-block', APPOINTMENT_SCHEDULER_HELP_TEXT: 'text-center help-block', APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_DETAILS: 'help-block', APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_HEADER: '', APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_CHANGE_BUTTON: 'btn btn-info', APPOINTMENT_SCHEDULER_TABLE: 'table-striped table table-bordered table-condensed align-middle', APPOINTMENT_SCHEDULER_BODY_ROW: 'align-middle', APPOINTMENT_SCHEDULER_TIME_DATE_CELL: 'text-center align-middle', APPOINTMENT_SCHEDULER_HEADER: 'text-center align-middle', APPOINTMENT_SCHEDULER_HEADER_DAY_OF_WEEK: '', APPOINTMENT_SCHEDULER_HEADER_MONTH: 'help-block', APPOINTMENT_SCHEDULER_HEADER_ROW: 'align-middle', APPOINTMENT_SCHEDULER_HEADER_ARROWS: 'text-center align-middle h3' } }, SETTINGS: { SOURCE: '', SOURCE_DETAILS: '', REMOVE_URL_APPOINTMENT_MESSAGE: false, NO_WEEKENDS: false, DEFAULT_LOCATION: 1, NO_DEFAULT_LOCATION: false, SUBMISSION_REDIRECT_URL: null, MAP_IMMEDIATE_CHANGE_MODE: true, DEFAULT_PATIENT_STATUS: 'New Patient', LANGUAGE: 'english', LANGUAGE_OPTIONS: [], HIDE_LOCATIONS: false, HIDE_LOCATION_OPTIONS: null }, SERVICES: { english: ['General Consultation', 'Palatal Expansion', 'Interested in Invisalign', 'Interested in Braces', 'Jaw Pain', 'Sleep and Breathing Concerns', 'Other'], spanish: [{ value: 'General Consultation', text: 'Consulta' }, { value: 'Palatal Expansion', text: 'Expansion' }, { value: 'Interested in Invisalign', text: 'Consulta para Invisalign' }, { value: 'Interested in Braces', text: 'Consulta para llaves' }, { value: 'Jaw Pain', text: 'Dolor de mandíbula' }, { value: 'Sleep and Breathing Concerns', text: 'Consulta sobre el sueño' }, { value: 'Other', text: 'Otra' }], french: [{ value: 'General Consultation', text: 'Consultation' }, { value: 'Palatal Expansion', text: 'Expansion' }, { value: 'Interested in Invisalign', text: 'Consultation pour Invisalign' }, { value: 'Interested in Braces', text: 'Consultation pour accolades' }, { value: 'Jaw Pain', text: 'La douleur à la mâchoire' }, { value: 'Sleep and Breathing Concerns', text: 'Consultation pour la dormire' }, { value: 'Other', text: 'Autre' }] }, AGE_OPTIONS: { english: ['Toddler (1 - 2)', 'Pre-Schooler (3 - 4)', 'Child (5 - 9)', 'Pre-Teen (10 - 12)', 'Early-Teen (13 - 15)', 'Late-Teen (16 - 19)', 'Young Adult (20 - 30)', 'Adult (31-64)', 'Senior (65+)'], spanish: [{ value: 'Toddler (1 - 2)', text: 'Niñito (1 - 2)' }, { value: 'Pre-Schooler (3 - 4)', text: 'Preescolar (3 - 4)' }, { value: 'Child (5 - 9)', text: 'Niño (5 - 9)' }, { value: 'Pre-Teen (10 - 12)', text: 'Pre-adolescente (10 - 12)' }, { value: 'Early-Teen (13 - 15)', text: 'Adolescente temprano (13 - 15)' }, { value: 'Late-Teen (16 - 19)', text: 'Adolescente tardío (16 - 19)' }, { value: 'Young Adult (20 - 30)', text: 'Adulto joven (20 - 30)' }, { value: 'Adult (31-64)', text: 'Adulto (31-64)' }, { value: 'Senior (65+)', text: 'Mayor (65+)' }], french: [{ value: 'Toddler (1 - 2)', text: 'Bambin (1 - 2)' }, { value: 'Pre-Schooler (3 - 4)', text: 'Enfant d\'âge préscolaire (3 - 4)' }, { value: 'Child (5 - 9)', text: 'Enfant (5 - 9)' }, { value: 'Pre-Teen (10 - 12)', text: 'Pré-ado (10 - 12)' }, { value: 'Early-Teen (13 - 15)', text: 'Adolescent précoce (13 - 15)' }, { value: 'Late-Teen (16 - 19)', text: 'Fin adolescent (16 - 19)' }, { value: 'Young Adult (20 - 30)', text: 'Jeune adulte (20 - 30)' }, { value: 'Adult (31-64)', text: 'Adulte (31-64)' }, { value: 'Senior (65+)', text: 'Sénior (65+)' }] }, DAY_NAMES_SHORT: { english: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], spanish: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'], french: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'] }, DAY_NAMES_LONG: { english: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], spanish: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'], french: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'] }, MONTH_NAMES_SHORT: { english: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], spanish: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'], french: ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Jui', 'Jui', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc'] }, AM_PM: { AM: { english: 'AM', spanish: 'AM', french: '' }, PM: { english: 'PM', spanish: 'PM', french: '' } }, VALIDATIONS: { EMAIL: true, PHONE: false }, DATABASE_KEY_MAP: { patientStatus: 'patientType', locations: 'location', services: 'visitType', reference: 'referralCategory', firstName: 'first_name', lastName: 'last_name', age: 'ageRange', appointmentScheduler: 'Appt_ID', appointmentCallMe: 'callMe', email: 'email', phone: 'phone', inquiry: 'message', textMessageConsent: 'textMessageConsent' }, PLACEHOLDERS: { FIRST_NAME: { english: 'Patient First Name', spanish: 'Primer Nombre de Paciente', french: 'Prénom du patient' }, LAST_NAME: { english: 'Patient Last Name', spanish: 'Apellido de Paciente', french: 'Nom du patient' }, EMAIL: { english: 'Email Address', spanish: 'Correo Electrónico', french: 'Adresse e-mail' }, PHONE: { english: 'Phone Number', spanish: 'Número de Teléfono', french: 'Numéro de téléphone' }, INQUIRY: { english: '', spanish: '', french: '' } }, LABELS: { PATIENT_STATUS: { english: 'Have you visited us before?', spanish: '¿Nos has visitado antes?', french: 'Vous nous avez déjà rendu visite?' }, LOCATION: { english: 'Select a location', spanish: 'Seleccione una localización', french: 'Choisissez un lieu' }, SERVICES: { english: 'What can we help you with?', spanish: '¿Qué podemos ayudarte?', french: 'En quoi pouvons-nous vous aider?' }, REFERENCES: { english: 'How did you hear about us?', spanish: '¿Cómo nos encontró?', french: 'Comment avez-vous entendu parler de nous?' }, FIRST_NAME: { english: 'Patient First Name', spanish: 'Primer Nombre de Paciente', french: 'Prénom du patient' }, LAST_NAME: { english: 'Patient Last Name', spanish: 'Apellido de Paciente', french: 'Nom du patient' }, AGE: { english: 'Patient Age', spanish: 'La edad del paciente', french: 'Âge du patient' }, EMAIL: { english: 'Email', spanish: 'Correo Electrónico', french: 'Email' }, PHONE: { english: 'Mobile Phone', spanish: 'Número de Teléfono', french: 'Téléphone portable' }, INQUIRY: { english: 'Question/Message', spanish: 'Preguntas/Mensaje', french: 'Question/Message' }, TEXT_MESSAGE_CONSENT: { english: 'I consent to receive text messages at this phone number. Message frequency varies, message and data rates may apply. Message types may include: marketing (eg. Promos), patient care and/or conversational messages. Reply STOP to opt-out; HELP for more information.', spanish: 'Doy mi consentimiento para recibir mensajes de texto en este número de teléfono. La frecuencia de los mensajes varía, pueden aplicarse tarifas de mensajes y datos. Los tipos de mensajes pueden incluir: marketing (por ejemplo, promociones), atención al paciente y/o mensajes conversacionales. Responda STOP para darse de baja; AYUDA para más información.La frecuencia de los mensajes varía, pueden aplicarse tarifas de mensajes y datos. Los tipos de mensajes pueden incluir: marketing (por ejemplo, promociones), atención al paciente y/o mensajes conversacionales. Responda STOP para darse de baja; AYUDA para más información.', french: 'J\'accepte de recevoir des SMS à ce numéro de téléphone. La fréquence des messages varie, des tarifs de messages et de données peuvent s\'appliquer. Les types de messages peuvent inclure: le marketing (par exemple, les promotions), les soins aux patients et/ou les messages conversationnels. Répondez STOP pour vous désinscrire; AIDE pour plus d\'informations.' }, TEXT_MESSAGE_CONSENT_1: { english: 'I consent to receive text messages from', spanish: 'Doy mi consentimiento para recibir mensajes de texto de', french: 'J\'accepte de recevoir des messages texte de' }, TEXT_MESSAGE_CONSENT_2: { english: '. Message frequency varies, message and data rates may apply. Message types may include: marketing (eg. Promos), patient care and/or conversational messages. Reply STOP to opt-out; HELP for more information.', spanish: '. La frecuencia de los mensajes varía, pueden aplicarse tarifas de mensajes y datos. Los tipos de mensajes pueden incluir: marketing (por ejemplo, promociones), atención al paciente y/o mensajes conversacionales. Responda STOP para darse de baja; AYUDA para más información.', french: '. La fréquence des messages varie, des tarifs de messages et de données peuvent s\'appliquer. Les types de messages peuvent inclure: le marketing (par exemple, les promotions), les soins aux patients et/ou les messages conversationnels. Répondez STOP pour vous désinscrire; AIDE pour plus d\'informations.' }, VIEW_PRIVACY_POLICY: { english: 'View our Privacy Policy', spanish: 'Ver nuestra Política de Privacidad', french: 'Consultez notre politique de confidentialité' }, AND: { english: 'and', spanish: 'y', french: 'et' }, VIEW_TERMS_OF_SERVICE: { english: 'Terms of Service', spanish: 'Términos de servicio', french: 'Conditions d\'utilisation' } }, SHOW: { PLACEHOLDERS: true, DISCLAIMER: true, WARNING: true, RESET_ALERT: true, HEADER: true, APPOINTMENT_SCHEDULER: true, RESET_BUTTON: false, PLEASE_CALL_ME: true, AGE: false, INQUIRY: true, REFERENCE: false, GOOGLE_MAPS_LOCAL: true, DEFAULT_LOCATION_ON_MAP_ONLY_ON_MAP: false, TODAYS_APPOINTMENTS: true, PATIENT_STATUS: false, SERVICES: false, LOCATIONS_POPOVER: false }, CLASSES: { FORM: 'wave-form-container', FORM_GROUP: 'wave-form-group', FORM_INPUT: 'wave-form-control', FORM_CHECK: 'wave-form-check', CHECKBOX_LABEL: 'wave-form-checkbox-label', ERROR_MESSAGE: 'wave-error-message', INPUT_LABEL: 'wave-form-label', INPUT_LABEL_REQUIRED: 'wave-form-required', BUTTON_SUBMIT: 'wave-form-button wave-form-button-submit', BUTTON_RESET: 'wave-form-button wave-form-button-reset', APPOINTMENT_SCHEDULER: 'wave-appointment-scheduler', APPOINTMENT_SCHEDULER_TITLE: 'wave-appointment-scheduler-title', APPOINTMENT_SCHEDULER_DESCRIPTION: 'wave-appointment-scheduler-description', APPOINTMENT_SCHEDULER_HELP_TEXT: 'wave-appointment-scheduler-help-text', APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_HEADER: 'wave-completion-message-header', APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_DETAILS: 'wave-completion-message-details', APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_CHANGE_BUTTON: 'wave-form-button wave-form-button-info wave-scheduler-change-appointment-button', APPOINTMENT_SCHEDULER_TABLE: 'wave-table', APPOINTMENT_SCHEDULER_BODY_ROW: '', APPOINTMENT_SCHEDULER_TIME_DATE_CELL: 'time-date-cell', APPOINTMENT_SCHEDULER_HEADER: 'table-date-header', APPOINTMENT_SCHEDULER_HEADER_DAY_OF_WEEK: 'day-of-week', APPOINTMENT_SCHEDULER_HEADER_MONTH: 'month', APPOINTMENT_SCHEDULER_HEADER_ROW: '', APPOINTMENT_SCHEDULER_HEADER_ARROWS: 'table-arrow-selector', PLEASE_CALL_ME: 'wave-appointment-scheduler-please-call-me', TITLE: 'wave-form-title', DESCRIPTION: 'wave-form-description', ALERT: 'wave-form-alert', LANGUAGE_PICKER: 'wave-language-picker', WARNING: 'wave-form-warning', SUCCESS_MESSAGE_TITLE: 'wave-success-message-title', SUCCESS_MESSAGE_BOX: 'wave-success-message-box', SUCCESS_MESSAGE_TEXT: 'wave-success-message-text' }, REQUIREMENTS: { PATIENT_STATUS: true, LOCATIONS: true, SERVICES: true, REFERENCES: true, FIRST_NAME: true, LAST_NAME: true, AGE: false, EMAIL: true, PHONE: false, APPOINTMENT_SCHEDULER: true, INQUIRY: false, TEXT_MESSAGE_CONSENT: true }, REFERRAL_METHODS: { english: ['Doctor or Dentist', 'Word of Mouth', 'Dental Insurance', 'Internet Search', 'Social Media', 'Advertisements', 'Other'], spanish: [{ value: 'Doctor or Dentist', text: 'Médico o Dentista' }, { value: 'Word of Mouth', text: 'Boca a boca' }, { value: 'Dental Insurance', text: 'Seguro dental' }, { value: 'Internet Search', text: 'Búsqueda de internet' }, { value: 'Social Media', text: 'Medios de comunicación social' }, { value: 'Advertisements', text: 'Anuncios' }, { value: 'Other', text: 'Otro' }], french: [{ value: 'Doctor or Dentist', text: 'Médecin ou Dentiste' }, { value: 'Word of Mouth', text: 'Bouche à oreille' }, { value: 'Dental Insurance', text: 'Assurance dentaire' }, { value: 'Internet Search', text: 'Recherche Internet' }, { value: 'Social Media', text: 'Des médias sociaux' }, { value: 'Advertisements', text: 'Annonces' }, { value: 'Other', text: 'Autre' }] }, PATIENT_CURRENT_STATUS: { english: ['New Patient', 'Current Patient', 'Previous Patient'], spanish: [{ value: 'New Patient', text: 'Paciente nuevo' }, { value: 'Current Patient', text: 'Paciente actual' }, { value: 'Previous Patient', text: 'Paciente anterior' }], french: [{ value: 'New Patient', text: 'Nouveau patient' }, { value: 'Current Patient', text: 'Patient actuel' }, { value: 'Previous Patient', text: 'Patient précédent' }] }, VALID_LANGUAGES: ['english', 'spanish', 'french'] }; }(); window.$wave_ATTRIBUTE_CONFIG_MAP = function () { var CONSTANTS = window.$wave_CONSTANTS; var returnArray = []; //==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-// var CLASSES = [{ attribute: 'data-form-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.FORM; }, group: 'CLASSES', key: 'FORM' }, { attribute: 'data-form-group-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.FORM_GROUP; }, group: 'CLASSES', key: 'FORM_GROUP' }, { attribute: 'data-form-check', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.FORM_CHECK; }, group: 'CLASSES', key: 'FORM_CHECK' }, { attribute: 'data-appointment-scheduler-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER' }, { attribute: 'data-appointment-scheduler-header-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_HEADER; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_HEADER' }, { attribute: 'data-appointment-scheduler-title-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_TITLE; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_TITLE' }, { attribute: 'data-appointment-scheduler-description-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_DESCRIPTION; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_DESCRIPTION' }, { attribute: 'data-appointment-scheduler-please-call-me-class', appendable: true, "default": function _default() { return CONSTANTS.CLASSES.PLEASE_CALL_ME; }, type: 'overwrite', group: 'CLASSES', key: 'PLEASE_CALL_ME' }, { attribute: 'data-appointment-scheduler-help-text-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_HELP_TEXT; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_HELP_TEXT' }, { attribute: 'data-appointment-scheduler-completion-change-button-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_CHANGE_BUTTON; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_CHANGE_BUTTON' }, { attribute: 'data-appointment-scheduler-completion-message-header-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_HEADER; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_HEADER' }, { attribute: 'data-appointment-scheduler-completion-message-details-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_DETAILS; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_COMPLETION_MESSAGE_DETAILS' }, { attribute: 'data-appointment-scheduler-table-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_TABLE; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_TABLE' }, { attribute: 'data-appointment-scheduler-body-row-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_BODY_ROW; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_BODY_ROW' }, { attribute: 'data-appointment-scheduler-time-date-cell-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_TIME_DATE_CELL; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_TIME_DATE_CELL' }, { attribute: 'data-appointment-scheduler-header-day-of-week-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_HEADER_DAY_OF_WEEK; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_HEADER_DAY_OF_WEEK' }, { attribute: 'data-appointment-scheduler-header-month-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_HEADER_MONTH; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_HEADER_MONTH' }, { attribute: 'data-appointment-scheduler-header-row-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_HEADER_ROW; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_HEADER_ROW' }, { attribute: 'data-appointment-scheduler-header-arrows-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.APPOINTMENT_SCHEDULER_HEADER_ARROWS; }, group: 'CLASSES', key: 'APPOINTMENT_SCHEDULER_HEADER_ARROWS' }, { attribute: 'data-form-input-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.FORM_INPUT; }, group: 'CLASSES', key: 'FORM_INPUT' }, { attribute: 'data-error-message-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.ERROR_MESSAGE; }, group: 'CLASSES', key: 'ERROR_MESSAGE' }, { attribute: 'data-warning-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.WARNING; }, group: 'CLASSES', key: 'WARNING' }, { attribute: 'data-language-picker-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.LANGUAGE_PICKER; }, group: 'CLASSES', key: 'LANGUAGE_PICKER' }, { attribute: 'data-input-label-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.INPUT_LABEL; }, group: 'CLASSES', key: 'INPUT_LABEL' }, { attribute: 'data-input-required-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.INPUT_LABEL_REQUIRED; }, group: 'CLASSES', key: 'INPUT_LABEL_REQUIRED' }, { attribute: 'data-checkbox-label-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.CHECKBOX_LABEL; }, group: 'CLASSES', key: 'CHECKBOX_LABEL' }, { attribute: 'data-button-submit-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.BUTTON_SUBMIT; }, group: 'CLASSES', key: 'BUTTON_SUBMIT' }, { attribute: 'data-button-reset-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.BUTTON_RESET; }, group: 'CLASSES', key: 'BUTTON_RESET' }, { attribute: 'data-title-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.TITLE; }, group: 'CLASSES', key: 'TITLE' }, { attribute: 'data-success-message-box-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.SUCCESS_MESSAGE_BOX; }, group: 'CLASSES', key: 'SUCCESS_MESSAGE_BOX' }, { attribute: 'data-success-message-text-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.SUCCESS_MESSAGE_TEXT; }, group: 'CLASSES', key: 'SUCCESS_MESSAGE_TEXT' }, { attribute: 'data-description-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.DESCRIPTION; }, group: 'CLASSES', key: 'DESCRIPTION' }, { attribute: 'data-alert-class', appendable: true, type: 'overwrite', "default": function _default() { return CONSTANTS.CLASSES.ALERT; }, group: 'CLASSES', key: 'ALERT' }]; var LABEL = [{ attribute: 'data-label-patient-status', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.PATIENT_STATUS; }, group: 'LABEL', key: 'PATIENT_STATUS' }, { attribute: 'data-label-location', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.LOCATION; }, group: 'LABEL', key: 'LOCATION' }, { attribute: 'data-label-age-dropdown', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.AGE; }, group: 'LABEL', key: 'AGE' }, { attribute: 'data-label-services', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.SERVICES; }, group: 'LABEL', key: 'SERVICES' }, { attribute: 'data-label-references', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.REFERENCES; }, group: 'LABEL', key: 'REFERENCES' }, { attribute: 'data-label-first-name', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.FIRST_NAME; }, group: 'LABEL', key: 'FIRST_NAME' }, { attribute: 'data-label-last-name', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.LAST_NAME; }, group: 'LABEL', key: 'LAST_NAME' }, { attribute: 'data-label-email', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.EMAIL; }, group: 'LABEL', key: 'EMAIL' }, { attribute: 'data-label-phone', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.PHONE; }, group: 'LABEL', key: 'PHONE' }, { attribute: 'data-label-inquiry', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.INQUIRY; }, group: 'LABEL', key: 'INQUIRY' }, { attribute: 'data-label-text-message-consent', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.TEXT_MESSAGE_CONSENT; }, group: 'LABEL', key: 'TEXT_MESSAGE_CONSENT' }, { attribute: 'data-label-text-message-consent-1', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.TEXT_MESSAGE_CONSENT_1; }, group: 'LABEL', key: 'TEXT_MESSAGE_CONSENT_1' }, { attribute: 'data-label-text-message-consent-2', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.TEXT_MESSAGE_CONSENT_2; }, group: 'LABEL', key: 'TEXT_MESSAGE_CONSENT_2' }, { attribute: 'data-label-privacy-policy', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.VIEW_PRIVACY_POLICY; }, group: 'LABEL', key: 'VIEW_PRIVACY_POLICY' }, { attribute: 'data-view-terms-of-service', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.VIEW_TERMS_OF_SERVICE; }, group: 'LABEL', key: 'VIEW_TERMS_OF_SERVICE' }, { attribute: 'data-and', type: 'overwrite', "default": function _default() { return CONSTANTS.LABELS.AND; }, group: 'LABEL', key: 'AND' }]; var TEXT = [{ attribute: 'data-submit-button-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.SAVE_BUTTON_TEXT; }, group: 'TEXT', key: 'SUBMIT_BUTTON' }, { attribute: 'data-appointment-scheduler-title-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.APPOINTMENT_SCHEDULER_TITLE_TEXT; }, group: 'TEXT', key: 'APPOINTMENT_SCHEDULER_TITLE' }, { attribute: 'data-appointment-please-call-me-confirmation-text', type: 'overwrite', "default": function _default() { return CONSTANTS.OUR_OFFICE_WILL_CALL_YOU_TO_SCHEDULE_APPOINTMENT; }, group: 'TEXT', key: 'OUR_OFFICE_WILL_CALL_YOU_TO_SCHEDULE_APPOINTMENT' }, { attribute: 'data-appointment-you-have-selected-text', type: 'overwrite', "default": function _default() { return CONSTANTS.YOU_HAVE_SELECTED; }, group: 'TEXT', key: 'YOU_HAVE_SELECTED' }, { attribute: 'data-appointment-scheduler-change-appointment-button-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.APPOINTMENT_SCHEDULER_CHANGE_APPOINTMENT_TEXT; }, group: 'TEXT', key: 'CHANGE_APPOINTMENT_BUTTON' }, { attribute: 'data-appointment-scheduler-completion-message-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.APPOINTMENT_SCHEDULER_SUCCESS_MESSAGE; }, group: 'TEXT', key: 'APPOINTMENT_SCHEDULER_SUCCESS_MESSAGE' }, { attribute: 'data-appointment-scheduler-call-me-completion-message-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.APPOINTMENT_SCHEDULER_CALL_ME_SUCCESS_MESSAGE; }, group: 'TEXT', key: 'APPOINTMENT_CALL_ME_SUCCESS_MESSAGE' }, { attribute: 'data-appointment-scheduler-description-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.APPOINTMENT_SCHEDULER_DESCRIPTION_TEXT; }, group: 'TEXT', key: 'APPOINTMENT_SCHEDULER_DESCRIPTION' }, { attribute: 'data-appointment-scheduler-please-call-me-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.PLEASE_CALL_ME_TEXT; }, group: 'TEXT', key: 'PLEASE_CALL_ME' }, { attribute: 'data-appointment-scheduler-unavailable-appointment-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.APPOINTMENT_SCHEDULER_UNAVAILABLE_APPOINTMENT_TEXT; }, group: 'TEXT', key: 'APPOINTMENT_SCHEDULER_UNAVAILABLE_APPOINTMENT' }, { attribute: 'data-reset-warning-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.RESET_ALERT; }, group: 'TEXT', key: 'RESET_ALERT' }, { attribute: 'data-reset-button-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.RESET_BUTTON_TEXT; }, group: 'TEXT', key: 'RESET_BUTTON' }, { attribute: 'data-heading-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.HEADER; }, group: 'TEXT', key: 'HEADER' }, { attribute: 'data-warning-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.WARNING_MESSAGE; }, group: 'TEXT', key: 'WARNING' }, { attribute: 'data-description-text', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.DESCRIPTION; }, group: 'TEXT', key: 'DESCRIPTION' }, { attribute: 'data-form-submission-success-title', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.SUBMISSION_SUCCESS_TITLE; }, group: 'TEXT', key: 'SUBMISSION_SUCCESS_TITLE' }, { attribute: 'data-form-submission-success-message', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.SUBMISSION_SUCCESS_MESSAGE; }, group: 'TEXT', key: 'SUBMISSION_SUCCESS_MESSAGE' }, { attribute: 'data-form-submission-error-message', type: 'overwrite', "default": function _default() { return CONSTANTS.TEXT.SUBMISSION_ERROR_MESSAGE; }, group: 'TEXT', key: 'SUBMISSION_ERROR_MESSAGE' }]; var PLACEHOLDERS = [{ attribute: 'data-placeholder-first-name', type: 'overwrite', "default": function _default() { return CONSTANTS.PLACEHOLDERS.FIRST_NAME; }, allowEmptyString: true, group: 'PLACEHOLDERS', key: 'FIRST_NAME' }, { attribute: 'data-placeholder-last-name', type: 'overwrite', "default": function _default() { return CONSTANTS.PLACEHOLDERS.LAST_NAME; }, allowEmptyString: true, group: 'PLACEHOLDERS', key: 'LAST_NAME' }, { attribute: 'data-placeholder-email', type: 'overwrite', "default": function _default() { return CONSTANTS.PLACEHOLDERS.EMAIL; }, allowEmptyString: true, group: 'PLACEHOLDERS', key: 'EMAIL' }, { attribute: 'data-placeholder-phone', type: 'overwrite', "default": function _default() { return CONSTANTS.PLACEHOLDERS.PHONE; }, allowEmptyString: true, group: 'PLACEHOLDERS', key: 'PHONE' }, { attribute: 'data-placeholder-inquiry', type: 'overwrite', "default": function _default() { return CONSTANTS.PLACEHOLDERS.INQUIRY; }, allowEmptyString: true, group: 'PLACEHOLDERS', key: 'INQUIRY' }]; var SHOW = [{ attribute: 'data-show-placeholders', type: 'boolean', "default": CONSTANTS.SHOW.PLACEHOLDERS, group: 'SHOW', key: 'PLACEHOLDERS' }, { attribute: 'data-show-appointment-scheduler', type: 'boolean', "default": CONSTANTS.SHOW.APPOINTMENT_SCHEDULER, group: 'SHOW', key: 'APPOINTMENT_SCHEDULER' }, { attribute: 'data-show-age-dropdown', type: 'boolean', "default": CONSTANTS.SHOW.AGE, group: 'SHOW', key: 'AGE' }, { attribute: 'data-show-appointment-scheduler-please-call-me', type: 'boolean', "default": CONSTANTS.SHOW.PLEASE_CALL_ME, group: 'SHOW', key: 'PLEASE_CALL_ME' }, { attribute: 'data-show-todays-appointments', type: 'boolean', "default": CONSTANTS.SHOW.TODAYS_APPOINTMENTS, group: 'SHOW', key: 'TODAYS_APPOINTMENTS' }, { attribute: 'data-show-reset-warning', type: 'boolean', "default": CONSTANTS.SHOW.RESET_ALERT, group: 'SHOW', key: 'RESET_ALERT' }, { attribute: 'data-show-warning', type: 'boolean', "default": CONSTANTS.SHOW.WARNING, group: 'SHOW', key: 'WARNING' }, { attribute: 'data-show-header', type: 'boolean', "default": CONSTANTS.SHOW.HEADER, group: 'SHOW', key: 'HEADER' }, { attribute: 'data-show-reset-button', type: 'boolean', "default": CONSTANTS.SHOW.RESET_BUTTON, group: 'SHOW', key: 'RESET_BUTTON' }, { attribute: 'data-show-inquiry-message', type: 'boolean', "default": CONSTANTS.SHOW.INQUIRY, group: 'SHOW', key: 'INQUIRY' }, { attribute: 'data-show-references', type: 'boolean', "default": CONSTANTS.SHOW.REFERENCE, group: 'SHOW', key: 'REFERENCE' }, { attribute: 'data-show-patient-status', type: 'boolean', "default": CONSTANTS.SHOW.PATIENT_STATUS, group: 'SHOW', key: 'PATIENT_STATUS' }, { attribute: 'data-show-services', type: 'boolean', "default": CONSTANTS.SHOW.SERVICES, group: 'SHOW', key: 'SERVICES' }, { attribute: 'data-show-map', type: 'boolean', "default": CONSTANTS.SHOW.GOOGLE_MAPS_LOCAL, group: 'SHOW', key: 'GOOGLE_MAPS_LOCAL' }, { attribute: 'data-show-default-location-only-on-map', type: 'boolean', "default": CONSTANTS.SHOW.DEFAULT_LOCATION_ON_MAP_ONLY_ON_MAP, group: 'SHOW', key: 'DEFAULT_LOCATION_ON_MAP_ONLY_ON_MAP' }, { attribute: 'data-show-locations-popover', type: 'boolean', "default": CONSTANTS.SHOW.LOCATIONS_POPOVER, group: 'SHOW', key: 'LOCATIONS_POPOVER' }]; var REQUIREMENTS = [{ attribute: 'data-require-patient-status', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.PATIENT_STATUS, group: 'REQUIREMENTS', key: 'PATIENT_STATUS' }, { attribute: 'data-require-appointment-scheduler', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.APPOINTMENT_SCHEDULER, group: 'REQUIREMENTS', key: 'APPOINTMENT_SCHEDULER' }, { attribute: 'data-require-age-dropdown', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.AGE, group: 'REQUIREMENTS', key: 'AGE' }, { attribute: 'data-require-locations', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.LOCATIONS, group: 'REQUIREMENTS', key: 'LOCATION' }, { attribute: 'data-require-services', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.SERVICES, group: 'REQUIREMENTS', key: 'SERVICES' }, { attribute: 'data-require-references', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.REFERENCES, group: 'REQUIREMENTS', key: 'REFERENCES' }, { attribute: 'data-require-first-name', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.FIRST_NAME, group: 'REQUIREMENTS', key: 'FIRST_NAME' }, { attribute: 'data-require-last-name', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.LAST_NAME, group: 'REQUIREMENTS', key: 'LAST_NAME' }, { attribute: 'data-require-phone', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.PHONE, group: 'REQUIREMENTS', key: 'PHONE' }, { attribute: 'data-require-email', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.EMAIL, group: 'REQUIREMENTS', key: 'EMAIL' }, { attribute: 'data-require-inquiry', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.INQUIRY, group: 'REQUIREMENTS', key: 'INQUIRY' }, { attribute: 'data-require-text-message-consent', type: 'boolean', "default": CONSTANTS.REQUIREMENTS.TEXT_MESSAGE_CONSENT, group: 'REQUIREMENTS', key: 'TEXT_MESSAGE_CONSENT' }]; var VALIDATIONS = [{ attribute: 'data-validate-email', type: 'boolean', "default": CONSTANTS.VALIDATIONS.EMAIL, group: 'VALIDATIONS', key: 'EMAIL' }, { attribute: 'data-validate-phone', type: 'boolean', "default": CONSTANTS.VALIDATIONS.PHONE, group: 'VALIDATIONS', key: 'PHONE' }]; var SETTINGS = [{ attribute: 'data-source', type: 'overwrite', "default": CONSTANTS.SETTINGS.SOURCE, group: 'SETTINGS', key: 'SOURCE' }, { attribute: 'data-remove-url-appointment-message', type: 'boolean', "default": CONSTANTS.SETTINGS.REMOVE_URL_APPOINTMENT_MESSAGE, group: 'SETTINGS', key: 'REMOVE_URL_APPOINTMENT_MESSAGE' }, { attribute: 'data-appointment-scheduler-no-weekends', type: 'boolean', "default": CONSTANTS.SETTINGS.NO_WEEKENDS, group: 'SETTINGS', key: 'NO_WEEKENDS' }, { attribute: 'data-language', type: 'overwrite', "default": CONSTANTS.SETTINGS.LANGUAGE, group: 'SETTINGS', key: 'LANGUAGE' }, { attribute: 'data-language-options', type: 'overwrite', "default": CONSTANTS.SETTINGS.LANGUAGE_OPTIONS, group: 'SETTINGS', key: 'LANGUAGE_OPTIONS' }, { attribute: 'data-map-marker-click-changes-location-immediately', type: 'boolean', "default": CONSTANTS.SETTINGS.MAP_IMMEDIATE_CHANGE_MODE, group: 'SETTINGS', key: 'MAP_IMMEDIATE_CHANGE_MODE' }, { attribute: 'data-submission-redirect-url', type: 'overwrite', "default": CONSTANTS.SETTINGS.SUBMISSION_REDIRECT_URL, group: 'SETTINGS', key: 'SUBMISSION_REDIRECT_URL' }, { attribute: 'data-hide-locations', type: 'boolean', "default": CONSTANTS.SETTINGS.HIDE_LOCATIONS, group: 'SETTINGS', key: 'HIDE_LOCATIONS' }, { attribute: 'data-hide-location-options', type: 'overwrite', "default": CONSTANTS.SETTINGS.HIDE_LOCATION_OPTIONS, group: 'SETTINGS', key: 'HIDE_LOCATION_OPTIONS' }, { attribute: 'data-default-patient-status', type: 'overwrite', "default": CONSTANTS.SETTINGS.DEFAULT_PATIENT_STATUS, group: 'SETTINGS', key: 'DEFAULT_PATIENT_STATUS' }, { attribute: 'data-default-location', type: 'overwrite', "default": CONSTANTS.SETTINGS.DEFAULT_LOCATION, group: 'SETTINGS', key: 'DEFAULT_LOCATION' }, { attribute: 'data-no-default-location', type: 'boolean', "default": CONSTANTS.SETTINGS.NO_DEFAULT_LOCATION, group: 'SETTINGS', key: 'NO_DEFAULT_LOCATION' }, { attribute: 'data-debug-mode', type: 'overwrite', "default": function _default() { return false; }, group: 'SETTINGS', key: 'DEBUG_MODE' }, { attribute: 'data-default-css-library', type: 'overwrite', manual: true, "default": CONSTANTS.SETTINGS.DEFAULT_CSS_LIBRARY, groups: 'SETTINGS', key: 'DEFAULT_CSS_LIBRARY' }]; //==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-// returnArray = returnArray.concat(LABEL).concat(TEXT).concat(PLACEHOLDERS).concat(SHOW).concat(SETTINGS).concat(VALIDATIONS).concat(CLASSES).concat(REQUIREMENTS); //==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-// return returnArray; }(); window.$wave_cookies = function () { var exports = {}; function get(a) { var b = document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)'); return b ? b.pop() : ''; } exports.get = get; return exports; }(); window.$wave_u$http = function () { var exports = {}; var $cookies = window.$wave_cookies; var $sessionStorage = {}; //just setting this like this for now var prepare_request = {}; function getFileEnding(string) { var re = /(?:\.([^.]+))?$/; var ext = re.exec(string)[1]; return ext; } function isHtml(string) { return /[\S\s]*[\S\s]*<\/html[\S\s]*\>[\S\s]*/.test(string); } function serializeQueryParams(obj) { if (obj) { var str = []; for (var p in obj) { // eslint-disable-next-line no-prototype-builtins if (obj.hasOwnProperty(p)) { str.push(encodeURIComponent(p) + '=' + encodeURIComponent(obj[p])); } } return '?' + str.join('&'); } else { return ''; } } function joinUrlWithQuery(url, query) { return url + serializeQueryParams(query); } function $http(params) { return new Promise(function (resolve, reject) { var expect_html = params.expect_html === true; delete params.expect_html; var request = new XMLHttpRequest(); request.onreadystatechange = function () { if (request.readyState === 4) { var returnObj = { status: request.status }; var url = request.responseURL; returnObj.file_type = getFileEnding(url); var leaveAsString = ['html']; var is_html = leaveAsString.indexOf(returnObj.file_type) > -1 || isHtml(request.responseText); if (is_html) { returnObj.data = request.responseText; } else { try { returnObj.data = request.status !== 204 ? JSON.parse(request.responseText) : ''; } catch (e) { returnObj.data = request.responseText; } } returnObj.request_object = params; if (request.status === 200 || request.status === 204) { if (expect_html === false && is_html === true) { returnObj.status = 400; reject(returnObj); } else { resolve(returnObj); } } else { reject(returnObj); } } }; request.open(params.method, params.url, true); // true for asynchronous params.data ? request.setRequestHeader('Content-Type', 'application/json;charset=UTF-8') : null; if (params.headers && Object.keys(params.headers).length) { Object.keys(params.headers).forEach(function (key) { request.setRequestHeader(key, params.headers[key]); }); } var data = params.data ? params.data : null; request.send(JSON.stringify(data)); }); } function u$http(params) { return new Promise(function (resolve, reject) { if (params) { //Checks to see if the params object is not empty; new Promise(function (next) { if (!params.url) { //url is required reject({ status: 400, message: 'no url passed' }); } else if (!params.method) { //method is required reject({ status: 400, message: 'no method passed' }); } else { //if both exist, send the params object to the next section next({ url: params.url, expect_html: params.expect_html || false, data: !!params.body ? params.body : params.data, method: params.method.toUpperCase(), params: params.params }); } }).then(function (httpParams) { //Checks to see if there is data return new Promise(function (next) { params.responseType = params.responseType != null ? params.responseType : undefined; params.dataType = params.dataType != null ? params.dataType : undefined; params.processData = params.processData != null ? params.processData : undefined; if (params.data && httpParams.method === 'DELETE') { reject({ status: 400, message: 'Data cannot be passed with a delete request.' }); } else if (params.data && httpParams.method !== 'GET') { //if there is data and the method is not 'GET', then add data and send httpParams.data = params.data; next(httpParams); } else { //send the params to the next section next(httpParams); } }); }).then(function (httpParams) { return new Promise(function (next) { if (!httpParams.headers) { httpParams.headers = {}; } if (httpParams.url.indexOf('/api/v1/') > -1) { //checks to see if token is required var token = window.localStorage.getItem('TOKEN'); if (window.localStorage && (token || window.localStorage.user || window.localStorage.token)) { //Checks to see that the user.token object exists if (!token) { token = window.localStorage.token ? window.localStorage.token : JSON.parse(window.localStorage.user).token; } httpParams.headers = { 'x-access-token': token }; next(httpParams); } else if (params.admin) { httpParams.headers = { 'x-access-token': params.admin.token }; next(httpParams); } else { //throws an error if it doesn't exist reject({ status: 400, message: 'No user.token found' }); } } else { //not required, send the current params to the next section next(httpParams); } }); }).then(function (httpParams) { return new Promise(function (next) { //If there are any other special headers we need to add //Put them here if (params.headers) { Object.keys(params.headers).forEach(function (key) { httpParams.headers[key] = params.headers[key]; }); } //If we need to specify a response type (like we do for file download) //It'll map it over here if (params.responseType) { httpParams.responseType = params.responseType; } next(httpParams); }); }).then(function (httpParams) { //makes the http request and returns the response/error httpParams.url = joinUrlWithQuery(httpParams.url, httpParams.params); $http(httpParams).then(function (response) { resolve(response); }, function (error) { reject(error); }); }); } else { //the params object doesn't exist. reject({ status: 400, message: 'no params passed in http function' }); } }); } exports.http = u$http; return exports; }(); window.$wave_UtilityService = function () { var exports = {}; /** * @description this ensures that an item is undefined * * @param {*} item - item to be tested * @returns {boolean} */ function isUndefined(item) { return typeof item === 'undefined'; } exports.isUndefined = isUndefined; /** * @description this ensures that an item is null * * @param {*} item - item to be tested * @returns {boolean} */ function isNull(item) { return item === null; } exports.isNull = isNull; /** *@description this ensures an item is a date, or a valid date string * * @param {*} item - item to be tested * @param {boolean=} [allowString=false] - allow a user to test if an item is a string and a valid date object * @returns {boolean} */ function isDate(item, allowString) { var isNotInvalidType = !isUndefined(item) && !isNull(item) && !isNumeric(item) && !isBoolean(item) && !isArray(item); var stringAllowance = allowString !== true ? !isString(item) : true; if (isNotInvalidType && stringAllowance) { if (allowString === true) { item = new Date(item); } return item instanceof Date === true && item.toString() !== 'Invalid Date'; } else { return false; } } exports.isDate = isDate; /** * @description this ensures that an item is explicitly true or false * * @param {*} item - item to be tested * @param {boolean=} [allowString=false] - allow 'true' and 'false' to return true * @param {*=} [equalityVal=null] - (true/false) if equalityVal is present, it will check to see if the value is true or false * @returns {boolean} */ function isBoolean(item, allowString, equalityVal) { var itemIsBoolean = item === true || item === false; var itemIsStringBoolean = item === 'true' || item === 'false'; if (equalityVal && equalityVal === 'true' || equalityVal === true || equalityVal === false || equalityVal === false) { var bothAreTrue = (item === true || item === 'true') && (equalityVal === true || equalityVal === 'true'); var bothAreFalse = (item === false || item === 'false') && (equalityVal === false || equalityVal === 'false'); var equalityValCheck = bothAreFalse || bothAreTrue; return (allowString === true ? itemIsBoolean || itemIsStringBoolean : itemIsBoolean) && equalityValCheck; } else { return allowString === true ? itemIsBoolean || itemIsStringBoolean : itemIsBoolean; } } exports.isBoolean = isBoolean; /** * @description this ensures that an item is an integer (a number without decimals) * * @param {*} item - item to be tested * @param {boolean=} [withoutTypeConversion=false] - require that the item is not a string * @returns {boolean} */ function isInteger(item, withoutTypeConversion) { var itemIsInteger = !isUndefined(item) && !isNull(item) && !isNaN(item) && parseInt(Number(item)) == item && !isNaN(parseInt(item, 10)); // eslint-disable-line var isNotString = withoutTypeConversion === true ? itemIsInteger === true && !isString(item) : true; return itemIsInteger === true && isNotString === true; } exports.isInteger = isInteger; /** * @description this ensures than an item is a number (with or without decimals) * * @param {*} item - item to be tested * @param {boolean=} [withoutTypeConversion=false] - require that the item is not a string * @returns {boolean} */ function isNumeric(item, withoutTypeConversion) { var itemIsNumeric = !isUndefined(item) && !isNull(item) && !isNaN(parseFloat(item)) && isFinite(item); var isNotString = withoutTypeConversion === true ? itemIsNumeric === true && !isString(item) : true; return itemIsNumeric === true && isNotString === true; } exports.isNumeric = isNumeric; /** * @description this ensures that an item is a function * * @param {*} item - item to be tested * @returns {boolean} */ function isFunction(item) { return !isUndefined(item) && !isNull(item) && typeof item === 'function'; } exports.isFunction = isFunction; /** * @description this ensures that an item is a string * * @param {*} item - item to be tested * @param {boolean=} [requireNotEmpty=false] - require that the string has a length of at least one * @returns {boolean} */ function isString(item, requireNotEmpty) { var itemIsString = !isUndefined(item) && !isNull(item) && typeof item === 'string'; var isNotEmpty = requireNotEmpty === true ? itemIsString === true && item.length > 0 : true; return itemIsString === true && isNotEmpty === true; } exports.isString = isString; /** * @description this ensures than an item is an object * * @param {*} item - item to be tested * @param {boolean=} [requireNotEmpty=false] - require that the object has at least one key * @returns {boolean} */ function isObject(item, requireNotEmpty) { var itemIsObject = !isUndefined(item) && !isNull(item) && !isDate(item) && _typeof(item) === 'object' && !isFunction(item) && Array.isArray(item) === false; var isNotEmpty = requireNotEmpty === true ? itemIsObject === true && Object.keys(item).length > 0 : true; return itemIsObject === true && isNotEmpty === true; } exports.isObject = isObject; /** * @description this ensures than an item is an array * * @param {*} item - item to be tested * @param {boolean=} [requireNotEmpty=false] - require that the array has a length of at least one * @returns {boolean} */ function isArray(item, requireNotEmpty) { var isArray = !isUndefined(item) && !isNull(item) && Array.isArray(item); var isNotEmpty = requireNotEmpty === true ? isArray === true && item.length > 0 : true; return isArray === true && isNotEmpty === true; } exports.isArray = isArray; /** * @description this ensures that an item is an array or object and ensures that the item is not an empty version of those types * * @param {*} item * @param {boolean=} [canBeEmpty=false] - allow the item (array or object) to be an empty array or object * @returns {boolean} */ function isJsonItem(item, canBeEmpty) { return isArray(item, canBeEmpty !== true) || isObject(item, canBeEmpty !== true); } exports.isJsonItem = isJsonItem; /** * @description this ensures that an item is an array, boolean, object, string or number and ensures that the item is not an empty version of those types * * @param {*} item * @param {boolean=} [canBeEmpty=false] - allow the item (array, object, or string) to be empty versions of that item * @returns {boolean} */ function isValidResponse(item, canBeEmpty) { return isArray(item, canBeEmpty !== true) || isDate(item) || isBoolean(item) || isObject(item, canBeEmpty !== true) || isString(item, canBeEmpty !== true) || isNumeric(item); } exports.isValidResponse = isValidResponse; /** * * @param {*} item * @param {boolean=} [canBeEmpty=false] - allow the item to be a string or array * @returns {boolean} */ function isStringOrArray(item, canBeEmpty) { return isString(item, canBeEmpty) || isArray(item, canBeEmpty); } exports.isStringOrArray = isStringOrArray; /** * * @param {*} item * @param {boolean=} [stringCanBeEmpty=false] - allow an empty string to pass * @param {boolean=} [booleanAllowString=false] - allow a string 'true' or 'false' to pass * @param {boolean=} [booleanEqualityVal=null] - require the item to be equal to a true or false value (or as string) * @returns {boolean} */ function isStringOrBoolean(item, stringCanBeEmpty, booleanAllowString, booleanEqualityVal) { return isString(item, stringCanBeEmpty) || isBoolean(item, booleanAllowString, booleanEqualityVal); } exports.isStringOrBoolean = isStringOrBoolean; /** * * @param {String} value * @returns {boolean} */ function isValidEmail(value) { var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(getSanitizedEmail(value)); } exports.isValidEmail = isValidEmail; /** * * @param value * @returns {string} */ function getSanitizedEmail(value) { return value.trim().toLowerCase(); } exports.getSanitizedEmail = getSanitizedEmail; /** * * @param {String} value * @returns {*} */ function getSanitizedPhoneNumber(value) { return value.replace(/[^0-9]/g, '').trim(); } exports.getSanitizedPhoneNumber = getSanitizedPhoneNumber; /** * * @param {String} value * @returns {boolean} */ function isValidPhone(value) { console.log(value); if (isString(value, true)) { var new_phone = getSanitizedPhoneNumber(value); console.log(new_phone); return new_phone.length === 10; } else { console.log('is not string'); return false; } } exports.isValidPhone = isValidPhone; /** * * @param {*} value * @returns {*} */ function extractValue(value) { if (typeof value === 'function') { return value(); } else { return value; } } exports.extractValue = extractValue; return exports; }(); window.$wave_DataService = function () { var exports = {}; var u$http = window.$wave_u$http; var UtilityService = window.$wave_UtilityService; var DATA_SERVICE_CONFIG = { URLS: { STANDARD: { DOCTOR_DATA: 'https://central.waveortho.com/wave-central/api/v3/getInquiryFormData.php', SAVE_APPOINTMENT: 'https://central.waveortho.com/wave-central/api/appt_scheduler.php', SAVE_MESSAGE: 'https://central.waveortho.com/wave-central/api/inquiry.php' }, LOCAL_SERVER: { DOCTOR_DATA: '/wave-central/api/v3/getInquiryFormData.php', SAVE_APPOINTMENT: '/wave-central/api/appt_scheduler.php', SAVE_MESSAGE: '/wave-central/api/inquiry.php' } } }; function getCurrentBrowser() { var browserName = undefined; if (!!window.opr && !!opr.addons || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0) { browserName = 'Opera'; } else if (typeof InstallTrigger !== 'undefined') { browserName = 'Firefox'; } else if (/constructor/i.test(window.HTMLElement) || function (p) { return p.toString() === '[object SafariRemoteNotification]'; }(!window['safari'] || typeof safari !== 'undefined' && safari.pushNotification)) { browserName = 'Safari'; } else if ( /*@cc_on!@*/ false || !!document.documentMode) { browserName = 'Internet Explorer'; } else if (!isIE && !!window.StyleMedia) { browserName = 'Edge'; } else if (!!window.chrome && !!window.chrome.webstore) { browserName = 'Chrome'; } return browserName; } function getDeviceType() { var type = 'Desktop'; if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { type = 'Mobile'; } return type; } function isDemoMode() { return !!(WaveInquiryForm && WaveInquiryForm.demoMode && WaveInquiryForm.demoMode === true); } function isLocalServerMode() { return !!(isDemoMode() && window.$wave_FORM_ATTRIBUTES['data-local-server-mode'] === 'true'); } function isDoNotSubmitMode() { return !!(window.$wave_FORM_ATTRIBUTES['data-do-not-submit'] === 'true'); } /** * * @param {'post' | 'get'} method * @returns {boolean} */ function dataShouldBeSubmittedToServer(method) { var validMethods = ['post', 'get']; if (!!method && validMethods.indexOf(method) > -1) { if (isDoNotSubmitMode() === true && method === 'get') { return true; } else if (isDoNotSubmitMode() === true) { return false; } else { if (isLocalServerMode() === true) { return true; } else { if (isDemoMode()) { return false; } else { return true; } } } } else { throw Error('method is required: ' + JSON.stringify(validMethods)); } } function getUrl(name) { var urlType = isLocalServerMode() ? 'LOCAL_SERVER' : 'STANDARD'; return DATA_SERVICE_CONFIG.URLS[urlType][name]; } function saveToDatabase(finalSaveObject, doctorID, options) { options = UtilityService.isObject(options) ? options : {}; finalSaveObject.clientNumber = doctorID; finalSaveObject.source = !!options.source ? options.source : ''; finalSaveObject.urlParameters = decodeURI(location.search.substring(1)); finalSaveObject.fullUrl = decodeURI(window.location.href); finalSaveObject.language = options.language || ''; finalSaveObject.formVersion = options.formVersion || ''; if (dataShouldBeSubmittedToServer('post')) { return u$http.http({ method: 'POST', url: getUrl('SAVE_MESSAGE'), body: finalSaveObject }); } else { return new Promise(function (resolve) { resolve({ status: 200, message: 'Demo successfully submitted' }); }); } } exports.saveToDatabase = saveToDatabase; function updateAppointmentData(Appt_ID, options) { options = UtilityService.isObject(options) ? options : {}; var body = { Appt_ID: Appt_ID }; if (dataShouldBeSubmittedToServer('post')) { return u$http.http({ method: 'POST', url: getUrl('SAVE_APPOINTMENT'), body: body }); } else { return new Promise(function (resolve) { resolve({ status: 200, message: 'Demo appointment submitted' }); }); } } exports.updateAppointmentData = updateAppointmentData; function getDoctorData(doctorID) { if (dataShouldBeSubmittedToServer('get')) { return u$http.http({ method: 'POST', url: getUrl('DOCTOR_DATA'), body: { clientNumber: doctorID }, headers: { 'USERNAME': null, 'PASSWORD': null } }); } else { return new Promise(function (resolve) { resolve({ status: 200, message: 'Demo successfully submitted', data: [{}] }); }); } } exports.getDoctorData = getDoctorData; return exports; }(); window.$wave_HTMLService = function () { var exports = {}; var UtilityService = window.$wave_UtilityService; function extractAttributesFromElement(element) { var attributesArray = [].slice.call(element.attributes); var returnObj = {}; attributesArray.forEach(function (attribute) { var key = attribute.nodeName; var value = attribute.nodeValue; returnObj[key] = value; }); return returnObj; } exports.extractAttributesFromElement = extractAttributesFromElement; function isEmpty(element) { var htmlString = element.innerHTML; htmlString = htmlString.trim ? htmlString.trim() : htmlString.replace(/^\s+/, ''); // eslint-disable-next-line return htmlString == ''; } exports.isEmpty = isEmpty; function getArrayFromNodeList(list) { return Array.prototype.slice.call(list); } exports.getArrayFromNodeList = getArrayFromNodeList; function emptyElement(element) { element.innerHTML = ''; } exports.emptyElement = emptyElement; function createElement(items, attributes, children, options) { var html = ''; options = UtilityService.isObject(options) ? options : {}; items = Array.isArray(items) ? items : [items]; items.forEach(function (item, i) { var itemTag; var itemAttributes; var itemChildren; var itemOptions = {}; if (!!attributes || !!children && _typeof(items) !== 'object') { itemTag = item; itemAttributes = attributes; itemChildren = children; } else { itemTag = item.tag; itemAttributes = item.attributes; itemChildren = item.children; itemOptions = UtilityService.isObject(item.options) ? item.options : {}; } var newHTML = createElementObject(itemTag, itemAttributes, itemChildren); if (!newHTML) { console.log(itemTag); console.log(itemAttributes); console.log(itemChildren); console.log(newHTML); } if (items.length > 1 || itemOptions.htmlToString === true) { html = html + newHTML.outerHTML; } else { html = newHTML; } }); return html; } exports.createElement = createElement; function generateValue(value) { if (UtilityService.isArray(value, true)) { value = createElement(value); } else if (UtilityService.isJsonItem(value, true)) { value = JSON.stringify(value); } else if (UtilityService.isNull(value) || UtilityService.isUndefined(value)) { value = ''; } else if (UtilityService.isFunction(value)) { value = value(); } return value; } function createElementObject(tag, attributes, children) { attributes = UtilityService.isObject(attributes) ? attributes : {}; var element; if (UtilityService.isArray(children, true)) { children = createElement(children); } else if (UtilityService.isJsonItem(children, true)) { children = JSON.stringify(children); } else if (UtilityService.isNull(children) || UtilityService.isUndefined(children)) { children = ''; } if (tag) { element = document.createElement(tag); var attributeNames = Object.keys(attributes); attributeNames.forEach(function (v, i) { var attributeValue = generateValue(attributes[v]); element.setAttribute(v, attributeValue); }); element.innerHTML = children; } return element; } exports.createElementObject = createElementObject; function insertElement(element, targetID, method) { var validMethods = ['append', 'override']; method = UtilityService.isString(method, true) && validMethods.indexOf(method) > -1 ? method : 'append'; var targetElement = document.getElementById(targetID); if (targetElement) { if (method === 'append') { targetElement.appendChild(element); } else if (method === 'override') { targetElement.innerHTML = element; } } else { console.log('invalid id: ' + targetID); } } exports.insertElement = insertElement; function extractUrlParameters(url) { if (url && url.indexOf('?') > -1) { var search = url.substring(url.indexOf('?') + 1, url.length); var decodedSearch = decodeURI(search); var options = decodedSearch.split('&'); var parameterObject = {}; options.forEach(function (optionObj) { var valueSplit = optionObj.split('='); var key = valueSplit[0]; var value = valueSplit[1].split('%2C').join(','); parameterObject[key] = value; }); return parameterObject; } else { return {}; } } exports.extractUrlParameters = extractUrlParameters; function objectToUrlParameters(params) { return Object.entries(params).filter(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], val = _ref2[1]; return !!val; }).map(function (_ref3) { var _ref4 = _slicedToArray(_ref3, 2), key = _ref4[0], val = _ref4[1]; return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(val)); }).join('&'); } exports.objectToUrlParameters = objectToUrlParameters; return exports; }(); window.$wave_FormService = function () { var exports = {}; var HTMLService = window.$wave_HTMLService; var UtilityService = window.$wave_UtilityService; /** * * @param list * @param {Object} [options] * @param {Object} [options.keys] * @param {String} [options.keys.id] * @param {String} [options.keys.text] * @param {Boolean} [options.noDefault] * @returns {string} */ function generateOptions(list, options) { options = UtilityService.isObject(options) ? options : {}; options.keys = UtilityService.isObject(options.keys) ? options.keys : { id: 'value', text: 'text' }; if (UtilityService.isFunction(list)) { list = list(); } list = UtilityService.isArray(list) ? list : []; var defaultOptionPlaceholder = ''; if (options.noDefault === true) { defaultOptionPlaceholder = ''; } return [defaultOptionPlaceholder].concat(list.map(function (value) { var text = value; var id = value; if (UtilityService.isObject(value)) { text = value[options.keys.text]; id = value[options.keys.id]; } return "\n \n "); })).join(''); } exports.generateOptions = generateOptions; /** * * @param list * @param {Object} [options] * @param {Object} [options.keys] * @param {String} [options.keys.id] * @param {String} [options.keys.text] * @param {Boolean} [options.noDefault] * @returns {string} */ function generateOptionsList(list, options) { options = UtilityService.isObject(options) ? options : {}; options.keys = UtilityService.isObject(options.keys) ? options.keys : { id: 'value', text: 'text' }; if (UtilityService.isFunction(list)) { list = list(); } list = UtilityService.isArray(list) ? list : []; return list.map(function (value) { var text = value; var id = value; if (UtilityService.isObject(value)) { text = value[options.keys.text]; id = value[options.keys.id]; } return "
\n \n
\n "); } exports.generateMessage = generateMessage; return exports; }(); window.$wave_APPOINTMENT_SCHEDULER = function () { var exports = {}; var VariableUtilityService = window.$wave_UtilityService; var HTMLService = window.$wave_HTMLService; var FormService = window.$wave_FormService; var u$http = window.$wave_u$http; var CONSTANTS = window.$wave_CONSTANTS; var TABLE_CONFIG = undefined; var APPT_TABLE_CACHE = { TOTAL_DAYS_TO_BE_SHOWN: 5, START_TIME: '09:00', END_TIME: '17:00', INCREMENT: 60 }; var EXAM_SCHEDULER_CONFIG = { CALL_IN_PROGRESS: false }; // let $wave_FORM_ATTRIBUTES = window.$wave_FORM_ATTRIBUTES; // let $wave_FORM_DATA_MAP = window.$wave_FORM_DATA_MAP; // let $wave_CONFIG = window.$wave_CONFIG; //==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-// function getConfig() { return TABLE_CONFIG; } function setConfig(config) { TABLE_CONFIG = config; } function changeDateArrowClick(element) { var config = getConfig(); var direction = element.getAttribute('data-position'); var dayChangeMagnitude = weekendsShouldBeHidden() ? 7 : 5; var change = direction === 'left' ? dayChangeMagnitude * -1 : dayChangeMagnitude; var minStartDate = getMinStartDate(); var maxStartDate = getMaxStartDate(); var currentStartDate = getStartDate(config); if (change < 0 && epochToSecondsEpoch(addDaysToDate(change, currentStartDate).getTime()) < epochToSecondsEpoch(minStartDate.getTime())) { return; } else if (change > 0 && epochToSecondsEpoch(addDaysToDate(change, currentStartDate).getTime()) > epochToSecondsEpoch(maxStartDate.getTime())) { return; } $wave_CONFIG.APPOINTMENT_SCHEDULER.START_DATE = addDaysToDate(change, currentStartDate); rebuildTable(change); } window.$wave_changeDateArrowClick = changeDateArrowClick; function skipNoApptWeek(change) { var config = getConfig(); var minStartDate = getMinStartDate(); var maxStartDate = getMaxStartDate(); var currentStartDate = getStartDate(config); if (change < 0 && epochToSecondsEpoch(addDaysToDate(change, currentStartDate).getTime()) < epochToSecondsEpoch(minStartDate.getTime())) { return; } else if (change > 0 && epochToSecondsEpoch(addDaysToDate(change, currentStartDate).getTime()) > epochToSecondsEpoch(maxStartDate.getTime())) { return; } $wave_CONFIG.APPOINTMENT_SCHEDULER.START_DATE = addDaysToDate(change, currentStartDate); rebuildTable(); } window.$wave_skipNoApptWeek = skipNoApptWeek; function formatData(response) { if (response.status === 200) { return response.data.map(function (apptObj) { apptObj.date = dateStringToDate(apptObj.Appt_Date); apptObj.time = apptObj.aStart; apptObj.available = apptObj.active === '1' && apptObj.zRecordStatus === 'active' ? '1' : '0'; apptObj.isToday = dateIsToday(apptObj.date); apptObj.isFuture = isFutureDate(apptObj.date); apptObj.isPast = isPastDate(apptObj.date); apptObj.absoluteMinutesOfDay = timeToAbsoluteMinutesOfDay(apptObj.time); return apptObj; }); } else { return []; } } function timeToAbsoluteMinutesOfDay(timeString) { var timeSplit = timeString.split(':').map(function (value) { return Number(value); }); return timeSplit[0] * 60 + timeSplit[1]; } function generateCacheKey(locationID, startDate) { return (locationID ? locationID + '-' : '') + startDate; } function storeInCache(locationID, startDate, data) { var key = generateCacheKey(locationID, startDate); var cacheMinutesUntilExpiration = 1; var storageObject = { expiration: new Date().getTime() + cacheMinutesUntilExpiration * 60 * 1000, data: data }; if (data && Array.isArray(data)) { APPT_TABLE_CACHE[key] = storageObject; } return data; } function getFromCache(locationID, startDate) { var key = generateCacheKey(locationID, startDate); var storageObject = APPT_TABLE_CACHE[key]; if (storageObject) { var expirationTime = storageObject.expiration; var hasExpired = expirationTime < new Date().getTime(); if (hasExpired === false) { return storageObject.data; } else { return undefined; } } else { return undefined; } } function isDemoMode() { return WaveInquiryForm.demoMode === true; } function isLocalServerMode() { return isDemoMode() && window.$wave_FORM_ATTRIBUTES['data-local-server-mode'] === 'true'; } function getAppointmentData() { return new Promise(function (resolve, reject) { var locationValue = $wave_FORM_DATA_MAP.locations.value; var clientNumber = window.$wave_FORM_ATTRIBUTES['data-doctor-id']; var apptDateList = generateAppointmentDateList(); var startDate = apptDateList[0]; var query = { clientNumber: clientNumber, Appt_Date: generateAppointmentDateList() }; if (!!locationValue) { query.Location_ID = locationValue; var locationIsHidden = $wave_CONFIG.SETTINGS.HIDE_LOCATIONS === true; logDebugValue('getting appointments for: ', $wave_FORM_DATA_MAP.locations.options.filter(function (obj) { return obj.id === locationValue; })[0].name); } logSuperDebugValue('appointment data query', query); var cachedData = getFromCache(locationValue, startDate); if (isDemoMode() && isLocalServerMode() === false) { resolve(WaveInquiryForm.getDemoAppointmentData()); } else { if (!!cachedData) { resolve(cachedData); } else { var url = isLocalServerMode() ? '/wave-central/api/v4/getAppointmentData.php' : 'https://central.waveortho.com/wave-central/api/v4/getAppointmentData.php'; if (EXAM_SCHEDULER_CONFIG.CALL_IN_PROGRESS === false) { EXAM_SCHEDULER_CONFIG.CALL_IN_PROGRESS = true; u$http.http({ method: 'POST', url: url, data: query, headers: { 'Content-Type': 'application/json' } }).then(function (response) { EXAM_SCHEDULER_CONFIG.CALL_IN_PROGRESS = false; logSuperDebugValue('response', response); var formattedData = formatData(response); storeInCache(locationValue, startDate, formattedData); resolve(formattedData); }, function (error) { EXAM_SCHEDULER_CONFIG.CALL_IN_PROGRESS = false; console.log(error); reject(error); }); } } } }); } function rebuildTable(change) { var config = getConfig() !== undefined ? getConfig() : {}; document.getElementById('WAVE-appointment-scheduler').innerHTML = generateTable(config); if (!!change) { config.change = change; } setTableData(config); } function sortAppointmentArray(appointmentArray) { return appointmentArray.sort(function (a, b) { var aTime = getTimestampFromMilitaryTimeString(a.time).getTime(); var bTime = getTimestampFromMilitaryTimeString(b.time).getTime(); if (aTime > bTime) { return 1; } else if (aTime < bTime) { return -1; } else { return 0; } }); } function generateAppointmentGroupObject(dateKeyList) { var appointmentGroupObject = {}; dateKeyList.forEach(function (key) { appointmentGroupObject[key] = []; }); return appointmentGroupObject; } function generateAppointmentDateList() { return $wave_CONFIG.DATE_ARRAY.map(function (date) { return dateToDateString(date); }); } function getMaxAppointments(appointmentDateObject) { var dateList = Object.keys(appointmentDateObject); var maxAppointments = 0; var placeholderCount = generatePlaceholderTimes(0).length; dateList.forEach(function (dateString) { var currentAppointments = appointmentDateObject[dateString].length; maxAppointments = currentAppointments > maxAppointments ? currentAppointments : maxAppointments; }); return placeholderCount > maxAppointments ? placeholderCount : maxAppointments; } function generatePlaceholderTimes(maxAppointments) { if (includePlaceholderAppointments() === true) { var config = getConfig(); var startTime = APPT_TABLE_CACHE.START_TIME; var endTime = APPT_TABLE_CACHE.END_TIME; var increment = APPT_TABLE_CACHE.INCREMENT; var incrementList = generateIncrementList(startTime, endTime, increment); var standardIncrements = incrementList.length; maxAppointments = !maxAppointments ? standardIncrements : maxAppointments; var maxIncrements = standardIncrements > maxAppointments ? maxAppointments : standardIncrements; incrementList.length = maxIncrements; return incrementList.map(function (timestamp) { return { time: timestampToTimestring(timestamp, 'military'), generated: true, available: '0' }; }); } else { return []; } } function removeLastPlaceholderAppointment(appointmentList, maxAppointments) { var listLength = appointmentList.length; if (listLength > maxAppointments) { for (var i = listLength - 1; i >= 0; i--) { if (appointmentList.length <= maxAppointments) { break; } if (i >= 0 && appointmentList[i] && appointmentList[i].generated === true) { appointmentList.splice(i, 1); } } } return appointmentList; } function removeDuplicates(sanitizedAppointments) { var newAppointments = []; var lastApptObj = null; sanitizedAppointments.forEach(function (currentApptObj, index) { if (!!lastApptObj) { var isLastItem = index === sanitizedAppointments.length - 1; var currentTime = currentApptObj.time; if (currentTime !== lastApptObj.time) { //not the same time newAppointments.push(lastApptObj); lastApptObj = Object.assign({}, currentApptObj); if (isLastItem) { newAppointments.push(currentApptObj); } } else { //same time if (lastApptObj.available !== '1' && currentApptObj.available === '1') { lastApptObj = Object.assign({}, currentApptObj); } if (isLastItem) { newAppointments.push(lastApptObj); } } } else { lastApptObj = Object.assign({}, currentApptObj); if (sanitizedAppointments.length === 1) { newAppointments.push(currentApptObj); } } }); return newAppointments; } function joinAndSanitizeAppointments(placeholderTimes, currentAppointments, maxAppointments) { currentAppointments.forEach(function (currentAppointment) { var foundTime = false; for (var pi = 0; pi < placeholderTimes.length; pi++) { var currentPlaceholder = placeholderTimes[pi]; var currentApptTime = timestampToTimestring(getTimestampFromMilitaryTimeString(currentAppointment.time, 'military')); if (currentPlaceholder.time === currentApptTime && !!currentPlaceholder.generated) { placeholderTimes[pi] = currentAppointment; foundTime = true; } } if (foundTime === false) { placeholderTimes.push(currentAppointment); } }); var sanitizedAppointments = sortAppointmentArray(removeLastPlaceholderAppointment(placeholderTimes, maxAppointments)); sanitizedAppointments = removeDuplicates(sanitizedAppointments); if (sanitizedAppointments.length === 0) { sanitizedAppointments.push(generateNoAppointmentPlaceholder()); } return sanitizedAppointments; } function generateNoAppointmentPlaceholder() { return { available: '0', isDefault: true, text: 'no appointments' }; } function setPlaceholderTemplatesToAppointmentDateObject(appointmentDateObject, maxAppointments) { var dateList = Object.keys(appointmentDateObject); dateList.forEach(function (dateString) { var currentAppointments = appointmentDateObject[dateString]; var placeholderTimes = generatePlaceholderTimes(); appointmentDateObject[dateString] = joinAndSanitizeAppointments(placeholderTimes, currentAppointments, maxAppointments); }); return appointmentDateObject; } function showUnavailableAppointments() { return $wave_CONFIG.SHOW.UNAVAILABLE_APPOINTMENTS === true || isDemoMode(); } function includePlaceholderAppointments() { return $wave_CONFIG.SHOW.PLACEHOLDER_APPOINTMENTS === true || isDemoMode(); } function groupAppointmentArray(sortedData) { var dateKeyList = generateAppointmentDateList(); var appointmentDateObject = generateAppointmentGroupObject(dateKeyList); includePlaceholderAppointments(); sortedData.forEach(function (appointmentObj) { var dateString = dateToDateString(appointmentObj.date); if (appointmentDateObject[dateString]) { appointmentDateObject[dateString].push(appointmentObj); } }); var maxAppointments = getMaxAppointments(appointmentDateObject); return setPlaceholderTemplatesToAppointmentDateObject(appointmentDateObject, maxAppointments); } function removeUnavailableAppointments(appointmentArray) { return appointmentArray.filter(function (apptObj) { return (showUnavailableAppointments() === false && apptObj.available === '0') === false; }); } function setTodaysDataToUnavailable(appointmentArray) { return appointmentArray.map(function (apptObj) { if (apptObj.isToday) { apptObj.available = '0'; apptObj.isToday = true; } return apptObj; }); } function setAppointmentsWithinHourBufferToUnavailable(appointmentArray) { var currentHour = new Date().getHours(); var hourBuffer = Number($wave_CONFIG.SETTINGS.TODAY_APPOINTMENT_BUFFER_HOURS); var minHour = currentHour + hourBuffer; var minAbsoluteMinuteOfDay = minHour * 60; return appointmentArray.map(function (apptObj) { if (apptObj.isToday && apptObj.absoluteMinutesOfDay < minAbsoluteMinuteOfDay) { apptObj.available = '0'; apptObj.withinBuffer = true; } else { apptObj.withinBuffer = false; } return apptObj; }); } function removeAppointmentsInThePast(appointmentArray) { return appointmentArray.map(function (apptObj) { if (apptObj.isPast) { apptObj.available = '0'; apptObj.isPastDate = true; } else { apptObj.isPastDate = false; } return apptObj; }); } function dateIsToday(dateObj) { var today = deconstructDate(removeTimeFromDate(new Date())); dateObj = deconstructDate(removeTimeFromDate(dateObj)); return ['year', 'month', 'date'].filter(function (key) { return dateObj[key] === today[key]; }).length === 3; } function isFutureDate(dateObj) { var today = deconstructDate(removeTimeFromDate(new Date())); dateObj = deconstructDate(removeTimeFromDate(dateObj)); if (dateObj.year < today.year) { return false; } else if (dateObj.year === today.year) { if (dateObj.month < today.month) { return false; } else if (dateObj.month === today.month) { return dateObj.date > today.date; } else { return true; } } else { return true; } } function isPastDate(dateObj) { return dateIsToday(dateObj) === false && isFutureDate(dateObj) === false; } function deconstructDate(dateObj) { return { year: dateObj.getFullYear(), month: dateObj.getMonth() + 1, date: dateObj.getDate(), _date: dateObj }; } function removeTimeFromDate(dateObj) { ['setHours', 'setMinutes', 'setSeconds'].forEach(function (action) { dateObj[action](0); }); return dateObj; } function filterAppointmentsByTimeAndDateSettings(appointmentArray) { appointmentArray = setAppointmentsWithinHourBufferToUnavailable(appointmentArray); if ($wave_CONFIG.SHOW.TODAYS_APPOINTMENTS === false) { appointmentArray = setTodaysDataToUnavailable(appointmentArray); } appointmentArray = removeAppointmentsInThePast(appointmentArray); appointmentArray = removeUnavailableAppointments(appointmentArray); return appointmentArray; } function insertPlaceholderCells() { var groupedDateObject = groupAppointmentArray([]); var newPlaceholderHTML = generateAppointmentTable(groupedDateObject); var tbodyElement = document.querySelector('#WAVE-appointment-scheduler tbody'); if (tbodyElement) { tbodyElement.innerHTML = newPlaceholderHTML; } } function generateProgressTime(laterTime, startTime) { var msDifference = laterTime - startTime; return msDifference / 1000 + ' seconds'; } function setTableData(config) { var minTableHeight = APPT_TABLE_CACHE.MIN_HEIGHT; if (minTableHeight) { insertPlaceholderCells(); } getAppointmentData(config).then(function (appointmentArray) { var availableAppointments = appointmentArray.filter(function (apptObj) { return apptObj.available === '1'; }).length; logSuperDebugValue('appointment data', appointmentArray); logSuperDebugValue('available appointments', availableAppointments); if (availableAppointments === 0 && emptyWeeksShouldBeSkipped()) { var dayChangeMagnitude = weekendsShouldBeHidden() ? 7 : 5; skipNoApptWeek(dayChangeMagnitude); } else { logDebugValue("found ".concat(appointmentArray.length, " appointments for this date range and location."), "".concat(availableAppointments, " appointments are available and ").concat(appointmentArray.length - availableAppointments, " are unavailable")); appointmentArray = filterAppointmentsByTimeAndDateSettings(appointmentArray); logSuperDebugValue('filtered appointments', appointmentArray); var sortedData = sortAppointmentArray(appointmentArray); logSuperDebugValue('sorted appointments', sortedData); var groupedDateObject = groupAppointmentArray(sortedData); logSuperDebugValue('grouped date objects', groupedDateObject); document.querySelector('#WAVE-appointment-scheduler tbody').innerHTML = ''; var CONFIG = $wave_CONFIG; if (!CONFIG.TIMING.GOT_FIRST_APPOINTMENTS) { CONFIG.TIMING.GOT_FIRST_APPOINTMENTS = new Date().getTime(); logDebugValue("\n[PROGRESS] - elapsed time to get remote settings ".concat(generateProgressTime(CONFIG.TIMING.DOCTOR_TIME, CONFIG.TIMING.START_TIME), "\n[PROGRESS] - elapsed time to get first set of appointments ").concat(generateProgressTime(CONFIG.TIMING.GOT_FIRST_APPOINTMENTS, CONFIG.TIMING.START_TIME), "\n "), ''); } generateAndInsertTableBody(groupedDateObject); } }); } exports.setTableData = setTableData; function generateAppointmentTable(groupedDateObject) { var totalRows = getMaxAppointments(groupedDateObject); var newHTML = ''; for (var i = 0; i < totalRows; i++) { newHTML = newHTML + generateBodyRow(groupedDateObject, i); } return newHTML; } function generateAndInsertTableBody(groupedDateObject) { var newHTML = generateAppointmentTable(groupedDateObject); document.getElementById('wave-table-body').innerHTML = newHTML; if (!APPT_TABLE_CACHE.MIN_HEIGHT) { var appointmentSchedulerCell = document.querySelector('#WAVE-appointment-scheduler td'); if (appointmentSchedulerCell) { var cellHeight = appointmentSchedulerCell.offsetHeight; var minBodyHeight = generatePlaceholderTimes().length * cellHeight; var minHeaderHeight = document.querySelector('#WAVE-appointment-scheduler th').offsetHeight; APPT_TABLE_CACHE.MIN_HEIGHT = minBodyHeight + minHeaderHeight; } } } function generateAppointmentHTML(appointmentObj) { if (appointmentObj) { var displayedData = WaveInquiryForm._getText('TEXT.APPOINTMENT_SCHEDULER_UNAVAILABLE_APPOINTMENT'); // let displayedData = 'unavailable'; if (appointmentObj.isDefault !== true) { var timestamp = getTimestampFromMilitaryTimeString(appointmentObj.time); var standardTimestring = timestampToTimestring(timestamp, 'standard'); displayedData = standardTimestring; } var Appt_ID = appointmentObj.Appt_ID; var isAvailable = appointmentObj.available !== '0'; var tagName = isAvailable ? 'a' : 'span'; var onClick = tagName === 'a' ? 'window.appointmentTimeClick(this)' : 'javascript:void(0);'; return "<".concat(tagName, " href=\"javascript:void(0);\" data-appt-id=\"").concat(Appt_ID, "\" onclick=\"").concat(onClick, "\" class=\"appointment-button ").concat(isAvailable ? 'available' : 'unavailable', "\">").concat(displayedData, "").concat(tagName, ">"); } else { return ''; } } function getHourFromAppointmentTimeString(timestring) { return Number(timestring.split(':')[0]); } function getMinutesFromAppointmentTimeString(timestring) { return Number(timestring.split(':')[1]); } /** * * @param {{time: String, date: String}} valueObj * @param {String} [locationName] * @returns {string} */ function generateAppointmentString(valueObj, locationName) { var militaryTime = valueObj.time; var dateString = valueObj.date; var year = dateString.split('-')[0]; var month = dateString.split('-')[1]; var dayOfMonth = dateString.split('-')[2]; var monthIndex = Number(month) - 1; var date = new Date(year, monthIndex, dayOfMonth); var militaryTimeSplit = militaryTime.split(':'); var militaryHour = Number(militaryTimeSplit[0]); var AMPM = getAMorPM(militaryHour); var hour = militaryHour; if (WaveInquiryForm._getLanguage() !== 'french') { hour = militaryHour > 12 ? militaryHour - 12 : militaryHour; } var minutes = militaryTimeSplit[1]; var dayOfWeek = getDayOfWeekName(date); var shortMonthName = getMonthName(date); var time = "".concat(hour, ":").concat(minutes); var timeQualifier = AMPM; var ending = (!!locationName ? ' ' + locationName : '') + ''; var appointmentString = "".concat(dayOfWeek, ", ").concat(shortMonthName, " ").concat(dayOfMonth, ", ").concat(year, " ").concat(WaveInquiryForm._getText('TEXT.AT', { object: CONSTANTS }), " ").concat(time, " ").concat(timeQualifier).concat(ending); return appointmentString; } exports.generateAppointmentString = generateAppointmentString; function getAMorPM(militaryHour) { var qualifier = militaryHour >= 12 ? 'PM' : 'AM'; return WaveInquiryForm._getText('AM_PM.' + qualifier, { object: CONSTANTS }) || ''; } function generateTable() { var startTime = APPT_TABLE_CACHE.START_TIME; var endTime = APPT_TABLE_CACHE.END_TIME; var increment = 15; var startDate = getStartDate(); var endDate = generateEndDate(startDate); var dateArray = getDateListBetweenTwoDates(startDate, endDate); var timeArray = generateIncrementList(startTime, endTime, increment); $wave_CONFIG.DATE_ARRAY = dateArray; var textContent = generateTextContent(); var mainTableContent = generateMainTable(dateArray, timeArray); var pleaseCallMeHTML = generatePleaseCallMeHTML(); return textContent + mainTableContent + pleaseCallMeHTML; } exports.generateTable = generateTable; function generateTextContent() { var CONFIG = $wave_CONFIG; var ApptConfig = $wave_FORM_DATA_MAP.appointment_scheduler; var title = WaveInquiryForm._getText('TEXT.APPOINTMENT_SCHEDULER_TITLE'); var description = WaveInquiryForm._getText('TEXT.APPOINTMENT_SCHEDULER_DESCRIPTION'); var required = VariableUtilityService.isFunction(ApptConfig.required) ? ApptConfig.required() : ApptConfig.required; var titleClass = CONFIG.CLASSES.APPOINTMENT_SCHEDULER_TITLE; var descriptionClass = CONFIG.CLASSES.APPOINTMENT_SCHEDULER_DESCRIPTION; var requiredClassName = CONFIG.CLASSES.INPUT_LABEL_REQUIRED; var requiredHTML = required === true ? "*") : ''; var errorMessage = ''; if (!!ApptConfig.errorMessage) { var errorClassName = $wave_CONFIG.CLASSES.ERROR_MESSAGE; if (errorClassName === 'wave-error-message') { errorClassName = errorClassName + ' text-center'; } errorMessage = "").concat(ApptConfig.errorMessage, "
"); } var helpText = WaveInquiryForm._getText('TEXT.APPOINTMENT_SCHEDULER_HELP_TEXT', { object: CONSTANTS }); var helpTextClass = CONFIG.CLASSES.APPOINTMENT_SCHEDULER_HELP_TEXT; return "").concat(description, "
").concat(helpText, "
\n ".concat(titleHTML, "\n
\n \n\n ").concat(locationConfig.address, "\n
\n \n\n ").concat(selectThisLocationHTML, "\n
\n\n ").concat(staticApptTimeMessage, " ").concat(changeText, "\n
\n \n\n ").concat(appointmentSuccessMessage, "\n
\n "); } else { if (CONFIG.IS_SUBMITTED !== true) { newHtml = AppointmentScheduler.generateTable(); AppointmentScheduler.setTableData(); } } return newHtml; }, target: function target() { return 'WAVE-form'; }, onReRender: function onReRender() { var elementName = 'appointment_scheduler'; var thisConfig = FORM_DATA_MAP[elementName]; var elementID = thisConfig.attributes.id; var value = thisConfig.value; var error = thisConfig.errorMessage; var shouldBeShown = UtilityService.extractValue(thisConfig.show) === true; var element = document.getElementById(elementID); if (element) { element.style.display = shouldBeShown ? 'inherit' : 'none'; if (shouldBeShown === true) { element.innerHTML = UtilityService.extractValue(thisConfig.children); var errorMessageElement = element.querySelector('.wave-error-message'); if (errorMessageElement) { var hasError = !!error; errorMessageElement.style.display = hasError ? 'inherit' : 'none'; errorMessageElement.innerText = hasError ? error : ''; } } } } }, appointment_call_me: { tag: 'div', isFormItem: true, databaseKey: CONSTANTS.DATABASE_KEY_MAP['appointmentCallMe'], attributes: { id: 'WAVE-appointment-scheduler-call-me', "class": function _class() { return ''; } }, sanitize: function sanitize(value) { return value === true ? '1' : '0'; }, customRequiredMessage: false, required: false, hiddenValue: true, show: false, children: function children() { return ''; }, target: function target() { return 'WAVE-form'; }, onReRender: function onReRender() { var elementName = 'appointment_call_me'; var thisConfig = FORM_DATA_MAP[elementName]; var elementID = thisConfig.attributes.id; var value = thisConfig.value; var shouldBeShown = UtilityService.extractValue(thisConfig.show) === true; var element = document.getElementById(elementID); if (element) { element.style.display = shouldBeShown ? 'inherit' : 'none'; } } }, submit: { tag: 'button', attributes: { id: 'WAVE-submit', "class": function _class() { return CONFIG.CLASSES.BUTTON_SUBMIT; }, type: 'button', onclick: 'window.$wave_action_submitForm(event)' }, show: function show() { var thisConfig = FORM_DATA_MAP['submit']; var isSubmitted = CONFIG.IS_SUBMITTED; return isSubmitted === false && showFormDetailInputs(); }, children: function children() { return _getText('TEXT.SUBMIT_BUTTON'); }, target: function target() { return 'WAVE-form'; }, onReRender: function onReRender() { var elementName = 'submit'; var thisConfig = FORM_DATA_MAP[elementName]; var elementID = thisConfig.attributes.id; var value = thisConfig.value; var shouldBeShown = UtilityService.extractValue(thisConfig.show) === true; var element = document.getElementById(elementID); if (element) { element.style.display = shouldBeShown ? 'inherit' : 'none'; if (shouldBeShown) { setElementDisability(element); } } } }, reset: { tag: 'button', attributes: { id: 'WAVE-reset', "class": function _class() { return CONFIG.CLASSES.BUTTON_RESET; }, type: 'button', onclick: 'window.$wave_action_resetForm(event)' }, show: function show() { var thisConfig = FORM_DATA_MAP['reset']; var isSubmitted = CONFIG.IS_SUBMITTED; return isSubmitted === false && CONFIG.SHOW.RESET_BUTTON; }, children: function children() { return _getText('TEXT.RESET_BUTTON'); }, target: function target() { return 'WAVE-form'; }, onReRender: function onReRender() { var elementName = 'reset'; var thisConfig = FORM_DATA_MAP[elementName]; var elementID = thisConfig.attributes.id; var value = thisConfig.value; var shouldBeShown = UtilityService.extractValue(thisConfig.show) === true; var element = document.getElementById(elementID); if (element) { element.style.display = shouldBeShown ? 'inherit' : 'none'; if (shouldBeShown) { setElementDisability(element); } } } }, languagePicker: { tag: 'div', attributes: { id: 'WAVE-language-picker', "class": function _class() { return CONFIG.CLASSES.LANGUAGE_PICKER; } }, show: function show() { var thisConfig = FORM_DATA_MAP['languagePicker']; var isSubmitted = CONFIG.IS_SUBMITTED; var languageOptions = UtilityService.extractValue(thisConfig.options); return isSubmitted === false && languageOptions.length > 0; }, children: function children() { var thisConfig = FORM_DATA_MAP['languagePicker']; var languageOptions = UtilityService.extractValue(thisConfig.options); return languageOptions.map(function (language) { var isSelected = _getLanguage() === language.value; if (isSelected) { return "".concat(language.text, ""); } else { return "").concat(language.text, ""); } }).join(''); }, options: function options() { return CONFIG.LANGUAGE_OPTIONS; }, onReRender: function onReRender() { var thisConfig = FORM_DATA_MAP['languagePicker']; var elementID = thisConfig.attributes.id; var shouldBeShown = UtilityService.extractValue(thisConfig.show) === true; var element = document.getElementById(elementID); if (element) { element.style.display = shouldBeShown ? 'inherit' : 'none'; } } }, warning: { tag: 'p', attributes: { id: 'WAVE-warning', "class": function _class() { return CONFIG.CLASSES.WARNING; } }, show: function show() { var thisConfig = FORM_DATA_MAP['warning']; var isSubmitted = CONFIG.IS_SUBMITTED; return isSubmitted === false && CONFIG.SHOW.WARNING; }, children: function children() { return _getText('TEXT.WARNING'); }, target: function target() { return 'WAVE-form'; }, onReRender: function onReRender() { var elementName = 'warning'; var thisConfig = FORM_DATA_MAP[elementName]; var elementID = thisConfig.attributes.id; var value = thisConfig.value; var shouldBeShown = UtilityService.extractValue(thisConfig.show) === true; var element = document.getElementById(elementID); if (element) { element.style.display = shouldBeShown ? 'inherit' : 'none'; } } }, successMessage: { tag: 'div', attributes: { id: 'WAVE-successMessage', "class": function _class() { return CONFIG.CLASSES.SUCCESS_MESSAGE_BOX; } }, showOnSubmissionSuccess: true, show: function show() { var thisConfig = FORM_DATA_MAP['successMessage']; return CONFIG.IS_SUBMITTED; }, target: 'WAVE-form', value: null, children: function children() { var title = "").concat(_getText('TEXT.SUBMISSION_SUCCESS_MESSAGE'), "
\n "); return [title, description].join('\n'); }, onReRender: function onReRender() { var elementName = 'successMessage'; var thisConfig = FORM_DATA_MAP[elementName]; var elementID = thisConfig.attributes.id; var value = thisConfig.value; var shouldBeShown = UtilityService.extractValue(thisConfig.show) === true; var element = document.getElementById(elementID); if (element) { element.style.display = shouldBeShown ? 'inherit' : 'none'; } } } }; window.$wave_FORM_DATA_MAP = FORM_DATA_MAP; var FORM_RENDER_ORDER = ['form', 'title', 'description', 'alertMessage', 'patientStatus', 'services', 'locations', 'google_maps', 'appointment_scheduler', 'appointment_call_me', 'firstName', 'lastName', 'age', 'email', 'phone', 'reference', 'inquiry', 'textMessageConsent', 'submit', 'reset', 'warning', 'languagePicker', 'successMessage']; logDebugValue('version number:', versionNumber, { force: true }); setTimeout(function () { run(); }); //==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-// //PUBLIC METHODS function createForm(id, config) { CONFIG.CUSTOM_START_CALLED = true; logDebugValue('create form function was called', true, { force: true }); if (!!id) { CONFIG.CUSTOM_ID = id; } FORM_DATA_MAP.locations.options = []; resetFormHasLoadedValues(); saveFormAttributes(); generateForm(config && config.reRender === true); } exports.createForm = createForm; //==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-==--====--=----=-// //PRIVATE METHODS function run(attempts) { var MAX_ATTEMPTS = 7; attempts = attempts || 0; if (inquiryFormIDExists()) { if (CONFIG.CUSTOM_START_CALLED !== true) { saveFormAttributes(); if (getFormSettingsAttribute('data-wait') !== 'true') { generateForm(); } } } else { if (attempts < MAX_ATTEMPTS) { setTimeout(function () { run(attempts + 1); }, 750); } else { logDebugValue('attempted to auto-load max times'); } } } function generateForm(reRender) { if (inquiryFormIDExists()) { CONFIG.TIMING.START_TIME = new Date().getTime(); logDebugValue('form generation beginning: ', CONFIG.TIMING.START_TIME); logDebugValue('form location was found by id:', getAppID(), { force: true }); prepareFormData(reRender); } else { var id = getAppID(); formErrorOccurred({ message: 'element could not be found by that ID: ' + id, fatal: true, status: 400 }); } } function prepareFormData(reRender) { CONFIG.TIMING.DOCTOR_LOADING = new Date().getTime(); getDoctorInfo().then(function success() { CONFIG.TIMING.DOCTOR_TIME = new Date().getTime(); logDebugValue('\n\n[PROGRESS] - elapsed time to get remote settings', generateProgressTime(CONFIG.TIMING.DOCTOR_TIME, CONFIG.TIMING.START_TIME)); configureApplicationSettings(); checkAndLogBasicSettings(); logDebugValue('show inquiry form', CONFIG.SHOW.INQUIRY_FORM); logDebugValue('show google maps', CONFIG.SHOW.GOOGLE_MAPS); logDebugValue('show exam scheduler', CONFIG.SHOW.ALLOW_APPOINTMENT_SCHEDULER); logDebugValue('show booked appointments', CONFIG.SHOW.UNAVAILABLE_APPOINTMENTS); logDebugValue('show placeholder appointments', CONFIG.SHOW.PLACEHOLDER_APPOINTMENTS); logDebugValue("found ".concat(FORM_DATA_MAP.locations.options.length, " locations:"), "(".concat(FORM_DATA_MAP.locations.options.map(function (obj) { return obj.name; }).join(', '), ")")); renderForm(reRender); }, function (error) { formErrorOccurred(error); }); } function getDoctorInfo() { return new Promise(function (resolve, reject) { if (UtilityService.isObject(getDoctorData(), true) && getDoctorData().clientNumber === getDoctorID()) { resolve(); } else { var doctorID = getDoctorID(); var _isDemoMode = WaveInquiryForm.demoMode === true; if (!!doctorID || _isDemoMode) { logDebugValue('found doctor id:', doctorID); DataService.getDoctorData(doctorID).then(function (response) { if (response.status === 204) { logDebugValue('invalid doctor id', doctorID); reject({ message: 'invalid doctor id', doctorID: doctorID, fatal: true, status: 400 }); } else { storeDoctorData(response.data[0]); logSuperDebugValue('doctor data', response.data[0]); resolve(); } }, function (error) { if (error.status === 403) { reject({ message: error.data.message, action: 'Please contact WaveOrtho to diagnose this issue or to subscribe to the inquiry form service', status: 403, fatal: true }); } else { logDebugValue('unknown server error when getting doctor information, if this error persists, please contact WaveOrtho support', error); reject(error); } }); } else { logDebugValue('no doctor id was found', '', { force: true, logType: 'error' }); reject({ message: 'No doctor id was found', fatal: true }); } } }); } function configureApplicationSettings() { setAttributeDataSettings(); setDoctorDataSettings(); setDefaultFormConfigItems(); } function setAttributeDataSettings() { var attributeData = getAttributeSettings(); var attributeConfigMap = getAttributeConfigMap(); var selectedCSSLibrary = attributeData['data-default-css-library']; if (CONSTANTS.CSS_LIBRARIES[selectedCSSLibrary]) { CONSTANTS.CLASSES = CONSTANTS.CSS_LIBRARIES[selectedCSSLibrary]; CONFIG.SETTINGS.DEFAULT_CSS_LIBRARY = selectedCSSLibrary; } checkLanguageSettings(attributeData); checkDataReferencesLocationSettings(attributeData); checkFakeDataSettings(attributeData); attributeConfigMap.forEach(function (obj) { if (obj.manual !== true) { var inputValue = attributeData[obj.attribute]; var type = obj.type; if (type === 'overwrite') { var defaultValue = UtilityService.isFunction(obj["default"]) ? obj["default"]() : obj["default"]; if (UtilityService.isString(inputValue, !obj.allowEmptyString) === false) { inputValue = defaultValue; } else if (obj.appendable === true) { if (inputValue[0] === '+') { inputValue = inputValue.substr(1); inputValue = inputValue + ' ' + defaultValue; } } } else if (type === 'boolean') { var isValidInput = inputValue === 'true' || inputValue === 'false'; if (isValidInput) { inputValue = inputValue === 'true'; } else { inputValue = UtilityService.isFunction(obj["default"]) ? obj["default"]() : obj["default"]; } } CONFIG[obj.group] = UtilityService.isObject(CONFIG[obj.group]) ? CONFIG[obj.group] : {}; CONFIG[obj.group][obj.key] = inputValue; } }); } function setDoctorDataSettings() { var doctorData = getDoctorData(); setInquiryFormSettings(doctorData); setGoogleMapSettings(doctorData); setExamSchedulerSettings(doctorData); setCustomReferenceSettings(doctorData); setCustomAgeOptionsSettings(doctorData); setLocationSettings(doctorData); setDefaultPatientStatus(doctorData); if (CONFIG.SHOW.GOOGLE_MAPS === true && FORM_DATA_MAP.google_maps.hiddenLocations && FORM_DATA_MAP.google_maps.hiddenLocations.length > 0) { filterGoogleMapLocations(); } } function setDefaultFormConfigItems() { CONFIG.IS_DISABLED = false; CONFIG.IS_SUBMITTED = false; } function checkAndLogBasicSettings() { var doctorData = getDoctorData(); var inquiryFormSubscriptionIsInactive = doctorData.flagInquiryForm !== '1'; var examSchedulerSubscriptionIsInactive = doctorData.flagApptScheduler !== '1'; if (inquiryFormSubscriptionIsInactive) { logDebugValue('INQUIRY FORM SUBSCRIPTION IS INACTIVE', inquiryFormSubscriptionIsInactive, { show: inquiryFormSubscriptionIsInactive }); formErrorOccurred({ message: 'Inquiry Form subscription is inactive', status: 400 }); } else { if (examSchedulerSubscriptionIsInactive) { logDebugValue('EXAM SCHEDULER SUBSCRIPTION IS INACTIVE', examSchedulerSubscriptionIsInactive, { show: examSchedulerSubscriptionIsInactive }); } } var customCSSLibraryInput = window.$wave_FORM_ATTRIBUTES['data-default-css-library']; var isValidName = !!customCSSLibraryInput && !CONFIG.SETTINGS.DEFAULT_CSS_LIBRARY; logDebugValue('custom css library is being used:', customCSSLibraryInput, { show: !!customCSSLibraryInput }); logDebugValue('invalid custom css library:', customCSSLibraryInput, { show: isValidName }); } function formErrorOccurred(errorObj) { var fatal = errorObj && errorObj.fatal && errorObj.fatal === true; if (fatal) { console.error(errorObj); } if (UtilityService.isFunction(WaveInquiryForm.onFormRenderError)) { WaveInquiryForm.onFormRenderError(errorObj); } } function generateAppointmentConfirmationString() { return AppointmentScheduler.generateAppointmentString(FORM_DATA_MAP.appointment_scheduler.value, getLocationName()); } /** * Whether the form should render the input based on whether the user has selected an appointment */ function showFormDetailInputs() { var appointmentSchedulerIsShowing = CONFIG.SHOW.APPOINTMENT_SCHEDULER && CONFIG.SHOW.ALLOW_APPOINTMENT_SCHEDULER === true; var locationsAreHiddenWithBadDefault = CONFIG.SETTINGS.HIDE_LOCATIONS === true && CONFIG.SETTINGS.INVALID_DEFAULT_LOCATION === true; var apptValueExists = !!FORM_DATA_MAP.appointment_scheduler.value || FORM_DATA_MAP.appointment_call_me.value === true; var patientIsNotNew = FORM_DATA_MAP.patientStatus.value !== 'New Patient'; return appointmentSchedulerIsShowing === false || patientIsNotNew || locationsAreHiddenWithBadDefault === true || apptValueExists; } function getLocationName() { var locationSelectorID = FORM_DATA_MAP.locations.value; var locationName = ''; if (locationSelectorID) { var locationList = FORM_DATA_MAP.locations.options; var locationObject = locationList.filter(function (locationObj) { return locationObj.id === locationSelectorID; })[0]; if (locationObject) { var qualifier = getLocationQualifier(); locationName = qualifier + ' ' + locationObject['name']; } } return locationName; } function getLocationQualifier() { var validLocationQualifierMap = { 'with': 'WITH', 'in': 'IN', 'at': 'AT' }; var locationQualifierAttribute = window.$wave_FORM_ATTRIBUTES['data-appointment-confirmation-location-qualifier']; var selectedQualifierType = validLocationQualifierMap[locationQualifierAttribute] ? validLocationQualifierMap[locationQualifierAttribute] : validLocationQualifierMap['in']; return _getText('TEXT.' + selectedQualifierType, { object: CONSTANTS }); } function resetForm() { if (CONFIG.SHOW.RESET_ALERT === true) { var answer = confirm(CONFIG.TEXT.RESET_ALERT); if (answer === true) { handleFormReset(); } } else { handleFormReset(); } } window.$wave_action_resetForm = resetForm; function changeLanguage(event) { if (event && event.srcElement) { var element = event.srcElement; var selectedLanguage = element.getAttribute('value'); if (isValidLanguage(selectedLanguage) && _getLanguage() !== selectedLanguage) { CONFIG.LANGUAGE = selectedLanguage; renderForm(true); } } } window.$wave_action_changeLanguage = changeLanguage; function handleFormReset() { resetFormValues(); CONFIG.IS_SUBMITTED = false; CONFIG.IS_DISABLED = false; if (UtilityService.isFunction(WaveInquiryForm.onFormReset)) { WaveInquiryForm.onFormReset(); } renderForm(); } function setElementDisability(element) { if (element) { if (CONFIG.IS_DISABLED === true) { element.setAttribute('disabled', true); } else { element.removeAttribute('disabled'); } } } function resetFormValues() { FORM_RENDER_ORDER.forEach(function (formKey) { FORM_DATA_MAP[formKey].value = ''; FORM_DATA_MAP[formKey].altValue = ''; }); } function resetAppointmentScheduler() { var apptSchedulerFormDataObj = FORM_DATA_MAP['appointment_scheduler']; apptSchedulerFormDataObj.value = undefined; var apptSchedulerCallMeFormDataObj = FORM_DATA_MAP['appointment_call_me']; apptSchedulerCallMeFormDataObj.value = undefined; renderForm(); } window.resetAppointmentScheduler = resetAppointmentScheduler; function selectLocationByKeyValue(key, value) { if (key && value) { var locationsConfig = FORM_DATA_MAP['locations']; var locations = locationsConfig.options; if (locations && Array.isArray(locations) && locations.length > 0) { var selectedLocation = locations.filter(function (singleLocationObj) { return singleLocationObj[key] === value; })[0]; if (selectedLocation && selectedLocation.id) { locationsConfig.value = selectedLocation.id; setTimeout(function () { resetAppointmentScheduler(); renderForm(); }, 1); } } } } window._selectLocationByKeyValue = selectLocationByKeyValue; function appointmentTimeClick(element) { var apptID = element.getAttribute('data-appt-id'); if (!!apptID) { var parentElement = element.parentNode; var time = parentElement.getAttribute('data-row-time'); var date = parentElement.getAttribute('data-date'); var formDataObj = FORM_DATA_MAP['appointment_scheduler']; formDataObj.value = { Appt_ID: apptID, time: time, date: date }; renderForm(); } } window.appointmentTimeClick = appointmentTimeClick; function appointmentCallMe(element) { var formDataObj = FORM_DATA_MAP['appointment_call_me']; formDataObj.value = true; renderForm(); } window.$wave_callMe = appointmentCallMe; function inputChanged(event, options) { options = options && _typeof(options) === 'object' ? options : {}; var sourceElement = event.target; var newValue = sourceElement.value; var formMapID = sourceElement.getAttribute('data-map-id'); var valueKey = sourceElement.getAttribute('data-value-key'); if (!valueKey || valueKey === 'undefined') { valueKey = 'value'; } if (formMapID) { var itemConfig = FORM_DATA_MAP[formMapID]; if (itemConfig) { if (UtilityService.isFunction(itemConfig.onChange)) { itemConfig.onChange(newValue); } itemConfig[valueKey] = newValue; itemConfig.errorMessage = null; } } renderForm(); } window.$wave_action_inputChanged = inputChanged; function onClick(event) { var isClickInside = event.target.className === 'popover-locations-list'; if (!isClickInside) { $('[data-bs-toggle="popover"]').popover('hide'); } } function showPopover(e) { document.addEventListener('click', onClick); $('[data-bs-toggle="popover"]').popover('toggle'); e.stopPropagation(); } window.$wave_action_showPopover = showPopover; function locationSelected(event, options) { //close popover $('[data-bs-toggle="popover"]').popover('hide'); document.removeEventListener('click', onClick); options = options && _typeof(options) === 'object' ? options : {}; var sourceElement = event.target; var newValue = sourceElement.attributes['data-value'].value; var valueKey = 'value'; var itemConfig = FORM_DATA_MAP['locations']; if (itemConfig) { if (UtilityService.isFunction(itemConfig.onChange)) { itemConfig.onChange(newValue); } itemConfig[valueKey] = newValue; itemConfig.errorMessage = null; } renderForm(); } window.$wave_action_locationSelected = locationSelected; function formIsValid() { var requiredFields = getRequiredFields(); var totalErrors = 0; requiredFields.forEach(function (itemConfig) { itemConfig.errorMessage = null; var currentValue = itemConfig.value; if (itemConfig.value === 'Other' && !!itemConfig.hasAltValue) { currentValue = itemConfig.altValue; } var config = getSystemConfig(itemConfig); if (UtilityService.isFunction(itemConfig.validate)) { var customValidationResults = itemConfig.validate(config); if (customValidationResults !== true) { itemConfig.errorMessage = customValidationResults; } } else if (!currentValue) { if (itemConfig.defaultValue) { itemConfig.value = itemConfig.defaultValue; } else { var errorMessage = !!itemConfig.customRequiredMessage ? itemConfig.customRequiredMessage : _getText('TEXT.FIELD_IS_REQUIRED', { object: CONSTANTS }); itemConfig.errorMessage = errorMessage; } } if (!!itemConfig.errorMessage) { totalErrors = totalErrors + 1; } }); if (totalErrors > 0) { return totalErrors; } else { return true; } } function getSanitizedDatabaseObject() { var returnObj = {}; var formItems = getFormItems(); formItems.forEach(function (itemConfig) { var config = getSystemConfig(itemConfig); var isShowing = UtilityService.isFunction(itemConfig.show) ? itemConfig.show(config) : itemConfig.show; var isHiddenValue = itemConfig.hiddenValue && itemConfig.hiddenValue === true; var databaseKey = itemConfig.databaseKey; var value = itemConfig.value; if (FORM_DATA_MAP.reference.isOtherOption(itemConfig.value) && (!!itemConfig.altValue || itemConfig.altValue === '') && UtilityService.isString(itemConfig.altValue)) { var newValue = itemConfig.altValue; newValue = newValue.trim(); newValue = newValue.substr(0, 100); //limit to 100 characters value = '(other) - ' + newValue; } if (UtilityService.isFunction(itemConfig.sanitize)) { value = itemConfig.sanitize(value); } if (!!itemConfig.defaultValue && !itemConfig.value) { value = itemConfig.defaultValue; } if (UtilityService.isInteger(itemConfig.characterLimit) && !!value && typeof value === 'string') { value = value.substr(0, itemConfig.characterLimit); } if (isShowing === true || isHiddenValue) { returnObj[databaseKey] = value; } }); return returnObj; } function handleFormSubmission(status) { if (WaveInquiryForm && WaveInquiryForm.onFormSubmission && UtilityService.isFunction(WaveInquiryForm.onFormSubmission)) { var responseObject = { error: 'An unknown internal error occurred' }; if (status && status === 200) { responseObject = {}; var appointmentMessage; if (!!FORM_DATA_MAP.appointment_scheduler.value) { appointmentMessage = generateAppointmentConfirmationString(); } else if (FORM_DATA_MAP.appointment_call_me.value === true) { appointmentMessage = 'Our office will call you to schedule an appointment'; } if (appointmentMessage) { responseObject.appointmentMessage = appointmentMessage; } } WaveInquiryForm.onFormSubmission(responseObject); } if (CONFIG.SETTINGS.SUBMISSION_REDIRECT_URL) { var url = CONFIG.SETTINGS.SUBMISSION_REDIRECT_URL; var urlHasQuery = url.indexOf('?') > -1; var urlBeginning = urlHasQuery === true ? url.substring(0, url.indexOf('?')) : url; var parameters = {}; if (urlHasQuery) { parameters = HTMLService.extractUrlParameters(url); } if (CONFIG.SETTINGS.REMOVE_URL_APPOINTMENT_MESSAGE !== true) { if (!!FORM_DATA_MAP.appointment_scheduler.value) { parameters['appointmentMessage'] = generateAppointmentConfirmationString(); } else if (FORM_DATA_MAP.appointment_call_me.value === true) { parameters['appointmentMessage'] = 'Our office will call you to schedule an appointment'; } } var urlEnding = HTMLService.objectToUrlParameters(parameters); document.location = "".concat(urlBeginning, "?").concat(urlEnding); } } function submitForm(event) { var formValidationResults = formIsValid(); FORM_DATA_MAP.alertMessage.value = null; CONFIG.IS_DISABLED = false; if (formValidationResults === true) { CONFIG.IS_DISABLED = true; renderForm(); var sanitizedObject = getSanitizedDatabaseObject(); var options = { source: CONFIG.SETTINGS.SOURCE, sourceDetails: CONFIG.SETTINGS.SOURCE_DETAILS, language: _getLanguage(), formVersion: versionNumber }; if (saveInProgress === false) { saveInProgress = true; DataService.saveToDatabase(sanitizedObject, getDoctorID(), options).then(function (response) { if (response.status === 200) { setSubmissionSuccess(); var userHasSelectedAnAppointment = !!sanitizedObject.Appt_ID; if (userHasSelectedAnAppointment) { DataService.updateAppointmentData(sanitizedObject.Appt_ID, {}).then(function (response) { logSuperDebugValue('response', response); }, function (error) { console.error(error); }); } } else { setSubmissionError(); } handleFormSubmission(response.status); logSuperDebugValue('response', response); logSuperDebugValue('submission data', sanitizedObject); if (isTestMode()) { logSuperDebugValue('submission data [stringified]', JSON.stringify(sanitizedObject)); } saveInProgress = false; }, function (error) { logSuperDebugValue('response error', error); setSubmissionError(); handleFormSubmission(); saveInProgress = false; }); } } else { var YOU_HAVE = _getText('TEXT.YOU_HAVE', { object: CONSTANTS }); var ERROR = _getText(formValidationResults > 1 ? 'TEXT.ERRORS' : 'TEXT.ERROR', { object: CONSTANTS }); var TO_ADDRESS = _getText('TEXT.TO_ADDRESS', { object: CONSTANTS }); FORM_DATA_MAP.alertMessage.value = "".concat(YOU_HAVE, " ").concat(formValidationResults, " ").concat(ERROR, " ").concat(TO_ADDRESS); renderForm(); } } window.$wave_action_submitForm = submitForm; function setSubmissionSuccess() { CONFIG.IS_SUBMITTED = true; CONFIG.IS_DISABLED = false; renderForm(); setTimeout(function () { var appElement = getAppForm(); appElement.scrollIntoView(); var apptElement = document.querySelector('.wave-completion-message-header'); if (apptElement) { var waveSuccessElement = document.getElementById('WAVE-successMessage'); var successMessageElement = waveSuccessElement.querySelector('p'); var confirmClass = successMessageElement.getAttribute('class'); var text = apptElement.innerHTML; var newApptConfirmElement = HTMLService.createElement('p', { className: confirmClass }, text); waveSuccessElement.appendChild(newApptConfirmElement); var apptContainerElement = document.getElementById('WAVE-appointment-scheduler'); apptContainerElement.parentNode.removeChild(apptContainerElement); } }, 100); renderForm(); } function setSubmissionError() { CONFIG.IS_DISABLED = false; FORM_DATA_MAP.alertMessage.value = _getText('SUBMISSION_ERROR_MESSAGE', { object: CONSTANTS.TEXT }); renderForm(); } function getRequiredFields() { return getFormItems().filter(function (itemConfig) { var config = getSystemConfig(itemConfig); var show = UtilityService.isFunction(itemConfig.show) ? itemConfig.show(config) : itemConfig.show; var required = UtilityService.isFunction(itemConfig.required) ? itemConfig.required(config) : itemConfig.required; return show === true && required === true; }); } function getFormItems() { return FORM_RENDER_ORDER.map(function (key) { return FORM_DATA_MAP[key]; }).filter(function (config) { return config.isFormItem === true; }); } function resetFormHasLoadedValues() { FORM_RENDER_ORDER.forEach(function (key) { FORM_DATA_MAP[key].hasLoaded = false; }); } function generateProgressTime(laterTime, startTime) { var msDifference = laterTime - startTime; return msDifference / 1000 + ' seconds'; } function storeDoctorData(data) { window.$wave_DOCTOR_DATA = data; } function getDoctorData() { return window.$wave_DOCTOR_DATA; } function getAttributeConfigMap() { return ATTRIBUTE_CONFIG_MAP; } function isJson(str) { try { JSON.parse(str); } catch (e) { return false; } return true; } function convertQuotesAndFormatAsJson(item) { logSuperDebugValue('text to be converted', item); var replacedText = !!item && typeof item === 'string' && item.split(['&', 'quot', ';'].join('')).join('"'); logSuperDebugValue('replacedText', replacedText); logSuperDebugValue('is json', isJson(replacedText)); if (!!replacedText && isJson(replacedText)) { return JSON.parse(replacedText); } else { return false; } } function getFormattedMapData(doctorData) { var newValue = convertQuotesAndFormatAsJson(doctorData.map_data); if (_typeof(newValue) === 'object' && Object.keys(newValue).length > 0) { return newValue; } else { throw new Error('Map data is invalid'); } } function getFormattedLocationData(doctorData) { var newLocations = convertQuotesAndFormatAsJson(doctorData.locations); logSuperDebugValue('newLocations', newLocations); logSuperDebugValue('doctorData.locations', doctorData.locations); var locations = UtilityService.isArray(newLocations) ? newLocations : []; if (locations && locations.length > 0) { locations = locations.map(function (locationObj) { if (locationObj && locationObj['name']) { locationObj['name'] = locationObj['name'].trim(); } return locationObj; }).filter(function (locationObj) { return !!locationObj.name; }); } return sortLocationData(locations); } function getFormattedCustomReferenceData(doctorData) { logSuperDebugValue('doctorData.customReferences', doctorData.customReferences); var newReferences = convertQuotesAndFormatAsJson(doctorData.customReferences); logSuperDebugValue('customReferences', newReferences); var customReferences = UtilityService.isArray(newReferences) ? newReferences : []; if (customReferences && customReferences.length > 0) { customReferences = customReferences.filter(function (item) { return UtilityService.isString(item, true); }).map(function (referenceString) { var maxStringLimit = 100; referenceString = referenceString.trim(); if (referenceString.length > maxStringLimit) { referenceString = referenceString.substr(0, maxStringLimit); } return referenceString; }); } return customReferences; } function getFormattedCustomAgeOptionsData(doctorData) { logSuperDebugValue('doctorData.customAgeOptions', doctorData.customAgeOptions); var newAgeOptions = convertQuotesAndFormatAsJson(doctorData.customAgeOptions); logSuperDebugValue('customAgeOptions', newAgeOptions); var customAgeOptions = UtilityService.isArray(newAgeOptions) ? newAgeOptions : []; if (customAgeOptions && customAgeOptions.length > 0) { customAgeOptions = customAgeOptions.filter(function (item) { return UtilityService.isString(item, true); }).map(function (ageOptionString) { var maxStringLimit = 100; ageOptionString = ageOptionString.trim(); if (ageOptionString.length > maxStringLimit) { ageOptionString = ageOptionString.substr(0, maxStringLimit); } return ageOptionString; }); } return customAgeOptions; } function isDemoMode() { return WaveInquiryForm.demoMode === true; } function isDebugMode() { return CONFIG.SETTINGS.DEBUG_MODE === 'true' || isSuperDebugMode(); } function isSuperDebugMode() { return window.$wave_FORM_ATTRIBUTES['data-super-debug-mode'] === 'true'; } /** * * @param {String} label * @param {*} [value] * @param {Object} [options] * @param {Boolean} [options.show] * @param {Boolean} [options.force] * @param {'warn', 'error'} [options.logType] */ function logDebugValue(label, value, options) { setTimeout(function () { value = value === null || value === undefined ? '' : value; options = UtilityService.isObject(options) ? options : {}; var _boolean3 = options.show === true || options.show === false ? options.show : true; var attributesExist = !!window.$wave_FORM_ATTRIBUTES && Object.keys(window.$wave_FORM_ATTRIBUTES).length > 0; var force = attributesExist ? window.$wave_FORM_ATTRIBUTES['data-debug-mode'] === 'true' : options.force === true; var logType = !!options.logType ? options.logType : 'log'; if ((isDebugMode() === true || force === true) && _boolean3 === true) { var debugString = 'wave-inquiry-form:'; console[logType](debugString, label, value); } }); } function logSuperDebugValue(label, value, options) { if (isSuperDebugMode()) { options = UtilityService.isObject(options) ? options : {}; options.force = true; logDebugValue(label, value, options); } } function sortLocationData(locations) { if (locations && locations.length > 1) { return locations.sort(function (a, b) { var aName = a.name; var bName = b.name; if (aName < bName) { return -1; } else if (aName > bName) { return 1; } else { return 0; } }); } else { return locations; } } function isValidMapData(importedData) { if (importedData.centerCoordinates) { var centerCoordinates = importedData.centerCoordinates; if (centerCoordinates.zoom && centerCoordinates.lat && centerCoordinates.lng) { if (importedData.smallCoordinates) { var smallCoordinates = importedData.smallCoordinates; if (smallCoordinates.zoom && centerCoordinates.lat && centerCoordinates.lng) { if (importedData.locations && Array.isArray(importedData.locations)) { if (importedData.locations.length > 0) { var invalidLocations = importedData.locations.filter(function (location) { var allFieldsArePresent = location.coordinates && location.coordinates.zoom && location.coordinates.lat && location.coordinates.lng && location.name && location.address; var idIsPresent = !!location.id; if (importedData.locations.length === 1) { return allFieldsArePresent === false; } else { return allFieldsArePresent === false && idIsPresent === false; } }); if (invalidLocations.length > 0) { throw Error('map_data.locations {coordinates: {zoom, lat, lng}, name, id, address} contains at least one invalid location: ' + JSON.stringify(invalidLocations)); } else { return true; } } else { throw Error('map_data.locations must contain at least one map point object'); } } else { throw Error('map_data.locations is required, and it must be an array'); } } else { throw Error('map_data.smallCoordinates requires zoom, lat, and lng values'); } } else { throw Error('map_data.smallCoordinates is required, and it must be an object'); } } else { throw Error('map_data.centerCoordinates requires zoom, lat, and lng values'); } } else { throw Error('map_data.centerCoordinates is required, and it must be an object'); } } /** * * @param {Object} doctorData * @param {'1' | '0'} doctorData.flagInquiryFormGoogleMaps */ function setGoogleMapSettings(doctorData) { CONFIG.SHOW.GOOGLE_MAPS = doctorData.flagInquiryFormGoogleMaps === '1'; var shouldBeShown = CONFIG.SHOW.GOOGLE_MAPS === true && CONFIG.SHOW.GOOGLE_MAPS_LOCAL === true; var mapData = null; if (shouldBeShown === true) { try { mapData = getFormattedMapData(doctorData); isValidMapData(mapData); FORM_DATA_MAP.google_maps.options = mapData; } catch (e) { logDebugValue('Map is set to be shown, but the map data is invalid.', '', { logType: 'warn' }); logSuperDebugValue(e, null, { logType: 'error' }); CONFIG.SHOW.GOOGLE_MAPS = false; } } } /** * * @param {Object} doctorData * @param {'1', '0'} doctorData.flagApptScheduler * @param {'1', '0'} doctorData.settingApptSchedulerShowBooked * @param {'1', '0'} doctorData.settingApptSchedulerShowClosedDays * @param {'1', '0'} doctorData.settingApptSchedulerHideTodaysAppts * @param {Number} doctorData.settingApptSchedulerHoursFromNow */ function setExamSchedulerSettings(doctorData) { var showAppointmentScheduler = doctorData.flagApptScheduler === '1'; if (isDemoMode()) { showAppointmentScheduler = true; } CONFIG.SHOW.ALLOW_APPOINTMENT_SCHEDULER = showAppointmentScheduler === true; if (CONFIG.SHOW.ALLOW_APPOINTMENT_SCHEDULER) { var showUnavailableAppts = doctorData.settingApptSchedulerShowBooked === '1'; var showPlaceholderAppts = doctorData.settingApptSchedulerShowClosedDays === '1'; var showTodaysAppts = doctorData.settingApptSchedulerHideTodaysAppts !== '1'; var hoursFromNow = isNaN(doctorData.settingApptSchedulerHoursFromNow) === false ? Number(doctorData.settingApptSchedulerHoursFromNow) : 1; CONFIG.SHOW.UNAVAILABLE_APPOINTMENTS = showUnavailableAppts === true; CONFIG.SHOW.PLACEHOLDER_APPOINTMENTS = showPlaceholderAppts === true; if (CONFIG.SHOW.TODAYS_APPOINTMENTS === false) { CONFIG.SHOW.TODAYS_APPOINTMENTS = showTodaysAppts === true; } CONFIG.SETTINGS.TODAY_APPOINTMENT_BUFFER_HOURS = hoursFromNow; CONFIG.SETTINGS.SKIP_EMPTY_APPT_WEEKS = doctorData.settingApptSchedulerSkipEmptyApptWeeks === '1'; } var openTime = '09:00:00'; var closeTime = '17:00:00'; var increment = 15; FORM_DATA_MAP.appointment_scheduler.data = { openTime: openTime, closeTime: closeTime, increment: increment }; } /** * * @param {Object} doctorData * @param {Array} doctorData.customReferences */ function setCustomReferenceSettings(doctorData) { var customReferences = []; try { customReferences = getFormattedCustomReferenceData(doctorData); } catch (error) { logDebugValue('No custom references, or invalid custom reference data'); } if (customReferences && UtilityService.isArray(customReferences) && customReferences.length > 0) { var eachChildIsString = customReferences.filter(function (item) { return UtilityService.isString(item); }).length === customReferences.length; var eachChildIsObject = customReferences.filter(function (item) { return UtilityService.isObject(item); }).length === customReferences.length; if ((eachChildIsObject || eachChildIsString) && transformReferralMethods(customReferences).length > 0) { CONSTANTS.REFERRAL_METHODS = customReferences; logDebugValue('custom references are being used', customReferences); } } } /** * * @param {Object} doctorData * @param {Array} doctorData.customAgeOptions */ function setCustomAgeOptionsSettings(doctorData) { var customAgeOptions = []; try { customAgeOptions = getFormattedCustomAgeOptionsData(doctorData); } catch (error) { logDebugValue('No custom age options, or invalid custom age option data'); } if (customAgeOptions && UtilityService.isArray(customAgeOptions) && customAgeOptions.length > 0) { FORM_DATA_MAP.age.options = customAgeOptions; } } /** * * @param {Object} doctorData * @param {'1' | '0'} doctorData.flagInquiryForm */ function setInquiryFormSettings(doctorData) { var showInquiryForm = doctorData.flagInquiryForm === '1'; if (isDemoMode()) { showInquiryForm = true; } CONFIG.SHOW.INQUIRY_FORM = showInquiryForm === true; } function setDefaultPatientStatus() { if (CONFIG.SETTINGS.DEFAULT_PATIENT_STATUS) { var possibleStatusOptions = getPatientStatusOptionsList(); if (possibleStatusOptions.indexOf(CONFIG.SETTINGS.DEFAULT_PATIENT_STATUS) > -1) { FORM_DATA_MAP.patientStatus.defaultValue = CONFIG.SETTINGS.DEFAULT_PATIENT_STATUS; FORM_DATA_MAP.patientStatus.value = CONFIG.SETTINGS.DEFAULT_PATIENT_STATUS; logDebugValue('default patient status was set to', CONFIG.SETTINGS.DEFAULT_PATIENT_STATUS); } } } function getPatientStatusOptionsList() { var patientStatusOptions = _getText('PATIENT_CURRENT_STATUS', { object: CONSTANTS }); return patientStatusOptions.map(function (statusOption) { if (UtilityService.isObject(statusOption)) { return statusOption.value; } else { return statusOption; } }); } function setLocationSettings(doctorData) { var locationsAreHidden = CONFIG.SETTINGS.HIDE_LOCATIONS === true; var defaultLocationIsSet = !!window.$wave_FORM_ATTRIBUTES['data-default-location']; var noDefaultLocationIsWanted = window.$wave_FORM_ATTRIBUTES['data-no-default-location'] === 'true'; var locations = []; try { locations = getFormattedLocationData(doctorData); } catch (e) { logDebugValue('No locations, or invalid location data'); } FORM_DATA_MAP.locations.options = locations; logDebugValue('parsed locations', locations); if (Array.isArray(locations) && locations.length > 0) { if (typeof CONFIG.SETTINGS.HIDE_LOCATION_OPTIONS === 'string' && CONFIG.SETTINGS.HIDE_LOCATION_OPTIONS.length > 0) { var locationsToBeHidden = CONFIG.SETTINGS.HIDE_LOCATION_OPTIONS.split('||'); logDebugValue('Some location options are expected to be hidden', locationsToBeHidden); if (locationsToBeHidden.length > 0) { locationsToBeHidden = locationsToBeHidden.map(function (locationName) { return locationName.trim(); }); var currentLocationOptions = _toConsumableArray(locations); locations = []; FORM_DATA_MAP.locations.options = []; var hiddenLocations = []; currentLocationOptions.forEach(function (locationObj) { if (locationObj && locationObj.name) { if (locationsToBeHidden.includes(locationObj.name.trim()) === false) { locations.push(locationObj); } else { hiddenLocations.push(locationObj); } } }); FORM_DATA_MAP.google_maps.hiddenLocations = hiddenLocations; var hiddenLocationNames = hiddenLocations.map(function (locationObj) { return locationObj.name; }); logDebugValue("".concat(locationsToBeHidden.length, " location").concat(locationsToBeHidden.length === 1 ? '' : 's', " (").concat(locationsToBeHidden.map(function (name) { return '"' + name + '"'; }).join(', '), ") ").concat(locationsToBeHidden.length === 1 ? 'was' : 'were', " entered as locations to be hidden and ").concat(hiddenLocationNames.length, " location").concat(hiddenLocationNames.length === 1 ? '' : 's', " ").concat(hiddenLocationNames.length === 1 ? 'was' : 'were', " hidden").concat(hiddenLocationNames.length > 0 ? ': ' + hiddenLocationNames.map(function (name) { return '"' + name + '"'; }).join(', ') + '.' : '.')); FORM_DATA_MAP.locations.options = locations; if (FORM_DATA_MAP.locations.options.length === 0) { logDebugValue('all locations are being hidden'); CONFIG.SETTINGS.HIDE_LOCATIONS = true; locationsAreHidden = true; } } } if (locationsAreHidden) { if (defaultLocationIsSet) { logDebugValue('locations are hidden, but a default location has been set'); if (noDefaultLocationIsWanted) { logDebugValue('locations are hidden, but both the default location is set and the no-default-location setting is also set'); } } else { logDebugValue('locations are hidden, and no default location has been set'); } } else { if (defaultLocationIsSet && noDefaultLocationIsWanted) { logDebugValue('the "data-default-location" and "data-no-default-location" settings are both set'); } else if (noDefaultLocationIsWanted) { logDebugValue('No default location is set'); } else if (defaultLocationIsSet) { logDebugValue('Default location is set'); } } var position = 0; var isValidLocation = false; if (defaultLocationIsSet) { var defaultLocationValue = CONFIG.SETTINGS.DEFAULT_LOCATION; logDebugValue('default location: ', defaultLocationValue); var isNumber = isNaN(defaultLocationValue) === false; var isString = typeof defaultLocationValue === 'string'; var locationSettings; if (isNumber || isString) { if (isNumber === false && isString) { FORM_DATA_MAP.locations.options.forEach(function (locationObj, i) { var name = locationObj.name; if (name === defaultLocationValue) { locationSettings = i; isValidLocation = true; } }); } else { locationSettings = defaultLocationValue - 1; isValidLocation = true; } } logDebugValue('The default location match a stored value: ', isValidLocation); if (locationsAreHidden === true && isValidLocation === true || locationsAreHidden === false && locationSettings && !!FORM_DATA_MAP.locations.options[locationSettings]) { position = locationSettings; } } if (defaultLocationIsSet === false && noDefaultLocationIsWanted === true) { position = null; } if (position !== null && (locationsAreHidden === true && defaultLocationIsSet === true && isValidLocation === true || locationsAreHidden === false)) { FORM_DATA_MAP.locations.value = FORM_DATA_MAP.locations.options[position].id; } else { FORM_DATA_MAP.locations.value = null; CONFIG.SETTINGS.INVALID_DEFAULT_LOCATION = true; logDebugValue('locations are hidden and no default location was set. The appointment scheduler will be hidden until you enter a valid value in the "data-default-location" field or un-hide the locations.', null, { logType: 'warn' }); } } else { logDebugValue('No locations were found'); } } function filterGoogleMapLocations() { var hiddenLocations = FORM_DATA_MAP.google_maps.hiddenLocations; var mapData = FORM_DATA_MAP.google_maps.options; var mapLocations = _toConsumableArray(mapData.locations); var hiddenLocationIds = hiddenLocations.map(function (locationObj) { return locationObj.id; }); mapData.locations = []; mapLocations.forEach(function (mapLocationObj) { if (mapLocationObj && mapLocationObj.id) { if (hiddenLocationIds.includes(mapLocationObj.id) === false) { mapData.locations.push(mapLocationObj); } } }); } function checkDataReferencesLocationSettings(attributeData) { if (attributeData['data-references-input-before-name'] === 'true') { FORM_RENDER_ORDER.splice(FORM_RENDER_ORDER.indexOf('reference'), 1); FORM_RENDER_ORDER.splice(FORM_RENDER_ORDER.indexOf('firstName'), 0, 'reference'); } } function checkFakeDataSettings(attributeData) { if (attributeData['data-fake-data'] === 'true') { FORM_DATA_MAP.appointment_call_me.value = true; FORM_DATA_MAP.firstName.value = 'Test'; FORM_DATA_MAP.lastName.value = 'Test'; FORM_DATA_MAP.email.value = 'test@test.com'; FORM_DATA_MAP.phone.value = '1231231234'; } } function getValidLanguages() { return CONSTANTS.VALID_LANGUAGES; } function isValidLanguage(language) { return getValidLanguages().includes(language); } function checkLanguageSettings(attributeData) { var selectedLanguage = getFormSettingsAttribute('data-language'); if (UtilityService.isString(selectedLanguage)) { selectedLanguage = selectedLanguage.toLowerCase(); if (isValidLanguage(selectedLanguage)) { CONFIG.LANGUAGE = selectedLanguage; logDebugValue('language has been set', CONFIG.LANGUAGE); } } var selectedLanguageOptions = getFormSettingsAttribute('data-language-options'); if (selectedLanguageOptions) { logDebugValue('User has entered language options', selectedLanguageOptions); selectedLanguageOptions = selectedLanguageOptions.toLowerCase().split(',').map(function (item) { return item.trim(); }); var validSelectedLanguageOptions = selectedLanguageOptions.filter(function (option) { return isValidLanguage(option); }); var languageOptionsObj = {}; validSelectedLanguageOptions.forEach(function (language) { languageOptionsObj[language] = true; }); var uniqueAndValidLanguageOptions = Object.keys(languageOptionsObj); if (uniqueAndValidLanguageOptions.length > 1) { logDebugValue('found multiple valid language options', uniqueAndValidLanguageOptions); var languageMap = { english: 'English', spanish: 'Español', french: 'Français' }; CONFIG.LANGUAGE_OPTIONS = uniqueAndValidLanguageOptions.map(function (language) { return { value: language, text: languageMap[language] }; }); } else if (uniqueAndValidLanguageOptions.length === 1) { logDebugValue('Only one language option was found', uniqueAndValidLanguageOptions); } else { logDebugValue('found no language options that met the options:', getValidLanguages()); } } } /** * * @param {String} position * @param {Object} [options] * @param {Object} [options.object] * @returns {*} * @private */ function _getText(position, options) { options = UtilityService.isObject(options) ? options : {}; var object = UtilityService.isObject(options.object) ? options.object : CONFIG; var language = CONFIG.LANGUAGE; var value = extractValueFromObjectByString(object, position); if (UtilityService.isObject(value)) { return value[language]; } else { return value; } } exports._getText = _getText; function _getLanguage() { return CONFIG.LANGUAGE; } exports._getLanguage = _getLanguage; /** * * @param {Object} object * @param {String} location * @param {Object} [options] * @param {String} [options.incompleteReturn] - Will return a default value (incompleteReturn) if there are still keys left * @param {Boolean} [options.logEmptyValues] - log in the console if a return value is empty * @param {Boolean} [options.originalString] [hidden] - This is a manually set value for the first time the function is called * @returns {*} */ function extractValueFromObjectByString(object, location, options) { options = UtilityService.isObject(options) ? options : {}; options.originalString = !!options.originalString ? options.originalString : location; var keys = UtilityService.isString(location) ? location.split('.') : []; var nextItem = keys[0]; keys.splice(0, 1); var remainingItems = keys.join('.'); if (nextItem && UtilityService.isObject(object)) { var itemValue = object[nextItem]; if (UtilityService.isObject(itemValue)) { return extractValueFromObjectByString(itemValue, remainingItems, options); } else { if (options.logEmptyValues === true && !itemValue) { console.log('BLANK VALUE: (' + options.originalString + ': ' + (itemValue || 'UNDEFINED') + ')'); } return itemValue; } } else { if (keys.length > 0 && UtilityService.isString(options.incompleteReturn)) { return options.incompleteReturn; } else { return object; } } } UtilityService.extractValueFromObjectByString = extractValueFromObjectByString; function replaceObjectKeyValues(objectToBeUpdated, configObj, level) { var keys = Object.keys(configObj); keys.forEach(function (key) { var value = configObj[key]; if (UtilityService.isObject(value)) { if (UtilityService.isObject(objectToBeUpdated[key]) === false) { objectToBeUpdated[key] = value; } else { objectToBeUpdated[key] = replaceObjectKeyValues(objectToBeUpdated[key], value, level + 1); } } else { objectToBeUpdated[key] = configObj[key]; } }); return objectToBeUpdated; } function getSystemConfig(itemConfig) { return { config: CONFIG, attributes: window.$wave_FORM_ATTRIBUTES, doctor_data: getDoctorData(), map_data: FORM_DATA_MAP, self: itemConfig }; } /** * * @param {Boolean} [reRender=false] */ function renderForm(reRender) { reRender = reRender === true; if (CONFIG.FORM_HAS_RENDERED !== true || reRender === true) { insertForm(reRender); if (UtilityService.isFunction(WaveInquiryForm.onFormRender)) { WaveInquiryForm.onFormRender(); } } else { setObjectVisibility(); } } function insertForm(reRender) { var waveForm = document.getElementById(getAppID()); FORM_DATA_MAP['google_maps'].hasLoaded = false; var content = FORM_RENDER_ORDER.map(function (key, index) { var itemConfig = FORM_DATA_MAP[key]; var tag = itemConfig.tag, attributes = itemConfig.attributes, children = itemConfig.children; if (index > 0) { return "\n <".concat(tag, " ").concat(generateElementAttributes(attributes), ">\n ").concat(UtilityService.extractValue(children), "\n ").concat(tag, ">\n "); } }).filter(function (content) { return !!content; }).join(''); waveForm.innerHTML = "\n <".concat(FORM_DATA_MAP.form.tag, " ").concat(generateElementAttributes(FORM_DATA_MAP.form.attributes), ">\n ").concat(content, "\n ").concat(FORM_DATA_MAP.form.tag, ">\n "); CONFIG.FORM_HAS_RENDERED = true; setObjectVisibility(); } function setObjectVisibility() { FORM_RENDER_ORDER.forEach(function (itemName) { var itemConfig = FORM_DATA_MAP[itemName]; if (UtilityService.isFunction(itemConfig.onReRender)) { itemConfig.onReRender(); } }); } function generateElementAttributes(attributesObj) { var keys = Object.keys(attributesObj); var string = ''; keys.forEach(function (key) { var value = UtilityService.extractValue(attributesObj[key]); string = "".concat(string, " ").concat(key, "=\"").concat(value, "\""); }); return string; } function saveFormAttributes() { var form = getAppForm(); if (form) { window.$wave_FORM_ATTRIBUTES = HTMLService.extractAttributesFromElement(form); logDebugValue('saved form attributes', window.$wave_FORM_ATTRIBUTES, { force: true }); } } function getFormSettingsAttribute(key) { var attributes = getAttributeSettings(); return attributes && attributes[key]; } function getAttributeSettings() { return window.$wave_FORM_ATTRIBUTES; } function getDoctorID() { return getFormSettingsAttribute('data-doctor-id'); } function getAppID() { return !!CONFIG.CUSTOM_ID ? CONFIG.CUSTOM_ID : CONSTANTS.APP_FORM_ID; } function isTestMode() { var attributes = getAttributeSettings(); return !!(attributes && attributes['data-test-mode'] && attributes['data-test-mode'] === 'true'); } function getAppForm(inputID) { var id = getAppID(); if (!!inputID) { id = inputID; } window.$wave_formID = id; return document.getElementById(id); } function inquiryFormIDExists(inputID) { return !!getAppForm(inputID); } function transformReferralMethods(methods) { if (UtilityService.isArray(methods)) { return methods.map(function (method) { if (UtilityService.isObject(method)) { var selectedLanguage = CONFIG.LANGUAGE; var defaultLanguage = 'english'; var methodKeys = Object.keys(method); var value = ''; var text = ''; if (methodKeys.length > 0) { if (methodKeys.includes('value')) { value = method.value; } else if (methodKeys.includes(selectedLanguage)) { value = method[selectedLanguage]; } else if (methodKeys.includes(defaultLanguage)) { value = method[defaultLanguage]; } else { return ''; } if (methodKeys.includes('text')) { text = method.text; } else if (methodKeys.includes(selectedLanguage)) { text = method[selectedLanguage]; } else if (methodKeys.includes(defaultLanguage)) { text = method[defaultLanguage]; } else if (!!value) { text = value; } return { value: value, text: text }; } else { return ''; } } else { return method; } }).filter(function (method) { return !!method; }); } else { return []; } } return exports; }(); window.$wave_WaveInquiryForm = WaveInquiryForm; /*! * Bootstrap v5.0.2 (https://getbootstrap.com/) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ !function (t, e) { "object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).bootstrap = e(); }(void 0, function () { "use strict"; var t = { find: function find(t) { var _ref5; var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.documentElement; return (_ref5 = []).concat.apply(_ref5, _toConsumableArray(Element.prototype.querySelectorAll.call(e, t))); }, findOne: function findOne(t) { var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.documentElement; return Element.prototype.querySelector.call(e, t); }, children: function children(t, e) { var _ref6; return (_ref6 = []).concat.apply(_ref6, _toConsumableArray(t.children)).filter(function (t) { return t.matches(e); }); }, parents: function parents(t, e) { var i = []; var n = t.parentNode; for (; n && n.nodeType === Node.ELEMENT_NODE && 3 !== n.nodeType;) { n.matches(e) && i.push(n), n = n.parentNode; } return i; }, prev: function prev(t, e) { var i = t.previousElementSibling; for (; i;) { if (i.matches(e)) return [i]; i = i.previousElementSibling; } return []; }, next: function next(t, e) { var i = t.nextElementSibling; for (; i;) { if (i.matches(e)) return [i]; i = i.nextElementSibling; } return []; } }, e = function e(t) { do { t += Math.floor(1e6 * Math.random()); } while (document.getElementById(t)); return t; }, i = function i(t) { var e = t.getAttribute("data-bs-target"); if (!e || "#" === e) { var _i2 = t.getAttribute("href"); if (!_i2 || !_i2.includes("#") && !_i2.startsWith(".")) return null; _i2.includes("#") && !_i2.startsWith("#") && (_i2 = "#" + _i2.split("#")[1]), e = _i2 && "#" !== _i2 ? _i2.trim() : null; } return e; }, n = function n(t) { var e = i(t); return e && document.querySelector(e) ? e : null; }, s = function s(t) { var e = i(t); return e ? document.querySelector(e) : null; }, o = function o(t) { t.dispatchEvent(new Event("transitionend")); }, r = function r(t) { return !(!t || "object" != _typeof(t)) && (void 0 !== t.jquery && (t = t[0]), void 0 !== t.nodeType); }, a = function a(e) { return r(e) ? e.jquery ? e[0] : e : "string" == typeof e && e.length > 0 ? t.findOne(e) : null; }, l = function l(t, e, i) { Object.keys(i).forEach(function (n) { var s = i[n], o = e[n], a = o && r(o) ? "element" : null == (l = o) ? "" + l : {}.toString.call(l).match(/\s([a-z]+)/i)[1].toLowerCase(); var l; if (!new RegExp(s).test(a)) throw new TypeError("".concat(t.toUpperCase(), ": Option \"").concat(n, "\" provided type \"").concat(a, "\" but expected type \"").concat(s, "\".")); }); }, c = function c(t) { return !(!r(t) || 0 === t.getClientRects().length) && "visible" === getComputedStyle(t).getPropertyValue("visibility"); }, h = function h(t) { return !t || t.nodeType !== Node.ELEMENT_NODE || !!t.classList.contains("disabled") || (void 0 !== t.disabled ? t.disabled : t.hasAttribute("disabled") && "false" !== t.getAttribute("disabled")); }, d = function d(t) { if (!document.documentElement.attachShadow) return null; if ("function" == typeof t.getRootNode) { var _e2 = t.getRootNode(); return _e2 instanceof ShadowRoot ? _e2 : null; } return t instanceof ShadowRoot ? t : t.parentNode ? d(t.parentNode) : null; }, u = function u() {}, f = function f(t) { return t.offsetHeight; }, p = function p() { var _window = window, t = _window.jQuery; return t && !document.body.hasAttribute("data-bs-no-jquery") ? t : null; }, m = [], g = function g() { return "rtl" === document.documentElement.dir; }, _ = function _(t) { var e; e = function e() { var e = p(); if (e) { var _i3 = t.NAME, _n2 = e.fn[_i3]; e.fn[_i3] = t.jQueryInterface, e.fn[_i3].Constructor = t, e.fn[_i3].noConflict = function () { return e.fn[_i3] = _n2, t.jQueryInterface; }; } }, "loading" === document.readyState ? (m.length || document.addEventListener("DOMContentLoaded", function () { m.forEach(function (t) { return t(); }); }), m.push(e)) : e(); }, b = function b(t) { "function" == typeof t && t(); }, v = function v(t, e) { var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0; if (!i) return void b(t); var n = function (t) { if (!t) return 0; var _window$getComputedSt = window.getComputedStyle(t), e = _window$getComputedSt.transitionDuration, i = _window$getComputedSt.transitionDelay; var n = Number.parseFloat(e), s = Number.parseFloat(i); return n || s ? (e = e.split(",")[0], i = i.split(",")[0], 1e3 * (Number.parseFloat(e) + Number.parseFloat(i))) : 0; }(e) + 5; var s = !1; var r = function r(_ref7) { var i = _ref7.target; i === e && (s = !0, e.removeEventListener("transitionend", r), b(t)); }; e.addEventListener("transitionend", r), setTimeout(function () { s || o(e); }, n); }, y = function y(t, e, i, n) { var s = t.indexOf(e); if (-1 === s) return t[!i && n ? t.length - 1 : 0]; var o = t.length; return s += i ? 1 : -1, n && (s = (s + o) % o), t[Math.max(0, Math.min(s, o - 1))]; }, w = /[^.]*(?=\..*)\.|.*/, E = /\..*/, A = /::\d+$/, T = {}; var O = 1; var C = { mouseenter: "mouseover", mouseleave: "mouseout" }, k = /^(mouseenter|mouseleave)/i, L = new Set(["click", "dblclick", "mouseup", "mousedown", "contextmenu", "mousewheel", "DOMMouseScroll", "mouseover", "mouseout", "mousemove", "selectstart", "selectend", "keydown", "keypress", "keyup", "orientationchange", "touchstart", "touchmove", "touchend", "touchcancel", "pointerdown", "pointermove", "pointerup", "pointerleave", "pointercancel", "gesturestart", "gesturechange", "gestureend", "focus", "blur", "change", "reset", "select", "submit", "focusin", "focusout", "load", "unload", "beforeunload", "resize", "move", "DOMContentLoaded", "readystatechange", "error", "abort", "scroll"]); function x(t, e) { return e && "".concat(e, "::").concat(O++) || t.uidEvent || O++; } function D(t) { var e = x(t); return t.uidEvent = e, T[e] = T[e] || {}, T[e]; } function S(t, e) { var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; var n = Object.keys(t); for (var _s2 = 0, _o = n.length; _s2 < _o; _s2++) { var _o2 = t[n[_s2]]; if (_o2.originalHandler === e && _o2.delegationSelector === i) return _o2; } return null; } function I(t, e, i) { var n = "string" == typeof e, s = n ? i : e; var o = M(t); return L.has(o) || (o = t), [n, s, o]; } function N(t, e, i, n, s) { if ("string" != typeof e || !t) return; if (i || (i = n, n = null), k.test(e)) { var _t2 = function _t2(t) { return function (e) { if (!e.relatedTarget || e.relatedTarget !== e.delegateTarget && !e.delegateTarget.contains(e.relatedTarget)) return t.call(this, e); }; }; n ? n = _t2(n) : i = _t2(i); } var _I = I(e, i, n), _I2 = _slicedToArray(_I, 3), o = _I2[0], r = _I2[1], a = _I2[2], l = D(t), c = l[a] || (l[a] = {}), h = S(c, r, o ? i : null); if (h) return void (h.oneOff = h.oneOff && s); var d = x(r, e.replace(w, "")), u = o ? function (t, e, i) { return function n(s) { var o = t.querySelectorAll(e); for (var _r = s.target; _r && _r !== this; _r = _r.parentNode) { for (var _a2 = o.length; _a2--;) { if (o[_a2] === _r) return s.delegateTarget = _r, n.oneOff && P.off(t, s.type, e, i), i.apply(_r, [s]); } } return null; }; }(t, i, n) : function (t, e) { return function i(n) { return n.delegateTarget = t, i.oneOff && P.off(t, n.type, e), e.apply(t, [n]); }; }(t, i); u.delegationSelector = o ? i : null, u.originalHandler = r, u.oneOff = s, u.uidEvent = d, c[d] = u, t.addEventListener(a, u, o); } function j(t, e, i, n, s) { var o = S(e[i], n, s); o && (t.removeEventListener(i, o, Boolean(s)), delete e[i][o.uidEvent]); } function M(t) { return t = t.replace(E, ""), C[t] || t; } var P = { on: function on(t, e, i, n) { N(t, e, i, n, !1); }, one: function one(t, e, i, n) { N(t, e, i, n, !0); }, off: function off(t, e, i, n) { if ("string" != typeof e || !t) return; var _I3 = I(e, i, n), _I4 = _slicedToArray(_I3, 3), s = _I4[0], o = _I4[1], r = _I4[2], a = r !== e, l = D(t), c = e.startsWith("."); if (void 0 !== o) { if (!l || !l[r]) return; return void j(t, l, r, o, s ? i : null); } c && Object.keys(l).forEach(function (i) { !function (t, e, i, n) { var s = e[i] || {}; Object.keys(s).forEach(function (o) { if (o.includes(n)) { var _n3 = s[o]; j(t, e, i, _n3.originalHandler, _n3.delegationSelector); } }); }(t, l, i, e.slice(1)); }); var h = l[r] || {}; Object.keys(h).forEach(function (i) { var n = i.replace(A, ""); if (!a || e.includes(n)) { var _e3 = h[i]; j(t, l, r, _e3.originalHandler, _e3.delegationSelector); } }); }, trigger: function trigger(t, e, i) { if ("string" != typeof e || !t) return null; var n = p(), s = M(e), o = e !== s, r = L.has(s); var a, l = !0, c = !0, h = !1, d = null; return o && n && (a = n.Event(e, i), n(t).trigger(a), l = !a.isPropagationStopped(), c = !a.isImmediatePropagationStopped(), h = a.isDefaultPrevented()), r ? (d = document.createEvent("HTMLEvents"), d.initEvent(s, l, !0)) : d = new CustomEvent(e, { bubbles: l, cancelable: !0 }), void 0 !== i && Object.keys(i).forEach(function (t) { Object.defineProperty(d, t, { get: function get() { return i[t]; } }); }), h && d.preventDefault(), c && t.dispatchEvent(d), d.defaultPrevented && void 0 !== a && a.preventDefault(), d; } }, H = new Map(); var R = { set: function set(t, e, i) { H.has(t) || H.set(t, new Map()); var n = H.get(t); n.has(e) || 0 === n.size ? n.set(e, i) : console.error("Bootstrap doesn't allow more than one instance per element. Bound instance: ".concat(Array.from(n.keys())[0], ".")); }, get: function get(t, e) { return H.has(t) && H.get(t).get(e) || null; }, remove: function remove(t, e) { if (!H.has(t)) return; var i = H.get(t); i["delete"](e), 0 === i.size && H["delete"](t); } }; var B = /*#__PURE__*/ function () { function B(t) { _classCallCheck(this, B); (t = a(t)) && (this._element = t, R.set(this._element, this.constructor.DATA_KEY, this)); } _createClass(B, [{ key: "dispose", value: function dispose() { var _this = this; R.remove(this._element, this.constructor.DATA_KEY), P.off(this._element, this.constructor.EVENT_KEY), Object.getOwnPropertyNames(this).forEach(function (t) { _this[t] = null; }); } }, { key: "_queueCallback", value: function _queueCallback(t, e) { var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0; v(t, e, i); } }], [{ key: "getInstance", value: function getInstance(t) { return R.get(t, this.DATA_KEY); } }, { key: "getOrCreateInstance", value: function getOrCreateInstance(t) { var e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this.getInstance(t) || new this(t, "object" == _typeof(e) ? e : null); } }, { key: "VERSION", get: function get() { return "5.0.2"; } }, { key: "NAME", get: function get() { throw new Error('You have to implement the static method "NAME", for each component!'); } }, { key: "DATA_KEY", get: function get() { return "bs." + this.NAME; } }, { key: "EVENT_KEY", get: function get() { return "." + this.DATA_KEY; } }]); return B; }(); var W = /*#__PURE__*/ function (_B) { _inherits(W, _B); function W() { _classCallCheck(this, W); return _possibleConstructorReturn(this, _getPrototypeOf(W).apply(this, arguments)); } _createClass(W, [{ key: "close", value: function close(t) { var e = t ? this._getRootElement(t) : this._element, i = this._triggerCloseEvent(e); null === i || i.defaultPrevented || this._removeElement(e); } }, { key: "_getRootElement", value: function _getRootElement(t) { return s(t) || t.closest(".alert"); } }, { key: "_triggerCloseEvent", value: function _triggerCloseEvent(t) { return P.trigger(t, "close.bs.alert"); } }, { key: "_removeElement", value: function _removeElement(t) { var _this2 = this; t.classList.remove("show"); var e = t.classList.contains("fade"); this._queueCallback(function () { return _this2._destroyElement(t); }, t, e); } }, { key: "_destroyElement", value: function _destroyElement(t) { t.remove(), P.trigger(t, "closed.bs.alert"); } }], [{ key: "jQueryInterface", value: function jQueryInterface(t) { return this.each(function () { var e = W.getOrCreateInstance(this); "close" === t && e[t](this); }); } }, { key: "handleDismiss", value: function handleDismiss(t) { return function (e) { e && e.preventDefault(), t.close(this); }; } }, { key: "NAME", get: function get() { return "alert"; } }]); return W; }(B); P.on(document, "click.bs.alert.data-api", '[data-bs-dismiss="alert"]', W.handleDismiss(new W())), _(W); var q = /*#__PURE__*/ function (_B2) { _inherits(q, _B2); function q() { _classCallCheck(this, q); return _possibleConstructorReturn(this, _getPrototypeOf(q).apply(this, arguments)); } _createClass(q, [{ key: "toggle", value: function toggle() { this._element.setAttribute("aria-pressed", this._element.classList.toggle("active")); } }], [{ key: "jQueryInterface", value: function jQueryInterface(t) { return this.each(function () { var e = q.getOrCreateInstance(this); "toggle" === t && e[t](); }); } }, { key: "NAME", get: function get() { return "button"; } }]); return q; }(B); function z(t) { return "true" === t || "false" !== t && (t === Number(t).toString() ? Number(t) : "" === t || "null" === t ? null : t); } function $(t) { return t.replace(/[A-Z]/g, function (t) { return "-" + t.toLowerCase(); }); } P.on(document, "click.bs.button.data-api", '[data-bs-toggle="button"]', function (t) { t.preventDefault(); var e = t.target.closest('[data-bs-toggle="button"]'); q.getOrCreateInstance(e).toggle(); }), _(q); var U = { setDataAttribute: function setDataAttribute(t, e, i) { t.setAttribute("data-bs-" + $(e), i); }, removeDataAttribute: function removeDataAttribute(t, e) { t.removeAttribute("data-bs-" + $(e)); }, getDataAttributes: function getDataAttributes(t) { if (!t) return {}; var e = {}; return Object.keys(t.dataset).filter(function (t) { return t.startsWith("bs"); }).forEach(function (i) { var n = i.replace(/^bs/, ""); n = n.charAt(0).toLowerCase() + n.slice(1, n.length), e[n] = z(t.dataset[i]); }), e; }, getDataAttribute: function getDataAttribute(t, e) { return z(t.getAttribute("data-bs-" + $(e))); }, offset: function offset(t) { var e = t.getBoundingClientRect(); return { top: e.top + document.body.scrollTop, left: e.left + document.body.scrollLeft }; }, position: function position(t) { return { top: t.offsetTop, left: t.offsetLeft }; } }, F = { interval: 5e3, keyboard: !0, slide: !1, pause: "hover", wrap: !0, touch: !0 }, V = { interval: "(number|boolean)", keyboard: "boolean", slide: "(boolean|string)", pause: "(string|boolean)", wrap: "boolean", touch: "boolean" }, K = "next", X = "prev", Y = "left", Q = "right", G = { ArrowLeft: Q, ArrowRight: Y }; var Z = /*#__PURE__*/ function (_B3) { _inherits(Z, _B3); function Z(e, i) { var _this3; _classCallCheck(this, Z); _this3 = _possibleConstructorReturn(this, _getPrototypeOf(Z).call(this, e)), _this3._items = null, _this3._interval = null, _this3._activeElement = null, _this3._isPaused = !1, _this3._isSliding = !1, _this3.touchTimeout = null, _this3.touchStartX = 0, _this3.touchDeltaX = 0, _this3._config = _this3._getConfig(i), _this3._indicatorsElement = t.findOne(".carousel-indicators", _this3._element), _this3._touchSupported = "ontouchstart" in document.documentElement || navigator.maxTouchPoints > 0, _this3._pointerEvent = Boolean(window.PointerEvent), _this3._addEventListeners(); return _this3; } _createClass(Z, [{ key: "next", value: function next() { this._slide(K); } }, { key: "nextWhenVisible", value: function nextWhenVisible() { !document.hidden && c(this._element) && this.next(); } }, { key: "prev", value: function prev() { this._slide(X); } }, { key: "pause", value: function pause(e) { e || (this._isPaused = !0), t.findOne(".carousel-item-next, .carousel-item-prev", this._element) && (o(this._element), this.cycle(!0)), clearInterval(this._interval), this._interval = null; } }, { key: "cycle", value: function cycle(t) { t || (this._isPaused = !1), this._interval && (clearInterval(this._interval), this._interval = null), this._config && this._config.interval && !this._isPaused && (this._updateInterval(), this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval)); } }, { key: "to", value: function to(e) { var _this4 = this; this._activeElement = t.findOne(".active.carousel-item", this._element); var i = this._getItemIndex(this._activeElement); if (e > this._items.length - 1 || e < 0) return; if (this._isSliding) return void P.one(this._element, "slid.bs.carousel", function () { return _this4.to(e); }); if (i === e) return this.pause(), void this.cycle(); var n = e > i ? K : X; this._slide(n, this._items[e]); } }, { key: "_getConfig", value: function _getConfig(t) { return t = _objectSpread({}, F, {}, U.getDataAttributes(this._element), {}, "object" == _typeof(t) ? t : {}), l("carousel", t, V), t; } }, { key: "_handleSwipe", value: function _handleSwipe() { var t = Math.abs(this.touchDeltaX); if (t <= 40) return; var e = t / this.touchDeltaX; this.touchDeltaX = 0, e && this._slide(e > 0 ? Q : Y); } }, { key: "_addEventListeners", value: function _addEventListeners() { var _this5 = this; this._config.keyboard && P.on(this._element, "keydown.bs.carousel", function (t) { return _this5._keydown(t); }), "hover" === this._config.pause && (P.on(this._element, "mouseenter.bs.carousel", function (t) { return _this5.pause(t); }), P.on(this._element, "mouseleave.bs.carousel", function (t) { return _this5.cycle(t); })), this._config.touch && this._touchSupported && this._addTouchEventListeners(); } }, { key: "_addTouchEventListeners", value: function _addTouchEventListeners() { var _this6 = this; var e = function e(t) { !_this6._pointerEvent || "pen" !== t.pointerType && "touch" !== t.pointerType ? _this6._pointerEvent || (_this6.touchStartX = t.touches[0].clientX) : _this6.touchStartX = t.clientX; }, i = function i(t) { _this6.touchDeltaX = t.touches && t.touches.length > 1 ? 0 : t.touches[0].clientX - _this6.touchStartX; }, n = function n(t) { !_this6._pointerEvent || "pen" !== t.pointerType && "touch" !== t.pointerType || (_this6.touchDeltaX = t.clientX - _this6.touchStartX), _this6._handleSwipe(), "hover" === _this6._config.pause && (_this6.pause(), _this6.touchTimeout && clearTimeout(_this6.touchTimeout), _this6.touchTimeout = setTimeout(function (t) { return _this6.cycle(t); }, 500 + _this6._config.interval)); }; t.find(".carousel-item img", this._element).forEach(function (t) { P.on(t, "dragstart.bs.carousel", function (t) { return t.preventDefault(); }); }), this._pointerEvent ? (P.on(this._element, "pointerdown.bs.carousel", function (t) { return e(t); }), P.on(this._element, "pointerup.bs.carousel", function (t) { return n(t); }), this._element.classList.add("pointer-event")) : (P.on(this._element, "touchstart.bs.carousel", function (t) { return e(t); }), P.on(this._element, "touchmove.bs.carousel", function (t) { return i(t); }), P.on(this._element, "touchend.bs.carousel", function (t) { return n(t); })); } }, { key: "_keydown", value: function _keydown(t) { if (/input|textarea/i.test(t.target.tagName)) return; var e = G[t.key]; e && (t.preventDefault(), this._slide(e)); } }, { key: "_getItemIndex", value: function _getItemIndex(e) { return this._items = e && e.parentNode ? t.find(".carousel-item", e.parentNode) : [], this._items.indexOf(e); } }, { key: "_getItemByOrder", value: function _getItemByOrder(t, e) { var i = t === K; return y(this._items, e, i, this._config.wrap); } }, { key: "_triggerSlideEvent", value: function _triggerSlideEvent(e, i) { var n = this._getItemIndex(e), s = this._getItemIndex(t.findOne(".active.carousel-item", this._element)); return P.trigger(this._element, "slide.bs.carousel", { relatedTarget: e, direction: i, from: s, to: n }); } }, { key: "_setActiveIndicatorElement", value: function _setActiveIndicatorElement(e) { if (this._indicatorsElement) { var _i4 = t.findOne(".active", this._indicatorsElement); _i4.classList.remove("active"), _i4.removeAttribute("aria-current"); var _n4 = t.find("[data-bs-target]", this._indicatorsElement); for (var _t3 = 0; _t3 < _n4.length; _t3++) { if (Number.parseInt(_n4[_t3].getAttribute("data-bs-slide-to"), 10) === this._getItemIndex(e)) { _n4[_t3].classList.add("active"), _n4[_t3].setAttribute("aria-current", "true"); break; } } } } }, { key: "_updateInterval", value: function _updateInterval() { var e = this._activeElement || t.findOne(".active.carousel-item", this._element); if (!e) return; var i = Number.parseInt(e.getAttribute("data-bs-interval"), 10); i ? (this._config.defaultInterval = this._config.defaultInterval || this._config.interval, this._config.interval = i) : this._config.interval = this._config.defaultInterval || this._config.interval; } }, { key: "_slide", value: function _slide(e, i) { var _this7 = this; var n = this._directionToOrder(e), s = t.findOne(".active.carousel-item", this._element), o = this._getItemIndex(s), r = i || this._getItemByOrder(n, s), a = this._getItemIndex(r), l = Boolean(this._interval), c = n === K, h = c ? "carousel-item-start" : "carousel-item-end", d = c ? "carousel-item-next" : "carousel-item-prev", u = this._orderToDirection(n); if (r && r.classList.contains("active")) return void (this._isSliding = !1); if (this._isSliding) return; if (this._triggerSlideEvent(r, u).defaultPrevented) return; if (!s || !r) return; this._isSliding = !0, l && this.pause(), this._setActiveIndicatorElement(r), this._activeElement = r; var p = function p() { P.trigger(_this7._element, "slid.bs.carousel", { relatedTarget: r, direction: u, from: o, to: a }); }; if (this._element.classList.contains("slide")) { r.classList.add(d), f(r), s.classList.add(h), r.classList.add(h); var _t4 = function _t4() { r.classList.remove(h, d), r.classList.add("active"), s.classList.remove("active", d, h), _this7._isSliding = !1, setTimeout(p, 0); }; this._queueCallback(_t4, s, !0); } else s.classList.remove("active"), r.classList.add("active"), this._isSliding = !1, p(); l && this.cycle(); } }, { key: "_directionToOrder", value: function _directionToOrder(t) { return [Q, Y].includes(t) ? g() ? t === Y ? X : K : t === Y ? K : X : t; } }, { key: "_orderToDirection", value: function _orderToDirection(t) { return [K, X].includes(t) ? g() ? t === X ? Y : Q : t === X ? Q : Y : t; } }], [{ key: "carouselInterface", value: function carouselInterface(t, e) { var i = Z.getOrCreateInstance(t, e); var n = i._config; "object" == _typeof(e) && (n = _objectSpread({}, n, {}, e)); var s = "string" == typeof e ? e : n.slide; if ("number" == typeof e) i.to(e);else if ("string" == typeof s) { if (void 0 === i[s]) throw new TypeError("No method named \"".concat(s, "\"")); i[s](); } else n.interval && n.ride && (i.pause(), i.cycle()); } }, { key: "jQueryInterface", value: function jQueryInterface(t) { return this.each(function () { Z.carouselInterface(this, t); }); } }, { key: "dataApiClickHandler", value: function dataApiClickHandler(t) { var e = s(this); if (!e || !e.classList.contains("carousel")) return; var i = _objectSpread({}, U.getDataAttributes(e), {}, U.getDataAttributes(this)), n = this.getAttribute("data-bs-slide-to"); n && (i.interval = !1), Z.carouselInterface(e, i), n && Z.getInstance(e).to(n), t.preventDefault(); } }, { key: "Default", get: function get() { return F; } }, { key: "NAME", get: function get() { return "carousel"; } }]); return Z; }(B); P.on(document, "click.bs.carousel.data-api", "[data-bs-slide], [data-bs-slide-to]", Z.dataApiClickHandler), P.on(window, "load.bs.carousel.data-api", function () { var e = t.find('[data-bs-ride="carousel"]'); for (var _t5 = 0, _i5 = e.length; _t5 < _i5; _t5++) { Z.carouselInterface(e[_t5], Z.getInstance(e[_t5])); } }), _(Z); var J = { toggle: !0, parent: "" }, tt = { toggle: "boolean", parent: "(string|element)" }; var et = /*#__PURE__*/ function (_B4) { _inherits(et, _B4); function et(e, i) { var _this8; _classCallCheck(this, et); _this8 = _possibleConstructorReturn(this, _getPrototypeOf(et).call(this, e)), _this8._isTransitioning = !1, _this8._config = _this8._getConfig(i), _this8._triggerArray = t.find("[data-bs-toggle=\"collapse\"][href=\"#".concat(_this8._element.id, "\"],[data-bs-toggle=\"collapse\"][data-bs-target=\"#").concat(_this8._element.id, "\"]")); var s = t.find('[data-bs-toggle="collapse"]'); for (var _e4 = 0, _i6 = s.length; _e4 < _i6; _e4++) { var _i7 = s[_e4], _o3 = n(_i7), _r2 = t.find(_o3).filter(function (t) { return t === _this8._element; }); null !== _o3 && _r2.length && (_this8._selector = _o3, _this8._triggerArray.push(_i7)); } _this8._parent = _this8._config.parent ? _this8._getParent() : null, _this8._config.parent || _this8._addAriaAndCollapsedClass(_this8._element, _this8._triggerArray), _this8._config.toggle && _this8.toggle(); return _this8; } _createClass(et, [{ key: "toggle", value: function toggle() { this._element.classList.contains("show") ? this.hide() : this.show(); } }, { key: "show", value: function show() { var _this9 = this; if (this._isTransitioning || this._element.classList.contains("show")) return; var e, i; this._parent && (e = t.find(".show, .collapsing", this._parent).filter(function (t) { return "string" == typeof _this9._config.parent ? t.getAttribute("data-bs-parent") === _this9._config.parent : t.classList.contains("collapse"); }), 0 === e.length && (e = null)); var n = t.findOne(this._selector); if (e) { var _t6 = e.find(function (t) { return n !== t; }); if (i = _t6 ? et.getInstance(_t6) : null, i && i._isTransitioning) return; } if (P.trigger(this._element, "show.bs.collapse").defaultPrevented) return; e && e.forEach(function (t) { n !== t && et.collapseInterface(t, "hide"), i || R.set(t, "bs.collapse", null); }); var s = this._getDimension(); this._element.classList.remove("collapse"), this._element.classList.add("collapsing"), this._element.style[s] = 0, this._triggerArray.length && this._triggerArray.forEach(function (t) { t.classList.remove("collapsed"), t.setAttribute("aria-expanded", !0); }), this.setTransitioning(!0); var o = "scroll" + (s[0].toUpperCase() + s.slice(1)); this._queueCallback(function () { _this9._element.classList.remove("collapsing"), _this9._element.classList.add("collapse", "show"), _this9._element.style[s] = "", _this9.setTransitioning(!1), P.trigger(_this9._element, "shown.bs.collapse"); }, this._element, !0), this._element.style[s] = this._element[o] + "px"; } }, { key: "hide", value: function hide() { var _this10 = this; if (this._isTransitioning || !this._element.classList.contains("show")) return; if (P.trigger(this._element, "hide.bs.collapse").defaultPrevented) return; var t = this._getDimension(); this._element.style[t] = this._element.getBoundingClientRect()[t] + "px", f(this._element), this._element.classList.add("collapsing"), this._element.classList.remove("collapse", "show"); var e = this._triggerArray.length; if (e > 0) for (var _t7 = 0; _t7 < e; _t7++) { var _e5 = this._triggerArray[_t7], _i8 = s(_e5); _i8 && !_i8.classList.contains("show") && (_e5.classList.add("collapsed"), _e5.setAttribute("aria-expanded", !1)); } this.setTransitioning(!0), this._element.style[t] = "", this._queueCallback(function () { _this10.setTransitioning(!1), _this10._element.classList.remove("collapsing"), _this10._element.classList.add("collapse"), P.trigger(_this10._element, "hidden.bs.collapse"); }, this._element, !0); } }, { key: "setTransitioning", value: function setTransitioning(t) { this._isTransitioning = t; } }, { key: "_getConfig", value: function _getConfig(t) { return (t = _objectSpread({}, J, {}, t)).toggle = Boolean(t.toggle), l("collapse", t, tt), t; } }, { key: "_getDimension", value: function _getDimension() { return this._element.classList.contains("width") ? "width" : "height"; } }, { key: "_getParent", value: function _getParent() { var _this11 = this; var e = this._config.parent; e = a(e); var i = "[data-bs-toggle=\"collapse\"][data-bs-parent=\"".concat(e, "\"]"); return t.find(i, e).forEach(function (t) { var e = s(t); _this11._addAriaAndCollapsedClass(e, [t]); }), e; } }, { key: "_addAriaAndCollapsedClass", value: function _addAriaAndCollapsedClass(t, e) { if (!t || !e.length) return; var i = t.classList.contains("show"); e.forEach(function (t) { i ? t.classList.remove("collapsed") : t.classList.add("collapsed"), t.setAttribute("aria-expanded", i); }); } }], [{ key: "collapseInterface", value: function collapseInterface(t, e) { var i = et.getInstance(t); var n = _objectSpread({}, J, {}, U.getDataAttributes(t), {}, "object" == _typeof(e) && e ? e : {}); if (!i && n.toggle && "string" == typeof e && /show|hide/.test(e) && (n.toggle = !1), i || (i = new et(t, n)), "string" == typeof e) { if (void 0 === i[e]) throw new TypeError("No method named \"".concat(e, "\"")); i[e](); } } }, { key: "jQueryInterface", value: function jQueryInterface(t) { return this.each(function () { et.collapseInterface(this, t); }); } }, { key: "Default", get: function get() { return J; } }, { key: "NAME", get: function get() { return "collapse"; } }]); return et; }(B); P.on(document, "click.bs.collapse.data-api", '[data-bs-toggle="collapse"]', function (e) { ("A" === e.target.tagName || e.delegateTarget && "A" === e.delegateTarget.tagName) && e.preventDefault(); var i = U.getDataAttributes(this), s = n(this); t.find(s).forEach(function (t) { var e = et.getInstance(t); var n; e ? (null === e._parent && "string" == typeof i.parent && (e._config.parent = i.parent, e._parent = e._getParent()), n = "toggle") : n = i, et.collapseInterface(t, n); }); }), _(et); var it = "top", nt = "bottom", st = "right", ot = "left", rt = [it, nt, st, ot], at = rt.reduce(function (t, e) { return t.concat([e + "-start", e + "-end"]); }, []), lt = [].concat(rt, ["auto"]).reduce(function (t, e) { return t.concat([e, e + "-start", e + "-end"]); }, []), ct = ["beforeRead", "read", "afterRead", "beforeMain", "main", "afterMain", "beforeWrite", "write", "afterWrite"]; function ht(t) { return t ? (t.nodeName || "").toLowerCase() : null; } function dt(t) { if (null == t) return window; if ("[object Window]" !== t.toString()) { var e = t.ownerDocument; return e && e.defaultView || window; } return t; } function ut(t) { return t instanceof dt(t).Element || t instanceof Element; } function ft(t) { return t instanceof dt(t).HTMLElement || t instanceof HTMLElement; } function pt(t) { return "undefined" != typeof ShadowRoot && (t instanceof dt(t).ShadowRoot || t instanceof ShadowRoot); } var mt = { name: "applyStyles", enabled: !0, phase: "write", fn: function fn(t) { var e = t.state; Object.keys(e.elements).forEach(function (t) { var i = e.styles[t] || {}, n = e.attributes[t] || {}, s = e.elements[t]; ft(s) && ht(s) && (Object.assign(s.style, i), Object.keys(n).forEach(function (t) { var e = n[t]; !1 === e ? s.removeAttribute(t) : s.setAttribute(t, !0 === e ? "" : e); })); }); }, effect: function effect(t) { var e = t.state, i = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} }; return Object.assign(e.elements.popper.style, i.popper), e.styles = i, e.elements.arrow && Object.assign(e.elements.arrow.style, i.arrow), function () { Object.keys(e.elements).forEach(function (t) { var n = e.elements[t], s = e.attributes[t] || {}, o = Object.keys(e.styles.hasOwnProperty(t) ? e.styles[t] : i[t]).reduce(function (t, e) { return t[e] = "", t; }, {}); ft(n) && ht(n) && (Object.assign(n.style, o), Object.keys(s).forEach(function (t) { n.removeAttribute(t); })); }); }; }, requires: ["computeStyles"] }; function gt(t) { return t.split("-")[0]; } function _t(t) { var e = t.getBoundingClientRect(); return { width: e.width, height: e.height, top: e.top, right: e.right, bottom: e.bottom, left: e.left, x: e.left, y: e.top }; } function bt(t) { var e = _t(t), i = t.offsetWidth, n = t.offsetHeight; return Math.abs(e.width - i) <= 1 && (i = e.width), Math.abs(e.height - n) <= 1 && (n = e.height), { x: t.offsetLeft, y: t.offsetTop, width: i, height: n }; } function vt(t, e) { var i = e.getRootNode && e.getRootNode(); if (t.contains(e)) return !0; if (i && pt(i)) { var n = e; do { if (n && t.isSameNode(n)) return !0; n = n.parentNode || n.host; } while (n); } return !1; } function yt(t) { return dt(t).getComputedStyle(t); } function wt(t) { return ["table", "td", "th"].indexOf(ht(t)) >= 0; } function Et(t) { return ((ut(t) ? t.ownerDocument : t.document) || window.document).documentElement; } function At(t) { return "html" === ht(t) ? t : t.assignedSlot || t.parentNode || (pt(t) ? t.host : null) || Et(t); } function Tt(t) { return ft(t) && "fixed" !== yt(t).position ? t.offsetParent : null; } function Ot(t) { for (var e = dt(t), i = Tt(t); i && wt(i) && "static" === yt(i).position;) { i = Tt(i); } return i && ("html" === ht(i) || "body" === ht(i) && "static" === yt(i).position) ? e : i || function (t) { var e = -1 !== navigator.userAgent.toLowerCase().indexOf("firefox"); if (-1 !== navigator.userAgent.indexOf("Trident") && ft(t) && "fixed" === yt(t).position) return null; for (var i = At(t); ft(i) && ["html", "body"].indexOf(ht(i)) < 0;) { var n = yt(i); if ("none" !== n.transform || "none" !== n.perspective || "paint" === n.contain || -1 !== ["transform", "perspective"].indexOf(n.willChange) || e && "filter" === n.willChange || e && n.filter && "none" !== n.filter) return i; i = i.parentNode; } return null; }(t) || e; } function Ct(t) { return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y"; } var kt = Math.max, Lt = Math.min, xt = Math.round; function Dt(t, e, i) { return kt(t, Lt(e, i)); } function St(t) { return Object.assign({}, { top: 0, right: 0, bottom: 0, left: 0 }, t); } function It(t, e) { return e.reduce(function (e, i) { return e[i] = t, e; }, {}); } var Nt = { name: "arrow", enabled: !0, phase: "main", fn: function fn(t) { var e, i = t.state, n = t.name, s = t.options, o = i.elements.arrow, r = i.modifiersData.popperOffsets, a = gt(i.placement), l = Ct(a), c = [ot, st].indexOf(a) >= 0 ? "height" : "width"; if (o && r) { var h = function (t, e) { return St("number" != typeof (t = "function" == typeof t ? t(Object.assign({}, e.rects, { placement: e.placement })) : t) ? t : It(t, rt)); }(s.padding, i), d = bt(o), u = "y" === l ? it : ot, f = "y" === l ? nt : st, p = i.rects.reference[c] + i.rects.reference[l] - r[l] - i.rects.popper[c], m = r[l] - i.rects.reference[l], g = Ot(o), _ = g ? "y" === l ? g.clientHeight || 0 : g.clientWidth || 0 : 0, b = p / 2 - m / 2, v = h[u], y = _ - d[c] - h[f], w = _ / 2 - d[c] / 2 + b, E = Dt(v, w, y), A = l; i.modifiersData[n] = ((e = {})[A] = E, e.centerOffset = E - w, e); } }, effect: function effect(t) { var e = t.state, i = t.options.element, n = void 0 === i ? "[data-popper-arrow]" : i; null != n && ("string" != typeof n || (n = e.elements.popper.querySelector(n))) && vt(e.elements.popper, n) && (e.elements.arrow = n); }, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }, jt = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function Mt(t) { var e, i = t.popper, n = t.popperRect, s = t.placement, o = t.offsets, r = t.position, a = t.gpuAcceleration, l = t.adaptive, c = t.roundOffsets, h = !0 === c ? function (t) { var e = t.x, i = t.y, n = window.devicePixelRatio || 1; return { x: xt(xt(e * n) / n) || 0, y: xt(xt(i * n) / n) || 0 }; }(o) : "function" == typeof c ? c(o) : o, d = h.x, u = void 0 === d ? 0 : d, f = h.y, p = void 0 === f ? 0 : f, m = o.hasOwnProperty("x"), g = o.hasOwnProperty("y"), _ = ot, b = it, v = window; if (l) { var y = Ot(i), w = "clientHeight", E = "clientWidth"; y === dt(i) && "static" !== yt(y = Et(i)).position && (w = "scrollHeight", E = "scrollWidth"), y = y, s === it && (b = nt, p -= y[w] - n.height, p *= a ? 1 : -1), s === ot && (_ = st, u -= y[E] - n.width, u *= a ? 1 : -1); } var A, T = Object.assign({ position: r }, l && jt); return a ? Object.assign({}, T, ((A = {})[b] = g ? "0" : "", A[_] = m ? "0" : "", A.transform = (v.devicePixelRatio || 1) < 2 ? "translate(" + u + "px, " + p + "px)" : "translate3d(" + u + "px, " + p + "px, 0)", A)) : Object.assign({}, T, ((e = {})[b] = g ? p + "px" : "", e[_] = m ? u + "px" : "", e.transform = "", e)); } var Pt = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: function fn(t) { var e = t.state, i = t.options, n = i.gpuAcceleration, s = void 0 === n || n, o = i.adaptive, r = void 0 === o || o, a = i.roundOffsets, l = void 0 === a || a, c = { placement: gt(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: s }; null != e.modifiersData.popperOffsets && (e.styles.popper = Object.assign({}, e.styles.popper, Mt(Object.assign({}, c, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: r, roundOffsets: l })))), null != e.modifiersData.arrow && (e.styles.arrow = Object.assign({}, e.styles.arrow, Mt(Object.assign({}, c, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: l })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement }); }, data: {} }, Ht = { passive: !0 }, Rt = { name: "eventListeners", enabled: !0, phase: "write", fn: function fn() {}, effect: function effect(t) { var e = t.state, i = t.instance, n = t.options, s = n.scroll, o = void 0 === s || s, r = n.resize, a = void 0 === r || r, l = dt(e.elements.popper), c = [].concat(e.scrollParents.reference, e.scrollParents.popper); return o && c.forEach(function (t) { t.addEventListener("scroll", i.update, Ht); }), a && l.addEventListener("resize", i.update, Ht), function () { o && c.forEach(function (t) { t.removeEventListener("scroll", i.update, Ht); }), a && l.removeEventListener("resize", i.update, Ht); }; }, data: {} }, Bt = { left: "right", right: "left", bottom: "top", top: "bottom" }; function Wt(t) { return t.replace(/left|right|bottom|top/g, function (t) { return Bt[t]; }); } var qt = { start: "end", end: "start" }; function zt(t) { return t.replace(/start|end/g, function (t) { return qt[t]; }); } function $t(t) { var e = dt(t); return { scrollLeft: e.pageXOffset, scrollTop: e.pageYOffset }; } function Ut(t) { return _t(Et(t)).left + $t(t).scrollLeft; } function Ft(t) { var e = yt(t), i = e.overflow, n = e.overflowX, s = e.overflowY; return /auto|scroll|overlay|hidden/.test(i + s + n); } function Vt(t, e) { var i; void 0 === e && (e = []); var n = function t(e) { return ["html", "body", "#document"].indexOf(ht(e)) >= 0 ? e.ownerDocument.body : ft(e) && Ft(e) ? e : t(At(e)); }(t), s = n === (null == (i = t.ownerDocument) ? void 0 : i.body), o = dt(n), r = s ? [o].concat(o.visualViewport || [], Ft(n) ? n : []) : n, a = e.concat(r); return s ? a : a.concat(Vt(At(r))); } function Kt(t) { return Object.assign({}, t, { left: t.x, top: t.y, right: t.x + t.width, bottom: t.y + t.height }); } function Xt(t, e) { return "viewport" === e ? Kt(function (t) { var e = dt(t), i = Et(t), n = e.visualViewport, s = i.clientWidth, o = i.clientHeight, r = 0, a = 0; return n && (s = n.width, o = n.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (r = n.offsetLeft, a = n.offsetTop)), { width: s, height: o, x: r + Ut(t), y: a }; }(t)) : ft(e) ? function (t) { var e = _t(t); return e.top = e.top + t.clientTop, e.left = e.left + t.clientLeft, e.bottom = e.top + t.clientHeight, e.right = e.left + t.clientWidth, e.width = t.clientWidth, e.height = t.clientHeight, e.x = e.left, e.y = e.top, e; }(e) : Kt(function (t) { var e, i = Et(t), n = $t(t), s = null == (e = t.ownerDocument) ? void 0 : e.body, o = kt(i.scrollWidth, i.clientWidth, s ? s.scrollWidth : 0, s ? s.clientWidth : 0), r = kt(i.scrollHeight, i.clientHeight, s ? s.scrollHeight : 0, s ? s.clientHeight : 0), a = -n.scrollLeft + Ut(t), l = -n.scrollTop; return "rtl" === yt(s || i).direction && (a += kt(i.clientWidth, s ? s.clientWidth : 0) - o), { width: o, height: r, x: a, y: l }; }(Et(t))); } function Yt(t) { return t.split("-")[1]; } function Qt(t) { var e, i = t.reference, n = t.element, s = t.placement, o = s ? gt(s) : null, r = s ? Yt(s) : null, a = i.x + i.width / 2 - n.width / 2, l = i.y + i.height / 2 - n.height / 2; switch (o) { case it: e = { x: a, y: i.y - n.height }; break; case nt: e = { x: a, y: i.y + i.height }; break; case st: e = { x: i.x + i.width, y: l }; break; case ot: e = { x: i.x - n.width, y: l }; break; default: e = { x: i.x, y: i.y }; } var c = o ? Ct(o) : null; if (null != c) { var h = "y" === c ? "height" : "width"; switch (r) { case "start": e[c] = e[c] - (i[h] / 2 - n[h] / 2); break; case "end": e[c] = e[c] + (i[h] / 2 - n[h] / 2); } } return e; } function Gt(t, e) { void 0 === e && (e = {}); var i = e, n = i.placement, s = void 0 === n ? t.placement : n, o = i.boundary, r = void 0 === o ? "clippingParents" : o, a = i.rootBoundary, l = void 0 === a ? "viewport" : a, c = i.elementContext, h = void 0 === c ? "popper" : c, d = i.altBoundary, u = void 0 !== d && d, f = i.padding, p = void 0 === f ? 0 : f, m = St("number" != typeof p ? p : It(p, rt)), g = "popper" === h ? "reference" : "popper", _ = t.elements.reference, b = t.rects.popper, v = t.elements[u ? g : h], y = function (t, e, i) { var n = "clippingParents" === e ? function (t) { var e = Vt(At(t)), i = ["absolute", "fixed"].indexOf(yt(t).position) >= 0 && ft(t) ? Ot(t) : t; return ut(i) ? e.filter(function (t) { return ut(t) && vt(t, i) && "body" !== ht(t); }) : []; }(t) : [].concat(e), s = [].concat(n, [i]), o = s[0], r = s.reduce(function (e, i) { var n = Xt(t, i); return e.top = kt(n.top, e.top), e.right = Lt(n.right, e.right), e.bottom = Lt(n.bottom, e.bottom), e.left = kt(n.left, e.left), e; }, Xt(t, o)); return r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r; }(ut(v) ? v : v.contextElement || Et(t.elements.popper), r, l), w = _t(_), E = Qt({ reference: w, element: b, strategy: "absolute", placement: s }), A = Kt(Object.assign({}, b, E)), T = "popper" === h ? A : w, O = { top: y.top - T.top + m.top, bottom: T.bottom - y.bottom + m.bottom, left: y.left - T.left + m.left, right: T.right - y.right + m.right }, C = t.modifiersData.offset; if ("popper" === h && C) { var k = C[s]; Object.keys(O).forEach(function (t) { var e = [st, nt].indexOf(t) >= 0 ? 1 : -1, i = [it, nt].indexOf(t) >= 0 ? "y" : "x"; O[t] += k[i] * e; }); } return O; } function Zt(t, e) { void 0 === e && (e = {}); var i = e, n = i.placement, s = i.boundary, o = i.rootBoundary, r = i.padding, a = i.flipVariations, l = i.allowedAutoPlacements, c = void 0 === l ? lt : l, h = Yt(n), d = h ? a ? at : at.filter(function (t) { return Yt(t) === h; }) : rt, u = d.filter(function (t) { return c.indexOf(t) >= 0; }); 0 === u.length && (u = d); var f = u.reduce(function (e, i) { return e[i] = Gt(t, { placement: i, boundary: s, rootBoundary: o, padding: r })[gt(i)], e; }, {}); return Object.keys(f).sort(function (t, e) { return f[t] - f[e]; }); } var Jt = { name: "flip", enabled: !0, phase: "main", fn: function fn(t) { var e = t.state, i = t.options, n = t.name; if (!e.modifiersData[n]._skip) { for (var s = i.mainAxis, o = void 0 === s || s, r = i.altAxis, a = void 0 === r || r, l = i.fallbackPlacements, c = i.padding, h = i.boundary, d = i.rootBoundary, u = i.altBoundary, f = i.flipVariations, p = void 0 === f || f, m = i.allowedAutoPlacements, g = e.options.placement, _ = gt(g), b = l || (_ !== g && p ? function (t) { if ("auto" === gt(t)) return []; var e = Wt(t); return [zt(t), e, zt(e)]; }(g) : [Wt(g)]), v = [g].concat(b).reduce(function (t, i) { return t.concat("auto" === gt(i) ? Zt(e, { placement: i, boundary: h, rootBoundary: d, padding: c, flipVariations: p, allowedAutoPlacements: m }) : i); }, []), y = e.rects.reference, w = e.rects.popper, E = new Map(), A = !0, T = v[0], O = 0; O < v.length; O++) { var C = v[O], k = gt(C), L = "start" === Yt(C), x = [it, nt].indexOf(k) >= 0, D = x ? "width" : "height", S = Gt(e, { placement: C, boundary: h, rootBoundary: d, altBoundary: u, padding: c }), I = x ? L ? st : ot : L ? nt : it; y[D] > w[D] && (I = Wt(I)); var N = Wt(I), j = []; if (o && j.push(S[k] <= 0), a && j.push(S[I] <= 0, S[N] <= 0), j.every(function (t) { return t; })) { T = C, A = !1; break; } E.set(C, j); } if (A) for (var M = function M(t) { var e = v.find(function (e) { var i = E.get(e); if (i) return i.slice(0, t).every(function (t) { return t; }); }); if (e) return T = e, "break"; }, P = p ? 3 : 1; P > 0 && "break" !== M(P); P--) { ; } e.placement !== T && (e.modifiersData[n]._skip = !0, e.placement = T, e.reset = !0); } }, requiresIfExists: ["offset"], data: { _skip: !1 } }; function te(t, e, i) { return void 0 === i && (i = { x: 0, y: 0 }), { top: t.top - e.height - i.y, right: t.right - e.width + i.x, bottom: t.bottom - e.height + i.y, left: t.left - e.width - i.x }; } function ee(t) { return [it, st, nt, ot].some(function (e) { return t[e] >= 0; }); } var ie = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: function fn(t) { var e = t.state, i = t.name, n = e.rects.reference, s = e.rects.popper, o = e.modifiersData.preventOverflow, r = Gt(e, { elementContext: "reference" }), a = Gt(e, { altBoundary: !0 }), l = te(r, n), c = te(a, s, o), h = ee(l), d = ee(c); e.modifiersData[i] = { referenceClippingOffsets: l, popperEscapeOffsets: c, isReferenceHidden: h, hasPopperEscaped: d }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": h, "data-popper-escaped": d }); } }, ne = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: function fn(t) { var e = t.state, i = t.options, n = t.name, s = i.offset, o = void 0 === s ? [0, 0] : s, r = lt.reduce(function (t, i) { return t[i] = function (t, e, i) { var n = gt(t), s = [ot, it].indexOf(n) >= 0 ? -1 : 1, o = "function" == typeof i ? i(Object.assign({}, e, { placement: t })) : i, r = o[0], a = o[1]; return r = r || 0, a = (a || 0) * s, [ot, st].indexOf(n) >= 0 ? { x: a, y: r } : { x: r, y: a }; }(i, e.rects, o), t; }, {}), a = r[e.placement], l = a.x, c = a.y; null != e.modifiersData.popperOffsets && (e.modifiersData.popperOffsets.x += l, e.modifiersData.popperOffsets.y += c), e.modifiersData[n] = r; } }, se = { name: "popperOffsets", enabled: !0, phase: "read", fn: function fn(t) { var e = t.state, i = t.name; e.modifiersData[i] = Qt({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement }); }, data: {} }, oe = { name: "preventOverflow", enabled: !0, phase: "main", fn: function fn(t) { var e = t.state, i = t.options, n = t.name, s = i.mainAxis, o = void 0 === s || s, r = i.altAxis, a = void 0 !== r && r, l = i.boundary, c = i.rootBoundary, h = i.altBoundary, d = i.padding, u = i.tether, f = void 0 === u || u, p = i.tetherOffset, m = void 0 === p ? 0 : p, g = Gt(e, { boundary: l, rootBoundary: c, padding: d, altBoundary: h }), _ = gt(e.placement), b = Yt(e.placement), v = !b, y = Ct(_), w = "x" === y ? "y" : "x", E = e.modifiersData.popperOffsets, A = e.rects.reference, T = e.rects.popper, O = "function" == typeof m ? m(Object.assign({}, e.rects, { placement: e.placement })) : m, C = { x: 0, y: 0 }; if (E) { if (o || a) { var k = "y" === y ? it : ot, L = "y" === y ? nt : st, x = "y" === y ? "height" : "width", D = E[y], S = E[y] + g[k], I = E[y] - g[L], N = f ? -T[x] / 2 : 0, j = "start" === b ? A[x] : T[x], M = "start" === b ? -T[x] : -A[x], P = e.elements.arrow, H = f && P ? bt(P) : { width: 0, height: 0 }, R = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : { top: 0, right: 0, bottom: 0, left: 0 }, B = R[k], W = R[L], q = Dt(0, A[x], H[x]), z = v ? A[x] / 2 - N - q - B - O : j - q - B - O, $ = v ? -A[x] / 2 + N + q + W + O : M + q + W + O, U = e.elements.arrow && Ot(e.elements.arrow), F = U ? "y" === y ? U.clientTop || 0 : U.clientLeft || 0 : 0, V = e.modifiersData.offset ? e.modifiersData.offset[e.placement][y] : 0, K = E[y] + z - V - F, X = E[y] + $ - V; if (o) { var Y = Dt(f ? Lt(S, K) : S, D, f ? kt(I, X) : I); E[y] = Y, C[y] = Y - D; } if (a) { var Q = "x" === y ? it : ot, G = "x" === y ? nt : st, Z = E[w], J = Z + g[Q], tt = Z - g[G], et = Dt(f ? Lt(J, K) : J, Z, f ? kt(tt, X) : tt); E[w] = et, C[w] = et - Z; } } e.modifiersData[n] = C; } }, requiresIfExists: ["offset"] }; function re(t, e, i) { void 0 === i && (i = !1); var n, s, o = Et(e), r = _t(t), a = ft(e), l = { scrollLeft: 0, scrollTop: 0 }, c = { x: 0, y: 0 }; return (a || !a && !i) && (("body" !== ht(e) || Ft(o)) && (l = (n = e) !== dt(n) && ft(n) ? { scrollLeft: (s = n).scrollLeft, scrollTop: s.scrollTop } : $t(n)), ft(e) ? ((c = _t(e)).x += e.clientLeft, c.y += e.clientTop) : o && (c.x = Ut(o))), { x: r.left + l.scrollLeft - c.x, y: r.top + l.scrollTop - c.y, width: r.width, height: r.height }; } var ae = { placement: "bottom", modifiers: [], strategy: "absolute" }; function le() { for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) { e[i] = arguments[i]; } return !e.some(function (t) { return !(t && "function" == typeof t.getBoundingClientRect); }); } function ce(t) { void 0 === t && (t = {}); var e = t, i = e.defaultModifiers, n = void 0 === i ? [] : i, s = e.defaultOptions, o = void 0 === s ? ae : s; return function (t, e, i) { void 0 === i && (i = o); var s, r, a = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, ae, o), modifiersData: {}, elements: { reference: t, popper: e }, attributes: {}, styles: {} }, l = [], c = !1, h = { state: a, setOptions: function setOptions(i) { d(), a.options = Object.assign({}, o, a.options, i), a.scrollParents = { reference: ut(t) ? Vt(t) : t.contextElement ? Vt(t.contextElement) : [], popper: Vt(e) }; var s, r, c = function (t) { var e = function (t) { var e = new Map(), i = new Set(), n = []; return t.forEach(function (t) { e.set(t.name, t); }), t.forEach(function (t) { i.has(t.name) || function t(s) { i.add(s.name), [].concat(s.requires || [], s.requiresIfExists || []).forEach(function (n) { if (!i.has(n)) { var s = e.get(n); s && t(s); } }), n.push(s); }(t); }), n; }(t); return ct.reduce(function (t, i) { return t.concat(e.filter(function (t) { return t.phase === i; })); }, []); }((s = [].concat(n, a.options.modifiers), r = s.reduce(function (t, e) { var i = t[e.name]; return t[e.name] = i ? Object.assign({}, i, e, { options: Object.assign({}, i.options, e.options), data: Object.assign({}, i.data, e.data) }) : e, t; }, {}), Object.keys(r).map(function (t) { return r[t]; }))); return a.orderedModifiers = c.filter(function (t) { return t.enabled; }), a.orderedModifiers.forEach(function (t) { var e = t.name, i = t.options, n = void 0 === i ? {} : i, s = t.effect; if ("function" == typeof s) { var o = s({ state: a, name: e, instance: h, options: n }); l.push(o || function () {}); } }), h.update(); }, forceUpdate: function forceUpdate() { if (!c) { var t = a.elements, e = t.reference, i = t.popper; if (le(e, i)) { a.rects = { reference: re(e, Ot(i), "fixed" === a.options.strategy), popper: bt(i) }, a.reset = !1, a.placement = a.options.placement, a.orderedModifiers.forEach(function (t) { return a.modifiersData[t.name] = Object.assign({}, t.data); }); for (var n = 0; n < a.orderedModifiers.length; n++) { if (!0 !== a.reset) { var s = a.orderedModifiers[n], o = s.fn, r = s.options, l = void 0 === r ? {} : r, d = s.name; "function" == typeof o && (a = o({ state: a, options: l, name: d, instance: h }) || a); } else a.reset = !1, n = -1; } } } }, update: (s = function s() { return new Promise(function (t) { h.forceUpdate(), t(a); }); }, function () { return r || (r = new Promise(function (t) { Promise.resolve().then(function () { r = void 0, t(s()); }); })), r; }), destroy: function destroy() { d(), c = !0; } }; if (!le(t, e)) return h; function d() { l.forEach(function (t) { return t(); }), l = []; } return h.setOptions(i).then(function (t) { !c && i.onFirstUpdate && i.onFirstUpdate(t); }), h; }; } var he = ce(), de = ce({ defaultModifiers: [Rt, se, Pt, mt] }), ue = ce({ defaultModifiers: [Rt, se, Pt, mt, ne, Jt, oe, Nt, ie] }), fe = Object.freeze({ __proto__: null, popperGenerator: ce, detectOverflow: Gt, createPopperBase: he, createPopper: ue, createPopperLite: de, top: it, bottom: nt, right: st, left: ot, auto: "auto", basePlacements: rt, start: "start", end: "end", clippingParents: "clippingParents", viewport: "viewport", popper: "popper", reference: "reference", variationPlacements: at, placements: lt, beforeRead: "beforeRead", read: "read", afterRead: "afterRead", beforeMain: "beforeMain", main: "main", afterMain: "afterMain", beforeWrite: "beforeWrite", write: "write", afterWrite: "afterWrite", modifierPhases: ct, applyStyles: mt, arrow: Nt, computeStyles: Pt, eventListeners: Rt, flip: Jt, hide: ie, offset: ne, popperOffsets: se, preventOverflow: oe }); var pe = new RegExp("ArrowUp|ArrowDown|Escape"), me = g() ? "top-end" : "top-start", ge = g() ? "top-start" : "top-end", _e = g() ? "bottom-end" : "bottom-start", be = g() ? "bottom-start" : "bottom-end", ve = g() ? "left-start" : "right-start", ye = g() ? "right-start" : "left-start", we = { offset: [0, 2], boundary: "clippingParents", reference: "toggle", display: "dynamic", popperConfig: null, autoClose: !0 }, Ee = { offset: "(array|string|function)", boundary: "(string|element)", reference: "(string|element|object)", display: "string", popperConfig: "(null|object|function)", autoClose: "(boolean|string)" }; var Ae = /*#__PURE__*/ function (_B5) { _inherits(Ae, _B5); function Ae(t, e) { var _this12; _classCallCheck(this, Ae); _this12 = _possibleConstructorReturn(this, _getPrototypeOf(Ae).call(this, t)), _this12._popper = null, _this12._config = _this12._getConfig(e), _this12._menu = _this12._getMenuElement(), _this12._inNavbar = _this12._detectNavbar(), _this12._addEventListeners(); return _this12; } _createClass(Ae, [{ key: "toggle", value: function toggle() { h(this._element) || (this._element.classList.contains("show") ? this.hide() : this.show()); } }, { key: "show", value: function show() { if (h(this._element) || this._menu.classList.contains("show")) return; var t = Ae.getParentFromElement(this._element), e = { relatedTarget: this._element }; if (!P.trigger(this._element, "show.bs.dropdown", e).defaultPrevented) { var _ref8; if (this._inNavbar) U.setDataAttribute(this._menu, "popper", "none");else { if (void 0 === fe) throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)"); var _e6 = this._element; "parent" === this._config.reference ? _e6 = t : r(this._config.reference) ? _e6 = a(this._config.reference) : "object" == _typeof(this._config.reference) && (_e6 = this._config.reference); var _i9 = this._getPopperConfig(), _n5 = _i9.modifiers.find(function (t) { return "applyStyles" === t.name && !1 === t.enabled; }); this._popper = ue(_e6, this._menu, _i9), _n5 && U.setDataAttribute(this._menu, "popper", "static"); } "ontouchstart" in document.documentElement && !t.closest(".navbar-nav") && (_ref8 = []).concat.apply(_ref8, _toConsumableArray(document.body.children)).forEach(function (t) { return P.on(t, "mouseover", u); }), this._element.focus(), this._element.setAttribute("aria-expanded", !0), this._menu.classList.toggle("show"), this._element.classList.toggle("show"), P.trigger(this._element, "shown.bs.dropdown", e); } } }, { key: "hide", value: function hide() { if (h(this._element) || !this._menu.classList.contains("show")) return; var t = { relatedTarget: this._element }; this._completeHide(t); } }, { key: "dispose", value: function dispose() { this._popper && this._popper.destroy(), _get(_getPrototypeOf(Ae.prototype), "dispose", this).call(this); } }, { key: "update", value: function update() { this._inNavbar = this._detectNavbar(), this._popper && this._popper.update(); } }, { key: "_addEventListeners", value: function _addEventListeners() { var _this13 = this; P.on(this._element, "click.bs.dropdown", function (t) { t.preventDefault(), _this13.toggle(); }); } }, { key: "_completeHide", value: function _completeHide(t) { var _ref9; P.trigger(this._element, "hide.bs.dropdown", t).defaultPrevented || ("ontouchstart" in document.documentElement && (_ref9 = []).concat.apply(_ref9, _toConsumableArray(document.body.children)).forEach(function (t) { return P.off(t, "mouseover", u); }), this._popper && this._popper.destroy(), this._menu.classList.remove("show"), this._element.classList.remove("show"), this._element.setAttribute("aria-expanded", "false"), U.removeDataAttribute(this._menu, "popper"), P.trigger(this._element, "hidden.bs.dropdown", t)); } }, { key: "_getConfig", value: function _getConfig(t) { if (t = _objectSpread({}, this.constructor.Default, {}, U.getDataAttributes(this._element), {}, t), l("dropdown", t, this.constructor.DefaultType), "object" == _typeof(t.reference) && !r(t.reference) && "function" != typeof t.reference.getBoundingClientRect) throw new TypeError("dropdown".toUpperCase() + ': Option "reference" provided type "object" without a required "getBoundingClientRect" method.'); return t; } }, { key: "_getMenuElement", value: function _getMenuElement() { return t.next(this._element, ".dropdown-menu")[0]; } }, { key: "_getPlacement", value: function _getPlacement() { var t = this._element.parentNode; if (t.classList.contains("dropend")) return ve; if (t.classList.contains("dropstart")) return ye; var e = "end" === getComputedStyle(this._menu).getPropertyValue("--bs-position").trim(); return t.classList.contains("dropup") ? e ? ge : me : e ? be : _e; } }, { key: "_detectNavbar", value: function _detectNavbar() { return null !== this._element.closest(".navbar"); } }, { key: "_getOffset", value: function _getOffset() { var _this14 = this; var t = this._config.offset; return "string" == typeof t ? t.split(",").map(function (t) { return Number.parseInt(t, 10); }) : "function" == typeof t ? function (e) { return t(e, _this14._element); } : t; } }, { key: "_getPopperConfig", value: function _getPopperConfig() { var t = { placement: this._getPlacement(), modifiers: [{ name: "preventOverflow", options: { boundary: this._config.boundary } }, { name: "offset", options: { offset: this._getOffset() } }] }; return "static" === this._config.display && (t.modifiers = [{ name: "applyStyles", enabled: !1 }]), _objectSpread({}, t, {}, "function" == typeof this._config.popperConfig ? this._config.popperConfig(t) : this._config.popperConfig); } }, { key: "_selectMenuItem", value: function _selectMenuItem(_ref10) { var e = _ref10.key, i = _ref10.target; var n = t.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)", this._menu).filter(c); n.length && y(n, i, "ArrowDown" === e, !n.includes(i)).focus(); } }], [{ key: "dropdownInterface", value: function dropdownInterface(t, e) { var i = Ae.getOrCreateInstance(t, e); if ("string" == typeof e) { if (void 0 === i[e]) throw new TypeError("No method named \"".concat(e, "\"")); i[e](); } } }, { key: "jQueryInterface", value: function jQueryInterface(t) { return this.each(function () { Ae.dropdownInterface(this, t); }); } }, { key: "clearMenus", value: function clearMenus(e) { if (e && (2 === e.button || "keyup" === e.type && "Tab" !== e.key)) return; var i = t.find('[data-bs-toggle="dropdown"]'); for (var _t8 = 0, _n6 = i.length; _t8 < _n6; _t8++) { var _n7 = Ae.getInstance(i[_t8]); if (!_n7 || !1 === _n7._config.autoClose) continue; if (!_n7._element.classList.contains("show")) continue; var _s3 = { relatedTarget: _n7._element }; if (e) { var _t9 = e.composedPath(), _i10 = _t9.includes(_n7._menu); if (_t9.includes(_n7._element) || "inside" === _n7._config.autoClose && !_i10 || "outside" === _n7._config.autoClose && _i10) continue; if (_n7._menu.contains(e.target) && ("keyup" === e.type && "Tab" === e.key || /input|select|option|textarea|form/i.test(e.target.tagName))) continue; "click" === e.type && (_s3.clickEvent = e); } _n7._completeHide(_s3); } } }, { key: "getParentFromElement", value: function getParentFromElement(t) { return s(t) || t.parentNode; } }, { key: "dataApiKeydownHandler", value: function dataApiKeydownHandler(e) { var _this15 = this; if (/input|textarea/i.test(e.target.tagName) ? "Space" === e.key || "Escape" !== e.key && ("ArrowDown" !== e.key && "ArrowUp" !== e.key || e.target.closest(".dropdown-menu")) : !pe.test(e.key)) return; var i = this.classList.contains("show"); if (!i && "Escape" === e.key) return; if (e.preventDefault(), e.stopPropagation(), h(this)) return; var n = function n() { return _this15.matches('[data-bs-toggle="dropdown"]') ? _this15 : t.prev(_this15, '[data-bs-toggle="dropdown"]')[0]; }; return "Escape" === e.key ? (n().focus(), void Ae.clearMenus()) : "ArrowUp" === e.key || "ArrowDown" === e.key ? (i || n().click(), void Ae.getInstance(n())._selectMenuItem(e)) : void (i && "Space" !== e.key || Ae.clearMenus()); } }, { key: "Default", get: function get() { return we; } }, { key: "DefaultType", get: function get() { return Ee; } }, { key: "NAME", get: function get() { return "dropdown"; } }]); return Ae; }(B); P.on(document, "keydown.bs.dropdown.data-api", '[data-bs-toggle="dropdown"]', Ae.dataApiKeydownHandler), P.on(document, "keydown.bs.dropdown.data-api", ".dropdown-menu", Ae.dataApiKeydownHandler), P.on(document, "click.bs.dropdown.data-api", Ae.clearMenus), P.on(document, "keyup.bs.dropdown.data-api", Ae.clearMenus), P.on(document, "click.bs.dropdown.data-api", '[data-bs-toggle="dropdown"]', function (t) { t.preventDefault(), Ae.dropdownInterface(this); }), _(Ae); var Te = /*#__PURE__*/ function () { function Te() { _classCallCheck(this, Te); this._element = document.body; } _createClass(Te, [{ key: "getWidth", value: function getWidth() { var t = document.documentElement.clientWidth; return Math.abs(window.innerWidth - t); } }, { key: "hide", value: function hide() { var t = this.getWidth(); this._disableOverFlow(), this._setElementAttributes(this._element, "paddingRight", function (e) { return e + t; }), this._setElementAttributes(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top", "paddingRight", function (e) { return e + t; }), this._setElementAttributes(".sticky-top", "marginRight", function (e) { return e - t; }); } }, { key: "_disableOverFlow", value: function _disableOverFlow() { this._saveInitialAttribute(this._element, "overflow"), this._element.style.overflow = "hidden"; } }, { key: "_setElementAttributes", value: function _setElementAttributes(t, e, i) { var _this16 = this; var n = this.getWidth(); this._applyManipulationCallback(t, function (t) { if (t !== _this16._element && window.innerWidth > t.clientWidth + n) return; _this16._saveInitialAttribute(t, e); var s = window.getComputedStyle(t)[e]; t.style[e] = i(Number.parseFloat(s)) + "px"; }); } }, { key: "reset", value: function reset() { this._resetElementAttributes(this._element, "overflow"), this._resetElementAttributes(this._element, "paddingRight"), this._resetElementAttributes(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top", "paddingRight"), this._resetElementAttributes(".sticky-top", "marginRight"); } }, { key: "_saveInitialAttribute", value: function _saveInitialAttribute(t, e) { var i = t.style[e]; i && U.setDataAttribute(t, e, i); } }, { key: "_resetElementAttributes", value: function _resetElementAttributes(t, e) { this._applyManipulationCallback(t, function (t) { var i = U.getDataAttribute(t, e); void 0 === i ? t.style.removeProperty(e) : (U.removeDataAttribute(t, e), t.style[e] = i); }); } }, { key: "_applyManipulationCallback", value: function _applyManipulationCallback(e, i) { r(e) ? i(e) : t.find(e, this._element).forEach(i); } }, { key: "isOverflowing", value: function isOverflowing() { return this.getWidth() > 0; } }]); return Te; }(); var Oe = { isVisible: !0, isAnimated: !1, rootElement: "body", clickCallback: null }, Ce = { isVisible: "boolean", isAnimated: "boolean", rootElement: "(element|string)", clickCallback: "(function|null)" }; var ke = /*#__PURE__*/ function () { function ke(t) { _classCallCheck(this, ke); this._config = this._getConfig(t), this._isAppended = !1, this._element = null; } _createClass(ke, [{ key: "show", value: function show(t) { this._config.isVisible ? (this._append(), this._config.isAnimated && f(this._getElement()), this._getElement().classList.add("show"), this._emulateAnimation(function () { b(t); })) : b(t); } }, { key: "hide", value: function hide(t) { var _this17 = this; this._config.isVisible ? (this._getElement().classList.remove("show"), this._emulateAnimation(function () { _this17.dispose(), b(t); })) : b(t); } }, { key: "_getElement", value: function _getElement() { if (!this._element) { var _t10 = document.createElement("div"); _t10.className = "modal-backdrop", this._config.isAnimated && _t10.classList.add("fade"), this._element = _t10; } return this._element; } }, { key: "_getConfig", value: function _getConfig(t) { return (t = _objectSpread({}, Oe, {}, "object" == _typeof(t) ? t : {})).rootElement = a(t.rootElement), l("backdrop", t, Ce), t; } }, { key: "_append", value: function _append() { var _this18 = this; this._isAppended || (this._config.rootElement.appendChild(this._getElement()), P.on(this._getElement(), "mousedown.bs.backdrop", function () { b(_this18._config.clickCallback); }), this._isAppended = !0); } }, { key: "dispose", value: function dispose() { this._isAppended && (P.off(this._element, "mousedown.bs.backdrop"), this._element.remove(), this._isAppended = !1); } }, { key: "_emulateAnimation", value: function _emulateAnimation(t) { v(t, this._getElement(), this._config.isAnimated); } }]); return ke; }(); var Le = { backdrop: !0, keyboard: !0, focus: !0 }, xe = { backdrop: "(boolean|string)", keyboard: "boolean", focus: "boolean" }; var De = /*#__PURE__*/ function (_B6) { _inherits(De, _B6); function De(e, i) { var _this19; _classCallCheck(this, De); _this19 = _possibleConstructorReturn(this, _getPrototypeOf(De).call(this, e)), _this19._config = _this19._getConfig(i), _this19._dialog = t.findOne(".modal-dialog", _this19._element), _this19._backdrop = _this19._initializeBackDrop(), _this19._isShown = !1, _this19._ignoreBackdropClick = !1, _this19._isTransitioning = !1, _this19._scrollBar = new Te(); return _this19; } _createClass(De, [{ key: "toggle", value: function toggle(t) { return this._isShown ? this.hide() : this.show(t); } }, { key: "show", value: function show(t) { var _this20 = this; this._isShown || this._isTransitioning || P.trigger(this._element, "show.bs.modal", { relatedTarget: t }).defaultPrevented || (this._isShown = !0, this._isAnimated() && (this._isTransitioning = !0), this._scrollBar.hide(), document.body.classList.add("modal-open"), this._adjustDialog(), this._setEscapeEvent(), this._setResizeEvent(), P.on(this._element, "click.dismiss.bs.modal", '[data-bs-dismiss="modal"]', function (t) { return _this20.hide(t); }), P.on(this._dialog, "mousedown.dismiss.bs.modal", function () { P.one(_this20._element, "mouseup.dismiss.bs.modal", function (t) { t.target === _this20._element && (_this20._ignoreBackdropClick = !0); }); }), this._showBackdrop(function () { return _this20._showElement(t); })); } }, { key: "hide", value: function hide(t) { var _this21 = this; if (t && ["A", "AREA"].includes(t.target.tagName) && t.preventDefault(), !this._isShown || this._isTransitioning) return; if (P.trigger(this._element, "hide.bs.modal").defaultPrevented) return; this._isShown = !1; var e = this._isAnimated(); e && (this._isTransitioning = !0), this._setEscapeEvent(), this._setResizeEvent(), P.off(document, "focusin.bs.modal"), this._element.classList.remove("show"), P.off(this._element, "click.dismiss.bs.modal"), P.off(this._dialog, "mousedown.dismiss.bs.modal"), this._queueCallback(function () { return _this21._hideModal(); }, this._element, e); } }, { key: "dispose", value: function dispose() { [window, this._dialog].forEach(function (t) { return P.off(t, ".bs.modal"); }), this._backdrop.dispose(), _get(_getPrototypeOf(De.prototype), "dispose", this).call(this), P.off(document, "focusin.bs.modal"); } }, { key: "handleUpdate", value: function handleUpdate() { this._adjustDialog(); } }, { key: "_initializeBackDrop", value: function _initializeBackDrop() { return new ke({ isVisible: Boolean(this._config.backdrop), isAnimated: this._isAnimated() }); } }, { key: "_getConfig", value: function _getConfig(t) { return t = _objectSpread({}, Le, {}, U.getDataAttributes(this._element), {}, "object" == _typeof(t) ? t : {}), l("modal", t, xe), t; } }, { key: "_showElement", value: function _showElement(e) { var _this22 = this; var i = this._isAnimated(), n = t.findOne(".modal-body", this._dialog); this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE || document.body.appendChild(this._element), this._element.style.display = "block", this._element.removeAttribute("aria-hidden"), this._element.setAttribute("aria-modal", !0), this._element.setAttribute("role", "dialog"), this._element.scrollTop = 0, n && (n.scrollTop = 0), i && f(this._element), this._element.classList.add("show"), this._config.focus && this._enforceFocus(), this._queueCallback(function () { _this22._config.focus && _this22._element.focus(), _this22._isTransitioning = !1, P.trigger(_this22._element, "shown.bs.modal", { relatedTarget: e }); }, this._dialog, i); } }, { key: "_enforceFocus", value: function _enforceFocus() { var _this23 = this; P.off(document, "focusin.bs.modal"), P.on(document, "focusin.bs.modal", function (t) { document === t.target || _this23._element === t.target || _this23._element.contains(t.target) || _this23._element.focus(); }); } }, { key: "_setEscapeEvent", value: function _setEscapeEvent() { var _this24 = this; this._isShown ? P.on(this._element, "keydown.dismiss.bs.modal", function (t) { _this24._config.keyboard && "Escape" === t.key ? (t.preventDefault(), _this24.hide()) : _this24._config.keyboard || "Escape" !== t.key || _this24._triggerBackdropTransition(); }) : P.off(this._element, "keydown.dismiss.bs.modal"); } }, { key: "_setResizeEvent", value: function _setResizeEvent() { var _this25 = this; this._isShown ? P.on(window, "resize.bs.modal", function () { return _this25._adjustDialog(); }) : P.off(window, "resize.bs.modal"); } }, { key: "_hideModal", value: function _hideModal() { var _this26 = this; this._element.style.display = "none", this._element.setAttribute("aria-hidden", !0), this._element.removeAttribute("aria-modal"), this._element.removeAttribute("role"), this._isTransitioning = !1, this._backdrop.hide(function () { document.body.classList.remove("modal-open"), _this26._resetAdjustments(), _this26._scrollBar.reset(), P.trigger(_this26._element, "hidden.bs.modal"); }); } }, { key: "_showBackdrop", value: function _showBackdrop(t) { var _this27 = this; P.on(this._element, "click.dismiss.bs.modal", function (t) { _this27._ignoreBackdropClick ? _this27._ignoreBackdropClick = !1 : t.target === t.currentTarget && (!0 === _this27._config.backdrop ? _this27.hide() : "static" === _this27._config.backdrop && _this27._triggerBackdropTransition()); }), this._backdrop.show(t); } }, { key: "_isAnimated", value: function _isAnimated() { return this._element.classList.contains("fade"); } }, { key: "_triggerBackdropTransition", value: function _triggerBackdropTransition() { var _this28 = this; if (P.trigger(this._element, "hidePrevented.bs.modal").defaultPrevented) return; var _this$_element = this._element, t = _this$_element.classList, e = _this$_element.scrollHeight, i = _this$_element.style, n = e > document.documentElement.clientHeight; !n && "hidden" === i.overflowY || t.contains("modal-static") || (n || (i.overflowY = "hidden"), t.add("modal-static"), this._queueCallback(function () { t.remove("modal-static"), n || _this28._queueCallback(function () { i.overflowY = ""; }, _this28._dialog); }, this._dialog), this._element.focus()); } }, { key: "_adjustDialog", value: function _adjustDialog() { var t = this._element.scrollHeight > document.documentElement.clientHeight, e = this._scrollBar.getWidth(), i = e > 0; (!i && t && !g() || i && !t && g()) && (this._element.style.paddingLeft = e + "px"), (i && !t && !g() || !i && t && g()) && (this._element.style.paddingRight = e + "px"); } }, { key: "_resetAdjustments", value: function _resetAdjustments() { this._element.style.paddingLeft = "", this._element.style.paddingRight = ""; } }], [{ key: "jQueryInterface", value: function jQueryInterface(t, e) { return this.each(function () { var i = De.getOrCreateInstance(this, t); if ("string" == typeof t) { if (void 0 === i[t]) throw new TypeError("No method named \"".concat(t, "\"")); i[t](e); } }); } }, { key: "Default", get: function get() { return Le; } }, { key: "NAME", get: function get() { return "modal"; } }]); return De; }(B); P.on(document, "click.bs.modal.data-api", '[data-bs-toggle="modal"]', function (t) { var _this29 = this; var e = s(this); ["A", "AREA"].includes(this.tagName) && t.preventDefault(), P.one(e, "show.bs.modal", function (t) { t.defaultPrevented || P.one(e, "hidden.bs.modal", function () { c(_this29) && _this29.focus(); }); }), De.getOrCreateInstance(e).toggle(this); }), _(De); var Se = { backdrop: !0, keyboard: !0, scroll: !1 }, Ie = { backdrop: "boolean", keyboard: "boolean", scroll: "boolean" }; var Ne = /*#__PURE__*/ function (_B7) { _inherits(Ne, _B7); function Ne(t, e) { var _this30; _classCallCheck(this, Ne); _this30 = _possibleConstructorReturn(this, _getPrototypeOf(Ne).call(this, t)), _this30._config = _this30._getConfig(e), _this30._isShown = !1, _this30._backdrop = _this30._initializeBackDrop(), _this30._addEventListeners(); return _this30; } _createClass(Ne, [{ key: "toggle", value: function toggle(t) { return this._isShown ? this.hide() : this.show(t); } }, { key: "show", value: function show(t) { var _this31 = this; this._isShown || P.trigger(this._element, "show.bs.offcanvas", { relatedTarget: t }).defaultPrevented || (this._isShown = !0, this._element.style.visibility = "visible", this._backdrop.show(), this._config.scroll || (new Te().hide(), this._enforceFocusOnElement(this._element)), this._element.removeAttribute("aria-hidden"), this._element.setAttribute("aria-modal", !0), this._element.setAttribute("role", "dialog"), this._element.classList.add("show"), this._queueCallback(function () { P.trigger(_this31._element, "shown.bs.offcanvas", { relatedTarget: t }); }, this._element, !0)); } }, { key: "hide", value: function hide() { var _this32 = this; this._isShown && (P.trigger(this._element, "hide.bs.offcanvas").defaultPrevented || (P.off(document, "focusin.bs.offcanvas"), this._element.blur(), this._isShown = !1, this._element.classList.remove("show"), this._backdrop.hide(), this._queueCallback(function () { _this32._element.setAttribute("aria-hidden", !0), _this32._element.removeAttribute("aria-modal"), _this32._element.removeAttribute("role"), _this32._element.style.visibility = "hidden", _this32._config.scroll || new Te().reset(), P.trigger(_this32._element, "hidden.bs.offcanvas"); }, this._element, !0))); } }, { key: "dispose", value: function dispose() { this._backdrop.dispose(), _get(_getPrototypeOf(Ne.prototype), "dispose", this).call(this), P.off(document, "focusin.bs.offcanvas"); } }, { key: "_getConfig", value: function _getConfig(t) { return t = _objectSpread({}, Se, {}, U.getDataAttributes(this._element), {}, "object" == _typeof(t) ? t : {}), l("offcanvas", t, Ie), t; } }, { key: "_initializeBackDrop", value: function _initializeBackDrop() { var _this33 = this; return new ke({ isVisible: this._config.backdrop, isAnimated: !0, rootElement: this._element.parentNode, clickCallback: function clickCallback() { return _this33.hide(); } }); } }, { key: "_enforceFocusOnElement", value: function _enforceFocusOnElement(t) { P.off(document, "focusin.bs.offcanvas"), P.on(document, "focusin.bs.offcanvas", function (e) { document === e.target || t === e.target || t.contains(e.target) || t.focus(); }), t.focus(); } }, { key: "_addEventListeners", value: function _addEventListeners() { var _this34 = this; P.on(this._element, "click.dismiss.bs.offcanvas", '[data-bs-dismiss="offcanvas"]', function () { return _this34.hide(); }), P.on(this._element, "keydown.dismiss.bs.offcanvas", function (t) { _this34._config.keyboard && "Escape" === t.key && _this34.hide(); }); } }], [{ key: "jQueryInterface", value: function jQueryInterface(t) { return this.each(function () { var e = Ne.getOrCreateInstance(this, t); if ("string" == typeof t) { if (void 0 === e[t] || t.startsWith("_") || "constructor" === t) throw new TypeError("No method named \"".concat(t, "\"")); e[t](this); } }); } }, { key: "NAME", get: function get() { return "offcanvas"; } }, { key: "Default", get: function get() { return Se; } }]); return Ne; }(B); P.on(document, "click.bs.offcanvas.data-api", '[data-bs-toggle="offcanvas"]', function (e) { var _this35 = this; var i = s(this); if (["A", "AREA"].includes(this.tagName) && e.preventDefault(), h(this)) return; P.one(i, "hidden.bs.offcanvas", function () { c(_this35) && _this35.focus(); }); var n = t.findOne(".offcanvas.show"); n && n !== i && Ne.getInstance(n).hide(), Ne.getOrCreateInstance(i).toggle(this); }), P.on(window, "load.bs.offcanvas.data-api", function () { return t.find(".offcanvas.show").forEach(function (t) { return Ne.getOrCreateInstance(t).show(); }); }), _(Ne); var je = new Set(["background", "cite", "href", "itemtype", "longdesc", "poster", "src", "xlink:href"]), Me = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i, Pe = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i, He = function He(t, e) { var i = t.nodeName.toLowerCase(); if (e.includes(i)) return !je.has(i) || Boolean(Me.test(t.nodeValue) || Pe.test(t.nodeValue)); var n = e.filter(function (t) { return t instanceof RegExp; }); for (var _t11 = 0, _e7 = n.length; _t11 < _e7; _t11++) { if (n[_t11].test(i)) return !0; } return !1; }; function Re(t, e, i) { var _ref11; if (!t.length) return t; if (i && "function" == typeof i) return i(t); var n = new window.DOMParser().parseFromString(t, "text/html"), s = Object.keys(e), o = (_ref11 = []).concat.apply(_ref11, _toConsumableArray(n.body.querySelectorAll("*"))); var _loop = function _loop(_t12, _i11) { var _ref12; var i = o[_t12], n = i.nodeName.toLowerCase(); if (!s.includes(n)) { i.remove(); return "continue"; } var r = (_ref12 = []).concat.apply(_ref12, _toConsumableArray(i.attributes)), a = [].concat(e["*"] || [], e[n] || []); r.forEach(function (t) { He(t, a) || i.removeAttribute(t.nodeName); }); }; for (var _t12 = 0, _i11 = o.length; _t12 < _i11; _t12++) { var _ret = _loop(_t12, _i11); if (_ret === "continue") continue; } return n.body.innerHTML; } var Be = new RegExp("(^|\\s)bs-tooltip\\S+", "g"), We = new Set(["sanitize", "allowList", "sanitizeFn"]), qe = { animation: "boolean", template: "string", title: "(string|element|function)", trigger: "string", delay: "(number|object)", html: "boolean", selector: "(string|boolean)", placement: "(string|function)", offset: "(array|string|function)", container: "(string|element|boolean)", fallbackPlacements: "array", boundary: "(string|element)", customClass: "(string|function)", sanitize: "boolean", sanitizeFn: "(null|function)", allowList: "object", popperConfig: "(null|object|function)" }, ze = { AUTO: "auto", TOP: "top", RIGHT: g() ? "left" : "right", BOTTOM: "bottom", LEFT: g() ? "right" : "left" }, $e = { animation: !0, template: '