rails_pulse 0.2.4 → 0.2.5.pre.pre.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +269 -12
- data/Rakefile +142 -8
- data/app/assets/stylesheets/rails_pulse/components/table.css +16 -1
- data/app/assets/stylesheets/rails_pulse/components/tags.css +7 -2
- data/app/assets/stylesheets/rails_pulse/components/utilities.css +3 -0
- data/app/controllers/concerns/chart_table_concern.rb +2 -1
- data/app/controllers/rails_pulse/application_controller.rb +11 -1
- data/app/controllers/rails_pulse/assets_controller.rb +18 -2
- data/app/controllers/rails_pulse/job_runs_controller.rb +37 -0
- data/app/controllers/rails_pulse/jobs_controller.rb +80 -0
- data/app/controllers/rails_pulse/operations_controller.rb +43 -31
- data/app/controllers/rails_pulse/queries_controller.rb +1 -1
- data/app/controllers/rails_pulse/requests_controller.rb +3 -9
- data/app/controllers/rails_pulse/routes_controller.rb +1 -1
- data/app/controllers/rails_pulse/tags_controller.rb +31 -5
- data/app/helpers/rails_pulse/application_helper.rb +32 -1
- data/app/helpers/rails_pulse/breadcrumbs_helper.rb +15 -1
- data/app/helpers/rails_pulse/status_helper.rb +16 -0
- data/app/helpers/rails_pulse/tags_helper.rb +39 -1
- data/app/javascript/rails_pulse/controllers/chart_controller.js +112 -8
- data/app/models/concerns/rails_pulse/taggable.rb +25 -2
- data/app/models/rails_pulse/charts/operations_chart.rb +33 -0
- data/app/models/rails_pulse/dashboard/charts/p95_response_time.rb +1 -2
- data/app/models/rails_pulse/dashboard/tables/slow_routes.rb +1 -1
- data/app/models/rails_pulse/job.rb +85 -0
- data/app/models/rails_pulse/job_run.rb +76 -0
- data/app/models/rails_pulse/jobs/cards/average_duration.rb +85 -0
- data/app/models/rails_pulse/jobs/cards/base.rb +70 -0
- data/app/models/rails_pulse/jobs/cards/failure_rate.rb +85 -0
- data/app/models/rails_pulse/jobs/cards/total_jobs.rb +74 -0
- data/app/models/rails_pulse/jobs/cards/total_runs.rb +48 -0
- data/app/models/rails_pulse/operation.rb +16 -3
- data/app/models/rails_pulse/queries/cards/average_query_times.rb +3 -3
- data/app/models/rails_pulse/queries/cards/execution_rate.rb +1 -1
- data/app/models/rails_pulse/queries/cards/percentile_query_times.rb +1 -1
- data/app/models/rails_pulse/queries/tables/index.rb +2 -1
- data/app/models/rails_pulse/query.rb +10 -1
- data/app/models/rails_pulse/routes/cards/average_response_times.rb +3 -2
- data/app/models/rails_pulse/routes/cards/error_rate_per_route.rb +1 -1
- data/app/models/rails_pulse/routes/cards/percentile_response_times.rb +1 -1
- data/app/models/rails_pulse/routes/cards/request_count_totals.rb +1 -1
- data/app/models/rails_pulse/routes/tables/index.rb +2 -1
- data/app/models/rails_pulse/summary.rb +10 -3
- data/app/services/rails_pulse/summary_service.rb +46 -0
- data/app/views/layouts/rails_pulse/_menu_items.html.erb +7 -0
- data/app/views/layouts/rails_pulse/application.html.erb +23 -0
- data/app/views/rails_pulse/components/_active_filters.html.erb +7 -6
- data/app/views/rails_pulse/components/_page_header.html.erb +8 -7
- data/app/views/rails_pulse/components/_table.html.erb +7 -4
- data/app/views/rails_pulse/dashboard/index.html.erb +1 -1
- data/app/views/rails_pulse/job_runs/_operations.html.erb +78 -0
- data/app/views/rails_pulse/job_runs/index.html.erb +3 -0
- data/app/views/rails_pulse/job_runs/show.html.erb +51 -0
- data/app/views/rails_pulse/jobs/_job_runs_table.html.erb +35 -0
- data/app/views/rails_pulse/jobs/_table.html.erb +43 -0
- data/app/views/rails_pulse/jobs/index.html.erb +34 -0
- data/app/views/rails_pulse/jobs/show.html.erb +49 -0
- data/app/views/rails_pulse/operations/_operation_analysis_application.html.erb +29 -27
- data/app/views/rails_pulse/operations/_operation_analysis_view.html.erb +11 -9
- data/app/views/rails_pulse/operations/show.html.erb +10 -8
- data/app/views/rails_pulse/queries/_table.html.erb +3 -3
- data/app/views/rails_pulse/requests/_table.html.erb +6 -6
- data/app/views/rails_pulse/routes/_table.html.erb +3 -3
- data/app/views/rails_pulse/routes/show.html.erb +1 -1
- data/app/views/rails_pulse/tags/_tag_manager.html.erb +7 -14
- data/config/brakeman.ignore +213 -0
- data/config/brakeman.yml +68 -0
- data/config/initializers/rails_pulse.rb +52 -0
- data/config/routes.rb +6 -0
- data/db/rails_pulse_migrate/20250113000000_add_jobs_to_rails_pulse.rb +95 -0
- data/db/rails_pulse_migrate/20250122000000_add_query_fingerprinting.rb +150 -0
- data/db/rails_pulse_migrate/20250202000000_add_index_to_request_uuid.rb +14 -0
- data/db/rails_pulse_schema.rb +186 -103
- data/lib/generators/rails_pulse/templates/db/rails_pulse_schema.rb +186 -103
- data/lib/generators/rails_pulse/templates/migrations/install_rails_pulse_tables.rb +30 -1
- data/lib/generators/rails_pulse/templates/rails_pulse.rb +31 -0
- data/lib/rails_pulse/active_job_extensions.rb +13 -0
- data/lib/rails_pulse/adapters/delayed_job_plugin.rb +25 -0
- data/lib/rails_pulse/adapters/sidekiq_middleware.rb +41 -0
- data/lib/rails_pulse/cleanup_service.rb +65 -0
- data/lib/rails_pulse/configuration.rb +80 -7
- data/lib/rails_pulse/engine.rb +34 -3
- data/lib/rails_pulse/extensions/active_record.rb +82 -0
- data/lib/rails_pulse/job_run_collector.rb +172 -0
- data/lib/rails_pulse/middleware/request_collector.rb +20 -43
- data/lib/rails_pulse/subscribers/operation_subscriber.rb +11 -5
- data/lib/rails_pulse/tracker.rb +82 -0
- data/lib/rails_pulse/version.rb +1 -1
- data/lib/rails_pulse.rb +2 -0
- data/lib/rails_pulse_server.ru +107 -0
- data/lib/tasks/rails_pulse_benchmark.rake +382 -0
- data/public/rails-pulse-assets/rails-pulse-icons.js +3 -2
- data/public/rails-pulse-assets/rails-pulse-icons.js.map +1 -1
- data/public/rails-pulse-assets/rails-pulse.css +1 -1
- data/public/rails-pulse-assets/rails-pulse.css.map +1 -1
- data/public/rails-pulse-assets/rails-pulse.js +1 -1
- data/public/rails-pulse-assets/rails-pulse.js.map +3 -3
- metadata +35 -7
- data/app/models/rails_pulse/requests/charts/operations_chart.rb +0 -35
- data/db/migrate/20250930105043_install_rails_pulse_tables.rb +0 -23
|
@@ -124,7 +124,7 @@ yyyy`);var o=Hi(e),l=t?"getUTC":"get",f=o[l+"FullYear"](),h=o[l+"Month"]()+1,v=o
|
|
|
124
124
|
<span class='flatpickr-weekday'>
|
|
125
125
|
`+ut.join("</span><span class='flatpickr-weekday'>")+`
|
|
126
126
|
</span>
|
|
127
|
-
`}}function Ot(){t.calendarContainer.classList.add("hasWeeks");var pt=kr("div","flatpickr-weekwrapper");pt.appendChild(kr("span","flatpickr-weekday",t.l10n.weekAbbreviation));var ut=kr("div","flatpickr-weeks");return pt.appendChild(ut),{weekWrapper:pt,weekNumbers:ut}}function Mt(pt,ut){ut===void 0&&(ut=!0);var bt=ut?pt:pt-t.currentMonth;bt<0&&t._hidePrevMonthArrow===!0||bt>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=bt,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Yr("onYearChange"),ot()),at(),Yr("onMonthChange"),gd())}function qt(pt,ut){if(pt===void 0&&(pt=!0),ut===void 0&&(ut=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,ut===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var bt=lE(t.config),Rt=bt.hours,le=bt.minutes,de=bt.seconds;A(Rt,le,de)}t.redraw(),pt&&Yr("onChange")}function Qt(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Yr("onClose")}function ne(){t.config!==void 0&&Yr("onDestroy");for(var pt=t._handlers.length;pt--;)t._handlers[pt].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var ut=t.calendarContainer.parentNode;if(ut.lastChild&&ut.removeChild(ut.lastChild),ut.parentNode){for(;ut.firstChild;)ut.parentNode.insertBefore(ut.firstChild,ut);ut.parentNode.removeChild(ut)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(bt){try{delete t[bt]}catch{}})}function j(pt){return t.calendarContainer.contains(pt)}function Dt(pt){if(t.isOpen&&!t.config.inline){var ut=Ja(pt),bt=j(ut),Rt=ut===t.input||ut===t.altInput||t.element.contains(ut)||pt.path&&pt.path.indexOf&&(~pt.path.indexOf(t.input)||~pt.path.indexOf(t.altInput)),le=!Rt&&!bt&&!j(pt.relatedTarget),de=!t.config.ignoredFocusElements.some(function(He){return He.contains(ut)});le&&de&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&g(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function hr(pt){if(!(!pt||t.config.minDate&&pt<t.config.minDate.getFullYear()||t.config.maxDate&&pt>t.config.maxDate.getFullYear())){var ut=pt,bt=t.currentYear!==ut;t.currentYear=ut||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),bt&&(t.redraw(),Yr("onYearChange"),ot())}}function jt(pt,ut){var bt;ut===void 0&&(ut=!0);var Rt=t.parseDate(pt,void 0,ut);if(t.config.minDate&&Rt&&Qa(Rt,t.config.minDate,ut!==void 0?ut:!t.minDateHasTime)<0||t.config.maxDate&&Rt&&Qa(Rt,t.config.maxDate,ut!==void 0?ut:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(Rt===void 0)return!1;for(var le=!!t.config.enable,de=(bt=t.config.enable)!==null&&bt!==void 0?bt:t.config.disable,He=0,Se=void 0;He<de.length;He++){if(Se=de[He],typeof Se=="function"&&Se(Rt))return le;if(Se instanceof Date&&Rt!==void 0&&Se.getTime()===Rt.getTime())return le;if(typeof Se=="string"){var pr=t.parseDate(Se,void 0,!0);return pr&&pr.getTime()===Rt.getTime()?le:!le}else if(typeof Se=="object"&&Rt!==void 0&&Se.from&&Se.to&&Rt.getTime()>=Se.from.getTime()&&Rt.getTime()<=Se.to.getTime())return le}return!le}function me(pt){return t.daysContainer!==void 0?pt.className.indexOf("hidden")===-1&&pt.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(pt):!1}function Jt(pt){var ut=pt.target===t._input,bt=t._input.value.trimEnd()!==md();ut&&bt&&!(pt.relatedTarget&&j(pt.relatedTarget))&&t.setDate(t._input.value,!0,pt.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function he(pt){var ut=Ja(pt),bt=t.config.wrap?i.contains(ut):ut===t._input,Rt=t.config.allowInput,le=t.isOpen&&(!Rt||!bt),de=t.config.inline&&bt&&!Rt;if(pt.keyCode===13&&bt){if(Rt)return t.setDate(t._input.value,!0,ut===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),ut.blur();t.open()}else if(j(ut)||le||de){var He=!!t.timeContainer&&t.timeContainer.contains(ut);switch(pt.keyCode){case 13:He?(pt.preventDefault(),g(),ro()):a0(pt);break;case 27:pt.preventDefault(),ro();break;case 8:case 46:bt&&!t.config.allowInput&&(pt.preventDefault(),t.clear());break;case 37:case 39:if(!He&&!bt){pt.preventDefault();var Se=f();if(t.daysContainer!==void 0&&(Rt===!1||Se&&me(Se))){var pr=pt.keyCode===39?1:-1;pt.ctrlKey?(pt.stopPropagation(),Mt(pr),Q($(1),0)):Q(void 0,pr)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:pt.preventDefault();var Ie=pt.keyCode===40?1:-1;t.daysContainer&&ut.$i!==void 0||ut===t.input||ut===t.altInput?pt.ctrlKey?(pt.stopPropagation(),hr(t.currentYear-Ie),Q($(1),0)):He||Q(void 0,Ie*7):ut===t.currentYearElement?hr(t.currentYear-Ie):t.config.enableTime&&(!He&&t.hourElement&&t.hourElement.focus(),g(pt),t._debouncedChange());break;case 9:if(He){var Ke=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Qn){return Qn}),xr=Ke.indexOf(ut);if(xr!==-1){var In=Ke[xr+(pt.shiftKey?-1:1)];pt.preventDefault(),(In||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(ut)&&pt.shiftKey&&(pt.preventDefault(),t._input.focus());break;default:break}}if(t.amPM!==void 0&&ut===t.amPM)switch(pt.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],b(),ie();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],b(),ie();break}(bt||j(ut))&&Yr("onKeyDown",pt)}function It(pt,ut){if(ut===void 0&&(ut="flatpickr-day"),!(t.selectedDates.length!==1||pt&&(!pt.classList.contains(ut)||pt.classList.contains("flatpickr-disabled")))){for(var bt=pt?pt.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),Rt=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),le=Math.min(bt,t.selectedDates[0].getTime()),de=Math.max(bt,t.selectedDates[0].getTime()),He=!1,Se=0,pr=0,Ie=le;Ie<de;Ie+=mmt.DAY)jt(new Date(Ie),!0)||(He=He||Ie>le&&Ie<de,Ie<Rt&&(!Se||Ie>Se)?Se=Ie:Ie>Rt&&(!pr||Ie<pr)&&(pr=Ie));var Ke=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+ut));Ke.forEach(function(xr){var In=xr.dateObj,Qn=In.getTime(),pu=Se>0&&Qn<Se||pr>0&&Qn>pr;if(pu){xr.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Mf){xr.classList.remove(Mf)});return}else if(He&&!pu)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Mf){xr.classList.remove(Mf)}),pt!==void 0&&(pt.classList.add(bt<=t.selectedDates[0].getTime()?"startRange":"endRange"),Rt<bt&&Qn===Rt?xr.classList.add("startRange"):Rt>bt&&Qn===Rt&&xr.classList.add("endRange"),Qn>=Se&&(pr===0||Qn<=pr)&&dmt(Qn,Rt,bt)&&xr.classList.add("inRange"))})}}function ae(){t.isOpen&&!t.config.static&&!t.config.inline&&re()}function At(pt,ut){if(ut===void 0&&(ut=t._positionElement),t.isMobile===!0){if(pt){pt.preventDefault();var bt=Ja(pt);bt&&bt.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Yr("onOpen");return}else if(t._input.disabled||t.config.inline)return;var Rt=t.isOpen;t.isOpen=!0,Rt||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Yr("onOpen"),re(ut)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(pt===void 0||!t.timeContainer.contains(pt.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function Wt(pt){return function(ut){var bt=t.config["_"+pt+"Date"]=t.parseDate(ut,t.config.dateFormat),Rt=t.config["_"+(pt==="min"?"max":"min")+"Date"];bt!==void 0&&(t[pt==="min"?"minDateHasTime":"maxDateHasTime"]=bt.getHours()>0||bt.getMinutes()>0||bt.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(le){return jt(le)}),!t.selectedDates.length&&pt==="min"&&T(bt),ie()),t.daysContainer&&(_a(),bt!==void 0?t.currentYearElement[pt]=bt.getFullYear().toString():t.currentYearElement.removeAttribute(pt),t.currentYearElement.disabled=!!Rt&&bt!==void 0&&Rt.getFullYear()===bt.getFullYear())}}function Bt(){var pt=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],ut=Jn(Jn({},JSON.parse(JSON.stringify(i.dataset||{}))),e),bt={};t.config.parseDate=ut.parseDate,t.config.formatDate=ut.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ke){t.config._enable=Ln(Ke)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ke){t.config._disable=Ln(Ke)}});var Rt=ut.mode==="time";if(!ut.dateFormat&&(ut.enableTime||Rt)){var le=Xi.defaultConfig.dateFormat||yh.dateFormat;bt.dateFormat=ut.noCalendar||Rt?"H:i"+(ut.enableSeconds?":S":""):le+" H:i"+(ut.enableSeconds?":S":"")}if(ut.altInput&&(ut.enableTime||Rt)&&!ut.altFormat){var de=Xi.defaultConfig.altFormat||yh.altFormat;bt.altFormat=ut.noCalendar||Rt?"h:i"+(ut.enableSeconds?":S K":" K"):de+(" h:i"+(ut.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Wt("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Wt("max")});var He=function(Ke){return function(xr){t.config[Ke==="min"?"_minTime":"_maxTime"]=t.parseDate(xr,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:He("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:He("max")}),ut.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,bt,ut);for(var Se=0;Se<pt.length;Se++)t.config[pt[Se]]=t.config[pt[Se]]===!0||t.config[pt[Se]]==="true";rE.filter(function(Ke){return t.config[Ke]!==void 0}).forEach(function(Ke){t.config[Ke]=aE(t.config[Ke]||[]).map(h)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Se=0;Se<t.config.plugins.length;Se++){var pr=t.config.plugins[Se](t)||{};for(var Ie in pr)rE.indexOf(Ie)>-1?t.config[Ie]=aE(pr[Ie]).map(h).concat(t.config[Ie]):typeof ut[Ie]>"u"&&(t.config[Ie]=pr[Ie])}ut.altInputClass||(t.config.altInputClass=Jr().className+" "+t.config.altInputClass),Yr("onParseConfig")}function Jr(){return t.config.wrap?i.querySelector("[data-input]"):i}function Ge(){typeof t.config.locale!="object"&&typeof Xi.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Jn(Jn({},Xi.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Xi.l10ns[t.config.locale]:void 0),bf.D="("+t.l10n.weekdays.shorthand.join("|")+")",bf.l="("+t.l10n.weekdays.longhand.join("|")+")",bf.M="("+t.l10n.months.shorthand.join("|")+")",bf.F="("+t.l10n.months.longhand.join("|")+")",bf.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var pt=Jn(Jn({},e),JSON.parse(JSON.stringify(i.dataset||{})));pt.time_24hr===void 0&&Xi.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=KW(t),t.parseDate=oE({config:t.config,l10n:t.l10n})}function re(pt){if(typeof t.config.position=="function")return void t.config.position(t,pt);if(t.calendarContainer!==void 0){Yr("onPreCalendarPosition");var ut=pt||t._positionElement,bt=Array.prototype.reduce.call(t.calendarContainer.children,function(gl,LE){return gl+LE.offsetHeight},0),Rt=t.calendarContainer.offsetWidth,le=t.config.position.split(" "),de=le[0],He=le.length>1?le[1]:null,Se=ut.getBoundingClientRect(),pr=window.innerHeight-Se.bottom,Ie=de==="above"||de!=="below"&&pr<bt&&Se.top>bt,Ke=window.pageYOffset+Se.top+(Ie?-bt-2:ut.offsetHeight+2);if(jn(t.calendarContainer,"arrowTop",!Ie),jn(t.calendarContainer,"arrowBottom",Ie),!t.config.inline){var xr=window.pageXOffset+Se.left,In=!1,Qn=!1;He==="center"?(xr-=(Rt-Se.width)/2,In=!0):He==="right"&&(xr-=Rt-Se.width,Qn=!0),jn(t.calendarContainer,"arrowLeft",!In&&!Qn),jn(t.calendarContainer,"arrowCenter",In),jn(t.calendarContainer,"arrowRight",Qn);var pu=window.document.body.offsetWidth-(window.pageXOffset+Se.right),Mf=xr+Rt>window.document.body.offsetWidth,DE=pu+Rt>window.document.body.offsetWidth;if(jn(t.calendarContainer,"rightMost",Mf),!t.config.static)if(t.calendarContainer.style.top=Ke+"px",!Mf)t.calendarContainer.style.left=xr+"px",t.calendarContainer.style.right="auto";else if(!DE)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=pu+"px";else{var s0=eo();if(s0===void 0)return;var ME=window.document.body.offsetWidth,Sh=Math.max(0,ME/2-Rt/2),vu=".flatpickr-calendar.centerMost:before",yd=".flatpickr-calendar.centerMost:after",Ls=s0.cssRules.length,S1="{left:"+Se.left+"px;right:auto;}";jn(t.calendarContainer,"rightMost",!1),jn(t.calendarContainer,"centerMost",!0),s0.insertRule(vu+","+yd+S1,Ls),t.calendarContainer.style.left=Sh+"px",t.calendarContainer.style.right="auto"}}}}function eo(){for(var pt=null,ut=0;ut<document.styleSheets.length;ut++){var bt=document.styleSheets[ut];if(bt.cssRules){try{bt.cssRules}catch{continue}pt=bt;break}}return pt??ri()}function ri(){var pt=document.createElement("style");return document.head.appendChild(pt),pt.sheet}function _a(){t.config.noCalendar||t.isMobile||(ot(),gd(),at())}function ro(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function a0(pt){pt.preventDefault(),pt.stopPropagation();var ut=function(Ke){return Ke.classList&&Ke.classList.contains("flatpickr-day")&&!Ke.classList.contains("flatpickr-disabled")&&!Ke.classList.contains("notAllowed")},bt=qW(Ja(pt),ut);if(bt!==void 0){var Rt=bt,le=t.latestSelectedDateObj=new Date(Rt.dateObj.getTime()),de=(le.getMonth()<t.currentMonth||le.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=Rt,t.config.mode==="single")t.selectedDates=[le];else if(t.config.mode==="multiple"){var He=o0(le);He?t.selectedDates.splice(parseInt(He),1):t.selectedDates.push(le)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=le,t.selectedDates.push(le),Qa(le,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ke,xr){return Ke.getTime()-xr.getTime()}));if(b(),de){var Se=t.currentYear!==le.getFullYear();t.currentYear=le.getFullYear(),t.currentMonth=le.getMonth(),Se&&(Yr("onYearChange"),ot()),Yr("onMonthChange")}if(gd(),at(),ie(),!de&&t.config.mode!=="range"&&t.config.showMonths===1?Y(Rt):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var pr=t.config.mode==="single"&&!t.config.enableTime,Ie=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(pr||Ie)&&ro()}E()}}var Af={locale:[Ge,mt],showMonths:[lt,v,st],minDate:[N],maxDate:[N],positionElement:[ye],clickOpens:[function(){t.config.clickOpens===!0?(I(t._input,"focus",t.open),I(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function vl(pt,ut){if(pt!==null&&typeof pt=="object"){Object.assign(t.config,pt);for(var bt in pt)Af[bt]!==void 0&&Af[bt].forEach(function(Rt){return Rt()})}else t.config[pt]=ut,Af[pt]!==void 0?Af[pt].forEach(function(Rt){return Rt()}):rE.indexOf(pt)>-1&&(t.config[pt]=aE(ut));t.redraw(),ie(!0)}function ni(pt,ut){var bt=[];if(pt instanceof Array)bt=pt.map(function(Rt){return t.parseDate(Rt,ut)});else if(pt instanceof Date||typeof pt=="number")bt=[t.parseDate(pt,ut)];else if(typeof pt=="string")switch(t.config.mode){case"single":case"time":bt=[t.parseDate(pt,ut)];break;case"multiple":bt=pt.split(t.config.conjunction).map(function(Rt){return t.parseDate(Rt,ut)});break;case"range":bt=pt.split(t.l10n.rangeSeparator).map(function(Rt){return t.parseDate(Rt,ut)});break;default:break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(pt)));t.selectedDates=t.config.allowInvalidPreload?bt:bt.filter(function(Rt){return Rt instanceof Date&&jt(Rt,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(Rt,le){return Rt.getTime()-le.getTime()})}function Pe(pt,ut,bt){if(ut===void 0&&(ut=!1),bt===void 0&&(bt=t.config.dateFormat),pt!==0&&!pt||pt instanceof Array&&pt.length===0)return t.clear(ut);ni(pt,bt),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),N(void 0,ut),T(),t.selectedDates.length===0&&t.clear(!1),ie(ut),ut&&Yr("onChange")}function Ln(pt){return pt.slice().map(function(ut){return typeof ut=="string"||typeof ut=="number"||ut instanceof Date?t.parseDate(ut,void 0,!0):ut&&typeof ut=="object"&&ut.from&&ut.to?{from:t.parseDate(ut.from,void 0),to:t.parseDate(ut.to,void 0)}:ut}).filter(function(ut){return ut})}function vd(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var pt=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);pt&&ni(pt,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()<t.now.getTime()?t.config.maxDate:t.now,t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth(),t.selectedDates.length>0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function dd(){if(t.input=Jr(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=kr(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),ye()}function ye(){t._positionElement=t.config.positionElement||t._input}function xa(){var pt=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=kr("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=pt,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=pt==="datetime-local"?"Y-m-d\\TH:i:S":pt==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}I(t.mobileInput,"change",function(ut){t.setDate(Ja(ut).value,!1,t.mobileFormatStr),Yr("onChange"),Yr("onClose")})}function _1(pt){if(t.isOpen===!0)return t.close();t.open(pt)}function Yr(pt,ut){if(t.config!==void 0){var bt=t.config[pt];if(bt!==void 0&&bt.length>0)for(var Rt=0;bt[Rt]&&Rt<bt.length;Rt++)bt[Rt](t.selectedDates,t.input.value,t,ut);pt==="onChange"&&(t.input.dispatchEvent(dl("change")),t.input.dispatchEvent(dl("input")))}}function dl(pt){var ut=document.createEvent("Event");return ut.initEvent(pt,!0,!0),ut}function o0(pt){for(var ut=0;ut<t.selectedDates.length;ut++){var bt=t.selectedDates[ut];if(bt instanceof Date&&Qa(bt,pt)===0)return""+ut}return!1}function x1(pt){return t.config.mode!=="range"||t.selectedDates.length<2?!1:Qa(pt,t.selectedDates[0])>=0&&Qa(pt,t.selectedDates[1])<=0}function gd(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(pt,ut){var bt=new Date(t.currentYear,t.currentMonth,1);bt.setMonth(t.currentMonth+ut),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[ut].textContent=i1(bt.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=bt.getMonth().toString(),pt.value=bt.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYear<t.config.minDate.getFullYear()),t._hideNextMonthArrow=t.config.maxDate!==void 0&&(t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth+1>t.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function md(pt){var ut=pt||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(bt){return t.formatDate(bt,ut)}).filter(function(bt,Rt,le){return t.config.mode!=="range"||t.config.enableTime||le.indexOf(bt)===Rt}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function ie(pt){pt===void 0&&(pt=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=md(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=md(t.config.altFormat)),pt!==!1&&Yr("onValueUpdate")}function Df(pt){var ut=Ja(pt),bt=t.prevMonthNav.contains(ut),Rt=t.nextMonthNav.contains(ut);bt||Rt?Mt(bt?-1:1):t.yearElements.indexOf(ut)>=0?ut.select():ut.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):ut.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function xh(pt){pt.preventDefault();var ut=pt.type==="keydown",bt=Ja(pt),Rt=bt;t.amPM!==void 0&&bt===t.amPM&&(t.amPM.textContent=t.l10n.amPM[ja(t.amPM.textContent===t.l10n.amPM[0])]);var le=parseFloat(Rt.getAttribute("min")),de=parseFloat(Rt.getAttribute("max")),He=parseFloat(Rt.getAttribute("step")),Se=parseInt(Rt.value,10),pr=pt.delta||(ut?pt.which===38?1:-1:0),Ie=Se+He*pr;if(typeof Rt.value<"u"&&Rt.value.length===2){var Ke=Rt===t.hourElement,xr=Rt===t.minuteElement;Ie<le?(Ie=de+Ie+ja(!Ke)+(ja(Ke)&&ja(!t.amPM)),xr&&F(void 0,-1,t.hourElement)):Ie>de&&(Ie=Rt===t.hourElement?Ie-de-ja(!t.amPM):le,xr&&F(void 0,1,t.hourElement)),t.amPM&&Ke&&(He===1?Ie+Se===23:Math.abs(Ie-Se)>He)&&(t.amPM.textContent=t.l10n.amPM[ja(t.amPM.textContent===t.l10n.amPM[0])]),Rt.value=Kn(Ie)}}return l(),t}function Wy(i,e){for(var t=Array.prototype.slice.call(i).filter(function(h){return h instanceof HTMLElement}),o=[],l=0;l<t.length;l++){var f=t[l];try{if(f.getAttribute("data-fp-omit")!==null)continue;f._flatpickr!==void 0&&(f._flatpickr.destroy(),f._flatpickr=void 0),f._flatpickr=LKt(f,e||{}),o.push(f._flatpickr)}catch(h){console.error(h)}}return o.length===1?o[0]:o}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(i){return Wy(this,i)},HTMLElement.prototype.flatpickr=function(i){return Wy([this],i)});var Xi=function(i,e){return typeof i=="string"?Wy(window.document.querySelectorAll(i),e):i instanceof Node?Wy([i],e):Wy(i,e)};Xi.defaultConfig={};Xi.l10ns={en:Jn({},nE),default:Jn({},nE)};Xi.localize=function(i){Xi.l10ns.default=Jn(Jn({},Xi.l10ns.default),i)};Xi.setDefaults=function(i){Xi.defaultConfig=Jn(Jn({},Xi.defaultConfig),i)};Xi.parseDate=oE({});Xi.formatDate=KW({});Xi.compareDates=Qa;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(i){return Wy(this,i)});Date.prototype.fp_incr=function(i){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof i=="string"?parseInt(i,10):i))};typeof window<"u"&&(window.flatpickr=Xi);var uE=Xi;var fE,_mt,cE,xmt,hE,Smt,n1,jW,Yy=class extends mr{constructor(){super(...arguments);Te(this,fE);Te(this,cE);Te(this,hE);Te(this,n1)}connect(){this.typeValue=="time"?this.flatpickr=uE(this.element,Oe(this,fE,_mt)):this.typeValue=="datetime"?this.flatpickr=uE(this.element,Oe(this,cE,xmt)):this.flatpickr=uE(this.element,Oe(this,hE,Smt))}disconnect(){this.flatpickr.destroy()}};fE=new WeakSet,_mt=function(){return{dateFormat:"H:i",enableTime:!0,noCalendar:!0}},cE=new WeakSet,xmt=function(){return{...Oe(this,n1,jW),altFormat:this.dateTimeFormatValue,dateFormat:"Y-m-d H:i",enableTime:!0}},hE=new WeakSet,Smt=function(){return{...Oe(this,n1,jW),altFormat:this.dateFormatValue,dateFormat:"Y-m-d"}},n1=new WeakSet,jW=function(){return{altInput:!0,disable:this.disableValue,mode:this.modeValue,showMonths:this.showMonthsValue}},Nt(Yy,"targets",["details"]),Nt(Yy,"values",{type:String,disable:Array,mode:{type:String,default:"single"},showMonths:{type:Number,default:1},dateFormat:{type:String,default:"F d, Y"},dateTimeFormat:{type:String,default:"M d, Y h:i K"}});var a1=class extends mr{show(){this.menuTarget.show()}showModal(){this.menuTarget.showModal()}close(){this.menuTarget.close()}closeOnClickOutside({target:i}){i.nodeName==="DIALOG"&&this.close()}};Nt(a1,"targets",["menu"]);var Xy,vE,bmt,qy,pE,dE,wmt,gE,Tmt,mE,Cmt,Zy=class extends mr{constructor(){super(...arguments);Te(this,vE);Te(this,qy);Te(this,dE);Te(this,gE);Te(this,mE);Te(this,Xy,void 0)}initialize(){Mr(this,Xy,new IntersectionObserver(Xe(this,vE,bmt).bind(this)))}connect(){Oe(this,Xy).observe(this.element)}disconnect(){Oe(this,Xy).disconnect()}prev(){this.indexValue>0&&(this.indexValue--,Xe(this,qy,pE).call(this))}next(){this.indexValue<Oe(this,mE,Cmt)&&(this.indexValue++,Xe(this,qy,pE).call(this))}};Xy=new WeakMap,vE=new WeakSet,bmt=function([e]){e.isIntersecting&&(this.indexValue=0,Xe(this,qy,pE).call(this))},qy=new WeakSet,pE=function(){Xe(this,dE,wmt).call(this),Xe(this,gE,Tmt).call(this)},dE=new WeakSet,wmt=function(){this.itemTargets.forEach((e,t)=>{e.tabIndex=t===this.indexValue?0:-1})},gE=new WeakSet,Tmt=function(){this.itemTargets[this.indexValue].focus()},mE=new WeakSet,Cmt=function(){return this.itemTargets.length-1},Nt(Zy,"targets",["item"]),Nt(Zy,"values",{index:Number});var $y=Math.min,wf=Math.max,s1=Math.round,l1=Math.floor,cl=i=>({x:i,y:i}),IKt={left:"right",right:"left",bottom:"top",top:"bottom"},EKt={start:"end",end:"start"};function JW(i,e,t){return wf(i,$y(e,t))}function u1(i,e){return typeof i=="function"?i(e):i}function _h(i){return i.split("-")[0]}function f1(i){return i.split("-")[1]}function QW(i){return i==="x"?"y":"x"}function t4(i){return i==="y"?"height":"width"}var PKt=new Set(["top","bottom"]);function Tf(i){return PKt.has(_h(i))?"y":"x"}function e4(i){return QW(Tf(i))}function Mmt(i,e,t){t===void 0&&(t=!1);let o=f1(i),l=e4(i),f=t4(l),h=l==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[f]>e.floating[f]&&(h=o1(h)),[h,o1(h)]}function Lmt(i){let e=o1(i);return[yE(i),e,yE(e)]}function yE(i){return i.replace(/start|end/g,e=>EKt[e])}var Amt=["left","right"],Dmt=["right","left"],RKt=["top","bottom"],OKt=["bottom","top"];function kKt(i,e,t){switch(i){case"top":case"bottom":return t?e?Dmt:Amt:e?Amt:Dmt;case"left":case"right":return e?RKt:OKt;default:return[]}}function Imt(i,e,t,o){let l=f1(i),f=kKt(_h(i),t==="start",o);return l&&(f=f.map(h=>h+"-"+l),e&&(f=f.concat(f.map(yE)))),f}function o1(i){return i.replace(/left|right|bottom|top/g,e=>IKt[e])}function NKt(i){return{top:0,right:0,bottom:0,left:0,...i}}function Emt(i){return typeof i!="number"?NKt(i):{top:i,right:i,bottom:i,left:i}}function fd(i){let{x:e,y:t,width:o,height:l}=i;return{width:o,height:l,top:t,left:e,right:e+o,bottom:t+l,x:e,y:t}}function Pmt(i,e,t){let{reference:o,floating:l}=i,f=Tf(e),h=e4(e),v=t4(h),g=_h(e),y=f==="y",x=o.x+o.width/2-l.width/2,b=o.y+o.height/2-l.height/2,T=o[v]/2-l[v]/2,A;switch(g){case"top":A={x,y:o.y-l.height};break;case"bottom":A={x,y:o.y+o.height};break;case"right":A={x:o.x+o.width,y:b};break;case"left":A={x:o.x-l.width,y:b};break;default:A={x:o.x,y:o.y}}switch(f1(e)){case"start":A[h]-=T*(t&&y?-1:1);break;case"end":A[h]+=T*(t&&y?-1:1);break}return A}var Rmt=async(i,e,t)=>{let{placement:o="bottom",strategy:l="absolute",middleware:f=[],platform:h}=t,v=f.filter(Boolean),g=await(h.isRTL==null?void 0:h.isRTL(e)),y=await h.getElementRects({reference:i,floating:e,strategy:l}),{x,y:b}=Pmt(y,o,g),T=o,A={},M=0;for(let I=0;I<v.length;I++){let{name:E,fn:O}=v[I],{x:N,y:V,data:F,reset:U}=await O({x,y:b,initialPlacement:o,placement:T,strategy:l,middlewareData:A,rects:y,platform:h,elements:{reference:i,floating:e}});x=N??x,b=V??b,A={...A,[E]:{...A[E],...F}},U&&M<=50&&(M++,typeof U=="object"&&(U.placement&&(T=U.placement),U.rects&&(y=U.rects===!0?await h.getElementRects({reference:i,floating:e,strategy:l}):U.rects),{x,y:b}=Pmt(y,T,g)),I=-1)}return{x,y:b,placement:T,strategy:l,middlewareData:A}};async function r4(i,e){var t;e===void 0&&(e={});let{x:o,y:l,platform:f,rects:h,elements:v,strategy:g}=i,{boundary:y="clippingAncestors",rootBoundary:x="viewport",elementContext:b="floating",altBoundary:T=!1,padding:A=0}=u1(e,i),M=Emt(A),E=v[T?b==="floating"?"reference":"floating":b],O=fd(await f.getClippingRect({element:(t=await(f.isElement==null?void 0:f.isElement(E)))==null||t?E:E.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(v.floating)),boundary:y,rootBoundary:x,strategy:g})),N=b==="floating"?{x:o,y:l,width:h.floating.width,height:h.floating.height}:h.reference,V=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v.floating)),F=await(f.isElement==null?void 0:f.isElement(V))?await(f.getScale==null?void 0:f.getScale(V))||{x:1,y:1}:{x:1,y:1},U=fd(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:v,rect:N,offsetParent:V,strategy:g}):N);return{top:(O.top-U.top+M.top)/F.y,bottom:(U.bottom-O.bottom+M.bottom)/F.y,left:(O.left-U.left+M.left)/F.x,right:(U.right-O.right+M.right)/F.x}}var Omt=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(e){var t,o;let{placement:l,middlewareData:f,rects:h,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:x=!0,crossAxis:b=!0,fallbackPlacements:T,fallbackStrategy:A="bestFit",fallbackAxisSideDirection:M="none",flipAlignment:I=!0,...E}=u1(i,e);if((t=f.arrow)!=null&&t.alignmentOffset)return{};let O=_h(l),N=Tf(v),V=_h(v)===v,F=await(g.isRTL==null?void 0:g.isRTL(y.floating)),U=T||(V||!I?[o1(v)]:Lmt(v)),H=M!=="none";!T&&H&&U.push(...Imt(v,I,M,F));let Y=[v,...U],$=await r4(e,E),K=[],Q=((o=f.flip)==null?void 0:o.overflows)||[];if(x&&K.push($[O]),b){let ct=Mmt(l,h,F);K.push($[ct[0]],$[ct[1]])}if(Q=[...Q,{placement:l,overflows:K}],!K.every(ct=>ct<=0)){var rt,at;let ct=(((rt=f.flip)==null?void 0:rt.index)||0)+1,lt=Y[ct];if(lt&&(!(b==="alignment"?N!==Tf(lt):!1)||Q.every(st=>st.overflows[0]>0&&Tf(st.placement)===N)))return{data:{index:ct,overflows:Q},reset:{placement:lt}};let dt=(at=Q.filter(wt=>wt.overflows[0]<=0).sort((wt,st)=>wt.overflows[1]-st.overflows[1])[0])==null?void 0:at.placement;if(!dt)switch(A){case"bestFit":{var ot;let wt=(ot=Q.filter(st=>{if(H){let mt=Tf(st.placement);return mt===N||mt==="y"}return!0}).map(st=>[st.placement,st.overflows.filter(mt=>mt>0).reduce((mt,Ot)=>mt+Ot,0)]).sort((st,mt)=>st[1]-mt[1])[0])==null?void 0:ot[0];wt&&(dt=wt);break}case"initialPlacement":dt=v;break}if(l!==dt)return{reset:{placement:dt}}}return{}}}};var zKt=new Set(["left","top"]);async function VKt(i,e){let{placement:t,platform:o,elements:l}=i,f=await(o.isRTL==null?void 0:o.isRTL(l.floating)),h=_h(t),v=f1(t),g=Tf(t)==="y",y=zKt.has(h)?-1:1,x=f&&g?-1:1,b=u1(e,i),{mainAxis:T,crossAxis:A,alignmentAxis:M}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return v&&typeof M=="number"&&(A=v==="end"?M*-1:M),g?{x:A*x,y:T*y}:{x:T*y,y:A*x}}var kmt=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(e){var t,o;let{x:l,y:f,placement:h,middlewareData:v}=e,g=await VKt(e,i);return h===((t=v.offset)==null?void 0:t.placement)&&(o=v.arrow)!=null&&o.alignmentOffset?{}:{x:l+g.x,y:f+g.y,data:{...g,placement:h}}}}},Nmt=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(e){let{x:t,y:o,placement:l}=e,{mainAxis:f=!0,crossAxis:h=!1,limiter:v={fn:E=>{let{x:O,y:N}=E;return{x:O,y:N}}},...g}=u1(i,e),y={x:t,y:o},x=await r4(e,g),b=Tf(_h(l)),T=QW(b),A=y[T],M=y[b];if(f){let E=T==="y"?"top":"left",O=T==="y"?"bottom":"right",N=A+x[E],V=A-x[O];A=JW(N,A,V)}if(h){let E=b==="y"?"top":"left",O=b==="y"?"bottom":"right",N=M+x[E],V=M-x[O];M=JW(N,M,V)}let I=v.fn({...e,[T]:A,[b]:M});return{...I,data:{x:I.x-t,y:I.y-o,enabled:{[T]:f,[b]:h}}}}}};function _E(){return typeof window<"u"}function cd(i){return Vmt(i)?(i.nodeName||"").toLowerCase():"#document"}function to(i){var e;return(i==null||(e=i.ownerDocument)==null?void 0:e.defaultView)||window}function hl(i){var e;return(e=(Vmt(i)?i.ownerDocument:i.document)||window.document)==null?void 0:e.documentElement}function Vmt(i){return _E()?i instanceof Node||i instanceof to(i).Node:!1}function Ds(i){return _E()?i instanceof Element||i instanceof to(i).Element:!1}function pl(i){return _E()?i instanceof HTMLElement||i instanceof to(i).HTMLElement:!1}function zmt(i){return!_E()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof to(i).ShadowRoot}var BKt=new Set(["inline","contents"]);function jy(i){let{overflow:e,overflowX:t,overflowY:o,display:l}=Ms(i);return/auto|scroll|overlay|hidden|clip/.test(e+o+t)&&!BKt.has(l)}var FKt=new Set(["table","td","th"]);function Bmt(i){return FKt.has(cd(i))}var UKt=[":popover-open",":modal"];function c1(i){return UKt.some(e=>{try{return i.matches(e)}catch{return!1}})}var GKt=["transform","translate","scale","rotate","perspective"],HKt=["transform","translate","scale","rotate","perspective","filter"],WKt=["paint","layout","strict","content"];function xE(i){let e=SE(),t=Ds(i)?Ms(i):i;return GKt.some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||HKt.some(o=>(t.willChange||"").includes(o))||WKt.some(o=>(t.contain||"").includes(o))}function Fmt(i){let e=Cf(i);for(;pl(e)&&!hd(e);){if(xE(e))return e;if(c1(e))return null;e=Cf(e)}return null}function SE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var YKt=new Set(["html","body","#document"]);function hd(i){return YKt.has(cd(i))}function Ms(i){return to(i).getComputedStyle(i)}function h1(i){return Ds(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function Cf(i){if(cd(i)==="html")return i;let e=i.assignedSlot||i.parentNode||zmt(i)&&i.host||hl(i);return zmt(e)?e.host:e}function Umt(i){let e=Cf(i);return hd(e)?i.ownerDocument?i.ownerDocument.body:i.body:pl(e)&&jy(e)?e:Umt(e)}function Ky(i,e,t){var o;e===void 0&&(e=[]),t===void 0&&(t=!0);let l=Umt(i),f=l===((o=i.ownerDocument)==null?void 0:o.body),h=to(l);if(f){let v=bE(h);return e.concat(h,h.visualViewport||[],jy(l)?l:[],v&&t?Ky(v):[])}return e.concat(l,Ky(l,[],t))}function bE(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function Wmt(i){let e=Ms(i),t=parseFloat(e.width)||0,o=parseFloat(e.height)||0,l=pl(i),f=l?i.offsetWidth:t,h=l?i.offsetHeight:o,v=s1(t)!==f||s1(o)!==h;return v&&(t=f,o=h),{width:t,height:o,$:v}}function n4(i){return Ds(i)?i:i.contextElement}function Jy(i){let e=n4(i);if(!pl(e))return cl(1);let t=e.getBoundingClientRect(),{width:o,height:l,$:f}=Wmt(e),h=(f?s1(t.width):t.width)/o,v=(f?s1(t.height):t.height)/l;return(!h||!Number.isFinite(h))&&(h=1),(!v||!Number.isFinite(v))&&(v=1),{x:h,y:v}}var ZKt=cl(0);function Ymt(i){let e=to(i);return!SE()||!e.visualViewport?ZKt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function XKt(i,e,t){return e===void 0&&(e=!1),!t||e&&t!==to(i)?!1:e}function pd(i,e,t,o){e===void 0&&(e=!1),t===void 0&&(t=!1);let l=i.getBoundingClientRect(),f=n4(i),h=cl(1);e&&(o?Ds(o)&&(h=Jy(o)):h=Jy(i));let v=XKt(f,t,o)?Ymt(f):cl(0),g=(l.left+v.x)/h.x,y=(l.top+v.y)/h.y,x=l.width/h.x,b=l.height/h.y;if(f){let T=to(f),A=o&&Ds(o)?to(o):o,M=T,I=bE(M);for(;I&&o&&A!==M;){let E=Jy(I),O=I.getBoundingClientRect(),N=Ms(I),V=O.left+(I.clientLeft+parseFloat(N.paddingLeft))*E.x,F=O.top+(I.clientTop+parseFloat(N.paddingTop))*E.y;g*=E.x,y*=E.y,x*=E.x,b*=E.y,g+=V,y+=F,M=to(I),I=bE(M)}}return fd({width:x,height:b,x:g,y})}function a4(i,e){let t=h1(i).scrollLeft;return e?e.left+t:pd(hl(i)).left+t}function Zmt(i,e,t){t===void 0&&(t=!1);let o=i.getBoundingClientRect(),l=o.left+e.scrollLeft-(t?0:a4(i,o)),f=o.top+e.scrollTop;return{x:l,y:f}}function qKt(i){let{elements:e,rect:t,offsetParent:o,strategy:l}=i,f=l==="fixed",h=hl(o),v=e?c1(e.floating):!1;if(o===h||v&&f)return t;let g={scrollLeft:0,scrollTop:0},y=cl(1),x=cl(0),b=pl(o);if((b||!b&&!f)&&((cd(o)!=="body"||jy(h))&&(g=h1(o)),pl(o))){let A=pd(o);y=Jy(o),x.x=A.x+o.clientLeft,x.y=A.y+o.clientTop}let T=h&&!b&&!f?Zmt(h,g,!0):cl(0);return{width:t.width*y.x,height:t.height*y.y,x:t.x*y.x-g.scrollLeft*y.x+x.x+T.x,y:t.y*y.y-g.scrollTop*y.y+x.y+T.y}}function $Kt(i){return Array.from(i.getClientRects())}function KKt(i){let e=hl(i),t=h1(i),o=i.ownerDocument.body,l=wf(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),f=wf(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),h=-t.scrollLeft+a4(i),v=-t.scrollTop;return Ms(o).direction==="rtl"&&(h+=wf(e.clientWidth,o.clientWidth)-l),{width:l,height:f,x:h,y:v}}function jKt(i,e){let t=to(i),o=hl(i),l=t.visualViewport,f=o.clientWidth,h=o.clientHeight,v=0,g=0;if(l){f=l.width,h=l.height;let y=SE();(!y||y&&e==="fixed")&&(v=l.offsetLeft,g=l.offsetTop)}return{width:f,height:h,x:v,y:g}}var JKt=new Set(["absolute","fixed"]);function QKt(i,e){let t=pd(i,!0,e==="fixed"),o=t.top+i.clientTop,l=t.left+i.clientLeft,f=pl(i)?Jy(i):cl(1),h=i.clientWidth*f.x,v=i.clientHeight*f.y,g=l*f.x,y=o*f.y;return{width:h,height:v,x:g,y}}function Gmt(i,e,t){let o;if(e==="viewport")o=jKt(i,t);else if(e==="document")o=KKt(hl(i));else if(Ds(e))o=QKt(e,t);else{let l=Ymt(i);o={x:e.x-l.x,y:e.y-l.y,width:e.width,height:e.height}}return fd(o)}function Xmt(i,e){let t=Cf(i);return t===e||!Ds(t)||hd(t)?!1:Ms(t).position==="fixed"||Xmt(t,e)}function tjt(i,e){let t=e.get(i);if(t)return t;let o=Ky(i,[],!1).filter(v=>Ds(v)&&cd(v)!=="body"),l=null,f=Ms(i).position==="fixed",h=f?Cf(i):i;for(;Ds(h)&&!hd(h);){let v=Ms(h),g=xE(h);!g&&v.position==="fixed"&&(l=null),(f?!g&&!l:!g&&v.position==="static"&&!!l&&JKt.has(l.position)||jy(h)&&!g&&Xmt(i,h))?o=o.filter(x=>x!==h):l=v,h=Cf(h)}return e.set(i,o),o}function ejt(i){let{element:e,boundary:t,rootBoundary:o,strategy:l}=i,h=[...t==="clippingAncestors"?c1(e)?[]:tjt(e,this._c):[].concat(t),o],v=h[0],g=h.reduce((y,x)=>{let b=Gmt(e,x,l);return y.top=wf(b.top,y.top),y.right=$y(b.right,y.right),y.bottom=$y(b.bottom,y.bottom),y.left=wf(b.left,y.left),y},Gmt(e,v,l));return{width:g.right-g.left,height:g.bottom-g.top,x:g.left,y:g.top}}function rjt(i){let{width:e,height:t}=Wmt(i);return{width:e,height:t}}function ijt(i,e,t){let o=pl(e),l=hl(e),f=t==="fixed",h=pd(i,!0,f,e),v={scrollLeft:0,scrollTop:0},g=cl(0);function y(){g.x=a4(l)}if(o||!o&&!f)if((cd(e)!=="body"||jy(l))&&(v=h1(e)),o){let A=pd(e,!0,f,e);g.x=A.x+e.clientLeft,g.y=A.y+e.clientTop}else l&&y();f&&!o&&l&&y();let x=l&&!o&&!f?Zmt(l,v):cl(0),b=h.left+v.scrollLeft-g.x-x.x,T=h.top+v.scrollTop-g.y-x.y;return{x:b,y:T,width:h.width,height:h.height}}function i4(i){return Ms(i).position==="static"}function Hmt(i,e){if(!pl(i)||Ms(i).position==="fixed")return null;if(e)return e(i);let t=i.offsetParent;return hl(i)===t&&(t=t.ownerDocument.body),t}function qmt(i,e){let t=to(i);if(c1(i))return t;if(!pl(i)){let l=Cf(i);for(;l&&!hd(l);){if(Ds(l)&&!i4(l))return l;l=Cf(l)}return t}let o=Hmt(i,e);for(;o&&Bmt(o)&&i4(o);)o=Hmt(o,e);return o&&hd(o)&&i4(o)&&!xE(o)?t:o||Fmt(i)||t}var njt=async function(i){let e=this.getOffsetParent||qmt,t=this.getDimensions,o=await t(i.floating);return{reference:ijt(i.reference,await e(i.floating),i.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ajt(i){return Ms(i).direction==="rtl"}var ojt={convertOffsetParentRelativeRectToViewportRelativeRect:qKt,getDocumentElement:hl,getClippingRect:ejt,getOffsetParent:qmt,getElementRects:njt,getClientRects:$Kt,getDimensions:rjt,getScale:Jy,isElement:Ds,isRTL:ajt};function $mt(i,e){return i.x===e.x&&i.y===e.y&&i.width===e.width&&i.height===e.height}function sjt(i,e){let t=null,o,l=hl(i);function f(){var v;clearTimeout(o),(v=t)==null||v.disconnect(),t=null}function h(v,g){v===void 0&&(v=!1),g===void 0&&(g=1),f();let y=i.getBoundingClientRect(),{left:x,top:b,width:T,height:A}=y;if(v||e(),!T||!A)return;let M=l1(b),I=l1(l.clientWidth-(x+T)),E=l1(l.clientHeight-(b+A)),O=l1(x),V={rootMargin:-M+"px "+-I+"px "+-E+"px "+-O+"px",threshold:wf(0,$y(1,g))||1},F=!0;function U(H){let Y=H[0].intersectionRatio;if(Y!==g){if(!F)return h();Y?h(!1,Y):o=setTimeout(()=>{h(!1,1e-7)},1e3)}Y===1&&!$mt(y,i.getBoundingClientRect())&&h(),F=!1}try{t=new IntersectionObserver(U,{...V,root:l.ownerDocument})}catch{t=new IntersectionObserver(U,V)}t.observe(i)}return h(!0),f}function Kmt(i,e,t,o){o===void 0&&(o={});let{ancestorScroll:l=!0,ancestorResize:f=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:v=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,y=n4(i),x=l||f?[...y?Ky(y):[],...Ky(e)]:[];x.forEach(O=>{l&&O.addEventListener("scroll",t,{passive:!0}),f&&O.addEventListener("resize",t)});let b=y&&v?sjt(y,t):null,T=-1,A=null;h&&(A=new ResizeObserver(O=>{let[N]=O;N&&N.target===y&&A&&(A.unobserve(e),cancelAnimationFrame(T),T=requestAnimationFrame(()=>{var V;(V=A)==null||V.observe(e)})),t()}),y&&!g&&A.observe(y),A.observe(e));let M,I=g?pd(i):null;g&&E();function E(){let O=pd(i);I&&!$mt(I,O)&&t(),I=O,M=requestAnimationFrame(E)}return t(),()=>{var O;x.forEach(N=>{l&&N.removeEventListener("scroll",t),f&&N.removeEventListener("resize",t)}),b?.(),(O=A)==null||O.disconnect(),A=null,g&&cancelAnimationFrame(M)}}var jmt=kmt;var Jmt=Nmt,Qmt=Omt;var tyt=(i,e,t)=>{let o=new Map,l={platform:ojt,...t},f={...l.platform,_c:o};return Rmt(i,e,{...l,platform:f})};var p1,v1,wE,eyt,Qy=class extends mr{constructor(){super(...arguments);Te(this,wE);Te(this,p1,null);Te(this,v1,null)}initialize(){this.orient=this.orient.bind(this)}connect(){this.cleanup=Kmt(this.buttonTarget,this.menuTarget,this.orient)}disconnect(){this.cleanup()}show(e){e&&e.preventDefault(),this.menuTarget.showPopover({source:this.buttonTarget}),this.orient(),this.loadOperationDetailsIfNeeded()}hide(){this.menuTarget.hidePopover()}toggle(e){e.preventDefault(),this.menuTarget.togglePopover({source:this.buttonTarget}),this.orient(),this.loadOperationDetailsIfNeeded()}debouncedShow(){clearTimeout(Oe(this,v1)),Mr(this,p1,setTimeout(()=>this.show(),700))}debouncedHide(){clearTimeout(Oe(this,p1)),Mr(this,v1,setTimeout(()=>this.hide(),300))}orient(){tyt(this.buttonTarget,this.menuTarget,Oe(this,wE,eyt)).then(({x:e,y:t})=>{this.menuTarget.style.setProperty("--popover-x",`${e}px`),this.menuTarget.style.setProperty("--popover-y",`${t}px`),this.menuTarget.classList.add("positioned")})}loadOperationDetailsIfNeeded(){let e=this.menuTarget.dataset.operationUrl;if(!e)return;let t=this.menuTarget.querySelector("turbo-frame");!t||!this.hasLoadingContent(t)||(t.src=e)}hasLoadingContent(e){return(e.textContent||"").includes("Loading operation details")}};p1=new WeakMap,v1=new WeakMap,wE=new WeakSet,eyt=function(){return{placement:this.placementValue,middleware:[jmt(4),Qmt(),Jmt({padding:4})]}},Nt(Qy,"targets",["button","menu"]),Nt(Qy,"values",{placement:{type:String,default:"top"}});var d1=class extends mr{initialize(){this.search=this.debounce(this.search.bind(this),500)}debounce(i,e){let t;return function(...l){let f=()=>{clearTimeout(t),i(...l)};clearTimeout(t),t=setTimeout(f,e)}}submit(){this.element.requestSubmit()}search(){this.element.requestSubmit()}cancel(){this.cancelTarget?.click()}preventAttachment(i){i.preventDefault()}};Nt(d1,"targets",["cancel"]);var g1=class extends mr{connect(){this.initializeChart(),this.handleColorSchemeChange=this.onColorSchemeChange.bind(this),document.addEventListener("rails-pulse:color-scheme-changed",this.handleColorSchemeChange)}disconnect(){document.removeEventListener("rails-pulse:color-scheme-changed",this.handleColorSchemeChange),this.disposeChart()}initializeChart(){this.retryCount=0,this.maxRetries=100,this.attemptInit()}attemptInit(){if(typeof echarts>"u"){if(this.retryCount++,this.retryCount>=this.maxRetries){console.error("[RailsPulse] echarts not loaded after 5 seconds for",this.element.id),this.showError();return}setTimeout(()=>this.attemptInit(),50);return}this.renderChart()}renderChart(){try{this.chart=echarts.init(this.element,this.themeValue||"railspulse");let i=this.buildChartConfig();this.chart.setOption(i),this.applyColorScheme(),document.dispatchEvent(new CustomEvent("stimulus:echarts:rendered",{detail:{containerId:this.element.id,chart:this.chart,controller:this}})),this.resizeObserver=new ResizeObserver(()=>{this.chart&&this.chart.resize()}),this.resizeObserver.observe(this.element),this.element.setAttribute("data-chart-rendered","true")}catch(i){console.error("[RailsPulse] Error initializing chart:",i),this.showError()}}buildChartConfig(){let i={...this.optionsValue};return this.processFormatters(i),this.setChartData(i),i}setChartData(i){let e=this.dataValue,t=Object.keys(e).map(l=>{let f=Number(l);return isNaN(f)?l:f}),o=Object.values(e).map(l=>typeof l=="object"&&l!==null&&l.value!==void 0?l.value:l);if(i.xAxis=i.xAxis||{},i.xAxis.type="category",i.xAxis.data=t,i.yAxis=i.yAxis||{},i.yAxis.type="value",Array.isArray(i.series))i.series[0]=i.series[0]||{},i.series[0].type=this.typeValue,i.series[0].data=o;else if(i.series&&typeof i.series=="object"){let l={...i.series};i.series=[{type:this.typeValue,data:o,...l}]}else i.series=[{type:this.typeValue,data:o}]}processFormatters(i){i.tooltip?.formatter&&typeof i.tooltip.formatter=="string"&&(i.tooltip.formatter=this.parseFormatter(i.tooltip.formatter)),i.xAxis?.axisLabel?.formatter&&typeof i.xAxis.axisLabel.formatter=="string"&&(i.xAxis.axisLabel.formatter=this.parseFormatter(i.xAxis.axisLabel.formatter)),i.yAxis?.axisLabel?.formatter&&typeof i.yAxis.axisLabel.formatter=="string"&&(i.yAxis.axisLabel.formatter=this.parseFormatter(i.yAxis.axisLabel.formatter))}parseFormatter(formatterString){let cleanString=formatterString.replace(/__FUNCTION_START__|__FUNCTION_END__/g,"");if(cleanString.trim().startsWith("function"))try{return eval(`(${cleanString})`)}catch(i){return console.error("[RailsPulse] Error parsing formatter function:",i),cleanString}return cleanString}showError(){this.element.classList.add("chart-error"),this.element.innerHTML='<p class="text-subtle p-4">Chart failed to load</p>'}get chartInstance(){return this.chart}disposeChart(){this.resizeObserver&&this.resizeObserver.disconnect(),this.chart&&(this.chart.dispose(),this.chart=null)}update(i){if(i.detail?.data&&(this.dataValue=i.detail.data),i.detail?.options&&(this.optionsValue=i.detail.options),this.chart){let e=this.buildChartConfig();this.chart.setOption(e,!0)}}onColorSchemeChange(){this.applyColorScheme()}applyColorScheme(){if(!this.chart)return;let t=document.documentElement.getAttribute("data-color-scheme")==="dark"?"#ffffff":"#999999";this.chart.setOption({xAxis:{axisLabel:{color:t}},yAxis:{axisLabel:{color:t}}})}};Nt(g1,"values",{type:String,data:Object,options:Object,theme:String});var t0=class extends mr{constructor(){super(...arguments);Nt(this,"lastTurboFrameRequestAt",0);Nt(this,"pendingRequestTimeout",null);Nt(this,"pendingRequestData",null);Nt(this,"selectedColumnIndex",null);Nt(this,"originalSeriesOption",null)}connect(){this.handleChartInitialized=this.onChartInitialized.bind(this),document.addEventListener("stimulus:echarts:rendered",this.handleChartInitialized)}disconnect(){document.removeEventListener("stimulus:echarts:rendered",this.handleChartInitialized),this.hasChartTarget&&this.chartTarget&&(this.chartTarget.removeEventListener("mousedown",this.handleChartMouseDown),this.chartTarget.removeEventListener("mouseup",this.handleChartMouseUp)),document.removeEventListener("mouseup",this.handleDocumentMouseUp),this.pendingRequestTimeout&&clearTimeout(this.pendingRequestTimeout)}onChartInitialized(e){e.detail.containerId===this.chartIdValue&&(this.chart=e.detail.chart,this.setup())}setup(){if(this.setupDone)return;let e=!1;try{e=!!this.chartTarget}catch{e=!1}!e||!this.chart||(this.visibleData=this.getVisibleData(),this.storeOriginalSeriesOption(),this.setupChartEventListeners(),this.setupDone=!0,e&&document.getElementById(this.chartIdValue)?.setAttribute("data-chart-rendered","true"),this.initializeColumnSelectionFromUrl())}setupChartEventListeners(){this.handleChartMouseDown=()=>{this.visibleData=this.getVisibleData()},this.chartTarget.addEventListener("mousedown",this.handleChartMouseDown),this.handleChartMouseUp=()=>{this.handleZoomChange()},this.chartTarget.addEventListener("mouseup",this.handleChartMouseUp),this.chart.on("datazoom",()=>{this.handleZoomChange()}),this.handleDocumentMouseUp=()=>{this.handleZoomChange()},document.addEventListener("mouseup",this.handleDocumentMouseUp),this.chart.on("click",e=>{this.handleColumnClick(e)})}getVisibleData(){try{let e=this.chart.getOption();if(!e.dataZoom||e.dataZoom.length===0)return{xAxis:[],series:[]};let t=e.dataZoom[1]||e.dataZoom[0];if(!e.xAxis||!e.xAxis[0]||!e.xAxis[0].data)return{xAxis:[],series:[]};if(!e.series||!e.series[0]||!e.series[0].data)return{xAxis:[],series:[]};let o=e.xAxis[0].data,l=e.series[0].data,f=t.startValue||0,h=t.endValue||o.length-1;return{xAxis:o.slice(f,h+1),series:l.slice(f,h+1)}}catch{return{xAxis:[],series:[]}}}handleZoomChange(){let e=this.getVisibleData(),t=e.xAxis.join(),o=this.visibleData.xAxis.join();t!==o&&(this.visibleData=e,this.updateUrlWithZoomParams(e),this.sendTurboFrameRequest(e))}updateUrlWithZoomParams(e){let t=new URL(window.location.href),o=new URLSearchParams(t.search),l=e.xAxis[0],f=e.xAxis[e.xAxis.length-1];o.set("zoom_start_time",l),o.set("zoom_end_time",f),t.search=o.toString(),window.history.replaceState({},"",t)}updatePaginationLimit(){if(!this.hasPaginationLimitTarget)return;let e=new URL(window.location.href),t=new URLSearchParams(e.search),o=this.paginationLimitTarget.value;t.set("limit",o),e.search=t.toString(),window.history.replaceState({},"",e)}sendTurboFrameRequest(e){let o=Date.now()-this.lastTurboFrameRequestAt;if(this.pendingRequestData=e,this.pendingRequestTimeout&&clearTimeout(this.pendingRequestTimeout),o>=1e3)this.executeTurboFrameRequest(e);else{let l=1e3-o;this.pendingRequestTimeout=setTimeout(()=>{this.executeTurboFrameRequest(this.pendingRequestData),this.pendingRequestTimeout=null},l)}}executeTurboFrameRequest(e){this.lastTurboFrameRequestAt=Date.now();let t=new URL(window.location.href),o=new URLSearchParams(t.search),l=e.xAxis[0],f=e.xAxis[e.xAxis.length-1];o.set("zoom_start_time",l),o.set("zoom_end_time",f),this.hasPaginationLimitTarget&&o.set("limit",this.paginationLimitTarget.value),t.search=o.toString(),fetch(t,{method:"GET",headers:{Accept:"text/vnd.turbo-stream.html, text/html","Turbo-Frame":this.indexTableTarget.id,"X-Requested-With":"XMLHttpRequest"}}).then(h=>h.text()).then(h=>{let v=this.indexTableTarget;if(v){let x=new DOMParser().parseFromString(h,"text/html").querySelector(`turbo-frame#${v.id}`);x?this.replaceFrameContent(v,x):this.replaceFrameContentFromHTML(v,h)}}).catch(h=>console.error("[IndexController] Fetch error:",h))}replaceFrameContent(e,t){try{for(;e.firstChild;)e.removeChild(e.firstChild);Array.from(t.childNodes).forEach(l=>{let f=l.cloneNode(!0);e.appendChild(f)})}catch(o){console.error("Error replacing frame content:",o),e.innerHTML=t.innerHTML}}replaceFrameContentFromHTML(e,t){try{let l=new DOMParser().parseFromString(t,"text/html");for(;e.firstChild;)e.removeChild(e.firstChild);Array.from(l.body.childNodes).forEach(h=>{let v=h.cloneNode(!0);e.appendChild(v)})}catch(o){console.error("Error parsing HTML content:",o),e.innerHTML=t}}handleColumnClick(e){let t=e.dataIndex;this.selectedColumnIndex===t?(this.resetColumnColors(),this.selectedColumnIndex=null,this.sendColumnDeselectionRequest()):(this.highlightColumn(t),this.selectedColumnIndex=t,this.sendColumnSelectionRequest(t))}highlightColumn(e){try{let t=this.chart.getOption();if(!t.series||!t.series[0]||!t.series[0].data)return;let o=t.series[0].data,f=this.chart.getOption().color?.[0]||"#5470c6";this.chart.setOption({series:[{data:o,itemStyle:{color:h=>h.dataIndex===e?f:"#cccccc"}}]})}catch(t){console.error("Error highlighting column:",t)}}storeOriginalSeriesOption(){try{let e=this.chart.getOption();if(e.series&&e.series[0]){let t=JSON.parse(JSON.stringify(e.series[0]));t.itemStyle&&typeof t.itemStyle.color=="function"&&delete t.itemStyle.color,this.originalSeriesOption=t}}catch(e){console.error("Error storing original series option:",e)}}resetColumnColors(){try{if(!this.originalSeriesOption){console.warn("No original series option stored, cannot reset properly");return}let t=this.chart.getOption().series[0].data,o={...this.originalSeriesOption,data:t};o.itemStyle||(o.itemStyle={}),o.itemStyle.color="#ffc91f",this.chart.setOption({series:[o]},!1)}catch(e){console.error("Error resetting column colors:",e)}}sendColumnSelectionRequest(e){let l=this.chart.getOption().xAxis[0].data[e];if(!l){console.error("Could not find timestamp for column index:",e);return}let f=new URL(window.location.href),h=new URLSearchParams(f.search);h.set("selected_column_time",l),this.hasPaginationLimitTarget&&h.set("limit",this.paginationLimitTarget.value),f.search=h.toString(),window.history.replaceState({},"",f),this.executeTurboFrameRequestForColumn(f)}sendColumnDeselectionRequest(){let e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("selected_column_time"),this.hasPaginationLimitTarget&&t.set("limit",this.paginationLimitTarget.value),e.search=t.toString(),window.history.replaceState({},"",e),this.executeTurboFrameRequestForColumn(e)}executeTurboFrameRequestForColumn(e){fetch(e,{method:"GET",headers:{Accept:"text/vnd.turbo-stream.html, text/html","Turbo-Frame":this.indexTableTarget.id,"X-Requested-With":"XMLHttpRequest"}}).then(t=>t.text()).then(t=>{let o=this.indexTableTarget;if(o){let h=new DOMParser().parseFromString(t,"text/html").querySelector(`turbo-frame#${o.id}`);h?this.replaceFrameContent(o,h):this.replaceFrameContentFromHTML(o,t)}}).catch(t=>console.error("[IndexController] Column selection fetch error:",t))}initializeColumnSelectionFromUrl(){let t=new URLSearchParams(window.location.search).get("selected_column_time");if(t){let o=this.chart.getOption();if(!o.xAxis||!o.xAxis[0]||!o.xAxis[0].data)return;let l=o.xAxis[0].data,f=l.findIndex(h=>h.toString()===t);if(f===-1){let h=parseInt(t);f=l.findIndex(v=>parseInt(v)===h)}f!==-1&&(this.selectedColumnIndex=f,requestAnimationFrame(()=>{this.highlightColumn(f)}))}}};Nt(t0,"targets",["chart","paginationLimit","indexTable"]),Nt(t0,"values",{chartId:String});var TE=class extends mr{connect(){this.storageKey="color-scheme",this.html=document.documentElement;let i=localStorage.getItem(this.storageKey);i&&this.html.setAttribute("data-color-scheme",i)}toggle(i){i.preventDefault();let e=this.html.getAttribute("data-color-scheme")==="dark"?"light":"dark";this.html.setAttribute("data-color-scheme",e),localStorage.setItem(this.storageKey,e),document.dispatchEvent(new CustomEvent("rails-pulse:color-scheme-changed",{detail:{scheme:e}}))}};var e0=class extends mr{connect(){this.restorePaginationLimit()}updateLimit(){let i=this.limitTarget.value;sessionStorage.setItem(this.storageKeyValue,i);let e=new URL(window.location);e.searchParams.set("limit",i),e.searchParams.delete("page"),typeof Turbo<"u"?Turbo.visit(e.toString(),{action:"replace"}):window.location.href=e.toString()}restorePaginationLimit(){let e=new URLSearchParams(window.location.search).get("limit");if(e&&this.limitTarget)sessionStorage.setItem(this.storageKeyValue,e),this.limitTarget.value!==e&&(this.limitTarget.value=e);else{let t=sessionStorage.getItem(this.storageKeyValue);t&&this.limitTarget&&this.limitTarget.value!==t&&(this.limitTarget.value=t)}}};Nt(e0,"targets",["limit"]),Nt(e0,"values",{storageKey:{type:String,default:"rails_pulse_pagination_limit"}});var m1=class extends mr{connect(){this.updateTimestamp(),this.setupObserver(),this.setupTurboFrameListener()}disconnect(){this.observer&&this.observer.disconnect(),this.frameObserver&&this.frameObserver.disconnect(),this.documentObserver&&this.documentObserver.disconnect(),this.turboFrameListener&&document.removeEventListener("turbo:frame-load",this.turboFrameListener)}setupObserver(){if(this.targetFrameValue){this.updateTimestamp();let i=new MutationObserver(()=>{let e=document.getElementById(this.targetFrameValue);e&&(this.updateTimestamp(),this.frameObserver&&this.frameObserver.disconnect(),this.frameObserver=new MutationObserver(()=>{this.updateTimestamp()}),this.frameObserver.observe(e,{attributes:!0,attributeFilter:["data-cached-at"],childList:!0,subtree:!0}))});i.observe(document.body,{childList:!0,subtree:!0}),this.documentObserver=i}}cachedAtValueChanged(){this.updateTimestamp()}setupTurboFrameListener(){this.targetFrameValue&&(this.turboFrameListener=i=>{i.target&&i.target.id===this.targetFrameValue&&this.updateTimestamp()},document.addEventListener("turbo:frame-load",this.turboFrameListener))}updateTimestamp(){let i=this.cachedAtValue;if(!i&&this.targetFrameValue){let e=document.getElementById(this.targetFrameValue);e&&(i=e.dataset.cachedAt)}if(i)try{let t=new Date(i).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0});this.element.title=`Last updated: ${t}`}catch{this.element.title="Cache time unavailable"}else this.element.title="Cache time unavailable"}};Nt(m1,"values",{cachedAt:String,targetFrame:String});var r0=class extends mr{connect(){this.renderIcon()}nameValueChanged(){this.renderIcon()}renderIcon(){this.clearIcon(),this.element.classList.add(...this.loadingClasses),this.element.classList.remove(...this.errorClasses,...this.loadedClasses);let i=this.nameValue;if(!i){this.handleError("Icon name is required");return}if(!window.RailsPulseIcons){this.handleError("RailsPulseIcons not loaded");return}let e=window.RailsPulseIcons.get(i);if(!e){this.handleError(`Icon '${i}' not found`);return}try{let t=this.createSVGElement(e);this.element.appendChild(t),this.element.classList.remove(...this.loadingClasses,...this.errorClasses),this.element.classList.add(...this.loadedClasses),this.element.setAttribute("aria-label",`${i} icon`)}catch(t){this.handleError(`Failed to render icon '${i}': ${t.message}`)}}createSVGElement(i){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.setAttribute("width",this.widthValue||"24"),e.setAttribute("height",this.heightValue||"24"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width",this.strokeWidthValue||"2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),window.RailsPulseIcons.render){let f=document.createElement("div");if(window.RailsPulseIcons.render(this.nameValue,f,{width:this.widthValue||"24",height:this.heightValue||"24"})&&f.firstChild)return f.firstChild}let l=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="${this.widthValue||"24"}" height="${this.heightValue||"24"}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${this.strokeWidthValue||"2"}" stroke-linecap="round" stroke-linejoin="round">${i}</svg>`,"image/svg+xml").documentElement;if(l.nodeName==="parsererror")throw new Error("Invalid SVG content");return document.importNode(l,!0)}clearIcon(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild)}handleError(i){console.warn(`[Rails Pulse Icon Controller] ${i}`),this.clearIcon(),this.element.classList.remove(...this.loadingClasses,...this.loadedClasses),this.element.classList.add(...this.errorClasses),this.createErrorPlaceholder(),this.element.setAttribute("aria-label","Icon not available")}createErrorPlaceholder(){let i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("width",this.widthValue||"24"),i.setAttribute("height",this.heightValue||"24"),i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("fill","currentColor"),i.setAttribute("opacity","0.3");let e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("width","20"),e.setAttribute("height","20"),e.setAttribute("x","2"),e.setAttribute("y","2"),e.setAttribute("rx","2"),i.appendChild(e),this.element.appendChild(i)}listAvailableIcons(){window.RailsPulseIcons?.list?console.log("Available icons:",window.RailsPulseIcons.list()):console.warn("RailsPulseIcons not loaded or list method not available")}};Nt(r0,"values",{name:String,width:String,height:String,strokeWidth:String}),Nt(r0,"classes",["loading","error","loaded"]);var CE=class extends mr{toggle(i){let e=i.target.closest("tr");if(!e||e.closest("tbody")!==this.element||e.classList.contains("operation-details-row"))return;let t=i.target.closest("td,th");if(t&&t.parentElement===e&&t.cellIndex===e.cells.length-1)return;i.preventDefault(),i.stopPropagation();let o=e.nextElementSibling;if(!o||o.tagName!=="TR"||!o.classList.contains("operation-details-row"))return;o.classList.contains("hidden")?this.expand(e,o):this.collapse(e,o)}expand(i,e){e.classList.remove("hidden");let t=i.querySelector(".chevron");t&&(t.style.transform="rotate(90deg)"),i.classList.add("expanded");let o=e.querySelector("turbo-frame");if(o&&!o.getAttribute("src")){let l=o.dataset.operationUrl;l&&o.setAttribute("src",l)}}collapse(i,e){e.classList.add("hidden");let t=i.querySelector(".chevron");t&&(t.style.transform="rotate(0deg)"),i.classList.remove("expanded")}};var i0=class extends mr{connect(){this.collapse()}toggle(){this.element.classList.contains(this.collapsedClass)?this.expand():this.collapse()}collapse(){this.element.classList.add(this.collapsedClass),this.hasToggleTarget&&(this.toggleTarget.textContent="show more")}expand(){this.element.classList.remove(this.collapsedClass),this.hasToggleTarget&&(this.toggleTarget.textContent="show less")}};Nt(i0,"targets",["content","toggle"]),Nt(i0,"classes",["collapsed"]);var AE=class extends mr{updateUrl(i){let t=i.currentTarget.getAttribute("href");t&&window.history.replaceState({},"",t)}};var n0=class extends mr{connect(){this.updateIndicator()}open(i){if(i.preventDefault(),this.dateRangeTarget.value){let e=this.application.getControllerForElementAndIdentifier(this.dateRangeTarget,"rails-pulse--datepicker");if(e&&e.flatpickr){let t=this.dateRangeTarget.value;if(t.includes(" to ")){let[o,l]=t.split(" to ").map(f=>f.trim());e.flatpickr.setDate([o,l],!1)}}}this.wrapperTarget.style.display="flex",document.body.style.overflow="hidden"}close(i){i&&i.preventDefault(),this.wrapperTarget.style.display="none",document.body.style.overflow=""}closeOnClickOutside(i){i.target===this.wrapperTarget&&this.close(i)}submit(i){if(i.submitter&&i.submitter.name==="clear")return;let e=this.dateRangeTarget.value,t=i.target;if(e&&e.includes(" to ")){let[o,l]=e.split(" to ").map(v=>v.trim());t.querySelectorAll('input[name="start_time"], input[name="end_time"]').forEach(v=>v.remove());let f=document.createElement("input");f.type="hidden",f.name="start_time",f.value=o,t.appendChild(f);let h=document.createElement("input");h.type="hidden",h.name="end_time",h.value=l,t.appendChild(h)}}updateIndicator(){this.hasIndicatorTarget&&(this.activeValue?this.indicatorTarget.classList.add("global-filters-active"):this.indicatorTarget.classList.remove("global-filters-active"))}activeValueChanged(){this.updateIndicator()}};Nt(n0,"targets",["wrapper","dialog","dateRange","indicator","form"]),Nt(n0,"values",{active:{type:Boolean,default:!1}});var y1=class extends mr{connect(){let i=this.selectWrapperTarget.querySelector("select");if(!i)return;i.dataset.mode==="recent_custom"?i.value==="custom"&&(this.showPicker(),this.initializeDatePicker()):i.value==="custom"&&(this.showPicker(),this.initializeDatePicker())}handleChange(i){i.target.dataset.mode==="recent_custom"?i.target.value==="custom"?(this.showPicker(),this.openDatePicker()):(this.pickerWrapperTarget.style.display="none",this.selectWrapperTarget.style.display="block"):i.target.value==="custom"&&(this.showPicker(),this.openDatePicker())}showPicker(){this.selectWrapperTarget.style.display="none",this.pickerWrapperTarget.style.display="flex"}openDatePicker(){setTimeout(()=>{let i=this.pickerWrapperTarget.querySelector('input[name*="custom_date_range"]');if(!i)return;let e=this.application.getControllerForElementAndIdentifier(i,"rails-pulse--datepicker");e&&e.flatpickr&&e.flatpickr.open()},50)}showSelect(){this.pickerWrapperTarget.style.display="none",this.selectWrapperTarget.style.display="block";let i=this.selectWrapperTarget.querySelector("select");i&&(i.dataset.mode==="recent_custom"?i.value="recent":i.value="last_day")}initializeDatePicker(){let i=this.pickerWrapperTarget.querySelector('input[type="text"]');if(!i||!i.value)return;let e=this.application.getControllerForElementAndIdentifier(i,"rails-pulse--datepicker");if(e&&e.flatpickr){let t=i.value;if(t.includes(" to ")){let[o,l]=t.split(" to ").map(f=>f.trim());e.flatpickr.setDate([o,l],!1)}}}};Nt(y1,"targets",["selectWrapper","pickerWrapper"]);var qi=tE.start();qi.debug=!1;window.Stimulus=qi;window.echarts=R3;window.Turbo=SW;qi.register("rails-pulse--context-menu",t1);qi.register("rails-pulse--datepicker",Yy);qi.register("rails-pulse--dialog",a1);qi.register("rails-pulse--menu",Zy);qi.register("rails-pulse--popover",Qy);qi.register("rails-pulse--form",d1);qi.register("rails-pulse--chart",g1);qi.register("rails-pulse--index",t0);qi.register("rails-pulse--color-scheme",TE);qi.register("rails-pulse--pagination",e0);qi.register("rails-pulse--timezone",m1);qi.register("rails-pulse--icon",r0);qi.register("rails-pulse--expandable-rows",CE);qi.register("rails-pulse--collapsible",i0);qi.register("rails-pulse--table-sort",AE);qi.register("rails-pulse--global-filters",n0);qi.register("rails-pulse--custom-range",y1);document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("turbo-frame[src]:not([complete])").forEach(e=>{let t=e.getAttribute("src");t&&(e.removeAttribute("src"),setTimeout(()=>e.setAttribute("src",t),10))})});var ljt=new MutationObserver(i=>{i.forEach(e=>{e.type==="childList"&&e.addedNodes.forEach(t=>{if(t.nodeType===1&&t.tagName==="TURBO-FRAME"&&t.hasAttribute("src")&&!t.hasAttribute("complete")){let o=t.getAttribute("src");o&&(t.removeAttribute("src"),setTimeout(()=>t.setAttribute("src",o),10))}})})});ljt.observe(document.body,{childList:!0,subtree:!0});CS("railspulse",{color:["#ffc91f","#ffde66","#fbedbf"],backgroundColor:"rgba(255,255,255,0)",textStyle:{},title:{textStyle:{color:"#666666"}},line:{lineStyle:{width:"3"},symbolSize:"8"},bar:{itemStyle:{barBorderWidth:0}}});window.RailsPulse={application:qi,version:"1.0.0"};})();
|
|
127
|
+
`}}function Ot(){t.calendarContainer.classList.add("hasWeeks");var pt=kr("div","flatpickr-weekwrapper");pt.appendChild(kr("span","flatpickr-weekday",t.l10n.weekAbbreviation));var ut=kr("div","flatpickr-weeks");return pt.appendChild(ut),{weekWrapper:pt,weekNumbers:ut}}function Mt(pt,ut){ut===void 0&&(ut=!0);var bt=ut?pt:pt-t.currentMonth;bt<0&&t._hidePrevMonthArrow===!0||bt>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=bt,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Yr("onYearChange"),ot()),at(),Yr("onMonthChange"),gd())}function qt(pt,ut){if(pt===void 0&&(pt=!0),ut===void 0&&(ut=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,ut===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var bt=lE(t.config),Rt=bt.hours,le=bt.minutes,de=bt.seconds;A(Rt,le,de)}t.redraw(),pt&&Yr("onChange")}function Qt(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Yr("onClose")}function ne(){t.config!==void 0&&Yr("onDestroy");for(var pt=t._handlers.length;pt--;)t._handlers[pt].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var ut=t.calendarContainer.parentNode;if(ut.lastChild&&ut.removeChild(ut.lastChild),ut.parentNode){for(;ut.firstChild;)ut.parentNode.insertBefore(ut.firstChild,ut);ut.parentNode.removeChild(ut)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(bt){try{delete t[bt]}catch{}})}function j(pt){return t.calendarContainer.contains(pt)}function Dt(pt){if(t.isOpen&&!t.config.inline){var ut=Ja(pt),bt=j(ut),Rt=ut===t.input||ut===t.altInput||t.element.contains(ut)||pt.path&&pt.path.indexOf&&(~pt.path.indexOf(t.input)||~pt.path.indexOf(t.altInput)),le=!Rt&&!bt&&!j(pt.relatedTarget),de=!t.config.ignoredFocusElements.some(function(He){return He.contains(ut)});le&&de&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&g(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function hr(pt){if(!(!pt||t.config.minDate&&pt<t.config.minDate.getFullYear()||t.config.maxDate&&pt>t.config.maxDate.getFullYear())){var ut=pt,bt=t.currentYear!==ut;t.currentYear=ut||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),bt&&(t.redraw(),Yr("onYearChange"),ot())}}function jt(pt,ut){var bt;ut===void 0&&(ut=!0);var Rt=t.parseDate(pt,void 0,ut);if(t.config.minDate&&Rt&&Qa(Rt,t.config.minDate,ut!==void 0?ut:!t.minDateHasTime)<0||t.config.maxDate&&Rt&&Qa(Rt,t.config.maxDate,ut!==void 0?ut:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(Rt===void 0)return!1;for(var le=!!t.config.enable,de=(bt=t.config.enable)!==null&&bt!==void 0?bt:t.config.disable,He=0,Se=void 0;He<de.length;He++){if(Se=de[He],typeof Se=="function"&&Se(Rt))return le;if(Se instanceof Date&&Rt!==void 0&&Se.getTime()===Rt.getTime())return le;if(typeof Se=="string"){var pr=t.parseDate(Se,void 0,!0);return pr&&pr.getTime()===Rt.getTime()?le:!le}else if(typeof Se=="object"&&Rt!==void 0&&Se.from&&Se.to&&Rt.getTime()>=Se.from.getTime()&&Rt.getTime()<=Se.to.getTime())return le}return!le}function me(pt){return t.daysContainer!==void 0?pt.className.indexOf("hidden")===-1&&pt.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(pt):!1}function Jt(pt){var ut=pt.target===t._input,bt=t._input.value.trimEnd()!==md();ut&&bt&&!(pt.relatedTarget&&j(pt.relatedTarget))&&t.setDate(t._input.value,!0,pt.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function he(pt){var ut=Ja(pt),bt=t.config.wrap?i.contains(ut):ut===t._input,Rt=t.config.allowInput,le=t.isOpen&&(!Rt||!bt),de=t.config.inline&&bt&&!Rt;if(pt.keyCode===13&&bt){if(Rt)return t.setDate(t._input.value,!0,ut===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),ut.blur();t.open()}else if(j(ut)||le||de){var He=!!t.timeContainer&&t.timeContainer.contains(ut);switch(pt.keyCode){case 13:He?(pt.preventDefault(),g(),ro()):a0(pt);break;case 27:pt.preventDefault(),ro();break;case 8:case 46:bt&&!t.config.allowInput&&(pt.preventDefault(),t.clear());break;case 37:case 39:if(!He&&!bt){pt.preventDefault();var Se=f();if(t.daysContainer!==void 0&&(Rt===!1||Se&&me(Se))){var pr=pt.keyCode===39?1:-1;pt.ctrlKey?(pt.stopPropagation(),Mt(pr),Q($(1),0)):Q(void 0,pr)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:pt.preventDefault();var Ie=pt.keyCode===40?1:-1;t.daysContainer&&ut.$i!==void 0||ut===t.input||ut===t.altInput?pt.ctrlKey?(pt.stopPropagation(),hr(t.currentYear-Ie),Q($(1),0)):He||Q(void 0,Ie*7):ut===t.currentYearElement?hr(t.currentYear-Ie):t.config.enableTime&&(!He&&t.hourElement&&t.hourElement.focus(),g(pt),t._debouncedChange());break;case 9:if(He){var Ke=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Qn){return Qn}),xr=Ke.indexOf(ut);if(xr!==-1){var In=Ke[xr+(pt.shiftKey?-1:1)];pt.preventDefault(),(In||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(ut)&&pt.shiftKey&&(pt.preventDefault(),t._input.focus());break;default:break}}if(t.amPM!==void 0&&ut===t.amPM)switch(pt.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],b(),ie();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],b(),ie();break}(bt||j(ut))&&Yr("onKeyDown",pt)}function It(pt,ut){if(ut===void 0&&(ut="flatpickr-day"),!(t.selectedDates.length!==1||pt&&(!pt.classList.contains(ut)||pt.classList.contains("flatpickr-disabled")))){for(var bt=pt?pt.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),Rt=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),le=Math.min(bt,t.selectedDates[0].getTime()),de=Math.max(bt,t.selectedDates[0].getTime()),He=!1,Se=0,pr=0,Ie=le;Ie<de;Ie+=mmt.DAY)jt(new Date(Ie),!0)||(He=He||Ie>le&&Ie<de,Ie<Rt&&(!Se||Ie>Se)?Se=Ie:Ie>Rt&&(!pr||Ie<pr)&&(pr=Ie));var Ke=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+ut));Ke.forEach(function(xr){var In=xr.dateObj,Qn=In.getTime(),pu=Se>0&&Qn<Se||pr>0&&Qn>pr;if(pu){xr.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Mf){xr.classList.remove(Mf)});return}else if(He&&!pu)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Mf){xr.classList.remove(Mf)}),pt!==void 0&&(pt.classList.add(bt<=t.selectedDates[0].getTime()?"startRange":"endRange"),Rt<bt&&Qn===Rt?xr.classList.add("startRange"):Rt>bt&&Qn===Rt&&xr.classList.add("endRange"),Qn>=Se&&(pr===0||Qn<=pr)&&dmt(Qn,Rt,bt)&&xr.classList.add("inRange"))})}}function ae(){t.isOpen&&!t.config.static&&!t.config.inline&&re()}function At(pt,ut){if(ut===void 0&&(ut=t._positionElement),t.isMobile===!0){if(pt){pt.preventDefault();var bt=Ja(pt);bt&&bt.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Yr("onOpen");return}else if(t._input.disabled||t.config.inline)return;var Rt=t.isOpen;t.isOpen=!0,Rt||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Yr("onOpen"),re(ut)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(pt===void 0||!t.timeContainer.contains(pt.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function Wt(pt){return function(ut){var bt=t.config["_"+pt+"Date"]=t.parseDate(ut,t.config.dateFormat),Rt=t.config["_"+(pt==="min"?"max":"min")+"Date"];bt!==void 0&&(t[pt==="min"?"minDateHasTime":"maxDateHasTime"]=bt.getHours()>0||bt.getMinutes()>0||bt.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(le){return jt(le)}),!t.selectedDates.length&&pt==="min"&&T(bt),ie()),t.daysContainer&&(_a(),bt!==void 0?t.currentYearElement[pt]=bt.getFullYear().toString():t.currentYearElement.removeAttribute(pt),t.currentYearElement.disabled=!!Rt&&bt!==void 0&&Rt.getFullYear()===bt.getFullYear())}}function Bt(){var pt=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],ut=Jn(Jn({},JSON.parse(JSON.stringify(i.dataset||{}))),e),bt={};t.config.parseDate=ut.parseDate,t.config.formatDate=ut.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ke){t.config._enable=Ln(Ke)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ke){t.config._disable=Ln(Ke)}});var Rt=ut.mode==="time";if(!ut.dateFormat&&(ut.enableTime||Rt)){var le=Xi.defaultConfig.dateFormat||yh.dateFormat;bt.dateFormat=ut.noCalendar||Rt?"H:i"+(ut.enableSeconds?":S":""):le+" H:i"+(ut.enableSeconds?":S":"")}if(ut.altInput&&(ut.enableTime||Rt)&&!ut.altFormat){var de=Xi.defaultConfig.altFormat||yh.altFormat;bt.altFormat=ut.noCalendar||Rt?"h:i"+(ut.enableSeconds?":S K":" K"):de+(" h:i"+(ut.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Wt("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Wt("max")});var He=function(Ke){return function(xr){t.config[Ke==="min"?"_minTime":"_maxTime"]=t.parseDate(xr,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:He("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:He("max")}),ut.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,bt,ut);for(var Se=0;Se<pt.length;Se++)t.config[pt[Se]]=t.config[pt[Se]]===!0||t.config[pt[Se]]==="true";rE.filter(function(Ke){return t.config[Ke]!==void 0}).forEach(function(Ke){t.config[Ke]=aE(t.config[Ke]||[]).map(h)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Se=0;Se<t.config.plugins.length;Se++){var pr=t.config.plugins[Se](t)||{};for(var Ie in pr)rE.indexOf(Ie)>-1?t.config[Ie]=aE(pr[Ie]).map(h).concat(t.config[Ie]):typeof ut[Ie]>"u"&&(t.config[Ie]=pr[Ie])}ut.altInputClass||(t.config.altInputClass=Jr().className+" "+t.config.altInputClass),Yr("onParseConfig")}function Jr(){return t.config.wrap?i.querySelector("[data-input]"):i}function Ge(){typeof t.config.locale!="object"&&typeof Xi.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Jn(Jn({},Xi.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Xi.l10ns[t.config.locale]:void 0),bf.D="("+t.l10n.weekdays.shorthand.join("|")+")",bf.l="("+t.l10n.weekdays.longhand.join("|")+")",bf.M="("+t.l10n.months.shorthand.join("|")+")",bf.F="("+t.l10n.months.longhand.join("|")+")",bf.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var pt=Jn(Jn({},e),JSON.parse(JSON.stringify(i.dataset||{})));pt.time_24hr===void 0&&Xi.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=KW(t),t.parseDate=oE({config:t.config,l10n:t.l10n})}function re(pt){if(typeof t.config.position=="function")return void t.config.position(t,pt);if(t.calendarContainer!==void 0){Yr("onPreCalendarPosition");var ut=pt||t._positionElement,bt=Array.prototype.reduce.call(t.calendarContainer.children,function(gl,LE){return gl+LE.offsetHeight},0),Rt=t.calendarContainer.offsetWidth,le=t.config.position.split(" "),de=le[0],He=le.length>1?le[1]:null,Se=ut.getBoundingClientRect(),pr=window.innerHeight-Se.bottom,Ie=de==="above"||de!=="below"&&pr<bt&&Se.top>bt,Ke=window.pageYOffset+Se.top+(Ie?-bt-2:ut.offsetHeight+2);if(jn(t.calendarContainer,"arrowTop",!Ie),jn(t.calendarContainer,"arrowBottom",Ie),!t.config.inline){var xr=window.pageXOffset+Se.left,In=!1,Qn=!1;He==="center"?(xr-=(Rt-Se.width)/2,In=!0):He==="right"&&(xr-=Rt-Se.width,Qn=!0),jn(t.calendarContainer,"arrowLeft",!In&&!Qn),jn(t.calendarContainer,"arrowCenter",In),jn(t.calendarContainer,"arrowRight",Qn);var pu=window.document.body.offsetWidth-(window.pageXOffset+Se.right),Mf=xr+Rt>window.document.body.offsetWidth,DE=pu+Rt>window.document.body.offsetWidth;if(jn(t.calendarContainer,"rightMost",Mf),!t.config.static)if(t.calendarContainer.style.top=Ke+"px",!Mf)t.calendarContainer.style.left=xr+"px",t.calendarContainer.style.right="auto";else if(!DE)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=pu+"px";else{var s0=eo();if(s0===void 0)return;var ME=window.document.body.offsetWidth,Sh=Math.max(0,ME/2-Rt/2),vu=".flatpickr-calendar.centerMost:before",yd=".flatpickr-calendar.centerMost:after",Ls=s0.cssRules.length,S1="{left:"+Se.left+"px;right:auto;}";jn(t.calendarContainer,"rightMost",!1),jn(t.calendarContainer,"centerMost",!0),s0.insertRule(vu+","+yd+S1,Ls),t.calendarContainer.style.left=Sh+"px",t.calendarContainer.style.right="auto"}}}}function eo(){for(var pt=null,ut=0;ut<document.styleSheets.length;ut++){var bt=document.styleSheets[ut];if(bt.cssRules){try{bt.cssRules}catch{continue}pt=bt;break}}return pt??ri()}function ri(){var pt=document.createElement("style");return document.head.appendChild(pt),pt.sheet}function _a(){t.config.noCalendar||t.isMobile||(ot(),gd(),at())}function ro(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function a0(pt){pt.preventDefault(),pt.stopPropagation();var ut=function(Ke){return Ke.classList&&Ke.classList.contains("flatpickr-day")&&!Ke.classList.contains("flatpickr-disabled")&&!Ke.classList.contains("notAllowed")},bt=qW(Ja(pt),ut);if(bt!==void 0){var Rt=bt,le=t.latestSelectedDateObj=new Date(Rt.dateObj.getTime()),de=(le.getMonth()<t.currentMonth||le.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=Rt,t.config.mode==="single")t.selectedDates=[le];else if(t.config.mode==="multiple"){var He=o0(le);He?t.selectedDates.splice(parseInt(He),1):t.selectedDates.push(le)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=le,t.selectedDates.push(le),Qa(le,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ke,xr){return Ke.getTime()-xr.getTime()}));if(b(),de){var Se=t.currentYear!==le.getFullYear();t.currentYear=le.getFullYear(),t.currentMonth=le.getMonth(),Se&&(Yr("onYearChange"),ot()),Yr("onMonthChange")}if(gd(),at(),ie(),!de&&t.config.mode!=="range"&&t.config.showMonths===1?Y(Rt):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var pr=t.config.mode==="single"&&!t.config.enableTime,Ie=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(pr||Ie)&&ro()}E()}}var Af={locale:[Ge,mt],showMonths:[lt,v,st],minDate:[N],maxDate:[N],positionElement:[ye],clickOpens:[function(){t.config.clickOpens===!0?(I(t._input,"focus",t.open),I(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function vl(pt,ut){if(pt!==null&&typeof pt=="object"){Object.assign(t.config,pt);for(var bt in pt)Af[bt]!==void 0&&Af[bt].forEach(function(Rt){return Rt()})}else t.config[pt]=ut,Af[pt]!==void 0?Af[pt].forEach(function(Rt){return Rt()}):rE.indexOf(pt)>-1&&(t.config[pt]=aE(ut));t.redraw(),ie(!0)}function ni(pt,ut){var bt=[];if(pt instanceof Array)bt=pt.map(function(Rt){return t.parseDate(Rt,ut)});else if(pt instanceof Date||typeof pt=="number")bt=[t.parseDate(pt,ut)];else if(typeof pt=="string")switch(t.config.mode){case"single":case"time":bt=[t.parseDate(pt,ut)];break;case"multiple":bt=pt.split(t.config.conjunction).map(function(Rt){return t.parseDate(Rt,ut)});break;case"range":bt=pt.split(t.l10n.rangeSeparator).map(function(Rt){return t.parseDate(Rt,ut)});break;default:break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(pt)));t.selectedDates=t.config.allowInvalidPreload?bt:bt.filter(function(Rt){return Rt instanceof Date&&jt(Rt,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(Rt,le){return Rt.getTime()-le.getTime()})}function Pe(pt,ut,bt){if(ut===void 0&&(ut=!1),bt===void 0&&(bt=t.config.dateFormat),pt!==0&&!pt||pt instanceof Array&&pt.length===0)return t.clear(ut);ni(pt,bt),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),N(void 0,ut),T(),t.selectedDates.length===0&&t.clear(!1),ie(ut),ut&&Yr("onChange")}function Ln(pt){return pt.slice().map(function(ut){return typeof ut=="string"||typeof ut=="number"||ut instanceof Date?t.parseDate(ut,void 0,!0):ut&&typeof ut=="object"&&ut.from&&ut.to?{from:t.parseDate(ut.from,void 0),to:t.parseDate(ut.to,void 0)}:ut}).filter(function(ut){return ut})}function vd(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var pt=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);pt&&ni(pt,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()<t.now.getTime()?t.config.maxDate:t.now,t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth(),t.selectedDates.length>0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function dd(){if(t.input=Jr(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=kr(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),ye()}function ye(){t._positionElement=t.config.positionElement||t._input}function xa(){var pt=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=kr("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=pt,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=pt==="datetime-local"?"Y-m-d\\TH:i:S":pt==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}I(t.mobileInput,"change",function(ut){t.setDate(Ja(ut).value,!1,t.mobileFormatStr),Yr("onChange"),Yr("onClose")})}function _1(pt){if(t.isOpen===!0)return t.close();t.open(pt)}function Yr(pt,ut){if(t.config!==void 0){var bt=t.config[pt];if(bt!==void 0&&bt.length>0)for(var Rt=0;bt[Rt]&&Rt<bt.length;Rt++)bt[Rt](t.selectedDates,t.input.value,t,ut);pt==="onChange"&&(t.input.dispatchEvent(dl("change")),t.input.dispatchEvent(dl("input")))}}function dl(pt){var ut=document.createEvent("Event");return ut.initEvent(pt,!0,!0),ut}function o0(pt){for(var ut=0;ut<t.selectedDates.length;ut++){var bt=t.selectedDates[ut];if(bt instanceof Date&&Qa(bt,pt)===0)return""+ut}return!1}function x1(pt){return t.config.mode!=="range"||t.selectedDates.length<2?!1:Qa(pt,t.selectedDates[0])>=0&&Qa(pt,t.selectedDates[1])<=0}function gd(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(pt,ut){var bt=new Date(t.currentYear,t.currentMonth,1);bt.setMonth(t.currentMonth+ut),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[ut].textContent=i1(bt.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=bt.getMonth().toString(),pt.value=bt.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYear<t.config.minDate.getFullYear()),t._hideNextMonthArrow=t.config.maxDate!==void 0&&(t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth+1>t.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function md(pt){var ut=pt||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(bt){return t.formatDate(bt,ut)}).filter(function(bt,Rt,le){return t.config.mode!=="range"||t.config.enableTime||le.indexOf(bt)===Rt}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function ie(pt){pt===void 0&&(pt=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=md(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=md(t.config.altFormat)),pt!==!1&&Yr("onValueUpdate")}function Df(pt){var ut=Ja(pt),bt=t.prevMonthNav.contains(ut),Rt=t.nextMonthNav.contains(ut);bt||Rt?Mt(bt?-1:1):t.yearElements.indexOf(ut)>=0?ut.select():ut.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):ut.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function xh(pt){pt.preventDefault();var ut=pt.type==="keydown",bt=Ja(pt),Rt=bt;t.amPM!==void 0&&bt===t.amPM&&(t.amPM.textContent=t.l10n.amPM[ja(t.amPM.textContent===t.l10n.amPM[0])]);var le=parseFloat(Rt.getAttribute("min")),de=parseFloat(Rt.getAttribute("max")),He=parseFloat(Rt.getAttribute("step")),Se=parseInt(Rt.value,10),pr=pt.delta||(ut?pt.which===38?1:-1:0),Ie=Se+He*pr;if(typeof Rt.value<"u"&&Rt.value.length===2){var Ke=Rt===t.hourElement,xr=Rt===t.minuteElement;Ie<le?(Ie=de+Ie+ja(!Ke)+(ja(Ke)&&ja(!t.amPM)),xr&&F(void 0,-1,t.hourElement)):Ie>de&&(Ie=Rt===t.hourElement?Ie-de-ja(!t.amPM):le,xr&&F(void 0,1,t.hourElement)),t.amPM&&Ke&&(He===1?Ie+Se===23:Math.abs(Ie-Se)>He)&&(t.amPM.textContent=t.l10n.amPM[ja(t.amPM.textContent===t.l10n.amPM[0])]),Rt.value=Kn(Ie)}}return l(),t}function Wy(i,e){for(var t=Array.prototype.slice.call(i).filter(function(h){return h instanceof HTMLElement}),o=[],l=0;l<t.length;l++){var f=t[l];try{if(f.getAttribute("data-fp-omit")!==null)continue;f._flatpickr!==void 0&&(f._flatpickr.destroy(),f._flatpickr=void 0),f._flatpickr=LKt(f,e||{}),o.push(f._flatpickr)}catch(h){console.error(h)}}return o.length===1?o[0]:o}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(i){return Wy(this,i)},HTMLElement.prototype.flatpickr=function(i){return Wy([this],i)});var Xi=function(i,e){return typeof i=="string"?Wy(window.document.querySelectorAll(i),e):i instanceof Node?Wy([i],e):Wy(i,e)};Xi.defaultConfig={};Xi.l10ns={en:Jn({},nE),default:Jn({},nE)};Xi.localize=function(i){Xi.l10ns.default=Jn(Jn({},Xi.l10ns.default),i)};Xi.setDefaults=function(i){Xi.defaultConfig=Jn(Jn({},Xi.defaultConfig),i)};Xi.parseDate=oE({});Xi.formatDate=KW({});Xi.compareDates=Qa;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(i){return Wy(this,i)});Date.prototype.fp_incr=function(i){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof i=="string"?parseInt(i,10):i))};typeof window<"u"&&(window.flatpickr=Xi);var uE=Xi;var fE,_mt,cE,xmt,hE,Smt,n1,jW,Yy=class extends mr{constructor(){super(...arguments);Te(this,fE);Te(this,cE);Te(this,hE);Te(this,n1)}connect(){this.typeValue=="time"?this.flatpickr=uE(this.element,Oe(this,fE,_mt)):this.typeValue=="datetime"?this.flatpickr=uE(this.element,Oe(this,cE,xmt)):this.flatpickr=uE(this.element,Oe(this,hE,Smt))}disconnect(){this.flatpickr.destroy()}};fE=new WeakSet,_mt=function(){return{dateFormat:"H:i",enableTime:!0,noCalendar:!0}},cE=new WeakSet,xmt=function(){return{...Oe(this,n1,jW),altFormat:this.dateTimeFormatValue,dateFormat:"Y-m-d H:i",enableTime:!0}},hE=new WeakSet,Smt=function(){return{...Oe(this,n1,jW),altFormat:this.dateFormatValue,dateFormat:"Y-m-d"}},n1=new WeakSet,jW=function(){return{altInput:!0,disable:this.disableValue,mode:this.modeValue,showMonths:this.showMonthsValue}},Nt(Yy,"targets",["details"]),Nt(Yy,"values",{type:String,disable:Array,mode:{type:String,default:"single"},showMonths:{type:Number,default:1},dateFormat:{type:String,default:"F d, Y"},dateTimeFormat:{type:String,default:"M d, Y h:i K"}});var a1=class extends mr{show(){this.menuTarget.show()}showModal(){this.menuTarget.showModal()}close(){this.menuTarget.close()}closeOnClickOutside({target:i}){i.nodeName==="DIALOG"&&this.close()}};Nt(a1,"targets",["menu"]);var Xy,vE,bmt,qy,pE,dE,wmt,gE,Tmt,mE,Cmt,Zy=class extends mr{constructor(){super(...arguments);Te(this,vE);Te(this,qy);Te(this,dE);Te(this,gE);Te(this,mE);Te(this,Xy,void 0)}initialize(){Mr(this,Xy,new IntersectionObserver(Xe(this,vE,bmt).bind(this)))}connect(){Oe(this,Xy).observe(this.element)}disconnect(){Oe(this,Xy).disconnect()}prev(){this.indexValue>0&&(this.indexValue--,Xe(this,qy,pE).call(this))}next(){this.indexValue<Oe(this,mE,Cmt)&&(this.indexValue++,Xe(this,qy,pE).call(this))}};Xy=new WeakMap,vE=new WeakSet,bmt=function([e]){e.isIntersecting&&(this.indexValue=0,Xe(this,qy,pE).call(this))},qy=new WeakSet,pE=function(){Xe(this,dE,wmt).call(this),Xe(this,gE,Tmt).call(this)},dE=new WeakSet,wmt=function(){this.itemTargets.forEach((e,t)=>{e.tabIndex=t===this.indexValue?0:-1})},gE=new WeakSet,Tmt=function(){this.itemTargets[this.indexValue].focus()},mE=new WeakSet,Cmt=function(){return this.itemTargets.length-1},Nt(Zy,"targets",["item"]),Nt(Zy,"values",{index:Number});var $y=Math.min,wf=Math.max,s1=Math.round,l1=Math.floor,cl=i=>({x:i,y:i}),IKt={left:"right",right:"left",bottom:"top",top:"bottom"},EKt={start:"end",end:"start"};function JW(i,e,t){return wf(i,$y(e,t))}function u1(i,e){return typeof i=="function"?i(e):i}function _h(i){return i.split("-")[0]}function f1(i){return i.split("-")[1]}function QW(i){return i==="x"?"y":"x"}function t4(i){return i==="y"?"height":"width"}var PKt=new Set(["top","bottom"]);function Tf(i){return PKt.has(_h(i))?"y":"x"}function e4(i){return QW(Tf(i))}function Mmt(i,e,t){t===void 0&&(t=!1);let o=f1(i),l=e4(i),f=t4(l),h=l==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[f]>e.floating[f]&&(h=o1(h)),[h,o1(h)]}function Lmt(i){let e=o1(i);return[yE(i),e,yE(e)]}function yE(i){return i.replace(/start|end/g,e=>EKt[e])}var Amt=["left","right"],Dmt=["right","left"],RKt=["top","bottom"],OKt=["bottom","top"];function kKt(i,e,t){switch(i){case"top":case"bottom":return t?e?Dmt:Amt:e?Amt:Dmt;case"left":case"right":return e?RKt:OKt;default:return[]}}function Imt(i,e,t,o){let l=f1(i),f=kKt(_h(i),t==="start",o);return l&&(f=f.map(h=>h+"-"+l),e&&(f=f.concat(f.map(yE)))),f}function o1(i){return i.replace(/left|right|bottom|top/g,e=>IKt[e])}function NKt(i){return{top:0,right:0,bottom:0,left:0,...i}}function Emt(i){return typeof i!="number"?NKt(i):{top:i,right:i,bottom:i,left:i}}function fd(i){let{x:e,y:t,width:o,height:l}=i;return{width:o,height:l,top:t,left:e,right:e+o,bottom:t+l,x:e,y:t}}function Pmt(i,e,t){let{reference:o,floating:l}=i,f=Tf(e),h=e4(e),v=t4(h),g=_h(e),y=f==="y",x=o.x+o.width/2-l.width/2,b=o.y+o.height/2-l.height/2,T=o[v]/2-l[v]/2,A;switch(g){case"top":A={x,y:o.y-l.height};break;case"bottom":A={x,y:o.y+o.height};break;case"right":A={x:o.x+o.width,y:b};break;case"left":A={x:o.x-l.width,y:b};break;default:A={x:o.x,y:o.y}}switch(f1(e)){case"start":A[h]-=T*(t&&y?-1:1);break;case"end":A[h]+=T*(t&&y?-1:1);break}return A}var Rmt=async(i,e,t)=>{let{placement:o="bottom",strategy:l="absolute",middleware:f=[],platform:h}=t,v=f.filter(Boolean),g=await(h.isRTL==null?void 0:h.isRTL(e)),y=await h.getElementRects({reference:i,floating:e,strategy:l}),{x,y:b}=Pmt(y,o,g),T=o,A={},M=0;for(let I=0;I<v.length;I++){let{name:E,fn:O}=v[I],{x:N,y:V,data:F,reset:U}=await O({x,y:b,initialPlacement:o,placement:T,strategy:l,middlewareData:A,rects:y,platform:h,elements:{reference:i,floating:e}});x=N??x,b=V??b,A={...A,[E]:{...A[E],...F}},U&&M<=50&&(M++,typeof U=="object"&&(U.placement&&(T=U.placement),U.rects&&(y=U.rects===!0?await h.getElementRects({reference:i,floating:e,strategy:l}):U.rects),{x,y:b}=Pmt(y,T,g)),I=-1)}return{x,y:b,placement:T,strategy:l,middlewareData:A}};async function r4(i,e){var t;e===void 0&&(e={});let{x:o,y:l,platform:f,rects:h,elements:v,strategy:g}=i,{boundary:y="clippingAncestors",rootBoundary:x="viewport",elementContext:b="floating",altBoundary:T=!1,padding:A=0}=u1(e,i),M=Emt(A),E=v[T?b==="floating"?"reference":"floating":b],O=fd(await f.getClippingRect({element:(t=await(f.isElement==null?void 0:f.isElement(E)))==null||t?E:E.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(v.floating)),boundary:y,rootBoundary:x,strategy:g})),N=b==="floating"?{x:o,y:l,width:h.floating.width,height:h.floating.height}:h.reference,V=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v.floating)),F=await(f.isElement==null?void 0:f.isElement(V))?await(f.getScale==null?void 0:f.getScale(V))||{x:1,y:1}:{x:1,y:1},U=fd(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:v,rect:N,offsetParent:V,strategy:g}):N);return{top:(O.top-U.top+M.top)/F.y,bottom:(U.bottom-O.bottom+M.bottom)/F.y,left:(O.left-U.left+M.left)/F.x,right:(U.right-O.right+M.right)/F.x}}var Omt=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(e){var t,o;let{placement:l,middlewareData:f,rects:h,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:x=!0,crossAxis:b=!0,fallbackPlacements:T,fallbackStrategy:A="bestFit",fallbackAxisSideDirection:M="none",flipAlignment:I=!0,...E}=u1(i,e);if((t=f.arrow)!=null&&t.alignmentOffset)return{};let O=_h(l),N=Tf(v),V=_h(v)===v,F=await(g.isRTL==null?void 0:g.isRTL(y.floating)),U=T||(V||!I?[o1(v)]:Lmt(v)),H=M!=="none";!T&&H&&U.push(...Imt(v,I,M,F));let Y=[v,...U],$=await r4(e,E),K=[],Q=((o=f.flip)==null?void 0:o.overflows)||[];if(x&&K.push($[O]),b){let ct=Mmt(l,h,F);K.push($[ct[0]],$[ct[1]])}if(Q=[...Q,{placement:l,overflows:K}],!K.every(ct=>ct<=0)){var rt,at;let ct=(((rt=f.flip)==null?void 0:rt.index)||0)+1,lt=Y[ct];if(lt&&(!(b==="alignment"?N!==Tf(lt):!1)||Q.every(st=>st.overflows[0]>0&&Tf(st.placement)===N)))return{data:{index:ct,overflows:Q},reset:{placement:lt}};let dt=(at=Q.filter(wt=>wt.overflows[0]<=0).sort((wt,st)=>wt.overflows[1]-st.overflows[1])[0])==null?void 0:at.placement;if(!dt)switch(A){case"bestFit":{var ot;let wt=(ot=Q.filter(st=>{if(H){let mt=Tf(st.placement);return mt===N||mt==="y"}return!0}).map(st=>[st.placement,st.overflows.filter(mt=>mt>0).reduce((mt,Ot)=>mt+Ot,0)]).sort((st,mt)=>st[1]-mt[1])[0])==null?void 0:ot[0];wt&&(dt=wt);break}case"initialPlacement":dt=v;break}if(l!==dt)return{reset:{placement:dt}}}return{}}}};var zKt=new Set(["left","top"]);async function VKt(i,e){let{placement:t,platform:o,elements:l}=i,f=await(o.isRTL==null?void 0:o.isRTL(l.floating)),h=_h(t),v=f1(t),g=Tf(t)==="y",y=zKt.has(h)?-1:1,x=f&&g?-1:1,b=u1(e,i),{mainAxis:T,crossAxis:A,alignmentAxis:M}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return v&&typeof M=="number"&&(A=v==="end"?M*-1:M),g?{x:A*x,y:T*y}:{x:T*y,y:A*x}}var kmt=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(e){var t,o;let{x:l,y:f,placement:h,middlewareData:v}=e,g=await VKt(e,i);return h===((t=v.offset)==null?void 0:t.placement)&&(o=v.arrow)!=null&&o.alignmentOffset?{}:{x:l+g.x,y:f+g.y,data:{...g,placement:h}}}}},Nmt=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(e){let{x:t,y:o,placement:l}=e,{mainAxis:f=!0,crossAxis:h=!1,limiter:v={fn:E=>{let{x:O,y:N}=E;return{x:O,y:N}}},...g}=u1(i,e),y={x:t,y:o},x=await r4(e,g),b=Tf(_h(l)),T=QW(b),A=y[T],M=y[b];if(f){let E=T==="y"?"top":"left",O=T==="y"?"bottom":"right",N=A+x[E],V=A-x[O];A=JW(N,A,V)}if(h){let E=b==="y"?"top":"left",O=b==="y"?"bottom":"right",N=M+x[E],V=M-x[O];M=JW(N,M,V)}let I=v.fn({...e,[T]:A,[b]:M});return{...I,data:{x:I.x-t,y:I.y-o,enabled:{[T]:f,[b]:h}}}}}};function _E(){return typeof window<"u"}function cd(i){return Vmt(i)?(i.nodeName||"").toLowerCase():"#document"}function to(i){var e;return(i==null||(e=i.ownerDocument)==null?void 0:e.defaultView)||window}function hl(i){var e;return(e=(Vmt(i)?i.ownerDocument:i.document)||window.document)==null?void 0:e.documentElement}function Vmt(i){return _E()?i instanceof Node||i instanceof to(i).Node:!1}function Ds(i){return _E()?i instanceof Element||i instanceof to(i).Element:!1}function pl(i){return _E()?i instanceof HTMLElement||i instanceof to(i).HTMLElement:!1}function zmt(i){return!_E()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof to(i).ShadowRoot}var BKt=new Set(["inline","contents"]);function jy(i){let{overflow:e,overflowX:t,overflowY:o,display:l}=Ms(i);return/auto|scroll|overlay|hidden|clip/.test(e+o+t)&&!BKt.has(l)}var FKt=new Set(["table","td","th"]);function Bmt(i){return FKt.has(cd(i))}var UKt=[":popover-open",":modal"];function c1(i){return UKt.some(e=>{try{return i.matches(e)}catch{return!1}})}var GKt=["transform","translate","scale","rotate","perspective"],HKt=["transform","translate","scale","rotate","perspective","filter"],WKt=["paint","layout","strict","content"];function xE(i){let e=SE(),t=Ds(i)?Ms(i):i;return GKt.some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||HKt.some(o=>(t.willChange||"").includes(o))||WKt.some(o=>(t.contain||"").includes(o))}function Fmt(i){let e=Cf(i);for(;pl(e)&&!hd(e);){if(xE(e))return e;if(c1(e))return null;e=Cf(e)}return null}function SE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var YKt=new Set(["html","body","#document"]);function hd(i){return YKt.has(cd(i))}function Ms(i){return to(i).getComputedStyle(i)}function h1(i){return Ds(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function Cf(i){if(cd(i)==="html")return i;let e=i.assignedSlot||i.parentNode||zmt(i)&&i.host||hl(i);return zmt(e)?e.host:e}function Umt(i){let e=Cf(i);return hd(e)?i.ownerDocument?i.ownerDocument.body:i.body:pl(e)&&jy(e)?e:Umt(e)}function Ky(i,e,t){var o;e===void 0&&(e=[]),t===void 0&&(t=!0);let l=Umt(i),f=l===((o=i.ownerDocument)==null?void 0:o.body),h=to(l);if(f){let v=bE(h);return e.concat(h,h.visualViewport||[],jy(l)?l:[],v&&t?Ky(v):[])}return e.concat(l,Ky(l,[],t))}function bE(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function Wmt(i){let e=Ms(i),t=parseFloat(e.width)||0,o=parseFloat(e.height)||0,l=pl(i),f=l?i.offsetWidth:t,h=l?i.offsetHeight:o,v=s1(t)!==f||s1(o)!==h;return v&&(t=f,o=h),{width:t,height:o,$:v}}function n4(i){return Ds(i)?i:i.contextElement}function Jy(i){let e=n4(i);if(!pl(e))return cl(1);let t=e.getBoundingClientRect(),{width:o,height:l,$:f}=Wmt(e),h=(f?s1(t.width):t.width)/o,v=(f?s1(t.height):t.height)/l;return(!h||!Number.isFinite(h))&&(h=1),(!v||!Number.isFinite(v))&&(v=1),{x:h,y:v}}var ZKt=cl(0);function Ymt(i){let e=to(i);return!SE()||!e.visualViewport?ZKt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function XKt(i,e,t){return e===void 0&&(e=!1),!t||e&&t!==to(i)?!1:e}function pd(i,e,t,o){e===void 0&&(e=!1),t===void 0&&(t=!1);let l=i.getBoundingClientRect(),f=n4(i),h=cl(1);e&&(o?Ds(o)&&(h=Jy(o)):h=Jy(i));let v=XKt(f,t,o)?Ymt(f):cl(0),g=(l.left+v.x)/h.x,y=(l.top+v.y)/h.y,x=l.width/h.x,b=l.height/h.y;if(f){let T=to(f),A=o&&Ds(o)?to(o):o,M=T,I=bE(M);for(;I&&o&&A!==M;){let E=Jy(I),O=I.getBoundingClientRect(),N=Ms(I),V=O.left+(I.clientLeft+parseFloat(N.paddingLeft))*E.x,F=O.top+(I.clientTop+parseFloat(N.paddingTop))*E.y;g*=E.x,y*=E.y,x*=E.x,b*=E.y,g+=V,y+=F,M=to(I),I=bE(M)}}return fd({width:x,height:b,x:g,y})}function a4(i,e){let t=h1(i).scrollLeft;return e?e.left+t:pd(hl(i)).left+t}function Zmt(i,e,t){t===void 0&&(t=!1);let o=i.getBoundingClientRect(),l=o.left+e.scrollLeft-(t?0:a4(i,o)),f=o.top+e.scrollTop;return{x:l,y:f}}function qKt(i){let{elements:e,rect:t,offsetParent:o,strategy:l}=i,f=l==="fixed",h=hl(o),v=e?c1(e.floating):!1;if(o===h||v&&f)return t;let g={scrollLeft:0,scrollTop:0},y=cl(1),x=cl(0),b=pl(o);if((b||!b&&!f)&&((cd(o)!=="body"||jy(h))&&(g=h1(o)),pl(o))){let A=pd(o);y=Jy(o),x.x=A.x+o.clientLeft,x.y=A.y+o.clientTop}let T=h&&!b&&!f?Zmt(h,g,!0):cl(0);return{width:t.width*y.x,height:t.height*y.y,x:t.x*y.x-g.scrollLeft*y.x+x.x+T.x,y:t.y*y.y-g.scrollTop*y.y+x.y+T.y}}function $Kt(i){return Array.from(i.getClientRects())}function KKt(i){let e=hl(i),t=h1(i),o=i.ownerDocument.body,l=wf(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),f=wf(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),h=-t.scrollLeft+a4(i),v=-t.scrollTop;return Ms(o).direction==="rtl"&&(h+=wf(e.clientWidth,o.clientWidth)-l),{width:l,height:f,x:h,y:v}}function jKt(i,e){let t=to(i),o=hl(i),l=t.visualViewport,f=o.clientWidth,h=o.clientHeight,v=0,g=0;if(l){f=l.width,h=l.height;let y=SE();(!y||y&&e==="fixed")&&(v=l.offsetLeft,g=l.offsetTop)}return{width:f,height:h,x:v,y:g}}var JKt=new Set(["absolute","fixed"]);function QKt(i,e){let t=pd(i,!0,e==="fixed"),o=t.top+i.clientTop,l=t.left+i.clientLeft,f=pl(i)?Jy(i):cl(1),h=i.clientWidth*f.x,v=i.clientHeight*f.y,g=l*f.x,y=o*f.y;return{width:h,height:v,x:g,y}}function Gmt(i,e,t){let o;if(e==="viewport")o=jKt(i,t);else if(e==="document")o=KKt(hl(i));else if(Ds(e))o=QKt(e,t);else{let l=Ymt(i);o={x:e.x-l.x,y:e.y-l.y,width:e.width,height:e.height}}return fd(o)}function Xmt(i,e){let t=Cf(i);return t===e||!Ds(t)||hd(t)?!1:Ms(t).position==="fixed"||Xmt(t,e)}function tjt(i,e){let t=e.get(i);if(t)return t;let o=Ky(i,[],!1).filter(v=>Ds(v)&&cd(v)!=="body"),l=null,f=Ms(i).position==="fixed",h=f?Cf(i):i;for(;Ds(h)&&!hd(h);){let v=Ms(h),g=xE(h);!g&&v.position==="fixed"&&(l=null),(f?!g&&!l:!g&&v.position==="static"&&!!l&&JKt.has(l.position)||jy(h)&&!g&&Xmt(i,h))?o=o.filter(x=>x!==h):l=v,h=Cf(h)}return e.set(i,o),o}function ejt(i){let{element:e,boundary:t,rootBoundary:o,strategy:l}=i,h=[...t==="clippingAncestors"?c1(e)?[]:tjt(e,this._c):[].concat(t),o],v=h[0],g=h.reduce((y,x)=>{let b=Gmt(e,x,l);return y.top=wf(b.top,y.top),y.right=$y(b.right,y.right),y.bottom=$y(b.bottom,y.bottom),y.left=wf(b.left,y.left),y},Gmt(e,v,l));return{width:g.right-g.left,height:g.bottom-g.top,x:g.left,y:g.top}}function rjt(i){let{width:e,height:t}=Wmt(i);return{width:e,height:t}}function ijt(i,e,t){let o=pl(e),l=hl(e),f=t==="fixed",h=pd(i,!0,f,e),v={scrollLeft:0,scrollTop:0},g=cl(0);function y(){g.x=a4(l)}if(o||!o&&!f)if((cd(e)!=="body"||jy(l))&&(v=h1(e)),o){let A=pd(e,!0,f,e);g.x=A.x+e.clientLeft,g.y=A.y+e.clientTop}else l&&y();f&&!o&&l&&y();let x=l&&!o&&!f?Zmt(l,v):cl(0),b=h.left+v.scrollLeft-g.x-x.x,T=h.top+v.scrollTop-g.y-x.y;return{x:b,y:T,width:h.width,height:h.height}}function i4(i){return Ms(i).position==="static"}function Hmt(i,e){if(!pl(i)||Ms(i).position==="fixed")return null;if(e)return e(i);let t=i.offsetParent;return hl(i)===t&&(t=t.ownerDocument.body),t}function qmt(i,e){let t=to(i);if(c1(i))return t;if(!pl(i)){let l=Cf(i);for(;l&&!hd(l);){if(Ds(l)&&!i4(l))return l;l=Cf(l)}return t}let o=Hmt(i,e);for(;o&&Bmt(o)&&i4(o);)o=Hmt(o,e);return o&&hd(o)&&i4(o)&&!xE(o)?t:o||Fmt(i)||t}var njt=async function(i){let e=this.getOffsetParent||qmt,t=this.getDimensions,o=await t(i.floating);return{reference:ijt(i.reference,await e(i.floating),i.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ajt(i){return Ms(i).direction==="rtl"}var ojt={convertOffsetParentRelativeRectToViewportRelativeRect:qKt,getDocumentElement:hl,getClippingRect:ejt,getOffsetParent:qmt,getElementRects:njt,getClientRects:$Kt,getDimensions:rjt,getScale:Jy,isElement:Ds,isRTL:ajt};function $mt(i,e){return i.x===e.x&&i.y===e.y&&i.width===e.width&&i.height===e.height}function sjt(i,e){let t=null,o,l=hl(i);function f(){var v;clearTimeout(o),(v=t)==null||v.disconnect(),t=null}function h(v,g){v===void 0&&(v=!1),g===void 0&&(g=1),f();let y=i.getBoundingClientRect(),{left:x,top:b,width:T,height:A}=y;if(v||e(),!T||!A)return;let M=l1(b),I=l1(l.clientWidth-(x+T)),E=l1(l.clientHeight-(b+A)),O=l1(x),V={rootMargin:-M+"px "+-I+"px "+-E+"px "+-O+"px",threshold:wf(0,$y(1,g))||1},F=!0;function U(H){let Y=H[0].intersectionRatio;if(Y!==g){if(!F)return h();Y?h(!1,Y):o=setTimeout(()=>{h(!1,1e-7)},1e3)}Y===1&&!$mt(y,i.getBoundingClientRect())&&h(),F=!1}try{t=new IntersectionObserver(U,{...V,root:l.ownerDocument})}catch{t=new IntersectionObserver(U,V)}t.observe(i)}return h(!0),f}function Kmt(i,e,t,o){o===void 0&&(o={});let{ancestorScroll:l=!0,ancestorResize:f=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:v=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,y=n4(i),x=l||f?[...y?Ky(y):[],...Ky(e)]:[];x.forEach(O=>{l&&O.addEventListener("scroll",t,{passive:!0}),f&&O.addEventListener("resize",t)});let b=y&&v?sjt(y,t):null,T=-1,A=null;h&&(A=new ResizeObserver(O=>{let[N]=O;N&&N.target===y&&A&&(A.unobserve(e),cancelAnimationFrame(T),T=requestAnimationFrame(()=>{var V;(V=A)==null||V.observe(e)})),t()}),y&&!g&&A.observe(y),A.observe(e));let M,I=g?pd(i):null;g&&E();function E(){let O=pd(i);I&&!$mt(I,O)&&t(),I=O,M=requestAnimationFrame(E)}return t(),()=>{var O;x.forEach(N=>{l&&N.removeEventListener("scroll",t),f&&N.removeEventListener("resize",t)}),b?.(),(O=A)==null||O.disconnect(),A=null,g&&cancelAnimationFrame(M)}}var jmt=kmt;var Jmt=Nmt,Qmt=Omt;var tyt=(i,e,t)=>{let o=new Map,l={platform:ojt,...t},f={...l.platform,_c:o};return Rmt(i,e,{...l,platform:f})};var p1,v1,wE,eyt,Qy=class extends mr{constructor(){super(...arguments);Te(this,wE);Te(this,p1,null);Te(this,v1,null)}initialize(){this.orient=this.orient.bind(this)}connect(){this.cleanup=Kmt(this.buttonTarget,this.menuTarget,this.orient)}disconnect(){this.cleanup()}show(e){e&&e.preventDefault(),this.menuTarget.showPopover({source:this.buttonTarget}),this.orient(),this.loadOperationDetailsIfNeeded()}hide(){this.menuTarget.hidePopover()}toggle(e){e.preventDefault(),this.menuTarget.togglePopover({source:this.buttonTarget}),this.orient(),this.loadOperationDetailsIfNeeded()}debouncedShow(){clearTimeout(Oe(this,v1)),Mr(this,p1,setTimeout(()=>this.show(),700))}debouncedHide(){clearTimeout(Oe(this,p1)),Mr(this,v1,setTimeout(()=>this.hide(),300))}orient(){tyt(this.buttonTarget,this.menuTarget,Oe(this,wE,eyt)).then(({x:e,y:t})=>{this.menuTarget.style.setProperty("--popover-x",`${e}px`),this.menuTarget.style.setProperty("--popover-y",`${t}px`),this.menuTarget.classList.add("positioned")})}loadOperationDetailsIfNeeded(){let e=this.menuTarget.dataset.operationUrl;if(!e)return;let t=this.menuTarget.querySelector("turbo-frame");!t||!this.hasLoadingContent(t)||(t.src=e)}hasLoadingContent(e){return(e.textContent||"").includes("Loading operation details")}};p1=new WeakMap,v1=new WeakMap,wE=new WeakSet,eyt=function(){return{placement:this.placementValue,middleware:[jmt(4),Qmt(),Jmt({padding:4})]}},Nt(Qy,"targets",["button","menu"]),Nt(Qy,"values",{placement:{type:String,default:"top"}});var d1=class extends mr{initialize(){this.search=this.debounce(this.search.bind(this),500)}debounce(i,e){let t;return function(...l){let f=()=>{clearTimeout(t),i(...l)};clearTimeout(t),t=setTimeout(f,e)}}submit(){this.element.requestSubmit()}search(){this.element.requestSubmit()}cancel(){this.cancelTarget?.click()}preventAttachment(i){i.preventDefault()}};Nt(d1,"targets",["cancel"]);var g1=class extends mr{connect(){this.initializeChart(),this.handleColorSchemeChange=this.onColorSchemeChange.bind(this),document.addEventListener("rails-pulse:color-scheme-changed",this.handleColorSchemeChange)}disconnect(){document.removeEventListener("rails-pulse:color-scheme-changed",this.handleColorSchemeChange),this.disposeChart()}initializeChart(){this.retryCount=0,this.maxRetries=100,this.attemptInit()}attemptInit(){if(typeof echarts>"u"){if(this.retryCount++,this.retryCount>=this.maxRetries){console.error("[RailsPulse] echarts not loaded after 5 seconds for",this.element.id),this.showError();return}setTimeout(()=>this.attemptInit(),50);return}this.renderChart()}renderChart(){try{this.chart=echarts.init(this.element,this.themeValue||"railspulse");let i=this.buildChartConfig();this.chart.setOption(i),this.applyColorScheme(),document.dispatchEvent(new CustomEvent("stimulus:echarts:rendered",{detail:{containerId:this.element.id,chart:this.chart,controller:this}})),this.resizeObserver=new ResizeObserver(()=>{this.chart&&this.chart.resize()}),this.resizeObserver.observe(this.element),this.element.setAttribute("data-chart-rendered","true")}catch(i){console.error("[RailsPulse] Error initializing chart:",i),this.showError()}}buildChartConfig(){let i={...this.optionsValue};return this.processFormatters(i),this.setChartData(i),i}setChartData(i){let e=this.dataValue,t=Object.keys(e).map(l=>{let f=Number(l);return isNaN(f)?l:f}),o=Object.values(e).map(l=>typeof l=="object"&&l!==null&&l.value!==void 0?l.value:l);if(i.xAxis=i.xAxis||{},i.xAxis.type="category",i.xAxis.data=t,i.yAxis=i.yAxis||{},i.yAxis.type="value",Array.isArray(i.series))i.series[0]=i.series[0]||{},i.series[0].type=this.typeValue,i.series[0].data=o;else if(i.series&&typeof i.series=="object"){let l={...i.series};i.series=[{type:this.typeValue,data:o,...l}]}else i.series=[{type:this.typeValue,data:o}]}processFormatters(i){i.tooltip?.formatter&&typeof i.tooltip.formatter=="string"&&(i.tooltip.formatter=this.parseFormatter(i.tooltip.formatter)),i.xAxis?.axisLabel?.formatter&&typeof i.xAxis.axisLabel.formatter=="string"&&(i.xAxis.axisLabel.formatter=this.parseFormatter(i.xAxis.axisLabel.formatter)),i.yAxis?.axisLabel?.formatter&&typeof i.yAxis.axisLabel.formatter=="string"&&(i.yAxis.axisLabel.formatter=this.parseFormatter(i.yAxis.axisLabel.formatter))}parseFormatter(i){let e=i.replace(/__FUNCTION_START__|__FUNCTION_END__/g,"");return e.trim().startsWith("function")?this.getSafeFormatter(e):e}getSafeFormatter(i){let e={duration_ms:t=>typeof t=="number"?t.toFixed(2)+" ms":t,percentage:t=>typeof t=="number"?t.toFixed(1)+"%":t,number_delimited:t=>typeof t=="number"?t.toLocaleString():t,timestamp:t=>typeof t=="number"||typeof t=="string"?new Date(t).toLocaleString():t,date:t=>typeof t=="number"||typeof t=="string"?new Date(t).toLocaleDateString():t,time:t=>typeof t=="number"||typeof t=="string"?new Date(t).toLocaleTimeString():t,bytes:t=>{if(typeof t!="number")return t;let o=["B","KB","MB","GB","TB"],l=t,f=0;for(;l>=1024&&f<o.length-1;)l/=1024,f++;return l.toFixed(2)+" "+o[f]}};for(let[t,o]of Object.entries(e))if(i.includes(t)||i.includes(t.replace("_","")))return o;return i.includes("toFixed(2)")&&i.includes("ms")?e.duration_ms:i.includes("toLocaleString")?e.number_delimited:i.includes("toLocaleDateString")?e.date:i.includes("toLocaleTimeString")?e.time:(console.warn("[RailsPulse] Unknown formatter pattern, using identity function:",i),t=>t)}showError(){this.element.classList.add("chart-error"),this.element.innerHTML='<p class="text-subtle p-4">Chart failed to load</p>'}get chartInstance(){return this.chart}disposeChart(){this.resizeObserver&&this.resizeObserver.disconnect(),this.chart&&(this.chart.dispose(),this.chart=null)}update(i){if(i.detail?.data&&(this.dataValue=i.detail.data),i.detail?.options&&(this.optionsValue=i.detail.options),this.chart){let e=this.buildChartConfig();this.chart.setOption(e,!0)}}onColorSchemeChange(){this.applyColorScheme()}applyColorScheme(){if(!this.chart)return;let t=document.documentElement.getAttribute("data-color-scheme")==="dark"?"#ffffff":"#999999";this.chart.setOption({xAxis:{axisLabel:{color:t}},yAxis:{axisLabel:{color:t}}})}};Nt(g1,"values",{type:String,data:Object,options:Object,theme:String});var t0=class extends mr{constructor(){super(...arguments);Nt(this,"lastTurboFrameRequestAt",0);Nt(this,"pendingRequestTimeout",null);Nt(this,"pendingRequestData",null);Nt(this,"selectedColumnIndex",null);Nt(this,"originalSeriesOption",null)}connect(){this.handleChartInitialized=this.onChartInitialized.bind(this),document.addEventListener("stimulus:echarts:rendered",this.handleChartInitialized)}disconnect(){document.removeEventListener("stimulus:echarts:rendered",this.handleChartInitialized),this.hasChartTarget&&this.chartTarget&&(this.chartTarget.removeEventListener("mousedown",this.handleChartMouseDown),this.chartTarget.removeEventListener("mouseup",this.handleChartMouseUp)),document.removeEventListener("mouseup",this.handleDocumentMouseUp),this.pendingRequestTimeout&&clearTimeout(this.pendingRequestTimeout)}onChartInitialized(e){e.detail.containerId===this.chartIdValue&&(this.chart=e.detail.chart,this.setup())}setup(){if(this.setupDone)return;let e=!1;try{e=!!this.chartTarget}catch{e=!1}!e||!this.chart||(this.visibleData=this.getVisibleData(),this.storeOriginalSeriesOption(),this.setupChartEventListeners(),this.setupDone=!0,e&&document.getElementById(this.chartIdValue)?.setAttribute("data-chart-rendered","true"),this.initializeColumnSelectionFromUrl())}setupChartEventListeners(){this.handleChartMouseDown=()=>{this.visibleData=this.getVisibleData()},this.chartTarget.addEventListener("mousedown",this.handleChartMouseDown),this.handleChartMouseUp=()=>{this.handleZoomChange()},this.chartTarget.addEventListener("mouseup",this.handleChartMouseUp),this.chart.on("datazoom",()=>{this.handleZoomChange()}),this.handleDocumentMouseUp=()=>{this.handleZoomChange()},document.addEventListener("mouseup",this.handleDocumentMouseUp),this.chart.on("click",e=>{this.handleColumnClick(e)})}getVisibleData(){try{let e=this.chart.getOption();if(!e.dataZoom||e.dataZoom.length===0)return{xAxis:[],series:[]};let t=e.dataZoom[1]||e.dataZoom[0];if(!e.xAxis||!e.xAxis[0]||!e.xAxis[0].data)return{xAxis:[],series:[]};if(!e.series||!e.series[0]||!e.series[0].data)return{xAxis:[],series:[]};let o=e.xAxis[0].data,l=e.series[0].data,f=t.startValue||0,h=t.endValue||o.length-1;return{xAxis:o.slice(f,h+1),series:l.slice(f,h+1)}}catch{return{xAxis:[],series:[]}}}handleZoomChange(){let e=this.getVisibleData(),t=e.xAxis.join(),o=this.visibleData.xAxis.join();t!==o&&(this.visibleData=e,this.updateUrlWithZoomParams(e),this.sendTurboFrameRequest(e))}updateUrlWithZoomParams(e){let t=new URL(window.location.href),o=new URLSearchParams(t.search),l=e.xAxis[0],f=e.xAxis[e.xAxis.length-1];o.set("zoom_start_time",l),o.set("zoom_end_time",f),t.search=o.toString(),window.history.replaceState({},"",t)}updatePaginationLimit(){if(!this.hasPaginationLimitTarget)return;let e=new URL(window.location.href),t=new URLSearchParams(e.search),o=this.paginationLimitTarget.value;t.set("limit",o),e.search=t.toString(),window.history.replaceState({},"",e)}sendTurboFrameRequest(e){let o=Date.now()-this.lastTurboFrameRequestAt;if(this.pendingRequestData=e,this.pendingRequestTimeout&&clearTimeout(this.pendingRequestTimeout),o>=1e3)this.executeTurboFrameRequest(e);else{let l=1e3-o;this.pendingRequestTimeout=setTimeout(()=>{this.executeTurboFrameRequest(this.pendingRequestData),this.pendingRequestTimeout=null},l)}}executeTurboFrameRequest(e){this.lastTurboFrameRequestAt=Date.now();let t=new URL(window.location.href),o=new URLSearchParams(t.search),l=e.xAxis[0],f=e.xAxis[e.xAxis.length-1];o.set("zoom_start_time",l),o.set("zoom_end_time",f),this.hasPaginationLimitTarget&&o.set("limit",this.paginationLimitTarget.value),t.search=o.toString(),fetch(t,{method:"GET",headers:{Accept:"text/vnd.turbo-stream.html, text/html","Turbo-Frame":this.indexTableTarget.id,"X-Requested-With":"XMLHttpRequest"}}).then(h=>h.text()).then(h=>{let v=this.indexTableTarget;if(v){let x=new DOMParser().parseFromString(h,"text/html").querySelector(`turbo-frame#${v.id}`);x?this.replaceFrameContent(v,x):this.replaceFrameContentFromHTML(v,h)}}).catch(h=>console.error("[IndexController] Fetch error:",h))}replaceFrameContent(e,t){try{for(;e.firstChild;)e.removeChild(e.firstChild);Array.from(t.childNodes).forEach(l=>{let f=l.cloneNode(!0);e.appendChild(f)})}catch(o){console.error("Error replacing frame content:",o),e.innerHTML=t.innerHTML}}replaceFrameContentFromHTML(e,t){try{let l=new DOMParser().parseFromString(t,"text/html");for(;e.firstChild;)e.removeChild(e.firstChild);Array.from(l.body.childNodes).forEach(h=>{let v=h.cloneNode(!0);e.appendChild(v)})}catch(o){console.error("Error parsing HTML content:",o),e.innerHTML=t}}handleColumnClick(e){let t=e.dataIndex;this.selectedColumnIndex===t?(this.resetColumnColors(),this.selectedColumnIndex=null,this.sendColumnDeselectionRequest()):(this.highlightColumn(t),this.selectedColumnIndex=t,this.sendColumnSelectionRequest(t))}highlightColumn(e){try{let t=this.chart.getOption();if(!t.series||!t.series[0]||!t.series[0].data)return;let o=t.series[0].data,f=this.chart.getOption().color?.[0]||"#5470c6";this.chart.setOption({series:[{data:o,itemStyle:{color:h=>h.dataIndex===e?f:"#cccccc"}}]})}catch(t){console.error("Error highlighting column:",t)}}storeOriginalSeriesOption(){try{let e=this.chart.getOption();if(e.series&&e.series[0]){let t=JSON.parse(JSON.stringify(e.series[0]));t.itemStyle&&typeof t.itemStyle.color=="function"&&delete t.itemStyle.color,this.originalSeriesOption=t}}catch(e){console.error("Error storing original series option:",e)}}resetColumnColors(){try{if(!this.originalSeriesOption){console.warn("No original series option stored, cannot reset properly");return}let t=this.chart.getOption().series[0].data,o={...this.originalSeriesOption,data:t};o.itemStyle||(o.itemStyle={}),o.itemStyle.color="#ffc91f",this.chart.setOption({series:[o]},!1)}catch(e){console.error("Error resetting column colors:",e)}}sendColumnSelectionRequest(e){let l=this.chart.getOption().xAxis[0].data[e];if(!l){console.error("Could not find timestamp for column index:",e);return}let f=new URL(window.location.href),h=new URLSearchParams(f.search);h.set("selected_column_time",l),this.hasPaginationLimitTarget&&h.set("limit",this.paginationLimitTarget.value),f.search=h.toString(),window.history.replaceState({},"",f),this.executeTurboFrameRequestForColumn(f)}sendColumnDeselectionRequest(){let e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("selected_column_time"),this.hasPaginationLimitTarget&&t.set("limit",this.paginationLimitTarget.value),e.search=t.toString(),window.history.replaceState({},"",e),this.executeTurboFrameRequestForColumn(e)}executeTurboFrameRequestForColumn(e){fetch(e,{method:"GET",headers:{Accept:"text/vnd.turbo-stream.html, text/html","Turbo-Frame":this.indexTableTarget.id,"X-Requested-With":"XMLHttpRequest"}}).then(t=>t.text()).then(t=>{let o=this.indexTableTarget;if(o){let h=new DOMParser().parseFromString(t,"text/html").querySelector(`turbo-frame#${o.id}`);h?this.replaceFrameContent(o,h):this.replaceFrameContentFromHTML(o,t)}}).catch(t=>console.error("[IndexController] Column selection fetch error:",t))}initializeColumnSelectionFromUrl(){let t=new URLSearchParams(window.location.search).get("selected_column_time");if(t){let o=this.chart.getOption();if(!o.xAxis||!o.xAxis[0]||!o.xAxis[0].data)return;let l=o.xAxis[0].data,f=l.findIndex(h=>h.toString()===t);if(f===-1){let h=parseInt(t);f=l.findIndex(v=>parseInt(v)===h)}f!==-1&&(this.selectedColumnIndex=f,requestAnimationFrame(()=>{this.highlightColumn(f)}))}}};Nt(t0,"targets",["chart","paginationLimit","indexTable"]),Nt(t0,"values",{chartId:String});var TE=class extends mr{connect(){this.storageKey="color-scheme",this.html=document.documentElement;let i=localStorage.getItem(this.storageKey);i&&this.html.setAttribute("data-color-scheme",i)}toggle(i){i.preventDefault();let e=this.html.getAttribute("data-color-scheme")==="dark"?"light":"dark";this.html.setAttribute("data-color-scheme",e),localStorage.setItem(this.storageKey,e),document.dispatchEvent(new CustomEvent("rails-pulse:color-scheme-changed",{detail:{scheme:e}}))}};var e0=class extends mr{connect(){this.restorePaginationLimit()}updateLimit(){let i=this.limitTarget.value;sessionStorage.setItem(this.storageKeyValue,i);let e=new URL(window.location);e.searchParams.set("limit",i),e.searchParams.delete("page"),typeof Turbo<"u"?Turbo.visit(e.toString(),{action:"replace"}):window.location.href=e.toString()}restorePaginationLimit(){let e=new URLSearchParams(window.location.search).get("limit");if(e&&this.limitTarget)sessionStorage.setItem(this.storageKeyValue,e),this.limitTarget.value!==e&&(this.limitTarget.value=e);else{let t=sessionStorage.getItem(this.storageKeyValue);t&&this.limitTarget&&this.limitTarget.value!==t&&(this.limitTarget.value=t)}}};Nt(e0,"targets",["limit"]),Nt(e0,"values",{storageKey:{type:String,default:"rails_pulse_pagination_limit"}});var m1=class extends mr{connect(){this.updateTimestamp(),this.setupObserver(),this.setupTurboFrameListener()}disconnect(){this.observer&&this.observer.disconnect(),this.frameObserver&&this.frameObserver.disconnect(),this.documentObserver&&this.documentObserver.disconnect(),this.turboFrameListener&&document.removeEventListener("turbo:frame-load",this.turboFrameListener)}setupObserver(){if(this.targetFrameValue){this.updateTimestamp();let i=new MutationObserver(()=>{let e=document.getElementById(this.targetFrameValue);e&&(this.updateTimestamp(),this.frameObserver&&this.frameObserver.disconnect(),this.frameObserver=new MutationObserver(()=>{this.updateTimestamp()}),this.frameObserver.observe(e,{attributes:!0,attributeFilter:["data-cached-at"],childList:!0,subtree:!0}))});i.observe(document.body,{childList:!0,subtree:!0}),this.documentObserver=i}}cachedAtValueChanged(){this.updateTimestamp()}setupTurboFrameListener(){this.targetFrameValue&&(this.turboFrameListener=i=>{i.target&&i.target.id===this.targetFrameValue&&this.updateTimestamp()},document.addEventListener("turbo:frame-load",this.turboFrameListener))}updateTimestamp(){let i=this.cachedAtValue;if(!i&&this.targetFrameValue){let e=document.getElementById(this.targetFrameValue);e&&(i=e.dataset.cachedAt)}if(i)try{let t=new Date(i).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0});this.element.title=`Last updated: ${t}`}catch{this.element.title="Cache time unavailable"}else this.element.title="Cache time unavailable"}};Nt(m1,"values",{cachedAt:String,targetFrame:String});var r0=class extends mr{connect(){this.renderIcon()}nameValueChanged(){this.renderIcon()}renderIcon(){this.clearIcon(),this.element.classList.add(...this.loadingClasses),this.element.classList.remove(...this.errorClasses,...this.loadedClasses);let i=this.nameValue;if(!i){this.handleError("Icon name is required");return}if(!window.RailsPulseIcons){this.handleError("RailsPulseIcons not loaded");return}let e=window.RailsPulseIcons.get(i);if(!e){this.handleError(`Icon '${i}' not found`);return}try{let t=this.createSVGElement(e);this.element.appendChild(t),this.element.classList.remove(...this.loadingClasses,...this.errorClasses),this.element.classList.add(...this.loadedClasses),this.element.setAttribute("aria-label",`${i} icon`)}catch(t){this.handleError(`Failed to render icon '${i}': ${t.message}`)}}createSVGElement(i){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.setAttribute("width",this.widthValue||"24"),e.setAttribute("height",this.heightValue||"24"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width",this.strokeWidthValue||"2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),window.RailsPulseIcons.render){let f=document.createElement("div");if(window.RailsPulseIcons.render(this.nameValue,f,{width:this.widthValue||"24",height:this.heightValue||"24"})&&f.firstChild)return f.firstChild}let l=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="${this.widthValue||"24"}" height="${this.heightValue||"24"}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${this.strokeWidthValue||"2"}" stroke-linecap="round" stroke-linejoin="round">${i}</svg>`,"image/svg+xml").documentElement;if(l.nodeName==="parsererror")throw new Error("Invalid SVG content");return document.importNode(l,!0)}clearIcon(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild)}handleError(i){console.warn(`[Rails Pulse Icon Controller] ${i}`),this.clearIcon(),this.element.classList.remove(...this.loadingClasses,...this.loadedClasses),this.element.classList.add(...this.errorClasses),this.createErrorPlaceholder(),this.element.setAttribute("aria-label","Icon not available")}createErrorPlaceholder(){let i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("width",this.widthValue||"24"),i.setAttribute("height",this.heightValue||"24"),i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("fill","currentColor"),i.setAttribute("opacity","0.3");let e=document.createElementNS("http://www.w3.org/2000/svg","rect");e.setAttribute("width","20"),e.setAttribute("height","20"),e.setAttribute("x","2"),e.setAttribute("y","2"),e.setAttribute("rx","2"),i.appendChild(e),this.element.appendChild(i)}listAvailableIcons(){window.RailsPulseIcons?.list?console.log("Available icons:",window.RailsPulseIcons.list()):console.warn("RailsPulseIcons not loaded or list method not available")}};Nt(r0,"values",{name:String,width:String,height:String,strokeWidth:String}),Nt(r0,"classes",["loading","error","loaded"]);var CE=class extends mr{toggle(i){let e=i.target.closest("tr");if(!e||e.closest("tbody")!==this.element||e.classList.contains("operation-details-row"))return;let t=i.target.closest("td,th");if(t&&t.parentElement===e&&t.cellIndex===e.cells.length-1)return;i.preventDefault(),i.stopPropagation();let o=e.nextElementSibling;if(!o||o.tagName!=="TR"||!o.classList.contains("operation-details-row"))return;o.classList.contains("hidden")?this.expand(e,o):this.collapse(e,o)}expand(i,e){e.classList.remove("hidden");let t=i.querySelector(".chevron");t&&(t.style.transform="rotate(90deg)"),i.classList.add("expanded");let o=e.querySelector("turbo-frame");if(o&&!o.getAttribute("src")){let l=o.dataset.operationUrl;l&&o.setAttribute("src",l)}}collapse(i,e){e.classList.add("hidden");let t=i.querySelector(".chevron");t&&(t.style.transform="rotate(0deg)"),i.classList.remove("expanded")}};var i0=class extends mr{connect(){this.collapse()}toggle(){this.element.classList.contains(this.collapsedClass)?this.expand():this.collapse()}collapse(){this.element.classList.add(this.collapsedClass),this.hasToggleTarget&&(this.toggleTarget.textContent="show more")}expand(){this.element.classList.remove(this.collapsedClass),this.hasToggleTarget&&(this.toggleTarget.textContent="show less")}};Nt(i0,"targets",["content","toggle"]),Nt(i0,"classes",["collapsed"]);var AE=class extends mr{updateUrl(i){let t=i.currentTarget.getAttribute("href");t&&window.history.replaceState({},"",t)}};var n0=class extends mr{connect(){this.updateIndicator()}open(i){if(i.preventDefault(),this.dateRangeTarget.value){let e=this.application.getControllerForElementAndIdentifier(this.dateRangeTarget,"rails-pulse--datepicker");if(e&&e.flatpickr){let t=this.dateRangeTarget.value;if(t.includes(" to ")){let[o,l]=t.split(" to ").map(f=>f.trim());e.flatpickr.setDate([o,l],!1)}}}this.wrapperTarget.style.display="flex",document.body.style.overflow="hidden"}close(i){i&&i.preventDefault(),this.wrapperTarget.style.display="none",document.body.style.overflow=""}closeOnClickOutside(i){i.target===this.wrapperTarget&&this.close(i)}submit(i){if(i.submitter&&i.submitter.name==="clear")return;let e=this.dateRangeTarget.value,t=i.target;if(e&&e.includes(" to ")){let[o,l]=e.split(" to ").map(v=>v.trim());t.querySelectorAll('input[name="start_time"], input[name="end_time"]').forEach(v=>v.remove());let f=document.createElement("input");f.type="hidden",f.name="start_time",f.value=o,t.appendChild(f);let h=document.createElement("input");h.type="hidden",h.name="end_time",h.value=l,t.appendChild(h)}}updateIndicator(){this.hasIndicatorTarget&&(this.activeValue?this.indicatorTarget.classList.add("global-filters-active"):this.indicatorTarget.classList.remove("global-filters-active"))}activeValueChanged(){this.updateIndicator()}};Nt(n0,"targets",["wrapper","dialog","dateRange","indicator","form"]),Nt(n0,"values",{active:{type:Boolean,default:!1}});var y1=class extends mr{connect(){let i=this.selectWrapperTarget.querySelector("select");if(!i)return;i.dataset.mode==="recent_custom"?i.value==="custom"&&(this.showPicker(),this.initializeDatePicker()):i.value==="custom"&&(this.showPicker(),this.initializeDatePicker())}handleChange(i){i.target.dataset.mode==="recent_custom"?i.target.value==="custom"?(this.showPicker(),this.openDatePicker()):(this.pickerWrapperTarget.style.display="none",this.selectWrapperTarget.style.display="block"):i.target.value==="custom"&&(this.showPicker(),this.openDatePicker())}showPicker(){this.selectWrapperTarget.style.display="none",this.pickerWrapperTarget.style.display="flex"}openDatePicker(){setTimeout(()=>{let i=this.pickerWrapperTarget.querySelector('input[name*="custom_date_range"]');if(!i)return;let e=this.application.getControllerForElementAndIdentifier(i,"rails-pulse--datepicker");e&&e.flatpickr&&e.flatpickr.open()},50)}showSelect(){this.pickerWrapperTarget.style.display="none",this.selectWrapperTarget.style.display="block";let i=this.selectWrapperTarget.querySelector("select");i&&(i.dataset.mode==="recent_custom"?i.value="recent":i.value="last_day")}initializeDatePicker(){let i=this.pickerWrapperTarget.querySelector('input[type="text"]');if(!i||!i.value)return;let e=this.application.getControllerForElementAndIdentifier(i,"rails-pulse--datepicker");if(e&&e.flatpickr){let t=i.value;if(t.includes(" to ")){let[o,l]=t.split(" to ").map(f=>f.trim());e.flatpickr.setDate([o,l],!1)}}}};Nt(y1,"targets",["selectWrapper","pickerWrapper"]);var qi=tE.start();qi.debug=!1;window.Stimulus=qi;window.echarts=R3;window.Turbo=SW;qi.register("rails-pulse--context-menu",t1);qi.register("rails-pulse--datepicker",Yy);qi.register("rails-pulse--dialog",a1);qi.register("rails-pulse--menu",Zy);qi.register("rails-pulse--popover",Qy);qi.register("rails-pulse--form",d1);qi.register("rails-pulse--chart",g1);qi.register("rails-pulse--index",t0);qi.register("rails-pulse--color-scheme",TE);qi.register("rails-pulse--pagination",e0);qi.register("rails-pulse--timezone",m1);qi.register("rails-pulse--icon",r0);qi.register("rails-pulse--expandable-rows",CE);qi.register("rails-pulse--collapsible",i0);qi.register("rails-pulse--table-sort",AE);qi.register("rails-pulse--global-filters",n0);qi.register("rails-pulse--custom-range",y1);document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("turbo-frame[src]:not([complete])").forEach(e=>{let t=e.getAttribute("src");t&&(e.removeAttribute("src"),setTimeout(()=>e.setAttribute("src",t),10))})});var ljt=new MutationObserver(i=>{i.forEach(e=>{e.type==="childList"&&e.addedNodes.forEach(t=>{if(t.nodeType===1&&t.tagName==="TURBO-FRAME"&&t.hasAttribute("src")&&!t.hasAttribute("complete")){let o=t.getAttribute("src");o&&(t.removeAttribute("src"),setTimeout(()=>t.setAttribute("src",o),10))}})})});ljt.observe(document.body,{childList:!0,subtree:!0});CS("railspulse",{color:["#ffc91f","#ffde66","#fbedbf"],backgroundColor:"rgba(255,255,255,0)",textStyle:{},title:{textStyle:{color:"#666666"}},line:{lineStyle:{width:"3"},symbolSize:"8"},bar:{itemStyle:{barBorderWidth:0}}});window.RailsPulse={application:qi,version:"1.0.0"};})();
|
|
128
128
|
/*! Bundled license information:
|
|
129
129
|
|
|
130
130
|
echarts/dist/echarts.js:
|