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AAuG;AACvG,4GAA4G;AAC5G,mDAAmD;AACnD,sEAAsE;AACtE,4DAA4D;AAC5D,wGAAwG;AACxG,4EAA4E;AAC5E,oBAAoB;AACpB,kBAAkB;AAClB,gBAAgB;AAEhB,cAAc;AACd,qEAAqE;AAGrE,wDAAwD;AAExD,gGAAgG;AAEhG,4BAA4B;AAC5B,0DAA0D;AAC1D,yEAAyE;AACzE,uEAAuE;AACvE,8EAA8E;AAC9E,qFAAqF;AACrF,iBAAiB;AAEjB,uEAAuE;AACvE,uEAAuE;AACvE,kIAAkI;AAClI,wDAAwD;AACxD,+BAA+B;AAC/B,sBAAsB;AACtB,kBAAkB;AAClB,cAAc;AACd,UAAU;AACV,MAAM;AACN,oCAAoC;AACpC,IAAI;AAEJ,8BAA8B;AAC9B,uCAAuC;AACvC,kHAAkH;AAClH,uDAAuD;AACvD,oCAAoC;AACpC,IAAI;AAEJ,6BAA6B;AAC7B,uCAAuC;AACvC,0HAA0H;AAC1H,uDAAuD;AACvD,oCAAoC;AACpC,IAAI;AAEJ,oCAAoC;AACpC,gDAAgD;AAChD,kHAAkH;AAClH,uDAAuD;AACvD,oCAAoC;AACpC,IAAI;AAEJ,qCAAqC;AACrC,gDAAgD;AAChD,mHAAmH;AACnH,uDAAuD;AACvD,oCAAoC;AACpC,IAAI;AAEJ,iDAAiD;AACjD,uDAAuD;AACvD,kCAAkC;AAClC,iEAAiE;AACjE,kFAAkF;AAClF,MAAM;AACN,gCAAgC;AAChC,IAAI","file":"daytool_nav.js","sourcesContent":["import {input__clipboard_date, MONTHS_ABV } from \"../constants.js\";\nimport { daytool_printer } from \"./UI/daytool_printer.js\";\n\n// Note: this is used via the DAYTOOL object - see daytool.ts line 119\n\nexport enum DAYTOOL_ENTITY_TYPE {\n Events = 'events',\n Needs = 'needs',\n Goals = 'goals',\n Stats = 'stats',\n Feeds = 'feeds',\n Cases = 'cases',\n Plans = 'plans',\n Notes = 'notes',\n Persons = 'persons'\n}\n\nexport class daytool_nav {\n query: string;\n date: string;\n constructor(\n query: string = \"\",\n ) {\n this.query = query;\n var urlParams = new URLSearchParams(query);\n\n // Date\n const dateRegex = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/;\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 var clipboard_date = `${yyyy}-${mm}-${dd}`;\n if (urlParams.get('d') &&\n dateRegex.test(urlParams.get('d')) ) {\n clipboard_date = urlParams.get('d');\n }\n var date_bullet = document.querySelector('.date_bullet');\n var new_date = new Date(clipboard_date);\n date_bullet.querySelector('.month').innerHTML = MONTHS_ABV[new_date.getUTCMonth()];\n date_bullet.querySelector('.date').innerHTML = new_date.getUTCDate().toString();\n date_bullet.querySelector('.year').innerHTML = new_date.getUTCFullYear().toString();\n input__clipboard_date.value = clipboard_date;\n daytool_printer.print_clipboard(clipboard_date);\n\n }\n}\n\n// run_query() {\n// // TODO: CREATE DAYTOOL FILTERS\n// var search_filter_input = document.getElementsByClassName('search_container')[0].getElementsByClassName('search_input')[0];\n// var search_filter_input_raw = search_filter_input.value;\n\n// // Then split by comma and space\n// var filter_string_split = split_filter_string(search_filter_input_raw);\n// var filter_scan_result: any[] = [];\n// // Iterate through all filter instructions\n// var current_entities = DAYTOOL.getEntityArrayByType(this.list);\n// for (var i = 0; i < current_entities.length; i++) {\n// filter_scan_result[i] = filter_basic_text(filter_string_split, current_entities[i].id,current_entities[i].type, filter_scan_result[i]);\n// if (filter_scan_result[i] != 1) {\n// filter_scan_result[i] = filter_creation_time(filter_string_split, current_entities[i].id, filter_scan_result[i]);\n// if (filter_scan_result[i] != 1) {\n// filter_scan_result[i] = filter_last_update_timestamp(filter_string_split, current_entities[i].id, filter_scan_result[i]);\n// if (filter_scan_result[i] != 1) {\n// filter_scan_result[i] = filter_daily_maximum(filter_string_split, current_entities[i].id, filter_scan_result[i]);\n// if (filter_scan_result[i] != 1) {\n// filter_scan_result[i] = filter_weekly_minimum(filter_string_split, current_entities[i].id, filter_scan_result[i]);\n// }\n// }\n// }\n// }\n// }\n// for (var j = 0; j < filter_scan_result.length; j++) {\n// if (filter_scan_result[j] == 1) {\n// this.entities.push(current_entities[j]);\n// }\n// }\n// }\n\n// function filter_basic_text(filter_string_split: string[], entity_id: number, entity_type: string, is_already_filtered: boolean) {\n// var current_filter_decision = is_already_filtered;\n// if (filter_string_split) {\n// if (is_already_filtered) {\n// // No need to do anything\n// } else {\n// var texts_to_filter_through:string[] = [];\n// var entity = DAYTOOL.getEntityByIdAndType(entity_id, entity_type);\n// // All cards by default have title\n// texts_to_filter_through.push(entity.title.at(-1));\n// // All cards by default have notes\n// for (var n = 0; n < DAYTOOL.getEntityArrayByType(DAYTOOL_ENTITY_TYPE.Notes).length; n++) {\n// var current_note = DAYTOOL.getEntityArrayByType(DAYTOOL_ENTITY_TYPE.Notes)[n];\n// if (current_note.links.length > 0) {\n// for (var l = 0; l < current_note.links.length; l++) {\n// var current_link = current_note.links[l];\n// if (current_link.entity_id == entity.id && current_link.entity_type == entity.type) {\n// texts_to_filter_through.push(current_note.note_string);\n// }\n// }\n// }\n\n// }\n// texts_to_filter_through.push(entity.description.at(-1));\n\n\n// // !! Card type specific basic text fields:\n\n// // Some types of cards have multiple additional basic text fields to search through\n\n// // Person cards\n// // if (card instanceof daytool_person_card) {\n// // texts_to_filter_through.push(card.entity.occupation);\n// // texts_to_filter_through.push(card.entity.location);\n// // texts_to_filter_through.push(card.entity.secondary_email);\n// // texts_to_filter_through.push(card.entity.secondary_phone_number);\n// // }\n\n// for (var t = 0; t < texts_to_filter_through.length; t++) {\n// for (var s = 0; s < filter_string_split.length; s++) {\n// if (texts_to_filter_through[t].toLowerCase().indexOf(filter_string_split[s].toString().toLowerCase()) > -1) {\n// current_filter_decision = true;\n// break;\n// }\n// }\n// }\n// }\n// }\n// return current_filter_decision;\n// }\n\n// // Creation Time Filtration\n// // For the following card types: All\n// function filter_creation_time(filter_string_split: string[], entity_id: number, is_already_filtered: boolean) {\n// var current_filter_decision = is_already_filtered;\n// return current_filter_decision;\n// }\n\n// // Last Updated Filtration\n// // For the following card types: All\n// function filter_last_update_timestamp(filter_string_split: string[], entity_id: number, is_already_filtered: boolean) {\n// var current_filter_decision = is_already_filtered;\n// return current_filter_decision;\n// }\n\n// // Daily Maximum Hours Filtration\n// // For the following card types: [Goal, Need]\n// function filter_daily_maximum(filter_string_split: string[], entity_id: number, is_already_filtered: boolean) {\n// var current_filter_decision = is_already_filtered;\n// return current_filter_decision;\n// }\n\n// // Weekly Minimum Hours Filtration\n// // For the following card types: [Goal, Need]\n// function filter_weekly_minimum(filter_string_split: string[], entity_id: number, is_already_filtered: boolean) {\n// var current_filter_decision = is_already_filtered;\n// return current_filter_decision;\n// }\n\n// function split_filter_string(string: string) {\n// var filter_string_split_comma = string.split(',');\n// var filter_string_split = [];\n// for (var c = 0; c < filter_string_split_comma.length; c++) {\n// filter_string_split[c] = filter_string_split_comma[c].split(' ');\n// }\n// return filter_string_split;\n// }"]}