${this.addExpansionPanel(this._getTranslation("calendar_entities"),"M21,17V8H7V17H21M21,3A2,2 0 0,1 23,5V17A2,2 0 0,1 21,19H7C5.89,19 5,18.1 5,17V5A2,2 0 0,1 7,3H8V1H10V3H18V1H20V3H21M3,21H17V23H3C1.89,23 1,22.1 1,21V9H3V21M19,15H15V11H19V15Z",Q` ${this._renderCalendarEntities()} `,!0)}
${this.addExpansionPanel(this._getTranslation("core_settings"),"M9,10V12H7V10H9M13,10V12H11V10H13M17,10V12H15V10H17M19,3A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H6V1H8V3H16V1H18V3H19M19,19V8H5V19H19M9,14V16H7V14H9M13,14V16H11V14H13M17,14V16H15V14H17Z",Q`
${this._getTranslation("time_range")}
${this._getTranslation("time_range_note")}
${this.addTextField("days_to_show",this._getTranslation("days_to_show"),"number")}
${this._getTranslation("days_to_show_note")}
${this.addSelectField("start_date_mode",this._getTranslation("start_date_mode"),[{value:"default",label:this._getTranslation("start_date_mode_default")},{value:"fixed",label:this._getTranslation("start_date_mode_fixed")},{value:"offset",label:this._getTranslation("start_date_mode_offset")}],!1,String(this._getStartDateMode()),(e=>{this._handleStartDateModeChange(e),this.requestUpdate()}))}
${(()=>{const e=this._getStartDateMode();return"fixed"===e?this.addDateField("start_date_fixed",this._getTranslation("start_date_fixed"),this._getStartDateValue("fixed")):"offset"===e?Q`
${this.addTextField("start_date_offset",this._getTranslation("start_date_offset"),"text",this._getStartDateValue("offset"))}
${this._getTranslation("start_date_offset_note")}
`:Q``})()}
${this._getTranslation("compact_mode")}
${this._getTranslation("compact_mode_note")}
${this.addTextField("compact_days_to_show",this._getTranslation("compact_days_to_show"),"number")}
${this.addTextField("compact_events_to_show",this._getTranslation("compact_events_to_show"),"number")}
${this.addBooleanField("compact_events_complete_days",this._getTranslation("compact_events_complete_days"))}
${this._getTranslation("compact_events_complete_days_note")}
${this._getTranslation("event_visibility")}
${this.addBooleanField("show_past_events",this._getTranslation("show_past_events"))}
${this.addBooleanField("show_empty_days",this._getTranslation("show_empty_days"))}
${this.addBooleanField("filter_duplicates",this._getTranslation("filter_duplicates"))}
${this._getTranslation("language_time_formats")}
${this.addSelectField("language_mode",this._getTranslation("language_mode"),[{value:"system",label:this._getTranslation("system")},{value:"custom",label:this._getTranslation("custom")}],!1,void 0!==this.getConfigValue("language")?"custom":"system")}
${(()=>void 0!==this.getConfigValue("language")?Q`
${this.addTextField("language",this._getTranslation("language_code"))}
${this._getTranslation("language_code_note")}
`:Q``)()}
${this.addSelectField("time_24h",this._getTranslation("time_24h"),[{value:"system",label:this._getTranslation("system")},{value:"true",label:this._getTranslation("24h")},{value:"false",label:this._getTranslation("12h")}])}
`)}
${this.addExpansionPanel(this._getTranslation("appearance_layout"),"M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z",Q`
${this._getTranslation("title_styling")}
${this.addTextField("title",this._getTranslation("title"))}
${this.addTextField("title_font_size",this._getTranslation("title_font_size"))}
${this.addTextField("title_color",this._getTranslation("title_color"))}
${this._getTranslation("card_styling")}
${this.addTextField("background_color",this._getTranslation("background_color"))}
${this.addSelectField("height_mode",this._getTranslation("height_mode"),[{value:"auto",label:this._getTranslation("auto")},{value:"fixed",label:this._getTranslation("fixed")},{value:"maximum",label:this._getTranslation("maximum")}],!1,(()=>void 0!==this.getConfigValue("height")&&"auto"!==this.getConfigValue("height")?"fixed":void 0!==this.getConfigValue("max_height")&&"none"!==this.getConfigValue("max_height")?"maximum":"auto")())}
${(()=>void 0!==this.getConfigValue("height")&&"auto"!==this.getConfigValue("height")?Q`
${this.addTextField("height",this._getTranslation("height_value"))}
${this._getTranslation("fixed_height_note")}
`:void 0!==this.getConfigValue("max_height")&&"none"!==this.getConfigValue("max_height")?Q`
${this.addTextField("max_height",this._getTranslation("height_value"))}
${this._getTranslation("max_height_note")}
`:Q``)()}
${this._getTranslation("event_styling")}
${this.addTextField("accent_color",this._getTranslation("accent_color"))}
${this.addTextField("event_background_opacity",this._getTranslation("event_background_opacity"),"number")}
${this.addTextField("vertical_line_width",this._getTranslation("vertical_line_width"))}
${this._getTranslation("spacing_alignment")}
${this.addTextField("day_spacing",this._getTranslation("day_spacing"))}
${this.addTextField("event_spacing",this._getTranslation("event_spacing"))}
${this.addTextField("additional_card_spacing",this._getTranslation("additional_card_spacing"))}
`)}
${this.addExpansionPanel(this._getTranslation("date_display"),"M7,10H12V15H7M19,19H5V8H19M19,3H18V1H16V3H8V1H6V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3Z",Q`
${this._getTranslation("vertical_alignment")}
${this.addSelectField("date_vertical_alignment",this._getTranslation("date_vertical_alignment"),[{value:"top",label:this._getTranslation("top")},{value:"middle",label:this._getTranslation("middle")},{value:"bottom",label:this._getTranslation("bottom")}])}
${this._getTranslation("date_formatting")}
${this._getTranslation("weekday_font")}
${this.addTextField("weekday_font_size",this._getTranslation("weekday_font_size"))}
${this.addTextField("weekday_color",this._getTranslation("weekday_color"))}
${this._getTranslation("day_font")}
${this.addTextField("day_font_size",this._getTranslation("day_font_size"))}
${this.addTextField("day_color",this._getTranslation("day_color"))}
${this._getTranslation("month_font")}
${this.addBooleanField("show_month",this._getTranslation("show_month"))}
${this.addTextField("month_font_size",this._getTranslation("month_font_size"))}
${this.addTextField("month_color",this._getTranslation("month_color"))}
${this._getTranslation("weekend_highlighting")}
${this.addTextField("weekend_weekday_color",this._getTranslation("weekend_weekday_color"))}
${this.addTextField("weekend_day_color",this._getTranslation("weekend_day_color"))}
${this.addTextField("weekend_month_color",this._getTranslation("weekend_month_color"))}
${this._getTranslation("today_highlighting")}
${this.addTextField("today_weekday_color",this._getTranslation("today_weekday_color"))}
${this.addTextField("today_day_color",this._getTranslation("today_day_color"))}
${this.addTextField("today_month_color",this._getTranslation("today_month_color"))}
${this._getTranslation("today_indicator")}
${this.addTodayIndicatorField("today_indicator",this._getTranslation("today_indicator"))}
${(()=>{const e=this.getConfigValue("today_indicator");return e&&"none"!==e?Q`
${this.addTextField("today_indicator_position",this._getTranslation("today_indicator_position"))}
${this.addTextField("today_indicator_color",this._getTranslation("today_indicator_color"))}
${this.addTextField("today_indicator_size",this._getTranslation("today_indicator_size"))}
`:Q``})()}
${this._getTranslation("week_numbers_separators")}
${this._getTranslation("week_numbers")}
${this.addSelectField("first_day_of_week",this._getTranslation("first_day_of_week"),[{value:"system",label:this._getTranslation("system")},{value:"sunday",label:this._getTranslation("sunday")},{value:"monday",label:this._getTranslation("monday")}])}
${this.addSelectField("show_week_numbers",this._getTranslation("show_week_numbers"),[{value:"null",label:this._getTranslation("none")},{value:"iso",label:"ISO"},{value:"simple",label:this._getTranslation("simple")}])}
${(()=>{const e=this.getConfigValue("show_week_numbers");return"iso"===e?Q`
${this._getTranslation("week_number_note_iso")}
`:"simple"===e?Q`
${this._getTranslation("week_number_note_simple")}
`:Q``})()}
${(()=>{const e=this.getConfigValue("show_week_numbers");return e&&"null"!==e?Q`
${this.addBooleanField("show_current_week_number",this._getTranslation("show_current_week_number"))}
${this.addTextField("week_number_font_size",this._getTranslation("week_number_font_size"))}
${this.addTextField("week_number_color",this._getTranslation("week_number_color"))}
${this.addTextField("week_number_background_color",this._getTranslation("week_number_background_color"))}
`:Q``})()}
${this._getTranslation("day_separator")}
${this.addBooleanField("day_separator_toggle",this._getTranslation("show_day_separator"),"0px"!==this.getConfigValue("day_separator_width")&&"0"!==this.getConfigValue("day_separator_width"),(e=>{e.target.checked?this.setConfigValue("day_separator_width","1px"):this.setConfigValue("day_separator_width","0px")}),!0)}
${(()=>"0px"!==this.getConfigValue("day_separator_width")&&"0"!==this.getConfigValue("day_separator_width")?Q`
${this.addTextField("day_separator_width",this._getTranslation("day_separator_width"))}
${this.addTextField("day_separator_color",this._getTranslation("day_separator_color"))}
`:Q``)()}
${this._getTranslation("week_separator")}
${this.addBooleanField("week_separator_toggle",this._getTranslation("show_week_separator"),"0px"!==this.getConfigValue("week_separator_width")&&"0"!==this.getConfigValue("week_separator_width"),(e=>{e.target.checked?this.setConfigValue("week_separator_width","1px"):this.setConfigValue("week_separator_width","0px")}),!0)}
${(()=>"0px"!==this.getConfigValue("week_separator_width")&&"0"!==this.getConfigValue("week_separator_width")?Q`
${this.addTextField("week_separator_width",this._getTranslation("week_separator_width"))}
${this.addTextField("week_separator_color",this._getTranslation("week_separator_color"))}
`:Q``)()}
${this._getTranslation("month_separator")}
${this.addBooleanField("month_separator_toggle",this._getTranslation("show_month_separator"),"0px"!==this.getConfigValue("month_separator_width")&&"0"!==this.getConfigValue("month_separator_width"),(e=>{e.target.checked?this.setConfigValue("month_separator_width","1px"):this.setConfigValue("month_separator_width","0px")}),!0)}
${(()=>"0px"!==this.getConfigValue("month_separator_width")&&"0"!==this.getConfigValue("month_separator_width")?Q`
${this.addTextField("month_separator_width",this._getTranslation("month_separator_width"))}
${this.addTextField("month_separator_color",this._getTranslation("month_separator_color"))}
`:Q``)()}
`)}
${this.addExpansionPanel(this._getTranslation("event_display"),"M20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20M5,13V15H16V13H5M5,9V11H19V9H5Z",Q`
${this._getTranslation("event_title")}
${this.addTextField("event_font_size",this._getTranslation("event_font_size"))}
${this.addTextField("event_color",this._getTranslation("event_color"))}
${this.addTextField("empty_day_color",this._getTranslation("empty_day_color"))}
${this._getTranslation("time")}
${this.addBooleanField("show_time",this._getTranslation("show_time"))}
${(()=>!0!==this.getConfigValue("show_time")?Q``:Q`
${this.addBooleanField("show_single_allday_time",this._getTranslation("show_single_allday_time"))}
${this.addBooleanField("show_end_time",this._getTranslation("show_end_time"))}
${this.addTextField("time_font_size",this._getTranslation("time_font_size"))}
${this.addTextField("time_color",this._getTranslation("time_color"))}
${this.addTextField("time_icon_size",this._getTranslation("time_icon_size"))}
`)()}
${this._getTranslation("location")}
${this.addBooleanField("show_location",this._getTranslation("show_location"))}
${(()=>!0!==this.getConfigValue("show_location")?Q``:Q`
${this.addTextField("location_font_size",this._getTranslation("location_font_size"))}
${this.addTextField("location_color",this._getTranslation("location_color"))}
${this.addTextField("location_icon_size",this._getTranslation("location_icon_size"))}
${this.addSelectField("remove_location_country_selector",this._getTranslation("remove_location_country"),[{value:"false",label:this._getTranslation("none")},{value:"true",label:this._getTranslation("simple")},{value:"custom",label:this._getTranslation("custom")}],!1,(()=>{if(!this._config||!this._config.hasOwnProperty("remove_location_country"))return"false";const e=this._config.remove_location_country;return!0===e||"true"===e?"true":!1===e||"false"===e?"false":"string"==typeof e?"custom":"false"})(),(e=>{"true"===e?this.setConfigValue("remove_location_country",!0):"false"===e?this.setConfigValue("remove_location_country",!1):"custom"===e&&this._config&&"custom"!==this._config.remove_location_country&&"string"!=typeof this._config.remove_location_country&&this.setConfigValue("remove_location_country","USA|United States|Canada")}))}
${(()=>{if(!this._config||!this._config.hasOwnProperty("remove_location_country")||!0===this._config.remove_location_country||!1===this._config.remove_location_country||"true"===this._config.remove_location_country||"false"===this._config.remove_location_country)return Q``;const e=this._config.remove_location_country;return"string"==typeof e&&"true"!==e&&"false"!==e?Q`
this.setConfigValue("remove_location_country",e.target.value)}"
>
${this._getTranslation("custom_country_pattern_note")}
`:Q``})()}
`)()}
${this._getTranslation("progress_indicators")}
${this.addBooleanField("show_countdown",this._getTranslation("show_countdown"))}
${this.addBooleanField("show_progress_bar",this._getTranslation("show_progress_bar"))}
${(()=>!0!==this.getConfigValue("show_progress_bar")?Q``:Q`
${this.addTextField("progress_bar_color",this._getTranslation("progress_bar_color"))}
${this.addTextField("progress_bar_height",this._getTranslation("progress_bar_height"))}
${this.addTextField("progress_bar_width",this._getTranslation("progress_bar_width"))}
`)()}
${this._getTranslation("multiday_event_handling")}
${this.addBooleanField("split_multiday_events",this._getTranslation("split_multiday_events"))}
`)}
${this.addExpansionPanel(this._getTranslation("weather_integration"),"M12.74,5.47C15.1,6.5 16.35,9.03 15.92,11.46C17.19,12.56 18,14.19 18,16V16.17C18.31,16.06 18.65,16 19,16A3,3 0 0,1 22,19A3,3 0 0,1 19,22H6A4,4 0 0,1 2,18A4,4 0 0,1 6,14H6.27C5,12.45 4.6,10.24 5.5,8.26C6.72,5.5 9.97,4.24 12.74,5.47M11.93,7.3C10.16,6.5 8.09,7.31 7.31,9.07C6.85,10.09 6.93,11.22 7.41,12.13C8.5,10.83 10.16,10 12,10C12.7,10 13.38,10.12 14,10.34C13.94,9.06 13.18,7.86 11.93,7.3M13.55,3.64C13,3.4 12.45,3.23 11.88,3.12L14.37,1.82L15.27,4.71C14.76,4.29 14.19,3.93 13.55,3.64M6.09,4.44C5.6,4.79 5.17,5.19 4.8,5.63L4.91,2.82L7.87,3.5C7.25,3.71 6.65,4.03 6.09,4.44M18,9.71C17.91,9.12 17.78,8.55 17.59,8L19.97,9.5L17.92,11.73C18.03,11.08 18.05,10.4 18,9.71M3.04,11.3C3.11,11.9 3.24,12.47 3.43,13L1.06,11.5L3.1,9.28C3,9.93 2.97,10.61 3.04,11.3M19,18H16V16A4,4 0 0,0 12,12A4,4 0 0,0 8,16H6A2,2 0 0,0 4,18A2,2 0 0,0 6,20H19A1,1 0 0,0 20,19A1,1 0 0,0 19,18Z",Q`
${this._getTranslation("weather_entity_position")}
${this.addEntityPickerField("weather.entity",this._getTranslation("weather_entity"),["weather"])}
${(()=>this.getConfigValue("weather.entity")?Q`
${this.addSelectField("weather.position",this._getTranslation("weather_position"),[{value:"none",label:this._getTranslation("none")},{value:"date",label:this._getTranslation("date")},{value:"event",label:this._getTranslation("event")},{value:"both",label:this._getTranslation("both")}])}
${(()=>{const e=this.getConfigValue("weather.position","none");return Q`
${"date"===e||"both"===e?Q`
${this._getTranslation("date_column_weather")}
${this.addBooleanField("weather.date.show_conditions",this._getTranslation("show_conditions"))}
${this.addBooleanField("weather.date.show_high_temp",this._getTranslation("show_high_temp"))}
${this.addBooleanField("weather.date.show_low_temp",this._getTranslation("show_low_temp"))}
${this.addTextField("weather.date.icon_size",this._getTranslation("icon_size"))}
${this.addTextField("weather.date.font_size",this._getTranslation("font_size"))}
${this.addTextField("weather.date.color",this._getTranslation("color"))}
`:Q``}
${"event"===e||"both"===e?Q`
${this._getTranslation("event_row_weather")}
${this.addBooleanField("weather.event.show_conditions",this._getTranslation("show_conditions"))}
${this.addBooleanField("weather.event.show_temp",this._getTranslation("show_temp"))}
${this.addTextField("weather.event.icon_size",this._getTranslation("icon_size"))}
${this.addTextField("weather.event.font_size",this._getTranslation("font_size"))}
${this.addTextField("weather.event.color",this._getTranslation("color"))}
`:Q``}
`})()}
`:Q``)()}
`)}
${this.addExpansionPanel(this._getTranslation("interactions"),"M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M9,12.44V9A2,2 0 0,1 11,7A2,2 0 0,1 13,9V12.44C14.19,11.75 15,10.47 15,9A4,4 0 0,0 11,5A4,4 0 0,0 7,9C7,10.47 7.81,11.75 9,12.44Z",Q`
${this._getTranslation("tap_action")}
${this._renderActionConfig("tap_action")}
${this._getTranslation("hold_action")}
${this._renderActionConfig("hold_action")}
${this._getTranslation("refresh_settings")}
${this.addTextField("refresh_interval",this._getTranslation("refresh_interval"),"number")}
${this.addBooleanField("refresh_on_navigate",this._getTranslation("refresh_on_navigate"))}
`)}
`}addTextField(e,t,a,n){let i=this.getConfigValue(e,n);return void 0===i&&(i=""),Q`
${this.addButton(this._getTranslation("remove"),"mdi:trash-can",(()=>this._removeCalendarEntity(t)))}
${a?Q`
${this.addButton(this._getTranslation("convert_to_advanced"),"mdi:code-json",(()=>this._convertEntityToObject(t)))}
`:Q``}
`)}
`}_renderCalendarEntities(){var e;const t=(null==(e=this._config)?void 0:e.entities)||[];return Q`
${t.map(((e,t)=>this._renderCalendarEntity(e,t)))}
${this.addButton(this._getTranslation("add_calendar"),"mdi:plus",(()=>this._addCalendarEntity()))}
`}_addCalendarEntity(){var e;const t=[...(null==(e=this._config)?void 0:e.entities)||[]];t.push({entity:"calendar.calendar"}),this.setConfigValue("entities",t)}_removeCalendarEntity(e){var t;const a=[...(null==(t=this._config)?void 0:t.entities)||[]];a.splice(e,1),this.setConfigValue("entities",a)}_convertEntityToObject(e){var t;const a=[...(null==(t=this._config)?void 0:t.entities)||[]],n=a[e];a[e]={entity:n},this.setConfigValue("entities",a)}_renderActionConfig(e){const t=this.getConfigValue(e,{action:"none"}),a=t.action||"none";return Q`