{"version":3,"file":"search-036bc9c5.js","sources":["../../../app/javascript/entrypoints/search.js"],"sourcesContent":["import { Calendar } from '@fullcalendar/core';\nimport dayGridPlugin from '@fullcalendar/daygrid';\nimport timeGridPlugin from '@fullcalendar/timegrid';\nimport listPlugin from '@fullcalendar/list';\nimport interactionPlugin from '@fullcalendar/interaction';\nimport { Modal } from \"bootstrap\";\n\nlet inputDate = ''\n\ndocument.addEventListener('DOMContentLoaded', function() {\n const calendarEls = document.querySelectorAll('.js_searchAreaCalendar')\n calendarEls.forEach(function(el) {\n const calendar = new Calendar(el, {\n timeZone: 'Asia/Tokyo',\n plugins: [dayGridPlugin, timeGridPlugin, listPlugin, interactionPlugin],\n initialView: 'dayGridMonth',\n validRange: function(currentDate) {\n const startDate = new Date(currentDate.valueOf());\n const endDate = new Date(currentDate.valueOf());\n\n endDate.setMonth(endDate.getMonth() + 6);\n\n return { start: startDate, end: endDate };\n },\n locale: 'ja',\n headerToolbar: {\n left: 'prev',\n center: 'title',\n right: 'next',\n },\n height: 'auto',\n dayCellContent: function(e) {\n // 「日」という文言を消して、日付を表示する\n return e.dayNumberText.replace('日', '');\n },\n dateClick: function(date) {\n inputDate = date.dateStr\n $('.fc-daygrid-day').removeClass('isSelected')\n $(`.fc-daygrid-day[data-date=\"${inputDate}\"]`).addClass('isSelected')\n $('.js_calendarAreaSelectedDate').text(inputDate)\n },\n })\n calendar.render()\n })\n})\n\n$(function() {\n // ページ読み込み時に受付中のクラスを付与\n if ($('#hiddenAccepting').val() == 'true') {\n $('.pc_accepting').prop('checked', true)\n $('.sp_accepting').prop('checked', true)\n } else {\n $('.pc_accepting').prop('checked', false)\n $('.sp_accepting').prop('checked', false)\n }\n\n // ページ読み込み時にランク区分検索のクラスを付与\n if ($('#hiddenRankTora').val() == 'false') {\n $('.check-box-tora').prop('checked', false)\n }\n if ($('#hiddenRankPanda').val() == 'false') {\n $('.check-box-panda').prop('checked', false)\n }\n if ($('#hiddenRankIruka').val() == 'false') {\n $('.check-box-iruka').prop('checked', false)\n }\n if ($('#hiddenRankPengin').val() == 'false') {\n $('.check-box-pengin').prop('checked', false)\n }\n if ($('#hiddenRankKodomo').val() == 'false') {\n $('.check-box-kodomo').prop('checked', false)\n }\n\n //「会員区分」にチェックありの場合\n $('.check_userstatus input[type=checkbox]').on('change', function() {\n if ($(this).prop('checked')) {\n $(this).parent('label').removeClass('is_uncheck')\n } else {\n $(this).parent('label').addClass('is_uncheck')\n }\n })\n\n $('.check_userstatus input[type=checkbox]').each(function() {\n if ($(this).prop('checked')) {\n $(this).parent('label').removeClass('is_uncheck')\n } else {\n $(this).parent('label').addClass('is_uncheck')\n }\n })\n\n // 市区町村入力\n // 都道府県\n const prefSelect = $('select[name=\"prefecture\"]')\n const citySelect = $('select[name=\"city\"]')\n\n const prefLoadStart = (loadingText = '読み込み中') => {\n prefSelect.prop('selectedIndex', 0)\n prefSelect.attr('disabled', 'disabled').find('option:eq(0)').html(loadingText)\n }\n const prefLoadEnd = () => {\n prefSelect.attr('disabled', false).find('option:eq(0)').html('都道府県を選択')\n }\n const cityLoadStart = (loadingText = '読み込み中') => {\n citySelect.prop('selectedIndex', 0)\n citySelect.attr('disabled', 'disabled').find('option:eq(0)').html(loadingText)\n }\n const cityLoadEnd = () => {\n citySelect.attr('disabled', false).find('option:eq(0)').html('市区町村を選択')\n }\n\n prefLoadStart()\n $.getJSON('/api/internal/v1/prefectures').done(function(json) {\n const prefs = json;\n const selectedKenId = $('input[name=\"prefecture\"]')\n prefs.forEach(function(pref) {\n const $option = $(\"');\n cityLoadStart()\n\n const kenId = $(this).val();\n const locationText = $(\".js_is_filter_by_provider_pref_text span\");\n if (kenId === '') {\n locationText.textContent = \"\";\n $(\".js_is_filter_by_provider_pref_wrapper\").hide();\n return\n }\n locationText.text($(this).find('option:selected').text());\n $(\".js_is_filter_by_provider_pref_wrapper\").show();\n getCities(kenId)\n })\n // 画面描画時に既に市区町村がセットされている場合の市区町村取得\n if ($('input[name=\"city\"]').length && $('input[name=\"city\"]').val() !== 0) {\n const selectedKenId = $('input[name=\"prefecture\"]').val()\n const selectedCityId = $('input[name=\"city\"]').val()\n if (selectedKenId !== '') {\n getCities(selectedKenId, selectedCityId)\n }\n }\n\n function getCities(kenId, cityId = null) {\n $.getJSON('/api/internal/v1/cities/' + kenId).done(function(json) {\n const cities = json;\n cities.forEach(function(city) {\n const $option = $(\"