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CAAC;IACN,CAAC;IACD,wBAAwB;IACxB,MAAM,CAAC,cAAc;QACnB,OAAO,CACL,iBAAiB,CAAC,IAAI,CACpB,iDAAiD,EACjD,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,EAAE,EACF,EAAE,EACF,oBAAoB,EACpB,KAAK,EACL,EAAE,EACF,EAAE,EACF,IAAI,EACJ,SAAS,EACT,EAAE,EACF,IAAI,EACJ,gBAAgB,EAChB,EAAE,EACF,EAAE,CACH,CACF,CAAC;IACJ,CAAC;CACF","file":"daytool_buttons.js","sourcesContent":["import { DAYTOOL } from \"../daytool.js\";\r\nimport { daytool_entity, daytool_feed, daytool_stat } from \"../daytool_entity.js\";\r\nimport { DateTimeTimeZone } from \"./daytool_event.js\";\r\nimport { daytool_templates } from \"./daytool_templates.js\";\r\nimport { MONTHS_ABV } from \"../.././constants.js\";\r\n\r\nexport class daytool_buttons {\r\n // Generic Components\r\n // Head Components\r\n // LEFT DOM\r\n static completion_checkbox(completed: boolean): string {\r\n return daytool_templates.Pill(\r\n `bg-unfilled unfiltered mx-2 my-1`,\r\n true,\r\n false,\r\n completed ? true : false,\r\n false,\r\n true,\r\n 24,\r\n \"\",\r\n \"checkmark\",\r\n false,\r\n \"\",\r\n \"\",\r\n false,\r\n \"\",\r\n \"\",\r\n true,\r\n \"checklist_complete\",\r\n [],\r\n []\r\n );\r\n }\r\n\r\n static add_stat_to_plan_item(): string {\r\n return daytool_templates.Pill(\r\n `bg-unfilled unfiltered mx-1`,\r\n true,\r\n true,\r\n false,\r\n false,\r\n true,\r\n 24,\r\n \"bg-unfilled unfiltered\",\r\n \"stats\",\r\n true,\r\n \"bg-unfilled unfiltered\",\r\n \"add\",\r\n true,\r\n \"Add Stats\",\r\n \"\",\r\n true,\r\n \"add_plan_item\",\r\n [\"type\"],\r\n [\"stats\"]\r\n );\r\n }\r\n static stat_widget (entity:daytool_stat): string {\r\n return daytool_templates.Pill(\r\n `bg-unfilled unfiltered mx-1`,\r\n true,\r\n true,\r\n false,\r\n false,\r\n true,\r\n 24,\r\n \"bg-unfilled unfiltered\",\r\n \"stats\",\r\n true,\r\n \"bg-unfilled unfiltered\",\r\n \"add\",\r\n true,\r\n entity.present_day_stat_changes(),\r\n \"\",\r\n true,\r\n \"stat_settings\",\r\n [\"type\"],\r\n [\"stats\"]\r\n );\r\n\r\n }\r\n static refresh_button (entity:daytool_feed): string {\r\n return ``;\r\n\r\n }\r\n\r\n static add_note_to_note_button(): string {\r\n return daytool_templates.Pill(\r\n `bg-unfilled unfiltered me-2`,\r\n true,\r\n true,\r\n false,\r\n false,\r\n true,\r\n 24,\r\n \"bg-unfilled unfiltered\",\r\n \"notes\",\r\n true,\r\n \"bg-unfilled unfiltered\",\r\n \"add\",\r\n false,\r\n \"\",\r\n \"\",\r\n true,\r\n \"add_note_to_note\",\r\n [\"type\"],\r\n [\"stats\"]\r\n );\r\n }\r\n\r\n\r\n static play_button(state: string): string {\r\n // TODO: Update with daytool_goal.current_state\r\n return daytool_templates.Pill(\r\n `bg-unfilled unfiltered me-2`,\r\n true,\r\n false,\r\n state ? true : false,\r\n false,\r\n true,\r\n 24,\r\n \"\",\r\n \"play\",\r\n false,\r\n \"\",\r\n \"\",\r\n false,\r\n \"\",\r\n \"\",\r\n true,\r\n \"play\",\r\n [],\r\n []\r\n );\r\n }\r\n\r\n static event_button(start_timestamp:Date ): string {\r\n var label = ``;\r\n if (start_timestamp && start_timestamp.getTime() > 0) {\r\n const startHour = start_timestamp.getHours() % 12 || 12; // Convert 24-hour time to 12-hour time\r\n const startMinutes = start_timestamp.getMinutes().toString().padStart(2, \"0\");\r\n const startPeriod = start_timestamp.getHours() >= 12 ? \"PM\" : \"AM\";\r\n label = `${startHour}:${startMinutes} ${startPeriod}
${MONTHS_ABV[start_timestamp.getMonth()]} ${start_timestamp.getDate()}
`;\r\n }\r\n return daytool_templates.Pill(\r\n `bg-unfilled unfiltered ps-2 me-2 my-1`,\r\n false,\r\n false,\r\n false,\r\n false,\r\n true,\r\n 24,\r\n \"\",\r\n \"events\",\r\n false,\r\n \"\",\r\n \"\",\r\n start_timestamp && start_timestamp.getTime() > 0 ? true : false,\r\n label,\r\n \" me-2\",\r\n true,\r\n \"event_settings\",\r\n [],\r\n []\r\n );\r\n }\r\n\r\n static changeable_icon(icon_img_class: string, microicon_img_class:string): string {\r\n var icon_background = \"\";\r\n if (icon_img_class == 'food') {\r\n icon_background = \"bg-red-gradient\";\r\n } else if (icon_img_class == 'home') {\r\n icon_background = \"bg-purple-gradient\";\r\n } else if (icon_img_class == 'family') {\r\n icon_background = \"bg-blue-gradient\";\r\n } else if (icon_img_class == 'career') {\r\n icon_background = \"bg-teal-gradient\";\r\n } else if (icon_img_class == 'sleep') {\r\n icon_background = \"bg-green-gradient\";\r\n } else if (icon_img_class == 'health') {\r\n icon_background = \"bg-lime-gradient\";\r\n } else if (icon_img_class == 'friends') {\r\n icon_background = \"bg-gold-gradient\";\r\n } else if (icon_img_class == 'fun') {\r\n icon_background = \"bg-orange-gradient\";\r\n }\r\n return daytool_templates.Pill(\r\n `bg-unfilled unfiltered mx-2 my-1 no_interaction_till_expansion`,\r\n true,\r\n false,\r\n false,\r\n false,\r\n true,\r\n 24,\r\n icon_background,\r\n icon_img_class,\r\n microicon_img_class.length > 0 ? true : false,\r\n microicon_img_class.length > 0 ? \"bg-unfilled unfiltered\" : \"\",\r\n microicon_img_class,\r\n false,\r\n \"\",\r\n \"\",\r\n true,\r\n \"changeable_icon\",\r\n [],\r\n []\r\n );\r\n }\r\n // RIGHT DOM\r\n // Head Components\r\n static clipboard_toggle(active: boolean): string {\r\n return daytool_templates.Pill(\r\n `bg-unfilled unfiltered ms-2`,\r\n true,\r\n false,\r\n active ? true : false,\r\n false,\r\n true,\r\n 24,\r\n \"\",\r\n \"clipboard\",\r\n false,\r\n \"\",\r\n \"\",\r\n false,\r\n \"\",\r\n \"\",\r\n true,\r\n \"toggle_pinned\",\r\n [],\r\n []\r\n );\r\n }\r\n\r\n static link_toggle(active: boolean): string {\r\n return daytool_templates.Pill(\r\n `bg-unfilled unfiltered ms-auto me-2 link_toggle`,\r\n true,\r\n false,\r\n active ? true : false,\r\n false,\r\n true,\r\n 24,\r\n \"\",\r\n \"links\",\r\n false,\r\n \"\",\r\n \"\",\r\n false,\r\n \"\",\r\n \"\",\r\n true,\r\n \"links\",\r\n [],\r\n []\r\n );\r\n }\r\n\r\n static share_toggle(): string {\r\n return daytool_templates.Pill(\r\n `bg-unfilled unfiltered me-2 share_toggle`,\r\n true,\r\n false,\r\n false,\r\n false,\r\n true,\r\n 24,\r\n \"\",\r\n \"share\",\r\n false,\r\n \"\",\r\n \"\",\r\n false,\r\n \"\",\r\n \"\",\r\n true,\r\n \"share\",\r\n [],\r\n []\r\n );\r\n }\r\n\r\n static delete_button(): string {\r\n return daytool_templates.Pill(\r\n `bg-unfilled unfiltered me-2`,\r\n true,\r\n false,\r\n false,\r\n false,\r\n true,\r\n 24,\r\n \"\",\r\n \"cancel\",\r\n false,\r\n \"\",\r\n \"\",\r\n false,\r\n \"\",\r\n \"\",\r\n true,\r\n \"delete_entity_prompt\",\r\n [],\r\n []\r\n );\r\n }\r\n\r\n\r\n static ordering_buttons(): string {\r\n return (\r\n\r\n daytool_templates.Pill(\r\n `ordering_buttons up ms-2 me-1`,\r\n false,\r\n false,\r\n false,\r\n false,\r\n true,\r\n 24,\r\n \"\",\r\n \"back\",\r\n false,\r\n \"\",\r\n \"\",\r\n false,\r\n \"\",\r\n \"\",\r\n true,\r\n \"checklist_ordering_up\",\r\n [],\r\n []\r\n )\r\n )+\r\n daytool_templates.Pill(\r\n `ordering_buttons down`,\r\n false,\r\n false,\r\n false,\r\n false,\r\n true,\r\n 24,\r\n \"\",\r\n \"back\",\r\n false,\r\n \"\",\r\n \"\",\r\n false,\r\n \"\",\r\n \"\",\r\n true,\r\n \"checklist_ordering_down\",\r\n [],\r\n []\r\n );\r\n }\r\n // Clipboard Components:\r\n static history_button(): string {\r\n return (\r\n daytool_templates.Pill(\r\n `history_button bg-unfilled unfiltered mx-2 pe-2`,\r\n false,\r\n false,\r\n false,\r\n false,\r\n true,\r\n 24,\r\n \"\",\r\n \"timing_transparent\",\r\n false,\r\n \"\",\r\n \"\",\r\n true,\r\n \"History\",\r\n \"\",\r\n true,\r\n \"entity_history\",\r\n [],\r\n []\r\n )\r\n );\r\n }\r\n}"]}