{ "version": 3, "sources": ["../../../node_modules/@hotwired/turbo-rails/node_modules/@rails/actioncable/src/adapters.js", "../../../node_modules/@hotwired/turbo-rails/node_modules/@rails/actioncable/src/logger.js", "../../../node_modules/@hotwired/turbo-rails/node_modules/@rails/actioncable/src/connection_monitor.js", "../../../node_modules/@hotwired/turbo-rails/node_modules/@rails/actioncable/src/internal.js", "../../../node_modules/@hotwired/turbo-rails/node_modules/@rails/actioncable/src/connection.js", "../../../node_modules/@hotwired/turbo-rails/node_modules/@rails/actioncable/src/subscription.js", "../../../node_modules/@hotwired/turbo-rails/node_modules/@rails/actioncable/src/subscription_guarantor.js", "../../../node_modules/@hotwired/turbo-rails/node_modules/@rails/actioncable/src/subscriptions.js", "../../../node_modules/@hotwired/turbo-rails/node_modules/@rails/actioncable/src/consumer.js", "../../../node_modules/@hotwired/turbo-rails/node_modules/@rails/actioncable/src/index.js", "../../../node_modules/flatpickr/dist/l10n/de.js", "../../../node_modules/headroom.js/dist/headroom.js", "../../../node_modules/@rails/actioncable/app/assets/javascripts/action_cable.js", "../../../node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js", "../../../node_modules/intl-tel-input/build/js/intlTelInput.js", "../../../node_modules/intl-tel-input/index.js", "../../../node_modules/intl-tel-input/build/js/utils.js", "../../../node_modules/trix/src/trix/config/attachments.js", "../../../node_modules/trix/src/trix/config/block_attributes.js", "../../../node_modules/trix/src/trix/config/browser.js", "../../../node_modules/trix/src/trix/config/lang.js", "../../../node_modules/trix/src/trix/config/file_size_formatting.js", "../../../node_modules/trix/src/trix/constants.js", "../../../node_modules/trix/src/trix/core/helpers/extend.js", "../../../node_modules/trix/src/trix/core/helpers/dom.js", "../../../node_modules/trix/src/trix/config/input.js", "../../../node_modules/trix/src/trix/config/key_names.js", "../../../node_modules/trix/src/trix/config/parser.js", "../../../node_modules/trix/src/trix/config/text_attributes.js", "../../../node_modules/trix/src/trix/config/toolbar.js", "../../../node_modules/trix/src/trix/config/undo.js", "../../../node_modules/trix/src/trix/config/css.js", "../../../node_modules/trix/src/trix/core/basic_object.js", "../../../node_modules/trix/src/trix/core/utilities/utf16_string.js", "../../../node_modules/trix/src/trix/core/object.js", "../../../node_modules/trix/src/trix/core/helpers/arrays.js", "../../../node_modules/trix/src/trix/core/helpers/bidi.js", "../../../node_modules/trix/src/trix/core/helpers/config.js", "../../../node_modules/trix/src/trix/core/helpers/custom_elements.js", "../../../node_modules/trix/src/trix/core/helpers/events.js", "../../../node_modules/trix/src/trix/core/helpers/functions.js", "../../../node_modules/trix/src/trix/core/helpers/objects.js", "../../../node_modules/trix/src/trix/core/helpers/ranges.js", "../../../node_modules/trix/src/trix/observers/selection_change_observer.js", "../../../node_modules/trix/src/trix/core/helpers/strings.js", "../../../node_modules/trix/src/trix/core/collections/hash.js", "../../../node_modules/trix/src/trix/core/collections/object_group.js", "../../../node_modules/trix/src/trix/core/collections/object_map.js", "../../../node_modules/trix/src/trix/core/collections/element_store.js", "../../../node_modules/trix/src/trix/core/utilities/operation.js", "../../../node_modules/trix/src/trix/views/object_view.js", "../../../node_modules/trix/src/trix/views/attachment_view.js", "../../../node_modules/trix/src/trix/views/previewable_attachment_view.js", "../../../node_modules/trix/src/trix/views/piece_view.js", "../../../node_modules/trix/src/trix/views/text_view.js", "../../../node_modules/trix/src/trix/views/block_view.js", "../../../node_modules/trix/src/trix/views/document_view.js", "../../../node_modules/trix/src/trix/models/piece.js", "../../../node_modules/trix/src/trix/operations/image_preload_operation.js", "../../../node_modules/trix/src/trix/models/attachment.js", "../../../node_modules/trix/src/trix/models/attachment_piece.js", "../../../node_modules/trix/src/trix/models/string_piece.js", "../../../node_modules/trix/src/trix/models/splittable_list.js", "../../../node_modules/trix/src/trix/models/text.js", "../../../node_modules/trix/src/trix/models/block.js", "../../../node_modules/trix/src/trix/models/document.js", "../../../node_modules/trix/src/trix/models/html_sanitizer.js", "../../../node_modules/trix/src/trix/models/html_parser.js", "../../../node_modules/trix/src/trix/core/serialization.js", "../../../node_modules/trix/src/trix/models/managed_attachment.js", "../../../node_modules/trix/src/trix/models/attachment_manager.js", "../../../node_modules/trix/src/trix/models/line_break_insertion.js", "../../../node_modules/trix/src/trix/models/composition.js", "../../../node_modules/trix/src/trix/models/undo_manager.js", "../../../node_modules/trix/src/trix/filters/filter.js", "../../../node_modules/trix/src/trix/filters/attachment_gallery_filter.js", "../../../node_modules/trix/src/trix/models/editor.js", "../../../node_modules/trix/src/trix/models/location_mapper.js", "../../../node_modules/trix/src/trix/models/point_mapper.js", "../../../node_modules/trix/src/trix/models/selection_manager.js", "../../../node_modules/trix/src/trix/controllers/attachment_editor_controller.js", "../../../node_modules/trix/src/trix/controllers/composition_controller.js", "../../../node_modules/trix/src/trix/controllers/controller.js", "../../../node_modules/trix/src/trix/observers/mutation_observer.js", "../../../node_modules/trix/src/trix/operations/file_verification_operation.js", "../../../node_modules/trix/src/trix/models/flaky_android_keyboard_detector.js", "../../../node_modules/trix/src/trix/controllers/input_controller.js", "../../../node_modules/trix/src/trix/controllers/level_0_input_controller.js", "../../../node_modules/trix/src/trix/controllers/level_2_input_controller.js", "../../../node_modules/trix/src/trix/controllers/toolbar_controller.js", "../../../node_modules/trix/src/trix/controllers/editor_controller.js", "../../../node_modules/trix/src/trix/elements/trix_toolbar_element.js", "../../../node_modules/trix/src/trix/elements/trix_editor_element.js", "../../../node_modules/trix/src/trix/trix.js", "../../../node_modules/file-saver/src/FileSaver.js", "../../../node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/form_submissions.js", "../../../node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js", "../../../node_modules/@hotwired/stimulus/dist/stimulus.js", "../../javascript/controllers/application.js", "../../javascript/controllers/accordion_controller.js", "../../javascript/controllers/calendar_controller.js", "../../javascript/controllers/clipboard_controller.js", "../../javascript/controllers/comment_controller.js", "../../javascript/controllers/content_box_controller.js", "../../../node_modules/flatpickr/dist/esm/types/options.js", "../../../node_modules/flatpickr/dist/esm/l10n/default.js", "../../../node_modules/flatpickr/dist/esm/utils/index.js", "../../../node_modules/flatpickr/dist/esm/utils/dom.js", "../../../node_modules/flatpickr/dist/esm/utils/formatting.js", "../../../node_modules/flatpickr/dist/esm/utils/dates.js", "../../../node_modules/flatpickr/dist/esm/utils/polyfills.js", "../../../node_modules/flatpickr/dist/esm/index.js", "../../javascript/controllers/datepicker_controller.js", "../../../node_modules/sortablejs/modular/sortable.esm.js", "../../../node_modules/@rails/request.js/src/fetch_response.js", "../../../node_modules/@rails/request.js/src/request_interceptor.js", "../../../node_modules/@rails/request.js/src/lib/utils.js", "../../../node_modules/@rails/request.js/src/fetch_request.js", "../../../node_modules/@rails/request.js/src/verbs.js", "../../javascript/controllers/drag_controller.js", "../../javascript/controllers/employee_availability_controller.js", "../../javascript/controllers/expandable_controller.js", "../../javascript/controllers/form_controller.js", "../../../node_modules/@glidejs/glide/dist/glide.esm.js", "../../javascript/controllers/glider_controller.js", "../../javascript/controllers/headroom_controller.js", "../../javascript/controllers/intersection_controller.js", "../../javascript/controllers/link_to_controller.js", "../../javascript/controllers/modal_controller.js", "../../../node_modules/hotkeys-js/dist/hotkeys.esm.js", "../../../node_modules/stimulus-use/dist/index.js", "../../../node_modules/el-transition/index.js", "../../javascript/controllers/navigation_controller.js", "../../javascript/controllers/nested_field_controller.js", "../../javascript/controllers/nested_fields_controller.js", "../../javascript/controllers/newsletter_controller.js", "../../javascript/controllers/notification_controller.js", "../../javascript/channels/consumer.js", "../../javascript/controllers/payslip_export_controller.js", "../../javascript/controllers/phone_controller.js", "../../javascript/controllers/radio_button_toggle_controller.js", "../../javascript/controllers/report_card_controller.js", "../../javascript/controllers/richtext_controller.js", "../../../node_modules/ssr-window/ssr-window.esm.js", "../../../node_modules/dom7/dom7.esm.js", "../../../node_modules/swiper/esm/utils/dom.js", "../../../node_modules/swiper/esm/utils/utils.js", "../../../node_modules/swiper/esm/utils/get-support.js", "../../../node_modules/swiper/esm/utils/get-device.js", "../../../node_modules/swiper/esm/utils/get-browser.js", "../../../node_modules/swiper/esm/modules/resize/resize.js", "../../../node_modules/swiper/esm/modules/observer/observer.js", "../../../node_modules/swiper/esm/components/core/modular.js", "../../../node_modules/swiper/esm/components/core/events-emitter.js", "../../../node_modules/swiper/esm/components/core/update/updateSize.js", "../../../node_modules/swiper/esm/components/core/update/updateSlides.js", "../../../node_modules/swiper/esm/components/core/update/updateAutoHeight.js", "../../../node_modules/swiper/esm/components/core/update/updateSlidesOffset.js", "../../../node_modules/swiper/esm/components/core/update/updateSlidesProgress.js", "../../../node_modules/swiper/esm/components/core/update/updateProgress.js", "../../../node_modules/swiper/esm/components/core/update/updateSlidesClasses.js", "../../../node_modules/swiper/esm/components/core/update/updateActiveIndex.js", "../../../node_modules/swiper/esm/components/core/update/updateClickedSlide.js", "../../../node_modules/swiper/esm/components/core/update/index.js", "../../../node_modules/swiper/esm/components/core/translate/getTranslate.js", "../../../node_modules/swiper/esm/components/core/translate/setTranslate.js", "../../../node_modules/swiper/esm/components/core/translate/minTranslate.js", "../../../node_modules/swiper/esm/components/core/translate/maxTranslate.js", "../../../node_modules/swiper/esm/components/core/translate/translateTo.js", "../../../node_modules/swiper/esm/components/core/translate/index.js", "../../../node_modules/swiper/esm/components/core/transition/setTransition.js", "../../../node_modules/swiper/esm/components/core/transition/transitionStart.js", "../../../node_modules/swiper/esm/components/core/transition/transitionEnd.js", "../../../node_modules/swiper/esm/components/core/transition/index.js", "../../../node_modules/swiper/esm/components/core/slide/slideTo.js", "../../../node_modules/swiper/esm/components/core/slide/slideToLoop.js", "../../../node_modules/swiper/esm/components/core/slide/slideNext.js", "../../../node_modules/swiper/esm/components/core/slide/slidePrev.js", "../../../node_modules/swiper/esm/components/core/slide/slideReset.js", "../../../node_modules/swiper/esm/components/core/slide/slideToClosest.js", "../../../node_modules/swiper/esm/components/core/slide/slideToClickedSlide.js", "../../../node_modules/swiper/esm/components/core/slide/index.js", "../../../node_modules/swiper/esm/components/core/loop/loopCreate.js", "../../../node_modules/swiper/esm/components/core/loop/loopFix.js", "../../../node_modules/swiper/esm/components/core/loop/loopDestroy.js", "../../../node_modules/swiper/esm/components/core/loop/index.js", "../../../node_modules/swiper/esm/components/core/grab-cursor/setGrabCursor.js", "../../../node_modules/swiper/esm/components/core/grab-cursor/unsetGrabCursor.js", "../../../node_modules/swiper/esm/components/core/grab-cursor/index.js", "../../../node_modules/swiper/esm/components/core/manipulation/appendSlide.js", "../../../node_modules/swiper/esm/components/core/manipulation/prependSlide.js", "../../../node_modules/swiper/esm/components/core/manipulation/addSlide.js", "../../../node_modules/swiper/esm/components/core/manipulation/removeSlide.js", "../../../node_modules/swiper/esm/components/core/manipulation/removeAllSlides.js", "../../../node_modules/swiper/esm/components/core/manipulation/index.js", "../../../node_modules/swiper/esm/components/core/events/onTouchStart.js", "../../../node_modules/swiper/esm/components/core/events/onTouchMove.js", "../../../node_modules/swiper/esm/components/core/events/onTouchEnd.js", "../../../node_modules/swiper/esm/components/core/events/onResize.js", "../../../node_modules/swiper/esm/components/core/events/onClick.js", "../../../node_modules/swiper/esm/components/core/events/onScroll.js", "../../../node_modules/swiper/esm/components/core/events/index.js", "../../../node_modules/swiper/esm/components/core/breakpoints/setBreakpoint.js", "../../../node_modules/swiper/esm/components/core/breakpoints/getBreakpoint.js", "../../../node_modules/swiper/esm/components/core/breakpoints/index.js", "../../../node_modules/swiper/esm/components/core/classes/addClasses.js", "../../../node_modules/swiper/esm/components/core/classes/removeClasses.js", "../../../node_modules/swiper/esm/components/core/classes/index.js", "../../../node_modules/swiper/esm/components/core/images/loadImage.js", "../../../node_modules/swiper/esm/components/core/images/preloadImages.js", "../../../node_modules/swiper/esm/components/core/images/index.js", "../../../node_modules/swiper/esm/components/core/check-overflow/index.js", "../../../node_modules/swiper/esm/components/core/defaults.js", "../../../node_modules/swiper/esm/components/core/core-class.js", "../../../node_modules/swiper/esm/components/navigation/navigation.js", "../../../node_modules/swiper/esm/components/pagination/pagination.js", "../../../node_modules/swiper/esm/components/autoplay/autoplay.js", "../../javascript/controllers/swiper_controller.js", "../../javascript/controllers/telegram_check_controller.js", "../../../node_modules/@popperjs/core/lib/enums.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/contains.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../../../node_modules/@popperjs/core/lib/utils/math.js", "../../../node_modules/@popperjs/core/lib/utils/within.js", "../../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../../../node_modules/@popperjs/core/lib/modifiers/arrow.js", "../../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../../../node_modules/@popperjs/core/lib/utils/getVariation.js", "../../../node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../../../node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../../../node_modules/@popperjs/core/lib/modifiers/flip.js", "../../../node_modules/@popperjs/core/lib/modifiers/hide.js", "../../../node_modules/@popperjs/core/lib/modifiers/offset.js", "../../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../../../node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../../../node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../../../node_modules/@popperjs/core/lib/utils/debounce.js", "../../../node_modules/@popperjs/core/lib/utils/format.js", "../../../node_modules/@popperjs/core/lib/utils/validateModifiers.js", "../../../node_modules/@popperjs/core/lib/utils/uniqueBy.js", "../../../node_modules/@popperjs/core/lib/utils/mergeByName.js", "../../../node_modules/@popperjs/core/lib/createPopper.js", "../../../node_modules/@popperjs/core/lib/popper.js", "../../../node_modules/tippy.js/src/constants.ts", "../../../node_modules/tippy.js/src/utils.ts", "../../../node_modules/tippy.js/src/dom-utils.ts", "../../../node_modules/tippy.js/src/bindGlobalEventListeners.ts", "../../../node_modules/tippy.js/src/browser.ts", "../../../node_modules/tippy.js/src/validation.ts", "../../../node_modules/tippy.js/src/props.ts", "../../../node_modules/tippy.js/src/template.ts", "../../../node_modules/tippy.js/src/createTippy.ts", "../../../node_modules/tippy.js/src/index.ts", "../../../node_modules/tippy.js/src/addons/createSingleton.ts", "../../../node_modules/tippy.js/src/addons/delegate.ts", "../../../node_modules/tippy.js/src/plugins/animateFill.ts", "../../../node_modules/tippy.js/src/plugins/followCursor.ts", "../../../node_modules/tippy.js/src/plugins/inlinePositioning.ts", "../../../node_modules/tippy.js/src/plugins/sticky.ts", "../../../node_modules/tippy.js/build/base.js", "../../javascript/controllers/tooltip_controller.js", "../../javascript/controllers/transaction_status_controller.js", "../../javascript/controllers/trix_embed_controller.js", "../../javascript/controllers/worker_select_controller.js", "../../javascript/controllers/index.js", "../../javascript/application.js", "../../../node_modules/@rails/actiontext/app/assets/javascripts/actiontext.esm.js"], "sourcesContent": ["export default {\n logger: self.console,\n WebSocket: self.WebSocket\n}\n", "import adapters from \"./adapters\"\n\n// The logger is disabled by default. You can enable it with:\n//\n// ActionCable.logger.enabled = true\n//\n// Example:\n//\n// import * as ActionCable from '@rails/actioncable'\n//\n// ActionCable.logger.enabled = true\n// ActionCable.logger.log('Connection Established.')\n//\n\nexport default {\n log(...messages) {\n if (this.enabled) {\n messages.push(Date.now())\n adapters.logger.log(\"[ActionCable]\", ...messages)\n }\n },\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring the cable connection is in good health by validating the heartbeat pings sent from the server, and attempting\n// revival reconnections if things go astray. Internal class, not intended for direct user manipulation.\n\nconst now = () => new Date().getTime()\n\nconst secondsSince = time => (now() - time) / 1000\n\nclass ConnectionMonitor {\n constructor(connection) {\n this.visibilityDidChange = this.visibilityDidChange.bind(this)\n this.connection = connection\n this.reconnectAttempts = 0\n }\n\n start() {\n if (!this.isRunning()) {\n this.startedAt = now()\n delete this.stoppedAt\n this.startPolling()\n addEventListener(\"visibilitychange\", this.visibilityDidChange)\n logger.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`)\n }\n }\n\n stop() {\n if (this.isRunning()) {\n this.stoppedAt = now()\n this.stopPolling()\n removeEventListener(\"visibilitychange\", this.visibilityDidChange)\n logger.log(\"ConnectionMonitor stopped\")\n }\n }\n\n isRunning() {\n return this.startedAt && !this.stoppedAt\n }\n\n recordPing() {\n this.pingedAt = now()\n }\n\n recordConnect() {\n this.reconnectAttempts = 0\n this.recordPing()\n delete this.disconnectedAt\n logger.log(\"ConnectionMonitor recorded connect\")\n }\n\n recordDisconnect() {\n this.disconnectedAt = now()\n logger.log(\"ConnectionMonitor recorded disconnect\")\n }\n\n // Private\n\n startPolling() {\n this.stopPolling()\n this.poll()\n }\n\n stopPolling() {\n clearTimeout(this.pollTimeout)\n }\n\n poll() {\n this.pollTimeout = setTimeout(() => {\n this.reconnectIfStale()\n this.poll()\n }\n , this.getPollInterval())\n }\n\n getPollInterval() {\n const { staleThreshold, reconnectionBackoffRate } = this.constructor\n const backoff = Math.pow(1 + reconnectionBackoffRate, Math.min(this.reconnectAttempts, 10))\n const jitterMax = this.reconnectAttempts === 0 ? 1.0 : reconnectionBackoffRate\n const jitter = jitterMax * Math.random()\n return staleThreshold * 1000 * backoff * (1 + jitter)\n }\n\n reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${secondsSince(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`)\n this.reconnectAttempts++\n if (this.disconnectedRecently()) {\n logger.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${secondsSince(this.disconnectedAt)} s`)\n } else {\n logger.log(\"ConnectionMonitor reopening\")\n this.connection.reopen()\n }\n }\n }\n\n get refreshedAt() {\n return this.pingedAt ? this.pingedAt : this.startedAt\n }\n\n connectionIsStale() {\n return secondsSince(this.refreshedAt) > this.constructor.staleThreshold\n }\n\n disconnectedRecently() {\n return this.disconnectedAt && (secondsSince(this.disconnectedAt) < this.constructor.staleThreshold)\n }\n\n visibilityDidChange() {\n if (document.visibilityState === \"visible\") {\n setTimeout(() => {\n if (this.connectionIsStale() || !this.connection.isOpen()) {\n logger.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`)\n this.connection.reopen()\n }\n }\n , 200)\n }\n }\n\n}\n\nConnectionMonitor.staleThreshold = 6 // Server::Connections::BEAT_INTERVAL * 2 (missed two pings)\nConnectionMonitor.reconnectionBackoffRate = 0.15\n\nexport default ConnectionMonitor\n", "export default {\n \"message_types\": {\n \"welcome\": \"welcome\",\n \"disconnect\": \"disconnect\",\n \"ping\": \"ping\",\n \"confirmation\": \"confirm_subscription\",\n \"rejection\": \"reject_subscription\"\n },\n \"disconnect_reasons\": {\n \"unauthorized\": \"unauthorized\",\n \"invalid_request\": \"invalid_request\",\n \"server_restart\": \"server_restart\"\n },\n \"default_mount_path\": \"/cable\",\n \"protocols\": [\n \"actioncable-v1-json\",\n \"actioncable-unsupported\"\n ]\n}\n", "import adapters from \"./adapters\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport INTERNAL from \"./internal\"\nimport logger from \"./logger\"\n\n// Encapsulate the cable connection held by the consumer. This is an internal class not intended for direct user manipulation.\n\nconst {message_types, protocols} = INTERNAL\nconst supportedProtocols = protocols.slice(0, protocols.length - 1)\n\nconst indexOf = [].indexOf\n\nclass Connection {\n constructor(consumer) {\n this.open = this.open.bind(this)\n this.consumer = consumer\n this.subscriptions = this.consumer.subscriptions\n this.monitor = new ConnectionMonitor(this)\n this.disconnected = true\n }\n\n send(data) {\n if (this.isOpen()) {\n this.webSocket.send(JSON.stringify(data))\n return true\n } else {\n return false\n }\n }\n\n open() {\n if (this.isActive()) {\n logger.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`)\n return false\n } else {\n logger.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${protocols}`)\n if (this.webSocket) { this.uninstallEventHandlers() }\n this.webSocket = new adapters.WebSocket(this.consumer.url, protocols)\n this.installEventHandlers()\n this.monitor.start()\n return true\n }\n }\n\n close({allowReconnect} = {allowReconnect: true}) {\n if (!allowReconnect) { this.monitor.stop() }\n if (this.isActive()) {\n return this.webSocket.close()\n }\n }\n\n reopen() {\n logger.log(`Reopening WebSocket, current state is ${this.getState()}`)\n if (this.isActive()) {\n try {\n return this.close()\n } catch (error) {\n logger.log(\"Failed to reopen WebSocket\", error)\n }\n finally {\n logger.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`)\n setTimeout(this.open, this.constructor.reopenDelay)\n }\n } else {\n return this.open()\n }\n }\n\n getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol\n }\n }\n\n isOpen() {\n return this.isState(\"open\")\n }\n\n isActive() {\n return this.isState(\"open\", \"connecting\")\n }\n\n // Private\n\n isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0\n }\n\n isState(...states) {\n return indexOf.call(states, this.getState()) >= 0\n }\n\n getState() {\n if (this.webSocket) {\n for (let state in adapters.WebSocket) {\n if (adapters.WebSocket[state] === this.webSocket.readyState) {\n return state.toLowerCase()\n }\n }\n }\n return null\n }\n\n installEventHandlers() {\n for (let eventName in this.events) {\n const handler = this.events[eventName].bind(this)\n this.webSocket[`on${eventName}`] = handler\n }\n }\n\n uninstallEventHandlers() {\n for (let eventName in this.events) {\n this.webSocket[`on${eventName}`] = function() {}\n }\n }\n\n}\n\nConnection.reopenDelay = 500\n\nConnection.prototype.events = {\n message(event) {\n if (!this.isProtocolSupported()) { return }\n const {identifier, message, reason, reconnect, type} = JSON.parse(event.data)\n switch (type) {\n case message_types.welcome:\n this.monitor.recordConnect()\n return this.subscriptions.reload()\n case message_types.disconnect:\n logger.log(`Disconnecting. Reason: ${reason}`)\n return this.close({allowReconnect: reconnect})\n case message_types.ping:\n return this.monitor.recordPing()\n case message_types.confirmation:\n this.subscriptions.confirmSubscription(identifier)\n return this.subscriptions.notify(identifier, \"connected\")\n case message_types.rejection:\n return this.subscriptions.reject(identifier)\n default:\n return this.subscriptions.notify(identifier, \"received\", message)\n }\n },\n\n open() {\n logger.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`)\n this.disconnected = false\n if (!this.isProtocolSupported()) {\n logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\")\n return this.close({allowReconnect: false})\n }\n },\n\n close(event) {\n logger.log(\"WebSocket onclose event\")\n if (this.disconnected) { return }\n this.disconnected = true\n this.monitor.recordDisconnect()\n return this.subscriptions.notifyAll(\"disconnected\", {willAttemptReconnect: this.monitor.isRunning()})\n },\n\n error() {\n logger.log(\"WebSocket onerror event\")\n }\n}\n\nexport default Connection\n", "// A new subscription is created through the ActionCable.Subscriptions instance available on the consumer.\n// It provides a number of callbacks and a method for calling remote procedure calls on the corresponding\n// Channel instance on the server side.\n//\n// An example demonstrates the basic functionality:\n//\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\", {\n// connected() {\n// // Called once the subscription has been successfully completed\n// },\n//\n// disconnected({ willAttemptReconnect: boolean }) {\n// // Called when the client has disconnected with the server.\n// // The object will have an `willAttemptReconnect` property which\n// // says whether the client has the intention of attempting\n// // to reconnect.\n// },\n//\n// appear() {\n// this.perform('appear', {appearing_on: this.appearingOn()})\n// },\n//\n// away() {\n// this.perform('away')\n// },\n//\n// appearingOn() {\n// $('main').data('appearing-on')\n// }\n// })\n//\n// The methods #appear and #away forward their intent to the remote AppearanceChannel instance on the server\n// by calling the `perform` method with the first parameter being the action (which maps to AppearanceChannel#appear/away).\n// The second parameter is a hash that'll get JSON encoded and made available on the server in the data parameter.\n//\n// This is how the server component would look:\n//\n// class AppearanceChannel < ApplicationActionCable::Channel\n// def subscribed\n// current_user.appear\n// end\n//\n// def unsubscribed\n// current_user.disappear\n// end\n//\n// def appear(data)\n// current_user.appear on: data['appearing_on']\n// end\n//\n// def away\n// current_user.away\n// end\n// end\n//\n// The \"AppearanceChannel\" name is automatically mapped between the client-side subscription creation and the server-side Ruby class name.\n// The AppearanceChannel#appear/away public methods are exposed automatically to client-side invocation through the perform method.\n\nconst extend = function(object, properties) {\n if (properties != null) {\n for (let key in properties) {\n const value = properties[key]\n object[key] = value\n }\n }\n return object\n}\n\nexport default class Subscription {\n constructor(consumer, params = {}, mixin) {\n this.consumer = consumer\n this.identifier = JSON.stringify(params)\n extend(this, mixin)\n }\n\n // Perform a channel action with the optional data passed as an attribute\n perform(action, data = {}) {\n data.action = action\n return this.send(data)\n }\n\n send(data) {\n return this.consumer.send({command: \"message\", identifier: this.identifier, data: JSON.stringify(data)})\n }\n\n unsubscribe() {\n return this.consumer.subscriptions.remove(this)\n }\n}\n", "import logger from \"./logger\"\n\n// Responsible for ensuring channel subscribe command is confirmed, retrying until confirmation is received.\n// Internal class, not intended for direct user manipulation.\n\nclass SubscriptionGuarantor {\n constructor(subscriptions) {\n this.subscriptions = subscriptions\n this.pendingSubscriptions = []\n }\n\n guarantee(subscription) {\n if(this.pendingSubscriptions.indexOf(subscription) == -1){ \n logger.log(`SubscriptionGuarantor guaranteeing ${subscription.identifier}`)\n this.pendingSubscriptions.push(subscription) \n }\n else {\n logger.log(`SubscriptionGuarantor already guaranteeing ${subscription.identifier}`)\n }\n this.startGuaranteeing()\n }\n\n forget(subscription) {\n logger.log(`SubscriptionGuarantor forgetting ${subscription.identifier}`)\n this.pendingSubscriptions = (this.pendingSubscriptions.filter((s) => s !== subscription))\n }\n\n startGuaranteeing() {\n this.stopGuaranteeing()\n this.retrySubscribing()\n }\n \n stopGuaranteeing() {\n clearTimeout(this.retryTimeout)\n }\n\n retrySubscribing() {\n this.retryTimeout = setTimeout(() => {\n if (this.subscriptions && typeof(this.subscriptions.subscribe) === \"function\") {\n this.pendingSubscriptions.map((subscription) => {\n logger.log(`SubscriptionGuarantor resubscribing ${subscription.identifier}`)\n this.subscriptions.subscribe(subscription)\n })\n }\n }\n , 500)\n }\n}\n\nexport default SubscriptionGuarantor", "import Subscription from \"./subscription\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport logger from \"./logger\"\n\n// Collection class for creating (and internally managing) channel subscriptions.\n// The only method intended to be triggered by the user is ActionCable.Subscriptions#create,\n// and it should be called through the consumer like so:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n\nexport default class Subscriptions {\n constructor(consumer) {\n this.consumer = consumer\n this.guarantor = new SubscriptionGuarantor(this)\n this.subscriptions = []\n }\n\n create(channelName, mixin) {\n const channel = channelName\n const params = typeof channel === \"object\" ? channel : {channel}\n const subscription = new Subscription(this.consumer, params, mixin)\n return this.add(subscription)\n }\n\n // Private\n\n add(subscription) {\n this.subscriptions.push(subscription)\n this.consumer.ensureActiveConnection()\n this.notify(subscription, \"initialized\")\n this.subscribe(subscription)\n return subscription\n }\n\n remove(subscription) {\n this.forget(subscription)\n if (!this.findAll(subscription.identifier).length) {\n this.sendCommand(subscription, \"unsubscribe\")\n }\n return subscription\n }\n\n reject(identifier) {\n return this.findAll(identifier).map((subscription) => {\n this.forget(subscription)\n this.notify(subscription, \"rejected\")\n return subscription\n })\n }\n\n forget(subscription) {\n this.guarantor.forget(subscription)\n this.subscriptions = (this.subscriptions.filter((s) => s !== subscription))\n return subscription\n }\n\n findAll(identifier) {\n return this.subscriptions.filter((s) => s.identifier === identifier)\n }\n\n reload() {\n return this.subscriptions.map((subscription) =>\n this.subscribe(subscription))\n }\n\n notifyAll(callbackName, ...args) {\n return this.subscriptions.map((subscription) =>\n this.notify(subscription, callbackName, ...args))\n }\n\n notify(subscription, callbackName, ...args) {\n let subscriptions\n if (typeof subscription === \"string\") {\n subscriptions = this.findAll(subscription)\n } else {\n subscriptions = [subscription]\n }\n\n return subscriptions.map((subscription) =>\n (typeof subscription[callbackName] === \"function\" ? subscription[callbackName](...args) : undefined))\n }\n\n subscribe(subscription) {\n if (this.sendCommand(subscription, \"subscribe\")) {\n this.guarantor.guarantee(subscription)\n }\n }\n\n confirmSubscription(identifier) {\n logger.log(`Subscription confirmed ${identifier}`)\n this.findAll(identifier).map((subscription) =>\n this.guarantor.forget(subscription))\n }\n\n sendCommand(subscription, command) {\n const {identifier} = subscription\n return this.consumer.send({command, identifier})\n }\n}\n", "import Connection from \"./connection\"\nimport Subscriptions from \"./subscriptions\"\n\n// The ActionCable.Consumer establishes the connection to a server-side Ruby Connection object. Once established,\n// the ActionCable.ConnectionMonitor will ensure that its properly maintained through heartbeats and checking for stale updates.\n// The Consumer instance is also the gateway to establishing subscriptions to desired channels through the #createSubscription\n// method.\n//\n// The following example shows how this can be set up:\n//\n// App = {}\n// App.cable = ActionCable.createConsumer(\"ws://example.com/accounts/1\")\n// App.appearance = App.cable.subscriptions.create(\"AppearanceChannel\")\n//\n// For more details on how you'd configure an actual channel subscription, see ActionCable.Subscription.\n//\n// When a consumer is created, it automatically connects with the server.\n//\n// To disconnect from the server, call\n//\n// App.cable.disconnect()\n//\n// and to restart the connection:\n//\n// App.cable.connect()\n//\n// Any channel subscriptions which existed prior to disconnecting will\n// automatically resubscribe.\n\nexport default class Consumer {\n constructor(url) {\n this._url = url\n this.subscriptions = new Subscriptions(this)\n this.connection = new Connection(this)\n }\n\n get url() {\n return createWebSocketURL(this._url)\n }\n\n send(data) {\n return this.connection.send(data)\n }\n\n connect() {\n return this.connection.open()\n }\n\n disconnect() {\n return this.connection.close({allowReconnect: false})\n }\n\n ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open()\n }\n }\n}\n\nexport function createWebSocketURL(url) {\n if (typeof url === \"function\") {\n url = url()\n }\n\n if (url && !/^wss?:/i.test(url)) {\n const a = document.createElement(\"a\")\n a.href = url\n // Fix populating Location properties in IE. Otherwise, protocol will be blank.\n a.href = a.href\n a.protocol = a.protocol.replace(\"http\", \"ws\")\n return a.href\n } else {\n return url\n }\n}\n", "import Connection from \"./connection\"\nimport ConnectionMonitor from \"./connection_monitor\"\nimport Consumer, { createWebSocketURL } from \"./consumer\"\nimport INTERNAL from \"./internal\"\nimport Subscription from \"./subscription\"\nimport Subscriptions from \"./subscriptions\"\nimport SubscriptionGuarantor from \"./subscription_guarantor\"\nimport adapters from \"./adapters\"\nimport logger from \"./logger\"\n\nexport {\n Connection,\n ConnectionMonitor,\n Consumer,\n INTERNAL,\n Subscription,\n Subscriptions,\n SubscriptionGuarantor,\n adapters,\n createWebSocketURL,\n logger,\n}\n\nexport function createConsumer(url = getConfig(\"url\") || INTERNAL.default_mount_path) {\n return new Consumer(url)\n}\n\nexport function getConfig(name) {\n const element = document.head.querySelector(`meta[name='action-cable-${name}']`)\n if (element) {\n return element.getAttribute(\"content\")\n }\n}\n", "(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.de = {}));\n}(this, (function (exports) { 'use strict';\n\n var fp = typeof window !== \"undefined\" && window.flatpickr !== undefined\n ? window.flatpickr\n : {\n l10ns: {},\n };\n var German = {\n weekdays: {\n shorthand: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"],\n longhand: [\n \"Sonntag\",\n \"Montag\",\n \"Dienstag\",\n \"Mittwoch\",\n \"Donnerstag\",\n \"Freitag\",\n \"Samstag\",\n ],\n },\n months: {\n shorthand: [\n \"Jan\",\n \"Feb\",\n \"M\u00E4r\",\n \"Apr\",\n \"Mai\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Okt\",\n \"Nov\",\n \"Dez\",\n ],\n longhand: [\n \"Januar\",\n \"Februar\",\n \"M\u00E4rz\",\n \"April\",\n \"Mai\",\n \"Juni\",\n \"Juli\",\n \"August\",\n \"September\",\n \"Oktober\",\n \"November\",\n \"Dezember\",\n ],\n },\n firstDayOfWeek: 1,\n weekAbbreviation: \"KW\",\n rangeSeparator: \" bis \",\n scrollTitle: \"Zum \u00C4ndern scrollen\",\n toggleTitle: \"Zum Umschalten klicken\",\n time_24hr: true,\n };\n fp.l10ns.de = German;\n var de = fp.l10ns;\n\n exports.German = German;\n exports.default = de;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n", "/*!\n * headroom.js v0.12.0 - Give your page some headroom. Hide your header until you need it\n * Copyright (c) 2020 Nick Williams - http://wicky.nillia.ms/headroom.js\n * License: MIT\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.Headroom = factory());\n}(this, function () { 'use strict';\n\n function isBrowser() {\n return typeof window !== \"undefined\";\n }\n\n /**\n * Used to detect browser support for adding an event listener with options\n * Credit: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n */\n function passiveEventsSupported() {\n var supported = false;\n\n try {\n var options = {\n // eslint-disable-next-line getter-return\n get passive() {\n supported = true;\n }\n };\n window.addEventListener(\"test\", options, options);\n window.removeEventListener(\"test\", options, options);\n } catch (err) {\n supported = false;\n }\n\n return supported;\n }\n\n function isSupported() {\n return !!(\n isBrowser() &&\n function() {}.bind &&\n \"classList\" in document.documentElement &&\n Object.assign &&\n Object.keys &&\n requestAnimationFrame\n );\n }\n\n function isDocument(obj) {\n return obj.nodeType === 9; // Node.DOCUMENT_NODE === 9\n }\n\n function isWindow(obj) {\n // `obj === window` or `obj instanceof Window` is not sufficient,\n // as the obj may be the window of an iframe.\n return obj && obj.document && isDocument(obj.document);\n }\n\n function windowScroller(win) {\n var doc = win.document;\n var body = doc.body;\n var html = doc.documentElement;\n\n return {\n /**\n * @see http://james.padolsey.com/javascript/get-document-height-cross-browser/\n * @return {Number} the scroll height of the document in pixels\n */\n scrollHeight: function() {\n return Math.max(\n body.scrollHeight,\n html.scrollHeight,\n body.offsetHeight,\n html.offsetHeight,\n body.clientHeight,\n html.clientHeight\n );\n },\n\n /**\n * @see http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript\n * @return {Number} the height of the viewport in pixels\n */\n height: function() {\n return win.innerHeight || html.clientHeight || body.clientHeight;\n },\n\n /**\n * Gets the Y scroll position\n * @return {Number} pixels the page has scrolled along the Y-axis\n */\n scrollY: function() {\n if (win.pageYOffset !== undefined) {\n return win.pageYOffset;\n }\n\n return (html || body.parentNode || body).scrollTop;\n }\n };\n }\n\n function elementScroller(element) {\n return {\n /**\n * @return {Number} the scroll height of the element in pixels\n */\n scrollHeight: function() {\n return Math.max(\n element.scrollHeight,\n element.offsetHeight,\n element.clientHeight\n );\n },\n\n /**\n * @return {Number} the height of the element in pixels\n */\n height: function() {\n return Math.max(element.offsetHeight, element.clientHeight);\n },\n\n /**\n * Gets the Y scroll position\n * @return {Number} pixels the element has scrolled along the Y-axis\n */\n scrollY: function() {\n return element.scrollTop;\n }\n };\n }\n\n function createScroller(element) {\n return isWindow(element) ? windowScroller(element) : elementScroller(element);\n }\n\n /**\n * @param element EventTarget\n */\n function trackScroll(element, options, callback) {\n var isPassiveSupported = passiveEventsSupported();\n var rafId;\n var scrolled = false;\n var scroller = createScroller(element);\n var lastScrollY = scroller.scrollY();\n var details = {};\n\n function update() {\n var scrollY = Math.round(scroller.scrollY());\n var height = scroller.height();\n var scrollHeight = scroller.scrollHeight();\n\n // reuse object for less memory churn\n details.scrollY = scrollY;\n details.lastScrollY = lastScrollY;\n details.direction = scrollY > lastScrollY ? \"down\" : \"up\";\n details.distance = Math.abs(scrollY - lastScrollY);\n details.isOutOfBounds = scrollY < 0 || scrollY + height > scrollHeight;\n details.top = scrollY <= options.offset[details.direction];\n details.bottom = scrollY + height >= scrollHeight;\n details.toleranceExceeded =\n details.distance > options.tolerance[details.direction];\n\n callback(details);\n\n lastScrollY = scrollY;\n scrolled = false;\n }\n\n function handleScroll() {\n if (!scrolled) {\n scrolled = true;\n rafId = requestAnimationFrame(update);\n }\n }\n\n var eventOptions = isPassiveSupported\n ? { passive: true, capture: false }\n : false;\n\n element.addEventListener(\"scroll\", handleScroll, eventOptions);\n update();\n\n return {\n destroy: function() {\n cancelAnimationFrame(rafId);\n element.removeEventListener(\"scroll\", handleScroll, eventOptions);\n }\n };\n }\n\n function normalizeUpDown(t) {\n return t === Object(t) ? t : { down: t, up: t };\n }\n\n /**\n * UI enhancement for fixed headers.\n * Hides header when scrolling down\n * Shows header when scrolling up\n * @constructor\n * @param {DOMElement} elem the header element\n * @param {Object} options options for the widget\n */\n function Headroom(elem, options) {\n options = options || {};\n Object.assign(this, Headroom.options, options);\n this.classes = Object.assign({}, Headroom.options.classes, options.classes);\n\n this.elem = elem;\n this.tolerance = normalizeUpDown(this.tolerance);\n this.offset = normalizeUpDown(this.offset);\n this.initialised = false;\n this.frozen = false;\n }\n Headroom.prototype = {\n constructor: Headroom,\n\n /**\n * Start listening to scrolling\n * @public\n */\n init: function() {\n if (Headroom.cutsTheMustard && !this.initialised) {\n this.addClass(\"initial\");\n this.initialised = true;\n\n // defer event registration to handle browser\n // potentially restoring previous scroll position\n setTimeout(\n function(self) {\n self.scrollTracker = trackScroll(\n self.scroller,\n { offset: self.offset, tolerance: self.tolerance },\n self.update.bind(self)\n );\n },\n 100,\n this\n );\n }\n\n return this;\n },\n\n /**\n * Destroy the widget, clearing up after itself\n * @public\n */\n destroy: function() {\n this.initialised = false;\n Object.keys(this.classes).forEach(this.removeClass, this);\n this.scrollTracker.destroy();\n },\n\n /**\n * Unpin the element\n * @public\n */\n unpin: function() {\n if (this.hasClass(\"pinned\") || !this.hasClass(\"unpinned\")) {\n this.addClass(\"unpinned\");\n this.removeClass(\"pinned\");\n\n if (this.onUnpin) {\n this.onUnpin.call(this);\n }\n }\n },\n\n /**\n * Pin the element\n * @public\n */\n pin: function() {\n if (this.hasClass(\"unpinned\")) {\n this.addClass(\"pinned\");\n this.removeClass(\"unpinned\");\n\n if (this.onPin) {\n this.onPin.call(this);\n }\n }\n },\n\n /**\n * Freezes the current state of the widget\n * @public\n */\n freeze: function() {\n this.frozen = true;\n this.addClass(\"frozen\");\n },\n\n /**\n * Re-enables the default behaviour of the widget\n * @public\n */\n unfreeze: function() {\n this.frozen = false;\n this.removeClass(\"frozen\");\n },\n\n top: function() {\n if (!this.hasClass(\"top\")) {\n this.addClass(\"top\");\n this.removeClass(\"notTop\");\n\n if (this.onTop) {\n this.onTop.call(this);\n }\n }\n },\n\n notTop: function() {\n if (!this.hasClass(\"notTop\")) {\n this.addClass(\"notTop\");\n this.removeClass(\"top\");\n\n if (this.onNotTop) {\n this.onNotTop.call(this);\n }\n }\n },\n\n bottom: function() {\n if (!this.hasClass(\"bottom\")) {\n this.addClass(\"bottom\");\n this.removeClass(\"notBottom\");\n\n if (this.onBottom) {\n this.onBottom.call(this);\n }\n }\n },\n\n notBottom: function() {\n if (!this.hasClass(\"notBottom\")) {\n this.addClass(\"notBottom\");\n this.removeClass(\"bottom\");\n\n if (this.onNotBottom) {\n this.onNotBottom.call(this);\n }\n }\n },\n\n shouldUnpin: function(details) {\n var scrollingDown = details.direction === \"down\";\n\n return scrollingDown && !details.top && details.toleranceExceeded;\n },\n\n shouldPin: function(details) {\n var scrollingUp = details.direction === \"up\";\n\n return (scrollingUp && details.toleranceExceeded) || details.top;\n },\n\n addClass: function(className) {\n this.elem.classList.add.apply(\n this.elem.classList,\n this.classes[className].split(\" \")\n );\n },\n\n removeClass: function(className) {\n this.elem.classList.remove.apply(\n this.elem.classList,\n this.classes[className].split(\" \")\n );\n },\n\n hasClass: function(className) {\n return this.classes[className].split(\" \").every(function(cls) {\n return this.classList.contains(cls);\n }, this.elem);\n },\n\n update: function(details) {\n if (details.isOutOfBounds) {\n // Ignore bouncy scrolling in OSX\n return;\n }\n\n if (this.frozen === true) {\n return;\n }\n\n if (details.top) {\n this.top();\n } else {\n this.notTop();\n }\n\n if (details.bottom) {\n this.bottom();\n } else {\n this.notBottom();\n }\n\n if (this.shouldUnpin(details)) {\n this.unpin();\n } else if (this.shouldPin(details)) {\n this.pin();\n }\n }\n };\n\n /**\n * Default options\n * @type {Object}\n */\n Headroom.options = {\n tolerance: {\n up: 0,\n down: 0\n },\n offset: 0,\n scroller: isBrowser() ? window : null,\n classes: {\n frozen: \"headroom--frozen\",\n pinned: \"headroom--pinned\",\n unpinned: \"headroom--unpinned\",\n top: \"headroom--top\",\n notTop: \"headroom--not-top\",\n bottom: \"headroom--bottom\",\n notBottom: \"headroom--not-bottom\",\n initial: \"headroom\"\n }\n };\n\n Headroom.cutsTheMustard = isSupported();\n\n return Headroom;\n\n}));\n", "(function(global, factory) {\n typeof exports === \"object\" && typeof module !== \"undefined\" ? factory(exports) : typeof define === \"function\" && define.amd ? define([ \"exports\" ], factory) : factory(global.ActionCable = {});\n})(this, function(exports) {\n \"use strict\";\n var adapters = {\n logger: self.console,\n WebSocket: self.WebSocket\n };\n var logger = {\n log: function log() {\n if (this.enabled) {\n var _adapters$logger;\n for (var _len = arguments.length, messages = Array(_len), _key = 0; _key < _len; _key++) {\n messages[_key] = arguments[_key];\n }\n messages.push(Date.now());\n (_adapters$logger = adapters.logger).log.apply(_adapters$logger, [ \"[ActionCable]\" ].concat(messages));\n }\n }\n };\n var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function(obj) {\n return typeof obj;\n } : function(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n var classCallCheck = function(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n var createClass = function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function(Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n var now = function now() {\n return new Date().getTime();\n };\n var secondsSince = function secondsSince(time) {\n return (now() - time) / 1e3;\n };\n var clamp = function clamp(number, min, max) {\n return Math.max(min, Math.min(max, number));\n };\n var ConnectionMonitor = function() {\n function ConnectionMonitor(connection) {\n classCallCheck(this, ConnectionMonitor);\n this.visibilityDidChange = this.visibilityDidChange.bind(this);\n this.connection = connection;\n this.reconnectAttempts = 0;\n }\n ConnectionMonitor.prototype.start = function start() {\n if (!this.isRunning()) {\n this.startedAt = now();\n delete this.stoppedAt;\n this.startPolling();\n addEventListener(\"visibilitychange\", this.visibilityDidChange);\n logger.log(\"ConnectionMonitor started. pollInterval = \" + this.getPollInterval() + \" ms\");\n }\n };\n ConnectionMonitor.prototype.stop = function stop() {\n if (this.isRunning()) {\n this.stoppedAt = now();\n this.stopPolling();\n removeEventListener(\"visibilitychange\", this.visibilityDidChange);\n logger.log(\"ConnectionMonitor stopped\");\n }\n };\n ConnectionMonitor.prototype.isRunning = function isRunning() {\n return this.startedAt && !this.stoppedAt;\n };\n ConnectionMonitor.prototype.recordPing = function recordPing() {\n this.pingedAt = now();\n };\n ConnectionMonitor.prototype.recordConnect = function recordConnect() {\n this.reconnectAttempts = 0;\n this.recordPing();\n delete this.disconnectedAt;\n logger.log(\"ConnectionMonitor recorded connect\");\n };\n ConnectionMonitor.prototype.recordDisconnect = function recordDisconnect() {\n this.disconnectedAt = now();\n logger.log(\"ConnectionMonitor recorded disconnect\");\n };\n ConnectionMonitor.prototype.startPolling = function startPolling() {\n this.stopPolling();\n this.poll();\n };\n ConnectionMonitor.prototype.stopPolling = function stopPolling() {\n clearTimeout(this.pollTimeout);\n };\n ConnectionMonitor.prototype.poll = function poll() {\n var _this = this;\n this.pollTimeout = setTimeout(function() {\n _this.reconnectIfStale();\n _this.poll();\n }, this.getPollInterval());\n };\n ConnectionMonitor.prototype.getPollInterval = function getPollInterval() {\n var _constructor$pollInte = this.constructor.pollInterval, min = _constructor$pollInte.min, max = _constructor$pollInte.max, multiplier = _constructor$pollInte.multiplier;\n var interval = multiplier * Math.log(this.reconnectAttempts + 1);\n return Math.round(clamp(interval, min, max) * 1e3);\n };\n ConnectionMonitor.prototype.reconnectIfStale = function reconnectIfStale() {\n if (this.connectionIsStale()) {\n logger.log(\"ConnectionMonitor detected stale connection. reconnectAttempts = \" + this.reconnectAttempts + \", pollInterval = \" + this.getPollInterval() + \" ms, time disconnected = \" + secondsSince(this.disconnectedAt) + \" s, stale threshold = \" + this.constructor.staleThreshold + \" s\");\n this.reconnectAttempts++;\n if (this.disconnectedRecently()) {\n logger.log(\"ConnectionMonitor skipping reopening recent disconnect\");\n } else {\n logger.log(\"ConnectionMonitor reopening\");\n this.connection.reopen();\n }\n }\n };\n ConnectionMonitor.prototype.connectionIsStale = function connectionIsStale() {\n return secondsSince(this.pingedAt ? this.pingedAt : this.startedAt) > this.constructor.staleThreshold;\n };\n ConnectionMonitor.prototype.disconnectedRecently = function disconnectedRecently() {\n return this.disconnectedAt && secondsSince(this.disconnectedAt) < this.constructor.staleThreshold;\n };\n ConnectionMonitor.prototype.visibilityDidChange = function visibilityDidChange() {\n var _this2 = this;\n if (document.visibilityState === \"visible\") {\n setTimeout(function() {\n if (_this2.connectionIsStale() || !_this2.connection.isOpen()) {\n logger.log(\"ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = \" + document.visibilityState);\n _this2.connection.reopen();\n }\n }, 200);\n }\n };\n return ConnectionMonitor;\n }();\n ConnectionMonitor.pollInterval = {\n min: 3,\n max: 30,\n multiplier: 5\n };\n ConnectionMonitor.staleThreshold = 6;\n var INTERNAL = {\n message_types: {\n welcome: \"welcome\",\n disconnect: \"disconnect\",\n ping: \"ping\",\n confirmation: \"confirm_subscription\",\n rejection: \"reject_subscription\"\n },\n disconnect_reasons: {\n unauthorized: \"unauthorized\",\n invalid_request: \"invalid_request\",\n server_restart: \"server_restart\"\n },\n default_mount_path: \"/cable\",\n protocols: [ \"actioncable-v1-json\", \"actioncable-unsupported\" ]\n };\n var message_types = INTERNAL.message_types, protocols = INTERNAL.protocols;\n var supportedProtocols = protocols.slice(0, protocols.length - 1);\n var indexOf = [].indexOf;\n var Connection = function() {\n function Connection(consumer) {\n classCallCheck(this, Connection);\n this.open = this.open.bind(this);\n this.consumer = consumer;\n this.subscriptions = this.consumer.subscriptions;\n this.monitor = new ConnectionMonitor(this);\n this.disconnected = true;\n }\n Connection.prototype.send = function send(data) {\n if (this.isOpen()) {\n this.webSocket.send(JSON.stringify(data));\n return true;\n } else {\n return false;\n }\n };\n Connection.prototype.open = function open() {\n if (this.isActive()) {\n logger.log(\"Attempted to open WebSocket, but existing socket is \" + this.getState());\n return false;\n } else {\n logger.log(\"Opening WebSocket, current state is \" + this.getState() + \", subprotocols: \" + protocols);\n if (this.webSocket) {\n this.uninstallEventHandlers();\n }\n this.webSocket = new adapters.WebSocket(this.consumer.url, protocols);\n this.installEventHandlers();\n this.monitor.start();\n return true;\n }\n };\n Connection.prototype.close = function close() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n allowReconnect: true\n }, allowReconnect = _ref.allowReconnect;\n if (!allowReconnect) {\n this.monitor.stop();\n }\n if (this.isActive()) {\n return this.webSocket.close();\n }\n };\n Connection.prototype.reopen = function reopen() {\n logger.log(\"Reopening WebSocket, current state is \" + this.getState());\n if (this.isActive()) {\n try {\n return this.close();\n } catch (error) {\n logger.log(\"Failed to reopen WebSocket\", error);\n } finally {\n logger.log(\"Reopening WebSocket in \" + this.constructor.reopenDelay + \"ms\");\n setTimeout(this.open, this.constructor.reopenDelay);\n }\n } else {\n return this.open();\n }\n };\n Connection.prototype.getProtocol = function getProtocol() {\n if (this.webSocket) {\n return this.webSocket.protocol;\n }\n };\n Connection.prototype.isOpen = function isOpen() {\n return this.isState(\"open\");\n };\n Connection.prototype.isActive = function isActive() {\n return this.isState(\"open\", \"connecting\");\n };\n Connection.prototype.isProtocolSupported = function isProtocolSupported() {\n return indexOf.call(supportedProtocols, this.getProtocol()) >= 0;\n };\n Connection.prototype.isState = function isState() {\n for (var _len = arguments.length, states = Array(_len), _key = 0; _key < _len; _key++) {\n states[_key] = arguments[_key];\n }\n return indexOf.call(states, this.getState()) >= 0;\n };\n Connection.prototype.getState = function getState() {\n if (this.webSocket) {\n for (var state in adapters.WebSocket) {\n if (adapters.WebSocket[state] === this.webSocket.readyState) {\n return state.toLowerCase();\n }\n }\n }\n return null;\n };\n Connection.prototype.installEventHandlers = function installEventHandlers() {\n for (var eventName in this.events) {\n var handler = this.events[eventName].bind(this);\n this.webSocket[\"on\" + eventName] = handler;\n }\n };\n Connection.prototype.uninstallEventHandlers = function uninstallEventHandlers() {\n for (var eventName in this.events) {\n this.webSocket[\"on\" + eventName] = function() {};\n }\n };\n return Connection;\n }();\n Connection.reopenDelay = 500;\n Connection.prototype.events = {\n message: function message(event) {\n if (!this.isProtocolSupported()) {\n return;\n }\n var _JSON$parse = JSON.parse(event.data), identifier = _JSON$parse.identifier, message = _JSON$parse.message, reason = _JSON$parse.reason, reconnect = _JSON$parse.reconnect, type = _JSON$parse.type;\n switch (type) {\n case message_types.welcome:\n this.monitor.recordConnect();\n return this.subscriptions.reload();\n\n case message_types.disconnect:\n logger.log(\"Disconnecting. Reason: \" + reason);\n return this.close({\n allowReconnect: reconnect\n });\n\n case message_types.ping:\n return this.monitor.recordPing();\n\n case message_types.confirmation:\n this.subscriptions.confirmSubscription(identifier);\n return this.subscriptions.notify(identifier, \"connected\");\n\n case message_types.rejection:\n return this.subscriptions.reject(identifier);\n\n default:\n return this.subscriptions.notify(identifier, \"received\", message);\n }\n },\n open: function open() {\n logger.log(\"WebSocket onopen event, using '\" + this.getProtocol() + \"' subprotocol\");\n this.disconnected = false;\n if (!this.isProtocolSupported()) {\n logger.log(\"Protocol is unsupported. Stopping monitor and disconnecting.\");\n return this.close({\n allowReconnect: false\n });\n }\n },\n close: function close(event) {\n logger.log(\"WebSocket onclose event\");\n if (this.disconnected) {\n return;\n }\n this.disconnected = true;\n this.monitor.recordDisconnect();\n return this.subscriptions.notifyAll(\"disconnected\", {\n willAttemptReconnect: this.monitor.isRunning()\n });\n },\n error: function error() {\n logger.log(\"WebSocket onerror event\");\n }\n };\n var extend = function extend(object, properties) {\n if (properties != null) {\n for (var key in properties) {\n var value = properties[key];\n object[key] = value;\n }\n }\n return object;\n };\n var Subscription = function() {\n function Subscription(consumer) {\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var mixin = arguments[2];\n classCallCheck(this, Subscription);\n this.consumer = consumer;\n this.identifier = JSON.stringify(params);\n extend(this, mixin);\n }\n Subscription.prototype.perform = function perform(action) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n data.action = action;\n return this.send(data);\n };\n Subscription.prototype.send = function send(data) {\n return this.consumer.send({\n command: \"message\",\n identifier: this.identifier,\n data: JSON.stringify(data)\n });\n };\n Subscription.prototype.unsubscribe = function unsubscribe() {\n return this.consumer.subscriptions.remove(this);\n };\n return Subscription;\n }();\n var SubscriptionGuarantor = function() {\n function SubscriptionGuarantor(subscriptions) {\n classCallCheck(this, SubscriptionGuarantor);\n this.subscriptions = subscriptions;\n this.pendingSubscriptions = [];\n }\n SubscriptionGuarantor.prototype.guarantee = function guarantee(subscription) {\n if (this.pendingSubscriptions.indexOf(subscription) == -1) {\n logger.log(\"SubscriptionGuarantor guaranteeing \" + subscription.identifier);\n this.pendingSubscriptions.push(subscription);\n } else {\n logger.log(\"SubscriptionGuarantor already guaranteeing \" + subscription.identifier);\n }\n this.startGuaranteeing();\n };\n SubscriptionGuarantor.prototype.forget = function forget(subscription) {\n logger.log(\"SubscriptionGuarantor forgetting \" + subscription.identifier);\n this.pendingSubscriptions = this.pendingSubscriptions.filter(function(s) {\n return s !== subscription;\n });\n };\n SubscriptionGuarantor.prototype.startGuaranteeing = function startGuaranteeing() {\n this.stopGuaranteeing();\n this.retrySubscribing();\n };\n SubscriptionGuarantor.prototype.stopGuaranteeing = function stopGuaranteeing() {\n clearTimeout(this.retryTimeout);\n };\n SubscriptionGuarantor.prototype.retrySubscribing = function retrySubscribing() {\n var _this = this;\n this.retryTimeout = setTimeout(function() {\n if (_this.subscriptions && typeof _this.subscriptions.subscribe === \"function\") {\n _this.pendingSubscriptions.map(function(subscription) {\n logger.log(\"SubscriptionGuarantor resubscribing \" + subscription.identifier);\n _this.subscriptions.subscribe(subscription);\n });\n }\n }, 500);\n };\n return SubscriptionGuarantor;\n }();\n var Subscriptions = function() {\n function Subscriptions(consumer) {\n classCallCheck(this, Subscriptions);\n this.consumer = consumer;\n this.guarantor = new SubscriptionGuarantor(this);\n this.subscriptions = [];\n }\n Subscriptions.prototype.create = function create(channelName, mixin) {\n var channel = channelName;\n var params = (typeof channel === \"undefined\" ? \"undefined\" : _typeof(channel)) === \"object\" ? channel : {\n channel: channel\n };\n var subscription = new Subscription(this.consumer, params, mixin);\n return this.add(subscription);\n };\n Subscriptions.prototype.add = function add(subscription) {\n this.subscriptions.push(subscription);\n this.consumer.ensureActiveConnection();\n this.notify(subscription, \"initialized\");\n this.subscribe(subscription);\n return subscription;\n };\n Subscriptions.prototype.remove = function remove(subscription) {\n this.forget(subscription);\n if (!this.findAll(subscription.identifier).length) {\n this.sendCommand(subscription, \"unsubscribe\");\n }\n return subscription;\n };\n Subscriptions.prototype.reject = function reject(identifier) {\n var _this = this;\n return this.findAll(identifier).map(function(subscription) {\n _this.forget(subscription);\n _this.notify(subscription, \"rejected\");\n return subscription;\n });\n };\n Subscriptions.prototype.forget = function forget(subscription) {\n this.guarantor.forget(subscription);\n this.subscriptions = this.subscriptions.filter(function(s) {\n return s !== subscription;\n });\n return subscription;\n };\n Subscriptions.prototype.findAll = function findAll(identifier) {\n return this.subscriptions.filter(function(s) {\n return s.identifier === identifier;\n });\n };\n Subscriptions.prototype.reload = function reload() {\n var _this2 = this;\n return this.subscriptions.map(function(subscription) {\n return _this2.subscribe(subscription);\n });\n };\n Subscriptions.prototype.notifyAll = function notifyAll(callbackName) {\n var _this3 = this;\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return this.subscriptions.map(function(subscription) {\n return _this3.notify.apply(_this3, [ subscription, callbackName ].concat(args));\n });\n };\n Subscriptions.prototype.notify = function notify(subscription, callbackName) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n var subscriptions = void 0;\n if (typeof subscription === \"string\") {\n subscriptions = this.findAll(subscription);\n } else {\n subscriptions = [ subscription ];\n }\n return subscriptions.map(function(subscription) {\n return typeof subscription[callbackName] === \"function\" ? subscription[callbackName].apply(subscription, args) : undefined;\n });\n };\n Subscriptions.prototype.subscribe = function subscribe(subscription) {\n if (this.sendCommand(subscription, \"subscribe\")) {\n this.guarantor.guarantee(subscription);\n }\n };\n Subscriptions.prototype.confirmSubscription = function confirmSubscription(identifier) {\n var _this4 = this;\n logger.log(\"Subscription confirmed \" + identifier);\n this.findAll(identifier).map(function(subscription) {\n return _this4.guarantor.forget(subscription);\n });\n };\n Subscriptions.prototype.sendCommand = function sendCommand(subscription, command) {\n var identifier = subscription.identifier;\n return this.consumer.send({\n command: command,\n identifier: identifier\n });\n };\n return Subscriptions;\n }();\n var Consumer = function() {\n function Consumer(url) {\n classCallCheck(this, Consumer);\n this._url = url;\n this.subscriptions = new Subscriptions(this);\n this.connection = new Connection(this);\n }\n Consumer.prototype.send = function send(data) {\n return this.connection.send(data);\n };\n Consumer.prototype.connect = function connect() {\n return this.connection.open();\n };\n Consumer.prototype.disconnect = function disconnect() {\n return this.connection.close({\n allowReconnect: false\n });\n };\n Consumer.prototype.ensureActiveConnection = function ensureActiveConnection() {\n if (!this.connection.isActive()) {\n return this.connection.open();\n }\n };\n createClass(Consumer, [ {\n key: \"url\",\n get: function get$$1() {\n return createWebSocketURL(this._url);\n }\n } ]);\n return Consumer;\n }();\n function createWebSocketURL(url) {\n if (typeof url === \"function\") {\n url = url();\n }\n if (url && !/^wss?:/i.test(url)) {\n var a = document.createElement(\"a\");\n a.href = url;\n a.href = a.href;\n a.protocol = a.protocol.replace(\"http\", \"ws\");\n return a.href;\n } else {\n return url;\n }\n }\n function createConsumer() {\n var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getConfig(\"url\") || INTERNAL.default_mount_path;\n return new Consumer(url);\n }\n function getConfig(name) {\n var element = document.head.querySelector(\"meta[name='action-cable-\" + name + \"']\");\n if (element) {\n return element.getAttribute(\"content\");\n }\n }\n exports.Connection = Connection;\n exports.ConnectionMonitor = ConnectionMonitor;\n exports.Consumer = Consumer;\n exports.INTERNAL = INTERNAL;\n exports.Subscription = Subscription;\n exports.Subscriptions = Subscriptions;\n exports.SubscriptionGuarantor = SubscriptionGuarantor;\n exports.adapters = adapters;\n exports.createWebSocketURL = createWebSocketURL;\n exports.logger = logger;\n exports.createConsumer = createConsumer;\n exports.getConfig = getConfig;\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n});\n", "/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/main/actionview/app/assets/javascripts\nReleased under the MIT license\n */;\n\n(function() {\n var context = this;\n\n (function() {\n (function() {\n this.Rails = {\n linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',\n buttonClickSelector: {\n selector: 'button[data-remote]:not([form]), button[data-confirm]:not([form])',\n exclude: 'form button'\n },\n inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',\n formSubmitSelector: 'form:not([data-turbo=true])',\n formInputClickSelector: 'form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',\n formDisableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',\n formEnableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',\n fileInputSelector: 'input[name][type=file]:not([disabled])',\n linkDisableSelector: 'a[data-disable-with], a[data-disable]',\n buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]'\n };\n\n }).call(this);\n }).call(context);\n\n var Rails = context.Rails;\n\n (function() {\n (function() {\n var nonce;\n\n nonce = null;\n\n Rails.loadCSPNonce = function() {\n var ref;\n return nonce = (ref = document.querySelector(\"meta[name=csp-nonce]\")) != null ? ref.content : void 0;\n };\n\n Rails.cspNonce = function() {\n return nonce != null ? nonce : Rails.loadCSPNonce();\n };\n\n }).call(this);\n (function() {\n var expando, m;\n\n m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\n\n Rails.matches = function(element, selector) {\n if (selector.exclude != null) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n };\n\n expando = '_ujsData';\n\n Rails.getData = function(element, key) {\n var ref;\n return (ref = element[expando]) != null ? ref[key] : void 0;\n };\n\n Rails.setData = function(element, key, value) {\n if (element[expando] == null) {\n element[expando] = {};\n }\n return element[expando][key] = value;\n };\n\n Rails.$ = function(selector) {\n return Array.prototype.slice.call(document.querySelectorAll(selector));\n };\n\n }).call(this);\n (function() {\n var $, csrfParam, csrfToken;\n\n $ = Rails.$;\n\n csrfToken = Rails.csrfToken = function() {\n var meta;\n meta = document.querySelector('meta[name=csrf-token]');\n return meta && meta.content;\n };\n\n csrfParam = Rails.csrfParam = function() {\n var meta;\n meta = document.querySelector('meta[name=csrf-param]');\n return meta && meta.content;\n };\n\n Rails.CSRFProtection = function(xhr) {\n var token;\n token = csrfToken();\n if (token != null) {\n return xhr.setRequestHeader('X-CSRF-Token', token);\n }\n };\n\n Rails.refreshCSRFTokens = function() {\n var param, token;\n token = csrfToken();\n param = csrfParam();\n if ((token != null) && (param != null)) {\n return $('form input[name=\"' + param + '\"]').forEach(function(input) {\n return input.value = token;\n });\n }\n };\n\n }).call(this);\n (function() {\n var CustomEvent, fire, matches, preventDefault;\n\n matches = Rails.matches;\n\n CustomEvent = window.CustomEvent;\n\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function(event, params) {\n var evt;\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n CustomEvent.prototype = window.Event.prototype;\n preventDefault = CustomEvent.prototype.preventDefault;\n CustomEvent.prototype.preventDefault = function() {\n var result;\n result = preventDefault.call(this);\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\n }\n });\n }\n return result;\n };\n }\n\n fire = Rails.fire = function(obj, name, data) {\n var event;\n event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n };\n\n Rails.stopEverything = function(e) {\n fire(e.target, 'ujs:everythingStopped');\n e.preventDefault();\n e.stopPropagation();\n return e.stopImmediatePropagation();\n };\n\n Rails.delegate = function(element, selector, eventType, handler) {\n return element.addEventListener(eventType, function(e) {\n var target;\n target = e.target;\n while (!(!(target instanceof Element) || matches(target, selector))) {\n target = target.parentNode;\n }\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n return e.stopPropagation();\n }\n });\n };\n\n }).call(this);\n (function() {\n var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse;\n\n cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire;\n\n AcceptHeaders = {\n '*': '*/*',\n text: 'text/plain',\n html: 'text/html',\n xml: 'application/xml, text/xml',\n json: 'application/json, text/javascript',\n script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'\n };\n\n Rails.ajax = function(options) {\n var xhr;\n options = prepareOptions(options);\n xhr = createXHR(options, function() {\n var ref, response;\n response = processResponse((ref = xhr.response) != null ? ref : xhr.responseText, xhr.getResponseHeader('Content-Type'));\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : void 0;\n });\n if ((options.beforeSend != null) && !options.beforeSend(xhr, options)) {\n return false;\n }\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n };\n\n prepareOptions = function(options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n if (options.type === 'GET' && options.data) {\n if (options.url.indexOf('?') < 0) {\n options.url += '?' + options.data;\n } else {\n options.url += '&' + options.data;\n }\n }\n if (AcceptHeaders[options.dataType] == null) {\n options.dataType = '*';\n }\n options.accept = AcceptHeaders[options.dataType];\n if (options.dataType !== '*') {\n options.accept += ', */*; q=0.01';\n }\n return options;\n };\n\n createXHR = function(options, done) {\n var xhr;\n xhr = new XMLHttpRequest();\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader('Accept', options.accept);\n if (typeof options.data === 'string') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n }\n if (!options.crossDomain) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n CSRFProtection(xhr);\n }\n xhr.withCredentials = !!options.withCredentials;\n xhr.onreadystatechange = function() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n return xhr;\n };\n\n processResponse = function(response, type) {\n var parser, script;\n if (typeof response === 'string' && typeof type === 'string') {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n script = document.createElement('script');\n script.setAttribute('nonce', cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n parser = new DOMParser();\n type = type.replace(/;.+/, '');\n try {\n response = parser.parseFromString(response, type);\n } catch (error) {}\n }\n }\n return response;\n };\n\n Rails.href = function(element) {\n return element.href;\n };\n\n Rails.isCrossDomain = function(url) {\n var e, originAnchor, urlAnchor;\n originAnchor = document.createElement('a');\n originAnchor.href = location.href;\n urlAnchor = document.createElement('a');\n try {\n urlAnchor.href = url;\n return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) || (originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host));\n } catch (error) {\n e = error;\n return true;\n }\n };\n\n }).call(this);\n (function() {\n var matches, toArray;\n\n matches = Rails.matches;\n\n toArray = function(e) {\n return Array.prototype.slice.call(e);\n };\n\n Rails.serializeElement = function(element, additionalParam) {\n var inputs, params;\n inputs = [element];\n if (matches(element, 'form')) {\n inputs = toArray(element.elements);\n }\n params = [];\n inputs.forEach(function(input) {\n if (!input.name || input.disabled) {\n return;\n }\n if (matches(input, 'fieldset[disabled] *')) {\n return;\n }\n if (matches(input, 'select')) {\n return toArray(input.options).forEach(function(option) {\n if (option.selected) {\n return params.push({\n name: input.name,\n value: option.value\n });\n }\n });\n } else if (input.checked || ['radio', 'checkbox', 'submit'].indexOf(input.type) === -1) {\n return params.push({\n name: input.name,\n value: input.value\n });\n }\n });\n if (additionalParam) {\n params.push(additionalParam);\n }\n return params.map(function(param) {\n if (param.name != null) {\n return (encodeURIComponent(param.name)) + \"=\" + (encodeURIComponent(param.value));\n } else {\n return param;\n }\n }).join('&');\n };\n\n Rails.formElements = function(form, selector) {\n if (matches(form, 'form')) {\n return toArray(form.elements).filter(function(el) {\n return matches(el, selector);\n });\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n };\n\n }).call(this);\n (function() {\n var allowAction, fire, stopEverything;\n\n fire = Rails.fire, stopEverything = Rails.stopEverything;\n\n Rails.handleConfirm = function(e) {\n if (!allowAction(this)) {\n return stopEverything(e);\n }\n };\n\n Rails.confirm = function(message, element) {\n return confirm(message);\n };\n\n allowAction = function(element) {\n var answer, callback, message;\n message = element.getAttribute('data-confirm');\n if (!message) {\n return true;\n }\n answer = false;\n if (fire(element, 'confirm')) {\n try {\n answer = Rails.confirm(message, element);\n } catch (error) {}\n callback = fire(element, 'confirm:complete', [answer]);\n }\n return answer && callback;\n };\n\n }).call(this);\n (function() {\n var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, isXhrRedirect, matches, setData, stopEverything;\n\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements;\n\n Rails.handleDisabledElement = function(e) {\n var element;\n element = this;\n if (element.disabled) {\n return stopEverything(e);\n }\n };\n\n Rails.enableElement = function(e) {\n var element;\n if (e instanceof Event) {\n if (isXhrRedirect(e)) {\n return;\n }\n element = e.target;\n } else {\n element = e;\n }\n if (matches(element, Rails.linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return enableFormElements(element);\n }\n };\n\n Rails.disableElement = function(e) {\n var element;\n element = e instanceof Event ? e.target : e;\n if (matches(element, Rails.linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return disableFormElements(element);\n }\n };\n\n disableLinkElement = function(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n }\n element.addEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', true);\n };\n\n enableLinkElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, 'ujs:enable-with', null);\n }\n element.removeEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', null);\n };\n\n disableFormElements = function(form) {\n return formElements(form, Rails.formDisableSelector).forEach(disableFormElement);\n };\n\n disableFormElement = function(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n if (matches(element, 'button')) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, 'ujs:enable-with', element.value);\n element.value = replacement;\n }\n }\n element.disabled = true;\n return setData(element, 'ujs:disabled', true);\n };\n\n enableFormElements = function(form) {\n return formElements(form, Rails.formEnableSelector).forEach(enableFormElement);\n };\n\n enableFormElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n if (matches(element, 'button')) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n setData(element, 'ujs:enable-with', null);\n }\n element.disabled = false;\n return setData(element, 'ujs:disabled', null);\n };\n\n isXhrRedirect = function(event) {\n var ref, xhr;\n xhr = (ref = event.detail) != null ? ref[0] : void 0;\n return (xhr != null ? xhr.getResponseHeader(\"X-Xhr-Redirect\") : void 0) != null;\n };\n\n }).call(this);\n (function() {\n var stopEverything;\n\n stopEverything = Rails.stopEverything;\n\n Rails.handleMethod = function(e) {\n var csrfParam, csrfToken, form, formContent, href, link, method;\n link = this;\n method = link.getAttribute('data-method');\n if (!method) {\n return;\n }\n href = Rails.href(link);\n csrfToken = Rails.csrfToken();\n csrfParam = Rails.csrfParam();\n form = document.createElement('form');\n formContent = \"\";\n if ((csrfParam != null) && (csrfToken != null) && !Rails.isCrossDomain(href)) {\n formContent += \"\";\n }\n formContent += '';\n form.method = 'post';\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = 'none';\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n return stopEverything(e);\n };\n\n }).call(this);\n (function() {\n var ajax, fire, getData, isCrossDomain, isRemote, matches, serializeElement, setData, stopEverything,\n slice = [].slice;\n\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, fire = Rails.fire, stopEverything = Rails.stopEverything, ajax = Rails.ajax, isCrossDomain = Rails.isCrossDomain, serializeElement = Rails.serializeElement;\n\n isRemote = function(element) {\n var value;\n value = element.getAttribute('data-remote');\n return (value != null) && value !== 'false';\n };\n\n Rails.handleRemote = function(e) {\n var button, data, dataType, element, method, url, withCredentials;\n element = this;\n if (!isRemote(element)) {\n return true;\n }\n if (!fire(element, 'ajax:before')) {\n fire(element, 'ajax:stopped');\n return false;\n }\n withCredentials = element.getAttribute('data-with-credentials');\n dataType = element.getAttribute('data-type') || 'script';\n if (matches(element, Rails.formSubmitSelector)) {\n button = getData(element, 'ujs:submit-button');\n method = getData(element, 'ujs:submit-button-formmethod') || element.method;\n url = getData(element, 'ujs:submit-button-formaction') || element.getAttribute('action') || location.href;\n if (method.toUpperCase() === 'GET') {\n url = url.replace(/\\?.*$/, '');\n }\n if (element.enctype === 'multipart/form-data') {\n data = new FormData(element);\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n setData(element, 'ujs:submit-button', null);\n setData(element, 'ujs:submit-button-formmethod', null);\n setData(element, 'ujs:submit-button-formaction', null);\n } else if (matches(element, Rails.buttonClickSelector) || matches(element, Rails.inputChangeSelector)) {\n method = element.getAttribute('data-method');\n url = element.getAttribute('data-url');\n data = serializeElement(element, element.getAttribute('data-params'));\n } else {\n method = element.getAttribute('data-method');\n url = Rails.href(element);\n data = element.getAttribute('data-params');\n }\n ajax({\n type: method || 'GET',\n url: url,\n data: data,\n dataType: dataType,\n beforeSend: function(xhr, options) {\n if (fire(element, 'ajax:beforeSend', [xhr, options])) {\n return fire(element, 'ajax:send', [xhr]);\n } else {\n fire(element, 'ajax:stopped');\n return false;\n }\n },\n success: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:success', args);\n },\n error: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:error', args);\n },\n complete: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:complete', args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: (withCredentials != null) && withCredentials !== 'false'\n });\n return stopEverything(e);\n };\n\n Rails.formSubmitButtonClick = function(e) {\n var button, form;\n button = this;\n form = button.form;\n if (!form) {\n return;\n }\n if (button.name) {\n setData(form, 'ujs:submit-button', {\n name: button.name,\n value: button.value\n });\n }\n setData(form, 'ujs:formnovalidate-button', button.formNoValidate);\n setData(form, 'ujs:submit-button-formaction', button.getAttribute('formaction'));\n return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod'));\n };\n\n Rails.preventInsignificantClick = function(e) {\n var data, insignificantMetaClick, link, metaClick, method, nonPrimaryMouseClick;\n link = this;\n method = (link.getAttribute('data-method') || 'GET').toUpperCase();\n data = link.getAttribute('data-params');\n metaClick = e.metaKey || e.ctrlKey;\n insignificantMetaClick = metaClick && method === 'GET' && !data;\n nonPrimaryMouseClick = (e.button != null) && e.button !== 0;\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n return e.stopImmediatePropagation();\n }\n };\n\n }).call(this);\n (function() {\n var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens;\n\n fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, loadCSPNonce = Rails.loadCSPNonce, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, preventInsignificantClick = Rails.preventInsignificantClick, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMethod = Rails.handleMethod;\n\n if ((typeof jQuery !== \"undefined\" && jQuery !== null) && (jQuery.ajax != null)) {\n if (jQuery.rails) {\n throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.');\n }\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter(function(options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n });\n }\n\n Rails.start = function() {\n if (window._rails_loaded) {\n throw new Error('rails-ujs has already been loaded!');\n }\n window.addEventListener('pageshow', function() {\n $(Rails.formEnableSelector).forEach(function(el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n return $(Rails.linkDisableSelector).forEach(function(el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n });\n delegate(document, Rails.linkDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.linkClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.linkClickSelector, 'click', handleConfirm);\n delegate(document, Rails.linkClickSelector, 'click', disableElement);\n delegate(document, Rails.linkClickSelector, 'click', handleRemote);\n delegate(document, Rails.linkClickSelector, 'click', handleMethod);\n delegate(document, Rails.buttonClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleConfirm);\n delegate(document, Rails.buttonClickSelector, 'click', disableElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleRemote);\n delegate(document, Rails.inputChangeSelector, 'change', handleDisabledElement);\n delegate(document, Rails.inputChangeSelector, 'change', handleConfirm);\n delegate(document, Rails.inputChangeSelector, 'change', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', handleDisabledElement);\n delegate(document, Rails.formSubmitSelector, 'submit', handleConfirm);\n delegate(document, Rails.formSubmitSelector, 'submit', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', function(e) {\n return setTimeout((function() {\n return disableElement(e);\n }), 13);\n });\n delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement);\n delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.formInputClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.formInputClickSelector, 'click', handleConfirm);\n delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick);\n document.addEventListener('DOMContentLoaded', refreshCSRFTokens);\n document.addEventListener('DOMContentLoaded', loadCSPNonce);\n return window._rails_loaded = true;\n };\n\n if (window.Rails === Rails && fire(document, 'rails:attachBindings')) {\n Rails.start();\n }\n\n }).call(this);\n }).call(this);\n\n if (typeof module === \"object\" && module.exports) {\n module.exports = Rails;\n } else if (typeof define === \"function\" && define.amd) {\n define(Rails);\n }\n}).call(this);\n", "/*\n * International Telephone Input v17.0.16\n * https://github.com/jackocnr/intl-tel-input.git\n * Licensed under the MIT license\n */\n\n// wrap in UMD\n(function(factory) {\n if (typeof module === \"object\" && module.exports) module.exports = factory(); else window.intlTelInput = factory();\n})(function(undefined) {\n \"use strict\";\n return function() {\n // Array of country objects for the flag dropdown.\n // Here is the criteria for the plugin to support a given country/territory\n // - It has an iso2 code: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\n // - It has it's own country calling code (it is not a sub-region of another country): https://en.wikipedia.org/wiki/List_of_country_calling_codes\n // - It has a flag in the region-flags project: https://github.com/behdad/region-flags/tree/gh-pages/png\n // - It is supported by libphonenumber (it must be listed on this page): https://github.com/googlei18n/libphonenumber/blob/master/resources/ShortNumberMetadata.xml\n // Each country array has the following information:\n // [\n // Country name,\n // iso2 code,\n // International dial code,\n // Order (if >1 country with same dial code),\n // Area codes\n // ]\n var allCountries = [ [ \"Afghanistan (\u202B\u0627\u0641\u063A\u0627\u0646\u0633\u062A\u0627\u0646\u202C\u200E)\", \"af\", \"93\" ], [ \"Albania (Shqip\u00EBri)\", \"al\", \"355\" ], [ \"Algeria (\u202B\u0627\u0644\u062C\u0632\u0627\u0626\u0631\u202C\u200E)\", \"dz\", \"213\" ], [ \"American Samoa\", \"as\", \"1\", 5, [ \"684\" ] ], [ \"Andorra\", \"ad\", \"376\" ], [ \"Angola\", \"ao\", \"244\" ], [ \"Anguilla\", \"ai\", \"1\", 6, [ \"264\" ] ], [ \"Antigua and Barbuda\", \"ag\", \"1\", 7, [ \"268\" ] ], [ \"Argentina\", \"ar\", \"54\" ], [ \"Armenia (\u0540\u0561\u0575\u0561\u057D\u057F\u0561\u0576)\", \"am\", \"374\" ], [ \"Aruba\", \"aw\", \"297\" ], [ \"Ascension Island\", \"ac\", \"247\" ], [ \"Australia\", \"au\", \"61\", 0 ], [ \"Austria (\u00D6sterreich)\", \"at\", \"43\" ], [ \"Azerbaijan (Az\u0259rbaycan)\", \"az\", \"994\" ], [ \"Bahamas\", \"bs\", \"1\", 8, [ \"242\" ] ], [ \"Bahrain (\u202B\u0627\u0644\u0628\u062D\u0631\u064A\u0646\u202C\u200E)\", \"bh\", \"973\" ], [ \"Bangladesh (\u09AC\u09BE\u0982\u09B2\u09BE\u09A6\u09C7\u09B6)\", \"bd\", \"880\" ], [ \"Barbados\", \"bb\", \"1\", 9, [ \"246\" ] ], [ \"Belarus (\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u044C)\", \"by\", \"375\" ], [ \"Belgium (Belgi\u00EB)\", \"be\", \"32\" ], [ \"Belize\", \"bz\", \"501\" ], [ \"Benin (B\u00E9nin)\", \"bj\", \"229\" ], [ \"Bermuda\", \"bm\", \"1\", 10, [ \"441\" ] ], [ \"Bhutan (\u0F60\u0F56\u0FB2\u0F74\u0F42)\", \"bt\", \"975\" ], [ \"Bolivia\", \"bo\", \"591\" ], [ \"Bosnia and Herzegovina (\u0411\u043E\u0441\u043D\u0430 \u0438 \u0425\u0435\u0440\u0446\u0435\u0433\u043E\u0432\u0438\u043D\u0430)\", \"ba\", \"387\" ], [ \"Botswana\", \"bw\", \"267\" ], [ \"Brazil (Brasil)\", \"br\", \"55\" ], [ \"British Indian Ocean Territory\", \"io\", \"246\" ], [ \"British Virgin Islands\", \"vg\", \"1\", 11, [ \"284\" ] ], [ \"Brunei\", \"bn\", \"673\" ], [ \"Bulgaria (\u0411\u044A\u043B\u0433\u0430\u0440\u0438\u044F)\", \"bg\", \"359\" ], [ \"Burkina Faso\", \"bf\", \"226\" ], [ \"Burundi (Uburundi)\", \"bi\", \"257\" ], [ \"Cambodia (\u1780\u1798\u17D2\u1796\u17BB\u1787\u17B6)\", \"kh\", \"855\" ], [ \"Cameroon (Cameroun)\", \"cm\", \"237\" ], [ \"Canada\", \"ca\", \"1\", 1, [ \"204\", \"226\", \"236\", \"249\", \"250\", \"289\", \"306\", \"343\", \"365\", \"387\", \"403\", \"416\", \"418\", \"431\", \"437\", \"438\", \"450\", \"506\", \"514\", \"519\", \"548\", \"579\", \"581\", \"587\", \"604\", \"613\", \"639\", \"647\", \"672\", \"705\", \"709\", \"742\", \"778\", \"780\", \"782\", \"807\", \"819\", \"825\", \"867\", \"873\", \"902\", \"905\" ] ], [ \"Cape Verde (Kabu Verdi)\", \"cv\", \"238\" ], [ \"Caribbean Netherlands\", \"bq\", \"599\", 1, [ \"3\", \"4\", \"7\" ] ], [ \"Cayman Islands\", \"ky\", \"1\", 12, [ \"345\" ] ], [ \"Central African Republic (R\u00E9publique centrafricaine)\", \"cf\", \"236\" ], [ \"Chad (Tchad)\", \"td\", \"235\" ], [ \"Chile\", \"cl\", \"56\" ], [ \"China (\u4E2D\u56FD)\", \"cn\", \"86\" ], [ \"Christmas Island\", \"cx\", \"61\", 2, [ \"89164\" ] ], [ \"Cocos (Keeling) Islands\", \"cc\", \"61\", 1, [ \"89162\" ] ], [ \"Colombia\", \"co\", \"57\" ], [ \"Comoros (\u202B\u062C\u0632\u0631 \u0627\u0644\u0642\u0645\u0631\u202C\u200E)\", \"km\", \"269\" ], [ \"Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)\", \"cd\", \"243\" ], [ \"Congo (Republic) (Congo-Brazzaville)\", \"cg\", \"242\" ], [ \"Cook Islands\", \"ck\", \"682\" ], [ \"Costa Rica\", \"cr\", \"506\" ], [ \"C\u00F4te d\u2019Ivoire\", \"ci\", \"225\" ], [ \"Croatia (Hrvatska)\", \"hr\", \"385\" ], [ \"Cuba\", \"cu\", \"53\" ], [ \"Cura\u00E7ao\", \"cw\", \"599\", 0 ], [ \"Cyprus (\u039A\u03CD\u03C0\u03C1\u03BF\u03C2)\", \"cy\", \"357\" ], [ \"Czech Republic (\u010Cesk\u00E1 republika)\", \"cz\", \"420\" ], [ \"Denmark (Danmark)\", \"dk\", \"45\" ], [ \"Djibouti\", \"dj\", \"253\" ], [ \"Dominica\", \"dm\", \"1\", 13, [ \"767\" ] ], [ \"Dominican Republic (Rep\u00FAblica Dominicana)\", \"do\", \"1\", 2, [ \"809\", \"829\", \"849\" ] ], [ \"Ecuador\", \"ec\", \"593\" ], [ \"Egypt (\u202B\u0645\u0635\u0631\u202C\u200E)\", \"eg\", \"20\" ], [ \"El Salvador\", \"sv\", \"503\" ], [ \"Equatorial Guinea (Guinea Ecuatorial)\", \"gq\", \"240\" ], [ \"Eritrea\", \"er\", \"291\" ], [ \"Estonia (Eesti)\", \"ee\", \"372\" ], [ \"Eswatini\", \"sz\", \"268\" ], [ \"Ethiopia\", \"et\", \"251\" ], [ \"Falkland Islands (Islas Malvinas)\", \"fk\", \"500\" ], [ \"Faroe Islands (F\u00F8royar)\", \"fo\", \"298\" ], [ \"Fiji\", \"fj\", \"679\" ], [ \"Finland (Suomi)\", \"fi\", \"358\", 0 ], [ \"France\", \"fr\", \"33\" ], [ \"French Guiana (Guyane fran\u00E7aise)\", \"gf\", \"594\" ], [ \"French Polynesia (Polyn\u00E9sie fran\u00E7aise)\", \"pf\", \"689\" ], [ \"Gabon\", \"ga\", \"241\" ], [ \"Gambia\", \"gm\", \"220\" ], [ \"Georgia (\u10E1\u10D0\u10E5\u10D0\u10E0\u10D7\u10D5\u10D4\u10DA\u10DD)\", \"ge\", \"995\" ], [ \"Germany (Deutschland)\", \"de\", \"49\" ], [ \"Ghana (Gaana)\", \"gh\", \"233\" ], [ \"Gibraltar\", \"gi\", \"350\" ], [ \"Greece (\u0395\u03BB\u03BB\u03AC\u03B4\u03B1)\", \"gr\", \"30\" ], [ \"Greenland (Kalaallit Nunaat)\", \"gl\", \"299\" ], [ \"Grenada\", \"gd\", \"1\", 14, [ \"473\" ] ], [ \"Guadeloupe\", \"gp\", \"590\", 0 ], [ \"Guam\", \"gu\", \"1\", 15, [ \"671\" ] ], [ \"Guatemala\", \"gt\", \"502\" ], [ \"Guernsey\", \"gg\", \"44\", 1, [ \"1481\", \"7781\", \"7839\", \"7911\" ] ], [ \"Guinea (Guin\u00E9e)\", \"gn\", \"224\" ], [ \"Guinea-Bissau (Guin\u00E9 Bissau)\", \"gw\", \"245\" ], [ \"Guyana\", \"gy\", \"592\" ], [ \"Haiti\", \"ht\", \"509\" ], [ \"Honduras\", \"hn\", \"504\" ], [ \"Hong Kong (\u9999\u6E2F)\", \"hk\", \"852\" ], [ \"Hungary (Magyarorsz\u00E1g)\", \"hu\", \"36\" ], [ \"Iceland (\u00CDsland)\", \"is\", \"354\" ], [ \"India (\u092D\u093E\u0930\u0924)\", \"in\", \"91\" ], [ \"Indonesia\", \"id\", \"62\" ], [ \"Iran (\u202B\u0627\u06CC\u0631\u0627\u0646\u202C\u200E)\", \"ir\", \"98\" ], [ \"Iraq (\u202B\u0627\u0644\u0639\u0631\u0627\u0642\u202C\u200E)\", \"iq\", \"964\" ], [ \"Ireland\", \"ie\", \"353\" ], [ \"Isle of Man\", \"im\", \"44\", 2, [ \"1624\", \"74576\", \"7524\", \"7924\", \"7624\" ] ], [ \"Israel (\u202B\u05D9\u05E9\u05E8\u05D0\u05DC\u202C\u200E)\", \"il\", \"972\" ], [ \"Italy (Italia)\", \"it\", \"39\", 0 ], [ \"Jamaica\", \"jm\", \"1\", 4, [ \"876\", \"658\" ] ], [ \"Japan (\u65E5\u672C)\", \"jp\", \"81\" ], [ \"Jersey\", \"je\", \"44\", 3, [ \"1534\", \"7509\", \"7700\", \"7797\", \"7829\", \"7937\" ] ], [ \"Jordan (\u202B\u0627\u0644\u0623\u0631\u062F\u0646\u202C\u200E)\", \"jo\", \"962\" ], [ \"Kazakhstan (\u041A\u0430\u0437\u0430\u0445\u0441\u0442\u0430\u043D)\", \"kz\", \"7\", 1, [ \"33\", \"7\" ] ], [ \"Kenya\", \"ke\", \"254\" ], [ \"Kiribati\", \"ki\", \"686\" ], [ \"Kosovo\", \"xk\", \"383\" ], [ \"Kuwait (\u202B\u0627\u0644\u0643\u0648\u064A\u062A\u202C\u200E)\", \"kw\", \"965\" ], [ \"Kyrgyzstan (\u041A\u044B\u0440\u0433\u044B\u0437\u0441\u0442\u0430\u043D)\", \"kg\", \"996\" ], [ \"Laos (\u0EA5\u0EB2\u0EA7)\", \"la\", \"856\" ], [ \"Latvia (Latvija)\", \"lv\", \"371\" ], [ \"Lebanon (\u202B\u0644\u0628\u0646\u0627\u0646\u202C\u200E)\", \"lb\", \"961\" ], [ \"Lesotho\", \"ls\", \"266\" ], [ \"Liberia\", \"lr\", \"231\" ], [ \"Libya (\u202B\u0644\u064A\u0628\u064A\u0627\u202C\u200E)\", \"ly\", \"218\" ], [ \"Liechtenstein\", \"li\", \"423\" ], [ \"Lithuania (Lietuva)\", \"lt\", \"370\" ], [ \"Luxembourg\", \"lu\", \"352\" ], [ \"Macau (\u6FB3\u9580)\", \"mo\", \"853\" ], [ \"North Macedonia (\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0438\u0458\u0430)\", \"mk\", \"389\" ], [ \"Madagascar (Madagasikara)\", \"mg\", \"261\" ], [ \"Malawi\", \"mw\", \"265\" ], [ \"Malaysia\", \"my\", \"60\" ], [ \"Maldives\", \"mv\", \"960\" ], [ \"Mali\", \"ml\", \"223\" ], [ \"Malta\", \"mt\", \"356\" ], [ \"Marshall Islands\", \"mh\", \"692\" ], [ \"Martinique\", \"mq\", \"596\" ], [ \"Mauritania (\u202B\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627\u202C\u200E)\", \"mr\", \"222\" ], [ \"Mauritius (Moris)\", \"mu\", \"230\" ], [ \"Mayotte\", \"yt\", \"262\", 1, [ \"269\", \"639\" ] ], [ \"Mexico (M\u00E9xico)\", \"mx\", \"52\" ], [ \"Micronesia\", \"fm\", \"691\" ], [ \"Moldova (Republica Moldova)\", \"md\", \"373\" ], [ \"Monaco\", \"mc\", \"377\" ], [ \"Mongolia (\u041C\u043E\u043D\u0433\u043E\u043B)\", \"mn\", \"976\" ], [ \"Montenegro (Crna Gora)\", \"me\", \"382\" ], [ \"Montserrat\", \"ms\", \"1\", 16, [ \"664\" ] ], [ \"Morocco (\u202B\u0627\u0644\u0645\u063A\u0631\u0628\u202C\u200E)\", \"ma\", \"212\", 0 ], [ \"Mozambique (Mo\u00E7ambique)\", \"mz\", \"258\" ], [ \"Myanmar (Burma) (\u1019\u103C\u1014\u103A\u1019\u102C)\", \"mm\", \"95\" ], [ \"Namibia (Namibi\u00EB)\", \"na\", \"264\" ], [ \"Nauru\", \"nr\", \"674\" ], [ \"Nepal (\u0928\u0947\u092A\u093E\u0932)\", \"np\", \"977\" ], [ \"Netherlands (Nederland)\", \"nl\", \"31\" ], [ \"New Caledonia (Nouvelle-Cal\u00E9donie)\", \"nc\", \"687\" ], [ \"New Zealand\", \"nz\", \"64\" ], [ \"Nicaragua\", \"ni\", \"505\" ], [ \"Niger (Nijar)\", \"ne\", \"227\" ], [ \"Nigeria\", \"ng\", \"234\" ], [ \"Niue\", \"nu\", \"683\" ], [ \"Norfolk Island\", \"nf\", \"672\" ], [ \"North Korea (\uC870\uC120 \uBBFC\uC8FC\uC8FC\uC758 \uC778\uBBFC \uACF5\uD654\uAD6D)\", \"kp\", \"850\" ], [ \"Northern Mariana Islands\", \"mp\", \"1\", 17, [ \"670\" ] ], [ \"Norway (Norge)\", \"no\", \"47\", 0 ], [ \"Oman (\u202B\u0639\u064F\u0645\u0627\u0646\u202C\u200E)\", \"om\", \"968\" ], [ \"Pakistan (\u202B\u067E\u0627\u06A9\u0633\u062A\u0627\u0646\u202C\u200E)\", \"pk\", \"92\" ], [ \"Palau\", \"pw\", \"680\" ], [ \"Palestine (\u202B\u0641\u0644\u0633\u0637\u064A\u0646\u202C\u200E)\", \"ps\", \"970\" ], [ \"Panama (Panam\u00E1)\", \"pa\", \"507\" ], [ \"Papua New Guinea\", \"pg\", \"675\" ], [ \"Paraguay\", \"py\", \"595\" ], [ \"Peru (Per\u00FA)\", \"pe\", \"51\" ], [ \"Philippines\", \"ph\", \"63\" ], [ \"Poland (Polska)\", \"pl\", \"48\" ], [ \"Portugal\", \"pt\", \"351\" ], [ \"Puerto Rico\", \"pr\", \"1\", 3, [ \"787\", \"939\" ] ], [ \"Qatar (\u202B\u0642\u0637\u0631\u202C\u200E)\", \"qa\", \"974\" ], [ \"R\u00E9union (La R\u00E9union)\", \"re\", \"262\", 0 ], [ \"Romania (Rom\u00E2nia)\", \"ro\", \"40\" ], [ \"Russia (\u0420\u043E\u0441\u0441\u0438\u044F)\", \"ru\", \"7\", 0 ], [ \"Rwanda\", \"rw\", \"250\" ], [ \"Saint Barth\u00E9lemy\", \"bl\", \"590\", 1 ], [ \"Saint Helena\", \"sh\", \"290\" ], [ \"Saint Kitts and Nevis\", \"kn\", \"1\", 18, [ \"869\" ] ], [ \"Saint Lucia\", \"lc\", \"1\", 19, [ \"758\" ] ], [ \"Saint Martin (Saint-Martin (partie fran\u00E7aise))\", \"mf\", \"590\", 2 ], [ \"Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)\", \"pm\", \"508\" ], [ \"Saint Vincent and the Grenadines\", \"vc\", \"1\", 20, [ \"784\" ] ], [ \"Samoa\", \"ws\", \"685\" ], [ \"San Marino\", \"sm\", \"378\" ], [ \"S\u00E3o Tom\u00E9 and Pr\u00EDncipe (S\u00E3o Tom\u00E9 e Pr\u00EDncipe)\", \"st\", \"239\" ], [ \"Saudi Arabia (\u202B\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629\u202C\u200E)\", \"sa\", \"966\" ], [ \"Senegal (S\u00E9n\u00E9gal)\", \"sn\", \"221\" ], [ \"Serbia (\u0421\u0440\u0431\u0438\u0458\u0430)\", \"rs\", \"381\" ], [ \"Seychelles\", \"sc\", \"248\" ], [ \"Sierra Leone\", \"sl\", \"232\" ], [ \"Singapore\", \"sg\", \"65\" ], [ \"Sint Maarten\", \"sx\", \"1\", 21, [ \"721\" ] ], [ \"Slovakia (Slovensko)\", \"sk\", \"421\" ], [ \"Slovenia (Slovenija)\", \"si\", \"386\" ], [ \"Solomon Islands\", \"sb\", \"677\" ], [ \"Somalia (Soomaaliya)\", \"so\", \"252\" ], [ \"South Africa\", \"za\", \"27\" ], [ \"South Korea (\uB300\uD55C\uBBFC\uAD6D)\", \"kr\", \"82\" ], [ \"South Sudan (\u202B\u062C\u0646\u0648\u0628 \u0627\u0644\u0633\u0648\u062F\u0627\u0646\u202C\u200E)\", \"ss\", \"211\" ], [ \"Spain (Espa\u00F1a)\", \"es\", \"34\" ], [ \"Sri Lanka (\u0DC1\u0DCA\u200D\u0DBB\u0DD3 \u0DBD\u0D82\u0D9A\u0DCF\u0DC0)\", \"lk\", \"94\" ], [ \"Sudan (\u202B\u0627\u0644\u0633\u0648\u062F\u0627\u0646\u202C\u200E)\", \"sd\", \"249\" ], [ \"Suriname\", \"sr\", \"597\" ], [ \"Svalbard and Jan Mayen\", \"sj\", \"47\", 1, [ \"79\" ] ], [ \"Sweden (Sverige)\", \"se\", \"46\" ], [ \"Switzerland (Schweiz)\", \"ch\", \"41\" ], [ \"Syria (\u202B\u0633\u0648\u0631\u064A\u0627\u202C\u200E)\", \"sy\", \"963\" ], [ \"Taiwan (\u53F0\u7063)\", \"tw\", \"886\" ], [ \"Tajikistan\", \"tj\", \"992\" ], [ \"Tanzania\", \"tz\", \"255\" ], [ \"Thailand (\u0E44\u0E17\u0E22)\", \"th\", \"66\" ], [ \"Timor-Leste\", \"tl\", \"670\" ], [ \"Togo\", \"tg\", \"228\" ], [ \"Tokelau\", \"tk\", \"690\" ], [ \"Tonga\", \"to\", \"676\" ], [ \"Trinidad and Tobago\", \"tt\", \"1\", 22, [ \"868\" ] ], [ \"Tunisia (\u202B\u062A\u0648\u0646\u0633\u202C\u200E)\", \"tn\", \"216\" ], [ \"Turkey (T\u00FCrkiye)\", \"tr\", \"90\" ], [ \"Turkmenistan\", \"tm\", \"993\" ], [ \"Turks and Caicos Islands\", \"tc\", \"1\", 23, [ \"649\" ] ], [ \"Tuvalu\", \"tv\", \"688\" ], [ \"U.S. Virgin Islands\", \"vi\", \"1\", 24, [ \"340\" ] ], [ \"Uganda\", \"ug\", \"256\" ], [ \"Ukraine (\u0423\u043A\u0440\u0430\u0457\u043D\u0430)\", \"ua\", \"380\" ], [ \"United Arab Emirates (\u202B\u0627\u0644\u0625\u0645\u0627\u0631\u0627\u062A \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0645\u062A\u062D\u062F\u0629\u202C\u200E)\", \"ae\", \"971\" ], [ \"United Kingdom\", \"gb\", \"44\", 0 ], [ \"United States\", \"us\", \"1\", 0 ], [ \"Uruguay\", \"uy\", \"598\" ], [ \"Uzbekistan (O\u02BBzbekiston)\", \"uz\", \"998\" ], [ \"Vanuatu\", \"vu\", \"678\" ], [ \"Vatican City (Citt\u00E0 del Vaticano)\", \"va\", \"39\", 1, [ \"06698\" ] ], [ \"Venezuela\", \"ve\", \"58\" ], [ \"Vietnam (Vi\u1EC7t Nam)\", \"vn\", \"84\" ], [ \"Wallis and Futuna (Wallis-et-Futuna)\", \"wf\", \"681\" ], [ \"Western Sahara (\u202B\u0627\u0644\u0635\u062D\u0631\u0627\u0621 \u0627\u0644\u063A\u0631\u0628\u064A\u0629\u202C\u200E)\", \"eh\", \"212\", 1, [ \"5288\", \"5289\" ] ], [ \"Yemen (\u202B\u0627\u0644\u064A\u0645\u0646\u202C\u200E)\", \"ye\", \"967\" ], [ \"Zambia\", \"zm\", \"260\" ], [ \"Zimbabwe\", \"zw\", \"263\" ], [ \"\u00C5land Islands\", \"ax\", \"358\", 1, [ \"18\" ] ] ];\n // loop over all of the countries above, restructuring the data to be objects with named keys\n for (var i = 0; i < allCountries.length; i++) {\n var c = allCountries[i];\n allCountries[i] = {\n name: c[0],\n iso2: c[1],\n dialCode: c[2],\n priority: c[3] || 0,\n areaCodes: c[4] || null\n };\n }\n \"use strict\";\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n var intlTelInputGlobals = {\n getInstance: function getInstance(input) {\n var id = input.getAttribute(\"data-intl-tel-input-id\");\n return window.intlTelInputGlobals.instances[id];\n },\n instances: {},\n // using a global like this allows us to mock it in the tests\n documentReady: function documentReady() {\n return document.readyState === \"complete\";\n }\n };\n if (typeof window === \"object\") window.intlTelInputGlobals = intlTelInputGlobals;\n // these vars persist through all instances of the plugin\n var id = 0;\n var defaults = {\n // whether or not to allow the dropdown\n allowDropdown: true,\n // if there is just a dial code in the input: remove it on blur\n autoHideDialCode: true,\n // add a placeholder in the input with an example number for the selected country\n autoPlaceholder: \"polite\",\n // modify the parentClass\n customContainer: \"\",\n // modify the auto placeholder\n customPlaceholder: null,\n // append menu to specified element\n dropdownContainer: null,\n // don't display these countries\n excludeCountries: [],\n // format the input value during initialisation and on setNumber\n formatOnDisplay: true,\n // geoIp lookup function\n geoIpLookup: null,\n // inject a hidden input with this name, and on submit, populate it with the result of getNumber\n hiddenInput: \"\",\n // initial country\n initialCountry: \"\",\n // localized country names e.g. { 'de': 'Deutschland' }\n localizedCountries: null,\n // don't insert international dial codes\n nationalMode: true,\n // display only these countries\n onlyCountries: [],\n // number type to use for placeholders\n placeholderNumberType: \"MOBILE\",\n // the countries at the top of the list. defaults to united states and united kingdom\n preferredCountries: [ \"us\", \"gb\" ],\n // display the country dial code next to the selected flag so it's not part of the typed number\n separateDialCode: false,\n // specify the path to the libphonenumber script to enable validation/formatting\n utilsScript: \"\"\n };\n // https://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes#Non-geographic_area_codes\n var regionlessNanpNumbers = [ \"800\", \"822\", \"833\", \"844\", \"855\", \"866\", \"877\", \"880\", \"881\", \"882\", \"883\", \"884\", \"885\", \"886\", \"887\", \"888\", \"889\" ];\n // utility function to iterate over an object. can't use Object.entries or native forEach because\n // of IE11\n var forEachProp = function forEachProp(obj, callback) {\n var keys = Object.keys(obj);\n for (var i = 0; i < keys.length; i++) {\n callback(keys[i], obj[keys[i]]);\n }\n };\n // run a method on each instance of the plugin\n var forEachInstance = function forEachInstance(method) {\n forEachProp(window.intlTelInputGlobals.instances, function(key) {\n window.intlTelInputGlobals.instances[key][method]();\n });\n };\n // this is our plugin class that we will create an instance of\n // eslint-disable-next-line no-unused-vars\n var Iti = /*#__PURE__*/\n function() {\n function Iti(input, options) {\n var _this = this;\n _classCallCheck(this, Iti);\n this.id = id++;\n this.telInput = input;\n this.activeItem = null;\n this.highlightedItem = null;\n // process specified options / defaults\n // alternative to Object.assign, which isn't supported by IE11\n var customOptions = options || {};\n this.options = {};\n forEachProp(defaults, function(key, value) {\n _this.options[key] = customOptions.hasOwnProperty(key) ? customOptions[key] : value;\n });\n this.hadInitialPlaceholder = Boolean(input.getAttribute(\"placeholder\"));\n }\n _createClass(Iti, [ {\n key: \"_init\",\n value: function _init() {\n var _this2 = this;\n // if in nationalMode, disable options relating to dial codes\n if (this.options.nationalMode) this.options.autoHideDialCode = false;\n // if separateDialCode then doesn't make sense to A) insert dial code into input\n // (autoHideDialCode), and B) display national numbers (because we're displaying the country\n // dial code next to them)\n if (this.options.separateDialCode) {\n this.options.autoHideDialCode = this.options.nationalMode = false;\n }\n // we cannot just test screen size as some smartphones/website meta tags will report desktop\n // resolutions\n // Note: for some reason jasmine breaks if you put this in the main Plugin function with the\n // rest of these declarations\n // Note: to target Android Mobiles (and not Tablets), we must find 'Android' and 'Mobile'\n this.isMobile = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n if (this.isMobile) {\n // trigger the mobile dropdown css\n document.body.classList.add(\"iti-mobile\");\n // on mobile, we want a full screen dropdown, so we must append it to the body\n if (!this.options.dropdownContainer) this.options.dropdownContainer = document.body;\n }\n // these promises get resolved when their individual requests complete\n // this way the dev can do something like iti.promise.then(...) to know when all requests are\n // complete\n if (typeof Promise !== \"undefined\") {\n var autoCountryPromise = new Promise(function(resolve, reject) {\n _this2.resolveAutoCountryPromise = resolve;\n _this2.rejectAutoCountryPromise = reject;\n });\n var utilsScriptPromise = new Promise(function(resolve, reject) {\n _this2.resolveUtilsScriptPromise = resolve;\n _this2.rejectUtilsScriptPromise = reject;\n });\n this.promise = Promise.all([ autoCountryPromise, utilsScriptPromise ]);\n } else {\n // prevent errors when Promise doesn't exist\n this.resolveAutoCountryPromise = this.rejectAutoCountryPromise = function() {};\n this.resolveUtilsScriptPromise = this.rejectUtilsScriptPromise = function() {};\n }\n // in various situations there could be no country selected initially, but we need to be able\n // to assume this variable exists\n this.selectedCountryData = {};\n // process all the data: onlyCountries, excludeCountries, preferredCountries etc\n this._processCountryData();\n // generate the markup\n this._generateMarkup();\n // set the initial state of the input value and the selected flag\n this._setInitialState();\n // start all of the event listeners: autoHideDialCode, input keydown, selectedFlag click\n this._initListeners();\n // utils script, and auto country\n this._initRequests();\n }\n }, {\n key: \"_processCountryData\",\n value: function _processCountryData() {\n // process onlyCountries or excludeCountries array if present\n this._processAllCountries();\n // process the countryCodes map\n this._processCountryCodes();\n // process the preferredCountries\n this._processPreferredCountries();\n // translate countries according to localizedCountries option\n if (this.options.localizedCountries) this._translateCountriesByLocale();\n // sort countries by name\n if (this.options.onlyCountries.length || this.options.localizedCountries) {\n this.countries.sort(this._countryNameSort);\n }\n }\n }, {\n key: \"_addCountryCode\",\n value: function _addCountryCode(iso2, countryCode, priority) {\n if (countryCode.length > this.countryCodeMaxLen) {\n this.countryCodeMaxLen = countryCode.length;\n }\n if (!this.countryCodes.hasOwnProperty(countryCode)) {\n this.countryCodes[countryCode] = [];\n }\n // bail if we already have this country for this countryCode\n for (var i = 0; i < this.countryCodes[countryCode].length; i++) {\n if (this.countryCodes[countryCode][i] === iso2) return;\n }\n // check for undefined as 0 is falsy\n var index = priority !== undefined ? priority : this.countryCodes[countryCode].length;\n this.countryCodes[countryCode][index] = iso2;\n }\n }, {\n key: \"_processAllCountries\",\n value: function _processAllCountries() {\n if (this.options.onlyCountries.length) {\n var lowerCaseOnlyCountries = this.options.onlyCountries.map(function(country) {\n return country.toLowerCase();\n });\n this.countries = allCountries.filter(function(country) {\n return lowerCaseOnlyCountries.indexOf(country.iso2) > -1;\n });\n } else if (this.options.excludeCountries.length) {\n var lowerCaseExcludeCountries = this.options.excludeCountries.map(function(country) {\n return country.toLowerCase();\n });\n this.countries = allCountries.filter(function(country) {\n return lowerCaseExcludeCountries.indexOf(country.iso2) === -1;\n });\n } else {\n this.countries = allCountries;\n }\n }\n }, {\n key: \"_translateCountriesByLocale\",\n value: function _translateCountriesByLocale() {\n for (var i = 0; i < this.countries.length; i++) {\n var iso = this.countries[i].iso2.toLowerCase();\n if (this.options.localizedCountries.hasOwnProperty(iso)) {\n this.countries[i].name = this.options.localizedCountries[iso];\n }\n }\n }\n }, {\n key: \"_countryNameSort\",\n value: function _countryNameSort(a, b) {\n return a.name.localeCompare(b.name);\n }\n }, {\n key: \"_processCountryCodes\",\n value: function _processCountryCodes() {\n this.countryCodeMaxLen = 0;\n // here we store just dial codes\n this.dialCodes = {};\n // here we store \"country codes\" (both dial codes and their area codes)\n this.countryCodes = {};\n // first: add dial codes\n for (var i = 0; i < this.countries.length; i++) {\n var c = this.countries[i];\n if (!this.dialCodes[c.dialCode]) this.dialCodes[c.dialCode] = true;\n this._addCountryCode(c.iso2, c.dialCode, c.priority);\n }\n // next: add area codes\n // this is a second loop over countries, to make sure we have all of the \"root\" countries\n // already in the map, so that we can access them, as each time we add an area code substring\n // to the map, we also need to include the \"root\" country's code, as that also matches\n for (var _i = 0; _i < this.countries.length; _i++) {\n var _c = this.countries[_i];\n // area codes\n if (_c.areaCodes) {\n var rootCountryCode = this.countryCodes[_c.dialCode][0];\n // for each area code\n for (var j = 0; j < _c.areaCodes.length; j++) {\n var areaCode = _c.areaCodes[j];\n // for each digit in the area code to add all partial matches as well\n for (var k = 1; k < areaCode.length; k++) {\n var partialDialCode = _c.dialCode + areaCode.substr(0, k);\n // start with the root country, as that also matches this dial code\n this._addCountryCode(rootCountryCode, partialDialCode);\n this._addCountryCode(_c.iso2, partialDialCode);\n }\n // add the full area code\n this._addCountryCode(_c.iso2, _c.dialCode + areaCode);\n }\n }\n }\n }\n }, {\n key: \"_processPreferredCountries\",\n value: function _processPreferredCountries() {\n this.preferredCountries = [];\n for (var i = 0; i < this.options.preferredCountries.length; i++) {\n var countryCode = this.options.preferredCountries[i].toLowerCase();\n var countryData = this._getCountryData(countryCode, false, true);\n if (countryData) this.preferredCountries.push(countryData);\n }\n }\n }, {\n key: \"_createEl\",\n value: function _createEl(name, attrs, container) {\n var el = document.createElement(name);\n if (attrs) forEachProp(attrs, function(key, value) {\n return el.setAttribute(key, value);\n });\n if (container) container.appendChild(el);\n return el;\n }\n }, {\n key: \"_generateMarkup\",\n value: function _generateMarkup() {\n // if autocomplete does not exist on the element and its form, then\n // prevent autocomplete as there's no safe, cross-browser event we can react to, so it can\n // easily put the plugin in an inconsistent state e.g. the wrong flag selected for the\n // autocompleted number, which on submit could mean wrong number is saved (esp in nationalMode)\n if (!this.telInput.hasAttribute(\"autocomplete\") && !(this.telInput.form && this.telInput.form.hasAttribute(\"autocomplete\"))) {\n this.telInput.setAttribute(\"autocomplete\", \"off\");\n }\n // containers (mostly for positioning)\n var parentClass = \"iti\";\n if (this.options.allowDropdown) parentClass += \" iti--allow-dropdown\";\n if (this.options.separateDialCode) parentClass += \" iti--separate-dial-code\";\n if (this.options.customContainer) {\n parentClass += \" \";\n parentClass += this.options.customContainer;\n }\n var wrapper = this._createEl(\"div\", {\n \"class\": parentClass\n });\n this.telInput.parentNode.insertBefore(wrapper, this.telInput);\n this.flagsContainer = this._createEl(\"div\", {\n \"class\": \"iti__flag-container\"\n }, wrapper);\n wrapper.appendChild(this.telInput);\n // selected flag (displayed to left of input)\n this.selectedFlag = this._createEl(\"div\", {\n \"class\": \"iti__selected-flag\",\n role: \"combobox\",\n \"aria-controls\": \"iti-\".concat(this.id, \"__country-listbox\"),\n \"aria-owns\": \"iti-\".concat(this.id, \"__country-listbox\"),\n \"aria-expanded\": \"false\"\n }, this.flagsContainer);\n this.selectedFlagInner = this._createEl(\"div\", {\n \"class\": \"iti__flag\"\n }, this.selectedFlag);\n if (this.options.separateDialCode) {\n this.selectedDialCode = this._createEl(\"div\", {\n \"class\": \"iti__selected-dial-code\"\n }, this.selectedFlag);\n }\n if (this.options.allowDropdown) {\n // make element focusable and tab navigable\n this.selectedFlag.setAttribute(\"tabindex\", \"0\");\n this.dropdownArrow = this._createEl(\"div\", {\n \"class\": \"iti__arrow\"\n }, this.selectedFlag);\n // country dropdown: preferred countries, then divider, then all countries\n this.countryList = this._createEl(\"ul\", {\n \"class\": \"iti__country-list iti__hide\",\n id: \"iti-\".concat(this.id, \"__country-listbox\"),\n role: \"listbox\",\n \"aria-label\": \"List of countries\"\n });\n if (this.preferredCountries.length) {\n this._appendListItems(this.preferredCountries, \"iti__preferred\", true);\n this._createEl(\"li\", {\n \"class\": \"iti__divider\",\n role: \"separator\",\n \"aria-disabled\": \"true\"\n }, this.countryList);\n }\n this._appendListItems(this.countries, \"iti__standard\");\n // create dropdownContainer markup\n if (this.options.dropdownContainer) {\n this.dropdown = this._createEl(\"div\", {\n \"class\": \"iti iti--container\"\n });\n this.dropdown.appendChild(this.countryList);\n } else {\n this.flagsContainer.appendChild(this.countryList);\n }\n }\n if (this.options.hiddenInput) {\n var hiddenInputName = this.options.hiddenInput;\n var name = this.telInput.getAttribute(\"name\");\n if (name) {\n var i = name.lastIndexOf(\"[\");\n // if input name contains square brackets, then give the hidden input the same name,\n // replacing the contents of the last set of brackets with the given hiddenInput name\n if (i !== -1) hiddenInputName = \"\".concat(name.substr(0, i), \"[\").concat(hiddenInputName, \"]\");\n }\n this.hiddenInput = this._createEl(\"input\", {\n type: \"hidden\",\n name: hiddenInputName\n });\n wrapper.appendChild(this.hiddenInput);\n }\n }\n }, {\n key: \"_appendListItems\",\n value: function _appendListItems(countries, className, preferred) {\n // we create so many DOM elements, it is faster to build a temp string\n // and then add everything to the DOM in one go at the end\n var tmp = \"\";\n // for each country\n for (var i = 0; i < countries.length; i++) {\n var c = countries[i];\n var idSuffix = preferred ? \"-preferred\" : \"\";\n // open the list item\n tmp += \"