@budibase/server 2.1.12-alpha.0 → 2.1.12
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.
- package/__mocks__/aws-sdk.ts +0 -14
- package/builder/assets/{index.f2075200.js → index.4ffe4819.js} +4 -4
- package/builder/index.html +1 -1
- package/coverage/clover.xml +6 -6
- package/coverage/coverage-final.json +1 -1
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
- package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +1 -1
- package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
- package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
- package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
- package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
- package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/role.js.html +1 -1
- package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/index.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/script.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/api/controllers/user.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
- package/coverage/lcov-report/api/index.html +1 -1
- package/coverage/lcov-report/api/index.js.html +1 -1
- package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
- package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/routes/automation.js.html +1 -1
- package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
- package/coverage/lcov-report/api/routes/component.js.html +1 -1
- package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
- package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
- package/coverage/lcov-report/api/routes/dev.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +1 -1
- package/coverage/lcov-report/api/routes/integration.js.html +1 -1
- package/coverage/lcov-report/api/routes/layout.js.html +1 -1
- package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
- package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
- package/coverage/lcov-report/api/routes/permission.js.html +1 -1
- package/coverage/lcov-report/api/routes/query.js.html +1 -1
- package/coverage/lcov-report/api/routes/role.js.html +1 -1
- package/coverage/lcov-report/api/routes/routing.js.html +1 -1
- package/coverage/lcov-report/api/routes/screen.js.html +1 -1
- package/coverage/lcov-report/api/routes/script.js.html +1 -1
- package/coverage/lcov-report/api/routes/table.js.html +1 -1
- package/coverage/lcov-report/api/routes/templates.js.html +1 -1
- package/coverage/lcov-report/api/routes/user.js.html +1 -1
- package/coverage/lcov-report/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
- package/coverage/lcov-report/api/routes/view.js.html +1 -1
- package/coverage/lcov-report/automations/actions.js.html +1 -1
- package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
- package/coverage/lcov-report/automations/bullboard.js.html +1 -1
- package/coverage/lcov-report/automations/index.html +1 -1
- package/coverage/lcov-report/automations/index.js.html +1 -1
- package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
- package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
- package/coverage/lcov-report/automations/steps/index.html +15 -15
- package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
- package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
- package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
- package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
- package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
- package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
- package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/utils.js.html +10 -10
- package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/triggers.js.html +1 -1
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +1 -1
- package/coverage/lcov-report/constants/layouts.js.html +1 -1
- package/coverage/lcov-report/constants/screens.js.html +1 -1
- package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
- package/coverage/lcov-report/db/index.html +1 -1
- package/coverage/lcov-report/db/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
- package/coverage/lcov-report/db/newid.js.html +1 -1
- package/coverage/lcov-report/db/utils.js.html +1 -1
- package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
- package/coverage/lcov-report/events/index.html +1 -1
- package/coverage/lcov-report/events/index.js.html +1 -1
- package/coverage/lcov-report/events/utils.js.html +1 -1
- package/coverage/lcov-report/index.html +14 -14
- package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
- package/coverage/lcov-report/middleware/builder.js.html +1 -1
- package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
- package/coverage/lcov-report/middleware/index.html +1 -1
- package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
- package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
- package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
- package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
- package/coverage/lcov-report/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
- package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
- package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
- package/coverage/lcov-report/utilities/global.js.html +1 -1
- package/coverage/lcov-report/utilities/index.html +1 -1
- package/coverage/lcov-report/utilities/index.js.html +1 -1
- package/coverage/lcov-report/utilities/plugins.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
- package/coverage/lcov-report/utilities/security.js.html +1 -1
- package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/utilities/users.js.html +1 -1
- package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
- package/coverage/lcov.info +4 -4
- package/dist/api/controllers/row/ExternalRequest.js +1 -6
- package/dist/api/controllers/row/index.js +7 -16
- package/dist/integrations/elasticsearch.js +2 -26
- package/dist/integrations/s3.js +1 -157
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/api/controllers/row/ExternalRequest.ts +3 -5
- package/src/api/controllers/row/index.ts +9 -17
- package/src/integrations/elasticsearch.ts +2 -32
- package/src/integrations/s3.ts +3 -179
- package/src/integrations/tests/s3.spec.ts +1 -85
|
@@ -29,7 +29,7 @@ var RZ=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var yyt=RZ((Df,G2
|
|
|
29
29
|
<span class='flatpickr-weekday'>
|
|
30
30
|
${_t.join("</span><span class='flatpickr-weekday'>")}
|
|
31
31
|
</span>
|
|
32
|
-
`}function be(){t.calendarContainer.classList.add("hasWeeks");const Qe=Ba("div","flatpickr-weekwrapper");Qe.appendChild(Ba("span","flatpickr-weekday",t.l10n.weekAbbreviation));const _t=Ba("div","flatpickr-weeks");return Qe.appendChild(_t),{weekWrapper:Qe,weekNumbers:_t}}function pe(Qe,_t=!0){const ot=_t?Qe:Qe-t.currentMonth;ot<0&&t._hidePrevMonthArrow===!0||ot>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ot,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,wn("onYearChange"),le()),Q(),wn("onMonthChange"),zn())}function _e(Qe=!0,_t=!0){if(t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,_t===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){const{hours:ot,minutes:It,seconds:fn}=zb(t.config);h(ot,It,fn)}t.redraw(),Qe&&wn("onChange")}function Ae(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),wn("onClose")}function me(){t.config!==void 0&&wn("onDestroy");for(let Qe=t._handlers.length;Qe--;)t._handlers[Qe].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){const Qe=t.calendarContainer.parentNode;if(Qe.lastChild&&Qe.removeChild(Qe.lastChild),Qe.parentNode){for(;Qe.firstChild;)Qe.parentNode.insertBefore(Qe.firstChild,Qe);Qe.parentNode.removeChild(Qe)}}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(Qe=>{try{delete t[Qe]}catch{}})}function it(Qe){return t.config.appendTo&&t.config.appendTo.contains(Qe)?!0:t.calendarContainer.contains(Qe)}function $e(Qe){if(t.isOpen&&!t.config.inline){const _t=kf(Qe),ot=it(_t),It=_t===t.input||_t===t.altInput||t.element.contains(_t)||Qe.path&&Qe.path.indexOf&&(~Qe.path.indexOf(t.input)||~Qe.path.indexOf(t.altInput)),fn=Qe.type==="blur"?It&&Qe.relatedTarget&&!it(Qe.relatedTarget):!It&&!ot&&!it(Qe.relatedTarget),an=!t.config.ignoredFocusElements.some(jn=>jn.contains(_t));fn&&an&&(t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&l(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&(t.clear(!1),t.redraw()))}}function Me(Qe){if(!Qe||t.config.minDate&&Qe<t.config.minDate.getFullYear()||t.config.maxDate&&Qe>t.config.maxDate.getFullYear())return;const _t=Qe,ot=t.currentYear!==_t;t.currentYear=_t||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)),ot&&(t.redraw(),wn("onYearChange"),le())}function Be(Qe,_t=!0){var ot;const It=t.parseDate(Qe,void 0,_t);if(t.config.minDate&&It&&zf(It,t.config.minDate,_t!==void 0?_t:!t.minDateHasTime)<0||t.config.maxDate&&It&&zf(It,t.config.maxDate,_t!==void 0?_t:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(It===void 0)return!1;const fn=!!t.config.enable,an=(ot=t.config.enable)!==null&&ot!==void 0?ot:t.config.disable;for(let jn=0,xn;jn<an.length;jn++){if(xn=an[jn],typeof xn=="function"&&xn(It))return fn;if(xn instanceof Date&&It!==void 0&&xn.getTime()===It.getTime())return fn;if(typeof xn=="string"){const yr=t.parseDate(xn,void 0,!0);return yr&&yr.getTime()===It.getTime()?fn:!fn}else if(typeof xn=="object"&&It!==void 0&&xn.from&&xn.to&&It.getTime()>=xn.from.getTime()&&It.getTime()<=xn.to.getTime())return fn}return!fn}function xe(Qe){return t.daysContainer!==void 0?Qe.className.indexOf("hidden")===-1&&Qe.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Qe):!1}function ve(Qe){Qe.target===t._input&&(t.selectedDates.length>0||t._input.value.length>0)&&!(Qe.relatedTarget&&it(Qe.relatedTarget))&&t.setDate(t._input.value,!0,Qe.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function st(Qe){const _t=kf(Qe),ot=t.config.wrap?n.contains(_t):_t===t._input,It=t.config.allowInput,fn=t.isOpen&&(!It||!ot),an=t.config.inline&&ot&&!It;if(Qe.keyCode===13&&ot){if(It)return t.setDate(t._input.value,!0,_t===t.altInput?t.config.altFormat:t.config.dateFormat),_t.blur();t.open()}else if(it(_t)||fn||an){const jn=!!t.timeContainer&&t.timeContainer.contains(_t);switch(Qe.keyCode){case 13:jn?(Qe.preventDefault(),l(),Se()):Re(Qe);break;case 27:Qe.preventDefault(),Se();break;case 8:case 46:ot&&!t.config.allowInput&&(Qe.preventDefault(),t.clear());break;case 37:case 39:if(!jn&&!ot){if(Qe.preventDefault(),t.daysContainer!==void 0&&(It===!1||document.activeElement&&xe(document.activeElement))){const yr=Qe.keyCode===39?1:-1;Qe.ctrlKey?(Qe.stopPropagation(),pe(yr),W(j(1),0)):W(void 0,yr)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Qe.preventDefault();const xn=Qe.keyCode===40?1:-1;t.daysContainer&&_t.$i!==void 0||_t===t.input||_t===t.altInput?Qe.ctrlKey?(Qe.stopPropagation(),Me(t.currentYear-xn),W(j(1),0)):jn||W(void 0,xn*7):_t===t.currentYearElement?Me(t.currentYear-xn):t.config.enableTime&&(!jn&&t.hourElement&&t.hourElement.focus(),l(Qe),t._debouncedChange());break;case 9:if(jn){const yr=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(vi=>vi),pr=yr.indexOf(_t);if(pr!==-1){const vi=yr[pr+(Qe.shiftKey?-1:1)];Qe.preventDefault(),(vi||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(_t)&&Qe.shiftKey&&(Qe.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&_t===t.amPM)switch(Qe.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Ut();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Ut();break}(ot||it(_t))&&wn("onKeyDown",Qe)}function dt(Qe){if(t.selectedDates.length!==1||Qe&&(!Qe.classList.contains("flatpickr-day")||Qe.classList.contains("flatpickr-disabled")))return;const _t=Qe?Qe.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ot=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),It=Math.min(_t,t.selectedDates[0].getTime()),fn=Math.max(_t,t.selectedDates[0].getTime());let an=!1,jn=0,xn=0;for(let yr=It;yr<fn;yr+=mie.DAY)Be(new Date(yr),!0)||(an=an||yr>It&&yr<fn,yr<ot&&(!jn||yr>jn)?jn=yr:yr>ot&&(!xn||yr<xn)&&(xn=yr));for(let yr=0;yr<t.config.showMonths;yr++){const pr=t.daysContainer.children[yr];for(let vi=0,Gi=pr.children.length;vi<Gi;vi++){const hi=pr.children[vi],Qa=hi.dateObj.getTime(),Qo=jn>0&&Qa<jn||xn>0&&Qa>xn;if(Qo){hi.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(s1=>{hi.classList.remove(s1)});continue}else if(an&&!Qo)continue;["startRange","inRange","endRange","notAllowed"].forEach(s1=>{hi.classList.remove(s1)}),Qe!==void 0&&(Qe.classList.add(_t<=t.selectedDates[0].getTime()?"startRange":"endRange"),ot<_t&&Qa===ot?hi.classList.add("startRange"):ot>_t&&Qa===ot&&hi.classList.add("endRange"),Qa>=jn&&(xn===0||Qa<=xn)&&hie(Qa,ot,_t)&&hi.classList.add("inRange"))}}}function vt(){t.isOpen&&!t.config.static&&!t.config.inline&&Tt()}function Ze(Qe,_t=t._positionElement){if(t.isMobile===!0){if(Qe){Qe.preventDefault();const It=kf(Qe);It&&It.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),wn("onOpen");return}else if(t._input.disabled||t.config.inline)return;const ot=t.isOpen;t.isOpen=!0,ot||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),wn("onOpen"),Tt(_t)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Qe===void 0||!t.timeContainer.contains(Qe.relatedTarget))&&setTimeout(()=>t.hourElement.select(),50)}function We(Qe){return _t=>{const ot=t.config[`_${Qe}Date`]=t.parseDate(_t,t.config.dateFormat),It=t.config[`_${Qe==="min"?"max":"min"}Date`];ot!==void 0&&(t[Qe==="min"?"minDateHasTime":"maxDateHasTime"]=ot.getHours()>0||ot.getMinutes()>0||ot.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(fn=>Be(fn)),!t.selectedDates.length&&Qe==="min"&&f(ot),Ut()),t.daysContainer&&(at(),ot!==void 0?t.currentYearElement[Qe]=ot.getFullYear().toString():t.currentYearElement.removeAttribute(Qe),t.currentYearElement.disabled=!!It&&ot!==void 0&&It.getFullYear()===ot.getFullYear())}}function nt(){const Qe=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],_t=Object.assign(Object.assign({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ot={};t.config.parseDate=_t.parseDate,t.config.formatDate=_t.formatDate,Object.defineProperty(t.config,"enable",{get:()=>t.config._enable,set:an=>{t.config._enable=Jt(an)}}),Object.defineProperty(t.config,"disable",{get:()=>t.config._disable,set:an=>{t.config._disable=Jt(an)}});const It=_t.mode==="time";if(!_t.dateFormat&&(_t.enableTime||It)){const an=is.defaultConfig.dateFormat||Fh.dateFormat;ot.dateFormat=_t.noCalendar||It?"H:i"+(_t.enableSeconds?":S":""):an+" H:i"+(_t.enableSeconds?":S":"")}if(_t.altInput&&(_t.enableTime||It)&&!_t.altFormat){const an=is.defaultConfig.altFormat||Fh.altFormat;ot.altFormat=_t.noCalendar||It?"h:i"+(_t.enableSeconds?":S K":" K"):an+` h:i${_t.enableSeconds?":S":""} K`}Object.defineProperty(t.config,"minDate",{get:()=>t.config._minDate,set:We("min")}),Object.defineProperty(t.config,"maxDate",{get:()=>t.config._maxDate,set:We("max")});const fn=an=>jn=>{t.config[an==="min"?"_minTime":"_maxTime"]=t.parseDate(jn,"H:i:S")};Object.defineProperty(t.config,"minTime",{get:()=>t.config._minTime,set:fn("min")}),Object.defineProperty(t.config,"maxTime",{get:()=>t.config._maxTime,set:fn("max")}),_t.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ot,_t);for(let an=0;an<Qe.length;an++)t.config[Qe[an]]=t.config[Qe[an]]===!0||t.config[Qe[an]]==="true";$b.filter(an=>t.config[an]!==void 0).forEach(an=>{t.config[an]=wb(t.config[an]||[]).map(a)}),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(let an=0;an<t.config.plugins.length;an++){const jn=t.config.plugins[an](t)||{};for(const xn in jn)$b.indexOf(xn)>-1?t.config[xn]=wb(jn[xn]).map(a).concat(t.config[xn]):typeof _t[xn]>"u"&&(t.config[xn]=jn[xn])}_t.altInputClass||(t.config.altInputClass=Ht().className+" "+t.config.altInputClass),wn("onParseConfig")}function Ht(){return t.config.wrap?n.querySelector("[data-input]"):n}function on(){typeof t.config.locale!="object"&&typeof is.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error(`flatpickr: invalid locale ${t.config.locale}`)),t.l10n=Object.assign(Object.assign({},is.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?is.l10ns[t.config.locale]:void 0),l$.K=`(${t.l10n.amPM[0]}|${t.l10n.amPM[1]}|${t.l10n.amPM[0].toLowerCase()}|${t.l10n.amPM[1].toLowerCase()})`,Object.assign(Object.assign({},e),JSON.parse(JSON.stringify(n.dataset||{}))).time_24hr===void 0&&is.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=bq(t),t.parseDate=s$({config:t.config,l10n:t.l10n})}function Tt(Qe){if(typeof t.config.position=="function")return void t.config.position(t,Qe);if(t.calendarContainer===void 0)return;wn("onPreCalendarPosition");const _t=Qe||t._positionElement,ot=Array.prototype.reduce.call(t.calendarContainer.children,(n1,Is)=>n1+Is.offsetHeight,0),It=t.calendarContainer.offsetWidth,fn=t.config.position.split(" "),an=fn[0],jn=fn.length>1?fn[1]:null,xn=_t.getBoundingClientRect(),yr=window.innerHeight-xn.bottom,pr=an==="above"||an!=="below"&&yr<ot&&xn.top>ot,vi=window.pageYOffset+xn.top+(pr?-ot-2:_t.offsetHeight+2);if(n2(t.calendarContainer,"arrowTop",!pr),n2(t.calendarContainer,"arrowBottom",pr),t.config.inline)return;let Gi=window.pageXOffset+xn.left,hi=!1,ls=!1;jn==="center"?(Gi-=(It-xn.width)/2,hi=!0):jn==="right"&&(Gi-=It-xn.width,ls=!0),n2(t.calendarContainer,"arrowLeft",!hi&&!ls),n2(t.calendarContainer,"arrowCenter",hi),n2(t.calendarContainer,"arrowRight",ls);const Qa=window.document.body.offsetWidth-(window.pageXOffset+xn.right),Qo=Gi+It>window.document.body.offsetWidth,s1=Qa+It>window.document.body.offsetWidth;if(n2(t.calendarContainer,"rightMost",Qo),!t.config.static)if(t.calendarContainer.style.top=`${vi}px`,!Qo)t.calendarContainer.style.left=`${Gi}px`,t.calendarContainer.style.right="auto";else if(!s1)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=`${Qa}px`;else{const n1=he();if(n1===void 0)return;const Is=window.document.body.offsetWidth,xa=Math.max(0,Is/2-It/2),Ha=".flatpickr-calendar.centerMost:before",x0=".flatpickr-calendar.centerMost:after",Y1=n1.cssRules.length,$a=`{left:${xn.left}px;right:auto;}`;n2(t.calendarContainer,"rightMost",!1),n2(t.calendarContainer,"centerMost",!0),n1.insertRule(`${Ha},${x0}${$a}`,Y1),t.calendarContainer.style.left=`${xa}px`,t.calendarContainer.style.right="auto"}}function he(){let Qe=null;for(let _t=0;_t<document.styleSheets.length;_t++){const ot=document.styleSheets[_t];try{ot.cssRules}catch{continue}Qe=ot;break}return Qe!=null?Qe:Xe()}function Xe(){const Qe=document.createElement("style");return document.head.appendChild(Qe),Qe.sheet}function at(){t.config.noCalendar||t.isMobile||(le(),zn(),Q())}function Se(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function Re(Qe){Qe.preventDefault(),Qe.stopPropagation();const _t=jn=>jn.classList&&jn.classList.contains("flatpickr-day")&&!jn.classList.contains("flatpickr-disabled")&&!jn.classList.contains("notAllowed"),ot=_q(kf(Qe),_t);if(ot===void 0)return;const It=ot,fn=t.latestSelectedDateObj=new Date(It.dateObj.getTime()),an=(fn.getMonth()<t.currentMonth||fn.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=It,t.config.mode==="single")t.selectedDates=[fn];else if(t.config.mode==="multiple"){const jn=br(fn);jn?t.selectedDates.splice(parseInt(jn),1):t.selectedDates.push(fn)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=fn,t.selectedDates.push(fn),zf(fn,t.selectedDates[0],!0)!==0&&t.selectedDates.sort((jn,xn)=>jn.getTime()-xn.getTime()));if(c(),an){const jn=t.currentYear!==fn.getFullYear();t.currentYear=fn.getFullYear(),t.currentMonth=fn.getMonth(),jn&&(wn("onYearChange"),le()),wn("onMonthChange")}if(zn(),Q(),Ut(),!an&&t.config.mode!=="range"&&t.config.showMonths===1?V(It):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){const jn=t.config.mode==="single"&&!t.config.enableTime,xn=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(jn||xn)&&Se()}y()}const Oe={locale:[on,de],showMonths:[K,o,se],minDate:[A],maxDate:[A],clickOpens:[()=>{t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ue(Qe,_t){if(Qe!==null&&typeof Qe=="object"){Object.assign(t.config,Qe);for(const ot in Qe)Oe[ot]!==void 0&&Oe[ot].forEach(It=>It())}else t.config[Qe]=_t,Oe[Qe]!==void 0?Oe[Qe].forEach(ot=>ot()):$b.indexOf(Qe)>-1&&(t.config[Qe]=wb(_t));t.redraw(),Ut(!0)}function kt(Qe,_t){let ot=[];if(Qe instanceof Array)ot=Qe.map(It=>t.parseDate(It,_t));else if(Qe instanceof Date||typeof Qe=="number")ot=[t.parseDate(Qe,_t)];else if(typeof Qe=="string")switch(t.config.mode){case"single":case"time":ot=[t.parseDate(Qe,_t)];break;case"multiple":ot=Qe.split(t.config.conjunction).map(It=>t.parseDate(It,_t));break;case"range":ot=Qe.split(t.l10n.rangeSeparator).map(It=>t.parseDate(It,_t));break}else t.config.errorHandler(new Error(`Invalid date supplied: ${JSON.stringify(Qe)}`));t.selectedDates=t.config.allowInvalidPreload?ot:ot.filter(It=>It instanceof Date&&Be(It,!1)),t.config.mode==="range"&&t.selectedDates.sort((It,fn)=>It.getTime()-fn.getTime())}function Mt(Qe,_t=!1,ot=t.config.dateFormat){if(Qe!==0&&!Qe||Qe instanceof Array&&Qe.length===0)return t.clear(_t);kt(Qe,ot),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),A(void 0,_t),f(),t.selectedDates.length===0&&t.clear(!1),Ut(_t),_t&&wn("onChange")}function Jt(Qe){return Qe.slice().map(_t=>typeof _t=="string"||typeof _t=="number"||_t instanceof Date?t.parseDate(_t,void 0,!0):_t&&typeof _t=="object"&&_t.from&&_t.to?{from:t.parseDate(_t.from,void 0),to:t.parseDate(_t.to,void 0)}:_t).filter(_t=>_t)}function dn(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;const Qe=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Qe&&kt(Qe,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 cn(){if(t.input=Ht(),!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=Ba(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"),t._positionElement=t.config.positionElement||t._input}function Dn(){const Qe=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=Ba("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Qe,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Qe==="datetime-local"?"Y-m-d\\TH:i:S":Qe==="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{}_(t.mobileInput,"change",_t=>{t.setDate(kf(_t).value,!1,t.mobileFormatStr),wn("onChange"),wn("onClose")})}function Pn(Qe){if(t.isOpen===!0)return t.close();t.open(Qe)}function wn(Qe,_t){if(t.config===void 0)return;const ot=t.config[Qe];if(ot!==void 0&&ot.length>0)for(let It=0;ot[It]&&It<ot.length;It++)ot[It](t.selectedDates,t.input.value,t,_t);Qe==="onChange"&&(t.input.dispatchEvent(St("change")),t.input.dispatchEvent(St("input")))}function St(Qe){const _t=document.createEvent("Event");return _t.initEvent(Qe,!0,!0),_t}function br(Qe){for(let _t=0;_t<t.selectedDates.length;_t++)if(zf(t.selectedDates[_t],Qe)===0)return""+_t;return!1}function Un(Qe){return t.config.mode!=="range"||t.selectedDates.length<2?!1:zf(Qe,t.selectedDates[0])>=0&&zf(Qe,t.selectedDates[1])<=0}function zn(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach((Qe,_t)=>{const ot=new Date(t.currentYear,t.currentMonth,1);ot.setMonth(t.currentMonth+_t),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[_t].textContent=sv(ot.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ot.getMonth().toString(),Qe.value=ot.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 On(Qe){return t.selectedDates.map(_t=>t.formatDate(_t,Qe)).filter((_t,ot,It)=>t.config.mode!=="range"||t.config.enableTime||It.indexOf(_t)===ot).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Ut(Qe=!0){t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=On(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=On(t.config.altFormat)),Qe!==!1&&wn("onValueUpdate")}function Kn(Qe){const _t=kf(Qe),ot=t.prevMonthNav.contains(_t),It=t.nextMonthNav.contains(_t);ot||It?pe(ot?-1:1):t.yearElements.indexOf(_t)>=0?_t.select():_t.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):_t.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Hr(Qe){Qe.preventDefault();const _t=Qe.type==="keydown",ot=kf(Qe),It=ot;t.amPM!==void 0&&ot===t.amPM&&(t.amPM.textContent=t.l10n.amPM[qf(t.amPM.textContent===t.l10n.amPM[0])]);const fn=parseFloat(It.getAttribute("min")),an=parseFloat(It.getAttribute("max")),jn=parseFloat(It.getAttribute("step")),xn=parseInt(It.value,10),yr=Qe.delta||(_t?Qe.which===38?1:-1:0);let pr=xn+jn*yr;if(typeof It.value<"u"&&It.value.length===2){const vi=It===t.hourElement,Gi=It===t.minuteElement;pr<fn?(pr=an+pr+qf(!vi)+(qf(vi)&&qf(!t.amPM)),Gi&&T(void 0,-1,t.hourElement)):pr>an&&(pr=It===t.hourElement?pr-an-qf(!t.amPM):fn,Gi&&T(void 0,1,t.hourElement)),t.amPM&&vi&&(jn===1?pr+xn===23:Math.abs(pr-xn)>jn)&&(t.amPM.textContent=t.l10n.amPM[qf(t.amPM.textContent===t.l10n.amPM[0])]),It.value=x2(pr)}}return i(),t}function jh(n,e){const t=Array.prototype.slice.call(n).filter(i=>i instanceof HTMLElement),r=[];for(let i=0;i<t.length;i++){const a=t[i];try{if(a.getAttribute("data-fp-omit")!==null)continue;a._flatpickr!==void 0&&(a._flatpickr.destroy(),a._flatpickr=void 0),a._flatpickr=vie(a,e||{}),r.push(a._flatpickr)}catch(o){console.error(o)}}return r.length===1?r[0]:r}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return jh(this,n)},HTMLElement.prototype.flatpickr=function(n){return jh([this],n)});var is=function(n,e){return typeof n=="string"?jh(window.document.querySelectorAll(n),e):n instanceof Node?jh([n],e):jh(n,e)};is.defaultConfig={};is.l10ns={en:Object.assign({},Yg),default:Object.assign({},Yg)};is.localize=n=>{is.l10ns.default=Object.assign(Object.assign({},is.l10ns.default),n)};is.setDefaults=n=>{is.defaultConfig=Object.assign(Object.assign({},is.defaultConfig),n)};is.parseDate=s$({});is.formatDate=bq({});is.compareDates=zf;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return jh(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=is);function _ie(n){let e,t=[n[1]],r={};for(let i=0;i<t.length;i+=1)r=au(r,t[i]);return{c(){e=X("input"),MA(e,r)},m(i,a){C(i,e,a),e.autofocus&&e.focus(),n[11](e)},p(i,a){MA(e,r=Rd(t,[a&2&&i[1]]))},d(i){i&&M(e),n[11](null)}}}function bie(n){let e;const t=n[10].default,r=Xn(t,n,n[9],null),i=r||_ie(n);return{c(){i&&i.c()},m(a,o){i&&i.m(a,o),e=!0},p(a,[o]){r?r.p&&(!e||o&512)&&Zn(r,t,a,a[9],e?Jn(t,a[9],o,null):Qn(a[9]),null):i&&i.p&&(!e||o&3)&&i.p(a,e?o:-1)},i(a){e||(b(i,a),e=!0)},o(a){$(i,a),e=!1},d(a){i&&i.d(a)}}}function yie(n){return n.charAt(2).toLowerCase()+n.substring(3)}function $ie(n,e,t){const r=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let i=Kh(e,r),{$$slots:a={},$$scope:o}=e;const l=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:s="",formattedValue:u="",element:c=null,dateFormat:f=null}=e,{options:h={}}=e,m=!1,{input:_=void 0,flatpickr:y=void 0}=e;ar(()=>{const I=c||_,P=A(h);return P.onReady.push(()=>{t(8,m=!0)}),t(3,y=is(I,Object.assign(P,c?{wrap:!0}:{}))),()=>{y.destroy()}});const w=Nn();function A(I={}){I=Object.assign({},I);for(const P of l){const V=(j,U,W)=>{w(yie(P),[j,U,W])};P in I?(Array.isArray(I[P])||(I[P]=[I[P]]),I[P].push(V)):I[P]=[V]}return I.onChange&&!I.onChange.includes(S)&&I.onChange.push(S),I}function S(I,P){t(2,s=Array.isArray(I)&&I.length===1?I[0]:I),t(4,u=P)}function T(I){De[I?"unshift":"push"](()=>{_=I,t(0,_)})}return n.$$set=I=>{e=au(au({},e),Ug(I)),t(1,i=Kh(e,r)),"value"in I&&t(2,s=I.value),"formattedValue"in I&&t(4,u=I.formattedValue),"element"in I&&t(5,c=I.element),"dateFormat"in I&&t(6,f=I.dateFormat),"options"in I&&t(7,h=I.options),"input"in I&&t(0,_=I.input),"flatpickr"in I&&t(3,y=I.flatpickr),"$$scope"in I&&t(9,o=I.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&y&&m&&y.setDate(s,!1,f),n.$$.dirty&392&&y&&m)for(const[I,P]of Object.entries(A(h)))y.set(I,P)},[_,i,s,y,u,c,f,h,m,o,a,T]}class wie extends Ve{constructor(e){super(),Pe(this,e,$ie,bie,Ie,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function UC(n){let e,t;return{c(){e=ut("svg"),t=ut("use"),Gr(t,"xlink:href","#spectrum-icon-18-Alert"),D(e,"class","spectrum-Icon spectrum-Icon--sizeM spectrum-Textfield-validationIcon"),D(e,"focusable","false"),D(e,"aria-hidden","true")},m(r,i){C(r,e,i),x(e,t)},d(r){r&&M(e)}}}function kie(n){let e,t,r,i,a,o,l,s,u=!!n[2]&&UC();return{c(){e=X("div"),t=X("div"),u&&u.c(),r=q(),i=X("input"),a=q(),o=X("button"),o.innerHTML='<svg class="spectrum-Icon spectrum-Icon--sizeM" focusable="false" aria-hidden="true" aria-label="Calendar"><use xlink:href="#spectrum-icon-18-Calendar"></use></svg>',D(i,"data-input",""),D(i,"type","text"),D(i,"class","spectrum-Textfield-input spectrum-InputGroup-input svelte-s5xzv8"),D(i,"placeholder",n[4]),D(i,"id",n[0]),i.value=n[3],Te(i,"is-disabled",n[1]),D(t,"class","spectrum-Textfield spectrum-InputGroup-textfield svelte-s5xzv8"),Te(t,"is-disabled",n[1]),Te(t,"is-invalid",!!n[2]),D(o,"type","button"),D(o,"class","spectrum-Picker spectrum-Picker--sizeM spectrum-InputGroup-button svelte-s5xzv8"),D(o,"tabindex","-1"),Te(o,"is-disabled",n[1]),Te(o,"is-invalid",!!n[2]),D(e,"id",n[10]),D(e,"class","flatpickr spectrum-InputGroup spectrum-Datepicker svelte-s5xzv8"),D(e,"aria-readonly","false"),D(e,"aria-required","false"),D(e,"aria-haspopup","true"),Te(e,"is-disabled",n[1]),Te(e,"is-invalid",!!n[2]),Te(e,"is-focused",n[6])},m(c,f){C(c,e,f),x(e,t),u&&u.m(t,null),x(t,r),x(t,i),x(e,a),x(e,o),l||(s=[At(t,"click",function(){var h,m;kn((h=n[7])==null?void 0:h.open)&&((m=n[7])==null||m.open.apply(this,arguments))}),At(o,"click",function(){var h,m;kn((h=n[7])==null?void 0:h.open)&&((m=n[7])==null||m.open.apply(this,arguments))})],l=!0)},p(c,f){n=c,n[2]?u||(u=UC(),u.c(),u.m(t,r)):u&&(u.d(1),u=null),f&16&&D(i,"placeholder",n[4]),f&1&&D(i,"id",n[0]),f&8&&i.value!==n[3]&&(i.value=n[3]),f&2&&Te(i,"is-disabled",n[1]),f&2&&Te(t,"is-disabled",n[1]),f&4&&Te(t,"is-invalid",!!n[2]),f&2&&Te(o,"is-disabled",n[1]),f&4&&Te(o,"is-invalid",!!n[2]),f&2&&Te(e,"is-disabled",n[1]),f&4&&Te(e,"is-invalid",!!n[2]),f&64&&Te(e,"is-focused",n[6])},d(c){c&&M(e),u&&u.d(),l=!1,Vi(s)}}}function qC(n){let e,t,r;function i(o){n[20](o)}let a={value:n[5]?n[3]:n[14](n[3]),options:n[8],element:`#${n[10]}`,$$slots:{default:[kie]},$$scope:{ctx:n}};return n[7]!==void 0&&(a.flatpickr=n[7]),e=new wie({props:a}),De.push(()=>tt(e,"flatpickr",i)),e.$on("open",n[12]),e.$on("close",n[13]),e.$on("change",n[11]),{c(){O(e.$$.fragment)},m(o,l){B(e,o,l),r=!0},p(o,l){const s={};l&40&&(s.value=o[5]?o[3]:o[14](o[3])),l&256&&(s.options=o[8]),l&16777439&&(s.$$scope={dirty:l,ctx:o}),!t&&l&128&&(t=!0,s.flatpickr=o[7],rt(()=>t=!1)),e.$set(s)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){$(e.$$.fragment,o),r=!1},d(o){H(e,o)}}}function WC(n){let e,t,r;return{c(){e=X("div"),D(e,"class","overlay svelte-s5xzv8")},m(i,a){C(i,e,a),t||(r=At(e,"mousedown",Mg(function(){var o,l;kn((o=n[7])==null?void 0:o.close)&&((l=n[7])==null||l.close.apply(this,arguments))})),t=!0)},p(i,a){n=i},d(i){i&&M(e),t=!1,r()}}}function zie(n){let e=n[9],t,r,i,a=qC(n),o=n[6]&&WC(n);return{c(){a.c(),t=q(),o&&o.c(),r=yt()},m(l,s){a.m(l,s),C(l,t,s),o&&o.m(l,s),C(l,r,s),i=!0},p(l,[s]){s&512&&Ie(e,e=l[9])?(we(),$(a,1,1,ht),ke(),a=qC(l),a.c(),b(a,1),a.m(t.parentNode,t)):a.p(l,s),l[6]?o?o.p(l,s):(o=WC(l),o.c(),o.m(r.parentNode,r)):o&&(o.d(1),o=null)},i(l){i||(b(a),i=!0)},o(l){$(a),i=!1},d(l){a.d(l),l&&M(t),o&&o.d(l),l&&M(r)}}}function Aie(n,e,t){let r,{id:i=null}=e,{disabled:a=!1}=e,{error:o=null}=e,{enableTime:l=!0}=e,{value:s=null}=e,{placeholder:u=null}=e,{appendTo:c=void 0}=e,{timeOnly:f=!1}=e,{ignoreTimezones:h=!1}=e,{time24hr:m=!1}=e,{range:_=!1}=e;const y=Nn(),w=`${C4()}-wrapper`;let A=!1,S,T;const I=Q=>{let le=new Date(`0-${Q}`);return le instanceof Date&&!isNaN(le.getTime())?le:null},P=Q=>{const[le]=Q.detail,ie=l&&!f&&h;let K=le[0];if(K&&(K=K.toISOString()),f)!s&&K&&(K=new Date(le[0].getTime()+60*60*1e3).toISOString()),K=`2000-01-01T${K.split("T")[1]}`;else if(l){if(ie){const G=le[0].getTimezoneOffset()*6e4;K=new Date(le[0].getTime()-G).toISOString().slice(0,-1)}}else{const G=le[0].getFullYear(),re=`${le[0].getMonth()+1}`.padStart(2,"0"),se=`${le[0].getDate()}`.padStart(2,"0");K=`${G}-${re}-${se}T00:00:00.000`}_?y("change",Q.detail):y("change",K)},V=Q=>{["Backspace","Clear","Delete"].includes(Q.key)&&(y("change",null),S.close())},j=()=>{t(6,A=!0),document.addEventListener("keyup",V)},U=()=>{t(6,A=!1),document.removeEventListener("keyup",V),document.querySelectorAll(`#${w} input`).forEach(le=>le.blur())},W=Q=>{if(!Q)return null;let le,ie,K=I(Q);return f&&K?le=K:Q instanceof Date?le=Q:isNaN(Q)?le=new Date(Q):le=new Date(parseInt(Q)),ie=le.getTime(),isNaN(ie)?null:new Date(Math.floor(ie/1e3)*1e3)};function te(Q){S=Q,t(7,S)}return n.$$set=Q=>{"id"in Q&&t(0,i=Q.id),"disabled"in Q&&t(1,a=Q.disabled),"error"in Q&&t(2,o=Q.error),"enableTime"in Q&&t(15,l=Q.enableTime),"value"in Q&&t(3,s=Q.value),"placeholder"in Q&&t(4,u=Q.placeholder),"appendTo"in Q&&t(16,c=Q.appendTo),"timeOnly"in Q&&t(17,f=Q.timeOnly),"ignoreTimezones"in Q&&t(18,h=Q.ignoreTimezones),"time24hr"in Q&&t(19,m=Q.time24hr),"range"in Q&&t(5,_=Q.range)},n.$$.update=()=>{n.$$.dirty&753704&&t(8,T={element:`#${w}`,enableTime:f||l||!1,noCalendar:f||!1,altInput:!0,time_24hr:m||!1,altFormat:f?"H:i":l?"F j Y, H:i":"F j, Y",wrap:!0,mode:_?"range":null,appendTo:c,disableMobile:"true",onReady:()=>{let Q=I(s);f&&Q&&y("change",Q.toISOString())}}),n.$$.dirty&688128&&t(9,r={timeOnly:f,enableTime:l,time24hr:m})},[i,a,o,s,u,_,A,S,T,r,w,P,j,U,W,l,c,f,h,m,te]}class Mie extends Ve{constructor(e){super(),Pe(this,e,Aie,zie,Ie,{id:0,disabled:1,error:2,enableTime:15,value:3,placeholder:4,appendTo:16,timeOnly:17,ignoreTimezones:18,time24hr:19,range:5})}}function Cie(n){let e,t;return e=new Mie({props:{error:n[4],disabled:n[3],value:n[0],placeholder:n[8],enableTime:n[5],timeOnly:n[6],time24hr:n[7],appendTo:n[9],ignoreTimezones:n[10],range:n[11]}}),e.$on("change",n[12]),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&16&&(a.error=r[4]),i&8&&(a.disabled=r[3]),i&1&&(a.value=r[0]),i&256&&(a.placeholder=r[8]),i&32&&(a.enableTime=r[5]),i&64&&(a.timeOnly=r[6]),i&128&&(a.time24hr=r[7]),i&512&&(a.appendTo=r[9]),i&1024&&(a.ignoreTimezones=r[10]),i&2048&&(a.range=r[11]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Sie(n){let e,t;return e=new Sc({props:{label:n[1],labelPosition:n[2],error:n[4],$$slots:{default:[Cie]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,[i]){const a={};i&2&&(a.label=r[1]),i&4&&(a.labelPosition=r[2]),i&16&&(a.error=r[4]),i&20473&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Lie(n,e,t){let{value:r=null}=e,{label:i=null}=e,{labelPosition:a="above"}=e,{disabled:o=!1}=e,{error:l=null}=e,{enableTime:s=!0}=e,{timeOnly:u=!1}=e,{time24hr:c=!1}=e,{placeholder:f=null}=e,{appendTo:h=void 0}=e,{ignoreTimezones:m=!1}=e,{range:_=!1}=e;const y=Nn(),w=A=>{_?t(0,r=A==null?void 0:A.detail[1]):t(0,r=A.detail),y("change",A.detail)};return n.$$set=A=>{"value"in A&&t(0,r=A.value),"label"in A&&t(1,i=A.label),"labelPosition"in A&&t(2,a=A.labelPosition),"disabled"in A&&t(3,o=A.disabled),"error"in A&&t(4,l=A.error),"enableTime"in A&&t(5,s=A.enableTime),"timeOnly"in A&&t(6,u=A.timeOnly),"time24hr"in A&&t(7,c=A.time24hr),"placeholder"in A&&t(8,f=A.placeholder),"appendTo"in A&&t(9,h=A.appendTo),"ignoreTimezones"in A&&t(10,m=A.ignoreTimezones),"range"in A&&t(11,_=A.range)},[r,i,a,o,l,s,u,c,f,h,m,_,w]}class f5 extends Ve{constructor(e){super(),Pe(this,e,Lie,Sie,Ie,{value:0,label:1,labelPosition:2,disabled:3,error:4,enableTime:5,timeOnly:6,time24hr:7,placeholder:8,appendTo:9,ignoreTimezones:10,range:11})}}function Eie(n){var r;let e,t;return e=new pq({props:{id:n[1],error:n[3],disabled:n[2],readonly:n[7],fieldText:n[13],options:n[4],isPlaceholder:!((r=n[0])!=null&&r.length),autocomplete:n[8],isOptionSelected:n[12],getOptionLabel:n[5],getOptionValue:n[6],onSelectOption:n[11],sort:n[9],autoWidth:n[10]}}),{c(){O(e.$$.fragment)},m(i,a){B(e,i,a),t=!0},p(i,[a]){var l;const o={};a&2&&(o.id=i[1]),a&8&&(o.error=i[3]),a&4&&(o.disabled=i[2]),a&128&&(o.readonly=i[7]),a&8192&&(o.fieldText=i[13]),a&16&&(o.options=i[4]),a&1&&(o.isPlaceholder=!((l=i[0])!=null&&l.length)),a&256&&(o.autocomplete=i[8]),a&4096&&(o.isOptionSelected=i[12]),a&32&&(o.getOptionLabel=i[5]),a&64&&(o.getOptionValue=i[6]),a&2048&&(o.onSelectOption=i[11]),a&512&&(o.sort=i[9]),a&1024&&(o.autoWidth=i[10]),e.$set(o)},i(i){t||(b(e.$$.fragment,i),t=!0)},o(i){$(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Tie(n,e,t){let r,i,a,o,l,{value:s=[]}=e,{id:u=null}=e,{placeholder:c=null}=e,{disabled:f=!1}=e,{error:h=null}=e,{options:m=[]}=e,{getOptionLabel:_=W=>W}=e,{getOptionValue:y=W=>W}=e,{readonly:w=!1}=e,{autocomplete:A=!1}=e,{sort:S=!1}=e,{autoWidth:T=!1}=e;const I=Nn(),P=(W,te,Q)=>{if(Array.isArray(W)&&W.length>0){if(!te)return"";const le=W.map(ie=>te[ie]||ie).join(", ");return`(${W.length}) ${le}`}else return Q||"Choose some options"},V=W=>{let te={};return Array.isArray(W)&&W.length>0&&W.forEach(Q=>{Q&&(te[Q]=!0)}),te},j=W=>{let te=null;return W!=null&&W.length&&(te={},W.forEach((Q,le)=>{const ie=y(Q,le);ie!=null&&(te[ie]=_(Q,le)||"")})),te},U=(W,te)=>Q=>{if(W[Q]){const le=te.filter(ie=>ie!==Q);I("change",le)}else I("change",[...te,Q])};return n.$$set=W=>{"value"in W&&t(0,s=W.value),"id"in W&&t(1,u=W.id),"placeholder"in W&&t(14,c=W.placeholder),"disabled"in W&&t(2,f=W.disabled),"error"in W&&t(3,h=W.error),"options"in W&&t(4,m=W.options),"getOptionLabel"in W&&t(5,_=W.getOptionLabel),"getOptionValue"in W&&t(6,y=W.getOptionValue),"readonly"in W&&t(7,w=W.readonly),"autocomplete"in W&&t(8,A=W.autocomplete),"sort"in W&&t(9,S=W.sort),"autoWidth"in W&&t(10,T=W.autoWidth)},n.$$.update=()=>{n.$$.dirty&1&&t(15,r=V(s)),n.$$.dirty&16&&t(16,i=j(m)),n.$$.dirty&81921&&t(13,a=P(s,i,c)),n.$$.dirty&32768&&t(12,o=W=>r[W]===!0),n.$$.dirty&32769&&t(11,l=U(r,s))},[s,u,f,h,m,_,y,w,A,S,T,l,o,a,c,r,i]}class Die extends Ve{constructor(e){super(),Pe(this,e,Tie,Eie,Ie,{value:0,id:1,placeholder:14,disabled:2,error:3,options:4,getOptionLabel:5,getOptionValue:6,readonly:7,autocomplete:8,sort:9,autoWidth:10})}}function Bie(n){let e,t;return e=new Die({props:{error:n[5],disabled:n[2],readonly:n[3],value:n[0],options:n[7],placeholder:n[6],sort:n[10],getOptionLabel:n[8],getOptionValue:n[9],autoWidth:n[11]}}),e.$on("change",n[12]),e.$on("click",n[13]),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&32&&(a.error=r[5]),i&4&&(a.disabled=r[2]),i&8&&(a.readonly=r[3]),i&1&&(a.value=r[0]),i&128&&(a.options=r[7]),i&64&&(a.placeholder=r[6]),i&1024&&(a.sort=r[10]),i&256&&(a.getOptionLabel=r[8]),i&512&&(a.getOptionValue=r[9]),i&2048&&(a.autoWidth=r[11]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Hie(n){let e,t;return e=new Sc({props:{label:n[1],labelPosition:n[4],error:n[5],$$slots:{default:[Bie]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,[i]){const a={};i&2&&(a.label=r[1]),i&16&&(a.labelPosition=r[4]),i&32&&(a.error=r[5]),i&36845&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Oie(n,e,t){let{value:r=[]}=e,{label:i=null}=e,{disabled:a=!1}=e,{readonly:o=!1}=e,{labelPosition:l="above"}=e,{error:s=null}=e,{placeholder:u=null}=e,{options:c=[]}=e,{getOptionLabel:f=S=>S}=e,{getOptionValue:h=S=>S}=e,{sort:m=!1}=e,{autoWidth:_=!1}=e;const y=Nn(),w=S=>{t(0,r=S.detail),y("change",S.detail)};function A(S){Hn.call(this,n,S)}return n.$$set=S=>{"value"in S&&t(0,r=S.value),"label"in S&&t(1,i=S.label),"disabled"in S&&t(2,a=S.disabled),"readonly"in S&&t(3,o=S.readonly),"labelPosition"in S&&t(4,l=S.labelPosition),"error"in S&&t(5,s=S.error),"placeholder"in S&&t(6,u=S.placeholder),"options"in S&&t(7,c=S.options),"getOptionLabel"in S&&t(8,f=S.getOptionLabel),"getOptionValue"in S&&t(9,h=S.getOptionValue),"sort"in S&&t(10,m=S.sort),"autoWidth"in S&&t(11,_=S.autoWidth)},[r,i,a,o,l,s,u,c,f,h,m,_,w,A]}class _5 extends Ve{constructor(e){super(),Pe(this,e,Oie,Hie,Ie,{value:0,label:1,disabled:2,readonly:3,labelPosition:4,error:5,placeholder:6,options:7,getOptionLabel:8,getOptionValue:9,sort:10,autoWidth:11})}}function Iie(n){let e,t=(typeof n[0]=="object"?JSON.stringify(n[0]):n[0])+"",r;return{c(){e=X("div"),r=oe(t),D(e,"class","svelte-186zidf")},m(i,a){C(i,e,a),x(e,r)},p(i,[a]){a&1&&t!==(t=(typeof i[0]=="object"?JSON.stringify(i[0]):i[0])+"")&>(r,t)},i:ht,o:ht,d(i){i&&M(e)}}}function Pie(n,e,t){let{value:r}=e;return n.$$set=i=>{"value"in i&&t(0,r=i.value)},[r]}class qm extends Ve{constructor(e){super(),Pe(this,e,Pie,Iie,Ie,{value:0})}}function Vie(n){let e,t,r,i,a;return{c(){e=X("label"),t=X("input"),i=q(),a=X("span"),a.innerHTML=`<svg class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark" focusable="false" aria-hidden="true"><use xlink:href="#spectrum-css-icon-Checkmark100"></use></svg>
|
|
32
|
+
`}function be(){t.calendarContainer.classList.add("hasWeeks");const Qe=Ba("div","flatpickr-weekwrapper");Qe.appendChild(Ba("span","flatpickr-weekday",t.l10n.weekAbbreviation));const _t=Ba("div","flatpickr-weeks");return Qe.appendChild(_t),{weekWrapper:Qe,weekNumbers:_t}}function pe(Qe,_t=!0){const ot=_t?Qe:Qe-t.currentMonth;ot<0&&t._hidePrevMonthArrow===!0||ot>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ot,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,wn("onYearChange"),le()),Q(),wn("onMonthChange"),zn())}function _e(Qe=!0,_t=!0){if(t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,_t===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){const{hours:ot,minutes:It,seconds:fn}=zb(t.config);h(ot,It,fn)}t.redraw(),Qe&&wn("onChange")}function Ae(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),wn("onClose")}function me(){t.config!==void 0&&wn("onDestroy");for(let Qe=t._handlers.length;Qe--;)t._handlers[Qe].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){const Qe=t.calendarContainer.parentNode;if(Qe.lastChild&&Qe.removeChild(Qe.lastChild),Qe.parentNode){for(;Qe.firstChild;)Qe.parentNode.insertBefore(Qe.firstChild,Qe);Qe.parentNode.removeChild(Qe)}}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(Qe=>{try{delete t[Qe]}catch{}})}function it(Qe){return t.config.appendTo&&t.config.appendTo.contains(Qe)?!0:t.calendarContainer.contains(Qe)}function $e(Qe){if(t.isOpen&&!t.config.inline){const _t=kf(Qe),ot=it(_t),It=_t===t.input||_t===t.altInput||t.element.contains(_t)||Qe.path&&Qe.path.indexOf&&(~Qe.path.indexOf(t.input)||~Qe.path.indexOf(t.altInput)),fn=Qe.type==="blur"?It&&Qe.relatedTarget&&!it(Qe.relatedTarget):!It&&!ot&&!it(Qe.relatedTarget),an=!t.config.ignoredFocusElements.some(jn=>jn.contains(_t));fn&&an&&(t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&l(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&(t.clear(!1),t.redraw()))}}function Me(Qe){if(!Qe||t.config.minDate&&Qe<t.config.minDate.getFullYear()||t.config.maxDate&&Qe>t.config.maxDate.getFullYear())return;const _t=Qe,ot=t.currentYear!==_t;t.currentYear=_t||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)),ot&&(t.redraw(),wn("onYearChange"),le())}function Be(Qe,_t=!0){var ot;const It=t.parseDate(Qe,void 0,_t);if(t.config.minDate&&It&&zf(It,t.config.minDate,_t!==void 0?_t:!t.minDateHasTime)<0||t.config.maxDate&&It&&zf(It,t.config.maxDate,_t!==void 0?_t:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(It===void 0)return!1;const fn=!!t.config.enable,an=(ot=t.config.enable)!==null&&ot!==void 0?ot:t.config.disable;for(let jn=0,xn;jn<an.length;jn++){if(xn=an[jn],typeof xn=="function"&&xn(It))return fn;if(xn instanceof Date&&It!==void 0&&xn.getTime()===It.getTime())return fn;if(typeof xn=="string"){const yr=t.parseDate(xn,void 0,!0);return yr&&yr.getTime()===It.getTime()?fn:!fn}else if(typeof xn=="object"&&It!==void 0&&xn.from&&xn.to&&It.getTime()>=xn.from.getTime()&&It.getTime()<=xn.to.getTime())return fn}return!fn}function xe(Qe){return t.daysContainer!==void 0?Qe.className.indexOf("hidden")===-1&&Qe.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Qe):!1}function ve(Qe){Qe.target===t._input&&(t.selectedDates.length>0||t._input.value.length>0)&&!(Qe.relatedTarget&&it(Qe.relatedTarget))&&t.setDate(t._input.value,!0,Qe.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function st(Qe){const _t=kf(Qe),ot=t.config.wrap?n.contains(_t):_t===t._input,It=t.config.allowInput,fn=t.isOpen&&(!It||!ot),an=t.config.inline&&ot&&!It;if(Qe.keyCode===13&&ot){if(It)return t.setDate(t._input.value,!0,_t===t.altInput?t.config.altFormat:t.config.dateFormat),_t.blur();t.open()}else if(it(_t)||fn||an){const jn=!!t.timeContainer&&t.timeContainer.contains(_t);switch(Qe.keyCode){case 13:jn?(Qe.preventDefault(),l(),Se()):Re(Qe);break;case 27:Qe.preventDefault(),Se();break;case 8:case 46:ot&&!t.config.allowInput&&(Qe.preventDefault(),t.clear());break;case 37:case 39:if(!jn&&!ot){if(Qe.preventDefault(),t.daysContainer!==void 0&&(It===!1||document.activeElement&&xe(document.activeElement))){const yr=Qe.keyCode===39?1:-1;Qe.ctrlKey?(Qe.stopPropagation(),pe(yr),W(j(1),0)):W(void 0,yr)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Qe.preventDefault();const xn=Qe.keyCode===40?1:-1;t.daysContainer&&_t.$i!==void 0||_t===t.input||_t===t.altInput?Qe.ctrlKey?(Qe.stopPropagation(),Me(t.currentYear-xn),W(j(1),0)):jn||W(void 0,xn*7):_t===t.currentYearElement?Me(t.currentYear-xn):t.config.enableTime&&(!jn&&t.hourElement&&t.hourElement.focus(),l(Qe),t._debouncedChange());break;case 9:if(jn){const yr=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(vi=>vi),pr=yr.indexOf(_t);if(pr!==-1){const vi=yr[pr+(Qe.shiftKey?-1:1)];Qe.preventDefault(),(vi||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(_t)&&Qe.shiftKey&&(Qe.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&_t===t.amPM)switch(Qe.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Ut();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Ut();break}(ot||it(_t))&&wn("onKeyDown",Qe)}function dt(Qe){if(t.selectedDates.length!==1||Qe&&(!Qe.classList.contains("flatpickr-day")||Qe.classList.contains("flatpickr-disabled")))return;const _t=Qe?Qe.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ot=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),It=Math.min(_t,t.selectedDates[0].getTime()),fn=Math.max(_t,t.selectedDates[0].getTime());let an=!1,jn=0,xn=0;for(let yr=It;yr<fn;yr+=mie.DAY)Be(new Date(yr),!0)||(an=an||yr>It&&yr<fn,yr<ot&&(!jn||yr>jn)?jn=yr:yr>ot&&(!xn||yr<xn)&&(xn=yr));for(let yr=0;yr<t.config.showMonths;yr++){const pr=t.daysContainer.children[yr];for(let vi=0,Gi=pr.children.length;vi<Gi;vi++){const hi=pr.children[vi],Qa=hi.dateObj.getTime(),Qo=jn>0&&Qa<jn||xn>0&&Qa>xn;if(Qo){hi.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(s1=>{hi.classList.remove(s1)});continue}else if(an&&!Qo)continue;["startRange","inRange","endRange","notAllowed"].forEach(s1=>{hi.classList.remove(s1)}),Qe!==void 0&&(Qe.classList.add(_t<=t.selectedDates[0].getTime()?"startRange":"endRange"),ot<_t&&Qa===ot?hi.classList.add("startRange"):ot>_t&&Qa===ot&&hi.classList.add("endRange"),Qa>=jn&&(xn===0||Qa<=xn)&&hie(Qa,ot,_t)&&hi.classList.add("inRange"))}}}function vt(){t.isOpen&&!t.config.static&&!t.config.inline&&Tt()}function Ze(Qe,_t=t._positionElement){if(t.isMobile===!0){if(Qe){Qe.preventDefault();const It=kf(Qe);It&&It.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),wn("onOpen");return}else if(t._input.disabled||t.config.inline)return;const ot=t.isOpen;t.isOpen=!0,ot||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),wn("onOpen"),Tt(_t)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Qe===void 0||!t.timeContainer.contains(Qe.relatedTarget))&&setTimeout(()=>t.hourElement.select(),50)}function We(Qe){return _t=>{const ot=t.config[`_${Qe}Date`]=t.parseDate(_t,t.config.dateFormat),It=t.config[`_${Qe==="min"?"max":"min"}Date`];ot!==void 0&&(t[Qe==="min"?"minDateHasTime":"maxDateHasTime"]=ot.getHours()>0||ot.getMinutes()>0||ot.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(fn=>Be(fn)),!t.selectedDates.length&&Qe==="min"&&f(ot),Ut()),t.daysContainer&&(at(),ot!==void 0?t.currentYearElement[Qe]=ot.getFullYear().toString():t.currentYearElement.removeAttribute(Qe),t.currentYearElement.disabled=!!It&&ot!==void 0&&It.getFullYear()===ot.getFullYear())}}function nt(){const Qe=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],_t=Object.assign(Object.assign({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ot={};t.config.parseDate=_t.parseDate,t.config.formatDate=_t.formatDate,Object.defineProperty(t.config,"enable",{get:()=>t.config._enable,set:an=>{t.config._enable=Jt(an)}}),Object.defineProperty(t.config,"disable",{get:()=>t.config._disable,set:an=>{t.config._disable=Jt(an)}});const It=_t.mode==="time";if(!_t.dateFormat&&(_t.enableTime||It)){const an=is.defaultConfig.dateFormat||Fh.dateFormat;ot.dateFormat=_t.noCalendar||It?"H:i"+(_t.enableSeconds?":S":""):an+" H:i"+(_t.enableSeconds?":S":"")}if(_t.altInput&&(_t.enableTime||It)&&!_t.altFormat){const an=is.defaultConfig.altFormat||Fh.altFormat;ot.altFormat=_t.noCalendar||It?"h:i"+(_t.enableSeconds?":S K":" K"):an+` h:i${_t.enableSeconds?":S":""} K`}Object.defineProperty(t.config,"minDate",{get:()=>t.config._minDate,set:We("min")}),Object.defineProperty(t.config,"maxDate",{get:()=>t.config._maxDate,set:We("max")});const fn=an=>jn=>{t.config[an==="min"?"_minTime":"_maxTime"]=t.parseDate(jn,"H:i:S")};Object.defineProperty(t.config,"minTime",{get:()=>t.config._minTime,set:fn("min")}),Object.defineProperty(t.config,"maxTime",{get:()=>t.config._maxTime,set:fn("max")}),_t.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ot,_t);for(let an=0;an<Qe.length;an++)t.config[Qe[an]]=t.config[Qe[an]]===!0||t.config[Qe[an]]==="true";$b.filter(an=>t.config[an]!==void 0).forEach(an=>{t.config[an]=wb(t.config[an]||[]).map(a)}),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(let an=0;an<t.config.plugins.length;an++){const jn=t.config.plugins[an](t)||{};for(const xn in jn)$b.indexOf(xn)>-1?t.config[xn]=wb(jn[xn]).map(a).concat(t.config[xn]):typeof _t[xn]>"u"&&(t.config[xn]=jn[xn])}_t.altInputClass||(t.config.altInputClass=Ht().className+" "+t.config.altInputClass),wn("onParseConfig")}function Ht(){return t.config.wrap?n.querySelector("[data-input]"):n}function on(){typeof t.config.locale!="object"&&typeof is.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error(`flatpickr: invalid locale ${t.config.locale}`)),t.l10n=Object.assign(Object.assign({},is.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?is.l10ns[t.config.locale]:void 0),l$.K=`(${t.l10n.amPM[0]}|${t.l10n.amPM[1]}|${t.l10n.amPM[0].toLowerCase()}|${t.l10n.amPM[1].toLowerCase()})`,Object.assign(Object.assign({},e),JSON.parse(JSON.stringify(n.dataset||{}))).time_24hr===void 0&&is.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=bq(t),t.parseDate=s$({config:t.config,l10n:t.l10n})}function Tt(Qe){if(typeof t.config.position=="function")return void t.config.position(t,Qe);if(t.calendarContainer===void 0)return;wn("onPreCalendarPosition");const _t=Qe||t._positionElement,ot=Array.prototype.reduce.call(t.calendarContainer.children,(n1,Is)=>n1+Is.offsetHeight,0),It=t.calendarContainer.offsetWidth,fn=t.config.position.split(" "),an=fn[0],jn=fn.length>1?fn[1]:null,xn=_t.getBoundingClientRect(),yr=window.innerHeight-xn.bottom,pr=an==="above"||an!=="below"&&yr<ot&&xn.top>ot,vi=window.pageYOffset+xn.top+(pr?-ot-2:_t.offsetHeight+2);if(n2(t.calendarContainer,"arrowTop",!pr),n2(t.calendarContainer,"arrowBottom",pr),t.config.inline)return;let Gi=window.pageXOffset+xn.left,hi=!1,ls=!1;jn==="center"?(Gi-=(It-xn.width)/2,hi=!0):jn==="right"&&(Gi-=It-xn.width,ls=!0),n2(t.calendarContainer,"arrowLeft",!hi&&!ls),n2(t.calendarContainer,"arrowCenter",hi),n2(t.calendarContainer,"arrowRight",ls);const Qa=window.document.body.offsetWidth-(window.pageXOffset+xn.right),Qo=Gi+It>window.document.body.offsetWidth,s1=Qa+It>window.document.body.offsetWidth;if(n2(t.calendarContainer,"rightMost",Qo),!t.config.static)if(t.calendarContainer.style.top=`${vi}px`,!Qo)t.calendarContainer.style.left=`${Gi}px`,t.calendarContainer.style.right="auto";else if(!s1)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=`${Qa}px`;else{const n1=he();if(n1===void 0)return;const Is=window.document.body.offsetWidth,xa=Math.max(0,Is/2-It/2),Ha=".flatpickr-calendar.centerMost:before",x0=".flatpickr-calendar.centerMost:after",Y1=n1.cssRules.length,$a=`{left:${xn.left}px;right:auto;}`;n2(t.calendarContainer,"rightMost",!1),n2(t.calendarContainer,"centerMost",!0),n1.insertRule(`${Ha},${x0}${$a}`,Y1),t.calendarContainer.style.left=`${xa}px`,t.calendarContainer.style.right="auto"}}function he(){let Qe=null;for(let _t=0;_t<document.styleSheets.length;_t++){const ot=document.styleSheets[_t];try{ot.cssRules}catch{continue}Qe=ot;break}return Qe!=null?Qe:Xe()}function Xe(){const Qe=document.createElement("style");return document.head.appendChild(Qe),Qe.sheet}function at(){t.config.noCalendar||t.isMobile||(le(),zn(),Q())}function Se(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function Re(Qe){Qe.preventDefault(),Qe.stopPropagation();const _t=jn=>jn.classList&&jn.classList.contains("flatpickr-day")&&!jn.classList.contains("flatpickr-disabled")&&!jn.classList.contains("notAllowed"),ot=_q(kf(Qe),_t);if(ot===void 0)return;const It=ot,fn=t.latestSelectedDateObj=new Date(It.dateObj.getTime()),an=(fn.getMonth()<t.currentMonth||fn.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=It,t.config.mode==="single")t.selectedDates=[fn];else if(t.config.mode==="multiple"){const jn=br(fn);jn?t.selectedDates.splice(parseInt(jn),1):t.selectedDates.push(fn)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=fn,t.selectedDates.push(fn),zf(fn,t.selectedDates[0],!0)!==0&&t.selectedDates.sort((jn,xn)=>jn.getTime()-xn.getTime()));if(c(),an){const jn=t.currentYear!==fn.getFullYear();t.currentYear=fn.getFullYear(),t.currentMonth=fn.getMonth(),jn&&(wn("onYearChange"),le()),wn("onMonthChange")}if(zn(),Q(),Ut(),!an&&t.config.mode!=="range"&&t.config.showMonths===1?V(It):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){const jn=t.config.mode==="single"&&!t.config.enableTime,xn=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(jn||xn)&&Se()}y()}const Oe={locale:[on,de],showMonths:[K,o,se],minDate:[A],maxDate:[A],clickOpens:[()=>{t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ue(Qe,_t){if(Qe!==null&&typeof Qe=="object"){Object.assign(t.config,Qe);for(const ot in Qe)Oe[ot]!==void 0&&Oe[ot].forEach(It=>It())}else t.config[Qe]=_t,Oe[Qe]!==void 0?Oe[Qe].forEach(ot=>ot()):$b.indexOf(Qe)>-1&&(t.config[Qe]=wb(_t));t.redraw(),Ut(!0)}function kt(Qe,_t){let ot=[];if(Qe instanceof Array)ot=Qe.map(It=>t.parseDate(It,_t));else if(Qe instanceof Date||typeof Qe=="number")ot=[t.parseDate(Qe,_t)];else if(typeof Qe=="string")switch(t.config.mode){case"single":case"time":ot=[t.parseDate(Qe,_t)];break;case"multiple":ot=Qe.split(t.config.conjunction).map(It=>t.parseDate(It,_t));break;case"range":ot=Qe.split(t.l10n.rangeSeparator).map(It=>t.parseDate(It,_t));break}else t.config.errorHandler(new Error(`Invalid date supplied: ${JSON.stringify(Qe)}`));t.selectedDates=t.config.allowInvalidPreload?ot:ot.filter(It=>It instanceof Date&&Be(It,!1)),t.config.mode==="range"&&t.selectedDates.sort((It,fn)=>It.getTime()-fn.getTime())}function Mt(Qe,_t=!1,ot=t.config.dateFormat){if(Qe!==0&&!Qe||Qe instanceof Array&&Qe.length===0)return t.clear(_t);kt(Qe,ot),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),A(void 0,_t),f(),t.selectedDates.length===0&&t.clear(!1),Ut(_t),_t&&wn("onChange")}function Jt(Qe){return Qe.slice().map(_t=>typeof _t=="string"||typeof _t=="number"||_t instanceof Date?t.parseDate(_t,void 0,!0):_t&&typeof _t=="object"&&_t.from&&_t.to?{from:t.parseDate(_t.from,void 0),to:t.parseDate(_t.to,void 0)}:_t).filter(_t=>_t)}function dn(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;const Qe=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Qe&&kt(Qe,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 cn(){if(t.input=Ht(),!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=Ba(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"),t._positionElement=t.config.positionElement||t._input}function Dn(){const Qe=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=Ba("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Qe,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Qe==="datetime-local"?"Y-m-d\\TH:i:S":Qe==="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{}_(t.mobileInput,"change",_t=>{t.setDate(kf(_t).value,!1,t.mobileFormatStr),wn("onChange"),wn("onClose")})}function Pn(Qe){if(t.isOpen===!0)return t.close();t.open(Qe)}function wn(Qe,_t){if(t.config===void 0)return;const ot=t.config[Qe];if(ot!==void 0&&ot.length>0)for(let It=0;ot[It]&&It<ot.length;It++)ot[It](t.selectedDates,t.input.value,t,_t);Qe==="onChange"&&(t.input.dispatchEvent(St("change")),t.input.dispatchEvent(St("input")))}function St(Qe){const _t=document.createEvent("Event");return _t.initEvent(Qe,!0,!0),_t}function br(Qe){for(let _t=0;_t<t.selectedDates.length;_t++)if(zf(t.selectedDates[_t],Qe)===0)return""+_t;return!1}function Un(Qe){return t.config.mode!=="range"||t.selectedDates.length<2?!1:zf(Qe,t.selectedDates[0])>=0&&zf(Qe,t.selectedDates[1])<=0}function zn(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach((Qe,_t)=>{const ot=new Date(t.currentYear,t.currentMonth,1);ot.setMonth(t.currentMonth+_t),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[_t].textContent=sv(ot.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ot.getMonth().toString(),Qe.value=ot.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 On(Qe){return t.selectedDates.map(_t=>t.formatDate(_t,Qe)).filter((_t,ot,It)=>t.config.mode!=="range"||t.config.enableTime||It.indexOf(_t)===ot).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Ut(Qe=!0){t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=On(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=On(t.config.altFormat)),Qe!==!1&&wn("onValueUpdate")}function Kn(Qe){const _t=kf(Qe),ot=t.prevMonthNav.contains(_t),It=t.nextMonthNav.contains(_t);ot||It?pe(ot?-1:1):t.yearElements.indexOf(_t)>=0?_t.select():_t.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):_t.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Hr(Qe){Qe.preventDefault();const _t=Qe.type==="keydown",ot=kf(Qe),It=ot;t.amPM!==void 0&&ot===t.amPM&&(t.amPM.textContent=t.l10n.amPM[qf(t.amPM.textContent===t.l10n.amPM[0])]);const fn=parseFloat(It.getAttribute("min")),an=parseFloat(It.getAttribute("max")),jn=parseFloat(It.getAttribute("step")),xn=parseInt(It.value,10),yr=Qe.delta||(_t?Qe.which===38?1:-1:0);let pr=xn+jn*yr;if(typeof It.value<"u"&&It.value.length===2){const vi=It===t.hourElement,Gi=It===t.minuteElement;pr<fn?(pr=an+pr+qf(!vi)+(qf(vi)&&qf(!t.amPM)),Gi&&T(void 0,-1,t.hourElement)):pr>an&&(pr=It===t.hourElement?pr-an-qf(!t.amPM):fn,Gi&&T(void 0,1,t.hourElement)),t.amPM&&vi&&(jn===1?pr+xn===23:Math.abs(pr-xn)>jn)&&(t.amPM.textContent=t.l10n.amPM[qf(t.amPM.textContent===t.l10n.amPM[0])]),It.value=x2(pr)}}return i(),t}function jh(n,e){const t=Array.prototype.slice.call(n).filter(i=>i instanceof HTMLElement),r=[];for(let i=0;i<t.length;i++){const a=t[i];try{if(a.getAttribute("data-fp-omit")!==null)continue;a._flatpickr!==void 0&&(a._flatpickr.destroy(),a._flatpickr=void 0),a._flatpickr=vie(a,e||{}),r.push(a._flatpickr)}catch(o){console.error(o)}}return r.length===1?r[0]:r}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return jh(this,n)},HTMLElement.prototype.flatpickr=function(n){return jh([this],n)});var is=function(n,e){return typeof n=="string"?jh(window.document.querySelectorAll(n),e):n instanceof Node?jh([n],e):jh(n,e)};is.defaultConfig={};is.l10ns={en:Object.assign({},Yg),default:Object.assign({},Yg)};is.localize=n=>{is.l10ns.default=Object.assign(Object.assign({},is.l10ns.default),n)};is.setDefaults=n=>{is.defaultConfig=Object.assign(Object.assign({},is.defaultConfig),n)};is.parseDate=s$({});is.formatDate=bq({});is.compareDates=zf;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return jh(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=is);function _ie(n){let e,t=[n[1]],r={};for(let i=0;i<t.length;i+=1)r=au(r,t[i]);return{c(){e=X("input"),MA(e,r)},m(i,a){C(i,e,a),e.autofocus&&e.focus(),n[11](e)},p(i,a){MA(e,r=Rd(t,[a&2&&i[1]]))},d(i){i&&M(e),n[11](null)}}}function bie(n){let e;const t=n[10].default,r=Xn(t,n,n[9],null),i=r||_ie(n);return{c(){i&&i.c()},m(a,o){i&&i.m(a,o),e=!0},p(a,[o]){r?r.p&&(!e||o&512)&&Zn(r,t,a,a[9],e?Jn(t,a[9],o,null):Qn(a[9]),null):i&&i.p&&(!e||o&3)&&i.p(a,e?o:-1)},i(a){e||(b(i,a),e=!0)},o(a){$(i,a),e=!1},d(a){i&&i.d(a)}}}function yie(n){return n.charAt(2).toLowerCase()+n.substring(3)}function $ie(n,e,t){const r=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let i=Kh(e,r),{$$slots:a={},$$scope:o}=e;const l=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:s="",formattedValue:u="",element:c=null,dateFormat:f=null}=e,{options:h={}}=e,m=!1,{input:_=void 0,flatpickr:y=void 0}=e;ar(()=>{const I=c||_,P=A(h);return P.onReady.push(()=>{t(8,m=!0)}),t(3,y=is(I,Object.assign(P,c?{wrap:!0}:{}))),()=>{y.destroy()}});const w=Nn();function A(I={}){I=Object.assign({},I);for(const P of l){const V=(j,U,W)=>{w(yie(P),[j,U,W])};P in I?(Array.isArray(I[P])||(I[P]=[I[P]]),I[P].push(V)):I[P]=[V]}return I.onChange&&!I.onChange.includes(S)&&I.onChange.push(S),I}function S(I,P){t(2,s=Array.isArray(I)&&I.length===1?I[0]:I),t(4,u=P)}function T(I){De[I?"unshift":"push"](()=>{_=I,t(0,_)})}return n.$$set=I=>{e=au(au({},e),Ug(I)),t(1,i=Kh(e,r)),"value"in I&&t(2,s=I.value),"formattedValue"in I&&t(4,u=I.formattedValue),"element"in I&&t(5,c=I.element),"dateFormat"in I&&t(6,f=I.dateFormat),"options"in I&&t(7,h=I.options),"input"in I&&t(0,_=I.input),"flatpickr"in I&&t(3,y=I.flatpickr),"$$scope"in I&&t(9,o=I.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&y&&m&&y.setDate(s,!1,f),n.$$.dirty&392&&y&&m)for(const[I,P]of Object.entries(A(h)))y.set(I,P)},[_,i,s,y,u,c,f,h,m,o,a,T]}class wie extends Ve{constructor(e){super(),Pe(this,e,$ie,bie,Ie,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function UC(n){let e,t;return{c(){e=ut("svg"),t=ut("use"),Gr(t,"xlink:href","#spectrum-icon-18-Alert"),D(e,"class","spectrum-Icon spectrum-Icon--sizeM spectrum-Textfield-validationIcon"),D(e,"focusable","false"),D(e,"aria-hidden","true")},m(r,i){C(r,e,i),x(e,t)},d(r){r&&M(e)}}}function kie(n){let e,t,r,i,a,o,l,s,u=!!n[2]&&UC();return{c(){e=X("div"),t=X("div"),u&&u.c(),r=q(),i=X("input"),a=q(),o=X("button"),o.innerHTML='<svg class="spectrum-Icon spectrum-Icon--sizeM" focusable="false" aria-hidden="true" aria-label="Calendar"><use xlink:href="#spectrum-icon-18-Calendar"></use></svg>',D(i,"data-input",""),D(i,"type","text"),D(i,"class","spectrum-Textfield-input spectrum-InputGroup-input svelte-s5xzv8"),D(i,"placeholder",n[4]),D(i,"id",n[0]),i.value=n[3],Te(i,"is-disabled",n[1]),D(t,"class","spectrum-Textfield spectrum-InputGroup-textfield svelte-s5xzv8"),Te(t,"is-disabled",n[1]),Te(t,"is-invalid",!!n[2]),D(o,"type","button"),D(o,"class","spectrum-Picker spectrum-Picker--sizeM spectrum-InputGroup-button svelte-s5xzv8"),D(o,"tabindex","-1"),Te(o,"is-disabled",n[1]),Te(o,"is-invalid",!!n[2]),D(e,"id",n[10]),D(e,"class","flatpickr spectrum-InputGroup spectrum-Datepicker svelte-s5xzv8"),D(e,"aria-readonly","false"),D(e,"aria-required","false"),D(e,"aria-haspopup","true"),Te(e,"is-disabled",n[1]),Te(e,"is-invalid",!!n[2]),Te(e,"is-focused",n[6])},m(c,f){C(c,e,f),x(e,t),u&&u.m(t,null),x(t,r),x(t,i),x(e,a),x(e,o),l||(s=[At(t,"click",function(){var h,m;kn((h=n[7])==null?void 0:h.open)&&((m=n[7])==null||m.open.apply(this,arguments))}),At(o,"click",function(){var h,m;kn((h=n[7])==null?void 0:h.open)&&((m=n[7])==null||m.open.apply(this,arguments))})],l=!0)},p(c,f){n=c,n[2]?u||(u=UC(),u.c(),u.m(t,r)):u&&(u.d(1),u=null),f&16&&D(i,"placeholder",n[4]),f&1&&D(i,"id",n[0]),f&8&&i.value!==n[3]&&(i.value=n[3]),f&2&&Te(i,"is-disabled",n[1]),f&2&&Te(t,"is-disabled",n[1]),f&4&&Te(t,"is-invalid",!!n[2]),f&2&&Te(o,"is-disabled",n[1]),f&4&&Te(o,"is-invalid",!!n[2]),f&2&&Te(e,"is-disabled",n[1]),f&4&&Te(e,"is-invalid",!!n[2]),f&64&&Te(e,"is-focused",n[6])},d(c){c&&M(e),u&&u.d(),l=!1,Vi(s)}}}function qC(n){let e,t,r;function i(o){n[20](o)}let a={value:n[5]?n[3]:n[14](n[3]),options:n[8],element:`#${n[10]}`,$$slots:{default:[kie]},$$scope:{ctx:n}};return n[7]!==void 0&&(a.flatpickr=n[7]),e=new wie({props:a}),De.push(()=>tt(e,"flatpickr",i)),e.$on("open",n[12]),e.$on("close",n[13]),e.$on("change",n[11]),{c(){O(e.$$.fragment)},m(o,l){B(e,o,l),r=!0},p(o,l){const s={};l&40&&(s.value=o[5]?o[3]:o[14](o[3])),l&256&&(s.options=o[8]),l&16777439&&(s.$$scope={dirty:l,ctx:o}),!t&&l&128&&(t=!0,s.flatpickr=o[7],rt(()=>t=!1)),e.$set(s)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){$(e.$$.fragment,o),r=!1},d(o){H(e,o)}}}function WC(n){let e,t,r;return{c(){e=X("div"),D(e,"class","overlay svelte-s5xzv8")},m(i,a){C(i,e,a),t||(r=At(e,"mousedown",Mg(function(){var o,l;kn((o=n[7])==null?void 0:o.close)&&((l=n[7])==null||l.close.apply(this,arguments))})),t=!0)},p(i,a){n=i},d(i){i&&M(e),t=!1,r()}}}function zie(n){let e=n[9],t,r,i,a=qC(n),o=n[6]&&WC(n);return{c(){a.c(),t=q(),o&&o.c(),r=yt()},m(l,s){a.m(l,s),C(l,t,s),o&&o.m(l,s),C(l,r,s),i=!0},p(l,[s]){s&512&&Ie(e,e=l[9])?(we(),$(a,1,1,ht),ke(),a=qC(l),a.c(),b(a,1),a.m(t.parentNode,t)):a.p(l,s),l[6]?o?o.p(l,s):(o=WC(l),o.c(),o.m(r.parentNode,r)):o&&(o.d(1),o=null)},i(l){i||(b(a),i=!0)},o(l){$(a),i=!1},d(l){a.d(l),l&&M(t),o&&o.d(l),l&&M(r)}}}function Aie(n,e,t){let r,{id:i=null}=e,{disabled:a=!1}=e,{error:o=null}=e,{enableTime:l=!0}=e,{value:s=null}=e,{placeholder:u=null}=e,{appendTo:c=void 0}=e,{timeOnly:f=!1}=e,{ignoreTimezones:h=!1}=e,{time24hr:m=!1}=e,{range:_=!1}=e;const y=Nn(),w=`${C4()}-wrapper`;let A=!1,S,T;const I=Q=>{let le=new Date(`0-${Q}`);return le instanceof Date&&!isNaN(le.getTime())?le:null},P=Q=>{const[le]=Q.detail,ie=l&&!f&&h;let K=le[0];if(K&&(K=K.toISOString()),f)!s&&K&&(K=new Date(le[0].getTime()+60*60*1e3).toISOString()),K=`2000-01-01T${K.split("T")[1]}`;else if(l){if(ie){const G=le[0].getTimezoneOffset()*6e4;K=new Date(le[0].getTime()-G).toISOString().slice(0,-1)}}else{const G=le[0].getFullYear(),re=`${le[0].getMonth()+1}`.padStart(2,"0"),se=`${le[0].getDate()}`.padStart(2,"0");K=`${G}-${re}-${se}T00:00:00.000`}_?y("change",Q.detail):y("change",K)},V=Q=>{["Backspace","Clear","Delete"].includes(Q.key)&&(y("change",null),S.close())},j=()=>{t(6,A=!0),document.addEventListener("keyup",V)},U=()=>{t(6,A=!1),document.removeEventListener("keyup",V),document.querySelectorAll(`#${w} input`).forEach(le=>le.blur())},W=Q=>{if(!Q)return null;let le,ie,K=I(Q);return f&&K?le=K:Q instanceof Date?le=Q:isNaN(Q)?le=new Date(Q):le=new Date(parseInt(Q)),ie=le.getTime(),isNaN(ie)?null:new Date(Math.floor(ie/1e3)*1e3)};function te(Q){S=Q,t(7,S)}return n.$$set=Q=>{"id"in Q&&t(0,i=Q.id),"disabled"in Q&&t(1,a=Q.disabled),"error"in Q&&t(2,o=Q.error),"enableTime"in Q&&t(15,l=Q.enableTime),"value"in Q&&t(3,s=Q.value),"placeholder"in Q&&t(4,u=Q.placeholder),"appendTo"in Q&&t(16,c=Q.appendTo),"timeOnly"in Q&&t(17,f=Q.timeOnly),"ignoreTimezones"in Q&&t(18,h=Q.ignoreTimezones),"time24hr"in Q&&t(19,m=Q.time24hr),"range"in Q&&t(5,_=Q.range)},n.$$.update=()=>{n.$$.dirty&753704&&t(8,T={element:`#${w}`,enableTime:f||l||!1,noCalendar:f||!1,altInput:!0,time_24hr:m||!1,altFormat:f?"H:i":l?"F j Y, H:i":"F j, Y",wrap:!0,mode:_?"range":"single",appendTo:c,disableMobile:"true",onReady:()=>{let Q=I(s);f&&Q&&y("change",Q.toISOString())}}),n.$$.dirty&688128&&t(9,r={timeOnly:f,enableTime:l,time24hr:m})},[i,a,o,s,u,_,A,S,T,r,w,P,j,U,W,l,c,f,h,m,te]}class Mie extends Ve{constructor(e){super(),Pe(this,e,Aie,zie,Ie,{id:0,disabled:1,error:2,enableTime:15,value:3,placeholder:4,appendTo:16,timeOnly:17,ignoreTimezones:18,time24hr:19,range:5})}}function Cie(n){let e,t;return e=new Mie({props:{error:n[4],disabled:n[3],value:n[0],placeholder:n[8],enableTime:n[5],timeOnly:n[6],time24hr:n[7],appendTo:n[9],ignoreTimezones:n[10],range:n[11]}}),e.$on("change",n[12]),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&16&&(a.error=r[4]),i&8&&(a.disabled=r[3]),i&1&&(a.value=r[0]),i&256&&(a.placeholder=r[8]),i&32&&(a.enableTime=r[5]),i&64&&(a.timeOnly=r[6]),i&128&&(a.time24hr=r[7]),i&512&&(a.appendTo=r[9]),i&1024&&(a.ignoreTimezones=r[10]),i&2048&&(a.range=r[11]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Sie(n){let e,t;return e=new Sc({props:{label:n[1],labelPosition:n[2],error:n[4],$$slots:{default:[Cie]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,[i]){const a={};i&2&&(a.label=r[1]),i&4&&(a.labelPosition=r[2]),i&16&&(a.error=r[4]),i&20473&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Lie(n,e,t){let{value:r=null}=e,{label:i=null}=e,{labelPosition:a="above"}=e,{disabled:o=!1}=e,{error:l=null}=e,{enableTime:s=!0}=e,{timeOnly:u=!1}=e,{time24hr:c=!1}=e,{placeholder:f=null}=e,{appendTo:h=void 0}=e,{ignoreTimezones:m=!1}=e,{range:_=!1}=e;const y=Nn(),w=A=>{_?t(0,r=A==null?void 0:A.detail[1]):t(0,r=A.detail),y("change",A.detail)};return n.$$set=A=>{"value"in A&&t(0,r=A.value),"label"in A&&t(1,i=A.label),"labelPosition"in A&&t(2,a=A.labelPosition),"disabled"in A&&t(3,o=A.disabled),"error"in A&&t(4,l=A.error),"enableTime"in A&&t(5,s=A.enableTime),"timeOnly"in A&&t(6,u=A.timeOnly),"time24hr"in A&&t(7,c=A.time24hr),"placeholder"in A&&t(8,f=A.placeholder),"appendTo"in A&&t(9,h=A.appendTo),"ignoreTimezones"in A&&t(10,m=A.ignoreTimezones),"range"in A&&t(11,_=A.range)},[r,i,a,o,l,s,u,c,f,h,m,_,w]}class f5 extends Ve{constructor(e){super(),Pe(this,e,Lie,Sie,Ie,{value:0,label:1,labelPosition:2,disabled:3,error:4,enableTime:5,timeOnly:6,time24hr:7,placeholder:8,appendTo:9,ignoreTimezones:10,range:11})}}function Eie(n){var r;let e,t;return e=new pq({props:{id:n[1],error:n[3],disabled:n[2],readonly:n[7],fieldText:n[13],options:n[4],isPlaceholder:!((r=n[0])!=null&&r.length),autocomplete:n[8],isOptionSelected:n[12],getOptionLabel:n[5],getOptionValue:n[6],onSelectOption:n[11],sort:n[9],autoWidth:n[10]}}),{c(){O(e.$$.fragment)},m(i,a){B(e,i,a),t=!0},p(i,[a]){var l;const o={};a&2&&(o.id=i[1]),a&8&&(o.error=i[3]),a&4&&(o.disabled=i[2]),a&128&&(o.readonly=i[7]),a&8192&&(o.fieldText=i[13]),a&16&&(o.options=i[4]),a&1&&(o.isPlaceholder=!((l=i[0])!=null&&l.length)),a&256&&(o.autocomplete=i[8]),a&4096&&(o.isOptionSelected=i[12]),a&32&&(o.getOptionLabel=i[5]),a&64&&(o.getOptionValue=i[6]),a&2048&&(o.onSelectOption=i[11]),a&512&&(o.sort=i[9]),a&1024&&(o.autoWidth=i[10]),e.$set(o)},i(i){t||(b(e.$$.fragment,i),t=!0)},o(i){$(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Tie(n,e,t){let r,i,a,o,l,{value:s=[]}=e,{id:u=null}=e,{placeholder:c=null}=e,{disabled:f=!1}=e,{error:h=null}=e,{options:m=[]}=e,{getOptionLabel:_=W=>W}=e,{getOptionValue:y=W=>W}=e,{readonly:w=!1}=e,{autocomplete:A=!1}=e,{sort:S=!1}=e,{autoWidth:T=!1}=e;const I=Nn(),P=(W,te,Q)=>{if(Array.isArray(W)&&W.length>0){if(!te)return"";const le=W.map(ie=>te[ie]||ie).join(", ");return`(${W.length}) ${le}`}else return Q||"Choose some options"},V=W=>{let te={};return Array.isArray(W)&&W.length>0&&W.forEach(Q=>{Q&&(te[Q]=!0)}),te},j=W=>{let te=null;return W!=null&&W.length&&(te={},W.forEach((Q,le)=>{const ie=y(Q,le);ie!=null&&(te[ie]=_(Q,le)||"")})),te},U=(W,te)=>Q=>{if(W[Q]){const le=te.filter(ie=>ie!==Q);I("change",le)}else I("change",[...te,Q])};return n.$$set=W=>{"value"in W&&t(0,s=W.value),"id"in W&&t(1,u=W.id),"placeholder"in W&&t(14,c=W.placeholder),"disabled"in W&&t(2,f=W.disabled),"error"in W&&t(3,h=W.error),"options"in W&&t(4,m=W.options),"getOptionLabel"in W&&t(5,_=W.getOptionLabel),"getOptionValue"in W&&t(6,y=W.getOptionValue),"readonly"in W&&t(7,w=W.readonly),"autocomplete"in W&&t(8,A=W.autocomplete),"sort"in W&&t(9,S=W.sort),"autoWidth"in W&&t(10,T=W.autoWidth)},n.$$.update=()=>{n.$$.dirty&1&&t(15,r=V(s)),n.$$.dirty&16&&t(16,i=j(m)),n.$$.dirty&81921&&t(13,a=P(s,i,c)),n.$$.dirty&32768&&t(12,o=W=>r[W]===!0),n.$$.dirty&32769&&t(11,l=U(r,s))},[s,u,f,h,m,_,y,w,A,S,T,l,o,a,c,r,i]}class Die extends Ve{constructor(e){super(),Pe(this,e,Tie,Eie,Ie,{value:0,id:1,placeholder:14,disabled:2,error:3,options:4,getOptionLabel:5,getOptionValue:6,readonly:7,autocomplete:8,sort:9,autoWidth:10})}}function Bie(n){let e,t;return e=new Die({props:{error:n[5],disabled:n[2],readonly:n[3],value:n[0],options:n[7],placeholder:n[6],sort:n[10],getOptionLabel:n[8],getOptionValue:n[9],autoWidth:n[11]}}),e.$on("change",n[12]),e.$on("click",n[13]),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&32&&(a.error=r[5]),i&4&&(a.disabled=r[2]),i&8&&(a.readonly=r[3]),i&1&&(a.value=r[0]),i&128&&(a.options=r[7]),i&64&&(a.placeholder=r[6]),i&1024&&(a.sort=r[10]),i&256&&(a.getOptionLabel=r[8]),i&512&&(a.getOptionValue=r[9]),i&2048&&(a.autoWidth=r[11]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Hie(n){let e,t;return e=new Sc({props:{label:n[1],labelPosition:n[4],error:n[5],$$slots:{default:[Bie]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,[i]){const a={};i&2&&(a.label=r[1]),i&16&&(a.labelPosition=r[4]),i&32&&(a.error=r[5]),i&36845&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Oie(n,e,t){let{value:r=[]}=e,{label:i=null}=e,{disabled:a=!1}=e,{readonly:o=!1}=e,{labelPosition:l="above"}=e,{error:s=null}=e,{placeholder:u=null}=e,{options:c=[]}=e,{getOptionLabel:f=S=>S}=e,{getOptionValue:h=S=>S}=e,{sort:m=!1}=e,{autoWidth:_=!1}=e;const y=Nn(),w=S=>{t(0,r=S.detail),y("change",S.detail)};function A(S){Hn.call(this,n,S)}return n.$$set=S=>{"value"in S&&t(0,r=S.value),"label"in S&&t(1,i=S.label),"disabled"in S&&t(2,a=S.disabled),"readonly"in S&&t(3,o=S.readonly),"labelPosition"in S&&t(4,l=S.labelPosition),"error"in S&&t(5,s=S.error),"placeholder"in S&&t(6,u=S.placeholder),"options"in S&&t(7,c=S.options),"getOptionLabel"in S&&t(8,f=S.getOptionLabel),"getOptionValue"in S&&t(9,h=S.getOptionValue),"sort"in S&&t(10,m=S.sort),"autoWidth"in S&&t(11,_=S.autoWidth)},[r,i,a,o,l,s,u,c,f,h,m,_,w,A]}class _5 extends Ve{constructor(e){super(),Pe(this,e,Oie,Hie,Ie,{value:0,label:1,disabled:2,readonly:3,labelPosition:4,error:5,placeholder:6,options:7,getOptionLabel:8,getOptionValue:9,sort:10,autoWidth:11})}}function Iie(n){let e,t=(typeof n[0]=="object"?JSON.stringify(n[0]):n[0])+"",r;return{c(){e=X("div"),r=oe(t),D(e,"class","svelte-186zidf")},m(i,a){C(i,e,a),x(e,r)},p(i,[a]){a&1&&t!==(t=(typeof i[0]=="object"?JSON.stringify(i[0]):i[0])+"")&>(r,t)},i:ht,o:ht,d(i){i&&M(e)}}}function Pie(n,e,t){let{value:r}=e;return n.$$set=i=>{"value"in i&&t(0,r=i.value)},[r]}class qm extends Ve{constructor(e){super(),Pe(this,e,Pie,Iie,Ie,{value:0})}}function Vie(n){let e,t,r,i,a;return{c(){e=X("label"),t=X("input"),i=q(),a=X("span"),a.innerHTML=`<svg class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark" focusable="false" aria-hidden="true"><use xlink:href="#spectrum-css-icon-Checkmark100"></use></svg>
|
|
33
33
|
<svg class="spectrum-Icon spectrum-UIIcon-Dash100 spectrum-Checkbox-partialCheckmark" focusable="false" aria-hidden="true"><use xlink:href="#spectrum-css-icon-Dash100"></use></svg>`,D(t,"type","checkbox"),D(t,"class","spectrum-Checkbox-input"),D(t,"id","checkbox-1"),t.disabled=!0,t.checked=r=!!n[0],D(a,"class","spectrum-Checkbox-box svelte-ww1lnr"),D(e,"class","spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-Checkbox--emphasized svelte-ww1lnr")},m(o,l){C(o,e,l),x(e,t),x(e,i),x(e,a)},p(o,[l]){l&1&&r!==(r=!!o[0])&&(t.checked=r)},i:ht,o:ht,d(o){o&&M(e)}}}function Rie(n,e,t){let{value:r}=e;return n.$$set=i=>{"value"in i&&t(0,r=i.value)},[r]}class Nie extends Ve{constructor(e){super(),Pe(this,e,Rie,Vie,Ie,{value:0})}}var b0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fie(n){var e=n.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var yq={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(b0,function(){var t="millisecond",r="second",i="minute",a="hour",o="day",l="week",s="month",u="quarter",c="year",f="date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},y=function(W,te,Q){var le=String(W);return!le||le.length>=te?W:""+Array(te+1-le.length).join(Q)+W},w={s:y,z:function(W){var te=-W.utcOffset(),Q=Math.abs(te),le=Math.floor(Q/60),ie=Q%60;return(te<=0?"+":"-")+y(le,2,"0")+":"+y(ie,2,"0")},m:function W(te,Q){if(te.date()<Q.date())return-W(Q,te);var le=12*(Q.year()-te.year())+(Q.month()-te.month()),ie=te.clone().add(le,s),K=Q-ie<0,G=te.clone().add(le+(K?-1:1),s);return+(-(le+(Q-ie)/(K?ie-G:G-ie))||0)},a:function(W){return W<0?Math.ceil(W)||0:Math.floor(W)},p:function(W){return{M:s,y:c,w:l,d:o,D:f,h:a,m:i,s:r,ms:t,Q:u}[W]||String(W||"").toLowerCase().replace(/s$/,"")},u:function(W){return W===void 0}},A="en",S={};S[A]=_;var T=function(W){return W instanceof j},I=function(W,te,Q){var le;if(!W)return A;if(typeof W=="string")S[W]&&(le=W),te&&(S[W]=te,le=W);else{var ie=W.name;S[ie]=W,le=ie}return!Q&&le&&(A=le),le||!Q&&A},P=function(W,te){if(T(W))return W.clone();var Q=typeof te=="object"?te:{};return Q.date=W,Q.args=arguments,new j(Q)},V=w;V.l=I,V.i=T,V.w=function(W,te){return P(W,{locale:te.$L,utc:te.$u,x:te.$x,$offset:te.$offset})};var j=function(){function W(Q){this.$L=I(Q.locale,null,!0),this.parse(Q)}var te=W.prototype;return te.parse=function(Q){this.$d=function(le){var ie=le.date,K=le.utc;if(ie===null)return new Date(NaN);if(V.u(ie))return new Date;if(ie instanceof Date)return new Date(ie);if(typeof ie=="string"&&!/Z$/i.test(ie)){var G=ie.match(h);if(G){var re=G[2]-1||0,se=(G[7]||"0").substring(0,3);return K?new Date(Date.UTC(G[1],re,G[3]||1,G[4]||0,G[5]||0,G[6]||0,se)):new Date(G[1],re,G[3]||1,G[4]||0,G[5]||0,G[6]||0,se)}}return new Date(ie)}(Q),this.$x=Q.x||{},this.init()},te.init=function(){var Q=this.$d;this.$y=Q.getFullYear(),this.$M=Q.getMonth(),this.$D=Q.getDate(),this.$W=Q.getDay(),this.$H=Q.getHours(),this.$m=Q.getMinutes(),this.$s=Q.getSeconds(),this.$ms=Q.getMilliseconds()},te.$utils=function(){return V},te.isValid=function(){return this.$d.toString()!=="Invalid Date"},te.isSame=function(Q,le){var ie=P(Q);return this.startOf(le)<=ie&&ie<=this.endOf(le)},te.isAfter=function(Q,le){return P(Q)<this.startOf(le)},te.isBefore=function(Q,le){return this.endOf(le)<P(Q)},te.$g=function(Q,le,ie){return V.u(Q)?this[le]:this.set(ie,Q)},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this.$d.getTime()},te.startOf=function(Q,le){var ie=this,K=!!V.u(le)||le,G=V.p(Q),re=function(it,$e){var Me=V.w(ie.$u?Date.UTC(ie.$y,$e,it):new Date(ie.$y,$e,it),ie);return K?Me:Me.endOf(o)},se=function(it,$e){return V.w(ie.toDate()[it].apply(ie.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice($e)),ie)},de=this.$W,be=this.$M,pe=this.$D,_e="set"+(this.$u?"UTC":"");switch(G){case c:return K?re(1,0):re(31,11);case s:return K?re(1,be):re(0,be+1);case l:var Ae=this.$locale().weekStart||0,me=(de<Ae?de+7:de)-Ae;return re(K?pe-me:pe+(6-me),be);case o:case f:return se(_e+"Hours",0);case a:return se(_e+"Minutes",1);case i:return se(_e+"Seconds",2);case r:return se(_e+"Milliseconds",3);default:return this.clone()}},te.endOf=function(Q){return this.startOf(Q,!1)},te.$set=function(Q,le){var ie,K=V.p(Q),G="set"+(this.$u?"UTC":""),re=(ie={},ie[o]=G+"Date",ie[f]=G+"Date",ie[s]=G+"Month",ie[c]=G+"FullYear",ie[a]=G+"Hours",ie[i]=G+"Minutes",ie[r]=G+"Seconds",ie[t]=G+"Milliseconds",ie)[K],se=K===o?this.$D+(le-this.$W):le;if(K===s||K===c){var de=this.clone().set(f,1);de.$d[re](se),de.init(),this.$d=de.set(f,Math.min(this.$D,de.daysInMonth())).$d}else re&&this.$d[re](se);return this.init(),this},te.set=function(Q,le){return this.clone().$set(Q,le)},te.get=function(Q){return this[V.p(Q)]()},te.add=function(Q,le){var ie,K=this;Q=Number(Q);var G=V.p(le),re=function(be){var pe=P(K);return V.w(pe.date(pe.date()+Math.round(be*Q)),K)};if(G===s)return this.set(s,this.$M+Q);if(G===c)return this.set(c,this.$y+Q);if(G===o)return re(1);if(G===l)return re(7);var se=(ie={},ie[i]=6e4,ie[a]=36e5,ie[r]=1e3,ie)[G]||1,de=this.$d.getTime()+Q*se;return V.w(de,this)},te.subtract=function(Q,le){return this.add(-1*Q,le)},te.format=function(Q){var le=this;if(!this.isValid())return"Invalid Date";var ie=Q||"YYYY-MM-DDTHH:mm:ssZ",K=V.z(this),G=this.$locale(),re=this.$H,se=this.$m,de=this.$M,be=G.weekdays,pe=G.months,_e=function($e,Me,Be,xe){return $e&&($e[Me]||$e(le,ie))||Be[Me].substr(0,xe)},Ae=function($e){return V.s(re%12||12,$e,"0")},me=G.meridiem||function($e,Me,Be){var xe=$e<12?"AM":"PM";return Be?xe.toLowerCase():xe},it={YY:String(this.$y).slice(-2),YYYY:this.$y,M:de+1,MM:V.s(de+1,2,"0"),MMM:_e(G.monthsShort,de,pe,3),MMMM:_e(pe,de),D:this.$D,DD:V.s(this.$D,2,"0"),d:String(this.$W),dd:_e(G.weekdaysMin,this.$W,be,2),ddd:_e(G.weekdaysShort,this.$W,be,3),dddd:be[this.$W],H:String(re),HH:V.s(re,2,"0"),h:Ae(1),hh:Ae(2),a:me(re,se,!0),A:me(re,se,!1),m:String(se),mm:V.s(se,2,"0"),s:String(this.$s),ss:V.s(this.$s,2,"0"),SSS:V.s(this.$ms,3,"0"),Z:K};return ie.replace(m,function($e,Me){return Me||it[$e]||K.replace(":","")})},te.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},te.diff=function(Q,le,ie){var K,G=V.p(le),re=P(Q),se=6e4*(re.utcOffset()-this.utcOffset()),de=this-re,be=V.m(this,re);return be=(K={},K[c]=be/12,K[s]=be,K[u]=be/3,K[l]=(de-se)/6048e5,K[o]=(de-se)/864e5,K[a]=de/36e5,K[i]=de/6e4,K[r]=de/1e3,K)[G]||de,ie?be:V.a(be)},te.daysInMonth=function(){return this.endOf(s).$D},te.$locale=function(){return S[this.$L]},te.locale=function(Q,le){if(!Q)return this.$L;var ie=this.clone(),K=I(Q,le,!0);return K&&(ie.$L=K),ie},te.clone=function(){return V.w(this.$d,this)},te.toDate=function(){return new Date(this.valueOf())},te.toJSON=function(){return this.isValid()?this.toISOString():null},te.toISOString=function(){return this.$d.toISOString()},te.toString=function(){return this.$d.toUTCString()},W}(),U=j.prototype;return P.prototype=U,[["$ms",t],["$s",r],["$m",i],["$H",a],["$W",o],["$M",s],["$y",c],["$D",f]].forEach(function(W){U[W[1]]=function(te){return this.$g(te,W[0],W[1])}}),P.extend=function(W,te){return W.$i||(W(te,j,P),W.$i=!0),P},P.locale=I,P.isDayjs=T,P.unix=function(W){return P(1e3*W)},P.en=S[A],P.Ls=S,P.p={},P})})(yq);const GC=yq.exports;function jie(n){let e,t=GC(n[1]?n[2]:n[0]).format(n[3])+"",r;return{c(){e=X("div"),r=oe(t),D(e,"class","svelte-1abuiv5")},m(i,a){C(i,e,a),x(e,r)},p(i,[a]){a&15&&t!==(t=GC(i[1]?i[2]:i[0]).format(i[3])+"")&>(r,t)},i:ht,o:ht,d(i){i&&M(e)}}}function xie(n,e,t){let r,i,a,o,{value:l}=e,{schema:s}=e;return n.$$set=u=>{"value"in u&&t(0,l=u.value),"schema"in u&&t(4,s=u.schema)},n.$$.update=()=>{n.$$.dirty&1&&t(2,r=new Date(`0-${l}`)),n.$$.dirty&20&&t(1,i=!isNaN(r)||(s==null?void 0:s.timeOnly)),n.$$.dirty&16&&t(5,a=s==null?void 0:s.dateOnly),n.$$.dirty&34&&t(3,o=i?"HH:mm:ss":a?"MMMM D YYYY":"MMMM D YYYY, HH:mm")},[l,i,r,o,s,a]}class Uie extends Ve{constructor(e){super(),Pe(this,e,xie,jie,Ie,{value:0,schema:4})}}function YC(n,e,t){const r=n.slice();return r[7]=e[t],r}function KC(n){let e,t=n[7].primaryDisplay+"",r,i,a;return{c(){e=X("span"),r=oe(t),D(e,"class","spectrum-Label spectrum-Label--grey svelte-1auwst5")},m(o,l){C(o,e,l),x(e,r),i||(a=At(e,"click",n[2]),i=!0)},p(o,l){l&1&&t!==(t=o[7].primaryDisplay+"")&>(r,t)},d(o){o&&M(e),i=!1,a()}}}function XC(n){var r;let e,t=((r=n[7])==null?void 0:r.primaryDisplay)&&KC(n);return{c(){t&&t.c(),e=yt()},m(i,a){t&&t.m(i,a),C(i,e,a)},p(i,a){var o;(o=i[7])!=null&&o.primaryDisplay?t?t.p(i,a):(t=KC(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&M(e)}}}function JC(n){let e,t,r,i;return{c(){e=X("div"),t=oe("+"),r=oe(n[1]),i=oe(" more")},m(a,o){C(a,e,o),x(e,t),x(e,r),x(e,i)},p(a,o){o&2&>(r,a[1])},d(a){a&&M(e)}}}function qie(n){let e,t,r=n[0],i=[];for(let o=0;o<r.length;o+=1)i[o]=XC(YC(n,r,o));let a=n[1]&&JC(n);return{c(){for(let o=0;o<i.length;o+=1)i[o].c();e=q(),a&&a.c(),t=yt()},m(o,l){for(let s=0;s<i.length;s+=1)i[s].m(o,l);C(o,e,l),a&&a.m(o,l),C(o,t,l)},p(o,[l]){if(l&5){r=o[0];let s;for(s=0;s<r.length;s+=1){const u=YC(o,r,s);i[s]?i[s].p(u,l):(i[s]=XC(u),i[s].c(),i[s].m(e.parentNode,e))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}o[1]?a?a.p(o,l):(a=JC(o),a.c(),a.m(t.parentNode,t)):a&&(a.d(1),a=null)},i:ht,o:ht,d(o){Bn(i,o),o&&M(e),a&&a.d(o),o&&M(t)}}}const Wie=5;function Gie(n,e,t){let r,i,{row:a}=e,{value:o}=e,{schema:l}=e;const s=Nn(),u=c=>{c.stopPropagation(),s("clickrelationship",{tableId:a.tableId,rowId:a._id,fieldName:l==null?void 0:l.name})};return n.$$set=c=>{"row"in c&&t(3,a=c.row),"value"in c&&t(4,o=c.value),"schema"in c&&t(5,l=c.schema)},n.$$.update=()=>{var c,f;n.$$.dirty&16&&t(0,r=(c=o==null?void 0:o.slice(0,Wie))!=null?c:[]),n.$$.dirty&17&&t(1,i=((f=o==null?void 0:o.length)!=null?f:0)-r.length)},[r,i,u,a,o,l]}class Yie extends Ve{constructor(e){super(),Pe(this,e,Gie,qie,Ie,{row:3,value:4,schema:5})}}function ZC(n,e,t){const r=n.slice();return r[5]=e[t],r}function Kie(n){let e,t,r,i;return t=new x3({props:{quiet:!0,target:"_blank",download:n[5].name,href:n[5].url,$$slots:{default:[Jie]},$$scope:{ctx:n}}}),t.$on("click",n1e),{c(){e=X("div"),O(t.$$.fragment),D(e,"class","file svelte-1abirxi"),D(e,"title",r=n[5].name)},m(a,o){C(a,e,o),B(t,e,null),i=!0},p(a,o){const l={};o&1&&(l.download=a[5].name),o&1&&(l.href=a[5].url),o&257&&(l.$$scope={dirty:o,ctx:a}),t.$set(l),(!i||o&1&&r!==(r=a[5].name))&&D(e,"title",r)},i(a){i||(b(t.$$.fragment,a),i=!0)},o(a){$(t.$$.fragment,a),i=!1},d(a){a&&M(e),H(t)}}}function Xie(n){let e,t;return e=new x3({props:{quiet:!0,target:"_blank",download:n[5].name,href:n[5].url,$$slots:{default:[Zie]},$$scope:{ctx:n}}}),e.$on("click",t1e),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&1&&(a.download=r[5].name),i&1&&(a.href=r[5].url),i&257&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Jie(n){let e=n[5].extension+"",t;return{c(){t=oe(e)},m(r,i){C(r,t,i)},p(r,i){i&1&&e!==(e=r[5].extension+"")&>(t,e)},d(r){r&&M(t)}}}function Zie(n){let e,t,r,i,a;return{c(){e=X("div"),t=X("img"),g1(t.src,r=n[5].url)||D(t,"src",r),D(t,"alt",i=n[5].extension),D(t,"class","svelte-1abirxi"),D(e,"class","center svelte-1abirxi"),D(e,"title",a=n[5].name)},m(o,l){C(o,e,l),x(e,t)},p(o,l){l&1&&!g1(t.src,r=o[5].url)&&D(t,"src",r),l&1&&i!==(i=o[5].extension)&&D(t,"alt",i),l&1&&a!==(a=o[5].name)&&D(e,"title",a)},d(o){o&&M(e)}}}function QC(n){let e,t,r,i,a;const o=[Xie,Kie],l=[];function s(u,c){return c&1&&(e=null),e==null&&(e=!!u[2](u[5].extension)),e?0:1}return t=s(n,-1),r=l[t]=o[t](n),{c(){r.c(),i=yt()},m(u,c){l[t].m(u,c),C(u,i,c),a=!0},p(u,c){let f=t;t=s(u,c),t===f?l[t].p(u,c):(we(),$(l[f],1,1,()=>{l[f]=null}),ke(),r=l[t],r?r.p(u,c):(r=l[t]=o[t](u),r.c()),b(r,1),r.m(i.parentNode,i))},i(u){a||(b(r),a=!0)},o(u){$(r),a=!1},d(u){l[t].d(u),u&&M(i)}}}function eS(n){let e,t,r,i;return{c(){e=X("div"),t=oe("+"),r=oe(n[1]),i=oe(" more")},m(a,o){C(a,e,o),x(e,t),x(e,r),x(e,i)},p(a,o){o&2&>(r,a[1])},d(a){a&&M(e)}}}function Qie(n){let e,t,r,i=n[0],a=[];for(let s=0;s<i.length;s+=1)a[s]=QC(ZC(n,i,s));const o=s=>$(a[s],1,1,()=>{a[s]=null});let l=n[1]&&eS(n);return{c(){for(let s=0;s<a.length;s+=1)a[s].c();e=q(),l&&l.c(),t=yt()},m(s,u){for(let c=0;c<a.length;c+=1)a[c].m(s,u);C(s,e,u),l&&l.m(s,u),C(s,t,u),r=!0},p(s,[u]){if(u&5){i=s[0];let c;for(c=0;c<i.length;c+=1){const f=ZC(s,i,c);a[c]?(a[c].p(f,u),b(a[c],1)):(a[c]=QC(f),a[c].c(),b(a[c],1),a[c].m(e.parentNode,e))}for(we(),c=i.length;c<a.length;c+=1)o(c);ke()}s[1]?l?l.p(s,u):(l=eS(s),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},i(s){if(!r){for(let u=0;u<i.length;u+=1)b(a[u]);r=!0}},o(s){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)$(a[u]);r=!1},d(s){Bn(a,s),s&&M(e),l&&l.d(s),s&&M(t)}}}const e1e=5,t1e=n=>{n.stopPropagation()},n1e=n=>{n.stopPropagation()};function r1e(n,e,t){let r,i,{value:a}=e;const o=["png","tiff","gif","raw","jpg","jpeg"],l=s=>o.includes(s==null?void 0:s.toLowerCase());return n.$$set=s=>{"value"in s&&t(3,a=s.value)},n.$$.update=()=>{var s,u;n.$$.dirty&8&&t(0,r=(s=a==null?void 0:a.slice(0,e1e))!=null?s:[]),n.$$.dirty&9&&t(1,i=((u=a==null?void 0:a.length)!=null?u:0)-r.length)},[r,i,l,a]}class i1e extends Ve{constructor(e){super(),Pe(this,e,r1e,Qie,Ie,{value:3})}}function tS(n,e,t){const r=n.slice();return r[3]=e[t],r}function a1e(n){let e=n[3]+"",t;return{c(){t=oe(e)},m(r,i){C(r,t,i)},p(r,i){i&1&&e!==(e=r[3]+"")&>(t,e)},d(r){r&&M(t)}}}function nS(n){let e,t;return e=new Nh({props:{size:"S",grey:!0,$$slots:{default:[a1e]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&65&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function rS(n){let e,t,r,i;return{c(){e=X("div"),t=oe("+"),r=oe(n[1]),i=oe(" more")},m(a,o){C(a,e,o),x(e,t),x(e,r),x(e,i)},p(a,o){o&2&>(r,a[1])},d(a){a&&M(e)}}}function o1e(n){let e,t,r,i=n[0],a=[];for(let s=0;s<i.length;s+=1)a[s]=nS(tS(n,i,s));const o=s=>$(a[s],1,1,()=>{a[s]=null});let l=n[1]&&rS(n);return{c(){for(let s=0;s<a.length;s+=1)a[s].c();e=q(),l&&l.c(),t=yt()},m(s,u){for(let c=0;c<a.length;c+=1)a[c].m(s,u);C(s,e,u),l&&l.m(s,u),C(s,t,u),r=!0},p(s,[u]){if(u&1){i=s[0];let c;for(c=0;c<i.length;c+=1){const f=tS(s,i,c);a[c]?(a[c].p(f,u),b(a[c],1)):(a[c]=nS(f),a[c].c(),b(a[c],1),a[c].m(e.parentNode,e))}for(we(),c=i.length;c<a.length;c+=1)o(c);ke()}s[1]?l?l.p(s,u):(l=rS(s),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},i(s){if(!r){for(let u=0;u<i.length;u+=1)b(a[u]);r=!0}},o(s){a=a.filter(Boolean);for(let u=0;u<a.length;u+=1)$(a[u]);r=!1},d(s){Bn(a,s),s&&M(e),l&&l.d(s),s&&M(t)}}}const l1e=5;function s1e(n,e,t){let r,i,{value:a}=e;return n.$$set=o=>{"value"in o&&t(2,a=o.value)},n.$$.update=()=>{var o;n.$$.dirty&4&&t(0,r=Array.isArray(a)?a.slice(0,l1e):[]),n.$$.dirty&5&&t(1,i=((o=a==null?void 0:a.length)!=null?o:0)-r.length)},[r,i,a]}class u1e extends Ve{constructor(e){super(),Pe(this,e,s1e,o1e,Ie,{value:2})}}function c1e(n){let e,t,r,i,a;return t=new un({props:{size:"S",name:"Copy"}}),{c(){e=X("div"),O(t.$$.fragment)},m(o,l){C(o,e,l),B(t,e,null),r=!0,i||(a=At(e,"click",c_(n[0])),i=!0)},p:ht,i(o){r||(b(t.$$.fragment,o),r=!0)},o(o){$(t.$$.fragment,o),r=!1},d(o){o&&M(e),H(t),i=!1,a()}}}function f1e(n,e,t){let{value:r}=e;const i=async a=>{a.stopPropagation();try{await dq(r),$t.success("Copied to clipboard")}catch{$t.error("Failed to copy to clipboard. Check the dev console for the value."),console.warn("Failed to copy the value",r)}};return n.$$set=a=>{"value"in a&&t(1,r=a.value)},[i,r]}class $q extends Ve{constructor(e){super(),Pe(this,e,f1e,c1e,Ie,{value:1})}}(function(){const n={};try{if(process)return process.env=Object.assign({},process.env),void Object.assign(process.env,n)}catch{}globalThis.process={env:n}})();var Ab,Jf=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{};function wh(n){if(Object.keys)return Object.keys(n);var e=[];for(var t in n)e.push(t);return e}function kh(n,e){if(n.forEach)return n.forEach(e);for(var t=0;t<n.length;t++)e(n[t],t,n)}function p1e(){try{return Object.defineProperty({},"_",{}),function(n,e,t){Object.defineProperty(n,e,{writable:!0,enumerable:!1,configurable:!0,value:t})}}catch{return function(e,t,r){e[t]=r}}}var iS=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function uv(){}function h4(n){if(!(this instanceof h4))return new h4(n);this.code=n}function wq(n){if(kq(n))return n;var e=new uv;return typeof n=="object"&&kh(wh(n),function(t){e[t]=n[t]}),e}function kq(n){return n instanceof uv}uv.prototype={},h4.prototype.runInContext=function(n){if(!(n instanceof uv))throw new TypeError("needs a 'context' argument.");if(Jf.document){var e=Jf.document.createElement("iframe");e.style||(e.style={}),e.style.display="none",Jf.document.body.appendChild(e);var t=e.contentWindow,r=t.eval,i=t.execScript;!r&&i&&(i.call(t,"null"),r=t.eval),kh(wh(n),function(l){t[l]=n[l]}),kh(iS,function(l){n[l]&&(t[l]=n[l])});var a=wh(t),o=r.call(t,this.code);return kh(wh(t),function(l){(l in n||function(s,u){if(d1e)return s.indexOf(u);for(var c=0;c<s.length;++c)if(s[c]===u)return c;return-1}(a,l)===-1)&&(n[l]=t[l])}),kh(iS,function(l){l in n||function(s,u,c){typeof Ab!="function"&&(Ab=p1e),Ab(s,u,c)}(n,l,t[l])}),Jf.document.body.removeChild(e),o}return function(l,s){var u=wh(Jf);return u.push("with (this.__ctx__){return eval(this.__code__)}"),Function.apply(null,u).apply({__code__:l,__ctx__:s})}(this.code,n)},h4.prototype.runInThisContext=function(){return new Function("code","return eval(code);").call(Jf,this.code)},h4.prototype.runInNewContext=function(n){var e=wq(n),t=this.runInContext(e);return n&&kh(wh(e),function(r){n[r]=e[r]}),t};var aS={runInContext:function(n,e,t){return new h4(n).runInContext(e,t)},isContext:kq,createContext:wq,createScript:function(n){return new h4(n)},Script:h4,runInThisContext:function(n,e){return new h4(n).runInThisContext(e)},runInNewContext:function(n,e,t){return new h4(n).runInNewContext(e,t)}},d1e=[].indexOf,Ef=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function k7(n){if(n.__esModule)return n;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(n).forEach(function(t){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}),e}function ur(n){var e={exports:{}};return n(e,e.exports),e.exports}function Mb(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}var D1=ur(function(n,e){e.__esModule=!0,e.extend=o,e.indexOf=function(c,f){for(var h=0,m=c.length;h<m;h++)if(c[h]===f)return h;return-1},e.escapeExpression=function(c){if(typeof c!="string"){if(c&&c.toHTML)return c.toHTML();if(c==null)return"";if(!c)return c+"";c=""+c}return i.test(c)?c.replace(r,a):c},e.isEmpty=function(c){return!c&&c!==0||!(!u(c)||c.length!==0)},e.createFrame=function(c){var f=o({},c);return f._parent=c,f},e.blockParams=function(c,f){return c.path=f,c},e.appendContextPath=function(c,f){return(c?c+".":"")+f};var t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},r=/[&<>"'`=]/g,i=/[&<>"'`=]/;function a(c){return t[c]}function o(c){for(var f=1;f<arguments.length;f++)for(var h in arguments[f])Object.prototype.hasOwnProperty.call(arguments[f],h)&&(c[h]=arguments[f][h]);return c}var l=Object.prototype.toString;e.toString=l;var s=function(c){return typeof c=="function"};s(/x/)&&(e.isFunction=s=function(c){return typeof c=="function"&&l.call(c)==="[object Function]"}),e.isFunction=s;var u=Array.isArray||function(c){return!(!c||typeof c!="object")&&l.call(c)==="[object Array]"};e.isArray=u}),U3=ur(function(n,e){e.__esModule=!0;var t=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function r(i,a){var o=a&&a.loc,l=void 0,s=void 0,u=void 0,c=void 0;o&&(l=o.start.line,s=o.end.line,u=o.start.column,c=o.end.column,i+=" - "+l+":"+u);for(var f=Error.prototype.constructor.call(this,i),h=0;h<t.length;h++)this[t[h]]=f[t[h]];Error.captureStackTrace&&Error.captureStackTrace(this,r);try{o&&(this.lineNumber=l,this.endLineNumber=s,Object.defineProperty?(Object.defineProperty(this,"column",{value:u,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:c,enumerable:!0})):(this.column=u,this.endColumn=c))}catch{}}r.prototype=new Error,e.default=r,n.exports=e.default}),h1e=ur(function(n,e){e.__esModule=!0,e.default=function(t){t.registerHelper("blockHelperMissing",function(r,i){var a=i.inverse,o=i.fn;if(r===!0)return o(this);if(r===!1||r==null)return a(this);if(D1.isArray(r))return r.length>0?(i.ids&&(i.ids=[i.name]),t.helpers.each(r,i)):a(this);if(i.data&&i.ids){var l=D1.createFrame(i.data);l.contextPath=D1.appendContextPath(i.data.contextPath,i.name),i={data:l}}return o(r,i)})},n.exports=e.default}),m1e=ur(function(n,e){e.__esModule=!0;var t,r=(t=U3)&&t.__esModule?t:{default:t};e.default=function(i){i.registerHelper("each",function(a,o){if(!o)throw new r.default("Must pass iterator to #each");var l,s=o.fn,u=o.inverse,c=0,f="",h=void 0,m=void 0;function _(T,I,P){h&&(h.key=T,h.index=I,h.first=I===0,h.last=!!P,m&&(h.contextPath=m+T)),f+=s(a[T],{data:h,blockParams:D1.blockParams([a[T],T],[m+T,null])})}if(o.data&&o.ids&&(m=D1.appendContextPath(o.data.contextPath,o.ids[0])+"."),D1.isFunction(a)&&(a=a.call(this)),o.data&&(h=D1.createFrame(o.data)),a&&typeof a=="object")if(D1.isArray(a))for(var y=a.length;c<y;c++)c in a&&_(c,c,c===a.length-1);else if(Ef.Symbol&&a[Ef.Symbol.iterator]){for(var w=[],A=a[Ef.Symbol.iterator](),S=A.next();!S.done;S=A.next())w.push(S.value);for(y=(a=w).length;c<y;c++)_(c,c,c===a.length-1)}else l=void 0,Object.keys(a).forEach(function(T){l!==void 0&&_(l,c-1),l=T,c++}),l!==void 0&&_(l,c-1,!0);return c===0&&(f=u(this)),f})},n.exports=e.default}),g1e=ur(function(n,e){e.__esModule=!0;var t,r=(t=U3)&&t.__esModule?t:{default:t};e.default=function(i){i.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new r.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},n.exports=e.default}),v1e=ur(function(n,e){e.__esModule=!0;var t,r=(t=U3)&&t.__esModule?t:{default:t};e.default=function(i){i.registerHelper("if",function(a,o){if(arguments.length!=2)throw new r.default("#if requires exactly one argument");return D1.isFunction(a)&&(a=a.call(this)),!o.hash.includeZero&&!a||D1.isEmpty(a)?o.inverse(this):o.fn(this)}),i.registerHelper("unless",function(a,o){if(arguments.length!=2)throw new r.default("#unless requires exactly one argument");return i.helpers.if.call(this,a,{fn:o.inverse,inverse:o.fn,hash:o.hash})})},n.exports=e.default}),_1e=ur(function(n,e){e.__esModule=!0,e.default=function(t){t.registerHelper("log",function(){for(var r=[void 0],i=arguments[arguments.length-1],a=0;a<arguments.length-1;a++)r.push(arguments[a]);var o=1;i.hash.level!=null?o=i.hash.level:i.data&&i.data.level!=null&&(o=i.data.level),r[0]=o,t.log.apply(t,r)})},n.exports=e.default}),b1e=ur(function(n,e){e.__esModule=!0,e.default=function(t){t.registerHelper("lookup",function(r,i,a){return r&&a.lookupProperty(r,i)})},n.exports=e.default}),y1e=ur(function(n,e){e.__esModule=!0;var t,r=(t=U3)&&t.__esModule?t:{default:t};e.default=function(i){i.registerHelper("with",function(a,o){if(arguments.length!=2)throw new r.default("#with requires exactly one argument");D1.isFunction(a)&&(a=a.call(this));var l=o.fn;if(D1.isEmpty(a))return o.inverse(this);var s=o.data;return o.data&&o.ids&&((s=D1.createFrame(o.data)).contextPath=D1.appendContextPath(o.data.contextPath,o.ids[0])),l(a,{data:s,blockParams:D1.blockParams([a],[s&&s.contextPath])})})},n.exports=e.default}),$1e=function(n){k1e.default(n),z1e.default(n),A1e.default(n),M1e.default(n),C1e.default(n),S1e.default(n),L1e.default(n)},w1e=function(n,e,t){n.helpers[e]&&(n.hooks[e]=n.helpers[e],t||delete n.helpers[e])};function xd(n){return n&&n.__esModule?n:{default:n}}var k1e=xd(h1e),z1e=xd(m1e),A1e=xd(g1e),M1e=xd(v1e),C1e=xd(_1e),S1e=xd(b1e),L1e=xd(y1e),u$=Object.defineProperty({registerDefaultHelpers:$1e,moveHelperToHooks:w1e},"__esModule",{value:!0}),E1e=ur(function(n,e){e.__esModule=!0,e.default=function(t){t.registerDecorator("inline",function(r,i,a,o){var l=r;return i.partials||(i.partials={},l=function(s,u){var c=a.partials;a.partials=D1.extend({},c,i.partials);var f=r(s,u);return a.partials=c,f}),i.partials[o.args[0]]=o.fn,l})},n.exports=e.default}),T1e=function(n){D1e.default(n)},J7,D1e=(J7=E1e)&&J7.__esModule?J7:{default:J7},B1e=Object.defineProperty({registerDefaultDecorators:T1e},"__esModule",{value:!0}),zq=ur(function(n,e){e.__esModule=!0;var t={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(r){if(typeof r=="string"){var i=D1.indexOf(t.methodMap,r.toLowerCase());r=i>=0?i:parseInt(r,10)}return r},log:function(r){if(r=t.lookupLevel(r),typeof console<"u"&&t.lookupLevel(t.level)<=r){var i=t.methodMap[r];console[i]||(i="log");for(var a=arguments.length,o=Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];console[i].apply(console,o)}}};e.default=t,n.exports=e.default}),H1e=function(){for(var n=arguments.length,e=Array(n),t=0;t<n;t++)e[t]=arguments[t];return D1.extend.apply(void 0,[Object.create(null)].concat(e))},oS=Object.defineProperty({createNewLookupObject:H1e},"__esModule",{value:!0}),O1e=function(n){var e=Object.create(null);e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1;var t=Object.create(null);return t.__proto__=!1,{properties:{whitelist:oS.createNewLookupObject(t,n.allowedProtoProperties),defaultValue:n.allowProtoPropertiesByDefault},methods:{whitelist:oS.createNewLookupObject(e,n.allowedProtoMethods),defaultValue:n.allowProtoMethodsByDefault}}},I1e=function(n,e,t){return R1e(typeof n=="function"?e.methods:e.properties,t)},P1e=function(){Object.keys(cv).forEach(function(n){delete cv[n]})},V1e=function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}(zq),cv=Object.create(null);function R1e(n,e){return n.whitelist[e]!==void 0?n.whitelist[e]===!0:n.defaultValue!==void 0?n.defaultValue:(function(t){cv[t]!==!0&&(cv[t]=!0,V1e.log("error",'Handlebars: Access has been denied to resolve the property "'+t+`" because it is not an "own property" of its parent.
|
|
34
34
|
You can add a runtime option to disable the check or this warning:
|
|
35
35
|
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}(e),!1)}var c$=Object.defineProperty({createProtoAccessControl:O1e,resultIsAllowed:I1e,resetLoggedProperties:P1e},"__esModule",{value:!0}),N1e=f$;function Aq(n){return n&&n.__esModule?n:{default:n}}var Cb=Aq(U3),fv=Aq(zq),F1e={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};function f$(n,e,t){this.helpers=n||{},this.partials=e||{},this.decorators=t||{},u$.registerDefaultHelpers(this),B1e.registerDefaultDecorators(this)}f$.prototype={constructor:f$,logger:fv.default,log:fv.default.log,registerHelper:function(n,e){if(D1.toString.call(n)==="[object Object]"){if(e)throw new Cb.default("Arg not supported with multiple helpers");D1.extend(this.helpers,n)}else this.helpers[n]=e},unregisterHelper:function(n){delete this.helpers[n]},registerPartial:function(n,e){if(D1.toString.call(n)==="[object Object]")D1.extend(this.partials,n);else{if(e===void 0)throw new Cb.default('Attempting to register a partial called "'+n+'" as undefined');this.partials[n]=e}},unregisterPartial:function(n){delete this.partials[n]},registerDecorator:function(n,e){if(D1.toString.call(n)==="[object Object]"){if(e)throw new Cb.default("Arg not supported with multiple decorators");D1.extend(this.decorators,n)}else this.decorators[n]=e},unregisterDecorator:function(n){delete this.decorators[n]},resetLoggedPropertyAccesses:function(){c$.resetLoggedProperties()}};var j1e=fv.default.log,x1e=D1.createFrame,U1e=fv.default,Zf=Object.defineProperty({HandlebarsEnvironment:N1e,VERSION:"4.7.7",COMPILER_REVISION:8,LAST_COMPATIBLE_COMPILER_REVISION:7,REVISION_CHANGES:F1e,log:j1e,createFrame:x1e,logger:U1e},"__esModule",{value:!0}),q1e=ur(function(n,e){function t(r){this.string=r}e.__esModule=!0,t.prototype.toString=t.prototype.toHTML=function(){return""+this.string},e.default=t,n.exports=e.default}),W1e=function(n,e){return typeof n!="function"?n:function(){return arguments[arguments.length-1]=e(arguments[arguments.length-1]),n.apply(this,arguments)}},G1e=Object.defineProperty({wrapHelper:W1e},"__esModule",{value:!0}),Y1e=function(n){var e=n&&n[0]||1,t=Zf.COMPILER_REVISION;if(!(e>=Zf.LAST_COMPATIBLE_COMPILER_REVISION&&e<=Zf.COMPILER_REVISION)){if(e<Zf.LAST_COMPATIBLE_COMPILER_REVISION){var r=Zf.REVISION_CHANGES[t],i=Zf.REVISION_CHANGES[e];throw new e5.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+i+").")}throw new e5.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+n[1]+").")}},K1e=function(n,e){if(!e)throw new e5.default("No environment passed to template");if(!n||!n.main)throw new e5.default("Unknown template object: "+typeof n);n.main.decorator=n.main_d,e.VM.checkRevision(n.compiler);var t=n.compiler&&n.compiler[0]===7,r={strict:function(a,o,l){if(!a||!(o in a))throw new e5.default('"'+o+'" not defined in '+a,{loc:l});return r.lookupProperty(a,o)},lookupProperty:function(a,o){var l=a[o];return l==null||Object.prototype.hasOwnProperty.call(a,o)||c$.resultIsAllowed(l,r.protoAccessControl,o)?l:void 0},lookup:function(a,o){for(var l=a.length,s=0;s<l;s++)if((a[s]&&r.lookupProperty(a[s],o))!=null)return a[s][o]},lambda:function(a,o){return typeof a=="function"?a.call(o):a},escapeExpression:J4.escapeExpression,invokePartial:function(a,o,l){l.hash&&(o=J4.extend({},o,l.hash),l.ids&&(l.ids[0]=!0)),a=e.VM.resolvePartial.call(this,a,o,l);var s=J4.extend({},l,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),u=e.VM.invokePartial.call(this,a,o,s);if(u==null&&e.compile&&(l.partials[l.name]=e.compile(a,n.compilerOptions,e),u=l.partials[l.name](o,s)),u!=null){if(l.indent){for(var c=u.split(`
|
|
@@ -175,7 +175,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
175
175
|
`},dashcase:{args:["string"],numArgs:1,example:"{{dashcase 'a-b-c d_e'}} -> a-b-c-d-e",description:`<p>dash-case the characters in <code>string</code>. Replaces non-word characters and periods with hyphens.</p>
|
|
176
176
|
`},dotcase:{args:["string"],numArgs:1,example:"{{dotcase 'a-b-c d_e'}} -> a.b.c.d.e",description:`<p>dot.case the characters in <code>string</code>.</p>
|
|
177
177
|
`},downcase:{args:["string"],numArgs:1,example:"{{downcase 'aBcDeF'}} -> abcdef",description:`<p>Lowercase all of the characters in the given string. Alias for <a href="#lowercase">lowercase</a>.</p>
|
|
178
|
-
`},ellipsis:{args:["str","length"],numArgs:2,example:"{{ellipsis 'foo bar baz' 7}} -> foo bar\u2026",description:`<p>Truncates a string to the specified <code>length</code>, and appends it with an elipsis, <code>\u2026</code>.</p>
|
|
178
|
+
`},ellipsis:{args:["str","length"],numArgs:2,example:"{{ellipsis 'foo bar baz', 7}} -> foo bar\u2026",description:`<p>Truncates a string to the specified <code>length</code>, and appends it with an elipsis, <code>\u2026</code>.</p>
|
|
179
179
|
`},hyphenate:{args:["str"],numArgs:1,example:"{{hyphenate 'foo bar baz qux'}} -> foo-bar-baz-qux",description:`<p>Replace spaces in a string with hyphens.</p>
|
|
180
180
|
`},isString:{args:["value"],numArgs:1,example:"{{isString 'foo'}} -> true",description:`<p>Return true if <code>value</code> is a string.</p>
|
|
181
181
|
`},lowercase:{args:["str"],numArgs:1,example:"{{lowercase 'Foo BAR baZ'}} -> foo bar baz",description:`<p>Lowercase all characters in the given string.</p>
|
|
@@ -340,7 +340,7 @@ Please report this to https://github.com/markedjs/marked.`,Xe.silent)return"<p>A
|
|
|
340
340
|
-----
|
|
341
341
|
|
|
342
342
|
`]},dce={link:"URL for the link:",image:"URL of the image:"},hce={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},mce={bold:"**",code:"```",italic:"*"},gce={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},vce={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#).
|
|
343
|
-
Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};function Lr(n){n=n||{},n.parent=this;var e=!0;if(n.autoDownloadFontAwesome===!1&&(e=!1),n.autoDownloadFontAwesome!==!0)for(var t=document.styleSheets,r=0;r<t.length;r++)!t[r].href||t[r].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(e=!1);if(e){var i=document.createElement("link");i.rel="stylesheet",i.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(i)}if(n.element)this.element=n.element;else if(n.element===null){console.log("EasyMDE: Error. No element was found.");return}if(n.toolbar===void 0){n.toolbar=[];for(var a in zd)Object.prototype.hasOwnProperty.call(zd,a)&&(a.indexOf("separator-")!=-1&&n.toolbar.push("|"),(zd[a].default===!0||n.showIcons&&n.showIcons.constructor===Array&&n.showIcons.indexOf(a)!=-1)&&n.toolbar.push(a))}if(Object.prototype.hasOwnProperty.call(n,"previewClass")||(n.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(n,"status")||(n.status=["autosave","lines","words","cursor"],n.uploadImage&&n.status.unshift("upload-image")),n.previewRender||(n.previewRender=function(l){return this.parent.markdown(l)}),n.parsingConfig=q5({highlightFormatting:!0},n.parsingConfig||{}),n.insertTexts=q5({},pce,n.insertTexts||{}),n.promptTexts=q5({},dce,n.promptTexts||{}),n.blockStyles=q5({},mce,n.blockStyles||{}),n.autosave!=null&&(n.autosave.timeFormat=q5({},hce,n.autosave.timeFormat||{})),n.shortcuts=q5({},ice,n.shortcuts||{}),n.maxHeight=n.maxHeight||void 0,n.direction=n.direction||"ltr",typeof n.maxHeight<"u"?n.minHeight=n.maxHeight:n.minHeight=n.minHeight||"300px",n.errorCallback=n.errorCallback||function(l){alert(l)},n.uploadImage=n.uploadImage||!1,n.imageMaxSize=n.imageMaxSize||2097152,n.imageAccept=n.imageAccept||"image/png, image/jpeg",n.imageTexts=q5({},gce,n.imageTexts||{}),n.errorMessages=q5({},vce,n.errorMessages||{}),n.autosave!=null&&n.autosave.unique_id!=null&&n.autosave.unique_id!=""&&(n.autosave.uniqueId=n.autosave.unique_id),n.overlayMode&&n.overlayMode.combine===void 0&&(n.overlayMode.combine=!0),this.options=n,this.render(),n.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(n.initialValue),n.uploadImage){var o=this;this.codemirror.on("dragenter",function(l,s){o.updateStatusBar("upload-image",o.options.imageTexts.sbOnDragEnter),s.stopPropagation(),s.preventDefault()}),this.codemirror.on("dragend",function(l,s){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit),s.stopPropagation(),s.preventDefault()}),this.codemirror.on("dragleave",function(l,s){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit),s.stopPropagation(),s.preventDefault()}),this.codemirror.on("dragover",function(l,s){o.updateStatusBar("upload-image",o.options.imageTexts.sbOnDragEnter),s.stopPropagation(),s.preventDefault()}),this.codemirror.on("drop",function(l,s){s.stopPropagation(),s.preventDefault(),n.imageUploadFunction?o.uploadImagesUsingCustomFunction(n.imageUploadFunction,s.dataTransfer.files):o.uploadImages(s.dataTransfer.files)}),this.codemirror.on("paste",function(l,s){n.imageUploadFunction?o.uploadImagesUsingCustomFunction(n.imageUploadFunction,s.clipboardData.files):o.uploadImages(s.clipboardData.files)})}}Lr.prototype.uploadImages=function(n,e,t){if(n.length!==0){for(var r=[],i=0;i<n.length;i++)r.push(n[i].name),this.uploadImage(n[i],e,t);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",r.join(", ")))}};Lr.prototype.uploadImagesUsingCustomFunction=function(n,e){if(e.length!==0){for(var t=[],r=0;r<e.length;r++)t.push(e[r].name),this.uploadImageUsingCustomFunction(n,e[r]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",t.join(", ")))}};Lr.prototype.updateStatusBar=function(n,e){if(!!this.gui.statusbar){var t=this.gui.statusbar.getElementsByClassName(n);t.length===1?this.gui.statusbar.getElementsByClassName(n)[0].textContent=e:t.length===0?console.log("EasyMDE: status bar item "+n+" was not found."):console.log("EasyMDE: Several status bar items named "+n+" was found.")}};Lr.prototype.markdown=function(n){if(ay){var e;if(this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?e=this.options.renderingConfig.markedOptions:e={},this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?e.breaks=!1:e.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var t=this.options.renderingConfig.hljs||window.hljs;t&&(e.highlight=function(i,a){return a&&t.getLanguage(a)?t.highlight(a,i).value:t.highlightAuto(i).value})}ay.setOptions(e);var r=ay.parse(n);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction=="function"&&(r=this.options.renderingConfig.sanitizerFunction.call(this,r)),r=oce(r),r=lce(r),r}};Lr.prototype.render=function(n){if(n||(n=this.element||document.getElementsByTagName("textarea")[0]),this._rendered&&this._rendered===n)return;this.element=n;var e=this.options,t=this,r={};for(var i in e.shortcuts)e.shortcuts[i]!==null&&Qg[i]!==null&&function(w){r[kG(e.shortcuts[w])]=function(){var A=Qg[w];typeof A=="function"?A(t):typeof A=="string"&&window.open(A,"_blank")}}(i);r.Enter="newlineAndIndentContinueMarkdownList",r.Tab="tabAndIndentMarkdownList",r["Shift-Tab"]="shiftTabAndUnindentMarkdownList",r.Esc=function(w){w.getOption("fullScreen")&&Td(t)},this.documentOnKeyDown=function(w){w=w||window.event,w.keyCode==27&&t.codemirror.getOption("fullScreen")&&Td(t)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var a,o;e.overlayMode?(bh.defineMode("overlay-mode",function(w){return bh.overlayMode(bh.getMode(w,e.spellChecker!==!1?"spell-checker":"gfm"),e.overlayMode.mode,e.overlayMode.combine)}),a="overlay-mode",o=e.parsingConfig,o.gitHubSpice=!1):(a=e.parsingConfig,a.name="gfm",a.gitHubSpice=!1),e.spellChecker!==!1&&(a="spell-checker",o=e.parsingConfig,o.name="gfm",o.gitHubSpice=!1,typeof e.spellChecker=="function"?e.spellChecker({codeMirrorInstance:bh}):nce({codeMirrorInstance:bh}));function l(w,A,S){return{addNew:!1}}if(this.codemirror=bh.fromTextArea(n,{mode:a,backdrop:o,theme:e.theme!=null?e.theme:"easymde",tabSize:e.tabSize!=null?e.tabSize:2,indentUnit:e.tabSize!=null?e.tabSize:2,indentWithTabs:e.indentWithTabs!==!1,lineNumbers:e.lineNumbers===!0,autofocus:e.autofocus===!0,extraKeys:r,direction:e.direction,lineWrapping:e.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:e.placeholder||n.getAttribute("placeholder")||"",styleSelectedText:e.styleSelectedText!=null?e.styleSelectedText:!I$(),scrollbarStyle:e.scrollbarStyle!=null?e.scrollbarStyle:"native",configureMouse:l,inputStyle:e.inputStyle!=null?e.inputStyle:I$()?"contenteditable":"textarea",spellcheck:e.nativeSpellcheck!=null?e.nativeSpellcheck:!0,autoRefresh:e.autoRefresh!=null?e.autoRefresh:!1}),this.codemirror.getScrollerElement().style.minHeight=e.minHeight,typeof e.maxHeight<"u"&&(this.codemirror.getScrollerElement().style.height=e.maxHeight),e.forceSync===!0){var s=this.codemirror;s.on("change",function(){s.save()})}this.gui={};var u=document.createElement("div");u.classList.add("EasyMDEContainer");var c=this.codemirror.getWrapperElement();c.parentNode.insertBefore(u,c),u.appendChild(c),e.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),e.status!==!1&&(this.gui.statusbar=this.createStatusbar()),e.autosave!=null&&e.autosave.enabled===!0&&(this.autosave(),this.codemirror.on("change",function(){clearTimeout(t._autosave_timeout),t._autosave_timeout=setTimeout(function(){t.autosave()},t.options.autosave.submit_delay||t.options.autosave.delay||1e3)}));function f(w,A){var S,T=window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","");return w<T?S=A+"px":S=A/w*100+"%",S}var h=this;function m(w,A){w.setAttribute("data-img-src",A.url),w.setAttribute("style","--bg-image:url("+A.url+");--width:"+A.naturalWidth+"px;--height:"+f(A.naturalWidth,A.naturalHeight)),h.codemirror.setSize()}function _(){!e.previewImagesInEditor||u.querySelectorAll(".cm-image-marker").forEach(function(w){var A=w.parentElement;if(!!A.innerText.match(/^!\[.*?\]\(.*\)/g)&&!A.hasAttribute("data-img-src")){var S=A.innerText.match("\\((.*)\\)");if(window.EMDEimagesCache||(window.EMDEimagesCache={}),S&&S.length>=2){var T=S[1];if(window.EMDEimagesCache[T])m(A,window.EMDEimagesCache[T]);else{var I=document.createElement("img");I.onload=function(){window.EMDEimagesCache[T]={naturalWidth:I.naturalWidth,naturalHeight:I.naturalHeight,url:T},m(A,window.EMDEimagesCache[T])},I.src=T}}}})}this.codemirror.on("update",function(){_()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element;var y=this.codemirror;setTimeout(function(){y.refresh()}.bind(y),0)};Lr.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function LG(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}Lr.prototype.autosave=function(){if(LG()){var n=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(n.element.form!=null&&n.element.form!=null&&n.element.form.addEventListener("submit",function(){clearTimeout(n.autosaveTimeoutId),n.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+n.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&localStorage.getItem("smde_"+this.options.autosave.uniqueId)!=""&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var e=n.value();e!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,e):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var t=document.getElementById("autosaved");if(t!=null&&t!=null&&t!=""){var r=new Date,i=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(r),a=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;t.innerHTML=a+i}}else console.log("EasyMDE: localStorage not available, cannot autosave")};Lr.prototype.clearAutosavedValue=function(){if(LG()){if(this.options.autosave==null||this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to clear the autosave value");return}localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")};Lr.prototype.openBrowseFileWindow=function(n,e){var t=this,r=this.gui.toolbar.getElementsByClassName("imageInput")[0];r.click();function i(a){t.options.imageUploadFunction?t.uploadImagesUsingCustomFunction(t.options.imageUploadFunction,a.target.files):t.uploadImages(a.target.files,n,e),r.removeEventListener("change",i)}r.addEventListener("change",i)};Lr.prototype.uploadImage=function(n,e,t){var r=this;e=e||function(u){CG(r,u)};function i(s){r.updateStatusBar("upload-image",s),setTimeout(function(){r.updateStatusBar("upload-image",r.options.imageTexts.sbInit)},1e4),t&&typeof t=="function"&&t(s),r.options.errorCallback(s)}function a(s){var u=r.options.imageTexts.sizeUnits.split(",");return s.replace("#image_name#",n.name).replace("#image_size#",Mv(n.size,u)).replace("#image_max_size#",Mv(r.options.imageMaxSize,u))}if(n.size>this.options.imageMaxSize){i(a(this.options.errorMessages.fileTooLarge));return}var o=new FormData;o.append("image",n),r.options.imageCSRFToken&&o.append("csrfmiddlewaretoken",r.options.imageCSRFToken);var l=new XMLHttpRequest;l.upload.onprogress=function(s){if(s.lengthComputable){var u=""+Math.round(s.loaded*100/s.total);r.updateStatusBar("upload-image",r.options.imageTexts.sbProgress.replace("#file_name#",n.name).replace("#progress#",u))}},l.open("POST",this.options.imageUploadEndpoint),l.onload=function(){try{var s=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),i(a(r.options.errorMessages.importError));return}this.status===200&&s&&!s.error&&s.data&&s.data.filePath?e((r.options.imagePathAbsolute?"":window.location.origin+"/")+s.data.filePath):s.error&&s.error in r.options.errorMessages?i(a(r.options.errorMessages[s.error])):s.error?i(a(s.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),i(a(r.options.errorMessages.importError)))},l.onerror=function(s){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+s.target.status+" ("+s.target.statusText+")"),i(r.options.errorMessages.importError)},l.send(o)};Lr.prototype.uploadImageUsingCustomFunction=function(n,e){var t=this;function r(o){CG(t,o)}function i(o){var l=a(o);t.updateStatusBar("upload-image",l),setTimeout(function(){t.updateStatusBar("upload-image",t.options.imageTexts.sbInit)},1e4),t.options.errorCallback(l)}function a(o){var l=t.options.imageTexts.sizeUnits.split(",");return o.replace("#image_name#",e.name).replace("#image_size#",Mv(e.size,l)).replace("#image_max_size#",Mv(t.options.imageMaxSize,l))}n.apply(this,[e,r,i])};Lr.prototype.setPreviewMaxHeight=function(){var n=this.codemirror,e=n.getWrapperElement(),t=e.nextSibling,r=parseInt(window.getComputedStyle(e).paddingTop),i=parseInt(window.getComputedStyle(e).borderTopWidth),a=parseInt(this.options.maxHeight),o=a+r*2+i*2,l=o.toString()+"px";t.style.height=l};Lr.prototype.createSideBySide=function(){var n=this.codemirror,e=n.getWrapperElement(),t=e.nextSibling;if(!t||!/editor-preview-side/.test(t.className)){if(t=document.createElement("div"),t.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var r=0;r<this.options.previewClass.length;r++)t.className+=" "+this.options.previewClass[r];else typeof this.options.previewClass=="string"&&(t.className+=" "+this.options.previewClass);e.parentNode.insertBefore(t,e.nextSibling)}if(typeof this.options.maxHeight<"u"&&this.setPreviewMaxHeight(),this.options.syncSideBySidePreviewScroll===!1)return t;var i=!1,a=!1;return n.on("scroll",function(o){if(i){i=!1;return}a=!0;var l=o.getScrollInfo().height-o.getScrollInfo().clientHeight,s=parseFloat(o.getScrollInfo().top)/l,u=(t.scrollHeight-t.clientHeight)*s;t.scrollTop=u}),t.onscroll=function(){if(a){a=!1;return}i=!0;var o=t.scrollHeight-t.clientHeight,l=parseFloat(t.scrollTop)/o,s=(n.getScrollInfo().height-n.getScrollInfo().clientHeight)*l;n.scrollTo(0,s)},t};Lr.prototype.createToolbar=function(n){if(n=n||this.options.toolbar,!(!n||n.length===0)){var e;for(e=0;e<n.length;e++)zd[n[e]]!=null&&(n[e]=zd[n[e]]);var t=document.createElement("div");t.className="editor-toolbar";var r=this,i={};for(r.toolbar=n,e=0;e<n.length;e++)if(!(n[e].name=="guide"&&r.options.toolbarGuideIcon===!1)&&!(r.options.hideIcons&&r.options.hideIcons.indexOf(n[e].name)!=-1)&&!((n[e].name=="fullscreen"||n[e].name=="side-by-side")&&I$())){if(n[e]==="|"){for(var a=!1,o=e+1;o<n.length;o++)n[o]!=="|"&&(!r.options.hideIcons||r.options.hideIcons.indexOf(n[o].name)==-1)&&(a=!0);if(!a)continue}(function(u){var c;if(u==="|"?c=uce():u.children?c=sce(u,r.options.toolbarTips,r.options.shortcuts,r):c=x9(u,!0,r.options.toolbarTips,r.options.shortcuts,"button",r),i[u.name||u]=c,t.appendChild(c),u.name==="upload-image"){var f=document.createElement("input");f.className="imageInput",f.type="file",f.multiple=!0,f.name="image",f.accept=r.options.imageAccept,f.style.display="none",f.style.opacity=0,t.appendChild(f)}})(n[e])}r.toolbar_div=t,r.toolbarElements=i;var l=this.codemirror;l.on("cursorActivity",function(){var u=k5(l);for(var c in i)(function(f){var h=i[f];u[f]?h.className+=" active":f!="fullscreen"&&f!="side-by-side"&&(h.className=h.className.replace(/\s*active\s*/g,""))})(c)});var s=l.getWrapperElement();return s.parentNode.insertBefore(t,s),t}};Lr.prototype.createStatusbar=function(n){n=n||this.options.status;var e=this.options,t=this.codemirror;if(!(!n||n.length===0)){var r=[],i,a,o,l;for(i=0;i<n.length;i++)if(a=void 0,o=void 0,l=void 0,typeof n[i]=="object")r.push({className:n[i].className,defaultValue:n[i].defaultValue,onUpdate:n[i].onUpdate,onActivity:n[i].onActivity});else{var s=n[i];s==="words"?(l=function(m){m.innerHTML=yE(t.getValue())},a=function(m){m.innerHTML=yE(t.getValue())}):s==="lines"?(l=function(m){m.innerHTML=t.lineCount()},a=function(m){m.innerHTML=t.lineCount()}):s==="cursor"?(l=function(m){m.innerHTML="1:1"},o=function(m){var _=t.getCursor(),y=_.line+1,w=_.ch+1;m.innerHTML=y+":"+w}):s==="autosave"?l=function(m){e.autosave!=null&&e.autosave.enabled===!0&&m.setAttribute("id","autosaved")}:s==="upload-image"&&(l=function(m){m.innerHTML=e.imageTexts.sbInit}),r.push({className:s,defaultValue:l,onUpdate:a,onActivity:o})}var u=document.createElement("div");for(u.className="editor-statusbar",i=0;i<r.length;i++){var c=r[i],f=document.createElement("span");f.className=c.className,typeof c.defaultValue=="function"&&c.defaultValue(f),typeof c.onUpdate=="function"&&this.codemirror.on("update",function(m,_){return function(){_.onUpdate(m)}}(f,c)),typeof c.onActivity=="function"&&this.codemirror.on("cursorActivity",function(m,_){return function(){_.onActivity(m)}}(f,c)),u.appendChild(f)}var h=this.codemirror.getWrapperElement();return h.parentNode.insertBefore(u,h.nextSibling),u}};Lr.prototype.value=function(n){var e=this.codemirror;if(n===void 0)return e.getValue();if(e.getDoc().setValue(n),this.isPreviewActive()){var t=e.getWrapperElement(),r=t.lastChild;r.innerHTML=this.options.previewRender(n,r)}return this};Lr.toggleBold=y_;Lr.toggleItalic=$_;Lr.toggleStrikethrough=w_;Lr.toggleBlockquote=z_;Lr.toggleHeadingSmaller=e7;Lr.toggleHeadingBigger=A_;Lr.toggleHeading1=M_;Lr.toggleHeading2=C_;Lr.toggleHeading3=S_;Lr.toggleCodeBlock=k_;Lr.toggleUnorderedList=L_;Lr.toggleOrderedList=E_;Lr.cleanBlock=T_;Lr.drawLink=D_;Lr.drawImage=B_;Lr.drawUploadedImage=Ck;Lr.drawTable=H_;Lr.drawHorizontalRule=O_;Lr.undo=I_;Lr.redo=P_;Lr.togglePreview=V_;Lr.toggleSideBySide=L6;Lr.toggleFullScreen=Td;Lr.prototype.toggleBold=function(){y_(this)};Lr.prototype.toggleItalic=function(){$_(this)};Lr.prototype.toggleStrikethrough=function(){w_(this)};Lr.prototype.toggleBlockquote=function(){z_(this)};Lr.prototype.toggleHeadingSmaller=function(){e7(this)};Lr.prototype.toggleHeadingBigger=function(){A_(this)};Lr.prototype.toggleHeading1=function(){M_(this)};Lr.prototype.toggleHeading2=function(){C_(this)};Lr.prototype.toggleHeading3=function(){S_(this)};Lr.prototype.toggleCodeBlock=function(){k_(this)};Lr.prototype.toggleUnorderedList=function(){L_(this)};Lr.prototype.toggleOrderedList=function(){E_(this)};Lr.prototype.cleanBlock=function(){T_(this)};Lr.prototype.drawLink=function(){D_(this)};Lr.prototype.drawImage=function(){B_(this)};Lr.prototype.drawUploadedImage=function(){Ck(this)};Lr.prototype.drawTable=function(){H_(this)};Lr.prototype.drawHorizontalRule=function(){O_(this)};Lr.prototype.undo=function(){I_(this)};Lr.prototype.redo=function(){P_(this)};Lr.prototype.togglePreview=function(){V_(this)};Lr.prototype.toggleSideBySide=function(){L6(this)};Lr.prototype.toggleFullScreen=function(){Td(this)};Lr.prototype.isPreviewActive=function(){var n=this.codemirror,e=n.getWrapperElement(),t=e.lastChild;return/editor-preview-active/.test(t.className)};Lr.prototype.isSideBySideActive=function(){var n=this.codemirror,e=n.getWrapperElement(),t=e.nextSibling;return/editor-preview-active-side/.test(t.className)};Lr.prototype.isFullscreenActive=function(){var n=this.codemirror;return n.getOption("fullScreen")};Lr.prototype.getState=function(){var n=this.codemirror;return k5(n)};Lr.prototype.toTextArea=function(){var n=this.codemirror,e=n.getWrapperElement(),t=e.parentNode;t&&(this.gui.toolbar&&t.removeChild(this.gui.toolbar),this.gui.statusbar&&t.removeChild(this.gui.statusbar),this.gui.sideBySide&&t.removeChild(this.gui.sideBySide)),t.parentNode.insertBefore(e,t),t.remove(),n.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())};var _ce=Lr;function bce(n){let e,t;return{c(){e=X("div"),t=X("textarea"),t.disabled=!0,D(t,"id",n[0]),D(e,"style",n[3]),D(e,"class","svelte-1gaj2sn"),Te(e,"disabled",n[1])},m(r,i){C(r,e,i),x(e,t),n[9](t)},p(r,[i]){i&1&&D(t,"id",r[0]),i&8&&D(e,"style",r[3]),i&2&&Te(e,"disabled",r[1])},i:ht,o:ht,d(r){r&&M(e),n[9](null)}}}function yce(n,e,t){let r,{height:i=null}=e,{scroll:a=!0}=e,{easyMDEOptions:o=null}=e,{mde:l=null}=e,{id:s=null}=e,{fullScreenOffset:u=null}=e,{disabled:c=!1}=e,f;ar(()=>(t(4,i=i||"200px"),t(5,l=new _ce({element:f,spellChecker:!1,status:!1,unorderedListStyle:"-",maxHeight:a?i:void 0,minHeight:a?void 0:i,...o})),()=>{l.toTextArea()}));const h=_=>{let y="";return y+=`--fullscreen-offset-x:${(_==null?void 0:_.x)||"0px"};`,y+=`--fullscreen-offset-y:${(_==null?void 0:_.y)||"0px"};`,y};function m(_){De[_?"unshift":"push"](()=>{f=_,t(2,f)})}return n.$$set=_=>{"height"in _&&t(4,i=_.height),"scroll"in _&&t(6,a=_.scroll),"easyMDEOptions"in _&&t(7,o=_.easyMDEOptions),"mde"in _&&t(5,l=_.mde),"id"in _&&t(0,s=_.id),"fullScreenOffset"in _&&t(8,u=_.fullScreenOffset),"disabled"in _&&t(1,c=_.disabled)},n.$$.update=()=>{n.$$.dirty&256&&t(3,r=h(u))},[s,c,f,r,i,l,a,o,u,m]}class $ce extends Ve{constructor(e){super(),Pe(this,e,yce,bce,Ie,{height:4,scroll:6,easyMDEOptions:7,mde:5,id:0,fullScreenOffset:8,disabled:1})}}function $E(n){let e,t,r;function i(o){n[8](o)}let a={scroll:!0,height:n[1],id:n[3],fullScreenOffset:n[4],disabled:n[5],easyMDEOptions:{initialValue:n[0],placeholder:n[2],...n[6]}};return n[7]!==void 0&&(a.mde=n[7]),e=new $ce({props:a}),De.push(()=>tt(e,"mde",i)),{c(){O(e.$$.fragment)},m(o,l){B(e,o,l),r=!0},p(o,l){const s={};l&2&&(s.height=o[1]),l&8&&(s.id=o[3]),l&16&&(s.fullScreenOffset=o[4]),l&32&&(s.disabled=o[5]),l&69&&(s.easyMDEOptions={initialValue:o[0],placeholder:o[2],...o[6]}),!t&&l&128&&(t=!0,s.mde=o[7],rt(()=>t=!1)),e.$set(s)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){$(e.$$.fragment,o),r=!1},d(o){H(e,o)}}}function wce(n){let e=n[1],t,r,i=$E(n);return{c(){i.c(),t=yt()},m(a,o){i.m(a,o),C(a,t,o),r=!0},p(a,[o]){o&2&&Ie(e,e=a[1])?(we(),$(i,1,1,ht),ke(),i=$E(a),i.c(),b(i,1),i.m(t.parentNode,t)):i.p(a,o)},i(a){r||(b(i),r=!0)},o(a){$(i),r=!1},d(a){a&&M(t),i.d(a)}}}function kce(n,e,t){let{value:r=null}=e,{height:i=null}=e,{placeholder:a=null}=e,{id:o=null}=e,{fullScreenOffset:l=0}=e,{disabled:s=!1}=e,{easyMDEOptions:u}=e;const c=Nn();let f,h;const m=S=>{h&&S!==f&&h.value(S)},w=((S,T)=>{let I;return()=>{clearTimeout(I),I=setTimeout(S,T)}})(()=>{f=h.value(),c("change",f)},250);function A(S){h=S,t(7,h)}return n.$$set=S=>{"value"in S&&t(0,r=S.value),"height"in S&&t(1,i=S.height),"placeholder"in S&&t(2,a=S.placeholder),"id"in S&&t(3,o=S.id),"fullScreenOffset"in S&&t(4,l=S.fullScreenOffset),"disabled"in S&&t(5,s=S.disabled),"easyMDEOptions"in S&&t(6,u=S.easyMDEOptions)},n.$$.update=()=>{n.$$.dirty&1&&m(r),n.$$.dirty&128&&(h==null||h.codemirror.on("change",w))},[r,i,a,o,l,s,u,h,A]}class zce extends Ve{constructor(e){super(),Pe(this,e,kce,wce,Ie,{value:0,height:1,placeholder:2,id:3,fullScreenOffset:4,disabled:5,easyMDEOptions:6})}}function Ace(n){let e,t,r;return t=new zce({props:{value:n[0],placeholder:n[1],height:n[4],id:n[5],fullScreenOffset:n[6],disabled:n[2],easyMDEOptions:n[7]}}),t.$on("change",n[8]),{c(){e=X("div"),O(t.$$.fragment),D(e,"class","svelte-rs8sig"),Te(e,"error",n[3])},m(i,a){C(i,e,a),B(t,e,null),r=!0},p(i,[a]){const o={};a&1&&(o.value=i[0]),a&2&&(o.placeholder=i[1]),a&16&&(o.height=i[4]),a&32&&(o.id=i[5]),a&64&&(o.fullScreenOffset=i[6]),a&4&&(o.disabled=i[2]),a&128&&(o.easyMDEOptions=i[7]),t.$set(o),a&8&&Te(e,"error",i[3])},i(i){r||(b(t.$$.fragment,i),r=!0)},o(i){$(t.$$.fragment,i),r=!1},d(i){i&&M(e),H(t)}}}function Mce(n,e,t){let{value:r=""}=e,{placeholder:i=null}=e,{disabled:a=!1}=e,{error:o=null}=e,{height:l=null}=e,{id:s=null}=e,{fullScreenOffset:u=null}=e,{easyMDEOptions:c=null}=e;function f(h){Hn.call(this,n,h)}return n.$$set=h=>{"value"in h&&t(0,r=h.value),"placeholder"in h&&t(1,i=h.placeholder),"disabled"in h&&t(2,a=h.disabled),"error"in h&&t(3,o=h.error),"height"in h&&t(4,l=h.height),"id"in h&&t(5,s=h.id),"fullScreenOffset"in h&&t(6,u=h.fullScreenOffset),"easyMDEOptions"in h&&t(7,c=h.easyMDEOptions)},[r,i,a,o,l,s,u,c,f]}class Cce extends Ve{constructor(e){super(),Pe(this,e,Mce,Ace,Ie,{value:0,placeholder:1,disabled:2,error:3,height:4,id:5,fullScreenOffset:6,easyMDEOptions:7})}}function Sce(n){let e,t;return e=new Cce({props:{error:n[5],disabled:n[4],value:n[0],placeholder:n[3],height:n[6],id:n[7],fullScreenOffset:n[8],easyMDEOptions:n[9]}}),e.$on("change",n[10]),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&32&&(a.error=r[5]),i&16&&(a.disabled=r[4]),i&1&&(a.value=r[0]),i&8&&(a.placeholder=r[3]),i&64&&(a.height=r[6]),i&128&&(a.id=r[7]),i&256&&(a.fullScreenOffset=r[8]),i&512&&(a.easyMDEOptions=r[9]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Lce(n){let e,t;return e=new Sc({props:{label:n[1],labelPosition:n[2],error:n[5],$$slots:{default:[Sce]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,[i]){const a={};i&2&&(a.label=r[1]),i&4&&(a.labelPosition=r[2]),i&32&&(a.error=r[5]),i&5113&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Ece(n,e,t){let{value:r=null}=e,{label:i=null}=e,{labelPosition:a="above"}=e,{placeholder:o=null}=e,{disabled:l=!1}=e,{error:s=null}=e,{height:u=null}=e,{id:c=null}=e,{fullScreenOffset:f=null}=e,{easyMDEOptions:h=null}=e;const m=Nn(),_=y=>{t(0,r=y.detail),m("change",y.detail)};return n.$$set=y=>{"value"in y&&t(0,r=y.value),"label"in y&&t(1,i=y.label),"labelPosition"in y&&t(2,a=y.labelPosition),"placeholder"in y&&t(3,o=y.placeholder),"disabled"in y&&t(4,l=y.disabled),"error"in y&&t(5,s=y.error),"height"in y&&t(6,u=y.height),"id"in y&&t(7,c=y.id),"fullScreenOffset"in y&&t(8,f=y.fullScreenOffset),"easyMDEOptions"in y&&t(9,h=y.easyMDEOptions)},[r,i,a,o,l,s,u,c,f,h,_]}class Tce extends Ve{constructor(e){super(),Pe(this,e,Ece,Lce,Ie,{value:0,label:1,labelPosition:2,placeholder:3,disabled:4,error:5,height:6,id:7,fullScreenOffset:8,easyMDEOptions:9})}}function wE(n){let e,t,r;return t=new Vu({props:{$$slots:{default:[Dce]},$$scope:{ctx:n}}}),{c(){e=X("div"),O(t.$$.fragment),D(e,"class","title svelte-glsrm")},m(i,a){C(i,e,a),B(t,e,null),r=!0},p(i,a){const o={};a&5&&(o.$$scope={dirty:a,ctx:i}),t.$set(o)},i(i){r||(b(t.$$.fragment,i),r=!0)},o(i){$(t.$$.fragment,i),r=!1},d(i){i&&M(e),H(t)}}}function Dce(n){let e;return{c(){e=oe(n[0])},m(t,r){C(t,e,r)},p(t,r){r&1&>(e,t[0])},d(t){t&&M(e)}}}function Bce(n){let e,t,r,i,a=n[0]&&wE(n);const o=n[1].default,l=Xn(o,n,n[2],null);return{c(){e=X("div"),a&&a.c(),t=q(),r=X("div"),l&&l.c(),D(r,"class","list-items svelte-glsrm")},m(s,u){C(s,e,u),a&&a.m(e,null),x(e,t),x(e,r),l&&l.m(r,null),i=!0},p(s,[u]){s[0]?a?(a.p(s,u),u&1&&b(a,1)):(a=wE(s),a.c(),b(a,1),a.m(e,t)):a&&(we(),$(a,1,1,()=>{a=null}),ke()),l&&l.p&&(!i||u&4)&&Zn(l,o,s,s[2],i?Jn(o,s[2],u,null):Qn(s[2]),null)},i(s){i||(b(a),b(l,s),i=!0)},o(s){$(a),$(l,s),i=!1},d(s){s&&M(e),a&&a.d(),l&&l.d(s)}}}function Hce(n,e,t){let{$$slots:r={},$$scope:i}=e,{title:a=null}=e;return n.$$set=o=>{"title"in o&&t(0,a=o.title),"$$scope"in o&&t(2,i=o.$$scope)},[a,r,i]}class E6 extends Ve{constructor(e){super(),Pe(this,e,Hce,Bce,Ie,{title:0})}}function kE(n){let e,t;return e=new Jw({props:{icon:n[0],color:n[2],background:n[1]}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&1&&(a.icon=r[0]),i&4&&(a.color=r[2]),i&2&&(a.background=r[1]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function zE(n){let e,t;return e=new Fd({props:{initials:n[7]}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&128&&(a.initials=r[7]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function AE(n){let e,t;return e=new jt({props:{$$slots:{default:[Oce]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&1040&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Oce(n){let e;return{c(){e=oe(n[4])},m(t,r){C(t,e,r)},p(t,r){r&16&>(e,t[4])},d(t){t&&M(e)}}}function ME(n){let e,t;return e=new sn({props:{$$slots:{default:[Ice]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&1056&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Ice(n){let e;return{c(){e=oe(n[5])},m(t,r){C(t,e,r)},p(t,r){r&32&>(e,t[5])},d(t){t&&M(e)}}}function Pce(n){let e,t,r,i,a,o,l,s,u,c,f=n[0]&&kE(n),h=n[3]&&zE(n),m=n[4]&&AE(n),_=n[5]&&ME(n);const y=n[8].default,w=Xn(y,n,n[10],null);return{c(){e=X("div"),t=X("div"),f&&f.c(),r=q(),h&&h.c(),i=q(),m&&m.c(),a=q(),_&&_.c(),o=q(),l=X("div"),w&&w.c(),D(t,"class","left svelte-15u15t4"),D(l,"class","right svelte-15u15t4"),D(e,"class","list-item svelte-15u15t4"),Te(e,"hoverable",n[6])},m(A,S){C(A,e,S),x(e,t),f&&f.m(t,null),x(t,r),h&&h.m(t,null),x(t,i),m&&m.m(t,null),x(t,a),_&&_.m(t,null),x(e,o),x(e,l),w&&w.m(l,null),s=!0,u||(c=At(e,"click",n[9]),u=!0)},p(A,[S]){A[0]?f?(f.p(A,S),S&1&&b(f,1)):(f=kE(A),f.c(),b(f,1),f.m(t,r)):f&&(we(),$(f,1,1,()=>{f=null}),ke()),A[3]?h?(h.p(A,S),S&8&&b(h,1)):(h=zE(A),h.c(),b(h,1),h.m(t,i)):h&&(we(),$(h,1,1,()=>{h=null}),ke()),A[4]?m?(m.p(A,S),S&16&&b(m,1)):(m=AE(A),m.c(),b(m,1),m.m(t,a)):m&&(we(),$(m,1,1,()=>{m=null}),ke()),A[5]?_?(_.p(A,S),S&32&&b(_,1)):(_=ME(A),_.c(),b(_,1),_.m(t,null)):_&&(we(),$(_,1,1,()=>{_=null}),ke()),w&&w.p&&(!s||S&1024)&&Zn(w,y,A,A[10],s?Jn(y,A[10],S,null):Qn(A[10]),null),S&64&&Te(e,"hoverable",A[6])},i(A){s||(b(f),b(h),b(m),b(_),b(w,A),s=!0)},o(A){$(f),$(h),$(m),$(_),$(w,A),s=!1},d(A){A&&M(e),f&&f.d(),h&&h.d(),m&&m.d(),_&&_.d(),w&&w.d(A),u=!1,c()}}}function Vce(n,e,t){let r,{$$slots:i={},$$scope:a}=e,{icon:o=null}=e,{iconBackground:l=null}=e,{iconColor:s=null}=e,{avatar:u=!1}=e,{title:c=null}=e,{subtitle:f=null}=e,{hoverable:h=!1}=e;function m(_){Hn.call(this,n,_)}return n.$$set=_=>{"icon"in _&&t(0,o=_.icon),"iconBackground"in _&&t(1,l=_.iconBackground),"iconColor"in _&&t(2,s=_.iconColor),"avatar"in _&&t(3,u=_.avatar),"title"in _&&t(4,c=_.title),"subtitle"in _&&t(5,f=_.subtitle),"hoverable"in _&&t(6,h=_.hoverable),"$$scope"in _&&t(10,a=_.$$scope)},n.$$.update=()=>{n.$$.dirty&24&&t(7,r=u?c==null?void 0:c[0]:null)},[o,l,s,u,c,f,h,r,i,m,a]}class E4 extends Ve{constructor(e){super(),Pe(this,e,Vce,Pce,Ie,{icon:0,iconBackground:1,iconColor:2,avatar:3,title:4,subtitle:5,hoverable:6})}}function Rce(n){let e,t;const r=n[1].default,i=Xn(r,n,n[0],null);return{c(){e=X("div"),i&&i.c(),D(e,"class","icon-side-nav svelte-krsn3q")},m(a,o){C(a,e,o),i&&i.m(e,null),t=!0},p(a,[o]){i&&i.p&&(!t||o&1)&&Zn(i,r,a,a[0],t?Jn(r,a[0],o,null):Qn(a[0]),null)},i(a){t||(b(i,a),t=!0)},o(a){$(i,a),t=!1},d(a){a&&M(e),i&&i.d(a)}}}function Nce(n,e,t){let{$$slots:r={},$$scope:i}=e;return n.$$set=a=>{"$$scope"in a&&t(0,i=a.$$scope)},[i,r]}class Fce extends Ve{constructor(e){super(),Pe(this,e,Nce,Rce,Ie,{})}}function CE(n){let e,t,r,i;return t=new z6({props:{textWrapping:!0,direction:"right",text:n[2]}}),{c(){e=X("div"),O(t.$$.fragment),D(e,"class","tooltip svelte-12yq719")},m(a,o){C(a,e,o),B(t,e,null),i=!0},p(a,o){const l={};o&4&&(l.text=a[2]),t.$set(l)},i(a){i||(b(t.$$.fragment,a),r||Po(()=>{r=Sd(e,ip,{duration:130,delay:250}),r.start()}),i=!0)},o(a){$(t.$$.fragment,a),i=!1},d(a){a&&M(e),H(t)}}}function jce(n){let e,t,r,i,a,o;t=new un({props:{name:n[0],hoverable:!0}});let l=n[2]&&n[3]&&CE(n);return{c(){e=X("div"),O(t.$$.fragment),r=q(),l&&l.c(),D(e,"class","icon-side-nav-item svelte-12yq719"),Te(e,"active",n[1])},m(s,u){C(s,e,u),B(t,e,null),x(e,r),l&&l.m(e,null),i=!0,a||(o=[At(e,"mouseover",n[5]),At(e,"focus",n[6]),At(e,"mouseleave",n[7]),At(e,"click",n[4])],a=!0)},p(s,[u]){const c={};u&1&&(c.name=s[0]),t.$set(c),s[2]&&s[3]?l?(l.p(s,u),u&12&&b(l,1)):(l=CE(s),l.c(),b(l,1),l.m(e,null)):l&&(we(),$(l,1,1,()=>{l=null}),ke()),u&2&&Te(e,"active",s[1])},i(s){i||(b(t.$$.fragment,s),b(l),i=!0)},o(s){$(t.$$.fragment,s),$(l),i=!1},d(s){s&&M(e),H(t),l&&l.d(),a=!1,Vi(o)}}}function xce(n,e,t){let{icon:r}=e,{active:i=!1}=e,{tooltip:a}=e,o=!1;function l(f){Hn.call(this,n,f)}const s=()=>t(3,o=!0),u=()=>t(3,o=!0),c=()=>t(3,o=!1);return n.$$set=f=>{"icon"in f&&t(0,r=f.icon),"active"in f&&t(1,i=f.active),"tooltip"in f&&t(2,a=f.tooltip)},[r,i,a,o,l,s,u,c]}class hg extends Ve{constructor(e){super(),Pe(this,e,xce,jce,Ie,{icon:0,active:1,tooltip:2})}}function Uce(n){let e,t,r,i;return{c(){e=X("div"),t=X("input"),D(t,"type","range"),D(t,"min",n[3]),D(t,"max",n[4]),D(t,"step",n[5]),t.value=n[0],t.disabled=n[2],D(t,"id",n[1]),D(t,"class","svelte-13v9q49"),D(e,"class","svelte-13v9q49")},m(a,o){C(a,e,o),x(e,t),r||(i=At(t,"change",n[6]),r=!0)},p(a,[o]){o&8&&D(t,"min",a[3]),o&16&&D(t,"max",a[4]),o&32&&D(t,"step",a[5]),o&1&&(t.value=a[0]),o&4&&(t.disabled=a[2]),o&2&&D(t,"id",a[1])},i:ht,o:ht,d(a){a&&M(e),r=!1,i()}}}function qce(n,e,t){let{value:r=!1}=e,{id:i=null}=e,{disabled:a=!1}=e,{min:o=0}=e,{max:l=100}=e,{step:s=1}=e;const u=Nn(),c=f=>{u("change",f.target.value)};return n.$$set=f=>{"value"in f&&t(0,r=f.value),"id"in f&&t(1,i=f.id),"disabled"in f&&t(2,a=f.disabled),"min"in f&&t(3,o=f.min),"max"in f&&t(4,l=f.max),"step"in f&&t(5,s=f.step)},[r,i,a,o,l,s,c]}class Wce extends Ve{constructor(e){super(),Pe(this,e,qce,Uce,Ie,{value:0,id:1,disabled:2,min:3,max:4,step:5})}}function Gce(n){let e,t;return e=new Wce({props:{disabled:n[6],value:n[0],min:n[3],max:n[4],step:n[5]}}),e.$on("change",n[8]),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&64&&(a.disabled=r[6]),i&1&&(a.value=r[0]),i&8&&(a.min=r[3]),i&16&&(a.max=r[4]),i&32&&(a.step=r[5]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Yce(n){let e,t;return e=new Sc({props:{label:n[1],labelPosition:n[2],error:n[7],$$slots:{default:[Gce]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,[i]){const a={};i&2&&(a.label=r[1]),i&4&&(a.labelPosition=r[2]),i&128&&(a.error=r[7]),i&1145&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Kce(n,e,t){let{value:r=null}=e,{label:i=null}=e,{labelPosition:a="above"}=e,{min:o=0}=e,{max:l=100}=e,{step:s=1}=e,{disabled:u=!1}=e,{error:c=null}=e;const f=Nn(),h=m=>{t(0,r=m.detail),f("change",m.detail)};return n.$$set=m=>{"value"in m&&t(0,r=m.value),"label"in m&&t(1,i=m.label),"labelPosition"in m&&t(2,a=m.labelPosition),"min"in m&&t(3,o=m.min),"max"in m&&t(4,l=m.max),"step"in m&&t(5,s=m.step),"disabled"in m&&t(6,u=m.disabled),"error"in m&&t(7,c=m.error)},[r,i,a,o,l,s,u,c,h]}class Xce extends Ve{constructor(e){super(),Pe(this,e,Kce,Yce,Ie,{value:0,label:1,labelPosition:2,min:3,max:4,step:5,disabled:6,error:7})}}function Jce(n){let e,t;return{c(){e=X("div"),t=oe(n[0]),D(e,"class","bold svelte-9amtlb")},m(r,i){C(r,e,i),x(e,t)},p(r,[i]){i&1&>(t,r[0])},i:ht,o:ht,d(r){r&&M(e)}}}function Zce(n,e,t){let{value:r}=e;return n.$$set=i=>{"value"in i&&t(0,r=i.value)},[r]}class Qce extends Ve{constructor(e){super(),Pe(this,e,Zce,Jce,Ie,{value:0})}}function e2e(n){let e,t;return{c(){e=X("code"),t=oe(n[0]),D(e,"class","svelte-e82i3")},m(r,i){C(r,e,i),x(e,t)},p(r,[i]){i&1&>(t,r[0])},i:ht,o:ht,d(r){r&&M(e)}}}function t2e(n,e,t){let{value:r}=e;return n.$$set=i=>{"value"in i&&t(0,r=i.value)},[r]}class n2e extends Ve{constructor(e){super(),Pe(this,e,t2e,e2e,Ie,{value:0})}}const Qf={Equals:{value:"equal",label:"Equals"},NotEquals:{value:"notEqual",label:"Not equals"},Empty:{value:"empty",label:"Is empty"},NotEmpty:{value:"notEmpty",label:"Is not empty"},StartsWith:{value:"string",label:"Starts with"},Like:{value:"fuzzy",label:"Like"},MoreThan:{value:"rangeLow",label:"More than"},LessThan:{value:"rangeHigh",label:"Less than"},Contains:{value:"contains",label:"Contains"},NotContains:{value:"notContains",label:"Does not contain"},In:{value:"oneOf",label:"Is in"},ContainsAny:{value:"containsAny",label:"Has any"}},Bh={Auth:"budibase:auth",CurrentApp:"budibase:currentapp",ReturnUrl:"budibase:returnurl",AccountReturnUrl:"budibase:account:returnurl"},EG={USERS:"ta_users"},u5={AppUser:"appUser",Developer:"developer",Admin:"admin"},R_=[{label:"App User",value:u5.AppUser},{label:"Developer",value:u5.Developer},{label:"Admin",value:u5.Admin}],TG=[{value:u5.AppUser,icon:"User",label:"App user - Only has access to published apps"},{value:u5.Developer,icon:"Hammer",label:"Developer - Access to the app builder"},{value:u5.Admin,icon:"Draw",label:"Admin - Full access"}],w4={FREE:"free",TEAM:"team",PRO:"pro",BUSINESS:"business",ENTERPRISE:"enterprise"},DG="1",P$={USER_GROUPS:"userGroups",BACKUPS:"appBackups"},W2={ADMIN:"ADMIN",POWER:"POWER",BASIC:"BASIC",PUBLIC:"PUBLIC",BUILDER:"BUILDER"},V$={integer:{max:2147483647,min:-2147483648},int:{max:2147483647,min:-2147483648},smallint:{max:32767,min:-32768},mediumint:{max:8388607,min:-8388608}},n6=[{class:"lightest",name:"Lightest"},{class:"light",name:"Light"},{class:"dark",name:"Dark"},{class:"darkest",name:"Darkest"},{class:"nord",name:"Nord",base:"darkest"},{class:"midnight",name:"Midnight",base:"darkest"}],r2e=Object.freeze(Object.defineProperty({__proto__:null,OperatorOptions:Qf,Cookies:Bh,TableNames:EG,BudibaseRoles:u5,BudibaseRoleOptions:R_,BuilderRoleDescriptions:TG,PlanType:w4,ApiVersion:DG,Features:P$,Roles:W2,SqlNumberTypeRangeMap:V$,Themes:n6},Symbol.toStringTag,{value:"Module"})),i2e=n=>({getAnalyticsStatus:async()=>await n.get({url:"/api/bbtel"}),analyticsPing:async({source:e})=>{const t=Intl.DateTimeFormat().resolvedOptions().timeZone;return await n.post({url:"/api/bbtel/ping",body:{source:e,timezone:t}})}}),a2e=n=>({fetchAppPackage:async e=>await n.get({url:`/api/applications/${e}/appPackage`}),saveAppMetadata:async({appId:e,metadata:t})=>await n.put({url:`/api/applications/${e}`,body:t}),deployAppChanges:async()=>await n.post({url:"/api/deploy"}),revertAppChanges:async e=>await n.post({url:`/api/dev/${e}/revert`}),updateAppClientVersion:async e=>await n.post({url:`/api/applications/${e}/client/update`}),revertAppClientVersion:async e=>await n.post({url:`/api/applications/${e}/client/revert`}),getAppDeployments:async()=>await n.get({url:"/api/deployments"}),createApp:async e=>await n.post({url:"/api/applications",body:e,json:!1}),importApps:async e=>await n.post({url:"/api/cloud/import",body:e,json:!1}),unpublishApp:async e=>await n.delete({url:`/api/applications/${e}?unpublish=1`}),deleteApp:async e=>await n.delete({url:`/api/applications/${e}`}),releaseAppLock:async e=>await n.delete({url:`/api/dev/${e}/lock`}),syncApp:async e=>await n.post({url:`/api/applications/${e}/sync`}),getApps:async()=>await n.get({url:"/api/applications?status=all"}),fetchComponentLibDefinitions:async e=>await n.get({url:`/api/${e}/components/definitions`})}),o2e=n=>{const e=async({datasourceId:t,bucket:r,key:i})=>await n.post({url:`/api/attachments/${t}/url`,body:{bucket:r,key:i}});return{getSignedDatasourceURL:e,uploadAttachment:async({data:t,tableId:r})=>await n.post({url:`/api/attachments/${r}/upload`,body:t,json:!1}),uploadBuilderAttachment:async t=>await n.post({url:"/api/attachments/process",body:t,json:!1}),externalUpload:async({datasourceId:t,bucket:r,key:i,data:a})=>{const{signedUrl:o,publicUrl:l}=await e({datasourceId:t,bucket:r,key:i});return await n.put({url:o,body:a,json:!1,external:!0}),{publicUrl:l}},deleteAttachments:async({keys:t,tableId:r})=>await n.post({url:`/api/attachments/${r}/delete`,body:{keys:t}}),deleteBuilderAttachments:async t=>await n.post({url:"/api/attachments/delete",body:{keys:t}})}},l2e=n=>({logIn:async({tenantId:e,username:t,password:r})=>await n.post({url:`/api/global/auth/${e}/login`,body:{username:t,password:r}}),logOut:async()=>await n.post({url:"/api/global/auth/logout"}),setInitInfo:async e=>await n.post({url:"/api/global/auth/init",body:e}),getInitInfo:async()=>await n.get({url:"/api/global/auth/init"}),requestForgotPassword:async({tenantId:e,email:t})=>await n.post({url:`/api/global/auth/${e}/reset`,body:{email:t}}),resetPassword:async({tenantId:e,password:t,resetCode:r})=>await n.post({url:`/api/global/auth/${e}/reset/update`,body:{password:t,resetCode:r}})}),s2e=n=>({triggerAutomation:async({automationId:e,fields:t})=>await n.post({url:`/api/automations/${e}/trigger`,body:{fields:t}}),testAutomation:async({automationId:e,testData:t})=>await n.post({url:`/api/automations/${e}/test`,body:t}),getAutomations:async()=>await n.get({url:"/api/automations"}),getAutomationDefinitions:async()=>await n.get({url:"/api/automations/definitions/list"}),createAutomation:async e=>await n.post({url:"/api/automations",body:e}),updateAutomation:async e=>await n.put({url:"/api/automations",body:e}),deleteAutomation:async({automationId:e,automationRev:t})=>await n.delete({url:`/api/automations/${e}/${t}`}),getAutomationLogs:async({automationId:e,startDate:t,status:r,page:i})=>await n.post({url:"/api/automations/logs/search",body:{automationId:e,startDate:t,status:r,page:i}}),clearAutomationLogErrors:async({automationId:e,appId:t})=>await n.delete({url:"/api/automations/logs",body:{appId:t,automationId:e}})}),u2e=n=>({saveConfig:async e=>await n.post({url:"/api/global/configs",body:e}),getConfig:async e=>await n.get({url:`/api/global/configs/${e}`}),deleteConfig:async({id:e,rev:t})=>await n.delete({url:`/api/global/configs/${e}/${t}`}),getTenantConfig:async e=>await n.get({url:`/api/global/configs/public?tenantId=${e}`}),getOIDCConfig:async e=>await n.get({url:`/api/global/configs/public/oidc?tenantId=${e}`}),getChecklist:async e=>await n.get({url:`/api/global/configs/checklist?tenantId=${e}`}),uploadLogo:async e=>await n.post({url:"/api/global/configs/upload/settings/logoUrl",body:e,json:!1}),uploadOIDCLogo:async({name:e,data:t})=>await n.post({url:`/api/global/configs/upload/logos_oidc/${e}`,body:t,json:!1}),getOIDCLogos:async()=>await n.get({url:"/api/global/configs/logos_oidc"})}),c2e=n=>({getDatasources:async()=>await n.get({url:"/api/datasources"}),buildDatasourceSchema:async({datasourceId:e,tablesFilter:t})=>await n.post({url:`/api/datasources/${e}/schema`,body:{tablesFilter:t}}),createDatasource:async({datasource:e,fetchSchema:t})=>await n.post({url:"/api/datasources",body:{datasource:e,fetchSchema:t}}),updateDatasource:async e=>await n.put({url:`/api/datasources/${e._id}`,body:e}),deleteDatasource:async({datasourceId:e,datasourceRev:t})=>await n.delete({url:`/api/datasources/${e}/${t}`})}),f2e=n=>({getFlags:async()=>await n.get({url:"/api/users/flags"}),updateFlag:async({flag:e,value:t})=>await n.post({url:"/api/users/flags",body:{flag:e,value:t}}),toggleUiFeature:async({value:e})=>await n.post({url:`/api/beta/${e}`})}),p2e=n=>({getHostingURLs:async()=>await n.get({url:"/api/hosting/urls"}),getDeployedApps:async()=>await n.get({url:"/api/hosting/apps"})}),d2e=n=>({saveLayout:async e=>await n.post({url:"/api/layouts",body:e}),deleteLayout:async({layoutId:e,layoutRev:t})=>await n.delete({url:`/api/layouts/${e}/${t}`})}),h2e=n=>({checkImportComplete:async()=>await n.get({url:"/api/cloud/import/complete"}),getEnvironment:async()=>await n.get({url:"/api/system/environment"}),getSystemStatus:async()=>await n.get({url:"/api/system/status"}),getIntegrations:async()=>await n.get({url:"/api/integrations"}),getBudibaseVersion:async()=>(await n.get({url:"/api/dev/version"})).version,getBasePermissions:async()=>await n.get({url:"/api/permission/builtin"}),checkBetaAccess:async e=>await n.get({url:`/api/beta/access?email=${e}`,external:!0})}),m2e=n=>({getPermissionForResource:async e=>await n.get({url:`/api/permission/${e}`}),updatePermissionForResource:async({resourceId:e,roleId:t,level:r})=>await n.post({url:`/api/permission/${t}/${e}/${r}`})}),g2e=n=>({executeQuery:async({queryId:e,pagination:t,parameters:r})=>await n.post({url:`/api/v2/queries/${e}`,body:{parameters:r,pagination:t}}),fetchQueryDefinition:async e=>await n.get({url:`/api/queries/${e}`,cache:!0}),getQueries:async()=>await n.get({url:"/api/queries"}),saveQuery:async e=>await n.post({url:"/api/queries",body:e}),deleteQuery:async({queryId:e,queryRev:t})=>await n.delete({url:`/api/queries/${e}/${t}`}),importQueries:async({datasourceId:e,data:t})=>await n.post({url:"/api/queries/import",body:{datasourceId:e,data:t}}),previewQuery:async e=>await n.post({url:"/api/queries/preview",body:e})}),v2e=n=>({fetchRelationshipData:async({tableId:e,rowId:t,fieldName:r})=>{if(!e||!t)return[];const i=await n.get({url:`/api/${e}/${t}/enrich`});return r?i[r]||[]:i||[]}}),_2e=n=>({deleteRole:async({roleId:e,roleRev:t})=>await n.delete({url:`/api/roles/${e}/${t}`}),saveRole:async e=>await n.post({url:"/api/roles",body:e}),getRoles:async()=>await n.get({url:"/api/roles"}),getRolesForApp:async e=>await n.get({url:`/api/global/roles/${e}`})}),b2e=n=>({fetchClientAppRoutes:async()=>await n.get({url:"/api/routing/client"}),fetchAppRoutes:async()=>await n.get({url:"/api/routing"})}),y2e=n=>({fetchRow:async({tableId:e,rowId:t})=>!e||!t?null:await n.get({url:`/api/${e}/rows/${t}`}),saveRow:async e=>{if(!!(e!=null&&e.tableId))return await n.post({url:`/api/${e.tableId}/rows`,body:e})},deleteRow:async({tableId:e,rowId:t,revId:r})=>{if(!(!e||!t))return await n.delete({url:`/api/${e}/rows`,body:{_id:t,_rev:r}})},deleteRows:async({tableId:e,rows:t})=>await n.delete({url:`/api/${e}/rows`,body:{rows:t}}),exportRows:async({tableId:e,rows:t,format:r,columns:i})=>await n.post({url:`/api/${e}/rows/exportRows?format=${r}`,body:{rows:t,columns:i},parseResponse:async a=>await a.text()})}),$2e=n=>({saveScreen:async e=>await n.post({url:"/api/screens",body:e}),deleteScreen:async({screenId:e,screenRev:t})=>await n.delete({url:`/api/screens/${e}/${t}`})}),w2e=n=>({fetchTableDefinition:async e=>await n.get({url:`/api/tables/${e}`,cache:!0}),fetchTableData:async e=>await n.get({url:`/api/${e}/rows`}),searchTable:async({tableId:e,query:t,bookmark:r,limit:i,sort:a,sortOrder:o,sortType:l,paginate:s})=>!e||!t?{rows:[]}:await n.post({url:`/api/${e}/search`,body:{query:t,bookmark:r,limit:i,sort:a,sortOrder:o,sortType:l,paginate:s}}),importTableData:async({tableId:e,data:t})=>await n.post({url:`/api/tables/${e}/import`,body:{dataImport:t}}),validateTableCSV:async({tableId:e,csvString:t,schema:r})=>await n.post({url:"/api/tables/csv/validate",body:{csvString:t,schema:r,tableId:e}}),getTables:async()=>await n.get({url:"/api/tables"}),saveTable:async e=>await n.post({url:"/api/tables",body:e}),deleteTable:async({tableId:e,tableRev:t})=>await n.delete({url:`/api/tables/${e}/${t}`})}),k2e=n=>({getEmailTemplateDefinitions:async()=>await n.get({url:"/api/global/template/definitions"}),getEmailTemplates:async()=>await n.get({url:"/api/global/template/email"}),saveEmailTemplate:async e=>await n.post({url:"/api/global/template",body:e}),getAppTemplates:async()=>await n.get({url:"/api/templates"})}),z2e=n=>({getUsers:async()=>await n.get({url:"/api/global/users"}),searchUsers:async({page:e,email:t,appId:r}={})=>{const i={};return e&&(i.page=e),t&&(i.email=t),r&&(i.appId=r),await n.post({url:"/api/global/users/search",body:i})},getUser:async e=>await n.get({url:`/api/global/users/${e}`}),createAppUser:async e=>await n.post({url:"/api/users/metadata",body:e}),updateOwnMetadata:async e=>await n.post({url:"/api/users/metadata/self",body:e}),createAdminUser:async e=>await n.post({url:"/api/global/users/init",body:e}),saveUser:async e=>await n.post({url:"/api/global/users",body:e}),createUsers:async({users:e,groups:t})=>(await n.post({url:"/api/global/users/bulk",body:{create:{users:e,groups:t}}})).created,deleteUser:async e=>await n.delete({url:`/api/global/users/${e}`}),deleteUsers:async e=>(await n.post({url:"/api/global/users/bulk",body:{delete:{userIds:e}}})).deleted,inviteUser:async({email:e,builder:t,admin:r})=>await n.post({url:"/api/global/users/invite",body:{email:e,userInfo:{admin:r?{global:!0}:void 0,builder:t?{global:!0}:void 0}}}),inviteUsers:async e=>await n.post({url:"/api/global/users/multi/invite",body:e.map(t=>({email:t.email,userInfo:{admin:t.admin?{global:!0}:void 0,builder:t.admin||t.builder?{global:!0}:void 0,groups:t.groups}}))}),acceptInvite:async({inviteCode:e,password:t})=>await n.post({url:"/api/global/users/invite/accept",body:{inviteCode:e,password:t}}),getUserCountByApp:async({appId:e})=>await n.get({url:`/api/global/users/count/${e}`})}),A2e=n=>({generateAPIKey:async()=>{const e=await n.post({url:"/api/global/self/api_key"});return e==null?void 0:e.apiKey},fetchDeveloperInfo:async()=>n.get({url:"/api/global/self/api_key"}),fetchSelf:async()=>await n.get({url:"/api/self"}),fetchBuilderSelf:async()=>await n.get({url:"/api/global/self"}),updateSelf:async e=>await n.post({url:"/api/global/self",body:e})}),M2e=n=>({fetchViewData:async({name:e,field:t,groupBy:r,calculation:i})=>{const a=new URLSearchParams;i&&(a.set("field",t),a.set("calculation",i)),r&&a.set("group",r);const o=t?`/api/views/${e}?${a}`:`/api/views/${e}`;return await n.get({url:o})},exportView:async({viewName:e,format:t})=>{const r=encodeURIComponent(e);return await n.get({url:`/api/views/export?view=${r}&format=${t}`,parseResponse:async i=>await i.text()})},saveView:async e=>await n.post({url:"/api/views",body:e}),deleteView:async e=>await n.delete({url:`/api/views/${e}`})}),C2e=n=>({activateLicenseKey:async e=>n.post({url:"/api/global/license/activate",body:e}),deleteLicenseKey:async()=>n.delete({url:"/api/global/license/info"}),getLicenseInfo:async()=>n.get({url:"/api/global/license/info"}),refreshLicense:async()=>n.post({url:"/api/global/license/refresh"}),getQuotaUsage:async()=>n.get({url:"/api/global/license/usage"})}),S2e=n=>{async function e(t,r,i,a){return Array.isArray(a)||(a=[a]),await n.post({url:`/api/global/groups/${t}/${r}`,body:{[i]:a}})}return{saveGroup:async t=>await n.post({url:"/api/global/groups",body:t}),getGroups:async()=>await n.get({url:"/api/global/groups"}),getGroup:async t=>await n.get({url:`/api/global/groups/${t}`}),deleteGroup:async({id:t,rev:r})=>await n.delete({url:`/api/global/groups/${t}/${r}`}),addUsersToGroup:async(t,r)=>e(t,"users","add",r),removeUsersFromGroup:async(t,r)=>e(t,"users","remove",r),addAppsToGroup:async(t,r)=>e(t,"apps","add",r),removeAppsFromGroup:async(t,r)=>e(t,"apps","remove",r)}},L2e=n=>({uploadPlugin:async e=>await n.post({url:"/api/plugin/upload",body:e,json:!1}),createPlugin:async e=>await n.post({url:"/api/plugin",body:e}),getPlugins:async()=>await n.get({url:"/api/plugin"}),deletePlugin:async e=>await n.delete({url:`/api/plugin/${e}`})}),E2e=n=>({searchBackups:async({appId:e,trigger:t,type:r,page:i,startDate:a,endDate:o})=>{const l={};return i&&(l.page=i),t&&r&&(l.trigger=t.toLowerCase(),l.type=r.toLowerCase()),a&&o&&(l.startDate=a,l.endDate=o),await n.post({url:`/api/apps/${e}/backups/search`,body:l})},createManualBackup:async({appId:e,name:t})=>await n.post({url:`/api/apps/${e}/backups`,body:{name:t}}),deleteBackup:async({appId:e,backupId:t})=>await n.delete({url:`/api/apps/${e}/backups/${t}`}),updateBackup:async({appId:e,backupId:t,name:r})=>await n.patch({url:`/api/apps/${e}/backups/${t}`,body:{name:r}}),restoreBackup:async({appId:e,backupId:t,name:r})=>await n.post({url:`/api/apps/${e}/backups/${t}/import`,body:{name:r}})}),T2e={enableCaching:!1,attachHeaders:null,onError:null},D2e=n=>{n={...T2e,...n};let e={};const t=async(s,u)=>{let c=s.statusText,f=null;try{f=await s.json(),f!=null&&f.message?c=f.message:f!=null&&f.error&&(c=f.error)}catch{}return{message:c,json:f,status:s.status,url:s.url,method:u,handled:!0}},r=(s,u)=>({message:s,json:null,status:400,url:u==null?void 0:u.url,method:u==null?void 0:u.method,handled:!0}),i=async({method:s,url:u,body:c,json:f=!0,external:h=!1,parseResponse:m})=>{f=f&&s!=="GET";let _={Accept:"application/json"};h||(_["x-budibase-api-version"]=DG),f&&(_["Content-Type"]="application/json"),n!=null&&n.attachHeaders&&n.attachHeaders(_);let y=c;if(f)try{y=JSON.stringify(c)}catch{throw r("Invalid JSON body",{url:u,method:s})}let w;try{w=await fetch(u,{method:s,headers:_,body:y,credentials:"same-origin"})}catch{throw delete e[u],r("Failed to send request",{url:u,method:s})}if(w.status>=200&&w.status<400)try{return m?await m(w):await w.json()}catch{return delete e[u],null}else throw delete e[u],await t(w,s)},a=async s=>{const u=s.url;return u?(e[u]||(e[u]=i(s),e[u]=await e[u]),await e[u]):null},o=s=>async u=>{try{let{url:c,cache:f=!1,external:h=!1}=u;h||(c=`/${c}`.replace("//","/"));const _=f&&(n==null?void 0:n.enableCaching)?a:i,y={...u,method:s,url:c};return await _(y)}catch(c){throw n!=null&&n.onError&&n.onError(c),c}};let l={post:o("POST"),get:o("GET"),patch:o("PATCH"),delete:o("DELETE"),put:o("PUT"),error:s=>{throw r(s)},invalidateCache:()=>{e={}}};return{...l,...i2e(l),...a2e(l),...o2e(l),...l2e(l),...s2e(l),...u2e(l),...c2e(l),...f2e(l),...p2e(l),...d2e(l),...h2e(l),...m2e(l),...g2e(l),...v2e(l),..._2e(l),...b2e(l),...y2e(l),...$2e(l),...w2e(l),...k2e(l),...z2e(l),...M2e(l),...A2e(l),...C2e(l),...S2e(l),...L2e(l),...E2e(l)}};var R$={exports:{}};/**
|
|
343
|
+
Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};function Lr(n){n=n||{},n.parent=this;var e=!0;if(n.autoDownloadFontAwesome===!1&&(e=!1),n.autoDownloadFontAwesome!==!0)for(var t=document.styleSheets,r=0;r<t.length;r++)!t[r].href||t[r].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(e=!1);if(e){var i=document.createElement("link");i.rel="stylesheet",i.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(i)}if(n.element)this.element=n.element;else if(n.element===null){console.log("EasyMDE: Error. No element was found.");return}if(n.toolbar===void 0){n.toolbar=[];for(var a in zd)Object.prototype.hasOwnProperty.call(zd,a)&&(a.indexOf("separator-")!=-1&&n.toolbar.push("|"),(zd[a].default===!0||n.showIcons&&n.showIcons.constructor===Array&&n.showIcons.indexOf(a)!=-1)&&n.toolbar.push(a))}if(Object.prototype.hasOwnProperty.call(n,"previewClass")||(n.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(n,"status")||(n.status=["autosave","lines","words","cursor"],n.uploadImage&&n.status.unshift("upload-image")),n.previewRender||(n.previewRender=function(l){return this.parent.markdown(l)}),n.parsingConfig=q5({highlightFormatting:!0},n.parsingConfig||{}),n.insertTexts=q5({},pce,n.insertTexts||{}),n.promptTexts=q5({},dce,n.promptTexts||{}),n.blockStyles=q5({},mce,n.blockStyles||{}),n.autosave!=null&&(n.autosave.timeFormat=q5({},hce,n.autosave.timeFormat||{})),n.shortcuts=q5({},ice,n.shortcuts||{}),n.maxHeight=n.maxHeight||void 0,n.direction=n.direction||"ltr",typeof n.maxHeight<"u"?n.minHeight=n.maxHeight:n.minHeight=n.minHeight||"300px",n.errorCallback=n.errorCallback||function(l){alert(l)},n.uploadImage=n.uploadImage||!1,n.imageMaxSize=n.imageMaxSize||2097152,n.imageAccept=n.imageAccept||"image/png, image/jpeg",n.imageTexts=q5({},gce,n.imageTexts||{}),n.errorMessages=q5({},vce,n.errorMessages||{}),n.autosave!=null&&n.autosave.unique_id!=null&&n.autosave.unique_id!=""&&(n.autosave.uniqueId=n.autosave.unique_id),n.overlayMode&&n.overlayMode.combine===void 0&&(n.overlayMode.combine=!0),this.options=n,this.render(),n.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(n.initialValue),n.uploadImage){var o=this;this.codemirror.on("dragenter",function(l,s){o.updateStatusBar("upload-image",o.options.imageTexts.sbOnDragEnter),s.stopPropagation(),s.preventDefault()}),this.codemirror.on("dragend",function(l,s){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit),s.stopPropagation(),s.preventDefault()}),this.codemirror.on("dragleave",function(l,s){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit),s.stopPropagation(),s.preventDefault()}),this.codemirror.on("dragover",function(l,s){o.updateStatusBar("upload-image",o.options.imageTexts.sbOnDragEnter),s.stopPropagation(),s.preventDefault()}),this.codemirror.on("drop",function(l,s){s.stopPropagation(),s.preventDefault(),n.imageUploadFunction?o.uploadImagesUsingCustomFunction(n.imageUploadFunction,s.dataTransfer.files):o.uploadImages(s.dataTransfer.files)}),this.codemirror.on("paste",function(l,s){n.imageUploadFunction?o.uploadImagesUsingCustomFunction(n.imageUploadFunction,s.clipboardData.files):o.uploadImages(s.clipboardData.files)})}}Lr.prototype.uploadImages=function(n,e,t){if(n.length!==0){for(var r=[],i=0;i<n.length;i++)r.push(n[i].name),this.uploadImage(n[i],e,t);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",r.join(", ")))}};Lr.prototype.uploadImagesUsingCustomFunction=function(n,e){if(e.length!==0){for(var t=[],r=0;r<e.length;r++)t.push(e[r].name),this.uploadImageUsingCustomFunction(n,e[r]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",t.join(", ")))}};Lr.prototype.updateStatusBar=function(n,e){if(!!this.gui.statusbar){var t=this.gui.statusbar.getElementsByClassName(n);t.length===1?this.gui.statusbar.getElementsByClassName(n)[0].textContent=e:t.length===0?console.log("EasyMDE: status bar item "+n+" was not found."):console.log("EasyMDE: Several status bar items named "+n+" was found.")}};Lr.prototype.markdown=function(n){if(ay){var e;if(this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?e=this.options.renderingConfig.markedOptions:e={},this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?e.breaks=!1:e.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var t=this.options.renderingConfig.hljs||window.hljs;t&&(e.highlight=function(i,a){return a&&t.getLanguage(a)?t.highlight(a,i).value:t.highlightAuto(i).value})}ay.setOptions(e);var r=ay.parse(n);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction=="function"&&(r=this.options.renderingConfig.sanitizerFunction.call(this,r)),r=oce(r),r=lce(r),r}};Lr.prototype.render=function(n){if(n||(n=this.element||document.getElementsByTagName("textarea")[0]),this._rendered&&this._rendered===n)return;this.element=n;var e=this.options,t=this,r={};for(var i in e.shortcuts)e.shortcuts[i]!==null&&Qg[i]!==null&&function(w){r[kG(e.shortcuts[w])]=function(){var A=Qg[w];typeof A=="function"?A(t):typeof A=="string"&&window.open(A,"_blank")}}(i);r.Enter="newlineAndIndentContinueMarkdownList",r.Tab="tabAndIndentMarkdownList",r["Shift-Tab"]="shiftTabAndUnindentMarkdownList",r.Esc=function(w){w.getOption("fullScreen")&&Td(t)},this.documentOnKeyDown=function(w){w=w||window.event,w.keyCode==27&&t.codemirror.getOption("fullScreen")&&Td(t)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var a,o;e.overlayMode?(bh.defineMode("overlay-mode",function(w){return bh.overlayMode(bh.getMode(w,e.spellChecker!==!1?"spell-checker":"gfm"),e.overlayMode.mode,e.overlayMode.combine)}),a="overlay-mode",o=e.parsingConfig,o.gitHubSpice=!1):(a=e.parsingConfig,a.name="gfm",a.gitHubSpice=!1),e.spellChecker!==!1&&(a="spell-checker",o=e.parsingConfig,o.name="gfm",o.gitHubSpice=!1,typeof e.spellChecker=="function"?e.spellChecker({codeMirrorInstance:bh}):nce({codeMirrorInstance:bh}));function l(w,A,S){return{addNew:!1}}if(this.codemirror=bh.fromTextArea(n,{mode:a,backdrop:o,theme:e.theme!=null?e.theme:"easymde",tabSize:e.tabSize!=null?e.tabSize:2,indentUnit:e.tabSize!=null?e.tabSize:2,indentWithTabs:e.indentWithTabs!==!1,lineNumbers:e.lineNumbers===!0,autofocus:e.autofocus===!0,extraKeys:r,direction:e.direction,lineWrapping:e.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:e.placeholder||n.getAttribute("placeholder")||"",styleSelectedText:e.styleSelectedText!=null?e.styleSelectedText:!I$(),scrollbarStyle:e.scrollbarStyle!=null?e.scrollbarStyle:"native",configureMouse:l,inputStyle:e.inputStyle!=null?e.inputStyle:I$()?"contenteditable":"textarea",spellcheck:e.nativeSpellcheck!=null?e.nativeSpellcheck:!0,autoRefresh:e.autoRefresh!=null?e.autoRefresh:!1}),this.codemirror.getScrollerElement().style.minHeight=e.minHeight,typeof e.maxHeight<"u"&&(this.codemirror.getScrollerElement().style.height=e.maxHeight),e.forceSync===!0){var s=this.codemirror;s.on("change",function(){s.save()})}this.gui={};var u=document.createElement("div");u.classList.add("EasyMDEContainer");var c=this.codemirror.getWrapperElement();c.parentNode.insertBefore(u,c),u.appendChild(c),e.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),e.status!==!1&&(this.gui.statusbar=this.createStatusbar()),e.autosave!=null&&e.autosave.enabled===!0&&(this.autosave(),this.codemirror.on("change",function(){clearTimeout(t._autosave_timeout),t._autosave_timeout=setTimeout(function(){t.autosave()},t.options.autosave.submit_delay||t.options.autosave.delay||1e3)}));function f(w,A){var S,T=window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","");return w<T?S=A+"px":S=A/w*100+"%",S}var h=this;function m(w,A){w.setAttribute("data-img-src",A.url),w.setAttribute("style","--bg-image:url("+A.url+");--width:"+A.naturalWidth+"px;--height:"+f(A.naturalWidth,A.naturalHeight)),h.codemirror.setSize()}function _(){!e.previewImagesInEditor||u.querySelectorAll(".cm-image-marker").forEach(function(w){var A=w.parentElement;if(!!A.innerText.match(/^!\[.*?\]\(.*\)/g)&&!A.hasAttribute("data-img-src")){var S=A.innerText.match("\\((.*)\\)");if(window.EMDEimagesCache||(window.EMDEimagesCache={}),S&&S.length>=2){var T=S[1];if(window.EMDEimagesCache[T])m(A,window.EMDEimagesCache[T]);else{var I=document.createElement("img");I.onload=function(){window.EMDEimagesCache[T]={naturalWidth:I.naturalWidth,naturalHeight:I.naturalHeight,url:T},m(A,window.EMDEimagesCache[T])},I.src=T}}}})}this.codemirror.on("update",function(){_()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element;var y=this.codemirror;setTimeout(function(){y.refresh()}.bind(y),0)};Lr.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function LG(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}Lr.prototype.autosave=function(){if(LG()){var n=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(n.element.form!=null&&n.element.form!=null&&n.element.form.addEventListener("submit",function(){clearTimeout(n.autosaveTimeoutId),n.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+n.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&localStorage.getItem("smde_"+this.options.autosave.uniqueId)!=""&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var e=n.value();e!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,e):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var t=document.getElementById("autosaved");if(t!=null&&t!=null&&t!=""){var r=new Date,i=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(r),a=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;t.innerHTML=a+i}}else console.log("EasyMDE: localStorage not available, cannot autosave")};Lr.prototype.clearAutosavedValue=function(){if(LG()){if(this.options.autosave==null||this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to clear the autosave value");return}localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")};Lr.prototype.openBrowseFileWindow=function(n,e){var t=this,r=this.gui.toolbar.getElementsByClassName("imageInput")[0];r.click();function i(a){t.options.imageUploadFunction?t.uploadImagesUsingCustomFunction(t.options.imageUploadFunction,a.target.files):t.uploadImages(a.target.files,n,e),r.removeEventListener("change",i)}r.addEventListener("change",i)};Lr.prototype.uploadImage=function(n,e,t){var r=this;e=e||function(u){CG(r,u)};function i(s){r.updateStatusBar("upload-image",s),setTimeout(function(){r.updateStatusBar("upload-image",r.options.imageTexts.sbInit)},1e4),t&&typeof t=="function"&&t(s),r.options.errorCallback(s)}function a(s){var u=r.options.imageTexts.sizeUnits.split(",");return s.replace("#image_name#",n.name).replace("#image_size#",Mv(n.size,u)).replace("#image_max_size#",Mv(r.options.imageMaxSize,u))}if(n.size>this.options.imageMaxSize){i(a(this.options.errorMessages.fileTooLarge));return}var o=new FormData;o.append("image",n),r.options.imageCSRFToken&&o.append("csrfmiddlewaretoken",r.options.imageCSRFToken);var l=new XMLHttpRequest;l.upload.onprogress=function(s){if(s.lengthComputable){var u=""+Math.round(s.loaded*100/s.total);r.updateStatusBar("upload-image",r.options.imageTexts.sbProgress.replace("#file_name#",n.name).replace("#progress#",u))}},l.open("POST",this.options.imageUploadEndpoint),l.onload=function(){try{var s=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),i(a(r.options.errorMessages.importError));return}this.status===200&&s&&!s.error&&s.data&&s.data.filePath?e((r.options.imagePathAbsolute?"":window.location.origin+"/")+s.data.filePath):s.error&&s.error in r.options.errorMessages?i(a(r.options.errorMessages[s.error])):s.error?i(a(s.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),i(a(r.options.errorMessages.importError)))},l.onerror=function(s){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+s.target.status+" ("+s.target.statusText+")"),i(r.options.errorMessages.importError)},l.send(o)};Lr.prototype.uploadImageUsingCustomFunction=function(n,e){var t=this;function r(o){CG(t,o)}function i(o){var l=a(o);t.updateStatusBar("upload-image",l),setTimeout(function(){t.updateStatusBar("upload-image",t.options.imageTexts.sbInit)},1e4),t.options.errorCallback(l)}function a(o){var l=t.options.imageTexts.sizeUnits.split(",");return o.replace("#image_name#",e.name).replace("#image_size#",Mv(e.size,l)).replace("#image_max_size#",Mv(t.options.imageMaxSize,l))}n.apply(this,[e,r,i])};Lr.prototype.setPreviewMaxHeight=function(){var n=this.codemirror,e=n.getWrapperElement(),t=e.nextSibling,r=parseInt(window.getComputedStyle(e).paddingTop),i=parseInt(window.getComputedStyle(e).borderTopWidth),a=parseInt(this.options.maxHeight),o=a+r*2+i*2,l=o.toString()+"px";t.style.height=l};Lr.prototype.createSideBySide=function(){var n=this.codemirror,e=n.getWrapperElement(),t=e.nextSibling;if(!t||!/editor-preview-side/.test(t.className)){if(t=document.createElement("div"),t.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var r=0;r<this.options.previewClass.length;r++)t.className+=" "+this.options.previewClass[r];else typeof this.options.previewClass=="string"&&(t.className+=" "+this.options.previewClass);e.parentNode.insertBefore(t,e.nextSibling)}if(typeof this.options.maxHeight<"u"&&this.setPreviewMaxHeight(),this.options.syncSideBySidePreviewScroll===!1)return t;var i=!1,a=!1;return n.on("scroll",function(o){if(i){i=!1;return}a=!0;var l=o.getScrollInfo().height-o.getScrollInfo().clientHeight,s=parseFloat(o.getScrollInfo().top)/l,u=(t.scrollHeight-t.clientHeight)*s;t.scrollTop=u}),t.onscroll=function(){if(a){a=!1;return}i=!0;var o=t.scrollHeight-t.clientHeight,l=parseFloat(t.scrollTop)/o,s=(n.getScrollInfo().height-n.getScrollInfo().clientHeight)*l;n.scrollTo(0,s)},t};Lr.prototype.createToolbar=function(n){if(n=n||this.options.toolbar,!(!n||n.length===0)){var e;for(e=0;e<n.length;e++)zd[n[e]]!=null&&(n[e]=zd[n[e]]);var t=document.createElement("div");t.className="editor-toolbar";var r=this,i={};for(r.toolbar=n,e=0;e<n.length;e++)if(!(n[e].name=="guide"&&r.options.toolbarGuideIcon===!1)&&!(r.options.hideIcons&&r.options.hideIcons.indexOf(n[e].name)!=-1)&&!((n[e].name=="fullscreen"||n[e].name=="side-by-side")&&I$())){if(n[e]==="|"){for(var a=!1,o=e+1;o<n.length;o++)n[o]!=="|"&&(!r.options.hideIcons||r.options.hideIcons.indexOf(n[o].name)==-1)&&(a=!0);if(!a)continue}(function(u){var c;if(u==="|"?c=uce():u.children?c=sce(u,r.options.toolbarTips,r.options.shortcuts,r):c=x9(u,!0,r.options.toolbarTips,r.options.shortcuts,"button",r),i[u.name||u]=c,t.appendChild(c),u.name==="upload-image"){var f=document.createElement("input");f.className="imageInput",f.type="file",f.multiple=!0,f.name="image",f.accept=r.options.imageAccept,f.style.display="none",f.style.opacity=0,t.appendChild(f)}})(n[e])}r.toolbar_div=t,r.toolbarElements=i;var l=this.codemirror;l.on("cursorActivity",function(){var u=k5(l);for(var c in i)(function(f){var h=i[f];u[f]?h.className+=" active":f!="fullscreen"&&f!="side-by-side"&&(h.className=h.className.replace(/\s*active\s*/g,""))})(c)});var s=l.getWrapperElement();return s.parentNode.insertBefore(t,s),t}};Lr.prototype.createStatusbar=function(n){n=n||this.options.status;var e=this.options,t=this.codemirror;if(!(!n||n.length===0)){var r=[],i,a,o,l;for(i=0;i<n.length;i++)if(a=void 0,o=void 0,l=void 0,typeof n[i]=="object")r.push({className:n[i].className,defaultValue:n[i].defaultValue,onUpdate:n[i].onUpdate,onActivity:n[i].onActivity});else{var s=n[i];s==="words"?(l=function(m){m.innerHTML=yE(t.getValue())},a=function(m){m.innerHTML=yE(t.getValue())}):s==="lines"?(l=function(m){m.innerHTML=t.lineCount()},a=function(m){m.innerHTML=t.lineCount()}):s==="cursor"?(l=function(m){m.innerHTML="1:1"},o=function(m){var _=t.getCursor(),y=_.line+1,w=_.ch+1;m.innerHTML=y+":"+w}):s==="autosave"?l=function(m){e.autosave!=null&&e.autosave.enabled===!0&&m.setAttribute("id","autosaved")}:s==="upload-image"&&(l=function(m){m.innerHTML=e.imageTexts.sbInit}),r.push({className:s,defaultValue:l,onUpdate:a,onActivity:o})}var u=document.createElement("div");for(u.className="editor-statusbar",i=0;i<r.length;i++){var c=r[i],f=document.createElement("span");f.className=c.className,typeof c.defaultValue=="function"&&c.defaultValue(f),typeof c.onUpdate=="function"&&this.codemirror.on("update",function(m,_){return function(){_.onUpdate(m)}}(f,c)),typeof c.onActivity=="function"&&this.codemirror.on("cursorActivity",function(m,_){return function(){_.onActivity(m)}}(f,c)),u.appendChild(f)}var h=this.codemirror.getWrapperElement();return h.parentNode.insertBefore(u,h.nextSibling),u}};Lr.prototype.value=function(n){var e=this.codemirror;if(n===void 0)return e.getValue();if(e.getDoc().setValue(n),this.isPreviewActive()){var t=e.getWrapperElement(),r=t.lastChild;r.innerHTML=this.options.previewRender(n,r)}return this};Lr.toggleBold=y_;Lr.toggleItalic=$_;Lr.toggleStrikethrough=w_;Lr.toggleBlockquote=z_;Lr.toggleHeadingSmaller=e7;Lr.toggleHeadingBigger=A_;Lr.toggleHeading1=M_;Lr.toggleHeading2=C_;Lr.toggleHeading3=S_;Lr.toggleCodeBlock=k_;Lr.toggleUnorderedList=L_;Lr.toggleOrderedList=E_;Lr.cleanBlock=T_;Lr.drawLink=D_;Lr.drawImage=B_;Lr.drawUploadedImage=Ck;Lr.drawTable=H_;Lr.drawHorizontalRule=O_;Lr.undo=I_;Lr.redo=P_;Lr.togglePreview=V_;Lr.toggleSideBySide=L6;Lr.toggleFullScreen=Td;Lr.prototype.toggleBold=function(){y_(this)};Lr.prototype.toggleItalic=function(){$_(this)};Lr.prototype.toggleStrikethrough=function(){w_(this)};Lr.prototype.toggleBlockquote=function(){z_(this)};Lr.prototype.toggleHeadingSmaller=function(){e7(this)};Lr.prototype.toggleHeadingBigger=function(){A_(this)};Lr.prototype.toggleHeading1=function(){M_(this)};Lr.prototype.toggleHeading2=function(){C_(this)};Lr.prototype.toggleHeading3=function(){S_(this)};Lr.prototype.toggleCodeBlock=function(){k_(this)};Lr.prototype.toggleUnorderedList=function(){L_(this)};Lr.prototype.toggleOrderedList=function(){E_(this)};Lr.prototype.cleanBlock=function(){T_(this)};Lr.prototype.drawLink=function(){D_(this)};Lr.prototype.drawImage=function(){B_(this)};Lr.prototype.drawUploadedImage=function(){Ck(this)};Lr.prototype.drawTable=function(){H_(this)};Lr.prototype.drawHorizontalRule=function(){O_(this)};Lr.prototype.undo=function(){I_(this)};Lr.prototype.redo=function(){P_(this)};Lr.prototype.togglePreview=function(){V_(this)};Lr.prototype.toggleSideBySide=function(){L6(this)};Lr.prototype.toggleFullScreen=function(){Td(this)};Lr.prototype.isPreviewActive=function(){var n=this.codemirror,e=n.getWrapperElement(),t=e.lastChild;return/editor-preview-active/.test(t.className)};Lr.prototype.isSideBySideActive=function(){var n=this.codemirror,e=n.getWrapperElement(),t=e.nextSibling;return/editor-preview-active-side/.test(t.className)};Lr.prototype.isFullscreenActive=function(){var n=this.codemirror;return n.getOption("fullScreen")};Lr.prototype.getState=function(){var n=this.codemirror;return k5(n)};Lr.prototype.toTextArea=function(){var n=this.codemirror,e=n.getWrapperElement(),t=e.parentNode;t&&(this.gui.toolbar&&t.removeChild(this.gui.toolbar),this.gui.statusbar&&t.removeChild(this.gui.statusbar),this.gui.sideBySide&&t.removeChild(this.gui.sideBySide)),t.parentNode.insertBefore(e,t),t.remove(),n.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())};var _ce=Lr;function bce(n){let e,t;return{c(){e=X("div"),t=X("textarea"),t.disabled=!0,D(t,"id",n[0]),D(e,"style",n[3]),D(e,"class","svelte-1gaj2sn"),Te(e,"disabled",n[1])},m(r,i){C(r,e,i),x(e,t),n[9](t)},p(r,[i]){i&1&&D(t,"id",r[0]),i&8&&D(e,"style",r[3]),i&2&&Te(e,"disabled",r[1])},i:ht,o:ht,d(r){r&&M(e),n[9](null)}}}function yce(n,e,t){let r,{height:i=null}=e,{scroll:a=!0}=e,{easyMDEOptions:o=null}=e,{mde:l=null}=e,{id:s=null}=e,{fullScreenOffset:u=null}=e,{disabled:c=!1}=e,f;ar(()=>(t(4,i=i||"200px"),t(5,l=new _ce({element:f,spellChecker:!1,status:!1,unorderedListStyle:"-",maxHeight:a?i:void 0,minHeight:a?void 0:i,...o})),()=>{l.toTextArea()}));const h=_=>{let y="";return y+=`--fullscreen-offset-x:${(_==null?void 0:_.x)||"0px"};`,y+=`--fullscreen-offset-y:${(_==null?void 0:_.y)||"0px"};`,y};function m(_){De[_?"unshift":"push"](()=>{f=_,t(2,f)})}return n.$$set=_=>{"height"in _&&t(4,i=_.height),"scroll"in _&&t(6,a=_.scroll),"easyMDEOptions"in _&&t(7,o=_.easyMDEOptions),"mde"in _&&t(5,l=_.mde),"id"in _&&t(0,s=_.id),"fullScreenOffset"in _&&t(8,u=_.fullScreenOffset),"disabled"in _&&t(1,c=_.disabled)},n.$$.update=()=>{n.$$.dirty&256&&t(3,r=h(u))},[s,c,f,r,i,l,a,o,u,m]}class $ce extends Ve{constructor(e){super(),Pe(this,e,yce,bce,Ie,{height:4,scroll:6,easyMDEOptions:7,mde:5,id:0,fullScreenOffset:8,disabled:1})}}function $E(n){let e,t,r;function i(o){n[8](o)}let a={scroll:!0,height:n[1],id:n[3],fullScreenOffset:n[4],disabled:n[5],easyMDEOptions:{initialValue:n[0],placeholder:n[2],...n[6]}};return n[7]!==void 0&&(a.mde=n[7]),e=new $ce({props:a}),De.push(()=>tt(e,"mde",i)),{c(){O(e.$$.fragment)},m(o,l){B(e,o,l),r=!0},p(o,l){const s={};l&2&&(s.height=o[1]),l&8&&(s.id=o[3]),l&16&&(s.fullScreenOffset=o[4]),l&32&&(s.disabled=o[5]),l&69&&(s.easyMDEOptions={initialValue:o[0],placeholder:o[2],...o[6]}),!t&&l&128&&(t=!0,s.mde=o[7],rt(()=>t=!1)),e.$set(s)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){$(e.$$.fragment,o),r=!1},d(o){H(e,o)}}}function wce(n){let e=n[1],t,r,i=$E(n);return{c(){i.c(),t=yt()},m(a,o){i.m(a,o),C(a,t,o),r=!0},p(a,[o]){o&2&&Ie(e,e=a[1])?(we(),$(i,1,1,ht),ke(),i=$E(a),i.c(),b(i,1),i.m(t.parentNode,t)):i.p(a,o)},i(a){r||(b(i),r=!0)},o(a){$(i),r=!1},d(a){a&&M(t),i.d(a)}}}function kce(n,e,t){let{value:r=null}=e,{height:i=null}=e,{placeholder:a=null}=e,{id:o=null}=e,{fullScreenOffset:l=0}=e,{disabled:s=!1}=e,{easyMDEOptions:u}=e;const c=Nn();let f,h;const m=S=>{h&&S!==f&&h.value(S)},w=((S,T)=>{let I;return()=>{clearTimeout(I),I=setTimeout(S,T)}})(()=>{f=h.value(),c("change",f)},250);function A(S){h=S,t(7,h)}return n.$$set=S=>{"value"in S&&t(0,r=S.value),"height"in S&&t(1,i=S.height),"placeholder"in S&&t(2,a=S.placeholder),"id"in S&&t(3,o=S.id),"fullScreenOffset"in S&&t(4,l=S.fullScreenOffset),"disabled"in S&&t(5,s=S.disabled),"easyMDEOptions"in S&&t(6,u=S.easyMDEOptions)},n.$$.update=()=>{n.$$.dirty&1&&m(r),n.$$.dirty&128&&(h==null||h.codemirror.on("change",w))},[r,i,a,o,l,s,u,h,A]}class zce extends Ve{constructor(e){super(),Pe(this,e,kce,wce,Ie,{value:0,height:1,placeholder:2,id:3,fullScreenOffset:4,disabled:5,easyMDEOptions:6})}}function Ace(n){let e,t,r;return t=new zce({props:{value:n[0],placeholder:n[1],height:n[4],id:n[5],fullScreenOffset:n[6],disabled:n[2],easyMDEOptions:n[7]}}),t.$on("change",n[8]),{c(){e=X("div"),O(t.$$.fragment),D(e,"class","svelte-rs8sig"),Te(e,"error",n[3])},m(i,a){C(i,e,a),B(t,e,null),r=!0},p(i,[a]){const o={};a&1&&(o.value=i[0]),a&2&&(o.placeholder=i[1]),a&16&&(o.height=i[4]),a&32&&(o.id=i[5]),a&64&&(o.fullScreenOffset=i[6]),a&4&&(o.disabled=i[2]),a&128&&(o.easyMDEOptions=i[7]),t.$set(o),a&8&&Te(e,"error",i[3])},i(i){r||(b(t.$$.fragment,i),r=!0)},o(i){$(t.$$.fragment,i),r=!1},d(i){i&&M(e),H(t)}}}function Mce(n,e,t){let{value:r=""}=e,{placeholder:i=null}=e,{disabled:a=!1}=e,{error:o=null}=e,{height:l=null}=e,{id:s=null}=e,{fullScreenOffset:u=null}=e,{easyMDEOptions:c=null}=e;function f(h){Hn.call(this,n,h)}return n.$$set=h=>{"value"in h&&t(0,r=h.value),"placeholder"in h&&t(1,i=h.placeholder),"disabled"in h&&t(2,a=h.disabled),"error"in h&&t(3,o=h.error),"height"in h&&t(4,l=h.height),"id"in h&&t(5,s=h.id),"fullScreenOffset"in h&&t(6,u=h.fullScreenOffset),"easyMDEOptions"in h&&t(7,c=h.easyMDEOptions)},[r,i,a,o,l,s,u,c,f]}class Cce extends Ve{constructor(e){super(),Pe(this,e,Mce,Ace,Ie,{value:0,placeholder:1,disabled:2,error:3,height:4,id:5,fullScreenOffset:6,easyMDEOptions:7})}}function Sce(n){let e,t;return e=new Cce({props:{error:n[5],disabled:n[4],value:n[0],placeholder:n[3],height:n[6],id:n[7],fullScreenOffset:n[8],easyMDEOptions:n[9]}}),e.$on("change",n[10]),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&32&&(a.error=r[5]),i&16&&(a.disabled=r[4]),i&1&&(a.value=r[0]),i&8&&(a.placeholder=r[3]),i&64&&(a.height=r[6]),i&128&&(a.id=r[7]),i&256&&(a.fullScreenOffset=r[8]),i&512&&(a.easyMDEOptions=r[9]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Lce(n){let e,t;return e=new Sc({props:{label:n[1],labelPosition:n[2],error:n[5],$$slots:{default:[Sce]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,[i]){const a={};i&2&&(a.label=r[1]),i&4&&(a.labelPosition=r[2]),i&32&&(a.error=r[5]),i&5113&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Ece(n,e,t){let{value:r=null}=e,{label:i=null}=e,{labelPosition:a="above"}=e,{placeholder:o=null}=e,{disabled:l=!1}=e,{error:s=null}=e,{height:u=null}=e,{id:c=null}=e,{fullScreenOffset:f=null}=e,{easyMDEOptions:h=null}=e;const m=Nn(),_=y=>{t(0,r=y.detail),m("change",y.detail)};return n.$$set=y=>{"value"in y&&t(0,r=y.value),"label"in y&&t(1,i=y.label),"labelPosition"in y&&t(2,a=y.labelPosition),"placeholder"in y&&t(3,o=y.placeholder),"disabled"in y&&t(4,l=y.disabled),"error"in y&&t(5,s=y.error),"height"in y&&t(6,u=y.height),"id"in y&&t(7,c=y.id),"fullScreenOffset"in y&&t(8,f=y.fullScreenOffset),"easyMDEOptions"in y&&t(9,h=y.easyMDEOptions)},[r,i,a,o,l,s,u,c,f,h,_]}class Tce extends Ve{constructor(e){super(),Pe(this,e,Ece,Lce,Ie,{value:0,label:1,labelPosition:2,placeholder:3,disabled:4,error:5,height:6,id:7,fullScreenOffset:8,easyMDEOptions:9})}}function wE(n){let e,t,r;return t=new Vu({props:{$$slots:{default:[Dce]},$$scope:{ctx:n}}}),{c(){e=X("div"),O(t.$$.fragment),D(e,"class","title svelte-glsrm")},m(i,a){C(i,e,a),B(t,e,null),r=!0},p(i,a){const o={};a&5&&(o.$$scope={dirty:a,ctx:i}),t.$set(o)},i(i){r||(b(t.$$.fragment,i),r=!0)},o(i){$(t.$$.fragment,i),r=!1},d(i){i&&M(e),H(t)}}}function Dce(n){let e;return{c(){e=oe(n[0])},m(t,r){C(t,e,r)},p(t,r){r&1&>(e,t[0])},d(t){t&&M(e)}}}function Bce(n){let e,t,r,i,a=n[0]&&wE(n);const o=n[1].default,l=Xn(o,n,n[2],null);return{c(){e=X("div"),a&&a.c(),t=q(),r=X("div"),l&&l.c(),D(r,"class","list-items svelte-glsrm")},m(s,u){C(s,e,u),a&&a.m(e,null),x(e,t),x(e,r),l&&l.m(r,null),i=!0},p(s,[u]){s[0]?a?(a.p(s,u),u&1&&b(a,1)):(a=wE(s),a.c(),b(a,1),a.m(e,t)):a&&(we(),$(a,1,1,()=>{a=null}),ke()),l&&l.p&&(!i||u&4)&&Zn(l,o,s,s[2],i?Jn(o,s[2],u,null):Qn(s[2]),null)},i(s){i||(b(a),b(l,s),i=!0)},o(s){$(a),$(l,s),i=!1},d(s){s&&M(e),a&&a.d(),l&&l.d(s)}}}function Hce(n,e,t){let{$$slots:r={},$$scope:i}=e,{title:a=null}=e;return n.$$set=o=>{"title"in o&&t(0,a=o.title),"$$scope"in o&&t(2,i=o.$$scope)},[a,r,i]}class E6 extends Ve{constructor(e){super(),Pe(this,e,Hce,Bce,Ie,{title:0})}}function kE(n){let e,t;return e=new Jw({props:{icon:n[0],color:n[2],background:n[1]}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&1&&(a.icon=r[0]),i&4&&(a.color=r[2]),i&2&&(a.background=r[1]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function zE(n){let e,t;return e=new Fd({props:{initials:n[7]}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&128&&(a.initials=r[7]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function AE(n){let e,t;return e=new jt({props:{$$slots:{default:[Oce]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&1040&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Oce(n){let e;return{c(){e=oe(n[4])},m(t,r){C(t,e,r)},p(t,r){r&16&>(e,t[4])},d(t){t&&M(e)}}}function ME(n){let e,t;return e=new sn({props:{$$slots:{default:[Ice]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&1056&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Ice(n){let e;return{c(){e=oe(n[5])},m(t,r){C(t,e,r)},p(t,r){r&32&>(e,t[5])},d(t){t&&M(e)}}}function Pce(n){let e,t,r,i,a,o,l,s,u,c,f=n[0]&&kE(n),h=n[3]&&zE(n),m=n[4]&&AE(n),_=n[5]&&ME(n);const y=n[8].default,w=Xn(y,n,n[10],null);return{c(){e=X("div"),t=X("div"),f&&f.c(),r=q(),h&&h.c(),i=q(),m&&m.c(),a=q(),_&&_.c(),o=q(),l=X("div"),w&&w.c(),D(t,"class","left svelte-15u15t4"),D(l,"class","right svelte-15u15t4"),D(e,"class","list-item svelte-15u15t4"),Te(e,"hoverable",n[6])},m(A,S){C(A,e,S),x(e,t),f&&f.m(t,null),x(t,r),h&&h.m(t,null),x(t,i),m&&m.m(t,null),x(t,a),_&&_.m(t,null),x(e,o),x(e,l),w&&w.m(l,null),s=!0,u||(c=At(e,"click",n[9]),u=!0)},p(A,[S]){A[0]?f?(f.p(A,S),S&1&&b(f,1)):(f=kE(A),f.c(),b(f,1),f.m(t,r)):f&&(we(),$(f,1,1,()=>{f=null}),ke()),A[3]?h?(h.p(A,S),S&8&&b(h,1)):(h=zE(A),h.c(),b(h,1),h.m(t,i)):h&&(we(),$(h,1,1,()=>{h=null}),ke()),A[4]?m?(m.p(A,S),S&16&&b(m,1)):(m=AE(A),m.c(),b(m,1),m.m(t,a)):m&&(we(),$(m,1,1,()=>{m=null}),ke()),A[5]?_?(_.p(A,S),S&32&&b(_,1)):(_=ME(A),_.c(),b(_,1),_.m(t,null)):_&&(we(),$(_,1,1,()=>{_=null}),ke()),w&&w.p&&(!s||S&1024)&&Zn(w,y,A,A[10],s?Jn(y,A[10],S,null):Qn(A[10]),null),S&64&&Te(e,"hoverable",A[6])},i(A){s||(b(f),b(h),b(m),b(_),b(w,A),s=!0)},o(A){$(f),$(h),$(m),$(_),$(w,A),s=!1},d(A){A&&M(e),f&&f.d(),h&&h.d(),m&&m.d(),_&&_.d(),w&&w.d(A),u=!1,c()}}}function Vce(n,e,t){let r,{$$slots:i={},$$scope:a}=e,{icon:o=null}=e,{iconBackground:l=null}=e,{iconColor:s=null}=e,{avatar:u=!1}=e,{title:c=null}=e,{subtitle:f=null}=e,{hoverable:h=!1}=e;function m(_){Hn.call(this,n,_)}return n.$$set=_=>{"icon"in _&&t(0,o=_.icon),"iconBackground"in _&&t(1,l=_.iconBackground),"iconColor"in _&&t(2,s=_.iconColor),"avatar"in _&&t(3,u=_.avatar),"title"in _&&t(4,c=_.title),"subtitle"in _&&t(5,f=_.subtitle),"hoverable"in _&&t(6,h=_.hoverable),"$$scope"in _&&t(10,a=_.$$scope)},n.$$.update=()=>{n.$$.dirty&24&&t(7,r=u?c==null?void 0:c[0]:null)},[o,l,s,u,c,f,h,r,i,m,a]}class E4 extends Ve{constructor(e){super(),Pe(this,e,Vce,Pce,Ie,{icon:0,iconBackground:1,iconColor:2,avatar:3,title:4,subtitle:5,hoverable:6})}}function Rce(n){let e,t;const r=n[1].default,i=Xn(r,n,n[0],null);return{c(){e=X("div"),i&&i.c(),D(e,"class","icon-side-nav svelte-krsn3q")},m(a,o){C(a,e,o),i&&i.m(e,null),t=!0},p(a,[o]){i&&i.p&&(!t||o&1)&&Zn(i,r,a,a[0],t?Jn(r,a[0],o,null):Qn(a[0]),null)},i(a){t||(b(i,a),t=!0)},o(a){$(i,a),t=!1},d(a){a&&M(e),i&&i.d(a)}}}function Nce(n,e,t){let{$$slots:r={},$$scope:i}=e;return n.$$set=a=>{"$$scope"in a&&t(0,i=a.$$scope)},[i,r]}class Fce extends Ve{constructor(e){super(),Pe(this,e,Nce,Rce,Ie,{})}}function CE(n){let e,t,r,i;return t=new z6({props:{textWrapping:!0,direction:"right",text:n[2]}}),{c(){e=X("div"),O(t.$$.fragment),D(e,"class","tooltip svelte-12yq719")},m(a,o){C(a,e,o),B(t,e,null),i=!0},p(a,o){const l={};o&4&&(l.text=a[2]),t.$set(l)},i(a){i||(b(t.$$.fragment,a),r||Po(()=>{r=Sd(e,ip,{duration:130,delay:250}),r.start()}),i=!0)},o(a){$(t.$$.fragment,a),i=!1},d(a){a&&M(e),H(t)}}}function jce(n){let e,t,r,i,a,o;t=new un({props:{name:n[0],hoverable:!0}});let l=n[2]&&n[3]&&CE(n);return{c(){e=X("div"),O(t.$$.fragment),r=q(),l&&l.c(),D(e,"class","icon-side-nav-item svelte-12yq719"),Te(e,"active",n[1])},m(s,u){C(s,e,u),B(t,e,null),x(e,r),l&&l.m(e,null),i=!0,a||(o=[At(e,"mouseover",n[5]),At(e,"focus",n[6]),At(e,"mouseleave",n[7]),At(e,"click",n[4])],a=!0)},p(s,[u]){const c={};u&1&&(c.name=s[0]),t.$set(c),s[2]&&s[3]?l?(l.p(s,u),u&12&&b(l,1)):(l=CE(s),l.c(),b(l,1),l.m(e,null)):l&&(we(),$(l,1,1,()=>{l=null}),ke()),u&2&&Te(e,"active",s[1])},i(s){i||(b(t.$$.fragment,s),b(l),i=!0)},o(s){$(t.$$.fragment,s),$(l),i=!1},d(s){s&&M(e),H(t),l&&l.d(),a=!1,Vi(o)}}}function xce(n,e,t){let{icon:r}=e,{active:i=!1}=e,{tooltip:a}=e,o=!1;function l(f){Hn.call(this,n,f)}const s=()=>t(3,o=!0),u=()=>t(3,o=!0),c=()=>t(3,o=!1);return n.$$set=f=>{"icon"in f&&t(0,r=f.icon),"active"in f&&t(1,i=f.active),"tooltip"in f&&t(2,a=f.tooltip)},[r,i,a,o,l,s,u,c]}class hg extends Ve{constructor(e){super(),Pe(this,e,xce,jce,Ie,{icon:0,active:1,tooltip:2})}}function Uce(n){let e,t,r,i;return{c(){e=X("div"),t=X("input"),D(t,"type","range"),D(t,"min",n[3]),D(t,"max",n[4]),D(t,"step",n[5]),t.value=n[0],t.disabled=n[2],D(t,"id",n[1]),D(t,"class","svelte-13v9q49"),D(e,"class","svelte-13v9q49")},m(a,o){C(a,e,o),x(e,t),r||(i=At(t,"change",n[6]),r=!0)},p(a,[o]){o&8&&D(t,"min",a[3]),o&16&&D(t,"max",a[4]),o&32&&D(t,"step",a[5]),o&1&&(t.value=a[0]),o&4&&(t.disabled=a[2]),o&2&&D(t,"id",a[1])},i:ht,o:ht,d(a){a&&M(e),r=!1,i()}}}function qce(n,e,t){let{value:r=!1}=e,{id:i=null}=e,{disabled:a=!1}=e,{min:o=0}=e,{max:l=100}=e,{step:s=1}=e;const u=Nn(),c=f=>{u("change",f.target.value)};return n.$$set=f=>{"value"in f&&t(0,r=f.value),"id"in f&&t(1,i=f.id),"disabled"in f&&t(2,a=f.disabled),"min"in f&&t(3,o=f.min),"max"in f&&t(4,l=f.max),"step"in f&&t(5,s=f.step)},[r,i,a,o,l,s,c]}class Wce extends Ve{constructor(e){super(),Pe(this,e,qce,Uce,Ie,{value:0,id:1,disabled:2,min:3,max:4,step:5})}}function Gce(n){let e,t;return e=new Wce({props:{disabled:n[6],value:n[0],min:n[3],max:n[4],step:n[5]}}),e.$on("change",n[8]),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,i){const a={};i&64&&(a.disabled=r[6]),i&1&&(a.value=r[0]),i&8&&(a.min=r[3]),i&16&&(a.max=r[4]),i&32&&(a.step=r[5]),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Yce(n){let e,t;return e=new Sc({props:{label:n[1],labelPosition:n[2],error:n[7],$$slots:{default:[Gce]},$$scope:{ctx:n}}}),{c(){O(e.$$.fragment)},m(r,i){B(e,r,i),t=!0},p(r,[i]){const a={};i&2&&(a.label=r[1]),i&4&&(a.labelPosition=r[2]),i&128&&(a.error=r[7]),i&1145&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(b(e.$$.fragment,r),t=!0)},o(r){$(e.$$.fragment,r),t=!1},d(r){H(e,r)}}}function Kce(n,e,t){let{value:r=null}=e,{label:i=null}=e,{labelPosition:a="above"}=e,{min:o=0}=e,{max:l=100}=e,{step:s=1}=e,{disabled:u=!1}=e,{error:c=null}=e;const f=Nn(),h=m=>{t(0,r=m.detail),f("change",m.detail)};return n.$$set=m=>{"value"in m&&t(0,r=m.value),"label"in m&&t(1,i=m.label),"labelPosition"in m&&t(2,a=m.labelPosition),"min"in m&&t(3,o=m.min),"max"in m&&t(4,l=m.max),"step"in m&&t(5,s=m.step),"disabled"in m&&t(6,u=m.disabled),"error"in m&&t(7,c=m.error)},[r,i,a,o,l,s,u,c,h]}class Xce extends Ve{constructor(e){super(),Pe(this,e,Kce,Yce,Ie,{value:0,label:1,labelPosition:2,min:3,max:4,step:5,disabled:6,error:7})}}function Jce(n){let e,t;return{c(){e=X("div"),t=oe(n[0]),D(e,"class","bold svelte-9amtlb")},m(r,i){C(r,e,i),x(e,t)},p(r,[i]){i&1&>(t,r[0])},i:ht,o:ht,d(r){r&&M(e)}}}function Zce(n,e,t){let{value:r}=e;return n.$$set=i=>{"value"in i&&t(0,r=i.value)},[r]}class Qce extends Ve{constructor(e){super(),Pe(this,e,Zce,Jce,Ie,{value:0})}}function e2e(n){let e,t;return{c(){e=X("code"),t=oe(n[0]),D(e,"class","svelte-e82i3")},m(r,i){C(r,e,i),x(e,t)},p(r,[i]){i&1&>(t,r[0])},i:ht,o:ht,d(r){r&&M(e)}}}function t2e(n,e,t){let{value:r}=e;return n.$$set=i=>{"value"in i&&t(0,r=i.value)},[r]}class n2e extends Ve{constructor(e){super(),Pe(this,e,t2e,e2e,Ie,{value:0})}}const Qf={Equals:{value:"equal",label:"Equals"},NotEquals:{value:"notEqual",label:"Not equals"},Empty:{value:"empty",label:"Is empty"},NotEmpty:{value:"notEmpty",label:"Is not empty"},StartsWith:{value:"string",label:"Starts with"},Like:{value:"fuzzy",label:"Like"},MoreThan:{value:"rangeLow",label:"More than"},LessThan:{value:"rangeHigh",label:"Less than"},Contains:{value:"contains",label:"Contains"},NotContains:{value:"notContains",label:"Does not contain"},In:{value:"oneOf",label:"Is in"},ContainsAny:{value:"containsAny",label:"Has any"}},Bh={Auth:"budibase:auth",CurrentApp:"budibase:currentapp",ReturnUrl:"budibase:returnurl",AccountReturnUrl:"budibase:account:returnurl"},EG={USERS:"ta_users"},u5={AppUser:"appUser",Developer:"developer",Admin:"admin"},R_=[{label:"App User",value:u5.AppUser},{label:"Developer",value:u5.Developer},{label:"Admin",value:u5.Admin}],TG=[{value:u5.AppUser,icon:"User",label:"App user - Only has access to published apps"},{value:u5.Developer,icon:"Hammer",label:"Developer - Access to the app builder"},{value:u5.Admin,icon:"Draw",label:"Admin - Full access"}],w4={FREE:"free",TEAM:"team",PRO:"pro",BUSINESS:"business",ENTERPRISE:"enterprise"},DG="1",P$={USER_GROUPS:"userGroups",BACKUPS:"appBackups"},W2={ADMIN:"ADMIN",POWER:"POWER",BASIC:"BASIC",PUBLIC:"PUBLIC",BUILDER:"BUILDER"},V$={integer:{max:2147483647,min:-2147483648},int:{max:2147483647,min:-2147483648},smallint:{max:32767,min:-32768},mediumint:{max:8388607,min:-8388608}},n6=[{class:"lightest",name:"Lightest"},{class:"light",name:"Light"},{class:"dark",name:"Dark"},{class:"darkest",name:"Darkest"},{class:"nord",name:"Nord",base:"darkest"},{class:"midnight",name:"Midnight",base:"darkest"}],r2e=Object.freeze(Object.defineProperty({__proto__:null,OperatorOptions:Qf,Cookies:Bh,TableNames:EG,BudibaseRoles:u5,BudibaseRoleOptions:R_,BuilderRoleDescriptions:TG,PlanType:w4,ApiVersion:DG,Features:P$,Roles:W2,SqlNumberTypeRangeMap:V$,Themes:n6},Symbol.toStringTag,{value:"Module"})),i2e=n=>({getAnalyticsStatus:async()=>await n.get({url:"/api/bbtel"}),analyticsPing:async({source:e})=>{const t=Intl.DateTimeFormat().resolvedOptions().timeZone;return await n.post({url:"/api/bbtel/ping",body:{source:e,timezone:t}})}}),a2e=n=>({fetchAppPackage:async e=>await n.get({url:`/api/applications/${e}/appPackage`}),saveAppMetadata:async({appId:e,metadata:t})=>await n.put({url:`/api/applications/${e}`,body:t}),deployAppChanges:async()=>await n.post({url:"/api/deploy"}),revertAppChanges:async e=>await n.post({url:`/api/dev/${e}/revert`}),updateAppClientVersion:async e=>await n.post({url:`/api/applications/${e}/client/update`}),revertAppClientVersion:async e=>await n.post({url:`/api/applications/${e}/client/revert`}),getAppDeployments:async()=>await n.get({url:"/api/deployments"}),createApp:async e=>await n.post({url:"/api/applications",body:e,json:!1}),importApps:async e=>await n.post({url:"/api/cloud/import",body:e,json:!1}),unpublishApp:async e=>await n.delete({url:`/api/applications/${e}?unpublish=1`}),deleteApp:async e=>await n.delete({url:`/api/applications/${e}`}),releaseAppLock:async e=>await n.delete({url:`/api/dev/${e}/lock`}),syncApp:async e=>await n.post({url:`/api/applications/${e}/sync`}),getApps:async()=>await n.get({url:"/api/applications?status=all"}),fetchComponentLibDefinitions:async e=>await n.get({url:`/api/${e}/components/definitions`})}),o2e=n=>{const e=async({datasourceId:t,bucket:r,key:i})=>await n.post({url:`/api/attachments/${t}/url`,body:{bucket:r,key:i}});return{getSignedDatasourceURL:e,uploadAttachment:async({data:t,tableId:r})=>await n.post({url:`/api/attachments/${r}/upload`,body:t,json:!1}),uploadBuilderAttachment:async t=>await n.post({url:"/api/attachments/process",body:t,json:!1}),externalUpload:async({datasourceId:t,bucket:r,key:i,data:a})=>{const{signedUrl:o,publicUrl:l}=await e({datasourceId:t,bucket:r,key:i});return await n.put({url:o,body:a,json:!1,external:!0}),{publicUrl:l}},deleteAttachments:async({keys:t,tableId:r})=>await n.post({url:`/api/attachments/${r}/delete`,body:{keys:t}}),deleteBuilderAttachments:async t=>await n.post({url:"/api/attachments/delete",body:{keys:t}})}},l2e=n=>({logIn:async({tenantId:e,username:t,password:r})=>await n.post({url:`/api/global/auth/${e}/login`,body:{username:t,password:r}}),logOut:async()=>await n.post({url:"/api/global/auth/logout"}),setInitInfo:async e=>await n.post({url:"/api/global/auth/init",body:e}),getInitInfo:async()=>await n.get({url:"/api/global/auth/init"}),requestForgotPassword:async({tenantId:e,email:t})=>await n.post({url:`/api/global/auth/${e}/reset`,body:{email:t}}),resetPassword:async({tenantId:e,password:t,resetCode:r})=>await n.post({url:`/api/global/auth/${e}/reset/update`,body:{password:t,resetCode:r}})}),s2e=n=>({triggerAutomation:async({automationId:e,fields:t})=>await n.post({url:`/api/automations/${e}/trigger`,body:{fields:t}}),testAutomation:async({automationId:e,testData:t})=>await n.post({url:`/api/automations/${e}/test`,body:t}),getAutomations:async()=>await n.get({url:"/api/automations"}),getAutomationDefinitions:async()=>await n.get({url:"/api/automations/definitions/list"}),createAutomation:async e=>await n.post({url:"/api/automations",body:e}),updateAutomation:async e=>await n.put({url:"/api/automations",body:e}),deleteAutomation:async({automationId:e,automationRev:t})=>await n.delete({url:`/api/automations/${e}/${t}`}),getAutomationLogs:async({automationId:e,startDate:t,status:r,page:i})=>await n.post({url:"/api/automations/logs/search",body:{automationId:e,startDate:t,status:r,page:i}}),clearAutomationLogErrors:async({automationId:e,appId:t})=>await n.delete({url:"/api/automations/logs",body:{appId:t,automationId:e}})}),u2e=n=>({saveConfig:async e=>await n.post({url:"/api/global/configs",body:e}),getConfig:async e=>await n.get({url:`/api/global/configs/${e}`}),deleteConfig:async({id:e,rev:t})=>await n.delete({url:`/api/global/configs/${e}/${t}`}),getTenantConfig:async e=>await n.get({url:`/api/global/configs/public?tenantId=${e}`}),getOIDCConfig:async e=>await n.get({url:`/api/global/configs/public/oidc?tenantId=${e}`}),getChecklist:async e=>await n.get({url:`/api/global/configs/checklist?tenantId=${e}`}),uploadLogo:async e=>await n.post({url:"/api/global/configs/upload/settings/logoUrl",body:e,json:!1}),uploadOIDCLogo:async({name:e,data:t})=>await n.post({url:`/api/global/configs/upload/logos_oidc/${e}`,body:t,json:!1}),getOIDCLogos:async()=>await n.get({url:"/api/global/configs/logos_oidc"})}),c2e=n=>({getDatasources:async()=>await n.get({url:"/api/datasources"}),buildDatasourceSchema:async({datasourceId:e,tablesFilter:t})=>await n.post({url:`/api/datasources/${e}/schema`,body:{tablesFilter:t}}),createDatasource:async({datasource:e,fetchSchema:t})=>await n.post({url:"/api/datasources",body:{datasource:e,fetchSchema:t}}),updateDatasource:async e=>await n.put({url:`/api/datasources/${e._id}`,body:e}),deleteDatasource:async({datasourceId:e,datasourceRev:t})=>await n.delete({url:`/api/datasources/${e}/${t}`})}),f2e=n=>({getFlags:async()=>await n.get({url:"/api/users/flags"}),updateFlag:async({flag:e,value:t})=>await n.post({url:"/api/users/flags",body:{flag:e,value:t}}),toggleUiFeature:async({value:e})=>await n.post({url:`/api/beta/${e}`})}),p2e=n=>({getHostingURLs:async()=>await n.get({url:"/api/hosting/urls"}),getDeployedApps:async()=>await n.get({url:"/api/hosting/apps"})}),d2e=n=>({saveLayout:async e=>await n.post({url:"/api/layouts",body:e}),deleteLayout:async({layoutId:e,layoutRev:t})=>await n.delete({url:`/api/layouts/${e}/${t}`})}),h2e=n=>({checkImportComplete:async()=>await n.get({url:"/api/cloud/import/complete"}),getEnvironment:async()=>await n.get({url:"/api/system/environment"}),getSystemStatus:async()=>await n.get({url:"/api/system/status"}),getIntegrations:async()=>await n.get({url:"/api/integrations"}),getBudibaseVersion:async()=>(await n.get({url:"/api/dev/version"})).version,getBasePermissions:async()=>await n.get({url:"/api/permission/builtin"}),checkBetaAccess:async e=>await n.get({url:`/api/beta/access?email=${e}`,external:!0})}),m2e=n=>({getPermissionForResource:async e=>await n.get({url:`/api/permission/${e}`}),updatePermissionForResource:async({resourceId:e,roleId:t,level:r})=>await n.post({url:`/api/permission/${t}/${e}/${r}`})}),g2e=n=>({executeQuery:async({queryId:e,pagination:t,parameters:r})=>await n.post({url:`/api/v2/queries/${e}`,body:{parameters:r,pagination:t}}),fetchQueryDefinition:async e=>await n.get({url:`/api/queries/${e}`,cache:!0}),getQueries:async()=>await n.get({url:"/api/queries"}),saveQuery:async e=>await n.post({url:"/api/queries",body:e}),deleteQuery:async({queryId:e,queryRev:t})=>await n.delete({url:`/api/queries/${e}/${t}`}),importQueries:async({datasourceId:e,data:t})=>await n.post({url:"/api/queries/import",body:{datasourceId:e,data:t}}),previewQuery:async e=>await n.post({url:"/api/queries/preview",body:e})}),v2e=n=>({fetchRelationshipData:async({tableId:e,rowId:t,fieldName:r})=>{if(!e||!t)return[];const i=await n.get({url:`/api/${e}/${t}/enrich`});return r?i[r]||[]:i||[]}}),_2e=n=>({deleteRole:async({roleId:e,roleRev:t})=>await n.delete({url:`/api/roles/${e}/${t}`}),saveRole:async e=>await n.post({url:"/api/roles",body:e}),getRoles:async()=>await n.get({url:"/api/roles"}),getRolesForApp:async e=>await n.get({url:`/api/global/roles/${e}`})}),b2e=n=>({fetchClientAppRoutes:async()=>await n.get({url:"/api/routing/client"}),fetchAppRoutes:async()=>await n.get({url:"/api/routing"})}),y2e=n=>({fetchRow:async({tableId:e,rowId:t})=>!e||!t?null:await n.get({url:`/api/${e}/rows/${t}`}),saveRow:async e=>{if(!!(e!=null&&e.tableId))return await n.post({url:`/api/${e.tableId}/rows`,body:e})},deleteRow:async({tableId:e,rowId:t,revId:r})=>{if(!(!e||!t))return await n.delete({url:`/api/${e}/rows`,body:{_id:t,_rev:r}})},deleteRows:async({tableId:e,rows:t})=>await n.delete({url:`/api/${e}/rows`,body:{rows:t}}),exportRows:async({tableId:e,rows:t,format:r,columns:i})=>await n.post({url:`/api/${e}/rows/exportRows?format=${r}`,body:{rows:t,columns:i},parseResponse:async a=>await a.text()})}),$2e=n=>({saveScreen:async e=>await n.post({url:"/api/screens",body:e}),deleteScreen:async({screenId:e,screenRev:t})=>await n.delete({url:`/api/screens/${e}/${t}`})}),w2e=n=>({fetchTableDefinition:async e=>await n.get({url:`/api/tables/${e}`,cache:!0}),fetchTableData:async e=>await n.get({url:`/api/${e}/rows`}),searchTable:async({tableId:e,query:t,bookmark:r,limit:i,sort:a,sortOrder:o,sortType:l,paginate:s})=>!e||!t?{rows:[]}:await n.post({url:`/api/${e}/search`,body:{query:t,bookmark:r,limit:i,sort:a,sortOrder:o,sortType:l,paginate:s}}),importTableData:async({tableId:e,data:t})=>await n.post({url:`/api/tables/${e}/import`,body:{dataImport:t}}),validateTableCSV:async({tableId:e,csvString:t,schema:r})=>await n.post({url:"/api/tables/csv/validate",body:{csvString:t,schema:r,tableId:e}}),getTables:async()=>await n.get({url:"/api/tables"}),saveTable:async e=>await n.post({url:"/api/tables",body:e}),deleteTable:async({tableId:e,tableRev:t})=>await n.delete({url:`/api/tables/${e}/${t}`})}),k2e=n=>({getEmailTemplateDefinitions:async()=>await n.get({url:"/api/global/template/definitions"}),getEmailTemplates:async()=>await n.get({url:"/api/global/template/email"}),saveEmailTemplate:async e=>await n.post({url:"/api/global/template",body:e}),getAppTemplates:async()=>await n.get({url:"/api/templates"})}),z2e=n=>({getUsers:async()=>await n.get({url:"/api/global/users"}),searchUsers:async({page:e,email:t,appId:r}={})=>{const i={};return e&&(i.page=e),t&&(i.email=t),r&&(i.appId=r),await n.post({url:"/api/global/users/search",body:i})},getUser:async e=>await n.get({url:`/api/global/users/${e}`}),createAppUser:async e=>await n.post({url:"/api/users/metadata",body:e}),updateOwnMetadata:async e=>await n.post({url:"/api/users/metadata/self",body:e}),createAdminUser:async e=>await n.post({url:"/api/global/users/init",body:e}),saveUser:async e=>await n.post({url:"/api/global/users",body:e}),createUsers:async({users:e,groups:t})=>(await n.post({url:"/api/global/users/bulk",body:{create:{users:e,groups:t}}})).created,deleteUser:async e=>await n.delete({url:`/api/global/users/${e}`}),deleteUsers:async e=>(await n.post({url:"/api/global/users/bulk",body:{delete:{userIds:e}}})).deleted,inviteUser:async({email:e,builder:t,admin:r})=>await n.post({url:"/api/global/users/invite",body:{email:e,userInfo:{admin:r?{global:!0}:void 0,builder:t?{global:!0}:void 0}}}),inviteUsers:async e=>await n.post({url:"/api/global/users/multi/invite",body:e.map(t=>({email:t.email,userInfo:{admin:t.admin?{global:!0}:void 0,builder:t.admin||t.builder?{global:!0}:void 0,userGroups:t.groups}}))}),acceptInvite:async({inviteCode:e,password:t})=>await n.post({url:"/api/global/users/invite/accept",body:{inviteCode:e,password:t}}),getUserCountByApp:async({appId:e})=>await n.get({url:`/api/global/users/count/${e}`})}),A2e=n=>({generateAPIKey:async()=>{const e=await n.post({url:"/api/global/self/api_key"});return e==null?void 0:e.apiKey},fetchDeveloperInfo:async()=>n.get({url:"/api/global/self/api_key"}),fetchSelf:async()=>await n.get({url:"/api/self"}),fetchBuilderSelf:async()=>await n.get({url:"/api/global/self"}),updateSelf:async e=>await n.post({url:"/api/global/self",body:e})}),M2e=n=>({fetchViewData:async({name:e,field:t,groupBy:r,calculation:i})=>{const a=new URLSearchParams;i&&(a.set("field",t),a.set("calculation",i)),r&&a.set("group",r);const o=t?`/api/views/${e}?${a}`:`/api/views/${e}`;return await n.get({url:o})},exportView:async({viewName:e,format:t})=>{const r=encodeURIComponent(e);return await n.get({url:`/api/views/export?view=${r}&format=${t}`,parseResponse:async i=>await i.text()})},saveView:async e=>await n.post({url:"/api/views",body:e}),deleteView:async e=>await n.delete({url:`/api/views/${e}`})}),C2e=n=>({activateLicenseKey:async e=>n.post({url:"/api/global/license/activate",body:e}),deleteLicenseKey:async()=>n.delete({url:"/api/global/license/info"}),getLicenseInfo:async()=>n.get({url:"/api/global/license/info"}),refreshLicense:async()=>n.post({url:"/api/global/license/refresh"}),getQuotaUsage:async()=>n.get({url:"/api/global/license/usage"})}),S2e=n=>{async function e(t,r,i,a){return Array.isArray(a)||(a=[a]),await n.post({url:`/api/global/groups/${t}/${r}`,body:{[i]:a}})}return{saveGroup:async t=>await n.post({url:"/api/global/groups",body:t}),getGroups:async()=>await n.get({url:"/api/global/groups"}),getGroup:async t=>await n.get({url:`/api/global/groups/${t}`}),deleteGroup:async({id:t,rev:r})=>await n.delete({url:`/api/global/groups/${t}/${r}`}),addUsersToGroup:async(t,r)=>e(t,"users","add",r),removeUsersFromGroup:async(t,r)=>e(t,"users","remove",r),addAppsToGroup:async(t,r)=>e(t,"apps","add",r),removeAppsFromGroup:async(t,r)=>e(t,"apps","remove",r)}},L2e=n=>({uploadPlugin:async e=>await n.post({url:"/api/plugin/upload",body:e,json:!1}),createPlugin:async e=>await n.post({url:"/api/plugin",body:e}),getPlugins:async()=>await n.get({url:"/api/plugin"}),deletePlugin:async e=>await n.delete({url:`/api/plugin/${e}`})}),E2e=n=>({searchBackups:async({appId:e,trigger:t,type:r,page:i,startDate:a,endDate:o})=>{const l={};return i&&(l.page=i),t&&r&&(l.trigger=t.toLowerCase(),l.type=r.toLowerCase()),a&&o&&(l.startDate=a,l.endDate=o),await n.post({url:`/api/apps/${e}/backups/search`,body:l})},createManualBackup:async({appId:e,name:t})=>await n.post({url:`/api/apps/${e}/backups`,body:{name:t}}),deleteBackup:async({appId:e,backupId:t})=>await n.delete({url:`/api/apps/${e}/backups/${t}`}),updateBackup:async({appId:e,backupId:t,name:r})=>await n.patch({url:`/api/apps/${e}/backups/${t}`,body:{name:r}}),restoreBackup:async({appId:e,backupId:t,name:r})=>await n.post({url:`/api/apps/${e}/backups/${t}/import`,body:{name:r}})}),T2e={enableCaching:!1,attachHeaders:null,onError:null},D2e=n=>{n={...T2e,...n};let e={};const t=async(s,u)=>{let c=s.statusText,f=null;try{f=await s.json(),f!=null&&f.message?c=f.message:f!=null&&f.error&&(c=f.error)}catch{}return{message:c,json:f,status:s.status,url:s.url,method:u,handled:!0}},r=(s,u)=>({message:s,json:null,status:400,url:u==null?void 0:u.url,method:u==null?void 0:u.method,handled:!0}),i=async({method:s,url:u,body:c,json:f=!0,external:h=!1,parseResponse:m})=>{f=f&&s!=="GET";let _={Accept:"application/json"};h||(_["x-budibase-api-version"]=DG),f&&(_["Content-Type"]="application/json"),n!=null&&n.attachHeaders&&n.attachHeaders(_);let y=c;if(f)try{y=JSON.stringify(c)}catch{throw r("Invalid JSON body",{url:u,method:s})}let w;try{w=await fetch(u,{method:s,headers:_,body:y,credentials:"same-origin"})}catch{throw delete e[u],r("Failed to send request",{url:u,method:s})}if(w.status>=200&&w.status<400)try{return m?await m(w):await w.json()}catch{return delete e[u],null}else throw delete e[u],await t(w,s)},a=async s=>{const u=s.url;return u?(e[u]||(e[u]=i(s),e[u]=await e[u]),await e[u]):null},o=s=>async u=>{try{let{url:c,cache:f=!1,external:h=!1}=u;h||(c=`/${c}`.replace("//","/"));const _=f&&(n==null?void 0:n.enableCaching)?a:i,y={...u,method:s,url:c};return await _(y)}catch(c){throw n!=null&&n.onError&&n.onError(c),c}};let l={post:o("POST"),get:o("GET"),patch:o("PATCH"),delete:o("DELETE"),put:o("PUT"),error:s=>{throw r(s)},invalidateCache:()=>{e={}}};return{...l,...i2e(l),...a2e(l),...o2e(l),...l2e(l),...s2e(l),...u2e(l),...c2e(l),...f2e(l),...p2e(l),...d2e(l),...h2e(l),...m2e(l),...g2e(l),...v2e(l),..._2e(l),...b2e(l),...y2e(l),...$2e(l),...w2e(l),...k2e(l),...z2e(l),...M2e(l),...A2e(l),...C2e(l),...S2e(l),...L2e(l),...E2e(l)}};var R$={exports:{}};/**
|
|
344
344
|
* @license
|
|
345
345
|
* Lodash <https://lodash.com/>
|
|
346
346
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -422,7 +422,7 @@ Event: `+pd(e)),!0):this._isIgnoredError(e,t)?(Oo.warn("Event dropped due to bei
|
|
|
422
422
|
Url: `+this._getEventFilterUrl(e)),!0):this._isAllowedUrl(e,t)?!1:(Oo.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+pd(e)+`.
|
|
423
423
|
Url: `+this._getEventFilterUrl(e)),!0)},n.prototype._isSentryError=function(e,t){if(!t.ignoreInternal)return!1;try{return e&&e.exception&&e.exception.values&&e.exception.values[0]&&e.exception.values[0].type==="SentryError"||!1}catch{return!1}},n.prototype._isIgnoredError=function(e,t){return!t.ignoreErrors||!t.ignoreErrors.length?!1:this._getPossibleEventMessages(e).some(function(r){return t.ignoreErrors.some(function(i){return dy(r,i)})})},n.prototype._isDeniedUrl=function(e,t){if(!t.denyUrls||!t.denyUrls.length)return!1;var r=this._getEventFilterUrl(e);return r?t.denyUrls.some(function(i){return dy(r,i)}):!1},n.prototype._isAllowedUrl=function(e,t){if(!t.allowUrls||!t.allowUrls.length)return!0;var r=this._getEventFilterUrl(e);return r?t.allowUrls.some(function(i){return dy(r,i)}):!0},n.prototype._mergeOptions=function(e){return e===void 0&&(e={}),{allowUrls:hl(this._options.whitelistUrls||[],this._options.allowUrls||[],e.whitelistUrls||[],e.allowUrls||[]),denyUrls:hl(this._options.blacklistUrls||[],this._options.denyUrls||[],e.blacklistUrls||[],e.denyUrls||[]),ignoreErrors:hl(this._options.ignoreErrors||[],e.ignoreErrors||[],j3e),ignoreInternal:typeof this._options.ignoreInternal<"u"?this._options.ignoreInternal:!0}},n.prototype._getPossibleEventMessages=function(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},r=t.type,i=r===void 0?"":r,a=t.value,o=a===void 0?"":a;return[""+o,i+": "+o]}catch{return Oo.error("Cannot extract message for event "+pd(e)),[]}return[]},n.prototype._getEventFilterUrl=function(e){try{if(e.stacktrace){var t=e.stacktrace.frames;return t&&t[t.length-1].filename||null}if(e.exception){var r=e.exception.values&&e.exception.values[0].stacktrace&&e.exception.values[0].stacktrace.frames;return r&&r[r.length-1].filename||null}return null}catch{return Oo.error("Cannot extract url for event "+pd(e)),null}},n.id="InboundFilters",n}(),vg="?",U3e=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,q3e=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,W3e=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,G3e=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Y3e=/\((\S*)(?::(\d+))(?::(\d+))\)/;function i7(n){var e=null,t=n&&n.framesToPop;try{if(e=X3e(n),e)return tT(e,t)}catch{}try{if(e=K3e(n),e)return tT(e,t)}catch{}return{message:Xk(n),name:n&&n.name,stack:[],failed:!0}}function K3e(n){if(!n||!n.stack)return null;for(var e=[],t=n.stack.split(`
|
|
424
424
|
`),r,i,a,o,l=0;l<t.length;++l){if(a=U3e.exec(t[l])){var s=a[2]&&a[2].indexOf("native")===0;r=a[2]&&a[2].indexOf("eval")===0,r&&(i=Y3e.exec(a[2]))&&(a[2]=i[1],a[3]=i[2],a[4]=i[3]),o={url:a[2]&&a[2].indexOf("address at ")===0?a[2].substr(11):a[2],func:a[1]||vg,args:s?[a[2]]:[],line:a[3]?+a[3]:null,column:a[4]?+a[4]:null}}else if(a=W3e.exec(t[l]))o={url:a[2],func:a[1]||vg,args:[],line:+a[3],column:a[4]?+a[4]:null};else if(a=q3e.exec(t[l]))r=a[3]&&a[3].indexOf(" > eval")>-1,r&&(i=G3e.exec(a[3]))?(a[1]=a[1]||"eval",a[3]=i[1],a[4]=i[2],a[5]=""):l===0&&!a[5]&&n.columnNumber!==void 0&&(e[0].column=n.columnNumber+1),o={url:a[3],func:a[1]||vg,args:a[2]?a[2].split(","):[],line:a[4]?+a[4]:null,column:a[5]?+a[5]:null};else continue;!o.func&&o.line&&(o.func=vg),e.push(o)}return e.length?{message:Xk(n),name:n.name,stack:e}:null}function X3e(n){if(!n||!n.stacktrace)return null;for(var e=n.stacktrace,t=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,r=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,i=e.split(`
|
|
425
|
-
`),a=[],o,l=0;l<i.length;l+=2){var s=null;(o=t.exec(i[l]))?s={url:o[2],func:o[3],args:[],line:+o[1],column:null}:(o=r.exec(i[l]))&&(s={url:o[6],func:o[3]||o[4],args:o[5]?o[5].split(","):[],line:+o[1],column:+o[2]}),s&&(!s.func&&s.line&&(s.func=vg),a.push(s))}return a.length?{message:Xk(n),name:n.name,stack:a}:null}function tT(n,e){try{return Wi({},n,{stack:n.stack.slice(e)})}catch{return n}}function Xk(n){var e=n&&n.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}var J3e=50;function CY(n){var e=Jk(n.stack),t={type:n.name,value:n.message};return e&&e.length&&(t.stacktrace={frames:e}),t.type===void 0&&t.value===""&&(t.value="Unrecoverable error caught"),t}function Z3e(n,e,t){var r={exception:{values:[{type:jk(n)?n.constructor.name:t?"UnhandledRejection":"Error",value:"Non-Error "+(t?"promise rejection":"exception")+" captured with keys: "+p3e(n)}]},extra:{__serialized__:_Y(n)}};if(e){var i=i7(e),a=Jk(i.stack);r.stacktrace={frames:a}}return r}function nT(n){var e=CY(n);return{exception:{values:[e]}}}function Jk(n){if(!n||!n.length)return[];var e=n,t=e[0].func||"",r=e[e.length-1].func||"";return(t.indexOf("captureMessage")!==-1||t.indexOf("captureException")!==-1)&&(e=e.slice(1)),r.indexOf("sentryWrapped")!==-1&&(e=e.slice(0,-1)),e.slice(0,J3e).map(function(i){return{colno:i.column===null?void 0:i.column,filename:i.url||e[0].url,function:i.func||"?",in_app:!0,lineno:i.line===null?void 0:i.line}}).reverse()}function Z$(n,e,t){t===void 0&&(t={});var r;if(mY(n)&&n.error){var i=n;return n=i.error,r=nT(i7(n)),r}if(jE(n)||Qfe(n)){var a=n,o=a.name||(jE(a)?"DOMError":"DOMException"),l=a.message?o+": "+a.message:o;return r=Q$(l,e,t),X$(r,l),r}if(hY(n))return r=nT(i7(n)),r;if(Fk(n)||jk(n)){var s=n;return r=Z3e(s,e,t.rejection),s6(r,{synthetic:!0}),r}return r=Q$(n,e,t),X$(r,""+n,void 0),s6(r,{synthetic:!0}),r}function Q$(n,e,t){t===void 0&&(t={});var r={message:n};if(t.attachStacktrace&&e){var i=i7(e),a=Jk(i.stack);r.stacktrace={frames:a}}return r}var SY=function(){function n(e){this.options=e,this._buffer=new d3e(30),this._api=new AY(this.options.dsn),this.url=this._api.getStoreEndpointWithUrlEncodedAuth()}return n.prototype.sendEvent=function(e){throw new r5("Transport Class has to implement `sendEvent` method")},n.prototype.close=function(e){return this._buffer.drain(e)},n}(),Q3e=Fu(),e4e=function(n){B7(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._disabledUntil=new Date(Date.now()),t}return e.prototype.sendEvent=function(t){var r=this;if(new Date(Date.now())<this._disabledUntil)return Promise.reject({event:t,reason:"Transport locked till "+this._disabledUntil+" due to too many requests.",status:429});var i=MY(t,this._api),a={body:i.body,method:"POST",referrerPolicy:m3e()?"origin":""};return this.options.fetchParameters!==void 0&&Object.assign(a,this.options.fetchParameters),this.options.headers!==void 0&&(a.headers=this.options.headers),this._buffer.add(new s2(function(o,l){Q3e.fetch(i.url,a).then(function(s){var u=B3.fromHttpCode(s.status);if(u===B3.Success){o({status:u});return}if(u===B3.RateLimit){var c=Date.now();r._disabledUntil=new Date(c+gY(c,s.headers.get("Retry-After"))),Oo.warn("Too many requests, backing off till: "+r._disabledUntil)}l(s)}).catch(l)}))},e}(SY),t4e=function(n){B7(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._disabledUntil=new Date(Date.now()),t}return e.prototype.sendEvent=function(t){var r=this;if(new Date(Date.now())<this._disabledUntil)return Promise.reject({event:t,reason:"Transport locked till "+this._disabledUntil+" due to too many requests.",status:429});var i=MY(t,this._api);return this._buffer.add(new s2(function(a,o){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(l.readyState===4){var u=B3.fromHttpCode(l.status);if(u===B3.Success){a({status:u});return}if(u===B3.RateLimit){var c=Date.now();r._disabledUntil=new Date(c+gY(c,l.getResponseHeader("Retry-After"))),Oo.warn("Too many requests, backing off till: "+r._disabledUntil)}o(l)}},l.open("POST",i.url);for(var s in r.options.headers)r.options.headers.hasOwnProperty(s)&&l.setRequestHeader(s,r.options.headers[s]);l.send(i.body)}))},e}(SY),n4e=function(n){B7(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype._setupTransport=function(){if(!this._options.dsn)return n.prototype._setupTransport.call(this);var t=Wi({},this._options.transportOptions,{dsn:this._options.dsn});return this._options.transport?new this._options.transport(t):qk()?new e4e(t):new t4e(t)},e.prototype.eventFromException=function(t,r){var i=r&&r.syntheticException||void 0,a=Z$(t,i,{attachStacktrace:this._options.attachStacktrace});return s6(a,{handled:!0,type:"generic"}),a.level=d5.Error,r&&r.event_id&&(a.event_id=r.event_id),s2.resolve(a)},e.prototype.eventFromMessage=function(t,r,i){r===void 0&&(r=d5.Info);var a=i&&i.syntheticException||void 0,o=Q$(t,a,{attachStacktrace:this._options.attachStacktrace});return o.level=r,i&&i.event_id&&(o.event_id=i.event_id),s2.resolve(o)},e}(R3e),ew=0;function rT(){return ew>0}function r4e(){ew+=1,setTimeout(function(){ew-=1})}function Sh(n,e,t){if(e===void 0&&(e={}),typeof n!="function")return n;try{if(n.__sentry__)return n;if(n.__sentry_wrapped__)return n.__sentry_wrapped__}catch{return n}var r=function(){var o=Array.prototype.slice.call(arguments);try{t&&typeof t=="function"&&t.apply(this,arguments);var l=o.map(function(s){return Sh(s,e)});return n.handleEvent?n.handleEvent.apply(this,l):n.apply(this,l)}catch(s){throw r4e(),B3e(function(u){u.addEventProcessor(function(c){var f=Wi({},c);return e.mechanism&&(X$(f,void 0,void 0),s6(f,e.mechanism)),f.extra=Wi({},f.extra,{arguments:o}),f}),zY(s)}),s}};try{for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}catch{}n.prototype=n.prototype||{},r.prototype=n.prototype,Object.defineProperty(n,"__sentry_wrapped__",{enumerable:!1,value:r}),Object.defineProperties(r,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:n}});try{var a=Object.getOwnPropertyDescriptor(r,"name");a.configurable&&Object.defineProperty(r,"name",{get:function(){return n.name}})}catch{}return r}var i4e=function(){function n(e){this.name=n.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._options=Wi({onerror:!0,onunhandledrejection:!0},e)}return n.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(Oo.log("Global Handler attached: onerror"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(Oo.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler())},n.prototype._installGlobalOnErrorHandler=function(){var e=this;this._onErrorHandlerInstalled||(gd({callback:function(t){var r=t.error,i=l2(),a=i.getIntegration(n),o=r&&r.__sentry_own_request__===!0;if(!(!a||rT()||o)){var l=i.getClient(),s=r7(r)?e._eventFromIncompleteOnError(t.msg,t.url,t.line,t.column):e._enhanceEventWithInitialFrame(Z$(r,void 0,{attachStacktrace:l&&l.getOptions().attachStacktrace,rejection:!1}),t.url,t.line,t.column);s6(s,{handled:!1,type:"onerror"}),i.captureEvent(s,{originalException:r})}},type:"error"}),this._onErrorHandlerInstalled=!0)},n.prototype._installGlobalOnUnhandledRejectionHandler=function(){var e=this;this._onUnhandledRejectionHandlerInstalled||(gd({callback:function(t){var r=t;try{"reason"in t?r=t.reason:"detail"in t&&"reason"in t.detail&&(r=t.detail.reason)}catch{}var i=l2(),a=i.getIntegration(n),o=r&&r.__sentry_own_request__===!0;if(!a||rT()||o)return!0;var l=i.getClient(),s=r7(r)?e._eventFromIncompleteRejection(r):Z$(r,void 0,{attachStacktrace:l&&l.getOptions().attachStacktrace,rejection:!0});s.level=d5.Error,s6(s,{handled:!1,type:"onunhandledrejection"}),i.captureEvent(s,{originalException:r})},type:"unhandledrejection"}),this._onUnhandledRejectionHandlerInstalled=!0)},n.prototype._eventFromIncompleteOnError=function(e,t,r,i){var a=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,o=mY(e)?e.message:e,l;if(l6(o)){var s=o.match(a);s&&(l=s[1],o=s[2])}var u={exception:{values:[{type:l||"Error",value:o}]}};return this._enhanceEventWithInitialFrame(u,t,r,i)},n.prototype._eventFromIncompleteRejection=function(e){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+e}]}}},n.prototype._enhanceEventWithInitialFrame=function(e,t,r,i){e.exception=e.exception||{},e.exception.values=e.exception.values||[],e.exception.values[0]=e.exception.values[0]||{},e.exception.values[0].stacktrace=e.exception.values[0].stacktrace||{},e.exception.values[0].stacktrace.frames=e.exception.values[0].stacktrace.frames||[];var a=isNaN(parseInt(i,10))?void 0:i,o=isNaN(parseInt(r,10))?void 0:r,l=l6(t)&&t.length>0?t:i3e();return e.exception.values[0].stacktrace.frames.length===0&&e.exception.values[0].stacktrace.frames.push({colno:a,filename:l,function:"?",in_app:!0,lineno:o}),e},n.id="GlobalHandlers",n}(),a4e=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],o4e=function(){function n(e){this.name=n.id,this._options=Wi({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}return n.prototype._wrapTimeFunction=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=t[0];return t[0]=Sh(i,{mechanism:{data:{function:K5(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}},n.prototype._wrapRAF=function(e){return function(t){return e.call(this,Sh(t,{mechanism:{data:{function:"requestAnimationFrame",handler:K5(e)},handled:!0,type:"instrument"}}))}},n.prototype._wrapEventTarget=function(e){var t=Fu(),r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(nu(r,"addEventListener",function(i){return function(a,o,l){try{typeof o.handleEvent=="function"&&(o.handleEvent=Sh(o.handleEvent.bind(o),{mechanism:{data:{function:"handleEvent",handler:K5(o),target:e},handled:!0,type:"instrument"}}))}catch{}return i.call(this,a,Sh(o,{mechanism:{data:{function:"addEventListener",handler:K5(o),target:e},handled:!0,type:"instrument"}}),l)}}),nu(r,"removeEventListener",function(i){return function(a,o,l){var s=o;try{s&&s.__sentry__&&i.call(this,a,s.__sentry_original__,l)}catch{}return i.call(this,a,s,l)}}))},n.prototype._wrapXHR=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,a=["onload","onerror","onprogress","onreadystatechange"];return a.forEach(function(o){o in i&&typeof i[o]=="function"&&nu(i,o,function(l){var s={mechanism:{data:{function:o,handler:K5(l)},handled:!0,type:"instrument"}};return l.__sentry_original__&&(s.mechanism.data.handler=K5(l.__sentry_original__)),Sh(l,s)})}),e.apply(this,t)}},n.prototype.setupOnce=function(){var e=Fu();if(this._options.setTimeout&&nu(e,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&nu(e,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&nu(e,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&nu(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget){var t=Array.isArray(this._options.eventTarget)?this._options.eventTarget:a4e;t.forEach(this._wrapEventTarget.bind(this))}},n.id="TryCatch",n}(),LY=function(){function n(e){this.name=n.id,this._options=Wi({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}return n.prototype.addSentryBreadcrumb=function(e){!this._options.sentry||l2().addBreadcrumb({category:"sentry."+(e.type==="transaction"?"transaction":"event"),event_id:e.event_id,level:e.level,message:pd(e)},{event:e})},n.prototype._consoleBreadcrumb=function(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:d5.fromString(e.level),message:UE(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)t.message="Assertion failed: "+(UE(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1);else return;l2().addBreadcrumb(t,{input:e.args,level:e.level})},n.prototype._domBreadcrumb=function(e){var t;try{t=e.event.target?Hv(e.event.target):Hv(e.event)}catch{t="<unknown>"}t.length!==0&&l2().addBreadcrumb({category:"ui."+e.name,message:t},{event:e.event,name:e.name})},n.prototype._xhrBreadcrumb=function(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;l2().addBreadcrumb({category:"xhr",data:e.xhr.__sentry_xhr__,type:"http"},{xhr:e.xhr});return}},n.prototype._fetchBreadcrumb=function(e){!e.endTimestamp||e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"||(e.error?l2().addBreadcrumb({category:"fetch",data:e.fetchData,level:d5.Error,type:"http"},{data:e.error,input:e.args}):l2().addBreadcrumb({category:"fetch",data:Wi({},e.fetchData,{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response}))},n.prototype._historyBreadcrumb=function(e){var t=Fu(),r=e.from,i=e.to,a=hy(t.location.href),o=hy(r),l=hy(i);o.path||(o=a),a.protocol===l.protocol&&a.host===l.host&&(i=l.relative),a.protocol===o.protocol&&a.host===o.host&&(r=o.relative),l2().addBreadcrumb({category:"navigation",data:{from:r,to:i}})},n.prototype.setupOnce=function(){var e=this;this._options.console&&gd({callback:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e._consoleBreadcrumb.apply(e,hl(t))},type:"console"}),this._options.dom&&gd({callback:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e._domBreadcrumb.apply(e,hl(t))},type:"dom"}),this._options.xhr&&gd({callback:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e._xhrBreadcrumb.apply(e,hl(t))},type:"xhr"}),this._options.fetch&&gd({callback:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e._fetchBreadcrumb.apply(e,hl(t))},type:"fetch"}),this._options.history&&gd({callback:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e._historyBreadcrumb.apply(e,hl(t))},type:"history"})},n.id="Breadcrumbs",n}(),l4e="cause",s4e=5,u4e=function(){function n(e){e===void 0&&(e={}),this.name=n.id,this._key=e.key||l4e,this._limit=e.limit||s4e}return n.prototype.setupOnce=function(){x_(function(e,t){var r=l2().getIntegration(n);return r?r._handler(e,t):e})},n.prototype._handler=function(e,t){if(!e.exception||!e.exception.values||!t||!cp(t.originalException,Error))return e;var r=this._walkErrorTree(t.originalException,this._key);return e.exception.values=hl(r,e.exception.values),e},n.prototype._walkErrorTree=function(e,t,r){if(r===void 0&&(r=[]),!cp(e[t],Error)||r.length+1>=this._limit)return r;var i=i7(e[t]),a=CY(i);return this._walkErrorTree(e[t],t,hl([a],r))},n.id="LinkedErrors",n}(),y9=Fu(),c4e=function(){function n(){this.name=n.id}return n.prototype.setupOnce=function(){x_(function(e){if(l2().getIntegration(n)){if(!y9.navigator||!y9.location)return e;var t=e.request||{};return t.url=t.url||y9.location.href,t.headers=t.headers||{},t.headers["User-Agent"]=y9.navigator.userAgent,Wi({},e,{request:t})}return e})},n.id="UserAgent",n}(),f4e="sentry.javascript.browser",iT="5.19.1",p4e=function(n){B7(e,n);function e(t){return t===void 0&&(t={}),n.call(this,n4e,t)||this}return e.prototype._prepareEvent=function(t,r,i){return t.platform=t.platform||"javascript",t.sdk=Wi({},t.sdk,{name:f4e,packages:hl(t.sdk&&t.sdk.packages||[],[{name:"npm:@sentry/browser",version:iT}]),version:iT}),n.prototype._prepareEvent.call(this,t,r,i)},e.prototype._sendEvent=function(t){var r=this.getIntegration(LY);r&&r.addSentryBreadcrumb(t),n.prototype._sendEvent.call(this,t)},e.prototype.showReportDialog=function(t){t===void 0&&(t={});var r=Fu().document;if(!!r){if(!this._isEnabled()){Oo.error("Trying to call showReportDialog with Sentry Client is disabled");return}var i=t.dsn||this.getDsn();if(!t.eventId){Oo.error("Missing `eventId` option in showReportDialog call");return}if(!i){Oo.error("Missing `Dsn` option in showReportDialog call");return}var a=r.createElement("script");a.async=!0,a.src=new AY(i).getReportDialogEndpoint(t),t.onLoad&&(a.onload=t.onLoad),(r.head||r.body).appendChild(a)}},e}(P3e),d4e=[new x3e,new F3e,new o4e,new LY,new i4e,new u4e,new c4e];function h4e(n){if(n===void 0&&(n={}),n.defaultIntegrations===void 0&&(n.defaultIntegrations=d4e),n.release===void 0){var e=Fu();e.SENTRY_RELEASE&&e.SENTRY_RELEASE.id&&(n.release=e.SENTRY_RELEASE.id)}N3e(p4e,n)}class m4e{constructor(e){this.dsn=e}init(){this.dsn&&(h4e({dsn:this.dsn}),this.initalised=!0)}captureException(e){!this.initalised||zY(e)}identify(e){!this.initalised||D3e(t=>{t.setUser({id:e})})}}const $9=new Gfe(void 0),wy=new m4e(void 0),w9=new Yfe("qz2sxfuv");class g4e{constructor(){this.clients=[$9,wy,w9]}async activate(){(await Zt.getAnalyticsStatus()).enabled&&this.clients.forEach(t=>t.init())}identify(e){$9.identify(e),wy.identify(e)}captureException(e){wy.captureException(e)}captureEvent(e,t={}){$9.captureEvent(e,t),w9.captureEvent(e,t)}showChat(e){w9.show(e)}async logout(){$9.logout(),w9.logout()}}const np=new g4e,ru=(n,e)=>EY(n,t=>t._id===e),vc=(n,e,t)=>{if(!n||!e)return null;if(n._id===e)return t;if(!n._children)return null;for(const r of n._children){const i=vc(r,e,n);if(i)return i}return null},T4=(n,e,t=[])=>{if(!n||!e)return[];if(n._id===e)return[...t,n];if(!n._children)return[];for(const r of n._children){const i=[...t,n],a=T4(r,e,i);if(a!=null&&a.length)return a}return[]},h5=(n,e)=>{if(!n||!e)return[];let t=[];return n._children&&n._children.forEach(r=>{t=[...t,...h5(r,e)]}),e(n)&&t.push(n),t.reverse()},q_=(n,e,t)=>{if(!t)return null;const r=T4(n,e).reverse();for(let i of r)if(t(i))return i;return null},EY=(n,e)=>{if(!n||!e)return null;if(e(n))return n;if(!n._children)return null;for(const t of n._children){const r=EY(t,e);if(r)return r}return null};let ky={};const D6=n=>{var r,i,a;if(!n)return[];if(!n.startsWith("plugin/")&&!n.startsWith("@budibase")&&(n=`@budibase/standard-components/${n}`),ky[n])return ky[n];const e=Xt.actions.components.getDefinition(n);let t=[];return e&&(t=(i=(r=e.settings)==null?void 0:r.filter(o=>!o.section))!=null?i:[],(a=e.settings)==null||a.filter(o=>o.section).forEach(o=>{t=t.concat(o.settings||[])})),ky[n]=t,t},Iv=n=>{var a;if(!n)return;const e=n._id,t=C4();let r=JSON.stringify(n);return r=r.replace(new RegExp(e,"g"),t),_G(r).forEach(o=>{let l=o.replace(/\\"/g,'"'),s=t6(l);if(s!=null){s=s.replace(new RegExp(e,"g"),t);let u=Dh(s);u=u.replace(/"/g,'\\"'),r=r.replace(o,u)}}),n=JSON.parse(r),{...n,_children:(a=n._children)==null?void 0:a.map(Iv)}},zy={apps:[],name:"",url:"",description:"",layouts:[],screens:[],components:[],clientFeatures:{spectrumThemes:!1,intelligentLoading:!1,deviceAwareness:!1,state:!1,rowSelection:!1,customThemes:!1,devicePreview:!1,messagePassing:!1,continueIfAction:!1,showNotificationAction:!1},errors:[],hasAppPackage:!1,libraries:null,appId:"",routes:{},clientLibPath:"",theme:"",customTheme:{},previewDevice:"desktop",highlightedSettingKey:null,selectedScreenId:null,selectedComponentId:null,selectedLayoutId:null},v4e=()=>{const n=gi({...zy}),e=xG(async(t,r)=>{const a=pn(n).screens.find(s=>s._id===r);if(!a)return;let o=$1.cloneDeep(a);if(t(o)!==!1)return await n.actions.screens.save(o)});return n.actions={reset:()=>{n.set({...zy})},initialise:async t=>{const{layouts:r,screens:i,application:a,clientLibPath:o}=t;await n.actions.components.refreshDefinitions(a.appId),n.update(l=>({...l,libraries:a.componentLibraries,name:a.name,description:a.description,appId:a.appId,url:a.url,layouts:r||[],screens:i||[],theme:a.theme||"spectrum--light",customTheme:a.customTheme,hasAppPackage:!0,appInstance:a.instance,clientLibPath:o,previousTopNavPath:{},version:a.version,revertableVersion:a.revertableVersion,navigation:a.navigation||{},usedPlugins:a.usedPlugins||[]})),Wd.set(a.instance),await Bi.init(),await z5.init(),await ya.init(),await Br.init()},theme:{save:async t=>{const r=pn(n).appId,i=await Zt.saveAppMetadata({appId:r,metadata:{theme:t}});n.update(a=>(a.theme=i.theme,a))}},customTheme:{save:async t=>{const r=pn(n).appId,i=await Zt.saveAppMetadata({appId:r,metadata:{customTheme:t}});n.update(a=>(a.customTheme=i.customTheme,a))}},navigation:{save:async t=>{const r=pn(n).appId,i=await Zt.saveAppMetadata({appId:r,metadata:{navigation:t}});n.update(a=>(a.navigation=i.navigation,a))}},screens:{select:t=>{var a;const r=pn(n),i=r.screens.find(o=>o._id===t);!i||r.selectedScreenId===i._id&&r.selectedComponentId===((a=i.props)==null?void 0:a._id)||n.update(o=>{var l;return o.selectedScreenId=i._id,o.selectedComponentId=(l=i.props)==null?void 0:l._id,o})},validate:t=>{const r=(a,o=[],l=[])=>{var c,f,h;const s=a._component;if(o.includes(s)||l.length&&!l.includes(s))return s;if(!((c=a==null?void 0:a._children)!=null&&c.length))return;const u=n.actions.components.getDefinition(a._component);if(l=[],(f=u==null?void 0:u.legalDirectChildren)!=null&&f.length&&(l=u.legalDirectChildren.map(m=>`@budibase/standard-components/${m}`)),(h=u==null?void 0:u.illegalChildren)!=null&&h.length){const m=u.illegalChildren.map(_=>`@budibase/standard-components/${_}`);o=[...new Set([...o,...m])]}for(let m of a._children){const _=r(m,o,l);if(_)return _}},i=r(t.props);if(i)throw`You can't place a ${n.actions.components.getDefinition(i).name} here`},save:async t=>{n.actions.screens.validate(t);const r=pn(n),i=t._id===void 0,a=await Zt.saveScreen(t),o=await Zt.fetchAppRoutes();let l=r.usedPlugins;if(a.pluginAdded){const{application:s}=await Zt.fetchAppPackage(r.appId);l=s.usedPlugins||[]}return n.update(s=>{const u=s.screens.findIndex(c=>c._id===a._id);return u!==-1?s.screens.splice(u,1,a):s.screens.push(a),i&&(s.selectedScreenId=a._id,s.selectedComponentId=a.props._id),s.routes=o.routes,s.usedPlugins=l,s}),a},patch:async(t,r)=>{if(r||(r=pn(n).selectedScreenId),!(!r||!t))return await e(t,r)},delete:async t=>{const r=Array.isArray(t)?t:[t],i=[];let a=[];r.forEach(s=>{i.push(Zt.deleteScreen({screenId:s._id,screenRev:s._rev})),a.push(s.routing.route)}),i.push(n.actions.links.delete(a)),await Promise.all(i);const o=r.map(s=>s._id),l=await Zt.fetchAppRoutes();n.update(s=>(s.screens=s.screens.filter(u=>!o.includes(u._id)),o.includes(s.selectedScreenId)&&(s.selectedScreenId=null,s.selectedComponentId=null),s.routes=l.routes,s))},updateSetting:async(t,r,i)=>{if(!t||!r)return;const a=u=>{if(!u||Xh(u,r)===i)return!1;ite(u,r,i)};await n.actions.screens.patch(a,t._id);const o=pn(n),l=o.screens.find(u=>u._id===t._id);if(!l)return;const s=o.screens.filter(u=>u.routing.roleId===l.routing.roleId&&u.routing.homeScreen&&u._id!==t._id);if(s.length){const u=c=>{c.routing.homeScreen=!1};for(let c of s)await n.actions.screens.patch(u,c._id)}},removeCustomLayout:async t=>{const r=pn(n).layouts.find(a=>a._id===t.layoutId),i=a=>{a.layoutId=null,a.showNavigation=(r==null?void 0:r.props.navigation)!=="None",a.width=(r==null?void 0:r.props.width)||"Large"};await n.actions.screens.patch(i,t._id)}},preview:{setDevice:t=>{n.update(r=>(r.previewDevice=t,r))},sendEvent:(t,r)=>{const{previewEventHandler:i}=pn(n);i==null||i(t,r)},registerEventHandler:t=>{n.update(r=>(r.previewEventHandler=t,r))}},layouts:{select:t=>{var a;const r=pn(n),i=r.layouts.find(o=>o._id===t);!i||r.selectedLayoutId===i._id&&r.selectedComponentId===((a=i.props)==null?void 0:a._id)||n.update(o=>{var l;return o.selectedLayoutId=i._id,o.selectedComponentId=(l=i.props)==null?void 0:l._id,o})},delete:async t=>{!(t!=null&&t._id)||(await Zt.deleteLayout({layoutId:t._id,layoutRev:t._rev}),n.update(r=>(r.layouts=r.layouts.filter(i=>i._id!==t._id),r)))}},components:{refreshDefinitions:async t=>{t||(t=pn(n).appId);const r=await Zt.fetchComponentLibDefinitions(t),i=Object.keys(r).filter(a=>a.startsWith("plugin/"));n.update(a=>({...a,components:r,customComponents:i,clientFeatures:{...zy.clientFeatures,...r.features}}))},getDefinition:t=>t?pn(n).components[t]:null,createInstance:(t,r)=>{const i=n.actions.components.getDefinition(t);if(!i)return null;const a=D6(t);let o={...r};a.forEach(s=>{s.defaultValue!==void 0&&(o[s.key]=s.defaultValue)});let l={};if(i.hasChildren&&(l._children=[]),t.endsWith("/formstep")){const s=q_(pn(ja).props,pn(I3)._id,c=>c._component.endsWith("/form")),u=h5(s,c=>c._component.endsWith("/formstep"));l.step=u.length+1,l._instanceName=`Step ${u.length+1}`}return{_id:C4(),_component:i.component,_styles:{normal:{},hover:{},active:{}},_instanceName:`New ${i.friendlyName||i.name}`,...$1.cloneDeep(o),...l}},create:async(t,r,i,a)=>{const o=pn(n),l=n.actions.components.createInstance(t,r);if(!!l)return i&&a!=null?await n.actions.screens.patch(s=>{var c;let u=ru(s.props,i);(c=u._children)!=null&&c.length?u._children.splice(a,0,l):u._children=[l]}):await n.actions.screens.patch(s=>{const u=ru(s.props,o.selectedComponentId);if(!u)return!1;let c;if(u){const f=n.actions.components.getDefinition(u._component);f!=null&&f.hasChildren?c=u:c=vc(s.props,u._id)}else c=s.props;if(!c)return!1;c._children||(c._children=[]),c._children.push(l)}),n.update(s=>(s.selectedComponentId=l._id,s)),np.captureEvent(o6.COMPONENT_CREATED,{name:l._component}),l},patch:async(t,r,i)=>{if(!r||!i){const o=pn(n);r=r||o.selectedComponentId,i=i||o.selectedScreenId}if(!r||!i||!t)return;const a=o=>{let l=ru(o.props,r);return l?t(l,o):!1};await n.actions.screens.patch(a,i)},delete:async t=>{if(!t)return;const r=pn(n);let i;r.selectedComponentId===t._id&&(i=n.actions.components.getNext(),i||(i=n.actions.components.getPrevious())),await n.actions.screens.patch(a=>{if(t=ru(a.props,t._id),!t)return!1;const o=vc(a.props,t._id);if(!o)return!1;o._children=o._children.filter(l=>l._id!==t._id)}),i&&n.update(a=>(a.selectedComponentId=i,a))},copy:(t,r=!1,i=!0)=>{if(n.update(a=>(a.componentToPaste=$1.cloneDeep(t),a.componentToPaste.isCut=r,a)),r&&i){const a=pn(ja),o=vc(a==null?void 0:a.props,t._id);o&&n.update(l=>(l.selectedComponentId=o._id,l))}},paste:async(t,r,i)=>{const a=pn(n);if(!a.componentToPaste)return;let o,l=$1.cloneDeep(a.componentToPaste);l.isCut&&n.update(c=>(delete c.componentToPaste,c));const s=c=>{if(t=ru(c.props,t._id),!t)return!1;const f=l.isCut,h=l._id;if(delete l.isCut,f||(l=Iv(l)),o=l._id,f){const m=vc(c.props,h);m!=null&&m._children&&(m._children=m._children.filter(_=>_._id!==h))}if(r==="inside"&&(n.actions.components.getDefinition(t._component).hasChildren||(r="below")),r==="inside")t._children||(t._children=[]),t._children.push(l);else{const m=vc(c.props,t._id);if(!(m!=null&&m._children))return!1;const _=m._children.findIndex(w=>w._id===t._id),y=r==="above"?_:_+1;m._children.splice(y,0,l)}},u=(i==null?void 0:i._id)||a.selectedScreenId;await n.actions.screens.patch(s,u),n.update(c=>(c.selectedScreenId=u,c.selectedComponentId=o,c))},getPrevious:()=>{var l,s;const r=pn(n).selectedComponentId,i=pn(ja),a=vc(i.props,r),o=a==null?void 0:a._children.findIndex(u=>u._id===r);if(!a||r===i.props._id)return null;if(o>0){const u=a._children[o-1];if((l=u._children)!=null&&l.length){let c=u;for(;(s=c._children)!=null&&s.length;)c=c._children[c._children.length-1];return c._id}return u._id}return a._id},getNext:()=>{var c,f;const t=pn(I3),r=t==null?void 0:t._id,i=pn(ja),a=vc(i.props,r),o=a==null?void 0:a._children.findIndex(h=>h._id===r);if((c=t._children)!=null&&c.length)return t._children[0]._id;if(!a)return null;if(o<a._children.length-1)return a._children[o+1]._id;let l=a,s=vc(i.props,l._id),u=s==null?void 0:s._children.findIndex(h=>h._id===l._id);for(;s!=null&&u===((f=s._children)==null?void 0:f.length)-1;)l=s,s=vc(i.props,l._id),u=s==null?void 0:s._children.findIndex(h=>h._id===l._id);return s?s._children[u+1]._id:null},selectPrevious:()=>{const t=n.actions.components.getPrevious();t&&n.update(r=>(r.selectedComponentId=t,r))},selectNext:()=>{const t=n.actions.components.getNext();t&&n.update(r=>(r.selectedComponentId=t,r))},moveUp:async t=>{await n.actions.screens.patch(r=>{const i=t==null?void 0:t._id,a=vc(r.props,i),o=a==null?void 0:a._children.findIndex(s=>s._id===i);if(!a||o===0&&a._id===r.props._id)return;const l=$1.cloneDeep(a._children[o]);if(a._children=a._children.filter(s=>s._id!==i),o>0){const s=a._children[o-1];n.actions.components.getDefinition(s._component).hasChildren?s._children.push(l):a._children.splice(o-1,0,l)}else if(a._id!==r.props._id){const s=vc(r.props,a._id),u=s._children.findIndex(c=>c._id===a._id);s._children.splice(u,0,l)}})},moveDown:async t=>{await n.actions.screens.patch(r=>{var s;const i=t==null?void 0:t._id,a=vc(r.props,i);if(!((s=a==null?void 0:a._children)!=null&&s.length))return!1;const o=a._children.findIndex(u=>u._id===i);if(o===a._children.length-1&&a._id===r.props._id)return;const l=$1.cloneDeep(a._children[o]);if(a._children=a._children.filter(u=>u._id!==i),o<a._children.length){const u=a._children[o];n.actions.components.getDefinition(u._component).hasChildren?u._children.splice(0,0,l):a._children.splice(o+1,0,l)}else{const u=vc(r.props,a._id),c=u._children.findIndex(f=>f._id===a._id);u._children.splice(c+1,0,l)}})},updateStyle:async(t,r)=>{await n.actions.components.patch(i=>{r==null||r===""?delete i._styles.normal[t]:i._styles.normal[t]=r})},updateStyles:async(t,r)=>{const i=a=>{a._styles.normal={...a._styles.normal,...t}};await n.actions.components.patch(i,r)},updateCustomStyle:async t=>{await n.actions.components.patch(r=>{r._styles.custom=t})},updateConditions:async t=>{await n.actions.components.patch(r=>{r._conditions=t})},updateSetting:async(t,r)=>{await n.actions.components.patch(i=>{if(!t||!i||i[t]===r)return!1;i[t]=r})},requestEjectBlock:t=>{n.actions.preview.sendEvent("eject-block",t)},handleEjectBlock:async(t,r)=>{let i;await n.actions.screens.patch(a=>{var c;const o=ru(a.props,t),l=vc(a.props,t);if(!o||!((c=l==null?void 0:l._children)!=null&&c.length))return!1;const s=h5(r,f=>f._containsSlot)[0];s&&(delete s._containsSlot,s._children=[...s._children||[],...o._children||[]]),r=Iv(r);const u=l._children.findIndex(f=>f._id===t);l._children[u]=r,i=r._id}),i&&n.update(a=>(a.selectedComponentId=i,a))}},links:{save:async(t,r)=>{const i=pn(n).navigation;let a=[...i==null?void 0:i.links];a.find(o=>o.url===t&&o.text===r)||(a.push({text:r,url:t}),await n.actions.navigation.save({...i,links:[...a]}))},delete:async t=>{const r=pn(n).navigation;let i=r==null?void 0:r.links;!(i!=null&&i.length)||(t=Array.isArray(t)?t:[t],i=i.filter(a=>!t.includes(a.url)),await n.actions.navigation.save({...r,links:i}))}},settings:{highlight:t=>{n.update(r=>({...r,highlightedSettingKey:t}))}},dnd:{start:t=>{n.actions.preview.sendEvent("dragging-new-component",{dragging:!0,component:t})},stop:()=>{n.actions.preview.sendEvent("dragging-new-component",{dragging:!1})}}},n};var c2={exports:{}},TY={exports:{}},Y9=1;function _4e(){return Y9=(Y9*9301+49297)%233280,Y9/233280}function b4e(n){Y9=n}var y4e={nextValue:_4e,seed:b4e},tw=y4e,vd="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-",Z5,aT,_g;function nw(){_g=!1}function DY(n){if(!n){Z5!==vd&&(Z5=vd,nw());return}if(n!==Z5){if(n.length!==vd.length)throw new Error("Custom alphabet for shortid must be "+vd.length+" unique characters. You submitted "+n.length+" characters: "+n);var e=n.split("").filter(function(t,r,i){return r!==i.lastIndexOf(t)});if(e.length)throw new Error("Custom alphabet for shortid must be "+vd.length+" unique characters. These characters were not unique: "+e.join(", "));Z5=n,nw()}}function $4e(n){return DY(n),Z5}function w4e(n){tw.seed(n),aT!==n&&(nw(),aT=n)}function k4e(){Z5||DY(vd);for(var n=Z5.split(""),e=[],t=tw.nextValue(),r;n.length>0;)t=tw.nextValue(),r=Math.floor(t*n.length),e.push(n.splice(r,1)[0]);return e.join("")}function BY(){return _g||(_g=k4e(),_g)}function z4e(n){var e=BY();return e[n]}function A4e(){return Z5||vd}var Zk={get:A4e,characters:$4e,seed:w4e,lookup:z4e,shuffled:BY},Ay=typeof window=="object"&&(window.crypto||window.msCrypto),rw;!Ay||!Ay.getRandomValues?rw=function(n){for(var e=[],t=0;t<n;t++)e.push(Math.floor(Math.random()*256));return e}:rw=function(n){return Ay.getRandomValues(new Uint8Array(n))};var M4e=rw,C4e=function(n,e,t){for(var r=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*r*t/e.length),a="";;)for(var o=n(i),l=i;l--;)if(a+=e[o[l]&r]||"",a.length===+t)return a},S4e=Zk,L4e=M4e,E4e=C4e;function T4e(n){for(var e=0,t,r="";!t;)r=r+E4e(L4e,S4e.get(),1),t=n<Math.pow(16,e+1),e++;return r}var D4e=T4e,k9=D4e,B4e=1567752802062,H4e=7,z9,oT;function O4e(n){var e="",t=Math.floor((Date.now()-B4e)*.001);return t===oT?z9++:(z9=0,oT=t),e=e+k9(H4e),e=e+k9(n),z9>0&&(e=e+k9(z9)),e=e+k9(t),e}var I4e=O4e,P4e=Zk;function V4e(n){if(!n||typeof n!="string"||n.length<6)return!1;var e=new RegExp("[^"+P4e.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]");return!e.test(n)}var R4e=V4e;(function(n){var e=Zk,t=I4e,r=R4e,i=0;function a(u){return e.seed(u),n.exports}function o(u){return i=u,n.exports}function l(u){return u!==void 0&&e.characters(u),e.shuffled()}function s(){return t(i)}n.exports=s,n.exports.generate=s,n.exports.seed=a,n.exports.worker=o,n.exports.characters=l,n.exports.isValid=r})(TY);(function(n){n.exports=TY.exports})(c2);class lT{constructor(e){this.automation=e}hasTrigger(){return this.automation.definition.trigger}addTestData(e){this.automation.testData={...this.automation.testData,...e}}addBlock(e,t){if(!this.hasTrigger()&&e.type==="TRIGGER"){const i={id:c2.exports.generate(),...e};return this.automation.definition.trigger=i,i}const r={id:c2.exports.generate(),...e};return this.automation.definition.steps.splice(t,0,r),r}updateBlock(e,t){const{steps:r,trigger:i}=this.automation.definition;if(i&&i.id===t){this.automation.definition.trigger=e;return}const a=r.findIndex(o=>o.id===t);if(a<0)throw new Error("Block not found.");r.splice(a,1,e),this.automation.definition.steps=r}deleteBlock(e){const{steps:t,trigger:r}=this.automation.definition;if(r&&r.id===e){this.automation.definition.trigger=null;return}const i=t.findIndex(a=>a.id===e);if(i<0)throw new Error("Block not found.");t.splice(i,1),this.automation.definition.steps=t}constructBlock(e,t,r){return{...r,inputs:r.inputs||{},stepId:t,type:e}}}const N4e={automations:[],showTestPanel:!1,blockDefinitions:{TRIGGER:[],ACTION:[]},selectedAutomation:null},F4e=()=>{const n=gi(N4e);return n.actions=j4e(n),n},j4e=n=>({definitions:async()=>{const e=await Zt.getAutomationDefinitions();return n.update(t=>(t.blockDefinitions={TRIGGER:e.trigger,ACTION:e.action},t)),e},fetch:async()=>{const e=await Promise.all([Zt.getAutomations(),Zt.getAutomationDefinitions()]);n.update(t=>{var i;let r=(i=t.selectedAutomation)==null?void 0:i.automation;return t.automations=e[0],t.blockDefinitions={TRIGGER:e[1].trigger,ACTION:e[1].action},r&&(r=e[0].filter(a=>a._id===r._id),t.selectedAutomation=new lT(r[0])),t})},create:async({name:e})=>{const t={name:e,type:"automation",definition:{steps:[]}},r=await Zt.createAutomation(t);n.update(i=>(i.automations=[...i.automations,r.automation],n.actions.select(r.automation),i))},duplicate:async e=>{const t=await Zt.createAutomation({...e,name:`${e.name} - copy`,_id:void 0,_ref:void 0});n.update(r=>(r.automations=[...r.automations,t.automation],n.actions.select(t.automation),r))},save:async e=>{const t=await Zt.updateAutomation(e);n.update(r=>{const i=t.automation,a=r.automations.findIndex(o=>o._id===e._id);if(a!==-1)return r.automations.splice(a,1,i),r.automations=[...r.automations],n.actions.select(i),r})},delete:async e=>{await Zt.deleteAutomation({automationId:e==null?void 0:e._id,automationRev:e==null?void 0:e._rev}),n.update(t=>{const r=t.automations.findIndex(i=>i._id===(e==null?void 0:e._id));return t.automations.splice(r,1),t.automations=[...t.automations],t.selectedAutomation=null,t.selectedBlock=null,t})},test:async(e,t)=>{n.update(i=>(i.selectedAutomation.testResults=null,i));const r=await Zt.testAutomation({automationId:e==null?void 0:e._id,testData:t});n.update(i=>(i.selectedAutomation.testResults=r,i))},select:e=>{n.update(t=>(t.selectedAutomation=new lT($1.cloneDeep(e)),t.selectedBlock=null,t))},getLogs:async({automationId:e,startDate:t,status:r,page:i}={})=>await Zt.getAutomationLogs({automationId:e,startDate:t,status:r,page:i}),clearLogErrors:async({automationId:e,appId:t}={})=>await Zt.clearAutomationLogErrors({automationId:e,appId:t}),addTestDataToAutomation:e=>{n.update(t=>(t.selectedAutomation.addTestData(e),t))},addBlockToAutomation:(e,t)=>{n.update(r=>(r.selectedBlock=r.selectedAutomation.addBlock($1.cloneDeep(e),t),r))},toggleFieldControl:e=>{n.update(t=>(t.selectedBlock.rowControl=e,t))},deleteAutomationBlock:e=>{n.update(t=>{const r=t.selectedAutomation.automation.definition.steps.findIndex(o=>o.id===e.id);t.selectedAutomation.deleteBlock(e.id);const i=t.selectedAutomation.automation.definition.steps;let a;return i[r]!=null?a=i[r]:i[r-1]!=null?a=i[r-1]:a=t.selectedAutomation.automation.definition.trigger||null,t.selectedBlock=a,t})}}),x4e=()=>{const t=jG("bb-temporal",{}),r=(a,o,l)=>{const s={...o,expiry:Date.now()+l*1e3};t.update(u=>({...u,[a]:s}))},i=a=>{const o=pn(t)[a];return o?o.expiry<Date.now()?(t.update(s=>(delete s[a],s)),null):o:void 0};return{subscribe:t.subscribe,actions:{setExpiring:r,getExpiring:i}}},U4e=()=>{const n=document.documentElement,e={theme:"darkest"},t=jG("bb-theme",e);return t.subscribe(r=>{if(r.darkMode!==void 0){t.set(e);return}n6.forEach(a=>{n.classList.toggle(`spectrum--${a.class}`,a.class===r.theme)});const i=n6.find(a=>a.class===r.theme);i!=null&&i.base&&n.classList.add(`spectrum--${i.base}`)}),t},Xt=v4e(),Or=F4e(),Pv=U4e(),Vv=x4e(),ja=Il(Xt,n=>n.screens.find(e=>e._id===n.selectedScreenId)),HY=Il(Xt,n=>{var e;return(e=n.layouts)==null?void 0:e.find(t=>t._id===n.selectedLayoutId)}),I3=Il([Xt,ja],([n,e])=>!e||!n.selectedComponentId?null:ru(e==null?void 0:e.props,n.selectedComponentId)),j0=ja,OY=Il(Xt,n=>n.screens.slice().sort((e,t)=>{const r=Sv(e.routing.roleId),i=Sv(t.routing.roleId);if(r!==i)return r>i?-1:1;const a=!!e.routing.homeScreen,o=!!t.routing.homeScreen;if(a!==o)return a?-1:1;const l=e.routing.route.split("/"),s=t.routing.route.split("/");let u=Math.min(l.length,s.length);for(let c=0;c<u;c++)if(l[c]!==s[c])return l[c]<s[c]?-1:1;return l.length<s.length?-1:1})),q4e=Il([Xt,ja],([n,e])=>T4(e==null?void 0:e.props,n.selectedComponentId).map(t=>t._id)),sT={platformUrl:"",logoUrl:void 0,docsUrl:void 0,company:"Budibase",oidc:void 0,google:void 0,oidcCallbackUrl:"",googleCallbackUrl:""};function W4e(){const n=gi(sT),{subscribe:e,set:t}=n;async function r(){const a=pn(sr).tenantId,o=await Zt.getTenantConfig(a);t({...sT,...o.config,_rev:o._rev})}async function i(a){const o=pn(n);delete o.oidc,delete o.google,delete o.oidcCallbackUrl,delete o.googleCallbackUrl,await Zt.saveConfig({type:"settings",config:{...pn(n),...a},_rev:pn(n)._rev}),await r()}return{subscribe:e,set:t,save:i,init:r}}const Hs=W4e();var Dd={exports:{}};/**
|
|
425
|
+
`),a=[],o,l=0;l<i.length;l+=2){var s=null;(o=t.exec(i[l]))?s={url:o[2],func:o[3],args:[],line:+o[1],column:null}:(o=r.exec(i[l]))&&(s={url:o[6],func:o[3]||o[4],args:o[5]?o[5].split(","):[],line:+o[1],column:+o[2]}),s&&(!s.func&&s.line&&(s.func=vg),a.push(s))}return a.length?{message:Xk(n),name:n.name,stack:a}:null}function tT(n,e){try{return Wi({},n,{stack:n.stack.slice(e)})}catch{return n}}function Xk(n){var e=n&&n.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}var J3e=50;function CY(n){var e=Jk(n.stack),t={type:n.name,value:n.message};return e&&e.length&&(t.stacktrace={frames:e}),t.type===void 0&&t.value===""&&(t.value="Unrecoverable error caught"),t}function Z3e(n,e,t){var r={exception:{values:[{type:jk(n)?n.constructor.name:t?"UnhandledRejection":"Error",value:"Non-Error "+(t?"promise rejection":"exception")+" captured with keys: "+p3e(n)}]},extra:{__serialized__:_Y(n)}};if(e){var i=i7(e),a=Jk(i.stack);r.stacktrace={frames:a}}return r}function nT(n){var e=CY(n);return{exception:{values:[e]}}}function Jk(n){if(!n||!n.length)return[];var e=n,t=e[0].func||"",r=e[e.length-1].func||"";return(t.indexOf("captureMessage")!==-1||t.indexOf("captureException")!==-1)&&(e=e.slice(1)),r.indexOf("sentryWrapped")!==-1&&(e=e.slice(0,-1)),e.slice(0,J3e).map(function(i){return{colno:i.column===null?void 0:i.column,filename:i.url||e[0].url,function:i.func||"?",in_app:!0,lineno:i.line===null?void 0:i.line}}).reverse()}function Z$(n,e,t){t===void 0&&(t={});var r;if(mY(n)&&n.error){var i=n;return n=i.error,r=nT(i7(n)),r}if(jE(n)||Qfe(n)){var a=n,o=a.name||(jE(a)?"DOMError":"DOMException"),l=a.message?o+": "+a.message:o;return r=Q$(l,e,t),X$(r,l),r}if(hY(n))return r=nT(i7(n)),r;if(Fk(n)||jk(n)){var s=n;return r=Z3e(s,e,t.rejection),s6(r,{synthetic:!0}),r}return r=Q$(n,e,t),X$(r,""+n,void 0),s6(r,{synthetic:!0}),r}function Q$(n,e,t){t===void 0&&(t={});var r={message:n};if(t.attachStacktrace&&e){var i=i7(e),a=Jk(i.stack);r.stacktrace={frames:a}}return r}var SY=function(){function n(e){this.options=e,this._buffer=new d3e(30),this._api=new AY(this.options.dsn),this.url=this._api.getStoreEndpointWithUrlEncodedAuth()}return n.prototype.sendEvent=function(e){throw new r5("Transport Class has to implement `sendEvent` method")},n.prototype.close=function(e){return this._buffer.drain(e)},n}(),Q3e=Fu(),e4e=function(n){B7(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._disabledUntil=new Date(Date.now()),t}return e.prototype.sendEvent=function(t){var r=this;if(new Date(Date.now())<this._disabledUntil)return Promise.reject({event:t,reason:"Transport locked till "+this._disabledUntil+" due to too many requests.",status:429});var i=MY(t,this._api),a={body:i.body,method:"POST",referrerPolicy:m3e()?"origin":""};return this.options.fetchParameters!==void 0&&Object.assign(a,this.options.fetchParameters),this.options.headers!==void 0&&(a.headers=this.options.headers),this._buffer.add(new s2(function(o,l){Q3e.fetch(i.url,a).then(function(s){var u=B3.fromHttpCode(s.status);if(u===B3.Success){o({status:u});return}if(u===B3.RateLimit){var c=Date.now();r._disabledUntil=new Date(c+gY(c,s.headers.get("Retry-After"))),Oo.warn("Too many requests, backing off till: "+r._disabledUntil)}l(s)}).catch(l)}))},e}(SY),t4e=function(n){B7(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._disabledUntil=new Date(Date.now()),t}return e.prototype.sendEvent=function(t){var r=this;if(new Date(Date.now())<this._disabledUntil)return Promise.reject({event:t,reason:"Transport locked till "+this._disabledUntil+" due to too many requests.",status:429});var i=MY(t,this._api);return this._buffer.add(new s2(function(a,o){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(l.readyState===4){var u=B3.fromHttpCode(l.status);if(u===B3.Success){a({status:u});return}if(u===B3.RateLimit){var c=Date.now();r._disabledUntil=new Date(c+gY(c,l.getResponseHeader("Retry-After"))),Oo.warn("Too many requests, backing off till: "+r._disabledUntil)}o(l)}},l.open("POST",i.url);for(var s in r.options.headers)r.options.headers.hasOwnProperty(s)&&l.setRequestHeader(s,r.options.headers[s]);l.send(i.body)}))},e}(SY),n4e=function(n){B7(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype._setupTransport=function(){if(!this._options.dsn)return n.prototype._setupTransport.call(this);var t=Wi({},this._options.transportOptions,{dsn:this._options.dsn});return this._options.transport?new this._options.transport(t):qk()?new e4e(t):new t4e(t)},e.prototype.eventFromException=function(t,r){var i=r&&r.syntheticException||void 0,a=Z$(t,i,{attachStacktrace:this._options.attachStacktrace});return s6(a,{handled:!0,type:"generic"}),a.level=d5.Error,r&&r.event_id&&(a.event_id=r.event_id),s2.resolve(a)},e.prototype.eventFromMessage=function(t,r,i){r===void 0&&(r=d5.Info);var a=i&&i.syntheticException||void 0,o=Q$(t,a,{attachStacktrace:this._options.attachStacktrace});return o.level=r,i&&i.event_id&&(o.event_id=i.event_id),s2.resolve(o)},e}(R3e),ew=0;function rT(){return ew>0}function r4e(){ew+=1,setTimeout(function(){ew-=1})}function Sh(n,e,t){if(e===void 0&&(e={}),typeof n!="function")return n;try{if(n.__sentry__)return n;if(n.__sentry_wrapped__)return n.__sentry_wrapped__}catch{return n}var r=function(){var o=Array.prototype.slice.call(arguments);try{t&&typeof t=="function"&&t.apply(this,arguments);var l=o.map(function(s){return Sh(s,e)});return n.handleEvent?n.handleEvent.apply(this,l):n.apply(this,l)}catch(s){throw r4e(),B3e(function(u){u.addEventProcessor(function(c){var f=Wi({},c);return e.mechanism&&(X$(f,void 0,void 0),s6(f,e.mechanism)),f.extra=Wi({},f.extra,{arguments:o}),f}),zY(s)}),s}};try{for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}catch{}n.prototype=n.prototype||{},r.prototype=n.prototype,Object.defineProperty(n,"__sentry_wrapped__",{enumerable:!1,value:r}),Object.defineProperties(r,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:n}});try{var a=Object.getOwnPropertyDescriptor(r,"name");a.configurable&&Object.defineProperty(r,"name",{get:function(){return n.name}})}catch{}return r}var i4e=function(){function n(e){this.name=n.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._options=Wi({onerror:!0,onunhandledrejection:!0},e)}return n.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(Oo.log("Global Handler attached: onerror"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(Oo.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler())},n.prototype._installGlobalOnErrorHandler=function(){var e=this;this._onErrorHandlerInstalled||(gd({callback:function(t){var r=t.error,i=l2(),a=i.getIntegration(n),o=r&&r.__sentry_own_request__===!0;if(!(!a||rT()||o)){var l=i.getClient(),s=r7(r)?e._eventFromIncompleteOnError(t.msg,t.url,t.line,t.column):e._enhanceEventWithInitialFrame(Z$(r,void 0,{attachStacktrace:l&&l.getOptions().attachStacktrace,rejection:!1}),t.url,t.line,t.column);s6(s,{handled:!1,type:"onerror"}),i.captureEvent(s,{originalException:r})}},type:"error"}),this._onErrorHandlerInstalled=!0)},n.prototype._installGlobalOnUnhandledRejectionHandler=function(){var e=this;this._onUnhandledRejectionHandlerInstalled||(gd({callback:function(t){var r=t;try{"reason"in t?r=t.reason:"detail"in t&&"reason"in t.detail&&(r=t.detail.reason)}catch{}var i=l2(),a=i.getIntegration(n),o=r&&r.__sentry_own_request__===!0;if(!a||rT()||o)return!0;var l=i.getClient(),s=r7(r)?e._eventFromIncompleteRejection(r):Z$(r,void 0,{attachStacktrace:l&&l.getOptions().attachStacktrace,rejection:!0});s.level=d5.Error,s6(s,{handled:!1,type:"onunhandledrejection"}),i.captureEvent(s,{originalException:r})},type:"unhandledrejection"}),this._onUnhandledRejectionHandlerInstalled=!0)},n.prototype._eventFromIncompleteOnError=function(e,t,r,i){var a=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,o=mY(e)?e.message:e,l;if(l6(o)){var s=o.match(a);s&&(l=s[1],o=s[2])}var u={exception:{values:[{type:l||"Error",value:o}]}};return this._enhanceEventWithInitialFrame(u,t,r,i)},n.prototype._eventFromIncompleteRejection=function(e){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+e}]}}},n.prototype._enhanceEventWithInitialFrame=function(e,t,r,i){e.exception=e.exception||{},e.exception.values=e.exception.values||[],e.exception.values[0]=e.exception.values[0]||{},e.exception.values[0].stacktrace=e.exception.values[0].stacktrace||{},e.exception.values[0].stacktrace.frames=e.exception.values[0].stacktrace.frames||[];var a=isNaN(parseInt(i,10))?void 0:i,o=isNaN(parseInt(r,10))?void 0:r,l=l6(t)&&t.length>0?t:i3e();return e.exception.values[0].stacktrace.frames.length===0&&e.exception.values[0].stacktrace.frames.push({colno:a,filename:l,function:"?",in_app:!0,lineno:o}),e},n.id="GlobalHandlers",n}(),a4e=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],o4e=function(){function n(e){this.name=n.id,this._options=Wi({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}return n.prototype._wrapTimeFunction=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=t[0];return t[0]=Sh(i,{mechanism:{data:{function:K5(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}},n.prototype._wrapRAF=function(e){return function(t){return e.call(this,Sh(t,{mechanism:{data:{function:"requestAnimationFrame",handler:K5(e)},handled:!0,type:"instrument"}}))}},n.prototype._wrapEventTarget=function(e){var t=Fu(),r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(nu(r,"addEventListener",function(i){return function(a,o,l){try{typeof o.handleEvent=="function"&&(o.handleEvent=Sh(o.handleEvent.bind(o),{mechanism:{data:{function:"handleEvent",handler:K5(o),target:e},handled:!0,type:"instrument"}}))}catch{}return i.call(this,a,Sh(o,{mechanism:{data:{function:"addEventListener",handler:K5(o),target:e},handled:!0,type:"instrument"}}),l)}}),nu(r,"removeEventListener",function(i){return function(a,o,l){var s=o;try{s&&s.__sentry__&&i.call(this,a,s.__sentry_original__,l)}catch{}return i.call(this,a,s,l)}}))},n.prototype._wrapXHR=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,a=["onload","onerror","onprogress","onreadystatechange"];return a.forEach(function(o){o in i&&typeof i[o]=="function"&&nu(i,o,function(l){var s={mechanism:{data:{function:o,handler:K5(l)},handled:!0,type:"instrument"}};return l.__sentry_original__&&(s.mechanism.data.handler=K5(l.__sentry_original__)),Sh(l,s)})}),e.apply(this,t)}},n.prototype.setupOnce=function(){var e=Fu();if(this._options.setTimeout&&nu(e,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&nu(e,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&nu(e,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&nu(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget){var t=Array.isArray(this._options.eventTarget)?this._options.eventTarget:a4e;t.forEach(this._wrapEventTarget.bind(this))}},n.id="TryCatch",n}(),LY=function(){function n(e){this.name=n.id,this._options=Wi({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}return n.prototype.addSentryBreadcrumb=function(e){!this._options.sentry||l2().addBreadcrumb({category:"sentry."+(e.type==="transaction"?"transaction":"event"),event_id:e.event_id,level:e.level,message:pd(e)},{event:e})},n.prototype._consoleBreadcrumb=function(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:d5.fromString(e.level),message:UE(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)t.message="Assertion failed: "+(UE(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1);else return;l2().addBreadcrumb(t,{input:e.args,level:e.level})},n.prototype._domBreadcrumb=function(e){var t;try{t=e.event.target?Hv(e.event.target):Hv(e.event)}catch{t="<unknown>"}t.length!==0&&l2().addBreadcrumb({category:"ui."+e.name,message:t},{event:e.event,name:e.name})},n.prototype._xhrBreadcrumb=function(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;l2().addBreadcrumb({category:"xhr",data:e.xhr.__sentry_xhr__,type:"http"},{xhr:e.xhr});return}},n.prototype._fetchBreadcrumb=function(e){!e.endTimestamp||e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"||(e.error?l2().addBreadcrumb({category:"fetch",data:e.fetchData,level:d5.Error,type:"http"},{data:e.error,input:e.args}):l2().addBreadcrumb({category:"fetch",data:Wi({},e.fetchData,{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response}))},n.prototype._historyBreadcrumb=function(e){var t=Fu(),r=e.from,i=e.to,a=hy(t.location.href),o=hy(r),l=hy(i);o.path||(o=a),a.protocol===l.protocol&&a.host===l.host&&(i=l.relative),a.protocol===o.protocol&&a.host===o.host&&(r=o.relative),l2().addBreadcrumb({category:"navigation",data:{from:r,to:i}})},n.prototype.setupOnce=function(){var e=this;this._options.console&&gd({callback:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e._consoleBreadcrumb.apply(e,hl(t))},type:"console"}),this._options.dom&&gd({callback:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e._domBreadcrumb.apply(e,hl(t))},type:"dom"}),this._options.xhr&&gd({callback:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e._xhrBreadcrumb.apply(e,hl(t))},type:"xhr"}),this._options.fetch&&gd({callback:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e._fetchBreadcrumb.apply(e,hl(t))},type:"fetch"}),this._options.history&&gd({callback:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e._historyBreadcrumb.apply(e,hl(t))},type:"history"})},n.id="Breadcrumbs",n}(),l4e="cause",s4e=5,u4e=function(){function n(e){e===void 0&&(e={}),this.name=n.id,this._key=e.key||l4e,this._limit=e.limit||s4e}return n.prototype.setupOnce=function(){x_(function(e,t){var r=l2().getIntegration(n);return r?r._handler(e,t):e})},n.prototype._handler=function(e,t){if(!e.exception||!e.exception.values||!t||!cp(t.originalException,Error))return e;var r=this._walkErrorTree(t.originalException,this._key);return e.exception.values=hl(r,e.exception.values),e},n.prototype._walkErrorTree=function(e,t,r){if(r===void 0&&(r=[]),!cp(e[t],Error)||r.length+1>=this._limit)return r;var i=i7(e[t]),a=CY(i);return this._walkErrorTree(e[t],t,hl([a],r))},n.id="LinkedErrors",n}(),y9=Fu(),c4e=function(){function n(){this.name=n.id}return n.prototype.setupOnce=function(){x_(function(e){if(l2().getIntegration(n)){if(!y9.navigator||!y9.location)return e;var t=e.request||{};return t.url=t.url||y9.location.href,t.headers=t.headers||{},t.headers["User-Agent"]=y9.navigator.userAgent,Wi({},e,{request:t})}return e})},n.id="UserAgent",n}(),f4e="sentry.javascript.browser",iT="5.19.1",p4e=function(n){B7(e,n);function e(t){return t===void 0&&(t={}),n.call(this,n4e,t)||this}return e.prototype._prepareEvent=function(t,r,i){return t.platform=t.platform||"javascript",t.sdk=Wi({},t.sdk,{name:f4e,packages:hl(t.sdk&&t.sdk.packages||[],[{name:"npm:@sentry/browser",version:iT}]),version:iT}),n.prototype._prepareEvent.call(this,t,r,i)},e.prototype._sendEvent=function(t){var r=this.getIntegration(LY);r&&r.addSentryBreadcrumb(t),n.prototype._sendEvent.call(this,t)},e.prototype.showReportDialog=function(t){t===void 0&&(t={});var r=Fu().document;if(!!r){if(!this._isEnabled()){Oo.error("Trying to call showReportDialog with Sentry Client is disabled");return}var i=t.dsn||this.getDsn();if(!t.eventId){Oo.error("Missing `eventId` option in showReportDialog call");return}if(!i){Oo.error("Missing `Dsn` option in showReportDialog call");return}var a=r.createElement("script");a.async=!0,a.src=new AY(i).getReportDialogEndpoint(t),t.onLoad&&(a.onload=t.onLoad),(r.head||r.body).appendChild(a)}},e}(P3e),d4e=[new x3e,new F3e,new o4e,new LY,new i4e,new u4e,new c4e];function h4e(n){if(n===void 0&&(n={}),n.defaultIntegrations===void 0&&(n.defaultIntegrations=d4e),n.release===void 0){var e=Fu();e.SENTRY_RELEASE&&e.SENTRY_RELEASE.id&&(n.release=e.SENTRY_RELEASE.id)}N3e(p4e,n)}class m4e{constructor(e){this.dsn=e}init(){this.dsn&&(h4e({dsn:this.dsn}),this.initalised=!0)}captureException(e){!this.initalised||zY(e)}identify(e){!this.initalised||D3e(t=>{t.setUser({id:e})})}}const $9=new Gfe("phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU"),wy=new m4e(""),w9=new Yfe("qz2sxfuv");class g4e{constructor(){this.clients=[$9,wy,w9]}async activate(){(await Zt.getAnalyticsStatus()).enabled&&this.clients.forEach(t=>t.init())}identify(e){$9.identify(e),wy.identify(e)}captureException(e){wy.captureException(e)}captureEvent(e,t={}){$9.captureEvent(e,t),w9.captureEvent(e,t)}showChat(e){w9.show(e)}async logout(){$9.logout(),w9.logout()}}const np=new g4e,ru=(n,e)=>EY(n,t=>t._id===e),vc=(n,e,t)=>{if(!n||!e)return null;if(n._id===e)return t;if(!n._children)return null;for(const r of n._children){const i=vc(r,e,n);if(i)return i}return null},T4=(n,e,t=[])=>{if(!n||!e)return[];if(n._id===e)return[...t,n];if(!n._children)return[];for(const r of n._children){const i=[...t,n],a=T4(r,e,i);if(a!=null&&a.length)return a}return[]},h5=(n,e)=>{if(!n||!e)return[];let t=[];return n._children&&n._children.forEach(r=>{t=[...t,...h5(r,e)]}),e(n)&&t.push(n),t.reverse()},q_=(n,e,t)=>{if(!t)return null;const r=T4(n,e).reverse();for(let i of r)if(t(i))return i;return null},EY=(n,e)=>{if(!n||!e)return null;if(e(n))return n;if(!n._children)return null;for(const t of n._children){const r=EY(t,e);if(r)return r}return null};let ky={};const D6=n=>{var r,i,a;if(!n)return[];if(!n.startsWith("plugin/")&&!n.startsWith("@budibase")&&(n=`@budibase/standard-components/${n}`),ky[n])return ky[n];const e=Xt.actions.components.getDefinition(n);let t=[];return e&&(t=(i=(r=e.settings)==null?void 0:r.filter(o=>!o.section))!=null?i:[],(a=e.settings)==null||a.filter(o=>o.section).forEach(o=>{t=t.concat(o.settings||[])})),ky[n]=t,t},Iv=n=>{var a;if(!n)return;const e=n._id,t=C4();let r=JSON.stringify(n);return r=r.replace(new RegExp(e,"g"),t),_G(r).forEach(o=>{let l=o.replace(/\\"/g,'"'),s=t6(l);if(s!=null){s=s.replace(new RegExp(e,"g"),t);let u=Dh(s);u=u.replace(/"/g,'\\"'),r=r.replace(o,u)}}),n=JSON.parse(r),{...n,_children:(a=n._children)==null?void 0:a.map(Iv)}},zy={apps:[],name:"",url:"",description:"",layouts:[],screens:[],components:[],clientFeatures:{spectrumThemes:!1,intelligentLoading:!1,deviceAwareness:!1,state:!1,rowSelection:!1,customThemes:!1,devicePreview:!1,messagePassing:!1,continueIfAction:!1,showNotificationAction:!1},errors:[],hasAppPackage:!1,libraries:null,appId:"",routes:{},clientLibPath:"",theme:"",customTheme:{},previewDevice:"desktop",highlightedSettingKey:null,selectedScreenId:null,selectedComponentId:null,selectedLayoutId:null},v4e=()=>{const n=gi({...zy}),e=xG(async(t,r)=>{const a=pn(n).screens.find(s=>s._id===r);if(!a)return;let o=$1.cloneDeep(a);if(t(o)!==!1)return await n.actions.screens.save(o)});return n.actions={reset:()=>{n.set({...zy})},initialise:async t=>{const{layouts:r,screens:i,application:a,clientLibPath:o}=t;await n.actions.components.refreshDefinitions(a.appId),n.update(l=>({...l,libraries:a.componentLibraries,name:a.name,description:a.description,appId:a.appId,url:a.url,layouts:r||[],screens:i||[],theme:a.theme||"spectrum--light",customTheme:a.customTheme,hasAppPackage:!0,appInstance:a.instance,clientLibPath:o,previousTopNavPath:{},version:a.version,revertableVersion:a.revertableVersion,navigation:a.navigation||{},usedPlugins:a.usedPlugins||[]})),Wd.set(a.instance),await Bi.init(),await z5.init(),await ya.init(),await Br.init()},theme:{save:async t=>{const r=pn(n).appId,i=await Zt.saveAppMetadata({appId:r,metadata:{theme:t}});n.update(a=>(a.theme=i.theme,a))}},customTheme:{save:async t=>{const r=pn(n).appId,i=await Zt.saveAppMetadata({appId:r,metadata:{customTheme:t}});n.update(a=>(a.customTheme=i.customTheme,a))}},navigation:{save:async t=>{const r=pn(n).appId,i=await Zt.saveAppMetadata({appId:r,metadata:{navigation:t}});n.update(a=>(a.navigation=i.navigation,a))}},screens:{select:t=>{var a;const r=pn(n),i=r.screens.find(o=>o._id===t);!i||r.selectedScreenId===i._id&&r.selectedComponentId===((a=i.props)==null?void 0:a._id)||n.update(o=>{var l;return o.selectedScreenId=i._id,o.selectedComponentId=(l=i.props)==null?void 0:l._id,o})},validate:t=>{const r=(a,o=[],l=[])=>{var c,f,h;const s=a._component;if(o.includes(s)||l.length&&!l.includes(s))return s;if(!((c=a==null?void 0:a._children)!=null&&c.length))return;const u=n.actions.components.getDefinition(a._component);if(l=[],(f=u==null?void 0:u.legalDirectChildren)!=null&&f.length&&(l=u.legalDirectChildren.map(m=>`@budibase/standard-components/${m}`)),(h=u==null?void 0:u.illegalChildren)!=null&&h.length){const m=u.illegalChildren.map(_=>`@budibase/standard-components/${_}`);o=[...new Set([...o,...m])]}for(let m of a._children){const _=r(m,o,l);if(_)return _}},i=r(t.props);if(i)throw`You can't place a ${n.actions.components.getDefinition(i).name} here`},save:async t=>{n.actions.screens.validate(t);const r=pn(n),i=t._id===void 0,a=await Zt.saveScreen(t),o=await Zt.fetchAppRoutes();let l=r.usedPlugins;if(a.pluginAdded){const{application:s}=await Zt.fetchAppPackage(r.appId);l=s.usedPlugins||[]}return n.update(s=>{const u=s.screens.findIndex(c=>c._id===a._id);return u!==-1?s.screens.splice(u,1,a):s.screens.push(a),i&&(s.selectedScreenId=a._id,s.selectedComponentId=a.props._id),s.routes=o.routes,s.usedPlugins=l,s}),a},patch:async(t,r)=>{if(r||(r=pn(n).selectedScreenId),!(!r||!t))return await e(t,r)},delete:async t=>{const r=Array.isArray(t)?t:[t],i=[];let a=[];r.forEach(s=>{i.push(Zt.deleteScreen({screenId:s._id,screenRev:s._rev})),a.push(s.routing.route)}),i.push(n.actions.links.delete(a)),await Promise.all(i);const o=r.map(s=>s._id),l=await Zt.fetchAppRoutes();n.update(s=>(s.screens=s.screens.filter(u=>!o.includes(u._id)),o.includes(s.selectedScreenId)&&(s.selectedScreenId=null,s.selectedComponentId=null),s.routes=l.routes,s))},updateSetting:async(t,r,i)=>{if(!t||!r)return;const a=u=>{if(!u||Xh(u,r)===i)return!1;ite(u,r,i)};await n.actions.screens.patch(a,t._id);const o=pn(n),l=o.screens.find(u=>u._id===t._id);if(!l)return;const s=o.screens.filter(u=>u.routing.roleId===l.routing.roleId&&u.routing.homeScreen&&u._id!==t._id);if(s.length){const u=c=>{c.routing.homeScreen=!1};for(let c of s)await n.actions.screens.patch(u,c._id)}},removeCustomLayout:async t=>{const r=pn(n).layouts.find(a=>a._id===t.layoutId),i=a=>{a.layoutId=null,a.showNavigation=(r==null?void 0:r.props.navigation)!=="None",a.width=(r==null?void 0:r.props.width)||"Large"};await n.actions.screens.patch(i,t._id)}},preview:{setDevice:t=>{n.update(r=>(r.previewDevice=t,r))},sendEvent:(t,r)=>{const{previewEventHandler:i}=pn(n);i==null||i(t,r)},registerEventHandler:t=>{n.update(r=>(r.previewEventHandler=t,r))}},layouts:{select:t=>{var a;const r=pn(n),i=r.layouts.find(o=>o._id===t);!i||r.selectedLayoutId===i._id&&r.selectedComponentId===((a=i.props)==null?void 0:a._id)||n.update(o=>{var l;return o.selectedLayoutId=i._id,o.selectedComponentId=(l=i.props)==null?void 0:l._id,o})},delete:async t=>{!(t!=null&&t._id)||(await Zt.deleteLayout({layoutId:t._id,layoutRev:t._rev}),n.update(r=>(r.layouts=r.layouts.filter(i=>i._id!==t._id),r)))}},components:{refreshDefinitions:async t=>{t||(t=pn(n).appId);const r=await Zt.fetchComponentLibDefinitions(t),i=Object.keys(r).filter(a=>a.startsWith("plugin/"));n.update(a=>({...a,components:r,customComponents:i,clientFeatures:{...zy.clientFeatures,...r.features}}))},getDefinition:t=>t?pn(n).components[t]:null,createInstance:(t,r)=>{const i=n.actions.components.getDefinition(t);if(!i)return null;const a=D6(t);let o={...r};a.forEach(s=>{s.defaultValue!==void 0&&(o[s.key]=s.defaultValue)});let l={};if(i.hasChildren&&(l._children=[]),t.endsWith("/formstep")){const s=q_(pn(ja).props,pn(I3)._id,c=>c._component.endsWith("/form")),u=h5(s,c=>c._component.endsWith("/formstep"));l.step=u.length+1,l._instanceName=`Step ${u.length+1}`}return{_id:C4(),_component:i.component,_styles:{normal:{},hover:{},active:{}},_instanceName:`New ${i.friendlyName||i.name}`,...$1.cloneDeep(o),...l}},create:async(t,r,i,a)=>{const o=pn(n),l=n.actions.components.createInstance(t,r);if(!!l)return i&&a!=null?await n.actions.screens.patch(s=>{var c;let u=ru(s.props,i);(c=u._children)!=null&&c.length?u._children.splice(a,0,l):u._children=[l]}):await n.actions.screens.patch(s=>{const u=ru(s.props,o.selectedComponentId);if(!u)return!1;let c;if(u){const f=n.actions.components.getDefinition(u._component);f!=null&&f.hasChildren?c=u:c=vc(s.props,u._id)}else c=s.props;if(!c)return!1;c._children||(c._children=[]),c._children.push(l)}),n.update(s=>(s.selectedComponentId=l._id,s)),np.captureEvent(o6.COMPONENT_CREATED,{name:l._component}),l},patch:async(t,r,i)=>{if(!r||!i){const o=pn(n);r=r||o.selectedComponentId,i=i||o.selectedScreenId}if(!r||!i||!t)return;const a=o=>{let l=ru(o.props,r);return l?t(l,o):!1};await n.actions.screens.patch(a,i)},delete:async t=>{if(!t)return;const r=pn(n);let i;r.selectedComponentId===t._id&&(i=n.actions.components.getNext(),i||(i=n.actions.components.getPrevious())),await n.actions.screens.patch(a=>{if(t=ru(a.props,t._id),!t)return!1;const o=vc(a.props,t._id);if(!o)return!1;o._children=o._children.filter(l=>l._id!==t._id)}),i&&n.update(a=>(a.selectedComponentId=i,a))},copy:(t,r=!1,i=!0)=>{if(n.update(a=>(a.componentToPaste=$1.cloneDeep(t),a.componentToPaste.isCut=r,a)),r&&i){const a=pn(ja),o=vc(a==null?void 0:a.props,t._id);o&&n.update(l=>(l.selectedComponentId=o._id,l))}},paste:async(t,r,i)=>{const a=pn(n);if(!a.componentToPaste)return;let o,l=$1.cloneDeep(a.componentToPaste);l.isCut&&n.update(c=>(delete c.componentToPaste,c));const s=c=>{if(t=ru(c.props,t._id),!t)return!1;const f=l.isCut,h=l._id;if(delete l.isCut,f||(l=Iv(l)),o=l._id,f){const m=vc(c.props,h);m!=null&&m._children&&(m._children=m._children.filter(_=>_._id!==h))}if(r==="inside"&&(n.actions.components.getDefinition(t._component).hasChildren||(r="below")),r==="inside")t._children||(t._children=[]),t._children.push(l);else{const m=vc(c.props,t._id);if(!(m!=null&&m._children))return!1;const _=m._children.findIndex(w=>w._id===t._id),y=r==="above"?_:_+1;m._children.splice(y,0,l)}},u=(i==null?void 0:i._id)||a.selectedScreenId;await n.actions.screens.patch(s,u),n.update(c=>(c.selectedScreenId=u,c.selectedComponentId=o,c))},getPrevious:()=>{var l,s;const r=pn(n).selectedComponentId,i=pn(ja),a=vc(i.props,r),o=a==null?void 0:a._children.findIndex(u=>u._id===r);if(!a||r===i.props._id)return null;if(o>0){const u=a._children[o-1];if((l=u._children)!=null&&l.length){let c=u;for(;(s=c._children)!=null&&s.length;)c=c._children[c._children.length-1];return c._id}return u._id}return a._id},getNext:()=>{var c,f;const t=pn(I3),r=t==null?void 0:t._id,i=pn(ja),a=vc(i.props,r),o=a==null?void 0:a._children.findIndex(h=>h._id===r);if((c=t._children)!=null&&c.length)return t._children[0]._id;if(!a)return null;if(o<a._children.length-1)return a._children[o+1]._id;let l=a,s=vc(i.props,l._id),u=s==null?void 0:s._children.findIndex(h=>h._id===l._id);for(;s!=null&&u===((f=s._children)==null?void 0:f.length)-1;)l=s,s=vc(i.props,l._id),u=s==null?void 0:s._children.findIndex(h=>h._id===l._id);return s?s._children[u+1]._id:null},selectPrevious:()=>{const t=n.actions.components.getPrevious();t&&n.update(r=>(r.selectedComponentId=t,r))},selectNext:()=>{const t=n.actions.components.getNext();t&&n.update(r=>(r.selectedComponentId=t,r))},moveUp:async t=>{await n.actions.screens.patch(r=>{const i=t==null?void 0:t._id,a=vc(r.props,i),o=a==null?void 0:a._children.findIndex(s=>s._id===i);if(!a||o===0&&a._id===r.props._id)return;const l=$1.cloneDeep(a._children[o]);if(a._children=a._children.filter(s=>s._id!==i),o>0){const s=a._children[o-1];n.actions.components.getDefinition(s._component).hasChildren?s._children.push(l):a._children.splice(o-1,0,l)}else if(a._id!==r.props._id){const s=vc(r.props,a._id),u=s._children.findIndex(c=>c._id===a._id);s._children.splice(u,0,l)}})},moveDown:async t=>{await n.actions.screens.patch(r=>{var s;const i=t==null?void 0:t._id,a=vc(r.props,i);if(!((s=a==null?void 0:a._children)!=null&&s.length))return!1;const o=a._children.findIndex(u=>u._id===i);if(o===a._children.length-1&&a._id===r.props._id)return;const l=$1.cloneDeep(a._children[o]);if(a._children=a._children.filter(u=>u._id!==i),o<a._children.length){const u=a._children[o];n.actions.components.getDefinition(u._component).hasChildren?u._children.splice(0,0,l):a._children.splice(o+1,0,l)}else{const u=vc(r.props,a._id),c=u._children.findIndex(f=>f._id===a._id);u._children.splice(c+1,0,l)}})},updateStyle:async(t,r)=>{await n.actions.components.patch(i=>{r==null||r===""?delete i._styles.normal[t]:i._styles.normal[t]=r})},updateStyles:async(t,r)=>{const i=a=>{a._styles.normal={...a._styles.normal,...t}};await n.actions.components.patch(i,r)},updateCustomStyle:async t=>{await n.actions.components.patch(r=>{r._styles.custom=t})},updateConditions:async t=>{await n.actions.components.patch(r=>{r._conditions=t})},updateSetting:async(t,r)=>{await n.actions.components.patch(i=>{if(!t||!i||i[t]===r)return!1;i[t]=r})},requestEjectBlock:t=>{n.actions.preview.sendEvent("eject-block",t)},handleEjectBlock:async(t,r)=>{let i;await n.actions.screens.patch(a=>{var c;const o=ru(a.props,t),l=vc(a.props,t);if(!o||!((c=l==null?void 0:l._children)!=null&&c.length))return!1;const s=h5(r,f=>f._containsSlot)[0];s&&(delete s._containsSlot,s._children=[...s._children||[],...o._children||[]]),r=Iv(r);const u=l._children.findIndex(f=>f._id===t);l._children[u]=r,i=r._id}),i&&n.update(a=>(a.selectedComponentId=i,a))}},links:{save:async(t,r)=>{const i=pn(n).navigation;let a=[...i==null?void 0:i.links];a.find(o=>o.url===t&&o.text===r)||(a.push({text:r,url:t}),await n.actions.navigation.save({...i,links:[...a]}))},delete:async t=>{const r=pn(n).navigation;let i=r==null?void 0:r.links;!(i!=null&&i.length)||(t=Array.isArray(t)?t:[t],i=i.filter(a=>!t.includes(a.url)),await n.actions.navigation.save({...r,links:i}))}},settings:{highlight:t=>{n.update(r=>({...r,highlightedSettingKey:t}))}},dnd:{start:t=>{n.actions.preview.sendEvent("dragging-new-component",{dragging:!0,component:t})},stop:()=>{n.actions.preview.sendEvent("dragging-new-component",{dragging:!1})}}},n};var c2={exports:{}},TY={exports:{}},Y9=1;function _4e(){return Y9=(Y9*9301+49297)%233280,Y9/233280}function b4e(n){Y9=n}var y4e={nextValue:_4e,seed:b4e},tw=y4e,vd="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-",Z5,aT,_g;function nw(){_g=!1}function DY(n){if(!n){Z5!==vd&&(Z5=vd,nw());return}if(n!==Z5){if(n.length!==vd.length)throw new Error("Custom alphabet for shortid must be "+vd.length+" unique characters. You submitted "+n.length+" characters: "+n);var e=n.split("").filter(function(t,r,i){return r!==i.lastIndexOf(t)});if(e.length)throw new Error("Custom alphabet for shortid must be "+vd.length+" unique characters. These characters were not unique: "+e.join(", "));Z5=n,nw()}}function $4e(n){return DY(n),Z5}function w4e(n){tw.seed(n),aT!==n&&(nw(),aT=n)}function k4e(){Z5||DY(vd);for(var n=Z5.split(""),e=[],t=tw.nextValue(),r;n.length>0;)t=tw.nextValue(),r=Math.floor(t*n.length),e.push(n.splice(r,1)[0]);return e.join("")}function BY(){return _g||(_g=k4e(),_g)}function z4e(n){var e=BY();return e[n]}function A4e(){return Z5||vd}var Zk={get:A4e,characters:$4e,seed:w4e,lookup:z4e,shuffled:BY},Ay=typeof window=="object"&&(window.crypto||window.msCrypto),rw;!Ay||!Ay.getRandomValues?rw=function(n){for(var e=[],t=0;t<n;t++)e.push(Math.floor(Math.random()*256));return e}:rw=function(n){return Ay.getRandomValues(new Uint8Array(n))};var M4e=rw,C4e=function(n,e,t){for(var r=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*r*t/e.length),a="";;)for(var o=n(i),l=i;l--;)if(a+=e[o[l]&r]||"",a.length===+t)return a},S4e=Zk,L4e=M4e,E4e=C4e;function T4e(n){for(var e=0,t,r="";!t;)r=r+E4e(L4e,S4e.get(),1),t=n<Math.pow(16,e+1),e++;return r}var D4e=T4e,k9=D4e,B4e=1567752802062,H4e=7,z9,oT;function O4e(n){var e="",t=Math.floor((Date.now()-B4e)*.001);return t===oT?z9++:(z9=0,oT=t),e=e+k9(H4e),e=e+k9(n),z9>0&&(e=e+k9(z9)),e=e+k9(t),e}var I4e=O4e,P4e=Zk;function V4e(n){if(!n||typeof n!="string"||n.length<6)return!1;var e=new RegExp("[^"+P4e.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]");return!e.test(n)}var R4e=V4e;(function(n){var e=Zk,t=I4e,r=R4e,i=0;function a(u){return e.seed(u),n.exports}function o(u){return i=u,n.exports}function l(u){return u!==void 0&&e.characters(u),e.shuffled()}function s(){return t(i)}n.exports=s,n.exports.generate=s,n.exports.seed=a,n.exports.worker=o,n.exports.characters=l,n.exports.isValid=r})(TY);(function(n){n.exports=TY.exports})(c2);class lT{constructor(e){this.automation=e}hasTrigger(){return this.automation.definition.trigger}addTestData(e){this.automation.testData={...this.automation.testData,...e}}addBlock(e,t){if(!this.hasTrigger()&&e.type==="TRIGGER"){const i={id:c2.exports.generate(),...e};return this.automation.definition.trigger=i,i}const r={id:c2.exports.generate(),...e};return this.automation.definition.steps.splice(t,0,r),r}updateBlock(e,t){const{steps:r,trigger:i}=this.automation.definition;if(i&&i.id===t){this.automation.definition.trigger=e;return}const a=r.findIndex(o=>o.id===t);if(a<0)throw new Error("Block not found.");r.splice(a,1,e),this.automation.definition.steps=r}deleteBlock(e){const{steps:t,trigger:r}=this.automation.definition;if(r&&r.id===e){this.automation.definition.trigger=null;return}const i=t.findIndex(a=>a.id===e);if(i<0)throw new Error("Block not found.");t.splice(i,1),this.automation.definition.steps=t}constructBlock(e,t,r){return{...r,inputs:r.inputs||{},stepId:t,type:e}}}const N4e={automations:[],showTestPanel:!1,blockDefinitions:{TRIGGER:[],ACTION:[]},selectedAutomation:null},F4e=()=>{const n=gi(N4e);return n.actions=j4e(n),n},j4e=n=>({definitions:async()=>{const e=await Zt.getAutomationDefinitions();return n.update(t=>(t.blockDefinitions={TRIGGER:e.trigger,ACTION:e.action},t)),e},fetch:async()=>{const e=await Promise.all([Zt.getAutomations(),Zt.getAutomationDefinitions()]);n.update(t=>{var i;let r=(i=t.selectedAutomation)==null?void 0:i.automation;return t.automations=e[0],t.blockDefinitions={TRIGGER:e[1].trigger,ACTION:e[1].action},r&&(r=e[0].filter(a=>a._id===r._id),t.selectedAutomation=new lT(r[0])),t})},create:async({name:e})=>{const t={name:e,type:"automation",definition:{steps:[]}},r=await Zt.createAutomation(t);n.update(i=>(i.automations=[...i.automations,r.automation],n.actions.select(r.automation),i))},duplicate:async e=>{const t=await Zt.createAutomation({...e,name:`${e.name} - copy`,_id:void 0,_ref:void 0});n.update(r=>(r.automations=[...r.automations,t.automation],n.actions.select(t.automation),r))},save:async e=>{const t=await Zt.updateAutomation(e);n.update(r=>{const i=t.automation,a=r.automations.findIndex(o=>o._id===e._id);if(a!==-1)return r.automations.splice(a,1,i),r.automations=[...r.automations],n.actions.select(i),r})},delete:async e=>{await Zt.deleteAutomation({automationId:e==null?void 0:e._id,automationRev:e==null?void 0:e._rev}),n.update(t=>{const r=t.automations.findIndex(i=>i._id===(e==null?void 0:e._id));return t.automations.splice(r,1),t.automations=[...t.automations],t.selectedAutomation=null,t.selectedBlock=null,t})},test:async(e,t)=>{n.update(i=>(i.selectedAutomation.testResults=null,i));const r=await Zt.testAutomation({automationId:e==null?void 0:e._id,testData:t});n.update(i=>(i.selectedAutomation.testResults=r,i))},select:e=>{n.update(t=>(t.selectedAutomation=new lT($1.cloneDeep(e)),t.selectedBlock=null,t))},getLogs:async({automationId:e,startDate:t,status:r,page:i}={})=>await Zt.getAutomationLogs({automationId:e,startDate:t,status:r,page:i}),clearLogErrors:async({automationId:e,appId:t}={})=>await Zt.clearAutomationLogErrors({automationId:e,appId:t}),addTestDataToAutomation:e=>{n.update(t=>(t.selectedAutomation.addTestData(e),t))},addBlockToAutomation:(e,t)=>{n.update(r=>(r.selectedBlock=r.selectedAutomation.addBlock($1.cloneDeep(e),t),r))},toggleFieldControl:e=>{n.update(t=>(t.selectedBlock.rowControl=e,t))},deleteAutomationBlock:e=>{n.update(t=>{const r=t.selectedAutomation.automation.definition.steps.findIndex(o=>o.id===e.id);t.selectedAutomation.deleteBlock(e.id);const i=t.selectedAutomation.automation.definition.steps;let a;return i[r]!=null?a=i[r]:i[r-1]!=null?a=i[r-1]:a=t.selectedAutomation.automation.definition.trigger||null,t.selectedBlock=a,t})}}),x4e=()=>{const t=jG("bb-temporal",{}),r=(a,o,l)=>{const s={...o,expiry:Date.now()+l*1e3};t.update(u=>({...u,[a]:s}))},i=a=>{const o=pn(t)[a];return o?o.expiry<Date.now()?(t.update(s=>(delete s[a],s)),null):o:void 0};return{subscribe:t.subscribe,actions:{setExpiring:r,getExpiring:i}}},U4e=()=>{const n=document.documentElement,e={theme:"darkest"},t=jG("bb-theme",e);return t.subscribe(r=>{if(r.darkMode!==void 0){t.set(e);return}n6.forEach(a=>{n.classList.toggle(`spectrum--${a.class}`,a.class===r.theme)});const i=n6.find(a=>a.class===r.theme);i!=null&&i.base&&n.classList.add(`spectrum--${i.base}`)}),t},Xt=v4e(),Or=F4e(),Pv=U4e(),Vv=x4e(),ja=Il(Xt,n=>n.screens.find(e=>e._id===n.selectedScreenId)),HY=Il(Xt,n=>{var e;return(e=n.layouts)==null?void 0:e.find(t=>t._id===n.selectedLayoutId)}),I3=Il([Xt,ja],([n,e])=>!e||!n.selectedComponentId?null:ru(e==null?void 0:e.props,n.selectedComponentId)),j0=ja,OY=Il(Xt,n=>n.screens.slice().sort((e,t)=>{const r=Sv(e.routing.roleId),i=Sv(t.routing.roleId);if(r!==i)return r>i?-1:1;const a=!!e.routing.homeScreen,o=!!t.routing.homeScreen;if(a!==o)return a?-1:1;const l=e.routing.route.split("/"),s=t.routing.route.split("/");let u=Math.min(l.length,s.length);for(let c=0;c<u;c++)if(l[c]!==s[c])return l[c]<s[c]?-1:1;return l.length<s.length?-1:1})),q4e=Il([Xt,ja],([n,e])=>T4(e==null?void 0:e.props,n.selectedComponentId).map(t=>t._id)),sT={platformUrl:"",logoUrl:void 0,docsUrl:void 0,company:"Budibase",oidc:void 0,google:void 0,oidcCallbackUrl:"",googleCallbackUrl:""};function W4e(){const n=gi(sT),{subscribe:e,set:t}=n;async function r(){const a=pn(sr).tenantId,o=await Zt.getTenantConfig(a);t({...sT,...o.config,_rev:o._rev})}async function i(a){const o=pn(n);delete o.oidc,delete o.google,delete o.oidcCallbackUrl,delete o.googleCallbackUrl,await Zt.saveConfig({type:"settings",config:{...pn(n),...a},_rev:pn(n)._rev}),await r()}return{subscribe:e,set:t,save:i,init:r}}const Hs=W4e();var Dd={exports:{}};/**
|
|
426
426
|
* @license
|
|
427
427
|
* Lodash <https://lodash.com/>
|
|
428
428
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|