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,EAASgG,cAAcjE,UAAUC,OAAO,UAExCiE,YAAW,WACTC,SAASC,QACX,GAAG,KAEP,GAGN,E,kBCvBF,SAASC,EAAoBhM,GAC5B,IAAIK,EAAI,IAAIC,MAAM,uBAAyBN,EAAM,KAEjD,MADAK,EAAEE,KAAO,mBACHF,CACP,CACA2L,EAAoBxL,KAAO,WAAa,MAAO,EAAI,EACnDwL,EAAoBtL,QAAUsL,EAC9BA,EAAoB/L,GAAK,IACzBU,EAAOC,QAAUoL,C,wECLjB,wBAA6BnL,EAAAA,GAC3BE,OAAAA,GACEC,KAAKgB,QAAQmD,MAAQnE,KAAKiL,cAC5B,CAEAA,YAAAA,GACE,MAAMC,EAAUC,OAAOC,KACvB,IACED,OAAOC,UAAOC,EACd,MAAMC,EAAKC,IAAAA,YAAiBnC,OAE5B,OADA+B,OAAOC,KAAOF,EACPI,CACT,CAAE,MAAOjM,GAEP,OAAOkM,IAAAA,YAAiBnC,MAC1B,CACF,E","sources":["webpack://app/./app/javascript/controllers/index.js","webpack://app/./app/javascript/entrypoints/application.js","webpack://app/./app/javascript/controllers/ sync _controller\\.js$","webpack://app/./app/javascript/controllers/toggle_controller.js","webpack://app/./app/javascript/controllers/datetime_picker_controller.js","webpack://app/./app/javascript/controllers/nested_form_controller.js","webpack://app/./app/javascript/channels/index.js","webpack://app/./app/javascript/controllers/hello_controller.js","webpack://app/./app/javascript/controllers/billing_controller.js","webpack://app/./app/javascript/controllers/select2_controller.js","webpack://app/./app/javascript/channels/consumer.js","webpack://app/./app/javascript/controllers/endpoint_verification_controller.js","webpack://app/./app/javascript/channels/ sync _channel\\.js$","webpack://app/./app/javascript/controllers/timezone_controller.js"],"sourcesContent":["// Load all the controllers within this directory and all subdirectories.\n// Controller files must be named *_controller.js.\n\nimport { Application } from \"@hotwired/stimulus\"\nimport { definitionsFromContext } from \"stimulus/webpack-helpers\"\n\nconst application = Application.start()\nconst context = require.context(\"controllers\", true, /_controller\\.js$/)\napplication.load(definitionsFromContext(context))","// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n\nimport Rails from \"@rails/ujs\"\nimport \"@hotwired/turbo\"\nimport * as ActiveStorage from \"@rails/activestorage\"\nimport \"channels\"\nimport \"@popperjs/core\"\nimport * as bootstrap from \"bootstrap\"\nimport \"bootstrap/scss/bootstrap.scss\"\nimport \"bootstrap-icons/font/bootstrap-icons.css\"\n\nRails.start()\nActiveStorage.start()\n\nimport \"controllers\"\n\ndocument.addEventListener(\n 'turbo:load',\n () => {\n let popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle=\"popover\"]'))\n let popoverList = popoverTriggerList.map(function (popoverTriggerEl) {\n return new bootstrap.Popover(popoverTriggerEl)\n })\n let tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle=\"tooltip\"]'))\n let tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {\n return new bootstrap.Tooltip(tooltipTriggerEl)\n })\n }\n);","var map = {\n\t\"./billing_controller.js\": 559,\n\t\"./datetime_picker_controller.js\": 162,\n\t\"./endpoint_verification_controller.js\": 713,\n\t\"./hello_controller.js\": 230,\n\t\"./nested_form_controller.js\": 204,\n\t\"./select2_controller.js\": 608,\n\t\"./timezone_controller.js\": 940,\n\t\"./toggle_controller.js\": 146,\n\t\"controllers/billing_controller.js\": 559,\n\t\"controllers/datetime_picker_controller.js\": 162,\n\t\"controllers/endpoint_verification_controller.js\": 713,\n\t\"controllers/hello_controller.js\": 230,\n\t\"controllers/nested_form_controller.js\": 204,\n\t\"controllers/select2_controller.js\": 608,\n\t\"controllers/timezone_controller.js\": 940,\n\t\"controllers/toggle_controller.js\": 146\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 124;","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = ['source', 'destination']\n\n connect() {\n this.toggle();\n }\n\n toggle() {\n let selected_option;\n if (this.sourceTargets.length > 1) {\n selected_option = this.sourceTargets.filter((entry) => { return entry.checked })[0];\n } else {\n selected_option = this.sourceTarget.options[this.sourceTarget.selectedIndex];\n }\n let enabled_element_class = selected_option.dataset.toggledElementClass;\n\n this.destinationTargets.forEach(element => {\n if (element.className.indexOf(enabled_element_class) == -1) {\n this.toggleElement(element, 'off');\n } else {\n this.toggleElement(element, 'on');\n }\n })\n }\n\n toggleElement(element, state) {\n let displayStatus = state == 'on' ? 'block' : 'none';\n let disabled = (state == 'off');\n\n element.style.display = displayStatus;\n if (element.nodeName == 'FIELDSET') {\n element.disabled = disabled\n } else {\n let input = element.querySelectorAll('select, input');\n input.forEach(e => e.disabled = disabled)\n }\n }\n}","import { Controller } from \"@hotwired/stimulus\"\nimport flatpickr from \"flatpickr\"\nimport css from \"flatpickr/dist/flatpickr.min.css\"\n\nexport default class extends Controller {\n static values = { time: Boolean, noDate: Boolean };\n\n connect() {\n let modal = this.element.closest(\"div.modal\");\n\n this.flatpickr = flatpickr(this.element, {\n enableTime: this.timeValue || false,\n noCalendar: this.noDateValue || false,\n // these fix a bug in flatpickr when used inside bootstrap 4 modal\n onOpen: function(selectedDates, dateStr, instance){\n if (modal) modal.removeAttribute('tabindex');\n },\n onClose: function(selectedDates, dateStr, instance){\n if (modal) modal.setAttribute('tabindex', -1);\n }\n });\n }\n\n disconnect() {\n this.flatpickr.destroy();\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = [\"add_item\", \"template\"]\n static values = { index: String }\n\n add_association(event) {\n event.preventDefault()\n let child_index_name = this.indexValue;\n var content = this.templateTarget.innerHTML.replace(new RegExp(child_index_name,\"g\"), new Date().valueOf())\n this.add_itemTarget.insertAdjacentHTML('beforebegin', content)\n }\n\n remove_association(event, answer) {\n event.preventDefault()\n\n if (!event.detail[0]) {\n // User cancelled\n return\n }\n\n let item = event.target.closest(\".nested-fields\")\n item.querySelector(\"input[name*='_destroy']\").value = 1\n item.style.display = 'none'\n this.clearRequired(item)\n }\n\n clearRequired(item) {\n item.querySelectorAll(\"input[required]\").forEach((node) => {\n node.required = false\n })\n item.querySelectorAll(\"select[required]\").forEach((node) => {\n node.required = false\n })\n }\n}\n","// Load all the channels within this directory and all subdirectories.\n// Channel files must be named *_channel.js.\n\nconst channels = require.context('.', true, /_channel\\.js$/)\nchannels.keys().forEach(channels)\n","// Visit The Stimulus Handbook for more details \n// https://stimulusjs.org/handbook/introduction\n// \n// This example controller works with specially annotated HTML like:\n//\n// <div data-controller=\"hello\">\n// <h1 data-target=\"hello.output\"></h1>\n// </div>\n\nimport { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = [ \"output\" ]\n\n connect() {\n this.outputTarget.textContent = 'Hello, Stimulus!'\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = ['card', 'errors', 'paymentMethodToken', 'submit'];\n static values = { key: String, clientSecret: String };\n\n connect() {\n let stimulus = this;\n let stripe = Stripe(this.keyValue);\n let elements = stripe.elements();\n let classes = {\n base: \"form-control\"\n }\n let style = {\n base: {\n lineHeight: '1.5',\n fontSize: '16px'\n }\n }\n\n let card = elements.create('card', {\n iconStyle: 'solid',\n classes: classes,\n style: style\n });\n card.mount(this.cardTarget);\n\n card.on('change', function (event) {\n stimulus.displayError(event);\n });\n this.element.addEventListener('submit', async (e) => {\n e.preventDefault();\n\n stripe.confirmCardSetup(\n stimulus.clientSecretValue,\n {\n payment_method: {\n card: card\n }\n }\n ).then(function(result) {\n if (result.error) {\n stimulus.submitTarget.disabled = false;\n console.log(result.error);\n } else {\n stimulus.paymentMethodTokenTarget.value = result.setupIntent.payment_method;\n\n stimulus.submitTarget.disabled = true;\n stimulus.element.submit();\n }\n });\n });\n }\n\n displayError(event) {\n if (event.error) {\n this.submitTarget.disabled = false;\n this.errorsTarget.textContent = event.error.message;\n this.errorsTarget.classList.remove(\"d-none\");\n } else {\n this.errorsTarget.textContent = '';\n this.errorsTarget.classList.add(\"d-none\");\n }\n }\n}","import { Controller } from \"@hotwired/stimulus\"\nimport $ from \"jquery\"\nimport \"select2\"\nimport 'select2/dist/css/select2.css'\nimport \"select2-bootstrap-5-theme/dist/select2-bootstrap-5-theme.css\"\n\nexport default class extends Controller {\n forwardEvents() {\n // forward select2 change event as native javascript event\n const select = $(this.select);\n\n select.on('select2:select', function (e) {\n let data = e.params.data;\n if (data.id) {\n let selected_option;\n // using this instead of jquery to handle scenarios where the option value has special characters\n for (let i = select[0].options.length; i-->0;) {\n if (select[0].options[i].value == data.id) {\n selected_option = $(select[0].options[i]);\n }\n }\n\n // add any custom data-attributes to the option itself\n Object.entries(data).forEach(([key, value]) => {\n if (key.indexOf(\"data\") !== -1) {\n selected_option.attr(key, value);\n }\n });\n\n let event = new Event('change', { bubbles: true }) // fire a native event\n this.dispatchEvent(event);\n }\n });\n\n select.on('select2:opening', function (e) {\n let event = new Event('opening', { bubbles: true }) // fire a native event\n this.dispatchEvent(event);\n });\n }\n\n get select() {\n return $(this.element);\n }\n\n data(attr) {\n // clear the data cache every time to get latest value\n this.select.removeData();\n\n return this.select.data(attr);\n }\n\n get userFilters() {\n let userFilters = this.data('resourceFilters');\n if (userFilters == 'undefined') {\n userFilters = { id: 0 }\n }\n\n return userFilters\n }\n\n get prefixedFilters() {\n let userFilters = this.userFilters\n let filterPrefixes = this.data('resourcePrefix')\n\n if (filterPrefixes) {\n let prefixedFilters = {}\n prefixedFilters[filterPrefixes] = userFilters\n userFilters = prefixedFilters\n }\n\n return userFilters\n }\n\n connect() {\n this.forwardEvents();\n\n $(document).on(\"select2:open\", () => {\n document.querySelector(\".select2-container--open .select2-search__field\").focus()\n })\n\n let config = {\n theme: 'bootstrap-5',\n placeholder: this.element.getAttribute(\"placeholder\"),\n allowClear: this.element.getAttribute(\"placeholder\") !== null\n };\n if (this.data('resourceUrl')) {\n config.ajax = this.ajaxConfig();\n config.createTag = (input) => { this.createTag(input) }\n if (this.data('tags')) {\n config.language = {\n noResults: function () {\n return \"No results found. Type '++' at the end of the name to create it. \"\n }\n }\n }\n }\n\n this.select.select2(config);\n }\n\n mergeParams(filter1, filter2) {\n // merge other params (e.g. user filters)\n if (filter2) {\n filter1 = {\n ...filter1,\n ...filter2\n }\n }\n\n return filter1;\n }\n\n ajaxConfig() {\n let stimulus = this;\n\n return {\n url: stimulus.data('resourceUrl'),\n data: function(params) {\n let userFilters = stimulus.prefixedFilters;\n\n let query = stimulus.mergeParams(\n { term: params.term, formatting: 'select2' },\n { filters: userFilters }\n );\n\n return query;\n },\n dataType: 'json'\n }\n }\n\n createTag(input) {\n const shorthand = '++'\n const total_length = input.term.length;\n const shorthand_position = input.term.indexOf(shorthand)\n\n if (shorthand_position + 2 !== total_length || total_length <= shorthand.length) {\n // Must use secret shorthand to create new object\n return null;\n }\n\n const name = input.term.slice(0, -shorthand.length);\n let params = this.createTagParams(name);\n\n this.createTagAjaxCall(this.data('resourceUrl'), params);\n }\n\n createTagParams(name) {\n let params = {\n formatting: 'select2'\n };\n const resourceName = this.data('resourceName');\n const parameterName = this.data('resourceParameter') || 'name';\n params[resourceName] = {};\n params[resourceName][parameterName] = name;\n\n params[resourceName] = this.mergeParams(params[resourceName], this.userFilters)\n console.log(params)\n\n return params;\n }\n\n createTagAjaxCall(url, params) {\n $.ajax({\n type: \"POST\",\n url: url,\n dataType: 'json',\n data: params,\n success: (response) => { this.createTagSuccess(response) },\n error: function(jqXHR, textStatus, errorThrown) {\n alert(\"Error, status = \" + textStatus + \", \" +\n \"error thrown: \" + errorThrown\n );\n }\n });\n }\n\n createTagSuccess(response) {\n const newOption = new Option(\n response.text,\n response.id,\n false,\n true\n )\n\n this.select.append(newOption).trigger('change').select2('close');\n\n this.select.trigger({\n type: 'select2:select',\n params: {\n data: response\n }\n });\n }\n\n disconnect() {\n if (this.select.data('select2')) this.select.select2('destroy');\n }\n}\n","// Action Cable provides the framework to deal with WebSockets in Rails.\n// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command.\n\nimport { createConsumer } from \"@rails/actioncable\"\n\nexport default createConsumer()\n","import { Controller } from \"@hotwired/stimulus\"\nimport consumer from \"../channels/consumer\"\n\nexport default class extends Controller {\n static targets = ['loader', 'success'];\n\n connect() {\n let stimulus = this;\n\n consumer.subscriptions.create(\"EndpointVerificationChannel\",\n {\n received(data) {\n if (data.action == 'authentication_success') {\n stimulus.loaderTarget.style.display = \"none\";\n stimulus.successTarget.classList.remove(\"d-none\");\n\n setTimeout(function() {\n location.reload();\n }, 2000);\n }\n }\n }\n )\n }\n}","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = 760;\nmodule.exports = webpackEmptyContext;","import { Controller } from \"@hotwired/stimulus\"\nimport jstz from 'jstz'\n\nexport default class extends Controller {\n connect() {\n this.element.value = this.findTimeZone();\n }\n\n findTimeZone() {\n const oldIntl = window.Intl\n try {\n window.Intl = undefined\n const tz = jstz.determine().name()\n window.Intl = oldIntl\n return tz\n } catch (e) {\n // sometimes (on android) you can't override intl\n return jstz.determine().name()\n }\n }\n}\n\n"],"names":["application","Application","start","context","require","load","definitionsFromContext","Rails","ActiveStorage","document","addEventListener","slice","call","querySelectorAll","map","popoverTriggerEl","bootstrap","tooltipTriggerEl","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","e","Error","code","keys","Object","resolve","module","exports","Controller","static","connect","this","toggle","selected_option","sourceTargets","length","filter","entry","checked","sourceTarget","options","selectedIndex","enabled_element_class","dataset","toggledElementClass","destinationTargets","forEach","element","className","indexOf","toggleElement","state","displayStatus","disabled","style","display","nodeName","time","Boolean","noDate","modal","closest","flatpickr","enableTime","timeValue","noCalendar","noDateValue","onOpen","selectedDates","dateStr","instance","removeAttribute","onClose","setAttribute","disconnect","destroy","index","String","add_association","event","preventDefault","child_index_name","indexValue","content","templateTarget","innerHTML","replace","RegExp","Date","valueOf","add_itemTarget","insertAdjacentHTML","remove_association","answer","detail","item","target","querySelector","value","clearRequired","node","required","channels","outputTarget","textContent","key","clientSecret","stimulus","stripe","Stripe","keyValue","card","elements","create","iconStyle","classes","base","lineHeight","fontSize","mount","cardTarget","on","displayError","async","confirmCardSetup","clientSecretValue","payment_method","then","result","error","submitTarget","console","log","paymentMethodTokenTarget","setupIntent","submit","errorsTarget","message","classList","remove","add","forwardEvents","select","$","data","params","i","entries","attr","Event","bubbles","dispatchEvent","removeData","userFilters","prefixedFilters","filterPrefixes","focus","config","theme","placeholder","getAttribute","allowClear","ajax","ajaxConfig","createTag","input","language","noResults","select2","mergeParams","filter1","filter2","url","term","formatting","filters","dataType","shorthand","total_length","name","createTagParams","createTagAjaxCall","resourceName","parameterName","type","success","response","createTagSuccess","jqXHR","textStatus","errorThrown","alert","newOption","Option","text","append","trigger","createConsumer","consumer","subscriptions","received","action","loaderTarget","successTarget","setTimeout","location","reload","webpackEmptyContext","findTimeZone","oldIntl","window","Intl","undefined","tz","jstz"],"sourceRoot":""}