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C;QAC3B,UAAK,GAAmB,EAAE,CAAC;QAC3B,YAAO,GAAqB,EAAE,CAAC;QAC/B,YAAO,GAAsB,EAAE,CAAC;QAChC,UAAK,GAAmB,EAAE,CAAC;QAC3B,kBAAa,GAAoB,EAAE,CAAC;QACpC,qBAAgB,GAAoB,EAAE,CAAC;QACvC,aAAQ,GAAqB,EAAE,CAAC;IAElC,CAAC;CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC","file":"daytool.js","sourcesContent":["import {\n reset_casting,\n returnDateFromDateTimeTimeZone,\n sort_items,\n} from \"../helpers.js\";\nimport { daytool_calendar, daytool_ical } from \"./daytool_calendar.js\";\nimport {\n daytool_case,\n daytool_entity,\n daytool_event,\n daytool_feed,\n daytool_goal,\n daytool_need,\n daytool_note,\n daytool_clipboard,\n daytool_person,\n daytool_plan,\n daytool_stat,\n} from \"./daytool_entity.js\";\nimport {\n deleteAllDatabases,\n calendarsService,\n needsService,\n goalsService,\n eventsService,\n plansService,\n casesService,\n feedsService,\n notesService,\n statsService,\n personsService,\n clipboardService,\n metadataService,\n} from \"./daytool_storage.js\";\n\nimport { google_event, microsoft_event } from \"./UI/daytool_event.js\";\nimport { daytool_injector } from \"./UI/daytool_injector.js\";\n\nimport { daytool_import_history } from \"./UI/daytool_import.js\";\nimport { daytool_notification } from \"./UI/daytool_notification.js\";\nimport { daytool_checkin } from \"./UI/daytool_survey.js\";\nimport { daytool_upload_history } from \"./UI/daytool_upload.js\";\n\nexport class daytool {\n /**\n * Stores all daytool json.\n * @param {daytool_metadata} metadata - Stores peripherial data.\n * @param {daytool_calendar[]} calendars - Stores daytool ical files and processed calendars.\n * @param {daytool_state} state - Stores active daytool entities.\n */\n metadata: daytool_metadata = null;\n calendars: daytool_calendar[] = [];\n state: daytool_state = new daytool_state();\n clipboard: daytool_clipboard = new daytool_clipboard();\n\n get Plans() {\n return this.state.plans;\n }\n\n set Plans(x: daytool_plan[]) {\n this.state.plans = x;\n }\n\n get Needs() {\n return this.state.needs;\n }\n\n set Needs(x: daytool_need[]) {\n this.state.needs = x;\n }\n\n get Notes() {\n return this.state.notes;\n }\n\n set Notes(x: daytool_note[]) {\n this.state.notes = x;\n }\n\n get Goals() {\n return this.state.goals;\n }\n\n set Goals(x: daytool_goal[]) {\n this.state.goals = x;\n }\n\n get Collections() {\n return this.state.cases;\n }\n\n set Collections(x: daytool_case[]) {\n this.state.cases = x;\n }\n\n get Persons() {\n return this.state.persons;\n }\n\n set Persons(x: daytool_person[]) {\n this.state.persons = x;\n }\n\n get Events() {\n return this.state.events;\n }\n\n set Events(x: daytool_event[]) {\n this.state.events = x;\n }\n\n get Stats() {\n return this.state.stats;\n }\n\n set Stats(x: daytool_stat[]) {\n this.state.stats = x;\n }\n\n get Clipboard() {\n return this.clipboard;\n }\n\n set Clipboard(x: daytool_clipboard) {\n this.clipboard = x;\n }\n\n async logout() {\n await deleteAllDatabases();\n // microsoftLogout();\n // googleLogout();\n if (location.protocol !== \"https:\") {\n window.location.href = \"http://\" + window.location.host + \"/index.php\";\n } else {\n window.location.href = \"https://\" + window.location.host + \"/index.php\";\n }\n }\n\n /** @type {daytool_calendar} */\n getCalendarById(id: number) {\n for (var c = 0; c < this.calendars.length; c++) {\n var current_calendar = this.calendars[c];\n if (current_calendar.id == id) {\n return current_calendar;\n }\n }\n }\n /** @type {daytool_calendar} */\n getCalendarByIcalId(ical_id: string) {\n for (var c = 0; c < this.calendars.length; c++) {\n var current_calendar = this.calendars[c];\n if (current_calendar.ical_id == ical_id) {\n return current_calendar;\n }\n }\n }\n\n save() {}\n\n /** @type {daytool_need[]|daytool_event[]|daytool_stat[]|daytool_goal[]|daytool_case[]|daytool_feed[]|daytool_note[]|daytool_person[]|daytool_plan[]} */\n getEntityArrayByType(entity_type: string) {\n entity_type = entity_type.toLowerCase();\n if (entity_type == \"needs\") {\n return this.state.needs;\n } else if (entity_type == \"goals\") {\n return this.state.goals;\n } else if (entity_type == \"cases\") {\n return this.state.cases;\n } else if (entity_type == \"persons\") {\n return this.state.persons;\n } else if (entity_type == \"events\") {\n return this.state.events;\n } else if (entity_type == \"plans\") {\n return this.state.plans;\n } else if (entity_type == \"notes\") {\n return this.state.notes;\n } else if (entity_type == \"stats\") {\n return this.state.stats;\n }\n }\n\n setEntityArrayByType(\n entity_type: string,\n new_array:\n | daytool_need[]\n | daytool_event[]\n | daytool_goal[]\n | daytool_case[]\n | daytool_feed[]\n | daytool_note[]\n | daytool_stat[]\n | daytool_person[]\n | daytool_plan[]\n ) {\n entity_type = entity_type.toLowerCase();\n if (entity_type == \"needs\") {\n this.Needs = new_array as daytool_need[];\n } else if (entity_type == \"goals\") {\n this.Goals = new_array as daytool_goal[];\n } else if (entity_type == \"cases\") {\n this.Collections = new_array as daytool_case[];\n } else if (entity_type == \"persons\") {\n this.Persons = new_array as daytool_person[];\n } else if (entity_type == \"events\") {\n this.Events = new_array as daytool_event[];\n } else if (entity_type == \"plans\") {\n this.Plans = new_array as daytool_plan[];\n } else if (entity_type == \"notes\") {\n this.Notes = new_array as daytool_note[];\n } else if (entity_type == \"stats\") {\n this.Stats = new_array as daytool_stat[];\n }\n }\n\n /** @type {boolean} */\n newCalendar(ical: daytool_ical) {\n if (ical) {\n } else {\n var new_calendar = new daytool_calendar(\"New Calendar\", true, \"\");\n this.calendars.push(new_calendar);\n }\n calendarsService.add(new_calendar);\n // this.rebuild_menu();\n }\n\n activateCalendar(id: number) {\n for (var i = 0; i < this.calendars.length; i++) {\n if (this.calendars[i].id == id) {\n this.calendars[i].active = true;\n calendarsService.update(this.calendars[i].id, this.calendars[i]);\n }\n }\n }\n\n deleteCalendar(id: number) {\n this.calendars.splice(id, 1);\n calendarsService.delete(id);\n }\n\n /** @type {daytool_event | daytool_plan | daytool_need | daytool_goal | daytool_case | daytool_feed | daytool_note | daytool_stat | daytool_person} */\n fetchEntity(entity_type: string, entity_id: number) {\n var array_to_search = this.getEntityArrayByType(entity_type);\n for (var a = 0; a < array_to_search.length; a++) {\n if (entity_id == array_to_search[a].id) {\n return array_to_search[a];\n }\n }\n return null;\n }\n\n /** @type {daytool_event | daytool_plan | daytool_need | daytool_goal | daytool_case | daytool_feed | daytool_note| daytool_stat | daytool_person} */\n async addEntity(\n entity:\n | daytool_event\n | daytool_plan\n | daytool_need\n | daytool_goal\n | daytool_case\n | daytool_feed\n | daytool_note\n | daytool_stat\n | daytool_person\n ) {\n this.state[entity.type].push(entity);\n if (entity instanceof daytool_need) {\n needsService.add(entity).catch((error) => {\n console.log(\"Add error: \" + error);\n });\n } else if (entity instanceof daytool_goal) {\n goalsService.add(entity).catch((error) => {\n console.log(\"Add error: \" + error);\n });\n } else if (entity instanceof daytool_event) {\n eventsService.add(entity).catch((error) => {\n console.log(\"Add error: \" + error);\n });\n } else if (entity instanceof daytool_plan) {\n plansService.add(entity).catch((error) => {\n console.log(\"Add error: \" + error);\n });\n } else if (entity instanceof daytool_case) {\n casesService.add(entity).catch((error) => {\n console.log(\"Add error: \" + error);\n });\n } else if (entity instanceof daytool_feed) {\n feedsService.add(entity).catch((error) => {\n console.log(\"Add error: \" + error);\n });\n } else if (entity instanceof daytool_note) {\n notesService.add(entity).catch((error) => {\n console.log(\"Add error: \" + error);\n });\n } else if (entity instanceof daytool_stat) {\n statsService.add(entity).catch((error) => {\n console.log(\"Add error: \" + error);\n });\n } else if (entity instanceof daytool_person) {\n personsService.add(entity).catch((error) => {\n console.log(\"Add error: \" + error);\n });\n }\n if (entity.imported == true) {\n daytool_injector.addToListDOM(entity);\n }\n }\n\n /** @type {daytool_event | daytool_plan | daytool_need | daytool_goal | daytool_case | daytool_feed | daytool_note | daytool_stat | daytool_person} */\n async updateEntity(\n entity:\n | daytool_event\n | daytool_plan\n | daytool_need\n | daytool_goal\n | daytool_case\n | daytool_feed\n | daytool_note\n | daytool_stat\n | daytool_person\n ) {\n if (entity instanceof daytool_need) {\n needsService.update(entity.id, entity).catch((error) => {\n console.log(\"Update error: \" + error);\n });\n } else if (entity instanceof daytool_goal) {\n goalsService.update(entity.id, entity).catch((error) => {\n console.log(\"Update error: \" + error);\n });\n } else if (entity instanceof daytool_event) {\n eventsService.update(entity.id, entity).catch((error) => {\n console.log(\"Update error: \" + error);\n });\n } else if (entity instanceof daytool_plan) {\n plansService.update(entity.id, entity).catch((error) => {\n console.log(\"Update error: \" + error);\n });\n } else if (entity instanceof daytool_case) {\n casesService.update(entity.id, entity).catch((error) => {\n console.log(\"Update error: \" + error);\n });\n } else if (entity instanceof daytool_feed) {\n feedsService.update(entity.id, entity).catch((error) => {\n console.log(\"Update error: \" + error);\n });\n } else if (entity instanceof daytool_note) {\n notesService.update(entity.id, entity).catch((error) => {\n console.log(\"Update error: \" + error);\n });\n } else if (entity instanceof daytool_stat) {\n statsService.update(entity.id, entity).catch((error) => {\n console.log(\"Update error: \" + error);\n });\n } else if (entity instanceof daytool_person) {\n personsService.update(entity.id, entity).catch((error) => {\n console.log(\"Update error: \" + error);\n });\n }\n }\n\n async updateClipboard() {\n clipboardService.updateLatest(DAYTOOL.clipboard).catch((error) => {\n console.log(\"Update Clipboard error: \" + error);\n });\n }\n\n async updateMetadata() {\n metadataService.updateLatest(DAYTOOL.metadata).catch((error) => {\n console.log(\"Update Metadata error: \" + error);\n });\n }\n\n getActiveCalendars() {\n var active_calendars: daytool_calendar[] = [];\n for (var i = 0; i < this.calendars.length; i++) {\n if (this.calendars[i].active) {\n active_calendars.push(this.calendars[i]);\n }\n }\n return active_calendars;\n }\n\n deleleEntity(\n entity:\n | daytool_event\n | daytool_plan\n | daytool_need\n | daytool_goal\n | daytool_case\n | daytool_feed\n | daytool_note\n | daytool_stat\n | daytool_person\n ) {\n var casted_entity = reset_casting([entity]).at(-1);\n var array_to_update = this.getEntityArrayByType(casted_entity.type);\n var new_array = [];\n for (var a = 0; a < array_to_update.length; a++) {\n if (casted_entity.id != array_to_update[a].id) {\n new_array.push(array_to_update[a]);\n }\n }\n this.setEntityArrayByType(casted_entity.type, new_array);\n if (casted_entity instanceof daytool_need) {\n needsService.delete(casted_entity.id).catch((error) => {\n console.log(\"Delete error: \" + error);\n });\n } else if (casted_entity instanceof daytool_goal) {\n goalsService.delete(casted_entity.id).catch((error) => {\n console.log(\"Delete error: \" + error);\n });\n } else if (casted_entity instanceof daytool_event) {\n eventsService.delete(casted_entity.id).catch((error) => {\n console.log(\"Delete error: \" + error);\n });\n } else if (casted_entity instanceof daytool_plan) {\n plansService.delete(casted_entity.id).catch((error) => {\n console.log(\"Delete error: \" + error);\n });\n } else if (casted_entity instanceof daytool_case) {\n casesService.delete(casted_entity.id).catch((error) => {\n console.log(\"Delete error: \" + error);\n });\n } else if (casted_entity instanceof daytool_feed) {\n feedsService.delete(casted_entity.id).catch((error) => {\n console.log(\"Delete error: \" + error);\n });\n } else if (casted_entity instanceof daytool_note) {\n notesService.delete(casted_entity.id).catch((error) => {\n console.log(\"Delete error: \" + error);\n });\n } else if (casted_entity instanceof daytool_stat) {\n statsService.delete(casted_entity.id).catch((error) => {\n console.log(\"Delete error: \" + error);\n });\n } else if (casted_entity instanceof daytool_person) {\n personsService.delete(casted_entity.id).catch((error) => {\n console.log(\"Delete error: \" + error);\n });\n }\n\n if (this.clipboard.entities.at(-1).includes(casted_entity.entity_id)) {\n var entity_array = this.clipboard.entities.at(-1);\n entity_array.splice(entity_array.indexOf(casted_entity.entity_id), 1);\n this.clipboard.entities.pop();\n this.clipboard.entities.push(entity_array);\n this.updateClipboard().then(() => {\n this.wipeFromDOM(\n '.entity_card[data-entity-id=\"' +\n casted_entity.id +\n '\"][data-entity-type=\"' +\n casted_entity.type +\n '\"], .entity_clipboard[data-entity-id=\"' +\n casted_entity.id +\n '\"][data-entity-type=\"' +\n casted_entity.type +\n '\"]'\n );\n });\n }\n }\n\n wipeFromDOM(selector: string) {\n var elements = document.querySelectorAll(selector);\n if (elements && elements.length > 0) {\n for (var e = 0; e < elements.length; e++) {\n var current_element = elements[e];\n current_element.classList.add(\"fadeOut\");\n }\n }\n\n setTimeout(() => {\n var elements = document.querySelectorAll(\".fadeOut\");\n for (var e = 0; e < elements.length; e++) {\n var current_element = elements[e];\n current_element.parentNode.removeChild(current_element);\n }\n }, 700);\n }\n\n /** @type {HTMLDivElement|[]} */\n getCardsByEntityType(entity_type: string) {\n var current_cards = document.getElementsByClassName(\"card\");\n var cards_to_return = [];\n for (var i = 0; i < current_cards.length; i++) {\n if (current_cards[i].getAttribute(\"data-entity-type\") == entity_type) {\n cards_to_return.push(current_cards[i]);\n }\n }\n return cards_to_return;\n }\n\n /** @type {HTMLDivElement[]} */\n getEntityCardsById(entity_id: number, repetition_number: number | null) {\n var current_cards = document.getElementsByClassName(\"card\");\n var cards_to_return: HTMLDivElement[] = [];\n for (var i = 0; i < current_cards.length; i++) {\n var current_card = current_cards[i];\n if (\n parseInt(current_card.getAttribute(\"data-entity-id\")) == entity_id &&\n current_card instanceof HTMLDivElement &&\n (repetition_number == null ||\n (repetition_number != null &&\n repetition_number ==\n parseInt(current_card.getAttribute(\"data-repetition-number\"))))\n ) {\n cards_to_return.push(current_card);\n }\n }\n return cards_to_return;\n }\n\n /** @type {HTMLDivElement[]} */\n getEventCellsById(event_id: number, repetition_number: number | null) {\n var current_cells = document.getElementsByClassName(\"ec\");\n var cells_to_return: HTMLDivElement[] = [];\n for (var i = 0; i < current_cells.length; i++) {\n var current_cell = current_cells[i];\n if (\n parseInt(current_cell.getAttribute(\"data-entity-id\")) == event_id &&\n current_cell instanceof HTMLDivElement &&\n (repetition_number == null ||\n (repetition_number != null &&\n repetition_number ==\n parseInt(current_cell.getAttribute(\"data-repetition-number\"))))\n ) {\n cells_to_return.push(current_cell);\n }\n }\n return cells_to_return;\n }\n\n /** @type {any[]|null} */\n getEntities() {\n var entities: any[] = [];\n var steps = this.getEntityArrayByType(\"plans\");\n var needs = this.getEntityArrayByType(\"needs\");\n var goals = this.getEntityArrayByType(\"goals\");\n var cases = this.getEntityArrayByType(\"cases\");\n var persons = this.getEntityArrayByType(\"persons\");\n var stats = this.getEntityArrayByType(\"stats\");\n var events = this.getEntityArrayByType(\"events\");\n var notes = this.getEntityArrayByType(\"notes\");\n var entity_arrays = [\n needs,\n goals,\n cases,\n persons,\n stats,\n events,\n steps,\n notes,\n ];\n for (var i = 0; i < entity_arrays.length; i++) {\n var current_entity_array = entity_arrays[i];\n if (current_entity_array) {\n for (var j = 0; j < current_entity_array.length; j++) {\n entities.push(current_entity_array[j]);\n }\n }\n }\n return entities;\n }\n\n /** @type {daytool_need|daytool_event|daytool_goal|daytool_case|daytool_feed|daytool_note|daytool_stat|daytool_person|daytool_plan|null} */\n getEntityByIdAndType(entity_id: number, entity_type: string) {\n var entities = this.getEntities();\n for (var i = 0; i < entities.length; i++) {\n if (entities[i].id == entity_id && entities[i].type == entity_type) {\n return entities[i];\n }\n }\n return null;\n }\n\n /** @type {daytool_need|daytool_event|daytool_goal|daytool_case|daytool_feed|daytool_note|daytool_stat|daytool_person|daytool_plan|null} */\n getEntityByObjectEntityId(entity_id: number) {\n var entities = this.getEntities();\n for (var i = 0; i < entities.length; i++) {\n if (entities[i].entity_id == entity_id) {\n return entities[i];\n }\n }\n return null;\n }\n\n /** @type {HTMLDivElement} */\n getCardDIVById(id: number) {\n var cards = document.getElementsByClassName(\"card\");\n var DIV: HTMLDivElement = null;\n for (var i = 0; i < cards.length; i++) {\n var current_card = cards[i];\n if (\n parseInt(cards[i].getAttribute(\"data-card-id\")) == id &&\n current_card instanceof HTMLDivElement\n ) {\n DIV = current_card;\n break;\n }\n }\n return DIV;\n }\n\n static importGoogleEvents() {\n if (localStorage.getItem(\"GOOGLE_CALENDARS\")) {\n var stored_string = localStorage.getItem(\"GOOGLE_CALENDARS\");\n var stored_calendars = <[]>JSON.parse(stored_string);\n for (var e = 0; e < stored_calendars.length; e++) {\n var stored_events = <[]>stored_calendars[e];\n for (var f = 0; f < stored_events.length; f++) {\n var stored_object = stored_events[e];\n if (stored_object) {\n console.log(\"Google Event:\");\n console.log(stored_object);\n var start = returnDateFromDateTimeTimeZone(stored_object.start);\n var end = returnDateFromDateTimeTimeZone(stored_object.end);\n var new_event = new daytool_event(\n stored_object.id,\n start.getTime(),\n end.getTime()\n );\n new_event.g_event = stored_object;\n daytool.formatImportedGoogleEvent(new_event);\n DAYTOOL.addEntity(new_event);\n }\n }\n }\n }\n }\n\n static importMicrosoftEvents() {\n if (localStorage.getItem(\"MICROSOFT_CALENDARS\")) {\n var stored_string = localStorage.getItem(\"MICROSOFT_CALENDARS\");\n var stored_objects = <[]>JSON.parse(stored_string);\n for (var e = 0; e < stored_objects.length; e++) {\n var stored_object = stored_objects[e];\n if (stored_object) {\n console.log(\"Microsoft Event:\");\n console.log(stored_object);\n var start = returnDateFromDateTimeTimeZone(stored_object.start);\n var end = returnDateFromDateTimeTimeZone(stored_object.end);\n var new_event = new daytool_event(\n stored_object.id,\n start.getTime(),\n end.getTime()\n );\n new_event.m_event = stored_object;\n daytool.formatImportedMicrosoftEvent(new_event);\n DAYTOOL.addEntity(new_event);\n }\n }\n }\n }\n\n static formatImportedGoogleEvent(event: daytool_event) {\n event.ical_id = event.g_event.id;\n event.title.push(event.g_event.summary);\n event.timing.start.push(event.g_event.start);\n event.timing.end.push(event.g_event.end);\n event.creation_timestamp = new Date(event.g_event.created).getTime();\n if (\n !event.last_update_timestamp.includes(\n new Date(event.g_event.updated).getTime()\n )\n ) {\n event.last_update_timestamp.push(\n new Date(event.g_event.updated).getTime()\n );\n }\n }\n static formatImportedMicrosoftEvent(event: daytool_event) {\n event.ical_id = event.m_event.id;\n event.title.push(event.m_event.subject);\n event.timing.start.push(event.m_event.start);\n event.timing.end.push(event.m_event.end);\n event.creation_timestamp = new Date(\n event.m_event.createdDateTime\n ).getTime();\n if (\n !event.last_update_timestamp.includes(\n new Date(event.m_event.lastModifiedDateTime).getTime()\n )\n ) {\n event.last_update_timestamp.push(\n new Date(event.m_event.lastModifiedDateTime).getTime()\n );\n }\n }\n}\n\nexport async function loadDAYTOOL() {\n var current_entity_count = 0;\n await needsService.getAll().then((n: daytool_need[]) => {\n var array_to_sort_over = [];\n var sub_array = [];\n for (var c = 0; c < n.length; c++) {\n sub_array = [n[c].list_weight, n[c]];\n array_to_sort_over.push(sub_array);\n }\n DAYTOOL.state.needs = sort_items(array_to_sort_over, \"dsc\");\n daytool_need.need_count = DAYTOOL.state.needs.length;\n current_entity_count += daytool_need.need_count;\n });\n await notesService.getAll().then((n: daytool_note[]) => {\n var array_to_sort_over = [];\n var sub_array = [];\n for (var c = 0; c < n.length; c++) {\n sub_array = [n[c].list_weight, n[c]];\n array_to_sort_over.push(sub_array);\n }\n DAYTOOL.state.notes = sort_items(array_to_sort_over, \"dsc\");\n daytool_note.note_count = DAYTOOL.state.notes.length;\n current_entity_count += daytool_note.note_count;\n });\n await statsService.getAll().then((n: daytool_stat[]) => {\n var array_to_sort_over = [];\n var sub_array = [];\n for (var c = 0; c < n.length; c++) {\n sub_array = [n[c].list_weight, n[c]];\n array_to_sort_over.push(sub_array);\n }\n DAYTOOL.state.stats = sort_items(array_to_sort_over, \"dsc\");\n daytool_stat.stat_count = DAYTOOL.state.stats.length;\n current_entity_count += daytool_stat.stat_count;\n });\n await goalsService.getAll().then((n: daytool_goal[]) => {\n var array_to_sort_over = [];\n var sub_array = [];\n for (var c = 0; c < n.length; c++) {\n sub_array = [n[c].list_weight, n[c]];\n array_to_sort_over.push(sub_array);\n }\n DAYTOOL.state.goals = sort_items(array_to_sort_over, \"dsc\");\n daytool_goal.goal_count = DAYTOOL.state.goals.length;\n current_entity_count += daytool_goal.goal_count;\n });\n await plansService.getAll().then((n: daytool_plan[]) => {\n var array_to_sort_over = [];\n var sub_array = [];\n for (var c = 0; c < n.length; c++) {\n sub_array = [n[c].list_weight, n[c]];\n array_to_sort_over.push(sub_array);\n }\n DAYTOOL.state.plans = sort_items(array_to_sort_over, \"dsc\");\n daytool_plan.plan_count = DAYTOOL.state.plans.length;\n current_entity_count += daytool_plan.plan_count;\n });\n await feedsService.getAll().then((n: daytool_feed[]) => {\n var array_to_sort_over = [];\n var sub_array = [];\n for (var c = 0; c < n.length; c++) {\n sub_array = [n[c].list_weight, n[c]];\n array_to_sort_over.push(sub_array);\n }\n DAYTOOL.state.feeds = sort_items(array_to_sort_over, \"dsc\");\n daytool_feed.feed_count = DAYTOOL.state.feeds.length;\n current_entity_count += daytool_feed.feed_count;\n });\n await eventsService.getAll().then((n: daytool_event[]) => {\n var array_to_sort_over = [];\n var sub_array = [];\n for (var c = 0; c < n.length; c++) {\n sub_array = [n[c].list_weight, n[c]];\n array_to_sort_over.push(sub_array);\n }\n DAYTOOL.state.events = sort_items(array_to_sort_over, \"dsc\");\n daytool_event.event_count = DAYTOOL.state.events.length;\n current_entity_count += daytool_event.event_count;\n });\n await casesService.getAll().then((n: daytool_case[]) => {\n var array_to_sort_over = [];\n var sub_array = [];\n for (var c = 0; c < n.length; c++) {\n sub_array = [n[c].list_weight, n[c]];\n array_to_sort_over.push(sub_array);\n }\n DAYTOOL.state.cases = sort_items(array_to_sort_over, \"dsc\");\n daytool_case.case_count = DAYTOOL.state.cases.length;\n current_entity_count += daytool_case.case_count;\n });\n await personsService.getAll().then((n: daytool_person[]) => {\n var array_to_sort_over = [];\n var sub_array = [];\n for (var c = 0; c < n.length; c++) {\n sub_array = [n[c].list_weight, n[c]];\n array_to_sort_over.push(sub_array);\n }\n DAYTOOL.state.persons = sort_items(array_to_sort_over, \"dsc\");\n daytool_person.person_count = DAYTOOL.state.persons.length;\n current_entity_count += daytool_person.person_count;\n });\n await calendarsService.getAll().then((n: daytool_calendar[]) => {\n DAYTOOL.calendars = n;\n });\n await metadataService.getLatest().then((n: daytool_metadata) => {\n if (n != null) {\n DAYTOOL.metadata = n;\n } else {\n var new_metadata = new daytool_metadata();\n new_metadata.current_session_start_timestamp = new Date().getTime();\n DAYTOOL.metadata = new_metadata;\n }\n });\n await clipboardService.getLatest().then((n: daytool_clipboard) => {\n if (n != null) {\n DAYTOOL.clipboard = n;\n } else {\n clipboardService.add(DAYTOOL.clipboard);\n }\n });\n // importsService.getLatest().then((n:daytool_metadata) => {\n // DAYTOOL.metadata = n;\n // });\n}\n\n// Change Types: 0,1,2,3 -> \"Creation\", \"Clipboard\", \"Field Update\", \"Deletion\" - our version of CRUD\nconst DAYTOOL_CHANGE_TYPES = [\n \"Creation\",\n \"Clipboard\",\n \"Field Update\",\n \"Deletion\",\n];\nexport class daytool_change {\n changed_entity: daytool_entity;\n change_type_id: string;\n changed_entity_field: string;\n changed_entity_previous_value: string;\n changed_entity_new_value: string;\n}\n\nexport class daytool_metadata {\n last_session_end_timestamp: number;\n current_session_start_timestamp: number;\n notifications: daytool_notification[] = [];\n upload_history: daytool_upload_history = new daytool_upload_history();\n import_history: daytool_import_history = new daytool_import_history();\n constructor() {\n this.current_session_start_timestamp = new Date().getTime();\n }\n}\n\nexport class daytool_state {\n plans: daytool_plan[] = [];\n events: daytool_event[] = [];\n cases: daytool_case[] = [];\n needs: daytool_need[] = [];\n goals: daytool_goal[] = [];\n stats: daytool_stat[] = [];\n persons: daytool_person[] = [];\n checkin: daytool_checkin[] = [];\n notes: daytool_note[] = [];\n google_events: daytool_event[] = [];\n microsoft_events: daytool_event[] = [];\n registry: daytool_change[] = [];\n feeds: daytool_feed[];\n}\n\nexport const DAYTOOL = new daytool();\n"]}