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C;QACjD,CAAC;IACH,CAAC;IAED,wBAAwB;QACtB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,aAAa;QACX,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,oBAAoB;QAClB,OAAO,EAAE,CAAC;IACZ,CAAC;;AAlCM,uBAAU,GAAW,CAAX,AAAY,CAAC;AAqChC,MAAM,OAAO,YAAa,SAAQ,YAAY;IAgB5C;QACE,SAAS;QACT,KAAK,EAAE,CAAC;QAhBV,OAAE,GAAW,YAAY,CAAC,UAAU,GAAG,CAAC,CAAC;QACzC,SAAI,GAAW,mBAAmB,CAAC,KAAK,CAAC;QACzC,cAAS,GAAY,IAAI,CAAC;QAC1B,iBAAY,GAAW,CAAC,CAAC;QAEzB,0BAAqB,GAAa,EAAE,CAAC;QACrC,wBAAmB,GAAa,EAAE,CAAC;QACnC,UAAK,GAAa,CAAC,UAAU,CAAC,CAAC;QAC/B,SAAI,GAAa,CAAC,OAAO,CAAC,CAAC;QAC3B,0CAAqC,GAAa,EAAE,CAAC;QACrD,sCAAiC,GAAa,EAAE,CAAC;QACjD,0CAAqC,GAAa,EAAE,CAAC;QACrD,wCAAmC,GAAa,EAAE,CAAC;QAKjD,YAAY,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC;IAEM,MAAM,CAAC,YAAY;QACxB,OAAO,YAAY,CAAC,UAAU,CAAC;IACjC,CAAC;;AAvBM,uBAAU,GAAW,CAAX,AAAY,CAAC","file":"daytool_entity.js","sourcesContent":["import { div__clipboard, input__clipboard_date } from \"../constants.js\";\nimport { reset_casting } from \"../helpers.js\";\nimport { DAYTOOL } from \"./daytool.js\";\nimport { DAYTOOL_ENTITY_TYPE } from \"./daytool_nav.js\";\nimport { daytool_reaction } from \"./daytool_reaction.js\";\nimport { reset_actions } from \"./UI/daytool_actions.js\";\nimport { MICROSOFT_RECURRENCE_PATTERN_TYPE, MICROSOFT_RECURRENCE_RANGE_TYPE, DateTimeTimeZone, google_event, microsoft_event, DAYTOOL_PERIOD_UNITS } from \"./UI/daytool_event.js\";\nimport { daytool_injector } from \"./UI/daytool_injector.js\";\nimport { daytool_note_attachment } from \"./UI/daytool_note.js\";\nimport { daytool_plan_item } from \"./UI/daytool_plan.js\";\nimport { DAYTOOL_STAT_UNITS } from \"./UI/daytool_stat.js\";\nimport { daytool_templates } from \"./UI/daytool_templates.js\";\n\n\nexport class daytool_entity_change {\n attribute_id: string = \"\";\n attribute_old_value: any = null;\n attribute_new_value: any = null;\n change_timestamp: number = 0;\n}\n\nexport class daytool_clipboard {\n date: string[] = [];\n entities: number[][] = [];\n constructor() {\n const now = new Date();\n const yyyy = now.getFullYear();\n const mm = String(now.getMonth() + 1).padStart(2, '0'); // Months are 0-based\n const dd = String(now.getDate()).padStart(2, '0');\n const formattedDate = `${yyyy}-${mm}-${dd}`;\n this.date.push(formattedDate);\n this.entities.push([]);\n }\n}\n\nexport class daytool_entity {\n // Counter\n static entity_count: number = 0;\n\n // Uneditable\n id: number = null;\n type: string = \"\";\n creation_timestamp: number = new Date().getTime();\n // entity_id are unique to entities {steps, needs, stats, goals, persons, events, cases}\n entity_id: number = daytool_entity.entity_count + 1;\n\n // System Editable\n isCancelled: boolean = false;\n imported: boolean = false;\n highlight: boolean = false;\n last_update_timestamp: number[] = [new Date().getTime()];\n list_weight: number[] = [this.id];\n changes: daytool_entity_change[] = [];\n\n // User Editable - Multiple\n title: string[] = [\"\"];\n description: string[] = [\"\"];\n links: number[] = [];\n icon: string[] = [\"\"];\n microicon: string[] = [\"\"];\n pinned: boolean = false;\n\n constructor() {\n daytool_entity.entity_count++;\n }\n\n public static getEntityCount() {\n return daytool_entity.entity_count;\n }\n\n returnEntityCardDOM () {\n var lists = document.getElementsByClassName('dt_list');\n for (var f=0;f < lists.length; f++) {\n var entities = document.getElementsByClassName('entity');\n for (var e = 0; e < entities.length; e++) {\n if(parseInt(entities[e].getAttribute('data-entity-id')) == this.id) {\n var entity = entities[e];\n return entity;\n }\n }\n }\n }\n\n returnEntityClipboardDOM () {\n var entities = div__clipboard.getElementsByClassName('entity');\n for (var e = 0; e < entities.length; e++) {\n if(parseInt(entities[e].getAttribute('data-entity-id')) == this.id) {\n var entity = entities[e];\n return entity;\n }\n }\n }\n\n returnIfOnClipboardForCurrentDate() {\n var curr_date = new Date(input__clipboard_date.value);\n curr_date.setUTCDate(curr_date.getUTCDate() + 1);\n const yyyy = curr_date.getUTCFullYear();\n const mm = String(curr_date.getUTCMonth() + 1).padStart(2, '0'); // Months are 0-based\n const dd = String(curr_date.getUTCDate()).padStart(2, '0');\n const formattedDate = `${yyyy}-${mm}-${dd}`;\n var key = DAYTOOL.clipboard.date.indexOf(formattedDate);\n var entity_ids = DAYTOOL.clipboard.entities[key];\n if (!(entity_ids === undefined) && entity_ids.includes(this.entity_id)) {\n return true;\n } else {\n return false;\n }\n }\n}\n\nexport class daytool_event extends daytool_entity {\n // Counter\n static event_count: number = 0;\n static recurring_series_id: number = 0;\n\n // Uneditable\n id: number = daytool_event.event_count + 1;\n type: string = DAYTOOL_ENTITY_TYPE.Events;\n\n // System Editable\n ical_id: string;\n recurrence: {\n recurring_series_id: number | null;\n next_repetition_number: number;\n recurrence_pattern: {\n dayOfMonth: number;\n daysOfWeek: string[];\n firstDayOfWeek: string;\n index: string;\n interval: number;\n month: number;\n type: MICROSOFT_RECURRENCE_PATTERN_TYPE | null;\n };\n recurrence_range: {\n startDate: Date | null;\n endDate: Date | null;\n numberOfOccurrences: number;\n recurrenceTimeZone: string;\n type: MICROSOFT_RECURRENCE_RANGE_TYPE | null;\n };\n } = {\n recurring_series_id: null,\n next_repetition_number: 0,\n recurrence_pattern: {\n dayOfMonth: 0,\n daysOfWeek: [],\n firstDayOfWeek: \"\",\n index: \"\",\n interval: 0,\n month: 0,\n type: null,\n },\n recurrence_range: {\n startDate: null,\n endDate: null,\n numberOfOccurrences: 0,\n recurrenceTimeZone: \"\",\n type: null,\n },\n };\n completed_iterations_entity_id: [] = [];\n location: string[] = [];\n days_skipped: string[] = [];\n\n // GOOGLE FIELDS\n google: boolean = false;\n g_event: google_event = null;\n\n // MICROSOFT FIELDS\n microsoft: boolean = false;\n m_event: microsoft_event = null;\n\n // User Editable - Once\n isAllDay: boolean = false;\n\n // User Editable - Multiple\n event_active: boolean = true;\n title: string[] = [\"New Event\"];\n icon: string[] = [\"events\"];\n organizer__person_entity_id: number[][] = [[]];\n attendees__person_entity_id: number[]\n reminder_millisec: number[] = [15 * 60 * 1000]; // 15 minute Reminder by default\n tolerance_millisec: number[] = [0]; // No Tolerance by default\n timing: {\n start: DateTimeTimeZone[];\n end: DateTimeTimeZone[];\n } = {\n start: [],\n end: [],\n };\n all_day: boolean = false;\n recurring: boolean = false;\n recurrence_ends: boolean = false;\n\n // Construsts a boilerplate event that needs to setup further\n constructor(\n icalId: string | null,\n startTimestamp: number | null,\n endTimestamp: number | null\n ) {\n // Global\n super();\n this.ical_id = icalId;\n\n if (!startTimestamp) {\n var new_date = new Date();\n this.timing.start = [{\n date: new_date.toDateString(),\n dateTime: new_date.toISOString(),\n timeZone: new Intl.DateTimeFormat(\"en-US\").format(new_date),\n }];\n this.recurrence.recurrence_range.startDate = new_date;\n } else {\n var new_date = new Date(startTimestamp);\n this.timing.start = [{\n date: new_date.toDateString(),\n dateTime: new_date.toISOString(),\n timeZone: new Intl.DateTimeFormat(\"en-US\").format(new_date),\n }];\n this.recurrence.recurrence_range.startDate = new_date;\n }\n if (!endTimestamp) {\n var new_date = new Date();\n this.timing.end = [{\n date: new_date.toDateString(),\n dateTime: new_date.toISOString(),\n timeZone: new Intl.DateTimeFormat(\"en-US\").format(new_date),\n }];\n this.recurrence.recurrence_range.endDate = new_date;\n } else {\n var new_date = new Date(endTimestamp);\n this.timing.end = [{\n date: new_date.toDateString(),\n dateTime: new_date.toISOString(),\n timeZone: new Intl.DateTimeFormat(\"en-US\").format(new_date),\n }];\n this.recurrence.recurrence_range.endDate = new_date;\n }\n daytool_event.event_count++;\n }\n\n public static getEventCount() {\n return daytool_event.event_count;\n }\n\n registerRecurringSeriesId() {\n daytool_event.recurring_series_id++;\n this.recurrence.recurring_series_id = daytool_event.recurring_series_id;\n }\n}\n\nexport class daytool_case extends daytool_entity {\n // Counter\n static case_count: number = 0;\n\n // Uneditable\n id: number = daytool_case.case_count + 1;\n type: string = DAYTOOL_ENTITY_TYPE.Cases;\n\n // System Editable\n shared_with: daytool_person[][] = [[]];\n\n // User Editable - Multiple\n title: string[] = [\"New Collection\"];\n icon: string[] = [\"cases\"];\n entities: daytool_entity[][] = [[]];\n\n constructor() {\n super();\n daytool_case.case_count++;\n }\n\n public static getCollectionCount() {\n return daytool_case.case_count;\n }\n}\n\nexport class daytool_feed extends daytool_case {\n // Counter\n static feed_count: number = 0;\n\n // Uneditable\n id: number = daytool_feed.feed_count + 1;\n type: string = DAYTOOL_ENTITY_TYPE.Feeds;\n\n // User Editable - Once\n url: string = \"\";\n\n // User Editable - Multiple\n title: string[] = [\"New Feed\"];\n icon: string[] = [\"feeds\"];\n\n constructor() {\n super();\n daytool_feed.feed_count++;\n }\n\n public static getFeedCount() {\n return daytool_feed.feed_count;\n }\n}\n\n\n\nexport class daytool_goal extends daytool_entity {\n // Counter\n static goal_count: number = 0;\n static recurring_series_id: number = 0;\n\n // Uneditable\n id: number = daytool_goal.goal_count + 1;\n type: string = DAYTOOL_ENTITY_TYPE.Goals;\n\n // System Editable\n sessions__daytool_event__entity_ids: number[];\n completed_iterations_entity_id: [] = [];\n current_state: string[] = ['not_started']; // States: not_started, started, paused, stopped\n\n // User Editable - Multiple\n title: string[] = [\"New Goal\"];\n icon: string[] = [\"goals\"];\n\n primary_objectives_plan_entity_id: number[] = [];\n secondary_objectives_plan_entity_id: number[] = [];\n bonus_objectives_plan_entity_id: number[] = [];\n\n timing__daytool_event__entity_ids:number[];\n\n constructor() {\n // Global\n super();\n daytool_goal.goal_count++;\n }\n\n public static getGoalCount() {\n return daytool_goal.goal_count;\n }\n}\n\nexport class daytool_note extends daytool_entity {\n // Counter\n static note_count: number = 0;\n\n // Uneditable\n id: number = daytool_note.note_count + 1;\n type: string = DAYTOOL_ENTITY_TYPE.Notes;\n list_weight: number[] = [new Date().getTime()];\n\n // User Editable - Multiple\n title: string[] = [\"New Note\"];\n icon: string[] = [\"notes\"];\n note_string: string[] = [\"\"];\n note_attachments: daytool_note_attachment[][];\n reactions: daytool_reaction[] = [];\n\n constructor() {\n super();\n daytool_note.note_count++;\n }\n\n setNoteString(input: string) {\n var parser = new DOMParser();\n var doc = parser.parseFromString(input, \"text/html\");\n // var sanitizedHTML = DOMPurify.sanitize(doc.body.innerHTML); TODO:\n this.note_string.push(doc.body.innerHTML);\n }\n\n}\n\nexport class daytool_person extends daytool_entity {\n // Counter\n static person_count: number = 0;\n\n // Uneditable\n id: number = daytool_person.person_count + 1;\n type: string = DAYTOOL_ENTITY_TYPE.Persons;\n self: boolean = false;\n\n // User Editable - Multiple\n title: string[] = [\"New Person\"];\n icon: string[] = [\"persons\"];\n first_name: string[] = [\"\"];\n last_name: string[] = [\"\"];\n email: string[] = [\"\"];\n phone_number: string[] = [\"\"];\n occupation: string[] = [\"\"];\n location: string[] = [\"\"];\n secondary_email: string[] = [\"\"];\n secondary_phone_number: string[] = [\"\"];\n\n constructor() {\n // Global\n super();\n daytool_person.person_count++;\n }\n\n public static getPersonCount() {\n return daytool_person.person_count;\n }\n}\n\nexport class daytool_plan extends daytool_entity {\n // Counter\n static plan_count: number = 0;\n\n // Uneditable\n id: number = daytool_plan.plan_count + 1;\n type: string = DAYTOOL_ENTITY_TYPE.Plans;\n\n // System Editable\n completed_iterations_entity_id: [] = [];\n\n // User Editable - Multiple\n title: string[] = [\"New Plan\"];\n icon: string[] = [\"plans\"];\n checklist: daytool_plan_item[][] = [[new daytool_plan_item()]];\n\n constructor() {\n // Global\n super();\n daytool_plan.plan_count++;\n }\n\n static addToPlan(entity_id: number, entity_type: string) {\n var entity = (\n DAYTOOL.getEntityByIdAndType(entity_id, entity_type)\n );\n var new_plan_item = new daytool_plan_item();\n\n entity.checklist.at(-1).push(new_plan_item);\n var casted_object = reset_casting([entity])[0];\n DAYTOOL.updateEntity(casted_object).then (()=>{\n var newElement = document.createElement(\"div\");\n newElement.innerHTML = daytool_templates.PlanItem(\n entity,\n new_plan_item.id,\n \"\"\n );\n var newElementCard = document.createElement(\"div\");\n newElementCard.innerHTML = daytool_templates.PlanItem(entity, new_plan_item.id, \"\");\n\n if (document\n .querySelector(\n `[data-entity-id=\"${entity_id}\"][data-entity-type=\"${entity_type}\"] .checklist.section .steps_list`\n )) {\n document\n .querySelector(\n `[data-entity-id=\"${entity_id}\"][data-entity-type=\"${entity_type}\"] .checklist.section .steps_list`\n )\n .appendChild(newElement.childNodes[0]);\n reset_actions(\n (\n document.querySelector(\n `[data-entity-id=\"${entity_id}\"][data-entity-type=\"${entity_type}\"] .checklist.section .steps_list`\n ).lastChild\n )\n );\n }\n\n\n\n var cards_to_update = document\n .querySelectorAll(\n `[data-entity-id=\"${entity_id}\"][data-entity-type=\"${entity_type}\"].entity_card .plan_items`\n );\n for (var c = 0; c < cards_to_update.length; c++) {\n var newElementCardClone = newElementCard.childNodes[0].cloneNode(true);\n cards_to_update[c].appendChild(newElementCardClone);\n reset_actions(cards_to_update[c].lastChild);\n }\n });\n }\n\n static addStatToPlanItem(targetDiv: HTMLElement) {\n\n var plan_item = targetDiv.closest(\"[data-plan-item-id]\");\n var plan_item_id = parseInt(plan_item.getAttribute(\"[data-plan-item-id]\"));\n var card = targetDiv.closest(\"[data-entity-id][data-entity-type].card\");\n var entityId = parseInt(card.getAttribute(\"data-entity-id\"));\n var entityType = card.getAttribute(\"data-entity-type\");\n var plan = DAYTOOL.getEntityByIdAndType(entityId, entityType);\n var plan_item_object = daytool_plan.getPlanItemById(plan, plan_item_id);\n\n var stat = new daytool_stat();\n\n plan_item_object.stats_entity_id.push(stat.entity_id);\n stat.imported = true;\n DAYTOOL.addEntity(stat);\n var casted_object = reset_casting([plan])[0];\n DAYTOOL.updateEntity(casted_object);\n // INCOMPLETE\n }\n\n static addNoteToPlanItem(targetDiv: HTMLElement) {\n var note = new daytool_note();\n note.imported = true;\n DAYTOOL.addEntity(note);\n var plan_item = targetDiv.closest(\"[data-plan-item-id]\");\n var plan_item_id = parseInt(plan_item.getAttribute(\"[data-plan-item-id]\"));\n var card = targetDiv.closest(\".card\");\n var entityId = parseInt(card.getAttribute(\"data-entity-id\"));\n var entityType = card.getAttribute(\"data-entity-type\");\n var plan = DAYTOOL.getEntityByIdAndType(entityId, entityType);\n var plan_item_object = daytool_plan.getPlanItemById(plan, plan_item_id);\n plan_item_object.notes_entity_id.push(note.entity_id);\n var casted_object = reset_casting([plan])[0];\n DAYTOOL.updateEntity(casted_object);\n // INCOMPLETE\n }\n\n static addNeedToPlanItem(targetDiv: HTMLElement) {\n var stat = new daytool_stat();\n stat.imported = true;\n DAYTOOL.addEntity(stat);\n var plan_item = targetDiv.closest(\"[data-plan-item-id]\");\n var plan_item_id = parseInt(plan_item.getAttribute(\"[data-plan-item-id]\"));\n var card = targetDiv.closest(\".card\");\n var entityId = parseInt(card.getAttribute(\"data-entity-id\"));\n var entityType = card.getAttribute(\"data-entity-type\");\n var plan = DAYTOOL.getEntityByIdAndType(entityId, entityType);\n var plan_item_object = daytool_plan.getPlanItemById(plan, plan_item_id);\n plan_item_object.needs_entity_id.push();\n var casted_object = reset_casting([plan])[0];\n DAYTOOL.updateEntity(casted_object);\n // INCOMPLETE\n }\n\n static getPlanItemById(plan:daytool_plan, id: number):daytool_plan_item {\n for ( var c = 0; c < plan.checklist.at(-1).length; c++ ) {\n var current_plan_item = plan.checklist.at(-1)[c];\n if (current_plan_item.id == id) {\n return current_plan_item;\n }\n }\n return null;\n }\n}\n\nexport class daytool_stat extends daytool_entity {\n static stat_count: number = 0;\n id: number = daytool_stat.stat_count + 1;\n stat_input_timestamp: number[] = [];\n stat_data: number[] = [];\n stat_unit:string = DAYTOOL_STAT_UNITS.Count;\n title: string[] = [\"New Stat\"];\n icon: string[] = [\"stats\"];\n type: string = DAYTOOL_ENTITY_TYPE.Stats;\n\n constructor() {\n // Global\n super();\n daytool_stat.stat_count++;\n }\n\n getStatUnit() {\n return this.stat_unit;\n }\n\n setStatUnit(stat_unit: string) {\n if (stat_unit in DAYTOOL_STAT_UNITS) {\n this.stat_unit = DAYTOOL_STAT_UNITS[stat_unit];\n }\n }\n\n present_day_stat_changes():string {\n return `0`;\n }\n\n returnDataLog():string {\n return ``;\n }\n returnDataLogPreview():string {\n return ``;\n }\n}\n\nexport class daytool_need extends daytool_goal {\n static need_count: number = 0;\n id: number = daytool_need.need_count + 1;\n type: string = DAYTOOL_ENTITY_TYPE.Needs;\n repeating: boolean = true;\n pulse_rating: number = 0;\n next_pulse_timestamp: number;\n preferred_start_times: number[] = [];\n preferred_end_times: number[] = [];\n title: string[] = [\"New Need\"];\n icon: string[] = [\"needs\"];\n suggestions__daytool_goal__entity_ids: number[] = [];\n timing__daytool_event__entity_ids: number[] = [];\n common_tasks_daytool_plan__entity_ids: number[] = [];\n key_stats__daytool_stat__entity_ids: number[] = [];\n\n constructor() {\n // Global\n super();\n daytool_need.need_count++;\n }\n\n public static getNeedCount() {\n return daytool_need.need_count;\n }\n}"]}