import{aa as E,ab as l}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{h as o,s as i}from"./machine.-tangy-colts-beg-869.js";import{h as d,c as C}from"./googleca-tangy-colts-beg-652.js";import{a as r}from"./machineh-tangy-colts-beg-81.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(a,e){return this.cache.has(a)?this.cache.get(a):(this.cache.set(a,e),e)}};const I=E(({helpers:a})=>({states:{components:[C(a),{componentName:a.componentName.switch,fieldType:"config",helperText:t("Select calendar from a list"),id:"select-calendar-toggle",label:t("Turn on to select any calendar from it"),onChange:"SET_SELECT_CALENDAR_TOGGLE",render:"IF_CONNECTION_SELECTED",size:"small",value:!1},{componentName:a.componentName.mixInput,helperText:t("Enter the calendar ID to update."),id:"calendar-input",label:t("Calendar ID"),onChange:"SET_CALENDAR_ID",path:"calendarMixInputId",render:"IF_CALENDAR_SELECTOR_NOT_SELECTED",required:!0,value:[]},{componentName:a.componentName.select,helperText:t("Select a calendar to update."),id:"calendar-id",label:t("Select Calendar"),onChange:"HANDLE_SELECT_CALENDAR",onRefetch:"REFETCH_CALENDAR_LIST",optionFilterProp:"label",options:[],path:"calendarSelectorId",render:"IF_CALENDAR_SELECTOR_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:a.componentName.mixInput,helperText:t("Enter the name of the calendar."),id:"name",label:t("Name"),onChange:"SET_NAME",path:"summary",render:"IF_CONNECTION_SELECTED",value:[]},{componentName:a.componentName.mixInput,helperText:t("Enter a description for the calendar."),id:"description",label:t("Description"),onChange:"SET_DESCRIPTION",path:"description",render:"IF_CONNECTION_SELECTED",value:[]}]},actions:{CONNECTION_ADD_CHANGE:d,HANDLE_SELECT_CALENDAR:o("calendarSelectorId"),IF_CONNECTION_SELECTED:({$:e})=>{var n;return l((n=e.getComponent("connection-id"))==null?void 0:n.value)},REFETCH_CALENDAR_LIST:({$:e})=>r(e),SET_CALENDAR_ID:o("calendarMixInputId"),SET_DESCRIPTION:o("description"),SET_NAME:o("summary"),SET_SELECT_CALENDAR_TOGGLE:o("selectCalendarToggle"),SET_CONNECTION:async({$:e,e:n})=>{o("connectionId")({$:e,e:n}),await r(e)},IF_CALENDAR_SELECTOR_SELECTED:({$:e})=>{var n,c;return l((n=e.getComponent("connection-id"))==null?void 0:n.value)&&((c=e.getComponent("select-calendar-toggle"))==null?void 0:c.value)===!0},IF_CALENDAR_SELECTOR_NOT_SELECTED:({$:e})=>{var n,c;return l((n=e.getComponent("connection-id"))==null?void 0:n.value)&&((c=e.getComponent("select-calendar-toggle"))==null?void 0:c.value)===!1},ON_MACHINE_LOAD:async({$:e})=>{i(e,[{db:"connectionId",id:"connection-id"},{db:"calendarMixInputId",id:"calendar-input"},{db:"calendarSelectorId",id:"calendar-id"},{db:"selectCalendarToggle",id:"select-calendar-toggle"},{db:"summary",id:"name"},{db:"description",id:"description"}]),await r(e)}}}));export{I as default};
